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.h41
1 files changed, 30 insertions, 11 deletions
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h
index a103732b7588..a64b00e286f5 100644
--- a/include/linux/interrupt.h
+++ b/include/linux/interrupt.h
@@ -59,6 +59,8 @@
59 * IRQF_NO_SUSPEND - Do not disable this IRQ during suspend 59 * IRQF_NO_SUSPEND - Do not disable this IRQ during suspend
60 * IRQF_FORCE_RESUME - Force enable it on resume even if IRQF_NO_SUSPEND is set 60 * IRQF_FORCE_RESUME - Force enable it on resume even if IRQF_NO_SUSPEND is set
61 * IRQF_NO_THREAD - Interrupt cannot be threaded 61 * IRQF_NO_THREAD - Interrupt cannot be threaded
62 * IRQF_EARLY_RESUME - Resume IRQ early during syscore instead of at device
63 * resume time.
62 */ 64 */
63#define IRQF_DISABLED 0x00000020 65#define IRQF_DISABLED 0x00000020
64#define IRQF_SAMPLE_RANDOM 0x00000040 66#define IRQF_SAMPLE_RANDOM 0x00000040
@@ -72,6 +74,7 @@
72#define IRQF_NO_SUSPEND 0x00004000 74#define IRQF_NO_SUSPEND 0x00004000
73#define IRQF_FORCE_RESUME 0x00008000 75#define IRQF_FORCE_RESUME 0x00008000
74#define IRQF_NO_THREAD 0x00010000 76#define IRQF_NO_THREAD 0x00010000
77#define IRQF_EARLY_RESUME 0x00020000
75 78
76#define IRQF_TIMER (__IRQF_TIMER | IRQF_NO_SUSPEND | IRQF_NO_THREAD) 79#define IRQF_TIMER (__IRQF_TIMER | IRQF_NO_SUSPEND | IRQF_NO_THREAD)
77 80
@@ -95,6 +98,7 @@ typedef irqreturn_t (*irq_handler_t)(int, void *);
95 * @flags: flags (see IRQF_* above) 98 * @flags: flags (see IRQF_* above)
96 * @name: name of the device 99 * @name: name of the device
97 * @dev_id: cookie to identify the device 100 * @dev_id: cookie to identify the device
101 * @percpu_dev_id: cookie to identify the device
98 * @next: pointer to the next irqaction for shared interrupts 102 * @next: pointer to the next irqaction for shared interrupts
99 * @irq: interrupt number 103 * @irq: interrupt number
100 * @dir: pointer to the proc/irq/NN/name entry 104 * @dir: pointer to the proc/irq/NN/name entry
@@ -104,17 +108,18 @@ typedef irqreturn_t (*irq_handler_t)(int, void *);
104 * @thread_mask: bitmask for keeping track of @thread activity 108 * @thread_mask: bitmask for keeping track of @thread activity
105 */ 109 */
106struct irqaction { 110struct irqaction {
107 irq_handler_t handler; 111 irq_handler_t handler;
108 unsigned long flags; 112 unsigned long flags;
109 void *dev_id; 113 void *dev_id;
110 struct irqaction *next; 114 void __percpu *percpu_dev_id;
111 int irq; 115 struct irqaction *next;
112 irq_handler_t thread_fn; 116 int irq;
113 struct task_struct *thread; 117 irq_handler_t thread_fn;
114 unsigned long thread_flags; 118 struct task_struct *thread;
115 unsigned long thread_mask; 119 unsigned long thread_flags;
116 const char *name; 120 unsigned long thread_mask;
117 struct proc_dir_entry *dir; 121 const char *name;
122 struct proc_dir_entry *dir;
118} ____cacheline_internodealigned_in_smp; 123} ____cacheline_internodealigned_in_smp;
119 124
120extern irqreturn_t no_action(int cpl, void *dev_id); 125extern irqreturn_t no_action(int cpl, void *dev_id);
@@ -136,6 +141,10 @@ extern int __must_check
136request_any_context_irq(unsigned int irq, irq_handler_t handler, 141request_any_context_irq(unsigned int irq, irq_handler_t handler,
137 unsigned long flags, const char *name, void *dev_id); 142 unsigned long flags, const char *name, void *dev_id);
138 143
144extern int __must_check
145request_percpu_irq(unsigned int irq, irq_handler_t handler,
146 const char *devname, void __percpu *percpu_dev_id);
147
139extern void exit_irq_thread(void); 148extern void exit_irq_thread(void);
140#else 149#else
141 150
@@ -164,10 +173,18 @@ request_any_context_irq(unsigned int irq, irq_handler_t handler,
164 return request_irq(irq, handler, flags, name, dev_id); 173 return request_irq(irq, handler, flags, name, dev_id);
165} 174}
166 175
176static inline int __must_check
177request_percpu_irq(unsigned int irq, irq_handler_t handler,
178 const char *devname, void __percpu *percpu_dev_id)
179{
180 return request_irq(irq, handler, 0, devname, percpu_dev_id);
181}
182
167static inline void exit_irq_thread(void) { } 183static inline void exit_irq_thread(void) { }
168#endif 184#endif
169 185
170extern void free_irq(unsigned int, void *); 186extern void free_irq(unsigned int, void *);
187extern void free_percpu_irq(unsigned int, void __percpu *);
171 188
172struct device; 189struct device;
173 190
@@ -207,7 +224,9 @@ extern void devm_free_irq(struct device *dev, unsigned int irq, void *dev_id);
207 224
208extern void disable_irq_nosync(unsigned int irq); 225extern void disable_irq_nosync(unsigned int irq);
209extern void disable_irq(unsigned int irq); 226extern void disable_irq(unsigned int irq);
227extern void disable_percpu_irq(unsigned int irq);
210extern void enable_irq(unsigned int irq); 228extern void enable_irq(unsigned int irq);
229extern void enable_percpu_irq(unsigned int irq, unsigned int type);
211 230
212/* The following three functions are for the core kernel use only. */ 231/* The following three functions are for the core kernel use only. */
213#ifdef CONFIG_GENERIC_HARDIRQS 232#ifdef CONFIG_GENERIC_HARDIRQS