| .. | .. |
|---|
| 14 | 14 | #define __LINUX_RT_MUTEX_H |
|---|
| 15 | 15 | |
|---|
| 16 | 16 | #include <linux/linkage.h> |
|---|
| 17 | +#include <linux/spinlock_types_raw.h> |
|---|
| 17 | 18 | #include <linux/rbtree.h> |
|---|
| 18 | | -#include <linux/spinlock_types.h> |
|---|
| 19 | 19 | |
|---|
| 20 | 20 | extern int max_lock_depth; /* for sysctl */ |
|---|
| 21 | + |
|---|
| 22 | +#ifdef CONFIG_DEBUG_MUTEXES |
|---|
| 23 | +#include <linux/debug_locks.h> |
|---|
| 24 | +#endif |
|---|
| 21 | 25 | |
|---|
| 22 | 26 | /** |
|---|
| 23 | 27 | * The rt_mutex structure |
|---|
| .. | .. |
|---|
| 31 | 35 | raw_spinlock_t wait_lock; |
|---|
| 32 | 36 | struct rb_root_cached waiters; |
|---|
| 33 | 37 | struct task_struct *owner; |
|---|
| 34 | | -#ifdef CONFIG_DEBUG_RT_MUTEXES |
|---|
| 35 | 38 | int save_state; |
|---|
| 39 | +#ifdef CONFIG_DEBUG_RT_MUTEXES |
|---|
| 36 | 40 | const char *name, *file; |
|---|
| 37 | 41 | int line; |
|---|
| 38 | 42 | void *magic; |
|---|
| .. | .. |
|---|
| 82 | 86 | #define __DEP_MAP_RT_MUTEX_INITIALIZER(mutexname) |
|---|
| 83 | 87 | #endif |
|---|
| 84 | 88 | |
|---|
| 85 | | -#define __RT_MUTEX_INITIALIZER(mutexname) \ |
|---|
| 86 | | - { .wait_lock = __RAW_SPIN_LOCK_UNLOCKED(mutexname.wait_lock) \ |
|---|
| 89 | +#define __RT_MUTEX_INITIALIZER_PLAIN(mutexname) \ |
|---|
| 90 | + .wait_lock = __RAW_SPIN_LOCK_UNLOCKED(mutexname.wait_lock) \ |
|---|
| 87 | 91 | , .waiters = RB_ROOT_CACHED \ |
|---|
| 88 | 92 | , .owner = NULL \ |
|---|
| 89 | 93 | __DEBUG_RT_MUTEX_INITIALIZER(mutexname) \ |
|---|
| 90 | | - __DEP_MAP_RT_MUTEX_INITIALIZER(mutexname)} |
|---|
| 94 | + __DEP_MAP_RT_MUTEX_INITIALIZER(mutexname) |
|---|
| 95 | + |
|---|
| 96 | +#define __RT_MUTEX_INITIALIZER(mutexname) \ |
|---|
| 97 | + { __RT_MUTEX_INITIALIZER_PLAIN(mutexname) } |
|---|
| 91 | 98 | |
|---|
| 92 | 99 | #define DEFINE_RT_MUTEX(mutexname) \ |
|---|
| 93 | 100 | struct rt_mutex mutexname = __RT_MUTEX_INITIALIZER(mutexname) |
|---|
| 101 | + |
|---|
| 102 | +#define __RT_MUTEX_INITIALIZER_SAVE_STATE(mutexname) \ |
|---|
| 103 | + { __RT_MUTEX_INITIALIZER_PLAIN(mutexname) \ |
|---|
| 104 | + , .save_state = 1 } |
|---|
| 94 | 105 | |
|---|
| 95 | 106 | /** |
|---|
| 96 | 107 | * rt_mutex_is_locked - is the mutex locked |
|---|
| .. | .. |
|---|
| 115 | 126 | #endif |
|---|
| 116 | 127 | |
|---|
| 117 | 128 | extern int rt_mutex_lock_interruptible(struct rt_mutex *lock); |
|---|
| 129 | +extern int rt_mutex_lock_killable(struct rt_mutex *lock); |
|---|
| 118 | 130 | extern int rt_mutex_timed_lock(struct rt_mutex *lock, |
|---|
| 119 | 131 | struct hrtimer_sleeper *timeout); |
|---|
| 120 | 132 | |
|---|