• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #define __SYSCALL_LL_E(x) (x)
2 #define __SYSCALL_LL_O(x) (x)
3 
4 #define __asm_syscall(...) \
5 	__asm__ __volatile__ ("ecall\n\t" \
6 	: "=r"(a0) : __VA_ARGS__ : "memory"); \
7 	return a0; \
8 
__syscall0(long n)9 static inline long __syscall0(long n)
10 {
11 	register long a7 __asm__("a7") = n;
12 	register long a0 __asm__("a0");
13 	__asm_syscall("r"(a7))
14 }
15 
__syscall1(long n,long a)16 static inline long __syscall1(long n, long a)
17 {
18 	register long a7 __asm__("a7") = n;
19 	register long a0 __asm__("a0") = a;
20 	__asm_syscall("r"(a7), "0"(a0))
21 }
22 
__syscall2(long n,long a,long b)23 static inline long __syscall2(long n, long a, long b)
24 {
25 	register long a7 __asm__("a7") = n;
26 	register long a0 __asm__("a0") = a;
27 	register long a1 __asm__("a1") = b;
28 	__asm_syscall("r"(a7), "0"(a0), "r"(a1))
29 }
30 
__syscall3(long n,long a,long b,long c)31 static inline long __syscall3(long n, long a, long b, long c)
32 {
33 	register long a7 __asm__("a7") = n;
34 	register long a0 __asm__("a0") = a;
35 	register long a1 __asm__("a1") = b;
36 	register long a2 __asm__("a2") = c;
37 	__asm_syscall("r"(a7), "0"(a0), "r"(a1), "r"(a2))
38 }
39 
__syscall4(long n,long a,long b,long c,long d)40 static inline long __syscall4(long n, long a, long b, long c, long d)
41 {
42 	register long a7 __asm__("a7") = n;
43 	register long a0 __asm__("a0") = a;
44 	register long a1 __asm__("a1") = b;
45 	register long a2 __asm__("a2") = c;
46 	register long a3 __asm__("a3") = d;
47 	__asm_syscall("r"(a7), "0"(a0), "r"(a1), "r"(a2), "r"(a3))
48 }
49 
__syscall5(long n,long a,long b,long c,long d,long e)50 static inline long __syscall5(long n, long a, long b, long c, long d, long e)
51 {
52 	register long a7 __asm__("a7") = n;
53 	register long a0 __asm__("a0") = a;
54 	register long a1 __asm__("a1") = b;
55 	register long a2 __asm__("a2") = c;
56 	register long a3 __asm__("a3") = d;
57 	register long a4 __asm__("a4") = e;
58 	__asm_syscall("r"(a7), "0"(a0), "r"(a1), "r"(a2), "r"(a3), "r"(a4))
59 }
60 
__syscall6(long n,long a,long b,long c,long d,long e,long f)61 static inline long __syscall6(long n, long a, long b, long c, long d, long e, long f)
62 {
63 	register long a7 __asm__("a7") = n;
64 	register long a0 __asm__("a0") = a;
65 	register long a1 __asm__("a1") = b;
66 	register long a2 __asm__("a2") = c;
67 	register long a3 __asm__("a3") = d;
68 	register long a4 __asm__("a4") = e;
69 	register long a5 __asm__("a5") = f;
70 	__asm_syscall("r"(a7), "0"(a0), "r"(a1), "r"(a2), "r"(a3), "r"(a4), "r"(a5))
71 }
72 
73 #define VDSO_USEFUL
74 /* We don't have a clock_gettime function.
75 #define VDSO_CGT_SYM "__vdso_clock_gettime"
76 #define VDSO_CGT_VER "LINUX_2.6" */
77 
78 #define IPC_64 0
79