From patchwork Thu Sep 13 20:12:41 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jason Baron X-Patchwork-Id: 183725 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id C44AA2C007A for ; Fri, 14 Sep 2012 06:57:00 +1000 (EST) Received: from localhost ([::1]:60125 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TCFmv-0001wv-VY for incoming@patchwork.ozlabs.org; Thu, 13 Sep 2012 16:13:25 -0400 Received: from eggs.gnu.org ([208.118.235.92]:53211) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TCFmJ-0000y4-DY for qemu-devel@nongnu.org; Thu, 13 Sep 2012 16:12:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TCFmF-0002us-Tq for qemu-devel@nongnu.org; Thu, 13 Sep 2012 16:12:47 -0400 Received: from mx1.redhat.com ([209.132.183.28]:21148) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TCFmF-0002uc-MD for qemu-devel@nongnu.org; Thu, 13 Sep 2012 16:12:43 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q8DKCg8w009023 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 13 Sep 2012 16:12:42 -0400 Received: from redhat.com (dhcp-185-114.bos.redhat.com [10.16.185.114]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q8DKCfOU026130; Thu, 13 Sep 2012 16:12:41 -0400 Date: Thu, 13 Sep 2012 16:12:41 -0400 From: Jason Baron To: qemu-devel@nongnu.org Message-Id: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Cc: aliguori@us.ibm.com, alex.williamson@redhat.com, mst@redhat.com, jan.kiszka@siemens.com, agraf@suse.de, armbru@redhat.com, yamahata@valinux.co.jp, juzhang@redhat.com, kevin@koconnor.net, avi@redhat.com, mkletzan@redhat.com, lcapitulino@redhat.com, afaerber@suse.de Subject: [Qemu-devel] [PATCH 10/25] pcie: Convert PCIExpressHost to use the QOM. X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Let's use PCIExpressHost with QOM. Signed-off-by: Jason Baron Acked-by: Andreas Färber --- hw/pcie_host.c | 14 ++++++++++++++ hw/pcie_host.h | 4 ++++ 2 files changed, 18 insertions(+), 0 deletions(-) diff --git a/hw/pcie_host.c b/hw/pcie_host.c index e2fd276..027ba05 100644 --- a/hw/pcie_host.c +++ b/hw/pcie_host.c @@ -145,3 +145,17 @@ void pcie_host_mmcfg_update(PCIExpressHost *e, pcie_host_mmcfg_map(e, addr, size); } } + +static const TypeInfo pcie_host_type_info = { + .name = TYPE_PCIE_HOST_BRIDGE, + .parent = TYPE_PCI_HOST_BRIDGE, + .abstract = true, + .instance_size = sizeof(PCIExpressHost), +}; + +static void pcie_host_register_types(void) +{ + type_register_static(&pcie_host_type_info); +} + +type_init(pcie_host_register_types) diff --git a/hw/pcie_host.h b/hw/pcie_host.h index 2faa54e..2494c71 100644 --- a/hw/pcie_host.h +++ b/hw/pcie_host.h @@ -24,6 +24,10 @@ #include "pci_host.h" #include "memory.h" +#define TYPE_PCIE_HOST_BRIDGE "pcie-host-bridge" +#define PCIE_HOST_BRIDGE(obj) \ + OBJECT_CHECK(PCIExpressHost, (obj), TYPE_PCIE_HOST_BRIDGE) + struct PCIExpressHost { PCIHostState pci;