2018-09-04 18:48:29 +08:00
|
|
|
#!/bin/sh
|
|
|
|
# SPDX-License-Identifier: GPL-2.0
|
|
|
|
#
|
|
|
|
# Check if atomic headers are up-to-date
|
|
|
|
|
|
|
|
ATOMICDIR=$(dirname $0)
|
|
|
|
ATOMICTBL=${ATOMICDIR}/atomics.tbl
|
|
|
|
LINUXDIR=${ATOMICDIR}/../..
|
|
|
|
|
2019-02-11 21:20:35 +08:00
|
|
|
echo '' | sha1sum - > /dev/null 2>&1
|
|
|
|
if [ $? -ne 0 ]; then
|
|
|
|
printf "sha1sum not available, skipping atomic header checks.\n"
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
2018-09-04 18:48:29 +08:00
|
|
|
cat <<EOF |
|
2019-02-11 21:20:35 +08:00
|
|
|
asm-generic/atomic-instrumented.h
|
|
|
|
asm-generic/atomic-long.h
|
2020-10-02 04:20:28 +08:00
|
|
|
linux/atomic-arch-fallback.h
|
2019-02-11 21:20:35 +08:00
|
|
|
linux/atomic-fallback.h
|
2018-09-04 18:48:29 +08:00
|
|
|
EOF
|
2019-02-11 21:20:35 +08:00
|
|
|
while read header; do
|
|
|
|
OLDSUM="$(tail -n 1 ${LINUXDIR}/include/${header})"
|
|
|
|
OLDSUM="${OLDSUM#// }"
|
|
|
|
|
2019-06-18 13:33:06 +08:00
|
|
|
NEWSUM="$(sed '$d' ${LINUXDIR}/include/${header} | sha1sum)"
|
2019-02-11 21:20:35 +08:00
|
|
|
NEWSUM="${NEWSUM%% *}"
|
|
|
|
|
|
|
|
if [ "${OLDSUM}" != "${NEWSUM}" ]; then
|
|
|
|
printf "warning: generated include/${header} has been modified.\n"
|
2018-09-04 18:48:29 +08:00
|
|
|
fi
|
|
|
|
done
|
2019-02-11 21:20:35 +08:00
|
|
|
|
|
|
|
exit 0
|