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) __SYSCALL_LL_E((x))
6 #define SYSCALL_MMAP2_UNIT 8192ULL
8 static __inline
long __syscall0(long n
)
10 register unsigned long r11
__asm__("r11") = n
;
11 __asm__
__volatile__ ("l.sys 1"
14 : "memory", "r3", "r4", "r5", "r6", "r7", "r8",
15 "r12", "r13", "r15", "r17", "r19", "r21",
16 "r23", "r25", "r27", "r29", "r31");
20 static inline long __syscall1(long n
, long a
)
22 register unsigned long r11
__asm__("r11") = n
;
23 register unsigned long r3
__asm__("r3") = a
;
24 __asm__
__volatile__ ("l.sys 1"
27 : "memory", "r4", "r5", "r6", "r7", "r8",
28 "r12", "r13", "r15", "r17", "r19", "r21",
29 "r23", "r25", "r27", "r29", "r31");
33 static inline long __syscall2(long n
, long a
, long b
)
35 register unsigned long r11
__asm__("r11") = n
;
36 register unsigned long r3
__asm__("r3") = a
;
37 register unsigned long r4
__asm__("r4") = b
;
38 __asm__
__volatile__ ("l.sys 1"
40 : "r"(r11
), "r"(r3
), "r"(r4
)
41 : "memory", "r5", "r6", "r7", "r8",
42 "r12", "r13", "r15", "r17", "r19", "r21",
43 "r23", "r25", "r27", "r29", "r31");
47 static inline long __syscall3(long n
, long a
, long b
, long c
)
49 register unsigned long r11
__asm__("r11") = n
;
50 register unsigned long r3
__asm__("r3") = a
;
51 register unsigned long r4
__asm__("r4") = b
;
52 register unsigned long r5
__asm__("r5") = c
;
53 __asm__
__volatile__ ("l.sys 1"
55 : "r"(r11
), "r"(r3
), "r"(r4
), "r"(r5
)
56 : "memory", "r6", "r7", "r8",
57 "r12", "r13", "r15", "r17", "r19", "r21",
58 "r23", "r25", "r27", "r29", "r31");
62 static inline long __syscall4(long n
, long a
, long b
, long c
, long d
)
64 register unsigned long r11
__asm__("r11") = n
;
65 register unsigned long r3
__asm__("r3") = a
;
66 register unsigned long r4
__asm__("r4") = b
;
67 register unsigned long r5
__asm__("r5") = c
;
68 register unsigned long r6
__asm__("r6") = d
;
69 __asm__
__volatile__ ("l.sys 1"
71 : "r"(r11
), "r"(r3
), "r"(r4
), "r"(r5
), "r"(r6
)
72 : "memory", "r7", "r8",
73 "r12", "r13", "r15", "r17", "r19", "r21",
74 "r23", "r25", "r27", "r29", "r31");
78 static inline long __syscall5(long n
, long a
, long b
, long c
, long d
, long e
)
80 register unsigned long r11
__asm__("r11") = n
;
81 register unsigned long r3
__asm__("r3") = a
;
82 register unsigned long r4
__asm__("r4") = b
;
83 register unsigned long r5
__asm__("r5") = c
;
84 register unsigned long r6
__asm__("r6") = d
;
85 register unsigned long r7
__asm__("r7") = e
;
86 __asm__
__volatile__ ("l.sys 1"
88 : "r"(r11
), "r"(r3
), "r"(r4
), "r"(r5
), "r"(r6
),
91 "r12", "r13", "r15", "r17", "r19", "r21",
92 "r23", "r25", "r27", "r29", "r31");
96 static inline long __syscall6(long n
, long a
, long b
, long c
, long d
, long e
, long f
)
98 register unsigned long r11
__asm__("r11") = n
;
99 register unsigned long r3
__asm__("r3") = a
;
100 register unsigned long r4
__asm__("r4") = b
;
101 register unsigned long r5
__asm__("r5") = c
;
102 register unsigned long r6
__asm__("r6") = d
;
103 register unsigned long r7
__asm__("r7") = e
;
104 register unsigned long r8
__asm__("r8") = f
;
105 __asm__
__volatile__ ("l.sys 1"
107 : "r"(r11
), "r"(r3
), "r"(r4
), "r"(r5
), "r"(r6
),
110 "r12", "r13", "r15", "r17", "r19", "r21",
111 "r23", "r25", "r27", "r29", "r31");