diff options
| author | Michael S. Tsirkin <mst@redhat.com> | 2012-07-29 17:03:19 +0300 |
|---|---|---|
| committer | Michael S. Tsirkin <mst@redhat.com> | 2012-07-29 17:05:35 +0300 |
| commit | 5e59b024351f827f903f98ae522687ea53dc4f23 (patch) | |
| tree | 4996f31e1d7d9e08c04d8bbf018752a71c6cd4c3 /hw/msi.c | |
| parent | 7162ab21fe8e82f924002951cd8e87f69358f8b5 (diff) | |
| parent | 932d4a42afa28829fadf3cbfbb0507cc09aafd8b (diff) | |
| download | focaccia-qemu-5e59b024351f827f903f98ae522687ea53dc4f23.tar.gz focaccia-qemu-5e59b024351f827f903f98ae522687ea53dc4f23.zip | |
Merge branch pci into master
Merge master and pci branch, resolve build breakage in hw/esp.c introduced by f90c2bcd. Conflicts: hw/esp.c
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) && |