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