]> asedeno.scripts.mit.edu Git - linux.git/blob - tools/objtool/sync-check.sh
Merge tag 'for-linus-20191115' of git://git.kernel.dk/linux-block
[linux.git] / tools / objtool / sync-check.sh
1 #!/bin/sh
2 # SPDX-License-Identifier: GPL-2.0
3
4 FILES='
5 arch/x86/include/asm/inat_types.h
6 arch/x86/include/asm/orc_types.h
7 arch/x86/lib/x86-opcode-map.txt
8 arch/x86/tools/gen-insn-attr-x86.awk
9 '
10
11 check_2 () {
12   file1=$1
13   file2=$2
14
15   shift
16   shift
17
18   cmd="diff $* $file1 $file2 > /dev/null"
19
20   test -f $file2 && {
21     eval $cmd || {
22       echo "Warning: Kernel ABI header at '$file1' differs from latest version at '$file2'" >&2
23       echo diff -u $file1 $file2
24     }
25   }
26 }
27
28 check () {
29   file=$1
30
31   shift
32
33   check_2 tools/$file $file $*
34 }
35
36 if [ ! -d ../../kernel ] || [ ! -d ../../tools ] || [ ! -d ../objtool ]; then
37         exit 0
38 fi
39
40 cd ../..
41
42 for i in $FILES; do
43   check $i
44 done
45
46 check arch/x86/include/asm/inat.h     '-I "^#include [\"<]\(asm/\)*inat_types.h[\">]"'
47 check arch/x86/include/asm/insn.h     '-I "^#include [\"<]\(asm/\)*inat.h[\">]"'
48 check arch/x86/lib/inat.c             '-I "^#include [\"<]\(../include/\)*asm/insn.h[\">]"'
49 check arch/x86/lib/insn.c             '-I "^#include [\"<]\(../include/\)*asm/in\(at\|sn\).h[\">]"'
50
51 cd -