diff options
Diffstat (limited to 'include/linux/compat.h')
-rw-r--r-- | include/linux/compat.h | 51 |
1 files changed, 15 insertions, 36 deletions
diff --git a/include/linux/compat.h b/include/linux/compat.h index 377cd8c3395e..d53c35352ea9 100644 --- a/include/linux/compat.h +++ b/include/linux/compat.h | |||
@@ -27,12 +27,6 @@ | |||
27 | #define __SC_DELOUSE(t,v) ((t)(unsigned long)(v)) | 27 | #define __SC_DELOUSE(t,v) ((t)(unsigned long)(v)) |
28 | #endif | 28 | #endif |
29 | 29 | ||
30 | #define __SC_CCAST1(t1, a1) __SC_DELOUSE(t1,a1) | ||
31 | #define __SC_CCAST2(t2, a2, ...) __SC_DELOUSE(t2,a2), __SC_CCAST1(__VA_ARGS__) | ||
32 | #define __SC_CCAST3(t3, a3, ...) __SC_DELOUSE(t3,a3), __SC_CCAST2(__VA_ARGS__) | ||
33 | #define __SC_CCAST4(t4, a4, ...) __SC_DELOUSE(t4,a4), __SC_CCAST3(__VA_ARGS__) | ||
34 | #define __SC_CCAST5(t5, a5, ...) __SC_DELOUSE(t5,a5), __SC_CCAST4(__VA_ARGS__) | ||
35 | #define __SC_CCAST6(t6, a6, ...) __SC_DELOUSE(t6,a6), __SC_CCAST5(__VA_ARGS__) | ||
36 | #define COMPAT_SYSCALL_DEFINE1(name, ...) \ | 30 | #define COMPAT_SYSCALL_DEFINE1(name, ...) \ |
37 | COMPAT_SYSCALL_DEFINEx(1, _##name, __VA_ARGS__) | 31 | COMPAT_SYSCALL_DEFINEx(1, _##name, __VA_ARGS__) |
38 | #define COMPAT_SYSCALL_DEFINE2(name, ...) \ | 32 | #define COMPAT_SYSCALL_DEFINE2(name, ...) \ |
@@ -46,24 +40,15 @@ | |||
46 | #define COMPAT_SYSCALL_DEFINE6(name, ...) \ | 40 | #define COMPAT_SYSCALL_DEFINE6(name, ...) \ |
47 | COMPAT_SYSCALL_DEFINEx(6, _##name, __VA_ARGS__) | 41 | COMPAT_SYSCALL_DEFINEx(6, _##name, __VA_ARGS__) |
48 | 42 | ||
49 | #ifdef CONFIG_HAVE_SYSCALL_WRAPPERS | ||
50 | |||
51 | #define COMPAT_SYSCALL_DEFINEx(x, name, ...) \ | 43 | #define COMPAT_SYSCALL_DEFINEx(x, name, ...) \ |
52 | asmlinkage long compat_sys##name(__SC_DECL##x(__VA_ARGS__)); \ | 44 | asmlinkage long compat_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__));\ |
53 | static inline long C_SYSC##name(__SC_DECL##x(__VA_ARGS__)); \ | 45 | static inline long C_SYSC##name(__MAP(x,__SC_DECL,__VA_ARGS__));\ |
54 | asmlinkage long compat_SyS##name(__SC_LONG##x(__VA_ARGS__)) \ | 46 | asmlinkage long compat_SyS##name(__MAP(x,__SC_LONG,__VA_ARGS__))\ |
55 | { \ | 47 | { \ |
56 | return (long) C_SYSC##name(__SC_CCAST##x(__VA_ARGS__)); \ | 48 | return C_SYSC##name(__MAP(x,__SC_DELOUSE,__VA_ARGS__)); \ |
57 | } \ | 49 | } \ |
58 | SYSCALL_ALIAS(compat_sys##name, compat_SyS##name); \ | 50 | SYSCALL_ALIAS(compat_sys##name, compat_SyS##name); \ |
59 | static inline long C_SYSC##name(__SC_DECL##x(__VA_ARGS__)) | 51 | static inline long C_SYSC##name(__MAP(x,__SC_DECL,__VA_ARGS__)) |
60 | |||
61 | #else /* CONFIG_HAVE_SYSCALL_WRAPPERS */ | ||
62 | |||
63 | #define COMPAT_SYSCALL_DEFINEx(x, name, ...) \ | ||
64 | asmlinkage long compat_sys##name(__SC_DECL##x(__VA_ARGS__)) | ||
65 | |||
66 | #endif /* CONFIG_HAVE_SYSCALL_WRAPPERS */ | ||
67 | 52 | ||
68 | #ifndef compat_user_stack_pointer | 53 | #ifndef compat_user_stack_pointer |
69 | #define compat_user_stack_pointer() current_user_stack_pointer() | 54 | #define compat_user_stack_pointer() current_user_stack_pointer() |
@@ -326,21 +311,13 @@ asmlinkage long | |||
326 | compat_sys_get_robust_list(int pid, compat_uptr_t __user *head_ptr, | 311 | compat_sys_get_robust_list(int pid, compat_uptr_t __user *head_ptr, |
327 | compat_size_t __user *len_ptr); | 312 | compat_size_t __user *len_ptr); |
328 | 313 | ||
329 | #ifdef CONFIG_ARCH_WANT_OLD_COMPAT_IPC | 314 | asmlinkage long compat_sys_ipc(u32, int, int, u32, compat_uptr_t, u32); |
330 | long compat_sys_semctl(int first, int second, int third, void __user *uptr); | 315 | asmlinkage long compat_sys_shmat(int shmid, compat_uptr_t shmaddr, int shmflg); |
331 | long compat_sys_msgsnd(int first, int second, int third, void __user *uptr); | 316 | asmlinkage long compat_sys_semctl(int semid, int semnum, int cmd, int arg); |
332 | long compat_sys_msgrcv(int first, int second, int msgtyp, int third, | 317 | asmlinkage long compat_sys_msgsnd(int msqid, compat_uptr_t msgp, |
333 | int version, void __user *uptr); | ||
334 | long compat_sys_shmat(int first, int second, compat_uptr_t third, int version, | ||
335 | void __user *uptr); | ||
336 | #else | ||
337 | long compat_sys_semctl(int semid, int semnum, int cmd, int arg); | ||
338 | long compat_sys_msgsnd(int msqid, struct compat_msgbuf __user *msgp, | ||
339 | compat_ssize_t msgsz, int msgflg); | 318 | compat_ssize_t msgsz, int msgflg); |
340 | long compat_sys_msgrcv(int msqid, struct compat_msgbuf __user *msgp, | 319 | asmlinkage long compat_sys_msgrcv(int msqid, compat_uptr_t msgp, |
341 | compat_ssize_t msgsz, long msgtyp, int msgflg); | 320 | compat_ssize_t msgsz, long msgtyp, int msgflg); |
342 | long compat_sys_shmat(int shmid, compat_uptr_t shmaddr, int shmflg); | ||
343 | #endif | ||
344 | long compat_sys_msgctl(int first, int second, void __user *uptr); | 321 | long compat_sys_msgctl(int first, int second, void __user *uptr); |
345 | long compat_sys_shmctl(int first, int second, void __user *uptr); | 322 | long compat_sys_shmctl(int first, int second, void __user *uptr); |
346 | long compat_sys_semtimedop(int semid, struct sembuf __user *tsems, | 323 | long compat_sys_semtimedop(int semid, struct sembuf __user *tsems, |
@@ -444,13 +421,13 @@ extern long compat_arch_ptrace(struct task_struct *child, compat_long_t request, | |||
444 | asmlinkage long compat_sys_ptrace(compat_long_t request, compat_long_t pid, | 421 | asmlinkage long compat_sys_ptrace(compat_long_t request, compat_long_t pid, |
445 | compat_long_t addr, compat_long_t data); | 422 | compat_long_t addr, compat_long_t data); |
446 | 423 | ||
424 | asmlinkage long compat_sys_lookup_dcookie(u32, u32, char __user *, size_t); | ||
447 | /* | 425 | /* |
448 | * epoll (fs/eventpoll.c) compat bits follow ... | 426 | * epoll (fs/eventpoll.c) compat bits follow ... |
449 | */ | 427 | */ |
450 | struct epoll_event; | 428 | struct epoll_event; /* fortunately, this one is fixed-layout */ |
451 | #define compat_epoll_event epoll_event | ||
452 | asmlinkage long compat_sys_epoll_pwait(int epfd, | 429 | asmlinkage long compat_sys_epoll_pwait(int epfd, |
453 | struct compat_epoll_event __user *events, | 430 | struct epoll_event __user *events, |
454 | int maxevents, int timeout, | 431 | int maxevents, int timeout, |
455 | const compat_sigset_t __user *sigmask, | 432 | const compat_sigset_t __user *sigmask, |
456 | compat_size_t sigsetsize); | 433 | compat_size_t sigsetsize); |
@@ -685,6 +662,8 @@ asmlinkage ssize_t compat_sys_process_vm_writev(compat_pid_t pid, | |||
685 | 662 | ||
686 | asmlinkage long compat_sys_sendfile(int out_fd, int in_fd, | 663 | asmlinkage long compat_sys_sendfile(int out_fd, int in_fd, |
687 | compat_off_t __user *offset, compat_size_t count); | 664 | compat_off_t __user *offset, compat_size_t count); |
665 | asmlinkage long compat_sys_sendfile64(int out_fd, int in_fd, | ||
666 | compat_loff_t __user *offset, compat_size_t count); | ||
688 | asmlinkage long compat_sys_sigaltstack(const compat_stack_t __user *uss_ptr, | 667 | asmlinkage long compat_sys_sigaltstack(const compat_stack_t __user *uss_ptr, |
689 | compat_stack_t __user *uoss_ptr); | 668 | compat_stack_t __user *uoss_ptr); |
690 | 669 | ||