Revert "CPU (macOS): use CPUID for freq detection on Intel"

This reverts commit 7ee0e8726e.
This commit is contained in:
李通洲
2025-08-11 16:35:35 +08:00
parent 883923de4a
commit 7f1063d09b
+7 -10
View File
@@ -72,17 +72,14 @@ static const char* detectFrequency(FFCPUResult* cpu)
#else
static const char* detectFrequency(FFCPUResult* cpu)
{
if (ffCPUDetectSpeedByCpuid(cpu) != NULL)
cpu->frequencyBase = (uint32_t) (ffSysctlGetInt64("hw.cpufrequency", 0) / 1000 / 1000);
cpu->frequencyMax = (uint32_t) (ffSysctlGetInt64("hw.cpufrequency_max", 0) / 1000 / 1000);
if(cpu->frequencyBase == 0)
{
cpu->frequencyBase = (uint32_t) (ffSysctlGetInt64("hw.cpufrequency", 0) / 1000 / 1000);
cpu->frequencyMax = (uint32_t) (ffSysctlGetInt64("hw.cpufrequency_max", 0) / 1000 / 1000);
if(cpu->frequencyBase == 0)
{
unsigned current = 0;
size_t size = sizeof(current);
if (sysctl((int[]){ CTL_HW, HW_CPU_FREQ }, 2, &current, &size, NULL, 0) == 0)
cpu->frequencyBase = (uint32_t) (current / 1000 / 1000);
}
unsigned current = 0;
size_t size = sizeof(current);
if (sysctl((int[]){ CTL_HW, HW_CPU_FREQ }, 2, &current, &size, NULL, 0) == 0)
cpu->frequencyBase = (uint32_t) (current / 1000 / 1000);
}
return NULL;
}