public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Jan Beulich" <jbeulich@novell.com>
To: <mingo@elte.hu>, <tglx@linutronix.de>, <hpa@zytor.com>
Cc: "Nick Piggin" <npiggin@suse.de>, <linux-kernel@vger.kernel.org>
Subject: [PATCH] x86: use LOCK_PREFIX consistently in tick spin lock code
Date: Fri, 29 Aug 2008 12:56:57 +0100	[thread overview]
Message-ID: <48B80029.76E4.0078.0@novell.com> (raw)

Signed-off-by: Jan Beulich <jbeulich@novell.com>
Cc: Nick Piggin <npiggin@suse.de>

---
 include/asm-x86/spinlock.h |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

--- linux-2.6.27-rc5/include/asm-x86/spinlock.h	2008-08-21 14:37:34.000000000 +0200
+++ 2.6.27-rc5-x86-spinlock-prefix/include/asm-x86/spinlock.h	2008-08-19 12:43:22.000000000 +0200
@@ -97,8 +97,8 @@ static __always_inline int __ticket_spin
 		     "jne 1f\n\t"
 		     "movw %w0,%w1\n\t"
 		     "incb %h1\n\t"
-		     "lock ; cmpxchgw %w1,%2\n\t"
-		     "1:"
+		     LOCK_PREFIX "cmpxchgw %w1, %2\n"
+		     "1:\t"
 		     "sete %b1\n\t"
 		     "movzbl %b1,%0\n\t"
 		     : "=&a" (tmp), "=Q" (new), "+m" (lock->slock)
@@ -135,9 +135,9 @@ static __always_inline void __ticket_spi
 	int inc = 0x00010000;
 	int tmp;
 
-	asm volatile("lock ; xaddl %0, %1\n"
+	asm volatile(LOCK_PREFIX "xaddl %0, %1\n\t"
 		     "movzwl %w0, %2\n\t"
-		     "shrl $16, %0\n\t"
+		     "shrl $16, %0\n"
 		     "1:\t"
 		     "cmpl %0, %2\n\t"
 		     "je 2f\n\t"
@@ -162,8 +162,8 @@ static __always_inline int __ticket_spin
 		     "cmpl %0,%1\n\t"
 		     "jne 1f\n\t"
 		     "addl $0x00010000, %1\n\t"
-		     "lock ; cmpxchgl %1,%2\n\t"
-		     "1:"
+		     LOCK_PREFIX "cmpxchgl %1, %2\n"
+		     "1:\t"
 		     "sete %b1\n\t"
 		     "movzbl %b1,%0\n\t"
 		     : "=&a" (tmp), "=r" (new), "+m" (lock->slock)




                 reply	other threads:[~2008-08-29 11:55 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=48B80029.76E4.0078.0@novell.com \
    --to=jbeulich@novell.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=npiggin@suse.de \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox