17 lines
366 B
C
17 lines
366 B
C
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
#include <kernel/syscall.h>
|
|
#include <arch/proc.h>
|
|
|
|
static inline i64 _do_syscall(struct pt_regs *regs)
|
|
{
|
|
syscall_t c = get_syscall(regs->rax);
|
|
if (!c)
|
|
return -ENOSYS;
|
|
|
|
return c(regs->rdi, regs->rsi, regs->rdx, regs->r10, regs->r8, regs->r9);
|
|
}
|
|
|
|
void syscall(struct pt_regs *regs)
|
|
{
|
|
regs->rax = _do_syscall(regs);
|
|
}
|