CVS commit: src/sys/arch/hp300

2024-01-15 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Tue Jan 16 07:07:00 UTC 2024

Modified Files:
src/sys/arch/hp300/dev: dio.c dma.c dmavar.h
src/sys/arch/hp300/hp300: autoconf.c
src/sys/arch/hp300/include: intr.h

Log Message:
Fix computation of the appropriate auto-vector interrupt level to use
for the DMA controller by tracking all of the DIO devices that have
"ISRPRI_BIO" interrupt handlers, and finding the highest auto-vector
level among them and informing the DMA controller.

Previously, in a post-flattening world, the DMA controller was always
told to interrupt at lev5, which is fine I guess although definitely not
ideal, but would not work on ncient HP320 Rev A DMA boards.  To that
effect, print a warning if a Rev B DMA board ends up at ipl != 3 (we can't
differentiate between a Rev A and a Rev B board).


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.43 src/sys/arch/hp300/dev/dio.c
cvs rdiff -u -r1.46 -r1.47 src/sys/arch/hp300/dev/dma.c
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/hp300/dev/dmavar.h
cvs rdiff -u -r1.111 -r1.112 src/sys/arch/hp300/hp300/autoconf.c
cvs rdiff -u -r1.37 -r1.38 src/sys/arch/hp300/include/intr.h

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/hp300/dev/dio.c
diff -u src/sys/arch/hp300/dev/dio.c:1.42 src/sys/arch/hp300/dev/dio.c:1.43
--- src/sys/arch/hp300/dev/dio.c:1.42	Tue Jan 16 03:44:43 2024
+++ src/sys/arch/hp300/dev/dio.c	Tue Jan 16 07:06:59 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: dio.c,v 1.42 2024/01/16 03:44:43 thorpej Exp $	*/
+/*	$NetBSD: dio.c,v 1.43 2024/01/16 07:06:59 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: dio.c,v 1.42 2024/01/16 03:44:43 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dio.c,v 1.43 2024/01/16 07:06:59 thorpej Exp $");
 
 #define	_M68K_INTR_PRIVATE
 
@@ -78,6 +78,9 @@ static int	diosubmatch(device_t, cfdata_
 CFATTACH_DECL_NEW(dio, sizeof(struct dio_softc),
 diomatch, dioattach, NULL, NULL);
 
+static LIST_HEAD(, hp300_intrhand) dio_dma_users =
+LIST_HEAD_INITIALIZER(dio_dma_users);
+
 static int
 diomatch(device_t parent, cfdata_t cf, void *aux)
 {
@@ -280,18 +283,40 @@ dio_devinfo(struct dio_attach_args *da, 
 }
 
 /*
+ * Enumerate the list of DMA controller users (the HPIB and SCSI
+ * controllers, essentially), and calculate what the highest
+ * auto-vector level used by those devices is.  Then tell the DMA
+ * controller to interrupt at that level.
+ */
+static void
+dio_dma_users_changed(void)
+{
+	struct hp300_intrhand *ih;
+	int ipl = 0;
+
+	LIST_FOREACH(ih, _dma_users, ih_dio_link) {
+		KASSERT(ih->ih_super.ih_isrpri == ISRPRI_BIO);
+		if (ih->ih_super.ih_ipl > ipl) {
+			ipl = ih->ih_super.ih_ipl;
+		}
+	}
+	dmaupdateipl(ipl);
+}
+
+/*
  * Establish an interrupt handler for a DIO device.
  */
 void *
 dio_intr_establish(int (*func)(void *), void *arg, int ipl, int isrpri)
 {
-	void *ih;
+	struct hp300_intrhand *ih;
 
 	ih = intr_establish(func, arg, ipl, isrpri);
 
-	/* XXX XXX XXX */
-	if (isrpri == IPL_BIO)
-		dmacomputeipl();
+	if (ih != NULL && isrpri == ISRPRI_BIO) {
+		LIST_INSERT_HEAD(_dma_users, ih, ih_dio_link);
+		dio_dma_users_changed();
+	}
 
 	return ih;
 }
