diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2015-09-19 15:59:52 +0100 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2015-09-19 15:59:52 +0100 |
commit | 18640989a9f5e4d2e84b566c52ff1fccfa0dbf4a (patch) | |
tree | ce530f23d339d9c907cf50aeb02a3413b026b9c4 /hw/ppc | |
parent | b12a84ce3c27e42c8f51c436aa196938d5cc2c71 (diff) | |
parent | 3b53e45f43825caaaf4fad6a5b85ce6a9949ff02 (diff) |
Merge remote-tracking branch 'remotes/afaerber/tags/qom-devices-for-peter' into staging
QOM infrastructure fixes and device conversions
* QOM API error handling fixes
* Performance improvements for device GPIO property creation
* Remaining conversion of QEMUMachine to QOM
# gpg: Signature made Sat 19 Sep 2015 15:40:44 BST using RSA key ID 3E7E013F
# gpg: Good signature from "Andreas Färber <afaerber@suse.de>"
# gpg: aka "Andreas Färber <afaerber@suse.com>"
* remotes/afaerber/tags/qom-devices-for-peter: (21 commits)
machine: Eliminate QEMUMachine and qemu_register_machine()
Revert use of DEFINE_MACHINE() for registrations of multiple machines
Use DEFINE_MACHINE() to register all machines
mac_world: Break long line
machine: DEFINE_MACHINE() macro
exynos4: Declare each QEMUMachine as a separate variable
exynos4: Use MachineClass instead of exynos4_machines array
exynos4: Use EXYNOS4210_NCPUS instead of max_cpus on error message
machine: Set MachineClass::name automatically
machine: Ensure all TYPE_MACHINE subclasses have the right suffix
mac99: Use MACHINE_TYPE_NAME to encode class name
s390: Rename s390-ccw-virtio-2.4 class name to use MACHINE_TYPE_NAME
s390-virtio: Rename machine class name to use MACHINE_TYPE_NAME
pseries: Rename machine class names to use MACHINE_TYPE_NAME
arm: Rename virt machine class to use MACHINE_TYPE_NAME
vexpress: Rename machine classes to use MACHINE_TYPE_NAME
vexpress: Don't set name on abstract class
machine: MACHINE_TYPE_NAME macro
qdev: Do not use slow [*] expansion for GPIO creation
qom: Fix invalid error check in property_get_str()
...
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw/ppc')
-rw-r--r-- | hw/ppc/e500plat.c | 17 | ||||
-rw-r--r-- | hw/ppc/mac_newworld.c | 3 | ||||
-rw-r--r-- | hw/ppc/mac_oldworld.c | 24 | ||||
-rw-r--r-- | hw/ppc/mpc8544ds.c | 15 | ||||
-rw-r--r-- | hw/ppc/ppc405_boards.c | 38 | ||||
-rw-r--r-- | hw/ppc/ppc440_bamboo.c | 13 | ||||
-rw-r--r-- | hw/ppc/prep.c | 17 | ||||
-rw-r--r-- | hw/ppc/spapr.c | 12 | ||||
-rw-r--r-- | hw/ppc/virtex_ml507.c | 13 |
9 files changed, 67 insertions, 85 deletions
diff --git a/hw/ppc/e500plat.c b/hw/ppc/e500plat.c index 14b14eaa7d..384b6e84d1 100644 --- a/hw/ppc/e500plat.c +++ b/hw/ppc/e500plat.c @@ -57,17 +57,12 @@ static void e500plat_init(MachineState *machine) ppce500_init(machine, ¶ms); } -static QEMUMachine e500plat_machine = { - .name = "ppce500", - .desc = "generic paravirt e500 platform", - .init = e500plat_init, - .max_cpus = 32, - .has_dynamic_sysbus = true, -}; - -static void e500plat_machine_init(void) +static void e500plat_machine_init(MachineClass *mc) { - qemu_register_machine(&e500plat_machine); + mc->desc = "generic paravirt e500 platform"; + mc->init = e500plat_init; + mc->max_cpus = 32; + mc->has_dynamic_sysbus = true; } -machine_init(e500plat_machine_init); +DEFINE_MACHINE("ppce500", e500plat_machine_init) diff --git a/hw/ppc/mac_newworld.c b/hw/ppc/mac_newworld.c index 3c82be2e18..e1c5ed76bd 100644 --- a/hw/ppc/mac_newworld.c +++ b/hw/ppc/mac_newworld.c @@ -508,7 +508,6 @@ static void core99_machine_class_init(ObjectClass *oc, void *data) { MachineClass *mc = MACHINE_CLASS(oc); - mc->name = "mac99"; mc->desc = "Mac99 based PowerMAC"; mc->init = ppc_core99_init; mc->max_cpus = MAX_CPUS; @@ -517,7 +516,7 @@ static void core99_machine_class_init(ObjectClass *oc, void *data) } static const TypeInfo core99_machine_info = { - .name = "mac99-machine", + .name = MACHINE_TYPE_NAME("mac99"), .parent = TYPE_MACHINE, .class_init = core99_machine_class_init, }; diff --git a/hw/ppc/mac_oldworld.c b/hw/ppc/mac_oldworld.c index 1e4b55a5cf..5cba2cb145 100644 --- a/hw/ppc/mac_oldworld.c +++ b/hw/ppc/mac_oldworld.c @@ -357,21 +357,17 @@ static int heathrow_kvm_type(const char *arg) return 2; } -static QEMUMachine heathrow_machine = { - .name = "g3beige", - .desc = "Heathrow based PowerMAC", - .init = ppc_heathrow_init, - .max_cpus = MAX_CPUS, +static void heathrow_machine_init(MachineClass *mc) +{ + mc->desc = "Heathrow based PowerMAC"; + mc->init = ppc_heathrow_init; + mc->max_cpus = MAX_CPUS; #ifndef TARGET_PPC64 - .is_default = 1, + mc->is_default = 1; #endif - .default_boot_order = "cd", /* TOFIX "cad" when Mac floppy is implemented */ - .kvm_type = heathrow_kvm_type, -}; - -static void heathrow_machine_init(void) -{ - qemu_register_machine(&heathrow_machine); + /* TOFIX "cad" when Mac floppy is implemented */ + mc->default_boot_order = "cd"; + mc->kvm_type = heathrow_kvm_type; } -machine_init(heathrow_machine_init); +DEFINE_MACHINE("g3beige", heathrow_machine_init) diff --git a/hw/ppc/mpc8544ds.c b/hw/ppc/mpc8544ds.c index 3a3b141e43..0afbd34d69 100644 --- a/hw/ppc/mpc8544ds.c +++ b/hw/ppc/mpc8544ds.c @@ -50,16 +50,11 @@ static void mpc8544ds_init(MachineState *machine) } -static QEMUMachine ppce500_machine = { - .name = "mpc8544ds", - .desc = "mpc8544ds", - .init = mpc8544ds_init, - .max_cpus = 15, -}; - -static void ppce500_machine_init(void) +static void ppce500_machine_init(MachineClass *mc) { - qemu_register_machine(&ppce500_machine); + mc->desc = "mpc8544ds"; + mc->init = mpc8544ds_init; + mc->max_cpus = 15; } -machine_init(ppce500_machine_init); +DEFINE_MACHINE("mpc8544ds", ppce500_machine_init) diff --git a/hw/ppc/ppc405_boards.c b/hw/ppc/ppc405_boards.c index 53897257f0..ec87587d6d 100644 --- a/hw/ppc/ppc405_boards.c +++ b/hw/ppc/ppc405_boards.c @@ -369,10 +369,18 @@ static void ref405ep_init(MachineState *machine) #endif } -static QEMUMachine ref405ep_machine = { - .name = "ref405ep", - .desc = "ref405ep", - .init = ref405ep_init, +static void ref405ep_class_init(ObjectClass *oc, void *data) +{ + MachineClass *mc = MACHINE_CLASS(oc); + + mc->desc = "ref405ep"; + mc->init = ref405ep_init; +} + +static const TypeInfo ref405ep_type = { + .name = MACHINE_TYPE_NAME("ref405ep"), + .parent = TYPE_MACHINE, + .class_init = ref405ep_class_init, }; /*****************************************************************************/ @@ -665,16 +673,24 @@ static void taihu_405ep_init(MachineState *machine) #endif } -static QEMUMachine taihu_machine = { - .name = "taihu", - .desc = "taihu", - .init = taihu_405ep_init, +static void taihu_class_init(ObjectClass *oc, void *data) +{ + MachineClass *mc = MACHINE_CLASS(oc); + + mc->desc = "taihu"; + mc->init = taihu_405ep_init; +} + +static const TypeInfo taihu_type = { + .name = MACHINE_TYPE_NAME("taihu"), + .parent = TYPE_MACHINE, + .class_init = taihu_class_init, }; static void ppc405_machine_init(void) { - qemu_register_machine(&ref405ep_machine); - qemu_register_machine(&taihu_machine); + type_register_static(&ref405ep_type); + type_register_static(&taihu_type); } -machine_init(ppc405_machine_init); +machine_init(ppc405_machine_init) diff --git a/hw/ppc/ppc440_bamboo.c b/hw/ppc/ppc440_bamboo.c index 032fa803db..4726832bfc 100644 --- a/hw/ppc/ppc440_bamboo.c +++ b/hw/ppc/ppc440_bamboo.c @@ -293,15 +293,10 @@ static void bamboo_init(MachineState *machine) kvmppc_init(); } -static QEMUMachine bamboo_machine = { - .name = "bamboo", - .desc = "bamboo", - .init = bamboo_init, -}; - -static void bamboo_machine_init(void) +static void bamboo_machine_init(MachineClass *mc) { - qemu_register_machine(&bamboo_machine); + mc->desc = "bamboo"; + mc->init = bamboo_init; } -machine_init(bamboo_machine_init); +DEFINE_MACHINE("bamboo", bamboo_machine_init) diff --git a/hw/ppc/prep.c b/hw/ppc/prep.c index 81f0838cd9..9d6d70a16c 100644 --- a/hw/ppc/prep.c +++ b/hw/ppc/prep.c @@ -687,17 +687,12 @@ static void ppc_prep_init(MachineState *machine) graphic_width, graphic_height, graphic_depth); } -static QEMUMachine prep_machine = { - .name = "prep", - .desc = "PowerPC PREP platform", - .init = ppc_prep_init, - .max_cpus = MAX_CPUS, - .default_boot_order = "cad", -}; - -static void prep_machine_init(void) +static void prep_machine_init(MachineClass *mc) { - qemu_register_machine(&prep_machine); + mc->desc = "PowerPC PREP platform"; + mc->init = ppc_prep_init; + mc->max_cpus = MAX_CPUS; + mc->default_boot_order = "cad"; } -machine_init(prep_machine_init); +DEFINE_MACHINE("prep", prep_machine_init) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index bf0c64f2d4..05926a3eb2 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -1919,13 +1919,12 @@ static void spapr_machine_2_1_class_init(ObjectClass *oc, void *data) { /* end of list */ } }; - mc->name = "pseries-2.1"; mc->desc = "pSeries Logical Partition (PAPR compliant) v2.1"; mc->compat_props = compat_props; } static const TypeInfo spapr_machine_2_1_info = { - .name = TYPE_SPAPR_MACHINE "2.1", + .name = MACHINE_TYPE_NAME("pseries-2.1"), .parent = TYPE_SPAPR_MACHINE, .class_init = spapr_machine_2_1_class_init, .instance_init = spapr_machine_2_1_instance_init, @@ -1939,13 +1938,12 @@ static void spapr_machine_2_2_class_init(ObjectClass *oc, void *data) }; MachineClass *mc = MACHINE_CLASS(oc); - mc->name = "pseries-2.2"; mc->desc = "pSeries Logical Partition (PAPR compliant) v2.2"; mc->compat_props = compat_props; } static const TypeInfo spapr_machine_2_2_info = { - .name = TYPE_SPAPR_MACHINE "2.2", + .name = MACHINE_TYPE_NAME("pseries-2.2"), .parent = TYPE_SPAPR_MACHINE, .class_init = spapr_machine_2_2_class_init, .instance_init = spapr_machine_2_2_instance_init, @@ -1959,13 +1957,12 @@ static void spapr_machine_2_3_class_init(ObjectClass *oc, void *data) }; MachineClass *mc = MACHINE_CLASS(oc); - mc->name = "pseries-2.3"; mc->desc = "pSeries Logical Partition (PAPR compliant) v2.3"; mc->compat_props = compat_props; } static const TypeInfo spapr_machine_2_3_info = { - .name = TYPE_SPAPR_MACHINE "2.3", + .name = MACHINE_TYPE_NAME("pseries-2.3"), .parent = TYPE_SPAPR_MACHINE, .class_init = spapr_machine_2_3_class_init, .instance_init = spapr_machine_2_3_instance_init, @@ -1975,14 +1972,13 @@ static void spapr_machine_2_4_class_init(ObjectClass *oc, void *data) { MachineClass *mc = MACHINE_CLASS(oc); - mc->name = "pseries-2.4"; mc->desc = "pSeries Logical Partition (PAPR compliant) v2.4"; mc->alias = "pseries"; mc->is_default = 1; } static const TypeInfo spapr_machine_2_4_info = { - .name = TYPE_SPAPR_MACHINE "2.4", + .name = MACHINE_TYPE_NAME("pseries-2.4"), .parent = TYPE_SPAPR_MACHINE, .class_init = spapr_machine_2_4_class_init, }; diff --git a/hw/ppc/virtex_ml507.c b/hw/ppc/virtex_ml507.c index de86f7c64c..457d762a1c 100644 --- a/hw/ppc/virtex_ml507.c +++ b/hw/ppc/virtex_ml507.c @@ -297,15 +297,10 @@ static void virtex_init(MachineState *machine) env->load_info = &boot_info; } -static QEMUMachine virtex_machine = { - .name = "virtex-ml507", - .desc = "Xilinx Virtex ML507 reference design", - .init = virtex_init, -}; - -static void virtex_machine_init(void) +static void virtex_machine_init(MachineClass *mc) { - qemu_register_machine(&virtex_machine); + mc->desc = "Xilinx Virtex ML507 reference design"; + mc->init = virtex_init; } -machine_init(virtex_machine_init); +DEFINE_MACHINE("virtex-ml507", virtex_machine_init) |