From 599c3e7724ab4520c6f11857eb953271d365f842 Mon Sep 17 00:00:00 2001 From: Jeremy Fitzhardinge Date: Thu, 23 Jun 2011 18:19:20 -0700 Subject: [PATCH] x86, ticketlock: Use xadd helper Signed-off-by: Jeremy Fitzhardinge Link: http://lkml.kernel.org/r/aa7c94ecfbee05a6b8e455271ba0bb467bf33b2f.1308878118.git.jeremy.fitzhardinge@citrix.com Signed-off-by: H. Peter Anvin --- arch/x86/include/asm/spinlock.h | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/arch/x86/include/asm/spinlock.h b/arch/x86/include/asm/spinlock.h index e07dc41c7c92..da196f1848bf 100644 --- a/arch/x86/include/asm/spinlock.h +++ b/arch/x86/include/asm/spinlock.h @@ -71,14 +71,7 @@ static __always_inline struct __raw_tickets __ticket_spin_claim(struct arch_spin { register struct __raw_tickets tickets = { .tail = 1 }; - if (sizeof(lock->tickets.head) == sizeof(u8)) - asm volatile (LOCK_PREFIX "xaddw %w0, %1\n" - : "+r" (tickets), "+m" (lock->tickets) - : : "memory", "cc"); - else - asm volatile (LOCK_PREFIX "xaddl %0, %1\n" - : "+r" (tickets), "+m" (lock->tickets) - : : "memory", "cc"); + xadd(&lock->tickets, tickets); return tickets; } -- 2.39.5