hw/arm/sabrelite: Open code DEFINE_MACHINE_ARM
Open code the DEFINE_MACHINE_ARM macro in preparation of creating SabreliteMachineState class. Signed-off-by: Matyáš Bobek <matyas.bobek@gmail.com> Signed-off-by: Pavel Pisa <pisa@fel.cvut.cz> Tested-by: Pavel Pisa <pisa@fel.cvut.cz> Reviewed-by: Bernhard Beschow <shentey@gmail.com> Reviewed-by: Pavel Pisa <pisa@fel.cvut.cz> Message-id: 629d00a1d8712dbf293fb13ac1a02bf80f6334ca.1782140438.git.matyas.bobek@gmail.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Matyáš Bobek committed
Jun 22, 2026 at 18:08 UTC
1cd538209a64b833b49063ecfbdf02be2acf4084
1 file changed
+18
-2
hw/arm/sabrelite.c
+18
-2
@@ -104,8 +104,10 @@ static void sabrelite_init(MachineState *machine)
104
}
105
}
106
107
-static void sabrelite_machine_init(MachineClass *mc)
107
+static void sabrelite_machine_class_init(ObjectClass *oc, const void *data)
108
{
109
+ MachineClass *mc = MACHINE_CLASS(oc);
110
+
111
mc->desc = "Freescale i.MX6 Quad SABRE Lite Board (Cortex-A9)";
112
mc->init = sabrelite_init;
113
mc->max_cpus = FSL_IMX6_NUM_CPUS;
@@ -114,4 +116,18 @@ static void sabrelite_machine_init(MachineClass *mc)
116
mc->auto_create_sdcard = true;
117
}
118
117
-DEFINE_MACHINE_ARM("sabrelite", sabrelite_machine_init)
119
+static const TypeInfo sabrelite_machine_init_typeinfo = {
120
+ .name = MACHINE_TYPE_NAME("sabrelite"),
121
+ .parent = TYPE_MACHINE,
122
+ .class_init = sabrelite_machine_class_init,
123
+ .instance_size = sizeof(MachineState),
124
+ .abstract = false,
125
+ .interfaces = arm_machine_interfaces,
126
+};
127
+
128
+static void sabrelite_machine_init_register_types(void)
129
+{
130
+ type_register_static(&sabrelite_machine_init_typeinfo);
131
+}
132
+
133
+type_init(sabrelite_machine_init_register_types)