]> Git Repo - qemu.git/commitdiff
hw/pci/pci.h: Don't include qemu-common.h
authorMarkus Armbruster <[email protected]>
Wed, 9 Mar 2016 12:44:19 +0000 (13:44 +0100)
committerPaolo Bonzini <[email protected]>
Tue, 22 Mar 2016 21:20:16 +0000 (22:20 +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 <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
hw/core/qdev-properties.c
include/hw/pci/pci.h
include/qemu-common.h
include/qemu/typedefs.h

index eef932cbf16de595730ec55721c57fe66960b97a..a8c77ec73154e80b7069220cf1aa2c90e15f0f51 100644 (file)
@@ -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"
index 0be07c83520e3dc6476d72b1403b2e13a40832f7..ef6ba51f6c6850df5c6dafa0fff3faa98e684fde 100644 (file)
@@ -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"
 
 #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,
index ba3796850399d87659602ae79afe5b2bd82da937..5a2d9972bd21e0a39884452d10c0515ed552c40e 100644 (file)
@@ -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);
 
index c987db6ddf814e27ab28be368dc05257d7d2f81d..1dcf6f5d5330dc5007e842fe13b83e2634fff7ca 100644 (file)
@@ -66,6 +66,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;
This page took 0.031186 seconds and 4 git commands to generate.