PPC port cleaned up, static linking works well now.
[musl] / arch / powerpc / 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 _NSIG 64
7 #define __SYSCALL_SSLEN (_NSIG/8)
8
9 long (__syscall)(long, ...);
10
11 static inline long __syscall0(long n)
12 {
13         return (__syscall)(n, 0, 0, 0, 0, 0, 0);
14 }
15
16 static inline long __syscall1(long n, long a)
17 {
18         return (__syscall)(n, a, 0, 0, 0, 0, 0);
19 }
20
21 static inline long __syscall2(long n, long a, long b)
22 {
23         return (__syscall)(n, a, b, 0, 0, 0, 0);
24 }
25
26 static inline long __syscall3(long n, long a, long b, long c)
27 {
28         return (__syscall)(n, a, b, c, 0, 0, 0);
29 }
30
31 static inline long __syscall4(long n, long a, long b, long c, long d)
32 {
33         return (__syscall)(n, a, b, c, d, 0, 0);
34 }
35
36 static inline long __syscall5(long n, long a, long b, long c, long d, long e)
37 {
38         return (__syscall)(n, a, b, c, d, e, 0);
39 }
40
41 static inline long __syscall6(long n, long a, long b, long c, long d, long e, long f)
42 {
43         return (__syscall)(n, a, b, c, d, e, f);
44 }
45
46 #define __SC_socket      1
47 #define __SC_bind        2
48 #define __SC_connect     3
49 #define __SC_listen      4
50 #define __SC_accept      5
51 #define __SC_getsockname 6
52 #define __SC_getpeername 7
53 #define __SC_socketpair  8
54 #define __SC_send        9
55 #define __SC_recv        10
56 #define __SC_sendto      11
57 #define __SC_recvfrom    12
58 #define __SC_shutdown    13
59 #define __SC_setsockopt  14
60 #define __SC_getsockopt  15
61 #define __SC_sendmsg     16
62 #define __SC_recvmsg     17