diff options
Diffstat (limited to 'include/linux/dmar.h')
| -rw-r--r-- | include/linux/dmar.h | 45 |
1 files changed, 38 insertions, 7 deletions
diff --git a/include/linux/dmar.h b/include/linux/dmar.h index 8a035aec14a9..2f3427468956 100644 --- a/include/linux/dmar.h +++ b/include/linux/dmar.h | |||
| @@ -26,9 +26,8 @@ | |||
| 26 | #include <linux/msi.h> | 26 | #include <linux/msi.h> |
| 27 | #include <linux/irqreturn.h> | 27 | #include <linux/irqreturn.h> |
| 28 | 28 | ||
| 29 | #if defined(CONFIG_DMAR) || defined(CONFIG_INTR_REMAP) | ||
| 30 | struct intel_iommu; | 29 | struct intel_iommu; |
| 31 | 30 | #if defined(CONFIG_DMAR) || defined(CONFIG_INTR_REMAP) | |
| 32 | struct dmar_drhd_unit { | 31 | struct dmar_drhd_unit { |
| 33 | struct list_head list; /* list of drhd units */ | 32 | struct list_head list; /* list of drhd units */ |
| 34 | struct acpi_dmar_header *hdr; /* ACPI header */ | 33 | struct acpi_dmar_header *hdr; /* ACPI header */ |
| @@ -52,7 +51,6 @@ extern int dmar_dev_scope_init(void); | |||
| 52 | extern void detect_intel_iommu(void); | 51 | extern void detect_intel_iommu(void); |
| 53 | extern int enable_drhd_fault_handling(void); | 52 | extern int enable_drhd_fault_handling(void); |
| 54 | 53 | ||
| 55 | |||
| 56 | extern int parse_ioapics_under_ir(void); | 54 | extern int parse_ioapics_under_ir(void); |
| 57 | extern int alloc_iommu(struct dmar_drhd_unit *); | 55 | extern int alloc_iommu(struct dmar_drhd_unit *); |
| 58 | #else | 56 | #else |
| @@ -65,12 +63,12 @@ static inline int dmar_table_init(void) | |||
| 65 | { | 63 | { |
| 66 | return -ENODEV; | 64 | return -ENODEV; |
| 67 | } | 65 | } |
| 66 | static inline int enable_drhd_fault_handling(void) | ||
| 67 | { | ||
| 68 | return -1; | ||
| 69 | } | ||
| 68 | #endif /* !CONFIG_DMAR && !CONFIG_INTR_REMAP */ | 70 | #endif /* !CONFIG_DMAR && !CONFIG_INTR_REMAP */ |
| 69 | 71 | ||
| 70 | #ifdef CONFIG_INTR_REMAP | ||
| 71 | extern int intr_remapping_enabled; | ||
| 72 | extern int enable_intr_remapping(int); | ||
| 73 | |||
| 74 | struct irte { | 72 | struct irte { |
| 75 | union { | 73 | union { |
| 76 | struct { | 74 | struct { |
| @@ -99,6 +97,10 @@ struct irte { | |||
| 99 | __u64 high; | 97 | __u64 high; |
| 100 | }; | 98 | }; |
| 101 | }; | 99 | }; |
| 100 | #ifdef CONFIG_INTR_REMAP | ||
| 101 | extern int intr_remapping_enabled; | ||
| 102 | extern int enable_intr_remapping(int); | ||
| 103 | |||
| 102 | extern int get_irte(int irq, struct irte *entry); | 104 | extern int get_irte(int irq, struct irte *entry); |
| 103 | extern int modify_irte(int irq, struct irte *irte_modified); | 105 | extern int modify_irte(int irq, struct irte *irte_modified); |
| 104 | extern int alloc_irte(struct intel_iommu *iommu, int irq, u16 count); | 106 | extern int alloc_irte(struct intel_iommu *iommu, int irq, u16 count); |
| @@ -113,6 +115,35 @@ extern int irq_remapped(int irq); | |||
| 113 | extern struct intel_iommu *map_dev_to_ir(struct pci_dev *dev); | 115 | extern struct intel_iommu *map_dev_to_ir(struct pci_dev *dev); |
| 114 | extern struct intel_iommu *map_ioapic_to_ir(int apic); | 116 | extern struct intel_iommu *map_ioapic_to_ir(int apic); |
| 115 | #else | 117 | #else |
| 118 | static inline int alloc_irte(struct intel_iommu *iommu, int irq, u16 count) | ||
| 119 | { | ||
| 120 | return -1; | ||
| 121 | } | ||
| 122 | static inline int modify_irte(int irq, struct irte *irte_modified) | ||
| 123 | { | ||
| 124 | return -1; | ||
| 125 | } | ||
| 126 | static inline int free_irte(int irq) | ||
| 127 | { | ||
| 128 | return -1; | ||
| 129 | } | ||
| 130 | static inline int map_irq_to_irte_handle(int irq, u16 *sub_handle) | ||
| 131 | { | ||
| 132 | return -1; | ||
| 133 | } | ||
| 134 | static inline int set_irte_irq(int irq, struct intel_iommu *iommu, u16 index, | ||
| 135 | u16 sub_handle) | ||
| 136 | { | ||
| 137 | return -1; | ||
| 138 | } | ||
| 139 | static inline struct intel_iommu *map_dev_to_ir(struct pci_dev *dev) | ||
| 140 | { | ||
| 141 | return NULL; | ||
| 142 | } | ||
| 143 | static inline struct intel_iommu *map_ioapic_to_ir(int apic) | ||
| 144 | { | ||
| 145 | return NULL; | ||
| 146 | } | ||
| 116 | #define irq_remapped(irq) (0) | 147 | #define irq_remapped(irq) (0) |
| 117 | #define enable_intr_remapping(mode) (-1) | 148 | #define enable_intr_remapping(mode) (-1) |
| 118 | #define intr_remapping_enabled (0) | 149 | #define intr_remapping_enabled (0) |
