CVS commit: src/usr.bin/make

2020-10-19 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Oct 19 23:43:55 UTC 2020

Modified Files:
src/usr.bin/make: config.h dir.h job.c make.c make.h make_malloc.h
meta.h nonints.h targ.c

Log Message:
make(1): clean up headers, no functional change


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/usr.bin/make/config.h
cvs rdiff -u -r1.30 -r1.31 src/usr.bin/make/dir.h
cvs rdiff -u -r1.266 -r1.267 src/usr.bin/make/job.c
cvs rdiff -u -r1.165 -r1.166 src/usr.bin/make/make.c
cvs rdiff -u -r1.159 -r1.160 src/usr.bin/make/make.h
cvs rdiff -u -r1.11 -r1.12 src/usr.bin/make/make_malloc.h
cvs rdiff -u -r1.7 -r1.8 src/usr.bin/make/meta.h
cvs rdiff -u -r1.144 -r1.145 src/usr.bin/make/nonints.h
cvs rdiff -u -r1.118 -r1.119 src/usr.bin/make/targ.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/make/config.h
diff -u src/usr.bin/make/config.h:1.24 src/usr.bin/make/config.h:1.25
--- src/usr.bin/make/config.h:1.24	Sun Oct 18 08:01:23 2020
+++ src/usr.bin/make/config.h	Mon Oct 19 23:43:55 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: config.h,v 1.24 2020/10/18 08:01:23 rillig Exp $	*/
+/*	$NetBSD: config.h,v 1.25 2020/10/19 23:43:55 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -133,8 +133,10 @@
 /*
  * SYSVINCLUDE
  *	Recognize system V like include directives [include "filename"]
+ *	(required by POSIX 2018)
  * SYSVVARSUB
  *	Recognize system V like ${VAR:x=y} variable substitutions
+ *	(required by POSIX 2018)
  */
 #define SYSVINCLUDE
 #define SYSVVARSUB

Index: src/usr.bin/make/dir.h
diff -u src/usr.bin/make/dir.h:1.30 src/usr.bin/make/dir.h:1.31
--- src/usr.bin/make/dir.h:1.30	Sun Oct 18 12:36:43 2020
+++ src/usr.bin/make/dir.h	Mon Oct 19 23:43:55 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: dir.h,v 1.30 2020/10/18 12:36:43 rillig Exp $	*/
+/*	$NetBSD: dir.h,v 1.31 2020/10/19 23:43:55 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -87,7 +87,8 @@ typedef struct CachedDir {
 int refCount;		/* Number of SearchPaths with this directory */
 int hits;			/* The number of times a file in this
  * directory has been found */
-HashTable files;		/* Hash set of files in directory */
+HashTable files;		/* Hash set of files in directory;
+ * all values are NULL. */
 } CachedDir;
 
 void Dir_Init(void);

Index: src/usr.bin/make/job.c
diff -u src/usr.bin/make/job.c:1.266 src/usr.bin/make/job.c:1.267
--- src/usr.bin/make/job.c:1.266	Mon Oct 19 23:07:22 2020
+++ src/usr.bin/make/job.c	Mon Oct 19 23:43:55 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: job.c,v 1.266 2020/10/19 23:07:22 rillig Exp $	*/
+/*	$NetBSD: job.c,v 1.267 2020/10/19 23:43:55 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -143,7 +143,7 @@
 #include "trace.h"
 
 /*	"@(#)job.c	8.2 (Berkeley) 3/19/94"	*/
-MAKE_RCSID("$NetBSD: job.c,v 1.266 2020/10/19 23:07:22 rillig Exp $");
+MAKE_RCSID("$NetBSD: job.c,v 1.267 2020/10/19 23:43:55 rillig Exp $");
 
 # define STATIC static
 
