aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/irq.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/irq.h')
-rw-r--r--include/linux/irq.h24
1 files changed, 12 insertions, 12 deletions
diff --git a/include/linux/irq.h b/include/linux/irq.h
index 27a67536511e..ca507c9426b0 100644
--- a/include/linux/irq.h
+++ b/include/linux/irq.h
@@ -17,9 +17,12 @@
17#include <linux/cache.h> 17#include <linux/cache.h>
18#include <linux/spinlock.h> 18#include <linux/spinlock.h>
19#include <linux/cpumask.h> 19#include <linux/cpumask.h>
20#include <linux/gfp.h>
20#include <linux/irqreturn.h> 21#include <linux/irqreturn.h>
21#include <linux/irqnr.h> 22#include <linux/irqnr.h>
22#include <linux/errno.h> 23#include <linux/errno.h>
24#include <linux/topology.h>
25#include <linux/wait.h>
23 26
24#include <asm/irq.h> 27#include <asm/irq.h>
25#include <asm/ptrace.h> 28#include <asm/ptrace.h>
@@ -65,6 +68,7 @@ typedef void (*irq_flow_handler_t)(unsigned int irq,
65#define IRQ_SPURIOUS_DISABLED 0x00800000 /* IRQ was disabled by the spurious trap */ 68#define IRQ_SPURIOUS_DISABLED 0x00800000 /* IRQ was disabled by the spurious trap */
66#define IRQ_MOVE_PCNTXT 0x01000000 /* IRQ migration from process context */ 69#define IRQ_MOVE_PCNTXT 0x01000000 /* IRQ migration from process context */
67#define IRQ_AFFINITY_SET 0x02000000 /* IRQ affinity was set from userspace*/ 70#define IRQ_AFFINITY_SET 0x02000000 /* IRQ affinity was set from userspace*/
71#define IRQ_SUSPENDED 0x04000000 /* IRQ has gone through suspend sequence */
68 72
69#ifdef CONFIG_IRQ_PER_CPU 73#ifdef CONFIG_IRQ_PER_CPU
70# define CHECK_IRQ_PER_CPU(var) ((var) & IRQ_PER_CPU) 74# define CHECK_IRQ_PER_CPU(var) ((var) & IRQ_PER_CPU)
@@ -155,17 +159,17 @@ struct irq_2_iommu;
155 * @affinity: IRQ affinity on SMP 159 * @affinity: IRQ affinity on SMP
156 * @cpu: cpu index useful for balancing 160 * @cpu: cpu index useful for balancing
157 * @pending_mask: pending rebalanced interrupts 161 * @pending_mask: pending rebalanced interrupts
162 * @threads_active: number of irqaction threads currently running
163 * @wait_for_threads: wait queue for sync_irq to wait for threaded handlers
158 * @dir: /proc/irq/ procfs entry 164 * @dir: /proc/irq/ procfs entry
159 * @name: flow handler name for /proc/interrupts output 165 * @name: flow handler name for /proc/interrupts output
160 */ 166 */
161struct irq_desc { 167struct irq_desc {
162 unsigned int irq; 168 unsigned int irq;
163#ifdef CONFIG_SPARSE_IRQ
164 struct timer_rand_state *timer_rand_state; 169 struct timer_rand_state *timer_rand_state;
165 unsigned int *kstat_irqs; 170 unsigned int *kstat_irqs;
166# ifdef CONFIG_INTR_REMAP 171#ifdef CONFIG_INTR_REMAP
167 struct irq_2_iommu *irq_2_iommu; 172 struct irq_2_iommu *irq_2_iommu;
168# endif
169#endif 173#endif
170 irq_flow_handler_t handle_irq; 174 irq_flow_handler_t handle_irq;
171 struct irq_chip *chip; 175 struct irq_chip *chip;
@@ -188,6 +192,8 @@ struct irq_desc {
188 cpumask_var_t pending_mask; 192 cpumask_var_t pending_mask;
189#endif 193#endif
190#endif 194#endif
195 atomic_t threads_active;
196 wait_queue_head_t wait_for_threads;
191#ifdef CONFIG_PROC_FS 197#ifdef CONFIG_PROC_FS
192 struct proc_dir_entry *dir; 198 struct proc_dir_entry *dir;
193#endif 199#endif
@@ -202,12 +208,6 @@ extern void arch_free_chip_data(struct irq_desc *old_desc, struct irq_desc *desc
202extern struct irq_desc irq_desc[NR_IRQS]; 208extern struct irq_desc irq_desc[NR_IRQS];
203#else /* CONFIG_SPARSE_IRQ */ 209#else /* CONFIG_SPARSE_IRQ */
204extern struct irq_desc *move_irq_desc(struct irq_desc *old_desc, int cpu); 210extern struct irq_desc *move_irq_desc(struct irq_desc *old_desc, int cpu);
205
206#define kstat_irqs_this_cpu(DESC) \
207 ((DESC)->kstat_irqs[smp_processor_id()])
208#define kstat_incr_irqs_this_cpu(irqno, DESC) \
209 ((DESC)->kstat_irqs[smp_processor_id()]++)
210
211#endif /* CONFIG_SPARSE_IRQ */ 211#endif /* CONFIG_SPARSE_IRQ */
212 212
213extern struct irq_desc *irq_to_desc_alloc_cpu(unsigned int irq, int cpu); 213extern struct irq_desc *irq_to_desc_alloc_cpu(unsigned int irq, int cpu);
@@ -226,7 +226,6 @@ irq_remap_to_desc(unsigned int irq, struct irq_desc *desc)
226 * Migration helpers for obsolete names, they will go away: 226 * Migration helpers for obsolete names, they will go away:
227 */ 227 */
228#define hw_interrupt_type irq_chip 228#define hw_interrupt_type irq_chip
229typedef struct irq_chip hw_irq_controller;
230#define no_irq_type no_irq_chip 229#define no_irq_type no_irq_chip
231typedef struct irq_desc irq_desc_t; 230typedef struct irq_desc irq_desc_t;
232 231
@@ -236,6 +235,7 @@ typedef struct irq_desc irq_desc_t;
236#include <asm/hw_irq.h> 235#include <asm/hw_irq.h>
237 236
238extern int setup_irq(unsigned int irq, struct irqaction *new); 237extern int setup_irq(unsigned int irq, struct irqaction *new);
238extern void remove_irq(unsigned int irq, struct irqaction *act);
239 239
240#ifdef CONFIG_GENERIC_HARDIRQS 240#ifdef CONFIG_GENERIC_HARDIRQS
241 241
@@ -280,7 +280,7 @@ static inline int irq_balancing_disabled(unsigned int irq)
280} 280}
281 281
282/* Handle irq action chains: */ 282/* Handle irq action chains: */
283extern int handle_IRQ_event(unsigned int irq, struct irqaction *action); 283extern irqreturn_t handle_IRQ_event(unsigned int irq, struct irqaction *action);
284 284
285/* 285/*
286 * Built-in IRQ handlers for various IRQ types, 286 * Built-in IRQ handlers for various IRQ types,
@@ -325,7 +325,7 @@ static inline void generic_handle_irq(unsigned int irq)
325 325
326/* Handling of unhandled and spurious interrupts: */ 326/* Handling of unhandled and spurious interrupts: */
327extern void note_interrupt(unsigned int irq, struct irq_desc *desc, 327extern void note_interrupt(unsigned int irq, struct irq_desc *desc,
328 int action_ret); 328 irqreturn_t action_ret);
329 329
330/* Resending of interrupts :*/ 330/* Resending of interrupts :*/
331void check_irq_resend(struct irq_desc *desc, unsigned int irq); 331void check_irq_resend(struct irq_desc *desc, unsigned int irq);