summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkato <kato@FreeBSD.org>1998-01-27 08:12:09 +0000
committerkato <kato@FreeBSD.org>1998-01-27 08:12:09 +0000
commit7a6d3914c386d52c97a9c61f28c4e28f617860d4 (patch)
treeabc6cebf4624921af2e4fb3f7893b15996bf7fa8
parent3599f91c1ddcf7dd8de06c2a97c82e421b911732 (diff)
downloadFreeBSD-src-7a6d3914c386d52c97a9c61f28c4e28f617860d4.zip
FreeBSD-src-7a6d3914c386d52c97a9c61f28c4e28f617860d4.tar.gz
Execute cpuid if BIOS disables cpuid instruction of Cyrix 6x86MX CPU.
-rw-r--r--sys/amd64/amd64/identcpu.c17
-rw-r--r--sys/i386/i386/identcpu.c17
2 files changed, 26 insertions, 8 deletions
diff --git a/sys/amd64/amd64/identcpu.c b/sys/amd64/amd64/identcpu.c
index 359eed2..8869f97 100644
--- a/sys/amd64/amd64/identcpu.c
+++ b/sys/amd64/amd64/identcpu.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* from: Id: machdep.c,v 1.193 1996/06/18 01:22:04 bde Exp
- * $Id: identcpu.c,v 1.40 1998/01/25 17:01:31 kato Exp $
+ * $Id: identcpu.c,v 1.41 1998/01/25 23:45:33 kato Exp $
*/
#include "opt_cpu.h"
@@ -664,6 +664,8 @@ void
finishidentcpu(void)
{
int isblue = 0;
+ u_char ccr3;
+ u_long regs[4];
if (strcmp(cpu_vendor, "CyrixInstead") == 0) {
if (cpu == CPU_486) {
@@ -719,11 +721,18 @@ finishidentcpu(void)
default:
/* M2 and later CPUs are treated as M2. */
cpu = CPU_M2;
+
/*
- * XXX
- * Execute cpuid instrunction here and fix cpu_id and
- * cpu_feature variables.
+ * enable cpuid instruction.
*/
+ ccr3 = read_cyrix_reg(CCR3);
+ write_cyrix_reg(CCR3, CCR3_MAPEN0);
+ write_cyrix_reg(CCR4, read_cyrix_reg(CCR4) | CCR4_CPUID);
+ write_cyrix_reg(CCR3, ccr3);
+
+ do_cpuid(1, regs);
+ cpu_id = regs[0]; /* eax */
+ cpu_feature = regs[3]; /* edx */
break;
}
}
diff --git a/sys/i386/i386/identcpu.c b/sys/i386/i386/identcpu.c
index 359eed2..8869f97 100644
--- a/sys/i386/i386/identcpu.c
+++ b/sys/i386/i386/identcpu.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* from: Id: machdep.c,v 1.193 1996/06/18 01:22:04 bde Exp
- * $Id: identcpu.c,v 1.40 1998/01/25 17:01:31 kato Exp $
+ * $Id: identcpu.c,v 1.41 1998/01/25 23:45:33 kato Exp $
*/
#include "opt_cpu.h"
@@ -664,6 +664,8 @@ void
finishidentcpu(void)
{
int isblue = 0;
+ u_char ccr3;
+ u_long regs[4];
if (strcmp(cpu_vendor, "CyrixInstead") == 0) {
if (cpu == CPU_486) {
@@ -719,11 +721,18 @@ finishidentcpu(void)
default:
/* M2 and later CPUs are treated as M2. */
cpu = CPU_M2;
+
/*
- * XXX
- * Execute cpuid instrunction here and fix cpu_id and
- * cpu_feature variables.
+ * enable cpuid instruction.
*/
+ ccr3 = read_cyrix_reg(CCR3);
+ write_cyrix_reg(CCR3, CCR3_MAPEN0);
+ write_cyrix_reg(CCR4, read_cyrix_reg(CCR4) | CCR4_CPUID);
+ write_cyrix_reg(CCR3, ccr3);
+
+ do_cpuid(1, regs);
+ cpu_id = regs[0]; /* eax */
+ cpu_feature = regs[3]; /* edx */
break;
}
}
OpenPOWER on IntegriCloud