blob: aa099b21dffa6ee024595b66ff021f9102bb0c16 [file] [log] [blame]
Josh Poimboeuf3bd51c52017-11-06 07:21:51 -06001#!/bin/sh
2# SPDX-License-Identifier: GPL-2.0
3
4FILES='
Josh Poimboeuf3bd51c52017-11-06 07:21:51 -06005arch/x86/include/asm/inat_types.h
6arch/x86/include/asm/orc_types.h
Masami Hiramatsu4d65adf2019-09-06 22:14:10 +09007arch/x86/include/asm/emulate_prefix.h
Josh Poimboeufd046b722019-08-29 17:41:18 -05008arch/x86/lib/x86-opcode-map.txt
9arch/x86/tools/gen-insn-attr-x86.awk
Josh Poimboeuf1e7e4782020-08-18 15:57:45 +020010include/linux/static_call_types.h
Josh Poimboeuf3bd51c52017-11-06 07:21:51 -060011'
12
Arnaldo Carvalho de Melo2ffd84a2019-08-31 17:29:47 -030013check_2 () {
14 file1=$1
15 file2=$2
Josh Poimboeuf3bd51c52017-11-06 07:21:51 -060016
Arnaldo Carvalho de Melo2ffd84a2019-08-31 17:29:47 -030017 shift
18 shift
19
20 cmd="diff $* $file1 $file2 > /dev/null"
21
22 test -f $file2 && {
23 eval $cmd || {
24 echo "Warning: Kernel ABI header at '$file1' differs from latest version at '$file2'" >&2
25 echo diff -u $file1 $file2
26 }
27 }
28}
29
30check () {
31 file=$1
32
33 shift
34
35 check_2 tools/$file $file $*
Josh Poimboeuf3bd51c52017-11-06 07:21:51 -060036}
37
38if [ ! -d ../../kernel ] || [ ! -d ../../tools ] || [ ! -d ../objtool ]; then
39 exit 0
40fi
41
Arnaldo Carvalho de Melo2ffd84a2019-08-31 17:29:47 -030042cd ../..
43
Josh Poimboeuf3bd51c52017-11-06 07:21:51 -060044for i in $FILES; do
45 check $i
46done
Arnaldo Carvalho de Melo2ffd84a2019-08-31 17:29:47 -030047
Arnaldo Carvalho de Meloae31a512019-08-31 17:35:53 -030048check arch/x86/include/asm/inat.h '-I "^#include [\"<]\(asm/\)*inat_types.h[\">]"'
49check arch/x86/include/asm/insn.h '-I "^#include [\"<]\(asm/\)*inat.h[\">]"'
50check arch/x86/lib/inat.c '-I "^#include [\"<]\(../include/\)*asm/insn.h[\">]"'
Masami Hiramatsu4d65adf2019-09-06 22:14:10 +090051check arch/x86/lib/insn.c '-I "^#include [\"<]\(../include/\)*asm/in\(at\|sn\).h[\">]" -I "^#include [\"<]\(../include/\)*asm/emulate_prefix.h[\">]"'