Gitiles
Code Review
Sign In
review.shift-gmbh.com
/
SHIFTPHONES
/
mainline
/
linux
/
e89d3a46710908c3973397849e758f6ca42db77d
/
.
/
scripts
/
atomic
/
fallbacks
/
try_cmpxchg
blob: 890f850ede378512c89a50a7c79e4358051abd15 [
file
] [
log
] [
blame
]
cat
<<
EOF
static
__always_inline
bool
arch_$
{
atomic
}
_try_cmpxchg$
{
order
}(
$
{
atomic
}
_t
*
v
,
$
{
int
}
*
old
,
$
{
int
}
new
)
{
$
{
int
}
r
,
o
=
*
old
;
r
=
arch_$
{
atomic
}
_cmpxchg$
{
order
}(
v
,
o
,
new
);
if
(
unlikely
(
r
!=
o
))
*
old
=
r
;
return
likely
(
r
==
o
);
}
EOF