summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorScott Williams <scwilliams@nvidia.com>2011-08-03 21:44:21 -0700
committerDan Willemsen <dwillemsen@nvidia.com>2011-11-30 21:47:02 -0800
commit381b82041036f33f18a6a4a303e3a985baf24ab6 (patch)
tree47956940ae833398515e85fff2e840f6a741b623 /arch
parente3e523668c9d6431ba5b2888707cd96b9d3f75b6 (diff)
ARM: tegra: power: Define push/pop context register macros
Define macros to ensure that the behavior of push/pop of the context regsiter set is consistent across all callers. Change-Id: If2e68764e9755979a205a57543b30438e9b7ff96 Signed-off-by: Scott Williams <scwilliams@nvidia.com> Rebase-Id: Rb8f4984258e71c318e93fc709b18d1efdf5b2cc4
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-tegra/sleep-t2.S7
-rw-r--r--arch/arm/mach-tegra/sleep.S14
-rw-r--r--arch/arm/mach-tegra/sleep.h16
3 files changed, 19 insertions, 18 deletions
diff --git a/arch/arm/mach-tegra/sleep-t2.S b/arch/arm/mach-tegra/sleep-t2.S
index 4ae200834df5..d92a664b3b03 100644
--- a/arch/arm/mach-tegra/sleep-t2.S
+++ b/arch/arm/mach-tegra/sleep-t2.S
@@ -226,12 +226,7 @@ ENTRY(tegra2_sleep_wfi)
bl __cpuc_flush_kern_all
#endif
- /* 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!, {lr}
- ldmfd sp!, {r4 - r11}
+ pop_ctx_regs @ 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 f4dac021fba4..23cecedc788a 100644
--- a/arch/arm/mach-tegra/sleep.S
+++ b/arch/arm/mach-tegra/sleep.S
@@ -179,12 +179,7 @@ ENDPROC(tegra_cpu_suspend)
*/
ENTRY(tegra_cpu_save)
- stmfd sp!, {r4 - r11}
- stmfd sp!, {lr}
- /* FIXME: The next two instructions should be removed if our change to
- save the diagnostic regsiter in the CPU context is accepted. */
- mrc p15, 0, r4, c15, c0, 1 @ read diagnostic register
- stmfd sp!, {r4}
+ push_ctx_regs @ save context registers
adr r3, tegra_cpu_resume
@@ -235,12 +230,7 @@ tegra_cpu_resume:
bl cpu_init
- /* 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!, {lr}
- ldmfd sp!, {r4 - r11}
+ pop_ctx_regs @ restore context registers
mov pc, lr
/*
diff --git a/arch/arm/mach-tegra/sleep.h b/arch/arm/mach-tegra/sleep.h
index 947d4d8867dd..31547d4522af 100644
--- a/arch/arm/mach-tegra/sleep.h
+++ b/arch/arm/mach-tegra/sleep.h
@@ -93,6 +93,22 @@
dsb
.endm
+.macro push_ctx_regs
+ 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. */
+ mrc p15, 0, r4, c15, c0, 1 @ read diagnostic register
+ stmfd sp!, {r4}
+.endm
+
+.macro pop_ctx_regs
+ /* 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}
+.endm
+
#else
#define FLOW_CTRL_HALT_CPU(cpu) (IO_ADDRESS(TEGRA_FLOW_CTRL_BASE) + \