diff options
author | Andreas Färber <afaerber@suse.de> | 2015-09-19 10:49:44 +0200 |
---|---|---|
committer | Andreas Färber <afaerber@suse.de> | 2015-09-19 16:40:27 +0200 |
commit | 8a661aea0e7f6e776c6ebc9abe339a85b34fea1d (patch) | |
tree | bdb4040a63f38d86d8c84157b60d71a84927ebb7 /hw/arm/spitz.c | |
parent | e264d29de28c5b0be3d063307ce9fb613b427cc3 (diff) | |
download | qemu-8a661aea0e7f6e776c6ebc9abe339a85b34fea1d.zip qemu-8a661aea0e7f6e776c6ebc9abe339a85b34fea1d.tar.gz qemu-8a661aea0e7f6e776c6ebc9abe339a85b34fea1d.tar.bz2 |
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/spitz.c')
-rw-r--r-- | hw/arm/spitz.c | 50 |
1 files changed, 42 insertions, 8 deletions
diff --git a/hw/arm/spitz.c b/hw/arm/spitz.c index 0f59489..2af03be 100644 --- a/hw/arm/spitz.c +++ b/hw/arm/spitz.c @@ -972,37 +972,71 @@ static void terrier_init(MachineState *machine) spitz_common_init(machine, terrier, 0x33f); } -static void akitapda_machine_init(MachineClass *mc) +static void akitapda_class_init(ObjectClass *oc, void *data) { + MachineClass *mc = MACHINE_CLASS(oc); + mc->desc = "Akita PDA (PXA270)"; mc->init = akita_init; } -DEFINE_MACHINE("akita", akitapda_machine_init) +static const TypeInfo akitapda_type = { + .name = MACHINE_TYPE_NAME("akita"), + .parent = TYPE_MACHINE, + .class_init = akitapda_class_init, +}; -static void spitzpda_machine_init(MachineClass *mc) +static void spitzpda_class_init(ObjectClass *oc, void *data) { + MachineClass *mc = MACHINE_CLASS(oc); + mc->desc = "Spitz PDA (PXA270)"; mc->init = spitz_init; } -DEFINE_MACHINE("spitz", spitzpda_machine_init) +static const TypeInfo spitzpda_type = { + .name = MACHINE_TYPE_NAME("spitz"), + .parent = TYPE_MACHINE, + .class_init = spitzpda_class_init, +}; -static void borzoipda_machine_init(MachineClass *mc) +static void borzoipda_class_init(ObjectClass *oc, void *data) { + MachineClass *mc = MACHINE_CLASS(oc); + mc->desc = "Borzoi PDA (PXA270)"; mc->init = borzoi_init; } -DEFINE_MACHINE("borzoi", borzoipda_machine_init) +static const TypeInfo borzoipda_type = { + .name = MACHINE_TYPE_NAME("borzoi"), + .parent = TYPE_MACHINE, + .class_init = borzoipda_class_init, +}; -static void terrierpda_machine_init(MachineClass *mc) +static void terrierpda_class_init(ObjectClass *oc, void *data) { + MachineClass *mc = MACHINE_CLASS(oc); + mc->desc = "Terrier PDA (PXA270)"; mc->init = terrier_init; } -DEFINE_MACHINE("terrier", terrierpda_machine_init) +static const TypeInfo terrierpda_type = { + .name = MACHINE_TYPE_NAME("terrier"), + .parent = TYPE_MACHINE, + .class_init = terrierpda_class_init, +}; + +static void spitz_machine_init(void) +{ + type_register_static(&akitapda_type); + type_register_static(&spitzpda_type); + type_register_static(&borzoipda_type); + type_register_static(&terrierpda_type); +} + +machine_init(spitz_machine_init) static bool is_version_0(void *opaque, int version_id) { |