summaryrefslogtreecommitdiffstats
path: root/src/detection/cpu/cpu.h
diff options
context:
space:
mode:
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);