From 02a6338c263572537dca788b6a20b81d2ac3bc88 Mon Sep 17 00:00:00 2001 From: kato Date: Fri, 20 Aug 1999 09:31:18 +0000 Subject: There may exist two kinds of IBM BlueLightning CPU. One is that 5/2 test does not change undefined flag like Cyrix CPUs. Another is that 5/2 test changes undefined flag like Intel CPUs. Latter one could not be detected and was recognized 486DX CPU. To solve this, finishidentcpu() calls identblue() when cpu_vendor is null string (that is, CPUID instruction is not supported) and cpu == CPU_486. Tests have been done on IBM BlueLightning CPUs, i486SX and i486DX. --- sys/amd64/amd64/identcpu.c | 16 +++++++++++++++- sys/i386/i386/identcpu.c | 16 +++++++++++++++- 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/sys/amd64/amd64/identcpu.c b/sys/amd64/amd64/identcpu.c index 9ed2869..ba53f4e 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.70 1999/07/06 12:42:26 peter Exp $ + * $Id: identcpu.c,v 1.71 1999/07/06 13:23:56 peter Exp $ */ #include "opt_cpu.h" @@ -856,6 +856,20 @@ finishidentcpu(void) break; } } + } else if (cpu == CPU_486 && *cpu_vendor == '\0') { + /* + * There are BlueLightning CPUs that do not change + * undefined flags by dividing 5 by 2. In this case, + * the CPU identification routine in locore.s leaves + * cpu_vendor null string and puts CPU_486 into the + * cpu. + */ + isblue = identblue(); + if (isblue == IDENTBLUE_IBMCPU) { + strcpy(cpu_vendor, "IBM"); + cpu = CPU_BLUE; + return; + } } } diff --git a/sys/i386/i386/identcpu.c b/sys/i386/i386/identcpu.c index 9ed2869..ba53f4e 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.70 1999/07/06 12:42:26 peter Exp $ + * $Id: identcpu.c,v 1.71 1999/07/06 13:23:56 peter Exp $ */ #include "opt_cpu.h" @@ -856,6 +856,20 @@ finishidentcpu(void) break; } } + } else if (cpu == CPU_486 && *cpu_vendor == '\0') { + /* + * There are BlueLightning CPUs that do not change + * undefined flags by dividing 5 by 2. In this case, + * the CPU identification routine in locore.s leaves + * cpu_vendor null string and puts CPU_486 into the + * cpu. + */ + isblue = identblue(); + if (isblue == IDENTBLUE_IBMCPU) { + strcpy(cpu_vendor, "IBM"); + cpu = CPU_BLUE; + return; + } } } -- cgit v1.1