diff options
Diffstat (limited to 'include/linux/interrupt.h')
| -rw-r--r-- | include/linux/interrupt.h | 39 |
1 files changed, 37 insertions, 2 deletions
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h index 75f3f00ac1e5..a0384a4d1e6f 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 |
| @@ -52,16 +53,21 @@ | |||
| 52 | * IRQF_ONESHOT - Interrupt is not reenabled after the hardirq handler finished. | 53 | * IRQF_ONESHOT - Interrupt is not reenabled after the hardirq handler finished. |
| 53 | * Used by threaded interrupts which need to keep the | 54 | * Used by threaded interrupts which need to keep the |
| 54 | * irq line disabled until the threaded handler has been run. | 55 | * irq line disabled until the threaded handler has been run. |
| 56 | * IRQF_NO_SUSPEND - Do not disable this IRQ during suspend | ||
| 57 | * | ||
| 55 | */ | 58 | */ |
| 56 | #define IRQF_DISABLED 0x00000020 | 59 | #define IRQF_DISABLED 0x00000020 |
| 57 | #define IRQF_SAMPLE_RANDOM 0x00000040 | 60 | #define IRQF_SAMPLE_RANDOM 0x00000040 |
| 58 | #define IRQF_SHARED 0x00000080 | 61 | #define IRQF_SHARED 0x00000080 |
| 59 | #define IRQF_PROBE_SHARED 0x00000100 | 62 | #define IRQF_PROBE_SHARED 0x00000100 |
| 60 | #define IRQF_TIMER 0x00000200 | 63 | #define __IRQF_TIMER 0x00000200 |
| 61 | #define IRQF_PERCPU 0x00000400 | 64 | #define IRQF_PERCPU 0x00000400 |
| 62 | #define IRQF_NOBALANCING 0x00000800 | 65 | #define IRQF_NOBALANCING 0x00000800 |
| 63 | #define IRQF_IRQPOLL 0x00001000 | 66 | #define IRQF_IRQPOLL 0x00001000 |
| 64 | #define IRQF_ONESHOT 0x00002000 | 67 | #define IRQF_ONESHOT 0x00002000 |
| 68 | #define IRQF_NO_SUSPEND 0x00004000 | ||
| 69 | |||
| 70 | #define IRQF_TIMER (__IRQF_TIMER | IRQF_NO_SUSPEND) | ||
| 65 | 71 | ||
| 66 | /* | 72 | /* |
| 67 | * Bits used by threaded handlers: | 73 | * Bits used by threaded handlers: |
| @@ -77,6 +83,18 @@ enum { | |||
| 77 | IRQTF_AFFINITY, | 83 | IRQTF_AFFINITY, |
| 78 | }; | 84 | }; |
| 79 | 85 | ||
| 86 | /* | ||
| 87 | * These values can be returned by request_any_context_irq() and | ||
| 88 | * describe the context the interrupt will be run in. | ||
| 89 | * | ||
| 90 | * IRQC_IS_HARDIRQ - interrupt runs in hardirq context | ||
| 91 | * IRQC_IS_NESTED - interrupt runs in a nested threaded context | ||
| 92 | */ | ||
| 93 | enum { | ||
| 94 | IRQC_IS_HARDIRQ = 0, | ||
| 95 | IRQC_IS_NESTED, | ||
| 96 | }; | ||
| 97 | |||
| 80 | typedef irqreturn_t (*irq_handler_t)(int, void *); | 98 | typedef irqreturn_t (*irq_handler_t)(int, void *); |
| 81 | 99 | ||
| 82 | /** | 100 | /** |
| @@ -120,6 +138,10 @@ request_irq(unsigned int irq, irq_handler_t handler, unsigned long flags, | |||
| 120 | return request_threaded_irq(irq, handler, NULL, flags, name, dev); | 138 | return request_threaded_irq(irq, handler, NULL, flags, name, dev); |
| 121 | } | 139 | } |
| 122 | 140 | ||
| 141 | extern int __must_check | ||
| 142 | request_any_context_irq(unsigned int irq, irq_handler_t handler, | ||
| 143 | unsigned long flags, const char *name, void *dev_id); | ||
| 144 | |||
| 123 | extern void exit_irq_thread(void); | 145 | extern void exit_irq_thread(void); |
| 124 | #else | 146 | #else |
| 125 | 147 | ||
| @@ -141,6 +163,13 @@ request_threaded_irq(unsigned int irq, irq_handler_t handler, | |||
| 141 | return request_irq(irq, handler, flags, name, dev); | 163 | return request_irq(irq, handler, flags, name, dev); |
| 142 | } | 164 | } |
| 143 | 165 | ||
| 166 | static inline int __must_check | ||
| 167 | request_any_context_irq(unsigned int irq, irq_handler_t handler, | ||
| 168 | unsigned long flags, const char *name, void *dev_id) | ||
| 169 | { | ||
| 170 | return request_irq(irq, handler, flags, name, dev_id); | ||
| 171 | } | ||
| 172 | |||
| 144 | static inline void exit_irq_thread(void) { } | 173 | static inline void exit_irq_thread(void) { } |
| 145 | #endif | 174 | #endif |
| 146 | 175 | ||
| @@ -209,6 +238,7 @@ extern int irq_set_affinity(unsigned int irq, const struct cpumask *cpumask); | |||
| 209 | extern int irq_can_set_affinity(unsigned int irq); | 238 | extern int irq_can_set_affinity(unsigned int irq); |
| 210 | extern int irq_select_affinity(unsigned int irq); | 239 | extern int irq_select_affinity(unsigned int irq); |
| 211 | 240 | ||
| 241 | extern int irq_set_affinity_hint(unsigned int irq, const struct cpumask *m); | ||
| 212 | #else /* CONFIG_SMP */ | 242 | #else /* CONFIG_SMP */ |
| 213 | 243 | ||
| 214 | static inline int irq_set_affinity(unsigned int irq, const struct cpumask *m) | 244 | static inline int irq_set_affinity(unsigned int irq, const struct cpumask *m) |
| @@ -223,6 +253,11 @@ static inline int irq_can_set_affinity(unsigned int irq) | |||
| 223 | 253 | ||
| 224 | static inline int irq_select_affinity(unsigned int irq) { return 0; } | 254 | static inline int irq_select_affinity(unsigned int irq) { return 0; } |
| 225 | 255 | ||
| 256 | static inline int irq_set_affinity_hint(unsigned int irq, | ||
| 257 | const struct cpumask *m) | ||
| 258 | { | ||
| 259 | return -EINVAL; | ||
| 260 | } | ||
| 226 | #endif /* CONFIG_SMP && CONFIG_GENERIC_HARDIRQS */ | 261 | #endif /* CONFIG_SMP && CONFIG_GENERIC_HARDIRQS */ |
| 227 | 262 | ||
| 228 | #ifdef CONFIG_GENERIC_HARDIRQS | 263 | #ifdef CONFIG_GENERIC_HARDIRQS |
