[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 08/15] hw/pci/pci.h: Don't include qemu-common.h
From: |
Markus Armbruster |
Subject: |
[Qemu-devel] [PATCH 08/15] hw/pci/pci.h: Don't include qemu-common.h |
Date: |
Tue, 15 Mar 2016 16:03:34 +0100 |
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 <address@hidden>
---
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;
--
2.4.3
- [Qemu-devel] [PATCH 02/15] Use scripts/clean-includes to drop redundant qemu/typedefs.h, (continued)
- [Qemu-devel] [PATCH 02/15] Use scripts/clean-includes to drop redundant qemu/typedefs.h, Markus Armbruster, 2016/03/15
- [Qemu-devel] [PATCH 10/15] Move QEMU_ALIGN_*() from qemu-common.h to qemu/osdep.h, Markus Armbruster, 2016/03/15
- [Qemu-devel] [PATCH 09/15] Move HOST_LONG_BITS from qemu-common.h to qemu/osdep.h, Markus Armbruster, 2016/03/15
- [Qemu-devel] [PATCH 05/15] fw_cfg: Split fw_cfg_keys.h off fw_cfg.h, Markus Armbruster, 2016/03/15
- [Qemu-devel] [PATCH 13/15] include/crypto: Include qapi-types.h instead of qemu-common.h, Markus Armbruster, 2016/03/15
- [Qemu-devel] [PATCH 11/15] Move ParallelIOArg from qemu-common.h to sysemu/char.h, Markus Armbruster, 2016/03/15
- [Qemu-devel] [PATCH 07/15] include/hw/hw.h: Don't include qemu-common.h, Markus Armbruster, 2016/03/15
- [Qemu-devel] [PATCH 12/15] isa: Move DMA_transfer_handler from qemu-common.h to hw/isa/isa.h, Markus Armbruster, 2016/03/15
- [Qemu-devel] [PATCH 08/15] hw/pci/pci.h: Don't include qemu-common.h,
Markus Armbruster <=
- [Qemu-devel] [PATCH 14/15] Don't include qemu-common.h in headers, Markus Armbruster, 2016/03/15
- Re: [Qemu-devel] [PATCH 14/15] Don't include qemu-common.h in headers, Daniel P. Berrange, 2016/03/15
- Re: [Qemu-devel] [PATCH 14/15] Don't include qemu-common.h in headers, Paolo Bonzini, 2016/03/15
- Re: [Qemu-devel] [PATCH 14/15] Don't include qemu-common.h in headers, Markus Armbruster, 2016/03/15
- Re: [Qemu-devel] [PATCH 14/15] Don't include qemu-common.h in headers, Paolo Bonzini, 2016/03/15
- Re: [Qemu-devel] [PATCH 14/15] Don't include qemu-common.h in headers, Peter Maydell, 2016/03/15
- Re: [Qemu-devel] [PATCH 14/15] Don't include qemu-common.h in headers, Paolo Bonzini, 2016/03/15
- Re: [Qemu-devel] [PATCH 14/15] Don't include qemu-common.h in headers, Peter Maydell, 2016/03/15
- Re: [Qemu-devel] [PATCH 14/15] Don't include qemu-common.h in headers, Markus Armbruster, 2016/03/15