Message ID | 1245505362-21036-1-git-send-email-matt@console-pimps.org (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
diff --git a/arch/sh/kernel/entry-common.S b/arch/sh/kernel/entry-common.S index d62359c..9c3ec36 100644 --- a/arch/sh/kernel/entry-common.S +++ b/arch/sh/kernel/entry-common.S @@ -322,9 +322,17 @@ ENTRY(system_call) nop #ifdef CONFIG_TRACE_IRQFLAGS + /* + * Save r3 (the syscall number) on the stack because it + * may be clobbered by the call to trace_hardirqs_on. + */ + mov.l r3, @-r15 + mov.l 5f, r10 jsr @r10 nop + + mov.l @r15+, r3 ! restore r3 #endif sti
When performing a syscall on SH we store the syscall number in register r3, which according to the ABI isn't callee-saved. I was running into a problem where trace_hardirqs_on would trash the value in r3 and the syscall handlers were not being called. So save/restore the contents of r3 on the stack around the call to trace_hardirqs_on. Signed-off-by: Matt Fleming <matt@console-pimps.org> --- arch/sh/kernel/entry-common.S | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-)