ARCH: AUDIT: implement syscall_get_arch for all arches
[firefly-linux-kernel-4.4.55.git] / arch / sparc / include / asm / syscall.h
index 025a02ad2e31c9a87c15350241234b8943e04ae6..fed3d511b108e955b02c8570ce0347fb1adadfbf 100644 (file)
@@ -1,9 +1,11 @@
 #ifndef __ASM_SPARC_SYSCALL_H
 #define __ASM_SPARC_SYSCALL_H
 
+#include <uapi/linux/audit.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <asm/ptrace.h>
+#include <asm/thread_info.h>
 
 /*
  * The syscall table always contains 32 bit pointers since we know that the
@@ -124,4 +126,10 @@ static inline void syscall_set_arguments(struct task_struct *task,
                regs->u_regs[UREG_I0 + i + j] = args[j];
 }
 
+static inline int syscall_get_arch(void)
+{
+       return test_thread_flag(TIF_32BIT) ? AUDIT_ARCH_SPARC
+                                          : AUDIT_ARCH_SPARC64;
+}
+
 #endif /* __ASM_SPARC_SYSCALL_H */