Jetpack/kernel/kernel-4.9/rt-patches/0080-locallock-add-local_lo...

38 lines
1.2 KiB
Diff
Raw Normal View History

From abeebaf53942ccd1c76a1cc53500b1b8a00831a8 Mon Sep 17 00:00:00 2001
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Date: Fri, 27 May 2016 15:11:51 +0200
Subject: [PATCH 080/352] locallock: add local_lock_on()
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
include/linux/locallock.h | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/include/linux/locallock.h b/include/linux/locallock.h
index 218e5a4..96f22c5 100644
--- a/include/linux/locallock.h
+++ b/include/linux/locallock.h
@@ -60,6 +60,9 @@ static inline void __local_lock(struct local_irq_lock *lv)
#define local_lock(lvar) \
do { __local_lock(&get_local_var(lvar)); } while (0)
+#define local_lock_on(lvar, cpu) \
+ do { __local_lock(&per_cpu(lvar, cpu)); } while (0)
+
static inline int __local_trylock(struct local_irq_lock *lv)
{
if (lv->owner != current && spin_trylock_local(&lv->lock)) {
@@ -98,6 +101,9 @@ static inline void __local_unlock(struct local_irq_lock *lv)
put_local_var(lvar); \
} while (0)
+#define local_unlock_on(lvar, cpu) \
+ do { __local_unlock(&per_cpu(lvar, cpu)); } while (0)
+
static inline void __local_lock_irq(struct local_irq_lock *lv)
{
spin_lock_irqsave(&lv->lock, lv->flags);
--
2.7.4