summaryrefslogtreecommitdiff
path: root/src/kernel/task/syscall.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/kernel/task/syscall.c')
-rw-r--r--src/kernel/task/syscall.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/kernel/task/syscall.c b/src/kernel/task/syscall.c
index 5aab011..8195dd0 100644
--- a/src/kernel/task/syscall.c
+++ b/src/kernel/task/syscall.c
@@ -1,21 +1,29 @@
#include "syscall.h"
+#include "task.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); }
+#define CALL0V(name, scname) static void scname(struct registers* r) { name(); }
+#define CALL1V(name, scname) static void scname(struct registers* r) { name(r->ebx); }
-CALL0(thread_exit, thread_exit_sc);
-CALL0(tasking_switch, schedule_sc);
-CALL1(thread_sleep, thread_sleep_sc);
-CALL1(process_exit, process_exit_sc);
+CALL0V(thread_exit, thread_exit_sc);
+CALL0V(tasking_switch, schedule_sc);
+CALL1V(thread_sleep, thread_sleep_sc);
+CALL1V(process_exit, process_exit_sc);
CALL1(monitor_write, printk_sc);
+static void thread_new_sc(struct registers* r) {
+ thread_new(current_thread->process, (thread_entry)r->ebx, (void*)r->ecx);
+}
+
int_callback syscalls[] = {
thread_exit_sc,
schedule_sc,
thread_sleep_sc,
process_exit_sc,
printk_sc,
+ thread_new_sc,
0 };