Commit e4da0d68 authored by Arnd Bergmann's avatar Arnd Bergmann

sparc: compat: Allow including asm/compat.h for 32-bit

We have several files on sparc that include linux/compat.h and expect
asm/compat.h not to be included for 32-bit builds, otherwise we get a
build failure.

Since we need to include asm/compat.h for compat time_t handling on all
32-bit architectures now, this hides some portions of asm/compat.h in
order to let the rest of the file get included.
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
parent 2b5a9a37
...@@ -168,6 +168,7 @@ static inline compat_uptr_t ptr_to_compat(void __user *uptr) ...@@ -168,6 +168,7 @@ static inline compat_uptr_t ptr_to_compat(void __user *uptr)
return (u32)(unsigned long)uptr; return (u32)(unsigned long)uptr;
} }
#ifdef CONFIG_COMPAT
static inline void __user *arch_compat_alloc_user_space(long len) static inline void __user *arch_compat_alloc_user_space(long len)
{ {
struct pt_regs *regs = current_thread_info()->kregs; struct pt_regs *regs = current_thread_info()->kregs;
...@@ -184,6 +185,7 @@ static inline void __user *arch_compat_alloc_user_space(long len) ...@@ -184,6 +185,7 @@ static inline void __user *arch_compat_alloc_user_space(long len)
return (void __user *) usp; return (void __user *) usp;
} }
#endif
struct compat_ipc64_perm { struct compat_ipc64_perm {
compat_key_t key; compat_key_t key;
...@@ -243,6 +245,7 @@ struct compat_shmid64_ds { ...@@ -243,6 +245,7 @@ struct compat_shmid64_ds {
unsigned int __unused2; unsigned int __unused2;
}; };
#ifdef CONFIG_COMPAT
static inline int is_compat_task(void) static inline int is_compat_task(void)
{ {
return test_thread_flag(TIF_32BIT); return test_thread_flag(TIF_32BIT);
...@@ -254,5 +257,6 @@ static inline bool in_compat_syscall(void) ...@@ -254,5 +257,6 @@ static inline bool in_compat_syscall(void)
return pt_regs_trap_type(current_pt_regs()) == 0x110; return pt_regs_trap_type(current_pt_regs()) == 0x110;
} }
#define in_compat_syscall in_compat_syscall #define in_compat_syscall in_compat_syscall
#endif
#endif /* _ASM_SPARC64_COMPAT_H */ #endif /* _ASM_SPARC64_COMPAT_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment