add "cpu classes" in addition to cpu names, put cpu names in table, along
with mapping to classes. this is for upgraded cpu-id code coming "soon"
This commit is contained in:
parent
171495eaa4
commit
253169d468
|
@ -35,7 +35,7 @@
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* from: @(#)machdep.c 7.4 (Berkeley) 6/3/91
|
* from: @(#)machdep.c 7.4 (Berkeley) 6/3/91
|
||||||
* $Id: machdep.c,v 1.17 1993/05/20 15:36:40 cgd Exp $
|
* $Id: machdep.c,v 1.18 1993/05/21 12:23:31 cgd Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "param.h"
|
#include "param.h"
|
||||||
|
@ -248,48 +248,64 @@ again:
|
||||||
configure();
|
configure();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
struct cpu_nameclass i386_cpus[] = {
|
||||||
|
{ "Intel 80286", CPUCLASS_286 }, /* CPU_286 */
|
||||||
|
{ "i386SX", CPUCLASS_386 }, /* CPU_386SX */
|
||||||
|
{ "i386DX", CPUCLASS_386 }, /* CPU_386 */
|
||||||
|
{ "i486SX", CPUCLASS_486 }, /* CPU_486SX */
|
||||||
|
{ "i486DX", CPUCLASS_486 }, /* CPU_486 */
|
||||||
|
{ "i586", CPUCLASS_586 }, /* CPU_586 */
|
||||||
|
};
|
||||||
|
|
||||||
identifycpu() /* translated from hp300 -- cgd */
|
identifycpu() /* translated from hp300 -- cgd */
|
||||||
{
|
{
|
||||||
|
int class;
|
||||||
|
|
||||||
printf("CPU: ");
|
printf("CPU: ");
|
||||||
switch (cpu) {
|
if (cpu >= 0 && cpu < (sizeof i386_cpus/sizeof(struct cpu_nameclass))) {
|
||||||
case CPU_386SX:
|
printf("%s", i386_cpus[cpu].cpu_name);
|
||||||
printf("i386SX");
|
class = i386_cpus[cpu].cpu_class;
|
||||||
break;
|
} else {
|
||||||
case CPU_386:
|
|
||||||
printf("i386");
|
|
||||||
break;
|
|
||||||
case CPU_486SX:
|
|
||||||
printf("i486SX");
|
|
||||||
break;
|
|
||||||
case CPU_486:
|
|
||||||
printf("i486");
|
|
||||||
break;
|
|
||||||
case CPU_586:
|
|
||||||
printf("i586");
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
printf("unknown cpu type %d\n", cpu);
|
printf("unknown cpu type %d\n", cpu);
|
||||||
panic("startup: bad cpu id");
|
panic("startup: bad cpu id");
|
||||||
}
|
}
|
||||||
|
printf(" (");
|
||||||
|
switch(class) {
|
||||||
|
case CPUCLASS_286:
|
||||||
|
printf("286");
|
||||||
|
break;
|
||||||
|
case CPUCLASS_386:
|
||||||
|
printf("386");
|
||||||
|
break;
|
||||||
|
case CPUCLASS_486:
|
||||||
|
printf("486");
|
||||||
|
break;
|
||||||
|
case CPUCLASS_586:
|
||||||
|
printf("586");
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
printf("unknown"); /* will panic below... */
|
||||||
|
}
|
||||||
|
printf("-class CPU)");
|
||||||
printf("\n"); /* cpu speed would be nice, but how? */
|
printf("\n"); /* cpu speed would be nice, but how? */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Now that we have told the user what they have,
|
* Now that we have told the user what they have,
|
||||||
* let them know if that machine type isn't configured.
|
* let them know if that machine type isn't configured.
|
||||||
*/
|
*/
|
||||||
switch (cpu) {
|
switch (class) {
|
||||||
case -1: /* keep compilers happy */
|
case CPUCLASS_286: /* a 286 should not make it this far, anyway */
|
||||||
#if !defined(I386_CPU)
|
#if !defined(I386_CPU)
|
||||||
case CPU_386SX:
|
case CPUCLASS_386:
|
||||||
case CPU_386:
|
|
||||||
#endif
|
#endif
|
||||||
#if !defined(I486_CPU)
|
#if !defined(I486_CPU)
|
||||||
case CPU_486SX:
|
case CPUCLASS_486:
|
||||||
case CPU_486:
|
|
||||||
#endif
|
#endif
|
||||||
#if !defined(I586_CPU)
|
#if !defined(I586_CPU)
|
||||||
case CPU_586:
|
case CPUCLASS_586:
|
||||||
#endif
|
#endif
|
||||||
panic("CPU type not configured");
|
panic("CPU class not configured");
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,7 +34,7 @@
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* from: @(#)cpu.h 5.4 (Berkeley) 5/9/91
|
* from: @(#)cpu.h 5.4 (Berkeley) 5/9/91
|
||||||
* $Id: cpu.h,v 1.5 1993/05/21 11:06:37 cgd Exp $
|
* $Id: cpu.h,v 1.6 1993/05/21 12:26:03 cgd Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -103,6 +103,12 @@ int want_resched; /* resched() was called */
|
||||||
*/
|
*/
|
||||||
#include "machine/cputypes.h"
|
#include "machine/cputypes.h"
|
||||||
|
|
||||||
|
struct cpu_nameclass {
|
||||||
|
char *cpu_name;
|
||||||
|
int cpu_class;
|
||||||
|
};
|
||||||
|
|
||||||
#ifdef KERNEL
|
#ifdef KERNEL
|
||||||
extern int cpu;
|
extern int cpu;
|
||||||
|
extern struct cpu_nameclass i386_cpus[];
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -24,15 +24,26 @@
|
||||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* $Id: cputypes.h,v 1.1 1993/05/21 11:06:40 cgd Exp $
|
* $Id: cputypes.h,v 1.2 1993/05/21 12:26:04 cgd Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Classes of Processor
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define CPUCLASS_286 0
|
||||||
|
#define CPUCLASS_386 1
|
||||||
|
#define CPUCLASS_486 2
|
||||||
|
#define CPUCLASS_586 3
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Kinds of Processor
|
* Kinds of Processor
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define CPU_386SX 0
|
#define CPU_286 0 /* Intel 80286 */
|
||||||
#define CPU_386 1
|
#define CPU_386SX 1 /* Intel 80386SX */
|
||||||
#define CPU_486SX 2
|
#define CPU_386 2 /* Intel 80386DX */
|
||||||
#define CPU_486 3
|
#define CPU_486SX 3 /* Intel 80486SX */
|
||||||
#define CPU_586 4
|
#define CPU_486 4 /* Intel 80486DX */
|
||||||
|
#define CPU_586 5 /* Intel P.....m (I hate lawyers; it's TM) */
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue