#include #include #include #include #include SysexitRegs _sysexit_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) { 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(); }