From patchwork Tue Mar 15 15:03:34 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Armbruster X-Patchwork-Id: 8589911 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 906089F294 for ; Tue, 15 Mar 2016 15:41:48 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E47D42024C for ; Tue, 15 Mar 2016 15:41:47 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 301E42022D for ; Tue, 15 Mar 2016 15:41:47 +0000 (UTC) Received: from localhost ([::1]:49321 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1afr6Q-0006KR-JW for patchwork-qemu-devel@patchwork.kernel.org; Tue, 15 Mar 2016 11:41:46 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59068) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1afqVo-0004So-JR for qemu-devel@nongnu.org; Tue, 15 Mar 2016 11:04:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1afqVi-0007ds-QR for qemu-devel@nongnu.org; Tue, 15 Mar 2016 11:03:56 -0400 Received: from mx1.redhat.com ([209.132.183.28]:59130) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1afqVi-0007di-JM for qemu-devel@nongnu.org; Tue, 15 Mar 2016 11:03:50 -0400 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id 3D3EFC049D7F; Tue, 15 Mar 2016 15:03:50 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-46.ams2.redhat.com [10.36.116.46]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u2FF3jY2030317 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 15 Mar 2016 11:03:49 -0400 Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id B06533011FAB; Tue, 15 Mar 2016 16:03:41 +0100 (CET) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Tue, 15 Mar 2016 16:03:34 +0100 Message-Id: <1458054221-16923-9-git-send-email-armbru@redhat.com> In-Reply-To: <1458054221-16923-1-git-send-email-armbru@redhat.com> References: <1458054221-16923-1-git-send-email-armbru@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: peter.maydell@linaro.org, pbonzini@redhat.com Subject: [Qemu-devel] [PATCH 08/15] hw/pci/pci.h: Don't include qemu-common.h 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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP qemu-common.h should only be included by .c files. Its file comment explains why: "No header file should depend on qemu-common.h, as this would easily lead to circular header dependencies." hw/pci/pci.h includes qemu-common.h, but its users only need pcibus_t and PCIHostDeviceAddress from it. Move them to hw/pci/pci.h and drop the ill-advised include. Include hw/pci/pci.h where the moved stuff is now missing. Except we can't in target-i386/kvm_i386.h, because that would break the i386-linux-user compile. Add PCIHostDeviceAddress to qemu/typedefs.h instead. Signed-off-by: Markus Armbruster --- hw/core/qdev-properties.c | 1 + include/hw/pci/pci.h | 11 +++++++++-- include/qemu-common.h | 9 --------- include/qemu/typedefs.h | 1 + 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c index eef932c..a8c77ec 100644 --- a/hw/core/qdev-properties.c +++ b/hw/core/qdev-properties.c @@ -2,6 +2,7 @@ #include "net/net.h" #include "hw/qdev.h" #include "qapi/error.h" +#include "hw/pci/pci.h" #include "qapi/qmp/qerror.h" #include "qemu/error-report.h" #include "sysemu/block-backend.h" diff --git a/include/hw/pci/pci.h b/include/hw/pci/pci.h index 0be07c8..ef6ba51 100644 --- a/include/hw/pci/pci.h +++ b/include/hw/pci/pci.h @@ -1,8 +1,6 @@ #ifndef QEMU_PCI_H #define QEMU_PCI_H -#include "qemu-common.h" - #include "hw/qdev.h" #include "exec/memory.h" #include "sysemu/dma.h" @@ -97,6 +95,15 @@ #define FMT_PCIBUS PRIx64 +typedef uint64_t pcibus_t; + +struct PCIHostDeviceAddress { + unsigned int domain; + unsigned int bus; + unsigned int slot; + unsigned int function; +}; + typedef void PCIConfigWriteFunc(PCIDevice *pci_dev, uint32_t address, uint32_t data, int len); typedef uint32_t PCIConfigReadFunc(PCIDevice *pci_dev, diff --git a/include/qemu-common.h b/include/qemu-common.h index ba37968..5a2d997 100644 --- a/include/qemu-common.h +++ b/include/qemu-common.h @@ -310,15 +310,6 @@ struct ParallelIOArg { typedef int (*DMA_transfer_handler) (void *opaque, int nchan, int pos, int size); -typedef uint64_t pcibus_t; - -typedef struct PCIHostDeviceAddress { - unsigned int domain; - unsigned int bus; - unsigned int slot; - unsigned int function; -} PCIHostDeviceAddress; - void tcg_exec_init(unsigned long tb_size); bool tcg_enabled(void); diff --git a/include/qemu/typedefs.h b/include/qemu/typedefs.h index 099146e..c1d2c2e 100644 --- a/include/qemu/typedefs.h +++ b/include/qemu/typedefs.h @@ -65,6 +65,7 @@ typedef struct PCIEPort PCIEPort; typedef struct PCIESlot PCIESlot; typedef struct PCIExpressDevice PCIExpressDevice; typedef struct PCIExpressHost PCIExpressHost; +typedef struct PCIHostDeviceAddress PCIHostDeviceAddress; typedef struct PCIHostState PCIHostState; typedef struct PCMachineClass PCMachineClass; typedef struct PCMachineState PCMachineState;