X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;f=ccan%2Fcpuid%2Fcpuid.c;h=59f7336346cb420e1c162a8d94e0610b15307d08;hb=dce6f0fa3177fbed4797e13173918309abb3cb5f;hp=57883e2bd0982b17fccdeaf34fd5da945c1134ea;hpb=ef47a9814be99eb66c906c01a36dd19e3a5f69ee;p=ccan diff --git a/ccan/cpuid/cpuid.c b/ccan/cpuid/cpuid.c index 57883e2b..59f73363 100644 --- a/ccan/cpuid/cpuid.c +++ b/ccan/cpuid/cpuid.c @@ -309,10 +309,20 @@ void cpuid(cpuid_t info, uint32_t *buf) buf[2] = ecx; break; case CPU_PROCINFO_AND_FEATUREBITS: - buf[0] = eax; /* The so called "signature" of the CPU. */ - buf[1] = edx; /* Feature flags #1. */ - buf[2] = ecx; /* Feature flags #2. */ - buf[3] = ebx; /* Additional feature information. */ + buf[0] = (eax & 0x0F); /* Stepping */ + buf[1] = (eax >> 4) & 0x0F; /* Model */ + buf[2] = (eax >> 8) & 0x0F; /* Family */ + buf[3] = (eax >> 16) & 0x0F; /* Extended Model. */ + buf[4] = (eax >> 24) & 0x0F; /* Extended Family. */ + + buf[5] = edx; /* Feature flags #1. */ + buf[6] = ecx; /* Feature flags #2. */ + + /* Additional Feature information. */ + buf[7] = ebx & 0xFF; + buf[8] = (ebx >> 8) & 0xFF; + buf[9] = (ebx >> 16) & 0xFF; + buf[10] = (ebx >> 24) & 0xFF; break; case CPU_CACHE_AND_TLBD_INFO: buf[0] = eax;