lkml.org 
[lkml]   [2011]   [Jun]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 8/8] x86/ticketlock: use xadd helper
    Date
    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


    \
     
     \ /
      Last update: 2011-06-24 03:23    [W:2.368 / U:0.700 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site