target: Set disassemble_info::endian value for little-endian targets
authorPhilippe Mathieu-Daudé <philmd@linaro.org>
Sun, 26 Jan 2025 13:36:56 +0000 (14:36 +0100)
committerPhilippe Mathieu-Daudé <philmd@linaro.org>
Thu, 6 Mar 2025 14:46:18 +0000 (15:46 +0100)
Have the CPUClass::disas_set_info() callback set the
disassemble_info::endian field for little-endian targets.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20250210212931.62401-2-philmd@linaro.org>

target/alpha/cpu.c
target/avr/cpu.c
target/hexagon/cpu.c
target/i386/cpu.c
target/loongarch/cpu.c
target/rx/cpu.c

index 57e41fcd784a8ecc07fe50358a3c2c0bf08ee07b..2eabd7724df3505525c28a168119a581fbe39df4 100644 (file)
@@ -85,6 +85,7 @@ static int alpha_cpu_mmu_index(CPUState *cs, bool ifetch)
 
 static void alpha_cpu_disas_set_info(CPUState *cpu, disassemble_info *info)
 {
+    info->endian = BFD_ENDIAN_LITTLE;
     info->mach = bfd_mach_alpha_ev6;
     info->print_insn = print_insn_alpha;
 }
index 5a0e21465e5ecc2c4918d5967bc2ce4c1ae48b11..2871d30540a40879ea45c6082ee82b02e0bb9f08 100644 (file)
@@ -102,6 +102,7 @@ static void avr_cpu_reset_hold(Object *obj, ResetType type)
 
 static void avr_cpu_disas_set_info(CPUState *cpu, disassemble_info *info)
 {
+    info->endian = BFD_ENDIAN_LITTLE;
     info->mach = bfd_arch_avr;
     info->print_insn = avr_print_insn;
 }
index 238e63bcea424e897e32a091dfccfd3c256abb9b..a9beb9a17572e351cf8ca60e19d990b19beb68d5 100644 (file)
@@ -293,6 +293,7 @@ static void hexagon_cpu_reset_hold(Object *obj, ResetType type)
 static void hexagon_cpu_disas_set_info(CPUState *s, disassemble_info *info)
 {
     info->print_insn = print_insn_hexagon;
+    info->endian = BFD_ENDIAN_LITTLE;
 }
 
 static void hexagon_cpu_realize(DeviceState *dev, Error **errp)
index 0cd9b70938d78082a6def2a8b4e3c4f50fd018a8..ab328485acce4a300be8c5edec8dd4c7d50e7292 100644 (file)
@@ -8691,6 +8691,7 @@ static void x86_disas_set_info(CPUState *cs, disassemble_info *info)
     X86CPU *cpu = X86_CPU(cs);
     CPUX86State *env = &cpu->env;
 
+    info->endian = BFD_ENDIAN_LITTLE;
     info->mach = (env->hflags & HF_CS64_MASK ? bfd_mach_x86_64
                   : env->hflags & HF_CS32_MASK ? bfd_mach_i386_i386
                   : bfd_mach_i386_i8086);
index b4b82425b18c7a7ca9c928feaeba71382169ba4b..d2e739a029f6e09371b5707572b0159367e6307b 100644 (file)
@@ -624,6 +624,7 @@ static void loongarch_cpu_reset_hold(Object *obj, ResetType type)
 
 static void loongarch_cpu_disas_set_info(CPUState *s, disassemble_info *info)
 {
+    info->endian = BFD_ENDIAN_LITTLE;
     info->print_insn = print_insn_loongarch;
 }
 
index 17ede51cd11c37138bbac4470de9555209fd2a78..1c40c8977e76e40c1a643bf2a8a59aff5d11bcab 100644 (file)
@@ -168,6 +168,7 @@ static void rx_cpu_set_irq(void *opaque, int no, int request)
 
 static void rx_cpu_disas_set_info(CPUState *cpu, disassemble_info *info)
 {
+    info->endian = BFD_ENDIAN_LITTLE;
     info->mach = bfd_mach_rx;
     info->print_insn = print_insn_rx;
 }