2 # SPDX-License-Identifier: GPL-2.0
4 ATOMICDIR=$(dirname $0)
6 . ${ATOMICDIR}/atomic-tbl.sh
8 #gen_cast(arg, int, atomic)
13 local atomic="$1"; shift
15 [ "${arg%%:*}" = "p" ] || return
17 printf "($(gen_param_type "${arg}" "${int}" "${atomic}"))"
20 #gen_args_cast(int, atomic, arg...)
24 local atomic="$1"; shift
26 while [ "$#" -gt 0 ]; do
27 local cast="$(gen_cast "$1" "${int}" "${atomic}")"
28 local arg="$(gen_param_name "$1")"
29 printf "${cast}${arg}"
30 [ "$#" -gt 1 ] && printf ", "
35 #gen_proto_order_variant(meta, pfx, name, sfx, order, atomic, int, arg...)
36 gen_proto_order_variant()
38 local meta="$1"; shift
39 local name="$1$2$3$4"; shift; shift; shift; shift
40 local atomic="$1"; shift
43 local ret="$(gen_ret_type "${meta}" "long")"
44 local params="$(gen_params "long" "atomic_long" "$@")"
45 local argscast="$(gen_args_cast "${int}" "${atomic}" "$@")"
46 local retstmt="$(gen_ret_stmt "${meta}")"
50 atomic_long_${name}(${params})
52 ${retstmt}${atomic}_${name}(${argscast});
59 // SPDX-License-Identifier: GPL-2.0
62 // DO NOT MODIFY THIS FILE DIRECTLY
64 #ifndef _ASM_GENERIC_ATOMIC_LONG_H
65 #define _ASM_GENERIC_ATOMIC_LONG_H
67 #include <asm/types.h>
70 typedef atomic64_t atomic_long_t;
71 #define ATOMIC_LONG_INIT(i) ATOMIC64_INIT(i)
72 #define atomic_long_cond_read_acquire atomic64_cond_read_acquire
73 #define atomic_long_cond_read_relaxed atomic64_cond_read_relaxed
75 typedef atomic_t atomic_long_t;
76 #define ATOMIC_LONG_INIT(i) ATOMIC_INIT(i)
77 #define atomic_long_cond_read_acquire atomic_cond_read_acquire
78 #define atomic_long_cond_read_relaxed atomic_cond_read_relaxed
85 grep '^[a-z]' "$1" | while read name meta args; do
86 gen_proto "${meta}" "${name}" "atomic64" "s64" ${args}
90 #else /* CONFIG_64BIT */
94 grep '^[a-z]' "$1" | while read name meta args; do
95 gen_proto "${meta}" "${name}" "atomic" "int" ${args}
99 #endif /* CONFIG_64BIT */
100 #endif /* _ASM_GENERIC_ATOMIC_LONG_H */