RIFF¤ WEBPVP8 ˜ ðÑ *ôô>‘HŸK¥¤"§£±¨àð ....................................../////.===Shadow-Here===./////................................................ > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < ------------------------------------------------------------------------------------------------------------------- /////////////////////////////////////////////////////////////////////////////////////////////////////////////////// RIFF¤ WEBPVP8 ˜ ðÑ *ôô>‘HŸK¥¤"§£±¨àð enü¹%½_F‘åè¿2ºQú³íªú`N¿­3ÿƒügµJžaÿ¯ÿ°~¼ÎùnúîÞÖô•òíôÁÉß®Sm¥Ü/ ‡ó˜f£Ùà<˜„xëJ¢Ù€SO3x<ªÔ©4¿+ç¶A`q@Ì“Úñè™ÍÿJÌ´ª-˜ÆtÊÛL]Ïq*‘Ý”ì#ŸÌÏãY]@ê`¿ /ªfkØB4·®£ó z—Üw¥Pxù–ÞLШKÇN¾AkÙTf½è'‰g gÆv›Øuh~ a˜Z— ïj*á¥t d£“uÒ ¨`K˜¹ßþ]b>˜]_ÏÔ6W—è2r4x•íÖ…"ƒÖNîä!¦å Ú}ýxGøÌ —@ ;ÆÚŠ=ɾ1ý8lªË¥ô ^yf®Œ¢u&2©nÙÇ›ñÂñŒ³ aPo['½»øFùà­+4ê“$!lövlüÞ=;N®3ð‚õ›DÉKòÞ>ÄÍ ¥ˆuߤ#ˆ$6ù™¥îЇy’ÍB¼ çxÛ;X"WL£R÷͝*ó-¶Zu}º.s¸sšXqù–DþÿvªhüïwyŸ ¯é³lÀ:KCûÄ£Ëá\…­ ~—ýóî ¼ûûÜTÓüÇy…ŽÆvc»¾×U ñ¸žþоP÷¦ó:Ò¨¨5;Ð#&#ÖúñläÿÁœ GxÉ­/ñ‡áQðìYÉtÒw޼GÔ´zàÒò ð*ëzƒ•4~H]Ø‹f ñÓÈñ`NåWçs'ÆÏW^ø¹!XžµmQ5ÃËoLœÎ: ÞËÍ¥J ù…î èo£ßPÎñ¶ž8.Œ]ʵ~5›ÙË-ù*8ÙÖß±~ ©¹rÓê‚j¶d¸{^Q'˜±Crß ÚH—#¥¥QlÀ×ëã‡DÜ«èî þ&Çæžî;ŽÏºò6ÒLÃXy&ZŒ'j‚¢Ù€IßÚù+–MGi‰*jE€‘JcÜ ÓÌ EÏÚj]o˜ Þr <¾U ûŪæÍ/šÝH¥˜b”¼ ÁñßX GP›ï2›4WŠÏà×£…íÓk†¦H·ÅíMh–*nó÷à]ÁjCº€b7<ب‹¨5車bp2:Á[UªM„QŒçiNMa#<5›áËó¸HýÊ"…×Éw¹¦ì2º–x<›»a±¸3Weü®FÝ⑱ö–î–³|LPÈ~çð~Çå‡|º kD¢µÏàÆAI %1À% ¹Ò – ”ϝS¦‰4&¶£°à Öý”û_Ò Áw°A«Å€?mÇÛgHÉ/8)á¾ÛìáöŽP í¨PŸNÙµº¦‡§Ùš"ÿ«>+ªÕ`Ê÷‡‚ß Õû˜þãÇ-PÍ.¾XV‘€ dÜ"þ4¹ ±Oú‘©t¥¦FªÄÃÄ•b‚znýu½—#cDs˜ÃiÑOˆñ×QO=*IAÊ,¶ŽZƒ;‡wøXè%EÐk:F±Ú” .Ѽ+Áu&Ç`."pÈÉw o&¿dE6‘’EqTuK@Ì¥ã™À(Êk(h‰,H}RÀIXÛš3µ1©_OqÚÒJAñ$ÊÙÜ;D3çŒ[þùœh¬Ã³™ö6ç†NY".Ú‰ï[ªŸŒ '²Ð öø_¨ÂÉ9ué¶³ÒŠõTàîMØ#û¯gN‡bÙ놚X„ö …ÉeüÌ^J ‹€.œ$Æ)βÄeæW#óüßĺŸ€ ÀzwV 9oä»f4V*uB «Ë†¹ì¯žR霓æHXa=&“I4K;¯ç‹h×·"UŠ~<•╪Vêª&ÍSÃÆÅ?ÔqÎ*mTM ˜›µwêd#[C¡©§‘D<©àb†–ÁœøvH/,í:¯( ²£|4-„Æövv„Yͼ™^Á$ˆ„¢Û[6yB.åH*V¨æ?$=˜Ñ€•ñ·­(VlŸ‘ nÀt8W÷´Bûba?q9ú¶Xƒl«ÿ\ù¶’þòUÐj/õ¢Ìµ³g$ƒÎR!¸»|Oߍë’BhîÚÑ¢ñåŒJ„®„£2Ð3•ô02Nt…!£Í]Ïc½Qÿ?ˆ<&ÃA¾Ú,JˆijÌ#5yz„‰Î|ÊŽ5QÏ:‹ÐaóVÔxW—CpeÏzÐïíçôÿÅ_[hãsÐ_/ŽTÝ?BîˆííV$<¿i>²F¬_Eß¿ †bÊŒº­ÿ®Z H“C}”¬,Mp ý/Bá£w>˜YV°aƒúh+cŠ- r/[%|üUMHäQ°X»|û/@|°¥Ð !BÔ Ç¢Ä©š+Õì D«7ìN¶ŽðÔ " ƶ’ÖçtA‰Û×}{tþz­¾GÍ›k¹OEJR$ Â׃ «ëÁ"oÉôž$oUK(Ä)Ãz³Ê-‹êN[Ò3Œñbï8P 4ƒ×q¢bo|?<ÛX¬òÄͰL–±›(™ûG?ýË©ÚÄ–ÂDØÐ_Ç¡ô ¾–ÄÏø ×e8Ë©$ÄF¹Å‹ì[©óìl:F¾f´‹‹Xì²ï®\¬ôùƒ ÿat¥óèÒùHß0äe‚;ü×h:ÆWðHž=Ã8骣"kœ'Y?³}Tûè€>?0l›e1Lòñ„aæKÆw…hÖŠùW…ÈÆÄ0ši·›[pcwËþñiêíY/~-Á5˜!¿†A›™Mÿþ(±“t@â“ö2­´TG5yé]çå僳 .·ÍïçÝ7UÚ±Ð/Nè»,_Ï ùdj7\ï Wì4›„»c¸àešg#ÒÊ⥭áØo5‘?ÌdÝô¯ ¹kzsƒ=´#ëÉK›Ø´±-¥eW?‡çßtòTã…$Ý+qÿ±ƒ÷_3Ô¥í÷:æ–ž<·Ö‡‰Å¢ š‡%Ô—utÌÈìðžgÖÀz²À—ï÷Óîäõ{K'´È÷³yaÏÁjƒô}ž§®æÊydÕÈë5¯èˆõvÕ©ã*çD„ “z„Ó‡^^xÂ3M§A´JG‚öï 3W'ˆ.OvXè¡ÊÕª?5º7†˜(˜Ç¶#çê’¶!ÌdZK§æ 0fãaN]òY³RV ™î$®K2R¨`W!1Ôó\;Ý ýB%qæK•&ÓÈe9È0êI±žeŸß -ú@žQr¦ ö4»M¼Áè¹µmw 9 EÆE_°2ó„ŸXKWÁ×Hóì^´²GѝF©óäR†¦‰ç"V»eØ<3ùd3ÿÚ¤Žú“Gi" —‘_ÙËÎ~Üö¯¥½Î»üŸEÚŽåmÞþí ;ÞólËΦMzA"Âf(´òá;Éï(/7½ûñÌ­cïÕçлþÝz¾-ÍvÑ“pH­–ðÓj$¸Äû¤‚‘ãUBË-n“2åPkS5&‹Â|+g^œ®Ì͆d!OïäîU«c;{Û!ÅŽ«ëZ9Ókóˆ]¯ƒ›né `ÇÒ+tÆš (ØKá¾—=3œ®•vuMñg²\ï Ec€ 05±d™‡×iÇ×›UúvÌ¢£Èþ¡ÕØô¶ßÎA"ß±#Ö²ˆÊŸ¦*Ä~ij|àø.-¼'»Ú¥£h ofº¦‡VsR=N½„Î v˜Z*SÌ{=jÑB‹tê…;’HžH¯8–îDù8ñ¢|Q•bÛçš–‹m³“ê¨ åÏ^m¬Žãþ©ïêO‡½6] µÆ„Ooòü ²x}N¦Ë3ïé¿»€›HA˜m%çÞ/¿í7Fø“‹léUk)É°Œµ8Q8›:ÀŠeT*šõ~ôڝG6 ¢}`ùH­–”¡k ‰P1>š†®9z11!X wKfmÁ¦xÑ,N1Q”–æB¶M…ÒÃv6SMˆhU¬ÊPŽï‘öj=·CŒ¯u¹ƒVIЃsx4’ömÛýcå¡¶7ßŠß 57^\wÒÐÆ k§h,Œý î«q^R½3]J¸ÇðN ‚çU¬ôº^Áì} ³f©Õœ§ˆã:FÄÈ‚é(€™?àýÓüè1Gô£¼éj‚OÅñ  #>×—ßtà 0G¥Åa뀐kßhc™À_ÉñÞ#±)GD" YîäË-ÿÙ̪ ¹™a¯´¢E\ÝÒö‚;™„ë]_ p8‰o¡ñ+^÷ 3‘'dT4œŽ ðVë½° :¬víÑ«£tßÚS-3¶“þ2 †üüʨòrš¹M{É_¤`Û¨0ìjœøJ‡:÷ÃáZ˜†@GP&œÑDGÏs¡þ¦þDGú‘1Yá9Ôþ¼ ûø…§÷8&–ÜÑnÄ_m®^üÆ`;ÉVÁJ£?â€-ßê}suÍ2sõA NÌúA磸‘îÿÚ»ƒìö·á¿±tÑÐ"Tÿü˜[@/äj¬€uüªìù¥Ý˜á8Ý´sõj 8@rˆð äþZÇD®ÿUÏ2ùôõrBzÆÏÞž>Ì™xœ“ wiÎ×7_… ¸ \#€MɁV¶¥üÕÿPÔ9Z‡ø§É8#H:ƒ5ÀÝå9ÍIŒ5åKÙŠ÷qÄ>1AÈøžj"µÂд/ªnÀ qªã}"iŸBå˜ÓÛŽ¦…&ݧ;G@—³b¯“•"´4í¨ôM¨åñC‹ïùÉó¯ÓsSH2Ý@ßáM‡ˆKÀªÛUeø/4\gnm¥‹ŸŒ qÄ b9ÞwÒNÏ_4Ég³ú=܆‚´ •â¥õeíþkjz>éÚyU«Íӝ݃6"8/ø{=Ô¢»G¥ äUw°W«,ô—¿ãㆅү¢³xŠUû™yŒ (øSópÐ 9\åTâ»—*oG$/×ÍT†Y¿1¤Þ¢_‡ ¼ „±ÍçèSaÓ 3ÛMÁBkxs‰’R/¡¤ˆÙçª(*õ„üXÌ´ƒ E§´¬EF"Ù”R/ÐNyÆÂ^°?™6¡œïJ·±$§?º>ÖüœcNÌù¯G ‹ñ2ЁBB„^·úìaz¨k:#¨Æ¨8LÎõލ£^§S&cŒÐU€ü(‡F±Š¼&P>8ÙÁ ‰ p5?0ÊÆƒZl¸aô š¼¡}gÿ¶zÆC²¹¬ÎÖG*HB¡O<º2#ñŒAƒ–¡B˜´É$¥›É:FÀÔx¾u?XÜÏÓvN©RS{2ʈãk9rmP¼Qq̳ è¼ÐFׄ^¡Öì fE“F4A…!ì/…¦Lƒ… … $%´¾yã@CI¬ á—3PþBÏNÿ<ý°4Ü ËÃ#ØÍ~âW«rEñw‹eùMMHß²`¬Öó½íf³:‹k˜¯÷}Z!ã¿<¥,\#öµÀ¯aÒNÆIé,Ћ–lŽ#Àæ9ÀÒS·I’½-Ïp Äz¤Š Â* ­íÄ9­< h>׍3ZkËU¹§˜ŒŠ±f­’¤º³Q ÏB?‹#µíÃ¥®@(Gs«†vI¥Mµ‹Á©e~2ú³ÁP4ìÕi‚²Ê^ö@-DþÓàlÜOÍ]n"µã:žpsŽ¢:! Aõ.ç~ÓBûH÷JCÌ]õVƒd «ú´QÙEA–¯¯Œ!.ˆˆëQ±ù œ·Ì!Õâ )ùL„ÅÀlÚè5@B…o´Æ¸XÓ&Û…O«˜”_#‡ƒ„ûÈt!¤ÁÏ›ÎÝŠ?c9 â\>lÓÁVÄÑ™£eØY]:fÝ–—ù+p{™ðè û³”g±OƒÚSù£áÁÊ„ä,ï7š²G ÕÌBk)~ÑiCµ|h#u¤¶îK¨² #²vݯGãeÖ϶ú…¾múÀ¶þÔñ‚Š9'^($¤§ò “š½{éúp÷J›ušS¹áªCÂubÃH9™D™/ZöØÁ‡¦ÝÙŸ·kð*_”.C‹{áXó€‡c¡c€§/šò/&éš÷,àéJþ‰X›fµ“C¨œ®r¬"kL‰Â_q…Z–.ÉL~O µ›zn‚¹À¦Öª7\àHµšÖ %»ÇníV[¥*Õ;ƒ#½¾HK-ÖIÊdÏEÚ#=o÷Óò³´Š: Ç?{¾+9›–‘OEáU·S€˜j"ÄaÜ ŒÛWt› á–c#a»pÔZÞdŽtWê=9éöÊ¢µ~ ë ;Öe‡Œ®:bî3±ýê¢wà¼îpêñ¹¾4 zc¾ðÖÿzdêŒÑÒŝÀ‰s6¤í³ÎÙB¿OZ”+F¤á‡3@Ñëäg©·Ž ˆèª<ù@É{&S„œÕúÀA)‰h:YÀ5^ÂÓŒ°õäU\ ùËÍû#²?Xe¬tu‰^zÒÔãë¼ÛWtEtû …‚g¶Úüâî*moGè¨7%u!]PhÏd™Ý%Îx: VÒ¦ôÊD3ÀŽKÛËãvÆî…N¯ä>Eró–ð`5 Œ%u5XkñÌ*NU%¶áœÊ:Qÿú»“úzyÏ6å-၇¾ ´ ÒÊ]y žO‘w2Äøæ…H’²f±ÎÇ.ª|¥'gîV•Ü .̘¯€šòü¤U~Ù†*¢!?ò wý,}´°ÔÞnïoKq5µb!áÓ3"vAßH¡³¡·G(ÐÎ0Îò¼MG!/ài®@—¬04*`…«é8ªøøló“ˆÊ”èù¤…ßÊoÿé'ËuÌÖ5×È¡§ˆˆfŽë9}hìâ_!!¯  B&Ëö¶‰ÀAÙNVŸ Wh›¸®XÑJì¨ú“¿÷3uj²˜¨ÍÎìë±aúŠÝå¯ð*Ó¨ôJ“yºØ)m°WýOè68†ŸÏ2—‰Ïüꪫٚ¥‹l1 ø ÏÄFjêµvÌbü¦èÝx:X±¢H=MÐß—,ˆÉÇ´(9ú¾^ÅÚ4¿m‡$âX‘å%(AlZo@½¨UOÌÕ”1ø¸jÎÀÃÃ_ µ‘Ü.œº¦Ut: Æï’!=¯uwû#,“pþÇúŒø(é@?³ü¥‘Mo §—s@Œ#)§ŒùkL}NOÆêA›¸~r½¼ÙA—HJ«eˆÖ´*¡ÓpÌŸö.m<-"³ûÈ$¬_6­åf£ïÚâj1y§ÕJ½@dÞÁr&Í\Z%D£Íñ·AZ Û³øüd/ªAi†/Й~  ‡âĮҮÏh§°b—›Û«mJžòG'[ÈYýŒ¦9psl ýÁ ®±f¦x,‰½tN ‚Xª9 ÙÖH.«Lo0×?͹m¡å†Ѽ+›2ƒF ±Ê8 7Hցϓ²Æ–m9…òŸï]Â1äN†VLâCˆU .ÿ‰Ts +ÅÎx(%¦u]6AF Š ØF鈄‘ |¢¶c±soŒ/t[a¾–û:s·`i햍ê›ËchÈ…8ßÀUÜewŒðNOƒõD%q#éû\9¤x¹&UE×G¥ Í—™$ð E6-‡¼!ýpãÔM˜ Âsìe¯ñµK¢Ç¡ùôléœ4Ö£”À Š®Ðc ^¨À}ÙËŸ§›ºê{ÊuÉC ×Sr€¤’fÉ*j!úÓ’Gsùìoîßîn%ò· àc Wp÷$¨˜)û»H ×8ŽÒ€Zj¤3ÀÙºY'Ql¦py{-6íÔCeiØp‘‡XÊîÆUߢ܂ž£Xé¼Y8þ©ëgñß}é.ÎógÒ„ÃØËø¯»™§Xýy M%@NŠ À(~áÐvu7&•,Ù˜ó€uP‡^^®=_E„jt’ 403WebShell
403Webshell
Server IP : 104.225.223.251  /  Your IP : 216.73.216.41
Web Server : Apache/2.4.41 (Ubuntu)
System : Linux agtdemo03 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
User : root ( 0)
PHP Version : 7.4.3-4ubuntu2.29
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /proc/self/root/usr/src/linux-headers-5.4.0-216/include/linux/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /proc/self/root/usr/src/linux-headers-5.4.0-216/include/linux//atomic-fallback.h
// SPDX-License-Identifier: GPL-2.0

