summaryrefslogtreecommitdiffstats
path: root/src/detection/cpu/cpu.h
diff options
context:
space:
mode:
authorsumuel <samuel@yakubos.org>2026-08-17 20:44:55 +0000
committersumuel <samuel@yakubos.org>2026-08-17 20:44:55 +0000
commit76424950e373d3b04ac3dd13019151bfba3e8423 (patch)
tree4c3cfdbda039e592b9186be3e28f8d7cfd439e8a /src/detection/cpu/cpu.h
Add the files
Diffstat (limited to 'src/detection/cpu/cpu.h')
-rw-r--r--src/detection/cpu/cpu.h35
1 files changed, 35 insertions, 0 deletions
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);