diff options
author | Andreas Färber | 2015-09-19 10:49:44 +0200 |
---|---|---|
committer | Andreas Färber | 2015-09-19 16:40:27 +0200 |
commit | 8a661aea0e7f6e776c6ebc9abe339a85b34fea1d (patch) | |
tree | bdb4040a63f38d86d8c84157b60d71a84927ebb7 /hw/arm/omap_sx1.c | |
parent | Use DEFINE_MACHINE() to register all machines (diff) | |
download | qemu-8a661aea0e7f6e776c6ebc9abe339a85b34fea1d.tar.gz qemu-8a661aea0e7f6e776c6ebc9abe339a85b34fea1d.tar.xz qemu-8a661aea0e7f6e776c6ebc9abe339a85b34fea1d.zip |
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/omap_sx1.c')
-rw-r--r-- | hw/arm/omap_sx1.c | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/hw/arm/omap_sx1.c b/hw/arm/omap_sx1.c index 68924fc663..8eaf8f3315 100644 --- a/hw/arm/omap_sx1.c +++ b/hw/arm/omap_sx1.c @@ -217,18 +217,38 @@ static void sx1_init_v2(MachineState *machine) sx1_init(machine, 2); } -static void sx1_machine_v2_machine_init(MachineClass *mc) +static void sx1_machine_v2_class_init(ObjectClass *oc, void *data) { + MachineClass *mc = MACHINE_CLASS(oc); + mc->desc = "Siemens SX1 (OMAP310) V2"; mc->init = sx1_init_v2; } -DEFINE_MACHINE("sx1", sx1_machine_v2_machine_init) +static const TypeInfo sx1_machine_v2_type = { + .name = MACHINE_TYPE_NAME("sx1"), + .parent = TYPE_MACHINE, + .class_init = sx1_machine_v2_class_init, +}; -static void sx1_machine_v1_machine_init(MachineClass *mc) +static void sx1_machine_v1_class_init(ObjectClass *oc, void *data) { + MachineClass *mc = MACHINE_CLASS(oc); + mc->desc = "Siemens SX1 (OMAP310) V1"; mc->init = sx1_init_v1; } -DEFINE_MACHINE("sx1-v1", sx1_machine_v1_machine_init) +static const TypeInfo sx1_machine_v1_type = { + .name = MACHINE_TYPE_NAME("sx1-v1"), + .parent = TYPE_MACHINE, + .class_init = sx1_machine_v1_class_init, +}; + +static void sx1_machine_init(void) +{ + type_register_static(&sx1_machine_v1_type); + type_register_static(&sx1_machine_v2_type); +} + +machine_init(sx1_machine_init) |