- fix hex constant in transmeta code to fit 32 bits.

- char assignment should be '\0'
- factor out some common strings
This commit is contained in:
christos 2002-01-31 17:40:51 +00:00
parent f71c29c50a
commit 7ea0ddda43
1 changed files with 15 additions and 11 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.c,v 1.466 2002/01/24 03:20:28 rafal Exp $ */
/* $NetBSD: machdep.c,v 1.467 2002/01/31 17:40:51 christos Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998, 2000 The NetBSD Foundation, Inc.
@ -76,7 +76,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.466 2002/01/24 03:20:28 rafal Exp $");
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.467 2002/01/31 17:40:51 christos Exp $");
#include "opt_cputype.h"
#include "opt_ddb.h"
@ -1063,7 +1063,7 @@ amd_family5_setup(void)
#define MSR_TMx86_LONGRUN 0x80868010
#define MSR_TMx86_LONGRUN_FLAGS 0x80868011
#define LONGRUN_MODE_MASK(x) ((x) & 0x000000007f)
#define LONGRUN_MODE_MASK(x) ((x) & 0x0000007f)
#define LONGRUN_MODE_RESERVED(x) ((x) & 0xffffff80)
#define LONGRUN_MODE_WRITE(x, y) (LONGRUN_MODE_RESERVED(x) | \
LONGRUN_MODE_MASK(y))
@ -1208,7 +1208,7 @@ transmeta_cpu_info(int cpuno)
do_cpuid(0x80860004, (u_int*) &info[16]);
do_cpuid(0x80860005, (u_int*) &info[32]);
do_cpuid(0x80860006, (u_int*) &info[48]);
info[64] = 0;
info[64] = '\0';
printf("cpu%d: %s\n", cpuno, info);
}
@ -1594,6 +1594,10 @@ amd_cpuid_cpu_cacheinfo(struct cpu_info *ci)
cai->cai_associativity = 0; /* XXX Unknown/reserved */
}
static const char n_support[] =
"NOTICE: this kernel does not support %s CPU class\n";
static const char n_lower[] = "NOTICE: lowering CPU class to %s\n";
void
identifycpu(struct cpu_info *ci)
{
@ -1717,34 +1721,34 @@ identifycpu(struct cpu_info *ci)
#endif
#ifndef I686_CPU
case CPUCLASS_686:
printf("NOTICE: this kernel does not support Pentium Pro CPU class\n");
printf(n_support, "Pentium Pro");
#ifdef I586_CPU
printf("NOTICE: lowering CPU class to i586\n");
printf(n_lower, "i586");
cpu_class = CPUCLASS_586;
break;
#endif
#endif
#ifndef I586_CPU
case CPUCLASS_586:
printf("NOTICE: this kernel does not support Pentium CPU class\n");
printf(n_support, "Pentium");
#ifdef I486_CPU
printf("NOTICE: lowering CPU class to i486\n");
printf(n_lower, "i486");
cpu_class = CPUCLASS_486;
break;
#endif
#endif
#ifndef I486_CPU
case CPUCLASS_486:
printf("NOTICE: this kernel does not support i486 CPU class\n");
printf(n_support, "i486");
#ifdef I386_CPU
printf("NOTICE: lowering CPU class to i386\n");
printf(n_lower, "i386");
cpu_class = CPUCLASS_386;
break;
#endif
#endif
#ifndef I386_CPU
case CPUCLASS_386:
printf("NOTICE: this kernel does not support i386 CPU class\n");
printf(n_support, "i386");
panic("no appropriate CPU class available");
#endif
default: