diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2004-09-17 19:28:06 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2004-09-17 19:28:06 +0000 |
commit | 5989f5a06769dd25d57917f8298a9ed254db1781 (patch) | |
tree | 493a7722a6c91f7277b07d1a81ef55c3014fa8ea | |
parent | 37f2204d0d07e6d4c2940b86430d865cf839d483 (diff) |
Now that we can check for pmap_extract() failure properly, do so.
-rw-r--r-- | sys/arch/mips64/mips64/busdma.c | 11 | ||||
-rw-r--r-- | sys/arch/mips64/mips64/vm_machdep.c | 10 |
2 files changed, 13 insertions, 8 deletions
diff --git a/sys/arch/mips64/mips64/busdma.c b/sys/arch/mips64/mips64/busdma.c index 659b3da0a25..d6c5a532f9e 100644 --- a/sys/arch/mips64/mips64/busdma.c +++ b/sys/arch/mips64/mips64/busdma.c @@ -1,4 +1,4 @@ -/* $OpenBSD: busdma.c,v 1.4 2004/08/10 20:15:47 deraadt Exp $ */ +/* $OpenBSD: busdma.c,v 1.5 2004/09/17 19:28:05 miod Exp $ */ /* * Copyright (c) 2003-2004 Opsycon AB (www.opsycon.se / www.opsycon.com) @@ -140,7 +140,10 @@ _dmamap_load(t, map, buf, buflen, p, flags) /* * Get the physical address for this segment. */ - pmap_extract(pmap, (vaddr_t)vaddr, (paddr_t *)&curaddr); + if (pmap_extract(pmap, (vaddr_t)vaddr, (paddr_t *)&curaddr) == + FALSE) + panic("_dmapmap_load: pmap_extract(%x, %x) failed!", + pmap, vaddr); /* * Compute the segment size, and adjust counts. @@ -229,7 +232,9 @@ _dmamap_load_mbuf(t, map, m, flags) incr = min(buflen, NBPG); buflen -= incr; - (void) pmap_extract(pmap_kernel(), vaddr, &pa); + if (pmap_extract(pmap_kernel(), vaddr, &pa) == FALSE) + panic("_dmamap_load_mbuf: pmap_extract(%x, %x) failed!", + pmap_kernel(), vaddr); pa += t->dma_offs; if (i > 0 && pa == (map->dm_segs[i-1].ds_addr + map->dm_segs[i-1].ds_len) diff --git a/sys/arch/mips64/mips64/vm_machdep.c b/sys/arch/mips64/mips64/vm_machdep.c index 9c8eb5dee54..f24eb7e3d90 100644 --- a/sys/arch/mips64/mips64/vm_machdep.c +++ b/sys/arch/mips64/mips64/vm_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vm_machdep.c,v 1.3 2004/08/10 20:28:13 deraadt Exp $ */ +/* $OpenBSD: vm_machdep.c,v 1.4 2004/09/17 19:28:05 miod Exp $ */ /* * Copyright (c) 1988 University of Utah. * Copyright (c) 1992, 1993 @@ -261,10 +261,10 @@ vmapbuf(bp, len) bp->b_data = (caddr_t) (kva + off); while (sz > 0) { - pmap_extract(pmap, uva, &pa); - if (pa == 0) { - panic("vmapbuf: null page frame"); - } + if (pmap_extract(pmap, uva, &pa) == FALSE) + panic("vmapbuf: pmap_extract(%x, %x) failed!", + pmap, uva); + pmap_enter(vm_map_pmap(phys_map), kva, trunc_page(pa), VM_PROT_READ|VM_PROT_WRITE, PMAP_WIRED); uva += PAGE_SIZE; |