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

2022-05-07 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat May  7 21:24:53 UTC 2022

Modified Files:
src/usr.bin/make/unit-tests: deptgt-posix.mk

Log Message:
tests/make: document why deptgt-posix needs its own directory

As described in PR toolchain/15163, '.include ' first looks in the
current directory, using the system include path only as fallback.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/usr.bin/make/unit-tests/deptgt-posix.mk

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

Modified files:

Index: src/usr.bin/make/unit-tests/deptgt-posix.mk
diff -u src/usr.bin/make/unit-tests/deptgt-posix.mk:1.3 src/usr.bin/make/unit-tests/deptgt-posix.mk:1.4
--- src/usr.bin/make/unit-tests/deptgt-posix.mk:1.3	Sat May  7 12:40:40 2022
+++ src/usr.bin/make/unit-tests/deptgt-posix.mk	Sat May  7 21:24:52 2022
@@ -1,4 +1,4 @@
-# $NetBSD: deptgt-posix.mk,v 1.3 2022/05/07 12:40:40 rillig Exp $
+# $NetBSD: deptgt-posix.mk,v 1.4 2022/05/07 21:24:52 rillig Exp $
 #
 # Tests for the special target '.POSIX', which enables POSIX mode.
 #
@@ -13,7 +13,10 @@
 #
 # Implementation note: this test needs to run isolated from the usual tests
 # directory to prevent unit-tests/posix.mk from interfering with the posix.mk
-# from the system directory that this test uses.
+# from the system directory that this test uses; since at least 1997, the
+# directive '.include ' has been looking in the current directory first
+# before searching the file in the system search path, as described in
+# https://gnats.netbsd.org/15163.
 #
 # See also:
 #	https://pubs.opengroup.org/onlinepubs/9699919799/utilities/make.html



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

2022-05-07 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat May  7 21:24:53 UTC 2022

Modified Files:
src/usr.bin/make/unit-tests: deptgt-posix.mk

Log Message:
tests/make: document why deptgt-posix needs its own directory

As described in PR toolchain/15163, '.include ' first looks in the
current directory, using the system include path only as fallback.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/usr.bin/make/unit-tests/deptgt-posix.mk

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



CVS commit: src/usr.bin/make

2022-05-07 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat May  7 21:19:43 UTC 2022

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

Log Message:
make: fix grammar in comment of DirFindDot


To generate a diff of this commit:
cvs rdiff -u -r1.278 -r1.279 src/usr.bin/make/dir.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/dir.c
diff -u src/usr.bin/make/dir.c:1.278 src/usr.bin/make/dir.c:1.279
--- src/usr.bin/make/dir.c:1.278	Fri Feb  4 23:22:19 2022
+++ src/usr.bin/make/dir.c	Sat May  7 21:19:43 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: dir.c,v 1.278 2022/02/04 23:22:19 rillig Exp $	*/
+/*	$NetBSD: dir.c,v 1.279 2022/05/07 21:19:43 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -138,7 +138,7 @@
 #include "job.h"
 
 /*	"@(#)dir.c	8.2 (Berkeley) 1/2/94"	*/
-MAKE_RCSID("$NetBSD: dir.c,v 1.278 2022/02/04 23:22:19 rillig Exp $");
+MAKE_RCSID("$NetBSD: dir.c,v 1.279 2022/05/07 21:19:43 rillig Exp $");
 
 /*
  * A search path is a list of CachedDir structures. A CachedDir has in it the
@@ -1035,7 +1035,7 @@ DirLookupAbs(CachedDir *dir, const char 
 }
 
 /*
- * Find the file given on "." or curdir.
+ * Find the given file in "." or curdir.
  * Return the freshly allocated path to the file, or NULL.
  */
 static char *



CVS commit: src/usr.bin/make

2022-05-07 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat May  7 21:19:43 UTC 2022

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

Log Message:
make: fix grammar in comment of DirFindDot


To generate a diff of this commit:
cvs rdiff -u -r1.278 -r1.279 src/usr.bin/make/dir.c

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



CVS commit: src/sys

2022-05-07 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sat May  7 19:44:40 UTC 2022

Modified Files:
src/sys/kern: kern_lwp.c kern_proc.c
src/sys/sys: lwp.h

Log Message:
bump maxthreads default.

bump the default MAXLWP to 4096 from 2048, and adjust the default
limits seen to be 2048 cur / 4096 max.  remove the linkage to
maxuprc entirely.

remove cpu_maxlwp() that isn't implemented anywhere.  instead,
grow the maxlwp for larger memory systems, picking 1 lwp per 1MiB
of ram, limited to 65535 like the system limit.

remove some magic numbers.

i've been having weird firefox issues for a few months now and
it turns out i was having pthread_create() failures and since
bumping the defaults i've had none of the recent issues.


To generate a diff of this commit:
cvs rdiff -u -r1.248 -r1.249 src/sys/kern/kern_lwp.c
cvs rdiff -u -r1.266 -r1.267 src/sys/kern/kern_proc.c
cvs rdiff -u -r1.215 -r1.216 src/sys/sys/lwp.h

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



CVS commit: src/sys

2022-05-07 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sat May  7 19:44:40 UTC 2022

Modified Files:
src/sys/kern: kern_lwp.c kern_proc.c
src/sys/sys: lwp.h

Log Message:
bump maxthreads default.

bump the default MAXLWP to 4096 from 2048, and adjust the default
limits seen to be 2048 cur / 4096 max.  remove the linkage to
maxuprc entirely.

remove cpu_maxlwp() that isn't implemented anywhere.  instead,
grow the maxlwp for larger memory systems, picking 1 lwp per 1MiB
of ram, limited to 65535 like the system limit.

remove some magic numbers.

i've been having weird firefox issues for a few months now and
it turns out i was having pthread_create() failures and since
bumping the defaults i've had none of the recent issues.


To generate a diff of this commit:
cvs rdiff -u -r1.248 -r1.249 src/sys/kern/kern_lwp.c
cvs rdiff -u -r1.266 -r1.267 src/sys/kern/kern_proc.c
cvs rdiff -u -r1.215 -r1.216 src/sys/sys/lwp.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/kern_lwp.c
diff -u src/sys/kern/kern_lwp.c:1.248 src/sys/kern/kern_lwp.c:1.249
--- src/sys/kern/kern_lwp.c:1.248	Sat Apr  9 23:45:36 2022
+++ src/sys/kern/kern_lwp.c	Sat May  7 19:44:40 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_lwp.c,v 1.248 2022/04/09 23:45:36 riastradh Exp $	*/
+/*	$NetBSD: kern_lwp.c,v 1.249 2022/05/07 19:44:40 mrg Exp $	*/
 
 /*-
  * Copyright (c) 2001, 2006, 2007, 2008, 2009, 2019, 2020
@@ -217,7 +217,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_lwp.c,v 1.248 2022/04/09 23:45:36 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_lwp.c,v 1.249 2022/05/07 19:44:40 mrg Exp $");
 
 #include "opt_ddb.h"
 #include "opt_lockdebug.h"
@@ -294,6 +294,15 @@ struct lwp lwp0 __aligned(MIN_LWP_ALIGNM
 	.l_fd = ,
 };
 
+static int
+lwp_maxlwp(void)
+{
+	/* Assume 1 LWP per 1MiB. */
+	uint64_t lwps_per = ctob(physmem) / (1024 * 1024);
+
+	return MAX(MIN(MAXMAXLWP, lwps_per), MAXLWP);
+}
+
 static int sysctl_kern_maxlwp(SYSCTLFN_PROTO);
 
 /*
@@ -313,9 +322,9 @@ sysctl_kern_maxlwp(SYSCTLFN_ARGS)
 	if (error || newp == NULL)
 		return error;
 
-	if (nmaxlwp < 0 || nmaxlwp >= 65536)
+	if (nmaxlwp < 0 || nmaxlwp >= MAXMAXLWP)
 		return EINVAL;
-	if (nmaxlwp > cpu_maxlwp())
+	if (nmaxlwp > lwp_maxlwp())
 		return EINVAL;
 	maxlwp = nmaxlwp;
 
@@ -350,7 +359,7 @@ lwpinit(void)
 	lwp_cache = pool_cache_init(sizeof(lwp_t), MIN_LWP_ALIGNMENT, 0,
 	PR_PSERIALIZE, "lwppl", NULL, IPL_NONE, lwp_ctor, lwp_dtor, NULL);
 
-	maxlwp = cpu_maxlwp();
+	maxlwp = lwp_maxlwp();
 	sysctl_kern_lwp_setup();
 }
 

Index: src/sys/kern/kern_proc.c
diff -u src/sys/kern/kern_proc.c:1.266 src/sys/kern/kern_proc.c:1.267
--- src/sys/kern/kern_proc.c:1.266	Thu Apr  7 19:33:38 2022
+++ src/sys/kern/kern_proc.c	Sat May  7 19:44:40 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_proc.c,v 1.266 2022/04/07 19:33:38 andvar Exp $	*/
+/*	$NetBSD: kern_proc.c,v 1.267 2022/05/07 19:44:40 mrg Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2006, 2007, 2008, 2020 The NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_proc.c,v 1.266 2022/04/07 19:33:38 andvar Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_proc.c,v 1.267 2022/05/07 19:44:40 mrg Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_kstack.h"
@@ -539,7 +539,7 @@ proc0_init(void)
 	rlim[RLIMIT_MEMLOCK].rlim_cur = lim / 3;
 
 	rlim[RLIMIT_NTHR].rlim_max = maxlwp;
-	rlim[RLIMIT_NTHR].rlim_cur = maxlwp < maxuprc ? maxlwp : maxuprc;
+	rlim[RLIMIT_NTHR].rlim_cur = maxlwp / 2;
 
 	/* Note that default core name has zero length. */
 	limit0.pl_corename = defcorename;

Index: src/sys/sys/lwp.h
diff -u src/sys/sys/lwp.h:1.215 src/sys/sys/lwp.h:1.216
--- src/sys/sys/lwp.h:1.215	Sat Apr  9 23:45:37 2022
+++ src/sys/sys/lwp.h	Sat May  7 19:44:40 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: lwp.h,v 1.215 2022/04/09 23:45:37 riastradh Exp $	*/
+/*	$NetBSD: lwp.h,v 1.216 2022/05/07 19:44:40 mrg Exp $	*/
 
 /*
  * Copyright (c) 2001, 2006, 2007, 2008, 2009, 2010, 2019, 2020
@@ -239,10 +239,10 @@ extern struct lwplist	alllwp;		/* List o
 extern lwp_t		lwp0;		/* LWP for proc0. */
 extern int		maxlwp __read_mostly;	/* max number of lwps */
 #ifndef MAXLWP
-#define	MAXLWP		2048
+#define	MAXLWP		4096		/* default max */
 #endif
-#ifndef	__HAVE_CPU_MAXLWP
-#define	cpu_maxlwp()	MAXLWP
+#ifndef MAXMAXLWP
+#define MAXMAXLWP	65535		/* absolute max */
 #endif
 #endif
 



