diff mbox series

[RFC,07/18] hw/mips/malta: Replace TARGET_MIPS64 by legacy_binary_is_64bit()

Message ID 20250305153929.43687-8-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 MIPS binaries, legacy_binary_is_64bit() is
equivalent of the compile time TARGET_MIPS64 definition.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 hw/mips/malta.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
diff mbox series

Patch

diff --git a/hw/mips/malta.c b/hw/mips/malta.c
index 8e9cea70b13..3517e437f26 100644
--- a/hw/mips/malta.c
+++ b/hw/mips/malta.c
@@ -26,6 +26,7 @@ 
 #include "qemu/units.h"
 #include "qemu/bitops.h"
 #include "qemu/datadir.h"
+#include "qemu/legacy_binary_info.h"
 #include "qemu/cutils.h"
 #include "qemu/guest-random.h"
 #include "exec/tswap.h"
@@ -1300,11 +1301,8 @@  static void mips_malta_machine_init(MachineClass *mc)
     mc->block_default_type = IF_IDE;
     mc->max_cpus = 16;
     mc->is_default = true;
-#ifdef TARGET_MIPS64
-    mc->default_cpu_type = MIPS_CPU_TYPE_NAME("20Kc");
-#else
-    mc->default_cpu_type = MIPS_CPU_TYPE_NAME("24Kf");
-#endif
+    mc->default_cpu_type = legacy_binary_is_64bit() ? MIPS_CPU_TYPE_NAME("20Kc")
+                                                    : MIPS_CPU_TYPE_NAME("24Kf");
     mc->default_ram_id = "mips_malta.ram";
     compat_props_add(mc->compat_props, malta_compat, malta_compat_len);
 }