CVS commit: src/sys/dev/ic

2021-10-11 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Tue Oct 12 06:25:17 UTC 2021

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

Log Message:
Now Jason has made this build, avoid a 50+ year
sleep to implement HUPCL.


To generate a diff of this commit:
cvs rdiff -u -r1.366 -r1.367 src/sys/dev/ic/com.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/com.c
diff -u src/sys/dev/ic/com.c:1.366 src/sys/dev/ic/com.c:1.367
--- src/sys/dev/ic/com.c:1.366	Mon Oct 11 18:39:06 2021
+++ src/sys/dev/ic/com.c	Tue Oct 12 06:25:17 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: com.c,v 1.366 2021/10/11 18:39:06 jmcneill Exp $ */
+/* $NetBSD: com.c,v 1.367 2021/10/12 06:25:17 kre Exp $ */
 
 /*-
  * Copyright (c) 1998, 1999, 2004, 2008 The NetBSD Foundation, Inc.
@@ -66,7 +66,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: com.c,v 1.366 2021/10/11 18:39:06 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: com.c,v 1.367 2021/10/12 06:25:17 kre Exp $");
 
 #include "opt_com.h"
 #include "opt_ddb.h"
@@ -986,9 +986,12 @@ comopen(dev_t dev, int flag, int mode, s
 		if (timerisset(&sc->sc_hup_pending)) {
 			getmicrotime(&now);
 			while (timercmp(&now, &sc->sc_hup_pending, <)) {
+int ms;
+
+
 timersub(&sc->sc_hup_pending, &now, &diff);
-int ms = now.tv_sec * 1000 +
-uimin(now.tv_usec / 1000, 1);
+ms = diff.tv_sec * 1000 +
+uimax(diff.tv_usec / 1000, 1);
 kpause("comopen", false, mstohz(ms),
 &sc->sc_lock);
 			}



CVS commit: src/sys/dev/ic

2021-10-11 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Tue Oct 12 06:25:17 UTC 2021

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

Log Message:
Now Jason has made this build, avoid a 50+ year
sleep to implement HUPCL.


To generate a diff of this commit:
cvs rdiff -u -r1.366 -r1.367 src/sys/dev/ic/com.c

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



CVS commit: src

2021-10-11 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Oct 12 04:55:19 UTC 2021

Modified Files:
src/distrib/sets/lists/man: mi
src/share/man/man4: Makefile
Added Files:
src/share/man/man4: hvn.4

Log Message:
Add hvn.4. OK'd by nonaka@.


To generate a diff of this commit:
cvs rdiff -u -r1.1726 -r1.1727 src/distrib/sets/lists/man/mi
cvs rdiff -u -r1.716 -r1.717 src/share/man/man4/Makefile
cvs rdiff -u -r0 -r1.1 src/share/man/man4/hvn.4

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

Modified files:

Index: src/distrib/sets/lists/man/mi
diff -u src/distrib/sets/lists/man/mi:1.1726 src/distrib/sets/lists/man/mi:1.1727
--- src/distrib/sets/lists/man/mi:1.1726	Sun Oct  3 17:27:02 2021
+++ src/distrib/sets/lists/man/mi	Tue Oct 12 04:55:19 2021
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1726 2021/10/03 17:27:02 brad Exp $
+# $NetBSD: mi,v 1.1727 2021/10/12 04:55:19 msaitoh Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -1261,6 +1261,7 @@
 ./usr/share/man/cat4/hppa/wax.0			man-sys-catman		.cat
 ./usr/share/man/cat4/hpqlb.0			man-sys-catman		.cat
 ./usr/share/man/cat4/hptide.0			man-sys-catman		.cat
+./usr/share/man/cat4/hvn.0			man-sys-catman		.cat
 ./usr/share/man/cat4/hythygtemp.0		man-sys-catman		.cat
 ./usr/share/man/cat4/i386/PCIBIOS.0		man-sys-catman		.cat
 ./usr/share/man/cat4/i386/apm.0			man-sys-catman		.cat
@@ -4488,6 +4489,7 @@
 ./usr/share/man/html4/hppa/wax.html		man-sys-htmlman		html
 ./usr/share/man/html4/hpqlb.html		man-sys-htmlman		html
 ./usr/share/man/html4/hptide.html		man-sys-htmlman		html
+./usr/share/man/html4/hvn.html			man-sys-htmlman		html
 ./usr/share/man/html4/hythygtemp.html		man-sys-htmlman		html
 ./usr/share/man/html4/i386/PCIBIOS.html		man-sys-htmlman		html
 ./usr/share/man/html4/i386/apm.html		man-sys-htmlman		html
@@ -7511,6 +7513,7 @@
 ./usr/share/man/man4/hppa/wax.4			man-sys-man		.man
 ./usr/share/man/man4/hpqlb.4			man-sys-man		.man
 ./usr/share/man/man4/hptide.4			man-sys-man		.man
+./usr/share/man/man4/hvn.4			man-sys-man		.man
 ./usr/share/man/man4/hythygtemp.4		man-sys-man		.man
 ./usr/share/man/man4/i386/PCIBIOS.4		man-sys-man		.man
 ./usr/share/man/man4/i386/apm.4			man-sys-man		.man

Index: src/share/man/man4/Makefile
diff -u src/share/man/man4/Makefile:1.716 src/share/man/man4/Makefile:1.717
--- src/share/man/man4/Makefile:1.716	Sun Oct  3 17:27:02 2021
+++ src/share/man/man4/Makefile	Tue Oct 12 04:55:19 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.716 2021/10/03 17:27:02 brad Exp $
+#	$NetBSD: Makefile,v 1.717 2021/10/12 04:55:19 msaitoh Exp $
 #	@(#)Makefile	8.1 (Berkeley) 6/18/93
 
 MAN=	aac.4 ac97.4 acardide.4 aceride.4 acphy.4 \
@@ -28,7 +28,7 @@ MAN=	aac.4 ac97.4 acardide.4 aceride.4 a
 	gcscaudio.4 gem.4 genfb.4 gentbi.4 geodeide.4 \
 	glxtphy.4 gpib.4 gpio.4 gpioirq.4 gpiolock.4 gpiopps.4 gpiopwm.4 \
 	gpiosim.4 gre.4 gphyter.4 gsip.4 \
-	hdaudio.4 hifn.4 hme.4 hpacel.4 hpqlb.4 hptide.4 hythygtemp.4 \
+	hdaudio.4 hifn.4 hme.4 hpacel.4 hpqlb.4 hptide.4 hvn.4 hythygtemp.4 \
 	iavf.4 ibmcd.4 ibmhawk.4 ichsmb.4 icmp.4 icp.4 icsphy.4 iee.4 \
 	ieee80211.4 ifmedia.4 igmafb.4 igphy.4 igsfb.4 iha.4 ihidev.4 \
 	ihphy.4 iic.4 ims.4 inet.4 ikphy.4 inphy.4 intersil7170.4 intro.4 \

Added files:

Index: src/share/man/man4/hvn.4
diff -u /dev/null src/share/man/man4/hvn.4:1.1
--- /dev/null	Tue Oct 12 04:55:20 2021
+++ src/share/man/man4/hvn.4	Tue Oct 12 04:55:19 2021
@@ -0,0 +1,70 @@
+.\"	$NetBSD: hvn.4,v 1.1 2021/10/12 04:55:19 msaitoh Exp $
+.\"
+.\"	$OpenBSD: hvn.4,v 1.5 2016/10/07 14:42:27 jmc Exp $
+.\"
+.\" Copyright (c) 2016 Mike Belopuhov
+.\"
+.\" Permission to use, copy, modify, and distribute this software for any
+.\" purpose with or without fee is hereby granted, provided that the above
+.\" copyright notice and this permission notice appear in all copies.
+.\"
+.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+.\"
+.Dd October 12 2021
+.Dt HVN 4
+.Os
+.Sh NAME
+.Nm hvn
+.Nd Hyper-V networking interface
+.Sh SYNOPSIS
+.Cd "hvn* at vmbus?"
+.Sh DESCRIPTION
+The
+.Nm
+driver provides support for a Network Virtual Service Client (NetVSC),
+a virtual networking interface that relays device requests to the Virtual
+Service Provider (VSP) in the management operating system via the VMBus.
+.Pp
+NetVSC emulates an RNDIS 1.0 compliant device on top of a custom NVS
+protocol operating over the VMBus channel ring.
+.Pp
+Individual networking interfaces can be renamed by issuing

CVS commit: src

2021-10-11 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Oct 12 04:55:19 UTC 2021

Modified Files:
src/distrib/sets/lists/man: mi
src/share/man/man4: Makefile
Added Files:
src/share/man/man4: hvn.4

Log Message:
Add hvn.4. OK'd by nonaka@.


To generate a diff of this commit:
cvs rdiff -u -r1.1726 -r1.1727 src/distrib/sets/lists/man/mi
cvs rdiff -u -r1.716 -r1.717 src/share/man/man4/Makefile
cvs rdiff -u -r0 -r1.1 src/share/man/man4/hvn.4

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



CVS commit: othersrc/external/bsd/bufgap/dist

2021-10-11 Thread Alistair G. Crooks
Module Name:othersrc
Committed By:   agc
Date:   Tue Oct 12 04:12:30 UTC 2021

Modified Files:
othersrc/external/bsd/bufgap/dist: gap.c gap.h

Log Message:
Add buffer gap accessor to return the complete text of the buffer as a string

Bump version number


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 othersrc/external/bsd/bufgap/dist/gap.c
cvs rdiff -u -r1.2 -r1.3 othersrc/external/bsd/bufgap/dist/gap.h

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

Modified files:

Index: othersrc/external/bsd/bufgap/dist/gap.c
diff -u othersrc/external/bsd/bufgap/dist/gap.c:1.1 othersrc/external/bsd/bufgap/dist/gap.c:1.2
--- othersrc/external/bsd/bufgap/dist/gap.c:1.1	Thu Sep 30 22:01:03 2021
+++ othersrc/external/bsd/bufgap/dist/gap.c	Tue Oct 12 04:12:30 2021
@@ -805,6 +805,16 @@ gap_exec_string(gap_t *gap, const char *
 			*n = cc;
 		}
 		return s;
+	case /* "text?" */ 0x10eee6dd:
+		cc = gap->lhsc + gap->rhsc;
+		s = calloc(1, cc + 1);
+		memcpy(s, gap->v, gap->lhsc);
+		memcpy(&s[gap->lhsc], &gap->v[rhssub(gap->size, gap->rhsc)], gap->rhsc);
+		s[cc] = 0x0;
+		if (n != NULL) {
+			*n = cc;
+		}
+		return s;
 	}
 	return NULL;
 }

Index: othersrc/external/bsd/bufgap/dist/gap.h
diff -u othersrc/external/bsd/bufgap/dist/gap.h:1.2 othersrc/external/bsd/bufgap/dist/gap.h:1.3
--- othersrc/external/bsd/bufgap/dist/gap.h:1.2	Thu Sep 30 22:16:57 2021
+++ othersrc/external/bsd/bufgap/dist/gap.h	Tue Oct 12 04:12:30 2021
@@ -23,7 +23,7 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 #ifndef GAP_H_
-#define GAP_H_	20210930
+#define GAP_H_	20211011
 
 #include 
 



CVS commit: othersrc/external/bsd/bufgap/dist

2021-10-11 Thread Alistair G. Crooks
Module Name:othersrc
Committed By:   agc
Date:   Tue Oct 12 04:12:30 UTC 2021

Modified Files:
othersrc/external/bsd/bufgap/dist: gap.c gap.h

Log Message:
Add buffer gap accessor to return the complete text of the buffer as a string

Bump version number


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 othersrc/external/bsd/bufgap/dist/gap.c
cvs rdiff -u -r1.2 -r1.3 othersrc/external/bsd/bufgap/dist/gap.h

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

2021-10-11 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Tue Oct 12 00:21:35 UTC 2021

Modified Files:
src/sys/dev/ic: comvar.h

Log Message:
Fix the build by adding 'sc_hup_pending' member to com_softc that
was apparently forgotten.


