diff options
author | Artur Grabowski <art@cvs.openbsd.org> | 2001-06-08 08:09:45 +0000 |
---|---|---|
committer | Artur Grabowski <art@cvs.openbsd.org> | 2001-06-08 08:09:45 +0000 |
commit | 95da2243c76760307b218cb7f05645e68a73e8af (patch) | |
tree | 594a78dc6e16ba4f07e3c1bc9c44def6966cf19e /sys/arch/hppa | |
parent | 0579d34f9bf07b4a6bfebb51a83de3ac8356c01f (diff) |
Change the paddr_t pmap_extract(struct pmap *, vaddr_t) interface to
boolean_t pmap_extract(struct pmap *, vaddr_t, paddr_t *).
Matches NetBSD. Tested by various people on various platforms.
Diffstat (limited to 'sys/arch/hppa')
-rw-r--r-- | sys/arch/hppa/hppa/pmap.c | 26 | ||||
-rw-r--r-- | sys/arch/hppa/hppa/vm_machdep.c | 9 |
2 files changed, 18 insertions, 17 deletions
diff --git a/sys/arch/hppa/hppa/pmap.c b/sys/arch/hppa/hppa/pmap.c index 39df5f46d6f..5a1062f3eb3 100644 --- a/sys/arch/hppa/hppa/pmap.c +++ b/sys/arch/hppa/hppa/pmap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pmap.c,v 1.44 2001/05/09 15:31:24 art Exp $ */ +/* $OpenBSD: pmap.c,v 1.45 2001/06/08 08:08:48 art Exp $ */ /* * Copyright (c) 1998-2001 Michael Shalayeff @@ -1299,17 +1299,19 @@ pmap_unwire(pmap, va) } /* - * pmap_extract(pmap, va) - * returns the physical address corrsponding to the - * virtual address specified by pmap and va if the - * virtual address is mapped and 0 if it is not. + * pmap_extract(pmap, va, pap) + * fills in the physical address corrsponding to the + * virtual address specified by pmap and va into the + * storage pointed to by pap and returns TRUE if the + * virtual address is mapped. returns FALSE in not mapped. */ -paddr_t -pmap_extract(pmap, va) +boolean_t +pmap_extract(pmap, va, pap) pmap_t pmap; vaddr_t va; + paddr_t *pap; { - register struct pv_entry *pv; + struct pv_entry *pv; va = hppa_trunc_page(va); #ifdef PMAPDEBUG @@ -1318,9 +1320,11 @@ pmap_extract(pmap, va) #endif if (!(pv = pmap_find_va(pmap_sid(pmap, va), va & ~PGOFSET))) - return(0); - else - return tlbptob(pv->pv_tlbpage) + (va & PGOFSET); + return (FALSE); + else { + *pap = tlbptob(pv->pv_tlbpage) + (va & PGOFSET); + return (TRUE); + } } /* diff --git a/sys/arch/hppa/hppa/vm_machdep.c b/sys/arch/hppa/hppa/vm_machdep.c index 13b4339ac6e..6c253d533f7 100644 --- a/sys/arch/hppa/hppa/vm_machdep.c +++ b/sys/arch/hppa/hppa/vm_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vm_machdep.c,v 1.21 2001/05/06 00:45:49 art Exp $ */ +/* $OpenBSD: vm_machdep.c,v 1.22 2001/06/08 08:08:49 art Exp $ */ /* * Copyright (c) 1999-2000 Michael Shalayeff @@ -107,7 +107,7 @@ pagemove(from, to, size) register paddr_t pa; while (size > 0) { - pa = pmap_extract(pmap_kernel(), (vaddr_t)from); + pmap_extract(pmap_kernel(), (vaddr_t)from, &pa); pmap_remove(pmap_kernel(), (vaddr_t)from, (vaddr_t)from + PAGE_SIZE); pmap_enter(pmap_kernel(), (vaddr_t)to, pa, @@ -345,11 +345,8 @@ vmapbuf(bp, len) /* not needed, thanks to PMAP_PREFER() */ /* fdcache(vm_map_pmap(map)->pmap_space, addr, PAGE_SIZE); */ - pa = pmap_extract(vm_map_pmap(map), addr); -#ifdef DIAGNOSTIC - if (pa == 0) + if (pmap_extract(vm_map_pmap(map), addr, &pa) == FALSE) panic("vmapbuf: null page frame"); -#endif pmap_enter(vm_map_pmap(phys_map), kva, pa, VM_PROT_READ|VM_PROT_WRITE, TRUE, 0); |