sparc: implement is_32bit_task
authorEric Paris <eparis@redhat.com>
Tue, 22 Apr 2014 16:39:51 +0000 (12:39 -0400)
committerEric Paris <eparis@redhat.com>
Tue, 23 Sep 2014 20:21:27 +0000 (16:21 -0400)
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
arch/sparc/include/asm/syscall.h
arch/sparc/include/asm/thread_info_32.h
arch/sparc/include/asm/thread_info_64.h

index a5a8153766b39c716b7a1241cf5b14e4f8852a63..49f71fd5b56ee83566895b0674dca3bd6c7057e5 100644 (file)
@@ -128,12 +128,7 @@ static inline void syscall_set_arguments(struct task_struct *task,
 
 static inline int syscall_get_arch(void)
 {
-#if defined(__sparc__) && defined(__arch64__)
-       return test_thread_flag(TIF_32BIT) ? AUDIT_ARCH_SPARC
-                                          : AUDIT_ARCH_SPARC64;
-#else
-       return AUDIT_ARCH_SPARC;
-#endif
+       return is_32bit_task() ? AUDIT_ARCH_SPARC : AUDIT_ARCH_SPARC64;
 }
 
 #endif /* __ASM_SPARC_SYSCALL_H */
index 96efa7adc22330d2684e67ab3c83dafa99e89e8a..025c98446b1ee1bce743d41ecdf4494eb62e7d50 100644 (file)
@@ -130,6 +130,8 @@ register struct thread_info *current_thread_info_reg asm("g6");
 #define _TIF_DO_NOTIFY_RESUME_MASK     (_TIF_NOTIFY_RESUME | \
                                         _TIF_SIGPENDING)
 
+#define is_32bit_task()        (1)
+
 #endif /* __KERNEL__ */
 
 #endif /* _ASM_THREAD_INFO_H */
index a5f01ac6d0f1a2619cdac6b639248cb5a7153dac..5a4f6600e62482e59cba6ef126be934c614491bc 100644 (file)
@@ -219,6 +219,8 @@ register struct thread_info *current_thread_info_reg asm("g6");
                                 _TIF_NEED_RESCHED)
 #define _TIF_DO_NOTIFY_RESUME_MASK     (_TIF_NOTIFY_RESUME | _TIF_SIGPENDING)
 
+#define is_32bit_task()        (test_thread_flag(TIF_32BIT))
+
 /*
  * Thread-synchronous status.
  *