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

Side by Side Diff: src/include/gcc/atomic_ops.h

Issue 10913285: Switch NaCl code to use GCC intrinsics for atomic ops. (Closed) Base URL: http://src.chromium.org/native_client/trunk/src/native_client/
Patch Set: Rename the file and correct #ifdef. Created 8 years, 3 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 | « src/include/atomic_ops.h ('k') | src/include/linux/arm/atomic_ops.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 /* 1 /*
2 * Copyright (c) 2011 The Native Client Authors. All rights reserved. 2 * Copyright (c) 2011 The Native Client Authors. All rights reserved.
3 * Use of this source code is governed by a BSD-style license that can be 3 * Use of this source code is governed by a BSD-style license that can be
4 * found in the LICENSE file. 4 * found in the LICENSE file.
5 */ 5 */
6 #ifndef NATIVE_CLIENT_SRC_INCLUDE_NACL_ATOMIC_OPS_H_ 6 #ifndef NATIVE_CLIENT_SRC_INCLUDE_NACL_ATOMIC_OPS_H_
7 #define NATIVE_CLIENT_SRC_INCLUDE_NACL_ATOMIC_OPS_H_ 1 7 #define NATIVE_CLIENT_SRC_INCLUDE_NACL_ATOMIC_OPS_H_ 1
8 8
9 #include "native_client/src/include/portability.h" 9 #include "native_client/src/include/portability.h"
10 #include <stdint.h> 10 #include <stdint.h>
(...skipping 10 matching lines...) Expand all
21 Atomic32 new_value) { 21 Atomic32 new_value) {
22 return __sync_lock_test_and_set(ptr, new_value); 22 return __sync_lock_test_and_set(ptr, new_value);
23 } 23 }
24 24
25 static INLINE Atomic32 AtomicIncrement(volatile Atomic32* ptr, 25 static INLINE Atomic32 AtomicIncrement(volatile Atomic32* ptr,
26 Atomic32 increment) { 26 Atomic32 increment) {
27 return __sync_add_and_fetch(ptr, increment); 27 return __sync_add_and_fetch(ptr, increment);
28 } 28 }
29 29
30 #endif /* NATIVE_CLIENT_SRC_INCLUDE_NACL_ATOMIC_OPS_H_ */ 30 #endif /* NATIVE_CLIENT_SRC_INCLUDE_NACL_ATOMIC_OPS_H_ */
OLDNEW
« no previous file with comments | « src/include/atomic_ops.h ('k') | src/include/linux/arm/atomic_ops.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698