1 #include <lunaix/syscall.h>
2 #include <lunaix/status.h>
5 #include "asm/aa64_exception.h"
7 extern ptr_t syscall_table[__SYSCALL_MAX];
10 aa64_syscall(struct hart_state* hstate)
14 call_id = esr_iss(hstate->execp.syndrome);
15 call_id = call_id & 0xffff;
17 if (call_id >= __SYSCALL_MAX) {
21 if (!syscall_table[call_id]) {
25 register reg_t param0 asm("x0") = hstate->registers.x[0];
26 register reg_t param1 asm("x1") = hstate->registers.x[1];
27 register reg_t param2 asm("x2") = hstate->registers.x[2];
28 register reg_t param3 asm("x3") = hstate->registers.x[3];
29 register reg_t param4 asm("x4") = hstate->registers.x[4];
36 [call_fn] "r"(syscall_table[call_id]),
44 hstate->registers.x[0] = param0;