From: Jason Baron Date: Fri, 19 Oct 2012 20:43:33 +0000 (-0400) Subject: pcie: Convert PCIExpressHost to use the QOM. X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=bc927e488c040c8ef2faed323e8a1a3d0ebbfb62;p=qmiga%2Fqemu.git pcie: Convert PCIExpressHost to use the QOM. Let's use PCIExpressHost with QOM. Reviewed-by: Paolo Bonzini Acked-by: Andreas Färber Signed-off-by: Jason Baron Signed-off-by: Michael S. Tsirkin --- diff --git a/hw/pcie_host.c b/hw/pcie_host.c index 2231d28ec3..c257fb43ca 100644 --- a/hw/pcie_host.c +++ b/hw/pcie_host.c @@ -145,3 +145,17 @@ void pcie_host_mmcfg_update(PCIExpressHost *e, pcie_host_mmcfg_map(e, addr, size); } } + +static const TypeInfo pcie_host_type_info = { + .name = TYPE_PCIE_HOST_BRIDGE, + .parent = TYPE_PCI_HOST_BRIDGE, + .abstract = true, + .instance_size = sizeof(PCIExpressHost), +}; + +static void pcie_host_register_types(void) +{ + type_register_static(&pcie_host_type_info); +} + +type_init(pcie_host_register_types) diff --git a/hw/pcie_host.h b/hw/pcie_host.h index 73e88db73e..392193530d 100644 --- a/hw/pcie_host.h +++ b/hw/pcie_host.h @@ -24,6 +24,10 @@ #include "pci_host.h" #include "memory.h" +#define TYPE_PCIE_HOST_BRIDGE "pcie-host-bridge" +#define PCIE_HOST_BRIDGE(obj) \ + OBJECT_CHECK(PCIExpressHost, (obj), TYPE_PCIE_HOST_BRIDGE) + struct PCIExpressHost { PCIHostState pci;