diff --git a/src/common/cpu.h b/src/common/cpu.h index 265a411..f1623f6 100644 --- a/src/common/cpu.h +++ b/src/common/cpu.h @@ -131,6 +131,8 @@ struct cpuInfo { uint32_t maxExtendedLevels; // Topology Extensions (AMD only) bool topology_extensions; + // Hybrid Flag (Intel only) + bool hybrid_flag; #elif ARCH_PPC uint32_t pvr; #elif ARCH_ARM diff --git a/src/x86/cpuid.c b/src/x86/cpuid.c index e35272a..e2022b3 100644 --- a/src/x86/cpuid.c +++ b/src/x86/cpuid.c @@ -401,6 +401,14 @@ struct cpuInfo* get_cpu_info() { cpu->topology_extensions = (ecx >> 22) & 1; } + cpu->hybrid_flag = false; + if(cpu->cpu_vendor == CPU_VENDOR_INTEL && cpu->maxLevels >= 0x00000007) { + eax = 0x00000007; + ecx = 0x00000000; + cpuid(&eax, &ebx, &ecx, &edx); + cpu->hybrid_flag = (edx >> 15) & 0x1; + } + // If any field of the struct is NULL, // return inmideately, as further functions // require valid fields (cach, topo, etc) @@ -931,6 +939,9 @@ void print_debug(struct cpuInfo* cpu) { if(cpu->cpu_vendor == CPU_VENDOR_AMD) { printf("- AMD topology extensions: %d\n", cpu->topology_extensions); } + if(cpu->cpu_vendor == CPU_VENDOR_INTEL) { + printf("- Hybrid Flag: %d\n", cpu->hybrid_flag); + } printf("- CPUID dump: 0x%.8X\n", eax); free_cpuinfo_struct(cpu);