CVS commit: src/share/mk

2021-10-14 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Thu Oct 14 11:46:46 UTC 2021

Modified Files:
src/share/mk: bsd.own.mk

Log Message:
mk: Enable MKRELRO on aarch64 to match x86.


To generate a diff of this commit:
cvs rdiff -u -r1.1264 -r1.1265 src/share/mk/bsd.own.mk

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

Modified files:

Index: src/share/mk/bsd.own.mk
diff -u src/share/mk/bsd.own.mk:1.1264 src/share/mk/bsd.own.mk:1.1265
--- src/share/mk/bsd.own.mk:1.1264	Thu Oct 14 11:45:46 2021
+++ src/share/mk/bsd.own.mk	Thu Oct 14 11:46:45 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.own.mk,v 1.1264 2021/10/14 11:45:46 nia Exp $
+#	$NetBSD: bsd.own.mk,v 1.1265 2021/10/14 11:46:45 nia Exp $
 
 # This needs to be before bsd.init.mk
 .if defined(BSD_MK_COMPAT_FILE)
@@ -1121,10 +1121,12 @@ MKPIE?=		no
 .endif
 
 #
-# RELRO is enabled on i386 and amd64 by default
+# RELRO is enabled on i386, amd64, and aarch64 by default
 #
 .if ${MACHINE_ARCH} == "i386" || \
-${MACHINE_ARCH} == "x86_64"
+${MACHINE_ARCH} == "x86_64" || \
+${MACHINE_ARCH} == "aarch64" || \
+${MACHINE_ARCH} == "aarch64eb"
 MKRELRO?=	partial
 .else
 MKRELRO?=	no



CVS commit: src/share/mk

2021-10-14 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Thu Oct 14 11:45:46 UTC 2021

Modified Files:
src/share/mk: bsd.README bsd.own.mk

Log Message:
mk: Enable MKARGON2 now that this stuff works.


To generate a diff of this commit:
cvs rdiff -u -r1.418 -r1.419 src/share/mk/bsd.README
cvs rdiff -u -r1.1263 -r1.1264 src/share/mk/bsd.own.mk

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

Modified files:

Index: src/share/mk/bsd.README
diff -u src/share/mk/bsd.README:1.418 src/share/mk/bsd.README:1.419
--- src/share/mk/bsd.README:1.418	Sun Sep 26 15:52:40 2021
+++ src/share/mk/bsd.README	Thu Oct 14 11:45:46 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.README,v 1.418 2021/09/26 15:52:40 maya Exp $
+#	$NetBSD: bsd.README,v 1.419 2021/10/14 11:45:46 nia Exp $
 #	@(#)bsd.README	8.2 (Berkeley) 4/2/94
 
 This is the README file for the make "include" files for the NetBSD
@@ -113,6 +113,9 @@ MAKEVERBOSE	Control how "verbose" the st
 		3	Ignore the effect of the "@" prefix in make commands
 		4	Trace shell commands using the shell's -x flag
 
+MKARGON2	If "no", don't build support for Argon2 into libcrypt.
+		Default: yes
+
 MKATF		If "no", don't build the Automated Testing Framework (ATF),
 		which includes the libatf-c, libatf-c++ and libatf-sh libraries
 		and the various command line tools.  Also, because the build of

Index: src/share/mk/bsd.own.mk
diff -u src/share/mk/bsd.own.mk:1.1263 src/share/mk/bsd.own.mk:1.1264
--- src/share/mk/bsd.own.mk:1.1263	Thu Sep 30 20:02:54 2021
+++ src/share/mk/bsd.own.mk	Thu Oct 14 11:45:46 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.own.mk,v 1.1263 2021/09/30 20:02:54 jmcneill Exp $
+#	$NetBSD: bsd.own.mk,v 1.1264 2021/10/14 11:45:46 nia Exp $
 
 # This needs to be before bsd.init.mk
 .if defined(BSD_MK_COMPAT_FILE)
@@ -1140,6 +1140,7 @@ MKSTATICPIE?=	no
 # MK* options which default to "yes".
 #
 _MKVARS.yes= \
+	MKARGON2 \
 	MKATF \
 	MKBINUTILS \
 	MKBSDTAR \
@@ -1281,7 +1282,6 @@ MKLLVMRT.aarch64=	yes
 # sorted with at most one letter per line.
 #
 _MKVARS.no= \
-	MKARGON2 \
 	MKARZERO \
 	MKBSDGREP \
 	MKCATPAGES MKCOMPATTESTS MKCOMPATX11 MKCTF \



CVS commit: src

2021-10-14 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Thu Oct 14 17:42:13 UTC 2021

Modified Files:
src/distrib/sets/lists/tests: mi
src/tests/usr.bin/indent: Makefile t_errors.sh
Added Files:
src/tests/usr.bin/indent: t_misc.sh

Log Message:
tests/indent: provide full line coverage for argument handling


To generate a diff of this commit:
cvs rdiff -u -r1.1137 -r1.1138 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.14 -r1.15 src/tests/usr.bin/indent/Makefile
cvs rdiff -u -r1.1 -r1.2 src/tests/usr.bin/indent/t_errors.sh
cvs rdiff -u -r0 -r1.1 src/tests/usr.bin/indent/t_misc.sh

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/tests/mi
diff -u src/distrib/sets/lists/tests/mi:1.1137 src/distrib/sets/lists/tests/mi:1.1138
--- src/distrib/sets/lists/tests/mi:1.1137	Wed Oct 13 23:33:52 2021
+++ src/distrib/sets/lists/tests/mi	Thu Oct 14 17:42:12 2021
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1137 2021/10/13 23:33:52 rillig Exp $
+# $NetBSD: mi,v 1.1138 2021/10/14 17:42:12 rillig Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -5007,6 +5007,7 @@
 ./usr/tests/usr.bin/indent/surplusbad.0.stdouttests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/indent/t_errors	tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/indent/t_indent	tests-usr.bin-tests	compattestfile,atf
+./usr/tests/usr.bin/indent/t_misc	tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/indent/token-binary_op.0tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/indent/token-binary_op.0.pro			tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/indent/token-binary_op.0.stdout			tests-usr.bin-tests	compattestfile,atf

Index: src/tests/usr.bin/indent/Makefile
diff -u src/tests/usr.bin/indent/Makefile:1.14 src/tests/usr.bin/indent/Makefile:1.15
--- src/tests/usr.bin/indent/Makefile:1.14	Wed Oct 13 23:33:52 2021
+++ src/tests/usr.bin/indent/Makefile	Thu Oct 14 17:42:13 2021
@@ -1,10 +1,11 @@
-#	$NetBSD: Makefile,v 1.14 2021/10/13 23:33:52 rillig Exp $
+#	$NetBSD: Makefile,v 1.15 2021/10/14 17:42:13 rillig Exp $
 
 .include 
 
 TESTSDIR=	${TESTSBASE}/usr.bin/indent
 TESTS_SH=	t_errors
 TESTS_SH+=	t_indent
+TESTS_SH+=	t_misc
 
 FILESDIR=	${TESTSDIR}
 FILES=		binary.0

Index: src/tests/usr.bin/indent/t_errors.sh
diff -u src/tests/usr.bin/indent/t_errors.sh:1.1 src/tests/usr.bin/indent/t_errors.sh:1.2
--- src/tests/usr.bin/indent/t_errors.sh:1.1	Wed Oct 13 23:33:52 2021
+++ src/tests/usr.bin/indent/t_errors.sh	Thu Oct 14 17:42:13 2021
@@ -1,5 +1,5 @@
 #! /bin/sh
