diff options
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/atomic/check-atomics.sh | 1 | ||||
-rwxr-xr-x | scripts/atomic/gen-atomic-instrumented.sh | 51 | ||||
-rwxr-xr-x | scripts/atomic/gen-atomics.sh | 1 |
3 files changed, 2 insertions, 51 deletions
diff --git a/scripts/atomic/check-atomics.sh b/scripts/atomic/check-atomics.sh index 82748d42ecc5..9c7fbd4bcbce 100755 --- a/scripts/atomic/check-atomics.sh +++ b/scripts/atomic/check-atomics.sh @@ -17,7 +17,6 @@ cat <<EOF | asm-generic/atomic-instrumented.h asm-generic/atomic-long.h linux/atomic-arch-fallback.h -linux/atomic-fallback.h EOF while read header; do OLDSUM="$(tail -n 1 ${LINUXDIR}/include/${header})" diff --git a/scripts/atomic/gen-atomic-instrumented.sh b/scripts/atomic/gen-atomic-instrumented.sh index 5766ffcec7c5..b0c45aee19d7 100755 --- a/scripts/atomic/gen-atomic-instrumented.sh +++ b/scripts/atomic/gen-atomic-instrumented.sh @@ -41,34 +41,6 @@ gen_params_checks() done } -# gen_guard(meta, atomic, pfx, name, sfx, order) -gen_guard() -{ - local meta="$1"; shift - local atomic="$1"; shift - local pfx="$1"; shift - local name="$1"; shift - local sfx="$1"; shift - local order="$1"; shift - - local atomicname="arch_${atomic}_${pfx}${name}${sfx}${order}" - - local template="$(find_fallback_template "${pfx}" "${name}" "${sfx}" "${order}")" - - # We definitely need a preprocessor symbol for this atomic if it is an - # ordering variant, or if there's a generic fallback. - if [ ! -z "${order}" ] || [ ! -z "${template}" ]; then - printf "defined(${atomicname})" - return - fi - - # If this is a base variant, but a relaxed variant *may* exist, then we - # only have a preprocessor symbol if the relaxed variant isn't defined - if meta_has_relaxed "${meta}"; then - printf "!defined(${atomicname}_relaxed) || defined(${atomicname})" - fi -} - #gen_proto_order_variant(meta, pfx, name, sfx, order, atomic, int, arg...) gen_proto_order_variant() { @@ -82,16 +54,12 @@ gen_proto_order_variant() local atomicname="${atomic}_${pfx}${name}${sfx}${order}" - local guard="$(gen_guard "${meta}" "${atomic}" "${pfx}" "${name}" "${sfx}" "${order}")" - local ret="$(gen_ret_type "${meta}" "${int}")" local params="$(gen_params "${int}" "${atomic}" "$@")" local checks="$(gen_params_checks "${meta}" "$@")" local args="$(gen_args "$@")" local retstmt="$(gen_ret_stmt "${meta}")" - [ ! -z "${guard}" ] && printf "#if ${guard}\n" - cat <<EOF static __always_inline ${ret} ${atomicname}(${params}) @@ -99,11 +67,8 @@ ${atomicname}(${params}) ${checks} ${retstmt}arch_${atomicname}(${args}); } -#define ${atomicname} ${atomicname} EOF - [ ! -z "${guard}" ] && printf "#endif\n" - printf "\n" } @@ -139,19 +104,6 @@ EOF fi } -gen_optional_xchg() -{ - local name="$1"; shift - local sfx="$1"; shift - local guard="defined(arch_${name}${sfx})" - - [ -z "${sfx}" ] && guard="!defined(arch_${name}_relaxed) || defined(arch_${name})" - - printf "#if ${guard}\n" - gen_xchg "${name}${sfx}" "" - printf "#endif\n\n" -} - cat << EOF // SPDX-License-Identifier: GPL-2.0 @@ -188,7 +140,8 @@ done for xchg in "xchg" "cmpxchg" "cmpxchg64" "try_cmpxchg"; do for order in "" "_acquire" "_release" "_relaxed"; do - gen_optional_xchg "${xchg}" "${order}" + gen_xchg "${xchg}${order}" "" + printf "\n" done done diff --git a/scripts/atomic/gen-atomics.sh b/scripts/atomic/gen-atomics.sh index d29e159ef489..f776a574224d 100755 --- a/scripts/atomic/gen-atomics.sh +++ b/scripts/atomic/gen-atomics.sh @@ -11,7 +11,6 @@ cat <<EOF | gen-atomic-instrumented.sh asm-generic/atomic-instrumented.h gen-atomic-long.sh asm-generic/atomic-long.h gen-atomic-fallback.sh linux/atomic-arch-fallback.h arch_ -gen-atomic-fallback.sh linux/atomic-fallback.h EOF while read script header args; do /bin/sh ${ATOMICDIR}/${script} ${ATOMICTBL} ${args} > ${LINUXDIR}/include/${header} |