[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v6 15/19] mac_newworld: Add machine types for different mac99 con
From: |
BALATON Zoltan |
Subject: |
[PATCH v6 15/19] mac_newworld: Add machine types for different mac99 configs |
Date: |
Fri, 28 Oct 2022 13:56:31 +0200 (CEST) |
The mac99 machine emulates different machines depending on machine
properties or even if it is run as qemu-system-ppc64 or
qemu-system-ppc. This is very confusing for users and many hours were
lost trying to explain it or finding out why commands users came up
with are not working as expected. (E.g. Windows users might think
qemu-system-ppc64 is just the 64 bit version of qemu-system-ppc and
then fail to boot a 32 bit OS with -M mac99 trying to follow an
example that had qemu-system-ppc.) To avoid such confusion, add
explicit machine types for the different configs which will work the
same with both qemu-system-ppc and qemu-system-ppc64 and also make the
command line clearer for new users.
Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
---
hw/ppc/mac_newworld.c | 94 +++++++++++++++++++++++++++++++++++++++++++
1 file changed, 94 insertions(+)
diff --git a/hw/ppc/mac_newworld.c b/hw/ppc/mac_newworld.c
index 601ea518f8..50b783d851 100644
--- a/hw/ppc/mac_newworld.c
+++ b/hw/ppc/mac_newworld.c
@@ -649,9 +649,103 @@ static const TypeInfo core99_machine_info = {
},
};
+static void powermac3_1_machine_class_init(ObjectClass *oc, void *data)
+{
+ MachineClass *mc = MACHINE_CLASS(oc);
+
+ core99_machine_class_init(oc, data);
+ mc->desc = "Apple Power Mac G4 AGP (Sawtooth)";
+ mc->default_cpu_type = POWERPC_CPU_TYPE_NAME("7400_v2.9");
+}
+
+static void powermac3_1_instance_init(Object *obj)
+{
+ Core99MachineState *cms = CORE99_MACHINE(obj);
+
+ cms->via_config = CORE99_VIA_CONFIG_PMU;
+ return;
+}
+
+static const TypeInfo powermac3_1_machine_info = {
+ .name = MACHINE_TYPE_NAME("powermac3_1"),
+ .parent = TYPE_MACHINE,
+ .class_init = powermac3_1_machine_class_init,
+ .instance_init = powermac3_1_instance_init,
+ .instance_size = sizeof(Core99MachineState),
+ .interfaces = (InterfaceInfo[]) {
+ { TYPE_FW_PATH_PROVIDER },
+ { }
+ },
+};
+
+static void powerbook3_2_machine_class_init(ObjectClass *oc, void *data)
+{
+ MachineClass *mc = MACHINE_CLASS(oc);
+
+ core99_machine_class_init(oc, data);
+ mc->desc = "Apple PowerBook G4 Titanium (Mercury)";
+ mc->default_cpu_type = POWERPC_CPU_TYPE_NAME("7400_v2.9");
+}
+
+static void powerbook3_2_instance_init(Object *obj)
+{
+ Core99MachineState *cms = CORE99_MACHINE(obj);
+
+ cms->via_config = CORE99_VIA_CONFIG_PMU_ADB;
+ return;
+}
+
+static const TypeInfo powerbook3_2_machine_info = {
+ .name = MACHINE_TYPE_NAME("powerbook3_2"),
+ .parent = TYPE_MACHINE,
+ .class_init = powerbook3_2_machine_class_init,
+ .instance_init = powerbook3_2_instance_init,
+ .instance_size = sizeof(Core99MachineState),
+ .interfaces = (InterfaceInfo[]) {
+ { TYPE_FW_PATH_PROVIDER },
+ { }
+ },
+};
+
+#ifdef TARGET_PPC64
+static void powermac7_3_machine_class_init(ObjectClass *oc, void *data)
+{
+ MachineClass *mc = MACHINE_CLASS(oc);
+
+ core99_machine_class_init(oc, data);
+ mc->desc = "Apple Power Mac G5 (Niagara)";
+ mc->default_cpu_type = POWERPC_CPU_TYPE_NAME("970fx_v3.1");
+}
+
+static void powermac7_3_instance_init(Object *obj)
+{
+ Core99MachineState *cms = CORE99_MACHINE(obj);
+
+ cms->via_config = CORE99_VIA_CONFIG_PMU;
+ return;
+}
+
+static const TypeInfo powermac7_3_machine_info = {
+ .name = MACHINE_TYPE_NAME("powermac7_3"),
+ .parent = TYPE_MACHINE,
+ .class_init = powermac7_3_machine_class_init,
+ .instance_init = powermac7_3_instance_init,
+ .instance_size = sizeof(Core99MachineState),
+ .interfaces = (InterfaceInfo[]) {
+ { TYPE_FW_PATH_PROVIDER },
+ { }
+ },
+};
+#endif
+
static void mac_machine_register_types(void)
{
type_register_static(&core99_machine_info);
+ type_register_static(&powermac3_1_machine_info);
+ type_register_static(&powerbook3_2_machine_info);
+#ifdef TARGET_PPC64
+ type_register_static(&powermac7_3_machine_info);
+#endif
}
type_init(mac_machine_register_types)
--
2.30.6
- Re: [PATCH v6 04/19] mac_{old|new}world: Avoid else branch by setting default value, (continued)
- [PATCH v6 06/19] mac_{old|new}world: Reduce number of QOM casts, BALATON Zoltan, 2022/10/28
- [PATCH v6 05/19] mac_newworld: Clean up creation of Uninorth devices, BALATON Zoltan, 2022/10/28
- [PATCH v6 14/19] mac_newworld: Turn CORE99_VIA_CONFIG defines into an enum, BALATON Zoltan, 2022/10/28
- [PATCH v6 16/19] mac_newworld: Deprecate mac99 with G5 CPU, BALATON Zoltan, 2022/10/28
- [PATCH v6 18/19] mac_newworld: Document deprecation, BALATON Zoltan, 2022/10/28
- [PATCH v6 09/19] hw/ppc/mac.h: Move grackle-pcihost type declaration out to a header, BALATON Zoltan, 2022/10/28
- [PATCH v6 12/19] mac_nvram: Use NVRAM_SIZE constant, BALATON Zoltan, 2022/10/28
- [PATCH v6 10/19] hw/ppc/mac.h: Move PROM and KERNEL defines to board code, BALATON Zoltan, 2022/10/28
- [PATCH v6 15/19] mac_newworld: Add machine types for different mac99 configs,
BALATON Zoltan <=
- [PATCH v6 19/19] mac_{old, new}world: Pass MacOS VGA NDRV in card ROM instead of fw_cfg, BALATON Zoltan, 2022/10/28
- [PATCH v6 17/19] mac_newworld: Deprecate mac99 "via" option, BALATON Zoltan, 2022/10/28
- [PATCH v6 07/19] hw/ppc/mac.h: Move newworld specific parts out from shared header, BALATON Zoltan, 2022/10/28
- [PATCH v6 11/19] hw/ppc/mac.h: Rename to include/hw/nvram/mac_nvram.h, BALATON Zoltan, 2022/10/28
- [PATCH v6 13/19] mac_{old|new}world: Code style fix adding missing braces to if-s, BALATON Zoltan, 2022/10/28
- [PATCH v6 08/19] hw/ppc/mac.h: Move macio specific parts out from shared header, BALATON Zoltan, 2022/10/28
- Re: [PATCH v6 00/19] Misc ppc/mac machines clean up, Mark Cave-Ayland, 2022/10/30