Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(402)

Side by Side Diff: base/atomicops_internals_x86_gcc.h

Issue 159428: Some base/ progress towards building on Linux x86-64. (Closed)
Patch Set: merge Created 11 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « base/atomicops.h ('k') | base/basictypes.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // This file is an internal atomic implementation, use base/atomicops.h instead. 5 // This file is an internal atomic implementation, use base/atomicops.h instead.
6 6
7 #ifndef BASE_ATOMICOPS_INTERNALS_X86_GCC_H_ 7 #ifndef BASE_ATOMICOPS_INTERNALS_X86_GCC_H_
8 #define BASE_ATOMICOPS_INTERNALS_X86_GCC_H_ 8 #define BASE_ATOMICOPS_INTERNALS_X86_GCC_H_
9 9
10 // This struct is not part of the public API of this module; clients may not 10 // This struct is not part of the public API of this module; clients may not
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 // for current AMD/Intel chips as of Jan 2008. 231 // for current AMD/Intel chips as of Jan 2008.
232 // See also Release_Store(), above. 232 // See also Release_Store(), above.
233 ATOMICOPS_COMPILER_BARRIER(); 233 ATOMICOPS_COMPILER_BARRIER();
234 return value; 234 return value;
235 } 235 }
236 236
237 inline Atomic64 Release_Load(volatile const Atomic64* ptr) { 237 inline Atomic64 Release_Load(volatile const Atomic64* ptr) {
238 MemoryBarrier(); 238 MemoryBarrier();
239 return *ptr; 239 return *ptr;
240 } 240 }
241
242 inline Atomic64 Acquire_CompareAndSwap(volatile Atomic64* ptr,
243 Atomic64 old_value,
244 Atomic64 new_value) {
245 Atomic64 x = NoBarrier_CompareAndSwap(ptr, old_value, new_value);
246 if (AtomicOps_Internalx86CPUFeatures.has_amd_lock_mb_bug) {
247 __asm__ __volatile__("lfence" : : : "memory");
248 }
249 return x;
250 }
251
252 inline Atomic64 Release_CompareAndSwap(volatile Atomic64* ptr,
253 Atomic64 old_value,
254 Atomic64 new_value) {
255 return NoBarrier_CompareAndSwap(ptr, old_value, new_value);
256 }
257
241 #endif // defined(__x86_64__) 258 #endif // defined(__x86_64__)
242 259
243 } // namespace base::subtle 260 } // namespace base::subtle
244 } // namespace base 261 } // namespace base
245 262
246 #undef ATOMICOPS_COMPILER_BARRIER 263 #undef ATOMICOPS_COMPILER_BARRIER
247 264
248 #endif // BASE_ATOMICOPS_INTERNALS_X86_GCC_H_ 265 #endif // BASE_ATOMICOPS_INTERNALS_X86_GCC_H_
OLDNEW
« no previous file with comments | « base/atomicops.h ('k') | base/basictypes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698