summaryrefslogtreecommitdiff
path: root/util/inteltool/cpu.c
diff options
context:
space:
mode:
authorStefan Reinauer <stepan@coresystems.de>2009-04-22 23:17:44 +0000
committerStefan Reinauer <stepan@openbios.org>2009-04-22 23:17:44 +0000
commitf182456013a4416e176b000076b9f101c144d586 (patch)
tree294b193380bed8c0fd627448762679804c6c7b32 /util/inteltool/cpu.c
parent554fce6ced7a13e3f5961fbc7b2be1e5a2d4f6ad (diff)
downloadcoreboot-f182456013a4416e176b000076b9f101c144d586.tar.xz
mini fix to reliably compile inteltool on darwin, and on Linux both on x86/x86_64.
Signed-off-by: Stefan Reinauer <stepan@coresystems.de> Acked-by: Stefan Reinauer <stepan@coresystems.de> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@4190 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'util/inteltool/cpu.c')
-rw-r--r--util/inteltool/cpu.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/util/inteltool/cpu.c b/util/inteltool/cpu.c
index bde93dee9d..c1972b77ea 100644
--- a/util/inteltool/cpu.c
+++ b/util/inteltool/cpu.c
@@ -32,6 +32,7 @@ unsigned int cpuid(unsigned int op)
{
unsigned int ret;
unsigned int dummy2, dummy3, dummy4;
+#if DARWIN
asm volatile (
"pushl %%ebx \n"
"cpuid \n"
@@ -41,6 +42,14 @@ unsigned int cpuid(unsigned int op)
: "a" (op)
: "cc"
);
+#else
+ asm volatile (
+ "cpuid"
+ : "=a" (ret), "=b" (dummy2), "=c" (dummy3), "=d" (dummy4)
+ : "a" (op)
+ : "cc"
+ );
+#endif
return ret;
}