// Generated by scripts/atomic/gen-atomic-fallback.sh
// DO NOT MODIFY THIS FILE DIRECTLY

#ifndef _LINUX_ATOMIC_FALLBACK_H
#define _LINUX_ATOMIC_FALLBACK_H

#ifndef xchg_relaxed
#define xchg_relaxed		xchg
#define xchg_acquire		xchg
#define xchg_release		xchg
#else /* xchg_relaxed */

#ifndef xchg_acquire
#define xchg_acquire(...) \
	__atomic_op_acquire(xchg, __VA_ARGS__)
#endif

#ifndef xchg_release
#define xchg_release(...) \
	__atomic_op_release(xchg, __VA_ARGS__)
#endif

#ifndef xchg
#define xchg(...) \
	__atomic_op_fence(xchg, __VA_ARGS__)
#endif

#endif /* xchg_relaxed */

#ifndef cmpxchg_relaxed
#define cmpxchg_relaxed		cmpxchg
#define cmpxchg_acquire		cmpxchg
#define cmpxchg_release		cmpxchg
#else /* cmpxchg_relaxed */

#ifndef cmpxchg_acquire
#define cmpxchg_acquire(...) \
	__atomic_op_acquire(cmpxchg, __VA_ARGS__)
#endif

#ifndef cmpxchg_release
#define cmpxchg_release(...) \
	__atomic_op_release(cmpxchg, __VA_ARGS__)
#endif

#ifndef cmpxchg
#define cmpxchg(...) \
	__atomic_op_fence(cmpxchg, __VA_ARGS__)
#endif

#endif /* cmpxchg_relaxed */

#ifndef cmpxchg64_relaxed
#define cmpxchg64_relaxed		cmpxchg64
#define cmpxchg64_acquire		cmpxchg64
#define cmpxchg64_release		cmpxchg64
#else /* cmpxchg64_relaxed */

#ifndef cmpxchg64_acquire
#define cmpxchg64_acquire(...) \
	__atomic_op_acquire(cmpxchg64, __VA_ARGS__)
#endif

#ifndef cmpxchg64_release
#define cmpxchg64_release(...) \
	__atomic_op_release(cmpxchg64, __VA_ARGS__)
#endif

#ifndef cmpxchg64
#define cmpxchg64(...) \
	__atomic_op_fence(cmpxchg64, __VA_ARGS__)
#endif

#endif /* cmpxchg64_relaxed */

#ifndef atomic_read_acquire
static inline int
atomic_read_acquire(const atomic_t *v)
{
	return smp_load_acquire(&(v)->counter);
}
#define atomic_read_acquire atomic_read_acquire
#endif

#ifndef atomic_set_release
static inline void
atomic_set_release(atomic_t *v, int i)
{
	smp_store_release(&(v)->counter, i);
}
#define atomic_set_release atomic_set_release
#endif

#ifndef atomic_add_return_relaxed
#define atomic_add_return_acquire atomic_add_return
#define atomic_add_return_release atomic_add_return
#define atomic_add_return_relaxed atomic_add_return
#else /* atomic_add_return_relaxed */

#ifndef atomic_add_return_acquire
static inline int
atomic_add_return_acquire(int i, atomic_t *v)
{
	int ret = atomic_add_return_relaxed(i, v);
	__atomic_acquire_fence();
	return ret;
}
#define atomic_add_return_acquire atomic_add_return_acquire
#endif

#ifndef atomic_add_return_release
static inline int
atomic_add_return_release(int i, atomic_t *v)
{
	__atomic_release_fence();
	return atomic_add_return_relaxed(i, v);
}
#define atomic_add_return_release atomic_add_return_release
#endif

