Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

Commit

Permalink
Merge pull request #18 from CyberShadow/cpuid-i7
Browse files Browse the repository at this point in the history
cpuid: Attempt to fix thread/core detection for Intel Core i7
  • Loading branch information
Don Clugston committed May 20, 2011
2 parents a8bf41e + b6cc7f2 commit 288e784
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/core/cpuid.d
Expand Up @@ -507,6 +507,7 @@ void getAMDcacheinfo()
void getCpuInfo0B()
{
int level=0;
int threadsPerCore;
uint a, b, c, d;
do {
asm {
Expand All @@ -521,8 +522,12 @@ void getCpuInfo0B()
if (b!=0) {
// I'm not sure about this. The docs state that there
// are 2 hyperthreads per core if HT is factory enabled.
if (level==0) maxThreads = b & 0xFFFF;
else if (level==1) maxCores = b & 0xFFFF;
if (level==0)
threadsPerCore = b & 0xFFFF;
else if (level==1) {
maxThreads = b & 0xFFFF;
maxCores = maxThreads / threadsPerCore;
}

}
++level;
Expand Down

0 comments on commit 288e784

Please sign in to comment.