1 |
1275 |
phoenix |
#ifndef _ASM_IA64_UNISTD_H
|
2 |
|
|
#define _ASM_IA64_UNISTD_H
|
3 |
|
|
|
4 |
|
|
/*
|
5 |
|
|
* IA-64 Linux syscall numbers and inline-functions.
|
6 |
|
|
*
|
7 |
|
|
* Copyright (C) 1998-2001 Hewlett-Packard Co
|
8 |
|
|
* David Mosberger-Tang <davidm@hpl.hp.com>
|
9 |
|
|
*/
|
10 |
|
|
|
11 |
|
|
#include <asm/break.h>
|
12 |
|
|
|
13 |
|
|
#define __BREAK_SYSCALL __IA64_BREAK_SYSCALL
|
14 |
|
|
|
15 |
|
|
#define __NR_ni_syscall 1024
|
16 |
|
|
#define __NR_exit 1025
|
17 |
|
|
#define __NR_read 1026
|
18 |
|
|
#define __NR_write 1027
|
19 |
|
|
#define __NR_open 1028
|
20 |
|
|
#define __NR_close 1029
|
21 |
|
|
#define __NR_creat 1030
|
22 |
|
|
#define __NR_link 1031
|
23 |
|
|
#define __NR_unlink 1032
|
24 |
|
|
#define __NR_execve 1033
|
25 |
|
|
#define __NR_chdir 1034
|
26 |
|
|
#define __NR_fchdir 1035
|
27 |
|
|
#define __NR_utimes 1036
|
28 |
|
|
#define __NR_mknod 1037
|
29 |
|
|
#define __NR_chmod 1038
|
30 |
|
|
#define __NR_chown 1039
|
31 |
|
|
#define __NR_lseek 1040
|
32 |
|
|
#define __NR_getpid 1041
|
33 |
|
|
#define __NR_getppid 1042
|
34 |
|
|
#define __NR_mount 1043
|
35 |
|
|
#define __NR_umount 1044
|
36 |
|
|
#define __NR_setuid 1045
|
37 |
|
|
#define __NR_getuid 1046
|
38 |
|
|
#define __NR_geteuid 1047
|
39 |
|
|
#define __NR_ptrace 1048
|
40 |
|
|
#define __NR_access 1049
|
41 |
|
|
#define __NR_sync 1050
|
42 |
|
|
#define __NR_fsync 1051
|
43 |
|
|
#define __NR_fdatasync 1052
|
44 |
|
|
#define __NR_kill 1053
|
45 |
|
|
#define __NR_rename 1054
|
46 |
|
|
#define __NR_mkdir 1055
|
47 |
|
|
#define __NR_rmdir 1056
|
48 |
|
|
#define __NR_dup 1057
|
49 |
|
|
#define __NR_pipe 1058
|
50 |
|
|
#define __NR_times 1059
|
51 |
|
|
#define __NR_brk 1060
|
52 |
|
|
#define __NR_setgid 1061
|
53 |
|
|
#define __NR_getgid 1062
|
54 |
|
|
#define __NR_getegid 1063
|
55 |
|
|
#define __NR_acct 1064
|
56 |
|
|
#define __NR_ioctl 1065
|
57 |
|
|
#define __NR_fcntl 1066
|
58 |
|
|
#define __NR_umask 1067
|
59 |
|
|
#define __NR_chroot 1068
|
60 |
|
|
#define __NR_ustat 1069
|
61 |
|
|
#define __NR_dup2 1070
|
62 |
|
|
#define __NR_setreuid 1071
|
63 |
|
|
#define __NR_setregid 1072
|
64 |
|
|
#define __NR_getresuid 1073
|
65 |
|
|
#define __NR_setresuid 1074
|
66 |
|
|
#define __NR_getresgid 1075
|
67 |
|
|
#define __NR_setresgid 1076
|
68 |
|
|
#define __NR_getgroups 1077
|
69 |
|
|
#define __NR_setgroups 1078
|
70 |
|
|
#define __NR_getpgid 1079
|
71 |
|
|
#define __NR_setpgid 1080
|
72 |
|
|
#define __NR_setsid 1081
|
73 |
|
|
#define __NR_getsid 1082
|
74 |
|
|
#define __NR_sethostname 1083
|
75 |
|
|
#define __NR_setrlimit 1084
|
76 |
|
|
#define __NR_getrlimit 1085
|
77 |
|
|
#define __NR_getrusage 1086
|
78 |
|
|
#define __NR_gettimeofday 1087
|
79 |
|
|
#define __NR_settimeofday 1088
|
80 |
|
|
#define __NR_select 1089
|
81 |
|
|
#define __NR_poll 1090
|
82 |
|
|
#define __NR_symlink 1091
|
83 |
|
|
#define __NR_readlink 1092
|
84 |
|
|
#define __NR_uselib 1093
|
85 |
|
|
#define __NR_swapon 1094
|
86 |
|
|
#define __NR_swapoff 1095
|
87 |
|
|
#define __NR_reboot 1096
|
88 |
|
|
#define __NR_truncate 1097
|
89 |
|
|
#define __NR_ftruncate 1098
|
90 |
|
|
#define __NR_fchmod 1099
|
91 |
|
|
#define __NR_fchown 1100
|
92 |
|
|
#define __NR_getpriority 1101
|
93 |
|
|
#define __NR_setpriority 1102
|
94 |
|
|
#define __NR_statfs 1103
|
95 |
|
|
#define __NR_fstatfs 1104
|
96 |
|
|
#define __NR_gettid 1105
|
97 |
|
|
#define __NR_semget 1106
|
98 |
|
|
#define __NR_semop 1107
|
99 |
|
|
#define __NR_semctl 1108
|
100 |
|
|
#define __NR_msgget 1109
|
101 |
|
|
#define __NR_msgsnd 1110
|
102 |
|
|
#define __NR_msgrcv 1111
|
103 |
|
|
#define __NR_msgctl 1112
|
104 |
|
|
#define __NR_shmget 1113
|
105 |
|
|
#define __NR_shmat 1114
|
106 |
|
|
#define __NR_shmdt 1115
|
107 |
|
|
#define __NR_shmctl 1116
|
108 |
|
|
/* also known as klogctl() in GNU libc: */
|
109 |
|
|
#define __NR_syslog 1117
|
110 |
|
|
#define __NR_setitimer 1118
|
111 |
|
|
#define __NR_getitimer 1119
|
112 |
|
|
#define __NR_old_stat 1120
|
113 |
|
|
#define __NR_old_lstat 1121
|
114 |
|
|
#define __NR_old_fstat 1122
|
115 |
|
|
#define __NR_vhangup 1123
|
116 |
|
|
#define __NR_lchown 1124
|
117 |
|
|
#define __NR_vm86 1125
|
118 |
|
|
#define __NR_wait4 1126
|
119 |
|
|
#define __NR_sysinfo 1127
|
120 |
|
|
#define __NR_clone 1128
|
121 |
|
|
#define __NR_setdomainname 1129
|
122 |
|
|
#define __NR_uname 1130
|
123 |
|
|
#define __NR_adjtimex 1131
|
124 |
|
|
#define __NR_create_module 1132
|
125 |
|
|
#define __NR_init_module 1133
|
126 |
|
|
#define __NR_delete_module 1134
|
127 |
|
|
#define __NR_get_kernel_syms 1135
|
128 |
|
|
#define __NR_query_module 1136
|
129 |
|
|
#define __NR_quotactl 1137
|
130 |
|
|
#define __NR_bdflush 1138
|
131 |
|
|
#define __NR_sysfs 1139
|
132 |
|
|
#define __NR_personality 1140
|
133 |
|
|
#define __NR_afs_syscall 1141
|
134 |
|
|
#define __NR_setfsuid 1142
|
135 |
|
|
#define __NR_setfsgid 1143
|
136 |
|
|
#define __NR_getdents 1144
|
137 |
|
|
#define __NR_flock 1145
|
138 |
|
|
#define __NR_readv 1146
|
139 |
|
|
#define __NR_writev 1147
|
140 |
|
|
#define __NR_pread 1148
|
141 |
|
|
#define __NR_pwrite 1149
|
142 |
|
|
#define __NR__sysctl 1150
|
143 |
|
|
#define __NR_mmap 1151
|
144 |
|
|
#define __NR_munmap 1152
|
145 |
|
|
#define __NR_mlock 1153
|
146 |
|
|
#define __NR_mlockall 1154
|
147 |
|
|
#define __NR_mprotect 1155
|
148 |
|
|
#define __NR_mremap 1156
|
149 |
|
|
#define __NR_msync 1157
|
150 |
|
|
#define __NR_munlock 1158
|
151 |
|
|
#define __NR_munlockall 1159
|
152 |
|
|
#define __NR_sched_getparam 1160
|
153 |
|
|
#define __NR_sched_setparam 1161
|
154 |
|
|
#define __NR_sched_getscheduler 1162
|
155 |
|
|
#define __NR_sched_setscheduler 1163
|
156 |
|
|
#define __NR_sched_yield 1164
|
157 |
|
|
#define __NR_sched_get_priority_max 1165
|
158 |
|
|
#define __NR_sched_get_priority_min 1166
|
159 |
|
|
#define __NR_sched_rr_get_interval 1167
|
160 |
|
|
#define __NR_nanosleep 1168
|
161 |
|
|
#define __NR_nfsservctl 1169
|
162 |
|
|
#define __NR_prctl 1170
|
163 |
|
|
/* 1171 is reserved for backwards compatibility with old __NR_getpagesize */
|
164 |
|
|
#define __NR_mmap2 1172
|
165 |
|
|
#define __NR_pciconfig_read 1173
|
166 |
|
|
#define __NR_pciconfig_write 1174
|
167 |
|
|
#define __NR_perfmonctl 1175
|
168 |
|
|
#define __NR_sigaltstack 1176
|
169 |
|
|
#define __NR_rt_sigaction 1177
|
170 |
|
|
#define __NR_rt_sigpending 1178
|
171 |
|
|
#define __NR_rt_sigprocmask 1179
|
172 |
|
|
#define __NR_rt_sigqueueinfo 1180
|
173 |
|
|
#define __NR_rt_sigreturn 1181
|
174 |
|
|
#define __NR_rt_sigsuspend 1182
|
175 |
|
|
#define __NR_rt_sigtimedwait 1183
|
176 |
|
|
#define __NR_getcwd 1184
|
177 |
|
|
#define __NR_capget 1185
|
178 |
|
|
#define __NR_capset 1186
|
179 |
|
|
#define __NR_sendfile 1187
|
180 |
|
|
#define __NR_getpmsg 1188
|
181 |
|
|
#define __NR_putpmsg 1189
|
182 |
|
|
#define __NR_socket 1190
|
183 |
|
|
#define __NR_bind 1191
|
184 |
|
|
#define __NR_connect 1192
|
185 |
|
|
#define __NR_listen 1193
|
186 |
|
|
#define __NR_accept 1194
|
187 |
|
|
#define __NR_getsockname 1195
|
188 |
|
|
#define __NR_getpeername 1196
|
189 |
|
|
#define __NR_socketpair 1197
|
190 |
|
|
#define __NR_send 1198
|
191 |
|
|
#define __NR_sendto 1199
|
192 |
|
|
#define __NR_recv 1200
|
193 |
|
|
#define __NR_recvfrom 1201
|
194 |
|
|
#define __NR_shutdown 1202
|
195 |
|
|
#define __NR_setsockopt 1203
|
196 |
|
|
#define __NR_getsockopt 1204
|
197 |
|
|
#define __NR_sendmsg 1205
|
198 |
|
|
#define __NR_recvmsg 1206
|
199 |
|
|
#define __NR_pivot_root 1207
|
200 |
|
|
#define __NR_mincore 1208
|
201 |
|
|
#define __NR_madvise 1209
|
202 |
|
|
#define __NR_stat 1210
|
203 |
|
|
#define __NR_lstat 1211
|
204 |
|
|
#define __NR_fstat 1212
|
205 |
|
|
#define __NR_clone2 1213
|
206 |
|
|
#define __NR_getdents64 1214
|
207 |
|
|
#define __NR_getunwind 1215
|
208 |
|
|
#define __NR_readahead 1216
|
209 |
|
|
#define __NR_setxattr 1217
|
210 |
|
|
#define __NR_lsetxattr 1218
|
211 |
|
|
#define __NR_fsetxattr 1219
|
212 |
|
|
#define __NR_getxattr 1220
|
213 |
|
|
#define __NR_lgetxattr 1221
|
214 |
|
|
#define __NR_fgetxattr 1222
|
215 |
|
|
#define __NR_listxattr 1223
|
216 |
|
|
#define __NR_llistxattr 1224
|
217 |
|
|
#define __NR_flistxattr 1225
|
218 |
|
|
#define __NR_removexattr 1226
|
219 |
|
|
#define __NR_lremovexattr 1227
|
220 |
|
|
#define __NR_fremovexattr 1228
|
221 |
|
|
#define __NR_tkill 1229
|
222 |
|
|
/* 1230-1232: reserved for futex and sched_[sg]etaffinity */
|
223 |
|
|
#define __NR_security 1233
|
224 |
|
|
/* 1234-1235: reserved for {alloc,free}_hugepages */
|
225 |
|
|
/* 1238-1242: reserved for io_{setup,destroy,getevents,submit,cancel} */
|
226 |
|
|
#define __NR_semtimedop 1247
|
227 |
|
|
|
228 |
|
|
#if !defined(__ASSEMBLY__) && !defined(ASSEMBLER)
|
229 |
|
|
|
230 |
|
|
extern long __ia64_syscall (long a0, long a1, long a2, long a3, long a4, long nr);
|
231 |
|
|
|
232 |
|
|
#define _syscall0(type,name) \
|
233 |
|
|
type \
|
234 |
|
|
name (void) \
|
235 |
|
|
{ \
|
236 |
|
|
register long dummy1 __asm__ ("out0"); \
|
237 |
|
|
register long dummy2 __asm__ ("out1"); \
|
238 |
|
|
register long dummy3 __asm__ ("out2"); \
|
239 |
|
|
register long dummy4 __asm__ ("out3"); \
|
240 |
|
|
register long dummy5 __asm__ ("out4"); \
|
241 |
|
|
\
|
242 |
|
|
return __ia64_syscall(dummy1, dummy2, dummy3, dummy4, dummy5, \
|
243 |
|
|
__NR_##name); \
|
244 |
|
|
}
|
245 |
|
|
|
246 |
|
|
#define _syscall1(type,name,type1,arg1) \
|
247 |
|
|
type \
|
248 |
|
|
name (type1 arg1) \
|
249 |
|
|
{ \
|
250 |
|
|
register long dummy2 __asm__ ("out1"); \
|
251 |
|
|
register long dummy3 __asm__ ("out2"); \
|
252 |
|
|
register long dummy4 __asm__ ("out3"); \
|
253 |
|
|
register long dummy5 __asm__ ("out4"); \
|
254 |
|
|
\
|
255 |
|
|
return __ia64_syscall((long) arg1, dummy2, dummy3, dummy4, \
|
256 |
|
|
dummy5, __NR_##name); \
|
257 |
|
|
}
|
258 |
|
|
|
259 |
|
|
#define _syscall2(type,name,type1,arg1,type2,arg2) \
|
260 |
|
|
type \
|
261 |
|
|
name (type1 arg1, type2 arg2) \
|
262 |
|
|
{ \
|
263 |
|
|
register long dummy3 __asm__ ("out2"); \
|
264 |
|
|
register long dummy4 __asm__ ("out3"); \
|
265 |
|
|
register long dummy5 __asm__ ("out4"); \
|
266 |
|
|
\
|
267 |
|
|
return __ia64_syscall((long) arg1, (long) arg2, dummy3, dummy4, \
|
268 |
|
|
dummy5, __NR_##name); \
|
269 |
|
|
}
|
270 |
|
|
|
271 |
|
|
#define _syscall3(type,name,type1,arg1,type2,arg2,type3,arg3) \
|
272 |
|
|
type \
|
273 |
|
|
name (type1 arg1, type2 arg2, type3 arg3) \
|
274 |
|
|
{ \
|
275 |
|
|
register long dummy4 __asm__ ("out3"); \
|
276 |
|
|
register long dummy5 __asm__ ("out4"); \
|
277 |
|
|
\
|
278 |
|
|
return __ia64_syscall((long) arg1, (long) arg2, (long) arg3, \
|
279 |
|
|
dummy4, dummy5, __NR_##name); \
|
280 |
|
|
}
|
281 |
|
|
|
282 |
|
|
#define _syscall4(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4) \
|
283 |
|
|
type \
|
284 |
|
|
name (type1 arg1, type2 arg2, type3 arg3, type4 arg4) \
|
285 |
|
|
{ \
|
286 |
|
|
register long dummy5 __asm__ ("out4"); \
|
287 |
|
|
\
|
288 |
|
|
return __ia64_syscall((long) arg1, (long) arg2, (long) arg3, \
|
289 |
|
|
(long) arg4, dummy5, __NR_##name); \
|
290 |
|
|
}
|
291 |
|
|
|
292 |
|
|
#define _syscall5(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4,type5,arg5) \
|
293 |
|
|
type \
|
294 |
|
|
name (type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5) \
|
295 |
|
|
{ \
|
296 |
|
|
return __ia64_syscall((long) arg1, (long) arg2, (long) arg3, \
|
297 |
|
|
(long) arg4, (long) arg5, __NR_##name); \
|
298 |
|
|
}
|
299 |
|
|
|
300 |
|
|
#ifdef __KERNEL_SYSCALLS__
|
301 |
|
|
|
302 |
|
|
static inline _syscall0(int,sync)
|
303 |
|
|
static inline _syscall0(pid_t,setsid)
|
304 |
|
|
static inline _syscall3(int,write,int,fd,const char *,buf,off_t,count)
|
305 |
|
|
static inline _syscall3(int,read,int,fd,char *,buf,off_t,count)
|
306 |
|
|
static inline _syscall3(off_t,lseek,int,fd,off_t,offset,int,count)
|
307 |
|
|
static inline _syscall1(int,dup,int,fd)
|
308 |
|
|
static inline _syscall3(int,execve,const char *,file,char **,argv,char **,envp)
|
309 |
|
|
static inline _syscall3(int,open,const char *,file,int,flag,int,mode)
|
310 |
|
|
static inline _syscall1(int,close,int,fd)
|
311 |
|
|
static inline _syscall4(pid_t,wait4,pid_t,pid,int *,wait_stat,int,options,struct rusage*, rusage)
|
312 |
|
|
static inline _syscall1(int,delete_module,const char *,name)
|
313 |
|
|
static inline _syscall2(pid_t,clone,unsigned long,flags,void*,sp);
|
314 |
|
|
|
315 |
|
|
#define __NR__exit __NR_exit
|
316 |
|
|
static inline _syscall1(int,_exit,int,exitcode)
|
317 |
|
|
|
318 |
|
|
static inline pid_t
|
319 |
|
|
waitpid (int pid, int *wait_stat, int flags)
|
320 |
|
|
{
|
321 |
|
|
return wait4(pid, wait_stat, flags, NULL);
|
322 |
|
|
}
|
323 |
|
|
|
324 |
|
|
static inline pid_t
|
325 |
|
|
wait (int * wait_stat)
|
326 |
|
|
{
|
327 |
|
|
return wait4(-1, wait_stat, 0, 0);
|
328 |
|
|
}
|
329 |
|
|
|
330 |
|
|
#endif /* __KERNEL_SYSCALLS__ */
|
331 |
|
|
#endif /* !__ASSEMBLY__ */
|
332 |
|
|
#endif /* _ASM_IA64_UNISTD_H */
|