Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 311491
b: refs/heads/master
c: 55f6cb9
h: refs/heads/master
i:
  311489: 0598952
  311487: e315e1e
v: v3
  • Loading branch information
H. Peter Anvin committed Jun 25, 2012
1 parent aa031a1 commit 3f10ece
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4ad33411308596f2f918603509729922a1ec4411
refs/heads/master: 55f6cb9d0b364e7e8cb65b51193f5e4743c44fde
23 changes: 18 additions & 5 deletions trunk/arch/x86/kernel/cpu/mkcapflags.pl
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,35 @@
print OUT "#include <asm/cpufeature.h>\n\n";
print OUT "const char * const x86_cap_flags[NCAPINTS*32] = {\n";

%features = ();
$err = 0;

while (defined($line = <IN>)) {
if ($line =~ /^\s*\#\s*define\s+(X86_FEATURE_(\S+))\s+(.*)$/) {
$macro = $1;
$feature = $2;
$feature = "\L$2";
$tail = $3;
if ($tail =~ /\/\*\s*\"([^"]*)\".*\*\//) {
$feature = $1;
$feature = "\L$1";
}

if ($feature ne '') {
printf OUT "\t%-32s = \"%s\",\n",
"[$macro]", "\L$feature";
next if ($feature eq '');

if ($features{$feature}++) {
print STDERR "$in: duplicate feature name: $feature\n";
$err++;
}
printf OUT "\t%-32s = \"%s\",%s\n", "[$macro]", $feature;
}
}
print OUT "};\n";

close(IN);
close(OUT);

if ($err) {
unlink($out);
exit(1);
}

exit(0);

0 comments on commit 3f10ece

Please sign in to comment.