CVS commit: src/sys/arch/evbmips/evbmips

2016-08-26 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Aug 26 07:07:29 UTC 2016

Modified Files:
src/sys/arch/evbmips/evbmips: interrupt.c

Log Message:
Make this reentrant / MP safe


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/evbmips/evbmips/interrupt.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/evbmips/evbmips/interrupt.c
diff -u src/sys/arch/evbmips/evbmips/interrupt.c:1.22 src/sys/arch/evbmips/evbmips/interrupt.c:1.23
--- src/sys/arch/evbmips/evbmips/interrupt.c:1.22	Sat Jun  6 22:22:03 2015
+++ src/sys/arch/evbmips/evbmips/interrupt.c	Fri Aug 26 07:07:29 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: interrupt.c,v 1.22 2015/06/06 22:22:03 matt Exp $	*/
+/*	$NetBSD: interrupt.c,v 1.23 2016/08/26 07:07:29 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: interrupt.c,v 1.22 2015/06/06 22:22:03 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: interrupt.c,v 1.23 2016/08/26 07:07:29 skrll Exp $");
 
 #include 
 #include 
@@ -40,8 +40,6 @@ __KERNEL_RCSID(0, "$NetBSD: interrupt.c,
 #include 
 #include 
 
-struct clockframe cf;
-
 void
 intr_init(void)
 {
@@ -74,12 +72,15 @@ cpu_intr(int ppl, vaddr_t pc, uint32_t s
 		"%s: cpl (%d) != ipl (%d)", __func__, ci->ci_cpl, ipl);
 		KASSERT(pending != 0);
 
-		cf.pc = pc;
-		cf.sr = status;
-		cf.intr = (ci->ci_idepth > 1);
 
 #ifdef MIPS3_ENABLE_CLOCK_INTR
 		if (pending & MIPS_INT_MASK_5) {
+			struct clockframe cf;
+
+			cf.pc = pc;
+			cf.sr = status;
+			cf.intr = (ci->ci_idepth > 1);
+
 			KASSERTMSG(ipl == IPL_SCHED,
 			"%s: ipl (%d) != IPL_SCHED (%d)",
 			 __func__, ipl, IPL_SCHED);



CVS commit: src/sys/arch/evbmips/evbmips

2015-06-26 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Jun 26 21:57:25 UTC 2015

Modified Files:
src/sys/arch/evbmips/evbmips: cpu.c yamon.c

Log Message:
Add #include 


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/evbmips/evbmips/cpu.c
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/evbmips/evbmips/yamon.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/evbmips/evbmips/cpu.c
diff -u src/sys/arch/evbmips/evbmips/cpu.c:1.4 src/sys/arch/evbmips/evbmips/cpu.c:1.5
--- src/sys/arch/evbmips/evbmips/cpu.c:1.4	Tue May 26 02:09:34 2015
+++ src/sys/arch/evbmips/evbmips/cpu.c	Fri Jun 26 21:57:25 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.c,v 1.4 2015/05/26 02:09:34 matt Exp $	*/
+/*	$NetBSD: cpu.c,v 1.5 2015/06/26 21:57:25 matt Exp $	*/
 
 /*
  * Copyright 2002 Wasabi Systems, Inc.
@@ -36,13 +36,15 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.4 2015/05/26 02:09:34 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.5 2015/06/26 21:57:25 matt Exp $");
 
 #include 
 #include 
 #include 
 #include 
 
+#include 
+
 static int	cpu_match(device_t, cfdata_t, void *);
 static void	cpu_attach(device_t, device_t, void *);
 

Index: src/sys/arch/evbmips/evbmips/yamon.c
diff -u src/sys/arch/evbmips/evbmips/yamon.c:1.13 src/sys/arch/evbmips/evbmips/yamon.c:1.14
--- src/sys/arch/evbmips/evbmips/yamon.c:1.13	Sun Feb 20 07:48:34 2011
+++ src/sys/arch/evbmips/evbmips/yamon.c	Fri Jun 26 21:57:25 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: yamon.c,v 1.13 2011/02/20 07:48:34 matt Exp $	*/
+/*	$NetBSD: yamon.c,v 1.14 2015/06/26 21:57:25 matt Exp $	*/
 
 /*
  * Copyright 2002 Wasabi Systems, Inc.
@@ -38,7 +38,7 @@
 /* XXX move to arch/mips/yamon/yamon.c or similar? */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: yamon.c,v 1.13 2011/02/20 07:48:34 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: yamon.c,v 1.14 2015/06/26 21:57:25 matt Exp $");
 
 #include 
 #include 
