diff options
author | Jonas Bonn <jonas@southpole.se> | 2012-04-18 06:23:39 -0400 |
---|---|---|
committer | Jonas Bonn <jonas@southpole.se> | 2012-05-08 05:43:59 -0400 |
commit | 207e715ff17b42e022df107210dc8c736a703eb3 (patch) | |
tree | 284b3b25fe53905286444ad0beacbba0663771f8 /arch/openrisc | |
parent | 7b903e6c021a5462e26ea7a8f014fa60b6782bdb (diff) |
openrisc: use scratch regs in atomic syscall
The function sys_or1k_atomic was using call-saved registers without
restoring their value before returning. This is a faux pas: either
we need to restore their values or use scratch regs; the latter is
less code so that's the route this patch takes.
Thanks to David Hennerström for doing most of the heavy-lifting in
tracking this one down.
Reported-by: Davd Hennerström <david.hennerstrom@aacmicrotec.com>
Signed-off-by: Jonas Bonn <jonas@southpole.se>
Diffstat (limited to 'arch/openrisc')
-rw-r--r-- | arch/openrisc/kernel/entry.S | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/arch/openrisc/kernel/entry.S b/arch/openrisc/kernel/entry.S index 6e61af8682b8..ddfcaa828b0e 100644 --- a/arch/openrisc/kernel/entry.S +++ b/arch/openrisc/kernel/entry.S | |||
@@ -1117,10 +1117,10 @@ ENTRY(sys_rt_sigreturn) | |||
1117 | ENTRY(sys_or1k_atomic) | 1117 | ENTRY(sys_or1k_atomic) |
1118 | /* FIXME: This ignores r3 and always does an XCHG */ | 1118 | /* FIXME: This ignores r3 and always does an XCHG */ |
1119 | DISABLE_INTERRUPTS(r17,r19) | 1119 | DISABLE_INTERRUPTS(r17,r19) |
1120 | l.lwz r30,0(r4) | 1120 | l.lwz r29,0(r4) |
1121 | l.lwz r28,0(r5) | 1121 | l.lwz r27,0(r5) |
1122 | l.sw 0(r4),r28 | 1122 | l.sw 0(r4),r27 |
1123 | l.sw 0(r5),r30 | 1123 | l.sw 0(r5),r29 |
1124 | ENABLE_INTERRUPTS(r17) | 1124 | ENABLE_INTERRUPTS(r17) |
1125 | l.jr r9 | 1125 | l.jr r9 |
1126 | l.or r11,r0,r0 | 1126 | l.or r11,r0,r0 |