AMD CPU detection patch.

Patrick St. Jean (psj@cgmlarson.com)
Sat, 28 Jun 1997 17:03:26 -0500 (CDT)


Hi everyone!
I really hate to beat a subject to death a little more like this, but I
was showing off my system to a friend today and he asked me why it said I
had a Pentium 60/66. I've got a little patch here that adds a k5model
function and supporting code to setup.c. It is against the pre-44-3
patch. I'm going to include it in the hopes that it or something like it
ends up in the kernel at some point in time... It seems kind of a shame
that Linux only REALLY id's Intel x86 chips...
Sorry about the gripe... It just bugs me... Anyways, here's that
patch:

--- cut here ---
*** setup.c.origional Sat Jun 28 16:08:21 1997
--- setup.c Sat Jun 28 16:56:19 1997
***************
*** 244,249 ****
--- 244,260 ----
return NULL;
}

+ static const char * k5model(unsigned int nr)
+ {
+ static const char *model[] = {
+ "SSA5 (PR-75, PR-90, PR-100)", "5k86 (PR-120, PR-133)",
+ "5k86 (PR-166)", "5k86 (PR-200)", "", "", "K6"
+ };
+ if (nr < sizeof(model)/sizeof(char *))
+ return model[nr];
+ return NULL;
+ }
+
static const char * i686model(unsigned int nr)
{
static const char *model[] = {
***************
*** 263,269 ****
p = i486model(model);
break;
case 5:
! p = i586model(model);
break;
case 6:
p = i686model(model);
--- 274,284 ----
p = i486model(model);
break;
case 5:
! if(strcmp(x86_vendor_id, "AuthenticAMD") == 0){
! p = k5model(model);
! } else {
! p = i586model(model);
! }
break;
case 6:
p = i686model(model);

--- cut here ---