Commit 3799bbe5 authored by Russell King's avatar Russell King

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: default avatarFrank Hofmann <frank.hofmann@tomtom.com>
Tested-by: default avatarKevin Hilman <khilman@ti.com>
Acked-by: default avatarJean Pihet <j-pihet@ti.com>
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent 8111eaa6
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
/* /*
* Save CPU state for a suspend * Save CPU state for a suspend
* r1 = v:p offset * r1 = v:p offset
* r2 = suspend function arg0
* r3 = virtual return function * r3 = virtual return function
* Note: sp is decremented to allocate space for CPU state on stack * Note: sp is decremented to allocate space for CPU state on stack
* r0-r3,ip,lr corrupted * r0-r3,ip,lr corrupted
...@@ -17,7 +18,6 @@ ...@@ -17,7 +18,6 @@
ENTRY(cpu_suspend) ENTRY(cpu_suspend)
stmfd sp!, {r3} stmfd sp!, {r3}
stmfd sp!, {r4 - r11} stmfd sp!, {r4 - r11}
mov r9, lr
#ifdef MULTI_CPU #ifdef MULTI_CPU
ldr r10, =processor ldr r10, =processor
ldr r5, [r10, #CPU_SLEEP_SIZE] @ size of CPU sleep state ldr r5, [r10, #CPU_SLEEP_SIZE] @ size of CPU sleep state
...@@ -33,6 +33,7 @@ ENTRY(cpu_suspend) ...@@ -33,6 +33,7 @@ ENTRY(cpu_suspend)
stmfd sp!, {r1, r6, ip} @ save v:p, virt SP, phys resume fn stmfd sp!, {r1, r6, ip} @ save v:p, virt SP, phys resume fn
ldr r5, =sleep_save_sp ldr r5, =sleep_save_sp
add r6, sp, r1 @ convert SP to phys add r6, sp, r1 @ convert SP to phys
stmfd sp!, {r2, lr} @ save suspend func arg and pointer
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
ALT_SMP(mrc p15, 0, lr, c0, c0, 5) ALT_SMP(mrc p15, 0, lr, c0, c0, 5)
ALT_UP(mov lr, #0) ALT_UP(mov lr, #0)
...@@ -51,12 +52,12 @@ ENTRY(cpu_suspend) ...@@ -51,12 +52,12 @@ ENTRY(cpu_suspend)
@ flush data cache @ flush data cache
#ifdef MULTI_CACHE #ifdef MULTI_CACHE
ldr r10, =cpu_cache ldr r10, =cpu_cache
mov lr, r9 mov lr, pc
ldr pc, [r10, #CACHE_FLUSH_KERN_ALL] ldr pc, [r10, #CACHE_FLUSH_KERN_ALL]
#else #else
mov lr, r9 bl __cpuc_flush_kern_all
b __cpuc_flush_kern_all
#endif #endif
ldmfd sp!, {r0, pc} @ call suspend fn
ENDPROC(cpu_suspend) ENDPROC(cpu_suspend)
.ltorg .ltorg
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment