1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-03 09:00:21 +00:00

Check if deterministic cache parameters leaf is valid before use.

This commit is contained in:
Jung-uk Kim 2006-04-24 22:23:52 +00:00
parent 95eb1796b1
commit cf24d86bcc
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=158003
2 changed files with 4 additions and 2 deletions

View File

@ -360,7 +360,8 @@ printcpuinfo(void)
else if (strcmp(cpu_vendor, "GenuineIntel") == 0 &&
(cpu_high >= 4)) {
cpuid_count(4, 0, regs);
cmp = ((regs[0] & 0xfc000000) >> 26) + 1;
if ((regs[0] & 0x1f) != 0)
cmp = ((regs[0] >> 26) & 0x3f) + 1;
}
if (cmp > 1)
printf("\n Cores per package: %d", cmp);

View File

@ -856,7 +856,8 @@ printcpuinfo(void)
else if (strcmp(cpu_vendor, "GenuineIntel") == 0 &&
(cpu_high >= 4)) {
cpuid_count(4, 0, regs);
cmp = ((regs[0] & 0xfc000000) >> 26) + 1;
if ((regs[0] & 0x1f) != 0)
cmp = ((regs[0] >> 26) & 0x3f) + 1;
}
if (cmp > 1)
printf("\n Cores per package: %d", cmp);