diff options
-rw-r--r-- | arch/arm/mach-tegra/sleep-t2.S | 2 | ||||
-rw-r--r-- | arch/arm/mach-tegra/sleep.S | 4 | ||||
-rw-r--r-- | arch/arm/mach-tegra/sleep.h | 26 |
3 files changed, 27 insertions, 5 deletions
diff --git a/arch/arm/mach-tegra/sleep-t2.S b/arch/arm/mach-tegra/sleep-t2.S index d92a664b3b03..93ae8b293a93 100644 --- a/arch/arm/mach-tegra/sleep-t2.S +++ b/arch/arm/mach-tegra/sleep-t2.S @@ -226,7 +226,7 @@ ENTRY(tegra2_sleep_wfi) bl __cpuc_flush_kern_all #endif - pop_ctx_regs @ restore context registers + pop_ctx_regs r0, r1 @ restore context registers mov pc, lr ENDPROC(tegra2_sleep_wfi) diff --git a/arch/arm/mach-tegra/sleep.S b/arch/arm/mach-tegra/sleep.S index 23cecedc788a..9c62832dedf2 100644 --- a/arch/arm/mach-tegra/sleep.S +++ b/arch/arm/mach-tegra/sleep.S @@ -179,7 +179,7 @@ ENDPROC(tegra_cpu_suspend) */ ENTRY(tegra_cpu_save) - push_ctx_regs @ save context registers + push_ctx_regs r1 @ save context registers adr r3, tegra_cpu_resume @@ -230,7 +230,7 @@ tegra_cpu_resume: bl cpu_init - pop_ctx_regs @ restore context registers + pop_ctx_regs r1, r2 @ restore context registers mov pc, lr /* diff --git a/arch/arm/mach-tegra/sleep.h b/arch/arm/mach-tegra/sleep.h index 31547d4522af..791a0a71067d 100644 --- a/arch/arm/mach-tegra/sleep.h +++ b/arch/arm/mach-tegra/sleep.h @@ -93,7 +93,28 @@ dsb .endm -.macro push_ctx_regs +#define DEBUG_CONTEXT_STACK 0 + +/* pops a debug check token from the stack */ +.macro pop_stack_token tmp1, tmp2 +#if DEBUG_CONTEXT_STACK + mov32 \tmp1, 0xBAB1F00D + ldmfd sp!, {\tmp2} + cmp \tmp1, \tmp2 + movne pc, #0 +#endif +.endm + +/* pushes a debug check token onto the stack */ +.macro push_stack_token tmp1 +#if DEBUG_CONTEXT_STACK + mov32 \tmp1, 0xBAB1F00D + stmfd sp!, {\tmp1} +#endif +.endm + +.macro push_ctx_regs, tmp1 + push_stack_token \tmp1 @ debug check word stmfd sp!, {r4 - r11, lr} /* FIXME: The next two instructions should be removed if our change to save the diagnostic regsiter in the CPU context is accepted. */ @@ -101,12 +122,13 @@ stmfd sp!, {r4} .endm -.macro pop_ctx_regs +.macro pop_ctx_regs, tmp1, tmp2 /* FIXME: The next two instructions should be removed if our change to save the diagnostic regsiter in the CPU context is accepted. */ ldmfd sp!, {r4} mcr p15, 0, r4, c15, c0, 1 @ write diagnostic register ldmfd sp!, {r4 - r11, lr} + pop_stack_token \tmp1, \tmp2 @ debug stack debug token .endm #else |