Skip to content

Commit e936dde

Browse files
committed
CPU (X86): adds code name and tech detection
Fixes #1501
1 parent c706201 commit e936dde

5 files changed

Lines changed: 1439 additions & 0 deletions

File tree

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -447,6 +447,7 @@ set(LIBFASTFETCH_SRC
447447
src/detection/codec/codec.c
448448
src/detection/codec/codec_vulkan.c
449449
src/detection/cpu/cpu.c
450+
src/detection/cpu/cpu_x86.c
450451
src/detection/cpuusage/cpuusage.c
451452
src/detection/command/command.c
452453
src/detection/disk/disk.c

src/detection/cpu/cpu.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ const char* ffDetectCPU(const FFCPUOptions* options, FFCPUResult* cpu) {
2222
ffStrbufSubstrBeforeFirstC(&cpu->name, '@'); // Cut the speed output in the name as we append our own
2323
ffStrbufTrimRight(&cpu->name, ' '); // If we removed the @ in previous step there was most likely a space before it
2424
ffStrbufRemoveDupWhitespaces(&cpu->name);
25+
26+
#if __i386__ || __x86_64__
27+
ffCPUDetectX86Specific(cpu);
28+
#endif
29+
2530
return NULL;
2631
}
2732

src/detection/cpu/cpu.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,20 @@ typedef struct FFCPUResult {
2727
FFCPUCore coreTypes[16]; // number of P cores, E cores, etc.
2828

2929
double temperature;
30+
31+
#if __i386__ || __x86_64__
32+
const char* codeName;
33+
const char* technology;
34+
#endif
3035
} FFCPUResult;
3136

3237
const char* ffDetectCPU(const FFCPUOptions* options, FFCPUResult* cpu);
3338
const char* ffCPUAppleCodeToName(uint32_t code);
3439
const char* ffCPUQualcommCodeToName(uint32_t code);
3540
void ffCPUDetectByCpuid(FFCPUResult* cpu);
41+
42+
#if __i386__ || __x86_64__
43+
44+
bool ffCPUDetectX86Specific(FFCPUResult* cpu);
45+
46+
#endif

0 commit comments

Comments
 (0)