diff mbox series

[RFC,13/18] hw/xtensa/sim: Replace TARGET_BIG_ENDIAN by legacy_binary_is_big_endian

Message ID 20250305153929.43687-14-philmd@linaro.org
State New
Headers show
Series hw/microblaze: Quick single binary proof of concept | expand

Commit Message

Philippe Mathieu-Daudé March 5, 2025, 3:39 p.m. UTC
For legacy binaries, legacy_binary_is_big_endian() is
equivalent of the compile time TARGET_BIG_ENDIAN definition.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 hw/xtensa/sim.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/hw/xtensa/sim.c b/hw/xtensa/sim.c
index 1cea29c66d4..cd7c6014c3b 100644
--- a/hw/xtensa/sim.c
+++ b/hw/xtensa/sim.c
@@ -26,6 +26,7 @@ 
  */
 
 #include "qemu/osdep.h"
+#include "qemu/legacy_binary_info.h"
 #include "qapi/error.h"
 #include "system/reset.h"
 #include "system/system.h"
@@ -101,7 +102,8 @@  void xtensa_sim_load_kernel(XtensaCPU *cpu, MachineState *machine)
         uint64_t elf_entry;
         int success = load_elf(kernel_filename, NULL, translate_phys_addr, cpu,
                                &elf_entry, NULL, NULL, NULL,
-                               TARGET_BIG_ENDIAN ? ELFDATA2MSB : ELFDATA2LSB,
+                               legacy_binary_is_big_endian() ? ELFDATA2MSB
+                                                             : ELFDATA2LSB,
                                EM_XTENSA, 0, 0);
 
         if (success > 0) {