diff options
author | midipix <writeonce@midipix.org> | 2015-08-03 14:21:54 +0300 |
---|---|---|
committer | midipix <writeonce@midipix.org> | 2015-09-26 11:16:39 -0400 |
commit | ca62e58b621c8423338a9fe404100726c4f134e6 (patch) | |
tree | 156e15c258c5146dc04a502ab658039f29b8d1da /include/ntapi/bits/x86_64 | |
parent | dfd2ede4f6225c3bc1f7cee5c0dc40bfccef408c (diff) | |
download | ntapi-ca62e58b621c8423338a9fe404100726c4f134e6.tar.bz2 ntapi-ca62e58b621c8423338a9fe404100726c4f134e6.tar.xz |
+ fix the atomic store functions to include a full memory barrier.
+ rewrite at_store_64 for i386 as a wrapper around a 64-bit cas operation.
Diffstat (limited to 'include/ntapi/bits/x86_64')
-rw-r--r-- | include/ntapi/bits/x86_64/nt_atomic_x86_64_asm__gcc.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/include/ntapi/bits/x86_64/nt_atomic_x86_64_asm__gcc.h b/include/ntapi/bits/x86_64/nt_atomic_x86_64_asm__gcc.h index 84b9575..d4d4eb0 100644 --- a/include/ntapi/bits/x86_64/nt_atomic_x86_64_asm__gcc.h +++ b/include/ntapi/bits/x86_64/nt_atomic_x86_64_asm__gcc.h @@ -458,7 +458,8 @@ static __inline__ void at_store( intptr_t val) { __asm__( - "mov %1, %0" + "mov %1, %0;" + "mfence;" : "=m" (*dst) : "r" (val) : "memory"); @@ -470,7 +471,8 @@ static __inline__ void at_store_32( int32_t val) { __asm__( - "mov %1, %0" + "mov %1, %0;" + "mfence;" : "=m" (*dst) : "r" (val) : "memory"); @@ -482,7 +484,8 @@ static __inline__ void at_store_64( int64_t val) { __asm__( - "mov %1, %0" + "mov %1, %0;" + "mfence;" : "=m" (*dst) : "r" (val) : "memory"); |