mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 08:43:55 -06:00
pci_host: Turn into SysBus-derived QOM type
The preceding commits fixed misuses of FROM_SYSBUS() that led people to add a bogus busdev field. For qdev the field order was less relevant but for QOM the PCIHostState field (including the SysBusDevice actually initialized with a value) must be placed first within the state struct. To facilitate accessing the PCIHostState fields, derive all PCI host bridges from TYPE_PCI_HOST_BRIDGE rather than TYPE_SYS_BUS_DEVICE. We can now access PCIHostState QOM-style, with PCI_HOST_BRIDGE() macro. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Wanpeng Li <liwanp@linux.vnet.ibm.com> Signed-off-by: Andreas Färber <andreas.faerber@web.de> Signed-off-by: Andreas Färber <afaerber@suse.de> Acked-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
parent
57fd7b7fce
commit
b44ff9d430
2 changed files with 17 additions and 0 deletions
|
@ -30,8 +30,13 @@
|
|||
|
||||
#include "sysbus.h"
|
||||
|
||||
#define TYPE_PCI_HOST_BRIDGE "pci-host-bridge"
|
||||
#define PCI_HOST_BRIDGE(obj) \
|
||||
OBJECT_CHECK(PCIHostState, (obj), TYPE_PCI_HOST_BRIDGE)
|
||||
|
||||
struct PCIHostState {
|
||||
SysBusDevice busdev;
|
||||
|
||||
MemoryRegion conf_mem;
|
||||
MemoryRegion data_mem;
|
||||
MemoryRegion mmcfg;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue