stuff2
This commit is contained in:
@@ -33,12 +33,12 @@ static const syscall_fn_t dispatch_table[] = {
|
||||
};
|
||||
|
||||
void syscall_dispatch(struct arch_context* ctx) {
|
||||
const size_t num = ctx->ARCH_CTX_NUM;
|
||||
const size_t num = ctx->num;
|
||||
|
||||
if (num >= ARRAY_SIZE(dispatch_table)) {
|
||||
ctx->ARCH_CTX_RET0 = ZN_ERR_BAD_SYSCALL;
|
||||
ctx->ret0 = ZN_ERR_BAD_SYSCALL;
|
||||
return;
|
||||
}
|
||||
|
||||
ctx->ARCH_CTX_RET0 = dispatch_table[num](ctx);
|
||||
ctx->ret0 = dispatch_table[num](ctx);
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#include <kernel/sched.h>
|
||||
#include <kernel/syscalls.h>
|
||||
#include <kernel/usercopy.h>
|
||||
#include <stddef.h>
|
||||
#include <string.h>
|
||||
|
||||
zn_status_t syscall_thread_create(struct arch_context* ctx) {
|
||||
@@ -114,5 +115,5 @@ zn_status_t syscall_thread_exit(struct arch_context* ctx) {
|
||||
struct sched_percpu* sched = &percpu_get()->sched;
|
||||
sched->current->state = TASK_STATE_DEAD;
|
||||
sched_yield(sched);
|
||||
__unreachable();
|
||||
unreachable();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user