summaryrefslogtreecommitdiff
path: root/kern/thread.c
diff options
context:
space:
mode:
authorJustus Winter <4winter@informatik.uni-hamburg.de>2015-04-01 14:01:14 +0200
committerJustus Winter <4winter@informatik.uni-hamburg.de>2015-08-28 15:48:05 +0200
commit51d95f2e41553890121a611852594ca4a74eb53e (patch)
treeec9ba152584e53c935c4841e80c1c7998fe86b4c /kern/thread.c
parent78487aa5a834d0a5e8e0c6c5490e3bce26e8756d (diff)
XXX pmm from x15, userspace crashes soon
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 9c82af5..a6644ca 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