summaryrefslogtreecommitdiff
path: root/src/kernel/task
diff options
context:
space:
mode:
authorAlex AUVOLAT <alexis211@gmail.com>2013-06-08 23:09:52 +0200
committerAlex AUVOLAT <alexis211@gmail.com>2013-06-08 23:09:52 +0200
commit4d65fcb9a8b6c7c6fd5a3390c46a96d11b6a80d4 (patch)
treec193acf64ff2db985f6664f161cf586c3caeb684 /src/kernel/task
parenteae9997d3c2dbaef53022ddabe61c1800a619499 (diff)
downloadTCE-4d65fcb9a8b6c7c6fd5a3390c46a96d11b6a80d4.tar.gz
TCE-4d65fcb9a8b6c7c6fd5a3390c46a96d11b6a80d4.zip
All FWIK is deleted. YOSH is now pure C. Not-working KBASIC included.
Diffstat (limited to 'src/kernel/task')
-rw-r--r--src/kernel/task/task.cpp10
-rw-r--r--src/kernel/task/task.h6
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 {