summaryrefslogtreecommitdiffstats
path: root/sys/vm/vm_kern.c
diff options
context:
space:
mode:
authordt <dt@FreeBSD.org>1999-06-08 17:03:28 +0000
committerdt <dt@FreeBSD.org>1999-06-08 17:03:28 +0000
commit309c487efd7aaa6300e27a2fedac55d365d7a5a7 (patch)
tree98f40617f3cf9da46329e620c40cbe008cbfe8f1 /sys/vm/vm_kern.c
parent6f2e7884b67738b227642fd6afda105bdbc49a5d (diff)
downloadFreeBSD-src-309c487efd7aaa6300e27a2fedac55d365d7a5a7.zip
FreeBSD-src-309c487efd7aaa6300e27a2fedac55d365d7a5a7.tar.gz
Add a function kmem_alloc_nofault() - same as kmem_alloc_pageable(), but
create a nofault entry. It will be used to allocate kmem for upages. (I am not too happy with all this, but it's better than nothing).
Diffstat (limited to 'sys/vm/vm_kern.c')
-rw-r--r--sys/vm/vm_kern.c26
1 files changed, 25 insertions, 1 deletions
diff --git a/sys/vm/vm_kern.c b/sys/vm/vm_kern.c
index 16c6208..531dab2 100644
--- a/sys/vm/vm_kern.c
+++ b/sys/vm/vm_kern.c
@@ -61,7 +61,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
- * $Id: vm_kern.c,v 1.53 1999/03/12 08:05:49 alc Exp $
+ * $Id: vm_kern.c,v 1.54 1999/03/16 07:39:07 alc Exp $
*/
/*
@@ -121,6 +121,30 @@ kmem_alloc_pageable(map, size)
}
/*
+ * kmem_alloc_nofault:
+ *
+ * Same as kmem_alloc_pageable, except that it create a nofault entry.
+ */
+
+vm_offset_t
+kmem_alloc_nofault(map, size)
+ vm_map_t map;
+ register vm_size_t size;
+{
+ vm_offset_t addr;
+ register int result;
+
+ size = round_page(size);
+ addr = vm_map_min(map);
+ result = vm_map_find(map, NULL, (vm_offset_t) 0,
+ &addr, size, TRUE, VM_PROT_ALL, VM_PROT_ALL, MAP_NOFAULT);
+ if (result != KERN_SUCCESS) {
+ return (0);
+ }
+ return (addr);
+}
+
+/*
* Allocate wired-down memory in the kernel's address map
* or a submap.
*/
OpenPOWER on IntegriCloud