[v0.94] Refactor CPU features in a separate struct. Remove x86 debug functions

This commit is contained in:
Dr-Noob
2020-12-01 12:14:24 +01:00
parent d04d535807
commit b1f3196e0d
4 changed files with 74 additions and 112 deletions

View File

@@ -79,7 +79,8 @@ struct topology {
#endif
};
struct cpuInfo {
struct features {
bool AES; // Must be the first field of features struct!
#ifdef ARCH_X86
bool AVX;
bool AVX2;
@@ -93,21 +94,23 @@ struct cpuInfo {
bool SSE4_2;
bool FMA3;
bool FMA4;
bool SHA;
bool SHA;
#elif ARCH_ARM
bool NEON;
bool SHA1;
bool SHA2;
bool CRC32;
#endif
bool AES;
#endif
};
struct cpuInfo {
VENDOR cpu_vendor;
struct uarch* arch;
struct hypervisor* hv;
struct frequency* freq;
struct cache* cach;
struct topology* topo;
struct features* feat;
#ifdef ARCH_X86
// CPU name from model