diff options
author | Jiang Liu <jiang.liu@linux.intel.com> | 2014-07-11 02:19:32 -0400 |
---|---|---|
committer | Joerg Roedel <jroedel@suse.de> | 2014-07-23 10:04:47 -0400 |
commit | 8594d83261d14754288ef00993f0971131ff08eb (patch) | |
tree | 00d7c2c9933fb55e0d4e37e3b4c41a3128a529cc | |
parent | 129ad28100cccc0ff01f2227dd8d0849c0114ade (diff) |
iommu/vt-d: Simplify include/linux/dmar.h
Simplify include/linux/dmar.h a bit based on the fact that
both CONFIG_INTEL_IOMMU and CONFIG_IRQ_REMAP select CONFIG_DMAR_TABLE.
Signed-off-by: Jiang Liu <jiang.liu@linux.intel.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
-rw-r--r-- | include/linux/dmar.h | 50 |
1 files changed, 18 insertions, 32 deletions
diff --git a/include/linux/dmar.h b/include/linux/dmar.h index 23c8db129560..1deece46a0ca 100644 --- a/include/linux/dmar.h +++ b/include/linux/dmar.h | |||
@@ -114,22 +114,30 @@ extern int dmar_remove_dev_scope(struct dmar_pci_notify_info *info, | |||
114 | /* Intel IOMMU detection */ | 114 | /* Intel IOMMU detection */ |
115 | extern int detect_intel_iommu(void); | 115 | extern int detect_intel_iommu(void); |
116 | extern int enable_drhd_fault_handling(void); | 116 | extern int enable_drhd_fault_handling(void); |
117 | #else | 117 | |
118 | struct dmar_pci_notify_info; | 118 | #ifdef CONFIG_INTEL_IOMMU |
119 | static inline int detect_intel_iommu(void) | 119 | extern int iommu_detected, no_iommu; |
120 | extern int intel_iommu_init(void); | ||
121 | extern int dmar_parse_one_rmrr(struct acpi_dmar_header *header); | ||
122 | extern int dmar_parse_one_atsr(struct acpi_dmar_header *header); | ||
123 | extern int dmar_iommu_notify_scope_dev(struct dmar_pci_notify_info *info); | ||
124 | #else /* !CONFIG_INTEL_IOMMU: */ | ||
125 | static inline int intel_iommu_init(void) { return -ENODEV; } | ||
126 | static inline int dmar_parse_one_rmrr(struct acpi_dmar_header *header) | ||
120 | { | 127 | { |
121 | return -ENODEV; | 128 | return 0; |
122 | } | 129 | } |
123 | 130 | static inline int dmar_parse_one_atsr(struct acpi_dmar_header *header) | |
124 | static inline int dmar_table_init(void) | ||
125 | { | 131 | { |
126 | return -ENODEV; | 132 | return 0; |
127 | } | 133 | } |
128 | static inline int enable_drhd_fault_handling(void) | 134 | static inline int dmar_iommu_notify_scope_dev(struct dmar_pci_notify_info *info) |
129 | { | 135 | { |
130 | return -1; | 136 | return 0; |
131 | } | 137 | } |
132 | #endif /* !CONFIG_DMAR_TABLE */ | 138 | #endif /* CONFIG_INTEL_IOMMU */ |
139 | |||
140 | #endif /* CONFIG_DMAR_TABLE */ | ||
133 | 141 | ||
134 | struct irte { | 142 | struct irte { |
135 | union { | 143 | union { |
@@ -177,26 +185,4 @@ extern int dmar_set_interrupt(struct intel_iommu *iommu); | |||
177 | extern irqreturn_t dmar_fault(int irq, void *dev_id); | 185 | extern irqreturn_t dmar_fault(int irq, void *dev_id); |
178 | extern int arch_setup_dmar_msi(unsigned int irq); | 186 | extern int arch_setup_dmar_msi(unsigned int irq); |
179 | 187 | ||
180 | #ifdef CONFIG_INTEL_IOMMU | ||
181 | extern int iommu_detected, no_iommu; | ||
182 | extern int dmar_parse_one_rmrr(struct acpi_dmar_header *header); | ||
183 | extern int dmar_parse_one_atsr(struct acpi_dmar_header *header); | ||
184 | extern int dmar_iommu_notify_scope_dev(struct dmar_pci_notify_info *info); | ||
185 | extern int intel_iommu_init(void); | ||
186 | #else /* !CONFIG_INTEL_IOMMU: */ | ||
187 | static inline int intel_iommu_init(void) { return -ENODEV; } | ||
188 | static inline int dmar_parse_one_rmrr(struct acpi_dmar_header *header) | ||
189 | { | ||
190 | return 0; | ||
191 | } | ||
192 | static inline int dmar_parse_one_atsr(struct acpi_dmar_header *header) | ||
193 | { | ||
194 | return 0; | ||
195 | } | ||
196 | static inline int dmar_iommu_notify_scope_dev(struct dmar_pci_notify_info *info) | ||
197 | { | ||
198 | return 0; | ||
199 | } | ||
200 | #endif /* CONFIG_INTEL_IOMMU */ | ||
201 | |||
202 | #endif /* __DMAR_H__ */ | 188 | #endif /* __DMAR_H__ */ |