diff options
-rw-r--r-- | util/inteltool/cpu.c | 9 | ||||
-rw-r--r-- | util/inteltool/inteltool.c | 2 |
2 files changed, 10 insertions, 1 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; } diff --git a/util/inteltool/inteltool.c b/util/inteltool/inteltool.c index c8fa6ac4fb..d7bd6c08f6 100644 --- a/util/inteltool/inteltool.c +++ b/util/inteltool/inteltool.c @@ -57,7 +57,7 @@ void *map_physical(unsigned long phys_addr, int len) fd_mem, (off_t) phys_addr); if (virt_addr == MAP_FAILED) { - printf("Error mapping physical memory 0x%08x[0x%x]\n", phys_addr, len); + printf("Error mapping physical memory 0x%08lx[0x%x]\n", phys_addr, len); return NULL; } |