syscall_get_arch: add "struct task_struct *" argument
[linux-block.git] / arch / powerpc / include / asm / syscall.h
index 1a0e7a8b1c811cf5d089c5ac68eb96d189ad702d..efb50429c9f4ba2aa65c599b780f78db14fae33a 100644 (file)
@@ -99,9 +99,15 @@ static inline void syscall_set_arguments(struct task_struct *task,
                regs->orig_gpr3 = args[0];
 }
 
-static inline int syscall_get_arch(void)
+static inline int syscall_get_arch(struct task_struct *task)
 {
-       int arch = is_32bit_task() ? AUDIT_ARCH_PPC : AUDIT_ARCH_PPC64;
+       int arch;
+
+       if (IS_ENABLED(CONFIG_PPC64) && !test_tsk_thread_flag(task, TIF_32BIT))
+               arch = AUDIT_ARCH_PPC64;
+       else
+               arch = AUDIT_ARCH_PPC;
+
 #ifdef __LITTLE_ENDIAN__
        arch |= __AUDIT_ARCH_LE;
 #endif