From nobody Tue Feb 10 06:43:16 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1510926383561270.01625878837365; Fri, 17 Nov 2017 05:46:23 -0800 (PST) Received: from localhost ([::1]:45977 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eFgyE-0002v6-CP for importer@patchew.org; Fri, 17 Nov 2017 08:46:14 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56508) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eFgvE-0000oL-Ox for qemu-devel@nongnu.org; Fri, 17 Nov 2017 08:43:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eFgvD-0008Vn-UN for qemu-devel@nongnu.org; Fri, 17 Nov 2017 08:43:08 -0500 Received: from chuckie.co.uk ([82.165.15.123]:59097 helo=s16892447.onlinehome-server.info) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eFgvD-0008Jf-No for qemu-devel@nongnu.org; Fri, 17 Nov 2017 08:43:07 -0500 Received: from host109-152-46-120.range109-152.btcentralplus.com ([109.152.46.120] helo=kentang.home) by s16892447.onlinehome-server.info with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1eFgvF-0001nd-36; Fri, 17 Nov 2017 13:43:09 +0000 From: Mark Cave-Ayland To: qemu-devel@nongnu.org, atar4qemu@gmail.com Date: Fri, 17 Nov 2017 13:42:34 +0000 Message-Id: <1510926167-23326-3-git-send-email-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1510926167-23326-1-git-send-email-mark.cave-ayland@ilande.co.uk> References: <1510926167-23326-1-git-send-email-mark.cave-ayland@ilande.co.uk> X-SA-Exim-Connect-IP: 109.152.46.120 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk X-SA-Exim-Version: 4.2.1 (built Sun, 08 Jan 2012 02:45:44 +0000) X-SA-Exim-Scanned: Yes (on s16892447.onlinehome-server.info) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 82.165.15.123 Subject: [Qemu-devel] [PATCH 02/15] sun4u: ebus QOMify tidy-up X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 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" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" The main change here is to introduce the proper TYPE_EBUS/EBUS QOM macros and remove the use of DO_UPCAST. Alongside this there are some a couple of minor cosmetic changes and a rena= me of pci_ebus_realize() to ebus_realize() since the ebus device is always what is effectively a PCI-ISA bridge. Signed-off-by: Mark Cave-Ayland Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/sparc64/sun4u.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/hw/sparc64/sun4u.c b/hw/sparc64/sun4u.c index 1672f25..394b7d6 100644 --- a/hw/sparc64/sun4u.c +++ b/hw/sparc64/sun4u.c @@ -81,11 +81,16 @@ struct hwdef { }; =20 typedef struct EbusState { - PCIDevice pci_dev; + /*< private >*/ + PCIDevice parent_obj; + MemoryRegion bar0; MemoryRegion bar1; } EbusState; =20 +#define TYPE_EBUS "ebus" +#define EBUS(obj) OBJECT_CHECK(EbusState, (obj), TYPE_EBUS) + void DMA_init(ISABus *bus, int high_page_enable) { } @@ -236,9 +241,9 @@ pci_ebus_init(PCIDevice *pci_dev, qemu_irq *irqs) return isa_bus; } =20 -static void pci_ebus_realize(PCIDevice *pci_dev, Error **errp) +static void ebus_realize(PCIDevice *pci_dev, Error **errp) { - EbusState *s =3D DO_UPCAST(EbusState, pci_dev, pci_dev); + EbusState *s =3D EBUS(pci_dev); =20 if (!isa_bus_new(DEVICE(pci_dev), get_system_memory(), pci_address_space_io(pci_dev), errp)) { @@ -264,7 +269,7 @@ static void ebus_class_init(ObjectClass *klass, void *d= ata) { PCIDeviceClass *k =3D PCI_DEVICE_CLASS(klass); =20 - k->realize =3D pci_ebus_realize; + k->realize =3D ebus_realize; k->vendor_id =3D PCI_VENDOR_ID_SUN; k->device_id =3D PCI_DEVICE_ID_SUN_EBUS; k->revision =3D 0x01; @@ -272,10 +277,10 @@ static void ebus_class_init(ObjectClass *klass, void = *data) } =20 static const TypeInfo ebus_info =3D { - .name =3D "ebus", + .name =3D TYPE_EBUS, .parent =3D TYPE_PCI_DEVICE, - .instance_size =3D sizeof(EbusState), .class_init =3D ebus_class_init, + .instance_size =3D sizeof(EbusState), .interfaces =3D (InterfaceInfo[]) { { INTERFACE_CONVENTIONAL_PCI_DEVICE }, { }, @@ -463,7 +468,7 @@ static void sun4uv_init(MemoryRegion *address_space_mem, pci_busA->slot_reserved_mask =3D 0xfffffff1; pci_busB->slot_reserved_mask =3D 0xfffffff0; =20 - ebus =3D pci_create_multifunction(pci_busA, PCI_DEVFN(1, 0), true, "eb= us"); + ebus =3D pci_create_multifunction(pci_busA, PCI_DEVFN(1, 0), true, TYP= E_EBUS); qdev_init_nofail(DEVICE(ebus)); =20 isa_bus =3D pci_ebus_init(ebus, pbm_irqs); --=20 1.7.10.4