Greg Kroah-Hartman | b244131 | 2017-11-01 15:07:57 +0100 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
Arnd Bergmann | 72099ed | 2009-05-13 22:56:29 +0000 | [diff] [blame] | 2 | #ifndef _ASM_GENERIC_ATOMIC_LONG_H |
| 3 | #define _ASM_GENERIC_ATOMIC_LONG_H |
Christoph Lameter | d3cb487 | 2006-01-06 00:11:20 -0800 | [diff] [blame] | 4 | /* |
| 5 | * Copyright (C) 2005 Silicon Graphics, Inc. |
Christoph Lameter | cde5353 | 2008-07-04 09:59:22 -0700 | [diff] [blame] | 6 | * Christoph Lameter |
Christoph Lameter | d3cb487 | 2006-01-06 00:11:20 -0800 | [diff] [blame] | 7 | * |
| 8 | * Allows to provide arch independent atomic definitions without the need to |
| 9 | * edit all arch specific atomic.h files. |
| 10 | */ |
| 11 | |
Andrew Morton | 5998bf1 | 2006-01-08 01:00:29 -0800 | [diff] [blame] | 12 | #include <asm/types.h> |
Christoph Lameter | d3cb487 | 2006-01-06 00:11:20 -0800 | [diff] [blame] | 13 | |
| 14 | /* |
| 15 | * Suppport for atomic_long_t |
| 16 | * |
| 17 | * Casts for parameters are avoided for existing atomic functions in order to |
| 18 | * avoid issues with cast-as-lval under gcc 4.x and other limitations that the |
| 19 | * macros of a platform may have. |
| 20 | */ |
| 21 | |
| 22 | #if BITS_PER_LONG == 64 |
| 23 | |
| 24 | typedef atomic64_t atomic_long_t; |
| 25 | |
| 26 | #define ATOMIC_LONG_INIT(i) ATOMIC64_INIT(i) |
Will Deacon | 586b610 | 2015-08-06 17:54:38 +0100 | [diff] [blame] | 27 | #define ATOMIC_LONG_PFX(x) atomic64 ## x |
Peter Zijlstra | c427f69 | 2018-04-05 11:05:35 +0200 | [diff] [blame] | 28 | #define ATOMIC_LONG_TYPE s64 |
Christoph Lameter | d3cb487 | 2006-01-06 00:11:20 -0800 | [diff] [blame] | 29 | |
Will Deacon | 586b610 | 2015-08-06 17:54:38 +0100 | [diff] [blame] | 30 | #else |
Christoph Lameter | d3cb487 | 2006-01-06 00:11:20 -0800 | [diff] [blame] | 31 | |
| 32 | typedef atomic_t atomic_long_t; |
| 33 | |
| 34 | #define ATOMIC_LONG_INIT(i) ATOMIC_INIT(i) |
Will Deacon | 586b610 | 2015-08-06 17:54:38 +0100 | [diff] [blame] | 35 | #define ATOMIC_LONG_PFX(x) atomic ## x |
Peter Zijlstra | c427f69 | 2018-04-05 11:05:35 +0200 | [diff] [blame] | 36 | #define ATOMIC_LONG_TYPE int |
Will Deacon | 586b610 | 2015-08-06 17:54:38 +0100 | [diff] [blame] | 37 | |
| 38 | #endif |
| 39 | |
Will Deacon | 6d79ef2 | 2015-08-06 17:54:39 +0100 | [diff] [blame] | 40 | #define ATOMIC_LONG_READ_OP(mo) \ |
Peter Zijlstra | e3e72ab | 2015-09-18 13:22:52 +0200 | [diff] [blame] | 41 | static inline long atomic_long_read##mo(const atomic_long_t *l) \ |
Will Deacon | 6d79ef2 | 2015-08-06 17:54:39 +0100 | [diff] [blame] | 42 | { \ |
| 43 | ATOMIC_LONG_PFX(_t) *v = (ATOMIC_LONG_PFX(_t) *)l; \ |
| 44 | \ |
| 45 | return (long)ATOMIC_LONG_PFX(_read##mo)(v); \ |
Christoph Lameter | d3cb487 | 2006-01-06 00:11:20 -0800 | [diff] [blame] | 46 | } |
Will Deacon | 6d79ef2 | 2015-08-06 17:54:39 +0100 | [diff] [blame] | 47 | ATOMIC_LONG_READ_OP() |
| 48 | ATOMIC_LONG_READ_OP(_acquire) |
Christoph Lameter | d3cb487 | 2006-01-06 00:11:20 -0800 | [diff] [blame] | 49 | |
Will Deacon | 6d79ef2 | 2015-08-06 17:54:39 +0100 | [diff] [blame] | 50 | #undef ATOMIC_LONG_READ_OP |
Christoph Lameter | d3cb487 | 2006-01-06 00:11:20 -0800 | [diff] [blame] | 51 | |
Will Deacon | 6d79ef2 | 2015-08-06 17:54:39 +0100 | [diff] [blame] | 52 | #define ATOMIC_LONG_SET_OP(mo) \ |
| 53 | static inline void atomic_long_set##mo(atomic_long_t *l, long i) \ |
| 54 | { \ |
| 55 | ATOMIC_LONG_PFX(_t) *v = (ATOMIC_LONG_PFX(_t) *)l; \ |
| 56 | \ |
| 57 | ATOMIC_LONG_PFX(_set##mo)(v, i); \ |
Christoph Lameter | d3cb487 | 2006-01-06 00:11:20 -0800 | [diff] [blame] | 58 | } |
Will Deacon | 6d79ef2 | 2015-08-06 17:54:39 +0100 | [diff] [blame] | 59 | ATOMIC_LONG_SET_OP() |
| 60 | ATOMIC_LONG_SET_OP(_release) |
| 61 | |
| 62 | #undef ATOMIC_LONG_SET_OP |
| 63 | |
| 64 | #define ATOMIC_LONG_ADD_SUB_OP(op, mo) \ |
| 65 | static inline long \ |
| 66 | atomic_long_##op##_return##mo(long i, atomic_long_t *l) \ |
| 67 | { \ |
| 68 | ATOMIC_LONG_PFX(_t) *v = (ATOMIC_LONG_PFX(_t) *)l; \ |
| 69 | \ |
| 70 | return (long)ATOMIC_LONG_PFX(_##op##_return##mo)(i, v); \ |
| 71 | } |
| 72 | ATOMIC_LONG_ADD_SUB_OP(add,) |
| 73 | ATOMIC_LONG_ADD_SUB_OP(add, _relaxed) |
| 74 | ATOMIC_LONG_ADD_SUB_OP(add, _acquire) |
| 75 | ATOMIC_LONG_ADD_SUB_OP(add, _release) |
| 76 | ATOMIC_LONG_ADD_SUB_OP(sub,) |
| 77 | ATOMIC_LONG_ADD_SUB_OP(sub, _relaxed) |
| 78 | ATOMIC_LONG_ADD_SUB_OP(sub, _acquire) |
| 79 | ATOMIC_LONG_ADD_SUB_OP(sub, _release) |
| 80 | |
| 81 | #undef ATOMIC_LONG_ADD_SUB_OP |
| 82 | |
| 83 | #define atomic_long_cmpxchg_relaxed(l, old, new) \ |
| 84 | (ATOMIC_LONG_PFX(_cmpxchg_relaxed)((ATOMIC_LONG_PFX(_t) *)(l), \ |
| 85 | (old), (new))) |
| 86 | #define atomic_long_cmpxchg_acquire(l, old, new) \ |
| 87 | (ATOMIC_LONG_PFX(_cmpxchg_acquire)((ATOMIC_LONG_PFX(_t) *)(l), \ |
| 88 | (old), (new))) |
| 89 | #define atomic_long_cmpxchg_release(l, old, new) \ |
| 90 | (ATOMIC_LONG_PFX(_cmpxchg_release)((ATOMIC_LONG_PFX(_t) *)(l), \ |
| 91 | (old), (new))) |
| 92 | #define atomic_long_cmpxchg(l, old, new) \ |
| 93 | (ATOMIC_LONG_PFX(_cmpxchg)((ATOMIC_LONG_PFX(_t) *)(l), (old), (new))) |
| 94 | |
Peter Zijlstra | c427f69 | 2018-04-05 11:05:35 +0200 | [diff] [blame] | 95 | |
| 96 | #define atomic_long_try_cmpxchg_relaxed(l, old, new) \ |
| 97 | (ATOMIC_LONG_PFX(_try_cmpxchg_relaxed)((ATOMIC_LONG_PFX(_t) *)(l), \ |
| 98 | (ATOMIC_LONG_TYPE *)(old), (ATOMIC_LONG_TYPE)(new))) |
| 99 | #define atomic_long_try_cmpxchg_acquire(l, old, new) \ |
| 100 | (ATOMIC_LONG_PFX(_try_cmpxchg_acquire)((ATOMIC_LONG_PFX(_t) *)(l), \ |
| 101 | (ATOMIC_LONG_TYPE *)(old), (ATOMIC_LONG_TYPE)(new))) |
| 102 | #define atomic_long_try_cmpxchg_release(l, old, new) \ |
| 103 | (ATOMIC_LONG_PFX(_try_cmpxchg_release)((ATOMIC_LONG_PFX(_t) *)(l), \ |
| 104 | (ATOMIC_LONG_TYPE *)(old), (ATOMIC_LONG_TYPE)(new))) |
| 105 | #define atomic_long_try_cmpxchg(l, old, new) \ |
| 106 | (ATOMIC_LONG_PFX(_try_cmpxchg)((ATOMIC_LONG_PFX(_t) *)(l), \ |
| 107 | (ATOMIC_LONG_TYPE *)(old), (ATOMIC_LONG_TYPE)(new))) |
| 108 | |
| 109 | |
Will Deacon | 6d79ef2 | 2015-08-06 17:54:39 +0100 | [diff] [blame] | 110 | #define atomic_long_xchg_relaxed(v, new) \ |
| 111 | (ATOMIC_LONG_PFX(_xchg_relaxed)((ATOMIC_LONG_PFX(_t) *)(v), (new))) |
| 112 | #define atomic_long_xchg_acquire(v, new) \ |
| 113 | (ATOMIC_LONG_PFX(_xchg_acquire)((ATOMIC_LONG_PFX(_t) *)(v), (new))) |
| 114 | #define atomic_long_xchg_release(v, new) \ |
| 115 | (ATOMIC_LONG_PFX(_xchg_release)((ATOMIC_LONG_PFX(_t) *)(v), (new))) |
| 116 | #define atomic_long_xchg(v, new) \ |
| 117 | (ATOMIC_LONG_PFX(_xchg)((ATOMIC_LONG_PFX(_t) *)(v), (new))) |
Christoph Lameter | d3cb487 | 2006-01-06 00:11:20 -0800 | [diff] [blame] | 118 | |
Denys Vlasenko | a644fdf | 2016-03-17 14:22:41 -0700 | [diff] [blame] | 119 | static __always_inline void atomic_long_inc(atomic_long_t *l) |
Christoph Lameter | d3cb487 | 2006-01-06 00:11:20 -0800 | [diff] [blame] | 120 | { |
Will Deacon | 586b610 | 2015-08-06 17:54:38 +0100 | [diff] [blame] | 121 | ATOMIC_LONG_PFX(_t) *v = (ATOMIC_LONG_PFX(_t) *)l; |
Christoph Lameter | d3cb487 | 2006-01-06 00:11:20 -0800 | [diff] [blame] | 122 | |
Will Deacon | 586b610 | 2015-08-06 17:54:38 +0100 | [diff] [blame] | 123 | ATOMIC_LONG_PFX(_inc)(v); |
Christoph Lameter | d3cb487 | 2006-01-06 00:11:20 -0800 | [diff] [blame] | 124 | } |
| 125 | |
Denys Vlasenko | a644fdf | 2016-03-17 14:22:41 -0700 | [diff] [blame] | 126 | static __always_inline void atomic_long_dec(atomic_long_t *l) |
Christoph Lameter | d3cb487 | 2006-01-06 00:11:20 -0800 | [diff] [blame] | 127 | { |
Will Deacon | 586b610 | 2015-08-06 17:54:38 +0100 | [diff] [blame] | 128 | ATOMIC_LONG_PFX(_t) *v = (ATOMIC_LONG_PFX(_t) *)l; |
Christoph Lameter | d3cb487 | 2006-01-06 00:11:20 -0800 | [diff] [blame] | 129 | |
Will Deacon | 586b610 | 2015-08-06 17:54:38 +0100 | [diff] [blame] | 130 | ATOMIC_LONG_PFX(_dec)(v); |
Christoph Lameter | d3cb487 | 2006-01-06 00:11:20 -0800 | [diff] [blame] | 131 | } |
| 132 | |
Peter Zijlstra | 28aa2bd | 2016-04-18 00:54:38 +0200 | [diff] [blame] | 133 | #define ATOMIC_LONG_FETCH_OP(op, mo) \ |
| 134 | static inline long \ |
| 135 | atomic_long_fetch_##op##mo(long i, atomic_long_t *l) \ |
| 136 | { \ |
| 137 | ATOMIC_LONG_PFX(_t) *v = (ATOMIC_LONG_PFX(_t) *)l; \ |
| 138 | \ |
| 139 | return (long)ATOMIC_LONG_PFX(_fetch_##op##mo)(i, v); \ |
| 140 | } |
| 141 | |
| 142 | ATOMIC_LONG_FETCH_OP(add, ) |
| 143 | ATOMIC_LONG_FETCH_OP(add, _relaxed) |
| 144 | ATOMIC_LONG_FETCH_OP(add, _acquire) |
| 145 | ATOMIC_LONG_FETCH_OP(add, _release) |
| 146 | ATOMIC_LONG_FETCH_OP(sub, ) |
| 147 | ATOMIC_LONG_FETCH_OP(sub, _relaxed) |
| 148 | ATOMIC_LONG_FETCH_OP(sub, _acquire) |
| 149 | ATOMIC_LONG_FETCH_OP(sub, _release) |
| 150 | ATOMIC_LONG_FETCH_OP(and, ) |
| 151 | ATOMIC_LONG_FETCH_OP(and, _relaxed) |
| 152 | ATOMIC_LONG_FETCH_OP(and, _acquire) |
| 153 | ATOMIC_LONG_FETCH_OP(and, _release) |
| 154 | ATOMIC_LONG_FETCH_OP(andnot, ) |
| 155 | ATOMIC_LONG_FETCH_OP(andnot, _relaxed) |
| 156 | ATOMIC_LONG_FETCH_OP(andnot, _acquire) |
| 157 | ATOMIC_LONG_FETCH_OP(andnot, _release) |
| 158 | ATOMIC_LONG_FETCH_OP(or, ) |
| 159 | ATOMIC_LONG_FETCH_OP(or, _relaxed) |
| 160 | ATOMIC_LONG_FETCH_OP(or, _acquire) |
| 161 | ATOMIC_LONG_FETCH_OP(or, _release) |
| 162 | ATOMIC_LONG_FETCH_OP(xor, ) |
| 163 | ATOMIC_LONG_FETCH_OP(xor, _relaxed) |
| 164 | ATOMIC_LONG_FETCH_OP(xor, _acquire) |
| 165 | ATOMIC_LONG_FETCH_OP(xor, _release) |
| 166 | |
Davidlohr Bueso | f066286 | 2016-06-28 14:56:51 -0700 | [diff] [blame] | 167 | #undef ATOMIC_LONG_FETCH_OP |
| 168 | |
| 169 | #define ATOMIC_LONG_FETCH_INC_DEC_OP(op, mo) \ |
| 170 | static inline long \ |
| 171 | atomic_long_fetch_##op##mo(atomic_long_t *l) \ |
| 172 | { \ |
| 173 | ATOMIC_LONG_PFX(_t) *v = (ATOMIC_LONG_PFX(_t) *)l; \ |
| 174 | \ |
| 175 | return (long)ATOMIC_LONG_PFX(_fetch_##op##mo)(v); \ |
| 176 | } |
| 177 | |
| 178 | ATOMIC_LONG_FETCH_INC_DEC_OP(inc,) |
| 179 | ATOMIC_LONG_FETCH_INC_DEC_OP(inc, _relaxed) |
| 180 | ATOMIC_LONG_FETCH_INC_DEC_OP(inc, _acquire) |
| 181 | ATOMIC_LONG_FETCH_INC_DEC_OP(inc, _release) |
| 182 | ATOMIC_LONG_FETCH_INC_DEC_OP(dec,) |
| 183 | ATOMIC_LONG_FETCH_INC_DEC_OP(dec, _relaxed) |
| 184 | ATOMIC_LONG_FETCH_INC_DEC_OP(dec, _acquire) |
| 185 | ATOMIC_LONG_FETCH_INC_DEC_OP(dec, _release) |
| 186 | |
| 187 | #undef ATOMIC_LONG_FETCH_INC_DEC_OP |
| 188 | |
Peter Zijlstra | 90fe651 | 2015-09-18 15:04:59 +0200 | [diff] [blame] | 189 | #define ATOMIC_LONG_OP(op) \ |
Denys Vlasenko | a644fdf | 2016-03-17 14:22:41 -0700 | [diff] [blame] | 190 | static __always_inline void \ |
Peter Zijlstra | 90fe651 | 2015-09-18 15:04:59 +0200 | [diff] [blame] | 191 | atomic_long_##op(long i, atomic_long_t *l) \ |
| 192 | { \ |
| 193 | ATOMIC_LONG_PFX(_t) *v = (ATOMIC_LONG_PFX(_t) *)l; \ |
| 194 | \ |
| 195 | ATOMIC_LONG_PFX(_##op)(i, v); \ |
Christoph Lameter | d3cb487 | 2006-01-06 00:11:20 -0800 | [diff] [blame] | 196 | } |
| 197 | |
Peter Zijlstra | 90fe651 | 2015-09-18 15:04:59 +0200 | [diff] [blame] | 198 | ATOMIC_LONG_OP(add) |
| 199 | ATOMIC_LONG_OP(sub) |
| 200 | ATOMIC_LONG_OP(and) |
Peter Zijlstra | 28aa2bd | 2016-04-18 00:54:38 +0200 | [diff] [blame] | 201 | ATOMIC_LONG_OP(andnot) |
Peter Zijlstra | 90fe651 | 2015-09-18 15:04:59 +0200 | [diff] [blame] | 202 | ATOMIC_LONG_OP(or) |
| 203 | ATOMIC_LONG_OP(xor) |
Christoph Lameter | d3cb487 | 2006-01-06 00:11:20 -0800 | [diff] [blame] | 204 | |
Peter Zijlstra | 90fe651 | 2015-09-18 15:04:59 +0200 | [diff] [blame] | 205 | #undef ATOMIC_LONG_OP |
Christoph Lameter | d3cb487 | 2006-01-06 00:11:20 -0800 | [diff] [blame] | 206 | |
Mathieu Desnoyers | bb2382c | 2007-05-08 00:34:19 -0700 | [diff] [blame] | 207 | static inline int atomic_long_sub_and_test(long i, atomic_long_t *l) |
| 208 | { |
Will Deacon | 586b610 | 2015-08-06 17:54:38 +0100 | [diff] [blame] | 209 | ATOMIC_LONG_PFX(_t) *v = (ATOMIC_LONG_PFX(_t) *)l; |
Mathieu Desnoyers | bb2382c | 2007-05-08 00:34:19 -0700 | [diff] [blame] | 210 | |
Will Deacon | 586b610 | 2015-08-06 17:54:38 +0100 | [diff] [blame] | 211 | return ATOMIC_LONG_PFX(_sub_and_test)(i, v); |
Mathieu Desnoyers | bb2382c | 2007-05-08 00:34:19 -0700 | [diff] [blame] | 212 | } |
| 213 | |
| 214 | static inline int atomic_long_dec_and_test(atomic_long_t *l) |
| 215 | { |
Will Deacon | 586b610 | 2015-08-06 17:54:38 +0100 | [diff] [blame] | 216 | ATOMIC_LONG_PFX(_t) *v = (ATOMIC_LONG_PFX(_t) *)l; |
Mathieu Desnoyers | bb2382c | 2007-05-08 00:34:19 -0700 | [diff] [blame] | 217 | |
Will Deacon | 586b610 | 2015-08-06 17:54:38 +0100 | [diff] [blame] | 218 | return ATOMIC_LONG_PFX(_dec_and_test)(v); |
Mathieu Desnoyers | bb2382c | 2007-05-08 00:34:19 -0700 | [diff] [blame] | 219 | } |
| 220 | |
| 221 | static inline int atomic_long_inc_and_test(atomic_long_t *l) |
| 222 | { |
Will Deacon | 586b610 | 2015-08-06 17:54:38 +0100 | [diff] [blame] | 223 | ATOMIC_LONG_PFX(_t) *v = (ATOMIC_LONG_PFX(_t) *)l; |
Mathieu Desnoyers | bb2382c | 2007-05-08 00:34:19 -0700 | [diff] [blame] | 224 | |
Will Deacon | 586b610 | 2015-08-06 17:54:38 +0100 | [diff] [blame] | 225 | return ATOMIC_LONG_PFX(_inc_and_test)(v); |
Mathieu Desnoyers | bb2382c | 2007-05-08 00:34:19 -0700 | [diff] [blame] | 226 | } |
| 227 | |
| 228 | static inline int atomic_long_add_negative(long i, atomic_long_t *l) |
| 229 | { |
Will Deacon | 586b610 | 2015-08-06 17:54:38 +0100 | [diff] [blame] | 230 | ATOMIC_LONG_PFX(_t) *v = (ATOMIC_LONG_PFX(_t) *)l; |
Mathieu Desnoyers | bb2382c | 2007-05-08 00:34:19 -0700 | [diff] [blame] | 231 | |
Will Deacon | 586b610 | 2015-08-06 17:54:38 +0100 | [diff] [blame] | 232 | return ATOMIC_LONG_PFX(_add_negative)(i, v); |
Mathieu Desnoyers | bb2382c | 2007-05-08 00:34:19 -0700 | [diff] [blame] | 233 | } |
| 234 | |
Davidlohr Bueso | 63ab7bd | 2015-09-30 13:03:11 -0700 | [diff] [blame] | 235 | #define ATOMIC_LONG_INC_DEC_OP(op, mo) \ |
| 236 | static inline long \ |
| 237 | atomic_long_##op##_return##mo(atomic_long_t *l) \ |
| 238 | { \ |
| 239 | ATOMIC_LONG_PFX(_t) *v = (ATOMIC_LONG_PFX(_t) *)l; \ |
| 240 | \ |
| 241 | return (long)ATOMIC_LONG_PFX(_##op##_return##mo)(v); \ |
Mathieu Desnoyers | bb2382c | 2007-05-08 00:34:19 -0700 | [diff] [blame] | 242 | } |
Davidlohr Bueso | 63ab7bd | 2015-09-30 13:03:11 -0700 | [diff] [blame] | 243 | ATOMIC_LONG_INC_DEC_OP(inc,) |
| 244 | ATOMIC_LONG_INC_DEC_OP(inc, _relaxed) |
| 245 | ATOMIC_LONG_INC_DEC_OP(inc, _acquire) |
| 246 | ATOMIC_LONG_INC_DEC_OP(inc, _release) |
| 247 | ATOMIC_LONG_INC_DEC_OP(dec,) |
| 248 | ATOMIC_LONG_INC_DEC_OP(dec, _relaxed) |
| 249 | ATOMIC_LONG_INC_DEC_OP(dec, _acquire) |
| 250 | ATOMIC_LONG_INC_DEC_OP(dec, _release) |
Mathieu Desnoyers | bb2382c | 2007-05-08 00:34:19 -0700 | [diff] [blame] | 251 | |
Davidlohr Bueso | 63ab7bd | 2015-09-30 13:03:11 -0700 | [diff] [blame] | 252 | #undef ATOMIC_LONG_INC_DEC_OP |
Mathieu Desnoyers | bb2382c | 2007-05-08 00:34:19 -0700 | [diff] [blame] | 253 | |
Mathieu Desnoyers | 2856f5e | 2007-05-08 00:34:38 -0700 | [diff] [blame] | 254 | static inline long atomic_long_add_unless(atomic_long_t *l, long a, long u) |
| 255 | { |
Will Deacon | 586b610 | 2015-08-06 17:54:38 +0100 | [diff] [blame] | 256 | ATOMIC_LONG_PFX(_t) *v = (ATOMIC_LONG_PFX(_t) *)l; |
Mathieu Desnoyers | 2856f5e | 2007-05-08 00:34:38 -0700 | [diff] [blame] | 257 | |
Will Deacon | 586b610 | 2015-08-06 17:54:38 +0100 | [diff] [blame] | 258 | return (long)ATOMIC_LONG_PFX(_add_unless)(v, a, u); |
Mathieu Desnoyers | 2856f5e | 2007-05-08 00:34:38 -0700 | [diff] [blame] | 259 | } |
Mathieu Desnoyers | bb2382c | 2007-05-08 00:34:19 -0700 | [diff] [blame] | 260 | |
Will Deacon | 586b610 | 2015-08-06 17:54:38 +0100 | [diff] [blame] | 261 | #define atomic_long_inc_not_zero(l) \ |
| 262 | ATOMIC_LONG_PFX(_inc_not_zero)((ATOMIC_LONG_PFX(_t) *)(l)) |
Adrian Bunk | 4b358e2 | 2006-12-06 20:40:28 -0800 | [diff] [blame] | 263 | |
Will Deacon | fcfdfe30 | 2018-04-26 11:34:15 +0100 | [diff] [blame] | 264 | #define atomic_long_cond_read_relaxed(v, c) \ |
| 265 | ATOMIC_LONG_PFX(_cond_read_relaxed)((ATOMIC_LONG_PFX(_t) *)(v), (c)) |
Will Deacon | 4df714b | 2017-10-12 13:20:48 +0100 | [diff] [blame] | 266 | #define atomic_long_cond_read_acquire(v, c) \ |
| 267 | ATOMIC_LONG_PFX(_cond_read_acquire)((ATOMIC_LONG_PFX(_t) *)(v), (c)) |
| 268 | |
Arnd Bergmann | 72099ed | 2009-05-13 22:56:29 +0000 | [diff] [blame] | 269 | #endif /* _ASM_GENERIC_ATOMIC_LONG_H */ |