diff options
Diffstat (limited to 'include/linux/interrupt.h')
-rw-r--r-- | include/linux/interrupt.h | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h index 55e0d4253e49..63c5ad78e37c 100644 --- a/include/linux/interrupt.h +++ b/include/linux/interrupt.h | |||
@@ -14,6 +14,8 @@ | |||
14 | #include <linux/smp.h> | 14 | #include <linux/smp.h> |
15 | #include <linux/percpu.h> | 15 | #include <linux/percpu.h> |
16 | #include <linux/hrtimer.h> | 16 | #include <linux/hrtimer.h> |
17 | #include <linux/kref.h> | ||
18 | #include <linux/workqueue.h> | ||
17 | 19 | ||
18 | #include <asm/atomic.h> | 20 | #include <asm/atomic.h> |
19 | #include <asm/ptrace.h> | 21 | #include <asm/ptrace.h> |
@@ -240,6 +242,35 @@ extern int irq_can_set_affinity(unsigned int irq); | |||
240 | extern int irq_select_affinity(unsigned int irq); | 242 | extern int irq_select_affinity(unsigned int irq); |
241 | 243 | ||
242 | extern int irq_set_affinity_hint(unsigned int irq, const struct cpumask *m); | 244 | extern int irq_set_affinity_hint(unsigned int irq, const struct cpumask *m); |
245 | |||
246 | /** | ||
247 | * struct irq_affinity_notify - context for notification of IRQ affinity changes | ||
248 | * @irq: Interrupt to which notification applies | ||
249 | * @kref: Reference count, for internal use | ||
250 | * @work: Work item, for internal use | ||
251 | * @notify: Function to be called on change. This will be | ||
252 | * called in process context. | ||
253 | * @release: Function to be called on release. This will be | ||
254 | * called in process context. Once registered, the | ||
255 | * structure must only be freed when this function is | ||
256 | * called or later. | ||
257 | */ | ||
258 | struct irq_affinity_notify { | ||
259 | unsigned int irq; | ||
260 | struct kref kref; | ||
261 | struct work_struct work; | ||
262 | void (*notify)(struct irq_affinity_notify *, const cpumask_t *mask); | ||
263 | void (*release)(struct kref *ref); | ||
264 | }; | ||
265 | |||
266 | extern int | ||
267 | irq_set_affinity_notifier(unsigned int irq, struct irq_affinity_notify *notify); | ||
268 | |||
269 | static inline void irq_run_affinity_notifiers(void) | ||
270 | { | ||
271 | flush_scheduled_work(); | ||
272 | } | ||
273 | |||
243 | #else /* CONFIG_SMP */ | 274 | #else /* CONFIG_SMP */ |
244 | 275 | ||
245 | static inline int irq_set_affinity(unsigned int irq, const struct cpumask *m) | 276 | static inline int irq_set_affinity(unsigned int irq, const struct cpumask *m) |
@@ -255,7 +286,7 @@ static inline int irq_can_set_affinity(unsigned int irq) | |||
255 | static inline int irq_select_affinity(unsigned int irq) { return 0; } | 286 | static inline int irq_select_affinity(unsigned int irq) { return 0; } |
256 | 287 | ||
257 | static inline int irq_set_affinity_hint(unsigned int irq, | 288 | static inline int irq_set_affinity_hint(unsigned int irq, |
258 | const struct cpumask *m) | 289 | const struct cpumask *m) |
259 | { | 290 | { |
260 | return -EINVAL; | 291 | return -EINVAL; |
261 | } | 292 | } |