diff options
Diffstat (limited to 'include/linux/dmar.h')
-rw-r--r-- | include/linux/dmar.h | 50 |
1 files changed, 44 insertions, 6 deletions
diff --git a/include/linux/dmar.h b/include/linux/dmar.h index 593fff99e6bf..30624954dec5 100644 --- a/include/linux/dmar.h +++ b/include/linux/dmar.h | |||
@@ -30,6 +30,12 @@ | |||
30 | 30 | ||
31 | struct acpi_dmar_header; | 31 | struct acpi_dmar_header; |
32 | 32 | ||
33 | #ifdef CONFIG_X86 | ||
34 | # define DMAR_UNITS_SUPPORTED MAX_IO_APICS | ||
35 | #else | ||
36 | # define DMAR_UNITS_SUPPORTED 64 | ||
37 | #endif | ||
38 | |||
33 | /* DMAR Flags */ | 39 | /* DMAR Flags */ |
34 | #define DMAR_INTR_REMAP 0x1 | 40 | #define DMAR_INTR_REMAP 0x1 |
35 | #define DMAR_X2APIC_OPT_OUT 0x2 | 41 | #define DMAR_X2APIC_OPT_OUT 0x2 |
@@ -120,28 +126,60 @@ extern int dmar_remove_dev_scope(struct dmar_pci_notify_info *info, | |||
120 | /* Intel IOMMU detection */ | 126 | /* Intel IOMMU detection */ |
121 | extern int detect_intel_iommu(void); | 127 | extern int detect_intel_iommu(void); |
122 | extern int enable_drhd_fault_handling(void); | 128 | extern int enable_drhd_fault_handling(void); |
129 | extern int dmar_device_add(acpi_handle handle); | ||
130 | extern int dmar_device_remove(acpi_handle handle); | ||
131 | |||
132 | static inline int dmar_res_noop(struct acpi_dmar_header *hdr, void *arg) | ||
133 | { | ||
134 | return 0; | ||
135 | } | ||
123 | 136 | ||
124 | #ifdef CONFIG_INTEL_IOMMU | 137 | #ifdef CONFIG_INTEL_IOMMU |
125 | extern int iommu_detected, no_iommu; | 138 | extern int iommu_detected, no_iommu; |
126 | extern int intel_iommu_init(void); | 139 | extern int intel_iommu_init(void); |
127 | extern int dmar_parse_one_rmrr(struct acpi_dmar_header *header); | 140 | extern int dmar_parse_one_rmrr(struct acpi_dmar_header *header, void *arg); |
128 | extern int dmar_parse_one_atsr(struct acpi_dmar_header *header); | 141 | extern int dmar_parse_one_atsr(struct acpi_dmar_header *header, void *arg); |
142 | extern int dmar_check_one_atsr(struct acpi_dmar_header *hdr, void *arg); | ||
143 | extern int dmar_release_one_atsr(struct acpi_dmar_header *hdr, void *arg); | ||
144 | extern int dmar_iommu_hotplug(struct dmar_drhd_unit *dmaru, bool insert); | ||
129 | extern int dmar_iommu_notify_scope_dev(struct dmar_pci_notify_info *info); | 145 | extern int dmar_iommu_notify_scope_dev(struct dmar_pci_notify_info *info); |
130 | #else /* !CONFIG_INTEL_IOMMU: */ | 146 | #else /* !CONFIG_INTEL_IOMMU: */ |
131 | static inline int intel_iommu_init(void) { return -ENODEV; } | 147 | static inline int intel_iommu_init(void) { return -ENODEV; } |
132 | static inline int dmar_parse_one_rmrr(struct acpi_dmar_header *header) | 148 | |
149 | #define dmar_parse_one_rmrr dmar_res_noop | ||
150 | #define dmar_parse_one_atsr dmar_res_noop | ||
151 | #define dmar_check_one_atsr dmar_res_noop | ||
152 | #define dmar_release_one_atsr dmar_res_noop | ||
153 | |||
154 | static inline int dmar_iommu_notify_scope_dev(struct dmar_pci_notify_info *info) | ||
133 | { | 155 | { |
134 | return 0; | 156 | return 0; |
135 | } | 157 | } |
136 | static inline int dmar_parse_one_atsr(struct acpi_dmar_header *header) | 158 | |
159 | static inline int dmar_iommu_hotplug(struct dmar_drhd_unit *dmaru, bool insert) | ||
137 | { | 160 | { |
138 | return 0; | 161 | return 0; |
139 | } | 162 | } |
140 | static inline int dmar_iommu_notify_scope_dev(struct dmar_pci_notify_info *info) | 163 | #endif /* CONFIG_INTEL_IOMMU */ |
164 | |||
165 | #ifdef CONFIG_IRQ_REMAP | ||
166 | extern int dmar_ir_hotplug(struct dmar_drhd_unit *dmaru, bool insert); | ||
167 | #else /* CONFIG_IRQ_REMAP */ | ||
168 | static inline int dmar_ir_hotplug(struct dmar_drhd_unit *dmaru, bool insert) | ||
169 | { return 0; } | ||
170 | #endif /* CONFIG_IRQ_REMAP */ | ||
171 | |||
172 | #else /* CONFIG_DMAR_TABLE */ | ||
173 | |||
174 | static inline int dmar_device_add(void *handle) | ||
175 | { | ||
176 | return 0; | ||
177 | } | ||
178 | |||
179 | static inline int dmar_device_remove(void *handle) | ||
141 | { | 180 | { |
142 | return 0; | 181 | return 0; |
143 | } | 182 | } |
144 | #endif /* CONFIG_INTEL_IOMMU */ | ||
145 | 183 | ||
146 | #endif /* CONFIG_DMAR_TABLE */ | 184 | #endif /* CONFIG_DMAR_TABLE */ |
147 | 185 | ||