Skip to main content

syscall_entry

Function syscall_entry 

Source
unsafe extern "C" fn syscall_entry()
Expand description

The SYSCALL entry point (naked function).

On entry from userspace:

  • RCX = user RIP (saved by CPU)
  • R11 = user RFLAGS (saved by CPU)
  • RSP = user stack pointer (NOT saved by CPU : we must save it)
  • IF = 0 (cleared by FMASK)
  • RAX = syscall number
  • RDI, RSI, RDX, R10, R8, R9 = arguments 1-6

We build a SyscallFrame on the kernel stack and call the Rust dispatcher.