Just check cpuid itself, don't clobber %ebx

This commit is contained in:
Frank Denis 2013-04-27 14:07:39 -07:00
parent 46f5ec89a6
commit bb70f436d0

View File

@ -241,13 +241,10 @@ AC_SUBST(HAVE_TI_MODE_V)
AC_MSG_CHECKING(for cpuid instruction) AC_MSG_CHECKING(for cpuid instruction)
HAVE_CPUID_V=0 HAVE_CPUID_V=0
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[
#include <stdlib.h> __asm__("movl %ebx,%esi\n"
]], [[ "cpuid\n"
unsigned int level = 0; "movl %esi,%ebx");
unsigned int *eax = NULL, *ebx = NULL, *ecx = NULL, *edx = NULL;
__asm__("cpuid" : "=a"(*eax), "=b" (*ebx), "=c"(*ecx), "=d"(*edx)
: "0"(level));
]])], ]])],
[AC_MSG_RESULT(yes) [AC_MSG_RESULT(yes)
AC_DEFINE([HAVE_CPUID], [1], [cpuid instruction is available]) AC_DEFINE([HAVE_CPUID], [1], [cpuid instruction is available])