From b29902f5859947c66345fcb9dce470a7f45a1d66 Mon Sep 17 00:00:00 2001 From: midipix Date: Sun, 14 Jan 2018 08:01:27 -0500 Subject: atomics: at_store(), at_store_32(), at_store_64(): use a full memory barrier. --- include/ntapi/bits/nt64/nt_atomic_x86_64_asm__gcc.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/ntapi/bits/nt64/nt_atomic_x86_64_asm__gcc.h b/include/ntapi/bits/nt64/nt_atomic_x86_64_asm__gcc.h index d4d4eb0..1e3f10d 100644 --- a/include/ntapi/bits/nt64/nt_atomic_x86_64_asm__gcc.h +++ b/include/ntapi/bits/nt64/nt_atomic_x86_64_asm__gcc.h @@ -459,7 +459,8 @@ static __inline__ void at_store( { __asm__( "mov %1, %0;" - "mfence;" + "lock;" + "orq $0, %0" : "=m" (*dst) : "r" (val) : "memory"); @@ -472,7 +473,8 @@ static __inline__ void at_store_32( { __asm__( "mov %1, %0;" - "mfence;" + "lock;" + "orl $0, %0" : "=m" (*dst) : "r" (val) : "memory"); @@ -485,7 +487,8 @@ static __inline__ void at_store_64( { __asm__( "mov %1, %0;" - "mfence;" + "lock;" + "orq $0, %0" : "=m" (*dst) : "r" (val) : "memory"); -- cgit v1.2.3