Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/luna68k Use now common fpu_probe() and print FPU ty...



details:   https://anonhg.NetBSD.org/src/rev/3c72edc980bf
branches:  trunk
changeset: 771231:3c72edc980bf
user:      tsutsui <tsutsui%NetBSD.org@localhost>
date:      Tue Nov 15 13:25:44 2011 +0000

description:
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 ;-)

diffstat:

 sys/arch/luna68k/conf/files.luna68k |   3 ++-
 sys/arch/luna68k/luna68k/locore.s   |   5 ++++-
 sys/arch/luna68k/luna68k/machdep.c  |  32 ++++++++++++++++++++++++--------
 3 files changed, 30 insertions(+), 10 deletions(-)

diffs (116 lines):

diff -r ae138b5627fa -r 3c72edc980bf sys/arch/luna68k/conf/files.luna68k
--- a/sys/arch/luna68k/conf/files.luna68k       Tue Nov 15 12:23:21 2011 +0000
+++ b/sys/arch/luna68k/conf/files.luna68k       Tue Nov 15 13:25:44 2011 +0000
@@ -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/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
diff -r ae138b5627fa -r 3c72edc980bf sys/arch/luna68k/luna68k/locore.s
--- a/sys/arch/luna68k/luna68k/locore.s Tue Nov 15 12:23:21 2011 +0000
+++ b/sys/arch/luna68k/luna68k/locore.s Tue Nov 15 13:25:44 2011 +0000
@@ -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 @@
        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
diff -r ae138b5627fa -r 3c72edc980bf sys/arch/luna68k/luna68k/machdep.c
--- a/sys/arch/luna68k/luna68k/machdep.c        Tue Nov 15 12:23:21 2011 +0000
+++ b/sys/arch/luna68k/luna68k/machdep.c        Tue Nov 15 13:25:44 2011 +0000
@@ -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 @@
  * 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 @@
 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 @@
 #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 @@
        default:
                panic("unknown CPU type");
        }
-       strcpy(cpu_model, cpu);
-       printf("%s (%s)\n", model, cpu);
+       printf("%s\n", cpu_model);
 }
 
 /*



Home | Main Index | Thread Index | Old Index