mini fix to reliably compile inteltool on darwin, and on Linux both on x86/x86_64.
authorStefan Reinauer <stepan@coresystems.de>
Wed, 22 Apr 2009 23:17:44 +0000 (23:17 +0000)
committerStefan Reinauer <stepan@openbios.org>
Wed, 22 Apr 2009 23:17:44 +0000 (23:17 +0000)
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

util/inteltool/cpu.c
util/inteltool/inteltool.c

index bde93dee9db66873d3aab88b251bf238a912e2a6..c1972b77ea3d0a44ae509cc14f623870e9101744 100644 (file)
@@ -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;
 }
 
index c8fa6ac4fb3d432bf188bded24c91f67729399f6..d7bd6c08f64213fc10cb42dbc96484d4f8078632 100644 (file)
@@ -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;
        }