From patchwork Sat Sep 19 15:36:38 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andreas_F=C3=A4rber?= X-Patchwork-Id: 519762 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id ECC101401E7 for ; Sun, 20 Sep 2015 01:37:28 +1000 (AEST) Received: from localhost ([::1]:46627 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZdKCc-0000Gj-R6 for incoming@patchwork.ozlabs.org; Sat, 19 Sep 2015 11:37:26 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57626) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZdKC2-0007pU-Mq for qemu-devel@nongnu.org; Sat, 19 Sep 2015 11:36:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZdKC0-0005z6-VV for qemu-devel@nongnu.org; Sat, 19 Sep 2015 11:36:50 -0400 Received: from mx2.suse.de ([195.135.220.15]:42770) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZdKC0-0005yk-MI; Sat, 19 Sep 2015 11:36:48 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id C0AEDAD33; Sat, 19 Sep 2015 15:36:47 +0000 (UTC) From: =?UTF-8?q?Andreas=20F=C3=A4rber?= To: qemu-devel@nongnu.org Date: Sat, 19 Sep 2015 17:36:38 +0200 Message-Id: <1442677004-4482-2-git-send-email-afaerber@suse.de> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1442677004-4482-1-git-send-email-afaerber@suse.de> References: <1442677004-4482-1-git-send-email-afaerber@suse.de> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no timestamps) [generic] X-Received-From: 195.135.220.15 Cc: Peter Maydell , Evgeny Voevodin , Rob Herring , Igor Mitsyanko , Leon Alrae , "Michael S. Tsirkin" , Mark Cave-Ayland , Alexander Graf , Blue Swirl , Max Filippov , Michael Walle , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , Dmitry Solodkiy , "open list:405" , Maksim Kozlov , =?UTF-8?q?Andreas=20F=C3=A4rber?= , Aurelien Jarno Subject: [Qemu-devel] [PATCH 1/6] Use type_init() for all machine QOM types X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org This prepares for dropping machine_init(), now that QEMUMachine is gone. Signed-off-by: Andreas Färber --- hw/arm/exynos4_boards.c | 2 +- hw/arm/gumstix.c | 2 +- hw/arm/highbank.c | 2 +- hw/arm/nseries.c | 2 +- hw/arm/omap_sx1.c | 2 +- hw/arm/realview.c | 2 +- hw/arm/spitz.c | 15 +++++---------- hw/arm/stellaris.c | 11 +++-------- hw/arm/versatilepb.c | 11 +++-------- hw/arm/vexpress.c | 2 +- hw/arm/virt.c | 2 +- hw/lm32/lm32_boards.c | 2 +- hw/mips/mips_jazz.c | 2 +- hw/ppc/ppc405_boards.c | 2 +- hw/sparc/sun4m.c | 14 +++++--------- hw/sparc64/sun4u.c | 12 ++++-------- hw/xtensa/xtfpga.c | 2 +- include/hw/boards.h | 2 +- include/hw/i386/pc.h | 2 +- 19 files changed, 34 insertions(+), 57 deletions(-) diff --git a/hw/arm/exynos4_boards.c b/hw/arm/exynos4_boards.c index da82b27..336c8b2 100644 --- a/hw/arm/exynos4_boards.c +++ b/hw/arm/exynos4_boards.c @@ -180,4 +180,4 @@ static void exynos4_machines_init(void) type_register_static(&smdkc210_type); } -machine_init(exynos4_machines_init) +type_init(exynos4_machines_init) diff --git a/hw/arm/gumstix.c b/hw/arm/gumstix.c index 32ad041..9b5938b 100644 --- a/hw/arm/gumstix.c +++ b/hw/arm/gumstix.c @@ -155,4 +155,4 @@ static void gumstix_machine_init(void) type_register_static(&verdex_type); } -machine_init(gumstix_machine_init) +type_init(gumstix_machine_init) diff --git a/hw/arm/highbank.c b/hw/arm/highbank.c index be04b27..98825e7 100644 --- a/hw/arm/highbank.c +++ b/hw/arm/highbank.c @@ -429,4 +429,4 @@ static void calxeda_machines_init(void) type_register_static(&midway_type); } -machine_init(calxeda_machines_init) +type_init(calxeda_machines_init) diff --git a/hw/arm/nseries.c b/hw/arm/nseries.c index 6a6b3e6..2bfdc20 100644 --- a/hw/arm/nseries.c +++ b/hw/arm/nseries.c @@ -1449,4 +1449,4 @@ static void nseries_machine_init(void) type_register_static(&n810_type); } -machine_init(nseries_machine_init) +type_init(nseries_machine_init) diff --git a/hw/arm/omap_sx1.c b/hw/arm/omap_sx1.c index 8eaf8f3..98c4066 100644 --- a/hw/arm/omap_sx1.c +++ b/hw/arm/omap_sx1.c @@ -251,4 +251,4 @@ static void sx1_machine_init(void) type_register_static(&sx1_machine_v2_type); } -machine_init(sx1_machine_init) +type_init(sx1_machine_init) diff --git a/hw/arm/realview.c b/hw/arm/realview.c index e14828d..c14aab2 100644 --- a/hw/arm/realview.c +++ b/hw/arm/realview.c @@ -468,4 +468,4 @@ static void realview_machine_init(void) type_register_static(&realview_pbx_a9_type); } -machine_init(realview_machine_init) +type_init(realview_machine_init) diff --git a/hw/arm/spitz.c b/hw/arm/spitz.c index 2af03be..8aa0172 100644 --- a/hw/arm/spitz.c +++ b/hw/arm/spitz.c @@ -1028,16 +1028,6 @@ static const TypeInfo terrierpda_type = { .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) { return version_id == 0; @@ -1167,6 +1157,11 @@ static const TypeInfo spitz_lcdtg_info = { static void spitz_register_types(void) { + type_register_static(&akitapda_type); + type_register_static(&spitzpda_type); + type_register_static(&borzoipda_type); + type_register_static(&terrierpda_type); + type_register_static(&corgi_ssp_info); type_register_static(&spitz_lcdtg_info); type_register_static(&spitz_keyboard_info); diff --git a/hw/arm/stellaris.c b/hw/arm/stellaris.c index 3d6486f..3b653c5 100644 --- a/hw/arm/stellaris.c +++ b/hw/arm/stellaris.c @@ -1394,14 +1394,6 @@ static const TypeInfo lm3s6965evb_type = { .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) { SysBusDeviceClass *sdc = SYS_BUS_DEVICE_CLASS(klass); @@ -1446,6 +1438,9 @@ static const TypeInfo stellaris_adc_info = { static void stellaris_register_types(void) { + type_register_static(&lm3s811evb_type); + type_register_static(&lm3s6965evb_type); + type_register_static(&stellaris_i2c_info); type_register_static(&stellaris_gptm_info); type_register_static(&stellaris_adc_info); diff --git a/hw/arm/versatilepb.c b/hw/arm/versatilepb.c index 912c290..8f48a3c 100644 --- a/hw/arm/versatilepb.c +++ b/hw/arm/versatilepb.c @@ -421,14 +421,6 @@ static const TypeInfo versatileab_type = { .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) { DeviceClass *dc = DEVICE_CLASS(klass); @@ -447,6 +439,9 @@ static const TypeInfo vpb_sic_info = { static void versatilepb_register_types(void) { + type_register_static(&versatilepb_type); + type_register_static(&versatileab_type); + type_register_static(&vpb_sic_info); } diff --git a/hw/arm/vexpress.c b/hw/arm/vexpress.c index 058abbd..e888d46 100644 --- a/hw/arm/vexpress.c +++ b/hw/arm/vexpress.c @@ -802,4 +802,4 @@ static void vexpress_machine_init(void) type_register_static(&vexpress_a15_info); } -machine_init(vexpress_machine_init); +type_init(vexpress_machine_init) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 6bf0d6d..e7cb46a 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -1095,4 +1095,4 @@ static void machvirt_machine_init(void) type_register_static(&machvirt_info); } -machine_init(machvirt_machine_init); +type_init(machvirt_machine_init); diff --git a/hw/lm32/lm32_boards.c b/hw/lm32/lm32_boards.c index 8e17a82..7093f3e 100644 --- a/hw/lm32/lm32_boards.c +++ b/hw/lm32/lm32_boards.c @@ -328,4 +328,4 @@ static void lm32_machine_init(void) type_register_static(&lm32_uclinux_type); } -machine_init(lm32_machine_init) +type_init(lm32_machine_init) diff --git a/hw/mips/mips_jazz.c b/hw/mips/mips_jazz.c index 1ab885b..8d7e8ba 100644 --- a/hw/mips/mips_jazz.c +++ b/hw/mips/mips_jazz.c @@ -385,4 +385,4 @@ static void mips_jazz_machine_init(void) type_register_static(&mips_pica61_type); } -machine_init(mips_jazz_machine_init) +type_init(mips_jazz_machine_init) diff --git a/hw/ppc/ppc405_boards.c b/hw/ppc/ppc405_boards.c index ec87587..7366b16 100644 --- a/hw/ppc/ppc405_boards.c +++ b/hw/ppc/ppc405_boards.c @@ -693,4 +693,4 @@ static void ppc405_machine_init(void) type_register_static(&taihu_type); } -machine_init(ppc405_machine_init) +type_init(ppc405_machine_init) diff --git a/hw/sparc/sun4m.c b/hw/sparc/sun4m.c index 9f1917f..8fea7b7 100644 --- a/hw/sparc/sun4m.c +++ b/hw/sparc/sun4m.c @@ -1570,14 +1570,6 @@ static const TypeInfo sbook_type = { static void sun4m_register_types(void) { - type_register_static(&idreg_info); - type_register_static(&afx_info); - type_register_static(&prom_info); - type_register_static(&ram_info); -} - -static void sun4m_machine_init(void) -{ type_register_static(&ss5_type); type_register_static(&ss10_type); type_register_static(&ss600mp_type); @@ -1587,7 +1579,11 @@ static void sun4m_machine_init(void) type_register_static(&ss4_type); type_register_static(&scls_type); type_register_static(&sbook_type); + + type_register_static(&idreg_info); + type_register_static(&afx_info); + type_register_static(&prom_info); + type_register_static(&ram_info); } type_init(sun4m_register_types) -machine_init(sun4m_machine_init) diff --git a/hw/sparc64/sun4u.c b/hw/sparc64/sun4u.c index a6b5957..46c8714 100644 --- a/hw/sparc64/sun4u.c +++ b/hw/sparc64/sun4u.c @@ -1016,17 +1016,13 @@ static const TypeInfo niagara_type = { static void sun4u_register_types(void) { - type_register_static(&ebus_info); - type_register_static(&prom_info); - type_register_static(&ram_info); -} - -static void sun4u_machine_init(void) -{ type_register_static(&sun4u_type); type_register_static(&sun4v_type); type_register_static(&niagara_type); + + type_register_static(&ebus_info); + type_register_static(&prom_info); + type_register_static(&ram_info); } type_init(sun4u_register_types) -machine_init(sun4u_machine_init) diff --git a/hw/xtensa/xtfpga.c b/hw/xtensa/xtfpga.c index 7aca1cf..3cd76aa 100644 --- a/hw/xtensa/xtfpga.c +++ b/hw/xtensa/xtfpga.c @@ -496,4 +496,4 @@ static void xtensa_lx_machines_init(void) type_register_static(&xtensa_kc705_type); } -machine_init(xtensa_lx_machines_init) +type_init(xtensa_lx_machines_init) diff --git a/include/hw/boards.h b/include/hw/boards.h index 3e9a92c..f5f4a17 100644 --- a/include/hw/boards.h +++ b/include/hw/boards.h @@ -147,6 +147,6 @@ struct MachineState { { \ type_register_static(&machine_initfn##_typeinfo); \ } \ - machine_init(machine_initfn##_register_types) + type_init(machine_initfn##_register_types) #endif diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index 3e002c9..b828bb9 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -717,7 +717,7 @@ bool e820_get_entry(int, uint32_t, uint64_t *, uint64_t *); { \ type_register(&pc_machine_type_##suffix); \ } \ - machine_init(pc_machine_init_##suffix) + type_init(pc_machine_init_##suffix) #define SET_MACHINE_COMPAT(m, COMPAT) do { \ static GlobalProperty props[] = { \