CVS commit: src/usr.bin/make

2022-05-07 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat May  7 17:49:47 UTC 2022

Modified Files:
src/usr.bin/make: compat.c main.c make.1 make.c make.h
src/usr.bin/make/unit-tests: Makefile depsrc-wait.exp depsrc-wait.mk
varname-dot-make-mode.exp varname-dot-make-mode.mk

Log Message:
make: allow to randomize build order of targets

In complex dependency structures, when a build fails, a probable cause
is a missing dependency declaration between some files.  In compat mode,
the build order is deterministic, in jobs mode, it is somewhat
deterministic.  To explore more edge cases, add the line ".MAKE.MODE +=
randomize-targets" somewhere in the makefile.

Fixes PR bin/45226 by riastradh.  Reviewed by christos.


To generate a diff of this commit:
cvs rdiff -u -r1.239 -r1.240 src/usr.bin/make/compat.c
cvs rdiff -u -r1.581 -r1.582 src/usr.bin/make/main.c
cvs rdiff -u -r1.308 -r1.309 src/usr.bin/make/make.1
cvs rdiff -u -r1.254 -r1.255 src/usr.bin/make/make.c
cvs rdiff -u -r1.301 -r1.302 src/usr.bin/make/make.h
cvs rdiff -u -r1.312 -r1.313 src/usr.bin/make/unit-tests/Makefile
cvs rdiff -u -r1.2 -r1.3 src/usr.bin/make/unit-tests/depsrc-wait.exp \
src/usr.bin/make/unit-tests/varname-dot-make-mode.mk
cvs rdiff -u -r1.3 -r1.4 src/usr.bin/make/unit-tests/depsrc-wait.mk
cvs rdiff -u -r1.1 -r1.2 \
src/usr.bin/make/unit-tests/varname-dot-make-mode.exp

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



CVS commit: src/usr.bin/make

2022-05-07 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat May  7 17:49:47 UTC 2022

Modified Files:
src/usr.bin/make: compat.c main.c make.1 make.c make.h
src/usr.bin/make/unit-tests: Makefile depsrc-wait.exp depsrc-wait.mk
varname-dot-make-mode.exp varname-dot-make-mode.mk

Log Message:
make: allow to randomize build order of targets

In complex dependency structures, when a build fails, a probable cause
is a missing dependency declaration between some files.  In compat mode,
the build order is deterministic, in jobs mode, it is somewhat
deterministic.  To explore more edge cases, add the line ".MAKE.MODE +=
randomize-targets" somewhere in the makefile.

Fixes PR bin/45226 by riastradh.  Reviewed by christos.


To generate a diff of this commit:
cvs rdiff -u -r1.239 -r1.240 src/usr.bin/make/compat.c
cvs rdiff -u -r1.581 -r1.582 src/usr.bin/make/main.c
cvs rdiff -u -r1.308 -r1.309 src/usr.bin/make/make.1
cvs rdiff -u -r1.254 -r1.255 src/usr.bin/make/make.c
cvs rdiff -u -r1.301 -r1.302 src/usr.bin/make/make.h
cvs rdiff -u -r1.312 -r1.313 src/usr.bin/make/unit-tests/Makefile
cvs rdiff -u -r1.2 -r1.3 src/usr.bin/make/unit-tests/depsrc-wait.exp \
src/usr.bin/make/unit-tests/varname-dot-make-mode.mk
cvs rdiff -u -r1.3 -r1.4 src/usr.bin/make/unit-tests/depsrc-wait.mk
cvs rdiff -u -r1.1 -r1.2 \
src/usr.bin/make/unit-tests/varname-dot-make-mode.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/compat.c
diff -u src/usr.bin/make/compat.c:1.239 src/usr.bin/make/compat.c:1.240
--- src/usr.bin/make/compat.c:1.239	Sat May  7 08:01:20 2022
+++ src/usr.bin/make/compat.c	Sat May  7 17:49:47 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: compat.c,v 1.239 2022/05/07 08:01:20 rillig Exp $	*/
+/*	$NetBSD: compat.c,v 1.240 2022/05/07 17:49:47 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -91,7 +91,7 @@
 #include "pathnames.h"
 
 /*	"@(#)compat.c	8.2 (Berkeley) 3/19/94"	*/
-MAKE_RCSID("$NetBSD: compat.c,v 1.239 2022/05/07 08:01:20 rillig Exp $");
+MAKE_RCSID("$NetBSD: compat.c,v 1.240 2022/05/07 17:49:47 rillig Exp $");
 
 static GNode *curTarg = NULL;
 static pid_t compatChild;
@@ -459,13 +459,65 @@ RunCommands(GNode *gn)
 }
 
 static void
+MakeInRandomOrder(GNode **gnodes, GNode **end, GNode *pgn)
+{
+	GNode **it;
+	size_t r;
+
+	for (r = (size_t)(end - gnodes); r >= 2; r--) {
+		/* Biased, but irrelevant in practice. */
+		size_t i = (size_t)random() % r;
+		GNode *t = gnodes[r - 1];
+		gnodes[r - 1] = gnodes[i];
+		gnodes[i] = t;
+	}
+
+	for (it = gnodes; it != end; it++)
+		Compat_Make(*it, pgn);
+}
+
+static void
+MakeWaitGroupsInRandomOrder(GNodeList *gnodes, GNode *pgn)
+{
+	Vector vec;
+	GNodeListNode *ln;
+	GNode **nodes;
+	size_t i, n, start;
+
+	Vector_Init(, sizeof(GNode *));
+	for (ln = gnodes->first; ln != NULL; ln = ln->next)
+		*(GNode **)Vector_Push() = ln->datum;
+	nodes = vec.items;
+	n = vec.len;
+
+	start = 0;
+	for (i = 0; i < n; i++) {
+		if (nodes[i]->type & OP_WAIT) {
+			MakeInRandomOrder(nodes + start, nodes + i, pgn);
+			Compat_Make(nodes[i], pgn);
+			start = i + 1;
+		}
+	}
+	MakeInRandomOrder(nodes + start, nodes + i, pgn);
+
+	Vector_Done();
+}
+
+static void
 MakeNodes(GNodeList *gnodes, GNode *pgn)
 {
 	GNodeListNode *ln;
 
+	if (Lst_IsEmpty(gnodes))
+		return;
+	if (opts.randomizeTargets) {
+		MakeWaitGroupsInRandomOrder(gnodes, pgn);
+		return;
+	}
+
 	for (ln = gnodes->first; ln != NULL; ln = ln->next) {
-		GNode *cohort = ln->datum;
-		Compat_Make(cohort, pgn);
+		GNode *cgn = ln->datum;
+		Compat_Make(cgn, pgn);
 	}
 }
 

Index: src/usr.bin/make/main.c
diff -u src/usr.bin/make/main.c:1.581 src/usr.bin/make/main.c:1.582
--- src/usr.bin/make/main.c:1.581	Sat May  7 08:01:20 2022
+++ src/usr.bin/make/main.c	Sat May  7 17:49:47 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.581 2022/05/07 08:01:20 rillig Exp $	*/
+/*	$NetBSD: main.c,v 1.582 2022/05/07 17:49:47 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -111,7 +111,7 @@
 #include "trace.h"
 
 /*	"@(#)main.c	8.3 (Berkeley) 3/19/94"	*/
-MAKE_RCSID("$NetBSD: main.c,v 1.581 2022/05/07 08:01:20 rillig Exp $");
+MAKE_RCSID("$NetBSD: main.c,v 1.582 2022/05/07 17:49:47 rillig Exp $");
 #if defined(MAKE_NATIVE) && !defined(lint)
 __COPYRIGHT("@(#) Copyright (c) 1988, 1989, 1990, 1993 "
 	"The Regents of the University of California.  "
@@ -799,6 +799,8 @@ MakeMode(void)
 		if (strstr(mode, "meta") != NULL)
 			meta_mode_init(mode);
 #endif
+		if (strstr(mode, "randomize-targets") != NULL)
+			opts.randomizeTargets = true;
 	}
 
 	free(mode);

Index: src/usr.bin/make/make.1
diff -u src/usr.bin/make/make.1:1.308 src/usr.bin/make/make.1:1.309
--- src/usr.bin/make/make.1:1.308	Mon Apr 18 15:06:27 2022
+++ src/usr.bin/make/make.1	Sat May  7 17:49:47 2022
@@ -1,4 +1,4 @@
-.\"	$NetBSD: make.1,v 1.308 2022/04/18 15:06:27 rillig Exp $
+.\"	

CVS commit: src/usr.bin/make

2022-05-07 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat May  7 17:25:28 UTC 2022

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

Log Message:
make: fix off-by-one error in buffer for .WAIT nodes

Strangely, GCC didn't warn about this error.  For the buffer overflow to
actually happen, there would have to be a billion .WAIT nodes.


To generate a diff of this commit:
cvs rdiff -u -r1.670 -r1.671 src/usr.bin/make/parse.c

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

Modified files:

Index: src/usr.bin/make/parse.c
diff -u src/usr.bin/make/parse.c:1.670 src/usr.bin/make/parse.c:1.671
--- src/usr.bin/make/parse.c:1.670	Mon Apr 18 16:09:05 2022
+++ src/usr.bin/make/parse.c	Sat May  7 17:25:28 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: parse.c,v 1.670 2022/04/18 16:09:05 sjg Exp $	*/
+/*	$NetBSD: parse.c,v 1.671 2022/05/07 17:25:28 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -106,7 +106,7 @@
 #include "pathnames.h"
 
 /*	"@(#)parse.c	8.3 (Berkeley) 3/19/94"	*/
