aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/dmar.h
diff options
context:
space:
mode:
authorSuresh Siddha <suresh.b.siddha@intel.com>2009-03-16 20:05:02 -0400
committerH. Peter Anvin <hpa@linux.intel.com>2009-03-17 18:45:07 -0400
commit29b61be65a33c95564fa82e7e8d60d97adb68ea8 (patch)
tree2a9898b3ff1c04805d2bb876061c00052c9647bc /include/linux/dmar.h
parent0280f7c416c652a2fd95d166f52b199ae61122c0 (diff)
x86, x2apic: cleanup ifdef CONFIG_INTR_REMAP in io_apic code
Impact: cleanup Clean up #ifdefs and replace them with helper functions. Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com> Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Diffstat (limited to 'include/linux/dmar.h')
-rw-r--r--include/linux/dmar.h45
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)
30struct intel_iommu; 29struct intel_iommu;
31 30#if defined(CONFIG_DMAR) || defined(CONFIG_INTR_REMAP)
32struct dmar_drhd_unit { 31struct 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);
52extern void detect_intel_iommu(void); 51extern void detect_intel_iommu(void);
53extern int enable_drhd_fault_handling(void); 52extern int enable_drhd_fault_handling(void);
54 53
55
56extern int parse_ioapics_under_ir(void); 54extern int parse_ioapics_under_ir(void);
57extern int alloc_iommu(struct dmar_drhd_unit *); 55extern 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}
66static 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
71extern int intr_remapping_enabled;
72extern int enable_intr_remapping(int);
73
74struct irte { 72struct 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
101extern int intr_remapping_enabled;
102extern int enable_intr_remapping(int);
103
102extern int get_irte(int irq, struct irte *entry); 104extern int get_irte(int irq, struct irte *entry);
103extern int modify_irte(int irq, struct irte *irte_modified); 105extern int modify_irte(int irq, struct irte *irte_modified);
104extern int alloc_irte(struct intel_iommu *iommu, int irq, u16 count); 106extern int alloc_irte(struct intel_iommu *iommu, int irq, u16 count);
@@ -113,6 +115,35 @@ extern int irq_remapped(int irq);
113extern struct intel_iommu *map_dev_to_ir(struct pci_dev *dev); 115extern struct intel_iommu *map_dev_to_ir(struct pci_dev *dev);
114extern struct intel_iommu *map_ioapic_to_ir(int apic); 116extern struct intel_iommu *map_ioapic_to_ir(int apic);
115#else 117#else
118static inline int alloc_irte(struct intel_iommu *iommu, int irq, u16 count)
119{
120 return -1;
121}
122static inline int modify_irte(int irq, struct irte *irte_modified)
123{
124 return -1;
125}
126static inline int free_irte(int irq)
127{
128 return -1;
129}
130static inline int map_irq_to_irte_handle(int irq, u16 *sub_handle)
131{
132 return -1;
133}
134static inline int set_irte_irq(int irq, struct intel_iommu *iommu, u16 index,
135 u16 sub_handle)
136{
137 return -1;
138}
139static inline struct intel_iommu *map_dev_to_ir(struct pci_dev *dev)
140{
141 return NULL;
142}
143static 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)