From: Alvise Rigo <a.rigo@virtualopensystems.com>
To: qemu-devel@nongnu.org, rob.herring@linaro.org
Cc: tech@virtualopensystems.com, Alvise Rigo <a.rigo@virtualopensystems.com>
Subject: [Qemu-devel] [RFC PATCH 4/8] generic_pci: create header file
Date: Fri, 11 Jul 2014 09:21:06 +0200 [thread overview]
Message-ID: <1405063270-18902-5-git-send-email-a.rigo@virtualopensystems.com> (raw)
In-Reply-To: <1405063270-18902-1-git-send-email-a.rigo@virtualopensystems.com>
As a matter of fact, the mach-virt platform needs some definitions of
the generic_pci device.
Note: Including the device header file in the mach-virt platform can be
avoided extending properly the idea present in
"[PATCH 4/7] hw/arm/virt: Support dynamically spawned sysbus devices".
Signed-off-by: Alvise Rigo <a.rigo@virtualopensystems.com>
---
hw/pci-host/generic-pci.c | 31 +------------------------------
include/hw/pci-host/pci_generic.h | 33 +++++++++++++++++++++++++++++++++
2 files changed, 34 insertions(+), 30 deletions(-)
create mode 100644 include/hw/pci-host/pci_generic.h
diff --git a/hw/pci-host/generic-pci.c b/hw/pci-host/generic-pci.c
index 1632e46..8733c67 100644
--- a/hw/pci-host/generic-pci.c
+++ b/hw/pci-host/generic-pci.c
@@ -12,44 +12,15 @@
*/
#include "hw/sysbus.h"
-#include "hw/pci/pci.h"
-#include "hw/pci/pci_bus.h"
-#include "hw/pci/pci_host.h"
+#include "hw/pci-host/pci_generic.h"
#include "exec/address-spaces.h"
-typedef struct {
- PCIHostState parent_obj;
-
- qemu_irq irq[4];
- MemoryRegion mem_config;
- /* Containers representing the PCI address spaces */
- MemoryRegion pci_io_space;
- MemoryRegion pci_mem_space;
- /* Alias regions into PCI address spaces which we expose as sysbus regions.
- * The offsets into pci_mem_space are controlled by the imap registers.
- */
- MemoryRegion pci_io_window;
- MemoryRegion pci_mem_window;
- PCIBus pci_bus;
- PCIDevice pci_dev;
-} PCIVPBState;
-
-
static const VMStateDescription pci_generic_host_vmstate = {
.name = "generic-host-pci",
.version_id = 1,
.minimum_version_id = 1,
};
-#define TYPE_GENERIC_PCI "generic_pci"
-#define PCI_GEN(obj) \
- OBJECT_CHECK(PCIVPBState, (obj), TYPE_GENERIC_PCI)
-
-#define TYPE_GENERIC_PCI_HOST "generic_pci_host"
-#define PCI_GEN_HOST(obj) \
- OBJECT_CHECK(PCIDevice, (obj), TYPE_GENERIC_PCIHOST)
-
-
static void pci_cam_config_write(void *opaque, hwaddr addr,
uint64_t val, unsigned size)
{
diff --git a/include/hw/pci-host/pci_generic.h b/include/hw/pci-host/pci_generic.h
new file mode 100644
index 0000000..46e4cb8
--- /dev/null
+++ b/include/hw/pci-host/pci_generic.h
@@ -0,0 +1,33 @@
+#ifndef QEMU_GENERIC_PCI_H
+#define QEMU_GENERIC_PCI_H
+
+#include "hw/pci/pci.h"
+#include "hw/pci/pci_bus.h"
+#include "hw/pci/pci_host.h"
+
+typedef struct {
+ PCIHostState parent_obj;
+
+ qemu_irq irq[4];
+ MemoryRegion mem_config;
+ /* Containers representing the PCI address spaces */
+ MemoryRegion pci_io_space;
+ MemoryRegion pci_mem_space;
+ /* Alias regions into PCI address spaces which we expose as sysbus regions.
+ * The offsets into pci_mem_space are controlled by the imap registers.
+ */
+ MemoryRegion pci_io_window;
+ MemoryRegion pci_mem_window;
+ PCIBus pci_bus;
+ PCIDevice pci_dev;
+} PCIVPBState;
+
+#define TYPE_GENERIC_PCI "generic_pci"
+#define PCI_GEN(obj) \
+ OBJECT_CHECK(PCIVPBState, (obj), TYPE_GENERIC_PCI)
+
+#define TYPE_GENERIC_PCI_HOST "generic_pci_host"
+#define PCI_GEN_HOST(obj) \
+ OBJECT_CHECK(PCIDevice, (obj), TYPE_GENERIC_PCIHOST)
+
+#endif
--
1.9.1
next prev parent reply other threads:[~2014-07-11 7:21 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-11 7:21 [Qemu-devel] [RFC PATCH 0/8] Add Generic PCI host device update Alvise Rigo
2014-07-11 7:21 ` [Qemu-devel] [RFC PATCH 1/8] mach-virt: move GIC inside mach-virt structure Alvise Rigo
2014-07-11 7:21 ` [Qemu-devel] [RFC PATCH 2/8] mach-virt: improve PCI memory topology definition Alvise Rigo
2014-07-11 7:21 ` [Qemu-devel] [RFC PATCH 3/8] QEMUMachine: finalize_dt function Alvise Rigo
2014-07-11 7:21 ` Alvise Rigo [this message]
2014-07-11 7:21 ` [Qemu-devel] [RFC PATCH 5/8] generic_pci: create own map irq function Alvise Rigo
2014-07-11 7:21 ` [Qemu-devel] [RFC PATCH 6/8] generic_pci: generate dt node after devices init Alvise Rigo
2014-11-05 12:26 ` Claudio Fontana
2014-11-06 10:27 ` alvise rigo
2014-07-11 7:21 ` [Qemu-devel] [RFC PATCH 7/8] generic_pci: realize device with machine data Alvise Rigo
2014-07-11 7:21 ` [Qemu-devel] [RFC PATCH 8/8] generic_pci: add interrupt map structures Alvise Rigo
2014-07-11 9:09 ` [Qemu-devel] [RFC PATCH 0/8] Add Generic PCI host device update Peter Maydell
2014-07-11 9:28 ` Alvise Rigo
2014-07-13 14:28 ` Rob Herring
2014-09-09 16:35 ` Claudio Fontana
2014-09-10 7:31 ` alvise rigo
2014-11-05 10:23 ` Claudio Fontana
2014-11-05 11:09 ` alvise rigo
2014-11-07 15:40 ` Claudio Fontana
2014-11-10 10:00 ` alvise rigo
2014-11-11 3:24 ` Ming Lei
2014-11-11 4:22 ` Ming Lei
2014-11-11 10:26 ` Claudio Fontana
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1405063270-18902-5-git-send-email-a.rigo@virtualopensystems.com \
--to=a.rigo@virtualopensystems.com \
--cc=qemu-devel@nongnu.org \
--cc=rob.herring@linaro.org \
--cc=tech@virtualopensystems.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).