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