diff options
-rw-r--r-- | sys/include/sys/sched.h | 4 | ||||
-rw-r--r-- | sys/kern/kern_sched.c | 7 | ||||
-rw-r--r-- | sys/kern/kern_syscall.c | 7 |
3 files changed, 11 insertions, 7 deletions
diff --git a/sys/include/sys/sched.h b/sys/include/sys/sched.h index 6689e3b..8245120 100644 --- a/sys/include/sys/sched.h +++ b/sys/include/sys/sched.h @@ -34,6 +34,7 @@ #include <sys/queue.h> #include <sys/types.h> #include <sys/spinlock.h> +#include <sys/syscall.h> #include <machine/cpu.h> #include <machine/frame.h> @@ -44,6 +45,9 @@ void sched_context_switch(struct trapframe *tf); void sched_rest(void); __noreturn +uint64_t sys_exit(struct syscall_args *args); + +__noreturn void sched_init_processor(struct cpu_info *ci); #endif /* !_SYS_SCHED_H_ */ diff --git a/sys/kern/kern_sched.c b/sys/kern/kern_sched.c index 1b4c987..c073224 100644 --- a/sys/kern/kern_sched.c +++ b/sys/kern/kern_sched.c @@ -457,6 +457,13 @@ sched_context_switch(struct trapframe *tf) sched_oneshot(false); } +uint64_t +sys_exit(struct syscall_args *args) +{ + sched_exit(); + __builtin_unreachable(); +} + void sched_init(void) { diff --git a/sys/kern/kern_syscall.c b/sys/kern/kern_syscall.c index e892c39..b575346 100644 --- a/sys/kern/kern_syscall.c +++ b/sys/kern/kern_syscall.c @@ -35,13 +35,6 @@ #include <sys/system.h> #include <vm/map.h> -__noreturn static uint64_t -sys_exit(struct syscall_args *args) -{ - sched_exit(); - __builtin_unreachable(); -} - uint64_t(*g_syscall_table[__MAX_SYSCALLS])(struct syscall_args *args) = { sys_exit, sys_write, |