pci_internals.h 2.0 KB

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