aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/dmar.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/dmar.h')
-rw-r--r--include/linux/dmar.h52
1 files changed, 42 insertions, 10 deletions
diff --git a/include/linux/dmar.h b/include/linux/dmar.h
index f28440784cf0..2f3427468956 100644
--- a/include/linux/dmar.h
+++ b/include/linux/dmar.h
@@ -24,10 +24,10 @@
24#include <linux/acpi.h> 24#include <linux/acpi.h>
25#include <linux/types.h> 25#include <linux/types.h>
26#include <linux/msi.h> 26#include <linux/msi.h>
27#include <linux/irqreturn.h>
27 28
28#if defined(CONFIG_DMAR) || defined(CONFIG_INTR_REMAP)
29struct intel_iommu; 29struct intel_iommu;
30 30#if defined(CONFIG_DMAR) || defined(CONFIG_INTR_REMAP)
31struct dmar_drhd_unit { 31struct dmar_drhd_unit {
32 struct list_head list; /* list of drhd units */ 32 struct list_head list; /* list of drhd units */
33 struct acpi_dmar_header *hdr; /* ACPI header */ 33 struct acpi_dmar_header *hdr; /* ACPI header */
@@ -49,7 +49,7 @@ extern int dmar_dev_scope_init(void);
49 49
50/* Intel IOMMU detection */ 50/* Intel IOMMU detection */
51extern void detect_intel_iommu(void); 51extern void detect_intel_iommu(void);
52 52extern int enable_drhd_fault_handling(void);
53 53
54extern int parse_ioapics_under_ir(void); 54extern int parse_ioapics_under_ir(void);
55extern int alloc_iommu(struct dmar_drhd_unit *); 55extern int alloc_iommu(struct dmar_drhd_unit *);
@@ -63,12 +63,12 @@ static inline int dmar_table_init(void)
63{ 63{
64 return -ENODEV; 64 return -ENODEV;
65} 65}
66static inline int enable_drhd_fault_handling(void)
67{
68 return -1;
69}
66#endif /* !CONFIG_DMAR && !CONFIG_INTR_REMAP */ 70#endif /* !CONFIG_DMAR && !CONFIG_INTR_REMAP */
67 71
68#ifdef CONFIG_INTR_REMAP
69extern int intr_remapping_enabled;
70extern int enable_intr_remapping(int);
71
72struct irte { 72struct irte {
73 union { 73 union {
74 struct { 74 struct {
@@ -97,6 +97,10 @@ struct irte {
97 __u64 high; 97 __u64 high;
98 }; 98 };
99}; 99};
100#ifdef CONFIG_INTR_REMAP
101extern int intr_remapping_enabled;
102extern int enable_intr_remapping(int);
103
100extern int get_irte(int irq, struct irte *entry); 104extern int get_irte(int irq, struct irte *entry);
101extern int modify_irte(int irq, struct irte *irte_modified); 105extern int modify_irte(int irq, struct irte *irte_modified);
102extern int alloc_irte(struct intel_iommu *iommu, int irq, u16 count); 106extern int alloc_irte(struct intel_iommu *iommu, int irq, u16 count);
@@ -111,14 +115,40 @@ extern int irq_remapped(int irq);
111extern struct intel_iommu *map_dev_to_ir(struct pci_dev *dev); 115extern struct intel_iommu *map_dev_to_ir(struct pci_dev *dev);
112extern struct intel_iommu *map_ioapic_to_ir(int apic); 116extern struct intel_iommu *map_ioapic_to_ir(int apic);
113#else 117#else
118static inline int alloc_irte(struct intel_iommu *iommu, int irq, u16 count)
119{
120 return -1;
121}
122static inline int modify_irte(int irq, struct irte *irte_modified)
123{
124 return -1;
125}
126static inline int free_irte(int irq)
127{
128 return -1;
129}
130static inline int map_irq_to_irte_handle(int irq, u16 *sub_handle)
131{
132 return -1;
133}
134static inline int set_irte_irq(int irq, struct intel_iommu *iommu, u16 index,
135 u16 sub_handle)
136{
137 return -1;
138}
139static inline struct intel_iommu *map_dev_to_ir(struct pci_dev *dev)
140{
141 return NULL;
142}
143static inline struct intel_iommu *map_ioapic_to_ir(int apic)
144{
145 return NULL;
146}
114#define irq_remapped(irq) (0) 147#define irq_remapped(irq) (0)
115#define enable_intr_remapping(mode) (-1) 148#define enable_intr_remapping(mode) (-1)
116#define intr_remapping_enabled (0) 149#define intr_remapping_enabled (0)
117#endif 150#endif
118 151
119#ifdef CONFIG_DMAR
120extern const char *dmar_get_fault_reason(u8 fault_reason);
121
122/* Can't use the common MSI interrupt functions 152/* Can't use the common MSI interrupt functions
123 * since DMAR is not a pci device 153 * since DMAR is not a pci device
124 */ 154 */
@@ -127,8 +157,10 @@ extern void dmar_msi_mask(unsigned int irq);
127extern void dmar_msi_read(int irq, struct msi_msg *msg); 157extern void dmar_msi_read(int irq, struct msi_msg *msg);
128extern void dmar_msi_write(int irq, struct msi_msg *msg); 158extern void dmar_msi_write(int irq, struct msi_msg *msg);
129extern int dmar_set_interrupt(struct intel_iommu *iommu); 159extern int dmar_set_interrupt(struct intel_iommu *iommu);
160extern irqreturn_t dmar_fault(int irq, void *dev_id);
130extern int arch_setup_dmar_msi(unsigned int irq); 161extern int arch_setup_dmar_msi(unsigned int irq);
131 162
163#ifdef CONFIG_DMAR
132extern int iommu_detected, no_iommu; 164extern int iommu_detected, no_iommu;
133extern struct list_head dmar_rmrr_units; 165extern struct list_head dmar_rmrr_units;
134struct dmar_rmrr_unit { 166struct dmar_rmrr_unit {