1 |
1275 |
phoenix |
#ifndef _ALPHA_UNISTD_H
|
2 |
|
|
#define _ALPHA_UNISTD_H
|
3 |
|
|
|
4 |
|
|
#define __NR_osf_syscall 0 /* not implemented */
|
5 |
|
|
#define __NR_exit 1
|
6 |
|
|
#define __NR_fork 2
|
7 |
|
|
#define __NR_read 3
|
8 |
|
|
#define __NR_write 4
|
9 |
|
|
#define __NR_osf_old_open 5 /* not implemented */
|
10 |
|
|
#define __NR_close 6
|
11 |
|
|
#define __NR_osf_wait4 7
|
12 |
|
|
#define __NR_osf_old_creat 8 /* not implemented */
|
13 |
|
|
#define __NR_link 9
|
14 |
|
|
#define __NR_unlink 10
|
15 |
|
|
#define __NR_osf_execve 11 /* not implemented */
|
16 |
|
|
#define __NR_chdir 12
|
17 |
|
|
#define __NR_fchdir 13
|
18 |
|
|
#define __NR_mknod 14
|
19 |
|
|
#define __NR_chmod 15
|
20 |
|
|
#define __NR_chown 16
|
21 |
|
|
#define __NR_brk 17
|
22 |
|
|
#define __NR_osf_getfsstat 18 /* not implemented */
|
23 |
|
|
#define __NR_lseek 19
|
24 |
|
|
#define __NR_getxpid 20
|
25 |
|
|
#define __NR_osf_mount 21
|
26 |
|
|
#define __NR_umount 22
|
27 |
|
|
#define __NR_setuid 23
|
28 |
|
|
#define __NR_getxuid 24
|
29 |
|
|
#define __NR_exec_with_loader 25 /* not implemented */
|
30 |
|
|
#define __NR_ptrace 26
|
31 |
|
|
#define __NR_osf_nrecvmsg 27 /* not implemented */
|
32 |
|
|
#define __NR_osf_nsendmsg 28 /* not implemented */
|
33 |
|
|
#define __NR_osf_nrecvfrom 29 /* not implemented */
|
34 |
|
|
#define __NR_osf_naccept 30 /* not implemented */
|
35 |
|
|
#define __NR_osf_ngetpeername 31 /* not implemented */
|
36 |
|
|
#define __NR_osf_ngetsockname 32 /* not implemented */
|
37 |
|
|
#define __NR_access 33
|
38 |
|
|
#define __NR_osf_chflags 34 /* not implemented */
|
39 |
|
|
#define __NR_osf_fchflags 35 /* not implemented */
|
40 |
|
|
#define __NR_sync 36
|
41 |
|
|
#define __NR_kill 37
|
42 |
|
|
#define __NR_osf_old_stat 38 /* not implemented */
|
43 |
|
|
#define __NR_setpgid 39
|
44 |
|
|
#define __NR_osf_old_lstat 40 /* not implemented */
|
45 |
|
|
#define __NR_dup 41
|
46 |
|
|
#define __NR_pipe 42
|
47 |
|
|
#define __NR_osf_set_program_attributes 43
|
48 |
|
|
#define __NR_osf_profil 44 /* not implemented */
|
49 |
|
|
#define __NR_open 45
|
50 |
|
|
#define __NR_osf_old_sigaction 46 /* not implemented */
|
51 |
|
|
#define __NR_getxgid 47
|
52 |
|
|
#define __NR_osf_sigprocmask 48
|
53 |
|
|
#define __NR_osf_getlogin 49 /* not implemented */
|
54 |
|
|
#define __NR_osf_setlogin 50 /* not implemented */
|
55 |
|
|
#define __NR_acct 51
|
56 |
|
|
#define __NR_sigpending 52
|
57 |
|
|
|
58 |
|
|
#define __NR_ioctl 54
|
59 |
|
|
#define __NR_osf_reboot 55 /* not implemented */
|
60 |
|
|
#define __NR_osf_revoke 56 /* not implemented */
|
61 |
|
|
#define __NR_symlink 57
|
62 |
|
|
#define __NR_readlink 58
|
63 |
|
|
#define __NR_execve 59
|
64 |
|
|
#define __NR_umask 60
|
65 |
|
|
#define __NR_chroot 61
|
66 |
|
|
#define __NR_osf_old_fstat 62 /* not implemented */
|
67 |
|
|
#define __NR_getpgrp 63
|
68 |
|
|
#define __NR_getpagesize 64
|
69 |
|
|
#define __NR_osf_mremap 65 /* not implemented */
|
70 |
|
|
#define __NR_vfork 66
|
71 |
|
|
#define __NR_stat 67
|
72 |
|
|
#define __NR_lstat 68
|
73 |
|
|
#define __NR_osf_sbrk 69 /* not implemented */
|
74 |
|
|
#define __NR_osf_sstk 70 /* not implemented */
|
75 |
|
|
#define __NR_mmap 71 /* OSF/1 mmap is superset of Linux */
|
76 |
|
|
#define __NR_osf_old_vadvise 72 /* not implemented */
|
77 |
|
|
#define __NR_munmap 73
|
78 |
|
|
#define __NR_mprotect 74
|
79 |
|
|
#define __NR_madvise 75
|
80 |
|
|
#define __NR_vhangup 76
|
81 |
|
|
#define __NR_osf_kmodcall 77 /* not implemented */
|
82 |
|
|
#define __NR_osf_mincore 78 /* not implemented */
|
83 |
|
|
#define __NR_getgroups 79
|
84 |
|
|
#define __NR_setgroups 80
|
85 |
|
|
#define __NR_osf_old_getpgrp 81 /* not implemented */
|
86 |
|
|
#define __NR_setpgrp 82 /* BSD alias for setpgid */
|
87 |
|
|
#define __NR_osf_setitimer 83
|
88 |
|
|
#define __NR_osf_old_wait 84 /* not implemented */
|
89 |
|
|
#define __NR_osf_table 85 /* not implemented */
|
90 |
|
|
#define __NR_osf_getitimer 86
|
91 |
|
|
#define __NR_gethostname 87
|
92 |
|
|
#define __NR_sethostname 88
|
93 |
|
|
#define __NR_getdtablesize 89
|
94 |
|
|
#define __NR_dup2 90
|
95 |
|
|
#define __NR_fstat 91
|
96 |
|
|
#define __NR_fcntl 92
|
97 |
|
|
#define __NR_osf_select 93
|
98 |
|
|
#define __NR_poll 94
|
99 |
|
|
#define __NR_fsync 95
|
100 |
|
|
#define __NR_setpriority 96
|
101 |
|
|
#define __NR_socket 97
|
102 |
|
|
#define __NR_connect 98
|
103 |
|
|
#define __NR_accept 99
|
104 |
|
|
#define __NR_getpriority 100
|
105 |
|
|
#define __NR_send 101
|
106 |
|
|
#define __NR_recv 102
|
107 |
|
|
#define __NR_sigreturn 103
|
108 |
|
|
#define __NR_bind 104
|
109 |
|
|
#define __NR_setsockopt 105
|
110 |
|
|
#define __NR_listen 106
|
111 |
|
|
#define __NR_osf_plock 107 /* not implemented */
|
112 |
|
|
#define __NR_osf_old_sigvec 108 /* not implemented */
|
113 |
|
|
#define __NR_osf_old_sigblock 109 /* not implemented */
|
114 |
|
|
#define __NR_osf_old_sigsetmask 110 /* not implemented */
|
115 |
|
|
#define __NR_sigsuspend 111
|
116 |
|
|
#define __NR_osf_sigstack 112
|
117 |
|
|
#define __NR_recvmsg 113
|
118 |
|
|
#define __NR_sendmsg 114
|
119 |
|
|
#define __NR_osf_old_vtrace 115 /* not implemented */
|
120 |
|
|
#define __NR_osf_gettimeofday 116
|
121 |
|
|
#define __NR_osf_getrusage 117
|
122 |
|
|
#define __NR_getsockopt 118
|
123 |
|
|
|
124 |
|
|
#define __NR_readv 120
|
125 |
|
|
#define __NR_writev 121
|
126 |
|
|
#define __NR_osf_settimeofday 122
|
127 |
|
|
#define __NR_fchown 123
|
128 |
|
|
#define __NR_fchmod 124
|
129 |
|
|
#define __NR_recvfrom 125
|
130 |
|
|
#define __NR_setreuid 126
|
131 |
|
|
#define __NR_setregid 127
|
132 |
|
|
#define __NR_rename 128
|
133 |
|
|
#define __NR_truncate 129
|
134 |
|
|
#define __NR_ftruncate 130
|
135 |
|
|
#define __NR_flock 131
|
136 |
|
|
#define __NR_setgid 132
|
137 |
|
|
#define __NR_sendto 133
|
138 |
|
|
#define __NR_shutdown 134
|
139 |
|
|
#define __NR_socketpair 135
|
140 |
|
|
#define __NR_mkdir 136
|
141 |
|
|
#define __NR_rmdir 137
|
142 |
|
|
#define __NR_osf_utimes 138
|
143 |
|
|
#define __NR_osf_old_sigreturn 139 /* not implemented */
|
144 |
|
|
#define __NR_osf_adjtime 140 /* not implemented */
|
145 |
|
|
#define __NR_getpeername 141
|
146 |
|
|
#define __NR_osf_gethostid 142 /* not implemented */
|
147 |
|
|
#define __NR_osf_sethostid 143 /* not implemented */
|
148 |
|
|
#define __NR_getrlimit 144
|
149 |
|
|
#define __NR_setrlimit 145
|
150 |
|
|
#define __NR_osf_old_killpg 146 /* not implemented */
|
151 |
|
|
#define __NR_setsid 147
|
152 |
|
|
#define __NR_quotactl 148
|
153 |
|
|
#define __NR_osf_oldquota 149 /* not implemented */
|
154 |
|
|
#define __NR_getsockname 150
|
155 |
|
|
|
156 |
|
|
#define __NR_osf_pid_block 153 /* not implemented */
|
157 |
|
|
#define __NR_osf_pid_unblock 154 /* not implemented */
|
158 |
|
|
|
159 |
|
|
#define __NR_sigaction 156
|
160 |
|
|
#define __NR_osf_sigwaitprim 157 /* not implemented */
|
161 |
|
|
#define __NR_osf_nfssvc 158 /* not implemented */
|
162 |
|
|
#define __NR_osf_getdirentries 159
|
163 |
|
|
#define __NR_osf_statfs 160
|
164 |
|
|
#define __NR_osf_fstatfs 161
|
165 |
|
|
|
166 |
|
|
#define __NR_osf_asynch_daemon 163 /* not implemented */
|
167 |
|
|
#define __NR_osf_getfh 164 /* not implemented */
|
168 |
|
|
#define __NR_osf_getdomainname 165
|
169 |
|
|
#define __NR_setdomainname 166
|
170 |
|
|
|
171 |
|
|
#define __NR_osf_exportfs 169 /* not implemented */
|
172 |
|
|
|
173 |
|
|
#define __NR_osf_alt_plock 181 /* not implemented */
|
174 |
|
|
|
175 |
|
|
#define __NR_osf_getmnt 184 /* not implemented */
|
176 |
|
|
|
177 |
|
|
#define __NR_osf_alt_sigpending 187 /* not implemented */
|
178 |
|
|
#define __NR_osf_alt_setsid 188 /* not implemented */
|
179 |
|
|
|
180 |
|
|
#define __NR_osf_swapon 199
|
181 |
|
|
#define __NR_msgctl 200
|
182 |
|
|
#define __NR_msgget 201
|
183 |
|
|
#define __NR_msgrcv 202
|
184 |
|
|
#define __NR_msgsnd 203
|
185 |
|
|
#define __NR_semctl 204
|
186 |
|
|
#define __NR_semget 205
|
187 |
|
|
#define __NR_semop 206
|
188 |
|
|
#define __NR_osf_utsname 207
|
189 |
|
|
#define __NR_lchown 208
|
190 |
|
|
#define __NR_osf_shmat 209
|
191 |
|
|
#define __NR_shmctl 210
|
192 |
|
|
#define __NR_shmdt 211
|
193 |
|
|
#define __NR_shmget 212
|
194 |
|
|
#define __NR_osf_mvalid 213 /* not implemented */
|
195 |
|
|
#define __NR_osf_getaddressconf 214 /* not implemented */
|
196 |
|
|
#define __NR_osf_msleep 215 /* not implemented */
|
197 |
|
|
#define __NR_osf_mwakeup 216 /* not implemented */
|
198 |
|
|
#define __NR_msync 217
|
199 |
|
|
#define __NR_osf_signal 218 /* not implemented */
|
200 |
|
|
#define __NR_osf_utc_gettime 219 /* not implemented */
|
201 |
|
|
#define __NR_osf_utc_adjtime 220 /* not implemented */
|
202 |
|
|
|
203 |
|
|
#define __NR_osf_security 222 /* not implemented */
|
204 |
|
|
#define __NR_osf_kloadcall 223 /* not implemented */
|
205 |
|
|
|
206 |
|
|
#define __NR_getpgid 233
|
207 |
|
|
#define __NR_getsid 234
|
208 |
|
|
#define __NR_sigaltstack 235
|
209 |
|
|
#define __NR_osf_waitid 236 /* not implemented */
|
210 |
|
|
#define __NR_osf_priocntlset 237 /* not implemented */
|
211 |
|
|
#define __NR_osf_sigsendset 238 /* not implemented */
|
212 |
|
|
#define __NR_osf_set_speculative 239 /* not implemented */
|
213 |
|
|
#define __NR_osf_msfs_syscall 240 /* not implemented */
|
214 |
|
|
#define __NR_osf_sysinfo 241
|
215 |
|
|
#define __NR_osf_uadmin 242 /* not implemented */
|
216 |
|
|
#define __NR_osf_fuser 243 /* not implemented */
|
217 |
|
|
#define __NR_osf_proplist_syscall 244
|
218 |
|
|
#define __NR_osf_ntp_adjtime 245 /* not implemented */
|
219 |
|
|
#define __NR_osf_ntp_gettime 246 /* not implemented */
|
220 |
|
|
#define __NR_osf_pathconf 247 /* not implemented */
|
221 |
|
|
#define __NR_osf_fpathconf 248 /* not implemented */
|
222 |
|
|
|
223 |
|
|
#define __NR_osf_uswitch 250 /* not implemented */
|
224 |
|
|
#define __NR_osf_usleep_thread 251
|
225 |
|
|
#define __NR_osf_audcntl 252 /* not implemented */
|
226 |
|
|
#define __NR_osf_audgen 253 /* not implemented */
|
227 |
|
|
#define __NR_sysfs 254
|
228 |
|
|
#define __NR_osf_subsys_info 255 /* not implemented */
|
229 |
|
|
#define __NR_osf_getsysinfo 256
|
230 |
|
|
#define __NR_osf_setsysinfo 257
|
231 |
|
|
#define __NR_osf_afs_syscall 258 /* not implemented */
|
232 |
|
|
#define __NR_osf_swapctl 259 /* not implemented */
|
233 |
|
|
#define __NR_osf_memcntl 260 /* not implemented */
|
234 |
|
|
#define __NR_osf_fdatasync 261 /* not implemented */
|
235 |
|
|
|
236 |
|
|
|
237 |
|
|
/*
|
238 |
|
|
* Linux-specific system calls begin at 300
|
239 |
|
|
*/
|
240 |
|
|
#define __NR_bdflush 300
|
241 |
|
|
#define __NR_sethae 301
|
242 |
|
|
#define __NR_mount 302
|
243 |
|
|
#define __NR_old_adjtimex 303
|
244 |
|
|
#define __NR_swapoff 304
|
245 |
|
|
#define __NR_getdents 305
|
246 |
|
|
#define __NR_create_module 306
|
247 |
|
|
#define __NR_init_module 307
|
248 |
|
|
#define __NR_delete_module 308
|
249 |
|
|
#define __NR_get_kernel_syms 309
|
250 |
|
|
#define __NR_syslog 310
|
251 |
|
|
#define __NR_reboot 311
|
252 |
|
|
#define __NR_clone 312
|
253 |
|
|
#define __NR_uselib 313
|
254 |
|
|
#define __NR_mlock 314
|
255 |
|
|
#define __NR_munlock 315
|
256 |
|
|
#define __NR_mlockall 316
|
257 |
|
|
#define __NR_munlockall 317
|
258 |
|
|
#define __NR_sysinfo 318
|
259 |
|
|
#define __NR__sysctl 319
|
260 |
|
|
/* 320 was sys_idle. */
|
261 |
|
|
#define __NR_oldumount 321
|
262 |
|
|
#define __NR_swapon 322
|
263 |
|
|
#define __NR_times 323
|
264 |
|
|
#define __NR_personality 324
|
265 |
|
|
#define __NR_setfsuid 325
|
266 |
|
|
#define __NR_setfsgid 326
|
267 |
|
|
#define __NR_ustat 327
|
268 |
|
|
#define __NR_statfs 328
|
269 |
|
|
#define __NR_fstatfs 329
|
270 |
|
|
#define __NR_sched_setparam 330
|
271 |
|
|
#define __NR_sched_getparam 331
|
272 |
|
|
#define __NR_sched_setscheduler 332
|
273 |
|
|
#define __NR_sched_getscheduler 333
|
274 |
|
|
#define __NR_sched_yield 334
|
275 |
|
|
#define __NR_sched_get_priority_max 335
|
276 |
|
|
#define __NR_sched_get_priority_min 336
|
277 |
|
|
#define __NR_sched_rr_get_interval 337
|
278 |
|
|
#define __NR_afs_syscall 338
|
279 |
|
|
#define __NR_uname 339
|
280 |
|
|
#define __NR_nanosleep 340
|
281 |
|
|
#define __NR_mremap 341
|
282 |
|
|
#define __NR_nfsservctl 342
|
283 |
|
|
#define __NR_setresuid 343
|
284 |
|
|
#define __NR_getresuid 344
|
285 |
|
|
#define __NR_pciconfig_read 345
|
286 |
|
|
#define __NR_pciconfig_write 346
|
287 |
|
|
#define __NR_query_module 347
|
288 |
|
|
#define __NR_prctl 348
|
289 |
|
|
#define __NR_pread 349
|
290 |
|
|
#define __NR_pwrite 350
|
291 |
|
|
#define __NR_rt_sigreturn 351
|
292 |
|
|
#define __NR_rt_sigaction 352
|
293 |
|
|
#define __NR_rt_sigprocmask 353
|
294 |
|
|
#define __NR_rt_sigpending 354
|
295 |
|
|
#define __NR_rt_sigtimedwait 355
|
296 |
|
|
#define __NR_rt_sigqueueinfo 356
|
297 |
|
|
#define __NR_rt_sigsuspend 357
|
298 |
|
|
#define __NR_select 358
|
299 |
|
|
#define __NR_gettimeofday 359
|
300 |
|
|
#define __NR_settimeofday 360
|
301 |
|
|
#define __NR_getitimer 361
|
302 |
|
|
#define __NR_setitimer 362
|
303 |
|
|
#define __NR_utimes 363
|
304 |
|
|
#define __NR_getrusage 364
|
305 |
|
|
#define __NR_wait4 365
|
306 |
|
|
#define __NR_adjtimex 366
|
307 |
|
|
#define __NR_getcwd 367
|
308 |
|
|
#define __NR_capget 368
|
309 |
|
|
#define __NR_capset 369
|
310 |
|
|
#define __NR_sendfile 370
|
311 |
|
|
#define __NR_setresgid 371
|
312 |
|
|
#define __NR_getresgid 372
|
313 |
|
|
#define __NR_dipc 373
|
314 |
|
|
#define __NR_pivot_root 374
|
315 |
|
|
#define __NR_mincore 375
|
316 |
|
|
#define __NR_pciconfig_iobase 376
|
317 |
|
|
#define __NR_getdents64 377
|
318 |
|
|
#define __NR_gettid 378
|
319 |
|
|
#define __NR_readahead 379
|
320 |
|
|
#define __NR_security 380 /* syscall for security modules */
|
321 |
|
|
#define __NR_tkill 381
|
322 |
|
|
#define __NR_setxattr 382
|
323 |
|
|
#define __NR_lsetxattr 383
|
324 |
|
|
#define __NR_fsetxattr 384
|
325 |
|
|
#define __NR_getxattr 385
|
326 |
|
|
#define __NR_lgetxattr 386
|
327 |
|
|
#define __NR_fgetxattr 387
|
328 |
|
|
#define __NR_listxattr 388
|
329 |
|
|
#define __NR_llistxattr 389
|
330 |
|
|
#define __NR_flistxattr 390
|
331 |
|
|
#define __NR_removexattr 391
|
332 |
|
|
#define __NR_lremovexattr 392
|
333 |
|
|
#define __NR_fremovexattr 393
|
334 |
|
|
|
335 |
|
|
|
336 |
|
|
#if defined(__GNUC__)
|
337 |
|
|
|
338 |
|
|
#define _syscall_return(type) \
|
339 |
|
|
return (_sc_err ? errno = _sc_ret, _sc_ret = -1L : 0), (type) _sc_ret
|
340 |
|
|
|
341 |
|
|
#define _syscall_clobbers \
|
342 |
|
|
"$1", "$2", "$3", "$4", "$5", "$6", "$7", "$8", \
|
343 |
|
|
"$22", "$23", "$24", "$25", "$27", "$28" \
|
344 |
|
|
|
345 |
|
|
#define _syscall0(type, name) \
|
346 |
|
|
type name(void) \
|
347 |
|
|
{ \
|
348 |
|
|
long _sc_ret, _sc_err; \
|
349 |
|
|
{ \
|
350 |
|
|
register long _sc_0 __asm__("$0"); \
|
351 |
|
|
register long _sc_19 __asm__("$19"); \
|
352 |
|
|
\
|
353 |
|
|
_sc_0 = __NR_##name; \
|
354 |
|
|
__asm__("callsys # %0 %1 %2" \
|
355 |
|
|
: "=r"(_sc_0), "=r"(_sc_19) \
|
356 |
|
|
: "0"(_sc_0) \
|
357 |
|
|
: _syscall_clobbers); \
|
358 |
|
|
_sc_ret = _sc_0, _sc_err = _sc_19; \
|
359 |
|
|
} \
|
360 |
|
|
_syscall_return(type); \
|
361 |
|
|
}
|
362 |
|
|
|
363 |
|
|
#define _syscall1(type,name,type1,arg1) \
|
364 |
|
|
type name(type1 arg1) \
|
365 |
|
|
{ \
|
366 |
|
|
long _sc_ret, _sc_err; \
|
367 |
|
|
{ \
|
368 |
|
|
register long _sc_0 __asm__("$0"); \
|
369 |
|
|
register long _sc_16 __asm__("$16"); \
|
370 |
|
|
register long _sc_19 __asm__("$19"); \
|
371 |
|
|
\
|
372 |
|
|
_sc_0 = __NR_##name; \
|
373 |
|
|
_sc_16 = (long) (arg1); \
|
374 |
|
|
__asm__("callsys # %0 %1 %2 %3" \
|
375 |
|
|
: "=r"(_sc_0), "=r"(_sc_19) \
|
376 |
|
|
: "0"(_sc_0), "r"(_sc_16) \
|
377 |
|
|
: _syscall_clobbers); \
|
378 |
|
|
_sc_ret = _sc_0, _sc_err = _sc_19; \
|
379 |
|
|
} \
|
380 |
|
|
_syscall_return(type); \
|
381 |
|
|
}
|
382 |
|
|
|
383 |
|
|
#define _syscall2(type,name,type1,arg1,type2,arg2) \
|
384 |
|
|
type name(type1 arg1,type2 arg2) \
|
385 |
|
|
{ \
|
386 |
|
|
long _sc_ret, _sc_err; \
|
387 |
|
|
{ \
|
388 |
|
|
register long _sc_0 __asm__("$0"); \
|
389 |
|
|
register long _sc_16 __asm__("$16"); \
|
390 |
|
|
register long _sc_17 __asm__("$17"); \
|
391 |
|
|
register long _sc_19 __asm__("$19"); \
|
392 |
|
|
\
|
393 |
|
|
_sc_0 = __NR_##name; \
|
394 |
|
|
_sc_16 = (long) (arg1); \
|
395 |
|
|
_sc_17 = (long) (arg2); \
|
396 |
|
|
__asm__("callsys # %0 %1 %2 %3 %4" \
|
397 |
|
|
: "=r"(_sc_0), "=r"(_sc_19) \
|
398 |
|
|
: "0"(_sc_0), "r"(_sc_16), "r"(_sc_17) \
|
399 |
|
|
: _syscall_clobbers); \
|
400 |
|
|
_sc_ret = _sc_0, _sc_err = _sc_19; \
|
401 |
|
|
} \
|
402 |
|
|
_syscall_return(type); \
|
403 |
|
|
}
|
404 |
|
|
|
405 |
|
|
#define _syscall3(type,name,type1,arg1,type2,arg2,type3,arg3) \
|
406 |
|
|
type name(type1 arg1,type2 arg2,type3 arg3) \
|
407 |
|
|
{ \
|
408 |
|
|
long _sc_ret, _sc_err; \
|
409 |
|
|
{ \
|
410 |
|
|
register long _sc_0 __asm__("$0"); \
|
411 |
|
|
register long _sc_16 __asm__("$16"); \
|
412 |
|
|
register long _sc_17 __asm__("$17"); \
|
413 |
|
|
register long _sc_18 __asm__("$18"); \
|
414 |
|
|
register long _sc_19 __asm__("$19"); \
|
415 |
|
|
\
|
416 |
|
|
_sc_0 = __NR_##name; \
|
417 |
|
|
_sc_16 = (long) (arg1); \
|
418 |
|
|
_sc_17 = (long) (arg2); \
|
419 |
|
|
_sc_18 = (long) (arg3); \
|
420 |
|
|
__asm__("callsys # %0 %1 %2 %3 %4 %5" \
|
421 |
|
|
: "=r"(_sc_0), "=r"(_sc_19) \
|
422 |
|
|
: "0"(_sc_0), "r"(_sc_16), "r"(_sc_17), \
|
423 |
|
|
"r"(_sc_18) \
|
424 |
|
|
: _syscall_clobbers); \
|
425 |
|
|
_sc_ret = _sc_0, _sc_err = _sc_19; \
|
426 |
|
|
} \
|
427 |
|
|
_syscall_return(type); \
|
428 |
|
|
}
|
429 |
|
|
|
430 |
|
|
#define _syscall4(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4) \
|
431 |
|
|
type name (type1 arg1, type2 arg2, type3 arg3, type4 arg4) \
|
432 |
|
|
{ \
|
433 |
|
|
long _sc_ret, _sc_err; \
|
434 |
|
|
{ \
|
435 |
|
|
register long _sc_0 __asm__("$0"); \
|
436 |
|
|
register long _sc_16 __asm__("$16"); \
|
437 |
|
|
register long _sc_17 __asm__("$17"); \
|
438 |
|
|
register long _sc_18 __asm__("$18"); \
|
439 |
|
|
register long _sc_19 __asm__("$19"); \
|
440 |
|
|
\
|
441 |
|
|
_sc_0 = __NR_##name; \
|
442 |
|
|
_sc_16 = (long) (arg1); \
|
443 |
|
|
_sc_17 = (long) (arg2); \
|
444 |
|
|
_sc_18 = (long) (arg3); \
|
445 |
|
|
_sc_19 = (long) (arg4); \
|
446 |
|
|
__asm__("callsys # %0 %1 %2 %3 %4 %5 %6" \
|
447 |
|
|
: "=r"(_sc_0), "=r"(_sc_19) \
|
448 |
|
|
: "0"(_sc_0), "r"(_sc_16), "r"(_sc_17), \
|
449 |
|
|
"r"(_sc_18), "1"(_sc_19) \
|
450 |
|
|
: _syscall_clobbers); \
|
451 |
|
|
_sc_ret = _sc_0, _sc_err = _sc_19; \
|
452 |
|
|
} \
|
453 |
|
|
_syscall_return(type); \
|
454 |
|
|
}
|
455 |
|
|
|
456 |
|
|
#define _syscall5(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4, \
|
457 |
|
|
type5,arg5) \
|
458 |
|
|
type name (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5) \
|
459 |
|
|
{ \
|
460 |
|
|
long _sc_ret, _sc_err; \
|
461 |
|
|
{ \
|
462 |
|
|
register long _sc_0 __asm__("$0"); \
|
463 |
|
|
register long _sc_16 __asm__("$16"); \
|
464 |
|
|
register long _sc_17 __asm__("$17"); \
|
465 |
|
|
register long _sc_18 __asm__("$18"); \
|
466 |
|
|
register long _sc_19 __asm__("$19"); \
|
467 |
|
|
register long _sc_20 __asm__("$20"); \
|
468 |
|
|
\
|
469 |
|
|
_sc_0 = __NR_##name; \
|
470 |
|
|
_sc_16 = (long) (arg1); \
|
471 |
|
|
_sc_17 = (long) (arg2); \
|
472 |
|
|
_sc_18 = (long) (arg3); \
|
473 |
|
|
_sc_19 = (long) (arg4); \
|
474 |
|
|
_sc_20 = (long) (arg5); \
|
475 |
|
|
__asm__("callsys # %0 %1 %2 %3 %4 %5 %6 %7" \
|
476 |
|
|
: "=r"(_sc_0), "=r"(_sc_19) \
|
477 |
|
|
: "0"(_sc_0), "r"(_sc_16), "r"(_sc_17), \
|
478 |
|
|
"r"(_sc_18), "1"(_sc_19), "r"(_sc_20) \
|
479 |
|
|
: _syscall_clobbers); \
|
480 |
|
|
_sc_ret = _sc_0, _sc_err = _sc_19; \
|
481 |
|
|
} \
|
482 |
|
|
_syscall_return(type); \
|
483 |
|
|
}
|
484 |
|
|
|
485 |
|
|
#define _syscall6(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4, \
|
486 |
|
|
type5,arg5,type6,arg6) \
|
487 |
|
|
type name (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5, type6 arg6)\
|
488 |
|
|
{ \
|
489 |
|
|
long _sc_ret, _sc_err; \
|
490 |
|
|
{ \
|
491 |
|
|
register long _sc_0 __asm__("$0"); \
|
492 |
|
|
register long _sc_16 __asm__("$16"); \
|
493 |
|
|
register long _sc_17 __asm__("$17"); \
|
494 |
|
|
register long _sc_18 __asm__("$18"); \
|
495 |
|
|
register long _sc_19 __asm__("$19"); \
|
496 |
|
|
register long _sc_20 __asm__("$20"); \
|
497 |
|
|
register long _sc_21 __asm__("$21"); \
|
498 |
|
|
\
|
499 |
|
|
_sc_0 = __NR_##name; \
|
500 |
|
|
_sc_16 = (long) (arg1); \
|
501 |
|
|
_sc_17 = (long) (arg2); \
|
502 |
|
|
_sc_18 = (long) (arg3); \
|
503 |
|
|
_sc_19 = (long) (arg4); \
|
504 |
|
|
_sc_20 = (long) (arg5); \
|
505 |
|
|
_sc_21 = (long) (arg6); \
|
506 |
|
|
__asm__("callsys # %0 %1 %2 %3 %4 %5 %6 %7 %8" \
|
507 |
|
|
: "=r"(_sc_0), "=r"(_sc_19) \
|
508 |
|
|
: "0"(_sc_0), "r"(_sc_16), "r"(_sc_17), \
|
509 |
|
|
"r"(_sc_18), "1"(_sc_19), "r"(_sc_20), "r"(_sc_21) \
|
510 |
|
|
: _syscall_clobbers); \
|
511 |
|
|
_sc_ret = _sc_0, _sc_err = _sc_19; \
|
512 |
|
|
} \
|
513 |
|
|
_syscall_return(type); \
|
514 |
|
|
}
|
515 |
|
|
|
516 |
|
|
#endif /* __LIBRARY__ && __GNUC__ */
|
517 |
|
|
|
518 |
|
|
#ifdef __KERNEL_SYSCALLS__
|
519 |
|
|
|
520 |
|
|
#include <linux/string.h>
|
521 |
|
|
#include <linux/signal.h>
|
522 |
|
|
|
523 |
|
|
extern void sys_idle(void);
|
524 |
|
|
static inline void idle(void)
|
525 |
|
|
{
|
526 |
|
|
sys_idle();
|
527 |
|
|
}
|
528 |
|
|
|
529 |
|
|
extern long sys_open(const char *, int, int);
|
530 |
|
|
static inline long open(const char * name, int mode, int flags)
|
531 |
|
|
{
|
532 |
|
|
return sys_open(name, mode, flags);
|
533 |
|
|
}
|
534 |
|
|
|
535 |
|
|
extern long sys_dup(int);
|
536 |
|
|
static inline long dup(int fd)
|
537 |
|
|
{
|
538 |
|
|
return sys_dup(fd);
|
539 |
|
|
}
|
540 |
|
|
|
541 |
|
|
static inline long close(int fd)
|
542 |
|
|
{
|
543 |
|
|
return sys_close(fd);
|
544 |
|
|
}
|
545 |
|
|
|
546 |
|
|
extern off_t sys_lseek(unsigned int, off_t, unsigned int);
|
547 |
|
|
static inline off_t lseek(unsigned int fd, off_t off, unsigned int whense)
|
548 |
|
|
{
|
549 |
|
|
return sys_lseek(fd, off, whense);
|
550 |
|
|
}
|
551 |
|
|
|
552 |
|
|
extern long sys_exit(int);
|
553 |
|
|
static inline long _exit(int value)
|
554 |
|
|
{
|
555 |
|
|
return sys_exit(value);
|
556 |
|
|
}
|
557 |
|
|
|
558 |
|
|
#define exit(x) _exit(x)
|
559 |
|
|
|
560 |
|
|
extern long sys_write(int, const char *, int);
|
561 |
|
|
static inline long write(int fd, const char * buf, int nr)
|
562 |
|
|
{
|
563 |
|
|
return sys_write(fd, buf, nr);
|
564 |
|
|
}
|
565 |
|
|
|
566 |
|
|
extern long sys_read(int, char *, int);
|
567 |
|
|
static inline long read(int fd, char * buf, int nr)
|
568 |
|
|
{
|
569 |
|
|
return sys_read(fd, buf, nr);
|
570 |
|
|
}
|
571 |
|
|
|
572 |
|
|
extern int __kernel_execve(char *, char **, char **, struct pt_regs *);
|
573 |
|
|
static inline long execve(char * file, char ** argvp, char ** envp)
|
574 |
|
|
{
|
575 |
|
|
struct pt_regs regs;
|
576 |
|
|
memset(®s, 0, sizeof(regs));
|
577 |
|
|
return __kernel_execve(file, argvp, envp, ®s);
|
578 |
|
|
}
|
579 |
|
|
|
580 |
|
|
extern long sys_setsid(void);
|
581 |
|
|
static inline long setsid(void)
|
582 |
|
|
{
|
583 |
|
|
return sys_setsid();
|
584 |
|
|
}
|
585 |
|
|
|
586 |
|
|
extern long sys_sync(void);
|
587 |
|
|
static inline long sync(void)
|
588 |
|
|
{
|
589 |
|
|
return sys_sync();
|
590 |
|
|
}
|
591 |
|
|
|
592 |
|
|
static inline pid_t waitpid(int pid, int * wait_stat, int flags)
|
593 |
|
|
{
|
594 |
|
|
return sys_wait4(pid, wait_stat, flags, NULL);
|
595 |
|
|
}
|
596 |
|
|
|
597 |
|
|
static inline pid_t wait(int * wait_stat)
|
598 |
|
|
{
|
599 |
|
|
return waitpid(-1,wait_stat,0);
|
600 |
|
|
}
|
601 |
|
|
|
602 |
|
|
extern long sys_delete_module(const char *name);
|
603 |
|
|
static inline long delete_module(const char *name)
|
604 |
|
|
{
|
605 |
|
|
return sys_delete_module(name);
|
606 |
|
|
}
|
607 |
|
|
|
608 |
|
|
#endif
|
609 |
|
|
|
610 |
|
|
#endif /* _ALPHA_UNISTD_H */
|