diff options
Diffstat (limited to 'src/kernel/task')
-rw-r--r-- | src/kernel/task/task.cpp | 10 | ||||
-rw-r--r-- | src/kernel/task/task.h | 6 |
2 files changed, 7 insertions, 9 deletions
diff --git a/src/kernel/task/task.cpp b/src/kernel/task/task.cpp index 4a802b8..91f802d 100644 --- a/src/kernel/task/task.cpp +++ b/src/kernel/task/task.cpp @@ -119,10 +119,10 @@ uint32_t tasking_handleException(registers *regs) { *ke_vt << "\n (PID " << current_thread->process->pid << ") "; if (regs->int_no == 14) { *ke_vt << ">>> Process exiting.\n"; - thread_exit_stackJmp(EX_PR_EXCEPTION); + thread_exit_stackJmp(EX_PAGEFAULT); } else { *ke_vt << ">>> Thread exiting.\n"; - thread_exit_stackJmp(EX_TH_EXCEPTION); + thread_exit_stackJmp(EX_EXCEPTION); } PANIC("This should never have happened. Please report this."); return 0; @@ -160,7 +160,7 @@ void thread_exit2(uint32_t reason) { //See EX_TH_* defines in task.h process* pr; if (th == 0 || th->process == 0) goto retrn; pr = th->process; - if ((reason == EX_TH_NORMAL || reason == EX_TH_EXCEPTION) && pr->thread_count > 1) { + if ((reason == EX_NOTHREADS || reason == EX_EXCEPTION) && pr->thread_count > 1) { delete th; } else { pr->finish(reason); @@ -188,12 +188,12 @@ void thread_exit_stackJmp(uint32_t reason) { /* System call. Exit the current thread. */ void thread_exit() { - thread_exit_stackJmp(EX_TH_NORMAL); + thread_exit_stackJmp(EX_NOTHREADS); } /* System call. Exit the current process. */ void process_exit(size_t retval) { - if (retval == EX_TH_NORMAL || retval == EX_TH_EXCEPTION) retval = EX_PR_EXCEPTION; + if (retval == EX_EXCEPTION || retval == EX_NOTHREADS || retval == EX_PAGEFAULT) retval = EX_INVALID; thread_exit_stackJmp(retval); } diff --git a/src/kernel/task/task.h b/src/kernel/task/task.h index fa748c2..5cd3fb2 100644 --- a/src/kernel/task/task.h +++ b/src/kernel/task/task.h @@ -15,14 +15,12 @@ #define PL_USER 1 #define PL_KERNEL 0 -#define EX_TH_NORMAL 0x10000 //ERROR code : just one thread exits, because it has to -#define EX_TH_EXCEPTION 0x10001 //ERROR code : just one thread exits, because of an unhandled exception -#define EX_PR_EXCEPTION 0x10002 //ERROR code : all process finishes, because of an unhandled exception - #define USER_STACK_SIZE 0x10000 //64k, but pages will be mapped one by one as they are used typedef void (*thread_entry)(void*); +typedef int FILE; // DUPLICATE FROM vfs/node.h + class thread; class node; class process { |