#ifndef atomic_add_return
static inline int
atomic_add_return(int i, atomic_t *v)
{
	int ret;
	__atomic_pre_full_fence();
	ret = atomic_add_return_relaxed(i, v);
	__atomic_post_full_fence();
	return ret;
}
#define atomic_add_return atomic_add_return
#endif

#endif /* atomic_add_return_relaxed */

#ifndef atomic_fetch_add_relaxed
#define atomic_fetch_add_acquire atomic_fetch_add
#define atomic_fetch_add_release atomic_fetch_add
#define atomic_fetch_add_relaxed atomic_fetch_add
#else /* atomic_fetch_add_relaxed */

#ifndef atomic_fetch_add_acquire
static inline int
atomic_fetch_add_acquire(int i, atomic_t *v)
{
	int ret = atomic_fetch_add_relaxed(i, v);
	__atomic_acquire_fence();
	return ret;
}
#define atomic_fetch_add_acquire atomic_fetch_add_acquire
#endif

#ifndef atomic_fetch_add_release
static inline int
atomic_fetch_add_release(int i, atomic_t *v)
{
	__atomic_release_fence();
	return atomic_fetch_add_relaxed(i, v);
}
#define atomic_fetch_add_release atomic_fetch_add_release
#endif

#ifndef atomic_fetch_add
static inline int
atomic_fetch_add(int i, atomic_t *v)
{
	int ret;
	__atomic_pre_full_fence();
	ret = atomic_fetch_add_relaxed(i, v);
	__atomic_post_full_fence();
	return ret;
}
#define atomic_fetch_add atomic_fetch_add
#endif

#endif /* atomic_fetch_add_relaxed */

#ifndef atomic_sub_return_relaxed
#define atomic_sub_return_acquire atomic_sub_return
#define atomic_sub_return_release atomic_sub_return
#define atomic_sub_return_relaxed atomic_sub_return
#else /* atomic_sub_return_relaxed */

#ifndef atomic_sub_return_acquire
static inline int
atomic_sub_return_acquire(int i, atomic_t *v)
{
	int ret = atomic_sub_return_relaxed(i, v);
	__atomic_acquire_fence();
	return ret;
}
#define atomic_sub_return_acquire atomic_sub_return_acquire
#endif

#ifndef atomic_sub_return_release
static inline int
atomic_sub_return_release(int i, atomic_t *v)
{
	__atomic_release_fence();
	return atomic_sub_return_relaxed(i, v);
}
#define atomic_sub_return_release atomic_sub_return_release
#endif

#ifndef atomic_sub_return
static inline int
atomic_sub_return(int i, atomic_t *v)
{
	int ret;
	__atomic_pre_full_fence();
	ret = atomic_sub_return_relaxed(i, v);
	__atomic_post_full_fence();
	return ret;
}
#define atomic_sub_return atomic_sub_return
#endif

#endif /* atomic_sub_return_relaxed */

#ifndef atomic_fetch_sub_relaxed
#define atomic_fetch_sub_acquire atomic_fetch_sub
#define atomic_fetch_sub_release atomic_fetch_sub
#define atomic_fetch_sub_relaxed atomic_fetch_sub
#else /* atomic_fetch_sub_relaxed */

#ifndef atomic_fetch_sub_acquire
static inline int
atomic_fetch_sub_acquire(int i, atomic_t *v)
{
	int ret = atomic_fetch_sub_relaxed(i, v);
	__atomic_acquire_fence();
	return ret;
}
#define atomic_fetch_sub_acquire atomic_fetch_sub_acquire
#endif

#ifndef atomic_fetch_sub_release
static inline int
atomic_fetch_sub_release(int i, atomic_t *v)
{
	__atomic_release_fence();
	return atomic_fetch_sub_relaxed(i, v);
}
#define atomic_fetch_sub_release atomic_fetch_sub_release
#endif

#ifndef atomic_fetch_sub
static inline int
atomic_fetch_sub(int i, atomic_t *v)
{
	int ret;
	__atomic_pre_full_fence();
	ret = atomic_fetch_sub_relaxed(i, v);
	__atomic_post_full_fence();
	return ret;
}
#define atomic_fetch_sub atomic_fetch_sub
#endif

#endif /* atomic_fetch_sub_relaxed */

#ifndef atomic_inc
static inline void
atomic_inc(atomic_t *v)
{
	atomic_add(1, v);
}
#define atomic_inc atomic_inc
#endif

#ifndef atomic_inc_return_relaxed
#ifdef atomic_inc_return
#define atomic_inc_return_acquire atomic_inc_return
#define atomic_inc_return_release atomic_inc_return
#define atomic_inc_return_relaxed atomic_inc_return
#endif /* atomic_inc_return */

#ifndef atomic_inc_return
static inline int
atomic_inc_return(atomic_t *v)
{
	return atomic_add_return(1, v);
}
#define atomic_inc_return atomic_inc_return
#endif

#ifndef atomic_inc_return_acquire
static inline int
atomic_inc_return_acquire(atomic_t *v)
{
	return atomic_add_return_acquire(1, v);
}
#define atomic_inc_return_acquire atomic_inc_return_acquire
#endif

#ifndef atomic_inc_return_release
static inline int
atomic_inc_return_release(atomic_t *v)
{
	return atomic_add_return_release(1, v);
}
#define atomic_inc_return_release atomic_inc_return_release
#endif

#ifndef atomic_inc_return_relaxed
static inline int
atomic_inc_return_relaxed(atomic_t *v)
{
	return atomic_add_return_relaxed(1, v);
}
#define atomic_inc_return_relaxed atomic_inc_return_relaxed
#endif

#else /* atomic_inc_return_relaxed */

#ifndef atomic_inc_return_acquire
static inline int
atomic_inc_return_acquire(atomic_t *v)
{
	int ret = atomic_inc_return_relaxed(v);
	__atomic_acquire_fence();
	return ret;
}
#define atomic_inc_return_acquire atomic_inc_return_acquire
#endif

#ifndef atomic_inc_return_release
static inline int
atomic_inc_return_release(atomic_t *v)
{
	__atomic_release_fence();
	return atomic_inc_return_relaxed(v);
}
#define atomic_inc_return_release atomic_inc_return_release
#endif

#ifndef atomic_inc_return
static inline int
atomic_inc_return(atomic_t *v)
{
	int ret;
	__atomic_pre_full_fence();
	ret = atomic_inc_return_relaxed(v);
	__atomic_post_full_fence();
	return ret;
}
#define atomic_inc_return atomic_inc_return
#endif

#endif /* atomic_inc_return_relaxed */

#ifndef atomic_fetch_inc_relaxed
#ifdef atomic_fetch_inc
#define atomic_fetch_inc_acquire atomic_fetch_inc
#define atomic_fetch_inc_release atomic_fetch_inc
#define atomic_fetch_inc_relaxed atomic_fetch_inc
#endif /* atomic_fetch_inc */

#ifndef atomic_fetch_inc
static inline int
atomic_fetch_inc(atomic_t *v)
{
	return atomic_fetch_add(1, v);
}
#define atomic_fetch_inc atomic_fetch_inc
#endif

#ifndef atomic_fetch_inc_acquire
static inline int
atomic_fetch_inc_acquire(atomic_t *v)
{
	return atomic_fetch_add_acquire(1, v);
}
#define atomic_fetch_inc_acquire atomic_fetch_inc_acquire
#endif

#ifndef atomic_fetch_inc_release
static inline int
atomic_fetch_inc_release(atomic_t *v)
{
	return atomic_fetch_add_release(1, v);
}
#define atomic_fetch_inc_release atomic_fetch_inc_release
#endif

#ifndef atomic_fetch_inc_relaxed
static inline int
atomic_fetch_inc_relaxed(atomic_t *v)
{
	return atomic_fetch_add_relaxed(1, v);
}
#define atomic_fetch_inc_relaxed atomic_fetch_inc_relaxed
#endif

#else /* atomic_fetch_inc_relaxed */

#ifndef atomic_fetch_inc_acquire
static inline int
atomic_fetch_inc_acquire(atomic_t *v)
{
	int ret = atomic_fetch_inc_relaxed(v);
	__atomic_acquire_fence();
	return ret;
}
#define atomic_fetch_inc_acquire atomic_fetch_inc_acquire
#endif

#ifndef atomic_fetch_inc_release
static inline int
atomic_fetch_inc_release(atomic_t *v)
{
	__atomic_release_fence();
	return atomic_fetch_inc_relaxed(v);
}
#define atomic_fetch_inc_release atomic_fetch_inc_release
#endif

#ifndef atomic_fetch_inc
static inline int
atomic_fetch_inc(atomic_t *v)
{
	int ret;
	__atomic_pre_full_fence();
	ret = atomic_fetch_inc_relaxed(v);
	__atomic_post_full_fence();
	return ret;
}
#define atomic_fetch_inc atomic_fetch_inc
#endif

#endif /* atomic_fetch_inc_relaxed */

#ifndef atomic_dec
static inline void
atomic_dec(atomic_t *v)
{
	atomic_sub(1, v);
}
#define atomic_dec atomic_dec
#endif

#ifndef atomic_dec_return_relaxed
#ifdef atomic_dec_return
#define atomic_dec_return_acquire atomic_dec_return
#define atomic_dec_return_release atomic_dec_return
#define atomic_dec_return_relaxed atomic_dec_return
#endif /* atomic_dec_return */

#ifndef atomic_dec_return
static inline int
atomic_dec_return(atomic_t *v)
{
	return atomic_sub_return(1, v);
}
#define atomic_dec_return atomic_dec_return
#endif

#ifndef atomic_dec_return_acquire
static inline int
atomic_dec_return_acquire(atomic_t *v)
{
	return atomic_sub_return_acquire(1, v);
}
#define atomic_dec_return_acquire atomic_dec_return_acquire
#endif

#ifndef atomic_dec_return_release
static inline int
atomic_dec_return_release(atomic_t *v)
{
	return atomic_sub_return_release(1, v);
}
#define atomic_dec_return_release atomic_dec_return_release
#endif

#ifndef atomic_dec_return_relaxed
static inline int
atomic_dec_return_relaxed(atomic_t *v)
{
	return atomic_sub_return_relaxed(1, v);
}
#define atomic_dec_return_relaxed atomic_dec_return_relaxed
#endif

#else /* atomic_dec_return_relaxed */

#ifndef atomic_dec_return_acquire
static inline int
atomic_dec_return_acquire(atomic_t *v)
{
	int ret = atomic_dec_return_relaxed(v);
	__atomic_acquire_fence();
	return ret;
}
#define atomic_dec_return_acquire atomic_dec_return_acquire
#endif

#ifndef atomic_dec_return_release
static inline int
atomic_dec_return_release(atomic_t *v)
{
	__atomic_release_fence();
	return atomic_dec_return_relaxed(v);
}
#define atomic_dec_return_release atomic_dec_return_release
#endif

