[v1.06][FreeBSD][Apple] Implement fallback frequency calculation (#251)

This commit is contained in:
Er2
2024-08-19 10:21:41 +03:00
committed by GitHub
parent 2410fd16d3
commit 8d10a03adc
3 changed files with 26 additions and 1 deletions

View File

@@ -40,6 +40,14 @@
#define CPUSUBFAMILY_ARM_HC_HD 5
#endif
// For alternative way to get CPU frequency on macOS and *BSD
#ifdef __APPLE__
#define CPUFREQUENCY_SYSCTL "hw.cpufrequency_max"
#else
// For FreeBSD, not sure about other *BSD
#define CPUFREQUENCY_SYSCTL "dev.cpu.0.freq"
#endif
uint32_t get_sys_info_by_name(char* name);
#endif