Skip to contentSkip to conversation

x86: use LOCK_PREFIX consistently in tick spin lock code

PATCH New Jan Beulich 1 participant 1 message Aug 29, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86: use LOCK_PREFIX consistently in tick spin lock code

---
 include/asm-x86/spinlock.h |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
include/asm-x86/spinlock.h +6 -6
@@ -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)