blob: df1dbee8d98db028e0bcf6025a8c440f265f7a67 [file] [log] [blame]
rjw1f884582022-01-06 17:20:42 +08001#!/bin/sh
2# SPDX-License-Identifier: GPL-2.0
3
4HEADERS='
5include/uapi/drm/drm.h
6include/uapi/drm/i915_drm.h
7include/uapi/linux/fcntl.h
8include/uapi/linux/kvm.h
9include/uapi/linux/perf_event.h
10include/uapi/linux/sched.h
11include/uapi/linux/stat.h
12include/uapi/linux/vhost.h
13include/uapi/sound/asound.h
14include/linux/bits.h
15include/linux/hash.h
16include/uapi/linux/hw_breakpoint.h
17arch/x86/include/asm/disabled-features.h
18arch/x86/include/asm/required-features.h
19arch/x86/include/asm/cpufeatures.h
20arch/arm/include/uapi/asm/perf_regs.h
21arch/arm64/include/uapi/asm/perf_regs.h
22arch/powerpc/include/uapi/asm/perf_regs.h
23arch/x86/include/uapi/asm/perf_regs.h
24arch/x86/include/uapi/asm/kvm.h
25arch/x86/include/uapi/asm/kvm_perf.h
26arch/x86/include/uapi/asm/svm.h
27arch/x86/include/uapi/asm/unistd.h
28arch/x86/include/uapi/asm/vmx.h
29arch/powerpc/include/uapi/asm/kvm.h
30arch/s390/include/uapi/asm/kvm.h
31arch/s390/include/uapi/asm/kvm_perf.h
32arch/s390/include/uapi/asm/sie.h
33arch/arm/include/uapi/asm/kvm.h
34arch/arm64/include/uapi/asm/kvm.h
35include/asm-generic/bitops/arch_hweight.h
36include/asm-generic/bitops/const_hweight.h
37include/asm-generic/bitops/__fls.h
38include/asm-generic/bitops/fls.h
39include/asm-generic/bitops/fls64.h
40include/linux/coresight-pmu.h
41include/uapi/asm-generic/ioctls.h
42include/uapi/asm-generic/mman-common.h
43'
44
45check () {
46 file=$1
47 opts="--ignore-blank-lines --ignore-space-change"
48
49 shift
50 while [ -n "$*" ]; do
51 opts="$opts \"$1\""
52 shift
53 done
54
55 cmd="diff $opts ../$file ../../$file > /dev/null"
56
57 test -f ../../$file &&
58 eval $cmd || echo "Warning: Kernel ABI header at 'tools/$file' differs from latest version at '$file'" >&2
59}
60
61
62# simple diff check
63for i in $HEADERS; do
64 check $i -B
65done
66
67# diff with extra ignore lines
68check arch/x86/lib/memcpy_64.S -I "^EXPORT_SYMBOL" -I "^#include <asm/export.h>"
69check arch/x86/lib/memset_64.S -I "^EXPORT_SYMBOL" -I "^#include <asm/export.h>"
70check include/uapi/asm-generic/mman.h -I "^#include <\(uapi/\)*asm-generic/mman-common.h>"
71check include/uapi/linux/mman.h -I "^#include <\(uapi/\)*asm/mman.h>"