blob: 073cf40f431b8bc88a01a3aef16cd2698e6e64b5 [file] [log] [blame]
Mark Rutlandb5d47ef2018-09-04 11:48:27 +01001// 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 Bergmann72099ed2009-05-13 22:56:29 +00006#ifndef _ASM_GENERIC_ATOMIC_LONG_H
7#define _ASM_GENERIC_ATOMIC_LONG_H
Christoph Lameterd3cb4872006-01-06 00:11:20 -08008
Marco Elverc0203952019-11-26 15:04:04 +01009#include <linux/compiler.h>
Andrew Morton5998bf12006-01-08 01:00:29 -080010#include <asm/types.h>
Christoph Lameterd3cb4872006-01-06 00:11:20 -080011
Mark Rutlandb5d47ef2018-09-04 11:48:27 +010012#ifdef CONFIG_64BIT
Christoph Lameterd3cb4872006-01-06 00:11:20 -080013typedef atomic64_t atomic_long_t;
Mark Rutlandb5d47ef2018-09-04 11:48:27 +010014#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 Deacon586b6102015-08-06 17:54:38 +010017#else
Christoph Lameterd3cb4872006-01-06 00:11:20 -080018typedef atomic_t atomic_long_t;
Mark Rutlandb5d47ef2018-09-04 11:48:27 +010019#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 Deacon586b6102015-08-06 17:54:38 +010022#endif
23
Mark Rutlandb5d47ef2018-09-04 11:48:27 +010024#ifdef CONFIG_64BIT
Christoph Lameterd3cb4872006-01-06 00:11:20 -080025
Marco Elverc0203952019-11-26 15:04:04 +010026static __always_inline long
Mark Rutlandb5d47ef2018-09-04 11:48:27 +010027atomic_long_read(const atomic_long_t *v)
Christoph Lameterd3cb4872006-01-06 00:11:20 -080028{
Mark Rutlandb5d47ef2018-09-04 11:48:27 +010029 return atomic64_read(v);
Christoph Lameterd3cb4872006-01-06 00:11:20 -080030}
31
Marco Elverc0203952019-11-26 15:04:04 +010032static __always_inline long
Mark Rutlandb5d47ef2018-09-04 11:48:27 +010033atomic_long_read_acquire(const atomic_long_t *v)
Christoph Lameterd3cb4872006-01-06 00:11:20 -080034{
Mark Rutlandb5d47ef2018-09-04 11:48:27 +010035 return atomic64_read_acquire(v);
Christoph Lameterd3cb4872006-01-06 00:11:20 -080036}
37
Marco Elverc0203952019-11-26 15:04:04 +010038static __always_inline void
Mark Rutlandb5d47ef2018-09-04 11:48:27 +010039atomic_long_set(atomic_long_t *v, long i)
Mathieu Desnoyersbb2382c2007-05-08 00:34:19 -070040{
Mark Rutlandb5d47ef2018-09-04 11:48:27 +010041 atomic64_set(v, i);
Mathieu Desnoyersbb2382c2007-05-08 00:34:19 -070042}
43
Marco Elverc0203952019-11-26 15:04:04 +010044static __always_inline void
Mark Rutlandb5d47ef2018-09-04 11:48:27 +010045atomic_long_set_release(atomic_long_t *v, long i)
Mathieu Desnoyersbb2382c2007-05-08 00:34:19 -070046{
Mark Rutlandb5d47ef2018-09-04 11:48:27 +010047 atomic64_set_release(v, i);
Mathieu Desnoyersbb2382c2007-05-08 00:34:19 -070048}
49
Marco Elverc0203952019-11-26 15:04:04 +010050static __always_inline void
Mark Rutlandb5d47ef2018-09-04 11:48:27 +010051atomic_long_add(long i, atomic_long_t *v)
Mathieu Desnoyersbb2382c2007-05-08 00:34:19 -070052{
Mark Rutlandb5d47ef2018-09-04 11:48:27 +010053 atomic64_add(i, v);
Mathieu Desnoyersbb2382c2007-05-08 00:34:19 -070054}
55
Marco Elverc0203952019-11-26 15:04:04 +010056static __always_inline long
Mark Rutlandb5d47ef2018-09-04 11:48:27 +010057atomic_long_add_return(long i, atomic_long_t *v)
Mathieu Desnoyersbb2382c2007-05-08 00:34:19 -070058{
Mark Rutlandb5d47ef2018-09-04 11:48:27 +010059 return atomic64_add_return(i, v);
Mathieu Desnoyersbb2382c2007-05-08 00:34:19 -070060}
61
Marco Elverc0203952019-11-26 15:04:04 +010062static __always_inline long
Mark Rutlandb5d47ef2018-09-04 11:48:27 +010063atomic_long_add_return_acquire(long i, atomic_long_t *v)
Mathieu Desnoyers2856f5e2007-05-08 00:34:38 -070064{
Mark Rutlandb5d47ef2018-09-04 11:48:27 +010065 return atomic64_add_return_acquire(i, v);
Mathieu Desnoyers2856f5e2007-05-08 00:34:38 -070066}
Mathieu Desnoyersbb2382c2007-05-08 00:34:19 -070067
Marco Elverc0203952019-11-26 15:04:04 +010068static __always_inline long
Mark Rutlandb5d47ef2018-09-04 11:48:27 +010069atomic_long_add_return_release(long i, atomic_long_t *v)
70{
71 return atomic64_add_return_release(i, v);
72}
Adrian Bunk4b358e22006-12-06 20:40:28 -080073
Marco Elverc0203952019-11-26 15:04:04 +010074static __always_inline long
Mark Rutlandb5d47ef2018-09-04 11:48:27 +010075atomic_long_add_return_relaxed(long i, atomic_long_t *v)
76{
77 return atomic64_add_return_relaxed(i, v);
78}
Will Deacon4df714b2017-10-12 13:20:48 +010079
Marco Elverc0203952019-11-26 15:04:04 +010080static __always_inline long
Mark Rutlandb5d47ef2018-09-04 11:48:27 +010081atomic_long_fetch_add(long i, atomic_long_t *v)
82{
83 return atomic64_fetch_add(i, v);
84}
85
Marco Elverc0203952019-11-26 15:04:04 +010086static __always_inline long
Mark Rutlandb5d47ef2018-09-04 11:48:27 +010087atomic_long_fetch_add_acquire(long i, atomic_long_t *v)
88{
89 return atomic64_fetch_add_acquire(i, v);
90}
91
Marco Elverc0203952019-11-26 15:04:04 +010092static __always_inline long
Mark Rutlandb5d47ef2018-09-04 11:48:27 +010093atomic_long_fetch_add_release(long i, atomic_long_t *v)
94{
95 return atomic64_fetch_add_release(i, v);
96}
97
Marco Elverc0203952019-11-26 15:04:04 +010098static __always_inline long
Mark Rutlandb5d47ef2018-09-04 11:48:27 +010099atomic_long_fetch_add_relaxed(long i, atomic_long_t *v)
100{
101 return atomic64_fetch_add_relaxed(i, v);
102}
103
Marco Elverc0203952019-11-26 15:04:04 +0100104static __always_inline void
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100105atomic_long_sub(long i, atomic_long_t *v)
106{
107 atomic64_sub(i, v);
108}
109
Marco Elverc0203952019-11-26 15:04:04 +0100110static __always_inline long
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100111atomic_long_sub_return(long i, atomic_long_t *v)
112{
113 return atomic64_sub_return(i, v);
114}
115
Marco Elverc0203952019-11-26 15:04:04 +0100116static __always_inline long
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100117atomic_long_sub_return_acquire(long i, atomic_long_t *v)
118{
119 return atomic64_sub_return_acquire(i, v);
120}
121
Marco Elverc0203952019-11-26 15:04:04 +0100122static __always_inline long
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100123atomic_long_sub_return_release(long i, atomic_long_t *v)
124{
125 return atomic64_sub_return_release(i, v);
126}
127
Marco Elverc0203952019-11-26 15:04:04 +0100128static __always_inline long
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100129atomic_long_sub_return_relaxed(long i, atomic_long_t *v)
130{
131 return atomic64_sub_return_relaxed(i, v);
132}
133
Marco Elverc0203952019-11-26 15:04:04 +0100134static __always_inline long
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100135atomic_long_fetch_sub(long i, atomic_long_t *v)
136{
137 return atomic64_fetch_sub(i, v);
138}
139
Marco Elverc0203952019-11-26 15:04:04 +0100140static __always_inline long
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100141atomic_long_fetch_sub_acquire(long i, atomic_long_t *v)
142{
143 return atomic64_fetch_sub_acquire(i, v);
144}
145
Marco Elverc0203952019-11-26 15:04:04 +0100146static __always_inline long
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100147atomic_long_fetch_sub_release(long i, atomic_long_t *v)
148{
149 return atomic64_fetch_sub_release(i, v);
150}
151
Marco Elverc0203952019-11-26 15:04:04 +0100152static __always_inline long
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100153atomic_long_fetch_sub_relaxed(long i, atomic_long_t *v)
154{
155 return atomic64_fetch_sub_relaxed(i, v);
156}
157
Marco Elverc0203952019-11-26 15:04:04 +0100158static __always_inline void
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100159atomic_long_inc(atomic_long_t *v)
160{
161 atomic64_inc(v);
162}
163
Marco Elverc0203952019-11-26 15:04:04 +0100164static __always_inline long
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100165atomic_long_inc_return(atomic_long_t *v)
166{
167 return atomic64_inc_return(v);
168}
169
Marco Elverc0203952019-11-26 15:04:04 +0100170static __always_inline long
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100171atomic_long_inc_return_acquire(atomic_long_t *v)
172{
173 return atomic64_inc_return_acquire(v);
174}
175
Marco Elverc0203952019-11-26 15:04:04 +0100176static __always_inline long
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100177atomic_long_inc_return_release(atomic_long_t *v)
178{
179 return atomic64_inc_return_release(v);
180}
181
Marco Elverc0203952019-11-26 15:04:04 +0100182static __always_inline long
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100183atomic_long_inc_return_relaxed(atomic_long_t *v)
184{
185 return atomic64_inc_return_relaxed(v);
186}
187
Marco Elverc0203952019-11-26 15:04:04 +0100188static __always_inline long
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100189atomic_long_fetch_inc(atomic_long_t *v)
190{
191 return atomic64_fetch_inc(v);
192}
193
Marco Elverc0203952019-11-26 15:04:04 +0100194static __always_inline long
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100195atomic_long_fetch_inc_acquire(atomic_long_t *v)
196{
197 return atomic64_fetch_inc_acquire(v);
198}
199
Marco Elverc0203952019-11-26 15:04:04 +0100200static __always_inline long
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100201atomic_long_fetch_inc_release(atomic_long_t *v)
202{
203 return atomic64_fetch_inc_release(v);
204}
205
Marco Elverc0203952019-11-26 15:04:04 +0100206static __always_inline long
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100207atomic_long_fetch_inc_relaxed(atomic_long_t *v)
208{
209 return atomic64_fetch_inc_relaxed(v);
210}
211
Marco Elverc0203952019-11-26 15:04:04 +0100212static __always_inline void
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100213atomic_long_dec(atomic_long_t *v)
214{
215 atomic64_dec(v);
216}
217
Marco Elverc0203952019-11-26 15:04:04 +0100218static __always_inline long
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100219atomic_long_dec_return(atomic_long_t *v)
220{
221 return atomic64_dec_return(v);
222}
223
Marco Elverc0203952019-11-26 15:04:04 +0100224static __always_inline long
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100225atomic_long_dec_return_acquire(atomic_long_t *v)
226{
227 return atomic64_dec_return_acquire(v);
228}
229
Marco Elverc0203952019-11-26 15:04:04 +0100230static __always_inline long
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100231atomic_long_dec_return_release(atomic_long_t *v)
232{
233 return atomic64_dec_return_release(v);
234}
235
Marco Elverc0203952019-11-26 15:04:04 +0100236static __always_inline long
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100237atomic_long_dec_return_relaxed(atomic_long_t *v)
238{
239 return atomic64_dec_return_relaxed(v);
240}
241
Marco Elverc0203952019-11-26 15:04:04 +0100242static __always_inline long
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100243atomic_long_fetch_dec(atomic_long_t *v)
244{
245 return atomic64_fetch_dec(v);
246}
247
Marco Elverc0203952019-11-26 15:04:04 +0100248static __always_inline long
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100249atomic_long_fetch_dec_acquire(atomic_long_t *v)
250{
251 return atomic64_fetch_dec_acquire(v);
252}
253
Marco Elverc0203952019-11-26 15:04:04 +0100254static __always_inline long
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100255atomic_long_fetch_dec_release(atomic_long_t *v)
256{
257 return atomic64_fetch_dec_release(v);
258}
259
Marco Elverc0203952019-11-26 15:04:04 +0100260static __always_inline long
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100261atomic_long_fetch_dec_relaxed(atomic_long_t *v)
262{
263 return atomic64_fetch_dec_relaxed(v);
264}
265
Marco Elverc0203952019-11-26 15:04:04 +0100266static __always_inline void
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100267atomic_long_and(long i, atomic_long_t *v)
268{
269 atomic64_and(i, v);
270}
271
Marco Elverc0203952019-11-26 15:04:04 +0100272static __always_inline long
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100273atomic_long_fetch_and(long i, atomic_long_t *v)
274{
275 return atomic64_fetch_and(i, v);
276}
277
Marco Elverc0203952019-11-26 15:04:04 +0100278static __always_inline long
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100279atomic_long_fetch_and_acquire(long i, atomic_long_t *v)
280{
281 return atomic64_fetch_and_acquire(i, v);
282}
283
Marco Elverc0203952019-11-26 15:04:04 +0100284static __always_inline long
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100285atomic_long_fetch_and_release(long i, atomic_long_t *v)
286{
287 return atomic64_fetch_and_release(i, v);
288}
289
Marco Elverc0203952019-11-26 15:04:04 +0100290static __always_inline long
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100291atomic_long_fetch_and_relaxed(long i, atomic_long_t *v)
292{
293 return atomic64_fetch_and_relaxed(i, v);
294}
295
Marco Elverc0203952019-11-26 15:04:04 +0100296static __always_inline void
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100297atomic_long_andnot(long i, atomic_long_t *v)
298{
299 atomic64_andnot(i, v);
300}
301
Marco Elverc0203952019-11-26 15:04:04 +0100302static __always_inline long
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100303atomic_long_fetch_andnot(long i, atomic_long_t *v)
304{
305 return atomic64_fetch_andnot(i, v);
306}
307
Marco Elverc0203952019-11-26 15:04:04 +0100308static __always_inline long
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100309atomic_long_fetch_andnot_acquire(long i, atomic_long_t *v)
310{
311 return atomic64_fetch_andnot_acquire(i, v);
312}
313
Marco Elverc0203952019-11-26 15:04:04 +0100314static __always_inline long
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100315atomic_long_fetch_andnot_release(long i, atomic_long_t *v)
316{
317 return atomic64_fetch_andnot_release(i, v);
318}
319
Marco Elverc0203952019-11-26 15:04:04 +0100320static __always_inline long
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100321atomic_long_fetch_andnot_relaxed(long i, atomic_long_t *v)
322{
323 return atomic64_fetch_andnot_relaxed(i, v);
324}
325
Marco Elverc0203952019-11-26 15:04:04 +0100326static __always_inline void
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100327atomic_long_or(long i, atomic_long_t *v)
328{
329 atomic64_or(i, v);
330}
331
Marco Elverc0203952019-11-26 15:04:04 +0100332static __always_inline long
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100333atomic_long_fetch_or(long i, atomic_long_t *v)
334{
335 return atomic64_fetch_or(i, v);
336}
337
Marco Elverc0203952019-11-26 15:04:04 +0100338static __always_inline long
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100339atomic_long_fetch_or_acquire(long i, atomic_long_t *v)
340{
341 return atomic64_fetch_or_acquire(i, v);
342}
343
Marco Elverc0203952019-11-26 15:04:04 +0100344static __always_inline long
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100345atomic_long_fetch_or_release(long i, atomic_long_t *v)
346{
347 return atomic64_fetch_or_release(i, v);
348}
349
Marco Elverc0203952019-11-26 15:04:04 +0100350static __always_inline long
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100351atomic_long_fetch_or_relaxed(long i, atomic_long_t *v)
352{
353 return atomic64_fetch_or_relaxed(i, v);
354}
355
Marco Elverc0203952019-11-26 15:04:04 +0100356static __always_inline void
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100357atomic_long_xor(long i, atomic_long_t *v)
358{
359 atomic64_xor(i, v);
360}
361
Marco Elverc0203952019-11-26 15:04:04 +0100362static __always_inline long
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100363atomic_long_fetch_xor(long i, atomic_long_t *v)
364{
365 return atomic64_fetch_xor(i, v);
366}
367
Marco Elverc0203952019-11-26 15:04:04 +0100368static __always_inline long
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100369atomic_long_fetch_xor_acquire(long i, atomic_long_t *v)
370{
371 return atomic64_fetch_xor_acquire(i, v);
372}
373
Marco Elverc0203952019-11-26 15:04:04 +0100374static __always_inline long
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100375atomic_long_fetch_xor_release(long i, atomic_long_t *v)
376{
377 return atomic64_fetch_xor_release(i, v);
378}
379
Marco Elverc0203952019-11-26 15:04:04 +0100380static __always_inline long
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100381atomic_long_fetch_xor_relaxed(long i, atomic_long_t *v)
382{
383 return atomic64_fetch_xor_relaxed(i, v);
384}
385
Marco Elverc0203952019-11-26 15:04:04 +0100386static __always_inline long
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100387atomic_long_xchg(atomic_long_t *v, long i)
388{
389 return atomic64_xchg(v, i);
390}
391
Marco Elverc0203952019-11-26 15:04:04 +0100392static __always_inline long
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100393atomic_long_xchg_acquire(atomic_long_t *v, long i)
394{
395 return atomic64_xchg_acquire(v, i);
396}
397
Marco Elverc0203952019-11-26 15:04:04 +0100398static __always_inline long
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100399atomic_long_xchg_release(atomic_long_t *v, long i)
400{
401 return atomic64_xchg_release(v, i);
402}
403
Marco Elverc0203952019-11-26 15:04:04 +0100404static __always_inline long
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100405atomic_long_xchg_relaxed(atomic_long_t *v, long i)
406{
407 return atomic64_xchg_relaxed(v, i);
408}
409
Marco Elverc0203952019-11-26 15:04:04 +0100410static __always_inline long
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100411atomic_long_cmpxchg(atomic_long_t *v, long old, long new)
412{
413 return atomic64_cmpxchg(v, old, new);
414}
415
Marco Elverc0203952019-11-26 15:04:04 +0100416static __always_inline long
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100417atomic_long_cmpxchg_acquire(atomic_long_t *v, long old, long new)
418{
419 return atomic64_cmpxchg_acquire(v, old, new);
420}
421
Marco Elverc0203952019-11-26 15:04:04 +0100422static __always_inline long
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100423atomic_long_cmpxchg_release(atomic_long_t *v, long old, long new)
424{
425 return atomic64_cmpxchg_release(v, old, new);
426}
427
Marco Elverc0203952019-11-26 15:04:04 +0100428static __always_inline long
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100429atomic_long_cmpxchg_relaxed(atomic_long_t *v, long old, long new)
430{
431 return atomic64_cmpxchg_relaxed(v, old, new);
432}
433
Marco Elverc0203952019-11-26 15:04:04 +0100434static __always_inline bool
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100435atomic_long_try_cmpxchg(atomic_long_t *v, long *old, long new)
436{
437 return atomic64_try_cmpxchg(v, (s64 *)old, new);
438}
439
Marco Elverc0203952019-11-26 15:04:04 +0100440static __always_inline bool
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100441atomic_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 Elverc0203952019-11-26 15:04:04 +0100446static __always_inline bool
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100447atomic_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 Elverc0203952019-11-26 15:04:04 +0100452static __always_inline bool
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100453atomic_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 Elverc0203952019-11-26 15:04:04 +0100458static __always_inline bool
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100459atomic_long_sub_and_test(long i, atomic_long_t *v)
460{
461 return atomic64_sub_and_test(i, v);
462}
463
Marco Elverc0203952019-11-26 15:04:04 +0100464static __always_inline bool
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100465atomic_long_dec_and_test(atomic_long_t *v)
466{
467 return atomic64_dec_and_test(v);
468}
469
Marco Elverc0203952019-11-26 15:04:04 +0100470static __always_inline bool
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100471atomic_long_inc_and_test(atomic_long_t *v)
472{
473 return atomic64_inc_and_test(v);
474}
475
Marco Elverc0203952019-11-26 15:04:04 +0100476static __always_inline bool
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100477atomic_long_add_negative(long i, atomic_long_t *v)
478{
479 return atomic64_add_negative(i, v);
480}
481
Marco Elverc0203952019-11-26 15:04:04 +0100482static __always_inline long
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100483atomic_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 Elverc0203952019-11-26 15:04:04 +0100488static __always_inline bool
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100489atomic_long_add_unless(atomic_long_t *v, long a, long u)
490{
491 return atomic64_add_unless(v, a, u);
492}
493
Marco Elverc0203952019-11-26 15:04:04 +0100494static __always_inline bool
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100495atomic_long_inc_not_zero(atomic_long_t *v)
496{
497 return atomic64_inc_not_zero(v);
498}
499
Marco Elverc0203952019-11-26 15:04:04 +0100500static __always_inline bool
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100501atomic_long_inc_unless_negative(atomic_long_t *v)
502{
503 return atomic64_inc_unless_negative(v);
504}
505
Marco Elverc0203952019-11-26 15:04:04 +0100506static __always_inline bool
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100507atomic_long_dec_unless_positive(atomic_long_t *v)
508{
509 return atomic64_dec_unless_positive(v);
510}
511
Marco Elverc0203952019-11-26 15:04:04 +0100512static __always_inline long
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100513atomic_long_dec_if_positive(atomic_long_t *v)
514{
515 return atomic64_dec_if_positive(v);
516}
517
518#else /* CONFIG_64BIT */
519
Marco Elverc0203952019-11-26 15:04:04 +0100520static __always_inline long
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100521atomic_long_read(const atomic_long_t *v)
522{
523 return atomic_read(v);
524}
525
Marco Elverc0203952019-11-26 15:04:04 +0100526static __always_inline long
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100527atomic_long_read_acquire(const atomic_long_t *v)
528{
529 return atomic_read_acquire(v);
530}
531
Marco Elverc0203952019-11-26 15:04:04 +0100532static __always_inline void
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100533atomic_long_set(atomic_long_t *v, long i)
534{
535 atomic_set(v, i);
536}
537
Marco Elverc0203952019-11-26 15:04:04 +0100538static __always_inline void
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100539atomic_long_set_release(atomic_long_t *v, long i)
540{
541 atomic_set_release(v, i);
542}
543
Marco Elverc0203952019-11-26 15:04:04 +0100544static __always_inline void
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100545atomic_long_add(long i, atomic_long_t *v)
546{
547 atomic_add(i, v);
548}
549
Marco Elverc0203952019-11-26 15:04:04 +0100550static __always_inline long
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100551atomic_long_add_return(long i, atomic_long_t *v)
552{
553 return atomic_add_return(i, v);
554}
555
Marco Elverc0203952019-11-26 15:04:04 +0100556static __always_inline long
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100557atomic_long_add_return_acquire(long i, atomic_long_t *v)
558{
559 return atomic_add_return_acquire(i, v);
560}
561
Marco Elverc0203952019-11-26 15:04:04 +0100562static __always_inline long
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100563atomic_long_add_return_release(long i, atomic_long_t *v)
564{
565 return atomic_add_return_release(i, v);
566}
567
Marco Elverc0203952019-11-26 15:04:04 +0100568static __always_inline long
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100569atomic_long_add_return_relaxed(long i, atomic_long_t *v)
570{
571 return atomic_add_return_relaxed(i, v);
572}
573
Marco Elverc0203952019-11-26 15:04:04 +0100574static __always_inline long
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100575atomic_long_fetch_add(long i, atomic_long_t *v)
576{
577 return atomic_fetch_add(i, v);
578}
579
Marco Elverc0203952019-11-26 15:04:04 +0100580static __always_inline long
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100581atomic_long_fetch_add_acquire(long i, atomic_long_t *v)
582{
583 return atomic_fetch_add_acquire(i, v);
584}
585
Marco Elverc0203952019-11-26 15:04:04 +0100586static __always_inline long
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100587atomic_long_fetch_add_release(long i, atomic_long_t *v)
588{
589 return atomic_fetch_add_release(i, v);
590}
591
Marco Elverc0203952019-11-26 15:04:04 +0100592static __always_inline long
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100593atomic_long_fetch_add_relaxed(long i, atomic_long_t *v)
594{
595 return atomic_fetch_add_relaxed(i, v);
596}
597
Marco Elverc0203952019-11-26 15:04:04 +0100598static __always_inline void
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100599atomic_long_sub(long i, atomic_long_t *v)
600{
601 atomic_sub(i, v);
602}
603
Marco Elverc0203952019-11-26 15:04:04 +0100604static __always_inline long
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100605atomic_long_sub_return(long i, atomic_long_t *v)
606{
607 return atomic_sub_return(i, v);
608}
609
Marco Elverc0203952019-11-26 15:04:04 +0100610static __always_inline long
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100611atomic_long_sub_return_acquire(long i, atomic_long_t *v)
612{
613 return atomic_sub_return_acquire(i, v);
614}
615
Marco Elverc0203952019-11-26 15:04:04 +0100616static __always_inline long
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100617atomic_long_sub_return_release(long i, atomic_long_t *v)
618{
619 return atomic_sub_return_release(i, v);
620}
621
Marco Elverc0203952019-11-26 15:04:04 +0100622static __always_inline long
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100623atomic_long_sub_return_relaxed(long i, atomic_long_t *v)
624{
625 return atomic_sub_return_relaxed(i, v);
626}
627
Marco Elverc0203952019-11-26 15:04:04 +0100628static __always_inline long
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100629atomic_long_fetch_sub(long i, atomic_long_t *v)
630{
631 return atomic_fetch_sub(i, v);
632}
633
Marco Elverc0203952019-11-26 15:04:04 +0100634static __always_inline long
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100635atomic_long_fetch_sub_acquire(long i, atomic_long_t *v)
636{
637 return atomic_fetch_sub_acquire(i, v);
638}
639
Marco Elverc0203952019-11-26 15:04:04 +0100640static __always_inline long
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100641atomic_long_fetch_sub_release(long i, atomic_long_t *v)
642{
643 return atomic_fetch_sub_release(i, v);
644}
645
Marco Elverc0203952019-11-26 15:04:04 +0100646static __always_inline long
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100647atomic_long_fetch_sub_relaxed(long i, atomic_long_t *v)
648{
649 return atomic_fetch_sub_relaxed(i, v);
650}
651
Marco Elverc0203952019-11-26 15:04:04 +0100652static __always_inline void
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100653atomic_long_inc(atomic_long_t *v)
654{
655 atomic_inc(v);
656}
657
Marco Elverc0203952019-11-26 15:04:04 +0100658static __always_inline long
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100659atomic_long_inc_return(atomic_long_t *v)
660{
661 return atomic_inc_return(v);
662}
663
Marco Elverc0203952019-11-26 15:04:04 +0100664static __always_inline long
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100665atomic_long_inc_return_acquire(atomic_long_t *v)
666{
667 return atomic_inc_return_acquire(v);
668}
669
Marco Elverc0203952019-11-26 15:04:04 +0100670static __always_inline long
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100671atomic_long_inc_return_release(atomic_long_t *v)
672{
673 return atomic_inc_return_release(v);
674}
675
Marco Elverc0203952019-11-26 15:04:04 +0100676static __always_inline long
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100677atomic_long_inc_return_relaxed(atomic_long_t *v)
678{
679 return atomic_inc_return_relaxed(v);
680}
681
Marco Elverc0203952019-11-26 15:04:04 +0100682static __always_inline long
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100683atomic_long_fetch_inc(atomic_long_t *v)
684{
685 return atomic_fetch_inc(v);
686}
687
Marco Elverc0203952019-11-26 15:04:04 +0100688static __always_inline long
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100689atomic_long_fetch_inc_acquire(atomic_long_t *v)
690{
691 return atomic_fetch_inc_acquire(v);
692}
693
Marco Elverc0203952019-11-26 15:04:04 +0100694static __always_inline long
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100695atomic_long_fetch_inc_release(atomic_long_t *v)
696{
697 return atomic_fetch_inc_release(v);
698}
699
Marco Elverc0203952019-11-26 15:04:04 +0100700static __always_inline long
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100701atomic_long_fetch_inc_relaxed(atomic_long_t *v)
702{
703 return atomic_fetch_inc_relaxed(v);
704}
705
Marco Elverc0203952019-11-26 15:04:04 +0100706static __always_inline void
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100707atomic_long_dec(atomic_long_t *v)
708{
709 atomic_dec(v);
710}
711
Marco Elverc0203952019-11-26 15:04:04 +0100712static __always_inline long
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100713atomic_long_dec_return(atomic_long_t *v)
714{
715 return atomic_dec_return(v);
716}
717
Marco Elverc0203952019-11-26 15:04:04 +0100718static __always_inline long
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100719atomic_long_dec_return_acquire(atomic_long_t *v)
720{
721 return atomic_dec_return_acquire(v);
722}
723
Marco Elverc0203952019-11-26 15:04:04 +0100724static __always_inline long
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100725atomic_long_dec_return_release(atomic_long_t *v)
726{
727 return atomic_dec_return_release(v);
728}
729
Marco Elverc0203952019-11-26 15:04:04 +0100730static __always_inline long
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100731atomic_long_dec_return_relaxed(atomic_long_t *v)
732{
733 return atomic_dec_return_relaxed(v);
734}
735
Marco Elverc0203952019-11-26 15:04:04 +0100736static __always_inline long
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100737atomic_long_fetch_dec(atomic_long_t *v)
738{
739 return atomic_fetch_dec(v);
740}
741
Marco Elverc0203952019-11-26 15:04:04 +0100742static __always_inline long
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100743atomic_long_fetch_dec_acquire(atomic_long_t *v)
744{
745 return atomic_fetch_dec_acquire(v);
746}
747
Marco Elverc0203952019-11-26 15:04:04 +0100748static __always_inline long
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100749atomic_long_fetch_dec_release(atomic_long_t *v)
750{
751 return atomic_fetch_dec_release(v);
752}
753
Marco Elverc0203952019-11-26 15:04:04 +0100754static __always_inline long
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100755atomic_long_fetch_dec_relaxed(atomic_long_t *v)
756{
757 return atomic_fetch_dec_relaxed(v);
758}
759
Marco Elverc0203952019-11-26 15:04:04 +0100760static __always_inline void
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100761atomic_long_and(long i, atomic_long_t *v)
762{
763 atomic_and(i, v);
764}
765
Marco Elverc0203952019-11-26 15:04:04 +0100766static __always_inline long
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100767atomic_long_fetch_and(long i, atomic_long_t *v)
768{
769 return atomic_fetch_and(i, v);
770}
771
Marco Elverc0203952019-11-26 15:04:04 +0100772static __always_inline long
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100773atomic_long_fetch_and_acquire(long i, atomic_long_t *v)
774{
775 return atomic_fetch_and_acquire(i, v);
776}
777
Marco Elverc0203952019-11-26 15:04:04 +0100778static __always_inline long
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100779atomic_long_fetch_and_release(long i, atomic_long_t *v)
780{
781 return atomic_fetch_and_release(i, v);
782}
783
Marco Elverc0203952019-11-26 15:04:04 +0100784static __always_inline long
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100785atomic_long_fetch_and_relaxed(long i, atomic_long_t *v)
786{
787 return atomic_fetch_and_relaxed(i, v);
788}
789
Marco Elverc0203952019-11-26 15:04:04 +0100790static __always_inline void
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100791atomic_long_andnot(long i, atomic_long_t *v)
792{
793 atomic_andnot(i, v);
794}
795
Marco Elverc0203952019-11-26 15:04:04 +0100796static __always_inline long
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100797atomic_long_fetch_andnot(long i, atomic_long_t *v)
798{
799 return atomic_fetch_andnot(i, v);
800}
801
Marco Elverc0203952019-11-26 15:04:04 +0100802static __always_inline long
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100803atomic_long_fetch_andnot_acquire(long i, atomic_long_t *v)
804{
805 return atomic_fetch_andnot_acquire(i, v);
806}
807
Marco Elverc0203952019-11-26 15:04:04 +0100808static __always_inline long
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100809atomic_long_fetch_andnot_release(long i, atomic_long_t *v)
810{
811 return atomic_fetch_andnot_release(i, v);
812}
813
Marco Elverc0203952019-11-26 15:04:04 +0100814static __always_inline long
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100815atomic_long_fetch_andnot_relaxed(long i, atomic_long_t *v)
816{
817 return atomic_fetch_andnot_relaxed(i, v);
818}
819
Marco Elverc0203952019-11-26 15:04:04 +0100820static __always_inline void
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100821atomic_long_or(long i, atomic_long_t *v)
822{
823 atomic_or(i, v);
824}
825
Marco Elverc0203952019-11-26 15:04:04 +0100826static __always_inline long
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100827atomic_long_fetch_or(long i, atomic_long_t *v)
828{
829 return atomic_fetch_or(i, v);
830}
831
Marco Elverc0203952019-11-26 15:04:04 +0100832static __always_inline long
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100833atomic_long_fetch_or_acquire(long i, atomic_long_t *v)
834{
835 return atomic_fetch_or_acquire(i, v);
836}
837
Marco Elverc0203952019-11-26 15:04:04 +0100838static __always_inline long
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100839atomic_long_fetch_or_release(long i, atomic_long_t *v)
840{
841 return atomic_fetch_or_release(i, v);
842}
843
Marco Elverc0203952019-11-26 15:04:04 +0100844static __always_inline long
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100845atomic_long_fetch_or_relaxed(long i, atomic_long_t *v)
846{
847 return atomic_fetch_or_relaxed(i, v);
848}
849
Marco Elverc0203952019-11-26 15:04:04 +0100850static __always_inline void
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100851atomic_long_xor(long i, atomic_long_t *v)
852{
853 atomic_xor(i, v);
854}
855
Marco Elverc0203952019-11-26 15:04:04 +0100856static __always_inline long
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100857atomic_long_fetch_xor(long i, atomic_long_t *v)
858{
859 return atomic_fetch_xor(i, v);
860}
861
Marco Elverc0203952019-11-26 15:04:04 +0100862static __always_inline long
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100863atomic_long_fetch_xor_acquire(long i, atomic_long_t *v)
864{
865 return atomic_fetch_xor_acquire(i, v);
866}
867
Marco Elverc0203952019-11-26 15:04:04 +0100868static __always_inline long
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100869atomic_long_fetch_xor_release(long i, atomic_long_t *v)
870{
871 return atomic_fetch_xor_release(i, v);
872}
873
Marco Elverc0203952019-11-26 15:04:04 +0100874static __always_inline long
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100875atomic_long_fetch_xor_relaxed(long i, atomic_long_t *v)
876{
877 return atomic_fetch_xor_relaxed(i, v);
878}
879
Marco Elverc0203952019-11-26 15:04:04 +0100880static __always_inline long
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100881atomic_long_xchg(atomic_long_t *v, long i)
882{
883 return atomic_xchg(v, i);
884}
885
Marco Elverc0203952019-11-26 15:04:04 +0100886static __always_inline long
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100887atomic_long_xchg_acquire(atomic_long_t *v, long i)
888{
889 return atomic_xchg_acquire(v, i);
890}
891
Marco Elverc0203952019-11-26 15:04:04 +0100892static __always_inline long
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100893atomic_long_xchg_release(atomic_long_t *v, long i)
894{
895 return atomic_xchg_release(v, i);
896}
897
Marco Elverc0203952019-11-26 15:04:04 +0100898static __always_inline long
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100899atomic_long_xchg_relaxed(atomic_long_t *v, long i)
900{
901 return atomic_xchg_relaxed(v, i);
902}
903
Marco Elverc0203952019-11-26 15:04:04 +0100904static __always_inline long
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100905atomic_long_cmpxchg(atomic_long_t *v, long old, long new)
906{
907 return atomic_cmpxchg(v, old, new);
908}
909
Marco Elverc0203952019-11-26 15:04:04 +0100910static __always_inline long
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100911atomic_long_cmpxchg_acquire(atomic_long_t *v, long old, long new)
912{
913 return atomic_cmpxchg_acquire(v, old, new);
914}
915
Marco Elverc0203952019-11-26 15:04:04 +0100916static __always_inline long
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100917atomic_long_cmpxchg_release(atomic_long_t *v, long old, long new)
918{
919 return atomic_cmpxchg_release(v, old, new);
920}
921
Marco Elverc0203952019-11-26 15:04:04 +0100922static __always_inline long
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100923atomic_long_cmpxchg_relaxed(atomic_long_t *v, long old, long new)
924{
925 return atomic_cmpxchg_relaxed(v, old, new);
926}
927
Marco Elverc0203952019-11-26 15:04:04 +0100928static __always_inline bool
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100929atomic_long_try_cmpxchg(atomic_long_t *v, long *old, long new)
930{
931 return atomic_try_cmpxchg(v, (int *)old, new);
932}
933
Marco Elverc0203952019-11-26 15:04:04 +0100934static __always_inline bool
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100935atomic_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 Elverc0203952019-11-26 15:04:04 +0100940static __always_inline bool
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100941atomic_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 Elverc0203952019-11-26 15:04:04 +0100946static __always_inline bool
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100947atomic_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 Elverc0203952019-11-26 15:04:04 +0100952static __always_inline bool
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100953atomic_long_sub_and_test(long i, atomic_long_t *v)
954{
955 return atomic_sub_and_test(i, v);
956}
957
Marco Elverc0203952019-11-26 15:04:04 +0100958static __always_inline bool
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100959atomic_long_dec_and_test(atomic_long_t *v)
960{
961 return atomic_dec_and_test(v);
962}
963
Marco Elverc0203952019-11-26 15:04:04 +0100964static __always_inline bool
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100965atomic_long_inc_and_test(atomic_long_t *v)
966{
967 return atomic_inc_and_test(v);
968}
969
Marco Elverc0203952019-11-26 15:04:04 +0100970static __always_inline bool
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100971atomic_long_add_negative(long i, atomic_long_t *v)
972{
973 return atomic_add_negative(i, v);
974}
975
Marco Elverc0203952019-11-26 15:04:04 +0100976static __always_inline long
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100977atomic_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 Elverc0203952019-11-26 15:04:04 +0100982static __always_inline bool
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100983atomic_long_add_unless(atomic_long_t *v, long a, long u)
984{
985 return atomic_add_unless(v, a, u);
986}
987
Marco Elverc0203952019-11-26 15:04:04 +0100988static __always_inline bool
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100989atomic_long_inc_not_zero(atomic_long_t *v)
990{
991 return atomic_inc_not_zero(v);
992}
993
Marco Elverc0203952019-11-26 15:04:04 +0100994static __always_inline bool
Mark Rutlandb5d47ef2018-09-04 11:48:27 +0100995atomic_long_inc_unless_negative(atomic_long_t *v)
996{
997 return atomic_inc_unless_negative(v);
998}
999
Marco Elverc0203952019-11-26 15:04:04 +01001000static __always_inline bool
Mark Rutlandb5d47ef2018-09-04 11:48:27 +01001001atomic_long_dec_unless_positive(atomic_long_t *v)
1002{
1003 return atomic_dec_unless_positive(v);
1004}
1005
Marco Elverc0203952019-11-26 15:04:04 +01001006static __always_inline long
Mark Rutlandb5d47ef2018-09-04 11:48:27 +01001007atomic_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 Elverc0203952019-11-26 15:04:04 +01001014// a624200981f552b2c6be4f32fe44da8289f30d87