pci: Allow PCI bus subtypes to support extended config space accesses
[qemu/ar7.git] / include / hw / pci / pci_bus.h
blobf6df834170c5e82b56ff8c338039c62268fc546c
1 #ifndef QEMU_PCI_BUS_H
2 #define QEMU_PCI_BUS_H
4 #include "hw/pci/pci.h"
6 /*
7 * PCI Bus datastructures.
9 * Do not access the following members directly;
10 * use accessor functions in pci.h
13 typedef struct PCIBusClass {
14 /*< private >*/
15 BusClass parent_class;
16 /*< public >*/
18 bool (*is_root)(PCIBus *bus);
19 int (*bus_num)(PCIBus *bus);
20 uint16_t (*numa_node)(PCIBus *bus);
21 bool (*allows_extended_config_space)(PCIBus *bus);
22 } PCIBusClass;
24 struct PCIBus {
25 BusState qbus;
26 PCIIOMMUFunc iommu_fn;
27 void *iommu_opaque;
28 uint8_t devfn_min;
29 uint32_t slot_reserved_mask;
30 pci_set_irq_fn set_irq;
31 pci_map_irq_fn map_irq;
32 pci_route_irq_fn route_intx_to_irq;
33 void *irq_opaque;
34 PCIDevice *devices[PCI_SLOT_MAX * PCI_FUNC_MAX];
35 PCIDevice *parent_dev;
36 MemoryRegion *address_space_mem;
37 MemoryRegion *address_space_io;
39 QLIST_HEAD(, PCIBus) child; /* this will be replaced by qdev later */
40 QLIST_ENTRY(PCIBus) sibling;/* this will be replaced by qdev later */
42 /* The bus IRQ state is the logical OR of the connected devices.
43 Keep a count of the number of devices with raised IRQs. */
44 int nirq;
45 int *irq_count;
47 Notifier machine_done;
50 #endif /* QEMU_PCI_BUS_H */