amd64: add syscall entry mechanism

Signed-off-by: Michael Shaw <m@michaelsshaw.com>
This commit is contained in:
Michael Shaw 2026-07-15 20:08:22 -04:00
commit d7477ae860
8 changed files with 103 additions and 87 deletions

View file

@ -2,7 +2,7 @@
#include <kernel/syscall.h>
#include <arch/proc.h>
i64 syscall(struct pt_regs *regs)
static inline i64 _do_syscall(struct pt_regs *regs)
{
syscall_t c = get_syscall(regs->rax);
if (!c)
@ -10,3 +10,8 @@ i64 syscall(struct pt_regs *regs)
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);
}