Skip to content

Commit

Permalink
[backend] power8 detection
Browse files Browse the repository at this point in the history
PowerPC kernel does not provide any flags, but we need to be able
to distinguish between power7 and 8 at least
  • Loading branch information
adrianschroeter committed Jan 8, 2015
1 parent bc257c2 commit a290c88
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/backend/bs_worker
Expand Up @@ -651,10 +651,18 @@ my $workerenvstate = {};
if (/^processor/s) {
$hw->{'processors'} = $hw->{'processors'} + 1;
}
elsif (/^flags[\s]*:\s(.*)$/) {
elsif (/^flags\s*:\s(.*)$/) {
my @cpuflags = split(' ', $1);
$hw->{'cpu'}->{'flag'} = \@cpuflags;
}
elsif (/^cpu\s*:\sPOWER8/) {
# PowerPC kernel does not provide any flags, but we need to be able
# to distinguish between power7 and 8 at least
$hw->{'cpu'}->{'flag'} = [ "power8" ];
}
elsif (/^cpu\s*:\sPOWER7/) {
$hw->{'cpu'}->{'flag'} = [ "power7" ];
}
}
close FILE;
}
Expand Down

0 comments on commit a290c88

Please sign in to comment.