#ifndef atomic_dec_return
static inline int
atomic_dec_return(atomic_t *v)
{
	int ret;
	__atomic_pre_full_fence();
	ret = atomic_dec_return_relaxed(v);
	__atomic_post_full_fence();
	return ret;
}
#define atomic_dec_return atomic_dec_return
#endif

#endif /* atomic_dec_return_relaxed */

#ifndef atomic_fetch_dec_relaxed
#ifdef atomic_fetch_dec
#define atomic_fetch_dec_acquire atomic_fetch_dec
#define atomic_fetch_dec_release atomic_fetch_dec
#define atomic_fetch_dec_relaxed atomic_fetch_dec
#endif /* atomic_fetch_dec */

#ifndef atomic_fetch_dec
static inline int
atomic_fetch_dec(atomic_t *v)
{
	return atomic_fetch_sub(1, v);
}
#define atomic_fetch_dec atomic_fetch_dec
#endif

#ifndef atomic_fetch_dec_acquire
static inline int
atomic_fetch_dec_acquire(atomic_t *v)
{
	return atomic_fetch_sub_acquire(1, v);
}
#define atomic_fetch_dec_acquire atomic_fetch_dec_acquire
#endif

#ifndef atomic_fetch_dec_release
static inline int
atomic_fetch_dec_release(atomic_t *v)
{
	return atomic_fetch_sub_release(1, v);
}
#define atomic_fetch_dec_release atomic_fetch_dec_release
#endif

#ifndef atomic_fetch_dec_relaxed
static inline int
atomic_fetch_dec_relaxed(atomic_t *v)
{
	return atomic_fetch_sub_relaxed(1, v);
}
#define atomic_fetch_dec_relaxed atomic_fetch_dec_relaxed
#endif

#else /* atomic_fetch_dec_relaxed */

#ifndef atomic_fetch_dec_acquire
static inline int
atomic_fetch_dec_acquire(atomic_t *v)
{
	int ret = atomic_fetch_dec_relaxed(v);
	__atomic_acquire_fence();
	return ret;
}
#define atomic_fetch_dec_acquire atomic_fetch_dec_acquire
#endif

#ifndef atomic_fetch_dec_release
static inline int
atomic_fetch_dec_release(atomic_t *v)
{
	__atomic_release_fence();
	return atomic_fetch_dec_relaxed(v);
}
#define atomic_fetch_dec_release atomic_fetch_dec_release
#endif

#ifndef atomic_fetch_dec
static inline int
atomic_fetch_dec(atomic_t *v)
{
	int ret;
	__atomic_pre_full_fence();
	ret = atomic_fetch_dec_relaxed(v);
	__atomic_post_full_fence();
	return ret;
}
#define atomic_fetch_dec atomic_fetch_dec
#endif

#endif /* atomic_fetch_dec_relaxed */

#ifndef atomic_fetch_and_relaxed
#define atomic_fetch_and_acquire atomic_fetch_and
#define atomic_fetch_and_release atomic_fetch_and
#define atomic_fetch_and_relaxed atomic_fetch_and
#else /* atomic_fetch_and_relaxed */

#ifndef atomic_fetch_and_acquire
static inline int
atomic_fetch_and_acquire(int i, atomic_t *v)
{
	int ret = atomic_fetch_and_relaxed(i, v);
	__atomic_acquire_fence();
	return ret;
}
#define atomic_fetch_and_acquire atomic_fetch_and_acquire
#endif

#ifndef atomic_fetch_and_release
static inline int
atomic_fetch_and_release(int i, atomic_t *v)
{
	__atomic_release_fence();
	return atomic_fetch_and_relaxed(i, v);
}
#define atomic_fetch_and_release atomic_fetch_and_release
#endif

#ifndef atomic_fetch_and
static inline int
atomic_fetch_and(int i, atomic_t *v)
{
	int ret;
	__atomic_pre_full_fence();
	ret = atomic_fetch_and_relaxed(i, v);
	__atomic_post_full_fence();
	return ret;
}
#define atomic_fetch_and atomic_fetch_and
#endif

#endif /* atomic_fetch_and_relaxed */

#ifndef atomic_andnot
static inline void
atomic_andnot(int i, atomic_t *v)
{
	atomic_and(~i, v);
}
#define atomic_andnot atomic_andnot
#endif

#ifndef atomic_fetch_andnot_relaxed
#ifdef atomic_fetch_andnot
#define atomic_fetch_andnot_acquire atomic_fetch_andnot
#define atomic_fetch_andnot_release atomic_fetch_andnot
#define atomic_fetch_andnot_relaxed atomic_fetch_andnot
#endif /* atomic_fetch_andnot */

#ifndef atomic_fetch_andnot
static inline int
atomic_fetch_andnot(int i, atomic_t *v)
{
	return atomic_fetch_and(~i, v);
}
#define atomic_fetch_andnot atomic_fetch_andnot
#endif

#ifndef atomic_fetch_andnot_acquire
static inline int
atomic_fetch_andnot_acquire(int i, atomic_t *v)
{
	return atomic_fetch_and_acquire(~i, v);
}
#define atomic_fetch_andnot_acquire atomic_fetch_andnot_acquire
#endif

#ifndef atomic_fetch_andnot_release
static inline int
atomic_fetch_andnot_release(int i, atomic_t *v)
{
	return atomic_fetch_and_release(~i, v);
}
#define atomic_fetch_andnot_release atomic_fetch_andnot_release
#endif

#ifndef atomic_fetch_andnot_relaxed
static inline int
atomic_fetch_andnot_relaxed(int i, atomic_t *v)
{
	return atomic_fetch_and_relaxed(~i, v);
}
#define atomic_fetch_andnot_relaxed atomic_fetch_andnot_relaxed
#endif

#else /* atomic_fetch_andnot_relaxed */

#ifndef atomic_fetch_andnot_acquire
static inline int
atomic_fetch_andnot_acquire(int i, atomic_t *v)
{
	int ret = atomic_fetch_andnot_relaxed(i, v);
	__atomic_acquire_fence();
	return ret;
}
#define atomic_fetch_andnot_acquire atomic_fetch_andnot_acquire
#endif

#ifndef atomic_fetch_andnot_release
static inline int
atomic_fetch_andnot_release(int i, atomic_t *v)
{
	__atomic_release_fence();
	return atomic_fetch_andnot_relaxed(i, v);
}
#define atomic_fetch_andnot_release atomic_fetch_andnot_release
#endif

#ifndef atomic_fetch_andnot
static inline int
atomic_fetch_andnot(int i, atomic_t *v)
{
	int ret;
	__atomic_pre_full_fence();
	ret = atomic_fetch_andnot_relaxed(i, v);
	__atomic_post_full_fence();
	return ret;
}
#define atomic_fetch_andnot atomic_fetch_andnot
#endif

#endif /* atomic_fetch_andnot_relaxed */

#ifndef atomic_fetch_or_relaxed
#define atomic_fetch_or_acquire atomic_fetch_or
#define atomic_fetch_or_release atomic_fetch_or
#define atomic_fetch_or_relaxed atomic_fetch_or
#else /* atomic_fetch_or_relaxed */

#ifndef atomic_fetch_or_acquire
static inline int
atomic_fetch_or_acquire(int i, atomic_t *v)
{
	int ret = atomic_fetch_or_relaxed(i, v);
	__atomic_acquire_fence();
	return ret;
}
#define atomic_fetch_or_acquire atomic_fetch_or_acquire
#endif

#ifndef atomic_fetch_or_release
static inline int
atomic_fetch_or_release(int i, atomic_t *v)
{
	__atomic_release_fence();
	return atomic_fetch_or_relaxed(i, v);
}
#define atomic_fetch_or_release atomic_fetch_or_release
#endif

#ifndef atomic_fetch_or
static inline int
atomic_fetch_or(int i, atomic_t *v)
{
	int ret;
	__atomic_pre_full_fence();
	ret = atomic_fetch_or_relaxed(i, v);
	__atomic_post_full_fence();
	return ret;
}
#define atomic_fetch_or atomic_fetch_or
#endif

#endif /* atomic_fetch_or_relaxed */

#ifndef atomic_fetch_xor_relaxed
#define atomic_fetch_xor_acquire atomic_fetch_xor
#define atomic_fetch_xor_release atomic_fetch_xor
#define atomic_fetch_xor_relaxed atomic_fetch_xor
#else /* atomic_fetch_xor_relaxed */

#ifndef atomic_fetch_xor_acquire
static inline int
atomic_fetch_xor_acquire(int i, atomic_t *v)
{
	int ret = atomic_fetch_xor_relaxed(i, v);
	__atomic_acquire_fence();
	return ret;
}
#define atomic_fetch_xor_acquire atomic_fetch_xor_acquire
#endif

#ifndef atomic_fetch_xor_release
static inline int
atomic_fetch_xor_release(int i, atomic_t *v)
{
	__atomic_release_fence();
	return atomic_fetch_xor_relaxed(i, v);
}
#define atomic_fetch_xor_release atomic_fetch_xor_release
#endif

#ifndef atomic_fetch_xor
static inline int
atomic_fetch_xor(int i, atomic_t *v)
{
	int ret;
	__atomic_pre_full_fence();
	ret = atomic_fetch_xor_relaxed(i, v);
	__atomic_post_full_fence();
	return ret;
}
#define atomic_fetch_xor atomic_fetch_xor
#endif

#endif /* atomic_fetch_xor_relaxed */

#ifndef atomic_xchg_relaxed
#define atomic_xchg_acquire atomic_xchg
#define atomic_xchg_release atomic_xchg
#define atomic_xchg_relaxed atomic_xchg
#else /* atomic_xchg_relaxed */

#ifndef atomic_xchg_acquire
static inline int
atomic_xchg_acquire(atomic_t *v, int i)
{
	int ret = atomic_xchg_relaxed(v, i);
	__atomic_acquire_fence();
	return ret;
}
#define atomic_xchg_acquire atomic_xchg_acquire
#endif

#ifndef atomic_xchg_release
static inline int
atomic_xchg_release(atomic_t *v, int i)
{
	__atomic_release_fence();
	return atomic_xchg_relaxed(v, i);
}
#define atomic_xchg_release atomic_xchg_release
#endif

#ifndef atomic_xchg
static inline int
atomic_xchg(atomic_t *v, int i)
{
	int ret;
	__atomic_pre_full_fence();
	ret = atomic_xchg_relaxed(v, i);
	__atomic_post_full_fence();
	return ret;
}
#define atomic_xchg atomic_xchg
#endif

#endif /* atomic_xchg_relaxed */

#ifndef atomic_cmpxchg_relaxed
#define atomic_cmpxchg_acquire atomic_cmpxchg
#define atomic_cmpxchg_release atomic_cmpxchg
#define atomic_cmpxchg_relaxed atomic_cmpxchg
#else /* atomic_cmpxchg_relaxed */