@@ -48,6 +48,8 @@ __KERNEL_RCSID(0, "$NetBSD: yamon.c,v 1.
 
 #include 
 
+#include 
+
 #include 
 
 static int  yamongetc(dev_t);



CVS commit: src/sys/arch/evbmips/evbmips

2015-06-06 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sat Jun  6 22:22:03 UTC 2015

Modified Files:
src/sys/arch/evbmips/evbmips: interrupt.c

Log Message:
Add a few KDASSERT for interrupts being enabled.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/evbmips/evbmips/interrupt.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/evbmips/evbmips/interrupt.c
diff -u src/sys/arch/evbmips/evbmips/interrupt.c:1.21 src/sys/arch/evbmips/evbmips/interrupt.c:1.22
--- src/sys/arch/evbmips/evbmips/interrupt.c:1.21	Fri Dec 26 18:08:52 2014
+++ src/sys/arch/evbmips/evbmips/interrupt.c	Sat Jun  6 22:22:03 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: interrupt.c,v 1.21 2014/12/26 18:08:52 macallan Exp $	*/
+/*	$NetBSD: interrupt.c,v 1.22 2015/06/06 22:22:03 matt Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: interrupt.c,v 1.21 2014/12/26 18:08:52 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: interrupt.c,v 1.22 2015/06/06 22:22:03 matt Exp $");
 
 #include 
 #include 
@@ -61,11 +61,14 @@ cpu_intr(int ppl, vaddr_t pc, uint32_t s
 	const u_int blcnt = curlwp->l_blcnt;
 #endif
 	KASSERT(ci->ci_cpl == IPL_HIGH);
+	KDASSERT(mips_cp0_status_read() & MIPS_SR_INT_IE);
 
 	ci->ci_data.cpu_nintr++;
 
 	while (ppl < (ipl = splintr(&pending))) {
+		KDASSERT(mips_cp0_status_read() & MIPS_SR_INT_IE);
 		splx(ipl);	/* lower to interrupt level */
+		KDASSERT(mips_cp0_status_read() & MIPS_SR_INT_IE);
 
 		KASSERTMSG(ci->ci_cpl == ipl,
 		"%s: cpl (%d) != ipl (%d)", __func__, ci->ci_cpl, ipl);
@@ -104,4 +107,5 @@ cpu_intr(int ppl, vaddr_t pc, uint32_t s
 	}
 
 	KASSERT(ci->ci_cpl == IPL_HIGH);
+	KDASSERT(mips_cp0_status_read() & MIPS_SR_INT_IE);
 }



CVS commit: src/sys/arch/evbmips/evbmips

2014-12-26 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Fri Dec 26 18:08:52 UTC 2014

Modified Files:
src/sys/arch/evbmips/evbmips: interrupt.c

Log Message:
put #ifdef MIPS3_ENABLE_CLOCK_INTR around special handling of INT5


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/evbmips/evbmips/interrupt.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/evbmips/evbmips/interrupt.c
diff -u src/sys/arch/evbmips/evbmips/interrupt.c:1.20 src/sys/arch/evbmips/evbmips/interrupt.c:1.21
--- src/sys/arch/evbmips/evbmips/interrupt.c:1.20	Sat Nov 22 15:17:02 2014
+++ src/sys/arch/evbmips/evbmips/interrupt.c	Fri Dec 26 18:08:52 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: interrupt.c,v 1.20 2014/11/22 15:17:02 macallan Exp $	*/
+/*	$NetBSD: interrupt.c,v 1.21 2014/12/26 18:08:52 macallan Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: interrupt.c,v 1.20 2014/11/22 15:17:02 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: interrupt.c,v 1.21 2014/12/26 18:08:52 macallan Exp $");
 
 #include 
 #include 
@@ -75,16 +75,16 @@ cpu_intr(int ppl, vaddr_t pc, uint32_t s
 		cf.sr = status;
 		cf.intr = (ci->ci_idepth > 1);
 
+#ifdef MIPS3_ENABLE_CLOCK_INTR
 		if (pending & MIPS_INT_MASK_5) {
 			KASSERTMSG(ipl == IPL_SCHED,
 			"%s: ipl (%d) != IPL_SCHED (%d)",
 			 __func__, ipl, IPL_SCHED);
-#ifdef MIPS3_ENABLE_CLOCK_INTR
 			/* call the common MIPS3 clock interrupt handler */ 
 			mips3_clockintr(&cf);
