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-pxa | |
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-pxa')
-rw-r--r-- | arch/arm/mach-pxa/sleep.S | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/arch/arm/mach-pxa/sleep.S b/arch/arm/mach-pxa/sleep.S index 613ddfa2c295..3a67887e6dbd 100644 --- a/arch/arm/mach-pxa/sleep.S +++ b/arch/arm/mach-pxa/sleep.S | |||
@@ -35,9 +35,11 @@ ENTRY(pxa3xx_cpu_suspend) | |||
35 | #endif | 35 | #endif |
36 | stmfd sp!, {r2 - r12, lr} @ save registers on stack | 36 | stmfd sp!, {r2 - r12, lr} @ save registers on stack |
37 | mov r1, r0 | 37 | mov r1, r0 |
38 | ldr r3, =pxa_cpu_resume @ resume function | 38 | adr r3, BSYM(pxa3xx_finish_suspend) |
39 | bl cpu_suspend | 39 | bl cpu_suspend |
40 | b pxa_cpu_resume | ||
40 | 41 | ||
42 | pxa3xx_finish_suspend: | ||
41 | mov r0, #0x06 @ S2D3C4 mode | 43 | mov r0, #0x06 @ S2D3C4 mode |
42 | mcr p14, 0, r0, c7, c0, 0 @ enter sleep | 44 | mcr p14, 0, r0, c7, c0, 0 @ enter sleep |
43 | 45 | ||
@@ -60,9 +62,11 @@ ENTRY(pxa27x_cpu_suspend) | |||
60 | #endif | 62 | #endif |
61 | stmfd sp!, {r2 - r12, lr} @ save registers on stack | 63 | stmfd sp!, {r2 - r12, lr} @ save registers on stack |
62 | mov r2, r0 @ save sleep mode | 64 | mov r2, r0 @ save sleep mode |
63 | ldr r3, =pxa_cpu_resume @ resume function | 65 | adr r3, BSYM(pxa27x_finish_suspend) |
64 | bl cpu_suspend | 66 | bl cpu_suspend |
67 | b pxa_cpu_resume | ||
65 | 68 | ||
69 | pxa27x_finish_suspend: | ||
66 | @ Put the processor to sleep | 70 | @ Put the processor to sleep |
67 | @ (also workaround for sighting 28071) | 71 | @ (also workaround for sighting 28071) |
68 | 72 | ||
@@ -110,8 +114,11 @@ ENTRY(pxa27x_cpu_suspend) | |||
110 | ENTRY(pxa25x_cpu_suspend) | 114 | ENTRY(pxa25x_cpu_suspend) |
111 | stmfd sp!, {r2 - r12, lr} @ save registers on stack | 115 | stmfd sp!, {r2 - r12, lr} @ save registers on stack |
112 | mov r2, r0 @ save sleep mode | 116 | mov r2, r0 @ save sleep mode |
113 | ldr r3, =pxa_cpu_resume @ resume function | 117 | adr r3, BSYM(pxa25x_finish_suspend) |
114 | bl cpu_suspend | 118 | bl cpu_suspend |
119 | b pxa_cpu_resume | ||
120 | |||
121 | pxa25x_finish_suspend: | ||
115 | @ prepare value for sleep mode | 122 | @ prepare value for sleep mode |
116 | mov r1, r0 @ sleep mode | 123 | mov r1, r0 @ sleep mode |
117 | 124 | ||