According to System V X86-64 ABI, function calls in the applications use the following sequence of registers to pass integer arguments:
rdi, rsi, rdx, rcx, r8, r9
But system call arguments (other than syscall number) are passed in another sequence of registers:
rdi, rsi, rdx, r10, r8, r9
Why does the kernel use r10
instead of rcx
for the fourth argument? Is it somehow related to the fact that rcx
is not preserved while r10
is?