diff options
author | deanm@chromium.org <deanm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-27 21:17:23 +0000 |
---|---|---|
committer | deanm@chromium.org <deanm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-27 21:17:23 +0000 |
commit | 616f9a1ec13b57aa1d6ca18a2b919cdaed41764a (patch) | |
tree | d252135ac55ccd9be85efbc945bb21b20fa230e9 /base/atomicops_internals_x86_gcc.h | |
parent | 6a97494def7709561e5874c53e797243c95cb7d5 (diff) | |
download | chromium_src-616f9a1ec13b57aa1d6ca18a2b919cdaed41764a.zip chromium_src-616f9a1ec13b57aa1d6ca18a2b919cdaed41764a.tar.gz chromium_src-616f9a1ec13b57aa1d6ca18a2b919cdaed41764a.tar.bz2 |
Some base/ progress towards building on Linux x86-64.
- Use long for int64 (still 64 bits) to avoid annoying nspr clash.
- Fix some incorrect define guards and add some functions to atomicops.
Review URL: http://codereview.chromium.org/159428
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21709 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/atomicops_internals_x86_gcc.h')
-rw-r--r-- | base/atomicops_internals_x86_gcc.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/base/atomicops_internals_x86_gcc.h b/base/atomicops_internals_x86_gcc.h index f523f6f7..002734b2b 100644 --- a/base/atomicops_internals_x86_gcc.h +++ b/base/atomicops_internals_x86_gcc.h @@ -238,6 +238,23 @@ inline Atomic64 Release_Load(volatile const Atomic64* ptr) { MemoryBarrier(); return *ptr; } + +inline Atomic64 Acquire_CompareAndSwap(volatile Atomic64* ptr, + Atomic64 old_value, + Atomic64 new_value) { + Atomic64 x = NoBarrier_CompareAndSwap(ptr, old_value, new_value); + if (AtomicOps_Internalx86CPUFeatures.has_amd_lock_mb_bug) { + __asm__ __volatile__("lfence" : : : "memory"); + } + return x; +} + +inline Atomic64 Release_CompareAndSwap(volatile Atomic64* ptr, + Atomic64 old_value, + Atomic64 new_value) { + return NoBarrier_CompareAndSwap(ptr, old_value, new_value); +} + #endif // defined(__x86_64__) } // namespace base::subtle |