32 #error "SF_USER_ERRNO not supported yet"
34 #define __sfsyscall_return(type, res) \
36 return (type) (res); \
43 #define _sfsyscall0(type,name) \
47 __asm__ volatile ("int $0x80" \
49 : "0" (__NR_##name)); \
50 __sfsyscall_return(type,__res); \
53 #define _sfsyscall1(type,name,type1,arg1) \
54 type name(type1 arg1) \
57 __asm__ volatile ("pushl %2\n\t" \
62 : "0" (__NR_##name),"g" ((long)(arg1))); \
63 __sfsyscall_return(type,__res); \
66 #define _sfsyscall2(type,name,type1,arg1,type2,arg2) \
67 type name(type1 arg1,type2 arg2) \
70 __asm__ volatile ("pushl %3\n\t" \
76 : "0" (__NR_##name),"g" ((long)(arg1)),"g" ((long)(arg2)) ); \
77 __sfsyscall_return(type,__res); \
80 #define _sfsyscall3(type,name,type1,arg1,type2,arg2,type3,arg3) \
81 type name(type1 arg1,type2 arg2,type3 arg3) \
84 __asm__ volatile ("pusha; pushl %4\n\t" \
89 "add $16, %%esp\n\t" \
92 : "0" (__NR_##name),"g" ((long)(arg1)),"g" ((long)(arg2)), \
93 "g" ((long)(arg3)) ); \
94 __sfsyscall_return(type,__res); \
97 #define _sfsyscall4(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4) \
98 type name (type1 arg1, type2 arg2, type3 arg3, type4 arg4) \
101 __asm__ volatile ("pushl %5\n\t" \
109 : "0" (__NR_##name),"g" ((long)(arg1)),"c" ((long)(arg2)), \
110 "d" ((long)(arg3)),"S" ((long)(arg4)) ); \
111 __sfsyscall_return(type,__res); \
114 #define _sfsyscall5(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4, \
116 type name (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5) \
119 __asm__ volatile ("pushl %6\n\t" \
128 : "0" (__NR_##name),"g" ((long)(arg1)),"g" ((long)(arg2)), \
129 "g" ((long)(arg3)),"g" ((long)(arg4)),"g" ((long)(arg5))); \
130 __sfsyscall_return(type,__res); \
133 #define _sfsyscall6(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4, \
134 type5,arg5,type6,arg6) \
135 type name (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5, type6 arg6) \
138 __asm__ volatile ("pushl %7\n\t" \
148 : "0" (__NR_##name),"g" ((long)(arg1)),"g" ((long)(arg2)), \
149 "g" ((long)(arg3)),"g" ((long)(arg4)),"g" ((long)(arg5)), \
150 "g" ((long)(arg6))); \
151 __sfsyscall_return(type,__res); \