2 * Copyright 2012, Alex Smith, alex@alex-smith.me.uk.
3 * Distributed under the terms of the MIT License.
10 // The kernel follows the AMD64 ABI for parameter passing (first 6 arguments in
11 // registers and the remaining ones in on the stack), except that RCX (argument
12 // 4) is overwritten by the SYSCALL instruction, so it is moved to R10. Syscall
13 // number goes in RAX.
16 #define _SYSCALL_NO_RCX(name, n) \
24 #define _SYSCALL_RCX(name, n) \
34 #define SYSCALL0(name, n) _SYSCALL_NO_RCX(name, n)
35 #define SYSCALL1(name, n) _SYSCALL_NO_RCX(name, n)
36 #define SYSCALL2(name, n) _SYSCALL_NO_RCX(name, n)
37 #define SYSCALL3(name, n) _SYSCALL_NO_RCX(name, n)
38 #define SYSCALL4(name, n) _SYSCALL_RCX(name, n)
39 #define SYSCALL5(name, n) _SYSCALL_RCX(name, n)
40 #define SYSCALL6(name, n) _SYSCALL_RCX(name, n)
41 #define SYSCALL7(name, n) _SYSCALL_RCX(name, n)
42 #define SYSCALL8(name, n) _SYSCALL_RCX(name, n)
43 #define SYSCALL9(name, n) _SYSCALL_RCX(name, n)
44 #define SYSCALL10(name, n) _SYSCALL_RCX(name, n)
45 #define SYSCALL11(name, n) _SYSCALL_RCX(name, n)
46 #define SYSCALL12(name, n) _SYSCALL_RCX(name, n)
47 #define SYSCALL13(name, n) _SYSCALL_RCX(name, n)
48 #define SYSCALL14(name, n) _SYSCALL_RCX(name, n)
49 #define SYSCALL15(name, n) _SYSCALL_RCX(name, n)
50 #define SYSCALL16(name, n) _SYSCALL_RCX(name, n)
51 #define SYSCALL17(name, n) _SYSCALL_RCX(name, n)
52 #define SYSCALL18(name, n) _SYSCALL_RCX(name, n)
53 #define SYSCALL19(name, n) _SYSCALL_RCX(name, n)
54 #define SYSCALL20(name, n) _SYSCALL_RCX(name, n)