brintos

brintos / linux-shallow public Read only

0
0
Text · 46.1 KiB · f86b29d Raw
1813 lines · c
1// SPDX-License-Identifier: GPL-2.02 3// Generated by scripts/atomic/gen-atomic-long.sh4// DO NOT MODIFY THIS FILE DIRECTLY5 6#ifndef _LINUX_ATOMIC_LONG_H7#define _LINUX_ATOMIC_LONG_H8 9#include <linux/compiler.h>10#include <asm/types.h>11 12#ifdef CONFIG_64BIT13typedef atomic64_t atomic_long_t;14#define ATOMIC_LONG_INIT(i)		ATOMIC64_INIT(i)15#define atomic_long_cond_read_acquire	atomic64_cond_read_acquire16#define atomic_long_cond_read_relaxed	atomic64_cond_read_relaxed17#else18typedef atomic_t atomic_long_t;19#define ATOMIC_LONG_INIT(i)		ATOMIC_INIT(i)20#define atomic_long_cond_read_acquire	atomic_cond_read_acquire21#define atomic_long_cond_read_relaxed	atomic_cond_read_relaxed22#endif23 24/**25 * raw_atomic_long_read() - atomic load with relaxed ordering26 * @v: pointer to atomic_long_t27 *28 * Atomically loads the value of @v with relaxed ordering.29 *30 * Safe to use in noinstr code; prefer atomic_long_read() elsewhere.31 *32 * Return: The value loaded from @v.33 */34static __always_inline long35raw_atomic_long_read(const atomic_long_t *v)36{37#ifdef CONFIG_64BIT38	return raw_atomic64_read(v);39#else40	return raw_atomic_read(v);41#endif42}43 44/**45 * raw_atomic_long_read_acquire() - atomic load with acquire ordering46 * @v: pointer to atomic_long_t47 *48 * Atomically loads the value of @v with acquire ordering.49 *50 * Safe to use in noinstr code; prefer atomic_long_read_acquire() elsewhere.51 *52 * Return: The value loaded from @v.53 */54static __always_inline long55raw_atomic_long_read_acquire(const atomic_long_t *v)56{57#ifdef CONFIG_64BIT58	return raw_atomic64_read_acquire(v);59#else60	return raw_atomic_read_acquire(v);61#endif62}63 64/**65 * raw_atomic_long_set() - atomic set with relaxed ordering66 * @v: pointer to atomic_long_t67 * @i: long value to assign68 *69 * Atomically sets @v to @i with relaxed ordering.70 *71 * Safe to use in noinstr code; prefer atomic_long_set() elsewhere.72 *73 * Return: Nothing.74 */75static __always_inline void76raw_atomic_long_set(atomic_long_t *v, long i)77{78#ifdef CONFIG_64BIT79	raw_atomic64_set(v, i);80#else81	raw_atomic_set(v, i);82#endif83}84 85/**86 * raw_atomic_long_set_release() - atomic set with release ordering87 * @v: pointer to atomic_long_t88 * @i: long value to assign89 *90 * Atomically sets @v to @i with release ordering.91 *92 * Safe to use in noinstr code; prefer atomic_long_set_release() elsewhere.93 *94 * Return: Nothing.95 */96static __always_inline void97raw_atomic_long_set_release(atomic_long_t *v, long i)98{99#ifdef CONFIG_64BIT100	raw_atomic64_set_release(v, i);101#else102	raw_atomic_set_release(v, i);103#endif104}105 106/**107 * raw_atomic_long_add() - atomic add with relaxed ordering108 * @i: long value to add109 * @v: pointer to atomic_long_t110 *111 * Atomically updates @v to (@v + @i) with relaxed ordering.112 *113 * Safe to use in noinstr code; prefer atomic_long_add() elsewhere.114 *115 * Return: Nothing.116 */117static __always_inline void118raw_atomic_long_add(long i, atomic_long_t *v)119{120#ifdef CONFIG_64BIT121	raw_atomic64_add(i, v);122#else123	raw_atomic_add(i, v);124#endif125}126 127/**128 * raw_atomic_long_add_return() - atomic add with full ordering129 * @i: long value to add130 * @v: pointer to atomic_long_t131 *132 * Atomically updates @v to (@v + @i) with full ordering.133 *134 * Safe to use in noinstr code; prefer atomic_long_add_return() elsewhere.135 *136 * Return: The updated value of @v.137 */138static __always_inline long139raw_atomic_long_add_return(long i, atomic_long_t *v)140{141#ifdef CONFIG_64BIT142	return raw_atomic64_add_return(i, v);143#else144	return raw_atomic_add_return(i, v);145#endif146}147 148/**149 * raw_atomic_long_add_return_acquire() - atomic add with acquire ordering150 * @i: long value to add151 * @v: pointer to atomic_long_t152 *153 * Atomically updates @v to (@v + @i) with acquire ordering.154 *155 * Safe to use in noinstr code; prefer atomic_long_add_return_acquire() elsewhere.156 *157 * Return: The updated value of @v.158 */159static __always_inline long160raw_atomic_long_add_return_acquire(long i, atomic_long_t *v)161{162#ifdef CONFIG_64BIT163	return raw_atomic64_add_return_acquire(i, v);164#else165	return raw_atomic_add_return_acquire(i, v);166#endif167}168 169/**170 * raw_atomic_long_add_return_release() - atomic add with release ordering171 * @i: long value to add172 * @v: pointer to atomic_long_t173 *174 * Atomically updates @v to (@v + @i) with release ordering.175 *176 * Safe to use in noinstr code; prefer atomic_long_add_return_release() elsewhere.177 *178 * Return: The updated value of @v.179 */180static __always_inline long181raw_atomic_long_add_return_release(long i, atomic_long_t *v)182{183#ifdef CONFIG_64BIT184	return raw_atomic64_add_return_release(i, v);185#else186	return raw_atomic_add_return_release(i, v);187#endif188}189 190/**191 * raw_atomic_long_add_return_relaxed() - atomic add with relaxed ordering192 * @i: long value to add193 * @v: pointer to atomic_long_t194 *195 * Atomically updates @v to (@v + @i) with relaxed ordering.196 *197 * Safe to use in noinstr code; prefer atomic_long_add_return_relaxed() elsewhere.198 *199 * Return: The updated value of @v.200 */201static __always_inline long202raw_atomic_long_add_return_relaxed(long i, atomic_long_t *v)203{204#ifdef CONFIG_64BIT205	return raw_atomic64_add_return_relaxed(i, v);206#else207	return raw_atomic_add_return_relaxed(i, v);208#endif209}210 211/**212 * raw_atomic_long_fetch_add() - atomic add with full ordering213 * @i: long value to add214 * @v: pointer to atomic_long_t215 *216 * Atomically updates @v to (@v + @i) with full ordering.217 *218 * Safe to use in noinstr code; prefer atomic_long_fetch_add() elsewhere.219 *220 * Return: The original value of @v.221 */222static __always_inline long223raw_atomic_long_fetch_add(long i, atomic_long_t *v)224{225#ifdef CONFIG_64BIT226	return raw_atomic64_fetch_add(i, v);227#else228	return raw_atomic_fetch_add(i, v);229#endif230}231 232/**233 * raw_atomic_long_fetch_add_acquire() - atomic add with acquire ordering234 * @i: long value to add235 * @v: pointer to atomic_long_t236 *237 * Atomically updates @v to (@v + @i) with acquire ordering.238 *239 * Safe to use in noinstr code; prefer atomic_long_fetch_add_acquire() elsewhere.240 *241 * Return: The original value of @v.242 */243static __always_inline long244raw_atomic_long_fetch_add_acquire(long i, atomic_long_t *v)245{246#ifdef CONFIG_64BIT247	return raw_atomic64_fetch_add_acquire(i, v);248#else249	return raw_atomic_fetch_add_acquire(i, v);250#endif251}252 253/**254 * raw_atomic_long_fetch_add_release() - atomic add with release ordering255 * @i: long value to add256 * @v: pointer to atomic_long_t257 *258 * Atomically updates @v to (@v + @i) with release ordering.259 *260 * Safe to use in noinstr code; prefer atomic_long_fetch_add_release() elsewhere.261 *262 * Return: The original value of @v.263 */264static __always_inline long265raw_atomic_long_fetch_add_release(long i, atomic_long_t *v)266{267#ifdef CONFIG_64BIT268	return raw_atomic64_fetch_add_release(i, v);269#else270	return raw_atomic_fetch_add_release(i, v);271#endif272}273 274/**275 * raw_atomic_long_fetch_add_relaxed() - atomic add with relaxed ordering276 * @i: long value to add277 * @v: pointer to atomic_long_t278 *279 * Atomically updates @v to (@v + @i) with relaxed ordering.280 *281 * Safe to use in noinstr code; prefer atomic_long_fetch_add_relaxed() elsewhere.282 *283 * Return: The original value of @v.284 */285static __always_inline long286raw_atomic_long_fetch_add_relaxed(long i, atomic_long_t *v)287{288#ifdef CONFIG_64BIT289	return raw_atomic64_fetch_add_relaxed(i, v);290#else291	return raw_atomic_fetch_add_relaxed(i, v);292#endif293}294 295/**296 * raw_atomic_long_sub() - atomic subtract with relaxed ordering297 * @i: long value to subtract298 * @v: pointer to atomic_long_t299 *300 * Atomically updates @v to (@v - @i) with relaxed ordering.301 *302 * Safe to use in noinstr code; prefer atomic_long_sub() elsewhere.303 *304 * Return: Nothing.305 */306static __always_inline void307raw_atomic_long_sub(long i, atomic_long_t *v)308{309#ifdef CONFIG_64BIT310	raw_atomic64_sub(i, v);311#else312	raw_atomic_sub(i, v);313#endif314}315 316/**317 * raw_atomic_long_sub_return() - atomic subtract with full ordering318 * @i: long value to subtract319 * @v: pointer to atomic_long_t320 *321 * Atomically updates @v to (@v - @i) with full ordering.322 *323 * Safe to use in noinstr code; prefer atomic_long_sub_return() elsewhere.324 *325 * Return: The updated value of @v.326 */327static __always_inline long328raw_atomic_long_sub_return(long i, atomic_long_t *v)329{330#ifdef CONFIG_64BIT331	return raw_atomic64_sub_return(i, v);332#else333	return raw_atomic_sub_return(i, v);334#endif335}336 337/**338 * raw_atomic_long_sub_return_acquire() - atomic subtract with acquire ordering339 * @i: long value to subtract340 * @v: pointer to atomic_long_t341 *342 * Atomically updates @v to (@v - @i) with acquire ordering.343 *344 * Safe to use in noinstr code; prefer atomic_long_sub_return_acquire() elsewhere.345 *346 * Return: The updated value of @v.347 */348static __always_inline long349raw_atomic_long_sub_return_acquire(long i, atomic_long_t *v)350{351#ifdef CONFIG_64BIT352	return raw_atomic64_sub_return_acquire(i, v);353#else354	return raw_atomic_sub_return_acquire(i, v);355#endif356}357 358/**359 * raw_atomic_long_sub_return_release() - atomic subtract with release ordering360 * @i: long value to subtract361 * @v: pointer to atomic_long_t362 *363 * Atomically updates @v to (@v - @i) with release ordering.364 *365 * Safe to use in noinstr code; prefer atomic_long_sub_return_release() elsewhere.366 *367 * Return: The updated value of @v.368 */369static __always_inline long370raw_atomic_long_sub_return_release(long i, atomic_long_t *v)371{372#ifdef CONFIG_64BIT373	return raw_atomic64_sub_return_release(i, v);374#else375	return raw_atomic_sub_return_release(i, v);376#endif377}378 379/**380 * raw_atomic_long_sub_return_relaxed() - atomic subtract with relaxed ordering381 * @i: long value to subtract382 * @v: pointer to atomic_long_t383 *384 * Atomically updates @v to (@v - @i) with relaxed ordering.385 *386 * Safe to use in noinstr code; prefer atomic_long_sub_return_relaxed() elsewhere.387 *388 * Return: The updated value of @v.389 */390static __always_inline long391raw_atomic_long_sub_return_relaxed(long i, atomic_long_t *v)392{393#ifdef CONFIG_64BIT394	return raw_atomic64_sub_return_relaxed(i, v);395#else396	return raw_atomic_sub_return_relaxed(i, v);397#endif398}399 400/**401 * raw_atomic_long_fetch_sub() - atomic subtract with full ordering402 * @i: long value to subtract403 * @v: pointer to atomic_long_t404 *405 * Atomically updates @v to (@v - @i) with full ordering.406 *407 * Safe to use in noinstr code; prefer atomic_long_fetch_sub() elsewhere.408 *409 * Return: The original value of @v.410 */411static __always_inline long412raw_atomic_long_fetch_sub(long i, atomic_long_t *v)413{414#ifdef CONFIG_64BIT415	return raw_atomic64_fetch_sub(i, v);416#else417	return raw_atomic_fetch_sub(i, v);418#endif419}420 421/**422 * raw_atomic_long_fetch_sub_acquire() - atomic subtract with acquire ordering423 * @i: long value to subtract424 * @v: pointer to atomic_long_t425 *426 * Atomically updates @v to (@v - @i) with acquire ordering.427 *428 * Safe to use in noinstr code; prefer atomic_long_fetch_sub_acquire() elsewhere.429 *430 * Return: The original value of @v.431 */432static __always_inline long433raw_atomic_long_fetch_sub_acquire(long i, atomic_long_t *v)434{435#ifdef CONFIG_64BIT436	return raw_atomic64_fetch_sub_acquire(i, v);437#else438	return raw_atomic_fetch_sub_acquire(i, v);439#endif440}441 442/**443 * raw_atomic_long_fetch_sub_release() - atomic subtract with release ordering444 * @i: long value to subtract445 * @v: pointer to atomic_long_t446 *447 * Atomically updates @v to (@v - @i) with release ordering.448 *449 * Safe to use in noinstr code; prefer atomic_long_fetch_sub_release() elsewhere.450 *451 * Return: The original value of @v.452 */453static __always_inline long454raw_atomic_long_fetch_sub_release(long i, atomic_long_t *v)455{456#ifdef CONFIG_64BIT457	return raw_atomic64_fetch_sub_release(i, v);458#else459	return raw_atomic_fetch_sub_release(i, v);460#endif461}462 463/**464 * raw_atomic_long_fetch_sub_relaxed() - atomic subtract with relaxed ordering465 * @i: long value to subtract466 * @v: pointer to atomic_long_t467 *468 * Atomically updates @v to (@v - @i) with relaxed ordering.469 *470 * Safe to use in noinstr code; prefer atomic_long_fetch_sub_relaxed() elsewhere.471 *472 * Return: The original value of @v.473 */474static __always_inline long475raw_atomic_long_fetch_sub_relaxed(long i, atomic_long_t *v)476{477#ifdef CONFIG_64BIT478	return raw_atomic64_fetch_sub_relaxed(i, v);479#else480	return raw_atomic_fetch_sub_relaxed(i, v);481#endif482}483 484/**485 * raw_atomic_long_inc() - atomic increment with relaxed ordering486 * @v: pointer to atomic_long_t487 *488 * Atomically updates @v to (@v + 1) with relaxed ordering.489 *490 * Safe to use in noinstr code; prefer atomic_long_inc() elsewhere.491 *492 * Return: Nothing.493 */494static __always_inline void495raw_atomic_long_inc(atomic_long_t *v)496{497#ifdef CONFIG_64BIT498	raw_atomic64_inc(v);499#else500	raw_atomic_inc(v);501#endif502}503 504/**505 * raw_atomic_long_inc_return() - atomic increment with full ordering506 * @v: pointer to atomic_long_t507 *508 * Atomically updates @v to (@v + 1) with full ordering.509 *510 * Safe to use in noinstr code; prefer atomic_long_inc_return() elsewhere.511 *512 * Return: The updated value of @v.513 */514static __always_inline long515raw_atomic_long_inc_return(atomic_long_t *v)516{517#ifdef CONFIG_64BIT518	return raw_atomic64_inc_return(v);519#else520	return raw_atomic_inc_return(v);521#endif522}523 524/**525 * raw_atomic_long_inc_return_acquire() - atomic increment with acquire ordering526 * @v: pointer to atomic_long_t527 *528 * Atomically updates @v to (@v + 1) with acquire ordering.529 *530 * Safe to use in noinstr code; prefer atomic_long_inc_return_acquire() elsewhere.531 *532 * Return: The updated value of @v.533 */534static __always_inline long535raw_atomic_long_inc_return_acquire(atomic_long_t *v)536{537#ifdef CONFIG_64BIT538	return raw_atomic64_inc_return_acquire(v);539#else540	return raw_atomic_inc_return_acquire(v);541#endif542}543 544/**545 * raw_atomic_long_inc_return_release() - atomic increment with release ordering546 * @v: pointer to atomic_long_t547 *548 * Atomically updates @v to (@v + 1) with release ordering.549 *550 * Safe to use in noinstr code; prefer atomic_long_inc_return_release() elsewhere.551 *552 * Return: The updated value of @v.553 */554static __always_inline long555raw_atomic_long_inc_return_release(atomic_long_t *v)556{557#ifdef CONFIG_64BIT558	return raw_atomic64_inc_return_release(v);559#else560	return raw_atomic_inc_return_release(v);561#endif562}563 564/**565 * raw_atomic_long_inc_return_relaxed() - atomic increment with relaxed ordering566 * @v: pointer to atomic_long_t567 *568 * Atomically updates @v to (@v + 1) with relaxed ordering.569 *570 * Safe to use in noinstr code; prefer atomic_long_inc_return_relaxed() elsewhere.571 *572 * Return: The updated value of @v.573 */574static __always_inline long575raw_atomic_long_inc_return_relaxed(atomic_long_t *v)576{577#ifdef CONFIG_64BIT578	return raw_atomic64_inc_return_relaxed(v);579#else580	return raw_atomic_inc_return_relaxed(v);581#endif582}583 584/**585 * raw_atomic_long_fetch_inc() - atomic increment with full ordering586 * @v: pointer to atomic_long_t587 *588 * Atomically updates @v to (@v + 1) with full ordering.589 *590 * Safe to use in noinstr code; prefer atomic_long_fetch_inc() elsewhere.591 *592 * Return: The original value of @v.593 */594static __always_inline long595raw_atomic_long_fetch_inc(atomic_long_t *v)596{597#ifdef CONFIG_64BIT598	return raw_atomic64_fetch_inc(v);599#else600	return raw_atomic_fetch_inc(v);601#endif602}603 604/**605 * raw_atomic_long_fetch_inc_acquire() - atomic increment with acquire ordering606 * @v: pointer to atomic_long_t607 *608 * Atomically updates @v to (@v + 1) with acquire ordering.609 *610 * Safe to use in noinstr code; prefer atomic_long_fetch_inc_acquire() elsewhere.611 *612 * Return: The original value of @v.613 */614static __always_inline long615raw_atomic_long_fetch_inc_acquire(atomic_long_t *v)616{617#ifdef CONFIG_64BIT618	return raw_atomic64_fetch_inc_acquire(v);619#else620	return raw_atomic_fetch_inc_acquire(v);621#endif622}623 624/**625 * raw_atomic_long_fetch_inc_release() - atomic increment with release ordering626 * @v: pointer to atomic_long_t627 *628 * Atomically updates @v to (@v + 1) with release ordering.629 *630 * Safe to use in noinstr code; prefer atomic_long_fetch_inc_release() elsewhere.631 *632 * Return: The original value of @v.633 */634static __always_inline long635raw_atomic_long_fetch_inc_release(atomic_long_t *v)636{637#ifdef CONFIG_64BIT638	return raw_atomic64_fetch_inc_release(v);639#else640	return raw_atomic_fetch_inc_release(v);641#endif642}643 644/**645 * raw_atomic_long_fetch_inc_relaxed() - atomic increment with relaxed ordering646 * @v: pointer to atomic_long_t647 *648 * Atomically updates @v to (@v + 1) with relaxed ordering.649 *650 * Safe to use in noinstr code; prefer atomic_long_fetch_inc_relaxed() elsewhere.651 *652 * Return: The original value of @v.653 */654static __always_inline long655raw_atomic_long_fetch_inc_relaxed(atomic_long_t *v)656{657#ifdef CONFIG_64BIT658	return raw_atomic64_fetch_inc_relaxed(v);659#else660	return raw_atomic_fetch_inc_relaxed(v);661#endif662}663 664/**665 * raw_atomic_long_dec() - atomic decrement with relaxed ordering666 * @v: pointer to atomic_long_t667 *668 * Atomically updates @v to (@v - 1) with relaxed ordering.669 *670 * Safe to use in noinstr code; prefer atomic_long_dec() elsewhere.671 *672 * Return: Nothing.673 */674static __always_inline void675raw_atomic_long_dec(atomic_long_t *v)676{677#ifdef CONFIG_64BIT678	raw_atomic64_dec(v);679#else680	raw_atomic_dec(v);681#endif682}683 684/**685 * raw_atomic_long_dec_return() - atomic decrement with full ordering686 * @v: pointer to atomic_long_t687 *688 * Atomically updates @v to (@v - 1) with full ordering.689 *690 * Safe to use in noinstr code; prefer atomic_long_dec_return() elsewhere.691 *692 * Return: The updated value of @v.693 */694static __always_inline long695raw_atomic_long_dec_return(atomic_long_t *v)696{697#ifdef CONFIG_64BIT698	return raw_atomic64_dec_return(v);699#else700	return raw_atomic_dec_return(v);701#endif702}703 704/**705 * raw_atomic_long_dec_return_acquire() - atomic decrement with acquire ordering706 * @v: pointer to atomic_long_t707 *708 * Atomically updates @v to (@v - 1) with acquire ordering.709 *710 * Safe to use in noinstr code; prefer atomic_long_dec_return_acquire() elsewhere.711 *712 * Return: The updated value of @v.713 */714static __always_inline long715raw_atomic_long_dec_return_acquire(atomic_long_t *v)716{717#ifdef CONFIG_64BIT718	return raw_atomic64_dec_return_acquire(v);719#else720	return raw_atomic_dec_return_acquire(v);721#endif722}723 724/**725 * raw_atomic_long_dec_return_release() - atomic decrement with release ordering726 * @v: pointer to atomic_long_t727 *728 * Atomically updates @v to (@v - 1) with release ordering.729 *730 * Safe to use in noinstr code; prefer atomic_long_dec_return_release() elsewhere.731 *732 * Return: The updated value of @v.733 */734static __always_inline long735raw_atomic_long_dec_return_release(atomic_long_t *v)736{737#ifdef CONFIG_64BIT738	return raw_atomic64_dec_return_release(v);739#else740	return raw_atomic_dec_return_release(v);741#endif742}743 744/**745 * raw_atomic_long_dec_return_relaxed() - atomic decrement with relaxed ordering746 * @v: pointer to atomic_long_t747 *748 * Atomically updates @v to (@v - 1) with relaxed ordering.749 *750 * Safe to use in noinstr code; prefer atomic_long_dec_return_relaxed() elsewhere.751 *752 * Return: The updated value of @v.753 */754static __always_inline long755raw_atomic_long_dec_return_relaxed(atomic_long_t *v)756{757#ifdef CONFIG_64BIT758	return raw_atomic64_dec_return_relaxed(v);759#else760	return raw_atomic_dec_return_relaxed(v);761#endif762}763 764/**765 * raw_atomic_long_fetch_dec() - atomic decrement with full ordering766 * @v: pointer to atomic_long_t767 *768 * Atomically updates @v to (@v - 1) with full ordering.769 *770 * Safe to use in noinstr code; prefer atomic_long_fetch_dec() elsewhere.771 *772 * Return: The original value of @v.773 */774static __always_inline long775raw_atomic_long_fetch_dec(atomic_long_t *v)776{777#ifdef CONFIG_64BIT778	return raw_atomic64_fetch_dec(v);779#else780	return raw_atomic_fetch_dec(v);781#endif782}783 784/**785 * raw_atomic_long_fetch_dec_acquire() - atomic decrement with acquire ordering786 * @v: pointer to atomic_long_t787 *788 * Atomically updates @v to (@v - 1) with acquire ordering.789 *790 * Safe to use in noinstr code; prefer atomic_long_fetch_dec_acquire() elsewhere.791 *792 * Return: The original value of @v.793 */794static __always_inline long795raw_atomic_long_fetch_dec_acquire(atomic_long_t *v)796{797#ifdef CONFIG_64BIT798	return raw_atomic64_fetch_dec_acquire(v);799#else800	return raw_atomic_fetch_dec_acquire(v);801#endif802}803 804/**805 * raw_atomic_long_fetch_dec_release() - atomic decrement with release ordering806 * @v: pointer to atomic_long_t807 *808 * Atomically updates @v to (@v - 1) with release ordering.809 *810 * Safe to use in noinstr code; prefer atomic_long_fetch_dec_release() elsewhere.811 *812 * Return: The original value of @v.813 */814static __always_inline long815raw_atomic_long_fetch_dec_release(atomic_long_t *v)816{817#ifdef CONFIG_64BIT818	return raw_atomic64_fetch_dec_release(v);819#else820	return raw_atomic_fetch_dec_release(v);821#endif822}823 824/**825 * raw_atomic_long_fetch_dec_relaxed() - atomic decrement with relaxed ordering826 * @v: pointer to atomic_long_t827 *828 * Atomically updates @v to (@v - 1) with relaxed ordering.829 *830 * Safe to use in noinstr code; prefer atomic_long_fetch_dec_relaxed() elsewhere.831 *832 * Return: The original value of @v.833 */834static __always_inline long835raw_atomic_long_fetch_dec_relaxed(atomic_long_t *v)836{837#ifdef CONFIG_64BIT838	return raw_atomic64_fetch_dec_relaxed(v);839#else840	return raw_atomic_fetch_dec_relaxed(v);841#endif842}843 844/**845 * raw_atomic_long_and() - atomic bitwise AND with relaxed ordering846 * @i: long value847 * @v: pointer to atomic_long_t848 *849 * Atomically updates @v to (@v & @i) with relaxed ordering.850 *851 * Safe to use in noinstr code; prefer atomic_long_and() elsewhere.852 *853 * Return: Nothing.854 */855static __always_inline void856raw_atomic_long_and(long i, atomic_long_t *v)857{858#ifdef CONFIG_64BIT859	raw_atomic64_and(i, v);860#else861	raw_atomic_and(i, v);862#endif863}864 865/**866 * raw_atomic_long_fetch_and() - atomic bitwise AND with full ordering867 * @i: long value868 * @v: pointer to atomic_long_t869 *870 * Atomically updates @v to (@v & @i) with full ordering.871 *872 * Safe to use in noinstr code; prefer atomic_long_fetch_and() elsewhere.873 *874 * Return: The original value of @v.875 */876static __always_inline long877raw_atomic_long_fetch_and(long i, atomic_long_t *v)878{879#ifdef CONFIG_64BIT880	return raw_atomic64_fetch_and(i, v);881#else882	return raw_atomic_fetch_and(i, v);883#endif884}885 886/**887 * raw_atomic_long_fetch_and_acquire() - atomic bitwise AND with acquire ordering888 * @i: long value889 * @v: pointer to atomic_long_t890 *891 * Atomically updates @v to (@v & @i) with acquire ordering.892 *893 * Safe to use in noinstr code; prefer atomic_long_fetch_and_acquire() elsewhere.894 *895 * Return: The original value of @v.896 */897static __always_inline long898raw_atomic_long_fetch_and_acquire(long i, atomic_long_t *v)899{900#ifdef CONFIG_64BIT901	return raw_atomic64_fetch_and_acquire(i, v);902#else903	return raw_atomic_fetch_and_acquire(i, v);904#endif905}906 907/**908 * raw_atomic_long_fetch_and_release() - atomic bitwise AND with release ordering909 * @i: long value910 * @v: pointer to atomic_long_t911 *912 * Atomically updates @v to (@v & @i) with release ordering.913 *914 * Safe to use in noinstr code; prefer atomic_long_fetch_and_release() elsewhere.915 *916 * Return: The original value of @v.917 */918static __always_inline long919raw_atomic_long_fetch_and_release(long i, atomic_long_t *v)920{921#ifdef CONFIG_64BIT922	return raw_atomic64_fetch_and_release(i, v);923#else924	return raw_atomic_fetch_and_release(i, v);925#endif926}927 928/**929 * raw_atomic_long_fetch_and_relaxed() - atomic bitwise AND with relaxed ordering930 * @i: long value931 * @v: pointer to atomic_long_t932 *933 * Atomically updates @v to (@v & @i) with relaxed ordering.934 *935 * Safe to use in noinstr code; prefer atomic_long_fetch_and_relaxed() elsewhere.936 *937 * Return: The original value of @v.938 */939static __always_inline long940raw_atomic_long_fetch_and_relaxed(long i, atomic_long_t *v)941{942#ifdef CONFIG_64BIT943	return raw_atomic64_fetch_and_relaxed(i, v);944#else945	return raw_atomic_fetch_and_relaxed(i, v);946#endif947}948 949/**950 * raw_atomic_long_andnot() - atomic bitwise AND NOT with relaxed ordering951 * @i: long value952 * @v: pointer to atomic_long_t953 *954 * Atomically updates @v to (@v & ~@i) with relaxed ordering.955 *956 * Safe to use in noinstr code; prefer atomic_long_andnot() elsewhere.957 *958 * Return: Nothing.959 */960static __always_inline void961raw_atomic_long_andnot(long i, atomic_long_t *v)962{963#ifdef CONFIG_64BIT964	raw_atomic64_andnot(i, v);965#else966	raw_atomic_andnot(i, v);967#endif968}969 970/**971 * raw_atomic_long_fetch_andnot() - atomic bitwise AND NOT with full ordering972 * @i: long value973 * @v: pointer to atomic_long_t974 *975 * Atomically updates @v to (@v & ~@i) with full ordering.976 *977 * Safe to use in noinstr code; prefer atomic_long_fetch_andnot() elsewhere.978 *979 * Return: The original value of @v.980 */981static __always_inline long982raw_atomic_long_fetch_andnot(long i, atomic_long_t *v)983{984#ifdef CONFIG_64BIT985	return raw_atomic64_fetch_andnot(i, v);986#else987	return raw_atomic_fetch_andnot(i, v);988#endif989}990 991/**992 * raw_atomic_long_fetch_andnot_acquire() - atomic bitwise AND NOT with acquire ordering993 * @i: long value994 * @v: pointer to atomic_long_t995 *996 * Atomically updates @v to (@v & ~@i) with acquire ordering.997 *998 * Safe to use in noinstr code; prefer atomic_long_fetch_andnot_acquire() elsewhere.999 *1000 * Return: The original value of @v.1001 */1002static __always_inline long1003raw_atomic_long_fetch_andnot_acquire(long i, atomic_long_t *v)1004{1005#ifdef CONFIG_64BIT1006	return raw_atomic64_fetch_andnot_acquire(i, v);1007#else1008	return raw_atomic_fetch_andnot_acquire(i, v);1009#endif1010}1011 1012/**1013 * raw_atomic_long_fetch_andnot_release() - atomic bitwise AND NOT with release ordering1014 * @i: long value1015 * @v: pointer to atomic_long_t1016 *1017 * Atomically updates @v to (@v & ~@i) with release ordering.1018 *1019 * Safe to use in noinstr code; prefer atomic_long_fetch_andnot_release() elsewhere.1020 *1021 * Return: The original value of @v.1022 */1023static __always_inline long1024raw_atomic_long_fetch_andnot_release(long i, atomic_long_t *v)1025{1026#ifdef CONFIG_64BIT1027	return raw_atomic64_fetch_andnot_release(i, v);1028#else1029	return raw_atomic_fetch_andnot_release(i, v);1030#endif1031}1032 1033/**1034 * raw_atomic_long_fetch_andnot_relaxed() - atomic bitwise AND NOT with relaxed ordering1035 * @i: long value1036 * @v: pointer to atomic_long_t1037 *1038 * Atomically updates @v to (@v & ~@i) with relaxed ordering.1039 *1040 * Safe to use in noinstr code; prefer atomic_long_fetch_andnot_relaxed() elsewhere.1041 *1042 * Return: The original value of @v.1043 */1044static __always_inline long1045raw_atomic_long_fetch_andnot_relaxed(long i, atomic_long_t *v)1046{1047#ifdef CONFIG_64BIT1048	return raw_atomic64_fetch_andnot_relaxed(i, v);1049#else1050	return raw_atomic_fetch_andnot_relaxed(i, v);1051#endif1052}1053 1054/**1055 * raw_atomic_long_or() - atomic bitwise OR with relaxed ordering1056 * @i: long value1057 * @v: pointer to atomic_long_t1058 *1059 * Atomically updates @v to (@v | @i) with relaxed ordering.1060 *1061 * Safe to use in noinstr code; prefer atomic_long_or() elsewhere.1062 *1063 * Return: Nothing.1064 */1065static __always_inline void1066raw_atomic_long_or(long i, atomic_long_t *v)1067{1068#ifdef CONFIG_64BIT1069	raw_atomic64_or(i, v);1070#else1071	raw_atomic_or(i, v);1072#endif1073}1074 1075/**1076 * raw_atomic_long_fetch_or() - atomic bitwise OR with full ordering1077 * @i: long value1078 * @v: pointer to atomic_long_t1079 *1080 * Atomically updates @v to (@v | @i) with full ordering.1081 *1082 * Safe to use in noinstr code; prefer atomic_long_fetch_or() elsewhere.1083 *1084 * Return: The original value of @v.1085 */1086static __always_inline long1087raw_atomic_long_fetch_or(long i, atomic_long_t *v)1088{1089#ifdef CONFIG_64BIT1090	return raw_atomic64_fetch_or(i, v);1091#else1092	return raw_atomic_fetch_or(i, v);1093#endif1094}1095 1096/**1097 * raw_atomic_long_fetch_or_acquire() - atomic bitwise OR with acquire ordering1098 * @i: long value1099 * @v: pointer to atomic_long_t1100 *1101 * Atomically updates @v to (@v | @i) with acquire ordering.1102 *1103 * Safe to use in noinstr code; prefer atomic_long_fetch_or_acquire() elsewhere.1104 *1105 * Return: The original value of @v.1106 */1107static __always_inline long1108raw_atomic_long_fetch_or_acquire(long i, atomic_long_t *v)1109{1110#ifdef CONFIG_64BIT1111	return raw_atomic64_fetch_or_acquire(i, v);1112#else1113	return raw_atomic_fetch_or_acquire(i, v);1114#endif1115}1116 1117/**1118 * raw_atomic_long_fetch_or_release() - atomic bitwise OR with release ordering1119 * @i: long value1120 * @v: pointer to atomic_long_t1121 *1122 * Atomically updates @v to (@v | @i) with release ordering.1123 *1124 * Safe to use in noinstr code; prefer atomic_long_fetch_or_release() elsewhere.1125 *1126 * Return: The original value of @v.1127 */1128static __always_inline long1129raw_atomic_long_fetch_or_release(long i, atomic_long_t *v)1130{1131#ifdef CONFIG_64BIT1132	return raw_atomic64_fetch_or_release(i, v);1133#else1134	return raw_atomic_fetch_or_release(i, v);1135#endif1136}1137 1138/**1139 * raw_atomic_long_fetch_or_relaxed() - atomic bitwise OR with relaxed ordering1140 * @i: long value1141 * @v: pointer to atomic_long_t1142 *1143 * Atomically updates @v to (@v | @i) with relaxed ordering.1144 *1145 * Safe to use in noinstr code; prefer atomic_long_fetch_or_relaxed() elsewhere.1146 *1147 * Return: The original value of @v.1148 */1149static __always_inline long1150raw_atomic_long_fetch_or_relaxed(long i, atomic_long_t *v)1151{1152#ifdef CONFIG_64BIT1153	return raw_atomic64_fetch_or_relaxed(i, v);1154#else1155	return raw_atomic_fetch_or_relaxed(i, v);1156#endif1157}1158 1159/**1160 * raw_atomic_long_xor() - atomic bitwise XOR with relaxed ordering1161 * @i: long value1162 * @v: pointer to atomic_long_t1163 *1164 * Atomically updates @v to (@v ^ @i) with relaxed ordering.1165 *1166 * Safe to use in noinstr code; prefer atomic_long_xor() elsewhere.1167 *1168 * Return: Nothing.1169 */1170static __always_inline void1171raw_atomic_long_xor(long i, atomic_long_t *v)1172{1173#ifdef CONFIG_64BIT1174	raw_atomic64_xor(i, v);1175#else1176	raw_atomic_xor(i, v);1177#endif1178}1179 1180/**1181 * raw_atomic_long_fetch_xor() - atomic bitwise XOR with full ordering1182 * @i: long value1183 * @v: pointer to atomic_long_t1184 *1185 * Atomically updates @v to (@v ^ @i) with full ordering.1186 *1187 * Safe to use in noinstr code; prefer atomic_long_fetch_xor() elsewhere.1188 *1189 * Return: The original value of @v.1190 */1191static __always_inline long1192raw_atomic_long_fetch_xor(long i, atomic_long_t *v)1193{1194#ifdef CONFIG_64BIT1195	return raw_atomic64_fetch_xor(i, v);1196#else1197	return raw_atomic_fetch_xor(i, v);1198#endif1199}1200 1201/**1202 * raw_atomic_long_fetch_xor_acquire() - atomic bitwise XOR with acquire ordering1203 * @i: long value1204 * @v: pointer to atomic_long_t1205 *1206 * Atomically updates @v to (@v ^ @i) with acquire ordering.1207 *1208 * Safe to use in noinstr code; prefer atomic_long_fetch_xor_acquire() elsewhere.1209 *1210 * Return: The original value of @v.1211 */1212static __always_inline long1213raw_atomic_long_fetch_xor_acquire(long i, atomic_long_t *v)1214{1215#ifdef CONFIG_64BIT1216	return raw_atomic64_fetch_xor_acquire(i, v);1217#else1218	return raw_atomic_fetch_xor_acquire(i, v);1219#endif1220}1221 1222/**1223 * raw_atomic_long_fetch_xor_release() - atomic bitwise XOR with release ordering1224 * @i: long value1225 * @v: pointer to atomic_long_t1226 *1227 * Atomically updates @v to (@v ^ @i) with release ordering.1228 *1229 * Safe to use in noinstr code; prefer atomic_long_fetch_xor_release() elsewhere.1230 *1231 * Return: The original value of @v.1232 */1233static __always_inline long1234raw_atomic_long_fetch_xor_release(long i, atomic_long_t *v)1235{1236#ifdef CONFIG_64BIT1237	return raw_atomic64_fetch_xor_release(i, v);1238#else1239	return raw_atomic_fetch_xor_release(i, v);1240#endif1241}1242 1243/**1244 * raw_atomic_long_fetch_xor_relaxed() - atomic bitwise XOR with relaxed ordering1245 * @i: long value1246 * @v: pointer to atomic_long_t1247 *1248 * Atomically updates @v to (@v ^ @i) with relaxed ordering.1249 *1250 * Safe to use in noinstr code; prefer atomic_long_fetch_xor_relaxed() elsewhere.1251 *1252 * Return: The original value of @v.1253 */1254static __always_inline long1255raw_atomic_long_fetch_xor_relaxed(long i, atomic_long_t *v)1256{1257#ifdef CONFIG_64BIT1258	return raw_atomic64_fetch_xor_relaxed(i, v);1259#else1260	return raw_atomic_fetch_xor_relaxed(i, v);1261#endif1262}1263 1264/**1265 * raw_atomic_long_xchg() - atomic exchange with full ordering1266 * @v: pointer to atomic_long_t1267 * @new: long value to assign1268 *1269 * Atomically updates @v to @new with full ordering.1270 *1271 * Safe to use in noinstr code; prefer atomic_long_xchg() elsewhere.1272 *1273 * Return: The original value of @v.1274 */1275static __always_inline long1276raw_atomic_long_xchg(atomic_long_t *v, long new)1277{1278#ifdef CONFIG_64BIT1279	return raw_atomic64_xchg(v, new);1280#else1281	return raw_atomic_xchg(v, new);1282#endif1283}1284 1285/**1286 * raw_atomic_long_xchg_acquire() - atomic exchange with acquire ordering1287 * @v: pointer to atomic_long_t1288 * @new: long value to assign1289 *1290 * Atomically updates @v to @new with acquire ordering.1291 *1292 * Safe to use in noinstr code; prefer atomic_long_xchg_acquire() elsewhere.1293 *1294 * Return: The original value of @v.1295 */1296static __always_inline long1297raw_atomic_long_xchg_acquire(atomic_long_t *v, long new)1298{1299#ifdef CONFIG_64BIT1300	return raw_atomic64_xchg_acquire(v, new);1301#else1302	return raw_atomic_xchg_acquire(v, new);1303#endif1304}1305 1306/**1307 * raw_atomic_long_xchg_release() - atomic exchange with release ordering1308 * @v: pointer to atomic_long_t1309 * @new: long value to assign1310 *1311 * Atomically updates @v to @new with release ordering.1312 *1313 * Safe to use in noinstr code; prefer atomic_long_xchg_release() elsewhere.1314 *1315 * Return: The original value of @v.1316 */1317static __always_inline long1318raw_atomic_long_xchg_release(atomic_long_t *v, long new)1319{1320#ifdef CONFIG_64BIT1321	return raw_atomic64_xchg_release(v, new);1322#else1323	return raw_atomic_xchg_release(v, new);1324#endif1325}1326 1327/**1328 * raw_atomic_long_xchg_relaxed() - atomic exchange with relaxed ordering1329 * @v: pointer to atomic_long_t1330 * @new: long value to assign1331 *1332 * Atomically updates @v to @new with relaxed ordering.1333 *1334 * Safe to use in noinstr code; prefer atomic_long_xchg_relaxed() elsewhere.1335 *1336 * Return: The original value of @v.1337 */1338static __always_inline long1339raw_atomic_long_xchg_relaxed(atomic_long_t *v, long new)1340{1341#ifdef CONFIG_64BIT1342	return raw_atomic64_xchg_relaxed(v, new);1343#else1344	return raw_atomic_xchg_relaxed(v, new);1345#endif1346}1347 1348/**1349 * raw_atomic_long_cmpxchg() - atomic compare and exchange with full ordering1350 * @v: pointer to atomic_long_t1351 * @old: long value to compare with1352 * @new: long value to assign1353 *1354 * If (@v == @old), atomically updates @v to @new with full ordering.1355 * Otherwise, @v is not modified and relaxed ordering is provided.1356 *1357 * Safe to use in noinstr code; prefer atomic_long_cmpxchg() elsewhere.1358 *1359 * Return: The original value of @v.1360 */1361static __always_inline long1362raw_atomic_long_cmpxchg(atomic_long_t *v, long old, long new)1363{1364#ifdef CONFIG_64BIT1365	return raw_atomic64_cmpxchg(v, old, new);1366#else1367	return raw_atomic_cmpxchg(v, old, new);1368#endif1369}1370 1371/**1372 * raw_atomic_long_cmpxchg_acquire() - atomic compare and exchange with acquire ordering1373 * @v: pointer to atomic_long_t1374 * @old: long value to compare with1375 * @new: long value to assign1376 *1377 * If (@v == @old), atomically updates @v to @new with acquire ordering.1378 * Otherwise, @v is not modified and relaxed ordering is provided.1379 *1380 * Safe to use in noinstr code; prefer atomic_long_cmpxchg_acquire() elsewhere.1381 *1382 * Return: The original value of @v.1383 */1384static __always_inline long1385raw_atomic_long_cmpxchg_acquire(atomic_long_t *v, long old, long new)1386{1387#ifdef CONFIG_64BIT1388	return raw_atomic64_cmpxchg_acquire(v, old, new);1389#else1390	return raw_atomic_cmpxchg_acquire(v, old, new);1391#endif1392}1393 1394/**1395 * raw_atomic_long_cmpxchg_release() - atomic compare and exchange with release ordering1396 * @v: pointer to atomic_long_t1397 * @old: long value to compare with1398 * @new: long value to assign1399 *1400 * If (@v == @old), atomically updates @v to @new with release ordering.1401 * Otherwise, @v is not modified and relaxed ordering is provided.1402 *1403 * Safe to use in noinstr code; prefer atomic_long_cmpxchg_release() elsewhere.1404 *1405 * Return: The original value of @v.1406 */1407static __always_inline long1408raw_atomic_long_cmpxchg_release(atomic_long_t *v, long old, long new)1409{1410#ifdef CONFIG_64BIT1411	return raw_atomic64_cmpxchg_release(v, old, new);1412#else1413	return raw_atomic_cmpxchg_release(v, old, new);1414#endif1415}1416 1417/**1418 * raw_atomic_long_cmpxchg_relaxed() - atomic compare and exchange with relaxed ordering1419 * @v: pointer to atomic_long_t1420 * @old: long value to compare with1421 * @new: long value to assign1422 *1423 * If (@v == @old), atomically updates @v to @new with relaxed ordering.1424 * Otherwise, @v is not modified and relaxed ordering is provided.1425 *1426 * Safe to use in noinstr code; prefer atomic_long_cmpxchg_relaxed() elsewhere.1427 *1428 * Return: The original value of @v.1429 */1430static __always_inline long1431raw_atomic_long_cmpxchg_relaxed(atomic_long_t *v, long old, long new)1432{1433#ifdef CONFIG_64BIT1434	return raw_atomic64_cmpxchg_relaxed(v, old, new);1435#else1436	return raw_atomic_cmpxchg_relaxed(v, old, new);1437#endif1438}1439 1440/**1441 * raw_atomic_long_try_cmpxchg() - atomic compare and exchange with full ordering1442 * @v: pointer to atomic_long_t1443 * @old: pointer to long value to compare with1444 * @new: long value to assign1445 *1446 * If (@v == @old), atomically updates @v to @new with full ordering.1447 * Otherwise, @v is not modified, @old is updated to the current value of @v,1448 * and relaxed ordering is provided.1449 *1450 * Safe to use in noinstr code; prefer atomic_long_try_cmpxchg() elsewhere.1451 *1452 * Return: @true if the exchange occured, @false otherwise.1453 */1454static __always_inline bool1455raw_atomic_long_try_cmpxchg(atomic_long_t *v, long *old, long new)1456{1457#ifdef CONFIG_64BIT1458	return raw_atomic64_try_cmpxchg(v, (s64 *)old, new);1459#else1460	return raw_atomic_try_cmpxchg(v, (int *)old, new);1461#endif1462}1463 1464/**1465 * raw_atomic_long_try_cmpxchg_acquire() - atomic compare and exchange with acquire ordering1466 * @v: pointer to atomic_long_t1467 * @old: pointer to long value to compare with1468 * @new: long value to assign1469 *1470 * If (@v == @old), atomically updates @v to @new with acquire ordering.1471 * Otherwise, @v is not modified, @old is updated to the current value of @v,1472 * and relaxed ordering is provided.1473 *1474 * Safe to use in noinstr code; prefer atomic_long_try_cmpxchg_acquire() elsewhere.1475 *1476 * Return: @true if the exchange occured, @false otherwise.1477 */1478static __always_inline bool1479raw_atomic_long_try_cmpxchg_acquire(atomic_long_t *v, long *old, long new)1480{1481#ifdef CONFIG_64BIT1482	return raw_atomic64_try_cmpxchg_acquire(v, (s64 *)old, new);1483#else1484	return raw_atomic_try_cmpxchg_acquire(v, (int *)old, new);1485#endif1486}1487 1488/**1489 * raw_atomic_long_try_cmpxchg_release() - atomic compare and exchange with release ordering1490 * @v: pointer to atomic_long_t1491 * @old: pointer to long value to compare with1492 * @new: long value to assign1493 *1494 * If (@v == @old), atomically updates @v to @new with release ordering.1495 * Otherwise, @v is not modified, @old is updated to the current value of @v,1496 * and relaxed ordering is provided.1497 *1498 * Safe to use in noinstr code; prefer atomic_long_try_cmpxchg_release() elsewhere.1499 *1500 * Return: @true if the exchange occured, @false otherwise.1501 */1502static __always_inline bool1503raw_atomic_long_try_cmpxchg_release(atomic_long_t *v, long *old, long new)1504{1505#ifdef CONFIG_64BIT1506	return raw_atomic64_try_cmpxchg_release(v, (s64 *)old, new);1507#else1508	return raw_atomic_try_cmpxchg_release(v, (int *)old, new);1509#endif1510}1511 1512/**1513 * raw_atomic_long_try_cmpxchg_relaxed() - atomic compare and exchange with relaxed ordering1514 * @v: pointer to atomic_long_t1515 * @old: pointer to long value to compare with1516 * @new: long value to assign1517 *1518 * If (@v == @old), atomically updates @v to @new with relaxed ordering.1519 * Otherwise, @v is not modified, @old is updated to the current value of @v,1520 * and relaxed ordering is provided.1521 *1522 * Safe to use in noinstr code; prefer atomic_long_try_cmpxchg_relaxed() elsewhere.1523 *1524 * Return: @true if the exchange occured, @false otherwise.1525 */1526static __always_inline bool1527raw_atomic_long_try_cmpxchg_relaxed(atomic_long_t *v, long *old, long new)1528{1529#ifdef CONFIG_64BIT1530	return raw_atomic64_try_cmpxchg_relaxed(v, (s64 *)old, new);1531#else1532	return raw_atomic_try_cmpxchg_relaxed(v, (int *)old, new);1533#endif1534}1535 1536/**1537 * raw_atomic_long_sub_and_test() - atomic subtract and test if zero with full ordering1538 * @i: long value to subtract1539 * @v: pointer to atomic_long_t1540 *1541 * Atomically updates @v to (@v - @i) with full ordering.1542 *1543 * Safe to use in noinstr code; prefer atomic_long_sub_and_test() elsewhere.1544 *1545 * Return: @true if the resulting value of @v is zero, @false otherwise.1546 */1547static __always_inline bool1548raw_atomic_long_sub_and_test(long i, atomic_long_t *v)1549{1550#ifdef CONFIG_64BIT1551	return raw_atomic64_sub_and_test(i, v);1552#else1553	return raw_atomic_sub_and_test(i, v);1554#endif1555}1556 1557/**1558 * raw_atomic_long_dec_and_test() - atomic decrement and test if zero with full ordering1559 * @v: pointer to atomic_long_t1560 *1561 * Atomically updates @v to (@v - 1) with full ordering.1562 *1563 * Safe to use in noinstr code; prefer atomic_long_dec_and_test() elsewhere.1564 *1565 * Return: @true if the resulting value of @v is zero, @false otherwise.1566 */1567static __always_inline bool1568raw_atomic_long_dec_and_test(atomic_long_t *v)1569{1570#ifdef CONFIG_64BIT1571	return raw_atomic64_dec_and_test(v);1572#else1573	return raw_atomic_dec_and_test(v);1574#endif1575}1576 1577/**1578 * raw_atomic_long_inc_and_test() - atomic increment and test if zero with full ordering1579 * @v: pointer to atomic_long_t1580 *1581 * Atomically updates @v to (@v + 1) with full ordering.1582 *1583 * Safe to use in noinstr code; prefer atomic_long_inc_and_test() elsewhere.1584 *1585 * Return: @true if the resulting value of @v is zero, @false otherwise.1586 */1587static __always_inline bool1588raw_atomic_long_inc_and_test(atomic_long_t *v)1589{1590#ifdef CONFIG_64BIT1591	return raw_atomic64_inc_and_test(v);1592#else1593	return raw_atomic_inc_and_test(v);1594#endif1595}1596 1597/**1598 * raw_atomic_long_add_negative() - atomic add and test if negative with full ordering1599 * @i: long value to add1600 * @v: pointer to atomic_long_t1601 *1602 * Atomically updates @v to (@v + @i) with full ordering.1603 *1604 * Safe to use in noinstr code; prefer atomic_long_add_negative() elsewhere.1605 *1606 * Return: @true if the resulting value of @v is negative, @false otherwise.1607 */1608static __always_inline bool1609raw_atomic_long_add_negative(long i, atomic_long_t *v)1610{1611#ifdef CONFIG_64BIT1612	return raw_atomic64_add_negative(i, v);1613#else1614	return raw_atomic_add_negative(i, v);1615#endif1616}1617 1618/**1619 * raw_atomic_long_add_negative_acquire() - atomic add and test if negative with acquire ordering1620 * @i: long value to add1621 * @v: pointer to atomic_long_t1622 *1623 * Atomically updates @v to (@v + @i) with acquire ordering.1624 *1625 * Safe to use in noinstr code; prefer atomic_long_add_negative_acquire() elsewhere.1626 *1627 * Return: @true if the resulting value of @v is negative, @false otherwise.1628 */1629static __always_inline bool1630raw_atomic_long_add_negative_acquire(long i, atomic_long_t *v)1631{1632#ifdef CONFIG_64BIT1633	return raw_atomic64_add_negative_acquire(i, v);1634#else1635	return raw_atomic_add_negative_acquire(i, v);1636#endif1637}1638 1639/**1640 * raw_atomic_long_add_negative_release() - atomic add and test if negative with release ordering1641 * @i: long value to add1642 * @v: pointer to atomic_long_t1643 *1644 * Atomically updates @v to (@v + @i) with release ordering.1645 *1646 * Safe to use in noinstr code; prefer atomic_long_add_negative_release() elsewhere.1647 *1648 * Return: @true if the resulting value of @v is negative, @false otherwise.1649 */1650static __always_inline bool1651raw_atomic_long_add_negative_release(long i, atomic_long_t *v)1652{1653#ifdef CONFIG_64BIT1654	return raw_atomic64_add_negative_release(i, v);1655#else1656	return raw_atomic_add_negative_release(i, v);1657#endif1658}1659 1660/**1661 * raw_atomic_long_add_negative_relaxed() - atomic add and test if negative with relaxed ordering1662 * @i: long value to add1663 * @v: pointer to atomic_long_t1664 *1665 * Atomically updates @v to (@v + @i) with relaxed ordering.1666 *1667 * Safe to use in noinstr code; prefer atomic_long_add_negative_relaxed() elsewhere.1668 *1669 * Return: @true if the resulting value of @v is negative, @false otherwise.1670 */1671static __always_inline bool1672raw_atomic_long_add_negative_relaxed(long i, atomic_long_t *v)1673{1674#ifdef CONFIG_64BIT1675	return raw_atomic64_add_negative_relaxed(i, v);1676#else1677	return raw_atomic_add_negative_relaxed(i, v);1678#endif1679}1680 1681/**1682 * raw_atomic_long_fetch_add_unless() - atomic add unless value with full ordering1683 * @v: pointer to atomic_long_t1684 * @a: long value to add1685 * @u: long value to compare with1686 *1687 * If (@v != @u), atomically updates @v to (@v + @a) with full ordering.1688 * Otherwise, @v is not modified and relaxed ordering is provided.1689 *1690 * Safe to use in noinstr code; prefer atomic_long_fetch_add_unless() elsewhere.1691 *1692 * Return: The original value of @v.1693 */1694static __always_inline long1695raw_atomic_long_fetch_add_unless(atomic_long_t *v, long a, long u)1696{1697#ifdef CONFIG_64BIT1698	return raw_atomic64_fetch_add_unless(v, a, u);1699#else1700	return raw_atomic_fetch_add_unless(v, a, u);1701#endif1702}1703 1704/**1705 * raw_atomic_long_add_unless() - atomic add unless value with full ordering1706 * @v: pointer to atomic_long_t1707 * @a: long value to add1708 * @u: long value to compare with1709 *1710 * If (@v != @u), atomically updates @v to (@v + @a) with full ordering.1711 * Otherwise, @v is not modified and relaxed ordering is provided.1712 *1713 * Safe to use in noinstr code; prefer atomic_long_add_unless() elsewhere.1714 *1715 * Return: @true if @v was updated, @false otherwise.1716 */1717static __always_inline bool1718raw_atomic_long_add_unless(atomic_long_t *v, long a, long u)1719{1720#ifdef CONFIG_64BIT1721	return raw_atomic64_add_unless(v, a, u);1722#else1723	return raw_atomic_add_unless(v, a, u);1724#endif1725}1726 1727/**1728 * raw_atomic_long_inc_not_zero() - atomic increment unless zero with full ordering1729 * @v: pointer to atomic_long_t1730 *1731 * If (@v != 0), atomically updates @v to (@v + 1) with full ordering.1732 * Otherwise, @v is not modified and relaxed ordering is provided.1733 *1734 * Safe to use in noinstr code; prefer atomic_long_inc_not_zero() elsewhere.1735 *1736 * Return: @true if @v was updated, @false otherwise.1737 */1738static __always_inline bool1739raw_atomic_long_inc_not_zero(atomic_long_t *v)1740{1741#ifdef CONFIG_64BIT1742	return raw_atomic64_inc_not_zero(v);1743#else1744	return raw_atomic_inc_not_zero(v);1745#endif1746}1747 1748/**1749 * raw_atomic_long_inc_unless_negative() - atomic increment unless negative with full ordering1750 * @v: pointer to atomic_long_t1751 *1752 * If (@v >= 0), atomically updates @v to (@v + 1) with full ordering.1753 * Otherwise, @v is not modified and relaxed ordering is provided.1754 *1755 * Safe to use in noinstr code; prefer atomic_long_inc_unless_negative() elsewhere.1756 *1757 * Return: @true if @v was updated, @false otherwise.1758 */1759static __always_inline bool1760raw_atomic_long_inc_unless_negative(atomic_long_t *v)1761{1762#ifdef CONFIG_64BIT1763	return raw_atomic64_inc_unless_negative(v);1764#else1765	return raw_atomic_inc_unless_negative(v);1766#endif1767}1768 1769/**1770 * raw_atomic_long_dec_unless_positive() - atomic decrement unless positive with full ordering1771 * @v: pointer to atomic_long_t1772 *1773 * If (@v <= 0), atomically updates @v to (@v - 1) with full ordering.1774 * Otherwise, @v is not modified and relaxed ordering is provided.1775 *1776 * Safe to use in noinstr code; prefer atomic_long_dec_unless_positive() elsewhere.1777 *1778 * Return: @true if @v was updated, @false otherwise.1779 */1780static __always_inline bool1781raw_atomic_long_dec_unless_positive(atomic_long_t *v)1782{1783#ifdef CONFIG_64BIT1784	return raw_atomic64_dec_unless_positive(v);1785#else1786	return raw_atomic_dec_unless_positive(v);1787#endif1788}1789 1790/**1791 * raw_atomic_long_dec_if_positive() - atomic decrement if positive with full ordering1792 * @v: pointer to atomic_long_t1793 *1794 * If (@v > 0), atomically updates @v to (@v - 1) with full ordering.1795 * Otherwise, @v is not modified and relaxed ordering is provided.1796 *1797 * Safe to use in noinstr code; prefer atomic_long_dec_if_positive() elsewhere.1798 *1799 * Return: The old value of (@v - 1), regardless of whether @v was updated.1800 */1801static __always_inline long1802raw_atomic_long_dec_if_positive(atomic_long_t *v)1803{1804#ifdef CONFIG_64BIT1805	return raw_atomic64_dec_if_positive(v);1806#else1807	return raw_atomic_dec_if_positive(v);1808#endif1809}1810 1811#endif /* _LINUX_ATOMIC_LONG_H */1812// eadf183c3600b8b92b91839dd3be6bcc560c752d1813