Most architectures define the atomic/atomic64 xchg and cmpxchg operations in terms of arch_xchg and arch_cmpxchg respectfully. Add fallbacks for these cases and remove the trivial cases from arch code. On some architectures the existing definitions are kept as these are used to build other arch_atomic*() operations.
Showing the changes to scripts (2 of 23 files). Show all
Unified · Split
| @@ -0,0 +1,7 @@ | ||
| 1 | +cat <<EOF | |
| 2 | +static __always_inline ${int} | |
| 3 | +arch_${atomic}_cmpxchg${order}(${atomic}_t *v, ${int} old, ${int} new) | |
| 4 | +{ | |
| 5 | + return arch_cmpxchg${order}(&v->counter, old, new); | |
| 6 | +} | |
| 7 | +EOF | |
| @@ -0,0 +1,7 @@ | ||
| 1 | +cat <<EOF | |
| 2 | +static __always_inline ${int} | |
| 3 | +arch_${atomic}_xchg${order}(${atomic}_t *v, ${int} new) | |
| 4 | +{ | |
| 5 | + return arch_xchg${order}(&v->counter, new); | |
| 6 | +} | |
| 7 | +EOF | |