To generate a diff of this commit:
cvs rdiff -u -r1.94 -r1.95 src/sys/dev/ic/comvar.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/ic/comvar.h
diff -u src/sys/dev/ic/comvar.h:1.94 src/sys/dev/ic/comvar.h:1.95
--- src/sys/dev/ic/comvar.h:1.94	Thu Mar 25 05:34:49 2021
+++ src/sys/dev/ic/comvar.h	Tue Oct 12 00:21:34 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: comvar.h,v 1.94 2021/03/25 05:34:49 rin Exp $	*/
+/*	$NetBSD: comvar.h,v 1.95 2021/10/12 00:21:34 thorpej Exp $	*/
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All rights reserved.
@@ -125,6 +125,7 @@ struct com_softc {
 
 	callout_t sc_diag_callout;
 	callout_t sc_poll_callout;
+	struct timeval sc_hup_pending;
 
 	int sc_frequency;
 



CVS commit: src/sys/dev/ic

2021-10-11 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Tue Oct 12 00:21:35 UTC 2021

Modified Files:
src/sys/dev/ic: comvar.h

Log Message:
Fix the build by adding 'sc_hup_pending' member to com_softc that
was apparently forgotten.


To generate a diff of this commit:
cvs rdiff -u -r1.94 -r1.95 src/sys/dev/ic/comvar.h

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



CVS commit: src/usr.bin/indent

2021-10-11 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Oct 11 20:31:06 UTC 2021

Modified Files:
src/usr.bin/indent: lexi.c

Log Message:
indent: use separate variables for lexi_alnum and lexi

These two uses of the variable are independent of each other.

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.90 -r1.91 src/usr.bin/indent/lexi.c

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



CVS commit: src/usr.bin/indent

2021-10-11 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Oct 11 20:31:06 UTC 2021

Modified Files:
src/usr.bin/indent: lexi.c

Log Message:
indent: use separate variables for lexi_alnum and lexi

These two uses of the variable are independent of each other.

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.90 -r1.91 src/usr.bin/indent/lexi.c

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

Modified files:

Index: src/usr.bin/indent/lexi.c
diff -u src/usr.bin/indent/lexi.c:1.90 src/usr.bin/indent/lexi.c:1.91
--- src/usr.bin/indent/lexi.c:1.90	Mon Oct 11 20:13:46 2021
+++ src/usr.bin/indent/lexi.c	Mon Oct 11 20:31:06 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: lexi.c,v 1.90 2021/10/11 20:13:46 rillig Exp $	*/
+/*	$NetBSD: lexi.c,v 1.91 2021/10/11 20:31:06 rillig Exp $	*/
 
 /*-
  * SPDX-License-Identifier: BSD-4-Clause
@@ -43,7 +43,7 @@ static char sccsid[] = "@(#)lexi.c	8.1 (
 
 #include 
 #if defined(__NetBSD__)
-__RCSID("$NetBSD: lexi.c,v 1.90 2021/10/11 20:13:46 rillig Exp $");
+__RCSID("$NetBSD: lexi.c,v 1.91 2021/10/11 20:31:06 rillig Exp $");
 #elif defined(__FreeBSD__)
 __FBSDID("$FreeBSD: head/usr.bin/indent/lexi.c 337862 2018-08-15 18:19:45Z pstef $");
 #endif
@@ -505,9 +505,9 @@ lexi(struct parser_state *state)
 	inbuf_skip();
 }
 
-token_type ttype = lexi_alnum(state);
-if (ttype != end_of_file)
-	return lexi_end(ttype);
+token_type alnum_ttype = lexi_alnum(state);
+if (alnum_ttype != end_of_file)
+	return lexi_end(alnum_ttype);
 
 /* Scan a non-alphanumeric token */
 
@@ -515,6 +515,7 @@ lexi(struct parser_state *state)
 *token.e++ = inbuf_next();
 *token.e = '\0';
 
+token_type ttype;
 bool unary_delim = false;	/* whether the current token forces a
  * following operator to be unary */
 



CVS commit: src/sbin/init

2021-10-11 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Oct 11 20:23:25 UTC 2021

Modified Files:
src/sbin/init: init.c

Log Message:
Allow getty to exit quickly a few times before deciding that it is exiting
too quickly. Based on a FreeBSD change from 1994.


To generate a diff of this commit:
cvs rdiff -u -r1.108 -r1.109 src/sbin/init/init.c

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

Modified files:

Index: src/sbin/init/init.c
diff -u src/sbin/init/init.c:1.108 src/sbin/init/init.c:1.109
--- src/sbin/init/init.c:1.108	Mon Jun 22 07:50:53 2020
+++ src/sbin/init/init.c	Mon Oct 11 20:23:25 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: init.c,v 1.108 2020/06/22 07:50:53 msaitoh Exp $	*/
+/*	$NetBSD: init.c,v 1.109 2021/10/11 20:23:25 jmcneill Exp $	*/
 
 /*-
  * Copyright (c) 1991, 1993
@@ -42,7 +42,7 @@ __COPYRIGHT("@(#) Copyright (c) 1991, 19
 #if 0
 static char sccsid[] = "@(#)init.c	8.2 (Berkeley) 4/28/95";
 #else
-__RCSID("$NetBSD: init.c,v 1.108 2020/06/22 07:50:53 msaitoh Exp $");
+__RCSID("$NetBSD: init.c,v 1.109 2021/10/11 20:23:25 jmcneill Exp $");
 #endif
 #endif /* not lint */
 
@@ -91,6 +91,7 @@ __RCSID("$NetBSD: init.c,v 1.108 2020/06
  */
 #define	GETTY_SPACING		 5	/* N secs minimum getty spacing */
 #define	GETTY_SLEEP		30	/* sleep N secs after spacing problem */
+#define	GETTY_NSPACE		 5	/* N retries before spacing problem */
 #define	WINDOW_WAIT		 3	/* wait N secs after starting window */
 #define	STALL_TIMEOUT		30	/* wait N secs after warning */
 #define	DEATH_WATCH		10	/* wait N secs for procs to die */
@@ -151,6 +152,7 @@ typedef struct init_session {
 	int	se_index;		/* index of entry in ttys file */
 	pid_t	se_process;		/* controlling process */
 	struct timeval	se_started;	/* used to avoid thrashing */
+	int	se_nspace;		/* spacing count */
 	int	se_flags;		/* status of session */
 #define	SE_SHUTDOWN	0x1		/* session won't be restarted */
 #define	SE_PRESENT	0x2		/* session is in /etc/ttys */
@@ -1270,6 +1272,17 @@ start_getty(session_t *sp)
 	pid_t pid;
 	sigset_t mask;
 	time_t current_time = time(NULL);
+	bool do_sleep = false;
+
+	if (current_time >= sp->se_started.tv_sec &&
+	current_time - sp->se_started.tv_sec < GETTY_SPACING) {
+		if (++sp->se_nspace > GETTY_NSPACE) {
+			sp->se_nspace = 0;
+			do_sleep = true;
+		}
+	} else {
+		sp->se_nspace = 0;
+	}
 
 	/*
 	 * fork(), not vfork() -- we can't afford to block.
@@ -1293,8 +1306,7 @@ start_getty(session_t *sp)
 		}
 #endif /* CHROOT */
 
-	if (current_time > sp->se_started.tv_sec &&
-	current_time - sp->se_started.tv_sec < GETTY_SPACING) {
+	if (do_sleep) {
 		warning("getty repeating too quickly on port `%s', sleeping",
 		sp->se_device);
 		(void)sleep(GETTY_SLEEP);
@@ -1555,6 +1567,8 @@ clean_ttys(void)
 sp->se_flags |= SE_SHUTDOWN;
 if (sp->se_process != 0)
 	(void)kill(sp->se_process, SIGHUP);
+			} else {
+sp->se_nspace = 0;
 			}
 			continue;
 		}



CVS commit: src/sbin/init

2021-10-11 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Oct 11 20:23:25 UTC 2021

Modified Files:
src/sbin/init: init.c

Log Message:
Allow getty to exit quickly a few times before deciding that it is exiting
too quickly. Based on a FreeBSD change from 1994.


To generate a diff of this commit:
cvs rdiff -u -r1.108 -r1.109 src/sbin/init/init.c

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



CVS commit: src/usr.bin/indent

2021-10-11 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Oct 11 20:13:46 UTC 2021

Modified Files:
src/usr.bin/indent: lexi.c

Log Message:
indent: clean up comments in lexi and lexi_alnum

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.89 -r1.90 src/usr.bin/indent/lexi.c

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



CVS commit: src/usr.bin/indent

2021-10-11 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Oct 11 20:13:46 UTC 2021

Modified Files:
src/usr.bin/indent: lexi.c

Log Message:
indent: clean up comments in lexi and lexi_alnum

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.89 -r1.90 src/usr.bin/indent/lexi.c

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

Modified files:

Index: src/usr.bin/indent/lexi.c
diff -u src/usr.bin/indent/lexi.c:1.89 src/usr.bin/indent/lexi.c:1.90
--- src/usr.bin/indent/lexi.c:1.89	Mon Oct 11 19:55:35 2021
+++ src/usr.bin/indent/lexi.c	Mon Oct 11 20:13:46 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: lexi.c,v 1.89 2021/10/11 19:55:35 rillig Exp $	*/
+/*	$NetBSD: lexi.c,v 1.90 2021/10/11 20:13:46 rillig Exp $	*/
 
 /*-
  * SPDX-License-Identifier: BSD-4-Clause
@@ -43,7 +43,7 @@ static char sccsid[] = "@(#)lexi.c	8.1 (
 
 #include 
 #if defined(__NetBSD__)
-__RCSID("$NetBSD: lexi.c,v 1.89 2021/10/11 19:55:35 rillig Exp $");
+__RCSID("$NetBSD: lexi.c,v 1.90 2021/10/11 20:13:46 rillig Exp $");
 #elif defined(__FreeBSD__)
 __FBSDID("$FreeBSD: head/usr.bin/indent/lexi.c 337862 2018-08-15 18:19:45Z pstef $");
 #endif
@@ -377,13 +377,14 @@ is_typename(void)
 return bsearch_typenames(token.s) >= 0;
 }
 
+/* Read an alphanumeric token into 'token', or return end_of_file. */
 static token_type
 lexi_alnum(struct parser_state *state)
 {
 if (!(isalnum((unsigned char)*inp.s) ||
 	*inp.s == '_' || *inp.s == '$' ||
 	(inp.s[0] == '.' && isdigit((unsigned char)inp.s[1]
-	return end_of_file;
+	return end_of_file;	/* just as a placeholder */
 
 if (isdigit((unsigned char)*inp.s) ||
 	(inp.s[0] == '.' && isdigit((unsigned char)inp.s[1]))) {
@@ -462,8 +463,8 @@ lexi_alnum(struct parser_state *state)
 	default:		/* all others are treated like any other
  * identifier */
 	return ident;
-	}			/* end of switch */
-}/* end of if (found_it) */
+	}
+}
 
 if (*inp.s == '(' && state->tos <= 1 && state->ind_level == 0 &&
 	!state->in_parameter_declaration && !state->block_init) {
@@ -495,10 +496,8 @@ not_proc:;
 token_type
 lexi(struct parser_state *state)
 {
-token.e = token.s;		/* point to start of place to save token */
-state->col_1 = state->last_nl;	/* tell world that this token started
-	 * in column 1 iff the last thing
-	 * scanned was a newline */
+token.e = token.s;
+state->col_1 = state->last_nl;
 state->last_nl = false;
 
 while (is_hspace(*inp.s)) {
@@ -512,9 +511,8 @@ lexi(struct parser_state *state)
 
 /* Scan a non-alphanumeric token */
 
-check_size_token(3);	/* things like "<<=" */
-*token.e++ = inbuf_next();	/* if it is only a one-character token, it is
- * moved here */
+check_size_token(3);	/* for things like "<<=" */
+*token.e++ = inbuf_next();
 *token.e = '\0';
 
 bool unary_delim = false;	/* whether the current token forces a
@@ -593,34 +591,28 @@ lexi(struct parser_state *state)
 	break;
 
 case '-':
-case '+':			/* check for -, +, --, ++ */
+case '+':
 	ttype = state->last_u_d ? unary_op : binary_op;
 	unary_delim = true;
 
-	if (*inp.s == token.s[0]) {
-	/* check for doubled character */
+	if (*inp.s == token.s[0]) {	/* ++, -- */
 	*token.e++ = *inp.s++;
-	/* buffer overflow will be checked at end of loop */
 	if (state->last_token == ident ||
 		state->last_token == rparen_or_rbracket) {
 		ttype = state->last_u_d ? unary_op : postfix_op;
-		/* check for following ++ or -- */
 		unary_delim = false;
 	}
 
-	} else if (*inp.s == '=') {
-	/* check for operator += */
+	} else if (*inp.s == '=') {	/* += */
 	*token.e++ = *inp.s++;
 
-	} else if (*inp.s == '>') {
-	/* check for operator -> */
+	} else if (*inp.s == '>') {	/* -> */
 	*token.e++ = *inp.s++;
 	unary_delim = false;
 	ttype = unary_op;
 	state->want_blank = false;
 	}
-	break;			/* buffer overflow will be checked at end of
- * switch */
+	break;
 
 case '=':
 	if (state->init_or_struct)



CVS commit: src/usr.bin/indent

2021-10-11 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Oct 11 19:55:35 UTC 2021

Modified Files:
src/usr.bin/indent: lexi.c

Log Message:
indent: extract lexi_alnum from lexi

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.88 -r1.89 src/usr.bin/indent/lexi.c

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



CVS commit: src/usr.bin/indent

2021-10-11 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Oct 11 19:55:35 UTC 2021

Modified Files:
src/usr.bin/indent: lexi.c

Log Message:
indent: extract lexi_alnum from lexi

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.88 -r1.89 src/usr.bin/indent/lexi.c

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

Modified files:

Index: src/usr.bin/indent/lexi.c
diff -u src/usr.bin/indent/lexi.c:1.88 src/usr.bin/indent/lexi.c:1.89
--- src/usr.bin/indent/lexi.c:1.88	Sat Oct  9 20:07:37 2021
+++ src/usr.bin/indent/lexi.c	Mon Oct 11 19:55:35 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: lexi.c,v 1.88 2021/10/09 20:07:37 rillig Exp $	*/
+/*	$NetBSD: lexi.c,v 1.89 2021/10/11 19:55:35 rillig Exp $	*/
 
 /*-
  * SPDX-License-Identifier: BSD-4-Clause
@@ -43,7 +43,7 @@ static char sccsid[] = "@(#)lexi.c	8.1 (
 
 #include 
 #if defined(__NetBSD__)
-__RCSID("$NetBSD: lexi.c,v 1.88 2021/10/09 20:07:37 rillig Exp $");
+__RCSID("$NetBSD: lexi.c,v 1.89 2021/10/11 19:55:35 rillig Exp $");
 #elif defined(__FreeBSD__)
 __FBSDID("$FreeBSD: head/usr.bin/indent/lexi.c 337862 2018-08-15 18:19:45Z pstef $");
 #endif
@@ -377,137 +377,138 @@ is_typename(void)
 return bsearch_typenames(token.s) >= 0;
 }
 
-/* Reads the next token, placing it in the global variable "token". */
-token_type
-lexi(struct parser_state *state)
+static token_type
+lexi_alnum(struct parser_state *state)
 {
-bool unary_delim;		/* whether the current token forces a
- * following operator to be unary */
-token_type ttype;
-
-token.e = token.s;		/* point to start of place to save token */
-unary_delim = false;
-state->col_1 = state->last_nl;	/* tell world that this token started
-	 * in column 1 iff the last thing
-	 * scanned was a newline */
-state->last_nl = false;
+if (!(isalnum((unsigned char)*inp.s) ||
+	*inp.s == '_' || *inp.s == '$' ||
+	(inp.s[0] == '.' && isdigit((unsigned char)inp.s[1]
+	return end_of_file;
 
-while (is_hspace(*inp.s)) {
-	state->col_1 = false;
-	inbuf_skip();
+if (isdigit((unsigned char)*inp.s) ||
+	(inp.s[0] == '.' && isdigit((unsigned char)inp.s[1]))) {
+	lex_number();
+} else {
+	lex_word();
 }
+*token.e = '\0';
 
-/* Scan an alphanumeric token */
-if (isalnum((unsigned char)*inp.s) ||
-	*inp.s == '_' || *inp.s == '$' ||
-	(inp.s[0] == '.' && isdigit((unsigned char)inp.s[1]))) {
+if (token.s[0] == 'L' && token.s[1] == '\0' &&
+	(*inp.s == '"' || *inp.s == '\''))
+	return string_prefix;
 
-	if (isdigit((unsigned char)*inp.s) ||
-	(inp.s[0] == '.' && isdigit((unsigned char)inp.s[1]))) {
-	lex_number();
-	} else {
-	lex_word();
-	}
-	*token.e = '\0';
-
-	if (token.s[0] == 'L' && token.s[1] == '\0' &&
-	(*inp.s == '"' || *inp.s == '\''))
-	return lexi_end(string_prefix);
+while (is_hspace(inbuf_peek()))
+	inbuf_skip();
+state->keyword = kw_0;
 
-	while (is_hspace(inbuf_peek()))
-	inbuf_skip();
-	state->keyword = kw_0;
+if (state->last_token == keyword_struct_union_enum &&
+	state->p_l_follow == 0) {
+	state->last_u_d = true;
+	return decl;
+}
+
+/* Operator after identifier is binary unless last token was 'struct'. */
+state->last_u_d = (state->last_token == keyword_struct_union_enum);
 
-	if (state->last_token == keyword_struct_union_enum &&
-		state->p_l_follow == 0) {
+const struct keyword *kw = bsearch(token.s, keywords,
+	nitems(keywords), sizeof(keywords[0]), cmp_keyword_by_name);
+if (kw == NULL) {
+	if (is_typename()) {
+	state->keyword = kw_type;
 	state->last_u_d = true;
-	return lexi_end(decl);
+	goto found_typename;
 	}
-	/*
-	 * Operator after identifier is binary unless last token was 'struct'
-	 */
-	state->last_u_d = (state->last_token == keyword_struct_union_enum);
-
-	const struct keyword *kw = bsearch(token.s, keywords,
-	nitems(keywords), sizeof(keywords[0]), cmp_keyword_by_name);
-	if (kw == NULL) {
-	if (is_typename()) {
-		state->keyword = kw_type;
-		state->last_u_d = true;
-		goto found_typename;
+
+} else {			/* we have a keyword */
+	state->keyword = kw->kind;
+	state->last_u_d = true;
+
+	switch (kw->kind) {
+	case kw_switch:
+	return switch_expr;
+
+	case kw_case_or_default:
+	return case_label;
+
+	case kw_struct_or_union_or_enum:
+	case kw_type:
+found_typename:
+	if (state->p_l_follow != 0) {
+		/* inside parens: cast, param list, offsetof or sizeof */
+		state->cast_mask |= (1 << state->p_l_follow) & ~state->not_cast_mask;
+	}
+	if (state->last_token == period || state->last_token == unary_op) {
+		state->keyword = kw_0;
+		break;
 	}
+	if (kw != NULL && kw->kind == kw_struct_or_union_or_enum)
+		return keyword_struct_union_enum;
+	if (state->p_l_follow != 0)
+		break;
+	return decl;
 
-	} else {		/* we have a keyword */
-	state->keyword = kw->kind;
-	state->last_u_d = true;
+	case kw_for_or_if_or_wh

CVS commit: src/usr.bin/indent

2021-10-11 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Oct 11 19:04:47 UTC 2021

Modified Files:
src/usr.bin/indent: io.c

Log Message:
indent: use bool for suppress_blanklines

It only ever got assigned the values 0 and 1.

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.93 -r1.94 src/usr.bin/indent/io.c

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



CVS commit: src/usr.bin/indent

2021-10-11 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Oct 11 19:04:47 UTC 2021

Modified Files:
src/usr.bin/indent: io.c

Log Message:
indent: use bool for suppress_blanklines

It only ever got assigned the values 0 and 1.

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.93 -r1.94 src/usr.bin/indent/io.c

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

Modified files:

Index: src/usr.bin/indent/io.c
diff -u src/usr.bin/indent/io.c:1.93 src/usr.bin/indent/io.c:1.94
--- src/usr.bin/indent/io.c:1.93	Mon Oct 11 18:55:49 2021
+++ src/usr.bin/indent/io.c	Mon Oct 11 19:04:47 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: io.c,v 1.93 2021/10/11 18:55:49 rillig Exp $	*/
+/*	$NetBSD: io.c,v 1.94 2021/10/11 19:04:47 rillig Exp $	*/
 
 /*-
  * SPDX-License-Identifier: BSD-4-Clause
@@ -43,7 +43,7 @@ static char sccsid[] = "@(#)io.c	8.1 (Be
 
 #include 
 #if defined(__NetBSD__)
-__RCSID("$NetBSD: io.c,v 1.93 2021/10/11 18:55:49 rillig Exp $");
+__RCSID("$NetBSD: io.c,v 1.94 2021/10/11 19:04:47 rillig Exp $");
 #elif defined(__FreeBSD__)
 __FBSDID("$FreeBSD: head/usr.bin/indent/io.c 334927 2018-06-10 16:44:18Z pstef $");
 #endif
@@ -56,7 +56,7 @@ __FBSDID("$FreeBSD: head/usr.bin/indent/
 #include "indent.h"
 
 static int paren_indent;
-static int suppress_blanklines;
+static bool suppress_blanklines;
 
 static void
 output_char(char ch)
@@ -218,13 +218,13 @@ dump_line(void)
 }
 
 if (code.s == code.e && lab.s == lab.e && com.s == com.e) {
-	if (suppress_blanklines > 0)
-	suppress_blanklines--;
+	if (suppress_blanklines)
+	suppress_blanklines = false;
 	else
 	next_blank_lines++;
 
 } else if (!inhibit_formatting) {
-	suppress_blanklines = 0;
+	suppress_blanklines = false;
 	if (prefix_blankline_requested && !first_line) {
 	if (opt.swallow_optional_blanklines) {
 		if (next_blank_lines == 1)
@@ -391,7 +391,7 @@ parse_indent_comment(void)
 	next_blank_lines = 0;
 	postfix_blankline_requested = false;
 	prefix_blankline_requested = false;
-	suppress_blanklines = 1;
+	suppress_blanklines = true;
 }
 }
 



CVS commit: src/usr.bin/indent

2021-10-11 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Oct 11 18:55:49 UTC 2021

Modified Files:
src/usr.bin/indent: io.c

Log Message:
indent: remove dead code


To generate a diff of this commit:
cvs rdiff -u -r1.92 -r1.93 src/usr.bin/indent/io.c

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

Modified files:

Index: src/usr.bin/indent/io.c
diff -u src/usr.bin/indent/io.c:1.92 src/usr.bin/indent/io.c:1.93
--- src/usr.bin/indent/io.c:1.92	Sat Oct  9 11:13:25 2021
+++ src/usr.bin/indent/io.c	Mon Oct 11 18:55:49 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: io.c,v 1.92 2021/10/09 11:13:25 rillig Exp $	*/
+/*	$NetBSD: io.c,v 1.93 2021/10/11 18:55:49 rillig Exp $	*/
 
 /*-
  * SPDX-License-Identifier: BSD-4-Clause
@@ -43,7 +43,7 @@ static char sccsid[] = "@(#)io.c	8.1 (Be
 
 #include 
 #if defined(__NetBSD__)
-__RCSID("$NetBSD: io.c,v 1.92 2021/10/09 11:13:25 rillig Exp $");
+__RCSID("$NetBSD: io.c,v 1.93 2021/10/11 18:55:49 rillig Exp $");
 #elif defined(__FreeBSD__)
 __FBSDID("$FreeBSD: head/usr.bin/indent/io.c 334927 2018-06-10 16:44:18Z pstef $");
 #endif
@@ -55,7 +55,6 @@ __FBSDID("$FreeBSD: head/usr.bin/indent/
 
 #include "indent.h"
 
-static bool comment_open;
 static int paren_indent;
 static int suppress_blanklines;
 
@@ -107,11 +106,6 @@ dump_line_label(void)
 {
 int ind;
 
-if (comment_open) {
-	comment_open = false;
-	output_string(".*/\n");
-}
-
 while (lab.e > lab.s && is_hspace(lab.e[-1]))
 	lab.e--;
 *lab.e = '\0';
@@ -151,10 +145,6 @@ dump_line_label(void)
 static int
 dump_line_code(int ind)
 {
-if (comment_open) {
-	comment_open = false;
-	output_string(".*/\n");
-}
 
 int target_ind = compute_code_indent();
 for (int i = 0; i < ps.p_l_follow; i++) {



CVS commit: src/usr.bin/indent

2021-10-11 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Oct 11 18:55:49 UTC 2021

Modified Files:
src/usr.bin/indent: io.c

Log Message:
indent: remove dead code


To generate a diff of this commit:
cvs rdiff -u -r1.92 -r1.93 src/usr.bin/indent/io.c

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



CVS commit: src/usr.sbin/sysinst

2021-10-11 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Oct 11 18:46:34 UTC 2021

Modified Files:
src/usr.sbin/sysinst: msg_xlat.sh

Log Message:
sysinst: fix typo in comment


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/usr.sbin/sysinst/msg_xlat.sh

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

Modified files:

Index: src/usr.sbin/sysinst/msg_xlat.sh
diff -u src/usr.sbin/sysinst/msg_xlat.sh:1.5 src/usr.sbin/sysinst/msg_xlat.sh:1.6
--- src/usr.sbin/sysinst/msg_xlat.sh:1.5	Mon Jul 12 19:03:20 2021
+++ src/usr.sbin/sysinst/msg_xlat.sh	Mon Oct 11 18:46:34 2021
@@ -1,5 +1,5 @@
 #! /bin/sh
-#	$NetBSD: msg_xlat.sh,v 1.5 2021/07/12 19:03:20 kre Exp $
+#	$NetBSD: msg_xlat.sh,v 1.6 2021/10/11 18:46:34 rillig Exp $
 
 #-
 # Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -104,7 +104,7 @@ done
 
 last_msg_number="$msg_number"
 
-# Read message definition file and set up map of munbers to strings
+# Read message definition file and set up map of numbers to strings
 
 exec <&3 3<&-
 
@@ -163,7 +163,7 @@ do
 
 	# For our purposes, empty messages are the same as words without %
 	if [ $# -eq 0 ]; then set -- x; fi
-	
+
 	if $count_fmtargs; then
 		echo $number $#
 		continue



CVS commit: src/usr.sbin/sysinst

2021-10-11 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Oct 11 18:46:34 UTC 2021

Modified Files:
src/usr.sbin/sysinst: msg_xlat.sh

Log Message:
sysinst: fix typo in comment


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/usr.sbin/sysinst/msg_xlat.sh

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

2021-10-11 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Oct 11 18:39:06 UTC 2021

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

Log Message:
com: speed up close with HUPCL set

Instead of incurring a 1s penalty on close of a com device with HUPCL set,
defer the sleep until the next open, and only sleep if necessary.

This has a side effect of making `ttyflags -a` with a default install not
pause for 1s for every non-console com device, which happens every boot
via /etc/rc.d/ttys.


To generate a diff of this commit:
cvs rdiff -u -r1.365 -r1.366 src/sys/dev/ic/com.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/com.c
diff -u src/sys/dev/ic/com.c:1.365 src/sys/dev/ic/com.c:1.366
--- src/sys/dev/ic/com.c:1.365	Sat Jul 31 10:04:12 2021
+++ src/sys/dev/ic/com.c	Mon Oct 11 18:39:06 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: com.c,v 1.365 2021/07/31 10:04:12 tnn Exp $ */
+/* $NetBSD: com.c,v 1.366 2021/10/11 18:39:06 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 1998, 1999, 2004, 2008 The NetBSD Foundation, Inc.
@@ -66,7 +66,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: com.c,v 1.365 2021/07/31 10:04:12 tnn Exp $");
+__KERNEL_RCSID(0, "$NetBSD: com.c,v 1.366 2021/10/11 18:39:06 jmcneill Exp $");
 
 #include "opt_com.h"
 #include "opt_ddb.h"
@@ -891,10 +891,8 @@ com_shutdown(struct com_softc *sc)
 	 */
 	if (ISSET(tp->t_cflag, HUPCL)) {
 		com_modem(sc, 0);
-		mutex_spin_exit(&sc->sc_lock);
-		/* XXX will only timeout */
-		(void) kpause(ttclos, false, hz, NULL);
-		mutex_spin_enter(&sc->sc_lock);
+		getmicrotime(&sc->sc_hup_pending);
+		sc->sc_hup_pending.tv_sec++;
 	}
 
 	/* Turn off interrupts. */
@@ -967,6 +965,7 @@ comopen(dev_t dev, int flag, int mode, s
 	 */
 	if (!ISSET(tp->t_state, TS_ISOPEN) && tp->t_wopen == 0) {
 		struct termios t;
+		struct timeval now, diff;
 
 		tp->t_dev = dev;
 
@@ -984,6 +983,18 @@ comopen(dev_t dev, int flag, int mode, s
 			mutex_spin_enter(&sc->sc_lock);
 		}
 
+		if (timerisset(&sc->sc_hup_pending)) {
+			getmicrotime(&now);
+			while (timercmp(&now, &sc->sc_hup_pending, <)) {
+timersub(&sc->sc_hup_pending, &now, &diff);
+int ms = now.tv_sec * 1000 +
+uimin(now.tv_usec / 1000, 1);
+kpause("comopen", false, mstohz(ms),
+&sc->sc_lock);
+			}
+			timerclear(&sc->sc_hup_pending);
+		}
+
 		/* Turn on interrupts. */
 		sc->sc_ier = IER_ERXRDY | IER_ERLS;
 		if (!ISSET(tp->t_cflag, CLOCAL))



CVS commit: src/sys/dev/ic

2021-10-11 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Oct 11 18:39:06 UTC 2021

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

Log Message:
com: speed up close with HUPCL set

Instead of incurring a 1s penalty on close of a com device with HUPCL set,
defer the sleep until the next open, and only sleep if necessary.

This has a side effect of making `ttyflags -a` with a default install not
pause for 1s for every non-console com device, which happens every boot
via /etc/rc.d/ttys.


To generate a diff of this commit:
cvs rdiff -u -r1.365 -r1.366 src/sys/dev/ic/com.c

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



Re: CVS commit: src/sys/dev/wscons

2021-10-11 Thread nia
On Sun, Oct 10, 2021 at 10:44:03PM +0900, Izumi Tsutsui wrote:
> > Module Name:src
> > Committed By:   nia
> > Date:   Tue Sep 28 06:14:28 UTC 2021
> > 
> > Modified Files:
> > src/sys/dev/wscons: wsconsio.h wsmouse.c wsmousevar.h
> > 
> > Log Message:
> > wsmouse: add support for "precision scrolling" events and (GET|SET)PARAMS
> 
> Could you please also update wsmouse(4) and wsmouse(9) man pages?
> Even the current version lacks various info (especially about ioctl(2))
> but no reason to make it worse.
> 
> Thanks,
> ---
> Izumi Tsutsui

Sure, I had been meaning to anyway but I clearly forgot to commit those
files...


CVS commit: src/share/man/man9

2021-10-11 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Mon Oct 11 18:19:27 UTC 2021

Modified Files:
src/share/man/man9: wsmouse.9

Log Message:
wsmouse.9: document scrolling bits


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/share/man/man9/wsmouse.9

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

Modified files:

Index: src/share/man/man9/wsmouse.9
diff -u src/share/man/man9/wsmouse.9:1.18 src/share/man/man9/wsmouse.9:1.19
--- src/share/man/man9/wsmouse.9:1.18	Fri Dec 18 02:29:50 2020
+++ src/share/man/man9/wsmouse.9	Mon Oct 11 18:19:27 2021
@@ -1,4 +1,4 @@
-.\" $NetBSD: wsmouse.9,v 1.18 2020/12/18 02:29:50 pgoyette Exp $
+.\" $NetBSD: wsmouse.9,v 1.19 2021/10/11 18:19:27 nia Exp $
 .\"
 .\" Copyright (c) 2001 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -27,7 +27,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd November 12, 2006
+.Dd October 11, 2021
 .Dt WSMOUSE 9
 .Os
 .Sh NAME
@@ -171,6 +171,30 @@ Absolute mode in
 axis.
 .El
 .El
+.It Fn wsmouse_precision_scroll "msdev" "x" "y"
+Callback from the mouse driver to the wsmouse interface driver.
+.Pp
+This is used when higher precision scrolling events are required
+than what can be provided by a typical scroll wheel.
+This function generates
+.Dv WSCONS_EVENT_HSCROLL
+(for scrolling on the X axis) and
+.Dv WSCONS_EVENT_VSCROLL
+(for scrolling on the X axis) events.
+.Pp
+The coordinates are adjusted for speed according to the formula:
+.Li x * 4096 / scroll_unit
+.Pp
+The
+.Dv scroll_unit
+is configured through the
+.Xr wsmouse 4
+ioctl interface, specifically the
+.Dv WSMOUSEIO_SETPARAMS
+keys
+.Dv WSMOUSECFG_HORIZSCROLLDIST
+and
+.Dv WSMOUSECFG_VERTSCROLLDIST .
 .It Fn wsmousedevprint "aux" "pnp"
 The default wsmouse printing routine used by
 .Fn config_found .



CVS commit: src/share/man/man9

2021-10-11 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Mon Oct 11 18:19:27 UTC 2021

Modified Files:
src/share/man/man9: wsmouse.9

Log Message:
wsmouse.9: document scrolling bits


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/share/man/man9/wsmouse.9

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



CVS commit: src/usr.bin/msgc

2021-10-11 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Oct 11 18:08:12 UTC 2021

Modified Files:
src/usr.bin/msgc: msgc.1

Log Message:
msgc.1: fix typos


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/usr.bin/msgc/msgc.1

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

Modified files:

Index: src/usr.bin/msgc/msgc.1
diff -u src/usr.bin/msgc/msgc.1:1.26 src/usr.bin/msgc/msgc.1:1.27
--- src/usr.bin/msgc/msgc.1:1.26	Tue Mar  6 16:26:01 2012
+++ src/usr.bin/msgc/msgc.1	Mon Oct 11 18:08:12 2021
@@ -1,4 +1,4 @@
-.\"	$NetBSD: msgc.1,v 1.26 2012/03/06 16:26:01 mbalmer Exp $
+.\"	$NetBSD: msgc.1,v 1.27 2021/10/11 18:08:12 rillig Exp $
 .\"
 .\" Copyright 1997 Piermont Information Systems Inc.
 .\" All rights reserved.
@@ -29,7 +29,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
 .\" THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd March 3, 2012
+.Dd October 11, 2021
 .Dt MSGC 1
 .Os
 .Sh NAME
@@ -114,18 +114,17 @@ Each message is started with the word
 followed by the name of the message.
 The body of the message is next and is started by a { and closed by a }.
 The braces are not part of the message.
-Everything, including newlines between the braces are part of the message.
+Everything, including newlines between the braces, is part of the message.
 .Sh MESSAGE FUNCTIONS
-The defined messages are used through calls routines that manipulate
+The defined messages are used through calls to routines that manipulate
 the messages.
 You first need to set the
 .Xr curses 3
 environment up and then tell the message system which window to use
-for displaying message by calling the function
+for displaying the messages by calling the function
 .Fn msg_window .
 .Pp
-All variable argument lists in the functions are used as
-are arguments to
+All variable argument lists in the functions are used as arguments to
 .Xr sprintf 3 .
 The messages may have
 .Xr sprintf 3
@@ -135,7 +134,7 @@ Messages are identified by name using th
 where
 .Dq name
 is the name in the message source file.
-(The definitions are accessed by including the generated .h file into a
+(The definitions are accessed by including the generated .h file into each
 source file wanting to use the message routines.)
 .Pp
 The function
@@ -153,7 +152,7 @@ The functions
 .Fn msg_display
 and
 .Fn msg_display_add
-cause a defined message to be displayed in the message window and does
+cause the given message to be displayed in the message window and do
 the requested conversions before printing.
 The difference is that
 .Fn msg_display
@@ -199,7 +198,7 @@ The functions
 .Fn msg_echo
 and
 .Fn msg_noecho
-control whether the prompt routine echo or don't echo the input that
+control whether the prompt routines echo or don't echo the input that
 is typed by the user.
 .Pp
 .Fn msg_prompt_win



CVS commit: src/usr.bin/msgc

2021-10-11 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Oct 11 18:08:12 UTC 2021

Modified Files:
src/usr.bin/msgc: msgc.1

Log Message:
msgc.1: fix typos


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/usr.bin/msgc/msgc.1

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



CVS commit: src/share/man/man4

2021-10-11 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Mon Oct 11 18:06:06 UTC 2021

Modified Files:
src/share/man/man4: wsmouse.4

Log Message:
wsmouse.4: document newer ioctls

accidentally missing from a previous commit, pointed out by tsutsui


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/share/man/man4/wsmouse.4

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

Modified files:

Index: src/share/man/man4/wsmouse.4
diff -u src/share/man/man4/wsmouse.4:1.22 src/share/man/man4/wsmouse.4:1.23
--- src/share/man/man4/wsmouse.4:1.22	Sun May 27 12:05:40 2012
+++ src/share/man/man4/wsmouse.4	Mon Oct 11 18:06:06 2021
@@ -1,4 +1,4 @@
-.\" $NetBSD: wsmouse.4,v 1.22 2012/05/27 12:05:40 wiz Exp $
+.\" $NetBSD: wsmouse.4,v 1.23 2021/10/11 18:06:06 nia Exp $
 .\"
 .\" Copyright (c) 1999
 .\" 	Matthias Drochner.  All rights reserved.
@@ -27,7 +27,7 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.Dd May 27, 2012
+.Dd September 25, 2021
 .Dt WSMOUSE 4
 .Os
 .Sh NAME
@@ -78,6 +78,36 @@ driver or by devices which use it.
 Their definitions are found in
 .Pa dev/wscons/wsconsio.h .
 .Bl -tag -width Dv
+.It Dv WSMOUSEIO_GETPARAMS Pq Li "struct wsmouse_parameters"
+.It Dv WSMOUSEIO_SETPARAMS Pq Li "struct wsmouse_parameters"
+Obtain and set various mouse parameters as a key/value set.
+Currently these primarily relate to touchpads.
+The structure
+.Vt struct wsmouse_parameters
+is defined as follows:
+.Bd -literal -offset indent
+struct wsmouse_param {
+	enum wsmousecfg key;
+	int value;
+};
+
+struct wsmouse_parameters {
+	struct wsmouse_param *params;
+	unsigned int nparams;
+};
+.Ed
+.Pp
+The number of parameters to read or write must be specified in
+.Va nparams .
+For each parameter, when
+.Dv WSMOUSEIO_GETPARAMS
+is used, a key must be specified.
+When
+.Dv WSMOUSEIO_SETPARAMS
+is used, a key and a value must be specified.
+A single ioctl may retrieve up to
+.Dv WSMOUSECFG_MAX
+.Va nparams .
 .It Dv WSMOUSEIO_GETREPEAT Pq Li "struct wsmouse_repeat"
 Retrieve the current automatic button repeating configuration.
 The structure returned is as follows:



CVS commit: src/share/man/man4

2021-10-11 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Mon Oct 11 18:06:06 UTC 2021

Modified Files:
src/share/man/man4: wsmouse.4

Log Message:
wsmouse.4: document newer ioctls

accidentally missing from a previous commit, pointed out by tsutsui


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/share/man/man4/wsmouse.4

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



CVS commit: src/usr.sbin/sysinst

2021-10-11 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Oct 11 17:23:28 UTC 2021

Modified Files:
src/usr.sbin/sysinst: msg.entropy.de

Log Message:
sysinst: proofread German entropy translation


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/usr.sbin/sysinst/msg.entropy.de

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

Modified files:

Index: src/usr.sbin/sysinst/msg.entropy.de
diff -u src/usr.sbin/sysinst/msg.entropy.de:1.3 src/usr.sbin/sysinst/msg.entropy.de:1.4
--- src/usr.sbin/sysinst/msg.entropy.de:1.3	Fri Oct  8 15:59:55 2021
+++ src/usr.sbin/sysinst/msg.entropy.de	Mon Oct 11 17:23:28 2021
@@ -1,4 +1,4 @@
-/*  $NetBSD: msg.entropy.de,v 1.3 2021/10/08 15:59:55 martin Exp $  */
+/*  $NetBSD: msg.entropy.de,v 1.4 2021/10/11 17:23:28 rillig Exp $  */
 
 /*
  * Copyright (c) 2020 The NetBSD Foundation, Inc.
@@ -28,7 +28,7 @@
 
 message Configure_entropy	{Entropie konfigurieren}
 
-message continue_without_entropy	{Weiter ohne Entropy}
+message continue_without_entropy	{Weiter ohne Entropie}
 
 message not_enough_entropy
 {Dieses System scheint nicht über einen Pseudo-Zufallszahlengenerator
@@ -39,12 +39,12 @@ Am einfachsten generieren Sie Zufallsdat
 und laden sie in dieser Installation. Alternativ können Sie auch
 manuell Zufallsdaten eingeben. 
  
-Falls Sie einen USB Zufallsgenerator besitzen, verbinden Sie diesen
+Falls Sie einen USB-Zufallsgenerator besitzen, verbinden Sie diesen
 jetzt und wählen dann die Option "Erneut testen".}
 
 message entropy_add_manually		{Manuelle Zufallseingabe}
 message entropy_download_raw		{Rohe binäre Zufallsdaten laden}
-message	entropy_download_seed		{NetBSD Entropie-Datei laden}
+message	entropy_download_seed		{NetBSD-Entropie-Datei laden}
 message entropy_retry			{Erneut testen}
 
 message entropy_enter_manual1
@@ -52,13 +52,13 @@ message entropy_enter_manual1
 in denen genug Entropie enthalten sein sollte, die 256 Münzwürfen,
 100 Würfen mit einem sechsseitigen Würfel oder 64 zufälligen hexadezimalen
 Zeichen entspricht.}
- 
+
 message entropy_enter_manual2
 {Falls Sie Daten von einem anderen System per Kopieren & Einfügen in dieses
 Installationsprogramm übertragen können, können Sie die Ausgabe des
-folgenden Kommandos (auf einem System dessen Entropie Sie vertrauen)
+folgenden Befehls (auf einem System, dessen Entropie Sie vertrauen)
 verwenden:}
- 
+
 message entropy_enter_manual3
 {Benutzen Sie nicht die gleiche Eingabe für mehrere Installationen. 
 Beenden Sie die Eingabe mit einer leeren Zeile.}
@@ -67,7 +67,7 @@ message entropy_manual_not_enough
 {Sie haben nicht genug Zeichen eingegeben!}
 
 message entropy_select_file
-{Wählen Sie auf welche Art Sie die Zufallsdaten auf diesen Computer
+{Wählen Sie, auf welche Art Sie die Zufallsdaten auf diesen Computer
 übertragen wollen:}
 
 message entropy_add_download_ftp
@@ -77,7 +77,7 @@ message entropy_add_download_http
 {Download per http}
 
 message entropy_add_nfs
-{Von einer NFS Freigabe laden}
+{Von einer NFS-Freigabe laden}
 
 message download_entropy
 {Download starten}
@@ -92,34 +92,34 @@ message load_entropy
 {Zufallsdatei laden}
 
 message set_entropy_file
-{Pfad der Zuffalsdatei}
+{Pfad der Zufallsdatei}
 
 /* Called with:Example
  *  $0 = content of file		NetBSD entropy seed file
  */
 message entropy_via_nfs
-{Wählen Sie Server, Freigabe und Dateipfad von dem die $0 geladen werden kann.}
+{Wählen Sie Server, Freigabe und Dateipfad, von dem die $0 geladen werden kann.}
 
 /* Called with:Example
  *  $0 = content of file		NetBSD entropy seed file
  */
 message entropy_via_download
 {Da derzeit auf diesem System nicht genug Entropie vorhanden ist, sind alle
-kryptographischen Operation durch replay-Attacken angreifbar. 
+kryptographischen Operation durch Replay-Attacken angreifbar. 
 Verwenden Sie nur lokale vertrauenswürdige Netzwerke.}
 
 message entropy_data
-{Binärdatei mit Zuffallsdaten}
+{Binärdatei mit Zufallsdaten}
 
 message entropy_data_hdr
 {Auf einem System mit kryptographisch starkem Zufallszahlengenerator
 können Sie zufällige Binärdaten z.B. so erzeugen:}
 
 message entropy_seed
-{NetBSD entropy Datei}
+{NetBSD-Entropie-Datei}
 
 message entropy_seed_hdr
-{Auf einem NetBSD System mit kryptographisch starkem Zufallszahlengenerator
+{Auf einem NetBSD-System mit kryptographisch starkem Zufallszahlengenerator
 können Sie einen Entropie-Schnappschuss folgendermaßen erstellen:}
 
 message entropy_path_and_file
@@ -128,4 +128,3 @@ message entropy_path_and_file
 message entropy_localfs
 {Geben Sie das noch nicht gemountete lokale Gerät und dessen entsprechendes
 Verzeichnis an, in dem die Zufallsdatei zu finden ist.}
-



CVS commit: src/usr.sbin/sysinst

2021-10-11 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Oct 11 17:23:28 UTC 2021

Modified Files:
src/usr.sbin/sysinst: msg.entropy.de

Log Message:
sysinst: proofread German entropy translation


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/usr.sbin/sysinst/msg.entropy.de

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



CVS commit: src/tests/usr.bin/indent

2021-10-11 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Oct 11 17:02:55 UTC 2021

Modified Files:
src/tests/usr.bin/indent: opt-nsob.0 opt-nsob.0.stdout opt-sob.0
opt-sob.0.stdout

Log Message:
tests/indent: finally found some "optional" blank lines


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/usr.bin/indent/opt-nsob.0 \
src/tests/usr.bin/indent/opt-nsob.0.stdout
cvs rdiff -u -r1.3 -r1.4 src/tests/usr.bin/indent/opt-sob.0 \
src/tests/usr.bin/indent/opt-sob.0.stdout

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



CVS commit: src/tests/usr.bin/indent

2021-10-11 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Oct 11 17:02:55 UTC 2021

Modified Files:
src/tests/usr.bin/indent: opt-nsob.0 opt-nsob.0.stdout opt-sob.0
opt-sob.0.stdout

Log Message:
tests/indent: finally found some "optional" blank lines


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/usr.bin/indent/opt-nsob.0 \
src/tests/usr.bin/indent/opt-nsob.0.stdout
cvs rdiff -u -r1.3 -r1.4 src/tests/usr.bin/indent/opt-sob.0 \
src/tests/usr.bin/indent/opt-sob.0.stdout

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

Modified files:

Index: src/tests/usr.bin/indent/opt-nsob.0
diff -u src/tests/usr.bin/indent/opt-nsob.0:1.2 src/tests/usr.bin/indent/opt-nsob.0:1.3
--- src/tests/usr.bin/indent/opt-nsob.0:1.2	Sun Mar  7 10:12:18 2021
+++ src/tests/usr.bin/indent/opt-nsob.0	Mon Oct 11 17:02:55 2021
@@ -1,12 +1,39 @@
-/* $NetBSD: opt-nsob.0,v 1.2 2021/03/07 10:12:18 rillig Exp $ */
+/* $NetBSD: opt-nsob.0,v 1.3 2021/10/11 17:02:55 rillig Exp $ */
 /* $FreeBSD$ */
 
 void		function_declaration(void);
 
 
+int
+function_with_0_blank_lines(void)
+{
+	int		var;
+	var = value;
+	if (var > 0)
+		var--;
+	return var;
+}
+
+int
+function_with_1_blank_line(void)
+{
+
+	int		var;
+
+	var = value;
+
+	if (var > 0)
+/* $ The following line is "optional" but is not removed due to '-nsob'. */
+
+		var--;
+
+	return var;
+
+}
+
 
 int
-function_definition(void)
+function_with_2_blank_lines(void)
 {
 
 
@@ -16,6 +43,13 @@ function_definition(void)
 	var = value;
 
 
+	if (var > 0)
+/* $ The following 2 lines are "optional" and are not removed due to '-nsob'. */
+
+
+	var--;
+
+
 	return var;
 
 
Index: src/tests/usr.bin/indent/opt-nsob.0.stdout
diff -u src/tests/usr.bin/indent/opt-nsob.0.stdout:1.2 src/tests/usr.bin/indent/opt-nsob.0.stdout:1.3
--- src/tests/usr.bin/indent/opt-nsob.0.stdout:1.2	Sun Mar  7 10:12:18 2021
+++ src/tests/usr.bin/indent/opt-nsob.0.stdout	Mon Oct 11 17:02:55 2021
@@ -1,12 +1,38 @@
-/* $NetBSD: opt-nsob.0.stdout,v 1.2 2021/03/07 10:12:18 rillig Exp $ */
+/* $NetBSD: opt-nsob.0.stdout,v 1.3 2021/10/11 17:02:55 rillig Exp $ */
 /* $FreeBSD$ */
 
 void		function_declaration(void);
 
 
+int
+function_with_0_blank_lines(void)
+{
+	int		var;
+	var = value;
+	if (var > 0)
+		var--;
+	return var;
+}
+
+int
+function_with_1_blank_line(void)
+{
+
+	int		var;
+
+	var = value;
+
+	if (var > 0)
+
+		var--;
+
+	return var;
+
+}
+
 
 int
-function_definition(void)
+function_with_2_blank_lines(void)
 {
 
 
@@ -16,6 +42,12 @@ function_definition(void)
 	var = value;
 
 
+	if (var > 0)
+
+
+		var--;
+
+
 	return var;
 
 

Index: src/tests/usr.bin/indent/opt-sob.0
diff -u src/tests/usr.bin/indent/opt-sob.0:1.3 src/tests/usr.bin/indent/opt-sob.0:1.4
--- src/tests/usr.bin/indent/opt-sob.0:1.3	Mon Oct 11 16:30:54 2021
+++ src/tests/usr.bin/indent/opt-sob.0	Mon Oct 11 17:02:55 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: opt-sob.0,v 1.3 2021/10/11 16:30:54 rillig Exp $ */
+/* $NetBSD: opt-sob.0,v 1.4 2021/10/11 17:02:55 rillig Exp $ */
 /* $FreeBSD$ */
 
 /* $ FIXME: There are lots of 'optional blank lines' here that should */
@@ -9,20 +9,27 @@ void		function_declaration(void);
 int
 function_with_0_blank_lines(void)
 {
-int		var;
-var = value;
-return var;
+	int		var;
+	var = value;
+	if (var > 0)
+		var--;
+	return var;
 }
 
 int
 function_with_1_blank_line(void)
 {
 
-int		var;
+	int		var;
+
+	var = value;
+
+	if (var > 0)
+/* $ The following line is "optional" and is removed due to '-sob'. */
 
-var = value;
+		var--;
 
-return var;
+	return var;
 
 }
 
@@ -38,6 +45,13 @@ function_with_2_blank_lines(void)
 	var = value;
 
 
+	if (var > 0)
+/* $ The following 2 lines are "optional" and are removed due to '-sob'. */
+
+
+	var--;
+
+
 	return var;
 
 
Index: src/tests/usr.bin/indent/opt-sob.0.stdout
diff -u src/tests/usr.bin/indent/opt-sob.0.stdout:1.3 src/tests/usr.bin/indent/opt-sob.0.stdout:1.4
--- src/tests/usr.bin/indent/opt-sob.0.stdout:1.3	Mon Oct 11 16:30:54 2021
+++ src/tests/usr.bin/indent/opt-sob.0.stdout	Mon Oct 11 17:02:55 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: opt-sob.0.stdout,v 1.3 2021/10/11 16:30:54 rillig Exp $ */
+/* $NetBSD: opt-sob.0.stdout,v 1.4 2021/10/11 17:02:55 rillig Exp $ */
 /* $FreeBSD$ */
 
 void		function_declaration(void);
@@ -9,6 +9,8 @@ function_with_0_blank_lines(void)
 {
 	int		var;
 	var = value;
+	if (var > 0)
+		var--;
 	return var;
 }
 
@@ -20,6 +22,9 @@ function_with_1_blank_line(void)
 
 	var = value;
 
+	if (var > 0)
+		var--;
+
 	return var;
 
 }
@@ -36,6 +41,10 @@ function_with_2_blank_lines(void)
 	var = value;
 
 
+	if (var > 0)
+		var--;
+
+
 	return var;
 
 



CVS commit: src/tests/usr.bin/indent

2021-10-11 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Oct 11 16:30:54 UTC 2021

Modified Files:
src/tests/usr.bin/indent: opt-sob.0 opt-sob.0.stdout

Log Message:
tests/indent: add more tests for -sob; nothing is swallowed at all


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/usr.bin/indent/opt-sob.0 \
src/tests/usr.bin/indent/opt-sob.0.stdout

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

Modified files:

Index: src/tests/usr.bin/indent/opt-sob.0
diff -u src/tests/usr.bin/indent/opt-sob.0:1.2 src/tests/usr.bin/indent/opt-sob.0:1.3
--- src/tests/usr.bin/indent/opt-sob.0:1.2	Sun Mar  7 10:12:18 2021
+++ src/tests/usr.bin/indent/opt-sob.0	Mon Oct 11 16:30:54 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: opt-sob.0,v 1.2 2021/03/07 10:12:18 rillig Exp $ */
+/* $NetBSD: opt-sob.0,v 1.3 2021/10/11 16:30:54 rillig Exp $ */
 /* $FreeBSD$ */
 
 /* $ FIXME: There are lots of 'optional blank lines' here that should */
@@ -6,9 +6,29 @@
 void		function_declaration(void);
 
 
+int
+function_with_0_blank_lines(void)
+{
+int		var;
+var = value;
+return var;
+}
+
+int
+function_with_1_blank_line(void)
+{
+
+int		var;
+
+var = value;
+
+return var;
+
+}
+
 
 int
-function_definition(void)
+function_with_2_blank_lines(void)
 {
 
 
Index: src/tests/usr.bin/indent/opt-sob.0.stdout
diff -u src/tests/usr.bin/indent/opt-sob.0.stdout:1.2 src/tests/usr.bin/indent/opt-sob.0.stdout:1.3
--- src/tests/usr.bin/indent/opt-sob.0.stdout:1.2	Sun Mar  7 10:12:18 2021
+++ src/tests/usr.bin/indent/opt-sob.0.stdout	Mon Oct 11 16:30:54 2021
@@ -1,12 +1,32 @@
-/* $NetBSD: opt-sob.0.stdout,v 1.2 2021/03/07 10:12:18 rillig Exp $ */
+/* $NetBSD: opt-sob.0.stdout,v 1.3 2021/10/11 16:30:54 rillig Exp $ */
 /* $FreeBSD$ */
 
 void		function_declaration(void);
 
 
+int
+function_with_0_blank_lines(void)
+{
+	int		var;
+	var = value;
+	return var;
+}
+
+int
+function_with_1_blank_line(void)
+{
+
+	int		var;
+
+	var = value;
+
+	return var;
+
+}
+
 
 int
-function_definition(void)
+function_with_2_blank_lines(void)
 {
 
 



CVS commit: src/tests/usr.bin/indent

2021-10-11 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Oct 11 16:30:54 UTC 2021

Modified Files:
src/tests/usr.bin/indent: opt-sob.0 opt-sob.0.stdout

Log Message:
tests/indent: add more tests for -sob; nothing is swallowed at all


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/usr.bin/indent/opt-sob.0 \
src/tests/usr.bin/indent/opt-sob.0.stdout

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

2021-10-11 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Oct 11 15:47:10 UTC 2021

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

Log Message:
Add Intel 500 Series PCH-H SMBus.


To generate a diff of this commit:
cvs rdiff -u -r1.72 -r1.73 src/sys/dev/pci/ichsmb.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/ichsmb.c
diff -u src/sys/dev/pci/ichsmb.c:1.72 src/sys/dev/pci/ichsmb.c:1.73
--- src/sys/dev/pci/ichsmb.c:1.72	Sat Aug  7 16:19:14 2021
+++ src/sys/dev/pci/ichsmb.c	Mon Oct 11 15:47:10 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: ichsmb.c,v 1.72 2021/08/07 16:19:14 thorpej Exp $	*/
+/*	$NetBSD: ichsmb.c,v 1.73 2021/10/11 15:47:10 msaitoh Exp $	*/
 /*	$OpenBSD: ichiic.c,v 1.44 2020/10/07 11:23:05 jsg Exp $	*/
 
 /*
@@ -22,7 +22,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ichsmb.c,v 1.72 2021/08/07 16:19:14 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ichsmb.c,v 1.73 2021/10/11 15:47:10 msaitoh Exp $");
 
 #include 
 #include 
@@ -149,6 +149,7 @@ ichsmb_match(device_t parent, cfdata_t m
 		case PCI_PRODUCT_INTEL_C2000_PCU_SMBUS:
 		case PCI_PRODUCT_INTEL_C3K_SMBUS_LEGACY:
 		case PCI_PRODUCT_INTEL_495_YU_SMB:
+		case PCI_PRODUCT_INTEL_5HS_H_SMB:
 		case PCI_PRODUCT_INTEL_5HS_LP_SMB:
 			return 1;
 		}



CVS commit: src/sys/dev/pci

2021-10-11 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Oct 11 15:47:10 UTC 2021

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

Log Message:
Add Intel 500 Series PCH-H SMBus.


To generate a diff of this commit:
cvs rdiff -u -r1.72 -r1.73 src/sys/dev/pci/ichsmb.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

2021-10-11 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Oct 11 15:43:20 UTC 2021

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

Log Message:
Add some Intel KT devices.


To generate a diff of this commit:
cvs rdiff -u -r1.110 -r1.111 src/sys/dev/pci/pucdata.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/pucdata.c
diff -u src/sys/dev/pci/pucdata.c:1.110 src/sys/dev/pci/pucdata.c:1.111
--- src/sys/dev/pci/pucdata.c:1.110	Sat Jul 17 10:45:58 2021
+++ src/sys/dev/pci/pucdata.c	Mon Oct 11 15:43:19 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: pucdata.c,v 1.110 2021/07/17 10:45:58 riastradh Exp $	*/
+/*	$NetBSD: pucdata.c,v 1.111 2021/10/11 15:43:19 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 1998, 1999 Christopher G. Demetriou.  All rights reserved.
@@ -36,7 +36,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pucdata.c,v 1.110 2021/07/17 10:45:58 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pucdata.c,v 1.111 2021/10/11 15:43:19 msaitoh Exp $");
 
 #include 
 #include 
@@ -2028,6 +2028,42 @@ const struct puc_device_description puc_
 	},
 	},
 
+	/* Intel Comet Lake KT */
+	{   "Intel Comet Lake KT",
+	{	PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_CMTLK_KT, 0, 0 },
+	{	0x,	0x,	0,	0	},
+	{
+		{ PUC_PORT_TYPE_COM, PCI_BAR0, 0x00, COM_FREQ },
+	},
+	},
+
+	/* Intel 400 Series (H) KT */
+	{   "Intel 400 Series (H) KT",
+	{	PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_4HS_H_KT, 0, 0 },
+	{	0x,	0x,	0,	0	},
+	{
+		{ PUC_PORT_TYPE_COM, PCI_BAR0, 0x00, COM_FREQ },
+	},
+	},
+
+	/* Intel 495 Series KT */
+	{   "Intel 495 Series KT",
+	{	PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_495_YU_KT, 0, 0 },
+	{	0x,	0x,	0,	0	},
+	{
+		{ PUC_PORT_TYPE_COM, PCI_BAR0, 0x00, COM_FREQ },
+	},
+	},
+
+	/* Intel 500 Series (H) KT */
+	{   "Intel 500 Series (H) KT",
+	{	PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_5HS_H_KT, 0, 0 },
+	{	0x,	0x,	0,	0	},
+	{
+		{ PUC_PORT_TYPE_COM, PCI_BAR0, 0x00, COM_FREQ },
+	},
+	},
+	
 	/* Intel C600/X79 Series KT */
 	{   "Intel C600/X79 Series KT",
 	{	PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_C600_KT, 0, 0 },



CVS commit: src/sys/dev/pci

2021-10-11 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Oct 11 15:43:20 UTC 2021

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

Log Message:
Add some Intel KT devices.


To generate a diff of this commit:
cvs rdiff -u -r1.110 -r1.111 src/sys/dev/pci/pucdata.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

2021-10-11 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Oct 11 15:11:50 UTC 2021

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

Log Message:
Avoid unaligned access in rge_get_macaddr(). Found by kUBSan.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/dev/pci/if_rge.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/if_rge.c
diff -u src/sys/dev/pci/if_rge.c:1.21 src/sys/dev/pci/if_rge.c:1.22
--- src/sys/dev/pci/if_rge.c:1.21	Mon Oct 11 15:11:07 2021
+++ src/sys/dev/pci/if_rge.c	Mon Oct 11 15:11:49 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_rge.c,v 1.21 2021/10/11 15:11:07 msaitoh Exp $	*/
+/*	$NetBSD: if_rge.c,v 1.22 2021/10/11 15:11:49 msaitoh Exp $	*/
 /*	$OpenBSD: if_rge.c,v 1.9 2020/12/12 11:48:53 jan Exp $	*/
 
 /*
@@ -18,7 +18,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_rge.c,v 1.21 2021/10/11 15:11:07 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_rge.c,v 1.22 2021/10/11 15:11:49 msaitoh Exp $");
 
 #include 
 
@@ -2077,8 +2077,10 @@ rge_set_macaddr(struct rge_softc *sc, co
 void
 rge_get_macaddr(struct rge_softc *sc, uint8_t *addr)
 {
-	*(uint32_t *)&addr[0] = RGE_READ_4(sc, RGE_ADDR0);
-	*(uint16_t *)&addr[4] = RGE_READ_2(sc, RGE_ADDR1);
+	int i;
+
+	for (i = 0; i < ETHER_ADDR_LEN; i++)
+		addr[i] = RGE_READ_1(sc, RGE_ADDR0 + i);
 }
 
 void



CVS commit: src/sys/dev/pci

2021-10-11 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Oct 11 15:11:50 UTC 2021

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

Log Message:
Avoid unaligned access in rge_get_macaddr(). Found by kUBSan.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/dev/pci/if_rge.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

2021-10-11 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Oct 11 15:11:07 UTC 2021

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

Log Message:
Use unsigned to avoid undefined behavior. Found by kUBSan.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/dev/pci/if_rge.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/if_rge.c
diff -u src/sys/dev/pci/if_rge.c:1.20 src/sys/dev/pci/if_rge.c:1.21
--- src/sys/dev/pci/if_rge.c:1.20	Mon Oct 11 15:10:19 2021
+++ src/sys/dev/pci/if_rge.c	Mon Oct 11 15:11:07 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_rge.c,v 1.20 2021/10/11 15:10:19 msaitoh Exp $	*/
+/*	$NetBSD: if_rge.c,v 1.21 2021/10/11 15:11:07 msaitoh Exp $	*/
 /*	$OpenBSD: if_rge.c,v 1.9 2020/12/12 11:48:53 jan Exp $	*/
 
 /*
@@ -18,7 +18,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_rge.c,v 1.20 2021/10/11 15:10:19 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_rge.c,v 1.21 2021/10/11 15:11:07 msaitoh Exp $");
 
 #include 
 
@@ -1503,9 +1503,9 @@ rge_iff(struct rge_softc *sc)
 			ETHER_ADDR_LEN) >> 26;
 
 			if (h < 32)
-hashes[0] |= (1 << h);
+hashes[0] |= (1U << h);
 			else
-hashes[1] |= (1 << (h - 32));
+hashes[1] |= (1U << (h - 32));
 
 			ETHER_NEXT_MULTI(step, enm);
 		}
@@ -2068,7 +2068,7 @@ rge_set_macaddr(struct rge_softc *sc, co
 {
 	RGE_SETBIT_1(sc, RGE_EECMD, RGE_EECMD_WRITECFG);
 	RGE_WRITE_4(sc, RGE_MAC0,
-	addr[3] << 24 | addr[2] << 16 | addr[1] << 8 | addr[0]);
+	(uint32_t)addr[3] << 24 | addr[2] << 16 | addr[1] << 8 | addr[0]);
 	RGE_WRITE_4(sc, RGE_MAC4,
 	addr[5] <<  8 | addr[4]);
 	RGE_CLRBIT_1(sc, RGE_EECMD, RGE_EECMD_WRITECFG);



CVS commit: src/sys/dev/pci

2021-10-11 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Oct 11 15:11:07 UTC 2021

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

Log Message:
Use unsigned to avoid undefined behavior. Found by kUBSan.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/dev/pci/if_rge.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

2021-10-11 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Oct 11 15:10:19 UTC 2021

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

Log Message:
Add pmf_device_register().


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/dev/pci/if_rge.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

2021-10-11 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Oct 11 15:10:19 UTC 2021

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

Log Message:
Add pmf_device_register().


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/dev/pci/if_rge.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/if_rge.c
diff -u src/sys/dev/pci/if_rge.c:1.19 src/sys/dev/pci/if_rge.c:1.20
--- src/sys/dev/pci/if_rge.c:1.19	Sat May  8 00:27:02 2021
+++ src/sys/dev/pci/if_rge.c	Mon Oct 11 15:10:19 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_rge.c,v 1.19 2021/05/08 00:27:02 thorpej Exp $	*/
+/*	$NetBSD: if_rge.c,v 1.20 2021/10/11 15:10:19 msaitoh Exp $	*/
 /*	$OpenBSD: if_rge.c,v 1.9 2020/12/12 11:48:53 jan Exp $	*/
 
 /*
@@ -18,7 +18,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_rge.c,v 1.19 2021/05/08 00:27:02 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_rge.c,v 1.20 2021/10/11 15:10:19 msaitoh Exp $");
 
 #include 
 
@@ -352,6 +352,11 @@ rge_attach(device_t parent, device_t sel
 
 	if_attach(ifp);
 	ether_ifattach(ifp, eaddr);
+
+	if (pmf_device_register(self, NULL, NULL))
+		pmf_class_network_register(self, ifp);
+	else
+		aprint_error_dev(self, "couldn't establish power handler\n");
 }
 
 int



CVS commit: src/sys/dev/pci

2021-10-11 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Oct 11 15:08:17 UTC 2021

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

Log Message:
Add pmf_device_register().


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/sys/dev/pci/if_aq.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/if_aq.c
diff -u src/sys/dev/pci/if_aq.c:1.28 src/sys/dev/pci/if_aq.c:1.29
--- src/sys/dev/pci/if_aq.c:1.28	Tue Oct  5 14:18:17 2021
+++ src/sys/dev/pci/if_aq.c	Mon Oct 11 15:08:17 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_aq.c,v 1.28 2021/10/05 14:18:17 ryo Exp $	*/
+/*	$NetBSD: if_aq.c,v 1.29 2021/10/11 15:08:17 msaitoh Exp $	*/
 
 /**
  * aQuantia Corporation Network Driver
@@ -62,7 +62,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_aq.c,v 1.28 2021/10/05 14:18:17 ryo Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_aq.c,v 1.29 2021/10/11 15:08:17 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_if_aq.h"
@@ -1530,6 +1530,11 @@ aq_attach(device_t parent, device_t self
 	AQ_EVCNT_ATTACH_MISC(sc, cprc, "RX coalesced packet");
 #endif
 
+	if (pmf_device_register(self, NULL, NULL))
+		pmf_class_network_register(self, ifp);
+	else
+		aprint_error_dev(self, "couldn't establish power handler\n");
+
 	return;
 
  attach_failure:



CVS commit: src/sys/dev/pci

2021-10-11 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Oct 11 15:08:17 UTC 2021

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

Log Message:
Add pmf_device_register().


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/sys/dev/pci/if_aq.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/hpcarm/hpcarm

2021-10-11 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Oct 11 14:36:05 UTC 2021

Modified Files:
src/sys/arch/hpcarm/hpcarm: sa11x0_hpc_machdep.c

Log Message:
alloc_pages: panic if allocating beyond KERNEL_TEXT_BASE.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/hpcarm/hpcarm/sa11x0_hpc_machdep.c

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



CVS commit: src/sys/arch/hpcarm/hpcarm

2021-10-11 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Oct 11 14:36:05 UTC 2021

Modified Files:
src/sys/arch/hpcarm/hpcarm: sa11x0_hpc_machdep.c

Log Message:
alloc_pages: panic if allocating beyond KERNEL_TEXT_BASE.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/hpcarm/hpcarm/sa11x0_hpc_machdep.c

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

Modified files:

Index: src/sys/arch/hpcarm/hpcarm/sa11x0_hpc_machdep.c
diff -u src/sys/arch/hpcarm/hpcarm/sa11x0_hpc_machdep.c:1.20 src/sys/arch/hpcarm/hpcarm/sa11x0_hpc_machdep.c:1.21
--- src/sys/arch/hpcarm/hpcarm/sa11x0_hpc_machdep.c:1.20	Mon Oct 11 14:33:31 2021
+++ src/sys/arch/hpcarm/hpcarm/sa11x0_hpc_machdep.c	Mon Oct 11 14:36:05 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: sa11x0_hpc_machdep.c,v 1.20 2021/10/11 14:33:31 rin Exp $	*/
+/*	$NetBSD: sa11x0_hpc_machdep.c,v 1.21 2021/10/11 14:36:05 rin Exp $	*/
 
 /*
  * Copyright (c) 1994-1998 Mark Brinicombe.
@@ -40,7 +40,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sa11x0_hpc_machdep.c,v 1.20 2021/10/11 14:33:31 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sa11x0_hpc_machdep.c,v 1.21 2021/10/11 14:36:05 rin Exp $");
 
 #include "opt_ddb.h"
 #include "opt_dram_pages.h"
@@ -286,6 +286,8 @@ init_sa11x0(int argc, char **argv, struc
 do {\
 	(var) = freemempos;		\
 	freemempos += (np) * PAGE_SIZE;	\
+	if (freemempos > KERNEL_TEXT_BASE)\
+		panic("%s: out of memory", __func__);			\
 } while (0)
 
 	valloc_pages(kernel_l1pt, L1_TABLE_SIZE / PAGE_SIZE);



CVS commit: src/sys/arch/hpcarm/hpcarm

2021-10-11 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Oct 11 14:33:31 UTC 2021

Modified Files:
src/sys/arch/hpcarm/hpcarm: sa11x0_hpc_machdep.c

Log Message:
Wrap multi-line macros with ``do { } while(0)''.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/hpcarm/hpcarm/sa11x0_hpc_machdep.c

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



CVS commit: src/sys/arch/hpcarm/hpcarm

2021-10-11 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Oct 11 14:33:31 UTC 2021

Modified Files:
src/sys/arch/hpcarm/hpcarm: sa11x0_hpc_machdep.c

Log Message:
Wrap multi-line macros with ``do { } while(0)''.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/hpcarm/hpcarm/sa11x0_hpc_machdep.c

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

Modified files:

Index: src/sys/arch/hpcarm/hpcarm/sa11x0_hpc_machdep.c
diff -u src/sys/arch/hpcarm/hpcarm/sa11x0_hpc_machdep.c:1.19 src/sys/arch/hpcarm/hpcarm/sa11x0_hpc_machdep.c:1.20
--- src/sys/arch/hpcarm/hpcarm/sa11x0_hpc_machdep.c:1.19	Mon Oct 11 14:30:30 2021
+++ src/sys/arch/hpcarm/hpcarm/sa11x0_hpc_machdep.c	Mon Oct 11 14:33:31 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: sa11x0_hpc_machdep.c,v 1.19 2021/10/11 14:30:30 rin Exp $	*/
+/*	$NetBSD: sa11x0_hpc_machdep.c,v 1.20 2021/10/11 14:33:31 rin Exp $	*/
 
 /*
  * Copyright (c) 1994-1998 Mark Brinicombe.
@@ -40,7 +40,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sa11x0_hpc_machdep.c,v 1.19 2021/10/11 14:30:30 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sa11x0_hpc_machdep.c,v 1.20 2021/10/11 14:33:31 rin Exp $");
 
 #include "opt_ddb.h"
 #include "opt_dram_pages.h"
@@ -277,12 +277,16 @@ init_sa11x0(int argc, char **argv, struc
 #endif
 
 	/* Define a macro to simplify memory allocation */
-#define	valloc_pages(var, np)			\
-	alloc_pages((var).pv_pa, (np));		\
-	(var).pv_va = KERNEL_BASE + (var).pv_pa - physical_start;
-#define	alloc_pages(var, np)			\
-	(var) = freemempos;			\
-	freemempos += (np) * PAGE_SIZE;
+#define	valloc_pages(var, np)		\
+do {\
+	alloc_pages((var).pv_pa, (np));	\
+	(var).pv_va = KERNEL_BASE + (var).pv_pa - physical_start;	\
+} while (0)
+#define	alloc_pages(var, np)		\
+do {\
+	(var) = freemempos;		\
+	freemempos += (np) * PAGE_SIZE;	\
+} while (0)
 
 	valloc_pages(kernel_l1pt, L1_TABLE_SIZE / PAGE_SIZE);
 	for (loop = 0; loop < NUM_KERNEL_PTS; ++loop) {



CVS commit: src/sys/arch/hpcarm/hpcarm

2021-10-11 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Oct 11 14:30:30 UTC 2021

Modified Files:
src/sys/arch/hpcarm/hpcarm: sa11x0_hpc_machdep.c

Log Message:
Fix build with DEBUG_BEFOREMMU.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/hpcarm/hpcarm/sa11x0_hpc_machdep.c

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

Modified files:

Index: src/sys/arch/hpcarm/hpcarm/sa11x0_hpc_machdep.c
diff -u src/sys/arch/hpcarm/hpcarm/sa11x0_hpc_machdep.c:1.18 src/sys/arch/hpcarm/hpcarm/sa11x0_hpc_machdep.c:1.19
--- src/sys/arch/hpcarm/hpcarm/sa11x0_hpc_machdep.c:1.18	Tue Aug 17 22:00:29 2021
+++ src/sys/arch/hpcarm/hpcarm/sa11x0_hpc_machdep.c	Mon Oct 11 14:30:30 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: sa11x0_hpc_machdep.c,v 1.18 2021/08/17 22:00:29 andvar Exp $	*/
+/*	$NetBSD: sa11x0_hpc_machdep.c,v 1.19 2021/10/11 14:30:30 rin Exp $	*/
 
 /*
  * Copyright (c) 1994-1998 Mark Brinicombe.
@@ -40,7 +40,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sa11x0_hpc_machdep.c,v 1.18 2021/08/17 22:00:29 andvar Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sa11x0_hpc_machdep.c,v 1.19 2021/10/11 14:30:30 rin Exp $");
 
 #include "opt_ddb.h"
 #include "opt_dram_pages.h"
@@ -136,6 +136,10 @@ vaddr_t init_sa11x0(int, char **, struct
 voiddumppages(char *, int);
 #endif
 
+#ifdef DEBUG_BEFOREMMU
+static void fakecninit(void);
+#endif
+
 /* Mode dependent sleep function holder */
 extern void (*__sleep_func)(void *);
 extern void *__sleep_ctx;



CVS commit: src/sys/arch/hpcarm/hpcarm

2021-10-11 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Oct 11 14:30:30 UTC 2021

Modified Files:
src/sys/arch/hpcarm/hpcarm: sa11x0_hpc_machdep.c

Log Message:
Fix build with DEBUG_BEFOREMMU.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/hpcarm/hpcarm/sa11x0_hpc_machdep.c

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



CVS commit: src/sys/arch/hpcarm/hpcarm

2021-10-11 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Oct 11 14:29:15 UTC 2021

Modified Files:
src/sys/arch/hpcarm/hpcarm: kloader_pxa2x0.S

Log Message:
G/C unused CPWAIT().


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/hpcarm/hpcarm/kloader_pxa2x0.S

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

Modified files:

Index: src/sys/arch/hpcarm/hpcarm/kloader_pxa2x0.S
diff -u src/sys/arch/hpcarm/hpcarm/kloader_pxa2x0.S:1.1 src/sys/arch/hpcarm/hpcarm/kloader_pxa2x0.S:1.2
--- src/sys/arch/hpcarm/hpcarm/kloader_pxa2x0.S:1.1	Sat Mar 31 14:02:54 2012
+++ src/sys/arch/hpcarm/hpcarm/kloader_pxa2x0.S	Mon Oct 11 14:29:15 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: kloader_pxa2x0.S,v 1.1 2012/03/31 14:02:54 nonaka Exp $	*/
+/*	$NetBSD: kloader_pxa2x0.S,v 1.2 2021/10/11 14:29:15 rin Exp $	*/
 
 /*-
  * Copyright (C) 2012 NONAKA Kimihiro 
@@ -29,20 +29,6 @@
 
 #include 
 
-/*
- * CPWAIT -- Canonical method to wait for CP15 update.
- * NOTE: Clobbers the specified temp reg.
- * copied from arm/arm/cpufunc_asm_xscale.S
- * XXX: better be in a common header file.
- */
-#define	CPWAIT_BRANCH			 \
-	sub	pc, pc, #4
-
-#define	CPWAIT(tmp)			 \
-	mrc	p15, 0, tmp, c2, c0, 0	/* arbitrary read of CP15 */	;\
-	mov	tmp, tmp		/* wait for it to complete */	;\
-	CPWAIT_BRANCH			/* branch to next insn */
-
 #define	VATOPA(reg)			\
 	bic	reg, reg, #0xff00	/* clear upper 8 bits */	;\
 	orr	reg, reg, #0xa000	/* OR in physical base address */



CVS commit: src/sys/arch/hpcarm/hpcarm

2021-10-11 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Oct 11 14:29:15 UTC 2021

Modified Files:
src/sys/arch/hpcarm/hpcarm: kloader_pxa2x0.S

Log Message:
G/C unused CPWAIT().


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/hpcarm/hpcarm/kloader_pxa2x0.S

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



CVS commit: src/sys/dev

2021-10-11 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Oct 11 14:25:05 UTC 2021

Modified Files:
src/sys/dev: kloader.c

Log Message:
Switch to kmem(9).


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/dev/kloader.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/kloader.c
diff -u src/sys/dev/kloader.c:1.31 src/sys/dev/kloader.c:1.32
--- src/sys/dev/kloader.c:1.31	Mon Oct 11 14:16:43 2021
+++ src/sys/dev/kloader.c	Mon Oct 11 14:25:05 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: kloader.c,v 1.31 2021/10/11 14:16:43 rin Exp $	*/
+/*	$NetBSD: kloader.c,v 1.32 2021/10/11 14:25:05 rin Exp $	*/
 
 /*-
  * Copyright (c) 2001, 2002, 2004 The NetBSD Foundation, Inc.
@@ -27,13 +27,13 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kloader.c,v 1.31 2021/10/11 14:16:43 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kloader.c,v 1.32 2021/10/11 14:25:05 rin Exp $");
 
 #include "debug_kloader.h"
 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -174,7 +174,7 @@ kloader_load(void)
 	Elf_Addr entry;
 	vaddr_t kv;
 	size_t sz;
-	size_t shstrsz;
+	size_t phsz, shsz, shstrsz;
 	char *shstrtab;
 	int symndx, strndx;
 	size_t ksymsz;
@@ -199,30 +199,30 @@ kloader_load(void)
 	}
 
 	/* read program headers */
-	sz = eh.e_phentsize * eh.e_phnum;
-	if ((ph = malloc(sz, M_TEMP, M_NOWAIT)) == NULL) {
+	phsz = eh.e_phentsize * eh.e_phnum;
+	if ((ph = kmem_alloc(phsz, KM_NOSLEEP)) == NULL) {
 		PRINTF("can't allocate program header table.\n");
 		goto err;
 	}
-	if (kloader_read(eh.e_phoff, sz, ph) != 0) {
+	if (kloader_read(eh.e_phoff, phsz, ph) != 0) {
 		PRINTF("program header read error.\n");
 		goto err;
 	}
 
 	/* read section headers */
-	sz = eh.e_shentsize * eh.e_shnum;
-	if ((sh = malloc(sz, M_TEMP, M_NOWAIT)) == NULL) {
+	shsz = eh.e_shentsize * eh.e_shnum;
+	if ((sh = kmem_alloc(shsz, KM_NOSLEEP)) == NULL) {
 		PRINTF("can't allocate section header table.\n");
 		goto err;
 	}
-	if (kloader_read(eh.e_shoff, eh.e_shentsize * eh.e_shnum, sh) != 0) {
+	if (kloader_read(eh.e_shoff, shsz, sh) != 0) {
 		PRINTF("section header read error.\n");
 		goto err;
 	}
 
 	/* read section names */
 	shstrsz = ROUND4(sh[eh.e_shstrndx].sh_size);
-	shstrtab = malloc(shstrsz, M_TEMP, M_NOWAIT);
+	shstrtab = kmem_alloc(shstrsz, KM_NOSLEEP);
 	if (shstrtab == NULL) {
 		PRINTF("unable to allocate memory for .shstrtab\n");
 		goto err;
@@ -416,11 +416,11 @@ kloader_load(void)
 	return (0);
  err:
 	if (ph != NULL)
-		free(ph, M_TEMP);
+		kmem_free(ph, phsz);
 	if (sh != NULL)
-		free(sh, M_TEMP);
+		kmem_free(sh, shsz);
 	if (shstrtab != NULL)
-		free(shstrtab, M_TEMP);
+		kmem_free(shstrtab, shstrsz);
 
 	return 1;
 }



CVS commit: src/sys/dev

2021-10-11 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Oct 11 14:25:05 UTC 2021

Modified Files:
src/sys/dev: kloader.c

Log Message:
Switch to kmem(9).


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/dev/kloader.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

2021-10-11 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Oct 11 14:16:43 UTC 2021

Modified Files:
src/sys/dev: kloader.c

Log Message:
Sort headers.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/sys/dev/kloader.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

2021-10-11 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Oct 11 14:16:43 UTC 2021

Modified Files:
src/sys/dev: kloader.c

Log Message:
Sort headers.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/sys/dev/kloader.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/kloader.c
diff -u src/sys/dev/kloader.c:1.30 src/sys/dev/kloader.c:1.31
--- src/sys/dev/kloader.c:1.30	Mon Oct 11 14:14:40 2021
+++ src/sys/dev/kloader.c	Mon Oct 11 14:16:43 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: kloader.c,v 1.30 2021/10/11 14:14:40 rin Exp $	*/
+/*	$NetBSD: kloader.c,v 1.31 2021/10/11 14:16:43 rin Exp $	*/
 
 /*-
  * Copyright (c) 2001, 2002, 2004 The NetBSD Foundation, Inc.
@@ -27,17 +27,18 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kloader.c,v 1.30 2021/10/11 14:14:40 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kloader.c,v 1.31 2021/10/11 14:16:43 rin Exp $");
 
 #include "debug_kloader.h"
 
 #include 
-#include 
+#include 
 #include 
+#include 
 #include 
+#include 
 #include 
-#include 
-#include 
+
 #define	ELFSIZE	32
 #include 
 



CVS commit: src/sys/dev

2021-10-11 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Oct 11 14:14:40 UTC 2021

Modified Files:
src/sys/dev: kloader.c

Log Message:
Zero clear sh_offset to indicate a section is unused.

Avoid kernel text being doubly allocated due to non-zero sh_offset for
unused sections.

None of MD codes and kern_ksyms.c use sh_type == SHT_NULL (yet?) to
determine whether a section is unused.


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/sys/dev/kloader.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/kloader.c
diff -u src/sys/dev/kloader.c:1.29 src/sys/dev/kloader.c:1.30
--- src/sys/dev/kloader.c:1.29	Tue Jun 29 22:40:53 2021
+++ src/sys/dev/kloader.c	Mon Oct 11 14:14:40 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: kloader.c,v 1.29 2021/06/29 22:40:53 dholland Exp $	*/
+/*	$NetBSD: kloader.c,v 1.30 2021/10/11 14:14:40 rin Exp $	*/
 
 /*-
  * Copyright (c) 2001, 2002, 2004 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kloader.c,v 1.29 2021/06/29 22:40:53 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kloader.c,v 1.30 2021/10/11 14:14:40 rin Exp $");
 
 #include "debug_kloader.h"
 
@@ -263,9 +263,11 @@ kloader_load(void)
 			symndx = i;
 		else if (strcmp(shstrtab + sh[i].sh_name, ".strtab") == 0)
 			strndx = i;
-		else if (i != eh.e_shstrndx)
+		else if (i != eh.e_shstrndx) {
 			/* while here, mark all other sections as unused */
 			sh[i].sh_type = SHT_NULL;
+			sh[i].sh_offset = 0;
+		}
 	}
 
 	if (symndx < 0 || strndx < 0) {



CVS commit: src/sys/dev

2021-10-11 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Oct 11 14:14:40 UTC 2021

Modified Files:
src/sys/dev: kloader.c

Log Message:
Zero clear sh_offset to indicate a section is unused.

Avoid kernel text being doubly allocated due to non-zero sh_offset for
unused sections.

None of MD codes and kern_ksyms.c use sh_type == SHT_NULL (yet?) to
determine whether a section is unused.


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

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



CVS commit: src/sys/conf

2021-10-11 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Oct 11 13:42:33 UTC 2021

Modified Files:
src/sys/conf: files

Log Message:
add defflag for AHCISATA_EXTRA_DELAY


To generate a diff of this commit:
cvs rdiff -u -r1.1288 -r1.1289 src/sys/conf/files

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

Modified files:

Index: src/sys/conf/files
diff -u src/sys/conf/files:1.1288 src/sys/conf/files:1.1289
--- src/sys/conf/files:1.1288	Mon Oct 11 03:50:45 2021
+++ src/sys/conf/files	Mon Oct 11 13:42:33 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: files,v 1.1288 2021/10/11 03:50:45 msaitoh Exp $
+#	$NetBSD: files,v 1.1289 2021/10/11 13:42:33 jmcneill Exp $
 #	@(#)files.newconf	7.5 (Berkeley) 5/10/93
 
 version 	20171118
@@ -1035,6 +1035,7 @@ device	njata: ata, ata_piobm, wdc_common
 file	dev/ic/ninjaata32.c		njata
 
 # AHCI-compatible SATA controllers
+defflag	opt_ahcisata.h	AHCISATA_EXTRA_DELAY
 define ahcisata_core
 file dev/ic/ahcisata_core.c ahcisata_core
 device ahcisata: ata, ata_dma, ata_udma, sata, sata_fis, sata_pmp, ahcisata_core



CVS commit: src/sys/conf

2021-10-11 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Oct 11 13:42:33 UTC 2021

Modified Files:
src/sys/conf: files

Log Message:
add defflag for AHCISATA_EXTRA_DELAY


To generate a diff of this commit:
cvs rdiff -u -r1.1288 -r1.1289 src/sys/conf/files

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



CVS commit: src/sbin/wsconsctl

2021-10-11 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Oct 11 13:27:47 UTC 2021

Modified Files:
src/sbin/wsconsctl: Makefile

Log Message:
wsconsctl: include correct header for lint

Running lint in non-tools mode picked up the header from the installed
system, not the one corresponding to the source code. The installed
header on NetBSD 9.99.88 does not define WSMOUSECFG_MAX yet.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sbin/wsconsctl/Makefile

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

Modified files:

Index: src/sbin/wsconsctl/Makefile
diff -u src/sbin/wsconsctl/Makefile:1.14 src/sbin/wsconsctl/Makefile:1.15
--- src/sbin/wsconsctl/Makefile:1.14	Sun Oct 26 14:55:17 2008
+++ src/sbin/wsconsctl/Makefile	Mon Oct 11 13:27:47 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.14 2008/10/26 14:55:17 apb Exp $
+#	$NetBSD: Makefile,v 1.15 2021/10/11 13:27:47 rillig Exp $
 
 PROG=	wsconsctl
 SRCS=	display.c keyboard.c keysym.c map_parse.y map_scan.l \
@@ -9,6 +9,7 @@ YHEADER=	1
 CPPFLAGS+=	-I. -I${.CURDIR}
 DPSRCS+=	keysym.h
 CLEANFILES+=	keysym.h
+LINTFLAGS+=	-I${NETBSDSRCDIR}/sys
 
 .include 
 



CVS commit: src/sbin/wsconsctl

2021-10-11 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Oct 11 13:27:47 UTC 2021

Modified Files:
src/sbin/wsconsctl: Makefile

Log Message:
wsconsctl: include correct header for lint

Running lint in non-tools mode picked up the header from the installed
system, not the one corresponding to the source code. The installed
header on NetBSD 9.99.88 does not define WSMOUSECFG_MAX yet.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sbin/wsconsctl/Makefile

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

2021-10-11 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Oct 11 13:27:27 UTC 2021

Modified Files:
src/sys/dev/pci: pcidevs.h pcidevs_data.h

Log Message:
Regen.


To generate a diff of this commit:
cvs rdiff -u -r1.1422 -r1.1423 src/sys/dev/pci/pcidevs.h
cvs rdiff -u -r1.1421 -r1.1422 src/sys/dev/pci/pcidevs_data.h

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

2021-10-11 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Oct 11 13:26:52 UTC 2021

Modified Files:
src/sys/dev/pci: pcidevs

Log Message:
Add Intel 500 Series PCH-H devices.


To generate a diff of this commit:
cvs rdiff -u -r1.1436 -r1.1437 src/sys/dev/pci/pcidevs

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

2021-10-11 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Oct 11 13:26:52 UTC 2021

Modified Files:
src/sys/dev/pci: pcidevs

Log Message:
Add Intel 500 Series PCH-H devices.


To generate a diff of this commit:
cvs rdiff -u -r1.1436 -r1.1437 src/sys/dev/pci/pcidevs

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/pcidevs
diff -u src/sys/dev/pci/pcidevs:1.1436 src/sys/dev/pci/pcidevs:1.1437
--- src/sys/dev/pci/pcidevs:1.1436	Mon Oct 11 13:25:19 2021
+++ src/sys/dev/pci/pcidevs	Mon Oct 11 13:26:52 2021
@@ -1,4 +1,4 @@
-$NetBSD: pcidevs,v 1.1436 2021/10/11 13:25:19 msaitoh Exp $
+$NetBSD: pcidevs,v 1.1437 2021/10/11 13:26:52 msaitoh Exp $
 
 /*
  * Copyright (c) 1995, 1996 Christopher G. Demetriou
@@ -5550,7 +5550,76 @@ product INTEL WIFI_LINK_5350_1	0x423a	Wi
 product INTEL WIFI_LINK_5350_2	0x423b	WiFi Link 5350
 product INTEL WIFI_LINK_5150_1	0x423c	WiFi Link 5150
 product INTEL WIFI_LINK_5150_2	0x423d	WiFi Link 5150
-
+product INTEL 5HS_Q570_ESPI	0x4384	Q570 eSPI
+product INTEL 5HS_Z590_ESPI	0x4385	Z590 eSPI
+product INTEL 5HS_H570_ESPI	0x4386	H570 eSPI
+product INTEL 5HS_B560_ESPI	0x4387	B560 eSPI
+product INTEL 5HS_H510_ESPI	0x4388	H510 eSPI
+product INTEL 5HS_W580_ESPI	0x438f	W580 eSPI
+product INTEL 5HS_H_P2SB	0x43a0	500 Series PCH-H P2SB
+product INTEL 5HS_H_PMC		0x43a1	500 Series PCH-H PMC
+product INTEL 5HS_H_SMB		0x43a3	500 Series PCH-H SMBus
+product INTEL 5HS_H_SPI		0x43a4	500 Series PCH-H SPI (FLASH)
+product INTEL 5HS_H_TRACE	0x43a6	500 Series PCH-H Trace Hub
+product INTEL 5HS_H_UART_2	0x43a7	500 Series PCH-H UART 2
+product INTEL 5HS_H_UART_0	0x43a8	500 Series PCH-H UART 0
+product INTEL 5HS_H_UART_1	0x43a9	500 Series PCH-H UART 1
+product INTEL 5HS_H_GSPI_0	0x43aa	500 Series PCH-H GSPI 0
+product INTEL 5HS_H_GSPI_1	0x43ab	500 Series PCH-H GSPI 1
+product INTEL 5HS_H_I2C_4	0x43ad	500 Series PCH-H I2C 4
+product INTEL 5HS_H_I2C_5	0x43ae	500 Series PCH-H I2C 5
+product INTEL 5HS_H_PCIE_9	0x43b0	500 Series PCH-H PCIe RP 9
+product INTEL 5HS_H_PCIE_10	0x43b1	500 Series PCH-H PCIe RP 10
+product INTEL 5HS_H_PCIE_11	0x43b2	500 Series PCH-H PCIe RP 11
+product INTEL 5HS_H_PCIE_12	0x43b3	500 Series PCH-H PCIe RP 12
+product INTEL 5HS_H_PCIE_13	0x43b4	500 Series PCH-H PCIe RP 13
+product INTEL 5HS_H_PCIE_14	0x43b5	500 Series PCH-H PCIe RP 14
+product INTEL 5HS_H_PCIE_15	0x43b6	500 Series PCH-H PCIe RP 15
+product INTEL 5HS_H_PCIE_16	0x43b7	500 Series PCH-H PCIe RP 16
+product INTEL 5HS_H_PCIE_1	0x43b8	500 Series PCH-H PCIe RP 1
+product INTEL 5HS_H_PCIE_2	0x43b9	500 Series PCH-H PCIe RP 2
+product INTEL 5HS_H_PCIE_3	0x43ba	500 Series PCH-H PCIe RP 3
+product INTEL 5HS_H_PCIE_4	0x43bb	500 Series PCH-H PCIe RP 4
+product INTEL 5HS_H_PCIE_5	0x43bc	500 Series PCH-H PCIe RP 5
+product INTEL 5HS_H_PCIE_6	0x43bd	500 Series PCH-H PCIe RP 6
+product INTEL 5HS_H_PCIE_7	0x43be	500 Series PCH-H PCIe RP 7
+product INTEL 5HS_H_PCIE_8	0x43bf	500 Series PCH-H PCIe RP 8
+product INTEL 5HS_H_PCIE_17	0x43c0	500 Series PCH-H PCIe RP 17
+product INTEL 5HS_H_PCIE_18	0x43c1	500 Series PCH-H PCIe RP 18
+product INTEL 5HS_H_PCIE_19	0x43c2	500 Series PCH-H PCIe RP 19
+product INTEL 5HS_H_PCIE_20	0x43c3	500 Series PCH-H PCIe RP 20
+product INTEL 5HS_H_PCIE_21	0x43c4	500 Series PCH-H PCIe RP 21
+product INTEL 5HS_H_PCIE_22	0x43c5	500 Series PCH-H PCIe RP 22
+product INTEL 5HS_H_PCIE_23	0x43c6	500 Series PCH-H PCIe RP 23
+product INTEL 5HS_H_PCIE_24	0x43c7	500 Series PCH-H PCIe RP 24
+product INTEL 5HS_H_HDA		0x43c8	500 Series PCH-H HD Audio
+product INTEL 5HS_H_THC_0	0x43d0	500 Series PCH-H THC 0
+product INTEL 5HS_H_THC_1	0x43d1	500 Series PCH-H THC 1
+product INTEL 5HS_H_D_AHCI	0x43d2	500 Series PCH-H SATA (AHCI, desktop)
+product INTEL 5HS_H_M_AHCI	0x43d3	500 Series PCH-H SATA (AHCI, mobile)
+product INTEL 5HS_H_D_RAID	0x43d4	500 Series PCH-H SATA (RAID, desktop)
+product INTEL 5HS_H_M_RAID	0x43d5	500 Series PCH-H SATA (RAID, mobile)
+product INTEL 5HS_H_D_RAID_P	0x43d6	500 Series PCH-H SATA (RAID, desktop) premium
+product INTEL 5HS_H_M_RAID_P	0x43d7	500 Series PCH-H SATA (RAID, mobile) premium
+product INTEL 5HS_H_I2C_6	0x43d8	500 Series PCH-H I2C 6
+product INTEL 5HS_H_UART_3	0x43da	500 Series PCH-H UART 3
+product INTEL 5HS_H_HECI_1	0x43e0	500 Series PCH-H HECI 1
+product INTEL 5HS_H_HECI_2	0x43e1	500 Series PCH-H HECI 2
+product INTEL 5HS_H_IDER	0x43e2	500 Series PCH-H IDE-R
+product INTEL 5HS_H_KT		0x43e3	500 Series PCH-H KT
+product INTEL 5HS_H_HECI_3	0x43e4	500 Series PCH-H HECI 3
+product INTEL 5HS_H_HECI_4	0x43e5	500 Series PCH-H HECI 4
+product INTEL 5HS_H_I2C_0	0x43e8	500 Series PCH-H I2C 0
+product INTEL 5HS_H_I2C_1	0x43e9	500 Series PCH-H I2C 1
+product INTEL 5HS_H_I2C_2	0x43ea	500 Series PCH-H I2C 2
+product INTEL 5HS_H_I2C_3	0x43eb	500 Series PCH-H I2C 3
+product INTEL 5HS_H_XHCI	0x43ed	500 Series PCH-H USB 3.2 Gen 2x2 xHCI
+product INTEL 5HS_H_XDCI	0x43ee	500 Series PCH-H USB 3.2 Gen 1x1 xDCI

CVS commit: src/sys/dev/pci

2021-10-11 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Oct 11 13:25:20 UTC 2021

Modified Files:
src/sys/dev/pci: pcidevs

Log Message:
Remove duplicated entries.


To generate a diff of this commit:
cvs rdiff -u -r1.1435 -r1.1436 src/sys/dev/pci/pcidevs

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/pcidevs
diff -u src/sys/dev/pci/pcidevs:1.1435 src/sys/dev/pci/pcidevs:1.1436
--- src/sys/dev/pci/pcidevs:1.1435	Sat Oct  2 20:45:17 2021
+++ src/sys/dev/pci/pcidevs	Mon Oct 11 13:25:19 2021
@@ -1,4 +1,4 @@
-$NetBSD: pcidevs,v 1.1435 2021/10/02 20:45:17 mrg Exp $
+$NetBSD: pcidevs,v 1.1436 2021/10/11 13:25:19 msaitoh Exp $
 
 /*
  * Copyright (c) 1995, 1996 Christopher G. Demetriou
@@ -3588,38 +3588,6 @@ product INTEL CMTLK_SDXC	0x02f5	Comet La
 product INTEL CMTLK_THERM	0x02f9	Comet Lake Thermal
 product INTEL CMTLK_SPI_2	0x02fb	Comet Lake SPI 2
 product INTEL CMTLK_ISH		0x02fc	Comet Lake Integrated Sensor Hub
-product INTEL CMTLK_PCIE_9	0x02b0	Comet Lake PCIe Root Port 9
-product INTEL CMTLK_PCIE_10	0x02b1	Comet Lake PCIe Root Port 10
-product INTEL CMTLK_PCIE_11	0x02b2	Comet Lake PCIe Root Port 11
-product INTEL CMTLK_PCIE_12	0x02b3	Comet Lake PCIe Root Port 12
-product INTEL CMTLK_PCIE_13	0x02b4	Comet Lake PCIe Root Port 13
-product INTEL CMTLK_PCIE_14	0x02b5	Comet Lake PCIe Root Port 14
-product INTEL CMTLK_PCIE_15	0x02b6	Comet Lake PCIe Root Port 15
-product INTEL CMTLK_PCIE_16	0x02b7	Comet Lake PCIe Root Port 16
-product INTEL CMTLK_PCIE_1	0x02b8	Comet Lake PCIe Root Port 1
-product INTEL CMTLK_PCIE_2	0x02b9	Comet Lake PCIe Root Port 2
-product INTEL CMTLK_PCIE_3	0x02ba	Comet Lake PCIe Root Port 3
-product INTEL CMTLK_PCIE_4	0x02bb	Comet Lake PCIe Root Port 4
-product INTEL CMTLK_PCIE_5	0x02bc	Comet Lake PCIe Root Port 5
-product INTEL CMTLK_PCIE_6	0x02bd	Comet Lake PCIe Root Port 6
-product INTEL CMTLK_PCIE_7	0x02be	Comet Lake PCIe Root Port 7
-product INTEL CMTLK_PCIE_8	0x02bf	Comet Lake PCIe Root Port 8
-product INTEL CMTLK_HDA		0x02c8	Comet Lake HD Audio
-product INTEL CMTLK_SATA_AHCI_0 0x02d3	Comet Lake SATA (AHCI)
-product INTEL CMTLK_MEI_1	0x02e0	Comet Lake MEI Controller #1
-product INTEL CMTLK_MEI_2	0x02e1	Comet Lake MEI Controller #2
-product INTEL CMTLK_IDE_R	0x02e2	Comet Lake IDE-R
-product INTEL CMTLK_KT		0x02e3	Comet Lake KT
-product INTEL CMTLK_MEI_3	0x02e4	Comet Lake MEI Controller #3
-product INTEL CMTLK_MEI_4	0x02e5	Comet Lake MEI Controller #4
-product INTEL CMTLK_I2C_0	0x02e8	Comet Lake I2C #0
-product INTEL CMTLK_I2C_1	0x02e9	Comet Lake I2C #1
-product INTEL CMTLK_I2C_2	0x02ea	Comet Lake I2C #2
-product INTEL CMTLK_I2C_3	0x02eb	Comet Lake I2C #3
-product INTEL CMTLK_XHCI	0x02ed	Comet Lake USB 3.2 Gen 2 xHCI
-product INTEL CMTLK_SSRAM	0x02ef	Comet Lake Shared SRAM
-product INTEL CMTLK_CNVI_WIFI	0x02f0	Comet Lake CNVi Wi-Fi
-product INTEL CMTLK_THERM	0x02f9	Comet Lake Thermal
 product INTEL 80312		0x030d	80312 I/O Companion Chip
 product INTEL 80321		0x0319	80321 I/O Processor
 product INTEL 6700PXH_IOXAPIC	0x0326	6700PXH IOxAPIC



CVS commit: src/sys/dev/pci

2021-10-11 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Oct 11 13:25:20 UTC 2021

Modified Files:
src/sys/dev/pci: pcidevs

Log Message:
Remove duplicated entries.


To generate a diff of this commit:
cvs rdiff -u -r1.1435 -r1.1436 src/sys/dev/pci/pcidevs

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

2021-10-11 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Oct 11 12:48:10 UTC 2021

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

Log Message:
ahcisata: remove excessive delays from drive probe path

There are a handful of inexplicable 500ms delays introduced to the drive
detect path in this driver, slowing boot. They can be re-enabled with
options AHCISATA_EXTRA_DELAY, but should not be enabled for normal kernels.
If a delay does need to be introduced in these places, the value should
either be more carefully selected or the scope limited to hardware that
requires the extra delay.


To generate a diff of this commit:
cvs rdiff -u -r1.102 -r1.103 src/sys/dev/ic/ahcisata_core.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/ahcisata_core.c
diff -u src/sys/dev/ic/ahcisata_core.c:1.102 src/sys/dev/ic/ahcisata_core.c:1.103
--- src/sys/dev/ic/ahcisata_core.c:1.102	Tue Oct  5 08:01:05 2021
+++ src/sys/dev/ic/ahcisata_core.c	Mon Oct 11 12:48:10 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: ahcisata_core.c,v 1.102 2021/10/05 08:01:05 rin Exp $	*/
+/*	$NetBSD: ahcisata_core.c,v 1.103 2021/10/11 12:48:10 jmcneill Exp $	*/
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ahcisata_core.c,v 1.102 2021/10/05 08:01:05 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ahcisata_core.c,v 1.103 2021/10/11 12:48:10 jmcneill Exp $");
 
 #include 
 #include 
@@ -50,6 +50,8 @@ __KERNEL_RCSID(0, "$NetBSD: ahcisata_cor
 
 #include "atapibus.h"
 
+#include "opt_ahcisata.h"
+
 #ifdef AHCI_DEBUG
 int ahcidebug_mask = 0;
 #endif
@@ -968,7 +970,9 @@ again:
 	AHCI_READ(sc, AHCI_P_CMD(chp->ch_channel))), DEBUG_PROBE);
 end:
 	ahci_channel_stop(sc, chp, flags);
+#ifdef AHCISATA_EXTRA_DELAY
 	ata_delay(chp, 500, "ahcirst", flags);
+#endif
 	/* clear port interrupt register */
 	AHCI_WRITE(sc, AHCI_P_IS(chp->ch_channel), 0x);
 	ahci_channel_start(sc, chp, flags,
@@ -992,7 +996,9 @@ ahci_reset_channel(struct ata_channel *c
 		/* XXX and then ? */
 	}
 	ata_kill_active(chp, KILL_RESET, flags);
+#ifdef AHCISATA_EXTRA_DELAY
 	ata_delay(chp, 500, "ahcirst", flags);
+#endif
 	/* clear port interrupt register */
 	AHCI_WRITE(sc, AHCI_P_IS(chp->ch_channel), 0x);
 	/* clear SErrors and start operations */
@@ -1062,7 +1068,9 @@ ahci_probe_drive(struct ata_channel *chp
 	switch (sata_reset_interface(chp, sc->sc_ahcit, achp->ahcic_scontrol,
 	achp->ahcic_sstatus, AT_WAIT)) {
 	case SStatus_DET_DEV:
+#ifdef AHCISATA_EXTRA_DELAY
 		ata_delay(chp, 500, "ahcidv", AT_WAIT);
+#endif
 
 		/* Initial value, used in case the soft reset fails */
 		sig = AHCI_READ(sc, AHCI_P_SIG(chp->ch_channel));
@@ -1101,8 +1109,10 @@ ahci_probe_drive(struct ata_channel *chp
 		AHCI_P_IX_IFS |
 		AHCI_P_IX_OFS | AHCI_P_IX_DPS | AHCI_P_IX_UFS |
 		AHCI_P_IX_PSS | AHCI_P_IX_DHRS | AHCI_P_IX_SDBS);
+#ifdef AHCISATA_EXTRA_DELAY
 		/* wait 500ms before actually starting operations */
 		ata_delay(chp, 500, "ahciprb", AT_WAIT);
+#endif
 		break;
 
 	default:



CVS commit: src/sys/dev/ic

2021-10-11 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Oct 11 12:48:10 UTC 2021

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

Log Message:
ahcisata: remove excessive delays from drive probe path

There are a handful of inexplicable 500ms delays introduced to the drive
detect path in this driver, slowing boot. They can be re-enabled with
options AHCISATA_EXTRA_DELAY, but should not be enabled for normal kernels.
If a delay does need to be introduced in these places, the value should
either be more carefully selected or the scope limited to hardware that
requires the extra delay.


To generate a diff of this commit:
cvs rdiff -u -r1.102 -r1.103 src/sys/dev/ic/ahcisata_core.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

2021-10-11 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Oct 11 10:59:09 UTC 2021

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

Log Message:
Squash "holding up boot" messages into a single line, and only print the
device list if no progress has been made in 1 second.


To generate a diff of this commit:
cvs rdiff -u -r1.289 -r1.290 src/sys/kern/subr_autoconf.c

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

Modified files:

Index: src/sys/kern/subr_autoconf.c
diff -u src/sys/kern/subr_autoconf.c:1.289 src/sys/kern/subr_autoconf.c:1.290
--- src/sys/kern/subr_autoconf.c:1.289	Sat Aug  7 16:19:18 2021
+++ src/sys/kern/subr_autoconf.c	Mon Oct 11 10:59:09 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: subr_autoconf.c,v 1.289 2021/08/07 16:19:18 thorpej Exp $ */
+/* $NetBSD: subr_autoconf.c,v 1.290 2021/10/11 10:59:09 jmcneill Exp $ */
 
 /*
  * Copyright (c) 1996, 2000 Christopher G. Demetriou
@@ -77,7 +77,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: subr_autoconf.c,v 1.289 2021/08/07 16:19:18 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_autoconf.c,v 1.290 2021/10/11 10:59:09 jmcneill Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ddb.h"
@@ -2406,9 +2406,16 @@ config_finalize(void)
 	mutex_enter(&config_misc_lock);
 	while (!TAILQ_EMPTY(&config_pending)) {
 		device_t dev;
-		TAILQ_FOREACH(dev, &config_pending, dv_pending_list)
-			aprint_debug_dev(dev, "holding up boot\n");
-		cv_wait(&config_misc_cv, &config_misc_lock);
+		int error;
+
+		error = cv_timedwait(&config_misc_cv, &config_misc_lock,
+		mstohz(1000));
+		if (error == EWOULDBLOCK) {
+			aprint_debug("waiting for devices:");
+			TAILQ_FOREACH(dev, &config_pending, dv_pending_list)
+aprint_debug(" %s", device_xname(dev));
+			aprint_debug("\n");
+		}
 	}
 	mutex_exit(&config_misc_lock);
 



CVS commit: src/sys/kern

2021-10-11 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Oct 11 10:59:09 UTC 2021

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

Log Message:
Squash "holding up boot" messages into a single line, and only print the
device list if no progress has been made in 1 second.


To generate a diff of this commit:
cvs rdiff -u -r1.289 -r1.290 src/sys/kern/subr_autoconf.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

2021-10-11 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Oct 11 10:23:02 UTC 2021

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

Log Message:
Use group 'e' instead of 'E' for the benefit of kdump.

Avoids collisions with envsys (EFIIOC_VAR_GET vs ENVSYS_GTREINFO).


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/sys/efiio.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

2021-10-11 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Oct 11 10:23:02 UTC 2021

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

Log Message:
Use group 'e' instead of 'E' for the benefit of kdump.

Avoids collisions with envsys (EFIIOC_VAR_GET vs ENVSYS_GTREINFO).


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/sys/efiio.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/efiio.h
diff -u src/sys/sys/efiio.h:1.1 src/sys/sys/efiio.h:1.2
--- src/sys/sys/efiio.h:1.1	Sun Oct 10 13:03:10 2021
+++ src/sys/sys/efiio.h	Mon Oct 11 10:23:02 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: efiio.h,v 1.1 2021/10/10 13:03:10 jmcneill Exp $ */
+/* $NetBSD: efiio.h,v 1.2 2021/10/11 10:23:02 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2021 The NetBSD Foundation, Inc.
@@ -57,8 +57,8 @@ struct efi_var_ioc {
 	size_t		datasize;	/* size in bytes of the data buffer */
 };
 
-#define	EFIIOC_VAR_GET		_IOWR('E', 4, struct efi_var_ioc)
-#define	EFIIOC_VAR_NEXT		_IOWR('E', 5, struct efi_var_ioc)
-#define	EFIIOC_VAR_SET		_IOWR('E', 7, struct efi_var_ioc)
+#define	EFIIOC_VAR_GET		_IOWR('e', 4, struct efi_var_ioc)
+#define	EFIIOC_VAR_NEXT		_IOWR('e', 5, struct efi_var_ioc)
+#define	EFIIOC_VAR_SET		_IOWR('e', 7, struct efi_var_ioc)
 
 #endif /* _SYS_EFIIO_H */



CVS commit: src/share/man/man4

2021-10-11 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Mon Oct 11 07:45:39 UTC 2021

Modified Files:
src/share/man/man4: ep.4

Log Message:
New sentence, new line.


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/share/man/man4/ep.4

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

Modified files:

Index: src/share/man/man4/ep.4
diff -u src/share/man/man4/ep.4:1.38 src/share/man/man4/ep.4:1.39
--- src/share/man/man4/ep.4:1.38	Mon Oct 11 03:00:18 2021
+++ src/share/man/man4/ep.4	Mon Oct 11 07:45:39 2021
@@ -1,4 +1,4 @@
-.\"	$NetBSD: ep.4,v 1.38 2021/10/11 03:00:18 rin Exp $
+.\"	$NetBSD: ep.4,v 1.39 2021/10/11 07:45:39 wiz Exp $
 .\"
 .\" Copyright (c) 1997 Jonathan Stone
 .\" All rights reserved.
@@ -138,7 +138,8 @@ PCMCIA 56K modem-10/100Mbps Ethernet com
 .It 3c562
 PCMCIA modem-10Mbps Ethernet combo card with dongle
 .It 3c572B
-OfficeConnect. Same as 3c574, but with newer revision of
+OfficeConnect.
+Same as 3c574, but with newer revision of
 .Xr tqphy 4
 .It 3c574
 PCMCIA 10/100Mbps card with dongle



CVS commit: src/share/man/man4

2021-10-11 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Mon Oct 11 07:45:39 UTC 2021

Modified Files:
src/share/man/man4: ep.4

Log Message:
New sentence, new line.


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/share/man/man4/ep.4

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



Re: CVS commit: src/sys/arch

2021-10-11 Thread Nick Hudson




On 11/10/2021 08:14, Rin Okuyama wrote:

Hi,

On 2021/09/23 15:34, Nick Hudson wrote:

Module Name:    src
Committed By:    skrll
Date:    Thu Sep 23 06:34:00 UTC 2021

Modified Files:
src/sys/arch/aarch64/aarch64: cpufunc.c
src/sys/arch/arm/arm32: cpu.c

Log Message:
Print the cache information in similar formats and arm and aarch64, e.g.


For classic ARM CPUs, info->[id]cache_sets are not set. This results in

cpu0 at mainbus0 core 0: SA-1110 step B-5 (SA-1 V4 core)
cpu0: DC enabled IC enabled WB enabled LABT
cpu0: L1 16KB/32B 32-way (0 set) VIVT Instruction cache
cpu0: L1 8KB/32B 32-way (0 set) write-back VIVT Data cache

or

cpu0 at mainbus0 core 0: ARM926EJ-S r0p0 (ARM9EJ-S V5TEJ core)
cpu0: DC enabled IC enabled WB enabled LABT
cpu0: L1 32KB/32B 1-way (0 set) VIVT Instruction cache
cpu0: L1 32KB/32B 1-way (0 set) write-back-locking-C VIVT Data cache

Can I commit the attached patch? Or initialize these variables somewhere
else?


I think your patch is fine. Thanks for fixing this.

Nick


Re: CVS commit: src/sys/arch

2021-10-11 Thread Rin Okuyama

Thanks for quick response. Committed :)

rin

On 2021/10/11 16:27, Nick Hudson wrote:



On 11/10/2021 08:14, Rin Okuyama wrote:

Hi,

On 2021/09/23 15:34, Nick Hudson wrote:

Module Name:    src
Committed By:    skrll
Date:    Thu Sep 23 06:34:00 UTC 2021

Modified Files:
src/sys/arch/aarch64/aarch64: cpufunc.c
src/sys/arch/arm/arm32: cpu.c

Log Message:
Print the cache information in similar formats and arm and aarch64, e.g.


For classic ARM CPUs, info->[id]cache_sets are not set. This results in

cpu0 at mainbus0 core 0: SA-1110 step B-5 (SA-1 V4 core)
cpu0: DC enabled IC enabled WB enabled LABT
cpu0: L1 16KB/32B 32-way (0 set) VIVT Instruction cache
cpu0: L1 8KB/32B 32-way (0 set) write-back VIVT Data cache

or

cpu0 at mainbus0 core 0: ARM926EJ-S r0p0 (ARM9EJ-S V5TEJ core)
cpu0: DC enabled IC enabled WB enabled LABT
cpu0: L1 32KB/32B 1-way (0 set) VIVT Instruction cache
cpu0: L1 32KB/32B 1-way (0 set) write-back-locking-C VIVT Data cache

Can I commit the attached patch? Or initialize these variables somewhere
else?


I think your patch is fine. Thanks for fixing this.

Nick


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

2021-10-11 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Oct 11 07:32:52 UTC 2021

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

Log Message:
For some classic CPUs, info->[id]cache_sets are not initialized.
Calculate and print numbers of sets in this case.


To generate a diff of this commit:
cvs rdiff -u -r1.150 -r1.151 src/sys/arch/arm/arm32/cpu.c

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

Modified files:

Index: src/sys/arch/arm/arm32/cpu.c
diff -u src/sys/arch/arm/arm32/cpu.c:1.150 src/sys/arch/arm/arm32/cpu.c:1.151
--- src/sys/arch/arm/arm32/cpu.c:1.150	Mon Oct 11 07:19:37 2021
+++ src/sys/arch/arm/arm32/cpu.c	Mon Oct 11 07:32:52 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.c,v 1.150 2021/10/11 07:19:37 rin Exp $	*/
+/*	$NetBSD: cpu.c,v 1.151 2021/10/11 07:32:52 rin Exp $	*/
 
 /*
  * Copyright (c) 1995 Mark Brinicombe.
@@ -46,7 +46,7 @@
 #include "opt_multiprocessor.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.150 2021/10/11 07:19:37 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.151 2021/10/11 07:32:52 rin Exp $");
 
 #include 
 
@@ -612,7 +612,9 @@ print_cache_info(device_t dv, struct arm
 		level + 1,
 		info->dcache_size / 1024,
 		info->dcache_line_size, info->dcache_ways,
-		info->dcache_sets,
+		info->dcache_sets ? info->dcache_sets :
+			info->dcache_size /
+			(info->dcache_line_size * info->dcache_ways),
 		wtnames[info->cache_type],
 		info->dcache_type & CACHE_TYPE_PIxx ? 'P' : 'V',
 		info->dcache_type & CACHE_TYPE_xxPT ? 'P' : 'V');
@@ -621,14 +623,18 @@ print_cache_info(device_t dv, struct arm
 		level + 1,
 		info->icache_size / 1024,
 		info->icache_line_size, info->icache_ways,
-		info->icache_sets,
+		info->icache_sets ? info->icache_sets :
+			info->icache_size /
+			(info->icache_line_size * info->icache_ways),
 		info->icache_type & CACHE_TYPE_PIxx ? 'P' : 'V',
 		info->icache_type & CACHE_TYPE_xxPT ? 'P' : 'V');
 		aprint_normal_dev(dv, "L%u %dKB/%dB %d-way (%u set) %s %cI%cT Data cache\n",
 		level + 1,
 		info->dcache_size / 1024,
 		info->dcache_line_size, info->dcache_ways,
-		info->dcache_sets,
+		info->dcache_sets ? info->dcache_sets :
+			info->dcache_size /
+			(info->dcache_line_size * info->dcache_ways),
 		wtnames[info->cache_type],
 		info->dcache_type & CACHE_TYPE_PIxx ? 'P' : 'V',
 		info->dcache_type & CACHE_TYPE_xxPT ? 'P' : 'V');



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

2021-10-11 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Oct 11 07:32:52 UTC 2021

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

Log Message:
For some classic CPUs, info->[id]cache_sets are not initialized.
Calculate and print numbers of sets in this case.


To generate a diff of this commit:
cvs rdiff -u -r1.150 -r1.151 src/sys/arch/arm/arm32/cpu.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/evbarm/include

2021-10-11 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon Oct 11 07:31:19 UTC 2021

Added Files:
src/sys/arch/evbarm/include: efi.h

Log Message:
Fix builds


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/arch/evbarm/include/efi.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/evbarm/include

2021-10-11 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon Oct 11 07:31:19 UTC 2021

Added Files:
src/sys/arch/evbarm/include: efi.h

Log Message:
Fix builds


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/arch/evbarm/include/efi.h

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

Added files:

Index: src/sys/arch/evbarm/include/efi.h
diff -u /dev/null src/sys/arch/evbarm/include/efi.h:1.1
--- /dev/null	Mon Oct 11 07:31:19 2021
+++ src/sys/arch/evbarm/include/efi.h	Mon Oct 11 07:31:19 2021
@@ -0,0 +1,3 @@
+/*	$NetBSD: efi.h,v 1.1 2021/10/11 07:31:19 skrll Exp $	*/
+
+#include 



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

2021-10-11 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Oct 11 07:26:17 UTC 2021

Modified Files:
src/sys/arch/arm/arm32: spl.S

Log Message:
splx: Restore interrupts before dosoftints() for __HAVE_FAST_SOFTINTS.

No functional changes; All the users of arm32/spl.S, i.e., acorn32,
hpcarm/sa11x0, and shark have not switched to __HAVE_FAST_SOFTINTS yet.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/arm/arm32/spl.S

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

Modified files:

Index: src/sys/arch/arm/arm32/spl.S
diff -u src/sys/arch/arm/arm32/spl.S:1.10 src/sys/arch/arm/arm32/spl.S:1.11
--- src/sys/arch/arm/arm32/spl.S:1.10	Mon Dec  2 18:36:10 2013
+++ src/sys/arch/arm/arm32/spl.S	Mon Oct 11 07:26:17 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: spl.S,v 1.10 2013/12/02 18:36:10 joerg Exp $	*/
+/*	$NetBSD: spl.S,v 1.11 2021/10/11 07:26:17 rin Exp $	*/
 
 /*
  * Copyright (c) 1996-1998 Mark Brinicombe.
@@ -43,7 +43,7 @@
 #include 
 #include 
 
-	RCSID("$NetBSD: spl.S,v 1.10 2013/12/02 18:36:10 joerg Exp $")
+	RCSID("$NetBSD: spl.S,v 1.11 2021/10/11 07:26:17 rin Exp $")
 
 	.text
 	.align	0
@@ -111,8 +111,8 @@ ENTRY(splx)
 	str	r3, [r1, #CI_CPL]	/* Store the new spl level */
 
 	bl	_C_LABEL(irq_setmasks)	/* Update the actual masks */
+	msr	cpsr_c, r4
 #ifdef __HAVE_FAST_SOFTINTS
 	bl	_C_LABEL(dosoftints)	/* Process any pending soft ints */
 #endif
-	msr	cpsr_c, r4
 	ldmfd	sp!, {r0, r1, r4, pc}



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

2021-10-11 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Oct 11 07:26:17 UTC 2021

Modified Files:
src/sys/arch/arm/arm32: spl.S

Log Message:
splx: Restore interrupts before dosoftints() for __HAVE_FAST_SOFTINTS.

No functional changes; All the users of arm32/spl.S, i.e., acorn32,
hpcarm/sa11x0, and shark have not switched to __HAVE_FAST_SOFTINTS yet.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/arm/arm32/spl.S

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



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

2021-10-11 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Oct 11 07:19:37 UTC 2021

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

Log Message:
pN steppings are used for ARM926EJ-S, although only r0 seems to be available.


To generate a diff of this commit:
cvs rdiff -u -r1.149 -r1.150 src/sys/arch/arm/arm32/cpu.c

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

Modified files:

Index: src/sys/arch/arm/arm32/cpu.c
diff -u src/sys/arch/arm/arm32/cpu.c:1.149 src/sys/arch/arm/arm32/cpu.c:1.150
--- src/sys/arch/arm/arm32/cpu.c:1.149	Thu Sep 23 06:34:00 2021
+++ src/sys/arch/arm/arm32/cpu.c	Mon Oct 11 07:19:37 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.c,v 1.149 2021/09/23 06:34:00 skrll Exp $	*/
+/*	$NetBSD: cpu.c,v 1.150 2021/10/11 07:19:37 rin Exp $	*/
 
 /*
  * Copyright (c) 1995 Mark Brinicombe.
@@ -46,7 +46,7 @@
 #include "opt_multiprocessor.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.149 2021/09/23 06:34:00 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.150 2021/10/11 07:19:37 rin Exp $");
 
 #include 
 
@@ -476,8 +476,8 @@ const struct cpuidtab cpuids[] = {
 
 	{ CPU_ID_ARM1026EJS,	CPU_CLASS_ARM10EJ,	"ARM1026EJ-S",
 	  generic_steppings, "5TEJ" },
-	{ CPU_ID_ARM926EJS,	CPU_CLASS_ARM9EJS,	"ARM926EJ-S",
-	  generic_steppings, "5TEJ" },
+	{ CPU_ID_ARM926EJS,	CPU_CLASS_ARM9EJS,	"ARM926EJ-S r0",
+	  pN_steppings, "5TEJ" },
 
 	{ CPU_ID_ARM1136JS,	CPU_CLASS_ARM11J,	"ARM1136J-S r0",
 	  pN_steppings, "6J" },



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

2021-10-11 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Oct 11 07:19:37 UTC 2021

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

Log Message:
pN steppings are used for ARM926EJ-S, although only r0 seems to be available.


To generate a diff of this commit:
cvs rdiff -u -r1.149 -r1.150 src/sys/arch/arm/arm32/cpu.c

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



Re: CVS commit: src/sys/arch

2021-10-11 Thread Rin Okuyama

Hi,

On 2021/09/23 15:34, Nick Hudson wrote:

Module Name:src
Committed By:   skrll
Date:   Thu Sep 23 06:34:00 UTC 2021

Modified Files:
src/sys/arch/aarch64/aarch64: cpufunc.c
src/sys/arch/arm/arm32: cpu.c

Log Message:
Print the cache information in similar formats and arm and aarch64, e.g.


For classic ARM CPUs, info->[id]cache_sets are not set. This results in

cpu0 at mainbus0 core 0: SA-1110 step B-5 (SA-1 V4 core)
cpu0: DC enabled IC enabled WB enabled LABT
cpu0: L1 16KB/32B 32-way (0 set) VIVT Instruction cache
cpu0: L1 8KB/32B 32-way (0 set) write-back VIVT Data cache

or

cpu0 at mainbus0 core 0: ARM926EJ-S r0p0 (ARM9EJ-S V5TEJ core)
cpu0: DC enabled IC enabled WB enabled LABT
cpu0: L1 32KB/32B 1-way (0 set) VIVT Instruction cache
cpu0: L1 32KB/32B 1-way (0 set) write-back-locking-C VIVT Data cache

Can I commit the attached patch? Or initialize these variables somewhere else?

Thanks,
rin
Index: sys/arch/arm/arm32/cpu.c
===
RCS file: /home/netbsd/src/sys/arch/arm/arm32/cpu.c,v
retrieving revision 1.149
diff -p -u -r1.149 cpu.c
--- sys/arch/arm/arm32/cpu.c23 Sep 2021 06:34:00 -  1.149
+++ sys/arch/arm/arm32/cpu.c8 Oct 2021 00:11:34 -
@@ -612,7 +612,9 @@ print_cache_info(device_t dv, struct arm
level + 1,
info->dcache_size / 1024,
info->dcache_line_size, info->dcache_ways,
-   info->dcache_sets,
+   info->dcache_sets ? info->dcache_sets :
+   info->dcache_size /
+   (info->dcache_line_size * info->dcache_ways),
wtnames[info->cache_type],
info->dcache_type & CACHE_TYPE_PIxx ? 'P' : 'V',
info->dcache_type & CACHE_TYPE_xxPT ? 'P' : 'V');
@@ -621,14 +623,18 @@ print_cache_info(device_t dv, struct arm
level + 1,
info->icache_size / 1024,
info->icache_line_size, info->icache_ways,
-   info->icache_sets,
+   info->icache_sets ? info->icache_sets :
+   info->icache_size /
+   (info->icache_line_size * info->icache_ways),
info->icache_type & CACHE_TYPE_PIxx ? 'P' : 'V',
info->icache_type & CACHE_TYPE_xxPT ? 'P' : 'V');
aprint_normal_dev(dv, "L%u %dKB/%dB %d-way (%u set) %s %cI%cT 
Data cache\n",
level + 1,
info->dcache_size / 1024,
info->dcache_line_size, info->dcache_ways,
-   info->dcache_sets,
+   info->dcache_sets ? info->dcache_sets :
+   info->dcache_size /
+   (info->dcache_line_size * info->dcache_ways),
wtnames[info->cache_type],
info->dcache_type & CACHE_TYPE_PIxx ? 'P' : 'V',
info->dcache_type & CACHE_TYPE_xxPT ? 'P' : 'V');