CVS commit: src/sys/uvm/pmap

2022-10-26 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu Oct 27 05:33:37 UTC 2022

Modified Files:
src/sys/uvm/pmap: pmap.h

Log Message:
Fix the crash(1) build for mips platforms


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/uvm/pmap/pmap.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/pmap/pmap.h
diff -u src/sys/uvm/pmap/pmap.h:1.22 src/sys/uvm/pmap/pmap.h:1.23
--- src/sys/uvm/pmap/pmap.h:1.22	Wed Oct 26 07:35:20 2022
+++ src/sys/uvm/pmap/pmap.h	Thu Oct 27 05:33:37 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.h,v 1.22 2022/10/26 07:35:20 skrll Exp $	*/
+/*	$NetBSD: pmap.h,v 1.23 2022/10/27 05:33:37 skrll Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -225,6 +225,8 @@ struct pmap {
 	struct pmap_asid_info	pm_pai[1];
 };
 
+
+#ifdef	_KERNEL
 static inline void
 pmap_lock(struct pmap *pm)
 {
@@ -239,7 +241,6 @@ pmap_unlock(struct pmap *pm)
 	rw_exit(pm->pm_lock);
 }
 
-#ifdef	_KERNEL
 struct pmap_kernel {
 	struct pmap kernel_pmap;
 #if defined(MULTIPROCESSOR) && PMAP_TLB_MAX > 1



CVS commit: src/sys/uvm/pmap

2022-10-26 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu Oct 27 05:33:37 UTC 2022

Modified Files:
src/sys/uvm/pmap: pmap.h

Log Message:
Fix the crash(1) build for mips platforms


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/uvm/pmap/pmap.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

2022-10-26 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Oct 27 00:26:20 UTC 2022

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

Log Message:
Welcome(?) to 9.99.103.

 - Revert dl_data[] size change.


To generate a diff of this commit:
cvs rdiff -u -r1.715 -r1.716 src/sys/sys/param.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/param.h
diff -u src/sys/sys/param.h:1.715 src/sys/sys/param.h:1.716
--- src/sys/sys/param.h:1.715	Mon Oct 24 08:14:11 2022
+++ src/sys/sys/param.h	Thu Oct 27 00:26:20 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: param.h,v 1.715 2022/10/24 08:14:11 msaitoh Exp $	*/
+/*	$NetBSD: param.h,v 1.716 2022/10/27 00:26:20 msaitoh Exp $	*/
 
 /*-
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -67,7 +67,7 @@
  *	2.99.9		(299000900)
  */
 
-#define	__NetBSD_Version__	999010200	/* NetBSD 9.99.102 */
+#define	__NetBSD_Version__	999010300	/* NetBSD 9.99.103 */
 
 #define __NetBSD_Prereq__(M,m,p) (M) * 1) + \
 (m) * 100) + (p) * 100) <= __NetBSD_Version__)



CVS commit: src/sys/sys

2022-10-26 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Oct 27 00:26:20 UTC 2022

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

Log Message:
Welcome(?) to 9.99.103.

 - Revert dl_data[] size change.


To generate a diff of this commit:
cvs rdiff -u -r1.715 -r1.716 src/sys/sys/param.h

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



CVS commit: src/sys/net

2022-10-26 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Oct 27 00:25:11 UTC 2022

Modified Files:
src/sys/net: if_dl.h

Log Message:
Revert if_dl.h change. It'll be commited with the COMPAT_9 code in future.


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/sys/net/if_dl.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/net/if_dl.h
diff -u src/sys/net/if_dl.h:1.29 src/sys/net/if_dl.h:1.30
--- src/sys/net/if_dl.h:1.29	Mon Oct 24 07:45:44 2022
+++ src/sys/net/if_dl.h	Thu Oct 27 00:25:11 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_dl.h,v 1.29 2022/10/24 07:45:44 msaitoh Exp $	*/
+/*	$NetBSD: if_dl.h,v 1.30 2022/10/27 00:25:11 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 1990, 1993
@@ -68,11 +68,11 @@ struct dl_addr {
 	uint8_t	dl_nlen;	/* interface name length, no trailing 0 reqd. */
 	uint8_t	dl_alen;	/* link level address length */
 	uint8_t	dl_slen;	/* link layer selector length */
-	char	dl_data[24]; /*
-  * minimum work area, can be larger; contains
-  * both if name and ll address; big enough for
-  * IFNAMSIZ plus 8byte ll addr
-  */
+	/*
+	 * minimum work area, can be larger; contains both if name
+	 * and ll address
+	 */
+	char	dl_data[12];
 };
 
 /*



CVS commit: src/sys/net

2022-10-26 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Oct 27 00:25:11 UTC 2022

Modified Files:
src/sys/net: if_dl.h

Log Message:
Revert if_dl.h change. It'll be commited with the COMPAT_9 code in future.


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/sys/net/if_dl.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/vax/uba

2022-10-26 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Thu Oct 27 00:00:25 UTC 2022

Modified Files:
src/sys/arch/vax/uba: qvaux.c

Log Message:
vax/qvaux(4): Convert to ttylock/ttyunlock.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/vax/uba/qvaux.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/vax/uba/qvaux.c
diff -u src/sys/arch/vax/uba/qvaux.c:1.4 src/sys/arch/vax/uba/qvaux.c:1.5
--- src/sys/arch/vax/uba/qvaux.c:1.4	Sat Aug  7 16:19:07 2021
+++ src/sys/arch/vax/uba/qvaux.c	Thu Oct 27 00:00:25 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: qvaux.c,v 1.4 2021/08/07 16:19:07 thorpej Exp $	*/
+/*	$NetBSD: qvaux.c,v 1.5 2022/10/27 00:00:25 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2015 The NetBSD Foundation, Inc.
@@ -548,7 +548,7 @@ qvauxopen(dev_t dev, int flag, int mode,
 	/* Use DMBIS and *not* DMSET or else we clobber incoming bits */
 	if (qvauxmctl(sc, line, DML_DTR, DMBIS) & DML_DCD)
 		tp->t_state |= TS_CARR_ON;
-	mutex_spin_enter(_lock);
+	ttylock(tp);
 	while (!(flag & O_NONBLOCK) && !(tp->t_cflag & CLOCAL) &&
 	   !(tp->t_state & TS_CARR_ON)) {
 		tp->t_wopen++;
@@ -557,7 +557,7 @@ qvauxopen(dev_t dev, int flag, int mode,
 		if (error)
 			break;
 	}
-	mutex_spin_exit(_lock);
+	ttyunlock(tp);
 	if (error)
 		return (error);
 	return ((*tp->t_linesw->l_open)(dev, tp));



CVS commit: src/sys/dev/pci

2022-10-26 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Thu Oct 27 00:01:07 UTC 2022

Modified Files:
src/sys/dev/pci: xmm7360.c

Log Message:
wwanc(4): Convert to ttylock/ttyunlock.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/dev/pci/xmm7360.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/dev/pci/xmm7360.c
diff -u src/sys/dev/pci/xmm7360.c:1.16 src/sys/dev/pci/xmm7360.c:1.17
--- src/sys/dev/pci/xmm7360.c:1.16	Sat Feb 12 16:21:27 2022
+++ src/sys/dev/pci/xmm7360.c	Thu Oct 27 00:01:07 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: xmm7360.c,v 1.16 2022/02/12 16:21:27 thorpej Exp $	*/
+/*	$NetBSD: xmm7360.c,v 1.17 2022/10/27 00:01:07 riastradh Exp $	*/
 
 /*
  * Device driver for Intel XMM7360 LTE modems, eg. Fibocom L850-GL.
@@ -75,7 +75,7 @@ MODULE_DEVICE_TABLE(pci, xmm7360_ids);
 #include "opt_gateway.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: xmm7360.c,v 1.16 2022/02/12 16:21:27 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xmm7360.c,v 1.17 2022/10/27 00:01:07 riastradh Exp $");
 #endif
 
 #include 
@@ -167,9 +167,9 @@ typedef struct mutex spinlock_t;
 #define if_deferred_start_init(ifp, arg)	/* nothing */
 #define IF_OUTPUT_CONST/* nothing */
 #define knote_set_eof(kn, f)			(kn)->kn_flags |= EV_EOF | (f)
-#define tty_lock()int s = spltty()
-#define tty_unlock()splx(s)
-#define tty_locked()/* nothing */
+#define tty_lock(tp)int s = spltty()
+#define tty_unlock(tp)splx(s)
+#define tty_locked(tp)/* nothing */
 #define pmf_device_deregister(dev)		/* nothing */
 #if NBPFILTER > 0
 #define BPF_MTAP_OUT(ifp, m)		\
@@ -263,9 +263,9 @@ typedef struct kmutex spinlock_t;
 #define if_hardmtu			if_mtu
 #define IF_OUTPUT_CONST			const
 #define XMM_KQ_ISFD_INITIALIZER		.f_flags = FILTEROP_ISFD
-#define tty_lock()			mutex_spin_enter(_lock)
-#define tty_unlock()			mutex_spin_exit(_lock)
-#define tty_locked()			KASSERT(mutex_owned(_lock))
+#define tty_lock(tp)			ttylock(tp)
+#define tty_unlock(tp)			ttyunlock(tp)
+#define tty_locked(tp)			KASSERT(ttylocked(tp))
 #define bpfattach(bpf, ifp, dlt, sz)	bpf_attach(ifp, dlt, sz)
 #define NBPFILTER			1
 #define BPF_MTAP_OUT(ifp, m)		bpf_mtap(ifp, m, BPF_D_OUT)
@@ -2677,7 +2677,7 @@ wwancstart(struct tty *tp)
 
 	KASSERT(DEV_IS_TTY(dev));
 	KASSERT(tp == sc->sc_tty[func]);
-	tty_locked();
+	tty_locked(tp);
 
 	if (ISSET(tp->t_state, TS_BUSY) || !xmm7360_qp_can_write(qp))
 		return;
@@ -2752,10 +2752,14 @@ static void
 filt_wwancrdetach(struct knote *kn)
 {
 	struct queue_pair *qp = (struct queue_pair *)kn->kn_hook;
+	struct xmm_dev *xmm = qp->xmm;
+	int func = qp - xmm->qp;
+	struct wwanc_softc *sc = container_of(xmm, struct wwanc_softc, sc_xmm);
+	struct tty *tp = sc->sc_tty[func];
 
-	tty_lock();
+	tty_lock(tp);
 	selremove_knote(>selr, kn);
-	tty_unlock();
+	tty_unlock(tp);
 }
 
 static int
@@ -2779,10 +2783,14 @@ static void
 filt_wwancwdetach(struct knote *kn)
 {
 	struct queue_pair *qp = (struct queue_pair *)kn->kn_hook;
+	struct xmm_dev *xmm = qp->xmm;
+	int func = qp - xmm->qp;
+	struct wwanc_softc *sc = container_of(xmm, struct wwanc_softc, sc_xmm);
+	struct tty *tp = sc->sc_tty[func];
 
-	tty_lock();
+	tty_lock(tp);
 	selremove_knote(>selw, kn);
-	tty_unlock();
+	tty_unlock(tp);
 }
 
 static int
@@ -2820,6 +2828,7 @@ wwanckqfilter(dev_t dev, struct knote *k
 	struct wwanc_softc *sc = device_lookup_private(_cd, DEVUNIT(dev));
 	int func = DEVFUNC(dev);
 	struct queue_pair *qp = >sc_xmm.qp[func];
+	struct tty *tp = sc->sc_tty[func];
 	struct selinfo *si;
 
 	if (DEV_IS_TTY(func))
@@ -2842,9 +2851,9 @@ wwanckqfilter(dev_t dev, struct knote *k
 
 	kn->kn_hook = (void *)qp;
 
-	tty_lock();
+	tty_lock(tp);
 	selrecord_knote(si, kn);
-	tty_unlock();
+	tty_unlock(tp);
 
 	return (0);
 }



CVS commit: src/sys/dev/pci

2022-10-26 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Thu Oct 27 00:01:07 UTC 2022

Modified Files:
src/sys/dev/pci: xmm7360.c

Log Message:
wwanc(4): Convert to ttylock/ttyunlock.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/dev/pci/xmm7360.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/vax/uba

2022-10-26 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Thu Oct 27 00:00:25 UTC 2022

Modified Files:
src/sys/arch/vax/uba: qvaux.c

Log Message:
vax/qvaux(4): Convert to ttylock/ttyunlock.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/vax/uba/qvaux.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/dev

2022-10-26 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Oct 26 23:59:56 UTC 2022

Modified Files:
src/sys/arch/sparc64/dev: zs.c

Log Message:
sparc64/zs(4): Convert to ttylock/ttyunlock.


To generate a diff of this commit:
cvs rdiff -u -r1.79 -r1.80 src/sys/arch/sparc64/dev/zs.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/dev/zs.c
diff -u src/sys/arch/sparc64/dev/zs.c:1.79 src/sys/arch/sparc64/dev/zs.c:1.80
--- src/sys/arch/sparc64/dev/zs.c:1.79	Wed Oct 26 23:38:08 2022
+++ src/sys/arch/sparc64/dev/zs.c	Wed Oct 26 23:59:56 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: zs.c,v 1.79 2022/10/26 23:38:08 riastradh Exp $	*/
+/*	$NetBSD: zs.c,v 1.80 2022/10/26 23:59:56 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: zs.c,v 1.79 2022/10/26 23:38:08 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: zs.c,v 1.80 2022/10/26 23:59:56 riastradh Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -541,8 +541,8 @@ zssoft(void *arg)
 	struct zsc_softc *zsc = arg;
 
 #if 0 /* not yet */
-	/* Make sure we call the tty layer with tty_lock held. */
-	mutex_spin_enter(_lock);
+	/* Make sure we call the tty layer with ttylock held. */
+	ttylock(tp);
 #endif
 	(void)zsc_intr_soft(zsc);
 #ifdef TTY_DEBUG
@@ -558,7 +558,7 @@ zssoft(void *arg)
 	}
 #endif
 #if 0 /* not yet */
-	mutex_spin_exit(_lock);
+	ttyunlock(tp);
 #endif
 }
 



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

2022-10-26 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Oct 26 23:59:56 UTC 2022

Modified Files:
src/sys/arch/sparc64/dev: zs.c

Log Message:
sparc64/zs(4): Convert to ttylock/ttyunlock.


To generate a diff of this commit:
cvs rdiff -u -r1.79 -r1.80 src/sys/arch/sparc64/dev/zs.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/dev

2022-10-26 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Oct 26 23:59:36 UTC 2022

Modified Files:
src/sys/arch/sparc64/dev: sab.c

Log Message:
sparc64/sab(4): Convert to ttylock/ttyunlock.


To generate a diff of this commit:
cvs rdiff -u -r1.57 -r1.58 src/sys/arch/sparc64/dev/sab.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/dev/sab.c
diff -u src/sys/arch/sparc64/dev/sab.c:1.57 src/sys/arch/sparc64/dev/sab.c:1.58
--- src/sys/arch/sparc64/dev/sab.c:1.57	Sat Aug  7 16:19:05 2021
+++ src/sys/arch/sparc64/dev/sab.c	Wed Oct 26 23:59:36 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: sab.c,v 1.57 2021/08/07 16:19:05 thorpej Exp $	*/
+/*	$NetBSD: sab.c,v 1.58 2022/10/26 23:59:36 riastradh Exp $	*/
 /*	$OpenBSD: sab.c,v 1.7 2002/04/08 17:49:42 jason Exp $	*/
 
 /*
@@ -42,7 +42,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sab.c,v 1.57 2021/08/07 16:19:05 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sab.c,v 1.58 2022/10/26 23:59:36 riastradh Exp $");
 
 #include "opt_kgdb.h"
 #include 
@@ -693,7 +693,7 @@ sabopen(dev_t dev, int flags, int mode, 
 	if (kauth_authorize_device_tty(l->l_cred, KAUTH_DEVICE_TTY_OPEN, tp))
 		return (EBUSY);
 
-	mutex_spin_enter(_lock);
+	ttylock(tp);
 	if (!ISSET(tp->t_state, TS_ISOPEN) && tp->t_wopen == 0) {
 		ttychars(tp);
 		tp->t_iflag = TTYDEF_IFLAG;
@@ -744,24 +744,24 @@ sabopen(dev_t dev, int flags, int mode, 
 
 			error = ttysleep(tp, >t_rawcv, true, 0);
 			if (error != 0) {
-mutex_spin_exit(_lock);
+ttyunlock(tp);
 return (error);
 			}
 		}
 	}
 
-	mutex_spin_exit(_lock);
+	ttyunlock(tp);
 
 	s = (*tp->t_linesw->l_open)(dev, tp);
 	if (s != 0) {
-		mutex_spin_enter(_lock);
+		ttylock(tp);
 		if (tp->t_state & TS_ISOPEN) {
-			mutex_spin_exit(_lock);
+			ttyunlock(tp);
 			return (s);
 		}
 		if (tp->t_cflag & HUPCL) {
 			sabtty_mdmctrl(sc, 0, DMSET);
-			cv_wait(, _lock);
+			ttysleep(tp, NULL, /*catch_p*/false, hz);
 		}
 
 		if ((sc->sc_flags & (SABTTYF_CONS_IN | SABTTYF_CONS_OUT)) == 0) {
@@ -769,7 +769,7 @@ sabopen(dev_t dev, int flags, int mode, 
 			sabtty_flush(sc);
 			sabtty_reset(sc);
 		}
-		mutex_spin_exit(_lock);
+		ttyunlock(tp);
 	}
 	return (s);
 }



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

2022-10-26 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Oct 26 23:59:36 UTC 2022

Modified Files:
src/sys/arch/sparc64/dev: sab.c

Log Message:
sparc64/sab(4): Convert to ttylock/ttyunlock.


To generate a diff of this commit:
cvs rdiff -u -r1.57 -r1.58 src/sys/arch/sparc64/dev/sab.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/sgimips/dev

2022-10-26 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Oct 26 23:59:14 UTC 2022

Modified Files:
src/sys/arch/sgimips/dev: scn.c

