[*] Improved cache reporting under NT under various conditions

new hw: return upper bound of range at level index.
old sw: missing impl.
This commit is contained in:
Reece Wilson 2022-12-14 05:25:05 +00:00
parent 49287f2a73
commit c42ebc9853

View File

@ -135,17 +135,15 @@ namespace Aurora::HWInfo
{
switch (sysinfo[i].Cache.Level)
{
case 0:
break;
case 1:
gCpuInfo.dwCacheLine = sysinfo[i].Cache.LineSize;
gCpuInfo.dwCacheL1 = sysinfo[i].Cache.Size;
gCpuInfo.dwCacheLine = AuMax<AuUInt32>(gCpuInfo.dwCacheLine, sysinfo[i].Cache.LineSize);
gCpuInfo.dwCacheL1 = AuMax<AuUInt32>(gCpuInfo.dwCacheL1, sysinfo[i].Cache.Size);
break;
case 2:
gCpuInfo.dwCacheL2 = sysinfo[i].Cache.Size;
gCpuInfo.dwCacheL2 = AuMax<AuUInt32>(gCpuInfo.dwCacheL2, sysinfo[i].Cache.Size);
break;
case 3:
gCpuInfo.dwCacheL3 = sysinfo[i].Cache.Size;
gCpuInfo.dwCacheL3 = AuMax<AuUInt32>(gCpuInfo.dwCacheL3, sysinfo[i].Cache.Size);
break;
}
}
@ -248,6 +246,22 @@ namespace Aurora::HWInfo
{
gCpuInfo.uSocket++;
}
else if (sysinfo[i].Relationship == RelationCache)
{
switch (sysinfo[i].Cache.Level)
{
case 1:
gCpuInfo.dwCacheLine = AuMax<AuUInt32>(gCpuInfo.dwCacheLine, sysinfo[i].Cache.LineSize);
gCpuInfo.dwCacheL1 = AuMax<AuUInt32>(gCpuInfo.dwCacheL1, sysinfo[i].Cache.Size);
break;
case 2:
gCpuInfo.dwCacheL2 = AuMax<AuUInt32>(gCpuInfo.dwCacheL2, sysinfo[i].Cache.Size);
break;
case 3:
gCpuInfo.dwCacheL3 = AuMax<AuUInt32>(gCpuInfo.dwCacheL3, sysinfo[i].Cache.Size);
break;
}
}
}
gCpuInfo.bMaskMTContig = !sparse;