.. | .. |
---|
23 | 23 | |
---|
24 | 24 | struct ww_acquire_ctx; |
---|
25 | 25 | |
---|
26 | | -#ifdef CONFIG_DEBUG_LOCK_ALLOC |
---|
27 | | -# define __DEP_MAP_MUTEX_INITIALIZER(lockname) \ |
---|
28 | | - , .dep_map = { \ |
---|
29 | | - .name = #lockname, \ |
---|
30 | | - .wait_type_inner = LD_WAIT_SLEEP, \ |
---|
31 | | - } |
---|
32 | | -#else |
---|
33 | | -# define __DEP_MAP_MUTEX_INITIALIZER(lockname) |
---|
34 | | -#endif |
---|
35 | | - |
---|
36 | | -#ifdef CONFIG_PREEMPT_RT |
---|
37 | | -# include <linux/mutex_rt.h> |
---|
38 | | -#else |
---|
39 | | - |
---|
40 | 26 | /* |
---|
41 | 27 | * Simple, straightforward mutexes with strict semantics: |
---|
42 | 28 | * |
---|
.. | .. |
---|
84 | 70 | struct ww_class; |
---|
85 | 71 | struct ww_acquire_ctx; |
---|
86 | 72 | |
---|
| 73 | +struct ww_mutex { |
---|
| 74 | + struct mutex base; |
---|
| 75 | + struct ww_acquire_ctx *ctx; |
---|
| 76 | +#ifdef CONFIG_DEBUG_MUTEXES |
---|
| 77 | + struct ww_class *ww_class; |
---|
| 78 | +#endif |
---|
| 79 | +}; |
---|
| 80 | + |
---|
87 | 81 | /* |
---|
88 | 82 | * This is the control structure for tasks blocked on mutex, |
---|
89 | 83 | * which resides on the blocked task's kernel stack: |
---|
.. | .. |
---|
126 | 120 | \ |
---|
127 | 121 | __mutex_init((mutex), #mutex, &__key); \ |
---|
128 | 122 | } while (0) |
---|
| 123 | + |
---|
| 124 | +#ifdef CONFIG_DEBUG_LOCK_ALLOC |
---|
| 125 | +# define __DEP_MAP_MUTEX_INITIALIZER(lockname) \ |
---|
| 126 | + , .dep_map = { \ |
---|
| 127 | + .name = #lockname, \ |
---|
| 128 | + .wait_type_inner = LD_WAIT_SLEEP, \ |
---|
| 129 | + } |
---|
| 130 | +#else |
---|
| 131 | +# define __DEP_MAP_MUTEX_INITIALIZER(lockname) |
---|
| 132 | +#endif |
---|
129 | 133 | |
---|
130 | 134 | #define __MUTEX_INITIALIZER(lockname) \ |
---|
131 | 135 | { .owner = ATOMIC_LONG_INIT(0) \ |
---|
.. | .. |
---|
221 | 225 | */ |
---|
222 | 226 | extern /* __deprecated */ __must_check enum mutex_trylock_recursive_enum |
---|
223 | 227 | mutex_trylock_recursive(struct mutex *lock); |
---|
224 | | - |
---|
225 | | -#endif /* !PREEMPT_RT */ |
---|
226 | 228 | |
---|
227 | 229 | #endif /* __LINUX_MUTEX_H */ |
---|