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

From: Andi Kleen
Date: Fri Mar 22 2013 - 21:26:50 EST


From: Andi Kleen <ak@xxxxxxxxxxxxxxx>

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

Cc: jeremy@xxxxxxxx
Signed-off-by: Andi Kleen <ak@xxxxxxxxxxxxxxx>
---
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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/