1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _ASM_X86_HW_IRQ_H
3 #define _ASM_X86_HW_IRQ_H
6 * (C) 1992, 1993 Linus Torvalds, (C) 1997 Ingo Molnar
8 * moved some of the old arch/i386/kernel/irq.h to here. VY
10 * IRQ/IPI changes taken from work by Thomas Radke
11 * <tomsoft@informatik.tu-chemnitz.de>
13 * hacked by Andi Kleen for x86-64.
17 #include <asm/irq_vectors.h>
21 #include <linux/percpu.h>
22 #include <linux/profile.h>
23 #include <linux/smp.h>
25 #include <linux/atomic.h>
27 #include <asm/sections.h>
29 /* Interrupt handlers registered during init_IRQ */
30 extern asmlinkage void apic_timer_interrupt(void);
31 extern asmlinkage void x86_platform_ipi(void);
32 extern asmlinkage void kvm_posted_intr_ipi(void);
33 extern asmlinkage void kvm_posted_intr_wakeup_ipi(void);
34 extern asmlinkage void kvm_posted_intr_nested_ipi(void);
35 extern asmlinkage void error_interrupt(void);
36 extern asmlinkage void irq_work_interrupt(void);
37 extern asmlinkage void uv_bau_message_intr1(void);
39 extern asmlinkage void spurious_interrupt(void);
40 extern asmlinkage void thermal_interrupt(void);
41 extern asmlinkage void reschedule_interrupt(void);
43 extern asmlinkage void irq_move_cleanup_interrupt(void);
44 extern asmlinkage void reboot_interrupt(void);
45 extern asmlinkage void threshold_interrupt(void);
46 extern asmlinkage void deferred_error_interrupt(void);
48 extern asmlinkage void call_function_interrupt(void);
49 extern asmlinkage void call_function_single_interrupt(void);
51 #ifdef CONFIG_X86_LOCAL_APIC
57 X86_IRQ_ALLOC_TYPE_IOAPIC = 1,
58 X86_IRQ_ALLOC_TYPE_HPET,
59 X86_IRQ_ALLOC_TYPE_MSI,
60 X86_IRQ_ALLOC_TYPE_MSIX,
61 X86_IRQ_ALLOC_TYPE_DMAR,
62 X86_IRQ_ALLOC_TYPE_UV,
65 struct irq_alloc_info {
66 enum irq_alloc_type type;
68 const struct cpumask *mask; /* CPU mask for vector allocation */
71 #ifdef CONFIG_HPET_TIMER
80 struct pci_dev *msi_dev;
81 irq_hw_number_t msi_hwirq;
84 #ifdef CONFIG_X86_IO_APIC
89 u32 ioapic_trigger : 1;
90 u32 ioapic_polarity : 1;
92 struct IO_APIC_route_entry *ioapic_entry;
95 #ifdef CONFIG_DMAR_TABLE
105 struct pci_dev *ht_dev;
113 unsigned long uv_offset;
117 #if IS_ENABLED(CONFIG_VMD)
119 struct msi_desc *desc;
126 unsigned int dest_apicid;
131 extern struct irq_cfg *irq_cfg(unsigned int irq);
132 extern struct irq_cfg *irqd_cfg(struct irq_data *irq_data);
133 extern void lock_vector_lock(void);
134 extern void unlock_vector_lock(void);
135 extern void setup_vector_irq(int cpu);
137 extern void send_cleanup_vector(struct irq_cfg *);
138 extern void irq_complete_move(struct irq_cfg *cfg);
140 static inline void send_cleanup_vector(struct irq_cfg *c) { }
141 static inline void irq_complete_move(struct irq_cfg *c) { }
144 extern void apic_ack_edge(struct irq_data *data);
145 #else /* CONFIG_X86_LOCAL_APIC */
146 static inline void lock_vector_lock(void) {}
147 static inline void unlock_vector_lock(void) {}
148 #endif /* CONFIG_X86_LOCAL_APIC */
151 extern atomic_t irq_err_count;
152 extern atomic_t irq_mis_count;
154 extern void elcr_set_level_irq(unsigned int irq);
156 extern char irq_entries_start[];
157 #ifdef CONFIG_TRACING
158 #define trace_irq_entries_start irq_entries_start
161 #define VECTOR_UNUSED NULL
162 #define VECTOR_RETRIGGERED ((void *)~0UL)
164 typedef struct irq_desc* vector_irq_t[NR_VECTORS];
165 DECLARE_PER_CPU(vector_irq_t, vector_irq);
167 #endif /* !ASSEMBLY_ */
169 #endif /* _ASM_X86_HW_IRQ_H */