diff options
author | Arjan van de Ven <arjan@linux.intel.com> | 2006-11-25 14:09:37 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.osdl.org> | 2006-11-25 16:28:34 -0500 |
commit | cfd3ef2346f924d6c0e82236c20fdb3a8840136a (patch) | |
tree | f0289367f0dbf80a5bcfa2969f428c605c54dd6a /include/linux/spinlock.h | |
parent | ee3ce191e8eaa4cc15c51a28b34143b36404c4f5 (diff) |
[PATCH] lockdep: spin_lock_irqsave_nested()
Introduce spin_lock_irqsave_nested(); implementation from:
http://lkml.org/lkml/2006/6/1/122
Patch from:
http://lkml.org/lkml/2006/9/13/258
[akpm@osdl.org: two compile fixes]
Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Signed-off-by: Jiri Kosina <jikos@jikos.cz>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Acked-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/linux/spinlock.h')
-rw-r--r-- | include/linux/spinlock.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/include/linux/spinlock.h b/include/linux/spinlock.h index 54ad37089c49..57f670d78f7c 100644 --- a/include/linux/spinlock.h +++ b/include/linux/spinlock.h | |||
@@ -199,6 +199,21 @@ do { \ | |||
199 | BUILD_CHECK_IRQ_FLAGS(flags); \ | 199 | BUILD_CHECK_IRQ_FLAGS(flags); \ |
200 | flags = _write_lock_irqsave(lock); \ | 200 | flags = _write_lock_irqsave(lock); \ |
201 | } while (0) | 201 | } while (0) |
202 | |||
203 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | ||
204 | #define spin_lock_irqsave_nested(lock, flags, subclass) \ | ||
205 | do { \ | ||
206 | BUILD_CHECK_IRQ_FLAGS(flags); \ | ||
207 | flags = _spin_lock_irqsave_nested(lock, subclass); \ | ||
208 | } while (0) | ||
209 | #else | ||
210 | #define spin_lock_irqsave_nested(lock, flags, subclass) \ | ||
211 | do { \ | ||
212 | BUILD_CHECK_IRQ_FLAGS(flags); \ | ||
213 | flags = _spin_lock_irqsave(lock); \ | ||
214 | } while (0) | ||
215 | #endif | ||
216 | |||
202 | #else | 217 | #else |
203 | #define spin_lock_irqsave(lock, flags) \ | 218 | #define spin_lock_irqsave(lock, flags) \ |
204 | do { \ | 219 | do { \ |
@@ -215,6 +230,9 @@ do { \ | |||
215 | BUILD_CHECK_IRQ_FLAGS(flags); \ | 230 | BUILD_CHECK_IRQ_FLAGS(flags); \ |
216 | _write_lock_irqsave(lock, flags); \ | 231 | _write_lock_irqsave(lock, flags); \ |
217 | } while (0) | 232 | } while (0) |
233 | #define spin_lock_irqsave_nested(lock, flags, subclass) \ | ||
234 | spin_lock_irqsave(lock, flags) | ||
235 | |||
218 | #endif | 236 | #endif |
219 | 237 | ||
220 | #define spin_lock_irq(lock) _spin_lock_irq(lock) | 238 | #define spin_lock_irq(lock) _spin_lock_irq(lock) |