diff options
-rw-r--r-- | include/linux/lockdep.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/include/linux/lockdep.h b/include/linux/lockdep.h index 331e5f1c2d8..0aa657aa8a1 100644 --- a/include/linux/lockdep.h +++ b/include/linux/lockdep.h | |||
@@ -480,4 +480,22 @@ static inline void print_irqtrace_events(struct task_struct *curr) | |||
480 | # define lock_map_release(l) do { } while (0) | 480 | # define lock_map_release(l) do { } while (0) |
481 | #endif | 481 | #endif |
482 | 482 | ||
483 | #ifdef CONFIG_PROVE_LOCKING | ||
484 | # define might_lock(lock) \ | ||
485 | do { \ | ||
486 | typecheck(struct lockdep_map *, &(lock)->dep_map); \ | ||
487 | lock_acquire(&(lock)->dep_map, 0, 0, 0, 2, NULL, _THIS_IP_); \ | ||
488 | lock_release(&(lock)->dep_map, 0, _THIS_IP_); \ | ||
489 | } while (0) | ||
490 | # define might_lock_read(lock) \ | ||
491 | do { \ | ||
492 | typecheck(struct lockdep_map *, &(lock)->dep_map); \ | ||
493 | lock_acquire(&(lock)->dep_map, 0, 0, 1, 2, NULL, _THIS_IP_); \ | ||
494 | lock_release(&(lock)->dep_map, 0, _THIS_IP_); \ | ||
495 | } while (0) | ||
496 | #else | ||
497 | # define might_lock(lock) do { } while (0) | ||
498 | # define might_lock_read(lock) do { } while (0) | ||
499 | #endif | ||
500 | |||
483 | #endif /* __LINUX_LOCKDEP_H */ | 501 | #endif /* __LINUX_LOCKDEP_H */ |