diff options
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/amd64/amd64/syscall.c | 7 | ||||
-rw-r--r-- | sys/include/sys/syscall.h | 3 | ||||
-rw-r--r-- | sys/kern/kern_syscall.c | 8 |
3 files changed, 8 insertions, 10 deletions
diff --git a/sys/arch/amd64/amd64/syscall.c b/sys/arch/amd64/amd64/syscall.c index 9b1f988..e80fe94 100644 --- a/sys/arch/amd64/amd64/syscall.c +++ b/sys/arch/amd64/amd64/syscall.c @@ -39,13 +39,10 @@ __syscall(struct trapframe *tf) .arg2 = tf->rcx, .arg3 = tf->r8, .arg4 = tf->r9, - .sp = tf->rsp, - .ret = tf->rax, + .sp = tf->rsp }; if (args.code < __MAX_SYSCALLS) { - g_syscall_table[tf->rax](&args); + tf->rax = g_syscall_table[tf->rax](&args); } - - tf->rax = args.ret; } diff --git a/sys/include/sys/syscall.h b/sys/include/sys/syscall.h index 98a57f2..03eda0b 100644 --- a/sys/include/sys/syscall.h +++ b/sys/include/sys/syscall.h @@ -47,11 +47,10 @@ struct syscall_args { uint64_t arg0, arg1, arg2, arg3, arg4; uint64_t ip; uint64_t sp; - uint64_t ret; }; #if defined(_KERNEL) -extern void(*g_syscall_table[__MAX_SYSCALLS])(struct syscall_args *args); +extern uint64_t(*g_syscall_table[__MAX_SYSCALLS])(struct syscall_args *args); void __syscall(struct trapframe *tf); #endif diff --git a/sys/kern/kern_syscall.c b/sys/kern/kern_syscall.c index 2c7215c..5a88bbb 100644 --- a/sys/kern/kern_syscall.c +++ b/sys/kern/kern_syscall.c @@ -30,21 +30,23 @@ #include <sys/syscall.h> #include <sys/sched.h> #include <sys/cdefs.h> +#include <sys/types.h> -static void +static uint64_t sys_debug(struct syscall_args *args) { /* TODO */ + return 0; } -__noreturn static void +__noreturn static uint64_t sys_exit(struct syscall_args *args) { sched_exit(); __builtin_unreachable(); } -void(*g_syscall_table[__MAX_SYSCALLS])(struct syscall_args *args) = { +uint64_t(*g_syscall_table[__MAX_SYSCALLS])(struct syscall_args *args) = { sys_debug, sys_exit, }; |