Skip to content

Glossary

SVC instruction

The arm64 Supervisor Call — the single instruction every macOS syscall on Apple Silicon ultimately compiles to.

SVC (Supervisor Call) is the arm64 instruction that traps from user mode (EL0) to kernel mode (EL1). On macOS, every syscall on Apple Silicon — BSD or Mach — uses the same one:

svc #0x80

The immediate #0x80 is by convention; XNU's exception vector looks at the instruction's class, not the immediate, so any SVC into the kernel works. The 0x80 is a wink to Darwin's BSD ancestry, where Intel int 0x80 was historically used for the same purpose.

What disambiguates one syscall from another is register x16:

  • x16 > 0BSD syscall. The kernel dispatches through unix_syscall64().
  • x16 < 0Mach trap. The kernel dispatches through mach_call_munger64().

Arguments stay in x0x7 across the trap. The kernel reads them directly from the trap frame. The return value goes back in x0 (and x1 for wider returns).

On x86_64 macOS (Intel and Rosetta 2), the equivalent is the syscall instruction with a packed (class << 24) | number in eax.

The user-space wrappers around SVC live in libsystem_kernel.dylib.