mirror of
https://github.com/google/cpu_features.git
synced 2025-04-28 07:23:37 +02:00
parent
55ac9f0556
commit
7bd206a75f
@ -1152,7 +1152,9 @@ static void ParseLeaf2(const int max_cpuid_leaf, CacheInfo* info) {
|
|||||||
// For newer AMD CPUs uses "CPUID, eax=0x8000001D"
|
// For newer AMD CPUs uses "CPUID, eax=0x8000001D"
|
||||||
static void ParseCacheInfo(const int max_cpuid_leaf, uint32_t leaf_id,
|
static void ParseCacheInfo(const int max_cpuid_leaf, uint32_t leaf_id,
|
||||||
CacheInfo* info) {
|
CacheInfo* info) {
|
||||||
for (int cache_id = 0; cache_id < CPU_FEATURES_MAX_CACHE_LEVEL; cache_id++) {
|
for (int cache_id = 0; cache_id < CPU_FEATURES_MAX_CACHE_LEVEL &&
|
||||||
|
info->size < CPU_FEATURES_MAX_CACHE_LEVEL;
|
||||||
|
cache_id++) {
|
||||||
const Leaf leaf = SafeCpuIdEx(max_cpuid_leaf, leaf_id, cache_id);
|
const Leaf leaf = SafeCpuIdEx(max_cpuid_leaf, leaf_id, cache_id);
|
||||||
CacheType cache_type = ExtractBitRange(leaf.eax, 4, 0);
|
CacheType cache_type = ExtractBitRange(leaf.eax, 4, 0);
|
||||||
if (cache_type == CPU_FEATURE_CACHE_NULL) continue;
|
if (cache_type == CPU_FEATURE_CACHE_NULL) continue;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user