Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/vax Add bus_space_mmap().
details: https://anonhg.NetBSD.org/src/rev/109daeb29292
branches: trunk
changeset: 515114:109daeb29292
user: ragge <ragge%NetBSD.org@localhost>
date: Sun Sep 16 20:39:02 2001 +0000
description:
Add bus_space_mmap().
diffstat:
sys/arch/vax/include/bus.h | 11 ++++++++++-
sys/arch/vax/vax/bus_mem.c | 16 +++++++++++++---
2 files changed, 23 insertions(+), 4 deletions(-)
diffs (66 lines):
diff -r 8818b0ceb87e -r 109daeb29292 sys/arch/vax/include/bus.h
--- a/sys/arch/vax/include/bus.h Sun Sep 16 19:26:12 2001 +0000
+++ b/sys/arch/vax/include/bus.h Sun Sep 16 20:39:02 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: bus.h,v 1.17 2001/07/19 15:32:19 thorpej Exp $ */
+/* $NetBSD: bus.h,v 1.18 2001/09/16 20:39:04 ragge Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998, 2001 The NetBSD Foundation, Inc.
@@ -127,6 +127,8 @@
bus_addr_t *, bus_space_handle_t *));
void (*vbs_free) __P((void *, bus_space_handle_t,
bus_size_t));
+ /* mmap bus space for user */
+ paddr_t (*vbs_mmap)(void *, bus_addr_t, off_t, int, int);
};
/*
@@ -192,6 +194,13 @@
(*(t)->vbs_free)((t)->vbs_cookie, (h), (s))
/*
+ * Mmap bus space for a user application.
+ */
+#define bus_space_mmap(t, a, o, p, f) \
+ (*(t)->vbs_mmap)((t)->vbs_cookie, (a), (o), (p), (f))
+
+
+/*
* u_intN_t bus_space_read_N __P((bus_space_tag_t tag,
* bus_space_handle_t bsh, bus_size_t offset));
*
diff -r 8818b0ceb87e -r 109daeb29292 sys/arch/vax/vax/bus_mem.c
--- a/sys/arch/vax/vax/bus_mem.c Sun Sep 16 19:26:12 2001 +0000
+++ b/sys/arch/vax/vax/bus_mem.c Sun Sep 16 20:39:02 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: bus_mem.c,v 1.8 2000/06/29 07:14:23 mrg Exp $ */
+/* $NetBSD: bus_mem.c,v 1.9 2001/09/16 20:39:02 ragge Exp $ */
/*
* Copyright (c) 1998 Matt Thomas
* All rights reserved.
@@ -120,12 +120,22 @@
{
panic("vax_mem_bus_free not implemented");
}
-
+
+static paddr_t
+vax_mem_bus_space_mmap(void *v, bus_addr_t addr, off_t off, int prot, int flags)
+{
+ bus_addr_t rv;
+
+ rv = addr + off;
+ return btop(rv);
+}
+
struct vax_bus_space vax_mem_bus_space = {
NULL,
vax_mem_bus_space_map,
vax_mem_bus_space_unmap,
vax_mem_bus_space_subregion,
vax_mem_bus_space_alloc,
- vax_mem_bus_space_free
+ vax_mem_bus_space_free,
+ vax_mem_bus_space_mmap,
};
Home |
Main Index |
Thread Index |
Old Index