#ifndef atomic_cmpxchg_acquire
static inline int
atomic_cmpxchg_acquire(atomic_t *v, int old, int new)
{
	int ret = atomic_cmpxchg_relaxed(v, old, new);
	__atomic_acquire_fence();
	return ret;
}
#define atomic_cmpxchg_acquire atomic_cmpxchg_acquire
#endif

#ifndef atomic_cmpxchg_release
static inline int
atomic_cmpxchg_release(atomic_t *v, int old, int new)
{
	__atomic_release_fence();
	return atomic_cmpxchg_relaxed(v, old, new);
}
#define atomic_cmpxchg_release atomic_cmpxchg_release
#endif

#ifndef atomic_cmpxchg
static inline int
atomic_cmpxchg(atomic_t *v, int old, int new)
{
	int ret;
	__atomic_pre_full_fence();
	ret = atomic_cmpxchg_relaxed(v, old, new);
	__atomic_post_full_fence();
	return ret;
}
#define atomic_cmpxchg atomic_cmpxchg
#endif

#endif /* atomic_cmpxchg_relaxed */

#ifndef atomic_try_cmpxchg_relaxed
#ifdef atomic_try_cmpxchg
#define atomic_try_cmpxchg_acquire atomic_try_cmpxchg
#define atomic_try_cmpxchg_release atomic_try_cmpxchg
#define atomic_try_cmpxchg_relaxed atomic_try_cmpxchg
#endif /* atomic_try_cmpxchg */

#ifndef atomic_try_cmpxchg
static inline bool
atomic_try_cmpxchg(atomic_t *v, int *old, int new)
{
	int r, o = *old;
	r = atomic_cmpxchg(v, o, new);
	if (unlikely(r != o))
		*old = r;
	return likely(r == o);
}
#define atomic_try_cmpxchg atomic_try_cmpxchg
#endif

#ifndef atomic_try_cmpxchg_acquire
static inline bool
atomic_try_cmpxchg_acquire(atomic_t *v, int *old, int new)
{
	int r, o = *old;
	r = atomic_cmpxchg_acquire(v, o, new);
	if (unlikely(r != o))
		*old = r;
	return likely(r == o);
}
#define atomic_try_cmpxchg_acquire atomic_try_cmpxchg_acquire
#endif

#ifndef atomic_try_cmpxchg_release
static inline bool
atomic_try_cmpxchg_release(atomic_t *v, int *old, int new)
{
	int r, o = *old;
	r = atomic_cmpxchg_release(v, o, new);
	if (unlikely(r != o))
		*old = r;
	return likely(r == o);
}
#define atomic_try_cmpxchg_release atomic_try_cmpxchg_release
#endif

#ifndef atomic_try_cmpxchg_relaxed
static inline bool
atomic_try_cmpxchg_relaxed(atomic_t *v, int *old, int new)
{
	int r, o = *old;
	r = atomic_cmpxchg_relaxed(v, o, new);
	if (unlikely(r != o))
		*old = r;
	return likely(r == o);
}
#define atomic_try_cmpxchg_relaxed atomic_try_cmpxchg_relaxed
#endif

#else /* atomic_try_cmpxchg_relaxed */

#ifndef atomic_try_cmpxchg_acquire
static inline bool
atomic_try_cmpxchg_acquire(atomic_t *v, int *old, int new)
{
	bool ret = atomic_try_cmpxchg_relaxed(v, old, new);
	__atomic_acquire_fence();
	return ret;
}
#define atomic_try_cmpxchg_acquire atomic_try_cmpxchg_acquire
#endif

#ifndef atomic_try_cmpxchg_release
static inline bool
atomic_try_cmpxchg_release(atomic_t *v, int *old, int new)
{
	__atomic_release_fence();
	return atomic_try_cmpxchg_relaxed(v, old, new);
}
#define atomic_try_cmpxchg_release atomic_try_cmpxchg_release
#endif

#ifndef atomic_try_cmpxchg
static inline bool
atomic_try_cmpxchg(atomic_t *v, int *old, int new)
{
	bool ret;
	__atomic_pre_full_fence();
	ret = atomic_try_cmpxchg_relaxed(v, old, new);
	__atomic_post_full_fence();
	return ret;
}
#define atomic_try_cmpxchg atomic_try_cmpxchg
#endif

#endif /* atomic_try_cmpxchg_relaxed */

#ifndef atomic_sub_and_test
/**
 * atomic_sub_and_test - subtract value from variable and test result
 * @i: integer value to subtract
 * @v: pointer of type atomic_t
 *
 * Atomically subtracts @i from @v and returns
 * true if the result is zero, or false for all
 * other cases.
 */
static inline bool
atomic_sub_and_test(int i, atomic_t *v)
{
	return atomic_sub_return(i, v) == 0;
}
#define atomic_sub_and_test atomic_sub_and_test
#endif

#ifndef atomic_dec_and_test
/**
 * atomic_dec_and_test - decrement and test
 * @v: pointer of type atomic_t
 *
 * Atomically decrements @v by 1 and
 * returns true if the result is 0, or false for all other
 * cases.
 */
static inline bool
atomic_dec_and_test(atomic_t *v)
{
	return atomic_dec_return(v) == 0;
}
#define atomic_dec_and_test atomic_dec_and_test
#endif

#ifndef atomic_inc_and_test
/**
 * atomic_inc_and_test - increment and test
 * @v: pointer of type atomic_t
 *
 * Atomically increments @v by 1
 * and returns true if the result is zero, or false for all
 * other cases.
 */
static inline bool
atomic_inc_and_test(atomic_t *v)
{
	return atomic_inc_return(v) == 0;
}
#define atomic_inc_and_test atomic_inc_and_test
#endif

#ifndef atomic_add_negative
/**
 * atomic_add_negative - add and test if negative
 * @i: integer value to add
 * @v: pointer of type atomic_t
 *
 * Atomically adds @i to @v and returns true
 * if the result is negative, or false when
 * result is greater than or equal to zero.
 */
static inline bool
atomic_add_negative(int i, atomic_t *v)
{
	return atomic_add_return(i, v) < 0;
}
#define atomic_add_negative atomic_add_negative
#endif

#ifndef atomic_fetch_add_unless
/**
 * atomic_fetch_add_unless - add unless the number is already a given value
 * @v: pointer of type atomic_t
 * @a: the amount to add to v...
 * @u: ...unless v is equal to u.
 *
 * Atomically adds @a to @v, so long as @v was not already @u.
 * Returns original value of @v
 */
static inline int
atomic_fetch_add_unless(atomic_t *v, int a, int u)
{
	int c = atomic_read(v);

	do {
		if (unlikely(c == u))
			break;
	} while (!atomic_try_cmpxchg(v, &c, c + a));

	return c;
}
#define atomic_fetch_add_unless atomic_fetch_add_unless
#endif

#ifndef atomic_add_unless
/**
 * atomic_add_unless - add unless the number is already a given value
 * @v: pointer of type atomic_t
 * @a: the amount to add to v...
 * @u: ...unless v is equal to u.
 *
 * Atomically adds @a to @v, if @v was not already @u.
 * Returns true if the addition was done.
 */
static inline bool
atomic_add_unless(atomic_t *v, int a, int u)
{
	return atomic_fetch_add_unless(v, a, u) != u;
}
#define atomic_add_unless atomic_add_unless
#endif

#ifndef atomic_inc_not_zero
/**
 * atomic_inc_not_zero - increment unless the number is zero
 * @v: pointer of type atomic_t
 *
 * Atomically increments @v by 1, if @v is non-zero.
 * Returns true if the increment was done.
 */
static inline bool
atomic_inc_not_zero(atomic_t *v)
{
	return atomic_add_unless(v, 1, 0);
}
#define atomic_inc_not_zero atomic_inc_not_zero
#endif

#ifndef atomic_inc_unless_negative
static inline bool
atomic_inc_unless_negative(atomic_t *v)
{
	int c = atomic_read(v);

	do {
		if (unlikely(c < 0))
			return false;
	} while (!atomic_try_cmpxchg(v, &c, c + 1));

	return true;
}
#define atomic_inc_unless_negative atomic_inc_unless_negative
#endif

#ifndef atomic_dec_unless_positive
static inline bool
atomic_dec_unless_positive(atomic_t *v)
{
	int c = atomic_read(v);

	do {
		if (unlikely(c > 0))
			return false;
	} while (!atomic_try_cmpxchg(v, &c, c - 1));

	return true;
}
#define atomic_dec_unless_positive atomic_dec_unless_positive
#endif

#ifndef atomic_dec_if_positive
static inline int
atomic_dec_if_positive(atomic_t *v)
{
	int dec, c = atomic_read(v);

	do {
		dec = c - 1;
		if (unlikely(dec < 0))
			break;
	} while (!atomic_try_cmpxchg(v, &c, dec));

	return dec;
}
#define atomic_dec_if_positive atomic_dec_if_positive
#endif

#define atomic_cond_read_acquire(v, c) smp_cond_load_acquire(&(v)->counter, (c))
#define atomic_cond_read_relaxed(v, c) smp_cond_load_relaxed(&(v)->counter, (c))

#ifdef CONFIG_GENERIC_ATOMIC64
#include <asm-generic/atomic64.h>
#endif

#ifndef atomic64_read_acquire
static inline s64
atomic64_read_acquire(const atomic64_t *v)
{
	return smp_load_acquire(&(v)->counter);
}
#define atomic64_read_acquire atomic64_read_acquire
#endif

#ifndef atomic64_set_release
static inline void
atomic64_set_release(atomic64_t *v, s64 i)
{
	smp_store_release(&(v)->counter, i);
}
#define atomic64_set_release atomic64_set_release
#endif

#ifndef atomic64_add_return_relaxed
#define atomic64_add_return_acquire atomic64_add_return
#define atomic64_add_return_release atomic64_add_return
#define atomic64_add_return_relaxed atomic64_add_return
#else /* atomic64_add_return_relaxed */

#ifndef atomic64_add_return_acquire
static inline s64
atomic64_add_return_acquire(s64 i, atomic64_t *v)
{
	s64 ret = atomic64_add_return_relaxed(i, v);
	__atomic_acquire_fence();
	return ret;
}
#define atomic64_add_return_acquire atomic64_add_return_acquire
#endif

#ifndef atomic64_add_return_release
static inline s64
atomic64_add_return_release(s64 i, atomic64_t *v)
{
	__atomic_release_fence();
	return atomic64_add_return_relaxed(i, v);
}
#define atomic64_add_return_release atomic64_add_return_release
#endif

#ifndef atomic64_add_return
static inline s64
atomic64_add_return(s64 i, atomic64_t *v)
{
	s64 ret;
	__atomic_pre_full_fence();
	ret = atomic64_add_return_relaxed(i, v);
	__atomic_post_full_fence();
	return ret;
}
#define atomic64_add_return atomic64_add_return
#endif

#endif /* atomic64_add_return_relaxed */

