Chromium Code Reviews| 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 19 matching lines...) Expand all Loading... | |
| 30 // | 30 // |
| 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> |
|
eroman
2012/05/11 03:55:53
[optional] I wander if these headers are needed an
kaiwang
2012/05/11 20:54:59
Done.
| |
| 41 #include <stdlib.h> | 41 #include <stdlib.h> |
| 42 #include "base/abort.h" | |
| 42 #include "base/basictypes.h" | 43 #include "base/basictypes.h" |
| 43 | 44 |
| 44 typedef int32_t Atomic32; | 45 typedef int32_t Atomic32; |
| 45 | 46 |
| 46 namespace base { | 47 namespace base { |
| 47 namespace subtle { | 48 namespace subtle { |
| 48 | 49 |
| 49 typedef int64_t Atomic64; | 50 typedef int64_t Atomic64; |
| 50 | 51 |
| 51 // 0xffff0fc0 is the hard coded address of a function provided by | 52 // 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(); | 154 MemoryBarrier(); |
| 154 return *ptr; | 155 return *ptr; |
| 155 } | 156 } |
| 156 | 157 |
| 157 | 158 |
| 158 // 64-bit versions are not implemented yet. | 159 // 64-bit versions are not implemented yet. |
| 159 | 160 |
| 160 inline void NotImplementedFatalError(const char *function_name) { | 161 inline void NotImplementedFatalError(const char *function_name) { |
| 161 fprintf(stderr, "64-bit %s() not implemented on this platform\n", | 162 fprintf(stderr, "64-bit %s() not implemented on this platform\n", |
| 162 function_name); | 163 function_name); |
| 163 abort(); | 164 Abort(); |
| 164 } | 165 } |
| 165 | 166 |
| 166 inline Atomic64 NoBarrier_CompareAndSwap(volatile Atomic64* ptr, | 167 inline Atomic64 NoBarrier_CompareAndSwap(volatile Atomic64* ptr, |
| 167 Atomic64 old_value, | 168 Atomic64 old_value, |
| 168 Atomic64 new_value) { | 169 Atomic64 new_value) { |
| 169 NotImplementedFatalError("NoBarrier_CompareAndSwap"); | 170 NotImplementedFatalError("NoBarrier_CompareAndSwap"); |
| 170 return 0; | 171 return 0; |
| 171 } | 172 } |
| 172 | 173 |
| 173 inline Atomic64 NoBarrier_AtomicExchange(volatile Atomic64* ptr, | 174 inline Atomic64 NoBarrier_AtomicExchange(volatile Atomic64* ptr, |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 226 Atomic64 old_value, | 227 Atomic64 old_value, |
| 227 Atomic64 new_value) { | 228 Atomic64 new_value) { |
| 228 NotImplementedFatalError("Atomic64 Release_CompareAndSwap"); | 229 NotImplementedFatalError("Atomic64 Release_CompareAndSwap"); |
| 229 return 0; | 230 return 0; |
| 230 } | 231 } |
| 231 | 232 |
| 232 } // namespace base::subtle | 233 } // namespace base::subtle |
| 233 } // namespace base | 234 } // namespace base |
| 234 | 235 |
| 235 #endif // BASE_ATOMICOPS_INTERNALS_ARM_GENERIC_H_ | 236 #endif // BASE_ATOMICOPS_INTERNALS_ARM_GENERIC_H_ |
| OLD | NEW |