Josh Poimboeuf | 3bd51c5 | 2017-11-06 07:21:51 -0600 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | # SPDX-License-Identifier: GPL-2.0 |
| 3 | |
| 4 | FILES=' |
Josh Poimboeuf | 3bd51c5 | 2017-11-06 07:21:51 -0600 | [diff] [blame] | 5 | arch/x86/include/asm/inat.h |
| 6 | arch/x86/include/asm/inat_types.h |
Josh Poimboeuf | d046b72 | 2019-08-29 17:41:18 -0500 | [diff] [blame] | 7 | arch/x86/include/asm/insn.h |
Josh Poimboeuf | 3bd51c5 | 2017-11-06 07:21:51 -0600 | [diff] [blame] | 8 | arch/x86/include/asm/orc_types.h |
Josh Poimboeuf | d046b72 | 2019-08-29 17:41:18 -0500 | [diff] [blame] | 9 | arch/x86/lib/inat.c |
| 10 | arch/x86/lib/insn.c |
| 11 | arch/x86/lib/x86-opcode-map.txt |
| 12 | arch/x86/tools/gen-insn-attr-x86.awk |
Josh Poimboeuf | 3bd51c5 | 2017-11-06 07:21:51 -0600 | [diff] [blame] | 13 | ' |
| 14 | |
Arnaldo Carvalho de Melo | 2ffd84a | 2019-08-31 17:29:47 -0300 | [diff] [blame^] | 15 | check_2 () { |
| 16 | file1=$1 |
| 17 | file2=$2 |
Josh Poimboeuf | 3bd51c5 | 2017-11-06 07:21:51 -0600 | [diff] [blame] | 18 | |
Arnaldo Carvalho de Melo | 2ffd84a | 2019-08-31 17:29:47 -0300 | [diff] [blame^] | 19 | shift |
| 20 | shift |
| 21 | |
| 22 | cmd="diff $* $file1 $file2 > /dev/null" |
| 23 | |
| 24 | test -f $file2 && { |
| 25 | eval $cmd || { |
| 26 | echo "Warning: Kernel ABI header at '$file1' differs from latest version at '$file2'" >&2 |
| 27 | echo diff -u $file1 $file2 |
| 28 | } |
| 29 | } |
| 30 | } |
| 31 | |
| 32 | check () { |
| 33 | file=$1 |
| 34 | |
| 35 | shift |
| 36 | |
| 37 | check_2 tools/$file $file $* |
Josh Poimboeuf | 3bd51c5 | 2017-11-06 07:21:51 -0600 | [diff] [blame] | 38 | } |
| 39 | |
| 40 | if [ ! -d ../../kernel ] || [ ! -d ../../tools ] || [ ! -d ../objtool ]; then |
| 41 | exit 0 |
| 42 | fi |
| 43 | |
Arnaldo Carvalho de Melo | 2ffd84a | 2019-08-31 17:29:47 -0300 | [diff] [blame^] | 44 | cd ../.. |
| 45 | |
Josh Poimboeuf | 3bd51c5 | 2017-11-06 07:21:51 -0600 | [diff] [blame] | 46 | for i in $FILES; do |
| 47 | check $i |
| 48 | done |
Arnaldo Carvalho de Melo | 2ffd84a | 2019-08-31 17:29:47 -0300 | [diff] [blame^] | 49 | |
| 50 | cd - |