X-Git-Url: http://wien.tomnetworks.com/gitweb/?p=coreboot.git;a=blobdiff_plain;f=util%2Finteltool%2Fcpu.c;h=20748bda44b0d3b39bfaf118e5f50783aa5b4aca;hp=9037d5df66fe1af08fea89315a13597adaae0387;hb=9beb5df3c4c35ddefa35742633a7876852065fae;hpb=5782fee0e14557963149c47ad07cf1d235196f67 diff --git a/util/inteltool/cpu.c b/util/inteltool/cpu.c index 9037d5df6..20748bda4 100644 --- a/util/inteltool/cpu.c +++ b/util/inteltool/cpu.c @@ -26,6 +26,12 @@ #include "inteltool.h" +#ifdef __x86_64__ +# define BREG "%%rbx" +#else +# define BREG "%%ebx" +#endif + int fd_msr; unsigned int cpuid(unsigned int op) @@ -34,9 +40,9 @@ unsigned int cpuid(unsigned int op) #if defined(__PIC__) || defined(__DARWIN__) && !defined(__LP64__) asm volatile ( - "pushl %%ebx\n" - "cpuid\n" - "popl %%ebx\n" + "push " BREG "\n\t" + "cpuid\n\t" + "pop " BREG "\n\t" : "=a" (ret) : "a" (op) : "%ecx", "%edx" ); #else