aboutsummaryrefslogtreecommitdiffstats
path: root/lib/psci/aarch32
diff options
context:
space:
mode:
authorSoby Mathew <soby.mathew@arm.com>2016-12-06 12:10:51 +0000
committerSoby Mathew <soby.mathew@arm.com>2016-12-12 17:57:37 +0000
commit9f3ee61c904e4b6d2038086718c5ec4237d544a8 (patch)
treea07820ccf5f8a93356566fec4b98fd1ae3a671ee /lib/psci/aarch32
parent919ad05ecb8fab23f91a37783dc5f246847c7bd2 (diff)
downloadplatform_external_arm-trusted-firmware-9f3ee61c904e4b6d2038086718c5ec4237d544a8.tar.gz
platform_external_arm-trusted-firmware-9f3ee61c904e4b6d2038086718c5ec4237d544a8.tar.bz2
platform_external_arm-trusted-firmware-9f3ee61c904e4b6d2038086718c5ec4237d544a8.zip
AArch32: Fix the stack alignment issue
The AArch32 Procedure call Standard mandates that the stack must be aligned to 8 byte boundary at external interfaces. This patch does the required changes. This problem was detected when a crash was encountered in `psci_print_power_domain_map()` while printing 64 bit values. Aligning the stack to 8 byte boundary resolved the problem. Fixes ARM-Software/tf-issues#437 Change-Id: I517bd8203601bb88e9311bd36d477fb7b3efb292 Signed-off-by: Soby Mathew <soby.mathew@arm.com>
Diffstat (limited to 'lib/psci/aarch32')
-rw-r--r--lib/psci/aarch32/psci_helpers.S5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/psci/aarch32/psci_helpers.S b/lib/psci/aarch32/psci_helpers.S
index 36d5d7d9b..373c184d8 100644
--- a/lib/psci/aarch32/psci_helpers.S
+++ b/lib/psci/aarch32/psci_helpers.S
@@ -93,7 +93,8 @@ endfunc psci_do_pwrdown_cache_maintenance
* -----------------------------------------------------------------------
*/
func psci_do_pwrup_cache_maintenance
- push {lr}
+ /* r12 is pushed to meet the 8 byte stack alignment requirement */
+ push {r12, lr}
/* ---------------------------------------------
* Ensure any inflight stack writes have made it
@@ -123,7 +124,7 @@ func psci_do_pwrup_cache_maintenance
stcopr r0, SCTLR
isb
- pop {pc}
+ pop {r12, pc}
endfunc psci_do_pwrup_cache_maintenance
/* ---------------------------------------------