summaryrefslogtreecommitdiff
path: root/extra/yassl
diff options
context:
space:
mode:
authorunknown <msvensson@pilot.blaudden>2007-04-11 22:08:19 +0200
committerunknown <msvensson@pilot.blaudden>2007-04-11 22:08:19 +0200
commit15050080f13d67a1e35fd92dbd3a05de27f0ee50 (patch)
tree6dd8a40001ccf4c778f2a2f67209c8f6bf0d574c /extra/yassl
parentd25a540dca1814d5a905544a88d93f936bc61137 (diff)
parentc6b0cff186dc8a275da5775e0207edac5cb2b1f2 (diff)
downloadmariadb-git-15050080f13d67a1e35fd92dbd3a05de27f0ee50.tar.gz
Merge pilot.blaudden:/home/msvensson/mysql/yassl_import/my50-yassl_import
into pilot.blaudden:/home/msvensson/mysql/mysql-5.0-maint
Diffstat (limited to 'extra/yassl')
-rw-r--r--extra/yassl/taocrypt/src/misc.cpp37
1 files changed, 21 insertions, 16 deletions
diff --git a/extra/yassl/taocrypt/src/misc.cpp b/extra/yassl/taocrypt/src/misc.cpp
index 726d9e630e6..402645c93fd 100644
--- a/extra/yassl/taocrypt/src/misc.cpp
+++ b/extra/yassl/taocrypt/src/misc.cpp
@@ -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
}