summaryrefslogtreecommitdiff
path: root/sys/arch/mvme88k
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2004-05-23 20:53:19 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2004-05-23 20:53:19 +0000
commit31d4c9fe0969db7e1ef9f436837405f3ac18201b (patch)
treeb05a755f85b40fabb2e90805218cbd6e90a4d22d /sys/arch/mvme88k
parentab311ceb3d3e6fe56e53c97387992bc633071569 (diff)
Simplify iomap_mapin().
Diffstat (limited to 'sys/arch/mvme88k')
-rw-r--r--sys/arch/mvme88k/mvme88k/vm_machdep.c22
1 files changed, 5 insertions, 17 deletions
diff --git a/sys/arch/mvme88k/mvme88k/vm_machdep.c b/sys/arch/mvme88k/mvme88k/vm_machdep.c
index 0b747fef885..1800d77cd06 100644
--- a/sys/arch/mvme88k/mvme88k/vm_machdep.c
+++ b/sys/arch/mvme88k/mvme88k/vm_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vm_machdep.c,v 1.62 2004/05/23 20:52:16 miod Exp $ */
+/* $OpenBSD: vm_machdep.c,v 1.63 2004/05/23 20:53:18 miod Exp $ */
/*
* Copyright (c) 1998 Steve Murphree, Jr.
@@ -345,9 +345,8 @@ iomap_mapin(paddr_t pa, psize_t len, boolean_t canwait)
if (len == 0)
return NULL;
- ppa = pa;
- off = (u_long)ppa & PGOFSET;
-
+ ppa = trunc_page(pa);
+ off = pa & PGOFSET;
len = round_page(off + len);
s = splhigh();
@@ -360,15 +359,8 @@ iomap_mapin(paddr_t pa, psize_t len, boolean_t canwait)
cmmu_flush_tlb(cpu_number(), 1, iova, len); /* necessary? */
- ppa = trunc_page(ppa);
-
-#ifndef NEW_MAPPING
tva = iova;
-#else
- tva = ppa;
-#endif
-
- while (len>0) {
+ while (len != 0) {
pmap_enter(vm_map_pmap(iomap_map), tva, ppa,
VM_PROT_WRITE | VM_PROT_READ,
VM_PROT_WRITE | VM_PROT_READ | PMAP_WIRED);
@@ -377,12 +369,8 @@ iomap_mapin(paddr_t pa, psize_t len, boolean_t canwait)
ppa += PAGE_SIZE;
}
pmap_update(pmap_kernel());
-#ifndef NEW_MAPPING
- return (iova + off);
-#else
- return (pa + off);
-#endif
+ return (iova + off);
}
/*