3 ms·
I don't suppose you know the syscall clobbered list for aarch64 Linux? Can't find it documented anywhere and not sure how to dig it out of the kernel A sibling
by JonChesterfield 2y ago
I don't suppose you know the syscall clobbered list for aarch64 Linux? Can't find it documented anywhere and not sure how to dig it out of the kernel
A sibling comment pointed at https://chromium.googlesource.com/linux-syscall-support/+/refs/tags/v2022.10.12/linux_syscall_support.h https://chromium.googlesource.com/linux-syscall-support/+/re... which suggests none are clobbered outside of the arguments used by a given call which is possible but seems unlikely
- jart 2y agoI think that's accurate. Example code: static privileged int GetPid(void) { int res; #ifdef __x86_64__ asm volatile("syscall" : "=a"(res) : "0"(__NR_linux_getpid) : "rcx", "r11", "memory"); #elif defined(__aarch64__) register long res_x0 asm("x0"); asm volatile("mov\tx8,%1\n\t" "svc\t0" : "=r"(res_x0) : "i"(__NR_linux_getpid) : "x8", "memory"); res = res_x0; #endif return res; } You should be fine.