]> Git Repo - linux.git/blob - arch/x86/include/asm/hw_irq.h
x86/vector/msi: Select CONFIG_GENERIC_IRQ_RESERVATION_MODE
[linux.git] / arch / x86 / include / asm / hw_irq.h
1 #ifndef _ASM_X86_HW_IRQ_H
2 #define _ASM_X86_HW_IRQ_H
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  * <[email protected]>
11  *
12  * hacked by Andi Kleen for x86-64.
13  * unified by tglx
14  */
15
16 #include <asm/irq_vectors.h>
17
18 #define IRQ_MATRIX_BITS         NR_VECTORS
19
20 #ifndef __ASSEMBLY__
21
22 #include <linux/percpu.h>
23 #include <linux/profile.h>
24 #include <linux/smp.h>
25
26 #include <linux/atomic.h>
27 #include <asm/irq.h>
28 #include <asm/sections.h>
29
30 /* Interrupt handlers registered during init_IRQ */
31 extern asmlinkage void apic_timer_interrupt(void);
32 extern asmlinkage void x86_platform_ipi(void);
33 extern asmlinkage void kvm_posted_intr_ipi(void);
34 extern asmlinkage void kvm_posted_intr_wakeup_ipi(void);
35 extern asmlinkage void kvm_posted_intr_nested_ipi(void);
36 extern asmlinkage void error_interrupt(void);
37 extern asmlinkage void irq_work_interrupt(void);
38
39 extern asmlinkage void spurious_interrupt(void);
40 extern asmlinkage void thermal_interrupt(void);
41 extern asmlinkage void reschedule_interrupt(void);
42
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);
47
48 extern asmlinkage void call_function_interrupt(void);
49 extern asmlinkage void call_function_single_interrupt(void);
50
51 #ifdef  CONFIG_X86_LOCAL_APIC
52 struct irq_data;
53 struct pci_dev;
54 struct msi_desc;
55
56 enum irq_alloc_type {
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,
63 };
64
65 struct irq_alloc_info {
66         enum irq_alloc_type     type;
67         u32                     flags;
68         const struct cpumask    *mask;  /* CPU mask for vector allocation */
69         union {
70                 int             unused;
71 #ifdef  CONFIG_HPET_TIMER
72                 struct {
73                         int             hpet_id;
74                         int             hpet_index;
75                         void            *hpet_data;
76                 };
77 #endif
78 #ifdef  CONFIG_PCI_MSI
79                 struct {
80                         struct pci_dev  *msi_dev;
81                         irq_hw_number_t msi_hwirq;
82                 };
83 #endif
84 #ifdef  CONFIG_X86_IO_APIC
85                 struct {
86                         int             ioapic_id;
87                         int             ioapic_pin;
88                         int             ioapic_node;
89                         u32             ioapic_trigger : 1;
90                         u32             ioapic_polarity : 1;
91                         u32             ioapic_valid : 1;
92                         struct IO_APIC_route_entry *ioapic_entry;
93                 };
94 #endif
95 #ifdef  CONFIG_DMAR_TABLE
96                 struct {
97                         int             dmar_id;
98                         void            *dmar_data;
99                 };
100 #endif
101 #ifdef  CONFIG_HT_IRQ
102                 struct {
103                         int             ht_pos;
104                         int             ht_idx;
105                         struct pci_dev  *ht_dev;
106                         void            *ht_update;
107                 };
108 #endif
109 #ifdef  CONFIG_X86_UV
110                 struct {
111                         int             uv_limit;
112                         int             uv_blade;
113                         unsigned long   uv_offset;
114                         char            *uv_name;
115                 };
116 #endif
117 #if IS_ENABLED(CONFIG_VMD)
118                 struct {
119                         struct msi_desc *desc;
120                 };
121 #endif
122         };
123 };
124
125 struct irq_cfg {
126         unsigned int            dest_apicid;
127         unsigned int            vector;
128 };
129
130 extern struct irq_cfg *irq_cfg(unsigned int irq);
131 extern struct irq_cfg *irqd_cfg(struct irq_data *irq_data);
132 extern void lock_vector_lock(void);
133 extern void unlock_vector_lock(void);
134 #ifdef CONFIG_SMP
135 extern void send_cleanup_vector(struct irq_cfg *);
136 extern void irq_complete_move(struct irq_cfg *cfg);
137 #else
138 static inline void send_cleanup_vector(struct irq_cfg *c) { }
139 static inline void irq_complete_move(struct irq_cfg *c) { }
140 #endif
141
142 extern void apic_ack_edge(struct irq_data *data);
143 #else   /*  CONFIG_X86_LOCAL_APIC */
144 static inline void lock_vector_lock(void) {}
145 static inline void unlock_vector_lock(void) {}
146 #endif  /* CONFIG_X86_LOCAL_APIC */
147
148 /* Statistics */
149 extern atomic_t irq_err_count;
150 extern atomic_t irq_mis_count;
151
152 extern void elcr_set_level_irq(unsigned int irq);
153
154 extern char irq_entries_start[];
155 #ifdef CONFIG_TRACING
156 #define trace_irq_entries_start irq_entries_start
157 #endif
158
159 #define VECTOR_UNUSED           NULL
160 #define VECTOR_RETRIGGERED      ((void *)~0UL)
161
162 typedef struct irq_desc* vector_irq_t[NR_VECTORS];
163 DECLARE_PER_CPU(vector_irq_t, vector_irq);
164
165 #endif /* !ASSEMBLY_ */
166
167 #endif /* _ASM_X86_HW_IRQ_H */
This page took 0.045106 seconds and 4 git commands to generate.