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 | |
parent | e264d29de28c5b0be3d063307ce9fb613b427cc3 (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')
-rw-r--r-- | hw/arm/exynos4_boards.c | 28 | ||||
-rw-r--r-- | hw/arm/gumstix.c | 28 | ||||
-rw-r--r-- | hw/arm/highbank.c | 28 | ||||
-rw-r--r-- | hw/arm/nseries.c | 28 | ||||
-rw-r--r-- | hw/arm/omap_sx1.c | 28 | ||||
-rw-r--r-- | hw/arm/realview.c | 50 | ||||
-rw-r--r-- | hw/arm/spitz.c | 50 | ||||
-rw-r--r-- | hw/arm/stellaris.c | 28 | ||||
-rw-r--r-- | hw/arm/versatilepb.c | 28 |
9 files changed, 252 insertions, 44 deletions
diff --git a/hw/arm/exynos4_boards.c b/hw/arm/exynos4_boards.c index fadf372b9c..da82b27bad 100644 --- a/hw/arm/exynos4_boards.c +++ b/hw/arm/exynos4_boards.c @@ -144,20 +144,40 @@ static void smdkc210_init(MachineState *machine) arm_load_kernel(ARM_CPU(first_cpu), &exynos4_board_binfo); } -static void exynos4_machine_nuri_machine_init(MachineClass *mc) +static void nuri_class_init(ObjectClass *oc, void *data) { + MachineClass *mc = MACHINE_CLASS(oc); + mc->desc = "Samsung NURI board (Exynos4210)"; mc->init = nuri_init; mc->max_cpus = EXYNOS4210_NCPUS; } -DEFINE_MACHINE("nuri", exynos4_machine_nuri_machine_init) +static const TypeInfo nuri_type = { + .name = MACHINE_TYPE_NAME("nuri"), + .parent = TYPE_MACHINE, + .class_init = nuri_class_init, +}; -static void exynos4_machine_smdkc210_machine_init(MachineClass *mc) +static void smdkc210_class_init(ObjectClass *oc, void *data) { + MachineClass *mc = MACHINE_CLASS(oc); + mc->desc = "Samsung SMDKC210 board (Exynos4210)"; mc->init = smdkc210_init; mc->max_cpus = EXYNOS4210_NCPUS; } -DEFINE_MACHINE("smdkc210", exynos4_machine_smdkc210_machine_init) +static const TypeInfo smdkc210_type = { + .name = MACHINE_TYPE_NAME("smdkc210"), + .parent = TYPE_MACHINE, + .class_init = smdkc210_class_init, +}; + +static void exynos4_machines_init(void) +{ + type_register_static(&nuri_type); + type_register_static(&smdkc210_type); +} + +machine_init(exynos4_machines_init) diff --git a/hw/arm/gumstix.c b/hw/arm/gumstix.c index 6dc98c86b4..32ad041b20 100644 --- a/hw/arm/gumstix.c +++ b/hw/arm/gumstix.c @@ -121,18 +121,38 @@ static void verdex_init(MachineState *machine) qdev_get_gpio_in(cpu->gpio, 99)); } -static void connex_machine_init(MachineClass *mc) +static void connex_class_init(ObjectClass *oc, void *data) { + MachineClass *mc = MACHINE_CLASS(oc); + mc->desc = "Gumstix Connex (PXA255)"; mc->init = connex_init; } -DEFINE_MACHINE("connex", connex_machine_init) +static const TypeInfo connex_type = { + .name = MACHINE_TYPE_NAME("connex"), + .parent = TYPE_MACHINE, + .class_init = connex_class_init, +}; -static void verdex_machine_init(MachineClass *mc) +static void verdex_class_init(ObjectClass *oc, void *data) { + MachineClass *mc = MACHINE_CLASS(oc); + mc->desc = "Gumstix Verdex (PXA270)"; mc->init = verdex_init; } -DEFINE_MACHINE("verdex", verdex_machine_init) +static const TypeInfo verdex_type = { + .name = MACHINE_TYPE_NAME("verdex"), + .parent = TYPE_MACHINE, + .class_init = verdex_class_init, +}; + +static void gumstix_machine_init(void) +{ + type_register_static(&connex_type); + type_register_static(&verdex_type); +} + +machine_init(gumstix_machine_init) 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) diff --git a/hw/arm/nseries.c b/hw/arm/nseries.c index af28449367..6a6b3e6642 100644 --- a/hw/arm/nseries.c +++ b/hw/arm/nseries.c @@ -1413,20 +1413,40 @@ static void n810_init(MachineState *machine) n8x0_init(machine, &n810_binfo, 810); } -static void n800_machine_init(MachineClass *mc) +static void n800_class_init(ObjectClass *oc, void *data) { + MachineClass *mc = MACHINE_CLASS(oc); + mc->desc = "Nokia N800 tablet aka. RX-34 (OMAP2420)"; mc->init = n800_init; mc->default_boot_order = ""; } -DEFINE_MACHINE("n800", n800_machine_init) +static const TypeInfo n800_type = { + .name = MACHINE_TYPE_NAME("n800"), + .parent = TYPE_MACHINE, + .class_init = n800_class_init, +}; -static void n810_machine_init(MachineClass *mc) +static void n810_class_init(ObjectClass *oc, void *data) { + MachineClass *mc = MACHINE_CLASS(oc); + mc->desc = "Nokia N810 tablet aka. RX-44 (OMAP2420)"; mc->init = n810_init; mc->default_boot_order = ""; } -DEFINE_MACHINE("n810", n810_machine_init) +static const TypeInfo n810_type = { + .name = MACHINE_TYPE_NAME("n810"), + .parent = TYPE_MACHINE, + .class_init = n810_class_init, +}; + +static void nseries_machine_init(void) +{ + type_register_static(&n800_type); + type_register_static(&n810_type); +} + +machine_init(nseries_machine_init) 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) diff --git a/hw/arm/realview.c b/hw/arm/realview.c index 6c838178f7..e14828db0d 100644 --- a/hw/arm/realview.c +++ b/hw/arm/realview.c @@ -399,39 +399,73 @@ static void realview_pbx_a9_init(MachineState *machine) realview_init(machine, BOARD_PBX_A9); } -static void realview_eb_machine_init(MachineClass *mc) +static void realview_eb_class_init(ObjectClass *oc, void *data) { + MachineClass *mc = MACHINE_CLASS(oc); + mc->desc = "ARM RealView Emulation Baseboard (ARM926EJ-S)"; mc->init = realview_eb_init; mc->block_default_type = IF_SCSI; } -DEFINE_MACHINE("realview-eb", realview_eb_machine_init) +static const TypeInfo realview_eb_type = { + .name = MACHINE_TYPE_NAME("realview-eb"), + .parent = TYPE_MACHINE, + .class_init = realview_eb_class_init, +}; -static void realview_eb_mpcore_machine_init(MachineClass *mc) +static void realview_eb_mpcore_class_init(ObjectClass *oc, void *data) { + MachineClass *mc = MACHINE_CLASS(oc); + mc->desc = "ARM RealView Emulation Baseboard (ARM11MPCore)"; mc->init = realview_eb_mpcore_init; mc->block_default_type = IF_SCSI; mc->max_cpus = 4; } -DEFINE_MACHINE("realview-eb-mpcore", realview_eb_mpcore_machine_init) +static const TypeInfo realview_eb_mpcore_type = { + .name = MACHINE_TYPE_NAME("realview-eb-mpcore"), + .parent = TYPE_MACHINE, + .class_init = realview_eb_mpcore_class_init, +}; -static void realview_pb_a8_machine_init(MachineClass *mc) +static void realview_pb_a8_class_init(ObjectClass *oc, void *data) { + MachineClass *mc = MACHINE_CLASS(oc); + mc->desc = "ARM RealView Platform Baseboard for Cortex-A8"; mc->init = realview_pb_a8_init; } -DEFINE_MACHINE("realview-pb-a8", realview_pb_a8_machine_init) +static const TypeInfo realview_pb_a8_type = { + .name = MACHINE_TYPE_NAME("realview-pb-a8"), + .parent = TYPE_MACHINE, + .class_init = realview_pb_a8_class_init, +}; -static void realview_pbx_a9_machine_init(MachineClass *mc) +static void realview_pbx_a9_class_init(ObjectClass *oc, void *data) { + MachineClass *mc = MACHINE_CLASS(oc); + mc->desc = "ARM RealView Platform Baseboard Explore for Cortex-A9"; mc->init = realview_pbx_a9_init; mc->block_default_type = IF_SCSI; mc->max_cpus = 4; } -DEFINE_MACHINE("realview-pbx-a9", realview_pbx_a9_machine_init) +static const TypeInfo realview_pbx_a9_type = { + .name = MACHINE_TYPE_NAME("realview-pbx-a9"), + .parent = TYPE_MACHINE, + .class_init = realview_pbx_a9_class_init, +}; + +static void realview_machine_init(void) +{ + type_register_static(&realview_eb_type); + type_register_static(&realview_eb_mpcore_type); + type_register_static(&realview_pb_a8_type); + type_register_static(&realview_pbx_a9_type); +} + +machine_init(realview_machine_init) diff --git a/hw/arm/spitz.c b/hw/arm/spitz.c index 0f59489804..2af03be622 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) { 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) { diff --git a/hw/arm/versatilepb.c b/hw/arm/versatilepb.c index 54281f4e3c..912c2908f3 100644 --- a/hw/arm/versatilepb.c +++ b/hw/arm/versatilepb.c @@ -391,23 +391,43 @@ static void vab_init(MachineState *machine) versatile_init(machine, 0x25e); } -static void versatilepb_machine_init(MachineClass *mc) +static void versatilepb_class_init(ObjectClass *oc, void *data) { + MachineClass *mc = MACHINE_CLASS(oc); + mc->desc = "ARM Versatile/PB (ARM926EJ-S)"; mc->init = vpb_init; mc->block_default_type = IF_SCSI; } -DEFINE_MACHINE("versatilepb", versatilepb_machine_init) +static const TypeInfo versatilepb_type = { + .name = MACHINE_TYPE_NAME("versatilepb"), + .parent = TYPE_MACHINE, + .class_init = versatilepb_class_init, +}; -static void versatileab_machine_init(MachineClass *mc) +static void versatileab_class_init(ObjectClass *oc, void *data) { + MachineClass *mc = MACHINE_CLASS(oc); + mc->desc = "ARM Versatile/AB (ARM926EJ-S)"; mc->init = vab_init; mc->block_default_type = IF_SCSI; } -DEFINE_MACHINE("versatileab", versatileab_machine_init) +static const TypeInfo versatileab_type = { + .name = MACHINE_TYPE_NAME("versatileab"), + .parent = TYPE_MACHINE, + .class_init = versatileab_class_init, +}; + +static void versatile_machine_init(void) +{ + type_register_static(&versatilepb_type); + type_register_static(&versatileab_type); +} + +machine_init(versatile_machine_init) static void vpb_sic_class_init(ObjectClass *klass, void *data) { |