OLD | NEW |
1 // Copyright (c) 2003, Google Inc. | 1 // Copyright (c) 2003, Google Inc. |
2 // All rights reserved. | 2 // All rights reserved. |
3 // | 3 // |
4 // Redistribution and use in source and binary forms, with or without | 4 // Redistribution and use in source and binary forms, with or without |
5 // modification, are permitted provided that the following conditions are | 5 // modification, are permitted provided that the following conditions are |
6 // met: | 6 // met: |
7 // | 7 // |
8 // * Redistributions of source code must retain the above copyright | 8 // * Redistributions of source code must retain the above copyright |
9 // notice, this list of conditions and the following disclaimer. | 9 // notice, this list of conditions and the following disclaimer. |
10 // * Redistributions in binary form must reproduce the above | 10 // * Redistributions in binary form must reproduce the above |
(...skipping 20 matching lines...) Expand all Loading... |
31 // Author: Lei Zhang, Sasha Levitskiy | 31 // Author: Lei Zhang, Sasha Levitskiy |
32 // | 32 // |
33 // This file is an internal atomic implementation, use base/atomicops.h instead. | 33 // This file is an internal atomic implementation, use base/atomicops.h instead. |
34 // | 34 // |
35 // LinuxKernelCmpxchg and Barrier_AtomicIncrement are from Google Gears. | 35 // LinuxKernelCmpxchg and Barrier_AtomicIncrement are from Google Gears. |
36 | 36 |
37 #ifndef BASE_ATOMICOPS_INTERNALS_ARM_GENERIC_H_ | 37 #ifndef BASE_ATOMICOPS_INTERNALS_ARM_GENERIC_H_ |
38 #define BASE_ATOMICOPS_INTERNALS_ARM_GENERIC_H_ | 38 #define BASE_ATOMICOPS_INTERNALS_ARM_GENERIC_H_ |
39 | 39 |
40 #include <stdio.h> | 40 #include <stdio.h> |
41 #include <stdlib.h> | 41 #include "base/abort.h" |
42 #include "base/basictypes.h" | 42 #include "base/basictypes.h" |
43 | 43 |
44 typedef int32_t Atomic32; | 44 typedef int32_t Atomic32; |
45 | 45 |
46 namespace base { | 46 namespace base { |
47 namespace subtle { | 47 namespace subtle { |
48 | 48 |
49 typedef int64_t Atomic64; | 49 typedef int64_t Atomic64; |
50 | 50 |
51 // 0xffff0fc0 is the hard coded address of a function provided by | 51 // 0xffff0fc0 is the hard coded address of a function provided by |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 MemoryBarrier(); | 153 MemoryBarrier(); |
154 return *ptr; | 154 return *ptr; |
155 } | 155 } |
156 | 156 |
157 | 157 |
158 // 64-bit versions are not implemented yet. | 158 // 64-bit versions are not implemented yet. |
159 | 159 |
160 inline void NotImplementedFatalError(const char *function_name) { | 160 inline void NotImplementedFatalError(const char *function_name) { |
161 fprintf(stderr, "64-bit %s() not implemented on this platform\n", | 161 fprintf(stderr, "64-bit %s() not implemented on this platform\n", |
162 function_name); | 162 function_name); |
163 abort(); | 163 tcmalloc::Abort(); |
164 } | 164 } |
165 | 165 |
166 inline Atomic64 NoBarrier_CompareAndSwap(volatile Atomic64* ptr, | 166 inline Atomic64 NoBarrier_CompareAndSwap(volatile Atomic64* ptr, |
167 Atomic64 old_value, | 167 Atomic64 old_value, |
168 Atomic64 new_value) { | 168 Atomic64 new_value) { |
169 NotImplementedFatalError("NoBarrier_CompareAndSwap"); | 169 NotImplementedFatalError("NoBarrier_CompareAndSwap"); |
170 return 0; | 170 return 0; |
171 } | 171 } |
172 | 172 |
173 inline Atomic64 NoBarrier_AtomicExchange(volatile Atomic64* ptr, | 173 inline Atomic64 NoBarrier_AtomicExchange(volatile Atomic64* ptr, |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 Atomic64 old_value, | 226 Atomic64 old_value, |
227 Atomic64 new_value) { | 227 Atomic64 new_value) { |
228 NotImplementedFatalError("Atomic64 Release_CompareAndSwap"); | 228 NotImplementedFatalError("Atomic64 Release_CompareAndSwap"); |
229 return 0; | 229 return 0; |
230 } | 230 } |
231 | 231 |
232 } // namespace base::subtle | 232 } // namespace base::subtle |
233 } // namespace base | 233 } // namespace base |
234 | 234 |
235 #endif // BASE_ATOMICOPS_INTERNALS_ARM_GENERIC_H_ | 235 #endif // BASE_ATOMICOPS_INTERNALS_ARM_GENERIC_H_ |
OLD | NEW |