From 0ea68568372b7b7b20bca6985ae4b36e8c99c0e9 Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Fri, 13 Feb 2015 18:53:36 +0100 Subject: Implement switching to usermode. --- src/kernel/core/thread.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/kernel/core/thread.c') diff --git a/src/kernel/core/thread.c b/src/kernel/core/thread.c index 9d11da2..519ba41 100644 --- a/src/kernel/core/thread.c +++ b/src/kernel/core/thread.c @@ -2,6 +2,7 @@ #include #include #include +#include #include #include @@ -88,6 +89,7 @@ void run_scheduler() { current_thread = dequeue_thread(); if (current_thread != 0) { + set_kernel_stack(current_thread->stack_region->addr + current_thread->stack_region->size); resume_context(¤t_thread->ctx); } else { // Wait for an IRQ @@ -146,7 +148,6 @@ thread_t *new_thread(entry_t entry, void* data) { // used by user processes t->proc = 0; - t->usermem_pf_handler = 0; t->kmem_violation_handler = 0; return t; -- cgit v1.2.3