Skip to content

Commit 7f1063d

Browse files
committed
Revert "CPU (macOS): use CPUID for freq detection on Intel"
This reverts commit 7ee0e87.
1 parent 883923d commit 7f1063d

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

src/detection/cpu/cpu_apple.c

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -72,17 +72,14 @@ static const char* detectFrequency(FFCPUResult* cpu)
7272
#else
7373
static const char* detectFrequency(FFCPUResult* cpu)
7474
{
75-
if (ffCPUDetectSpeedByCpuid(cpu) != NULL)
75+
cpu->frequencyBase = (uint32_t) (ffSysctlGetInt64("hw.cpufrequency", 0) / 1000 / 1000);
76+
cpu->frequencyMax = (uint32_t) (ffSysctlGetInt64("hw.cpufrequency_max", 0) / 1000 / 1000);
77+
if(cpu->frequencyBase == 0)
7678
{
77-
cpu->frequencyBase = (uint32_t) (ffSysctlGetInt64("hw.cpufrequency", 0) / 1000 / 1000);
78-
cpu->frequencyMax = (uint32_t) (ffSysctlGetInt64("hw.cpufrequency_max", 0) / 1000 / 1000);
79-
if(cpu->frequencyBase == 0)
80-
{
81-
unsigned current = 0;
82-
size_t size = sizeof(current);
83-
if (sysctl((int[]){ CTL_HW, HW_CPU_FREQ }, 2, &current, &size, NULL, 0) == 0)
84-
cpu->frequencyBase = (uint32_t) (current / 1000 / 1000);
85-
}
79+
unsigned current = 0;
80+
size_t size = sizeof(current);
81+
if (sysctl((int[]){ CTL_HW, HW_CPU_FREQ }, 2, &current, &size, NULL, 0) == 0)
82+
cpu->frequencyBase = (uint32_t) (current / 1000 / 1000);
8683
}
8784
return NULL;
8885
}

0 commit comments

Comments
 (0)