#ifndef atomic64_fetch_add_relaxed
#define atomic64_fetch_add_acquire atomic64_fetch_add
#define atomic64_fetch_add_release atomic64_fetch_add
#define atomic64_fetch_add_relaxed atomic64_fetch_add
#else /* atomic64_fetch_add_relaxed */

#ifndef atomic64_fetch_add_acquire
static inline s64
atomic64_fetch_add_acquire(s64 i, atomic64_t *v)
{
	s64 ret = atomic64_fetch_add_relaxed(i, v);
	__atomic_acquire_fence();
	return ret;
}
#define atomic64_fetch_add_acquire atomic64_fetch_add_acquire
#endif

#ifndef atomic64_fetch_add_release
static inline s64
atomic64_fetch_add_release(s64 i, atomic64_t *v)
{
	__atomic_release_fence();
	return atomic64_fetch_add_relaxed(i, v);
}
#define atomic64_fetch_add_release atomic64_fetch_add_release
#endif

#ifndef atomic64_fetch_add
static inline s64
atomic64_fetch_add(s64 i, atomic64_t *v)
{
	s64 ret;
	__atomic_pre_full_fence();
	ret = atomic64_fetch_add_relaxed(i, v);
	__atomic_post_full_fence();
	return ret;
}
#define atomic64_fetch_add atomic64_fetch_add
#endif

#endif /* atomic64_fetch_add_relaxed */

#ifndef atomic64_sub_return_relaxed
#define atomic64_sub_return_acquire atomic64_sub_return
#define atomic64_sub_return_release atomic64_sub_return
#define atomic64_sub_return_relaxed atomic64_sub_return
#else /* atomic64_sub_return_relaxed */

#ifndef atomic64_sub_return_acquire
static inline s64
atomic64_sub_return_acquire(s64 i, atomic64_t *v)
{
	s64 ret = atomic64_sub_return_relaxed(i, v);
	__atomic_acquire_fence();
	return ret;
}
#define atomic64_sub_return_acquire atomic64_sub_return_acquire
#endif

#ifndef atomic64_sub_return_release
static inline s64
atomic64_sub_return_release(s64 i, atomic64_t *v)
{
	__atomic_release_fence();
	return atomic64_sub_return_relaxed(i, v);
}
#define atomic64_sub_return_release atomic64_sub_return_release
#endif

#ifndef atomic64_sub_return
static inline s64
atomic64_sub_return(s64 i, atomic64_t *v)
{
	s64 ret;
	__atomic_pre_full_fence();
	ret = atomic64_sub_return_relaxed(i, v);
	__atomic_post_full_fence();
	return ret;
}
#define atomic64_sub_return atomic64_sub_return
#endif

#endif /* atomic64_sub_return_relaxed */

#ifndef atomic64_fetch_sub_relaxed
#define atomic64_fetch_sub_acquire atomic64_fetch_sub
#define atomic64_fetch_sub_release atomic64_fetch_sub
#define atomic64_fetch_sub_relaxed atomic64_fetch_sub
#else /* atomic64_fetch_sub_relaxed */

#ifndef atomic64_fetch_sub_acquire
static inline s64
atomic64_fetch_sub_acquire(s64 i, atomic64_t *v)
{
	s64 ret = atomic64_fetch_sub_relaxed(i, v);
	__atomic_acquire_fence();
	return ret;
}
#define atomic64_fetch_sub_acquire atomic64_fetch_sub_acquire
#endif

#ifndef atomic64_fetch_sub_release
static inline s64
atomic64_fetch_sub_release(s64 i, atomic64_t *v)
{
	__atomic_release_fence();
	return atomic64_fetch_sub_relaxed(i, v);
}
#define atomic64_fetch_sub_release atomic64_fetch_sub_release
#endif

#ifndef atomic64_fetch_sub
static inline s64
atomic64_fetch_sub(s64 i, atomic64_t *v)
{
	s64 ret;
	__atomic_pre_full_fence();
	ret = atomic64_fetch_sub_relaxed(i, v);
	__atomic_post_full_fence();
	return ret;
}
#define atomic64_fetch_sub atomic64_fetch_sub
#endif

#endif /* atomic64_fetch_sub_relaxed */

#ifndef atomic64_inc
static inline void
atomic64_inc(atomic64_t *v)
{
	atomic64_add(1, v);
}
#define atomic64_inc atomic64_inc
#endif

#ifndef atomic64_inc_return_relaxed
#ifdef atomic64_inc_return
#define atomic64_inc_return_acquire atomic64_inc_return
#define atomic64_inc_return_release atomic64_inc_return
#define atomic64_inc_return_relaxed atomic64_inc_return
#endif /* atomic64_inc_return */

#ifndef atomic64_inc_return
static inline s64
atomic64_inc_return(atomic64_t *v)
{
	return atomic64_add_return(1, v);
}
#define atomic64_inc_return atomic64_inc_return
#endif

#ifndef atomic64_inc_return_acquire
static inline s64
atomic64_inc_return_acquire(atomic64_t *v)
{
	return atomic64_add_return_acquire(1, v);
}
#define atomic64_inc_return_acquire atomic64_inc_return_acquire
#endif

#ifndef atomic64_inc_return_release
static inline s64
atomic64_inc_return_release(atomic64_t *v)
{
	return atomic64_add_return_release(1, v);
}
#define atomic64_inc_return_release atomic64_inc_return_release
#endif

#ifndef atomic64_inc_return_relaxed
static inline s64
atomic64_inc_return_relaxed(atomic64_t *v)
{
	return atomic64_add_return_relaxed(1, v);
}
#define atomic64_inc_return_relaxed atomic64_inc_return_relaxed
#endif

#else /* atomic64_inc_return_relaxed */

#ifndef atomic64_inc_return_acquire
static inline s64
atomic64_inc_return_acquire(atomic64_t *v)
{
	s64 ret = atomic64_inc_return_relaxed(v);
	__atomic_acquire_fence();
	return ret;
}
#define atomic64_inc_return_acquire atomic64_inc_return_acquire
#endif

#ifndef atomic64_inc_return_release
static inline s64
atomic64_inc_return_release(atomic64_t *v)
{
	__atomic_release_fence();
	return atomic64_inc_return_relaxed(v);
}
#define atomic64_inc_return_release atomic64_inc_return_release
#endif

#ifndef atomic64_inc_return
static inline s64
atomic64_inc_return(atomic64_t *v)
{
	s64 ret;
	__atomic_pre_full_fence();
	ret = atomic64_inc_return_relaxed(v);
	__atomic_post_full_fence();
	return ret;
}
#define atomic64_inc_return atomic64_inc_return
#endif

#endif /* atomic64_inc_return_relaxed */

#ifndef atomic64_fetch_inc_relaxed
#ifdef atomic64_fetch_inc
#define atomic64_fetch_inc_acquire atomic64_fetch_inc
#define atomic64_fetch_inc_release atomic64_fetch_inc
#define atomic64_fetch_inc_relaxed atomic64_fetch_inc
#endif /* atomic64_fetch_inc */

#ifndef atomic64_fetch_inc
static inline s64
atomic64_fetch_inc(atomic64_t *v)
{
	return atomic64_fetch_add(1, v);
}
#define atomic64_fetch_inc atomic64_fetch_inc
#endif

#ifndef atomic64_fetch_inc_acquire
static inline s64
atomic64_fetch_inc_acquire(atomic64_t *v)
{
	return atomic64_fetch_add_acquire(1, v);
}
#define atomic64_fetch_inc_acquire atomic64_fetch_inc_acquire
#endif

#ifndef atomic64_fetch_inc_release
static inline s64
atomic64_fetch_inc_release(atomic64_t *v)
{
	return atomic64_fetch_add_release(1, v);
}
#define atomic64_fetch_inc_release atomic64_fetch_inc_release
#endif

#ifndef atomic64_fetch_inc_relaxed
static inline s64
atomic64_fetch_inc_relaxed(atomic64_t *v)
{
	return atomic64_fetch_add_relaxed(1, v);
}
#define atomic64_fetch_inc_relaxed atomic64_fetch_inc_relaxed
#endif

#else /* atomic64_fetch_inc_relaxed */

#ifndef atomic64_fetch_inc_acquire
static inline s64
atomic64_fetch_inc_acquire(atomic64_t *v)
{
	s64 ret = atomic64_fetch_inc_relaxed(v);
	__atomic_acquire_fence();
	return ret;
}
#define atomic64_fetch_inc_acquire atomic64_fetch_inc_acquire
#endif

#ifndef atomic64_fetch_inc_release
static inline s64
atomic64_fetch_inc_release(atomic64_t *v)
{
	__atomic_release_fence();
	return atomic64_fetch_inc_relaxed(v);
}
#define atomic64_fetch_inc_release atomic64_fetch_inc_release
#endif

#ifndef atomic64_fetch_inc
static inline s64
atomic64_fetch_inc(atomic64_t *v)
{
	s64 ret;
	__atomic_pre_full_fence();
	ret = atomic64_fetch_inc_relaxed(v);
	__atomic_post_full_fence();
	return ret;
}
#define atomic64_fetch_inc atomic64_fetch_inc
#endif

#endif /* atomic64_fetch_inc_relaxed */

#ifndef atomic64_dec
static inline void
atomic64_dec(atomic64_t *v)
{
	atomic64_sub(1, v);
}
#define atomic64_dec atomic64_dec
#endif

#ifndef atomic64_dec_return_relaxed
#ifdef atomic64_dec_return
#define atomic64_dec_return_acquire atomic64_dec_return
#define atomic64_dec_return_release atomic64_dec_return
#define atomic64_dec_return_relaxed atomic64_dec_return
#endif /* atomic64_dec_return */

#ifndef atomic64_dec_return
static inline s64
atomic64_dec_return(atomic64_t *v)
{
	return atomic64_sub_return(1, v);
}
#define atomic64_dec_return atomic64_dec_return
#endif

#ifndef atomic64_dec_return_acquire
static inline s64
atomic64_dec_return_acquire(atomic64_t *v)
{
	return atomic64_sub_return_acquire(1, v);
}
#define atomic64_dec_return_acquire atomic64_dec_return_acquire
#endif

#ifndef atomic64_dec_return_release
static inline s64
atomic64_dec_return_release(atomic64_t *v)
{
	return atomic64_sub_return_release(1, v);
}
#define atomic64_dec_return_release atomic64_dec_return_release
#endif

#ifndef atomic64_dec_return_relaxed
static inline s64
atomic64_dec_return_relaxed(atomic64_t *v)
{
	return atomic64_sub_return_relaxed(1, v);
}
#define atomic64_dec_return_relaxed atomic64_dec_return_relaxed
#endif

#else /* atomic64_dec_return_relaxed */

#ifndef atomic64_dec_return_acquire
static inline s64
atomic64_dec_return_acquire(atomic64_t *v)
{
	s64 ret = atomic64_dec_return_relaxed(v);
	__atomic_acquire_fence();
	return ret;
}
#define atomic64_dec_return_acquire atomic64_dec_return_acquire
#endif

