summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorKATO Takenori <kato@FreeBSD.org>1998-01-25 17:01:31 +0000
committerKATO Takenori <kato@FreeBSD.org>1998-01-25 17:01:31 +0000
commit2f5a8c876ad8de7e2322937c217f25b60cec0bc5 (patch)
tree6cb613590e7a66f7d32b94d3f2e30f99411cae55 /sys
parent9e7a1d01b0ee05bf48bc2322cfa6e8dd2e6f765d (diff)
Notes
Diffstat (limited to 'sys')
-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 cbb9b8a2f25d..0b190f39cf14 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.38 1998/01/03 05:43:37 obrien Exp $
+ * $Id: identcpu.c,v 1.39 1998/01/25 12:01:10 kato Exp $
*/
#include "opt_cpu.h"
@@ -664,6 +664,8 @@ void
finishidentcpu(void)
{
int isblue = 0;
+ u_int ccr3;
+ u_int eax, ebx, ecx, edx;
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;
+ eax = 1;
+
/*
- * 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);
+ cpuid(&eax, &ebx, &ecx, &edx);
+ cpu_id = eax;
+ cpu_feature = edx;
break;
}
}
diff --git a/sys/i386/i386/identcpu.c b/sys/i386/i386/identcpu.c
index cbb9b8a2f25d..0b190f39cf14 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.38 1998/01/03 05:43:37 obrien Exp $
+ * $Id: identcpu.c,v 1.39 1998/01/25 12:01:10 kato Exp $
*/
#include "opt_cpu.h"
@@ -664,6 +664,8 @@ void
finishidentcpu(void)
{
int isblue = 0;
+ u_int ccr3;
+ u_int eax, ebx, ecx, edx;
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;
+ eax = 1;
+
/*
- * 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);
+ cpuid(&eax, &ebx, &ecx, &edx);
+ cpu_id = eax;
+ cpu_feature = edx;
break;
}
}