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"(r0) : __VA_ARGS__ : "memory"); \
12 static inline long __syscall0(long n
)
14 register long r7
__asm__("r7") = n
;
15 register long r0
__asm__("r0");
16 __asm_syscall("r"(r7
));
19 static inline long __syscall1(long n
, long a
)
21 register long r7
__asm__("r7") = n
;
22 register long r0
__asm__("r0") = a
;
23 __asm_syscall("r"(r7
), "0"(r0
));
26 static inline long __syscall2(long n
, long a
, long b
)
28 register long r7
__asm__("r7") = n
;
29 register long r0
__asm__("r0") = a
;
30 register long r1
__asm__("r1") = b
;
31 __asm_syscall("r"(r7
), "0"(r0
), "r"(r1
));
34 static inline long __syscall3(long n
, long a
, long b
, long c
)
36 register long r7
__asm__("r7") = n
;
37 register long r0
__asm__("r0") = a
;
38 register long r1
__asm__("r1") = b
;
39 register long r2
__asm__("r2") = c
;
40 __asm_syscall("r"(r7
), "0"(r0
), "r"(r1
), "r"(r2
));
43 static inline long __syscall4(long n
, long a
, long b
, long c
, long d
)
45 register long r7
__asm__("r7") = n
;
46 register long r0
__asm__("r0") = a
;
47 register long r1
__asm__("r1") = b
;
48 register long r2
__asm__("r2") = c
;
49 register long r3
__asm__("r3") = d
;
50 __asm_syscall("r"(r7
), "0"(r0
), "r"(r1
), "r"(r2
), "r"(r3
));
53 static inline long __syscall5(long n
, long a
, long b
, long c
, long d
, long e
)
55 register long r7
__asm__("r7") = n
;
56 register long r0
__asm__("r0") = a
;
57 register long r1
__asm__("r1") = b
;
58 register long r2
__asm__("r2") = c
;
59 register long r3
__asm__("r3") = d
;
60 register long r4
__asm__("r4") = e
;
61 __asm_syscall("r"(r7
), "0"(r0
), "r"(r1
), "r"(r2
), "r"(r3
), "r"(r4
));
64 static inline long __syscall6(long n
, long a
, long b
, long c
, long d
, long e
, long f
)
66 register long r7
__asm__("r7") = n
;
67 register long r0
__asm__("r0") = a
;
68 register long r1
__asm__("r1") = b
;
69 register long r2
__asm__("r2") = c
;
70 register long r3
__asm__("r3") = d
;
71 register long r4
__asm__("r4") = e
;
72 register long r5
__asm__("r5") = f
;
73 __asm_syscall("r"(r7
), "0"(r0
), "r"(r1
), "r"(r2
), "r"(r3
), "r"(r4
), "r"(r5
));
77 #define VDSO_CGT_SYM "__vdso_clock_gettime"
78 #define VDSO_CGT_VER "LINUX_2.6"
80 #define SYSCALL_FADVISE_6_ARG