diff options
Diffstat (limited to 'arch/mips/kernel/scall64-o32.S')
-rw-r--r-- | arch/mips/kernel/scall64-o32.S | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/arch/mips/kernel/scall64-o32.S b/arch/mips/kernel/scall64-o32.S index 6788727d91af..70f6acecd928 100644 --- a/arch/mips/kernel/scall64-o32.S +++ b/arch/mips/kernel/scall64-o32.S | |||
@@ -112,7 +112,20 @@ trace_a_syscall: | |||
112 | 112 | ||
113 | move s0, t2 # Save syscall pointer | 113 | move s0, t2 # Save syscall pointer |
114 | move a0, sp | 114 | move a0, sp |
115 | jal syscall_trace_enter | 115 | /* |
116 | * syscall number is in v0 unless we called syscall(__NR_###) | ||
117 | * where the real syscall number is in a0 | ||
118 | * note: NR_syscall is the first O32 syscall but the macro is | ||
119 | * only defined when compiling with -mabi=32 (CONFIG_32BIT) | ||
120 | * therefore __NR_O32_Linux is used (4000) | ||
121 | */ | ||
122 | addiu a1, v0, __NR_O32_Linux | ||
123 | bnez v0, 1f /* __NR_syscall at offset 0 */ | ||
124 | lw a1, PT_R4(sp) | ||
125 | |||
126 | 1: jal syscall_trace_enter | ||
127 | |||
128 | bltz v0, 2f # seccomp failed? Skip syscall | ||
116 | 129 | ||
117 | move t0, s0 | 130 | move t0, s0 |
118 | RESTORE_STATIC | 131 | RESTORE_STATIC |
@@ -136,7 +149,7 @@ trace_a_syscall: | |||
136 | sd t1, PT_R0(sp) # save it for syscall restarting | 149 | sd t1, PT_R0(sp) # save it for syscall restarting |
137 | 1: sd v0, PT_R2(sp) # result | 150 | 1: sd v0, PT_R2(sp) # result |
138 | 151 | ||
139 | j syscall_exit | 152 | 2: j syscall_exit |
140 | 153 | ||
141 | /* ------------------------------------------------------------------------ */ | 154 | /* ------------------------------------------------------------------------ */ |
142 | 155 | ||