summaryrefslogtreecommitdiff
path: root/src/stem/task/syscall.c
diff options
context:
space:
mode:
authorAlexis211 <alexis211@gmail.com>2010-02-03 17:50:30 +0100
committerAlexis211 <alexis211@gmail.com>2010-02-03 17:50:30 +0100
commit6d849bc12d6afe2fe239c5a7dc581ba76d67974b (patch)
treea227121ed4e5d3ef86d5047fed7b5a0bbef33ead /src/stem/task/syscall.c
parent9c4310651a91e64c10a17f3190c895a49096aeb1 (diff)
downloadTCE-6d849bc12d6afe2fe239c5a7dc581ba76d67974b.tar.gz
TCE-6d849bc12d6afe2fe239c5a7dc581ba76d67974b.zip
Start syscall work
Diffstat (limited to 'src/stem/task/syscall.c')
-rw-r--r--src/stem/task/syscall.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/stem/task/syscall.c b/src/stem/task/syscall.c
new file mode 100644
index 0000000..281d680
--- /dev/null
+++ b/src/stem/task/syscall.c
@@ -0,0 +1,16 @@
+#include "syscall.h"
+
+#define CALL0(name, scname) static void scname(struct registers* r) { r->eax = name(); }
+#define CALL1(name, scname) static void scname(struct registers* r) { \
+ r->eax = name(r->ebx); }
+#define CALL2(name, scname) static void scname(struct registers* r) { \
+ r->eax = name(r->ebx, r->ecx); }
+
+CALL0(tasking_switch, schedule_sc);
+
+int_callback syscalls[] = {
+ 0, //Syscall 0 will be thread_exit
+ schedule_sc,
+ 0, //Syscall 2 will be thread_sleep
+ 0, //Syscall 3 will be process_exit
+ 0 };