X-Git-Url: https://scm.lunaixsky.com/lunaix-os.git/blobdiff_plain/b26d3165c52589d1f8de37bf0df27ad96f460f47..e47950ba3c4ef27ff19d8bb7ad54d779180e96e9:/lunaix-os/kernel/syscall.c diff --git a/lunaix-os/kernel/syscall.c b/lunaix-os/kernel/syscall.c index 1c0110d..cd3b80d 100644 --- a/lunaix-os/kernel/syscall.c +++ b/lunaix-os/kernel/syscall.c @@ -1,17 +1,19 @@ -#include -#include #include -#include -#include -#include +#include -LOG_MODULE("SYSCALL") +typedef reg_t (*syscall_fn)(reg_t p1, reg_t p2, reg_t p3, reg_t p4, reg_t p5); -extern void -syscall_hndlr(const isr_param* param); - -void -syscall_install() +reg_t +dispatch_syscall(void* syscall_fnptr, + reg_t p1, reg_t p2, reg_t p3, reg_t p4, reg_t p5) { - isrm_bindiv(LUNAIX_SYS_CALL, syscall_hndlr); + reg_t ret_val; + + thread_stats_update_entering(true); + + set_preemption(); + ret_val = ((syscall_fn)syscall_fnptr)(p1, p2, p3, p4, p5); + no_preemption(); + + return ret_val; } \ No newline at end of file