]>
Commit | Line | Data |
---|---|---|
1965aae3 PA |
1 | #ifndef _ASM_X86_HW_IRQ_H |
2 | #define _ASM_X86_HW_IRQ_H | |
2e088436 TG |
3 | |
4 | /* | |
5 | * (C) 1992, 1993 Linus Torvalds, (C) 1997 Ingo Molnar | |
6 | * | |
7 | * moved some of the old arch/i386/kernel/irq.h to here. VY | |
8 | * | |
9 | * IRQ/IPI changes taken from work by Thomas Radke | |
10 | * <tomsoft@informatik.tu-chemnitz.de> | |
11 | * | |
12 | * hacked by Andi Kleen for x86-64. | |
13 | * unified by tglx | |
14 | */ | |
15 | ||
9b7dc567 | 16 | #include <asm/irq_vectors.h> |
2e088436 TG |
17 | |
18 | #ifndef __ASSEMBLY__ | |
19 | ||
20 | #include <linux/percpu.h> | |
21 | #include <linux/profile.h> | |
22 | #include <linux/smp.h> | |
23 | ||
60063497 | 24 | #include <linux/atomic.h> |
2e088436 TG |
25 | #include <asm/irq.h> |
26 | #include <asm/sections.h> | |
27 | ||
2e088436 | 28 | /* Interrupt handlers registered during init_IRQ */ |
1d9090e2 AK |
29 | extern asmlinkage void apic_timer_interrupt(void); |
30 | extern asmlinkage void x86_platform_ipi(void); | |
31 | extern asmlinkage void kvm_posted_intr_ipi(void); | |
32 | extern asmlinkage void error_interrupt(void); | |
33 | extern asmlinkage void irq_work_interrupt(void); | |
34 | ||
35 | extern asmlinkage void spurious_interrupt(void); | |
36 | extern asmlinkage void thermal_interrupt(void); | |
37 | extern asmlinkage void reschedule_interrupt(void); | |
38 | ||
1d9090e2 AK |
39 | extern asmlinkage void irq_move_cleanup_interrupt(void); |
40 | extern asmlinkage void reboot_interrupt(void); | |
41 | extern asmlinkage void threshold_interrupt(void); | |
42 | ||
43 | extern asmlinkage void call_function_interrupt(void); | |
44 | extern asmlinkage void call_function_single_interrupt(void); | |
2e088436 | 45 | |
cf910e83 SA |
46 | #ifdef CONFIG_TRACING |
47 | /* Interrupt handlers registered during init_IRQ */ | |
48 | extern void trace_apic_timer_interrupt(void); | |
49 | extern void trace_x86_platform_ipi(void); | |
50 | extern void trace_error_interrupt(void); | |
51 | extern void trace_irq_work_interrupt(void); | |
52 | extern void trace_spurious_interrupt(void); | |
53 | extern void trace_thermal_interrupt(void); | |
54 | extern void trace_reschedule_interrupt(void); | |
55 | extern void trace_threshold_interrupt(void); | |
56 | extern void trace_call_function_interrupt(void); | |
57 | extern void trace_call_function_single_interrupt(void); | |
58 | #define trace_irq_move_cleanup_interrupt irq_move_cleanup_interrupt | |
59 | #define trace_reboot_interrupt reboot_interrupt | |
60 | #define trace_kvm_posted_intr_ipi kvm_posted_intr_ipi | |
61 | #endif /* CONFIG_TRACING */ | |
62 | ||
26011eee | 63 | #ifdef CONFIG_X86_LOCAL_APIC |
74afab7a | 64 | struct irq_data; |
947045a2 JL |
65 | struct pci_dev; |
66 | struct msi_desc; | |
67 | ||
68 | enum irq_alloc_type { | |
69 | X86_IRQ_ALLOC_TYPE_IOAPIC = 1, | |
70 | X86_IRQ_ALLOC_TYPE_HPET, | |
71 | X86_IRQ_ALLOC_TYPE_MSI, | |
72 | X86_IRQ_ALLOC_TYPE_MSIX, | |
0921f1da | 73 | X86_IRQ_ALLOC_TYPE_DMAR, |
43fe1abc | 74 | X86_IRQ_ALLOC_TYPE_UV, |
947045a2 | 75 | }; |
b5dc8e6c JL |
76 | |
77 | struct irq_alloc_info { | |
947045a2 | 78 | enum irq_alloc_type type; |
b5dc8e6c JL |
79 | u32 flags; |
80 | const struct cpumask *mask; /* CPU mask for vector allocation */ | |
947045a2 JL |
81 | union { |
82 | int unused; | |
83 | #ifdef CONFIG_HPET_TIMER | |
84 | struct { | |
85 | int hpet_id; | |
86 | int hpet_index; | |
87 | void *hpet_data; | |
88 | }; | |
89 | #endif | |
90 | #ifdef CONFIG_PCI_MSI | |
91 | struct { | |
92 | struct pci_dev *msi_dev; | |
93 | irq_hw_number_t msi_hwirq; | |
94 | }; | |
95 | #endif | |
96 | #ifdef CONFIG_X86_IO_APIC | |
97 | struct { | |
98 | int ioapic_id; | |
99 | int ioapic_pin; | |
100 | int ioapic_node; | |
101 | u32 ioapic_trigger : 1; | |
102 | u32 ioapic_polarity : 1; | |
103 | u32 ioapic_valid : 1; | |
104 | struct IO_APIC_route_entry *ioapic_entry; | |
105 | }; | |
0921f1da JL |
106 | #endif |
107 | #ifdef CONFIG_DMAR_TABLE | |
108 | struct { | |
109 | int dmar_id; | |
110 | void *dmar_data; | |
111 | }; | |
49e07d8f JL |
112 | #endif |
113 | #ifdef CONFIG_HT_IRQ | |
114 | struct { | |
115 | int ht_pos; | |
116 | int ht_idx; | |
117 | struct pci_dev *ht_dev; | |
118 | void *ht_update; | |
119 | }; | |
43fe1abc JL |
120 | #endif |
121 | #ifdef CONFIG_X86_UV | |
122 | struct { | |
123 | int uv_limit; | |
124 | int uv_blade; | |
125 | unsigned long uv_offset; | |
126 | char *uv_name; | |
127 | }; | |
947045a2 JL |
128 | #endif |
129 | }; | |
b5dc8e6c JL |
130 | }; |
131 | ||
9338ad6f | 132 | struct irq_cfg { |
5f0052f9 | 133 | unsigned int dest_apicid; |
9338ad6f | 134 | u8 vector; |
9338ad6f DS |
135 | }; |
136 | ||
55a0e2b1 JL |
137 | extern struct irq_cfg *irq_cfg(unsigned int irq); |
138 | extern struct irq_cfg *irqd_cfg(struct irq_data *irq_data); | |
74afab7a JL |
139 | extern void lock_vector_lock(void); |
140 | extern void unlock_vector_lock(void); | |
74afab7a | 141 | extern void setup_vector_irq(int cpu); |
e32c67e0 | 142 | #ifdef CONFIG_SMP |
9338ad6f | 143 | extern void send_cleanup_vector(struct irq_cfg *); |
f0e5bf75 | 144 | extern void irq_complete_move(struct irq_cfg *cfg); |
e32c67e0 JL |
145 | #else |
146 | static inline void send_cleanup_vector(struct irq_cfg *c) { } | |
f0e5bf75 | 147 | static inline void irq_complete_move(struct irq_cfg *c) { } |
e32c67e0 | 148 | #endif |
7ec13187 | 149 | |
74afab7a | 150 | extern void apic_ack_edge(struct irq_data *data); |
74afab7a | 151 | #else /* CONFIG_X86_LOCAL_APIC */ |
26011eee JL |
152 | static inline void lock_vector_lock(void) {} |
153 | static inline void unlock_vector_lock(void) {} | |
74afab7a | 154 | #endif /* CONFIG_X86_LOCAL_APIC */ |
26011eee | 155 | |
2e088436 TG |
156 | /* Statistics */ |
157 | extern atomic_t irq_err_count; | |
158 | extern atomic_t irq_mis_count; | |
159 | ||
1a331957 TG |
160 | /* EISA */ |
161 | extern void eisa_set_level_irq(unsigned int irq); | |
162 | ||
2b97df06 | 163 | /* SMP */ |
1d9090e2 AK |
164 | extern __visible void smp_apic_timer_interrupt(struct pt_regs *); |
165 | extern __visible void smp_spurious_interrupt(struct pt_regs *); | |
166 | extern __visible void smp_x86_platform_ipi(struct pt_regs *); | |
167 | extern __visible void smp_error_interrupt(struct pt_regs *); | |
2c1b284e JSR |
168 | #ifdef CONFIG_X86_IO_APIC |
169 | extern asmlinkage void smp_irq_move_cleanup_interrupt(void); | |
170 | #endif | |
3e5095d1 | 171 | #ifdef CONFIG_SMP |
1d9090e2 AK |
172 | extern __visible void smp_reschedule_interrupt(struct pt_regs *); |
173 | extern __visible void smp_call_function_interrupt(struct pt_regs *); | |
174 | extern __visible void smp_call_function_single_interrupt(struct pt_regs *); | |
e7f08dfd | 175 | #endif |
2b97df06 | 176 | |
3304c9c3 | 177 | extern char irq_entries_start[]; |
25c74b10 | 178 | #ifdef CONFIG_TRACING |
3304c9c3 | 179 | #define trace_irq_entries_start irq_entries_start |
25c74b10 | 180 | #endif |
497c9a19 | 181 | |
79a51b25 PB |
182 | #define VECTOR_UNDEFINED (-1) |
183 | #define VECTOR_RETRIGGERED (-2) | |
9345005f | 184 | |
22dc12d1 TG |
185 | typedef int vector_irq_t[NR_VECTORS]; |
186 | DECLARE_PER_CPU(vector_irq_t, vector_irq); | |
2e088436 | 187 | |
22dc12d1 TG |
188 | #endif /* !ASSEMBLY_ */ |
189 | ||
1965aae3 | 190 | #endif /* _ASM_X86_HW_IRQ_H */ |