changeset 738:7705b51ab518

cpuid bug fixed. remelem.
author pontscho
date Wed, 09 May 2001 16:40:06 +0000
parents e8d5e6d4d85f
children c0131b42214a
files mp3lib/d_cpu.s
diffstat 1 files changed, 19 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mp3lib/d_cpu.s	Wed May 09 14:17:55 2001 +0000
+++ b/mp3lib/d_cpu.s	Wed May 09 16:40:06 2001 +0000
@@ -15,16 +15,34 @@
 /   return: cpu ident number.
 / ---------------------------------------------------------------------------
 CpuDetect:
+	pushl %eax
         pushl %ebx
         pushl %ecx
         pushl %edx
 
-        movl  $1,%eax
+        pushfl
+        popl   %eax
+        movl   %eax,%ebx
+        xorl   $0x00200000,%eax
+        pushl  %eax
+        popfl
+        pushfl
+        popl   %eax
+        cmpl   %eax,%ebx
+        jz     no_cpuid_cpudetect
+	
+        movl   $1,%eax
         cpuid
+	
+        jmp    exit_cpudetect
+no_cpuid_cpudetect:
+        xorl   %eax,%eax
+exit_cpudetect:
 
         popl  %edx
         popl  %ecx
         popl  %ebx
+	popl  %eax
         ret
 
 / ---------------------------------------------------------------------------