int msix_uninit(PCIDevice *dev, MemoryRegion *bar)

{

    if (!(dev->cap_present & QEMU_PCI_CAP_MSIX))

        return 0;

    pci_del_capability(dev, PCI_CAP_ID_MSIX, MSIX_CAP_LENGTH);

    dev->msix_cap = 0;

    msix_free_irq_entries(dev);

    dev->msix_entries_nr = 0;

    memory_region_del_subregion(bar, &dev->msix_mmio);

    memory_region_destroy(&dev->msix_mmio);

    g_free(dev->msix_table_page);

    dev->msix_table_page = NULL;

    g_free(dev->msix_entry_used);

    dev->msix_entry_used = NULL;

    dev->cap_present &= ~QEMU_PCI_CAP_MSIX;

    return 0;

}

int msix_uninit(PCIDevice *dev, MemoryRegion *bar)

{

    if (!(dev->cap_present & QEMU_PCI_CAP_MSIX))

        return 0;

    pci_del_capability(dev, PCI_CAP_ID_MSIX, MSIX_CAP_LENGTH);

    dev->msix_cap = 0;

    msix_free_irq_entries(dev);

    dev->msix_entries_nr = 0;

    memory_region_del_subregion(bar, &dev->msix_mmio);

    memory_region_destroy(&dev->msix_mmio);

    g_free(dev->msix_table_page);

    dev->msix_table_page = NULL;

    g_free(dev->msix_entry_used);

    dev->msix_entry_used = NULL;

    dev->cap_present &= ~QEMU_PCI_CAP_MSIX;

    return 0;

}

int FUNC_0(PCIDevice *VAR_0, MemoryRegion *VAR_1)

{

    if (!(VAR_0->cap_present & QEMU_PCI_CAP_MSIX))

        return 0;

    pci_del_capability(VAR_0, PCI_CAP_ID_MSIX, MSIX_CAP_LENGTH);

    VAR_0->msix_cap = 0;

    msix_free_irq_entries(VAR_0);

    VAR_0->msix_entries_nr = 0;

    memory_region_del_subregion(VAR_1, &VAR_0->msix_mmio);

    memory_region_destroy(&VAR_0->msix_mmio);

    g_free(VAR_0->msix_table_page);

    VAR_0->msix_table_page = NULL;

    g_free(VAR_0->msix_entry_used);

    VAR_0->msix_entry_used = NULL;

    VAR_0->cap_present &= ~QEMU_PCI_CAP_MSIX;

    return 0;

}

int FUNC_0(PCIDevice *VAR_0, MemoryRegion *VAR_1)
{ if (!(VAR_0->cap_present & QEMU_PCI_CAP_MSIX))
return 0; pci_del_capability(VAR_0, PCI_CAP_ID_MSIX, MSIX_CAP_LENGTH); VAR_0->msix_cap = 0; msix_free_irq_entries(VAR_0); VAR_0->msix_entries_nr = 0; memory_region_del_subregion(VAR_1, &VAR_0->msix_mmio); memory_region_destroy(&VAR_0->msix_mmio); g_free(VAR_0->msix_table_page); VAR_0->msix_table_page = NULL; g_free(VAR_0->msix_entry_used); VAR_0->msix_entry_used = NULL; VAR_0->cap_present &= ~QEMU_PCI_CAP_MSIX; return 0; }