qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 11/15] pci: add pci_register_msix_region


From: Anthony Liguori
Subject: [Qemu-devel] [PATCH 11/15] pci: add pci_register_msix_region
Date: Tue, 9 Feb 2010 16:01:35 -0600

And make virtio use it.

Signed-off-by: Anthony Liguori <address@hidden>
---
 hw/pci.c        |    8 ++++++++
 hw/pci.h        |    2 ++
 hw/virtio-pci.c |    5 +----
 3 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/hw/pci.c b/hw/pci.c
index 5460f27..50ae917 100644
--- a/hw/pci.c
+++ b/hw/pci.c
@@ -28,6 +28,7 @@
 #include "sysemu.h"
 #include "loader.h"
 #include "qemu-objects.h"
+#include "msix.h"
 
 //#define DEBUG_PCI
 #ifdef DEBUG_PCI
@@ -823,6 +824,13 @@ void pci_register_io_region(PCIDevice *d, int region_num,
     }
 }
 
+void pci_register_msix_region(PCIDevice *d, int region_num)
+{
+    pci_register_bar(d, region_num, msix_bar_size(d),
+                     PCI_BASE_ADDRESS_SPACE_MEMORY,
+                     msix_mmio_map);
+}
+
 static uint32_t pci_config_get_io_base(PCIDevice *d,
                                        uint32_t base, uint32_t base_upper16)
 {
diff --git a/hw/pci.h b/hw/pci.h
index 3edf28f..9645fce 100644
--- a/hw/pci.h
+++ b/hw/pci.h
@@ -202,6 +202,8 @@ void pci_register_io_region(PCIDevice *d, int region_num,
                             pcibus_t size, int type,
                             PCIIOReadFunc *readcb, PCIIOWriteFunc *writecb);
 
+void pci_register_msix_region(PCIDevice *d, int region_num);
+
 void pci_memory_read(PCIDevice *pci_dev, pcibus_t addr, void *buf, int len);
 void pci_memory_write(PCIDevice *pci_dev, pcibus_t addr,
                       const void *buf, int len);
diff --git a/hw/virtio-pci.c b/hw/virtio-pci.c
index a2ba294..81c4d37 100644
--- a/hw/virtio-pci.c
+++ b/hw/virtio-pci.c
@@ -372,10 +372,7 @@ static void virtio_init_pci(VirtIOPCIProxy *proxy, 
VirtIODevice *vdev,
     config[0x3d] = 1;
 
     if (vdev->nvectors && !msix_init(&proxy->pci_dev, vdev->nvectors, 1, 0)) {
-        pci_register_bar(&proxy->pci_dev, 1,
-                         msix_bar_size(&proxy->pci_dev),
-                         PCI_BASE_ADDRESS_SPACE_MEMORY,
-                         msix_mmio_map);
+        pci_register_msix_region(&proxy->pci_dev, 1);
     } else
         vdev->nvectors = 0;
 
-- 
1.6.5.2





reply via email to

[Prev in Thread] Current Thread [Next in Thread]