Messages in this thread Patch in this message | | | From | Jeremy Fitzhardinge <> | Subject | [PATCH 08/15] x86/ticketlock: use xadd helper | Date | Mon, 22 Aug 2011 16:15:04 -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 4857dee..05fd59e 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.6
| |