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 23 matching lines...) Expand all Loading... |
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__) || NACL_LINUX |
45 #include "native_client/src/include/nacl/atomic_ops.h" | 45 #include "native_client/src/include/gcc/atomic_ops.h" |
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 Loading... |
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_ */ |
OLD | NEW |