2019-02-11 21:20:35 +08:00
|
|
|
#!/bin/sh
|
|
|
|
# SPDX-License-Identifier: GPL-2.0
|
|
|
|
#
|
|
|
|
# Generate atomic headers
|
|
|
|
|
|
|
|
ATOMICDIR=$(dirname $0)
|
|
|
|
ATOMICTBL=${ATOMICDIR}/atomics.tbl
|
|
|
|
LINUXDIR=${ATOMICDIR}/../..
|
|
|
|
|
|
|
|
cat <<EOF |
|
2021-07-13 18:52:51 +08:00
|
|
|
gen-atomic-instrumented.sh linux/atomic/atomic-instrumented.h
|
|
|
|
gen-atomic-long.sh linux/atomic/atomic-long.h
|
|
|
|
gen-atomic-fallback.sh linux/atomic/atomic-arch-fallback.h
|
2019-02-11 21:20:35 +08:00
|
|
|
EOF
|
2020-01-25 05:13:03 +08:00
|
|
|
while read script header args; do
|
|
|
|
/bin/sh ${ATOMICDIR}/${script} ${ATOMICTBL} ${args} > ${LINUXDIR}/include/${header}
|
2019-02-11 21:20:35 +08:00
|
|
|
HASH="$(sha1sum ${LINUXDIR}/include/${header})"
|
|
|
|
HASH="${HASH%% *}"
|
|
|
|
printf "// %s\n" "${HASH}" >> ${LINUXDIR}/include/${header}
|
|
|
|
done
|