diff options
author | Sam Edwards | 2023-05-27 18:09:42 -0600 |
---|---|---|
committer | Tom Rini | 2023-06-20 16:08:13 -0400 |
commit | 8dc2c666808a07c2ad484ef6c4f89aa551eaf265 (patch) | |
tree | a19a24a3c024074afe3394a0ef12252716234b71 | |
parent | 50195a23468e3a8a32cba8534d76627b5d189551 (diff) |
psci: fix use of clobbered registers in asm
The functions `psci_get_context_id` and `psci_get_target_pc`
are written in C, so the C compiler may clobber registers r0-r3.
Do not use these registers to save data across calls.
Signed-off-by: Sam Edwards <CFSworks@gmail.com>
-rw-r--r-- | arch/arm/cpu/armv7/psci.S | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/arm/cpu/armv7/psci.S b/arch/arm/cpu/armv7/psci.S index 6c066e50d91..41428728b7b 100644 --- a/arch/arm/cpu/armv7/psci.S +++ b/arch/arm/cpu/armv7/psci.S @@ -311,11 +311,11 @@ ENTRY(psci_cpu_entry) bl psci_arch_cpu_entry bl psci_get_cpu_id @ CPU ID => r0 - mov r2, r0 @ CPU ID => r2 bl psci_get_context_id @ context id => r0 - mov r1, r0 @ context id => r1 - mov r0, r2 @ CPU ID => r0 + push {r0} @ save context id + bl psci_get_cpu_id @ CPU ID => r0 bl psci_get_target_pc @ target PC => r0 + pop {r1} @ context id => r1 b _do_nonsec_entry ENDPROC(psci_cpu_entry) |