From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40432) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X5V9E-0007L1-Cp for qemu-devel@nongnu.org; Fri, 11 Jul 2014 03:21:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X5V97-00067H-MY for qemu-devel@nongnu.org; Fri, 11 Jul 2014 03:21:36 -0400 Received: from mail-wi0-f171.google.com ([209.85.212.171]:61385) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X5V97-00066r-Ge for qemu-devel@nongnu.org; Fri, 11 Jul 2014 03:21:29 -0400 Received: by mail-wi0-f171.google.com with SMTP id f8so5263199wiw.4 for ; Fri, 11 Jul 2014 00:21:27 -0700 (PDT) From: Alvise Rigo Date: Fri, 11 Jul 2014 09:21:06 +0200 Message-Id: <1405063270-18902-5-git-send-email-a.rigo@virtualopensystems.com> In-Reply-To: <1405063270-18902-1-git-send-email-a.rigo@virtualopensystems.com> References: <1405063270-18902-1-git-send-email-a.rigo@virtualopensystems.com> Subject: [Qemu-devel] [RFC PATCH 4/8] generic_pci: create header file List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org, rob.herring@linaro.org Cc: tech@virtualopensystems.com, Alvise Rigo 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 --- 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