1 #define __SYSCALL_LL_E(x) \
2 ((union { long long ll; long l[2]; }){ .ll = x }).l[0], \
3 ((union { long long ll; long l[2]; }){ .ll = x }).l[1]
4 #define __SYSCALL_LL_O(x) 0, __SYSCALL_LL_E((x))
6 #define __asm_syscall(...) do { \
7 __asm__ __volatile__ ( "svc 0" \
8 : "=r"(x0) : __VA_ARGS__ : "memory", "cc"); \
12 static inline long __syscall0(long n)
14 register long x8 __asm__("x8") = n;
15 register long x0 __asm__("x0");
16 __asm_syscall("r"(x8));
19 static inline long __syscall1(long n, long a)
21 register long x8 __asm__("x8") = n;
22 register long x0 __asm__("x0") = a;
23 __asm_syscall("r"(x8), "0"(x0));
26 static inline long __syscall2(long n, long a, long b)
28 register long x8 __asm__("x8") = n;
29 register long x0 __asm__("x0") = a;
30 register long x1 __asm__("x1") = b;
31 __asm_syscall("r"(x8), "0"(x0), "r"(x1));
34 static inline long __syscall3(long n, long a, long b, long c)
36 register long x8 __asm__("x8") = n;
37 register long x0 __asm__("x0") = a;
38 register long x1 __asm__("x1") = b;
39 register long x2 __asm__("x2") = c;
40 __asm_syscall("r"(x8), "0"(x0), "r"(x1), "r"(x2));
43 static inline long __syscall4(long n, long a, long b, long c, long d)
45 register long x8 __asm__("x8") = n;
46 register long x0 __asm__("x0") = a;
47 register long x1 __asm__("x1") = b;
48 register long x2 __asm__("x2") = c;
49 register long x3 __asm__("x3") = d;
50 __asm_syscall("r"(x8), "0"(x0), "r"(x1), "r"(x2), "r"(x3));
53 static inline long __syscall5(long n, long a, long b, long c, long d, long e)
55 register long x8 __asm__("x8") = n;
56 register long x0 __asm__("x0") = a;
57 register long x1 __asm__("x1") = b;
58 register long x2 __asm__("x2") = c;
59 register long x3 __asm__("x3") = d;
60 register long x4 __asm__("x4") = e;
61 __asm_syscall("r"(x8), "0"(x0), "r"(x1), "r"(x2), "r"(x3), "r"(x4));
64 static inline long __syscall6(long n, long a, long b, long c, long d, long e, long f)
66 register long x8 __asm__("x8") = n;
67 register long x0 __asm__("x0") = a;
68 register long x1 __asm__("x1") = b;
69 register long x2 __asm__("x2") = c;
70 register long x3 __asm__("x3") = d;
71 register long x4 __asm__("x4") = e;
72 register long x5 __asm__("x5") = f;
73 __asm_syscall("r"(x8), "0"(x0), "r"(x1), "r"(x2), "r"(x3), "r"(x4), "r"(x5));
77 #define VDSO_CGT_SYM "__kernel_clock_gettime"
78 #define VDSO_CGT_VER "LINUX_2.6.39"