chiark / gitweb /
x86-model: Make it build on amd64.
authorMark Wooding <mdw@distorted.org.uk>
Mon, 20 Jan 2014 16:03:50 +0000 (16:03 +0000)
committerMark Wooding <mdw@distorted.org.uk>
Mon, 20 Jan 2014 16:03:50 +0000 (16:03 +0000)
It even seems to work.

configure.ac
x86-model.c

index f0fa6143e0c55b8a37cd2a7e9811a9b83e99c077..97e1c30bf889fd28300e1ce5447cc265cc804329 100644 (file)
@@ -72,7 +72,7 @@ AC_CHECK_FUNC([prlimit], [have_prlimit=yes], [have_prlimit=no])
 AM_CONDITIONAL([HAVE_PRLIMIT], [test $have_prlimit = yes])
 
 ## Processor type.
-case "$host_cpu" in i?86) x86=yes;; *) x86=no;; esac
+case "$host_cpu" in i?86 | x86_64) x86=yes;; *) x86=no;; esac
 AM_CONDITIONAL([X86], [test $x86 = yes -a $GCC = yes])
 
 dnl--------------------------------------------------------------------------
index cb90fb3dab75cd8556f47d7851148d40da48f470..05c47c6f25052be4f66ce03fc2f775f3779af82e 100644 (file)
@@ -32,7 +32,7 @@
 #include <mLib/quis.h>
 #include <mLib/report.h>
 
-#if !defined(__GNUC__) || !defined(__i386__)
+#if !defined(__GNUC__) || (!defined(__i386__) && !defined(__amd64__))
 #  error "This isn't going to work."
 #endif
 
@@ -44,6 +44,7 @@ struct cpuid { unsigned eax, ebx, ecx, edx; };
 
 static inline void cpuid(unsigned leaf, struct cpuid *c)
 {
+
   __asm__ ("cpuid"
           : "=a" (c->eax),
             "=b" (c->ebx),