]>
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); | |
f6b3c72c | 32 | extern asmlinkage void kvm_posted_intr_wakeup_ipi(void); |
210f84b0 | 33 | extern asmlinkage void kvm_posted_intr_nested_ipi(void); |
1d9090e2 AK |
34 | extern asmlinkage void error_interrupt(void); |
35 | extern asmlinkage void irq_work_interrupt(void); | |
36 | ||
37 | extern asmlinkage void spurious_interrupt(void); | |
38 | extern asmlinkage void thermal_interrupt(void); | |
39 | extern asmlinkage void reschedule_interrupt(void); | |
40 | ||
1d9090e2 AK |
41 | extern asmlinkage void irq_move_cleanup_interrupt(void); |
42 | extern asmlinkage void reboot_interrupt(void); | |
43 | extern asmlinkage void threshold_interrupt(void); | |
24fd78a8 | 44 | extern asmlinkage void deferred_error_interrupt(void); |
1d9090e2 AK |
45 | |
46 | extern asmlinkage void call_function_interrupt(void); | |
47 | extern asmlinkage void call_function_single_interrupt(void); | |
2e088436 | 48 | |
cf910e83 SA |
49 | #ifdef CONFIG_TRACING |
50 | /* Interrupt handlers registered during init_IRQ */ | |
51 | extern void trace_apic_timer_interrupt(void); | |
52 | extern void trace_x86_platform_ipi(void); | |
53 | extern void trace_error_interrupt(void); | |
54 | extern void trace_irq_work_interrupt(void); | |
55 | extern void trace_spurious_interrupt(void); | |
56 | extern void trace_thermal_interrupt(void); | |
57 | extern void trace_reschedule_interrupt(void); | |
58 | extern void trace_threshold_interrupt(void); | |
24fd78a8 | 59 | extern void trace_deferred_error_interrupt(void); |
cf910e83 SA |
60 | extern void trace_call_function_interrupt(void); |
61 | extern void trace_call_function_single_interrupt(void); | |
62 | #define trace_irq_move_cleanup_interrupt irq_move_cleanup_interrupt | |
63 | #define trace_reboot_interrupt reboot_interrupt | |
64 | #define trace_kvm_posted_intr_ipi kvm_posted_intr_ipi | |
f6b3c72c | 65 | #define trace_kvm_posted_intr_wakeup_ipi kvm_posted_intr_wakeup_ipi |
210f84b0 | 66 | #define trace_kvm_posted_intr_nested_ipi kvm_posted_intr_nested_ipi |
cf910e83 SA |
67 | #endif /* CONFIG_TRACING */ |
68 | ||
26011eee | 69 | #ifdef CONFIG_X86_LOCAL_APIC |
74afab7a | 70 | struct irq_data; |
947045a2 JL |
71 | struct pci_dev; |
72 | struct msi_desc; | |
73 | ||
74 | enum irq_alloc_type { | |
75 | X86_IRQ_ALLOC_TYPE_IOAPIC = 1, | |
76 | X86_IRQ_ALLOC_TYPE_HPET, | |
77 | X86_IRQ_ALLOC_TYPE_MSI, | |
78 | X86_IRQ_ALLOC_TYPE_MSIX, | |
0921f1da | 79 | X86_IRQ_ALLOC_TYPE_DMAR, |
43fe1abc | 80 | X86_IRQ_ALLOC_TYPE_UV, |
947045a2 | 81 | }; |
b5dc8e6c JL |
82 | |
83 | struct irq_alloc_info { | |
947045a2 | 84 | enum irq_alloc_type type; |
b5dc8e6c JL |
85 | u32 flags; |
86 | const struct cpumask *mask; /* CPU mask for vector allocation */ | |
947045a2 JL |
87 | union { |
88 | int unused; | |
89 | #ifdef CONFIG_HPET_TIMER | |
90 | struct { | |
91 | int hpet_id; | |
92 | int hpet_index; | |
93 | void *hpet_data; | |
94 | }; | |
95 | #endif | |
96 | #ifdef CONFIG_PCI_MSI | |
97 | struct { | |
98 | struct pci_dev *msi_dev; | |
99 | irq_hw_number_t msi_hwirq; | |
100 | }; | |
101 | #endif | |
102 | #ifdef CONFIG_X86_IO_APIC | |
103 | struct { | |
104 | int ioapic_id; | |
105 | int ioapic_pin; | |
106 | int ioapic_node; | |
107 | u32 ioapic_trigger : 1; | |
108 | u32 ioapic_polarity : 1; | |
109 | u32 ioapic_valid : 1; | |
110 | struct IO_APIC_route_entry *ioapic_entry; | |
111 | }; | |
0921f1da JL |
112 | #endif |
113 | #ifdef CONFIG_DMAR_TABLE | |
114 | struct { | |
115 | int dmar_id; | |
116 | void *dmar_data; | |
117 | }; | |
49e07d8f JL |
118 | #endif |
119 | #ifdef CONFIG_HT_IRQ | |
120 | struct { | |
121 | int ht_pos; | |
122 | int ht_idx; | |
123 | struct pci_dev *ht_dev; | |
124 | void *ht_update; | |
125 | }; | |
43fe1abc JL |
126 | #endif |
127 | #ifdef CONFIG_X86_UV | |
128 | struct { | |
129 | int uv_limit; | |
130 | int uv_blade; | |
131 | unsigned long uv_offset; | |
132 | char *uv_name; | |
133 | }; | |
185a383a KB |
134 | #endif |
135 | #if IS_ENABLED(CONFIG_VMD) | |
136 | struct { | |
137 | struct msi_desc *desc; | |
138 | }; | |
947045a2 JL |
139 | #endif |
140 | }; | |
b5dc8e6c JL |
141 | }; |
142 | ||
9338ad6f | 143 | struct irq_cfg { |
5f0052f9 | 144 | unsigned int dest_apicid; |
9338ad6f | 145 | u8 vector; |
551adc60 | 146 | u8 old_vector; |
9338ad6f DS |
147 | }; |
148 | ||
55a0e2b1 JL |
149 | extern struct irq_cfg *irq_cfg(unsigned int irq); |
150 | extern struct irq_cfg *irqd_cfg(struct irq_data *irq_data); | |
74afab7a JL |
151 | extern void lock_vector_lock(void); |
152 | extern void unlock_vector_lock(void); | |
74afab7a | 153 | extern void setup_vector_irq(int cpu); |
e32c67e0 | 154 | #ifdef CONFIG_SMP |
9338ad6f | 155 | extern void send_cleanup_vector(struct irq_cfg *); |
f0e5bf75 | 156 | extern void irq_complete_move(struct irq_cfg *cfg); |
e32c67e0 JL |
157 | #else |
158 | static inline void send_cleanup_vector(struct irq_cfg *c) { } | |
f0e5bf75 | 159 | static inline void irq_complete_move(struct irq_cfg *c) { } |
e32c67e0 | 160 | #endif |
7ec13187 | 161 | |
74afab7a | 162 | extern void apic_ack_edge(struct irq_data *data); |
74afab7a | 163 | #else /* CONFIG_X86_LOCAL_APIC */ |
26011eee JL |
164 | static inline void lock_vector_lock(void) {} |
165 | static inline void unlock_vector_lock(void) {} | |
74afab7a | 166 | #endif /* CONFIG_X86_LOCAL_APIC */ |
26011eee | 167 | |
2e088436 TG |
168 | /* Statistics */ |
169 | extern atomic_t irq_err_count; | |
170 | extern atomic_t irq_mis_count; | |
171 | ||
ea6cd250 | 172 | extern void elcr_set_level_irq(unsigned int irq); |
1a331957 | 173 | |
3304c9c3 | 174 | extern char irq_entries_start[]; |
25c74b10 | 175 | #ifdef CONFIG_TRACING |
3304c9c3 | 176 | #define trace_irq_entries_start irq_entries_start |
25c74b10 | 177 | #endif |
497c9a19 | 178 | |
a782a7e4 TG |
179 | #define VECTOR_UNUSED NULL |
180 | #define VECTOR_RETRIGGERED ((void *)~0UL) | |
9345005f | 181 | |
a782a7e4 | 182 | typedef struct irq_desc* vector_irq_t[NR_VECTORS]; |
22dc12d1 | 183 | DECLARE_PER_CPU(vector_irq_t, vector_irq); |
2e088436 | 184 | |
22dc12d1 TG |
185 | #endif /* !ASSEMBLY_ */ |
186 | ||
1965aae3 | 187 | #endif /* _ASM_X86_HW_IRQ_H */ |