amd64: add syscall entry mechanism
Signed-off-by: Michael Shaw <m@michaelsshaw.com>
This commit is contained in:
parent
a73fc47664
commit
d7477ae860
8 changed files with 103 additions and 87 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue