diff options
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/interrupt.h | 49 |
1 files changed, 48 insertions, 1 deletions
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h index da3e0dbe61d4..2c5452c1d7bb 100644 --- a/include/linux/interrupt.h +++ b/include/linux/interrupt.h | |||
@@ -86,6 +86,41 @@ extern void disable_irq_nosync(unsigned int irq); | |||
86 | extern void disable_irq(unsigned int irq); | 86 | extern void disable_irq(unsigned int irq); |
87 | extern void enable_irq(unsigned int irq); | 87 | extern void enable_irq(unsigned int irq); |
88 | 88 | ||
89 | /* | ||
90 | * Special lockdep variants of irq disabling/enabling. | ||
91 | * These should be used for locking constructs that | ||
92 | * know that a particular irq context which is disabled, | ||
93 | * and which is the only irq-context user of a lock, | ||
94 | * that it's safe to take the lock in the irq-disabled | ||
95 | * section without disabling hardirqs. | ||
96 | * | ||
97 | * On !CONFIG_LOCKDEP they are equivalent to the normal | ||
98 | * irq disable/enable methods. | ||
99 | */ | ||
100 | static inline void disable_irq_nosync_lockdep(unsigned int irq) | ||
101 | { | ||
102 | disable_irq_nosync(irq); | ||
103 | #ifdef CONFIG_LOCKDEP | ||
104 | local_irq_disable(); | ||
105 | #endif | ||
106 | } | ||
107 | |||
108 | static inline void disable_irq_lockdep(unsigned int irq) | ||
109 | { | ||
110 | disable_irq(irq); | ||
111 | #ifdef CONFIG_LOCKDEP | ||
112 | local_irq_disable(); | ||
113 | #endif | ||
114 | } | ||
115 | |||
116 | static inline void enable_irq_lockdep(unsigned int irq) | ||
117 | { | ||
118 | #ifdef CONFIG_LOCKDEP | ||
119 | local_irq_enable(); | ||
120 | #endif | ||
121 | enable_irq(irq); | ||
122 | } | ||
123 | |||
89 | /* IRQ wakeup (PM) control: */ | 124 | /* IRQ wakeup (PM) control: */ |
90 | extern int set_irq_wake(unsigned int irq, unsigned int on); | 125 | extern int set_irq_wake(unsigned int irq, unsigned int on); |
91 | 126 | ||
@@ -99,7 +134,19 @@ static inline int disable_irq_wake(unsigned int irq) | |||
99 | return set_irq_wake(irq, 0); | 134 | return set_irq_wake(irq, 0); |
100 | } | 135 | } |
101 | 136 | ||
102 | #endif | 137 | #else /* !CONFIG_GENERIC_HARDIRQS */ |
138 | /* | ||
139 | * NOTE: non-genirq architectures, if they want to support the lock | ||
140 | * validator need to define the methods below in their asm/irq.h | ||
141 | * files, under an #ifdef CONFIG_LOCKDEP section. | ||
142 | */ | ||
143 | # ifndef CONFIG_LOCKDEP | ||
144 | # define disable_irq_nosync_lockdep(irq) disable_irq_nosync(irq) | ||
145 | # define disable_irq_lockdep(irq) disable_irq(irq) | ||
146 | # define enable_irq_lockdep(irq) enable_irq(irq) | ||
147 | # endif | ||
148 | |||
149 | #endif /* CONFIG_GENERIC_HARDIRQS */ | ||
103 | 150 | ||
104 | #ifndef __ARCH_SET_SOFTIRQ_PENDING | 151 | #ifndef __ARCH_SET_SOFTIRQ_PENDING |
105 | #define set_softirq_pending(x) (local_softirq_pending() = (x)) | 152 | #define set_softirq_pending(x) (local_softirq_pending() = (x)) |