CVS commit: src/usr.bin/make

2024-01-24 Thread Simon J. Gerraty
Module Name:src
Committed By:   sjg
Date:   Thu Jan 25 07:35:46 UTC 2024

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

Log Message:
Indicate that for :U newval is optional


To generate a diff of this commit:
cvs rdiff -u -r1.372 -r1.373 src/usr.bin/make/make.1

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

Modified files:

Index: src/usr.bin/make/make.1
diff -u src/usr.bin/make/make.1:1.372 src/usr.bin/make/make.1:1.373
--- src/usr.bin/make/make.1:1.372	Sun Dec 24 16:48:30 2023
+++ src/usr.bin/make/make.1	Thu Jan 25 07:35:46 2024
@@ -1,4 +1,4 @@
-.\"	$NetBSD: make.1,v 1.372 2023/12/24 16:48:30 sjg Exp $
+.\"	$NetBSD: make.1,v 1.373 2024/01/25 07:35:46 sjg Exp $
 .\"
 .\" Copyright (c) 1990, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -29,7 +29,7 @@
 .\"
 .\"	from: @(#)make.1	8.4 (Berkeley) 3/19/94
 .\"
-.Dd December 24, 2023
+.Dd January 24, 2024
 .Dt MAKE 1
 .Os
 .Sh NAME
@@ -1772,8 +1772,9 @@ is used to save the result of the
 .Ql :S
 modifier which is later referenced using the index values from
 .Ql :range .
-.It Cm \&:U\| Ns Ar newval
+.It Cm \&:U\| Ns Oo Ar newval Oc
 If the variable is undefined,
+the optional
 .Ar newval
 is the value.
 If the variable is defined, the existing value is returned.



CVS commit: src/usr.bin/make

2024-01-24 Thread Simon J. Gerraty
Module Name:src
Committed By:   sjg
Date:   Thu Jan 25 07:35:46 UTC 2024

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

Log Message:
Indicate that for :U newval is optional


To generate a diff of this commit:
cvs rdiff -u -r1.372 -r1.373 src/usr.bin/make/make.1

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/igc

2024-01-24 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Jan 25 05:48:56 UTC 2024

Modified Files:
src/sys/dev/pci/igc: if_igc.c

Log Message:
igc(4): Count iqdrops.

 TODO: RQDPC should be visible via evcnt(9).


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/dev/pci/igc/if_igc.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/igc/if_igc.c
diff -u src/sys/dev/pci/igc/if_igc.c:1.9 src/sys/dev/pci/igc/if_igc.c:1.10
--- src/sys/dev/pci/igc/if_igc.c:1.9	Wed Dec 20 18:09:19 2023
+++ src/sys/dev/pci/igc/if_igc.c	Thu Jan 25 05:48:56 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_igc.c,v 1.9 2023/12/20 18:09:19 skrll Exp $	*/
+/*	$NetBSD: if_igc.c,v 1.10 2024/01/25 05:48:56 msaitoh Exp $	*/
 /*	$OpenBSD: if_igc.c,v 1.13 2023/04/28 10:18:57 bluhm Exp $	*/
 /*-
  * SPDX-License-Identifier: BSD-2-Clause
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_igc.c,v 1.9 2023/12/20 18:09:19 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_igc.c,v 1.10 2024/01/25 05:48:56 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_if_igc.h"
@@ -1116,11 +1116,35 @@ igc_update_counters(struct igc_softc *sc
 
 	/* Mac statistics */
 	struct igc_hw *hw = >hw;
+	struct ifnet *ifp = >sc_ec.ec_if;
+	uint64_t iqdrops = 0;
 
 	for (int cnt = 0; cnt < IGC_MAC_COUNTERS; cnt++) {
-		IGC_MAC_COUNTER_ADD(sc, cnt, igc_read_mac_counter(hw,
-		igc_mac_counters[cnt].reg, igc_mac_counters[cnt].is64));
+		uint64_t val;
+		bus_size_t regaddr = igc_mac_counters[cnt].reg;
+
+		val = igc_read_mac_counter(hw, regaddr,
+		igc_mac_counters[cnt].is64);
+		IGC_MAC_COUNTER_ADD(sc, cnt, val);
+		/* XXX Count MPC to iqdrops. */
+		if (regaddr == IGC_MPC)
+			iqdrops += val;
 	}
+
+	for (int iq = 0; iq < sc->sc_nqueues; iq++) {
+		uint32_t val;
+
+		/* XXX RQDPC should be visible via evcnt(9). */
+		val = IGC_READ_REG(hw, IGC_RQDPC(iq));
+
+		/* RQDPC is not cleard on read. */
+		if (val != 0)
+			IGC_WRITE_REG(hw, IGC_RQDPC(iq), 0);
+		iqdrops += val;
+	}
+
+	if (iqdrops != 0)
+		if_statadd(ifp, if_iqdrops, iqdrops);
 #endif
 }
 



