From patchwork Sun Jan 14 10:47:45 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Mark Cave-Ayland X-Patchwork-Id: 860426 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zKCt51rM2z9sBZ for ; Sun, 14 Jan 2018 21:49:47 +1100 (AEDT) Received: from localhost ([::1]:57399 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eafrF-0007xB-3F for incoming@patchwork.ozlabs.org; Sun, 14 Jan 2018 05:49:45 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41198) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eafqa-0007wt-6a for qemu-devel@nongnu.org; Sun, 14 Jan 2018 05:49:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eafqX-0000rG-Vf for qemu-devel@nongnu.org; Sun, 14 Jan 2018 05:49:04 -0500 Received: from chuckie.co.uk ([82.165.15.123]:41908 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 1eafqX-0000q9-OZ for qemu-devel@nongnu.org; Sun, 14 Jan 2018 05:49:01 -0500 Received: from host86-191-132-7.range86-191.btcentralplus.com ([86.191.132.7] 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 1eafqh-0000Uc-DA; Sun, 14 Jan 2018 10:49:12 +0000 From: Mark Cave-Ayland To: qemu-devel@nongnu.org, atar4qemu@gmail.com Date: Sun, 14 Jan 2018 10:47:45 +0000 Message-Id: <20180114104751.21965-6-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180114104751.21965-1-mark.cave-ayland@ilande.co.uk> References: <20180114104751.21965-1-mark.cave-ayland@ilande.co.uk> X-SA-Exim-Connect-IP: 86.191.132.7 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 05/11] 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Mark Cave-Ayland Reviewed-by: Philippe Mathieu-Daudé --- 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 **errp) &s->pci_ioport, 0, 32, TYPE_PCI_BUS); - pci_create_simple(phb->bus, 0, "pbm-pci"); + pci_create_simple(phb->bus, 0, TYPE_SABRE_PCI_DEVICE); /* IOMMU */ memory_region_add_subregion_overlap(&s->apb_config, 0x200, @@ -498,9 +498,9 @@ static void sabre_pci_class_init(ObjectClass *klass, void *data) } static const TypeInfo sabre_pci_info = { - .name = "pbm-pci", + .name = TYPE_SABRE_PCI_DEVICE, .parent = TYPE_PCI_DEVICE, - .instance_size = sizeof(PCIDevice), + .instance_size = sizeof(SabrePCIState), .class_init = sabre_pci_class_init, .interfaces = (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 -#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) typedef struct APBState { PCIHostState parent_obj; @@ -41,4 +45,8 @@ typedef struct APBState { unsigned int nr_resets; } APBState; +#define TYPE_APB "apb" +#define APB_DEVICE(obj) \ + OBJECT_CHECK(APBState, (obj), TYPE_APB) + #endif