From patchwork Mon Dec 9 09:49:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 11278873 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 03B9914BD for ; Mon, 9 Dec 2019 09:51:29 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D4AA224680 for ; Mon, 9 Dec 2019 09:51:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="FbT1BtM+" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D4AA224680 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1ieFgX-0004PM-UY; Mon, 09 Dec 2019 09:50:33 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1ieFgX-0004P4-2F for xen-devel@lists.xenproject.org; Mon, 09 Dec 2019 09:50:33 +0000 X-Inumbo-ID: 5605b459-1a69-11ea-87af-12813bfff9fa Received: from us-smtp-1.mimecast.com (unknown [207.211.31.81]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTP id 5605b459-1a69-11ea-87af-12813bfff9fa; Mon, 09 Dec 2019 09:50:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1575885030; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=65dn2EaMCTP37YOCYHLxZUlHztk6cKACuH+ML1W/q/Y=; b=FbT1BtM+ats12IGQYugzBIR4/YSU68bbLczAyWMSNsDdjA/P20a5qLWxruUiI6WG3kJl9p 6OsY6Uo+ahQuB+FyQJz+D73bnOsDaafE2oSUZE1v7Oqw0yU0o7nd5oGb2cNa88Clq7gSuE fniY2zBc6fyAXKRTkDf0O3X8XSqUM4A= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-119-iZ-_Yi-lPHK3MEi807cAbQ-1; Mon, 09 Dec 2019 04:50:28 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 581F01800D45; Mon, 9 Dec 2019 09:50:27 +0000 (UTC) Received: from x1w.redhat.com (ovpn-205-142.brq.redhat.com [10.40.205.142]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 32B2519C5B; Mon, 9 Dec 2019 09:50:22 +0000 (UTC) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Date: Mon, 9 Dec 2019 10:49:58 +0100 Message-Id: <20191209095002.32194-3-philmd@redhat.com> In-Reply-To: <20191209095002.32194-1-philmd@redhat.com> References: <20191209095002.32194-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-MC-Unique: iZ-_Yi-lPHK3MEi807cAbQ-1 X-Mimecast-Spam-Score: 0 Subject: [Xen-devel] [PATCH-for-5.0 v3 2/6] hw/pci-host/i440fx: Extract PCII440FXState to "hw/pci-host/i440fx.h" X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Thomas Huth , Stefano Stabellini , "Michael S. Tsirkin" , Paul Durrant , Markus Armbruster , Alex Williamson , Marcel Apfelbaum , Paolo Bonzini , Anthony Perard , xen-devel@lists.xenproject.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Make the PCII440FXState structure public, so it can be used out of this source file. This will allow us to extract the IGD Passthrough Host Bridge, which is a children of the TYPE_I440FX_PCI_DEVICE. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Thomas Huth --- include/hw/pci-host/i440fx.h | 19 +++++++++++++++++-- hw/pci-host/i440fx.c | 18 ------------------ 2 files changed, 17 insertions(+), 20 deletions(-) diff --git a/include/hw/pci-host/i440fx.h b/include/hw/pci-host/i440fx.h index f54e6466e4..cc58d82ed4 100644 --- a/include/hw/pci-host/i440fx.h +++ b/include/hw/pci-host/i440fx.h @@ -13,12 +13,27 @@ #include "hw/hw.h" #include "hw/pci/pci_bus.h" - -typedef struct PCII440FXState PCII440FXState; +#include "hw/pci-host/pam.h" #define TYPE_I440FX_PCI_HOST_BRIDGE "i440FX-pcihost" #define TYPE_I440FX_PCI_DEVICE "i440FX" +#define I440FX_PCI_DEVICE(obj) \ + OBJECT_CHECK(PCII440FXState, (obj), TYPE_I440FX_PCI_DEVICE) + +typedef struct PCII440FXState { + /*< private >*/ + PCIDevice parent_obj; + /*< public >*/ + + MemoryRegion *system_memory; + MemoryRegion *pci_address_space; + MemoryRegion *ram_memory; + PAMMemoryRegion pam_regions[13]; + MemoryRegion smram_region; + MemoryRegion smram, low_smram; +} PCII440FXState; + #define TYPE_IGD_PASSTHROUGH_I440FX_PCI_DEVICE "igd-passthrough-i440FX" PCIBus *i440fx_init(const char *host_type, const char *pci_type, diff --git a/hw/pci-host/i440fx.c b/hw/pci-host/i440fx.c index 3fc94426ea..fbdc563599 100644 --- a/hw/pci-host/i440fx.c +++ b/hw/pci-host/i440fx.c @@ -31,7 +31,6 @@ #include "hw/sysbus.h" #include "qapi/error.h" #include "migration/vmstate.h" -#include "hw/pci-host/pam.h" #include "qapi/visitor.h" #include "qemu/error-report.h" @@ -51,23 +50,6 @@ typedef struct I440FXState { uint32_t short_root_bus; } I440FXState; -#define I440FX_PCI_DEVICE(obj) \ - OBJECT_CHECK(PCII440FXState, (obj), TYPE_I440FX_PCI_DEVICE) - -struct PCII440FXState { - /*< private >*/ - PCIDevice parent_obj; - /*< public >*/ - - MemoryRegion *system_memory; - MemoryRegion *pci_address_space; - MemoryRegion *ram_memory; - PAMMemoryRegion pam_regions[13]; - MemoryRegion smram_region; - MemoryRegion smram, low_smram; -}; - - #define I440FX_PAM 0x59 #define I440FX_PAM_SIZE 7 #define I440FX_SMRAM 0x72