Reputation: 117
Does anyone know where i can find the conventions for Linux syscalls in ArmV8? What register parameter must be passed in and where are return values stored.
Upvotes: 8
Views: 4195
Reputation: 1483
A system call is issued using the svc #0
instruction.
The system call number is passed on register X8
and the return value is stored in X0
.
Here is a link to an interesting article about system calls on ARMv8: Decoding Syscalls in ARM64
Here is a link to the Procedure Call Standard for the ARM 64-bit Architecture (AArch64) that can give you more information on calling conventions for ARMv8.
You can also get that information running man syscall
on the terminal from some ARM machines running Linux.
This is a summary of the information from man syscall
:
arch/ABI instruction syscall # retval
arm64 svc #0 x8 x0
Arguments:
arch/ABI arg1 arg2 arg3 arg4 arg5 arg6 arg7
arm64 x0 x1 x2 x3 x4 x5 -
Upvotes: 7