Skip to content

Commit

Permalink
compat: Make compat helpers independent of CONFIG_COMPAT
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
deepa-hub authored and arndb committed Apr 19, 2018
1 parent 60cc43f commit 5055c67
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions include/linux/compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@

#include <linux/types.h>

#ifdef CONFIG_COMPAT

#include <linux/stat.h>
#include <linux/param.h> /* for HZ */
#include <linux/sem.h>
Expand All @@ -20,9 +18,11 @@
#include <linux/uaccess.h>
#include <linux/unistd.h>

#ifdef CONFIG_COMPAT
#include <asm/compat.h>
#include <asm/siginfo.h>
#include <asm/signal.h>
#endif

#ifdef CONFIG_ARCH_HAS_SYSCALL_WRAPPER
/*
Expand Down Expand Up @@ -83,6 +83,8 @@
static inline long __do_compat_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__))
#endif /* COMPAT_SYSCALL_DEFINEx */

#ifdef CONFIG_COMPAT

#ifndef compat_user_stack_pointer
#define compat_user_stack_pointer() current_user_stack_pointer()
#endif
Expand Down Expand Up @@ -1016,7 +1018,9 @@ static inline struct compat_timeval ns_to_compat_timeval(s64 nsec)
#else /* !CONFIG_COMPAT */

#define is_compat_task() (0)
#ifndef in_compat_syscall
static inline bool in_compat_syscall(void) { return false; }
#endif

#endif /* CONFIG_COMPAT */

Expand Down

0 comments on commit 5055c67

Please sign in to comment.