aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/interrupt.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/interrupt.h')
-rw-r--r--include/linux/interrupt.h32
1 files changed, 31 insertions, 1 deletions
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h
index 75f3f00ac1e5..c2331138ca1b 100644
--- a/include/linux/interrupt.h
+++ b/include/linux/interrupt.h
@@ -39,7 +39,8 @@
39 * These flags used only by the kernel as part of the 39 * These flags used only by the kernel as part of the
40 * irq handling routines. 40 * irq handling routines.
41 * 41 *
42 * IRQF_DISABLED - keep irqs disabled when calling the action handler 42 * IRQF_DISABLED - keep irqs disabled when calling the action handler.
43 * DEPRECATED. This flag is a NOOP and scheduled to be removed
43 * IRQF_SAMPLE_RANDOM - irq is used to feed the random generator 44 * IRQF_SAMPLE_RANDOM - irq is used to feed the random generator
44 * IRQF_SHARED - allow sharing the irq among several devices 45 * IRQF_SHARED - allow sharing the irq among several devices
45 * IRQF_PROBE_SHARED - set by callers when they expect sharing mismatches to occur 46 * IRQF_PROBE_SHARED - set by callers when they expect sharing mismatches to occur
@@ -77,6 +78,18 @@ enum {
77 IRQTF_AFFINITY, 78 IRQTF_AFFINITY,
78}; 79};
79 80
81/*
82 * These values can be returned by request_any_context_irq() and
83 * describe the context the interrupt will be run in.
84 *
85 * IRQC_IS_HARDIRQ - interrupt runs in hardirq context
86 * IRQC_IS_NESTED - interrupt runs in a nested threaded context
87 */
88enum {
89 IRQC_IS_HARDIRQ = 0,
90 IRQC_IS_NESTED,
91};
92
80typedef irqreturn_t (*irq_handler_t)(int, void *); 93typedef irqreturn_t (*irq_handler_t)(int, void *);
81 94
82/** 95/**
@@ -120,6 +133,10 @@ request_irq(unsigned int irq, irq_handler_t handler, unsigned long flags,
120 return request_threaded_irq(irq, handler, NULL, flags, name, dev); 133 return request_threaded_irq(irq, handler, NULL, flags, name, dev);
121} 134}
122 135
136extern int __must_check
137request_any_context_irq(unsigned int irq, irq_handler_t handler,
138 unsigned long flags, const char *name, void *dev_id);
139
123extern void exit_irq_thread(void); 140extern void exit_irq_thread(void);
124#else 141#else
125 142
@@ -141,6 +158,13 @@ request_threaded_irq(unsigned int irq, irq_handler_t handler,
141 return request_irq(irq, handler, flags, name, dev); 158 return request_irq(irq, handler, flags, name, dev);
142} 159}
143 160
161static inline int __must_check
162request_any_context_irq(unsigned int irq, irq_handler_t handler,
163 unsigned long flags, const char *name, void *dev_id)
164{
165 return request_irq(irq, handler, flags, name, dev_id);
166}
167
144static inline void exit_irq_thread(void) { } 168static inline void exit_irq_thread(void) { }
145#endif 169#endif
146 170
@@ -209,6 +233,7 @@ extern int irq_set_affinity(unsigned int irq, const struct cpumask *cpumask);
209extern int irq_can_set_affinity(unsigned int irq); 233extern int irq_can_set_affinity(unsigned int irq);
210extern int irq_select_affinity(unsigned int irq); 234extern int irq_select_affinity(unsigned int irq);
211 235
236extern int irq_set_affinity_hint(unsigned int irq, const struct cpumask *m);
212#else /* CONFIG_SMP */ 237#else /* CONFIG_SMP */
213 238
214static inline int irq_set_affinity(unsigned int irq, const struct cpumask *m) 239static inline int irq_set_affinity(unsigned int irq, const struct cpumask *m)
@@ -223,6 +248,11 @@ static inline int irq_can_set_affinity(unsigned int irq)
223 248
224static inline int irq_select_affinity(unsigned int irq) { return 0; } 249static inline int irq_select_affinity(unsigned int irq) { return 0; }
225 250
251static inline int irq_set_affinity_hint(unsigned int irq,
252 const struct cpumask *m)
253{
254 return -EINVAL;
255}
226#endif /* CONFIG_SMP && CONFIG_GENERIC_HARDIRQS */ 256#endif /* CONFIG_SMP && CONFIG_GENERIC_HARDIRQS */
227 257
228#ifdef CONFIG_GENERIC_HARDIRQS 258#ifdef CONFIG_GENERIC_HARDIRQS