OLD | NEW |
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 22 matching lines...) Expand all Loading... |
33 #ifndef NATIVE_CLIENT_SRC_INCLUDE_ATOMIC_OPS_H_ | 33 #ifndef NATIVE_CLIENT_SRC_INCLUDE_ATOMIC_OPS_H_ |
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 #include "native_client/src/include/nacl_defines.h" |
43 | 44 |
44 #if defined(__native_client__) || NACL_LINUX | 45 #if defined(__native_client__) || NACL_LINUX |
45 #include "native_client/src/include/gcc/atomic_ops.h" | 46 #include "native_client/src/include/gcc/atomic_ops.h" |
46 #elif NACL_OSX | 47 #elif NACL_OSX |
47 #include "native_client/src/include/osx/atomic_ops_osx.h" | 48 #include "native_client/src/include/osx/atomic_ops_osx.h" |
48 #elif NACL_WINDOWS | 49 #elif NACL_WINDOWS |
49 #include "native_client/src/include/win/atomic_ops_win32.h" | 50 #include "native_client/src/include/win/atomic_ops_win32.h" |
50 #else | 51 #else |
51 #error You need to implement atomic operations for this architecture | 52 #error You need to implement atomic operations for this architecture |
52 #endif | 53 #endif |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 | 89 |
89 | 90 |
90 /* Atomically increment *ptr by "increment". Returns the new value of | 91 /* Atomically increment *ptr by "increment". Returns the new value of |
91 * *ptr with the increment applied. This routine implies no memory | 92 * *ptr with the increment applied. This routine implies no memory |
92 * barriers. | 93 * barriers. |
93 */ | 94 */ |
94 static INLINE Atomic32 | 95 static INLINE Atomic32 |
95 AtomicIncrement(volatile Atomic32* ptr, Atomic32 increment); | 96 AtomicIncrement(volatile Atomic32* ptr, Atomic32 increment); |
96 | 97 |
97 #endif /* NATIVE_CLIENT_SRC_INCLUDE_ATOMIC_OPS_H_ */ | 98 #endif /* NATIVE_CLIENT_SRC_INCLUDE_ATOMIC_OPS_H_ */ |
OLD | NEW |