X-Git-Url: https://git.ozlabs.org/?a=blobdiff_plain;f=ccan%2Fcpuid%2Fcpuid.c;h=df9b4aafc530268f96280e9bf52260c7477765dc;hb=715de3cf272d057e176d032986db45d2270494fc;hp=bc44fcf2f9d7c264071cbc3cf67cf2e31022670c;hpb=0e528772db367034b41b693336ffee8bc765a62f;p=ccan diff --git a/ccan/cpuid/cpuid.c b/ccan/cpuid/cpuid.c index bc44fcf2..df9b4aaf 100644 --- a/ccan/cpuid/cpuid.c +++ b/ccan/cpuid/cpuid.c @@ -29,7 +29,6 @@ #include "cpuid.h" #include -#include enum { CPU_PROC_BRAND_STRING_INTERNAL0 = 0x80000003, @@ -161,8 +160,8 @@ bool cpuid_is_supported(void) pushfd pop eax xor eax, ecx - shr eax, 0x21 - and eax, 0x1 + shr eax, 21 + and eax, 1 push ecx popfd @@ -318,7 +317,12 @@ void cpuid(cpuid_t info, uint32_t *buf) buf[5] = edx; /* Feature flags #1. */ buf[6] = ecx; /* Feature flags #2. */ - buf[7] = ebx; /* Additional feature information. */ + + /* 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;