From c3ae85fc8f36b64fb73038214e4359f1e470d169 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Fri, 4 Mar 2016 11:30:19 +0000 Subject: linux-user: arm: handle CPSR.E correctly in strex emulation Now that CPSR.E is set correctly, prepare for when setend will be able to change it; bswap data in and out of strex manually by comparing SCTLR.B, CPSR.E and TARGET_WORDS_BIGENDIAN (we do not have the luxury of using TCGMemOps). Signed-off-by: Paolo Bonzini [ PC changes: * Moved SCTLR/CPSR logic to arm_cpu_data_is_big_endian ] Signed-off-by: Peter Crosthwaite Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell --- target-arm/cpu.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'target-arm') diff --git a/target-arm/cpu.h b/target-arm/cpu.h index ab0ea92baf..cbf171cc23 100644 --- a/target-arm/cpu.h +++ b/target-arm/cpu.h @@ -2102,6 +2102,17 @@ static inline int fp_exception_el(CPUARMState *env) return 0; } +#ifdef CONFIG_USER_ONLY +static inline bool arm_cpu_bswap_data(CPUARMState *env) +{ + return +#ifdef TARGET_WORDS_BIGENDIAN + 1 ^ +#endif + arm_cpu_data_is_big_endian(env); +} +#endif + static inline void cpu_get_tb_cpu_state(CPUARMState *env, target_ulong *pc, target_ulong *cs_base, int *flags) { -- cgit v1.2.3-55-g7522