Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/sparc64/sparc64 first steps towards fujitsu SPARC64...



details:   https://anonhg.NetBSD.org/src/rev/c96131d40107
branches:  trunk
changeset: 764922:c96131d40107
user:      mrg <mrg%NetBSD.org@localhost>
date:      Thu May 12 05:42:22 2011 +0000

description:
first steps towards fujitsu SPARC64 support:

- re-add cputyp, default to sun4u
- set cputyp for sun4us or sun4v systems (from openbsd)

diffstat:

 sys/arch/sparc64/sparc64/autoconf.c |  15 +++++++++++++--
 1 files changed, 13 insertions(+), 2 deletions(-)

diffs (50 lines):

diff -r 2173964a0f93 -r c96131d40107 sys/arch/sparc64/sparc64/autoconf.c
--- a/sys/arch/sparc64/sparc64/autoconf.c       Thu May 12 05:42:05 2011 +0000
+++ b/sys/arch/sparc64/sparc64/autoconf.c       Thu May 12 05:42:22 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: autoconf.c,v 1.176 2010/08/11 19:14:26 macallan Exp $ */
+/*     $NetBSD: autoconf.c,v 1.177 2011/05/12 05:42:22 mrg Exp $ */
 
 /*
  * Copyright (c) 1996
@@ -48,7 +48,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.176 2010/08/11 19:14:26 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.177 2011/05/12 05:42:22 mrg Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -137,6 +137,9 @@
 int kgdb_break_at_attach;
 #endif
 
+/* Default to sun4u */
+int cputyp = CPU_SUN4U;
+
 #define        OFPATHLEN       128
 #define        OFNODEKEY       "OFpnode"
 
@@ -254,6 +257,7 @@
 {
        void *bi;
        long bmagic;
+       char buf[32];
 
 #if NKSYMS || defined(DDB) || defined(MODULAR)
        struct btinfo_symtab *bi_sym;
@@ -329,6 +333,13 @@
 #endif
 #endif
 
+       if (OF_getprop(findroot(), "compatible", buf, sizeof(buf)) > 0) {
+               if (strcmp(buf, "sun4us") == 0)
+                       cputyp = CPU_SUN4US;
+               else if (strcmp(buf, "sun4v") == 0)
+                       cputyp = CPU_SUN4V;
+       }
+
        LOOKUP_BOOTINFO(bi_count, BTINFO_DTLB_SLOTS);
        kernel_tlb_slots = bi_count->count;
        LOOKUP_BOOTINFO(bi_tlb, BTINFO_DTLB);



Home | Main Index | Thread Index | Old Index