Merge pilot.blaudden:/home/msvensson/mysql/mysql-5.0-maint
into pilot.blaudden:/home/msvensson/mysql/mysql-5.1-maint
This commit is contained in:
commit
61a3fdd782
@ -192,27 +192,32 @@ bool HaveCpuId()
|
|||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
#else
|
#else
|
||||||
typedef void (*SigHandler)(int);
|
word32 eax, ebx;
|
||||||
|
|
||||||
SigHandler oldHandler = signal(SIGILL, SigIllHandler);
|
|
||||||
if (oldHandler == SIG_ERR)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
bool result = true;
|
|
||||||
if (setjmp(s_env))
|
|
||||||
result = false;
|
|
||||||
else
|
|
||||||
__asm__ __volatile
|
__asm__ __volatile
|
||||||
(
|
(
|
||||||
// save ebx in case -fPIC is being used
|
/* Put EFLAGS in eax and ebx */
|
||||||
"push %%ebx; mov $0, %%eax; cpuid; pop %%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);
|
if (eax == ebx)
|
||||||
return result;
|
return false;
|
||||||
|
return true;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user