Use now common fpu_probe() and print FPU type per probe result since
it turns out that server and high-end LUNA models actually have MC68882, not MC68881 as basic and standard models: http://www.h2.dion.ne.jp/~dogs/collect/ds/luna.html Also put LUNA model names into cpu_model[] for sysctl(3). (maybe we don't have to consider sysctl backward compatibility on this port ;-)
This commit is contained in:
parent
556c80110c
commit
bebd4e17d1
|
@ -1,5 +1,5 @@
|
|||
#
|
||||
# $NetBSD: files.luna68k,v 1.22 2011/06/12 03:35:43 rmind Exp $
|
||||
# $NetBSD: files.luna68k,v 1.23 2011/11/15 13:25:44 tsutsui Exp $
|
||||
#
|
||||
maxpartitions 8
|
||||
maxusers 2 8 64
|
||||
|
@ -16,6 +16,7 @@ file arch/luna68k/luna68k/pmap_bootstrap.c
|
|||
file arch/luna68k/luna68k/trap.c
|
||||
file arch/m68k/m68k/cacheops.c
|
||||
file arch/m68k/m68k/db_memrw.c ddb | kgdb
|
||||
file arch/m68k/m68k/fpu.c
|
||||
file arch/m68k/m68k/pmap_motorola.c
|
||||
file arch/m68k/m68k/procfs_machdep.c procfs
|
||||
file arch/m68k/m68k/sys_machdep.c
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: locore.s,v 1.44 2011/11/15 10:57:02 tsutsui Exp $ */
|
||||
/* $NetBSD: locore.s,v 1.45 2011/11/15 13:25:44 tsutsui Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1988 University of Utah.
|
||||
|
@ -281,6 +281,9 @@ Lenab1:
|
|||
movl #USRSTACK-4,%a2
|
||||
movl %a2,%usp | init user SP
|
||||
|
||||
/* detect FPU type */
|
||||
jbsr _C_LABEL(fpu_probe)
|
||||
movl %d0,_C_LABEL(fputype)
|
||||
tstl _C_LABEL(fputype) | Have an FPU?
|
||||
jeq Lenab2 | No, skip.
|
||||
clrl %a1@(PCB_FPCTX) | ensure null FP context
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: machdep.c,v 1.85 2011/11/12 13:44:26 tsutsui Exp $ */
|
||||
/* $NetBSD: machdep.c,v 1.86 2011/11/15 13:25:44 tsutsui Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2000 The NetBSD Foundation, Inc.
|
||||
|
@ -31,7 +31,7 @@
|
|||
|
||||
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
|
||||
|
||||
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.85 2011/11/12 13:44:26 tsutsui Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.86 2011/11/15 13:25:44 tsutsui Exp $");
|
||||
|
||||
#include "opt_ddb.h"
|
||||
#include "opt_kgdb.h"
|
||||
|
@ -95,7 +95,7 @@ __KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.85 2011/11/12 13:44:26 tsutsui Exp $")
|
|||
* Info for CTL_HW
|
||||
*/
|
||||
char machine[] = MACHINE;
|
||||
char cpu_model[60];
|
||||
char cpu_model[120];
|
||||
|
||||
/* Our exported CPU info; we can have only one. */
|
||||
struct cpu_info cpu_info_store;
|
||||
|
@ -284,13 +284,28 @@ void
|
|||
identifycpu(void)
|
||||
{
|
||||
extern int cputype;
|
||||
const char *cpu, *model;
|
||||
const char *model, *fpu;
|
||||
|
||||
memset(cpu_model, 0, sizeof(cpu_model));
|
||||
switch (cputype) {
|
||||
case CPU_68030:
|
||||
model ="LUNA-I";
|
||||
cpu = "MC68030 CPU+MMU, MC68881 FPU";
|
||||
switch (fputype) {
|
||||
case FPU_68881:
|
||||
fpu = "MC68881";
|
||||
break;
|
||||
case FPU_68882:
|
||||
fpu = "MC68882";
|
||||
break;
|
||||
case FPU_NONE:
|
||||
fpu = "no";
|
||||
break;
|
||||
default:
|
||||
fpu = "unknown";
|
||||
break;
|
||||
}
|
||||
snprintf(cpu_model, sizeof(cpu_model),
|
||||
"%s (MC68030 CPU+MMU, %s FPU)", model, fpu);
|
||||
machtype = LUNA_I;
|
||||
/* 20MHz 68030 */
|
||||
cpuspeed = 20;
|
||||
|
@ -300,7 +315,9 @@ identifycpu(void)
|
|||
#if defined(M68040)
|
||||
case CPU_68040:
|
||||
model ="LUNA-II";
|
||||
cpu = "MC68040 CPU+MMU+FPU, 4k on-chip physical I/D caches";
|
||||
snprintf(cpu_model, sizeof(cpu_model),
|
||||
"%s (MC68040 CPU+MMU+FPU, 4k on-chip physical I/D caches)",
|
||||
model);
|
||||
machtype = LUNA_II;
|
||||
/* 25MHz 68040 */
|
||||
cpuspeed = 25;
|
||||
|
@ -311,8 +328,7 @@ identifycpu(void)
|
|||
default:
|
||||
panic("unknown CPU type");
|
||||
}
|
||||
strcpy(cpu_model, cpu);
|
||||
printf("%s (%s)\n", model, cpu);
|
||||
printf("%s\n", cpu_model);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in New Issue