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.h43
1 files changed, 35 insertions, 8 deletions
diff --git a/include/linux/dmar.h b/include/linux/dmar.h
index 7b776d71d36..a8b1a847c10 100644
--- a/include/linux/dmar.h
+++ b/include/linux/dmar.h
@@ -26,8 +26,13 @@
26#include <linux/msi.h> 26#include <linux/msi.h>
27#include <linux/irqreturn.h> 27#include <linux/irqreturn.h>
28 28
29/* DMAR Flags */
30#define DMAR_INTR_REMAP 0x1
31#define DMAR_X2APIC_OPT_OUT 0x2
32
29struct intel_iommu; 33struct intel_iommu;
30#if defined(CONFIG_DMAR) || defined(CONFIG_INTR_REMAP) 34#ifdef CONFIG_DMAR_TABLE
35extern struct acpi_table_header *dmar_tbl;
31struct dmar_drhd_unit { 36struct dmar_drhd_unit {
32 struct list_head list; /* list of drhd units */ 37 struct list_head list; /* list of drhd units */
33 struct acpi_dmar_header *hdr; /* ACPI header */ 38 struct acpi_dmar_header *hdr; /* ACPI header */
@@ -76,7 +81,7 @@ static inline int enable_drhd_fault_handling(void)
76{ 81{
77 return -1; 82 return -1;
78} 83}
79#endif /* !CONFIG_DMAR && !CONFIG_INTR_REMAP */ 84#endif /* !CONFIG_DMAR_TABLE */
80 85
81struct irte { 86struct irte {
82 union { 87 union {
@@ -107,10 +112,10 @@ struct irte {
107 }; 112 };
108}; 113};
109 114
110#ifdef CONFIG_INTR_REMAP 115#ifdef CONFIG_IRQ_REMAP
111extern int intr_remapping_enabled; 116extern int intr_remapping_enabled;
112extern int intr_remapping_supported(void); 117extern int intr_remapping_supported(void);
113extern int enable_intr_remapping(int); 118extern int enable_intr_remapping(void);
114extern void disable_intr_remapping(void); 119extern void disable_intr_remapping(void);
115extern int reenable_intr_remapping(int); 120extern int reenable_intr_remapping(int);
116 121
@@ -177,7 +182,7 @@ static inline int set_msi_sid(struct irte *irte, struct pci_dev *dev)
177 182
178#define intr_remapping_enabled (0) 183#define intr_remapping_enabled (0)
179 184
180static inline int enable_intr_remapping(int eim) 185static inline int enable_intr_remapping(void)
181{ 186{
182 return -1; 187 return -1;
183} 188}
@@ -192,6 +197,11 @@ static inline int reenable_intr_remapping(int eim)
192} 197}
193#endif 198#endif
194 199
200enum {
201 IRQ_REMAP_XAPIC_MODE,
202 IRQ_REMAP_X2APIC_MODE,
203};
204
195/* Can't use the common MSI interrupt functions 205/* Can't use the common MSI interrupt functions
196 * since DMAR is not a pci device 206 * since DMAR is not a pci device
197 */ 207 */
@@ -204,7 +214,7 @@ extern int dmar_set_interrupt(struct intel_iommu *iommu);
204extern irqreturn_t dmar_fault(int irq, void *dev_id); 214extern irqreturn_t dmar_fault(int irq, void *dev_id);
205extern int arch_setup_dmar_msi(unsigned int irq); 215extern int arch_setup_dmar_msi(unsigned int irq);
206 216
207#ifdef CONFIG_DMAR 217#ifdef CONFIG_INTEL_IOMMU
208extern int iommu_detected, no_iommu; 218extern int iommu_detected, no_iommu;
209extern struct list_head dmar_rmrr_units; 219extern struct list_head dmar_rmrr_units;
210struct dmar_rmrr_unit { 220struct dmar_rmrr_unit {
@@ -227,9 +237,26 @@ struct dmar_atsr_unit {
227 u8 include_all:1; /* include all ports */ 237 u8 include_all:1; /* include all ports */
228}; 238};
229 239
240int dmar_parse_rmrr_atsr_dev(void);
241extern int dmar_parse_one_rmrr(struct acpi_dmar_header *header);
242extern int dmar_parse_one_atsr(struct acpi_dmar_header *header);
243extern int dmar_parse_dev_scope(void *start, void *end, int *cnt,
244 struct pci_dev ***devices, u16 segment);
230extern int intel_iommu_init(void); 245extern int intel_iommu_init(void);
231#else /* !CONFIG_DMAR: */ 246#else /* !CONFIG_INTEL_IOMMU: */
232static inline int intel_iommu_init(void) { return -ENODEV; } 247static inline int intel_iommu_init(void) { return -ENODEV; }
233#endif /* CONFIG_DMAR */ 248static inline int dmar_parse_one_rmrr(struct acpi_dmar_header *header)
249{
250 return 0;
251}
252static inline int dmar_parse_one_atsr(struct acpi_dmar_header *header)
253{
254 return 0;
255}
256static inline int dmar_parse_rmrr_atsr_dev(void)
257{
258 return 0;
259}
260#endif /* CONFIG_INTEL_IOMMU */
234 261
235#endif /* __DMAR_H__ */ 262#endif /* __DMAR_H__ */