From 76424950e373d3b04ac3dd13019151bfba3e8423 Mon Sep 17 00:00:00 2001 From: sumuel Date: Mon, 17 Aug 2026 20:44:55 +0000 Subject: Add the files --- src/detection/cpu/cpu.h | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 src/detection/cpu/cpu.h (limited to 'src/detection/cpu/cpu.h') diff --git a/src/detection/cpu/cpu.h b/src/detection/cpu/cpu.h new file mode 100644 index 0000000..0f7eece --- /dev/null +++ b/src/detection/cpu/cpu.h @@ -0,0 +1,35 @@ +#pragma once + +#include "fastfetch.h" +#include "modules/cpu/option.h" + +#define FF_CPU_TEMP_UNSET (-DBL_MAX) + +typedef struct FFCPUCore { + uint32_t freq; + uint32_t count; +} FFCPUCore; + +typedef struct FFCPUResult { + FFstrbuf name; + FFstrbuf vendor; + const char* march; // Microarchitecture + + uint16_t packages; + uint16_t coresPhysical; + uint16_t coresLogical; + uint16_t coresOnline; + uint16_t numaNodes; + + uint32_t frequencyBase; // GHz + uint32_t frequencyMax; // GHz + + FFCPUCore coreTypes[16]; // number of P cores, E cores, etc. + + double temperature; +} FFCPUResult; + +const char* ffDetectCPU(const FFCPUOptions* options, FFCPUResult* cpu); +const char* ffCPUAppleCodeToName(uint32_t code); +const char* ffCPUQualcommCodeToName(uint32_t code); +void ffCPUDetectByCpuid(FFCPUResult* cpu); -- cgit v1.2.3