diff options
Diffstat (limited to 'arch/x86/pci/xen.c')
-rw-r--r-- | arch/x86/pci/xen.c | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/arch/x86/pci/xen.c b/arch/x86/pci/xen.c index 4e371065ce41..08e3cdccdfa8 100644 --- a/arch/x86/pci/xen.c +++ b/arch/x86/pci/xen.c | |||
@@ -17,6 +17,44 @@ | |||
17 | #include <xen/events.h> | 17 | #include <xen/events.h> |
18 | #include <asm/xen/pci.h> | 18 | #include <asm/xen/pci.h> |
19 | 19 | ||
20 | #ifdef CONFIG_ACPI | ||
21 | static int xen_hvm_register_pirq(u32 gsi, int triggering) | ||
22 | { | ||
23 | int rc, irq; | ||
24 | struct physdev_map_pirq map_irq; | ||
25 | int shareable = 0; | ||
26 | char *name; | ||
27 | |||
28 | if (!xen_hvm_domain()) | ||
29 | return -1; | ||
30 | |||
31 | map_irq.domid = DOMID_SELF; | ||
32 | map_irq.type = MAP_PIRQ_TYPE_GSI; | ||
33 | map_irq.index = gsi; | ||
34 | map_irq.pirq = -1; | ||
35 | |||
36 | rc = HYPERVISOR_physdev_op(PHYSDEVOP_map_pirq, &map_irq); | ||
37 | if (rc) { | ||
38 | printk(KERN_WARNING "xen map irq failed %d\n", rc); | ||
39 | return -1; | ||
40 | } | ||
41 | |||
42 | if (triggering == ACPI_EDGE_SENSITIVE) { | ||
43 | shareable = 0; | ||
44 | name = "ioapic-edge"; | ||
45 | } else { | ||
46 | shareable = 1; | ||
47 | name = "ioapic-level"; | ||
48 | } | ||
49 | |||
50 | irq = xen_map_pirq_gsi(map_irq.pirq, gsi, shareable, name); | ||
51 | |||
52 | printk(KERN_DEBUG "xen: --> irq=%d, pirq=%d\n", irq, map_irq.pirq); | ||
53 | |||
54 | return irq; | ||
55 | } | ||
56 | #endif | ||
57 | |||
20 | #if defined(CONFIG_PCI_MSI) | 58 | #if defined(CONFIG_PCI_MSI) |
21 | #include <linux/msi.h> | 59 | #include <linux/msi.h> |
22 | 60 | ||