mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
target/arm: Export cpsr_{read_for, write_from}_spsr_elx
Move cpsr_write_from_spsr_elx from tcg/helper-a64.c to helper.c, so that it's present with --disable-tcg. Declare both in internals.h. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-id: 20251008215613.300150-36-richard.henderson@linaro.org Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
committed by
Peter Maydell
parent
3476d935c3
commit
38f8b024d8
+19
-1
@@ -8896,7 +8896,7 @@ static int aarch64_regnum(CPUARMState *env, int aarch32_reg)
|
||||
}
|
||||
}
|
||||
|
||||
static uint32_t cpsr_read_for_spsr_elx(CPUARMState *env)
|
||||
uint32_t cpsr_read_for_spsr_elx(CPUARMState *env)
|
||||
{
|
||||
uint32_t ret = cpsr_read(env);
|
||||
|
||||
@@ -8911,6 +8911,24 @@ static uint32_t cpsr_read_for_spsr_elx(CPUARMState *env)
|
||||
return ret;
|
||||
}
|
||||
|
||||
void cpsr_write_from_spsr_elx(CPUARMState *env, uint32_t val)
|
||||
{
|
||||
uint32_t mask;
|
||||
|
||||
/* Save SPSR_ELx.SS into PSTATE. */
|
||||
env->pstate = (env->pstate & ~PSTATE_SS) | (val & PSTATE_SS);
|
||||
val &= ~PSTATE_SS;
|
||||
|
||||
/* Move DIT to the correct location for CPSR */
|
||||
if (val & PSTATE_DIT) {
|
||||
val &= ~PSTATE_DIT;
|
||||
val |= CPSR_DIT;
|
||||
}
|
||||
|
||||
mask = aarch32_cpsr_valid_mask(env->features, &env_archcpu(env)->isar);
|
||||
cpsr_write(env, val, mask, CPSRWriteRaw);
|
||||
}
|
||||
|
||||
static bool syndrome_is_sync_extabt(uint32_t syndrome)
|
||||
{
|
||||
/* Return true if this syndrome value is a synchronous external abort */
|
||||
|
||||
@@ -1897,6 +1897,8 @@ void vfp_clear_float_status_exc_flags(CPUARMState *env);
|
||||
*/
|
||||
void vfp_set_fpcr_to_host(CPUARMState *env, uint32_t val, uint32_t mask);
|
||||
bool arm_pan_enabled(CPUARMState *env);
|
||||
uint32_t cpsr_read_for_spsr_elx(CPUARMState *env);
|
||||
void cpsr_write_from_spsr_elx(CPUARMState *env, uint32_t val);
|
||||
|
||||
/* Compare uint64_t for qsort and bsearch. */
|
||||
int compare_u64(const void *a, const void *b);
|
||||
|
||||
@@ -615,26 +615,6 @@ static int el_from_spsr(uint32_t spsr)
|
||||
}
|
||||
}
|
||||
|
||||
static void cpsr_write_from_spsr_elx(CPUARMState *env,
|
||||
uint32_t val)
|
||||
{
|
||||
uint32_t mask;
|
||||
|
||||
/* Save SPSR_ELx.SS into PSTATE. */
|
||||
env->pstate = (env->pstate & ~PSTATE_SS) | (val & PSTATE_SS);
|
||||
val &= ~PSTATE_SS;
|
||||
|
||||
/* Move DIT to the correct location for CPSR */
|
||||
if (val & PSTATE_DIT) {
|
||||
val &= ~PSTATE_DIT;
|
||||
val |= CPSR_DIT;
|
||||
}
|
||||
|
||||
mask = aarch32_cpsr_valid_mask(env->features, \
|
||||
&env_archcpu(env)->isar);
|
||||
cpsr_write(env, val, mask, CPSRWriteRaw);
|
||||
}
|
||||
|
||||
void HELPER(exception_return)(CPUARMState *env, uint64_t new_pc)
|
||||
{
|
||||
ARMCPU *cpu = env_archcpu(env);
|
||||
|
||||
Reference in New Issue
Block a user