Server : Apache/2.4.18 (Ubuntu) System : Linux canvaswebdesign 3.13.0-71-generic #114-Ubuntu SMP Tue Dec 1 02:34:22 UTC 2015 x86_64 User : oppastar ( 1041) PHP Version : 7.0.33-0ubuntu0.16.04.15 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority, Directory : /usr/src/linux-headers-4.4.0-134-generic/arch/x86/kernel/cpu/ |
Upload File : |
#!/bin/sh # # Generate the x86_cap/bug_flags[] arrays from include/asm/cpufeatures.h # IN=$1 OUT=$2 dump_array() { ARRAY=$1 SIZE=$2 PFX=$3 POSTFIX=$4 PFX_SZ=$(echo $PFX | wc -c) TABS="$(printf '\t\t\t\t\t')" echo "const char * const $ARRAY[$SIZE] = {" # Iterate through any input lines starting with #define $PFX sed -n -e 's/\t/ /g' -e "s/^ *# *define *$PFX//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)" if [ -n "$POSTFIX" ]; then T=$(( $PFX_SZ + $(echo $POSTFIX | wc -c) + 2 )) TABS="$(printf '\t\t\t\t\t\t')" TABCOUNT=$(( ( 6*8 - ($T + 1) - $(echo "$NAME" | wc -c) ) / 8 )) printf "\t[%s - %s]%.*s = %s,\n" "$PFX$NAME" "$POSTFIX" "$TABCOUNT" "$TABS" "$VALUE" else TABCOUNT=$(( ( 5*8 - ($PFX_SZ + 1) - $(echo "$NAME" | wc -c) ) / 8 )) printf "\t[%s]%.*s = %s,\n" "$PFX$NAME" "$TABCOUNT" "$TABS" "$VALUE" fi done echo "};" } trap 'rm "$OUT"' EXIT ( echo "#ifndef _ASM_X86_CPUFEATURES_H" echo "#include <asm/cpufeatures.h>" echo "#endif" echo "" dump_array "x86_cap_flags" "NCAPINTS*32" "X86_FEATURE_" "" echo "" dump_array "x86_bug_flags" "NBUGINTS*32" "X86_BUG_" "NCAPINTS*32" ) > $OUT trap - EXIT