Module Name:    src
Committed By:   mrg
Date:           Thu May 12 05:42:22 UTC 2011

Modified Files:
        src/sys/arch/sparc64/sparc64: autoconf.c

Log Message:
first steps towards fujitsu SPARC64 support:

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


To generate a diff of this commit:
cvs rdiff -u -r1.176 -r1.177 src/sys/arch/sparc64/sparc64/autoconf.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/sparc64/sparc64/autoconf.c
diff -u src/sys/arch/sparc64/sparc64/autoconf.c:1.176 src/sys/arch/sparc64/sparc64/autoconf.c:1.177
--- src/sys/arch/sparc64/sparc64/autoconf.c:1.176	Wed Aug 11 19:14:26 2010
+++ src/sys/arch/sparc64/sparc64/autoconf.c	Thu May 12 05:42:22 2011
@@ -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);

Reply via email to