Rev 3243 | Rev 5270 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 3243 | Rev 5056 | ||
---|---|---|---|
Line 226... | Line 226... | ||
226 | */ |
226 | */ |
227 | unsigned int irq_context:2; /* bit 0 - soft, bit 1 - hard */ |
227 | unsigned int irq_context:2; /* bit 0 - soft, bit 1 - hard */ |
228 | unsigned int trylock:1; /* 16 bits */ |
228 | unsigned int trylock:1; /* 16 bits */ |
Line 229... | Line 229... | ||
229 | 229 | ||
230 | unsigned int read:2; /* see lock_acquire() comment */ |
230 | unsigned int read:2; /* see lock_acquire() comment */ |
231 | unsigned int check:2; /* see lock_acquire() comment */ |
231 | unsigned int check:1; /* see lock_acquire() comment */ |
232 | unsigned int hardirqs_off:1; |
232 | unsigned int hardirqs_off:1; |
233 | unsigned int references:11; /* 32 bits */ |
233 | unsigned int references:12; /* 32 bits */ |
Line 234... | Line 234... | ||
234 | }; |
234 | }; |
235 | 235 | ||
236 | /* |
236 | /* |
237 | * Initialization, self-test and debugging-output methods: |
237 | * Initialization, self-test and debugging-output methods: |
238 | */ |
238 | */ |
239 | extern void lockdep_init(void); |
239 | extern void lockdep_init(void); |
240 | extern void lockdep_info(void); |
240 | extern void lockdep_info(void); |
241 | extern void lockdep_reset(void); |
241 | extern void lockdep_reset(void); |
242 | extern void lockdep_reset_lock(struct lockdep_map *lock); |
242 | extern void lockdep_reset_lock(struct lockdep_map *lock); |
Line 243... | Line 243... | ||
243 | extern void lockdep_free_key_range(void *start, unsigned long size); |
243 | extern void lockdep_free_key_range(void *start, unsigned long size); |
244 | extern void lockdep_sys_exit(void); |
244 | extern asmlinkage void lockdep_sys_exit(void); |
Line 245... | Line 245... | ||
245 | 245 | ||
Line 277... | Line 277... | ||
277 | #define lockdep_set_subclass(lock, sub) \ |
277 | #define lockdep_set_subclass(lock, sub) \ |
278 | lockdep_init_map(&(lock)->dep_map, #lock, \ |
278 | lockdep_init_map(&(lock)->dep_map, #lock, \ |
279 | (lock)->dep_map.key, sub) |
279 | (lock)->dep_map.key, sub) |
Line 280... | Line 280... | ||
280 | 280 | ||
281 | #define lockdep_set_novalidate_class(lock) \ |
281 | #define lockdep_set_novalidate_class(lock) \ |
282 | lockdep_set_class(lock, &__lockdep_no_validate__) |
282 | lockdep_set_class_and_name(lock, &__lockdep_no_validate__, #lock) |
283 | /* |
283 | /* |
284 | * Compare locking classes |
284 | * Compare locking classes |
285 | */ |
285 | */ |
Line 300... | Line 300... | ||
300 | * 1: read-acquire (no recursion allowed) |
300 | * 1: read-acquire (no recursion allowed) |
301 | * 2: read-acquire with same-instance recursion allowed |
301 | * 2: read-acquire with same-instance recursion allowed |
302 | * |
302 | * |
303 | * Values for check: |
303 | * Values for check: |
304 | * |
304 | * |
305 | * 0: disabled |
- | |
306 | * 1: simple checks (freeing, held-at-exit-time, etc.) |
305 | * 0: simple checks (freeing, held-at-exit-time, etc.) |
307 | * 2: full validation |
306 | * 1: full validation |
308 | */ |
307 | */ |
309 | extern void lock_acquire(struct lockdep_map *lock, unsigned int subclass, |
308 | extern void lock_acquire(struct lockdep_map *lock, unsigned int subclass, |
310 | int trylock, int read, int check, |
309 | int trylock, int read, int check, |
311 | struct lockdep_map *nest_lock, unsigned long ip); |
310 | struct lockdep_map *nest_lock, unsigned long ip); |
Line 333... | Line 332... | ||
333 | 332 | ||
Line 334... | Line 333... | ||
334 | # define INIT_LOCKDEP .lockdep_recursion = 0, .lockdep_reclaim_gfp = 0, |
333 | # define INIT_LOCKDEP .lockdep_recursion = 0, .lockdep_reclaim_gfp = 0, |
Line -... | Line 334... | ||
- | 334 | ||
335 | 335 | #define lockdep_depth(tsk) (debug_locks ? (tsk)->lockdep_depth : 0) |
|
- | 336 | ||
- | 337 | #define lockdep_assert_held(l) do { \ |
|
- | 338 | WARN_ON(debug_locks && !lockdep_is_held(l)); \ |
|
Line 336... | Line 339... | ||
336 | #define lockdep_depth(tsk) (debug_locks ? (tsk)->lockdep_depth : 0) |
339 | } while (0) |
Line 337... | Line 340... | ||
337 | 340 | ||
338 | #define lockdep_assert_held(l) WARN_ON(debug_locks && !lockdep_is_held(l)) |
341 | #define lockdep_recursing(tsk) ((tsk)->lockdep_recursion) |
339 | 342 | ||
Line 382... | Line 385... | ||
382 | */ |
385 | */ |
383 | struct lock_class_key { }; |
386 | struct lock_class_key { }; |
Line 384... | Line 387... | ||
384 | 387 | ||
Line 385... | Line 388... | ||
385 | #define lockdep_depth(tsk) (0) |
388 | #define lockdep_depth(tsk) (0) |
Line 386... | Line 389... | ||
386 | 389 | ||
Line 387... | Line 390... | ||
387 | #define lockdep_assert_held(l) do { } while (0) |
390 | #define lockdep_assert_held(l) do { (void)(l); } while (0) |
Line 530... | Line 533... | ||
530 | 533 | ||
531 | #ifdef CONFIG_PROVE_LOCKING |
534 | #ifdef CONFIG_PROVE_LOCKING |
532 | # define might_lock(lock) \ |
535 | # define might_lock(lock) \ |
533 | do { \ |
536 | do { \ |
534 | typecheck(struct lockdep_map *, &(lock)->dep_map); \ |
537 | typecheck(struct lockdep_map *, &(lock)->dep_map); \ |
535 | lock_acquire(&(lock)->dep_map, 0, 0, 0, 2, NULL, _THIS_IP_); \ |
538 | lock_acquire(&(lock)->dep_map, 0, 0, 0, 1, NULL, _THIS_IP_); \ |
536 | lock_release(&(lock)->dep_map, 0, _THIS_IP_); \ |
539 | lock_release(&(lock)->dep_map, 0, _THIS_IP_); \ |
537 | } while (0) |
540 | } while (0) |
538 | # define might_lock_read(lock) \ |
541 | # define might_lock_read(lock) \ |
539 | do { \ |
542 | do { \ |
540 | typecheck(struct lockdep_map *, &(lock)->dep_map); \ |
543 | typecheck(struct lockdep_map *, &(lock)->dep_map); \ |
541 | lock_acquire(&(lock)->dep_map, 0, 0, 1, 2, NULL, _THIS_IP_); \ |
544 | lock_acquire(&(lock)->dep_map, 0, 0, 1, 1, NULL, _THIS_IP_); \ |
542 | lock_release(&(lock)->dep_map, 0, _THIS_IP_); \ |
545 | lock_release(&(lock)->dep_map, 0, _THIS_IP_); \ |
543 | } while (0) |
546 | } while (0) |
544 | #else |
547 | #else |
545 | # define might_lock(lock) do { } while (0) |
548 | # define might_lock(lock) do { } while (0) |