From nobody Tue May 7 02:04:11 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1620200242; cv=none; d=zohomail.com; s=zohoarc; b=LRbR+k0eCZeaqQtgKZB/oPqtjS0ZZofnkWMpBqs7cX5q8kCcqFAUL96CpPo1efTDNGvMx4kNxBxvbImCy9640QyZRbhKCTEZTLDK1UA9OwOkxS4PP6rGxPQ2q/ZtS00h1X4LEm77nhwWlXPHMw8T+8XCuIDVDZD02sM0/S1T7T4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1620200242; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=MiuiM50U12S86j3YhbGx8fFEjXKcYl9BdZZJMi7C8Io=; b=gNrMTl0fKozv7awmzArWzxppC1PI8QFR0OoX5iC8CVBwICyVVtnnxsaudqrv8nVy2UG06eYfroXhuFD4FcPkNI2Er2TaWDYaoewzO/uohlG8b3+yACYAz45Ii2bBPMiluMC/VwV7tmc3oXyvPg1KaY0NlW+RS9bE9mHnSm9tJmY= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1620200242059593.0381883225423; Wed, 5 May 2021 00:37:22 -0700 (PDT) Received: from localhost ([::1]:35278 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1leC5w-0000gf-Ds for importer@patchew.org; Wed, 05 May 2021 03:37:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52768) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1leC4U-0007X8-Bb for qemu-devel@nongnu.org; Wed, 05 May 2021 03:35:50 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:57678 helo=mail.default.ilande.uk0.bigv.io) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1leC4Q-00022d-83 for qemu-devel@nongnu.org; Wed, 05 May 2021 03:35:50 -0400 Received: from host81-154-26-71.range81-154.btcentralplus.com ([81.154.26.71] helo=kentang.home) by mail.default.ilande.uk0.bigv.io with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1leC4N-0000OI-Se; Wed, 05 May 2021 08:35:44 +0100 From: Mark Cave-Ayland To: peter.maydell@linaro.org, qemu-devel@nongnu.org Date: Wed, 5 May 2021 08:35:29 +0100 Message-Id: <20210505073538.11438-2-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210505073538.11438-1-mark.cave-ayland@ilande.co.uk> References: <20210505073538.11438-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 81.154.26.71 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PULL 01/10] hw/sparc/sun4m: Have sun4m machines inherit new TYPE_SUN4M_MACHINE X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.default.ilande.uk0.bigv.io) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.default.ilande.uk0.bigv.io X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daud=C3=A9 Introduce the TYPE_SUN4M_MACHINE and have all sun4m machines inherit it. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Mark Cave-Ayland Message-Id: <20210503171303.822501-2-f4bug@amsat.org> Signed-off-by: Mark Cave-Ayland --- hw/sparc/sun4m.c | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/hw/sparc/sun4m.c b/hw/sparc/sun4m.c index 1a00816d9a..9d07fa43d6 100644 --- a/hw/sparc/sun4m.c +++ b/hw/sparc/sun4m.c @@ -107,6 +107,8 @@ struct sun4m_hwdef { uint8_t nvram_machine_id; }; =20 +#define TYPE_SUN4M_MACHINE MACHINE_TYPE_NAME("sun4m-common") + const char *fw_cfg_arch_key_name(uint16_t key) { static const struct { @@ -1433,7 +1435,7 @@ static void ss5_class_init(ObjectClass *oc, void *dat= a) =20 static const TypeInfo ss5_type =3D { .name =3D MACHINE_TYPE_NAME("SS-5"), - .parent =3D TYPE_MACHINE, + .parent =3D TYPE_SUN4M_MACHINE, .class_init =3D ss5_class_init, }; =20 @@ -1453,7 +1455,7 @@ static void ss10_class_init(ObjectClass *oc, void *da= ta) =20 static const TypeInfo ss10_type =3D { .name =3D MACHINE_TYPE_NAME("SS-10"), - .parent =3D TYPE_MACHINE, + .parent =3D TYPE_SUN4M_MACHINE, .class_init =3D ss10_class_init, }; =20 @@ -1473,7 +1475,7 @@ static void ss600mp_class_init(ObjectClass *oc, void = *data) =20 static const TypeInfo ss600mp_type =3D { .name =3D MACHINE_TYPE_NAME("SS-600MP"), - .parent =3D TYPE_MACHINE, + .parent =3D TYPE_SUN4M_MACHINE, .class_init =3D ss600mp_class_init, }; =20 @@ -1493,7 +1495,7 @@ static void ss20_class_init(ObjectClass *oc, void *da= ta) =20 static const TypeInfo ss20_type =3D { .name =3D MACHINE_TYPE_NAME("SS-20"), - .parent =3D TYPE_MACHINE, + .parent =3D TYPE_SUN4M_MACHINE, .class_init =3D ss20_class_init, }; =20 @@ -1512,7 +1514,7 @@ static void voyager_class_init(ObjectClass *oc, void = *data) =20 static const TypeInfo voyager_type =3D { .name =3D MACHINE_TYPE_NAME("Voyager"), - .parent =3D TYPE_MACHINE, + .parent =3D TYPE_SUN4M_MACHINE, .class_init =3D voyager_class_init, }; =20 @@ -1531,7 +1533,7 @@ static void ss_lx_class_init(ObjectClass *oc, void *d= ata) =20 static const TypeInfo ss_lx_type =3D { .name =3D MACHINE_TYPE_NAME("LX"), - .parent =3D TYPE_MACHINE, + .parent =3D TYPE_SUN4M_MACHINE, .class_init =3D ss_lx_class_init, }; =20 @@ -1550,7 +1552,7 @@ static void ss4_class_init(ObjectClass *oc, void *dat= a) =20 static const TypeInfo ss4_type =3D { .name =3D MACHINE_TYPE_NAME("SS-4"), - .parent =3D TYPE_MACHINE, + .parent =3D TYPE_SUN4M_MACHINE, .class_init =3D ss4_class_init, }; =20 @@ -1569,7 +1571,7 @@ static void scls_class_init(ObjectClass *oc, void *da= ta) =20 static const TypeInfo scls_type =3D { .name =3D MACHINE_TYPE_NAME("SPARCClassic"), - .parent =3D TYPE_MACHINE, + .parent =3D TYPE_SUN4M_MACHINE, .class_init =3D scls_class_init, }; =20 @@ -1588,10 +1590,20 @@ static void sbook_class_init(ObjectClass *oc, void = *data) =20 static const TypeInfo sbook_type =3D { .name =3D MACHINE_TYPE_NAME("SPARCbook"), - .parent =3D TYPE_MACHINE, + .parent =3D TYPE_SUN4M_MACHINE, .class_init =3D sbook_class_init, }; =20 +static const TypeInfo sun4m_machine_types[] =3D { + { + .name =3D TYPE_SUN4M_MACHINE, + .parent =3D TYPE_MACHINE, + .abstract =3D true, + } +}; + +DEFINE_TYPES(sun4m_machine_types) + static void sun4m_register_types(void) { type_register_static(&idreg_info); --=20 2.20.1 From nobody Tue May 7 02:04:11 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1620200369; cv=none; d=zohomail.com; s=zohoarc; b=GOZKJwecjAqt1r17LS2FkPXQyYQ0a+pllhGN+2+tGXxR10Q1fwaOuULF5iHmxqSfPhaw1ETc4qqYJcWr2DAIikxmS9BQKNQmRrSo6wll8hoUgDkh+sl+Da6KqluoW+gb0q1twqUmgUgaaMNSUeLfngvOqOVjvXj370veGMeqUr4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1620200369; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=9C71LpKPfzdi6+nqwM5w+Tw3+1+72FXEW0WofuIDPPE=; b=Xu+YFj3Ic6YxOGN+OFVoqzLWS1zw1da3FW26wmG1eIjzF3TXciB/vSXgRbvx/Bpwg77DdwYB6OJBYv3gIDf+1a9hN8e+PW9aPjyENA1YHQdJWOP9uUvTi+YREz2Eyj4V1ACLGv/RjqeAYomuXUdoNQ3MTLZfaKbAvfY6YkdX2VA= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1620200369442397.41239022432126; Wed, 5 May 2021 00:39:29 -0700 (PDT) Received: from localhost ([::1]:43868 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1leC80-000474-OI for importer@patchew.org; Wed, 05 May 2021 03:39:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52852) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1leC4a-0007ZC-TQ for qemu-devel@nongnu.org; Wed, 05 May 2021 03:35:56 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:57682 helo=mail.default.ilande.uk0.bigv.io) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1leC4S-00023i-4U for qemu-devel@nongnu.org; Wed, 05 May 2021 03:35:56 -0400 Received: from host81-154-26-71.range81-154.btcentralplus.com ([81.154.26.71] helo=kentang.home) by mail.default.ilande.uk0.bigv.io with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1leC4O-0000OI-HI; Wed, 05 May 2021 08:35:46 +0100 From: Mark Cave-Ayland To: peter.maydell@linaro.org, qemu-devel@nongnu.org Date: Wed, 5 May 2021 08:35:30 +0100 Message-Id: <20210505073538.11438-3-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210505073538.11438-1-mark.cave-ayland@ilande.co.uk> References: <20210505073538.11438-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 81.154.26.71 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PULL 02/10] hw/sparc/sun4m: Introduce Sun4mMachineClass X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.default.ilande.uk0.bigv.io) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.default.ilande.uk0.bigv.io X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daud=C3=A9 Instead of passing the sun4m_hwdef structure via machine_init(), store it into the MachineClass. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Mark Cave-Ayland Message-Id: <20210503171303.822501-3-f4bug@amsat.org> Signed-off-by: Mark Cave-Ayland --- hw/sparc/sun4m.c | 50 +++++++++++++++++++++++++++++++++++++----------- 1 file changed, 39 insertions(+), 11 deletions(-) diff --git a/hw/sparc/sun4m.c b/hw/sparc/sun4m.c index 9d07fa43d6..c2bc8a9fa5 100644 --- a/hw/sparc/sun4m.c +++ b/hw/sparc/sun4m.c @@ -107,7 +107,16 @@ struct sun4m_hwdef { uint8_t nvram_machine_id; }; =20 +struct Sun4mMachineClass { + /*< private >*/ + MachineClass parent_obj; + /*< public >*/ + const struct sun4m_hwdef *hwdef; +}; +typedef struct Sun4mMachineClass Sun4mMachineClass; + #define TYPE_SUN4M_MACHINE MACHINE_TYPE_NAME("sun4m-common") +DECLARE_CLASS_CHECKERS(Sun4mMachineClass, SUN4M_MACHINE, TYPE_SUN4M_MACHIN= E) =20 const char *fw_cfg_arch_key_name(uint16_t key) { @@ -839,9 +848,9 @@ static void dummy_fdc_tc(void *opaque, int irq, int lev= el) { } =20 -static void sun4m_hw_init(const struct sun4m_hwdef *hwdef, - MachineState *machine) +static void sun4m_hw_init(MachineState *machine) { + const struct sun4m_hwdef *hwdef =3D SUN4M_MACHINE_GET_CLASS(machine)->= hwdef; DeviceState *slavio_intctl; unsigned int i; Nvram *nvram; @@ -1368,60 +1377,61 @@ static const struct sun4m_hwdef sun4m_hwdefs[] =3D { /* SPARCstation 5 hardware initialisation */ static void ss5_init(MachineState *machine) { - sun4m_hw_init(&sun4m_hwdefs[0], machine); + sun4m_hw_init(machine); } =20 /* SPARCstation 10 hardware initialisation */ static void ss10_init(MachineState *machine) { - sun4m_hw_init(&sun4m_hwdefs[1], machine); + sun4m_hw_init(machine); } =20 /* SPARCserver 600MP hardware initialisation */ static void ss600mp_init(MachineState *machine) { - sun4m_hw_init(&sun4m_hwdefs[2], machine); + sun4m_hw_init(machine); } =20 /* SPARCstation 20 hardware initialisation */ static void ss20_init(MachineState *machine) { - sun4m_hw_init(&sun4m_hwdefs[3], machine); + sun4m_hw_init(machine); } =20 /* SPARCstation Voyager hardware initialisation */ static void vger_init(MachineState *machine) { - sun4m_hw_init(&sun4m_hwdefs[4], machine); + sun4m_hw_init(machine); } =20 /* SPARCstation LX hardware initialisation */ static void ss_lx_init(MachineState *machine) { - sun4m_hw_init(&sun4m_hwdefs[5], machine); + sun4m_hw_init(machine); } =20 /* SPARCstation 4 hardware initialisation */ static void ss4_init(MachineState *machine) { - sun4m_hw_init(&sun4m_hwdefs[6], machine); + sun4m_hw_init(machine); } =20 /* SPARCClassic hardware initialisation */ static void scls_init(MachineState *machine) { - sun4m_hw_init(&sun4m_hwdefs[7], machine); + sun4m_hw_init(machine); } =20 /* SPARCbook hardware initialisation */ static void sbook_init(MachineState *machine) { - sun4m_hw_init(&sun4m_hwdefs[8], machine); + sun4m_hw_init(machine); } =20 static void ss5_class_init(ObjectClass *oc, void *data) { MachineClass *mc =3D MACHINE_CLASS(oc); + Sun4mMachineClass *smc =3D SUN4M_MACHINE_CLASS(mc); =20 mc->desc =3D "Sun4m platform, SPARCstation 5"; mc->init =3D ss5_init; @@ -1431,6 +1441,7 @@ static void ss5_class_init(ObjectClass *oc, void *dat= a) mc->default_cpu_type =3D SPARC_CPU_TYPE_NAME("Fujitsu-MB86904"); mc->default_display =3D "tcx"; mc->default_ram_id =3D "sun4m.ram"; + smc->hwdef =3D &sun4m_hwdefs[0]; } =20 static const TypeInfo ss5_type =3D { @@ -1442,6 +1453,7 @@ static const TypeInfo ss5_type =3D { static void ss10_class_init(ObjectClass *oc, void *data) { MachineClass *mc =3D MACHINE_CLASS(oc); + Sun4mMachineClass *smc =3D SUN4M_MACHINE_CLASS(mc); =20 mc->desc =3D "Sun4m platform, SPARCstation 10"; mc->init =3D ss10_init; @@ -1451,6 +1463,7 @@ static void ss10_class_init(ObjectClass *oc, void *da= ta) mc->default_cpu_type =3D SPARC_CPU_TYPE_NAME("TI-SuperSparc-II"); mc->default_display =3D "tcx"; mc->default_ram_id =3D "sun4m.ram"; + smc->hwdef =3D &sun4m_hwdefs[1]; } =20 static const TypeInfo ss10_type =3D { @@ -1462,6 +1475,7 @@ static const TypeInfo ss10_type =3D { static void ss600mp_class_init(ObjectClass *oc, void *data) { MachineClass *mc =3D MACHINE_CLASS(oc); + Sun4mMachineClass *smc =3D SUN4M_MACHINE_CLASS(mc); =20 mc->desc =3D "Sun4m platform, SPARCserver 600MP"; mc->init =3D ss600mp_init; @@ -1471,6 +1485,7 @@ static void ss600mp_class_init(ObjectClass *oc, void = *data) mc->default_cpu_type =3D SPARC_CPU_TYPE_NAME("TI-SuperSparc-II"); mc->default_display =3D "tcx"; mc->default_ram_id =3D "sun4m.ram"; + smc->hwdef =3D &sun4m_hwdefs[2]; } =20 static const TypeInfo ss600mp_type =3D { @@ -1482,6 +1497,7 @@ static const TypeInfo ss600mp_type =3D { static void ss20_class_init(ObjectClass *oc, void *data) { MachineClass *mc =3D MACHINE_CLASS(oc); + Sun4mMachineClass *smc =3D SUN4M_MACHINE_CLASS(mc); =20 mc->desc =3D "Sun4m platform, SPARCstation 20"; mc->init =3D ss20_init; @@ -1491,6 +1507,7 @@ static void ss20_class_init(ObjectClass *oc, void *da= ta) mc->default_cpu_type =3D SPARC_CPU_TYPE_NAME("TI-SuperSparc-II"); mc->default_display =3D "tcx"; mc->default_ram_id =3D "sun4m.ram"; + smc->hwdef =3D &sun4m_hwdefs[3]; } =20 static const TypeInfo ss20_type =3D { @@ -1502,6 +1519,7 @@ static const TypeInfo ss20_type =3D { static void voyager_class_init(ObjectClass *oc, void *data) { MachineClass *mc =3D MACHINE_CLASS(oc); + Sun4mMachineClass *smc =3D SUN4M_MACHINE_CLASS(mc); =20 mc->desc =3D "Sun4m platform, SPARCstation Voyager"; mc->init =3D vger_init; @@ -1510,6 +1528,7 @@ static void voyager_class_init(ObjectClass *oc, void = *data) mc->default_cpu_type =3D SPARC_CPU_TYPE_NAME("Fujitsu-MB86904"); mc->default_display =3D "tcx"; mc->default_ram_id =3D "sun4m.ram"; + smc->hwdef =3D &sun4m_hwdefs[4]; } =20 static const TypeInfo voyager_type =3D { @@ -1521,6 +1540,7 @@ static const TypeInfo voyager_type =3D { static void ss_lx_class_init(ObjectClass *oc, void *data) { MachineClass *mc =3D MACHINE_CLASS(oc); + Sun4mMachineClass *smc =3D SUN4M_MACHINE_CLASS(mc); =20 mc->desc =3D "Sun4m platform, SPARCstation LX"; mc->init =3D ss_lx_init; @@ -1529,6 +1549,7 @@ static void ss_lx_class_init(ObjectClass *oc, void *d= ata) mc->default_cpu_type =3D SPARC_CPU_TYPE_NAME("TI-MicroSparc-I"); mc->default_display =3D "tcx"; mc->default_ram_id =3D "sun4m.ram"; + smc->hwdef =3D &sun4m_hwdefs[5]; } =20 static const TypeInfo ss_lx_type =3D { @@ -1540,6 +1561,7 @@ static const TypeInfo ss_lx_type =3D { static void ss4_class_init(ObjectClass *oc, void *data) { MachineClass *mc =3D MACHINE_CLASS(oc); + Sun4mMachineClass *smc =3D SUN4M_MACHINE_CLASS(mc); =20 mc->desc =3D "Sun4m platform, SPARCstation 4"; mc->init =3D ss4_init; @@ -1548,6 +1570,7 @@ static void ss4_class_init(ObjectClass *oc, void *dat= a) mc->default_cpu_type =3D SPARC_CPU_TYPE_NAME("Fujitsu-MB86904"); mc->default_display =3D "tcx"; mc->default_ram_id =3D "sun4m.ram"; + smc->hwdef =3D &sun4m_hwdefs[6]; } =20 static const TypeInfo ss4_type =3D { @@ -1559,6 +1582,7 @@ static const TypeInfo ss4_type =3D { static void scls_class_init(ObjectClass *oc, void *data) { MachineClass *mc =3D MACHINE_CLASS(oc); + Sun4mMachineClass *smc =3D SUN4M_MACHINE_CLASS(mc); =20 mc->desc =3D "Sun4m platform, SPARCClassic"; mc->init =3D scls_init; @@ -1567,6 +1591,7 @@ static void scls_class_init(ObjectClass *oc, void *da= ta) mc->default_cpu_type =3D SPARC_CPU_TYPE_NAME("TI-MicroSparc-I"); mc->default_display =3D "tcx"; mc->default_ram_id =3D "sun4m.ram"; + smc->hwdef =3D &sun4m_hwdefs[7]; } =20 static const TypeInfo scls_type =3D { @@ -1578,6 +1603,7 @@ static const TypeInfo scls_type =3D { static void sbook_class_init(ObjectClass *oc, void *data) { MachineClass *mc =3D MACHINE_CLASS(oc); + Sun4mMachineClass *smc =3D SUN4M_MACHINE_CLASS(mc); =20 mc->desc =3D "Sun4m platform, SPARCbook"; mc->init =3D sbook_init; @@ -1586,6 +1612,7 @@ static void sbook_class_init(ObjectClass *oc, void *d= ata) mc->default_cpu_type =3D SPARC_CPU_TYPE_NAME("TI-MicroSparc-I"); mc->default_display =3D "tcx"; mc->default_ram_id =3D "sun4m.ram"; + smc->hwdef =3D &sun4m_hwdefs[8]; } =20 static const TypeInfo sbook_type =3D { @@ -1598,6 +1625,7 @@ static const TypeInfo sun4m_machine_types[] =3D { { .name =3D TYPE_SUN4M_MACHINE, .parent =3D TYPE_MACHINE, + .class_size =3D sizeof(Sun4mMachineClass), .abstract =3D true, } }; --=20 2.20.1 From nobody Tue May 7 02:04:11 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1620200373; cv=none; d=zohomail.com; s=zohoarc; b=bnS8i9MbPSaq9l+Sfm540r+4R8Dgx8qSex/SMdaqD4WFmuTgD+TkMBiJg0eBN22Crh65RRkgIXP36+ZcaUXKG87NfRJbbWDgUqo78CHCgPh0eIeQGrMJ3/23fGVMQRQ6nfY3JNAV4N+/lezQFgJ2CBjBH3D+WZ/jKCm8M2nuiFs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1620200373; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=XpbCxgLu9EenLbcuYNtjBU11Nxs7IlkvQ9zNxV6EmeQ=; b=ApYbFY22Gx/uBBXoBZpyjGcVKCYuTdDY+dKS9tsPUGiCEME7ViAD3T4k07S16pcy79e8xThuYmovKJh6rrPEYMXXHuFHOU9Fe7YfEBBLD2VuwYrETJ8oM2tkDVThkvSZ0k9julYAAs7TCU0QmZqnfSgpTJJKjUK5lxc4tFMLc2U= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1620200373327948.7537985362899; Wed, 5 May 2021 00:39:33 -0700 (PDT) Received: from localhost ([::1]:43986 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1leC82-0004AD-Ac for importer@patchew.org; Wed, 05 May 2021 03:39:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52836) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1leC4Z-0007YG-RZ for qemu-devel@nongnu.org; Wed, 05 May 2021 03:35:55 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:57690 helo=mail.default.ilande.uk0.bigv.io) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1leC4U-00025f-1k for qemu-devel@nongnu.org; Wed, 05 May 2021 03:35:55 -0400 Received: from host81-154-26-71.range81-154.btcentralplus.com ([81.154.26.71] helo=kentang.home) by mail.default.ilande.uk0.bigv.io with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1leC4Q-0000OI-O4; Wed, 05 May 2021 08:35:48 +0100 From: Mark Cave-Ayland To: peter.maydell@linaro.org, qemu-devel@nongnu.org Date: Wed, 5 May 2021 08:35:31 +0100 Message-Id: <20210505073538.11438-4-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210505073538.11438-1-mark.cave-ayland@ilande.co.uk> References: <20210505073538.11438-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 81.154.26.71 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PULL 03/10] hw/sparc/sun4m: Factor out sun4m_machine_class_init() X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.default.ilande.uk0.bigv.io) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.default.ilande.uk0.bigv.io X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daud=C3=A9 Factor out the class_init code common to all machines to sun4m_machine_class_init(). Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Mark Cave-Ayland Message-Id: <20210503171303.822501-4-f4bug@amsat.org> Signed-off-by: Mark Cave-Ayland --- hw/sparc/sun4m.c | 103 ++++------------------------------------------- 1 file changed, 8 insertions(+), 95 deletions(-) diff --git a/hw/sparc/sun4m.c b/hw/sparc/sun4m.c index c2bc8a9fa5..56f927e66c 100644 --- a/hw/sparc/sun4m.c +++ b/hw/sparc/sun4m.c @@ -1374,58 +1374,15 @@ static const struct sun4m_hwdef sun4m_hwdefs[] =3D { }, }; =20 -/* SPARCstation 5 hardware initialisation */ -static void ss5_init(MachineState *machine) +static void sun4m_machine_class_init(ObjectClass *oc, void *data) { - sun4m_hw_init(machine); -} - -/* SPARCstation 10 hardware initialisation */ -static void ss10_init(MachineState *machine) -{ - sun4m_hw_init(machine); -} - -/* SPARCserver 600MP hardware initialisation */ -static void ss600mp_init(MachineState *machine) -{ - sun4m_hw_init(machine); -} - -/* SPARCstation 20 hardware initialisation */ -static void ss20_init(MachineState *machine) -{ - sun4m_hw_init(machine); -} - -/* SPARCstation Voyager hardware initialisation */ -static void vger_init(MachineState *machine) -{ - sun4m_hw_init(machine); -} - -/* SPARCstation LX hardware initialisation */ -static void ss_lx_init(MachineState *machine) -{ - sun4m_hw_init(machine); -} - -/* SPARCstation 4 hardware initialisation */ -static void ss4_init(MachineState *machine) -{ - sun4m_hw_init(machine); -} - -/* SPARCClassic hardware initialisation */ -static void scls_init(MachineState *machine) -{ - sun4m_hw_init(machine); -} + MachineClass *mc =3D MACHINE_CLASS(oc); =20 -/* SPARCbook hardware initialisation */ -static void sbook_init(MachineState *machine) -{ - sun4m_hw_init(machine); + mc->init =3D sun4m_hw_init; + mc->block_default_type =3D IF_SCSI; + mc->default_boot_order =3D "c"; + mc->default_display =3D "tcx"; + mc->default_ram_id =3D "sun4m.ram"; } =20 static void ss5_class_init(ObjectClass *oc, void *data) @@ -1434,13 +1391,8 @@ static void ss5_class_init(ObjectClass *oc, void *da= ta) Sun4mMachineClass *smc =3D SUN4M_MACHINE_CLASS(mc); =20 mc->desc =3D "Sun4m platform, SPARCstation 5"; - mc->init =3D ss5_init; - mc->block_default_type =3D IF_SCSI; mc->is_default =3D true; - mc->default_boot_order =3D "c"; mc->default_cpu_type =3D SPARC_CPU_TYPE_NAME("Fujitsu-MB86904"); - mc->default_display =3D "tcx"; - mc->default_ram_id =3D "sun4m.ram"; smc->hwdef =3D &sun4m_hwdefs[0]; } =20 @@ -1456,13 +1408,8 @@ static void ss10_class_init(ObjectClass *oc, void *d= ata) Sun4mMachineClass *smc =3D SUN4M_MACHINE_CLASS(mc); =20 mc->desc =3D "Sun4m platform, SPARCstation 10"; - mc->init =3D ss10_init; - mc->block_default_type =3D IF_SCSI; mc->max_cpus =3D 4; - mc->default_boot_order =3D "c"; mc->default_cpu_type =3D SPARC_CPU_TYPE_NAME("TI-SuperSparc-II"); - mc->default_display =3D "tcx"; - mc->default_ram_id =3D "sun4m.ram"; smc->hwdef =3D &sun4m_hwdefs[1]; } =20 @@ -1478,13 +1425,8 @@ static void ss600mp_class_init(ObjectClass *oc, void= *data) Sun4mMachineClass *smc =3D SUN4M_MACHINE_CLASS(mc); =20 mc->desc =3D "Sun4m platform, SPARCserver 600MP"; - mc->init =3D ss600mp_init; - mc->block_default_type =3D IF_SCSI; mc->max_cpus =3D 4; - mc->default_boot_order =3D "c"; mc->default_cpu_type =3D SPARC_CPU_TYPE_NAME("TI-SuperSparc-II"); - mc->default_display =3D "tcx"; - mc->default_ram_id =3D "sun4m.ram"; smc->hwdef =3D &sun4m_hwdefs[2]; } =20 @@ -1500,13 +1442,8 @@ static void ss20_class_init(ObjectClass *oc, void *d= ata) Sun4mMachineClass *smc =3D SUN4M_MACHINE_CLASS(mc); =20 mc->desc =3D "Sun4m platform, SPARCstation 20"; - mc->init =3D ss20_init; - mc->block_default_type =3D IF_SCSI; mc->max_cpus =3D 4; - mc->default_boot_order =3D "c"; mc->default_cpu_type =3D SPARC_CPU_TYPE_NAME("TI-SuperSparc-II"); - mc->default_display =3D "tcx"; - mc->default_ram_id =3D "sun4m.ram"; smc->hwdef =3D &sun4m_hwdefs[3]; } =20 @@ -1522,12 +1459,7 @@ static void voyager_class_init(ObjectClass *oc, void= *data) Sun4mMachineClass *smc =3D SUN4M_MACHINE_CLASS(mc); =20 mc->desc =3D "Sun4m platform, SPARCstation Voyager"; - mc->init =3D vger_init; - mc->block_default_type =3D IF_SCSI; - mc->default_boot_order =3D "c"; mc->default_cpu_type =3D SPARC_CPU_TYPE_NAME("Fujitsu-MB86904"); - mc->default_display =3D "tcx"; - mc->default_ram_id =3D "sun4m.ram"; smc->hwdef =3D &sun4m_hwdefs[4]; } =20 @@ -1543,12 +1475,7 @@ static void ss_lx_class_init(ObjectClass *oc, void *= data) Sun4mMachineClass *smc =3D SUN4M_MACHINE_CLASS(mc); =20 mc->desc =3D "Sun4m platform, SPARCstation LX"; - mc->init =3D ss_lx_init; - mc->block_default_type =3D IF_SCSI; - mc->default_boot_order =3D "c"; mc->default_cpu_type =3D SPARC_CPU_TYPE_NAME("TI-MicroSparc-I"); - mc->default_display =3D "tcx"; - mc->default_ram_id =3D "sun4m.ram"; smc->hwdef =3D &sun4m_hwdefs[5]; } =20 @@ -1564,12 +1491,7 @@ static void ss4_class_init(ObjectClass *oc, void *da= ta) Sun4mMachineClass *smc =3D SUN4M_MACHINE_CLASS(mc); =20 mc->desc =3D "Sun4m platform, SPARCstation 4"; - mc->init =3D ss4_init; - mc->block_default_type =3D IF_SCSI; - mc->default_boot_order =3D "c"; mc->default_cpu_type =3D SPARC_CPU_TYPE_NAME("Fujitsu-MB86904"); - mc->default_display =3D "tcx"; - mc->default_ram_id =3D "sun4m.ram"; smc->hwdef =3D &sun4m_hwdefs[6]; } =20 @@ -1585,12 +1507,7 @@ static void scls_class_init(ObjectClass *oc, void *d= ata) Sun4mMachineClass *smc =3D SUN4M_MACHINE_CLASS(mc); =20 mc->desc =3D "Sun4m platform, SPARCClassic"; - mc->init =3D scls_init; - mc->block_default_type =3D IF_SCSI; - mc->default_boot_order =3D "c"; mc->default_cpu_type =3D SPARC_CPU_TYPE_NAME("TI-MicroSparc-I"); - mc->default_display =3D "tcx"; - mc->default_ram_id =3D "sun4m.ram"; smc->hwdef =3D &sun4m_hwdefs[7]; } =20 @@ -1606,12 +1523,7 @@ static void sbook_class_init(ObjectClass *oc, void *= data) Sun4mMachineClass *smc =3D SUN4M_MACHINE_CLASS(mc); =20 mc->desc =3D "Sun4m platform, SPARCbook"; - mc->init =3D sbook_init; - mc->block_default_type =3D IF_SCSI; - mc->default_boot_order =3D "c"; mc->default_cpu_type =3D SPARC_CPU_TYPE_NAME("TI-MicroSparc-I"); - mc->default_display =3D "tcx"; - mc->default_ram_id =3D "sun4m.ram"; smc->hwdef =3D &sun4m_hwdefs[8]; } =20 @@ -1626,6 +1538,7 @@ static const TypeInfo sun4m_machine_types[] =3D { .name =3D TYPE_SUN4M_MACHINE, .parent =3D TYPE_MACHINE, .class_size =3D sizeof(Sun4mMachineClass), + .class_init =3D sun4m_machine_class_init, .abstract =3D true, } }; --=20 2.20.1 From nobody Tue May 7 02:04:11 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1620200375; cv=none; d=zohomail.com; s=zohoarc; b=D5wRooXgJp+CDOVcj0BX814J6CFT0SGVupLuU+MrqCP0Z6c4kE836pUtsahBKCM1FmcQDomN9tq09U9R92VTAo8rRzqCE4z6wAU2VvFKVAgOzVA6i3kXf0jdxP38rNsLi99Dk8ANn+/bSHucLMsbEx1LLUwf2eF0vwh3X/H2Ezo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1620200375; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=FBHrQNmb+xIXpOs+BIoP88NYO+ugyvHgdl9GtdnOCYU=; b=Q8tdr4eV9kKr7HFxvXGMj9qHhl6yvT+hPqeyPtPtN2GvdWcsaAQz+3rX6ieVfs/Sh+Srew39h1iBNR9A3FF46uqEhP2KFPRCX4EA/AZI/atq9BbenOMnobBRXsJbcb9fq6+VUwBQa9or6MgGx3ZN/QPfDJMRoEcO1wCOvOhmNJs= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1620200375100139.6378193058904; Wed, 5 May 2021 00:39:35 -0700 (PDT) Received: from localhost ([::1]:44504 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1leC86-0004Mi-EB for importer@patchew.org; Wed, 05 May 2021 03:39:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52904) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1leC4d-0007ds-G6 for qemu-devel@nongnu.org; Wed, 05 May 2021 03:35:59 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:57696 helo=mail.default.ilande.uk0.bigv.io) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1leC4W-00027U-2h for qemu-devel@nongnu.org; Wed, 05 May 2021 03:35:59 -0400 Received: from host81-154-26-71.range81-154.btcentralplus.com ([81.154.26.71] helo=kentang.home) by mail.default.ilande.uk0.bigv.io with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1leC4S-0000OI-MH; Wed, 05 May 2021 08:35:50 +0100 From: Mark Cave-Ayland To: peter.maydell@linaro.org, qemu-devel@nongnu.org Date: Wed, 5 May 2021 08:35:32 +0100 Message-Id: <20210505073538.11438-5-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210505073538.11438-1-mark.cave-ayland@ilande.co.uk> References: <20210505073538.11438-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 81.154.26.71 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PULL 04/10] hw/sparc/sun4m: Register machine types in sun4m_machine_types[] X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.default.ilande.uk0.bigv.io) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.default.ilande.uk0.bigv.io X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Mark Cave-Ayland Message-Id: <20210503171303.822501-5-f4bug@amsat.org> Signed-off-by: Mark Cave-Ayland --- hw/sparc/sun4m.c | 100 +++++++++++++++++------------------------------ 1 file changed, 36 insertions(+), 64 deletions(-) diff --git a/hw/sparc/sun4m.c b/hw/sparc/sun4m.c index 56f927e66c..a625c41cd3 100644 --- a/hw/sparc/sun4m.c +++ b/hw/sparc/sun4m.c @@ -1396,12 +1396,6 @@ static void ss5_class_init(ObjectClass *oc, void *da= ta) smc->hwdef =3D &sun4m_hwdefs[0]; } =20 -static const TypeInfo ss5_type =3D { - .name =3D MACHINE_TYPE_NAME("SS-5"), - .parent =3D TYPE_SUN4M_MACHINE, - .class_init =3D ss5_class_init, -}; - static void ss10_class_init(ObjectClass *oc, void *data) { MachineClass *mc =3D MACHINE_CLASS(oc); @@ -1413,12 +1407,6 @@ static void ss10_class_init(ObjectClass *oc, void *d= ata) smc->hwdef =3D &sun4m_hwdefs[1]; } =20 -static const TypeInfo ss10_type =3D { - .name =3D MACHINE_TYPE_NAME("SS-10"), - .parent =3D TYPE_SUN4M_MACHINE, - .class_init =3D ss10_class_init, -}; - static void ss600mp_class_init(ObjectClass *oc, void *data) { MachineClass *mc =3D MACHINE_CLASS(oc); @@ -1430,12 +1418,6 @@ static void ss600mp_class_init(ObjectClass *oc, void= *data) smc->hwdef =3D &sun4m_hwdefs[2]; } =20 -static const TypeInfo ss600mp_type =3D { - .name =3D MACHINE_TYPE_NAME("SS-600MP"), - .parent =3D TYPE_SUN4M_MACHINE, - .class_init =3D ss600mp_class_init, -}; - static void ss20_class_init(ObjectClass *oc, void *data) { MachineClass *mc =3D MACHINE_CLASS(oc); @@ -1447,12 +1429,6 @@ static void ss20_class_init(ObjectClass *oc, void *d= ata) smc->hwdef =3D &sun4m_hwdefs[3]; } =20 -static const TypeInfo ss20_type =3D { - .name =3D MACHINE_TYPE_NAME("SS-20"), - .parent =3D TYPE_SUN4M_MACHINE, - .class_init =3D ss20_class_init, -}; - static void voyager_class_init(ObjectClass *oc, void *data) { MachineClass *mc =3D MACHINE_CLASS(oc); @@ -1463,12 +1439,6 @@ static void voyager_class_init(ObjectClass *oc, void= *data) smc->hwdef =3D &sun4m_hwdefs[4]; } =20 -static const TypeInfo voyager_type =3D { - .name =3D MACHINE_TYPE_NAME("Voyager"), - .parent =3D TYPE_SUN4M_MACHINE, - .class_init =3D voyager_class_init, -}; - static void ss_lx_class_init(ObjectClass *oc, void *data) { MachineClass *mc =3D MACHINE_CLASS(oc); @@ -1479,12 +1449,6 @@ static void ss_lx_class_init(ObjectClass *oc, void *= data) smc->hwdef =3D &sun4m_hwdefs[5]; } =20 -static const TypeInfo ss_lx_type =3D { - .name =3D MACHINE_TYPE_NAME("LX"), - .parent =3D TYPE_SUN4M_MACHINE, - .class_init =3D ss_lx_class_init, -}; - static void ss4_class_init(ObjectClass *oc, void *data) { MachineClass *mc =3D MACHINE_CLASS(oc); @@ -1495,12 +1459,6 @@ static void ss4_class_init(ObjectClass *oc, void *da= ta) smc->hwdef =3D &sun4m_hwdefs[6]; } =20 -static const TypeInfo ss4_type =3D { - .name =3D MACHINE_TYPE_NAME("SS-4"), - .parent =3D TYPE_SUN4M_MACHINE, - .class_init =3D ss4_class_init, -}; - static void scls_class_init(ObjectClass *oc, void *data) { MachineClass *mc =3D MACHINE_CLASS(oc); @@ -1511,12 +1469,6 @@ static void scls_class_init(ObjectClass *oc, void *d= ata) smc->hwdef =3D &sun4m_hwdefs[7]; } =20 -static const TypeInfo scls_type =3D { - .name =3D MACHINE_TYPE_NAME("SPARCClassic"), - .parent =3D TYPE_SUN4M_MACHINE, - .class_init =3D scls_class_init, -}; - static void sbook_class_init(ObjectClass *oc, void *data) { MachineClass *mc =3D MACHINE_CLASS(oc); @@ -1527,14 +1479,44 @@ static void sbook_class_init(ObjectClass *oc, void = *data) smc->hwdef =3D &sun4m_hwdefs[8]; } =20 -static const TypeInfo sbook_type =3D { - .name =3D MACHINE_TYPE_NAME("SPARCbook"), - .parent =3D TYPE_SUN4M_MACHINE, - .class_init =3D sbook_class_init, -}; - static const TypeInfo sun4m_machine_types[] =3D { { + .name =3D MACHINE_TYPE_NAME("SS-5"), + .parent =3D TYPE_SUN4M_MACHINE, + .class_init =3D ss5_class_init, + }, { + .name =3D MACHINE_TYPE_NAME("SS-10"), + .parent =3D TYPE_SUN4M_MACHINE, + .class_init =3D ss10_class_init, + }, { + .name =3D MACHINE_TYPE_NAME("SS-600MP"), + .parent =3D TYPE_SUN4M_MACHINE, + .class_init =3D ss600mp_class_init, + }, { + .name =3D MACHINE_TYPE_NAME("SS-20"), + .parent =3D TYPE_SUN4M_MACHINE, + .class_init =3D ss20_class_init, + }, { + .name =3D MACHINE_TYPE_NAME("Voyager"), + .parent =3D TYPE_SUN4M_MACHINE, + .class_init =3D voyager_class_init, + }, { + .name =3D MACHINE_TYPE_NAME("LX"), + .parent =3D TYPE_SUN4M_MACHINE, + .class_init =3D ss_lx_class_init, + }, { + .name =3D MACHINE_TYPE_NAME("SS-4"), + .parent =3D TYPE_SUN4M_MACHINE, + .class_init =3D ss4_class_init, + }, { + .name =3D MACHINE_TYPE_NAME("SPARCClassic"), + .parent =3D TYPE_SUN4M_MACHINE, + .class_init =3D scls_class_init, + }, { + .name =3D MACHINE_TYPE_NAME("SPARCbook"), + .parent =3D TYPE_SUN4M_MACHINE, + .class_init =3D sbook_class_init, + }, { .name =3D TYPE_SUN4M_MACHINE, .parent =3D TYPE_MACHINE, .class_size =3D sizeof(Sun4mMachineClass), @@ -1551,16 +1533,6 @@ static void sun4m_register_types(void) type_register_static(&afx_info); type_register_static(&prom_info); type_register_static(&ram_info); - - type_register_static(&ss5_type); - type_register_static(&ss10_type); - type_register_static(&ss600mp_type); - type_register_static(&ss20_type); - type_register_static(&voyager_type); - type_register_static(&ss_lx_type); - type_register_static(&ss4_type); - type_register_static(&scls_type); - type_register_static(&sbook_type); } =20 type_init(sun4m_register_types) --=20 2.20.1 From nobody Tue May 7 02:04:11 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1620200248; cv=none; d=zohomail.com; s=zohoarc; b=krUW69fIAN8ctlSuLrAc7pJQW6j/DsSYvbZDXiNw7hYVE55Uq8XsNiUkPBvIRihQPgiCOENkl/nKafEZouD6+5RwKgFD2GJ1XGtN/QcG2ym0tmShzIKTT4+4uoJpEXd7aUlbhJ/kN7mhL5Xey9TebYesyPv1oMKxe2mbiY7u/E0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1620200248; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=2BTwmdLhDuPLk4I5E6RLLSjCsmTfd1Y8eKh2auPiZMs=; b=URKUMJN2FXvDIShOkTWINndPIcqW8qEcIVSyCGLtlmaNYg6YWahB92/UsLZD5eEg7o3eQdpDozC5ZvsArFx08vndRAfP0nT1U5JYi8BICU+F/pBuF8ztR40w/GrYrpohrxi62KJN5BDaR1eG5mfiLMSMMWrRFUe3RLuehkHKtwk= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1620200248078573.7563340249019; Wed, 5 May 2021 00:37:28 -0700 (PDT) Received: from localhost ([::1]:35934 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1leC62-0000ww-VM for importer@patchew.org; Wed, 05 May 2021 03:37:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52870) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1leC4b-0007aA-DZ for qemu-devel@nongnu.org; Wed, 05 May 2021 03:35:57 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:57700 helo=mail.default.ilande.uk0.bigv.io) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1leC4W-00027q-JS for qemu-devel@nongnu.org; Wed, 05 May 2021 03:35:57 -0400 Received: from host81-154-26-71.range81-154.btcentralplus.com ([81.154.26.71] helo=kentang.home) by mail.default.ilande.uk0.bigv.io with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1leC4U-0000OI-6h; Wed, 05 May 2021 08:35:50 +0100 From: Mark Cave-Ayland To: peter.maydell@linaro.org, qemu-devel@nongnu.org Date: Wed, 5 May 2021 08:35:33 +0100 Message-Id: <20210505073538.11438-6-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210505073538.11438-1-mark.cave-ayland@ilande.co.uk> References: <20210505073538.11438-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 81.154.26.71 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PULL 05/10] hw/sparc/sun4m: Fix code style for checkpatch.pl X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.default.ilande.uk0.bigv.io) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.default.ilande.uk0.bigv.io X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daud=C3=A9 We are going to move this code, fix its style first. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Mark Cave-Ayland Message-Id: <20210503171303.822501-6-f4bug@amsat.org> Signed-off-by: Mark Cave-Ayland --- hw/sparc/sun4m.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/hw/sparc/sun4m.c b/hw/sparc/sun4m.c index a625c41cd3..956216591b 100644 --- a/hw/sparc/sun4m.c +++ b/hw/sparc/sun4m.c @@ -1181,11 +1181,11 @@ static const struct sun4m_hwdef sun4m_hwdefs[] =3D { .dma_base =3D 0xef0400000ULL, .esp_base =3D 0xef0800000ULL, .le_base =3D 0xef0c00000ULL, - .apc_base =3D 0xefa000000ULL, // XXX should not exist + .apc_base =3D 0xefa000000ULL, /* XXX should not exist */ .aux1_base =3D 0xff1800000ULL, .aux2_base =3D 0xff1a01000ULL, .ecc_base =3D 0xf00000000ULL, - .ecc_version =3D 0x10000000, // version 0, implementation 1 + .ecc_version =3D 0x10000000, /* version 0, implementation 1 */ .nvram_machine_id =3D 0x72, .machine_id =3D ss10_id, .iommu_version =3D 0x03000000, @@ -1204,11 +1204,11 @@ static const struct sun4m_hwdef sun4m_hwdefs[] =3D { .dma_base =3D 0xef0081000ULL, .esp_base =3D 0xef0080000ULL, .le_base =3D 0xef0060000ULL, - .apc_base =3D 0xefa000000ULL, // XXX should not exist + .apc_base =3D 0xefa000000ULL, /* XXX should not exist */ .aux1_base =3D 0xff1800000ULL, - .aux2_base =3D 0xff1a01000ULL, // XXX should not exist + .aux2_base =3D 0xff1a01000ULL, /* XXX should not exist */ .ecc_base =3D 0xf00000000ULL, - .ecc_version =3D 0x00000000, // version 0, implementation 0 + .ecc_version =3D 0x00000000, /* version 0, implementation 0 */ .nvram_machine_id =3D 0x71, .machine_id =3D ss600mp_id, .iommu_version =3D 0x01000000, @@ -1230,7 +1230,7 @@ static const struct sun4m_hwdef sun4m_hwdefs[] =3D { .esp_base =3D 0xef0800000ULL, .le_base =3D 0xef0c00000ULL, .bpp_base =3D 0xef4800000ULL, - .apc_base =3D 0xefa000000ULL, // XXX should not exist + .apc_base =3D 0xefa000000ULL, /* XXX should not exist */ .aux1_base =3D 0xff1800000ULL, .aux2_base =3D 0xff1a01000ULL, .dbri_base =3D 0xee0000000ULL, @@ -1249,7 +1249,7 @@ static const struct sun4m_hwdef sun4m_hwdefs[] =3D { } }, .ecc_base =3D 0xf00000000ULL, - .ecc_version =3D 0x20000000, // version 0, implementation 2 + .ecc_version =3D 0x20000000, /* version 0, implementation 2 */ .nvram_machine_id =3D 0x72, .machine_id =3D ss20_id, .iommu_version =3D 0x13000000, @@ -1270,7 +1270,7 @@ static const struct sun4m_hwdef sun4m_hwdefs[] =3D { .dma_base =3D 0x78400000, .esp_base =3D 0x78800000, .le_base =3D 0x78c00000, - .apc_base =3D 0x71300000, // pmc + .apc_base =3D 0x71300000, /* pmc */ .aux1_base =3D 0x71900000, .aux2_base =3D 0x71910000, .nvram_machine_id =3D 0x80, @@ -1352,7 +1352,7 @@ static const struct sun4m_hwdef sun4m_hwdefs[] =3D { /* SPARCbook */ { .iommu_base =3D 0x10000000, - .tcx_base =3D 0x50000000, // XXX + .tcx_base =3D 0x50000000, /* XXX */ .slavio_base =3D 0x70000000, .ms_kb_base =3D 0x71000000, .serial_base =3D 0x71100000, --=20 2.20.1 From nobody Tue May 7 02:04:11 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1620200248; cv=none; d=zohomail.com; s=zohoarc; b=MnrJnTQoWgoMnRnT4zPZWaZs8sECUeomiYyGIdw90IsSfVs7J8SRgJtdzmkq6Pp9eVW/C57LTXvwwyWVac4rcD9USvroTnMPjNxfIIHHCWqeCN2ZdOkh0pCIMABhtoQjaTNYSso18KMJs5ug/P5ILcgzViGGC/vnes34IFISmpo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1620200248; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=LwcqNOWllX1eAm9FUfjswAzjLPu1RRvqkzqdGh457rg=; b=i4k0lexiE1XPTCaNJ/69huXwUk5M3iIgb6OkWHO19lwBtqN9CNhy4KPuNClgD2vp9oV/mdoQstGQOQ/925myefHoS8mHf09i1VgOqbXRWEfrdzc1Iz909g81GV18P0G84pPQwLuBzzmptcXTECf6iy3DaxuUpXe7SLRkwhEGc5M= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1620200248678492.08204423778454; Wed, 5 May 2021 00:37:28 -0700 (PDT) Received: from localhost ([::1]:36026 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1leC63-0000z5-SG for importer@patchew.org; Wed, 05 May 2021 03:37:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52884) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1leC4b-0007b0-UP for qemu-devel@nongnu.org; Wed, 05 May 2021 03:35:57 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:57706 helo=mail.default.ilande.uk0.bigv.io) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1leC4X-000281-RT for qemu-devel@nongnu.org; Wed, 05 May 2021 03:35:57 -0400 Received: from host81-154-26-71.range81-154.btcentralplus.com ([81.154.26.71] helo=kentang.home) by mail.default.ilande.uk0.bigv.io with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1leC4U-0000OI-MI; Wed, 05 May 2021 08:35:51 +0100 From: Mark Cave-Ayland To: peter.maydell@linaro.org, qemu-devel@nongnu.org Date: Wed, 5 May 2021 08:35:34 +0100 Message-Id: <20210505073538.11438-7-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210505073538.11438-1-mark.cave-ayland@ilande.co.uk> References: <20210505073538.11438-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 81.154.26.71 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PULL 06/10] hw/sparc/sun4m: Move each sun4m_hwdef definition in its class_init X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.default.ilande.uk0.bigv.io) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.default.ilande.uk0.bigv.io X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daud=C3=A9 Remove the sun4m_hwdefs[] array by moving assigning the structure fields directly in each machine class_init() function. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Mark Cave-Ayland Message-Id: <20210503171303.822501-7-f4bug@amsat.org> Signed-off-by: Mark Cave-Ayland --- hw/sparc/sun4m.c | 248 ++++++++++++++++++++++------------------------- 1 file changed, 118 insertions(+), 130 deletions(-) diff --git a/hw/sparc/sun4m.c b/hw/sparc/sun4m.c index 956216591b..263732b904 100644 --- a/hw/sparc/sun4m.c +++ b/hw/sparc/sun4m.c @@ -1138,9 +1138,22 @@ enum { ss600mp_id, }; =20 -static const struct sun4m_hwdef sun4m_hwdefs[] =3D { - /* SS-5 */ - { +static void sun4m_machine_class_init(ObjectClass *oc, void *data) +{ + MachineClass *mc =3D MACHINE_CLASS(oc); + + mc->init =3D sun4m_hw_init; + mc->block_default_type =3D IF_SCSI; + mc->default_boot_order =3D "c"; + mc->default_display =3D "tcx"; + mc->default_ram_id =3D "sun4m.ram"; +} + +static void ss5_class_init(ObjectClass *oc, void *data) +{ + MachineClass *mc =3D MACHINE_CLASS(oc); + Sun4mMachineClass *smc =3D SUN4M_MACHINE_CLASS(mc); + static const struct sun4m_hwdef ss5_hwdef =3D { .iommu_base =3D 0x10000000, .iommu_pad_base =3D 0x10004000, .iommu_pad_len =3D 0x0fffb000, @@ -1165,9 +1178,19 @@ static const struct sun4m_hwdef sun4m_hwdefs[] =3D { .machine_id =3D ss5_id, .iommu_version =3D 0x05000000, .max_mem =3D 0x10000000, - }, - /* SS-10 */ - { + }; + + mc->desc =3D "Sun4m platform, SPARCstation 5"; + mc->is_default =3D true; + mc->default_cpu_type =3D SPARC_CPU_TYPE_NAME("Fujitsu-MB86904"); + smc->hwdef =3D &ss5_hwdef; +} + +static void ss10_class_init(ObjectClass *oc, void *data) +{ + MachineClass *mc =3D MACHINE_CLASS(oc); + Sun4mMachineClass *smc =3D SUN4M_MACHINE_CLASS(mc); + static const struct sun4m_hwdef ss10_hwdef =3D { .iommu_base =3D 0xfe0000000ULL, .tcx_base =3D 0xe20000000ULL, .slavio_base =3D 0xff0000000ULL, @@ -1190,9 +1213,19 @@ static const struct sun4m_hwdef sun4m_hwdefs[] =3D { .machine_id =3D ss10_id, .iommu_version =3D 0x03000000, .max_mem =3D 0xf00000000ULL, - }, - /* SS-600MP */ - { + }; + + mc->desc =3D "Sun4m platform, SPARCstation 10"; + mc->max_cpus =3D 4; + mc->default_cpu_type =3D SPARC_CPU_TYPE_NAME("TI-SuperSparc-II"); + smc->hwdef =3D &ss10_hwdef; +} + +static void ss600mp_class_init(ObjectClass *oc, void *data) +{ + MachineClass *mc =3D MACHINE_CLASS(oc); + Sun4mMachineClass *smc =3D SUN4M_MACHINE_CLASS(mc); + static const struct sun4m_hwdef ss600mp_hwdef =3D { .iommu_base =3D 0xfe0000000ULL, .tcx_base =3D 0xe20000000ULL, .slavio_base =3D 0xff0000000ULL, @@ -1213,9 +1246,19 @@ static const struct sun4m_hwdef sun4m_hwdefs[] =3D { .machine_id =3D ss600mp_id, .iommu_version =3D 0x01000000, .max_mem =3D 0xf00000000ULL, - }, - /* SS-20 */ - { + }; + + mc->desc =3D "Sun4m platform, SPARCserver 600MP"; + mc->max_cpus =3D 4; + mc->default_cpu_type =3D SPARC_CPU_TYPE_NAME("TI-SuperSparc-II"); + smc->hwdef =3D &ss600mp_hwdef; +} + +static void ss20_class_init(ObjectClass *oc, void *data) +{ + MachineClass *mc =3D MACHINE_CLASS(oc); + Sun4mMachineClass *smc =3D SUN4M_MACHINE_CLASS(mc); + static const struct sun4m_hwdef ss20_hwdef =3D { .iommu_base =3D 0xfe0000000ULL, .tcx_base =3D 0xe20000000ULL, .slavio_base =3D 0xff0000000ULL, @@ -1254,9 +1297,19 @@ static const struct sun4m_hwdef sun4m_hwdefs[] =3D { .machine_id =3D ss20_id, .iommu_version =3D 0x13000000, .max_mem =3D 0xf00000000ULL, - }, - /* Voyager */ - { + }; + + mc->desc =3D "Sun4m platform, SPARCstation 20"; + mc->max_cpus =3D 4; + mc->default_cpu_type =3D SPARC_CPU_TYPE_NAME("TI-SuperSparc-II"); + smc->hwdef =3D &ss20_hwdef; +} + +static void voyager_class_init(ObjectClass *oc, void *data) +{ + MachineClass *mc =3D MACHINE_CLASS(oc); + Sun4mMachineClass *smc =3D SUN4M_MACHINE_CLASS(mc); + static const struct sun4m_hwdef voyager_hwdef =3D { .iommu_base =3D 0x10000000, .tcx_base =3D 0x50000000, .slavio_base =3D 0x70000000, @@ -1277,9 +1330,18 @@ static const struct sun4m_hwdef sun4m_hwdefs[] =3D { .machine_id =3D vger_id, .iommu_version =3D 0x05000000, .max_mem =3D 0x10000000, - }, - /* LX */ - { + }; + + mc->desc =3D "Sun4m platform, SPARCstation Voyager"; + mc->default_cpu_type =3D SPARC_CPU_TYPE_NAME("Fujitsu-MB86904"); + smc->hwdef =3D &voyager_hwdef; +} + +static void ss_lx_class_init(ObjectClass *oc, void *data) +{ + MachineClass *mc =3D MACHINE_CLASS(oc); + Sun4mMachineClass *smc =3D SUN4M_MACHINE_CLASS(mc); + static const struct sun4m_hwdef ss_lx_hwdef =3D { .iommu_base =3D 0x10000000, .iommu_pad_base =3D 0x10004000, .iommu_pad_len =3D 0x0fffb000, @@ -1301,9 +1363,18 @@ static const struct sun4m_hwdef sun4m_hwdefs[] =3D { .machine_id =3D lx_id, .iommu_version =3D 0x04000000, .max_mem =3D 0x10000000, - }, - /* SS-4 */ - { + }; + + mc->desc =3D "Sun4m platform, SPARCstation LX"; + mc->default_cpu_type =3D SPARC_CPU_TYPE_NAME("TI-MicroSparc-I"); + smc->hwdef =3D &ss_lx_hwdef; +} + +static void ss4_class_init(ObjectClass *oc, void *data) +{ + MachineClass *mc =3D MACHINE_CLASS(oc); + Sun4mMachineClass *smc =3D SUN4M_MACHINE_CLASS(mc); + static const struct sun4m_hwdef ss4_hwdef =3D { .iommu_base =3D 0x10000000, .tcx_base =3D 0x50000000, .cs_base =3D 0x6c000000, @@ -1325,9 +1396,18 @@ static const struct sun4m_hwdef sun4m_hwdefs[] =3D { .machine_id =3D ss4_id, .iommu_version =3D 0x05000000, .max_mem =3D 0x10000000, - }, - /* SPARCClassic */ - { + }; + + mc->desc =3D "Sun4m platform, SPARCstation 4"; + mc->default_cpu_type =3D SPARC_CPU_TYPE_NAME("Fujitsu-MB86904"); + smc->hwdef =3D &ss4_hwdef; +} + +static void scls_class_init(ObjectClass *oc, void *data) +{ + MachineClass *mc =3D MACHINE_CLASS(oc); + Sun4mMachineClass *smc =3D SUN4M_MACHINE_CLASS(mc); + static const struct sun4m_hwdef scls_hwdef =3D { .iommu_base =3D 0x10000000, .tcx_base =3D 0x50000000, .slavio_base =3D 0x70000000, @@ -1348,9 +1428,18 @@ static const struct sun4m_hwdef sun4m_hwdefs[] =3D { .machine_id =3D scls_id, .iommu_version =3D 0x05000000, .max_mem =3D 0x10000000, - }, - /* SPARCbook */ - { + }; + + mc->desc =3D "Sun4m platform, SPARCClassic"; + mc->default_cpu_type =3D SPARC_CPU_TYPE_NAME("TI-MicroSparc-I"); + smc->hwdef =3D &scls_hwdef; +} + +static void sbook_class_init(ObjectClass *oc, void *data) +{ + MachineClass *mc =3D MACHINE_CLASS(oc); + Sun4mMachineClass *smc =3D SUN4M_MACHINE_CLASS(mc); + static const struct sun4m_hwdef sbook_hwdef =3D { .iommu_base =3D 0x10000000, .tcx_base =3D 0x50000000, /* XXX */ .slavio_base =3D 0x70000000, @@ -1371,112 +1460,11 @@ static const struct sun4m_hwdef sun4m_hwdefs[] =3D= { .machine_id =3D sbook_id, .iommu_version =3D 0x05000000, .max_mem =3D 0x10000000, - }, -}; - -static void sun4m_machine_class_init(ObjectClass *oc, void *data) -{ - MachineClass *mc =3D MACHINE_CLASS(oc); - - mc->init =3D sun4m_hw_init; - mc->block_default_type =3D IF_SCSI; - mc->default_boot_order =3D "c"; - mc->default_display =3D "tcx"; - mc->default_ram_id =3D "sun4m.ram"; -} - -static void ss5_class_init(ObjectClass *oc, void *data) -{ - MachineClass *mc =3D MACHINE_CLASS(oc); - Sun4mMachineClass *smc =3D SUN4M_MACHINE_CLASS(mc); - - mc->desc =3D "Sun4m platform, SPARCstation 5"; - mc->is_default =3D true; - mc->default_cpu_type =3D SPARC_CPU_TYPE_NAME("Fujitsu-MB86904"); - smc->hwdef =3D &sun4m_hwdefs[0]; -} - -static void ss10_class_init(ObjectClass *oc, void *data) -{ - MachineClass *mc =3D MACHINE_CLASS(oc); - Sun4mMachineClass *smc =3D SUN4M_MACHINE_CLASS(mc); - - mc->desc =3D "Sun4m platform, SPARCstation 10"; - mc->max_cpus =3D 4; - mc->default_cpu_type =3D SPARC_CPU_TYPE_NAME("TI-SuperSparc-II"); - smc->hwdef =3D &sun4m_hwdefs[1]; -} - -static void ss600mp_class_init(ObjectClass *oc, void *data) -{ - MachineClass *mc =3D MACHINE_CLASS(oc); - Sun4mMachineClass *smc =3D SUN4M_MACHINE_CLASS(mc); - - mc->desc =3D "Sun4m platform, SPARCserver 600MP"; - mc->max_cpus =3D 4; - mc->default_cpu_type =3D SPARC_CPU_TYPE_NAME("TI-SuperSparc-II"); - smc->hwdef =3D &sun4m_hwdefs[2]; -} - -static void ss20_class_init(ObjectClass *oc, void *data) -{ - MachineClass *mc =3D MACHINE_CLASS(oc); - Sun4mMachineClass *smc =3D SUN4M_MACHINE_CLASS(mc); - - mc->desc =3D "Sun4m platform, SPARCstation 20"; - mc->max_cpus =3D 4; - mc->default_cpu_type =3D SPARC_CPU_TYPE_NAME("TI-SuperSparc-II"); - smc->hwdef =3D &sun4m_hwdefs[3]; -} - -static void voyager_class_init(ObjectClass *oc, void *data) -{ - MachineClass *mc =3D MACHINE_CLASS(oc); - Sun4mMachineClass *smc =3D SUN4M_MACHINE_CLASS(mc); - - mc->desc =3D "Sun4m platform, SPARCstation Voyager"; - mc->default_cpu_type =3D SPARC_CPU_TYPE_NAME("Fujitsu-MB86904"); - smc->hwdef =3D &sun4m_hwdefs[4]; -} - -static void ss_lx_class_init(ObjectClass *oc, void *data) -{ - MachineClass *mc =3D MACHINE_CLASS(oc); - Sun4mMachineClass *smc =3D SUN4M_MACHINE_CLASS(mc); - - mc->desc =3D "Sun4m platform, SPARCstation LX"; - mc->default_cpu_type =3D SPARC_CPU_TYPE_NAME("TI-MicroSparc-I"); - smc->hwdef =3D &sun4m_hwdefs[5]; -} - -static void ss4_class_init(ObjectClass *oc, void *data) -{ - MachineClass *mc =3D MACHINE_CLASS(oc); - Sun4mMachineClass *smc =3D SUN4M_MACHINE_CLASS(mc); - - mc->desc =3D "Sun4m platform, SPARCstation 4"; - mc->default_cpu_type =3D SPARC_CPU_TYPE_NAME("Fujitsu-MB86904"); - smc->hwdef =3D &sun4m_hwdefs[6]; -} - -static void scls_class_init(ObjectClass *oc, void *data) -{ - MachineClass *mc =3D MACHINE_CLASS(oc); - Sun4mMachineClass *smc =3D SUN4M_MACHINE_CLASS(mc); - - mc->desc =3D "Sun4m platform, SPARCClassic"; - mc->default_cpu_type =3D SPARC_CPU_TYPE_NAME("TI-MicroSparc-I"); - smc->hwdef =3D &sun4m_hwdefs[7]; -} - -static void sbook_class_init(ObjectClass *oc, void *data) -{ - MachineClass *mc =3D MACHINE_CLASS(oc); - Sun4mMachineClass *smc =3D SUN4M_MACHINE_CLASS(mc); + }; =20 mc->desc =3D "Sun4m platform, SPARCbook"; mc->default_cpu_type =3D SPARC_CPU_TYPE_NAME("TI-MicroSparc-I"); - smc->hwdef =3D &sun4m_hwdefs[8]; + smc->hwdef =3D &sbook_hwdef; } =20 static const TypeInfo sun4m_machine_types[] =3D { --=20 2.20.1 From nobody Tue May 7 02:04:11 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1620200508; cv=none; d=zohomail.com; s=zohoarc; b=QY4Iocc/GiS9xOvLbPiY+JX4hSGYr73TJ77yRTI2oGccbgkc1pgFfuuGVeCKo3ZhsyGTELHo41H+GUCoDczZqTBikDzqNxkumpZlrjrjl9o6/cviA6B+KpnROMDDeKbGw7ADYjOHkZlNzHlGz6CMc+c3CcO1wBh/vzjE9ShwrEw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1620200508; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=/zajEqdETIqPVmW6UIal9Sf0+jtD9yPe69sXslSHYbo=; b=djDiE3Xg/+OIKZWiCXHE6MWthpoCh+WfLHl8EOJbYvGWnKBasgPy9CS3cMxVunM4+RJ0/E1SuIm6d+T8dzkw6S9aQ3xZzDSjVSe5MDYblsGx2VriMgATVOG7ruR3ngJluQmUv+qv/IAUYdbcKv/MK7fXon+F0COTNxob3punKj8= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1620200508884597.4786217942594; Wed, 5 May 2021 00:41:48 -0700 (PDT) Received: from localhost ([::1]:51590 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1leCAG-0007I3-31 for importer@patchew.org; Wed, 05 May 2021 03:41:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52888) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1leC4c-0007cF-HS for qemu-devel@nongnu.org; Wed, 05 May 2021 03:35:58 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:57712 helo=mail.default.ilande.uk0.bigv.io) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1leC4a-0002Bb-8l for qemu-devel@nongnu.org; Wed, 05 May 2021 03:35:58 -0400 Received: from host81-154-26-71.range81-154.btcentralplus.com ([81.154.26.71] helo=kentang.home) by mail.default.ilande.uk0.bigv.io with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1leC4V-0000OI-Cs; Wed, 05 May 2021 08:35:54 +0100 From: Mark Cave-Ayland To: peter.maydell@linaro.org, qemu-devel@nongnu.org Date: Wed, 5 May 2021 08:35:35 +0100 Message-Id: <20210505073538.11438-8-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210505073538.11438-1-mark.cave-ayland@ilande.co.uk> References: <20210505073538.11438-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 81.154.26.71 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PULL 07/10] hw/sparc: Allow building without the leon3 machine X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.default.ilande.uk0.bigv.io) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.default.ilande.uk0.bigv.io X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daud=C3=A9 When building without the leon3 machine, we get this link failure: /usr/bin/ld: target_sparc_int32_helper.c.o: in function `leon3_irq_manage= r': target/sparc/int32_helper.c:172: undefined reference to `leon3_irq_ack' This is because the leon3_irq_ack() is declared in hw/sparc/leon3.c, which is only build when CONFIG_LEON3 is selected. Fix by moving the leon3_cache_control_int() / leon3_irq_manager() (which are specific to the leon3 machine) to hw/sparc/leon3.c. Move the trace events along (but don't rename them). leon3_irq_ack() is now locally used, declare it static to reduce its scope. Reviewed-by: Richard Henderson Reviewed-by: KONRAD Frederic Tested-by: KONRAD Frederic Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Mark Cave-Ayland Message-Id: <20210428141655.387430-2-f4bug@amsat.org> Signed-off-by: Mark Cave-Ayland --- hw/sparc/leon3.c | 37 ++++++++++++++++++++++++++++++++++++- hw/sparc/trace-events | 2 ++ target/sparc/cpu.h | 6 ------ target/sparc/int32_helper.c | 37 ------------------------------------- target/sparc/trace-events | 4 ---- 5 files changed, 38 insertions(+), 48 deletions(-) diff --git a/hw/sparc/leon3.c b/hw/sparc/leon3.c index 7e16eea9e6..98e3789cf8 100644 --- a/hw/sparc/leon3.c +++ b/hw/sparc/leon3.c @@ -137,7 +137,36 @@ static void main_cpu_reset(void *opaque) env->regbase[6] =3D s->sp; } =20 -void leon3_irq_ack(void *irq_manager, int intno) +static void leon3_cache_control_int(CPUSPARCState *env) +{ + uint32_t state =3D 0; + + if (env->cache_control & CACHE_CTRL_IF) { + /* Instruction cache state */ + state =3D env->cache_control & CACHE_STATE_MASK; + if (state =3D=3D CACHE_ENABLED) { + state =3D CACHE_FROZEN; + trace_int_helper_icache_freeze(); + } + + env->cache_control &=3D ~CACHE_STATE_MASK; + env->cache_control |=3D state; + } + + if (env->cache_control & CACHE_CTRL_DF) { + /* Data cache state */ + state =3D (env->cache_control >> 2) & CACHE_STATE_MASK; + if (state =3D=3D CACHE_ENABLED) { + state =3D CACHE_FROZEN; + trace_int_helper_dcache_freeze(); + } + + env->cache_control &=3D ~(CACHE_STATE_MASK << 2); + env->cache_control |=3D (state << 2); + } +} + +static void leon3_irq_ack(void *irq_manager, int intno) { grlib_irqmp_ack((DeviceState *)irq_manager, intno); } @@ -181,6 +210,12 @@ static void leon3_set_pil_in(void *opaque, int n, int = level) } } =20 +static void leon3_irq_manager(CPUSPARCState *env, void *irq_manager, int i= ntno) +{ + leon3_irq_ack(irq_manager, intno); + leon3_cache_control_int(env); +} + static void leon3_generic_hw_init(MachineState *machine) { ram_addr_t ram_size =3D machine->ram_size; diff --git a/hw/sparc/trace-events b/hw/sparc/trace-events index 355b07ae05..dfb53dc1a2 100644 --- a/hw/sparc/trace-events +++ b/hw/sparc/trace-events @@ -19,3 +19,5 @@ sun4m_iommu_bad_addr(uint64_t addr) "bad addr 0x%"PRIx64 # leon3.c leon3_set_irq(int intno) "Set CPU IRQ %d" leon3_reset_irq(int intno) "Reset CPU IRQ %d" +int_helper_icache_freeze(void) "Instruction cache: freeze" +int_helper_dcache_freeze(void) "Data cache: freeze" diff --git a/target/sparc/cpu.h b/target/sparc/cpu.h index 4b2290650b..ff8ae73002 100644 --- a/target/sparc/cpu.h +++ b/target/sparc/cpu.h @@ -615,15 +615,9 @@ int cpu_cwp_inc(CPUSPARCState *env1, int cwp); int cpu_cwp_dec(CPUSPARCState *env1, int cwp); void cpu_set_cwp(CPUSPARCState *env1, int new_cwp); =20 -/* int_helper.c */ -void leon3_irq_manager(CPUSPARCState *env, void *irq_manager, int intno); - /* sun4m.c, sun4u.c */ void cpu_check_irqs(CPUSPARCState *env); =20 -/* leon3.c */ -void leon3_irq_ack(void *irq_manager, int intno); - #if defined (TARGET_SPARC64) =20 static inline int compare_masked(uint64_t x, uint64_t y, uint64_t mask) diff --git a/target/sparc/int32_helper.c b/target/sparc/int32_helper.c index 817a463a17..d008dbdb65 100644 --- a/target/sparc/int32_helper.c +++ b/target/sparc/int32_helper.c @@ -136,40 +136,3 @@ void sparc_cpu_do_interrupt(CPUState *cs) } #endif } - -#if !defined(CONFIG_USER_ONLY) -static void leon3_cache_control_int(CPUSPARCState *env) -{ - uint32_t state =3D 0; - - if (env->cache_control & CACHE_CTRL_IF) { - /* Instruction cache state */ - state =3D env->cache_control & CACHE_STATE_MASK; - if (state =3D=3D CACHE_ENABLED) { - state =3D CACHE_FROZEN; - trace_int_helper_icache_freeze(); - } - - env->cache_control &=3D ~CACHE_STATE_MASK; - env->cache_control |=3D state; - } - - if (env->cache_control & CACHE_CTRL_DF) { - /* Data cache state */ - state =3D (env->cache_control >> 2) & CACHE_STATE_MASK; - if (state =3D=3D CACHE_ENABLED) { - state =3D CACHE_FROZEN; - trace_int_helper_dcache_freeze(); - } - - env->cache_control &=3D ~(CACHE_STATE_MASK << 2); - env->cache_control |=3D (state << 2); - } -} - -void leon3_irq_manager(CPUSPARCState *env, void *irq_manager, int intno) -{ - leon3_irq_ack(irq_manager, intno); - leon3_cache_control_int(env); -} -#endif diff --git a/target/sparc/trace-events b/target/sparc/trace-events index 6a064e2327..e925ddd1cc 100644 --- a/target/sparc/trace-events +++ b/target/sparc/trace-events @@ -15,10 +15,6 @@ int_helper_set_softint(uint32_t softint) "new 0x%08x" int_helper_clear_softint(uint32_t softint) "new 0x%08x" int_helper_write_softint(uint32_t softint) "new 0x%08x" =20 -# int32_helper.c -int_helper_icache_freeze(void) "Instruction cache: freeze" -int_helper_dcache_freeze(void) "Data cache: freeze" - # win_helper.c win_helper_gregset_error(uint32_t pstate) "ERROR in get_gregset: active ps= tate bits=3D0x%x" win_helper_switch_pstate(uint32_t pstate_regs, uint32_t new_pstate_regs) "= change_pstate: switching regs old=3D0x%x new=3D0x%x" --=20 2.20.1 From nobody Tue May 7 02:04:11 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1620200375; cv=none; d=zohomail.com; s=zohoarc; b=C5X3smrfiOkAB34y9jbhMVMJyB130Br9FFQhS7Mu1Nnk5SN8X/OBZUgHeLn9CAWRoGKx47qXBh1hr0AqiPOQKjrU+hp1YgaXOq1oSJtLoetWGmevdRhoHjm4TOAN/5xj74K1NUitPbq8GLxuiJQEgyLiWwiN96Lt4PNLOdCmB58= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1620200375; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=A8kK8GmTOdlAh/li4UnOs+6JWxLSeSxrtyyNHDVsBCc=; b=h6HRyyWVKqQC3++MTUs9TU7zsZJMcA86KQF80D8uS/ENRjRXX3XPi1I2LjESU0w2RB61uZK2wssfAiLNAR+a4nUtlokjqhYOM5kj7rz4tNBpURzRnPOMPss6+3IGc1U/+fulJk29uiP1sK0E5ZXRAPB1/VnCCOVHBbD1ILLh4Jw= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1620200375605487.2631855299179; Wed, 5 May 2021 00:39:35 -0700 (PDT) Received: from localhost ([::1]:44584 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1leC86-0004Om-Ro for importer@patchew.org; Wed, 05 May 2021 03:39:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52936) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1leC4f-0007g2-HJ for qemu-devel@nongnu.org; Wed, 05 May 2021 03:36:01 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:57718 helo=mail.default.ilande.uk0.bigv.io) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1leC4d-0002DS-T6 for qemu-devel@nongnu.org; Wed, 05 May 2021 03:36:01 -0400 Received: from host81-154-26-71.range81-154.btcentralplus.com ([81.154.26.71] helo=kentang.home) by mail.default.ilande.uk0.bigv.io with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1leC4Y-0000OI-WA; Wed, 05 May 2021 08:35:58 +0100 From: Mark Cave-Ayland To: peter.maydell@linaro.org, qemu-devel@nongnu.org Date: Wed, 5 May 2021 08:35:36 +0100 Message-Id: <20210505073538.11438-9-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210505073538.11438-1-mark.cave-ayland@ilande.co.uk> References: <20210505073538.11438-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 81.154.26.71 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PULL 08/10] hw/sparc64: Remove unused "hw/char/serial.h" header X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.default.ilande.uk0.bigv.io) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.default.ilande.uk0.bigv.io X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: KONRAD Frederic Reviewed-by: Mark Cave-Ayland Reviewed-by: Richard Henderson Message-Id: <20210428141655.387430-3-f4bug@amsat.org> Signed-off-by: Mark Cave-Ayland --- hw/sparc64/sparc64.c | 1 - 1 file changed, 1 deletion(-) diff --git a/hw/sparc64/sparc64.c b/hw/sparc64/sparc64.c index e3f9219a10..cc0b9bd30d 100644 --- a/hw/sparc64/sparc64.c +++ b/hw/sparc64/sparc64.c @@ -26,7 +26,6 @@ #include "qemu/osdep.h" #include "cpu.h" #include "hw/boards.h" -#include "hw/char/serial.h" #include "hw/sparc/sparc64.h" #include "qemu/timer.h" #include "sysemu/reset.h" --=20 2.20.1 From nobody Tue May 7 02:04:11 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1620200549; cv=none; d=zohomail.com; s=zohoarc; b=QQCWipLiaoWPZRjTk2aq4NhJRuzwD+dvl97YSpzG3sdWOtns9jnx4jGam2X+rCOxgL+CHA+MWu3SgIaNfsXSbboKM5zZBwRNQ0BW7KBdQDzZXlygLzJd7VgtFAr28tHjdUD872f9mFNzQ4bKnDdgYdN98M1cejBtzP0JwCPAJxw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1620200549; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=0N+elMCVQAXYM53riR6iUBdnTEJl+/8yDVeAMlgPh+I=; b=nanfn75MVACwX4BhVLZ7h2Q/f8mfngw9R/tSYppV0TUs08CGpwFb23PzTdJG0kmvPfkMTHod4SDMo4xm07WHx/RnyoAyRkeAGHczUUkT5TbJYTqItY1JTGbURzPaZ8+yztMizcAW5LCfUxsQ4TEp/u/zYuVbS5HIs0RrNkA34t4= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 162020054903846.813262728422615; Wed, 5 May 2021 00:42:29 -0700 (PDT) Received: from localhost ([::1]:53894 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1leCAt-0008DX-QU for importer@patchew.org; Wed, 05 May 2021 03:42:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52958) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1leC4i-0007jB-25 for qemu-devel@nongnu.org; Wed, 05 May 2021 03:36:04 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:57724 helo=mail.default.ilande.uk0.bigv.io) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1leC4f-0002EX-QE for qemu-devel@nongnu.org; Wed, 05 May 2021 03:36:03 -0400 Received: from host81-154-26-71.range81-154.btcentralplus.com ([81.154.26.71] helo=kentang.home) by mail.default.ilande.uk0.bigv.io with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1leC4c-0000OI-Ha; Wed, 05 May 2021 08:36:00 +0100 From: Mark Cave-Ayland To: peter.maydell@linaro.org, qemu-devel@nongnu.org Date: Wed, 5 May 2021 08:35:37 +0100 Message-Id: <20210505073538.11438-10-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210505073538.11438-1-mark.cave-ayland@ilande.co.uk> References: <20210505073538.11438-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 81.154.26.71 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PULL 09/10] hw/sparc64: Fix code style for checkpatch.pl X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.default.ilande.uk0.bigv.io) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.default.ilande.uk0.bigv.io X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daud=C3=A9 We are going to move this code, fix its style first. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: KONRAD Frederic Reviewed-by: Mark Cave-Ayland Reviewed-by: Richard Henderson Message-Id: <20210428141655.387430-4-f4bug@amsat.org> Signed-off-by: Mark Cave-Ayland --- hw/sparc64/sparc64.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/hw/sparc64/sparc64.c b/hw/sparc64/sparc64.c index cc0b9bd30d..fd29a79edc 100644 --- a/hw/sparc64/sparc64.c +++ b/hw/sparc64/sparc64.c @@ -48,14 +48,18 @@ void cpu_check_irqs(CPUSPARCState *env) return; } cs =3D env_cpu(env); - /* check if TM or SM in SOFTINT are set - setting these also causes interrupt 14 */ + /* + * check if TM or SM in SOFTINT are set + * setting these also causes interrupt 14 + */ if (env->softint & (SOFTINT_TIMER | SOFTINT_STIMER)) { pil |=3D 1 << 14; } =20 - /* The bit corresponding to psrpil is (1<< psrpil), the next bit - is (2 << psrpil). */ + /* + * The bit corresponding to psrpil is (1<< psrpil), + * the next bit is (2 << psrpil). + */ if (pil < (2 << env->psrpil)) { if (cs->interrupt_request & CPU_INTERRUPT_HARD) { trace_sparc64_cpu_check_irqs_reset_irq(env->interrupt_index); --=20 2.20.1 From nobody Tue May 7 02:04:11 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1620200514; cv=none; d=zohomail.com; s=zohoarc; b=WEQq+fKnx+GsUNS/3l0FC+XWChnAUPDUalKYHKGpdl8YuJ2hisdrHFaaNH6eH744TFuiTreJT++Klf30SVEM4QsHylPFKY5rAuZbqbAcFmvyeF8BrDfMY9rO1JDoKFzdSkwvSgsI6vmdAWe7xsapDUy6Fb6zGJwMI3mVvQmbWfY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1620200514; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=4mV2MZJuyQwOssgesdaR2yqSo3asOQzJPUdjuAR2Afg=; b=nF4kIKxoJGWi3KUSz6dLba5idL8+DKPFPoaK/9wRAXSFEJAq9hPWI21ei8lkynv8dMkfuhgZB7O2Lx1saaRZU4epqW+H2eYxBV/FUCfGhUlIRbETRyKjuq/wYj/T71A6CDXbjdFugpLnFqZLA+l3jnX/SVcTZ//QQ9p77ye5UYM= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1620200514524811.2277523016944; Wed, 5 May 2021 00:41:54 -0700 (PDT) Received: from localhost ([::1]:52068 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1leCAL-0007V2-Pe for importer@patchew.org; Wed, 05 May 2021 03:41:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52972) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1leC4m-0007l0-1J for qemu-devel@nongnu.org; Wed, 05 May 2021 03:36:08 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:57730 helo=mail.default.ilande.uk0.bigv.io) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1leC4g-0002Ex-H8 for qemu-devel@nongnu.org; Wed, 05 May 2021 03:36:07 -0400 Received: from host81-154-26-71.range81-154.btcentralplus.com ([81.154.26.71] helo=kentang.home) by mail.default.ilande.uk0.bigv.io with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1leC4e-0000OI-CU; Wed, 05 May 2021 08:36:01 +0100 From: Mark Cave-Ayland To: peter.maydell@linaro.org, qemu-devel@nongnu.org Date: Wed, 5 May 2021 08:35:38 +0100 Message-Id: <20210505073538.11438-11-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210505073538.11438-1-mark.cave-ayland@ilande.co.uk> References: <20210505073538.11438-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 81.154.26.71 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PULL 10/10] hw/sparc*: Move cpu_check_irqs() to target/sparc/ X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.default.ilande.uk0.bigv.io) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.default.ilande.uk0.bigv.io X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daud=C3=A9 Since cpu_check_irqs() doesn't reference to anything outside of CPUSPARCState, it better belongs to the architectural code in target/, rather than the hardware specific code in hw/. Note: while we moved the trace events, we don't rename them. Remark: this allows us to build the leon3 machine stand alone, fixing this link failure (because cpu_check_irqs is defined in hw/sparc/sun4m.c which is only built when CONFIG_SUN4M is selected): /usr/bin/ld: target_sparc_win_helper.c.o: in function `cpu_put_psr': target/sparc/win_helper.c:91: undefined reference to `cpu_check_irqs' Suggested-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Mark Cave-Ayland Reviewed-by: Richard Henderson Message-Id: <20210428141655.387430-5-f4bug@amsat.org> Signed-off-by: Mark Cave-Ayland --- hw/sparc/sun4m.c | 32 ------------------ hw/sparc/trace-events | 2 -- hw/sparc64/sparc64.c | 66 ------------------------------------- hw/sparc64/trace-events | 4 --- target/sparc/int32_helper.c | 33 +++++++++++++++++++ target/sparc/int64_helper.c | 66 +++++++++++++++++++++++++++++++++++++ target/sparc/trace-events | 8 +++++ 7 files changed, 107 insertions(+), 104 deletions(-) diff --git a/hw/sparc/sun4m.c b/hw/sparc/sun4m.c index 263732b904..42e139849e 100644 --- a/hw/sparc/sun4m.c +++ b/hw/sparc/sun4m.c @@ -170,38 +170,6 @@ static void nvram_init(Nvram *nvram, uint8_t *macaddr, } } =20 -void cpu_check_irqs(CPUSPARCState *env) -{ - CPUState *cs; - - /* We should be holding the BQL before we mess with IRQs */ - g_assert(qemu_mutex_iothread_locked()); - - if (env->pil_in && (env->interrupt_index =3D=3D 0 || - (env->interrupt_index & ~15) =3D=3D TT_EXTINT)) { - unsigned int i; - - for (i =3D 15; i > 0; i--) { - if (env->pil_in & (1 << i)) { - int old_interrupt =3D env->interrupt_index; - - env->interrupt_index =3D TT_EXTINT | i; - if (old_interrupt !=3D env->interrupt_index) { - cs =3D env_cpu(env); - trace_sun4m_cpu_interrupt(i); - cpu_interrupt(cs, CPU_INTERRUPT_HARD); - } - break; - } - } - } else if (!env->pil_in && (env->interrupt_index & ~15) =3D=3D TT_EXTI= NT) { - cs =3D env_cpu(env); - trace_sun4m_cpu_reset_interrupt(env->interrupt_index & 15); - env->interrupt_index =3D 0; - cpu_reset_interrupt(cs, CPU_INTERRUPT_HARD); - } -} - static void cpu_kick_irq(SPARCCPU *cpu) { CPUSPARCState *env =3D &cpu->env; diff --git a/hw/sparc/trace-events b/hw/sparc/trace-events index dfb53dc1a2..d3a30a816a 100644 --- a/hw/sparc/trace-events +++ b/hw/sparc/trace-events @@ -1,8 +1,6 @@ # See docs/devel/tracing.txt for syntax documentation. =20 # sun4m.c -sun4m_cpu_interrupt(unsigned int level) "Set CPU IRQ %d" -sun4m_cpu_reset_interrupt(unsigned int level) "Reset CPU IRQ %d" sun4m_cpu_set_irq_raise(int level) "Raise CPU IRQ %d" sun4m_cpu_set_irq_lower(int level) "Lower CPU IRQ %d" =20 diff --git a/hw/sparc64/sparc64.c b/hw/sparc64/sparc64.c index fd29a79edc..8654e955eb 100644 --- a/hw/sparc64/sparc64.c +++ b/hw/sparc64/sparc64.c @@ -34,72 +34,6 @@ =20 #define TICK_MAX 0x7fffffffffffffffULL =20 -void cpu_check_irqs(CPUSPARCState *env) -{ - CPUState *cs; - uint32_t pil =3D env->pil_in | - (env->softint & ~(SOFTINT_TIMER | SOFTINT_STIMER)); - - /* We should be holding the BQL before we mess with IRQs */ - g_assert(qemu_mutex_iothread_locked()); - - /* TT_IVEC has a higher priority (16) than TT_EXTINT (31..17) */ - if (env->ivec_status & 0x20) { - return; - } - cs =3D env_cpu(env); - /* - * check if TM or SM in SOFTINT are set - * setting these also causes interrupt 14 - */ - if (env->softint & (SOFTINT_TIMER | SOFTINT_STIMER)) { - pil |=3D 1 << 14; - } - - /* - * The bit corresponding to psrpil is (1<< psrpil), - * the next bit is (2 << psrpil). - */ - if (pil < (2 << env->psrpil)) { - if (cs->interrupt_request & CPU_INTERRUPT_HARD) { - trace_sparc64_cpu_check_irqs_reset_irq(env->interrupt_index); - env->interrupt_index =3D 0; - cpu_reset_interrupt(cs, CPU_INTERRUPT_HARD); - } - return; - } - - if (cpu_interrupts_enabled(env)) { - - unsigned int i; - - for (i =3D 15; i > env->psrpil; i--) { - if (pil & (1 << i)) { - int old_interrupt =3D env->interrupt_index; - int new_interrupt =3D TT_EXTINT | i; - - if (unlikely(env->tl > 0 && cpu_tsptr(env)->tt > new_inter= rupt - && ((cpu_tsptr(env)->tt & 0x1f0) =3D=3D TT_EXTINT))) { - trace_sparc64_cpu_check_irqs_noset_irq(env->tl, - cpu_tsptr(env)->tt, - new_interrupt); - } else if (old_interrupt !=3D new_interrupt) { - env->interrupt_index =3D new_interrupt; - trace_sparc64_cpu_check_irqs_set_irq(i, old_interrupt, - new_interrupt); - cpu_interrupt(cs, CPU_INTERRUPT_HARD); - } - break; - } - } - } else if (cs->interrupt_request & CPU_INTERRUPT_HARD) { - trace_sparc64_cpu_check_irqs_disabled(pil, env->pil_in, env->softi= nt, - env->interrupt_index); - env->interrupt_index =3D 0; - cpu_reset_interrupt(cs, CPU_INTERRUPT_HARD); - } -} - static void cpu_kick_irq(SPARCCPU *cpu) { CPUState *cs =3D CPU(cpu); diff --git a/hw/sparc64/trace-events b/hw/sparc64/trace-events index a0b29987d2..b85d14c30c 100644 --- a/hw/sparc64/trace-events +++ b/hw/sparc64/trace-events @@ -9,10 +9,6 @@ sun4u_iommu_mem_write(uint64_t addr, uint64_t val, int siz= e) "addr: 0x%"PRIx64" sun4u_iommu_translate(uint64_t addr, uint64_t trans_addr, uint64_t tte) "x= late 0x%"PRIx64" =3D> pa 0x%"PRIx64" tte: 0x%"PRIx64 =20 # sparc64.c -sparc64_cpu_check_irqs_reset_irq(int intno) "Reset CPU IRQ (current interr= upt 0x%x)" -sparc64_cpu_check_irqs_noset_irq(uint32_t tl, uint32_t tt, int intno) "Not= setting CPU IRQ: TL=3D%d current 0x%x >=3D pending 0x%x" -sparc64_cpu_check_irqs_set_irq(unsigned int i, int old, int new) "Set CPU = IRQ %d old=3D0x%x new=3D0x%x" -sparc64_cpu_check_irqs_disabled(uint32_t pil, uint32_t pil_in, uint32_t so= ftint, int intno) "Interrupts disabled, pil=3D0x%08x pil_in=3D0x%08x softin= t=3D0x%08x current interrupt 0x%x" sparc64_cpu_ivec_raise_irq(int irq) "Raise IVEC IRQ %d" sparc64_cpu_ivec_lower_irq(int irq) "Lower IVEC IRQ %d" sparc64_cpu_tick_irq_disabled(void) "tick_irq: softint disabled" diff --git a/target/sparc/int32_helper.c b/target/sparc/int32_helper.c index d008dbdb65..82e8418e46 100644 --- a/target/sparc/int32_helper.c +++ b/target/sparc/int32_helper.c @@ -18,6 +18,7 @@ */ =20 #include "qemu/osdep.h" +#include "qemu/main-loop.h" #include "cpu.h" #include "trace.h" #include "exec/log.h" @@ -64,6 +65,38 @@ static const char *excp_name_str(int32_t exception_index) return excp_names[exception_index]; } =20 +void cpu_check_irqs(CPUSPARCState *env) +{ + CPUState *cs; + + /* We should be holding the BQL before we mess with IRQs */ + g_assert(qemu_mutex_iothread_locked()); + + if (env->pil_in && (env->interrupt_index =3D=3D 0 || + (env->interrupt_index & ~15) =3D=3D TT_EXTINT)) { + unsigned int i; + + for (i =3D 15; i > 0; i--) { + if (env->pil_in & (1 << i)) { + int old_interrupt =3D env->interrupt_index; + + env->interrupt_index =3D TT_EXTINT | i; + if (old_interrupt !=3D env->interrupt_index) { + cs =3D env_cpu(env); + trace_sun4m_cpu_interrupt(i); + cpu_interrupt(cs, CPU_INTERRUPT_HARD); + } + break; + } + } + } else if (!env->pil_in && (env->interrupt_index & ~15) =3D=3D TT_EXTI= NT) { + cs =3D env_cpu(env); + trace_sun4m_cpu_reset_interrupt(env->interrupt_index & 15); + env->interrupt_index =3D 0; + cpu_reset_interrupt(cs, CPU_INTERRUPT_HARD); + } +} + void sparc_cpu_do_interrupt(CPUState *cs) { SPARCCPU *cpu =3D SPARC_CPU(cs); diff --git a/target/sparc/int64_helper.c b/target/sparc/int64_helper.c index 7fb8ab211c..793e57c536 100644 --- a/target/sparc/int64_helper.c +++ b/target/sparc/int64_helper.c @@ -62,6 +62,72 @@ static const char * const excp_names[0x80] =3D { }; #endif =20 +void cpu_check_irqs(CPUSPARCState *env) +{ + CPUState *cs; + uint32_t pil =3D env->pil_in | + (env->softint & ~(SOFTINT_TIMER | SOFTINT_STIMER)); + + /* We should be holding the BQL before we mess with IRQs */ + g_assert(qemu_mutex_iothread_locked()); + + /* TT_IVEC has a higher priority (16) than TT_EXTINT (31..17) */ + if (env->ivec_status & 0x20) { + return; + } + cs =3D env_cpu(env); + /* + * check if TM or SM in SOFTINT are set + * setting these also causes interrupt 14 + */ + if (env->softint & (SOFTINT_TIMER | SOFTINT_STIMER)) { + pil |=3D 1 << 14; + } + + /* + * The bit corresponding to psrpil is (1<< psrpil), + * the next bit is (2 << psrpil). + */ + if (pil < (2 << env->psrpil)) { + if (cs->interrupt_request & CPU_INTERRUPT_HARD) { + trace_sparc64_cpu_check_irqs_reset_irq(env->interrupt_index); + env->interrupt_index =3D 0; + cpu_reset_interrupt(cs, CPU_INTERRUPT_HARD); + } + return; + } + + if (cpu_interrupts_enabled(env)) { + + unsigned int i; + + for (i =3D 15; i > env->psrpil; i--) { + if (pil & (1 << i)) { + int old_interrupt =3D env->interrupt_index; + int new_interrupt =3D TT_EXTINT | i; + + if (unlikely(env->tl > 0 && cpu_tsptr(env)->tt > new_inter= rupt + && ((cpu_tsptr(env)->tt & 0x1f0) =3D=3D TT_EXTINT))) { + trace_sparc64_cpu_check_irqs_noset_irq(env->tl, + cpu_tsptr(env)->tt, + new_interrupt); + } else if (old_interrupt !=3D new_interrupt) { + env->interrupt_index =3D new_interrupt; + trace_sparc64_cpu_check_irqs_set_irq(i, old_interrupt, + new_interrupt); + cpu_interrupt(cs, CPU_INTERRUPT_HARD); + } + break; + } + } + } else if (cs->interrupt_request & CPU_INTERRUPT_HARD) { + trace_sparc64_cpu_check_irqs_disabled(pil, env->pil_in, env->softi= nt, + env->interrupt_index); + env->interrupt_index =3D 0; + cpu_reset_interrupt(cs, CPU_INTERRUPT_HARD); + } +} + void sparc_cpu_do_interrupt(CPUState *cs) { SPARCCPU *cpu =3D SPARC_CPU(cs); diff --git a/target/sparc/trace-events b/target/sparc/trace-events index e925ddd1cc..75e7093d5f 100644 --- a/target/sparc/trace-events +++ b/target/sparc/trace-events @@ -10,10 +10,18 @@ mmu_helper_get_phys_addr_code(uint32_t tl, int mmu_idx,= uint64_t prim_context, u mmu_helper_get_phys_addr_data(uint32_t tl, int mmu_idx, uint64_t prim_cont= ext, uint64_t sec_context, uint64_t address) "tl=3D%d mmu_idx=3D%d primary = context=3D0x%"PRIx64" secondary context=3D0x%"PRIx64" address=3D0x%"PRIx64 mmu_helper_mmu_fault(uint64_t address, uint64_t paddr, int mmu_idx, uint32= _t tl, uint64_t prim_context, uint64_t sec_context) "Translate at 0x%"PRIx6= 4" -> 0x%"PRIx64", mmu_idx=3D%d tl=3D%d primary context=3D0x%"PRIx64" secon= dary context=3D0x%"PRIx64 =20 +# int32_helper.c +sun4m_cpu_interrupt(unsigned int level) "Set CPU IRQ %d" +sun4m_cpu_reset_interrupt(unsigned int level) "Reset CPU IRQ %d" + # int64_helper.c int_helper_set_softint(uint32_t softint) "new 0x%08x" int_helper_clear_softint(uint32_t softint) "new 0x%08x" int_helper_write_softint(uint32_t softint) "new 0x%08x" +sparc64_cpu_check_irqs_reset_irq(int intno) "Reset CPU IRQ (current interr= upt 0x%x)" +sparc64_cpu_check_irqs_noset_irq(uint32_t tl, uint32_t tt, int intno) "Not= setting CPU IRQ: TL=3D%d current 0x%x >=3D pending 0x%x" +sparc64_cpu_check_irqs_set_irq(unsigned int i, int old, int new) "Set CPU = IRQ %d old=3D0x%x new=3D0x%x" +sparc64_cpu_check_irqs_disabled(uint32_t pil, uint32_t pil_in, uint32_t so= ftint, int intno) "Interrupts disabled, pil=3D0x%08x pil_in=3D0x%08x softin= t=3D0x%08x current interrupt 0x%x" =20 # win_helper.c win_helper_gregset_error(uint32_t pstate) "ERROR in get_gregset: active ps= tate bits=3D0x%x" --=20 2.20.1