diff options
Diffstat (limited to 'include/linux/dmar.h')
| -rw-r--r-- | include/linux/dmar.h | 43 |
1 files changed, 35 insertions, 8 deletions
diff --git a/include/linux/dmar.h b/include/linux/dmar.h index 7b776d71d36d..a8b1a847c103 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 | |||
| 29 | struct intel_iommu; | 33 | struct intel_iommu; |
| 30 | #if defined(CONFIG_DMAR) || defined(CONFIG_INTR_REMAP) | 34 | #ifdef CONFIG_DMAR_TABLE |
| 35 | extern struct acpi_table_header *dmar_tbl; | ||
| 31 | struct dmar_drhd_unit { | 36 | struct 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 | ||
| 81 | struct irte { | 86 | struct 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 |
| 111 | extern int intr_remapping_enabled; | 116 | extern int intr_remapping_enabled; |
| 112 | extern int intr_remapping_supported(void); | 117 | extern int intr_remapping_supported(void); |
| 113 | extern int enable_intr_remapping(int); | 118 | extern int enable_intr_remapping(void); |
| 114 | extern void disable_intr_remapping(void); | 119 | extern void disable_intr_remapping(void); |
| 115 | extern int reenable_intr_remapping(int); | 120 | extern 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 | ||
| 180 | static inline int enable_intr_remapping(int eim) | 185 | static 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 | ||
| 200 | enum { | ||
| 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); | |||
| 204 | extern irqreturn_t dmar_fault(int irq, void *dev_id); | 214 | extern irqreturn_t dmar_fault(int irq, void *dev_id); |
| 205 | extern int arch_setup_dmar_msi(unsigned int irq); | 215 | extern int arch_setup_dmar_msi(unsigned int irq); |
| 206 | 216 | ||
| 207 | #ifdef CONFIG_DMAR | 217 | #ifdef CONFIG_INTEL_IOMMU |
| 208 | extern int iommu_detected, no_iommu; | 218 | extern int iommu_detected, no_iommu; |
| 209 | extern struct list_head dmar_rmrr_units; | 219 | extern struct list_head dmar_rmrr_units; |
| 210 | struct dmar_rmrr_unit { | 220 | struct 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 | ||
| 240 | int dmar_parse_rmrr_atsr_dev(void); | ||
| 241 | extern int dmar_parse_one_rmrr(struct acpi_dmar_header *header); | ||
| 242 | extern int dmar_parse_one_atsr(struct acpi_dmar_header *header); | ||
| 243 | extern int dmar_parse_dev_scope(void *start, void *end, int *cnt, | ||
| 244 | struct pci_dev ***devices, u16 segment); | ||
| 230 | extern int intel_iommu_init(void); | 245 | extern int intel_iommu_init(void); |
| 231 | #else /* !CONFIG_DMAR: */ | 246 | #else /* !CONFIG_INTEL_IOMMU: */ |
| 232 | static inline int intel_iommu_init(void) { return -ENODEV; } | 247 | static inline int intel_iommu_init(void) { return -ENODEV; } |
| 233 | #endif /* CONFIG_DMAR */ | 248 | static inline int dmar_parse_one_rmrr(struct acpi_dmar_header *header) |
| 249 | { | ||
| 250 | return 0; | ||
| 251 | } | ||
| 252 | static inline int dmar_parse_one_atsr(struct acpi_dmar_header *header) | ||
| 253 | { | ||
| 254 | return 0; | ||
| 255 | } | ||
| 256 | static 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__ */ |
