]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
Use cpuid.h if it exists, to use the x86 CPUID instruction.
authorNikos Mavrogiannopoulos <nmav@gnutls.org>
Sun, 29 May 2011 10:01:16 +0000 (12:01 +0200)
committerNikos Mavrogiannopoulos <nmav@gnutls.org>
Sun, 29 May 2011 10:01:16 +0000 (12:01 +0200)
configure.ac
lib/accelerated/x86.h

index 95eb972d0aa482f5a86e27269216697a84a724a0..00f4a7ed57c556606d9696e8038490a1ffea9ee8 100644 (file)
@@ -81,6 +81,7 @@ case $host_cpu in
   i?86 | x86_64 | amd64)
 dnl    GCC_FLAG_ADD([-maes -mpclmul],[X86])
 dnl    if test "x$X86" = "xyes";then
+      AC_CHECK_HEADERS(cpuid.h)
       if test "$host_cpu" = "x86_64" -o "$host_cpu" = "amd64";then
         hw_accel="x86-64"
       else
index c344283e36d1776d9077a53749b750033276aef6..8886516f4e43837031da16ed39b9346bdb26e38e 100644 (file)
@@ -1,3 +1,12 @@
+#include <config.h>
+
+#ifdef HAVE_CPUID_H
+# include <cpuid.h>
+# define cpuid __cpuid
+
+#else
 #define cpuid(func,ax,bx,cx,dx)\
   __asm__ __volatile__ ("cpuid":\
   "=a" (ax), "=b" (bx), "=c" (cx), "=d" (dx) : "a" (func));
+
+#endif