mirror of
https://github.com/Dr-Noob/cpufetch.git
synced 2026-03-25 16:00:39 +01:00
[v1.03] Fix compilation errors in Windows
This commit is contained in:
@@ -102,6 +102,7 @@ bool bind_to_cpu(int cpu_id) {
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef __linux__
|
||||||
int get_total_cores_module(int total_cores, int module) {
|
int get_total_cores_module(int total_cores, int module) {
|
||||||
int total_modules = 2;
|
int total_modules = 2;
|
||||||
int32_t current_module_idx = -1;
|
int32_t current_module_idx = -1;
|
||||||
@@ -154,6 +155,7 @@ int get_total_cores_module(int total_cores, int module) {
|
|||||||
//printf("Module %d has %d cores\n", module, cores_in_module);
|
//printf("Module %d has %d cores\n", module, cores_in_module);
|
||||||
return cores_in_module;
|
return cores_in_module;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
bool fill_topo_masks_apic(struct topology* topo) {
|
bool fill_topo_masks_apic(struct topology* topo) {
|
||||||
uint32_t eax = 0x00000001;
|
uint32_t eax = 0x00000001;
|
||||||
|
|||||||
@@ -21,6 +21,8 @@ uint32_t is_smt_enabled_amd(struct topology* topo);
|
|||||||
bool bind_to_cpu(int cpu_id);
|
bool bind_to_cpu(int cpu_id);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef __linux__
|
||||||
int get_total_cores_module(int total_cores, int module);
|
int get_total_cores_module(int total_cores, int module);
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -398,6 +398,10 @@ bool set_cpu_module(int m, int total_modules, int32_t* first_core) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
// This is a normal architecture
|
||||||
|
*first_core = 0;
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -652,7 +656,11 @@ struct topology* get_topology_info(struct cpuInfo* cpu, struct cache* cach, int
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
if(cpu->hybrid_flag) {
|
if(cpu->hybrid_flag) {
|
||||||
topo->total_cores_module = get_total_cores_module(topo->total_cores, module);
|
#ifdef __linux__
|
||||||
|
topo->total_cores_module = get_total_cores_module(topo->total_cores, module);
|
||||||
|
#else
|
||||||
|
topo->total_cores_module = topo->total_cores;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
topo->total_cores_module = topo->total_cores;
|
topo->total_cores_module = topo->total_cores;
|
||||||
|
|||||||
Reference in New Issue
Block a user