X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/misc/blobdiff_plain/92f7c0021fcd48f17b0d48880937ded81db0bf89..0f5c5dd0eaf183ab7ed091c366f068ee6c6184e9:/x86-model.c diff --git a/x86-model.c b/x86-model.c index 59640c7..05c47c6 100644 --- a/x86-model.c +++ b/x86-model.c @@ -32,7 +32,7 @@ #include #include -#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), @@ -84,7 +85,7 @@ static void identify(unsigned f) if (family == 0x06 || family == 0x0f) printf(" (base = %d, extended = %d)", model, extmodel); putchar('\n'); - printf("stepping = %d\n", type); + printf("stepping = %d\n", stepping); } }