fix __syscall declaration with wrong visibility in syscall_arch.h
[oweals/musl.git] / arch / aarch64 / syscall_arch.h
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))
5
6 #define __asm_syscall(...) do { \
7         __asm__ __volatile__ ( "svc 0" \
8         : "=r"(x0) : __VA_ARGS__ : "memory", "cc"); \
9         return x0; \
10         } while (0)
11
12 static inline long __syscall0(long n)
13 {
14         register long x8 __asm__("x8") = n;
15         register long x0 __asm__("x0");
16         __asm_syscall("r"(x8));
17 }
18
19 static inline long __syscall1(long n, long a)
20 {
21         register long x8 __asm__("x8") = n;
22         register long x0 __asm__("x0") = a;
23         __asm_syscall("r"(x8), "0"(x0));
24 }
25
26 static inline long __syscall2(long n, long a, long b)
27 {
28         register long x8 __asm__("x8") = n;
29         register long x0 __asm__("x0") = a;
30         register long x1 __asm__("x1") = b;
31         __asm_syscall("r"(x8), "0"(x0), "r"(x1));
32 }
33
34 static inline long __syscall3(long n, long a, long b, long c)
35 {
36         register long x8 __asm__("x8") = n;
37         register long x0 __asm__("x0") = a;
38         register long x1 __asm__("x1") = b;
39         register long x2 __asm__("x2") = c;
40         __asm_syscall("r"(x8), "0"(x0), "r"(x1), "r"(x2));
41 }
42
43 static inline long __syscall4(long n, long a, long b, long c, long d)
44 {
45         register long x8 __asm__("x8") = n;
46         register long x0 __asm__("x0") = a;
47         register long x1 __asm__("x1") = b;
48         register long x2 __asm__("x2") = c;
49         register long x3 __asm__("x3") = d;
50         __asm_syscall("r"(x8), "0"(x0), "r"(x1), "r"(x2), "r"(x3));
51 }
52
53 static inline long __syscall5(long n, long a, long b, long c, long d, long e)
54 {
55         register long x8 __asm__("x8") = n;
56         register long x0 __asm__("x0") = a;
57         register long x1 __asm__("x1") = b;
58         register long x2 __asm__("x2") = c;
59         register long x3 __asm__("x3") = d;
60         register long x4 __asm__("x4") = e;
61         __asm_syscall("r"(x8), "0"(x0), "r"(x1), "r"(x2), "r"(x3), "r"(x4));
62 }
63
64 static inline long __syscall6(long n, long a, long b, long c, long d, long e, long f)
65 {
66         register long x8 __asm__("x8") = n;
67         register long x0 __asm__("x0") = a;
68         register long x1 __asm__("x1") = b;
69         register long x2 __asm__("x2") = c;
70         register long x3 __asm__("x3") = d;
71         register long x4 __asm__("x4") = e;
72         register long x5 __asm__("x5") = f;
73         __asm_syscall("r"(x8), "0"(x0), "r"(x1), "r"(x2), "r"(x3), "r"(x4), "r"(x5));
74 }
75
76 #define VDSO_USEFUL
77 #define VDSO_CGT_SYM "__kernel_clock_gettime"
78 #define VDSO_CGT_VER "LINUX_2.6.39"