ia64/xen-unstable

view tools/libaio/src/syscall-alpha.h @ 10736:2937703f0ed0

Added blktap support. Includes kernel driver (enabled as CONFIG_XEN_BLKDEV_TAP=y) and userspace tools. The userspace deamon (blktapctrl) is enabled by default when xend is activated. For further information on using and configuring blktap see tools/blktap/README.
author jchesterfield@dhcp92.uk.xensource.com
date Thu Jul 13 10:13:26 2006 +0100 (2006-07-13)
parents
children
line source
1 #define __NR_io_setup 398
2 #define __NR_io_destroy 399
3 #define __NR_io_getevents 400
4 #define __NR_io_submit 401
5 #define __NR_io_cancel 402
7 #define inline_syscall_r0_asm
8 #define inline_syscall_r0_out_constraint "=v"
10 #define inline_syscall_clobbers \
11 "$1", "$2", "$3", "$4", "$5", "$6", "$7", "$8", \
12 "$22", "$23", "$24", "$25", "$27", "$28", "memory"
14 #define inline_syscall0(name, args...) \
15 { \
16 register long _sc_0 inline_syscall_r0_asm; \
17 register long _sc_19 __asm__("$19"); \
18 \
19 _sc_0 = name; \
20 __asm__ __volatile__ \
21 ("callsys # %0 %1 <= %2" \
22 : inline_syscall_r0_out_constraint (_sc_0), \
23 "=r"(_sc_19) \
24 : "0"(_sc_0) \
25 : inline_syscall_clobbers, \
26 "$16", "$17", "$18", "$20", "$21"); \
27 _sc_ret = _sc_0, _sc_err = _sc_19; \
28 }
30 #define inline_syscall1(name,arg1) \
31 { \
32 register long _sc_0 inline_syscall_r0_asm; \
33 register long _sc_16 __asm__("$16"); \
34 register long _sc_19 __asm__("$19"); \
35 \
36 _sc_0 = name; \
37 _sc_16 = (long) (arg1); \
38 __asm__ __volatile__ \
39 ("callsys # %0 %1 <= %2 %3" \
40 : inline_syscall_r0_out_constraint (_sc_0), \
41 "=r"(_sc_19), "=r"(_sc_16) \
42 : "0"(_sc_0), "2"(_sc_16) \
43 : inline_syscall_clobbers, \
44 "$17", "$18", "$20", "$21"); \
45 _sc_ret = _sc_0, _sc_err = _sc_19; \
46 }
48 #define inline_syscall2(name,arg1,arg2) \
49 { \
50 register long _sc_0 inline_syscall_r0_asm; \
51 register long _sc_16 __asm__("$16"); \
52 register long _sc_17 __asm__("$17"); \
53 register long _sc_19 __asm__("$19"); \
54 \
55 _sc_0 = name; \
56 _sc_16 = (long) (arg1); \
57 _sc_17 = (long) (arg2); \
58 __asm__ __volatile__ \
59 ("callsys # %0 %1 <= %2 %3 %4" \
60 : inline_syscall_r0_out_constraint (_sc_0), \
61 "=r"(_sc_19), "=r"(_sc_16), "=r"(_sc_17) \
62 : "0"(_sc_0), "2"(_sc_16), "3"(_sc_17) \
63 : inline_syscall_clobbers, \
64 "$18", "$20", "$21"); \
65 _sc_ret = _sc_0, _sc_err = _sc_19; \
66 }
68 #define inline_syscall3(name,arg1,arg2,arg3) \
69 { \
70 register long _sc_0 inline_syscall_r0_asm; \
71 register long _sc_16 __asm__("$16"); \
72 register long _sc_17 __asm__("$17"); \
73 register long _sc_18 __asm__("$18"); \
74 register long _sc_19 __asm__("$19"); \
75 \
76 _sc_0 = name; \
77 _sc_16 = (long) (arg1); \
78 _sc_17 = (long) (arg2); \
79 _sc_18 = (long) (arg3); \
80 __asm__ __volatile__ \
81 ("callsys # %0 %1 <= %2 %3 %4 %5" \
82 : inline_syscall_r0_out_constraint (_sc_0), \
83 "=r"(_sc_19), "=r"(_sc_16), "=r"(_sc_17), \
84 "=r"(_sc_18) \
85 : "0"(_sc_0), "2"(_sc_16), "3"(_sc_17), \
86 "4"(_sc_18) \
87 : inline_syscall_clobbers, "$20", "$21"); \
88 _sc_ret = _sc_0, _sc_err = _sc_19; \
89 }
91 #define inline_syscall4(name,arg1,arg2,arg3,arg4) \
92 { \
93 register long _sc_0 inline_syscall_r0_asm; \
94 register long _sc_16 __asm__("$16"); \
95 register long _sc_17 __asm__("$17"); \
96 register long _sc_18 __asm__("$18"); \
97 register long _sc_19 __asm__("$19"); \
98 \
99 _sc_0 = name; \
100 _sc_16 = (long) (arg1); \
101 _sc_17 = (long) (arg2); \
102 _sc_18 = (long) (arg3); \
103 _sc_19 = (long) (arg4); \
104 __asm__ __volatile__ \
105 ("callsys # %0 %1 <= %2 %3 %4 %5 %6" \
106 : inline_syscall_r0_out_constraint (_sc_0), \
107 "=r"(_sc_19), "=r"(_sc_16), "=r"(_sc_17), \
108 "=r"(_sc_18) \
109 : "0"(_sc_0), "2"(_sc_16), "3"(_sc_17), \
110 "4"(_sc_18), "1"(_sc_19) \
111 : inline_syscall_clobbers, "$20", "$21"); \
112 _sc_ret = _sc_0, _sc_err = _sc_19; \
113 }
115 #define inline_syscall5(name,arg1,arg2,arg3,arg4,arg5) \
116 { \
117 register long _sc_0 inline_syscall_r0_asm; \
118 register long _sc_16 __asm__("$16"); \
119 register long _sc_17 __asm__("$17"); \
120 register long _sc_18 __asm__("$18"); \
121 register long _sc_19 __asm__("$19"); \
122 register long _sc_20 __asm__("$20"); \
123 \
124 _sc_0 = name; \
125 _sc_16 = (long) (arg1); \
126 _sc_17 = (long) (arg2); \
127 _sc_18 = (long) (arg3); \
128 _sc_19 = (long) (arg4); \
129 _sc_20 = (long) (arg5); \
130 __asm__ __volatile__ \
131 ("callsys # %0 %1 <= %2 %3 %4 %5 %6 %7" \
132 : inline_syscall_r0_out_constraint (_sc_0), \
133 "=r"(_sc_19), "=r"(_sc_16), "=r"(_sc_17), \
134 "=r"(_sc_18), "=r"(_sc_20) \
135 : "0"(_sc_0), "2"(_sc_16), "3"(_sc_17), \
136 "4"(_sc_18), "1"(_sc_19), "5"(_sc_20) \
137 : inline_syscall_clobbers, "$21"); \
138 _sc_ret = _sc_0, _sc_err = _sc_19; \
139 }
141 #define inline_syscall6(name,arg1,arg2,arg3,arg4,arg5,arg6) \
142 { \
143 register long _sc_0 inline_syscall_r0_asm; \
144 register long _sc_16 __asm__("$16"); \
145 register long _sc_17 __asm__("$17"); \
146 register long _sc_18 __asm__("$18"); \
147 register long _sc_19 __asm__("$19"); \
148 register long _sc_20 __asm__("$20"); \
149 register long _sc_21 __asm__("$21"); \
150 \
151 _sc_0 = name; \
152 _sc_16 = (long) (arg1); \
153 _sc_17 = (long) (arg2); \
154 _sc_18 = (long) (arg3); \
155 _sc_19 = (long) (arg4); \
156 _sc_20 = (long) (arg5); \
157 _sc_21 = (long) (arg6); \
158 __asm__ __volatile__ \
159 ("callsys # %0 %1 <= %2 %3 %4 %5 %6 %7 %8" \
160 : inline_syscall_r0_out_constraint (_sc_0), \
161 "=r"(_sc_19), "=r"(_sc_16), "=r"(_sc_17), \
162 "=r"(_sc_18), "=r"(_sc_20), "=r"(_sc_21) \
163 : "0"(_sc_0), "2"(_sc_16), "3"(_sc_17), "4"(_sc_18), \
164 "1"(_sc_19), "5"(_sc_20), "6"(_sc_21) \
165 : inline_syscall_clobbers); \
166 _sc_ret = _sc_0, _sc_err = _sc_19; \
167 }
169 #define INLINE_SYSCALL1(name, nr, args...) \
170 ({ \
171 long _sc_ret, _sc_err; \
172 inline_syscall##nr(__NR_##name, args); \
173 if (_sc_err != 0) \
174 { \
175 _sc_ret = -(_sc_ret); \
176 } \
177 _sc_ret; \
178 })
180 #define io_syscall1(type,fname,sname,type1,arg1) \
181 type fname(type1 arg1) \
182 { \
183 return (type)INLINE_SYSCALL1(sname, 1, arg1); \
184 }
186 #define io_syscall2(type,fname,sname,type1,arg1,type2,arg2) \
187 type fname(type1 arg1,type2 arg2) \
188 { \
189 return (type)INLINE_SYSCALL1(sname, 2, arg1, arg2); \
190 }
192 #define io_syscall3(type,fname,sname,type1,arg1,type2,arg2,type3,arg3) \
193 type fname(type1 arg1,type2 arg2,type3 arg3) \
194 { \
195 return (type)INLINE_SYSCALL1(sname, 3, arg1, arg2, arg3); \
196 }
198 #define io_syscall4(type,fname,sname,type1,arg1,type2,arg2,type3,arg3,type4,arg4) \
199 type fname (type1 arg1, type2 arg2, type3 arg3, type4 arg4) \
200 { \
201 return (type)INLINE_SYSCALL1(sname, 4, arg1, arg2, arg3, arg4); \
202 }
204 #define io_syscall5(type,fname,sname,type1,arg1,type2,arg2,type3,arg3,type4,arg4, \
205 type5,arg5) \
206 type fname (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5) \
207 { \
208 return (type)INLINE_SYSCALL1(sname, 5, arg1, arg2, arg3, arg4, arg5);\
209 }