aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/interrupt.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-03-15 22:23:40 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-03-15 22:23:40 -0400
commit5f6fb45466b2273ffb91c9cf209f164f666c33b1 (patch)
tree2b19f24b678ae379be1b19338c3095c1f76ed41d /include/linux/interrupt.h
parent3904afb41d4316f7a2968c615d689e19149a4f84 (diff)
parentc0185808eb85139f45dbfd0de66963c498d0c4db (diff)
Merge branch 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (116 commits) x86: Enable forced interrupt threading support x86: Mark low level interrupts IRQF_NO_THREAD x86: Use generic show_interrupts x86: ioapic: Avoid redundant lookup of irq_cfg x86: ioapic: Use new move_irq functions x86: Use the proper accessors in fixup_irqs() x86: ioapic: Use irq_data->state x86: ioapic: Simplify irq chip and handler setup x86: Cleanup the genirq name space genirq: Add chip flag to force mask on suspend genirq: Add desc->irq_data accessor genirq: Add comments to Kconfig switches genirq: Fixup fasteoi handler for oneshot mode genirq: Provide forced interrupt threading sched: Switch wait_task_inactive to schedule_hrtimeout() genirq: Add IRQF_NO_THREAD genirq: Allow shared oneshot interrupts genirq: Prepare the handling of shared oneshot interrupts genirq: Make warning in handle_percpu_event useful x86: ioapic: Move trigger defines to io_apic.h ... Fix up trivial(?) conflicts in arch/x86/pci/xen.c due to genirq name space changes clashing with the Xen cleanups. The set_irq_msi() had moved to xen_bind_pirq_msi_to_irq().
Diffstat (limited to 'include/linux/interrupt.h')
-rw-r--r--include/linux/interrupt.h75
1 files changed, 56 insertions, 19 deletions
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h
index 2eb16e03422f..59b72ca1c5d1 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>
@@ -56,6 +58,7 @@
56 * irq line disabled until the threaded handler has been run. 58 * irq line disabled until the threaded handler has been run.
57 * IRQF_NO_SUSPEND - Do not disable this IRQ during suspend 59 * IRQF_NO_SUSPEND - Do not disable this IRQ during suspend
58 * 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
59 */ 62 */
60#define IRQF_DISABLED 0x00000020 63#define IRQF_DISABLED 0x00000020
61#define IRQF_SAMPLE_RANDOM 0x00000040 64#define IRQF_SAMPLE_RANDOM 0x00000040
@@ -68,22 +71,9 @@
68#define IRQF_ONESHOT 0x00002000 71#define IRQF_ONESHOT 0x00002000
69#define IRQF_NO_SUSPEND 0x00004000 72#define IRQF_NO_SUSPEND 0x00004000
70#define IRQF_FORCE_RESUME 0x00008000 73#define IRQF_FORCE_RESUME 0x00008000
74#define IRQF_NO_THREAD 0x00010000
71 75
72#define IRQF_TIMER (__IRQF_TIMER | IRQF_NO_SUSPEND) 76#define IRQF_TIMER (__IRQF_TIMER | IRQF_NO_SUSPEND | IRQF_NO_THREAD)
73
74/*
75 * Bits used by threaded handlers:
76 * IRQTF_RUNTHREAD - signals that the interrupt handler thread should run
77 * IRQTF_DIED - handler thread died
78 * IRQTF_WARNED - warning "IRQ_WAKE_THREAD w/o thread_fn" has been printed
79 * IRQTF_AFFINITY - irq thread is requested to adjust affinity
80 */
81enum {
82 IRQTF_RUNTHREAD,
83 IRQTF_DIED,
84 IRQTF_WARNED,
85 IRQTF_AFFINITY,
86};
87 77
88/* 78/*
89 * These values can be returned by request_any_context_irq() and 79 * These values can be returned by request_any_context_irq() and
@@ -111,6 +101,7 @@ typedef irqreturn_t (*irq_handler_t)(int, void *);
111 * @thread_fn: interupt handler function for threaded interrupts 101 * @thread_fn: interupt handler function for threaded interrupts
112 * @thread: thread pointer for threaded interrupts 102 * @thread: thread pointer for threaded interrupts
113 * @thread_flags: flags related to @thread 103 * @thread_flags: flags related to @thread
104 * @thread_mask: bitmask for keeping track of @thread activity
114 */ 105 */
115struct irqaction { 106struct irqaction {
116 irq_handler_t handler; 107 irq_handler_t handler;
@@ -121,6 +112,7 @@ struct irqaction {
121 irq_handler_t thread_fn; 112 irq_handler_t thread_fn;
122 struct task_struct *thread; 113 struct task_struct *thread;
123 unsigned long thread_flags; 114 unsigned long thread_flags;
115 unsigned long thread_mask;
124 const char *name; 116 const char *name;
125 struct proc_dir_entry *dir; 117 struct proc_dir_entry *dir;
126} ____cacheline_internodealigned_in_smp; 118} ____cacheline_internodealigned_in_smp;
@@ -241,6 +233,35 @@ extern int irq_can_set_affinity(unsigned int irq);
241extern int irq_select_affinity(unsigned int irq); 233extern int irq_select_affinity(unsigned int irq);
242 234
243extern int irq_set_affinity_hint(unsigned int irq, const struct cpumask *m); 235extern int irq_set_affinity_hint(unsigned int irq, const struct cpumask *m);
236
237/**
238 * struct irq_affinity_notify - context for notification of IRQ affinity changes
239 * @irq: Interrupt to which notification applies
240 * @kref: Reference count, for internal use
241 * @work: Work item, for internal use
242 * @notify: Function to be called on change. This will be
243 * called in process context.
244 * @release: Function to be called on release. This will be
245 * called in process context. Once registered, the
246 * structure must only be freed when this function is
247 * called or later.
248 */
249struct irq_affinity_notify {
250 unsigned int irq;
251 struct kref kref;
252 struct work_struct work;
253 void (*notify)(struct irq_affinity_notify *, const cpumask_t *mask);
254 void (*release)(struct kref *ref);
255};
256
257extern int
258irq_set_affinity_notifier(unsigned int irq, struct irq_affinity_notify *notify);
259
260static inline void irq_run_affinity_notifiers(void)
261{
262 flush_scheduled_work();
263}
264
244#else /* CONFIG_SMP */ 265#else /* CONFIG_SMP */
245 266
246static inline int irq_set_affinity(unsigned int irq, const struct cpumask *m) 267static inline int irq_set_affinity(unsigned int irq, const struct cpumask *m)
@@ -256,7 +277,7 @@ static inline int irq_can_set_affinity(unsigned int irq)
256static inline int irq_select_affinity(unsigned int irq) { return 0; } 277static inline int irq_select_affinity(unsigned int irq) { return 0; }
257 278
258static inline int irq_set_affinity_hint(unsigned int irq, 279static inline int irq_set_affinity_hint(unsigned int irq,
259 const struct cpumask *m) 280 const struct cpumask *m)
260{ 281{
261 return -EINVAL; 282 return -EINVAL;
262} 283}
@@ -315,16 +336,24 @@ static inline void enable_irq_lockdep_irqrestore(unsigned int irq, unsigned long
315} 336}
316 337
317/* IRQ wakeup (PM) control: */ 338/* IRQ wakeup (PM) control: */
318extern int set_irq_wake(unsigned int irq, unsigned int on); 339extern int irq_set_irq_wake(unsigned int irq, unsigned int on);
340
341#ifndef CONFIG_GENERIC_HARDIRQS_NO_COMPAT
342/* Please do not use: Use the replacement functions instead */
343static inline int set_irq_wake(unsigned int irq, unsigned int on)
344{
345 return irq_set_irq_wake(irq, on);
346}
347#endif
319 348
320static inline int enable_irq_wake(unsigned int irq) 349static inline int enable_irq_wake(unsigned int irq)
321{ 350{
322 return set_irq_wake(irq, 1); 351 return irq_set_irq_wake(irq, 1);
323} 352}
324 353
325static inline int disable_irq_wake(unsigned int irq) 354static inline int disable_irq_wake(unsigned int irq)
326{ 355{
327 return set_irq_wake(irq, 0); 356 return irq_set_irq_wake(irq, 0);
328} 357}
329 358
330#else /* !CONFIG_GENERIC_HARDIRQS */ 359#else /* !CONFIG_GENERIC_HARDIRQS */
@@ -354,6 +383,13 @@ static inline int disable_irq_wake(unsigned int irq)
354} 383}
355#endif /* CONFIG_GENERIC_HARDIRQS */ 384#endif /* CONFIG_GENERIC_HARDIRQS */
356 385
386
387#ifdef CONFIG_IRQ_FORCED_THREADING
388extern bool force_irqthreads;
389#else
390#define force_irqthreads (0)
391#endif
392
357#ifndef __ARCH_SET_SOFTIRQ_PENDING 393#ifndef __ARCH_SET_SOFTIRQ_PENDING
358#define set_softirq_pending(x) (local_softirq_pending() = (x)) 394#define set_softirq_pending(x) (local_softirq_pending() = (x))
359#define or_softirq_pending(x) (local_softirq_pending() |= (x)) 395#define or_softirq_pending(x) (local_softirq_pending() |= (x))
@@ -653,6 +689,7 @@ static inline void init_irq_proc(void)
653 689
654struct seq_file; 690struct seq_file;
655int show_interrupts(struct seq_file *p, void *v); 691int show_interrupts(struct seq_file *p, void *v);
692int arch_show_interrupts(struct seq_file *p, int prec);
656 693
657extern int early_irq_init(void); 694extern int early_irq_init(void);
658extern int arch_probe_nr_irqs(void); 695extern int arch_probe_nr_irqs(void);