Skip to content

Commit

Permalink
openrisc: use scratch regs in atomic syscall
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jonas Bonn committed May 8, 2012
1 parent 7b903e6 commit 207e715
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions arch/openrisc/kernel/entry.S
Original file line number Diff line number Diff line change
Expand Up @@ -1117,10 +1117,10 @@ ENTRY(sys_rt_sigreturn)
ENTRY(sys_or1k_atomic)
/* FIXME: This ignores r3 and always does an XCHG */
DISABLE_INTERRUPTS(r17,r19)
l.lwz r30,0(r4)
l.lwz r28,0(r5)
l.sw 0(r4),r28
l.sw 0(r5),r30
l.lwz r29,0(r4)
l.lwz r27,0(r5)
l.sw 0(r4),r27
l.sw 0(r5),r29
ENABLE_INTERRUPTS(r17)
l.jr r9
l.or r11,r0,r0
Expand Down

0 comments on commit 207e715

Please sign in to comment.