aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Herbszt <herbszt@gmx.de>2010-03-21 21:55:00 +0100
committerH. Peter Anvin <hpa@zytor.com>2010-03-29 13:16:09 -0700
commit1ca27ea6c2fbdc14f06d821cac440898e08ce087 (patch)
tree46703783e91b191a547c7e6ffc8344246b0d0a2b
parenteaa8dfe4150e12dcebf327f59e18a4be5fda3207 (diff)
downloadsyslinux-1ca27ea6c2fbdc14f06d821cac440898e08ce087.tar.gz
syslinux-1ca27ea6c2fbdc14f06d821cac440898e08ce087.tar.xz
syslinux-1ca27ea6c2fbdc14f06d821cac440898e08ce087.zip
gpllib: fix call to CPUID function 4
Only call CPUID function 4 if cpuid_level indicates its availability. Signed-off-by: Sebastian Herbszt <herbszt@gmx.de> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
-rw-r--r--com32/gpllib/cpuid.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/com32/gpllib/cpuid.c b/com32/gpllib/cpuid.c
index fa212045..f33e8958 100644
--- a/com32/gpllib/cpuid.c
+++ b/com32/gpllib/cpuid.c
@@ -232,8 +232,10 @@ void generic_identify(struct cpuinfo_x86 *c)
}
break;
case X86_VENDOR_INTEL:
- cpuid(0x4, &eax, &ebx, &ecx, &edx);
- c->x86_num_cores = ((eax & 0xfc000000) >> 26) + 1;
+ if (c->cpuid_level >= 0x00000004) {
+ cpuid(0x4, &eax, &ebx, &ecx, &edx);
+ c->x86_num_cores = ((eax & 0xfc000000) >> 26) + 1;
+ }
break;
default:
c->x86_num_cores = 1;