2017-11-06 06:21:51 -07:00
|
|
|
#!/bin/sh
|
|
|
|
# SPDX-License-Identifier: GPL-2.0
|
|
|
|
|
2020-09-04 08:30:20 -07:00
|
|
|
if [ -z "$SRCARCH" ]; then
|
|
|
|
echo 'sync-check.sh: error: missing $SRCARCH environment variable' >&2
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2023-03-01 08:13:07 -07:00
|
|
|
FILES="include/linux/objtool_types.h"
|
2020-09-04 08:30:27 -07:00
|
|
|
|
2020-09-04 08:30:20 -07:00
|
|
|
if [ "$SRCARCH" = "x86" ]; then
|
2020-09-04 08:30:27 -07:00
|
|
|
FILES="$FILES
|
2021-03-12 04:32:55 -07:00
|
|
|
arch/x86/include/asm/nops.h
|
2017-11-06 06:21:51 -07:00
|
|
|
arch/x86/include/asm/inat_types.h
|
|
|
|
arch/x86/include/asm/orc_types.h
|
2019-09-06 06:14:10 -07:00
|
|
|
arch/x86/include/asm/emulate_prefix.h
|
2019-08-29 15:41:18 -07:00
|
|
|
arch/x86/lib/x86-opcode-map.txt
|
|
|
|
arch/x86/tools/gen-insn-attr-x86.awk
|
2020-08-18 06:57:45 -07:00
|
|
|
include/linux/static_call_types.h
|
2020-09-04 08:30:19 -07:00
|
|
|
"
|
2021-02-22 05:34:40 -07:00
|
|
|
|
|
|
|
SYNC_CHECK_FILES='
|
|
|
|
arch/x86/include/asm/inat.h
|
|
|
|
arch/x86/include/asm/insn.h
|
|
|
|
arch/x86/lib/inat.c
|
|
|
|
arch/x86/lib/insn.c
|
|
|
|
'
|
2020-09-04 08:30:20 -07:00
|
|
|
fi
|
2017-11-06 06:21:51 -07:00
|
|
|
|
2019-08-31 13:29:47 -07:00
|
|
|
check_2 () {
|
|
|
|
file1=$1
|
|
|
|
file2=$2
|
2017-11-06 06:21:51 -07:00
|
|
|
|
2019-08-31 13:29:47 -07:00
|
|
|
shift
|
|
|
|
shift
|
|
|
|
|
|
|
|
cmd="diff $* $file1 $file2 > /dev/null"
|
|
|
|
|
|
|
|
test -f $file2 && {
|
|
|
|
eval $cmd || {
|
|
|
|
echo "Warning: Kernel ABI header at '$file1' differs from latest version at '$file2'" >&2
|
|
|
|
echo diff -u $file1 $file2
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
check () {
|
|
|
|
file=$1
|
|
|
|
|
|
|
|
shift
|
|
|
|
|
|
|
|
check_2 tools/$file $file $*
|
2017-11-06 06:21:51 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
if [ ! -d ../../kernel ] || [ ! -d ../../tools ] || [ ! -d ../objtool ]; then
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
2019-08-31 13:29:47 -07:00
|
|
|
cd ../..
|
|
|
|
|
2020-09-04 08:30:19 -07:00
|
|
|
while read -r file_entry; do
|
|
|
|
if [ -z "$file_entry" ]; then
|
|
|
|
continue
|
|
|
|
fi
|
2019-08-31 13:29:47 -07:00
|
|
|
|
2020-09-04 08:30:19 -07:00
|
|
|
check $file_entry
|
|
|
|
done <<EOF
|
|
|
|
$FILES
|
|
|
|
EOF
|
2021-02-22 05:34:40 -07:00
|
|
|
|
|
|
|
if [ "$SRCARCH" = "x86" ]; then
|
|
|
|
for i in $SYNC_CHECK_FILES; do
|
|
|
|
check $i '-I "^.*\/\*.*__ignore_sync_check__.*\*\/.*$"'
|
|
|
|
done
|
|
|
|
fi
|