aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMate Toth-Pal <mate.toth-pal@arm.com>2019-09-18 15:03:23 +0200
committerMate Toth-Pal <mate.toth-pal@arm.com>2020-01-21 08:42:52 +0100
commit01ac46562dffca940340413bef4ffa07f99840de (patch)
tree20d6e80d2b5b5e5bca6316a497ad45f26f9abf16
parent79efae3785f4c7a1023d286dfb2ac8e9b0d4910e (diff)
downloadtrusted-firmware-m-01ac46562dffca940340413bef4ffa07f99840de.tar.gz
Core: Unify register clear in naked functions
Use the r4 register value to clear general purpose registers in SVC and IRQ handlers. Change-Id: I4ac2097655d4caf3952f45760fe4e37b9ebd30b8 Signed-off-by: Mate Toth-Pal <mate.toth-pal@arm.com>
-rw-r--r--secure_fw/core/arch/tfm_arch_v8m_main.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/secure_fw/core/arch/tfm_arch_v8m_main.c b/secure_fw/core/arch/tfm_arch_v8m_main.c
index 9a0d4ccdd..1d3fd22dd 100644
--- a/secure_fw/core/arch/tfm_arch_v8m_main.c
+++ b/secure_fw/core/arch/tfm_arch_v8m_main.c
@@ -93,13 +93,13 @@ int32_t tfm_core_sfn_request(const struct tfm_sfn_req_s *desc_ptr)
"PUSH {r4-r12, lr} \n"
"SVC %[SVC_REQ] \n"
"MOV r4, #0 \n"
- "MOV r5, #0 \n"
- "MOV r6, #0 \n"
- "MOV r7, #0 \n"
- "MOV r8, #0 \n"
- "MOV r9, #0 \n"
- "MOV r10, #0 \n"
- "MOV r11, #0 \n"
+ "MOV r5, r4 \n"
+ "MOV r6, r4 \n"
+ "MOV r7, r4 \n"
+ "MOV r8, r4 \n"
+ "MOV r9, r4 \n"
+ "MOV r10, r4 \n"
+ "MOV r11, r4 \n"
"BLX lr \n"
"SVC %[SVC_RET] \n"
"POP {r4-r12, pc} \n"
@@ -120,14 +120,14 @@ void priv_irq_handler_main(uint32_t partition_id,
/* Request SVC to configure environment for the unpriv IRQ handler */
"SVC %[SVC_REQ] \n"
/* clear the callee saved registers to prevent information leak */
- "MOV r4, #0 \n"
- "MOV r5, #0 \n"
- "MOV r6, #0 \n"
- "MOV r7, #0 \n"
- "MOV r8, #0 \n"
- "MOV r9, #0 \n"
- "MOV r10, #0 \n"
- "MOV r11, #0 \n"
+ "MOV r4, #0 \n"
+ "MOV r5, r4 \n"
+ "MOV r6, r4 \n"
+ "MOV r7, r4 \n"
+ "MOV r8, r4 \n"
+ "MOV r9, r4 \n"
+ "MOV r10, r4 \n"
+ "MOV r11, r4 \n"
/* Branch to the unprivileged handler */
"BLX lr \n"
/* Request SVC to reconfigure the environment of the interrupted