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/plat-s3c24xx | |
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/plat-s3c24xx')
-rw-r--r-- | arch/arm/plat-s3c24xx/sleep.S | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/arch/arm/plat-s3c24xx/sleep.S b/arch/arm/plat-s3c24xx/sleep.S index fd7032f84ae7..f822e6282dd4 100644 --- a/arch/arm/plat-s3c24xx/sleep.S +++ b/arch/arm/plat-s3c24xx/sleep.S | |||
@@ -49,21 +49,17 @@ | |||
49 | 49 | ||
50 | ENTRY(s3c_cpu_save) | 50 | ENTRY(s3c_cpu_save) |
51 | stmfd sp!, { r4 - r12, lr } | 51 | stmfd sp!, { r4 - r12, lr } |
52 | ldr r3, =resume_with_mmu | 52 | adr r3, BSYM(s3c24xx_finish_suspend) |
53 | bl cpu_suspend | 53 | bl cpu_suspend |
54 | ldmfd sp!, { r4 - r12, pc } | ||
54 | 55 | ||
56 | s3c24xx_finish_suspend: | ||
55 | @@ jump to final code to send system to sleep | 57 | @@ jump to final code to send system to sleep |
56 | ldr r0, =pm_cpu_sleep | 58 | ldr r0, =pm_cpu_sleep |
57 | @@ldr pc, [ r0 ] | 59 | @@ldr pc, [ r0 ] |
58 | ldr r0, [ r0 ] | 60 | ldr r0, [ r0 ] |
59 | mov pc, r0 | 61 | mov pc, r0 |
60 | 62 | ||
61 | @@ return to the caller, after having the MMU | ||
62 | @@ turned on, this restores the last bits from the | ||
63 | @@ stack | ||
64 | resume_with_mmu: | ||
65 | ldmfd sp!, { r4 - r12, pc } | ||
66 | |||
67 | .ltorg | 63 | .ltorg |
68 | 64 | ||
69 | /* sleep magic, to allow the bootloader to check for an valid | 65 | /* sleep magic, to allow the bootloader to check for an valid |