CVS commit: src/usr.bin/make

2021-04-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Apr  3 23:24:06 UTC 2021

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

Log Message:
make: move VarEvalFlags_ToString down to the other functions

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.903 -r1.904 src/usr.bin/make/var.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/var.c
diff -u src/usr.bin/make/var.c:1.903 src/usr.bin/make/var.c:1.904
--- src/usr.bin/make/var.c:1.903	Sat Apr  3 23:19:08 2021
+++ src/usr.bin/make/var.c	Sat Apr  3 23:24:06 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: var.c,v 1.903 2021/04/03 23:19:08 rillig Exp $	*/
+/*	$NetBSD: var.c,v 1.904 2021/04/03 23:24:06 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -140,7 +140,7 @@
 #include "metachar.h"
 
 /*	"@(#)var.c	8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: var.c,v 1.903 2021/04/03 23:19:08 rillig Exp $");
+MAKE_RCSID("$NetBSD: var.c,v 1.904 2021/04/03 23:24:06 rillig Exp $");
 
 /*
  * Variables are defined using one of the VAR=value assignments.  Their
@@ -256,26 +256,6 @@ typedef struct SepBuf {
 	char sep;
 } SepBuf;
 
-static const char *
-VarEvalFlags_ToString(VarEvalFlags eflags)
-{
-	if (!eflags.wantRes) {
-		assert(!eflags.undefErr);
-		assert(!eflags.keepDollar && !eflags.keepUndef);
-		return "parse-only";
-	}
-	if (eflags.undefErr) {
-		assert(!eflags.keepDollar && !eflags.keepUndef);
-		return "eval-defined";
-	}
-	if (eflags.keepDollar && eflags.keepUndef)
-		return "eval-keep-dollar-and-undefined";
-	if (eflags.keepDollar)
-		return "eval-keep-dollar";
-	if (eflags.keepUndef)
-		return "eval-keep-undefined";
-	return "eval";
-}
 
 /*
  * This lets us tell if we have replaced the original environ
@@ -339,6 +319,27 @@ GNode *SCOPE_INTERNAL;
 static VarExportedMode var_exportedVars = VAR_EXPORTED_NONE;
 
 
+static const char *
+VarEvalFlags_ToString(VarEvalFlags eflags)
+{
+	if (!eflags.wantRes) {
+		assert(!eflags.undefErr);
+		assert(!eflags.keepDollar && !eflags.keepUndef);
+		return "parse-only";
+	}
+	if (eflags.undefErr) {
+		assert(!eflags.keepDollar && !eflags.keepUndef);
+		return "eval-defined";
+	}
+	if (eflags.keepDollar && eflags.keepUndef)
+		return "eval-keep-dollar-and-undefined";
+	if (eflags.keepDollar)
+		return "eval-keep-dollar";
+	if (eflags.keepUndef)
+		return "eval-keep-undefined";
+	return "eval";
+}
+
 static Var *
 VarNew(FStr name, const char *value, bool fromEnv, bool readOnly)
 {



CVS commit: src/usr.bin/make

2021-04-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Apr  3 23:24:06 UTC 2021

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

Log Message:
make: move VarEvalFlags_ToString down to the other functions

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.903 -r1.904 src/usr.bin/make/var.c

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



CVS commit: src/usr.bin/make

2021-04-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Apr  3 23:19:09 UTC 2021

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

Log Message:
make: condense definition of VarPatternFlags

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.902 -r1.903 src/usr.bin/make/var.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/var.c
diff -u src/usr.bin/make/var.c:1.902 src/usr.bin/make/var.c:1.903
--- src/usr.bin/make/var.c:1.902	Sat Apr  3 23:15:52 2021
+++ src/usr.bin/make/var.c	Sat Apr  3 23:19:08 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: var.c,v 1.902 2021/04/03 23:15:52 rillig Exp $	*/
+/*	$NetBSD: var.c,v 1.903 2021/04/03 23:19:08 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -140,7 +140,7 @@
 #include "metachar.h"
 
 /*	"@(#)var.c	8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: var.c,v 1.902 2021/04/03 23:15:52 rillig Exp $");
+MAKE_RCSID("$NetBSD: var.c,v 1.903 2021/04/03 23:19:08 rillig Exp $");
 
 /*
  * Variables are defined using one of the VAR=value assignments.  Their
@@ -242,15 +242,10 @@ typedef enum UnexportWhat {
 
 /* Flags for pattern matching in the :S and :C modifiers */
 typedef struct VarPatternFlags {
-
-	/* Replace as often as possible ('g') */
-	bool subGlobal: 1;
-	/* Replace only once ('1') */
-	bool subOnce: 1;
-	/* Match at start of word ('^') */
-	bool anchorStart: 1;
-	/* Match at end of word ('$') */
-	bool anchorEnd: 1;
+	bool subGlobal: 1;	/* 'g': replace as often as possible */
+	bool subOnce: 1;	/* '1': replace only once */
+	bool anchorStart: 1;	/* '^': match only at start of word */
+	bool anchorEnd: 1;	/* '$': match only at end of word */
 } VarPatternFlags;
 
 /* SepBuf builds a string from words interleaved with separators. */



CVS commit: src/usr.bin/make

2021-04-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Apr  3 23:19:09 UTC 2021

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

Log Message:
make: condense definition of VarPatternFlags

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.902 -r1.903 src/usr.bin/make/var.c

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



CVS commit: src/usr.bin/make

2021-04-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Apr  3 23:15:52 UTC 2021

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

Log Message:
make: inline VarFlags into Var

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.901 -r1.902 src/usr.bin/make/var.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/var.c
diff -u src/usr.bin/make/var.c:1.901 src/usr.bin/make/var.c:1.902
--- src/usr.bin/make/var.c:1.901	Sat Apr  3 23:08:30 2021
+++ src/usr.bin/make/var.c	Sat Apr  3 23:15:52 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: var.c,v 1.901 2021/04/03 23:08:30 rillig Exp $	*/
+/*	$NetBSD: var.c,v 1.902 2021/04/03 23:15:52 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -140,48 +140,7 @@
 #include "metachar.h"
 
 /*	"@(#)var.c	8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: var.c,v 1.901 2021/04/03 23:08:30 rillig Exp $");
-
-typedef struct VarFlags {
-	/*
-	 * The variable's value is currently being used by Var_Parse or
-	 * Var_Subst.  This marker is used to avoid endless recursion.
-	 */
-	bool inUse: 1;
-
-	/*
-	 * The variable comes from the environment.
-	 * These variables are not registered in any GNode, therefore they
-	 * must be freed as soon as they are not used anymore.
-	 */
-	bool fromEnv: 1;
-
-	/*
-	 * The variable is exported to the environment, to be used by child
-	 * processes.
-	 */
-	bool exported: 1;
-
-	/*
-	 * At the point where this variable was exported, it contained an
-	 * unresolved reference to another variable.  Before any child
-	 * process is started, it needs to be exported again, in the hope
-	 * that the referenced variable can then be resolved.
-	 */
-	bool reexport: 1;
-
-	/* The variable came from the command line. */
-	bool fromCmd: 1;
-
-	/*
-	 * The variable value cannot be changed anymore, and the variable
-	 * cannot be deleted.  Any attempts to do so are silently ignored,
-	 * they are logged with -dv though.
-	 *
-	 * See VAR_SET_READONLY.
-	 */
-	bool readOnly: 1;
-} VarFlags;
+MAKE_RCSID("$NetBSD: var.c,v 1.902 2021/04/03 23:15:52 rillig Exp $");
 
 /*
  * Variables are defined using one of the VAR=value assignments.  Their
@@ -212,8 +171,45 @@ typedef struct Var {
 
 	/* The unexpanded value of the variable. */
 	Buffer val;
-	/* Miscellaneous status flags. */
-	VarFlags flags;
+
+	/* The variable came from the command line. */
+	bool fromCmd: 1;
+
+	/*
+	 * The variable comes from the environment.
+	 * These variables are not registered in any GNode, therefore they
+	 * must be freed as soon as they are not used anymore.
+	 */
+	bool fromEnv: 1;
+
+	/*
+	 * The variable value cannot be changed anymore, and the variable
+	 * cannot be deleted.  Any attempts to do so are silently ignored,
+	 * they are logged with -dv though.
+	 *
+	 * See VAR_SET_READONLY.
+	 */
+	bool readOnly: 1;
+
+	/*
+	* The variable's value is currently being used by Var_Parse or
+	* Var_Subst.  This marker is used to avoid endless recursion.
+	*/
+	bool inUse: 1;
+
+	/*
+	 * The variable is exported to the environment, to be used by child
+	 * processes.
+	 */
+	bool exported: 1;
+
+	/*
+	 * At the point where this variable was exported, it contained an
+	 * unresolved reference to another variable.  Before any child
+	 * process is started, it needs to be exported again, in the hope
+	 * that the referenced variable can then be resolved.
+	 */
+	bool reexport: 1;
 } Var;
 
 /*
@@ -352,14 +348,16 @@ static Var *
 VarNew(FStr name, const char *value, bool fromEnv, bool readOnly)
 {
 	size_t value_len = strlen(value);
-	VarFlags vflags = { false, false, false, false, false, false };
 	Var *var = bmake_malloc(sizeof *var);
 	var->name = name;
 	Buf_InitSize(>val, value_len + 1);
 	Buf_AddBytes(>val, value, value_len);
-	vflags.fromEnv = fromEnv;
-	vflags.readOnly = readOnly;
-	var->flags = vflags;
+	var->fromCmd = false;
+	var->fromEnv = fromEnv;
+	var->readOnly = readOnly;
+	var->inUse = false;
+	var->exported = false;
+	var->reexport = false;
 	return var;
 }
 
@@ -478,7 +476,7 @@ VarFind(const char *name, GNode *scope, 
 static void
 VarFreeEnv(Var *v)
 {
-	if (!v->flags.fromEnv)
+	if (!v->fromEnv)
 		return;
 
 	FStr_Done(>name);
@@ -515,7 +513,7 @@ Var_Delete(GNode *scope, const char *var
 
 	DEBUG2(VAR, "%s:delete %s\n", scope->name, varname);
 	v = he->value;
-	if (v->flags.exported)
+	if (v->exported)
 		unsetenv(v->name.str);
 	if (strcmp(v->name.str, MAKE_EXPORTED) == 0)
 		var_exportedVars = VAR_EXPORTED_NONE;
@@ -616,16 +614,16 @@ ExportVarEnv(Var *v)
 	char *val = v->val.data;
 	char *expr;
 
-	if (v->flags.exported && !v->flags.reexport)
+	if (v->exported && !v->reexport)
 		return false;	/* nothing to do */
 
 	if (strchr(val, '$') == NULL) {
-		if (!v->flags.exported)
+		if (!v->exported)
 			setenv(name, val, 1);
 		return true;
 	}
 
-	if (v->flags.inUse) {
+	if (v->inUse) {
 		/*
 		 * We recursed while exporting in a child.

CVS commit: src/usr.bin/make

2021-04-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Apr  3 23:15:52 UTC 2021

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

Log Message:
make: inline VarFlags into Var

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.901 -r1.902 src/usr.bin/make/var.c

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



CVS commit: src/usr.bin/make

2021-04-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Apr  3 23:08:30 UTC 2021

Modified Files:
src/usr.bin/make: var.c
src/usr.bin/make/unit-tests: directive-export-impl.exp
directive-export-impl.mk

Log Message:
make: replace enum bit-set with struct bit-fields

This makes the code easier to read, especially when setting one of the
flags to false.

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.900 -r1.901 src/usr.bin/make/var.c
cvs rdiff -u -r1.6 -r1.7 \
src/usr.bin/make/unit-tests/directive-export-impl.exp
cvs rdiff -u -r1.2 -r1.3 src/usr.bin/make/unit-tests/directive-export-impl.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/var.c
diff -u src/usr.bin/make/var.c:1.900 src/usr.bin/make/var.c:1.901
--- src/usr.bin/make/var.c:1.900	Sat Apr  3 22:06:23 2021
+++ src/usr.bin/make/var.c	Sat Apr  3 23:08:30 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: var.c,v 1.900 2021/04/03 22:06:23 rillig Exp $	*/
+/*	$NetBSD: var.c,v 1.901 2021/04/03 23:08:30 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -140,29 +140,27 @@
 #include "metachar.h"
 
 /*	"@(#)var.c	8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: var.c,v 1.900 2021/04/03 22:06:23 rillig Exp $");
-
-typedef enum VarFlags {
-	VFL_NONE	= 0,
+MAKE_RCSID("$NetBSD: var.c,v 1.901 2021/04/03 23:08:30 rillig Exp $");
 
+typedef struct VarFlags {
 	/*
 	 * The variable's value is currently being used by Var_Parse or
 	 * Var_Subst.  This marker is used to avoid endless recursion.
 	 */
-	VFL_IN_USE	= 1 << 0,
+	bool inUse: 1;
 
 	/*
 	 * The variable comes from the environment.
 	 * These variables are not registered in any GNode, therefore they
 	 * must be freed as soon as they are not used anymore.
 	 */
-	VFL_FROM_ENV	= 1 << 1,
+	bool fromEnv: 1;
 
 	/*
 	 * The variable is exported to the environment, to be used by child
 	 * processes.
 	 */
-	VFL_EXPORTED	= 1 << 2,
+	bool exported: 1;
 
 	/*
 	 * At the point where this variable was exported, it contained an
@@ -170,10 +168,10 @@ typedef enum VarFlags {
 	 * process is started, it needs to be exported again, in the hope
 	 * that the referenced variable can then be resolved.
 	 */
-	VFL_REEXPORT	= 1 << 3,
+	bool reexport: 1;
 
 	/* The variable came from the command line. */
-	VFL_FROM_CMD	= 1 << 4,
+	bool fromCmd: 1;
 
 	/*
 	 * The variable value cannot be changed anymore, and the variable
@@ -182,7 +180,7 @@ typedef enum VarFlags {
 	 *
 	 * See VAR_SET_READONLY.
 	 */
-	VFL_READONLY	= 1 << 5
+	bool readOnly: 1;
 } VarFlags;
 
 /*
@@ -351,14 +349,17 @@ static VarExportedMode var_exportedVars 
 
 
 static Var *
-VarNew(FStr name, const char *value, VarFlags flags)
+VarNew(FStr name, const char *value, bool fromEnv, bool readOnly)
 {
 	size_t value_len = strlen(value);
+	VarFlags vflags = { false, false, false, false, false, false };
 	Var *var = bmake_malloc(sizeof *var);
 	var->name = name;
 	Buf_InitSize(>val, value_len + 1);
 	Buf_AddBytes(>val, value, value_len);
-	var->flags = flags;
+	vflags.fromEnv = fromEnv;
+	vflags.readOnly = readOnly;
+	var->flags = vflags;
 	return var;
 }
 
@@ -456,7 +457,7 @@ VarFind(const char *name, GNode *scope, 
 
 		if ((env = getenv(name)) != NULL) {
 			char *varname = bmake_strdup(name);
-			return VarNew(FStr_InitOwn(varname), env, VFL_FROM_ENV);
+			return VarNew(FStr_InitOwn(varname), env, true, false);
 		}
 
 		if (opts.checkEnvFirst && scope != SCOPE_GLOBAL) {
@@ -477,7 +478,7 @@ VarFind(const char *name, GNode *scope, 
 static void
 VarFreeEnv(Var *v)
 {
-	if (!(v->flags & VFL_FROM_ENV))
+	if (!v->flags.fromEnv)
 		return;
 
 	FStr_Done(>name);
@@ -491,7 +492,7 @@ VarAdd(const char *name, const char *val
 {
 	HashEntry *he = HashTable_CreateEntry(>vars, name, NULL);
 	Var *v = VarNew(FStr_InitRefer(/* aliased to */ he->key), value,
-	flags & VAR_SET_READONLY ? VFL_READONLY : VFL_NONE);
+	false, (flags & VAR_SET_READONLY) != 0);
 	HashEntry_Set(he, v);
 	DEBUG3(VAR, "%s:%s = %s\n", scope->name, name, value);
 	return v;
