|
20 | 20 | #include <linux/unistd.h> |
21 | 21 |
|
22 | 22 | #include <asm/compat.h> |
23 | | - |
24 | | -#ifdef CONFIG_COMPAT |
25 | 23 | #include <asm/siginfo.h> |
26 | 24 | #include <asm/signal.h> |
27 | | -#endif |
28 | 25 |
|
29 | 26 | #ifdef CONFIG_ARCH_HAS_SYSCALL_WRAPPER |
30 | 27 | /* |
@@ -95,8 +92,6 @@ struct compat_iovec { |
95 | 92 | compat_size_t iov_len; |
96 | 93 | }; |
97 | 94 |
|
98 | | -#ifdef CONFIG_COMPAT |
99 | | - |
100 | 95 | #ifndef compat_user_stack_pointer |
101 | 96 | #define compat_user_stack_pointer() current_user_stack_pointer() |
102 | 97 | #endif |
@@ -131,9 +126,11 @@ struct compat_tms { |
131 | 126 |
|
132 | 127 | #define _COMPAT_NSIG_WORDS (_COMPAT_NSIG / _COMPAT_NSIG_BPW) |
133 | 128 |
|
| 129 | +#ifndef compat_sigset_t |
134 | 130 | typedef struct { |
135 | 131 | compat_sigset_word sig[_COMPAT_NSIG_WORDS]; |
136 | 132 | } compat_sigset_t; |
| 133 | +#endif |
137 | 134 |
|
138 | 135 | int set_compat_user_sigmask(const compat_sigset_t __user *umask, |
139 | 136 | size_t sigsetsize); |
@@ -384,6 +381,7 @@ struct compat_keyctl_kdf_params { |
384 | 381 | __u32 __spare[8]; |
385 | 382 | }; |
386 | 383 |
|
| 384 | +struct compat_stat; |
387 | 385 | struct compat_statfs; |
388 | 386 | struct compat_statfs64; |
389 | 387 | struct compat_old_linux_dirent; |
@@ -428,7 +426,7 @@ put_compat_sigset(compat_sigset_t __user *compat, const sigset_t *set, |
428 | 426 | unsigned int size) |
429 | 427 | { |
430 | 428 | /* size <= sizeof(compat_sigset_t) <= sizeof(sigset_t) */ |
431 | | -#ifdef __BIG_ENDIAN |
| 429 | +#if defined(__BIG_ENDIAN) && defined(CONFIG_64BIT) |
432 | 430 | compat_sigset_t v; |
433 | 431 | switch (_NSIG_WORDS) { |
434 | 432 | case 4: v.sig[7] = (set->sig[3] >> 32); v.sig[6] = set->sig[3]; |
@@ -929,17 +927,6 @@ asmlinkage long compat_sys_socketcall(int call, u32 __user *args); |
929 | 927 |
|
930 | 928 | #endif /* CONFIG_ARCH_HAS_SYSCALL_WRAPPER */ |
931 | 929 |
|
932 | | - |
933 | | -/* |
934 | | - * For most but not all architectures, "am I in a compat syscall?" and |
935 | | - * "am I a compat task?" are the same question. For architectures on which |
936 | | - * they aren't the same question, arch code can override in_compat_syscall. |
937 | | - */ |
938 | | - |
939 | | -#ifndef in_compat_syscall |
940 | | -static inline bool in_compat_syscall(void) { return is_compat_task(); } |
941 | | -#endif |
942 | | - |
943 | 930 | /** |
944 | 931 | * ns_to_old_timeval32 - Compat version of ns_to_timeval |
945 | 932 | * @nsec: the nanoseconds value to be converted |
@@ -969,6 +956,17 @@ int kcompat_sys_statfs64(const char __user * pathname, compat_size_t sz, |
969 | 956 | int kcompat_sys_fstatfs64(unsigned int fd, compat_size_t sz, |
970 | 957 | struct compat_statfs64 __user * buf); |
971 | 958 |
|
| 959 | +#ifdef CONFIG_COMPAT |
| 960 | + |
| 961 | +/* |
| 962 | + * For most but not all architectures, "am I in a compat syscall?" and |
| 963 | + * "am I a compat task?" are the same question. For architectures on which |
| 964 | + * they aren't the same question, arch code can override in_compat_syscall. |
| 965 | + */ |
| 966 | +#ifndef in_compat_syscall |
| 967 | +static inline bool in_compat_syscall(void) { return is_compat_task(); } |
| 968 | +#endif |
| 969 | + |
972 | 970 | #else /* !CONFIG_COMPAT */ |
973 | 971 |
|
974 | 972 | #define is_compat_task() (0) |
|
0 commit comments