From nobody Wed Feb 11 00:55:22 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 1516526092821142.29823324954543; Sun, 21 Jan 2018 01:14:52 -0800 (PST) Received: from localhost ([::1]:44977 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1edBi8-0007Yy-6n for importer@patchew.org; Sun, 21 Jan 2018 04:14:44 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34714) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1edBfq-0006En-3M for qemu-devel@nongnu.org; Sun, 21 Jan 2018 04:12:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1edBfl-00035J-P8 for qemu-devel@nongnu.org; Sun, 21 Jan 2018 04:12:22 -0500 Received: from chuckie.co.uk ([82.165.15.123]:47988 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 1edBfl-00033y-I4 for qemu-devel@nongnu.org; Sun, 21 Jan 2018 04:12:17 -0500 Received: from host86-133-194-144.range86-133.btcentralplus.com ([86.133.194.144] 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 1edBfv-0005SV-Qw; Sun, 21 Jan 2018 09:12:28 +0000 From: Mark Cave-Ayland To: qemu-devel@nongnu.org, atar4qemu@gmail.com Date: Sun, 21 Jan 2018 09:11:49 +0000 Message-Id: <20180121091154.17426-6-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180121091154.17426-1-mark.cave-ayland@ilande.co.uk> References: <20180121091154.17426-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: 86.133.194.144 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] [PATCHv2 05/10] apb: QOMify sabre PCI host bridge 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: , Cc: Mark Cave-Ayland Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Signed-off-by: Mark Cave-Ayland Reviewed-by: Philippe Mathieu-Daud=C3=A9 Acked-by: Artyom Tarasenko --- hw/pci-host/apb.c | 6 +++--- include/hw/pci-host/apb.h | 14 +++++++++++--- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/hw/pci-host/apb.c b/hw/pci-host/apb.c index 98c5f344f7..36c6251816 100644 --- a/hw/pci-host/apb.c +++ b/hw/pci-host/apb.c @@ -407,7 +407,7 @@ static void sabre_realize(DeviceState *dev, Error **err= p) &s->pci_ioport, 0, 32, TYPE_PCI_BUS); =20 - pci_create_simple(phb->bus, 0, "pbm-pci"); + pci_create_simple(phb->bus, 0, TYPE_SABRE_PCI_DEVICE); =20 /* IOMMU */ memory_region_add_subregion_overlap(&s->apb_config, 0x200, @@ -498,9 +498,9 @@ static void sabre_pci_class_init(ObjectClass *klass, vo= id *data) } =20 static const TypeInfo sabre_pci_info =3D { - .name =3D "pbm-pci", + .name =3D TYPE_SABRE_PCI_DEVICE, .parent =3D TYPE_PCI_DEVICE, - .instance_size =3D sizeof(PCIDevice), + .instance_size =3D sizeof(SabrePCIState), .class_init =3D sabre_pci_class_init, .interfaces =3D (InterfaceInfo[]) { { INTERFACE_CONVENTIONAL_PCI_DEVICE }, diff --git a/include/hw/pci-host/apb.h b/include/hw/pci-host/apb.h index 41de012396..470863639a 100644 --- a/include/hw/pci-host/apb.h +++ b/include/hw/pci-host/apb.h @@ -14,9 +14,13 @@ #define OBIO_MSE_IRQ 0x2a #define OBIO_SER_IRQ 0x2b =20 -#define TYPE_APB "pbm" -#define APB_DEVICE(obj) \ - OBJECT_CHECK(APBState, (obj), TYPE_APB) +typedef struct SabrePCIState { + PCIDevice parent_obj; +} SabrePCIState; + +#define TYPE_SABRE_PCI_DEVICE "sabre-pci" +#define SABRE_PCI_DEVICE(obj) \ + OBJECT_CHECK(SabrePCIState, (obj), TYPE_SABRE_PCI_DEVICE) =20 typedef struct APBState { PCIHostState parent_obj; @@ -41,4 +45,8 @@ typedef struct APBState { unsigned int nr_resets; } APBState; =20 +#define TYPE_APB "apb" +#define APB_DEVICE(obj) \ + OBJECT_CHECK(APBState, (obj), TYPE_APB) + #endif --=20 2.11.0