diff options
Diffstat (limited to 'src/kernel/arch/amd64/sysenter.c')
-rw-r--r-- | src/kernel/arch/amd64/sysenter.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/kernel/arch/amd64/sysenter.c b/src/kernel/arch/amd64/sysenter.c index 5a96e33..2f83e3d 100644 --- a/src/kernel/arch/amd64/sysenter.c +++ b/src/kernel/arch/amd64/sysenter.c @@ -2,17 +2,20 @@ #include <kernel/arch/amd64/sysenter.h> #include <kernel/arch/generic.h> #include <kernel/proc.h> +#include <shared/mem.h> -CpuRegs _sysexit_regs; +SysexitRegs _sysexit_regs; -_Noreturn void sysexit(CpuRegs regs) { - _sysexit_regs = regs; +_Noreturn void sysexit(UserRegs *regs, char sse[512]) { + _sysexit_regs.u = *regs; + memcpy(_sysexit_regs.sse, sse, 512); _sysexit_real(); } _Noreturn void sysenter_stage2(void) { - CpuRegs *regs = &proc_cur->regs; - *regs = _sysexit_regs; + UserRegs *regs = &proc_cur->regs; + *regs = _sysexit_regs.u; + memcpy(proc_cur->sse, _sysexit_regs.sse, 512); _syscall(regs->rdi, regs->rsi, regs->rdx, regs->r10, regs->r8, regs->r9); proc_switch_any(); } |