aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDeepa Dinamani <deepa.kernel@gmail.com>2018-03-14 00:03:24 -0400
committerArnd Bergmann <arnd@arndb.de>2018-04-19 07:28:04 -0400
commit5055c67760df8e13c68f73b8534d5792d1d36543 (patch)
tree65b0670c18b7e257a481d659e97ebecaea6c5f30
parent60cc43fc888428bb2f18f08997432d426a243338 (diff)
compat: Make compat helpers independent of CONFIG_COMPAT
Many of the compat time syscalls are also repurposed as 32 bit native syscalls to provide backward compatibility while adding new y2038 safe sycalls. Enabling the helpers makes this possible. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Deepa Dinamani <deepa.kernel@gmail.com> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
-rw-r--r--include/linux/compat.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/include/linux/compat.h b/include/linux/compat.h
index 081281ad5772..3f35f4cfb98d 100644
--- a/include/linux/compat.h
+++ b/include/linux/compat.h
@@ -8,8 +8,6 @@
8 8
9#include <linux/types.h> 9#include <linux/types.h>
10 10
11#ifdef CONFIG_COMPAT
12
13#include <linux/stat.h> 11#include <linux/stat.h>
14#include <linux/param.h> /* for HZ */ 12#include <linux/param.h> /* for HZ */
15#include <linux/sem.h> 13#include <linux/sem.h>
@@ -20,9 +18,11 @@
20#include <linux/uaccess.h> 18#include <linux/uaccess.h>
21#include <linux/unistd.h> 19#include <linux/unistd.h>
22 20
21#ifdef CONFIG_COMPAT
23#include <asm/compat.h> 22#include <asm/compat.h>
24#include <asm/siginfo.h> 23#include <asm/siginfo.h>
25#include <asm/signal.h> 24#include <asm/signal.h>
25#endif
26 26
27#ifdef CONFIG_ARCH_HAS_SYSCALL_WRAPPER 27#ifdef CONFIG_ARCH_HAS_SYSCALL_WRAPPER
28/* 28/*
@@ -83,6 +83,8 @@
83 static inline long __do_compat_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__)) 83 static inline long __do_compat_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__))
84#endif /* COMPAT_SYSCALL_DEFINEx */ 84#endif /* COMPAT_SYSCALL_DEFINEx */
85 85
86#ifdef CONFIG_COMPAT
87
86#ifndef compat_user_stack_pointer 88#ifndef compat_user_stack_pointer
87#define compat_user_stack_pointer() current_user_stack_pointer() 89#define compat_user_stack_pointer() current_user_stack_pointer()
88#endif 90#endif
@@ -1016,7 +1018,9 @@ static inline struct compat_timeval ns_to_compat_timeval(s64 nsec)
1016#else /* !CONFIG_COMPAT */ 1018#else /* !CONFIG_COMPAT */
1017 1019
1018#define is_compat_task() (0) 1020#define is_compat_task() (0)
1021#ifndef in_compat_syscall
1019static inline bool in_compat_syscall(void) { return false; } 1022static inline bool in_compat_syscall(void) { return false; }
1023#endif
1020 1024
1021#endif /* CONFIG_COMPAT */ 1025#endif /* CONFIG_COMPAT */
1022 1026