Ingo Molnar | 408894e | 2006-01-09 15:59:20 -0800 | [diff] [blame] | 1 | #ifndef __LINUX_MUTEX_DEBUG_H |
| 2 | #define __LINUX_MUTEX_DEBUG_H |
| 3 | |
David S. Miller | 8b4ad5e | 2006-01-09 21:38:23 -0800 | [diff] [blame] | 4 | #include <linux/linkage.h> |
Ingo Molnar | ef5d470 | 2006-07-03 00:24:55 -0700 | [diff] [blame] | 5 | #include <linux/lockdep.h> |
David S. Miller | 8b4ad5e | 2006-01-09 21:38:23 -0800 | [diff] [blame] | 6 | |
Ingo Molnar | 408894e | 2006-01-09 15:59:20 -0800 | [diff] [blame] | 7 | /* |
| 8 | * Mutexes - debugging helpers: |
| 9 | */ |
| 10 | |
Ingo Molnar | 9a11b49a | 2006-07-03 00:24:33 -0700 | [diff] [blame] | 11 | #define __DEBUG_MUTEX_INITIALIZER(lockname) \ |
| 12 | , .magic = &lockname |
Ingo Molnar | 408894e | 2006-01-09 15:59:20 -0800 | [diff] [blame] | 13 | |
Ingo Molnar | ef5d470 | 2006-07-03 00:24:55 -0700 | [diff] [blame] | 14 | #define mutex_init(mutex) \ |
| 15 | do { \ |
| 16 | static struct lock_class_key __key; \ |
| 17 | \ |
| 18 | __mutex_init((mutex), #mutex, &__key); \ |
| 19 | } while (0) |
Ingo Molnar | 408894e | 2006-01-09 15:59:20 -0800 | [diff] [blame] | 20 | |
| 21 | extern void FASTCALL(mutex_destroy(struct mutex *lock)); |
| 22 | |
Ingo Molnar | 408894e | 2006-01-09 15:59:20 -0800 | [diff] [blame] | 23 | #endif |