-MAKE_RCSID("$NetBSD: parse.c,v 1.670 2022/04/18 16:09:05 sjg Exp $");
+MAKE_RCSID("$NetBSD: parse.c,v 1.671 2022/05/07 17:25:28 rillig Exp $");
 
 /*
  * A file being read.
@@ -699,11 +699,11 @@ static void
 ApplyDependencySourceWait(bool isSpecial)
 {
 	static unsigned wait_number = 0;
-	char wait_src[16];
+	char name[6 + 10 + 1];
 	GNode *gn;
 
-	snprintf(wait_src, sizeof wait_src, ".WAIT_%u", ++wait_number);
-	gn = Targ_NewInternalNode(wait_src);
+	snprintf(name, sizeof name, ".WAIT_%u", ++wait_number);
+	gn = Targ_NewInternalNode(name);
 	if (doing_depend)
 		RememberLocation(gn);
 	gn->type = OP_WAIT | OP_PHONY | OP_DEPENDS | OP_NOTMAIN;



CVS commit: src/usr.bin/make

2022-05-07 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat May  7 17:25:28 UTC 2022

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

Log Message:
make: fix off-by-one error in buffer for .WAIT nodes

Strangely, GCC didn't warn about this error.  For the buffer overflow to
actually happen, there would have to be a billion .WAIT nodes.


To generate a diff of this commit:
cvs rdiff -u -r1.670 -r1.671 src/usr.bin/make/parse.c

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



CVS commit: src/sys/arch/x86/x86

2022-05-07 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sat May  7 14:59:25 UTC 2022

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

Log Message:
return after calling xen_pagezero(), don't fall back to the legacy
pmap_zero_page() method.
This should only affect performances.


To generate a diff of this commit:
cvs rdiff -u -r1.413 -r1.414 src/sys/arch/x86/x86/pmap.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/x86/x86

2022-05-07 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sat May  7 14:59:25 UTC 2022

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

Log Message:
return after calling xen_pagezero(), don't fall back to the legacy
pmap_zero_page() method.
This should only affect performances.


To generate a diff of this commit:
cvs rdiff -u -r1.413 -r1.414 src/sys/arch/x86/x86/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/x86/x86/pmap.c
diff -u src/sys/arch/x86/x86/pmap.c:1.413 src/sys/arch/x86/x86/pmap.c:1.414
--- src/sys/arch/x86/x86/pmap.c:1.413	Sun Jan  2 20:28:53 2022
+++ src/sys/arch/x86/x86/pmap.c	Sat May  7 14:59:25 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.413 2022/01/02 20:28:53 andvar Exp $	*/
+/*	$NetBSD: pmap.c,v 1.414 2022/05/07 14:59:25 bouyer Exp $	*/
 
 /*
  * Copyright (c) 2008, 2010, 2016, 2017, 2019, 2020 The NetBSD Foundation, Inc.
@@ -130,7 +130,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.413 2022/01/02 20:28:53 andvar Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.414 2022/05/07 14:59:25 bouyer Exp $");
 
 #include "opt_user_ldt.h"
 #include "opt_lockdebug.h"
@@ -3813,8 +3813,10 @@ pmap_zero_page(paddr_t pa)
 	memset(PAGE_ALIGNED(PMAP_DIRECT_MAP(pa)), 0, PAGE_SIZE);
 #else
 #if defined(XENPV)
-	if (XEN_VERSION_SUPPORTED(3, 4))
+	if (XEN_VERSION_SUPPORTED(3, 4)) {
 		xen_pagezero(pa);
+		return;
+	}
 #endif
 	struct cpu_info *ci;
 	pt_entry_t *zpte;



CVS commit: src/sys/dev/ic

2022-05-07 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sat May  7 14:25:12 UTC 2022

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

Log Message:
Clear mailbox to not to pass garbage data.


To generate a diff of this commit:
cvs rdiff -u -r1.71 -r1.72 src/sys/dev/ic/mfi.c

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

Modified files:

Index: src/sys/dev/ic/mfi.c
diff -u src/sys/dev/ic/mfi.c:1.71 src/sys/dev/ic/mfi.c:1.72
--- src/sys/dev/ic/mfi.c:1.71	Sat May  7 14:14:34 2022
+++ src/sys/dev/ic/mfi.c	Sat May  7 14:25:12 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: mfi.c,v 1.71 2022/05/07 14:14:34 msaitoh Exp $ */
+/* $NetBSD: mfi.c,v 1.72 2022/05/07 14:25:12 msaitoh Exp $ */
 /* $OpenBSD: mfi.c,v 1.66 2006/11/28 23:59:45 dlg Exp $ */
 
 /*
@@ -73,7 +73,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: mfi.c,v 1.71 2022/05/07 14:14:34 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mfi.c,v 1.72 2022/05/07 14:25:12 msaitoh Exp $");
 
 #include "bio.h"
 
@@ -970,8 +970,10 @@ mfi_shutdown(device_t dev, int how)
 	struct mfi_softc	*sc = device_private(dev);
 	uint8_t			mbox[MFI_MBOX_SIZE];
 	int s = splbio();
+
 	DNPRINTF(MFI_D_MISC, "%s: mfi_shutdown\n", DEVNAME(sc));
 	if (sc->sc_running) {
+		memset(mbox, 0, sizeof(mbox));
 		mbox[0] = MR_FLUSH_CTRL_CACHE | MR_FLUSH_DISK_CACHE;
 		if (mfi_mgmt_internal(sc, MR_DCMD_CTRL_CACHE_FLUSH,
 		MFI_DATA_NONE, 0, NULL, mbox, true)) {
@@ -1683,6 +1685,7 @@ mfi_scsipi_request(struct scsipi_channel
 
 	case SCSI_SYNCHRONIZE_CACHE_10:
 	case SCSI_SYNCHRONIZE_CACHE_16:
+		memset(mbox, 0, sizeof(mbox));
 		mbox[0] = MR_FLUSH_CTRL_CACHE | MR_FLUSH_DISK_CACHE;
 		if (mfi_mgmt(ccb, xs,
 		MR_DCMD_CTRL_CACHE_FLUSH, MFI_DATA_NONE, 0, NULL, mbox)) {
@@ -2045,6 +2048,7 @@ mfi_ioctl_vol(struct mfi_softc *sc, stru
 		goto done;
 
 	i = bv->bv_volid;
+	memset(mbox, 0, sizeof(mbox));
 	mbox[0] = sc->sc_ld_list.mll_list[i].mll_ld.mld_target;
 	DNPRINTF(MFI_D_IOCTL, "%s: mfi_ioctl_vol target %#x\n",
 	DEVNAME(sc), mbox[0]);
@@ -2220,6 +2224,7 @@ mfi_ioctl_disk(struct mfi_softc *sc, str
 	}
 
 	/* get the remaining fields */
