2 #ifndef _LINUX_INTERRUPT_H
3 #define _LINUX_INTERRUPT_H
5 #include <linux/kernel.h>
6 #include <linux/linkage.h>
7 #include <linux/bitops.h>
11 #include <linux/irqnr.h>
16 #include <linux/hrtimer.h>
21 #include <asm/ptrace.h>
30 #define IRQF_TRIGGER_NONE 0x00000000
31 #define IRQF_TRIGGER_RISING 0x00000001
32 #define IRQF_TRIGGER_FALLING 0x00000002
33 #define IRQF_TRIGGER_HIGH 0x00000004
34 #define IRQF_TRIGGER_LOW 0x00000008
35 #define IRQF_TRIGGER_MASK (IRQF_TRIGGER_HIGH | IRQF_TRIGGER_LOW | \
36 IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING)
37 #define IRQF_TRIGGER_PROBE 0x00000010
62 #define IRQF_DISABLED 0x00000020
63 #define IRQF_SHARED 0x00000080
64 #define IRQF_PROBE_SHARED 0x00000100
65 #define __IRQF_TIMER 0x00000200
66 #define IRQF_PERCPU 0x00000400
67 #define IRQF_NOBALANCING 0x00000800
68 #define IRQF_IRQPOLL 0x00001000
69 #define IRQF_ONESHOT 0x00002000
70 #define IRQF_NO_SUSPEND 0x00004000
71 #define IRQF_FORCE_RESUME 0x00008000
72 #define IRQF_NO_THREAD 0x00010000
73 #define IRQF_EARLY_RESUME 0x00020000
75 #define IRQF_TIMER (__IRQF_TIMER | IRQF_NO_SUSPEND | IRQF_NO_THREAD)
123 #ifdef CONFIG_GENERIC_HARDIRQS
142 const char *devname,
void __percpu *percpu_dev_id);
160 return request_irq(irq, handler, flags, name, dev);
167 return request_irq(irq, handler, flags, name, dev_id);
172 const char *devname,
void __percpu *percpu_dev_id)
174 return request_irq(irq, handler, 0, devname, percpu_dev_id);
178 extern void free_irq(
unsigned int,
void *);
186 unsigned long irqflags,
const char *devname,
191 unsigned long irqflags,
const char *devname,
void *
dev_id)
211 #ifdef CONFIG_LOCKDEP
212 # define local_irq_enable_in_hardirq() do { } while (0)
214 # define local_irq_enable_in_hardirq() local_irq_enable()
224 #ifdef CONFIG_GENERIC_HARDIRQS
227 #ifdef CONFIG_PM_SLEEP
238 #if defined(CONFIG_SMP) && defined(CONFIG_GENERIC_HARDIRQS)
242 extern int irq_set_affinity(
unsigned int irq,
const struct cpumask *
cpumask);
243 extern int irq_can_set_affinity(
unsigned int irq);
244 extern int irq_select_affinity(
unsigned int irq);
246 extern int irq_set_affinity_hint(
unsigned int irq,
const struct cpumask *
m);
260 struct irq_affinity_notify {
269 irq_set_affinity_notifier(
unsigned int irq,
struct irq_affinity_notify *
notify);
271 static inline void irq_run_affinity_notifiers(
void)
278 static inline int irq_set_affinity(
unsigned int irq,
const struct cpumask *
m)
283 static inline int irq_can_set_affinity(
unsigned int irq)
288 static inline int irq_select_affinity(
unsigned int irq) {
return 0; }
290 static inline int irq_set_affinity_hint(
unsigned int irq,
297 #ifdef CONFIG_GENERIC_HARDIRQS
312 #ifdef CONFIG_LOCKDEP
320 #ifdef CONFIG_LOCKDEP
328 #ifdef CONFIG_LOCKDEP
335 #ifdef CONFIG_LOCKDEP
343 #ifdef CONFIG_LOCKDEP
352 static inline int enable_irq_wake(
unsigned int irq)
357 static inline int disable_irq_wake(
unsigned int irq)
368 #ifndef CONFIG_LOCKDEP
369 # define disable_irq_nosync_lockdep(irq) disable_irq_nosync(irq)
370 # define disable_irq_nosync_lockdep_irqsave(irq, flags) \
371 disable_irq_nosync(irq)
372 # define disable_irq_lockdep(irq) disable_irq(irq)
373 # define enable_irq_lockdep(irq) enable_irq(irq)
374 # define enable_irq_lockdep_irqrestore(irq, flags) \
378 static inline int enable_irq_wake(
unsigned int irq)
383 static inline int disable_irq_wake(
unsigned int irq)
390 #ifdef CONFIG_IRQ_FORCED_THREADING
393 #define force_irqthreads (0)
396 #ifndef __ARCH_SET_SOFTIRQ_PENDING
397 #define set_softirq_pending(x) (local_softirq_pending() = (x))
398 #define or_softirq_pending(x) (local_softirq_pending() |= (x))
407 #ifndef hard_irq_disable
408 #define hard_irq_disable() do { } while(0)
433 #define SOFTIRQ_STOP_IDLE_MASK (~(1 << RCU_SOFTIRQ))
469 static inline struct task_struct *this_cpu_ksoftirqd(
void)
483 int this_cpu,
int softirq);
514 #define DECLARE_TASKLET(name, func, data) \
515 struct tasklet_struct name = { NULL, 0, ATOMIC_INIT(0), func, data }
517 #define DECLARE_TASKLET_DISABLED(name, func, data) \
518 struct tasklet_struct name = { NULL, 0, ATOMIC_INIT(1), func, data }
544 #define tasklet_trylock(t) 1
545 #define tasklet_unlock_wait(t) do { } while (0)
546 #define tasklet_unlock(t) do { } while (0)
573 static inline void tasklet_hi_schedule_first(
struct tasklet_struct *t)
580 static inline void tasklet_disable_nosync(
struct tasklet_struct *t)
588 tasklet_disable_nosync(t);
608 void (*
func)(
unsigned long),
unsigned long data);
663 #if defined(CONFIG_GENERIC_HARDIRQS) && !defined(CONFIG_GENERIC_IRQ_PROBE)
682 #ifdef CONFIG_PROC_FS