mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 23:33:54 -06:00
hw/pci: made pci_bus_is_root a PCIBusClass method
Refactoring it as a method of PCIBusClass will allow different implementations for subclasses. Removed the assumption that the root bus does not have a parent device because is specific only to the default class implementation. Signed-off-by: Marcel Apfelbaum <marcel@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Acked-by: Laszlo Ersek <lersek@redhat.com>
This commit is contained in:
parent
32d9ca15ba
commit
ce6a28ee05
3 changed files with 24 additions and 3 deletions
|
@ -340,6 +340,8 @@ typedef PCIINTxRoute (*pci_route_irq_fn)(void *opaque, int pin);
|
|||
|
||||
#define TYPE_PCI_BUS "PCI"
|
||||
#define PCI_BUS(obj) OBJECT_CHECK(PCIBus, (obj), TYPE_PCI_BUS)
|
||||
#define PCI_BUS_CLASS(klass) OBJECT_CLASS_CHECK(PCIBusClass, (klass), TYPE_PCI_BUS)
|
||||
#define PCI_BUS_GET_CLASS(obj) OBJECT_GET_CLASS(PCIBusClass, (obj), TYPE_PCI_BUS)
|
||||
#define TYPE_PCIE_BUS "PCIE"
|
||||
|
||||
bool pci_bus_is_express(PCIBus *bus);
|
||||
|
|
|
@ -8,6 +8,14 @@
|
|||
* use accessor functions in pci.h, pci_bridge.h
|
||||
*/
|
||||
|
||||
typedef struct PCIBusClass {
|
||||
/*< private >*/
|
||||
BusClass parent_class;
|
||||
/*< public >*/
|
||||
|
||||
bool (*is_root)(PCIBus *bus);
|
||||
} PCIBusClass;
|
||||
|
||||
struct PCIBus {
|
||||
BusState qbus;
|
||||
PCIIOMMUFunc iommu_fn;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue