mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-24 07:31:41 +00:00
locking/rtmutex: Convert macros to inlines
Inlines are type-safe... Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Signed-off-by: Ingo Molnar <mingo@kernel.org> Link: https://lore.kernel.org/r/20210815211302.610830960@linutronix.de
This commit is contained in:
parent
f07ec52202
commit
785159301b
1 changed files with 27 additions and 4 deletions
|
@ -141,8 +141,19 @@ static __always_inline void fixup_rt_mutex_waiters(struct rt_mutex *lock)
|
||||||
* set up.
|
* set up.
|
||||||
*/
|
*/
|
||||||
#ifndef CONFIG_DEBUG_RT_MUTEXES
|
#ifndef CONFIG_DEBUG_RT_MUTEXES
|
||||||
# define rt_mutex_cmpxchg_acquire(l,c,n) (cmpxchg_acquire(&l->owner, c, n) == c)
|
static __always_inline bool rt_mutex_cmpxchg_acquire(struct rt_mutex *lock,
|
||||||
# define rt_mutex_cmpxchg_release(l,c,n) (cmpxchg_release(&l->owner, c, n) == c)
|
struct task_struct *old,
|
||||||
|
struct task_struct *new)
|
||||||
|
{
|
||||||
|
return cmpxchg_acquire(&lock->owner, old, new) == old;
|
||||||
|
}
|
||||||
|
|
||||||
|
static __always_inline bool rt_mutex_cmpxchg_release(struct rt_mutex *lock,
|
||||||
|
struct task_struct *old,
|
||||||
|
struct task_struct *new)
|
||||||
|
{
|
||||||
|
return cmpxchg_release(&lock->owner, old, new) == old;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Callers must hold the ->wait_lock -- which is the whole purpose as we force
|
* Callers must hold the ->wait_lock -- which is the whole purpose as we force
|
||||||
|
@ -201,8 +212,20 @@ static __always_inline bool unlock_rt_mutex_safe(struct rt_mutex *lock,
|
||||||
}
|
}
|
||||||
|
|
||||||
#else
|
#else
|
||||||
# define rt_mutex_cmpxchg_acquire(l,c,n) (0)
|
static __always_inline bool rt_mutex_cmpxchg_acquire(struct rt_mutex *lock,
|
||||||
# define rt_mutex_cmpxchg_release(l,c,n) (0)
|
struct task_struct *old,
|
||||||
|
struct task_struct *new)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
static __always_inline bool rt_mutex_cmpxchg_release(struct rt_mutex *lock,
|
||||||
|
struct task_struct *old,
|
||||||
|
struct task_struct *new)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
static __always_inline void mark_rt_mutex_waiters(struct rt_mutex *lock)
|
static __always_inline void mark_rt_mutex_waiters(struct rt_mutex *lock)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue