]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/blame - tools/objtool/sync-check.sh
objtool: Define 'struct orc_entry' only when needed
[mirror_ubuntu-jammy-kernel.git] / tools / objtool / sync-check.sh
CommitLineData
3bd51c5a
JP
1#!/bin/sh
2# SPDX-License-Identifier: GPL-2.0
3
4FILES='
3bd51c5a
JP
5arch/x86/include/asm/inat_types.h
6arch/x86/include/asm/orc_types.h
4d65adfc 7arch/x86/include/asm/emulate_prefix.h
d046b725
JP
8arch/x86/lib/x86-opcode-map.txt
9arch/x86/tools/gen-insn-attr-x86.awk
1e7e4788 10include/linux/static_call_types.h
3bd51c5a
JP
11'
12
2ffd84ae
ACM
13check_2 () {
14 file1=$1
15 file2=$2
3bd51c5a 16
2ffd84ae
ACM
17 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 $*
3bd51c5a
JP
36}
37
38if [ ! -d ../../kernel ] || [ ! -d ../../tools ] || [ ! -d ../objtool ]; then
39 exit 0
40fi
41
2ffd84ae
ACM
42cd ../..
43
3bd51c5a
JP
44for i in $FILES; do
45 check $i
46done
2ffd84ae 47
ae31a514
ACM
48check 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[\">]"'
4d65adfc 51check arch/x86/lib/insn.c '-I "^#include [\"<]\(../include/\)*asm/in\(at\|sn\).h[\">]" -I "^#include [\"<]\(../include/\)*asm/emulate_prefix.h[\">]"'