hc
2023-12-09 b22da3d8526a935aa31e086e63f60ff3246cb61c
kernel/include/linux/rtmutex.h
....@@ -14,8 +14,8 @@
1414 #define __LINUX_RT_MUTEX_H
1515
1616 #include <linux/linkage.h>
17
+#include <linux/rbtree_type.h>
1718 #include <linux/spinlock_types_raw.h>
18
-#include <linux/rbtree.h>
1919
2020 extern int max_lock_depth; /* for sysctl */
2121
....@@ -36,11 +36,6 @@
3636 struct rb_root_cached waiters;
3737 struct task_struct *owner;
3838 int save_state;
39
-#ifdef CONFIG_DEBUG_RT_MUTEXES
40
- const char *name, *file;
41
- int line;
42
- void *magic;
43
-#endif
4439 #ifdef CONFIG_DEBUG_LOCK_ALLOC
4540 struct lockdep_map dep_map;
4641 #endif
....@@ -53,6 +48,7 @@
5348 extern int rt_mutex_debug_check_no_locks_freed(const void *from,
5449 unsigned long len);
5550 extern void rt_mutex_debug_check_no_locks_held(struct task_struct *task);
51
+ extern void rt_mutex_debug_task_free(struct task_struct *tsk);
5652 #else
5753 static inline int rt_mutex_debug_check_no_locks_freed(const void *from,
5854 unsigned long len)
....@@ -60,24 +56,14 @@
6056 return 0;
6157 }
6258 # define rt_mutex_debug_check_no_locks_held(task) do { } while (0)
59
+# define rt_mutex_debug_task_free(t) do { } while (0)
6360 #endif
6461
65
-#ifdef CONFIG_DEBUG_RT_MUTEXES
66
-# define __DEBUG_RT_MUTEX_INITIALIZER(mutexname) \
67
- , .name = #mutexname, .file = __FILE__, .line = __LINE__
68
-
69
-# define rt_mutex_init(mutex) \
62
+#define rt_mutex_init(mutex) \
7063 do { \
7164 static struct lock_class_key __key; \
7265 __rt_mutex_init(mutex, __func__, &__key); \
7366 } while (0)
74
-
75
- extern void rt_mutex_debug_task_free(struct task_struct *tsk);
76
-#else
77
-# define __DEBUG_RT_MUTEX_INITIALIZER(mutexname)
78
-# define rt_mutex_init(mutex) __rt_mutex_init(mutex, NULL, NULL)
79
-# define rt_mutex_debug_task_free(t) do { } while (0)
80
-#endif
8167
8268 #ifdef CONFIG_DEBUG_LOCK_ALLOC
8369 #define __DEP_MAP_RT_MUTEX_INITIALIZER(mutexname) \
....@@ -87,21 +73,21 @@
8773 #endif
8874
8975 #define __RT_MUTEX_INITIALIZER_PLAIN(mutexname) \
90
- .wait_lock = __RAW_SPIN_LOCK_UNLOCKED(mutexname.wait_lock) \
76
+ .wait_lock = __RAW_SPIN_LOCK_UNLOCKED(mutexname.wait_lock) \
9177 , .waiters = RB_ROOT_CACHED \
9278 , .owner = NULL \
93
- __DEBUG_RT_MUTEX_INITIALIZER(mutexname) \
9479 __DEP_MAP_RT_MUTEX_INITIALIZER(mutexname)
9580
9681 #define __RT_MUTEX_INITIALIZER(mutexname) \
97
- { __RT_MUTEX_INITIALIZER_PLAIN(mutexname) }
98
-
99
-#define DEFINE_RT_MUTEX(mutexname) \
100
- struct rt_mutex mutexname = __RT_MUTEX_INITIALIZER(mutexname)
82
+ { __RT_MUTEX_INITIALIZER_PLAIN(mutexname) \
83
+ , .save_state = 0 }
10184
10285 #define __RT_MUTEX_INITIALIZER_SAVE_STATE(mutexname) \
10386 { __RT_MUTEX_INITIALIZER_PLAIN(mutexname) \
104
- , .save_state = 1 }
87
+ , .save_state = 1 }
88
+
89
+#define DEFINE_RT_MUTEX(mutexname) \
90
+ struct rt_mutex mutexname = __RT_MUTEX_INITIALIZER(mutexname)
10591
10692 /**
10793 * rt_mutex_is_locked - is the mutex locked
....@@ -126,10 +112,6 @@
126112 #endif
127113
128114 extern int rt_mutex_lock_interruptible(struct rt_mutex *lock);
129
-extern int rt_mutex_lock_killable(struct rt_mutex *lock);
130
-extern int rt_mutex_timed_lock(struct rt_mutex *lock,
131
- struct hrtimer_sleeper *timeout);
132
-
133115 extern int rt_mutex_trylock(struct rt_mutex *lock);
134116
135117 extern void rt_mutex_unlock(struct rt_mutex *lock);