| From | Jeremy Fitzhardinge <> | Subject | [PATCH 8/8] x86/ticketlock: use xadd helper | Date | Thu, 23 Jun 2011 18:19:20 -0700 |
| |
From: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com> --- arch/x86/include/asm/spinlock.h | 9 +-------- 1 files changed, 1 insertions(+), 8 deletions(-)
diff --git a/arch/x86/include/asm/spinlock.h b/arch/x86/include/asm/spinlock.h index dac6fc6..2d14e7c 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; } -- 1.7.5.4
|