aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/xen
diff options
context:
space:
mode:
authorStefano Stabellini <stefano.stabellini@eu.citrix.com>2010-07-01 12:10:39 -0400
committerStefano Stabellini <stefano.stabellini@eu.citrix.com>2010-10-22 16:25:43 -0400
commit809f9267bbaba7765cdb86a47f2e6e4bf4951b69 (patch)
tree5ed0ad8e7f5f535d94927498feefba15c9770e91 /drivers/xen
parent3942b740e5183caad47a4a3fcb37a4509ce7af83 (diff)
xen: map MSIs into pirqs
Map MSIs into pirqs, writing 0 in the MSI vector data field and the pirq number in the MSI destination id field. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Diffstat (limited to 'drivers/xen')
-rw-r--r--drivers/xen/events.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/drivers/xen/events.c b/drivers/xen/events.c
index 32269bcbd88c..efa683ee8840 100644
--- a/drivers/xen/events.c
+++ b/drivers/xen/events.c
@@ -656,6 +656,28 @@ out:
656 return irq; 656 return irq;
657} 657}
658 658
659void xen_allocate_pirq_msi(char *name, int *irq, int *pirq)
660{
661 spin_lock(&irq_mapping_update_lock);
662
663 *irq = find_unbound_irq();
664 if (*irq == -1)
665 goto out;
666
667 *pirq = find_unbound_pirq();
668 if (*pirq == -1)
669 goto out;
670
671 set_irq_chip_and_handler_name(*irq, &xen_pirq_chip,
672 handle_level_irq, name);
673
674 irq_info[*irq] = mk_pirq_info(0, *pirq, 0, 0);
675 pirq_to_irq[*pirq] = *irq;
676
677out:
678 spin_unlock(&irq_mapping_update_lock);
679}
680
659int xen_destroy_irq(int irq) 681int xen_destroy_irq(int irq)
660{ 682{
661 struct irq_desc *desc; 683 struct irq_desc *desc;