aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/x86/lib/atomic64_32.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/arch/x86/lib/atomic64_32.c b/arch/x86/lib/atomic64_32.c
index fd28fd3fb742..cd11803f9448 100644
--- a/arch/x86/lib/atomic64_32.c
+++ b/arch/x86/lib/atomic64_32.c
@@ -62,9 +62,17 @@ void atomic64_set(atomic64_t *ptr, u64 new_val)
62 */ 62 */
63u64 atomic64_read(atomic64_t *ptr) 63u64 atomic64_read(atomic64_t *ptr)
64{ 64{
65 u64 old = 1LL << 32; 65 u64 res;
66 66
67 return cmpxchg8b(&ptr->counter, old, old); 67 asm volatile(
68 "mov %%ebx, %%eax\n\t"
69 "mov %%ecx, %%edx\n\t"
70 LOCK_PREFIX "cmpxchg8b %1\n"
71 : "+A" (res)
72 : "m" (*ptr)
73 );
74
75 return res;
68} 76}
69 77
70/** 78/**