X-Git-Url: https://git.ozlabs.org/?a=blobdiff_plain;f=ccan%2Fcpuid%2Fcpuid.c;h=6133e13f03c420144348f8d08ea9901d643985f9;hb=c9345f68da9df5b5aa499d77cd31dc0bc9fc45d7;hp=d6d27799e9383ae0b777a225691358c67857cd69;hpb=b0851b56f25f082ff3753e678c2ce15abc543ca9;p=ccan diff --git a/ccan/cpuid/cpuid.c b/ccan/cpuid/cpuid.c index d6d27799..6133e13f 100644 --- a/ccan/cpuid/cpuid.c +++ b/ccan/cpuid/cpuid.c @@ -62,8 +62,8 @@ static void ___cpuid(cpuid_t info, uint32_t *eax, uint32_t *ebx, uint32_t *ecx, #endif static struct { - int feature; - unsigned mask; + uint32_t feature; + uint32_t mask; bool use_edx; /* ecx will be used if false. */ } features[] = { { CF_MMX, 1 << 23, true }, @@ -152,7 +152,7 @@ bool cpuid_has_feature(int feature, bool extended) return has_feature(feature, ecx, edx); } -static const char *cpuids[] = { +static const char *const cpuids[] = { "Nooooooooone", "AMDisbetter!", "AuthenticAMD", @@ -260,6 +260,10 @@ void cpuid(cpuid_t info, uint32_t *buf) buf[1] = ecx; break; case CPU_L1_CACHE_AND_TLB_IDS: + buf[0] = eax; + buf[1] = ebx; + buf[2] = ecx; + buf[3] = edx; break; case CPU_EXTENDED_L2_CACHE_FEATURES: *buf = ecx;