target/arm: fetch code with translator_ld
Now the arm_ld*_code functions are only used at translate time we can just pass down to translator_ld functions. Signed-off-by: Emilio G. Cota <cota@braap.org> [AJB: convert from plugin_insn_append to translator_ld] Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
parent
409c1a0bf0
commit
ae82adc8e2
@ -20,25 +20,20 @@
|
||||
#ifndef ARM_LDST_H
|
||||
#define ARM_LDST_H
|
||||
|
||||
#include "exec/cpu_ldst.h"
|
||||
#include "exec/translator.h"
|
||||
#include "qemu/bswap.h"
|
||||
|
||||
/* Load an instruction and return it in the standard little-endian order */
|
||||
static inline uint32_t arm_ldl_code(CPUARMState *env, target_ulong addr,
|
||||
bool sctlr_b)
|
||||
{
|
||||
uint32_t insn = cpu_ldl_code(env, addr);
|
||||
if (bswap_code(sctlr_b)) {
|
||||
return bswap32(insn);
|
||||
}
|
||||
return insn;
|
||||
return translator_ldl_swap(env, addr, bswap_code(sctlr_b));
|
||||
}
|
||||
|
||||
/* Ditto, for a halfword (Thumb) instruction */
|
||||
static inline uint16_t arm_lduw_code(CPUARMState *env, target_ulong addr,
|
||||
bool sctlr_b)
|
||||
{
|
||||
uint16_t insn;
|
||||
#ifndef CONFIG_USER_ONLY
|
||||
/* In big-endian (BE32) mode, adjacent Thumb instructions have been swapped
|
||||
within each word. Undo that now. */
|
||||
@ -46,11 +41,7 @@ static inline uint16_t arm_lduw_code(CPUARMState *env, target_ulong addr,
|
||||
addr ^= 2;
|
||||
}
|
||||
#endif
|
||||
insn = cpu_lduw_code(env, addr);
|
||||
if (bswap_code(sctlr_b)) {
|
||||
return bswap16(insn);
|
||||
}
|
||||
return insn;
|
||||
return translator_lduw_swap(env, addr, bswap_code(sctlr_b));
|
||||
}
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user