2022-09-19 22:23:31 +02:00
|
|
|
#include "cpu.h"
|
2022-09-19 23:16:43 +02:00
|
|
|
#include "common/sysctl.h"
|
2022-09-19 22:23:31 +02:00
|
|
|
|
|
|
|
|
void ffDetectCPUImpl(FFCPUResult* cpu)
|
|
|
|
|
{
|
2022-09-19 23:16:43 +02:00
|
|
|
ffStrbufInitA(&cpu->vendor, 0);
|
|
|
|
|
|
2022-09-19 22:23:31 +02:00
|
|
|
ffStrbufInit(&cpu->name);
|
2022-09-19 23:16:43 +02:00
|
|
|
ffSysctlGetString("hw.model", &cpu->name);
|
|
|
|
|
|
|
|
|
|
cpu->coresPhysical = (uint16_t) ffSysctlGetInt("hw.ncpu", 1);
|
|
|
|
|
cpu->coresLogical = cpu->coresPhysical;
|
|
|
|
|
cpu->coresOnline = cpu->coresPhysical;
|
|
|
|
|
|
|
|
|
|
cpu->frequencyMin = ffSysctlGetInt("hw.clockrate", 0) / 1000.0;
|
|
|
|
|
cpu->frequencyMax = cpu->frequencyMin;
|
|
|
|
|
|
|
|
|
|
cpu->temperature = FF_CPU_TEMP_UNSET;
|
2022-09-19 22:23:31 +02:00
|
|
|
}
|