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