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

Side by Side Diff: src/include/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: Use nacl/atomic_ops.h. 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 | « no previous file | 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 2008, Google Inc. 2 * Copyright 2008, Google Inc.
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 23 matching lines...) Expand all
34 #define NATIVE_CLIENT_SRC_INCLUDE_ATOMIC_OPS_H_ 1 34 #define NATIVE_CLIENT_SRC_INCLUDE_ATOMIC_OPS_H_ 1
35 35
36 /* ------------------------------------------------------------------------ 36 /* ------------------------------------------------------------------------
37 * Include the platform specific implementations of the types 37 * Include the platform specific implementations of the types
38 * and operations listed below. 38 * and operations listed below.
39 * ------------------------------------------------------------------------ 39 * ------------------------------------------------------------------------
40 */ 40 */
41 41
42 #include "native_client/src/include/nacl_base.h" 42 #include "native_client/src/include/nacl_base.h"
43 43
44 #ifdef __native_client__ 44 #if defined(__native_client__) || defined(NACL_LINUX)
Mark Seaborn 2012/09/15 02:53:51 This should be "#if defined(__native_client__) ||
petarj 2012/09/15 23:13:17 Done.
45 #include "native_client/src/include/nacl/atomic_ops.h" 45 #include "native_client/src/include/nacl/atomic_ops.h"
Mark Seaborn 2012/09/15 02:53:51 Could you rename "nacl/atomic_ops.h" to "gcc/atomi
petarj 2012/09/15 23:13:17 Done.
46 #elif NACL_OSX 46 #elif NACL_OSX
47 #include "native_client/src/include/osx/atomic_ops_osx.h" 47 #include "native_client/src/include/osx/atomic_ops_osx.h"
48 #elif NACL_LINUX
49
50 #if NACL_ARCH(NACL_BUILD_ARCH) == NACL_x86
51 #include "native_client/src/include/linux/x86/atomic_ops.h"
52 #elif NACL_ARCH(NACL_BUILD_ARCH) == NACL_arm
53 #include "native_client/src/include/linux/arm/atomic_ops.h"
54 #else
55 #error Unknown platform!
56 #endif
57
58 #elif NACL_WINDOWS 48 #elif NACL_WINDOWS
59 #include "native_client/src/include/win/atomic_ops_win32.h" 49 #include "native_client/src/include/win/atomic_ops_win32.h"
60 #else 50 #else
61 #error You need to implement atomic operations for this architecture 51 #error You need to implement atomic operations for this architecture
62 #endif 52 #endif
63 53
64 /* ------------------------------------------------------------------------ 54 /* ------------------------------------------------------------------------
65 * Interface provided by this module 55 * Interface provided by this module
66 * ------------------------------------------------------------------------ 56 * ------------------------------------------------------------------------
67 */ 57 */
(...skipping 30 matching lines...) Expand all
98 88
99 89
100 /* Atomically increment *ptr by "increment". Returns the new value of 90 /* Atomically increment *ptr by "increment". Returns the new value of
101 * *ptr with the increment applied. This routine implies no memory 91 * *ptr with the increment applied. This routine implies no memory
102 * barriers. 92 * barriers.
103 */ 93 */
104 static INLINE Atomic32 94 static INLINE Atomic32
105 AtomicIncrement(volatile Atomic32* ptr, Atomic32 increment); 95 AtomicIncrement(volatile Atomic32* ptr, Atomic32 increment);
106 96
107 #endif /* NATIVE_CLIENT_SRC_INCLUDE_ATOMIC_OPS_H_ */ 97 #endif /* NATIVE_CLIENT_SRC_INCLUDE_ATOMIC_OPS_H_ */
OLDNEW
« no previous file with comments | « no previous file | src/include/linux/arm/atomic_ops.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698