CVS commit: src/sys/dev/pci/igc

2024-01-24 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Jan 25 05:48:56 UTC 2024

Modified Files:
src/sys/dev/pci/igc: if_igc.c

Log Message:
igc(4): Count iqdrops.

 TODO: RQDPC should be visible via evcnt(9).


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

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



CVS commit: src/sbin/blkdiscard

2024-01-24 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Thu Jan 25 02:42:17 UTC 2024

Modified Files:
src/sbin/blkdiscard: blkdiscard.8 blkdiscard.c

Log Message:
blkdiscard: avoid asserting when passed a bsd disklabel raw device

PR#57856 shows when using blkdiscard on eg, /dev/ld0 it asserts because
'0' is not between 'a' and 'p'.  switch this to using DISKPART() on the
returned st_rdev, so it works on 'ld0c' or 'ld0' (rawpart=2.)


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sbin/blkdiscard/blkdiscard.8 \
src/sbin/blkdiscard/blkdiscard.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/blkdiscard/blkdiscard.8
diff -u src/sbin/blkdiscard/blkdiscard.8:1.2 src/sbin/blkdiscard/blkdiscard.8:1.3
--- src/sbin/blkdiscard/blkdiscard.8:1.2	Sat Oct 15 21:53:21 2022
+++ src/sbin/blkdiscard/blkdiscard.8	Thu Jan 25 02:42:17 2024
@@ -1,4 +1,4 @@
-.\"	$NetBSD: blkdiscard.8,v 1.2 2022/10/15 21:53:21 andvar Exp $
+.\"	$NetBSD: blkdiscard.8,v 1.3 2024/01/25 02:42:17 mrg Exp $
 .\"
 .\" Copyright (c) 2022 Matthew R. Green
 .\" All rights reserved.
@@ -24,7 +24,7 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.Dd February 6, 2022
+.Dd January 13, 2024
 .Dt BLKDISCARD 8
 .Os
 .Sh NAME
@@ -156,7 +156,7 @@ The
 .Nm
 command was written by
 .An Matthew R. Green
-.Aq m...@eterna.com.au .
+.Aq m...@eterna23.net .
 .Sh BUGS
 The secure erase functionality of the
 .Fl s
Index: src/sbin/blkdiscard/blkdiscard.c
diff -u src/sbin/blkdiscard/blkdiscard.c:1.2 src/sbin/blkdiscard/blkdiscard.c:1.3
--- src/sbin/blkdiscard/blkdiscard.c:1.2	Thu Jan 25 02:06:56 2024
+++ src/sbin/blkdiscard/blkdiscard.c	Thu Jan 25 02:42:17 2024
@@ -1,7 +1,7 @@
-/*	$NetBSD: blkdiscard.c,v 1.2 2024/01/25 02:06:56 mrg Exp $	*/
+/*	$NetBSD: blkdiscard.c,v 1.3 2024/01/25 02:42:17 mrg Exp $	*/
 
 /*
- * Copyright (c) 2019, 2020, 2022 Matthew R. Green
+ * Copyright (c) 2019, 2020, 2022, 2024 Matthew R. Green
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -45,7 +45,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 
 static bool secure = false;
@@ -53,7 +52,7 @@ static bool zeroout = false;
 static char *zeros = NULL;
 static unsigned ttywidth = 80;
 
-#define FDISCARD_VERSION	20220206u
+#define FDISCARD_VERSION	20240113u
 
 static void __dead
 usage(const char* msg)
@@ -105,6 +104,7 @@ main(int argc, char *argv[])
 	int64_t val;
 	int i;
 	bool verbose = false;
+	struct stat sb;
 
 	/* Default /sbin/blkdiscard to be "run" */
 	bool norun = strcmp(getprogname(), "blkdiscard") != 0;
@@ -176,6 +176,7 @@ main(int argc, char *argv[])
 
 	if (size == 0) {
 		struct dkwedge_info dkw;
+
 		if (ioctl(fd, DIOCGWEDGEINFO, ) == 0) {
 			size = dkw.dkw_size * DEV_BSIZE;
 			if (verbose)
@@ -184,24 +185,20 @@ main(int argc, char *argv[])
 		}
 	}
 
