aboutsummaryrefslogtreecommitdiff
path: root/hw/arm/stellaris.c
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/arm/stellaris.c
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/arm/stellaris.c')
-rw-r--r--hw/arm/stellaris.c28
1 files changed, 24 insertions, 4 deletions
diff --git a/hw/arm/stellaris.c b/hw/arm/stellaris.c
index a97d9e3ef2..3d6486fcf5 100644
--- a/hw/arm/stellaris.c
+++ b/hw/arm/stellaris.c
@@ -1366,21 +1366,41 @@ static void lm3s6965evb_init(MachineState *machine)
stellaris_init(kernel_filename, cpu_model, &stellaris_boards[1]);
}
-static void lm3s811evb_machine_init(MachineClass *mc)
+static void lm3s811evb_class_init(ObjectClass *oc, void *data)
{
+ MachineClass *mc = MACHINE_CLASS(oc);
+
mc->desc = "Stellaris LM3S811EVB";
mc->init = lm3s811evb_init;
}
-DEFINE_MACHINE("lm3s811evb", lm3s811evb_machine_init)
+static const TypeInfo lm3s811evb_type = {
+ .name = MACHINE_TYPE_NAME("lm3s811evb"),
+ .parent = TYPE_MACHINE,
+ .class_init = lm3s811evb_class_init,
+};
-static void lm3s6965evb_machine_init(MachineClass *mc)
+static void lm3s6965evb_class_init(ObjectClass *oc, void *data)
{
+ MachineClass *mc = MACHINE_CLASS(oc);
+
mc->desc = "Stellaris LM3S6965EVB";
mc->init = lm3s6965evb_init;
}
-DEFINE_MACHINE("lm3s6965evb", lm3s6965evb_machine_init)
+static const TypeInfo lm3s6965evb_type = {
+ .name = MACHINE_TYPE_NAME("lm3s6965evb"),
+ .parent = TYPE_MACHINE,
+ .class_init = lm3s6965evb_class_init,
+};
+
+static void stellaris_machine_init(void)
+{
+ type_register_static(&lm3s811evb_type);
+ type_register_static(&lm3s6965evb_type);
+}
+
+machine_init(stellaris_machine_init)
static void stellaris_i2c_class_init(ObjectClass *klass, void *data)
{