@@ -190,10 +190,10 @@ typedef struct Shell {
 const char *noPrint;	/* command to skip when printing output from
  * shell. This is usually the command which
  * was executed to turn off echoing */
-size_t noPLen;		/* length of noPrint command */
+size_t noPrintLen;		/* length of noPrint command */
 Boolean hasErrCtl;		/* set if can control error checking for
  * individual commands */
-const char *errCheck;	/* string to turn error checking on */
+const char *errCheck;	/* string to turn on error checking */
 const char *ignErr;		/* string to turn off error checking */
 const char *errOut;		/* string to use for testing exit code */
 const char *newline;	/* string literal that results in a newline
@@ -1627,7 +1627,7 @@ JobOutput(Job *job, char *cp, char *endp
 		(void)fprintf(stdout, "%s", cp);
 		(void)fflush(stdout);
 	}
-	cp = ecp + commandShell->noPLen;
+	cp = ecp + commandShell->noPrintLen;
 	if (cp != endp) {
 		/*
 		 * Still more to print, look again after skipping
@@ -2273,7 +2273,7 @@ Job_ParseShell(char *line)
 		newShell.echoOn = arg + 5;
 	} else if (strncmp(arg, "filter=", 7) == 0) {
 		newShell.noPrint = arg + 7;
-		newShell.noPLen = strlen(newShell.noPrint);
+		newShell.noPrintLen = strlen(newShell.noPrint);
 	} else if (strncmp(arg, "echoFlag=", 9) == 0) {
 		newShell.echo = arg + 9;
 	} else if (strncmp(arg, "errFlag=", 8) == 0) {

Index: src/usr.bin/make/make.c
diff -u src/usr.bin/make/make.c:1.165 src/usr.bin/make/make.c:1.166
--- src/usr.bin/make/make.c:1.165	Mon Oct 19 21:57:37 2020
+++ src/usr.bin/make/make.c	Mon Oct 19 23:43:55 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: make.c,v 1.165 2020/10/19 21:57:37 rillig Exp $	*/
+/*	$NetBSD: make.c,v 1.166 2020/10/19 23:43:55 rillig Exp $	*/
 
 /*
  * Copyright (c) 

CVS commit: src/usr.bin/make

2020-10-19 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Oct 19 23:07:22 UTC 2020

Modified Files:
src/usr.bin/make: job.c job.h

Log Message:
make(1): move struct Shell from job.h to job.c

This type is only needed in job.c.


To generate a diff of this commit:
cvs rdiff -u -r1.265 -r1.266 src/usr.bin/make/job.c
cvs rdiff -u -r1.55 -r1.56 src/usr.bin/make/job.h

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.265 src/usr.bin/make/job.c:1.266
--- src/usr.bin/make/job.c:1.265	Sun Oct 18 13:02:10 2020
+++ src/usr.bin/make/job.c	Mon Oct 19 23:07:22 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: job.c,v 1.265 2020/10/18 13:02:10 rillig Exp $	*/
+/*	$NetBSD: job.c,v 1.266 2020/10/19 23:07:22 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -143,10 +143,71 @@
 #include "trace.h"
 
 /*	"@(#)job.c	8.2 (Berkeley) 3/19/94"	*/
-MAKE_RCSID("$NetBSD: job.c,v 1.265 2020/10/18 13:02:10 rillig Exp $");
+MAKE_RCSID("$NetBSD: job.c,v 1.266 2020/10/19 23:07:22 rillig Exp $");
 
 # define STATIC static
 
+/*-
+ * Shell Specifications:
+ * Each shell type has associated with it the following information:
+ *	1) The string which must match the last character of the shell name
+ *	   for the shell to be considered of this type. The longest match
+ *	   wins.
+ *	2) A command to issue to turn off echoing of command lines
+ *	3) A command to issue to turn echoing back on again
+ *	4) What the shell prints, and its length, when given the echo-off
+ *	   command. This line will not be printed when received from the shell
+ *	5) A boolean to tell if the shell has the ability to control
+ *	   error checking for individual commands.
+ *	6) The string to turn this checking on.
+ *	7) The string to turn it off.
+ *	8) The command-flag to give to cause the shell to start echoing
+ *	   commands right away.
+ *	9) The command-flag to cause the shell to Lib_Exit when an error is
+ *	   detected in one of the commands.
+ *
+ * Some special stuff goes on if a shell doesn't have error control. In such
+ * a case, errCheck becomes a printf template for echoing the command,
+ * should echoing be on and ignErr becomes another printf template for
+ * executing the command while ignoring the return status. Finally errOut
+ * is a printf template for running the command and causing the shell to
+ * exit on error. If any of these strings are empty when hasErrCtl is FALSE,
+ * the command will be executed anyway as is and if it causes an error, so be
+ * it. Any templates setup to echo the command will escape any '$ ` \ "'i
+ * characters in the command string to avoid common problems with
+ * echo "%s\n" as a template.
+ */
+typedef struct Shell {
+const char *name;		/* the name of the shell. For Bourne and C
+ * shells, this is used only to find the
+ * shell description when used as the single
+ * source of a .SHELL target. For user-defined
+ * shells, this is the full path of the shell.
+ */
+Boolean hasEchoCtl;		/* True if both echoOff and echoOn defined */
+const char *echoOff;	/* command to turn off echo */
+const char *echoOn;		/* command to turn it back on again */
+const char *noPrint;	/* command to skip when printing output from
+ * shell. This is usually the command which
+ * was executed to turn off echoing */
+size_t noPLen;		/* length of noPrint command */
+Boolean hasErrCtl;		/* set if can control error checking for
+ * individual commands */
+const char *errCheck;	/* string to turn error checking on */
+const char *ignErr;		/* string to turn off error checking */
+const char *errOut;		/* string to use for testing exit code */
+const char *newline;	/* string literal that results in a newline
+ * character when it appears outside of any
+ * 'quote' or "quote" characters */
+char commentChar;		/* character used by shell for comment lines */
+
+/*
+ * command-line flags
+ */
+const char *echo;		/* echo commands */
+const char *exit;		/* exit on error */
+} Shell;
+
 /*
  * error handling variables
  */

Index: src/usr.bin/make/job.h
diff -u src/usr.bin/make/job.h:1.55 src/usr.bin/make/job.h:1.56
--- src/usr.bin/make/job.h:1.55	Mon Oct  5 21:37:07 2020
+++ src/usr.bin/make/job.h	Mon Oct 19 23:07:22 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: job.h,v 1.55 2020/10/05 21:37:07 rillig Exp $	*/
+/*	$NetBSD: job.h,v 1.56 2020/10/19 23:07:22 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -177,67 +177,6 @@ typedef struct Job {
 #endif
 } Job;
 
-/*-
- * Shell Specifications:
- * Each shell type has associated with it the following information:
- *	1) The string which must match the last character of the shell name
- *	   for the shell to be considered of this type. The longest match
- *	   wins.

CVS commit: src/lib/libc/arch/aarch64/sys

2020-10-19 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Mon Oct 19 22:33:53 UTC 2020

Modified Files:
src/lib/libc/arch/aarch64/sys: __sigtramp2.S

Log Message:
Restore SP from mcontext

Improves unwinding of multiple frames without frame pointer.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/lib/libc/arch/aarch64/sys/__sigtramp2.S

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

Modified files:

Index: src/lib/libc/arch/aarch64/sys/__sigtramp2.S
diff -u src/lib/libc/arch/aarch64/sys/__sigtramp2.S:1.3 src/lib/libc/arch/aarch64/sys/__sigtramp2.S:1.4
--- src/lib/libc/arch/aarch64/sys/__sigtramp2.S:1.3	Sat Oct 17 15:44:59 2020
+++ src/lib/libc/arch/aarch64/sys/__sigtramp2.S	Mon Oct 19 22:33:53 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: __sigtramp2.S,v 1.3 2020/10/17 15:44:59 skrll Exp $ */
+/* $NetBSD: __sigtramp2.S,v 1.4 2020/10/19 22:33:53 kamil Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -82,7 +82,7 @@
 	.cfi_offset x28, _UC_REGS_X28
 	.cfi_offset x29, _UC_REGS_X29
 	.cfi_offset lr, _UC_REGS_LR
-	/* The unwinder will use the CFA to restore X31 (SP). */
+	.cfi_offset sp, _UC_REGS_SP
 	nop
 ENTRY_NP(__sigtramp_siginfo_2)
 	mov	x0, x28/* set the arg */



CVS commit: src/usr.bin/make

2020-10-19 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Oct 19 21:57:37 UTC 2020

Modified Files:
src/usr.bin/make: arch.c dir.c lst.c lst.h main.c make.c meta.c parse.c
suff.c

Log Message:
make(1): inline simple Lst getters

The function call variant takes more screen space than the direct field
access.  Having an abstract API is usually a good idea, in this case of
simple read-only member access it makes the code more difficult to read.

LstNode_Set has been kept as a function since it is not a read-only
accessor function.


To generate a diff of this commit:
cvs rdiff -u -r1.136 -r1.137 src/usr.bin/make/arch.c
cvs rdiff -u -r1.170 -r1.171 src/usr.bin/make/dir.c
cvs rdiff -u -r1.78 -r1.79 src/usr.bin/make/lst.c
cvs rdiff -u -r1.73 -r1.74 src/usr.bin/make/lst.h
cvs rdiff -u -r1.378 -r1.379 src/usr.bin/make/main.c
cvs rdiff -u -r1.164 -r1.165 src/usr.bin/make/make.c
cvs rdiff -u -r1.126 -r1.127 src/usr.bin/make/meta.c
cvs rdiff -u -r1.393 -r1.394 src/usr.bin/make/parse.c
cvs rdiff -u -r1.194 -r1.195 src/usr.bin/make/suff.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/make/arch.c
diff -u src/usr.bin/make/arch.c:1.136 src/usr.bin/make/arch.c:1.137
--- src/usr.bin/make/arch.c:1.136	Sun Oct 18 13:02:10 2020
+++ src/usr.bin/make/arch.c	Mon Oct 19 21:57:37 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: arch.c,v 1.136 2020/10/18 13:02:10 rillig Exp $	*/
+/*	$NetBSD: arch.c,v 1.137 2020/10/19 21:57:37 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -130,7 +130,7 @@
 #include"config.h"
 
 /*	"@(#)arch.c	8.2 (Berkeley) 1/2/94"	*/
-MAKE_RCSID("$NetBSD: arch.c,v 1.136 2020/10/18 13:02:10 rillig Exp $");
+MAKE_RCSID("$NetBSD: arch.c,v 1.137 2020/10/19 21:57:37 rillig Exp $");
 
 #ifdef TARGET_MACHINE
 #undef MAKE_MACHINE
@@ -468,7 +468,7 @@ ArchStatMember(const char *archive, cons
 if (ln != NULL) {
 	struct ar_hdr *hdr;
 
-	ar = LstNode_Datum(ln);
+	ar = ln->datum;
 	hdr = Hash_FindValue(>members, member);
 	if (hdr != NULL)
 	return hdr;

Index: src/usr.bin/make/dir.c
diff -u src/usr.bin/make/dir.c:1.170 src/usr.bin/make/dir.c:1.171
--- src/usr.bin/make/dir.c:1.170	Sun Oct 18 17:19:54 2020
+++ src/usr.bin/make/dir.c	Mon Oct 19 21:57:37 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: dir.c,v 1.170 2020/10/18 17:19:54 rillig Exp $	*/
+/*	$NetBSD: dir.c,v 1.171 2020/10/19 21:57:37 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -135,7 +135,7 @@
 #include "job.h"
 
 /*	"@(#)dir.c	8.2 (Berkeley) 1/2/94"	*/
-MAKE_RCSID("$NetBSD: dir.c,v 1.170 2020/10/18 17:19:54 rillig Exp $");
+MAKE_RCSID("$NetBSD: dir.c,v 1.171 2020/10/19 21:57:37 rillig Exp $");
 
 #define DIR_DEBUG0(text) DEBUG0(DIR, text)
 #define DIR_DEBUG1(fmt, arg1) DEBUG1(DIR, fmt, arg1)
@@ -1510,7 +1510,7 @@ Dir_AddDir(SearchPath *path, const char 
 if (path != NULL && strcmp(name, ".DOTLAST") == 0) {
 	SearchPathNode *ln = Lst_Find(path, DirFindName, name);
 	if (ln != NULL)
-	return LstNode_Datum(ln);
+	return ln->datum;
 
 	dotLast->refCount++;
 	Lst_Prepend(path, dotLast);

Index: src/usr.bin/make/lst.c
diff -u src/usr.bin/make/lst.c:1.78 src/usr.bin/make/lst.c:1.79
--- src/usr.bin/make/lst.c:1.78	Mon Oct 19 21:41:31 2020
+++ src/usr.bin/make/lst.c	Mon Oct 19 21:57:37 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: lst.c,v 1.78 2020/10/19 21:41:31 rillig Exp $ */
+/* $NetBSD: lst.c,v 1.79 2020/10/19 21:57:37 rillig Exp $ */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -34,7 +34,7 @@
 
 #include "make.h"
 
-MAKE_RCSID("$NetBSD: lst.c,v 1.78 2020/10/19 21:41:31 rillig Exp $");
+MAKE_RCSID("$NetBSD: lst.c,v 1.79 2020/10/19 21:57:37 rillig Exp $");
 
 /* Allocate and initialize a list node.
  *
@@ -268,7 +268,7 @@ LstNode_SetNull(ListNode *node)
 ListNode *
 Lst_Find(List *list, LstFindProc match, const void *matchArgs)
 {
-return Lst_FindFrom(list, Lst_First(list), match, matchArgs);
+return Lst_FindFrom(list, list->first, match, matchArgs);
 }
 
 /* Return the first node from the list, starting at the given node, for which

Index: src/usr.bin/make/lst.h
diff -u src/usr.bin/make/lst.h:1.73 src/usr.bin/make/lst.h:1.74
--- src/usr.bin/make/lst.h:1.73	Mon Oct 19 21:41:31 2020
+++ src/usr.bin/make/lst.h	Mon Oct 19 21:57:37 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: lst.h,v 1.73 2020/10/19 21:41:31 rillig Exp $	*/
+/*	$NetBSD: lst.h,v 1.74 2020/10/19 21:57:37 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -145,12 +145,7 @@ void Lst_Destroy(List *, LstFreeProc);
 
 static inline MAKE_ATTR_UNUSED Boolean
 Lst_IsEmpty(List *list) { return list->first == NULL; }
-/* Return the first node of the list, or NULL if the list is empty. */
-static inline MAKE_ATTR_UNUSED ListNode *
-Lst_First(List *list) { return list->first; }
-/* Return the last node of the list, or NULL if the list is empty. */
-static inline MAKE_ATTR_UNUSED 

CVS commit: src/usr.bin/audiocfg

2020-10-19 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Mon Oct 19 21:46:15 UTC 2020

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

Log Message:
Add missing HISTORY and AUTHORS. Bump date.

Noticed by qjsgkem on freenode.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/usr.bin/audiocfg/audiocfg.1

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

Modified files:

Index: src/usr.bin/audiocfg/audiocfg.1
diff -u src/usr.bin/audiocfg/audiocfg.1:1.6 src/usr.bin/audiocfg/audiocfg.1:1.7
--- src/usr.bin/audiocfg/audiocfg.1:1.6	Sat Aug 24 06:13:01 2019
+++ src/usr.bin/audiocfg/audiocfg.1	Mon Oct 19 21:46:15 2020
@@ -1,4 +1,4 @@
-.\"	$NetBSD: audiocfg.1,v 1.6 2019/08/24 06:13:01 isaki Exp $
+.\"	$NetBSD: audiocfg.1,v 1.7 2020/10/19 21:46:15 dholland Exp $
 .\"
 .\" Copyright (c) 2010 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -27,7 +27,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd May 8, 2019
+.Dd October 19, 2020
 .Dt AUDIOCFG 1
 .Os
 .Sh NAME
@@ -125,3 +125,16 @@ Available audio devices.
 .Xr audiorecord 1 ,
 .Xr audio 4 ,
 .Xr drvctl 8
+.Sh HISTORY
+The
+.Nm
+utility first appeared in
+.Nx 6.0 .
+.Sh AUTHORS
+.An -nosplit
+The
+.Nm
+utility was originally written by
+.An Jared McNeill .
+This manual page was written by
+.An Thomas Klausner .



CVS commit: src/usr.bin/make

2020-10-19 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Oct 19 21:41:31 UTC 2020

Modified Files:
src/usr.bin/make: lst.c lst.h

Log Message:
make(1): remove unused Lst_ForEach

All of its uses have been inlined since iterating through a linked list
is trivial.  This avoids the cumbersome callback functions with void
pointer parameters, allowing the compiler to perform better type checks.


To generate a diff of this commit:
cvs rdiff -u -r1.77 -r1.78 src/usr.bin/make/lst.c
cvs rdiff -u -r1.72 -r1.73 src/usr.bin/make/lst.h

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/lst.c
diff -u src/usr.bin/make/lst.c:1.77 src/usr.bin/make/lst.c:1.78
--- src/usr.bin/make/lst.c:1.77	Sun Oct 18 13:02:10 2020
+++ src/usr.bin/make/lst.c	Mon Oct 19 21:41:31 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: lst.c,v 1.77 2020/10/18 13:02:10 rillig Exp $ */
+/* $NetBSD: lst.c,v 1.78 2020/10/19 21:41:31 rillig Exp $ */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -34,7 +34,7 @@
 
 #include "make.h"
 
-MAKE_RCSID("$NetBSD: lst.c,v 1.77 2020/10/18 13:02:10 rillig Exp $");
+MAKE_RCSID("$NetBSD: lst.c,v 1.78 2020/10/19 21:41:31 rillig Exp $");
 
 /* Allocate and initialize a list node.
  *
@@ -308,14 +308,6 @@ Lst_FindDatum(List *list, const void *da
 return NULL;
 }
 
-void
-Lst_ForEach(List *list, LstActionProc proc, void *procData)
-{
-ListNode *node;
-for (node = list->first; node != NULL; node = node->next)
-	proc(node->datum, procData);
-}
-
 /* Apply the given function to each element of the given list. The function
  * should return 0 if traversal should continue and non-zero if it should
  * abort. */

Index: src/usr.bin/make/lst.h
diff -u src/usr.bin/make/lst.h:1.72 src/usr.bin/make/lst.h:1.73
--- src/usr.bin/make/lst.h:1.72	Sun Oct 18 17:19:54 2020
+++ src/usr.bin/make/lst.h	Mon Oct 19 21:41:31 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: lst.h,v 1.72 2020/10/18 17:19:54 rillig Exp $	*/
+/*	$NetBSD: lst.h,v 1.73 2020/10/19 21:41:31 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -185,10 +185,6 @@ void LstNode_SetNull(ListNode *);
 
 /* Iterating over a list, using a callback function */
 
-/* Apply a function to each datum of the list.
- * The function must not modify the structure of the list, for example by
- * adding or removing nodes. */
-void Lst_ForEach(List *, LstActionProc, void *);
 /* Apply a function to each datum of the list, until the callback function
  * returns non-zero. */
 int Lst_ForEachUntil(List *, LstActionUntilProc, void *);



CVS commit: src/usr.bin/make

2020-10-19 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Oct 19 21:38:10 UTC 2020

Modified Files:
src/usr.bin/make: suff.c

Log Message:
make(1): use consistent formatting for DEBUG_SRC

No trailing whitespace anymore, %p instead of %lx.


To generate a diff of this commit:
cvs rdiff -u -r1.193 -r1.194 src/usr.bin/make/suff.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/make/suff.c
diff -u src/usr.bin/make/suff.c:1.193 src/usr.bin/make/suff.c:1.194
--- src/usr.bin/make/suff.c:1.193	Mon Oct 19 21:33:09 2020
+++ src/usr.bin/make/suff.c	Mon Oct 19 21:38:10 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: suff.c,v 1.193 2020/10/19 21:33:09 rillig Exp $	*/
+/*	$NetBSD: suff.c,v 1.194 2020/10/19 21:38:10 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -129,7 +129,7 @@
 #include "dir.h"
 
 /*	"@(#)suff.c	8.4 (Berkeley) 3/21/94"	*/
-MAKE_RCSID("$NetBSD: suff.c,v 1.193 2020/10/19 21:33:09 rillig Exp $");
+MAKE_RCSID("$NetBSD: suff.c,v 1.194 2020/10/19 21:38:10 rillig Exp $");
 
 #define SUFF_DEBUG0(text) DEBUG0(SUFF, text)
 #define SUFF_DEBUG1(fmt, arg1) DEBUG1(SUFF, fmt, arg1)
@@ -878,10 +878,8 @@ static void
 SrcList_PrintAddrs(SrcList *srcList)
 {
 SrcListNode *ln;
-for (ln = srcList->first; ln != NULL; ln = ln->next) {
-Src *src = ln->datum;
-	printf("%lx ", (unsigned long) src);
-}
+for (ln = srcList->first; ln != NULL; ln = ln->next)
+	debug_printf(" %p", ln->datum);
 }
 #endif
 
@@ -957,7 +955,7 @@ SuffRemoveSrc(SrcList *l)
 Lst_Open(l);
 
 #ifdef DEBUG_SRC
-debug_printf("cleaning %lx: ", (unsigned long) l);
+debug_printf("cleaning %p:", l);
 SrcList_PrintAddrs(l);
 debug_printf("\n");
 #endif
@@ -987,7 +985,7 @@ SuffRemoveSrc(SrcList *l)
 	}
 #ifdef DEBUG_SRC
 	else {
-	debug_printf("keep: [l=%p] p=%p %d: ", l, s, s->children);
+	debug_printf("keep: [l=%p] p=%p %d:", l, s, s->children);
 	SrcList_PrintAddrs(s->cp);
 	debug_printf("\n");
 	}



CVS commit: src/usr.bin/make

2020-10-19 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Oct 19 21:33:09 UTC 2020

Modified Files:
src/usr.bin/make: suff.c

Log Message:
make(1): remove void pointers from DEBUG_SRC debugging code

This debugging code is completely broken.  Part of the output goes to
debug_file, the other part goes to stdout.  The spacing in the output is
inconsistent.  The printf directives vary between %p and %lx.

All these inconsistencies have already been there in June 2020, before
the big refactoring started.


To generate a diff of this commit:
cvs rdiff -u -r1.192 -r1.193 src/usr.bin/make/suff.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/make/suff.c
diff -u src/usr.bin/make/suff.c:1.192 src/usr.bin/make/suff.c:1.193
--- src/usr.bin/make/suff.c:1.192	Mon Oct 19 21:23:07 2020
+++ src/usr.bin/make/suff.c	Mon Oct 19 21:33:09 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: suff.c,v 1.192 2020/10/19 21:23:07 rillig Exp $	*/
+/*	$NetBSD: suff.c,v 1.193 2020/10/19 21:33:09 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -129,7 +129,7 @@
 #include "dir.h"
 
 /*	"@(#)suff.c	8.4 (Berkeley) 3/21/94"	*/
-MAKE_RCSID("$NetBSD: suff.c,v 1.192 2020/10/19 21:23:07 rillig Exp $");
+MAKE_RCSID("$NetBSD: suff.c,v 1.193 2020/10/19 21:33:09 rillig Exp $");
 
 #define SUFF_DEBUG0(text) DEBUG0(SUFF, text)
 #define SUFF_DEBUG1(fmt, arg1) DEBUG1(SUFF, fmt, arg1)
@@ -875,9 +875,13 @@ Suff_AddLib(const char *sname)
 
 #ifdef DEBUG_SRC
 static void
-PrintAddr(void *a, void *b MAKE_ATTR_UNUSED)
+SrcList_PrintAddrs(SrcList *srcList)
 {
-printf("%lx ", (unsigned long) a);
+SrcListNode *ln;
+for (ln = srcList->first; ln != NULL; ln = ln->next) {
+Src *src = ln->datum;
+	printf("%lx ", (unsigned long) src);
+}
 }
 #endif
 
@@ -899,7 +903,7 @@ SuffAddSrc(Suff *suff, SrcList *srcList,
 s2->cp = Lst_New();
 Lst_Append(targ->cp, s2);
 debug_printf("%s add %p %p to %p:", debug_tag, targ, s2, srcList);
-Lst_ForEach(srcList, PrintAddr, NULL);
+SrcList_PrintAddrs(srcList);
 debug_printf("\n");
 #endif
 }
@@ -954,7 +958,7 @@ SuffRemoveSrc(SrcList *l)
 
 #ifdef DEBUG_SRC
 debug_printf("cleaning %lx: ", (unsigned long) l);
-Lst_ForEach(l, PrintAddr, NULL);
+SrcList_PrintAddrs(l);
 debug_printf("\n");
 #endif
 
@@ -984,7 +988,7 @@ SuffRemoveSrc(SrcList *l)
 #ifdef DEBUG_SRC
 	else {
 	debug_printf("keep: [l=%p] p=%p %d: ", l, s, s->children);
-	Lst_ForEach(s->cp, PrintAddr, NULL);
+	SrcList_PrintAddrs(s->cp);
 	debug_printf("\n");
 	}
 #endif



CVS commit: src/usr.bin/make

2020-10-19 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Oct 19 21:23:07 UTC 2020

Modified Files:
src/usr.bin/make: suff.c

Log Message:
make(1): remove void pointers from SuffRebuildGraph


To generate a diff of this commit:
cvs rdiff -u -r1.191 -r1.192 src/usr.bin/make/suff.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/make/suff.c
diff -u src/usr.bin/make/suff.c:1.191 src/usr.bin/make/suff.c:1.192
--- src/usr.bin/make/suff.c:1.191	Mon Oct 19 21:17:35 2020
+++ src/usr.bin/make/suff.c	Mon Oct 19 21:23:07 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: suff.c,v 1.191 2020/10/19 21:17:35 rillig Exp $	*/
+/*	$NetBSD: suff.c,v 1.192 2020/10/19 21:23:07 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -129,7 +129,7 @@
 #include "dir.h"
 
 /*	"@(#)suff.c	8.4 (Berkeley) 3/21/94"	*/
-MAKE_RCSID("$NetBSD: suff.c,v 1.191 2020/10/19 21:17:35 rillig Exp $");
+MAKE_RCSID("$NetBSD: suff.c,v 1.192 2020/10/19 21:23:07 rillig Exp $");
 
 #define SUFF_DEBUG0(text) DEBUG0(SUFF, text)
 #define SUFF_DEBUG1(fmt, arg1) DEBUG1(SUFF, fmt, arg1)
@@ -637,14 +637,12 @@ Suff_EndTransform(GNode *gn)
  * transformation rules exist for it.
  *
  * Input:
- *	transformp	Transformation to test
- *	sp		Suffix to rebuild
+ *	transform	Transformation to test
+ *	s		Suffix to rebuild
  */
 static void
-SuffRebuildGraph(void *transformp, void *sp)
+SuffRebuildGraph(GNode *transform, Suff *s)
 {
-GNode *transform = (GNode *)transformp;
-Suff *s = (Suff *)sp;
 char *cp;
 struct SuffSuffGetSuffixArgs sd;
 
@@ -765,6 +763,8 @@ UpdateTargets(GNode **inout_main, Suff *
 void
 Suff_AddSuffix(const char *name, GNode **inout_main)
 {
+GNodeListNode *ln;
+
 Suff *s = FindSuffByName(name);
 if (s != NULL)
 	return;
@@ -778,7 +778,8 @@ Suff_AddSuffix(const char *name, GNode *
  * Look for any existing transformations from or to this suffix.
  * XXX: Only do this after a Suff_ClearSuffixes?
  */
-Lst_ForEach(transforms, SuffRebuildGraph, s);
+for (ln = transforms->first; ln != NULL; ln = ln->next)
+	SuffRebuildGraph(ln->datum, s);
 }
 
 /* Return the search path for the given suffix, or NULL. */



CVS commit: src/usr.bin/make

2020-10-19 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Oct 19 21:17:35 UTC 2020

Modified Files:
src/usr.bin/make: suff.c targ.c

Log Message:
make(1): remove void pointers from suffix debug printing


To generate a diff of this commit:
cvs rdiff -u -r1.190 -r1.191 src/usr.bin/make/suff.c
cvs rdiff -u -r1.117 -r1.118 src/usr.bin/make/targ.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/make/suff.c
diff -u src/usr.bin/make/suff.c:1.190 src/usr.bin/make/suff.c:1.191
--- src/usr.bin/make/suff.c:1.190	Sun Oct 18 17:41:06 2020
+++ src/usr.bin/make/suff.c	Mon Oct 19 21:17:35 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: suff.c,v 1.190 2020/10/18 17:41:06 rillig Exp $	*/
+/*	$NetBSD: suff.c,v 1.191 2020/10/19 21:17:35 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -129,7 +129,7 @@
 #include "dir.h"
 
 /*	"@(#)suff.c	8.4 (Berkeley) 3/21/94"	*/
-MAKE_RCSID("$NetBSD: suff.c,v 1.190 2020/10/18 17:41:06 rillig Exp $");
+MAKE_RCSID("$NetBSD: suff.c,v 1.191 2020/10/19 21:17:35 rillig Exp $");
 
 #define SUFF_DEBUG0(text) DEBUG0(SUFF, text)
 #define SUFF_DEBUG1(fmt, arg1) DEBUG1(SUFF, fmt, arg1)
@@ -2110,18 +2110,22 @@ Suff_End(void)
 /* DEBUGGING FUNCTIONS **/
 
 static void
-SuffPrintName(void *s, void *dummy MAKE_ATTR_UNUSED)
+PrintSuffNames(const char *prefix, SuffList *suffs)
 {
-debug_printf("%s ", ((Suff *)s)->name);
+SuffListNode *ln;
+
+debug_printf("#\t%s: ", prefix);
+for (ln = suffs->first; ln != NULL; ln = ln->next) {
+	Suff *suff = ln->datum;
+	debug_printf("%s ", suff->name);
+}
+debug_printf("\n");
 }
 
 static void
-SuffPrintSuff(void *sp, void *dummy MAKE_ATTR_UNUSED)
+PrintSuff(Suff *s)
 {
-Suff*s = (Suff *)sp;
-
 debug_printf("# `%s' [%d] ", s->name, s->refCount);
-
 if (s->flags != 0) {
 	char flags_buf[SuffFlags_ToStringSize];
 
@@ -2129,36 +2133,40 @@ SuffPrintSuff(void *sp, void *dummy MAKE
 		 Enum_FlagsToString(flags_buf, sizeof flags_buf,
 	s->flags, SuffFlags_ToStringSpecs));
 }
-fputc('\n', debug_file);
-debug_printf("#\tTo: ");
-Lst_ForEach(s->parents, SuffPrintName, NULL);
-fputc('\n', debug_file);
-debug_printf("#\tFrom: ");
-Lst_ForEach(s->children, SuffPrintName, NULL);
-fputc('\n', debug_file);
+debug_printf("\n");
+
+PrintSuffNames("To", s->parents);
+PrintSuffNames("From", s->children);
+
 debug_printf("#\tSearch Path: ");
 Dir_PrintPath(s->searchPath);
-fputc('\n', debug_file);
+debug_printf("\n");
 }
 
 static void
-SuffPrintTrans(void *tp, void *dummy MAKE_ATTR_UNUSED)
+PrintTransformation(GNode *t)
 {
-GNode   *t = (GNode *)tp;
-
 debug_printf("%-16s:", t->name);
 Targ_PrintType(t->type);
-fputc('\n', debug_file);
+debug_printf("\n");
 Targ_PrintCmds(t);
-fputc('\n', debug_file);
+debug_printf("\n");
 }
 
 void
 Suff_PrintAll(void)
 {
 debug_printf("#*** Suffixes:\n");
-Lst_ForEach(sufflist, SuffPrintSuff, NULL);
+{
+	SuffListNode *ln;
+	for (ln = sufflist->first; ln != NULL; ln = ln->next)
+	PrintSuff(ln->datum);
+}
 
 debug_printf("#*** Transformations:\n");
-Lst_ForEach(transforms, SuffPrintTrans, NULL);
+{
+	GNodeListNode *ln;
+	for (ln = transforms->first; ln != NULL; ln = ln->next)
+	PrintTransformation(ln->datum);
+}
 }

Index: src/usr.bin/make/targ.c
diff -u src/usr.bin/make/targ.c:1.117 src/usr.bin/make/targ.c:1.118
--- src/usr.bin/make/targ.c:1.117	Mon Oct 19 19:34:18 2020
+++ src/usr.bin/make/targ.c	Mon Oct 19 21:17:35 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: targ.c,v 1.117 2020/10/19 19:34:18 rillig Exp $	*/
+/*	$NetBSD: targ.c,v 1.118 2020/10/19 21:17:35 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -121,7 +121,7 @@
 #include "dir.h"
 
 /*	"@(#)targ.c	8.2 (Berkeley) 3/19/94"	*/
-MAKE_RCSID("$NetBSD: targ.c,v 1.117 2020/10/19 19:34:18 rillig Exp $");
+MAKE_RCSID("$NetBSD: targ.c,v 1.118 2020/10/19 21:17:35 rillig Exp $");
 
 static GNodeList *allTargets;	/* the list of all targets found so far */
 #ifdef CLEANUP
@@ -358,9 +358,9 @@ PrintNodeNamesLine(const char *label, GN
 void
 Targ_PrintCmds(GNode *gn)
 {
-StringListNode *node = gn->commands->first;
-for (; node != NULL; node = node->next) {
-	const char *cmd = LstNode_Datum(node);
+StringListNode *ln;
+for (ln = gn->commands->first; ln != NULL; ln = ln->next) {
+	const char *cmd = ln->datum;
 	debug_printf("\t%s\n", cmd);
 }
 }



CVS commit: src/usr.bin/make

2020-10-19 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Oct 19 20:55:30 UTC 2020

Modified Files:
src/usr.bin/make: parse.c

Log Message:
make(1): remove void pointers from ParseAddDir


To generate a diff of this commit:
cvs rdiff -u -r1.392 -r1.393 src/usr.bin/make/parse.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/make/parse.c
diff -u src/usr.bin/make/parse.c:1.392 src/usr.bin/make/parse.c:1.393
--- src/usr.bin/make/parse.c:1.392	Mon Oct 19 20:51:18 2020
+++ src/usr.bin/make/parse.c	Mon Oct 19 20:55:30 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: parse.c,v 1.392 2020/10/19 20:51:18 rillig Exp $	*/
+/*	$NetBSD: parse.c,v 1.393 2020/10/19 20:55:30 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -131,7 +131,7 @@
 #include "pathnames.h"
 
 /*	"@(#)parse.c	8.3 (Berkeley) 3/19/94"	*/
-MAKE_RCSID("$NetBSD: parse.c,v 1.392 2020/10/19 20:51:18 rillig Exp $");
+MAKE_RCSID("$NetBSD: parse.c,v 1.393 2020/10/19 20:55:30 rillig Exp $");
 
 /* types and constants */
 
@@ -1013,12 +1013,6 @@ FindMainTarget(void)
 }
 }
 
-static void
-ParseAddDir(void *path, void *name)
-{
-(void)Dir_AddDir(path, name);
-}
-
 /*
  * We got to the end of the line while we were still looking at targets.
  *
@@ -1386,6 +1380,16 @@ ParseDoDependencySourcesEmpty(ParseSpeci
 }
 }
 
+static void
+AddToPaths(const char *dir, SearchPathList *paths)
+{
+if (paths != NULL) {
+	SearchPathListNode *ln;
+	for (ln = paths->first; ln != NULL; ln = ln->next)
+	(void)Dir_AddDir(ln->datum, dir);
+}
+}
+
 /*
  * If the target was one that doesn't take files as its sources
  * but takes something like suffixes, we take each
@@ -1422,8 +1426,7 @@ ParseDoDependencySourceSpecial(ParseSpec
 	Suff_AddSuffix(line, );
 	break;
 case ExPath:
-	if (paths != NULL)
-	Lst_ForEach(paths, ParseAddDir, line);
+	AddToPaths(line, paths);
 	break;
 case Includes:
 	Suff_AddInclude(line);



CVS commit: src/usr.bin/make

2020-10-19 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Oct 19 20:51:18 UTC 2020

Modified Files:
src/usr.bin/make: parse.c

Log Message:
make(1): remove void pointers from ParseClearPath


To generate a diff of this commit:
cvs rdiff -u -r1.391 -r1.392 src/usr.bin/make/parse.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/make/parse.c
diff -u src/usr.bin/make/parse.c:1.391 src/usr.bin/make/parse.c:1.392
--- src/usr.bin/make/parse.c:1.391	Sun Oct 18 20:46:42 2020
+++ src/usr.bin/make/parse.c	Mon Oct 19 20:51:18 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: parse.c,v 1.391 2020/10/18 20:46:42 rillig Exp $	*/
+/*	$NetBSD: parse.c,v 1.392 2020/10/19 20:51:18 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -131,7 +131,7 @@
 #include "pathnames.h"
 
 /*	"@(#)parse.c	8.3 (Berkeley) 3/19/94"	*/
-MAKE_RCSID("$NetBSD: parse.c,v 1.391 2020/10/18 20:46:42 rillig Exp $");
+MAKE_RCSID("$NetBSD: parse.c,v 1.392 2020/10/19 20:51:18 rillig Exp $");
 
 /* types and constants */
 
@@ -196,6 +196,7 @@ typedef enum ParseSpecial {
 } ParseSpecial;
 
 typedef List SearchPathList;
+typedef ListNode SearchPathListNode;
 
 /* result data */
 
@@ -1018,12 +1019,6 @@ ParseAddDir(void *path, void *name)
 (void)Dir_AddDir(path, name);
 }
 
-static void
-ParseClearPath(void *path, void *unused MAKE_ATTR_UNUSED)
-{
-Dir_ClearPath(path);
-}
-
 /*
  * We got to the end of the line while we were still looking at targets.
  *
@@ -1350,6 +1345,18 @@ ParseDoDependencyParseOp(char **const pp
 }
 
 static void
+ClearPaths(SearchPathList *paths)
+{
+if (paths != NULL) {
+	SearchPathListNode *ln;
+	for (ln = paths->first; ln != NULL; ln = ln->next)
+	Dir_ClearPath(ln->datum);
+}
+
+Dir_SetPATH();
+}
+
+static void
 ParseDoDependencySourcesEmpty(ParseSpecial const specType,
 			  SearchPathList *const paths)
 {
@@ -1367,9 +1374,7 @@ ParseDoDependencySourcesEmpty(ParseSpeci
 	beSilent = TRUE;
 	break;
 case ExPath:
-	if (paths != NULL)
-	Lst_ForEach(paths, ParseClearPath, NULL);
-	Dir_SetPATH();
+	ClearPaths(paths);
 	break;
 #ifdef POSIX
 case Posix:



CVS commit: src/usr.bin/make

2020-10-19 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Oct 19 20:41:53 UTC 2020

Modified Files:
src/usr.bin/make: meta.c

Log Message:
make(1): remove void pointers from printCMD


To generate a diff of this commit:
cvs rdiff -u -r1.125 -r1.126 src/usr.bin/make/meta.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/make/meta.c
diff -u src/usr.bin/make/meta.c:1.125 src/usr.bin/make/meta.c:1.126
--- src/usr.bin/make/meta.c:1.125	Sun Oct 18 13:02:10 2020
+++ src/usr.bin/make/meta.c	Mon Oct 19 20:41:53 2020
@@ -1,4 +1,4 @@
-/*  $NetBSD: meta.c,v 1.125 2020/10/18 13:02:10 rillig Exp $ */
+/*  $NetBSD: meta.c,v 1.126 2020/10/19 20:41:53 rillig Exp $ */
 
 /*
  * Implement 'meta' mode.
@@ -367,10 +367,8 @@ typedef struct meta_file_s {
 } meta_file_t;
 
 static void
-printCMD(void *cmdp, void *mfpp)
+printCMD(const char *cmd, meta_file_t *mfp)
 {
-meta_file_t *mfp = mfpp;
-char *cmd = cmdp;
 char *cmd_freeIt = NULL;
 
 if (strchr(cmd, '$')) {
@@ -382,6 +380,15 @@ printCMD(void *cmdp, void *mfpp)
 free(cmd_freeIt);
 }
 
+static void
+printCMDs(GNode *gn, meta_file_t *mf)
+{
+GNodeListNode *ln;
+
+for (ln = gn->commands->first; ln != NULL; ln = ln->next)
+	printCMD(ln->datum, mf);
+}
+
 /*
  * Certain node types never get a .meta file
  */
@@ -517,7 +524,7 @@ meta_create(BuildMon *pbm, GNode *gn)
 
 mf.gn = gn;
 
-Lst_ForEach(gn->commands, printCMD, );
+printCMDs(gn, );
 
 fprintf(mf.fp, "CWD %s\n", getcwd(buf, sizeof(buf)));
 fprintf(mf.fp, "TARGET %s\n", tname);



CVS commit: src/usr.bin/make

2020-10-19 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Oct 19 19:55:25 UTC 2020

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

Log Message:
make(1): inline link_parent into Make_ProcessWait


To generate a diff of this commit:
cvs rdiff -u -r1.163 -r1.164 src/usr.bin/make/make.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/make/make.c
diff -u src/usr.bin/make/make.c:1.163 src/usr.bin/make/make.c:1.164
--- src/usr.bin/make/make.c:1.163	Mon Oct 19 19:48:09 2020
+++ src/usr.bin/make/make.c	Mon Oct 19 19:55:25 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: make.c,v 1.163 2020/10/19 19:48:09 rillig Exp $	*/
+/*	$NetBSD: make.c,v 1.164 2020/10/19 19:55:25 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -107,7 +107,7 @@
 #include"job.h"
 
 /*	"@(#)make.c	8.1 (Berkeley) 6/6/93"	*/
-MAKE_RCSID("$NetBSD: make.c,v 1.163 2020/10/19 19:48:09 rillig Exp $");
+MAKE_RCSID("$NetBSD: make.c,v 1.164 2020/10/19 19:55:25 rillig Exp $");
 
 /* Sequence # to detect recursion. */
 static unsigned int checked = 1;
@@ -1171,17 +1171,6 @@ Make_ExpandUse(GNodeList *targs)
 Lst_Free(examine);
 }
 
-static void
-link_parent(void *cnp, void *pnp)
-{
-GNode *cn = cnp;
-GNode *pn = pnp;
-
-Lst_Append(pn->children, cn);
-Lst_Append(cn->parents, pn);
-pn->unmade++;
-}
-
 /* Make the .WAIT node depend on the previous children */
 static void
 add_wait_dependency(GNodeListNode *owln, GNode *wn)
@@ -1205,10 +1194,8 @@ static void
 Make_ProcessWait(GNodeList *targs)
 {
 GNode  *pgn;		/* 'parent' node we are examining */
-GNode  *cgn;		/* Each child in turn */
 GNodeListNode *owln;	/* Previous .WAIT node */
 GNodeList *examine;		/* List of targets to examine */
-GNodeListNode *ln;
 
 /*
  * We need all the nodes to have a common parent in order for the
@@ -1222,7 +1209,16 @@ Make_ProcessWait(GNodeList *targs)
 /* Get it displayed in the diag dumps */
 Lst_Prepend(Targ_List(), pgn);
 
-Lst_ForEach(targs, link_parent, pgn);
+{
+	GNodeListNode *ln;
+	for (ln = targs->first; ln != NULL; ln = ln->next) {
+	GNode *cgn = ln->datum;
+
+	Lst_Append(pgn->children, cgn);
+	Lst_Append(cgn->parents, pgn);
+	pgn->unmade++;
+	}
+}
 
 /* Start building with the 'dummy' .MAIN' node */
 MakeBuildChild(pgn, NULL);
@@ -1231,6 +1227,8 @@ Make_ProcessWait(GNodeList *targs)
 Lst_Append(examine, pgn);
 
 while (!Lst_IsEmpty(examine)) {
+	GNodeListNode *ln;
+
 	pgn = Lst_Dequeue(examine);
 
 	/* We only want to process each child-list once */
@@ -1245,7 +1243,7 @@ Make_ProcessWait(GNodeList *targs)
 	owln = Lst_First(pgn->children);
 	Lst_Open(pgn->children);
 	for (; (ln = Lst_Next(pgn->children)) != NULL; ) {
-	cgn = LstNode_Datum(ln);
+	GNode *cgn = LstNode_Datum(ln);
 	if (cgn->type & OP_WAIT) {
 		add_wait_dependency(owln, cgn);
 		owln = ln;



CVS commit: src/usr.bin/make

2020-10-19 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Oct 19 19:48:09 UTC 2020

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

Log Message:
make(1): inline MakeTimeStamp in Make_OODate


To generate a diff of this commit:
cvs rdiff -u -r1.162 -r1.163 src/usr.bin/make/make.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/make/make.c
diff -u src/usr.bin/make/make.c:1.162 src/usr.bin/make/make.c:1.163
--- src/usr.bin/make/make.c:1.162	Mon Oct 19 19:45:50 2020
+++ src/usr.bin/make/make.c	Mon Oct 19 19:48:09 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: make.c,v 1.162 2020/10/19 19:45:50 rillig Exp $	*/
+/*	$NetBSD: make.c,v 1.163 2020/10/19 19:48:09 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -107,7 +107,7 @@
 #include"job.h"
 
 /*	"@(#)make.c	8.1 (Berkeley) 6/6/93"	*/
-MAKE_RCSID("$NetBSD: make.c,v 1.162 2020/10/19 19:45:50 rillig Exp $");
+MAKE_RCSID("$NetBSD: make.c,v 1.163 2020/10/19 19:48:09 rillig Exp $");
 
 /* Sequence # to detect recursion. */
 static unsigned int checked = 1;
@@ -192,12 +192,6 @@ Make_TimeStamp(GNode *pgn, GNode *cgn)
 }
 }
 
-static void
-MakeTimeStamp(void *pgn, void *cgn)
-{
-Make_TimeStamp(pgn, cgn);
-}
-
 /* See if the node is out of date with respect to its sources.
  *
  * Used by Make_Run when deciding which nodes to place on the
@@ -335,7 +329,9 @@ Make_OODate(GNode *gn)
  * thinking they're out-of-date.
  */
 if (!oodate) {
-	Lst_ForEach(gn->parents, MakeTimeStamp, gn);
+	GNodeListNode *ln;
+	for (ln = gn->parents->first; ln != NULL; ln = ln->next)
+	Make_TimeStamp(ln->datum, gn);
 }
 
 return oodate;



CVS commit: src/usr.bin/make

2020-10-19 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Oct 19 19:45:50 UTC 2020

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

Log Message:
make(1): eliminate void pointer from MakeAddAllSrc


To generate a diff of this commit:
cvs rdiff -u -r1.161 -r1.162 src/usr.bin/make/make.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/make/make.c
diff -u src/usr.bin/make/make.c:1.161 src/usr.bin/make/make.c:1.162
--- src/usr.bin/make/make.c:1.161	Sun Oct 18 14:58:45 2020
+++ src/usr.bin/make/make.c	Mon Oct 19 19:45:50 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: make.c,v 1.161 2020/10/18 14:58:45 rillig Exp $	*/
+/*	$NetBSD: make.c,v 1.162 2020/10/19 19:45:50 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -107,7 +107,7 @@
 #include"job.h"
 
 /*	"@(#)make.c	8.1 (Berkeley) 6/6/93"	*/
-MAKE_RCSID("$NetBSD: make.c,v 1.161 2020/10/18 14:58:45 rillig Exp $");
+MAKE_RCSID("$NetBSD: make.c,v 1.162 2020/10/19 19:45:50 rillig Exp $");
 
 /* Sequence # to detect recursion. */
 static unsigned int checked = 1;
@@ -763,16 +763,13 @@ UnmarkChildren(GNode *gn)
  * modification times, the comparison is rather unfair...)..
  *
  * Input:
- *	cgnp		The child to add
- *	pgnp		The parent to whose ALLSRC variable it should
+ *	cgn		The child to add
+ *	pgn		The parent to whose ALLSRC variable it should
  *			be added
  */
 static void
-MakeAddAllSrc(void *cgnp, void *pgnp)
+MakeAddAllSrc(GNode *cgn, GNode *pgn)
 {
-GNode	*cgn = (GNode *)cgnp;
-GNode	*pgn = (GNode *)pgnp;
-
 if (cgn->type & OP_MARK)
 	return;
 cgn->type |= OP_MARK;
@@ -838,11 +835,14 @@ MakeAddAllSrc(void *cgnp, void *pgnp)
 void
 Make_DoAllVar(GNode *gn)
 {
+GNodeListNode *ln;
+
 if (gn->flags & DONE_ALLSRC)
 	return;
 
 UnmarkChildren(gn);
-Lst_ForEach(gn->children, MakeAddAllSrc, gn);
+for (ln = gn->children->first; ln != NULL; ln = ln->next)
+MakeAddAllSrc(ln->datum, gn);
 
 if (!Var_Exists(OODATE, gn)) {
 	Var_Set(OODATE, "", gn);



CVS commit: src/usr.bin/make

2020-10-19 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Oct 19 19:34:18 UTC 2020

Modified Files:
src/usr.bin/make: targ.c

Log Message:
make(1): fix variable names in Targ_Propagate

List nodes are called ln, not pn or cn.

While here, extract a common subexpression to save a few instructions.
The compiler cannot know that gn->type will not change during the whole
loop.  For this, it would have to know that a GNode cannot have itself
as a cohort, and this is not expressed anywhere in the code.


To generate a diff of this commit:
cvs rdiff -u -r1.116 -r1.117 src/usr.bin/make/targ.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/make/targ.c
diff -u src/usr.bin/make/targ.c:1.116 src/usr.bin/make/targ.c:1.117
--- src/usr.bin/make/targ.c:1.116	Sun Oct 18 13:02:10 2020
+++ src/usr.bin/make/targ.c	Mon Oct 19 19:34:18 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: targ.c,v 1.116 2020/10/18 13:02:10 rillig Exp $	*/
+/*	$NetBSD: targ.c,v 1.117 2020/10/19 19:34:18 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -121,7 +121,7 @@
 #include "dir.h"
 
 /*	"@(#)targ.c	8.2 (Berkeley) 3/19/94"	*/
-MAKE_RCSID("$NetBSD: targ.c,v 1.116 2020/10/18 13:02:10 rillig Exp $");
+MAKE_RCSID("$NetBSD: targ.c,v 1.117 2020/10/19 19:34:18 rillig Exp $");
 
 static GNodeList *allTargets;	/* the list of all targets found so far */
 #ifdef CLEANUP
@@ -554,18 +554,19 @@ Targ_PrintGraph(int pass)
 void
 Targ_Propagate(void)
 {
-GNodeListNode *pn, *cn;
+GNodeListNode *ln, *cln;
 
-for (pn = allTargets->first; pn != NULL; pn = pn->next) {
-	GNode *pgn = pn->datum;
+for (ln = allTargets->first; ln != NULL; ln = ln->next) {
+	GNode *gn = ln->datum;
+	GNodeType type = gn->type;
 
-	if (!(pgn->type & OP_DOUBLEDEP))
+	if (!(type & OP_DOUBLEDEP))
 	continue;
 
-	for (cn = pgn->cohorts->first; cn != NULL; cn = cn->next) {
-	GNode *cgn = cn->datum;
+	for (cln = gn->cohorts->first; cln != NULL; cln = cln->next) {
+	GNode *cohort = cln->datum;
 
-	cgn->type |= pgn->type & ~OP_OPMASK;
+	cohort->type |= type & ~OP_OPMASK;
 	}
 }
 }



CVS commit: src/sys

2020-10-19 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Oct 19 19:33:02 UTC 2020

Modified Files:
src/sys/arch/amd64/conf: MODULAR files.amd64
src/sys/kern: compat_stub.c core_elf32.c files.kern kern_core.c
kern_sig.c
src/sys/modules/coredump: Makefile
src/sys/modules/exec_elf32: Makefile
src/sys/modules/exec_elf64: Makefile
src/sys/modules/ptrace_common: Makefile
src/sys/sys: compat_stub.h exec_elf.h
Added Files:
src/sys/modules/ptrace_common: machdep.mk

Log Message:
Arrange so that no options COREDUMP and no options PTRACE work together.
Thanks to Paul Goyette for testing.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/amd64/conf/MODULAR
cvs rdiff -u -r1.117 -r1.118 src/sys/arch/amd64/conf/files.amd64
cvs rdiff -u -r1.19 -r1.20 src/sys/kern/compat_stub.c
cvs rdiff -u -r1.65 -r1.66 src/sys/kern/core_elf32.c
cvs rdiff -u -r1.52 -r1.53 src/sys/kern/files.kern
cvs rdiff -u -r1.30 -r1.31 src/sys/kern/kern_core.c
cvs rdiff -u -r1.390 -r1.391 src/sys/kern/kern_sig.c
cvs rdiff -u -r1.6 -r1.7 src/sys/modules/coredump/Makefile
cvs rdiff -u -r1.5 -r1.6 src/sys/modules/exec_elf32/Makefile
cvs rdiff -u -r1.4 -r1.5 src/sys/modules/exec_elf64/Makefile
cvs rdiff -u -r1.3 -r1.4 src/sys/modules/ptrace_common/Makefile
cvs rdiff -u -r0 -r1.1 src/sys/modules/ptrace_common/machdep.mk
cvs rdiff -u -r1.23 -r1.24 src/sys/sys/compat_stub.h
cvs rdiff -u -r1.167 -r1.168 src/sys/sys/exec_elf.h

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

Modified files:

Index: src/sys/arch/amd64/conf/MODULAR
diff -u src/sys/arch/amd64/conf/MODULAR:1.17 src/sys/arch/amd64/conf/MODULAR:1.18
--- src/sys/arch/amd64/conf/MODULAR:1.17	Sun Sep 27 09:48:49 2020
+++ src/sys/arch/amd64/conf/MODULAR	Mon Oct 19 15:33:01 2020
@@ -1,11 +1,9 @@
-# $NetBSD: MODULAR,v 1.17 2020/09/27 13:48:49 roy Exp $
+# $NetBSD: MODULAR,v 1.18 2020/10/19 19:33:01 christos Exp $
 #
 # Try to exclude all the drivers in GENERIC that have been modularized
 # XXX: incomplete
 
 include "arch/amd64/conf/GENERIC"
-options 	MODULAR		# new style module(7) framework
-options 	MODULAR_DEFAULT_AUTOLOAD
 
 -no acpicpu*	at cpu?
 -no est0		at cpu0
@@ -85,6 +83,9 @@ options 	MODULAR_DEFAULT_AUTOLOAD
 
 -no options	AIO
 
+-no options	PTRACE
+-no options	COREDUMP
+
 -no acpiacad*	at acpi?		# ACPI AC Adapter
 -no acpibat*	at acpi?		# ACPI Battery
 -no acpibut*	at acpi?		# ACPI Button

Index: src/sys/arch/amd64/conf/files.amd64
diff -u src/sys/arch/amd64/conf/files.amd64:1.117 src/sys/arch/amd64/conf/files.amd64:1.118
--- src/sys/arch/amd64/conf/files.amd64:1.117	Thu Oct 15 13:40:13 2020
+++ src/sys/arch/amd64/conf/files.amd64	Mon Oct 19 15:33:01 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: files.amd64,v 1.117 2020/10/15 17:40:13 mgorny Exp $
+#	$NetBSD: files.amd64,v 1.118 2020/10/19 19:33:01 christos Exp $
 #
 # new style config file for amd64 architecture
 #
@@ -47,7 +47,7 @@ file	kern/subr_disk_mbr.c			disk
 file	arch/amd64/amd64/gdt.c			machdep
 file	arch/amd64/amd64/machdep.c		machdep
 file	arch/amd64/amd64/prekern.c		kaslr
-file	arch/amd64/amd64/process_machdep.c	machdep
+file	arch/amd64/amd64/process_machdep.c	machdep & ptrace
 file	arch/amd64/amd64/trap.c			machdep
 file	arch/x86/x86/fpu.c			machdep
 file	arch/x86/x86/dbregs.c			machdep

Index: src/sys/kern/compat_stub.c
diff -u src/sys/kern/compat_stub.c:1.19 src/sys/kern/compat_stub.c:1.20
--- src/sys/kern/compat_stub.c:1.19	Wed Nov 20 14:37:53 2019
+++ src/sys/kern/compat_stub.c	Mon Oct 19 15:33:02 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: compat_stub.c,v 1.19 2019/11/20 19:37:53 pgoyette Exp $	*/
+/* $NetBSD: compat_stub.c,v 1.20 2020/10/19 19:33:02 christos Exp $	*/
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -280,6 +280,8 @@ struct coredump_hook_t coredump_hook;
 struct coredump_offset_hook_t coredump_offset_hook;
 struct coredump_write_hook_t coredump_write_hook;
 struct coredump_netbsd_hook_t coredump_netbsd_hook;
+struct coredump_elf32_hook_t coredump_elf32_hook;
+struct coredump_elf64_hook_t coredump_elf64_hook;
 struct uvm_coredump_walkmap_hook_t uvm_coredump_walkmap_hook;
 struct uvm_coredump_count_segs_hook_t uvm_coredump_count_segs_hook;
 

Index: src/sys/kern/core_elf32.c
diff -u src/sys/kern/core_elf32.c:1.65 src/sys/kern/core_elf32.c:1.66
--- src/sys/kern/core_elf32.c:1.65	Fri Oct  9 20:10:06 2020
+++ src/sys/kern/core_elf32.c	Mon Oct 19 15:33:02 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: core_elf32.c,v 1.65 2020/10/10 00:10:06 rin Exp $	*/
+/*	$NetBSD: core_elf32.c,v 1.66 2020/10/19 19:33:02 christos Exp $	*/
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -40,7 +40,7 @@
  */
 
 #include 
-__KERNEL_RCSID(1, "$NetBSD: core_elf32.c,v 1.65 2020/10/10 00:10:06 rin Exp $");
+__KERNEL_RCSID(1, "$NetBSD: core_elf32.c,v 1.66 2020/10/19 19:33:02 christos Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd32.h"
@@ -109,7 +109,7 @@ static int	

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

2020-10-19 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Oct 19 19:14:11 UTC 2020

Modified Files:
src/usr.bin/make/unit-tests: shell-csh.mk

Log Message:
make(1): fix test shell-csh in case no csh is available


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/usr.bin/make/unit-tests/shell-csh.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/shell-csh.mk
diff -u src/usr.bin/make/unit-tests/shell-csh.mk:1.4 src/usr.bin/make/unit-tests/shell-csh.mk:1.5
--- src/usr.bin/make/unit-tests/shell-csh.mk:1.4	Sat Oct  3 15:38:13 2020
+++ src/usr.bin/make/unit-tests/shell-csh.mk	Mon Oct 19 19:14:11 2020
@@ -1,11 +1,15 @@
-# $NetBSD: shell-csh.mk,v 1.4 2020/10/03 15:38:13 rillig Exp $
+# $NetBSD: shell-csh.mk,v 1.5 2020/10/19 19:14:11 rillig Exp $
 #
 # Tests for using a C shell for running the commands.
 
+CSH!=	which csh || true
+
 # The shell path must be an absolute path.
 # This is only obvious in parallel mode since in compat mode,
 # simple commands are executed via execve directly.
-.SHELL: name="csh" path="${:!which csh!}"
+.if ${CSH} != ""
+.SHELL: name="csh" path="${CSH}"
+.endif
 
 # In parallel mode, the commandShell->noPrint command is filtered from
 # the output, rather naively (in JobOutput).
@@ -15,6 +19,7 @@
 .MAKEFLAGS: -j1
 
 all:
+.if ${CSH} != ""
 	# This command is both printed and executed.
 	echo normal
 
@@ -30,3 +35,6 @@ all:
 	# In the C shell, "unset verbose" is set as the noPrint command.
 	# Therefore it is filtered from the output, rather naively.
 	@echo 'They chatted in the sunset verbosely.'
+.else
+	@sed '$$d' ${MAKEFILE:.mk=.exp}	# This is cheated.
+.endif



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

2020-10-19 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Oct 19 18:59:53 UTC 2020

Modified Files:
src/usr.bin/make/unit-tests: directive-export-gmake.mk

Log Message:
make(1): fix test directive-export-gmake.mk for dash


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 \
src/usr.bin/make/unit-tests/directive-export-gmake.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/directive-export-gmake.mk
diff -u src/usr.bin/make/unit-tests/directive-export-gmake.mk:1.1 src/usr.bin/make/unit-tests/directive-export-gmake.mk:1.2
--- src/usr.bin/make/unit-tests/directive-export-gmake.mk:1.1	Fri Oct  2 20:34:59 2020
+++ src/usr.bin/make/unit-tests/directive-export-gmake.mk	Mon Oct 19 18:59:53 2020
@@ -1,4 +1,4 @@
-# $NetBSD: directive-export-gmake.mk,v 1.1 2020/10/02 20:34:59 rillig Exp $
+# $NetBSD: directive-export-gmake.mk,v 1.2 2020/10/19 18:59:53 rillig Exp $
 #
 # Tests for the export directive (without leading dot), as in GNU make.
 
@@ -34,9 +34,15 @@ export VAR=  leading spaces
 # Contrary to the usual variable assignments, spaces are significant
 # before the '=' sign and are appended to the name of the environment
 # variable.
+#
+# Depending on the shell, environment variables with such exotic names
+# may be silently discarded.  One such shell is dash, which is the default
+# shell on Ubuntu and Debian.
 export VAR =trailing space in varname
 .if ${:!env | grep trailing!} != "VAR =trailing space in varname"
-.  error
+.  if ${:!env | grep trailing!} != "" # for dash
+.error
+.  endif
 .endif
 
 # The right-hand side of the exported variable is expanded exactly once.



CVS commit: src/sys/arch

2020-10-19 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Oct 19 17:47:37 UTC 2020

Modified Files:
src/sys/arch/amd64/amd64: process_machdep.c
src/sys/arch/arm/arm: process_machdep.c
src/sys/arch/i386/i386: process_machdep.c
src/sys/arch/sh3/sh3: process_machdep.c

Log Message:
_KERNEL_OPT police


To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 src/sys/arch/amd64/amd64/process_machdep.c
cvs rdiff -u -r1.33 -r1.34 src/sys/arch/arm/arm/process_machdep.c
cvs rdiff -u -r1.95 -r1.96 src/sys/arch/i386/i386/process_machdep.c
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/sh3/sh3/process_machdep.c

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

Modified files:

Index: src/sys/arch/amd64/amd64/process_machdep.c
diff -u src/sys/arch/amd64/amd64/process_machdep.c:1.48 src/sys/arch/amd64/amd64/process_machdep.c:1.49
--- src/sys/arch/amd64/amd64/process_machdep.c:1.48	Thu Oct 15 13:37:35 2020
+++ src/sys/arch/amd64/amd64/process_machdep.c	Mon Oct 19 13:47:37 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: process_machdep.c,v 1.48 2020/10/15 17:37:35 mgorny Exp $	*/
+/*	$NetBSD: process_machdep.c,v 1.49 2020/10/19 17:47:37 christos Exp $	*/
 
 /*
  * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@@ -74,9 +74,12 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: process_machdep.c,v 1.48 2020/10/15 17:37:35 mgorny Exp $");
+__KERNEL_RCSID(0, "$NetBSD: process_machdep.c,v 1.49 2020/10/19 17:47:37 christos Exp $");
 
+#ifdef _KERNEL_OPT
 #include "opt_xen.h"
+#endif
+
 #include 
 #include 
 #include 

Index: src/sys/arch/arm/arm/process_machdep.c
diff -u src/sys/arch/arm/arm/process_machdep.c:1.33 src/sys/arch/arm/arm/process_machdep.c:1.34
--- src/sys/arch/arm/arm/process_machdep.c:1.33	Wed Jan 24 04:04:44 2018
+++ src/sys/arch/arm/arm/process_machdep.c	Mon Oct 19 13:47:37 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: process_machdep.c,v 1.33 2018/01/24 09:04:44 skrll Exp $	*/
+/*	$NetBSD: process_machdep.c,v 1.34 2020/10/19 17:47:37 christos Exp $	*/
 
 /*
  * Copyright (c) 1993 The Regents of the University of California.
@@ -129,11 +129,13 @@
  *	Set the process's program counter.
  */
 
+#ifdef _KERNEL_OPT
 #include "opt_armfpe.h"
+#endif
 
 #include 
 
-__KERNEL_RCSID(0, "$NetBSD: process_machdep.c,v 1.33 2018/01/24 09:04:44 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: process_machdep.c,v 1.34 2020/10/19 17:47:37 christos Exp $");
 
 #include 
 #include 

Index: src/sys/arch/i386/i386/process_machdep.c
diff -u src/sys/arch/i386/i386/process_machdep.c:1.95 src/sys/arch/i386/i386/process_machdep.c:1.96
--- src/sys/arch/i386/i386/process_machdep.c:1.95	Thu Oct 15 13:37:35 2020
+++ src/sys/arch/i386/i386/process_machdep.c	Mon Oct 19 13:47:37 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: process_machdep.c,v 1.95 2020/10/15 17:37:35 mgorny Exp $	*/
+/*	$NetBSD: process_machdep.c,v 1.96 2020/10/19 17:47:37 christos Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2000, 2001, 2008 The NetBSD Foundation, Inc.
@@ -75,9 +75,11 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: process_machdep.c,v 1.95 2020/10/15 17:37:35 mgorny Exp $");
+__KERNEL_RCSID(0, "$NetBSD: process_machdep.c,v 1.96 2020/10/19 17:47:37 christos Exp $");
 
+#ifdef _KERNEL_OPT
 #include "opt_ptrace.h"
+#endif
 
 #include 
 #include 

Index: src/sys/arch/sh3/sh3/process_machdep.c
diff -u src/sys/arch/sh3/sh3/process_machdep.c:1.24 src/sys/arch/sh3/sh3/process_machdep.c:1.25
--- src/sys/arch/sh3/sh3/process_machdep.c:1.24	Thu Oct 15 14:58:59 2020
+++ src/sys/arch/sh3/sh3/process_machdep.c	Mon Oct 19 13:47:37 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: process_machdep.c,v 1.24 2020/10/15 18:58:59 martin Exp $	*/
+/*	$NetBSD: process_machdep.c,v 1.25 2020/10/19 17:47:37 christos Exp $	*/
 
 /*
  * Copyright (c) 1993 The Regents of the University of California.
@@ -77,7 +77,12 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: process_machdep.c,v 1.24 2020/10/15 18:58:59 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: process_machdep.c,v 1.25 2020/10/19 17:47:37 christos Exp $");
+
+#ifdef _KERNEL_OPT
+#include "opt_compat_netbsd.h"
+#include "opt_ptrace.h"
+#endif
 
 #include 
 #include 
@@ -90,9 +95,6 @@ __KERNEL_RCSID(0, "$NetBSD: process_mach
 #include 
 #include 
 
-#include "opt_compat_netbsd.h"
-#include "opt_ptrace.h"
-
 #ifdef COMPAT_40
 static int process_machdep_doregs40(struct lwp *, struct lwp *, struct uio *);
 static int process_machdep_read_regs40(struct lwp *l, struct __reg40 *);



CVS commit: src/lib/libutil

2020-10-19 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Mon Oct 19 17:47:45 UTC 2020

Modified Files:
src/lib/libutil: parsedate.y

Log Message:
Check the year field of a tentative ISO-8601 date format for overflow
before committing to it being an 8601 format date, rather than after
(or the fall back grammar parser doesn't start with a clean slate).

This isn't likely to ever bother anyone, the chances of encountering
something that looks just like an 8601 format date, but with a year
field so large it overflows a long are kind of slim.   If it did happen
the chances that the string could be correctly parsed (into something
different) by the grammar are even slimmer. But better to do it properly.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/lib/libutil/parsedate.y

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

Modified files:

Index: src/lib/libutil/parsedate.y
diff -u src/lib/libutil/parsedate.y:1.34 src/lib/libutil/parsedate.y:1.35
--- src/lib/libutil/parsedate.y:1.34	Mon Oct 19 15:08:17 2020
+++ src/lib/libutil/parsedate.y	Mon Oct 19 17:47:45 2020
@@ -14,7 +14,7 @@
 
 #include 
 #ifdef __RCSID
-__RCSID("$NetBSD: parsedate.y,v 1.34 2020/10/19 15:08:17 kre Exp $");
+__RCSID("$NetBSD: parsedate.y,v 1.35 2020/10/19 17:47:45 kre Exp $");
 #endif
 
 #include 
@@ -1081,6 +1081,7 @@ parsedate(const char *p, const time_t *n
 	const unsigned char *pp = (const unsigned char *)p;
 	char *ep;	/* starts as "expected, becomes "end ptr" */
 	static char format[] = "-dd-ddTdd:dd:dd";
+	time_t yr;
 
 	while (isdigit(*pp))
 		pp++;
@@ -1121,6 +1122,11 @@ parsedate(const char *p, const time_t *n
 	if (*pp != '\0' && !isspace(*pp))
 		break;
 
+	errno = 0;
+	yr = (time_t)strtol(p, , 10);
+	if (errno != 0)			/* out of range (can be big number) */
+		break;			/* the ones below are all 2 digits */
+
 	/*
 	 * This is good enough to commit to there being an ISO format
 	 * timestamp leading the input string.   We permit standard
@@ -1135,10 +1141,7 @@ parsedate(const char *p, const time_t *n
 		param.yyHaveZone = 1;
 	}
 
-	errno = 0;
-	param.yyYear = (time_t)strtol(p, , 10);
-	if (errno != 0)			/* out of range (can be big number) */
-		break;			/* the ones below are all 2 digits */
+	param.yyYear = yr;
 	param.yyMonth = (time_t)strtol(ep + 1, , 10);
 	param.yyDay = (time_t)strtol(ep + 1, , 10);
 	param.yyHour = (time_t)strtol(ep + 1, , 10);



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

2020-10-19 Thread Tobias Nygren
Module Name:src
Committed By:   tnn
Date:   Mon Oct 19 17:00:02 UTC 2020

Modified Files:
src/sys/arch/evbarm/dev: plcom.c

Log Message:
remove superfluous parentheses in PREAD4/PWRITE4 macros


To generate a diff of this commit:
cvs rdiff -u -r1.61 -r1.62 src/sys/arch/evbarm/dev/plcom.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/evbarm/dev/plcom.c
diff -u src/sys/arch/evbarm/dev/plcom.c:1.61 src/sys/arch/evbarm/dev/plcom.c:1.62
--- src/sys/arch/evbarm/dev/plcom.c:1.61	Sat Apr 25 21:34:08 2020
+++ src/sys/arch/evbarm/dev/plcom.c	Mon Oct 19 17:00:02 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: plcom.c,v 1.61 2020/04/25 21:34:08 jmcneill Exp $	*/
+/*	$NetBSD: plcom.c,v 1.62 2020/10/19 17:00:02 tnn Exp $	*/
 
 /*-
  * Copyright (c) 2001 ARM Ltd
@@ -94,7 +94,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: plcom.c,v 1.61 2020/04/25 21:34:08 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: plcom.c,v 1.62 2020/10/19 17:00:02 tnn Exp $");
 
 #include "opt_plcom.h"
 #include "opt_ddb.h"
@@ -297,12 +297,12 @@ pwritem1(struct plcom_instance *pi, bus_
 
 #define	PREAD1(pi, reg)		pread1(pi, reg)
 #define	PREAD4(pi, reg)		\
-	(bus_space_read_4((pi)->pi_iot, (pi)->pi_ioh, (reg)))
+	bus_space_read_4((pi)->pi_iot, (pi)->pi_ioh, (reg))
 
 #define	PWRITE1(pi, reg, val)	pwrite1(pi, reg, val)
 #define	PWRITEM1(pi, reg, d, c)	pwritem1(pi, reg, d, c)
 #define	PWRITE4(pi, reg, val)	\
-	(bus_space_write_4((pi)->pi_iot, (pi)->pi_ioh, (reg), (val)))
+	bus_space_write_4((pi)->pi_iot, (pi)->pi_ioh, (reg), (val))
 
 int
 pl010comspeed(long speed, long frequency)



CVS commit: src/share/legal

2020-10-19 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Mon Oct 19 15:25:58 UTC 2020

Modified Files:
src/share/legal: COPYRIGHT

Log Message:
Remove advertising clause from the code distributed from UCB

Follow ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/share/legal/COPYRIGHT

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

Modified files:

Index: src/share/legal/COPYRIGHT
diff -u src/share/legal/COPYRIGHT:1.2 src/share/legal/COPYRIGHT:1.3
--- src/share/legal/COPYRIGHT:1.2	Sat Feb  6 10:40:58 2016
+++ src/share/legal/COPYRIGHT	Mon Oct 19 15:25:57 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: COPYRIGHT,v 1.2 2016/02/06 10:40:58 mlelstv Exp $
+#	$NetBSD: COPYRIGHT,v 1.3 2020/10/19 15:25:57 kamil Exp $
 #	@(#)COPYRIGHT	8.2 (Berkeley) 3/21/94
 
 All of the documentation and software included in the 4.4BSD and 4.4BSD-Lite
@@ -15,11 +15,7 @@ are met:
 2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-3. All advertising materials mentioning features or use of this software
-   must display the following acknowledgement:
-This product includes software developed by the University of
-California, Berkeley and its contributors.
-4. Neither the name of the University nor the names of its contributors
+3. Neither the name of the University nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
 
@@ -128,4 +124,3 @@ Except as contained in this notice, the 
 shall not be used in advertising or otherwise to promote the sale,
 use or other dealings in these Data Files or Software without prior
 written authorization of the copyright holder.
-



CVS commit: src/lib/libutil

2020-10-19 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Mon Oct 19 15:08:17 UTC 2020

Modified Files:
src/lib/libutil: parsedate.y

Log Message:
For touch -d (which uses parsedate()) POSIX specifies that the
ISO-8601 format -mm-ddTHH:MM:SS[radix_and+frac][Z]
be accepted.

We didn't handle that, as in parsedate(), 'T' represents the
military timezone designator, not a padding separator between
date & time as POSIX specified it.

The way parsedate() is written, fixing this in the grammar/lexer
would be hard without deleting support for T as a zone indicator
(it is *my* timezone!).

So, instead of doing that, parse an ISO-8901 string which occurs
right at the start of the input (not even any preceding white space)
by hand, before invoking the grammar, and so not involving the lexer.
This is sufficient to make touch -d conform.

After doing that, we still need to allow earlier valid inputs,
where an ISO-8601 format (using space as the separator, but without
the 'Z' (Zulu, or UTC) suffix) followed by an arbitrary timezone
designation, and other modifiers (eg: "+5 minutes" work.  So we
call the grammar on whatever is left of the input after the 8601
string has been consumed.   This all "just works" with one exception,
a format like "-mm-dd hh:mm:ss +0700" would have the grammar parse
just "+0700" which by itself would be meaningless, and so wasn't
handled.Add a grammar rule & processing to Handle it.

Also note that while POSIX specifies "at least 4" digits in the 
field, we implement "at least one" so years from 0-999 continue to be
parsed as they always have (nb: these were, and continue to be, treated
as absolute year numbers, year 10 is year 10, not 2010).  Years > 2 billion
(give or take) cannot be represented in the tm_year field of a struct tm,
so there's a limit on the max number of digits as well.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/lib/libutil/parsedate.y

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

Modified files:

Index: src/lib/libutil/parsedate.y
diff -u src/lib/libutil/parsedate.y:1.33 src/lib/libutil/parsedate.y:1.34
--- src/lib/libutil/parsedate.y:1.33	Mon Oct 19 15:05:53 2020
+++ src/lib/libutil/parsedate.y	Mon Oct 19 15:08:17 2020
@@ -14,7 +14,7 @@
 
 #include 
 #ifdef __RCSID
-__RCSID("$NetBSD: parsedate.y,v 1.33 2020/10/19 15:05:53 kre Exp $");
+__RCSID("$NetBSD: parsedate.y,v 1.34 2020/10/19 15:08:17 kre Exp $");
 #endif
 
 #include 
@@ -300,6 +300,12 @@ zone:
 	  tZONE		{ param->yyTimezone = $1; param->yyDSTmode = DSToff; }
 	| tDAYZONE	{ param->yyTimezone = $1; param->yyDSTmode = DSTon; }
 	| tZONE tDST	{ param->yyTimezone = $1; param->yyDSTmode = DSTon; }
+	| tSNUMBER	{
+			  if (param->yyHaveDate == 0 && param->yyHaveTime == 0)
+YYREJECT;
+			  param->yyTimezone = - ($1 % 100 + ($1 / 100) * 60);
+			  param->yyDSTmode = DSTmaybe;
+			}
 ;
 
 day:
@@ -1066,6 +1072,85 @@ parsedate(const char *p, const time_t *n
 param.yyHaveTime = 0;
 param.yyHaveZone = 0;
 
+/*
+ * This one is too hard to parse using a grammar (the lexer would
+ * confuse the 'T' with the Mil format timezone designator)
+ * so handle it as a special case.
+ */
+do {
+	const unsigned char *pp = (const unsigned char *)p;
+	char *ep;	/* starts as "expected, becomes "end ptr" */
+	static char format[] = "-dd-ddTdd:dd:dd";
+
+	while (isdigit(*pp))
+		pp++;
+
+	if (pp == (const unsigned char *)p)
+		break;
+
+	for (ep = format; *ep; ep++, pp++) {
+		switch (*ep) {
+		case 'd':
+			if (isdigit(*pp))
+continue;
+			break;
+		case 'T':
+			if (*pp == 'T' || *pp == 't' || *pp == ' ')
+continue;
+			break;
+		default:
+			if (*pp == *ep)
+continue;
+			break;
+		}
+		break;
+	}
+	if (*ep != '\0')
+		break;
+	if (*pp == '.' || *pp == ',') {
+		if (!isdigit(pp[1]))
+			break;
+		while (isdigit(*++pp))
+			continue;
+	}
+	if (*pp == 'Z' || *pp == 'z')
+		pp++;
+	else if (isdigit(*pp))
+		break;
+
+	if (*pp != '\0' && !isspace(*pp))
+		break;
+
+	/*
+	 * This is good enough to commit to there being an ISO format
+	 * timestamp leading the input string.   We permit standard
+	 * parsedate() modifiers to follow but not precede this string.
+	 */
+	param.yyHaveTime = 1;
+	param.yyHaveDate = 1;
+	param.yyHaveFullYear = 1;
+
+	if (pp[-1] == 'Z' || pp[-1] == 'z') {
+		param.yyTimezone = 0;
+		param.yyHaveZone = 1;
+	}
+
+	errno = 0;
+	param.yyYear = (time_t)strtol(p, , 10);
+	if (errno != 0)			/* out of range (can be big number) */
+		break;			/* the ones below are all 2 digits */
+	param.yyMonth = (time_t)strtol(ep + 1, , 10);
+	param.yyDay = (time_t)strtol(ep + 1, , 10);
+	param.yyHour = (time_t)strtol(ep + 1, , 10);
+	param.yyMinutes = (time_t)strtol(ep + 1, , 10);
+	param.yySeconds = (time_t)strtol(ep + 1, , 10);
+	/* ignore any fractional seconds, no way to return them in a time_t */
+
+	param.yyMeridian = MER24;
+
+	p = (const char *)pp;
+} while (0);
+
 if 

CVS commit: src/lib/libutil

2020-10-19 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Mon Oct 19 15:08:39 UTC 2020

Modified Files:
src/lib/libutil: parsedate.3

Log Message:
Catch the parsedate man page up with recent updates, ans also include
some general improvements I've had kicking around for a long time, but
never got around to committing.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/lib/libutil/parsedate.3

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

Modified files:

Index: src/lib/libutil/parsedate.3
diff -u src/lib/libutil/parsedate.3:1.24 src/lib/libutil/parsedate.3:1.25
--- src/lib/libutil/parsedate.3:1.24	Wed Mar 22 18:17:42 2017
+++ src/lib/libutil/parsedate.3	Mon Oct 19 15:08:39 2020
@@ -1,4 +1,4 @@
-.\" $NetBSD: parsedate.3,v 1.24 2017/03/22 18:17:42 kre Exp $
+.\" $NetBSD: parsedate.3,v 1.25 2020/10/19 15:08:39 kre Exp $
 .\"
 .\" Copyright (c) 2006 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -27,7 +27,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd March 22, 2017
+.Dd October 19, 2020
 .Dt PARSEDATE 3
 .Os
 .Sh NAME
@@ -42,7 +42,7 @@
 .Sh DESCRIPTION
 The
 .Fn parsedate
-function parses a datetime from
+function parses a date and time from
 .Ar datestr
 described in English relative to an optional
 .Ar time
@@ -65,9 +65,28 @@ The
 .Ar datestr
 is a sequence of white-space separated items.
 The white-space is optional if the concatenated items are not ambiguous.
+The string contains data which can specify a base time (used in
+conjunction with the
+.Ar time
+parameter, totally replacing that parameter's value if sufficient data
+appears in
+.Ar datestr
+to do so), and data specifying an offset from the base time.
+Both of those are optional.
+If no data specifies the base time, then
+.Nm
+simply uses the value given by
+.Ar \&*time
+.Pq "or now" .
+If there is no offset data then no offset is applied.
 An empty
+.Ar datestr ,
+or a
 .Ar datestr
-is equivalent to midnight today (the beginning of this day).
+containing nothing but whitespace,
+is equivalent to midnight at the start of the day specified by
+.Ar \&*time
+.Pq "or today" .
 .Pp
 The following words have the indicated numeric meanings:
 .Dv last =
@@ -147,6 +166,11 @@ The months:
 .Dv november ,
 .Dv december ,
 and common abbreviations for them.
+When a month name (or its ordinal number) is given,
+the number of some particular day of that month is required to accompany it.
+This is generally true of any data that specifies a period
+with a duration longer than a day, so simply specifying a year,
+or a month, is invalid, as also is specifying a year and a month.
 .Pp
 The days of the week:
 .Dv sunday ,
@@ -157,6 +181,9 @@ The days of the week:
 .Dv friday ,
 .Dv saturday ,
 and common abbreviations for them.
+Weekday names are typically ignored if any other data
+is given to specify the date, even if the name given
+is not the day on which the specified date occurred.
 .Pp
 Time units:
 .Dv year ,
@@ -239,20 +266,27 @@ Timezone names:
 .Dv nzdt (+1300) ,
 .Dv idle (+1200) .
 .Pp
-The timezone names specify an offset from Coordinated Universal Time (UTC)
+The timezone names simply specify an offset from
+Coordinated Universal Time (UTC)
 and do not imply validating the time/date to be reasonable in any zone
 that happens to use the abbreviation specified.
 .Pp
 A variety of unambiguous dates are recognized:
 .Bl -tag -compact -width "20 Jun 1994"
 .It 9/10/69
-For years between 70-99 we assume 1900+ and for years between 0-69
+For years between 69-99 we assume 1900+ and for years between 0-68
 we assume 2000+.
 .It 2006-11-17
 An ISO-8601 date.
-.It 69-09-10
+Note that when using the ISO-8601 format date and time with the
+.Sq T
+designator to separate date and time-of-day,
+this must appear at the start of the input string,
+with no preceding whitespace.
+Other modifiers may optionally follow.
+.It 67-09-10
 The year in an ISO-8601 date is always taken literally,
-so this is the year 69, not 2069.
+so this is the year 67, not 2067.
 .It 10/1/2000
 October 1, 2000; the common, but bizarre, US format.
 .It 20 Jun 1994
@@ -261,7 +295,14 @@ October 1, 2000; the common, but bizarre
 Other common abbreviations.
 .It 1/11
 The year can be omitted.
-This is the US month/day format.
+A missing year is taken from the
+.Ar \&*time
+value, or
+.Dq now
+if
+.Ar time
+is NULL.
+Again, this is the US month/day format (the 11th of January).
 .El
 .Pp
 Standard e-mail (RFC822, RFC2822, etc)
@@ -269,18 +310,28 @@ formats and the output from
 .Xr date 1 ,
 and
 .Xr asctime 3
-are all supported as input.
+are all supported as input,
+as is cvs date format (where years < 100 are treated as
+20th century).
 .Pp
-As well as times:
+Times can also be specified in common forms:
 .Bl -tag -compact -width 12:11:01.12
 .It 10:01
 .It 10:12pm
 .It 12:11:01.12
 .It 12:21-0500
 .El

CVS commit: src/sys/kern

2020-10-19 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Mon Oct 19 15:07:47 UTC 2020

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

Log Message:
This file does not contain any code written by cgd@

Delete the BSD 4-clause license.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/kern/sys_ptrace.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/sys_ptrace.c
diff -u src/sys/kern/sys_ptrace.c:1.8 src/sys/kern/sys_ptrace.c:1.9
--- src/sys/kern/sys_ptrace.c:1.8	Mon Oct 19 14:52:19 2020
+++ src/sys/kern/sys_ptrace.c	Mon Oct 19 15:07:47 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: sys_ptrace.c,v 1.8 2020/10/19 14:52:19 kamil Exp $	*/
+/*	$NetBSD: sys_ptrace.c,v 1.9 2020/10/19 15:07:47 kamil Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -68,46 +68,8 @@
  *	from: @(#)sys_process.c	8.1 (Berkeley) 6/10/93
  */
 
-/*-
- * Copyright (c) 1993 Jan-Simon Pendry.
- * Copyright (c) 1994 Christopher G. Demetriou.  All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Jan-Simon Pendry.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *notice, this list of conditions and the following disclaimer in the
- *documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *must display the following acknowledgement:
- *	This product includes software developed by the University of
- *	California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- *may be used to endorse or promote products derived from this software
- *without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- *	from: @(#)sys_process.c	8.1 (Berkeley) 6/10/93
- */
-
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sys_ptrace.c,v 1.8 2020/10/19 14:52:19 kamil Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sys_ptrace.c,v 1.9 2020/10/19 15:07:47 kamil Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ptrace.h"



CVS commit: src/tests/lib/libutil

2020-10-19 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Mon Oct 19 15:06:49 UTC 2020

Modified Files:
src/tests/lib/libutil: t_parsedate.c

Log Message:
Adapt for change to parsedate() which now follows POSIX and altered the
dividing line between 21st and 20th century conversions from 69/70 to
68/69.   Adapt the tests for this to conform.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/tests/lib/libutil/t_parsedate.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/lib/libutil/t_parsedate.c
diff -u src/tests/lib/libutil/t_parsedate.c:1.30 src/tests/lib/libutil/t_parsedate.c:1.31
--- src/tests/lib/libutil/t_parsedate.c:1.30	Wed Mar 22 05:35:33 2017
+++ src/tests/lib/libutil/t_parsedate.c	Mon Oct 19 15:06:49 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: t_parsedate.c,v 1.30 2017/03/22 05:35:33 kre Exp $ */
+/* $NetBSD: t_parsedate.c,v 1.31 2020/10/19 15:06:49 kre Exp $ */
 /*-
  * Copyright (c) 2010, 2015 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -29,7 +29,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: t_parsedate.c,v 1.30 2017/03/22 05:35:33 kre Exp $");
+__RCSID("$NetBSD: t_parsedate.c,v 1.31 2020/10/19 15:06:49 kre Exp $");
 
 #include 
 #include 
@@ -125,12 +125,12 @@ ATF_TC_HEAD(dates, tc)
 ATF_TC_BODY(dates, tc)
 {
 
+	parsecheck("9/10/68", NULL, NULL, localtime_r,
+		2068, 9, 10, 0, 0, 0); /* year < 69: add 2000 */
 	parsecheck("9/10/69", NULL, NULL, localtime_r,
-		2069, 9, 10, 0, 0, 0); /* year < 70: add 2000 */
-	parsecheck("9/10/70", NULL, NULL, localtime_r,
-		1970, 9, 10, 0, 0, 0); /* 70 <= year < 100: add 1900 */
-	parsecheck("69-09-10", NULL, NULL, localtime_r,
-		69, 9, 10, 0, 0, 0); /* ISO8601 year remains unchanged */
+		1969, 9, 10, 0, 0, 0); /* 69 <= year < 100: add 1900 */
+	parsecheck("68-09-10", NULL, NULL, localtime_r,
+		68, 9, 10, 0, 0, 0); /* ISO8601 year remains unchanged */
 	parsecheck("70-09-10", NULL, NULL, localtime_r,
 		70, 9, 10, 0, 0, 0); /* ISO8601 year remains unchanged */
 	parsecheck("2006-11-17", NULL, NULL, localtime_r,



CVS commit: src/lib/libutil

2020-10-19 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Mon Oct 19 15:05:53 UTC 2020

Modified Files:
src/lib/libutil: parsedate.y

Log Message:
POSIX requires that when converting 2 digit year representations to
actual specific years, values from 69-99 be treated as 20th century,
and values from 0-68 be treated as 21st century.  This allows for those
unfortunate enough to reside in a timezone west of Greenwich to convert
the epoch (or a time very close to it) to text, write that with just two
digits, and correctly convert it back to a time near the epoch, rather
than to something in 2069.

We used to split things so 0-69 were 21st century, and 70-99 were 20th.
Change that (this requires a change in the parsedate ATF tests which
test this specific boundary).

While here, add support for another POSIX requirement, that the radix
char before fractional seconds can be either a ',' or a '.'.  We used
to allow only '.', add support for ','.   This is something of a meaningless
change, as parsedate() returns a time_t in which there is no way to
represent fractional seconds, so there's little point in ever specifying
them regardless of what char is used for the "decimal point" - they will
be ignored anyway.But at least fractional seconds using a ',' as the
radix char will no longer cause the conversion to fail (or do something else
bizarre).


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/lib/libutil/parsedate.y

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

Modified files:

Index: src/lib/libutil/parsedate.y
diff -u src/lib/libutil/parsedate.y:1.32 src/lib/libutil/parsedate.y:1.33
--- src/lib/libutil/parsedate.y:1.32	Wed Mar 22 18:17:42 2017
+++ src/lib/libutil/parsedate.y	Mon Oct 19 15:05:53 2020
@@ -14,7 +14,7 @@
 
 #include 
 #ifdef __RCSID
-__RCSID("$NetBSD: parsedate.y,v 1.32 2017/03/22 18:17:42 kre Exp $");
+__RCSID("$NetBSD: parsedate.y,v 1.33 2020/10/19 15:05:53 kre Exp $");
 #endif
 
 #include 
@@ -249,7 +249,14 @@ time:
 		param->yyMinutes = $3;
 		param->yySeconds = $5;
 		param->yyMeridian = MER24;
-		/* XXX: Do nothing with millis */
+		/* XXX: Do nothing with fractional secs ($7) */
+	  }
+	| tUNUMBER ':' tUNUMBER ':' tUNUMBER ',' tUNUMBER {
+		param->yyHour = $1;
+		param->yyMinutes = $3;
+		param->yySeconds = $5;
+		param->yyMeridian = MER24;
+		/* XXX: Do nothing with fractional seconds ($7) */
 	  }
 	| tTIME {
 		param->yyHour = $1;
@@ -664,7 +671,8 @@ RelVal(struct dateinfo *param, time_t v,
  * e.g. convert 70 to 1970.
  * Input Year is either:
  *  - A negative number, which means to use its absolute value (why?)
- *  - A number from 0 to 99, which means a year from 1900 to 1999, or
+ *  - A number from 0 to 68, which means a year from 2000 to 2068, 
+ *  - A number from 69 to 99, which means a year from 1969 to 1999, or
  *  - The actual year (>=100).
  * Returns the full year.
  */
@@ -674,7 +682,7 @@ AdjustYear(time_t Year)
 /* XXX Y2K */
 if (Year < 0)
 	Year = -Year;
-if (Year < 70)
+if (Year < 69)	/* POSIX compliant, 0..68 is 2000's, 69-99 1900's */
 	Year += 2000;
 else if (Year < 100)
 	Year += 1900;



CVS commit: src/sys/kern

2020-10-19 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Mon Oct 19 14:52:19 UTC 2020

Modified Files:
src/sys/kern: sys_ptrace.c sys_ptrace_common.c

Log Message:
Rollback unintended changes in the previous commit


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/kern/sys_ptrace.c
cvs rdiff -u -r1.85 -r1.86 src/sys/kern/sys_ptrace_common.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/sys_ptrace.c
diff -u src/sys/kern/sys_ptrace.c:1.7 src/sys/kern/sys_ptrace.c:1.8
--- src/sys/kern/sys_ptrace.c:1.7	Mon Oct 19 14:47:01 2020
+++ src/sys/kern/sys_ptrace.c	Mon Oct 19 14:52:19 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: sys_ptrace.c,v 1.7 2020/10/19 14:47:01 kamil Exp $	*/
+/*	$NetBSD: sys_ptrace.c,v 1.8 2020/10/19 14:52:19 kamil Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -106,9 +106,8 @@
  *	from: @(#)sys_process.c	8.1 (Berkeley) 6/10/93
  */
 
-
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sys_ptrace.c,v 1.7 2020/10/19 14:47:01 kamil Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sys_ptrace.c,v 1.8 2020/10/19 14:52:19 kamil Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ptrace.h"
@@ -129,6 +128,7 @@ __KERNEL_RCSID(0, "$NetBSD: sys_ptrace.c
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -214,3 +214,26 @@ sys_ptrace(struct lwp *l, const struct s
 return do_ptrace(_ptm, l, SCARG(uap, req), SCARG(uap, pid),
 SCARG(uap, addr), SCARG(uap, data), retval);
 }
+
+#define	DEPS	"ptrace_common"  
+
+MODULE(MODULE_CLASS_EXEC, ptrace, DEPS);
+ 
+static int
+ptrace_modcmd(modcmd_t cmd, void *arg)
+{
+	int error;
+ 
+	switch (cmd) {
+	case MODULE_CMD_INIT: 
+		error = syscall_establish(_netbsd, ptrace_syscalls);
+		break;
+	case MODULE_CMD_FINI:
+		error = syscall_disestablish(_netbsd, ptrace_syscalls);
+		break;
+	default:
+		error = ENOTTY;
+		break;
+	}
+	return error;
+}

Index: src/sys/kern/sys_ptrace_common.c
diff -u src/sys/kern/sys_ptrace_common.c:1.85 src/sys/kern/sys_ptrace_common.c:1.86
--- src/sys/kern/sys_ptrace_common.c:1.85	Mon Oct 19 14:47:01 2020
+++ src/sys/kern/sys_ptrace_common.c	Mon Oct 19 14:52:19 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: sys_ptrace_common.c,v 1.85 2020/10/19 14:47:01 kamil Exp $	*/
+/*	$NetBSD: sys_ptrace_common.c,v 1.86 2020/10/19 14:52:19 kamil Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -106,9 +106,8 @@
  *	from: @(#)sys_process.c	8.1 (Berkeley) 6/10/93
  */
 
-
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sys_ptrace_common.c,v 1.85 2020/10/19 14:47:01 kamil Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sys_ptrace_common.c,v 1.86 2020/10/19 14:52:19 kamil Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ptrace.h"
@@ -135,6 +134,7 @@ __KERNEL_RCSID(0, "$NetBSD: sys_ptrace_c
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -1785,3 +1785,25 @@ process_auxv_offset(struct proc *p, stru
 	return 0;
 }
 #endif /* PTRACE */
+
+MODULE(MODULE_CLASS_EXEC, ptrace_common, NULL);
+ 
+static int
+ptrace_common_modcmd(modcmd_t cmd, void *arg)
+{
+int error;
+ 
+switch (cmd) {
+case MODULE_CMD_INIT:
+error = ptrace_init();
+break;
+case MODULE_CMD_FINI:
+error = ptrace_fini();
+break;
+default:
+		ptrace_hooks();
+error = ENOTTY;
+break;
+}
+return error;
+}



CVS commit: src/sys/kern

2020-10-19 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Mon Oct 19 14:47:01 UTC 2020

Modified Files:
src/sys/kern: sys_ptrace.c sys_ptrace_common.c

Log Message:
Remove obsolete references to 4.4BSD papers


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/kern/sys_ptrace.c
cvs rdiff -u -r1.84 -r1.85 src/sys/kern/sys_ptrace_common.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/sys_ptrace.c
diff -u src/sys/kern/sys_ptrace.c:1.6 src/sys/kern/sys_ptrace.c:1.7
--- src/sys/kern/sys_ptrace.c:1.6	Tue Dec 24 14:50:59 2019
+++ src/sys/kern/sys_ptrace.c	Mon Oct 19 14:47:01 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: sys_ptrace.c,v 1.6 2019/12/24 14:50:59 kamil Exp $	*/
+/*	$NetBSD: sys_ptrace.c,v 1.7 2020/10/19 14:47:01 kamil Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -106,19 +106,9 @@
  *	from: @(#)sys_process.c	8.1 (Berkeley) 6/10/93
  */
 
-/*
- * References:
- *	(1) Bach's "The Design of the UNIX Operating System",
- *	(2) sys/miscfs/procfs from UCB's 4.4BSD-Lite distribution,
- *	(3) the "4.4BSD Programmer's Reference Manual" published
- *		by USENIX and O'Reilly & Associates.
- * The 4.4BSD PRM does a reasonably good job of documenting what the various
- * ptrace() requests should actually do, and its text is quoted several times
- * in this file.
- */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sys_ptrace.c,v 1.6 2019/12/24 14:50:59 kamil Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sys_ptrace.c,v 1.7 2020/10/19 14:47:01 kamil Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ptrace.h"
@@ -139,7 +129,6 @@ __KERNEL_RCSID(0, "$NetBSD: sys_ptrace.c
 #include 
 #include 
 #include 
-#include 
 
 #include 
 
@@ -225,26 +214,3 @@ sys_ptrace(struct lwp *l, const struct s
 return do_ptrace(_ptm, l, SCARG(uap, req), SCARG(uap, pid),
 SCARG(uap, addr), SCARG(uap, data), retval);
 }
-
-#define	DEPS	"ptrace_common"  
-
-MODULE(MODULE_CLASS_EXEC, ptrace, DEPS);
- 
-static int
-ptrace_modcmd(modcmd_t cmd, void *arg)
-{
-	int error;
- 
-	switch (cmd) {
-	case MODULE_CMD_INIT: 
-		error = syscall_establish(_netbsd, ptrace_syscalls);
-		break;
-	case MODULE_CMD_FINI:
-		error = syscall_disestablish(_netbsd, ptrace_syscalls);
-		break;
-	default:
-		error = ENOTTY;
-		break;
-	}
-	return error;
-}

Index: src/sys/kern/sys_ptrace_common.c
diff -u src/sys/kern/sys_ptrace_common.c:1.84 src/sys/kern/sys_ptrace_common.c:1.85
--- src/sys/kern/sys_ptrace_common.c:1.84	Thu Oct 15 17:37:36 2020
+++ src/sys/kern/sys_ptrace_common.c	Mon Oct 19 14:47:01 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: sys_ptrace_common.c,v 1.84 2020/10/15 17:37:36 mgorny Exp $	*/
+/*	$NetBSD: sys_ptrace_common.c,v 1.85 2020/10/19 14:47:01 kamil Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -106,19 +106,9 @@
  *	from: @(#)sys_process.c	8.1 (Berkeley) 6/10/93
  */
 
-/*
- * References:
- *	(1) Bach's "The Design of the UNIX Operating System",
- *	(2) sys/miscfs/procfs from UCB's 4.4BSD-Lite distribution,
- *	(3) the "4.4BSD Programmer's Reference Manual" published
- *		by USENIX and O'Reilly & Associates.
- * The 4.4BSD PRM does a reasonably good job of documenting what the various
- * ptrace() requests should actually do, and its text is quoted several times
- * in this file.
- */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sys_ptrace_common.c,v 1.84 2020/10/15 17:37:36 mgorny Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sys_ptrace_common.c,v 1.85 2020/10/19 14:47:01 kamil Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ptrace.h"
@@ -145,7 +135,6 @@ __KERNEL_RCSID(0, "$NetBSD: sys_ptrace_c
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -1796,25 +1785,3 @@ process_auxv_offset(struct proc *p, stru
 	return 0;
 }
 #endif /* PTRACE */
-
-MODULE(MODULE_CLASS_EXEC, ptrace_common, NULL);
- 
-static int
-ptrace_common_modcmd(modcmd_t cmd, void *arg)
-{
-int error;
- 
-switch (cmd) {
-case MODULE_CMD_INIT:
-error = ptrace_init();
-break;
-case MODULE_CMD_FINI:
-error = ptrace_fini();
-break;
-default:
-		ptrace_hooks();
-error = ENOTTY;
-break;
-}
-return error;
-}



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

2020-10-19 Thread Tobias Nygren
Module Name:src
Committed By:   tnn
Date:   Mon Oct 19 13:44:25 UTC 2020

Modified Files:
src/sys/arch/arm/rockchip: rk_v1crypto.c

Log Message:
bus_space_write_4 does not have a return value


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/arm/rockchip/rk_v1crypto.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/rockchip/rk_v1crypto.c
diff -u src/sys/arch/arm/rockchip/rk_v1crypto.c:1.2 src/sys/arch/arm/rockchip/rk_v1crypto.c:1.3
--- src/sys/arch/arm/rockchip/rk_v1crypto.c:1.2	Sun May 17 20:29:39 2020
+++ src/sys/arch/arm/rockchip/rk_v1crypto.c	Mon Oct 19 13:44:25 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: rk_v1crypto.c,v 1.2 2020/05/17 20:29:39 riastradh Exp $	*/
+/*	$NetBSD: rk_v1crypto.c,v 1.3 2020/10/19 13:44:25 tnn Exp $	*/
 
 /*-
  * Copyright (c) 2020 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include 
-__KERNEL_RCSID(1, "$NetBSD: rk_v1crypto.c,v 1.2 2020/05/17 20:29:39 riastradh Exp $");
+__KERNEL_RCSID(1, "$NetBSD: rk_v1crypto.c,v 1.3 2020/10/19 13:44:25 tnn Exp $");
 
 #include 
 
@@ -82,7 +82,7 @@ RKC_READ(struct rk_v1crypto_softc *sc, b
 static void
 RKC_WRITE(struct rk_v1crypto_softc *sc, bus_addr_t reg, uint32_t v)
 {
-	return bus_space_write_4(sc->sc_bst, sc->sc_bsh, reg, v);
+	bus_space_write_4(sc->sc_bst, sc->sc_bsh, reg, v);
 }
 
 static inline void



CVS commit: src/external/gpl3/binutils/dist/gas/config

2020-10-19 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Oct 19 12:47:53 UTC 2020

Modified Files:
src/external/gpl3/binutils/dist/gas/config: tc-aarch64.c

Log Message:
Fix assembling "isb sy" for aarch64{,eb} on LP64BE architectures.
Cherry-picked from upstream:

https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=05cfb0d8cc9b7f8676f5ae55a93642f091d5405f;hp=0ec992e6647c00fc234cdf4c11732b6711b024af

Now, working kernel can be self-built on aarch64eb.

Thanks to ryo@ for fixing and upstreaming this!


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.6 -r1.2 \
src/external/gpl3/binutils/dist/gas/config/tc-aarch64.c

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

Modified files:

Index: src/external/gpl3/binutils/dist/gas/config/tc-aarch64.c
diff -u src/external/gpl3/binutils/dist/gas/config/tc-aarch64.c:1.1.1.6 src/external/gpl3/binutils/dist/gas/config/tc-aarch64.c:1.2
--- src/external/gpl3/binutils/dist/gas/config/tc-aarch64.c:1.1.1.6	Fri Apr  3 23:40:11 2020
+++ src/external/gpl3/binutils/dist/gas/config/tc-aarch64.c	Mon Oct 19 12:47:53 2020
@@ -250,12 +250,6 @@ set_fatal_syntax_error (const char *erro
 typedef struct
 {
   const char *template;
-  unsigned long value;
-} asm_barrier_opt;
-
-typedef struct
-{
-  const char *template;
   uint32_t value;
 } asm_nzcv;
 
@@ -3994,7 +3988,7 @@ static int
 parse_barrier (char **str)
 {
   char *p, *q;
-  const asm_barrier_opt *o;
+  const struct aarch64_name_value_pair *o;
 
   p = q = *str;
   while (ISALPHA (*q))



CVS commit: src/crypto/external/bsd/openssl/include/openssl

2020-10-19 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Oct 19 12:46:04 UTC 2020

Modified Files:
src/crypto/external/bsd/openssl/include/openssl: opensslconf.h

Log Message:
Define OPENSSL_NO_EC_NISTP_64_GCC_128 also for aarch64eb.

Fix ssh-keygen(1) on aarch64eb. Also, all tests in tests/crypto pass
with this change.

As martin pointed out when this macro was defined for sparc64,

http://cvsweb.netbsd.org/bsdweb.cgi/src/crypto/external/bsd/openssl/include/openssl/opensslconf.h#rev1.5

this code seems broken on LP64BE architectures.

At the moment, mips64eb is not affected since only N32 is supported as
userland. Also, we do not support powerpc64 (eb) yet. But we may need to
take care of them in future.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 \
src/crypto/external/bsd/openssl/include/openssl/opensslconf.h

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

Modified files:

Index: src/crypto/external/bsd/openssl/include/openssl/opensslconf.h
diff -u src/crypto/external/bsd/openssl/include/openssl/opensslconf.h:1.8 src/crypto/external/bsd/openssl/include/openssl/opensslconf.h:1.9
--- src/crypto/external/bsd/openssl/include/openssl/opensslconf.h:1.8	Thu Oct  8 16:00:09 2020
+++ src/crypto/external/bsd/openssl/include/openssl/opensslconf.h	Mon Oct 19 12:46:04 2020
@@ -50,7 +50,12 @@ extern "C" {
 #  define OPENSSL_NO_DEVCRYPTOENG
 # endif
 #endif
-#if !defined(_LP64) || defined(__alpha__) || defined(__sparc64__)
+/*
+ * XXX
+ * This seems broken on big-endian or strictly-aligned architectures.
+ */
+#if !defined(_LP64) || \
+defined(__AARCH64EB__) || defined(__alpha__) || defined(__sparc64__)
 # ifndef OPENSSL_NO_EC_NISTP_64_GCC_128
 #  define OPENSSL_NO_EC_NISTP_64_GCC_128
 # endif



CVS commit: src/sys/external/bsd/common/include/linux

2020-10-19 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Oct 19 11:49:56 UTC 2020

Modified Files:
src/sys/external/bsd/common/include/linux: kernel.h

Log Message:
Define __BIG_ENDIAN or __LITTLE_ENDIAN depending on target endianness


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/sys/external/bsd/common/include/linux/kernel.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/external/bsd/common/include/linux/kernel.h
diff -u src/sys/external/bsd/common/include/linux/kernel.h:1.25 src/sys/external/bsd/common/include/linux/kernel.h:1.26
--- src/sys/external/bsd/common/include/linux/kernel.h:1.25	Fri Feb 14 14:34:57 2020
+++ src/sys/external/bsd/common/include/linux/kernel.h	Mon Oct 19 11:49:56 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: kernel.h,v 1.25 2020/02/14 14:34:57 maya Exp $	*/
+/*	$NetBSD: kernel.h,v 1.26 2020/10/19 11:49:56 jmcneill Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -36,6 +36,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -53,6 +54,12 @@
 
 #define	oops_in_progress	(panicstr != NULL)
 
+#if BYTE_ORDER == BIG_ENDIAN
+#define	__BIG_ENDIAN		_BIG_ENDIAN
+#else
+#define	__LITTLE_ENDIAN		_LITTLE_ENDIAN
+#endif
+
 #define	IS_ENABLED(option)	(option)
 #define	IS_BUILTIN(option)	(1) /* Probably... */
 



CVS commit: src/lib/libc/arch/i386/sys

2020-10-19 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Mon Oct 19 11:31:02 UTC 2020

Modified Files:
src/lib/libc/arch/i386/sys: __sigtramp2.S

Log Message:
Restore ESP from mcontext

Improves unwinding of multiple frames without base pointer.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/lib/libc/arch/i386/sys/__sigtramp2.S

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

Modified files:

Index: src/lib/libc/arch/i386/sys/__sigtramp2.S
diff -u src/lib/libc/arch/i386/sys/__sigtramp2.S:1.6 src/lib/libc/arch/i386/sys/__sigtramp2.S:1.7
--- src/lib/libc/arch/i386/sys/__sigtramp2.S:1.6	Mon Oct 12 23:56:08 2020
+++ src/lib/libc/arch/i386/sys/__sigtramp2.S	Mon Oct 19 11:31:01 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: __sigtramp2.S,v 1.6 2020/10/12 23:56:08 kamil Exp $	*/
+/*	$NetBSD: __sigtramp2.S,v 1.7 2020/10/19 11:31:01 kamil Exp $	*/
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -57,7 +57,7 @@
 	.cfi_offset ecx, UC_GREGS_ECX
 	.cfi_offset edx, UC_GREGS_EDX
 	.cfi_offset ebx, UC_GREGS_EBX
-	/* The unwinder will use the CFA to restore ESP. */
+	.cfi_offset esp, UC_GREGS_ESP
 	.cfi_offset ebp, UC_GREGS_EBP
 	.cfi_offset esi, UC_GREGS_ESI
 	.cfi_offset edi, UC_GREGS_EDI



CVS commit: src/lib/libc/arch/x86_64/sys

2020-10-19 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Mon Oct 19 11:29:26 UTC 2020

Modified Files:
src/lib/libc/arch/x86_64/sys: __sigtramp2.S

Log Message:
Restore RSP from mcontext

Fixes unwinding of multiple frames without base pointer.

Patch by: Nikhil Benesch via PR lib/55719


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/lib/libc/arch/x86_64/sys/__sigtramp2.S

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

Modified files:

Index: src/lib/libc/arch/x86_64/sys/__sigtramp2.S
diff -u src/lib/libc/arch/x86_64/sys/__sigtramp2.S:1.8 src/lib/libc/arch/x86_64/sys/__sigtramp2.S:1.9
--- src/lib/libc/arch/x86_64/sys/__sigtramp2.S:1.8	Mon Oct 12 17:55:54 2020
+++ src/lib/libc/arch/x86_64/sys/__sigtramp2.S	Mon Oct 19 11:29:26 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: __sigtramp2.S,v 1.8 2020/10/12 17:55:54 kamil Exp $	*/
+/*	$NetBSD: __sigtramp2.S,v 1.9 2020/10/19 11:29:26 kamil Exp $	*/
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -58,7 +58,7 @@
 	.cfi_offset rsi, UC_GREGS_RSI
 	.cfi_offset rdi, UC_GREGS_RDI
 	.cfi_offset rbp, UC_GREGS_RBP
-	/* The unwinder will use the CFA to restore RSP. */
+	.cfi_offset rsp, UC_GREGS_RSP
 	.cfi_offset r8,  UC_GREGS_R8
 	.cfi_offset r9,  UC_GREGS_R9
 	.cfi_offset r10, UC_GREGS_R10



CVS commit: src/lib/libossaudio

2020-10-19 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Mon Oct 19 10:28:47 UTC 2020

Modified Files:
src/lib/libossaudio: ossaudio.c soundcard.h

Log Message:
ossaudio(3): add some no-op defines for ossv4 compat.


To generate a diff of this commit:
cvs rdiff -u -r1.51 -r1.52 src/lib/libossaudio/ossaudio.c
cvs rdiff -u -r1.27 -r1.28 src/lib/libossaudio/soundcard.h

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

Modified files:

Index: src/lib/libossaudio/ossaudio.c
diff -u src/lib/libossaudio/ossaudio.c:1.51 src/lib/libossaudio/ossaudio.c:1.52
--- src/lib/libossaudio/ossaudio.c:1.51	Mon Oct 19 09:07:29 2020
+++ src/lib/libossaudio/ossaudio.c	Mon Oct 19 10:28:47 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: ossaudio.c,v 1.51 2020/10/19 09:07:29 nia Exp $	*/
+/*	$NetBSD: ossaudio.c,v 1.52 2020/10/19 10:28:47 nia Exp $	*/
 
 /*-
  * Copyright (c) 1997, 2020 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: ossaudio.c,v 1.51 2020/10/19 09:07:29 nia Exp $");
+__RCSID("$NetBSD: ossaudio.c,v 1.52 2020/10/19 10:28:47 nia Exp $");
 
 /*
  * This is an Open Sound System compatibility layer, which provides
@@ -37,7 +37,7 @@ __RCSID("$NetBSD: ossaudio.c,v 1.51 2020
  * http://manuals.opensound.com/developer/
  * 
  * This file is similar to sys/compat/ossaudio.c with additional OSSv4
- * compatibility - with some preprocessor magic it could be the same file.
+ * compatibility.
  */
 
 #include 
@@ -79,6 +79,7 @@ static void setblocksize(int, struct aud
 static int audio_ioctl(int, unsigned long, void *);
 static int mixer_oss3_ioctl(int, unsigned long, void *);
 static int mixer_oss4_ioctl(int, unsigned long, void *);
+static int global_oss4_ioctl(int, unsigned long, void *);
 static int opaque_to_enum(struct audiodevinfo *, audio_mixer_name_t *, int);
 static int enum_to_ord(struct audiodevinfo *, int);
 static int enum_to_mask(struct audiodevinfo *, int);
@@ -101,6 +102,8 @@ _oss_ioctl(int fd, unsigned long com, ..
 		return mixer_oss3_ioctl(fd, com, argp);
 	else if (IOCGROUP(com) == 'X')
 		return mixer_oss4_ioctl(fd, com, argp);
+	else if (IOCGROUP(com) == 'Y')
+		return global_oss4_ioctl(fd, com, argp);
 	else
 		return ioctl(fd, com, argp);
 }
@@ -1515,6 +1518,37 @@ mixer_oss4_ioctl(int fd, unsigned long c
 }
 
 static int
+global_oss4_ioctl(int fd, unsigned long com, void *argp)
+{
+	int retval = 0;
+
+	switch (com) {
+	/*
+	 * These ioctls were added in OSSv4 with the idea that
+	 * applications could apply strings to audio devices to
+	 * display what they are using them for (e.g. with song
+	 * names) in mixer applications. In practice, the popular
+	 * implementations of the API in FreeBSD and Solaris treat
+	 * these as a no-op and return EINVAL, and no software in the
+	 * wild seems to use them.
+	 */
+	case SNDCTL_SETSONG:
+	case SNDCTL_GETSONG:
+	case SNDCTL_SETNAME:
+	case SNDCTL_SETLABEL:
+	case SNDCTL_GETLABEL:
+		errno = EINVAL;
+		retval = -1;
+		break;
+	default:
+		errno = EINVAL;
+		retval = -1;
+		break;
+	}
+	return retval;
+}
+
+static int
 getmixercount(void)
 {
 	char devname[32];

Index: src/lib/libossaudio/soundcard.h
diff -u src/lib/libossaudio/soundcard.h:1.27 src/lib/libossaudio/soundcard.h:1.28
--- src/lib/libossaudio/soundcard.h:1.27	Mon Oct 19 09:01:24 2020
+++ src/lib/libossaudio/soundcard.h	Mon Oct 19 10:28:47 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: soundcard.h,v 1.27 2020/10/19 09:01:24 nia Exp $	*/
+/*	$NetBSD: soundcard.h,v 1.28 2020/10/19 10:28:47 nia Exp $	*/
 
 /*-
  * Copyright (c) 1997, 2020 The NetBSD Foundation, Inc.
@@ -475,6 +475,10 @@ typedef char oss_id_t[OSS_ID_SIZE];
 typedef char oss_devnode_t[OSS_DEVNODE_SIZE];
 #define OSS_HANDLE_SIZE		32
 typedef char oss_handle_t[OSS_HANDLE_SIZE];
+#define	OSS_LONGNAME_SIZE	64
+typedef char oss_longname_t[OSS_LONGNAME_SIZE];
+#define	OSS_LABEL_SIZE		16
+typedef char oss_label_t[OSS_LABEL_SIZE];
 
 typedef struct oss_mixext_root {
 	oss_id_t id;
@@ -542,6 +546,17 @@ typedef struct oss_mixext {
 	int filler[6];
 } oss_mixext;
 
+
+/*
+ * These are no-ops on FreeBSD, NetBSD, and Solaris,
+ * but are defined for compatibility with OSSv4.
+ */
+#define SNDCTL_SETSONG		_IOW ('Y',2, oss_longname_t)
+#define SNDCTL_GETSONG		_IOR ('Y',2, oss_longname_t)
+#define SNDCTL_SETNAME		_IOW ('Y',3, oss_longname_t)
+#define SNDCTL_SETLABEL		_IOW ('Y',4, oss_label_t)
+#define SNDCTL_GETLABEL		_IOR ('Y',4, oss_label_t)
+
 #define ioctl _oss_ioctl
 /*
  * If we already included , then we define our own prototype,



CVS commit: src/lib/libossaudio

2020-10-19 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Mon Oct 19 09:07:29 UTC 2020

Modified Files:
src/lib/libossaudio: ossaudio.c

Log Message:
ossaudio(3): these ioctls need to return samples, not bytes


To generate a diff of this commit:
cvs rdiff -u -r1.50 -r1.51 src/lib/libossaudio/ossaudio.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/libossaudio/ossaudio.c
diff -u src/lib/libossaudio/ossaudio.c:1.50 src/lib/libossaudio/ossaudio.c:1.51
--- src/lib/libossaudio/ossaudio.c:1.50	Mon Oct 19 09:01:24 2020
+++ src/lib/libossaudio/ossaudio.c	Mon Oct 19 09:07:29 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: ossaudio.c,v 1.50 2020/10/19 09:01:24 nia Exp $	*/
+/*	$NetBSD: ossaudio.c,v 1.51 2020/10/19 09:07:29 nia Exp $	*/
 
 /*-
  * Copyright (c) 1997, 2020 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: ossaudio.c,v 1.50 2020/10/19 09:01:24 nia Exp $");
+__RCSID("$NetBSD: ossaudio.c,v 1.51 2020/10/19 09:07:29 nia Exp $");
 
 /*
  * This is an Open Sound System compatibility layer, which provides
@@ -584,8 +584,12 @@ audio_ioctl(int fd, unsigned long com, v
 			return retval;
 		/* XXX: 'samples' may wrap */
 		memset(osscount.filler, 0, sizeof(osscount.filler));
-		osscount.samples = tmpinfo.record.samples;
-		osscount.fifo_samples = tmpinfo.record.seek;
+		osscount.samples = tmpinfo.record.samples /
+		((tmpinfo.record.precision / NBBY) *
+			tmpinfo.record.channels);
+		osscount.fifo_samples = tmpinfo.record.seek /
+		((tmpinfo.record.precision / NBBY) *
+			tmpinfo.record.channels);
 		*(oss_count_t *)argp = osscount;
 		break;
 	case SNDCTL_DSP_GETOPTR:
@@ -603,8 +607,12 @@ audio_ioctl(int fd, unsigned long com, v
 			return retval;
 		/* XXX: 'samples' may wrap */
 		memset(osscount.filler, 0, sizeof(osscount.filler));
-		osscount.samples = tmpinfo.play.samples;
-		osscount.fifo_samples = tmpinfo.play.seek;
+		osscount.samples = tmpinfo.play.samples /
+		((tmpinfo.play.precision / NBBY) *
+			tmpinfo.play.channels);
+		osscount.fifo_samples = tmpinfo.play.seek /
+		((tmpinfo.play.precision / NBBY) *
+			tmpinfo.play.channels);
 		*(oss_count_t *)argp = osscount;
 		break;
 	case SNDCTL_DSP_SETPLAYVOL:



CVS commit: src/lib/libossaudio

2020-10-19 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Mon Oct 19 09:01:24 UTC 2020

Modified Files:
src/lib/libossaudio: ossaudio.c soundcard.h

Log Message:
ossaudio(3): Add SNDCTL_DSP_CURRENT_(I|O)PTR

In OSSv4 these are supposed to avoid the wrapping problems with the
older GET(I|O)PTR ioctls but we don't quite get the same benefit here.

XXX: We could probably fake it by maintaining some state in-between calls.


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/lib/libossaudio/ossaudio.c
cvs rdiff -u -r1.26 -r1.27 src/lib/libossaudio/soundcard.h

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

Modified files:

Index: src/lib/libossaudio/ossaudio.c
diff -u src/lib/libossaudio/ossaudio.c:1.49 src/lib/libossaudio/ossaudio.c:1.50
--- src/lib/libossaudio/ossaudio.c:1.49	Sat Oct 17 23:23:06 2020
+++ src/lib/libossaudio/ossaudio.c	Mon Oct 19 09:01:24 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: ossaudio.c,v 1.49 2020/10/17 23:23:06 nia Exp $	*/
+/*	$NetBSD: ossaudio.c,v 1.50 2020/10/19 09:01:24 nia Exp $	*/
 
 /*-
  * Copyright (c) 1997, 2020 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: ossaudio.c,v 1.49 2020/10/17 23:23:06 nia Exp $");
+__RCSID("$NetBSD: ossaudio.c,v 1.50 2020/10/19 09:01:24 nia Exp $");
 
 /*
  * This is an Open Sound System compatibility layer, which provides
@@ -121,6 +121,7 @@ audio_ioctl(int fd, unsigned long com, v
 	int perrors, rerrors;
 	static int totalperrors = 0;
 	static int totalrerrors = 0;
+	oss_count_t osscount;
 	int idat, idata;
 	int retval;
 
@@ -577,6 +578,16 @@ audio_ioctl(int fd, unsigned long com, v
 		cntinfo.ptr = tmpoffs.offset;
 		*(struct count_info *)argp = cntinfo;
 		break;
+	case SNDCTL_DSP_CURRENT_IPTR:
+		retval = ioctl(fd, AUDIO_GETBUFINFO, );
+		if (retval < 0)
+			return retval;
+		/* XXX: 'samples' may wrap */
+		memset(osscount.filler, 0, sizeof(osscount.filler));
+		osscount.samples = tmpinfo.record.samples;
+		osscount.fifo_samples = tmpinfo.record.seek;
+		*(oss_count_t *)argp = osscount;
+		break;
 	case SNDCTL_DSP_GETOPTR:
 		retval = ioctl(fd, AUDIO_GETOOFFS, );
 		if (retval < 0)
@@ -586,6 +597,16 @@ audio_ioctl(int fd, unsigned long com, v
 		cntinfo.ptr = tmpoffs.offset;
 		*(struct count_info *)argp = cntinfo;
 		break;
+	case SNDCTL_DSP_CURRENT_OPTR:
+		retval = ioctl(fd, AUDIO_GETBUFINFO, );
+		if (retval < 0)
+			return retval;
+		/* XXX: 'samples' may wrap */
+		memset(osscount.filler, 0, sizeof(osscount.filler));
+		osscount.samples = tmpinfo.play.samples;
+		osscount.fifo_samples = tmpinfo.play.seek;
+		*(oss_count_t *)argp = osscount;
+		break;
 	case SNDCTL_DSP_SETPLAYVOL:
 		setvol(fd, INTARG, false);
 		/* FALLTHRU */

Index: src/lib/libossaudio/soundcard.h
diff -u src/lib/libossaudio/soundcard.h:1.26 src/lib/libossaudio/soundcard.h:1.27
--- src/lib/libossaudio/soundcard.h:1.26	Sat Oct 17 23:23:06 2020
+++ src/lib/libossaudio/soundcard.h	Mon Oct 19 09:01:24 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: soundcard.h,v 1.26 2020/10/17 23:23:06 nia Exp $	*/
+/*	$NetBSD: soundcard.h,v 1.27 2020/10/19 09:01:24 nia Exp $	*/
 
 /*-
  * Copyright (c) 1997, 2020 The NetBSD Foundation, Inc.
@@ -326,6 +326,14 @@ typedef struct buffmem_desc {
 #define SNDCTL_DSP_SILENCE		_IO ('P',32)
 #define SNDCTL_DSP_COOKEDMODE		_IOW ('P',33, int)
 #define SNDCTL_DSP_GETERROR		_IOR ('P',34, struct audio_errinfo)
+#define SNDCTL_DSP_CURRENT_IPTR		_IOR ('P',35, oss_count_t)
+#define SNDCTL_DSP_CURRENT_OPTR		_IOR ('P',36, oss_count_t)
+
+typedef struct {
+	long long samples;
+	int fifo_samples;
+	int filler[32];			/* "Future use" */
+} oss_count_t;
 
 typedef struct audio_errinfo {
 	int play_underruns;



CVS commit: src/external/gpl3/gcc/dist/libcpp

2020-10-19 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Mon Oct 19 07:44:52 UTC 2020

Modified Files:
src/external/gpl3/gcc/dist/libcpp: macro.c

Log Message:
Remove unused local diff. Pointed out by htodd.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/external/gpl3/gcc/dist/libcpp/macro.c

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

Modified files:

Index: src/external/gpl3/gcc/dist/libcpp/macro.c
diff -u src/external/gpl3/gcc/dist/libcpp/macro.c:1.11 src/external/gpl3/gcc/dist/libcpp/macro.c:1.12
--- src/external/gpl3/gcc/dist/libcpp/macro.c:1.11	Sat Sep  5 09:12:29 2020
+++ src/external/gpl3/gcc/dist/libcpp/macro.c	Mon Oct 19 07:44:52 2020
@@ -406,33 +406,6 @@ add_cpp_remap_path (const char *arg)
 	++remap_pairs;
 }
 
-static const char *
-cpp_remap_file (const char *arg, char **tmp_name)
-{
-	char *result;
-	size_t i, len;
-
-	for (i = 0; i < remap_pairs; ++i) {
-		len = strlen (remap_src[i]);
-		if (strncmp (remap_src[i], arg, len))
-			continue;
-		if (arg[len] == '\0')
-			return remap_dst[i];
-		if (arg[len] != '/')
-			continue;
-		arg += len;
-		len = strlen (remap_dst[i]);
-		result = (char *) xmalloc (len + strlen (arg) + 1);
-		memcpy(result, remap_dst[i], len);
-		strcpy(result + len, arg);
-		*tmp_name = result;
-
-		return result;
-	}
-
-	return arg;
-}
-
 /* Helper function for builtin_macro.  Returns the text generated by
a builtin macro. */
 const uchar *