blob: 2a1261bfbb625302d81a8fa2e26efb1cb91ffd9d [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 Poimboeuf3bd51c52017-11-06 07:21:51 -060010'
11
Arnaldo Carvalho de Melo2ffd84a2019-08-31 17:29:47 -030012check_2 () {
13 file1=$1
14 file2=$2
Josh Poimboeuf3bd51c52017-11-06 07:21:51 -060015
Arnaldo Carvalho de Melo2ffd84a2019-08-31 17:29:47 -030016 shift
17 shift
18
19 cmd="diff $* $file1 $file2 > /dev/null"
20
21 test -f $file2 && {
22 eval $cmd || {
23 echo "Warning: Kernel ABI header at '$file1' differs from latest version at '$file2'" >&2
24 echo diff -u $file1 $file2
25 }
26 }
27}
28
29check () {
30 file=$1
31
32 shift
33
34 check_2 tools/$file $file $*
Josh Poimboeuf3bd51c52017-11-06 07:21:51 -060035}
36
37if [ ! -d ../../kernel ] || [ ! -d ../../tools ] || [ ! -d ../objtool ]; then
38 exit 0
39fi
40
Arnaldo Carvalho de Melo2ffd84a2019-08-31 17:29:47 -030041cd ../..
42
Josh Poimboeuf3bd51c52017-11-06 07:21:51 -060043for i in $FILES; do
44 check $i
45done
Arnaldo Carvalho de Melo2ffd84a2019-08-31 17:29:47 -030046
Arnaldo Carvalho de Meloae31a512019-08-31 17:35:53 -030047check arch/x86/include/asm/inat.h '-I "^#include [\"<]\(asm/\)*inat_types.h[\">]"'
48check arch/x86/include/asm/insn.h '-I "^#include [\"<]\(asm/\)*inat.h[\">]"'
49check arch/x86/lib/inat.c '-I "^#include [\"<]\(../include/\)*asm/insn.h[\">]"'
Masami Hiramatsu4d65adf2019-09-06 22:14:10 +090050check arch/x86/lib/insn.c '-I "^#include [\"<]\(../include/\)*asm/in\(at\|sn\).h[\">]" -I "^#include [\"<]\(../include/\)*asm/emulate_prefix.h[\">]"'