diff options
author | nyan <nyan@FreeBSD.org> | 2006-04-21 12:12:21 +0000 |
---|---|---|
committer | nyan <nyan@FreeBSD.org> | 2006-04-21 12:12:21 +0000 |
commit | 13a5c9f63cd168426983da045bd3b55af2d756b0 (patch) | |
tree | ae0c5008bd9356c5a709864b25c860c3cba6c129 /sys/pc98 | |
parent | 7921291f4909f6e01d444ad12e3801a00ebf5257 (diff) | |
download | FreeBSD-src-13a5c9f63cd168426983da045bd3b55af2d756b0.zip FreeBSD-src-13a5c9f63cd168426983da045bd3b55af2d756b0.tar.gz |
MFi386: revision 1.625.
Diffstat (limited to 'sys/pc98')
-rw-r--r-- | sys/pc98/pc98/machdep.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/sys/pc98/pc98/machdep.c b/sys/pc98/pc98/machdep.c index fe6cfa5..1a47ed8 100644 --- a/sys/pc98/pc98/machdep.c +++ b/sys/pc98/pc98/machdep.c @@ -1232,9 +1232,22 @@ cpu_setregs(void) unsigned int cr0; cr0 = rcr0(); + /* - * CR0_MP, CR0_NE and CR0_TS are also set by npx_probe() for the - * BSP. See the comments there about why we set them. + * CR0_MP, CR0_NE and CR0_TS are set for NPX (FPU) support: + * + * Prepare to trap all ESC (i.e., NPX) instructions and all WAIT + * instructions. We must set the CR0_MP bit and use the CR0_TS + * bit to control the trap, because setting the CR0_EM bit does + * not cause WAIT instructions to trap. It's important to trap + * WAIT instructions - otherwise the "wait" variants of no-wait + * control instructions would degenerate to the "no-wait" variants + * after FP context switches but work correctly otherwise. It's + * particularly important to trap WAITs when there is no NPX - + * otherwise the "wait" variants would always degenerate. + * + * Try setting CR0_NE to get correct error reporting on 486DX's. + * Setting it should fail or do nothing on lesser processors. */ cr0 |= CR0_MP | CR0_NE | CR0_TS | CR0_WP | CR0_AM; load_cr0(cr0); |