Apache/2.4.7 (Ubuntu) Linux sman1baleendah 3.13.0-24-generic #46-Ubuntu SMP Thu Apr 10 19:11:08 UTC 2014 x86_64 uid=33(www-data) gid=33(www-data) groups=33(www-data) safemode : OFF MySQL: ON | Perl: ON | cURL: OFF | WGet: ON > / usr / src / linux-headers-3.13.0-24 / arch / x86 / kernel / cpu / | server ip : 172.67.156.115 your ip : 172.69.214.34 H O M E |
Filename | /usr/src/linux-headers-3.13.0-24/arch/x86/kernel/cpu/mkcapflags.sh |
Size | 1 kb |
Permission | rw-r--r-- |
Owner | root : root |
Create time | 27-Apr-2025 09:50 |
Last modified | 20-Jan-2014 10:40 |
Last accessed | 06-Jul-2025 15:17 |
Actions | edit | rename | delete | download (gzip) |
View | text | code | image |
#!/bin/sh
#
# Generate the x86_cap_flags[] array from include/asm/cpufeature.h
#
IN=$1
OUT=$2
TABS="$(printf '\t\t\t\t\t')"
trap 'rm "$OUT"' EXIT
(
echo "#ifndef _ASM_X86_CPUFEATURE_H"
echo "#include <asm/cpufeature.h>"
echo "#endif"
echo ""
echo "const char * const x86_cap_flags[NCAPINTS*32] = {"
# Iterate through any input lines starting with #define X86_FEATURE_
sed -n -e 's/\t/ /g' -e 's/^ *# *define *X86_FEATURE_//p' $IN |
while read i
do
# Name is everything up to the first whitespace
NAME="$(echo "$i" | sed 's/ .*//')"
# If the /* comment */ starts with a quote string, grab that.
VALUE="$(echo "$i" | sed -n 's@.*/\* *\("[^"]*"\).*\*/@\1@p')"
[ -z "$VALUE" ] && VALUE="\"$NAME\""
[ "$VALUE" == '""' ] && continue
# Name is uppercase, VALUE is all lowercase
VALUE="$(echo "$VALUE" | tr A-Z a-z)"
TABCOUNT=$(( ( 5*8 - 14 - $(echo "$NAME" | wc -c) ) / 8 ))
printf "\t[%s]%.*s = %s,\n" \
"X86_FEATURE_$NAME" "$TABCOUNT" "$TABS" "$VALUE"
done
echo "};"
) > $OUT
trap - EXIT
#
# Generate the x86_cap_flags[] array from include/asm/cpufeature.h
#
IN=$1
OUT=$2
TABS="$(printf '\t\t\t\t\t')"
trap 'rm "$OUT"' EXIT
(
echo "#ifndef _ASM_X86_CPUFEATURE_H"
echo "#include <asm/cpufeature.h>"
echo "#endif"
echo ""
echo "const char * const x86_cap_flags[NCAPINTS*32] = {"
# Iterate through any input lines starting with #define X86_FEATURE_
sed -n -e 's/\t/ /g' -e 's/^ *# *define *X86_FEATURE_//p' $IN |
while read i
do
# Name is everything up to the first whitespace
NAME="$(echo "$i" | sed 's/ .*//')"
# If the /* comment */ starts with a quote string, grab that.
VALUE="$(echo "$i" | sed -n 's@.*/\* *\("[^"]*"\).*\*/@\1@p')"
[ -z "$VALUE" ] && VALUE="\"$NAME\""
[ "$VALUE" == '""' ] && continue
# Name is uppercase, VALUE is all lowercase
VALUE="$(echo "$VALUE" | tr A-Z a-z)"
TABCOUNT=$(( ( 5*8 - 14 - $(echo "$NAME" | wc -c) ) / 8 ))
printf "\t[%s]%.*s = %s,\n" \
"X86_FEATURE_$NAME" "$TABCOUNT" "$TABS" "$VALUE"
done
echo "};"
) > $OUT
trap - EXIT