diff options
author | Nicolas Pitre <nicolas.pitre@linaro.org> | 2017-08-01 00:31:32 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2017-08-01 08:36:35 -0400 |
commit | bc2eecd7ecce40af43b6eb3d256b6076257df846 (patch) | |
tree | d4189369c4484b144f9cb3d72455ac3a5207dd37 /kernel/locking/rtmutex_common.h | |
parent | f06e8c584fa0d05312c11ea66194f3d2efb93c21 (diff) |
futex: Allow for compiling out PI support
This makes it possible to preserve basic futex support and compile out the
PI support when RT mutexes are not available.
Signed-off-by: Nicolas Pitre <nico@linaro.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Darren Hart <dvhart@infradead.org>
Link: http://lkml.kernel.org/r/alpine.LFD.2.20.1708010024190.5981@knanqh.ubzr
Diffstat (limited to 'kernel/locking/rtmutex_common.h')
-rw-r--r-- | kernel/locking/rtmutex_common.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/kernel/locking/rtmutex_common.h b/kernel/locking/rtmutex_common.h index 72ad45a9a794..8d039b928d61 100644 --- a/kernel/locking/rtmutex_common.h +++ b/kernel/locking/rtmutex_common.h | |||
@@ -40,6 +40,9 @@ struct rt_mutex_waiter { | |||
40 | /* | 40 | /* |
41 | * Various helpers to access the waiters-tree: | 41 | * Various helpers to access the waiters-tree: |
42 | */ | 42 | */ |
43 | |||
44 | #ifdef CONFIG_RT_MUTEXES | ||
45 | |||
43 | static inline int rt_mutex_has_waiters(struct rt_mutex *lock) | 46 | static inline int rt_mutex_has_waiters(struct rt_mutex *lock) |
44 | { | 47 | { |
45 | return !RB_EMPTY_ROOT(&lock->waiters); | 48 | return !RB_EMPTY_ROOT(&lock->waiters); |
@@ -69,6 +72,32 @@ task_top_pi_waiter(struct task_struct *p) | |||
69 | pi_tree_entry); | 72 | pi_tree_entry); |
70 | } | 73 | } |
71 | 74 | ||
75 | #else | ||
76 | |||
77 | static inline int rt_mutex_has_waiters(struct rt_mutex *lock) | ||
78 | { | ||
79 | return false; | ||
80 | } | ||
81 | |||
82 | static inline struct rt_mutex_waiter * | ||
83 | rt_mutex_top_waiter(struct rt_mutex *lock) | ||
84 | { | ||
85 | return NULL; | ||
86 | } | ||
87 | |||
88 | static inline int task_has_pi_waiters(struct task_struct *p) | ||
89 | { | ||
90 | return false; | ||
91 | } | ||
92 | |||
93 | static inline struct rt_mutex_waiter * | ||
94 | task_top_pi_waiter(struct task_struct *p) | ||
95 | { | ||
96 | return NULL; | ||
97 | } | ||
98 | |||
99 | #endif | ||
100 | |||
72 | /* | 101 | /* |
73 | * lock->owner state tracking: | 102 | * lock->owner state tracking: |
74 | */ | 103 | */ |