]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/blame - tools/objtool/sync-check.sh
x86: Remove dynamic NOP selection
[mirror_ubuntu-jammy-kernel.git] / tools / objtool / sync-check.sh
CommitLineData
3bd51c5a
JP
1#!/bin/sh
2# SPDX-License-Identifier: GPL-2.0
3
bb090fdb
JT
4if [ -z "$SRCARCH" ]; then
5 echo 'sync-check.sh: error: missing $SRCARCH environment variable' >&2
6 exit 1
7fi
8
ee819aed
JT
9FILES="include/linux/objtool.h"
10
bb090fdb 11if [ "$SRCARCH" = "x86" ]; then
ee819aed 12FILES="$FILES
3bd51c5a
JP
13arch/x86/include/asm/inat_types.h
14arch/x86/include/asm/orc_types.h
4d65adfc 15arch/x86/include/asm/emulate_prefix.h
d046b725
JP
16arch/x86/lib/x86-opcode-map.txt
17arch/x86/tools/gen-insn-attr-x86.awk
1e7e4788 18include/linux/static_call_types.h
3890b8d9
JT
19arch/x86/include/asm/inat.h -I '^#include [\"<]\(asm/\)*inat_types.h[\">]'
20arch/x86/include/asm/insn.h -I '^#include [\"<]\(asm/\)*inat.h[\">]'
21arch/x86/lib/inat.c -I '^#include [\"<]\(../include/\)*asm/insn.h[\">]'
22arch/x86/lib/insn.c -I '^#include [\"<]\(../include/\)*asm/in\(at\|sn\).h[\">]' -I '^#include [\"<]\(../include/\)*asm/emulate_prefix.h[\">]'
23"
bb090fdb 24fi
3bd51c5a 25
2ffd84ae
ACM
26check_2 () {
27 file1=$1
28 file2=$2
3bd51c5a 29
2ffd84ae
ACM
30 shift
31 shift
32
33 cmd="diff $* $file1 $file2 > /dev/null"
34
35 test -f $file2 && {
36 eval $cmd || {
37 echo "Warning: Kernel ABI header at '$file1' differs from latest version at '$file2'" >&2
38 echo diff -u $file1 $file2
39 }
40 }
41}
42
43check () {
44 file=$1
45
46 shift
47
48 check_2 tools/$file $file $*
3bd51c5a
JP
49}
50
51if [ ! -d ../../kernel ] || [ ! -d ../../tools ] || [ ! -d ../objtool ]; then
52 exit 0
53fi
54
2ffd84ae
ACM
55cd ../..
56
3890b8d9
JT
57while read -r file_entry; do
58 if [ -z "$file_entry" ]; then
59 continue
60 fi
2ffd84ae 61
3890b8d9
JT
62 check $file_entry
63done <<EOF
64$FILES
65EOF