From: Jeremy Fitzhardinge Date: Fri, 24 Jun 2011 01:19:20 +0000 (-0700) Subject: x86, ticketlock: Use xadd helper X-Git-Tag: next-20110810~12^2~2^2 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=599c3e7724ab4520c6f11857eb953271d365f842;p=karo-tx-linux.git 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 --- 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; }