summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorArtur Grabowski <art@cvs.openbsd.org>2002-10-14 20:31:47 +0000
committerArtur Grabowski <art@cvs.openbsd.org>2002-10-14 20:31:47 +0000
commit96f4c81b92efe09943afbaf3b84d823292ab992a (patch)
tree2e7602818844e8542ff327f8a5822fb802e54ead /sys/arch
parent88520fa67dbed4d2d6f5e693ae304eed7d42954e (diff)
Use uvm_km_valloc_prefer_wait instead of doing the same thing manually.
<miod> well, my comments are "looks sane, works for me, ok to commit"
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/sparc/sparc/vm_machdep.c17
1 files changed, 4 insertions, 13 deletions
diff --git a/sys/arch/sparc/sparc/vm_machdep.c b/sys/arch/sparc/sparc/vm_machdep.c
index 1e3d4a756f1..6adbea4cb9c 100644
--- a/sys/arch/sparc/sparc/vm_machdep.c
+++ b/sys/arch/sparc/sparc/vm_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vm_machdep.c,v 1.43 2002/02/20 22:28:23 deraadt Exp $ */
+/* $OpenBSD: vm_machdep.c,v 1.44 2002/10/14 20:31:46 art Exp $ */
/* $NetBSD: vm_machdep.c,v 1.30 1997/03/10 23:55:40 pk Exp $ */
/*
@@ -290,14 +290,12 @@ dvma_mapout(kva, va, len)
* Map an IO request into kernel virtual address space.
*/
void
-vmapbuf(bp, sz)
- struct buf *bp;
- vsize_t sz;
+vmapbuf(struct buf *bp, vsize_t sz)
{
vaddr_t uva, kva;
- paddr_t pa;
vsize_t size, off;
struct pmap *pmap;
+ paddr_t pa;
#ifdef DIAGNOSTIC
if ((bp->b_flags & B_PHYS) == 0)
@@ -315,14 +313,7 @@ vmapbuf(bp, sz)
* We do it on our own here to be able to specify an offset to uvm_map
* so that we can get all benefits of PMAP_PREFER.
*/
- while (1) {
- kva = vm_map_min(kernel_map);
- if (uvm_map(kernel_map, &kva, size, NULL, uva, 0,
- UVM_MAPFLAG(UVM_PROT_ALL, UVM_PROT_ALL,
- UVM_INH_NONE, UVM_ADV_RANDOM, 0)) == 0)
- break;
- tsleep(kernel_map, PVM, "vallocwait", 0);
- }
+ kva = uvm_km_valloc_prefer_wait(kernel_map, size, uva);
bp->b_data = (caddr_t)(kva + off);
while (size > 0) {