From mrt  Thu Feb 11 03:24:09 1999
Received: from mana.s.notwork.org (tok075.airnet.ne.jp [210.159.88.75])
          by hub.freebsd.org (8.8.8/8.8.8) with SMTP id DAA00204
          for <freebsd-gnats-submit@freebsd.org>; Thu, 11 Feb 1999 03:24:07 -0800 (PST)
          (envelope-from mrt)
Received: (qmail 661 invoked from network); 11 Feb 1999 11:24:02 -0000
Received: from kotonoha.s.notwork.org (192.168.1.1)
  by mana.s.notwork.org with SMTP; 11 Feb 1999 11:24:02 -0000
Received: (from mrt@localhost)
	by kotonoha.s.notwork.org (8.9.2/3.7W) id UAA00936;
	Thu, 11 Feb 1999 20:24:29 +0900 (JST)
Message-Id: <199902111124.UAA00936@kotonoha.s.notwork.org>
Date: Thu, 11 Feb 1999 20:24:29 +0900 (JST)
From: mrt@notwork.org
Reply-To: mrt@notwork.org
To: FreeBSD-gnats-submit@freebsd.org
Subject: kernel cannot detect WinChips correctly.
X-Send-Pr-Version: 3.2

>Number:         10022
>Category:       kern
>Synopsis:       kernel cannot detect WinChips correctly.
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    green
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Thu Feb 11 03:30:00 PST 1999
>Closed-Date:    Mon Jul 5 23:16:55 PDT 1999
>Last-Modified:  Mon Jul  5 23:27:21 PDT 1999
>Originator:     Murata Shuuichirou
>Release:        FreeBSD 4.0-CURRENT i386
>Organization:
>Environment:
FreeBSD kotonoha.s.notwork.org 4.0-CURRENT FreeBSD 4.0-CURRENT #6: Thu Feb 11 18:24:37 JST 1999     mrt@kotonoha.s.notwork.org:/usr/src/mrt/src/sys/compile/KOTONOHA  i386
>Description:

-current kernel cannot detect IDT's WinChips correctly.

>How-To-Repeat:

Replace your Pentium with a WinChip and boot FreeBSD.

>Fix:
	
According to data sheet, WinChips (C6 and 2) are almost
compatible with Pentium and have no special features on our
use.  So all we have to do is to print the name and features
correctly.  Following patch is tested on WinChip C6.

Index: identcpu.c
===================================================================
RCS file: /home/ncvs/src/sys/i386/i386/identcpu.c,v
retrieving revision 1.58
diff -u -r1.58 identcpu.c
--- identcpu.c	1999/02/04 16:48:25	1.58
+++ identcpu.c	1999/02/05 17:30:53
@@ -457,6 +457,17 @@
 		}
 	} else if (strcmp(cpu_vendor,"IBM") == 0)
 		strcpy(cpu_model, "Blue Lightning CPU");
+	else if (strcmp(cpu_vendor,"CentaurHauls") == 0) {
+		strcpy(cpu_model, "IDT ");
+		switch (cpu_id & 0xff0) {
+		case 0x540:
+			strcat(cpu_model, "WinChip C6");
+			break;
+		case 0x580:
+			strcat(cpu_model, "WinChip 2");
+			break;
+		}
+	}
 #endif
 
 	printf("%s (", cpu_model);
