aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2011-06-15 11:02:21 +0200
committerSteven Rostedt <rostedt@rostedt.homelinux.com>2013-11-19 22:03:57 -0500
commit91b295aac5b73faa4d9bb72d282957fe4231cb7b (patch)
treeae4acf0805873cda5b2ce671fcf60636bbcd4be9 /include
parente923279b6f11ad96e9e02e9ac907d91cb2f40a07 (diff)
lglocks-rt.patch
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'include')
-rw-r--r--include/linux/lglock.h19
1 files changed, 17 insertions, 2 deletions
diff --git a/include/linux/lglock.h b/include/linux/lglock.h
index 0d24e932db0b..d2c0d6d27163 100644
--- a/include/linux/lglock.h
+++ b/include/linux/lglock.h
@@ -42,22 +42,37 @@
#endif
struct lglock {
+#ifndef CONFIG_PREEMPT_RT_FULL
arch_spinlock_t __percpu *lock;
+#else
+ struct rt_mutex __percpu *lock;
+#endif
#ifdef CONFIG_DEBUG_LOCK_ALLOC
struct lock_class_key lock_key;
struct lockdep_map lock_dep_map;
#endif
};
-#define DEFINE_LGLOCK(name) \
+#ifndef CONFIG_PREEMPT_RT_FULL
+# define DEFINE_LGLOCK(name) \
static DEFINE_PER_CPU(arch_spinlock_t, name ## _lock) \
= __ARCH_SPIN_LOCK_UNLOCKED; \
struct lglock name = { .lock = &name ## _lock }
-#define DEFINE_STATIC_LGLOCK(name) \
+# define DEFINE_STATIC_LGLOCK(name) \
static DEFINE_PER_CPU(arch_spinlock_t, name ## _lock) \
= __ARCH_SPIN_LOCK_UNLOCKED; \
static struct lglock name = { .lock = &name ## _lock }
+#else
+
+# define DEFINE_LGLOCK(name) \
+ static DEFINE_PER_CPU(struct rt_mutex, name ## _lock); \
+ struct lglock name = { .lock = &name ## _lock }
+
+# define DEFINE_STATIC_LGLOCK(name) \
+ static DEFINE_PER_CPU(struct rt_mutex, name ## _lock); \
+ static struct lglock name = { .lock = &name ## _lock }
+#endif
void lg_lock_init(struct lglock *lg, char *name);
void lg_local_lock(struct lglock *lg);