6

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.

KAM
  • 115
  • 1
  • 3
  • 5
  • syscall numbers asked at: https://reverseengineering.stackexchange.com/questions/16917/arm64-syscalls-table Related: https://stackoverflow.com/questions/12946958/what-is-the-interface-for-arm-system-calls-and-where-is-it-defined-in-the-linux – Ciro Santilli OurBigBook.com Jul 18 '18 at 08:43

1 Answers1

4

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    -
Capybara
  • 1,313
  • 8
  • 12
  • 1.The document may be helpful, but it doesn't answer the question how linux system call, is related to those call conventions. 2. man syscall provides no information on amrbian so you are overly optimistic. 3. Is it so hard to state positively something like "the instruction 'svc #0' performs a system call with the number that is in register X8" (provided this is what is ment). Albert – Albert van der Horst May 23 '19 at 21:41
  • 1
    Hi @AlbertvanderHorst, you are correct, my answer was not the best. I edited it, so hopefully it is much better now. Thanks. – Capybara Jul 02 '19 at 16:05