2
0

pci_internals.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. target_phys_addr_t mem_base;
  25. QLIST_HEAD(, PCIBus) child; /* this will be replaced by qdev later */
  26. QLIST_ENTRY(PCIBus) sibling;/* this will be replaced by qdev later */
  27. /* The bus IRQ state is the logical OR of the connected devices.
  28. Keep a count of the number of devices with raised IRQs. */
  29. int nirq;
  30. int *irq_count;
  31. };
  32. struct PCIBridge {
  33. PCIDevice dev;
  34. /* private member */
  35. PCIBus sec_bus;
  36. pci_map_irq_fn map_irq;
  37. const char *bus_name;
  38. };
  39. #endif /* QEMU_PCI_INTERNALS_H */