@@ -508,7 +519,8 @@
 	if (strcmp(cpu_vendor, "GenuineIntel") == 0 ||
 	    strcmp(cpu_vendor, "AuthenticAMD") == 0 ||
 		((strcmp(cpu_vendor, "CyrixInstead") == 0) &&
-		 ((cpu_id & 0xf00) > 5))) {
+		 ((cpu_id & 0xf00) > 5)) ||
+	    strcmp(cpu_vendor, "CentaurHauls") == 0) {
 		printf("  Stepping=%u", cpu_id & 0xf);
 		if (strcmp(cpu_vendor, "CyrixInstead") == 0)
 			printf("  DIR=0x%04x", cyrix_did);
>Release-Note:
>Audit-Trail:

From: Kevin Day <toasty@home.dragondata.com>
To: mrt@notwork.org
Cc: FreeBSD-gnats-submit@FreeBSD.ORG
Subject: Re: kern/10022: kernel cannot detect WinChips correctly.
Date: Thu, 11 Feb 1999 13:52:21 -0600 (CST)

 Completely unrelated to this, but i just saw this line... Isn't this a bug?
 
 
 > @@ -508,7 +519,8 @@
 >  	if (strcmp(cpu_vendor, "GenuineIntel") == 0 ||
 >  	    strcmp(cpu_vendor, "AuthenticAMD") == 0 ||
 >  		((strcmp(cpu_vendor, "CyrixInstead") == 0) &&
 > 		 ((cpu_id & 0xf00) > 5))) {
 >  		printf("  Stepping=%u", cpu_id & 0xf);
 >  		if (strcmp(cpu_vendor, "CyrixInstead") == 0)
 >  			printf("  DIR=0x%04x", cyrix_did);
 
 
 Shouldn't that be:
 
  		 ((cpu_id & 0xf00) > 0x500))) {
 
 Or really anything but what is there? Or am I still asleep today?
 
 
 Kevin
 
 
 
 
 
 
State-Changed-From-To: open->feedback 
State-Changed-By: sheldonh 
State-Changed-When: Tue Jun 22 03:47:22 PDT 1999 
State-Changed-Why:  
Could you provide feedback as to whether your patch still works when 
modified as per Kevin Day's suggestion. Alternatively, let us know 
why you changed the bit-value test for cpu_id . 

From: Murata Shuuichirou <mrt@notwork.org>
To: sheldonh@FreeBSD.org
Cc: freebsd-bugs@FreeBSD.org
Subject: Re: kern/10022: kernel cannot detect WinChips correctly.
Date: 24 Jun 1999 01:16:42 +0900

 In message <199906221050.DAA29480@freefall.freebsd.org>,
  `<sheldonh@FreeBSD.org>' wrote:
 > Could you provide feedback as to whether your patch still works when
 > modified as per Kevin Day's suggestion. Alternatively, let us know
 > why you changed the bit-value test for cpu_id .
 
 Kevin Day's suggestion is not related to my change, but it's
 correct and already in identcpu.c.  So, my previous patch is
 now cannot be applied cleanly.  I'll attach the diff from
 current identcpu.c (rev. 1.63).
 
 -- 
 Murata, Shuuichirou
 
 Index: identcpu.c
 ===================================================================
 RCS file: /home/ncvs/src/sys/i386/i386/identcpu.c,v
 retrieving revision 1.63
 diff -u -r1.63 identcpu.c
 --- identcpu.c	1999/05/29 06:57:38	1.63
 +++ identcpu.c	1999/06/23 16:07:02
 @@ -460,6 +460,20 @@
  		}
  	} else if (strcmp(cpu_vendor,"IBM") == 0)
  		strcpy(cpu_model, "Blue Lightning CPU");
 +	else if (strcmp(cpu_vendor, "CentaurHauls") == 0) {
 +		strcpy(cpu_model, "IDT ");
 +		switch (cpu_id & 0xff0) {
 +		case 0x540:
 +			strcat(cpu_model, "WinChip C6");
 +			break;
 +		case 0x580:
 +			strcat(cpu_model, "WinChip 2");
 +			break;
 +		default:
 +			strcat(cpu_model, "Unknown");
 +			break;
 +		}
 +	}
  #endif
  
  	printf("%s (", cpu_model);
 @@ -511,7 +525,8 @@
  	if (strcmp(cpu_vendor, "GenuineIntel") == 0 ||
  	    strcmp(cpu_vendor, "AuthenticAMD") == 0 ||
  		((strcmp(cpu_vendor, "CyrixInstead") == 0) &&
 -		 ((cpu_id & 0xf00) > 0x500))) {
 +		 ((cpu_id & 0xf00) > 0x500)) ||
 +	    strcmp(cpu_vendor, "CentaurHauls") == 0) {
  		printf("  Stepping=%u", cpu_id & 0xf);
  		if (strcmp(cpu_vendor, "CyrixInstead") == 0)
  			printf("  DIR=0x%04x", cyrix_did);
 
 
State-Changed-From-To: feedback->open 
State-Changed-By: sheldonh 
State-Changed-When: Thu Jun 24 01:08:12 PDT 1999 
State-Changed-Why:  
Submitter has corrected diffs for CURRENT. Ready for review. 
Responsible-Changed-From-To: freebsd-bugs->green 
Responsible-Changed-By: sheldonh 
Responsible-Changed-When: Mon Jul 5 23:01:03 PDT 1999 
Responsible-Changed-Why:  
Brian has his hands dirty in the code lately, so hopefully he'll 
take a look at this. 
State-Changed-From-To: open->closed 
State-Changed-By: green 
State-Changed-When: Mon Jul 5 23:16:55 PDT 1999 
State-Changed-Why:  
I sure do have my hands dirty with these files :) It's in 4.0-CURRENT now. It 
will be in 3.2-STABLE and 3.2-PAO soon. 

>Unformatted:
