master ohmu/fastfetch-openbsd / src / detection / cpu / cpu.h
ohmu  ·  2026-10-15
 1#pragma once
 2
 3#include "fastfetch.h"
 4#include "modules/cpu/option.h"
 5
 6#define FF_CPU_TEMP_UNSET (-DBL_MAX)
 7
 8typedef struct FFCPUCore {
 9    uint32_t freq;
10    uint32_t count;
11} FFCPUCore;
12
13typedef struct FFCPUResult {
14    FFstrbuf name;
15    FFstrbuf vendor;
16    const char* march; // Microarchitecture
17
18    uint16_t packages;
19    uint16_t coresPhysical;
20    uint16_t coresLogical;
21    uint16_t coresOnline;
22    uint16_t numaNodes;
23
24    uint32_t frequencyBase; // GHz
25    uint32_t frequencyMax;  // GHz
26
27    FFCPUCore coreTypes[16]; // number of P cores, E cores, etc.
28
29    double temperature;
30
31    #if __i386__ || __x86_64__
32    const char* codeName;
33    const char* technology;
34    #endif
35} FFCPUResult;
36
37const char* ffDetectCPU(const FFCPUOptions* options, FFCPUResult* cpu);
38const char* ffCPUAppleCodeToName(uint32_t code);
39const char* ffCPUQualcommCodeToName(uint32_t code);
40void ffCPUDetectByCpuid(FFCPUResult* cpu);
41
42#if __i386__ || __x86_64__
43
44bool ffCPUDetectX86Specific(FFCPUResult* cpu);
45
46#endif