diff options
author | jeff <jeff@FreeBSD.org> | 2002-06-19 20:47:18 +0000 |
---|---|---|
committer | jeff <jeff@FreeBSD.org> | 2002-06-19 20:47:18 +0000 |
commit | 0776d3f180e1070fc4edad0433924c5e97a5ca22 (patch) | |
tree | 17d5dbfe792aa81e32cccb784b2c6b5a0e949f0e /sys | |
parent | 237e4756df3eec1c88b2b529046ab8cf436d18a6 (diff) | |
download | FreeBSD-src-0776d3f180e1070fc4edad0433924c5e97a5ca22.zip FreeBSD-src-0776d3f180e1070fc4edad0433924c5e97a5ca22.tar.gz |
Teach kmem_malloc about M_ZERO.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/vm/vm_kern.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/sys/vm/vm_kern.c b/sys/vm/vm_kern.c index aa7c885..53464d8 100644 --- a/sys/vm/vm_kern.c +++ b/sys/vm/vm_kern.c @@ -347,6 +347,7 @@ kmem_malloc(map, size, flags) VM_PROT_ALL, VM_PROT_ALL, 0); for (i = 0; i < size; i += PAGE_SIZE) { + int pflags; /* * Note: if M_NOWAIT specified alone, allocate from * interrupt-safe queues only (just the free list). If @@ -356,10 +357,15 @@ kmem_malloc(map, size, flags) * are not allowed to mess with the cache queue. */ retry: - m = vm_page_alloc(kmem_object, OFF_TO_IDX(offset + i), - ((flags & (M_NOWAIT|M_USE_RESERVE)) == M_NOWAIT) ? - VM_ALLOC_INTERRUPT : - VM_ALLOC_SYSTEM); + if ((flags & (M_NOWAIT|M_USE_RESERVE)) == M_NOWAIT) + pflags = VM_ALLOC_INTERRUPT; + else + pflags = VM_ALLOC_SYSTEM; + + if (flags & M_ZERO) + pflags |= VM_ALLOC_ZERO; + + m = vm_page_alloc(kmem_object, OFF_TO_IDX(offset + i), pflags); /* * Ran out of space, free everything up and return. Don't need |