aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorEric Paris <eparis@redhat.com>2014-04-22 12:39:51 -0400
committerEric Paris <eparis@redhat.com>2014-09-23 16:21:27 -0400
commita17c8b54dc738c4fda31e8be0302cd131a04c19f (patch)
treeab8ac2099cb03bb85a06f9d7adf5f1f5167c763f /arch
parent01ed102c8522a71d6d05824dd4dc3e17ee9b6d29 (diff)
sparc: implement is_32bit_task
We are currently embedding the same check from thread_info.h into syscall.h thanks to the way syscall_get_arch() was implemented in the audit tree. Instead create a new function, is_32bit_task() which is similar to that found on the powerpc arch. This simplifies the syscall.h code and makes the build/Kconfig requirements much easier to understand. Signed-off-by: Eric Paris <eparis@redhat.com Acked-by: David S. Miller <davem@davemloft.net> Cc: Stephen Rothwell <sfr@canb.auug.org.au> Cc: sparclinux@vger.kernel.org
Diffstat (limited to 'arch')
-rw-r--r--arch/sparc/include/asm/syscall.h7
-rw-r--r--arch/sparc/include/asm/thread_info_32.h2
-rw-r--r--arch/sparc/include/asm/thread_info_64.h2
3 files changed, 5 insertions, 6 deletions
diff --git a/arch/sparc/include/asm/syscall.h b/arch/sparc/include/asm/syscall.h
index a5a8153766b3..49f71fd5b56e 100644
--- a/arch/sparc/include/asm/syscall.h
+++ b/arch/sparc/include/asm/syscall.h
@@ -128,12 +128,7 @@ static inline void syscall_set_arguments(struct task_struct *task,
128 128
129static inline int syscall_get_arch(void) 129static inline int syscall_get_arch(void)
130{ 130{
131#if defined(__sparc__) && defined(__arch64__) 131 return is_32bit_task() ? AUDIT_ARCH_SPARC : AUDIT_ARCH_SPARC64;
132 return test_thread_flag(TIF_32BIT) ? AUDIT_ARCH_SPARC
133 : AUDIT_ARCH_SPARC64;
134#else
135 return AUDIT_ARCH_SPARC;
136#endif
137} 132}
138 133
139#endif /* __ASM_SPARC_SYSCALL_H */ 134#endif /* __ASM_SPARC_SYSCALL_H */
diff --git a/arch/sparc/include/asm/thread_info_32.h b/arch/sparc/include/asm/thread_info_32.h
index 96efa7adc223..025c98446b1e 100644
--- a/arch/sparc/include/asm/thread_info_32.h
+++ b/arch/sparc/include/asm/thread_info_32.h
@@ -130,6 +130,8 @@ register struct thread_info *current_thread_info_reg asm("g6");
130#define _TIF_DO_NOTIFY_RESUME_MASK (_TIF_NOTIFY_RESUME | \ 130#define _TIF_DO_NOTIFY_RESUME_MASK (_TIF_NOTIFY_RESUME | \
131 _TIF_SIGPENDING) 131 _TIF_SIGPENDING)
132 132
133#define is_32bit_task() (1)
134
133#endif /* __KERNEL__ */ 135#endif /* __KERNEL__ */
134 136
135#endif /* _ASM_THREAD_INFO_H */ 137#endif /* _ASM_THREAD_INFO_H */
diff --git a/arch/sparc/include/asm/thread_info_64.h b/arch/sparc/include/asm/thread_info_64.h
index a5f01ac6d0f1..5a4f6600e624 100644
--- a/arch/sparc/include/asm/thread_info_64.h
+++ b/arch/sparc/include/asm/thread_info_64.h
@@ -219,6 +219,8 @@ register struct thread_info *current_thread_info_reg asm("g6");
219 _TIF_NEED_RESCHED) 219 _TIF_NEED_RESCHED)
220#define _TIF_DO_NOTIFY_RESUME_MASK (_TIF_NOTIFY_RESUME | _TIF_SIGPENDING) 220#define _TIF_DO_NOTIFY_RESUME_MASK (_TIF_NOTIFY_RESUME | _TIF_SIGPENDING)
221 221
222#define is_32bit_task() (test_thread_flag(TIF_32BIT))
223
222/* 224/*
223 * Thread-synchronous status. 225 * Thread-synchronous status.
224 * 226 *