diff options
Diffstat (limited to 'scripts/atomic/gen-atomic-raw.sh')
-rw-r--r-- | scripts/atomic/gen-atomic-raw.sh | 80 |
1 files changed, 0 insertions, 80 deletions
diff --git a/scripts/atomic/gen-atomic-raw.sh b/scripts/atomic/gen-atomic-raw.sh deleted file mode 100644 index c7e3c52b4927..000000000000 --- a/scripts/atomic/gen-atomic-raw.sh +++ /dev/null @@ -1,80 +0,0 @@ -#!/bin/sh -# SPDX-License-Identifier: GPL-2.0 - -ATOMICDIR=$(dirname $0) - -. ${ATOMICDIR}/atomic-tbl.sh - -#gen_proto_order_variant(meta, pfx, name, sfx, order, atomic, int, arg...) -gen_proto_order_variant() -{ - local meta="$1"; shift - local pfx="$1"; shift - local name="$1"; shift - local sfx="$1"; shift - local order="$1"; shift - local atomic="$1"; shift - local int="$1"; shift - - local atomicname="${atomic}_${pfx}${name}${sfx}${order}" - - local ret="$(gen_ret_type "${meta}" "${int}")" - local params="$(gen_params "${int}" "${atomic}" "$@")" - local args="$(gen_args "$@")" - local retstmt="$(gen_ret_stmt "${meta}")" - -cat <<EOF -static __always_inline ${ret} -raw_${atomicname}(${params}) -{ - ${retstmt}arch_${atomicname}(${args}); -} - -EOF -} - -gen_xchg() -{ - local xchg="$1"; shift - local order="$1"; shift - -cat <<EOF -#define raw_${xchg}${order}(...) \\ - arch_${xchg}${order}(__VA_ARGS__) -EOF -} - -cat << EOF -// SPDX-License-Identifier: GPL-2.0 - -// Generated by $0 -// DO NOT MODIFY THIS FILE DIRECTLY - -#ifndef _LINUX_ATOMIC_RAW_H -#define _LINUX_ATOMIC_RAW_H - -EOF - -grep '^[a-z]' "$1" | while read name meta args; do - gen_proto "${meta}" "${name}" "atomic" "int" ${args} -done - -grep '^[a-z]' "$1" | while read name meta args; do - gen_proto "${meta}" "${name}" "atomic64" "s64" ${args} -done - -for xchg in "xchg" "cmpxchg" "cmpxchg64" "cmpxchg128" "try_cmpxchg" "try_cmpxchg64" "try_cmpxchg128"; do - for order in "" "_acquire" "_release" "_relaxed"; do - gen_xchg "${xchg}" "${order}" - printf "\n" - done -done - -for xchg in "cmpxchg_local" "cmpxchg64_local" "cmpxchg128_local" "sync_cmpxchg" "try_cmpxchg_local" "try_cmpxchg64_local" "try_cmpxchg128_local"; do - gen_xchg "${xchg}" "" - printf "\n" -done - -cat <<EOF -#endif /* _LINUX_ATOMIC_RAW_H */ -EOF |