Skip to content

Commit

Permalink
[ARM] pxa: don't rely on r2 being preserved over a function call
Browse files Browse the repository at this point in the history
r2 is not guaranteed to be preserved over a function call, so relying
on it to store the link register over the call to sleep_phys_sp() is
unreliable.  Store the link register on the stack instead.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
  • Loading branch information
Russell King authored and Russell King committed Jan 20, 2008
1 parent a7da60f commit 3b1904d
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions arch/arm/mach-pxa/sleep.S
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ pxa_cpu_save_cp:
pxa_cpu_save_sp:
@ preserve phys address of stack
mov r0, sp
mov r2, lr
str lr, [sp, #-4]!
bl sleep_phys_sp
ldr r1, =sleep_save_sp
str r0, [r1]
mov pc, r2
ldr pc, [sp], #4

/*
* pxa27x_cpu_suspend()
Expand Down Expand Up @@ -270,5 +270,3 @@ resume_after_mmu:
mar acc0, r2, r3
#endif
ldmfd sp!, {r4 - r12, pc} @ return to caller


0 comments on commit 3b1904d

Please sign in to comment.