From b2c3dcb6c96f255263fe4839f2d3d2a7b60928e0 Mon Sep 17 00:00:00 2001 From: gwr Date: Tue, 24 Jan 1995 06:11:35 +0000 Subject: [PATCH] Use kmem_alloc_wait instead of calling the vm code directly. (The old way somehow allowed the pages to be stolen!) --- sys/arch/sun3/sun3/vm_machdep.c | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/sys/arch/sun3/sun3/vm_machdep.c b/sys/arch/sun3/sun3/vm_machdep.c index 3eec8d1dc4ed..1fa6b60dcb97 100644 --- a/sys/arch/sun3/sun3/vm_machdep.c +++ b/sys/arch/sun3/sun3/vm_machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: vm_machdep.c,v 1.22 1995/01/11 20:39:22 gwr Exp $ */ +/* $NetBSD: vm_machdep.c,v 1.23 1995/01/24 06:11:35 gwr Exp $ */ /* * Copyright (c) 1994 Gordon W. Ross @@ -287,20 +287,13 @@ caddr_t dvma_vm_alloc(npages) int npages; { vm_size_t size; - vm_offset_t addr; - int result; + vm_offset_t va; if (npages <= 0) panic("dvma_vm_alloc(0)"); - /* XXX - Should this use kmem_alloc_wait() instead? -gwr */ - size = npages*NBPG; - addr = vm_map_min(phys_map); - result = vm_map_find(phys_map, NULL, (vm_offset_t) 0, &addr, size, TRUE); - if (result != KERN_SUCCESS) - return NULL; - vm_map_remove(phys_map, addr, addr+size); - return (caddr_t) addr; + va = kmem_alloc_wait(phys_map, npages); + return (caddr_t) va; } /*