1 #ifndef _ASM_X86_HW_IRQ_H
2 #define _ASM_X86_HW_IRQ_H
5 * (C) 1992, 1993 Linus Torvalds, (C) 1997 Ingo Molnar
7 * moved some of the old arch/i386/kernel/irq.h to here. VY
9 * IRQ/IPI changes taken from work by Thomas Radke
10 * <tomsoft@informatik.tu-chemnitz.de>
12 * hacked by Andi Kleen for x86-64.
16 #include <asm/irq_vectors.h>
20 #include <linux/percpu.h>
21 #include <linux/profile.h>
22 #include <linux/smp.h>
24 #include <linux/atomic.h>
26 #include <asm/sections.h>
28 /* Interrupt handlers registered during init_IRQ */
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 kvm_posted_intr_wakeup_ipi(void);
33 extern asmlinkage
void kvm_posted_intr_nested_ipi(void);
34 extern asmlinkage
void error_interrupt(void);
35 extern asmlinkage
void irq_work_interrupt(void);
37 extern asmlinkage
void spurious_interrupt(void);
38 extern asmlinkage
void thermal_interrupt(void);
39 extern asmlinkage
void reschedule_interrupt(void);
41 extern asmlinkage
void irq_move_cleanup_interrupt(void);
42 extern asmlinkage
void reboot_interrupt(void);
43 extern asmlinkage
void threshold_interrupt(void);
44 extern asmlinkage
void deferred_error_interrupt(void);
46 extern asmlinkage
void call_function_interrupt(void);
47 extern asmlinkage
void call_function_single_interrupt(void);
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);
59 extern void trace_deferred_error_interrupt(void);
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
65 #define trace_kvm_posted_intr_wakeup_ipi kvm_posted_intr_wakeup_ipi
66 #define trace_kvm_posted_intr_nested_ipi kvm_posted_intr_nested_ipi
67 #endif /* CONFIG_TRACING */
69 #ifdef CONFIG_X86_LOCAL_APIC
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
,
79 X86_IRQ_ALLOC_TYPE_DMAR
,
80 X86_IRQ_ALLOC_TYPE_UV
,
83 struct irq_alloc_info
{
84 enum irq_alloc_type type
;
86 const struct cpumask
*mask
; /* CPU mask for vector allocation */
89 #ifdef CONFIG_HPET_TIMER
98 struct pci_dev
*msi_dev
;
99 irq_hw_number_t msi_hwirq
;
102 #ifdef CONFIG_X86_IO_APIC
107 u32 ioapic_trigger
: 1;
108 u32 ioapic_polarity
: 1;
109 u32 ioapic_valid
: 1;
110 struct IO_APIC_route_entry
*ioapic_entry
;
113 #ifdef CONFIG_DMAR_TABLE
123 struct pci_dev
*ht_dev
;
131 unsigned long uv_offset
;
135 #if IS_ENABLED(CONFIG_VMD)
137 struct msi_desc
*desc
;
144 unsigned int dest_apicid
;
149 extern struct irq_cfg
*irq_cfg(unsigned int irq
);
150 extern struct irq_cfg
*irqd_cfg(struct irq_data
*irq_data
);
151 extern void lock_vector_lock(void);
152 extern void unlock_vector_lock(void);
153 extern void setup_vector_irq(int cpu
);
155 extern void send_cleanup_vector(struct irq_cfg
*);
156 extern void irq_complete_move(struct irq_cfg
*cfg
);
158 static inline void send_cleanup_vector(struct irq_cfg
*c
) { }
159 static inline void irq_complete_move(struct irq_cfg
*c
) { }
162 extern void apic_ack_edge(struct irq_data
*data
);
163 #else /* CONFIG_X86_LOCAL_APIC */
164 static inline void lock_vector_lock(void) {}
165 static inline void unlock_vector_lock(void) {}
166 #endif /* CONFIG_X86_LOCAL_APIC */
169 extern atomic_t irq_err_count
;
170 extern atomic_t irq_mis_count
;
172 extern void elcr_set_level_irq(unsigned int irq
);
174 extern char irq_entries_start
[];
175 #ifdef CONFIG_TRACING
176 #define trace_irq_entries_start irq_entries_start
179 #define VECTOR_UNUSED NULL
180 #define VECTOR_RETRIGGERED ((void *)~0UL)
182 typedef struct irq_desc
* vector_irq_t
[NR_VECTORS
];
183 DECLARE_PER_CPU(vector_irq_t
, vector_irq
);
185 #endif /* !ASSEMBLY_ */
187 #endif /* _ASM_X86_HW_IRQ_H */