[PATCH 09/29] x86, xen: Support arch_spin_unlock_irq/flags

Andi Kleen
2013-03-23T01:25:59Z

Add simple implementations of arch_spin_unlock_flags/irq to the Xen
paravirt spinlock code.

Cc: jeremy@goop.org
Signed-off-by: Andi Kleen <ak@linux.intel.com>
---
arch/x86/xen/spinlock.c | 17 +++++++++++++++++
1 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/arch/x86/xen/spinlock.c b/arch/x86/xen/spinlock.c
index f7a080e..4e22520 100644
--- a/arch/x86/xen/spinlock.c
+++ b/arch/x86/xen/spinlock.c
@@ -353,6 +353,21 @@ static void xen_spin_unlock(struct arch_spinlock *lock)
xen_spin_unlock_slow(xl);
}

+/* inline the Xen functions for irqs? */
+
+static void xen_spin_unlock_flags(struct arch_spinlock *lock,
+ unsigned long flags)
+{
+ xen_spin_unlock(lock);
+ local_irq_restore(flags);
+}
+
+static void xen_spin_unlock_irq(struct arch_spinlock *lock)
+{
+ xen_spin_unlock(lock);
+ local_irq_enable();
+}
+
static irqreturn_t dummy_handler(int irq, void *dev_id)
{
BUG();
@@ -395,6 +410,8 @@ void __init xen_init_spinlocks(void)
pv_lock_ops.spin_lock_flags = xen_spin_lock_flags;
pv_lock_ops.spin_trylock = xen_spin_trylock;
pv_lock_ops.spin_unlock = xen_spin_unlock;
+ pv_lock_ops.spin_unlock_flags = xen_spin_unlock_flags;
+ pv_lock_ops.spin_unlock_irq = xen_spin_unlock_irq;
}

#ifdef CONFIG_XEN_DEBUG_FS
--
1.7.7.6