diff options
| author | Anthony Liguori <aliguori@us.ibm.com> | 2012-07-30 10:00:48 -0500 |
|---|---|---|
| committer | Anthony Liguori <aliguori@us.ibm.com> | 2012-07-30 10:00:48 -0500 |
| commit | 5e3bc7144edd6e4fa2824944e5eb16c28197dd5a (patch) | |
| tree | e12e9145e74916485b482b2336bf1775a177e635 /hw/msi.c | |
| parent | 4dd533aa03d6844f61e95558d75d8dbec72d899c (diff) | |
| parent | 5e59b024351f827f903f98ae522687ea53dc4f23 (diff) | |
| download | focaccia-qemu-5e3bc7144edd6e4fa2824944e5eb16c28197dd5a.tar.gz focaccia-qemu-5e3bc7144edd6e4fa2824944e5eb16c28197dd5a.zip | |
Merge remote-tracking branch 'mst/tags/for_anthony' into staging
* mst/tags/for_anthony: msi/msix: added API to set MSI message address and data pci: Add INTx routing notifier pci: Add pci_device_route_intx_to_irq pci: Unregister BARs before device exit pci: convert PCIUnregisterFunc to void msix: Switch msix_uninit to return void msix: Allow full specification of MSIX layout msix: Split PBA into it's own MemoryRegion msix: Note endian TODO item msix: Move msix_mmio_read virtio: Convert to msix_init_exclusive_bar() interface ivshmem: Convert to msix_init_exclusive_bar() interface msix: Add simple BAR allocation MSIX setup functions msix: fix PCIDevice naming inconsistency msix: drop unused msix_bar_size, require valid bar_size
Diffstat (limited to 'hw/msi.c')
| -rw-r--r-- | hw/msi.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/hw/msi.c b/hw/msi.c index 52332041e7..e2273a09ae 100644 --- a/hw/msi.c +++ b/hw/msi.c @@ -105,6 +105,23 @@ static inline uint8_t msi_pending_off(const PCIDevice* dev, bool msi64bit) return dev->msi_cap + (msi64bit ? PCI_MSI_PENDING_64 : PCI_MSI_PENDING_32); } +/* + * Special API for POWER to configure the vectors through + * a side channel. Should never be used by devices. + */ +void msi_set_message(PCIDevice *dev, MSIMessage msg) +{ + uint16_t flags = pci_get_word(dev->config + msi_flags_off(dev)); + bool msi64bit = flags & PCI_MSI_FLAGS_64BIT; + + if (msi64bit) { + pci_set_quad(dev->config + msi_address_lo_off(dev), msg.address); + } else { + pci_set_long(dev->config + msi_address_lo_off(dev), msg.address); + } + pci_set_word(dev->config + msi_data_off(dev, msi64bit), msg.data); +} + bool msi_enabled(const PCIDevice *dev) { return msi_present(dev) && |