Commit | Line | Data |
---|---|---|
1da177e4 LT |
1 | #ifndef _LINUX_COMPAT_H |
2 | #define _LINUX_COMPAT_H | |
3 | /* | |
4 | * These are the type definitions for the architecture specific | |
5 | * syscall compatibility layer. | |
6 | */ | |
1da177e4 LT |
7 | |
8 | #ifdef CONFIG_COMPAT | |
9 | ||
10 | #include <linux/stat.h> | |
11 | #include <linux/param.h> /* for HZ */ | |
12 | #include <linux/sem.h> | |
2dceba14 AB |
13 | #include <linux/socket.h> |
14 | #include <linux/if.h> | |
be84cb43 | 15 | #include <linux/fs.h> |
45e9683e | 16 | #include <linux/aio_abi.h> /* for aio_context_t */ |
1da177e4 LT |
17 | |
18 | #include <asm/compat.h> | |
19 | #include <asm/siginfo.h> | |
3f2e05e9 | 20 | #include <asm/signal.h> |
1da177e4 | 21 | |
45e87781 L |
22 | #ifndef COMPAT_USE_64BIT_TIME |
23 | #define COMPAT_USE_64BIT_TIME 0 | |
24 | #endif | |
25 | ||
1da177e4 LT |
26 | #define compat_jiffies_to_clock_t(x) \ |
27 | (((unsigned long)(x) * COMPAT_USER_HZ) / HZ) | |
28 | ||
202e5979 SR |
29 | typedef __compat_uid32_t compat_uid_t; |
30 | typedef __compat_gid32_t compat_gid_t; | |
31 | ||
5d0e5283 | 32 | struct compat_sel_arg_struct; |
1da177e4 LT |
33 | struct rusage; |
34 | ||
4800a5bb | 35 | struct compat_itimerspec { |
1da177e4 LT |
36 | struct compat_timespec it_interval; |
37 | struct compat_timespec it_value; | |
38 | }; | |
39 | ||
40 | struct compat_utimbuf { | |
41 | compat_time_t actime; | |
42 | compat_time_t modtime; | |
43 | }; | |
44 | ||
45 | struct compat_itimerval { | |
46 | struct compat_timeval it_interval; | |
47 | struct compat_timeval it_value; | |
48 | }; | |
49 | ||
50 | struct compat_tms { | |
51 | compat_clock_t tms_utime; | |
52 | compat_clock_t tms_stime; | |
53 | compat_clock_t tms_cutime; | |
54 | compat_clock_t tms_cstime; | |
55 | }; | |
56 | ||
88959ea9 SR |
57 | struct compat_timex { |
58 | compat_uint_t modes; | |
59 | compat_long_t offset; | |
60 | compat_long_t freq; | |
61 | compat_long_t maxerror; | |
62 | compat_long_t esterror; | |
63 | compat_int_t status; | |
64 | compat_long_t constant; | |
65 | compat_long_t precision; | |
66 | compat_long_t tolerance; | |
67 | struct compat_timeval time; | |
68 | compat_long_t tick; | |
69 | compat_long_t ppsfreq; | |
70 | compat_long_t jitter; | |
71 | compat_int_t shift; | |
72 | compat_long_t stabil; | |
73 | compat_long_t jitcnt; | |
74 | compat_long_t calcnt; | |
75 | compat_long_t errcnt; | |
76 | compat_long_t stbcnt; | |
153b5d05 | 77 | compat_int_t tai; |
88959ea9 | 78 | |
4800a5bb CM |
79 | compat_int_t:32; compat_int_t:32; compat_int_t:32; compat_int_t:32; |
80 | compat_int_t:32; compat_int_t:32; compat_int_t:32; compat_int_t:32; | |
81 | compat_int_t:32; compat_int_t:32; compat_int_t:32; | |
88959ea9 SR |
82 | }; |
83 | ||
1da177e4 LT |
84 | #define _COMPAT_NSIG_WORDS (_COMPAT_NSIG / _COMPAT_NSIG_BPW) |
85 | ||
86 | typedef struct { | |
87 | compat_sigset_word sig[_COMPAT_NSIG_WORDS]; | |
88 | } compat_sigset_t; | |
89 | ||
4800a5bb CM |
90 | extern int get_compat_timespec(struct timespec *, |
91 | const struct compat_timespec __user *); | |
92 | extern int put_compat_timespec(const struct timespec *, | |
93 | struct compat_timespec __user *); | |
1da177e4 LT |
94 | |
95 | struct compat_iovec { | |
96 | compat_uptr_t iov_base; | |
97 | compat_size_t iov_len; | |
98 | }; | |
99 | ||
100 | struct compat_rlimit { | |
101 | compat_ulong_t rlim_cur; | |
102 | compat_ulong_t rlim_max; | |
103 | }; | |
104 | ||
105 | struct compat_rusage { | |
106 | struct compat_timeval ru_utime; | |
107 | struct compat_timeval ru_stime; | |
108 | compat_long_t ru_maxrss; | |
109 | compat_long_t ru_ixrss; | |
110 | compat_long_t ru_idrss; | |
111 | compat_long_t ru_isrss; | |
112 | compat_long_t ru_minflt; | |
113 | compat_long_t ru_majflt; | |
114 | compat_long_t ru_nswap; | |
115 | compat_long_t ru_inblock; | |
116 | compat_long_t ru_oublock; | |
117 | compat_long_t ru_msgsnd; | |
118 | compat_long_t ru_msgrcv; | |
119 | compat_long_t ru_nsignals; | |
120 | compat_long_t ru_nvcsw; | |
121 | compat_long_t ru_nivcsw; | |
122 | }; | |
123 | ||
4800a5bb CM |
124 | extern int put_compat_rusage(const struct rusage *, |
125 | struct compat_rusage __user *); | |
1da177e4 LT |
126 | |
127 | struct compat_siginfo; | |
128 | ||
129 | extern asmlinkage long compat_sys_waitid(int, compat_pid_t, | |
130 | struct compat_siginfo __user *, int, | |
131 | struct compat_rusage __user *); | |
132 | ||
133 | struct compat_dirent { | |
134 | u32 d_ino; | |
135 | compat_off_t d_off; | |
136 | u16 d_reclen; | |
137 | char d_name[256]; | |
138 | }; | |
139 | ||
2b1c6bd7 CH |
140 | struct compat_ustat { |
141 | compat_daddr_t f_tfree; | |
142 | compat_ino_t f_tinode; | |
143 | char f_fname[6]; | |
144 | char f_fpack[6]; | |
145 | }; | |
146 | ||
1da177e4 LT |
147 | typedef union compat_sigval { |
148 | compat_int_t sival_int; | |
149 | compat_uptr_t sival_ptr; | |
150 | } compat_sigval_t; | |
151 | ||
152 | #define COMPAT_SIGEV_PAD_SIZE ((SIGEV_MAX_SIZE/sizeof(int)) - 3) | |
153 | ||
154 | typedef struct compat_sigevent { | |
155 | compat_sigval_t sigev_value; | |
156 | compat_int_t sigev_signo; | |
157 | compat_int_t sigev_notify; | |
158 | union { | |
159 | compat_int_t _pad[COMPAT_SIGEV_PAD_SIZE]; | |
160 | compat_int_t _tid; | |
161 | ||
162 | struct { | |
163 | compat_uptr_t _function; | |
164 | compat_uptr_t _attribute; | |
165 | } _sigev_thread; | |
166 | } _sigev_un; | |
167 | } compat_sigevent_t; | |
168 | ||
2dceba14 AB |
169 | struct compat_ifmap { |
170 | compat_ulong_t mem_start; | |
171 | compat_ulong_t mem_end; | |
172 | unsigned short base_addr; | |
173 | unsigned char irq; | |
174 | unsigned char dma; | |
175 | unsigned char port; | |
176 | }; | |
177 | ||
4800a5bb | 178 | struct compat_if_settings { |
7a50a240 AB |
179 | unsigned int type; /* Type of physical device or protocol */ |
180 | unsigned int size; /* Size of the data allocated by the caller */ | |
181 | compat_uptr_t ifs_ifsu; /* union of pointers */ | |
182 | }; | |
183 | ||
2dceba14 | 184 | struct compat_ifreq { |
7a50a240 AB |
185 | union { |
186 | char ifrn_name[IFNAMSIZ]; /* if name, e.g. "en0" */ | |
187 | } ifr_ifrn; | |
188 | union { | |
189 | struct sockaddr ifru_addr; | |
190 | struct sockaddr ifru_dstaddr; | |
191 | struct sockaddr ifru_broadaddr; | |
192 | struct sockaddr ifru_netmask; | |
193 | struct sockaddr ifru_hwaddr; | |
194 | short ifru_flags; | |
195 | compat_int_t ifru_ivalue; | |
196 | compat_int_t ifru_mtu; | |
197 | struct compat_ifmap ifru_map; | |
198 | char ifru_slave[IFNAMSIZ]; /* Just fits the size */ | |
2dceba14 | 199 | char ifru_newname[IFNAMSIZ]; |
7a50a240 AB |
200 | compat_caddr_t ifru_data; |
201 | struct compat_if_settings ifru_settings; | |
202 | } ifr_ifru; | |
2dceba14 AB |
203 | }; |
204 | ||
205 | struct compat_ifconf { | |
4800a5bb CM |
206 | compat_int_t ifc_len; /* size of buffer */ |
207 | compat_caddr_t ifcbuf; | |
2dceba14 AB |
208 | }; |
209 | ||
34f192c6 IM |
210 | struct compat_robust_list { |
211 | compat_uptr_t next; | |
212 | }; | |
213 | ||
214 | struct compat_robust_list_head { | |
215 | struct compat_robust_list list; | |
216 | compat_long_t futex_offset; | |
217 | compat_uptr_t list_op_pending; | |
218 | }; | |
219 | ||
be84cb43 CM |
220 | struct compat_statfs; |
221 | struct compat_statfs64; | |
222 | struct compat_old_linux_dirent; | |
223 | struct compat_linux_dirent; | |
224 | struct linux_dirent64; | |
225 | struct compat_msghdr; | |
226 | struct compat_mmsghdr; | |
227 | struct compat_sysinfo; | |
228 | struct compat_sysctl_args; | |
229 | struct compat_kexec_segment; | |
230 | struct compat_mq_attr; | |
231 | ||
34f192c6 IM |
232 | extern void compat_exit_robust_list(struct task_struct *curr); |
233 | ||
234 | asmlinkage long | |
235 | compat_sys_set_robust_list(struct compat_robust_list_head __user *head, | |
236 | compat_size_t len); | |
237 | asmlinkage long | |
ba46df98 | 238 | compat_sys_get_robust_list(int pid, compat_uptr_t __user *head_ptr, |
34f192c6 | 239 | compat_size_t __user *len_ptr); |
1da177e4 LT |
240 | |
241 | long compat_sys_semctl(int first, int second, int third, void __user *uptr); | |
242 | long compat_sys_msgsnd(int first, int second, int third, void __user *uptr); | |
243 | long compat_sys_msgrcv(int first, int second, int msgtyp, int third, | |
244 | int version, void __user *uptr); | |
245 | long compat_sys_msgctl(int first, int second, void __user *uptr); | |
246 | long compat_sys_shmat(int first, int second, compat_uptr_t third, int version, | |
247 | void __user *uptr); | |
248 | long compat_sys_shmctl(int first, int second, void __user *uptr); | |
249 | long compat_sys_semtimedop(int semid, struct sembuf __user *tsems, | |
250 | unsigned nsems, const struct compat_timespec __user *timeout); | |
251 | asmlinkage long compat_sys_keyctl(u32 option, | |
252 | u32 arg2, u32 arg3, u32 arg4, u32 arg5); | |
2b1c6bd7 | 253 | asmlinkage long compat_sys_ustat(unsigned dev, struct compat_ustat __user *u32); |
1da177e4 LT |
254 | |
255 | asmlinkage ssize_t compat_sys_readv(unsigned long fd, | |
256 | const struct compat_iovec __user *vec, unsigned long vlen); | |
257 | asmlinkage ssize_t compat_sys_writev(unsigned long fd, | |
258 | const struct compat_iovec __user *vec, unsigned long vlen); | |
f3554f4b GH |
259 | asmlinkage ssize_t compat_sys_preadv(unsigned long fd, |
260 | const struct compat_iovec __user *vec, | |
601cc11d | 261 | unsigned long vlen, u32 pos_low, u32 pos_high); |
f3554f4b GH |
262 | asmlinkage ssize_t compat_sys_pwritev(unsigned long fd, |
263 | const struct compat_iovec __user *vec, | |
601cc11d | 264 | unsigned long vlen, u32 pos_low, u32 pos_high); |
1da177e4 | 265 | |
4800a5bb CM |
266 | int compat_do_execve(char *filename, compat_uptr_t __user *argv, |
267 | compat_uptr_t __user *envp, struct pt_regs *regs); | |
1da177e4 LT |
268 | |
269 | asmlinkage long compat_sys_select(int n, compat_ulong_t __user *inp, | |
270 | compat_ulong_t __user *outp, compat_ulong_t __user *exp, | |
271 | struct compat_timeval __user *tvp); | |
272 | ||
5d0e5283 CH |
273 | asmlinkage long compat_sys_old_select(struct compat_sel_arg_struct __user *arg); |
274 | ||
c202f298 | 275 | asmlinkage long compat_sys_wait4(compat_pid_t pid, |
7d61c459 AV |
276 | compat_uint_t __user *stat_addr, int options, |
277 | struct compat_rusage __user *ru); | |
c202f298 | 278 | |
1da177e4 LT |
279 | #define BITS_PER_COMPAT_LONG (8*sizeof(compat_long_t)) |
280 | ||
281 | #define BITS_TO_COMPAT_LONGS(bits) \ | |
282 | (((bits)+BITS_PER_COMPAT_LONG-1)/BITS_PER_COMPAT_LONG) | |
283 | ||
5fa3839a | 284 | long compat_get_bitmap(unsigned long *mask, const compat_ulong_t __user *umask, |
1da177e4 LT |
285 | unsigned long bitmap_size); |
286 | long compat_put_bitmap(compat_ulong_t __user *umask, unsigned long *mask, | |
287 | unsigned long bitmap_size); | |
288 | int copy_siginfo_from_user32(siginfo_t *to, struct compat_siginfo __user *from); | |
289 | int copy_siginfo_to_user32(struct compat_siginfo __user *to, siginfo_t *from); | |
290 | int get_compat_sigevent(struct sigevent *event, | |
291 | const struct compat_sigevent __user *u_event); | |
62ab4505 TG |
292 | long compat_sys_rt_tgsigqueueinfo(compat_pid_t tgid, compat_pid_t pid, int sig, |
293 | struct compat_siginfo __user *uinfo); | |
1da177e4 | 294 | |
643a6545 AM |
295 | static inline int compat_timeval_compare(struct compat_timeval *lhs, |
296 | struct compat_timeval *rhs) | |
297 | { | |
298 | if (lhs->tv_sec < rhs->tv_sec) | |
299 | return -1; | |
300 | if (lhs->tv_sec > rhs->tv_sec) | |
301 | return 1; | |
302 | return lhs->tv_usec - rhs->tv_usec; | |
303 | } | |
304 | ||
305 | static inline int compat_timespec_compare(struct compat_timespec *lhs, | |
306 | struct compat_timespec *rhs) | |
307 | { | |
308 | if (lhs->tv_sec < rhs->tv_sec) | |
309 | return -1; | |
310 | if (lhs->tv_sec > rhs->tv_sec) | |
311 | return 1; | |
312 | return lhs->tv_nsec - rhs->tv_nsec; | |
313 | } | |
314 | ||
83f5d126 DL |
315 | extern int get_compat_itimerspec(struct itimerspec *dst, |
316 | const struct compat_itimerspec __user *src); | |
317 | extern int put_compat_itimerspec(struct compat_itimerspec __user *dst, | |
318 | const struct itimerspec *src); | |
319 | ||
b418da16 CH |
320 | asmlinkage long compat_sys_gettimeofday(struct compat_timeval __user *tv, |
321 | struct timezone __user *tz); | |
322 | asmlinkage long compat_sys_settimeofday(struct compat_timeval __user *tv, | |
323 | struct timezone __user *tz); | |
324 | ||
3158e941 SR |
325 | asmlinkage long compat_sys_adjtimex(struct compat_timex __user *utp); |
326 | ||
bebfa101 | 327 | extern int compat_printk(const char *fmt, ...); |
0235497f | 328 | extern void sigset_from_compat(sigset_t *set, compat_sigset_t *compat); |
bebfa101 | 329 | |
3fd59397 SR |
330 | asmlinkage long compat_sys_migrate_pages(compat_pid_t pid, |
331 | compat_ulong_t maxnode, const compat_ulong_t __user *old_nodes, | |
332 | const compat_ulong_t __user *new_nodes); | |
333 | ||
032d82d9 RM |
334 | extern int compat_ptrace_request(struct task_struct *child, |
335 | compat_long_t request, | |
336 | compat_ulong_t addr, compat_ulong_t data); | |
337 | ||
c269f196 RM |
338 | extern long compat_arch_ptrace(struct task_struct *child, compat_long_t request, |
339 | compat_ulong_t addr, compat_ulong_t data); | |
340 | asmlinkage long compat_sys_ptrace(compat_long_t request, compat_long_t pid, | |
341 | compat_long_t addr, compat_long_t data); | |
c269f196 | 342 | |
f6dfb4fd DL |
343 | /* |
344 | * epoll (fs/eventpoll.c) compat bits follow ... | |
345 | */ | |
f6dfb4fd DL |
346 | struct epoll_event; |
347 | #define compat_epoll_event epoll_event | |
f6dfb4fd DL |
348 | asmlinkage long compat_sys_epoll_pwait(int epfd, |
349 | struct compat_epoll_event __user *events, | |
350 | int maxevents, int timeout, | |
351 | const compat_sigset_t __user *sigmask, | |
352 | compat_size_t sigsetsize); | |
353 | ||
be84cb43 CM |
354 | asmlinkage long compat_sys_utime(const char __user *filename, |
355 | struct compat_utimbuf __user *t); | |
4800a5bb CM |
356 | asmlinkage long compat_sys_utimensat(unsigned int dfd, |
357 | const char __user *filename, | |
358 | struct compat_timespec __user *t, | |
359 | int flags); | |
97416ce8 | 360 | |
be84cb43 CM |
361 | asmlinkage long compat_sys_time(compat_time_t __user *tloc); |
362 | asmlinkage long compat_sys_stime(compat_time_t __user *tptr); | |
140ff8b0 | 363 | asmlinkage long compat_sys_signalfd(int ufd, |
4800a5bb CM |
364 | const compat_sigset_t __user *sigmask, |
365 | compat_size_t sigsetsize); | |
4d672e7a DL |
366 | asmlinkage long compat_sys_timerfd_settime(int ufd, int flags, |
367 | const struct compat_itimerspec __user *utmr, | |
368 | struct compat_itimerspec __user *otmr); | |
369 | asmlinkage long compat_sys_timerfd_gettime(int ufd, | |
370 | struct compat_itimerspec __user *otmr); | |
140ff8b0 | 371 | |
4c696ba7 HC |
372 | asmlinkage long compat_sys_move_pages(pid_t pid, unsigned long nr_page, |
373 | __u32 __user *pages, | |
374 | const int __user *nodes, | |
375 | int __user *status, | |
376 | int flags); | |
4800a5bb CM |
377 | asmlinkage long compat_sys_futimesat(unsigned int dfd, |
378 | const char __user *filename, | |
4c696ba7 | 379 | struct compat_timeval __user *t); |
be84cb43 CM |
380 | asmlinkage long compat_sys_utimes(const char __user *filename, |
381 | struct compat_timeval __user *t); | |
4800a5bb | 382 | asmlinkage long compat_sys_newstat(const char __user *filename, |
be84cb43 | 383 | struct compat_stat __user *statbuf); |
4800a5bb | 384 | asmlinkage long compat_sys_newlstat(const char __user *filename, |
be84cb43 | 385 | struct compat_stat __user *statbuf); |
4800a5bb CM |
386 | asmlinkage long compat_sys_newfstatat(unsigned int dfd, |
387 | const char __user *filename, | |
4c696ba7 HC |
388 | struct compat_stat __user *statbuf, |
389 | int flag); | |
be84cb43 | 390 | asmlinkage long compat_sys_newfstat(unsigned int fd, |
4800a5bb | 391 | struct compat_stat __user *statbuf); |
be84cb43 CM |
392 | asmlinkage long compat_sys_statfs(const char __user *pathname, |
393 | struct compat_statfs __user *buf); | |
394 | asmlinkage long compat_sys_fstatfs(unsigned int fd, | |
395 | struct compat_statfs __user *buf); | |
396 | asmlinkage long compat_sys_statfs64(const char __user *pathname, | |
397 | compat_size_t sz, | |
398 | struct compat_statfs64 __user *buf); | |
399 | asmlinkage long compat_sys_fstatfs64(unsigned int fd, compat_size_t sz, | |
400 | struct compat_statfs64 __user *buf); | |
401 | asmlinkage long compat_sys_fcntl64(unsigned int fd, unsigned int cmd, | |
402 | unsigned long arg); | |
403 | asmlinkage long compat_sys_fcntl(unsigned int fd, unsigned int cmd, | |
404 | unsigned long arg); | |
405 | asmlinkage long compat_sys_io_setup(unsigned nr_reqs, u32 __user *ctx32p); | |
406 | asmlinkage long compat_sys_io_getevents(aio_context_t ctx_id, | |
407 | unsigned long min_nr, | |
408 | unsigned long nr, | |
409 | struct io_event __user *events, | |
410 | struct compat_timespec __user *timeout); | |
411 | asmlinkage long compat_sys_io_submit(aio_context_t ctx_id, int nr, | |
412 | u32 __user *iocb); | |
4800a5bb CM |
413 | asmlinkage long compat_sys_mount(const char __user *dev_name, |
414 | const char __user *dir_name, | |
415 | const char __user *type, unsigned long flags, | |
416 | const void __user *data); | |
be84cb43 CM |
417 | asmlinkage long compat_sys_old_readdir(unsigned int fd, |
418 | struct compat_old_linux_dirent __user *, | |
419 | unsigned int count); | |
420 | asmlinkage long compat_sys_getdents(unsigned int fd, | |
421 | struct compat_linux_dirent __user *dirent, | |
422 | unsigned int count); | |
423 | asmlinkage long compat_sys_getdents64(unsigned int fd, | |
4800a5bb | 424 | struct linux_dirent64 __user *dirent, |
be84cb43 CM |
425 | unsigned int count); |
426 | asmlinkage long compat_sys_vmsplice(int fd, const struct compat_iovec __user *, | |
427 | unsigned int nr_segs, unsigned int flags); | |
428 | asmlinkage long compat_sys_open(const char __user *filename, int flags, | |
a218d0fd | 429 | umode_t mode); |
4c696ba7 | 430 | asmlinkage long compat_sys_openat(unsigned int dfd, const char __user *filename, |
a218d0fd | 431 | int flags, umode_t mode); |
be84cb43 CM |
432 | asmlinkage long compat_sys_open_by_handle_at(int mountdirfd, |
433 | struct file_handle __user *handle, | |
434 | int flags); | |
435 | asmlinkage long compat_sys_pselect6(int n, compat_ulong_t __user *inp, | |
436 | compat_ulong_t __user *outp, | |
437 | compat_ulong_t __user *exp, | |
438 | struct compat_timespec __user *tsp, | |
439 | void __user *sig); | |
440 | asmlinkage long compat_sys_ppoll(struct pollfd __user *ufds, | |
441 | unsigned int nfds, | |
442 | struct compat_timespec __user *tsp, | |
443 | const compat_sigset_t __user *sigmask, | |
444 | compat_size_t sigsetsize); | |
be84cb43 CM |
445 | asmlinkage long compat_sys_signalfd4(int ufd, |
446 | const compat_sigset_t __user *sigmask, | |
447 | compat_size_t sigsetsize, int flags); | |
448 | asmlinkage long compat_sys_get_mempolicy(int __user *policy, | |
449 | compat_ulong_t __user *nmask, | |
450 | compat_ulong_t maxnode, | |
451 | compat_ulong_t addr, | |
452 | compat_ulong_t flags); | |
453 | asmlinkage long compat_sys_set_mempolicy(int mode, compat_ulong_t __user *nmask, | |
454 | compat_ulong_t maxnode); | |
455 | asmlinkage long compat_sys_mbind(compat_ulong_t start, compat_ulong_t len, | |
456 | compat_ulong_t mode, | |
457 | compat_ulong_t __user *nmask, | |
458 | compat_ulong_t maxnode, compat_ulong_t flags); | |
459 | ||
460 | asmlinkage long compat_sys_setsockopt(int fd, int level, int optname, | |
461 | char __user *optval, unsigned int optlen); | |
462 | asmlinkage long compat_sys_sendmsg(int fd, struct compat_msghdr __user *msg, | |
463 | unsigned flags); | |
507c5f12 CM |
464 | asmlinkage long compat_sys_sendmmsg(int fd, struct compat_mmsghdr __user *mmsg, |
465 | unsigned vlen, unsigned int flags); | |
be84cb43 CM |
466 | asmlinkage long compat_sys_recvmsg(int fd, struct compat_msghdr __user *msg, |
467 | unsigned int flags); | |
468 | asmlinkage long compat_sys_recv(int fd, void __user *buf, size_t len, | |
469 | unsigned flags); | |
470 | asmlinkage long compat_sys_recvfrom(int fd, void __user *buf, size_t len, | |
471 | unsigned flags, struct sockaddr __user *addr, | |
472 | int __user *addrlen); | |
473 | asmlinkage long compat_sys_recvmmsg(int fd, struct compat_mmsghdr __user *mmsg, | |
474 | unsigned vlen, unsigned int flags, | |
475 | struct compat_timespec __user *timeout); | |
476 | asmlinkage long compat_sys_nanosleep(struct compat_timespec __user *rqtp, | |
477 | struct compat_timespec __user *rmtp); | |
478 | asmlinkage long compat_sys_getitimer(int which, | |
479 | struct compat_itimerval __user *it); | |
480 | asmlinkage long compat_sys_setitimer(int which, | |
481 | struct compat_itimerval __user *in, | |
482 | struct compat_itimerval __user *out); | |
483 | asmlinkage long compat_sys_times(struct compat_tms __user *tbuf); | |
484 | asmlinkage long compat_sys_setrlimit(unsigned int resource, | |
485 | struct compat_rlimit __user *rlim); | |
4800a5bb CM |
486 | asmlinkage long compat_sys_getrlimit(unsigned int resource, |
487 | struct compat_rlimit __user *rlim); | |
be84cb43 CM |
488 | asmlinkage long compat_sys_getrusage(int who, struct compat_rusage __user *ru); |
489 | asmlinkage long compat_sys_sched_setaffinity(compat_pid_t pid, | |
490 | unsigned int len, | |
491 | compat_ulong_t __user *user_mask_ptr); | |
492 | asmlinkage long compat_sys_sched_getaffinity(compat_pid_t pid, | |
493 | unsigned int len, | |
494 | compat_ulong_t __user *user_mask_ptr); | |
495 | asmlinkage long compat_sys_timer_create(clockid_t which_clock, | |
496 | struct compat_sigevent __user *timer_event_spec, | |
497 | timer_t __user *created_timer_id); | |
498 | asmlinkage long compat_sys_timer_settime(timer_t timer_id, int flags, | |
499 | struct compat_itimerspec __user *new, | |
500 | struct compat_itimerspec __user *old); | |
501 | asmlinkage long compat_sys_timer_gettime(timer_t timer_id, | |
502 | struct compat_itimerspec __user *setting); | |
503 | asmlinkage long compat_sys_clock_settime(clockid_t which_clock, | |
504 | struct compat_timespec __user *tp); | |
505 | asmlinkage long compat_sys_clock_gettime(clockid_t which_clock, | |
506 | struct compat_timespec __user *tp); | |
507 | asmlinkage long compat_sys_clock_adjtime(clockid_t which_clock, | |
508 | struct compat_timex __user *tp); | |
509 | asmlinkage long compat_sys_clock_getres(clockid_t which_clock, | |
510 | struct compat_timespec __user *tp); | |
511 | asmlinkage long compat_sys_clock_nanosleep(clockid_t which_clock, int flags, | |
512 | struct compat_timespec __user *rqtp, | |
513 | struct compat_timespec __user *rmtp); | |
4800a5bb | 514 | asmlinkage long compat_sys_rt_sigtimedwait(compat_sigset_t __user *uthese, |
be84cb43 CM |
515 | struct compat_siginfo __user *uinfo, |
516 | struct compat_timespec __user *uts, compat_size_t sigsetsize); | |
517 | asmlinkage long compat_sys_rt_sigsuspend(compat_sigset_t __user *unewset, | |
518 | compat_size_t sigsetsize); | |
519 | asmlinkage long compat_sys_sysinfo(struct compat_sysinfo __user *info); | |
520 | asmlinkage long compat_sys_ioctl(unsigned int fd, unsigned int cmd, | |
521 | unsigned long arg); | |
522 | asmlinkage long compat_sys_futex(u32 __user *uaddr, int op, u32 val, | |
523 | struct compat_timespec __user *utime, u32 __user *uaddr2, | |
524 | u32 val3); | |
525 | asmlinkage long compat_sys_getsockopt(int fd, int level, int optname, | |
526 | char __user *optval, int __user *optlen); | |
527 | asmlinkage long compat_sys_kexec_load(unsigned long entry, | |
528 | unsigned long nr_segments, | |
529 | struct compat_kexec_segment __user *, | |
530 | unsigned long flags); | |
531 | asmlinkage long compat_sys_mq_getsetattr(mqd_t mqdes, | |
532 | const struct compat_mq_attr __user *u_mqstat, | |
533 | struct compat_mq_attr __user *u_omqstat); | |
534 | asmlinkage long compat_sys_mq_notify(mqd_t mqdes, | |
535 | const struct compat_sigevent __user *u_notification); | |
536 | asmlinkage long compat_sys_mq_open(const char __user *u_name, | |
537 | int oflag, compat_mode_t mode, | |
538 | struct compat_mq_attr __user *u_attr); | |
539 | asmlinkage long compat_sys_mq_timedsend(mqd_t mqdes, | |
540 | const char __user *u_msg_ptr, | |
541 | size_t msg_len, unsigned int msg_prio, | |
542 | const struct compat_timespec __user *u_abs_timeout); | |
543 | asmlinkage ssize_t compat_sys_mq_timedreceive(mqd_t mqdes, | |
544 | char __user *u_msg_ptr, | |
545 | size_t msg_len, unsigned int __user *u_msg_prio, | |
546 | const struct compat_timespec __user *u_abs_timeout); | |
547 | asmlinkage long compat_sys_socketcall(int call, u32 __user *args); | |
548 | asmlinkage long compat_sys_sysctl(struct compat_sysctl_args __user *args); | |
4c696ba7 | 549 | |
b8373363 | 550 | extern ssize_t compat_rw_copy_check_uvector(int type, |
4800a5bb CM |
551 | const struct compat_iovec __user *uvector, |
552 | unsigned long nr_segs, | |
b8373363 | 553 | unsigned long fast_segs, struct iovec *fast_pointer, |
fcf63409 CY |
554 | struct iovec **ret_pointer, |
555 | int check_access); | |
c41d68a5 PA |
556 | |
557 | extern void __user *compat_alloc_user_space(unsigned long len); | |
558 | ||
a67ba43d CM |
559 | asmlinkage ssize_t compat_sys_process_vm_readv(compat_pid_t pid, |
560 | const struct compat_iovec __user *lvec, | |
561 | unsigned long liovcnt, const struct compat_iovec __user *rvec, | |
562 | unsigned long riovcnt, unsigned long flags); | |
563 | asmlinkage ssize_t compat_sys_process_vm_writev(compat_pid_t pid, | |
564 | const struct compat_iovec __user *lvec, | |
565 | unsigned long liovcnt, const struct compat_iovec __user *rvec, | |
566 | unsigned long riovcnt, unsigned long flags); | |
567 | ||
1da177e4 LT |
568 | #endif /* CONFIG_COMPAT */ |
569 | #endif /* _LINUX_COMPAT_H */ |