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