diff options
author | Sebastian Andrzej Siewior <bigeasy@linutronix.de> | 2016-05-27 15:11:51 +0200 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2016-07-12 17:00:28 -0400 |
commit | d90a745aa361ecba9051870de4d6fae88069677f (patch) | |
tree | 7cddb767ee6cdae986949d149b5de01851712b50 | |
parent | 31a1d2c85694e09d6f74d1ed2f2d1fd9e45f0f63 (diff) | |
download | linux-rt-d90a745aa361ecba9051870de4d6fae88069677f.tar.gz |
locallock: add local_lock_on()
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
-rw-r--r-- | include/linux/locallock.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/locallock.h b/include/linux/locallock.h index 21653e9bfa20..015271ff8ec8 100644 --- a/include/linux/locallock.h +++ b/include/linux/locallock.h @@ -66,6 +66,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)) { @@ -104,6 +107,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); |