I am working with arm64 assembly coding and I want to implement system calls using svc instruction . I can't find any working arm64 system call implementation online.Also, I can't find the system call list for arm64. Also explain the implementation .
相关问题
- Avoid cmake to add the flags -search_paths_first a
- AOSP Build TARGET_PRODUCT fails
- Why/how does gcc compile the undefined behaviour i
- Perform a horizontal logical/bitwise AND operation
- Can variables inside packed structures be read ato
相关文章
- socket() returns 0 in C client server application
- Difference in ABI between x86_64 Linux functions a
- Why are i2c_smbus function not available? (I2C – E
- Problem with time() function in embedded applicati
- Understanding `read, write` system calls in Unix
- avoiding text relocations when mixing c/c++ and as
- Interrupt handling on an SMP ARM system with a GIC
- how can i know whether a linux syscall is thread s
You can pass six arguments in
x0
tox5
, return value is saved inx0
.To give an assembler snippet, this is
write
syscall from Android Bionic's libc implementation.write
's three arguments would already be inx0-x2
. Syscall number is passed inx8
.Give AArch64 ABI a look.
Newer generation of architectures all use numbers from include/uapi/asm-generic/unistd.h.
You can also check arch/arm64/include/asm/syscall.h for argument and return value handling.
Another example:
If you have
as
andld
in hand, you can create a simple executable just quitting with an exit value.Here
42
is our return value and93
isexit
system call.