Re: CVS commit: src/lib/libc/stdlib

2022-02-12 Thread Warner Losh
On Sat, Feb 12, 2022, 11:52 AM Taylor R Campbell <
campbell+netbsd-source-change...@mumble.net> wrote:

> > Date: Sun, 13 Feb 2022 05:44:38 +1100
> > from: matthew green 
> >
> > "Roland Illig" writes:
> > > Module Name:src
> > > Committed By:   rillig
> > > Date:   Fri Feb 11 21:36:46 UTC 2022
> > >
> > > Modified Files:
> > > src/lib/libc/stdlib: getenv.c
> > >
> > > Log Message:
> > > libc/getenv: remove trailing whitespace
> > >
> > > No binary change.
> >
> > please avoid purely whitespace changes unless you're
> > also going to be modifying the code itself.
> >
> > (don't back out now.)
>
> I thought we were supposed to _avoid_ mixing whitespace changes and
> functional changes?
>
> (Obviously the solution is to just only ever commit code with perfect
> style to begin with so this is never an issue!  Speaking of which,
> (setq show-trailing-whitespace t) is helpful to avoid this kind of
> mistake up front.  git diff or git add -p will also flag this kind of
> mistake, if you're working in git.  /usr/share/misc/NetBSD.el is also
> helpful for other KNF style.)
>

I thought the rule was don't make purely whitespace changes UNLESS you plan
on making other changes to (or are fixing an oops you just made). If that's
the case, separate the two commits.

Warner

>


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

2022-02-12 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Sun Feb 13 00:39:45 UTC 2022

Modified Files:
src/sys/arch/arm/at91: at91usartreg.h

Log Message:
s/Errorrs/Errors/


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/at91/at91usartreg.h

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

Modified files:

Index: src/sys/arch/arm/at91/at91usartreg.h
diff -u src/sys/arch/arm/at91/at91usartreg.h:1.3 src/sys/arch/arm/at91/at91usartreg.h:1.4
--- src/sys/arch/arm/at91/at91usartreg.h:1.3	Fri Oct 23 06:53:13 2009
+++ src/sys/arch/arm/at91/at91usartreg.h	Sun Feb 13 00:39:45 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: at91usartreg.h,v 1.3 2009/10/23 06:53:13 snj Exp $	*/
+/*	$NetBSD: at91usartreg.h,v 1.4 2022/02/13 00:39:45 andvar Exp $	*/
 
 /*
  * Copyright (c) 2007 Embedtronics Oy. All rights reserved.
@@ -40,7 +40,7 @@
 #define	US_RTOR		0x24U	/* 0x24: Receiver Time-out Reg	*/
 #define	US_TTGR		0x28U	/* 0x28: Transmitter Timeguard Reg */
 #define	US_FIDI		0x40U	/* 0x40: FI DI Ratio Register	*/
-#define	US_NER		0x44U	/* 0x44: Number of Errorrs Reg	*/
+#define	US_NER		0x44U	/* 0x44: Number of Errors Reg	*/
 #define	US_IF		0x4CU	/* 0x4C: IrDA Filter Register	*/
 #define	US_PDC		0x100U	/* 0x100: PDC			*/
 



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

2022-02-12 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Sun Feb 13 00:39:45 UTC 2022

Modified Files:
src/sys/arch/arm/at91: at91usartreg.h

Log Message:
s/Errorrs/Errors/


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/at91/at91usartreg.h

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



CVS commit: src/usr.sbin/mopd/mopcopy

2022-02-12 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Sun Feb 13 00:30:10 UTC 2022

Modified Files:
src/usr.sbin/mopd/mopcopy: mopcopy.c

Log Message:
s/mahine/machine/


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/usr.sbin/mopd/mopcopy/mopcopy.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/mopd/mopcopy/mopcopy.c
diff -u src/usr.sbin/mopd/mopcopy/mopcopy.c:1.9 src/usr.sbin/mopd/mopcopy/mopcopy.c:1.10
--- src/usr.sbin/mopd/mopcopy/mopcopy.c:1.9	Thu Oct 29 08:50:42 2020
+++ src/usr.sbin/mopd/mopcopy/mopcopy.c	Sun Feb 13 00:30:10 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: mopcopy.c,v 1.9 2020/10/29 08:50:42 martin Exp $	*/
+/*	$NetBSD: mopcopy.c,v 1.10 2022/02/13 00:30:10 andvar Exp $	*/
 
 /* mopcopy - Convert a Unix format kernel into something that
  * can be transferred via MOP.
@@ -10,7 +10,7 @@
  * If necessary, the a.out header is stripped, and the program
  * segments are padded out. The BSS segment is zero filled.
  * A header is prepended that looks like an IHD header. In 
- * particular the Unix mahine ID is placed where mopd expects
+ * particular the Unix machine ID is placed where mopd expects
  * the image type to be (offset is IHD_W_ALIAS). If the machine
  * ID could be mistaken for a DEC image type, then the conversion 
  * is aborted. The original a.out header is copied into the front
@@ -49,7 +49,7 @@
 
 #include "port.h"
 #ifndef lint
-__RCSID("$NetBSD: mopcopy.c,v 1.9 2020/10/29 08:50:42 martin Exp $");
+__RCSID("$NetBSD: mopcopy.c,v 1.10 2022/02/13 00:30:10 andvar Exp $");
 #endif
 
 #include "os.h"



CVS commit: src/usr.sbin/mopd/mopcopy

2022-02-12 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Sun Feb 13 00:30:10 UTC 2022

Modified Files:
src/usr.sbin/mopd/mopcopy: mopcopy.c

Log Message:
s/mahine/machine/


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/usr.sbin/mopd/mopcopy/mopcopy.c

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



CVS commit: src/sbin/nvmectl

2022-02-12 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Sat Feb 12 23:50:14 UTC 2022

Modified Files:
src/sbin/nvmectl: logpage.c

Log Message:
s/Expceted/Expected/ in log message and s/attribtues/attributes/ in comment.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sbin/nvmectl/logpage.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/nvmectl/logpage.c
diff -u src/sbin/nvmectl/logpage.c:1.7 src/sbin/nvmectl/logpage.c:1.8
--- src/sbin/nvmectl/logpage.c:1.7	Wed Apr 18 10:11:44 2018
+++ src/sbin/nvmectl/logpage.c	Sat Feb 12 23:50:14 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: logpage.c,v 1.7 2018/04/18 10:11:44 nonaka Exp $	*/
+/*	$NetBSD: logpage.c,v 1.8 2022/02/12 23:50:14 andvar Exp $	*/
 
 /*-
  * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
@@ -33,7 +33,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: logpage.c,v 1.7 2018/04/18 10:11:44 nonaka Exp $");
+__RCSID("$NetBSD: logpage.c,v 1.8 2022/02/12 23:50:14 andvar Exp $");
 #if 0
 __FBSDID("$FreeBSD: head/sbin/nvmecontrol/logpage.c 329824 2018-02-22 13:32:31Z wma $");
 #endif
@@ -682,7 +682,7 @@ print_hgst_info_background_scan(void *bu
 		return;
 	}
 	if (code != 0) {
-		printf("Expceted code 0, found code %#x\n", code);
+		printf("Expected code 0, found code %#x\n", code);
 		return;
 	}
 	pom = le32dec(walker);
@@ -1042,7 +1042,7 @@ logpage(int argc, char *argv[])
 	read_controller_data(fd, &cdata);
 
 	/*
-	 * The log page attribtues indicate whether or not the controller
+	 * The log page attributes indicate whether or not the controller
 	 * supports the SMART/Health information log page on a per
 	 * namespace basis.
 	 */



CVS commit: src/sbin/nvmectl

2022-02-12 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Sat Feb 12 23:50:14 UTC 2022

Modified Files:
src/sbin/nvmectl: logpage.c

Log Message:
s/Expceted/Expected/ in log message and s/attribtues/attributes/ in comment.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sbin/nvmectl/logpage.c

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



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

2022-02-12 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Sat Feb 12 23:30:30 UTC 2022

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

Log Message:
s/epxected/expected/


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/amiga/dev/repulse.c

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



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

2022-02-12 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Sat Feb 12 23:30:30 UTC 2022

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

Log Message:
s/epxected/expected/


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/amiga/dev/repulse.c

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

Modified files:

Index: src/sys/arch/amiga/dev/repulse.c
diff -u src/sys/arch/amiga/dev/repulse.c:1.23 src/sys/arch/amiga/dev/repulse.c:1.24
--- src/sys/arch/amiga/dev/repulse.c:1.23	Sat Jun  8 08:02:36 2019
+++ src/sys/arch/amiga/dev/repulse.c	Sat Feb 12 23:30:30 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: repulse.c,v 1.23 2019/06/08 08:02:36 isaki Exp $ */
+/*	$NetBSD: repulse.c,v 1.24 2022/02/12 23:30:30 andvar Exp $ */
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: repulse.c,v 1.23 2019/06/08 08:02:36 isaki Exp $");
+__KERNEL_RCSID(0, "$NetBSD: repulse.c,v 1.24 2022/02/12 23:30:30 andvar Exp $");
 
 #include 
 #include 
@@ -310,7 +310,7 @@ repulse_attach(device_t parent, device_t
 	/*
 	 * Print a warning if the codec doesn't support hardware variable
 	 * rate audio. As the initial incarnations of the Repulse board
-	 * are AC'97 2.1, it is epxected that we'll always have VRA.
+	 * are AC'97 2.1, it is expected that we'll always have VRA.
 	 */
 	/*
 	 * XXX this should be a panic(). OTOH, audio codec speed is not



CVS commit: src/usr.bin/script

2022-02-12 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Feb 12 23:03:52 UTC 2022

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

Log Message:
script: declare dooutput as __dead

This fixes the Clang build, which failed with:

usr.bin/script/script.c:255:1: error:
function 'dooutput' could be declared with attribute 'noreturn'
[-Werror,-Wmissing-noreturn]


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

2022-02-12 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Feb 12 23:03:52 UTC 2022

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

Log Message:
script: declare dooutput as __dead

This fixes the Clang build, which failed with:

usr.bin/script/script.c:255:1: error:
function 'dooutput' could be declared with attribute 'noreturn'
[-Werror,-Wmissing-noreturn]


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/usr.bin/script/script.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/script/script.c
diff -u src/usr.bin/script/script.c:1.31 src/usr.bin/script/script.c:1.32
--- src/usr.bin/script/script.c:1.31	Fri Feb 11 21:15:25 2022
+++ src/usr.bin/script/script.c	Sat Feb 12 23:03:52 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: script.c,v 1.31 2022/02/11 21:15:25 christos Exp $	*/
+/*	$NetBSD: script.c,v 1.32 2022/02/12 23:03:52 rillig Exp $	*/
 
 /*
  * Copyright (c) 1980, 1992, 1993
@@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 19
 #if 0
 static char sccsid[] = "@(#)script.c	8.1 (Berkeley) 6/6/93";
 #endif
-__RCSID("$NetBSD: script.c,v 1.31 2022/02/11 21:15:25 christos Exp $");
+__RCSID("$NetBSD: script.c,v 1.32 2022/02/12 23:03:52 rillig Exp $");
 #endif /* not lint */
 
 #include 
@@ -91,7 +91,7 @@ __dead static void	done(int);
 __dead static void	doshell(const char *);
 __dead static void	fail(void);
 static sig_t	xsignal(int, sig_t);
-static void	dooutput(void);
+__dead static void	dooutput(void);
 static void	finish(int);
 static void	scriptflush(int);
 static void	record(FILE *, char *, size_t, int);



Re: CVS commit: src/lib/libc/stdlib

2022-02-12 Thread Roland Illig

Am 12.02.2022 um 20:10 schrieb Warner Losh:

I thought the rule was don't make purely whitespace changes UNLESS you
plan on making other changes to (or are fixing an oops you just made).
If that's the case, separate the two commits.


That sounds like a useful rule, I'll stick to it.

Roland


CVS commit: src/usr.bin/make/unit-tests

2022-02-12 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Feb 12 20:05:36 UTC 2022

Modified Files:
src/usr.bin/make/unit-tests: opt-keep-going-indirect.mk

Log Message:
tests/make: clean up comments in test for indirect -k failures

See PR#49720.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 \
src/usr.bin/make/unit-tests/opt-keep-going-indirect.mk

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



CVS commit: src/usr.bin/make/unit-tests

2022-02-12 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Feb 12 20:05:36 UTC 2022

Modified Files:
src/usr.bin/make/unit-tests: opt-keep-going-indirect.mk

Log Message:
tests/make: clean up comments in test for indirect -k failures

See PR#49720.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 \
src/usr.bin/make/unit-tests/opt-keep-going-indirect.mk

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/make/unit-tests/opt-keep-going-indirect.mk
diff -u src/usr.bin/make/unit-tests/opt-keep-going-indirect.mk:1.1 src/usr.bin/make/unit-tests/opt-keep-going-indirect.mk:1.2
--- src/usr.bin/make/unit-tests/opt-keep-going-indirect.mk:1.1	Sat Feb 12 13:17:57 2022
+++ src/usr.bin/make/unit-tests/opt-keep-going-indirect.mk	Sat Feb 12 20:05:36 2022
@@ -1,4 +1,4 @@
-# $NetBSD: opt-keep-going-indirect.mk,v 1.1 2022/02/12 13:17:57 rillig Exp $
+# $NetBSD: opt-keep-going-indirect.mk,v 1.2 2022/02/12 20:05:36 rillig Exp $
 #
 # Tests for the -k command line option, which stops building a target as soon
 # as an error is detected, but continues building the other, independent
@@ -6,27 +6,28 @@
 #
 # History:
 #	In 1993, the exit status for the option '-k' was always 0, even if a
-#	a direct or an indirect target failed.
+#	direct or an indirect target failed.
 #
 #	Since 2000.12.30.02.05.21, the word '(continuing)' is missing in jobs
 #	mode, both for direct as well as indirect targets.
 #
 #	Since 2001.10.16.18.50.12, the exit status for a direct failure in
-#	compat mode is 1, while jobs mode and indirect failures still return
-#	exit status 0.  The number of empty lines between the various error
-#	messages differs between the modes, for no reason.
+#	compat mode is the correct 1, while jobs mode and indirect failures
+#	still return the wrong exit status 0.  The number of empty lines
+#	between the various error messages differs between the modes, for no
+#	reason.
 #
 #	At 2006.11.17.22.07.39, the exit status for direct failures in both
-#	modes and for indirect failures in jobs mode was corrected, leaving
-#	only indirect failures in compat mode wrong.  On the downside, a
-#	failed indirect target in jobs mode was no longer listed as "not
-#	remade because of errors".
-#
-#	At 2016.08.26.23.28.39, the additional empty lines for a direct
-#	failure in compat mode was removed, making it consistent with a direct
-#	failure in jobs mode.  This left only one inconsistency, in that
-#	indirect failures in jobs mode (by far the most common when building
-#	large projects) did not produce any empty line.
+#	modes and for indirect failures in jobs mode was fixed to the correct
+#	1.  The exit status for indirect failures in compat mode is still the
+#	wrong 0.  On the downside, a failed indirect target in jobs mode is no
+#	longer listed as "not remade because of errors".
+#
+#	At 2016.08.26.23.28.39, the additional empty line for a direct failure
+#	in compat mode was removed, making it consistent with a direct failure
+#	in jobs mode.  This left only one inconsistency, in that indirect
+#	failures in jobs mode (by far the most common when building large
+#	projects) did not produce any empty line.
 #
 #	Since 2020.12.07.00.53.30, the exit status is consistently 1 for
 #	failures in all 4 modes.
@@ -83,6 +84,7 @@ direct:
 # expect: exited 1
 
 # TODO: Add '(continuing)'.
+# TODO: Add 'not remade because of errors'.
 # expect: indirect jobs
 # expect: *** [direct] Error code 1
 # expect: exited 1



CVS commit: src

2022-02-12 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Feb 12 19:56:53 UTC 2022

Modified Files:
src/tests/usr.bin/indent: lsym_typedef.c
src/usr.bin/indent: indent.h io.c lexi.c

Log Message:
indent: fix indentation of enum constants in typedef (since 2019-04-04)

The solution is not elegant since it adds a small state machine inside
the parser state, but at least these states only depend on the sequence
of token types and not on any other part of the parser state.

Reported in PR#55453.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/usr.bin/indent/lsym_typedef.c
cvs rdiff -u -r1.107 -r1.108 src/usr.bin/indent/indent.h
cvs rdiff -u -r1.143 -r1.144 src/usr.bin/indent/io.c
cvs rdiff -u -r1.168 -r1.169 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/tests/usr.bin/indent/lsym_typedef.c
diff -u src/tests/usr.bin/indent/lsym_typedef.c:1.2 src/tests/usr.bin/indent/lsym_typedef.c:1.3
--- src/tests/usr.bin/indent/lsym_typedef.c:1.2	Sat Feb 12 13:38:29 2022
+++ src/tests/usr.bin/indent/lsym_typedef.c	Sat Feb 12 19:56:52 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: lsym_typedef.c,v 1.2 2022/02/12 13:38:29 rillig Exp $ */
+/* $NetBSD: lsym_typedef.c,v 1.3 2022/02/12 19:56:52 rillig Exp $ */
 /* $FreeBSD$ */
 
 /*
@@ -7,8 +7,10 @@
  */
 
 /*
- * Since 2019-04-04, indent places all enum constants except the first in the
- * wrong column, but only if the enum declaration follows a 'typedef'.
+ * Since 2019-04-04 and before lexi.c 1.169 from 2022-02-12, indent placed all
+ * enum constants except the first too far to the right, as if it were a
+ * statement continuation, but only if the enum declaration followed a
+ * 'typedef'.
  *
  * https://gnats.netbsd.org/55453
  */
@@ -24,11 +26,10 @@ enum {
 } E;
 #indent end
 
-/* FIXME: TC2 is indented too far. */
 #indent run -ci4 -i4
 typedef enum {
 TC1,
-	TC2
+TC2
 } T;
 
 enum {
@@ -37,11 +38,10 @@ enum {
 }		E;
 #indent end
 
-/* FIXME: TC2 is indented too far. */
 #indent run -ci2
 typedef enum {
 	TC1,
-	  TC2
+	TC2
 } T;
 
 enum {

Index: src/usr.bin/indent/indent.h
diff -u src/usr.bin/indent/indent.h:1.107 src/usr.bin/indent/indent.h:1.108
--- src/usr.bin/indent/indent.h:1.107	Sun Nov 28 14:29:03 2021
+++ src/usr.bin/indent/indent.h	Sat Feb 12 19:56:52 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: indent.h,v 1.107 2021/11/28 14:29:03 rillig Exp $	*/
+/*	$NetBSD: indent.h,v 1.108 2022/02/12 19:56:52 rillig Exp $	*/
 
 /*-
  * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
@@ -309,6 +309,12 @@ extern struct parser_state {
  * different */
 int just_saw_decl;
 bool in_func_def_params;
+enum {
+	in_enum_no,		/* outside any 'enum { ... }' */
+	in_enum_enum,		/* after keyword 'enum' */
+	in_enum_type,		/* after 'enum' or 'enum tag' */
+	in_enum_brace		/* between '{' and '}' */
+} in_enum;			/* enum { . } */
 bool decl_indent_done;	/* whether the indentation for a declaration
  * has been added to the code buffer. */
 

Index: src/usr.bin/indent/io.c
diff -u src/usr.bin/indent/io.c:1.143 src/usr.bin/indent/io.c:1.144
--- src/usr.bin/indent/io.c:1.143	Sun Nov 28 11:49:10 2021
+++ src/usr.bin/indent/io.c	Sat Feb 12 19:56:52 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: io.c,v 1.143 2021/11/28 11:49:10 rillig Exp $	*/
+/*	$NetBSD: io.c,v 1.144 2022/02/12 19:56:52 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.143 2021/11/28 11:49:10 rillig Exp $");
+__RCSID("$NetBSD: io.c,v 1.144 2022/02/12 19:56:52 rillig Exp $");
 #elif defined(__FreeBSD__)
 __FBSDID("$FreeBSD: head/usr.bin/indent/io.c 334927 2018-06-10 16:44:18Z pstef $");
 #endif
@@ -618,7 +618,7 @@ compute_code_indent(void)
 int base_ind = ps.ind_level * opt.indent_size;
 
 if (ps.paren_level == 0) {
-	if (ps.in_stmt_cont)
+	if (ps.in_stmt_cont && ps.in_enum != in_enum_brace)
 	return base_ind + opt.continuation_indent;
 	return base_ind;
 }

Index: src/usr.bin/indent/lexi.c
diff -u src/usr.bin/indent/lexi.c:1.168 src/usr.bin/indent/lexi.c:1.169
--- src/usr.bin/indent/lexi.c:1.168	Sat Feb 12 15:50:14 2022
+++ src/usr.bin/indent/lexi.c	Sat Feb 12 19:56:52 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: lexi.c,v 1.168 2022/02/12 15:50:14 rillig Exp $	*/
+/*	$NetBSD: lexi.c,v 1.169 2022/02/12 19:56:52 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.168 2022/02/12 15:50:14 rillig Exp $");
+__RCSID("$NetBSD: lexi.c,v 1.169 2022/02/12 19:56:52 rillig Exp $");
 #elif defined(__FreeBSD__)
 __FBSDID("$FreeBSD: head/usr.bin/indent/lexi.c 337862 2018-08-15 18:19:45Z pstef $");
 #endif
@@ -542,6 +542,8 @@ lexi_alnum(void)
 	if (is_typename()) {
 	is_type = true;
 	ps.next_unary 

CVS commit: src

2022-02-12 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Feb 12 19:56:53 UTC 2022

Modified Files:
src/tests/usr.bin/indent: lsym_typedef.c
src/usr.bin/indent: indent.h io.c lexi.c

Log Message:
indent: fix indentation of enum constants in typedef (since 2019-04-04)

The solution is not elegant since it adds a small state machine inside
the parser state, but at least these states only depend on the sequence
of token types and not on any other part of the parser state.

Reported in PR#55453.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/usr.bin/indent/lsym_typedef.c
cvs rdiff -u -r1.107 -r1.108 src/usr.bin/indent/indent.h
cvs rdiff -u -r1.143 -r1.144 src/usr.bin/indent/io.c
cvs rdiff -u -r1.168 -r1.169 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/tests/usr.bin/indent

2022-02-12 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Feb 12 19:46:56 UTC 2022

Modified Files:
src/tests/usr.bin/indent: lsym_tag.c

Log Message:
tests/indent: add another test for indentation of enum constants

To prevent an overzealous quick hack for indenting enum constants in a
typedef, as part of fixing PR#55453.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/usr.bin/indent/lsym_tag.c

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/lsym_tag.c
diff -u src/tests/usr.bin/indent/lsym_tag.c:1.1 src/tests/usr.bin/indent/lsym_tag.c:1.2
--- src/tests/usr.bin/indent/lsym_tag.c:1.1	Thu Nov 18 21:19:19 2021
+++ src/tests/usr.bin/indent/lsym_tag.c	Sat Feb 12 19:46:56 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: lsym_tag.c,v 1.1 2021/11/18 21:19:19 rillig Exp $ */
+/* $NetBSD: lsym_tag.c,v 1.2 2022/02/12 19:46:56 rillig Exp $ */
 /* $FreeBSD$ */
 
 /*
@@ -6,8 +6,38 @@
  * 'struct', 'union' or 'enum' that declare, define or use a tagged type.
  */
 
+/* TODO: Add systematic tests for 'struct'. */
+/* TODO: Add systematic tests for 'union'. */
+/* TODO: Add systematic tests for 'enum'. */
+
+
 #indent input
-// TODO: add input
+int
+indent_enum_constants(void)
+{
+	enum color {
+		red,
+		green
+	};
+	enum color	colors[] = {
+		red,
+		red,
+		red,
+	};
+	/*
+	 * Ensure that the token sequence 'enum type {' only matches if there
+	 * are no other tokens in between, to prevent statement continuations
+	 * from being indented like enum constant declarations.
+	 *
+	 * See https://gnats.netbsd.org/55453.
+	 */
+	if (colors[0] == (enum color)1) {
+		return 1
+		  + 2
+		  + 3;
+	}
+	return 0;
+}
 #indent end
 
-#indent run-equals-input
+#indent run-equals-input -ci2



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

2022-02-12 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Feb 12 19:46:56 UTC 2022

Modified Files:
src/tests/usr.bin/indent: lsym_tag.c

Log Message:
tests/indent: add another test for indentation of enum constants

To prevent an overzealous quick hack for indenting enum constants in a
typedef, as part of fixing PR#55453.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/usr.bin/indent/lsym_tag.c

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



Re: CVS commit: src/lib/libc/stdlib

2022-02-12 Thread Taylor R Campbell
> Date: Sun, 13 Feb 2022 05:44:38 +1100
> from: matthew green 
> 
> "Roland Illig" writes:
> > Module Name:src
> > Committed By:   rillig
> > Date:   Fri Feb 11 21:36:46 UTC 2022
> >
> > Modified Files:
> > src/lib/libc/stdlib: getenv.c
> >
> > Log Message:
> > libc/getenv: remove trailing whitespace
> >
> > No binary change.
> 
> please avoid purely whitespace changes unless you're
> also going to be modifying the code itself.
> 
> (don't back out now.)

I thought we were supposed to _avoid_ mixing whitespace changes and
functional changes?

(Obviously the solution is to just only ever commit code with perfect
style to begin with so this is never an issue!  Speaking of which,
(setq show-trailing-whitespace t) is helpful to avoid this kind of
mistake up front.  git diff or git add -p will also flag this kind of
mistake, if you're working in git.  /usr/share/misc/NetBSD.el is also
helpful for other KNF style.)


re: CVS commit: src/lib/libc/stdlib

2022-02-12 Thread matthew green
"Roland Illig" writes:
> Module Name:  src
> Committed By: rillig
> Date: Fri Feb 11 21:36:46 UTC 2022
>
> Modified Files:
>   src/lib/libc/stdlib: getenv.c
>
> Log Message:
> libc/getenv: remove trailing whitespace
>
> No binary change.

please avoid purely whitespace changes unless you're
also going to be modifying the code itself.

(don't back out now.)

thanks.


.mrg.


CVS commit: src/sys/arch

2022-02-12 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Feb 12 17:17:54 UTC 2022

Modified Files:
src/sys/arch/alpha/include: lock.h
src/sys/arch/hppa/include: lock.h
src/sys/arch/ia64/include: lock.h
src/sys/arch/powerpc/include: lock.h
src/sys/arch/vax/include: lock.h
src/sys/arch/x86/include: lock.h

Log Message:
__cpu_simple_lock(9): Omit needless barriers in init.

It is, and always has been, the caller's responsibility to ensure the
lock is initialized before it can be used -- otherwise the memory
could hold garbage; it is nonsensical to even attempt locking
operations on it before initialization.

So there's no need to issue explicit barriers here.  The barrier
seems to have been introduced in sys/arch/alpha/alpha/lock_machdep.c
rev. 1.1 (since moved to inline asm in alpha/include/lock.h) and then
copied & pasted into several other architectures.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/arch/alpha/include/lock.h
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/hppa/include/lock.h
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/ia64/include/lock.h
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/powerpc/include/lock.h
cvs rdiff -u -r1.32 -r1.33 src/sys/arch/vax/include/lock.h
cvs rdiff -u -r1.28 -r1.29 src/sys/arch/x86/include/lock.h

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

Modified files:

Index: src/sys/arch/alpha/include/lock.h
diff -u src/sys/arch/alpha/include/lock.h:1.31 src/sys/arch/alpha/include/lock.h:1.32
--- src/sys/arch/alpha/include/lock.h:1.31	Sat Apr  3 14:56:13 2021
+++ src/sys/arch/alpha/include/lock.h	Sat Feb 12 17:17:53 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: lock.h,v 1.31 2021/04/03 14:56:13 thorpej Exp $ */
+/* $NetBSD: lock.h,v 1.32 2022/02/12 17:17:53 riastradh Exp $ */
 
 /*-
  * Copyright (c) 1998, 1999, 2000 The NetBSD Foundation, Inc.
@@ -69,12 +69,7 @@ static __inline void
 __cpu_simple_lock_init(__cpu_simple_lock_t *alp)
 {
 
-	__asm volatile(
-		"# BEGIN __cpu_simple_lock_init\n"
-		"	stl	$31, %0		\n"
-		"	mb			\n"
-		"	# END __cpu_simple_lock_init"
-		: "=m" (*alp));
+	*alp = __SIMPLELOCK_UNLOCKED;
 }
 
 static __inline void

Index: src/sys/arch/hppa/include/lock.h
diff -u src/sys/arch/hppa/include/lock.h:1.22 src/sys/arch/hppa/include/lock.h:1.23
--- src/sys/arch/hppa/include/lock.h:1.22	Fri Nov 29 20:05:29 2019
+++ src/sys/arch/hppa/include/lock.h	Sat Feb 12 17:17:53 2022
@@ -1,4 +1,4 @@
-/* 	$NetBSD: lock.h,v 1.22 2019/11/29 20:05:29 riastradh Exp $	*/
+/* 	$NetBSD: lock.h,v 1.23 2022/02/12 17:17:53 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc.
@@ -85,10 +85,10 @@ __sync(void)
 static __inline void
 __cpu_simple_lock_init(__cpu_simple_lock_t *alp)
 {
+
 	alp->csl_lock[0] = alp->csl_lock[1] =
 	alp->csl_lock[2] = alp->csl_lock[3] =
 	__SIMPLELOCK_RAW_UNLOCKED;
-	__sync();
 }
 
 static __inline void

Index: src/sys/arch/ia64/include/lock.h
diff -u src/sys/arch/ia64/include/lock.h:1.8 src/sys/arch/ia64/include/lock.h:1.9
--- src/sys/arch/ia64/include/lock.h:1.8	Fri Nov 29 20:05:38 2019
+++ src/sys/arch/ia64/include/lock.h	Sat Feb 12 17:17:53 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: lock.h,v 1.8 2019/11/29 20:05:38 riastradh Exp $	*/
+/*	$NetBSD: lock.h,v 1.9 2022/02/12 17:17:53 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -83,7 +83,6 @@ __cpu_simple_lock_init(__cpu_simple_lock
 {
 
 	*lockp = __SIMPLELOCK_UNLOCKED;
-	__insn_barrier();
 }
 
 static __inline int

Index: src/sys/arch/powerpc/include/lock.h
diff -u src/sys/arch/powerpc/include/lock.h:1.16 src/sys/arch/powerpc/include/lock.h:1.17
--- src/sys/arch/powerpc/include/lock.h:1.16	Mon Sep 13 11:54:42 2021
+++ src/sys/arch/powerpc/include/lock.h	Sat Feb 12 17:17:53 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: lock.h,v 1.16 2021/09/13 11:54:42 rin Exp $	*/
+/*	$NetBSD: lock.h,v 1.17 2022/02/12 17:17:53 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2000, 2007 The NetBSD Foundation, Inc.
@@ -64,7 +64,6 @@ static __inline void
 __cpu_simple_lock_init(__cpu_simple_lock_t *alp)
 {
 	*alp = __SIMPLELOCK_UNLOCKED;
-	__asm volatile ("sync");
 }
 
 static __inline void

Index: src/sys/arch/vax/include/lock.h
diff -u src/sys/arch/vax/include/lock.h:1.32 src/sys/arch/vax/include/lock.h:1.33
--- src/sys/arch/vax/include/lock.h:1.32	Fri Nov 29 20:06:44 2019
+++ src/sys/arch/vax/include/lock.h	Sat Feb 12 17:17:53 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: lock.h,v 1.32 2019/11/29 20:06:44 riastradh Exp $	*/
+/*	$NetBSD: lock.h,v 1.33 2022/02/12 17:17:53 riastradh Exp $	*/
 
 /*
  * Copyright (c) 2000 Ludd, University of Lule}, Sweden.
@@ -66,17 +66,7 @@ static __inline void __cpu_simple_lock_i
 static __inline void
 __cpu_simple_lock_init(__cpu_simple_lock_t *__alp)
 {
-#ifdef _HARDKERNEL
-	__asm __volatile ("movl %0,%%r1;jsb Sunlock"
-		: /* No output */
-		: "g"(__alp)
-		: "r1","cc","memory");
-#else
-	__asm __volatile ("bbcci $0,%0,1f;1:"
-		: 

CVS commit: src/sys/arch

2022-02-12 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Feb 12 17:17:54 UTC 2022

Modified Files:
src/sys/arch/alpha/include: lock.h
src/sys/arch/hppa/include: lock.h
src/sys/arch/ia64/include: lock.h
src/sys/arch/powerpc/include: lock.h
src/sys/arch/vax/include: lock.h
src/sys/arch/x86/include: lock.h

Log Message:
__cpu_simple_lock(9): Omit needless barriers in init.

It is, and always has been, the caller's responsibility to ensure the
lock is initialized before it can be used -- otherwise the memory
could hold garbage; it is nonsensical to even attempt locking
operations on it before initialization.

So there's no need to issue explicit barriers here.  The barrier
seems to have been introduced in sys/arch/alpha/alpha/lock_machdep.c
rev. 1.1 (since moved to inline asm in alpha/include/lock.h) and then
copied & pasted into several other architectures.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/arch/alpha/include/lock.h
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/hppa/include/lock.h
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/ia64/include/lock.h
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/powerpc/include/lock.h
cvs rdiff -u -r1.32 -r1.33 src/sys/arch/vax/include/lock.h
cvs rdiff -u -r1.28 -r1.29 src/sys/arch/x86/include/lock.h

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



CVS commit: src

2022-02-12 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Feb 12 17:10:20 UTC 2022

Modified Files:
src/distrib/sets/lists/comp: mi
src/share/man/man9: Makefile
Added Files:
src/share/man/man9: __cpu_simple_lock.9

Log Message:
__cpu_simple_lock(9): New man page.

This doesn't mean you should use it!  Mostly it's to document the
semantics to help understand existing uses, which should not
proliferate, and audit definitions.


To generate a diff of this commit:
cvs rdiff -u -r1.2410 -r1.2411 src/distrib/sets/lists/comp/mi
cvs rdiff -u -r1.462 -r1.463 src/share/man/man9/Makefile
cvs rdiff -u -r0 -r1.1 src/share/man/man9/__cpu_simple_lock.9

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/comp/mi
diff -u src/distrib/sets/lists/comp/mi:1.2410 src/distrib/sets/lists/comp/mi:1.2411
--- src/distrib/sets/lists/comp/mi:1.2410	Sat Jan 22 08:58:48 2022
+++ src/distrib/sets/lists/comp/mi	Sat Feb 12 17:10:20 2022
@@ -1,4 +1,4 @@
-#	$NetBSD: mi,v 1.2410 2022/01/22 08:58:48 skrll Exp $
+#	$NetBSD: mi,v 1.2411 2022/02/12 17:10:20 riastradh Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 ./etc/mtree/set.compcomp-sys-root
@@ -11292,6 +11292,14 @@
 ./usr/share/man/cat9/VOP_WHITEOUT.0		comp-sys-catman		.cat
 ./usr/share/man/cat9/VOP_WRITE.0		comp-sys-catman		.cat
 ./usr/share/man/cat9/VREF.0			comp-obsolete		obsolete
+./usr/share/man/cat9/__SIMPLELOCK_LOCKED_P.0		comp-sys-catman		.cat
+./usr/share/man/cat9/__SIMPLELOCK_UNLOCKED_P.0		comp-sys-catman		.cat
+./usr/share/man/cat9/__cpu_simple_lock_clear.0		comp-sys-catman		.cat
+./usr/share/man/cat9/__cpu_simple_lock_init.0		comp-sys-catman		.cat
+./usr/share/man/cat9/__cpu_simple_lock_set.0		comp-sys-catman		.cat
+./usr/share/man/cat9/__cpu_simple_lock_try.0		comp-sys-catman		.cat
+./usr/share/man/cat9/__cpu_simple_lock.0		comp-sys-catman		.cat
+./usr/share/man/cat9/__cpu_simple_unlock.0		comp-sys-catman		.cat
 ./usr/share/man/cat9/acl.0			comp-sys-catman		.cat
 ./usr/share/man/cat9/accept_filt_add.0		comp-sys-catman		.cat
 ./usr/share/man/cat9/accept_filt_del.0		comp-sys-catman		.cat
@@ -19522,6 +19530,14 @@
 ./usr/share/man/html9/VOP_WHITEOUT.html		comp-sys-htmlman	html
 ./usr/share/man/html9/VOP_WRITE.html		comp-sys-htmlman	html
 ./usr/share/man/html9/VREF.html			comp-obsolete	obsolete
+./usr/share/man/html9/__SIMPLELOCK_LOCKED_P.html		comp-sys-htmlman		html
+./usr/share/man/html9/__SIMPLELOCK_UNLOCKED_P.html		comp-sys-htmlman		html
+./usr/share/man/html9/__cpu_simple_lock_clear.html		comp-sys-htmlman		html
+./usr/share/man/html9/__cpu_simple_lock_init.html		comp-sys-htmlman		html
+./usr/share/man/html9/__cpu_simple_lock_set.html		comp-sys-htmlman		html
+./usr/share/man/html9/__cpu_simple_lock_try.html		comp-sys-htmlman		html
+./usr/share/man/html9/__cpu_simple_lock.html		comp-sys-htmlman		html
+./usr/share/man/html9/__cpu_simple_unlock.html		comp-sys-htmlman		html
 ./usr/share/man/html9/acl.html			comp-sys-htmlman	html
 ./usr/share/man/html9/accept_filt_add.html	comp-sys-htmlman	html
 ./usr/share/man/html9/accept_filt_del.html	comp-sys-htmlman	html
@@ -27855,6 +27871,14 @@
 ./usr/share/man/man9/VOP_WHITEOUT.9		comp-sys-man		.man
 ./usr/share/man/man9/VOP_WRITE.9		comp-sys-man		.man
 ./usr/share/man/man9/VREF.9			comp-obsolete		obsolete
+./usr/share/man/man9/__SIMPLELOCK_LOCKED_P.9		comp-sys-man		.man
+./usr/share/man/man9/__SIMPLELOCK_UNLOCKED_P.9		comp-sys-man		.man
+./usr/share/man/man9/__cpu_simple_lock_clear.9		comp-sys-man		.man
+./usr/share/man/man9/__cpu_simple_lock_init.9		comp-sys-man		.man
+./usr/share/man/man9/__cpu_simple_lock_set.9		comp-sys-man		.man
+./usr/share/man/man9/__cpu_simple_lock_try.9		comp-sys-man		.man
+./usr/share/man/man9/__cpu_simple_lock.9		comp-sys-man		.man
+./usr/share/man/man9/__cpu_simple_unlock.9		comp-sys-man		.man
 ./usr/share/man/man9/acl.9			comp-sys-man		.man
 ./usr/share/man/man9/accept_filt_add.9		comp-sys-man		.man
 ./usr/share/man/man9/accept_filt_del.9		comp-sys-man		.man

Index: src/share/man/man9/Makefile
diff -u src/share/man/man9/Makefile:1.462 src/share/man/man9/Makefile:1.463
--- src/share/man/man9/Makefile:1.462	Mon Jan 17 22:47:43 2022
+++ src/share/man/man9/Makefile	Sat Feb 12 17:10:20 2022
@@ -1,4 +1,4 @@
-#   $NetBSD: Makefile,v 1.462 2022/01/17 22:47:43 christos Exp $
+#   $NetBSD: Makefile,v 1.463 2022/02/12 17:10:20 riastradh Exp $
 
 #	Makefile for section 9 (kernel function and variable) manual pages.
 
@@ -71,6 +71,15 @@ MAN=	accept_filter.9 accf_data.9 accf_ht
 	xcall.9 \
 	VOP_ACLCHECK.9 VOP_GETACL.9 VOP_SETACL.9
 
+MAN+=	__cpu_simple_lock.9
+MLINKS+=__cpu_simple_lock.9 __SIMPLELOCK_LOCKED_P.9 \
+	__cpu_simple_lock.9 __SIMPLELOCK_UNLOCKED_P.9 \
+	__cpu_simple_lock.9 __cpu_simple_lock_clear.9 \
+	__cpu_simple_lock.9 __cpu_simple_lock_init.9 \
+	__cpu_simple_lock.9 __cpu_simple_lock_set.9 \
+	__cpu_simple_lock.9 __cpu_simpl

CVS commit: src

2022-02-12 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Feb 12 17:10:20 UTC 2022

Modified Files:
src/distrib/sets/lists/comp: mi
src/share/man/man9: Makefile
Added Files:
src/share/man/man9: __cpu_simple_lock.9

Log Message:
__cpu_simple_lock(9): New man page.

This doesn't mean you should use it!  Mostly it's to document the
semantics to help understand existing uses, which should not
proliferate, and audit definitions.


To generate a diff of this commit:
cvs rdiff -u -r1.2410 -r1.2411 src/distrib/sets/lists/comp/mi
cvs rdiff -u -r1.462 -r1.463 src/share/man/man9/Makefile
cvs rdiff -u -r0 -r1.1 src/share/man/man9/__cpu_simple_lock.9

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



CVS commit: src

2022-02-12 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Feb 12 17:10:02 UTC 2022

Modified Files:
src/common/lib/libc/arch/mips/atomic: membar_ops.S
src/sys/arch/mips/include: lock.h

Log Message:
mips: Brush up __cpu_simple_lock.

- Eradicate last vestiges of mb_* barriers.

- In __cpu_simple_lock_init, omit needless barrier.  It is the
  caller's responsibility to ensure __cpu_simple_lock_init happens
  before other operations on it anyway, so there was never any need
  for a barrier here.

- In __cpu_simple_lock_try, leave comments about memory ordering
  guarantees of the kernel's _atomic_cas_uint, which are inexplicably
  different from the non-underscored atomic_cas_uint.

- In __cpu_simple_unlock, use membar_exit instead of mb_memory, and do
  it unconditionally.

  This ensures that in __cpu_simple_lock/.../__cpu_simple_unlock, all
  memory operations in the ellipsis happen before the store that
  releases the lock.

  - On Octeon, the barrier was omitted altogether, which is a bug --
it needs to be there or else there is no happens-before relation
and whoever takes the lock next might see stale values stored or
even stomp over the unlocking CPU's delayed loads.

  - On non-Octeon, the mb_memory was sync.  Using membar_exit
preserves this.

  XXX On Octeon, membar_exit only issues syncw -- this seems wrong,
  only store-before-store and not load/store-before-store, unless the
  CNMIPS architecture guarantees it is sufficient here like
  SPARCv8/v9 PSO (`Partial Store Order').

- Leave an essay with citations about why we have an apparently
  pointless syncw _after_ releasing a lock, to work around a design
  bug^W^Wquirk in cnmips which sometimes buffers stores for hundreds
  of thousands of cycles for fun unless you issue syncw.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/common/lib/libc/arch/mips/atomic/membar_ops.S
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/mips/include/lock.h

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

Modified files:

Index: src/common/lib/libc/arch/mips/atomic/membar_ops.S
diff -u src/common/lib/libc/arch/mips/atomic/membar_ops.S:1.10 src/common/lib/libc/arch/mips/atomic/membar_ops.S:1.11
--- src/common/lib/libc/arch/mips/atomic/membar_ops.S:1.10	Mon Aug 10 14:37:38 2020
+++ src/common/lib/libc/arch/mips/atomic/membar_ops.S	Sat Feb 12 17:10:02 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: membar_ops.S,v 1.10 2020/08/10 14:37:38 skrll Exp $	*/
+/*	$NetBSD: membar_ops.S,v 1.11 2022/02/12 17:10:02 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2006, 2007 The NetBSD Foundation, Inc.
@@ -46,16 +46,6 @@ LEAF(_membar_producer)
 END(_membar_producer)
 #endif
 
-#ifdef _KERNEL
-STRONG_ALIAS(mb_read, _membar_sync)
-#ifdef __OCTEON__
-STRONG_ALIAS(mb_write, _membar_producer)
-#else
-STRONG_ALIAS(mb_write, _membar_sync)
-#endif
-STRONG_ALIAS(mb_memory, _membar_sync)
-#endif
-
 ATOMIC_OP_ALIAS(membar_sync,_membar_sync)
 ATOMIC_OP_ALIAS(membar_enter,_membar_sync)
 STRONG_ALIAS(_membar_enter,_membar_sync)

Index: src/sys/arch/mips/include/lock.h
diff -u src/sys/arch/mips/include/lock.h:1.21 src/sys/arch/mips/include/lock.h:1.22
--- src/sys/arch/mips/include/lock.h:1.21	Wed Aug  5 05:24:44 2020
+++ src/sys/arch/mips/include/lock.h	Sat Feb 12 17:10:02 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: lock.h,v 1.21 2020/08/05 05:24:44 simonb Exp $	*/
+/*	$NetBSD: lock.h,v 1.22 2022/02/12 17:10:02 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2001, 2007 The NetBSD Foundation, Inc.
@@ -41,6 +41,8 @@
 
 #include 
 
+#include 
+
 static __inline int
 __SIMPLELOCK_LOCKED_P(const __cpu_simple_lock_t *__ptr)
 {
@@ -98,63 +100,30 @@ __cpu_simple_lock_try(__cpu_simple_lock_
 	return (v0 != 0);
 }
 
-#ifdef MIPS1
-static __inline void
-mb_read(void)
-{
-	__insn_barrier();
-}
-
-static __inline void
-mb_write(void)
-{
-	__insn_barrier();
-}
-
-static __inline void
-mb_memory(void)
-{
-	__insn_barrier();
-}
-#else	/* MIPS1*/
-static __inline void
-mb_read(void)
-{
-	__asm volatile(
-		"	.set push		\n"
-		"	.set mips2		\n"
-		"	sync			\n"
-		"	.set pop"
-		::: "memory"
-	);
-}
-
-static __inline void
-mb_write(void)
-{
-	mb_read();
-}
-
-static __inline void
-mb_memory(void)
-{
-	mb_read();
-}
-#endif	/* MIPS1 */
-
 #else	/* !_HARDKERNEL */
 
 u_int	_atomic_cas_uint(volatile u_int *, u_int, u_int);
 u_long	_atomic_cas_ulong(volatile u_long *, u_long, u_long);
 void *	_atomic_cas_ptr(volatile void *, void *, void *);
-void	mb_read(void);
-void	mb_write(void);
-void	mb_memory(void);
 
 static __inline int
 __cpu_simple_lock_try(__cpu_simple_lock_t *lp)
 {
 
+	/*
+	 * Successful _atomic_cas_uint functions as a load-acquire --
+	 * on MP systems, it issues sync after the LL/SC CAS succeeds;
+	 * on non-MP systems every load is a load-acquire so it's moot.
+	 * This pairs with the membar_exit and store sequence in
+	 * __cpu_simple_unlock that functions as a store-release
+	 * operation.
+	 *
+	 * NOTE: This appli

CVS commit: src

2022-02-12 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Feb 12 17:10:02 UTC 2022

Modified Files:
src/common/lib/libc/arch/mips/atomic: membar_ops.S
src/sys/arch/mips/include: lock.h

Log Message:
mips: Brush up __cpu_simple_lock.

- Eradicate last vestiges of mb_* barriers.

- In __cpu_simple_lock_init, omit needless barrier.  It is the
  caller's responsibility to ensure __cpu_simple_lock_init happens
  before other operations on it anyway, so there was never any need
  for a barrier here.

- In __cpu_simple_lock_try, leave comments about memory ordering
  guarantees of the kernel's _atomic_cas_uint, which are inexplicably
  different from the non-underscored atomic_cas_uint.

- In __cpu_simple_unlock, use membar_exit instead of mb_memory, and do
  it unconditionally.

  This ensures that in __cpu_simple_lock/.../__cpu_simple_unlock, all
  memory operations in the ellipsis happen before the store that
  releases the lock.

  - On Octeon, the barrier was omitted altogether, which is a bug --
it needs to be there or else there is no happens-before relation
and whoever takes the lock next might see stale values stored or
even stomp over the unlocking CPU's delayed loads.

  - On non-Octeon, the mb_memory was sync.  Using membar_exit
preserves this.

  XXX On Octeon, membar_exit only issues syncw -- this seems wrong,
  only store-before-store and not load/store-before-store, unless the
  CNMIPS architecture guarantees it is sufficient here like
  SPARCv8/v9 PSO (`Partial Store Order').

- Leave an essay with citations about why we have an apparently
  pointless syncw _after_ releasing a lock, to work around a design
  bug^W^Wquirk in cnmips which sometimes buffers stores for hundreds
  of thousands of cycles for fun unless you issue syncw.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/common/lib/libc/arch/mips/atomic/membar_ops.S
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/mips/include/lock.h

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



CVS commit: src/sys

2022-02-12 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Feb 12 17:09:44 UTC 2022

Modified Files:
src/sys/arch/arm/omap: omapl1x_timer.c omapl1x_tipb.c
src/sys/arch/vax/uba: qvkbd.c
src/sys/arch/vax/vsa: lcg.c
src/sys/dev/marvell: mvspi.c

Log Message:
sys: Omit vestigial struct devices in softcs after device_t split.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/omap/omapl1x_timer.c \
src/sys/arch/arm/omap/omapl1x_tipb.c
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/vax/uba/qvkbd.c
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/vax/vsa/lcg.c
cvs rdiff -u -r1.7 -r1.8 src/sys/dev/marvell/mvspi.c

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



CVS commit: src/sys

2022-02-12 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Feb 12 17:09:44 UTC 2022

Modified Files:
src/sys/arch/arm/omap: omapl1x_timer.c omapl1x_tipb.c
src/sys/arch/vax/uba: qvkbd.c
src/sys/arch/vax/vsa: lcg.c
src/sys/dev/marvell: mvspi.c

Log Message:
sys: Omit vestigial struct devices in softcs after device_t split.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/omap/omapl1x_timer.c \
src/sys/arch/arm/omap/omapl1x_tipb.c
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/vax/uba/qvkbd.c
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/vax/vsa/lcg.c
cvs rdiff -u -r1.7 -r1.8 src/sys/dev/marvell/mvspi.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/omap/omapl1x_timer.c
diff -u src/sys/arch/arm/omap/omapl1x_timer.c:1.3 src/sys/arch/arm/omap/omapl1x_timer.c:1.4
--- src/sys/arch/arm/omap/omapl1x_timer.c:1.3	Sat Feb 12 03:24:34 2022
+++ src/sys/arch/arm/omap/omapl1x_timer.c	Sat Feb 12 17:09:43 2022
@@ -25,7 +25,7 @@
 
 #include 
 
-__KERNEL_RCSID(0, "$NetBSD: omapl1x_timer.c,v 1.3 2022/02/12 03:24:34 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: omapl1x_timer.c,v 1.4 2022/02/12 17:09:43 riastradh Exp $");
 
 #include "opt_timer.h"
 
@@ -61,7 +61,6 @@ typedef struct timer_factors {
 } timer_factors_t;
 
 typedef struct omapl1xtmr_softc {
-	struct device		sc_dev;
 	uint			sc_timerno;
 	uint			sc_timer_freq;
 	bus_space_tag_t		sc_iot;
Index: src/sys/arch/arm/omap/omapl1x_tipb.c
diff -u src/sys/arch/arm/omap/omapl1x_tipb.c:1.3 src/sys/arch/arm/omap/omapl1x_tipb.c:1.4
--- src/sys/arch/arm/omap/omapl1x_tipb.c:1.3	Sat Aug  7 16:18:45 2021
+++ src/sys/arch/arm/omap/omapl1x_tipb.c	Sat Feb 12 17:09:43 2022
@@ -97,7 +97,7 @@
 
 #include 
 
-__KERNEL_RCSID(0, "$NetBSD: omapl1x_tipb.c,v 1.3 2021/08/07 16:18:45 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: omapl1x_tipb.c,v 1.4 2022/02/12 17:09:43 riastradh Exp $");
 
 #include "locators.h"
 
@@ -121,7 +121,6 @@ __KERNEL_RCSID(0, "$NetBSD: omapl1x_tipb
 #include 
 
 struct tipb_softc {
-	struct device sc_dev;
 	bus_dma_tag_t sc_dmac;
 };
 

Index: src/sys/arch/vax/uba/qvkbd.c
diff -u src/sys/arch/vax/uba/qvkbd.c:1.5 src/sys/arch/vax/uba/qvkbd.c:1.6
--- src/sys/arch/vax/uba/qvkbd.c:1.5	Sat Aug  7 16:19:07 2021
+++ src/sys/arch/vax/uba/qvkbd.c	Sat Feb 12 17:09:43 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: qvkbd.c,v 1.5 2021/08/07 16:19:07 thorpej Exp $	*/
+/*	$NetBSD: qvkbd.c,v 1.6 2022/02/12 17:09:43 riastradh Exp $	*/
 
 /* Copyright (c) 2015 Charles H. Dickman. All rights reserved.
  * Derived from dzkbd.c
@@ -81,8 +81,6 @@ struct qvkbd_internal {
 struct qvkbd_internal qvkbd_console_internal;
 
 struct qvkbd_softc {
-	struct device qvkbd_dev;	/* required first: base device */
-
 	struct qvkbd_internal *sc_itl;
 
 	int sc_enabled;

Index: src/sys/arch/vax/vsa/lcg.c
diff -u src/sys/arch/vax/vsa/lcg.c:1.8 src/sys/arch/vax/vsa/lcg.c:1.9
--- src/sys/arch/vax/vsa/lcg.c:1.8	Sat Feb 12 03:24:35 2022
+++ src/sys/arch/vax/vsa/lcg.c	Sat Feb 12 17:09:43 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: lcg.c,v 1.8 2022/02/12 03:24:35 riastradh Exp $ */
+/*	$NetBSD: lcg.c,v 1.9 2022/02/12 17:09:43 riastradh Exp $ */
 /*
  * LCG accelerated framebuffer driver
  * Copyright (c) 2003, 2004 Blaz Antonic
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: lcg.c,v 1.8 2022/02/12 03:24:35 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lcg.c,v 1.9 2022/02/12 17:09:43 riastradh Exp $");
 
 #define LCG_NO_ACCEL
 
@@ -105,7 +105,6 @@ static	int lcg_match(struct device *, st
 static	void lcg_attach(struct device *, struct device *, void *);
 
 struct	lcg_softc {
-	struct	device ss_dev;
 	bus_dmamap_t sc_dm;
 };
 

Index: src/sys/dev/marvell/mvspi.c
diff -u src/sys/dev/marvell/mvspi.c:1.7 src/sys/dev/marvell/mvspi.c:1.8
--- src/sys/dev/marvell/mvspi.c:1.7	Sat Aug  7 16:19:13 2021
+++ src/sys/dev/marvell/mvspi.c	Sat Feb 12 17:09:44 2022
@@ -53,7 +53,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBI
 extern uint32_t mvTclk;
 
 struct mvspi_softc {
-	struct device		sc_dev;
 	struct spi_controller	sc_spi;
 	void			*sc_ih;
 	bool			sc_interrupts;



CVS commit: src/sys/arch/hppa/hppa

2022-02-12 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Feb 12 17:09:07 UTC 2022

Modified Files:
src/sys/arch/hppa/hppa: ipifuncs.c

Log Message:
hppa: Membar audit in ipifuncs.c.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/hppa/hppa/ipifuncs.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/hppa/hppa/ipifuncs.c
diff -u src/sys/arch/hppa/hppa/ipifuncs.c:1.5 src/sys/arch/hppa/hppa/ipifuncs.c:1.6
--- src/sys/arch/hppa/hppa/ipifuncs.c:1.5	Mon Apr 15 20:45:08 2019
+++ src/sys/arch/hppa/hppa/ipifuncs.c	Sat Feb 12 17:09:07 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: ipifuncs.c,v 1.5 2019/04/15 20:45:08 skrll Exp $	*/
+/*	$NetBSD: ipifuncs.c,v 1.6 2022/02/12 17:09:07 riastradh Exp $	*/
 /*	$OpenBSD: ipi.c,v 1.4 2011/01/14 13:20:06 jsing Exp $	*/
 
 /*
@@ -83,6 +83,7 @@ hppa_ipi_intr(void *arg)
 
 	/* Handle an IPI. */
 	ipi_pending = atomic_swap_ulong(&ci->ci_ipi, 0);
+	membar_enter();	/* matches membar_exit in xc_send_ipi, cpu_ipi */
 
 	KASSERT(ipi_pending);
 
@@ -108,10 +109,22 @@ hppa_ipi_send(struct cpu_info *ci, u_lon
 
 	atomic_or_ulong(&ci->ci_ipi, (1L << ipi));
 
-	/* Send an IPI to the specified CPU by triggering EIR{1} (irq 30). */
+	/*
+	 * Send an IPI to the specified CPU by triggering EIR{1} (irq 30).
+	 *
+	 * The `load-acquire operation' matching this store-release is
+	 * somewhere inside the silicon or firmware -- the point is
+	 * that the store to ci->ci_ipi above must happen before
+	 * writing to EIR{1}; there is conceptually some magic inside
+	 * the silicon or firmware on the target CPU that effectively
+	 * does
+	 *
+	 *	if (atomic_load_acquire(&cpu->io_eir)) {
+	 *		enter_interrupt_vector();
+	 *	}
+	 */
 	cpu = (struct iomod *)(ci->ci_hpa);
-	cpu->io_eir = 1;
-	membar_sync();
+	atomic_store_release(&cpu->io_eir, 1);
 
 	return 0;
 }
@@ -156,6 +169,7 @@ xc_send_ipi(struct cpu_info *ci)
 	KASSERT(kpreempt_disabled());
 	KASSERT(curcpu() != ci);
 
+	membar_exit();		/* matches membar_enter in hppa_ipi_intr */
 	if (ci) {
 		/* Unicast: remote CPU. */
 		hppa_ipi_send(ci, HPPA_IPI_XCALL);
@@ -171,6 +185,7 @@ cpu_ipi(struct cpu_info *ci)
 	KASSERT(kpreempt_disabled());
 	KASSERT(curcpu() != ci);
 
+	membar_exit();		/* matches membar_enter in hppa_ipi_intr */
 	if (ci) {
 		/* Unicast: remote CPU. */
 		hppa_ipi_send(ci, HPPA_IPI_GENERIC);



CVS commit: src/sys/arch/hppa/hppa

2022-02-12 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Feb 12 17:09:07 UTC 2022

Modified Files:
src/sys/arch/hppa/hppa: ipifuncs.c

Log Message:
hppa: Membar audit in ipifuncs.c.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/hppa/hppa/ipifuncs.c

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



CVS commit: src/sys/kern

2022-02-12 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Sat Feb 12 16:31:06 UTC 2022

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

Log Message:
more __diagused to appease clang


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/kern/subr_psref.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_psref.c
diff -u src/sys/kern/subr_psref.c:1.17 src/sys/kern/subr_psref.c:1.18
--- src/sys/kern/subr_psref.c:1.17	Tue Feb  8 12:59:16 2022
+++ src/sys/kern/subr_psref.c	Sat Feb 12 16:31:06 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: subr_psref.c,v 1.17 2022/02/08 12:59:16 riastradh Exp $	*/
+/*	$NetBSD: subr_psref.c,v 1.18 2022/02/12 16:31:06 macallan Exp $	*/
 
 /*-
  * Copyright (c) 2016 The NetBSD Foundation, Inc.
@@ -64,7 +64,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: subr_psref.c,v 1.17 2022/02/08 12:59:16 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_psref.c,v 1.18 2022/02/12 16:31:06 macallan Exp $");
 
 #include 
 #include 
@@ -180,7 +180,7 @@ psref_cpu_drained_p(void *p, void *cooki
 		*retp = false;
 }
 
-static bool
+static bool __diagused
 psref_class_drained_p(const struct psref_class *prc)
 {
 	bool ret = true;



CVS commit: src/sys/kern

2022-02-12 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Sat Feb 12 16:31:06 UTC 2022

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

Log Message:
more __diagused to appease clang


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

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



CVS commit: src/sys/dev/pci

2022-02-12 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sat Feb 12 16:21:27 UTC 2022

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

Log Message:
Don't dig into the guts of selinfo.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/dev/pci/xmm7360.c

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

Modified files:

Index: src/sys/dev/pci/xmm7360.c
diff -u src/sys/dev/pci/xmm7360.c:1.15 src/sys/dev/pci/xmm7360.c:1.16
--- src/sys/dev/pci/xmm7360.c:1.15	Sat Feb 12 15:51:29 2022
+++ src/sys/dev/pci/xmm7360.c	Sat Feb 12 16:21:27 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: xmm7360.c,v 1.15 2022/02/12 15:51:29 thorpej Exp $	*/
+/*	$NetBSD: xmm7360.c,v 1.16 2022/02/12 16:21:27 thorpej Exp $	*/
 
 /*
  * Device driver for Intel XMM7360 LTE modems, eg. Fibocom L850-GL.
@@ -75,7 +75,7 @@ MODULE_DEVICE_TABLE(pci, xmm7360_ids);
 #include "opt_gateway.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: xmm7360.c,v 1.15 2022/02/12 15:51:29 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xmm7360.c,v 1.16 2022/02/12 16:21:27 thorpej Exp $");
 #endif
 
 #include 
@@ -203,6 +203,11 @@ typedef struct mutex spinlock_t;
 #define XMM_KQ_ISFD_INITIALIZER		.f_flags = FILTEROP_ISFD
 #endif /* OpenBSD <= 201911 */
 
+#define	selrecord_knote(si, kn)		\
+	klist_insert(&(si)->si_note, (kn))
+#define	selremove_knote(si, kn)		\
+	klist_remove(&(si)->si_note, (kn))
+
 #endif
 
 #ifdef __NetBSD__
@@ -257,7 +262,6 @@ typedef struct kmutex spinlock_t;
 #define if_ih_remove(ifp, func, arg)	/* nothing to do */
 #define if_hardmtu			if_mtu
 #define IF_OUTPUT_CONST			const
-#define si_notesel_klist
 #define XMM_KQ_ISFD_INITIALIZER		.f_flags = FILTEROP_ISFD
 #define tty_lock()			mutex_spin_enter(&tty_lock)
 #define tty_unlock()			mutex_spin_exit(&tty_lock)
@@ -2750,7 +2754,7 @@ filt_wwancrdetach(struct knote *kn)
 	struct queue_pair *qp = (struct queue_pair *)kn->kn_hook;
 
 	tty_lock();
-	klist_remove(&qp->selr.si_note, kn);
+	selremove_knote(&qp->selr, kn);
 	tty_unlock();
 }
 
@@ -2777,7 +2781,7 @@ filt_wwancwdetach(struct knote *kn)
 	struct queue_pair *qp = (struct queue_pair *)kn->kn_hook;
 
 	tty_lock();
-	klist_remove(&qp->selw.si_note, kn);
+	selremove_knote(&qp->selw, kn);
 	tty_unlock();
 }
 
@@ -2816,7 +2820,7 @@ wwanckqfilter(dev_t dev, struct knote *k
 	struct wwanc_softc *sc = device_lookup_private(&wwanc_cd, DEVUNIT(dev));
 	int func = DEVFUNC(dev);
 	struct queue_pair *qp = &sc->sc_xmm.qp[func];
-	struct klist *klist;
+	struct selinfo *si;
 
 	if (DEV_IS_TTY(func))
 		return ttkqfilter(dev, kn);
@@ -2825,11 +2829,11 @@ wwanckqfilter(dev_t dev, struct knote *k
 
 	switch (kn->kn_filter) {
 	case EVFILT_READ:
-		klist = &qp->selr.si_note;
+		si = &qp->selr;
 		kn->kn_fop = &wwancread_filtops;
 		break;
 	case EVFILT_WRITE:
-		klist = &qp->selw.si_note;
+		si = &qp->selw;
 		kn->kn_fop = &wwancwrite_filtops;
 		break;
 	default:
@@ -2839,7 +2843,7 @@ wwanckqfilter(dev_t dev, struct knote *k
 	kn->kn_hook = (void *)qp;
 
 	tty_lock();
-	klist_insert(klist, kn);
+	selrecord_knote(si, kn);
 	tty_unlock();
 
 	return (0);



CVS commit: src/sys/dev/pci

2022-02-12 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sat Feb 12 16:21:27 UTC 2022

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

Log Message:
Don't dig into the guts of selinfo.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/dev/pci/xmm7360.c

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



CVS commit: src/sys/dev/usb

2022-02-12 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Sat Feb 12 15:55:04 UTC 2022

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

Log Message:
initialize ntag with the old dmatag so we never end up with an invalid one
suggested by jmcneill@


To generate a diff of this commit:
cvs rdiff -u -r1.301 -r1.302 src/sys/dev/usb/ehci.c

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

Modified files:

Index: src/sys/dev/usb/ehci.c
diff -u src/sys/dev/usb/ehci.c:1.301 src/sys/dev/usb/ehci.c:1.302
--- src/sys/dev/usb/ehci.c:1.301	Wed Jan 26 16:49:06 2022
+++ src/sys/dev/usb/ehci.c	Sat Feb 12 15:55:04 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: ehci.c,v 1.301 2022/01/26 16:49:06 macallan Exp $ */
+/*	$NetBSD: ehci.c,v 1.302 2022/02/12 15:55:04 macallan Exp $ */
 
 /*
  * Copyright (c) 2004-2012,2016,2020 The NetBSD Foundation, Inc.
@@ -54,7 +54,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.301 2022/01/26 16:49:06 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.302 2022/02/12 15:55:04 macallan Exp $");
 
 #include "ohci.h"
 #include "uhci.h"
@@ -498,7 +498,7 @@ ehci_init(ehci_softc_t *sc)
 	 * - the driver doesn't currently set EHCI_CTRLDSSEGMENT to anything
 	 *   other than 0.
 	 */
-	bus_dma_tag_t ntag = NULL;
+	bus_dma_tag_t ntag = sc->sc_bus.ub_dmatag;
 	sc->sc_dmatag = sc->sc_bus.ub_dmatag;
 	err = bus_dmatag_subregion(sc->sc_bus.ub_dmatag, 0, UINT32_MAX,
 	&ntag, 0);



CVS commit: src/sys/dev/usb

2022-02-12 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Sat Feb 12 15:55:04 UTC 2022

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

Log Message:
initialize ntag with the old dmatag so we never end up with an invalid one
suggested by jmcneill@


To generate a diff of this commit:
cvs rdiff -u -r1.301 -r1.302 src/sys/dev/usb/ehci.c

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



CVS commit: src/sys

2022-02-12 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sat Feb 12 15:51:29 UTC 2022

Modified Files:
src/sys/arch/arm/xscale: pxa2x0_apm.c
src/sys/arch/mips/ralink: ralink_gpio.c
src/sys/dev/pci: xmm7360.c
src/sys/external/bsd/drm2/linux: linux_sync_file.c
src/sys/kern: kern_event.c kern_proc.c kern_sig.c sys_select.c
vfs_init.c vfs_syscalls.c vfs_vnode.c
src/sys/sys: event.h mount.h

Log Message:
Add inline functions to manipulate the klists that link up knotes
via kn_selnext:

- klist_init()
- klist_fini()
- klist_insert()
- klist_remove()

These provide some API insulation from the implementation details of these
lists (but not completely; see vn_knote_attach() and vn_knote_detach()).
Currently just a wrapper around SLIST(9).

This will make it significantly easier to switch kn_selnext linkage
to a different kind of list.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/arm/xscale/pxa2x0_apm.c
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/mips/ralink/ralink_gpio.c
cvs rdiff -u -r1.14 -r1.15 src/sys/dev/pci/xmm7360.c
cvs rdiff -u -r1.1 -r1.2 src/sys/external/bsd/drm2/linux/linux_sync_file.c
cvs rdiff -u -r1.139 -r1.140 src/sys/kern/kern_event.c
cvs rdiff -u -r1.262 -r1.263 src/sys/kern/kern_proc.c
cvs rdiff -u -r1.400 -r1.401 src/sys/kern/kern_sig.c
cvs rdiff -u -r1.57 -r1.58 src/sys/kern/sys_select.c
cvs rdiff -u -r1.53 -r1.54 src/sys/kern/vfs_init.c
cvs rdiff -u -r1.554 -r1.555 src/sys/kern/vfs_syscalls.c
cvs rdiff -u -r1.129 -r1.130 src/sys/kern/vfs_vnode.c
cvs rdiff -u -r1.51 -r1.52 src/sys/sys/event.h
cvs rdiff -u -r1.237 -r1.238 src/sys/sys/mount.h

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

Modified files:

Index: src/sys/arch/arm/xscale/pxa2x0_apm.c
diff -u src/sys/arch/arm/xscale/pxa2x0_apm.c:1.7 src/sys/arch/arm/xscale/pxa2x0_apm.c:1.8
--- src/sys/arch/arm/xscale/pxa2x0_apm.c:1.7	Sun Sep 26 16:36:18 2021
+++ src/sys/arch/arm/xscale/pxa2x0_apm.c	Sat Feb 12 15:51:28 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: pxa2x0_apm.c,v 1.7 2021/09/26 16:36:18 thorpej Exp $	*/
+/*	$NetBSD: pxa2x0_apm.c,v 1.8 2022/02/12 15:51:28 thorpej Exp $	*/
 /*	$OpenBSD: pxa2x0_apm.c,v 1.28 2007/03/29 18:42:38 uwe Exp $	*/
 
 /*-
@@ -601,7 +601,7 @@ filt_apmrdetach(struct knote *kn)
 	struct pxa2x0_apm_softc *sc =
 	(struct pxa2x0_apm_softc *)kn->kn_hook;
 
-	SLIST_REMOVE(&sc->sc_note, kn, knote, kn_selnext);
+	klist_remove(&sc->sc_note, kn);
 }
 
 int
@@ -633,7 +633,7 @@ apmkqfilter(dev_t dev, struct knote *kn)
 	}
 
 	kn->kn_hook = (caddr_t)sc;
-	SLIST_INSERT_HEAD(&sc->sc_note, kn, kn_selnext);
+	klist_insert(&sc->sc_note, kn);
 
 	return (0);
 }
@@ -651,6 +651,7 @@ pxa2x0_apm_attach_sub(struct pxa2x0_apm_
 	}
 
 	lockinit(&sc->sc_lock, PWAIT, "apmlk", 0, 0);
+	klist_init(&sc->sc_note);
 
 	kthread_create_deferred(apm_thread_create, sc);
 

Index: src/sys/arch/mips/ralink/ralink_gpio.c
diff -u src/sys/arch/mips/ralink/ralink_gpio.c:1.13 src/sys/arch/mips/ralink/ralink_gpio.c:1.14
--- src/sys/arch/mips/ralink/ralink_gpio.c:1.13	Sun Sep 26 01:16:07 2021
+++ src/sys/arch/mips/ralink/ralink_gpio.c	Sat Feb 12 15:51:29 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: ralink_gpio.c,v 1.13 2021/09/26 01:16:07 thorpej Exp $	*/
+/*	$NetBSD: ralink_gpio.c,v 1.14 2022/02/12 15:51:29 thorpej Exp $	*/
 /*-
  * Copyright (c) 2011 CradlePoint Technology, Inc.
  * All rights reserved.
@@ -29,7 +29,7 @@
 /* ra_gpio.c -- Ralink 3052 gpio driver */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ralink_gpio.c,v 1.13 2021/09/26 01:16:07 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ralink_gpio.c,v 1.14 2022/02/12 15:51:29 thorpej Exp $");
 
 #include 
 #include 
@@ -660,7 +660,7 @@ ra_gpio_attach(device_t parent, device_t
 		goto fail_3;
 	}
 
-	SLIST_INIT(&knotes);
+	klist_init(&knotes);
 	if (kfilter_register("CP_GPIO_EVENT", &app_fops, &app_filter_id) != 0) {
 		RALINK_DEBUG(RALINK_DEBUG_ERROR,
 			"%s: kfilter_register for CP_GPIO_EVENT failed\n",
@@ -1514,7 +1514,7 @@ gpio_event_app_user_attach(struct knote 
 	}
 
 	kn->kn_flags |= EV_CLEAR;	/* automatically set */
-	SLIST_INSERT_HEAD(&knotes, kn, kn_selnext);
+	klist_insert(&knotes, kn);
 
 	return 0;
 }
@@ -1530,7 +1530,7 @@ gpio_event_app_user_detach(struct knote 
 		RALINK_DEBUG(RALINK_DEBUG_ERROR, "Null kn found\n");
 		return;
 	}
-	SLIST_REMOVE(&knotes, kn, knote, kn_selnext);
+	klist_remove(&knotes, kn);
 }
 
 /*

Index: src/sys/dev/pci/xmm7360.c
diff -u src/sys/dev/pci/xmm7360.c:1.14 src/sys/dev/pci/xmm7360.c:1.15
--- src/sys/dev/pci/xmm7360.c:1.14	Sat Feb 12 03:24:36 2022
+++ src/sys/dev/pci/xmm7360.c	Sat Feb 12 15:51:29 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: xmm7360.c,v 1.14 2022/02/12 03:24:36 riastradh Exp $	*/
+/*	$NetBSD: xmm7360.c,v 1.15 2022/02/12 15:51:29 thorpej Exp $	*/
 
 /*
  * Device driver for Intel XMM7360 LTE modems, eg. Fibocom L850-GL.
@@ -75,7 +75,7 @@ MODULE_DEVICE_TABLE(pci, xmm7360_ids);
 #include "opt_gateway.h"
 
 #include 
-__KERNE

CVS commit: src/sys

2022-02-12 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sat Feb 12 15:51:29 UTC 2022

Modified Files:
src/sys/arch/arm/xscale: pxa2x0_apm.c
src/sys/arch/mips/ralink: ralink_gpio.c
src/sys/dev/pci: xmm7360.c
src/sys/external/bsd/drm2/linux: linux_sync_file.c
src/sys/kern: kern_event.c kern_proc.c kern_sig.c sys_select.c
vfs_init.c vfs_syscalls.c vfs_vnode.c
src/sys/sys: event.h mount.h

Log Message:
Add inline functions to manipulate the klists that link up knotes
via kn_selnext:

- klist_init()
- klist_fini()
- klist_insert()
- klist_remove()

These provide some API insulation from the implementation details of these
lists (but not completely; see vn_knote_attach() and vn_knote_detach()).
Currently just a wrapper around SLIST(9).

This will make it significantly easier to switch kn_selnext linkage
to a different kind of list.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/arm/xscale/pxa2x0_apm.c
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/mips/ralink/ralink_gpio.c
cvs rdiff -u -r1.14 -r1.15 src/sys/dev/pci/xmm7360.c
cvs rdiff -u -r1.1 -r1.2 src/sys/external/bsd/drm2/linux/linux_sync_file.c
cvs rdiff -u -r1.139 -r1.140 src/sys/kern/kern_event.c
cvs rdiff -u -r1.262 -r1.263 src/sys/kern/kern_proc.c
cvs rdiff -u -r1.400 -r1.401 src/sys/kern/kern_sig.c
cvs rdiff -u -r1.57 -r1.58 src/sys/kern/sys_select.c
cvs rdiff -u -r1.53 -r1.54 src/sys/kern/vfs_init.c
cvs rdiff -u -r1.554 -r1.555 src/sys/kern/vfs_syscalls.c
cvs rdiff -u -r1.129 -r1.130 src/sys/kern/vfs_vnode.c
cvs rdiff -u -r1.51 -r1.52 src/sys/sys/event.h
cvs rdiff -u -r1.237 -r1.238 src/sys/sys/mount.h

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



CVS commit: src/usr.bin/indent

2022-02-12 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Feb 12 15:50:14 UTC 2022

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

Log Message:
indent: extend debug logging for the parser state

The member names in struct parser_state are not trustworthy, for example
in_decl does not correspond to the intuitive definition of "inside a
declaration".  To cope with this uncertainty, output the full state of
the parser state to the debug log, not only the changes.  This helps to
track the inner state for small differences in the input, such as
between 'typedef enum { TA, TB } TT' and 'enum { EA, EB } ET'.

This hopefully helps in fixing PR#55453.

No functional change outside debug mode.


To generate a diff of this commit:
cvs rdiff -u -r1.167 -r1.168 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.167 src/usr.bin/indent/lexi.c:1.168
--- src/usr.bin/indent/lexi.c:1.167	Sun Nov 28 14:29:03 2021
+++ src/usr.bin/indent/lexi.c	Sat Feb 12 15:50:14 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: lexi.c,v 1.167 2021/11/28 14:29:03 rillig Exp $	*/
+/*	$NetBSD: lexi.c,v 1.168 2022/02/12 15:50:14 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.167 2021/11/28 14:29:03 rillig Exp $");
+__RCSID("$NetBSD: lexi.c,v 1.168 2022/02/12 15:50:14 rillig Exp $");
 #elif defined(__FreeBSD__)
 __FBSDID("$FreeBSD: head/usr.bin/indent/lexi.c 337862 2018-08-15 18:19:45Z pstef $");
 #endif
@@ -244,12 +244,23 @@ debug_print_buf(const char *name, const 
 }
 }
 
+static bool
+debug_full_parser_state(void)
+{
+return true;
+}
+
 #define debug_ps_bool(name) \
 if (ps.name != prev_ps.name) \
-	debug_println("[%c] ps." #name, ps.name ? 'x' : ' ')
+	debug_println("[%c] -> [%c] ps." #name, \
+		prev_ps.name ? 'x' : ' ', ps.name ? 'x' : ' '); \
+	else if (debug_full_parser_state()) \
+	debug_println("   [%c] ps." #name, ps.name ? 'x' : ' ')
 #define debug_ps_int(name) \
 	if (ps.name != prev_ps.name) \
-	debug_println("%3d ps." #name, ps.name)
+	debug_println("%3d -> %3d ps." #name, prev_ps.name, ps.name); \
+	else if (debug_full_parser_state()) \
+	debug_println("   %3d ps." #name, ps.name)
 
 static void
 debug_lexi(lexer_symbol lsym)
@@ -268,7 +279,7 @@ debug_lexi(lexer_symbol lsym)
 debug_print_buf("code", &code);
 debug_print_buf("comment", &com);
 
-debug_println("ps.prev_token = %s", lsym_name(ps.prev_token));
+debug_println("   ps.prev_token = %s", lsym_name(ps.prev_token));
 debug_ps_bool(next_col_1);
 debug_ps_bool(curr_col_1);
 debug_ps_bool(next_unary);
@@ -277,7 +288,7 @@ debug_lexi(lexer_symbol lsym)
 debug_ps_int(paren_level);
 debug_ps_int(p_l_follow);
 if (ps.paren_level != prev_ps.paren_level) {
-	debug_printf("ps.paren_indents:");
+	debug_printf("   ps.paren_indents:");
 	for (int i = 0; i < ps.paren_level; i++)
 	debug_printf(" %d", ps.paren_indents[i]);
 	debug_println("");
@@ -497,7 +508,7 @@ lexi_alnum(void)
 if (ch_isdigit(inp_peek()) ||
 	(inp_peek() == '.' && ch_isdigit(inp_lookahead(1 {
 	lex_number();
-} else if (is_identifier_part(inp_peek())) {
+} else if (is_identifier_start(inp_peek())) {
 	lex_word();
 
 	if (token.s[0] == 'L' && token.e - token.s == 1 &&



CVS commit: src/usr.bin/indent

2022-02-12 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Feb 12 15:50:14 UTC 2022

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

Log Message:
indent: extend debug logging for the parser state

The member names in struct parser_state are not trustworthy, for example
in_decl does not correspond to the intuitive definition of "inside a
declaration".  To cope with this uncertainty, output the full state of
the parser state to the debug log, not only the changes.  This helps to
track the inner state for small differences in the input, such as
between 'typedef enum { TA, TB } TT' and 'enum { EA, EB } ET'.

This hopefully helps in fixing PR#55453.

No functional change outside debug mode.


To generate a diff of this commit:
cvs rdiff -u -r1.167 -r1.168 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/lib/libpthread

2022-02-12 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Feb 12 14:59:32 UTC 2022

Modified Files:
src/lib/libpthread: pthread.c pthread_attr.c pthread_barrier.c
pthread_cancelstub.c pthread_compat.c pthread_cond.c
pthread_getcpuclockid.c pthread_int.h pthread_lock.c
pthread_makelwp_netbsd.c pthread_misc.c pthread_mutex.c
pthread_once.c pthread_rwlock.c pthread_specific.c pthread_spin.c
pthread_tsd.c res_state.c

Log Message:
libpthread: Move namespacing include to top of .c files.

Stuff like libc's namespace.h, or atomic_op_namespace.h, which does
namespacing tricks like `#define atomic_cas_uint _atomic_cas_uint',
has to go at the top of each .c file.  If it goes in the middle, it
might be too late to affect the declarations, and result in compile
errors.

I tripped over this by including  in mips
.

(Maybe we should create a new pthread_namespace.h file for the
purpose, but this'll do for now.)


To generate a diff of this commit:
cvs rdiff -u -r1.179 -r1.180 src/lib/libpthread/pthread.c
cvs rdiff -u -r1.19 -r1.20 src/lib/libpthread/pthread_attr.c
cvs rdiff -u -r1.22 -r1.23 src/lib/libpthread/pthread_barrier.c
cvs rdiff -u -r1.40 -r1.41 src/lib/libpthread/pthread_cancelstub.c
cvs rdiff -u -r1.6 -r1.7 src/lib/libpthread/pthread_compat.c \
src/lib/libpthread/res_state.c
cvs rdiff -u -r1.76 -r1.77 src/lib/libpthread/pthread_cond.c
cvs rdiff -u -r1.3 -r1.4 src/lib/libpthread/pthread_getcpuclockid.c \
src/lib/libpthread/pthread_once.c
cvs rdiff -u -r1.107 -r1.108 src/lib/libpthread/pthread_int.h
cvs rdiff -u -r1.34 -r1.35 src/lib/libpthread/pthread_lock.c
cvs rdiff -u -r1.2 -r1.3 src/lib/libpthread/pthread_makelwp_netbsd.c
cvs rdiff -u -r1.17 -r1.18 src/lib/libpthread/pthread_misc.c
cvs rdiff -u -r1.81 -r1.82 src/lib/libpthread/pthread_mutex.c
cvs rdiff -u -r1.43 -r1.44 src/lib/libpthread/pthread_rwlock.c
cvs rdiff -u -r1.26 -r1.27 src/lib/libpthread/pthread_specific.c
cvs rdiff -u -r1.8 -r1.9 src/lib/libpthread/pthread_spin.c
cvs rdiff -u -r1.23 -r1.24 src/lib/libpthread/pthread_tsd.c

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

Modified files:

Index: src/lib/libpthread/pthread.c
diff -u src/lib/libpthread/pthread.c:1.179 src/lib/libpthread/pthread.c:1.180
--- src/lib/libpthread/pthread.c:1.179	Tue Apr 13 00:31:54 2021
+++ src/lib/libpthread/pthread.c	Sat Feb 12 14:59:32 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: pthread.c,v 1.179 2021/04/13 00:31:54 mrg Exp $	*/
+/*	$NetBSD: pthread.c,v 1.180 2022/02/12 14:59:32 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2001, 2002, 2003, 2006, 2007, 2008, 2020
@@ -31,10 +31,13 @@
  */
 
 #include 
-__RCSID("$NetBSD: pthread.c,v 1.179 2021/04/13 00:31:54 mrg Exp $");
+__RCSID("$NetBSD: pthread.c,v 1.180 2022/02/12 14:59:32 riastradh Exp $");
 
 #define	__EXPOSE_STACK	1
 
+/* Need to use libc-private names for atomic operations. */
+#include "../../common/lib/libc/atomic/atomic_op_namespace.h"
+
 #include 
 #include 
 #include 

Index: src/lib/libpthread/pthread_attr.c
diff -u src/lib/libpthread/pthread_attr.c:1.19 src/lib/libpthread/pthread_attr.c:1.20
--- src/lib/libpthread/pthread_attr.c:1.19	Wed Jan 29 13:47:31 2020
+++ src/lib/libpthread/pthread_attr.c	Sat Feb 12 14:59:32 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: pthread_attr.c,v 1.19 2020/01/29 13:47:31 kamil Exp $	*/
+/*	$NetBSD: pthread_attr.c,v 1.20 2022/02/12 14:59:32 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2001, 2002, 2003, 2008 The NetBSD Foundation, Inc.
@@ -30,7 +30,10 @@
  */
 
 #include 
-__RCSID("$NetBSD: pthread_attr.c,v 1.19 2020/01/29 13:47:31 kamil Exp $");
+__RCSID("$NetBSD: pthread_attr.c,v 1.20 2022/02/12 14:59:32 riastradh Exp $");
+
+/* Need to use libc-private names for atomic operations. */
+#include "../../common/lib/libc/atomic/atomic_op_namespace.h"
 
 #include 
 #include 

Index: src/lib/libpthread/pthread_barrier.c
diff -u src/lib/libpthread/pthread_barrier.c:1.22 src/lib/libpthread/pthread_barrier.c:1.23
--- src/lib/libpthread/pthread_barrier.c:1.22	Sat May 16 22:53:37 2020
+++ src/lib/libpthread/pthread_barrier.c	Sat Feb 12 14:59:32 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: pthread_barrier.c,v 1.22 2020/05/16 22:53:37 ad Exp $	*/
+/*	$NetBSD: pthread_barrier.c,v 1.23 2022/02/12 14:59:32 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2001, 2003, 2006, 2007, 2009, 2020 The NetBSD Foundation, Inc.
@@ -30,7 +30,10 @@
  */
 
 #include 
-__RCSID("$NetBSD: pthread_barrier.c,v 1.22 2020/05/16 22:53:37 ad Exp $");
+__RCSID("$NetBSD: pthread_barrier.c,v 1.23 2022/02/12 14:59:32 riastradh Exp $");
+
+/* Need to use libc-private names for atomic operations. */
+#include "../../common/lib/libc/atomic/atomic_op_namespace.h"
 
 #include 
 

Index: src/lib/libpthread/pthread_cancelstub.c
diff -u src/lib/libpthread/pthread_cancelstub.c:1.40 src/lib/libpthread/pthread_cancelstub.c:1.41
--- src/lib/libpthread/pthread_cancelstub.c:1.40	Fri Oct  1 20:13:38 2021
+++ src/lib/libpthre

CVS commit: src/lib/libpthread

2022-02-12 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Feb 12 14:59:32 UTC 2022

Modified Files:
src/lib/libpthread: pthread.c pthread_attr.c pthread_barrier.c
pthread_cancelstub.c pthread_compat.c pthread_cond.c
pthread_getcpuclockid.c pthread_int.h pthread_lock.c
pthread_makelwp_netbsd.c pthread_misc.c pthread_mutex.c
pthread_once.c pthread_rwlock.c pthread_specific.c pthread_spin.c
pthread_tsd.c res_state.c

Log Message:
libpthread: Move namespacing include to top of .c files.

Stuff like libc's namespace.h, or atomic_op_namespace.h, which does
namespacing tricks like `#define atomic_cas_uint _atomic_cas_uint',
has to go at the top of each .c file.  If it goes in the middle, it
might be too late to affect the declarations, and result in compile
errors.

I tripped over this by including  in mips
.

(Maybe we should create a new pthread_namespace.h file for the
purpose, but this'll do for now.)


To generate a diff of this commit:
cvs rdiff -u -r1.179 -r1.180 src/lib/libpthread/pthread.c
cvs rdiff -u -r1.19 -r1.20 src/lib/libpthread/pthread_attr.c
cvs rdiff -u -r1.22 -r1.23 src/lib/libpthread/pthread_barrier.c
cvs rdiff -u -r1.40 -r1.41 src/lib/libpthread/pthread_cancelstub.c
cvs rdiff -u -r1.6 -r1.7 src/lib/libpthread/pthread_compat.c \
src/lib/libpthread/res_state.c
cvs rdiff -u -r1.76 -r1.77 src/lib/libpthread/pthread_cond.c
cvs rdiff -u -r1.3 -r1.4 src/lib/libpthread/pthread_getcpuclockid.c \
src/lib/libpthread/pthread_once.c
cvs rdiff -u -r1.107 -r1.108 src/lib/libpthread/pthread_int.h
cvs rdiff -u -r1.34 -r1.35 src/lib/libpthread/pthread_lock.c
cvs rdiff -u -r1.2 -r1.3 src/lib/libpthread/pthread_makelwp_netbsd.c
cvs rdiff -u -r1.17 -r1.18 src/lib/libpthread/pthread_misc.c
cvs rdiff -u -r1.81 -r1.82 src/lib/libpthread/pthread_mutex.c
cvs rdiff -u -r1.43 -r1.44 src/lib/libpthread/pthread_rwlock.c
cvs rdiff -u -r1.26 -r1.27 src/lib/libpthread/pthread_specific.c
cvs rdiff -u -r1.8 -r1.9 src/lib/libpthread/pthread_spin.c
cvs rdiff -u -r1.23 -r1.24 src/lib/libpthread/pthread_tsd.c

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

2022-02-12 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Feb 12 13:38:29 UTC 2022

Modified Files:
src/tests/usr.bin/indent: lsym_typedef.c

Log Message:
tests/indent: demonstrate wrong formatting of enum (since 2019-04-04)

Reported by me in PR#55453.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/usr.bin/indent/lsym_typedef.c

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/lsym_typedef.c
diff -u src/tests/usr.bin/indent/lsym_typedef.c:1.1 src/tests/usr.bin/indent/lsym_typedef.c:1.2
--- src/tests/usr.bin/indent/lsym_typedef.c:1.1	Thu Nov 18 21:19:19 2021
+++ src/tests/usr.bin/indent/lsym_typedef.c	Sat Feb 12 13:38:29 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: lsym_typedef.c,v 1.1 2021/11/18 21:19:19 rillig Exp $ */
+/* $NetBSD: lsym_typedef.c,v 1.2 2022/02/12 13:38:29 rillig Exp $ */
 /* $FreeBSD$ */
 
 /*
@@ -6,8 +6,46 @@
  * for giving a type an additional name.
  */
 
+/*
+ * Since 2019-04-04, indent places all enum constants except the first in the
+ * wrong column, but only if the enum declaration follows a 'typedef'.
+ *
+ * https://gnats.netbsd.org/55453
+ */
 #indent input
-// TODO: add input
+typedef enum {
+TC1,
+TC2
+} T;
+
+enum {
+EC1,
+EC2
+} E;
+#indent end
+
+/* FIXME: TC2 is indented too far. */
+#indent run -ci4 -i4
+typedef enum {
+TC1,
+	TC2
+} T;
+
+enum {
+EC1,
+EC2
+}		E;
 #indent end
 
-#indent run-equals-input
+/* FIXME: TC2 is indented too far. */
+#indent run -ci2
+typedef enum {
+	TC1,
+	  TC2
+} T;
+
+enum {
+	EC1,
+	EC2
+}		E;
+#indent end



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

2022-02-12 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Feb 12 13:38:29 UTC 2022

Modified Files:
src/tests/usr.bin/indent: lsym_typedef.c

Log Message:
tests/indent: demonstrate wrong formatting of enum (since 2019-04-04)

Reported by me in PR#55453.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/usr.bin/indent/lsym_typedef.c

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



CVS commit: src

2022-02-12 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Feb 12 13:17:57 UTC 2022

Modified Files:
src/distrib/sets/lists/tests: mi
src/usr.bin/make/unit-tests: Makefile
Added Files:
src/usr.bin/make/unit-tests: opt-keep-going-indirect.exp
opt-keep-going-indirect.mk

Log Message:
tests/make: document the history of bugs in '-k' mode

Reported in PR#49720 in 2015, fixed independently in compat.c 1.199 from
2020-12-07.


To generate a diff of this commit:
cvs rdiff -u -r1.1187 -r1.1188 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.308 -r1.309 src/usr.bin/make/unit-tests/Makefile
cvs rdiff -u -r0 -r1.1 \
src/usr.bin/make/unit-tests/opt-keep-going-indirect.exp \
src/usr.bin/make/unit-tests/opt-keep-going-indirect.mk

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.1187 src/distrib/sets/lists/tests/mi:1.1188
--- src/distrib/sets/lists/tests/mi:1.1187	Sat Feb 12 01:15:17 2022
+++ src/distrib/sets/lists/tests/mi	Sat Feb 12 13:17:57 2022
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1187 2022/02/12 01:15:17 rillig Exp $
+# $NetBSD: mi,v 1.1188 2022/02/12 13:17:57 rillig Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -5803,6 +5803,8 @@
 ./usr/tests/usr.bin/make/unit-tests/opt-jobs-no-action.mk			tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/opt-jobs.exptests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/opt-jobs.mk	tests-usr.bin-tests	compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/opt-keep-going-indirect.exp			tests-usr.bin-tests	compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/opt-keep-going-indirect.mk			tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/opt-keep-going-multiple.exp			tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/opt-keep-going-multiple.mk			tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/opt-keep-going.exptests-usr.bin-tests	compattestfile,atf

Index: src/usr.bin/make/unit-tests/Makefile
diff -u src/usr.bin/make/unit-tests/Makefile:1.308 src/usr.bin/make/unit-tests/Makefile:1.309
--- src/usr.bin/make/unit-tests/Makefile:1.308	Sat Feb 12 01:15:18 2022
+++ src/usr.bin/make/unit-tests/Makefile	Sat Feb 12 13:17:57 2022
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.308 2022/02/12 01:15:18 rillig Exp $
+# $NetBSD: Makefile,v 1.309 2022/02/12 13:17:57 rillig Exp $
 #
 # Unit tests for make(1)
 #
@@ -260,6 +260,7 @@ TESTS+=		opt-jobs
 TESTS+=		opt-jobs-internal
 TESTS+=		opt-jobs-no-action
 TESTS+=		opt-keep-going
+TESTS+=		opt-keep-going-indirect
 TESTS+=		opt-keep-going-multiple
 TESTS+=		opt-m-include-dir
 TESTS+=		opt-no-action

Added files:

Index: src/usr.bin/make/unit-tests/opt-keep-going-indirect.exp
diff -u /dev/null src/usr.bin/make/unit-tests/opt-keep-going-indirect.exp:1.1
--- /dev/null	Sat Feb 12 13:17:57 2022
+++ src/usr.bin/make/unit-tests/opt-keep-going-indirect.exp	Sat Feb 12 13:17:57 2022
@@ -0,0 +1,32 @@
+direct compat
+false
+*** Error code 1 (continuing)
+
+Stop.
+make: stopped in unit-tests
+exited 1
+
+direct jobs
+false
+*** [direct] Error code 1
+
+make: stopped in unit-tests
+exited 1
+
+indirect compat
+false
+*** Error code 1 (continuing)
+`indirect' not remade because of errors.
+
+Stop.
+make: stopped in unit-tests
+exited 1
+
+indirect jobs
+false
+*** [direct] Error code 1
+
+make: stopped in unit-tests
+exited 1
+
+exit status 0
Index: src/usr.bin/make/unit-tests/opt-keep-going-indirect.mk
diff -u /dev/null src/usr.bin/make/unit-tests/opt-keep-going-indirect.mk:1.1
--- /dev/null	Sat Feb 12 13:17:57 2022
+++ src/usr.bin/make/unit-tests/opt-keep-going-indirect.mk	Sat Feb 12 13:17:57 2022
@@ -0,0 +1,88 @@
+# $NetBSD: opt-keep-going-indirect.mk,v 1.1 2022/02/12 13:17:57 rillig Exp $
+#
+# Tests for the -k command line option, which stops building a target as soon
+# as an error is detected, but continues building the other, independent
+# targets, as far as possible.
+#
+# History:
+#	In 1993, the exit status for the option '-k' was always 0, even if a
+#	a direct or an indirect target failed.
+#
+#	Since 2000.12.30.02.05.21, the word '(continuing)' is missing in jobs
+#	mode, both for direct as well as indirect targets.
+#
+#	Since 2001.10.16.18.50.12, the exit status for a direct failure in
+#	compat mode is 1, while jobs mode and indirect failures still return
+#	exit status 0.  The number of empty lines between the various error
+#	messages differs between the modes, for no reason.
+#
+#	At 2006.11.17.22.07.39, the exit status for direct failures in both
+#	modes and for indirect failures in jobs mode was corrected, leaving
+#	only indirect failures in compat mode wrong.  On the downside, a
+#	failed indirect target in jobs mode was no longer listed as "not
+#	remade becau

CVS commit: src

2022-02-12 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Feb 12 13:17:57 UTC 2022

Modified Files:
src/distrib/sets/lists/tests: mi
src/usr.bin/make/unit-tests: Makefile
Added Files:
src/usr.bin/make/unit-tests: opt-keep-going-indirect.exp
opt-keep-going-indirect.mk

Log Message:
tests/make: document the history of bugs in '-k' mode

Reported in PR#49720 in 2015, fixed independently in compat.c 1.199 from
2020-12-07.


To generate a diff of this commit:
cvs rdiff -u -r1.1187 -r1.1188 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.308 -r1.309 src/usr.bin/make/unit-tests/Makefile
cvs rdiff -u -r0 -r1.1 \
src/usr.bin/make/unit-tests/opt-keep-going-indirect.exp \
src/usr.bin/make/unit-tests/opt-keep-going-indirect.mk

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



CVS commit: src/usr.bin/make

2022-02-12 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Feb 12 11:14:48 UTC 2022

Modified Files:
src/usr.bin/make: job.c
src/usr.bin/make/unit-tests: deptgt-silent-jobs.exp
deptgt-silent-jobs.mk sh-flags.exp

Log Message:
make: fix echoing of command with '-' in silent target in jobs mode

Since job.c 1.83 from 2003-12-20, the command had been echoed even if
the target had the attribute '.SILENT'.

In sh-flags.exp, each removed 'echo' command is below a target name
matching the pattern 'opt-?j-tgt-??s-cmd-?i?', which means that the
target was marked as silent, either through a global '.SILENT'
declaration or the command line option '-s' or the attribute '.SILENT'
on the target.

Reported by Alan Barrett in PR#45356.


To generate a diff of this commit:
cvs rdiff -u -r1.451 -r1.452 src/usr.bin/make/job.c
cvs rdiff -u -r1.1 -r1.2 src/usr.bin/make/unit-tests/deptgt-silent-jobs.exp \
src/usr.bin/make/unit-tests/deptgt-silent-jobs.mk
cvs rdiff -u -r1.3 -r1.4 src/usr.bin/make/unit-tests/sh-flags.exp

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



CVS commit: src/usr.bin/make

2022-02-12 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Feb 12 11:14:48 UTC 2022

Modified Files:
src/usr.bin/make: job.c
src/usr.bin/make/unit-tests: deptgt-silent-jobs.exp
deptgt-silent-jobs.mk sh-flags.exp

Log Message:
make: fix echoing of command with '-' in silent target in jobs mode

Since job.c 1.83 from 2003-12-20, the command had been echoed even if
the target had the attribute '.SILENT'.

In sh-flags.exp, each removed 'echo' command is below a target name
matching the pattern 'opt-?j-tgt-??s-cmd-?i?', which means that the
target was marked as silent, either through a global '.SILENT'
declaration or the command line option '-s' or the attribute '.SILENT'
on the target.

Reported by Alan Barrett in PR#45356.


To generate a diff of this commit:
cvs rdiff -u -r1.451 -r1.452 src/usr.bin/make/job.c
cvs rdiff -u -r1.1 -r1.2 src/usr.bin/make/unit-tests/deptgt-silent-jobs.exp \
src/usr.bin/make/unit-tests/deptgt-silent-jobs.mk
cvs rdiff -u -r1.3 -r1.4 src/usr.bin/make/unit-tests/sh-flags.exp

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/make/job.c
diff -u src/usr.bin/make/job.c:1.451 src/usr.bin/make/job.c:1.452
--- src/usr.bin/make/job.c:1.451	Fri Feb  4 23:22:19 2022
+++ src/usr.bin/make/job.c	Sat Feb 12 11:14:48 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: job.c,v 1.451 2022/02/04 23:22:19 rillig Exp $	*/
+/*	$NetBSD: job.c,v 1.452 2022/02/12 11:14:48 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -142,7 +142,7 @@
 #include "trace.h"
 
 /*	"@(#)job.c	8.2 (Berkeley) 3/19/94"	*/
-MAKE_RCSID("$NetBSD: job.c,v 1.451 2022/02/04 23:22:19 rillig Exp $");
+MAKE_RCSID("$NetBSD: job.c,v 1.452 2022/02/12 11:14:48 rillig Exp $");
 
 /*
  * A shell defines how the commands are run.  All commands for a target are
@@ -835,7 +835,7 @@ static void
 JobWriteSpecialsEchoCtl(Job *job, ShellWriter *wr, CommandFlags *inout_cmdFlags,
 			const char *escCmd, const char **inout_cmdTemplate)
 {
-	/* XXX: Why is the job modified at this point? */
+	/* XXX: Why is the whole job modified at this point? */
 	job->ignerr = true;
 
 	if (job->echo && inout_cmdFlags->echo) {
@@ -847,9 +847,6 @@ JobWriteSpecialsEchoCtl(Job *job, ShellW
 		 * for toggling the error checking.
 		 */
 		inout_cmdFlags->echo = false;
-	} else {
-		if (inout_cmdFlags->echo)
-			ShellWriter_EchoCmd(wr, escCmd);
 	}
 	*inout_cmdTemplate = shell->runIgnTmpl;
 

Index: src/usr.bin/make/unit-tests/deptgt-silent-jobs.exp
diff -u src/usr.bin/make/unit-tests/deptgt-silent-jobs.exp:1.1 src/usr.bin/make/unit-tests/deptgt-silent-jobs.exp:1.2
--- src/usr.bin/make/unit-tests/deptgt-silent-jobs.exp:1.1	Sat Feb 12 01:15:18 2022
+++ src/usr.bin/make/unit-tests/deptgt-silent-jobs.exp	Sat Feb 12 11:14:48 2022
@@ -2,7 +2,6 @@ compat: testing 1
 compat: testing 2
 compat: testing 3
 jobs: testing 1
-echo 'jobs: testing 2'
 jobs: testing 2
 jobs: testing 3
 exit status 0
Index: src/usr.bin/make/unit-tests/deptgt-silent-jobs.mk
diff -u src/usr.bin/make/unit-tests/deptgt-silent-jobs.mk:1.1 src/usr.bin/make/unit-tests/deptgt-silent-jobs.mk:1.2
--- src/usr.bin/make/unit-tests/deptgt-silent-jobs.mk:1.1	Sat Feb 12 01:15:18 2022
+++ src/usr.bin/make/unit-tests/deptgt-silent-jobs.mk	Sat Feb 12 11:14:48 2022
@@ -1,4 +1,4 @@
-# $NetBSD: deptgt-silent-jobs.mk,v 1.1 2022/02/12 01:15:18 rillig Exp $
+# $NetBSD: deptgt-silent-jobs.mk,v 1.2 2022/02/12 11:14:48 rillig Exp $
 #
 # Ensure that the special dependency target '.SILENT' only affects the amount
 # of output, but not the kind of error handling.
@@ -7,7 +7,7 @@
 #	In job.c 1.83 from 2003.12.20.00.18.22, in an attempt to fix
 #	https://gnats.netbsd.org/18573, commands that suppressed error
 #	handling were output in jobs mode, even when the global '.SILENT'
-#	was set.
+#	was set.  This was fixed in job.c 1.452 from 2022-02-12.
 #
 # See also:
 #	https://gnats.netbsd.org/45356
@@ -28,7 +28,6 @@ compat:
 	@${MAKE} -r -f ${MAKEFILE} test VARIANT=compat
 
 # expect: jobs: testing 1
-# FIXME: suppress 'echo 'jobs: testing 2''
 # expect: echo 'jobs: testing 2'
 # expect: jobs: testing 2
 # expect: jobs: testing 3

Index: src/usr.bin/make/unit-tests/sh-flags.exp
diff -u src/usr.bin/make/unit-tests/sh-flags.exp:1.3 src/usr.bin/make/unit-tests/sh-flags.exp:1.4
--- src/usr.bin/make/unit-tests/sh-flags.exp:1.3	Sat Dec 12 12:19:18 2020
+++ src/usr.bin/make/unit-tests/sh-flags.exp	Sat Feb 12 11:14:48 2022
@@ -1102,7 +1102,6 @@ opt-_j-tgt-__s-cmd-__s
 running
 
 opt-_j-tgt-__s-cmd-_i_
-echo running; false
 running
 *** [opt-_j-tgt-__s-cmd-_i_] Error code 1 (ignored)
 
@@ -1117,7 +1116,6 @@ opt-_j-tgt-__s-cmd-a_s
 running
 
 opt-_j-tgt-__s-cmd-ai_
-echo running; false
 running
 *** [opt-_j-tgt-__s-cmd-ai_] Error code 1 (ignored)
 
@@ -1170,7 +1168,6 @@ running
 *** [opt-_j-tgt-_is-cmd-__s] Error code 1 (ignored)
 
 opt-_j-tgt-_