diff options
author | Nicolas Pitre <nico@cam.org> | 2006-01-14 14:30:04 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2006-01-14 14:30:04 -0500 |
commit | 3f471126ee53feb5e9b210ea2f525ed3bb9b7a7f (patch) | |
tree | 3f7567343a892d02e758bcd1c07557af43d5aa1b /arch/arm/kernel/entry-common.S | |
parent | 6c90c872017773cde70a51432cb28f253451b967 (diff) |
[ARM] 3262/4: allow ptraced syscalls to be overriden
Patch from Nicolas Pitre
This is needed by strace to properly handle the tracing of some system
calls. It could be useful for other applications as well.
Based on an earlier patch from Daniel Jacobowitz.
Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Daniel Jacobowitz <dan@debian.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/kernel/entry-common.S')
-rw-r--r-- | arch/arm/kernel/entry-common.S | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/arm/kernel/entry-common.S b/arch/arm/kernel/entry-common.S index 8826d9803aeb..2b92ce85f97f 100644 --- a/arch/arm/kernel/entry-common.S +++ b/arch/arm/kernel/entry-common.S | |||
@@ -214,11 +214,13 @@ ENTRY(vector_swi) | |||
214 | * context switches, and waiting for our parent to respond. | 214 | * context switches, and waiting for our parent to respond. |
215 | */ | 215 | */ |
216 | __sys_trace: | 216 | __sys_trace: |
217 | mov r2, scno | ||
217 | add r1, sp, #S_OFF | 218 | add r1, sp, #S_OFF |
218 | mov r0, #0 @ trace entry [IP = 0] | 219 | mov r0, #0 @ trace entry [IP = 0] |
219 | bl syscall_trace | 220 | bl syscall_trace |
220 | 221 | ||
221 | adr lr, __sys_trace_return @ return address | 222 | adr lr, __sys_trace_return @ return address |
223 | mov scno, r0 @ syscall number (possibly new) | ||
222 | add r1, sp, #S_R0 + S_OFF @ pointer to regs | 224 | add r1, sp, #S_R0 + S_OFF @ pointer to regs |
223 | cmp scno, #NR_syscalls @ check upper syscall limit | 225 | cmp scno, #NR_syscalls @ check upper syscall limit |
224 | ldmccia r1, {r0 - r3} @ have to reload r0 - r3 | 226 | ldmccia r1, {r0 - r3} @ have to reload r0 - r3 |
@@ -227,6 +229,7 @@ __sys_trace: | |||
227 | 229 | ||
228 | __sys_trace_return: | 230 | __sys_trace_return: |
229 | str r0, [sp, #S_R0 + S_OFF]! @ save returned r0 | 231 | str r0, [sp, #S_R0 + S_OFF]! @ save returned r0 |
232 | mov r2, scno | ||
230 | mov r1, sp | 233 | mov r1, sp |
231 | mov r0, #1 @ trace exit [IP = 1] | 234 | mov r0, #1 @ trace exit [IP = 1] |
232 | bl syscall_trace | 235 | bl syscall_trace |