Now that all architectures provide arch_{atomic,atomic64}_*(), we can build arch_atomic_long_*() atop these, which can be safely used in noinstr code. The regular atomic_long_*() wrappers are built atop these, as we do for {atomic,atomic64}_*() atop arch_{atomic,atomic64}_*(). We don't provide arch_* versions of the cond_read*() variants, as we don't have arch_* versions of the underlying atomic/atomic64 functions (nor the smp_cond_load*() helpers these are typically based on). Note that the headers in this patch under include/linux/atomic/ are generated by the scripts in scripts/atomic/.
Showing the changes to scripts (2 of 5 files). Show all
Unified · Split
| @@ -138,6 +138,11 @@ grep '^[a-z]' "$1" | while read name meta args; do · 137 unmodified lines | |||
| 138 | gen_proto "${meta}" "${name}" "atomic64" "s64" ${args} | 138 | gen_proto "${meta}" "${name}" "atomic64" "s64" ${args} |
| 139 | done | 139 | done |
| 140 | 140 | ||
| 141 | grep '^[a-z]' "$1" | while read name meta args; do | ||
| 142 | gen_proto "${meta}" "${name}" "atomic_long" "long" ${args} | ||
| 143 | done | ||
| 144 | |||
| 145 | |||
| 141 | for xchg in "xchg" "cmpxchg" "cmpxchg64" "try_cmpxchg"; do | 146 | for xchg in "xchg" "cmpxchg" "cmpxchg64" "try_cmpxchg"; do |
| 142 | for order in "" "_acquire" "_release" "_relaxed"; do | 147 | for order in "" "_acquire" "_release" "_relaxed"; do |
| 143 | gen_xchg "${xchg}${order}" "" | 148 | gen_xchg "${xchg}${order}" "" |
| @@ -47,9 +47,9 @@ gen_proto_order_variant() · 46 unmodified lines | |||
| 47 | 47 | ||
| 48 | cat <<EOF | 48 | cat <<EOF |
| 49 | static __always_inline ${ret} | 49 | static __always_inline ${ret} |
| 50 | atomic_long_${name}(${params}) | 50 | arch_atomic_long_${name}(${params}) |
| 51 | { | 51 | { |
| 52 | ${retstmt}${atomic}_${name}(${argscast}); | 52 | ${retstmt}arch_${atomic}_${name}(${argscast}); |
| 53 | } | 53 | } |
| 54 | 54 | ||
| 55 | EOF | 55 | EOF |