@@ -302,14 +327,18 @@ dio_intr_establish(int (*func)(void *), 
 void
 dio_intr_disestablish(void *arg)
 {
-	struct m68k_intrhand *ih = arg;
-	int isrpri = ih->ih_isrpri;
+	struct hp300_intrhand *ih = arg;
+	int isrpri = ih->ih_super.ih_isrpri;
+
+	if (isrpri == ISRPRI_BIO) {
+		LIST_REMOVE(ih, ih_dio_link);
+	}
 
 	intr_disestablish(arg);
 
-	/* XXX XXX XXX */
-	if (isrpri == IPL_BIO)
-		dmacomputeipl();
+	if (isrpri == ISRPRI_BIO) {
+		dio_dma_users_changed();
+	}
 }
 
 /*

Index: src/sys/arch/hp300/dev/dma.c
diff -u src/sys/arch/hp300/dev/dma.c:1.46 src/sys/arch/hp300/dev/dma.c:1.47
--- src/sys/arch/hp300/dev/dma.c:1.46	Tue Jan 16 05:48:28 2024
+++ src/sys/arch/hp300/dev/dma.c	Tue Jan 16 07:06:59 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: dma.c,v 1.46 2024/01/16 05:48:28 thorpej Exp $	*/
+/*	$NetBSD: dma.c,v 1.47 2024/01/16 07:06:59 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
 #include "opt_m68k_arch.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: dma.c,v 1.46 2024/01/16 05:48:28 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dma.c,v 1.47 2024/01/16 07:06:59 thorpej Exp $");
 
 #include 	/* XXX param.h includes cpu.h */
 
@@ -263,19 +263,30 @@ dmaattach(device_t parent, device_t self
  * for the DMA controller.
  */
 void
-dmacomputeipl(void)
+dmaupdateipl(int ipl)
 {
 	struct dma_softc *sc = dma_softc;
 
-	if (sc->sc_ih != NULL)
+	if (sc->sc_ih != NULL && sc->sc_ipl == ipl) {
+		/* No change. */
+		return;
+	}
+
+	if (sc->sc_ih != NULL) {
 		intr_disestablish(sc->sc_ih);
+	}
+
+	if ((sc->sc_ipl == ipl) == 0) {
+		/* Don't hook up a new handler. */
+		return;
+	}
 
-	

CVS commit: src/sys/arch/hp300

2024-01-15 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Tue Jan 16 07:07:00 UTC 2024

Modified Files:
src/sys/arch/hp300/dev: dio.c dma.c dmavar.h
src/sys/arch/hp300/hp300: autoconf.c
src/sys/arch/hp300/include: intr.h

Log Message:
Fix computation of the appropriate auto-vector interrupt level to use
for the DMA controller by tracking all of the DIO devices that have
"ISRPRI_BIO" interrupt handlers, and finding the highest auto-vector
level among them and informing the DMA controller.

Previously, in a post-flattening world, the DMA controller was always
told to interrupt at lev5, which is fine I guess although definitely not
ideal, but would not work on ncient HP320 Rev A DMA boards.  To that
effect, print a warning if a Rev B DMA board ends up at ipl != 3 (we can't
differentiate between a Rev A and a Rev B board).


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.43 src/sys/arch/hp300/dev/dio.c
cvs rdiff -u -r1.46 -r1.47 src/sys/arch/hp300/dev/dma.c
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/hp300/dev/dmavar.h
cvs rdiff -u -r1.111 -r1.112 src/sys/arch/hp300/hp300/autoconf.c
cvs rdiff -u -r1.37 -r1.38 src/sys/arch/hp300/include/intr.h

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



CVS commit: src/sys/arch/m68k/include

2024-01-15 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Tue Jan 16 05:29:44 UTC 2024

Modified Files:
src/sys/arch/m68k/include: psl.h

Log Message:
Provide PSLTOIPL() and IPLTOPSL() macros.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/m68k/include/psl.h

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/m68k/include/psl.h
diff -u src/sys/arch/m68k/include/psl.h:1.18 src/sys/arch/m68k/include/psl.h:1.19
--- src/sys/arch/m68k/include/psl.h:1.18	Sun Jan 14 22:06:03 2024
+++ src/sys/arch/m68k/include/psl.h	Tue Jan 16 05:29:44 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: psl.h,v 1.18 2024/01/14 22:06:03 thorpej Exp $	*/
+/*	$NetBSD: psl.h,v 1.19 2024/01/16 05:29:44 thorpej Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1993
@@ -65,6 +65,9 @@
 #define	PSL_USERSET	(0)
 #define	PSL_USERCLR	(PSL_S | PSL_IPL7 | PSL_MBZ)
 
+#define	PSLTOIPL(x)	(((x) >> 8) & 0x7)
+#define	IPLTOPSL(x)	x) & 0x7) << 8) | PSL_S)
+
 #define	USERMODE(ps)	(((ps) & PSL_S) == 0)
 
 #if defined(_KERNEL) && !defined(_LOCORE)



CVS commit: src/sys/arch/m68k/include

2024-01-15 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Tue Jan 16 05:29:44 UTC 2024

Modified Files:
src/sys/arch/m68k/include: psl.h

Log Message:
Provide PSLTOIPL() and IPLTOPSL() macros.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/m68k/include/psl.h

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



CVS commit: src/sys/arch/hp300

2024-01-15 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Tue Jan 16 03:44:44 UTC 2024

Modified Files:
src/sys/arch/hp300/conf: files.hp300
src/sys/arch/hp300/dev: dio.c frodo.c
src/sys/arch/hp300/hp300: genassym.cf locore.s
src/sys/arch/hp300/include: cpu.h intr.h vectors.h
Removed Files:
src/sys/arch/hp300/hp300: intr.c

Log Message:
Switch hp300 over to the common interrupt dispatch code.

XXX There are still some things to fix up here, but it's no worse
than it was before (the problems date back to when we flattened
the device interrupt levels into IPL_VM).


To generate a diff of this commit:
cvs rdiff -u -r1.94 -r1.95 src/sys/arch/hp300/conf/files.hp300
cvs rdiff -u -r1.41 -r1.42 src/sys/arch/hp300/dev/dio.c
cvs rdiff -u -r1.35 -r1.36 src/sys/arch/hp300/dev/frodo.c
cvs rdiff -u -r1.50 -r1.51 src/sys/arch/hp300/hp300/genassym.cf
cvs rdiff -u -r1.44 -r0 src/sys/arch/hp300/hp300/intr.c
cvs rdiff -u -r1.180 -r1.181 src/sys/arch/hp300/hp300/locore.s
cvs rdiff -u -r1.75 -r1.76 src/sys/arch/hp300/include/cpu.h
cvs rdiff -u -r1.36 -r1.37 src/sys/arch/hp300/include/intr.h
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/hp300/include/vectors.h

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



CVS commit: src/sys/arch/hp300

2024-01-15 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Tue Jan 16 03:44:44 UTC 2024

Modified Files:
src/sys/arch/hp300/conf: files.hp300
src/sys/arch/hp300/dev: dio.c frodo.c
src/sys/arch/hp300/hp300: genassym.cf locore.s
src/sys/arch/hp300/include: cpu.h intr.h vectors.h
Removed Files:
src/sys/arch/hp300/hp300: intr.c

Log Message:
Switch hp300 over to the common interrupt dispatch code.

XXX There are still some things to fix up here, but it's no worse
than it was before (the problems date back to when we flattened
the device interrupt levels into IPL_VM).


To generate a diff of this commit:
cvs rdiff -u -r1.94 -r1.95 src/sys/arch/hp300/conf/files.hp300
cvs rdiff -u -r1.41 -r1.42 src/sys/arch/hp300/dev/dio.c
cvs rdiff -u -r1.35 -r1.36 src/sys/arch/hp300/dev/frodo.c
cvs rdiff -u -r1.50 -r1.51 src/sys/arch/hp300/hp300/genassym.cf
cvs rdiff -u -r1.44 -r0 src/sys/arch/hp300/hp300/intr.c
cvs rdiff -u -r1.180 -r1.181 src/sys/arch/hp300/hp300/locore.s
cvs rdiff -u -r1.75 -r1.76 src/sys/arch/hp300/include/cpu.h
cvs rdiff -u -r1.36 -r1.37 src/sys/arch/hp300/include/intr.h
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/hp300/include/vectors.h

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/hp300/conf/files.hp300
diff -u src/sys/arch/hp300/conf/files.hp300:1.94 src/sys/arch/hp300/conf/files.hp300:1.95
--- src/sys/arch/hp300/conf/files.hp300:1.94	Sat Jan 13 19:20:26 2024
+++ src/sys/arch/hp300/conf/files.hp300	Tue Jan 16 03:44:43 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: files.hp300,v 1.94 2024/01/13 19:20:26 thorpej Exp $
+#	$NetBSD: files.hp300,v 1.95 2024/01/16 03:44:43 thorpej Exp $
 #
 # hp300-specific configuration info
 
@@ -210,7 +210,6 @@ file	arch/hp300/hp300/bus_space.c
 file	arch/hp300/hp300/clock.c
 file	arch/hp300/hp300/dkbad.c
 file	arch/hp300/hp300/machdep.c
-file	arch/hp300/hp300/intr.c
 file	arch/hp300/hp300/leds.c			useleds
 file	arch/hp300/hp300/pmap_bootstrap.c	compile-with "${NOPROF_C}"
 file	arch/hp300/hp300/trap.c
@@ -219,6 +218,8 @@ file	arch/m68k/m68k/cacheops.c
 file	arch/m68k/m68k/db_memrw.c		ddb | kgdb
 file	arch/m68k/m68k/fpu.c			compile-with "${M68K_KERN_FPU}"
 file	arch/m68k/m68k/kgdb_machdep.c		kgdb
+file	arch/m68k/m68k/m68k_intr.c
+file	arch/m68k/m68k/m68k_intr_stubs.s
 file	arch/m68k/m68k/m68k_trap.c
 file	arch/m68k/m68k/mmu_subr.s
 file	arch/m68k/m68k/pmap_motorola.c

Index: src/sys/arch/hp300/dev/dio.c
diff -u src/sys/arch/hp300/dev/dio.c:1.41 src/sys/arch/hp300/dev/dio.c:1.42
--- src/sys/arch/hp300/dev/dio.c:1.41	Sat Aug  7 16:18:53 2021
+++ src/sys/arch/hp300/dev/dio.c	Tue Jan 16 03:44:43 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: dio.c,v 1.41 2021/08/07 16:18:53 thorpej Exp $	*/
+/*	$NetBSD: dio.c,v 1.42 2024/01/16 03:44:43 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -34,9 +34,9 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: dio.c,v 1.41 2021/08/07 16:18:53 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dio.c,v 1.42 2024/01/16 03:44:43 thorpej Exp $");
 
-#define	_HP300_INTR_H_PRIVATE
+#define	_M68K_INTR_PRIVATE
 
 #include 
 #include 
@@ -283,13 +283,14 @@ dio_devinfo(struct dio_attach_args *da, 
  * Establish an interrupt handler for a DIO device.
  */
 void *
-dio_intr_establish(int (*func)(void *), void *arg, int ipl, int priority)
+dio_intr_establish(int (*func)(void *), void *arg, int ipl, int isrpri)
 {
 	void *ih;
 
-	ih = intr_establish(func, arg, ipl, priority);
+	ih = intr_establish(func, arg, ipl, isrpri);
 
-	if (priority == IPL_BIO)
+	/* XXX XXX XXX */
+	if (isrpri == IPL_BIO)
 		dmacomputeipl();
 
 	return ih;
@@ -301,12 +302,13 @@ dio_intr_establish(int (*func)(void *), 
 void
 dio_intr_disestablish(void *arg)
 {
-	struct hp300_intrhand *ih = arg;
-	int priority = ih->ih_priority;
+	struct m68k_intrhand *ih = arg;
+	int isrpri = ih->ih_isrpri;
 
 	intr_disestablish(arg);
 
-	if (priority == IPL_BIO)
+	/* XXX XXX XXX */
+	if (isrpri == IPL_BIO)
 		dmacomputeipl();
 }
 

Index: src/sys/arch/hp300/dev/frodo.c
diff -u src/sys/arch/hp300/dev/frodo.c:1.35 src/sys/arch/hp300/dev/frodo.c:1.36
--- src/sys/arch/hp300/dev/frodo.c:1.35	Fri Nov 25 13:12:02 2022
+++ src/sys/arch/hp300/dev/frodo.c	Tue Jan 16 03:44:43 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: frodo.c,v 1.35 2022/11/25 13:12:02 tsutsui Exp $	*/
+/*	$NetBSD: frodo.c,v 1.36 2024/01/16 03:44:43 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 1997, 1998, 1999 The NetBSD Foundation, Inc.
@@ -60,9 +60,9 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: frodo.c,v 1.35 2022/11/25 13:12:02 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: frodo.c,v 1.36 2024/01/16 03:44:43 thorpej Exp $");
 
-#define	_HP300_INTR_H_PRIVATE
+#define	_M68K_INTR_PRIVATE
 
 #include 
 #include 
@@ -86,7 +86,7 @@ __KERNEL_RCSID(0, "$NetBSD: frodo.c,v 1.
 struct frodo_interhand {
 	int	(*ih_fn)(void *);
 	void	*ih_arg;
-	int	ih_priority;
+	int	ih_isrpri;
 };
 
 struct frodo_softc {
@@ -237,10 

CVS commit: src/sys/arch/m68k/m68k

2024-01-15 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Tue Jan 16 02:36:49 UTC 2024

Modified Files:
src/sys/arch/m68k/m68k: m68k_intr.c

Log Message:
Add a hook to allow a platform to suppress reporting stray auto-vectored
interrupts.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/m68k/m68k/m68k_intr.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/m68k/m68k/m68k_intr.c
diff -u src/sys/arch/m68k/m68k/m68k_intr.c:1.9 src/sys/arch/m68k/m68k/m68k_intr.c:1.10
--- src/sys/arch/m68k/m68k/m68k_intr.c:1.9	Tue Jan 16 02:14:33 2024
+++ src/sys/arch/m68k/m68k/m68k_intr.c	Tue Jan 16 02:36:49 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: m68k_intr.c,v 1.9 2024/01/16 02:14:33 thorpej Exp $	*/
+/*	$NetBSD: m68k_intr.c,v 1.10 2024/01/16 02:36:49 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 1996, 2023, 2024 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: m68k_intr.c,v 1.9 2024/01/16 02:14:33 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: m68k_intr.c,v 1.10 2024/01/16 02:36:49 thorpej Exp $");
 
 #define	_M68K_INTR_PRIVATE
 
@@ -377,6 +377,10 @@ m68k_intr_disestablish(void *v)
 
 void	m68k_intr_autovec(struct clockframe);
 
+#ifndef MACHINE_AUTOVEC_IGNORE_STRAY
+#define	MACHINE_AUTOVEC_IGNORE_STRAY(ipl)	0
+#endif
+
 /*
  * m68k_intr_autovec --
  *	Run the interrupt handlers for an auto-vectored interrupt.
@@ -398,8 +402,8 @@ m68k_intr_autovec(struct clockframe fram
 			rv = true;
 		}
 	}
-	if (!rv) {
-		printf("Spurious interrupt on IPL %d\n", ipl);
+	if (!rv && !MACHINE_AUTOVEC_IGNORE_STRAY(ipl)) {
+		printf("Stray level %d interrupt\n", ipl);
 	}
 
 	ATOMIC_CAS_CHECK();
@@ -438,8 +442,8 @@ m68k_intr_vectored(struct clockframe fra
 		 : ) != 0)) {
 		ih->ih_evcnt->ev_count++;
 	} else {
-		printf("Spurious interrupt on vector=0x%0x IPL %d\n",
-		vec, ipl);
+		printf("Stray level %d interrupt vector=0x%x\n",
+		ipl, vec);
 	}
 #ifdef DIAGNOSTIC
  out:



CVS commit: src/sys/arch/m68k/m68k

2024-01-15 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Tue Jan 16 02:36:49 UTC 2024

Modified Files:
src/sys/arch/m68k/m68k: m68k_intr.c

Log Message:
Add a hook to allow a platform to suppress reporting stray auto-vectored
interrupts.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/m68k/m68k/m68k_intr.c

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



CVS commit: src/sys/arch/m68k/m68k

2024-01-15 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Tue Jan 16 02:14:33 UTC 2024

Modified Files:
src/sys/arch/m68k/m68k: m68k_intr.c m68k_intr_stubs.s

Log Message:
Increment and decrement idepth in the assembly stubs, not C code.  This
provides two advantages:
- Greater coverage for detecting "interrupt time".
- More flexibility for platform-specific interrupt stubs that might need
  to do special processing before calling the common dispatcher.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/m68k/m68k/m68k_intr.c
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/m68k/m68k/m68k_intr_stubs.s

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/m68k/m68k/m68k_intr.c
diff -u src/sys/arch/m68k/m68k/m68k_intr.c:1.8 src/sys/arch/m68k/m68k/m68k_intr.c:1.9
--- src/sys/arch/m68k/m68k/m68k_intr.c:1.8	Tue Jan 16 01:16:46 2024
+++ src/sys/arch/m68k/m68k/m68k_intr.c	Tue Jan 16 02:14:33 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: m68k_intr.c,v 1.8 2024/01/16 01:16:46 thorpej Exp $	*/
+/*	$NetBSD: m68k_intr.c,v 1.9 2024/01/16 02:14:33 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 1996, 2023, 2024 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: m68k_intr.c,v 1.8 2024/01/16 01:16:46 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: m68k_intr.c,v 1.9 2024/01/16 02:14:33 thorpej Exp $");
 
 #define	_M68K_INTR_PRIVATE
 
@@ -70,7 +70,7 @@ extern char intrstub_vectored[];
 /* A dummy event counter where interrupt stats go to die. */
 static struct evcnt bitbucket;
 
-volatile int idepth;
+volatile int idepth;	/* updated in assembly glue */
 
 static struct m68k_intrhand_list m68k_intrhands_autovec[NAUTOVECTORS];
 #ifdef __HAVE_M68K_INTR_VECTORED
@@ -389,8 +389,6 @@ m68k_intr_autovec(struct clockframe fram
 	struct m68k_intrhand *ih;
 	bool rv = false;
 
-	idepth++;
-
 	m68k_count_intr(ipl);
 
 	LIST_FOREACH(ih, _intrhands_autovec[ipl], ih_link) {
@@ -404,8 +402,6 @@ m68k_intr_autovec(struct clockframe fram
 		printf("Spurious interrupt on IPL %d\n", ipl);
 	}
 
-	idepth--;
-
 	ATOMIC_CAS_CHECK();
 }
 
@@ -424,8 +420,6 @@ m68k_intr_vectored(struct clockframe fra
 	const int ipl = (getsr() >> 8) & 7;
 	struct m68k_intrhand *ih;
 
-	idepth++;
-
 	m68k_count_intr(ipl);
 
 #ifdef DIAGNOSTIC
@@ -450,8 +444,6 @@ m68k_intr_vectored(struct clockframe fra
 #ifdef DIAGNOSTIC
  out:
 #endif
-	idepth--;
-
 	ATOMIC_CAS_CHECK();
 }
 #endif /* __HAVE_M68K_INTR_VECTORED */

Index: src/sys/arch/m68k/m68k/m68k_intr_stubs.s
diff -u src/sys/arch/m68k/m68k/m68k_intr_stubs.s:1.2 src/sys/arch/m68k/m68k/m68k_intr_stubs.s:1.3
--- src/sys/arch/m68k/m68k/m68k_intr_stubs.s:1.2	Tue Jan 16 01:16:46 2024
+++ src/sys/arch/m68k/m68k/m68k_intr_stubs.s	Tue Jan 16 02:14:33 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: m68k_intr_stubs.s,v 1.2 2024/01/16 01:16:46 thorpej Exp $	*/
+/*	$NetBSD: m68k_intr_stubs.s,v 1.3 2024/01/16 02:14:33 thorpej Exp $	*/
 
 /*
  * Copyright (c) 1980, 1990, 1993
@@ -62,9 +62,11 @@
  */
 	INTRSTUB_ALIGN
 ENTRY_NOPROFILE(intrstub_autovec)
+	addql	#1,_C_LABEL(idepth)
 	INTERRUPT_SAVEREG
 	jbsr	_C_LABEL(m68k_intr_autovec)
 	INTERRUPT_RESTOREREG
+	subql	#1,_C_LABEL(idepth)
 	jra	_ASM_LABEL(rei)
 
 #ifdef __HAVE_M68K_INTR_VECTORED
@@ -73,8 +75,10 @@ ENTRY_NOPROFILE(intrstub_autovec)
  */
 	INTRSTUB_ALIGN
 ENTRY_NOPROFILE(intrstub_vectored)
+	addql	#1,_C_LABEL(idepth)
 	INTERRUPT_SAVEREG
 	jbsr	_C_LABEL(m68k_intr_vectored)
 	INTERRUPT_RESTOREREG
+	subql	#1,_C_LABEL(idepth)
 	jra	_ASM_LABEL(rei)
 #endif /* __HAVE_M68K_INTR_VECTORED */



CVS commit: src/sys/arch/m68k/m68k

2024-01-15 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Tue Jan 16 02:14:33 UTC 2024

Modified Files:
src/sys/arch/m68k/m68k: m68k_intr.c m68k_intr_stubs.s

Log Message:
Increment and decrement idepth in the assembly stubs, not C code.  This
provides two advantages:
- Greater coverage for detecting "interrupt time".
- More flexibility for platform-specific interrupt stubs that might need
  to do special processing before calling the common dispatcher.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/m68k/m68k/m68k_intr.c
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/m68k/m68k/m68k_intr_stubs.s

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



CVS commit: src/sys/arch/mvme68k

2024-01-15 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Tue Jan 16 01:26:34 UTC 2024

Modified Files:
src/sys/arch/mvme68k/conf: files.mvme68k
src/sys/arch/mvme68k/include: cpu.h intr.h types.h vectors.h
src/sys/arch/mvme68k/mvme68k: genassym.cf isr.h locore.s machdep.c
trap.c
Removed Files:
src/sys/arch/mvme68k/mvme68k: isr.c

Log Message:
Switch mvme68k over to the common interrupt dispatch code and G/C
__HAVE_LEGACY_INTRCNT.


To generate a diff of this commit:
cvs rdiff -u -r1.67 -r1.68 src/sys/arch/mvme68k/conf/files.mvme68k
cvs rdiff -u -r1.52 -r1.53 src/sys/arch/mvme68k/include/cpu.h
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/mvme68k/include/intr.h
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/mvme68k/include/types.h
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/mvme68k/include/vectors.h
cvs rdiff -u -r1.40 -r1.41 src/sys/arch/mvme68k/mvme68k/genassym.cf
cvs rdiff -u -r1.36 -r0 src/sys/arch/mvme68k/mvme68k/isr.c
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/mvme68k/mvme68k/isr.h
cvs rdiff -u -r1.126 -r1.127 src/sys/arch/mvme68k/mvme68k/locore.s
cvs rdiff -u -r1.162 -r1.163 src/sys/arch/mvme68k/mvme68k/machdep.c
cvs rdiff -u -r1.114 -r1.115 src/sys/arch/mvme68k/mvme68k/trap.c

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



CVS commit: src/sys/arch/mvme68k

2024-01-15 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Tue Jan 16 01:26:34 UTC 2024

Modified Files:
src/sys/arch/mvme68k/conf: files.mvme68k
src/sys/arch/mvme68k/include: cpu.h intr.h types.h vectors.h
src/sys/arch/mvme68k/mvme68k: genassym.cf isr.h locore.s machdep.c
trap.c
Removed Files:
src/sys/arch/mvme68k/mvme68k: isr.c

Log Message:
Switch mvme68k over to the common interrupt dispatch code and G/C
__HAVE_LEGACY_INTRCNT.


To generate a diff of this commit:
cvs rdiff -u -r1.67 -r1.68 src/sys/arch/mvme68k/conf/files.mvme68k
cvs rdiff -u -r1.52 -r1.53 src/sys/arch/mvme68k/include/cpu.h
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/mvme68k/include/intr.h
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/mvme68k/include/types.h
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/mvme68k/include/vectors.h
cvs rdiff -u -r1.40 -r1.41 src/sys/arch/mvme68k/mvme68k/genassym.cf
cvs rdiff -u -r1.36 -r0 src/sys/arch/mvme68k/mvme68k/isr.c
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/mvme68k/mvme68k/isr.h
cvs rdiff -u -r1.126 -r1.127 src/sys/arch/mvme68k/mvme68k/locore.s
cvs rdiff -u -r1.162 -r1.163 src/sys/arch/mvme68k/mvme68k/machdep.c
cvs rdiff -u -r1.114 -r1.115 src/sys/arch/mvme68k/mvme68k/trap.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/mvme68k/conf/files.mvme68k
diff -u src/sys/arch/mvme68k/conf/files.mvme68k:1.67 src/sys/arch/mvme68k/conf/files.mvme68k:1.68
--- src/sys/arch/mvme68k/conf/files.mvme68k:1.67	Sat Jan 13 20:18:46 2024
+++ src/sys/arch/mvme68k/conf/files.mvme68k	Tue Jan 16 01:26:34 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: files.mvme68k,v 1.67 2024/01/13 20:18:46 thorpej Exp $
+#	$NetBSD: files.mvme68k,v 1.68 2024/01/16 01:26:34 thorpej Exp $
 
 # config file for mvme68k
 
@@ -91,13 +91,14 @@ file arch/mvme68k/mvme68k/bus_space.c
 file arch/mvme68k/mvme68k/clock.c
 file arch/mvme68k/mvme68k/conf.c
 file arch/mvme68k/mvme68k/disksubr.c
-file arch/mvme68k/mvme68k/isr.c
 file arch/mvme68k/mvme68k/machdep.c
 file arch/mvme68k/mvme68k/pmap_bootstrap.c	compile-with "${NOPROF_C}"
 file arch/mvme68k/mvme68k/trap.c
 file arch/m68k/m68k/cacheops.c
 file arch/m68k/m68k/db_memrw.c			ddb | kgdb
 file arch/m68k/m68k/kgdb_machdep.c		kgdb
+file arch/m68k/m68k/m68k_intr.c
+file arch/m68k/m68k/m68k_intr_stubs.s
 file arch/m68k/m68k/m68k_trap.c
 file arch/m68k/m68k/mmu_subr.s
 file arch/m68k/m68k/pmap_motorola.c

Index: src/sys/arch/mvme68k/include/cpu.h
diff -u src/sys/arch/mvme68k/include/cpu.h:1.52 src/sys/arch/mvme68k/include/cpu.h:1.53
--- src/sys/arch/mvme68k/include/cpu.h:1.52	Tue Jan  9 04:16:26 2024
+++ src/sys/arch/mvme68k/include/cpu.h	Tue Jan 16 01:26:34 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.h,v 1.52 2024/01/09 04:16:26 thorpej Exp $	*/
+/*	$NetBSD: cpu.h,v 1.53 2024/01/16 01:26:34 thorpej Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -60,17 +60,17 @@
 /*
  * Arguments to hardclock and gatherstats encapsulate the previous
  * machine state in an opaque clockframe.  On the mvme68k, we use
- * what the hardware pushes on an interrupt (frame format 0).
+ * what the locore.s glue puts on the stack before calling C-code.
  */
 struct clockframe {
-	u_short	sr;		/* sr at time of interrupt */
-	u_long	pc;		/* pc at time of interrupt */
-	u_short	fmt:4,
-		vec:12;		/* vector offset (4-word frame) */
+	u_int	cf_regs[4];	/* d0,d1,a0,a1 */
+	u_short	cf_sr;		/* sr at time of interrupt */
+	u_long	cf_pc;		/* pc at time of interrupt */
+	u_short	cf_vo;		/* vector offset (4-word frame) */
 } __attribute__((packed));
 
-#define	CLKF_USERMODE(framep)	(((framep)->sr & PSL_S) == 0)
-#define	CLKF_PC(framep)		((framep)->pc)
+#define	CLKF_USERMODE(framep)	(((framep)->cf_sr & PSL_S) == 0)
+#define	CLKF_PC(framep)		((framep)->cf_pc)
 
 /*
  * The clock interrupt handler can determine if it's a nested
@@ -78,8 +78,7 @@ struct clockframe {
  * (Remember, the clock interrupt handler itself will cause the
  * depth counter to be incremented).
  */
-extern volatile unsigned int interrupt_depth;
-#define	CLKF_INTR(framep)	(interrupt_depth > 1)
+#define	CLKF_INTR(framep)	(idepth > 1)
 
 
 /*

Index: src/sys/arch/mvme68k/include/intr.h
diff -u src/sys/arch/mvme68k/include/intr.h:1.22 src/sys/arch/mvme68k/include/intr.h:1.23
--- src/sys/arch/mvme68k/include/intr.h:1.22	Tue Jul 11 11:07:54 2023
+++ src/sys/arch/mvme68k/include/intr.h	Tue Jan 16 01:26:34 2024
@@ -1,11 +1,11 @@
-/*	$NetBSD: intr.h,v 1.22 2023/07/11 11:07:54 riastradh Exp $	*/
+/*	$NetBSD: intr.h,v 1.23 2024/01/16 01:26:34 thorpej Exp $	*/
 
 /*-
- * Copyright (c) 2000 The NetBSD Foundation, Inc.
+ * Copyright (c) 2024 The NetBSD Foundation, Inc.
  * All rights reserved.
  *
  * This code is derived from software contributed to The NetBSD Foundation
- * by Jason R. Thorpe and Steve C. Woodford.
+ * by Jason R. Thorpe.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the 

CVS commit: src/sys/arch/news68k/news68k

2024-01-15 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Tue Jan 16 01:17:59 UTC 2024

Modified Files:
src/sys/arch/news68k/news68k: isr.h

Log Message:
Use m68k_intrvec_intrhand() to implement isrunlink_vectored().


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/news68k/news68k/isr.h

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/news68k/news68k/isr.h
diff -u src/sys/arch/news68k/news68k/isr.h:1.10 src/sys/arch/news68k/news68k/isr.h:1.11
--- src/sys/arch/news68k/news68k/isr.h:1.10	Mon Jan 15 00:35:24 2024
+++ src/sys/arch/news68k/news68k/isr.h	Tue Jan 16 01:17:59 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: isr.h,v 1.10 2024/01/15 00:35:24 thorpej Exp $	*/
+/*	$NetBSD: isr.h,v 1.11 2024/01/16 01:17:59 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 2004 The NetBSD Foundation, Inc.
@@ -61,8 +61,11 @@ isrlink_vectored(int (*func)(void *), vo
 static inline void
 isrunlink_vectored(int vec)
 {
-	/* XXX isrlink_*() functions should return handle. */
-	panic("isrunlink_vectored");
+	/* XXX isrlink_vectored() should return a handle. */
+	void *ih = m68k_intrvec_intrhand(vec);
+	if (ih != NULL) {
+		m68k_intr_disestablish(ih);
+	}
 }
 
 #endif /* _NEWS68k_ISR_H_ */



CVS commit: src/sys/arch/news68k/news68k

2024-01-15 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Tue Jan 16 01:17:59 UTC 2024

Modified Files:
src/sys/arch/news68k/news68k: isr.h

Log Message:
Use m68k_intrvec_intrhand() to implement isrunlink_vectored().


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/news68k/news68k/isr.h

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



CVS commit: src/sys/arch/m68k

2024-01-15 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Tue Jan 16 01:16:47 UTC 2024

Modified Files:
src/sys/arch/m68k/include: intr.h
src/sys/arch/m68k/m68k: m68k_intr.c m68k_intr_stubs.s

Log Message:
- Declare idepth as volatile.
- Provide a m68k_intrvec_intrhand() routine that returns the interrupt
  handle for a given vectored interrupt.  XXX This is gross and should
  burn to the ground, but is needed to support legacy ISR interfaces.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/m68k/include/intr.h
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/m68k/m68k/m68k_intr.c
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/m68k/m68k/m68k_intr_stubs.s

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/m68k/include/intr.h
diff -u src/sys/arch/m68k/include/intr.h:1.4 src/sys/arch/m68k/include/intr.h:1.5
--- src/sys/arch/m68k/include/intr.h:1.4	Mon Jan 15 18:47:03 2024
+++ src/sys/arch/m68k/include/intr.h	Tue Jan 16 01:16:46 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: intr.h,v 1.4 2024/01/15 18:47:03 thorpej Exp $	*/
+/*	$NetBSD: intr.h,v 1.5 2024/01/16 01:16:46 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 2023, 2024 The NetBSD Foundation, Inc.
@@ -68,7 +68,7 @@ typedef struct {
 #endif
 
 #ifdef _KERNEL
-extern int idepth;		/* interrupt depth */
+extern volatile int idepth;		/* interrupt depth */
 extern const uint16_t ipl2psl_table[NIPL];
 
 typedef int ipl_t;		/* logical IPL_* value */
@@ -198,6 +198,10 @@ void	*m68k_intr_establish(int (*)(void *
 	int/*vec*/, int/*m68k ipl*/, int/*isrpri*/, int/*flags*/);
 bool	m68k_intr_disestablish(void *);
 
+#ifdef __HAVE_M68K_INTR_VECTORED
+void	*m68k_intrvec_intrhand(int vec);	/* XXX */
+#endif
+
 #endif /* _KERNEL */
 
 #endif /* _M68k_INTR_H_ */

Index: src/sys/arch/m68k/m68k/m68k_intr.c
diff -u src/sys/arch/m68k/m68k/m68k_intr.c:1.7 src/sys/arch/m68k/m68k/m68k_intr.c:1.8
--- src/sys/arch/m68k/m68k/m68k_intr.c:1.7	Mon Jan 15 19:27:16 2024
+++ src/sys/arch/m68k/m68k/m68k_intr.c	Tue Jan 16 01:16:46 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: m68k_intr.c,v 1.7 2024/01/15 19:27:16 thorpej Exp $	*/
+/*	$NetBSD: m68k_intr.c,v 1.8 2024/01/16 01:16:46 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 1996, 2023, 2024 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: m68k_intr.c,v 1.7 2024/01/15 19:27:16 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: m68k_intr.c,v 1.8 2024/01/16 01:16:46 thorpej Exp $");
 
 #define	_M68K_INTR_PRIVATE
 
@@ -70,7 +70,7 @@ extern char intrstub_vectored[];
 /* A dummy event counter where interrupt stats go to die. */
 static struct evcnt bitbucket;
 
-int idepth;
+volatile int idepth;
 
 static struct m68k_intrhand_list m68k_intrhands_autovec[NAUTOVECTORS];
 #ifdef __HAVE_M68K_INTR_VECTORED
@@ -215,6 +215,16 @@ m68k_intrvec_remove(struct m68k_intrhand
 	*slot = NULL;
 }
 
+/* XXX This is horrible and should burn to the ground. */
+void *
+m68k_intrvec_intrhand(int vec)
+{
+	KASSERT(vec >= MACHINE_USERVEC_START);
+	KASSERT(vec < NVECTORS);
+
+	return m68k_intrhands_vectored[vec - MACHINE_USERVEC_START];
+}
+
 #endif /* __HAVE_M68K_INTR_VECTORED */
 
 /*

Index: src/sys/arch/m68k/m68k/m68k_intr_stubs.s
diff -u src/sys/arch/m68k/m68k/m68k_intr_stubs.s:1.1 src/sys/arch/m68k/m68k/m68k_intr_stubs.s:1.2
--- src/sys/arch/m68k/m68k/m68k_intr_stubs.s:1.1	Sun Jan 14 22:32:32 2024
+++ src/sys/arch/m68k/m68k/m68k_intr_stubs.s	Tue Jan 16 01:16:46 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: m68k_intr_stubs.s,v 1.1 2024/01/14 22:32:32 thorpej Exp $	*/
+/*	$NetBSD: m68k_intr_stubs.s,v 1.2 2024/01/16 01:16:46 thorpej Exp $	*/
 
 /*
  * Copyright (c) 1980, 1990, 1993
@@ -50,6 +50,13 @@
 #endif
 
 /*
+ * XXX Some platforms (e.g. news68k) have hardware-assisted ASTs, and
+ * XXX thus don't need to branch to rei() after an interrupt.  Figure
+ * XXX out a way to handle these platforms.  This works for now; the
+ * XXX hardware-assist is just an optimization.
+ */
+
+/*
  * Vector stub for auto-vectored interrupts.  Calls the dispatch
  * routine with the frame BY VALUE (saves a few instructions).
  */



CVS commit: src/sys/arch/m68k

2024-01-15 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Tue Jan 16 01:16:47 UTC 2024

Modified Files:
src/sys/arch/m68k/include: intr.h
src/sys/arch/m68k/m68k: m68k_intr.c m68k_intr_stubs.s

Log Message:
- Declare idepth as volatile.
- Provide a m68k_intrvec_intrhand() routine that returns the interrupt
  handle for a given vectored interrupt.  XXX This is gross and should
  burn to the ground, but is needed to support legacy ISR interfaces.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/m68k/include/intr.h
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/m68k/m68k/m68k_intr.c
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/m68k/m68k/m68k_intr_stubs.s

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



CVS commit: src/sys/arch/next68k/next68k

2024-01-15 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Tue Jan 16 00:34:58 UTC 2024

Modified Files:
src/sys/arch/next68k/next68k: genassym.cf isr.h locore.s trap.c
Removed Files:
src/sys/arch/next68k/next68k: isr.c

Log Message:
Switch next68k over to common interrupt dispatch and G/C __HAVE_LEGACY_INTRCNT.
Also included is G/C of the old ssir stuff that's no longer used.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/arch/next68k/next68k/genassym.cf
cvs rdiff -u -r1.35 -r0 src/sys/arch/next68k/next68k/isr.c
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/next68k/next68k/isr.h
cvs rdiff -u -r1.81 -r1.82 src/sys/arch/next68k/next68k/locore.s
cvs rdiff -u -r1.94 -r1.95 src/sys/arch/next68k/next68k/trap.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/next68k/next68k/genassym.cf
diff -u src/sys/arch/next68k/next68k/genassym.cf:1.33 src/sys/arch/next68k/next68k/genassym.cf:1.34
--- src/sys/arch/next68k/next68k/genassym.cf:1.33	Tue Jan  9 04:16:26 2024
+++ src/sys/arch/next68k/next68k/genassym.cf	Tue Jan 16 00:34:58 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: genassym.cf,v 1.33 2024/01/09 04:16:26 thorpej Exp $
+#	$NetBSD: genassym.cf,v 1.34 2024/01/16 00:34:58 thorpej Exp $
 
 #
 # Copyright (c) 1982, 1990, 1993
@@ -127,6 +127,7 @@ define	P_VMSPACE		offsetof(struct proc, 
 
 # interrupt/fault metering
 define	CI_NINTR		offsetof(struct cpu_info, ci_data.cpu_nintr)
+define	NMI_INTRCNT		((sizeof(struct evcnt)*7) + offsetof(struct evcnt, ev_count32))
 
 # PSL values (should just include psl.h?)
 define	PSL_S			PSL_S

Index: src/sys/arch/next68k/next68k/isr.h
diff -u src/sys/arch/next68k/next68k/isr.h:1.10 src/sys/arch/next68k/next68k/isr.h:1.11
--- src/sys/arch/next68k/next68k/isr.h:1.10	Mon Jan 15 20:28:56 2024
+++ src/sys/arch/next68k/next68k/isr.h	Tue Jan 16 00:34:58 2024
@@ -1,14 +1,7 @@
-/*	$NetBSD: isr.h,v 1.10 2024/01/15 20:28:56 thorpej Exp $ */
-
-/*
- * This file was taken from mvme68k/mvme68k/isr.h
- * should probably be re-synced when needed.
- * Darrin B. Jewell   Tue Nov 10 05:07:16 1998
- * original cvs id: NetBSD: isr.h,v 1.3 1997/10/09 08:40:06 jtc Exp
- */
+/*	$NetBSD: isr.h,v 1.11 2024/01/16 00:34:58 thorpej Exp $	*/
 
 /*-
- * Copyright (c) 1996 The NetBSD Foundation, Inc.
+ * Copyright (c) 2024 The NetBSD Foundation, Inc.
  * All rights reserved.
  *
  * This code is derived from software contributed to The NetBSD Foundation
@@ -36,59 +29,27 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include 
-
-/*
- * The location and size of the autovectored interrupt portion
- * of the vector table.
- */
-#define ISRAUTOVEC	0x18
-#define NISRAUTOVEC	8
-#define NIPLS		8
+#ifndef _NEXT68K_ISR_H_
+#define	_NEXT68K_ISR_H_
 
-/*
- * The location and size of the vectored interrupt portion
- * of the vector table.
- */
-#define ISRVECTORED	0x40
+#include 
 
 /*
- * Autovectored interrupt handler cookie.
+ * Aliases for the legacy next68k ISR routines.
  */
-struct isr_autovec {
-	LIST_ENTRY(isr_autovec) isr_link;
-	int		(*isr_func)(void *);
-	void		*isr_arg;
-	int		isr_ipl;
-	int		isr_priority;
-	struct evcnt	*isr_evcnt;
-};
 
-typedef LIST_HEAD(, isr_autovec) isr_autovec_list_t;
+static inline void
+isrinit(void)
+{
+	m68k_intr_init(NULL);
+}
 
-/*
- * Vectored interrupt handler cookie.  The handler may request to
- * receive the exception frame as an argument by specifying NULL
- * when establishing the interrupt.
- */
-struct isr_vectored {
-	int		(*isr_func)(void *);
-	void		*isr_arg;
-	int		isr_ipl;
-	struct evcnt	*isr_evcnt;
-};
+static inline void
+isrlink_autovec(int (*func)(void *), void *arg, int ipl, int isrpri,
+struct evcnt *ev)
+{
+	/* XXX leaks interrupt handle. */
+	m68k_intr_establish(func, arg, ev, 0, ipl, isrpri, 0);
+}
 
-/*
- * Autovectored ISR priorities.  These are not the same as interrupt levels.
- */
-#define ISRPRI_BIO		0
-#define ISRPRI_NET		1
-#define ISRPRI_TTY		2
-#define ISRPRI_TTYNOBUF		3
-
-extern struct evcnt next68k_irq_evcnt[];
-
-void	isrinit(void);
-void	isrlink_autovec(int (*)(void *), void *, int, int, struct evcnt *);
-void	isrdispatch_autovec(struct clockframe *);
-void	netintr(void);
+#endif /* _NEXT68K_ISR_H_ */

Index: src/sys/arch/next68k/next68k/locore.s
diff -u src/sys/arch/next68k/next68k/locore.s:1.81 src/sys/arch/next68k/next68k/locore.s:1.82
--- src/sys/arch/next68k/next68k/locore.s:1.81	Sat Jan 13 21:40:54 2024
+++ src/sys/arch/next68k/next68k/locore.s	Tue Jan 16 00:34:58 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.s,v 1.81 2024/01/13 21:40:54 thorpej Exp $	*/
+/*	$NetBSD: locore.s,v 1.82 2024/01/16 00:34:58 thorpej Exp $	*/
 
 /*
  * Copyright (c) 1998 Darrin B. Jewell
@@ -500,13 +500,7 @@ ENTRY_NOPROFILE(trap0)
 	jbsr	_C_LABEL(syscall)	| handle it
 	addql	#4,%sp			| pop syscall arg
 	tstl	_C_LABEL(astpending)
-	jne	Lrei2
-	tstb	_C_LABEL(ssir)
-	jeq	Ltrap1
-	movw	#SPL1,%sr
-	tstb	_C_LABEL(ssir)
-	jne	Lsir1
-Ltrap1:
+	jne	Lrei
 	

CVS commit: src/sys/arch/next68k/next68k

2024-01-15 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Tue Jan 16 00:34:58 UTC 2024

Modified Files:
src/sys/arch/next68k/next68k: genassym.cf isr.h locore.s trap.c
Removed Files:
src/sys/arch/next68k/next68k: isr.c

Log Message:
Switch next68k over to common interrupt dispatch and G/C __HAVE_LEGACY_INTRCNT.
Also included is G/C of the old ssir stuff that's no longer used.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/arch/next68k/next68k/genassym.cf
cvs rdiff -u -r1.35 -r0 src/sys/arch/next68k/next68k/isr.c
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/next68k/next68k/isr.h
cvs rdiff -u -r1.81 -r1.82 src/sys/arch/next68k/next68k/locore.s
cvs rdiff -u -r1.94 -r1.95 src/sys/arch/next68k/next68k/trap.c

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



CVS commit: src/sys/arch/arm/arm32

2024-01-15 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Mon Jan 15 20:35:23 UTC 2024

Modified Files:
src/sys/arch/arm/arm32: vm_machdep.c

Log Message:
Include  with "#ifdef STACKCHECKS" guard.

The include was lost on rev 1.77 during includes cleanup and KNF, however
it is still needed with STACKCHECKS build option.


To generate a diff of this commit:
cvs rdiff -u -r1.78 -r1.79 src/sys/arch/arm/arm32/vm_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/arm/arm32/vm_machdep.c
diff -u src/sys/arch/arm/arm32/vm_machdep.c:1.78 src/sys/arch/arm/arm32/vm_machdep.c:1.79
--- src/sys/arch/arm/arm32/vm_machdep.c:1.78	Sun Mar 28 10:29:05 2021
+++ src/sys/arch/arm/arm32/vm_machdep.c	Mon Jan 15 20:35:22 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: vm_machdep.c,v 1.78 2021/03/28 10:29:05 skrll Exp $	*/
+/*	$NetBSD: vm_machdep.c,v 1.79 2024/01/15 20:35:22 andvar Exp $	*/
 
 /*
  * Copyright (c) 1994-1998 Mark Brinicombe.
@@ -44,7 +44,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.78 2021/03/28 10:29:05 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.79 2024/01/15 20:35:22 andvar Exp $");
 
 #include "opt_armfpe.h"
 #include "opt_cputypes.h"
@@ -55,6 +55,9 @@ __KERNEL_RCSID(0, "$NetBSD: vm_machdep.c
 #include 
 #include 
 #include 
+#ifdef STACKCHECKS
+#include 
+#endif
 #include 
 #include 
 



CVS commit: src/sys/arch/arm/arm32

2024-01-15 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Mon Jan 15 20:35:23 UTC 2024

Modified Files:
src/sys/arch/arm/arm32: vm_machdep.c

Log Message:
Include  with "#ifdef STACKCHECKS" guard.

The include was lost on rev 1.77 during includes cleanup and KNF, however
it is still needed with STACKCHECKS build option.


To generate a diff of this commit:
cvs rdiff -u -r1.78 -r1.79 src/sys/arch/arm/arm32/vm_machdep.c

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



CVS commit: src/sys/arch/next68k/next68k

2024-01-15 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Mon Jan 15 20:28:56 UTC 2024

Modified Files:
src/sys/arch/next68k/next68k: isr.c isr.h

Log Message:
G/C unused isrlink_evcnt().


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sys/arch/next68k/next68k/isr.c
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/next68k/next68k/isr.h

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/next68k/next68k/isr.c
diff -u src/sys/arch/next68k/next68k/isr.c:1.34 src/sys/arch/next68k/next68k/isr.c:1.35
--- src/sys/arch/next68k/next68k/isr.c:1.34	Sat Jan 13 21:40:54 2024
+++ src/sys/arch/next68k/next68k/isr.c	Mon Jan 15 20:28:56 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: isr.c,v 1.34 2024/01/13 21:40:54 thorpej Exp $ */
+/*	$NetBSD: isr.c,v 1.35 2024/01/15 20:28:56 thorpej Exp $ */
 
 /*-
  * Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: isr.c,v 1.34 2024/01/13 21:40:54 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: isr.c,v 1.35 2024/01/15 20:28:56 thorpej Exp $");
 
 #include 
 #include 
@@ -159,23 +159,6 @@ isrlink_autovec(int (*func)(void *), voi
 }
 
 /*
- * Return a pointer to the evcnt structure for
- * the specified ipl.
- */
-struct evcnt *
-isrlink_evcnt(int ipl)
-{
-
-#ifdef DIAGNOSTIC
-	if (ipl < 0 ||
-	ipl >= (sizeof(next68k_irq_evcnt) / sizeof(struct evcnt)))
-		panic("isrlink_evcnt: bad ipl %d", ipl);
-#endif
-
-	return (_irq_evcnt[ipl]);
-}
-
-/*
  * This is the dispatcher called by the low-level
  * assembly language autovectored interrupt routine.
  */

Index: src/sys/arch/next68k/next68k/isr.h
diff -u src/sys/arch/next68k/next68k/isr.h:1.9 src/sys/arch/next68k/next68k/isr.h:1.10
--- src/sys/arch/next68k/next68k/isr.h:1.9	Sat Jan 13 21:40:54 2024
+++ src/sys/arch/next68k/next68k/isr.h	Mon Jan 15 20:28:56 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: isr.h,v 1.9 2024/01/13 21:40:54 thorpej Exp $ */
+/*	$NetBSD: isr.h,v 1.10 2024/01/15 20:28:56 thorpej Exp $ */
 
 /*
  * This file was taken from mvme68k/mvme68k/isr.h
@@ -89,7 +89,6 @@ struct isr_vectored {
 extern struct evcnt next68k_irq_evcnt[];
 
 void	isrinit(void);
-struct	evcnt *isrlink_evcnt(int);
 void	isrlink_autovec(int (*)(void *), void *, int, int, struct evcnt *);
 void	isrdispatch_autovec(struct clockframe *);
 void	netintr(void);



CVS commit: src/sys/arch/next68k/next68k

2024-01-15 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Mon Jan 15 20:28:56 UTC 2024

Modified Files:
src/sys/arch/next68k/next68k: isr.c isr.h

Log Message:
G/C unused isrlink_evcnt().


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sys/arch/next68k/next68k/isr.c
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/next68k/next68k/isr.h

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



CVS commit: src/sys/arch/news68k

2024-01-15 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Mon Jan 15 20:21:51 UTC 2024

Modified Files:
src/sys/arch/news68k/dev: timer_hb.c
src/sys/arch/news68k/include: cpu.h intr.h types.h
src/sys/arch/news68k/news68k: genassym.cf locore.s machdep.c

Log Message:
G/C __HAVE_LEGACY_INTRCNT from news68k.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/news68k/dev/timer_hb.c
cvs rdiff -u -r1.50 -r1.51 src/sys/arch/news68k/include/cpu.h
cvs rdiff -u -r1.29 -r1.30 src/sys/arch/news68k/include/intr.h
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/news68k/include/types.h
cvs rdiff -u -r1.35 -r1.36 src/sys/arch/news68k/news68k/genassym.cf
cvs rdiff -u -r1.81 -r1.82 src/sys/arch/news68k/news68k/locore.s
cvs rdiff -u -r1.112 -r1.113 src/sys/arch/news68k/news68k/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/news68k/dev/timer_hb.c
diff -u src/sys/arch/news68k/dev/timer_hb.c:1.20 src/sys/arch/news68k/dev/timer_hb.c:1.21
--- src/sys/arch/news68k/dev/timer_hb.c:1.20	Mon Jan 15 00:35:23 2024
+++ src/sys/arch/news68k/dev/timer_hb.c	Mon Jan 15 20:21:50 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: timer_hb.c,v 1.20 2024/01/15 00:35:23 thorpej Exp $	*/
+/*	$NetBSD: timer_hb.c,v 1.21 2024/01/15 20:21:50 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: timer_hb.c,v 1.20 2024/01/15 00:35:23 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: timer_hb.c,v 1.21 2024/01/15 20:21:50 thorpej Exp $");
 
 #include 
 #include 
@@ -154,7 +154,8 @@ clock_intr(struct clockframe cf)
 	/* Pulse the clock intr. enable low. */
 	*ctrl_timer = 0;
 	*ctrl_timer = 1;
-	intrcnt[TIMER_LEVEL]++;
+
+	m68k_count_intr(TIMER_LEVEL);
 
 	/* Entertainment! */
 #ifdef	LED_IDLE_CHECK
@@ -164,7 +165,6 @@ clock_intr(struct clockframe cf)
 
 	/* Call common clock interrupt handler. */
 	hardclock();
-	curcpu()->ci_data.cpu_nintr++;
 }
 
 /* heartbeat LED */

Index: src/sys/arch/news68k/include/cpu.h
diff -u src/sys/arch/news68k/include/cpu.h:1.50 src/sys/arch/news68k/include/cpu.h:1.51
--- src/sys/arch/news68k/include/cpu.h:1.50	Mon Jan 15 00:35:23 2024
+++ src/sys/arch/news68k/include/cpu.h	Mon Jan 15 20:21:50 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.h,v 1.50 2024/01/15 00:35:23 thorpej Exp $	*/
+/*	$NetBSD: cpu.h,v 1.51 2024/01/15 20:21:50 thorpej Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -148,7 +148,6 @@ extern int cpuspeed;
 extern char *intiobase, *intiolimit, *extiobase;
 extern u_int intiobase_phys, intiotop_phys;
 extern u_int extiobase_phys, extiotop_phys;
-extern u_int intrcnt[];
 
 extern void *romcallvec;
 

Index: src/sys/arch/news68k/include/intr.h
diff -u src/sys/arch/news68k/include/intr.h:1.29 src/sys/arch/news68k/include/intr.h:1.30
--- src/sys/arch/news68k/include/intr.h:1.29	Mon Jan 15 00:35:23 2024
+++ src/sys/arch/news68k/include/intr.h	Mon Jan 15 20:21:50 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: intr.h,v 1.29 2024/01/15 00:35:23 thorpej Exp $	*/
+/*	$NetBSD: intr.h,v 1.30 2024/01/15 20:21:50 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 2024 The NetBSD Foundation, Inc.
@@ -41,6 +41,9 @@
 #define	MACHINE_PSL_IPL_VM		PSL_IPL5
 #define	MACHINE_PSL_IPL_SCHED		PSL_IPL7
 
+#define	MACHINE_INTREVCNT_NAMES		\
+	{ "spur", "AST", "softint", "lev3", "lev4", "lev5", "clock", "nmi" }
+
 #include 
 
 #endif	/* _NEWS68K_INTR_H_ */

Index: src/sys/arch/news68k/include/types.h
diff -u src/sys/arch/news68k/include/types.h:1.14 src/sys/arch/news68k/include/types.h:1.15
--- src/sys/arch/news68k/include/types.h:1.14	Mon Jan 15 00:35:23 2024
+++ src/sys/arch/news68k/include/types.h	Mon Jan 15 20:21:50 2024
@@ -1,7 +1,6 @@
-/*	$NetBSD: types.h,v 1.14 2024/01/15 00:35:23 thorpej Exp $	*/
+/*	$NetBSD: types.h,v 1.15 2024/01/15 20:21:50 thorpej Exp $	*/
 
 #include 
 
-#define	__HAVE_LEGACY_INTRCNT
 #define	__HAVE_MM_MD_KERNACC
 #define	__HAVE_M68K_INTR_VECTORED

Index: src/sys/arch/news68k/news68k/genassym.cf
diff -u src/sys/arch/news68k/news68k/genassym.cf:1.35 src/sys/arch/news68k/news68k/genassym.cf:1.36
--- src/sys/arch/news68k/news68k/genassym.cf:1.35	Mon Jan 15 00:35:24 2024
+++ src/sys/arch/news68k/news68k/genassym.cf	Mon Jan 15 20:21:50 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: genassym.cf,v 1.35 2024/01/15 00:35:24 thorpej Exp $
+#	$NetBSD: genassym.cf,v 1.36 2024/01/15 20:21:50 thorpej Exp $
 
 #
 # Copyright (c) 1982, 1990, 1993
@@ -115,6 +115,8 @@ define	P_VMSPACE		offsetof(struct proc, 
 
 # interrupt/fault metering
 define	CI_NINTR		offsetof(struct cpu_info, ci_data.cpu_nintr)
+define	AST_INTRCNT		((sizeof(struct evcnt)*1) + offsetof(struct evcnt, ev_count32))
+define	NMI_INTRCNT		((sizeof(struct evcnt)*7) + offsetof(struct evcnt, ev_count32))
 
 # PSL values (should just include psl.h?)
 define	PSL_S			PSL_S

Index: src/sys/arch/news68k/news68k/locore.s
diff -u src/sys/arch/news68k/news68k/locore.s:1.81 

CVS commit: src/sys/arch/news68k

2024-01-15 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Mon Jan 15 20:21:51 UTC 2024

Modified Files:
src/sys/arch/news68k/dev: timer_hb.c
src/sys/arch/news68k/include: cpu.h intr.h types.h
src/sys/arch/news68k/news68k: genassym.cf locore.s machdep.c

Log Message:
G/C __HAVE_LEGACY_INTRCNT from news68k.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/news68k/dev/timer_hb.c
cvs rdiff -u -r1.50 -r1.51 src/sys/arch/news68k/include/cpu.h
cvs rdiff -u -r1.29 -r1.30 src/sys/arch/news68k/include/intr.h
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/news68k/include/types.h
cvs rdiff -u -r1.35 -r1.36 src/sys/arch/news68k/news68k/genassym.cf
cvs rdiff -u -r1.81 -r1.82 src/sys/arch/news68k/news68k/locore.s
cvs rdiff -u -r1.112 -r1.113 src/sys/arch/news68k/news68k/machdep.c

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



CVS commit: src/sys/arch/luna68k

2024-01-15 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Mon Jan 15 20:10:34 UTC 2024

Modified Files:
src/sys/arch/luna68k/include: intr.h types.h
src/sys/arch/luna68k/luna68k: genassym.cf locore.s

Log Message:
G/C __HAVE_LEGACY_INTRCNT from luna68k.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/luna68k/include/intr.h
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/luna68k/include/types.h
cvs rdiff -u -r1.27 -r1.28 src/sys/arch/luna68k/luna68k/genassym.cf
cvs rdiff -u -r1.78 -r1.79 src/sys/arch/luna68k/luna68k/locore.s

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/luna68k/include/intr.h
diff -u src/sys/arch/luna68k/include/intr.h:1.17 src/sys/arch/luna68k/include/intr.h:1.18
--- src/sys/arch/luna68k/include/intr.h:1.17	Mon Jan 15 02:16:52 2024
+++ src/sys/arch/luna68k/include/intr.h	Mon Jan 15 20:10:33 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: intr.h,v 1.17 2024/01/15 02:16:52 thorpej Exp $	*/
+/*	$NetBSD: intr.h,v 1.18 2024/01/15 20:10:33 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 2024 The NetBSD Foundation, Inc.
@@ -41,6 +41,9 @@
 #define	MACHINE_PSL_IPL_VM		PSL_IPL4
 #define	MACHINE_PSL_IPL_SCHED		PSL_IPL5
 
+#define	MACHINE_INTREVCNT_NAMES		\
+	{ "spur", "lev1", "scsi", "network", "lev4", "clock", "serial", "nmi" }
+
 #include 
 
 #endif	/* _LUNA68K_INTR_H */

Index: src/sys/arch/luna68k/include/types.h
diff -u src/sys/arch/luna68k/include/types.h:1.9 src/sys/arch/luna68k/include/types.h:1.10
--- src/sys/arch/luna68k/include/types.h:1.9	Tue Jul  5 15:37:13 2022
+++ src/sys/arch/luna68k/include/types.h	Mon Jan 15 20:10:33 2024
@@ -1,5 +1,3 @@
-/*	$NetBSD: types.h,v 1.9 2022/07/05 15:37:13 tsutsui Exp $	*/
+/*	$NetBSD: types.h,v 1.10 2024/01/15 20:10:33 thorpej Exp $	*/
 
 #include 
-
-#define	__HAVE_LEGACY_INTRCNT

Index: src/sys/arch/luna68k/luna68k/genassym.cf
diff -u src/sys/arch/luna68k/luna68k/genassym.cf:1.27 src/sys/arch/luna68k/luna68k/genassym.cf:1.28
--- src/sys/arch/luna68k/luna68k/genassym.cf:1.27	Tue Jan  9 04:16:25 2024
+++ src/sys/arch/luna68k/luna68k/genassym.cf	Mon Jan 15 20:10:34 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: genassym.cf,v 1.27 2024/01/09 04:16:25 thorpej Exp $
+#	$NetBSD: genassym.cf,v 1.28 2024/01/15 20:10:34 thorpej Exp $
 
 #
 # Copyright (c) 1982, 1990, 1993
@@ -110,6 +110,8 @@ define	P_VMSPACE		offsetof(struct proc, 
 
 # interrupt/fault metering
 define	CI_NINTR		offsetof(struct cpu_info, ci_data.cpu_nintr)
+define	CLOCK_INTRCNT		((sizeof(struct evcnt)*5) + offsetof(struct evcnt, ev_count32))
+define	NMI_INTRCNT		((sizeof(struct evcnt)*7) + offsetof(struct evcnt, ev_count32))
 
 define	T_BUSERR		T_BUSERR
 define	T_ADDRERR		T_ADDRERR

Index: src/sys/arch/luna68k/luna68k/locore.s
diff -u src/sys/arch/luna68k/luna68k/locore.s:1.78 src/sys/arch/luna68k/luna68k/locore.s:1.79
--- src/sys/arch/luna68k/luna68k/locore.s:1.78	Mon Jan 15 19:30:15 2024
+++ src/sys/arch/luna68k/luna68k/locore.s	Mon Jan 15 20:10:34 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: locore.s,v 1.78 2024/01/15 19:30:15 thorpej Exp $ */
+/* $NetBSD: locore.s,v 1.79 2024/01/15 20:10:34 thorpej Exp $ */
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -555,7 +555,7 @@ Lbrkpt3:
  */
 
 ENTRY_NOPROFILE(lev7intr)		/* Level 7: NMI */
-	addql	#1,_C_LABEL(intrcnt)+32
+	addql	#1,_C_LABEL(m68k_intr_evcnt)+NMI_INTRCNT
 	clrl	%sp@-
 	moveml	#0x,%sp@-		| save registers
 	movl	%usp,%a0		| and save
@@ -580,7 +580,7 @@ ENTRY_NOPROFILE(lev5intr)
 	movl	%a1,%sp@-
 	jbsr	_C_LABEL(hardclock)	| hardclock()
 	addql	#4,%sp
-	addql	#1,_C_LABEL(intrcnt)+20
+	addql	#1,_C_LABEL(m68k_intr_evcnt)+CLOCK_INTRCNT
 	INTERRUPT_RESTOREREG
 1:
 	subql	#1,_C_LABEL(idepth)
@@ -830,19 +830,3 @@ GLOBAL(intiobase_phys)
 	.long	0		| PA of board's I/O registers
 GLOBAL(intiotop_phys)
 	.long	0		| PA of top of board's I/O registers
-
-GLOBAL(intrnames)
-	.asciz	"spur"
-	.asciz	"lev1"
-	.asciz	"scsi"
-	.asciz	"network"
-	.asciz	"lev4"
-	.asciz	"clock"
-	.asciz	"serial"
-	.asciz	"nmi"
-	.asciz	"statclock"
-GLOBAL(eintrnames)
-	.even
-GLOBAL(intrcnt)
-	.long	0,0,0,0,0,0,0,0,0
-GLOBAL(eintrcnt)



CVS commit: src/sys/arch/luna68k

2024-01-15 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Mon Jan 15 20:10:34 UTC 2024

Modified Files:
src/sys/arch/luna68k/include: intr.h types.h
src/sys/arch/luna68k/luna68k: genassym.cf locore.s

Log Message:
G/C __HAVE_LEGACY_INTRCNT from luna68k.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/luna68k/include/intr.h
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/luna68k/include/types.h
cvs rdiff -u -r1.27 -r1.28 src/sys/arch/luna68k/luna68k/genassym.cf
cvs rdiff -u -r1.78 -r1.79 src/sys/arch/luna68k/luna68k/locore.s

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



CVS commit: src/sys/arch/news68k

2024-01-15 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Mon Jan 15 19:54:53 UTC 2024

Modified Files:
src/sys/arch/news68k/include: vectors.h
src/sys/arch/news68k/news68k: locore.s

Log Message:
No need for our own spurious interrupt handler now that m68k_intr.c
handles them for us.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/news68k/include/vectors.h
cvs rdiff -u -r1.80 -r1.81 src/sys/arch/news68k/news68k/locore.s

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/news68k/include/vectors.h
diff -u src/sys/arch/news68k/include/vectors.h:1.2 src/sys/arch/news68k/include/vectors.h:1.3
--- src/sys/arch/news68k/include/vectors.h:1.2	Mon Jan 15 00:35:23 2024
+++ src/sys/arch/news68k/include/vectors.h	Mon Jan 15 19:54:53 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: vectors.h,v 1.2 2024/01/15 00:35:23 thorpej Exp $	*/
+/*	$NetBSD: vectors.h,v 1.3 2024/01/15 19:54:53 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 2024 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
 
 #include 
 
-#define	MACHINE_AV0_HANDLER	spurintr
+#define	MACHINE_AV0_HANDLER	intrstub_autovec
 #define	MACHINE_AV1_HANDLER	lev1intr
 #define	MACHINE_AV2_HANDLER	intrstub_autovec
 #define	MACHINE_AV3_HANDLER	lev3intr

Index: src/sys/arch/news68k/news68k/locore.s
diff -u src/sys/arch/news68k/news68k/locore.s:1.80 src/sys/arch/news68k/news68k/locore.s:1.81
--- src/sys/arch/news68k/news68k/locore.s:1.80	Mon Jan 15 00:35:24 2024
+++ src/sys/arch/news68k/news68k/locore.s	Mon Jan 15 19:54:53 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.s,v 1.80 2024/01/15 00:35:24 thorpej Exp $	*/
+/*	$NetBSD: locore.s,v 1.81 2024/01/15 19:54:53 thorpej Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -651,13 +651,6 @@ Lbrkpt3:
  * Interrupt handlers.
  */
 
-ENTRY_NOPROFILE(spurintr)	/* Level 0 */
-	addql	#1,_C_LABEL(intrcnt)+0
-	INTERRUPT_SAVEREG
-	CPUINFO_INCREMENT(CI_NINTR)
-	INTERRUPT_RESTOREREG
-	rte
-
 ENTRY_NOPROFILE(lev1intr)		/* Level 1: AST interrupt */
 	addql	#1,_C_LABEL(idepth)
 	INTERRUPT_SAVEREG



CVS commit: src/sys/arch/news68k

2024-01-15 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Mon Jan 15 19:54:53 UTC 2024

Modified Files:
src/sys/arch/news68k/include: vectors.h
src/sys/arch/news68k/news68k: locore.s

Log Message:
No need for our own spurious interrupt handler now that m68k_intr.c
handles them for us.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/news68k/include/vectors.h
cvs rdiff -u -r1.80 -r1.81 src/sys/arch/news68k/news68k/locore.s

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



CVS commit: src

2024-01-15 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Mon Jan 15 19:44:07 UTC 2024

Modified Files:
src/sys/arch/emips/emips: machdep.c
src/sys/arch/evbppc/obs405/dev: obsled.c
src/sys/arch/luna68k/luna68k: machdep.c
src/sys/arch/pmax/pmax: machdep.c
src/sys/netinet: sctp_indata.c
src/usr.sbin/altq/libaltq: parser.c

Log Message:
Fix few typos in comments, mainly s/argment/argument/.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/emips/emips/machdep.c
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/evbppc/obs405/dev/obsled.c
cvs rdiff -u -r1.110 -r1.111 src/sys/arch/luna68k/luna68k/machdep.c
cvs rdiff -u -r1.254 -r1.255 src/sys/arch/pmax/pmax/machdep.c
cvs rdiff -u -r1.13 -r1.14 src/sys/netinet/sctp_indata.c
cvs rdiff -u -r1.12 -r1.13 src/usr.sbin/altq/libaltq/parser.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/emips/emips/machdep.c
diff -u src/sys/arch/emips/emips/machdep.c:1.18 src/sys/arch/emips/emips/machdep.c:1.19
--- src/sys/arch/emips/emips/machdep.c:1.18	Fri Sep  1 06:16:45 2023
+++ src/sys/arch/emips/emips/machdep.c	Mon Jan 15 19:44:06 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.18 2023/09/01 06:16:45 andvar Exp $	*/
+/*	$NetBSD: machdep.c,v 1.19 2024/01/15 19:44:06 andvar Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -39,7 +39,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.18 2023/09/01 06:16:45 andvar Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.19 2024/01/15 19:44:06 andvar Exp $");
 
 #include "opt_ddb.h"
 
@@ -133,7 +133,7 @@ extern const struct callback callvec;
 
 /*
  * Do all the stuff that locore normally does before calling main().
- * The first 4 argments are passed by PROM monitor, and remaining two
+ * The first 4 arguments are passed by PROM monitor, and remaining two
  * are built on temporary stack by our boot loader.
  */
 void

Index: src/sys/arch/evbppc/obs405/dev/obsled.c
diff -u src/sys/arch/evbppc/obs405/dev/obsled.c:1.10 src/sys/arch/evbppc/obs405/dev/obsled.c:1.11
--- src/sys/arch/evbppc/obs405/dev/obsled.c:1.10	Tue Feb 25 18:30:08 2014
+++ src/sys/arch/evbppc/obs405/dev/obsled.c	Mon Jan 15 19:44:07 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: obsled.c,v 1.10 2014/02/25 18:30:08 pooka Exp $	*/
+/*	$NetBSD: obsled.c,v 1.11 2024/01/15 19:44:07 andvar Exp $	*/
 
 /*
  * Copyright (c) 2004 Shigeyuki Fukushima.
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: obsled.c,v 1.10 2014/02/25 18:30:08 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: obsled.c,v 1.11 2024/01/15 19:44:07 andvar Exp $");
 
 #include 
 #include 
@@ -165,7 +165,7 @@ obsled_set_state(struct obsled_softc *sc
 
 /*
  * Setting LED interface for inside kernel.
- * Argumnt `led' is 3-bit LED state (led=0-7/ON=1/OFF=0).
+ * Argument `led' is 3-bit LED state (led=0-7/ON=1/OFF=0).
  */
 void
 obs266_led_set(int led)

Index: src/sys/arch/luna68k/luna68k/machdep.c
diff -u src/sys/arch/luna68k/luna68k/machdep.c:1.110 src/sys/arch/luna68k/luna68k/machdep.c:1.111
--- src/sys/arch/luna68k/luna68k/machdep.c:1.110	Wed Dec 20 00:40:43 2023
+++ src/sys/arch/luna68k/luna68k/machdep.c	Mon Jan 15 19:44:07 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.110 2023/12/20 00:40:43 thorpej Exp $ */
+/* $NetBSD: machdep.c,v 1.111 2024/01/15 19:44:07 andvar Exp $ */
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include 			/* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.110 2023/12/20 00:40:43 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.111 2024/01/15 19:44:07 andvar Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -222,7 +222,7 @@ luna68k_init(void)
 	 *
 	 * 'bootarg' on LUNA-II has "" only.
 	 *
-	 * NetBSD/luna68k cares only the first argment; any of "sda".
+	 * NetBSD/luna68k cares only the first argument; any of "sda".
 	 */
 	bootarg[63] = '\0';
 	for (cp = bootarg; *cp != '\0'; cp++) {

Index: src/sys/arch/pmax/pmax/machdep.c
diff -u src/sys/arch/pmax/pmax/machdep.c:1.254 src/sys/arch/pmax/pmax/machdep.c:1.255
--- src/sys/arch/pmax/pmax/machdep.c:1.254	Mon Sep 28 01:20:29 2020
+++ src/sys/arch/pmax/pmax/machdep.c	Mon Jan 15 19:44:07 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.254 2020/09/28 01:20:29 simonb Exp $	*/
+/*	$NetBSD: machdep.c,v 1.255 2024/01/15 19:44:07 andvar Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -39,7 +39,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.254 2020/09/28 01:20:29 simonb Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.255 2024/01/15 19:44:07 andvar Exp $");
 
 #include "opt_ddb.h"
 #include "opt_modular.h"
@@ -128,7 +128,7 @@ extern struct consdev promcd;		/* XXX */
 
 /*
  * Do all the stuff that locore normally does before calling main().
- * The first 4 argments are passed by PROM monitor, and remaining two
+ * The first 4 arguments are 

CVS commit: src

2024-01-15 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Mon Jan 15 19:44:07 UTC 2024

Modified Files:
src/sys/arch/emips/emips: machdep.c
src/sys/arch/evbppc/obs405/dev: obsled.c
src/sys/arch/luna68k/luna68k: machdep.c
src/sys/arch/pmax/pmax: machdep.c
src/sys/netinet: sctp_indata.c
src/usr.sbin/altq/libaltq: parser.c

Log Message:
Fix few typos in comments, mainly s/argment/argument/.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/emips/emips/machdep.c
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/evbppc/obs405/dev/obsled.c
cvs rdiff -u -r1.110 -r1.111 src/sys/arch/luna68k/luna68k/machdep.c
cvs rdiff -u -r1.254 -r1.255 src/sys/arch/pmax/pmax/machdep.c
cvs rdiff -u -r1.13 -r1.14 src/sys/netinet/sctp_indata.c
cvs rdiff -u -r1.12 -r1.13 src/usr.sbin/altq/libaltq/parser.c

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



CVS commit: src/sys/arch/arm/arm

2024-01-15 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Mon Jan 15 19:34:13 UTC 2024

Modified Files:
src/sys/arch/arm/arm: disksubr_acorn.c

Log Message:
Replace format specifier from %08x to PRId64 for bp->blkno.
Exchange incorrectly placed printf() __func__ and loop arguments.

Fixes DEBUG_LABEL enabled build for acorn32.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/arm/arm/disksubr_acorn.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/arm/arm/disksubr_acorn.c
diff -u src/sys/arch/arm/arm/disksubr_acorn.c:1.13 src/sys/arch/arm/arm/disksubr_acorn.c:1.14
--- src/sys/arch/arm/arm/disksubr_acorn.c:1.13	Tue Sep 29 02:58:52 2020
+++ src/sys/arch/arm/arm/disksubr_acorn.c	Mon Jan 15 19:34:13 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: disksubr_acorn.c,v 1.13 2020/09/29 02:58:52 msaitoh Exp $	*/
+/*	$NetBSD: disksubr_acorn.c,v 1.14 2024/01/15 19:34:13 andvar Exp $	*/
 
 /*
  * Copyright (c) 1998 Christopher G. Demetriou.  All rights reserved.
@@ -97,7 +97,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: disksubr_acorn.c,v 1.13 2020/09/29 02:58:52 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: disksubr_acorn.c,v 1.14 2024/01/15 19:34:13 andvar Exp $");
 
 #include 
 #include 
@@ -255,7 +255,7 @@ filecore_label_read(dev_t dev, void (*st
 
 		bp->b_blkno = cyl * heads * sectors;
 #ifdef DEBUG_LABEL
-		printf("%s: Found RiscIX partition table @ %08x\n",
+		printf("%s: Found RiscIX partition table @ %" PRId64 "\n",
 		__func__, bp->b_blkno);
 #endif
 		bp->b_cylinder = bp->b_blkno / lp->d_secpercyl;
@@ -277,8 +277,8 @@ filecore_label_read(dev_t dev, void (*st
 		rpt = (struct riscix_partition_table *)bp->b_data;
 #ifdef DEBUG_LABEL
 		for (loop = 0; loop < NRISCIX_PARTITIONS; ++loop)
-			printf("%s: p%d: %16s %08x %08x %08x\n", loop,
-			__func__, rpt->partitions[loop].rp_name,
+			printf("%s: p%d: %16s %08x %08x %08x\n", __func__,
+			loop, rpt->partitions[loop].rp_name,
 			rpt->partitions[loop].rp_start,
 			rpt->partitions[loop].rp_length,
 			rpt->partitions[loop].rp_type);



CVS commit: src/sys/arch/arm/arm

2024-01-15 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Mon Jan 15 19:34:13 UTC 2024

Modified Files:
src/sys/arch/arm/arm: disksubr_acorn.c

Log Message:
Replace format specifier from %08x to PRId64 for bp->blkno.
Exchange incorrectly placed printf() __func__ and loop arguments.

Fixes DEBUG_LABEL enabled build for acorn32.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/arm/arm/disksubr_acorn.c

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



CVS commit: src/sys/arch/luna68k

2024-01-15 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Mon Jan 15 19:30:15 UTC 2024

Modified Files:
src/sys/arch/luna68k/include: vectors.h
src/sys/arch/luna68k/luna68k: locore.s

Log Message:
No need for our own spurious interrupt handler now that m68k_intr.c
handles them for us.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/luna68k/include/vectors.h
cvs rdiff -u -r1.77 -r1.78 src/sys/arch/luna68k/luna68k/locore.s

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/luna68k/include/vectors.h
diff -u src/sys/arch/luna68k/include/vectors.h:1.2 src/sys/arch/luna68k/include/vectors.h:1.3
--- src/sys/arch/luna68k/include/vectors.h:1.2	Mon Jan 15 02:16:52 2024
+++ src/sys/arch/luna68k/include/vectors.h	Mon Jan 15 19:30:14 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: vectors.h,v 1.2 2024/01/15 02:16:52 thorpej Exp $	*/
+/*	$NetBSD: vectors.h,v 1.3 2024/01/15 19:30:14 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 2024 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
 
 #include 
 
-#define	MACHINE_AV0_HANDLER	spurintr
+#define	MACHINE_AV0_HANDLER	intrstub_autovec
 #define	MACHINE_AV1_HANDLER	intrstub_autovec
 #define	MACHINE_AV2_HANDLER	intrstub_autovec
 #define	MACHINE_AV3_HANDLER	intrstub_autovec

Index: src/sys/arch/luna68k/luna68k/locore.s
diff -u src/sys/arch/luna68k/luna68k/locore.s:1.77 src/sys/arch/luna68k/luna68k/locore.s:1.78
--- src/sys/arch/luna68k/luna68k/locore.s:1.77	Mon Jan 15 02:16:52 2024
+++ src/sys/arch/luna68k/luna68k/locore.s	Mon Jan 15 19:30:15 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: locore.s,v 1.77 2024/01/15 02:16:52 thorpej Exp $ */
+/* $NetBSD: locore.s,v 1.78 2024/01/15 19:30:15 thorpej Exp $ */
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -554,13 +554,6 @@ Lbrkpt3:
  * Interrupt handlers.
  */
 
-ENTRY_NOPROFILE(spurintr)		/* Level 0 */
-	addql	#1,_C_LABEL(intrcnt)+0
-	INTERRUPT_SAVEREG
-	CPUINFO_INCREMENT(CI_NINTR)
-	INTERRUPT_RESTOREREG
-	jra	_ASM_LABEL(rei)
-
 ENTRY_NOPROFILE(lev7intr)		/* Level 7: NMI */
 	addql	#1,_C_LABEL(intrcnt)+32
 	clrl	%sp@-



CVS commit: src/sys/arch/luna68k

2024-01-15 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Mon Jan 15 19:30:15 UTC 2024

Modified Files:
src/sys/arch/luna68k/include: vectors.h
src/sys/arch/luna68k/luna68k: locore.s

Log Message:
No need for our own spurious interrupt handler now that m68k_intr.c
handles them for us.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/luna68k/include/vectors.h
cvs rdiff -u -r1.77 -r1.78 src/sys/arch/luna68k/luna68k/locore.s

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



CVS commit: src/sys/arch/cesfic

2024-01-15 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Mon Jan 15 19:28:06 UTC 2024

Modified Files:
src/sys/arch/cesfic/cesfic: genassym.cf locore.s
src/sys/arch/cesfic/include: vectors.h

Log Message:
No need for our own spurious interrupt handler now that m68k_intr.c
handles them for us.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/cesfic/cesfic/genassym.cf
cvs rdiff -u -r1.42 -r1.43 src/sys/arch/cesfic/cesfic/locore.s
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/cesfic/include/vectors.h

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/cesfic/cesfic/genassym.cf
diff -u src/sys/arch/cesfic/cesfic/genassym.cf:1.22 src/sys/arch/cesfic/cesfic/genassym.cf:1.23
--- src/sys/arch/cesfic/cesfic/genassym.cf:1.22	Mon Jan 15 19:11:31 2024
+++ src/sys/arch/cesfic/cesfic/genassym.cf	Mon Jan 15 19:28:06 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: genassym.cf,v 1.22 2024/01/15 19:11:31 thorpej Exp $
+#	$NetBSD: genassym.cf,v 1.23 2024/01/15 19:28:06 thorpej Exp $
 
 #
 # Copyright (c) 1982, 1990, 1993
@@ -110,7 +110,6 @@ define	EVCNT_COUNT		offsetof(struct evcn
 
 # interrupt/fault metering
 define	CI_NINTR		offsetof(struct cpu_info, ci_data.cpu_nintr)
-define	SPUR_INTRCNT		((sizeof(struct evcnt)*0) + offsetof(struct evcnt, ev_count32))
 define	CLOCK_INTRCNT		((sizeof(struct evcnt)*6) + offsetof(struct evcnt, ev_count32))
 define	NMI_INTRCNT		((sizeof(struct evcnt)*7) + offsetof(struct evcnt, ev_count32))
 

Index: src/sys/arch/cesfic/cesfic/locore.s
diff -u src/sys/arch/cesfic/cesfic/locore.s:1.42 src/sys/arch/cesfic/cesfic/locore.s:1.43
--- src/sys/arch/cesfic/cesfic/locore.s:1.42	Mon Jan 15 19:11:31 2024
+++ src/sys/arch/cesfic/cesfic/locore.s	Mon Jan 15 19:28:06 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.s,v 1.42 2024/01/15 19:11:31 thorpej Exp $	*/
+/*	$NetBSD: locore.s,v 1.43 2024/01/15 19:28:06 thorpej Exp $	*/
 
 /*
  * Copyright (c) 1980, 1990, 1993
@@ -601,18 +601,8 @@ Lbrkpt2:
 
 /*
  * Interrupt handlers.
- * All device interrupts are auto-vectored.  The CPU provides
- * the vector 0x18+level.  Note we count spurious interrupts, but
- * we don't do anything else with them.
  */
 
-ENTRY_NOPROFILE(spurintr)	/* level 0 */
-	addql	#1,_C_LABEL(m68k_intr_evcnt)+SPUR_INTRCNT
-	INTERRUPT_SAVEREG
-	CPUINFO_INCREMENT(CI_NINTR)
-	INTERRUPT_RESTOREREG
-	jra	_ASM_LABEL(rei)
-
 ENTRY_NOPROFILE(lev6intr)	/* Level 6: clock */
 	INTERRUPT_SAVEREG
 	/* XXX */

Index: src/sys/arch/cesfic/include/vectors.h
diff -u src/sys/arch/cesfic/include/vectors.h:1.2 src/sys/arch/cesfic/include/vectors.h:1.3
--- src/sys/arch/cesfic/include/vectors.h:1.2	Mon Jan 15 03:07:14 2024
+++ src/sys/arch/cesfic/include/vectors.h	Mon Jan 15 19:28:06 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: vectors.h,v 1.2 2024/01/15 03:07:14 thorpej Exp $	*/
+/*	$NetBSD: vectors.h,v 1.3 2024/01/15 19:28:06 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 2024 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
 
 #include 
 
-#define	MACHINE_AV0_HANDLER	spurintr
+#define	MACHINE_AV0_HANDLER	intrstub_autovec
 #define	MACHINE_AV1_HANDLER	intrstub_autovec
 #define	MACHINE_AV2_HANDLER	intrstub_autovec
 #define	MACHINE_AV3_HANDLER	intrstub_autovec



CVS commit: src/sys/arch/cesfic

2024-01-15 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Mon Jan 15 19:28:06 UTC 2024

Modified Files:
src/sys/arch/cesfic/cesfic: genassym.cf locore.s
src/sys/arch/cesfic/include: vectors.h

Log Message:
No need for our own spurious interrupt handler now that m68k_intr.c
handles them for us.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/cesfic/cesfic/genassym.cf
cvs rdiff -u -r1.42 -r1.43 src/sys/arch/cesfic/cesfic/locore.s
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/cesfic/include/vectors.h

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



CVS commit: src/sys/arch/m68k/m68k

2024-01-15 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Mon Jan 15 19:27:16 UTC 2024

Modified Files:
src/sys/arch/m68k/m68k: m68k_intr.c

Log Message:
Insert a spurious interrupt handler at auto-vector IPL 0 that simply
abosrbs them.  They'll get counted during the normal course of auto-vector
interrupt handling.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/m68k/m68k/m68k_intr.c

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



CVS commit: src/sys/arch/m68k/m68k

2024-01-15 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Mon Jan 15 19:27:16 UTC 2024

Modified Files:
src/sys/arch/m68k/m68k: m68k_intr.c

Log Message:
Insert a spurious interrupt handler at auto-vector IPL 0 that simply
abosrbs them.  They'll get counted during the normal course of auto-vector
interrupt handling.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/m68k/m68k/m68k_intr.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/m68k/m68k/m68k_intr.c
diff -u src/sys/arch/m68k/m68k/m68k_intr.c:1.6 src/sys/arch/m68k/m68k/m68k_intr.c:1.7
--- src/sys/arch/m68k/m68k/m68k_intr.c:1.6	Mon Jan 15 18:47:03 2024
+++ src/sys/arch/m68k/m68k/m68k_intr.c	Mon Jan 15 19:27:16 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: m68k_intr.c,v 1.6 2024/01/15 18:47:03 thorpej Exp $	*/
+/*	$NetBSD: m68k_intr.c,v 1.7 2024/01/15 19:27:16 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 1996, 2023, 2024 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: m68k_intr.c,v 1.6 2024/01/15 18:47:03 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: m68k_intr.c,v 1.7 2024/01/15 19:27:16 thorpej Exp $");
 
 #define	_M68K_INTR_PRIVATE
 
@@ -110,6 +110,24 @@ const uint16_t ipl2psl_table[NIPL] = {
 	[IPL_HIGH]	 = PSL_S | PSL_IPL7,
 };
 
+/*
+ * m68k_spurintr --
+ *	Interrupt handler for the "spurious interrupt" that comes in
+ *	on auto-vector level 0.  All we do is claim it; it gets counted
+ *	during the normal course of auto-vector interrupt handling.
+ */
+static int
+m68k_spurintr(void *arg)
+{
+	return 1;
+}
+
+static struct m68k_intrhand m68k_spurintr_ih = {
+	.ih_func  = m68k_spurintr,
+	.ih_arg   = m68k_spurintr,
+	.ih_evcnt = ,
+};
+
 static struct m68k_intrhand *
 m68k_ih_stdalloc(int km_flag)
 {
@@ -140,7 +158,9 @@ static void
 m68k_ih_free(struct m68k_intrhand *ih)
 {
 	KASSERT(ih_allocfuncs != NULL);
-	ih_allocfuncs->free(ih);
+	if (__predict_true(ih != _spurintr_ih)) {
+		ih_allocfuncs->free(ih);
+	}
 }
 
 #ifdef __HAVE_M68K_INTR_VECTORED
@@ -219,6 +239,8 @@ m68k_intr_init(const struct m68k_ih_allo
 		evcnt_attach_static(_intr_evcnt[i]);
 #endif
 	}
+	LIST_INSERT_HEAD(_intrhands_autovec[0],
+	_spurintr_ih, ih_link);
 }
 
 /*



CVS commit: src/sys/arch/cesfic

2024-01-15 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Mon Jan 15 19:11:31 UTC 2024

Modified Files:
src/sys/arch/cesfic/cesfic: genassym.cf locore.s
src/sys/arch/cesfic/include: intr.h types.h

Log Message:
G/C __HAVE_LEGACY_INTRCNT from cesfic.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/cesfic/cesfic/genassym.cf
cvs rdiff -u -r1.41 -r1.42 src/sys/arch/cesfic/cesfic/locore.s
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/cesfic/include/intr.h
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/cesfic/include/types.h

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/cesfic/cesfic/genassym.cf
diff -u src/sys/arch/cesfic/cesfic/genassym.cf:1.21 src/sys/arch/cesfic/cesfic/genassym.cf:1.22
--- src/sys/arch/cesfic/cesfic/genassym.cf:1.21	Tue Jan  9 04:16:24 2024
+++ src/sys/arch/cesfic/cesfic/genassym.cf	Mon Jan 15 19:11:31 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: genassym.cf,v 1.21 2024/01/09 04:16:24 thorpej Exp $
+#	$NetBSD: genassym.cf,v 1.22 2024/01/15 19:11:31 thorpej Exp $
 
 #
 # Copyright (c) 1982, 1990, 1993
@@ -38,6 +38,7 @@ include 
 include 
 include 
 include 
+include 
 
 include 
 
@@ -104,8 +105,14 @@ define	P_FLAG			offsetof(struct proc, p_
 define	P_RASLIST		offsetof(struct proc, p_raslist)
 define	P_VMSPACE		offsetof(struct proc, p_vmspace)
 
+# event counter
+define	EVCNT_COUNT		offsetof(struct evcnt, ev_count)
+
 # interrupt/fault metering
 define	CI_NINTR		offsetof(struct cpu_info, ci_data.cpu_nintr)
+define	SPUR_INTRCNT		((sizeof(struct evcnt)*0) + offsetof(struct evcnt, ev_count32))
+define	CLOCK_INTRCNT		((sizeof(struct evcnt)*6) + offsetof(struct evcnt, ev_count32))
+define	NMI_INTRCNT		((sizeof(struct evcnt)*7) + offsetof(struct evcnt, ev_count32))
 
 # PSL values (should just include psl.h?)
 define	PSL_S			PSL_S
@@ -175,6 +182,3 @@ define	SYS_compat_13_sigreturn13 SYS_com
 # errno
 define	EFAULT			EFAULT
 define	ENAMETOOLONG		ENAMETOOLONG
-
-# event counter
-define	EVCNT_COUNT		offsetof(struct evcnt, ev_count)

Index: src/sys/arch/cesfic/cesfic/locore.s
diff -u src/sys/arch/cesfic/cesfic/locore.s:1.41 src/sys/arch/cesfic/cesfic/locore.s:1.42
--- src/sys/arch/cesfic/cesfic/locore.s:1.41	Mon Jan 15 03:07:14 2024
+++ src/sys/arch/cesfic/cesfic/locore.s	Mon Jan 15 19:11:31 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.s,v 1.41 2024/01/15 03:07:14 thorpej Exp $	*/
+/*	$NetBSD: locore.s,v 1.42 2024/01/15 19:11:31 thorpej Exp $	*/
 
 /*
  * Copyright (c) 1980, 1990, 1993
@@ -607,7 +607,7 @@ Lbrkpt2:
  */
 
 ENTRY_NOPROFILE(spurintr)	/* level 0 */
-	addql	#1,_C_LABEL(intrcnt)+0
+	addql	#1,_C_LABEL(m68k_intr_evcnt)+SPUR_INTRCNT
 	INTERRUPT_SAVEREG
 	CPUINFO_INCREMENT(CI_NINTR)
 	INTERRUPT_RESTOREREG
@@ -621,7 +621,7 @@ ENTRY_NOPROFILE(lev6intr)	/* Level 6: cl
 	movl %d0, %a0@
 	btst #2, %d0
 	jeq 1f
-	addql	#1,_C_LABEL(intrcnt)+24
+	addql	#1,_C_LABEL(m68k_intr_evcnt)+CLOCK_INTRCNT
 	lea	%sp@(0), %a1		| a1 = 
 	movl	%a1, %sp@-
 	jbsr	_C_LABEL(hardclock)	| hardclock()
@@ -636,7 +636,7 @@ ENTRY_NOPROFILE(lev6intr)	/* Level 6: cl
 	jra	_ASM_LABEL(rei)		| all done
 
 ENTRY_NOPROFILE(lev7intr)	/* level 7: parity errors, reset key */
-	addql	#1,_C_LABEL(intrcnt)+28
+	addql	#1,_C_LABEL(m68k_intr_evcnt)+NMI_INTRCNT
 	clrl	%sp@-
 	moveml	#0x,%sp@-		| save registers
 	movl	%usp,%a0			| and save
@@ -844,19 +844,3 @@ fulltflush:
 fullcflush:
 	.long	0
 #endif
-
-/* interrupt counters */
-GLOBAL(intrnames)
-	.asciz	"spur"
-	.asciz	"lev1"
-	.asciz	"lev2"
-	.asciz	"lev3"
-	.asciz	"lev4"
-	.asciz	"lev5"
-	.asciz	"clock"
-	.asciz	"nmi"
-GLOBAL(eintrnames)
-	.even
-GLOBAL(intrcnt)
-	.long	0,0,0,0,0,0,0,0
-GLOBAL(eintrcnt)

Index: src/sys/arch/cesfic/include/intr.h
diff -u src/sys/arch/cesfic/include/intr.h:1.16 src/sys/arch/cesfic/include/intr.h:1.17
--- src/sys/arch/cesfic/include/intr.h:1.16	Mon Jan 15 03:07:14 2024
+++ src/sys/arch/cesfic/include/intr.h	Mon Jan 15 19:11:31 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: intr.h,v 1.16 2024/01/15 03:07:14 thorpej Exp $	*/
+/*	$NetBSD: intr.h,v 1.17 2024/01/15 19:11:31 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 2024 The NetBSD Foundation, Inc.
@@ -41,6 +41,9 @@
 #define	MACHINE_PSL_IPL_VM		PSL_IPL4
 #define	MACHINE_PSL_IPL_SCHED		PSL_IPL6
 
+#define	MACHINE_INTREVCNT_NAMES		\
+	{ "spur", "lev1", "lev2", "lev3", "lev4", "lev5", "clock", "nmi" }
+
 #include 
 
 #endif	/* _LUNA68K_INTR_H */

Index: src/sys/arch/cesfic/include/types.h
diff -u src/sys/arch/cesfic/include/types.h:1.7 src/sys/arch/cesfic/include/types.h:1.8
--- src/sys/arch/cesfic/include/types.h:1.7	Thu Apr  1 04:43:00 2021
+++ src/sys/arch/cesfic/include/types.h	Mon Jan 15 19:11:31 2024
@@ -1,5 +1,3 @@
-/* $NetBSD: types.h,v 1.7 2021/04/01 04:43:00 simonb Exp $ */
+/* $NetBSD: types.h,v 1.8 2024/01/15 19:11:31 thorpej Exp $ */
 
 #include 
-
-#define	__HAVE_LEGACY_INTRCNT



CVS commit: src/sys/arch/cesfic

2024-01-15 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Mon Jan 15 19:11:31 UTC 2024

Modified Files:
src/sys/arch/cesfic/cesfic: genassym.cf locore.s
src/sys/arch/cesfic/include: intr.h types.h

Log Message:
G/C __HAVE_LEGACY_INTRCNT from cesfic.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/cesfic/cesfic/genassym.cf
cvs rdiff -u -r1.41 -r1.42 src/sys/arch/cesfic/cesfic/locore.s
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/cesfic/include/intr.h
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/cesfic/include/types.h

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



CVS commit: src/sys/arch

2024-01-15 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Mon Jan 15 18:47:03 UTC 2024

Modified Files:
src/sys/arch/m68k/include: intr.h
src/sys/arch/m68k/m68k: m68k_intr.c
src/sys/arch/sun3/sun3: clock.c
src/sys/arch/sun3/sun3x: clock.c

Log Message:
Provide a m68k_count_intr() macro that hides the details of how interrupts
are counted, and also ensures that ci_data.cpu_nintr is incremented.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/m68k/include/intr.h
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/m68k/m68k/m68k_intr.c
cvs rdiff -u -r1.67 -r1.68 src/sys/arch/sun3/sun3/clock.c
cvs rdiff -u -r1.43 -r1.44 src/sys/arch/sun3/sun3x/clock.c

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



CVS commit: src/sys/arch

2024-01-15 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Mon Jan 15 18:47:03 UTC 2024

Modified Files:
src/sys/arch/m68k/include: intr.h
src/sys/arch/m68k/m68k: m68k_intr.c
src/sys/arch/sun3/sun3: clock.c
src/sys/arch/sun3/sun3x: clock.c

Log Message:
Provide a m68k_count_intr() macro that hides the details of how interrupts
are counted, and also ensures that ci_data.cpu_nintr is incremented.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/m68k/include/intr.h
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/m68k/m68k/m68k_intr.c
cvs rdiff -u -r1.67 -r1.68 src/sys/arch/sun3/sun3/clock.c
cvs rdiff -u -r1.43 -r1.44 src/sys/arch/sun3/sun3x/clock.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/m68k/include/intr.h
diff -u src/sys/arch/m68k/include/intr.h:1.3 src/sys/arch/m68k/include/intr.h:1.4
--- src/sys/arch/m68k/include/intr.h:1.3	Mon Jan 15 17:12:00 2024
+++ src/sys/arch/m68k/include/intr.h	Mon Jan 15 18:47:03 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: intr.h,v 1.3 2024/01/15 17:12:00 thorpej Exp $	*/
+/*	$NetBSD: intr.h,v 1.4 2024/01/15 18:47:03 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 2023, 2024 The NetBSD Foundation, Inc.
@@ -134,13 +134,27 @@ struct m68k_ih_allocfuncs;
 
 #include 
 
-#ifndef __HAVE_LEGACY_INTRCNT
+#ifdef __HAVE_LEGACY_INTRCNT
+#define	m68k_count_intr(x)		\
+do {	\
+	extern u_int intrcnt[];		\
+	intrcnt[(x)]++;			\
+	curcpu()->ci_data.cpu_nintr++;	\
+} while (/*CONSTCOND*/0)
+#else
 /*
  * This is exposed here so that platform-specific interrupt handlers
  * can access it.
  */
 extern struct evcnt m68k_intr_evcnt[];
-#endif
+
+#define	m68k_count_intr(x)		\
+do {	\
+	/* 32-bit counter should be sufficient for m68k. */		\
+	m68k_intr_evcnt[(x)].ev_count32++;\
+	curcpu()->ci_data.cpu_nintr++;	\
+} while (/*CONSTCOND*/0)
+#endif /* __HAVE_LEGACY_INTRCNT */
 
 /*
  * Common m68k interrupt dispatch:

Index: src/sys/arch/m68k/m68k/m68k_intr.c
diff -u src/sys/arch/m68k/m68k/m68k_intr.c:1.5 src/sys/arch/m68k/m68k/m68k_intr.c:1.6
--- src/sys/arch/m68k/m68k/m68k_intr.c:1.5	Mon Jan 15 17:12:00 2024
+++ src/sys/arch/m68k/m68k/m68k_intr.c	Mon Jan 15 18:47:03 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: m68k_intr.c,v 1.5 2024/01/15 17:12:00 thorpej Exp $	*/
+/*	$NetBSD: m68k_intr.c,v 1.6 2024/01/15 18:47:03 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 1996, 2023, 2024 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: m68k_intr.c,v 1.5 2024/01/15 17:12:00 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: m68k_intr.c,v 1.6 2024/01/15 18:47:03 thorpej Exp $");
 
 #define	_M68K_INTR_PRIVATE
 
@@ -77,10 +77,7 @@ static struct m68k_intrhand_list m68k_in
 static struct m68k_intrhand *m68k_intrhands_vectored[NVECHANDS];
 #endif
 
-#ifdef __HAVE_LEGACY_INTRCNT
-extern u_int intrcnt[];
-#define	INTRCNT(x)	intrcnt[(x)]++
-#else
+#ifndef __HAVE_LEGACY_INTRCNT
 #ifndef MACHINE_INTREVCNT_NAMES
 #define	MACHINE_INTREVCNT_NAMES		\
 	{ "spur", "lev1", "lev2", "lev3", "lev4", "lev5", "lev6", "nmi" }
@@ -100,8 +97,6 @@ struct evcnt m68k_intr_evcnt[] = {
 __CTASSERT(__arraycount(m68k_intr_evcnt) == NAUTOVECTORS);
 
 #undef INTRCNT_INIT
-
-#define	INTRCNT(x)	m68k_intr_evcnt[(x)].ev_count++
 #endif /* __HAVE_LEGACY_INTRCNT */
 
 const uint16_t ipl2psl_table[NIPL] = {
@@ -364,8 +359,7 @@ m68k_intr_autovec(struct clockframe fram
 
 	idepth++;
 
-	INTRCNT(ipl);
-	curcpu()->ci_data.cpu_nintr++;
+	m68k_count_intr(ipl);
 
 	LIST_FOREACH(ih, _intrhands_autovec[ipl], ih_link) {
 		void *arg = ih->ih_arg ? ih->ih_arg : 
@@ -400,8 +394,7 @@ m68k_intr_vectored(struct clockframe fra
 
 	idepth++;
 
-	INTRCNT(ipl);
-	curcpu()->ci_data.cpu_nintr++;
+	m68k_count_intr(ipl);
 
 #ifdef DIAGNOSTIC
 	if (vec < MACHINE_USERVEC_START || vec >= NVECTORS) {

Index: src/sys/arch/sun3/sun3/clock.c
diff -u src/sys/arch/sun3/sun3/clock.c:1.67 src/sys/arch/sun3/sun3/clock.c:1.68
--- src/sys/arch/sun3/sun3/clock.c:1.67	Mon Jan 15 17:40:35 2024
+++ src/sys/arch/sun3/sun3/clock.c	Mon Jan 15 18:47:03 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: clock.c,v 1.67 2024/01/15 17:40:35 thorpej Exp $	*/
+/*	$NetBSD: clock.c,v 1.68 2024/01/15 18:47:03 thorpej Exp $	*/
 
 /*
  * Copyright (c) 1982, 1990, 1993
@@ -83,7 +83,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.67 2024/01/15 17:40:35 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.68 2024/01/15 18:47:03 thorpej Exp $");
 
 #include 
 #include 
@@ -316,8 +316,7 @@ clock_intr(struct clockframe cf)
 	/* Read the clock intr. reg. AGAIN! */
 	intersil_clear();
 
-	m68k_intr_evcnt[CLOCK_PRI].ev_count++;
-	curcpu()->ci_data.cpu_nintr++;
+	m68k_count_intr(CLOCK_PRI);
 
 	{ /* Entertainment! */
 #ifdef	LED_IDLE_CHECK

Index: src/sys/arch/sun3/sun3x/clock.c
diff -u src/sys/arch/sun3/sun3x/clock.c:1.43 src/sys/arch/sun3/sun3x/clock.c:1.44
--- src/sys/arch/sun3/sun3x/clock.c:1.43	Mon 

CVS commit: src/sys/sys

2024-01-15 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Mon Jan 15 18:15:37 UTC 2024

Modified Files:
src/sys/sys: device.h

Log Message:
Revert unintended commit (didn't hit CTRL-C fast enough I guess).


To generate a diff of this commit:
cvs rdiff -u -r1.187 -r1.188 src/sys/sys/device.h

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

Modified files:

Index: src/sys/sys/device.h
diff -u src/sys/sys/device.h:1.187 src/sys/sys/device.h:1.188
--- src/sys/sys/device.h:1.187	Mon Jan 15 18:14:23 2024
+++ src/sys/sys/device.h	Mon Jan 15 18:15:37 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: device.h,v 1.187 2024/01/15 18:14:23 thorpej Exp $ */
+/* $NetBSD: device.h,v 1.188 2024/01/15 18:15:37 thorpej Exp $ */
 
 /*
  * Copyright (c) 2021 The NetBSD Foundation, Inc.
@@ -622,16 +622,11 @@ bool		devhandle_is_valid(devhandle_t);
 devhandle_t	devhandle_invalid(void);
 devhandle_type_t devhandle_type(devhandle_t);
 int		devhandle_compare(devhandle_t, devhandle_t);
-devhandle_t	devhandle_subclass(devhandle_t, struct devhandle_impl *,
-		device_call_t (*)(devhandle_t, const char *,
-  devhandle_t *));
 
 device_call_t	devhandle_lookup_device_call(devhandle_t, const char *,
 		devhandle_t *);
-void		devhandle_impl_subclass(struct devhandle_impl *,
-		const struct devhandle_impl *,
-		device_call_t (*)(devhandle_t, const char *,
-  devhandle_t *));
+void		devhandle_impl_inherit(struct devhandle_impl *,
+		const struct devhandle_impl *);
 
 device_t	deviter_first(deviter_t *, deviter_flags_t);
 void		deviter_init(deviter_t *, deviter_flags_t);
@@ -722,13 +717,10 @@ struct device_call_generic {
 	void *args;
 };
 
-int		device_call_generic(device_t, devhandle_t,
-		const struct device_call_generic *);
+int	device_call_generic(device_t, const struct device_call_generic *);
 
 #define	device_call(dev, call)		\
-	device_call_generic((dev), device_handle(dev), &(call)->generic)
-#define	devhandle_call(handle, call)	\
-	device_call_generic(NULL, (handle), &(call)->generic)
+	device_call_generic((dev), &(call)->generic)
 
 #endif /* _KERNEL */
 



CVS commit: src/sys/sys

2024-01-15 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Mon Jan 15 18:15:37 UTC 2024

Modified Files:
src/sys/sys: device.h

Log Message:
Revert unintended commit (didn't hit CTRL-C fast enough I guess).


To generate a diff of this commit:
cvs rdiff -u -r1.187 -r1.188 src/sys/sys/device.h

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



CVS commit: src/sys/sys

2024-01-15 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Mon Jan 15 18:14:24 UTC 2024

Modified Files:
src/sys/sys: device.h evcnt.h

Log Message:
Provide an ev_count32 field for situations where a 32-bit counter is
sufficient (and, notably, might be desirable to avoid 64-bit math on
an older 32-bit platform).  This is overlaid on the 64-bit counter
field, and simply references the correct half based on byte order.


To generate a diff of this commit:
cvs rdiff -u -r1.186 -r1.187 src/sys/sys/device.h
cvs rdiff -u -r1.10 -r1.11 src/sys/sys/evcnt.h

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

Modified files:

Index: src/sys/sys/device.h
diff -u src/sys/sys/device.h:1.186 src/sys/sys/device.h:1.187
--- src/sys/sys/device.h:1.186	Mon May 22 14:58:22 2023
+++ src/sys/sys/device.h	Mon Jan 15 18:14:23 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: device.h,v 1.186 2023/05/22 14:58:22 riastradh Exp $ */
+/* $NetBSD: device.h,v 1.187 2024/01/15 18:14:23 thorpej Exp $ */
 
 /*
  * Copyright (c) 2021 The NetBSD Foundation, Inc.
@@ -622,11 +622,16 @@ bool		devhandle_is_valid(devhandle_t);
 devhandle_t	devhandle_invalid(void);
 devhandle_type_t devhandle_type(devhandle_t);
 int		devhandle_compare(devhandle_t, devhandle_t);
+devhandle_t	devhandle_subclass(devhandle_t, struct devhandle_impl *,
+		device_call_t (*)(devhandle_t, const char *,
+  devhandle_t *));
 
 device_call_t	devhandle_lookup_device_call(devhandle_t, const char *,
 		devhandle_t *);
-void		devhandle_impl_inherit(struct devhandle_impl *,
-		const struct devhandle_impl *);
+void		devhandle_impl_subclass(struct devhandle_impl *,
+		const struct devhandle_impl *,
+		device_call_t (*)(devhandle_t, const char *,
+  devhandle_t *));
 
 device_t	deviter_first(deviter_t *, deviter_flags_t);
 void		deviter_init(deviter_t *, deviter_flags_t);
@@ -717,10 +722,13 @@ struct device_call_generic {
 	void *args;
 };
 
-int	device_call_generic(device_t, const struct device_call_generic *);
+int		device_call_generic(device_t, devhandle_t,
+		const struct device_call_generic *);
 
 #define	device_call(dev, call)		\
-	device_call_generic((dev), &(call)->generic)
+	device_call_generic((dev), device_handle(dev), &(call)->generic)
+#define	devhandle_call(handle, call)	\
+	device_call_generic(NULL, (handle), &(call)->generic)
 
 #endif /* _KERNEL */
 

Index: src/sys/sys/evcnt.h
diff -u src/sys/sys/evcnt.h:1.10 src/sys/sys/evcnt.h:1.11
--- src/sys/sys/evcnt.h:1.10	Tue Aug  3 23:12:14 2021
+++ src/sys/sys/evcnt.h	Mon Jan 15 18:14:23 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: evcnt.h,v 1.10 2021/08/03 23:12:14 andvar Exp $	*/
+/*	$NetBSD: evcnt.h,v 1.11 2024/01/15 18:14:23 thorpej Exp $	*/
 
 /*
  * Copyright (c) 1996, 2000 Christopher G. Demetriou
@@ -83,7 +83,10 @@
  */
 
 struct evcnt {
-	uint64_t	ev_count;	/* how many have occurred */
+	union {
+		uint64_t ev_count;	/* how many have occurred */
+		uint32_t ev__count32[2];
+	};
 	TAILQ_ENTRY(evcnt) ev_list;	/* entry on list of all counters */
 	unsigned char	ev_type;	/* counter type; see below */
 	unsigned char	ev_grouplen;	/* 'group' len, excluding NUL */
@@ -95,6 +98,16 @@ struct evcnt {
 };
 TAILQ_HEAD(evcntlist, evcnt);
 
+/*
+ * For 32-bit counters, ev_count32 is the correct half of the 64-bit
+ * counter field.
+ */
+#if _BYTE_ORDER == _BIG_ENDIAN
+#define	ev_count32	ev__count32[1]
+#elif _BYTE_ORDER == _LITTLE_ENDIAN
+#define	ev_count32	ev__count32[0]
+#endif
+
 /* maximum group/name lengths, including trailing NUL */
 #define	EVCNT_STRING_MAX	255
 



CVS commit: src/sys/sys

2024-01-15 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Mon Jan 15 18:14:24 UTC 2024

Modified Files:
src/sys/sys: device.h evcnt.h

Log Message:
Provide an ev_count32 field for situations where a 32-bit counter is
sufficient (and, notably, might be desirable to avoid 64-bit math on
an older 32-bit platform).  This is overlaid on the 64-bit counter
field, and simply references the correct half based on byte order.


To generate a diff of this commit:
cvs rdiff -u -r1.186 -r1.187 src/sys/sys/device.h
cvs rdiff -u -r1.10 -r1.11 src/sys/sys/evcnt.h

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



CVS commit: src/bin/cp

2024-01-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Jan 15 17:41:06 UTC 2024

Modified Files:
src/bin/cp: utils.c

Log Message:
PR/57857: Ricardo Branco: Always copy regular files, even if they appear to
be zero-sized.


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/bin/cp/utils.c

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

Modified files:

Index: src/bin/cp/utils.c
diff -u src/bin/cp/utils.c:1.49 src/bin/cp/utils.c:1.50
--- src/bin/cp/utils.c:1.49	Sun May 17 19:34:11 2020
+++ src/bin/cp/utils.c	Mon Jan 15 12:41:06 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: utils.c,v 1.49 2020/05/17 23:34:11 christos Exp $ */
+/* $NetBSD: utils.c,v 1.50 2024/01/15 17:41:06 christos Exp $ */
 
 /*-
  * Copyright (c) 1991, 1993, 1994
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)utils.c	8.3 (Berkeley) 4/1/94";
 #else
-__RCSID("$NetBSD: utils.c,v 1.49 2020/05/17 23:34:11 christos Exp $");
+__RCSID("$NetBSD: utils.c,v 1.50 2024/01/15 17:41:06 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -179,10 +179,10 @@ copy_file(FTSENT *entp, int dne)
 	rval = 0;
 
 	/* 
-	 * There's no reason to do anything other than close the file
-	 * now if it's regular and empty, so let's not bother.
+	 * We always copy regular files, even if they appear to be 0-sized
+	 * because kernfs and procfs don't return file sizes.
 	 */
-	bool need_copy = !S_ISREG(fs->st_mode) || fs->st_size > 0;
+	bool need_copy = S_ISREG(fs->st_mode) || fs->st_size > 0;
 
 	struct finfo fi;
 



CVS commit: src/bin/cp

2024-01-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Jan 15 17:41:06 UTC 2024

Modified Files:
src/bin/cp: utils.c

Log Message:
PR/57857: Ricardo Branco: Always copy regular files, even if they appear to
be zero-sized.


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/bin/cp/utils.c

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



CVS commit: src/sys/arch

2024-01-15 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Mon Jan 15 17:40:35 UTC 2024

Modified Files:
src/sys/arch/sun2/sun2: locore.s
src/sys/arch/sun3/sun3: clock.c locore.s
src/sys/arch/sun3/sun3x: clock.c locore.s
src/sys/arch/sun68k/include: intr.h types.h

Log Message:
G/C __HAVE_LEGACY_INTRCNT from the sun68k platforms.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sys/arch/sun2/sun2/locore.s
cvs rdiff -u -r1.66 -r1.67 src/sys/arch/sun3/sun3/clock.c
cvs rdiff -u -r1.106 -r1.107 src/sys/arch/sun3/sun3/locore.s
cvs rdiff -u -r1.42 -r1.43 src/sys/arch/sun3/sun3x/clock.c
cvs rdiff -u -r1.74 -r1.75 src/sys/arch/sun3/sun3x/locore.s
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/sun68k/include/intr.h
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/sun68k/include/types.h

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/sun2/sun2/locore.s
diff -u src/sys/arch/sun2/sun2/locore.s:1.34 src/sys/arch/sun2/sun2/locore.s:1.35
--- src/sys/arch/sun2/sun2/locore.s:1.34	Sun Jan 14 22:34:54 2024
+++ src/sys/arch/sun2/sun2/locore.s	Mon Jan 15 17:40:34 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.s,v 1.34 2024/01/14 22:34:54 thorpej Exp $	*/
+/*	$NetBSD: locore.s,v 1.35 2024/01/15 17:40:34 thorpej Exp $	*/
 
 /*
  * Copyright (c) 1980, 1990, 1993
@@ -411,25 +411,6 @@ GLOBAL(_isr_clock)
 	INTERRUPT_RESTOREREG
 	jra	_ASM_LABEL(rei)
 
-/* interrupt counters (needed by vmstat) */
-GLOBAL(intrnames)
-	.asciz	"spur"	| 0
-	.asciz	"lev1"	| 1
-	.asciz	"lev2"	| 2
-	.asciz	"lev3"	| 3
-	.asciz	"lev4"	| 4
-	.asciz	"clock"	| 5
-	.asciz	"lev6"	| 6
-	.asciz	"nmi"	| 7
-GLOBAL(eintrnames)
-
-	.data
-	.even
-GLOBAL(intrcnt)
-	.long	0,0,0,0,0,0,0,0
-GLOBAL(eintrcnt)
-	.text
-
 /*
  * Emulation of VAX REI instruction.
  *

Index: src/sys/arch/sun3/sun3/clock.c
diff -u src/sys/arch/sun3/sun3/clock.c:1.66 src/sys/arch/sun3/sun3/clock.c:1.67
--- src/sys/arch/sun3/sun3/clock.c:1.66	Sun Jan 14 17:51:16 2024
+++ src/sys/arch/sun3/sun3/clock.c	Mon Jan 15 17:40:35 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: clock.c,v 1.66 2024/01/14 17:51:16 thorpej Exp $	*/
+/*	$NetBSD: clock.c,v 1.67 2024/01/15 17:40:35 thorpej Exp $	*/
 
 /*
  * Copyright (c) 1982, 1990, 1993
@@ -83,13 +83,14 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.66 2024/01/14 17:51:16 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.67 2024/01/15 17:40:35 thorpej Exp $");
 
 #include 
 #include 
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -109,8 +110,6 @@ __KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.
 #include 
 #include 
 
-extern u_int intrcnt[];
-
 #define	CLOCK_PRI	5
 #define IREG_CLK_BITS	(IREG_CLOCK_ENAB_7 | IREG_CLOCK_ENAB_5)
 
@@ -317,7 +316,7 @@ clock_intr(struct clockframe cf)
 	/* Read the clock intr. reg. AGAIN! */
 	intersil_clear();
 
-	intrcnt[CLOCK_PRI]++;
+	m68k_intr_evcnt[CLOCK_PRI].ev_count++;
 	curcpu()->ci_data.cpu_nintr++;
 
 	{ /* Entertainment! */

Index: src/sys/arch/sun3/sun3/locore.s
diff -u src/sys/arch/sun3/sun3/locore.s:1.106 src/sys/arch/sun3/sun3/locore.s:1.107
--- src/sys/arch/sun3/sun3/locore.s:1.106	Sun Jan 14 22:34:54 2024
+++ src/sys/arch/sun3/sun3/locore.s	Mon Jan 15 17:40:35 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.s,v 1.106 2024/01/14 22:34:54 thorpej Exp $	*/
+/*	$NetBSD: locore.s,v 1.107 2024/01/15 17:40:35 thorpej Exp $	*/
 
 /*
  * Copyright (c) 1980, 1990, 1993
@@ -457,25 +457,6 @@ GLOBAL(_isr_clock)
 	INTERRUPT_RESTOREREG
 	jra	_ASM_LABEL(rei)
 
-/* interrupt counters (needed by vmstat) */
-GLOBAL(intrnames)
-	.asciz	"spur"	| 0
-	.asciz	"lev1"	| 1
-	.asciz	"lev2"	| 2
-	.asciz	"lev3"	| 3
-	.asciz	"lev4"	| 4
-	.asciz	"clock"	| 5
-	.asciz	"lev6"	| 6
-	.asciz	"nmi"	| 7
-GLOBAL(eintrnames)
-
-	.data
-	.even
-GLOBAL(intrcnt)
-	.long	0,0,0,0,0,0,0,0
-GLOBAL(eintrcnt)
-	.text
-
 /*
  * Emulation of VAX REI instruction.
  *

Index: src/sys/arch/sun3/sun3x/clock.c
diff -u src/sys/arch/sun3/sun3x/clock.c:1.42 src/sys/arch/sun3/sun3x/clock.c:1.43
--- src/sys/arch/sun3/sun3x/clock.c:1.42	Sun Jan 14 17:51:16 2024
+++ src/sys/arch/sun3/sun3x/clock.c	Mon Jan 15 17:40:35 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: clock.c,v 1.42 2024/01/14 17:51:16 thorpej Exp $	*/
+/*	$NetBSD: clock.c,v 1.43 2024/01/15 17:40:35 thorpej Exp $	*/
 
 /*
  * Copyright (c) 1982, 1990, 1993
@@ -95,7 +95,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.42 2024/01/14 17:51:16 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.43 2024/01/15 17:40:35 thorpej Exp $");
 
 #include 
 #include 
@@ -123,8 +123,6 @@ __KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.
 #include 
 #include 
 
-extern u_int intrcnt[];
-
 #define SUN3_470	Yes
 
 #define	CLOCK_PRI	5
@@ -443,7 +441,7 @@ clock_intr(struct clockframe cf)
 	}
 #endif	/* SUN3_470 */
 
-	intrcnt[CLOCK_PRI]++;
+	m68k_intr_evcnt[CLOCK_PRI].ev_count++;
 	curcpu()->ci_data.cpu_nintr++;
 
 	/* Entertainment! */

Index: src/sys/arch/sun3/sun3x/locore.s
diff -u 

CVS commit: src/sys/arch

2024-01-15 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Mon Jan 15 17:40:35 UTC 2024

Modified Files:
src/sys/arch/sun2/sun2: locore.s
src/sys/arch/sun3/sun3: clock.c locore.s
src/sys/arch/sun3/sun3x: clock.c locore.s
src/sys/arch/sun68k/include: intr.h types.h

Log Message:
G/C __HAVE_LEGACY_INTRCNT from the sun68k platforms.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sys/arch/sun2/sun2/locore.s
cvs rdiff -u -r1.66 -r1.67 src/sys/arch/sun3/sun3/clock.c
cvs rdiff -u -r1.106 -r1.107 src/sys/arch/sun3/sun3/locore.s
cvs rdiff -u -r1.42 -r1.43 src/sys/arch/sun3/sun3x/clock.c
cvs rdiff -u -r1.74 -r1.75 src/sys/arch/sun3/sun3x/locore.s
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/sun68k/include/intr.h
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/sun68k/include/types.h

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



CVS commit: src/usr.bin/gzip

2024-01-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Jan 15 17:35:48 UTC 2024

Modified Files:
src/usr.bin/gzip: gzip.c

Log Message:
PR/57858: Ricardo Branco: Print the full pathname on errors.
from FreeBSD https://github.com/NetBSD/src/pull/25


To generate a diff of this commit:
cvs rdiff -u -r1.120 -r1.121 src/usr.bin/gzip/gzip.c

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



CVS commit: src/usr.bin/gzip

2024-01-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Jan 15 17:35:48 UTC 2024

Modified Files:
src/usr.bin/gzip: gzip.c

Log Message:
PR/57858: Ricardo Branco: Print the full pathname on errors.
from FreeBSD https://github.com/NetBSD/src/pull/25


To generate a diff of this commit:
cvs rdiff -u -r1.120 -r1.121 src/usr.bin/gzip/gzip.c

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

Modified files:

Index: src/usr.bin/gzip/gzip.c
diff -u src/usr.bin/gzip/gzip.c:1.120 src/usr.bin/gzip/gzip.c:1.121
--- src/usr.bin/gzip/gzip.c:1.120	Sun Jan 14 13:12:59 2024
+++ src/usr.bin/gzip/gzip.c	Mon Jan 15 12:35:48 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: gzip.c,v 1.120 2024/01/14 18:12:59 mrg Exp $	*/
+/*	$NetBSD: gzip.c,v 1.121 2024/01/15 17:35:48 christos Exp $	*/
 
 /*
  * Copyright (c) 1997, 1998, 2003, 2004, 2006, 2008, 2009, 2010, 2011, 2015, 2017
@@ -31,7 +31,7 @@
 #ifndef lint
 __COPYRIGHT("@(#) Copyright (c) 1997, 1998, 2003, 2004, 2006, 2008,\
  2009, 2010, 2011, 2015, 2017 Matthew R. Green.  All rights reserved.");
-__RCSID("$NetBSD: gzip.c,v 1.120 2024/01/14 18:12:59 mrg Exp $");
+__RCSID("$NetBSD: gzip.c,v 1.121 2024/01/15 17:35:48 christos Exp $");
 #endif /* not lint */
 
 /*
@@ -2037,7 +2037,7 @@ handle_dir(char *dir)
 
 	path_argv[0] = dir;
 	path_argv[1] = 0;
-	fts = fts_open(path_argv, FTS_PHYSICAL, NULL);
+	fts = fts_open(path_argv, FTS_PHYSICAL | FTS_NOCHDIR, NULL);
 	if (fts == NULL) {
 		warn("couldn't fts_open %s", dir);
 		return;
@@ -2055,7 +2055,7 @@ handle_dir(char *dir)
 			maybe_warn("%s", entry->fts_path);
 			continue;
 		case FTS_F:
-			handle_file(entry->fts_name, entry->fts_statp);
+			handle_file(entry->fts_path, entry->fts_statp);
 		}
 	}
 	(void)fts_close(fts);



CVS commit: src/sys/arch/arm/imx

2024-01-15 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Mon Jan 15 17:29:27 UTC 2024

Modified Files:
src/sys/arch/arm/imx: imx23_usb.c

Log Message:
Fix imx23_usb_init() function declaration, it expects two parameters.

Fixes build for IMX23_OLINUXINO kernel config.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/arm/imx/imx23_usb.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/arm/imx/imx23_usb.c
diff -u src/sys/arch/arm/imx/imx23_usb.c:1.6 src/sys/arch/arm/imx/imx23_usb.c:1.7
--- src/sys/arch/arm/imx/imx23_usb.c:1.6	Thu May  4 17:09:44 2023
+++ src/sys/arch/arm/imx/imx23_usb.c	Mon Jan 15 17:29:27 2024
@@ -1,4 +1,4 @@
-/* $Id: imx23_usb.c,v 1.6 2023/05/04 17:09:44 bouyer Exp $ */
+/* $Id: imx23_usb.c,v 1.7 2024/01/15 17:29:27 andvar Exp $ */
 
 /*
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -63,7 +63,7 @@ static void	imx23_usb_attach(device_t, d
 static int	imx23_usb_activate(device_t, enum devact);
 
 static int  imxusbc_search(device_t, cfdata_t, const int *, void *);
-static void	imx23_usb_init(struct imxehci_softc *);
+static void	imx23_usb_init(struct imxehci_softc *, uintptr_t);
 
 CFATTACH_DECL3_NEW(imxusbc,
 sizeof(struct imx23_usb_softc),



CVS commit: src/sys/arch/arm/imx

2024-01-15 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Mon Jan 15 17:29:27 UTC 2024

Modified Files:
src/sys/arch/arm/imx: imx23_usb.c

Log Message:
Fix imx23_usb_init() function declaration, it expects two parameters.

Fixes build for IMX23_OLINUXINO kernel config.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/arm/imx/imx23_usb.c

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



CVS commit: src/sys/arch/m68k

2024-01-15 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Mon Jan 15 17:12:00 UTC 2024

Modified Files:
src/sys/arch/m68k/include: intr.h
src/sys/arch/m68k/m68k: m68k_intr.c

Log Message:
Use evcnt to count interrupts for the non-__HAVE_LEGACY_INTRCNT case.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/m68k/include/intr.h
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/m68k/m68k/m68k_intr.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/m68k/include/intr.h
diff -u src/sys/arch/m68k/include/intr.h:1.2 src/sys/arch/m68k/include/intr.h:1.3
--- src/sys/arch/m68k/include/intr.h:1.2	Mon Jan 15 02:13:16 2024
+++ src/sys/arch/m68k/include/intr.h	Mon Jan 15 17:12:00 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: intr.h,v 1.2 2024/01/15 02:13:16 thorpej Exp $	*/
+/*	$NetBSD: intr.h,v 1.3 2024/01/15 17:12:00 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 2023, 2024 The NetBSD Foundation, Inc.
@@ -132,7 +132,15 @@ struct m68k_ih_allocfuncs {
 struct m68k_ih_allocfuncs;
 #endif /* _M68K_INTR_PRIVATE */
 
-struct evcnt;
+#include 
+
+#ifndef __HAVE_LEGACY_INTRCNT
+/*
+ * This is exposed here so that platform-specific interrupt handlers
+ * can access it.
+ */
+extern struct evcnt m68k_intr_evcnt[];
+#endif
 
 /*
  * Common m68k interrupt dispatch:

Index: src/sys/arch/m68k/m68k/m68k_intr.c
diff -u src/sys/arch/m68k/m68k/m68k_intr.c:1.4 src/sys/arch/m68k/m68k/m68k_intr.c:1.5
--- src/sys/arch/m68k/m68k/m68k_intr.c:1.4	Mon Jan 15 02:13:16 2024
+++ src/sys/arch/m68k/m68k/m68k_intr.c	Mon Jan 15 17:12:00 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: m68k_intr.c,v 1.4 2024/01/15 02:13:16 thorpej Exp $	*/
+/*	$NetBSD: m68k_intr.c,v 1.5 2024/01/15 17:12:00 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 1996, 2023, 2024 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: m68k_intr.c,v 1.4 2024/01/15 02:13:16 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: m68k_intr.c,v 1.5 2024/01/15 17:12:00 thorpej Exp $");
 
 #define	_M68K_INTR_PRIVATE
 
@@ -70,10 +70,6 @@ extern char intrstub_vectored[];
 /* A dummy event counter where interrupt stats go to die. */
 static struct evcnt bitbucket;
 
-#ifdef __HAVE_LEGACY_INTRCNT
-extern u_int intrcnt[];		/* XXX old-style statistics */
-#endif
-
 int idepth;
 
 static struct m68k_intrhand_list m68k_intrhands_autovec[NAUTOVECTORS];
@@ -81,6 +77,33 @@ static struct m68k_intrhand_list m68k_in
 static struct m68k_intrhand *m68k_intrhands_vectored[NVECHANDS];
 #endif
 
+#ifdef __HAVE_LEGACY_INTRCNT
+extern u_int intrcnt[];
+#define	INTRCNT(x)	intrcnt[(x)]++
+#else
+#ifndef MACHINE_INTREVCNT_NAMES
+#define	MACHINE_INTREVCNT_NAMES		\
+	{ "spur", "lev1", "lev2", "lev3", "lev4", "lev5", "lev6", "nmi" }
+#endif
+static const char * const m68k_intr_evcnt_names[] = MACHINE_INTREVCNT_NAMES;
+__CTASSERT(__arraycount(m68k_intr_evcnt_names) == NAUTOVECTORS);
+static const char m68k_intr_evcnt_group[] = "cpu";
+
+#define	INTRCNT_INIT(x)			\
+	EVCNT_INITIALIZER(EVCNT_TYPE_INTR, NULL, m68k_intr_evcnt_group,	\
+			  m68k_intr_evcnt_names[(x)])
+
+struct evcnt m68k_intr_evcnt[] = {
+	INTRCNT_INIT(0), INTRCNT_INIT(1), INTRCNT_INIT(2), INTRCNT_INIT(3),
+	INTRCNT_INIT(4), INTRCNT_INIT(5), INTRCNT_INIT(6), INTRCNT_INIT(7),
+};
+__CTASSERT(__arraycount(m68k_intr_evcnt) == NAUTOVECTORS);
+
+#undef INTRCNT_INIT
+
+#define	INTRCNT(x)	m68k_intr_evcnt[(x)].ev_count++
+#endif /* __HAVE_LEGACY_INTRCNT */
+
 const uint16_t ipl2psl_table[NIPL] = {
 	[IPL_NONE]	 = PSL_S | PSL_IPL0,
 	[IPL_SOFTBIO]	 = PSL_S | MACHINE_PSL_IPL_SOFTBIO,
@@ -197,13 +220,15 @@ m68k_intr_init(const struct m68k_ih_allo
 
 	for (i = 0; i < NAUTOVECTORS; i++) {
 		LIST_INIT(_intrhands_autovec[i]);
+#ifndef __HAVE_LEGACY_INTRCNT
+		evcnt_attach_static(_intr_evcnt[i]);
+#endif
 	}
 }
 
 /*
  * m68k_intr_establish --
  *	Establish an interrupt handler at the specified vector.
- *	XXX We don't do anything with isrpri yet.
  *	XXX We don't do anything with the flags yet.
  */
 void *
@@ -339,9 +364,7 @@ m68k_intr_autovec(struct clockframe fram
 
 	idepth++;
 
-#ifdef __HAVE_LEGACY_INTRCNT
-	intrcnt[ipl]++;		/* XXX */
-#endif
+	INTRCNT(ipl);
 	curcpu()->ci_data.cpu_nintr++;
 
 	LIST_FOREACH(ih, _intrhands_autovec[ipl], ih_link) {
@@ -377,9 +400,7 @@ m68k_intr_vectored(struct clockframe fra
 
 	idepth++;
 
-#ifdef __HAVE_LEGACY_INTRCNT
-	intrcnt[ipl]++;		/* XXX */
-#endif
+	INTRCNT(ipl);
 	curcpu()->ci_data.cpu_nintr++;
 
 #ifdef DIAGNOSTIC
@@ -394,7 +415,10 @@ m68k_intr_vectored(struct clockframe fra
 		vec_set_entry(vec, INTR_FREEVEC);
 	}
 
-	if ((*ih->ih_func)(ih->ih_arg ? ih->ih_arg : ) == 0) {
+	if (__predict_true((*ih->ih_func)(ih->ih_arg ? ih->ih_arg
+		 : ) != 0)) {
+		ih->ih_evcnt->ev_count++;
+	} else {
 		printf("Spurious interrupt on vector=0x%0x IPL %d\n",
 		vec, ipl);
 	}



CVS commit: src/sys/arch/m68k

2024-01-15 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Mon Jan 15 17:12:00 UTC 2024

Modified Files:
src/sys/arch/m68k/include: intr.h
src/sys/arch/m68k/m68k: m68k_intr.c

Log Message:
Use evcnt to count interrupts for the non-__HAVE_LEGACY_INTRCNT case.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/m68k/include/intr.h
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/m68k/m68k/m68k_intr.c

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



CVS commit: [netbsd-10] src/doc

2024-01-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Jan 15 16:13:10 UTC 2024

Modified Files:
src/doc [netbsd-10]: CHANGES-10.0

Log Message:
Ticket #555


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.187 -r1.1.2.188 src/doc/CHANGES-10.0

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



CVS commit: [netbsd-10] src/doc

2024-01-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Jan 15 16:13:10 UTC 2024

Modified Files:
src/doc [netbsd-10]: CHANGES-10.0

Log Message:
Ticket #555


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.187 -r1.1.2.188 src/doc/CHANGES-10.0

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

Modified files:

Index: src/doc/CHANGES-10.0
diff -u src/doc/CHANGES-10.0:1.1.2.187 src/doc/CHANGES-10.0:1.1.2.188
--- src/doc/CHANGES-10.0:1.1.2.187	Mon Jan 15 14:17:04 2024
+++ src/doc/CHANGES-10.0	Mon Jan 15 16:13:10 2024
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-10.0,v 1.1.2.187 2024/01/15 14:17:04 martin Exp $
+# $NetBSD: CHANGES-10.0,v 1.1.2.188 2024/01/15 16:13:10 martin Exp $
 
 A complete list of changes from the initial NetBSD 10.0 branch on 2022-12-16
 until the 10.0 release:
@@ -15225,3 +15225,9 @@ sys/uvm/uvm_physseg.h1.9
 	to u_long.
 	[tnn, ticket #554]
 
+usr.bin/ftp/fetch.c1.237,1.238
+
+	ftp(1): fix HTTPS through Proxy.
+	Avoid confusing message when downloading empty files.
+	[mlelstv, ticket #555]
+



CVS commit: [netbsd-10] src/usr.bin/ftp

2024-01-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Jan 15 16:12:08 UTC 2024

Modified Files:
src/usr.bin/ftp [netbsd-10]: fetch.c

Log Message:
Pull up following revision(s) (requested by mlelstv in ticket #555):

usr.bin/ftp/fetch.c: revision 1.237
usr.bin/ftp/fetch.c: revision 1.238

Fix HTTPS through Proxy.

While a regular HTTP Proxy, requires the absolute URL with protocol
and host part, yyou must only send the relative URL through a
CONNECT tunnel (you are talking to the target server).

Don't finish downloading an empty file with 'already done' before it is
created locally.


To generate a diff of this commit:
cvs rdiff -u -r1.235.2.1 -r1.235.2.2 src/usr.bin/ftp/fetch.c

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



CVS commit: [netbsd-10] src/usr.bin/ftp

2024-01-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Jan 15 16:12:08 UTC 2024

Modified Files:
src/usr.bin/ftp [netbsd-10]: fetch.c

Log Message:
Pull up following revision(s) (requested by mlelstv in ticket #555):

usr.bin/ftp/fetch.c: revision 1.237
usr.bin/ftp/fetch.c: revision 1.238

Fix HTTPS through Proxy.

While a regular HTTP Proxy, requires the absolute URL with protocol
and host part, yyou must only send the relative URL through a
CONNECT tunnel (you are talking to the target server).

Don't finish downloading an empty file with 'already done' before it is
created locally.


To generate a diff of this commit:
cvs rdiff -u -r1.235.2.1 -r1.235.2.2 src/usr.bin/ftp/fetch.c

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

Modified files:

Index: src/usr.bin/ftp/fetch.c
diff -u src/usr.bin/ftp/fetch.c:1.235.2.1 src/usr.bin/ftp/fetch.c:1.235.2.2
--- src/usr.bin/ftp/fetch.c:1.235.2.1	Tue May 16 16:16:00 2023
+++ src/usr.bin/ftp/fetch.c	Mon Jan 15 16:12:08 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: fetch.c,v 1.235.2.1 2023/05/16 16:16:00 martin Exp $	*/
+/*	$NetBSD: fetch.c,v 1.235.2.2 2024/01/15 16:12:08 martin Exp $	*/
 
 /*-
  * Copyright (c) 1997-2015 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: fetch.c,v 1.235.2.1 2023/05/16 16:16:00 martin Exp $");
+__RCSID("$NetBSD: fetch.c,v 1.235.2.2 2024/01/15 16:12:08 martin Exp $");
 #endif /* not lint */
 
 /*
@@ -801,7 +801,12 @@ handle_proxy(const char *url, const char
 	}
 
 	FREEPTR(pui.path);
-	pui.path = ftp_strdup(url);
+#ifdef WITH_SSL
+	if (ui->utype == HTTPS_URL_T)
+		pui.path = ftp_strdup(ui->path);
+	else
+#endif
+		pui.path = ftp_strdup(url);
 
 	freeurlinfo(ui);
 	*ui = pui;
@@ -1647,9 +1652,10 @@ fetch_url(const char *url, const char *p
 		}
 	}
 	if (fout == NULL) {
-		if ((pi.rangeend != -1 && pi.rangeend <= restart_point) ||
+		if (restart_point && (
+		(pi.rangeend != -1 && pi.rangeend <= restart_point) ||
 		(pi.rangestart == -1 &&
-		filesize != -1 && filesize <= restart_point)) {
+		filesize != -1 && filesize <= restart_point))) {
 			/* already done */
 			if (verbose)
 fprintf(ttyout, "already done\n");



CVS commit: [netbsd-10] src/doc

2024-01-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Jan 15 14:17:04 UTC 2024

Modified Files:
src/doc [netbsd-10]: CHANGES-10.0

Log Message:
Tickets #553 and #554


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.186 -r1.1.2.187 src/doc/CHANGES-10.0

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

Modified files:

Index: src/doc/CHANGES-10.0
diff -u src/doc/CHANGES-10.0:1.1.2.186 src/doc/CHANGES-10.0:1.1.2.187
--- src/doc/CHANGES-10.0:1.1.2.186	Sun Jan 14 18:06:46 2024
+++ src/doc/CHANGES-10.0	Mon Jan 15 14:17:04 2024
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-10.0,v 1.1.2.186 2024/01/14 18:06:46 martin Exp $
+# $NetBSD: CHANGES-10.0,v 1.1.2.187 2024/01/15 14:17:04 martin Exp $
 
 A complete list of changes from the initial NetBSD 10.0 branch on 2022-12-16
 until the 10.0 release:
@@ -15211,3 +15211,17 @@ sys/arch/vax/vax/machdep.c			1.198
 	vax: set default RLIMIT_AS to the same as MAXDSIZ.
 	[mrg, ticket #552]
 
+sys/external/bsd/drm2/dist/drm/i915/i915_pci.c	1.5
+
+	i915: PR 57268: backport change to downgrade gen7/vlv to
+	aliasing-ppggtt.
+	[riastradh, ticket #553]
+
+sys/uvm/uvm_pglist.c1.91,1.92
+sys/uvm/uvm_physseg.c1.20
+sys/uvm/uvm_physseg.h1.9
+
+	uvm: PR 57683: change type of uvm_physseg.start_hint from u_int
+	to u_long.
+	[tnn, ticket #554]
+



CVS commit: [netbsd-10] src/doc

2024-01-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Jan 15 14:17:04 UTC 2024

Modified Files:
src/doc [netbsd-10]: CHANGES-10.0

Log Message:
Tickets #553 and #554


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.186 -r1.1.2.187 src/doc/CHANGES-10.0

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



CVS commit: [netbsd-10] src/sys/uvm

2024-01-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Jan 15 14:15:55 UTC 2024

Modified Files:
src/sys/uvm [netbsd-10]: uvm_pglist.c uvm_physseg.c uvm_physseg.h

Log Message:
Pull up following revision(s) (requested by tnn in ticket #554):

sys/uvm/uvm_physseg.c: revision 1.20
sys/uvm/uvm_pglist.c: revision 1.91
sys/uvm/uvm_pglist.c: revision 1.92
sys/uvm/uvm_physseg.h: revision 1.9

uvm: change type of uvm_physseg.start_hint from u_int to u_long
Avoids assertion failure in uvm_pglistalloc_s_ps() with large paddrs.
PR kern/57683.

fix DEBUG build


To generate a diff of this commit:
cvs rdiff -u -r1.90 -r1.90.4.1 src/sys/uvm/uvm_pglist.c
cvs rdiff -u -r1.17 -r1.17.20.1 src/sys/uvm/uvm_physseg.c
cvs rdiff -u -r1.8 -r1.8.52.1 src/sys/uvm/uvm_physseg.h

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

Modified files:

Index: src/sys/uvm/uvm_pglist.c
diff -u src/sys/uvm/uvm_pglist.c:1.90 src/sys/uvm/uvm_pglist.c:1.90.4.1
--- src/sys/uvm/uvm_pglist.c:1.90	Tue Dec 21 08:27:49 2021
+++ src/sys/uvm/uvm_pglist.c	Mon Jan 15 14:15:54 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_pglist.c,v 1.90 2021/12/21 08:27:49 skrll Exp $	*/
+/*	$NetBSD: uvm_pglist.c,v 1.90.4.1 2024/01/15 14:15:54 martin Exp $	*/
 
 /*-
  * Copyright (c) 1997, 2019 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uvm_pglist.c,v 1.90 2021/12/21 08:27:49 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_pglist.c,v 1.90.4.1 2024/01/15 14:15:54 martin Exp $");
 
 #include 
 #include 
@@ -112,8 +112,9 @@ static int
 uvm_pglistalloc_c_ps(uvm_physseg_t psi, int num, paddr_t low, paddr_t high,
 paddr_t alignment, paddr_t boundary, struct pglist *rlist)
 {
-	signed int candidate, limit, candidateidx, end, idx, skip;
-	int pagemask;
+	long candidate, limit, candidateidx, end, idx;
+	int skip;
+	long pagemask;
 	bool second_pass;
 #ifdef DEBUG
 	paddr_t idxpa, lastidxpa;
@@ -138,9 +139,9 @@ uvm_pglistalloc_c_ps(uvm_physseg_t psi, 
 	 * succeeded.
 	 */
 	alignment = atop(alignment);
-	candidate = roundup2(uimax(low, uvm_physseg_get_avail_start(psi) +
+	candidate = roundup2(ulmax(low, uvm_physseg_get_avail_start(psi) +
 		uvm_physseg_get_start_hint(psi)), alignment);
-	limit = uimin(high, uvm_physseg_get_avail_end(psi));
+	limit = ulmin(high, uvm_physseg_get_avail_end(psi));
 	pagemask = ~((boundary >> PAGE_SHIFT) - 1);
 	skip = 0;
 	second_pass = false;
@@ -162,8 +163,8 @@ uvm_pglistalloc_c_ps(uvm_physseg_t psi, 
 			 * is were we started.
 			 */
 			second_pass = true;
-			candidate = roundup2(uimax(low, uvm_physseg_get_avail_start(psi)), alignment);
-			limit = uimin(limit, uvm_physseg_get_avail_start(psi) +
+			candidate = roundup2(ulmax(low, uvm_physseg_get_avail_start(psi)), alignment);
+			limit = ulmin(limit, uvm_physseg_get_avail_start(psi) +
 			uvm_physseg_get_start_hint(psi));
 			skip = 0;
 			continue;
@@ -200,7 +201,7 @@ uvm_pglistalloc_c_ps(uvm_physseg_t psi, 
 		 * Found a suitable starting page.  See if the range is free.
 		 */
 #ifdef PGALLOC_VERBOSE
-		printf("%s: psi=%d candidate=%#x end=%#x skip=%#x, align=%#"PRIxPADDR,
+		printf("%s: psi=%d candidate=%#lx end=%#lx skip=%#x, align=%#"PRIxPADDR,
 		__func__, psi, candidateidx, end, skip, alignment);
 #endif
 		/*
@@ -283,7 +284,7 @@ uvm_pglistalloc_c_ps(uvm_physseg_t psi, 
 	uvm_physseg_get_avail_start(psi));
 	KASSERTMSG(uvm_physseg_get_start_hint(psi) <=
 	uvm_physseg_get_avail_end(psi) - uvm_physseg_get_avail_start(psi),
-	"%x %u (%#x) <= %#"PRIxPADDR" - %#"PRIxPADDR" (%#"PRIxPADDR")",
+	"%lx %lu (%#lx) <= %#"PRIxPADDR" - %#"PRIxPADDR" (%#"PRIxPADDR")",
 	candidate + num,
 	uvm_physseg_get_start_hint(psi), uvm_physseg_get_start_hint(psi),
 	uvm_physseg_get_avail_end(psi), uvm_physseg_get_avail_start(psi),
@@ -523,7 +524,8 @@ static int
 uvm_pglistalloc_s_ps(uvm_physseg_t psi, int num, paddr_t low, paddr_t high,
 struct pglist *rlist)
 {
-	int todo, limit, candidate;
+	int todo;
+	long limit, candidate;
 	struct vm_page *pg;
 	bool second_pass;
 #ifdef PGALLOC_VERBOSE
@@ -546,9 +548,9 @@ uvm_pglistalloc_s_ps(uvm_physseg_t psi, 
 		return -1;
 
 	todo = num;
-	candidate = uimax(low, uvm_physseg_get_avail_start(psi) +
+	candidate = ulmax(low, uvm_physseg_get_avail_start(psi) +
 	uvm_physseg_get_start_hint(psi));
-	limit = uimin(high, uvm_physseg_get_avail_end(psi));
+	limit = ulmin(high, uvm_physseg_get_avail_end(psi));
 	pg = uvm_physseg_get_pg(psi, candidate - uvm_physseg_get_start(psi));
 	second_pass = false;
 
@@ -560,8 +562,8 @@ again:
 break;
 			}
 			second_pass = true;
-			candidate = uimax(low, uvm_physseg_get_avail_start(psi));
-			limit = uimin(limit, uvm_physseg_get_avail_start(psi) +
+			candidate = ulmax(low, uvm_physseg_get_avail_start(psi));
+			limit = ulmin(limit, uvm_physseg_get_avail_start(psi) +
 			uvm_physseg_get_start_hint(psi));
 			pg = 

CVS commit: [netbsd-10] src/sys/uvm

2024-01-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Jan 15 14:15:55 UTC 2024

Modified Files:
src/sys/uvm [netbsd-10]: uvm_pglist.c uvm_physseg.c uvm_physseg.h

Log Message:
Pull up following revision(s) (requested by tnn in ticket #554):

sys/uvm/uvm_physseg.c: revision 1.20
sys/uvm/uvm_pglist.c: revision 1.91
sys/uvm/uvm_pglist.c: revision 1.92
sys/uvm/uvm_physseg.h: revision 1.9

uvm: change type of uvm_physseg.start_hint from u_int to u_long
Avoids assertion failure in uvm_pglistalloc_s_ps() with large paddrs.
PR kern/57683.

fix DEBUG build


To generate a diff of this commit:
cvs rdiff -u -r1.90 -r1.90.4.1 src/sys/uvm/uvm_pglist.c
cvs rdiff -u -r1.17 -r1.17.20.1 src/sys/uvm/uvm_physseg.c
cvs rdiff -u -r1.8 -r1.8.52.1 src/sys/uvm/uvm_physseg.h

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



CVS commit: [netbsd-10] src/sys/external/bsd/drm2/dist/drm/i915

2024-01-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Jan 15 14:13:40 UTC 2024

Modified Files:
src/sys/external/bsd/drm2/dist/drm/i915 [netbsd-10]: i915_pci.c

Log Message:
Pull up following revision(s) (requested by riastradh in ticket #553):

sys/external/bsd/drm2/dist/drm/i915/i915_pci.c: revision 1.5

i915: Backport change to downgrade gen7/vlv to aliasing-ppggtt.
PR kern/57268

commit 4fbe112a569526e46fa2accb5763c069f78cb431
Author: Chris Wilson 
Date:   Mon Feb 24 10:11:20 2020 +
drm/i915/gtt: Downgrade gen7 (ivb, byt, hsw) back to aliasing-ppgtt
Full-ppgtt on gen7 is proving to be highly unstable and not robust.
Closes: https://gitlab.freedesktop.org/drm/intel/issues/694;>https://gitlab.freedesktop.org/drm/intel/issues/694
Fixes: 3cd6e8860ecd ("drm/i915/gen7: Re-enable full-ppgtt for ivb & hsw")
Signed-off-by: Chris Wilson 
Cc: Joonas Lahtinen 
Cc: Rodrigo Vivi 
Cc: Jani Nikula 
Cc: Dave Airlie 
Acked-by: Rodrigo Vivi 
Link: 
https://patchwork.freedesktop.org/patch/msgid/20200224101120.4024481-1-chris%chris-wilson.co.uk@localhost


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.4.4.1 \
src/sys/external/bsd/drm2/dist/drm/i915/i915_pci.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/external/bsd/drm2/dist/drm/i915/i915_pci.c
diff -u src/sys/external/bsd/drm2/dist/drm/i915/i915_pci.c:1.4 src/sys/external/bsd/drm2/dist/drm/i915/i915_pci.c:1.4.4.1
--- src/sys/external/bsd/drm2/dist/drm/i915/i915_pci.c:1.4	Sun Dec 19 01:44:49 2021
+++ src/sys/external/bsd/drm2/dist/drm/i915/i915_pci.c	Mon Jan 15 14:13:39 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: i915_pci.c,v 1.4 2021/12/19 01:44:49 riastradh Exp $	*/
+/*	$NetBSD: i915_pci.c,v 1.4.4.1 2024/01/15 14:13:39 martin Exp $	*/
 
 /*
  * Copyright © 2016 Intel Corporation
@@ -25,7 +25,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: i915_pci.c,v 1.4 2021/12/19 01:44:49 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i915_pci.c,v 1.4.4.1 2024/01/15 14:13:39 martin Exp $");
 
 #include 
 #include 
@@ -442,7 +442,7 @@ static const struct intel_device_info sn
 	.has_rc6 = 1, \
 	.has_rc6p = 1, \
 	.has_rps = true, \
-	.ppgtt_type = INTEL_PPGTT_FULL, \
+	.ppgtt_type = INTEL_PPGTT_ALIASING, \
 	.ppgtt_size = 31, \
 	IVB_PIPE_OFFSETS, \
 	IVB_CURSOR_OFFSETS, \
@@ -499,7 +499,7 @@ static const struct intel_device_info vl
 	.has_rps = true,
 	.display.has_gmch = 1,
 	.display.has_hotplug = 1,
-	.ppgtt_type = INTEL_PPGTT_FULL,
+	.ppgtt_type = INTEL_PPGTT_ALIASING,
 	.ppgtt_size = 31,
 	.has_snoop = true,
 	.has_coherent_ggtt = false,



CVS commit: [netbsd-10] src/sys/external/bsd/drm2/dist/drm/i915

2024-01-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Jan 15 14:13:40 UTC 2024

Modified Files:
src/sys/external/bsd/drm2/dist/drm/i915 [netbsd-10]: i915_pci.c

Log Message:
Pull up following revision(s) (requested by riastradh in ticket #553):

sys/external/bsd/drm2/dist/drm/i915/i915_pci.c: revision 1.5

i915: Backport change to downgrade gen7/vlv to aliasing-ppggtt.
PR kern/57268

commit 4fbe112a569526e46fa2accb5763c069f78cb431
Author: Chris Wilson 
Date:   Mon Feb 24 10:11:20 2020 +
drm/i915/gtt: Downgrade gen7 (ivb, byt, hsw) back to aliasing-ppgtt
Full-ppgtt on gen7 is proving to be highly unstable and not robust.
Closes: https://gitlab.freedesktop.org/drm/intel/issues/694;>https://gitlab.freedesktop.org/drm/intel/issues/694
Fixes: 3cd6e8860ecd ("drm/i915/gen7: Re-enable full-ppgtt for ivb & hsw")
Signed-off-by: Chris Wilson 
Cc: Joonas Lahtinen 
Cc: Rodrigo Vivi 
Cc: Jani Nikula 
Cc: Dave Airlie 
Acked-by: Rodrigo Vivi 
Link: 
https://patchwork.freedesktop.org/patch/msgid/20200224101120.4024481-1-chris%chris-wilson.co.uk@localhost


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.4.4.1 \
src/sys/external/bsd/drm2/dist/drm/i915/i915_pci.c

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



CVS commit: src/external/bsd/libproc/dist

2024-01-15 Thread Patrick Welche
Module Name:src
Committed By:   prlw1
Date:   Mon Jan 15 12:38:56 UTC 2024

Modified Files:
src/external/bsd/libproc/dist: proc_sym.c

Log Message:
libproc: sanitize process symbols so binary doesn't end up in dtrace profiling
>From RVP on current-users
https://mail-index.netbsd.org/current-users/2023/12/27/msg044840.html


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/bsd/libproc/dist/proc_sym.c

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

Modified files:

Index: src/external/bsd/libproc/dist/proc_sym.c
diff -u src/external/bsd/libproc/dist/proc_sym.c:1.4 src/external/bsd/libproc/dist/proc_sym.c:1.5
--- src/external/bsd/libproc/dist/proc_sym.c:1.4	Thu Jun 15 23:44:58 2017
+++ src/external/bsd/libproc/dist/proc_sym.c	Mon Jan 15 12:38:56 2024
@@ -32,7 +32,7 @@
 #ifdef __FBSDID
 __FBSDID("$FreeBSD: head/lib/libproc/proc_sym.c 279946 2015-03-13 04:26:48Z stas $");
 #else
-__RCSID("$NetBSD: proc_sym.c,v 1.4 2017/06/15 23:44:58 kamil Exp $");
+__RCSID("$NetBSD: proc_sym.c,v 1.5 2024/01/15 12:38:56 prlw1 Exp $");
 #endif
 
 #include 
@@ -141,6 +141,10 @@ proc_objname(struct proc_handle *p, uint
 	size_t i;
 	rd_loadobj_t *rdl;
 
+	if (p->nobjs == 0)  
+		if (proc_rdagent(p) == NULL)	
+			return (NULL);  
+
 	for (i = 0; i < p->nobjs; i++) {
 		rdl = >rdobjs[i];
 		if (addr >= rdl->rdl_saddr && addr < rdl->rdl_eaddr) {



CVS commit: src/external/bsd/libproc/dist

2024-01-15 Thread Patrick Welche
Module Name:src
Committed By:   prlw1
Date:   Mon Jan 15 12:38:56 UTC 2024

Modified Files:
src/external/bsd/libproc/dist: proc_sym.c

Log Message:
libproc: sanitize process symbols so binary doesn't end up in dtrace profiling
>From RVP on current-users
https://mail-index.netbsd.org/current-users/2023/12/27/msg044840.html


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/bsd/libproc/dist/proc_sym.c

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



CVS commit: src/usr.sbin/wgconfig

2024-01-15 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Mon Jan 15 08:29:14 UTC 2024

Modified Files:
src/usr.sbin/wgconfig: wgconfig.8

Log Message:
Fix typo in wgconfig(8)

>From rudolf in PR 57663


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/usr.sbin/wgconfig/wgconfig.8

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

Modified files:

Index: src/usr.sbin/wgconfig/wgconfig.8
diff -u src/usr.sbin/wgconfig/wgconfig.8:1.10 src/usr.sbin/wgconfig/wgconfig.8:1.11
--- src/usr.sbin/wgconfig/wgconfig.8:1.10	Wed Aug 26 16:03:42 2020
+++ src/usr.sbin/wgconfig/wgconfig.8	Mon Jan 15 08:29:14 2024
@@ -1,4 +1,4 @@
-.\"	$NetBSD: wgconfig.8,v 1.10 2020/08/26 16:03:42 riastradh Exp $
+.\"	$NetBSD: wgconfig.8,v 1.11 2024/01/15 08:29:14 wiz Exp $
 .\"
 .\" Copyright (C) Ryota Ozaki 
 .\" All rights reserved.
@@ -138,7 +138,7 @@ is the peer's base64-encoded public key,
 .Pp
 The following options may be specified:
 .Bl -tag -width abcd
-.It Fl Fl preshared-key-file Ns Li \&= Ns Ar filename
+.It Fl Fl preshared-key Ns Li \&= Ns Ar filename
 Set a secret preshared key generated by
 .Nm wg-keygen
 .Fl Fl psk .



CVS commit: src/usr.sbin/wgconfig

2024-01-15 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Mon Jan 15 08:29:14 UTC 2024

Modified Files:
src/usr.sbin/wgconfig: wgconfig.8

Log Message:
Fix typo in wgconfig(8)

>From rudolf in PR 57663


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/usr.sbin/wgconfig/wgconfig.8

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



CVS commit: src/sys/arch/sparc64/sparc64

2024-01-15 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Mon Jan 15 08:13:45 UTC 2024

Modified Files:
src/sys/arch/sparc64/sparc64: intr.c trap.c

Log Message:
Fix typos in trap types and one log message.

OpenBSD fixed those over 20 years ago.


To generate a diff of this commit:
cvs rdiff -u -r1.71 -r1.72 src/sys/arch/sparc64/sparc64/intr.c
cvs rdiff -u -r1.196 -r1.197 src/sys/arch/sparc64/sparc64/trap.c

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



CVS commit: src/sys/arch/sparc64/sparc64

2024-01-15 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Mon Jan 15 08:13:45 UTC 2024

Modified Files:
src/sys/arch/sparc64/sparc64: intr.c trap.c

Log Message:
Fix typos in trap types and one log message.

OpenBSD fixed those over 20 years ago.


To generate a diff of this commit:
cvs rdiff -u -r1.71 -r1.72 src/sys/arch/sparc64/sparc64/intr.c
cvs rdiff -u -r1.196 -r1.197 src/sys/arch/sparc64/sparc64/trap.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/intr.c
diff -u src/sys/arch/sparc64/sparc64/intr.c:1.71 src/sys/arch/sparc64/sparc64/intr.c:1.72
--- src/sys/arch/sparc64/sparc64/intr.c:1.71	Sun Jan  9 20:30:04 2022
+++ src/sys/arch/sparc64/sparc64/intr.c	Mon Jan 15 08:13:45 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: intr.c,v 1.71 2022/01/09 20:30:04 palle Exp $ */
+/*	$NetBSD: intr.c,v 1.72 2024/01/15 08:13:45 andvar Exp $ */
 
 /*
  * Copyright (c) 1992, 1993
@@ -41,7 +41,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.71 2022/01/09 20:30:04 palle Exp $");
+__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.72 2024/01/15 08:13:45 andvar Exp $");
 
 #include "opt_ddb.h"
 #include "opt_multiprocessor.h"
@@ -108,7 +108,7 @@ strayintr(const struct trapframe64 *fp, 
 
 	snprintb(buf, sizeof(buf), PSTATE_BITS,
 	(fp->tf_tstate>>TSTATE_PSTATE_SHIFT));
-	printf("stray interrupt ipl %u pc=%llx npc=%llx pstate=%s vecttored=%d\n",
+	printf("stray interrupt ipl %u pc=%llx npc=%llx pstate=%s vectored=%d\n",
 	fp->tf_pil, (unsigned long long)fp->tf_pc,
 	(unsigned long long)fp->tf_npc,  buf, vectored);
 

Index: src/sys/arch/sparc64/sparc64/trap.c
diff -u src/sys/arch/sparc64/sparc64/trap.c:1.196 src/sys/arch/sparc64/sparc64/trap.c:1.197
--- src/sys/arch/sparc64/sparc64/trap.c:1.196	Mon Jan  8 19:33:49 2024
+++ src/sys/arch/sparc64/sparc64/trap.c	Mon Jan 15 08:13:45 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: trap.c,v 1.196 2024/01/08 19:33:49 palle Exp $ */
+/*	$NetBSD: trap.c,v 1.197 2024/01/15 08:13:45 andvar Exp $ */
 
 /*
  * Copyright (c) 1996-2002 Eduardo Horvath.  All rights reserved.
@@ -50,7 +50,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.196 2024/01/08 19:33:49 palle Exp $");
+__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.197 2024/01/15 08:13:45 andvar Exp $");
 
 #include "opt_ddb.h"
 #include "opt_multiprocessor.h"
@@ -342,7 +342,7 @@ const char *trap_type[] = {
 	T, T, T, T, T, T, T, T, /* 128..12f */
 	T, T,			/* 130..131 */
 	"get condition codes",	/* 132 */
-	"set condision codes",	/* 133 */
+	"set condition codes",	/* 133 */
 	T, T, T, T,		/* 134..137 */
 	T, T, T, T, T, T, T, T, /* 138..13f */
 	T, T, T, T, T, T, T, T, /* 140..147 */
@@ -352,7 +352,7 @@ const char *trap_type[] = {
 	T, T, T, T,		/* 160..163 */
 	"SVID syscall64",	/* 164 */
 	"SPARC Intl syscall64",	/* 165 */
-	"OS vedor spec syscall",/* 166 */
+	"OS vendor spec syscall",	/* 166 */
 	"HW OEM syscall",	/* 167 */
 	"ret from deferred trap",	/* 168 */
 };