-#endif
 			pending ^= MIPS_INT_MASK_5;
 		}
+#endif
 
 		if (pending != 0) {
 			/* Process I/O and error interrupts. */



CVS commit: src/sys/arch/evbmips/evbmips

2013-05-14 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Tue May 14 09:16:59 UTC 2013

Modified Files:
src/sys/arch/evbmips/evbmips: interrupt.c

Log Message:
always set up a clockframe and make it available to other drivers, so clocks
other than the MIPS cycle counter can be used ( for example pwmclock )


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/evbmips/evbmips/interrupt.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/evbmips/evbmips/interrupt.c
diff -u src/sys/arch/evbmips/evbmips/interrupt.c:1.18 src/sys/arch/evbmips/evbmips/interrupt.c:1.19
--- src/sys/arch/evbmips/evbmips/interrupt.c:1.18	Tue Sep 27 01:02:33 2011
+++ src/sys/arch/evbmips/evbmips/interrupt.c	Tue May 14 09:16:59 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: interrupt.c,v 1.18 2011/09/27 01:02:33 jym Exp $	*/
+/*	$NetBSD: interrupt.c,v 1.19 2013/05/14 09:16:59 macallan Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: interrupt.c,v 1.18 2011/09/27 01:02:33 jym Exp $");
+__KERNEL_RCSID(0, "$NetBSD: interrupt.c,v 1.19 2013/05/14 09:16:59 macallan Exp $");
 
 #include 
 #include 
@@ -40,6 +40,8 @@ __KERNEL_RCSID(0, "$NetBSD: interrupt.c,
 #include 
 #include 
 
+struct clockframe cf;
+
 void
 intr_init(void)
 {
@@ -69,15 +71,15 @@ cpu_intr(int ppl, vaddr_t pc, uint32_t s
 		"%s: cpl (%d) != ipl (%d)", __func__, ci->ci_cpl, ipl);
 		KASSERT(pending != 0);
 
+		cf.pc = pc;
+		cf.sr = status;
+		cf.intr = (ci->ci_idepth > 1);
+
 		if (pending & MIPS_INT_MASK_5) {
-			struct clockframe cf;
 			KASSERTMSG(ipl == IPL_SCHED,
 			"%s: ipl (%d) != IPL_SCHED (%d)",
 			 __func__, ipl, IPL_SCHED);
 			/* call the common MIPS3 clock interrupt handler */ 
-			cf.pc = pc;
-			cf.sr = status;
-			cf.intr = (ci->ci_idepth > 1);
 			mips3_clockintr(&cf);
 			pending ^= MIPS_INT_MASK_5;
 		}



CVS commit: src/sys/arch/evbmips/evbmips

2009-08-10 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Tue Aug 11 02:37:29 UTC 2009

Modified Files:
src/sys/arch/evbmips/evbmips: cpu.c

Log Message:
Use aprint_normal


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/evbmips/evbmips/cpu.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/evbmips/evbmips/cpu.c
diff -u src/sys/arch/evbmips/evbmips/cpu.c:1.1 src/sys/arch/evbmips/evbmips/cpu.c:1.2
--- src/sys/arch/evbmips/evbmips/cpu.c:1.1	Sun Aug  2 17:12:29 2009
+++ src/sys/arch/evbmips/evbmips/cpu.c	Tue Aug 11 02:37:29 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.c,v 1.1 2009/08/02 17:12:29 matt Exp $	*/
+/*	$NetBSD: cpu.c,v 1.2 2009/08/11 02:37:29 matt Exp $	*/
 
 /*
  * Copyright 2002 Wasabi Systems, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.1 2009/08/02 17:12:29 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.2 2009/08/11 02:37:29 matt Exp $");
 
 #include 
 #include 
@@ -61,11 +61,11 @@
 {
 	struct cpu_info * const ci = curcpu();
 
-	printf(": %lu.%02luMHz (hz cycles = %lu, delay divisor = %lu)\n",
+	aprint_normal(": %lu.%02luMHz (hz cycles = %lu, delay divisor = %lu)\n",
 	ci->ci_cpu_freq / 100,
 	(ci->ci_cpu_freq % 100) / 1,
 	ci->ci_cycles_per_hz, ci->ci_divisor_delay);
 
-	printf("%s: ", device_xname(self));
+	aprint_normal("%s: ", device_xname(self));
 	cpu_identify();
 }