3 # Generate the x86_cap_flags[] array from include/asm-x86/cpufeature.h
8 open(IN
, "< $in\0") or die "$0: cannot open: $in: $!\n";
9 open(OUT
, "> $out\0") or die "$0: cannot create: $out: $!\n";
11 print OUT
"#ifndef _ASM_X86_CPUFEATURE_H\n";
12 print OUT
"#include <asm/cpufeature.h>\n";
15 print OUT
"const char * const x86_cap_flags[NCAPINTS*32] = {\n";
20 while (defined($line = <IN
>)) {
21 if ($line =~ /^\s*\#\s*define\s+(X86_FEATURE_(\S+))\s+(.*)$/) {
25 if ($tail =~ /\/\
*\s
*\"([^"]*)\".*\*\//) {
29 next if ($feature eq '');
31 if ($features{$feature}++) {
32 print STDERR "$in: duplicate feature name
: $feature\n";
35 printf OUT "\t%-32s
= \"%s\",\n", "[$macro]", $feature;