void msi_notify(PCIDevice *dev, unsigned int vector)

{

    uint16_t flags = pci_get_word(dev->config + msi_flags_off(dev));

    bool msi64bit = flags & PCI_MSI_FLAGS_64BIT;

    unsigned int nr_vectors = msi_nr_vectors(flags);

    MSIMessage msg;



    assert(vector < nr_vectors);

    if (msi_is_masked(dev, vector)) {

        assert(flags & PCI_MSI_FLAGS_MASKBIT);

        pci_long_test_and_set_mask(

            dev->config + msi_pending_off(dev, msi64bit), 1U << vector);

        MSI_DEV_PRINTF(dev, "pending vector 0x%x\n", vector);

        return;

    }



    msg = msi_get_message(dev, vector);



    MSI_DEV_PRINTF(dev,

                   "notify vector 0x%x"

                   " address: 0x%"PRIx64" data: 0x%"PRIx32"\n",

                   vector, msg.address, msg.data);

    stl_le_phys(&address_space_memory, msg.address, msg.data);

}

void msi_notify(PCIDevice *dev, unsigned int vector)

{

    uint16_t flags = pci_get_word(dev->config + msi_flags_off(dev));

    bool msi64bit = flags & PCI_MSI_FLAGS_64BIT;

    unsigned int nr_vectors = msi_nr_vectors(flags);

    MSIMessage msg;



    assert(vector < nr_vectors);

    if (msi_is_masked(dev, vector)) {

        assert(flags & PCI_MSI_FLAGS_MASKBIT);

        pci_long_test_and_set_mask(

            dev->config + msi_pending_off(dev, msi64bit), 1U << vector);

        MSI_DEV_PRINTF(dev, "pending vector 0x%x\n", vector);

        return;

    }



    msg = msi_get_message(dev, vector);



    MSI_DEV_PRINTF(dev,

                   "notify vector 0x%x"

                   " address: 0x%"PRIx64" data: 0x%"PRIx32"\n",

                   vector, msg.address, msg.data);

    stl_le_phys(&address_space_memory, msg.address, msg.data);

}

void FUNC_0(PCIDevice *VAR_0, unsigned int VAR_1)

{

    uint16_t flags = pci_get_word(VAR_0->config + msi_flags_off(VAR_0));

    bool msi64bit = flags & PCI_MSI_FLAGS_64BIT;

    unsigned int VAR_2 = msi_nr_vectors(flags);

    MSIMessage msg;



    assert(VAR_1 < VAR_2);

    if (msi_is_masked(VAR_0, VAR_1)) {

        assert(flags & PCI_MSI_FLAGS_MASKBIT);

        pci_long_test_and_set_mask(

            VAR_0->config + msi_pending_off(VAR_0, msi64bit), 1U << VAR_1);

        MSI_DEV_PRINTF(VAR_0, "pending VAR_1 0x%x\n", VAR_1);

        return;

    }



    msg = msi_get_message(VAR_0, VAR_1);



    MSI_DEV_PRINTF(VAR_0,

                   "notify VAR_1 0x%x"

                   " address: 0x%"PRIx64" data: 0x%"PRIx32"\n",

                   VAR_1, msg.address, msg.data);

    stl_le_phys(&address_space_memory, msg.address, msg.data);

}

void FUNC_0(PCIDevice *VAR_0, unsigned int VAR_1)
{ uint16_t flags = pci_get_word(VAR_0->config + msi_flags_off(VAR_0)); bool msi64bit = flags & PCI_MSI_FLAGS_64BIT; unsigned int VAR_2 = msi_nr_vectors(flags); MSIMessage msg; assert(VAR_1 < VAR_2); if (msi_is_masked(VAR_0, VAR_1)) { assert(flags & PCI_MSI_FLAGS_MASKBIT); pci_long_test_and_set_mask(
VAR_0->config + msi_pending_off(VAR_0, msi64bit), 1U << VAR_1); MSI_DEV_PRINTF(VAR_0, "pending VAR_1 0x%x\n", VAR_1); return; } msg = msi_get_message(VAR_0, VAR_1); MSI_DEV_PRINTF(VAR_0,
"notify VAR_1 0x%x"
" address: 0x%"PRIx64" data: 0x%"PRIx32"\n",
VAR_1, msg.address, msg.data); stl_le_phys(&address_space_memory, msg.address, msg.data); }