summaryrefslogtreecommitdiff
path: root/vm/vm_map.h
diff options
context:
space:
mode:
authorRichard Braun <rbraun@sceen.net>2011-12-17 16:23:33 +0000
committerRichard Braun <rbraun@sceen.net>2011-12-17 22:12:45 +0000
commit7fa0de680bbfed02e09ad517788fe336c0d855cc (patch)
tree83cd618d51f770f7fbf452cbe72c0f349068eefd /vm/vm_map.h
parentdb2078e4f1802434f791f4f1c333725c42fe172b (diff)
Adjust VM initialization
Unlike the zone allocator, the slab code can't be fed with an initial chunk of memory. Some VM objects used early during startup now have to be statically allocated, and kernel map entries need a special path to avoid recursion when being allocated. * vm/vm_map.c (vm_submap_object_store): New variable. (vm_submap_object): Point to vm_submap_object_store. (kentry_data_size): Initialize to arbitrary value. (kentry_count): Remove variable. (kentry_pagealloc): New function. (vm_map_setup): Likewise. (vm_map_create): Replace initialization with a call to vm_map_setup(). * vm/vm_map.h (vm_map_setup): New prototype. * vm/vm_kern.c (kernel_map_store): New variable. (kernel_map): Point to kernel_map_store. (kmem_suballoc): Remove function. Replaced with... (kmem_submap): New function. (kmem_init): Call vm_map_setup() instead of vm_map_create(). * vm/vm_kern.h (kmem_suballoc): Remove prototype. (kmem_submap): New prototype. * vm/vm_object.c (kernel_object_store): New variable. (kernel_object): Point to kernel_object_store. (vm_object_template): Change type from vm_object_t to struct vm_object. (_vm_object_setup): New function. (_vm_object_allocate): Replace initialization with a call to _vm_object_setup(). (vm_object_bootstrap): Don't allocate vm_object_template, and use it as a structure instead of a pointer. Initialize kernel_object and vm_submap_object with _vm_object_setup() instead of _vm_object_allocate(). * vm/vm_resident.c (vm_page_bootstrap): Don't initialize kentry_data_size. * device/ds_routines.c (device_io_map_store): New variable. (device_io_map): Point to device_io_map_store. (mach_device_init): Call kmem_submap() instead of kmem_suballoc(). * ipc/ipc_init.c (ipc_kernel_map_store): New variable. (ipc_kernel_map): Point to ipc_kernel_map_store.
Diffstat (limited to 'vm/vm_map.h')
-rw-r--r--vm/vm_map.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/vm/vm_map.h b/vm/vm_map.h
index 567fe933..f4e9395d 100644
--- a/vm/vm_map.h
+++ b/vm/vm_map.h
@@ -357,6 +357,9 @@ extern int kentry_count;
/* Initialize the module */
extern void vm_map_init(void);
+/* Initialize an empty map */
+extern void vm_map_setup(vm_map_t, pmap_t, vm_offset_t, vm_offset_t,
+ boolean_t);
/* Create an empty map */
extern vm_map_t vm_map_create(pmap_t, vm_offset_t, vm_offset_t,
boolean_t);