|
20 | 20 | #include <linux/osq_lock.h>
|
21 | 21 | #include <linux/debug_locks.h>
|
22 | 22 | #include <linux/cleanup.h>
|
| 23 | +#include <linux/mutex_types.h> |
23 | 24 |
|
24 | 25 | #ifdef CONFIG_DEBUG_LOCK_ALLOC
|
25 | 26 | # define __DEP_MAP_MUTEX_INITIALIZER(lockname) \
|
|
33 | 34 |
|
34 | 35 | #ifndef CONFIG_PREEMPT_RT
|
35 | 36 |
|
36 |
| -/* |
37 |
| - * Simple, straightforward mutexes with strict semantics: |
38 |
| - * |
39 |
| - * - only one task can hold the mutex at a time |
40 |
| - * - only the owner can unlock the mutex |
41 |
| - * - multiple unlocks are not permitted |
42 |
| - * - recursive locking is not permitted |
43 |
| - * - a mutex object must be initialized via the API |
44 |
| - * - a mutex object must not be initialized via memset or copying |
45 |
| - * - task may not exit with mutex held |
46 |
| - * - memory areas where held locks reside must not be freed |
47 |
| - * - held mutexes must not be reinitialized |
48 |
| - * - mutexes may not be used in hardware or software interrupt |
49 |
| - * contexts such as tasklets and timers |
50 |
| - * |
51 |
| - * These semantics are fully enforced when DEBUG_MUTEXES is |
52 |
| - * enabled. Furthermore, besides enforcing the above rules, the mutex |
53 |
| - * debugging code also implements a number of additional features |
54 |
| - * that make lock debugging easier and faster: |
55 |
| - * |
56 |
| - * - uses symbolic names of mutexes, whenever they are printed in debug output |
57 |
| - * - point-of-acquire tracking, symbolic lookup of function names |
58 |
| - * - list of all locks held in the system, printout of them |
59 |
| - * - owner tracking |
60 |
| - * - detects self-recursing locks and prints out all relevant info |
61 |
| - * - detects multi-task circular deadlocks and prints out all affected |
62 |
| - * locks and tasks (and only those tasks) |
63 |
| - */ |
64 |
| -struct mutex { |
65 |
| - atomic_long_t owner; |
66 |
| - raw_spinlock_t wait_lock; |
67 |
| -#ifdef CONFIG_MUTEX_SPIN_ON_OWNER |
68 |
| - struct optimistic_spin_queue osq; /* Spinner MCS lock */ |
69 |
| -#endif |
70 |
| - struct list_head wait_list; |
71 |
| -#ifdef CONFIG_DEBUG_MUTEXES |
72 |
| - void *magic; |
73 |
| -#endif |
74 |
| -#ifdef CONFIG_DEBUG_LOCK_ALLOC |
75 |
| - struct lockdep_map dep_map; |
76 |
| -#endif |
77 |
| -}; |
78 |
| - |
79 | 37 | #ifdef CONFIG_DEBUG_MUTEXES
|
80 | 38 |
|
81 | 39 | #define __DEBUG_MUTEX_INITIALIZER(lockname) \
|
@@ -131,14 +89,6 @@ extern bool mutex_is_locked(struct mutex *lock);
|
131 | 89 | /*
|
132 | 90 | * Preempt-RT variant based on rtmutexes.
|
133 | 91 | */
|
134 |
| -#include <linux/rtmutex.h> |
135 |
| - |
136 |
| -struct mutex { |
137 |
| - struct rt_mutex_base rtmutex; |
138 |
| -#ifdef CONFIG_DEBUG_LOCK_ALLOC |
139 |
| - struct lockdep_map dep_map; |
140 |
| -#endif |
141 |
| -}; |
142 | 92 |
|
143 | 93 | #define __MUTEX_INITIALIZER(mutexname) \
|
144 | 94 | { \
|
|
0 commit comments