Log Message:
sgimips/scn(4): Convert to ttylock/ttyunlock.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/sgimips/dev/scn.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/sgimips/dev/scn.c
diff -u src/sys/arch/sgimips/dev/scn.c:1.9 src/sys/arch/sgimips/dev/scn.c:1.10
--- src/sys/arch/sgimips/dev/scn.c:1.9	Tue Oct  4 07:24:32 2022
+++ src/sys/arch/sgimips/dev/scn.c	Wed Oct 26 23:59:14 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: scn.c,v 1.9 2022/10/04 07:24:32 rin Exp $ */
+/*	$NetBSD: scn.c,v 1.10 2022/10/26 23:59:14 riastradh Exp $ */
 
 /*
  * Resurrected from the old pc532 port 1/18/2009.
@@ -92,7 +92,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: scn.c,v 1.9 2022/10/04 07:24:32 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: scn.c,v 1.10 2022/10/26 23:59:14 riastradh Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -1098,7 +1098,7 @@ scnopen(dev_t dev, int flags, int mode, 
 	if (kauth_authorize_device_tty(l->l_cred, KAUTH_DEVICE_TTY_OPEN, tp))
 		return (EBUSY);
 
-	mutex_spin_enter(_lock);
+	ttylock(tp);
 
 	if ((tp->t_state & TS_ISOPEN) == 0 && tp->t_wopen == 0) {
 		ttychars(tp);
@@ -1135,7 +1135,7 @@ scnopen(dev_t dev, int flags, int mode, 
 			tp->t_state &= ~TS_CARR_ON;
 	}
 
-	mutex_spin_exit(_lock);
+	ttyunlock(tp);
 
 	error = ttyopen(tp, SCN_DIALOUT(sc), flags & O_NONBLOCK);
 if (error) printf("ttyopen failed line %d, error %d\n", __LINE__, error);



CVS commit: src/sys/arch/sgimips/dev

2022-10-26 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Oct 26 23:59:14 UTC 2022

Modified Files:
src/sys/arch/sgimips/dev: scn.c

Log Message:
sgimips/scn(4): Convert to ttylock/ttyunlock.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/sgimips/dev/scn.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/amiga/dev

2022-10-26 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Oct 26 23:55:40 UTC 2022

Modified Files:
src/sys/arch/amiga/dev: msc.c

Log Message:
amiga/msc(4): Convert to ttylock/ttyunlock.


To generate a diff of this commit:
cvs rdiff -u -r1.47 -r1.48 src/sys/arch/amiga/dev/msc.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/amiga/dev/msc.c
diff -u src/sys/arch/amiga/dev/msc.c:1.47 src/sys/arch/amiga/dev/msc.c:1.48
--- src/sys/arch/amiga/dev/msc.c:1.47	Fri Jul 25 08:10:31 2014
+++ src/sys/arch/amiga/dev/msc.c	Wed Oct 26 23:55:40 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: msc.c,v 1.47 2014/07/25 08:10:31 dholland Exp $ */
+/*	$NetBSD: msc.c,v 1.48 2022/10/26 23:55:40 riastradh Exp $ */
 
 /*
  * Copyright (c) 1982, 1986, 1990 The Regents of the University of California.
@@ -93,7 +93,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: msc.c,v 1.47 2014/07/25 08:10:31 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: msc.c,v 1.48 2022/10/26 23:55:40 riastradh Exp $");
 
 #include "msc.h"
 
@@ -390,7 +390,7 @@ mscopen(dev_t dev, int flag, int mode, s
 	if (kauth_authorize_device_tty(l->l_cred, KAUTH_DEVICE_TTY_OPEN, tp))
 		return (EBUSY);
 
-	mutex_spin_enter(_lock);
+	ttylock(tp);
 	/* initialize tty */
 	if ((tp->t_state & TS_ISOPEN) == 0 && tp->t_wopen == 0) {
 		ttychars(tp);
@@ -451,7 +451,7 @@ mscopen(dev_t dev, int flag, int mode, s
 		tp->t_wopen--;
 
 		if (error) {
-			mutex_spin_exit(_lock);
+			ttyunlock(tp);
 			return(error);
 		}
 	}
@@ -472,7 +472,7 @@ mscopen(dev_t dev, int flag, int mode, s
 	 * use of the tty with a dialin open waiting.
 	 */
 	tp->t_dev = dev;
-	mutex_spin_exit(_lock);
+	ttyunlock(tp);
 
 	return tp->t_linesw->l_open(dev, tp);
 }



CVS commit: src/sys/arch/amiga/dev

2022-10-26 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Oct 26 23:55:40 UTC 2022

Modified Files:
src/sys/arch/amiga/dev: msc.c

Log Message:
amiga/msc(4): Convert to ttylock/ttyunlock.


To generate a diff of this commit:
cvs rdiff -u -r1.47 -r1.48 src/sys/arch/amiga/dev/msc.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/amiga/dev

2022-10-26 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Oct 26 23:54:19 UTC 2022

Modified Files:
src/sys/arch/amiga/dev: mfc.c

Log Message:
amiga/mfc(4): Convert to ttylock/ttyunlock.


To generate a diff of this commit:
cvs rdiff -u -r1.60 -r1.61 src/sys/arch/amiga/dev/mfc.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/amiga/dev/mfc.c
diff -u src/sys/arch/amiga/dev/mfc.c:1.60 src/sys/arch/amiga/dev/mfc.c:1.61
--- src/sys/arch/amiga/dev/mfc.c:1.60	Thu Oct 21 13:21:54 2021
+++ src/sys/arch/amiga/dev/mfc.c	Wed Oct 26 23:54:19 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: mfc.c,v 1.60 2021/10/21 13:21:54 andvar Exp $ */
+/*	$NetBSD: mfc.c,v 1.61 2022/10/26 23:54:19 riastradh Exp $ */
 
 /*
  * Copyright (c) 1982, 1990 The Regents of the University of California.
@@ -55,7 +55,7 @@
 #include "opt_kgdb.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: mfc.c,v 1.60 2021/10/21 13:21:54 andvar Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mfc.c,v 1.61 2022/10/26 23:54:19 riastradh Exp $");
 
 #include 
 #include 
@@ -516,7 +516,7 @@ mfcsopen(dev_t dev, int flag, int mode, 
 	if (kauth_authorize_device_tty(l->l_cred, KAUTH_DEVICE_TTY_OPEN, tp))
 		return (EBUSY);
 
-	mutex_spin_enter(_lock);
+	ttylock(tp);
 	if ((tp->t_state & TS_ISOPEN) == 0 && tp->t_wopen == 0) {
 		ttychars(tp);
 		if (tp->t_ispeed == 0) {
@@ -563,7 +563,7 @@ mfcsopen(dev_t dev, int flag, int mode, 
 		error = ttysleep(tp, >t_rawcv, true, 0);
 		tp->t_wopen--;
 		if (error) {
-			mutex_spin_exit(_lock);
+			ttyunlock(tp);
 			return(error);
 		}
 	}
@@ -578,7 +578,7 @@ done:
 	 * use of the tty with a dialin open waiting.
 	 */
 	tp->t_dev = dev;
-	mutex_spin_exit(_lock);
+	ttyunlock(tp);
 	return tp->t_linesw->l_open(dev, tp);
 }
 



CVS commit: src/sys/arch/amiga/dev

2022-10-26 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Oct 26 23:54:19 UTC 2022

Modified Files:
src/sys/arch/amiga/dev: mfc.c

Log Message:
amiga/mfc(4): Convert to ttylock/ttyunlock.


To generate a diff of this commit:
cvs rdiff -u -r1.60 -r1.61 src/sys/arch/amiga/dev/mfc.c

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



CVS commit: src/sys/dev/usb

2022-10-26 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Oct 26 23:53:04 UTC 2022

Modified Files:
src/sys/dev/usb: uhso.c

Log Message:
uhso(4): Convert locking comments to locking assertions.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/sys/dev/usb/uhso.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/dev/usb/uhso.c
diff -u src/sys/dev/usb/uhso.c:1.36 src/sys/dev/usb/uhso.c:1.37
--- src/sys/dev/usb/uhso.c:1.36	Sat Sep  3 02:48:00 2022
+++ src/sys/dev/usb/uhso.c	Wed Oct 26 23:53:03 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: uhso.c,v 1.36 2022/09/03 02:48:00 thorpej Exp $	*/
+/*	$NetBSD: uhso.c,v 1.37 2022/10/26 23:53:03 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2009 Iain Hibbert
@@ -37,7 +37,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uhso.c,v 1.36 2022/09/03 02:48:00 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uhso.c,v 1.37 2022/10/26 23:53:03 riastradh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -1759,7 +1759,6 @@ uhso_tty_do_ioctl(struct uhso_port *hp, 
 	return error;
 }
 
-/* this is called with tty_lock held */
 static void
 uhso_tty_stop(struct tty *tp, int flag)
 {
@@ -1768,6 +1767,8 @@ uhso_tty_stop(struct tty *tp, int flag)
 	UHSOUNIT(tp->t_dev));
 	struct uhso_port *hp = sc->sc_port[UHSOPORT(tp->t_dev)];
 #endif
+
+	KASSERT(ttylocked(tp));
 }
 
 static struct tty *
@@ -1838,7 +1839,6 @@ uhso_tty_param(struct tty *tp, struct te
 	return 0;
 }
 
-/* this is called with tty_lock held */
 Static void
 uhso_tty_start(struct tty *tp)
 {
@@ -1847,6 +1847,8 @@ uhso_tty_start(struct tty *tp)
 	struct uhso_port *hp = sc->sc_port[UHSOPORT(tp->t_dev)];
 	int s;
 
+	KASSERT(ttylocked(tp));
+
 	if (!device_is_active(sc->sc_dev))
 		return;
 



CVS commit: src/sys/dev/usb

2022-10-26 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Oct 26 23:53:04 UTC 2022

Modified Files:
src/sys/dev/usb: uhso.c

Log Message:
uhso(4): Convert locking comments to locking assertions.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/sys/dev/usb/uhso.c

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



CVS commit: src/sys/dev/usb

2022-10-26 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Oct 26 23:50:28 UTC 2022

Modified Files:
src/sys/dev/usb: ucycom.c

Log Message:
ucycom(4): Convert to ttylock/ttyunlock.


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 src/sys/dev/usb/ucycom.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/dev/usb/ucycom.c
diff -u src/sys/dev/usb/ucycom.c:1.55 src/sys/dev/usb/ucycom.c:1.56
--- src/sys/dev/usb/ucycom.c:1.55	Mon Mar 28 12:44:17 2022
+++ src/sys/dev/usb/ucycom.c	Wed Oct 26 23:50:28 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: ucycom.c,v 1.55 2022/03/28 12:44:17 riastradh Exp $	*/
+/*	$NetBSD: ucycom.c,v 1.56 2022/10/26 23:50:28 riastradh Exp $	*/
 
 /*
  * Copyright (c) 2005 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ucycom.c,v 1.55 2022/03/28 12:44:17 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ucycom.c,v 1.56 2022/10/26 23:50:28 riastradh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -272,11 +272,11 @@ ucycom_detach(device_t self, int flags)
 
 	s = splusb();
 	if (tp != NULL) {
-		mutex_spin_enter(_lock);
+		ttylock(tp);
 		CLR(tp->t_state, TS_CARR_ON);
 		CLR(tp->t_cflag, CLOCAL | MDMBUF);
 		ttyflush(tp, FREAD|FWRITE);
-		mutex_spin_exit(_lock);
+		ttyunlock(tp);
 	}
 	/* Wait for processes to go away. */
 	usb_detach_waitold(sc->sc_dev);
@@ -490,7 +490,7 @@ ucycomstart(struct tty *tp)
 	u_char *data;
 	int cnt, len, s;
 
-	KASSERT(mutex_owned(_lock));
+	KASSERT(ttylocked(tp));
 
 	if (sc->sc_dying)
 		return;



CVS commit: src/sys/dev/usb

2022-10-26 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Oct 26 23:50:28 UTC 2022

Modified Files:
src/sys/dev/usb: ucycom.c

Log Message:
ucycom(4): Convert to ttylock/ttyunlock.


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 src/sys/dev/usb/ucycom.c

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



CVS commit: src/sys/dev/usb

2022-10-26 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Oct 26 23:48:43 UTC 2022

Modified Files:
src/sys/dev/usb: ucom.c

Log Message:
ucom(4): Convert to ttylock/ttyunlock.


To generate a diff of this commit:
cvs rdiff -u -r1.133 -r1.134 src/sys/dev/usb/ucom.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/dev/usb/ucom.c
diff -u src/sys/dev/usb/ucom.c:1.133 src/sys/dev/usb/ucom.c:1.134
--- src/sys/dev/usb/ucom.c:1.133	Sun Apr 17 09:25:24 2022
+++ src/sys/dev/usb/ucom.c	Wed Oct 26 23:48:43 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: ucom.c,v 1.133 2022/04/17 09:25:24 riastradh Exp $	*/
+/*	$NetBSD: ucom.c,v 1.134 2022/10/26 23:48:43 riastradh Exp $	*/
 
 /*
  * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ucom.c,v 1.133 2022/04/17 09:25:24 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ucom.c,v 1.134 2022/10/26 23:48:43 riastradh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -415,10 +415,10 @@ ucom_detach(device_t self, int flags)
 
 	/* tty is now off.  */
 	if (tp != NULL) {
-		mutex_spin_enter(_lock);
+		ttylock(tp);
 		CLR(tp->t_state, TS_CARR_ON);
 		CLR(tp->t_cflag, CLOCAL | MDMBUF);
-		mutex_spin_exit(_lock);
+		ttyunlock(tp);
 	}
 
 	/* locate the major number */
@@ -783,10 +783,10 @@ ucomclose(dev_t dev, int flag, int mode,
 	 * ttyclose should have cleared TS_ISOPEN and interrupted all
 	 * pending opens, which should have completed by now.
 	 */
-	mutex_spin_enter(_lock);
+	ttylock(tp);
 	KASSERT(!ISSET(tp->t_state, TS_ISOPEN));
 	KASSERT(tp->t_wopen == 0);
-	mutex_spin_exit(_lock);
+	ttyunlock(tp);
 
 	/*
 	 * Close any device-specific state.
@@ -1180,7 +1180,7 @@ ucomhwiflow(struct tty *tp, int block)
 	UCOMHIST_FUNC(); UCOMHIST_CALLED();
 
 	KASSERT(>sc_lock);
-	KASSERT(mutex_owned(_lock));
+	KASSERT(ttylocked(tp));
 
 	old = sc->sc_rx_stopped;
 	sc->sc_rx_stopped = (u_char)block;
@@ -1263,14 +1263,14 @@ ucomstop(struct tty *tp, int flag)
 	struct ucom_softc * const sc = device_lookup_private(_cd, unit);
 
 	mutex_enter(>sc_lock);
-	mutex_spin_enter(_lock);
+	ttylock(tp);
 	if (ISSET(tp->t_state, TS_BUSY)) {
 		/* obuff_full -> obuff_free? */
 		/* sc->sc_tx_stopped = 1; */
 		if (!ISSET(tp->t_state, TS_TTSTOP))
 			SET(tp->t_state, TS_FLUSH);
 	}
-	mutex_spin_exit(_lock);
+	ttyunlock(tp);
 	mutex_exit(>sc_lock);
 #endif
 }
@@ -1303,22 +1303,22 @@ ucom_write_status(struct ucom_softc *sc,
 		SIMPLEQ_INSERT_TAIL(>sc_obuff_free, ub, ub_link);
 		cc -= sc->sc_opkthdrlen;
 
-		mutex_spin_enter(_lock);
+		ttylock(tp);
 		CLR(tp->t_state, TS_BUSY);
 		if (ISSET(tp->t_state, TS_FLUSH))
 			CLR(tp->t_state, TS_FLUSH);
 		else
 			ndflush(>t_outq, cc);
-		mutex_spin_exit(_lock);
+		ttyunlock(tp);
 
 		if (err != USBD_CANCELLED && err != USBD_IOERROR &&
 		!sc->sc_closing) {
 			if ((ub = SIMPLEQ_FIRST(>sc_obuff_full)) != NULL)
 ucom_submit_write(sc, ub);
 
-			mutex_spin_enter(_lock);
+			ttylock(tp);
 			(*tp->t_linesw->l_start)(tp);
-			mutex_spin_exit(_lock);
+			ttyunlock(tp);
 		}
 		break;
 	}
@@ -1356,13 +1356,13 @@ ucom_softintr(void *arg)
 	struct tty *tp = sc->sc_tty;
 
 	mutex_enter(>sc_lock);
-	mutex_enter(_lock);
+	ttylock(tp);
 	if (!ISSET(tp->t_state, TS_ISOPEN)) {
-		mutex_exit(_lock);
+		ttyunlock(tp);
 		mutex_exit(>sc_lock);
 		return;
 	}
-	mutex_exit(_lock);
+	ttyunlock(tp);
 
 	struct ucom_buffer *ub = SIMPLEQ_FIRST(>sc_obuff_full);
 
