summaryrefslogtreecommitdiff
path: root/hw/ivshmem.c
diff options
context:
space:
mode:
authorAvi Kivity <avi@redhat.com>2011-08-08 16:09:26 +0300
committerAnthony Liguori <aliguori@us.ibm.com>2011-08-08 10:22:30 -0500
commit95524ae8dc8f06da0d6ba37703038238e3b27066 (patch)
tree9b050ccb65a7cb8a65f3746aaec401304a996ce9 /hw/ivshmem.c
parentde00982e9e14e2d6ba3d148f02c5a1e94deaa985 (diff)
downloadqemu-95524ae8dc8f06da0d6ba37703038238e3b27066.tar.gz
msix: convert to memory API
The msix table is defined as a subregion, to allow for a BAR that mixes device specific regions with the msix table. Reviewed-by: Richard Henderson <rth@twiddle.net> Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/ivshmem.c')
-rw-r--r--hw/ivshmem.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/hw/ivshmem.c b/hw/ivshmem.c
index f80e7b635e..bacba604d7 100644
--- a/hw/ivshmem.c
+++ b/hw/ivshmem.c
@@ -65,6 +65,7 @@ typedef struct IVShmemState {
*/
MemoryRegion bar;
MemoryRegion ivshmem;
+ MemoryRegion msix_bar;
uint64_t ivshmem_size; /* size of shared memory region */
int shm_fd; /* shared memory file descriptor */
@@ -540,11 +541,11 @@ static void ivshmem_setup_msi(IVShmemState * s) {
/* allocate the MSI-X vectors */
- if (!msix_init(&s->dev, s->vectors, 1, 0)) {
- pci_register_bar(&s->dev, 1,
- msix_bar_size(&s->dev),
- PCI_BASE_ADDRESS_SPACE_MEMORY,
- msix_mmio_map);
+ memory_region_init(&s->msix_bar, "ivshmem-msix", 4096);
+ if (!msix_init(&s->dev, s->vectors, &s->msix_bar, 1, 0)) {
+ pci_register_bar_region(&s->dev, 1,
+ PCI_BASE_ADDRESS_SPACE_MEMORY,
+ &s->msix_bar);
IVSHMEM_DPRINTF("msix initialized (%d vectors)\n", s->vectors);
} else {
IVSHMEM_DPRINTF("msix initialization failed\n");