diff mbox series

[RFC,09/18] hw/ppc/mac: Replace TARGET_PPC64 by legacy_binary_is_64bit()

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

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 hw/ppc/mac_newworld.c | 9 ++++-----
 hw/ppc/mac_oldworld.c | 5 ++---
 2 files changed, 6 insertions(+), 8 deletions(-)
diff mbox series

Patch

diff --git a/hw/ppc/mac_newworld.c b/hw/ppc/mac_newworld.c
index cb3dc3ab482..60cca313b10 100644
--- a/hw/ppc/mac_newworld.c
+++ b/hw/ppc/mac_newworld.c
@@ -49,6 +49,7 @@ 
 #include "qemu/osdep.h"
 #include "qemu/datadir.h"
 #include "qemu/units.h"
+#include "qemu/legacy_binary_info.h"
 #include "qapi/error.h"
 #include "hw/ppc/ppc.h"
 #include "hw/qdev-properties.h"
@@ -581,11 +582,9 @@  static void core99_machine_class_init(ObjectClass *oc, void *data)
     mc->default_display = "std";
     mc->default_nic = "sungem";
     mc->kvm_type = core99_kvm_type;
-#ifdef TARGET_PPC64
-    mc->default_cpu_type = POWERPC_CPU_TYPE_NAME("970fx_v3.1");
-#else
-    mc->default_cpu_type = POWERPC_CPU_TYPE_NAME("7400_v2.9");
-#endif
+    mc->default_cpu_type = legacy_binary_is_64bit()
+                           ? POWERPC_CPU_TYPE_NAME("970fx_v3.1")
+                           : POWERPC_CPU_TYPE_NAME("7400_v2.9");
     mc->default_ram_id = "ppc_core99.ram";
     mc->ignore_boot_device_suffixes = true;
     fwc->get_dev_path = core99_fw_dev_path;
diff --git a/hw/ppc/mac_oldworld.c b/hw/ppc/mac_oldworld.c
index 0dbcea035c3..a8515778e2d 100644
--- a/hw/ppc/mac_oldworld.c
+++ b/hw/ppc/mac_oldworld.c
@@ -27,6 +27,7 @@ 
 #include "qemu/osdep.h"
 #include "qemu/datadir.h"
 #include "qemu/units.h"
+#include "qemu/legacy_binary_info.h"
 #include "qapi/error.h"
 #include "hw/ppc/ppc.h"
 #include "hw/qdev-properties.h"
@@ -416,9 +417,7 @@  static void heathrow_class_init(ObjectClass *oc, void *data)
     mc->block_default_type = IF_IDE;
     /* SMP is not supported currently */
     mc->max_cpus = 1;
-#ifndef TARGET_PPC64
-    mc->is_default = true;
-#endif
+    mc->is_default = !legacy_binary_is_64bit();
     /* TOFIX "cad" when Mac floppy is implemented */
     mc->default_boot_order = "cd";
     mc->kvm_type = heathrow_kvm_type;