locking/atomics: Don't assume that scripts are executable
[sfrench/cifs-2.6.git] / scripts / atomic / gen-atomics.sh
1 #!/bin/sh
2 # SPDX-License-Identifier: GPL-2.0
3 #
4 # Generate atomic headers
5
6 ATOMICDIR=$(dirname $0)
7 ATOMICTBL=${ATOMICDIR}/atomics.tbl
8 LINUXDIR=${ATOMICDIR}/../..
9
10 cat <<EOF |
11 gen-atomic-instrumented.sh      asm-generic/atomic-instrumented.h
12 gen-atomic-long.sh              asm-generic/atomic-long.h
13 gen-atomic-fallback.sh          linux/atomic-fallback.h
14 EOF
15 while read script header; do
16         /bin/sh ${ATOMICDIR}/${script} ${ATOMICTBL} > ${LINUXDIR}/include/${header}
17         HASH="$(sha1sum ${LINUXDIR}/include/${header})"
18         HASH="${HASH%% *}"
19         printf "// %s\n" "${HASH}" >> ${LINUXDIR}/include/${header}
20 done