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
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 #ifdef CONFIG_IRQ_DOMAIN_HIERARCHY
35 X86_IRQ_ALLOC_TYPE_IOAPIC = 1,
36 X86_IRQ_ALLOC_TYPE_HPET,
37 X86_IRQ_ALLOC_TYPE_PCI_MSI,
38 X86_IRQ_ALLOC_TYPE_PCI_MSIX,
39 X86_IRQ_ALLOC_TYPE_DMAR,
40 X86_IRQ_ALLOC_TYPE_AMDVI,
41 X86_IRQ_ALLOC_TYPE_UV,
44 struct ioapic_alloc_info {
52 struct uv_alloc_info {
61 * irq_alloc_info - X86 specific interrupt allocation info
62 * @type: X86 specific allocation type
63 * @flags: Flags for allocation tweaks
64 * @devid: Device ID for allocations
65 * @hwirq: Associated hw interrupt number in the domain
66 * @mask: CPU mask for vector allocation
67 * @desc: Pointer to msi descriptor
68 * @data: Allocation specific data
70 * @ioapic: IOAPIC specific allocation data
71 * @uv: UV specific allocation data
73 struct irq_alloc_info {
74 enum irq_alloc_type type;
77 irq_hw_number_t hwirq;
78 const struct cpumask *mask;
79 struct msi_desc *desc;
83 struct ioapic_alloc_info ioapic;
84 struct uv_alloc_info uv;
89 unsigned int dest_apicid;
93 extern struct irq_cfg *irq_cfg(unsigned int irq);
94 extern struct irq_cfg *irqd_cfg(struct irq_data *irq_data);
95 extern void lock_vector_lock(void);
96 extern void unlock_vector_lock(void);
98 extern void vector_schedule_cleanup(struct irq_cfg *);
99 extern void irq_complete_move(struct irq_cfg *cfg);
101 static inline void vector_schedule_cleanup(struct irq_cfg *c) { }
102 static inline void irq_complete_move(struct irq_cfg *c) { }
105 extern void apic_ack_edge(struct irq_data *data);
106 #else /* CONFIG_IRQ_DOMAIN_HIERARCHY */
107 static inline void lock_vector_lock(void) {}
108 static inline void unlock_vector_lock(void) {}
109 #endif /* CONFIG_IRQ_DOMAIN_HIERARCHY */
112 extern atomic_t irq_err_count;
113 extern atomic_t irq_mis_count;
115 extern void elcr_set_level_irq(unsigned int irq);
117 extern char irq_entries_start[];
118 #ifdef CONFIG_TRACING
119 #define trace_irq_entries_start irq_entries_start
122 extern char spurious_entries_start[];
124 #define VECTOR_UNUSED NULL
125 #define VECTOR_SHUTDOWN ((void *)-1L)
126 #define VECTOR_RETRIGGERED ((void *)-2L)
128 typedef struct irq_desc* vector_irq_t[NR_VECTORS];
129 DECLARE_PER_CPU(vector_irq_t, vector_irq);
131 #endif /* !ASSEMBLY_ */
133 #endif /* _ASM_X86_HW_IRQ_H */