diff options
| author | Michael S. Tsirkin <mst@redhat.com> | 2009-06-21 19:49:54 +0300 |
|---|---|---|
| committer | Anthony Liguori <aliguori@us.ibm.com> | 2009-06-24 09:09:14 -0500 |
| commit | 02eb84d0ec97f183ac23ee939403a139e8849b1d (patch) | |
| tree | 9425e8a576f027b67c5f4b40fdb7762b7c57b753 /hw/pci.h | |
| parent | bd4b65ee5e5f750da709ac10c70266876e515c23 (diff) | |
| download | focaccia-qemu-02eb84d0ec97f183ac23ee939403a139e8849b1d.tar.gz focaccia-qemu-02eb84d0ec97f183ac23ee939403a139e8849b1d.zip | |
qemu/pci: MSI-X support functions
Add functions implementing MSI-X support. First user will be virtio-pci. Note that platform must set a flag to declare MSI supported: this is a safety measure to avoid breaking platforms which should support MSI-X but currently lack this in the interrupt controller emulation. For PC this will be set by APIC. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/pci.h')
| -rw-r--r-- | hw/pci.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/hw/pci.h b/hw/pci.h index 8b5edef003..87b5a3cf24 100644 --- a/hw/pci.h +++ b/hw/pci.h @@ -155,6 +155,11 @@ typedef struct PCIIORegion { /* Size of the standard PCI config space */ #define PCI_CONFIG_SPACE_SIZE 0x100 +/* Bits in cap_present field. */ +enum { + QEMU_PCI_CAP_MSIX = 0x1, +}; + struct PCIDevice { DeviceState qdev; /* PCI config space */ @@ -186,6 +191,24 @@ struct PCIDevice { /* Current IRQ levels. Used internally by the generic PCI code. */ int irq_state[4]; + + /* Capability bits */ + uint32_t cap_present; + + /* Offset of MSI-X capability in config space */ + uint8_t msix_cap; + + /* MSI-X entries */ + int msix_entries_nr; + + /* Space to store MSIX table */ + uint8_t *msix_table_page; + /* MMIO index used to map MSIX table and pending bit entries. */ + int msix_mmio_index; + /* Reference-count for entries actually in use by driver. */ + unsigned *msix_entry_used; + /* Region including the MSI-X table */ + uint32_t msix_bar_size; }; PCIDevice *pci_register_device(PCIBus *bus, const char *name, |