Browse Source

Refs #335. Added the fallback of L2 size detection for some virtual machines.

tags/v0.2.9.rc2^2
Zhang Xianyi 12 years ago
parent
commit
7b8604ea29
1 changed files with 6 additions and 0 deletions
  1. +6
    -0
      cpuid_x86.c

+ 6
- 0
cpuid_x86.c View File

@@ -1558,7 +1558,13 @@ void get_cpuconfig(void){
printf("#define L2_SIZE %d\n", info.size * 1024);
printf("#define L2_ASSOCIATIVE %d\n", info.associative);
printf("#define L2_LINESIZE %d\n", info.linesize);
} else {
//fall back for some virtual machines.
printf("#define L2_SIZE 1048576\n");
printf("#define L2_ASSOCIATIVE 6\n");
printf("#define L2_LINESIZE 64\n");
}

get_cacheinfo(CACHE_INFO_L3, &info);
if (info.size > 0) {


Loading…
Cancel
Save