diff options
author | Dave Jones <davej@redhat.com> | 2006-12-12 17:41:41 -0500 |
---|---|---|
committer | Dave Jones <davej@redhat.com> | 2006-12-12 17:41:41 -0500 |
commit | c4366889dda8110247be59ca41fddb82951a8c26 (patch) | |
tree | 705c1a996bed8fd48ce94ff33ec9fd00f9b94875 /include/asm-xtensa/unistd.h | |
parent | db2fb9db5735cc532fd4fc55e94b9a3c3750378e (diff) | |
parent | e1036502e5263851259d147771226161e5ccc85a (diff) |
Merge ../linus
Conflicts:
drivers/cpufreq/cpufreq.c
Diffstat (limited to 'include/asm-xtensa/unistd.h')
-rw-r--r-- | include/asm-xtensa/unistd.h | 970 |
1 files changed, 585 insertions, 385 deletions
diff --git a/include/asm-xtensa/unistd.h b/include/asm-xtensa/unistd.h index 411f810a55c6..8a7fb6964ce1 100644 --- a/include/asm-xtensa/unistd.h +++ b/include/asm-xtensa/unistd.h | |||
@@ -11,396 +11,593 @@ | |||
11 | #ifndef _XTENSA_UNISTD_H | 11 | #ifndef _XTENSA_UNISTD_H |
12 | #define _XTENSA_UNISTD_H | 12 | #define _XTENSA_UNISTD_H |
13 | 13 | ||
14 | #define __NR_spill 0 | 14 | #ifndef __SYSCALL |
15 | #define __NR_exit 1 | 15 | # define __SYSCALL(nr,func,nargs) |
16 | #define __NR_read 3 | 16 | #endif |
17 | #define __NR_write 4 | ||
18 | #define __NR_open 5 | ||
19 | #define __NR_close 6 | ||
20 | #define __NR_creat 8 | ||
21 | #define __NR_link 9 | ||
22 | #define __NR_unlink 10 | ||
23 | #define __NR_execve 11 | ||
24 | #define __NR_chdir 12 | ||
25 | #define __NR_mknod 14 | ||
26 | #define __NR_chmod 15 | ||
27 | #define __NR_lchown 16 | ||
28 | #define __NR_break 17 | ||
29 | #define __NR_lseek 19 | ||
30 | #define __NR_getpid 20 | ||
31 | #define __NR_mount 21 | ||
32 | #define __NR_setuid 23 | ||
33 | #define __NR_getuid 24 | ||
34 | #define __NR_ptrace 26 | ||
35 | #define __NR_utime 30 | ||
36 | #define __NR_stty 31 | ||
37 | #define __NR_gtty 32 | ||
38 | #define __NR_access 33 | ||
39 | #define __NR_ftime 35 | ||
40 | #define __NR_sync 36 | ||
41 | #define __NR_kill 37 | ||
42 | #define __NR_rename 38 | ||
43 | #define __NR_mkdir 39 | ||
44 | #define __NR_rmdir 40 | ||
45 | #define __NR_dup 41 | ||
46 | #define __NR_pipe 42 | ||
47 | #define __NR_times 43 | ||
48 | #define __NR_prof 44 | ||
49 | #define __NR_brk 45 | ||
50 | #define __NR_setgid 46 | ||
51 | #define __NR_getgid 47 | ||
52 | #define __NR_signal 48 | ||
53 | #define __NR_geteuid 49 | ||
54 | #define __NR_getegid 50 | ||
55 | #define __NR_acct 51 | ||
56 | #define __NR_lock 53 | ||
57 | #define __NR_ioctl 54 | ||
58 | #define __NR_fcntl 55 | ||
59 | #define __NR_setpgid 57 | ||
60 | #define __NR_ulimit 58 | ||
61 | #define __NR_umask 60 | ||
62 | #define __NR_chroot 61 | ||
63 | #define __NR_ustat 62 | ||
64 | #define __NR_dup2 63 | ||
65 | #define __NR_getppid 64 | ||
66 | #define __NR_setsid 66 | ||
67 | #define __NR_sigaction 67 | ||
68 | #define __NR_setreuid 70 | ||
69 | #define __NR_setregid 71 | ||
70 | #define __NR_sigsuspend 72 | ||
71 | #define __NR_sigpending 73 | ||
72 | #define __NR_sethostname 74 | ||
73 | #define __NR_setrlimit 75 | ||
74 | #define __NR_getrlimit 76 /* Back compatible 2Gig limited rlimit */ | ||
75 | #define __NR_getrusage 77 | ||
76 | #define __NR_gettimeofday 78 | ||
77 | #define __NR_settimeofday 79 | ||
78 | #define __NR_getgroups 80 | ||
79 | #define __NR_setgroups 81 | ||
80 | #define __NR_select 82 | ||
81 | #define __NR_symlink 83 | ||
82 | #define __NR_readlink 85 | ||
83 | #define __NR_uselib 86 | ||
84 | #define __NR_swapon 87 | ||
85 | #define __NR_reboot 88 | ||
86 | #define __NR_munmap 91 | ||
87 | #define __NR_truncate 92 | ||
88 | #define __NR_ftruncate 93 | ||
89 | #define __NR_fchmod 94 | ||
90 | #define __NR_fchown 95 | ||
91 | #define __NR_getpriority 96 | ||
92 | #define __NR_setpriority 97 | ||
93 | #define __NR_profil 98 | ||
94 | #define __NR_statfs 99 | ||
95 | #define __NR_fstatfs 100 | ||
96 | #define __NR_ioperm 101 | ||
97 | #define __NR_syslog 103 | ||
98 | #define __NR_setitimer 104 | ||
99 | #define __NR_getitimer 105 | ||
100 | #define __NR_stat 106 | ||
101 | #define __NR_lstat 107 | ||
102 | #define __NR_fstat 108 | ||
103 | #define __NR_iopl 110 | ||
104 | #define __NR_vhangup 111 | ||
105 | #define __NR_idle 112 | ||
106 | #define __NR_wait4 114 | ||
107 | #define __NR_swapoff 115 | ||
108 | #define __NR_sysinfo 116 | ||
109 | #define __NR_fsync 118 | ||
110 | #define __NR_sigreturn 119 | ||
111 | #define __NR_clone 120 | ||
112 | #define __NR_setdomainname 121 | ||
113 | #define __NR_uname 122 | ||
114 | #define __NR_modify_ldt 123 | ||
115 | #define __NR_adjtimex 124 | ||
116 | #define __NR_mprotect 125 | ||
117 | #define __NR_create_module 127 | ||
118 | #define __NR_init_module 128 | ||
119 | #define __NR_delete_module 129 | ||
120 | #define __NR_quotactl 131 | ||
121 | #define __NR_getpgid 132 | ||
122 | #define __NR_fchdir 133 | ||
123 | #define __NR_bdflush 134 | ||
124 | #define __NR_sysfs 135 | ||
125 | #define __NR_personality 136 | ||
126 | #define __NR_setfsuid 138 | ||
127 | #define __NR_setfsgid 139 | ||
128 | #define __NR__llseek 140 | ||
129 | #define __NR_getdents 141 | ||
130 | #define __NR__newselect 142 | ||
131 | #define __NR_flock 143 | ||
132 | #define __NR_msync 144 | ||
133 | #define __NR_readv 145 | ||
134 | #define __NR_writev 146 | ||
135 | #define __NR_cacheflush 147 | ||
136 | #define __NR_cachectl 148 | ||
137 | #define __NR_sysxtensa 149 | ||
138 | #define __NR_sysdummy 150 | ||
139 | #define __NR_getsid 151 | ||
140 | #define __NR_fdatasync 152 | ||
141 | #define __NR__sysctl 153 | ||
142 | #define __NR_mlock 154 | ||
143 | #define __NR_munlock 155 | ||
144 | #define __NR_mlockall 156 | ||
145 | #define __NR_munlockall 157 | ||
146 | #define __NR_sched_setparam 158 | ||
147 | #define __NR_sched_getparam 159 | ||
148 | #define __NR_sched_setscheduler 160 | ||
149 | #define __NR_sched_getscheduler 161 | ||
150 | #define __NR_sched_yield 162 | ||
151 | #define __NR_sched_get_priority_max 163 | ||
152 | #define __NR_sched_get_priority_min 164 | ||
153 | #define __NR_sched_rr_get_interval 165 | ||
154 | #define __NR_nanosleep 166 | ||
155 | #define __NR_mremap 167 | ||
156 | #define __NR_accept 168 | ||
157 | #define __NR_bind 169 | ||
158 | #define __NR_connect 170 | ||
159 | #define __NR_getpeername 171 | ||
160 | #define __NR_getsockname 172 | ||
161 | #define __NR_getsockopt 173 | ||
162 | #define __NR_listen 174 | ||
163 | #define __NR_recv 175 | ||
164 | #define __NR_recvfrom 176 | ||
165 | #define __NR_recvmsg 177 | ||
166 | #define __NR_send 178 | ||
167 | #define __NR_sendmsg 179 | ||
168 | #define __NR_sendto 180 | ||
169 | #define __NR_setsockopt 181 | ||
170 | #define __NR_shutdown 182 | ||
171 | #define __NR_socket 183 | ||
172 | #define __NR_socketpair 184 | ||
173 | #define __NR_setresuid 185 | ||
174 | #define __NR_getresuid 186 | ||
175 | #define __NR_query_module 187 | ||
176 | #define __NR_poll 188 | ||
177 | #define __NR_nfsservctl 189 | ||
178 | #define __NR_setresgid 190 | ||
179 | #define __NR_getresgid 191 | ||
180 | #define __NR_prctl 192 | ||
181 | #define __NR_rt_sigreturn 193 | ||
182 | #define __NR_rt_sigaction 194 | ||
183 | #define __NR_rt_sigprocmask 195 | ||
184 | #define __NR_rt_sigpending 196 | ||
185 | #define __NR_rt_sigtimedwait 197 | ||
186 | #define __NR_rt_sigqueueinfo 198 | ||
187 | #define __NR_rt_sigsuspend 199 | ||
188 | #define __NR_pread 200 | ||
189 | #define __NR_pwrite 201 | ||
190 | #define __NR_chown 202 | ||
191 | #define __NR_getcwd 203 | ||
192 | #define __NR_capget 204 | ||
193 | #define __NR_capset 205 | ||
194 | #define __NR_sigaltstack 206 | ||
195 | #define __NR_sendfile 207 | ||
196 | #define __NR_mmap2 210 | ||
197 | #define __NR_truncate64 211 | ||
198 | #define __NR_ftruncate64 212 | ||
199 | #define __NR_stat64 213 | ||
200 | #define __NR_lstat64 214 | ||
201 | #define __NR_fstat64 215 | ||
202 | #define __NR_pivot_root 216 | ||
203 | #define __NR_mincore 217 | ||
204 | #define __NR_madvise 218 | ||
205 | #define __NR_getdents64 219 | ||
206 | |||
207 | /* Keep this last; should always equal the last valid call number. */ | ||
208 | #define __NR_Linux_syscalls 220 | ||
209 | |||
210 | /* user-visible error numbers are in the range -1 - -125: see | ||
211 | * <asm-xtensa/errno.h> */ | ||
212 | |||
213 | #define SYSXTENSA_RESERVED 0 /* don't use this */ | ||
214 | #define SYSXTENSA_ATOMIC_SET 1 /* set variable */ | ||
215 | #define SYSXTENSA_ATOMIC_EXG_ADD 2 /* exchange memory and add */ | ||
216 | #define SYSXTENSA_ATOMIC_ADD 3 /* add to memory */ | ||
217 | #define SYSXTENSA_ATOMIC_CMP_SWP 4 /* compare and swap */ | ||
218 | |||
219 | #define SYSXTENSA_COUNT 5 /* count of syscall0 functions*/ | ||
220 | 17 | ||
221 | #ifdef __KERNEL__ | 18 | #define __NR_spill 0 |
222 | #include <linux/linkage.h> | 19 | __SYSCALL( 0, sys_ni_syscall, 0) |
20 | #define __NR_xtensa 1 | ||
21 | __SYSCALL( 1, sys_ni_syscall, 0) | ||
22 | #define __NR_available4 2 | ||
23 | __SYSCALL( 2, sys_ni_syscall, 0) | ||
24 | #define __NR_available5 3 | ||
25 | __SYSCALL( 3, sys_ni_syscall, 0) | ||
26 | #define __NR_available6 4 | ||
27 | __SYSCALL( 4, sys_ni_syscall, 0) | ||
28 | #define __NR_available7 5 | ||
29 | __SYSCALL( 5, sys_ni_syscall, 0) | ||
30 | #define __NR_available8 6 | ||
31 | __SYSCALL( 6, sys_ni_syscall, 0) | ||
32 | #define __NR_available9 7 | ||
33 | __SYSCALL( 7, sys_ni_syscall, 0) | ||
223 | 34 | ||
224 | #define __syscall_return(type, res) return ((type)(res)) | 35 | /* File Operations */ |
225 | 36 | ||
226 | /* Tensilica's xt-xcc compiler is much more agressive at code | 37 | #define __NR_open 8 |
227 | * optimization than gcc. Multiple __asm__ statements are | 38 | __SYSCALL( 8, sys_open, 3) |
228 | * insufficient for xt-xcc because subsequent optimization passes | 39 | #define __NR_close 9 |
229 | * (beyond the front-end that knows of __asm__ statements and other | 40 | __SYSCALL( 9, sys_close, 1) |
230 | * such GNU Extensions to C) can modify the register selection for | 41 | #define __NR_dup 10 |
231 | * containment of C variables. | 42 | __SYSCALL( 10, sys_dup, 1) |
232 | * | 43 | #define __NR_dup2 11 |
233 | * xt-xcc cannot modify the contents of a single __asm__ statement, so | 44 | __SYSCALL( 11, sys_dup2, 2) |
234 | * we create single-asm versions of the syscall macros that are | 45 | #define __NR_read 12 |
235 | * suitable and optimal for both xt-xcc and gcc. | 46 | __SYSCALL( 12, sys_read, 3) |
236 | * | 47 | #define __NR_write 13 |
237 | * Linux takes system-call arguments in registers. The following | 48 | __SYSCALL( 13, sys_write, 3) |
238 | * design is optimized for user-land apps (e.g., glibc) which | 49 | #define __NR_select 14 |
239 | * typically have a function wrapper around the "syscall" assembly | 50 | __SYSCALL( 14, sys_select, 5) |
240 | * instruction. It satisfies the Xtensa ABI while minizing argument | 51 | #define __NR_lseek 15 |
241 | * shifting. | 52 | __SYSCALL( 15, sys_lseek, 3) |
242 | * | 53 | #define __NR_poll 16 |
243 | * The Xtensa ABI and software conventions require the system-call | 54 | __SYSCALL( 16, sys_poll, 3) |
244 | * number in a2. If an argument exists in a2, we move it to the next | 55 | #define __NR__llseek 17 |
245 | * available register. Note that for improved efficiency, we do NOT | 56 | __SYSCALL( 17, sys_llseek, 5) |
246 | * shift all parameters down one register to maintain the original | 57 | #define __NR_epoll_wait 18 |
247 | * order. | 58 | __SYSCALL( 18, sys_epoll_wait, 4) |
248 | * | 59 | #define __NR_epoll_ctl 19 |
249 | * At best case (zero arguments), we just write the syscall number to | 60 | __SYSCALL( 19, sys_epoll_ctl, 4) |
250 | * a2. At worst case (1 to 6 arguments), we move the argument in a2 | 61 | #define __NR_epoll_create 20 |
251 | * to the next available register, then write the syscall number to | 62 | __SYSCALL( 20, sys_epoll_create, 1) |
252 | * a2. | 63 | #define __NR_creat 21 |
253 | * | 64 | __SYSCALL( 21, sys_creat, 2) |
254 | * For clarity, the following truth table enumerates all possibilities. | 65 | #define __NR_truncate 22 |
66 | __SYSCALL( 22, sys_truncate, 2) | ||
67 | #define __NR_ftruncate 23 | ||
68 | __SYSCALL( 23, sys_ftruncate, 2) | ||
69 | #define __NR_readv 24 | ||
70 | __SYSCALL( 24, sys_readv, 3) | ||
71 | #define __NR_writev 25 | ||
72 | __SYSCALL( 25, sys_writev, 3) | ||
73 | #define __NR_fsync 26 | ||
74 | __SYSCALL( 26, sys_fsync, 1) | ||
75 | #define __NR_fdatasync 27 | ||
76 | __SYSCALL( 27, sys_fdatasync, 1) | ||
77 | #define __NR_truncate64 28 | ||
78 | __SYSCALL( 28, sys_truncate64, 2) | ||
79 | #define __NR_ftruncate64 29 | ||
80 | __SYSCALL( 29, sys_ftruncate64, 2) | ||
81 | #define __NR_pread64 30 | ||
82 | __SYSCALL( 30, sys_pread64, 6) | ||
83 | #define __NR_pwrite64 31 | ||
84 | __SYSCALL( 31, sys_pwrite64, 6) | ||
85 | |||
86 | #define __NR_link 32 | ||
87 | __SYSCALL( 32, sys_link, 2) | ||
88 | #define __NR_rename 33 | ||
89 | __SYSCALL( 33, sys_rename, 2) | ||
90 | #define __NR_symlink 34 | ||
91 | __SYSCALL( 34, sys_symlink, 2) | ||
92 | #define __NR_readlink 35 | ||
93 | __SYSCALL( 35, sys_readlink, 3) | ||
94 | #define __NR_mknod 36 | ||
95 | __SYSCALL( 36, sys_mknod, 3) | ||
96 | #define __NR_pipe 37 | ||
97 | __SYSCALL( 37, xtensa_pipe, 1) | ||
98 | #define __NR_unlink 38 | ||
99 | __SYSCALL( 38, sys_unlink, 1) | ||
100 | #define __NR_rmdir 39 | ||
101 | __SYSCALL( 39, sys_rmdir, 1) | ||
102 | |||
103 | #define __NR_mkdir 40 | ||
104 | __SYSCALL( 40, sys_mkdir, 2) | ||
105 | #define __NR_chdir 41 | ||
106 | __SYSCALL( 41, sys_chdir, 1) | ||
107 | #define __NR_fchdir 42 | ||
108 | __SYSCALL( 42, sys_fchdir, 1) | ||
109 | #define __NR_getcwd 43 | ||
110 | __SYSCALL( 43, sys_getcwd, 2) | ||
111 | |||
112 | #define __NR_chmod 44 | ||
113 | __SYSCALL( 44, sys_chmod, 2) | ||
114 | #define __NR_chown 45 | ||
115 | __SYSCALL( 45, sys_chown, 3) | ||
116 | #define __NR_stat 46 | ||
117 | __SYSCALL( 46, sys_newstat, 2) | ||
118 | #define __NR_stat64 47 | ||
119 | __SYSCALL( 47, sys_stat64, 2) | ||
120 | |||
121 | #define __NR_lchown 48 | ||
122 | __SYSCALL( 48, sys_lchown, 3) | ||
123 | #define __NR_lstat 49 | ||
124 | __SYSCALL( 49, sys_newlstat, 2) | ||
125 | #define __NR_lstat64 50 | ||
126 | __SYSCALL( 50, sys_lstat64, 2) | ||
127 | #define __NR_available51 51 | ||
128 | __SYSCALL( 51, sys_ni_syscall, 0) | ||
129 | |||
130 | #define __NR_fchmod 52 | ||
131 | __SYSCALL( 52, sys_fchmod, 2) | ||
132 | #define __NR_fchown 53 | ||
133 | __SYSCALL( 53, sys_fchown, 3) | ||
134 | #define __NR_fstat 54 | ||
135 | __SYSCALL( 54, sys_newfstat, 2) | ||
136 | #define __NR_fstat64 55 | ||
137 | __SYSCALL( 55, sys_fstat64, 2) | ||
138 | |||
139 | #define __NR_flock 56 | ||
140 | __SYSCALL( 56, sys_flock, 2) | ||
141 | #define __NR_access 57 | ||
142 | __SYSCALL( 57, sys_access, 2) | ||
143 | #define __NR_umask 58 | ||
144 | __SYSCALL( 58, sys_umask, 1) | ||
145 | #define __NR_getdents 59 | ||
146 | __SYSCALL( 59, sys_getdents, 3) | ||
147 | #define __NR_getdents64 60 | ||
148 | __SYSCALL( 60, sys_getdents64, 3) | ||
149 | #define __NR_fcntl64 61 | ||
150 | __SYSCALL( 61, sys_fcntl64, 3) | ||
151 | #define __NR_available62 62 | ||
152 | __SYSCALL( 62, sys_ni_syscall, 0) | ||
153 | #define __NR_fadvise64_64 63 | ||
154 | __SYSCALL( 63, sys_fadvise64_64, 6) | ||
155 | #define __NR_utime 64 /* glibc 2.3.3 ?? */ | ||
156 | __SYSCALL( 64, sys_utime, 2) | ||
157 | #define __NR_utimes 65 | ||
158 | __SYSCALL( 65, sys_utimes, 2) | ||
159 | #define __NR_ioctl 66 | ||
160 | __SYSCALL( 66, sys_ioctl, 3) | ||
161 | #define __NR_fcntl 67 | ||
162 | __SYSCALL( 67, sys_fcntl, 3) | ||
163 | |||
164 | #define __NR_setxattr 68 | ||
165 | __SYSCALL( 68, sys_setxattr, 5) | ||
166 | #define __NR_getxattr 69 | ||
167 | __SYSCALL( 69, sys_getxattr, 4) | ||
168 | #define __NR_listxattr 70 | ||
169 | __SYSCALL( 70, sys_listxattr, 3) | ||
170 | #define __NR_removexattr 71 | ||
171 | __SYSCALL( 71, sys_removexattr, 2) | ||
172 | #define __NR_lsetxattr 72 | ||
173 | __SYSCALL( 72, sys_lsetxattr, 5) | ||
174 | #define __NR_lgetxattr 73 | ||
175 | __SYSCALL( 73, sys_lgetxattr, 4) | ||
176 | #define __NR_llistxattr 74 | ||
177 | __SYSCALL( 74, sys_llistxattr, 3) | ||
178 | #define __NR_lremovexattr 75 | ||
179 | __SYSCALL( 75, sys_lremovexattr, 2) | ||
180 | #define __NR_fsetxattr 76 | ||
181 | __SYSCALL( 76, sys_fsetxattr, 5) | ||
182 | #define __NR_fgetxattr 77 | ||
183 | __SYSCALL( 77, sys_fgetxattr, 4) | ||
184 | #define __NR_flistxattr 78 | ||
185 | __SYSCALL( 78, sys_flistxattr, 3) | ||
186 | #define __NR_fremovexattr 79 | ||
187 | __SYSCALL( 79, sys_fremovexattr, 2) | ||
188 | |||
189 | /* File Map / Shared Memory Operations */ | ||
190 | |||
191 | #define __NR_mmap2 80 | ||
192 | __SYSCALL( 80, xtensa_mmap2, 6) | ||
193 | #define __NR_munmap 81 | ||
194 | __SYSCALL( 81, sys_munmap, 2) | ||
195 | #define __NR_mprotect 82 | ||
196 | __SYSCALL( 82, sys_mprotect, 3) | ||
197 | #define __NR_brk 83 | ||
198 | __SYSCALL( 83, sys_brk, 1) | ||
199 | #define __NR_mlock 84 | ||
200 | __SYSCALL( 84, sys_mlock, 2) | ||
201 | #define __NR_munlock 85 | ||
202 | __SYSCALL( 85, sys_munlock, 2) | ||
203 | #define __NR_mlockall 86 | ||
204 | __SYSCALL( 86, sys_mlockall, 1) | ||
205 | #define __NR_munlockall 87 | ||
206 | __SYSCALL( 87, sys_munlockall, 0) | ||
207 | #define __NR_mremap 88 | ||
208 | __SYSCALL( 88, sys_mremap, 4) | ||
209 | #define __NR_msync 89 | ||
210 | __SYSCALL( 89, sys_msync, 3) | ||
211 | #define __NR_mincore 90 | ||
212 | __SYSCALL( 90, sys_mincore, 3) | ||
213 | #define __NR_madvise 91 | ||
214 | __SYSCALL( 91, sys_madvise, 3) | ||
215 | #define __NR_shmget 92 | ||
216 | __SYSCALL( 92, sys_shmget, 4) | ||
217 | #define __NR_shmat 93 | ||
218 | __SYSCALL( 93, xtensa_shmat, 4) | ||
219 | #define __NR_shmctl 94 | ||
220 | __SYSCALL( 94, sys_shmctl, 4) | ||
221 | #define __NR_shmdt 95 | ||
222 | __SYSCALL( 95, sys_shmdt, 4) | ||
223 | |||
224 | /* Socket Operations */ | ||
225 | |||
226 | #define __NR_socket 96 | ||
227 | __SYSCALL( 96, sys_socket, 3) | ||
228 | #define __NR_setsockopt 97 | ||
229 | __SYSCALL( 97, sys_setsockopt, 5) | ||
230 | #define __NR_getsockopt 98 | ||
231 | __SYSCALL( 98, sys_getsockopt, 5) | ||
232 | #define __NR_shutdown 99 | ||
233 | __SYSCALL( 99, sys_shutdown, 2) | ||
234 | |||
235 | #define __NR_bind 100 | ||
236 | __SYSCALL(100, sys_bind, 3) | ||
237 | #define __NR_connect 101 | ||
238 | __SYSCALL(101, sys_connect, 3) | ||
239 | #define __NR_listen 102 | ||
240 | __SYSCALL(102, sys_listen, 2) | ||
241 | #define __NR_accept 103 | ||
242 | __SYSCALL(103, sys_accept, 3) | ||
243 | |||
244 | #define __NR_getsockname 104 | ||
245 | __SYSCALL(104, sys_getsockname, 3) | ||
246 | #define __NR_getpeername 105 | ||
247 | __SYSCALL(105, sys_getpeername, 3) | ||
248 | #define __NR_sendmsg 106 | ||
249 | __SYSCALL(106, sys_sendmsg, 3) | ||
250 | #define __NR_recvmsg 107 | ||
251 | __SYSCALL(107, sys_recvmsg, 3) | ||
252 | #define __NR_send 108 | ||
253 | __SYSCALL(108, sys_send, 4) | ||
254 | #define __NR_recv 109 | ||
255 | __SYSCALL(109, sys_recv, 4) | ||
256 | #define __NR_sendto 110 | ||
257 | __SYSCALL(110, sys_sendto, 6) | ||
258 | #define __NR_recvfrom 111 | ||
259 | __SYSCALL(111, sys_recvfrom, 6) | ||
260 | |||
261 | #define __NR_socketpair 112 | ||
262 | __SYSCALL(112, sys_socketpair, 4) | ||
263 | #define __NR_sendfile 113 | ||
264 | __SYSCALL(113, sys_sendfile, 4) | ||
265 | #define __NR_sendfile64 114 | ||
266 | __SYSCALL(114, sys_sendfile64, 4) | ||
267 | #define __NR_available115 115 | ||
268 | __SYSCALL(115, sys_ni_syscall, 0) | ||
269 | |||
270 | /* Process Operations */ | ||
271 | |||
272 | #define __NR_clone 116 | ||
273 | __SYSCALL(116, xtensa_clone, 5) | ||
274 | #define __NR_execve 117 | ||
275 | __SYSCALL(117, xtensa_execve, 3) | ||
276 | #define __NR_exit 118 | ||
277 | __SYSCALL(118, sys_exit, 1) | ||
278 | #define __NR_exit_group 119 | ||
279 | __SYSCALL(119, sys_exit_group, 1) | ||
280 | #define __NR_getpid 120 | ||
281 | __SYSCALL(120, sys_getpid, 0) | ||
282 | #define __NR_wait4 121 | ||
283 | __SYSCALL(121, sys_wait4, 4) | ||
284 | #define __NR_waitid 122 | ||
285 | __SYSCALL(122, sys_waitid, 5) | ||
286 | #define __NR_kill 123 | ||
287 | __SYSCALL(123, sys_kill, 2) | ||
288 | #define __NR_tkill 124 | ||
289 | __SYSCALL(124, sys_tkill, 2) | ||
290 | #define __NR_tgkill 125 | ||
291 | __SYSCALL(125, sys_tgkill, 3) | ||
292 | #define __NR_set_tid_address 126 | ||
293 | __SYSCALL(126, sys_set_tid_address, 1) | ||
294 | #define __NR_gettid 127 | ||
295 | __SYSCALL(127, sys_gettid, 0) | ||
296 | #define __NR_setsid 128 | ||
297 | __SYSCALL(128, sys_setsid, 0) | ||
298 | #define __NR_getsid 129 | ||
299 | __SYSCALL(129, sys_getsid, 1) | ||
300 | #define __NR_prctl 130 | ||
301 | __SYSCALL(130, sys_prctl, 5) | ||
302 | #define __NR_personality 131 | ||
303 | __SYSCALL(131, sys_personality, 1) | ||
304 | #define __NR_getpriority 132 | ||
305 | __SYSCALL(132, sys_getpriority, 2) | ||
306 | #define __NR_setpriority 133 | ||
307 | __SYSCALL(133, sys_setpriority, 3) | ||
308 | #define __NR_setitimer 134 | ||
309 | __SYSCALL(134, sys_setitimer, 3) | ||
310 | #define __NR_getitimer 135 | ||
311 | __SYSCALL(135, sys_getitimer, 2) | ||
312 | #define __NR_setuid 136 | ||
313 | __SYSCALL(136, sys_setuid, 1) | ||
314 | #define __NR_getuid 137 | ||
315 | __SYSCALL(137, sys_getuid, 0) | ||
316 | #define __NR_setgid 138 | ||
317 | __SYSCALL(138, sys_setgid, 1) | ||
318 | #define __NR_getgid 139 | ||
319 | __SYSCALL(139, sys_getgid, 0) | ||
320 | #define __NR_geteuid 140 | ||
321 | __SYSCALL(140, sys_geteuid, 0) | ||
322 | #define __NR_getegid 141 | ||
323 | __SYSCALL(141, sys_getegid, 0) | ||
324 | #define __NR_setreuid 142 | ||
325 | __SYSCALL(142, sys_setreuid, 2) | ||
326 | #define __NR_setregid 143 | ||
327 | __SYSCALL(143, sys_setregid, 2) | ||
328 | #define __NR_setresuid 144 | ||
329 | __SYSCALL(144, sys_setresuid, 3) | ||
330 | #define __NR_getresuid 145 | ||
331 | __SYSCALL(145, sys_getresuid, 3) | ||
332 | #define __NR_setresgid 146 | ||
333 | __SYSCALL(146, sys_setresgid, 3) | ||
334 | #define __NR_getresgid 147 | ||
335 | __SYSCALL(147, sys_getresgid, 3) | ||
336 | #define __NR_setpgid 148 | ||
337 | __SYSCALL(148, sys_setpgid, 2) | ||
338 | #define __NR_getpgid 149 | ||
339 | __SYSCALL(149, sys_getpgid, 1) | ||
340 | #define __NR_getppid 150 | ||
341 | __SYSCALL(150, sys_getppid, 0) | ||
342 | #define __NR_available151 151 | ||
343 | __SYSCALL(151, sys_ni_syscall, 0) | ||
344 | |||
345 | #define __NR_reserved152 152 /* set_thread_area */ | ||
346 | __SYSCALL(152, sys_ni_syscall, 0) | ||
347 | #define __NR_reserved153 153 /* get_thread_area */ | ||
348 | __SYSCALL(153, sys_ni_syscall, 0) | ||
349 | #define __NR_times 154 | ||
350 | __SYSCALL(154, sys_times, 1) | ||
351 | #define __NR_acct 155 | ||
352 | __SYSCALL(155, sys_acct, 1) | ||
353 | #define __NR_sched_setaffinity 156 | ||
354 | __SYSCALL(156, sys_sched_setaffinity, 3) | ||
355 | #define __NR_sched_getaffinity 157 | ||
356 | __SYSCALL(157, sys_sched_getaffinity, 3) | ||
357 | #define __NR_capget 158 | ||
358 | __SYSCALL(158, sys_capget, 2) | ||
359 | #define __NR_capset 159 | ||
360 | __SYSCALL(159, sys_capset, 2) | ||
361 | #define __NR_ptrace 160 | ||
362 | __SYSCALL(160, sys_ptrace, 4) | ||
363 | #define __NR_semtimedop 161 | ||
364 | __SYSCALL(161, sys_semtimedop, 5) | ||
365 | #define __NR_semget 162 | ||
366 | __SYSCALL(162, sys_semget, 4) | ||
367 | #define __NR_semop 163 | ||
368 | __SYSCALL(163, sys_semop, 4) | ||
369 | #define __NR_semctl 164 | ||
370 | __SYSCALL(164, sys_semctl, 4) | ||
371 | #define __NR_available165 165 | ||
372 | __SYSCALL(165, sys_ni_syscall, 0) | ||
373 | #define __NR_msgget 166 | ||
374 | __SYSCALL(166, sys_msgget, 4) | ||
375 | #define __NR_msgsnd 167 | ||
376 | __SYSCALL(167, sys_msgsnd, 4) | ||
377 | #define __NR_msgrcv 168 | ||
378 | __SYSCALL(168, sys_msgrcv, 4) | ||
379 | #define __NR_msgctl 169 | ||
380 | __SYSCALL(169, sys_msgctl, 4) | ||
381 | #define __NR_available170 170 | ||
382 | __SYSCALL(170, sys_ni_syscall, 0) | ||
383 | #define __NR_available171 171 | ||
384 | __SYSCALL(171, sys_ni_syscall, 0) | ||
385 | |||
386 | /* File System */ | ||
387 | |||
388 | #define __NR_mount 172 | ||
389 | __SYSCALL(172, sys_mount, 5) | ||
390 | #define __NR_swapon 173 | ||
391 | __SYSCALL(173, sys_swapon, 2) | ||
392 | #define __NR_chroot 174 | ||
393 | __SYSCALL(174, sys_chroot, 1) | ||
394 | #define __NR_pivot_root 175 | ||
395 | __SYSCALL(175, sys_pivot_root, 2) | ||
396 | #define __NR_umount 176 | ||
397 | __SYSCALL(176, sys_umount, 2) | ||
398 | #define __NR_swapoff 177 | ||
399 | __SYSCALL(177, sys_swapoff, 1) | ||
400 | #define __NR_sync 178 | ||
401 | __SYSCALL(178, sys_sync, 0) | ||
402 | #define __NR_available179 179 | ||
403 | __SYSCALL(179, sys_ni_syscall, 0) | ||
404 | #define __NR_setfsuid 180 | ||
405 | __SYSCALL(180, sys_setfsuid, 1) | ||
406 | #define __NR_setfsgid 181 | ||
407 | __SYSCALL(181, sys_setfsgid, 1) | ||
408 | #define __NR_sysfs 182 | ||
409 | __SYSCALL(182, sys_sysfs, 3) | ||
410 | #define __NR_ustat 183 | ||
411 | __SYSCALL(183, sys_ustat, 2) | ||
412 | #define __NR_statfs 184 | ||
413 | __SYSCALL(184, sys_statfs, 2) | ||
414 | #define __NR_fstatfs 185 | ||
415 | __SYSCALL(185, sys_fstatfs, 2) | ||
416 | #define __NR_statfs64 186 | ||
417 | __SYSCALL(186, sys_statfs64, 3) | ||
418 | #define __NR_fstatfs64 187 | ||
419 | __SYSCALL(187, sys_fstatfs64, 3) | ||
420 | |||
421 | /* System */ | ||
422 | |||
423 | #define __NR_setrlimit 188 | ||
424 | __SYSCALL(188, sys_setrlimit, 2) | ||
425 | #define __NR_getrlimit 189 | ||
426 | __SYSCALL(189, sys_getrlimit, 2) | ||
427 | #define __NR_getrusage 190 | ||
428 | __SYSCALL(190, sys_getrusage, 2) | ||
429 | #define __NR_futex 191 | ||
430 | __SYSCALL(191, sys_futex, 5) | ||
431 | #define __NR_gettimeofday 192 | ||
432 | __SYSCALL(192, sys_gettimeofday, 2) | ||
433 | #define __NR_settimeofday 193 | ||
434 | __SYSCALL(193, sys_settimeofday, 2) | ||
435 | #define __NR_adjtimex 194 | ||
436 | __SYSCALL(194, sys_adjtimex, 1) | ||
437 | #define __NR_nanosleep 195 | ||
438 | __SYSCALL(195, sys_nanosleep, 2) | ||
439 | #define __NR_getgroups 196 | ||
440 | __SYSCALL(196, sys_getgroups, 2) | ||
441 | #define __NR_setgroups 197 | ||
442 | __SYSCALL(197, sys_setgroups, 2) | ||
443 | #define __NR_sethostname 198 | ||
444 | __SYSCALL(198, sys_sethostname, 2) | ||
445 | #define __NR_setdomainname 199 | ||
446 | __SYSCALL(199, sys_setdomainname, 2) | ||
447 | #define __NR_syslog 200 | ||
448 | __SYSCALL(200, sys_syslog, 3) | ||
449 | #define __NR_vhangup 201 | ||
450 | __SYSCALL(201, sys_vhangup, 0) | ||
451 | #define __NR_uselib 202 | ||
452 | __SYSCALL(202, sys_uselib, 1) | ||
453 | #define __NR_reboot 203 | ||
454 | __SYSCALL(203, sys_reboot, 3) | ||
455 | #define __NR_quotactl 204 | ||
456 | __SYSCALL(204, sys_quotactl, 4) | ||
457 | #define __NR_nfsservctl 205 | ||
458 | __SYSCALL(205, sys_nfsservctl, 3) | ||
459 | #define __NR__sysctl 206 | ||
460 | __SYSCALL(206, sys_sysctl, 1) | ||
461 | #define __NR_bdflush 207 | ||
462 | __SYSCALL(207, sys_bdflush, 2) | ||
463 | #define __NR_uname 208 | ||
464 | __SYSCALL(208, sys_newuname, 1) | ||
465 | #define __NR_sysinfo 209 | ||
466 | __SYSCALL(209, sys_sysinfo, 1) | ||
467 | #define __NR_init_module 210 | ||
468 | __SYSCALL(210, sys_init_module, 2) | ||
469 | #define __NR_delete_module 211 | ||
470 | __SYSCALL(211, sys_delete_module, 1) | ||
471 | |||
472 | #define __NR_sched_setparam 212 | ||
473 | __SYSCALL(212, sys_sched_setparam, 2) | ||
474 | #define __NR_sched_getparam 213 | ||
475 | __SYSCALL(213, sys_sched_getparam, 2) | ||
476 | #define __NR_sched_setscheduler 214 | ||
477 | __SYSCALL(214, sys_sched_setscheduler, 3) | ||
478 | #define __NR_sched_getscheduler 215 | ||
479 | __SYSCALL(215, sys_sched_getscheduler, 1) | ||
480 | #define __NR_sched_get_priority_max 216 | ||
481 | __SYSCALL(216, sys_sched_get_priority_max, 1) | ||
482 | #define __NR_sched_get_priority_min 217 | ||
483 | __SYSCALL(217, sys_sched_get_priority_min, 1) | ||
484 | #define __NR_sched_rr_get_interval 218 | ||
485 | __SYSCALL(218, sys_sched_rr_get_interval, 2) | ||
486 | #define __NR_sched_yield 219 | ||
487 | __SYSCALL(219, sys_sched_yield, 0) | ||
488 | #define __NR_sigreturn 222 | ||
489 | __SYSCALL(222, xtensa_sigreturn, 0) | ||
490 | |||
491 | /* Signal Handling */ | ||
492 | |||
493 | #define __NR_restart_syscall 223 | ||
494 | __SYSCALL(223, sys_restart_syscall, 0) | ||
495 | #define __NR_sigaltstack 224 | ||
496 | __SYSCALL(224, xtensa_sigaltstack, 2) | ||
497 | #define __NR_rt_sigreturn 225 | ||
498 | __SYSCALL(225, xtensa_rt_sigreturn, 1) | ||
499 | #define __NR_rt_sigaction 226 | ||
500 | __SYSCALL(226, sys_rt_sigaction, 4) | ||
501 | #define __NR_rt_sigprocmask 227 | ||
502 | __SYSCALL(227, sys_rt_sigprocmask, 4) | ||
503 | #define __NR_rt_sigpending 228 | ||
504 | __SYSCALL(228, sys_rt_sigpending, 2) | ||
505 | #define __NR_rt_sigtimedwait 229 | ||
506 | __SYSCALL(229, sys_rt_sigtimedwait, 4) | ||
507 | #define __NR_rt_sigqueueinfo 230 | ||
508 | __SYSCALL(230, sys_rt_sigqueueinfo, 3) | ||
509 | #define __NR_rt_sigsuspend 231 | ||
510 | __SYSCALL(231, xtensa_rt_sigsuspend, 2) | ||
511 | |||
512 | /* Message */ | ||
513 | |||
514 | #define __NR_mq_open 232 | ||
515 | __SYSCALL(232, sys_mq_open, 4) | ||
516 | #define __NR_mq_unlink 233 | ||
517 | __SYSCALL(233, sys_mq_unlink, 1) | ||
518 | #define __NR_mq_timedsend 234 | ||
519 | __SYSCALL(234, sys_mq_timedsend, 5) | ||
520 | #define __NR_mq_timedreceive 235 | ||
521 | __SYSCALL(235, sys_mq_timedreceive, 5) | ||
522 | #define __NR_mq_notify 236 | ||
523 | __SYSCALL(236, sys_mq_notify, 2) | ||
524 | #define __NR_mq_getsetattr 237 | ||
525 | __SYSCALL(237, sys_mq_getsetattr, 3) | ||
526 | #define __NR_available238 238 | ||
527 | __SYSCALL(238, sys_ni_syscall, 0) | ||
528 | |||
529 | /* IO */ | ||
530 | |||
531 | #define __NR_io_setup 239 | ||
532 | __SYSCALL(239, sys_io_setup, 2) | ||
533 | #define __NR_io_destroy 240 | ||
534 | __SYSCALL(240, sys_io_destroy, 1) | ||
535 | #define __NR_io_submit 241 | ||
536 | __SYSCALL(241, sys_io_submit, 3) | ||
537 | #define __NR_io_getevents 242 | ||
538 | __SYSCALL(242, sys_io_getevents, 5) | ||
539 | #define __NR_io_cancel 243 | ||
540 | __SYSCALL(243, sys_io_cancel, 3) | ||
541 | #define __NR_clock_settime 244 | ||
542 | __SYSCALL(244, sys_clock_settime, 2) | ||
543 | #define __NR_clock_gettime 245 | ||
544 | __SYSCALL(245, sys_clock_gettime, 2) | ||
545 | #define __NR_clock_getres 246 | ||
546 | __SYSCALL(246, sys_clock_getres, 2) | ||
547 | #define __NR_clock_nanosleep 247 | ||
548 | __SYSCALL(247, sys_clock_nanosleep, 4) | ||
549 | |||
550 | /* Timer */ | ||
551 | |||
552 | #define __NR_timer_create 248 | ||
553 | __SYSCALL(248, sys_timer_create, 3) | ||
554 | #define __NR_timer_delete 249 | ||
555 | __SYSCALL(249, sys_timer_delete, 1) | ||
556 | #define __NR_timer_settime 250 | ||
557 | __SYSCALL(250, sys_timer_settime, 4) | ||
558 | #define __NR_timer_gettime 251 | ||
559 | __SYSCALL(251, sys_timer_gettime, 2) | ||
560 | #define __NR_timer_getoverrun 252 | ||
561 | __SYSCALL(252, sys_timer_getoverrun, 1) | ||
562 | |||
563 | /* System */ | ||
564 | |||
565 | #define __NR_reserved244 253 | ||
566 | __SYSCALL(253, sys_ni_syscall, 0) | ||
567 | #define __NR_lookup_dcookie 254 | ||
568 | __SYSCALL(254, sys_lookup_dcookie, 4) | ||
569 | #define __NR_available255 255 | ||
570 | __SYSCALL(255, sys_ni_syscall, 0) | ||
571 | #define __NR_add_key 256 | ||
572 | __SYSCALL(256, sys_add_key, 5) | ||
573 | #define __NR_request_key 257 | ||
574 | __SYSCALL(257, sys_request_key, 5) | ||
575 | #define __NR_keyctl 258 | ||
576 | __SYSCALL(258, sys_keyctl, 5) | ||
577 | #define __NR_available259 259 | ||
578 | __SYSCALL(259, sys_ni_syscall, 0) | ||
579 | |||
580 | #define __NR_syscall_count 261 | ||
581 | |||
582 | /* | ||
583 | * sysxtensa syscall handler | ||
255 | * | 584 | * |
256 | * arguments syscall number arg0, arg1, arg2, arg3, arg4, arg5 | 585 | * int sysxtensa (SYS_XTENSA_ATOMIC_SET, ptr, val, unused); |
257 | * --------- -------------- ---------------------------------- | 586 | * int sysxtensa (SYS_XTENSA_ATOMIC_ADD, ptr, val, unused); |
258 | * 0 a2 | 587 | * int sysxtensa (SYS_XTENSA_ATOMIC_EXG_ADD, ptr, val, unused); |
259 | * 1 a2 a3 | 588 | * int sysxtensa (SYS_XTENSA_ATOMIC_CMP_SWP, ptr, oldval, newval); |
260 | * 2 a2 a4, a3 | 589 | * a2 a6 a3 a4 a5 |
261 | * 3 a2 a5, a3, a4 | ||
262 | * 4 a2 a6, a3, a4, a5 | ||
263 | * 5 a2 a7, a3, a4, a5, a6 | ||
264 | * 6 a2 a8, a3, a4, a5, a6, a7 | ||
265 | */ | 590 | */ |
266 | 591 | ||
267 | #define _syscall0(type,name) \ | 592 | #define SYS_XTENSA_RESERVED 0 /* don't use this */ |
268 | type name(void) \ | 593 | #define SYS_XTENSA_ATOMIC_SET 1 /* set variable */ |
269 | { \ | 594 | #define SYS_XTENSA_ATOMIC_EXG_ADD 2 /* exchange memory and add */ |
270 | long __res; \ | 595 | #define SYS_XTENSA_ATOMIC_ADD 3 /* add to memory */ |
271 | __asm__ __volatile__ ( \ | 596 | #define SYS_XTENSA_ATOMIC_CMP_SWP 4 /* compare and swap */ |
272 | " movi a2, %1 \n" \ | 597 | |
273 | " syscall \n" \ | 598 | #define SYS_XTENSA_COUNT 5 /* count */ |
274 | " mov %0, a2 \n" \ | 599 | |
275 | : "=a" (__res) \ | 600 | #ifdef __KERNEL__ |
276 | : "i" (__NR_##name) \ | ||
277 | : "a2" \ | ||
278 | ); \ | ||
279 | __syscall_return(type,__res); \ | ||
280 | } | ||
281 | |||
282 | #define _syscall1(type,name,type0,arg0) \ | ||
283 | type name(type0 arg0) \ | ||
284 | { \ | ||
285 | long __res; \ | ||
286 | __asm__ __volatile__ ( \ | ||
287 | " mov a3, %2 \n" \ | ||
288 | " movi a2, %1 \n" \ | ||
289 | " syscall \n" \ | ||
290 | " mov %0, a2 \n" \ | ||
291 | : "=a" (__res) \ | ||
292 | : "i" (__NR_##name), "a" (arg0) \ | ||
293 | : "a2", "a3" \ | ||
294 | ); \ | ||
295 | __syscall_return(type,__res); \ | ||
296 | } | ||
297 | |||
298 | #define _syscall2(type,name,type0,arg0,type1,arg1) \ | ||
299 | type name(type0 arg0,type1 arg1) \ | ||
300 | { \ | ||
301 | long __res; \ | ||
302 | __asm__ __volatile__ ( \ | ||
303 | " mov a4, %2 \n" \ | ||
304 | " mov a3, %3 \n" \ | ||
305 | " movi a2, %1 \n" \ | ||
306 | " syscall \n" \ | ||
307 | " mov %0, a2 \n" \ | ||
308 | : "=a" (__res) \ | ||
309 | : "i" (__NR_##name), "a" (arg0), "a" (arg1) \ | ||
310 | : "a2", "a3", "a4" \ | ||
311 | ); \ | ||
312 | __syscall_return(type,__res); \ | ||
313 | } | ||
314 | |||
315 | #define _syscall3(type,name,type0,arg0,type1,arg1,type2,arg2) \ | ||
316 | type name(type0 arg0,type1 arg1,type2 arg2) \ | ||
317 | { \ | ||
318 | long __res; \ | ||
319 | __asm__ __volatile__ ( \ | ||
320 | " mov a5, %2 \n" \ | ||
321 | " mov a4, %4 \n" \ | ||
322 | " mov a3, %3 \n" \ | ||
323 | " movi a2, %1 \n" \ | ||
324 | " syscall \n" \ | ||
325 | " mov %0, a2 \n" \ | ||
326 | : "=a" (__res) \ | ||
327 | : "i" (__NR_##name), "a" (arg0), "a" (arg1), "a" (arg2) \ | ||
328 | : "a2", "a3", "a4", "a5" \ | ||
329 | ); \ | ||
330 | __syscall_return(type,__res); \ | ||
331 | } | ||
332 | |||
333 | #define _syscall4(type,name,type0,arg0,type1,arg1,type2,arg2,type3,arg3) \ | ||
334 | type name(type0 arg0,type1 arg1,type2 arg2,type3 arg3) \ | ||
335 | { \ | ||
336 | long __res; \ | ||
337 | __asm__ __volatile__ ( \ | ||
338 | " mov a6, %2 \n" \ | ||
339 | " mov a5, %5 \n" \ | ||
340 | " mov a4, %4 \n" \ | ||
341 | " mov a3, %3 \n" \ | ||
342 | " movi a2, %1 \n" \ | ||
343 | " syscall \n" \ | ||
344 | " mov %0, a2 \n" \ | ||
345 | : "=a" (__res) \ | ||
346 | : "i" (__NR_##name), "a" (arg0), "a" (arg1), "a" (arg2), "a" (arg3) \ | ||
347 | : "a2", "a3", "a4", "a5", "a6" \ | ||
348 | ); \ | ||
349 | __syscall_return(type,__res); \ | ||
350 | } | ||
351 | |||
352 | /* Note that we save and restore the a7 frame pointer. | ||
353 | * Including a7 in the clobber list doesn't do what you'd expect. | ||
354 | */ | ||
355 | #define _syscall5(type,name,type0,arg0,type1,arg1,type2,arg2,type3,arg3,type4,arg4) \ | ||
356 | type name(type0 arg0,type1 arg1,type2 arg2,type3 arg3,type4 arg4) \ | ||
357 | { \ | ||
358 | long __res; \ | ||
359 | __asm__ __volatile__ ( \ | ||
360 | " mov a9, a7 \n" \ | ||
361 | " mov a7, %2 \n" \ | ||
362 | " mov a6, %6 \n" \ | ||
363 | " mov a5, %5 \n" \ | ||
364 | " mov a4, %4 \n" \ | ||
365 | " mov a3, %3 \n" \ | ||
366 | " movi a2, %1 \n" \ | ||
367 | " syscall \n" \ | ||
368 | " mov a7, a9 \n" \ | ||
369 | " mov %0, a2 \n" \ | ||
370 | : "=a" (__res) \ | ||
371 | : "i" (__NR_##name), "a" (arg0), "a" (arg1), "a" (arg2), \ | ||
372 | "a" (arg3), "a" (arg4) \ | ||
373 | : "a2", "a3", "a4", "a5", "a6", "a9" \ | ||
374 | ); \ | ||
375 | __syscall_return(type,__res); \ | ||
376 | } | ||
377 | |||
378 | /* Note that we save and restore the a7 frame pointer. | ||
379 | * Including a7 in the clobber list doesn't do what you'd expect. | ||
380 | */ | ||
381 | #define _syscall6(type,name,type0,arg0,type1,arg1,type2,arg2,type3,arg3,type4,arg4,type5,arg5) \ | ||
382 | type name(type0 arg0,type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5) \ | ||
383 | { \ | ||
384 | long __res; \ | ||
385 | __asm__ __volatile__ ( \ | ||
386 | " mov a9, a7 \n" \ | ||
387 | " mov a8, %2 \n" \ | ||
388 | " mov a7, %7 \n" \ | ||
389 | " mov a6, %6 \n" \ | ||
390 | " mov a5, %5 \n" \ | ||
391 | " mov a4, %4 \n" \ | ||
392 | " mov a3, %3 \n" \ | ||
393 | " movi a2, %1 \n" \ | ||
394 | " syscall \n" \ | ||
395 | " mov a7, a9 \n" \ | ||
396 | " mov %0, a2 \n" \ | ||
397 | : "=a" (__res) \ | ||
398 | : "i" (__NR_##name), "a" (arg0), "a" (arg1), "a" (arg2), \ | ||
399 | "a" (arg3), "a" (arg4), "a" (arg5) \ | ||
400 | : "a2", "a3", "a4", "a5", "a6", "a8", "a9" \ | ||
401 | ); \ | ||
402 | __syscall_return(type,__res); \ | ||
403 | } | ||
404 | 601 | ||
405 | /* | 602 | /* |
406 | * "Conditional" syscalls | 603 | * "Conditional" syscalls |
@@ -414,6 +611,9 @@ __syscall_return(type,__res); \ | |||
414 | #define __ARCH_WANT_SYS_UTIME | 611 | #define __ARCH_WANT_SYS_UTIME |
415 | #define __ARCH_WANT_SYS_LLSEEK | 612 | #define __ARCH_WANT_SYS_LLSEEK |
416 | #define __ARCH_WANT_SYS_RT_SIGACTION | 613 | #define __ARCH_WANT_SYS_RT_SIGACTION |
417 | #endif /* __KERNEL__ */ | 614 | #define __ARCH_WANT_SYS_RT_SIGSUSPEND |
615 | |||
616 | #endif /* __KERNEL__ */ | ||
418 | 617 | ||
419 | #endif /* _XTENSA_UNISTD_H */ | 618 | #endif /* _XTENSA_UNISTD_H */ |
619 | |||