#ifndef atomic64_dec_return_release
static inline s64
atomic64_dec_return_release(atomic64_t *v)
{
	__atomic_release_fence();
	return atomic64_dec_return_relaxed(v);
}
#define atomic64_dec_return_release atomic64_dec_return_release
#endif

#ifndef atomic64_dec_return
static inline s64
atomic64_dec_return(atomic64_t *v)
{
	s64 ret;
	__atomic_pre_full_fence();
	ret = atomic64_dec_return_relaxed(v);
	__atomic_post_full_fence();
	return ret;
}
#define atomic64_dec_return atomic64_dec_return
#endif

#endif /* atomic64_dec_return_relaxed */

#ifndef atomic64_fetch_dec_relaxed
#ifdef atomic64_fetch_dec
#define atomic64_fetch_dec_acquire atomic64_fetch_dec
#define atomic64_fetch_dec_release atomic64_fetch_dec
#define atomic64_fetch_dec_relaxed atomic64_fetch_dec
#endif /* atomic64_fetch_dec */

#ifndef atomic64_fetch_dec
static inline s64
atomic64_fetch_dec(atomic64_t *v)
{
	return atomic64_fetch_sub(1, v);
}
#define atomic64_fetch_dec atomic64_fetch_dec
#endif

#ifndef atomic64_fetch_dec_acquire
static inline s64
atomic64_fetch_dec_acquire(atomic64_t *v)
{
	return atomic64_fetch_sub_acquire(1, v);
}
#define atomic64_fetch_dec_acquire atomic64_fetch_dec_acquire
#endif

#ifndef atomic64_fetch_dec_release
static inline s64
atomic64_fetch_dec_release(atomic64_t *v)
{
	return atomic64_fetch_sub_release(1, v);
}
#define atomic64_fetch_dec_release atomic64_fetch_dec_release
#endif

#ifndef atomic64_fetch_dec_relaxed
static inline s64
atomic64_fetch_dec_relaxed(atomic64_t *v)
{
	return atomic64_fetch_sub_relaxed(1, v);
}
#define atomic64_fetch_dec_relaxed atomic64_fetch_dec_relaxed
#endif

#else /* atomic64_fetch_dec_relaxed */

#ifndef atomic64_fetch_dec_acquire
static inline s64
atomic64_fetch_dec_acquire(atomic64_t *v)
{
	s64 ret = atomic64_fetch_dec_relaxed(v);
	__atomic_acquire_fence();
	return ret;
}
#define atomic64_fetch_dec_acquire atomic64_fetch_dec_acquire
#endif

#ifndef atomic64_fetch_dec_release
static inline s64
atomic64_fetch_dec_release(atomic64_t *v)
{
	__atomic_release_fence();
	return atomic64_fetch_dec_relaxed(v);
}
#define atomic64_fetch_dec_release atomic64_fetch_dec_release
#endif

#ifndef atomic64_fetch_dec
static inline s64
atomic64_fetch_dec(atomic64_t *v)
{
	s64 ret;
	__atomic_pre_full_fence();
	ret = atomic64_fetch_dec_relaxed(v);
	__atomic_post_full_fence();
	return ret;
}
#define atomic64_fetch_dec atomic64_fetch_dec
#endif

#endif /* atomic64_fetch_dec_relaxed */

#ifndef atomic64_fetch_and_relaxed
#define atomic64_fetch_and_acquire atomic64_fetch_and
#define atomic64_fetch_and_release atomic64_fetch_and
#define atomic64_fetch_and_relaxed atomic64_fetch_and
#else /* atomic64_fetch_and_relaxed */

#ifndef atomic64_fetch_and_acquire
static inline s64
atomic64_fetch_and_acquire(s64 i, atomic64_t *v)
{
	s64 ret = atomic64_fetch_and_relaxed(i, v);
	__atomic_acquire_fence();
	return ret;
}
#define atomic64_fetch_and_acquire atomic64_fetch_and_acquire
#endif

#ifndef atomic64_fetch_and_release
static inline s64
atomic64_fetch_and_release(s64 i, atomic64_t *v)
{
	__atomic_release_fence();
	return atomic64_fetch_and_relaxed(i, v);
}
#define atomic64_fetch_and_release atomic64_fetch_and_release
#endif

#ifndef atomic64_fetch_and
static inline s64
atomic64_fetch_and(s64 i, atomic64_t *v)
{
	s64 ret;
	__atomic_pre_full_fence();
	ret = atomic64_fetch_and_relaxed(i, v);
	__atomic_post_full_fence();
	return ret;
}
#define atomic64_fetch_and atomic64_fetch_and
#endif

#endif /* atomic64_fetch_and_relaxed */

#ifndef atomic64_andnot
static inline void
atomic64_andnot(s64 i, atomic64_t *v)
{
	atomic64_and(~i, v);
}
#define atomic64_andnot atomic64_andnot
#endif

#ifndef atomic64_fetch_andnot_relaxed
#ifdef atomic64_fetch_andnot
#define atomic64_fetch_andnot_acquire atomic64_fetch_andnot
#define atomic64_fetch_andnot_release atomic64_fetch_andnot
#define atomic64_fetch_andnot_relaxed atomic64_fetch_andnot
#endif /* atomic64_fetch_andnot */

#ifndef atomic64_fetch_andnot
static inline s64
atomic64_fetch_andnot(s64 i, atomic64_t *v)
{
	return atomic64_fetch_and(~i, v);
}
#define atomic64_fetch_andnot atomic64_fetch_andnot
#endif

#ifndef atomic64_fetch_andnot_acquire
static inline s64
atomic64_fetch_andnot_acquire(s64 i, atomic64_t *v)
{
	return atomic64_fetch_and_acquire(~i, v);
}
#define atomic64_fetch_andnot_acquire atomic64_fetch_andnot_acquire
#endif

#ifndef atomic64_fetch_andnot_release
static inline s64
atomic64_fetch_andnot_release(s64 i, atomic64_t *v)
{
	return atomic64_fetch_and_release(~i, v);
}
#define atomic64_fetch_andnot_release atomic64_fetch_andnot_release
#endif

#ifndef atomic64_fetch_andnot_relaxed
static inline s64
atomic64_fetch_andnot_relaxed(s64 i, atomic64_t *v)
{
	return atomic64_fetch_and_relaxed(~i, v);
}
#define atomic64_fetch_andnot_relaxed atomic64_fetch_andnot_relaxed
#endif

#else /* atomic64_fetch_andnot_relaxed */

#ifndef atomic64_fetch_andnot_acquire
static inline s64
atomic64_fetch_andnot_acquire(s64 i, atomic64_t *v)
{
	s64 ret = atomic64_fetch_andnot_relaxed(i, v);
	__atomic_acquire_fence();
	return ret;
}
#define atomic64_fetch_andnot_acquire atomic64_fetch_andnot_acquire
#endif

#ifndef atomic64_fetch_andnot_release
static inline s64
atomic64_fetch_andnot_release(s64 i, atomic64_t *v)
{
	__atomic_release_fence();
	return atomic64_fetch_andnot_relaxed(i, v);
}
#define atomic64_fetch_andnot_release atomic64_fetch_andnot_release
#endif

#ifndef atomic64_fetch_andnot
static inline s64
atomic64_fetch_andnot(s64 i, atomic64_t *v)
{
	s64 ret;
	__atomic_pre_full_fence();
	ret = atomic64_fetch_andnot_relaxed(i, v);
	__atomic_post_full_fence();
	return ret;
}
#define atomic64_fetch_andnot atomic64_fetch_andnot
#endif

#endif /* atomic64_fetch_andnot_relaxed */

#ifndef atomic64_fetch_or_relaxed
#define atomic64_fetch_or_acquire atomic64_fetch_or
#define atomic64_fetch_or_release atomic64_fetch_or
#define atomic64_fetch_or_relaxed atomic64_fetch_or
#else /* atomic64_fetch_or_relaxed */

#ifndef atomic64_fetch_or_acquire
static inline s64
atomic64_fetch_or_acquire(s64 i, atomic64_t *v)
{
	s64 ret = atomic64_fetch_or_relaxed(i, v);
	__atomic_acquire_fence();
	return ret;
}
#define atomic64_fetch_or_acquire atomic64_fetch_or_acquire
#endif

#ifndef atomic64_fetch_or_release
static inline s64
atomic64_fetch_or_release(s64 i, atomic64_t *v)
{
	__atomic_release_fence();
	return atomic64_fetch_or_relaxed(i, v);
}
#define atomic64_fetch_or_release atomic64_fetch_or_release
#endif

#ifndef atomic64_fetch_or
static inline s64
atomic64_fetch_or(s64 i, atomic64_t *v)
{
	s64 ret;
	__atomic_pre_full_fence();
	ret = atomic64_fetch_or_relaxed(i, v);
	__atomic_post_full_fence();
	return ret;
}
#define atomic64_fetch_or atomic64_fetch_or
#endif

#endif /* atomic64_fetch_or_relaxed */

#ifndef atomic64_fetch_xor_relaxed
#define atomic64_fetch_xor_acquire atomic64_fetch_xor
#define atomic64_fetch_xor_release atomic64_fetch_xor
#define atomic64_fetch_xor_relaxed atomic64_fetch_xor
#else /* atomic64_fetch_xor_relaxed */

#ifndef atomic64_fetch_xor_acquire
static inline s64
atomic64_fetch_xor_acquire(s64 i, atomic64_t *v)
{
	s64 ret = atomic64_fetch_xor_relaxed(i, v);
	__atomic_acquire_fence();
	return ret;
}
#define atomic64_fetch_xor_acquire atomic64_fetch_xor_acquire
#endif

#ifndef atomic64_fetch_xor_release
static inline s64
atomic64_fetch_xor_release(s64 i, atomic64_t *v)
{
	__atomic_release_fence();
	return atomic64_fetch_xor_relaxed(i, v);
}
#define atomic64_fetch_xor_release atomic64_fetch_xor_release
#endif

#ifndef atomic64_fetch_xor
static inline s64
atomic64_fetch_xor(s64 i, atomic64_t *v)
{
	s64 ret;
	__atomic_pre_full_fence();
	ret = atomic64_fetch_xor_relaxed(i, v);
	__atomic_post_full_fence();
	return ret;
}
#define atomic64_fetch_xor atomic64_fetch_xor
#endif

#endif /* atomic64_fetch_xor_relaxed */

#ifndef atomic64_xchg_relaxed
#define atomic64_xchg_acquire atomic64_xchg
#define atomic64_xchg_release atomic64_xchg
#define atomic64_xchg_relaxed atomic64_xchg
#else /* atomic64_xchg_relaxed */

#ifndef atomic64_xchg_acquire
static inline s64
atomic64_xchg_acquire(atomic64_t *v, s64 i)
{
	s64 ret = atomic64_xchg_relaxed(v, i);
	__atomic_acquire_fence();
	return ret;
}
#define atomic64_xchg_acquire atomic64_xchg_acquire
#endif

