MIPS: Fix syscall_get_nr for the syscall exit tracing.
authorLars Persson <lars.persson@axis.com>
Tue, 3 Feb 2015 16:08:17 +0000 (17:08 +0100)
committerRalf Baechle <ralf@linux-mips.org>
Wed, 4 Feb 2015 15:40:09 +0000 (16:40 +0100)
Register 2 is alredy overwritten by the return value when
syscall_trace_leave() is called.

Signed-off-by: Lars Persson <larper@axis.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/9187/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
arch/mips/include/asm/syscall.h
arch/mips/include/asm/thread_info.h
arch/mips/kernel/ptrace.c

index bb79637..6499d93 100644 (file)
 static inline long syscall_get_nr(struct task_struct *task,
                                  struct pt_regs *regs)
 {
-       /* O32 ABI syscall() - Either 64-bit with O32 or 32-bit */
-       if ((config_enabled(CONFIG_32BIT) ||
-           test_tsk_thread_flag(task, TIF_32BIT_REGS)) &&
-           (regs->regs[2] == __NR_syscall))
-               return regs->regs[4];
-       else
-               return regs->regs[2];
+       return current_thread_info()->syscall;
 }
 
 static inline unsigned long mips_get_syscall_arg(unsigned long *arg,
Simple merge
Simple merge