summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Braun <rbraun@sceen.net>2012-12-01 15:44:24 +0100
committerRichard Braun <rbraun@sceen.net>2012-12-01 15:44:24 +0100
commitcf06fbde7911c5380d9f145f55168cddb4f01bd4 (patch)
tree8364771a4b3b326f97b4de93eef778557ec775ec
parent7639d05dcb960c91ba0bd18daa55b4deb30e8b52 (diff)
kern/kmem: merge kmem_bootstrap into kmem_setup
-rw-r--r--kern/kmem.c14
-rw-r--r--kern/kmem.h11
-rw-r--r--vm/vm_setup.c3
3 files changed, 10 insertions, 18 deletions
diff --git a/kern/kmem.c b/kern/kmem.c
index 2718c09e..c8c55579 100644
--- a/kern/kmem.c
+++ b/kern/kmem.c
@@ -1073,21 +1073,17 @@ kmem_cache_info(struct kmem_cache *cache)
}
void __init
-kmem_bootstrap(void)
+kmem_setup(void)
{
+ struct kmem_cpu_pool_type *cpu_pool_type;
+ char name[KMEM_NAME_SIZE];
+ size_t i, size;
+
/* Make sure a bufctl can always be stored in a buffer */
assert(sizeof(union kmem_bufctl) <= KMEM_ALIGN_MIN);
list_init(&kmem_cache_list);
/* mutex_init(&kmem_cache_list_mutex); */
-}
-
-void __init
-kmem_setup(void)
-{
- struct kmem_cpu_pool_type *cpu_pool_type;
- char name[KMEM_NAME_SIZE];
- size_t i, size;
for (i = 0; i < ARRAY_SIZE(kmem_cpu_pool_types); i++) {
cpu_pool_type = &kmem_cpu_pool_types[i];
diff --git a/kern/kmem.h b/kern/kmem.h
index 169497c2..98306fae 100644
--- a/kern/kmem.h
+++ b/kern/kmem.h
@@ -273,14 +273,11 @@ void kmem_cache_free(struct kmem_cache *cache, void *obj);
void kmem_cache_info(struct kmem_cache *cache);
/*
- * Early initialization of the kernel memory allocator.
- *
- * Once this function returns, caches can be initialized.
- */
-void kmem_bootstrap(void);
-
-/*
* Set up the kernel memory allocator module.
+ *
+ * This function should only be called by the VM system. Once it returns,
+ * caches can be initialized, but those using the default backend can only
+ * operate once the VM system is sufficiently ready.
*/
void kmem_setup(void);
diff --git a/vm/vm_setup.c b/vm/vm_setup.c
index 33b07257..fa8c8139 100644
--- a/vm/vm_setup.c
+++ b/vm/vm_setup.c
@@ -26,8 +26,7 @@ vm_setup(void)
{
vm_kmem_setup();
vm_phys_setup();
- kmem_bootstrap();
- vm_map_bootstrap();
kmem_setup();
+ vm_map_bootstrap();
vm_map_setup();
}