Files
mop3/kernel/syscall/syscall.c
kamkow1 b5353cb600
All checks were successful
Build documentation / build-and-deploy (push) Successful in 44s
Auxilary scripts for formatting all components
2026-01-04 01:44:02 +01:00

35 lines
962 B
C

#include <aux/compiler.h>
#include <libk/std.h>
#include <m/syscall_defs.h>
#include <proc/proc.h>
#include <sys/debug.h>
#include <syscall/syscall.h>
#define DEFINE_SYSCALL(name) \
int name (struct proc* proc, uintptr_t UNUSED a1, uintptr_t UNUSED a2, uintptr_t UNUSED a3, \
uintptr_t UNUSED a4, uintptr_t UNUSED a5, uintptr_t UNUSED a6)
DEFINE_SYSCALL (sys_proc_quit) {
proc_kill (proc);
proc_sched ();
return SR_OK;
}
DEFINE_SYSCALL (sys_proc_test) {
DEBUG ("test syscall message!\n");
return SR_OK;
}
static syscall_handler_func_t handler_table[] = {
[SYS_PROC_QUIT] = &sys_proc_quit,
[SYS_PROC_TEST] = &sys_proc_test,
};
syscall_handler_func_t syscall_find_handler (int syscall_num) {
if (!(syscall_num >= 0 && syscall_num < (sizeof (handler_table) / sizeof (handler_table[0])))) {
return NULL;
}
return handler_table[syscall_num];
}