Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
torvalds
GitHub Repository: torvalds/linux
Path: blob/master/arch/arm64/tools/gen-kernel-hwcaps.sh
170891 views
1
#!/bin/sh -e
2
# SPDX-License-Identifier: GPL-2.0
3
#
4
# gen-kernel-hwcap.sh - Generate kernel internal hwcap.h definitions
5
#
6
# Copyright 2026 Arm, Ltd.
7
8
if [ "$1" = "" ]; then
9
echo "$0: no filename specified"
10
exit 1
11
fi
12
13
echo "#ifndef __ASM_KERNEL_HWCAPS_H"
14
echo "#define __ASM_KERNEL_HWCAPS_H"
15
echo ""
16
echo "/* Generated file - do not edit */"
17
echo ""
18
19
grep -E '^#define HWCAP[0-9]*_[A-Z0-9_]+' $1 | \
20
sed 's/.*HWCAP\([0-9]*\)_\([A-Z0-9_]\+\).*/#define KERNEL_HWCAP_\2\t__khwcap\1_feature(\2)/'
21
22
echo ""
23
echo "#endif /* __ASM_KERNEL_HWCAPS_H */"
24
25