CVS commit: src/sys/arch/newsmips/newsmips

2014-11-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Nov 24 04:06:13 UTC 2014

Modified Files:
src/sys/arch/newsmips/newsmips: machdep.c

Log Message:
avoid shadowing a new global.


To generate a diff of this commit:
cvs rdiff -u -r1.115 -r1.116 src/sys/arch/newsmips/newsmips/machdep.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/newsmips/newsmips/machdep.c
diff -u src/sys/arch/newsmips/newsmips/machdep.c:1.115 src/sys/arch/newsmips/newsmips/machdep.c:1.116
--- src/sys/arch/newsmips/newsmips/machdep.c:1.115	Mon Mar 24 16:05:20 2014
+++ src/sys/arch/newsmips/newsmips/machdep.c	Sun Nov 23 23:06:13 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.115 2014/03/24 20:05:20 christos Exp $	*/
+/*	$NetBSD: machdep.c,v 1.116 2014/11/24 04:06:13 christos Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -39,7 +39,7 @@
 
 #include 			/* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.115 2014/03/24 20:05:20 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.116 2014/11/24 04:06:13 christos Exp $");
 
 /* from: Utah Hdr: machdep.c 1.63 91/04/24 */
 
@@ -196,7 +196,7 @@ mach_init(int x_boothowto, int x_bootdev
 #ifdef news5000
 	if (systype == NEWS5000) {
 		int i;
-		char *bootspec = (char *)x_bootdev;
+		char *bspec = (char *)x_bootdev;
 
 		if (bi_arg == NULL)
 			panic("news5000 requires BTINFO_BOOTARG to boot");
@@ -204,21 +204,21 @@ mach_init(int x_boothowto, int x_bootdev
 		_sip = (void *)bi_arg->sip;
 		x_maxmem = _sip->apbsi_memsize;
 		x_maxmem -= 0x0010;	/* reserve 1MB for ROM monitor */
-		if (strncmp(bootspec, "scsi", 4) == 0) {
+		if (strncmp(bspec, "scsi", 4) == 0) {
 			x_bootdev = (5 << 28) | 0;	 /* magic, sd */
-			bootspec += 4;
-			if (*bootspec != '(' /*)*/)
+			bspec += 4;
+			if (*bspec != '(' /*)*/)
 goto bootspec_end;
-			i = strtoul(bootspec + 1, &bootspec, 10);
+			i = strtoul(bspec + 1, &bspec, 10);
 			x_bootdev |= (i << 24);		/* bus */
-			if (*bootspec != ',')
+			if (*bspec != ',')
 goto bootspec_end;
-			i = strtoul(bootspec + 1, &bootspec, 10);
+			i = strtoul(bspec + 1, &bspec, 10);
 			x_bootdev |= (i / 10) << 20;	/* controller */
 			x_bootdev |= (i % 10) << 16;	/* unit */
-			if (*bootspec != ',')
+			if (*bspec != ',')
 goto bootspec_end;
-			i = strtoul(bootspec + 1, &bootspec, 10);
+			i = strtoul(bspec + 1, &bspec, 10);
 			x_bootdev |= (i << 8);		/* partition */
 		}
  bootspec_end:



CVS commit: src/sys/arch/newsmips/newsmips

2011-03-10 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Thu Mar 10 15:40:36 UTC 2011

Modified Files:
src/sys/arch/newsmips/newsmips: news3400.c news5000.c

Log Message:
Set correct struct clockframe .intr value for hardclock(9).


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/newsmips/newsmips/news3400.c
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/newsmips/newsmips/news5000.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/newsmips/newsmips/news3400.c
diff -u src/sys/arch/newsmips/newsmips/news3400.c:1.21 src/sys/arch/newsmips/newsmips/news3400.c:1.22
--- src/sys/arch/newsmips/newsmips/news3400.c:1.21	Wed Mar  9 13:21:36 2011
+++ src/sys/arch/newsmips/newsmips/news3400.c	Thu Mar 10 15:40:36 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: news3400.c,v 1.21 2011/03/09 13:21:36 tsutsui Exp $	*/
+/*	$NetBSD: news3400.c,v 1.22 2011/03/10 15:40:36 tsutsui Exp $	*/
 
 /*-
  * Copyright (C) 1999 Tsubai Masanari.  All rights reserved.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: news3400.c,v 1.21 2011/03/09 13:21:36 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: news3400.c,v 1.22 2011/03/10 15:40:36 tsutsui Exp $");
 
 #define __INTR_PRIVATE
 #include 
@@ -102,7 +102,7 @@
 struct clockframe cf = {
 	.pc = pc,
 	.sr = status,
-	.intr = (curcpu()->ci_idepth > 0),
+	.intr = (curcpu()->ci_idepth > 1),
 };
 hardclock(&cf);
 intrcnt[HARDCLOCK_INTR]++;

Index: src/sys/arch/newsmips/newsmips/news5000.c
diff -u src/sys/arch/newsmips/newsmips/news5000.c:1.19 src/sys/arch/newsmips/newsmips/news5000.c:1.20
--- src/sys/arch/newsmips/newsmips/news5000.c:1.19	Wed Mar  9 13:21:36 2011
+++ src/sys/arch/newsmips/newsmips/news5000.c	Thu Mar 10 15:40:36 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: news5000.c,v 1.19 2011/03/09 13:21:36 tsutsui Exp $	*/
+/*	$NetBSD: news5000.c,v 1.20 2011/03/10 15:40:36 tsutsui Exp $	*/
 
 /*-
  * Copyright (C) 1999 SHIMIZU Ryo.  All rights reserved.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: news5000.c,v 1.19 2011/03/09 13:21:36 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: news5000.c,v 1.20 2011/03/10 15:40:36 tsutsui Exp $");
 
 #define __INTR_PRIVATE
 #include 
@@ -89,7 +89,6 @@
 			static int l2cnt = 0;
 #endif
 			uint32_t int2stat;
-			struct clockframe cf;
 
 			int2stat = *(volatile uint32_t *)NEWS5000_INTST2;
 
@@ -105,11 +104,12 @@
 #endif
 
 			if (int2stat & NEWS5000_INT2_TIMER0) {
+struct clockframe cf = {
+	.pc = pc,
+	.sr = status,
+	.intr = (curcpu()->ci_idepth > 1),
+};
 *(volatile uint32_t *)NEWS5000_TIMER0 = 1;
-
-cf.pc = pc;
-cf.sr = status;
-
 hardclock(&cf);
 intrcnt[HARDCLOCK_INTR]++;
 			}



CVS commit: src/sys/arch/newsmips/newsmips

2011-03-09 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Wed Mar  9 13:21:36 UTC 2011

Modified Files:
src/sys/arch/newsmips/newsmips: autoconf.c machdep.c news3400.c
news5000.c

Log Message:
Fix newsmips interrupt handling for new mips interrupt/spl framework:
 - make news3400_badaddr() work even if interrupts are disabled
   (in the old world bus error interrupt is enabled even during splhigh())
 - make ipl_sr_map values model dependent

Now GENERIC kernel boots to single user properly on R3000 NWS-3470D,
though sh(1) still gets floating point exceptions during /etc/rc scripts.
news5000 is untested (yet).


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sys/arch/newsmips/newsmips/autoconf.c
cvs rdiff -u -r1.112 -r1.113 src/sys/arch/newsmips/newsmips/machdep.c
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/newsmips/newsmips/news3400.c
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/newsmips/newsmips/news5000.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/newsmips/newsmips/autoconf.c
diff -u src/sys/arch/newsmips/newsmips/autoconf.c:1.34 src/sys/arch/newsmips/newsmips/autoconf.c:1.35
--- src/sys/arch/newsmips/newsmips/autoconf.c:1.34	Sun Feb 20 07:56:31 2011
+++ src/sys/arch/newsmips/newsmips/autoconf.c	Wed Mar  9 13:21:36 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: autoconf.c,v 1.34 2011/02/20 07:56:31 matt Exp $	*/
+/*	$NetBSD: autoconf.c,v 1.35 2011/03/09 13:21:36 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -49,7 +49,7 @@
 #define __INTR_PRIVATE
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.34 2011/02/20 07:56:31 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.35 2011/03/09 13:21:36 tsutsui Exp $");
 
 #include 
 #include 
@@ -94,19 +94,14 @@
 	/*
 	 * Kick off autoconfiguration
 	 */
-	spl0();		/* enable all interrupts */
-	splhigh();	/* ...then disable device interrupts */
-
-	if (systype == NEWS3400) {
-		*(char *)INTEN0 = INTEN0_BERR;	/* only buserr occurs */
-		*(char *)INTEN1 = 0;
-	}
+	(*disable_intr)();
+	(void)splhigh();
 
 	if (config_rootfound("mainbus", NULL) == NULL)
 		panic("no mainbus found");
 
 	/* Enable hardware interrupt registers. */
-	enable_intr();
+	(*enable_intr)();
 
 	/* Configuration is finished, turn on interrupts. */
 	spl0();		/* enable all source forcing SOFT_INTs cleared */

Index: src/sys/arch/newsmips/newsmips/machdep.c
diff -u src/sys/arch/newsmips/newsmips/machdep.c:1.112 src/sys/arch/newsmips/newsmips/machdep.c:1.113
--- src/sys/arch/newsmips/newsmips/machdep.c:1.112	Sun Feb 20 07:56:31 2011
+++ src/sys/arch/newsmips/newsmips/machdep.c	Wed Mar  9 13:21:36 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.112 2011/02/20 07:56:31 matt Exp $	*/
+/*	$NetBSD: machdep.c,v 1.113 2011/03/09 13:21:36 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -39,7 +39,7 @@
 
 #include 			/* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.112 2011/02/20 07:56:31 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.113 2011/03/09 13:21:36 tsutsui Exp $");
 
 /* from: Utah Hdr: machdep.c 1.63 91/04/24 */
 
@@ -138,27 +138,6 @@
 extern void stacktrace(void); /*XXX*/
 #endif
 
-/*
- * This is a mask of bits to clear in the SR when we go to a
- * given interrupt priority level.
- */
-const struct ipl_sr_map newsmips_ipl_sr_map = {
-.sr_bits = {
-	[IPL_NONE] =		0,
-	[IPL_SOFTCLOCK] =	MIPS_SOFT_INT_MASK_0,
-	[IPL_SOFTNET] =		MIPS_SOFT_INT_MASK,
-	[IPL_VM] =		MIPS_SOFT_INT_MASK
-| MIPS_INT_MASK_0
-| MIPS_INT_MASK_1,
-	[IPL_SCHED] =		MIPS_SOFT_INT_MASK
-| MIPS_INT_MASK_0
-| MIPS_INT_MASK_1
-| MIPS_INT_MASK_2,
-	[IPL_DDB] =		MIPS_INT_MASK,
-	[IPL_HIGH] =		MIPS_INT_MASK,
-},
-};
-
 extern u_long bootdev;
 extern char edata[], end[];
 
@@ -284,7 +263,6 @@
 	 * Initialize locore-function vector.
 	 * Clear out the I and D caches.
 	 */
-	ipl_sr_map = newsmips_ipl_sr_map;
 	mips_vector_init(NULL, false);
 
 	/*

Index: src/sys/arch/newsmips/newsmips/news3400.c
diff -u src/sys/arch/newsmips/newsmips/news3400.c:1.20 src/sys/arch/newsmips/newsmips/news3400.c:1.21
--- src/sys/arch/newsmips/newsmips/news3400.c:1.20	Sun Feb 20 07:56:31 2011
+++ src/sys/arch/newsmips/newsmips/news3400.c	Wed Mar  9 13:21:36 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: news3400.c,v 1.20 2011/02/20 07:56:31 matt Exp $	*/
+/*	$NetBSD: news3400.c,v 1.21 2011/03/09 13:21:36 tsutsui Exp $	*/
 
 /*-
  * Copyright (C) 1999 Tsubai Masanari.  All rights reserved.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: news3400.c,v 1.20 2011/02/20 07:56:31 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: news3400.c,v 1.21 2011/03/09 13:21:36 tsutsui Exp $");
 
 #define __INTR_PRIVATE
 #include 
@@ -59,6 +59,27 @@
 #define INT_MASK_FPU MIPS_INT_MASK_3
 
 /*
+ * This is a mask of bits to clear in the SR when we go to a
+ * given interrupt priority level.
+ */
+static const struct ipl_sr_map news3400