From 125f3b3c3ee3b99f94e08214f610bde06a9bb754 Mon Sep 17 00:00:00 2001 From: Ben Kallus Date: Sun, 18 May 2025 19:45:07 -0400 Subject: [PATCH] man/man2/syscall.2: x86-64 + x32 syscall numbers go in eax The kernel sign-extends eax before dispatching syscalls. From arch/x86/entry/entry_64.S: > movslq %eax, %rsi > IBRS_ENTER > UNTRAIN_RET > CLEAR_BRANCH_HISTORY > > call do_syscall_64 /* returns with IRQs disabled */ This patch updates syscall.2 to document this. ARM64 exhibits a similar behavior (w8 is extended), which is already documented. Signed-off-by: Ben Kallus Message-ID: <20250518234507.404608-1-benjamin.p.kallus.gr@dartmouth.edu> Signed-off-by: Alejandro Colomar --- man/man2/syscall.2 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/man/man2/syscall.2 b/man/man2/syscall.2 index f50d7cfc7..be645c0f4 100644 --- a/man/man2/syscall.2 +++ b/man/man2/syscall.2 @@ -190,8 +190,8 @@ superh trapa #31 r3 r0 r1 - 4, 6 sparc/32 t 0x10 g1 o0 o1 psr/csr 1, 6 sparc/64 t 0x6d g1 o0 o1 psr/csr 1, 6 tile swint1 R10 R00 - R01 1 -x86-64 syscall rax rax rdx - 5 -x32 syscall rax rax rdx - 5 +x86-64 syscall eax rax rdx - 5 +x32 syscall eax rax rdx - 5 xtensa syscall a2 a2 - - .TE .P -- 2.47.2