diff options
author | midipix <writeonce@midipix.org> | 2018-01-14 08:01:27 -0500 |
---|---|---|
committer | midipix <writeonce@midipix.org> | 2018-01-14 08:01:27 -0500 |
commit | b29902f5859947c66345fcb9dce470a7f45a1d66 (patch) | |
tree | 447806f7017c6e89f6c3ba50774191ca40ca063d | |
parent | 3c26f0e5086e7f00eb4318e3874fefc17b2431b9 (diff) | |
download | ntapi-b29902f5859947c66345fcb9dce470a7f45a1d66.tar.bz2 ntapi-b29902f5859947c66345fcb9dce470a7f45a1d66.tar.xz |
atomics: at_store(), at_store_32(), at_store_64(): use a full memory barrier.
-rw-r--r-- | include/ntapi/bits/nt64/nt_atomic_x86_64_asm__gcc.h | 9 |
1 files changed, 6 insertions, 3 deletions
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"); |