diff options
Diffstat (limited to 'include/linux/interrupt.h')
-rw-r--r-- | include/linux/interrupt.h | 37 |
1 files changed, 35 insertions, 2 deletions
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h index 0c9cb63e6895..6fc2b720c231 100644 --- a/include/linux/interrupt.h +++ b/include/linux/interrupt.h | |||
@@ -59,6 +59,16 @@ | |||
59 | #define IRQF_NOBALANCING 0x00000800 | 59 | #define IRQF_NOBALANCING 0x00000800 |
60 | #define IRQF_IRQPOLL 0x00001000 | 60 | #define IRQF_IRQPOLL 0x00001000 |
61 | 61 | ||
62 | /* | ||
63 | * Bits used by threaded handlers: | ||
64 | * IRQTF_RUNTHREAD - signals that the interrupt handler thread should run | ||
65 | * IRQTF_DIED - handler thread died | ||
66 | */ | ||
67 | enum { | ||
68 | IRQTF_RUNTHREAD, | ||
69 | IRQTF_DIED, | ||
70 | }; | ||
71 | |||
62 | typedef irqreturn_t (*irq_handler_t)(int, void *); | 72 | typedef irqreturn_t (*irq_handler_t)(int, void *); |
63 | 73 | ||
64 | /** | 74 | /** |
@@ -71,6 +81,9 @@ typedef irqreturn_t (*irq_handler_t)(int, void *); | |||
71 | * @next: pointer to the next irqaction for shared interrupts | 81 | * @next: pointer to the next irqaction for shared interrupts |
72 | * @irq: interrupt number | 82 | * @irq: interrupt number |
73 | * @dir: pointer to the proc/irq/NN/name entry | 83 | * @dir: pointer to the proc/irq/NN/name entry |
84 | * @thread_fn: interupt handler function for threaded interrupts | ||
85 | * @thread: thread pointer for threaded interrupts | ||
86 | * @thread_flags: flags related to @thread | ||
74 | */ | 87 | */ |
75 | struct irqaction { | 88 | struct irqaction { |
76 | irq_handler_t handler; | 89 | irq_handler_t handler; |
@@ -81,11 +94,31 @@ struct irqaction { | |||
81 | struct irqaction *next; | 94 | struct irqaction *next; |
82 | int irq; | 95 | int irq; |
83 | struct proc_dir_entry *dir; | 96 | struct proc_dir_entry *dir; |
97 | irq_handler_t thread_fn; | ||
98 | struct task_struct *thread; | ||
99 | unsigned long thread_flags; | ||
84 | }; | 100 | }; |
85 | 101 | ||
86 | extern irqreturn_t no_action(int cpl, void *dev_id); | 102 | extern irqreturn_t no_action(int cpl, void *dev_id); |
87 | extern int __must_check request_irq(unsigned int, irq_handler_t handler, | 103 | |
88 | unsigned long, const char *, void *); | 104 | extern int __must_check |
105 | request_threaded_irq(unsigned int irq, irq_handler_t handler, | ||
106 | irq_handler_t thread_fn, | ||
107 | unsigned long flags, const char *name, void *dev); | ||
108 | |||
109 | static inline int __must_check | ||
110 | request_irq(unsigned int irq, irq_handler_t handler, unsigned long flags, | ||
111 | const char *name, void *dev) | ||
112 | { | ||
113 | return request_threaded_irq(irq, handler, NULL, flags, name, dev); | ||
114 | } | ||
115 | |||
116 | #ifdef CONFIG_GENERIC_HARDIRQS | ||
117 | extern void exit_irq_thread(void); | ||
118 | #else | ||
119 | static inline void exit_irq_thread(void) { } | ||
120 | #endif | ||
121 | |||
89 | extern void free_irq(unsigned int, void *); | 122 | extern void free_irq(unsigned int, void *); |
90 | 123 | ||
91 | struct device; | 124 | struct device; |