Skip to contentSkip to conversation

Remove redundant LOCK prefix

PATCH In review Jan Kiszka 2 participants 2 messages Aug 23, 2008 Atomic infrastructure

lore
Share & tools
lore

Jan Kiszka

author
#0 lore raw

PATCH 1/1 Remove redundant LOCK prefix

According to Linux and the Intel spec, this prefix is not needed.

---
 include/asm-x86/atomic_32.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/asm-x86/atomic_32.h +1 -1
Index: b/include/asm-x86/atomic_32.h
===================================================================
@@ -64,7 +64,7 @@ struct __xeno_xchg_dummy { unsigned long
 static inline unsigned long xnarch_atomic_xchg (volatile void *ptr,
 						unsigned long x)
 {
-	__asm__ __volatile__(LOCK_PREFIX "xchgl %0,%1"
+	__asm__ __volatile__("xchgl %0,%1"
 			     :"=r" (x)
 			     :"m" (*__xeno_xg(ptr)), "0" (x)
 			     :"memory");
#1 lore raw
Quoted 2 lines · Jan Kiszka

According to Linux and the Intel spec, this prefix is not needed.

Obviously, it's not, since the whole purpose of xchg() is to guarantee bus locking for memory operands anyway. Please merge.

Quoted 26 lines
---
 include/asm-x86/atomic_32.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: b/include/asm-x86/atomic_32.h
===================================================================

include/asm-x86/atomic_32.h +1 -2
@@ -64,7 +64,7 @@ struct __xeno_xchg_dummy { unsigned long
 static inline unsigned long xnarch_atomic_xchg (volatile void *ptr,
 						unsigned long x)
 {
-	__asm__ __volatile__(LOCK_PREFIX "xchgl %0,%1"
+	__asm__ __volatile__("xchgl %0,%1"
 			     :"=r" (x)
 			     :"m" (*__xeno_xg(ptr)), "0" (x)
 			     :"memory");
 
 
 
------------------------------------------------------------------------

_______________________________________________
Xenomai-core mailing list
[email protected]
https://mail.gna.org/listinfo/xenomai-core

Signature · 1 line
Philippe.