mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-28 11:18:45 +07:00
12 lines
231 B
Plaintext
12 lines
231 B
Plaintext
|
cat <<EOF
|
||
|
static inline bool
|
||
|
${atomic}_try_cmpxchg${order}(${atomic}_t *v, ${int} *old, ${int} new)
|
||
|
{
|
||
|
${int} r, o = *old;
|
||
|
r = ${atomic}_cmpxchg${order}(v, o, new);
|
||
|
if (unlikely(r != o))
|
||
|
*old = r;
|
||
|
return likely(r == o);
|
||
|
}
|
||
|
EOF
|