From owner-FreeBSD-tech-jp@jp.freebsd.org  Sat Feb 15 05:45:03 1997
Received: by jaz.jp.freebsd.org (8.8.5+2.7Wbeta5/8.7.3) id FAA08519
	Sat, 15 Feb 1997 05:45:03 +0900 (JST)
Received: by jaz.jp.freebsd.org (8.8.5+2.7Wbeta5/8.7.3) with ESMTP id FAA08508
	for <FreeBSD-tech-jp@jp.freebsd.org>; Sat, 15 Feb 1997 05:45:02 +0900 (JST)
Received: from marble.eps.nagoya-u.ac.jp (localhost [127.0.0.1]) by marble.eps.nagoya-u.ac.jp (8.7.6/3.4W4) with ESMTP id FAA00576; Sat, 15 Feb 1997 05:45:01 +0900 (JST)
Message-Id: <199702142045.FAA00576@marble.eps.nagoya-u.ac.jp>
To: FreeBSD-tech-jp@jp.freebsd.org
Cc: iwasaki@pc.jaring.my
In-Reply-To: Your message of "Sat, 15 Feb 1997 05:38:24 +0900"
References: <199702142038.FAA00539@marble.eps.nagoya-u.ac.jp>
X-Mailer: Mew version 1.54 on Emacs 19.28.1, Mule 2.3
X-PGP-Fingerprint: 03 72 85 36 62 46 23 03  52 B1 10 22 44 10 0D 9E
Mime-Version: 1.0
Content-Type: Text/Plain; charset=iso-2022-jp
Content-Transfer-Encoding: 7bit
Date: Sat, 15 Feb 1997 05:45:00 +0900
From: KATO Takenori <kato@eclogite.eps.nagoya-u.ac.jp>
Reply-To: FreeBSD-tech-jp@jp.freebsd.org
Precedence: bulk
X-Distribute: distribute [version 2.1 (Alpha) patchlevel=19]
X-Sequence: FreeBSD-tech-jp 72
Subject: [FreeBSD-tech-jp 72] Re: [FINAL] CPU identification routine
Errors-To: owner-FreeBSD-tech-jp@jp.freebsd.org
Sender: owner-FreeBSD-tech-jp@jp.freebsd.org

$B2CF#!wL>Bg4d9[$G$9!%(B

From: KATO Takenori <kato@eclogite.eps.nagoya-u.ac.jp>
Subject: [FreeBSD-tech-jp 71] Re: [FINAL] CPU identification routine
Date: Sat, 15 Feb 1997 05:38:24 +0900

> $B$3$l$r8+$k$H!$DL$jF;$OFCDj$G$-$k$N$G$9$,M}M3$,8+Ev$?$j$^$;$s!%=>Mh$N%+!<(B
> $B%M%k$H@_Dj=g=x$,JQ2=$9$k>l=j$,(B1$B$D$"$k$N$G$9$,!$(B

$B$=$l$G!$$=$NItJ,$r$b$H$KLa$9%Q%C%A$G$9!%(B

---------- BEGIN ----------
*** sys/i386/i386/initcpu.c.ORIG	Sat Feb 15 05:39:21 1997
--- sys/i386/i386/initcpu.c	Sat Feb 15 05:41:13 1997
***************
*** 392,407 ****
  #endif
  	}
  #endif /* PC98 && !UPGRADE_CPU_HW_CACHE */
- 
- 	/*
- 	 * Now we've determined what cpu-type we are, we can enable write
- 	 * protection and alignment checking on i486 cpus and above.
- 	 */
- #if defined(I486_CPU) || defined(I586_CPU) || defined(I686_CPU)
- 	if (cpu_class != CPUCLASS_386) {
- 		load_cr0(rcr0() | CR0_WP | CR0_AM);
- 	}
- #endif
  }
  
  #include "opt_ddb.h"
--- 392,397 ----
*** sys/i386/i386/locore.s.ORIG	Sat Feb 15 05:39:24 1997
--- sys/i386/i386/locore.s	Sat Feb 15 05:40:35 1997
***************
*** 364,369 ****
--- 364,382 ----
  	addl	$(13*4),%esp			/* back to a frame we can return with */
  
  	/*
+ 	 * Now we've run main() and determined what cpu-type we are, we can
+ 	 * enable write protection and alignment checking on i486 cpus and
+ 	 * above.
+ 	 */
+ #if defined(I486_CPU) || defined(I586_CPU) || defined(I686_CPU)
+ 	cmpl    $CPUCLASS_386,_cpu_class
+ 	je	1f
+ 	movl	%cr0,%eax			/* get control word */
+ 	orl	$CR0_WP|CR0_AM,%eax		/* enable i486 features */
+ 	movl	%eax,%cr0			/* and do it */
+ 1:
+ #endif
+ 	/*
  	 * on return from main(), we are process 1
  	 * set up address space and stack so that we can 'return' to user mode
  	 */
---------- END ----------

$B$3$l$G$I$N$h$&$K$J$j$^$9$+!)(B

----
KATO Takenori <kato@eclogite.eps.nagoya-u.ac.jp>
Dept. Earth Planet. Sci., Nagoya Univ.,  Nagoya, 464-01, Japan
PGP public key: finger kato@eclogite.eps.nagoya-u.ac.jp
------------------- Powered by FreeBSD(98) -------------------
