]> git.ozlabs.org Git - ccan/blobdiff - ccan/cpuid/cpuid.c
Merge branch 'io'
[ccan] / ccan / cpuid / cpuid.c
index d6d27799e9383ae0b777a225691358c67857cd69..6133e13f03c420144348f8d08ea9901d643985f9 100644 (file)
@@ -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;