@@ -514,7 +515,7 @@ Var_Delete(GNode *scope, const char *var
 
 	DEBUG2(VAR, "%s:delete %s\n", scope->name, varname);
 	v = he->value;
-	if (v->flags & VFL_EXPORTED)
+	if (v->flags.exported)
 		unsetenv(v->name.str);
 	if (strcmp(v->name.str, MAKE_EXPORTED) == 0)
 		var_exportedVars = VAR_EXPORTED_NONE;
@@ -615,16 +616,16 @@ ExportVarEnv(Var *v)
 	char *val = v->val.data;
 	char *expr;
 
-	if ((v->flags & VFL_EXPORTED) && !(v->flags & VFL_REEXPORT))
+	if (v->flags.exported && !v->flags.reexport)
 		return false;	/* nothing to do */
 
 	if (strchr(val, '$') == NULL) {
-		if (!(v->flags & VFL_EXPORTED))
+		if (!v->flags.exported)
 			setenv(name, val, 1);
 		return true;
 	}
 
-	if (v->flags & VFL_IN_USE) {
+	if (v->flags.inUse) {
 		/*
 		 * We recursed while exporting in a child.
 		 * This isn't going to end well, just skip it.
@@ -647,8 +648,8 @@ 

CVS commit: src/usr.bin/make

2021-04-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Apr  3 23:08:30 UTC 2021

Modified Files:
src/usr.bin/make: var.c
src/usr.bin/make/unit-tests: directive-export-impl.exp
directive-export-impl.mk

Log Message:
make: replace enum bit-set with struct bit-fields

This makes the code easier to read, especially when setting one of the
flags to false.

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.900 -r1.901 src/usr.bin/make/var.c
cvs rdiff -u -r1.6 -r1.7 \
src/usr.bin/make/unit-tests/directive-export-impl.exp
cvs rdiff -u -r1.2 -r1.3 src/usr.bin/make/unit-tests/directive-export-impl.mk

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



CVS commit: src/external/mpl/bind/dist/lib/isc

2021-04-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Apr  3 22:44:44 UTC 2021

Modified Files:
src/external/mpl/bind/dist/lib/isc: app.c

Log Message:
Don't block signals if we are not bind (because if we are not bind, we don't
sigwait(2)).


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/mpl/bind/dist/lib/isc/app.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/mpl/bind/dist/lib/isc/app.c
diff -u src/external/mpl/bind/dist/lib/isc/app.c:1.4 src/external/mpl/bind/dist/lib/isc/app.c:1.5
--- src/external/mpl/bind/dist/lib/isc/app.c:1.4	Fri Feb 19 11:42:19 2021
+++ src/external/mpl/bind/dist/lib/isc/app.c	Sat Apr  3 18:44:43 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: app.c,v 1.4 2021/02/19 16:42:19 christos Exp $	*/
+/*	$NetBSD: app.c,v 1.5 2021/04/03 22:44:43 christos Exp $	*/
 
 /*
  * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
@@ -164,6 +164,8 @@ isc_app_ctxstart(isc_appctx_t *ctx) {
 	 * blocked by default, ensuring that only the thread that calls
 	 * sigwait() for them will get those signals.
 	 */
+	if (isc_bind9) {
+
 	if (sigemptyset() != 0 || sigaddset(, SIGHUP) != 0 ||
 	sigaddset(, SIGINT) != 0 || sigaddset(, SIGTERM) != 0)
 	{
@@ -178,6 +180,8 @@ isc_app_ctxstart(isc_appctx_t *ctx) {
 "isc_app_start() pthread_sigmask: %s", strbuf);
 	}
 
+	}
+
 #endif /* WIN32 */
 
 	return (ISC_R_SUCCESS);



CVS commit: src/external/mpl/bind/dist/lib/isc

2021-04-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Apr  3 22:44:44 UTC 2021

Modified Files:
src/external/mpl/bind/dist/lib/isc: app.c

Log Message:
Don't block signals if we are not bind (because if we are not bind, we don't
sigwait(2)).


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/mpl/bind/dist/lib/isc/app.c

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



CVS commit: [thorpej-futex] src/distrib/sets/lists

2021-04-03 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sat Apr  3 22:43:42 UTC 2021

Modified Files:
src/distrib/sets/lists/base [thorpej-futex]: md.amiga md.evbarm mi
shl.mi
src/distrib/sets/lists/comp [thorpej-futex]: ad.mips mi stl.mi
src/distrib/sets/lists/debug [thorpej-futex]: mi module.md.amd64
module.md.i386 module.mi shl.mi
src/distrib/sets/lists/etc [thorpej-futex]: mi
src/distrib/sets/lists/man [thorpej-futex]: mi
src/distrib/sets/lists/modules [thorpej-futex]: md.amd64 md.i386 mi
src/distrib/sets/lists/tests [thorpej-futex]: mi
src/distrib/sets/lists/xbase [thorpej-futex]: md.evbarm mi
src/distrib/sets/lists/xcomp [thorpej-futex]: mi
src/distrib/sets/lists/xdebug [thorpej-futex]: md.evbarm mi
src/distrib/sets/lists/xetc [thorpej-futex]: mi
src/distrib/sets/lists/xfont [thorpej-futex]: mi
src/distrib/sets/lists/xserver [thorpej-futex]: mi
Added Files:
src/distrib/sets/lists/xdebug [thorpej-futex]: md.evbppc
src/distrib/sets/lists/xserver [thorpej-futex]: md.evbppc

Log Message:
Sync with HEAD.


To generate a diff of this commit:
cvs rdiff -u -r1.56 -r1.56.30.1 src/distrib/sets/lists/base/md.amiga
cvs rdiff -u -r1.19 -r1.19.2.1 src/distrib/sets/lists/base/md.evbarm
cvs rdiff -u -r1.1272.2.1 -r1.1272.2.2 src/distrib/sets/lists/base/mi
cvs rdiff -u -r1.910 -r1.910.2.1 src/distrib/sets/lists/base/shl.mi
cvs rdiff -u -r1.86 -r1.86.2.1 src/distrib/sets/lists/comp/ad.mips
cvs rdiff -u -r1.2367.2.1 -r1.2367.2.2 src/distrib/sets/lists/comp/mi
cvs rdiff -u -r1.7 -r1.7.2.1 src/distrib/sets/lists/comp/stl.mi
cvs rdiff -u -r1.344.2.1 -r1.344.2.2 src/distrib/sets/lists/debug/mi
cvs rdiff -u -r1.4 -r1.4.2.1 src/distrib/sets/lists/debug/module.md.amd64
cvs rdiff -u -r1.2 -r1.2.2.1 src/distrib/sets/lists/debug/module.md.i386
cvs rdiff -u -r1.7 -r1.7.2.1 src/distrib/sets/lists/debug/module.mi
cvs rdiff -u -r1.269 -r1.269.2.1 src/distrib/sets/lists/debug/shl.mi
cvs rdiff -u -r1.263 -r1.263.2.1 src/distrib/sets/lists/etc/mi
cvs rdiff -u -r1.1711.2.1 -r1.1711.2.2 src/distrib/sets/lists/man/mi
cvs rdiff -u -r1.91 -r1.91.2.1 src/distrib/sets/lists/modules/md.amd64
cvs rdiff -u -r1.89 -r1.89.2.1 src/distrib/sets/lists/modules/md.i386
cvs rdiff -u -r1.142 -r1.142.2.1 src/distrib/sets/lists/modules/mi
cvs rdiff -u -r1.993.2.1 -r1.993.2.2 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.6 -r1.6.4.1 src/distrib/sets/lists/xbase/md.evbarm
cvs rdiff -u -r1.163.2.1 -r1.163.2.2 src/distrib/sets/lists/xbase/mi
cvs rdiff -u -r1.223 -r1.223.2.1 src/distrib/sets/lists/xcomp/mi
cvs rdiff -u -r1.28 -r1.28.2.1 src/distrib/sets/lists/xdebug/md.evbarm
cvs rdiff -u -r0 -r1.1.2.2 src/distrib/sets/lists/xdebug/md.evbppc
cvs rdiff -u -r1.39.2.1 -r1.39.2.2 src/distrib/sets/lists/xdebug/mi
cvs rdiff -u -r1.39 -r1.39.2.1 src/distrib/sets/lists/xetc/mi
cvs rdiff -u -r1.45 -r1.45.2.1 src/distrib/sets/lists/xfont/mi
cvs rdiff -u -r0 -r1.4.2.2 src/distrib/sets/lists/xserver/md.evbppc
cvs rdiff -u -r1.46 -r1.46.2.1 src/distrib/sets/lists/xserver/mi

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

Modified files:

Index: src/distrib/sets/lists/base/md.amiga
diff -u src/distrib/sets/lists/base/md.amiga:1.56 src/distrib/sets/lists/base/md.amiga:1.56.30.1
--- src/distrib/sets/lists/base/md.amiga:1.56	Wed Aug  6 12:15:01 2014
+++ src/distrib/sets/lists/base/md.amiga	Sat Apr  3 22:43:39 2021
@@ -1,8 +1,10 @@
-# $NetBSD: md.amiga,v 1.56 2014/08/06 12:15:01 martin Exp $
+# $NetBSD: md.amiga,v 1.56.30.1 2021/04/03 22:43:39 thorpej Exp $
 ./sbin/binpatch	base-sysutil-root
 ./usr/mdec/boot.amigabase-sysutil-bin
 ./usr/mdec/bootxx_fdbase-sysutil-bin
-./usr/mdec/bootxx_ffsbase-sysutil-bin
+./usr/mdec/bootxx_ffsbase-sysutil-bin	obsolete
+./usr/mdec/bootxx_ffsv1base-sysutil-bin
+./usr/mdec/bootxx_ffsv2base-sysutil-bin
 ./usr/mdec/fdbootbase-obsolete		obsolete
 ./usr/mdec/installbootbase-obsolete		obsolete
 ./usr/mdec/xxbootbase-obsolete		obsolete

Index: src/distrib/sets/lists/base/md.evbarm
diff -u src/distrib/sets/lists/base/md.evbarm:1.19 src/distrib/sets/lists/base/md.evbarm:1.19.2.1
--- src/distrib/sets/lists/base/md.evbarm:1.19	Thu Aug 27 15:31:59 2020
+++ src/distrib/sets/lists/base/md.evbarm	Sat Apr  3 22:43:39 2021
@@ -1,4 +1,4 @@
-# $NetBSD: md.evbarm,v 1.19 2020/08/27 15:31:59 riastradh Exp $
+# $NetBSD: md.evbarm,v 1.19.2.1 2021/04/03 22:43:39 thorpej Exp $
 ./libdata/firmware/if_bwfm/brcmfmac43143-sdio.bin	base-firmware-root	firmware
 ./libdata/firmware/if_bwfm/brcmfmac43241b0-sdio.bin	base-firmware-root	firmware
 ./libdata/firmware/if_bwfm/brcmfmac43241b4-sdio.bin	base-firmware-root	firmware
@@ -19,6 +19,7 @@
 ./libdata/firmware/if_bwfm/brcmfmac43430-sdio.sinovoip,bpi-m2-zero.txt	base-firmware-root	firmware
 ./libdata/firmware/if_bwfm/brcmfmac43430a0-sdio.bin	base-firmware-root	firmware
 

CVS commit: [thorpej-futex] src/distrib/sets/lists

2021-04-03 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sat Apr  3 22:43:42 UTC 2021

Modified Files:
src/distrib/sets/lists/base [thorpej-futex]: md.amiga md.evbarm mi
shl.mi
src/distrib/sets/lists/comp [thorpej-futex]: ad.mips mi stl.mi
src/distrib/sets/lists/debug [thorpej-futex]: mi module.md.amd64
module.md.i386 module.mi shl.mi
src/distrib/sets/lists/etc [thorpej-futex]: mi
src/distrib/sets/lists/man [thorpej-futex]: mi
src/distrib/sets/lists/modules [thorpej-futex]: md.amd64 md.i386 mi
src/distrib/sets/lists/tests [thorpej-futex]: mi
src/distrib/sets/lists/xbase [thorpej-futex]: md.evbarm mi
src/distrib/sets/lists/xcomp [thorpej-futex]: mi
src/distrib/sets/lists/xdebug [thorpej-futex]: md.evbarm mi
src/distrib/sets/lists/xetc [thorpej-futex]: mi
src/distrib/sets/lists/xfont [thorpej-futex]: mi
src/distrib/sets/lists/xserver [thorpej-futex]: mi
Added Files:
src/distrib/sets/lists/xdebug [thorpej-futex]: md.evbppc
src/distrib/sets/lists/xserver [thorpej-futex]: md.evbppc

Log Message:
Sync with HEAD.


To generate a diff of this commit:
cvs rdiff -u -r1.56 -r1.56.30.1 src/distrib/sets/lists/base/md.amiga
cvs rdiff -u -r1.19 -r1.19.2.1 src/distrib/sets/lists/base/md.evbarm
cvs rdiff -u -r1.1272.2.1 -r1.1272.2.2 src/distrib/sets/lists/base/mi
cvs rdiff -u -r1.910 -r1.910.2.1 src/distrib/sets/lists/base/shl.mi
cvs rdiff -u -r1.86 -r1.86.2.1 src/distrib/sets/lists/comp/ad.mips
cvs rdiff -u -r1.2367.2.1 -r1.2367.2.2 src/distrib/sets/lists/comp/mi
cvs rdiff -u -r1.7 -r1.7.2.1 src/distrib/sets/lists/comp/stl.mi
cvs rdiff -u -r1.344.2.1 -r1.344.2.2 src/distrib/sets/lists/debug/mi
cvs rdiff -u -r1.4 -r1.4.2.1 src/distrib/sets/lists/debug/module.md.amd64
cvs rdiff -u -r1.2 -r1.2.2.1 src/distrib/sets/lists/debug/module.md.i386
cvs rdiff -u -r1.7 -r1.7.2.1 src/distrib/sets/lists/debug/module.mi
cvs rdiff -u -r1.269 -r1.269.2.1 src/distrib/sets/lists/debug/shl.mi
cvs rdiff -u -r1.263 -r1.263.2.1 src/distrib/sets/lists/etc/mi
cvs rdiff -u -r1.1711.2.1 -r1.1711.2.2 src/distrib/sets/lists/man/mi
cvs rdiff -u -r1.91 -r1.91.2.1 src/distrib/sets/lists/modules/md.amd64
cvs rdiff -u -r1.89 -r1.89.2.1 src/distrib/sets/lists/modules/md.i386
cvs rdiff -u -r1.142 -r1.142.2.1 src/distrib/sets/lists/modules/mi
cvs rdiff -u -r1.993.2.1 -r1.993.2.2 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.6 -r1.6.4.1 src/distrib/sets/lists/xbase/md.evbarm
cvs rdiff -u -r1.163.2.1 -r1.163.2.2 src/distrib/sets/lists/xbase/mi
cvs rdiff -u -r1.223 -r1.223.2.1 src/distrib/sets/lists/xcomp/mi
cvs rdiff -u -r1.28 -r1.28.2.1 src/distrib/sets/lists/xdebug/md.evbarm
cvs rdiff -u -r0 -r1.1.2.2 src/distrib/sets/lists/xdebug/md.evbppc
cvs rdiff -u -r1.39.2.1 -r1.39.2.2 src/distrib/sets/lists/xdebug/mi
cvs rdiff -u -r1.39 -r1.39.2.1 src/distrib/sets/lists/xetc/mi
cvs rdiff -u -r1.45 -r1.45.2.1 src/distrib/sets/lists/xfont/mi
cvs rdiff -u -r0 -r1.4.2.2 src/distrib/sets/lists/xserver/md.evbppc
cvs rdiff -u -r1.46 -r1.46.2.1 src/distrib/sets/lists/xserver/mi

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



CVS commit: [thorpej-futex] src/tests/lib/libc/sys

2021-04-03 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sat Apr  3 22:34:59 UTC 2021

Modified Files:
src/tests/lib/libc/sys [thorpej-futex]: t_ptrace_signal_wait.h
t_sendrecv.c t_syscall.c

Log Message:
Sync with HEAD.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.4.2.1 src/tests/lib/libc/sys/t_ptrace_signal_wait.h
cvs rdiff -u -r1.6 -r1.6.8.1 src/tests/lib/libc/sys/t_sendrecv.c
cvs rdiff -u -r1.3 -r1.3.10.1 src/tests/lib/libc/sys/t_syscall.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/libc/sys/t_ptrace_signal_wait.h
diff -u src/tests/lib/libc/sys/t_ptrace_signal_wait.h:1.4 src/tests/lib/libc/sys/t_ptrace_signal_wait.h:1.4.2.1
--- src/tests/lib/libc/sys/t_ptrace_signal_wait.h:1.4	Mon Jun 22 12:21:02 2020
+++ src/tests/lib/libc/sys/t_ptrace_signal_wait.h	Sat Apr  3 22:34:59 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_ptrace_signal_wait.h,v 1.4 2020/06/22 12:21:02 rin Exp $	*/
+/*	$NetBSD: t_ptrace_signal_wait.h,v 1.4.2.1 2021/04/03 22:34:59 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 2016, 2017, 2018, 2019, 2020 The NetBSD Foundation, Inc.
@@ -90,7 +90,7 @@ traceme_raise(int sigval)
 		ATF_REQUIRE_EQ(info.psi_siginfo.si_signo, sigval);
 		ATF_REQUIRE_EQ(info.psi_siginfo.si_code, SI_LWP);
 
-		DPRINTF("Assert that PT_GET_PROCESS_STATE returns non-error");
+		DPRINTF("Assert that PT_GET_PROCESS_STATE returns non-error\n");
 		SYSCALL_REQUIRE(
 		ptrace(PT_GET_PROCESS_STATE, child, , slen) != -1);
 		ATF_REQUIRE(memcmp(, _state, slen) == 0);
@@ -401,7 +401,7 @@ traceme_crash(int sig)
 
 	validate_status_stopped(status, sig);
 
-	DPRINTF("Before calling ptrace(2) with PT_GET_SIGINFO for child");
+	DPRINTF("Before calling ptrace(2) with PT_GET_SIGINFO for child\n");
 	SYSCALL_REQUIRE(
 	ptrace(PT_GET_SIGINFO, child, , sizeof(info)) != -1);
 
@@ -567,7 +567,7 @@ traceme_signalmasked_crash(int sig)
 
 	validate_status_stopped(status, sig);
 
-	DPRINTF("Before calling ptrace(2) with PT_GET_SIGINFO for child");
+	DPRINTF("Before calling ptrace(2) with PT_GET_SIGINFO for child\n");
 	SYSCALL_REQUIRE(
 	ptrace(PT_GET_SIGINFO, child, , sizeof(info)) != -1);
 
@@ -750,7 +750,7 @@ traceme_signalignored_crash(int sig)
 
 	validate_status_stopped(status, sig);
 
-	DPRINTF("Before calling ptrace(2) with PT_GET_SIGINFO for child");
+	DPRINTF("Before calling ptrace(2) with PT_GET_SIGINFO for child\n");
 	SYSCALL_REQUIRE(
 	ptrace(PT_GET_SIGINFO, child, , sizeof(info)) != -1);
 

Index: src/tests/lib/libc/sys/t_sendrecv.c
diff -u src/tests/lib/libc/sys/t_sendrecv.c:1.6 src/tests/lib/libc/sys/t_sendrecv.c:1.6.8.1
--- src/tests/lib/libc/sys/t_sendrecv.c:1.6	Sun Feb  3 03:19:28 2019
+++ src/tests/lib/libc/sys/t_sendrecv.c	Sat Apr  3 22:34:59 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_sendrecv.c,v 1.6 2019/02/03 03:19:28 mrg Exp $	*/
+/*	$NetBSD: t_sendrecv.c,v 1.6.8.1 2021/04/03 22:34:59 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__RCSID("$NetBSD: t_sendrecv.c,v 1.6 2019/02/03 03:19:28 mrg Exp $");
+__RCSID("$NetBSD: t_sendrecv.c,v 1.6.8.1 2021/04/03 22:34:59 thorpej Exp $");
 
 #include 
 #include 
@@ -40,8 +40,8 @@ __RCSID("$NetBSD: t_sendrecv.c,v 1.6 201
 #include 
 #include 
 #include 
-#include 
 #include 
+#include 
 #include 
 
 
@@ -62,61 +62,66 @@ handle_sigchld(__unused int pid)
 }
 
 static void
-sender(int fd)
+sender(int sd)
 {
 	union packet p;
 	ssize_t n;
 	p.seq = 0;
 	for (size_t i = 0; i < COUNT; i++) {
-		for (; (n = send(fd, , sizeof(p), 0)) == sizeof(p);
+		for (; (n = send(sd, , sizeof(p), 0)) == sizeof(p);
 		p.seq++)
 			continue;
-		printf(">>%zd %d %ju\n", n, errno, p.seq);
+//		printf(">>%zd %d %ju\n", n, errno, p.seq);
 		ATF_REQUIRE_MSG(errno == ENOBUFS, "send %s", strerror(errno));
-//		sched_yield();
 	}
-	printf("sender done\n");
+	close(sd);
+//	printf("sender done\n");
 }
 
 static void
-receiver(int fd)
+receiver(int sd)
 {
 	union packet p;
 	ssize_t n;
 	uintmax_t seq = 0;
 
-	do {
+	for (size_t i = 0; i < COUNT; i++) {
 		if (rdied)
 			return;
-		while ((n = recv(fd, , sizeof(p), 0), sizeof(p))
+		while ((n = recv(sd, , sizeof(p), 0), sizeof(p))
 		== sizeof(p))
 		{
 			if (rdied)
 return;
 			if (p.seq != seq)
 printf("%ju != %ju\n", p.seq, seq);
+			if (seq % 10 == 0)
+sched_yield();
 			seq = p.seq + 1;
 		}
-		printf("<<%zd %d %ju\n", n, errno, seq);
+//		printf("<<%zd %d %ju\n", n, errno, seq);
 		if (n == 0)
 			return;
 		ATF_REQUIRE_EQ(n, -1);
 		ATF_REQUIRE_MSG(errno == ENOBUFS, "recv %s", strerror(errno));
-	} while (p.seq < COUNT);
+	}
+	close(sd);
 }
 
 static void
 sendrecv(int rerror)
 {
-	int fd[2], error;
+	int fd[2], sd[2], error;
+	char c = 0;
 	struct sigaction sa;
 
-	error = socketpair(AF_UNIX, SOCK_DGRAM, 0, fd);
-//	error = pipe(fd);
+	error = socketpair(AF_UNIX, SOCK_DGRAM, 0, sd);
 	ATF_REQUIRE_MSG(error 

CVS commit: [thorpej-futex] src/tests/lib/libc/sys

2021-04-03 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sat Apr  3 22:34:59 UTC 2021

Modified Files:
src/tests/lib/libc/sys [thorpej-futex]: t_ptrace_signal_wait.h
t_sendrecv.c t_syscall.c

Log Message:
Sync with HEAD.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.4.2.1 src/tests/lib/libc/sys/t_ptrace_signal_wait.h
cvs rdiff -u -r1.6 -r1.6.8.1 src/tests/lib/libc/sys/t_sendrecv.c
cvs rdiff -u -r1.3 -r1.3.10.1 src/tests/lib/libc/sys/t_syscall.c

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



CVS commit: src/external/mpl/bind/dist/lib/isc

2021-04-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Apr  3 22:20:26 UTC 2021

Modified Files:
src/external/mpl/bind/dist/lib/isc: timer.c
src/external/mpl/bind/dist/lib/isc/netmgr: netmgr.c
src/external/mpl/bind/dist/lib/isc/unix: socket.c

Log Message:
prefixing lwp names with isc- adds no useful information and causes
truncation of the useful part.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/external/mpl/bind/dist/lib/isc/timer.c
cvs rdiff -u -r1.4 -r1.5 src/external/mpl/bind/dist/lib/isc/netmgr/netmgr.c
cvs rdiff -u -r1.20 -r1.21 src/external/mpl/bind/dist/lib/isc/unix/socket.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/mpl/bind/dist/lib/isc/timer.c
diff -u src/external/mpl/bind/dist/lib/isc/timer.c:1.7 src/external/mpl/bind/dist/lib/isc/timer.c:1.8
--- src/external/mpl/bind/dist/lib/isc/timer.c:1.7	Fri Feb 19 11:42:19 2021
+++ src/external/mpl/bind/dist/lib/isc/timer.c	Sat Apr  3 18:20:26 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: timer.c,v 1.7 2021/02/19 16:42:19 christos Exp $	*/
+/*	$NetBSD: timer.c,v 1.8 2021/04/03 22:20:26 christos Exp $	*/
 
 /*
  * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
@@ -716,7 +716,7 @@ isc_timermgr_create(isc_mem_t *mctx, isc
 	isc_mem_attach(mctx, >mctx);
 	isc_condition_init(>wakeup);
 	isc_thread_create(run, manager, >thread);
-	isc_thread_setname(manager->thread, "isc-timer");
+	isc_thread_setname(manager->thread, "timer");
 
 	*managerp = (isc_timermgr_t *)manager;
 

Index: src/external/mpl/bind/dist/lib/isc/netmgr/netmgr.c
diff -u src/external/mpl/bind/dist/lib/isc/netmgr/netmgr.c:1.4 src/external/mpl/bind/dist/lib/isc/netmgr/netmgr.c:1.5
--- src/external/mpl/bind/dist/lib/isc/netmgr/netmgr.c:1.4	Fri Feb 19 11:42:20 2021
+++ src/external/mpl/bind/dist/lib/isc/netmgr/netmgr.c	Sat Apr  3 18:20:26 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: netmgr.c,v 1.4 2021/02/19 16:42:20 christos Exp $	*/
+/*	$NetBSD: netmgr.c,v 1.5 2021/04/03 22:20:26 christos Exp $	*/
 
 /*
  * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
@@ -287,7 +287,7 @@ isc_nm_start(isc_mem_t *mctx, uint32_t w
 		mgr->workers_running++;
 		isc_thread_create(nm_thread, >workers[i], >thread);
 
-		snprintf(name, sizeof(name), "isc-net-%04zu", i);
+		snprintf(name, sizeof(name), "net-%zu", i);
 		isc_thread_setname(worker->thread, name);
 	}
 

Index: src/external/mpl/bind/dist/lib/isc/unix/socket.c
diff -u src/external/mpl/bind/dist/lib/isc/unix/socket.c:1.20 src/external/mpl/bind/dist/lib/isc/unix/socket.c:1.21
--- src/external/mpl/bind/dist/lib/isc/unix/socket.c:1.20	Sun Feb 21 20:31:51 2021
+++ src/external/mpl/bind/dist/lib/isc/unix/socket.c	Sat Apr  3 18:20:26 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: socket.c,v 1.20 2021/02/22 01:31:51 christos Exp $	*/
+/*	$NetBSD: socket.c,v 1.21 2021/04/03 22:20:26 christos Exp $	*/
 
 /*
  * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
@@ -3946,7 +3946,7 @@ isc_socketmgr_create2(isc_mem_t *mctx, i
 		isc_thread_create(netthread, >threads[i],
   >threads[i].thread);
 		char tname[1024];
-		sprintf(tname, "isc-socket-%d", i);
+		sprintf(tname, "sock-%d", i);
 		isc_thread_setname(manager->threads[i].thread, tname);
 	}
 



CVS commit: src/external/mpl/bind/dist/lib/isc

2021-04-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Apr  3 22:20:26 UTC 2021

Modified Files:
src/external/mpl/bind/dist/lib/isc: timer.c
src/external/mpl/bind/dist/lib/isc/netmgr: netmgr.c
src/external/mpl/bind/dist/lib/isc/unix: socket.c

Log Message:
prefixing lwp names with isc- adds no useful information and causes
truncation of the useful part.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/external/mpl/bind/dist/lib/isc/timer.c
cvs rdiff -u -r1.4 -r1.5 src/external/mpl/bind/dist/lib/isc/netmgr/netmgr.c
cvs rdiff -u -r1.20 -r1.21 src/external/mpl/bind/dist/lib/isc/unix/socket.c

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



CVS commit: src/usr.bin/make

2021-04-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Apr  3 22:06:23 UTC 2021

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

Log Message:
make: remove unused Expr.varFlags

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.899 -r1.900 src/usr.bin/make/var.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/var.c
diff -u src/usr.bin/make/var.c:1.899 src/usr.bin/make/var.c:1.900
--- src/usr.bin/make/var.c:1.899	Sat Apr  3 22:02:59 2021
+++ src/usr.bin/make/var.c	Sat Apr  3 22:06:23 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: var.c,v 1.899 2021/04/03 22:02:59 rillig Exp $	*/
+/*	$NetBSD: var.c,v 1.900 2021/04/03 22:06:23 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -140,7 +140,7 @@
 #include "metachar.h"
 
 /*	"@(#)var.c	8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: var.c,v 1.899 2021/04/03 22:02:59 rillig Exp $");
+MAKE_RCSID("$NetBSD: var.c,v 1.900 2021/04/03 22:06:23 rillig Exp $");
 
 typedef enum VarFlags {
 	VFL_NONE	= 0,
@@ -347,10 +347,6 @@ GNode *SCOPE_CMDLINE;
 GNode *SCOPE_GLOBAL;
 GNode *SCOPE_INTERNAL;
 
-ENUM_FLAGS_RTTI_6(VarFlags,
-		  VFL_IN_USE, VFL_FROM_ENV,
-		  VFL_EXPORTED, VFL_REEXPORT, VFL_FROM_CMD, VFL_READONLY);
-
 static VarExportedMode var_exportedVars = VAR_EXPORTED_NONE;
 
 
@@ -2059,7 +2055,6 @@ static const char *const ExprDefined_Nam
 typedef struct Expr {
 	const char *name;
 	FStr value;
-	VarFlags varFlags;
 	VarEvalFlags const_member eflags;
 	GNode *const_member scope;
 	ExprDefined defined;
@@ -4314,18 +4309,17 @@ FreeEnvVar(Var *v, FStr *inout_val)
 }
 
 #if __STDC_VERSION__ >= 199901L
-#define Expr_Literal(name, value, vflags, eflags, scope, defined) \
-	{ name, value, vflags, eflags, scope, defined }
+#define Expr_Literal(name, value, eflags, scope, defined) \
+	{ name, value, eflags, scope, defined }
 #else
 MAKE_INLINE Expr
-Expr_Literal(const char *name, FStr value, VarFlags vflags,
+Expr_Literal(const char *name, FStr value,
 	 VarEvalFlags eflags, GNode *scope, ExprDefined defined)
 {
 	Expr expr;
 
 	expr.name = name;
 	expr.value = value;
-	expr.varFlags = vflags;
 	expr.eflags = eflags;
 	expr.scope = scope;
 	expr.defined = defined;
@@ -4389,7 +4383,7 @@ Var_Parse(const char **pp, GNode *scope,
 	bool dynamic;
 	const char *extramodifiers;
 	Var *v;
-	Expr expr = Expr_Literal(NULL, FStr_InitRefer(NULL), VFL_NONE, eflags,
+	Expr expr = Expr_Literal(NULL, FStr_InitRefer(NULL), eflags,
 	scope, DEF_REGULAR);
 
 	DEBUG2(VAR, "Var_Parse: %s (%s)\n", start,
@@ -4423,7 +4417,6 @@ Var_Parse(const char **pp, GNode *scope,
 	}
 
 	expr.name = v->name.str;
-	expr.varFlags = v->flags;
 	if (v->flags & VFL_IN_USE)
 		Fatal("Variable %s is recursive.", v->name.str);
 



CVS commit: src/usr.bin/make

2021-04-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Apr  3 22:06:23 UTC 2021

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

Log Message:
make: remove unused Expr.varFlags

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.899 -r1.900 src/usr.bin/make/var.c

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



CVS commit: src/usr.bin/make

2021-04-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Apr  3 22:02:59 UTC 2021

Modified Files:
src/usr.bin/make: var.c
src/usr.bin/make/unit-tests: directive-export-impl.exp
directive-unexport-env.exp var-eval-short.exp var-op-append.exp
vardebug.exp varmod-assign.exp varmod-defined.exp
varmod-indirect.exp varmod-match-escape.exp varname-empty.exp
varname.exp

Log Message:
make: remove VarFlags from debug logging

Before the introduction of ExprDefined, VarFlags contained whether the
expression was defined or not, which was useful to know since the final
value of the expression depends on this information.  The other VarFlags
do not influence the evaluation, so there is no point logging them.


To generate a diff of this commit:
cvs rdiff -u -r1.898 -r1.899 src/usr.bin/make/var.c
cvs rdiff -u -r1.5 -r1.6 \
src/usr.bin/make/unit-tests/directive-export-impl.exp \
src/usr.bin/make/unit-tests/varmod-defined.exp
cvs rdiff -u -r1.6 -r1.7 \
src/usr.bin/make/unit-tests/directive-unexport-env.exp \
src/usr.bin/make/unit-tests/var-op-append.exp
cvs rdiff -u -r1.8 -r1.9 src/usr.bin/make/unit-tests/var-eval-short.exp \
src/usr.bin/make/unit-tests/varmod-match-escape.exp
cvs rdiff -u -r1.18 -r1.19 src/usr.bin/make/unit-tests/vardebug.exp
cvs rdiff -u -r1.11 -r1.12 src/usr.bin/make/unit-tests/varmod-assign.exp
cvs rdiff -u -r1.13 -r1.14 src/usr.bin/make/unit-tests/varmod-indirect.exp \
src/usr.bin/make/unit-tests/varname.exp
cvs rdiff -u -r1.10 -r1.11 src/usr.bin/make/unit-tests/varname-empty.exp

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

Modified files:

Index: src/usr.bin/make/var.c
diff -u src/usr.bin/make/var.c:1.898 src/usr.bin/make/var.c:1.899
--- src/usr.bin/make/var.c:1.898	Sat Apr  3 21:55:27 2021
+++ src/usr.bin/make/var.c	Sat Apr  3 22:02:59 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: var.c,v 1.898 2021/04/03 21:55:27 rillig Exp $	*/
+/*	$NetBSD: var.c,v 1.899 2021/04/03 22:02:59 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -140,7 +140,7 @@
 #include "metachar.h"
 
 /*	"@(#)var.c	8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: var.c,v 1.898 2021/04/03 21:55:27 rillig Exp $");
+MAKE_RCSID("$NetBSD: var.c,v 1.899 2021/04/03 22:02:59 rillig Exp $");
 
 typedef enum VarFlags {
 	VFL_NONE	= 0,
@@ -3639,16 +3639,14 @@ static void
 LogBeforeApply(const ModChain *ch, const char *mod)
 {
 	const Expr *expr = ch->expr;
-	char vflags_str[VarFlags_ToStringSize];
 	bool is_single_char = mod[0] != '\0' && IsDelimiter(mod[1], ch);
 
 	/* At this point, only the first character of the modifier can
 	 * be used since the end of the modifier is not yet known. */
-	debug_printf("Applying ${%s:%c%s} to \"%s\" (%s, %s, %s)\n",
+	debug_printf("Applying ${%s:%c%s} to \"%s\" (%s, %s)\n",
 	expr->name, mod[0], is_single_char ? "" : "...",
 	expr->value.str,
 	VarEvalFlags_ToString(expr->eflags),
-	VarFlags_ToString(vflags_str, expr->varFlags),
 	ExprDefined_Name[expr->defined]);
 }
 
@@ -3657,14 +3655,12 @@ LogAfterApply(const ModChain *ch, const 
 {
 	const Expr *expr = ch->expr;
 	const char *value = expr->value.str;
-	char vflags_str[VarFlags_ToStringSize];
 	const char *quot = value == var_Error ? "" : "\"";
 
-	debug_printf("Result of ${%s:%.*s} is %s%s%s (%s, %s, %s)\n",
+	debug_printf("Result of ${%s:%.*s} is %s%s%s (%s, %s)\n",
 	expr->name, (int)(p - mod), mod,
 	quot, value == var_Error ? "error" : value, quot,
 	VarEvalFlags_ToString(expr->eflags),
-	VarFlags_ToString(vflags_str, expr->varFlags),
 	ExprDefined_Name[expr->defined]);
 }
 

Index: src/usr.bin/make/unit-tests/directive-export-impl.exp
diff -u src/usr.bin/make/unit-tests/directive-export-impl.exp:1.5 src/usr.bin/make/unit-tests/directive-export-impl.exp:1.6
--- src/usr.bin/make/unit-tests/directive-export-impl.exp:1.5	Mon Mar 15 15:39:13 2021
+++ src/usr.bin/make/unit-tests/directive-export-impl.exp	Sat Apr  3 22:02:59 2021
@@ -5,46 +5,46 @@ Global:.MAKE.EXPORTED = UT_VAR
 ParseReadLine (32): ': ${UT_VAR:N*}'
 Var_Parse: ${UT_VAR:N*} (eval-defined)
 Var_Parse: ${REF}> (eval-defined)
-Applying ${UT_VAR:N...} to "<>" (eval-defined, VFL_EXPORTED|VFL_REEXPORT, regular)
+Applying ${UT_VAR:N...} to "<>" (eval-defined, regular)
 Pattern[UT_VAR] for [<>] is [*]
 ModifyWords: split "<>" into 1 words
-Result of ${UT_VAR:N*} is "" (eval-defined, VFL_EXPORTED|VFL_REEXPORT, regular)
+Result of ${UT_VAR:N*} is "" (eval-defined, regular)
 ParseDoDependency(: )
 CondParser_Eval: ${:!echo "\$UT_VAR"!} != "<>"
 Var_Parse: ${:!echo "\$UT_VAR"!} != "<>" (eval-defined)
-Applying ${:!...} to "" (eval-defined, none, undefined)
+Applying ${:!...} to "" (eval-defined, undefined)
 Modifier part: "echo "$UT_VAR""
 Var_Parse: ${.MAKE.EXPORTED:O:u} (eval)
-Applying ${.MAKE.EXPORTED:O} to "UT_VAR" (eval, none, regular)
-Result of ${.MAKE.EXPORTED:O} is "UT_VAR" (eval, none, 

CVS commit: src/usr.bin/make

2021-04-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Apr  3 22:02:59 UTC 2021

Modified Files:
src/usr.bin/make: var.c
src/usr.bin/make/unit-tests: directive-export-impl.exp
directive-unexport-env.exp var-eval-short.exp var-op-append.exp
vardebug.exp varmod-assign.exp varmod-defined.exp
varmod-indirect.exp varmod-match-escape.exp varname-empty.exp
varname.exp

Log Message:
make: remove VarFlags from debug logging

Before the introduction of ExprDefined, VarFlags contained whether the
expression was defined or not, which was useful to know since the final
value of the expression depends on this information.  The other VarFlags
do not influence the evaluation, so there is no point logging them.


To generate a diff of this commit:
cvs rdiff -u -r1.898 -r1.899 src/usr.bin/make/var.c
cvs rdiff -u -r1.5 -r1.6 \
src/usr.bin/make/unit-tests/directive-export-impl.exp \
src/usr.bin/make/unit-tests/varmod-defined.exp
cvs rdiff -u -r1.6 -r1.7 \
src/usr.bin/make/unit-tests/directive-unexport-env.exp \
src/usr.bin/make/unit-tests/var-op-append.exp
cvs rdiff -u -r1.8 -r1.9 src/usr.bin/make/unit-tests/var-eval-short.exp \
src/usr.bin/make/unit-tests/varmod-match-escape.exp
cvs rdiff -u -r1.18 -r1.19 src/usr.bin/make/unit-tests/vardebug.exp
cvs rdiff -u -r1.11 -r1.12 src/usr.bin/make/unit-tests/varmod-assign.exp
cvs rdiff -u -r1.13 -r1.14 src/usr.bin/make/unit-tests/varmod-indirect.exp \
src/usr.bin/make/unit-tests/varname.exp
cvs rdiff -u -r1.10 -r1.11 src/usr.bin/make/unit-tests/varname-empty.exp

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



CVS commit: src/usr.bin/make

2021-04-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Apr  3 21:55:27 UTC 2021

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

Log Message:
make: simplify access to the name of an expression during evaluation

During the evaluation, the flags of the variable don't change, except
for VFL_IN_USE, but in such a case make exits immediately anyway.

Logging the variable flags does not provide any useful information, so
it will be removed soon.  Logging the variable flags made sense when the
definedness of the expression was still encoded in the variable flags,
instead of in the separate ExprDefined.

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.897 -r1.898 src/usr.bin/make/var.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/var.c
diff -u src/usr.bin/make/var.c:1.897 src/usr.bin/make/var.c:1.898
--- src/usr.bin/make/var.c:1.897	Sat Apr  3 14:39:02 2021
+++ src/usr.bin/make/var.c	Sat Apr  3 21:55:27 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: var.c,v 1.897 2021/04/03 14:39:02 rillig Exp $	*/
+/*	$NetBSD: var.c,v 1.898 2021/04/03 21:55:27 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -140,7 +140,7 @@
 #include "metachar.h"
 
 /*	"@(#)var.c	8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: var.c,v 1.897 2021/04/03 14:39:02 rillig Exp $");
+MAKE_RCSID("$NetBSD: var.c,v 1.898 2021/04/03 21:55:27 rillig Exp $");
 
 typedef enum VarFlags {
 	VFL_NONE	= 0,
@@ -2057,8 +2057,9 @@ static const char *const ExprDefined_Nam
 
 /* A variable expression such as $@ or ${VAR:Mpattern:Q}. */
 typedef struct Expr {
-	Var *var;
+	const char *name;
 	FStr value;
+	VarFlags varFlags;
 	VarEvalFlags const_member eflags;
 	GNode *const_member scope;
 	ExprDefined defined;
@@ -2266,7 +2267,7 @@ ParseModifierPartSubst(
 	if (*p != delim) {
 		*pp = p;
 		Error("Unfinished modifier for \"%s\" ('%c' missing)",
-		ch->expr->var->name.str, delim);
+		ch->expr->name, delim);
 		*out_part = NULL;
 		return VPR_ERR;
 	}
@@ -2451,7 +2452,7 @@ ApplyModifier_Loop(const char **pp, ModC
 		Parse_Error(PARSE_FATAL,
 		"In the :@ modifier of \"%s\", the variable name \"%s\" "
 		"must not contain a dollar.",
-		expr->var->name.str, args.tvar);
+		expr->name, args.tvar);
 		return AMR_CLEANUP;
 	}
 
@@ -2551,7 +2552,7 @@ ApplyModifier_Literal(const char **pp, M
 
 	if (expr->eflags.wantRes) {
 		Expr_Define(expr);
-		Expr_SetValueOwn(expr, bmake_strdup(expr->var->name.str));
+		Expr_SetValueOwn(expr, bmake_strdup(expr->name));
 	}
 
 	return AMR_OK;
@@ -2665,17 +2666,17 @@ ApplyModifier_Path(const char **pp, ModC
 
 	Expr_Define(expr);
 
-	gn = Targ_FindNode(expr->var->name.str);
+	gn = Targ_FindNode(expr->name);
 	if (gn == NULL || gn->type & OP_NOPATH) {
 		path = NULL;
 	} else if (gn->path != NULL) {
 		path = bmake_strdup(gn->path);
 	} else {
 		SearchPath *searchPath = Suff_FindPath(gn);
-		path = Dir_FindFile(expr->var->name.str, searchPath);
+		path = Dir_FindFile(expr->name, searchPath);
 	}
 	if (path == NULL)
-		path = bmake_strdup(expr->var->name.str);
+		path = bmake_strdup(expr->name);
 	Expr_SetValueOwn(expr, path);
 
 	return AMR_OK;
@@ -2833,7 +2834,7 @@ ParseModifier_Match(const char **pp, con
 	}
 
 	DEBUG3(VAR, "Pattern[%s] for [%s] is [%s]\n",
-	expr->var->name.str, expr->value.str, pattern);
+	   expr->name, expr->value.str, pattern);
 
 	*out_pattern = pattern;
 }
@@ -3345,7 +3346,7 @@ ApplyModifier_IfElse(const char **pp, Mo
 
 	int cond_rc = COND_PARSE;	/* anything other than COND_INVALID */
 	if (expr->eflags.wantRes) {
-		cond_rc = Cond_EvalCondition(expr->var->name.str, );
+		cond_rc = Cond_EvalCondition(expr->name, );
 		if (cond_rc != COND_INVALID && value)
 			then_eflags = expr->eflags;
 		if (cond_rc != COND_INVALID && !value)
@@ -3365,8 +3366,7 @@ ApplyModifier_IfElse(const char **pp, Mo
 
 	if (cond_rc == COND_INVALID) {
 		Error("Bad conditional expression `%s' in %s?%s:%s",
-		expr->var->name.str, expr->var->name.str,
-		then_expr, else_expr);
+		expr->name, expr->name, then_expr, else_expr);
 		return AMR_CLEANUP;
 	}
 
@@ -3424,7 +3424,7 @@ ApplyModifier_Assign(const char **pp, Mo
 	return AMR_UNKNOWN;	/* "::" */
 
 ok:
-	if (expr->var->name.str[0] == '\0') {
+	if (expr->name[0] == '\0') {
 		*pp = mod + 1;
 		return AMR_BAD;
 	}
@@ -3451,7 +3451,7 @@ ok:
 
 	scope = expr->scope;	/* scope where v belongs */
 	if (expr->defined == DEF_REGULAR && expr->scope != SCOPE_GLOBAL) {
-		Var *gv = VarFind(expr->var->name.str, expr->scope, false);
+		Var *gv = VarFind(expr->name, expr->scope, false);
 		if (gv == NULL)
 			scope = SCOPE_GLOBAL;
 		else
@@ -3460,7 +3460,7 @@ ok:
 
 	switch (op[0]) {
 	case '+':
-		Var_Append(scope, expr->var->name.str, val);
+		Var_Append(scope, expr->name, val);
 		break;
 	case '!': {
 		const char *errfmt;
@@ -3468,7 +3468,7 @@ ok:
 		if (errfmt != NULL)
 			Error(errfmt, val);
 		else
-			

CVS commit: src/usr.bin/make

2021-04-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Apr  3 21:55:27 UTC 2021

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

Log Message:
make: simplify access to the name of an expression during evaluation

During the evaluation, the flags of the variable don't change, except
for VFL_IN_USE, but in such a case make exits immediately anyway.

Logging the variable flags does not provide any useful information, so
it will be removed soon.  Logging the variable flags made sense when the
definedness of the expression was still encoded in the variable flags,
instead of in the separate ExprDefined.

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.897 -r1.898 src/usr.bin/make/var.c

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



CVS commit: [thorpej-futex] src/sys/kern

2021-04-03 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sat Apr  3 21:52:20 UTC 2021

Modified Files:
src/sys/kern [thorpej-futex]: sys_futex.c

Log Message:
futex_func_wait(): If TIMER_ABSTIME, sanity check that the deadline
provided by the caller is not ridiculous.


To generate a diff of this commit:
cvs rdiff -u -r1.11.2.1 -r1.11.2.2 src/sys/kern/sys_futex.c

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



CVS commit: [thorpej-futex] src/sys/kern

2021-04-03 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sat Apr  3 21:52:20 UTC 2021

Modified Files:
src/sys/kern [thorpej-futex]: sys_futex.c

Log Message:
futex_func_wait(): If TIMER_ABSTIME, sanity check that the deadline
provided by the caller is not ridiculous.


To generate a diff of this commit:
cvs rdiff -u -r1.11.2.1 -r1.11.2.2 src/sys/kern/sys_futex.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_futex.c
diff -u src/sys/kern/sys_futex.c:1.11.2.1 src/sys/kern/sys_futex.c:1.11.2.2
--- src/sys/kern/sys_futex.c:1.11.2.1	Sun Nov  1 15:16:43 2020
+++ src/sys/kern/sys_futex.c	Sat Apr  3 21:52:20 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: sys_futex.c,v 1.11.2.1 2020/11/01 15:16:43 thorpej Exp $	*/
+/*	$NetBSD: sys_futex.c,v 1.11.2.2 2021/04/03 21:52:20 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 2018, 2019, 2020 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sys_futex.c,v 1.11.2.1 2020/11/01 15:16:43 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sys_futex.c,v 1.11.2.2 2021/04/03 21:52:20 thorpej Exp $");
 
 /*
  * Futexes
@@ -1367,7 +1367,15 @@ futex_func_wait(bool shared, int *uaddr,
 		return EAGAIN;
 
 	/* Determine a deadline on the specified clock.  */
-	if (timeout == NULL || (clkflags & TIMER_ABSTIME) == TIMER_ABSTIME) {
+	if (timeout == NULL) {
+		deadline = timeout;
+	} else if ((clkflags & TIMER_ABSTIME) == TIMER_ABSTIME) {
+		/* Sanity-check the deadline. */
+		if (timeout->tv_sec < 0 ||
+		timeout->tv_nsec < 0 ||
+		timeout->tv_nsec >= 10L) {
+			return EINVAL;
+		}
 		deadline = timeout;
 	} else {
 		struct timespec interval = *timeout;
@@ -1920,7 +1928,7 @@ futex_func_rw_wait(bool shared, int *uad
 	}
 
 	/*
-	 * Now wait.  futex_wait() will dop our op lock once we
+	 * Now wait.  futex_wait() will drop our op lock once we
 	 * are entered into the sleep queue, thus ensuring atomicity
 	 * of wakes with respect to waits.
 	 *



CVS commit: [thorpej-cfargs] src/sys

2021-04-03 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sat Apr  3 21:45:01 UTC 2021

Modified Files:
src/sys/arch/aarch64/aarch64 [thorpej-cfargs]: aarch64_machdep.c
efi_machdep.c locore.S pmapboot.c vm_machdep.c
src/sys/arch/aarch64/include [thorpej-cfargs]: asan.h cpu.h pmap.h
types.h vmparam.h
src/sys/arch/alpha/alpha [thorpej-cfargs]: pmap.c
src/sys/arch/alpha/include [thorpej-cfargs]: lock.h
src/sys/arch/amd64/include [thorpej-cfargs]: types.h
src/sys/arch/amiga/include [thorpej-cfargs]: types.h
src/sys/arch/arm/arm32 [thorpej-cfargs]: arm32_kvminit.c pmap.c
vm_machdep.c
src/sys/arch/arm/cortex [thorpej-cfargs]: gic.c gicv3.c
src/sys/arch/arm/include [thorpej-cfargs]: cpu.h
src/sys/arch/arm/omap [thorpej-cfargs]: ti_iic.c
src/sys/arch/arm/pic [thorpej-cfargs]: pic.c pic_splfuncs.c picvar.h
src/sys/arch/atari/include [thorpej-cfargs]: intr.h types.h
src/sys/arch/bebox/include [thorpej-cfargs]: types.h
src/sys/arch/cats/include [thorpej-cfargs]: types.h
src/sys/arch/cesfic/cesfic [thorpej-cfargs]: isr.c
src/sys/arch/cesfic/include [thorpej-cfargs]: types.h
src/sys/arch/emips/include [thorpej-cfargs]: types.h
src/sys/arch/evbarm/bcm53xx [thorpej-cfargs]: bcm53xx_machdep.c
src/sys/arch/evbarm/beagle [thorpej-cfargs]: beagle_machdep.c
src/sys/arch/evbarm/conf [thorpej-cfargs]: Makefile.evbarm.inc
std.generic std.rpi
src/sys/arch/evbarm/include [thorpej-cfargs]: types.h
src/sys/arch/evbarm/rpi [thorpej-cfargs]: vcio.h
src/sys/arch/evbarm/zynq [thorpej-cfargs]: zynq_machdep.c
src/sys/arch/evbppc/conf [thorpej-cfargs]: Makefile.virtex.inc
Makefile.walnut.inc files.obs405 files.walnut
src/sys/arch/evbppc/evbppc [thorpej-cfargs]: evbppc_machdep.c
src/sys/arch/evbppc/explora [thorpej-cfargs]: machdep.c
src/sys/arch/evbppc/include [thorpej-cfargs]: obs200.h obs266.h
obs600.h
src/sys/arch/evbppc/obs405 [thorpej-cfargs]: obs200_autoconf.c
obs200_machdep.c obs266_autoconf.c obs266_machdep.c
obs600_autoconf.c obs600_machdep.c
src/sys/arch/evbppc/virtex [thorpej-cfargs]: autoconf.c consinit.c
design_gsrd2.c machdep.c
src/sys/arch/evbppc/virtex/dev [thorpej-cfargs]: if_temac.c tft_ll.c
src/sys/arch/evbppc/walnut [thorpej-cfargs]: autoconf.c consinit.c
machdep.c
src/sys/arch/hpcsh/include [thorpej-cfargs]: types.h
src/sys/arch/hppa/include [thorpej-cfargs]: types.h
src/sys/arch/i386/include [thorpej-cfargs]: types.h
src/sys/arch/ia64/include [thorpej-cfargs]: types.h
src/sys/arch/landisk/include [thorpej-cfargs]: types.h
src/sys/arch/luna68k/include [thorpej-cfargs]: types.h
src/sys/arch/luna68k/luna68k [thorpej-cfargs]: isr.c locore.s
src/sys/arch/m68k/include [thorpej-cfargs]: types.h
src/sys/arch/mac68k/include [thorpej-cfargs]: types.h
src/sys/arch/mac68k/mac68k [thorpej-cfargs]: intr.c
src/sys/arch/macppc/conf [thorpej-cfargs]: POWERMAC_G5
src/sys/arch/mips/cavium/dev [thorpej-cfargs]: octeon_fpa.c
src/sys/arch/mips/conf [thorpej-cfargs]: files.mips
src/sys/arch/mips/include [thorpej-cfargs]: Makefile Makefile.inc
cdefs.h cpu.h db_machdep.h frame.h types.h
src/sys/arch/mips/mips [thorpej-cfargs]: mips_machdep.c
mips_stacktrace.c trap.c
src/sys/arch/mvme68k/include [thorpej-cfargs]: types.h
src/sys/arch/mvme68k/mvme68k [thorpej-cfargs]: isr.c locore.s
src/sys/arch/mvmeppc/include [thorpej-cfargs]: types.h
src/sys/arch/netwinder/include [thorpej-cfargs]: types.h
src/sys/arch/news68k/include [thorpej-cfargs]: types.h
src/sys/arch/newsmips/include [thorpej-cfargs]: types.h
src/sys/arch/next68k/include [thorpej-cfargs]: types.h
src/sys/arch/next68k/next68k [thorpej-cfargs]: isr.c
src/sys/arch/or1k/include [thorpej-cfargs]: types.h
src/sys/arch/powerpc/booke [thorpej-cfargs]: booke_machdep.c
src/sys/arch/powerpc/ibm4xx [thorpej-cfargs]: cpu.c ibm4xx_autoconf.c
ibm4xx_machdep.c pmap.c
src/sys/arch/powerpc/ibm4xx/dev [thorpej-cfargs]: emacreg.h if_emac.c
src/sys/arch/powerpc/ibm4xx/openbios [thorpej-cfargs]: locore.S
openbios.c
src/sys/arch/powerpc/include [thorpej-cfargs]: types.h
src/sys/arch/powerpc/include/ibm4xx [thorpej-cfargs]: cpu.h dcr4xx.h
openbios.h tlb.h
src/sys/arch/powerpc/oea [thorpej-cfargs]: cpu_subr.c ofwoea_machdep.c
src/sys/arch/powerpc/pic [thorpej-cfargs]: intr.c picvar.h
src/sys/arch/powerpc/powerpc [thorpej-cfargs]: db_interface.c
src/sys/arch/prep/include [thorpej-cfargs]: types.h

CVS commit: [thorpej-cfargs] src/sys

2021-04-03 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sat Apr  3 21:45:01 UTC 2021

Modified Files:
src/sys/arch/aarch64/aarch64 [thorpej-cfargs]: aarch64_machdep.c
efi_machdep.c locore.S pmapboot.c vm_machdep.c
src/sys/arch/aarch64/include [thorpej-cfargs]: asan.h cpu.h pmap.h
types.h vmparam.h
src/sys/arch/alpha/alpha [thorpej-cfargs]: pmap.c
src/sys/arch/alpha/include [thorpej-cfargs]: lock.h
src/sys/arch/amd64/include [thorpej-cfargs]: types.h
src/sys/arch/amiga/include [thorpej-cfargs]: types.h
src/sys/arch/arm/arm32 [thorpej-cfargs]: arm32_kvminit.c pmap.c
vm_machdep.c
src/sys/arch/arm/cortex [thorpej-cfargs]: gic.c gicv3.c
src/sys/arch/arm/include [thorpej-cfargs]: cpu.h
src/sys/arch/arm/omap [thorpej-cfargs]: ti_iic.c
src/sys/arch/arm/pic [thorpej-cfargs]: pic.c pic_splfuncs.c picvar.h
src/sys/arch/atari/include [thorpej-cfargs]: intr.h types.h
src/sys/arch/bebox/include [thorpej-cfargs]: types.h
src/sys/arch/cats/include [thorpej-cfargs]: types.h
src/sys/arch/cesfic/cesfic [thorpej-cfargs]: isr.c
src/sys/arch/cesfic/include [thorpej-cfargs]: types.h
src/sys/arch/emips/include [thorpej-cfargs]: types.h
src/sys/arch/evbarm/bcm53xx [thorpej-cfargs]: bcm53xx_machdep.c
src/sys/arch/evbarm/beagle [thorpej-cfargs]: beagle_machdep.c
src/sys/arch/evbarm/conf [thorpej-cfargs]: Makefile.evbarm.inc
std.generic std.rpi
src/sys/arch/evbarm/include [thorpej-cfargs]: types.h
src/sys/arch/evbarm/rpi [thorpej-cfargs]: vcio.h
src/sys/arch/evbarm/zynq [thorpej-cfargs]: zynq_machdep.c
src/sys/arch/evbppc/conf [thorpej-cfargs]: Makefile.virtex.inc
Makefile.walnut.inc files.obs405 files.walnut
src/sys/arch/evbppc/evbppc [thorpej-cfargs]: evbppc_machdep.c
src/sys/arch/evbppc/explora [thorpej-cfargs]: machdep.c
src/sys/arch/evbppc/include [thorpej-cfargs]: obs200.h obs266.h
obs600.h
src/sys/arch/evbppc/obs405 [thorpej-cfargs]: obs200_autoconf.c
obs200_machdep.c obs266_autoconf.c obs266_machdep.c
obs600_autoconf.c obs600_machdep.c
src/sys/arch/evbppc/virtex [thorpej-cfargs]: autoconf.c consinit.c
design_gsrd2.c machdep.c
src/sys/arch/evbppc/virtex/dev [thorpej-cfargs]: if_temac.c tft_ll.c
src/sys/arch/evbppc/walnut [thorpej-cfargs]: autoconf.c consinit.c
machdep.c
src/sys/arch/hpcsh/include [thorpej-cfargs]: types.h
src/sys/arch/hppa/include [thorpej-cfargs]: types.h
src/sys/arch/i386/include [thorpej-cfargs]: types.h
src/sys/arch/ia64/include [thorpej-cfargs]: types.h
src/sys/arch/landisk/include [thorpej-cfargs]: types.h
src/sys/arch/luna68k/include [thorpej-cfargs]: types.h
src/sys/arch/luna68k/luna68k [thorpej-cfargs]: isr.c locore.s
src/sys/arch/m68k/include [thorpej-cfargs]: types.h
src/sys/arch/mac68k/include [thorpej-cfargs]: types.h
src/sys/arch/mac68k/mac68k [thorpej-cfargs]: intr.c
src/sys/arch/macppc/conf [thorpej-cfargs]: POWERMAC_G5
src/sys/arch/mips/cavium/dev [thorpej-cfargs]: octeon_fpa.c
src/sys/arch/mips/conf [thorpej-cfargs]: files.mips
src/sys/arch/mips/include [thorpej-cfargs]: Makefile Makefile.inc
cdefs.h cpu.h db_machdep.h frame.h types.h
src/sys/arch/mips/mips [thorpej-cfargs]: mips_machdep.c
mips_stacktrace.c trap.c
src/sys/arch/mvme68k/include [thorpej-cfargs]: types.h
src/sys/arch/mvme68k/mvme68k [thorpej-cfargs]: isr.c locore.s
src/sys/arch/mvmeppc/include [thorpej-cfargs]: types.h
src/sys/arch/netwinder/include [thorpej-cfargs]: types.h
src/sys/arch/news68k/include [thorpej-cfargs]: types.h
src/sys/arch/newsmips/include [thorpej-cfargs]: types.h
src/sys/arch/next68k/include [thorpej-cfargs]: types.h
src/sys/arch/next68k/next68k [thorpej-cfargs]: isr.c
src/sys/arch/or1k/include [thorpej-cfargs]: types.h
src/sys/arch/powerpc/booke [thorpej-cfargs]: booke_machdep.c
src/sys/arch/powerpc/ibm4xx [thorpej-cfargs]: cpu.c ibm4xx_autoconf.c
ibm4xx_machdep.c pmap.c
src/sys/arch/powerpc/ibm4xx/dev [thorpej-cfargs]: emacreg.h if_emac.c
src/sys/arch/powerpc/ibm4xx/openbios [thorpej-cfargs]: locore.S
openbios.c
src/sys/arch/powerpc/include [thorpej-cfargs]: types.h
src/sys/arch/powerpc/include/ibm4xx [thorpej-cfargs]: cpu.h dcr4xx.h
openbios.h tlb.h
src/sys/arch/powerpc/oea [thorpej-cfargs]: cpu_subr.c ofwoea_machdep.c
src/sys/arch/powerpc/pic [thorpej-cfargs]: intr.c picvar.h
src/sys/arch/powerpc/powerpc [thorpej-cfargs]: db_interface.c
src/sys/arch/prep/include [thorpej-cfargs]: types.h

CVS commit: src/doc

2021-04-03 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sat Apr  3 21:36:03 UTC 2021

Modified Files:
src/doc: BRANCHES

Log Message:
Document thorpej-cfargs branch.


To generate a diff of this commit:
cvs rdiff -u -r1.356 -r1.357 src/doc/BRANCHES

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



CVS commit: src/doc

2021-04-03 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sat Apr  3 21:36:03 UTC 2021

Modified Files:
src/doc: BRANCHES

Log Message:
Document thorpej-cfargs branch.


To generate a diff of this commit:
cvs rdiff -u -r1.356 -r1.357 src/doc/BRANCHES

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

Modified files:

Index: src/doc/BRANCHES
diff -u src/doc/BRANCHES:1.356 src/doc/BRANCHES:1.357
--- src/doc/BRANCHES:1.356	Fri Dec 18 01:08:13 2020
+++ src/doc/BRANCHES	Sat Apr  3 21:36:03 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: BRANCHES,v 1.356 2020/12/18 01:08:13 thorpej Exp $
+#	$NetBSD: BRANCHES,v 1.357 2021/04/03 21:36:03 thorpej Exp $
 #
 # This file contains a list of branches that exist in the NetBSD CVS
 # tree and their current state.
@@ -723,6 +723,17 @@ Notes:		No longer active due to the lack
 		(before the merge to -current) with an interop IPv6 test.
 		More info at: http://www.tahi.org/
 
+Branch:		thorpej-cfargs
+Description:	Clean up hwo arguments are passed to various autoconfiguration
+		routines.
+Status:		Active
+Start Date:	Sat March 20 2021
+End Date:
+Base Tag:	thorpej-cfargs-base
+Maintainer:	Jason Thorpe 
+Scope:		src/sys
+Notes:
+
 Branch:		thorpej-futex
 Description:	Overhaul of futex operations to fix thread priority issues
 Status:		Active
@@ -731,7 +742,7 @@ End Date:
 Base Tag:	thorpej-futex-base
 Maintainer:	Jason Thorpe 
 Scope:		src/sys src/tests/lib/libc/sys src/distrib/sets/lists
-Note:		Normal futex operataions pass the test suite, but there are
+Notes:		Normal futex operataions pass the test suite, but there are
 		issues with Linux compatibility currently, that need to be
 		addressed before merging.  Also includes new NetBSD extensions
 		to the futex interface to support reader/writer locks.  Those



CVS commit: [thorpej-cfargs] src/sys

2021-04-03 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sat Apr  3 21:21:08 UTC 2021

Modified Files:
src/sys/arch/arm/acpi [thorpej-cfargs]: acpi_platform.c
src/sys/arch/arm/altera [thorpej-cfargs]: cycv_platform.c
src/sys/arch/arm/amlogic [thorpej-cfargs]: meson_platform.c
src/sys/arch/arm/broadcom [thorpej-cfargs]: bcm283x_platform.c
src/sys/arch/arm/fdt [thorpej-cfargs]: arm_platform.c
src/sys/arch/arm/nvidia [thorpej-cfargs]: tegra_platform.c
src/sys/arch/arm/nxp [thorpej-cfargs]: imx6_platform.c
src/sys/arch/arm/rockchip [thorpej-cfargs]: rk_platform.c
src/sys/arch/arm/samsung [thorpej-cfargs]: exynos_platform.c
src/sys/arch/arm/sunxi [thorpej-cfargs]: sunxi_platform.c
src/sys/arch/arm/ti [thorpej-cfargs]: omap3_platform.c
src/sys/arch/arm/vexpress [thorpej-cfargs]: vexpress_platform.c
src/sys/arch/arm/virt [thorpej-cfargs]: virt_platform.c
src/sys/arch/arm/xilinx [thorpej-cfargs]: zynq_platform.c
src/sys/dev/fdt [thorpej-cfargs]: fdtbus.c fdtvar.h
src/sys/dev/ofw [thorpej-cfargs]: ofw_subr.c openfirm.h

Log Message:
- FDT device enumeration now sets the device handle using CFARG_DEVHANDLE.
- fdtbus_device_register() is now obsolete, so G/C it.
- of_device_register() is now obsolete, so G/C it.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.24.2.1 src/sys/arch/arm/acpi/acpi_platform.c
cvs rdiff -u -r1.17 -r1.17.2.1 src/sys/arch/arm/altera/cycv_platform.c
cvs rdiff -u -r1.19 -r1.19.2.1 src/sys/arch/arm/amlogic/meson_platform.c
cvs rdiff -u -r1.47 -r1.47.2.1 src/sys/arch/arm/broadcom/bcm283x_platform.c
cvs rdiff -u -r1.4 -r1.4.2.1 src/sys/arch/arm/fdt/arm_platform.c
cvs rdiff -u -r1.26 -r1.26.2.1 src/sys/arch/arm/nvidia/tegra_platform.c
cvs rdiff -u -r1.5 -r1.5.2.1 src/sys/arch/arm/nxp/imx6_platform.c
cvs rdiff -u -r1.11 -r1.11.2.1 src/sys/arch/arm/rockchip/rk_platform.c
cvs rdiff -u -r1.37 -r1.37.2.1 src/sys/arch/arm/samsung/exynos_platform.c
cvs rdiff -u -r1.42 -r1.42.2.1 src/sys/arch/arm/sunxi/sunxi_platform.c
cvs rdiff -u -r1.6 -r1.6.2.1 src/sys/arch/arm/ti/omap3_platform.c
cvs rdiff -u -r1.21 -r1.21.2.1 src/sys/arch/arm/vexpress/vexpress_platform.c
cvs rdiff -u -r1.13 -r1.13.2.1 src/sys/arch/arm/virt/virt_platform.c
cvs rdiff -u -r1.4 -r1.4.2.1 src/sys/arch/arm/xilinx/zynq_platform.c
cvs rdiff -u -r1.40.2.3 -r1.40.2.4 src/sys/dev/fdt/fdtbus.c
cvs rdiff -u -r1.69 -r1.69.2.1 src/sys/dev/fdt/fdtvar.h
cvs rdiff -u -r1.57 -r1.57.2.1 src/sys/dev/ofw/ofw_subr.c
cvs rdiff -u -r1.46 -r1.46.2.1 src/sys/dev/ofw/openfirm.h

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

Modified files:

Index: src/sys/arch/arm/acpi/acpi_platform.c
diff -u src/sys/arch/arm/acpi/acpi_platform.c:1.24 src/sys/arch/arm/acpi/acpi_platform.c:1.24.2.1
--- src/sys/arch/arm/acpi/acpi_platform.c:1.24	Fri Feb 12 12:26:09 2021
+++ src/sys/arch/arm/acpi/acpi_platform.c	Sat Apr  3 21:21:07 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_platform.c,v 1.24 2021/02/12 12:26:09 jmcneill Exp $ */
+/* $NetBSD: acpi_platform.c,v 1.24.2.1 2021/04/03 21:21:07 thorpej Exp $ */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
 #include "opt_multiprocessor.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: acpi_platform.c,v 1.24 2021/02/12 12:26:09 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_platform.c,v 1.24.2.1 2021/04/03 21:21:07 thorpej Exp $");
 
 #include 
 #include 
@@ -287,9 +287,7 @@ acpi_platform_init_attach_args(struct fd
 static void
 acpi_platform_device_register(device_t self, void *aux)
 {
-	/* XXX Not ideal, but the only reasonable solution atm. */
 	acpi_device_register(self, aux);
-	fdtbus_device_register(self, aux);
 
 #if NCOM > 0
 	prop_dictionary_t prop = device_properties(self);

Index: src/sys/arch/arm/altera/cycv_platform.c
diff -u src/sys/arch/arm/altera/cycv_platform.c:1.17 src/sys/arch/arm/altera/cycv_platform.c:1.17.2.1
--- src/sys/arch/arm/altera/cycv_platform.c:1.17	Thu Feb  4 22:36:52 2021
+++ src/sys/arch/arm/altera/cycv_platform.c	Sat Apr  3 21:21:07 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: cycv_platform.c,v 1.17 2021/02/04 22:36:52 thorpej Exp $ */
+/* $NetBSD: cycv_platform.c,v 1.17.2.1 2021/04/03 21:21:07 thorpej Exp $ */
 
 /* This file is in the public domain. */
 
@@ -7,7 +7,7 @@
 #include "opt_multiprocessor.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cycv_platform.c,v 1.17 2021/02/04 22:36:52 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cycv_platform.c,v 1.17.2.1 2021/04/03 21:21:07 thorpej Exp $");
 
 #define	_ARM32_BUS_DMA_PRIVATE
 #include 
@@ -141,8 +141,6 @@ cycv_platform_device_register(device_t d
 {
 	prop_dictionary_t dict = device_properties(dev);
 
-	fdtbus_device_register(dev, aux);
-
 	if (device_is_a(dev, "arma9tmr")) {
 		prop_dictionary_set_uint32(dict, "frequency",
 			cycv_clkmgr_early_get_mpu_clk() / 4);

Index: src/sys/arch/arm/amlogic/meson_platform.c
diff -u 

CVS commit: [thorpej-cfargs] src/sys

2021-04-03 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sat Apr  3 21:21:08 UTC 2021

Modified Files:
src/sys/arch/arm/acpi [thorpej-cfargs]: acpi_platform.c
src/sys/arch/arm/altera [thorpej-cfargs]: cycv_platform.c
src/sys/arch/arm/amlogic [thorpej-cfargs]: meson_platform.c
src/sys/arch/arm/broadcom [thorpej-cfargs]: bcm283x_platform.c
src/sys/arch/arm/fdt [thorpej-cfargs]: arm_platform.c
src/sys/arch/arm/nvidia [thorpej-cfargs]: tegra_platform.c
src/sys/arch/arm/nxp [thorpej-cfargs]: imx6_platform.c
src/sys/arch/arm/rockchip [thorpej-cfargs]: rk_platform.c
src/sys/arch/arm/samsung [thorpej-cfargs]: exynos_platform.c
src/sys/arch/arm/sunxi [thorpej-cfargs]: sunxi_platform.c
src/sys/arch/arm/ti [thorpej-cfargs]: omap3_platform.c
src/sys/arch/arm/vexpress [thorpej-cfargs]: vexpress_platform.c
src/sys/arch/arm/virt [thorpej-cfargs]: virt_platform.c
src/sys/arch/arm/xilinx [thorpej-cfargs]: zynq_platform.c
src/sys/dev/fdt [thorpej-cfargs]: fdtbus.c fdtvar.h
src/sys/dev/ofw [thorpej-cfargs]: ofw_subr.c openfirm.h

Log Message:
- FDT device enumeration now sets the device handle using CFARG_DEVHANDLE.
- fdtbus_device_register() is now obsolete, so G/C it.
- of_device_register() is now obsolete, so G/C it.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.24.2.1 src/sys/arch/arm/acpi/acpi_platform.c
cvs rdiff -u -r1.17 -r1.17.2.1 src/sys/arch/arm/altera/cycv_platform.c
cvs rdiff -u -r1.19 -r1.19.2.1 src/sys/arch/arm/amlogic/meson_platform.c
cvs rdiff -u -r1.47 -r1.47.2.1 src/sys/arch/arm/broadcom/bcm283x_platform.c
cvs rdiff -u -r1.4 -r1.4.2.1 src/sys/arch/arm/fdt/arm_platform.c
cvs rdiff -u -r1.26 -r1.26.2.1 src/sys/arch/arm/nvidia/tegra_platform.c
cvs rdiff -u -r1.5 -r1.5.2.1 src/sys/arch/arm/nxp/imx6_platform.c
cvs rdiff -u -r1.11 -r1.11.2.1 src/sys/arch/arm/rockchip/rk_platform.c
cvs rdiff -u -r1.37 -r1.37.2.1 src/sys/arch/arm/samsung/exynos_platform.c
cvs rdiff -u -r1.42 -r1.42.2.1 src/sys/arch/arm/sunxi/sunxi_platform.c
cvs rdiff -u -r1.6 -r1.6.2.1 src/sys/arch/arm/ti/omap3_platform.c
cvs rdiff -u -r1.21 -r1.21.2.1 src/sys/arch/arm/vexpress/vexpress_platform.c
cvs rdiff -u -r1.13 -r1.13.2.1 src/sys/arch/arm/virt/virt_platform.c
cvs rdiff -u -r1.4 -r1.4.2.1 src/sys/arch/arm/xilinx/zynq_platform.c
cvs rdiff -u -r1.40.2.3 -r1.40.2.4 src/sys/dev/fdt/fdtbus.c
cvs rdiff -u -r1.69 -r1.69.2.1 src/sys/dev/fdt/fdtvar.h
cvs rdiff -u -r1.57 -r1.57.2.1 src/sys/dev/ofw/ofw_subr.c
cvs rdiff -u -r1.46 -r1.46.2.1 src/sys/dev/ofw/openfirm.h

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



CVS commit: src/external/bsd/top/dist/machine

2021-04-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Apr  3 19:25:38 UTC 2021

Modified Files:
src/external/bsd/top/dist/machine: m_netbsd.c

Log Message:
- Bump field width for state to accommodate > 9 CPUs
- When star formatting to adjust the width, count the trailing number of
  digits starting backwards instead of using strcspn because the lwp name
  might contain other digits like wm0TxRx/10.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/external/bsd/top/dist/machine/m_netbsd.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/bsd/top/dist/machine/m_netbsd.c
diff -u src/external/bsd/top/dist/machine/m_netbsd.c:1.23 src/external/bsd/top/dist/machine/m_netbsd.c:1.24
--- src/external/bsd/top/dist/machine/m_netbsd.c:1.23	Sat Apr 27 10:10:01 2019
+++ src/external/bsd/top/dist/machine/m_netbsd.c	Sat Apr  3 15:25:38 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: m_netbsd.c,v 1.23 2019/04/27 14:10:01 christos Exp $	*/
+/*	$NetBSD: m_netbsd.c,v 1.24 2021/04/03 19:25:38 christos Exp $	*/
 
 /*
  * top - a top users display for Unix
@@ -37,12 +37,12 @@
  *		Andrew Doran 
  *
  *
- * $Id: m_netbsd.c,v 1.23 2019/04/27 14:10:01 christos Exp $
+ * $Id: m_netbsd.c,v 1.24 2021/04/03 19:25:38 christos Exp $
  */
 #include 
 
 #ifndef lint
-__RCSID("$NetBSD: m_netbsd.c,v 1.23 2019/04/27 14:10:01 christos Exp $");
+__RCSID("$NetBSD: m_netbsd.c,v 1.24 2021/04/03 19:25:38 christos Exp $");
 #endif
 
 #include 
@@ -57,6 +57,7 @@ __RCSID("$NetBSD: m_netbsd.c,v 1.23 2019
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -102,18 +103,18 @@ struct handle {
  */
 
 static char Proc_header[] =
-  "  PID XPRI NICE   SIZE   RES STATE  TIME   WCPUCPU COMMAND";
+  "  PID XPRI NICE   SIZE   RES STATE   TIME  WCPU   CPU   COMMAND";
 /* 0123456   -- field to fill in starts at header+6 */
 #define PROC_UNAME_START 6
 #define Proc_format \
-	"%5d %-8.8s %3d %4d%7s %5s %-8.8s%7s %5.*f%% %5.*f%% %s"
+	"%5d %-8.8s %3d %4d%7s %5s %-9.9s%7s %5.*f%% %5.*f%% %s"
 
 static char Thread_header[] =
-  "  PID   LID XPRI STATE  TIME   WCPUCPU NAME  COMMAND";
+  "  PID   LID XPRI STATE   TIME  WCPU   CPU   NAME  COMMAND";
 /* 0123456   -- field to fill in starts at header+6 */
 #define THREAD_UNAME_START 12
 #define Thread_format \
-"%5d %5d %-8.8s %3d %-8.8s%7s %5.2f%% %5.2f%% %-9.9s %s"
+"%5d %5d %-8.8s %3d %-9.9s%7s %5.2f%% %5.2f%% %-9.9s %s"
 
 /* 
  * Process state names for the "STATE" column of the display.
@@ -879,19 +880,25 @@ format_next_proc(caddr_t handle, char *(
 }
 
 static char *
-countable(char *p, size_t l)
+countable(char *p, size_t width)
 {
-	static const char digits[] = "0123456789";
-	size_t first = strcspn(p, digits);		// non digits
-	size_t last = strspn(p + first, digits);	// trailing digits
-	size_t len = first + last;			
-	if (p[len] || last == 0)	// should be total and must have digits
+	size_t len = strlen(p);
+	if (len < width) {		// shorter than width, ok
 		return p;
-	if (len < l)			// if shorter, done
+	}
+	size_t first, last = len - 1;
+	for (first = len - 1; isdigit((unsigned char)p[first]); first--) {
+		continue;
+	}
+	if (first == len - 1) {		// no digits, ok
 		return p;
-	if (l < last + 1)		// if not enough for digits, done
+	}
+	first++;
+	last = len - first;
+	if (width < last + 1) {		// if not enough for digits, done
 		return p;
-	size_t start = l - last - 1;	// compute starting point
+	}
+	size_t start = width - last - 1;	// compute starting point
 	p[start] = '*';			// put a star
 	memmove(p + start + 1, p + first, last + 1);	// move digits and NUL
 	return p;



CVS commit: src/external/bsd/top/dist/machine

2021-04-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Apr  3 19:25:38 UTC 2021

Modified Files:
src/external/bsd/top/dist/machine: m_netbsd.c

Log Message:
- Bump field width for state to accommodate > 9 CPUs
- When star formatting to adjust the width, count the trailing number of
  digits starting backwards instead of using strcspn because the lwp name
  might contain other digits like wm0TxRx/10.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/external/bsd/top/dist/machine/m_netbsd.c

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



CVS commit: src/doc

2021-04-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Apr  3 17:46:07 UTC 2021

Modified Files:
src/doc: 3RDPARTY CHANGES

Log Message:
new acpica


To generate a diff of this commit:
cvs rdiff -u -r1.1787 -r1.1788 src/doc/3RDPARTY
cvs rdiff -u -r1.2790 -r1.2791 src/doc/CHANGES

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

Modified files:

Index: src/doc/3RDPARTY
diff -u src/doc/3RDPARTY:1.1787 src/doc/3RDPARTY:1.1788
--- src/doc/3RDPARTY:1.1787	Fri Mar 26 04:21:32 2021
+++ src/doc/3RDPARTY	Sat Apr  3 13:46:07 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.1787 2021/03/26 08:21:32 wiz Exp $
+#	$NetBSD: 3RDPARTY,v 1.1788 2021/04/03 17:46:07 christos Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -41,12 +41,12 @@
 #
 
 Package:	acpica
-Version:	20201113
-Current Vers:	20210105
+Version:	20210331
+Current Vers:	20210331
 Maintainer:	Intel
 Archive Site:	http://www.acpica.org/downloads/
 Home Page:	http://www.acpica.org/
-Date:		2020-11-27
+Date:		2021-04-03
 Mailing List:	de...@acpica.org
 License:	BSD-like
 Responsible:	jruoho

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.2790 src/doc/CHANGES:1.2791
--- src/doc/CHANGES:1.2790	Fri Apr  2 10:41:07 2021
+++ src/doc/CHANGES	Sat Apr  3 13:46:07 2021
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2790 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2791 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -345,3 +345,4 @@ Changes from NetBSD 9.0 to NetBSD 10.0:
 	OpenSSL: Imported 1.1.1k. [christos 20210325]
 	evbppc: Add support for DHT Walnut 405GP evaluation board.
 		[rin 20210402]
+	acpi(4): Updated ACPICA to 20210331. [christos 20210403]



CVS commit: src/doc

2021-04-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Apr  3 17:46:07 UTC 2021

Modified Files:
src/doc: 3RDPARTY CHANGES

Log Message:
new acpica


To generate a diff of this commit:
cvs rdiff -u -r1.1787 -r1.1788 src/doc/3RDPARTY
cvs rdiff -u -r1.2790 -r1.2791 src/doc/CHANGES

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



CVS commit: src/sys/external/bsd/acpica/dist

2021-04-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Apr  3 17:45:04 UTC 2021

Modified Files:
src/sys/external/bsd/acpica/dist/common: dmtables.c dmtbdump.c
dmtbinfo.c
src/sys/external/bsd/acpica/dist/compiler: aslanalyze.c aslcompile.c
aslcompiler.h aslcompiler.l aslerror.c aslfileio.c aslfiles.c
aslload.c asllookup.c aslopcodes.c aslopt.c asloptions.c
aslpredef.c aslprepkg.c aslsupport.l asltree.c aslutils.c
aslwalks.c aslxref.c dtcompile.c dtcompilerparser.y dtfield.c
dtparser.y dtsubtable.c dttable.c dtutils.c prparser.y prutils.c
src/sys/external/bsd/acpica/dist/debugger: dbcmds.c dbdisply.c dbexec.c
dbinput.c dbmethod.c dbnames.c dbtest.c dbutils.c
src/sys/external/bsd/acpica/dist/disassembler: dmbuffer.c dmcstyle.c
dmresrc.c dmresrcl.c dmresrcl2.c dmwalk.c
src/sys/external/bsd/acpica/dist/dispatcher: dscontrol.c dsopcode.c
dspkginit.c dsutils.c
src/sys/external/bsd/acpica/dist/events: evregion.c evrgnini.c
evxface.c
src/sys/external/bsd/acpica/dist/executer: exconfig.c exdebug.c
exdump.c
src/sys/external/bsd/acpica/dist/hardware: hwesleep.c hwregs.c
hwsleep.c hwxfsleep.c
src/sys/external/bsd/acpica/dist/include: acapps.h acdebug.h acdisasm.h
acexcep.h acglobal.h acinterp.h aclocal.h acmacros.h acnamesp.h
acoutput.h acpiosxf.h acpixf.h acresrc.h actables.h actbl1.h
actypes.h acutils.h amlresrc.h
src/sys/external/bsd/acpica/dist/include/platform: acgcc.h acnetbsd.h
src/sys/external/bsd/acpica/dist/namespace: nsaccess.c nsdump.c
nseval.c nsinit.c nsrepair2.c nsxfeval.c nsxfname.c
src/sys/external/bsd/acpica/dist/os_specific/service_layers:
oslinuxtbl.c
src/sys/external/bsd/acpica/dist/parser: psopcode.c psopinfo.c
src/sys/external/bsd/acpica/dist/resources: rsdump.c rsdumpinfo.c
rsutils.c rsxface.c
src/sys/external/bsd/acpica/dist/tables: tbdata.c tbfadt.c tbinstal.c
tbutils.c tbxface.c tbxfload.c tbxfroot.c
src/sys/external/bsd/acpica/dist/tools/acpidump: apfiles.c
src/sys/external/bsd/acpica/dist/tools/acpixtract: acpixtract.c
src/sys/external/bsd/acpica/dist/utilities: utcache.c utdebug.c
utdecode.c utdelete.c uteval.c utglobal.c utmisc.c utmutex.c
utnonansi.c utobject.c utosi.c utprint.c uttrack.c utuuid.c

Log Message:
Merge local changes with acpica-20210331


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/external/bsd/acpica/dist/common/dmtables.c
cvs rdiff -u -r1.12 -r1.13 src/sys/external/bsd/acpica/dist/common/dmtbdump.c
cvs rdiff -u -r1.18 -r1.19 src/sys/external/bsd/acpica/dist/common/dmtbinfo.c
cvs rdiff -u -r1.14 -r1.15 \
src/sys/external/bsd/acpica/dist/compiler/aslanalyze.c \
src/sys/external/bsd/acpica/dist/compiler/aslprepkg.c \
src/sys/external/bsd/acpica/dist/compiler/aslwalks.c \
src/sys/external/bsd/acpica/dist/compiler/dttable.c
cvs rdiff -u -r1.19 -r1.20 \
src/sys/external/bsd/acpica/dist/compiler/aslcompile.c
cvs rdiff -u -r1.17 -r1.18 \
src/sys/external/bsd/acpica/dist/compiler/aslcompiler.h
cvs rdiff -u -r1.18 -r1.19 \
src/sys/external/bsd/acpica/dist/compiler/aslcompiler.l
cvs rdiff -u -r1.16 -r1.17 \
src/sys/external/bsd/acpica/dist/compiler/aslerror.c \
src/sys/external/bsd/acpica/dist/compiler/aslfiles.c \
src/sys/external/bsd/acpica/dist/compiler/dtcompile.c \
src/sys/external/bsd/acpica/dist/compiler/dtfield.c
cvs rdiff -u -r1.11 -r1.12 \
src/sys/external/bsd/acpica/dist/compiler/aslfileio.c
cvs rdiff -u -r1.20 -r1.21 \
src/sys/external/bsd/acpica/dist/compiler/aslload.c \
src/sys/external/bsd/acpica/dist/compiler/aslxref.c
cvs rdiff -u -r1.13 -r1.14 \
src/sys/external/bsd/acpica/dist/compiler/asllookup.c \
src/sys/external/bsd/acpica/dist/compiler/aslopcodes.c \
src/sys/external/bsd/acpica/dist/compiler/asloptions.c \
src/sys/external/bsd/acpica/dist/compiler/aslpredef.c \
src/sys/external/bsd/acpica/dist/compiler/prutils.c
cvs rdiff -u -r1.9 -r1.10 src/sys/external/bsd/acpica/dist/compiler/aslopt.c
cvs rdiff -u -r1.15 -r1.16 \
src/sys/external/bsd/acpica/dist/compiler/aslsupport.l \
src/sys/external/bsd/acpica/dist/compiler/asltree.c \
src/sys/external/bsd/acpica/dist/compiler/dtparser.y \
src/sys/external/bsd/acpica/dist/compiler/dtutils.c \
src/sys/external/bsd/acpica/dist/compiler/prparser.y
cvs rdiff -u -r1.27 -r1.28 \
src/sys/external/bsd/acpica/dist/compiler/aslutils.c
cvs rdiff -u -r1.4 -r1.5 \
src/sys/external/bsd/acpica/dist/compiler/dtcompilerparser.y
cvs rdiff -u -r1.12 -r1.13 \
src/sys/external/bsd/acpica/dist/compiler/dtsubtable.c
cvs rdiff -u -r1.14 -r1.15 src/sys/external/bsd/acpica/dist/debugger/dbcmds.c \

CVS import: src/sys/external/bsd/acpica/dist

2021-04-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Apr  3 17:43:43 UTC 2021

Update of /cvsroot/src/sys/external/bsd/acpica/dist
In directory ivanova.netbsd.org:/tmp/cvs-serv19872

Log Message:
31 March 2021. Summary of changes for version 20210331:

This release is available at https://acpica.org/downloads, and
includes all ACPI 6.4 support

1) ACPICA kernel-resident subsystem:
ACPI 6.4: iASL: deprecate DDBHandleObj keyword
Always create namespace nodes using AcpiNsCreateNode(). ACPICA is
allocating an object using kmalloc(), but then frees it using
kmem_cache_free(<"Acpi-Namespace" kmem_cache>). This is wrong.
Fixed a race condition in generic serial bus operation region
handler. Fixed by Hans de Goede.

2) iASL Compiler/Disassembler and ACPICA tools:

ACPI 6.4: NFIT: add Location Cookie field
ACPI 6.4: HMAT: add new fields/flags
ACPI 6.4: Add new flags in SRAT
ACPI 6.4: add SDEV secure access components
ACPI 6.4: add Csi2Bus resource template
ACPI 6.4: add support for PHAT table
ACPI 6.4: add support for PMTT table
Add disassembly support for the IVRS table. Compilation of the
table is not yet complete.  Fixed a potential infinite loop due to
type mismatch. The for-loop is using a UINT8 counter and comparing
the upper limit against a UINT32 AslGbl_ExpectedMessagesIndex
maximum. In the case where AslGbl_ExpectedMessagesIndex is > 255
the counter i will wrap around to zero and the loop will never
exit. I suspect the AslGbl_ExpectedMessagesIndex is never that
high, but fixing this does future proof the code and cleans up
static analysis warnings.Colin King.

iASL/TableCompiler: update it with IORT table E.b revision changes.
From shamiali2008.
iASL/TableCompiler: Add compilation support for the VIOT table.
Signed-off-by: Jean-Philippe Brucker.
iASL/TableCompiler: Add compilation support for CEDT table.
 Also, update the CEDT template.

Status:

Vendor Tag: intel
Release Tags:   acpica-20210331

U src/sys/external/bsd/acpica/dist/changes.txt
U src/sys/external/bsd/acpica/dist/Makefile
U src/sys/external/bsd/acpica/dist/generate/lint/files.lnt
U src/sys/external/bsd/acpica/dist/generate/lint/lint.bat
U src/sys/external/bsd/acpica/dist/generate/lint/lset.bat
U src/sys/external/bsd/acpica/dist/generate/lint/options.lnt
U src/sys/external/bsd/acpica/dist/generate/lint/readme.txt
U src/sys/external/bsd/acpica/dist/generate/lint/std16.lnt
U src/sys/external/bsd/acpica/dist/generate/lint/std32.lnt
U src/sys/external/bsd/acpica/dist/generate/lint/std64.lnt
U src/sys/external/bsd/acpica/dist/generate/release/build.sh
U src/sys/external/bsd/acpica/dist/generate/release/release.sh
U src/sys/external/bsd/acpica/dist/generate/unix/Makefile
U src/sys/external/bsd/acpica/dist/generate/unix/Makefile.common
U src/sys/external/bsd/acpica/dist/generate/unix/Makefile.config
U src/sys/external/bsd/acpica/dist/generate/unix/Makefile.rules
U src/sys/external/bsd/acpica/dist/generate/unix/readme.txt
U src/sys/external/bsd/acpica/dist/generate/unix/acpibin/Makefile
U src/sys/external/bsd/acpica/dist/generate/unix/acpidump/Makefile
U src/sys/external/bsd/acpica/dist/generate/unix/acpiexamples/Makefile
U src/sys/external/bsd/acpica/dist/generate/unix/acpiexec/Makefile
U src/sys/external/bsd/acpica/dist/generate/unix/acpihelp/Makefile
U src/sys/external/bsd/acpica/dist/generate/unix/acpisrc/Makefile
U src/sys/external/bsd/acpica/dist/generate/unix/acpixtract/Makefile
U src/sys/external/bsd/acpica/dist/generate/unix/iasl/Makefile
U src/sys/external/bsd/acpica/dist/common/acfileio.c
U src/sys/external/bsd/acpica/dist/common/acgetline.c
U src/sys/external/bsd/acpica/dist/common/adfile.c
U src/sys/external/bsd/acpica/dist/common/adisasm.c
U src/sys/external/bsd/acpica/dist/common/adwalk.c
U src/sys/external/bsd/acpica/dist/common/ahids.c
U src/sys/external/bsd/acpica/dist/common/ahpredef.c
U src/sys/external/bsd/acpica/dist/common/ahtable.c
U src/sys/external/bsd/acpica/dist/common/ahuuids.c
U src/sys/external/bsd/acpica/dist/common/cmfsize.c
U src/sys/external/bsd/acpica/dist/common/dmextern.c
U src/sys/external/bsd/acpica/dist/common/dmrestag.c
U src/sys/external/bsd/acpica/dist/common/dmswitch.c
U src/sys/external/bsd/acpica/dist/common/dmtable.c
C src/sys/external/bsd/acpica/dist/common/dmtables.c
C src/sys/external/bsd/acpica/dist/common/dmtbdump.c
U src/sys/external/bsd/acpica/dist/common/dmtbdump1.c
U src/sys/external/bsd/acpica/dist/common/dmtbdump2.c
U src/sys/external/bsd/acpica/dist/common/dmtbdump3.c
C src/sys/external/bsd/acpica/dist/common/dmtbinfo.c
U src/sys/external/bsd/acpica/dist/common/dmtbinfo1.c
U src/sys/external/bsd/acpica/dist/common/dmtbinfo2.c
U src/sys/external/bsd/acpica/dist/common/dmtbinfo3.c
U src/sys/external/bsd/acpica/dist/common/getopt.c
U src/sys/external/bsd/acpica/dist/tests/misc/badcode.asl
U src/sys/external/bsd/acpica/dist/tests/misc/converterSample.asl
U src/sys/external/bsd/acpica/dist/tests/misc/grammar.asl
U 

CVS import: src/sys/external/bsd/acpica/dist

2021-04-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Apr  3 17:43:43 UTC 2021

Update of /cvsroot/src/sys/external/bsd/acpica/dist
In directory ivanova.netbsd.org:/tmp/cvs-serv19872

Log Message:
31 March 2021. Summary of changes for version 20210331:

This release is available at https://acpica.org/downloads, and
includes all ACPI 6.4 support

1) ACPICA kernel-resident subsystem:
ACPI 6.4: iASL: deprecate DDBHandleObj keyword
Always create namespace nodes using AcpiNsCreateNode(). ACPICA is
allocating an object using kmalloc(), but then frees it using
kmem_cache_free(<"Acpi-Namespace" kmem_cache>). This is wrong.
Fixed a race condition in generic serial bus operation region
handler. Fixed by Hans de Goede.

2) iASL Compiler/Disassembler and ACPICA tools:

ACPI 6.4: NFIT: add Location Cookie field
ACPI 6.4: HMAT: add new fields/flags
ACPI 6.4: Add new flags in SRAT
ACPI 6.4: add SDEV secure access components
ACPI 6.4: add Csi2Bus resource template
ACPI 6.4: add support for PHAT table
ACPI 6.4: add support for PMTT table
Add disassembly support for the IVRS table. Compilation of the
table is not yet complete.  Fixed a potential infinite loop due to
type mismatch. The for-loop is using a UINT8 counter and comparing
the upper limit against a UINT32 AslGbl_ExpectedMessagesIndex
maximum. In the case where AslGbl_ExpectedMessagesIndex is > 255
the counter i will wrap around to zero and the loop will never
exit. I suspect the AslGbl_ExpectedMessagesIndex is never that
high, but fixing this does future proof the code and cleans up
static analysis warnings.Colin King.

iASL/TableCompiler: update it with IORT table E.b revision changes.
From shamiali2008.
iASL/TableCompiler: Add compilation support for the VIOT table.
Signed-off-by: Jean-Philippe Brucker.
iASL/TableCompiler: Add compilation support for CEDT table.
 Also, update the CEDT template.

Status:

Vendor Tag: intel
Release Tags:   acpica-20210331

U src/sys/external/bsd/acpica/dist/changes.txt
U src/sys/external/bsd/acpica/dist/Makefile
U src/sys/external/bsd/acpica/dist/generate/lint/files.lnt
U src/sys/external/bsd/acpica/dist/generate/lint/lint.bat
U src/sys/external/bsd/acpica/dist/generate/lint/lset.bat
U src/sys/external/bsd/acpica/dist/generate/lint/options.lnt
U src/sys/external/bsd/acpica/dist/generate/lint/readme.txt
U src/sys/external/bsd/acpica/dist/generate/lint/std16.lnt
U src/sys/external/bsd/acpica/dist/generate/lint/std32.lnt
U src/sys/external/bsd/acpica/dist/generate/lint/std64.lnt
U src/sys/external/bsd/acpica/dist/generate/release/build.sh
U src/sys/external/bsd/acpica/dist/generate/release/release.sh
U src/sys/external/bsd/acpica/dist/generate/unix/Makefile
U src/sys/external/bsd/acpica/dist/generate/unix/Makefile.common
U src/sys/external/bsd/acpica/dist/generate/unix/Makefile.config
U src/sys/external/bsd/acpica/dist/generate/unix/Makefile.rules
U src/sys/external/bsd/acpica/dist/generate/unix/readme.txt
U src/sys/external/bsd/acpica/dist/generate/unix/acpibin/Makefile
U src/sys/external/bsd/acpica/dist/generate/unix/acpidump/Makefile
U src/sys/external/bsd/acpica/dist/generate/unix/acpiexamples/Makefile
U src/sys/external/bsd/acpica/dist/generate/unix/acpiexec/Makefile
U src/sys/external/bsd/acpica/dist/generate/unix/acpihelp/Makefile
U src/sys/external/bsd/acpica/dist/generate/unix/acpisrc/Makefile
U src/sys/external/bsd/acpica/dist/generate/unix/acpixtract/Makefile
U src/sys/external/bsd/acpica/dist/generate/unix/iasl/Makefile
U src/sys/external/bsd/acpica/dist/common/acfileio.c
U src/sys/external/bsd/acpica/dist/common/acgetline.c
U src/sys/external/bsd/acpica/dist/common/adfile.c
U src/sys/external/bsd/acpica/dist/common/adisasm.c
U src/sys/external/bsd/acpica/dist/common/adwalk.c
U src/sys/external/bsd/acpica/dist/common/ahids.c
U src/sys/external/bsd/acpica/dist/common/ahpredef.c
U src/sys/external/bsd/acpica/dist/common/ahtable.c
U src/sys/external/bsd/acpica/dist/common/ahuuids.c
U src/sys/external/bsd/acpica/dist/common/cmfsize.c
U src/sys/external/bsd/acpica/dist/common/dmextern.c
U src/sys/external/bsd/acpica/dist/common/dmrestag.c
U src/sys/external/bsd/acpica/dist/common/dmswitch.c
U src/sys/external/bsd/acpica/dist/common/dmtable.c
C src/sys/external/bsd/acpica/dist/common/dmtables.c
C src/sys/external/bsd/acpica/dist/common/dmtbdump.c
U src/sys/external/bsd/acpica/dist/common/dmtbdump1.c
U src/sys/external/bsd/acpica/dist/common/dmtbdump2.c
U src/sys/external/bsd/acpica/dist/common/dmtbdump3.c
C src/sys/external/bsd/acpica/dist/common/dmtbinfo.c
U src/sys/external/bsd/acpica/dist/common/dmtbinfo1.c
U src/sys/external/bsd/acpica/dist/common/dmtbinfo2.c
U src/sys/external/bsd/acpica/dist/common/dmtbinfo3.c
U src/sys/external/bsd/acpica/dist/common/getopt.c
U src/sys/external/bsd/acpica/dist/tests/misc/badcode.asl
U src/sys/external/bsd/acpica/dist/tests/misc/converterSample.asl
U src/sys/external/bsd/acpica/dist/tests/misc/grammar.asl
U 

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

2021-04-03 Thread Palle Lyckegaard
Module Name:src
Committed By:   palle
Date:   Sat Apr  3 17:02:32 UTC 2021

Modified Files:
src/sys/arch/sparc64/doc: TODO

Log Message:
update TODO after cpu_idle() has been improved (sun4v only for now)


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 src/sys/arch/sparc64/doc/TODO

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

Modified files:

Index: src/sys/arch/sparc64/doc/TODO
diff -u src/sys/arch/sparc64/doc/TODO:1.40 src/sys/arch/sparc64/doc/TODO:1.41
--- src/sys/arch/sparc64/doc/TODO:1.40	Tue Mar 30 20:23:45 2021
+++ src/sys/arch/sparc64/doc/TODO	Sat Apr  3 17:02:31 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: TODO,v 1.40 2021/03/30 20:23:45 palle Exp $ */
+/* $NetBSD: TODO,v 1.41 2021/04/03 17:02:31 palle Exp $ */
 
 Things to be done:
 
@@ -23,7 +23,6 @@ sun4v:
 	 S7 ldom with 8 VCPU and 16GB (primary ldom is Solaris 11.4 SRU30):
 	   - during autoconfiguration of vnet devices the call to hv_vintr_setenabled()
 	 returns error code 7 (EBADTRAP?)
-- idle handling - call hypervisor trap (openbsd code...??)	   
 - 64-bit kernel support
 - 32-bit kernel support
 - libkvm



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

2021-04-03 Thread Palle Lyckegaard
Module Name:src
Committed By:   palle
Date:   Sat Apr  3 17:02:32 UTC 2021

Modified Files:
src/sys/arch/sparc64/doc: TODO

Log Message:
update TODO after cpu_idle() has been improved (sun4v only for now)


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 src/sys/arch/sparc64/doc/TODO

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



CVS commit: src/sys/arch/sparc64

2021-04-03 Thread Palle Lyckegaard
Module Name:src
Committed By:   palle
Date:   Sat Apr  3 17:01:24 UTC 2021

Modified Files:
src/sys/arch/sparc64/include: cpu.h
src/sys/arch/sparc64/sparc64: cpu.c genassym.cf locore.s

Log Message:
Improve cpu_idle() by allowing a platform specific implementaion (same logic as 
the sparc implementation) - currently only used by sun4v


To generate a diff of this commit:
cvs rdiff -u -r1.130 -r1.131 src/sys/arch/sparc64/include/cpu.h
cvs rdiff -u -r1.138 -r1.139 src/sys/arch/sparc64/sparc64/cpu.c
cvs rdiff -u -r1.84 -r1.85 src/sys/arch/sparc64/sparc64/genassym.cf
cvs rdiff -u -r1.426 -r1.427 src/sys/arch/sparc64/sparc64/locore.s

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

Modified files:

Index: src/sys/arch/sparc64/include/cpu.h
diff -u src/sys/arch/sparc64/include/cpu.h:1.130 src/sys/arch/sparc64/include/cpu.h:1.131
--- src/sys/arch/sparc64/include/cpu.h:1.130	Tue Mar 10 03:49:56 2020
+++ src/sys/arch/sparc64/include/cpu.h	Sat Apr  3 17:01:24 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.h,v 1.130 2020/03/10 03:49:56 christos Exp $ */
+/*	$NetBSD: cpu.h,v 1.131 2021/04/03 17:01:24 palle Exp $ */
 
 /*
  * Copyright (c) 1992, 1993
@@ -212,12 +212,14 @@ struct cpu_info {
 	paddr_t			ci_devmq;  /* device mondo queue address */
 	paddr_t			ci_cpuset; /* mondo recipient address */ 
 	paddr_t			ci_mondo;  /* mondo message address */
-	
+
 	/* probe fault in PCI config space reads */
 	bool			ci_pci_probe;
 	bool			ci_pci_fault;
 
 	volatile void		*ci_ddb_regs;	/* DDB regs */
+
+	void (*ci_idlespin)(void);
 };
 
 #endif /* _KERNEL || _KMEMUSER */
@@ -438,6 +440,9 @@ void	switchtoctx_usiii(int);
 void	next_tick(long);
 void	next_stick(long);
 void	next_stick_init(void);
+#ifdef SUN4V
+voidcpu_idle_sun4v(void);
+#endif
 /* trap.c */
 void	cpu_vmspace_exec(struct lwp *, vaddr_t, vaddr_t);
 int	rwindow_save(struct lwp *);

Index: src/sys/arch/sparc64/sparc64/cpu.c
diff -u src/sys/arch/sparc64/sparc64/cpu.c:1.138 src/sys/arch/sparc64/sparc64/cpu.c:1.139
--- src/sys/arch/sparc64/sparc64/cpu.c:1.138	Fri Aug  7 14:20:08 2020
+++ src/sys/arch/sparc64/sparc64/cpu.c	Sat Apr  3 17:01:24 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.c,v 1.138 2020/08/07 14:20:08 fcambus Exp $ */
+/*	$NetBSD: cpu.c,v 1.139 2021/04/03 17:01:24 palle Exp $ */
 
 /*
  * Copyright (c) 1996
@@ -52,7 +52,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.138 2020/08/07 14:20:08 fcambus Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.139 2021/04/03 17:01:24 palle Exp $");
 
 #include "opt_multiprocessor.h"
 
@@ -695,9 +695,22 @@ cpu_attach(device_t parent, device_t dev
 		ci->ci_cpuset = pa;
 		pa += 64;
 	}
-	
+
+	/*
+	 * cpu_idle setup (currently only necessary for sun4v)
+	 */
+	if (CPU_ISSUN4V) {
+	  ci->ci_idlespin = cpu_idle_sun4v;
+	}
 }
 
+#ifdef SUN4V
+void cpu_idle_sun4v(void)
+{
+  hv_cpu_yield();
+}
+#endif
+
 int
 cpu_myid(void)
 {

Index: src/sys/arch/sparc64/sparc64/genassym.cf
diff -u src/sys/arch/sparc64/sparc64/genassym.cf:1.84 src/sys/arch/sparc64/sparc64/genassym.cf:1.85
--- src/sys/arch/sparc64/sparc64/genassym.cf:1.84	Mon Feb 17 09:09:49 2020
+++ src/sys/arch/sparc64/sparc64/genassym.cf	Sat Apr  3 17:01:24 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: genassym.cf,v 1.84 2020/02/17 09:09:49 skrll Exp $
+#	$NetBSD: genassym.cf,v 1.85 2021/04/03 17:01:24 palle Exp $
 
 #
 # Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -183,6 +183,7 @@ define	CI_DEVMQ	offsetof(struct cpu_info
 ifdef MULTIPROCESSOR
 define	CI_IPIEVC	offsetof(struct cpu_info, ci_ipi_evcnt[0].ev_count)
 endif
+define	CI_IDLESPIN offsetof(struct cpu_info, ci_idlespin)
 
 # CPU boot arguments structure
 define	CBA_NODE	offsetof(struct cpu_bootargs, cb_node)

Index: src/sys/arch/sparc64/sparc64/locore.s
diff -u src/sys/arch/sparc64/sparc64/locore.s:1.426 src/sys/arch/sparc64/sparc64/locore.s:1.427
--- src/sys/arch/sparc64/sparc64/locore.s:1.426	Tue Mar 30 20:03:14 2021
+++ src/sys/arch/sparc64/sparc64/locore.s	Sat Apr  3 17:01:24 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.s,v 1.426 2021/03/30 20:03:14 palle Exp $	*/
+/*	$NetBSD: locore.s,v 1.427 2021/04/03 17:01:24 palle Exp $	*/
 
 /*
  * Copyright (c) 2006-2010 Matthew R. Green
@@ -6619,11 +6619,19 @@ ENTRY(getfp)
 	 mov %fp, %o0
 
 /*
- * nothing MD to do in the idle loop
+ * Call optional cpu_idle handler if provided
  */
 ENTRY(cpu_idle)
-	retl
+	set	CPUINFO_VA, %o0
+	LDPTR	[%o0 + CI_IDLESPIN], %o1
+	tst	%o1
+	bz	1f
+	 nop
+	jmp	%o1
 	 nop
+1:
+	retl
+	nop
 
 /*
  * cpu_switchto() switches to an lwp to run and runs it, saving the



CVS commit: src/sys/arch/sparc64

2021-04-03 Thread Palle Lyckegaard
Module Name:src
Committed By:   palle
Date:   Sat Apr  3 17:01:24 UTC 2021

Modified Files:
src/sys/arch/sparc64/include: cpu.h
src/sys/arch/sparc64/sparc64: cpu.c genassym.cf locore.s

Log Message:
Improve cpu_idle() by allowing a platform specific implementaion (same logic as 
the sparc implementation) - currently only used by sun4v


To generate a diff of this commit:
cvs rdiff -u -r1.130 -r1.131 src/sys/arch/sparc64/include/cpu.h
cvs rdiff -u -r1.138 -r1.139 src/sys/arch/sparc64/sparc64/cpu.c
cvs rdiff -u -r1.84 -r1.85 src/sys/arch/sparc64/sparc64/genassym.cf
cvs rdiff -u -r1.426 -r1.427 src/sys/arch/sparc64/sparc64/locore.s

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



CVS commit: [thorpej-cfargs] src/sys/dev/acpi

2021-04-03 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sat Apr  3 16:10:39 UTC 2021

Modified Files:
src/sys/dev/acpi [thorpej-cfargs]: acpi.c

Log Message:
Pass CFARG_DEVHANDLE to config_found(), rather than setting the device
handle in acpi_device_register().


To generate a diff of this commit:
cvs rdiff -u -r1.290.2.2 -r1.290.2.3 src/sys/dev/acpi/acpi.c

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



CVS commit: [thorpej-cfargs] src/sys/dev/acpi

2021-04-03 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sat Apr  3 16:10:39 UTC 2021

Modified Files:
src/sys/dev/acpi [thorpej-cfargs]: acpi.c

Log Message:
Pass CFARG_DEVHANDLE to config_found(), rather than setting the device
handle in acpi_device_register().


To generate a diff of this commit:
cvs rdiff -u -r1.290.2.2 -r1.290.2.3 src/sys/dev/acpi/acpi.c

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

Modified files:

Index: src/sys/dev/acpi/acpi.c
diff -u src/sys/dev/acpi/acpi.c:1.290.2.2 src/sys/dev/acpi/acpi.c:1.290.2.3
--- src/sys/dev/acpi/acpi.c:1.290.2.2	Fri Apr  2 22:17:43 2021
+++ src/sys/dev/acpi/acpi.c	Sat Apr  3 16:10:39 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: acpi.c,v 1.290.2.2 2021/04/02 22:17:43 thorpej Exp $	*/
+/*	$NetBSD: acpi.c,v 1.290.2.3 2021/04/03 16:10:39 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 2003, 2007 The NetBSD Foundation, Inc.
@@ -100,7 +100,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: acpi.c,v 1.290.2.2 2021/04/02 22:17:43 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi.c,v 1.290.2.3 2021/04/03 16:10:39 thorpej Exp $");
 
 #include "pci.h"
 #include "opt_acpi.h"
@@ -951,6 +951,8 @@ acpi_rescan_early(struct acpi_softc *sc)
 		if (acpi_match_hid(ad->ad_devinfo, acpi_early_ids) == 0)
 			continue;
 
+		KASSERT(ad->ad_handle != NULL);
+
 		aa.aa_node = ad;
 		aa.aa_iot = sc->sc_iot;
 		aa.aa_memt = sc->sc_memt;
@@ -964,6 +966,7 @@ acpi_rescan_early(struct acpi_softc *sc)
 
 		ad->ad_device = config_found(sc->sc_dev, , acpi_print,
 		CFARG_IATTR, "acpinodebus",
+		CFARG_DEVHANDLE, devhandle_from_acpi(ad->ad_handle),
 		CFARG_EOL);
 	}
 }
@@ -1016,6 +1019,8 @@ acpi_rescan_nodes(struct acpi_softc *sc)
 		if (acpi_match_hid(di, hpet_ids) != 0 && sc->sc_hpet != NULL)
 			continue;
 
+		KASSERT(ad->ad_handle != NULL);
+
 		aa.aa_node = ad;
 		aa.aa_iot = sc->sc_iot;
 		aa.aa_memt = sc->sc_memt;
@@ -1029,6 +1034,7 @@ acpi_rescan_nodes(struct acpi_softc *sc)
 
 		ad->ad_device = config_found(sc->sc_dev, , acpi_print,
 		CFARG_IATTR, "acpinodebus",
+		CFARG_DEVHANDLE, devhandle_from_acpi(ad->ad_handle),
 		CFARG_EOL);
 	}
 }
@@ -1151,14 +1157,7 @@ acpi_device_register(device_t dev, void 
 	device_t parent = device_parent(dev);
 	ACPI_HANDLE hdl = NULL;
 
-	/*
-	 * aa_node is only valid if we attached to the "acpinodebus"
-	 * interface attribute.
-	 */
-	if (device_attached_to_iattr(dev, "acpinodebus")) {
-		const struct acpi_attach_args *aa = v;
-		hdl = aa->aa_node->ad_handle;
-	} else if (device_is_a(parent, "pci")) {
+	if (device_is_a(parent, "pci")) {
 		const struct pci_attach_args *pa = v;
 		struct acpi_devnode *ad;
 		u_int segment;



CVS commit: [thorpej-cfargs] src/sys

2021-04-03 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sat Apr  3 16:09:44 UTC 2021

Modified Files:
src/sys/kern [thorpej-cfargs]: subr_autoconf.c
src/sys/sys [thorpej-cfargs]: device.h

Log Message:
Add CFARG_DEVHANDLE, allowing direct configuration using e.g. ACPI or
OpenFirmware / FDT to associate the handle with the device_t.


To generate a diff of this commit:
cvs rdiff -u -r1.277.2.9 -r1.277.2.10 src/sys/kern/subr_autoconf.c
cvs rdiff -u -r1.167.2.6 -r1.167.2.7 src/sys/sys/device.h

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



CVS commit: [thorpej-cfargs] src/sys

2021-04-03 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sat Apr  3 16:09:44 UTC 2021

Modified Files:
src/sys/kern [thorpej-cfargs]: subr_autoconf.c
src/sys/sys [thorpej-cfargs]: device.h

Log Message:
Add CFARG_DEVHANDLE, allowing direct configuration using e.g. ACPI or
OpenFirmware / FDT to associate the handle with the device_t.


To generate a diff of this commit:
cvs rdiff -u -r1.277.2.9 -r1.277.2.10 src/sys/kern/subr_autoconf.c
cvs rdiff -u -r1.167.2.6 -r1.167.2.7 src/sys/sys/device.h

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

Modified files:

Index: src/sys/kern/subr_autoconf.c
diff -u src/sys/kern/subr_autoconf.c:1.277.2.9 src/sys/kern/subr_autoconf.c:1.277.2.10
--- src/sys/kern/subr_autoconf.c:1.277.2.9	Sat Apr  3 15:37:07 2021
+++ src/sys/kern/subr_autoconf.c	Sat Apr  3 16:09:44 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: subr_autoconf.c,v 1.277.2.9 2021/04/03 15:37:07 thorpej Exp $ */
+/* $NetBSD: subr_autoconf.c,v 1.277.2.10 2021/04/03 16:09:44 thorpej Exp $ */
 
 /*
  * Copyright (c) 1996, 2000 Christopher G. Demetriou
@@ -77,7 +77,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: subr_autoconf.c,v 1.277.2.9 2021/04/03 15:37:07 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_autoconf.c,v 1.277.2.10 2021/04/03 16:09:44 thorpej Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ddb.h"
@@ -1025,11 +1025,15 @@ config_get_cfargs(cfarg_t tag,
 		  cfsubmatch_t *fnp,		/* output */
 		  const char **ifattrp,		/* output */
 		  const int **locsp,		/* output */
+		  devhandle_t *handlep,		/* output */
 		  va_list ap)
 {
 	cfsubmatch_t fn = NULL;
 	const char *ifattr = NULL;
 	const int *locs = NULL;
+	devhandle_t handle;
+
+	devhandle_invalidate();
 
 	while (tag != CFARG_EOL) {
 		switch (tag) {
@@ -1045,6 +1049,10 @@ config_get_cfargs(cfarg_t tag,
 			locs = va_arg(ap, const int *);
 			break;
 
+		case CFARG_DEVHANDLE:
+			handle = va_arg(ap, devhandle_t);
+			break;
+
 		default:
 			/* XXX panic? */
 			/* XXX dump stack backtrace? */
@@ -1062,6 +1070,8 @@ config_get_cfargs(cfarg_t tag,
 		*ifattrp = ifattr;
 	if (locsp != NULL)
 		*locsp = locs;
+	if (handlep != NULL)
+		*handlep = handle;
 }
 
 /*
@@ -1085,7 +1095,7 @@ config_vsearch(device_t parent, void *au
 	cfdata_t cf;
 	struct matchinfo m;
 
-	config_get_cfargs(tag, , , , ap);
+	config_get_cfargs(tag, , , , NULL, ap);
 
 	KASSERT(config_initialized);
 	KASSERT(!ifattr || cfdriver_get_iattr(parent->dv_cfdriver, ifattr));
@@ -1471,8 +1481,6 @@ config_vdevalloc(const device_t parent, 
 	device_lock_t dvl;
 	const int *locs;
 
-	config_get_cfargs(tag, NULL, NULL, , ap);
-
 	cd = config_cfdriver_lookup(cf->cf_name);
 	if (cd == NULL)
 		return NULL;
@@ -1490,6 +1498,13 @@ config_vdevalloc(const device_t parent, 
 	}
 	dev = kmem_zalloc(sizeof(*dev), KM_SLEEP);
 
+	/*
+	 * If a handle was supplied to config_attach(), we'll get it
+	 * assigned automatically here.  If not, then we'll get the
+	 * default invalid handle.
+	 */
+	config_get_cfargs(tag, NULL, NULL, , >dv_handle, ap);
+
 	dev->dv_class = cd->cd_class;
 	dev->dv_cfdata = cf;
 	dev->dv_cfdriver = cd;

Index: src/sys/sys/device.h
diff -u src/sys/sys/device.h:1.167.2.6 src/sys/sys/device.h:1.167.2.7
--- src/sys/sys/device.h:1.167.2.6	Sat Apr  3 06:54:29 2021
+++ src/sys/sys/device.h	Sat Apr  3 16:09:44 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: device.h,v 1.167.2.6 2021/04/03 06:54:29 thorpej Exp $ */
+/* $NetBSD: device.h,v 1.167.2.7 2021/04/03 16:09:44 thorpej Exp $ */
 
 /*
  * Copyright (c) 2021 The NetBSD Foundation, Inc.
@@ -532,6 +532,7 @@ typedef enum {
 	CFARG_SUBMATCH		= 0,	/* submatch function */
 	CFARG_IATTR		= 1,	/* interface attribute */
 	CFARG_LOCATORS		= 2,	/* locators array */
+	CFARG_DEVHANDLE		= 3,	/* devhandle_t (by value) */
 
 	CFARG_EOL		= 0x
 } cfarg_t;



CVS commit: [thorpej-cfargs] src/sys/kern

2021-04-03 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sat Apr  3 15:37:07 UTC 2021

Modified Files:
src/sys/kern [thorpej-cfargs]: subr_autoconf.c

Log Message:
- Give config_devalloc() the tagged variadic argument treatment.
- Only extract the values from the variadic argument list if we're
  going to use them locally.  If not, just pass them along (using
  va_copy() if necessary).  This serves to future-proof the intermediaries
  as new cfarg_t tag values are added in the future.


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

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

Modified files:

Index: src/sys/kern/subr_autoconf.c
diff -u src/sys/kern/subr_autoconf.c:1.277.2.8 src/sys/kern/subr_autoconf.c:1.277.2.9
--- src/sys/kern/subr_autoconf.c:1.277.2.8	Sat Apr  3 06:54:29 2021
+++ src/sys/kern/subr_autoconf.c	Sat Apr  3 15:37:07 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: subr_autoconf.c,v 1.277.2.8 2021/04/03 06:54:29 thorpej Exp $ */
+/* $NetBSD: subr_autoconf.c,v 1.277.2.9 2021/04/03 15:37:07 thorpej Exp $ */
 
 /*
  * Copyright (c) 1996, 2000 Christopher G. Demetriou
@@ -77,7 +77,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: subr_autoconf.c,v 1.277.2.8 2021/04/03 06:54:29 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_autoconf.c,v 1.277.2.9 2021/04/03 15:37:07 thorpej Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ddb.h"
@@ -168,7 +168,8 @@ struct alldevs_foray {
 
 static char *number(char *, int);
 static void mapply(struct matchinfo *, cfdata_t);
-static device_t config_devalloc(const device_t, const cfdata_t, const int *);
+static device_t config_vattach(device_t, cfdata_t, void *, cfprint_t, cfarg_t,
+			   va_list);
 static void config_devdelete(device_t);
 static void config_devunlink(device_t, struct devicelist *);
 static void config_makeroom(int, struct cfdriver *);
@@ -1189,20 +1190,17 @@ static device_t
 config_vfound(device_t parent, void *aux, cfprint_t print, cfarg_t tag,
 va_list ap)
 {
-	cfsubmatch_t submatch;
-	const char *ifattr;
-	const int *locs;
 	cfdata_t cf;
+	va_list nap;
+
+	va_copy(nap, ap);
+	cf = config_vsearch(parent, aux, tag, nap);
+	va_end(nap);
 
-	config_get_cfargs(tag, , , , ap);
+	if (cf != NULL) {
+		return config_vattach(parent, cf, aux, print, tag, ap);
+	}
 
-	if ((cf = config_search(parent, aux,
-CFARG_SUBMATCH, submatch,
-CFARG_IATTR, ifattr,
-CFARG_LOCATORS, locs,
-CFARG_EOL)))
-		return config_attach(parent, cf, aux, print,
-		CFARG_LOCATORS, locs);
 	if (print) {
 		if (config_do_twiddle && cold)
 			twiddle();
@@ -1458,7 +1456,8 @@ config_unit_alloc(device_t dev, cfdriver
 }
 
 static device_t
-config_devalloc(const device_t parent, const cfdata_t cf, const int *locs)
+config_vdevalloc(const device_t parent, const cfdata_t cf, cfarg_t tag,
+va_list ap)
 {
 	cfdriver_t cd;
 	cfattach_t ca;
@@ -1470,6 +1469,9 @@ config_devalloc(const device_t parent, c
 	void *dev_private;
 	const struct cfiattrdata *ia;
 	device_lock_t dvl;
+	const int *locs;
+
+	config_get_cfargs(tag, NULL, NULL, , ap);
 
 	cd = config_cfdriver_lookup(cf->cf_name);
 	if (cd == NULL)
@@ -1508,7 +1510,7 @@ config_devalloc(const device_t parent, c
 	xunit = number([sizeof(num)], myunit);
 	lunit = [sizeof(num)] - xunit;
 	if (lname + lunit > sizeof(dev->dv_xname))
-		panic("config_devalloc: device name too long");
+		panic("config_vdevalloc: device name too long");
 
 	dvl = device_getlock(dev);
 
@@ -1549,6 +1551,19 @@ config_devalloc(const device_t parent, c
 	return dev;
 }
 
+static device_t
+config_devalloc(const device_t parent, const cfdata_t cf, cfarg_t tag, ...)
+{
+	device_t dev;
+	va_list ap;
+
+	va_start(ap, tag);
+	dev = config_vdevalloc(parent, cf, tag, ap);
+	va_end(ap);
+
+	return dev;
+}
+
 /*
  * Create an array of device attach attributes and add it
  * to the device's dv_properties dictionary.
@@ -1638,11 +1653,8 @@ config_vattach(device_t parent, cfdata_t
 	device_t dev;
 	struct cftable *ct;
 	const char *drvname;
-	const int *locs;
-
-	config_get_cfargs(tag, NULL, NULL, , ap);
 
-	dev = config_devalloc(parent, cf, locs);
+	dev = config_vdevalloc(parent, cf, tag, ap);
 	if (!dev)
 		panic("config_attach: allocation of device softc failed");
 
@@ -1735,7 +1747,7 @@ config_attach_pseudo(cfdata_t cf)
 {
 	device_t dev;
 
-	dev = config_devalloc(ROOT, cf, NULL);
+	dev = config_devalloc(ROOT, cf, CFARG_EOL);
 	if (!dev)
 		return NULL;
 



CVS commit: [thorpej-cfargs] src/sys/kern

2021-04-03 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sat Apr  3 15:37:07 UTC 2021

Modified Files:
src/sys/kern [thorpej-cfargs]: subr_autoconf.c

Log Message:
- Give config_devalloc() the tagged variadic argument treatment.
- Only extract the values from the variadic argument list if we're
  going to use them locally.  If not, just pass them along (using
  va_copy() if necessary).  This serves to future-proof the intermediaries
  as new cfarg_t tag values are added in the future.


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

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



CVS commit: src/sys/arch/alpha/alpha

2021-04-03 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sat Apr  3 15:29:02 UTC 2021

Modified Files:
src/sys/arch/alpha/alpha: pmap.c

Log Message:
Slight tweak to last: Our IPL gets raised to IPL_SCHED by simply *trying*
to acquire the pmap activation lock, regardless of whether or not that was
successful.  So, in addition to remember if we acquired it, also remember
if we tried, and drop back to IPL_VM if so.


To generate a diff of this commit:
cvs rdiff -u -r1.275 -r1.276 src/sys/arch/alpha/alpha/pmap.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/alpha/alpha/pmap.c
diff -u src/sys/arch/alpha/alpha/pmap.c:1.275 src/sys/arch/alpha/alpha/pmap.c:1.276
--- src/sys/arch/alpha/alpha/pmap.c:1.275	Sat Apr  3 14:56:13 2021
+++ src/sys/arch/alpha/alpha/pmap.c	Sat Apr  3 15:29:02 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.275 2021/04/03 14:56:13 thorpej Exp $ */
+/* $NetBSD: pmap.c,v 1.276 2021/04/03 15:29:02 thorpej Exp $ */
 
 /*-
  * Copyright (c) 1998, 1999, 2000, 2001, 2007, 2008, 2020
@@ -135,7 +135,7 @@
 
 #include 			/* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.275 2021/04/03 14:56:13 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.276 2021/04/03 15:29:02 thorpej Exp $");
 
 #include 
 #include 
@@ -915,7 +915,7 @@ pmap_tlb_shootnow(const struct pmap_tlb_
 	const struct cpu_info *ci = curcpu();
 	const u_long this_cpu = 1UL << ci->ci_cpuid;
 	u_long active_cpus;
-	bool activation_locked;
+	bool activation_locked, activation_lock_tried;
 
 	/*
 	 * Figure out who to notify.  If it's for the kernel or
@@ -929,6 +929,7 @@ pmap_tlb_shootnow(const struct pmap_tlb_
 	if (TLB_CTX_FLAGS(tlbctx) & (TLB_CTX_F_ASM | TLB_CTX_F_MULTI)) {
 		active_cpus = pmap_all_cpus();
 		activation_locked = false;
+		activation_lock_tried = false;
 	} else {
 		KASSERT(tlbctx->t_pmap != NULL);
 		activation_locked = PMAP_ACT_TRYLOCK(tlbctx->t_pmap);
@@ -938,6 +939,7 @@ pmap_tlb_shootnow(const struct pmap_tlb_
 			TLB_COUNT(shootnow_over_notify);
 			active_cpus = pmap_all_cpus();
 		}
+		activation_lock_tried = true;
 	}
 
 #if defined(MULTIPROCESSOR)
@@ -959,14 +961,17 @@ pmap_tlb_shootnow(const struct pmap_tlb_
 	 * Now that the remotes have been notified, release the
 	 * activation lock.
 	 */
-	if (activation_locked) {
-		KASSERT(tlbctx->t_pmap != NULL);
-		PMAP_ACT_UNLOCK(tlbctx->t_pmap);
+	if (activation_lock_tried) {
+		if (activation_locked) {
+			KASSERT(tlbctx->t_pmap != NULL);
+			PMAP_ACT_UNLOCK(tlbctx->t_pmap);
+		}
 		/*
-		 * When we acquired the activation lock, we
-		 * raised IPL to IPL_SCHED, which blocks out
-		 * IPIs.  Force our IPL back down to IPL_VM
-		 * so that we can receive IPIs.
+		 * When we tried to acquire the activation lock, we
+		 * raised IPL to IPL_SCHED (even if we ultimately
+		 * failed to acquire the lock), which blocks out IPIs.
+		 * Force our IPL back down to IPL_VM so that we can
+		 * receive IPIs.
 		 */
 		alpha_pal_swpipl(IPL_VM);
 	}



CVS commit: src/sys/arch/alpha/alpha

2021-04-03 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sat Apr  3 15:29:02 UTC 2021

Modified Files:
src/sys/arch/alpha/alpha: pmap.c

Log Message:
Slight tweak to last: Our IPL gets raised to IPL_SCHED by simply *trying*
to acquire the pmap activation lock, regardless of whether or not that was
successful.  So, in addition to remember if we acquired it, also remember
if we tried, and drop back to IPL_VM if so.


To generate a diff of this commit:
cvs rdiff -u -r1.275 -r1.276 src/sys/arch/alpha/alpha/pmap.c

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



CVS commit: src/usr.bin/make

2021-04-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Apr  3 15:22:23 UTC 2021

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

Log Message:
make: revert accidental change from the previous commit

The definition of MAKE_GNUC_PREREQ was not supposed to be changed.  This
change only slipped accidentally, the test for __STDC_VERSION__ was only
supposed to be for UNCONST.


To generate a diff of this commit:
cvs rdiff -u -r1.258 -r1.259 src/usr.bin/make/make.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/make.h
diff -u src/usr.bin/make/make.h:1.258 src/usr.bin/make/make.h:1.259
--- src/usr.bin/make/make.h:1.258	Sat Apr  3 14:39:02 2021
+++ src/usr.bin/make/make.h	Sat Apr  3 15:22:23 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: make.h,v 1.258 2021/04/03 14:39:02 rillig Exp $	*/
+/*	$NetBSD: make.h,v 1.259 2021/04/03 15:22:23 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -101,7 +101,7 @@
 #define FD_CLOEXEC 1
 #endif
 
-#if defined(__GNUC__) && __STDC_VERSION__ >= 199901L
+#if defined(__GNUC__)
 #define MAKE_GNUC_PREREQ(x, y)		\
 	((__GNUC__ == (x) && __GNUC_MINOR__ >= (y)) ||			\
 	 (__GNUC__ > (x)))



CVS commit: src/usr.bin/make

2021-04-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Apr  3 15:22:23 UTC 2021

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

Log Message:
make: revert accidental change from the previous commit

The definition of MAKE_GNUC_PREREQ was not supposed to be changed.  This
change only slipped accidentally, the test for __STDC_VERSION__ was only
supposed to be for UNCONST.


To generate a diff of this commit:
cvs rdiff -u -r1.258 -r1.259 src/usr.bin/make/make.h

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



CVS commit: src/sys

2021-04-03 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sat Apr  3 14:56:14 UTC 2021

Modified Files:
src/sys/arch/alpha/alpha: pmap.c
src/sys/arch/alpha/include: lock.h
src/sys/kern: kern_mutex.c

Log Message:
Fix an IPI deadlock scenario that resulted in a TLB shootdown timeout
panic reported by John Klos on port-alpha:

- pmap_tlb_shootnow(): If we acquire a pmap's activation lock, we will
  have raised the IPL on the current CPU to IPL_SCHED until we drop
  the tlb_lock (due to how nested spin mutexes work).  As such, when
  we release the activation lock, forcibly lower our IPL back to IPL_VM
  so that we can receive and process IPIs while waiting for other CPUs
  to process the shootdowns.
- mutex_vector_enter(): Invoke SPINLOCK_SPIN_HOOK while spinning to acquire
  a spin mutex.  This is a nop on most platforms, but it's important on
  the Alpha.  Without this, IPIs (and thus TLB shootdowns) cannot be
  processed if trying to acquire an IPL_SCHED spin mutex such as those
  used by the scheduler.

...and while we're poking around in here:

- Rework the Alpha SPINLOCK_SPIN_HOOK to only check curcpu()->ci_ipis
  if the current CPU's IPL is >= IPL_CLOCK (thus ensuring that preemption
  is disabled and thus guaranteeing that curcpu() is stable).  (Alpha does
  not yet support kernel preemption, but this is now one less thing that
  would need to be fixed.)


To generate a diff of this commit:
cvs rdiff -u -r1.274 -r1.275 src/sys/arch/alpha/alpha/pmap.c
cvs rdiff -u -r1.30 -r1.31 src/sys/arch/alpha/include/lock.h
cvs rdiff -u -r1.96 -r1.97 src/sys/kern/kern_mutex.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/alpha/alpha/pmap.c
diff -u src/sys/arch/alpha/alpha/pmap.c:1.274 src/sys/arch/alpha/alpha/pmap.c:1.275
--- src/sys/arch/alpha/alpha/pmap.c:1.274	Tue Dec 29 17:16:15 2020
+++ src/sys/arch/alpha/alpha/pmap.c	Sat Apr  3 14:56:13 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.274 2020/12/29 17:16:15 thorpej Exp $ */
+/* $NetBSD: pmap.c,v 1.275 2021/04/03 14:56:13 thorpej Exp $ */
 
 /*-
  * Copyright (c) 1998, 1999, 2000, 2001, 2007, 2008, 2020
@@ -135,7 +135,7 @@
 
 #include 			/* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.274 2020/12/29 17:16:15 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.275 2021/04/03 14:56:13 thorpej Exp $");
 
 #include 
 #include 
@@ -962,6 +962,13 @@ pmap_tlb_shootnow(const struct pmap_tlb_
 	if (activation_locked) {
 		KASSERT(tlbctx->t_pmap != NULL);
 		PMAP_ACT_UNLOCK(tlbctx->t_pmap);
+		/*
+		 * When we acquired the activation lock, we
+		 * raised IPL to IPL_SCHED, which blocks out
+		 * IPIs.  Force our IPL back down to IPL_VM
+		 * so that we can receive IPIs.
+		 */
+		alpha_pal_swpipl(IPL_VM);
 	}
 
 	/*

Index: src/sys/arch/alpha/include/lock.h
diff -u src/sys/arch/alpha/include/lock.h:1.30 src/sys/arch/alpha/include/lock.h:1.31
--- src/sys/arch/alpha/include/lock.h:1.30	Fri Nov 29 20:05:07 2019
+++ src/sys/arch/alpha/include/lock.h	Sat Apr  3 14:56:13 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: lock.h,v 1.30 2019/11/29 20:05:07 riastradh Exp $ */
+/* $NetBSD: lock.h,v 1.31 2021/04/03 14:56:13 thorpej Exp $ */
 
 /*-
  * Copyright (c) 1998, 1999, 2000 The NetBSD Foundation, Inc.
@@ -151,26 +151,27 @@ __cpu_simple_unlock(__cpu_simple_lock_t 
 #if defined(MULTIPROCESSOR)
 /*
  * On the Alpha, interprocessor interrupts come in at device priority
- * level.  This can cause some problems while waiting for r/w spinlocks
- * from a high'ish priority level: IPIs that come in will not be processed.
- * This can lead to deadlock.
+ * level (ALPHA_PSL_IPL_CLOCK).  This can cause some problems while
+ * waiting for spin locks from a high'ish priority level (like spin
+ * mutexes used by the scheduler): IPIs that come in will not be
+ * processed. This can lead to deadlock.
  *
- * This hook allows IPIs to be processed while a spinlock's interlock
- * is released.
+ * This hook allows IPIs to be processed while spinning.  Note we only
+ * do the special thing if IPIs are blocked (current IPL >= IPL_CLOCK).
+ * IPIs will be processed in the normal fashion otherwise, and checking
+ * this way ensures that preemption is disabled (i.e. curcpu() is stable).
  */
 #define	SPINLOCK_SPIN_HOOK		\
 do {	\
-	struct cpu_info *__ci = curcpu();\
-	int __s;			\
+	unsigned long _ipl_ = alpha_pal_rdps() & ALPHA_PSL_IPL_MASK;	\
 	\
-	if (__ci->ci_ipis != 0) {	\
-		/* printf("CPU %lu has IPIs pending\n",			\
-		__ci->ci_cpuid); */	\
-		__s = splhigh();		\
-		alpha_ipi_process(__ci, NULL);\
-		splx(__s);		\
+	if (_ipl_ >= ALPHA_PSL_IPL_CLOCK) {\
+		struct cpu_info *__ci = curcpu();			\
+		if (atomic_load_relaxed(&__ci->ci_ipis) != 0) {		\
+			alpha_ipi_process(__ci, NULL);			\
+		}			\
 	}\
-} while (0)
+} while (/*CONSTCOND*/0)
 #define	SPINLOCK_BACKOFF_HOOK	

CVS commit: src/sys

2021-04-03 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sat Apr  3 14:56:14 UTC 2021

Modified Files:
src/sys/arch/alpha/alpha: pmap.c
src/sys/arch/alpha/include: lock.h
src/sys/kern: kern_mutex.c

Log Message:
Fix an IPI deadlock scenario that resulted in a TLB shootdown timeout
panic reported by John Klos on port-alpha:

- pmap_tlb_shootnow(): If we acquire a pmap's activation lock, we will
  have raised the IPL on the current CPU to IPL_SCHED until we drop
  the tlb_lock (due to how nested spin mutexes work).  As such, when
  we release the activation lock, forcibly lower our IPL back to IPL_VM
  so that we can receive and process IPIs while waiting for other CPUs
  to process the shootdowns.
- mutex_vector_enter(): Invoke SPINLOCK_SPIN_HOOK while spinning to acquire
  a spin mutex.  This is a nop on most platforms, but it's important on
  the Alpha.  Without this, IPIs (and thus TLB shootdowns) cannot be
  processed if trying to acquire an IPL_SCHED spin mutex such as those
  used by the scheduler.

...and while we're poking around in here:

- Rework the Alpha SPINLOCK_SPIN_HOOK to only check curcpu()->ci_ipis
  if the current CPU's IPL is >= IPL_CLOCK (thus ensuring that preemption
  is disabled and thus guaranteeing that curcpu() is stable).  (Alpha does
  not yet support kernel preemption, but this is now one less thing that
  would need to be fixed.)


To generate a diff of this commit:
cvs rdiff -u -r1.274 -r1.275 src/sys/arch/alpha/alpha/pmap.c
cvs rdiff -u -r1.30 -r1.31 src/sys/arch/alpha/include/lock.h
cvs rdiff -u -r1.96 -r1.97 src/sys/kern/kern_mutex.c

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



CVS commit: src/usr.bin/make

2021-04-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Apr  3 14:39:02 UTC 2021

Modified Files:
src/usr.bin/make: hash.c job.c make.h nonints.h str.c var.c

Log Message:
make: backport to C90

In the past few months I had accidentally used C99 features in the make
code.  According to tools/README, tools that are used in the build
system should restrict themselves to C90.

This allows make to build with GCC's options "-pedantic
-Wno-system-headers -Dinline= -Wno-error=cast-qual".

I didn't notice anyone actively complaining though, I just wanted to see
how much work this backporting would be.  The identifier __func__ is
still used, as in other tools.

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.62 -r1.63 src/usr.bin/make/hash.c
cvs rdiff -u -r1.421 -r1.422 src/usr.bin/make/job.c
cvs rdiff -u -r1.257 -r1.258 src/usr.bin/make/make.h
cvs rdiff -u -r1.207 -r1.208 src/usr.bin/make/nonints.h
cvs rdiff -u -r1.82 -r1.83 src/usr.bin/make/str.c
cvs rdiff -u -r1.896 -r1.897 src/usr.bin/make/var.c

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



CVS commit: src/usr.bin/make

2021-04-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Apr  3 14:39:02 UTC 2021

Modified Files:
src/usr.bin/make: hash.c job.c make.h nonints.h str.c var.c

Log Message:
make: backport to C90

In the past few months I had accidentally used C99 features in the make
code.  According to tools/README, tools that are used in the build
system should restrict themselves to C90.

This allows make to build with GCC's options "-pedantic
-Wno-system-headers -Dinline= -Wno-error=cast-qual".

I didn't notice anyone actively complaining though, I just wanted to see
how much work this backporting would be.  The identifier __func__ is
still used, as in other tools.

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.62 -r1.63 src/usr.bin/make/hash.c
cvs rdiff -u -r1.421 -r1.422 src/usr.bin/make/job.c
cvs rdiff -u -r1.257 -r1.258 src/usr.bin/make/make.h
cvs rdiff -u -r1.207 -r1.208 src/usr.bin/make/nonints.h
cvs rdiff -u -r1.82 -r1.83 src/usr.bin/make/str.c
cvs rdiff -u -r1.896 -r1.897 src/usr.bin/make/var.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/hash.c
diff -u src/usr.bin/make/hash.c:1.62 src/usr.bin/make/hash.c:1.63
--- src/usr.bin/make/hash.c:1.62	Sat Apr  3 11:08:40 2021
+++ src/usr.bin/make/hash.c	Sat Apr  3 14:39:02 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: hash.c,v 1.62 2021/04/03 11:08:40 rillig Exp $	*/
+/*	$NetBSD: hash.c,v 1.63 2021/04/03 14:39:02 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -74,7 +74,7 @@
 #include "make.h"
 
 /*	"@(#)hash.c	8.1 (Berkeley) 6/6/93"	*/
-MAKE_RCSID("$NetBSD: hash.c,v 1.62 2021/04/03 11:08:40 rillig Exp $");
+MAKE_RCSID("$NetBSD: hash.c,v 1.63 2021/04/03 14:39:02 rillig Exp $");
 
 /*
  * The ratio of # entries to # buckets at which we rebuild the table to
@@ -227,7 +227,7 @@ HashTable_Enlarge(HashTable *t)
 	t->bucketsMask = newMask;
 	t->buckets = newBuckets;
 	DEBUG5(HASH, "%s: %p size=%d entries=%d maxchain=%d\n",
-	   __func__, t, t->bucketsSize, t->numEntries, t->maxchain);
+	__func__, (void *)t, t->bucketsSize, t->numEntries, t->maxchain);
 	t->maxchain = 0;
 }
 

Index: src/usr.bin/make/job.c
diff -u src/usr.bin/make/job.c:1.421 src/usr.bin/make/job.c:1.422
--- src/usr.bin/make/job.c:1.421	Sat Apr  3 11:08:40 2021
+++ src/usr.bin/make/job.c	Sat Apr  3 14:39:02 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: job.c,v 1.421 2021/04/03 11:08:40 rillig Exp $	*/
+/*	$NetBSD: job.c,v 1.422 2021/04/03 14:39:02 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -142,7 +142,7 @@
 #include "trace.h"
 
 /*	"@(#)job.c	8.2 (Berkeley) 3/19/94"	*/
-MAKE_RCSID("$NetBSD: job.c,v 1.421 2021/04/03 11:08:40 rillig Exp $");
+MAKE_RCSID("$NetBSD: job.c,v 1.422 2021/04/03 14:39:02 rillig Exp $");
 
 /*
  * A shell defines how the commands are run.  All commands for a target are
@@ -1000,7 +1000,10 @@ JobPrintCommands(Job *job)
 {
 	StringListNode *ln;
 	bool seen = false;
-	ShellWriter wr = { job->cmdFILE, false };
+	ShellWriter wr;
+
+	wr.f = job->cmdFILE;
+	wr.xtraced = false;
 
 	for (ln = job->node->commands.first; ln != NULL; ln = ln->next) {
 		const char *cmd = ln->datum;
@@ -1216,10 +1219,12 @@ static void
 TouchRegular(GNode *gn)
 {
 	const char *file = GNode_Path(gn);
-	struct utimbuf times = { now, now };
+	struct utimbuf times;
 	int fd;
 	char c;
 
+	times.actime = now;
+	times.modtime = now;
 	if (utime(file, ) >= 0)
 		return;
 

Index: src/usr.bin/make/make.h
diff -u src/usr.bin/make/make.h:1.257 src/usr.bin/make/make.h:1.258
--- src/usr.bin/make/make.h:1.257	Sat Apr  3 11:08:40 2021
+++ src/usr.bin/make/make.h	Sat Apr  3 14:39:02 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: make.h,v 1.257 2021/04/03 11:08:40 rillig Exp $	*/
+/*	$NetBSD: make.h,v 1.258 2021/04/03 14:39:02 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -101,7 +101,7 @@
 #define FD_CLOEXEC 1
 #endif
 
-#if defined(__GNUC__)
+#if defined(__GNUC__) && __STDC_VERSION__ >= 199901L
 #define MAKE_GNUC_PREREQ(x, y)		\
 	((__GNUC__ == (x) && __GNUC_MINOR__ >= (y)) ||			\
 	 (__GNUC__ > (x)))
@@ -738,7 +738,7 @@ GNode_VarArchive(GNode *gn) { return GNo
 MAKE_INLINE const char *
 GNode_VarMember(GNode *gn) { return GNode_ValueDirect(gn, MEMBER); }
 
-#ifdef __GNUC__
+#if defined(__GNUC__) && __STDC_VERSION__ >= 199901L
 #define UNCONST(ptr)	({		\
 union __unconst {			\
 	const void *__cp;		\

Index: src/usr.bin/make/nonints.h
diff -u src/usr.bin/make/nonints.h:1.207 src/usr.bin/make/nonints.h:1.208
--- src/usr.bin/make/nonints.h:1.207	Sat Apr  3 11:08:40 2021
+++ src/usr.bin/make/nonints.h	Sat Apr  3 14:39:02 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: nonints.h,v 1.207 2021/04/03 11:08:40 rillig Exp $	*/
+/*	$NetBSD: nonints.h,v 1.208 2021/04/03 14:39:02 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -186,18 +186,31 @@ typedef struct Words {
 	void 

CVS commit: src/usr.bin/make

2021-04-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Apr  3 14:31:44 UTC 2021

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

Log Message:
make: rename function parameters to match boolean constants

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.553 -r1.554 src/usr.bin/make/parse.c
cvs rdiff -u -r1.895 -r1.896 src/usr.bin/make/var.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.553 src/usr.bin/make/parse.c:1.554
--- src/usr.bin/make/parse.c:1.553	Sat Apr  3 11:08:40 2021
+++ src/usr.bin/make/parse.c	Sat Apr  3 14:31:44 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: parse.c,v 1.553 2021/04/03 11:08:40 rillig Exp $	*/
+/*	$NetBSD: parse.c,v 1.554 2021/04/03 14:31:44 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -109,7 +109,7 @@
 #include "pathnames.h"
 
 /*	"@(#)parse.c	8.3 (Berkeley) 3/19/94"	*/
-MAKE_RCSID("$NetBSD: parse.c,v 1.553 2021/04/03 11:08:40 rillig Exp $");
+MAKE_RCSID("$NetBSD: parse.c,v 1.554 2021/04/03 14:31:44 rillig Exp $");
 
 /* types and constants */
 
@@ -1936,7 +1936,7 @@ VarAssign_EvalShell(const char *name, co
 /*
  * Perform a variable assignment.
  *
- * The actual value of the variable is returned in *out_TRUE_avalue.
+ * The actual value of the variable is returned in *out_true_avalue.
  * Especially for VAR_SUBST and VAR_SHELL this can differ from the literal
  * value.
  *
@@ -1946,7 +1946,7 @@ VarAssign_EvalShell(const char *name, co
  */
 static bool
 VarAssign_Eval(const char *name, VarAssignOp op, const char *uvalue,
-	   GNode *scope, FStr *out_TRUE_avalue)
+	   GNode *scope, FStr *out_true_avalue)
 {
 	FStr avalue = FStr_InitRefer(uvalue);
 
@@ -1964,7 +1964,7 @@ VarAssign_Eval(const char *name, VarAssi
 		Var_SetExpand(scope, name, uvalue);
 	}
 
-	*out_TRUE_avalue = avalue;
+	*out_true_avalue = avalue;
 	return true;
 }
 

Index: src/usr.bin/make/var.c
diff -u src/usr.bin/make/var.c:1.895 src/usr.bin/make/var.c:1.896
--- src/usr.bin/make/var.c:1.895	Sat Apr  3 11:08:40 2021
+++ src/usr.bin/make/var.c	Sat Apr  3 14:31:44 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: var.c,v 1.895 2021/04/03 11:08:40 rillig Exp $	*/
+/*	$NetBSD: var.c,v 1.896 2021/04/03 14:31:44 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -140,7 +140,7 @@
 #include "metachar.h"
 
 /*	"@(#)var.c	8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: var.c,v 1.895 2021/04/03 11:08:40 rillig Exp $");
+MAKE_RCSID("$NetBSD: var.c,v 1.896 2021/04/03 14:31:44 rillig Exp $");
 
 typedef enum VarFlags {
 	VFL_NONE	= 0,
@@ -4051,8 +4051,8 @@ ValidShortVarname(char varname, const ch
 static bool
 ParseVarnameShort(char varname, const char **pp, GNode *scope,
 		  VarEvalFlags eflags,
-		  VarParseResult *out_FALSE_res, const char **out_FALSE_val,
-		  Var **out_TRUE_var)
+		  VarParseResult *out_false_res, const char **out_false_val,
+		  Var **out_true_var)
 {
 	char name[2];
 	Var *v;
@@ -4061,8 +4061,8 @@ ParseVarnameShort(char varname, const ch
 	vpr = ValidShortVarname(varname, *pp);
 	if (vpr != VPR_OK) {
 		(*pp)++;
-		*out_FALSE_res = vpr;
-		*out_FALSE_val = var_Error;
+		*out_false_res = vpr;
+		*out_false_val = var_Error;
 		return false;
 	}
 
@@ -4080,8 +4080,8 @@ ParseVarnameShort(char varname, const ch
 		if (opts.strict && val == var_Error) {
 			Parse_Error(PARSE_FATAL,
 			"Variable \"%s\" is undefined", name);
-			*out_FALSE_res = VPR_ERR;
-			*out_FALSE_val = val;
+			*out_false_res = VPR_ERR;
+			*out_false_val = val;
 			return false;
 		}
 
@@ -4095,12 +4095,12 @@ ParseVarnameShort(char varname, const ch
 		 * If undefined expressions are allowed, this should rather
 		 * be VPR_UNDEF instead of VPR_OK.
 		 */
-		*out_FALSE_res = eflags.undefErr ? VPR_UNDEF : VPR_OK;
-		*out_FALSE_val = val;
+		*out_false_res = eflags.undefErr ? VPR_UNDEF : VPR_OK;
+		*out_false_val = val;
 		return false;
 	}
 
-	*out_TRUE_var = v;
+	*out_true_var = v;
 	return true;
 }
 
@@ -4178,17 +4178,17 @@ ParseVarnameLong(
 	GNode *scope,
 	VarEvalFlags eflags,
 
-	const char **out_FALSE_pp,
-	VarParseResult *out_FALSE_res,
-	FStr *out_FALSE_val,
-
-	char *out_TRUE_endc,
-	const char **out_TRUE_p,
-	Var **out_TRUE_v,
-	bool *out_TRUE_haveModifier,
-	const char **out_TRUE_extraModifiers,
-	bool *out_TRUE_dynamic,
-	ExprDefined *out_TRUE_exprDefined
+	const char **out_false_pp,
+	VarParseResult *out_false_res,
+	FStr *out_false_val,
+
+	char *out_true_endc,
+	const char **out_true_p,
+	Var **out_true_v,
+	bool *out_true_haveModifier,
+	const char **out_true_extraModifiers,
+	bool *out_true_dynamic,
+	ExprDefined *out_true_exprDefined
 )
 {
 	size_t namelen;
@@ -4210,9 +4210,9 @@ ParseVarnameLong(
 	} else {
 		Parse_Error(PARSE_FATAL, "Unclosed variable \"%s\"", varname);
 		free(varname);
-		*out_FALSE_pp = p;
-		*out_FALSE_val = FStr_InitRefer(var_Error);
-		*out_FALSE_res = VPR_ERR;
+		

CVS commit: src/usr.bin/make

2021-04-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Apr  3 14:31:44 UTC 2021

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

Log Message:
make: rename function parameters to match boolean constants

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.553 -r1.554 src/usr.bin/make/parse.c
cvs rdiff -u -r1.895 -r1.896 src/usr.bin/make/var.c

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



CVS commit: src/usr.sbin/makefs

2021-04-03 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Sat Apr  3 14:10:56 UTC 2021

Modified Files:
src/usr.sbin/makefs: makefs.8 makefs.c makefs.h walk.c

Log Message:
Add a -L option to follow all symbolic links.  Useful if you have symlinks
in a makefs directory tree but want to refer to the actual file.


To generate a diff of this commit:
cvs rdiff -u -r1.66 -r1.67 src/usr.sbin/makefs/makefs.8
cvs rdiff -u -r1.53 -r1.54 src/usr.sbin/makefs/makefs.c
cvs rdiff -u -r1.36 -r1.37 src/usr.sbin/makefs/makefs.h
cvs rdiff -u -r1.29 -r1.30 src/usr.sbin/makefs/walk.c

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

Modified files:

Index: src/usr.sbin/makefs/makefs.8
diff -u src/usr.sbin/makefs/makefs.8:1.66 src/usr.sbin/makefs/makefs.8:1.67
--- src/usr.sbin/makefs/makefs.8:1.66	Sun Nov 15 00:18:48 2020
+++ src/usr.sbin/makefs/makefs.8	Sat Apr  3 14:10:56 2021
@@ -1,4 +1,4 @@
-.\"	$NetBSD: makefs.8,v 1.66 2020/11/15 00:18:48 jmcneill Exp $
+.\"	$NetBSD: makefs.8,v 1.67 2021/04/03 14:10:56 simonb Exp $
 .\"
 .\" Copyright (c) 2001-2003 Wasabi Systems, Inc.
 .\" All rights reserved.
@@ -33,7 +33,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd November 14, 2020
+.Dd April 4, 2021
 .Dt MAKEFS 8
 .Os
 .Sh NAME
@@ -41,7 +41,7 @@
 .Nd create a file system image from a directory tree
 .Sh SYNOPSIS
 .Nm
-.Op Fl rxZ
+.Op Fl LrxZ
 .Op Fl B Ar endian
 .Op Fl b Ar free-blocks
 .Op Fl d Ar debug-mask
@@ -158,6 +158,8 @@ An optional
 suffix may be provided to indicate that
 .Ar free-files
 indicates a percentage of the calculated image size.
+.It Fl L
+All symbolic links are followed.
 .It Fl M Ar minimum-size
 Set the minimum size of the file system image to
 .Ar minimum-size .

Index: src/usr.sbin/makefs/makefs.c
diff -u src/usr.sbin/makefs/makefs.c:1.53 src/usr.sbin/makefs/makefs.c:1.54
--- src/usr.sbin/makefs/makefs.c:1.53	Fri Nov 27 15:10:32 2015
+++ src/usr.sbin/makefs/makefs.c	Sat Apr  3 14:10:56 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: makefs.c,v 1.53 2015/11/27 15:10:32 joerg Exp $	*/
+/*	$NetBSD: makefs.c,v 1.54 2021/04/03 14:10:56 simonb Exp $	*/
 
 /*
  * Copyright (c) 2001-2003 Wasabi Systems, Inc.
@@ -41,7 +41,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(__lint)
-__RCSID("$NetBSD: makefs.c,v 1.53 2015/11/27 15:10:32 joerg Exp $");
+__RCSID("$NetBSD: makefs.c,v 1.54 2021/04/03 14:10:56 simonb Exp $");
 #endif	/* !__lint */
 
 #include 
@@ -129,7 +129,7 @@ main(int argc, char *argv[])
 		err(1, "Unable to get system time");
 
 
-	while ((ch = getopt(argc, argv, "B:b:d:f:F:M:m:N:O:o:rs:S:t:T:xZ")) != -1) {
+	while ((ch = getopt(argc, argv, "B:b:d:f:F:LM:m:N:O:o:rs:S:t:T:xZ")) != -1) {
 		switch (ch) {
 
 		case 'B':
@@ -187,6 +187,10 @@ main(int argc, char *argv[])
 			specfile = optarg;
 			break;
 
+		case 'L':
+			fsoptions.follow = true;
+			break;
+
 		case 'M':
 			fsoptions.minsize =
 			strsuftoll("minimum size", optarg, 1LL, LLONG_MAX);
@@ -286,7 +290,8 @@ main(int argc, char *argv[])
 
 /* walk the tree */
 	TIMER_START(start);
-	root = walk_dir(argv[1], ".", NULL, NULL, fsoptions.replace);
+	root = walk_dir(argv[1], ".", NULL, NULL, fsoptions.replace,
+	fsoptions.follow);
 	TIMER_RESULTS(start, "walk_dir");
 
 	/* append extra directory */
@@ -297,7 +302,8 @@ main(int argc, char *argv[])
 		if (!S_ISDIR(sb.st_mode))
 			errx(1, "%s: not a directory", argv[i]);
 		TIMER_START(start);
-		root = walk_dir(argv[i], ".", NULL, root, fsoptions.replace);
+		root = walk_dir(argv[i], ".", NULL, root, fsoptions.replace,
+		fsoptions.follow);
 		TIMER_RESULTS(start, "walk_dir2");
 	}
 

Index: src/usr.sbin/makefs/makefs.h
diff -u src/usr.sbin/makefs/makefs.h:1.36 src/usr.sbin/makefs/makefs.h:1.37
--- src/usr.sbin/makefs/makefs.h:1.36	Wed Nov 25 00:48:49 2015
+++ src/usr.sbin/makefs/makefs.h	Sat Apr  3 14:10:56 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: makefs.h,v 1.36 2015/11/25 00:48:49 christos Exp $	*/
+/*	$NetBSD: makefs.h,v 1.37 2021/04/03 14:10:56 simonb Exp $	*/
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -166,6 +166,7 @@ typedef struct makefs_fsinfo {
 	int	sectorsize;	/* sector size */
 	int	sparse;		/* sparse image, don't fill it with zeros */
 	int	replace;	/* replace files when merging */
+	int	follow;		/* follow symlinks */
 
 	void	*fs_specific;	/* File system specific additions. */
 	option_t *fs_options;	/* File system specific options */
@@ -180,7 +181,8 @@ const char *	inode_type(mode_t);
 int		set_option(const option_t *, const char *, char *, size_t);
 int		set_option_var(const option_t *, const char *, const char *,
 char *, size_t);
-fsnode *	walk_dir(const char *, const char *, fsnode *, fsnode *, int);
+fsnode *	walk_dir(const char *, const char *, fsnode *, fsnode *, int,
+int);
 void		free_fsnodes(fsnode *);
 option_t *	copy_opts(const option_t *);
 

Index: src/usr.sbin/makefs/walk.c
diff -u 

CVS commit: src/usr.sbin/makefs

2021-04-03 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Sat Apr  3 14:10:56 UTC 2021

Modified Files:
src/usr.sbin/makefs: makefs.8 makefs.c makefs.h walk.c

Log Message:
Add a -L option to follow all symbolic links.  Useful if you have symlinks
in a makefs directory tree but want to refer to the actual file.


To generate a diff of this commit:
cvs rdiff -u -r1.66 -r1.67 src/usr.sbin/makefs/makefs.8
cvs rdiff -u -r1.53 -r1.54 src/usr.sbin/makefs/makefs.c
cvs rdiff -u -r1.36 -r1.37 src/usr.sbin/makefs/makefs.h
cvs rdiff -u -r1.29 -r1.30 src/usr.sbin/makefs/walk.c

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



CVS commit: src/usr.sbin/mtree

2021-04-03 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Sat Apr  3 13:37:18 UTC 2021

Modified Files:
src/usr.sbin/mtree: compare.c

Log Message:
Deal with the case when a device gets recreated (eg when mtree is called by
MAKEDEV) and the stat buffer contains information about the original device
before checking/setting the owner/group/mode of the new device file.


To generate a diff of this commit:
cvs rdiff -u -r1.59 -r1.60 src/usr.sbin/mtree/compare.c

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

Modified files:

Index: src/usr.sbin/mtree/compare.c
diff -u src/usr.sbin/mtree/compare.c:1.59 src/usr.sbin/mtree/compare.c:1.60
--- src/usr.sbin/mtree/compare.c:1.59	Thu Mar 18 20:02:18 2021
+++ src/usr.sbin/mtree/compare.c	Sat Apr  3 13:37:18 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: compare.c,v 1.59 2021/03/18 20:02:18 cheusov Exp $	*/
+/*	$NetBSD: compare.c,v 1.60 2021/04/03 13:37:18 simonb Exp $	*/
 
 /*-
  * Copyright (c) 1989, 1993
@@ -38,7 +38,7 @@
 #if 0
 static char sccsid[] = "@(#)compare.c	8.1 (Berkeley) 6/6/93";
 #else
-__RCSID("$NetBSD: compare.c,v 1.59 2021/03/18 20:02:18 cheusov Exp $");
+__RCSID("$NetBSD: compare.c,v 1.60 2021/04/03 13:37:18 simonb Exp $");
 #endif
 #endif /* not lint */
 
@@ -137,6 +137,7 @@ compare(NODE *s, FTSENT *p)
 {
 	uint32_t len, val, flags;
 	int fd, label;
+	bool was_unlinked;
 	const char *cp, *tab;
 #if !defined(NO_MD5) || !defined(NO_RMD160) || !defined(NO_SHA1) || !defined(NO_SHA2)
 	char *digestbuf;
@@ -144,6 +145,7 @@ compare(NODE *s, FTSENT *p)
 
 	tab = NULL;
 	label = 0;
+	was_unlinked = false;
 	switch(s->type) {
 	case F_BLOCK:
 		if (!S_ISBLK(p->fts_statp->st_mode))
@@ -210,19 +212,22 @@ typeerr:		LABEL;
 			  s->st_mode | nodetoino(s->type),
 			  s->st_rdev) == -1) ||
 			(lchown(p->fts_accpath, p->fts_statp->st_uid,
-			  p->fts_statp->st_gid) == -1) )
+			  p->fts_statp->st_gid) == -1) ) {
 printf(", not modified: %s%s\n",
 strerror(errno),
 flavor == F_FREEBSD9 ? "" : ")");
-			 else
+			} else {
 printf(", modified%s\n",
 flavor == F_FREEBSD9 ? "" : ")");
+was_unlinked = true;
+			}
 		} else
 			printf(")\n");
 		tab = "\t";
 	}
 	/* Set the uid/gid first, then set the mode. */
-	if (s->flags & (F_UID | F_UNAME) && s->st_uid != p->fts_statp->st_uid) {
+	if (s->flags & (F_UID | F_UNAME) &&
+	(was_unlinked || s->st_uid != p->fts_statp->st_uid)) {
 		LABEL;
 		printf(flavor == F_FREEBSD9 ?
 		"%suser expected %lu found %lu" : "%suser (%lu, %lu",
@@ -233,13 +238,15 @@ typeerr:		LABEL;
 strerror(errno),
 flavor == F_FREEBSD9 ? "" : ")");
 			else
-printf(", modified%s\n",
+printf(", modified%s%s\n",
+was_unlinked ? " by unlink" : "",
 flavor == F_FREEBSD9 ? "" : ")");
 		} else
 			printf(")\n");
 		tab = "\t";
 	}
-	if (s->flags & (F_GID | F_GNAME) && s->st_gid != p->fts_statp->st_gid) {
+	if (s->flags & (F_GID | F_GNAME) &&
+	(was_unlinked || s->st_gid != p->fts_statp->st_gid)) {
 		LABEL;
 		printf(flavor == F_FREEBSD9 ?
 		"%sgid expected %lu found %lu" : "%sgid (%lu, %lu",
@@ -250,7 +257,8 @@ typeerr:		LABEL;
 strerror(errno),
 flavor == F_FREEBSD9 ? "" : ")");
 			else
-printf(", modified%s\n",
+printf(", modified%s%s\n",
+was_unlinked ? " by unlink" : "",
 flavor == F_FREEBSD9 ? "" : ")");
 		}
 		else
@@ -258,8 +266,8 @@ typeerr:		LABEL;
 		tab = "\t";
 	}
 	if (s->flags & F_MODE &&
-	s->st_mode != (p->fts_statp->st_mode & MBITS)) {
-		if (lflag) {
+	(was_unlinked || s->st_mode != (p->fts_statp->st_mode & MBITS))) {
+		if (lflag && !was_unlinked) {
 			mode_t tmode, mode;
 
 			tmode = s->st_mode;
@@ -287,7 +295,8 @@ typeerr:		LABEL;
 strerror(errno),
 flavor == F_FREEBSD9 ? "" : ")");
 			else
-printf(", modified%s\n",
+printf(", modified%s%s\n",
+was_unlinked ? " by unlink" : "",
 flavor == F_FREEBSD9 ? "" : ")");
 		}
 		else



CVS commit: src/usr.sbin/mtree

2021-04-03 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Sat Apr  3 13:37:18 UTC 2021

Modified Files:
src/usr.sbin/mtree: compare.c

Log Message:
Deal with the case when a device gets recreated (eg when mtree is called by
MAKEDEV) and the stat buffer contains information about the original device
before checking/setting the owner/group/mode of the new device file.


To generate a diff of this commit:
cvs rdiff -u -r1.59 -r1.60 src/usr.sbin/mtree/compare.c

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



CVS commit: src/sys

2021-04-03 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Sat Apr  3 12:57:21 UTC 2021

Modified Files:
src/sys/compat/common: kern_time_50.c
src/sys/kern: kern_time.c

Log Message:
Centralise the setitimer() timer type validation in dosetitimer() as is
done with dogetitimer().


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/sys/compat/common/kern_time_50.c
cvs rdiff -u -r1.210 -r1.211 src/sys/kern/kern_time.c

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



CVS commit: src/sys

2021-04-03 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Sat Apr  3 12:57:21 UTC 2021

Modified Files:
src/sys/compat/common: kern_time_50.c
src/sys/kern: kern_time.c

Log Message:
Centralise the setitimer() timer type validation in dosetitimer() as is
done with dogetitimer().


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/sys/compat/common/kern_time_50.c
cvs rdiff -u -r1.210 -r1.211 src/sys/kern/kern_time.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/compat/common/kern_time_50.c
diff -u src/sys/compat/common/kern_time_50.c:1.35 src/sys/compat/common/kern_time_50.c:1.36
--- src/sys/compat/common/kern_time_50.c:1.35	Thu Feb 27 16:41:59 2020
+++ src/sys/compat/common/kern_time_50.c	Sat Apr  3 12:57:21 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_time_50.c,v 1.35 2020/02/27 16:41:59 pgoyette Exp $	*/
+/*	$NetBSD: kern_time_50.c,v 1.36 2021/04/03 12:57:21 simonb Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_time_50.c,v 1.35 2020/02/27 16:41:59 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_time_50.c,v 1.36 2021/04/03 12:57:21 simonb Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -324,8 +324,6 @@ compat_50_sys_setitimer(struct lwp *l,
 	struct itimerval aitv;
 	int error;
 
-	if ((u_int)which > ITIMER_PROF)
-		return (EINVAL);
 	itvp = SCARG(uap, itv);
 	if (itvp &&
 	(error = copyin(itvp, , sizeof(aitv50))) != 0)

Index: src/sys/kern/kern_time.c
diff -u src/sys/kern/kern_time.c:1.210 src/sys/kern/kern_time.c:1.211
--- src/sys/kern/kern_time.c:1.210	Tue Dec  8 04:09:38 2020
+++ src/sys/kern/kern_time.c	Sat Apr  3 12:57:21 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_time.c,v 1.210 2020/12/08 04:09:38 thorpej Exp $	*/
+/*	$NetBSD: kern_time.c,v 1.211 2021/04/03 12:57:21 simonb Exp $	*/
 
 /*-
  * Copyright (c) 2000, 2004, 2005, 2007, 2008, 2009, 2020
@@ -62,7 +62,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_time.c,v 1.210 2020/12/08 04:09:38 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_time.c,v 1.211 2021/04/03 12:57:21 simonb Exp $");
 
 #include 
 #include 
@@ -1576,8 +1576,6 @@ sys___setitimer50(struct lwp *l, const s
 	struct itimerval aitv;
 	int error;
 
-	if ((u_int)which > ITIMER_MONOTONIC)
-		return (EINVAL);
 	itvp = SCARG(uap, itv);
 	if (itvp &&
 	(error = copyin(itvp, , sizeof(struct itimerval))) != 0)
@@ -1604,7 +1602,8 @@ dosetitimer(struct proc *p, int which, s
 	struct itlist *itl;
 	int error;
 
-	KASSERT((u_int)which <= CLOCK_MONOTONIC);
+	if ((u_int)which > ITIMER_MONOTONIC)
+		return (EINVAL);
 	if (itimerfix(>it_value) || itimerfix(>it_interval))
 		return (EINVAL);
 



CVS commit: src/sys/kern

2021-04-03 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Sat Apr  3 12:06:53 UTC 2021

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

Log Message:
Print the "preposterous TOD clock time" message only if the RTC is
before very late 2020 (1/1/2021 minus a few leap days) instead of
late 1994.  Someone(TM) should remember to adjust this in somewhat
less than 26 years.


To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.47 src/sys/kern/kern_todr.c

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



CVS commit: src/sys/kern

2021-04-03 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Sat Apr  3 12:06:53 UTC 2021

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

Log Message:
Print the "preposterous TOD clock time" message only if the RTC is
before very late 2020 (1/1/2021 minus a few leap days) instead of
late 1994.  Someone(TM) should remember to adjust this in somewhat
less than 26 years.


To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.47 src/sys/kern/kern_todr.c

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

Modified files:

Index: src/sys/kern/kern_todr.c
diff -u src/sys/kern/kern_todr.c:1.46 src/sys/kern/kern_todr.c:1.47
--- src/sys/kern/kern_todr.c:1.46	Fri Jan  3 01:24:48 2020
+++ src/sys/kern/kern_todr.c	Sat Apr  3 12:06:53 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_todr.c,v 1.46 2020/01/03 01:24:48 thorpej Exp $	*/
+/*	$NetBSD: kern_todr.c,v 1.47 2021/04/03 12:06:53 simonb Exp $	*/
 
 /*-
  * Copyright (c) 2020 The NetBSD Foundation, Inc.
@@ -70,7 +70,7 @@
 #include "opt_todr.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_todr.c,v 1.46 2020/01/03 01:24:48 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_todr.c,v 1.47 2021/04/03 12:06:53 simonb Exp $");
 
 #include 
 #include 
@@ -90,6 +90,9 @@ static kmutex_t todr_mutex;
 static todr_chip_handle_t todr_handle;
 static bool todr_initialized;
 
+/* The minimum reasonable RTC date before preposterousness */
+#define	PREPOSTEROUS_YEARS	(2021 - POSIX_BASE_YEAR)
+
 /*
  * todr_init:
  *	Initialize TOD clock data.
@@ -213,7 +216,7 @@ todr_set_systime(time_t base)
 
 	if ((todr_handle == NULL) ||
 	(todr_gettime(todr_handle, ) != 0) ||
-	(tv.tv_sec < (25 * SECS_PER_COMMON_YEAR))) {
+	(tv.tv_sec < (PREPOSTEROUS_YEARS * SECS_PER_COMMON_YEAR))) {
 
 		if (todr_handle != NULL)
 			printf("WARNING: preposterous TOD clock time\n");



CVS commit: src/usr.bin/make

2021-04-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Apr  3 12:01:00 UTC 2021

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

Log Message:
make: use standard %H in strftime instead of %k

The conversion specifier %k is neither in C99 nor in C90.

These timestamps are only used in the debug output.


To generate a diff of this commit:
cvs rdiff -u -r1.167 -r1.168 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.167 src/usr.bin/make/targ.c:1.168
--- src/usr.bin/make/targ.c:1.167	Sat Apr  3 11:08:40 2021
+++ src/usr.bin/make/targ.c	Sat Apr  3 12:01:00 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: targ.c,v 1.167 2021/04/03 11:08:40 rillig Exp $	*/
+/*	$NetBSD: targ.c,v 1.168 2021/04/03 12:01:00 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -113,7 +113,7 @@
 #include "dir.h"
 
 /*	"@(#)targ.c	8.2 (Berkeley) 3/19/94"	*/
-MAKE_RCSID("$NetBSD: targ.c,v 1.167 2021/04/03 11:08:40 rillig Exp $");
+MAKE_RCSID("$NetBSD: targ.c,v 1.168 2021/04/03 12:01:00 rillig Exp $");
 
 /*
  * All target nodes that appeared on the left-hand side of one of the
@@ -410,7 +410,7 @@ Targ_FmtTime(time_t tm)
 	static char buf[128];
 
 	struct tm *parts = localtime();
-	(void)strftime(buf, sizeof buf, "%k:%M:%S %b %d, %Y", parts);
+	(void)strftime(buf, sizeof buf, "%H:%M:%S %b %d, %Y", parts);
 	return buf;
 }
 



CVS commit: src/usr.bin/make

2021-04-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Apr  3 12:01:00 UTC 2021

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

Log Message:
make: use standard %H in strftime instead of %k

The conversion specifier %k is neither in C99 nor in C90.

These timestamps are only used in the debug output.


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



CVS commit: src/sys/kern

2021-04-03 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Sat Apr  3 11:19:11 UTC 2021

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

Log Message:
CTASSERT that NSIG <= 128.  There are many hard-coded assumptions that
there are <= 4 x 32bit signal mask bits.


To generate a diff of this commit:
cvs rdiff -u -r1.396 -r1.397 src/sys/kern/kern_sig.c

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



CVS commit: src/sys/kern

2021-04-03 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Sat Apr  3 11:19:11 UTC 2021

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

Log Message:
CTASSERT that NSIG <= 128.  There are many hard-coded assumptions that
there are <= 4 x 32bit signal mask bits.


To generate a diff of this commit:
cvs rdiff -u -r1.396 -r1.397 src/sys/kern/kern_sig.c

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

Modified files:

Index: src/sys/kern/kern_sig.c
diff -u src/sys/kern/kern_sig.c:1.396 src/sys/kern/kern_sig.c:1.397
--- src/sys/kern/kern_sig.c:1.396	Mon Jan 11 17:18:51 2021
+++ src/sys/kern/kern_sig.c	Sat Apr  3 11:19:11 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_sig.c,v 1.396 2021/01/11 17:18:51 skrll Exp $	*/
+/*	$NetBSD: kern_sig.c,v 1.397 2021/04/03 11:19:11 simonb Exp $	*/
 
 /*-
  * Copyright (c) 2006, 2007, 2008, 2019 The NetBSD Foundation, Inc.
@@ -70,7 +70,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_sig.c,v 1.396 2021/01/11 17:18:51 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_sig.c,v 1.397 2021/04/03 11:19:11 simonb Exp $");
 
 #include "opt_execfmt.h"
 #include "opt_ptrace.h"
@@ -110,6 +110,9 @@ __KERNEL_RCSID(0, "$NetBSD: kern_sig.c,v
 
 #include 
 
+/* Many hard-coded assumptions that there are <= 4 x 32bit signal mask bits */
+__CTASSERT(NSIG <= 128);
+
 #define	SIGQUEUE_MAX	32
 static pool_cache_t	sigacts_cache	__read_mostly;
 static pool_cache_t	ksiginfo_cache	__read_mostly;



CVS commit: src/usr.bin/make

2021-04-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Apr  3 11:08:40 UTC 2021

Modified Files:
src/usr.bin/make: arch.c buf.h compat.c cond.c dir.c dir.h for.c hash.c
hash.h job.c job.h lst.h main.c make.c make.h meta.c meta.h
metachar.h nonints.h parse.c str.c suff.c targ.c test-variants.sh
var.c
src/usr.bin/make/unit-tests: Makefile varmod-match-escape.mk

Log Message:
make: use C99 bool type instead of defining its own

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.198 -r1.199 src/usr.bin/make/arch.c
cvs rdiff -u -r1.42 -r1.43 src/usr.bin/make/buf.h
cvs rdiff -u -r1.224 -r1.225 src/usr.bin/make/compat.c
cvs rdiff -u -r1.259 -r1.260 src/usr.bin/make/cond.c
cvs rdiff -u -r1.270 -r1.271 src/usr.bin/make/dir.c
cvs rdiff -u -r1.43 -r1.44 src/usr.bin/make/dir.h
cvs rdiff -u -r1.141 -r1.142 src/usr.bin/make/for.c
cvs rdiff -u -r1.61 -r1.62 src/usr.bin/make/hash.c
cvs rdiff -u -r1.38 -r1.39 src/usr.bin/make/hash.h
cvs rdiff -u -r1.420 -r1.421 src/usr.bin/make/job.c
cvs rdiff -u -r1.72 -r1.73 src/usr.bin/make/job.h
cvs rdiff -u -r1.97 -r1.98 src/usr.bin/make/lst.h
cvs rdiff -u -r1.533 -r1.534 src/usr.bin/make/main.c
cvs rdiff -u -r1.242 -r1.243 src/usr.bin/make/make.c
cvs rdiff -u -r1.256 -r1.257 src/usr.bin/make/make.h
cvs rdiff -u -r1.179 -r1.180 src/usr.bin/make/meta.c
cvs rdiff -u -r1.9 -r1.10 src/usr.bin/make/meta.h \
src/usr.bin/make/test-variants.sh
cvs rdiff -u -r1.15 -r1.16 src/usr.bin/make/metachar.h
cvs rdiff -u -r1.206 -r1.207 src/usr.bin/make/nonints.h
cvs rdiff -u -r1.552 -r1.553 src/usr.bin/make/parse.c
cvs rdiff -u -r1.81 -r1.82 src/usr.bin/make/str.c
cvs rdiff -u -r1.348 -r1.349 src/usr.bin/make/suff.c
cvs rdiff -u -r1.166 -r1.167 src/usr.bin/make/targ.c
cvs rdiff -u -r1.894 -r1.895 src/usr.bin/make/var.c
cvs rdiff -u -r1.273 -r1.274 src/usr.bin/make/unit-tests/Makefile
cvs rdiff -u -r1.6 -r1.7 src/usr.bin/make/unit-tests/varmod-match-escape.mk

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



CVS commit: src/lib/librumpuser

2021-04-03 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Sat Apr  3 07:38:11 UTC 2021

Modified Files:
src/lib/librumpuser: rumpuser_port.h

Log Message:
For MIPS N32, register_t needs to be uint64_t as "long" isn't
big enough.


To generate a diff of this commit:
cvs rdiff -u -r1.50 -r1.51 src/lib/librumpuser/rumpuser_port.h

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



CVS commit: src/lib/librumpuser

2021-04-03 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Sat Apr  3 07:38:11 UTC 2021

Modified Files:
src/lib/librumpuser: rumpuser_port.h

Log Message:
For MIPS N32, register_t needs to be uint64_t as "long" isn't
big enough.


To generate a diff of this commit:
cvs rdiff -u -r1.50 -r1.51 src/lib/librumpuser/rumpuser_port.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/librumpuser/rumpuser_port.h
diff -u src/lib/librumpuser/rumpuser_port.h:1.50 src/lib/librumpuser/rumpuser_port.h:1.51
--- src/lib/librumpuser/rumpuser_port.h:1.50	Thu May 11 10:21:55 2017
+++ src/lib/librumpuser/rumpuser_port.h	Sat Apr  3 07:38:11 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: rumpuser_port.h,v 1.50 2017/05/11 10:21:55 martin Exp $	*/
+/*	$NetBSD: rumpuser_port.h,v 1.51 2021/04/03 07:38:11 simonb Exp $	*/
 
 #ifndef _LIB_LIBRUMPUSER_RUMPUSER_PORT_H_
 #define _LIB_LIBRUMPUSER_RUMPUSER_PORT_H_
@@ -297,6 +297,13 @@ aligned_alloc(size_t alignment, size_t s
 #define MSG_NOSIGNAL 0
 #endif
 
+#if defined(__NetBSD__) && defined(__mips_n32)	/* XXX */
+/* The MIPS N32 ABI has 4 byte longs but uses 8 byte registers */
+#define	HAVE_REGISTER_T	1
+#define	RUMP_REGISTER_T uint64_t
+typedef RUMP_REGISTER_T register_t;
+#define	PRIxREGISTER	PRIx64
+#endif /* __NetBSD__ && __mips_n32 */		/* XXX */
 #if !defined(HAVE_REGISTER_T) && !defined(RUMP_REGISTER_T)
 #define RUMP_REGISTER_T long
 typedef RUMP_REGISTER_T register_t;



CVS commit: [thorpej-cfargs] src/sys

2021-04-03 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sat Apr  3 06:54:29 UTC 2021

Modified Files:
src/sys/arch/powerpc/booke/dev [thorpej-cfargs]: pq3obio.c
src/sys/arch/x86/pci [thorpej-cfargs]: amdpcib.c amdsmn.c
src/sys/dev/audio [thorpej-cfargs]: audio.c
src/sys/dev/fdt [thorpej-cfargs]: fdtbus.c
src/sys/dev/gpio [thorpej-cfargs]: gpio.c
src/sys/dev/ic [thorpej-cfargs]: apple_smc.c
src/sys/dev/isa [thorpej-cfargs]: isa.c pcppi.c
src/sys/dev/scsipi [thorpej-cfargs]: scsiconf.c
src/sys/kern [thorpej-cfargs]: subr_autoconf.c
src/sys/sys [thorpej-cfargs]: device.h

Log Message:
config_attach_loc() -> config_attach() with CFARG_LOCATORS argument.


To generate a diff of this commit:
cvs rdiff -u -r1.5.4.2 -r1.5.4.3 src/sys/arch/powerpc/booke/dev/pq3obio.c
cvs rdiff -u -r1.3.96.1 -r1.3.96.2 src/sys/arch/x86/pci/amdpcib.c
cvs rdiff -u -r1.10.4.3 -r1.10.4.4 src/sys/arch/x86/pci/amdsmn.c
cvs rdiff -u -r1.91.2.4 -r1.91.2.5 src/sys/dev/audio/audio.c
cvs rdiff -u -r1.40.2.2 -r1.40.2.3 src/sys/dev/fdt/fdtbus.c
cvs rdiff -u -r1.64.10.6 -r1.64.10.7 src/sys/dev/gpio/gpio.c
cvs rdiff -u -r1.6.50.2 -r1.6.50.3 src/sys/dev/ic/apple_smc.c
cvs rdiff -u -r1.138.76.4 -r1.138.76.5 src/sys/dev/isa/isa.c
cvs rdiff -u -r1.45.22.3 -r1.45.22.4 src/sys/dev/isa/pcppi.c
cvs rdiff -u -r1.290.4.3 -r1.290.4.4 src/sys/dev/scsipi/scsiconf.c
cvs rdiff -u -r1.277.2.7 -r1.277.2.8 src/sys/kern/subr_autoconf.c
cvs rdiff -u -r1.167.2.5 -r1.167.2.6 src/sys/sys/device.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/powerpc/booke/dev/pq3obio.c
diff -u src/sys/arch/powerpc/booke/dev/pq3obio.c:1.5.4.2 src/sys/arch/powerpc/booke/dev/pq3obio.c:1.5.4.3
--- src/sys/arch/powerpc/booke/dev/pq3obio.c:1.5.4.2	Sun Mar 21 17:35:46 2021
+++ src/sys/arch/powerpc/booke/dev/pq3obio.c	Sat Apr  3 06:54:28 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: pq3obio.c,v 1.5.4.2 2021/03/21 17:35:46 thorpej Exp $	*/
+/*	$NetBSD: pq3obio.c,v 1.5.4.3 2021/04/03 06:54:28 thorpej Exp $	*/
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -37,7 +37,7 @@
 #define	LBC_PRIVATE
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pq3obio.c,v 1.5.4.2 2021/03/21 17:35:46 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pq3obio.c,v 1.5.4.3 2021/04/03 06:54:28 thorpej Exp $");
 
 #include "locators.h"
 
@@ -151,7 +151,9 @@ pq3obio_search(device_t parent, cfdata_t
 			[OBIOCF_IRQ] = ga.ga_irq,
 			[OBIOCF_CS] = ga.ga_cs,
 			};
-			config_attach_loc(parent, cf, floc, , pq3obio_print);
+			config_attach(parent, cf, , pq3obio_print,
+			CFARG_LOCATORS, floc,
+			CFARG_EOL);
 			tryagain = (cf->cf_fstate == FSTATE_STAR);
 		}
 	} while (tryagain);

Index: src/sys/arch/x86/pci/amdpcib.c
diff -u src/sys/arch/x86/pci/amdpcib.c:1.3.96.1 src/sys/arch/x86/pci/amdpcib.c:1.3.96.2
--- src/sys/arch/x86/pci/amdpcib.c:1.3.96.1	Sat Mar 20 19:33:39 2021
+++ src/sys/arch/x86/pci/amdpcib.c	Sat Apr  3 06:54:28 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: amdpcib.c,v 1.3.96.1 2021/03/20 19:33:39 thorpej Exp $ */
+/* $NetBSD: amdpcib.c,v 1.3.96.2 2021/04/03 06:54:28 thorpej Exp $ */
 
 /*
  * Copyright (c) 2006 Nicolas Joly
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: amdpcib.c,v 1.3.96.1 2021/03/20 19:33:39 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: amdpcib.c,v 1.3.96.2 2021/04/03 06:54:28 thorpej Exp $");
 
 #include 
 #include 
@@ -83,7 +83,9 @@ amdpcib_search(device_t parent, cfdata_t
 {
 
 	if (config_match(parent, cf, aux))
-		config_attach_loc(parent, cf, locs, aux, NULL);
+		config_attach(parent, cf, aux, NULL,
+		CFARG_LOCATORS, locs,
+		CFARG_EOL);
 
 	return 0;
 }

Index: src/sys/arch/x86/pci/amdsmn.c
diff -u src/sys/arch/x86/pci/amdsmn.c:1.10.4.3 src/sys/arch/x86/pci/amdsmn.c:1.10.4.4
--- src/sys/arch/x86/pci/amdsmn.c:1.10.4.3	Sun Mar 28 01:03:19 2021
+++ src/sys/arch/x86/pci/amdsmn.c	Sat Apr  3 06:54:28 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: amdsmn.c,v 1.10.4.3 2021/03/28 01:03:19 thorpej Exp $	*/
+/*	$NetBSD: amdsmn.c,v 1.10.4.4 2021/04/03 06:54:28 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 2017, 2019 Conrad Meyer 
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: amdsmn.c,v 1.10.4.3 2021/03/28 01:03:19 thorpej Exp $ ");
+__KERNEL_RCSID(0, "$NetBSD: amdsmn.c,v 1.10.4.4 2021/04/03 06:54:28 thorpej Exp $ ");
 
 /*
  * Driver for the AMD Family 15h (model 60+) and 17h CPU
@@ -123,7 +123,9 @@ static int
 amdsmn_misc_search(device_t parent, cfdata_t cf, const int *locs, void *aux)
 {
 	if (config_match(parent, cf, aux))
-		config_attach_loc(parent, cf, locs, aux, NULL);
+		config_attach(parent, cf, aux, NULL,
+		CFARG_LOCATORS, locs,
+		CFARG_EOL);
 
 	return 0;
 }

Index: src/sys/dev/audio/audio.c
diff -u src/sys/dev/audio/audio.c:1.91.2.4 src/sys/dev/audio/audio.c:1.91.2.5
--- src/sys/dev/audio/audio.c:1.91.2.4	Sun Mar 28 19:55:37 2021
+++ 

CVS commit: [thorpej-cfargs] src/sys

2021-04-03 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sat Apr  3 06:54:29 UTC 2021

Modified Files:
src/sys/arch/powerpc/booke/dev [thorpej-cfargs]: pq3obio.c
src/sys/arch/x86/pci [thorpej-cfargs]: amdpcib.c amdsmn.c
src/sys/dev/audio [thorpej-cfargs]: audio.c
src/sys/dev/fdt [thorpej-cfargs]: fdtbus.c
src/sys/dev/gpio [thorpej-cfargs]: gpio.c
src/sys/dev/ic [thorpej-cfargs]: apple_smc.c
src/sys/dev/isa [thorpej-cfargs]: isa.c pcppi.c
src/sys/dev/scsipi [thorpej-cfargs]: scsiconf.c
src/sys/kern [thorpej-cfargs]: subr_autoconf.c
src/sys/sys [thorpej-cfargs]: device.h

Log Message:
config_attach_loc() -> config_attach() with CFARG_LOCATORS argument.


To generate a diff of this commit:
cvs rdiff -u -r1.5.4.2 -r1.5.4.3 src/sys/arch/powerpc/booke/dev/pq3obio.c
cvs rdiff -u -r1.3.96.1 -r1.3.96.2 src/sys/arch/x86/pci/amdpcib.c
cvs rdiff -u -r1.10.4.3 -r1.10.4.4 src/sys/arch/x86/pci/amdsmn.c
cvs rdiff -u -r1.91.2.4 -r1.91.2.5 src/sys/dev/audio/audio.c
cvs rdiff -u -r1.40.2.2 -r1.40.2.3 src/sys/dev/fdt/fdtbus.c
cvs rdiff -u -r1.64.10.6 -r1.64.10.7 src/sys/dev/gpio/gpio.c
cvs rdiff -u -r1.6.50.2 -r1.6.50.3 src/sys/dev/ic/apple_smc.c
cvs rdiff -u -r1.138.76.4 -r1.138.76.5 src/sys/dev/isa/isa.c
cvs rdiff -u -r1.45.22.3 -r1.45.22.4 src/sys/dev/isa/pcppi.c
cvs rdiff -u -r1.290.4.3 -r1.290.4.4 src/sys/dev/scsipi/scsiconf.c
cvs rdiff -u -r1.277.2.7 -r1.277.2.8 src/sys/kern/subr_autoconf.c
cvs rdiff -u -r1.167.2.5 -r1.167.2.6 src/sys/sys/device.h

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