Skip to content

Commit 44ab8c2

Browse files
committed
target/arm: Add cpu local variable to exception_return helper
We already call env_archcpu() multiple times within the exception_return helper function, and we're about to want to add another use of the ARMCPU pointer. Add a local variable cpu so we can call env_archcpu() just once. Signed-off-by: Peter Maydell <[email protected]> Reviewed-by: Richard Henderson <[email protected]>
1 parent 39ec3fc commit 44ab8c2

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

target/arm/tcg/helper-a64.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -631,6 +631,7 @@ static void cpsr_write_from_spsr_elx(CPUARMState *env,
631631

632632
void HELPER(exception_return)(CPUARMState *env, uint64_t new_pc)
633633
{
634+
ARMCPU *cpu = env_archcpu(env);
634635
int cur_el = arm_current_el(env);
635636
unsigned int spsr_idx = aarch64_banked_spsr_index(cur_el);
636637
uint32_t spsr = env->banked_spsr[spsr_idx];
@@ -682,7 +683,7 @@ void HELPER(exception_return)(CPUARMState *env, uint64_t new_pc)
682683
}
683684

684685
bql_lock();
685-
arm_call_pre_el_change_hook(env_archcpu(env));
686+
arm_call_pre_el_change_hook(cpu);
686687
bql_unlock();
687688

688689
if (!return_to_aa64) {
@@ -710,7 +711,7 @@ void HELPER(exception_return)(CPUARMState *env, uint64_t new_pc)
710711
int tbii;
711712

712713
env->aarch64 = true;
713-
spsr &= aarch64_pstate_valid_mask(&env_archcpu(env)->isar);
714+
spsr &= aarch64_pstate_valid_mask(&cpu->isar);
714715
pstate_write(env, spsr);
715716
if (!arm_singlestep_active(env)) {
716717
env->pstate &= ~PSTATE_SS;
@@ -749,7 +750,7 @@ void HELPER(exception_return)(CPUARMState *env, uint64_t new_pc)
749750
aarch64_sve_change_el(env, cur_el, new_el, return_to_aa64);
750751

751752
bql_lock();
752-
arm_call_el_change_hook(env_archcpu(env));
753+
arm_call_el_change_hook(cpu);
753754
bql_unlock();
754755

755756
return;

0 commit comments

Comments
 (0)