aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2011-06-13 10:28:40 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2011-06-24 03:47:36 -0400
commit3799bbe57843d279008c9ec3406838966cad5f15 (patch)
tree791781918bd18ac0747eb0b82d8eb5e2205af105 /arch
parent8111eaa6d424ab3ba8a4d7a3148d4681ae5c6ae3 (diff)
ARM: pm: rejig suspend follow-on function calling convention
Save the suspend function pointer onto the stack for use when returning. Allocate r2 to pass an argument to the suspend function. 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')
-rw-r--r--arch/arm/kernel/sleep.S9
1 files changed, 5 insertions, 4 deletions
diff --git a/arch/arm/kernel/sleep.S b/arch/arm/kernel/sleep.S
index 358be13499da..b924bcc32dcd 100644
--- a/arch/arm/kernel/sleep.S
+++ b/arch/arm/kernel/sleep.S
@@ -10,6 +10,7 @@
10/* 10/*
11 * Save CPU state for a suspend 11 * Save CPU state for a suspend
12 * r1 = v:p offset 12 * r1 = v:p offset
13 * r2 = suspend function arg0
13 * r3 = virtual return function 14 * r3 = virtual return function
14 * Note: sp is decremented to allocate space for CPU state on stack 15 * Note: sp is decremented to allocate space for CPU state on stack
15 * r0-r3,ip,lr corrupted 16 * r0-r3,ip,lr corrupted
@@ -17,7 +18,6 @@
17ENTRY(cpu_suspend) 18ENTRY(cpu_suspend)
18 stmfd sp!, {r3} 19 stmfd sp!, {r3}
19 stmfd sp!, {r4 - r11} 20 stmfd sp!, {r4 - r11}
20 mov r9, lr
21#ifdef MULTI_CPU 21#ifdef MULTI_CPU
22 ldr r10, =processor 22 ldr r10, =processor
23 ldr r5, [r10, #CPU_SLEEP_SIZE] @ size of CPU sleep state 23 ldr r5, [r10, #CPU_SLEEP_SIZE] @ size of CPU sleep state
@@ -33,6 +33,7 @@ ENTRY(cpu_suspend)
33 stmfd sp!, {r1, r6, ip} @ save v:p, virt SP, phys resume fn 33 stmfd sp!, {r1, r6, ip} @ save v:p, virt SP, phys resume fn
34 ldr r5, =sleep_save_sp 34 ldr r5, =sleep_save_sp
35 add r6, sp, r1 @ convert SP to phys 35 add r6, sp, r1 @ convert SP to phys
36 stmfd sp!, {r2, lr} @ save suspend func arg and pointer
36#ifdef CONFIG_SMP 37#ifdef CONFIG_SMP
37 ALT_SMP(mrc p15, 0, lr, c0, c0, 5) 38 ALT_SMP(mrc p15, 0, lr, c0, c0, 5)
38 ALT_UP(mov lr, #0) 39 ALT_UP(mov lr, #0)
@@ -51,12 +52,12 @@ ENTRY(cpu_suspend)
51 @ flush data cache 52 @ flush data cache
52#ifdef MULTI_CACHE 53#ifdef MULTI_CACHE
53 ldr r10, =cpu_cache 54 ldr r10, =cpu_cache
54 mov lr, r9 55 mov lr, pc
55 ldr pc, [r10, #CACHE_FLUSH_KERN_ALL] 56 ldr pc, [r10, #CACHE_FLUSH_KERN_ALL]
56#else 57#else
57 mov lr, r9 58 bl __cpuc_flush_kern_all
58 b __cpuc_flush_kern_all
59#endif 59#endif
60 ldmfd sp!, {r0, pc} @ call suspend fn
60ENDPROC(cpu_suspend) 61ENDPROC(cpu_suspend)
61 .ltorg 62 .ltorg
62 63