FreeBSD: add file descriptor tracking for _umtx_op
[valgrind.git] / none / tests / s390x / svc.h
blob166eb8a8f63c5ccaddef64787e91b11488150f80
1 #ifndef SVC_H
2 #define SVC_H
3 #include <asm/unistd.h>
4 #include <sys/syscall.h>
6 static inline long
7 svc0(int num)
9 register int _num asm("1") = num;
10 register long ret asm("2");
12 asm volatile( "svc 0\n"
13 :"=d"(ret)
14 : "d" (_num)
15 : "cc", "memory");
16 return ret;
19 static inline long
20 svc1(int num, unsigned long arg1)
22 register int _num asm("1") = num;
23 register long ret asm("2");
24 register unsigned long _arg1 asm("2") = arg1;
26 asm volatile( "svc 0\n"
27 :"=d"(ret)
28 : "d" (_num), "d" (_arg1)
29 : "cc", "memory");
30 return ret;
33 static inline long
34 svc2(int num, unsigned long arg1, unsigned long arg2)
36 register int _num asm("1") = num;
37 register long ret asm("2");
38 register unsigned long _arg1 asm("2") = arg1;
39 register unsigned long _arg2 asm("3") = arg2;
41 asm volatile( "svc 0\n"
42 :"=d"(ret)
43 : "d" (_num), "d" (_arg1), "d" (_arg2)
44 : "cc", "memory");
45 return ret;
49 static inline long
50 svc3(int num, unsigned long arg1, unsigned long arg2, unsigned long arg3)
52 register int _num asm("1") = num;
53 register long ret asm("2");
54 register unsigned long _arg1 asm("2") = arg1;
55 register unsigned long _arg2 asm("3") = arg2;
56 register unsigned long _arg3 asm("4") = arg3;
58 asm volatile( "svc 0\n"
59 :"=d"(ret)
60 : "d" (_num), "d" (_arg1), "d" (_arg2), "d" (_arg3)
61 : "cc", "memory");
62 return ret;
67 static inline long
68 svc4(int num, unsigned long arg1, unsigned long arg2, unsigned long arg3, unsigned long arg4)
70 register int _num asm("1") = num;
71 register long ret asm("2");
72 register unsigned long _arg1 asm("2") = arg1;
73 register unsigned long _arg2 asm("3") = arg2;
74 register unsigned long _arg3 asm("4") = arg3;
75 register unsigned long _arg4 asm("5") = arg4;
77 asm volatile( "svc 0\n"
78 :"=d"(ret)
79 : "d" (_num), "d" (_arg1), "d" (_arg2), "d" (_arg3), "d" (_arg4)
80 : "cc", "memory");
81 return ret;
86 static inline long
87 svc5(int num, unsigned long arg1, unsigned long arg2, unsigned long arg3, unsigned long arg4,
88 unsigned long arg5)
90 register int _num asm("1") = num;
91 register long ret asm("2");
92 register unsigned long _arg1 asm("2") = arg1;
93 register unsigned long _arg2 asm("3") = arg2;
94 register unsigned long _arg3 asm("4") = arg3;
95 register unsigned long _arg4 asm("5") = arg4;
96 register unsigned long _arg5 asm("6") = arg5;
98 asm volatile( "svc 0\n"
99 :"=d"(ret)
100 : "d" (_num), "d" (_arg1), "d" (_arg2), "d" (_arg3), "d" (_arg4), "d" (_arg5)
101 : "cc", "memory");
102 return ret;
105 #endif /* SVC_H */