summaryrefslogtreecommitdiff
path: root/bl32/sp_min
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 /bl32/sp_min
parent919ad05ecb8fab23f91a37783dc5f246847c7bd2 (diff)
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 'bl32/sp_min')
-rw-r--r--bl32/sp_min/aarch32/entrypoint.S9
1 files changed, 6 insertions, 3 deletions
diff --git a/bl32/sp_min/aarch32/entrypoint.S b/bl32/sp_min/aarch32/entrypoint.S
index 54f2cedb..e2ab923d 100644
--- a/bl32/sp_min/aarch32/entrypoint.S
+++ b/bl32/sp_min/aarch32/entrypoint.S
@@ -168,8 +168,11 @@ func handle_smc
mov r2, r0 /* handle */
ldcopr r0, SCR
- /* Save SCR in stack */
- push {r0}
+ /*
+ * Save SCR in stack. r1 is pushed to meet the 8 byte
+ * stack alignment requirement.
+ */
+ push {r0, r1}
and r3, r0, #SCR_NS_BIT /* flags */
/* Switch to Secure Mode*/
@@ -191,7 +194,7 @@ func handle_smc
/* r0 points to smc context */
/* Restore SCR from stack */
- pop {r1}
+ pop {r1, r2}
stcopr r1, SCR
isb