-# $NetBSD: t_errors.sh,v 1.1 2021/10/13 23:33:52 rillig Exp $
+# $NetBSD: t_errors.sh,v 1.2 2021/10/14 17:42:13 rillig Exp $
 #
 # Copyright (c) 2021 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -27,32 +27,105 @@
 #
 # $FreeBSD$
 
+# Tests for error handling in indent.
+
 indent=$(atf_config_get usr.bin.indent.test_indent /usr/bin/indent)
 nl='
 '
 
+expect_error()
+{
+	local msg
+
+	msg="$1"
+	shift
+
+	atf_check -s 'exit:1' \
+	-e "inline:$msg$nl" \
+	"$indent" "$@"
+}
+
 atf_test_case 'option_unknown'
 option_unknown_body()
 {
-	atf_check -s 'exit:1' \
-	-e 'inline:indent: Command line: unknown option "-Z-unknown"'"$nl" \
-	"$indent" -Z-unknown
+	expect_error \
+	'indent: Command line: unknown option "-Z-unknown"' \
+	-Z-unknown
 }
 
 atf_test_case 'option_bool_trailing_garbage'
 option_bool_trailing_garbage_body()
 {
-	atf_check -s 'exit:1' \
-	-e 'inline:indent: Command line: unknown option "-bacchus"'"$nl" \
-	"$indent" -bacchus
+	expect_error \
+	'indent: Command line: unknown option "-bacchus"' \
+	-bacchus
 }
 
 atf_test_case 'option_int_missing_parameter'
 option_int_missing_parameter_body()
 {
+	expect_error \
+	'indent: Command line: option "-ts" requires an integer parameter' \
+	-tsx
+}
+
+atf_test_case 'option_profile_not_found'
+option_profile_not_found_body()
+{
+	expect_error \
+	'indent: profile ./nonexistent: No such file or directory' \
+	-P./nonexistent
+}
+
+atf_test_case 'option_typedefs_not_found'
+option_typedefs_not_found_body()
+{
+	expect_error \
+	'indent: cannot open file ./nonexistent' \
+	-U./nonexistent
+}
+
+atf_test_case 'option_buffer_overflow'
+option_buffer_overflow_body()
+{
+	opt='12345678123456781234567812345678'	# 32
+	opt="$opt$opt$opt$opt$opt$opt$opt$opt"	# 256
+	opt="$opt$opt$opt$opt$opt$opt$opt$opt"	# 2048
+	opt="$opt$opt$opt$opt$opt$opt$opt$opt"	# 16384
+	printf '%s\n' "-$opt" > indent.pro
+
+	# TODO: The call to 'diag' should be replaced with 'errx'.
+	expect_error \
+	'Error@1: buffer overflow in indent.pro, starting with '\''-123456781'\''' \
+	-Pindent.pro
+}
+
+atf_test_case 'option_special_missing_param'
+option_special_missing_param_body()
+{
+	# TODO: Write '-cli' instead of only 'cli'.
+	expect_error \
+	'indent: Command line: 

CVS commit: src

2021-10-14 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Oct 14 15:40:00 UTC 2021

Modified Files:
src: UPDATING

Log Message:
aarch64 needs a clean build after MKRELRO default has changed.


To generate a diff of this commit:
cvs rdiff -u -r1.321 -r1.322 src/UPDATING

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



CVS commit: src/share/mk

2021-10-14 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Thu Oct 14 11:45:46 UTC 2021

Modified Files:
src/share/mk: bsd.README bsd.own.mk

Log Message:
mk: Enable MKARGON2 now that this stuff works.


To generate a diff of this commit:
cvs rdiff -u -r1.418 -r1.419 src/share/mk/bsd.README
cvs rdiff -u -r1.1263 -r1.1264 src/share/mk/bsd.own.mk

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-14 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Thu Oct 14 09:56:12 UTC 2021

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

Log Message:
- use microtime instead of getmicrotime, suggested by thorpej
- use ttclos for wchan even though we are sleeping in comopen now


To generate a diff of this commit:
cvs rdiff -u -r1.368 -r1.369 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.368 src/sys/dev/ic/com.c:1.369
--- src/sys/dev/ic/com.c:1.368	Tue Oct 12 08:09:50 2021
+++ src/sys/dev/ic/com.c	Thu Oct 14 09:56:12 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: com.c,v 1.368 2021/10/12 08:09:50 kre Exp $ */
+/* $NetBSD: com.c,v 1.369 2021/10/14 09:56:12 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.368 2021/10/12 08:09:50 kre Exp $");
+__KERNEL_RCSID(0, "$NetBSD: com.c,v 1.369 2021/10/14 09:56:12 jmcneill Exp $");
 
 #include "opt_com.h"
 #include "opt_ddb.h"
@@ -891,7 +891,7 @@ com_shutdown(struct com_softc *sc)
 	 */
 	if (ISSET(tp->t_cflag, HUPCL)) {
 		com_modem(sc, 0);
-		getmicrotime(>sc_hup_pending);
+		microtime(>sc_hup_pending);
 		sc->sc_hup_pending.tv_sec++;
 	}
 
@@ -984,17 +984,14 @@ comopen(dev_t dev, int flag, int mode, s
 		}
 
 		if (timerisset(>sc_hup_pending)) {
-			getmicrotime();
+			microtime();
 			while (timercmp(, >sc_hup_pending, <)) {
-int ms;
-
-
 timersub(>sc_hup_pending, , );
-ms = diff.tv_sec * 1000 +
+const int ms = diff.tv_sec * 1000 +
 uimax(diff.tv_usec / 1000, 1);
-kpause("comopen", false, mstohz(ms),
+kpause(ttclos, false, mstohz(ms),
 >sc_lock);
-getmicrotime();
+microtime();
 			}
 			timerclear(>sc_hup_pending);
 		}



CVS commit: src/sys/dev/ic

2021-10-14 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Thu Oct 14 09:56:12 UTC 2021

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

Log Message:
- use microtime instead of getmicrotime, suggested by thorpej
- use ttclos for wchan even though we are sleeping in comopen now


To generate a diff of this commit:
cvs rdiff -u -r1.368 -r1.369 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/usr.sbin/tprof

2021-10-14 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu Oct 14 09:52:40 UTC 2021

Modified Files:
src/usr.sbin/tprof: tprof_analyze.c

Log Message:
Output alignement - give lwp 6 characters


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/usr.sbin/tprof/tprof_analyze.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.sbin/tprof/tprof_analyze.c
diff -u src/usr.sbin/tprof/tprof_analyze.c:1.4 src/usr.sbin/tprof/tprof_analyze.c:1.5
--- src/usr.sbin/tprof/tprof_analyze.c:1.4	Sat Jan 30 11:46:25 2021
+++ src/usr.sbin/tprof/tprof_analyze.c	Thu Oct 14 09:52:40 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: tprof_analyze.c,v 1.4 2021/01/30 11:46:25 jmcneill Exp $	*/
+/*	$NetBSD: tprof_analyze.c,v 1.5 2021/10/14 09:52:40 skrll Exp $	*/
 
 /*
  * Copyright (c) 2010,2011,2012 YAMAMOTO Takashi,
@@ -28,7 +28,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: tprof_analyze.c,v 1.4 2021/01/30 11:46:25 jmcneill Exp $");
+__RCSID("$NetBSD: tprof_analyze.c,v 1.5 2021/10/14 09:52:40 skrll Exp $");
 #endif /* not lint */
 
 #include 
@@ -423,8 +423,8 @@ tprof_analyze(int argc, char **argv)
 	 */
 	printf("File: %s\n", argv[0]);
 	printf("Number of samples: %zu\n\n", nsamples);
-	printf("percentage   nsamples pidlwp  cpu  k address  symbol\n");
-	printf("  --   -  --\n");
+	printf("percentage   nsamples pidlwpcpu  k address  symbol\n");
+	printf("  -- --  -  --\n");
 	for (i = 0; i < naddrs; i++) {
 		const char *name;
 		char buf[100];
@@ -448,7 +448,7 @@ tprof_analyze(int argc, char **argv)
 
 		perc = ((float)a->nsamples / (float)nsamples) * 100.0;
 
-		printf("%11f%% %8u %6" PRIu32 " %4" PRIu32 " %4" PRIu32 " %u %016"
+		printf("%11f%% %8u %6" PRIu32 " %6" PRIu32 " %4" PRIu32 " %u %016"
 		PRIx64 " %s\n",
 		perc,
 		a->nsamples, a->pid, a->lwpid, a->cpuid, a->in_kernel,



CVS commit: src/share/man/man4

2021-10-14 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Thu Oct 14 21:35:45 UTC 2021

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

Log Message:
New sentence, new line.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/share/man/man4/sgp40mox.4

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-14 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Thu Oct 14 21:35:45 UTC 2021

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

Log Message:
New sentence, new line.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/share/man/man4/sgp40mox.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/sgp40mox.4
diff -u src/share/man/man4/sgp40mox.4:1.1 src/share/man/man4/sgp40mox.4:1.2
--- src/share/man/man4/sgp40mox.4:1.1	Thu Oct 14 13:54:45 2021
+++ src/share/man/man4/sgp40mox.4	Thu Oct 14 21:35:45 2021
@@ -1,4 +1,4 @@
-.\" $NetBSD: sgp40mox.4,v 1.1 2021/10/14 13:54:45 brad Exp $
+.\" $NetBSD: sgp40mox.4,v 1.2 2021/10/14 21:35:45 wiz Exp $
 .\"
 .\" Copyright (c) 2021 Brad Spencer 
 .\"
@@ -41,9 +41,9 @@ nodes.
 .Pp
 In order to calculate the VOC index, the volatile organic compounds index, which
 is the measure of air quality the sensor is polled once a second and the raw sensor
-value is fed into the Sensirion VOC algorithm.  This VOC algorithm used in this driver
-is licensed under a 3 clause BSD license and was pulled from the Sensirion Github
-repository at
+value is fed into the Sensirion VOC algorithm.
+This VOC algorithm used in this driver is licensed under a 3 clause
+BSD license and was pulled from the Sensirion Github repository at
 .Rs
 .%U https://github.com/Sensirion/embedded-sgp
 .Re
@@ -54,10 +54,11 @@ variables are provided:
 .Bl -tag -width indent
 .It Li hw.sgp40mox0.compensation.temperature
 This should be set to the temperature in Celsius of the environment that the sensor
-is in.  The valid values are from -45 to 130 degrees Celsius.
+is in.
+The valid values are from -45 to 130 degrees Celsius.
 .It Li hw.sgp40mox0.compensation.humidity
-This should be set to the %RH of the environment that the sensor is in.  The valid
-values are from 0 to 100.
+This should be set to the %RH of the environment that the sensor is in.
+The valid values are from 0 to 100.
 .Pp
 For the best performance of the VOC algorithm it is important that the temperature
 and %RH compensation values be current and set using the
@@ -98,10 +99,12 @@ The
 driver was written by
 .An Brad Spencer Aq Mt b...@anduin.eldar.org .
 .Sh BUGS
-The driver does not make complete use of the VOC algorithm.  In particular, there is no
-need to restart the algorithm from scratch if there is a stoppage of polling for less than
-10 minutes.  The driver does not have the ability to determine that, and therefore
+The driver does not make complete use of the VOC algorithm.
+In particular, there is no need to restart the algorithm from
+scratch if there is a stoppage of polling for less than 10 minutes.
+The driver does not have the ability to determine that, and therefore
 assumes that the sensor is completely cold each time the driver attaches to the chip.
 .Pp
 The temperature and humidity compensation could be allowed to contain fractional degrees Celsius
-and %RH.  The driver only supports setting whole numbers for either of those.
+and %RH.
+The driver only supports setting whole numbers for either of those.



CVS commit: src/usr.bin/indent

2021-10-14 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Thu Oct 14 20:23:43 UTC 2021

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

Log Message:
indent: clarify that 25 is a magic number

The extra line width for comments to the very right is just that, an
arbitrarily chosen number. It neither has to be a multiple of 8, nor of
the tabsize nor of the indentation. Since 25 is neither of these, this
makes it a perfect choice, allowing these extreme comments to have 22
characters per line with -sc (leading asterisks in comment
continuations, the default) or 25 without.

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.78 -r1.79 src/usr.bin/indent/pr_comment.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/pr_comment.c
diff -u src/usr.bin/indent/pr_comment.c:1.78 src/usr.bin/indent/pr_comment.c:1.79
--- src/usr.bin/indent/pr_comment.c:1.78	Thu Oct 14 20:15:18 2021
+++ src/usr.bin/indent/pr_comment.c	Thu Oct 14 20:23:43 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: pr_comment.c,v 1.78 2021/10/14 20:15:18 rillig Exp $	*/
+/*	$NetBSD: pr_comment.c,v 1.79 2021/10/14 20:23:43 rillig Exp $	*/
 
 /*-
  * SPDX-License-Identifier: BSD-4-Clause
@@ -43,7 +43,7 @@ static char sccsid[] = "@(#)pr_comment.c
 
 #include 
 #if defined(__NetBSD__)
-__RCSID("$NetBSD: pr_comment.c,v 1.78 2021/10/14 20:15:18 rillig Exp $");
+__RCSID("$NetBSD: pr_comment.c,v 1.79 2021/10/14 20:23:43 rillig Exp $");
 #elif defined(__FreeBSD__)
 __FBSDID("$FreeBSD: head/usr.bin/indent/pr_comment.c 334927 2018-06-10 16:44:18Z pstef $");
 #endif
@@ -168,9 +168,8 @@ process_comment(void)
 		? opt.decl_comment_column - 1 : opt.comment_column - 1;
 	if (com_ind <= target_ind)
 		com_ind = next_tab(target_ind);
-	/* XXX: the '+ 1' smells like an off-by-one error */
-	if (com_ind + 1 + 24 > adj_max_line_length)
-		adj_max_line_length = com_ind + 1 + 24;
+	if (com_ind + 25 > adj_max_line_length)
+		adj_max_line_length = com_ind + 25;
 	}
 }
 



CVS commit: src/usr.bin/indent

2021-10-14 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Thu Oct 14 20:15:18 UTC 2021

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

Log Message:
indent: turn ps.com_ind into local variable

This makes it immediately clear that ps.com_ind is computed in the first
part of process_comment and then only used from there.

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.77 -r1.78 src/usr.bin/indent/pr_comment.c

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



CVS commit: src/doc

2021-10-14 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Thu Oct 14 21:18:07 UTC 2021

Modified Files:
src/doc: CHANGES

Log Message:
doc: MKPIE/MKRELRO for aarch64


To generate a diff of this commit:
cvs rdiff -u -r1.2840 -r1.2841 src/doc/CHANGES

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



CVS commit: src/doc

2021-10-14 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Thu Oct 14 21:18:07 UTC 2021

Modified Files:
src/doc: CHANGES

Log Message:
doc: MKPIE/MKRELRO for aarch64


To generate a diff of this commit:
cvs rdiff -u -r1.2840 -r1.2841 src/doc/CHANGES

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

Modified files:

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.2840 src/doc/CHANGES:1.2841
--- src/doc/CHANGES:1.2840	Thu Oct 14 14:53:41 2021
+++ src/doc/CHANGES	Thu Oct 14 21:18:07 2021
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2840 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2841 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -441,3 +441,4 @@ Changes from NetBSD 9.0 to NetBSD 10.0:
 		[msaitoh 20211013]
 	sgp40mox(4): Driver for the Sensirion SGP40 MOx gas sensor for air quality
 		[brad 20211014]
+	aarch64: Enable MKRELRO and MKPIE by default. [nia 20211014]



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

2021-10-14 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Thu Oct 14 20:00:59 UTC 2021

Modified Files:
src/tests/usr.bin/indent: token-comment.0 token-comment.0.stdout

Log Message:
tests/indent: test comment to the right, collect more useful tests


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/tests/usr.bin/indent/token-comment.0
cvs rdiff -u -r1.13 -r1.14 src/tests/usr.bin/indent/token-comment.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-14 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Thu Oct 14 20:00:59 UTC 2021

Modified Files:
src/tests/usr.bin/indent: token-comment.0 token-comment.0.stdout

Log Message:
tests/indent: test comment to the right, collect more useful tests


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/tests/usr.bin/indent/token-comment.0
cvs rdiff -u -r1.13 -r1.14 src/tests/usr.bin/indent/token-comment.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/token-comment.0
diff -u src/tests/usr.bin/indent/token-comment.0:1.11 src/tests/usr.bin/indent/token-comment.0:1.12
--- src/tests/usr.bin/indent/token-comment.0:1.11	Tue Oct 12 21:08:37 2021
+++ src/tests/usr.bin/indent/token-comment.0	Thu Oct 14 20:00:59 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: token-comment.0,v 1.11 2021/10/12 21:08:37 rillig Exp $ */
+/* $NetBSD: token-comment.0,v 1.12 2021/10/14 20:00:59 rillig Exp $ */
 /* $FreeBSD$ */
 
 /*
@@ -190,3 +190,44 @@ while(cond)/*comment*/;
 	while(cond)
 	/*comment*/;
 }
+
+/*
+ * The following comment starts really far to the right. To avoid that each
+ * line only contains a single word, the maximum allowed line width is
+ * extended such that each comment line may contain 22 characters.
+ */
+int global_variable_with_really_long_name_that_reaches_up_to_column_xx;	/* 1234567890123456789 1 1234567890123456789 12 1234567890123456789 123 1234567890123456789 1234 1234567890123456789 12345 1234567890123456789 123456 */
+
+/*-
+ * TODO: systematically test comments
+ *
+ * - starting in column 1, with opt.format_col1_comments
+ * - starting in column 1, without opt.format_col1_comments
+ * - starting in column 9, independent of opt.format_col1_comments
+ * - starting in column 33, the default
+ * - starting in column 65, which is already close to the default right margin
+ * - starting in column 81, spilling into the right margin
+ *
+ * - block comment starting with '/' '*' '-'
+ * - block comment starting with '/' '*' '*'
+ * - block comment starting with '/' '*' '\n'
+ * - end-of-line comment starting with '//'
+ * - end-of-line comment starting with '//x', so without leading space
+ * - block comment starting with '/' '*' 'x', so without leading space
+ *
+ * - block/end-of-line comment to the right of a label
+ * - block/end-of-line comment to the right of code
+ * - block/end-of-line comment to the right of label with code
+ *
+ * - with/without opt.comment_delimiter_on_blankline
+ * - with/without opt.star_comment_cont
+ * - with/without opt.format_block_comments
+ * - with varying opt.max_line_length (32, 64, 80, 140)
+ * - with varying opt.unindent_displace (0, 2, -5)
+ * - with varying opt.indent_size (3, 4, 8)
+ * - with varying opt.tabsize (3, 4, 8, 16)
+ * - with varying opt.block_comment_max_line_length (60, 78, 90)
+ * - with varying opt.decl_comment_column (0, 1, 33, 80)
+ * - with/without ps.decl_on_line
+ * - with/without ps.last_nl
+ */

Index: src/tests/usr.bin/indent/token-comment.0.stdout
diff -u src/tests/usr.bin/indent/token-comment.0.stdout:1.13 src/tests/usr.bin/indent/token-comment.0.stdout:1.14
--- src/tests/usr.bin/indent/token-comment.0.stdout:1.13	Tue Oct 12 21:08:37 2021
+++ src/tests/usr.bin/indent/token-comment.0.stdout	Thu Oct 14 20:00:59 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: token-comment.0.stdout,v 1.13 2021/10/12 21:08:37 rillig Exp $ */
+/* $NetBSD: token-comment.0.stdout,v 1.14 2021/10/14 20:00:59 rillig Exp $ */
 /* $FreeBSD$ */
 
 /*
@@ -220,3 +220,53 @@ loop(void)
 /* $ XXX: The spaces around the comment look unintentional. */
 		 /* comment */ ;
 }
+
+/*
+ * The following comment starts really far to the right. To avoid that each
+ * line only contains a single word, the maximum allowed line width is
+ * extended such that each comment line may contain 22 characters.
+ */
+int		global_variable_with_really_long_name_that_reaches_up_to_column_xx;	/* 1234567890123456789 1
+			 * 1234567890123456789 12
+			 * 1234567890123456789
+			 * 123
+			 * 1234567890123456789
+			 * 1234
+			 * 1234567890123456789
+			 * 12345
+			 * 1234567890123456789
+			 * 123456 */
+
+/*-
+ * TODO: systematically test comments
+ *
+ * - starting in column 1, with opt.format_col1_comments
+ * - starting in column 1, without opt.format_col1_comments
+ * - starting in column 9, independent of opt.format_col1_comments
+ * - starting in column 33, the default
+ * - starting in column 65, which is already close to the default right margin
+ * - starting in column 81, spilling into the right margin
+ *
+ * - block comment starting with '/' '*' '-'
+ * - block comment starting with '/' '*' '*'
+ * - block comment starting with '/' '*' '\n'
+ * - end-of-line comment starting with '//'
+ * - end-of-line comment starting with '//x', so without leading space
+ * - block comment starting with '/' '*' 

CVS commit: src/usr.bin/indent

2021-10-14 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Thu Oct 14 20:23:43 UTC 2021

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

Log Message:
indent: clarify that 25 is a magic number

The extra line width for comments to the very right is just that, an
arbitrarily chosen number. It neither has to be a multiple of 8, nor of
the tabsize nor of the indentation. Since 25 is neither of these, this
makes it a perfect choice, allowing these extreme comments to have 22
characters per line with -sc (leading asterisks in comment
continuations, the default) or 25 without.

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.78 -r1.79 src/usr.bin/indent/pr_comment.c

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-14 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Thu Oct 14 20:23:31 UTC 2021

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

Log Message:
Add sgp40mox(4)


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/share/man/man4/iic.4

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-14 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Thu Oct 14 20:15:18 UTC 2021

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

Log Message:
indent: turn ps.com_ind into local variable

This makes it immediately clear that ps.com_ind is computed in the first
part of process_comment and then only used from there.

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.77 -r1.78 src/usr.bin/indent/pr_comment.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/pr_comment.c
diff -u src/usr.bin/indent/pr_comment.c:1.77 src/usr.bin/indent/pr_comment.c:1.78
--- src/usr.bin/indent/pr_comment.c:1.77	Wed Oct 13 22:38:02 2021
+++ src/usr.bin/indent/pr_comment.c	Thu Oct 14 20:15:18 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: pr_comment.c,v 1.77 2021/10/13 22:38:02 rillig Exp $	*/
+/*	$NetBSD: pr_comment.c,v 1.78 2021/10/14 20:15:18 rillig Exp $	*/
 
 /*-
  * SPDX-License-Identifier: BSD-4-Clause
@@ -43,7 +43,7 @@ static char sccsid[] = "@(#)pr_comment.c
 
 #include 
 #if defined(__NetBSD__)
-__RCSID("$NetBSD: pr_comment.c,v 1.77 2021/10/13 22:38:02 rillig Exp $");
+__RCSID("$NetBSD: pr_comment.c,v 1.78 2021/10/14 20:15:18 rillig Exp $");
 #elif defined(__FreeBSD__)
 __FBSDID("$FreeBSD: head/usr.bin/indent/pr_comment.c 334927 2018-06-10 16:44:18Z pstef $");
 #endif
@@ -125,6 +125,7 @@ process_comment(void)
 ssize_t last_blank;		/* index of the last blank in com.buf */
 bool break_delim = opt.comment_delimiter_on_blankline;
 int l_just_saw_decl = ps.just_saw_decl;
+int com_ind;
 
 adj_max_line_length = opt.max_line_length;
 ps.just_saw_decl = 0;
@@ -137,7 +138,7 @@ process_comment(void)
 if (ps.col_1 && !opt.format_col1_comments) {
 	may_wrap = false;
 	break_delim = false;
-	ps.com_ind = 0;
+	com_ind = 0;
 
 } else {
 	if (*inp.s == '-' || *inp.s == '*' || token.e[-1] == '/' ||
@@ -147,10 +148,10 @@ process_comment(void)
 	}
 
 	if (lab.s == lab.e && code.s == code.e) {
-	ps.com_ind = (ps.ind_level - opt.unindent_displace) * opt.indent_size;
+	com_ind = (ps.ind_level - opt.unindent_displace) * opt.indent_size;
 	adj_max_line_length = opt.block_comment_max_line_length;
-	if (ps.com_ind <= 0)
-		ps.com_ind = opt.format_col1_comments ? 0 : 1;
+	if (com_ind <= 0)
+		com_ind = opt.format_col1_comments ? 0 : 1;
 
 	} else {
 	break_delim = false;
@@ -163,16 +164,18 @@ process_comment(void)
 	else
 		target_ind = 0;
 
-	ps.com_ind = ps.decl_on_line || ps.ind_level == 0
+	com_ind = ps.decl_on_line || ps.ind_level == 0
 		? opt.decl_comment_column - 1 : opt.comment_column - 1;
-	if (ps.com_ind <= target_ind)
-		ps.com_ind = next_tab(target_ind);
+	if (com_ind <= target_ind)
+		com_ind = next_tab(target_ind);
 	/* XXX: the '+ 1' smells like an off-by-one error */
-	if (ps.com_ind + 1 + 24 > adj_max_line_length)
-		adj_max_line_length = ps.com_ind + 1 + 24;
+	if (com_ind + 1 + 24 > adj_max_line_length)
+		adj_max_line_length = com_ind + 1 + 24;
 	}
 }
 
+ps.com_ind = com_ind;
+
 if (!may_wrap) {
 	/*
 	 * Find out how much indentation there was originally, because that



CVS commit: src/share/man/man4

2021-10-14 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Thu Oct 14 20:23:31 UTC 2021

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

Log Message:
Add sgp40mox(4)


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/share/man/man4/iic.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/iic.4
diff -u src/share/man/man4/iic.4:1.29 src/share/man/man4/iic.4:1.30
--- src/share/man/man4/iic.4:1.29	Tue Oct  5 16:36:58 2021
+++ src/share/man/man4/iic.4	Thu Oct 14 20:23:31 2021
@@ -1,4 +1,4 @@
-.\"	$NetBSD: iic.4,v 1.29 2021/10/05 16:36:58 nia Exp $
+.\"	$NetBSD: iic.4,v 1.30 2021/10/14 20:23:31 nia Exp $
 .\"	$OpenBSD: iic.4,v 1.74 2008/09/10 16:13:43 reyk Exp $
 .\"
 .\" Copyright (c) 2004, 2006 Alexander Yurchenko 
@@ -16,7 +16,7 @@
 .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 .\"
-.Dd October 5, 2021
+.Dd October 14, 2021
 .Dt IIC 4
 .Os
 .Sh NAME
@@ -213,6 +213,8 @@ Seiko Instruments S-35390 real-time cloc
 JEDEC JC-42.4 compatible memory module temperature sensors
 .It Xr seeprom 4
 24-series I2C EEPROM driver
+.It Xr sgp40mox 4
+Sensirion SGP40 MOx gas sensors
 .It Xr sgsmix 4
 SGS 7433 Basic Audio Processor found in some Apple machines
 .It Xr sht4xtemp 4



CVS commit: src/tests/lib/libc/sys

2021-10-14 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Thu Oct 14 13:50:36 UTC 2021

Modified Files:
src/tests/lib/libc/sys: t_ptrace_register_wait.h

Log Message:
Remove trailing whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/lib/libc/sys/t_ptrace_register_wait.h

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

Modified files:

Index: src/tests/lib/libc/sys/t_ptrace_register_wait.h
diff -u src/tests/lib/libc/sys/t_ptrace_register_wait.h:1.3 src/tests/lib/libc/sys/t_ptrace_register_wait.h:1.4
--- src/tests/lib/libc/sys/t_ptrace_register_wait.h:1.3	Mon May 11 12:17:57 2020
+++ src/tests/lib/libc/sys/t_ptrace_register_wait.h	Thu Oct 14 13:50:36 2021
@@ -1,4 +1,4 @@
-/*  $NetBSD: t_ptrace_register_wait.h,v 1.3 2020/05/11 12:17:57 kamil Exp $   */
+/*  $NetBSD: t_ptrace_register_wait.h,v 1.4 2021/10/14 13:50:36 gson Exp $   */
 
 /*-
  * Copyright (c) 2016, 2017, 2018, 2019, 2020 The NetBSD Foundation, Inc.
@@ -44,7 +44,7 @@ access_regs(const char *regset, const ch
 #if defined(HAVE_FPREGS)
 	struct fpreg fpr;
 #endif
-	
+
 #if !defined(HAVE_GPREGS)
 	if (strcmp(regset, "regs") == 0)
 		atf_tc_fail("Impossible test scenario!");



CVS commit: src/tests/lib/libc/sys

2021-10-14 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Thu Oct 14 13:50:36 UTC 2021

Modified Files:
src/tests/lib/libc/sys: t_ptrace_register_wait.h

Log Message:
Remove trailing whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/lib/libc/sys/t_ptrace_register_wait.h

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



CVS commit: src/doc

2021-10-14 Thread Brad Spencer
Module Name:src
Committed By:   brad
Date:   Thu Oct 14 14:53:41 UTC 2021

Modified Files:
src/doc: 3RDPARTY CHANGES

Log Message:
Mention sht4xtemp and sgp40mox in CHANGES.  Add an entry for the Sensirion
VOC algorithm in 3RDPARTY.


To generate a diff of this commit:
cvs rdiff -u -r1.1820 -r1.1821 src/doc/3RDPARTY
cvs rdiff -u -r1.2839 -r1.2840 src/doc/CHANGES

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



CVS commit: src/doc

2021-10-14 Thread Brad Spencer
Module Name:src
Committed By:   brad
Date:   Thu Oct 14 14:53:41 UTC 2021

Modified Files:
src/doc: 3RDPARTY CHANGES

Log Message:
Mention sht4xtemp and sgp40mox in CHANGES.  Add an entry for the Sensirion
VOC algorithm in 3RDPARTY.


To generate a diff of this commit:
cvs rdiff -u -r1.1820 -r1.1821 src/doc/3RDPARTY
cvs rdiff -u -r1.2839 -r1.2840 src/doc/CHANGES

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

Modified files:

Index: src/doc/3RDPARTY
diff -u src/doc/3RDPARTY:1.1820 src/doc/3RDPARTY:1.1821
--- src/doc/3RDPARTY:1.1820	Sat Oct  2 11:01:53 2021
+++ src/doc/3RDPARTY	Thu Oct 14 14:53:41 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.1820 2021/10/02 11:01:53 kre Exp $
+#	$NetBSD: 3RDPARTY,v 1.1821 2021/10/14 14:53:41 brad Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -2260,3 +2260,16 @@ Responsible:	riastradh
 License:	bsd
 Location:	sys/external/bsd/libsodium
 Notes:
+
+Package:	Sensirion VOC index algorithm
+Version:	git commit hash 4f69c0d8e2f7192aeaf0d268211b1f54af50146b
+Current Vers:	git commit hash 4f69c0d8e2f7192aeaf0d268211b1f54af50146b
+Maintainer:	Brad Spencer
+Archive Site:	https://github.com/Sensirion/embedded-sgp
+Home Page:	https://github.com/Sensirion
+Date:		2021-09-30
+Mailing List:
+Responsible:	brad
+License:	BSD (3-clause)
+Location:	sys/dev/i2c/sensirion_voc_algorithm.c sys/dev/i2c/sensirion_voc_algorithm.h
+Notes:

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.2839 src/doc/CHANGES:1.2840
--- src/doc/CHANGES:1.2839	Wed Oct 13 08:29:26 2021
+++ src/doc/CHANGES	Thu Oct 14 14:53:41 2021
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2839 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2840 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -435,5 +435,9 @@ Changes from NetBSD 9.0 to NetBSD 10.0:
 		xf86-input-ws. [nia 20210928]
 	gnu-efi: Import version 3.0.14. [jmcneill 20210930]
 	tzdata partly updated to 2021b [kre 20211001] 
+	sht4xtemp(4): Driver for the Sensirion SHT40/SHT41/SHT45 temperature
+		and humidity sensor [brad 20211003]
 	wm(4): Add Tiger Lake and newer devices (I219V 15-V9 and LM 16-19).
 		[msaitoh 20211013]
+	sgp40mox(4): Driver for the Sensirion SGP40 MOx gas sensor for air quality
+		[brad 20211014]



CVS commit: src

2021-10-14 Thread Brad Spencer
Module Name:src
Committed By:   brad
Date:   Thu Oct 14 13:54:46 UTC 2021

Modified Files:
src/distrib/sets/lists/debug: module.mi
src/distrib/sets/lists/man: mi
src/distrib/sets/lists/modules: mi
src/share/man/man4: Makefile
src/sys/dev/i2c: files.i2c
src/sys/modules: Makefile
Added Files:
src/share/man/man4: sgp40mox.4
src/sys/dev/i2c: sensirion_arch_config.h sensirion_voc_algorithm.c
sensirion_voc_algorithm.h sgp40.c sgp40reg.h sgp40var.h
src/sys/modules/sgp40mox: Makefile sgp40mox.ioconf

Log Message:
A driver for the Sensirion SGP40 MOx gas sensor.  An example of this
chip from Adafruit is:

https://www.adafruit.com/product/4829

This is a moderately priced gas sensor that can detect volatile
organic compounds in the air.  The driver uses the 3-clause BSD
licensed VOC algorithm provided by Sensirion to turn the raw sensor
metric into a VOC index which can indicate the quality of the air in a
particular indoor environment.  All published functions of the chip
are supported and one unpublished feature.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/distrib/sets/lists/debug/module.mi
cvs rdiff -u -r1.1727 -r1.1728 src/distrib/sets/lists/man/mi
cvs rdiff -u -r1.147 -r1.148 src/distrib/sets/lists/modules/mi
cvs rdiff -u -r1.717 -r1.718 src/share/man/man4/Makefile
cvs rdiff -u -r0 -r1.1 src/share/man/man4/sgp40mox.4
cvs rdiff -u -r1.117 -r1.118 src/sys/dev/i2c/files.i2c
cvs rdiff -u -r0 -r1.1 src/sys/dev/i2c/sensirion_arch_config.h \
src/sys/dev/i2c/sensirion_voc_algorithm.c \
src/sys/dev/i2c/sensirion_voc_algorithm.h src/sys/dev/i2c/sgp40.c \
src/sys/dev/i2c/sgp40reg.h src/sys/dev/i2c/sgp40var.h
cvs rdiff -u -r1.258 -r1.259 src/sys/modules/Makefile
cvs rdiff -u -r0 -r1.1 src/sys/modules/sgp40mox/Makefile \
src/sys/modules/sgp40mox/sgp40mox.ioconf

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



CVS commit: src/share/mk

2021-10-14 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Thu Oct 14 12:58:30 UTC 2021

Modified Files:
src/share/mk: bsd.own.mk

Log Message:
mk: Enable MKPIE on aarch64 (it's already enabled on 32-bit arm)


To generate a diff of this commit:
cvs rdiff -u -r1.1265 -r1.1266 src/share/mk/bsd.own.mk

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



CVS commit: src

2021-10-14 Thread Brad Spencer
Module Name:src
Committed By:   brad
Date:   Thu Oct 14 13:54:46 UTC 2021

Modified Files:
src/distrib/sets/lists/debug: module.mi
src/distrib/sets/lists/man: mi
src/distrib/sets/lists/modules: mi
src/share/man/man4: Makefile
src/sys/dev/i2c: files.i2c
src/sys/modules: Makefile
Added Files:
src/share/man/man4: sgp40mox.4
src/sys/dev/i2c: sensirion_arch_config.h sensirion_voc_algorithm.c
sensirion_voc_algorithm.h sgp40.c sgp40reg.h sgp40var.h
src/sys/modules/sgp40mox: Makefile sgp40mox.ioconf

Log Message:
A driver for the Sensirion SGP40 MOx gas sensor.  An example of this
chip from Adafruit is:

https://www.adafruit.com/product/4829

This is a moderately priced gas sensor that can detect volatile
organic compounds in the air.  The driver uses the 3-clause BSD
licensed VOC algorithm provided by Sensirion to turn the raw sensor
metric into a VOC index which can indicate the quality of the air in a
particular indoor environment.  All published functions of the chip
are supported and one unpublished feature.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/distrib/sets/lists/debug/module.mi
cvs rdiff -u -r1.1727 -r1.1728 src/distrib/sets/lists/man/mi
cvs rdiff -u -r1.147 -r1.148 src/distrib/sets/lists/modules/mi
cvs rdiff -u -r1.717 -r1.718 src/share/man/man4/Makefile
cvs rdiff -u -r0 -r1.1 src/share/man/man4/sgp40mox.4
cvs rdiff -u -r1.117 -r1.118 src/sys/dev/i2c/files.i2c
cvs rdiff -u -r0 -r1.1 src/sys/dev/i2c/sensirion_arch_config.h \
src/sys/dev/i2c/sensirion_voc_algorithm.c \
src/sys/dev/i2c/sensirion_voc_algorithm.h src/sys/dev/i2c/sgp40.c \
src/sys/dev/i2c/sgp40reg.h src/sys/dev/i2c/sgp40var.h
cvs rdiff -u -r1.258 -r1.259 src/sys/modules/Makefile
cvs rdiff -u -r0 -r1.1 src/sys/modules/sgp40mox/Makefile \
src/sys/modules/sgp40mox/sgp40mox.ioconf

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/debug/module.mi
diff -u src/distrib/sets/lists/debug/module.mi:1.13 src/distrib/sets/lists/debug/module.mi:1.14
--- src/distrib/sets/lists/debug/module.mi:1.13	Mon Oct  4 07:04:39 2021
+++ src/distrib/sets/lists/debug/module.mi	Thu Oct 14 13:54:46 2021
@@ -1,4 +1,4 @@
-# $NetBSD: module.mi,v 1.13 2021/10/04 07:04:39 brad Exp $
+# $NetBSD: module.mi,v 1.14 2021/10/14 13:54:46 brad Exp $
 ./usr/libdata/debug/@MODULEDIR@	modules-base-kernel	kmod,debug
 ./usr/libdata/debug/@MODULEDIR@/accf_dataready			modules-base-kernel	kmod,debug
 ./usr/libdata/debug/@MODULEDIR@/accf_dataready/accf_dataready.kmod.debug	modules-base-kernel	kmod,debug
@@ -332,6 +332,8 @@
 ./usr/libdata/debug/@MODULEDIR@/securelevel/securelevel.kmod.debug	modules-base-kernel	kmod,debug
 ./usr/libdata/debug/@MODULEDIR@/sequencermodules-base-kernel	kmod,debug
 ./usr/libdata/debug/@MODULEDIR@/sequencer/sequencer.kmod.debug		modules-base-kernel	kmod,debug
+./usr/libdata/debug/@MODULEDIR@/sgp40moxmodules-base-kernel	kmod,debug
+./usr/libdata/debug/@MODULEDIR@/sgp40mox/sgp40mox.kmod.debug		modules-base-kernel	kmod,debug
 ./usr/libdata/debug/@MODULEDIR@/sht4xtempmodules-base-kernel	kmod,debug
 ./usr/libdata/debug/@MODULEDIR@/sht4xtemp/sht4xtemp.kmod.debug		modules-base-kernel	kmod,debug
 ./usr/libdata/debug/@MODULEDIR@/si70xxtempmodules-base-kernel	kmod,debug

Index: src/distrib/sets/lists/man/mi
diff -u src/distrib/sets/lists/man/mi:1.1727 src/distrib/sets/lists/man/mi:1.1728
--- src/distrib/sets/lists/man/mi:1.1727	Tue Oct 12 04:55:19 2021
+++ src/distrib/sets/lists/man/mi	Thu Oct 14 13:54:46 2021
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1727 2021/10/12 04:55:19 msaitoh Exp $
+# $NetBSD: mi,v 1.1728 2021/10/14 13:54:46 brad Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -1720,6 +1720,7 @@
 ./usr/share/man/cat4/sgimips/pic.0		man-sys-catman		.cat
 ./usr/share/man/cat4/sgimips/sq.0		man-sys-catman		.cat
 ./usr/share/man/cat4/sgimips/wdsc.0		man-sys-catman		.cat
+./usr/share/man/cat4/sgp40mox.0			man-sys-catman		.cat
 ./usr/share/man/cat4/sgsmix.0			man-sys-catman		.cat
 ./usr/share/man/cat4/shb.0			man-sys-catman		.cat
 ./usr/share/man/cat4/shmif.0			man-sys-catman		.cat
@@ -4895,6 +4896,7 @@
 ./usr/share/man/html4/sgimips/pic.html		man-sys-htmlman		html
 ./usr/share/man/html4/sgimips/sq.html		man-sys-htmlman		html
 ./usr/share/man/html4/sgimips/wdsc.html		man-sys-htmlman		html
+./usr/share/man/html4/sgp40mox.html		man-sys-htmlman		html
 ./usr/share/man/html4/sgsmix.html		man-sys-htmlman		html
 ./usr/share/man/html4/shb.html			man-sys-htmlman		html
 ./usr/share/man/html4/shmif.html		man-sys-htmlman		html
@@ -7976,6 +7978,7 @@
 ./usr/share/man/man4/sgimips/pic.4		man-sys-man		.man
 ./usr/share/man/man4/sgimips/sq.4		man-sys-man		.man
 ./usr/share/man/man4/sgimips/wdsc.4		man-sys-man		.man
+./usr/share/man/man4/sgp40mox.4			man-sys-man		.man
 

CVS commit: src/share/mk

2021-10-14 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Thu Oct 14 12:58:30 UTC 2021

Modified Files:
src/share/mk: bsd.own.mk

Log Message:
mk: Enable MKPIE on aarch64 (it's already enabled on 32-bit arm)


To generate a diff of this commit:
cvs rdiff -u -r1.1265 -r1.1266 src/share/mk/bsd.own.mk

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

Modified files:

Index: src/share/mk/bsd.own.mk
diff -u src/share/mk/bsd.own.mk:1.1265 src/share/mk/bsd.own.mk:1.1266
--- src/share/mk/bsd.own.mk:1.1265	Thu Oct 14 11:46:45 2021
+++ src/share/mk/bsd.own.mk	Thu Oct 14 12:58:30 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.own.mk,v 1.1265 2021/10/14 11:46:45 nia Exp $
+#	$NetBSD: bsd.own.mk,v 1.1266 2021/10/14 12:58:30 nia Exp $
 
 # This needs to be before bsd.init.mk
 .if defined(BSD_MK_COMPAT_FILE)
@@ -1110,6 +1110,8 @@ MKCTF?=		yes
 .if !defined(COVERITY_TOP_CONFIG) && \
 (${MACHINE_ARCH} == "i386" || \
 ${MACHINE_ARCH} == "x86_64" || \
+${MACHINE_ARCH} == "aarch64" || \
+${MACHINE_ARCH} == "aarch64eb" || \
 ${MACHINE_CPU} == "arm" || \
 ${MACHINE_CPU} == "m68k" || \
 ${MACHINE_CPU} == "mips" || \



CVS commit: src

2021-10-14 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Oct 14 15:40:00 UTC 2021

Modified Files:
src: UPDATING

Log Message:
aarch64 needs a clean build after MKRELRO default has changed.


To generate a diff of this commit:
cvs rdiff -u -r1.321 -r1.322 src/UPDATING

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

Modified files:

Index: src/UPDATING
diff -u src/UPDATING:1.321 src/UPDATING:1.322
--- src/UPDATING:1.321	Sat Sep 18 03:05:19 2021
+++ src/UPDATING	Thu Oct 14 15:40:00 2021
@@ -1,4 +1,4 @@
-$NetBSD: UPDATING,v 1.321 2021/09/18 03:05:19 christos Exp $
+$NetBSD: UPDATING,v 1.322 2021/10/14 15:40:00 martin Exp $
 
 This file (UPDATING) is intended to be a brief reference to recent
 changes that might cause problems in the build process, and a guide for
@@ -19,6 +19,9 @@ See also: BUILDING, build.sh, Makefile.
 Recent changes:
 ^^^
 
+20211014:
+	MKRELRO default for aarch64 has changed, a clean build is required.
+
 20210917:
 	Changed MNT_ACLS to default to POSIX1e ACLs instead of NFSv4
 	ACLs, to be compatible with FreeBSD. If you are using NFSv4 ACLs



CVS commit: src

2021-10-14 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Thu Oct 14 17:42:13 UTC 2021

Modified Files:
src/distrib/sets/lists/tests: mi
src/tests/usr.bin/indent: Makefile t_errors.sh
Added Files:
src/tests/usr.bin/indent: t_misc.sh

Log Message:
tests/indent: provide full line coverage for argument handling


To generate a diff of this commit:
cvs rdiff -u -r1.1137 -r1.1138 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.14 -r1.15 src/tests/usr.bin/indent/Makefile
cvs rdiff -u -r1.1 -r1.2 src/tests/usr.bin/indent/t_errors.sh
cvs rdiff -u -r0 -r1.1 src/tests/usr.bin/indent/t_misc.sh

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-14 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Thu Oct 14 18:55:41 UTC 2021

Modified Files:
src/tests/usr.bin/indent: t_errors.sh t_misc.sh

Log Message:
tests/indent: cover more error cases and inline indentation


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/usr.bin/indent/t_errors.sh
cvs rdiff -u -r1.1 -r1.2 src/tests/usr.bin/indent/t_misc.sh

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/t_errors.sh
diff -u src/tests/usr.bin/indent/t_errors.sh:1.2 src/tests/usr.bin/indent/t_errors.sh:1.3
--- src/tests/usr.bin/indent/t_errors.sh:1.2	Thu Oct 14 17:42:13 2021
+++ src/tests/usr.bin/indent/t_errors.sh	Thu Oct 14 18:55:41 2021
@@ -1,5 +1,5 @@
 #! /bin/sh
-# $NetBSD: t_errors.sh,v 1.2 2021/10/14 17:42:13 rillig Exp $
+# $NetBSD: t_errors.sh,v 1.3 2021/10/14 18:55:41 rillig Exp $
 #
 # Copyright (c) 2021 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -85,6 +85,48 @@ option_typedefs_not_found_body()
 	-U./nonexistent
 }
 
+atf_test_case 'option_tabsize_negative'
+option_tabsize_negative_body()
+{
+	expect_error \
+	'indent: Command line: option "-ts" requires an integer parameter' \
+	-ts-1
+}
+
+atf_test_case 'option_tabsize_zero'
+option_tabsize_zero_body()
+{
+	expect_error \
+	'indent: invalid tabsize 0' \
+	-ts0
+}
+
+atf_test_case 'option_tabsize_large'
+option_tabsize_large_body()
+{
+	# Integer overflow, on both ILP32 and LP64 platforms.
+	expect_error \
+	'indent: invalid tabsize 81' \
+	-ts81
+}
+
+atf_test_case 'option_tabsize_very_large'
+option_tabsize_very_large_body()
+{
+	# Integer overflow, on both ILP32 and LP64 platforms.
+	expect_error \
+	'indent: invalid tabsize -1294967296' \
+	-ts30
+}
+
+atf_test_case 'option_indent_size_zero'
+option_indent_size_zero_body()
+{
+	expect_error \
+	'indent: invalid indentation 0' \
+	-i0
+}
+
 atf_test_case 'option_buffer_overflow'
 option_buffer_overflow_body()
 {
@@ -128,6 +170,168 @@ unterminated_comment_body()
 	"$indent" -st < comment.c
 }
 
+atf_test_case 'in_place_wrong_backup'
+in_place_wrong_backup_body()
+{
+	cat <<-\EOF > code.c
+		int decl;
+	EOF
+	cp code.c code.c.orig
+
+	# Due to the strange backup suffix '/subdir', indent tries to create
+	# a file named 'code.c/subdir', but 'code.c' is already a regular
+	# file, not a directory.
+	atf_check -s 'exit:1' \
+	-e 'inline:indent: code.c/subdir: Not a directory'"$nl" \
+	env SIMPLE_BACKUP_SUFFIX="/subdir" "$indent" code.c
+
+	# Since there was an early error, the original file is kept as is.
+	atf_check -o 'file:code.c.orig' \
+	cat code.c
+}
+
+atf_test_case 'argument_input_enoent'
+argument_input_enoent_body()
+{
+	atf_check -s 'exit:1' \
+	-e 'inline:indent: ./nonexistent.c: No such file or directory'"$nl" \
+	"$indent" ./nonexistent.c
+}
+
+atf_test_case 'argument_output_equals_input_name'
+argument_output_equals_input_name_body()
+{
+	echo '/* comment */' > code.c
+
+	atf_check -s 'exit:1' \
+	-e 'inline:indent: input and output files must be different'"$nl" \
+	"$indent" code.c code.c
+}
+
+atf_test_case 'argument_output_equals_input_file'
+argument_output_equals_input_file_body()
+{
+	echo '/* comment */' > code.c
+
+	atf_check \
+	"$indent" code.c ./code.c
+
+	# Oops, the file has become empty since the output is first emptied,
+	# before reading any of the input.
+	atf_check \
+	cat code.c
+}
+
+atf_test_case 'argument_output_enoent'
+argument_output_enoent_body()
+{
+	expect_error \
+	'indent: subdir/nonexistent.c: No such file or directory' \
+	/dev/null subdir/nonexistent.c
+}
+
+atf_test_case 'argument_too_many'
+argument_too_many_body()
+{
+	echo '/* comment */' > arg1.c
+
+	expect_error \
+	'indent: unknown parameter: arg3.c' \
+	arg1.c arg2.c arg3.c arg4.c
+}
+
+atf_test_case 'unexpected_end_of_file'
+unexpected_end_of_file_body()
+{
+	echo 'struct{' > code.c
+
+	expect_error \
+	'Error@1: Stuff missing from end of file' \
+	code.c
+
+	atf_check \
+	-o 'inline:struct {'"$nl" \
+	cat code.c
+}
+
+atf_test_case 'unexpected_closing_brace_top_level'
+unexpected_closing_brace_top_level_body()
+{
+	echo '}' > code.c
+
+	expect_error \
+	'Error@1: Statement nesting error' \
+	code.c
+	atf_check \
+	-o 'inline:}'"$nl" \
+	cat code.c
+}
+
+atf_test_case 'unexpected_closing_brace_decl'
+unexpected_closing_brace_decl_body()
+{
+	echo 'int i = 3};' > code.c
+
+	expect_error \
+	'Error@1: Statement nesting error' \
+	code.c
+	# Despite the error message, the original file got overwritten with a
+	# best-effort rewrite of the code.
+	atf_check \
+	-o 'inline:int		i = 3};'"$nl" \
+	cat code.c
+}
+
+atf_test_case 'preprocessing_overflow'
+preprocessing_overflow_body()
+{
+	cat <<-\EOF > code.c
+		#if 1
+		#if 2
+		#if 3
+		#if 4
+		#if 5
+		#if 6
+		#endif 6
+		#endif 5
+		

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

2021-10-14 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Thu Oct 14 18:55:41 UTC 2021

Modified Files:
src/tests/usr.bin/indent: t_errors.sh t_misc.sh

Log Message:
tests/indent: cover more error cases and inline indentation


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/usr.bin/indent/t_errors.sh
cvs rdiff -u -r1.1 -r1.2 src/tests/usr.bin/indent/t_misc.sh

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



CVS commit: src/usr.sbin/tprof

2021-10-14 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu Oct 14 09:52:40 UTC 2021

Modified Files:
src/usr.sbin/tprof: tprof_analyze.c

Log Message:
Output alignement - give lwp 6 characters


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/usr.sbin/tprof/tprof_analyze.c

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



CVS commit: src/share/mk

2021-10-14 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Thu Oct 14 11:46:46 UTC 2021

Modified Files:
src/share/mk: bsd.own.mk

Log Message:
mk: Enable MKRELRO on aarch64 to match x86.


To generate a diff of this commit:
cvs rdiff -u -r1.1264 -r1.1265 src/share/mk/bsd.own.mk

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



CVS commit: src/sys/arch/mips/mips

2021-10-14 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Thu Oct 14 02:22:25 UTC 2021

Modified Files:
src/sys/arch/mips/mips: vm_machdep.c

Log Message:
cpu_uarea_alloc: For ILP32, do not try to allocate physical memory above
pmap_limits.avail_end.

Fix NULL dereference in uvm_pglistalloc_contig_aggressive().


To generate a diff of this commit:
cvs rdiff -u -r1.162 -r1.163 src/sys/arch/mips/mips/vm_machdep.c

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