Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. =================================================================== RCS file: /ftp/cvs/cvsroot/src/sys/kern/subr_pool.c,v rcsdiff: /ftp/cvs/cvsroot/src/sys/kern/subr_pool.c,v: warning: Unknown phrases like `commitid ...;' are present. retrieving revision 1.10 retrieving revision 1.12 diff -u -p -r1.10 -r1.12 --- src/sys/kern/subr_pool.c 1998/08/13 02:10:58 1.10 +++ src/sys/kern/subr_pool.c 1998/08/28 21:18:37 1.12 @@ -1,4 +1,4 @@ -/* $NetBSD: subr_pool.c,v 1.10 1998/08/13 02:10:58 eeh Exp $ */ +/* $NetBSD: subr_pool.c,v 1.12 1998/08/28 21:18:37 thorpej Exp $ */ /*- * Copyright (c) 1997 The NetBSD Foundation, Inc. @@ -830,11 +830,12 @@ pool_page_alloc(sz, flags, mtype) int flags; int mtype; { + boolean_t waitok = (flags & PR_WAITOK) ? TRUE : FALSE; #if defined(UVM) - return ((void *)uvm_km_alloc_poolpage()); + return ((void *)uvm_km_alloc_poolpage(waitok)); #else - return ((void *)kmem_alloc_poolpage()); + return ((void *)kmem_alloc_poolpage(waitok)); #endif } @@ -853,6 +854,47 @@ pool_page_free(v, sz, mtype) } /* + * Alternate pool page allocator for pools that know they will + * never be accessed in interrupt context. + */ +void * +pool_page_alloc_nointr(sz, flags, mtype) + unsigned long sz; + int flags; + int mtype; +{ +#if defined(UVM) + boolean_t waitok = (flags & PR_WAITOK) ? TRUE : FALSE; + + /* + * With UVM, we can use the kernel_map. + */ + return ((void *)uvm_km_alloc_poolpage1(kernel_map, uvm.kernel_object, + waitok)); +#else + /* + * Can't do anything so cool with Mach VM. + */ + return (pool_page_alloc(sz, flags, mtype)); +#endif +} + +void +pool_page_free_nointr(v, sz, mtype) + void *v; + unsigned long sz; + int mtype; +{ + +#if defined(UVM) + uvm_km_free_poolpage1(kernel_map, (vaddr_t)v); +#else + pool_page_free(v, sz, mtype); +#endif +} + + +/* * Release all complete pages that have not been used recently. */ void