@@ -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;
@@ -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;
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(-)