Go to the documentation of this file. 1 #ifndef _ASM_CRIS_ARCH_UNISTD_H_
2 #define _ASM_CRIS_ARCH_UNISTD_H_
9 #define _syscall0(type,name) \
12 register long __a __asm__ ("r10"); \
13 register long __n_ __asm__ ("r9") = (__NR_##name); \
14 __asm__ __volatile__ (".ifnc %0%1,$r10$r9\n\t" \
26 #define _syscall1(type,name,type1,arg1) \
27 type name(type1 arg1) \
29 register long __a __asm__ ("r10") = (long) arg1; \
30 register long __n_ __asm__ ("r9") = (__NR_##name); \
31 __asm__ __volatile__ (".ifnc %0%1,$r10$r9\n\t" \
36 : "r" (__n_), "0" (__a)); \
43 #define _syscall2(type,name,type1,arg1,type2,arg2) \
44 type name(type1 arg1,type2 arg2) \
46 register long __a __asm__ ("r10") = (long) arg1; \
47 register long __b __asm__ ("r11") = (long) arg2; \
48 register long __n_ __asm__ ("r9") = (__NR_##name); \
49 __asm__ __volatile__ (".ifnc %0%1%3,$r10$r9$r11\n\t" \
54 : "r" (__n_), "0" (__a), "r" (__b)); \
61 #define _syscall3(type,name,type1,arg1,type2,arg2,type3,arg3) \
62 type name(type1 arg1,type2 arg2,type3 arg3) \
64 register long __a __asm__ ("r10") = (long) arg1; \
65 register long __b __asm__ ("r11") = (long) arg2; \
66 register long __c __asm__ ("r12") = (long) arg3; \
67 register long __n_ __asm__ ("r9") = (__NR_##name); \
68 __asm__ __volatile__ (".ifnc %0%1%3%4,$r10$r9$r11$r12\n\t" \
73 : "r" (__n_), "0" (__a), "r" (__b), "r" (__c)); \
80 #define _syscall4(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4) \
81 type name (type1 arg1, type2 arg2, type3 arg3, type4 arg4) \
83 register long __a __asm__ ("r10") = (long) arg1; \
84 register long __b __asm__ ("r11") = (long) arg2; \
85 register long __c __asm__ ("r12") = (long) arg3; \
86 register long __d __asm__ ("r13") = (long) arg4; \
87 register long __n_ __asm__ ("r9") = (__NR_##name); \
88 __asm__ __volatile__ (".ifnc %0%1%3%4%5,$r10$r9$r11$r12$r13\n\t" \
93 : "r" (__n_), "0" (__a), "r" (__b), \
94 "r" (__c), "r" (__d)); \
101 #define _syscall5(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4, \
103 type name (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5) \
105 register long __a __asm__ ("r10") = (long) arg1; \
106 register long __b __asm__ ("r11") = (long) arg2; \
107 register long __c __asm__ ("r12") = (long) arg3; \
108 register long __d __asm__ ("r13") = (long) arg4; \
109 register long __n_ __asm__ ("r9") = (__NR_##name); \
110 __asm__ __volatile__ (".ifnc %0%1%3%4%5,$r10$r9$r11$r12$r13\n\t" \
116 : "r" (__n_), "0" (__a), "r" (__b), \
117 "r" (__c), "r" (__d), "g" (arg5)); \
124 #define _syscall6(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4, \
125 type5,arg5,type6,arg6) \
126 type name (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5,type6 arg6) \
128 register long __a __asm__ ("r10") = (long) arg1; \
129 register long __b __asm__ ("r11") = (long) arg2; \
130 register long __c __asm__ ("r12") = (long) arg3; \
131 register long __d __asm__ ("r13") = (long) arg4; \
132 register long __n_ __asm__ ("r9") = (__NR_##name); \
133 __asm__ __volatile__ (".ifnc %0%1%3%4%5,$r10$r9$r11$r12$r13\n\t" \
136 "move %6,$mof\n\tmove %7,$srp\n\t" \
139 : "r" (__n_), "0" (__a), "r" (__b), \
140 "r" (__c), "r" (__d), "g" (arg5), "g" (arg6)\