hc
2023-12-11 6778948f9de86c3cfaf36725a7c87dcff9ba247f
kernel/include/linux/mutex.h
....@@ -23,20 +23,6 @@
2323
2424 struct ww_acquire_ctx;
2525
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
-
4026 /*
4127 * Simple, straightforward mutexes with strict semantics:
4228 *
....@@ -84,6 +70,14 @@
8470 struct ww_class;
8571 struct ww_acquire_ctx;
8672
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
+
8781 /*
8882 * This is the control structure for tasks blocked on mutex,
8983 * which resides on the blocked task's kernel stack:
....@@ -126,6 +120,16 @@
126120 \
127121 __mutex_init((mutex), #mutex, &__key); \
128122 } 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
129133
130134 #define __MUTEX_INITIALIZER(lockname) \
131135 { .owner = ATOMIC_LONG_INIT(0) \
....@@ -221,7 +225,5 @@
221225 */
222226 extern /* __deprecated */ __must_check enum mutex_trylock_recursive_enum
223227 mutex_trylock_recursive(struct mutex *lock);
224
-
225
-#endif /* !PREEMPT_RT */
226228
227229 #endif /* __LINUX_MUTEX_H */