+	memset(mbox, 0, sizeof(mbox));
 	*((uint16_t *)) = ar[arr].pd[disk].mar_pd.mfp_id;
 	memset(pd, 0, sizeof(*pd));
 	if (mfi_mgmt_internal(sc, MR_DCMD_PD_GET_INFO, MFI_DATA_IN,



CVS commit: src/sys/dev/ic

2022-05-07 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sat May  7 14:25:12 UTC 2022

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

Log Message:
Clear mailbox to not to pass garbage data.


To generate a diff of this commit:
cvs rdiff -u -r1.71 -r1.72 src/sys/dev/ic/mfi.c

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



CVS commit: src/sys/dev/pci

2022-05-07 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sat May  7 14:18:25 UTC 2022

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

Log Message:
Use mlp_bgi for MFI_LD_PROG_BGI. Same as OpenBSD.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/dev/pci/mfii.c

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

Modified files:

Index: src/sys/dev/pci/mfii.c
diff -u src/sys/dev/pci/mfii.c:1.10 src/sys/dev/pci/mfii.c:1.11
--- src/sys/dev/pci/mfii.c:1.10	Thu May  5 09:14:17 2022
+++ src/sys/dev/pci/mfii.c	Sat May  7 14:18:25 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: mfii.c,v 1.10 2022/05/05 09:14:17 msaitoh Exp $ */
+/* $NetBSD: mfii.c,v 1.11 2022/05/07 14:18:25 msaitoh Exp $ */
 /* $OpenBSD: mfii.c,v 1.58 2018/08/14 05:22:21 jmatthew Exp $ */
 
 /*
@@ -19,7 +19,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: mfii.c,v 1.10 2022/05/05 09:14:17 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mfii.c,v 1.11 2022/05/07 14:18:25 msaitoh Exp $");
 
 #include "bio.h"
 
@@ -2934,7 +2934,6 @@ mfii_ioctl_vol(struct mfii_softc *sc, st
 	/* additional status can modify MFI status */
 	switch (sc->sc_ld_details[i].mld_progress.mlp_in_prog) {
 	case MFI_LD_PROG_CC:
-	case MFI_LD_PROG_BGI:
 		bv->bv_status = BIOC_SVSCRUB;
 		per = (int)sc->sc_ld_details[i].mld_progress.mlp_cc.mp_progress;
 		bv->bv_percent = (per * 100) / 0x;
@@ -2942,6 +2941,14 @@ mfii_ioctl_vol(struct mfii_softc *sc, st
 		sc->sc_ld_details[i].mld_progress.mlp_cc.mp_elapsed_seconds;
 		break;
 
+	case MFI_LD_PROG_BGI:
+		bv->bv_status = BIOC_SVSCRUB;
+		per = (int)sc->sc_ld_details[i].mld_progress.mlp_bgi.mp_progress;
+		bv->bv_percent = (per * 100) / 0x;
+		bv->bv_seconds =
+		sc->sc_ld_details[i].mld_progress.mlp_bgi.mp_elapsed_seconds;
+		break;
+
 	case MFI_LD_PROG_FGI:
 	case MFI_LD_PROG_RECONSTRUCT:
 		/* nothing yet */



CVS commit: src/sys/dev/pci

2022-05-07 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sat May  7 14:18:25 UTC 2022

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

Log Message:
Use mlp_bgi for MFI_LD_PROG_BGI. Same as OpenBSD.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/dev/pci/mfii.c

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



CVS commit: src/sys/dev/ic

2022-05-07 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sat May  7 14:14:34 UTC 2022

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

Log Message:
Use mlp_bgi for MFI_LD_PROG_BGI. Same as OpenBSD.


To generate a diff of this commit:
cvs rdiff -u -r1.70 -r1.71 src/sys/dev/ic/mfi.c

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

Modified files:

Index: src/sys/dev/ic/mfi.c
diff -u src/sys/dev/ic/mfi.c:1.70 src/sys/dev/ic/mfi.c:1.71
--- src/sys/dev/ic/mfi.c:1.70	Sat May  7 04:40:02 2022
+++ src/sys/dev/ic/mfi.c	Sat May  7 14:14:34 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: mfi.c,v 1.70 2022/05/07 04:40:02 msaitoh Exp $ */
+/* $NetBSD: mfi.c,v 1.71 2022/05/07 14:14:34 msaitoh Exp $ */
 /* $OpenBSD: mfi.c,v 1.66 2006/11/28 23:59:45 dlg Exp $ */
 
 /*
@@ -73,7 +73,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: mfi.c,v 1.70 2022/05/07 04:40:02 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mfi.c,v 1.71 2022/05/07 14:14:34 msaitoh Exp $");
 
 #include "bio.h"
 
@@ -2085,7 +2085,6 @@ mfi_ioctl_vol(struct mfi_softc *sc, stru
 	/* additional status can modify MFI status */
 	switch (sc->sc_ld_details.mld_progress.mlp_in_prog) {
 	case MFI_LD_PROG_CC:
-	case MFI_LD_PROG_BGI:
 		bv->bv_status = BIOC_SVSCRUB;
 		per = (int)sc->sc_ld_details.mld_progress.mlp_cc.mp_progress;
 		bv->bv_percent = (per * 100) / 0x;
@@ -2093,6 +2092,14 @@ mfi_ioctl_vol(struct mfi_softc *sc, stru
 		sc->sc_ld_details.mld_progress.mlp_cc.mp_elapsed_seconds;
 		break;
 
+	case MFI_LD_PROG_BGI:
+		bv->bv_status = BIOC_SVSCRUB;
+		per = (int)sc->sc_ld_details.mld_progress.mlp_bgi.mp_progress;
+		bv->bv_percent = (per * 100) / 0x;
+		bv->bv_seconds =
+		sc->sc_ld_details.mld_progress.mlp_bgi.mp_elapsed_seconds;
+		break;
+
 	case MFI_LD_PROG_FGI:
 	case MFI_LD_PROG_RECONSTRUCT:
 		/* nothing yet */



CVS commit: src/sys/dev/ic

2022-05-07 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sat May  7 14:14:34 UTC 2022

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

Log Message:
Use mlp_bgi for MFI_LD_PROG_BGI. Same as OpenBSD.


To generate a diff of this commit:
cvs rdiff -u -r1.70 -r1.71 src/sys/dev/ic/mfi.c

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



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

2022-05-07 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat May  7 13:14:16 UTC 2022

Modified Files:
src/tests/lib/libc/gen: t_siginfo.c

Log Message:
Skip sigfpe_int also for sh3; integer division by zero is not trapped.


To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.47 src/tests/lib/libc/gen/t_siginfo.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/gen/t_siginfo.c
diff -u src/tests/lib/libc/gen/t_siginfo.c:1.46 src/tests/lib/libc/gen/t_siginfo.c:1.47
--- src/tests/lib/libc/gen/t_siginfo.c:1.46	Fri Dec 10 20:36:05 2021
+++ src/tests/lib/libc/gen/t_siginfo.c	Sat May  7 13:14:16 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: t_siginfo.c,v 1.46 2021/12/10 20:36:05 andvar Exp $ */
+/* $NetBSD: t_siginfo.c,v 1.47 2022/05/07 13:14:16 rin Exp $ */
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -367,7 +367,7 @@ ATF_TC_BODY(sigfpe_int, tc)
 	struct sigaction sa;
 	long l = strtol("0", NULL, 10);
 
-#if defined(__powerpc__) || defined(__aarch64__)
+#if defined(__aarch64__) || defined(__powerpc__) || defined(__sh3__)
 	atf_tc_skip("Integer division by zero doesn't trap");
 #endif
 	if (sigsetjmp(sigfpe_int_env, 0) == 0) {



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

2022-05-07 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat May  7 13:14:16 UTC 2022

Modified Files:
src/tests/lib/libc/gen: t_siginfo.c

Log Message:
Skip sigfpe_int also for sh3; integer division by zero is not trapped.


To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.47 src/tests/lib/libc/gen/t_siginfo.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/unit-tests

2022-05-07 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat May  7 12:40:40 UTC 2022

Modified Files:
src/usr.bin/make/unit-tests: deptgt-posix.mk

Log Message:
tests/make: clean up comments in test for .POSIX


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/usr.bin/make/unit-tests/deptgt-posix.mk

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



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

2022-05-07 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat May  7 12:40:40 UTC 2022

Modified Files:
src/usr.bin/make/unit-tests: deptgt-posix.mk

Log Message:
tests/make: clean up comments in test for .POSIX


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/usr.bin/make/unit-tests/deptgt-posix.mk

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

Modified files:

Index: src/usr.bin/make/unit-tests/deptgt-posix.mk
diff -u src/usr.bin/make/unit-tests/deptgt-posix.mk:1.2 src/usr.bin/make/unit-tests/deptgt-posix.mk:1.3
--- src/usr.bin/make/unit-tests/deptgt-posix.mk:1.2	Mon Apr 18 15:59:39 2022
+++ src/usr.bin/make/unit-tests/deptgt-posix.mk	Sat May  7 12:40:40 2022
@@ -1,16 +1,19 @@
-# $NetBSD: deptgt-posix.mk,v 1.2 2022/04/18 15:59:39 sjg Exp $
+# $NetBSD: deptgt-posix.mk,v 1.3 2022/05/07 12:40:40 rillig Exp $
 #
 # Tests for the special target '.POSIX', which enables POSIX mode.
 #
-# As of 2022-04-18, this only means that the variable '%POSIX' is defined and
-# that the variables and rules specified by POSIX replace the default ones.
-# This is done by loading , if available.  That file is not included
-# in NetBSD, but only in the bmake distribution.  As of 2022-04-18, POSIX
-# support is not complete.
+# As of 2022-04-18, when parsing the dependency line '.POSIX', the variable
+# '%POSIX' is defined and  is included, if it exists.  Other than
+# that, POSIX support is still incomplete, the exact set of supported features
+# needs to be cross-checked with the POSIX specification.
 #
-# Implementation node: this test needs to be isolated from the usual test
-# to prevent unit-tests/posix.mk from interfering with the posix.mk from the
-# system directory that this test uses.
+# At the point of '.POSIX:',  has been loaded already, unless the
+# option '-r' was given.  This means that an implementation of  must
+# work both with and without the system rules from  being in effect.
+#
+# Implementation note: this test needs to run isolated from the usual tests
+# directory to prevent unit-tests/posix.mk from interfering with the posix.mk
+# from the system directory that this test uses.
 #
 # See also:
 #	https://pubs.opengroup.org/onlinepubs/9699919799/utilities/make.html
@@ -99,7 +102,8 @@ in-first-line: .PHONY set-up-sysdir chec
 	'.POSIX:'
 
 # The only allowed lines before switching to POSIX mode are comment lines.
-# POSIX defines that empty and blank lines are called comment lines as well.
+# POSIX defines comment lines as "blank lines, empty lines, and lines with
+#  ('#') as the first character".
 all: after-comment-lines
 after-comment-lines: .PHONY set-up-sysdir check-is-posix run
 	printf '%s\n' > ${MAIN_MK} \



CVS commit: src/usr.bin/make

2022-05-07 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat May  7 10:05:49 UTC 2022

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

Log Message:
make: inline MakeBuildParent

The word "parent" didn't match exactly, since this part is about the
predecessor/successor relationship due to the .ORDER attribute.

No functional change.


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

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

Modified files:

Index: src/usr.bin/make/make.c
diff -u src/usr.bin/make/make.c:1.253 src/usr.bin/make/make.c:1.254
--- src/usr.bin/make/make.c:1.253	Sat May  7 09:44:50 2022
+++ src/usr.bin/make/make.c	Sat May  7 10:05:49 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: make.c,v 1.253 2022/05/07 09:44:50 rillig Exp $	*/
+/*	$NetBSD: make.c,v 1.254 2022/05/07 10:05:49 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -104,7 +104,7 @@
 #include "job.h"
 
 /*	"@(#)make.c	8.1 (Berkeley) 6/6/93"	*/
-MAKE_RCSID("$NetBSD: make.c,v 1.253 2022/05/07 09:44:50 rillig Exp $");
+MAKE_RCSID("$NetBSD: make.c,v 1.254 2022/05/07 10:05:49 rillig Exp $");
 
 /* Sequence # to detect recursion. */
 static unsigned int checked_seqno = 1;
@@ -633,7 +633,7 @@ IsWaitingForOrder(GNode *gn)
 	return false;
 }
 
-static void MakeBuildParent(GNode *, GNodeListNode *);
+static bool MakeBuildChild(GNode *, GNodeListNode *);
 
 static void
 ScheduleOrderSuccessors(GNode *gn)
@@ -641,8 +641,13 @@ ScheduleOrderSuccessors(GNode *gn)
 	GNodeListNode *toBeMadeNext = toBeMade.first;
 	GNodeListNode *ln;
 
-	for (ln = gn->order_succ.first; ln != NULL; ln = ln->next)
-		MakeBuildParent(ln->datum, toBeMadeNext);
+	for (ln = gn->order_succ.first; ln != NULL; ln = ln->next) {
+		GNode *succ = ln->datum;
+
+		if (succ->made == DEFERRED &&
+		!MakeBuildChild(succ, toBeMadeNext))
+			succ->flags.doneOrder = true;
+	}
 }
 
 /*
@@ -972,19 +977,6 @@ MakeBuildChild(GNode *cn, GNodeListNode 
 	return cn->type & OP_WAIT && cn->unmade > 0;
 }
 
-/* When a .ORDER LHS node completes, we do this on each RHS. */
-static void
-MakeBuildParent(GNode *pn, GNodeListNode *toBeMadeNext)
-{
-	if (pn->made != DEFERRED)
-		return;
-
-	if (!MakeBuildChild(pn, toBeMadeNext)) {
-		/* When this node is built, reschedule its parents. */
-		pn->flags.doneOrder = true;
-	}
-}
-
 static void
 MakeChildren(GNode *gn)
 {



CVS commit: src/usr.bin/make

2022-05-07 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat May  7 10:05:49 UTC 2022

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

Log Message:
make: inline MakeBuildParent

The word "parent" didn't match exactly, since this part is about the
predecessor/successor relationship due to the .ORDER attribute.

No functional change.


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

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



CVS commit: src/usr.bin/make

2022-05-07 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat May  7 09:44:50 UTC 2022

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

Log Message:
make: inline make_abort, improve error details

This function was only called a single time, making the source code line
number redundant.  Instead, print the name of the state instead of its
ordinal value.


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

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

Modified files:

Index: src/usr.bin/make/make.c
diff -u src/usr.bin/make/make.c:1.252 src/usr.bin/make/make.c:1.253
--- src/usr.bin/make/make.c:1.252	Sun Jan  9 15:48:30 2022
+++ src/usr.bin/make/make.c	Sat May  7 09:44:50 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: make.c,v 1.252 2022/01/09 15:48:30 rillig Exp $	*/
+/*	$NetBSD: make.c,v 1.253 2022/05/07 09:44:50 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -104,7 +104,7 @@
 #include "job.h"
 
 /*	"@(#)make.c	8.1 (Berkeley) 6/6/93"	*/
-MAKE_RCSID("$NetBSD: make.c,v 1.252 2022/01/09 15:48:30 rillig Exp $");
+MAKE_RCSID("$NetBSD: make.c,v 1.253 2022/05/07 09:44:50 rillig Exp $");
 
 /* Sequence # to detect recursion. */
 static unsigned int checked_seqno = 1;
@@ -127,17 +127,6 @@ debug_printf(const char *fmt, ...)
 	va_end(ap);
 }
 
-MAKE_ATTR_DEAD static void
-make_abort(GNode *gn, int lineno)
-{
-
-	debug_printf("make_abort from line %d\n", lineno);
-	Targ_PrintNode(gn, 2);
-	Targ_PrintNodes(, 2);
-	Targ_PrintGraph(3);
-	abort();
-}
-
 static const char *
 GNodeType_ToString(GNodeType type, void **freeIt)
 {
@@ -1033,13 +1022,12 @@ MakeStartJobs(void)
 		DEBUG2(MAKE, "Examining %s%s...\n", gn->name, gn->cohort_num);
 
 		if (gn->made != REQUESTED) {
-			/*
-			 * XXX: Replace %d with string representation;
-			 * see made_name.
-			 */
-			DEBUG1(MAKE, "state %d\n", gn->made);
-
-			make_abort(gn, __LINE__);
+			debug_printf("internal error: made = %s\n",
+			GNodeMade_Name(gn->made));
+			Targ_PrintNode(gn, 2);
+			Targ_PrintNodes(, 2);
+			Targ_PrintGraph(3);
+			abort();
 		}
 
 		if (gn->checked_seqno == checked_seqno) {



CVS commit: src/usr.bin/make

2022-05-07 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat May  7 09:44:50 UTC 2022

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

Log Message:
make: inline make_abort, improve error details

This function was only called a single time, making the source code line
number redundant.  Instead, print the name of the state instead of its
ordinal value.


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

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



CVS commit: src/sys/arch/powerpc/include

2022-05-07 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat May  7 09:02:19 UTC 2022

Modified Files:
src/sys/arch/powerpc/include: spr.h

Log Message:
Remove SPR_CCR0 from ; we already have it in
, together with other 4xx-specific SPRs.

Thanks uwe@ for pointing out.


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 src/sys/arch/powerpc/include/spr.h

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



CVS commit: src/sys/arch/powerpc/include

2022-05-07 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat May  7 09:02:19 UTC 2022

Modified Files:
src/sys/arch/powerpc/include: spr.h

Log Message:
Remove SPR_CCR0 from ; we already have it in
, together with other 4xx-specific SPRs.

Thanks uwe@ for pointing out.


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 src/sys/arch/powerpc/include/spr.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/include/spr.h
diff -u src/sys/arch/powerpc/include/spr.h:1.55 src/sys/arch/powerpc/include/spr.h:1.56
--- src/sys/arch/powerpc/include/spr.h:1.55	Sat May  7 04:12:54 2022
+++ src/sys/arch/powerpc/include/spr.h	Sat May  7 09:02:19 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: spr.h,v 1.55 2022/05/07 04:12:54 rin Exp $	*/
+/*	$NetBSD: spr.h,v 1.56 2022/05/07 09:02:19 rin Exp $	*/
 
 /*
  * Copyright (c) 2001, The NetBSD Foundation, Inc.
@@ -144,7 +144,6 @@ mfspr(int reg)
 #define	SPR_TBL			0x11c	/* E468 Time Base Lower */
 #define	SPR_TBU			0x11d	/* E468 Time Base Upper */
 #define	SPR_PVR			0x11f	/* E468 Processor Version Register */
-#define	SPR_CCR0		0x3b3	/* .4.. Core Configuration Register */
 
 /* Time Base Register declarations */
 #define	TBR_TBL			0x10c	/* E468 Time Base Lower */



Re: CVS commit: src/sys/arch

2022-05-07 Thread Rin Okuyama

Oops, I missed it. I will fix soon.

Thanks again,
rin

On 2022/05/07 17:24, Valery Ushakov wrote:

On Sat, May 07, 2022 at 04:12:55 +, Rin Okuyama wrote:


Module Name:src
Committed By:   rin
Date:   Sat May  7 04:12:55 UTC 2022

Modified Files:
src/sys/arch/evbppc/dht: locore.S
src/sys/arch/powerpc/include: spr.h

Log Message:
Instead of hard-coding SPR# for CCR0, define SPR_CCR0 in
 and use it.

Idea from uwe@, thanks!
(and sorry for delayed response!)


Note that we already have it defined (along with bunch of others) in
sys/arch/powerpc/include/ibm4xx/spr.h:74


-uwe



CVS commit: src/usr.sbin/makefs

2022-05-07 Thread Reinoud Zandijk
Module Name:src
Committed By:   reinoud
Date:   Sat May  7 08:54:02 UTC 2022

Modified Files:
src/usr.sbin/makefs: makefs.h udf.c

Log Message:
When creating disc images, keep the proposed size a multiple of the blockingnr
for good measure; this prevents possible burning/copying issues on packet
media.


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/usr.sbin/makefs/makefs.h
cvs rdiff -u -r1.29 -r1.30 src/usr.sbin/makefs/udf.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.h
diff -u src/usr.sbin/makefs/makefs.h:1.38 src/usr.sbin/makefs/makefs.h:1.39
--- src/usr.sbin/makefs/makefs.h:1.38	Sat Apr  9 10:05:35 2022
+++ src/usr.sbin/makefs/makefs.h	Sat May  7 08:54:02 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: makefs.h,v 1.38 2022/04/09 10:05:35 riastradh Exp $	*/
+/*	$nEtBSD: makefs.h,v 1.38 2022/04/09 10:05:35 riastradh Exp $	*/
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -44,7 +44,7 @@
 #define HAVE_STRUCT_STAT_ST_FLAGS 1
 #define HAVE_STRUCT_STAT_ST_GEN 1
 #define HAVE_STRUCT_STAT_ST_MTIMENSEC 1
-#define HAVE_STRUCT_STATVFS_F_IOSIZE 1
+//#define HAVE_STRUCT_STATVFS_F_IOSIZE 1
 #define HAVE_STRUCT_STAT_BIRTHTIME 1
 #define HAVE_FSTATVFS 1
 #endif

Index: src/usr.sbin/makefs/udf.c
diff -u src/usr.sbin/makefs/udf.c:1.29 src/usr.sbin/makefs/udf.c:1.30
--- src/usr.sbin/makefs/udf.c:1.29	Tue Apr 26 15:18:08 2022
+++ src/usr.sbin/makefs/udf.c	Sat May  7 08:54:02 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: udf.c,v 1.29 2022/04/26 15:18:08 reinoud Exp $ */
+/* $NetBSD: udf.c,v 1.30 2022/05/07 08:54:02 reinoud Exp $ */
 
 /*
  * Copyright (c) 2006, 2008, 2013, 2021, 2022 Reinoud Zandijk
@@ -30,7 +30,7 @@
 #endif
 
 #include 
-__RCSID("$NetBSD: udf.c,v 1.29 2022/04/26 15:18:08 reinoud Exp $");
+__RCSID("$NetBSD: udf.c,v 1.30 2022/05/07 08:54:02 reinoud Exp $");
 
 #include 
 #include 
@@ -1130,7 +1130,24 @@ udf_enumerate_and_estimate(const char *d
 		stats->ndatablocks += (n - nblk);
 		nblk += n - nblk;
 	}
+
+	/* keep proposed size a multiple of blockingnr for image creation */
+	if (S_ISREG(dev_fd_stat.st_mode)) {
+		struct mmc_trackinfo ti;
+		int blockingnr;
+		int error;
+
+		/* adjust proposed size to be a multiple of the blockingnr */
+		udf_update_discinfo();
+		ti.tracknr = mmc_discinfo.first_track_last_session;
+		error = udf_update_trackinfo();
+		assert(!error);
+		blockingnr = udf_get_blockingnr();
+		nblk = UDF_ROUNDUP(nblk, blockingnr);
+	}
+
 	proposed_size = (off_t) nblk * fsopts->sectorsize;
+
 	/* sanity size */
 	if (proposed_size < 512*1024)
 		proposed_size = 512*1024;



CVS commit: src/usr.sbin/makefs

2022-05-07 Thread Reinoud Zandijk
Module Name:src
Committed By:   reinoud
Date:   Sat May  7 08:54:02 UTC 2022

Modified Files:
src/usr.sbin/makefs: makefs.h udf.c

Log Message:
When creating disc images, keep the proposed size a multiple of the blockingnr
for good measure; this prevents possible burning/copying issues on packet
media.


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/usr.sbin/makefs/makefs.h
cvs rdiff -u -r1.29 -r1.30 src/usr.sbin/makefs/udf.c

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



CVS commit: src/sbin/newfs_udf

2022-05-07 Thread Reinoud Zandijk
Module Name:src
Committed By:   reinoud
Date:   Sat May  7 08:51:32 UTC 2022

Modified Files:
src/sbin/newfs_udf: udf_core.c

Log Message:
Data is written out in fixed sized packets; discs are normally a multiple of
the packet size but they don't have to be so never write past the last sector.


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

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

Modified files:

Index: src/sbin/newfs_udf/udf_core.c
diff -u src/sbin/newfs_udf/udf_core.c:1.9 src/sbin/newfs_udf/udf_core.c:1.10
--- src/sbin/newfs_udf/udf_core.c:1.9	Tue Apr 26 15:11:42 2022
+++ src/sbin/newfs_udf/udf_core.c	Sat May  7 08:51:32 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: udf_core.c,v 1.9 2022/04/26 15:11:42 reinoud Exp $ */
+/* $NetBSD: udf_core.c,v 1.10 2022/05/07 08:51:32 reinoud Exp $ */
 
 /*
  * Copyright (c) 2006, 2008, 2021, 2022 Reinoud Zandijk
@@ -30,7 +30,7 @@
 #endif
 
 #include 
-__RCSID("$NetBSD: udf_core.c,v 1.9 2022/04/26 15:11:42 reinoud Exp $");
+__RCSID("$NetBSD: udf_core.c,v 1.10 2022/05/07 08:51:32 reinoud Exp $");
 
 #include 
 #include 
@@ -3782,6 +3782,7 @@ udf_writeout_writequeue(bool complete)
 	int		 blockingnr = layout.blockingnr;
 	int		 linesize, offset, ret;
 	uint8_t		*linebuf;
+	int32_t		 wsects;
 	uint64_t	 present, all_present = -1;
 	uint64_t	 rpos, wpos;
 	static int	 t = 0;
@@ -3832,8 +3833,17 @@ udf_writeout_writequeue(bool complete)
 		if (complete || (packet->present == all_present)) {
 			printf("%c", "\\|/-"[t++ % 4]); fflush(stdout);fflush(stderr);
 //printf("write %lu + %d\n", packet->start_sectornr, linesize / context.sector_size);
+
+			/* don't write past last possible lba */
+			wsects = (mmc_discinfo.last_possible_lba + 1 - packet->start_sectornr);
+			assert(wsects >= 0);
+			wsects = MIN(wsects, blockingnr);
+	
 			wpos = (uint64_t) packet->start_sectornr * context.sector_size;
-			ret = pwrite(dev_fd, packet->packet_data, linesize, wpos);
+			ret = pwrite(dev_fd,
+packet->packet_data,
+wsects * context.sector_size,
+wpos);
 			printf("\b");
 			if (ret == -1)
 warn("error writing packet, "



CVS commit: src/sbin/newfs_udf

2022-05-07 Thread Reinoud Zandijk
Module Name:src
Committed By:   reinoud
Date:   Sat May  7 08:51:32 UTC 2022

Modified Files:
src/sbin/newfs_udf: udf_core.c

Log Message:
Data is written out in fixed sized packets; discs are normally a multiple of
the packet size but they don't have to be so never write past the last sector.


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

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



Re: CVS commit: src/sys/arch

2022-05-07 Thread Valery Ushakov
On Sat, May 07, 2022 at 04:12:55 +, Rin Okuyama wrote:

> Module Name:  src
> Committed By: rin
> Date: Sat May  7 04:12:55 UTC 2022
> 
> Modified Files:
>   src/sys/arch/evbppc/dht: locore.S
>   src/sys/arch/powerpc/include: spr.h
> 
> Log Message:
> Instead of hard-coding SPR# for CCR0, define SPR_CCR0 in
>  and use it.
> 
> Idea from uwe@, thanks!
> (and sorry for delayed response!)

Note that we already have it defined (along with bunch of others) in 
sys/arch/powerpc/include/ibm4xx/spr.h:74


-uwe


CVS commit: src/sys

2022-05-07 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat May  7 08:20:04 UTC 2022

Modified Files:
src/sys/arch/arm/apple: files.apple
src/sys/arch/evbarm/conf: GENERIC64
src/sys/dev/ic: nvme.c nvmevar.h
Added Files:
src/sys/arch/arm/apple: apple_nvme.c

Log Message:
Add support for Apple silicon NVME.  Ported from OpenBSD.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/arch/arm/apple/apple_nvme.c
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/arm/apple/files.apple
cvs rdiff -u -r1.198 -r1.199 src/sys/arch/evbarm/conf/GENERIC64
cvs rdiff -u -r1.59 -r1.60 src/sys/dev/ic/nvme.c
cvs rdiff -u -r1.23 -r1.24 src/sys/dev/ic/nvmevar.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/apple/files.apple
diff -u src/sys/arch/arm/apple/files.apple:1.5 src/sys/arch/arm/apple/files.apple:1.6
--- src/sys/arch/arm/apple/files.apple:1.5	Wed Apr 27 08:06:20 2022
+++ src/sys/arch/arm/apple/files.apple	Sat May  7 08:20:04 2022
@@ -1,4 +1,4 @@
-#	$NetBSD: files.apple,v 1.5 2022/04/27 08:06:20 skrll Exp $
+#	$NetBSD: files.apple,v 1.6 2022/05/07 08:20:04 skrll Exp $
 #
 # Configuration info for Apple Silicon SoCs
 #
@@ -19,6 +19,11 @@ device	applembox
 attach	applembox at fdt with apple_mbox
 file	arch/arm/apple/apple_mbox.c		apple_mbox
 
+# NVME
+device	applenvme: nvme
+attach	nvme at fdt with apple_nvme
+file	arch/arm/apple/apple_nvme.c		apple_nvme
+
 # PCIe controller
 device	applepcie: pcibus, pcihost_fdt
 attach	applepcie at fdt with apple_pcie

Index: src/sys/arch/evbarm/conf/GENERIC64
diff -u src/sys/arch/evbarm/conf/GENERIC64:1.198 src/sys/arch/evbarm/conf/GENERIC64:1.199
--- src/sys/arch/evbarm/conf/GENERIC64:1.198	Wed Apr 27 08:06:20 2022
+++ src/sys/arch/evbarm/conf/GENERIC64	Sat May  7 08:20:04 2022
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: GENERIC64,v 1.198 2022/04/27 08:06:20 skrll Exp $
+#	$NetBSD: GENERIC64,v 1.199 2022/05/07 08:20:04 skrll Exp $
 #
 #	GENERIC ARM (aarch64) kernel
 #
@@ -413,6 +413,7 @@ wd*		at atabus? drive ?
 cd*		at atapibus? drive ?
 
 # NVMe
+nvme*		at fdt?			# Apple M1
 nvme*		at pci? dev ? function ?
 ld*		at nvme? nsid ?
 

Index: src/sys/dev/ic/nvme.c
diff -u src/sys/dev/ic/nvme.c:1.59 src/sys/dev/ic/nvme.c:1.60
--- src/sys/dev/ic/nvme.c:1.59	Tue Nov 16 06:58:33 2021
+++ src/sys/dev/ic/nvme.c	Sat May  7 08:20:04 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: nvme.c,v 1.59 2021/11/16 06:58:33 skrll Exp $	*/
+/*	$NetBSD: nvme.c,v 1.60 2022/05/07 08:20:04 skrll Exp $	*/
 /*	$OpenBSD: nvme.c,v 1.49 2016/04/18 05:59:50 dlg Exp $ */
 
 /*
@@ -18,7 +18,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: nvme.c,v 1.59 2021/11/16 06:58:33 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nvme.c,v 1.60 2022/05/07 08:20:04 skrll Exp $");
 
 #include 
 #include 
@@ -55,6 +55,27 @@ static int	nvme_enable(struct nvme_softc
 static int	nvme_disable(struct nvme_softc *);
 static int	nvme_shutdown(struct nvme_softc *);
 
+uint32_t	nvme_op_sq_enter(struct nvme_softc *,
+		struct nvme_queue *, struct nvme_ccb *);
+void		nvme_op_sq_leave(struct nvme_softc *,
+		struct nvme_queue *, struct nvme_ccb *);
+uint32_t	nvme_op_sq_enter_locked(struct nvme_softc *,
+		struct nvme_queue *, struct nvme_ccb *);
+void		nvme_op_sq_leave_locked(struct nvme_softc *,
+		struct nvme_queue *, struct nvme_ccb *);
+
+void		nvme_op_cq_done(struct nvme_softc *,
+		struct nvme_queue *, struct nvme_ccb *);
+
+static const struct nvme_ops nvme_ops = {
+	.op_sq_enter		= nvme_op_sq_enter,
+	.op_sq_leave		= nvme_op_sq_leave,
+	.op_sq_enter_locked	= nvme_op_sq_enter_locked,
+	.op_sq_leave_locked	= nvme_op_sq_leave_locked,
+
+	.op_cq_done		= nvme_op_cq_done,
+};
+
 #ifdef NVME_DEBUG
 static void	nvme_dumpregs(struct nvme_softc *);
 #endif
@@ -92,12 +113,6 @@ static void	nvme_q_free(struct nvme_soft
 static void	nvme_q_wait_complete(struct nvme_softc *, struct nvme_queue *,
 		bool (*)(void *), void *);
 
-static struct nvme_dmamem *
-		nvme_dmamem_alloc(struct nvme_softc *, size_t);
-static void	nvme_dmamem_free(struct nvme_softc *, struct nvme_dmamem *);
-static void	nvme_dmamem_sync(struct nvme_softc *, struct nvme_dmamem *,
-		int);
-
 static void	nvme_ns_io_fill(struct nvme_queue *, struct nvme_ccb *,
 		void *);
 static void	nvme_ns_io_done(struct nvme_queue *, struct nvme_ccb *,
@@ -126,15 +141,11 @@ static int	nvme_set_number_of_queues(str
 #define NVME_TIMO_PT		-1	/* passthrough cmd timeout */
 #define NVME_TIMO_SY		60	/* sync cache timeout */
 
-#define nvme_read4(_s, _r) \
-	bus_space_read_4((_s)->sc_iot, (_s)->sc_ioh, (_r))
-#define nvme_write4(_s, _r, _v) \
-	bus_space_write_4((_s)->sc_iot, (_s)->sc_ioh, (_r), (_v))
 /*
  * Some controllers, at least Apple NVMe, always require split
  * transfers, so don't use bus_space_{read,write}_8() on LP64.
  */
-static inline uint64_t
+uint64_t
 nvme_read8(struct nvme_softc *sc, bus_size_t r)
 {
 	uint64_t v;
@@ -151,7 +162,7 @@ 

CVS commit: src/sys

2022-05-07 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat May  7 08:20:04 UTC 2022

Modified Files:
src/sys/arch/arm/apple: files.apple
src/sys/arch/evbarm/conf: GENERIC64
src/sys/dev/ic: nvme.c nvmevar.h
Added Files:
src/sys/arch/arm/apple: apple_nvme.c

Log Message:
Add support for Apple silicon NVME.  Ported from OpenBSD.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/arch/arm/apple/apple_nvme.c
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/arm/apple/files.apple
cvs rdiff -u -r1.198 -r1.199 src/sys/arch/evbarm/conf/GENERIC64
cvs rdiff -u -r1.59 -r1.60 src/sys/dev/ic/nvme.c
cvs rdiff -u -r1.23 -r1.24 src/sys/dev/ic/nvmevar.h

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



CVS commit: src/usr.bin/make

2022-05-07 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat May  7 08:01:20 UTC 2022

Modified Files:
src/usr.bin/make: compat.c job.c main.c make.h
src/usr.bin/make/unit-tests: compat-error.mk deptgt-begin.mk
deptgt-end-fail-indirect.mk deptgt-end-fail.mk

Log Message:
make: rename Compat_Run to Compat_MakeAll

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.238 -r1.239 src/usr.bin/make/compat.c
cvs rdiff -u -r1.452 -r1.453 src/usr.bin/make/job.c
cvs rdiff -u -r1.580 -r1.581 src/usr.bin/make/main.c
cvs rdiff -u -r1.300 -r1.301 src/usr.bin/make/make.h
cvs rdiff -u -r1.3 -r1.4 src/usr.bin/make/unit-tests/compat-error.mk
cvs rdiff -u -r1.5 -r1.6 src/usr.bin/make/unit-tests/deptgt-begin.mk
cvs rdiff -u -r1.2 -r1.3 \
src/usr.bin/make/unit-tests/deptgt-end-fail-indirect.mk
cvs rdiff -u -r1.6 -r1.7 src/usr.bin/make/unit-tests/deptgt-end-fail.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/compat.c
diff -u src/usr.bin/make/compat.c:1.238 src/usr.bin/make/compat.c:1.239
--- src/usr.bin/make/compat.c:1.238	Sat Jan 22 18:59:23 2022
+++ src/usr.bin/make/compat.c	Sat May  7 08:01:20 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: compat.c,v 1.238 2022/01/22 18:59:23 rillig Exp $	*/
+/*	$NetBSD: compat.c,v 1.239 2022/05/07 08:01:20 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -70,16 +70,11 @@
  */
 
 /*
- * compat.c --
- *	The routines in this file implement the full-compatibility
- *	mode of PMake. Most of the special functionality of PMake
- *	is available in this mode. Things not supported:
- *	- different shells.
- *	- friendly variable substitution.
+ * This file implements the full-compatibility mode of make, which makes the
+ * targets without parallelism and without a custom shell.
  *
  * Interface:
- *	Compat_Run	Initialize things for this module and recreate
- *			thems as need creatin'
+ *	Compat_MakeAll	Initialize this module and make the given targets.
  */
 
 #include 
@@ -96,7 +91,7 @@
 #include "pathnames.h"
 
 /*	"@(#)compat.c	8.2 (Berkeley) 3/19/94"	*/
-MAKE_RCSID("$NetBSD: compat.c,v 1.238 2022/01/22 18:59:23 rillig Exp $");
+MAKE_RCSID("$NetBSD: compat.c,v 1.239 2022/05/07 08:01:20 rillig Exp $");
 
 static GNode *curTarg = NULL;
 static pid_t compatChild;
@@ -689,14 +684,8 @@ InitSignals(void)
 		bmake_signal(SIGQUIT, CompatInterrupt);
 }
 
-/*
- * Initialize this module and start making.
- *
- * Input:
- *	targs		The target nodes to re-create
- */
 void
-Compat_Run(GNodeList *targs)
+Compat_MakeAll(GNodeList *targs)
 {
 	GNode *errorNode = NULL;
 

Index: src/usr.bin/make/job.c
diff -u src/usr.bin/make/job.c:1.452 src/usr.bin/make/job.c:1.453
--- src/usr.bin/make/job.c:1.452	Sat Feb 12 11:14:48 2022
+++ src/usr.bin/make/job.c	Sat May  7 08:01:20 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: job.c,v 1.452 2022/02/12 11:14:48 rillig Exp $	*/
+/*	$NetBSD: job.c,v 1.453 2022/05/07 08:01:20 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.452 2022/02/12 11:14:48 rillig Exp $");
+MAKE_RCSID("$NetBSD: job.c,v 1.453 2022/05/07 08:01:20 rillig Exp $");
 
 /*
  * A shell defines how the commands are run.  All commands for a target are
@@ -2303,7 +2303,7 @@ Job_Init(void)
 	(void)Job_RunTarget(".BEGIN", NULL);
 	/*
 	 * Create the .END node now, even though no code in the unit tests
-	 * depends on it.  See also Targ_GetEndNode in Compat_Run.
+	 * depends on it.  See also Targ_GetEndNode in Compat_MakeAll.
 	 */
 	(void)Targ_GetEndNode();
 }

Index: src/usr.bin/make/main.c
diff -u src/usr.bin/make/main.c:1.580 src/usr.bin/make/main.c:1.581
--- src/usr.bin/make/main.c:1.580	Mon Apr 18 15:06:27 2022
+++ src/usr.bin/make/main.c	Sat May  7 08:01:20 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.580 2022/04/18 15:06:27 rillig Exp $	*/
+/*	$NetBSD: main.c,v 1.581 2022/05/07 08:01:20 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -111,7 +111,7 @@
 #include "trace.h"
 
 /*	"@(#)main.c	8.3 (Berkeley) 3/19/94"	*/
-MAKE_RCSID("$NetBSD: main.c,v 1.580 2022/04/18 15:06:27 rillig Exp $");
+MAKE_RCSID("$NetBSD: main.c,v 1.581 2022/05/07 08:01:20 rillig Exp $");
 #if defined(MAKE_NATIVE) && !defined(lint)
 __COPYRIGHT("@(#) Copyright (c) 1988, 1989, 1990, 1993 "
 	"The Regents of the University of California.  "
@@ -903,11 +903,7 @@ runTargets(void)
 		/* Traverse the graph, checking on all the targets */
 		outOfDate = Make_Run();
 	} else {
-		/*
-		 * Compat_Init will take care of creating all the
-		 * targets as well as initializing the module.
-		 */
-		Compat_Run();
+		Compat_MakeAll();
 		outOfDate = false;
 	}
 	Lst_Done();	/* Don't free the targets themselves. */

Index: src/usr.bin/make/make.h
diff -u 

CVS commit: src/usr.bin/make

2022-05-07 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat May  7 08:01:20 UTC 2022

Modified Files:
src/usr.bin/make: compat.c job.c main.c make.h
src/usr.bin/make/unit-tests: compat-error.mk deptgt-begin.mk
deptgt-end-fail-indirect.mk deptgt-end-fail.mk

Log Message:
make: rename Compat_Run to Compat_MakeAll

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.238 -r1.239 src/usr.bin/make/compat.c
cvs rdiff -u -r1.452 -r1.453 src/usr.bin/make/job.c
cvs rdiff -u -r1.580 -r1.581 src/usr.bin/make/main.c
cvs rdiff -u -r1.300 -r1.301 src/usr.bin/make/make.h
cvs rdiff -u -r1.3 -r1.4 src/usr.bin/make/unit-tests/compat-error.mk
cvs rdiff -u -r1.5 -r1.6 src/usr.bin/make/unit-tests/deptgt-begin.mk
cvs rdiff -u -r1.2 -r1.3 \
src/usr.bin/make/unit-tests/deptgt-end-fail-indirect.mk
cvs rdiff -u -r1.6 -r1.7 src/usr.bin/make/unit-tests/deptgt-end-fail.mk

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



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

2022-05-07 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat May  7 07:26:27 UTC 2022

Modified Files:
src/sys/arch/arm/broadcom: bcm2835_spi.c

Log Message:
Remove unnecessary gotos and label.  Same code before and after.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/arm/broadcom/bcm2835_spi.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/arm/broadcom

2022-05-07 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat May  7 07:26:27 UTC 2022

Modified Files:
src/sys/arch/arm/broadcom: bcm2835_spi.c

Log Message:
Remove unnecessary gotos and label.  Same code before and after.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/arm/broadcom/bcm2835_spi.c

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

Modified files:

Index: src/sys/arch/arm/broadcom/bcm2835_spi.c
diff -u src/sys/arch/arm/broadcom/bcm2835_spi.c:1.11 src/sys/arch/arm/broadcom/bcm2835_spi.c:1.12
--- src/sys/arch/arm/broadcom/bcm2835_spi.c:1.11	Sat Aug  7 16:18:43 2021
+++ src/sys/arch/arm/broadcom/bcm2835_spi.c	Sat May  7 07:26:27 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: bcm2835_spi.c,v 1.11 2021/08/07 16:18:43 thorpej Exp $	*/
+/*	$NetBSD: bcm2835_spi.c,v 1.12 2022/05/07 07:26:27 skrll Exp $	*/
 
 /*
  * Copyright (c) 2012 Jonathan A. Kollasch
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: bcm2835_spi.c,v 1.11 2021/08/07 16:18:43 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bcm2835_spi.c,v 1.12 2022/05/07 07:26:27 skrll Exp $");
 
 #include 
 #include 
@@ -298,7 +298,6 @@ bcmspi_intr(void *cookie)
 	if (ISSET(cs, SPI_CS_DONE)) {
 		if (sc->sc_wchunk != NULL) {
 			bcmspi_send(sc);
-			goto end;
 		} else {
 			bus_space_write_4(sc->sc_iot, sc->sc_ioh, SPI_CS,
 			sc->sc_CS);
@@ -309,14 +308,12 @@ bcmspi_intr(void *cookie)
 			KASSERT(st != NULL);
 			spi_done(st, 0);
 			sc->sc_running = false;
-			goto end;
 		}
 	} else if (ISSET(cs, SPI_CS_RXR)) {
 		bcmspi_recv(sc);
 		bcmspi_send(sc);
 	}
 
-end:
 	mutex_exit(>sc_mutex);
 	return ISSET(cs, SPI_CS_DONE|SPI_CS_RXR);
 }



CVS commit: src/sys/arch/powerpc

2022-05-07 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat May  7 07:10:47 UTC 2022

Modified Files:
src/sys/arch/powerpc/conf: files.powerpc
src/sys/arch/powerpc/include: pmap.h
src/sys/arch/powerpc/include/oea: pmap.h

Log Message:
Try to fix PV tracking support.

* For oea (with real PV tracking support):

  Define __HAVE_PMAP_PV_TRACK. Otherwise, pmap_pv_init() is not called by
  uvm_init().

* For booke and ibm4xx (without PV tracking support):

  For MODULAR kernel and modules, define __HAVE_PMAP_PV_TRACK together with
  PMAP_PV_TRACK_ONLY_STUBS, so that modules can be shared with oea.

Note that PMAP_PV_TRACK_ONLY_STUBS can be used even for oea,
as a compile-time option to strip real PV tracking support.


To generate a diff of this commit:
cvs rdiff -u -r1.100 -r1.101 src/sys/arch/powerpc/conf/files.powerpc
cvs rdiff -u -r1.41 -r1.42 src/sys/arch/powerpc/include/pmap.h
cvs rdiff -u -r1.36 -r1.37 src/sys/arch/powerpc/include/oea/pmap.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/conf/files.powerpc
diff -u src/sys/arch/powerpc/conf/files.powerpc:1.100 src/sys/arch/powerpc/conf/files.powerpc:1.101
--- src/sys/arch/powerpc/conf/files.powerpc:1.100	Thu Feb 17 16:09:00 2022
+++ src/sys/arch/powerpc/conf/files.powerpc	Sat May  7 07:10:46 2022
@@ -1,4 +1,4 @@
-#	$NetBSD: files.powerpc,v 1.100 2022/02/17 16:09:00 macallan Exp $
+#	$NetBSD: files.powerpc,v 1.101 2022/05/07 07:10:46 rin Exp $
 
 defflag	opt_altivec.h	ALTIVEC K_ALTIVEC PPC_HAVE_SPE
 defflag	opt_openpic.h	OPENPIC_DISTRIBUTE
@@ -32,6 +32,8 @@ file	arch/powerpc/powerpc/db_trace.c			d
 file	arch/powerpc/powerpc/fpu.c
 file	arch/powerpc/powerpc/intr_stubs.c		ppc_booke
 
+file	uvm/pmap/pmap_pvt.cmodular | (ppc_oea | ppc_oea64 | ppc_oea64_bridge | ppc_oea601)
+
 # IBM 4xx Family files (40x)
 file	arch/powerpc/ibm4xx/pmap.c			ppc_ibm4xx
 file	arch/powerpc/ibm4xx/trap.c			ppc_ibm4xx
@@ -51,7 +53,6 @@ file	arch/powerpc/oea/pmap64.c			ppc_oea
 file	arch/powerpc/oea/pmap64_bridge.c		ppc_oea64_bridge
 file	arch/powerpc/oea/pmap_kernel.c			ppc_oea | ppc_oea64 | ppc_oea64_bridge | ppc_oea601
 file	arch/powerpc/powerpc/trap.c			ppc_oea | ppc_oea64 | ppc_oea64_bridge | ppc_oea601
-file	uvm/pmap/pmap_pvt.cppc_oea | ppc_oea64 | ppc_oea64_bridge | ppc_oea601
 
 # PPC BookE (MPC85xx) Family files
 file	arch/powerpc/booke/booke_machdep.c		ppc_booke

Index: src/sys/arch/powerpc/include/pmap.h
diff -u src/sys/arch/powerpc/include/pmap.h:1.41 src/sys/arch/powerpc/include/pmap.h:1.42
--- src/sys/arch/powerpc/include/pmap.h:1.41	Wed Feb 16 23:31:13 2022
+++ src/sys/arch/powerpc/include/pmap.h	Sat May  7 07:10:46 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.h,v 1.41 2022/02/16 23:31:13 riastradh Exp $	*/
+/*	$NetBSD: pmap.h,v 1.42 2022/05/07 07:10:46 rin Exp $	*/
 
 #ifndef _POWERPC_PMAP_H_
 #define _POWERPC_PMAP_H_
@@ -22,8 +22,6 @@
 
 #endif /* !_MODULE */
 
-#include 
-
 #if !defined(_LOCORE) && (defined(MODULAR) || defined(_MODULE))
 /*
  * Both BOOKE and OEA use __HAVE_VM_PAGE_MD but IBM4XX doesn't so define
@@ -41,6 +39,15 @@ struct vm_page_md {
 
 __CTASSERT(sizeof(struct vm_page_md) == sizeof(uintptr_t)*5);
 
+#ifndef __HAVE_PMAP_PV_TRACK
+/*
+ * We need empty stubs for modules shared with all sub-archs.
+ */
+#define	__HAVE_PMAP_PV_TRACK
+#define	PMAP_PV_TRACK_ONLY_STUBS
+#include 
+#endif /* !__HAVE_PMAP_PV_TRACK */
+
 #endif /* !LOCORE && (MODULAR || _MODULE) */
 
 #endif /* !_POWERPC_PMAP_H_ */

Index: src/sys/arch/powerpc/include/oea/pmap.h
diff -u src/sys/arch/powerpc/include/oea/pmap.h:1.36 src/sys/arch/powerpc/include/oea/pmap.h:1.37
--- src/sys/arch/powerpc/include/oea/pmap.h:1.36	Wed Feb 16 23:31:13 2022
+++ src/sys/arch/powerpc/include/oea/pmap.h	Sat May  7 07:10:46 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.h,v 1.36 2022/02/16 23:31:13 riastradh Exp $	*/
+/*	$NetBSD: pmap.h,v 1.37 2022/05/07 07:10:46 rin Exp $	*/
 
 /*-
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -48,6 +48,9 @@
 #endif
 #include 
 
+#define	__HAVE_PMAP_PV_TRACK
+#include 
+
 /*
  * Pmap stuff
  */



CVS commit: src/sys/arch/powerpc

2022-05-07 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat May  7 07:10:47 UTC 2022

Modified Files:
src/sys/arch/powerpc/conf: files.powerpc
src/sys/arch/powerpc/include: pmap.h
src/sys/arch/powerpc/include/oea: pmap.h

Log Message:
Try to fix PV tracking support.

* For oea (with real PV tracking support):

  Define __HAVE_PMAP_PV_TRACK. Otherwise, pmap_pv_init() is not called by
  uvm_init().

* For booke and ibm4xx (without PV tracking support):

  For MODULAR kernel and modules, define __HAVE_PMAP_PV_TRACK together with
  PMAP_PV_TRACK_ONLY_STUBS, so that modules can be shared with oea.

Note that PMAP_PV_TRACK_ONLY_STUBS can be used even for oea,
as a compile-time option to strip real PV tracking support.


To generate a diff of this commit:
cvs rdiff -u -r1.100 -r1.101 src/sys/arch/powerpc/conf/files.powerpc
cvs rdiff -u -r1.41 -r1.42 src/sys/arch/powerpc/include/pmap.h
cvs rdiff -u -r1.36 -r1.37 src/sys/arch/powerpc/include/oea/pmap.h

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



CVS commit: src/sys/uvm/pmap

2022-05-07 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat May  7 06:53:16 UTC 2022

Modified Files:
src/sys/uvm/pmap: pmap.c pmap.h pmap_pvt.c

Log Message:
Introduce PMAP_PV_TRACK_ONLY_STUBS option, by which only empty stubs for
global functions in pmap_pvt.h are provided, instead of real support for
PV tracking.

Necessary for powerpc: Only one sub-arch (oea) has PV tracking support.
Others (booke/ibm4xx) do not at the moment (probably never for ibm4xx),
but __HAVE_PMAP_PV_TRACK is necessary, so that modules can be shared by
all of sub-archs.


To generate a diff of this commit:
cvs rdiff -u -r1.64 -r1.65 src/sys/uvm/pmap/pmap.c
cvs rdiff -u -r1.20 -r1.21 src/sys/uvm/pmap/pmap.h
cvs rdiff -u -r1.11 -r1.12 src/sys/uvm/pmap/pmap_pvt.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/uvm/pmap/pmap.c
diff -u src/sys/uvm/pmap/pmap.c:1.64 src/sys/uvm/pmap/pmap.c:1.65
--- src/sys/uvm/pmap/pmap.c:1.64	Sat Apr  9 23:38:33 2022
+++ src/sys/uvm/pmap/pmap.c	Sat May  7 06:53:16 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.64 2022/04/09 23:38:33 riastradh Exp $	*/
+/*	$NetBSD: pmap.c,v 1.65 2022/05/07 06:53:16 rin Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2001 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
 
 #include 
 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.64 2022/04/09 23:38:33 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.65 2022/05/07 06:53:16 rin Exp $");
 
 /*
  *	Manages physical address maps.
@@ -120,6 +120,10 @@ __KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.6
  PMAP_NO_PV_UNCACHED to be defined
 #endif
 
+#if defined(PMAP_PV_TRACK_ONLY_STUBS)
+#undef	__HAVE_PMAP_PV_TRACK
+#endif
+
 PMAP_COUNTER(remove_kernel_calls, "remove kernel calls");
 PMAP_COUNTER(remove_kernel_pages, "kernel pages unmapped");
 PMAP_COUNTER(remove_user_calls, "remove user calls");

Index: src/sys/uvm/pmap/pmap.h
diff -u src/sys/uvm/pmap/pmap.h:1.20 src/sys/uvm/pmap/pmap.h:1.21
--- src/sys/uvm/pmap/pmap.h:1.20	Fri Mar 19 07:51:33 2021
+++ src/sys/uvm/pmap/pmap.h	Sat May  7 06:53:16 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.h,v 1.20 2021/03/19 07:51:33 skrll Exp $	*/
+/*	$NetBSD: pmap.h,v 1.21 2022/05/07 06:53:16 rin Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -203,7 +203,7 @@ void	pmap_pvlist_lock_init(size_t);
 void	pmap_page_cache(struct vm_page_md *, bool);
 #endif
 
-#ifdef __HAVE_PMAP_PV_TRACK
+#if defined(__HAVE_PMAP_PV_TRACK) && !defined(PMAP_PV_TRACK_ONLY_STUBS)
 void	pmap_pv_protect(paddr_t, vm_prot_t);
 #endif
 

Index: src/sys/uvm/pmap/pmap_pvt.c
diff -u src/sys/uvm/pmap/pmap_pvt.c:1.11 src/sys/uvm/pmap/pmap_pvt.c:1.12
--- src/sys/uvm/pmap/pmap_pvt.c:1.11	Wed Jul 21 06:35:45 2021
+++ src/sys/uvm/pmap/pmap_pvt.c	Sat May  7 06:53:16 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap_pvt.c,v 1.11 2021/07/21 06:35:45 skrll Exp $	*/
+/*	$NetBSD: pmap_pvt.c,v 1.12 2022/05/07 06:53:16 rin Exp $	*/
 
 /*-
  * Copyright (c) 2014, 2020 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: pmap_pvt.c,v 1.11 2021/07/21 06:35:45 skrll Exp $");
+__RCSID("$NetBSD: pmap_pvt.c,v 1.12 2022/05/07 06:53:16 rin Exp $");
 
 #include 
 #include 
@@ -40,6 +40,7 @@ __RCSID("$NetBSD: pmap_pvt.c,v 1.11 2021
 #include 
 #include 
 
+#if !defined(PMAP_PV_TRACK_ONLY_STUBS)
 /*
  * unmanaged pv-tracked ranges
  *
@@ -177,3 +178,33 @@ pmap_pv_tracked(paddr_t pa)
 	return >pvt_pages[pgno];
 }
 
+#else /* PMAP_PV_TRACK_ONLY_STUBS */
+/*
+ * Provide empty stubs just for MODULAR kernels.
+ */
+
+void
+pmap_pv_init(void)
+{
+
+}
+
+void
+pmap_pv_track(paddr_t start, psize_t size)
+{
+
+}
+
+void
+pmap_pv_untrack(paddr_t start, psize_t size)
+{
+
+}
+
+struct pmap_page *
+pmap_pv_tracked(paddr_t pa)
+{
+
+	return NULL;
+}
+#endif



CVS commit: src/sys/uvm/pmap

2022-05-07 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat May  7 06:53:16 UTC 2022

Modified Files:
src/sys/uvm/pmap: pmap.c pmap.h pmap_pvt.c

Log Message:
Introduce PMAP_PV_TRACK_ONLY_STUBS option, by which only empty stubs for
global functions in pmap_pvt.h are provided, instead of real support for
PV tracking.

Necessary for powerpc: Only one sub-arch (oea) has PV tracking support.
Others (booke/ibm4xx) do not at the moment (probably never for ibm4xx),
but __HAVE_PMAP_PV_TRACK is necessary, so that modules can be shared by
all of sub-archs.


To generate a diff of this commit:
cvs rdiff -u -r1.64 -r1.65 src/sys/uvm/pmap/pmap.c
cvs rdiff -u -r1.20 -r1.21 src/sys/uvm/pmap/pmap.h
cvs rdiff -u -r1.11 -r1.12 src/sys/uvm/pmap/pmap_pvt.c

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



CVS commit: src/external/mit/xorg/bin/xdm/config

2022-05-07 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Sat May  7 06:31:39 UTC 2022

Modified Files:
src/external/mit/xorg/bin/xdm/config: Xresources.in

Log Message:
Add RCSID to Xresources config.  Use the B/W NetBSD logo on B/W displays.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/external/mit/xorg/bin/xdm/config/Xresources.in

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

Modified files:

Index: src/external/mit/xorg/bin/xdm/config/Xresources.in
diff -u src/external/mit/xorg/bin/xdm/config/Xresources.in:1.6 src/external/mit/xorg/bin/xdm/config/Xresources.in:1.7
--- src/external/mit/xorg/bin/xdm/config/Xresources.in:1.6	Thu May  5 15:26:11 2022
+++ src/external/mit/xorg/bin/xdm/config/Xresources.in	Sat May  7 06:31:39 2022
@@ -1,3 +1,5 @@
+! $NetBSD: Xresources.in,v 1.7 2022/05/07 06:31:39 nia Exp $
+
 xlogin*login.translations: #override BS
 	CtrlR: abort-display()NLBS
 	F1: set-session-argument(failsafe) finish-field()NLBS
@@ -42,6 +44,7 @@ xlogin*innerFramesWidth: 2
 xlogin*sepWidth: 0
 
 XHASHifdef COLOR
+xlogin*logoFileName: BITMAPDIR/**//XDM_PIXMAP
 xlogin*shdColor: steelblue
 xlogin*hiColor: steelblue
 xlogin*background: white
@@ -49,6 +52,7 @@ xlogin*inpColor: lavender
 xlogin*greetColor: black
 xlogin*failColor: darkred
 XHASHelse
+xlogin*logoFileName: BITMAPDIR/**//XDM_BWPIXMAP
 xlogin*shdColor: black
 xlogin*hiColor: black
 xlogin*background: white
@@ -60,7 +64,6 @@ XHASHendif
 *Foreground: black
 *Background: white
 
-xlogin*logoFileName: BITMAPDIR/**//XDM_PIXMAP
 xlogin*useShape: true
 xlogin*logoPadding: 12
 



CVS commit: src/external/mit/xorg/bin/xdm/config

2022-05-07 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Sat May  7 06:31:39 UTC 2022

Modified Files:
src/external/mit/xorg/bin/xdm/config: Xresources.in

Log Message:
Add RCSID to Xresources config.  Use the B/W NetBSD logo on B/W displays.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/external/mit/xorg/bin/xdm/config/Xresources.in

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