^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) cat <<EOF
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) static __always_inline bool
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) ${arch}${atomic}_try_cmpxchg${order}(${atomic}_t *v, ${int} *old, ${int} new)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) ${int} r, o = *old;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) r = ${arch}${atomic}_cmpxchg${order}(v, o, new);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) if (unlikely(r != o))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) *old = r;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) return likely(r == o);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) EOF