@@ -1390,7 +1390,7 @@ ucom_read_complete(struct ucom_softc *sc
 
 	while (ub != NULL && !sc->sc_rx_stopped) {
 
-		/* XXX ttyinput takes tty_lock */
+		/* XXX ttyinput takes ttylock */
 		while (ub->ub_index < ub->ub_len && !sc->sc_rx_stopped) {
 			/* Give characters to tty layer. */
 			if ((*rint)(ub->ub_data[ub->ub_index], tp) == -1) {
@@ -1453,9 +1453,9 @@ ucomreadcb(struct usbd_xfer *xfer, void 
 		if (status == USBD_IOERROR || sc->sc_closing) {
 			/* Send something to wake upper layer */
 			(tp->t_linesw->l_rint)('\n', tp);
-			mutex_spin_enter(_lock);	/* XXX */
+			ttylock(tp);	/* XXX */
 			ttwakeup(tp);
-			mutex_spin_exit(_lock);	/* XXX */
+			ttyunlock(tp);	/* XXX */
 		}
 
 		mutex_exit(>sc_lock);



CVS commit: src/sys/dev/usb

2022-10-26 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Oct 26 23:48:43 UTC 2022

Modified Files:
src/sys/dev/usb: ucom.c

Log Message:
ucom(4): Convert to ttylock/ttyunlock.


To generate a diff of this commit:
cvs rdiff -u -r1.133 -r1.134 src/sys/dev/usb/ucom.c

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



CVS commit: src/sys/dev/sun

2022-10-26 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Oct 26 23:47:55 UTC 2022

Modified Files:
src/sys/dev/sun: sunkbd.c

Log Message:
sunkbd(4): Convert to ttylock/ttyunlock.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/dev/sun/sunkbd.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/dev/sun/sunkbd.c
diff -u src/sys/dev/sun/sunkbd.c:1.31 src/sys/dev/sun/sunkbd.c:1.32
--- src/sys/dev/sun/sunkbd.c:1.31	Sun Sep 25 21:30:29 2022
+++ src/sys/dev/sun/sunkbd.c	Wed Oct 26 23:47:55 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: sunkbd.c,v 1.31 2022/09/25 21:30:29 thorpej Exp $	*/
+/*	$NetBSD: sunkbd.c,v 1.32 2022/10/26 23:47:55 riastradh Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -51,7 +51,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sunkbd.c,v 1.31 2022/09/25 21:30:29 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sunkbd.c,v 1.32 2022/10/26 23:47:55 riastradh Exp $");
 
 #include 
 #include 
@@ -301,8 +301,8 @@ sunkbd_write_data(struct kbd_sun_softc *
 {
 	struct tty *tp = k->k_priv;
 
-	mutex_spin_enter(_lock);
+	ttylock(tp);
 	ttyoutput(c, tp);
 	ttstart(tp);
-	mutex_spin_exit(_lock);
+	ttyunlock(tp);
 }



CVS commit: src/sys/dev/sun

2022-10-26 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Oct 26 23:47:55 UTC 2022

Modified Files:
src/sys/dev/sun: sunkbd.c

Log Message:
sunkbd(4): Convert to ttylock/ttyunlock.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/dev/sun/sunkbd.c

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



CVS commit: src/sys/dev/sbus

2022-10-26 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Oct 26 23:46:50 UTC 2022

Modified Files:
src/sys/dev/sbus: spif.c

Log Message:
spif(4): Convert to ttylock/ttyunlock.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sys/dev/sbus/spif.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/dev/sbus/spif.c
diff -u src/sys/dev/sbus/spif.c:1.34 src/sys/dev/sbus/spif.c:1.35
--- src/sys/dev/sbus/spif.c:1.34	Sat Aug  7 16:19:15 2021
+++ src/sys/dev/sbus/spif.c	Wed Oct 26 23:46:50 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: spif.c,v 1.34 2021/08/07 16:19:15 thorpej Exp $	*/
+/*	$NetBSD: spif.c,v 1.35 2022/10/26 23:46:50 riastradh Exp $	*/
 /*	$OpenBSD: spif.c,v 1.12 2003/10/03 16:44:51 miod Exp $	*/
 
 /*
@@ -41,7 +41,7 @@
 
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: spif.c,v 1.34 2021/08/07 16:19:15 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: spif.c,v 1.35 2022/10/26 23:46:50 riastradh Exp $");
 
 #include "spif.h"
 #if NSPIF > 0
@@ -354,7 +354,7 @@ stty_open(dev_t dev, int flags, int mode
 	if (kauth_authorize_device_tty(l->l_cred, KAUTH_DEVICE_TTY_OPEN, tp))
 		return (EBUSY);
 
-	mutex_spin_enter(_lock);
+	ttylock(tp);
 	if (!ISSET(tp->t_state, TS_ISOPEN) && tp->t_wopen == 0) {
 		ttychars(tp);
 		tp->t_iflag = TTYDEF_IFLAG;
@@ -393,12 +393,12 @@ stty_open(dev_t dev, int flags, int mode
 			int error;
 			error = ttysleep(tp, >t_rawcv, true, 0);
 			if (error != 0) {
-mutex_spin_exit(_lock);
+ttyunlock(tp);
 return (error);
 			}
 		}
 	}
-	mutex_spin_exit(_lock);
+	ttyunlock(tp);
 
 	return ((*tp->t_linesw->l_open)(dev, tp));
 }



CVS commit: src/sys/dev/sbus

2022-10-26 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Oct 26 23:46:50 UTC 2022

Modified Files:
src/sys/dev/sbus: spif.c

Log Message:
spif(4): Convert to ttylock/ttyunlock.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sys/dev/sbus/spif.c

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



CVS commit: src/sys/dev/qbus

2022-10-26 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Oct 26 23:46:37 UTC 2022

Modified Files:
src/sys/dev/qbus: dhu.c

Log Message:
vax/dhu(4): Convert to ttylock/ttyunlock.


To generate a diff of this commit:
cvs rdiff -u -r1.57 -r1.58 src/sys/dev/qbus/dhu.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/dev/qbus/dhu.c
diff -u src/sys/dev/qbus/dhu.c:1.57 src/sys/dev/qbus/dhu.c:1.58
--- src/sys/dev/qbus/dhu.c:1.57	Fri Jul 25 08:10:38 2014
+++ src/sys/dev/qbus/dhu.c	Wed Oct 26 23:46:37 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: dhu.c,v 1.57 2014/07/25 08:10:38 dholland Exp $	*/
+/*	$NetBSD: dhu.c,v 1.58 2022/10/26 23:46:37 riastradh Exp $	*/
 /*
  * Copyright (c) 2003, Hugh Graham.
  * Copyright (c) 1992, 1993
@@ -68,7 +68,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: dhu.c,v 1.57 2014/07/25 08:10:38 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dhu.c,v 1.58 2022/10/26 23:46:37 riastradh Exp $");
 
 #include 
 #include 
@@ -439,7 +439,8 @@ dhuopen(dev_t dev, int flag, int mode, s
 	if (line >= sc->sc_lines)
 		return ENXIO;
 
-	mutex_spin_enter(_lock);
+	tp = sc->sc_dhu[line].dhu_tty;
+	ttylock(tp);
 	if (sc->sc_type == IS_DHU) {
 		/* CSR 3:0 must be 0 */
 		DHU_WRITE_BYTE(DHU_UBA_CSR, DHU_CSR_RXIE);
@@ -449,8 +450,6 @@ dhuopen(dev_t dev, int flag, int mode, s
 	DHU_WRITE_BYTE(DHU_UBA_CSR, DHU_CSR_RXIE | line);
 	sc->sc_dhu[line].dhu_modem = DHU_READ_WORD(DHU_UBA_STAT);
 
-	tp = sc->sc_dhu[line].dhu_tty;
-
 	if (kauth_authorize_device_tty(l->l_cred, KAUTH_DEVICE_TTY_OPEN, tp))
 		return (EBUSY);
 
@@ -482,7 +481,7 @@ dhuopen(dev_t dev, int flag, int mode, s
 		if (error)
 			break;
 	}
-	mutex_spin_exit(_lock);
+	ttyunlock(tp);
 	if (error)
 		return (error);
 	return ((*tp->t_linesw->l_open)(dev, tp));



CVS commit: src/sys/dev/qbus

2022-10-26 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Oct 26 23:46:37 UTC 2022

Modified Files:
src/sys/dev/qbus: dhu.c

Log Message:
vax/dhu(4): Convert to ttylock/ttyunlock.


To generate a diff of this commit:
cvs rdiff -u -r1.57 -r1.58 src/sys/dev/qbus/dhu.c

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



CVS commit: src/sys/dev/pci

2022-10-26 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Oct 26 23:46:24 UTC 2022

Modified Files:
src/sys/dev/pci: cz.c

Log Message:
cz(4): Convert to ttylock/ttyunlock.


To generate a diff of this commit:
cvs rdiff -u -r1.64 -r1.65 src/sys/dev/pci/cz.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/dev/pci/cz.c
diff -u src/sys/dev/pci/cz.c:1.64 src/sys/dev/pci/cz.c:1.65
--- src/sys/dev/pci/cz.c:1.64	Sun Dec  9 11:14:02 2018
+++ src/sys/dev/pci/cz.c	Wed Oct 26 23:46:24 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: cz.c,v 1.64 2018/12/09 11:14:02 jdolecek Exp $	*/
+/*	$NetBSD: cz.c,v 1.65 2022/10/26 23:46:24 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2000 Zembu Labs, Inc.
@@ -73,7 +73,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cz.c,v 1.64 2018/12/09 11:14:02 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cz.c,v 1.65 2022/10/26 23:46:24 riastradh Exp $");
 
 #include 
 #include 
@@ -731,9 +731,9 @@ cz_intr(void *arg)
 /*
  * Do wakeup stuff here.
  */
-mutex_spin_enter(_lock); /* XXX */
+ttylock(tp); /* XXX */
 ttwakeup(tp);
-mutex_spin_exit(_lock); /* XXX */
+ttyunlock(tp); /* XXX */
 wakeup(tp);
 			}
 			break;
@@ -754,9 +754,9 @@ cz_intr(void *arg)
 /*
  * Do wakeup stuff here.
  */
-mutex_spin_enter(_lock); /* XXX */
+ttylock(tp); /* XXX */
 ttwakeup(tp);
-mutex_spin_exit(_lock); /* XXX */
+ttyunlock(tp); /* XXX */
 wakeup(tp);
 			}
 			break;
@@ -804,9 +804,9 @@ cz_intr(void *arg)
 			 * flags set. So TTY_FE by itself works.
 			 */
 			(*tp->t_linesw->l_rint)(TTY_FE, tp);
-			mutex_spin_enter(_lock); /* XXX */
+			ttylock(tp); /* XXX */
 			ttwakeup(tp);
-			mutex_spin_exit(_lock); /* XXX */
+			ttyunlock(tp); /* XXX */
 			wakeup(tp);
 			break;
 



CVS commit: src/sys/dev/pci

2022-10-26 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Oct 26 23:46:24 UTC 2022

Modified Files:
src/sys/dev/pci: cz.c

Log Message:
cz(4): Convert to ttylock/ttyunlock.


To generate a diff of this commit:
cvs rdiff -u -r1.64 -r1.65 src/sys/dev/pci/cz.c

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



CVS commit: src/sys/dev/ir

2022-10-26 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Oct 26 23:45:43 UTC 2022

Modified Files:
src/sys/dev/ir: irframe_tty.c

Log Message:
irframetty(4): Convert to ttylock/ttyunlock.


To generate a diff of this commit:
cvs rdiff -u -r1.66 -r1.67 src/sys/dev/ir/irframe_tty.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/dev/ir/irframe_tty.c
diff -u src/sys/dev/ir/irframe_tty.c:1.66 src/sys/dev/ir/irframe_tty.c:1.67
--- src/sys/dev/ir/irframe_tty.c:1.66	Tue May 24 20:50:19 2022
+++ src/sys/dev/ir/irframe_tty.c	Wed Oct 26 23:45:43 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: irframe_tty.c,v 1.66 2022/05/24 20:50:19 andvar Exp $	*/
+/*	$NetBSD: irframe_tty.c,v 1.67 2022/10/26 23:45:43 riastradh Exp $	*/
 
 /*
  * TODO
@@ -41,7 +41,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: irframe_tty.c,v 1.66 2022/05/24 20:50:19 andvar Exp $");
+__KERNEL_RCSID(0, "$NetBSD: irframe_tty.c,v 1.67 2022/10/26 23:45:43 riastradh Exp $");
 
 #include 
 #include 
@@ -313,9 +313,9 @@ irframetopen(dev_t dev, struct tty *tp)
 
 	DPRINTF(("%s: set sc=%p\n", __func__, sc));
 
-	mutex_spin_enter(_lock);
+	ttylock(tp);
 	ttyflush(tp, FREAD | FWRITE);
-	mutex_spin_exit(_lock);
+	ttyunlock(tp);
 
 	sc->sc_dongle = DONGLE_NONE;
 	sc->sc_dongle_private = 0;
@@ -341,9 +341,9 @@ irframetclose(struct tty *tp, int flag)
 	DPRINTF(("%s: tp=%p\n", __func__, tp));
 
 	s = spltty();
-	mutex_spin_enter(_lock);
+	ttylock(tp);
 	ttyflush(tp, FREAD | FWRITE);
-	mutex_spin_exit(_lock);	 /* XXX */
+	ttyunlock(tp);	 /* XXX */
 	ttyldisc_release(tp->t_linesw);
 	tp->t_linesw = ttyldisc_default(); if (sc != NULL) {
 		irt_buffer(sc, 0);
@@ -684,17 +684,17 @@ irt_putc(struct tty *tp, int c)
 #endif
 	if (tp->t_outq.c_cc > tp->t_hiwat) {
 		irframetstart(tp);
-		mutex_spin_enter(_lock);
+		ttylock(tp);
 		/*
 		 * This can only occur if FLUSHO is set in t_lflag,
 		 * or if ttstart/oproc is synchronous (or very fast).
 		 */
 		if (tp->t_outq.c_cc <= tp->t_hiwat) {
-			mutex_spin_exit(_lock);
+			ttyunlock(tp);
 			goto go;
 		}
 		error = ttysleep(tp, >t_outcv, true, 0);
-		mutex_spin_exit(_lock);
+		ttyunlock(tp);
 		if (error)
 			return (error);
 	}



CVS commit: src/sys/dev/ir

2022-10-26 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Oct 26 23:45:43 UTC 2022

Modified Files:
src/sys/dev/ir: irframe_tty.c

Log Message:
irframetty(4): Convert to ttylock/ttyunlock.


To generate a diff of this commit:
cvs rdiff -u -r1.66 -r1.67 src/sys/dev/ir/irframe_tty.c

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



CVS commit: src/sys/dev/ic

2022-10-26 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Oct 26 23:45:25 UTC 2022

Modified Files:
src/sys/dev/ic: z8530tty.c

Log Message:
zs(4): Convert to ttylock/ttyunlock.


To generate a diff of this commit:
cvs rdiff -u -r1.134 -r1.135 src/sys/dev/ic/z8530tty.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/dev/ic/z8530tty.c
diff -u src/sys/dev/ic/z8530tty.c:1.134 src/sys/dev/ic/z8530tty.c:1.135
--- src/sys/dev/ic/z8530tty.c:1.134	Sun Nov 10 21:16:35 2019
+++ src/sys/dev/ic/z8530tty.c	Wed Oct 26 23:45:25 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: z8530tty.c,v 1.134 2019/11/10 21:16:35 chs Exp $	*/
+/*	$NetBSD: z8530tty.c,v 1.135 2022/10/26 23:45:25 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 1993, 1994, 1995, 1996, 1997, 1998, 1999
@@ -137,7 +137,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: z8530tty.c,v 1.134 2019/11/10 21:16:35 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: z8530tty.c,v 1.135 2022/10/26 23:45:25 riastradh Exp $");
 
 #include "opt_kgdb.h"
 #include "opt_ntp.h"
@@ -565,7 +565,7 @@ zsopen(dev_t dev, int flags, int mode, s
 	if (kauth_authorize_device_tty(l->l_cred, KAUTH_DEVICE_TTY_OPEN, tp))
 		return (EBUSY);
 
-	mutex_spin_enter(_lock);
+	ttylock(tp);
 
 	/*
 	 * Do the following iff this is a first open.
@@ -578,7 +578,7 @@ zsopen(dev_t dev, int flags, int mode, s
 		/* Call the power management hook. */
 		if (cs->enable) {
 			if ((*cs->enable)(cs)) {
-mutex_spin_exit(_lock);
+ttyunlock(tp);
 printf("%s: device enable failed\n",
 device_xname(zst->zst_dev));
 return (EIO);
@@ -624,9 +624,9 @@ zsopen(dev_t dev, int flags, int mode, s
 
 		/* Make sure zsparam will see changes. */
 		tp->t_ospeed = 0;
-		mutex_spin_exit(_lock);
+		ttyunlock(tp);
 		(void) zsparam(tp, );
-		mutex_spin_enter(_lock);
+		ttylock(tp);
 
 		/*
 		 * Note: zsparam has done: cflag, ispeed, ospeed
@@ -666,7 +666,7 @@ zsopen(dev_t dev, int flags, int mode, s
 		mutex_spin_exit(>cs_lock);
 	}
 
-	mutex_spin_exit(_lock);
+	ttyunlock(tp);
 
 	error = ttyopen(tp, ZSDIALOUT(dev), ISSET(flags, O_NONBLOCK));
 	if (error)



CVS commit: src/sys/dev/ic

2022-10-26 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Oct 26 23:45:25 UTC 2022

Modified Files:
src/sys/dev/ic: z8530tty.c

Log Message:
zs(4): Convert to ttylock/ttyunlock.


To generate a diff of this commit:
cvs rdiff -u -r1.134 -r1.135 src/sys/dev/ic/z8530tty.c

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



CVS commit: src/sys/dev/hpc

2022-10-26 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Oct 26 23:45:10 UTC 2022

Modified Files:
src/sys/dev/hpc: hpf1275a_tty.c

Log Message:
hpf1275a(4): Convert to ttylock/ttyunlock.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/dev/hpc/hpf1275a_tty.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/dev/hpc/hpf1275a_tty.c
diff -u src/sys/dev/hpc/hpf1275a_tty.c:1.31 src/sys/dev/hpc/hpf1275a_tty.c:1.32
--- src/sys/dev/hpc/hpf1275a_tty.c:1.31	Sat Aug  7 16:19:11 2021
+++ src/sys/dev/hpc/hpf1275a_tty.c	Wed Oct 26 23:45:10 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: hpf1275a_tty.c,v 1.31 2021/08/07 16:19:11 thorpej Exp $ */
+/*	$NetBSD: hpf1275a_tty.c,v 1.32 2022/10/26 23:45:10 riastradh Exp $ */
 
 /*
  * Copyright (c) 2004 Valeriy E. Ushakov
@@ -28,7 +28,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: hpf1275a_tty.c,v 1.31 2021/08/07 16:19:11 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hpf1275a_tty.c,v 1.32 2022/10/26 23:45:10 riastradh Exp $");
 
 #include "opt_wsdisplay_compat.h"
 
@@ -346,9 +346,9 @@ hpf1275a_close(struct tty *tp, int flag)
 	int s;
 
 	s = spltty();
-	mutex_spin_enter(_lock);
+	ttylock(tp);
 	ttyflush(tp, FREAD | FWRITE);
-	mutex_spin_exit(_lock);	 /* XXX */
+	ttyunlock(tp);	 /* XXX */
 	ttyldisc_release(tp->t_linesw);
 	tp->t_linesw = ttyldisc_default();
 	if (sc != NULL) {



CVS commit: src/sys/dev/hpc

2022-10-26 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Oct 26 23:45:10 UTC 2022

Modified Files:
src/sys/dev/hpc: hpf1275a_tty.c

Log Message:
hpf1275a(4): Convert to ttylock/ttyunlock.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/dev/hpc/hpf1275a_tty.c

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



CVS commit: src/sys/dev/dec

2022-10-26 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Oct 26 23:44:36 UTC 2022

Modified Files:
src/sys/dev/dec: dz.c

Log Message:
vax/dz(4): Convert to ttylock/ttyunlock.


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.43 src/sys/dev/dec/dz.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/dev/dec/dz.c
diff -u src/sys/dev/dec/dz.c:1.42 src/sys/dev/dec/dz.c:1.43
--- src/sys/dev/dec/dz.c:1.42	Fri Jul 25 08:10:36 2014
+++ src/sys/dev/dec/dz.c	Wed Oct 26 23:44:36 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: dz.c,v 1.42 2014/07/25 08:10:36 dholland Exp $	*/
+/*	$NetBSD: dz.c,v 1.43 2022/10/26 23:44:36 riastradh Exp $	*/
 /*
  * Copyright (c) 1992, 1993
  *	The Regents of the University of California.  All rights reserved.
@@ -67,7 +67,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: dz.c,v 1.42 2014/07/25 08:10:36 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dz.c,v 1.43 2022/10/26 23:44:36 riastradh Exp $");
 
 #include 
 #include 
@@ -407,7 +407,7 @@ dzopen(dev_t dev, int flag, int mode, st
 	/* Use DMBIS and *not* DMSET or else we clobber incoming bits */
 	if (dzmctl(sc, line, DML_DTR, DMBIS) & DML_DCD)
 		tp->t_state |= TS_CARR_ON;
-	mutex_spin_enter(_lock);
+	ttylock(tp);
 	while (!(flag & O_NONBLOCK) && !(tp->t_cflag & CLOCAL) &&
 	   !(tp->t_state & TS_CARR_ON)) {
 		tp->t_wopen++;
@@ -416,7 +416,7 @@ dzopen(dev_t dev, int flag, int mode, st
 		if (error)
 			break;
 	}
-	mutex_spin_exit(_lock);
+	ttyunlock(tp);
 	if (error)
 		return (error);
 	return ((*tp->t_linesw->l_open)(dev, tp));



CVS commit: src/sys/dev/dec

2022-10-26 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Oct 26 23:44:36 UTC 2022

Modified Files:
src/sys/dev/dec: dz.c

Log Message:
vax/dz(4): Convert to ttylock/ttyunlock.


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.43 src/sys/dev/dec/dz.c

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



CVS commit: src/sys/dev/bluetooth

2022-10-26 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Oct 26 23:44:03 UTC 2022

Modified Files:
src/sys/dev/bluetooth: btuart.c

Log Message:
btuart(4): Convert to ttylock/ttyunlock.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/sys/dev/bluetooth/btuart.c

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



CVS commit: src/sys/dev/bluetooth

2022-10-26 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Oct 26 23:44:03 UTC 2022

Modified Files:
src/sys/dev/bluetooth: btuart.c

Log Message:
btuart(4): Convert to ttylock/ttyunlock.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/sys/dev/bluetooth/btuart.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/dev/bluetooth/btuart.c
diff -u src/sys/dev/bluetooth/btuart.c:1.30 src/sys/dev/bluetooth/btuart.c:1.31
--- src/sys/dev/bluetooth/btuart.c:1.30	Tue Jun 28 13:25:36 2022
+++ src/sys/dev/bluetooth/btuart.c	Wed Oct 26 23:44:03 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: btuart.c,v 1.30 2022/06/28 13:25:36 plunky Exp $	*/
+/*	$NetBSD: btuart.c,v 1.31 2022/10/26 23:44:03 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2006, 2007 KIYOHARA Takashi
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: btuart.c,v 1.30 2022/06/28 13:25:36 plunky Exp $");
+__KERNEL_RCSID(0, "$NetBSD: btuart.c,v 1.31 2022/10/26 23:44:03 riastradh Exp $");
 
 #include 
 #include 
@@ -265,9 +265,9 @@ btuartopen(dev_t devno __unused, struct 
 	sc->sc_tp = tp;
 	tp->t_sc = sc;
 
-	mutex_spin_enter(_lock);
+	ttylock(tp);
 	ttyflush(tp, FREAD | FWRITE);
-	mutex_spin_exit(_lock);
+	ttyunlock(tp);
 
 	splx(s);
 
@@ -283,9 +283,9 @@ btuartclose(struct tty *tp, int flag __u
 
 	s = spltty();
 
-	mutex_spin_enter(_lock);
+	ttylock(tp);
 	ttyflush(tp, FREAD | FWRITE);
-	mutex_spin_exit(_lock);	/* XXX */
+	ttyunlock(tp);	/* XXX */
 
 	ttyldisc_release(tp->t_linesw);
 	tp->t_linesw = ttyldisc_default();



CVS commit: src/sys/dev/bluetooth

2022-10-26 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Oct 26 23:43:34 UTC 2022

Modified Files:
src/sys/dev/bluetooth: bth5.c

Log Message:
bth5(4): Convert to ttylock/ttyunlock.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/dev/bluetooth/bth5.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/dev/bluetooth/bth5.c
diff -u src/sys/dev/bluetooth/bth5.c:1.7 src/sys/dev/bluetooth/bth5.c:1.8
--- src/sys/dev/bluetooth/bth5.c:1.7	Tue Jun 28 13:25:36 2022
+++ src/sys/dev/bluetooth/bth5.c	Wed Oct 26 23:43:34 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: bth5.c,v 1.7 2022/06/28 13:25:36 plunky Exp $	*/
+/*	$NetBSD: bth5.c,v 1.8 2022/10/26 23:43:34 riastradh Exp $	*/
 /*
  * Copyright (c) 2017 Nathanial Sloss 
  * All rights reserved.
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: bth5.c,v 1.7 2022/06/28 13:25:36 plunky Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bth5.c,v 1.8 2022/10/26 23:43:34 riastradh Exp $");
 
 #include 
 #include 
@@ -411,11 +411,11 @@ bth5open(dev_t device __unused, struct t
 	}
 	sc = device_private(dev);
 
-	mutex_spin_enter(_lock);
+	ttylock(tp);
 	tp->t_sc = sc;
 	sc->sc_tp = tp;
 	ttyflush(tp, FREAD | FWRITE);
-	mutex_spin_exit(_lock);
+	ttyunlock(tp);
 
 	splx(s);
 
@@ -444,9 +444,9 @@ bth5close(struct tty *tp, int flag __unu
 	MBUFQ_DRAIN(>sc_dgq);
 	bth5_sequencing_reset(sc);
 
-	mutex_spin_enter(_lock);
+	ttylock(tp);
 	ttyflush(tp, FREAD | FWRITE);
-	mutex_spin_exit(_lock);	/* XXX */
+	ttyunlock(tp);	/* XXX */
 	ttyldisc_release(tp->t_linesw);
 	tp->t_linesw = ttyldisc_default();
 	if (sc != NULL) {



CVS commit: src/sys/dev/bluetooth

2022-10-26 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Oct 26 23:43:34 UTC 2022

Modified Files:
src/sys/dev/bluetooth: bth5.c

Log Message:
bth5(4): Convert to ttylock/ttyunlock.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/dev/bluetooth/bth5.c

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



CVS commit: src/sys/dev/bluetooth

2022-10-26 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Oct 26 23:43:21 UTC 2022

Modified Files:
src/sys/dev/bluetooth: bcsp.c

Log Message:
bcsp(4): Convert to ttylock/ttyunlock.


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/sys/dev/bluetooth/bcsp.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/dev/bluetooth/bcsp.c
diff -u src/sys/dev/bluetooth/bcsp.c:1.32 src/sys/dev/bluetooth/bcsp.c:1.33
--- src/sys/dev/bluetooth/bcsp.c:1.32	Tue Jun 28 13:25:36 2022
+++ src/sys/dev/bluetooth/bcsp.c	Wed Oct 26 23:43:21 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: bcsp.c,v 1.32 2022/06/28 13:25:36 plunky Exp $	*/
+/*	$NetBSD: bcsp.c,v 1.33 2022/10/26 23:43:21 riastradh Exp $	*/
 /*
  * Copyright (c) 2007 KIYOHARA Takashi
  * All rights reserved.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: bcsp.c,v 1.32 2022/06/28 13:25:36 plunky Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bcsp.c,v 1.33 2022/10/26 23:43:21 riastradh Exp $");
 
 #include 
 #include 
@@ -406,11 +406,11 @@ bcspopen(dev_t device __unused, struct t
 	}
 	sc = device_private(dev);
 
-	mutex_spin_enter(_lock);
+	ttylock(tp);
 	tp->t_sc = sc;
 	sc->sc_tp = tp;
 	ttyflush(tp, FREAD | FWRITE);
-	mutex_spin_exit(_lock);
+	ttyunlock(tp);
 
 	splx(s);
 
@@ -439,9 +439,9 @@ bcspclose(struct tty *tp, int flag __unu
 	MBUFQ_DRAIN(>sc_dgq);
 	bcsp_sequencing_reset(sc);
 
-	mutex_spin_enter(_lock);
+	ttylock(tp);
 	ttyflush(tp, FREAD | FWRITE);
-	mutex_spin_exit(_lock);	/* XXX */
+	ttyunlock(tp);	/* XXX */
 	ttyldisc_release(tp->t_linesw);
 	tp->t_linesw = ttyldisc_default();
 	if (sc != NULL) {



CVS commit: src/sys/dev/bluetooth

2022-10-26 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Oct 26 23:43:21 UTC 2022

Modified Files:
src/sys/dev/bluetooth: bcsp.c

Log Message:
bcsp(4): Convert to ttylock/ttyunlock.


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/sys/dev/bluetooth/bcsp.c

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



CVS commit: src/sys/net

2022-10-26 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Oct 26 23:42:56 UTC 2022

Modified Files:
src/sys/net: ppp_tty.c

Log Message:
ppp(4): Convert to ttylock/ttyunlock.


To generate a diff of this commit:
cvs rdiff -u -r1.70 -r1.71 src/sys/net/ppp_tty.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/net/ppp_tty.c
diff -u src/sys/net/ppp_tty.c:1.70 src/sys/net/ppp_tty.c:1.71
--- src/sys/net/ppp_tty.c:1.70	Wed May  4 07:48:35 2022
+++ src/sys/net/ppp_tty.c	Wed Oct 26 23:42:56 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: ppp_tty.c,v 1.70 2022/05/04 07:48:35 andvar Exp $	*/
+/*	$NetBSD: ppp_tty.c,v 1.71 2022/10/26 23:42:56 riastradh Exp $	*/
 /*	Id: ppp_tty.c,v 1.3 1996/07/01 01:04:11 paulus Exp 	*/
 
 /*
@@ -93,7 +93,7 @@
 /* from NetBSD: if_ppp.c,v 1.15.2.2 1994/07/28 05:17:58 cgd Exp */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ppp_tty.c,v 1.70 2022/05/04 07:48:35 andvar Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ppp_tty.c,v 1.71 2022/10/26 23:42:56 riastradh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "ppp.h"
@@ -235,9 +235,9 @@ pppopen(dev_t dev, struct tty *tp)
 sc->sc_if.if_baudrate = tp->t_ospeed;
 
 tp->t_sc = (void *) sc;
-mutex_spin_enter(_lock);
+ttylock(tp);
 ttyflush(tp, FREAD | FWRITE);
-mutex_spin_exit(_lock);
+ttyunlock(tp);
 
 splx(s);
 return (0);
@@ -256,9 +256,9 @@ pppclose(struct tty *tp, int flag)
 int s;
 
 s = spltty();
-mutex_spin_enter(_lock);
+ttylock(tp);
 ttyflush(tp, FREAD|FWRITE);
-mutex_spin_exit(_lock);	/* XXX */
+ttyunlock(tp);	/* XXX */
 ttyldisc_release(tp->t_linesw);
 tp->t_linesw = ttyldisc_default();
 sc = (struct ppp_softc *) tp->t_sc;
@@ -316,27 +316,27 @@ pppread(struct tty *tp, struct uio *uio,
  * Loop waiting for input, checking that nothing disastrous
  * happens in the meantime.
  */
-mutex_spin_enter(_lock);
+ttylock(tp);
 for (;;) {
 	if (tp != (struct tty *) sc->sc_devp ||
 	tp->t_linesw != _disc) {
-	mutex_spin_exit(_lock);
+	ttyunlock(tp);
 	return 0;
 	}
 	if (sc->sc_inq.ifq_head != NULL)
 	break;
 	if ((tp->t_state & TS_CARR_ON) == 0 && (tp->t_cflag & CLOCAL) == 0
 	&& (tp->t_state & TS_ISOPEN)) {
-	mutex_spin_exit(_lock);
+	ttyunlock(tp);
 	return 0;		/* end of file */
 	}
 	if (tp->t_state & TS_ASYNC || flag & IO_NDELAY) {
-	mutex_spin_exit(_lock);
+	ttyunlock(tp);
 	return (EWOULDBLOCK);
 	}
 	error = ttysleep(tp, >t_rawcv, true, 0);
 	if (error) {
-	mutex_spin_exit(_lock);
+	ttyunlock(tp);
 	return error;
 	}
 }
@@ -346,7 +346,7 @@ pppread(struct tty *tp, struct uio *uio,
 
 /* Get the packet from the input queue */
 IF_DEQUEUE(>sc_inq, m0);
-mutex_spin_exit(_lock);
+ttyunlock(tp);
 
 for (m = m0; m && uio->uio_resid; m = m->m_next)
 	if ((error = uiomove(mtod(m, u_char *), m->m_len, uio)) != 0)
@@ -702,7 +702,7 @@ pppasyncstart(struct ppp_softc *sc)
 	return;
 }
 
-mutex_spin_enter(_lock);
+ttylock(tp);
 
 idle = 0;
 while (CCOUNT(>t_outq) < PPP_HIWAT) {
@@ -860,7 +860,7 @@ pppasyncstart(struct ppp_softc *sc)
 	sc->sc_flags |= SC_TIMEOUT;
 }
 
-mutex_spin_exit(_lock);
+ttyunlock(tp);
 }
 
 /*
@@ -873,11 +873,11 @@ pppasyncctlp(struct ppp_softc *sc)
 struct tty *tp;
 
 /* Put a placeholder byte in canq for ttselect()/ttnread(). */
-mutex_spin_enter(_lock);
 tp = (struct tty *) sc->sc_devp;
+ttylock(tp);
 putc(0, >t_canq);
 ttwakeup(tp);
-mutex_spin_exit(_lock);
+ttyunlock(tp);
 }
 
 /*
@@ -932,10 +932,10 @@ ppp_timeout(void *x)
 struct ppp_softc *sc = (struct ppp_softc *) x;
 struct tty *tp = (struct tty *) sc->sc_devp;
 
-mutex_spin_enter(_lock);
+ttylock(tp);
 sc->sc_flags &= ~SC_TIMEOUT;
 pppstart(tp);
-mutex_spin_exit(_lock);
+ttyunlock(tp);
 }
 
 /*



CVS commit: src/sys/net

2022-10-26 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Oct 26 23:42:56 UTC 2022

Modified Files:
src/sys/net: ppp_tty.c

Log Message:
ppp(4): Convert to ttylock/ttyunlock.


To generate a diff of this commit:
cvs rdiff -u -r1.70 -r1.71 src/sys/net/ppp_tty.c

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



CVS commit: src/sys/net

2022-10-26 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Oct 26 23:42:42 UTC 2022

Modified Files:
src/sys/net: if_sl.c

Log Message:
sl(4): Convert to ttylock/ttyunlock.


To generate a diff of this commit:
cvs rdiff -u -r1.135 -r1.136 src/sys/net/if_sl.c

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



CVS commit: src/sys/net

2022-10-26 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Oct 26 23:42:42 UTC 2022

Modified Files:
src/sys/net: if_sl.c

Log Message:
sl(4): Convert to ttylock/ttyunlock.


To generate a diff of this commit:
cvs rdiff -u -r1.135 -r1.136 src/sys/net/if_sl.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/net/if_sl.c
diff -u src/sys/net/if_sl.c:1.135 src/sys/net/if_sl.c:1.136
--- src/sys/net/if_sl.c:1.135	Sat Sep  3 02:47:59 2022
+++ src/sys/net/if_sl.c	Wed Oct 26 23:42:42 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_sl.c,v 1.135 2022/09/03 02:47:59 thorpej Exp $	*/
+/*	$NetBSD: if_sl.c,v 1.136 2022/10/26 23:42:42 riastradh Exp $	*/
 
 /*
  * Copyright (c) 1987, 1989, 1992, 1993
@@ -60,7 +60,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_sl.c,v 1.135 2022/09/03 02:47:59 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_sl.c,v 1.136 2022/10/26 23:42:42 riastradh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -350,7 +350,7 @@ slopen(dev_t dev, struct tty *tp)
 			tp->t_sc = (void *)sc;
 			sc->sc_ttyp = tp;
 			sc->sc_if.if_baudrate = tp->t_ospeed;
-			mutex_spin_enter(_lock);
+			ttylock(tp);
 			tp->t_state |= TS_ISOPEN | TS_XCLUDE;
 			ttyflush(tp, FREAD | FWRITE);
 			/*
@@ -366,7 +366,7 @@ slopen(dev_t dev, struct tty *tp)
 sc->sc_oldbufquot = tp->t_outq.c_cq != 0;
 
 clfree(>t_outq);
-mutex_spin_exit(_lock);
+ttyunlock(tp);
 error = clalloc(>t_outq, 2 * SLMAX + 2, 0);
 if (error) {
 	softint_disestablish(sc->sc_si);
@@ -379,7 +379,7 @@ slopen(dev_t dev, struct tty *tp)
 }
 			} else {
 sc->sc_oldbufsize = sc->sc_oldbufquot = 0;
-mutex_spin_exit(_lock);
+ttyunlock(tp);
 			}
 			return 0;
 		}



CVS commit: src/sys/dev/ic

2022-10-26 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Oct 26 23:42:05 UTC 2022

Modified Files:
src/sys/dev/ic: cy.c

Log Message:
cy(4): Convert to ttylock/ttyunlock.


To generate a diff of this commit:
cvs rdiff -u -r1.62 -r1.63 src/sys/dev/ic/cy.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/dev/ic/cy.c
diff -u src/sys/dev/ic/cy.c:1.62 src/sys/dev/ic/cy.c:1.63
--- src/sys/dev/ic/cy.c:1.62	Sun Nov 10 21:16:35 2019
+++ src/sys/dev/ic/cy.c	Wed Oct 26 23:42:04 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: cy.c,v 1.62 2019/11/10 21:16:35 chs Exp $	*/
+/*	$NetBSD: cy.c,v 1.63 2022/10/26 23:42:04 riastradh Exp $	*/
 
 /*
  * cy.c
@@ -16,7 +16,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cy.c,v 1.62 2019/11/10 21:16:35 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cy.c,v 1.63 2022/10/26 23:42:04 riastradh Exp $");
 
 #include 
 #include 
@@ -380,18 +380,18 @@ cyopen(dev_t dev, int flag, int mode, st
 
 	/* wait for carrier if necessary */
 	if (!ISSET(flag, O_NONBLOCK)) {
-		mutex_spin_enter(_lock);
+		ttylock(tp);
 		while (!ISSET(tp->t_cflag, CLOCAL) &&
 		!ISSET(tp->t_state, TS_CARR_ON)) {
 			tp->t_wopen++;
 			error = ttysleep(tp, >t_rawcv, true, 0);
 			tp->t_wopen--;
 			if (error != 0) {
-mutex_spin_exit(_lock);
+ttyunlock(tp);
 return error;
 			}
 		}
-		mutex_spin_exit(_lock);
+		ttyunlock(tp);
 	}
 
 	return (*tp->t_linesw->l_open) (dev, tp);



CVS commit: src/sys/dev/ic

2022-10-26 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Oct 26 23:42:05 UTC 2022

Modified Files:
src/sys/dev/ic: cy.c

Log Message:
cy(4): Convert to ttylock/ttyunlock.


To generate a diff of this commit:
cvs rdiff -u -r1.62 -r1.63 src/sys/dev/ic/cy.c

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



CVS commit: src/sys

2022-10-26 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Oct 26 23:41:49 UTC 2022

Modified Files:
src/sys/kern: tty.c
src/sys/sys: tty.h

Log Message:
tty(9): New ttylock, ttyunlock, ttylocked functions.

These are wrappers around the global tty_lock for now (and the
continued existence of the tty_lock variable is why the ttylock
function has no underscore in its name).  They will assist in
converting drivers to per-tty locking later on.


To generate a diff of this commit:
cvs rdiff -u -r1.306 -r1.307 src/sys/kern/tty.c
cvs rdiff -u -r1.102 -r1.103 src/sys/sys/tty.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/kern/tty.c
diff -u src/sys/kern/tty.c:1.306 src/sys/kern/tty.c:1.307
--- src/sys/kern/tty.c:1.306	Tue Oct 25 23:21:13 2022
+++ src/sys/kern/tty.c	Wed Oct 26 23:41:49 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: tty.c,v 1.306 2022/10/25 23:21:13 riastradh Exp $	*/
+/*	$NetBSD: tty.c,v 1.307 2022/10/26 23:41:49 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2020 The NetBSD Foundation, Inc.
@@ -63,7 +63,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: tty.c,v 1.306 2022/10/25 23:21:13 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tty.c,v 1.307 2022/10/26 23:41:49 riastradh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -353,6 +353,34 @@ sysctl_kern_tty_setup(void)
 		   CTL_CREATE, CTL_EOL);
 }
 
+/*
+ * ttylock(tp), ttyunlock(tp), ttylocked(tp)
+ *
+ *	Exclusive lock on tty.  Currently a single global lock.
+ *
+ *	ttylocked is for positive DIAGNOSTIC assertions only.
+ */
+void
+ttylock(struct tty *tp)
+{
+
+	mutex_spin_enter(_lock);
+}
+
+void
+ttyunlock(struct tty *tp)
+{
+
+	mutex_spin_exit(_lock);
+}
+
+bool
+ttylocked(struct tty *tp)
+{
+
+	return mutex_owned(_lock);
+}
+
 int
 ttyopen(struct tty *tp, int dialout, int nonblock)
 {

Index: src/sys/sys/tty.h
diff -u src/sys/sys/tty.h:1.102 src/sys/sys/tty.h:1.103
--- src/sys/sys/tty.h:1.102	Tue Oct 25 23:21:13 2022
+++ src/sys/sys/tty.h	Wed Oct 26 23:41:49 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: tty.h,v 1.102 2022/10/25 23:21:13 riastradh Exp $	*/
+/*	$NetBSD: tty.h,v 1.103 2022/10/26 23:41:49 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -319,6 +319,10 @@ int	 tty_unit(dev_t);
 void	 tty_acquire(struct tty *);
 void	 tty_release(struct tty *);
 
+void	 ttylock(struct tty *);
+void	 ttyunlock(struct tty *);
+bool	 ttylocked(struct tty *);
+
 int	clalloc(struct clist *, int, int);
 void	clfree(struct clist *);
 



CVS commit: src/sys

2022-10-26 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Oct 26 23:41:49 UTC 2022

Modified Files:
src/sys/kern: tty.c
src/sys/sys: tty.h

Log Message:
tty(9): New ttylock, ttyunlock, ttylocked functions.

These are wrappers around the global tty_lock for now (and the
continued existence of the tty_lock variable is why the ttylock
function has no underscore in its name).  They will assist in
converting drivers to per-tty locking later on.


To generate a diff of this commit:
cvs rdiff -u -r1.306 -r1.307 src/sys/kern/tty.c
cvs rdiff -u -r1.102 -r1.103 src/sys/sys/tty.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

2022-10-26 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Oct 26 23:40:31 UTC 2022

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

Log Message:
sys/vnode.h: New home for extern vfs_op_descs.

(Maybe this should be in a more kern-private header file -- it's used
only by vnode_if.c and vfs_init.c -- but this'll do for now.)


To generate a diff of this commit:
cvs rdiff -u -r1.303 -r1.304 src/sys/sys/vnode.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/vnode.h
diff -u src/sys/sys/vnode.h:1.303 src/sys/sys/vnode.h:1.304
--- src/sys/sys/vnode.h:1.303	Fri Aug  5 05:20:39 2022
+++ src/sys/sys/vnode.h	Wed Oct 26 23:40:30 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: vnode.h,v 1.303 2022/08/05 05:20:39 thorpej Exp $	*/
+/*	$NetBSD: vnode.h,v 1.304 2022/10/26 23:40:30 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2020 The NetBSD Foundation, Inc.
@@ -508,6 +508,8 @@ struct vnodeop_desc {
 
 #ifdef _KERNEL
 
+extern const struct vnodeop_desc * const vfs_op_descs[];
+
 /*
  * Union filesystem hook for vn_readdir().
  */



CVS commit: src/sys/sys

2022-10-26 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Oct 26 23:40:31 UTC 2022

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

Log Message:
sys/vnode.h: New home for extern vfs_op_descs.

(Maybe this should be in a more kern-private header file -- it's used
only by vnode_if.c and vfs_init.c -- but this'll do for now.)


To generate a diff of this commit:
cvs rdiff -u -r1.303 -r1.304 src/sys/sys/vnode.h

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



CVS commit: src/sys

2022-10-26 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Oct 26 23:40:20 UTC 2022

Modified Files:
src/sys/kern: vfs_init.c
src/sys/miscfs/fifofs: fifo.h

Log Message:
miscfs/fifofs/fifo.h: New home for extern fifo_vnodeop_opv_desc.

Add include guard and fix missing includes while here too.


To generate a diff of this commit:
cvs rdiff -u -r1.57 -r1.58 src/sys/kern/vfs_init.c
cvs rdiff -u -r1.27 -r1.28 src/sys/miscfs/fifofs/fifo.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/kern/vfs_init.c
diff -u src/sys/kern/vfs_init.c:1.57 src/sys/kern/vfs_init.c:1.58
--- src/sys/kern/vfs_init.c:1.57	Wed Oct 26 23:40:08 2022
+++ src/sys/kern/vfs_init.c	Wed Oct 26 23:40:20 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_init.c,v 1.57 2022/10/26 23:40:08 riastradh Exp $	*/
+/*	$NetBSD: vfs_init.c,v 1.58 2022/10/26 23:40:20 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2000, 2008 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vfs_init.c,v 1.57 2022/10/26 23:40:08 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_init.c,v 1.58 2022/10/26 23:40:20 riastradh Exp $");
 
 #include 
 #include 
@@ -86,6 +86,7 @@ __KERNEL_RCSID(0, "$NetBSD: vfs_init.c,v
 #include 
 
 #include 
+#include 
 #include 
 
 /*
@@ -109,8 +110,6 @@ extern const struct vnodeop_desc * const
  * associated with any particular file system, and thus cannot
  * be initialized by vfs_attach().
  */
-extern const struct vnodeopv_desc fifo_vnodeop_opv_desc;
-
 const struct vnodeopv_desc * const vfs_special_vnodeopv_descs[] = {
 	_vnodeop_opv_desc,
 	_vnodeop_opv_desc,

Index: src/sys/miscfs/fifofs/fifo.h
diff -u src/sys/miscfs/fifofs/fifo.h:1.27 src/sys/miscfs/fifofs/fifo.h:1.28
--- src/sys/miscfs/fifofs/fifo.h:1.27	Sun Jul 18 23:56:13 2021
+++ src/sys/miscfs/fifofs/fifo.h	Wed Oct 26 23:40:20 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: fifo.h,v 1.27 2021/07/18 23:56:13 dholland Exp $	*/
+/*	$NetBSD: fifo.h,v 1.28 2022/10/26 23:40:20 riastradh Exp $	*/
 
 /*
  * Copyright (c) 1991, 1993
@@ -31,6 +31,15 @@
  *	@(#)fifo.h	8.6 (Berkeley) 5/21/95
  */
 
+#ifndef _MISCFS_FIFOFS_FIFO_H_
+#define _MISCFS_FIFOFS_FIFO_H_
+
+#include 
+
+#include 
+
+extern const struct vnodeopv_desc fifo_vnodeop_opv_desc;
+
 extern int (**fifo_vnodeop_p)(void *);
 
 /*
@@ -78,7 +87,7 @@ extern int (**fifo_vnodeop_p)(void *);
  * fifo_foo (currently via vn_fifo_bypass). For fsync it varies.
  *
  * Note that because the op descriptor tables are unordered it does not
- * matter where in the table this macro goes (except I think default 
+ * matter where in the table this macro goes (except I think default
  * still needs to be first...)
  *
  * XXX currently all the ops are vn_fifo_bypass, which does an
@@ -117,3 +126,5 @@ extern int (**fifo_vnodeop_p)(void *);
 	{ _advlock_desc, vn_fifo_bypass },		/* advlock */	\
 	{ _getpages_desc, genfs_badop },	 	/* getpages */	\
 	{ _putpages_desc, vn_fifo_bypass }	 	/* putpages */
+
+#endif	/* _MISCFS_FIFOFS_FIFO_H_ */



CVS commit: src/sys

2022-10-26 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Oct 26 23:40:20 UTC 2022

Modified Files:
src/sys/kern: vfs_init.c
src/sys/miscfs/fifofs: fifo.h

Log Message:
miscfs/fifofs/fifo.h: New home for extern fifo_vnodeop_opv_desc.

Add include guard and fix missing includes while here too.


To generate a diff of this commit:
cvs rdiff -u -r1.57 -r1.58 src/sys/kern/vfs_init.c
cvs rdiff -u -r1.27 -r1.28 src/sys/miscfs/fifofs/fifo.h

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



CVS commit: src/sys

2022-10-26 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Oct 26 23:40:08 UTC 2022

Modified Files:
src/sys/kern: vfs_init.c vfs_vnode.c
src/sys/miscfs/specfs: specdev.h

Log Message:
miscfs/specfs/specdev.h: New home for extern spec_vnodeop_opv_desc.

Also use it for extern spec_vnodeop_p, which is already there.


To generate a diff of this commit:
cvs rdiff -u -r1.56 -r1.57 src/sys/kern/vfs_init.c
cvs rdiff -u -r1.146 -r1.147 src/sys/kern/vfs_vnode.c
cvs rdiff -u -r1.52 -r1.53 src/sys/miscfs/specfs/specdev.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/kern/vfs_init.c
diff -u src/sys/kern/vfs_init.c:1.56 src/sys/kern/vfs_init.c:1.57
--- src/sys/kern/vfs_init.c:1.56	Wed Oct 26 23:39:43 2022
+++ src/sys/kern/vfs_init.c	Wed Oct 26 23:40:08 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_init.c,v 1.56 2022/10/26 23:39:43 riastradh Exp $	*/
+/*	$NetBSD: vfs_init.c,v 1.57 2022/10/26 23:40:08 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2000, 2008 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vfs_init.c,v 1.56 2022/10/26 23:39:43 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_init.c,v 1.57 2022/10/26 23:40:08 riastradh Exp $");
 
 #include 
 #include 
@@ -86,6 +86,7 @@ __KERNEL_RCSID(0, "$NetBSD: vfs_init.c,v
 #include 
 
 #include 
+#include 
 
 /*
  * Sigh, such primitive tools are these...
@@ -109,7 +110,6 @@ extern const struct vnodeop_desc * const
  * be initialized by vfs_attach().
  */
 extern const struct vnodeopv_desc fifo_vnodeop_opv_desc;
-extern const struct vnodeopv_desc spec_vnodeop_opv_desc;
 
 const struct vnodeopv_desc * const vfs_special_vnodeopv_descs[] = {
 	_vnodeop_opv_desc,

Index: src/sys/kern/vfs_vnode.c
diff -u src/sys/kern/vfs_vnode.c:1.146 src/sys/kern/vfs_vnode.c:1.147
--- src/sys/kern/vfs_vnode.c:1.146	Wed Oct 26 23:39:43 2022
+++ src/sys/kern/vfs_vnode.c	Wed Oct 26 23:40:08 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_vnode.c,v 1.146 2022/10/26 23:39:43 riastradh Exp $	*/
+/*	$NetBSD: vfs_vnode.c,v 1.147 2022/10/26 23:40:08 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 1997-2011, 2019, 2020 The NetBSD Foundation, Inc.
@@ -148,7 +148,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vfs_vnode.c,v 1.146 2022/10/26 23:39:43 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_vnode.c,v 1.147 2022/10/26 23:40:08 riastradh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_pax.h"
@@ -177,6 +177,7 @@ __KERNEL_RCSID(0, "$NetBSD: vfs_vnode.c,
 #include 
 
 #include 
+#include 
 
 #include 
 #include 
@@ -226,7 +227,6 @@ static void		vnpanic(vnode_t *, const ch
 __printflike(2, 3);
 
 /* Routines having to do with the management of the vnode table. */
-extern int		(**spec_vnodeop_p)(void *);
 
 /*
  * The high bit of v_usecount is a gate for vcache_tryvget().  It's set

Index: src/sys/miscfs/specfs/specdev.h
diff -u src/sys/miscfs/specfs/specdev.h:1.52 src/sys/miscfs/specfs/specdev.h:1.53
--- src/sys/miscfs/specfs/specdev.h:1.52	Mon Mar 28 12:38:04 2022
+++ src/sys/miscfs/specfs/specdev.h	Wed Oct 26 23:40:08 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: specdev.h,v 1.52 2022/03/28 12:38:04 riastradh Exp $	*/
+/*	$NetBSD: specdev.h,v 1.53 2022/10/26 23:40:08 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -104,6 +104,7 @@ void	spec_node_revoke(vnode_t *);
 /*
  * Prototypes for special file operations on vnodes.
  */
+extern const struct vnodeopv_desc spec_vnodeop_opv_desc;
 extern	int (**spec_vnodeop_p)(void *);
 struct	nameidata;
 struct	componentname;
@@ -175,7 +176,7 @@ int	spec_advlock(void *);
  * spec_foo. For fsync it varies, but should always also call spec_fsync.
  *
  * Note that because the op descriptor tables are unordered it does not
- * matter where in the table this macro goes (except I think default 
+ * matter where in the table this macro goes (except I think default
  * still needs to be first...)
  */
 #define GENFS_SPECOP_ENTRIES \



CVS commit: src/sys

2022-10-26 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Oct 26 23:40:08 UTC 2022

Modified Files:
src/sys/kern: vfs_init.c vfs_vnode.c
src/sys/miscfs/specfs: specdev.h

Log Message:
miscfs/specfs/specdev.h: New home for extern spec_vnodeop_opv_desc.

Also use it for extern spec_vnodeop_p, which is already there.


To generate a diff of this commit:
cvs rdiff -u -r1.56 -r1.57 src/sys/kern/vfs_init.c
cvs rdiff -u -r1.146 -r1.147 src/sys/kern/vfs_vnode.c
cvs rdiff -u -r1.52 -r1.53 src/sys/miscfs/specfs/specdev.h

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



CVS commit: src/sys

2022-10-26 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Oct 26 23:39:43 UTC 2022

Modified Files:
src/sys/kern: vfs_init.c vfs_subr.c vfs_trans.c vfs_vnode.c vnode_if.sh
src/sys/miscfs/deadfs: dead_vfsops.c dead_vnops.c
Added Files:
src/sys/miscfs/deadfs: deadfs.h

Log Message:
miscfs/deadfs/deadfs.h: New home for deadfs-related externs.

XXX regen sys/kern/vnode_if.c and the others


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 src/sys/kern/vfs_init.c
cvs rdiff -u -r1.495 -r1.496 src/sys/kern/vfs_subr.c
cvs rdiff -u -r1.68 -r1.69 src/sys/kern/vfs_trans.c
cvs rdiff -u -r1.145 -r1.146 src/sys/kern/vfs_vnode.c
cvs rdiff -u -r1.76 -r1.77 src/sys/kern/vnode_if.sh
cvs rdiff -u -r1.12 -r1.13 src/sys/miscfs/deadfs/dead_vfsops.c
cvs rdiff -u -r1.66 -r1.67 src/sys/miscfs/deadfs/dead_vnops.c
cvs rdiff -u -r0 -r1.1 src/sys/miscfs/deadfs/deadfs.h

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



CVS commit: src/sys

2022-10-26 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Oct 26 23:39:43 UTC 2022

Modified Files:
src/sys/kern: vfs_init.c vfs_subr.c vfs_trans.c vfs_vnode.c vnode_if.sh
src/sys/miscfs/deadfs: dead_vfsops.c dead_vnops.c
Added Files:
src/sys/miscfs/deadfs: deadfs.h

Log Message:
miscfs/deadfs/deadfs.h: New home for deadfs-related externs.

XXX regen sys/kern/vnode_if.c and the others


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 src/sys/kern/vfs_init.c
cvs rdiff -u -r1.495 -r1.496 src/sys/kern/vfs_subr.c
cvs rdiff -u -r1.68 -r1.69 src/sys/kern/vfs_trans.c
cvs rdiff -u -r1.145 -r1.146 src/sys/kern/vfs_vnode.c
cvs rdiff -u -r1.76 -r1.77 src/sys/kern/vnode_if.sh
cvs rdiff -u -r1.12 -r1.13 src/sys/miscfs/deadfs/dead_vfsops.c
cvs rdiff -u -r1.66 -r1.67 src/sys/miscfs/deadfs/dead_vnops.c
cvs rdiff -u -r0 -r1.1 src/sys/miscfs/deadfs/deadfs.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/kern/vfs_init.c
diff -u src/sys/kern/vfs_init.c:1.55 src/sys/kern/vfs_init.c:1.56
--- src/sys/kern/vfs_init.c:1.55	Wed Oct 26 23:39:21 2022
+++ src/sys/kern/vfs_init.c	Wed Oct 26 23:39:43 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_init.c,v 1.55 2022/10/26 23:39:21 riastradh Exp $	*/
+/*	$NetBSD: vfs_init.c,v 1.56 2022/10/26 23:39:43 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2000, 2008 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vfs_init.c,v 1.55 2022/10/26 23:39:21 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_init.c,v 1.56 2022/10/26 23:39:43 riastradh Exp $");
 
 #include 
 #include 
@@ -85,6 +85,8 @@ __KERNEL_RCSID(0, "$NetBSD: vfs_init.c,v
 #include 
 #include 
 
+#include 
+
 /*
  * Sigh, such primitive tools are these...
  */
@@ -106,7 +108,6 @@ extern const struct vnodeop_desc * const
  * associated with any particular file system, and thus cannot
  * be initialized by vfs_attach().
  */
-extern const struct vnodeopv_desc dead_vnodeop_opv_desc;
 extern const struct vnodeopv_desc fifo_vnodeop_opv_desc;
 extern const struct vnodeopv_desc spec_vnodeop_opv_desc;
 

Index: src/sys/kern/vfs_subr.c
diff -u src/sys/kern/vfs_subr.c:1.495 src/sys/kern/vfs_subr.c:1.496
--- src/sys/kern/vfs_subr.c:1.495	Tue Sep 13 09:13:19 2022
+++ src/sys/kern/vfs_subr.c	Wed Oct 26 23:39:43 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_subr.c,v 1.495 2022/09/13 09:13:19 riastradh Exp $	*/
+/*	$NetBSD: vfs_subr.c,v 1.496 2022/10/26 23:39:43 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 1997, 1998, 2004, 2005, 2007, 2008, 2019, 2020
@@ -69,7 +69,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vfs_subr.c,v 1.495 2022/09/13 09:13:19 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_subr.c,v 1.496 2022/10/26 23:39:43 riastradh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ddb.h"
@@ -96,8 +96,10 @@ __KERNEL_RCSID(0, "$NetBSD: vfs_subr.c,v
 #include 
 #include 
 
+#include 
 #include 
 #include 
+
 #include 
 
 const enum vtype iftovt_tab[16] = {
@@ -120,8 +122,6 @@ const int	vttoif_tab[9] = {
 
 int doforce = 1;		/* 1 => permit forcible unmounting */
 
-extern struct mount *dead_rootmount;
-
 /*
  * Local declarations.
  */

Index: src/sys/kern/vfs_trans.c
diff -u src/sys/kern/vfs_trans.c:1.68 src/sys/kern/vfs_trans.c:1.69
--- src/sys/kern/vfs_trans.c:1.68	Mon Aug 22 09:13:08 2022
+++ src/sys/kern/vfs_trans.c	Wed Oct 26 23:39:43 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_trans.c,v 1.68 2022/08/22 09:13:08 hannken Exp $	*/
+/*	$NetBSD: vfs_trans.c,v 1.69 2022/10/26 23:39:43 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2007, 2020 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vfs_trans.c,v 1.68 2022/08/22 09:13:08 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_trans.c,v 1.69 2022/10/26 23:39:43 riastradh Exp $");
 
 /*
  * File system transaction operations.
@@ -53,6 +53,7 @@ __KERNEL_RCSID(0, "$NetBSD: vfs_trans.c,
 #include 
 #include 
 
+#include 
 #include 
 
 #define FSTRANS_MOUNT_HASHSIZE	32
@@ -124,8 +125,6 @@ static bool cow_state_change_done(const 
 static void cow_change_enter(struct fstrans_mount_info *);
 static void cow_change_done(struct fstrans_mount_info *);
 
-extern struct mount *dead_rootmount;
-
 /*
  * Initialize.
  */

Index: src/sys/kern/vfs_vnode.c
diff -u src/sys/kern/vfs_vnode.c:1.145 src/sys/kern/vfs_vnode.c:1.146
--- src/sys/kern/vfs_vnode.c:1.145	Fri Aug  5 05:20:39 2022
+++ src/sys/kern/vfs_vnode.c	Wed Oct 26 23:39:43 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_vnode.c,v 1.145 2022/08/05 05:20:39 thorpej Exp $	*/
+/*	$NetBSD: vfs_vnode.c,v 1.146 2022/10/26 23:39:43 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 1997-2011, 2019, 2020 The NetBSD Foundation, Inc.
@@ -141,14 +141,14 @@
  *	Vnode is considered active, if reference count (vnode_t::v_usecount)
  *	is non-zero.  It is maintained using: vref(9) and vrele(9), as well
  *	as vput(9), routines.  Common points holding references are e.g.
- *	

CVS commit: src/sys

2022-10-26 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Oct 26 23:39:22 UTC 2022

Modified Files:
src/sys/kern: vfs_init.c
src/sys/sys: mount.h

Log Message:
sys/mount.h: New home for vfs_timestamp_precision, vfs_magiclinks.


To generate a diff of this commit:
cvs rdiff -u -r1.54 -r1.55 src/sys/kern/vfs_init.c
cvs rdiff -u -r1.238 -r1.239 src/sys/sys/mount.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/kern/vfs_init.c
diff -u src/sys/kern/vfs_init.c:1.54 src/sys/kern/vfs_init.c:1.55
--- src/sys/kern/vfs_init.c:1.54	Sat Feb 12 15:51:29 2022
+++ src/sys/kern/vfs_init.c	Wed Oct 26 23:39:21 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_init.c,v 1.54 2022/02/12 15:51:29 thorpej Exp $	*/
+/*	$NetBSD: vfs_init.c,v 1.55 2022/10/26 23:39:21 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2000, 2008 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vfs_init.c,v 1.54 2022/02/12 15:51:29 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_init.c,v 1.55 2022/10/26 23:39:21 riastradh Exp $");
 
 #include 
 #include 
@@ -150,8 +150,6 @@ static struct sysctllog *vfs_sysctllog;
 static void
 sysctl_vfs_setup(void)
 {
-	extern int vfs_magiclinks;
-	extern int vfs_timestamp_precision;
 
 	sysctl_createv(_sysctllog, 0, NULL, NULL,
 		   CTLFLAG_PERMANENT,

Index: src/sys/sys/mount.h
diff -u src/sys/sys/mount.h:1.238 src/sys/sys/mount.h:1.239
--- src/sys/sys/mount.h:1.238	Sat Feb 12 15:51:29 2022
+++ src/sys/sys/mount.h	Wed Oct 26 23:39:22 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: mount.h,v 1.238 2022/02/12 15:51:29 thorpej Exp $	*/
+/*	$NetBSD: mount.h,v 1.239 2022/10/26 23:39:22 riastradh Exp $	*/
 
 /*
  * Copyright (c) 1989, 1991, 1993
@@ -438,6 +438,9 @@ extern time_t	metadelay;
 void	vfs_syncer_add_to_worklist(struct mount *);
 void	vfs_syncer_remove_from_worklist(struct mount *);
 
+extern int vfs_magiclinks;
+extern int vfs_timestamp_precision;
+
 extern	struct vfsops *vfssw[];			/* filesystem type table */
 extern	int nvfssw;
 extern	kmutex_t vfs_list_lock;



CVS commit: src/sys

2022-10-26 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Oct 26 23:39:22 UTC 2022

Modified Files:
src/sys/kern: vfs_init.c
src/sys/sys: mount.h

Log Message:
sys/mount.h: New home for vfs_timestamp_precision, vfs_magiclinks.


To generate a diff of this commit:
cvs rdiff -u -r1.54 -r1.55 src/sys/kern/vfs_init.c
cvs rdiff -u -r1.238 -r1.239 src/sys/sys/mount.h

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



CVS commit: src/sys

2022-10-26 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Oct 26 23:39:11 UTC 2022

Modified Files:
src/sys/dev: firmload.c
src/sys/kern: vfs_mount.c
src/sys/rump/librump/rumpvfs: rump_vfs.c
src/sys/sys: filedesc.h

Log Message:
sys/filedesc.h: New home for extern cwdi0.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/dev/firmload.c
cvs rdiff -u -r1.97 -r1.98 src/sys/kern/vfs_mount.c
cvs rdiff -u -r1.93 -r1.94 src/sys/rump/librump/rumpvfs/rump_vfs.c
cvs rdiff -u -r1.69 -r1.70 src/sys/sys/filedesc.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/dev/firmload.c
diff -u src/sys/dev/firmload.c:1.23 src/sys/dev/firmload.c:1.24
--- src/sys/dev/firmload.c:1.23	Tue Jun 29 22:40:53 2021
+++ src/sys/dev/firmload.c	Wed Oct 26 23:39:10 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: firmload.c,v 1.23 2021/06/29 22:40:53 dholland Exp $	*/
+/*	$NetBSD: firmload.c,v 1.24 2022/10/26 23:39:10 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2005, 2006 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: firmload.c,v 1.23 2021/06/29 22:40:53 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: firmload.c,v 1.24 2022/10/26 23:39:10 riastradh Exp $");
 
 /*
  * The firmload API provides an interface for device drivers to access
@@ -209,7 +209,6 @@ firmware_open(const char *drvname, const
 	firmware_handle_t fh;
 	struct vnode *vp;
 	int error;
-	extern struct cwdinfo cwdi0;
 
 	if (drvname == NULL || imgname == NULL)
 		return (EINVAL);

Index: src/sys/kern/vfs_mount.c
diff -u src/sys/kern/vfs_mount.c:1.97 src/sys/kern/vfs_mount.c:1.98
--- src/sys/kern/vfs_mount.c:1.97	Tue Sep 13 09:35:31 2022
+++ src/sys/kern/vfs_mount.c	Wed Oct 26 23:39:10 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_mount.c,v 1.97 2022/09/13 09:35:31 riastradh Exp $	*/
+/*	$NetBSD: vfs_mount.c,v 1.98 2022/10/26 23:39:10 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 1997-2020 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vfs_mount.c,v 1.97 2022/09/13 09:35:31 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_mount.c,v 1.98 2022/10/26 23:39:10 riastradh Exp $");
 
 #include 
 #include 
@@ -1273,7 +1273,6 @@ done:
 	if (error == 0) {
 		mount_iterator_t *iter;
 		struct mount *mp;
-		extern struct cwdinfo cwdi0;
 
 		mountlist_iterator_init();
 		mp = mountlist_iterator_next(iter);

Index: src/sys/rump/librump/rumpvfs/rump_vfs.c
diff -u src/sys/rump/librump/rumpvfs/rump_vfs.c:1.93 src/sys/rump/librump/rumpvfs/rump_vfs.c:1.94
--- src/sys/rump/librump/rumpvfs/rump_vfs.c:1.93	Sat Apr 25 15:42:15 2020
+++ src/sys/rump/librump/rumpvfs/rump_vfs.c	Wed Oct 26 23:39:10 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: rump_vfs.c,v 1.93 2020/04/25 15:42:15 bouyer Exp $	*/
+/*	$NetBSD: rump_vfs.c,v 1.94 2022/10/26 23:39:10 riastradh Exp $	*/
 
 /*
  * Copyright (c) 2008 Antti Kantee.  All Rights Reserved.
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rump_vfs.c,v 1.93 2020/04/25 15:42:15 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rump_vfs.c,v 1.94 2022/10/26 23:39:10 riastradh Exp $");
 
 #include 
 #include 
@@ -57,7 +57,6 @@ __KERNEL_RCSID(0, "$NetBSD: rump_vfs.c,v
 #include 
 #include 
 
-extern struct cwdinfo cwdi0;
 const char *rootfstype = ROOT_FSTYPE_ANY;
 
 static void

Index: src/sys/sys/filedesc.h
diff -u src/sys/sys/filedesc.h:1.69 src/sys/sys/filedesc.h:1.70
--- src/sys/sys/filedesc.h:1.69	Tue Jun 29 22:40:53 2021
+++ src/sys/sys/filedesc.h	Wed Oct 26 23:39:10 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: filedesc.h,v 1.69 2021/06/29 22:40:53 dholland Exp $	*/
+/*	$NetBSD: filedesc.h,v 1.70 2022/10/26 23:39:10 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -187,6 +187,8 @@ struct fileops;
 struct socket;
 struct proc;
 
+extern struct cwdinfo cwdi0;
+
 /*
  * Kernel global variables and routines.
  */



CVS commit: src/sys

2022-10-26 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Oct 26 23:39:11 UTC 2022

Modified Files:
src/sys/dev: firmload.c
src/sys/kern: vfs_mount.c
src/sys/rump/librump/rumpvfs: rump_vfs.c
src/sys/sys: filedesc.h

Log Message:
sys/filedesc.h: New home for extern cwdi0.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/dev/firmload.c
cvs rdiff -u -r1.97 -r1.98 src/sys/kern/vfs_mount.c
cvs rdiff -u -r1.93 -r1.94 src/sys/rump/librump/rumpvfs/rump_vfs.c
cvs rdiff -u -r1.69 -r1.70 src/sys/sys/filedesc.h

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



CVS commit: src/sys

2022-10-26 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Oct 26 23:38:58 UTC 2022

Modified Files:
src/sys/kern: subr_pcu.c
src/sys/sys: pcu.h

Log Message:
sys/pcu.h: New home for extern pcu_ops_md_defs.

XXX Should split sys/pcu.h up into the part that sys/lwp.h needs,
which triggers rebuild of entire kernel, and the parts needed only by
subr_pcu.c and by MD FP/SIMD state management logic.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/sys/kern/subr_pcu.c
cvs rdiff -u -r1.13 -r1.14 src/sys/sys/pcu.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/kern/subr_pcu.c
diff -u src/sys/kern/subr_pcu.c:1.26 src/sys/kern/subr_pcu.c:1.27
--- src/sys/kern/subr_pcu.c:1.26	Tue Feb  8 12:59:16 2022
+++ src/sys/kern/subr_pcu.c	Wed Oct 26 23:38:57 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: subr_pcu.c,v 1.26 2022/02/08 12:59:16 riastradh Exp $	*/
+/*	$NetBSD: subr_pcu.c,v 1.27 2022/10/26 23:38:57 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2011, 2014 The NetBSD Foundation, Inc.
@@ -52,7 +52,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: subr_pcu.c,v 1.26 2022/02/08 12:59:16 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_pcu.c,v 1.27 2022/10/26 23:38:57 riastradh Exp $");
 
 #include 
 #include 
@@ -85,9 +85,6 @@ typedef struct {
  */
 #define	splpcu		splhigh
 
-/* PCU operations structure provided by the MD code. */
-extern const pcu_ops_t * const pcu_ops_md_defs[];
-
 /*
  * pcu_available_p: true if lwp is allowed to use PCU state.
  */

Index: src/sys/sys/pcu.h
diff -u src/sys/sys/pcu.h:1.13 src/sys/sys/pcu.h:1.14
--- src/sys/sys/pcu.h:1.13	Thu Mar 16 16:13:21 2017
+++ src/sys/sys/pcu.h	Wed Oct 26 23:38:58 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: pcu.h,v 1.13 2017/03/16 16:13:21 chs Exp $	*/
+/*	$NetBSD: pcu.h,v 1.14 2022/10/26 23:38:58 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -86,6 +86,9 @@ void	pcu_save_all_on_cpu(void);
 void	pcu_discard(const pcu_ops_t *, lwp_t *, bool);
 bool	pcu_valid_p(const pcu_ops_t *, const lwp_t *);
 
+/* PCU operations structure provided by the MD code. */
+extern const pcu_ops_t *const pcu_ops_md_defs[];
+
 #else
 #define	pcu_switchpoint(l)
 #define	pcu_discard_all(l)



CVS commit: src/sys

2022-10-26 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Oct 26 23:38:58 UTC 2022

Modified Files:
src/sys/kern: subr_pcu.c
src/sys/sys: pcu.h

Log Message:
sys/pcu.h: New home for extern pcu_ops_md_defs.

XXX Should split sys/pcu.h up into the part that sys/lwp.h needs,
which triggers rebuild of entire kernel, and the parts needed only by
subr_pcu.c and by MD FP/SIMD state management logic.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/sys/kern/subr_pcu.c
cvs rdiff -u -r1.13 -r1.14 src/sys/sys/pcu.h

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



CVS commit: src/sys

2022-10-26 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Oct 26 23:38:10 UTC 2022

Modified Files:
src/sys/arch/aarch64/aarch64: db_machdep.c
src/sys/arch/alpha/alpha: db_interface.c
src/sys/arch/amd64/amd64: db_interface.c machdep.c
src/sys/arch/amiga/dev: ser.c
src/sys/arch/arm/amlogic: meson_uart.c
src/sys/arch/arm/arm32: db_interface.c
src/sys/arch/arm/at91: at91dbgu.c at91usart.c
src/sys/arch/arm/clps711x: clpscom.c
src/sys/arch/arm/ep93xx: epcom.c
src/sys/arch/arm/imx: imxuart.c
src/sys/arch/arm/s3c2xx0: sscom.c
src/sys/arch/arm/sa11x0: sa11x0_com.c
src/sys/arch/arm/samsung: exynos_uart.c
src/sys/arch/arm/xilinx: zynq_uart.c
src/sys/arch/arm/zynq: zynq_uart.c
src/sys/arch/epoc32/windermere: wmcom.c
src/sys/arch/evbarm/dev: plcom.c
src/sys/arch/hppa/hppa: db_interface.c
src/sys/arch/i386/i386: db_interface.c machdep.c
src/sys/arch/ia64/ia64: db_interface.c
src/sys/arch/m68k/m68k: db_interface.c
src/sys/arch/mips/mips: db_interface.c
src/sys/arch/powerpc/powerpc: db_interface.c
src/sys/arch/riscv/riscv: db_interface.c
src/sys/arch/sh3/sh3: db_interface.c
src/sys/arch/sparc/sparc: db_interface.c
src/sys/arch/sparc64/dev: zs.c
src/sys/arch/sparc64/sparc64: db_interface.c machdep.c
src/sys/arch/sun2/dev: zs.c
src/sys/arch/vax/vax: db_machdep.c
src/sys/arch/x86/x86: intr.c
src/sys/dev/ic: com.c
src/sys/external/bsd/drm2/include/linux: kgdb.h
src/sys/kern: subr_msan.c uipc_socket2.c
src/sys/uvm: uvm_page.c
Added Files:
src/sys/ddb: db_active.h

Log Message:
ddb/db_active.h: New home for extern db_active.

This can be included unconditionally, and db_active can then be
queried unconditionally; if DDB is not in the kernel, then db_active
is a constant zero.  Reduces need for #include opt_ddb.h, #ifdef DDB.


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.45 src/sys/arch/aarch64/aarch64/db_machdep.c
cvs rdiff -u -r1.36 -r1.37 src/sys/arch/alpha/alpha/db_interface.c
cvs rdiff -u -r1.40 -r1.41 src/sys/arch/amd64/amd64/db_interface.c
cvs rdiff -u -r1.365 -r1.366 src/sys/arch/amd64/amd64/machdep.c
cvs rdiff -u -r1.85 -r1.86 src/sys/arch/amiga/dev/ser.c
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/arm/amlogic/meson_uart.c
cvs rdiff -u -r1.63 -r1.64 src/sys/arch/arm/arm32/db_interface.c
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/arm/at91/at91dbgu.c
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/arm/at91/at91usart.c
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/arm/clps711x/clpscom.c
cvs rdiff -u -r1.35 -r1.36 src/sys/arch/arm/ep93xx/epcom.c
cvs rdiff -u -r1.29 -r1.30 src/sys/arch/arm/imx/imxuart.c
cvs rdiff -u -r1.49 -r1.50 src/sys/arch/arm/s3c2xx0/sscom.c
cvs rdiff -u -r1.58 -r1.59 src/sys/arch/arm/sa11x0/sa11x0_com.c
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/arm/samsung/exynos_uart.c
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/xilinx/zynq_uart.c
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/arm/zynq/zynq_uart.c
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/epoc32/windermere/wmcom.c
cvs rdiff -u -r1.65 -r1.66 src/sys/arch/evbarm/dev/plcom.c
cvs rdiff -u -r1.27 -r1.28 src/sys/arch/hppa/hppa/db_interface.c
cvs rdiff -u -r1.87 -r1.88 src/sys/arch/i386/i386/db_interface.c
cvs rdiff -u -r1.838 -r1.839 src/sys/arch/i386/i386/machdep.c
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/ia64/ia64/db_interface.c
cvs rdiff -u -r1.35 -r1.36 src/sys/arch/m68k/m68k/db_interface.c
cvs rdiff -u -r1.96 -r1.97 src/sys/arch/mips/mips/db_interface.c
cvs rdiff -u -r1.59 -r1.60 src/sys/arch/powerpc/powerpc/db_interface.c
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/riscv/riscv/db_interface.c
cvs rdiff -u -r1.66 -r1.67 src/sys/arch/sh3/sh3/db_interface.c
cvs rdiff -u -r1.96 -r1.97 src/sys/arch/sparc/sparc/db_interface.c
cvs rdiff -u -r1.78 -r1.79 src/sys/arch/sparc64/dev/zs.c
cvs rdiff -u -r1.137 -r1.138 src/sys/arch/sparc64/sparc64/db_interface.c
cvs rdiff -u -r1.305 -r1.306 src/sys/arch/sparc64/sparc64/machdep.c
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/sun2/dev/zs.c
cvs rdiff -u -r1.59 -r1.60 src/sys/arch/vax/vax/db_machdep.c
cvs rdiff -u -r1.161 -r1.162 src/sys/arch/x86/x86/intr.c
cvs rdiff -u -r0 -r1.1 src/sys/ddb/db_active.h
cvs rdiff -u -r1.378 -r1.379 src/sys/dev/ic/com.c
cvs rdiff -u -r1.3 -r1.4 src/sys/external/bsd/drm2/include/linux/kgdb.h
cvs rdiff -u -r1.17 -r1.18 src/sys/kern/subr_msan.c
cvs rdiff -u -r1.141 -r1.142 src/sys/kern/uipc_socket2.c
cvs rdiff -u -r1.250 -r1.251 src/sys/uvm/uvm_page.c

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



CVS commit: src/sys

2022-10-26 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Oct 26 23:38:10 UTC 2022

Modified Files:
src/sys/arch/aarch64/aarch64: db_machdep.c
src/sys/arch/alpha/alpha: db_interface.c
src/sys/arch/amd64/amd64: db_interface.c machdep.c
src/sys/arch/amiga/dev: ser.c
src/sys/arch/arm/amlogic: meson_uart.c
src/sys/arch/arm/arm32: db_interface.c
src/sys/arch/arm/at91: at91dbgu.c at91usart.c
src/sys/arch/arm/clps711x: clpscom.c
src/sys/arch/arm/ep93xx: epcom.c
src/sys/arch/arm/imx: imxuart.c
src/sys/arch/arm/s3c2xx0: sscom.c
src/sys/arch/arm/sa11x0: sa11x0_com.c
src/sys/arch/arm/samsung: exynos_uart.c
src/sys/arch/arm/xilinx: zynq_uart.c
src/sys/arch/arm/zynq: zynq_uart.c
src/sys/arch/epoc32/windermere: wmcom.c
src/sys/arch/evbarm/dev: plcom.c
src/sys/arch/hppa/hppa: db_interface.c
src/sys/arch/i386/i386: db_interface.c machdep.c
src/sys/arch/ia64/ia64: db_interface.c
src/sys/arch/m68k/m68k: db_interface.c
src/sys/arch/mips/mips: db_interface.c
src/sys/arch/powerpc/powerpc: db_interface.c
src/sys/arch/riscv/riscv: db_interface.c
src/sys/arch/sh3/sh3: db_interface.c
src/sys/arch/sparc/sparc: db_interface.c
src/sys/arch/sparc64/dev: zs.c
src/sys/arch/sparc64/sparc64: db_interface.c machdep.c
src/sys/arch/sun2/dev: zs.c
src/sys/arch/vax/vax: db_machdep.c
src/sys/arch/x86/x86: intr.c
src/sys/dev/ic: com.c
src/sys/external/bsd/drm2/include/linux: kgdb.h
src/sys/kern: subr_msan.c uipc_socket2.c
src/sys/uvm: uvm_page.c
Added Files:
src/sys/ddb: db_active.h

Log Message:
ddb/db_active.h: New home for extern db_active.

This can be included unconditionally, and db_active can then be
queried unconditionally; if DDB is not in the kernel, then db_active
is a constant zero.  Reduces need for #include opt_ddb.h, #ifdef DDB.


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.45 src/sys/arch/aarch64/aarch64/db_machdep.c
cvs rdiff -u -r1.36 -r1.37 src/sys/arch/alpha/alpha/db_interface.c
cvs rdiff -u -r1.40 -r1.41 src/sys/arch/amd64/amd64/db_interface.c
cvs rdiff -u -r1.365 -r1.366 src/sys/arch/amd64/amd64/machdep.c
cvs rdiff -u -r1.85 -r1.86 src/sys/arch/amiga/dev/ser.c
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/arm/amlogic/meson_uart.c
cvs rdiff -u -r1.63 -r1.64 src/sys/arch/arm/arm32/db_interface.c
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/arm/at91/at91dbgu.c
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/arm/at91/at91usart.c
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/arm/clps711x/clpscom.c
cvs rdiff -u -r1.35 -r1.36 src/sys/arch/arm/ep93xx/epcom.c
cvs rdiff -u -r1.29 -r1.30 src/sys/arch/arm/imx/imxuart.c
cvs rdiff -u -r1.49 -r1.50 src/sys/arch/arm/s3c2xx0/sscom.c
cvs rdiff -u -r1.58 -r1.59 src/sys/arch/arm/sa11x0/sa11x0_com.c
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/arm/samsung/exynos_uart.c
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/xilinx/zynq_uart.c
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/arm/zynq/zynq_uart.c
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/epoc32/windermere/wmcom.c
cvs rdiff -u -r1.65 -r1.66 src/sys/arch/evbarm/dev/plcom.c
cvs rdiff -u -r1.27 -r1.28 src/sys/arch/hppa/hppa/db_interface.c
cvs rdiff -u -r1.87 -r1.88 src/sys/arch/i386/i386/db_interface.c
cvs rdiff -u -r1.838 -r1.839 src/sys/arch/i386/i386/machdep.c
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/ia64/ia64/db_interface.c
cvs rdiff -u -r1.35 -r1.36 src/sys/arch/m68k/m68k/db_interface.c
cvs rdiff -u -r1.96 -r1.97 src/sys/arch/mips/mips/db_interface.c
cvs rdiff -u -r1.59 -r1.60 src/sys/arch/powerpc/powerpc/db_interface.c
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/riscv/riscv/db_interface.c
cvs rdiff -u -r1.66 -r1.67 src/sys/arch/sh3/sh3/db_interface.c
cvs rdiff -u -r1.96 -r1.97 src/sys/arch/sparc/sparc/db_interface.c
cvs rdiff -u -r1.78 -r1.79 src/sys/arch/sparc64/dev/zs.c
cvs rdiff -u -r1.137 -r1.138 src/sys/arch/sparc64/sparc64/db_interface.c
cvs rdiff -u -r1.305 -r1.306 src/sys/arch/sparc64/sparc64/machdep.c
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/sun2/dev/zs.c
cvs rdiff -u -r1.59 -r1.60 src/sys/arch/vax/vax/db_machdep.c
cvs rdiff -u -r1.161 -r1.162 src/sys/arch/x86/x86/intr.c
cvs rdiff -u -r0 -r1.1 src/sys/ddb/db_active.h
cvs rdiff -u -r1.378 -r1.379 src/sys/dev/ic/com.c
cvs rdiff -u -r1.3 -r1.4 src/sys/external/bsd/drm2/include/linux/kgdb.h
cvs rdiff -u -r1.17 -r1.18 src/sys/kern/subr_msan.c
cvs rdiff -u -r1.141 -r1.142 src/sys/kern/uipc_socket2.c
cvs rdiff -u -r1.250 -r1.251 src/sys/uvm/uvm_page.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/aarch64/aarch64/db_machdep.c
diff -u src/sys/arch/aarch64/aarch64/db_machdep.c:1.44 src/sys/arch/aarch64/aarch64/db_machdep.c:1.45
--- src/sys/arch/aarch64/aarch64/db_machdep.c:1.44	Sun May 29 16:45:00 2022
+++ 

CVS commit: src/sys

2022-10-26 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Oct 26 23:28:43 UTC 2022

Modified Files:
src/sys/kern: subr_prf.c
src/sys/sys: msgbuf.h

Log Message:
sys/msgbuf.h: New home for extern log_open.


To generate a diff of this commit:
cvs rdiff -u -r1.194 -r1.195 src/sys/kern/subr_prf.c
cvs rdiff -u -r1.17 -r1.18 src/sys/sys/msgbuf.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/kern/subr_prf.c
diff -u src/sys/kern/subr_prf.c:1.194 src/sys/kern/subr_prf.c:1.195
--- src/sys/kern/subr_prf.c:1.194	Tue Oct 25 23:21:13 2022
+++ src/sys/kern/subr_prf.c	Wed Oct 26 23:28:42 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: subr_prf.c,v 1.194 2022/10/25 23:21:13 riastradh Exp $	*/
+/*	$NetBSD: subr_prf.c,v 1.195 2022/10/26 23:28:42 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 1986, 1988, 1991, 1993
@@ -37,7 +37,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: subr_prf.c,v 1.194 2022/10/25 23:21:13 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_prf.c,v 1.195 2022/10/26 23:28:42 riastradh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ddb.h"
@@ -103,7 +103,6 @@ static void	 kprintf_internal(const char
  * globals
  */
 
-extern	int log_open;	/* subr_log: is /dev/klog open? */
 const	char *panicstr; /* arg to first call to panic (used as a flag
 			   to indicate that panic has already been called). */
 struct cpu_info *paniccpu;	/* cpu that first panicked */

Index: src/sys/sys/msgbuf.h
diff -u src/sys/sys/msgbuf.h:1.17 src/sys/sys/msgbuf.h:1.18
--- src/sys/sys/msgbuf.h:1.17	Thu Apr 19 21:19:07 2018
+++ src/sys/sys/msgbuf.h	Wed Oct 26 23:28:43 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: msgbuf.h,v 1.17 2018/04/19 21:19:07 christos Exp $	*/
+/*	$NetBSD: msgbuf.h,v 1.18 2022/10/26 23:28:43 riastradh Exp $	*/
 
 /*
  * Copyright (c) 1981, 1984, 1993
@@ -47,6 +47,7 @@ struct	kern_msgbuf {
 extern int	msgbufmapped;		/* is the message buffer mapped */
 extern int	msgbufenabled;		/* is logging to the buffer enabled */
 extern struct	kern_msgbuf *msgbufp;	/* the mapped buffer, itself. */
+extern int	log_open;		/* is /dev/klog open? */
 
 void	initmsgbuf(void *, size_t);
 void	loginit(void);



CVS commit: src/sys

2022-10-26 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Oct 26 23:28:43 UTC 2022

Modified Files:
src/sys/kern: subr_prf.c
src/sys/sys: msgbuf.h

Log Message:
sys/msgbuf.h: New home for extern log_open.


To generate a diff of this commit:
cvs rdiff -u -r1.194 -r1.195 src/sys/kern/subr_prf.c
cvs rdiff -u -r1.17 -r1.18 src/sys/sys/msgbuf.h

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



CVS commit: src/sys/kern

2022-10-26 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Oct 26 23:28:30 UTC 2022

Modified Files:
src/sys/kern: subr_log.c

Log Message:
kern/subr_log.c: log_lock is private; make it static, not extern.


To generate a diff of this commit:
cvs rdiff -u -r1.62 -r1.63 src/sys/kern/subr_log.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/kern/subr_log.c
diff -u src/sys/kern/subr_log.c:1.62 src/sys/kern/subr_log.c:1.63
--- src/sys/kern/subr_log.c:1.62	Sun Sep 26 15:11:33 2021
+++ src/sys/kern/subr_log.c	Wed Oct 26 23:28:30 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: subr_log.c,v 1.62 2021/09/26 15:11:33 thorpej Exp $	*/
+/*	$NetBSD: subr_log.c,v 1.63 2022/10/26 23:28:30 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2007, 2008 The NetBSD Foundation, Inc.
@@ -65,7 +65,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: subr_log.c,v 1.62 2021/09/26 15:11:33 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_log.c,v 1.63 2022/10/26 23:28:30 riastradh Exp $");
 
 #include 
 #include 
@@ -93,7 +93,7 @@ static pid_t	log_pgid;		/* process/group
 static kcondvar_t log_cv;
 static void	*log_sih;
 
-kmutex_t log_lock;
+static kmutex_t log_lock;
 int	log_open;			/* also used in log() */
 int	msgbufmapped;			/* is the message buffer mapped */
 int	msgbufenabled;			/* is logging to the buffer enabled */
@@ -457,7 +457,6 @@ sysctl_msgbuf(SYSCTLFN_ARGS)
 	char *where = oldp;
 	size_t len, maxlen;
 	long beg, end;
-	extern kmutex_t log_lock;
 	int error;
 
 	if (!logenabled(msgbufp)) {



CVS commit: src/sys/kern

2022-10-26 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Oct 26 23:28:30 UTC 2022

Modified Files:
src/sys/kern: subr_log.c

Log Message:
kern/subr_log.c: log_lock is private; make it static, not extern.


To generate a diff of this commit:
cvs rdiff -u -r1.62 -r1.63 src/sys/kern/subr_log.c

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



CVS commit: src/sys/kern

2022-10-26 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Oct 26 23:28:18 UTC 2022

Modified Files:
src/sys/kern: kern_lock.c

Log Message:
kern/kern_lock.c: We get start_init_exec from sys/kernel.h now.


To generate a diff of this commit:
cvs rdiff -u -r1.180 -r1.181 src/sys/kern/kern_lock.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/kern/kern_lock.c
diff -u src/sys/kern/kern_lock.c:1.180 src/sys/kern/kern_lock.c:1.181
--- src/sys/kern/kern_lock.c:1.180	Tue Sep 13 09:28:05 2022
+++ src/sys/kern/kern_lock.c	Wed Oct 26 23:28:18 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_lock.c,v 1.180 2022/09/13 09:28:05 riastradh Exp $	*/
+/*	$NetBSD: kern_lock.c,v 1.181 2022/10/26 23:28:18 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2002, 2006, 2007, 2008, 2009, 2020 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_lock.c,v 1.180 2022/09/13 09:28:05 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_lock.c,v 1.181 2022/10/26 23:28:18 riastradh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_lockdebug.h"
@@ -254,7 +254,6 @@ _kernel_lock(int nlocks)
 		splx(s);
 		while (__SIMPLELOCK_LOCKED_P(kernel_lock)) {
 #ifdef LOCKDEBUG
-			extern int start_init_exec;
 			if (SPINLOCK_SPINOUT(spins) && start_init_exec &&
 			(getticks() - starttime) > 10*hz) {
 ipi_msg_t msg = {



CVS commit: src/sys/kern

2022-10-26 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Oct 26 23:28:18 UTC 2022

Modified Files:
src/sys/kern: kern_lock.c

Log Message:
kern/kern_lock.c: We get start_init_exec from sys/kernel.h now.


To generate a diff of this commit:
cvs rdiff -u -r1.180 -r1.181 src/sys/kern/kern_lock.c

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



CVS commit: src/sys

2022-10-26 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Oct 26 23:27:32 UTC 2022

Modified Files:
src/sys/sys: kernel.h
src/sys/uvm: uvm_fault.c

Log Message:
sys/kernel.h: New home for extern start_init_exec.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sys/sys/kernel.h
cvs rdiff -u -r1.230 -r1.231 src/sys/uvm/uvm_fault.c

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



CVS commit: src/sys

2022-10-26 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Oct 26 23:27:32 UTC 2022

Modified Files:
src/sys/sys: kernel.h
src/sys/uvm: uvm_fault.c

Log Message:
sys/kernel.h: New home for extern start_init_exec.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sys/sys/kernel.h
cvs rdiff -u -r1.230 -r1.231 src/sys/uvm/uvm_fault.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/sys/kernel.h
diff -u src/sys/sys/kernel.h:1.34 src/sys/sys/kernel.h:1.35
--- src/sys/sys/kernel.h:1.34	Sat Mar 19 14:34:48 2022
+++ src/sys/sys/kernel.h	Wed Oct 26 23:27:32 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: kernel.h,v 1.34 2022/03/19 14:34:48 riastradh Exp $	*/
+/*	$NetBSD: kernel.h,v 1.35 2022/10/26 23:27:32 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 1990, 1993
@@ -53,6 +53,7 @@ extern int domainnamelen;
 extern int rtc_offset;		/* offset of rtc from UTC in minutes */
 
 extern int cold;		/* still working on startup */
+extern int start_init_exec;	/* init(8) may have started */
 extern int shutting_down;	/* system is shutting down */
 extern int tick;		/* usec per tick (100 / hz) */
 extern int tickadj;		/* "standard" clock skew, us./tick */

Index: src/sys/uvm/uvm_fault.c
diff -u src/sys/uvm/uvm_fault.c:1.230 src/sys/uvm/uvm_fault.c:1.231
--- src/sys/uvm/uvm_fault.c:1.230	Fri Jun  3 00:21:44 2022
+++ src/sys/uvm/uvm_fault.c	Wed Oct 26 23:27:32 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_fault.c,v 1.230 2022/06/03 00:21:44 dholland Exp $	*/
+/*	$NetBSD: uvm_fault.c,v 1.231 2022/10/26 23:27:32 riastradh Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uvm_fault.c,v 1.230 2022/06/03 00:21:44 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_fault.c,v 1.231 2022/10/26 23:27:32 riastradh Exp $");
 
 #include "opt_uvmhist.h"
 
@@ -171,12 +171,6 @@ static const struct uvm_advice uvmadvice
  */
 
 /*
- * externs from other modules
- */
-
-extern int start_init_exec;	/* Is init_main() done / init running? */
-
-/*
  * inline functions
  */
 



CVS commit: src/sys/kern

2022-10-26 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Oct 26 23:27:16 UTC 2022

Modified Files:
src/sys/kern: kern_turnstile.c

Log Message:
kern/kern_turnstile.c: Get turnstile0 from sys/sleeptab.h.


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.45 src/sys/kern/kern_turnstile.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/kern/kern_turnstile.c
diff -u src/sys/kern/kern_turnstile.c:1.44 src/sys/kern/kern_turnstile.c:1.45
--- src/sys/kern/kern_turnstile.c:1.44	Wed Jun 29 22:27:01 2022
+++ src/sys/kern/kern_turnstile.c	Wed Oct 26 23:27:16 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_turnstile.c,v 1.44 2022/06/29 22:27:01 riastradh Exp $	*/
+/*	$NetBSD: kern_turnstile.c,v 1.45 2022/10/26 23:27:16 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2002, 2006, 2007, 2009, 2019, 2020
@@ -61,13 +61,14 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_turnstile.c,v 1.44 2022/06/29 22:27:01 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_turnstile.c,v 1.45 2022/10/26 23:27:16 riastradh Exp $");
 
 #include 
 #include 
 #include 
-#include  
+#include 
 #include 
+#include 
 #include 
 
 /*
@@ -81,7 +82,6 @@ __KERNEL_RCSID(0, "$NetBSD: kern_turnsti
 
 static tschain_t	turnstile_chains[TS_HASH_SIZE] __cacheline_aligned;
 struct pool		turnstile_pool;
-extern turnstile_t	turnstile0;
 
 static union {
 	kmutex_t	lock;



CVS commit: src/sys/kern

2022-10-26 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Oct 26 23:27:16 UTC 2022

Modified Files:
src/sys/kern: kern_turnstile.c

Log Message:
kern/kern_turnstile.c: Get turnstile0 from sys/sleeptab.h.


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.45 src/sys/kern/kern_turnstile.c

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



CVS commit: src/sys/kern

2022-10-26 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Oct 26 23:26:57 UTC 2022

Modified Files:
src/sys/kern: kgdb_stub.c

Log Message:
kgdb(9): Use ddb/db_extern.h instead of copying extern.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/sys/kern/kgdb_stub.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/kern/kgdb_stub.c
diff -u src/sys/kern/kgdb_stub.c:1.30 src/sys/kern/kgdb_stub.c:1.31
--- src/sys/kern/kgdb_stub.c:1.30	Wed Jan 13 07:36:56 2021
+++ src/sys/kern/kgdb_stub.c	Wed Oct 26 23:26:57 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: kgdb_stub.c,v 1.30 2021/01/13 07:36:56 skrll Exp $	*/
+/*	$NetBSD: kgdb_stub.c,v 1.31 2022/10/26 23:26:57 riastradh Exp $	*/
 
 /*
  * Copyright (c) 1990, 1993
@@ -45,7 +45,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kgdb_stub.c,v 1.30 2021/01/13 07:36:56 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kgdb_stub.c,v 1.31 2022/10/26 23:26:57 riastradh Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -103,7 +103,7 @@ kgdb_waitc(void *arg)
  * is shared with DDB.
  */
 #ifdef DDB
-extern void (*db_trap_callback)(int);
+#include 
 #else
 void (*db_trap_callback)(int);
 #endif



CVS commit: src/sys/kern

2022-10-26 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Oct 26 23:26:57 UTC 2022

Modified Files:
src/sys/kern: kgdb_stub.c

Log Message:
kgdb(9): Use ddb/db_extern.h instead of copying extern.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/sys/kern/kgdb_stub.c

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



CVS commit: src/sys/kern

2022-10-26 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Oct 26 23:26:45 UTC 2022

Modified Files:
src/sys/kern: subr_kobj.c

Log Message:
kern/subr_kobj.c: We already get module_base from sys/module.h.


To generate a diff of this commit:
cvs rdiff -u -r1.74 -r1.75 src/sys/kern/subr_kobj.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/kern/subr_kobj.c
diff -u src/sys/kern/subr_kobj.c:1.74 src/sys/kern/subr_kobj.c:1.75
--- src/sys/kern/subr_kobj.c:1.74	Wed Oct 26 23:22:07 2022
+++ src/sys/kern/subr_kobj.c	Wed Oct 26 23:26:45 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: subr_kobj.c,v 1.74 2022/10/26 23:22:07 riastradh Exp $	*/
+/*	$NetBSD: subr_kobj.c,v 1.75 2022/10/26 23:26:45 riastradh Exp $	*/
 
 /*
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -63,7 +63,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: subr_kobj.c,v 1.74 2022/10/26 23:22:07 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_kobj.c,v 1.75 2022/10/26 23:26:45 riastradh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_modular.h"
@@ -1196,8 +1196,6 @@ kobj_free(kobj_t ko, void *base, size_t 
 	kmem_free(base, size);
 }
 
-extern char module_base[];
-
 void
 kobj_setname(kobj_t ko, const char *name)
 {



CVS commit: src/sys/kern

2022-10-26 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Oct 26 23:26:45 UTC 2022

Modified Files:
src/sys/kern: subr_kobj.c

Log Message:
kern/subr_kobj.c: We already get module_base from sys/module.h.


To generate a diff of this commit:
cvs rdiff -u -r1.74 -r1.75 src/sys/kern/subr_kobj.c

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



CVS commit: src/sys/sys

2022-10-26 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Oct 26 23:24:59 UTC 2022

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

Log Message:
sys/sleepq.h: Get cold from sys/kernel.h.


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/sys/sys/sleepq.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/sleepq.h
diff -u src/sys/sys/sleepq.h:1.35 src/sys/sys/sleepq.h:1.36
--- src/sys/sys/sleepq.h:1.35	Wed Jun 29 22:27:01 2022
+++ src/sys/sys/sleepq.h	Wed Oct 26 23:24:59 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: sleepq.h,v 1.35 2022/06/29 22:27:01 riastradh Exp $	*/
+/*	$NetBSD: sleepq.h,v 1.36 2022/10/26 23:24:59 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2002, 2006, 2007, 2008, 2009, 2019, 2020
@@ -63,6 +63,9 @@ void	sleepq_lendpri(lwp_t *, pri_t);
 int	sleepq_block(int, bool, struct syncobj *);
 
 #ifdef _KERNEL
+
+#include 
+
 typedef union {
 	kmutex_t	lock;
 	uint8_t		pad[COHERENCY_UNIT];
@@ -76,7 +79,6 @@ typedef union {
 static __inline bool
 sleepq_dontsleep(lwp_t *l)
 {
-	extern int cold;
 
 	return cold || (doing_shutdown && (panicstr || CURCPU_IDLE_P()));
 }
@@ -97,6 +99,7 @@ sleepq_enter(sleepq_t *sq, lwp_t *l, kmu
 	lwp_unlock_to(l, mp);
 	KERNEL_UNLOCK_ALL(NULL, >l_biglocks);
 }
+
 #endif
 
 #include 



CVS commit: src/sys/sys

2022-10-26 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Oct 26 23:24:59 UTC 2022

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

Log Message:
sys/sleepq.h: Get cold from sys/kernel.h.


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/sys/sys/sleepq.h

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



CVS commit: src/sys/kern

2022-10-26 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Oct 26 23:24:21 UTC 2022

Modified Files:
src/sys/kern: subr_kcov.c

Log Message:
kern/subr_kcov.c: We already get cold from sys/kernel.h.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/kern/subr_kcov.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/kern/subr_kcov.c
diff -u src/sys/kern/subr_kcov.c:1.17 src/sys/kern/subr_kcov.c:1.18
--- src/sys/kern/subr_kcov.c:1.17	Wed Jul  6 01:12:46 2022
+++ src/sys/kern/subr_kcov.c	Wed Oct 26 23:24:21 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: subr_kcov.c,v 1.17 2022/07/06 01:12:46 riastradh Exp $	*/
+/*	$NetBSD: subr_kcov.c,v 1.18 2022/10/26 23:24:21 riastradh Exp $	*/
 
 /*
  * Copyright (c) 2019-2020 The NetBSD Foundation, Inc.
@@ -579,7 +579,6 @@ void __sanitizer_cov_trace_pc(void);
 void __nomsan
 __sanitizer_cov_trace_pc(void)
 {
-	extern int cold;
 	uint64_t idx;
 	kcov_t *kd;
 
@@ -626,7 +625,6 @@ __sanitizer_cov_trace_pc(void)
 static void __nomsan
 trace_cmp(uint64_t type, uint64_t arg1, uint64_t arg2, intptr_t pc)
 {
-	extern int cold;
 	uint64_t idx;
 	kcov_t *kd;
 



CVS commit: src/sys/kern

2022-10-26 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Oct 26 23:24:21 UTC 2022

Modified Files:
src/sys/kern: subr_kcov.c

Log Message:
kern/subr_kcov.c: We already get cold from sys/kernel.h.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/kern/subr_kcov.c

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



CVS commit: src/sys

2022-10-26 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Oct 26 23:24:09 UTC 2022

Modified Files:
src/sys/kern: sched_4bsd.c
src/sys/sys: sched.h

Log Message:
sys/sched.h: New home for extern sched_pstats_ticks in kernel.


To generate a diff of this commit:
cvs rdiff -u -r1.45 -r1.46 src/sys/kern/sched_4bsd.c
cvs rdiff -u -r1.90 -r1.91 src/sys/sys/sched.h

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



CVS commit: src/sys

2022-10-26 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Oct 26 23:24:09 UTC 2022

Modified Files:
src/sys/kern: sched_4bsd.c
src/sys/sys: sched.h

Log Message:
sys/sched.h: New home for extern sched_pstats_ticks in kernel.


To generate a diff of this commit:
cvs rdiff -u -r1.45 -r1.46 src/sys/kern/sched_4bsd.c
cvs rdiff -u -r1.90 -r1.91 src/sys/sys/sched.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/kern/sched_4bsd.c
diff -u src/sys/kern/sched_4bsd.c:1.45 src/sys/kern/sched_4bsd.c:1.46
--- src/sys/kern/sched_4bsd.c:1.45	Mon Aug  9 19:57:57 2021
+++ src/sys/kern/sched_4bsd.c	Wed Oct 26 23:24:09 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: sched_4bsd.c,v 1.45 2021/08/09 19:57:57 andvar Exp $	*/
+/*	$NetBSD: sched_4bsd.c,v 1.46 2022/10/26 23:24:09 riastradh Exp $	*/
 
 /*
  * Copyright (c) 1999, 2000, 2004, 2006, 2007, 2008, 2019, 2020
@@ -69,7 +69,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sched_4bsd.c,v 1.45 2021/08/09 19:57:57 andvar Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sched_4bsd.c,v 1.46 2022/10/26 23:24:09 riastradh Exp $");
 
 #include "opt_ddb.h"
 #include "opt_lockdebug.h"
@@ -90,8 +90,6 @@ __KERNEL_RCSID(0, "$NetBSD: sched_4bsd.c
 static void updatepri(struct lwp *);
 static void resetpriority(struct lwp *);
 
-extern unsigned int sched_pstats_ticks; /* defined in kern_synch.c */
-
 /* Number of hardclock ticks per sched_tick() */
 u_int sched_rrticks __read_mostly;
 

Index: src/sys/sys/sched.h
diff -u src/sys/sys/sched.h:1.90 src/sys/sys/sched.h:1.91
--- src/sys/sys/sched.h:1.90	Sat May 23 23:37:17 2020
+++ src/sys/sys/sched.h	Wed Oct 26 23:24:09 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: sched.h,v 1.90 2020/05/23 23:37:17 ad Exp $	*/
+/*	$NetBSD: sched.h,v 1.91 2022/10/26 23:24:09 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2002, 2007, 2008, 2019, 2020
@@ -211,6 +211,7 @@ struct schedstate_percpu {
 
 extern int schedhz;			/* ideally: 16 */
 extern u_int sched_rrticks;
+extern u_int sched_pstats_ticks;
 
 struct proc;
 struct cpu_info;



CVS commit: src/sys

2022-10-26 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Oct 26 23:23:52 UTC 2022

Modified Files:
src/sys/arch/amd64/amd64: machdep.c
src/sys/arch/i386/i386: machdep.c
src/sys/compat/netbsd32: netbsd32_compat_50.c netbsd32_time.c
src/sys/kern: kern_ntptime.c kern_time.c
src/sys/sys: timevar.h timex.h

Log Message:
sys: Put externs for time_adjtime and time_adjusted in .h files.

time_adjtime: sys/timex.h (defined in ntp code)
time_adjusted: sys/timevar.h (defined in non-ntp code)

(Not really sure this is a valuable distinction to maintain; there's
non-ntp code that uses time_adjtime too.)


To generate a diff of this commit:
cvs rdiff -u -r1.364 -r1.365 src/sys/arch/amd64/amd64/machdep.c
cvs rdiff -u -r1.837 -r1.838 src/sys/arch/i386/i386/machdep.c
cvs rdiff -u -r1.52 -r1.53 src/sys/compat/netbsd32/netbsd32_compat_50.c
cvs rdiff -u -r1.57 -r1.58 src/sys/compat/netbsd32/netbsd32_time.c
cvs rdiff -u -r1.63 -r1.64 src/sys/kern/kern_ntptime.c
cvs rdiff -u -r1.217 -r1.218 src/sys/kern/kern_time.c
cvs rdiff -u -r1.48 -r1.49 src/sys/sys/timevar.h
cvs rdiff -u -r1.19 -r1.20 src/sys/sys/timex.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/amd64/amd64/machdep.c
diff -u src/sys/arch/amd64/amd64/machdep.c:1.364 src/sys/arch/amd64/amd64/machdep.c:1.365
--- src/sys/arch/amd64/amd64/machdep.c:1.364	Wed Oct 26 23:22:07 2022
+++ src/sys/arch/amd64/amd64/machdep.c	Wed Oct 26 23:23:52 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.364 2022/10/26 23:22:07 riastradh Exp $	*/
+/*	$NetBSD: machdep.c,v 1.365 2022/10/26 23:23:52 riastradh Exp $	*/
 
 /*
  * Copyright (c) 1996, 1997, 1998, 2000, 2006, 2007, 2008, 2011
@@ -110,7 +110,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.364 2022/10/26 23:22:07 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.365 2022/10/26 23:23:52 riastradh Exp $");
 
 #include "opt_modular.h"
 #include "opt_user_ldt.h"
@@ -154,6 +154,7 @@ __KERNEL_RCSID(0, "$NetBSD: machdep.c,v 
 #include 
 #include 
 #include 
+#include 
 
 #ifdef KGDB
 #include 
@@ -303,8 +304,6 @@ void dumpsys(void);
 
 static void x86_64_proc0_pcb_ldt_init(void);
 
-extern int time_adjusted;	/* XXX no common header */
-
 void dump_misc_init(void);
 void dump_seg_prep(void);
 int dump_seg_iter(int (*)(paddr_t, paddr_t));

Index: src/sys/arch/i386/i386/machdep.c
diff -u src/sys/arch/i386/i386/machdep.c:1.837 src/sys/arch/i386/i386/machdep.c:1.838
--- src/sys/arch/i386/i386/machdep.c:1.837	Sat Aug 20 23:48:50 2022
+++ src/sys/arch/i386/i386/machdep.c	Wed Oct 26 23:23:52 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.837 2022/08/20 23:48:50 riastradh Exp $	*/
+/*	$NetBSD: machdep.c,v 1.838 2022/10/26 23:23:52 riastradh Exp $	*/
 
 /*
  * Copyright (c) 1996, 1997, 1998, 2000, 2004, 2006, 2008, 2009, 2017
@@ -67,7 +67,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.837 2022/08/20 23:48:50 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.838 2022/10/26 23:23:52 riastradh Exp $");
 
 #include "opt_beep.h"
 #include "opt_compat_freebsd.h"
@@ -106,6 +106,7 @@ __KERNEL_RCSID(0, "$NetBSD: machdep.c,v 
 #include 
 #include 
 #include 
+#include 
 
 #ifdef KGDB
 #include 
@@ -250,8 +251,6 @@ void initgdt(union descriptor *);
 
 static void i386_proc0_pcb_ldt_init(void);
 
-extern int time_adjusted;
-
 int *esym;
 int *eblob;
 extern int boothowto;

Index: src/sys/compat/netbsd32/netbsd32_compat_50.c
diff -u src/sys/compat/netbsd32/netbsd32_compat_50.c:1.52 src/sys/compat/netbsd32/netbsd32_compat_50.c:1.53
--- src/sys/compat/netbsd32/netbsd32_compat_50.c:1.52	Tue Sep  7 11:43:05 2021
+++ src/sys/compat/netbsd32/netbsd32_compat_50.c	Wed Oct 26 23:23:52 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_compat_50.c,v 1.52 2021/09/07 11:43:05 riastradh Exp $	*/
+/*	$NetBSD: netbsd32_compat_50.c,v 1.53 2022/10/26 23:23:52 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2020 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_50.c,v 1.52 2021/09/07 11:43:05 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_50.c,v 1.53 2022/10/26 23:23:52 riastradh Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_netbsd.h"
@@ -47,6 +47,8 @@ __KERNEL_RCSID(0, "$NetBSD: netbsd32_com
 #include 
 #include 
 #include 
+#include 
+#include 
 #include 
 #include 
 #include 
@@ -247,9 +249,6 @@ compat_50_netbsd32_adjtime(struct lwp *l
 	struct netbsd32_timeval50 atv;
 	int error;
 
-	extern int time_adjusted; /* in kern_ntptime.c */
-	extern int64_t time_adjtime;  /* in kern_ntptime.c */
-
 	if ((error = kauth_authorize_system(l->l_cred,
 	KAUTH_SYSTEM_TIME, KAUTH_REQ_SYSTEM_TIME_ADJTIME, NULL, NULL,
 	NULL)) != 0)

Index: src/sys/compat/netbsd32/netbsd32_time.c
diff -u src/sys/compat/netbsd32/netbsd32_time.c:1.57 

CVS commit: src/sys

2022-10-26 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Oct 26 23:23:52 UTC 2022

Modified Files:
src/sys/arch/amd64/amd64: machdep.c
src/sys/arch/i386/i386: machdep.c
src/sys/compat/netbsd32: netbsd32_compat_50.c netbsd32_time.c
src/sys/kern: kern_ntptime.c kern_time.c
src/sys/sys: timevar.h timex.h

Log Message:
sys: Put externs for time_adjtime and time_adjusted in .h files.

time_adjtime: sys/timex.h (defined in ntp code)
time_adjusted: sys/timevar.h (defined in non-ntp code)

(Not really sure this is a valuable distinction to maintain; there's
non-ntp code that uses time_adjtime too.)


To generate a diff of this commit:
cvs rdiff -u -r1.364 -r1.365 src/sys/arch/amd64/amd64/machdep.c
cvs rdiff -u -r1.837 -r1.838 src/sys/arch/i386/i386/machdep.c
cvs rdiff -u -r1.52 -r1.53 src/sys/compat/netbsd32/netbsd32_compat_50.c
cvs rdiff -u -r1.57 -r1.58 src/sys/compat/netbsd32/netbsd32_time.c
cvs rdiff -u -r1.63 -r1.64 src/sys/kern/kern_ntptime.c
cvs rdiff -u -r1.217 -r1.218 src/sys/kern/kern_time.c
cvs rdiff -u -r1.48 -r1.49 src/sys/sys/timevar.h
cvs rdiff -u -r1.19 -r1.20 src/sys/sys/timex.h

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



CVS commit: src/sys/kern

2022-10-26 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Oct 26 23:23:28 UTC 2022

Modified Files:
src/sys/kern: kern_synch.c

Log Message:
kern/kern_synch.c: Get averunnable from sys/resource.h.


To generate a diff of this commit:
cvs rdiff -u -r1.351 -r1.352 src/sys/kern/kern_synch.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/kern/kern_synch.c
diff -u src/sys/kern/kern_synch.c:1.351 src/sys/kern/kern_synch.c:1.352
--- src/sys/kern/kern_synch.c:1.351	Wed Jun 29 22:27:01 2022
+++ src/sys/kern/kern_synch.c	Wed Oct 26 23:23:28 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_synch.c,v 1.351 2022/06/29 22:27:01 riastradh Exp $	*/
+/*	$NetBSD: kern_synch.c,v 1.352 2022/10/26 23:23:28 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2004, 2006, 2007, 2008, 2009, 2019, 2020
@@ -69,7 +69,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_synch.c,v 1.351 2022/06/29 22:27:01 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_synch.c,v 1.352 2022/10/26 23:23:28 riastradh Exp $");
 
 #include "opt_kstack.h"
 #include "opt_dtrace.h"
@@ -82,6 +82,7 @@ __KERNEL_RCSID(0, "$NetBSD: kern_synch.c
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -1104,7 +1105,6 @@ static const fixpt_t cexp[ ] = {
 void
 sched_pstats(void)
 {
-	extern struct loadavg averunnable;
 	struct loadavg *avg = 
 	const int clkhz = (stathz != 0 ? stathz : hz);
 	static bool backwards = false;



CVS commit: src/sys/kern

2022-10-26 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Oct 26 23:23:28 UTC 2022

Modified Files:
src/sys/kern: kern_synch.c

Log Message:
kern/kern_synch.c: Get averunnable from sys/resource.h.


To generate a diff of this commit:
cvs rdiff -u -r1.351 -r1.352 src/sys/kern/kern_synch.c

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



CVS commit: src/lib/libc/time

2022-10-26 Thread Jan Schaumann
Module Name:src
Committed By:   jschauma
Date:   Wed Oct 26 23:22:54 UTC 2022

Modified Files:
src/lib/libc/time: ctime.3

Log Message:
rephrase / clarify explanation of struct tm member normalization


To generate a diff of this commit:
cvs rdiff -u -r1.67 -r1.68 src/lib/libc/time/ctime.3

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



CVS commit: src/lib/libc/time

2022-10-26 Thread Jan Schaumann
Module Name:src
Committed By:   jschauma
Date:   Wed Oct 26 23:22:54 UTC 2022

Modified Files:
src/lib/libc/time: ctime.3

Log Message:
rephrase / clarify explanation of struct tm member normalization


To generate a diff of this commit:
cvs rdiff -u -r1.67 -r1.68 src/lib/libc/time/ctime.3

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

Modified files:

Index: src/lib/libc/time/ctime.3
diff -u src/lib/libc/time/ctime.3:1.67 src/lib/libc/time/ctime.3:1.68
--- src/lib/libc/time/ctime.3:1.67	Fri Oct 21 12:28:43 2022
+++ src/lib/libc/time/ctime.3	Wed Oct 26 23:22:54 2022
@@ -1,4 +1,4 @@
-.\" $NetBSD: ctime.3,v 1.67 2022/10/21 12:28:43 uwe Exp $
+.\" $NetBSD: ctime.3,v 1.68 2022/10/26 23:22:54 jschauma Exp $
 .\"
 .\" XXX: License missing?
 .\"
@@ -255,15 +255,56 @@ components of the structure are ignored,
 and the original values of the other components are not restricted
 to their normal ranges and will be normalized,
 if need be.
+.Pp
 For example,
-October 40 is changed into November 9, a
-.Fa tm_hour
-of \-1 means 1 hour before midnight,
+consider a
+.Fa struct tm
+initialized with
+.Fa tm_year
+= 122,
+.Fa tm_mon
+= 10,
 .Fa tm_mday
-of 0 means the day preceding the current month, and
+= 30,
+.Fa tm_hour
+= 22,
+.Fa tm_min
+= 57,
+and
+.Fa tm_sec
+= 0.
+Incrementing
+.Fa tm_min
+by 13 and calling
+.Fn mktime
+would lead to
+.Fa tm_hour
+= 23 and
+.Fa tm_min
+= 10.
+.Pp
+This normalizing can lead to cascading changes:
+Again using a
+.Fa struct tm
+initialized as in the above example but with
+.Fa tm_hour
+= 23,
+the same change would lead to
 .Fa tm_mon
-of \-2 means 2 months before January of
-.Fa tm_year .
+= 11,
+.Fa tm_mday
+= 1,
+.Fa tm_hour
+= 0, and
+.Fa tm_min
+= 10.
+.Pp
+Negative values may also be normalized with similar
+cascading effect such that e.g.,
+a
+.Fa tm_hour
+of \-1 means 1 hour before midnight on the previous
+day and so on.
 .It
 A positive or zero value for
 .Fa tm_isdst



CVS commit: src/sys/kern

2022-10-26 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Oct 26 23:22:38 UTC 2022

Modified Files:
src/sys/kern: kern_pax.c

Log Message:
kern/kern_pax.c: Get maxsmap from sys/resourcevar.h.


To generate a diff of this commit:
cvs rdiff -u -r1.62 -r1.63 src/sys/kern/kern_pax.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/kern/kern_pax.c
diff -u src/sys/kern/kern_pax.c:1.62 src/sys/kern/kern_pax.c:1.63
--- src/sys/kern/kern_pax.c:1.62	Mon Aug 30 01:25:10 2021
+++ src/sys/kern/kern_pax.c	Wed Oct 26 23:22:38 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_pax.c,v 1.62 2021/08/30 01:25:10 rin Exp $	*/
+/*	$NetBSD: kern_pax.c,v 1.63 2022/10/26 23:22:38 riastradh Exp $	*/
 
 /*
  * Copyright (c) 2015, 2020 The NetBSD Foundation, Inc.
@@ -57,7 +57,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_pax.c,v 1.62 2021/08/30 01:25:10 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_pax.c,v 1.63 2022/10/26 23:22:38 riastradh Exp $");
 
 #include "opt_pax.h"
 
@@ -86,6 +86,7 @@ __KERNEL_RCSID(0, "$NetBSD: kern_pax.c,v
 
 #ifdef PAX_ASLR
 #include 
+#include 
 
 int pax_aslr_enabled = 1;
 int pax_aslr_global = PAX_ASLR;
@@ -336,7 +337,6 @@ pax_init(void)
 {
 #ifdef PAX_ASLR
 	/* Adjust maximum stack by the size we can consume for ASLR */
-	extern rlim_t maxsmap;
 	maxsmap = MAXSSIZ - (MAXSSIZ / PAX_ASLR_MAX_STACK_WASTE);
 	// XXX: compat32 is not handled.
 #endif



CVS commit: src/sys/kern

2022-10-26 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Oct 26 23:22:38 UTC 2022

Modified Files:
src/sys/kern: kern_pax.c

Log Message:
kern/kern_pax.c: Get maxsmap from sys/resourcevar.h.


To generate a diff of this commit:
cvs rdiff -u -r1.62 -r1.63 src/sys/kern/kern_pax.c

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



  1   2   >