Commit 15050080 authored by unknown's avatar unknown

Merge pilot.blaudden:/home/msvensson/mysql/yassl_import/my50-yassl_import

into  pilot.blaudden:/home/msvensson/mysql/mysql-5.0-maint

parents d25a540d c6b0cff1
......@@ -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
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment