76 lines · bash
1#!/bin/sh2# SPDX-License-Identifier: GPL-2.03 4if [ -z "$SRCARCH" ]; then5 echo 'sync-check.sh: error: missing $SRCARCH environment variable' >&26 exit 17fi8 9FILES="include/linux/objtool_types.h"10 11if [ "$SRCARCH" = "x86" ]; then12FILES="$FILES13arch/x86/include/asm/nops.h14arch/x86/include/asm/inat_types.h15arch/x86/include/asm/orc_types.h16arch/x86/include/asm/emulate_prefix.h17arch/x86/lib/x86-opcode-map.txt18arch/x86/tools/gen-insn-attr-x86.awk19include/linux/static_call_types.h20"21 22SYNC_CHECK_FILES='23arch/x86/include/asm/inat.h24arch/x86/include/asm/insn.h25arch/x86/lib/inat.c26arch/x86/lib/insn.c27'28fi29 30check_2 () {31 file1=$132 file2=$233 34 shift35 shift36 37 cmd="diff $* $file1 $file2 > /dev/null"38 39 test -f $file2 && {40 eval $cmd || {41 echo "Warning: Kernel ABI header at '$file1' differs from latest version at '$file2'" >&242 echo diff -u $file1 $file243 }44 }45}46 47check () {48 file=$149 50 shift51 52 check_2 tools/$file $file $*53}54 55if [ ! -d ../../kernel ] || [ ! -d ../../tools ] || [ ! -d ../objtool ]; then56 exit 057fi58 59cd ../..60 61while read -r file_entry; do62 if [ -z "$file_entry" ]; then63 continue64 fi65 66 check $file_entry67done <<EOF68$FILES69EOF70 71if [ "$SRCARCH" = "x86" ]; then72 for i in $SYNC_CHECK_FILES; do73 check $i '-I "^.*\/\*.*__ignore_sync_check__.*\*\/.*$"'74 done75fi76