diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2011-06-13 10:58:34 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2011-06-24 03:48:43 -0400 |
commit | e8856a8797e76e6883ae81f8f9ecbb231cc535df (patch) | |
tree | f256d1100f2458e01ca2680052466b24bbabe664 /arch/arm/mach-sa1100/sleep.S | |
parent | dbc125168fd7dda4ffb24a29548746c7bd3b3d87 (diff) |
ARM: pm: convert cpu_suspend() to a normal function
cpu_suspend() has a weird calling method which makes it only possible to
call from assembly code: it returns with a modified stack pointer to
finish the suspend, but on resume, it 'returns' via a provided pointer.
We can make cpu_suspend() appear to be a normal function merely by
swapping the resume pointer argument and the link register.
Do so, and update all callers to take account of this more traditional
behaviour.
Acked-by: Frank Hofmann <frank.hofmann@tomtom.com>
Tested-by: Kevin Hilman <khilman@ti.com>
Acked-by: Jean Pihet <j-pihet@ti.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-sa1100/sleep.S')
-rw-r--r-- | arch/arm/mach-sa1100/sleep.S | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/arch/arm/mach-sa1100/sleep.S b/arch/arm/mach-sa1100/sleep.S index 122ab3c66923..f3fe39773f8b 100644 --- a/arch/arm/mach-sa1100/sleep.S +++ b/arch/arm/mach-sa1100/sleep.S | |||
@@ -31,9 +31,11 @@ | |||
31 | ENTRY(sa1100_cpu_suspend) | 31 | ENTRY(sa1100_cpu_suspend) |
32 | stmfd sp!, {r4 - r12, lr} @ save registers on stack | 32 | stmfd sp!, {r4 - r12, lr} @ save registers on stack |
33 | mov r1, r0 | 33 | mov r1, r0 |
34 | ldr r3, =sa1100_cpu_resume @ return function | 34 | adr r3, BSYM(sa1100_finish_suspend) |
35 | bl cpu_suspend | 35 | bl cpu_suspend |
36 | ldmfd sp!, {r4 - r12, pc} @ return to caller | ||
36 | 37 | ||
38 | sa1100_finish_suspend: | ||
37 | @ disable clock switching | 39 | @ disable clock switching |
38 | mcr p15, 0, r1, c15, c2, 2 | 40 | mcr p15, 0, r1, c15, c2, 2 |
39 | 41 | ||
@@ -139,12 +141,3 @@ sa1110_sdram_controller_fix: | |||
139 | str r13, [r12] | 141 | str r13, [r12] |
140 | 142 | ||
141 | 20: b 20b @ loop waiting for sleep | 143 | 20: b 20b @ loop waiting for sleep |
142 | |||
143 | /* | ||
144 | * cpu_sa1100_resume() | ||
145 | * | ||
146 | * entry point from bootloader into kernel during resume | ||
147 | */ | ||
148 | .align 5 | ||
149 | sa1100_cpu_resume: | ||
150 | ldmfd sp!, {r4 - r12, pc} @ return to caller | ||