Use fallback in detecting VIA cach line size

This commit is contained in:
Jeffrey Walton 2019-05-08 19:46:23 -04:00
parent 40e5891635
commit c91813c0b4
No known key found for this signature in database
GPG Key ID: B36AB348921B1838

View File

@ -458,6 +458,14 @@ void DetectX86Features()
CpuId(0xC0000005, 0, cpuid2);
g_cacheLineSize = GETBYTE(cpuid2[2] /*ECX*/, 0);
}
#if defined(_SC_LEVEL1_DCACHE_LINESIZE)
else
{
int cacheLineSize = sysconf(_SC_LEVEL1_DCACHE_LINESIZE);
if (cacheLineSize > 0)
g_cacheLineSize = cacheLineSize;
}
#endif
}
if (g_cacheLineSize == 0)