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/amiga | |
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/amiga')
-rw-r--r-- | sys/arch/amiga/amiga/machdep.c | 6 | ||||
-rw-r--r-- | sys/arch/amiga/amiga/mem.c | 4 | ||||
-rw-r--r-- | sys/arch/amiga/amiga/pmap.c | 27 | ||||
-rw-r--r-- | sys/arch/amiga/amiga/vm_machdep.c | 8 |
4 files changed, 23 insertions, 22 deletions
diff --git a/sys/arch/amiga/amiga/machdep.c b/sys/arch/amiga/amiga/machdep.c index 794e44a9036..4986f0cd536 100644 --- a/sys/arch/amiga/amiga/machdep.c +++ b/sys/arch/amiga/amiga/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.48 2001/07/18 10:47:04 art Exp $ */ +/* $OpenBSD: machdep.c,v 1.49 2001/07/25 13:25:31 art Exp $ */ /* $NetBSD: machdep.c,v 1.95 1997/08/27 18:31:17 is Exp $ */ /* @@ -331,8 +331,8 @@ cpu_startup() */ for (i = 0; i < btoc(MSGBUFSIZE); i++) pmap_enter(pmap_kernel(), (vm_offset_t)msgbufp, - msgbufpa + i * PAGE_SIZE, VM_PROT_READ|VM_PROT_WRITE, TRUE, - VM_PROT_READ|VM_PROT_WRITE); + msgbufpa + i * PAGE_SIZE, VM_PROT_READ|VM_PROT_WRITE, + VM_PROT_READ|VM_PROT_WRITE|PMAP_WIRED); initmsgbuf((caddr_t)msgbufp, round_page(MSGBUFSIZE)); /* diff --git a/sys/arch/amiga/amiga/mem.c b/sys/arch/amiga/amiga/mem.c index 73f814ae719..bc83cdfba96 100644 --- a/sys/arch/amiga/amiga/mem.c +++ b/sys/arch/amiga/amiga/mem.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mem.c,v 1.13 2001/06/27 03:54:13 art Exp $ */ +/* $OpenBSD: mem.c,v 1.14 2001/07/25 13:25:31 art Exp $ */ /* $NetBSD: mem.c,v 1.18 1997/02/02 07:17:14 thorpej Exp $ */ /* @@ -146,7 +146,7 @@ mmrw(dev, uio, flags) #endif pmap_enter(pmap_kernel(), (vm_offset_t)vmmap, trunc_page(v), uio->uio_rw == UIO_READ ? - VM_PROT_READ : VM_PROT_WRITE, TRUE, 0); + VM_PROT_READ : VM_PROT_WRITE, PMAP_WIRED); o = uio->uio_offset & PGOFSET; c = min(uio->uio_resid, (int)(NBPG - o)); error = uiomove((caddr_t)vmmap + o, c, uio); diff --git a/sys/arch/amiga/amiga/pmap.c b/sys/arch/amiga/amiga/pmap.c index ae23ce73391..452fee199aa 100644 --- a/sys/arch/amiga/amiga/pmap.c +++ b/sys/arch/amiga/amiga/pmap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pmap.c,v 1.33 2001/07/18 10:47:04 art Exp $ */ +/* $OpenBSD: pmap.c,v 1.34 2001/07/25 13:25:31 art Exp $ */ /* $NetBSD: pmap.c,v 1.68 1999/06/19 19:44:09 is Exp $ */ /*- @@ -769,7 +769,7 @@ pmap_map(virt, start, end, prot) prot); #endif while (start < end) { - pmap_enter(pmap_kernel(), virt, start, prot, FALSE, 0); + pmap_enter(pmap_kernel(), virt, start, prot, 0); virt += PAGE_SIZE; start += PAGE_SIZE; } @@ -1110,28 +1110,26 @@ pmap_protect(pmap, sva, eva, prot) */ extern int kernel_copyback; -void -pmap_enter(pmap, va, pa, prot, wired, access_type) +int +pmap_enter(pmap, va, pa, prot, flags) pmap_t pmap; vaddr_t va; paddr_t pa; vm_prot_t prot; - boolean_t wired; - vm_prot_t access_type; + int flags; { u_int *pte; int npte; paddr_t opa; boolean_t cacheable = TRUE; boolean_t checkpv = TRUE; + boolean_t wired = (flags & PMAP_WIRED) != 0; #ifdef DEBUG if (pmapdebug & (PDB_FOLLOW|PDB_ENTER)) printf("pmap_enter(%p, %lx, %lx, %x, %x)\n", pmap, va, pa, prot, wired); #endif - if (pmap == NULL) - return; #ifdef DEBUG if (pmap == pmap_kernel()) @@ -1379,6 +1377,8 @@ validate: pmap_check_wiring("enter", trunc_page((vaddr_t)pmap_pte(pmap, va))); } #endif + + return (KERN_SUCCESS); } /* @@ -2397,8 +2397,8 @@ pmap_enter_ptpage(pmap, va) kpt_used_list = kpt; ptpa = kpt->kpt_pa; bzero((char *)kpt->kpt_va, NBPG); - pmap_enter(pmap, va, ptpa, VM_PROT_DEFAULT, TRUE, - VM_PROT_DEFAULT); + pmap_enter(pmap, va, ptpa, VM_PROT_DEFAULT, + VM_PROT_DEFAULT|PMAP_WIRED); #if defined(M68060) if (machineid & AMIGA_68060) { pmap_changebit(ptpa, PG_CCB, 0); @@ -2599,7 +2599,8 @@ pmap_virtual_space(vstartp, vendp) void pmap_kenter_pa(vaddr_t va, paddr_t pa, vm_prot_t prot) { - pmap_enter(pmap_kernel(), va, pa, prot, 1, VM_PROT_READ|VM_PROT_WRITE); + pmap_enter(pmap_kernel(), va, pa, prot, + VM_PROT_READ|VM_PROT_WRITE|PMAP_WIRED); } void @@ -2609,8 +2610,8 @@ pmap_kenter_pgs(vaddr_t va, struct vm_page **pgs, int 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, - 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/amiga/amiga/vm_machdep.c b/sys/arch/amiga/amiga/vm_machdep.c index 259075d7924..c3f29b2f3d6 100644 --- a/sys/arch/amiga/amiga/vm_machdep.c +++ b/sys/arch/amiga/amiga/vm_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vm_machdep.c,v 1.20 2001/06/27 03:54:13 art Exp $ */ +/* $OpenBSD: vm_machdep.c,v 1.21 2001/07/25 13:25:31 art Exp $ */ /* $NetBSD: vm_machdep.c,v 1.30 1997/05/19 10:14:50 veego Exp $ */ /* @@ -191,8 +191,8 @@ pagemove(from, to, size) pmap_remove(pmap_kernel(), (vm_offset_t)from, (vm_offset_t)from + PAGE_SIZE); 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); from += PAGE_SIZE; to += PAGE_SIZE; size -= PAGE_SIZE; @@ -380,7 +380,7 @@ vmapbuf(bp, len) if (pmap_extract(upmap, uva, &pa) == FALSE) panic("vmapbuf: null page frame"); pmap_enter(kpmap, kva, pa, VM_PROT_READ|VM_PROT_WRITE, - TRUE, 0); + PMAP_WIRED); uva += PAGE_SIZE; kva += PAGE_SIZE; len -= PAGE_SIZE; |