• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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))
5 
__syscall0(long n)6 static __inline long __syscall0(long n)
7 {
8 	register unsigned long r12 __asm__("r12") = n;
9 	register unsigned long r3 __asm__("r3");
10 	__asm__ __volatile__ ("brki r14, 0x8" : "=r"(r3)
11 		: "r"(r12)
12 		: "memory", "r4");
13 	return r3;
14 }
15 
__syscall1(long n,long a)16 static inline long __syscall1(long n, long a)
17 {
18 	register unsigned long r12 __asm__("r12") = n;
19 	register unsigned long r3 __asm__("r3");
20 	register unsigned long r5 __asm__("r5") = a;
21 	__asm__ __volatile__ ("brki r14, 0x8" : "=r"(r3)
22 		: "r"(r12), "r"(r5)
23 		: "memory", "r4");
24 	return r3;
25 }
26 
__syscall2(long n,long a,long b)27 static inline long __syscall2(long n, long a, long b)
28 {
29 	register unsigned long r12 __asm__("r12") = n;
30 	register unsigned long r3 __asm__("r3");
31 	register unsigned long r5 __asm__("r5") = a;
32 	register unsigned long r6 __asm__("r6") = b;
33 	__asm__ __volatile__ ("brki r14, 0x8" : "=r"(r3)
34 		: "r"(r12), "r"(r5), "r"(r6)
35 		: "memory", "r4");
36 	return r3;
37 }
38 
__syscall3(long n,long a,long b,long c)39 static inline long __syscall3(long n, long a, long b, long c)
40 {
41 	register unsigned long r12 __asm__("r12") = n;
42 	register unsigned long r3 __asm__("r3");
43 	register unsigned long r5 __asm__("r5") = a;
44 	register unsigned long r6 __asm__("r6") = b;
45 	register unsigned long r7 __asm__("r7") = c;
46 	__asm__ __volatile__ ("brki r14, 0x8" : "=r"(r3)
47 		: "r"(r12), "r"(r5), "r"(r6), "r"(r7)
48 		: "memory", "r4");
49 	return r3;
50 }
51 
__syscall4(long n,long a,long b,long c,long d)52 static inline long __syscall4(long n, long a, long b, long c, long d)
53 {
54 	register unsigned long r12 __asm__("r12") = n;
55 	register unsigned long r3 __asm__("r3");
56 	register unsigned long r5 __asm__("r5") = a;
57 	register unsigned long r6 __asm__("r6") = b;
58 	register unsigned long r7 __asm__("r7") = c;
59 	register unsigned long r8 __asm__("r8") = d;
60 	__asm__ __volatile__ ("brki r14, 0x8" : "=r"(r3)
61 		: "r"(r12), "r"(r5), "r"(r6), "r"(r7), "r"(r8)
62 		: "memory", "r4");
63 	return r3;
64 }
65 
__syscall5(long n,long a,long b,long c,long d,long e)66 static inline long __syscall5(long n, long a, long b, long c, long d, long e)
67 {
68 	register unsigned long r12 __asm__("r12") = n;
69 	register unsigned long r3 __asm__("r3");
70 	register unsigned long r5 __asm__("r5") = a;
71 	register unsigned long r6 __asm__("r6") = b;
72 	register unsigned long r7 __asm__("r7") = c;
73 	register unsigned long r8 __asm__("r8") = d;
74 	register unsigned long r9 __asm__("r9") = e;
75 	__asm__ __volatile__ ("brki r14, 0x8" : "=r"(r3)
76 		: "r"(r12), "r"(r5), "r"(r6), "r"(r7), "r"(r8), "r"(r9)
77 		: "memory", "r4");
78 	return r3;
79 }
80 
__syscall6(long n,long a,long b,long c,long d,long e,long f)81 static inline long __syscall6(long n, long a, long b, long c, long d, long e, long f)
82 {
83 	register unsigned long r12 __asm__("r12") = n;
84 	register unsigned long r3 __asm__("r3");
85 	register unsigned long r5 __asm__("r5") = a;
86 	register unsigned long r6 __asm__("r6") = b;
87 	register unsigned long r7 __asm__("r7") = c;
88 	register unsigned long r8 __asm__("r8") = d;
89 	register unsigned long r9 __asm__("r9") = e;
90 	register unsigned long r10 __asm__("r10") = f;
91 	__asm__ __volatile__ ("brki r14, 0x8" : "=r"(r3)
92 		: "r"(r12), "r"(r5), "r"(r6), "r"(r7), "r"(r8), "r"(r9), "r"(r10)
93 		: "memory", "r4");
94 	return r3;
95 }
96 
97 #define SYSCALL_IPC_BROKEN_MODE
98 
99 #undef SYS_socketcall
100