diff options
author | Manish Pandey <manish.pandey2@arm.com> | 2023-01-11 21:41:07 +0000 |
---|---|---|
committer | Manish Pandey <manish.pandey2@arm.com> | 2023-02-13 10:45:46 +0000 |
commit | d87c0e277fcc6b07112c0ee6d1aecbc2200055a5 (patch) | |
tree | 26194f272300fb57e1bc8d0ab0a55c0a8d9ad105 /include/arch | |
parent | 6264643a0711faef346cbbb6e3d928a198aeaf31 (diff) | |
download | arm-trusted-firmware-d87c0e277fcc6b07112c0ee6d1aecbc2200055a5.tar.gz |
refactor(el3_runtime): introduce save_x30 macro
Most of the macros/routine in vector entry need a free scratch register.
Introduce a macro "save_x30" and call it right at the begining of vector
entries where x30 is used. It is more exlicit and less error prone
Signed-off-by: Manish Pandey <manish.pandey2@arm.com>
Change-Id: I617f3d41a120739e5e3fe1c421c79ceb70c1188e
Diffstat (limited to 'include/arch')
-rw-r--r-- | include/arch/aarch64/el2_common_macros.S | 9 | ||||
-rw-r--r-- | include/arch/aarch64/el3_common_macros.S | 9 |
2 files changed, 8 insertions, 10 deletions
diff --git a/include/arch/aarch64/el2_common_macros.S b/include/arch/aarch64/el2_common_macros.S index 7bf480698..b3b85e67e 100644 --- a/include/arch/aarch64/el2_common_macros.S +++ b/include/arch/aarch64/el2_common_macros.S @@ -384,13 +384,12 @@ .macro apply_at_speculative_wa #if ERRATA_SPECULATIVE_AT /* - * Explicitly save x30 so as to free up a register and to enable - * branching and also, save x29 which will be used in the called - * function + * This function expects x30 has been saved. + * Also, save x29 which will be used in the called function. */ - stp x29, x30, [sp, #CTX_GPREGS_OFFSET + CTX_GPREG_X29] + str x29, [sp, #CTX_GPREGS_OFFSET + CTX_GPREG_X29] bl save_and_update_ptw_el1_sys_regs - ldp x29, x30, [sp, #CTX_GPREGS_OFFSET + CTX_GPREG_X29] + ldr x29, [sp, #CTX_GPREGS_OFFSET + CTX_GPREG_X29] #endif .endm diff --git a/include/arch/aarch64/el3_common_macros.S b/include/arch/aarch64/el3_common_macros.S index de2b931af..40ff05668 100644 --- a/include/arch/aarch64/el3_common_macros.S +++ b/include/arch/aarch64/el3_common_macros.S @@ -532,13 +532,12 @@ .macro apply_at_speculative_wa #if ERRATA_SPECULATIVE_AT /* - * Explicitly save x30 so as to free up a register and to enable - * branching and also, save x29 which will be used in the called - * function + * This function expects x30 has been saved. + * Also, save x29 which will be used in the called function. */ - stp x29, x30, [sp, #CTX_GPREGS_OFFSET + CTX_GPREG_X29] + str x29, [sp, #CTX_GPREGS_OFFSET + CTX_GPREG_X29] bl save_and_update_ptw_el1_sys_regs - ldp x29, x30, [sp, #CTX_GPREGS_OFFSET + CTX_GPREG_X29] + ldr x29, [sp, #CTX_GPREGS_OFFSET + CTX_GPREG_X29] #endif .endm |