// return r;
}
-static void amd_identify(struct cpuinfo_x86 * c)
-{
- u32 xlvl;
-
- if (have_cpuid_p()) {
- generic_identify(c);
-
- /* AMD-defined flags: level 0x80000001 */
- xlvl = cpuid_eax(0x80000000);
- if ( (xlvl & 0xffff0000) == 0x80000000 ) {
- if ( xlvl >= 0x80000001 )
- c->x86_capability[1] = cpuid_edx(0x80000001);
- if ( xlvl >= 0x80000004 )
- get_model_name(c); /* Default name */
- }
- }
-}
-
static unsigned int amd_size_cache(struct cpuinfo_x86 * c, unsigned int size)
{
/* AMD errata T13 (order #21922) */
},
},
.c_init = init_amd,
- .c_identify = amd_identify,
+ .c_identify = generic_identify,
.c_size_cache = amd_size_cache,
};
void __init generic_identify(struct cpuinfo_x86 * c)
{
- u32 tfms;
+ u32 tfms, xlvl;
int junk;
if (have_cpuid_p()) {
/* Have CPUID level 0 only - unheard of */
c->x86 = 4;
}
+
+ /* AMD-defined flags: level 0x80000001 */
+ xlvl = cpuid_eax(0x80000000);
+ if ( (xlvl & 0xffff0000) == 0x80000000 ) {
+ if ( xlvl >= 0x80000001 )
+ c->x86_capability[1] = cpuid_edx(0x80000001);
+ if ( xlvl >= 0x80000004 )
+ get_model_name(c); /* Default name */
+ }
}
}
}
#endif
- get_model_name(c);
if (c->cpuid_level > 1) {
/* supports eax=2 call */
wrmsr(0x80860004, ~0, uk);
c->x86_capability[0] = cpuid_edx(0x00000001);
wrmsr(0x80860004, cap_mask, uk);
+
+ /* If we can run i686 user-space code, call us an i686 */
+#define USER686 (X86_FEATURE_TSC|X86_FEATURE_CX8|X86_FEATURE_CMOV)
+ if ( c->x86 == 5 && (c->x86_capability[0] & USER686) == USER686 )
+ c->x86 = 6;
}
static void transmeta_identify(struct cpuinfo_x86 * c)