Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0 |
| 2 | |
| 3 | // Generated by scripts/atomic/gen-atomic-long.sh |
| 4 | // DO NOT MODIFY THIS FILE DIRECTLY |
| 5 | |
Arnd Bergmann | 72099ed | 2009-05-13 22:56:29 +0000 | [diff] [blame] | 6 | #ifndef _ASM_GENERIC_ATOMIC_LONG_H |
| 7 | #define _ASM_GENERIC_ATOMIC_LONG_H |
Christoph Lameter | d3cb487 | 2006-01-06 00:11:20 -0800 | [diff] [blame] | 8 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 9 | #include <linux/compiler.h> |
Andrew Morton | 5998bf1 | 2006-01-08 01:00:29 -0800 | [diff] [blame] | 10 | #include <asm/types.h> |
Christoph Lameter | d3cb487 | 2006-01-06 00:11:20 -0800 | [diff] [blame] | 11 | |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 12 | #ifdef CONFIG_64BIT |
Christoph Lameter | d3cb487 | 2006-01-06 00:11:20 -0800 | [diff] [blame] | 13 | typedef atomic64_t atomic_long_t; |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 14 | #define ATOMIC_LONG_INIT(i) ATOMIC64_INIT(i) |
| 15 | #define atomic_long_cond_read_acquire atomic64_cond_read_acquire |
| 16 | #define atomic_long_cond_read_relaxed atomic64_cond_read_relaxed |
Will Deacon | 586b610 | 2015-08-06 17:54:38 +0100 | [diff] [blame] | 17 | #else |
Christoph Lameter | d3cb487 | 2006-01-06 00:11:20 -0800 | [diff] [blame] | 18 | typedef atomic_t atomic_long_t; |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 19 | #define ATOMIC_LONG_INIT(i) ATOMIC_INIT(i) |
| 20 | #define atomic_long_cond_read_acquire atomic_cond_read_acquire |
| 21 | #define atomic_long_cond_read_relaxed atomic_cond_read_relaxed |
Will Deacon | 586b610 | 2015-08-06 17:54:38 +0100 | [diff] [blame] | 22 | #endif |
| 23 | |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 24 | #ifdef CONFIG_64BIT |
Christoph Lameter | d3cb487 | 2006-01-06 00:11:20 -0800 | [diff] [blame] | 25 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 26 | static __always_inline long |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 27 | atomic_long_read(const atomic_long_t *v) |
Christoph Lameter | d3cb487 | 2006-01-06 00:11:20 -0800 | [diff] [blame] | 28 | { |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 29 | return atomic64_read(v); |
Christoph Lameter | d3cb487 | 2006-01-06 00:11:20 -0800 | [diff] [blame] | 30 | } |
| 31 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 32 | static __always_inline long |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 33 | atomic_long_read_acquire(const atomic_long_t *v) |
Christoph Lameter | d3cb487 | 2006-01-06 00:11:20 -0800 | [diff] [blame] | 34 | { |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 35 | return atomic64_read_acquire(v); |
Christoph Lameter | d3cb487 | 2006-01-06 00:11:20 -0800 | [diff] [blame] | 36 | } |
| 37 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 38 | static __always_inline void |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 39 | atomic_long_set(atomic_long_t *v, long i) |
Mathieu Desnoyers | bb2382c | 2007-05-08 00:34:19 -0700 | [diff] [blame] | 40 | { |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 41 | atomic64_set(v, i); |
Mathieu Desnoyers | bb2382c | 2007-05-08 00:34:19 -0700 | [diff] [blame] | 42 | } |
| 43 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 44 | static __always_inline void |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 45 | atomic_long_set_release(atomic_long_t *v, long i) |
Mathieu Desnoyers | bb2382c | 2007-05-08 00:34:19 -0700 | [diff] [blame] | 46 | { |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 47 | atomic64_set_release(v, i); |
Mathieu Desnoyers | bb2382c | 2007-05-08 00:34:19 -0700 | [diff] [blame] | 48 | } |
| 49 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 50 | static __always_inline void |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 51 | atomic_long_add(long i, atomic_long_t *v) |
Mathieu Desnoyers | bb2382c | 2007-05-08 00:34:19 -0700 | [diff] [blame] | 52 | { |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 53 | atomic64_add(i, v); |
Mathieu Desnoyers | bb2382c | 2007-05-08 00:34:19 -0700 | [diff] [blame] | 54 | } |
| 55 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 56 | static __always_inline long |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 57 | atomic_long_add_return(long i, atomic_long_t *v) |
Mathieu Desnoyers | bb2382c | 2007-05-08 00:34:19 -0700 | [diff] [blame] | 58 | { |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 59 | return atomic64_add_return(i, v); |
Mathieu Desnoyers | bb2382c | 2007-05-08 00:34:19 -0700 | [diff] [blame] | 60 | } |
| 61 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 62 | static __always_inline long |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 63 | atomic_long_add_return_acquire(long i, atomic_long_t *v) |
Mathieu Desnoyers | 2856f5e | 2007-05-08 00:34:38 -0700 | [diff] [blame] | 64 | { |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 65 | return atomic64_add_return_acquire(i, v); |
Mathieu Desnoyers | 2856f5e | 2007-05-08 00:34:38 -0700 | [diff] [blame] | 66 | } |
Mathieu Desnoyers | bb2382c | 2007-05-08 00:34:19 -0700 | [diff] [blame] | 67 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 68 | static __always_inline long |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 69 | atomic_long_add_return_release(long i, atomic_long_t *v) |
| 70 | { |
| 71 | return atomic64_add_return_release(i, v); |
| 72 | } |
Adrian Bunk | 4b358e2 | 2006-12-06 20:40:28 -0800 | [diff] [blame] | 73 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 74 | static __always_inline long |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 75 | atomic_long_add_return_relaxed(long i, atomic_long_t *v) |
| 76 | { |
| 77 | return atomic64_add_return_relaxed(i, v); |
| 78 | } |
Will Deacon | 4df714b | 2017-10-12 13:20:48 +0100 | [diff] [blame] | 79 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 80 | static __always_inline long |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 81 | atomic_long_fetch_add(long i, atomic_long_t *v) |
| 82 | { |
| 83 | return atomic64_fetch_add(i, v); |
| 84 | } |
| 85 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 86 | static __always_inline long |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 87 | atomic_long_fetch_add_acquire(long i, atomic_long_t *v) |
| 88 | { |
| 89 | return atomic64_fetch_add_acquire(i, v); |
| 90 | } |
| 91 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 92 | static __always_inline long |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 93 | atomic_long_fetch_add_release(long i, atomic_long_t *v) |
| 94 | { |
| 95 | return atomic64_fetch_add_release(i, v); |
| 96 | } |
| 97 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 98 | static __always_inline long |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 99 | atomic_long_fetch_add_relaxed(long i, atomic_long_t *v) |
| 100 | { |
| 101 | return atomic64_fetch_add_relaxed(i, v); |
| 102 | } |
| 103 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 104 | static __always_inline void |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 105 | atomic_long_sub(long i, atomic_long_t *v) |
| 106 | { |
| 107 | atomic64_sub(i, v); |
| 108 | } |
| 109 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 110 | static __always_inline long |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 111 | atomic_long_sub_return(long i, atomic_long_t *v) |
| 112 | { |
| 113 | return atomic64_sub_return(i, v); |
| 114 | } |
| 115 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 116 | static __always_inline long |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 117 | atomic_long_sub_return_acquire(long i, atomic_long_t *v) |
| 118 | { |
| 119 | return atomic64_sub_return_acquire(i, v); |
| 120 | } |
| 121 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 122 | static __always_inline long |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 123 | atomic_long_sub_return_release(long i, atomic_long_t *v) |
| 124 | { |
| 125 | return atomic64_sub_return_release(i, v); |
| 126 | } |
| 127 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 128 | static __always_inline long |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 129 | atomic_long_sub_return_relaxed(long i, atomic_long_t *v) |
| 130 | { |
| 131 | return atomic64_sub_return_relaxed(i, v); |
| 132 | } |
| 133 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 134 | static __always_inline long |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 135 | atomic_long_fetch_sub(long i, atomic_long_t *v) |
| 136 | { |
| 137 | return atomic64_fetch_sub(i, v); |
| 138 | } |
| 139 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 140 | static __always_inline long |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 141 | atomic_long_fetch_sub_acquire(long i, atomic_long_t *v) |
| 142 | { |
| 143 | return atomic64_fetch_sub_acquire(i, v); |
| 144 | } |
| 145 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 146 | static __always_inline long |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 147 | atomic_long_fetch_sub_release(long i, atomic_long_t *v) |
| 148 | { |
| 149 | return atomic64_fetch_sub_release(i, v); |
| 150 | } |
| 151 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 152 | static __always_inline long |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 153 | atomic_long_fetch_sub_relaxed(long i, atomic_long_t *v) |
| 154 | { |
| 155 | return atomic64_fetch_sub_relaxed(i, v); |
| 156 | } |
| 157 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 158 | static __always_inline void |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 159 | atomic_long_inc(atomic_long_t *v) |
| 160 | { |
| 161 | atomic64_inc(v); |
| 162 | } |
| 163 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 164 | static __always_inline long |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 165 | atomic_long_inc_return(atomic_long_t *v) |
| 166 | { |
| 167 | return atomic64_inc_return(v); |
| 168 | } |
| 169 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 170 | static __always_inline long |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 171 | atomic_long_inc_return_acquire(atomic_long_t *v) |
| 172 | { |
| 173 | return atomic64_inc_return_acquire(v); |
| 174 | } |
| 175 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 176 | static __always_inline long |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 177 | atomic_long_inc_return_release(atomic_long_t *v) |
| 178 | { |
| 179 | return atomic64_inc_return_release(v); |
| 180 | } |
| 181 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 182 | static __always_inline long |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 183 | atomic_long_inc_return_relaxed(atomic_long_t *v) |
| 184 | { |
| 185 | return atomic64_inc_return_relaxed(v); |
| 186 | } |
| 187 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 188 | static __always_inline long |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 189 | atomic_long_fetch_inc(atomic_long_t *v) |
| 190 | { |
| 191 | return atomic64_fetch_inc(v); |
| 192 | } |
| 193 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 194 | static __always_inline long |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 195 | atomic_long_fetch_inc_acquire(atomic_long_t *v) |
| 196 | { |
| 197 | return atomic64_fetch_inc_acquire(v); |
| 198 | } |
| 199 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 200 | static __always_inline long |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 201 | atomic_long_fetch_inc_release(atomic_long_t *v) |
| 202 | { |
| 203 | return atomic64_fetch_inc_release(v); |
| 204 | } |
| 205 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 206 | static __always_inline long |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 207 | atomic_long_fetch_inc_relaxed(atomic_long_t *v) |
| 208 | { |
| 209 | return atomic64_fetch_inc_relaxed(v); |
| 210 | } |
| 211 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 212 | static __always_inline void |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 213 | atomic_long_dec(atomic_long_t *v) |
| 214 | { |
| 215 | atomic64_dec(v); |
| 216 | } |
| 217 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 218 | static __always_inline long |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 219 | atomic_long_dec_return(atomic_long_t *v) |
| 220 | { |
| 221 | return atomic64_dec_return(v); |
| 222 | } |
| 223 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 224 | static __always_inline long |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 225 | atomic_long_dec_return_acquire(atomic_long_t *v) |
| 226 | { |
| 227 | return atomic64_dec_return_acquire(v); |
| 228 | } |
| 229 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 230 | static __always_inline long |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 231 | atomic_long_dec_return_release(atomic_long_t *v) |
| 232 | { |
| 233 | return atomic64_dec_return_release(v); |
| 234 | } |
| 235 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 236 | static __always_inline long |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 237 | atomic_long_dec_return_relaxed(atomic_long_t *v) |
| 238 | { |
| 239 | return atomic64_dec_return_relaxed(v); |
| 240 | } |
| 241 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 242 | static __always_inline long |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 243 | atomic_long_fetch_dec(atomic_long_t *v) |
| 244 | { |
| 245 | return atomic64_fetch_dec(v); |
| 246 | } |
| 247 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 248 | static __always_inline long |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 249 | atomic_long_fetch_dec_acquire(atomic_long_t *v) |
| 250 | { |
| 251 | return atomic64_fetch_dec_acquire(v); |
| 252 | } |
| 253 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 254 | static __always_inline long |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 255 | atomic_long_fetch_dec_release(atomic_long_t *v) |
| 256 | { |
| 257 | return atomic64_fetch_dec_release(v); |
| 258 | } |
| 259 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 260 | static __always_inline long |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 261 | atomic_long_fetch_dec_relaxed(atomic_long_t *v) |
| 262 | { |
| 263 | return atomic64_fetch_dec_relaxed(v); |
| 264 | } |
| 265 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 266 | static __always_inline void |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 267 | atomic_long_and(long i, atomic_long_t *v) |
| 268 | { |
| 269 | atomic64_and(i, v); |
| 270 | } |
| 271 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 272 | static __always_inline long |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 273 | atomic_long_fetch_and(long i, atomic_long_t *v) |
| 274 | { |
| 275 | return atomic64_fetch_and(i, v); |
| 276 | } |
| 277 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 278 | static __always_inline long |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 279 | atomic_long_fetch_and_acquire(long i, atomic_long_t *v) |
| 280 | { |
| 281 | return atomic64_fetch_and_acquire(i, v); |
| 282 | } |
| 283 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 284 | static __always_inline long |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 285 | atomic_long_fetch_and_release(long i, atomic_long_t *v) |
| 286 | { |
| 287 | return atomic64_fetch_and_release(i, v); |
| 288 | } |
| 289 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 290 | static __always_inline long |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 291 | atomic_long_fetch_and_relaxed(long i, atomic_long_t *v) |
| 292 | { |
| 293 | return atomic64_fetch_and_relaxed(i, v); |
| 294 | } |
| 295 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 296 | static __always_inline void |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 297 | atomic_long_andnot(long i, atomic_long_t *v) |
| 298 | { |
| 299 | atomic64_andnot(i, v); |
| 300 | } |
| 301 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 302 | static __always_inline long |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 303 | atomic_long_fetch_andnot(long i, atomic_long_t *v) |
| 304 | { |
| 305 | return atomic64_fetch_andnot(i, v); |
| 306 | } |
| 307 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 308 | static __always_inline long |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 309 | atomic_long_fetch_andnot_acquire(long i, atomic_long_t *v) |
| 310 | { |
| 311 | return atomic64_fetch_andnot_acquire(i, v); |
| 312 | } |
| 313 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 314 | static __always_inline long |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 315 | atomic_long_fetch_andnot_release(long i, atomic_long_t *v) |
| 316 | { |
| 317 | return atomic64_fetch_andnot_release(i, v); |
| 318 | } |
| 319 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 320 | static __always_inline long |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 321 | atomic_long_fetch_andnot_relaxed(long i, atomic_long_t *v) |
| 322 | { |
| 323 | return atomic64_fetch_andnot_relaxed(i, v); |
| 324 | } |
| 325 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 326 | static __always_inline void |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 327 | atomic_long_or(long i, atomic_long_t *v) |
| 328 | { |
| 329 | atomic64_or(i, v); |
| 330 | } |
| 331 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 332 | static __always_inline long |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 333 | atomic_long_fetch_or(long i, atomic_long_t *v) |
| 334 | { |
| 335 | return atomic64_fetch_or(i, v); |
| 336 | } |
| 337 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 338 | static __always_inline long |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 339 | atomic_long_fetch_or_acquire(long i, atomic_long_t *v) |
| 340 | { |
| 341 | return atomic64_fetch_or_acquire(i, v); |
| 342 | } |
| 343 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 344 | static __always_inline long |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 345 | atomic_long_fetch_or_release(long i, atomic_long_t *v) |
| 346 | { |
| 347 | return atomic64_fetch_or_release(i, v); |
| 348 | } |
| 349 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 350 | static __always_inline long |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 351 | atomic_long_fetch_or_relaxed(long i, atomic_long_t *v) |
| 352 | { |
| 353 | return atomic64_fetch_or_relaxed(i, v); |
| 354 | } |
| 355 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 356 | static __always_inline void |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 357 | atomic_long_xor(long i, atomic_long_t *v) |
| 358 | { |
| 359 | atomic64_xor(i, v); |
| 360 | } |
| 361 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 362 | static __always_inline long |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 363 | atomic_long_fetch_xor(long i, atomic_long_t *v) |
| 364 | { |
| 365 | return atomic64_fetch_xor(i, v); |
| 366 | } |
| 367 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 368 | static __always_inline long |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 369 | atomic_long_fetch_xor_acquire(long i, atomic_long_t *v) |
| 370 | { |
| 371 | return atomic64_fetch_xor_acquire(i, v); |
| 372 | } |
| 373 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 374 | static __always_inline long |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 375 | atomic_long_fetch_xor_release(long i, atomic_long_t *v) |
| 376 | { |
| 377 | return atomic64_fetch_xor_release(i, v); |
| 378 | } |
| 379 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 380 | static __always_inline long |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 381 | atomic_long_fetch_xor_relaxed(long i, atomic_long_t *v) |
| 382 | { |
| 383 | return atomic64_fetch_xor_relaxed(i, v); |
| 384 | } |
| 385 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 386 | static __always_inline long |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 387 | atomic_long_xchg(atomic_long_t *v, long i) |
| 388 | { |
| 389 | return atomic64_xchg(v, i); |
| 390 | } |
| 391 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 392 | static __always_inline long |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 393 | atomic_long_xchg_acquire(atomic_long_t *v, long i) |
| 394 | { |
| 395 | return atomic64_xchg_acquire(v, i); |
| 396 | } |
| 397 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 398 | static __always_inline long |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 399 | atomic_long_xchg_release(atomic_long_t *v, long i) |
| 400 | { |
| 401 | return atomic64_xchg_release(v, i); |
| 402 | } |
| 403 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 404 | static __always_inline long |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 405 | atomic_long_xchg_relaxed(atomic_long_t *v, long i) |
| 406 | { |
| 407 | return atomic64_xchg_relaxed(v, i); |
| 408 | } |
| 409 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 410 | static __always_inline long |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 411 | atomic_long_cmpxchg(atomic_long_t *v, long old, long new) |
| 412 | { |
| 413 | return atomic64_cmpxchg(v, old, new); |
| 414 | } |
| 415 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 416 | static __always_inline long |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 417 | atomic_long_cmpxchg_acquire(atomic_long_t *v, long old, long new) |
| 418 | { |
| 419 | return atomic64_cmpxchg_acquire(v, old, new); |
| 420 | } |
| 421 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 422 | static __always_inline long |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 423 | atomic_long_cmpxchg_release(atomic_long_t *v, long old, long new) |
| 424 | { |
| 425 | return atomic64_cmpxchg_release(v, old, new); |
| 426 | } |
| 427 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 428 | static __always_inline long |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 429 | atomic_long_cmpxchg_relaxed(atomic_long_t *v, long old, long new) |
| 430 | { |
| 431 | return atomic64_cmpxchg_relaxed(v, old, new); |
| 432 | } |
| 433 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 434 | static __always_inline bool |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 435 | atomic_long_try_cmpxchg(atomic_long_t *v, long *old, long new) |
| 436 | { |
| 437 | return atomic64_try_cmpxchg(v, (s64 *)old, new); |
| 438 | } |
| 439 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 440 | static __always_inline bool |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 441 | atomic_long_try_cmpxchg_acquire(atomic_long_t *v, long *old, long new) |
| 442 | { |
| 443 | return atomic64_try_cmpxchg_acquire(v, (s64 *)old, new); |
| 444 | } |
| 445 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 446 | static __always_inline bool |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 447 | atomic_long_try_cmpxchg_release(atomic_long_t *v, long *old, long new) |
| 448 | { |
| 449 | return atomic64_try_cmpxchg_release(v, (s64 *)old, new); |
| 450 | } |
| 451 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 452 | static __always_inline bool |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 453 | atomic_long_try_cmpxchg_relaxed(atomic_long_t *v, long *old, long new) |
| 454 | { |
| 455 | return atomic64_try_cmpxchg_relaxed(v, (s64 *)old, new); |
| 456 | } |
| 457 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 458 | static __always_inline bool |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 459 | atomic_long_sub_and_test(long i, atomic_long_t *v) |
| 460 | { |
| 461 | return atomic64_sub_and_test(i, v); |
| 462 | } |
| 463 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 464 | static __always_inline bool |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 465 | atomic_long_dec_and_test(atomic_long_t *v) |
| 466 | { |
| 467 | return atomic64_dec_and_test(v); |
| 468 | } |
| 469 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 470 | static __always_inline bool |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 471 | atomic_long_inc_and_test(atomic_long_t *v) |
| 472 | { |
| 473 | return atomic64_inc_and_test(v); |
| 474 | } |
| 475 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 476 | static __always_inline bool |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 477 | atomic_long_add_negative(long i, atomic_long_t *v) |
| 478 | { |
| 479 | return atomic64_add_negative(i, v); |
| 480 | } |
| 481 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 482 | static __always_inline long |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 483 | atomic_long_fetch_add_unless(atomic_long_t *v, long a, long u) |
| 484 | { |
| 485 | return atomic64_fetch_add_unless(v, a, u); |
| 486 | } |
| 487 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 488 | static __always_inline bool |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 489 | atomic_long_add_unless(atomic_long_t *v, long a, long u) |
| 490 | { |
| 491 | return atomic64_add_unless(v, a, u); |
| 492 | } |
| 493 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 494 | static __always_inline bool |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 495 | atomic_long_inc_not_zero(atomic_long_t *v) |
| 496 | { |
| 497 | return atomic64_inc_not_zero(v); |
| 498 | } |
| 499 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 500 | static __always_inline bool |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 501 | atomic_long_inc_unless_negative(atomic_long_t *v) |
| 502 | { |
| 503 | return atomic64_inc_unless_negative(v); |
| 504 | } |
| 505 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 506 | static __always_inline bool |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 507 | atomic_long_dec_unless_positive(atomic_long_t *v) |
| 508 | { |
| 509 | return atomic64_dec_unless_positive(v); |
| 510 | } |
| 511 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 512 | static __always_inline long |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 513 | atomic_long_dec_if_positive(atomic_long_t *v) |
| 514 | { |
| 515 | return atomic64_dec_if_positive(v); |
| 516 | } |
| 517 | |
| 518 | #else /* CONFIG_64BIT */ |
| 519 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 520 | static __always_inline long |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 521 | atomic_long_read(const atomic_long_t *v) |
| 522 | { |
| 523 | return atomic_read(v); |
| 524 | } |
| 525 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 526 | static __always_inline long |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 527 | atomic_long_read_acquire(const atomic_long_t *v) |
| 528 | { |
| 529 | return atomic_read_acquire(v); |
| 530 | } |
| 531 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 532 | static __always_inline void |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 533 | atomic_long_set(atomic_long_t *v, long i) |
| 534 | { |
| 535 | atomic_set(v, i); |
| 536 | } |
| 537 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 538 | static __always_inline void |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 539 | atomic_long_set_release(atomic_long_t *v, long i) |
| 540 | { |
| 541 | atomic_set_release(v, i); |
| 542 | } |
| 543 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 544 | static __always_inline void |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 545 | atomic_long_add(long i, atomic_long_t *v) |
| 546 | { |
| 547 | atomic_add(i, v); |
| 548 | } |
| 549 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 550 | static __always_inline long |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 551 | atomic_long_add_return(long i, atomic_long_t *v) |
| 552 | { |
| 553 | return atomic_add_return(i, v); |
| 554 | } |
| 555 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 556 | static __always_inline long |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 557 | atomic_long_add_return_acquire(long i, atomic_long_t *v) |
| 558 | { |
| 559 | return atomic_add_return_acquire(i, v); |
| 560 | } |
| 561 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 562 | static __always_inline long |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 563 | atomic_long_add_return_release(long i, atomic_long_t *v) |
| 564 | { |
| 565 | return atomic_add_return_release(i, v); |
| 566 | } |
| 567 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 568 | static __always_inline long |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 569 | atomic_long_add_return_relaxed(long i, atomic_long_t *v) |
| 570 | { |
| 571 | return atomic_add_return_relaxed(i, v); |
| 572 | } |
| 573 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 574 | static __always_inline long |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 575 | atomic_long_fetch_add(long i, atomic_long_t *v) |
| 576 | { |
| 577 | return atomic_fetch_add(i, v); |
| 578 | } |
| 579 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 580 | static __always_inline long |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 581 | atomic_long_fetch_add_acquire(long i, atomic_long_t *v) |
| 582 | { |
| 583 | return atomic_fetch_add_acquire(i, v); |
| 584 | } |
| 585 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 586 | static __always_inline long |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 587 | atomic_long_fetch_add_release(long i, atomic_long_t *v) |
| 588 | { |
| 589 | return atomic_fetch_add_release(i, v); |
| 590 | } |
| 591 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 592 | static __always_inline long |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 593 | atomic_long_fetch_add_relaxed(long i, atomic_long_t *v) |
| 594 | { |
| 595 | return atomic_fetch_add_relaxed(i, v); |
| 596 | } |
| 597 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 598 | static __always_inline void |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 599 | atomic_long_sub(long i, atomic_long_t *v) |
| 600 | { |
| 601 | atomic_sub(i, v); |
| 602 | } |
| 603 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 604 | static __always_inline long |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 605 | atomic_long_sub_return(long i, atomic_long_t *v) |
| 606 | { |
| 607 | return atomic_sub_return(i, v); |
| 608 | } |
| 609 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 610 | static __always_inline long |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 611 | atomic_long_sub_return_acquire(long i, atomic_long_t *v) |
| 612 | { |
| 613 | return atomic_sub_return_acquire(i, v); |
| 614 | } |
| 615 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 616 | static __always_inline long |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 617 | atomic_long_sub_return_release(long i, atomic_long_t *v) |
| 618 | { |
| 619 | return atomic_sub_return_release(i, v); |
| 620 | } |
| 621 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 622 | static __always_inline long |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 623 | atomic_long_sub_return_relaxed(long i, atomic_long_t *v) |
| 624 | { |
| 625 | return atomic_sub_return_relaxed(i, v); |
| 626 | } |
| 627 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 628 | static __always_inline long |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 629 | atomic_long_fetch_sub(long i, atomic_long_t *v) |
| 630 | { |
| 631 | return atomic_fetch_sub(i, v); |
| 632 | } |
| 633 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 634 | static __always_inline long |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 635 | atomic_long_fetch_sub_acquire(long i, atomic_long_t *v) |
| 636 | { |
| 637 | return atomic_fetch_sub_acquire(i, v); |
| 638 | } |
| 639 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 640 | static __always_inline long |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 641 | atomic_long_fetch_sub_release(long i, atomic_long_t *v) |
| 642 | { |
| 643 | return atomic_fetch_sub_release(i, v); |
| 644 | } |
| 645 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 646 | static __always_inline long |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 647 | atomic_long_fetch_sub_relaxed(long i, atomic_long_t *v) |
| 648 | { |
| 649 | return atomic_fetch_sub_relaxed(i, v); |
| 650 | } |
| 651 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 652 | static __always_inline void |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 653 | atomic_long_inc(atomic_long_t *v) |
| 654 | { |
| 655 | atomic_inc(v); |
| 656 | } |
| 657 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 658 | static __always_inline long |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 659 | atomic_long_inc_return(atomic_long_t *v) |
| 660 | { |
| 661 | return atomic_inc_return(v); |
| 662 | } |
| 663 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 664 | static __always_inline long |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 665 | atomic_long_inc_return_acquire(atomic_long_t *v) |
| 666 | { |
| 667 | return atomic_inc_return_acquire(v); |
| 668 | } |
| 669 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 670 | static __always_inline long |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 671 | atomic_long_inc_return_release(atomic_long_t *v) |
| 672 | { |
| 673 | return atomic_inc_return_release(v); |
| 674 | } |
| 675 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 676 | static __always_inline long |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 677 | atomic_long_inc_return_relaxed(atomic_long_t *v) |
| 678 | { |
| 679 | return atomic_inc_return_relaxed(v); |
| 680 | } |
| 681 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 682 | static __always_inline long |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 683 | atomic_long_fetch_inc(atomic_long_t *v) |
| 684 | { |
| 685 | return atomic_fetch_inc(v); |
| 686 | } |
| 687 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 688 | static __always_inline long |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 689 | atomic_long_fetch_inc_acquire(atomic_long_t *v) |
| 690 | { |
| 691 | return atomic_fetch_inc_acquire(v); |
| 692 | } |
| 693 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 694 | static __always_inline long |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 695 | atomic_long_fetch_inc_release(atomic_long_t *v) |
| 696 | { |
| 697 | return atomic_fetch_inc_release(v); |
| 698 | } |
| 699 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 700 | static __always_inline long |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 701 | atomic_long_fetch_inc_relaxed(atomic_long_t *v) |
| 702 | { |
| 703 | return atomic_fetch_inc_relaxed(v); |
| 704 | } |
| 705 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 706 | static __always_inline void |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 707 | atomic_long_dec(atomic_long_t *v) |
| 708 | { |
| 709 | atomic_dec(v); |
| 710 | } |
| 711 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 712 | static __always_inline long |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 713 | atomic_long_dec_return(atomic_long_t *v) |
| 714 | { |
| 715 | return atomic_dec_return(v); |
| 716 | } |
| 717 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 718 | static __always_inline long |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 719 | atomic_long_dec_return_acquire(atomic_long_t *v) |
| 720 | { |
| 721 | return atomic_dec_return_acquire(v); |
| 722 | } |
| 723 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 724 | static __always_inline long |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 725 | atomic_long_dec_return_release(atomic_long_t *v) |
| 726 | { |
| 727 | return atomic_dec_return_release(v); |
| 728 | } |
| 729 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 730 | static __always_inline long |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 731 | atomic_long_dec_return_relaxed(atomic_long_t *v) |
| 732 | { |
| 733 | return atomic_dec_return_relaxed(v); |
| 734 | } |
| 735 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 736 | static __always_inline long |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 737 | atomic_long_fetch_dec(atomic_long_t *v) |
| 738 | { |
| 739 | return atomic_fetch_dec(v); |
| 740 | } |
| 741 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 742 | static __always_inline long |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 743 | atomic_long_fetch_dec_acquire(atomic_long_t *v) |
| 744 | { |
| 745 | return atomic_fetch_dec_acquire(v); |
| 746 | } |
| 747 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 748 | static __always_inline long |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 749 | atomic_long_fetch_dec_release(atomic_long_t *v) |
| 750 | { |
| 751 | return atomic_fetch_dec_release(v); |
| 752 | } |
| 753 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 754 | static __always_inline long |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 755 | atomic_long_fetch_dec_relaxed(atomic_long_t *v) |
| 756 | { |
| 757 | return atomic_fetch_dec_relaxed(v); |
| 758 | } |
| 759 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 760 | static __always_inline void |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 761 | atomic_long_and(long i, atomic_long_t *v) |
| 762 | { |
| 763 | atomic_and(i, v); |
| 764 | } |
| 765 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 766 | static __always_inline long |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 767 | atomic_long_fetch_and(long i, atomic_long_t *v) |
| 768 | { |
| 769 | return atomic_fetch_and(i, v); |
| 770 | } |
| 771 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 772 | static __always_inline long |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 773 | atomic_long_fetch_and_acquire(long i, atomic_long_t *v) |
| 774 | { |
| 775 | return atomic_fetch_and_acquire(i, v); |
| 776 | } |
| 777 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 778 | static __always_inline long |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 779 | atomic_long_fetch_and_release(long i, atomic_long_t *v) |
| 780 | { |
| 781 | return atomic_fetch_and_release(i, v); |
| 782 | } |
| 783 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 784 | static __always_inline long |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 785 | atomic_long_fetch_and_relaxed(long i, atomic_long_t *v) |
| 786 | { |
| 787 | return atomic_fetch_and_relaxed(i, v); |
| 788 | } |
| 789 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 790 | static __always_inline void |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 791 | atomic_long_andnot(long i, atomic_long_t *v) |
| 792 | { |
| 793 | atomic_andnot(i, v); |
| 794 | } |
| 795 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 796 | static __always_inline long |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 797 | atomic_long_fetch_andnot(long i, atomic_long_t *v) |
| 798 | { |
| 799 | return atomic_fetch_andnot(i, v); |
| 800 | } |
| 801 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 802 | static __always_inline long |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 803 | atomic_long_fetch_andnot_acquire(long i, atomic_long_t *v) |
| 804 | { |
| 805 | return atomic_fetch_andnot_acquire(i, v); |
| 806 | } |
| 807 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 808 | static __always_inline long |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 809 | atomic_long_fetch_andnot_release(long i, atomic_long_t *v) |
| 810 | { |
| 811 | return atomic_fetch_andnot_release(i, v); |
| 812 | } |
| 813 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 814 | static __always_inline long |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 815 | atomic_long_fetch_andnot_relaxed(long i, atomic_long_t *v) |
| 816 | { |
| 817 | return atomic_fetch_andnot_relaxed(i, v); |
| 818 | } |
| 819 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 820 | static __always_inline void |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 821 | atomic_long_or(long i, atomic_long_t *v) |
| 822 | { |
| 823 | atomic_or(i, v); |
| 824 | } |
| 825 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 826 | static __always_inline long |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 827 | atomic_long_fetch_or(long i, atomic_long_t *v) |
| 828 | { |
| 829 | return atomic_fetch_or(i, v); |
| 830 | } |
| 831 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 832 | static __always_inline long |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 833 | atomic_long_fetch_or_acquire(long i, atomic_long_t *v) |
| 834 | { |
| 835 | return atomic_fetch_or_acquire(i, v); |
| 836 | } |
| 837 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 838 | static __always_inline long |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 839 | atomic_long_fetch_or_release(long i, atomic_long_t *v) |
| 840 | { |
| 841 | return atomic_fetch_or_release(i, v); |
| 842 | } |
| 843 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 844 | static __always_inline long |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 845 | atomic_long_fetch_or_relaxed(long i, atomic_long_t *v) |
| 846 | { |
| 847 | return atomic_fetch_or_relaxed(i, v); |
| 848 | } |
| 849 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 850 | static __always_inline void |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 851 | atomic_long_xor(long i, atomic_long_t *v) |
| 852 | { |
| 853 | atomic_xor(i, v); |
| 854 | } |
| 855 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 856 | static __always_inline long |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 857 | atomic_long_fetch_xor(long i, atomic_long_t *v) |
| 858 | { |
| 859 | return atomic_fetch_xor(i, v); |
| 860 | } |
| 861 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 862 | static __always_inline long |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 863 | atomic_long_fetch_xor_acquire(long i, atomic_long_t *v) |
| 864 | { |
| 865 | return atomic_fetch_xor_acquire(i, v); |
| 866 | } |
| 867 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 868 | static __always_inline long |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 869 | atomic_long_fetch_xor_release(long i, atomic_long_t *v) |
| 870 | { |
| 871 | return atomic_fetch_xor_release(i, v); |
| 872 | } |
| 873 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 874 | static __always_inline long |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 875 | atomic_long_fetch_xor_relaxed(long i, atomic_long_t *v) |
| 876 | { |
| 877 | return atomic_fetch_xor_relaxed(i, v); |
| 878 | } |
| 879 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 880 | static __always_inline long |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 881 | atomic_long_xchg(atomic_long_t *v, long i) |
| 882 | { |
| 883 | return atomic_xchg(v, i); |
| 884 | } |
| 885 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 886 | static __always_inline long |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 887 | atomic_long_xchg_acquire(atomic_long_t *v, long i) |
| 888 | { |
| 889 | return atomic_xchg_acquire(v, i); |
| 890 | } |
| 891 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 892 | static __always_inline long |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 893 | atomic_long_xchg_release(atomic_long_t *v, long i) |
| 894 | { |
| 895 | return atomic_xchg_release(v, i); |
| 896 | } |
| 897 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 898 | static __always_inline long |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 899 | atomic_long_xchg_relaxed(atomic_long_t *v, long i) |
| 900 | { |
| 901 | return atomic_xchg_relaxed(v, i); |
| 902 | } |
| 903 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 904 | static __always_inline long |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 905 | atomic_long_cmpxchg(atomic_long_t *v, long old, long new) |
| 906 | { |
| 907 | return atomic_cmpxchg(v, old, new); |
| 908 | } |
| 909 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 910 | static __always_inline long |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 911 | atomic_long_cmpxchg_acquire(atomic_long_t *v, long old, long new) |
| 912 | { |
| 913 | return atomic_cmpxchg_acquire(v, old, new); |
| 914 | } |
| 915 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 916 | static __always_inline long |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 917 | atomic_long_cmpxchg_release(atomic_long_t *v, long old, long new) |
| 918 | { |
| 919 | return atomic_cmpxchg_release(v, old, new); |
| 920 | } |
| 921 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 922 | static __always_inline long |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 923 | atomic_long_cmpxchg_relaxed(atomic_long_t *v, long old, long new) |
| 924 | { |
| 925 | return atomic_cmpxchg_relaxed(v, old, new); |
| 926 | } |
| 927 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 928 | static __always_inline bool |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 929 | atomic_long_try_cmpxchg(atomic_long_t *v, long *old, long new) |
| 930 | { |
| 931 | return atomic_try_cmpxchg(v, (int *)old, new); |
| 932 | } |
| 933 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 934 | static __always_inline bool |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 935 | atomic_long_try_cmpxchg_acquire(atomic_long_t *v, long *old, long new) |
| 936 | { |
| 937 | return atomic_try_cmpxchg_acquire(v, (int *)old, new); |
| 938 | } |
| 939 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 940 | static __always_inline bool |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 941 | atomic_long_try_cmpxchg_release(atomic_long_t *v, long *old, long new) |
| 942 | { |
| 943 | return atomic_try_cmpxchg_release(v, (int *)old, new); |
| 944 | } |
| 945 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 946 | static __always_inline bool |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 947 | atomic_long_try_cmpxchg_relaxed(atomic_long_t *v, long *old, long new) |
| 948 | { |
| 949 | return atomic_try_cmpxchg_relaxed(v, (int *)old, new); |
| 950 | } |
| 951 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 952 | static __always_inline bool |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 953 | atomic_long_sub_and_test(long i, atomic_long_t *v) |
| 954 | { |
| 955 | return atomic_sub_and_test(i, v); |
| 956 | } |
| 957 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 958 | static __always_inline bool |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 959 | atomic_long_dec_and_test(atomic_long_t *v) |
| 960 | { |
| 961 | return atomic_dec_and_test(v); |
| 962 | } |
| 963 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 964 | static __always_inline bool |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 965 | atomic_long_inc_and_test(atomic_long_t *v) |
| 966 | { |
| 967 | return atomic_inc_and_test(v); |
| 968 | } |
| 969 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 970 | static __always_inline bool |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 971 | atomic_long_add_negative(long i, atomic_long_t *v) |
| 972 | { |
| 973 | return atomic_add_negative(i, v); |
| 974 | } |
| 975 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 976 | static __always_inline long |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 977 | atomic_long_fetch_add_unless(atomic_long_t *v, long a, long u) |
| 978 | { |
| 979 | return atomic_fetch_add_unless(v, a, u); |
| 980 | } |
| 981 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 982 | static __always_inline bool |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 983 | atomic_long_add_unless(atomic_long_t *v, long a, long u) |
| 984 | { |
| 985 | return atomic_add_unless(v, a, u); |
| 986 | } |
| 987 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 988 | static __always_inline bool |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 989 | atomic_long_inc_not_zero(atomic_long_t *v) |
| 990 | { |
| 991 | return atomic_inc_not_zero(v); |
| 992 | } |
| 993 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 994 | static __always_inline bool |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 995 | atomic_long_inc_unless_negative(atomic_long_t *v) |
| 996 | { |
| 997 | return atomic_inc_unless_negative(v); |
| 998 | } |
| 999 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 1000 | static __always_inline bool |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 1001 | atomic_long_dec_unless_positive(atomic_long_t *v) |
| 1002 | { |
| 1003 | return atomic_dec_unless_positive(v); |
| 1004 | } |
| 1005 | |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 1006 | static __always_inline long |
Mark Rutland | b5d47ef | 2018-09-04 11:48:27 +0100 | [diff] [blame] | 1007 | atomic_long_dec_if_positive(atomic_long_t *v) |
| 1008 | { |
| 1009 | return atomic_dec_if_positive(v); |
| 1010 | } |
| 1011 | |
| 1012 | #endif /* CONFIG_64BIT */ |
| 1013 | #endif /* _ASM_GENERIC_ATOMIC_LONG_H */ |
Marco Elver | c020395 | 2019-11-26 15:04:04 +0100 | [diff] [blame] | 1014 | // a624200981f552b2c6be4f32fe44da8289f30d87 |