diff options
author | Artur Grabowski <art@cvs.openbsd.org> | 2001-07-25 13:25:34 +0000 |
---|---|---|
committer | Artur Grabowski <art@cvs.openbsd.org> | 2001-07-25 13:25:34 +0000 |
commit | 9b5d0ac364b4502c9f4962efc3b9cf762eeb8a23 (patch) | |
tree | c5b76dbc032ac625cb87376504029b7b8c6c8f71 /sys/arch/powerpc | |
parent | 2aa44ff1a290aa08d7d6659ac7350bb6d3efb06c (diff) |
Change the pmap_enter interface to merge access_type and the wired boolean
and arbitrary flags into one argument.
One new flag is PMAP_CANFAIL that tells pmap_enter that it can fail if there
are not enough resources to satisfy the request. If this flag is not passed,
pmap_enter should panic as it should have done before this change (XXX - many
pmaps are still not doing that).
Only i386 and alpha implement CANFAIL for now.
Includes uvm updates from NetBSD.
Diffstat (limited to 'sys/arch/powerpc')
-rw-r--r-- | sys/arch/powerpc/powerpc/dma.c | 6 | ||||
-rw-r--r-- | sys/arch/powerpc/powerpc/machdep.c | 6 | ||||
-rw-r--r-- | sys/arch/powerpc/powerpc/ofw_machdep.c | 4 | ||||
-rw-r--r-- | sys/arch/powerpc/powerpc/pmap.c | 17 | ||||
-rw-r--r-- | sys/arch/powerpc/powerpc/vm_machdep.c | 8 |
5 files changed, 21 insertions, 20 deletions
diff --git a/sys/arch/powerpc/powerpc/dma.c b/sys/arch/powerpc/powerpc/dma.c index 00d491bfe3a..f9b8bfae9c7 100644 --- a/sys/arch/powerpc/powerpc/dma.c +++ b/sys/arch/powerpc/powerpc/dma.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dma.c,v 1.6 2001/06/27 04:37:20 art Exp $ */ +/* $OpenBSD: dma.c,v 1.7 2001/07/25 13:25:32 art Exp $ */ /* $NetBSD: machdep.c,v 1.214 1996/11/10 03:16:17 thorpej Exp $ */ /*- @@ -374,8 +374,8 @@ _dmamem_map(t, segs, nsegs, size, kvap, flags) if (size == 0) panic("_bus_dmamem_map: size botch"); pmap_enter(pmap_kernel(), va, addr, - VM_PROT_READ | VM_PROT_WRITE, TRUE, - VM_PROT_READ | VM_PROT_WRITE); + VM_PROT_READ | VM_PROT_WRITE, + VM_PROT_READ | VM_PROT_WRITE | PMAP_WIRED); } } diff --git a/sys/arch/powerpc/powerpc/machdep.c b/sys/arch/powerpc/powerpc/machdep.c index 27b45f693a5..cc837733129 100644 --- a/sys/arch/powerpc/powerpc/machdep.c +++ b/sys/arch/powerpc/powerpc/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.72 2001/07/09 02:14:05 mickey Exp $ */ +/* $OpenBSD: machdep.c,v 1.73 2001/07/25 13:25:33 art Exp $ */ /* $NetBSD: machdep.c,v 1.4 1996/10/16 19:33:11 ws Exp $ */ /* @@ -1213,7 +1213,7 @@ bus_mem_add_mapping(bpa, size, cacheable, bshp) #else pmap_enter(pmap_kernel(), vaddr, spa, #endif - VM_PROT_READ | VM_PROT_WRITE, TRUE, 0/* XXX */); + VM_PROT_READ | VM_PROT_WRITE, PMAP_WIRED /* XXX */); spa += NBPG; vaddr += NBPG; } @@ -1272,7 +1272,7 @@ mapiodev(pa, len) #else pmap_enter(pmap_kernel(), vaddr, spa, #endif - VM_PROT_READ | VM_PROT_WRITE, TRUE, 0/* XXX */); + VM_PROT_READ | VM_PROT_WRITE, PMAP_WIRED/* XXX */); spa += NBPG; vaddr += NBPG; } diff --git a/sys/arch/powerpc/powerpc/ofw_machdep.c b/sys/arch/powerpc/powerpc/ofw_machdep.c index 8cd4e945947..76e547fc54b 100644 --- a/sys/arch/powerpc/powerpc/ofw_machdep.c +++ b/sys/arch/powerpc/powerpc/ofw_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ofw_machdep.c,v 1.22 2001/06/24 23:29:35 drahn Exp $ */ +/* $OpenBSD: ofw_machdep.c,v 1.23 2001/07/25 13:25:33 art Exp $ */ /* $NetBSD: ofw_machdep.c,v 1.1 1996/09/30 16:34:50 ws Exp $ */ /* @@ -187,7 +187,7 @@ restore_ofw_mapping() continue; while (size > 0) { - pmap_enter(&ofw_pmap, va, pa, VM_PROT_ALL, 1, 0); + pmap_enter(&ofw_pmap, va, pa, VM_PROT_ALL, PMAP_WIRED); pa += NBPG; va += NBPG; size -= NBPG; diff --git a/sys/arch/powerpc/powerpc/pmap.c b/sys/arch/powerpc/powerpc/pmap.c index 44c104b4edf..6e85bec52d7 100644 --- a/sys/arch/powerpc/powerpc/pmap.c +++ b/sys/arch/powerpc/powerpc/pmap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pmap.c,v 1.36 2001/07/18 10:47:05 art Exp $ */ +/* $OpenBSD: pmap.c,v 1.37 2001/07/25 13:25:33 art Exp $ */ /* $NetBSD: pmap.c,v 1.1 1996/09/30 16:34:52 ws Exp $ */ /* @@ -1170,13 +1170,12 @@ pmap_remove_pv(pm, pteidx, va, pte_lo) /* * Insert physical page at pa into the given pmap at virtual address va. */ -void -pmap_enter(pm, va, pa, prot, wired, access_type) +int +pmap_enter(pm, va, pa, prot, flags) struct pmap *pm; vm_offset_t va, pa; vm_prot_t prot; - int wired; - vm_prot_t access_type; + int flags; { sr_t sr; int idx, s; @@ -1233,7 +1232,7 @@ pmap_enter(pm, va, pa, prot, wired, access_type) */ if (pte_insert(idx, &pte)) { splx(s); - return; + return (KERN_SUCCESS); } /* @@ -1245,6 +1244,8 @@ pmap_enter(pm, va, pa, prot, wired, access_type) po->po_pte = pte; LIST_INSERT_HEAD(potable + idx, po, po_list); splx(s); + + return (KERN_SUCCESS); } void @@ -1253,7 +1254,7 @@ pmap_kenter_pa(va, pa, prot) paddr_t pa; vm_prot_t prot; { - pmap_enter(pmap_kernel(), va, pa, prot, 1, 0); + pmap_enter(pmap_kernel(), va, pa, prot, PMAP_WIRED); } void @@ -1266,7 +1267,7 @@ pmap_kenter_pgs(va, pgs, npgs) for (i = 0; i < npgs; i++, va += PAGE_SIZE) { pmap_enter(pmap_kernel(), va, VM_PAGE_TO_PHYS(pgs[i]), - VM_PROT_READ|VM_PROT_WRITE, 1, 0); + VM_PROT_READ|VM_PROT_WRITE, PMAP_WIRED); } } diff --git a/sys/arch/powerpc/powerpc/vm_machdep.c b/sys/arch/powerpc/powerpc/vm_machdep.c index 93e7a512dc3..f1980b01929 100644 --- a/sys/arch/powerpc/powerpc/vm_machdep.c +++ b/sys/arch/powerpc/powerpc/vm_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vm_machdep.c,v 1.20 2001/07/09 02:14:06 mickey Exp $ */ +/* $OpenBSD: vm_machdep.c,v 1.21 2001/07/25 13:25:33 art Exp $ */ /* $NetBSD: vm_machdep.c,v 1.1 1996/09/30 16:34:57 ws Exp $ */ /* @@ -156,8 +156,8 @@ pagemove(from, to, size) pmap_extract(pmap_kernel(), va, &pa); pmap_remove(pmap_kernel(), va, va + NBPG); pmap_enter(pmap_kernel(), (vm_offset_t)to, pa, - VM_PROT_READ | VM_PROT_WRITE, 1, - VM_PROT_READ | VM_PROT_WRITE); + VM_PROT_READ | VM_PROT_WRITE, + VM_PROT_READ | VM_PROT_WRITE | PMAP_WIRED); va += NBPG; to += NBPG; } @@ -244,7 +244,7 @@ vmapbuf(bp, len) for (; len > 0; len -= NBPG) { pmap_extract(vm_map_pmap(&bp->b_proc->p_vmspace->vm_map), faddr, &pa); pmap_enter(vm_map_pmap(phys_map), taddr, pa, - VM_PROT_READ | VM_PROT_WRITE, 1, 0); + VM_PROT_READ | VM_PROT_WRITE, PMAP_WIRED); faddr += NBPG; taddr += NBPG; } |