summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDave Jones <davej@codemonkey.org.uk>2002-11-25 02:35:11 -0800
committerDave Jones <davej@codemonkey.org.uk>2002-11-25 02:35:11 -0800
commit443ac42a17489947f7c3e1e401c8562e6ced62eb (patch)
tree2a8e6a2bb87e0071c20edeb6578c4acb7711161a /include
parent9cb01e6b0454035bad6c2e87b191240722ba35af (diff)
[PATCH] cmpxchg8b needs lock prefix
From 2.4
Diffstat (limited to 'include')
-rw-r--r--include/asm-i386/system.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/include/asm-i386/system.h b/include/asm-i386/system.h
index 5d5588788fe5..fc8f116430bc 100644
--- a/include/asm-i386/system.h
+++ b/include/asm-i386/system.h
@@ -150,6 +150,11 @@ struct __xchg_dummy { unsigned long a[100]; };
* to do an SIMD/3DNOW!/MMX/FPU 64-bit store here, but that
* might have an implicit FPU-save as a cost, so it's not
* clear which path to go.)
+ *
+ * cmpxchg8b must be used with the lock prefix here to allow
+ * the instruction to be executed atomically, see page 3-102
+ * of the instruction set reference 24319102.pdf. We need
+ * the reader side to see the coherent 64bit value.
*/
static inline void __set_64bit (unsigned long long * ptr,
unsigned int low, unsigned int high)
@@ -158,7 +163,7 @@ static inline void __set_64bit (unsigned long long * ptr,
"\n1:\t"
"movl (%0), %%eax\n\t"
"movl 4(%0), %%edx\n\t"
- "cmpxchg8b (%0)\n\t"
+ "lock cmpxchg8b (%0)\n\t"
"jnz 1b"
: /* no outputs */
: "D"(ptr),