summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2004-01-29 12:00:33 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2004-01-29 12:00:33 +0000
commit862d95a85cd356a57dc937c7ff26046eabe4bd01 (patch)
tree033c2371449a29896debfd2893d3650dc5c45d48 /sys
parentbc1e4fe69bfb558a4402368d49843230a8010975 (diff)
Don't assume 1:1 mapping for bus_spac anymore.
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/mvmeppc/mvmeppc/bus_space.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/sys/arch/mvmeppc/mvmeppc/bus_space.c b/sys/arch/mvmeppc/mvmeppc/bus_space.c
index 9ab3036642c..5c3928a7e77 100644
--- a/sys/arch/mvmeppc/mvmeppc/bus_space.c
+++ b/sys/arch/mvmeppc/mvmeppc/bus_space.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bus_space.c,v 1.5 2002/10/12 01:09:43 krw Exp $ */
+/* $OpenBSD: bus_space.c,v 1.6 2004/01/29 12:00:32 miod Exp $ */
/* $NetBSD: bus_space.c,v 1.4 2001/06/15 15:50:05 nonaka Exp $ */
/*-
@@ -44,6 +44,8 @@
#include <sys/extent.h>
#include <sys/mbuf.h>
+#include <uvm/uvm_extern.h>
+
#include <machine/bus.h>
static int prep_memio_map(bus_space_tag_t, bus_addr_t, bus_size_t, int,
@@ -130,12 +132,11 @@ prep_memio_map(t, bpa, size, flags, bshp)
* Before we go any further, let's make sure that this
* region is available.
*/
- error = extent_alloc_region(ex, bpa, size,
- EX_NOWAIT | (ioport_malloc_safe ? EX_MALLOCOK : 0));
- if (error)
+ if ((error = extent_alloc_region(ex, bpa, size,
+ EX_NOWAIT | (ioport_malloc_safe ? EX_MALLOCOK : 0))) != 0)
return (error);
- *bshp = t->pbs_base + bpa;
+ *bshp = (bus_space_handle_t)mapiodev(t->pbs_base + bpa, size);
return (0);
}
@@ -159,7 +160,8 @@ prep_memio_unmap(t, bsh, size)
else
panic("prep_memio_unmap: bad bus space tag");
- bpa = bsh - t->pbs_base;
+ pmap_extract(pmap_kernel(), (vaddr_t)bsh, (paddr_t *)&bpa);
+ unmapiodev((void *)bsh, size);
if (extent_free(ex, bpa, size,
EX_NOWAIT | (ioport_malloc_safe ? EX_MALLOCOK : 0))) {