List:Commits« Previous MessageNext Message »
From:msvensson Date:April 11 2007 10:07pm
Subject:bk commit into 5.0 tree (msvensson:1.2447) BUG#21765
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of msvensson. When msvensson does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet@stripped, 2007-04-11 22:07:24+02:00, msvensson@stripped +1 -0
  Bug#21765 Illegal Instruction crash on pre-pentium when using YASSL
   - Import patch with different method of detecting if machine has
     cpuid instruction

  extra/yassl/taocrypt/src/misc.cpp@stripped, 2007-04-11 19:34:46+02:00,
msvensson@stripped +21 -16
    Import patch yassl.diff

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	msvensson
# Host:	pilot.blaudden
# Root:	/home/msvensson/mysql/yassl_import/my50-yassl_import

--- 1.20/extra/yassl/taocrypt/src/misc.cpp	2007-02-27 12:05:13 +01:00
+++ 1.21/extra/yassl/taocrypt/src/misc.cpp	2007-04-11 19:34:46 +02:00
@@ -192,27 +192,32 @@ bool HaveCpuId()
     }
     return true;
 #else
-    typedef void (*SigHandler)(int);
-
-    SigHandler oldHandler = signal(SIGILL, SigIllHandler);
-    if (oldHandler == SIG_ERR)
-        return false;
-
-    bool result = true;
-    if (setjmp(s_env))
-        result = false;
-    else 
+    word32 eax, ebx;
         __asm__ __volatile
         (
-            // save ebx in case -fPIC is being used
-            "push %%ebx; mov $0, %%eax; cpuid; pop %%ebx"
-            : 
+        /* Put EFLAGS in eax and ebx */
+        "pushf;"
+        "pushf;"
+        "pop %0;"
+        "movl %0,%1;"
+
+        /* Flip the cpuid bit and store back in EFLAGS */
+        "xorl $0x200000,%0;"
+        "push %0;"
+        "popf;"
+
+        /* Read EFLAGS again */
+        "pushf;"
+        "pop %0;"
+        "popf"
+        : "=r" (eax), "=r" (ebx)
             :
-            : "%eax", "%ecx", "%edx" 
+        : "cc"
         );
 
-    signal(SIGILL, oldHandler);
-    return result;
+    if (eax == ebx)
+        return false;
+    return true;
 #endif
 }
 
Thread
bk commit into 5.0 tree (msvensson:1.2447) BUG#21765msvensson11 Apr