1/* 2 * Copyright 2019 Haiku, Inc. All Rights Reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5#define _AARCH64_SYSCALL_ENCODE(name, code, nparams) \ 6.globl name; \ 7.type name,%function; \ 8.p2align 2; \ 9name: \ 10 svc #(((code) << 5) | (nparams)); \ 11 ret 12 13#define SYSCALL0(name, n) _AARCH64_SYSCALL_ENCODE(name, n, 0) 14#define SYSCALL1(name, n) _AARCH64_SYSCALL_ENCODE(name, n, 1) 15#define SYSCALL2(name, n) _AARCH64_SYSCALL_ENCODE(name, n, 2) 16#define SYSCALL3(name, n) _AARCH64_SYSCALL_ENCODE(name, n, 3) 17#define SYSCALL4(name, n) _AARCH64_SYSCALL_ENCODE(name, n, 4) 18#define SYSCALL5(name, n) _AARCH64_SYSCALL_ENCODE(name, n, 5) 19#define SYSCALL6(name, n) _AARCH64_SYSCALL_ENCODE(name, n, 6) 20#define SYSCALL7(name, n) _AARCH64_SYSCALL_ENCODE(name, n, 7) 21#define SYSCALL8(name, n) _AARCH64_SYSCALL_ENCODE(name, n, 8) 22#define SYSCALL9(name, n) _AARCH64_SYSCALL_ENCODE(name, n, 9) 23#define SYSCALL10(name, n) _AARCH64_SYSCALL_ENCODE(name, n, 10) 24#define SYSCALL11(name, n) _AARCH64_SYSCALL_ENCODE(name, n, 11) 25#define SYSCALL12(name, n) _AARCH64_SYSCALL_ENCODE(name, n, 12) 26#define SYSCALL13(name, n) _AARCH64_SYSCALL_ENCODE(name, n, 13) 27#define SYSCALL14(name, n) _AARCH64_SYSCALL_ENCODE(name, n, 14) 28#define SYSCALL15(name, n) _AARCH64_SYSCALL_ENCODE(name, n, 15) 29#define SYSCALL16(name, n) _AARCH64_SYSCALL_ENCODE(name, n, 16) 30#define SYSCALL17(name, n) _AARCH64_SYSCALL_ENCODE(name, n, 17) 31#define SYSCALL18(name, n) _AARCH64_SYSCALL_ENCODE(name, n, 18) 32#define SYSCALL19(name, n) _AARCH64_SYSCALL_ENCODE(name, n, 19) 33#define SYSCALL20(name, n) _AARCH64_SYSCALL_ENCODE(name, n, 20) 34