aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/kernel/scall32-o32.S
diff options
context:
space:
mode:
Diffstat (limited to 'arch/mips/kernel/scall32-o32.S')
-rw-r--r--arch/mips/kernel/scall32-o32.S11
1 files changed, 10 insertions, 1 deletions
diff --git a/arch/mips/kernel/scall32-o32.S b/arch/mips/kernel/scall32-o32.S
index 1789a801802e..ffe89139e0f9 100644
--- a/arch/mips/kernel/scall32-o32.S
+++ b/arch/mips/kernel/scall32-o32.S
@@ -118,7 +118,16 @@ syscall_trace_entry:
SAVE_STATIC
move s0, t2
move a0, sp
- jal syscall_trace_enter
+
+ /*
+ * syscall number is in v0 unless we called syscall(__NR_###)
+ * where the real syscall number is in a0
+ */
+ addiu a1, v0, __NR_O32_Linux
+ bnez v0, 1f /* __NR_syscall at offset 0 */
+ lw a1, PT_R4(sp)
+
+1: jal syscall_trace_enter
bltz v0, 2f # seccomp failed? Skip syscall