pci: Add INTx routing notifier
[qemu/ar7.git] / hw / pci_internals.h
blobd704704833c65ab008349423e316660c3728c2cb
1 #ifndef QEMU_PCI_INTERNALS_H
2 #define QEMU_PCI_INTERNALS_H
4 /*
5 * This header files is private to pci.c and pci_bridge.c
6 * So following structures are opaque to others and shouldn't be
7 * accessed.
9 * For pci-to-pci bridge needs to include this header file to embed
10 * PCIBridge in its structure or to get sizeof(PCIBridge),
11 * However, they shouldn't access those following members directly.
12 * Use accessor function in pci.h, pci_bridge.h
15 extern struct BusInfo pci_bus_info;
17 struct PCIBus {
18 BusState qbus;
19 uint8_t devfn_min;
20 pci_set_irq_fn set_irq;
21 pci_map_irq_fn map_irq;
22 pci_route_irq_fn route_intx_to_irq;
23 pci_hotplug_fn hotplug;
24 DeviceState *hotplug_qdev;
25 void *irq_opaque;
26 PCIDevice *devices[PCI_SLOT_MAX * PCI_FUNC_MAX];
27 PCIDevice *parent_dev;
28 MemoryRegion *address_space_mem;
29 MemoryRegion *address_space_io;
31 QLIST_HEAD(, PCIBus) child; /* this will be replaced by qdev later */
32 QLIST_ENTRY(PCIBus) sibling;/* this will be replaced by qdev later */
34 /* The bus IRQ state is the logical OR of the connected devices.
35 Keep a count of the number of devices with raised IRQs. */
36 int nirq;
37 int *irq_count;
40 struct PCIBridge {
41 PCIDevice dev;
43 /* private member */
44 PCIBus sec_bus;
46 * Memory regions for the bridge's address spaces. These regions are not
47 * directly added to system_memory/system_io or its descendants.
48 * Bridge's secondary bus points to these, so that devices
49 * under the bridge see these regions as its address spaces.
50 * The regions are as large as the entire address space -
51 * they don't take into account any windows.
53 MemoryRegion address_space_mem;
54 MemoryRegion address_space_io;
56 * Aliases for each of the address space windows that the bridge
57 * can forward. Mapped into the bridge's parent's address space,
58 * as subregions.
60 MemoryRegion alias_pref_mem;
61 MemoryRegion alias_mem;
62 MemoryRegion alias_io;
63 pci_map_irq_fn map_irq;
64 const char *bus_name;
67 #endif /* QEMU_PCI_INTERNALS_H */