aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/spinlock.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/spinlock.h')
-rw-r--r--include/linux/spinlock.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/include/linux/spinlock.h b/include/linux/spinlock.h
index fd57888d4942..01cda2439feb 100644
--- a/include/linux/spinlock.h
+++ b/include/linux/spinlock.h
@@ -279,7 +279,11 @@ static inline void do_raw_spin_unlock(raw_spinlock_t *lock) __releases(lock)
})
/* Include rwlock functions */
-#include <linux/rwlock.h>
+#ifdef CONFIG_PREEMPT_RT_FULL
+# include <linux/rwlock_rt.h>
+#else
+# include <linux/rwlock.h>
+#endif
/*
* Pull the _spin_*()/_read_*()/_write_*() functions/declarations:
@@ -290,6 +294,10 @@ static inline void do_raw_spin_unlock(raw_spinlock_t *lock) __releases(lock)
# include <linux/spinlock_api_up.h>
#endif
+#ifdef CONFIG_PREEMPT_RT_FULL
+# include <linux/spinlock_rt.h>
+#else /* PREEMPT_RT_FULL */
+
/*
* Map the spin_lock functions to the raw variants for PREEMPT_RT=n
*/
@@ -410,6 +418,8 @@ static __always_inline int spin_is_contended(spinlock_t *lock)
#define assert_spin_locked(lock) assert_raw_spin_locked(&(lock)->rlock)
+#endif /* !PREEMPT_RT_FULL */
+
/*
* Pull the atomic_t declaration:
* (asm-mips/atomic.h needs above definitions)