diff options
Diffstat (limited to 'include/linux/atomic.h')
-rw-r--r-- | include/linux/atomic.h | 100 |
1 files changed, 99 insertions, 1 deletions
diff --git a/include/linux/atomic.h b/include/linux/atomic.h index 00a5763e850e..301de78d65f7 100644 --- a/include/linux/atomic.h +++ b/include/linux/atomic.h | |||
@@ -81,6 +81,30 @@ | |||
81 | #endif | 81 | #endif |
82 | #endif /* atomic_add_return_relaxed */ | 82 | #endif /* atomic_add_return_relaxed */ |
83 | 83 | ||
84 | /* atomic_inc_return_relaxed */ | ||
85 | #ifndef atomic_inc_return_relaxed | ||
86 | #define atomic_inc_return_relaxed atomic_inc_return | ||
87 | #define atomic_inc_return_acquire atomic_inc_return | ||
88 | #define atomic_inc_return_release atomic_inc_return | ||
89 | |||
90 | #else /* atomic_inc_return_relaxed */ | ||
91 | |||
92 | #ifndef atomic_inc_return_acquire | ||
93 | #define atomic_inc_return_acquire(...) \ | ||
94 | __atomic_op_acquire(atomic_inc_return, __VA_ARGS__) | ||
95 | #endif | ||
96 | |||
97 | #ifndef atomic_inc_return_release | ||
98 | #define atomic_inc_return_release(...) \ | ||
99 | __atomic_op_release(atomic_inc_return, __VA_ARGS__) | ||
100 | #endif | ||
101 | |||
102 | #ifndef atomic_inc_return | ||
103 | #define atomic_inc_return(...) \ | ||
104 | __atomic_op_fence(atomic_inc_return, __VA_ARGS__) | ||
105 | #endif | ||
106 | #endif /* atomic_inc_return_relaxed */ | ||
107 | |||
84 | /* atomic_sub_return_relaxed */ | 108 | /* atomic_sub_return_relaxed */ |
85 | #ifndef atomic_sub_return_relaxed | 109 | #ifndef atomic_sub_return_relaxed |
86 | #define atomic_sub_return_relaxed atomic_sub_return | 110 | #define atomic_sub_return_relaxed atomic_sub_return |
@@ -105,6 +129,30 @@ | |||
105 | #endif | 129 | #endif |
106 | #endif /* atomic_sub_return_relaxed */ | 130 | #endif /* atomic_sub_return_relaxed */ |
107 | 131 | ||
132 | /* atomic_dec_return_relaxed */ | ||
133 | #ifndef atomic_dec_return_relaxed | ||
134 | #define atomic_dec_return_relaxed atomic_dec_return | ||
135 | #define atomic_dec_return_acquire atomic_dec_return | ||
136 | #define atomic_dec_return_release atomic_dec_return | ||
137 | |||
138 | #else /* atomic_dec_return_relaxed */ | ||
139 | |||
140 | #ifndef atomic_dec_return_acquire | ||
141 | #define atomic_dec_return_acquire(...) \ | ||
142 | __atomic_op_acquire(atomic_dec_return, __VA_ARGS__) | ||
143 | #endif | ||
144 | |||
145 | #ifndef atomic_dec_return_release | ||
146 | #define atomic_dec_return_release(...) \ | ||
147 | __atomic_op_release(atomic_dec_return, __VA_ARGS__) | ||
148 | #endif | ||
149 | |||
150 | #ifndef atomic_dec_return | ||
151 | #define atomic_dec_return(...) \ | ||
152 | __atomic_op_fence(atomic_dec_return, __VA_ARGS__) | ||
153 | #endif | ||
154 | #endif /* atomic_dec_return_relaxed */ | ||
155 | |||
108 | /* atomic_xchg_relaxed */ | 156 | /* atomic_xchg_relaxed */ |
109 | #ifndef atomic_xchg_relaxed | 157 | #ifndef atomic_xchg_relaxed |
110 | #define atomic_xchg_relaxed atomic_xchg | 158 | #define atomic_xchg_relaxed atomic_xchg |
@@ -185,6 +233,31 @@ | |||
185 | #endif | 233 | #endif |
186 | #endif /* atomic64_add_return_relaxed */ | 234 | #endif /* atomic64_add_return_relaxed */ |
187 | 235 | ||
236 | /* atomic64_inc_return_relaxed */ | ||
237 | #ifndef atomic64_inc_return_relaxed | ||
238 | #define atomic64_inc_return_relaxed atomic64_inc_return | ||
239 | #define atomic64_inc_return_acquire atomic64_inc_return | ||
240 | #define atomic64_inc_return_release atomic64_inc_return | ||
241 | |||
242 | #else /* atomic64_inc_return_relaxed */ | ||
243 | |||
244 | #ifndef atomic64_inc_return_acquire | ||
245 | #define atomic64_inc_return_acquire(...) \ | ||
246 | __atomic_op_acquire(atomic64_inc_return, __VA_ARGS__) | ||
247 | #endif | ||
248 | |||
249 | #ifndef atomic64_inc_return_release | ||
250 | #define atomic64_inc_return_release(...) \ | ||
251 | __atomic_op_release(atomic64_inc_return, __VA_ARGS__) | ||
252 | #endif | ||
253 | |||
254 | #ifndef atomic64_inc_return | ||
255 | #define atomic64_inc_return(...) \ | ||
256 | __atomic_op_fence(atomic64_inc_return, __VA_ARGS__) | ||
257 | #endif | ||
258 | #endif /* atomic64_inc_return_relaxed */ | ||
259 | |||
260 | |||
188 | /* atomic64_sub_return_relaxed */ | 261 | /* atomic64_sub_return_relaxed */ |
189 | #ifndef atomic64_sub_return_relaxed | 262 | #ifndef atomic64_sub_return_relaxed |
190 | #define atomic64_sub_return_relaxed atomic64_sub_return | 263 | #define atomic64_sub_return_relaxed atomic64_sub_return |
@@ -209,6 +282,30 @@ | |||
209 | #endif | 282 | #endif |
210 | #endif /* atomic64_sub_return_relaxed */ | 283 | #endif /* atomic64_sub_return_relaxed */ |
211 | 284 | ||
285 | /* atomic64_dec_return_relaxed */ | ||
286 | #ifndef atomic64_dec_return_relaxed | ||
287 | #define atomic64_dec_return_relaxed atomic64_dec_return | ||
288 | #define atomic64_dec_return_acquire atomic64_dec_return | ||
289 | #define atomic64_dec_return_release atomic64_dec_return | ||
290 | |||
291 | #else /* atomic64_dec_return_relaxed */ | ||
292 | |||
293 | #ifndef atomic64_dec_return_acquire | ||
294 | #define atomic64_dec_return_acquire(...) \ | ||
295 | __atomic_op_acquire(atomic64_dec_return, __VA_ARGS__) | ||
296 | #endif | ||
297 | |||
298 | #ifndef atomic64_dec_return_release | ||
299 | #define atomic64_dec_return_release(...) \ | ||
300 | __atomic_op_release(atomic64_dec_return, __VA_ARGS__) | ||
301 | #endif | ||
302 | |||
303 | #ifndef atomic64_dec_return | ||
304 | #define atomic64_dec_return(...) \ | ||
305 | __atomic_op_fence(atomic64_dec_return, __VA_ARGS__) | ||
306 | #endif | ||
307 | #endif /* atomic64_dec_return_relaxed */ | ||
308 | |||
212 | /* atomic64_xchg_relaxed */ | 309 | /* atomic64_xchg_relaxed */ |
213 | #ifndef atomic64_xchg_relaxed | 310 | #ifndef atomic64_xchg_relaxed |
214 | #define atomic64_xchg_relaxed atomic64_xchg | 311 | #define atomic64_xchg_relaxed atomic64_xchg |
@@ -451,7 +548,6 @@ static inline int atomic_dec_if_positive(atomic_t *v) | |||
451 | } | 548 | } |
452 | #endif | 549 | #endif |
453 | 550 | ||
454 | #include <asm-generic/atomic-long.h> | ||
455 | #ifdef CONFIG_GENERIC_ATOMIC64 | 551 | #ifdef CONFIG_GENERIC_ATOMIC64 |
456 | #include <asm-generic/atomic64.h> | 552 | #include <asm-generic/atomic64.h> |
457 | #endif | 553 | #endif |
@@ -463,4 +559,6 @@ static inline void atomic64_andnot(long long i, atomic64_t *v) | |||
463 | } | 559 | } |
464 | #endif | 560 | #endif |
465 | 561 | ||
562 | #include <asm-generic/atomic-long.h> | ||
563 | |||
466 | #endif /* _LINUX_ATOMIC_H */ | 564 | #endif /* _LINUX_ATOMIC_H */ |