OSDN Git Service

x86: Rename eisa_set_level_irq to elcr_set_level_irq
[uclinux-h8/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  * <tomsoft@informatik.tu-chemnitz.de>
11  *
12  * hacked by Andi Kleen for x86-64.
13  * unified by tglx
14  */
15
16 #include <asm/irq_vectors.h>
17
18 #ifndef __ASSEMBLY__
19
20 #include <linux/percpu.h>
21 #include <linux/profile.h>
22 #include <linux/smp.h>
23
24 #include <linux/atomic.h>
25 #include <asm/irq.h>
26 #include <asm/sections.h>
27
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 error_interrupt(void);
33 extern asmlinkage void irq_work_interrupt(void);
34
35 extern asmlinkage void spurious_interrupt(void);
36 extern asmlinkage void thermal_interrupt(void);
37 extern asmlinkage void reschedule_interrupt(void);
38
39 extern asmlinkage void irq_move_cleanup_interrupt(void);
40 extern asmlinkage void reboot_interrupt(void);
41 extern asmlinkage void threshold_interrupt(void);
42
43 extern asmlinkage void call_function_interrupt(void);
44 extern asmlinkage void call_function_single_interrupt(void);
45
46 #ifdef CONFIG_TRACING
47 /* Interrupt handlers registered during init_IRQ */
48 extern void trace_apic_timer_interrupt(void);
49 extern void trace_x86_platform_ipi(void);
50 extern void trace_error_interrupt(void);
51 extern void trace_irq_work_interrupt(void);
52 extern void trace_spurious_interrupt(void);
53 extern void trace_thermal_interrupt(void);
54 extern void trace_reschedule_interrupt(void);
55 extern void trace_threshold_interrupt(void);
56 extern void trace_call_function_interrupt(void);
57 extern void trace_call_function_single_interrupt(void);
58 #define trace_irq_move_cleanup_interrupt  irq_move_cleanup_interrupt
59 #define trace_reboot_interrupt  reboot_interrupt
60 #define trace_kvm_posted_intr_ipi kvm_posted_intr_ipi
61 #endif /* CONFIG_TRACING */
62
63 #ifdef  CONFIG_X86_LOCAL_APIC
64 struct irq_data;
65 struct pci_dev;
66 struct msi_desc;
67
68 enum irq_alloc_type {
69         X86_IRQ_ALLOC_TYPE_IOAPIC = 1,
70         X86_IRQ_ALLOC_TYPE_HPET,
71         X86_IRQ_ALLOC_TYPE_MSI,
72         X86_IRQ_ALLOC_TYPE_MSIX,
73         X86_IRQ_ALLOC_TYPE_DMAR,
74         X86_IRQ_ALLOC_TYPE_UV,
75 };
76
77 struct irq_alloc_info {
78         enum irq_alloc_type     type;
79         u32                     flags;
80         const struct cpumask    *mask;  /* CPU mask for vector allocation */
81         union {
82                 int             unused;
83 #ifdef  CONFIG_HPET_TIMER
84                 struct {
85                         int             hpet_id;
86                         int             hpet_index;
87                         void            *hpet_data;
88                 };
89 #endif
90 #ifdef  CONFIG_PCI_MSI
91                 struct {
92                         struct pci_dev  *msi_dev;
93                         irq_hw_number_t msi_hwirq;
94                 };
95 #endif
96 #ifdef  CONFIG_X86_IO_APIC
97                 struct {
98                         int             ioapic_id;
99                         int             ioapic_pin;
100                         int             ioapic_node;
101                         u32             ioapic_trigger : 1;
102                         u32             ioapic_polarity : 1;
103                         u32             ioapic_valid : 1;
104                         struct IO_APIC_route_entry *ioapic_entry;
105                 };
106 #endif
107 #ifdef  CONFIG_DMAR_TABLE
108                 struct {
109                         int             dmar_id;
110                         void            *dmar_data;
111                 };
112 #endif
113 #ifdef  CONFIG_HT_IRQ
114                 struct {
115                         int             ht_pos;
116                         int             ht_idx;
117                         struct pci_dev  *ht_dev;
118                         void            *ht_update;
119                 };
120 #endif
121 #ifdef  CONFIG_X86_UV
122                 struct {
123                         int             uv_limit;
124                         int             uv_blade;
125                         unsigned long   uv_offset;
126                         char            *uv_name;
127                 };
128 #endif
129         };
130 };
131
132 struct irq_cfg {
133         unsigned int            dest_apicid;
134         u8                      vector;
135 };
136
137 extern struct irq_cfg *irq_cfg(unsigned int irq);
138 extern struct irq_cfg *irqd_cfg(struct irq_data *irq_data);
139 extern void lock_vector_lock(void);
140 extern void unlock_vector_lock(void);
141 extern void setup_vector_irq(int cpu);
142 #ifdef CONFIG_SMP
143 extern void send_cleanup_vector(struct irq_cfg *);
144 extern void irq_complete_move(struct irq_cfg *cfg);
145 #else
146 static inline void send_cleanup_vector(struct irq_cfg *c) { }
147 static inline void irq_complete_move(struct irq_cfg *c) { }
148 #endif
149
150 extern void apic_ack_edge(struct irq_data *data);
151 #else   /*  CONFIG_X86_LOCAL_APIC */
152 static inline void lock_vector_lock(void) {}
153 static inline void unlock_vector_lock(void) {}
154 #endif  /* CONFIG_X86_LOCAL_APIC */
155
156 /* Statistics */
157 extern atomic_t irq_err_count;
158 extern atomic_t irq_mis_count;
159
160 extern void elcr_set_level_irq(unsigned int irq);
161
162 /* SMP */
163 extern __visible void smp_apic_timer_interrupt(struct pt_regs *);
164 extern __visible void smp_spurious_interrupt(struct pt_regs *);
165 extern __visible void smp_x86_platform_ipi(struct pt_regs *);
166 extern __visible void smp_error_interrupt(struct pt_regs *);
167 #ifdef CONFIG_X86_IO_APIC
168 extern asmlinkage void smp_irq_move_cleanup_interrupt(void);
169 #endif
170 #ifdef CONFIG_SMP
171 extern __visible void smp_reschedule_interrupt(struct pt_regs *);
172 extern __visible void smp_call_function_interrupt(struct pt_regs *);
173 extern __visible void smp_call_function_single_interrupt(struct pt_regs *);
174 #endif
175
176 extern char irq_entries_start[];
177 #ifdef CONFIG_TRACING
178 #define trace_irq_entries_start irq_entries_start
179 #endif
180
181 #define VECTOR_UNDEFINED        (-1)
182 #define VECTOR_RETRIGGERED      (-2)
183
184 typedef int vector_irq_t[NR_VECTORS];
185 DECLARE_PER_CPU(vector_irq_t, vector_irq);
186
187 #endif /* !ASSEMBLY_ */
188
189 #endif /* _ASM_X86_HW_IRQ_H */