1 | #define __NR_io_setup 206 |
---|
2 | #define __NR_io_destroy 207 |
---|
3 | #define __NR_io_getevents 208 |
---|
4 | #define __NR_io_submit 209 |
---|
5 | #define __NR_io_cancel 210 |
---|
6 | |
---|
7 | #define __syscall_clobber "r11","rcx","memory" |
---|
8 | #define __syscall "syscall" |
---|
9 | |
---|
10 | #define io_syscall1(type,fname,sname,type1,arg1) \ |
---|
11 | type fname(type1 arg1) \ |
---|
12 | { \ |
---|
13 | long __res; \ |
---|
14 | __asm__ volatile (__syscall \ |
---|
15 | : "=a" (__res) \ |
---|
16 | : "0" (__NR_##sname),"D" ((long)(arg1)) : __syscall_clobber ); \ |
---|
17 | return __res; \ |
---|
18 | } |
---|
19 | |
---|
20 | #define io_syscall2(type,fname,sname,type1,arg1,type2,arg2) \ |
---|
21 | type fname(type1 arg1,type2 arg2) \ |
---|
22 | { \ |
---|
23 | long __res; \ |
---|
24 | __asm__ volatile (__syscall \ |
---|
25 | : "=a" (__res) \ |
---|
26 | : "0" (__NR_##sname),"D" ((long)(arg1)),"S" ((long)(arg2)) : __syscall_clobber ); \ |
---|
27 | return __res; \ |
---|
28 | } |
---|
29 | |
---|
30 | #define io_syscall3(type,fname,sname,type1,arg1,type2,arg2,type3,arg3) \ |
---|
31 | type fname(type1 arg1,type2 arg2,type3 arg3) \ |
---|
32 | { \ |
---|
33 | long __res; \ |
---|
34 | __asm__ volatile (__syscall \ |
---|
35 | : "=a" (__res) \ |
---|
36 | : "0" (__NR_##sname),"D" ((long)(arg1)),"S" ((long)(arg2)), \ |
---|
37 | "d" ((long)(arg3)) : __syscall_clobber); \ |
---|
38 | return __res; \ |
---|
39 | } |
---|
40 | |
---|
41 | #define io_syscall4(type,fname,sname,type1,arg1,type2,arg2,type3,arg3,type4,arg4) \ |
---|
42 | type fname (type1 arg1, type2 arg2, type3 arg3, type4 arg4) \ |
---|
43 | { \ |
---|
44 | long __res; \ |
---|
45 | __asm__ volatile ("movq %5,%%r10 ;" __syscall \ |
---|
46 | : "=a" (__res) \ |
---|
47 | : "0" (__NR_##sname),"D" ((long)(arg1)),"S" ((long)(arg2)), \ |
---|
48 | "d" ((long)(arg3)),"g" ((long)(arg4)) : __syscall_clobber,"r10" ); \ |
---|
49 | return __res; \ |
---|
50 | } |
---|
51 | |
---|
52 | #define io_syscall5(type,fname,sname,type1,arg1,type2,arg2,type3,arg3,type4,arg4, \ |
---|
53 | type5,arg5) \ |
---|
54 | type fname (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5) \ |
---|
55 | { \ |
---|
56 | long __res; \ |
---|
57 | __asm__ volatile ("movq %5,%%r10 ; movq %6,%%r8 ; " __syscall \ |
---|
58 | : "=a" (__res) \ |
---|
59 | : "0" (__NR_##sname),"D" ((long)(arg1)),"S" ((long)(arg2)), \ |
---|
60 | "d" ((long)(arg3)),"g" ((long)(arg4)),"g" ((long)(arg5)) : \ |
---|
61 | __syscall_clobber,"r8","r10" ); \ |
---|
62 | return __res; \ |
---|
63 | } |
---|