Fix endless loop
Fix a while loop that can cause forever loop when cpuid instruction
doesn't work properly.
Change-Id: Iefa49d23b40c994eb4369621974a7d3c4067e47a
Signed-off-by: Amber Lin <Amber.Lin@amd.com>
[ROCm/ROCR-Runtime commit: 5815d9de9b]
This commit is contained in:
@@ -354,7 +354,8 @@ static int cpuid_find_num_cache_leaves(uint32_t op)
|
||||
do {
|
||||
++idx;
|
||||
cpuid_count(op, idx, &eax.full, &ebx.full, &ecx, &edx);
|
||||
} while (eax.split.type != CACHE_TYPE_NULL);
|
||||
/* Modern systems have cache levels up to 3. */
|
||||
} while (eax.split.type != CACHE_TYPE_NULL && idx < 4);
|
||||
return idx;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user