syscall.s (535B)
1 /* tcc-build aarch64 syscall trampoline. 2 * 3 * Mirrors src/internal/x86_64/syscall.s. C-ABI passes the syscall 4 * number in x0 and arguments in x1-x6; Linux aarch64 syscall ABI 5 * wants the number in x8 and arguments in x0-x5. Shuffle and svc. 6 * Return value is already in x0 from the kernel side. 7 * 8 * Mnemonics here are all in arm64-asm.c phase 1 (mov reg-reg, svc, 9 * ret). */ 10 11 .global __syscall 12 .type __syscall,@function 13 __syscall: 14 mov x8, x0 15 mov x0, x1 16 mov x1, x2 17 mov x2, x3 18 mov x3, x4 19 mov x4, x5 20 mov x5, x6 21 svc #0 22 ret