summaryrefslogtreecommitdiff
path: root/kern/thread.c
diff options
context:
space:
mode:
Diffstat (limited to 'kern/thread.c')
-rw-r--r--kern/thread.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/kern/thread.c b/kern/thread.c
index 720711c..8c4fc22 100644
--- a/kern/thread.c
+++ b/kern/thread.c
@@ -123,6 +123,15 @@ decl_simple_lock_data(, stack_lock_data)/* splsched only */
*/
static struct kmem_cache stack_cache;
+vm_offset_t
+thread_bootstrap_stack_alloc(void)
+{
+ vm_offset_t stack;
+ stack = kmem_cache_alloc(&stack_cache);
+ assert ((stack & (KERNEL_STACK_SIZE-1)) == 0);
+ return stack;
+}
+
/*
* stack_alloc_try:
*
@@ -220,7 +229,7 @@ void stack_privilege(
thread->stack_privilege = current_stack();
}
-void thread_init(void)
+void thread_bootstrap(void)
{
kmem_cache_init(&thread_cache, "thread", sizeof(struct thread), 0,
NULL, 0);
@@ -233,7 +242,10 @@ void thread_init(void)
kmem_cache_init(&stack_cache, "stack",
KERNEL_STACK_SIZE, KERNEL_STACK_SIZE,
NULL, 0);
+}
+void thread_init(void)
+{
/*
* Fill in a template thread for fast initialization.
* [Fields that must be (or are typically) reset at