1 #include <linux/kernel.h>
2 #include <linux/string.h>
4 #include <linux/errno.h>
7 #include <asm/hw_irq.h>
8 #include <asm/irq_remapping.h>
18 static struct irq_remap_ops *remap_ops;
20 static __init int setup_nointremap(
char *
str)
27 static __init int setup_irqremap(
char *
str)
35 else if (!
strncmp(str,
"off", 3))
37 else if (!
strncmp(str,
"nosid", 5))
39 else if (!
strncmp(str,
"no_x2apic_optout", 16))
55 #ifdef CONFIG_AMD_IOMMU
56 if (amd_iommu_irq_ops.prepare() == 0)
57 remap_ops = &amd_iommu_irq_ops;
66 if (!remap_ops || !remap_ops->supported)
69 return remap_ops->supported();
74 if (!remap_ops || !remap_ops->prepare)
77 return remap_ops->prepare();
82 if (!remap_ops || !remap_ops->enable)
85 return remap_ops->enable();
90 if (!remap_ops || !remap_ops->disable)
98 if (!remap_ops || !remap_ops->reenable)
101 return remap_ops->reenable(mode);
106 if (!remap_ops || !remap_ops->enable_faulting)
109 return remap_ops->enable_faulting();
114 unsigned int destination,
int vector,
117 if (!remap_ops || !remap_ops->setup_ioapic_entry)
120 return remap_ops->setup_ioapic_entry(irq, entry, destination,
128 !remap_ops->set_affinity)
131 return remap_ops->set_affinity(data, mask, force);
136 if (!remap_ops || !remap_ops->free_irq)
139 remap_ops->free_irq(irq);
143 unsigned int irq,
unsigned int dest,
146 if (!remap_ops || !remap_ops->compose_msi_msg)
149 remap_ops->compose_msi_msg(pdev, irq, dest, msg, hpet_id);
154 if (!remap_ops || !remap_ops->msi_alloc_irq)
157 return remap_ops->msi_alloc_irq(pdev, irq, nvec);
161 int index,
int sub_handle)
163 if (!remap_ops || !remap_ops->msi_setup_irq)
166 return remap_ops->msi_setup_irq(pdev, irq, index, sub_handle);
171 if (!remap_ops || !remap_ops->setup_hpet_msi)
174 return remap_ops->setup_hpet_msi(irq,
id);