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 long (__syscall)(long, ...);
8 #define __asm_syscall(...) do { \
9 __asm__ __volatile__ ( "svc 0" \
10 : "=r"(x0) : __VA_ARGS__ : "memory", "cc"); \
14 static inline long __syscall0(long n)
16 register long x8 __asm__("x8") = n;
17 register long x0 __asm__("x0");
18 __asm_syscall("r"(x8));
21 static inline long __syscall1(long n, long a)
23 register long x8 __asm__("x8") = n;
24 register long x0 __asm__("x0") = a;
25 __asm_syscall("r"(x8), "0"(x0));
28 static inline long __syscall2(long n, long a, long b)
30 register long x8 __asm__("x8") = n;
31 register long x0 __asm__("x0") = a;
32 register long x1 __asm__("x1") = b;
33 __asm_syscall("r"(x8), "0"(x0), "r"(x1));
36 static inline long __syscall3(long n, long a, long b, long c)
38 register long x8 __asm__("x8") = n;
39 register long x0 __asm__("x0") = a;
40 register long x1 __asm__("x1") = b;
41 register long x2 __asm__("x2") = c;
42 __asm_syscall("r"(x8), "0"(x0), "r"(x1), "r"(x2));
45 static inline long __syscall4(long n, long a, long b, long c, long d)
47 register long x8 __asm__("x8") = n;
48 register long x0 __asm__("x0") = a;
49 register long x1 __asm__("x1") = b;
50 register long x2 __asm__("x2") = c;
51 register long x3 __asm__("x3") = d;
52 __asm_syscall("r"(x8), "0"(x0), "r"(x1), "r"(x2), "r"(x3));
55 static inline long __syscall5(long n, long a, long b, long c, long d, long e)
57 register long x8 __asm__("x8") = n;
58 register long x0 __asm__("x0") = a;
59 register long x1 __asm__("x1") = b;
60 register long x2 __asm__("x2") = c;
61 register long x3 __asm__("x3") = d;
62 register long x4 __asm__("x4") = e;
63 __asm_syscall("r"(x8), "0"(x0), "r"(x1), "r"(x2), "r"(x3), "r"(x4));
66 static inline long __syscall6(long n, long a, long b, long c, long d, long e, long f)
68 register long x8 __asm__("x8") = n;
69 register long x0 __asm__("x0") = a;
70 register long x1 __asm__("x1") = b;
71 register long x2 __asm__("x2") = c;
72 register long x3 __asm__("x3") = d;
73 register long x4 __asm__("x4") = e;
74 register long x5 __asm__("x5") = f;
75 __asm_syscall("r"(x8), "0"(x0), "r"(x1), "r"(x2), "r"(x3), "r"(x4), "r"(x5));
79 #define VDSO_CGT_SYM "__kernel_clock_gettime"
80 #define VDSO_CGT_VER "LINUX_2.6.39"