|
| static void | wrmsr (uint32_t msr, uint64_t val) |
| static uint64_t | rdmsr (uint32_t msr) |
| void | syscall_entry (void) |
| void | int80_entry (void) |
| void | syscall_save_user_regs (uint64_t user_rip, uint64_t user_rflags, uint64_t user_rsp) |
| void | syscall_save_user_callee_regs (uint64_t user_rbp, uint64_t user_rbx, uint64_t user_r12, uint64_t user_r13, uint64_t user_r14, uint64_t user_r15) |
| void | syscall_get_saved_user_callee_regs (uint64_t *out_rbp, uint64_t *out_rbx, uint64_t *out_r12, uint64_t *out_r13, uint64_t *out_r14, uint64_t *out_r15) |
| void | syscall_get_saved_user_ctx (uint64_t *out_rip, uint64_t *out_rfl, uint64_t *out_rsp) |
| void | syscall_get_saved_user_rdi_rsi_rdx (uint64_t *out_rdi, uint64_t *out_rsi, uint64_t *out_rdx) |
| | The SYSCALL instruction clobbers RCX and R11; arguments in RDI/RSI/RDX are preserved by the syscall.asm stub in per-CPU scratch space. This helper exposes them to kernel C code (e.g., SYS_execve handler) that needs all three argument registers.
|
| void | syscall_save_restart_state (uint64_t nr, uint64_t a1, uint64_t a2, uint64_t a3, uint64_t a4, uint64_t a5, uint64_t a6) |
| void | syscall_init (void) |
| | Writes IA32_LSTAR MSR to the address of syscall_entry (the NASM entry stub in syscall.asm), writes IA32_STAR MSR with kernel CS (0x08) and user CS (0x1B) selectors, writes IA32_FMASK to mask IF during syscall entry (interrupts disabled at syscall boundary), and sets SCE bit in IA32_EFER. Called once by the BSP during boot.
|
| int64_t | syscall_dispatch (uint64_t nr, uint64_t arg1, uint64_t arg2, uint64_t arg3, uint64_t arg4, uint64_t arg5, uint64_t arg6) |