mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 16:23:55 -06:00
target/arm: Move BE32 disassembler fixup
The Capstone disassembler has its own big-endian fixup. Doing this twice does not work, of course. Move our current fixup from target/arm/cpu.c to disas/arm.c. This makes read_memory_inner_func unused and can be removed. Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
parent
0eea8cdd6d
commit
6cd61517fb
3 changed files with 16 additions and 31 deletions
|
@ -473,21 +473,6 @@ print_insn_thumb1(bfd_vma pc, disassemble_info *info)
|
|||
return print_insn_arm(pc | 1, info);
|
||||
}
|
||||
|
||||
static int arm_read_memory_func(bfd_vma memaddr, bfd_byte *b,
|
||||
int length, struct disassemble_info *info)
|
||||
{
|
||||
assert(info->read_memory_inner_func);
|
||||
assert((info->flags & INSN_ARM_BE32) == 0 || length == 2 || length == 4);
|
||||
|
||||
if ((info->flags & INSN_ARM_BE32) != 0 && length == 2) {
|
||||
assert(info->endian == BFD_ENDIAN_LITTLE);
|
||||
return info->read_memory_inner_func(memaddr ^ 2, (bfd_byte *)b, 2,
|
||||
info);
|
||||
} else {
|
||||
return info->read_memory_inner_func(memaddr, b, length, info);
|
||||
}
|
||||
}
|
||||
|
||||
static void arm_disas_set_info(CPUState *cpu, disassemble_info *info)
|
||||
{
|
||||
ARMCPU *ac = ARM_CPU(cpu);
|
||||
|
@ -513,10 +498,6 @@ static void arm_disas_set_info(CPUState *cpu, disassemble_info *info)
|
|||
info->endian = BFD_ENDIAN_BIG;
|
||||
#endif
|
||||
}
|
||||
if (info->read_memory_inner_func == NULL) {
|
||||
info->read_memory_inner_func = info->read_memory_func;
|
||||
info->read_memory_func = arm_read_memory_func;
|
||||
}
|
||||
info->flags &= ~INSN_ARM_BE32;
|
||||
if (arm_sctlr_b(env)) {
|
||||
info->flags |= INSN_ARM_BE32;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue