blob: 073cf40f431b8bc88a01a3aef16cd2698e6e64b5 [file] [log] [blame]
David Brazdil0f672f62019-12-10 10:32:29 +00001// SPDX-License-Identifier: GPL-2.0
2
3// Generated by scripts/atomic/gen-atomic-long.sh
4// DO NOT MODIFY THIS FILE DIRECTLY
5
Andrew Scullb4b6d4a2019-01-02 15:54:55 +00006#ifndef _ASM_GENERIC_ATOMIC_LONG_H
7#define _ASM_GENERIC_ATOMIC_LONG_H
Andrew Scullb4b6d4a2019-01-02 15:54:55 +00008
Olivier Deprez157378f2022-04-04 15:47:50 +02009#include <linux/compiler.h>
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000010#include <asm/types.h>
11
David Brazdil0f672f62019-12-10 10:32:29 +000012#ifdef CONFIG_64BIT
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000013typedef atomic64_t atomic_long_t;
David Brazdil0f672f62019-12-10 10:32:29 +000014#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
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000017#else
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000018typedef atomic_t atomic_long_t;
David Brazdil0f672f62019-12-10 10:32:29 +000019#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
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000022#endif
23
David Brazdil0f672f62019-12-10 10:32:29 +000024#ifdef CONFIG_64BIT
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000025
Olivier Deprez157378f2022-04-04 15:47:50 +020026static __always_inline long
David Brazdil0f672f62019-12-10 10:32:29 +000027atomic_long_read(const atomic_long_t *v)
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000028{
David Brazdil0f672f62019-12-10 10:32:29 +000029 return atomic64_read(v);
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000030}
31
Olivier Deprez157378f2022-04-04 15:47:50 +020032static __always_inline long
David Brazdil0f672f62019-12-10 10:32:29 +000033atomic_long_read_acquire(const atomic_long_t *v)
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000034{
David Brazdil0f672f62019-12-10 10:32:29 +000035 return atomic64_read_acquire(v);
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000036}
37
Olivier Deprez157378f2022-04-04 15:47:50 +020038static __always_inline void
David Brazdil0f672f62019-12-10 10:32:29 +000039atomic_long_set(atomic_long_t *v, long i)
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000040{
David Brazdil0f672f62019-12-10 10:32:29 +000041 atomic64_set(v, i);
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000042}
43
Olivier Deprez157378f2022-04-04 15:47:50 +020044static __always_inline void
David Brazdil0f672f62019-12-10 10:32:29 +000045atomic_long_set_release(atomic_long_t *v, long i)
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000046{
David Brazdil0f672f62019-12-10 10:32:29 +000047 atomic64_set_release(v, i);
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000048}
49
Olivier Deprez157378f2022-04-04 15:47:50 +020050static __always_inline void
David Brazdil0f672f62019-12-10 10:32:29 +000051atomic_long_add(long i, atomic_long_t *v)
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000052{
David Brazdil0f672f62019-12-10 10:32:29 +000053 atomic64_add(i, v);
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000054}
55
Olivier Deprez157378f2022-04-04 15:47:50 +020056static __always_inline long
David Brazdil0f672f62019-12-10 10:32:29 +000057atomic_long_add_return(long i, atomic_long_t *v)
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000058{
David Brazdil0f672f62019-12-10 10:32:29 +000059 return atomic64_add_return(i, v);
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000060}
61
Olivier Deprez157378f2022-04-04 15:47:50 +020062static __always_inline long
David Brazdil0f672f62019-12-10 10:32:29 +000063atomic_long_add_return_acquire(long i, atomic_long_t *v)
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000064{
David Brazdil0f672f62019-12-10 10:32:29 +000065 return atomic64_add_return_acquire(i, v);
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000066}
67
Olivier Deprez157378f2022-04-04 15:47:50 +020068static __always_inline long
David Brazdil0f672f62019-12-10 10:32:29 +000069atomic_long_add_return_release(long i, atomic_long_t *v)
70{
71 return atomic64_add_return_release(i, v);
72}
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000073
Olivier Deprez157378f2022-04-04 15:47:50 +020074static __always_inline long
David Brazdil0f672f62019-12-10 10:32:29 +000075atomic_long_add_return_relaxed(long i, atomic_long_t *v)
76{
77 return atomic64_add_return_relaxed(i, v);
78}
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000079
Olivier Deprez157378f2022-04-04 15:47:50 +020080static __always_inline long
David Brazdil0f672f62019-12-10 10:32:29 +000081atomic_long_fetch_add(long i, atomic_long_t *v)
82{
83 return atomic64_fetch_add(i, v);
84}
85
Olivier Deprez157378f2022-04-04 15:47:50 +020086static __always_inline long
David Brazdil0f672f62019-12-10 10:32:29 +000087atomic_long_fetch_add_acquire(long i, atomic_long_t *v)
88{
89 return atomic64_fetch_add_acquire(i, v);
90}
91
Olivier Deprez157378f2022-04-04 15:47:50 +020092static __always_inline long
David Brazdil0f672f62019-12-10 10:32:29 +000093atomic_long_fetch_add_release(long i, atomic_long_t *v)
94{
95 return atomic64_fetch_add_release(i, v);
96}
97
Olivier Deprez157378f2022-04-04 15:47:50 +020098static __always_inline long
David Brazdil0f672f62019-12-10 10:32:29 +000099atomic_long_fetch_add_relaxed(long i, atomic_long_t *v)
100{
101 return atomic64_fetch_add_relaxed(i, v);
102}
103
Olivier Deprez157378f2022-04-04 15:47:50 +0200104static __always_inline void
David Brazdil0f672f62019-12-10 10:32:29 +0000105atomic_long_sub(long i, atomic_long_t *v)
106{
107 atomic64_sub(i, v);
108}
109
Olivier Deprez157378f2022-04-04 15:47:50 +0200110static __always_inline long
David Brazdil0f672f62019-12-10 10:32:29 +0000111atomic_long_sub_return(long i, atomic_long_t *v)
112{
113 return atomic64_sub_return(i, v);
114}
115
Olivier Deprez157378f2022-04-04 15:47:50 +0200116static __always_inline long
David Brazdil0f672f62019-12-10 10:32:29 +0000117atomic_long_sub_return_acquire(long i, atomic_long_t *v)
118{
119 return atomic64_sub_return_acquire(i, v);
120}
121
Olivier Deprez157378f2022-04-04 15:47:50 +0200122static __always_inline long
David Brazdil0f672f62019-12-10 10:32:29 +0000123atomic_long_sub_return_release(long i, atomic_long_t *v)
124{
125 return atomic64_sub_return_release(i, v);
126}
127
Olivier Deprez157378f2022-04-04 15:47:50 +0200128static __always_inline long
David Brazdil0f672f62019-12-10 10:32:29 +0000129atomic_long_sub_return_relaxed(long i, atomic_long_t *v)
130{
131 return atomic64_sub_return_relaxed(i, v);
132}
133
Olivier Deprez157378f2022-04-04 15:47:50 +0200134static __always_inline long
David Brazdil0f672f62019-12-10 10:32:29 +0000135atomic_long_fetch_sub(long i, atomic_long_t *v)
136{
137 return atomic64_fetch_sub(i, v);
138}
139
Olivier Deprez157378f2022-04-04 15:47:50 +0200140static __always_inline long
David Brazdil0f672f62019-12-10 10:32:29 +0000141atomic_long_fetch_sub_acquire(long i, atomic_long_t *v)
142{
143 return atomic64_fetch_sub_acquire(i, v);
144}
145
Olivier Deprez157378f2022-04-04 15:47:50 +0200146static __always_inline long
David Brazdil0f672f62019-12-10 10:32:29 +0000147atomic_long_fetch_sub_release(long i, atomic_long_t *v)
148{
149 return atomic64_fetch_sub_release(i, v);
150}
151
Olivier Deprez157378f2022-04-04 15:47:50 +0200152static __always_inline long
David Brazdil0f672f62019-12-10 10:32:29 +0000153atomic_long_fetch_sub_relaxed(long i, atomic_long_t *v)
154{
155 return atomic64_fetch_sub_relaxed(i, v);
156}
157
Olivier Deprez157378f2022-04-04 15:47:50 +0200158static __always_inline void
David Brazdil0f672f62019-12-10 10:32:29 +0000159atomic_long_inc(atomic_long_t *v)
160{
161 atomic64_inc(v);
162}
163
Olivier Deprez157378f2022-04-04 15:47:50 +0200164static __always_inline long
David Brazdil0f672f62019-12-10 10:32:29 +0000165atomic_long_inc_return(atomic_long_t *v)
166{
167 return atomic64_inc_return(v);
168}
169
Olivier Deprez157378f2022-04-04 15:47:50 +0200170static __always_inline long
David Brazdil0f672f62019-12-10 10:32:29 +0000171atomic_long_inc_return_acquire(atomic_long_t *v)
172{
173 return atomic64_inc_return_acquire(v);
174}
175
Olivier Deprez157378f2022-04-04 15:47:50 +0200176static __always_inline long
David Brazdil0f672f62019-12-10 10:32:29 +0000177atomic_long_inc_return_release(atomic_long_t *v)
178{
179 return atomic64_inc_return_release(v);
180}
181
Olivier Deprez157378f2022-04-04 15:47:50 +0200182static __always_inline long
David Brazdil0f672f62019-12-10 10:32:29 +0000183atomic_long_inc_return_relaxed(atomic_long_t *v)
184{
185 return atomic64_inc_return_relaxed(v);
186}
187
Olivier Deprez157378f2022-04-04 15:47:50 +0200188static __always_inline long
David Brazdil0f672f62019-12-10 10:32:29 +0000189atomic_long_fetch_inc(atomic_long_t *v)
190{
191 return atomic64_fetch_inc(v);
192}
193
Olivier Deprez157378f2022-04-04 15:47:50 +0200194static __always_inline long
David Brazdil0f672f62019-12-10 10:32:29 +0000195atomic_long_fetch_inc_acquire(atomic_long_t *v)
196{
197 return atomic64_fetch_inc_acquire(v);
198}
199
Olivier Deprez157378f2022-04-04 15:47:50 +0200200static __always_inline long
David Brazdil0f672f62019-12-10 10:32:29 +0000201atomic_long_fetch_inc_release(atomic_long_t *v)
202{
203 return atomic64_fetch_inc_release(v);
204}
205
Olivier Deprez157378f2022-04-04 15:47:50 +0200206static __always_inline long
David Brazdil0f672f62019-12-10 10:32:29 +0000207atomic_long_fetch_inc_relaxed(atomic_long_t *v)
208{
209 return atomic64_fetch_inc_relaxed(v);
210}
211
Olivier Deprez157378f2022-04-04 15:47:50 +0200212static __always_inline void
David Brazdil0f672f62019-12-10 10:32:29 +0000213atomic_long_dec(atomic_long_t *v)
214{
215 atomic64_dec(v);
216}
217
Olivier Deprez157378f2022-04-04 15:47:50 +0200218static __always_inline long
David Brazdil0f672f62019-12-10 10:32:29 +0000219atomic_long_dec_return(atomic_long_t *v)
220{
221 return atomic64_dec_return(v);
222}
223
Olivier Deprez157378f2022-04-04 15:47:50 +0200224static __always_inline long
David Brazdil0f672f62019-12-10 10:32:29 +0000225atomic_long_dec_return_acquire(atomic_long_t *v)
226{
227 return atomic64_dec_return_acquire(v);
228}
229
Olivier Deprez157378f2022-04-04 15:47:50 +0200230static __always_inline long
David Brazdil0f672f62019-12-10 10:32:29 +0000231atomic_long_dec_return_release(atomic_long_t *v)
232{
233 return atomic64_dec_return_release(v);
234}
235
Olivier Deprez157378f2022-04-04 15:47:50 +0200236static __always_inline long
David Brazdil0f672f62019-12-10 10:32:29 +0000237atomic_long_dec_return_relaxed(atomic_long_t *v)
238{
239 return atomic64_dec_return_relaxed(v);
240}
241
Olivier Deprez157378f2022-04-04 15:47:50 +0200242static __always_inline long
David Brazdil0f672f62019-12-10 10:32:29 +0000243atomic_long_fetch_dec(atomic_long_t *v)
244{
245 return atomic64_fetch_dec(v);
246}
247
Olivier Deprez157378f2022-04-04 15:47:50 +0200248static __always_inline long
David Brazdil0f672f62019-12-10 10:32:29 +0000249atomic_long_fetch_dec_acquire(atomic_long_t *v)
250{
251 return atomic64_fetch_dec_acquire(v);
252}
253
Olivier Deprez157378f2022-04-04 15:47:50 +0200254static __always_inline long
David Brazdil0f672f62019-12-10 10:32:29 +0000255atomic_long_fetch_dec_release(atomic_long_t *v)
256{
257 return atomic64_fetch_dec_release(v);
258}
259
Olivier Deprez157378f2022-04-04 15:47:50 +0200260static __always_inline long
David Brazdil0f672f62019-12-10 10:32:29 +0000261atomic_long_fetch_dec_relaxed(atomic_long_t *v)
262{
263 return atomic64_fetch_dec_relaxed(v);
264}
265
Olivier Deprez157378f2022-04-04 15:47:50 +0200266static __always_inline void
David Brazdil0f672f62019-12-10 10:32:29 +0000267atomic_long_and(long i, atomic_long_t *v)
268{
269 atomic64_and(i, v);
270}
271
Olivier Deprez157378f2022-04-04 15:47:50 +0200272static __always_inline long
David Brazdil0f672f62019-12-10 10:32:29 +0000273atomic_long_fetch_and(long i, atomic_long_t *v)
274{
275 return atomic64_fetch_and(i, v);
276}
277
Olivier Deprez157378f2022-04-04 15:47:50 +0200278static __always_inline long
David Brazdil0f672f62019-12-10 10:32:29 +0000279atomic_long_fetch_and_acquire(long i, atomic_long_t *v)
280{
281 return atomic64_fetch_and_acquire(i, v);
282}
283
Olivier Deprez157378f2022-04-04 15:47:50 +0200284static __always_inline long
David Brazdil0f672f62019-12-10 10:32:29 +0000285atomic_long_fetch_and_release(long i, atomic_long_t *v)
286{
287 return atomic64_fetch_and_release(i, v);
288}
289
Olivier Deprez157378f2022-04-04 15:47:50 +0200290static __always_inline long
David Brazdil0f672f62019-12-10 10:32:29 +0000291atomic_long_fetch_and_relaxed(long i, atomic_long_t *v)
292{
293 return atomic64_fetch_and_relaxed(i, v);
294}
295
Olivier Deprez157378f2022-04-04 15:47:50 +0200296static __always_inline void
David Brazdil0f672f62019-12-10 10:32:29 +0000297atomic_long_andnot(long i, atomic_long_t *v)
298{
299 atomic64_andnot(i, v);
300}
301
Olivier Deprez157378f2022-04-04 15:47:50 +0200302static __always_inline long
David Brazdil0f672f62019-12-10 10:32:29 +0000303atomic_long_fetch_andnot(long i, atomic_long_t *v)
304{
305 return atomic64_fetch_andnot(i, v);
306}
307
Olivier Deprez157378f2022-04-04 15:47:50 +0200308static __always_inline long
David Brazdil0f672f62019-12-10 10:32:29 +0000309atomic_long_fetch_andnot_acquire(long i, atomic_long_t *v)
310{
311 return atomic64_fetch_andnot_acquire(i, v);
312}
313
Olivier Deprez157378f2022-04-04 15:47:50 +0200314static __always_inline long
David Brazdil0f672f62019-12-10 10:32:29 +0000315atomic_long_fetch_andnot_release(long i, atomic_long_t *v)
316{
317 return atomic64_fetch_andnot_release(i, v);
318}
319
Olivier Deprez157378f2022-04-04 15:47:50 +0200320static __always_inline long
David Brazdil0f672f62019-12-10 10:32:29 +0000321atomic_long_fetch_andnot_relaxed(long i, atomic_long_t *v)
322{
323 return atomic64_fetch_andnot_relaxed(i, v);
324}
325
Olivier Deprez157378f2022-04-04 15:47:50 +0200326static __always_inline void
David Brazdil0f672f62019-12-10 10:32:29 +0000327atomic_long_or(long i, atomic_long_t *v)
328{
329 atomic64_or(i, v);
330}
331
Olivier Deprez157378f2022-04-04 15:47:50 +0200332static __always_inline long
David Brazdil0f672f62019-12-10 10:32:29 +0000333atomic_long_fetch_or(long i, atomic_long_t *v)
334{
335 return atomic64_fetch_or(i, v);
336}
337
Olivier Deprez157378f2022-04-04 15:47:50 +0200338static __always_inline long
David Brazdil0f672f62019-12-10 10:32:29 +0000339atomic_long_fetch_or_acquire(long i, atomic_long_t *v)
340{
341 return atomic64_fetch_or_acquire(i, v);
342}
343
Olivier Deprez157378f2022-04-04 15:47:50 +0200344static __always_inline long
David Brazdil0f672f62019-12-10 10:32:29 +0000345atomic_long_fetch_or_release(long i, atomic_long_t *v)
346{
347 return atomic64_fetch_or_release(i, v);
348}
349
Olivier Deprez157378f2022-04-04 15:47:50 +0200350static __always_inline long
David Brazdil0f672f62019-12-10 10:32:29 +0000351atomic_long_fetch_or_relaxed(long i, atomic_long_t *v)
352{
353 return atomic64_fetch_or_relaxed(i, v);
354}
355
Olivier Deprez157378f2022-04-04 15:47:50 +0200356static __always_inline void
David Brazdil0f672f62019-12-10 10:32:29 +0000357atomic_long_xor(long i, atomic_long_t *v)
358{
359 atomic64_xor(i, v);
360}
361
Olivier Deprez157378f2022-04-04 15:47:50 +0200362static __always_inline long
David Brazdil0f672f62019-12-10 10:32:29 +0000363atomic_long_fetch_xor(long i, atomic_long_t *v)
364{
365 return atomic64_fetch_xor(i, v);
366}
367
Olivier Deprez157378f2022-04-04 15:47:50 +0200368static __always_inline long
David Brazdil0f672f62019-12-10 10:32:29 +0000369atomic_long_fetch_xor_acquire(long i, atomic_long_t *v)
370{
371 return atomic64_fetch_xor_acquire(i, v);
372}
373
Olivier Deprez157378f2022-04-04 15:47:50 +0200374static __always_inline long
David Brazdil0f672f62019-12-10 10:32:29 +0000375atomic_long_fetch_xor_release(long i, atomic_long_t *v)
376{
377 return atomic64_fetch_xor_release(i, v);
378}
379
Olivier Deprez157378f2022-04-04 15:47:50 +0200380static __always_inline long
David Brazdil0f672f62019-12-10 10:32:29 +0000381atomic_long_fetch_xor_relaxed(long i, atomic_long_t *v)
382{
383 return atomic64_fetch_xor_relaxed(i, v);
384}
385
Olivier Deprez157378f2022-04-04 15:47:50 +0200386static __always_inline long
David Brazdil0f672f62019-12-10 10:32:29 +0000387atomic_long_xchg(atomic_long_t *v, long i)
388{
389 return atomic64_xchg(v, i);
390}
391
Olivier Deprez157378f2022-04-04 15:47:50 +0200392static __always_inline long
David Brazdil0f672f62019-12-10 10:32:29 +0000393atomic_long_xchg_acquire(atomic_long_t *v, long i)
394{
395 return atomic64_xchg_acquire(v, i);
396}
397
Olivier Deprez157378f2022-04-04 15:47:50 +0200398static __always_inline long
David Brazdil0f672f62019-12-10 10:32:29 +0000399atomic_long_xchg_release(atomic_long_t *v, long i)
400{
401 return atomic64_xchg_release(v, i);
402}
403
Olivier Deprez157378f2022-04-04 15:47:50 +0200404static __always_inline long
David Brazdil0f672f62019-12-10 10:32:29 +0000405atomic_long_xchg_relaxed(atomic_long_t *v, long i)
406{
407 return atomic64_xchg_relaxed(v, i);
408}
409
Olivier Deprez157378f2022-04-04 15:47:50 +0200410static __always_inline long
David Brazdil0f672f62019-12-10 10:32:29 +0000411atomic_long_cmpxchg(atomic_long_t *v, long old, long new)
412{
413 return atomic64_cmpxchg(v, old, new);
414}
415
Olivier Deprez157378f2022-04-04 15:47:50 +0200416static __always_inline long
David Brazdil0f672f62019-12-10 10:32:29 +0000417atomic_long_cmpxchg_acquire(atomic_long_t *v, long old, long new)
418{
419 return atomic64_cmpxchg_acquire(v, old, new);
420}
421
Olivier Deprez157378f2022-04-04 15:47:50 +0200422static __always_inline long
David Brazdil0f672f62019-12-10 10:32:29 +0000423atomic_long_cmpxchg_release(atomic_long_t *v, long old, long new)
424{
425 return atomic64_cmpxchg_release(v, old, new);
426}
427
Olivier Deprez157378f2022-04-04 15:47:50 +0200428static __always_inline long
David Brazdil0f672f62019-12-10 10:32:29 +0000429atomic_long_cmpxchg_relaxed(atomic_long_t *v, long old, long new)
430{
431 return atomic64_cmpxchg_relaxed(v, old, new);
432}
433
Olivier Deprez157378f2022-04-04 15:47:50 +0200434static __always_inline bool
David Brazdil0f672f62019-12-10 10:32:29 +0000435atomic_long_try_cmpxchg(atomic_long_t *v, long *old, long new)
436{
437 return atomic64_try_cmpxchg(v, (s64 *)old, new);
438}
439
Olivier Deprez157378f2022-04-04 15:47:50 +0200440static __always_inline bool
David Brazdil0f672f62019-12-10 10:32:29 +0000441atomic_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
Olivier Deprez157378f2022-04-04 15:47:50 +0200446static __always_inline bool
David Brazdil0f672f62019-12-10 10:32:29 +0000447atomic_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
Olivier Deprez157378f2022-04-04 15:47:50 +0200452static __always_inline bool
David Brazdil0f672f62019-12-10 10:32:29 +0000453atomic_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
Olivier Deprez157378f2022-04-04 15:47:50 +0200458static __always_inline bool
David Brazdil0f672f62019-12-10 10:32:29 +0000459atomic_long_sub_and_test(long i, atomic_long_t *v)
460{
461 return atomic64_sub_and_test(i, v);
462}
463
Olivier Deprez157378f2022-04-04 15:47:50 +0200464static __always_inline bool
David Brazdil0f672f62019-12-10 10:32:29 +0000465atomic_long_dec_and_test(atomic_long_t *v)
466{
467 return atomic64_dec_and_test(v);
468}
469
Olivier Deprez157378f2022-04-04 15:47:50 +0200470static __always_inline bool
David Brazdil0f672f62019-12-10 10:32:29 +0000471atomic_long_inc_and_test(atomic_long_t *v)
472{
473 return atomic64_inc_and_test(v);
474}
475
Olivier Deprez157378f2022-04-04 15:47:50 +0200476static __always_inline bool
David Brazdil0f672f62019-12-10 10:32:29 +0000477atomic_long_add_negative(long i, atomic_long_t *v)
478{
479 return atomic64_add_negative(i, v);
480}
481
Olivier Deprez157378f2022-04-04 15:47:50 +0200482static __always_inline long
David Brazdil0f672f62019-12-10 10:32:29 +0000483atomic_long_fetch_add_unless(atomic_long_t *v, long a, long u)
484{
485 return atomic64_fetch_add_unless(v, a, u);
486}
487
Olivier Deprez157378f2022-04-04 15:47:50 +0200488static __always_inline bool
David Brazdil0f672f62019-12-10 10:32:29 +0000489atomic_long_add_unless(atomic_long_t *v, long a, long u)
490{
491 return atomic64_add_unless(v, a, u);
492}
493
Olivier Deprez157378f2022-04-04 15:47:50 +0200494static __always_inline bool
David Brazdil0f672f62019-12-10 10:32:29 +0000495atomic_long_inc_not_zero(atomic_long_t *v)
496{
497 return atomic64_inc_not_zero(v);
498}
499
Olivier Deprez157378f2022-04-04 15:47:50 +0200500static __always_inline bool
David Brazdil0f672f62019-12-10 10:32:29 +0000501atomic_long_inc_unless_negative(atomic_long_t *v)
502{
503 return atomic64_inc_unless_negative(v);
504}
505
Olivier Deprez157378f2022-04-04 15:47:50 +0200506static __always_inline bool
David Brazdil0f672f62019-12-10 10:32:29 +0000507atomic_long_dec_unless_positive(atomic_long_t *v)
508{
509 return atomic64_dec_unless_positive(v);
510}
511
Olivier Deprez157378f2022-04-04 15:47:50 +0200512static __always_inline long
David Brazdil0f672f62019-12-10 10:32:29 +0000513atomic_long_dec_if_positive(atomic_long_t *v)
514{
515 return atomic64_dec_if_positive(v);
516}
517
518#else /* CONFIG_64BIT */
519
Olivier Deprez157378f2022-04-04 15:47:50 +0200520static __always_inline long
David Brazdil0f672f62019-12-10 10:32:29 +0000521atomic_long_read(const atomic_long_t *v)
522{
523 return atomic_read(v);
524}
525
Olivier Deprez157378f2022-04-04 15:47:50 +0200526static __always_inline long
David Brazdil0f672f62019-12-10 10:32:29 +0000527atomic_long_read_acquire(const atomic_long_t *v)
528{
529 return atomic_read_acquire(v);
530}
531
Olivier Deprez157378f2022-04-04 15:47:50 +0200532static __always_inline void
David Brazdil0f672f62019-12-10 10:32:29 +0000533atomic_long_set(atomic_long_t *v, long i)
534{
535 atomic_set(v, i);
536}
537
Olivier Deprez157378f2022-04-04 15:47:50 +0200538static __always_inline void
David Brazdil0f672f62019-12-10 10:32:29 +0000539atomic_long_set_release(atomic_long_t *v, long i)
540{
541 atomic_set_release(v, i);
542}
543
Olivier Deprez157378f2022-04-04 15:47:50 +0200544static __always_inline void
David Brazdil0f672f62019-12-10 10:32:29 +0000545atomic_long_add(long i, atomic_long_t *v)
546{
547 atomic_add(i, v);
548}
549
Olivier Deprez157378f2022-04-04 15:47:50 +0200550static __always_inline long
David Brazdil0f672f62019-12-10 10:32:29 +0000551atomic_long_add_return(long i, atomic_long_t *v)
552{
553 return atomic_add_return(i, v);
554}
555
Olivier Deprez157378f2022-04-04 15:47:50 +0200556static __always_inline long
David Brazdil0f672f62019-12-10 10:32:29 +0000557atomic_long_add_return_acquire(long i, atomic_long_t *v)
558{
559 return atomic_add_return_acquire(i, v);
560}
561
Olivier Deprez157378f2022-04-04 15:47:50 +0200562static __always_inline long
David Brazdil0f672f62019-12-10 10:32:29 +0000563atomic_long_add_return_release(long i, atomic_long_t *v)
564{
565 return atomic_add_return_release(i, v);
566}
567
Olivier Deprez157378f2022-04-04 15:47:50 +0200568static __always_inline long
David Brazdil0f672f62019-12-10 10:32:29 +0000569atomic_long_add_return_relaxed(long i, atomic_long_t *v)
570{
571 return atomic_add_return_relaxed(i, v);
572}
573
Olivier Deprez157378f2022-04-04 15:47:50 +0200574static __always_inline long
David Brazdil0f672f62019-12-10 10:32:29 +0000575atomic_long_fetch_add(long i, atomic_long_t *v)
576{
577 return atomic_fetch_add(i, v);
578}
579
Olivier Deprez157378f2022-04-04 15:47:50 +0200580static __always_inline long
David Brazdil0f672f62019-12-10 10:32:29 +0000581atomic_long_fetch_add_acquire(long i, atomic_long_t *v)
582{
583 return atomic_fetch_add_acquire(i, v);
584}
585
Olivier Deprez157378f2022-04-04 15:47:50 +0200586static __always_inline long
David Brazdil0f672f62019-12-10 10:32:29 +0000587atomic_long_fetch_add_release(long i, atomic_long_t *v)
588{
589 return atomic_fetch_add_release(i, v);
590}
591
Olivier Deprez157378f2022-04-04 15:47:50 +0200592static __always_inline long
David Brazdil0f672f62019-12-10 10:32:29 +0000593atomic_long_fetch_add_relaxed(long i, atomic_long_t *v)
594{
595 return atomic_fetch_add_relaxed(i, v);
596}
597
Olivier Deprez157378f2022-04-04 15:47:50 +0200598static __always_inline void
David Brazdil0f672f62019-12-10 10:32:29 +0000599atomic_long_sub(long i, atomic_long_t *v)
600{
601 atomic_sub(i, v);
602}
603
Olivier Deprez157378f2022-04-04 15:47:50 +0200604static __always_inline long
David Brazdil0f672f62019-12-10 10:32:29 +0000605atomic_long_sub_return(long i, atomic_long_t *v)
606{
607 return atomic_sub_return(i, v);
608}
609
Olivier Deprez157378f2022-04-04 15:47:50 +0200610static __always_inline long
David Brazdil0f672f62019-12-10 10:32:29 +0000611atomic_long_sub_return_acquire(long i, atomic_long_t *v)
612{
613 return atomic_sub_return_acquire(i, v);
614}
615
Olivier Deprez157378f2022-04-04 15:47:50 +0200616static __always_inline long
David Brazdil0f672f62019-12-10 10:32:29 +0000617atomic_long_sub_return_release(long i, atomic_long_t *v)
618{
619 return atomic_sub_return_release(i, v);
620}
621
Olivier Deprez157378f2022-04-04 15:47:50 +0200622static __always_inline long
David Brazdil0f672f62019-12-10 10:32:29 +0000623atomic_long_sub_return_relaxed(long i, atomic_long_t *v)
624{
625 return atomic_sub_return_relaxed(i, v);
626}
627
Olivier Deprez157378f2022-04-04 15:47:50 +0200628static __always_inline long
David Brazdil0f672f62019-12-10 10:32:29 +0000629atomic_long_fetch_sub(long i, atomic_long_t *v)
630{
631 return atomic_fetch_sub(i, v);
632}
633
Olivier Deprez157378f2022-04-04 15:47:50 +0200634static __always_inline long
David Brazdil0f672f62019-12-10 10:32:29 +0000635atomic_long_fetch_sub_acquire(long i, atomic_long_t *v)
636{
637 return atomic_fetch_sub_acquire(i, v);
638}
639
Olivier Deprez157378f2022-04-04 15:47:50 +0200640static __always_inline long
David Brazdil0f672f62019-12-10 10:32:29 +0000641atomic_long_fetch_sub_release(long i, atomic_long_t *v)
642{
643 return atomic_fetch_sub_release(i, v);
644}
645
Olivier Deprez157378f2022-04-04 15:47:50 +0200646static __always_inline long
David Brazdil0f672f62019-12-10 10:32:29 +0000647atomic_long_fetch_sub_relaxed(long i, atomic_long_t *v)
648{
649 return atomic_fetch_sub_relaxed(i, v);
650}
651
Olivier Deprez157378f2022-04-04 15:47:50 +0200652static __always_inline void
David Brazdil0f672f62019-12-10 10:32:29 +0000653atomic_long_inc(atomic_long_t *v)
654{
655 atomic_inc(v);
656}
657
Olivier Deprez157378f2022-04-04 15:47:50 +0200658static __always_inline long
David Brazdil0f672f62019-12-10 10:32:29 +0000659atomic_long_inc_return(atomic_long_t *v)
660{
661 return atomic_inc_return(v);
662}
663
Olivier Deprez157378f2022-04-04 15:47:50 +0200664static __always_inline long
David Brazdil0f672f62019-12-10 10:32:29 +0000665atomic_long_inc_return_acquire(atomic_long_t *v)
666{
667 return atomic_inc_return_acquire(v);
668}
669
Olivier Deprez157378f2022-04-04 15:47:50 +0200670static __always_inline long
David Brazdil0f672f62019-12-10 10:32:29 +0000671atomic_long_inc_return_release(atomic_long_t *v)
672{
673 return atomic_inc_return_release(v);
674}
675
Olivier Deprez157378f2022-04-04 15:47:50 +0200676static __always_inline long
David Brazdil0f672f62019-12-10 10:32:29 +0000677atomic_long_inc_return_relaxed(atomic_long_t *v)
678{
679 return atomic_inc_return_relaxed(v);
680}
681
Olivier Deprez157378f2022-04-04 15:47:50 +0200682static __always_inline long
David Brazdil0f672f62019-12-10 10:32:29 +0000683atomic_long_fetch_inc(atomic_long_t *v)
684{
685 return atomic_fetch_inc(v);
686}
687
Olivier Deprez157378f2022-04-04 15:47:50 +0200688static __always_inline long
David Brazdil0f672f62019-12-10 10:32:29 +0000689atomic_long_fetch_inc_acquire(atomic_long_t *v)
690{
691 return atomic_fetch_inc_acquire(v);
692}
693
Olivier Deprez157378f2022-04-04 15:47:50 +0200694static __always_inline long
David Brazdil0f672f62019-12-10 10:32:29 +0000695atomic_long_fetch_inc_release(atomic_long_t *v)
696{
697 return atomic_fetch_inc_release(v);
698}
699
Olivier Deprez157378f2022-04-04 15:47:50 +0200700static __always_inline long
David Brazdil0f672f62019-12-10 10:32:29 +0000701atomic_long_fetch_inc_relaxed(atomic_long_t *v)
702{
703 return atomic_fetch_inc_relaxed(v);
704}
705
Olivier Deprez157378f2022-04-04 15:47:50 +0200706static __always_inline void
David Brazdil0f672f62019-12-10 10:32:29 +0000707atomic_long_dec(atomic_long_t *v)
708{
709 atomic_dec(v);
710}
711
Olivier Deprez157378f2022-04-04 15:47:50 +0200712static __always_inline long
David Brazdil0f672f62019-12-10 10:32:29 +0000713atomic_long_dec_return(atomic_long_t *v)
714{
715 return atomic_dec_return(v);
716}
717
Olivier Deprez157378f2022-04-04 15:47:50 +0200718static __always_inline long
David Brazdil0f672f62019-12-10 10:32:29 +0000719atomic_long_dec_return_acquire(atomic_long_t *v)
720{
721 return atomic_dec_return_acquire(v);
722}
723
Olivier Deprez157378f2022-04-04 15:47:50 +0200724static __always_inline long
David Brazdil0f672f62019-12-10 10:32:29 +0000725atomic_long_dec_return_release(atomic_long_t *v)
726{
727 return atomic_dec_return_release(v);
728}
729
Olivier Deprez157378f2022-04-04 15:47:50 +0200730static __always_inline long
David Brazdil0f672f62019-12-10 10:32:29 +0000731atomic_long_dec_return_relaxed(atomic_long_t *v)
732{
733 return atomic_dec_return_relaxed(v);
734}
735
Olivier Deprez157378f2022-04-04 15:47:50 +0200736static __always_inline long
David Brazdil0f672f62019-12-10 10:32:29 +0000737atomic_long_fetch_dec(atomic_long_t *v)
738{
739 return atomic_fetch_dec(v);
740}
741
Olivier Deprez157378f2022-04-04 15:47:50 +0200742static __always_inline long
David Brazdil0f672f62019-12-10 10:32:29 +0000743atomic_long_fetch_dec_acquire(atomic_long_t *v)
744{
745 return atomic_fetch_dec_acquire(v);
746}
747
Olivier Deprez157378f2022-04-04 15:47:50 +0200748static __always_inline long
David Brazdil0f672f62019-12-10 10:32:29 +0000749atomic_long_fetch_dec_release(atomic_long_t *v)
750{
751 return atomic_fetch_dec_release(v);
752}
753
Olivier Deprez157378f2022-04-04 15:47:50 +0200754static __always_inline long
David Brazdil0f672f62019-12-10 10:32:29 +0000755atomic_long_fetch_dec_relaxed(atomic_long_t *v)
756{
757 return atomic_fetch_dec_relaxed(v);
758}
759
Olivier Deprez157378f2022-04-04 15:47:50 +0200760static __always_inline void
David Brazdil0f672f62019-12-10 10:32:29 +0000761atomic_long_and(long i, atomic_long_t *v)
762{
763 atomic_and(i, v);
764}
765
Olivier Deprez157378f2022-04-04 15:47:50 +0200766static __always_inline long
David Brazdil0f672f62019-12-10 10:32:29 +0000767atomic_long_fetch_and(long i, atomic_long_t *v)
768{
769 return atomic_fetch_and(i, v);
770}
771
Olivier Deprez157378f2022-04-04 15:47:50 +0200772static __always_inline long
David Brazdil0f672f62019-12-10 10:32:29 +0000773atomic_long_fetch_and_acquire(long i, atomic_long_t *v)
774{
775 return atomic_fetch_and_acquire(i, v);
776}
777
Olivier Deprez157378f2022-04-04 15:47:50 +0200778static __always_inline long
David Brazdil0f672f62019-12-10 10:32:29 +0000779atomic_long_fetch_and_release(long i, atomic_long_t *v)
780{
781 return atomic_fetch_and_release(i, v);
782}
783
Olivier Deprez157378f2022-04-04 15:47:50 +0200784static __always_inline long
David Brazdil0f672f62019-12-10 10:32:29 +0000785atomic_long_fetch_and_relaxed(long i, atomic_long_t *v)
786{
787 return atomic_fetch_and_relaxed(i, v);
788}
789
Olivier Deprez157378f2022-04-04 15:47:50 +0200790static __always_inline void
David Brazdil0f672f62019-12-10 10:32:29 +0000791atomic_long_andnot(long i, atomic_long_t *v)
792{
793 atomic_andnot(i, v);
794}
795
Olivier Deprez157378f2022-04-04 15:47:50 +0200796static __always_inline long
David Brazdil0f672f62019-12-10 10:32:29 +0000797atomic_long_fetch_andnot(long i, atomic_long_t *v)
798{
799 return atomic_fetch_andnot(i, v);
800}
801
Olivier Deprez157378f2022-04-04 15:47:50 +0200802static __always_inline long
David Brazdil0f672f62019-12-10 10:32:29 +0000803atomic_long_fetch_andnot_acquire(long i, atomic_long_t *v)
804{
805 return atomic_fetch_andnot_acquire(i, v);
806}
807
Olivier Deprez157378f2022-04-04 15:47:50 +0200808static __always_inline long
David Brazdil0f672f62019-12-10 10:32:29 +0000809atomic_long_fetch_andnot_release(long i, atomic_long_t *v)
810{
811 return atomic_fetch_andnot_release(i, v);
812}
813
Olivier Deprez157378f2022-04-04 15:47:50 +0200814static __always_inline long
David Brazdil0f672f62019-12-10 10:32:29 +0000815atomic_long_fetch_andnot_relaxed(long i, atomic_long_t *v)
816{
817 return atomic_fetch_andnot_relaxed(i, v);
818}
819
Olivier Deprez157378f2022-04-04 15:47:50 +0200820static __always_inline void
David Brazdil0f672f62019-12-10 10:32:29 +0000821atomic_long_or(long i, atomic_long_t *v)
822{
823 atomic_or(i, v);
824}
825
Olivier Deprez157378f2022-04-04 15:47:50 +0200826static __always_inline long
David Brazdil0f672f62019-12-10 10:32:29 +0000827atomic_long_fetch_or(long i, atomic_long_t *v)
828{
829 return atomic_fetch_or(i, v);
830}
831
Olivier Deprez157378f2022-04-04 15:47:50 +0200832static __always_inline long
David Brazdil0f672f62019-12-10 10:32:29 +0000833atomic_long_fetch_or_acquire(long i, atomic_long_t *v)
834{
835 return atomic_fetch_or_acquire(i, v);
836}
837
Olivier Deprez157378f2022-04-04 15:47:50 +0200838static __always_inline long
David Brazdil0f672f62019-12-10 10:32:29 +0000839atomic_long_fetch_or_release(long i, atomic_long_t *v)
840{
841 return atomic_fetch_or_release(i, v);
842}
843
Olivier Deprez157378f2022-04-04 15:47:50 +0200844static __always_inline long
David Brazdil0f672f62019-12-10 10:32:29 +0000845atomic_long_fetch_or_relaxed(long i, atomic_long_t *v)
846{
847 return atomic_fetch_or_relaxed(i, v);
848}
849
Olivier Deprez157378f2022-04-04 15:47:50 +0200850static __always_inline void
David Brazdil0f672f62019-12-10 10:32:29 +0000851atomic_long_xor(long i, atomic_long_t *v)
852{
853 atomic_xor(i, v);
854}
855
Olivier Deprez157378f2022-04-04 15:47:50 +0200856static __always_inline long
David Brazdil0f672f62019-12-10 10:32:29 +0000857atomic_long_fetch_xor(long i, atomic_long_t *v)
858{
859 return atomic_fetch_xor(i, v);
860}
861
Olivier Deprez157378f2022-04-04 15:47:50 +0200862static __always_inline long
David Brazdil0f672f62019-12-10 10:32:29 +0000863atomic_long_fetch_xor_acquire(long i, atomic_long_t *v)
864{
865 return atomic_fetch_xor_acquire(i, v);
866}
867
Olivier Deprez157378f2022-04-04 15:47:50 +0200868static __always_inline long
David Brazdil0f672f62019-12-10 10:32:29 +0000869atomic_long_fetch_xor_release(long i, atomic_long_t *v)
870{
871 return atomic_fetch_xor_release(i, v);
872}
873
Olivier Deprez157378f2022-04-04 15:47:50 +0200874static __always_inline long
David Brazdil0f672f62019-12-10 10:32:29 +0000875atomic_long_fetch_xor_relaxed(long i, atomic_long_t *v)
876{
877 return atomic_fetch_xor_relaxed(i, v);
878}
879
Olivier Deprez157378f2022-04-04 15:47:50 +0200880static __always_inline long
David Brazdil0f672f62019-12-10 10:32:29 +0000881atomic_long_xchg(atomic_long_t *v, long i)
882{
883 return atomic_xchg(v, i);
884}
885
Olivier Deprez157378f2022-04-04 15:47:50 +0200886static __always_inline long
David Brazdil0f672f62019-12-10 10:32:29 +0000887atomic_long_xchg_acquire(atomic_long_t *v, long i)
888{
889 return atomic_xchg_acquire(v, i);
890}
891
Olivier Deprez157378f2022-04-04 15:47:50 +0200892static __always_inline long
David Brazdil0f672f62019-12-10 10:32:29 +0000893atomic_long_xchg_release(atomic_long_t *v, long i)
894{
895 return atomic_xchg_release(v, i);
896}
897
Olivier Deprez157378f2022-04-04 15:47:50 +0200898static __always_inline long
David Brazdil0f672f62019-12-10 10:32:29 +0000899atomic_long_xchg_relaxed(atomic_long_t *v, long i)
900{
901 return atomic_xchg_relaxed(v, i);
902}
903
Olivier Deprez157378f2022-04-04 15:47:50 +0200904static __always_inline long
David Brazdil0f672f62019-12-10 10:32:29 +0000905atomic_long_cmpxchg(atomic_long_t *v, long old, long new)
906{
907 return atomic_cmpxchg(v, old, new);
908}
909
Olivier Deprez157378f2022-04-04 15:47:50 +0200910static __always_inline long
David Brazdil0f672f62019-12-10 10:32:29 +0000911atomic_long_cmpxchg_acquire(atomic_long_t *v, long old, long new)
912{
913 return atomic_cmpxchg_acquire(v, old, new);
914}
915
Olivier Deprez157378f2022-04-04 15:47:50 +0200916static __always_inline long
David Brazdil0f672f62019-12-10 10:32:29 +0000917atomic_long_cmpxchg_release(atomic_long_t *v, long old, long new)
918{
919 return atomic_cmpxchg_release(v, old, new);
920}
921
Olivier Deprez157378f2022-04-04 15:47:50 +0200922static __always_inline long
David Brazdil0f672f62019-12-10 10:32:29 +0000923atomic_long_cmpxchg_relaxed(atomic_long_t *v, long old, long new)
924{
925 return atomic_cmpxchg_relaxed(v, old, new);
926}
927
Olivier Deprez157378f2022-04-04 15:47:50 +0200928static __always_inline bool
David Brazdil0f672f62019-12-10 10:32:29 +0000929atomic_long_try_cmpxchg(atomic_long_t *v, long *old, long new)
930{
931 return atomic_try_cmpxchg(v, (int *)old, new);
932}
933
Olivier Deprez157378f2022-04-04 15:47:50 +0200934static __always_inline bool
David Brazdil0f672f62019-12-10 10:32:29 +0000935atomic_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
Olivier Deprez157378f2022-04-04 15:47:50 +0200940static __always_inline bool
David Brazdil0f672f62019-12-10 10:32:29 +0000941atomic_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
Olivier Deprez157378f2022-04-04 15:47:50 +0200946static __always_inline bool
David Brazdil0f672f62019-12-10 10:32:29 +0000947atomic_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
Olivier Deprez157378f2022-04-04 15:47:50 +0200952static __always_inline bool
David Brazdil0f672f62019-12-10 10:32:29 +0000953atomic_long_sub_and_test(long i, atomic_long_t *v)
954{
955 return atomic_sub_and_test(i, v);
956}
957
Olivier Deprez157378f2022-04-04 15:47:50 +0200958static __always_inline bool
David Brazdil0f672f62019-12-10 10:32:29 +0000959atomic_long_dec_and_test(atomic_long_t *v)
960{
961 return atomic_dec_and_test(v);
962}
963
Olivier Deprez157378f2022-04-04 15:47:50 +0200964static __always_inline bool
David Brazdil0f672f62019-12-10 10:32:29 +0000965atomic_long_inc_and_test(atomic_long_t *v)
966{
967 return atomic_inc_and_test(v);
968}
969
Olivier Deprez157378f2022-04-04 15:47:50 +0200970static __always_inline bool
David Brazdil0f672f62019-12-10 10:32:29 +0000971atomic_long_add_negative(long i, atomic_long_t *v)
972{
973 return atomic_add_negative(i, v);
974}
975
Olivier Deprez157378f2022-04-04 15:47:50 +0200976static __always_inline long
David Brazdil0f672f62019-12-10 10:32:29 +0000977atomic_long_fetch_add_unless(atomic_long_t *v, long a, long u)
978{
979 return atomic_fetch_add_unless(v, a, u);
980}
981
Olivier Deprez157378f2022-04-04 15:47:50 +0200982static __always_inline bool
David Brazdil0f672f62019-12-10 10:32:29 +0000983atomic_long_add_unless(atomic_long_t *v, long a, long u)
984{
985 return atomic_add_unless(v, a, u);
986}
987
Olivier Deprez157378f2022-04-04 15:47:50 +0200988static __always_inline bool
David Brazdil0f672f62019-12-10 10:32:29 +0000989atomic_long_inc_not_zero(atomic_long_t *v)
990{
991 return atomic_inc_not_zero(v);
992}
993
Olivier Deprez157378f2022-04-04 15:47:50 +0200994static __always_inline bool
David Brazdil0f672f62019-12-10 10:32:29 +0000995atomic_long_inc_unless_negative(atomic_long_t *v)
996{
997 return atomic_inc_unless_negative(v);
998}
999
Olivier Deprez157378f2022-04-04 15:47:50 +02001000static __always_inline bool
David Brazdil0f672f62019-12-10 10:32:29 +00001001atomic_long_dec_unless_positive(atomic_long_t *v)
1002{
1003 return atomic_dec_unless_positive(v);
1004}
1005
Olivier Deprez157378f2022-04-04 15:47:50 +02001006static __always_inline long
David Brazdil0f672f62019-12-10 10:32:29 +00001007atomic_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 */
Olivier Deprez157378f2022-04-04 15:47:50 +02001014// a624200981f552b2c6be4f32fe44da8289f30d87