target: Set disassemble_info::endian value for big-endian targets
authorPhilippe Mathieu-Daudé <philmd@linaro.org>
Sun, 26 Jan 2025 13:37:18 +0000 (14:37 +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 big-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-3-philmd@linaro.org>

target/hppa/cpu.c
target/m68k/cpu.c
target/openrisc/cpu.c
target/s390x/cpu.c
target/sparc/cpu.c

index 4bb5cff624e9223f966ff2abc9c056532d461886..d15f8c9c2172bbe6d7bb6919b504ebd73e317352 100644 (file)
@@ -150,6 +150,7 @@ static int hppa_cpu_mmu_index(CPUState *cs, bool ifetch)
 static void hppa_cpu_disas_set_info(CPUState *cs, disassemble_info *info)
 {
     info->mach = bfd_mach_hppa20;
+    info->endian = BFD_ENDIAN_BIG;
     info->print_insn = print_insn_hppa;
 }
 
index eedda07c2ab4d76ad4b81688f645ce8402ac53a0..df8b9c53fca03fb058b92d5fec8ebba3d12e2e64 100644 (file)
@@ -157,6 +157,7 @@ static void m68k_cpu_reset_hold(Object *obj, ResetType type)
 static void m68k_cpu_disas_set_info(CPUState *s, disassemble_info *info)
 {
     info->print_insn = print_insn_m68k;
+    info->endian = BFD_ENDIAN_BIG;
     info->mach = 0;
 }
 
index 785b065b513d081fd217747d465e8236d1e4efc4..e8c357ae83694c9619319cdde37636c13d1096b2 100644 (file)
@@ -83,6 +83,7 @@ static int openrisc_cpu_mmu_index(CPUState *cs, bool ifetch)
 
 static void openrisc_disas_set_info(CPUState *cpu, disassemble_info *info)
 {
+    info->endian = BFD_ENDIAN_BIG;
     info->print_insn = print_insn_or1k;
 }
 
index 3bea014f9ee9cac05ee4c1431e9f2d429a380955..972d265478d79b036637ee38c429a649d2fc0f8f 100644 (file)
@@ -243,6 +243,7 @@ static void s390_cpu_disas_set_info(CPUState *cpu, disassemble_info *info)
 {
     info->mach = bfd_mach_s390_64;
     info->cap_arch = CS_ARCH_SYSZ;
+    info->endian = BFD_ENDIAN_BIG;
     info->cap_insn_unit = 2;
     info->cap_insn_split = 6;
 }
index e3b46137178d3ec3d558a06b403f229df7f4b458..9fd222e4c82777aa19a9a8f554606563ee44d498 100644 (file)
@@ -106,6 +106,7 @@ static bool sparc_cpu_exec_interrupt(CPUState *cs, int interrupt_request)
 static void cpu_sparc_disas_set_info(CPUState *cpu, disassemble_info *info)
 {
     info->print_insn = print_insn_sparc;
+    info->endian = BFD_ENDIAN_BIG;
 #ifdef TARGET_SPARC64
     info->mach = bfd_mach_sparc_v9b;
 #endif