-	if (size == 0) {
+	if (size == 0 && fstat(fd, ) != -1) {
 		struct disklabel dl;
+
 		if (ioctl(fd, DIOCGDINFO, ) != -1) {
-			char partchar = name[strlen(name)-1];
-			assert(partchar >= 'a' && partchar <= 'p');
-			int part = partchar - 'a';
+			unsigned part = DISKPART(sb.st_rdev);
 
 			size = (uint64_t)dl.d_partitions[part].p_size *
 			dl.d_secsize;
 			if (verbose)
-printf("%s: disklabel size is %lld\n", name,
-(long long)size);
+printf("%s: partition %u disklabel size is"
+   " %lld\n", name, part, (long long)size);
 		}
-	}
 
-	if (size == 0) {
-		struct stat sb;
-		if (fstat(fd, ) != -1) {
+		if (size == 0) {
 			size = sb.st_size;
 			if (verbose)
 printf("%s: stat size is %lld\n", name,



CVS commit: src/sbin/blkdiscard

2024-01-24 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Thu Jan 25 02:42:17 UTC 2024

Modified Files:
src/sbin/blkdiscard: blkdiscard.8 blkdiscard.c

Log Message:
blkdiscard: avoid asserting when passed a bsd disklabel raw device

PR#57856 shows when using blkdiscard on eg, /dev/ld0 it asserts because
'0' is not between 'a' and 'p'.  switch this to using DISKPART() on the
returned st_rdev, so it works on 'ld0c' or 'ld0' (rawpart=2.)


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sbin/blkdiscard/blkdiscard.8 \
src/sbin/blkdiscard/blkdiscard.c

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



CVS commit: src/sbin/blkdiscard

2024-01-24 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Thu Jan 25 02:06:56 UTC 2024

Modified Files:
src/sbin/blkdiscard: blkdiscard.c

Log Message:
determine the tty width instead off writing 100 chars before a new line.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sbin/blkdiscard/blkdiscard.c

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



CVS commit: src/sbin/blkdiscard

2024-01-24 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Thu Jan 25 02:06:56 UTC 2024

Modified Files:
src/sbin/blkdiscard: blkdiscard.c

Log Message:
determine the tty width instead off writing 100 chars before a new line.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sbin/blkdiscard/blkdiscard.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/blkdiscard/blkdiscard.c
diff -u src/sbin/blkdiscard/blkdiscard.c:1.1 src/sbin/blkdiscard/blkdiscard.c:1.2
--- src/sbin/blkdiscard/blkdiscard.c:1.1	Mon Feb  7 09:33:26 2022
+++ src/sbin/blkdiscard/blkdiscard.c	Thu Jan 25 02:06:56 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: blkdiscard.c,v 1.1 2022/02/07 09:33:26 mrg Exp $	*/
+/*	$NetBSD: blkdiscard.c,v 1.2 2024/01/25 02:06:56 mrg Exp $	*/
 
 /*
  * Copyright (c) 2019, 2020, 2022 Matthew R. Green
@@ -51,6 +51,7 @@
 static bool secure = false;
 static bool zeroout = false;
 static char *zeros = NULL;
+static unsigned ttywidth = 80;
 
 #define FDISCARD_VERSION	20220206u
 
@@ -224,7 +225,9 @@ main(int argc, char *argv[])
 		size = end_offset;
 	}
 
-	if (verbose)
+	if (verbose) {
+		struct winsize winsize;
+
 		printf("%sgoing to %s on %s from byte %lld for "
 		   "%lld bytes, %lld at a time\n",
 		   norun ? "not " : "",
@@ -233,7 +236,12 @@ main(int argc, char *argv[])
 		   name, (long long)first_byte, (long long)size,
 		   (long long)max_per_call);
 
-	int loop = 0;
+		if (ioctl(fileno(stdout), TIOCGWINSZ, ) != -1 &&
+		winsize.ws_col > 1)
+			ttywidth = winsize.ws_col - 1;
+	}
+
+	unsigned loop = 0;
 	while (size > 0) {
 		if (size > max_per_call)
 			discard_size = max_per_call;
@@ -248,7 +256,7 @@ main(int argc, char *argv[])
 		if (verbose) {
 			printf(".");
 			fflush(stdout);
-			if (loop++ > 100) {
+			if (++loop >= ttywidth) {
 loop = 0;
 printf("\n");
 			}



CVS commit: src/distrib/sets/lists/tests

2024-01-24 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Thu Jan 25 01:43:59 UTC 2024

Modified Files:
src/distrib/sets/lists/tests: mi

Log Message:
add missing mtree subdir and it's Atffile.


To generate a diff of this commit:
cvs rdiff -u -r1.1300 -r1.1301 src/distrib/sets/lists/tests/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/tests/mi
diff -u src/distrib/sets/lists/tests/mi:1.1300 src/distrib/sets/lists/tests/mi:1.1301
--- src/distrib/sets/lists/tests/mi:1.1300	Thu Jan 25 00:30:57 2024
+++ src/distrib/sets/lists/tests/mi	Thu Jan 25 01:43:58 2024
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1300 2024/01/25 00:30:57 riastradh Exp $
+# $NetBSD: mi,v 1.1301 2024/01/25 01:43:58 mrg Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -6378,6 +6378,8 @@
 ./usr/tests/usr.bin/mkdep/h_findcc			tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/mkdep/t_findcc			tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/mkdep/t_mkdep			tests-usr.bin-tests	compattestfile,atf
+./usr/tests/usr.bin/mtreetests-usr.bin-tests	compattestfile,atf
+./usr/tests/usr.bin/mtree/Atffile			tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/mtree/t_sets			tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/nbperftests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/nbperf/Atffile			tests-usr.bin-tests	compattestfile,atf



CVS commit: src/distrib/sets/lists/tests

2024-01-24 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Thu Jan 25 01:43:59 UTC 2024

Modified Files:
src/distrib/sets/lists/tests: mi

Log Message:
add missing mtree subdir and it's Atffile.


To generate a diff of this commit:
cvs rdiff -u -r1.1300 -r1.1301 src/distrib/sets/lists/tests/mi

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



CVS commit: src

2024-01-24 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Thu Jan 25 00:30:58 UTC 2024

Modified Files:
src/distrib/sets/lists/tests: mi
src/etc/mtree: NetBSD.dist.tests
src/tests/usr.bin: Makefile
Added Files:
src/tests/usr.bin/mtree: Makefile t_sets.sh

Log Message:
mtree(8): Test the installed sets.

Except etc and xetc, which likely won't match for reasons that aren't
great, like etc including empty log files which in an installed
system have probably changed.

This test will probably fail, but we should make sure it doesn't!

PR misc/57877


To generate a diff of this commit:
cvs rdiff -u -r1.1299 -r1.1300 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.201 -r1.202 src/etc/mtree/NetBSD.dist.tests
cvs rdiff -u -r1.38 -r1.39 src/tests/usr.bin/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/usr.bin/mtree/Makefile \
src/tests/usr.bin/mtree/t_sets.sh

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

Modified files:

Index: src/distrib/sets/lists/tests/mi
diff -u src/distrib/sets/lists/tests/mi:1.1299 src/distrib/sets/lists/tests/mi:1.1300
--- src/distrib/sets/lists/tests/mi:1.1299	Tue Jan 23 22:07:23 2024
+++ src/distrib/sets/lists/tests/mi	Thu Jan 25 00:30:57 2024
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1299 2024/01/23 22:07:23 rillig Exp $
+# $NetBSD: mi,v 1.1300 2024/01/25 00:30:57 riastradh Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -6378,6 +6378,7 @@
 ./usr/tests/usr.bin/mkdep/h_findcc			tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/mkdep/t_findcc			tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/mkdep/t_mkdep			tests-usr.bin-tests	compattestfile,atf
+./usr/tests/usr.bin/mtree/t_sets			tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/nbperftests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/nbperf/Atffile			tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/nbperf/Kyuafile			tests-usr.bin-tests	compattestfile,atf,kyua

Index: src/etc/mtree/NetBSD.dist.tests
diff -u src/etc/mtree/NetBSD.dist.tests:1.201 src/etc/mtree/NetBSD.dist.tests:1.202
--- src/etc/mtree/NetBSD.dist.tests:1.201	Sat Aug 26 10:06:16 2023
+++ src/etc/mtree/NetBSD.dist.tests	Thu Jan 25 00:30:57 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: NetBSD.dist.tests,v 1.201 2023/08/26 10:06:16 rillig Exp $
+#	$NetBSD: NetBSD.dist.tests,v 1.202 2024/01/25 00:30:57 riastradh Exp $
 
 ./usr/libdata/debug/usr/tests
 ./usr/libdata/debug/usr/tests/atf
@@ -462,6 +462,7 @@
 ./usr/tests/usr.bin/make/unit-tests
 ./usr/tests/usr.bin/mixerctl
 ./usr/tests/usr.bin/mkdep
+./usr/tests/usr.bin/mtree
 ./usr/tests/usr.bin/nbperf
 ./usr/tests/usr.bin/netpgpverify
 ./usr/tests/usr.bin/patch

Index: src/tests/usr.bin/Makefile
diff -u src/tests/usr.bin/Makefile:1.38 src/tests/usr.bin/Makefile:1.39
--- src/tests/usr.bin/Makefile:1.38	Sat Aug 26 10:06:16 2023
+++ src/tests/usr.bin/Makefile	Thu Jan 25 00:30:57 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.38 2023/08/26 10:06:16 rillig Exp $
+#	$NetBSD: Makefile,v 1.39 2024/01/25 00:30:57 riastradh Exp $
 #
 
 .include 
@@ -7,7 +7,7 @@ TESTSDIR=   ${TESTSBASE}/usr.bin
 
 TESTS_SUBDIRS=	awk basename bzip2 cc cmp compress config cpio col cut \
 		diff dirname error find fstat gdb grep gzip id indent \
-		infocmp jot ld locale m4 make mixerctl mkdep nbperf \
+		infocmp jot ld locale m4 make mixerctl mkdep mtree nbperf \
 		netpgpverify patch pkill pr printf pwhash realpath rump_server \
 		shmif_dumpbus sdiff sed sort tar tmux tr unifdef uniq \
 		vmstat xlint ztest

Added files:

Index: src/tests/usr.bin/mtree/Makefile
diff -u /dev/null src/tests/usr.bin/mtree/Makefile:1.1
--- /dev/null	Thu Jan 25 00:30:58 2024
+++ src/tests/usr.bin/mtree/Makefile	Thu Jan 25 00:30:57 2024
@@ -0,0 +1,8 @@
+#	$NetBSD: Makefile,v 1.1 2024/01/25 00:30:57 riastradh Exp $
+#
+
+TESTSDIR=	${TESTSBASE}/usr.bin/mtree
+
+TESTS_SH+=	t_sets
+
+.include 
Index: src/tests/usr.bin/mtree/t_sets.sh
diff -u /dev/null src/tests/usr.bin/mtree/t_sets.sh:1.1
--- /dev/null	Thu Jan 25 00:30:58 2024
+++ src/tests/usr.bin/mtree/t_sets.sh	Thu Jan 25 00:30:57 2024
@@ -0,0 +1,92 @@
+#	$NetBSD: t_sets.sh,v 1.1 2024/01/25 00:30:57 riastradh Exp $
+#
+# Copyright (c) 2024 The NetBSD Foundation, Inc.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#notice, this list of conditions and the following disclaimer in the
+#documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED

CVS commit: src

2024-01-24 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Thu Jan 25 00:30:58 UTC 2024

Modified Files:
src/distrib/sets/lists/tests: mi
src/etc/mtree: NetBSD.dist.tests
src/tests/usr.bin: Makefile
Added Files:
src/tests/usr.bin/mtree: Makefile t_sets.sh

Log Message:
mtree(8): Test the installed sets.

Except etc and xetc, which likely won't match for reasons that aren't
great, like etc including empty log files which in an installed
system have probably changed.

This test will probably fail, but we should make sure it doesn't!

PR misc/57877


To generate a diff of this commit:
cvs rdiff -u -r1.1299 -r1.1300 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.201 -r1.202 src/etc/mtree/NetBSD.dist.tests
cvs rdiff -u -r1.38 -r1.39 src/tests/usr.bin/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/usr.bin/mtree/Makefile \
src/tests/usr.bin/mtree/t_sets.sh

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



CVS commit: src

2024-01-24 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Wed Jan 24 21:53:35 UTC 2024

Modified Files:
src/distrib/utils/embedded/files: evbppc_wii_meta.xml
src/sys/arch/evbppc/include: wii.h
src/sys/arch/evbppc/wii: autoconf.c machdep.c wii_locore.S

Log Message:
wii: Add support for passing boot options to the kernel.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/distrib/utils/embedded/files/evbppc_wii_meta.xml
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/evbppc/include/wii.h
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/evbppc/wii/autoconf.c \
src/sys/arch/evbppc/wii/wii_locore.S
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/evbppc/wii/machdep.c

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



CVS commit: src

2024-01-24 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Wed Jan 24 21:53:35 UTC 2024

Modified Files:
src/distrib/utils/embedded/files: evbppc_wii_meta.xml
src/sys/arch/evbppc/include: wii.h
src/sys/arch/evbppc/wii: autoconf.c machdep.c wii_locore.S

Log Message:
wii: Add support for passing boot options to the kernel.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/distrib/utils/embedded/files/evbppc_wii_meta.xml
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/evbppc/include/wii.h
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/evbppc/wii/autoconf.c \
src/sys/arch/evbppc/wii/wii_locore.S
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/evbppc/wii/machdep.c

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

Modified files:

Index: src/distrib/utils/embedded/files/evbppc_wii_meta.xml
diff -u src/distrib/utils/embedded/files/evbppc_wii_meta.xml:1.1 src/distrib/utils/embedded/files/evbppc_wii_meta.xml:1.2
--- src/distrib/utils/embedded/files/evbppc_wii_meta.xml:1.1	Sat Jan 20 21:35:59 2024
+++ src/distrib/utils/embedded/files/evbppc_wii_meta.xml	Wed Jan 24 21:53:34 2024
@@ -6,5 +6,8 @@
   
   Free Unix-like operating system.
   NetBSD is a free, fast, secure, and highly portable Unix-like Open Source operating system.
+  
+root=ld0
+  
   
 

Index: src/sys/arch/evbppc/include/wii.h
diff -u src/sys/arch/evbppc/include/wii.h:1.5 src/sys/arch/evbppc/include/wii.h:1.6
--- src/sys/arch/evbppc/include/wii.h:1.5	Tue Jan 23 21:48:12 2024
+++ src/sys/arch/evbppc/include/wii.h	Wed Jan 24 21:53:34 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: wii.h,v 1.5 2024/01/23 21:48:12 jmcneill Exp $ */
+/* $NetBSD: wii.h,v 1.6 2024/01/24 21:53:34 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2024 Jared McNeill 
@@ -125,6 +125,15 @@
 #define GPIO_SHUTDOWN			1
 #define GPIO_SLOT_LED			5
 
+/* Command line protocol */
+#define WII_ARGV_MAGIC			0x5f617267
+struct wii_argv {
+	uint32_t	magic;
+	uint32_t	cmdline;
+	uint32_t	length;
+	uint32_t	unused[3];
+};
+
 /* Blink the slot LED forever at the specified interval. */
 static inline void __dead
 wii_slot_led_blink(u_int interval_us)

Index: src/sys/arch/evbppc/wii/autoconf.c
diff -u src/sys/arch/evbppc/wii/autoconf.c:1.1 src/sys/arch/evbppc/wii/autoconf.c:1.2
--- src/sys/arch/evbppc/wii/autoconf.c:1.1	Sat Jan 20 21:36:00 2024
+++ src/sys/arch/evbppc/wii/autoconf.c	Wed Jan 24 21:53:34 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: autoconf.c,v 1.1 2024/01/20 21:36:00 jmcneill Exp $	*/
+/*	$NetBSD: autoconf.c,v 1.2 2024/01/24 21:53:34 jmcneill Exp $	*/
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -44,7 +44,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.1 2024/01/20 21:36:00 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.2 2024/01/24 21:53:34 jmcneill Exp $");
 
 #include 
 #include 
@@ -53,19 +53,25 @@ __KERNEL_RCSID(0, "$NetBSD: autoconf.c,v
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
+#include 
+
 void findroot(void);
 void disable_intr(void);
 void enable_intr(void);
 
+static void parse_cmdline(void);
+
 /*
  * Determine i/o configuration for a machine.
  */
 void
 cpu_configure(void)
 {
+	parse_cmdline();
 
 	if (config_rootfound("mainbus", NULL) == NULL)
 		panic("configure: mainbus not configured");
@@ -87,21 +93,40 @@ cpu_rootconf(void)
 void
 findroot(void)
 {
-	device_t dev;
-
-	if (booted_device != NULL) {
-		return;
-	}
+}
 
-	if ((dev = device_find_by_driver_unit("ld", 0)) != NULL) {
+void
+device_register(device_t dev, void *aux)
+{
+	if (bootspec != NULL && strcmp(device_xname(dev), bootspec) == 0) {
 		booted_device = dev;
 		booted_partition = 0;
-		return;
 	}
 }
 
-void
-device_register(device_t dev, void *aux)
+static void
+parse_cmdline(void)
 {
-	/* do nothing */
+	static char bootspec_buf[64];
+	extern char wii_cmdline[];
+	const char *cmdline = wii_cmdline;
+
+	while (*cmdline != '\0') {
+		const char *cp = cmdline;
+
+		if (*cp == '-') {
+			for (cp++; *cp != '\0'; cp++) {
+BOOT_FLAG(*cp, boothowto);
+			}
+		} else if (strncmp(cp, "root=", 5) == 0) {
+			snprintf(bootspec_buf, sizeof(bootspec_buf), "%s",
+			cp + 5);
+			if (bootspec_buf[0] != '\0') {
+bootspec = bootspec_buf;
+booted_method = "bootinfo/rootdevice";
+			}
+		}
+
+		cmdline += strlen(cmdline) + 1;
+	}
 }
Index: src/sys/arch/evbppc/wii/wii_locore.S
diff -u src/sys/arch/evbppc/wii/wii_locore.S:1.1 src/sys/arch/evbppc/wii/wii_locore.S:1.2
--- src/sys/arch/evbppc/wii/wii_locore.S:1.1	Sat Jan 20 21:36:00 2024
+++ src/sys/arch/evbppc/wii/wii_locore.S	Wed Jan 24 21:53:34 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: wii_locore.S,v 1.1 2024/01/20 21:36:00 jmcneill Exp $	*/
+/*	$NetBSD: wii_locore.S,v 1.2 2024/01/24 21:53:34 jmcneill Exp $	*/
 /*	$OpenBSD: locore.S,v 1.4 1997/01/26 09:06:38 rahnds Exp $	*/
 
 /*
@@ -34,8 +34,6 @@
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
-#include "opt_multiprocessor.h"
-#include "opt_openpic.h"
 #include "opt_ppcparam.h"
 

CVS commit: src/doc

2024-01-24 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Wed Jan 24 21:04:09 UTC 2024

Modified Files:
src/doc: 3RDPARTY

Log Message:
space -> tab cleanup


To generate a diff of this commit:
cvs rdiff -u -r1.1978 -r1.1979 src/doc/3RDPARTY

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



CVS commit: src/doc

2024-01-24 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Wed Jan 24 21:04:09 UTC 2024

Modified Files:
src/doc: 3RDPARTY

Log Message:
space -> tab cleanup


To generate a diff of this commit:
cvs rdiff -u -r1.1978 -r1.1979 src/doc/3RDPARTY

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.1978 src/doc/3RDPARTY:1.1979
--- src/doc/3RDPARTY:1.1978	Wed Jan 24 20:06:40 2024
+++ src/doc/3RDPARTY	Wed Jan 24 21:04:08 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.1978 2024/01/24 20:06:40 wiz Exp $
+#	$NetBSD: 3RDPARTY,v 1.1979 2024/01/24 21:04:08 wiz Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -365,16 +365,16 @@ Notes:
 Please submit all changes upstream.
 Import using the import-src make target.
 
-Package:   drm
-Version:   Linux 3.15
-Current Vers:  ?
-Maintainer:Intel, AMD, Linux kernel developers
-Archive Site:  git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
-Home Page: http://dri.freedesktop.org/
-Mailing List:  dri-de...@lists.freedesktop.org
-Responsible:   riastradh
-License:   BSD
-Location:  sys/external/bsd/drm2/dist
+Package:	drm
+Version:	Linux 3.15
+Current Vers:	?
+Maintainer:	Intel, AMD, Linux kernel developers
+Archive Site:	git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
+Home Page:	http://dri.freedesktop.org/
+Mailing List:	dri-de...@lists.freedesktop.org
+Responsible:	riastradh
+License:	BSD
+Location:	sys/external/bsd/drm2/dist
 Notes:
 Graphics drivers.   Talk to riastradh@ about updates.  When importing
 from Linux, we map
@@ -1658,39 +1658,39 @@ Responsible:	christos
 License:	BSD-like (2-clause)
 Location:	usr.bin/timeout
 
-Package:libproc
-Version:FreeBSD-2015-09-24
-Current Vers:   FreeBSD-2018-07-27 r336782
-Maintainer: Rui Paulo 
-Archive Site:   none
-Home Page:  https://svnweb.freebsd.org/base/head/lib/libproc/
-Mailing List:   none
-Responsible:christos
-License:BSD-like (2-clause)
-Location:   external/bsd/libproc/dist
-
-Package:librtld_db
-Version:FreeBSD-2015-09-24
-Current Vers:   FreeBSD-2017-11-26 r326219
-Maintainer: Rui Paulo 
-Archive Site:   none
-Home Page:  https://svnweb.freebsd.org/base/head/lib/librtld_db/
-Mailing List:   none
-Responsible:christos
-License:BSD-like (2-clause)
-Location:   external/bsd/librtld_db/dist
-
-Package:netcat
-Version:OpenBSD-2017-02-06
-Current Vers:   OpenBSD-2020-02-12
-Maintainer: OpenBSD
-Archive Site:   http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/usr.bin/nc/
-Home Page:  none
-Date:		2020-06-13
-Mailing List:   none
-Responsible:christos
-License:BSD-like (3-clause)
-Location:   usr.bin/nc
+Package:	libproc
+Version:	FreeBSD-2015-09-24
+Current Vers:	FreeBSD-2018-07-27 r336782
+Maintainer:	Rui Paulo 
+Archive Site:	none
+Home Page:	https://svnweb.freebsd.org/base/head/lib/libproc/
+Mailing List:	none
+Responsible:	christos
+License:	BSD-like (2-clause)
+Location:	external/bsd/libproc/dist
+
+Package:	librtld_db
+Version:	FreeBSD-2015-09-24
+Current Vers:	FreeBSD-2017-11-26 r326219
+Maintainer:	Rui Paulo 
+Archive Site:	none
+Home Page:	https://svnweb.freebsd.org/base/head/lib/librtld_db/
+Mailing List:	none
+Responsible:	christos
+License:	BSD-like (2-clause)
+Location:	external/bsd/librtld_db/dist
+
+Package:	netcat
+Version:	OpenBSD-2017-02-06
+Current Vers:	OpenBSD-2020-02-12
+Maintainer:	OpenBSD
+Archive Site:	http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/usr.bin/nc/
+Home Page:	none
+Date:		2020-06-13
+Mailing List:	none
+Responsible:	christos
+License:	BSD-like (3-clause)
+Location:	usr.bin/nc
 
 Package:	gnu-efi
 Version:	3.0.14
@@ -2009,7 +2009,7 @@ Package:	tigon
 Version:	12.4.11
 Current Vers:
 Maintainer:	wp...@brak.osd.bsdi.com
-Archive Site:   https://people.freebsd.org/~wpaul/Alteon/
+Archive Site:	https://people.freebsd.org/~wpaul/Alteon/
 Home Page:	http://www.alteon.com/support/openkits (extinct)
 Mailing List:
 License:	Alteon WebSystems, Inc.



CVS commit: src/doc

2024-01-24 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Wed Jan 24 20:06:40 UTC 2024

Modified Files:
src/doc: 3RDPARTY

Log Message:
zlib-1.3.1 out


To generate a diff of this commit:
cvs rdiff -u -r1.1977 -r1.1978 src/doc/3RDPARTY

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.1977 src/doc/3RDPARTY:1.1978
--- src/doc/3RDPARTY:1.1977	Mon Jan 22 14:33:26 2024
+++ src/doc/3RDPARTY	Wed Jan 24 20:06:40 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.1977 2024/01/22 14:33:26 wiz Exp $
+#	$NetBSD: 3RDPARTY,v 1.1978 2024/01/24 20:06:40 wiz Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -1465,7 +1465,7 @@ See /usr/src/external/bsd/wpa/NetBSD-upg
 
 Package:	zlib
 Version:	1.2.13
-Current Vers:	1.3
+Current Vers:	1.3.1
 Maintainer:	Jean-loup Gailly and Mark Adler 
 Archive Site:	http://www.zlib.net/
 Home Page:	http://www.zlib.net/



CVS commit: src/doc

2024-01-24 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Wed Jan 24 20:06:40 UTC 2024

Modified Files:
src/doc: 3RDPARTY

Log Message:
zlib-1.3.1 out


To generate a diff of this commit:
cvs rdiff -u -r1.1977 -r1.1978 src/doc/3RDPARTY

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



CVS commit: src/sys/kern

2024-01-24 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Jan 24 16:11:48 UTC 2024

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

Log Message:
Unbreak sched_m2 (died because lwp_eproc() KASSERT in DIAGNOSTIC) and explain
what is going on. This has been broken since the introduction of l_mutex
5 months ago.


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/sys/kern/sched_m2.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/sched_m2.c
diff -u src/sys/kern/sched_m2.c:1.39 src/sys/kern/sched_m2.c:1.40
--- src/sys/kern/sched_m2.c:1.39	Sat May 23 17:24:41 2020
+++ src/sys/kern/sched_m2.c	Wed Jan 24 11:11:48 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: sched_m2.c,v 1.39 2020/05/23 21:24:41 ad Exp $	*/
+/*	$NetBSD: sched_m2.c,v 1.40 2024/01/24 16:11:48 christos Exp $	*/
 
 /*
  * Copyright (c) 2007, 2008 Mindaugas Rasiukevicius 
@@ -33,7 +33,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sched_m2.c,v 1.39 2020/05/23 21:24:41 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sched_m2.c,v 1.40 2024/01/24 16:11:48 christos Exp $");
 
 #include 
 
@@ -91,14 +91,22 @@ sched_rqinit(void)
 	sched_rrticks = mstohz(100);			/* ~100 ms */
 	sched_precalcts();
 
-#ifdef notdef
+#ifdef notyet
 	/* Need to set the name etc. This does not belong here */
 	/* Attach the primary CPU here */
 	sched_cpuattach(curcpu());
 #endif
 
 	sched_lwp_fork(NULL, );
+#ifdef notyet
+	/* without attaching the primary CPU l_mutex does not get initialized */
+	lwp_lock();
 	sched_newts();
+	lwp_unlock();
+#else
+	/* gross */
+	lwp0.l_sched.timeslice = ts_map[lwp0.l_auxprio];
+#endif
 }
 
 /* Pre-calculate the time-slices for the priorities */



CVS commit: src/sys/kern

2024-01-24 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Jan 24 16:11:48 UTC 2024

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

Log Message:
Unbreak sched_m2 (died because lwp_eproc() KASSERT in DIAGNOSTIC) and explain
what is going on. This has been broken since the introduction of l_mutex
5 months ago.


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/sys/kern/sched_m2.c

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