mirror of
https://github.com/Dr-Noob/cpufetch.git
synced 2026-03-25 16:00:39 +01:00
[v1.02][x86] Suport for detecting hybrid_flag
This commit is contained in:
@@ -131,6 +131,8 @@ struct cpuInfo {
|
|||||||
uint32_t maxExtendedLevels;
|
uint32_t maxExtendedLevels;
|
||||||
// Topology Extensions (AMD only)
|
// Topology Extensions (AMD only)
|
||||||
bool topology_extensions;
|
bool topology_extensions;
|
||||||
|
// Hybrid Flag (Intel only)
|
||||||
|
bool hybrid_flag;
|
||||||
#elif ARCH_PPC
|
#elif ARCH_PPC
|
||||||
uint32_t pvr;
|
uint32_t pvr;
|
||||||
#elif ARCH_ARM
|
#elif ARCH_ARM
|
||||||
|
|||||||
@@ -401,6 +401,14 @@ struct cpuInfo* get_cpu_info() {
|
|||||||
cpu->topology_extensions = (ecx >> 22) & 1;
|
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,
|
// If any field of the struct is NULL,
|
||||||
// return inmideately, as further functions
|
// return inmideately, as further functions
|
||||||
// require valid fields (cach, topo, etc)
|
// require valid fields (cach, topo, etc)
|
||||||
@@ -931,6 +939,9 @@ void print_debug(struct cpuInfo* cpu) {
|
|||||||
if(cpu->cpu_vendor == CPU_VENDOR_AMD) {
|
if(cpu->cpu_vendor == CPU_VENDOR_AMD) {
|
||||||
printf("- AMD topology extensions: %d\n", cpu->topology_extensions);
|
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);
|
printf("- CPUID dump: 0x%.8X\n", eax);
|
||||||
|
|
||||||
free_cpuinfo_struct(cpu);
|
free_cpuinfo_struct(cpu);
|
||||||
|
|||||||
Reference in New Issue
Block a user