summaryrefslogtreecommitdiff
path: root/hw/mips
diff options
context:
space:
mode:
authorAndreas Färber <afaerber@suse.de>2015-09-19 10:49:44 +0200
committerAndreas Färber <afaerber@suse.de>2015-09-19 16:40:27 +0200
commit8a661aea0e7f6e776c6ebc9abe339a85b34fea1d (patch)
treebdb4040a63f38d86d8c84157b60d71a84927ebb7 /hw/mips
parente264d29de28c5b0be3d063307ce9fb613b427cc3 (diff)
Revert use of DEFINE_MACHINE() for registrations of multiple machines
The script used for converting from QEMUMachine had used one DEFINE_MACHINE() per machine registered. In cases where multiple machines are registered from one source file, avoid the excessive generation of module init functions by reverting this unrolling. Signed-off-by: Andreas Färber <afaerber@suse.de>
Diffstat (limited to 'hw/mips')
-rw-r--r--hw/mips/mips_jazz.c28
1 files changed, 24 insertions, 4 deletions
diff --git a/hw/mips/mips_jazz.c b/hw/mips/mips_jazz.c
index d3627ba9b6..1ab885bb3f 100644
--- a/hw/mips/mips_jazz.c
+++ b/hw/mips/mips_jazz.c
@@ -349,20 +349,40 @@ void mips_pica61_init(MachineState *machine)
mips_jazz_init(machine, JAZZ_PICA61);
}
-static void mips_magnum_machine_init(MachineClass *mc)
+static void mips_magnum_class_init(ObjectClass *oc, void *data)
{
+ MachineClass *mc = MACHINE_CLASS(oc);
+
mc->desc = "MIPS Magnum";
mc->init = mips_magnum_init;
mc->block_default_type = IF_SCSI;
}
-DEFINE_MACHINE("magnum", mips_magnum_machine_init)
+static const TypeInfo mips_magnum_type = {
+ .name = MACHINE_TYPE_NAME("magnum"),
+ .parent = TYPE_MACHINE,
+ .class_init = mips_magnum_class_init,
+};
-static void mips_pica61_machine_init(MachineClass *mc)
+static void mips_pica61_class_init(ObjectClass *oc, void *data)
{
+ MachineClass *mc = MACHINE_CLASS(oc);
+
mc->desc = "Acer Pica 61";
mc->init = mips_pica61_init;
mc->block_default_type = IF_SCSI;
}
-DEFINE_MACHINE("pica61", mips_pica61_machine_init)
+static const TypeInfo mips_pica61_type = {
+ .name = MACHINE_TYPE_NAME("pica61"),
+ .parent = TYPE_MACHINE,
+ .class_init = mips_pica61_class_init,
+};
+
+static void mips_jazz_machine_init(void)
+{
+ type_register_static(&mips_magnum_type);
+ type_register_static(&mips_pica61_type);
+}
+
+machine_init(mips_jazz_machine_init)