aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2011-01-24 17:30:13 -0500
committerDavid S. Miller <davem@davemloft.net>2011-01-24 17:30:13 -0500
commitc2df88cbb43c25db27fbbf94e92318bdad018f3e (patch)
treedc41466a193f85e3a7cc8baf1f78f2b55b62aabc /include
parent5bdc22a56549e7983c6b443298672641952ea035 (diff)
parentcd7eab44e9946c28d595abe3e9a43e945bc49141 (diff)
Merge branch 'irq/numa' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
Diffstat (limited to 'include')
-rw-r--r--include/linux/interrupt.h33
-rw-r--r--include/linux/irqdesc.h3
2 files changed, 35 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);
240extern int irq_select_affinity(unsigned int irq); 242extern int irq_select_affinity(unsigned int irq);
241 243
242extern int irq_set_affinity_hint(unsigned int irq, const struct cpumask *m); 244extern 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 */
258struct 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
266extern int
267irq_set_affinity_notifier(unsigned int irq, struct irq_affinity_notify *notify);
268
269static inline void irq_run_affinity_notifiers(void)
270{
271 flush_scheduled_work();
272}
273
243#else /* CONFIG_SMP */ 274#else /* CONFIG_SMP */
244 275
245static inline int irq_set_affinity(unsigned int irq, const struct cpumask *m) 276static 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)
255static inline int irq_select_affinity(unsigned int irq) { return 0; } 286static inline int irq_select_affinity(unsigned int irq) { return 0; }
256 287
257static inline int irq_set_affinity_hint(unsigned int irq, 288static 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}
diff --git a/include/linux/irqdesc.h b/include/linux/irqdesc.h
index c1a95b7b58de..bfef56dadddb 100644
--- a/include/linux/irqdesc.h
+++ b/include/linux/irqdesc.h
@@ -8,6 +8,7 @@
8 * For now it's included from <linux/irq.h> 8 * For now it's included from <linux/irq.h>
9 */ 9 */
10 10
11struct irq_affinity_notify;
11struct proc_dir_entry; 12struct proc_dir_entry;
12struct timer_rand_state; 13struct timer_rand_state;
13/** 14/**
@@ -24,6 +25,7 @@ struct timer_rand_state;
24 * @last_unhandled: aging timer for unhandled count 25 * @last_unhandled: aging timer for unhandled count
25 * @irqs_unhandled: stats field for spurious unhandled interrupts 26 * @irqs_unhandled: stats field for spurious unhandled interrupts
26 * @lock: locking for SMP 27 * @lock: locking for SMP
28 * @affinity_notify: context for notification of affinity changes
27 * @pending_mask: pending rebalanced interrupts 29 * @pending_mask: pending rebalanced interrupts
28 * @threads_active: number of irqaction threads currently running 30 * @threads_active: number of irqaction threads currently running
29 * @wait_for_threads: wait queue for sync_irq to wait for threaded handlers 31 * @wait_for_threads: wait queue for sync_irq to wait for threaded handlers
@@ -70,6 +72,7 @@ struct irq_desc {
70 raw_spinlock_t lock; 72 raw_spinlock_t lock;
71#ifdef CONFIG_SMP 73#ifdef CONFIG_SMP
72 const struct cpumask *affinity_hint; 74 const struct cpumask *affinity_hint;
75 struct irq_affinity_notify *affinity_notify;
73#ifdef CONFIG_GENERIC_PENDING_IRQ 76#ifdef CONFIG_GENERIC_PENDING_IRQ
74 cpumask_var_t pending_mask; 77 cpumask_var_t pending_mask;
75#endif 78#endif