} dpci_infos;
+char mapped_machine_irq[PT_NR_IRQS] = {0};
+
/* prototype */
static uint32_t pt_common_reg_init(struct pt_dev *ptdev,
struct pt_reg_info_tbl *reg, uint32_t real_offset);
{
machine_irq = pirq;
assigned_device->machine_irq = pirq;
+ mapped_machine_irq[machine_irq]++;
}
}
if (assigned_device->msix)
pt_msix_disable(assigned_device);
+ if (machine_irq)
+ {
+ mapped_machine_irq[machine_irq]--;
+
+ if (mapped_machine_irq[machine_irq] == 0)
+ {
+ rc = xc_physdev_unmap_pirq(xc_handle, domid, machine_irq);
+
+ if (rc < 0)
+ PT_LOG("Error: Unmaping of interrupt failed! rc=%d\n", rc);
+ }
+ }
+
/* delete all emulated config registers */
pt_config_delete(assigned_device);
#define PT_MACHINE_IRQ_AUTO (0xFFFFFFFF)
#define PT_VIRT_DEVFN_AUTO (-1)
+#define PT_NR_IRQS (256)
/* Misc PCI constants that should be moved to a separate library :) */
#define PCI_CONFIG_SIZE (256)