From 8a661aea0e7f6e776c6ebc9abe339a85b34fea1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Sat, 19 Sep 2015 10:49:44 +0200 Subject: Revert use of DEFINE_MACHINE() for registrations of multiple machines MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- hw/arm/highbank.c | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) (limited to 'hw/arm/highbank.c') diff --git a/hw/arm/highbank.c b/hw/arm/highbank.c index 9b2887ef6f..be04b27230 100644 --- a/hw/arm/highbank.c +++ b/hw/arm/highbank.c @@ -391,22 +391,42 @@ static void midway_init(MachineState *machine) calxeda_init(machine, CALXEDA_MIDWAY); } -static void highbank_machine_init(MachineClass *mc) +static void highbank_class_init(ObjectClass *oc, void *data) { + MachineClass *mc = MACHINE_CLASS(oc); + mc->desc = "Calxeda Highbank (ECX-1000)"; mc->init = highbank_init; mc->block_default_type = IF_SCSI; mc->max_cpus = 4; } -DEFINE_MACHINE("highbank", highbank_machine_init) +static const TypeInfo highbank_type = { + .name = MACHINE_TYPE_NAME("highbank"), + .parent = TYPE_MACHINE, + .class_init = highbank_class_init, +}; -static void midway_machine_init(MachineClass *mc) +static void midway_class_init(ObjectClass *oc, void *data) { + MachineClass *mc = MACHINE_CLASS(oc); + mc->desc = "Calxeda Midway (ECX-2000)"; mc->init = midway_init; mc->block_default_type = IF_SCSI; mc->max_cpus = 4; } -DEFINE_MACHINE("midway", midway_machine_init) +static const TypeInfo midway_type = { + .name = MACHINE_TYPE_NAME("midway"), + .parent = TYPE_MACHINE, + .class_init = midway_class_init, +}; + +static void calxeda_machines_init(void) +{ + type_register_static(&highbank_type); + type_register_static(&midway_type); +} + +machine_init(calxeda_machines_init) -- cgit v1.2.1