diff options
Diffstat (limited to 'scripts/atomic/fallbacks/try_cmpxchg')
-rwxr-xr-x | scripts/atomic/fallbacks/try_cmpxchg | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/scripts/atomic/fallbacks/try_cmpxchg b/scripts/atomic/fallbacks/try_cmpxchg new file mode 100755 index 0000000000..d4da82092b --- /dev/null +++ b/scripts/atomic/fallbacks/try_cmpxchg @@ -0,0 +1,7 @@ +cat <<EOF + ${int} r, o = *old; + r = raw_${atomic}_cmpxchg${order}(v, o, new); + if (unlikely(r != o)) + *old = r; + return likely(r == o); +EOF |