#ifndef atomic64_xchg_release
static inline s64
atomic64_xchg_release(atomic64_t *v, s64 i)
{
	__atomic_release_fence();
	return atomic64_xchg_relaxed(v, i);
}
#define atomic64_xchg_release atomic64_xchg_release
#endif

#ifndef atomic64_xchg
static inline s64
atomic64_xchg(atomic64_t *v, s64 i)
{
	s64 ret;
	__atomic_pre_full_fence();
	ret = atomic64_xchg_relaxed(v, i);
	__atomic_post_full_fence();
	return ret;
}
#define atomic64_xchg atomic64_xchg
#endif

#endif /* atomic64_xchg_relaxed */

#ifndef atomic64_cmpxchg_relaxed
#define atomic64_cmpxchg_acquire atomic64_cmpxchg
#define atomic64_cmpxchg_release atomic64_cmpxchg
#define atomic64_cmpxchg_relaxed atomic64_cmpxchg
#else /* atomic64_cmpxchg_relaxed */

#ifndef atomic64_cmpxchg_acquire
static inline s64
atomic64_cmpxchg_acquire(atomic64_t *v, s64 old, s64 new)
{
	s64 ret = atomic64_cmpxchg_relaxed(v, old, new);
	__atomic_acquire_fence();
	return ret;
}
#define atomic64_cmpxchg_acquire atomic64_cmpxchg_acquire
#endif

#ifndef atomic64_cmpxchg_release
static inline s64
atomic64_cmpxchg_release(atomic64_t *v, s64 old, s64 new)
{
	__atomic_release_fence();
	return atomic64_cmpxchg_relaxed(v, old, new);
}
#define atomic64_cmpxchg_release atomic64_cmpxchg_release
#endif

#ifndef atomic64_cmpxchg
static inline s64
atomic64_cmpxchg(atomic64_t *v, s64 old, s64 new)
{
	s64 ret;
	__atomic_pre_full_fence();
	ret = atomic64_cmpxchg_relaxed(v, old, new);
	__atomic_post_full_fence();
	return ret;
}
#define atomic64_cmpxchg atomic64_cmpxchg
#endif

#endif /* atomic64_cmpxchg_relaxed */

#ifndef atomic64_try_cmpxchg_relaxed
#ifdef atomic64_try_cmpxchg
#define atomic64_try_cmpxchg_acquire atomic64_try_cmpxchg
#define atomic64_try_cmpxchg_release atomic64_try_cmpxchg
#define atomic64_try_cmpxchg_relaxed atomic64_try_cmpxchg
#endif /* atomic64_try_cmpxchg */

#ifndef atomic64_try_cmpxchg
static inline bool
atomic64_try_cmpxchg(atomic64_t *v, s64 *old, s64 new)
{
	s64 r, o = *old;
	r = atomic64_cmpxchg(v, o, new);
	if (unlikely(r != o))
		*old = r;
	return likely(r == o);
}
#define atomic64_try_cmpxchg atomic64_try_cmpxchg
#endif

#ifndef atomic64_try_cmpxchg_acquire
static inline bool
atomic64_try_cmpxchg_acquire(atomic64_t *v, s64 *old, s64 new)
{
	s64 r, o = *old;
	r = atomic64_cmpxchg_acquire(v, o, new);
	if (unlikely(r != o))
		*old = r;
	return likely(r == o);
}
#define atomic64_try_cmpxchg_acquire atomic64_try_cmpxchg_acquire
#endif

#ifndef atomic64_try_cmpxchg_release
static inline bool
atomic64_try_cmpxchg_release(atomic64_t *v, s64 *old, s64 new)
{
	s64 r, o = *old;
	r = atomic64_cmpxchg_release(v, o, new);
	if (unlikely(r != o))
		*old = r;
	return likely(r == o);
}
#define atomic64_try_cmpxchg_release atomic64_try_cmpxchg_release
#endif

#ifndef atomic64_try_cmpxchg_relaxed
static inline bool
atomic64_try_cmpxchg_relaxed(atomic64_t *v, s64 *old, s64 new)
{
	s64 r, o = *old;
	r = atomic64_cmpxchg_relaxed(v, o, new);
	if (unlikely(r != o))
		*old = r;
	return likely(r == o);
}
#define atomic64_try_cmpxchg_relaxed atomic64_try_cmpxchg_relaxed
#endif

#else /* atomic64_try_cmpxchg_relaxed */

#ifndef atomic64_try_cmpxchg_acquire
static inline bool
atomic64_try_cmpxchg_acquire(atomic64_t *v, s64 *old, s64 new)
{
	bool ret = atomic64_try_cmpxchg_relaxed(v, old, new);
	__atomic_acquire_fence();
	return ret;
}
#define atomic64_try_cmpxchg_acquire atomic64_try_cmpxchg_acquire
#endif

#ifndef atomic64_try_cmpxchg_release
static inline bool
atomic64_try_cmpxchg_release(atomic64_t *v, s64 *old, s64 new)
{
	__atomic_release_fence();
	return atomic64_try_cmpxchg_relaxed(v, old, new);
}
#define atomic64_try_cmpxchg_release atomic64_try_cmpxchg_release
#endif

#ifndef atomic64_try_cmpxchg
static inline bool
atomic64_try_cmpxchg(atomic64_t *v, s64 *old, s64 new)
{
	bool ret;
	__atomic_pre_full_fence();
	ret = atomic64_try_cmpxchg_relaxed(v, old, new);
	__atomic_post_full_fence();
	return ret;
}
#define atomic64_try_cmpxchg atomic64_try_cmpxchg
#endif

#endif /* atomic64_try_cmpxchg_relaxed */

#ifndef atomic64_sub_and_test
/**
 * atomic64_sub_and_test - subtract value from variable and test result
 * @i: integer value to subtract
 * @v: pointer of type atomic64_t
 *
 * Atomically subtracts @i from @v and returns
 * true if the result is zero, or false for all
 * other cases.
 */
static inline bool
atomic64_sub_and_test(s64 i, atomic64_t *v)
{
	return atomic64_sub_return(i, v) == 0;
}
#define atomic64_sub_and_test atomic64_sub_and_test
#endif

#ifndef atomic64_dec_and_test
/**
 * atomic64_dec_and_test - decrement and test
 * @v: pointer of type atomic64_t
 *
 * Atomically decrements @v by 1 and
 * returns true if the result is 0, or false for all other
 * cases.
 */
static inline bool
atomic64_dec_and_test(atomic64_t *v)
{
	return atomic64_dec_return(v) == 0;
}
#define atomic64_dec_and_test atomic64_dec_and_test
#endif

#ifndef atomic64_inc_and_test
/**
 * atomic64_inc_and_test - increment and test
 * @v: pointer of type atomic64_t
 *
 * Atomically increments @v by 1
 * and returns true if the result is zero, or false for all
 * other cases.
 */
static inline bool
atomic64_inc_and_test(atomic64_t *v)
{
	return atomic64_inc_return(v) == 0;
}
#define atomic64_inc_and_test atomic64_inc_and_test
#endif

#ifndef atomic64_add_negative
/**
 * atomic64_add_negative - add and test if negative
 * @i: integer value to add
 * @v: pointer of type atomic64_t
 *
 * Atomically adds @i to @v and returns true
 * if the result is negative, or false when
 * result is greater than or equal to zero.
 */
static inline bool
atomic64_add_negative(s64 i, atomic64_t *v)
{
	return atomic64_add_return(i, v) < 0;
}
#define atomic64_add_negative atomic64_add_negative
#endif

#ifndef atomic64_fetch_add_unless
/**
 * atomic64_fetch_add_unless - add unless the number is already a given value
 * @v: pointer of type atomic64_t
 * @a: the amount to add to v...
 * @u: ...unless v is equal to u.
 *
 * Atomically adds @a to @v, so long as @v was not already @u.
 * Returns original value of @v
 */
static inline s64
atomic64_fetch_add_unless(atomic64_t *v, s64 a, s64 u)
{
	s64 c = atomic64_read(v);

	do {
		if (unlikely(c == u))
			break;
	} while (!atomic64_try_cmpxchg(v, &c, c + a));

	return c;
}
#define atomic64_fetch_add_unless atomic64_fetch_add_unless
#endif

#ifndef atomic64_add_unless
/**
 * atomic64_add_unless - add unless the number is already a given value
 * @v: pointer of type atomic64_t
 * @a: the amount to add to v...
 * @u: ...unless v is equal to u.
 *
 * Atomically adds @a to @v, if @v was not already @u.
 * Returns true if the addition was done.
 */
static inline bool
atomic64_add_unless(atomic64_t *v, s64 a, s64 u)
{
	return atomic64_fetch_add_unless(v, a, u) != u;
}
#define atomic64_add_unless atomic64_add_unless
#endif

#ifndef atomic64_inc_not_zero
/**
 * atomic64_inc_not_zero - increment unless the number is zero
 * @v: pointer of type atomic64_t
 *
 * Atomically increments @v by 1, if @v is non-zero.
 * Returns true if the increment was done.
 */
static inline bool
atomic64_inc_not_zero(atomic64_t *v)
{
	return atomic64_add_unless(v, 1, 0);
}
#define atomic64_inc_not_zero atomic64_inc_not_zero
#endif

#ifndef atomic64_inc_unless_negative
static inline bool
atomic64_inc_unless_negative(atomic64_t *v)
{
	s64 c = atomic64_read(v);

	do {
		if (unlikely(c < 0))
			return false;
	} while (!atomic64_try_cmpxchg(v, &c, c + 1));

	return true;
}
#define atomic64_inc_unless_negative atomic64_inc_unless_negative
#endif

#ifndef atomic64_dec_unless_positive
static inline bool
atomic64_dec_unless_positive(atomic64_t *v)
{
	s64 c = atomic64_read(v);

	do {
		if (unlikely(c > 0))
			return false;
	} while (!atomic64_try_cmpxchg(v, &c, c - 1));

	return true;
}
#define atomic64_dec_unless_positive atomic64_dec_unless_positive
#endif

#ifndef atomic64_dec_if_positive
static inline s64
atomic64_dec_if_positive(atomic64_t *v)
{
	s64 dec, c = atomic64_read(v);

	do {
		dec = c - 1;
		if (unlikely(dec < 0))
			break;
	} while (!atomic64_try_cmpxchg(v, &c, dec));

	return dec;
}
#define atomic64_dec_if_positive atomic64_dec_if_positive
#endif

#define atomic64_cond_read_acquire(v, c) smp_cond_load_acquire(&(v)->counter, (c))
#define atomic64_cond_read_relaxed(v, c) smp_cond_load_relaxed(&(v)->counter, (c))

#endif /* _LINUX_ATOMIC_FALLBACK_H */
// 25de4a2804d70f57e994fe3b419148658bb5378a

Youez - 2016 - github.com/yon3zu
LinuXploit