aboutsummaryrefslogtreecommitdiff
path: root/kernel/spinlock.c
diff options
context:
space:
mode:
authorAndi Kleen <andi@basil.nowhere.org>2006-11-28 20:12:29 +0100
committerAndi Kleen <andi@basil.nowhere.org>2006-11-28 20:12:29 +0100
commita3550a9c543556cf7764be81aeb17c6dab440753 (patch)
treee8c8bf721cc917c8842c4a007ad4b3f68eb7aa1e /kernel/spinlock.c
parent9a14f2964b459c18198ee59ff7212321def82df7 (diff)
parent2ea5814472c3c910aed5c5b60f1f3b1000e353f1 (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
Diffstat (limited to 'kernel/spinlock.c')
-rw-r--r--kernel/spinlock.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/kernel/spinlock.c b/kernel/spinlock.c
index 476c3741511..2c6c2bf8551 100644
--- a/kernel/spinlock.c
+++ b/kernel/spinlock.c
@@ -293,6 +293,27 @@ void __lockfunc _spin_lock_nested(spinlock_t *lock, int subclass)
}
EXPORT_SYMBOL(_spin_lock_nested);
+unsigned long __lockfunc _spin_lock_irqsave_nested(spinlock_t *lock, int subclass)
+{
+ unsigned long flags;
+
+ local_irq_save(flags);
+ preempt_disable();
+ spin_acquire(&lock->dep_map, subclass, 0, _RET_IP_);
+ /*
+ * On lockdep we dont want the hand-coded irq-enable of
+ * _raw_spin_lock_flags() code, because lockdep assumes
+ * that interrupts are not re-enabled during lock-acquire:
+ */
+#ifdef CONFIG_PROVE_SPIN_LOCKING
+ _raw_spin_lock(lock);
+#else
+ _raw_spin_lock_flags(lock, &flags);
+#endif
+ return flags;
+}
+
+EXPORT_SYMBOL(_spin_lock_irqsave_nested);
#endif