reboot on x64
reboot or enable/disable Ctrl-Alt-Del
sys_reboot(int magic1, int magic2, unsigned int cmd, void *arg)
| number | 169 (0xa9) |
|---|---|
| abi | common |
| entry point | sys_reboot |
| since | Linux 3.3 or earlier (3.3 is the first release scanned for x64) |
| man page | reboot(2) |
| source | elixir.bootlin.com |
Registers
| register | value |
|---|---|
rax | 169, the syscall number |
rdi | int magic1 |
rsi | int magic2 |
rdx | unsigned int cmd |
r10 | void *arg |
rax | the return value |
Then run syscall to enter the kernel.
The syscall instruction clobbers rcx (the return address lands in rcx) and r11 (the flags land in r11).
Since Linux 5.14 the kernel reads the syscall number from eax and ignores the upper 32 bits of rax. Older kernels fail with ENOSYS when those bits are not zero, and mov eax, N clears them, so it works on both.
Same syscall on other architectures
- x86 88
- arm64 142
- arm 88
- riscv64 142
- ia32 88
- x32 1073741993
- loongarch64 142
- ppc64 88
- ppc 88
- s390x 88
- mips64 5164
- mipsn32 6164
- mipso32 4088
- alpha 311
- arc 142
- blackfin 88, removed in 4.17
- cris 88, removed in 4.17
- csky 142
- frv 88, removed in 4.17
- hexagon 142
- ia64 1096, removed in 6.7
- m32r 88, removed in 4.17
- m68k 88
- metag 142, removed in 4.17
- microblaze 88
- mn10300 88, removed in 4.17
- nds32 142, removed in 5.18
- nios2 142
- openrisc 142
- parisc 88
- score 142, removed in 4.17
- sh 88
- sparc 55
- sparc64 55
- tilegx 142, removed in 4.17
- tilepro 142, removed in 4.17
- xtensa 203
Get this as JSON: https://api.syscall.sh/v2/syscalls/x64/reboot