CVS commit: src/sbin/ifconfig

2024-04-07 Thread Shoichi YAMAGUCHI
Module Name:src
Committed By:   yamaguchi
Date:   Mon Apr  8 04:29:52 UTC 2024

Modified Files:
src/sbin/ifconfig: ifconfig.8

Log Message:
Added documents about parameters related to lagg(4)

PR misc/58125


To generate a diff of this commit:
cvs rdiff -u -r1.125 -r1.126 src/sbin/ifconfig/ifconfig.8

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

Modified files:

Index: src/sbin/ifconfig/ifconfig.8
diff -u src/sbin/ifconfig/ifconfig.8:1.125 src/sbin/ifconfig/ifconfig.8:1.126
--- src/sbin/ifconfig/ifconfig.8:1.125	Sun Mar 26 01:04:16 2023
+++ src/sbin/ifconfig/ifconfig.8	Mon Apr  8 04:29:52 2024
@@ -1,4 +1,4 @@
-.\"	$NetBSD: ifconfig.8,v 1.125 2023/03/26 01:04:16 mlelstv Exp $
+.\"	$NetBSD: ifconfig.8,v 1.126 2024/04/08 04:29:52 yamaguchi Exp $
 .\"
 .\" Copyright (c) 1983, 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -614,6 +614,40 @@ Remove
 from the
 .Xr agr 4
 interface.
+.It Cm laggport Ar interface Oo Cm pri Ar n Oc
+Add the interface named by
+.Ar interface
+as a port of the
+.Xr lagg 4
+interface,
+and set the priority of
+.Ar interface
+to
+.Ar n .
+.It Cm -laggport Ar interface
+Remove the interface named by
+.Ar interface
+from the
+.Xr lagg 4
+interface.
+.It Cm laggproto Ar proto
+Set the aggregation protocol of
+.Xr lagg 4 .
+The default is
+.Li none .
+The available options are
+.Li failover ,
+.Li lacp ,
+.Li loadbalance ,
+and
+.Li none .
+.It Cm laggportpri Ar interface Ar n
+If the interface id a
+.Xr lagg 4
+pseudo-interface, set the priority of
+.Ar interface
+to
+.Ar n
 .It Cm eee
 Enable IEEE 802.3az Energy Efficiency Ethernet function.
 .It Cm -eee
@@ -899,6 +933,7 @@ tried to alter an interface's configurat
 .Sh SEE ALSO
 .Xr netstat 1 ,
 .Xr agr 4 ,
+.Xr lagg 4 ,
 .Xr carp 4 ,
 .Xr ifmedia 4 ,
 .Xr netintro 4 ,



CVS commit: src/sbin/ifconfig

2024-04-07 Thread Shoichi YAMAGUCHI
Module Name:src
Committed By:   yamaguchi
Date:   Mon Apr  8 04:29:52 UTC 2024

Modified Files:
src/sbin/ifconfig: ifconfig.8

Log Message:
Added documents about parameters related to lagg(4)

PR misc/58125


To generate a diff of this commit:
cvs rdiff -u -r1.125 -r1.126 src/sbin/ifconfig/ifconfig.8

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



Re: CVS commit: src/lib/libutil

2024-04-07 Thread Valery Ushakov
On Sun, Apr 07, 2024 at 14:28:27 +, Roland Illig wrote:

> Log Message:
> snprintb.3: clean up formatting and wording, prefer octal in examples
> 
> Using hexadecimal character escapes requires separate string literals if
> the description starts with one of the letters A-F; octal character
> escapes have at most 3 digits, reducing ambiguity.

70s are over, very few people speak octal fluently.  If anything, the
man page should highlight the potential snag.  Besides, separate
literal for the name is good for readability anyway.

Please, revert.

-uwe


CVS commit: src/sbin/ifconfig

2024-04-07 Thread Shoichi YAMAGUCHI
Module Name:src
Committed By:   yamaguchi
Date:   Mon Apr  8 00:50:49 UTC 2024

Modified Files:
src/sbin/ifconfig: lagg.c

Log Message:
lagg(4): fix missing initialization of the number of array

pointed out by martin@, thanks.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sbin/ifconfig/lagg.c

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



CVS commit: src/sbin/ifconfig

2024-04-07 Thread Shoichi YAMAGUCHI
Module Name:src
Committed By:   yamaguchi
Date:   Mon Apr  8 00:50:49 UTC 2024

Modified Files:
src/sbin/ifconfig: lagg.c

Log Message:
lagg(4): fix missing initialization of the number of array

pointed out by martin@, thanks.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sbin/ifconfig/lagg.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/ifconfig/lagg.c
diff -u src/sbin/ifconfig/lagg.c:1.6 src/sbin/ifconfig/lagg.c:1.7
--- src/sbin/ifconfig/lagg.c:1.6	Thu Apr  4 08:01:55 2024
+++ src/sbin/ifconfig/lagg.c	Mon Apr  8 00:50:49 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: lagg.c,v 1.6 2024/04/04 08:01:55 yamaguchi Exp $	*/
+/*	$NetBSD: lagg.c,v 1.7 2024/04/08 00:50:49 yamaguchi Exp $	*/
 
 /*
  * Copyright (c) 2021 Internet Initiative Japan Inc.
@@ -28,7 +28,7 @@
 
 #include 
 #if !defined(lint)
-__RCSID("$NetBSD: lagg.c,v 1.6 2024/04/04 08:01:55 yamaguchi Exp $");
+__RCSID("$NetBSD: lagg.c,v 1.7 2024/04/08 00:50:49 yamaguchi Exp $");
 #endif /* !defined(lint) */
 
 #include 
@@ -413,6 +413,7 @@ setlaggport(prop_dictionary_t env, prop_
 	memset(&_req, 0, sizeof(_req));
 	req = (struct lagg_req *)&_req;
 	rp = >lrq_reqports[0];
+	req->lrq_nports = 1;
 
 	strlcpy(rp->rp_portname, ifname, sizeof(rp->rp_portname));
 	ioc = LAGGIOC_NOCMD;



CVS commit: src/sys/arch/riscv/riscv

2024-04-07 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Apr  7 22:59:13 UTC 2024

Modified Files:
src/sys/arch/riscv/riscv: clock_machdep.c

Log Message:
riscv: Schedule next hardclock tick in the future, not the past.

If we have missed hardclock ticks, schedule up to one tick interval
in the future anyway; don't try to play hardclock catchup by
scheduling for when the next hardclock tick _should_ have been, in
the past, leading to ticking as fast as possible until we've caught
up.  as fast as possible until we've caught up.

Playing hardclock catchup triggers heartbeat panics when continuing
from ddb, if you've been in ddb for >15sec.  Other hardclock drivers
like x86 lapic don't play hardclock catchup either.

PR kern/57920


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/riscv/riscv/clock_machdep.c

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

Modified files:

Index: src/sys/arch/riscv/riscv/clock_machdep.c
diff -u src/sys/arch/riscv/riscv/clock_machdep.c:1.7 src/sys/arch/riscv/riscv/clock_machdep.c:1.8
--- src/sys/arch/riscv/riscv/clock_machdep.c:1.7	Thu Jan 18 07:41:50 2024
+++ src/sys/arch/riscv/riscv/clock_machdep.c	Sun Apr  7 22:59:13 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: clock_machdep.c,v 1.7 2024/01/18 07:41:50 skrll Exp $	*/
+/*	$NetBSD: clock_machdep.c,v 1.8 2024/04/07 22:59:13 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include 
 
-__RCSID("$NetBSD: clock_machdep.c,v 1.7 2024/01/18 07:41:50 skrll Exp $");
+__RCSID("$NetBSD: clock_machdep.c,v 1.8 2024/04/07 22:59:13 riastradh Exp $");
 
 #include 
 #include 
@@ -124,6 +124,10 @@ riscv_timer_intr(void *arg)
 	ci->ci_ev_timer.ev_count++;
 
 	ci->ci_lastintr_scheduled += timer_ticks_per_hz;
+	while (__predict_false(ci->ci_lastintr_scheduled < now)) {
+		ci->ci_lastintr_scheduled += timer_ticks_per_hz;
+		/* XXX count missed timer interrupts */
+	}
 	sbi_set_timer(ci->ci_lastintr_scheduled);
 
 	hardclock(cf);



CVS commit: src/sys/arch/riscv/riscv

2024-04-07 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Apr  7 22:59:13 UTC 2024

Modified Files:
src/sys/arch/riscv/riscv: clock_machdep.c

Log Message:
riscv: Schedule next hardclock tick in the future, not the past.

If we have missed hardclock ticks, schedule up to one tick interval
in the future anyway; don't try to play hardclock catchup by
scheduling for when the next hardclock tick _should_ have been, in
the past, leading to ticking as fast as possible until we've caught
up.  as fast as possible until we've caught up.

Playing hardclock catchup triggers heartbeat panics when continuing
from ddb, if you've been in ddb for >15sec.  Other hardclock drivers
like x86 lapic don't play hardclock catchup either.

PR kern/57920


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/riscv/riscv/clock_machdep.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/riscv/riscv

2024-04-07 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Apr  7 22:52:53 UTC 2024

Modified Files:
src/sys/arch/riscv/riscv: cpu.c

Log Message:
riscv: Make sure cpu0->ci_cpu_freq is initialized by cpu_attach.

Otherwise this stays zero, which screws up cpu_ipi_wait.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/riscv/riscv/cpu.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/riscv/riscv/cpu.c
diff -u src/sys/arch/riscv/riscv/cpu.c:1.5 src/sys/arch/riscv/riscv/cpu.c:1.6
--- src/sys/arch/riscv/riscv/cpu.c:1.5	Sun Sep  3 08:48:20 2023
+++ src/sys/arch/riscv/riscv/cpu.c	Sun Apr  7 22:52:53 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.c,v 1.5 2023/09/03 08:48:20 skrll Exp $	*/
+/*	$NetBSD: cpu.c,v 1.6 2024/04/07 22:52:53 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2023 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
 #include "opt_multiprocessor.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.5 2023/09/03 08:48:20 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.6 2024/04/07 22:52:53 riastradh Exp $");
 
 #include 
 
@@ -184,6 +184,7 @@ cpu_attach(device_t dv, cpuid_t hartid)
 		ci = curcpu();
 		KASSERTMSG(ci == _info_store[0], "ci %p", ci);
 		ci->ci_cpuid = hartid;
+		ci->ci_cpu_freq = riscv_timer_frequency_get();
 	} else {
 #ifdef MULTIPROCESSOR
 		if ((boothowto & RB_MD1) != 0) {



CVS commit: src/sys/arch/riscv/riscv

2024-04-07 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Apr  7 22:52:53 UTC 2024

Modified Files:
src/sys/arch/riscv/riscv: cpu.c

Log Message:
riscv: Make sure cpu0->ci_cpu_freq is initialized by cpu_attach.

Otherwise this stays zero, which screws up cpu_ipi_wait.


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

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



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

2024-04-07 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Sun Apr  7 21:33:12 UTC 2024

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

Log Message:
Revert last, unbreak build.   Unless the bind Makefiles start installing
a /var/run/named file (which in general would be wrong, as most sites run
named in a chroot these days) the file is obsolete, and should not, and
does not, get generated by the build, nor should it be included in any
sets.

Ideally we'd have an "optional" flag for the sets files, to allow them
to mention files that might exist, and don't matter (and are not included
in the sets), but that's a bigger change than is needed just to fix the
builds.


To generate a diff of this commit:
cvs rdiff -u -r1.1340 -r1.1341 src/distrib/sets/lists/base/mi

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

Modified files:

Index: src/distrib/sets/lists/base/mi
diff -u src/distrib/sets/lists/base/mi:1.1340 src/distrib/sets/lists/base/mi:1.1341
--- src/distrib/sets/lists/base/mi:1.1340	Sun Apr  7 15:02:08 2024
+++ src/distrib/sets/lists/base/mi	Sun Apr  7 21:33:12 2024
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1340 2024/04/07 15:02:08 christos Exp $
+# $NetBSD: mi,v 1.1341 2024/04/07 21:33:12 kre Exp $
 #
 # Note:	Don't delete entries from here - mark them as "obsolete" instead,
 #	unless otherwise stated below.
@@ -6377,7 +6377,7 @@
 ./var/quotas	base-util-root
 ./var/run	base-sys-root
 ./var/run/lwresdbase-obsolete		obsolete
-./var/run/named	base-bind-root
+./var/run/named	base-obsolete		obsolete
 ./var/rwho	base-netutil-root
 ./var/shm	base-sys-root
 ./var/spool	base-sys-root



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

2024-04-07 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Sun Apr  7 21:33:12 UTC 2024

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

Log Message:
Revert last, unbreak build.   Unless the bind Makefiles start installing
a /var/run/named file (which in general would be wrong, as most sites run
named in a chroot these days) the file is obsolete, and should not, and
does not, get generated by the build, nor should it be included in any
sets.

Ideally we'd have an "optional" flag for the sets files, to allow them
to mention files that might exist, and don't matter (and are not included
in the sets), but that's a bigger change than is needed just to fix the
builds.


To generate a diff of this commit:
cvs rdiff -u -r1.1340 -r1.1341 src/distrib/sets/lists/base/mi

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



CVS commit: src/sys/arch/evbmips/conf

2024-04-07 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Sun Apr  7 19:51:49 UTC 2024

Modified Files:
src/sys/arch/evbmips/conf: README.evbmips

Log Message:
Remove extra whitespace after P-4032.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/evbmips/conf/README.evbmips

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/evbmips/conf/README.evbmips
diff -u src/sys/arch/evbmips/conf/README.evbmips:1.1 src/sys/arch/evbmips/conf/README.evbmips:1.2
--- src/sys/arch/evbmips/conf/README.evbmips:1.1	Sun Apr  7 19:39:24 2024
+++ src/sys/arch/evbmips/conf/README.evbmips	Sun Apr  7 19:51:49 2024
@@ -1,4 +1,4 @@
-$NetBSD: README.evbmips,v 1.1 2024/04/07 19:39:24 andvar Exp $
+$NetBSD: README.evbmips,v 1.2 2024/04/07 19:51:49 andvar Exp $
 
 The documentation is not final, more updates are coming.
 
@@ -29,7 +29,7 @@ MIPSSIM64	2021/01/27	evbmips(n)64-el,eb	
 MTX-1		2006/02/23	evbmips-el		4G Systems MTX-1 (MeshCube / AccessCube, Alchemy Au1500).
 OCTEON		2015/04/29	evbmips(n)64-eb		Cavium Octeon and Octeon Plus SoC based devices like Ubiquiti Networks EdgeRouter Lite.
 OMSAL400	2006/02/23	evbmips-el		Plat'Home OpenMicroServer (OMS-AL400, Alchemy Au1550).
-P4032		2001/06/01	evbmips-el		Algorithmics MIPS P-4032  evaluation board (QED RM4xxx).
+P4032		2001/06/01	evbmips-el		Algorithmics MIPS P-4032 evaluation board (QED RM4xxx).
 P5064		2001/05/28	evbmips-el		Algorithmics MIPS P-5064 evaluation board (QED RM52xx).
 P5064-64	2009/12/14	evbmips(n)64-el		P5064 64-bit kernel configuration.
 P6032		2001/06/22	evbmips-el		Algorithmics MIPS P-6032 evaluation board.



CVS commit: src/sys/arch/evbmips/conf

2024-04-07 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Sun Apr  7 19:51:49 UTC 2024

Modified Files:
src/sys/arch/evbmips/conf: README.evbmips

Log Message:
Remove extra whitespace after P-4032.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/evbmips/conf/README.evbmips

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



CVS commit: src/sys/arch/evbmips/conf

2024-04-07 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Sun Apr  7 19:39:24 UTC 2024

Added Files:
src/sys/arch/evbmips/conf: README.evbmips

Log Message:
Initial version of evbmips kernel configuration files documentation.
The goal is to give a better understanding which hardware they represent
and how to build them. Also not to lose this information over the years.

Loosely based on a README.evbarm, however has additional notes on building
targets. The file is not final, some discussion came up about the need of
*32 kernel configs. simon is planning to review.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/arch/evbmips/conf/README.evbmips

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

Added files:

Index: src/sys/arch/evbmips/conf/README.evbmips
diff -u /dev/null src/sys/arch/evbmips/conf/README.evbmips:1.1
--- /dev/null	Sun Apr  7 19:39:24 2024
+++ src/sys/arch/evbmips/conf/README.evbmips	Sun Apr  7 19:39:24 2024
@@ -0,0 +1,64 @@
+$NetBSD: README.evbmips,v 1.1 2024/04/07 19:39:24 andvar Exp $
+
+The documentation is not final, more updates are coming.
+
+config		date		targets			boards
+-
+ADM5210		2007/03/20	evbmips-el		Infineon ADM5120 (MIPS32 4Kc) based boards and routers, 
+			including RouterBOARD 100 series.
+ADM5210-NB	2007/03/20	evbmips-el		ADM5120 netboot kernel.
+ADM5210-USB	2007/03/20	evbmips-el		ADM5120 netboot kernel with USB support.
+AP30		2006/06/06	evbmips-el,eb		Atheros AP30 development board (AR5312).
+CI20		2014/11/22	evbmips-eb		MIPS Creator CI20 (Ingenic JZ4780).
+CPMBR1400	2011/07/28	evbmips-el		CradlePoint MBR1400 Router (Ralink RT3883 MIPS74K).
+DB120		2011/07/07	evbmips-eb		Qualcomm Atheros AR9344 (MIPS74K) DB120 evaluation board.
+DBAU1500	2006/02/08	evbmips-el,eb		AMD Alchemy DBAu1500 evaluation board.
+DBAU1550	2006/02/08	evbmips-el,eb		AMD Alchemy DBAu1550 evaluation board.
+GDIUM		2009/08/06	evbmips-el		EMTEC Gdium netbook 32-bit kernel.
+GDIUM64		2011/08/24	evbmips(n)64-el		EMTEC Gdium netbook 64-bit kernel.
+LINKITSMART7688	2016/10/05	evbmips-el		Seeed Studio LinkIt Smart 7688 compact controller board (MediaTek MT7688).
+LOONGSON	2011/08/27	evbmips64-el		Loongson 2F/2E based devices (Lemote Fuloong, Yeelong).
+MALTA		2002/03/07	evbmips-el,eb		MIPS Malta evaluation board 4Kc (MIPS32) or 5Kc (MIPS64).
+MALTA32		2009/12/14	evbmips64-el,eb		MALTA N32 ABI kernel configuration.
+MALTA32.MP	2009/12/14	evbmips64-el,eb		MALTA N32 ABI MP kernel configuration.
+MALTA64		2009/12/14	evbmips(n)64-el,eb	MALTA 64-bit kernel configuration.
+MALTA64.MP	2009/12/14	evbmips(n)64-el,eb	MALTA MP 64-bit kernel configuration.
+MERAKI		2006/09/26	evbmips-eb		Meraki Mini (Atheros AR2315).
+MIPSSIM		2021/01/27	evbmips-el,eb		QEMU MIPS "mipssim" simulator.
+MIPSSIM64	2021/01/27	evbmips(n)64-el,eb	MIPSSIM 64-bit kernel.
+MTX-1		2006/02/23	evbmips-el		4G Systems MTX-1 (MeshCube / AccessCube, Alchemy Au1500).
+OCTEON		2015/04/29	evbmips(n)64-eb		Cavium Octeon and Octeon Plus SoC based devices like Ubiquiti Networks EdgeRouter Lite.
+OMSAL400	2006/02/23	evbmips-el		Plat'Home OpenMicroServer (OMS-AL400, Alchemy Au1550).
+P4032		2001/06/01	evbmips-el		Algorithmics MIPS P-4032  evaluation board (QED RM4xxx).
+P5064		2001/05/28	evbmips-el		Algorithmics MIPS P-5064 evaluation board (QED RM52xx).
+P5064-64	2009/12/14	evbmips(n)64-el		P5064 64-bit kernel configuration.
+P6032		2001/06/22	evbmips-el		Algorithmics MIPS P-6032 evaluation board.
+RB153		2007/03/20	evbmips-el		MikroTik RouterBOARD 153 (Infineon ADM5120).
+RB433UAH	2011/07/07	evbmips-eb		MikroTik RouterBOARD 433(UAH) AR71xx (MIPS24K core).
+SBMIPS		2002/03/06	evbmips-el,eb		Broadcom/SiByte SB1250 evaluation board.
+SBMIPS.MP	2011/02/20	evbmips-el,eb		SBMIPS MP kernel configuration.
+SBMIPS64	2009/12/14	evbmips(n)64-el,eb	SBMIPS 64-bit kernel configuration.
+SBMIPS64.MP	2011/02/20	evbmips(n)64-el,eb	SBMIPS 64-bit MP kernel configuration.
+WGT624V3	2007/02/18	evbmips-eb		Netgear WGT624 v3 wireless router (example config).
+XLSATX		2009/12/14RMI (NetLogic) XLS/XLR models (base for other XLSATX* kernel configs).
+XLSATX32	2011/02/20	evbmips64-el,eb		XLSATX N32 kernel configuration.
+XLSATX64	2009/12/14	evbmips(n)64-el,eb	XLSATX 64-bit kernel configuration.
+XLSATX64.MP	2011/02/20	evbmips(n)64-el,eb	XLSATX 64-bit MP kernel configuration.
+ZYXELKX		2014/04/30	evbmips-el		Zyxel Keenetic Extra router (MediaTek MT7620A).
+
+Configuration file notes:
+* "INSALL_*"	installation kernel configuration files.
+		(typically enables hooks for initializing the root memory-disk).
+* "*.MP"	configuration files with the multiprocessor support enabled.
+* "*32"		N32 ABI kernel configuration files
+		(can be built using evbmips64-* targets).
+Building target notes:
+* "*-el"	represent targets for building little-endian 

CVS commit: src/sys/arch/evbmips/conf

2024-04-07 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Sun Apr  7 19:39:24 UTC 2024

Added Files:
src/sys/arch/evbmips/conf: README.evbmips

Log Message:
Initial version of evbmips kernel configuration files documentation.
The goal is to give a better understanding which hardware they represent
and how to build them. Also not to lose this information over the years.

Loosely based on a README.evbarm, however has additional notes on building
targets. The file is not final, some discussion came up about the need of
*32 kernel configs. simon is planning to review.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/arch/evbmips/conf/README.evbmips

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



CVS commit: src/sys/arch

2024-04-07 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Apr  7 17:08:00 UTC 2024

Modified Files:
src/sys/arch/sparc/include: psl.h
src/sys/arch/sparc/sparc: memeccreg.h
src/sys/arch/sparc64/include: psl.h

Log Message:
sparc: fix typos and omissions in PSTATE_BITS and ECC_AFR_BITS

Fixes PR 57869.


To generate a diff of this commit:
cvs rdiff -u -r1.52 -r1.53 src/sys/arch/sparc/include/psl.h
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/sparc/sparc/memeccreg.h
cvs rdiff -u -r1.64 -r1.65 src/sys/arch/sparc64/include/psl.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

2024-04-07 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Apr  7 17:08:00 UTC 2024

Modified Files:
src/sys/arch/sparc/include: psl.h
src/sys/arch/sparc/sparc: memeccreg.h
src/sys/arch/sparc64/include: psl.h

Log Message:
sparc: fix typos and omissions in PSTATE_BITS and ECC_AFR_BITS

Fixes PR 57869.


To generate a diff of this commit:
cvs rdiff -u -r1.52 -r1.53 src/sys/arch/sparc/include/psl.h
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/sparc/sparc/memeccreg.h
cvs rdiff -u -r1.64 -r1.65 src/sys/arch/sparc64/include/psl.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/sparc/include/psl.h
diff -u src/sys/arch/sparc/include/psl.h:1.52 src/sys/arch/sparc/include/psl.h:1.53
--- src/sys/arch/sparc/include/psl.h:1.52	Tue Jul 11 13:10:08 2023
+++ src/sys/arch/sparc/include/psl.h	Sun Apr  7 17:08:00 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: psl.h,v 1.52 2023/07/11 13:10:08 martin Exp $ */
+/*	$NetBSD: psl.h,v 1.53 2024/04/07 17:08:00 rillig Exp $ */
 
 /*
  * Copyright (c) 1992, 1993
@@ -113,8 +113,11 @@
 #define PSTATE_IE	0x002	/* interrupt enable */
 #define PSTATE_AG	0x001	/* enable alternate globals */
 
-#define PSTATE_BITS "\20\14IG\13MG\12CLE\11TLE\10\7MM\6RED\5PEF\4AM\3PRIV\2IE\1AG"
-
+#define PSTATE_BITS "\177\020"		\
+	"b\013IG\0"	"b\012MG\0"	"b\011CLE\0"	"b\010TLE\0"	\
+			"F\006\002\0"	":\000MM_TSO\0"	":\001MM_PSO\0"	\
+	":\002MM_RMO\0"	"*?\0"		"b\005RED\0"	"b\004PEF\0"	\
+	"b\003AM\0"	"b\002PRIV\0"	"b\001IE\0"	"b\000AG\0"
 
 /*
  * 32-bit code requires TSO or at best PSO since that's what's supported on

Index: src/sys/arch/sparc/sparc/memeccreg.h
diff -u src/sys/arch/sparc/sparc/memeccreg.h:1.2 src/sys/arch/sparc/sparc/memeccreg.h:1.3
--- src/sys/arch/sparc/sparc/memeccreg.h:1.2	Mon Apr 28 20:23:36 2008
+++ src/sys/arch/sparc/sparc/memeccreg.h	Sun Apr  7 17:08:00 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: memeccreg.h,v 1.2 2008/04/28 20:23:36 martin Exp $	*/
+/*	$NetBSD: memeccreg.h,v 1.3 2024/04/07 17:08:00 rillig Exp $	*/
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -73,7 +73,7 @@
 #define ECC_AFR_S	0x0800	/* Access was in supervisor mode */
 #define ECC_AFR_MID	0xf000	/* Module code */
 #define ECC_AFR_BITS	"\177\020"\
-			"f\0\4VAH\0f\4\4TYPE\0f\10\3SIZE\0"	\
+			"f\0\4PAH\0f\4\4TYPE\0f\10\3SIZE\0"	\
 			"b\13C\0b\14LOCK\0b\15MBL\0"		\
 			"f\16\10VA\0b\33S\0f\34\4MID\0"
 

Index: src/sys/arch/sparc64/include/psl.h
diff -u src/sys/arch/sparc64/include/psl.h:1.64 src/sys/arch/sparc64/include/psl.h:1.65
--- src/sys/arch/sparc64/include/psl.h:1.64	Sat Sep  2 05:51:57 2023
+++ src/sys/arch/sparc64/include/psl.h	Sun Apr  7 17:08:00 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: psl.h,v 1.64 2023/09/02 05:51:57 jdc Exp $ */
+/*	$NetBSD: psl.h,v 1.65 2024/04/07 17:08:00 rillig Exp $ */
 
 /*
  * Copyright (c) 1992, 1993
@@ -129,7 +129,11 @@
 #define PSTATE_IE	0x002	/* interrupt enable */
 #define PSTATE_AG	0x001	/* enable alternate globals */
 
-#define PSTATE_BITS "\20\14IG\13MG\12CLE\11TLE\10\7MM\6RED\5PEF\4AM\3PRIV\2IE\1AG"
+#define PSTATE_BITS "\177\020"		\
+	"b\013IG\0"	"b\012MG\0"	"b\011CLE\0"	"b\010TLE\0"	\
+			"F\006\002\0"	":\000MM_TSO\0"	":\001MM_PSO\0"	\
+	":\002MM_RMO\0"	"*?\0"		"b\005RED\0"	"b\004PEF\0"	\
+	"b\003AM\0"	"b\002PRIV\0"	"b\001IE\0"	"b\000AG\0"
 
 
 /*



CVS commit: src

2024-04-07 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Apr  7 15:20:17 UTC 2024

Modified Files:
src/common/lib/libutil: snprintb.c
src/tests/lib/libutil: t_snprintb.c

Log Message:
snprintb: reject empty bit descriptions and wrongly placed defaults


To generate a diff of this commit:
cvs rdiff -u -r1.47 -r1.48 src/common/lib/libutil/snprintb.c
cvs rdiff -u -r1.34 -r1.35 src/tests/lib/libutil/t_snprintb.c

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

Modified files:

Index: src/common/lib/libutil/snprintb.c
diff -u src/common/lib/libutil/snprintb.c:1.47 src/common/lib/libutil/snprintb.c:1.48
--- src/common/lib/libutil/snprintb.c:1.47	Sun Apr  7 12:05:23 2024
+++ src/common/lib/libutil/snprintb.c	Sun Apr  7 15:20:16 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: snprintb.c,v 1.47 2024/04/07 12:05:23 rillig Exp $	*/
+/*	$NetBSD: snprintb.c,v 1.48 2024/04/07 15:20:16 rillig Exp $	*/
 
 /*-
  * Copyright (c) 2002, 2024 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
 
 #  include 
 #  if defined(LIBC_SCCS)
-__RCSID("$NetBSD: snprintb.c,v 1.47 2024/04/07 12:05:23 rillig Exp $");
+__RCSID("$NetBSD: snprintb.c,v 1.48 2024/04/07 15:20:16 rillig Exp $");
 #  endif
 
 #  include 
@@ -46,7 +46,7 @@ __RCSID("$NetBSD: snprintb.c,v 1.47 2024
 #  include 
 # else /* ! _KERNEL */
 #  include 
-__KERNEL_RCSID(0, "$NetBSD: snprintb.c,v 1.47 2024/04/07 12:05:23 rillig Exp $");
+__KERNEL_RCSID(0, "$NetBSD: snprintb.c,v 1.48 2024/04/07 15:20:16 rillig Exp $");
 #  include 
 #  include 
 #  include 
@@ -133,15 +133,17 @@ old_style(state *s)
 	while (*s->bitfmt != '\0') {
 		const char *cur_bitfmt = s->bitfmt;
 		uint8_t bit = *s->bitfmt;
-		if (bit > ' ')
+		if (bit > 32)
+			return -1;
+		if ((uint8_t)cur_bitfmt[1] <= 32)
 			return -1;
 		if (s->val & (1U << (bit - 1))) {
 			store_delimiter(s);
-			while ((uint8_t)*++s->bitfmt > ' ')
+			while ((uint8_t)*++s->bitfmt > 32)
 store(s, *s->bitfmt);
 			maybe_wrap_line(s, cur_bitfmt);
 		} else
-			while ((uint8_t)*++s->bitfmt > ' ')
+			while ((uint8_t)*++s->bitfmt > 32)
 continue;
 	}
 	return 0;
@@ -222,6 +224,7 @@ new_style(state *s)
 		case '*':
 			if (field_kind == 0)
 return -1;
+			field_kind = 0;
 			if (cur_bitfmt[1] == '\0')
 return -1;
 			s->bitfmt++;

Index: src/tests/lib/libutil/t_snprintb.c
diff -u src/tests/lib/libutil/t_snprintb.c:1.34 src/tests/lib/libutil/t_snprintb.c:1.35
--- src/tests/lib/libutil/t_snprintb.c:1.34	Sun Apr  7 12:05:23 2024
+++ src/tests/lib/libutil/t_snprintb.c	Sun Apr  7 15:20:17 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: t_snprintb.c,v 1.34 2024/04/07 12:05:23 rillig Exp $ */
+/* $NetBSD: t_snprintb.c,v 1.35 2024/04/07 15:20:17 rillig Exp $ */
 
 /*
  * Copyright (c) 2002, 2004, 2008, 2010, 2024 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
 #include 
 __COPYRIGHT("@(#) Copyright (c) 2008, 2010, 2024\
  The NetBSD Foundation, inc. All rights reserved.");
-__RCSID("$NetBSD: t_snprintb.c,v 1.34 2024/04/07 12:05:23 rillig Exp $");
+__RCSID("$NetBSD: t_snprintb.c,v 1.35 2024/04/07 15:20:17 rillig Exp $");
 
 #include 
 #include 
@@ -309,16 +309,16 @@ ATF_TC_BODY(snprintb, tc)
 
 	// old style, empty description
 	//
-	// Empty descriptions result in multiple commas in a row, which is a
-	// mistake.
-	h_snprintb(
+	// The description of a bit in the old format must not be empty,
+	// to prevent multiple commas in a row.
+	h_snprintb_val_error(
 	"\020"
 	"\001lsb"
 	"\004"
 	"\005"
 	"\010msb",
 	0xff,
-	"0xff");
+	"0xff");
 
-	// new style unknown directive, at the beginning
+	// new style unknown conversion, at the beginning
 	h_snprintb_val_error(
 	"\177\020"
 	"unknown\0",
 	0xff,
 	"0xff#");
 
-	// new style unknown directive, after a known directive
+	// new style unknown conversion, after a known conversion
 	h_snprintb_val_error(
 	"\177\020"
 	"b\007msb\0"
@@ -946,42 +946,51 @@ ATF_TC_BODY(snprintb, tc)
 
 	// new style combinations, 'f' '*' '='
 	//
-	// After a catch-all '*' directive, any following '=' directive
-	// generates misleading output, which is a mistake.
-	h_snprintb(
+	// After a catch-all '*' conversions, there must not be further '='
+	// conversions.
+	h_snprintb_val_error(
 	"\177\020"
 	"f\000\010f\0"
 		"*=default\0"
 		"=\245match\0",
 	0xa5,
-	"0xa5");
+	"0xa5");
+	"0xa5");
+	"0xa5

CVS commit: src

2024-04-07 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Apr  7 15:20:17 UTC 2024

Modified Files:
src/common/lib/libutil: snprintb.c
src/tests/lib/libutil: t_snprintb.c

Log Message:
snprintb: reject empty bit descriptions and wrongly placed defaults


To generate a diff of this commit:
cvs rdiff -u -r1.47 -r1.48 src/common/lib/libutil/snprintb.c
cvs rdiff -u -r1.34 -r1.35 src/tests/lib/libutil/t_snprintb.c

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



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

2024-04-07 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Apr  7 15:02:08 UTC 2024

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

Log Message:
/var/run/named is not obsolete


To generate a diff of this commit:
cvs rdiff -u -r1.1339 -r1.1340 src/distrib/sets/lists/base/mi

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



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

2024-04-07 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Apr  7 15:02:08 UTC 2024

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

Log Message:
/var/run/named is not obsolete


To generate a diff of this commit:
cvs rdiff -u -r1.1339 -r1.1340 src/distrib/sets/lists/base/mi

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

Modified files:

Index: src/distrib/sets/lists/base/mi
diff -u src/distrib/sets/lists/base/mi:1.1339 src/distrib/sets/lists/base/mi:1.1340
--- src/distrib/sets/lists/base/mi:1.1339	Thu Apr  4 21:15:59 2024
+++ src/distrib/sets/lists/base/mi	Sun Apr  7 11:02:08 2024
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1339 2024/04/05 01:15:59 christos Exp $
+# $NetBSD: mi,v 1.1340 2024/04/07 15:02:08 christos Exp $
 #
 # Note:	Don't delete entries from here - mark them as "obsolete" instead,
 #	unless otherwise stated below.
@@ -6377,7 +6377,7 @@
 ./var/quotas	base-util-root
 ./var/run	base-sys-root
 ./var/run/lwresdbase-obsolete		obsolete
-./var/run/named	base-obsolete		obsolete
+./var/run/named	base-bind-root
 ./var/rwho	base-netutil-root
 ./var/shm	base-sys-root
 ./var/spool	base-sys-root



CVS commit: src/share/mk

2024-04-07 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sun Apr  7 14:40:34 UTC 2024

Modified Files:
src/share/mk: bsd.own.mk

Log Message:
Switch vax to HAVE_XORG_SERVER_VER=120.

Tested on my VAXstation 3100/m30 with smg(4).
Ok'ed by mrg@ on tech-x11@:
 https://mail-index.netbsd.org/tech-x11/2024/04/thread1.html#002457


To generate a diff of this commit:
cvs rdiff -u -r1.1366 -r1.1367 src/share/mk/bsd.own.mk

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

Modified files:

Index: src/share/mk/bsd.own.mk
diff -u src/share/mk/bsd.own.mk:1.1366 src/share/mk/bsd.own.mk:1.1367
--- src/share/mk/bsd.own.mk:1.1366	Tue Apr  2 22:41:48 2024
+++ src/share/mk/bsd.own.mk	Sun Apr  7 14:40:34 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.own.mk,v 1.1366 2024/04/02 22:41:48 riastradh Exp $
+#	$NetBSD: bsd.own.mk,v 1.1367 2024/04/07 14:40:34 tsutsui Exp $
 
 # This needs to be before bsd.init.mk
 .if defined(BSD_MK_COMPAT_FILE)
@@ -1674,8 +1674,7 @@ X11SRCDIR.${_proto}proto?=		${X11SRCDIRM
 .if \
 ${MACHINE} == "alpha"	|| \
 ${MACHINE} == "netwinder"	|| \
-${MACHINE} == "sgimips"	|| \
-${MACHINE} == "vax"
+${MACHINE} == "sgimips"
 HAVE_XORG_SERVER_VER?=110
 .else
 HAVE_XORG_SERVER_VER?=120



CVS commit: src/share/mk

2024-04-07 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sun Apr  7 14:40:34 UTC 2024

Modified Files:
src/share/mk: bsd.own.mk

Log Message:
Switch vax to HAVE_XORG_SERVER_VER=120.

Tested on my VAXstation 3100/m30 with smg(4).
Ok'ed by mrg@ on tech-x11@:
 https://mail-index.netbsd.org/tech-x11/2024/04/thread1.html#002457


To generate a diff of this commit:
cvs rdiff -u -r1.1366 -r1.1367 src/share/mk/bsd.own.mk

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



CVS commit: src/share/mk

2024-04-07 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sun Apr  7 14:36:23 UTC 2024

Modified Files:
src/share/mk: bsd.x11.mk

Log Message:
Use default X11FLAGS to build Xorg servers on vax.

It looks necessary on HAVE_XORG_SERVER_VER=120.


To generate a diff of this commit:
cvs rdiff -u -r1.152 -r1.153 src/share/mk/bsd.x11.mk

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



CVS commit: src/share/mk

2024-04-07 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sun Apr  7 14:36:23 UTC 2024

Modified Files:
src/share/mk: bsd.x11.mk

Log Message:
Use default X11FLAGS to build Xorg servers on vax.

It looks necessary on HAVE_XORG_SERVER_VER=120.


To generate a diff of this commit:
cvs rdiff -u -r1.152 -r1.153 src/share/mk/bsd.x11.mk

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

Modified files:

Index: src/share/mk/bsd.x11.mk
diff -u src/share/mk/bsd.x11.mk:1.152 src/share/mk/bsd.x11.mk:1.153
--- src/share/mk/bsd.x11.mk:1.152	Tue Apr  2 16:17:29 2024
+++ src/share/mk/bsd.x11.mk	Sun Apr  7 14:36:23 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.x11.mk,v 1.152 2024/04/02 16:17:29 christos Exp $
+#	$NetBSD: bsd.x11.mk,v 1.153 2024/04/07 14:36:23 tsutsui Exp $
 
 .include 
 
@@ -83,8 +83,7 @@ X11FLAGS.OS_DEFINES=	-DDDXOSINIT -DSERVE
 
 .if !(${MACHINE} == "acorn32"	|| \
 ${MACHINE} == "sun3"	|| \
-${MACHINE} == "x68k"	|| \
-${MACHINE} == "vax")
+${MACHINE} == "x68k")
 #	EXT_DEFINES
 X11FLAGS.EXTENSION+=	-DXF86VIDMODE
 



CVS commit: src/lib/libutil

2024-04-07 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Apr  7 14:28:27 UTC 2024

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

Log Message:
snprintb.3: clean up formatting and wording, prefer octal in examples

Using hexadecimal character escapes requires separate string literals if
the description starts with one of the letters A-F; octal character
escapes have at most 3 digits, reducing ambiguity.


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/lib/libutil/snprintb.3

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

Modified files:

Index: src/lib/libutil/snprintb.3
diff -u src/lib/libutil/snprintb.3:1.37 src/lib/libutil/snprintb.3:1.38
--- src/lib/libutil/snprintb.3:1.37	Sun Apr  7 12:05:23 2024
+++ src/lib/libutil/snprintb.3	Sun Apr  7 14:28:26 2024
@@ -1,4 +1,4 @@
-.\" $NetBSD: snprintb.3,v 1.37 2024/04/07 12:05:23 rillig Exp $
+.\" $NetBSD: snprintb.3,v 1.38 2024/04/07 14:28:26 rillig Exp $
 .\"
 .\" Copyright (c) 1998, 2024 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -27,7 +27,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd February 22, 2024
+.Dd April 7, 2024
 .Dt SNPRINTB 3
 .Os
 .Sh NAME
@@ -180,10 +180,10 @@ followed by type-specific parameters, ea
 followed by a
 .Tn NUL Ns -terminated description.
 The bit positions are 0-based,
-they range from
-.Sq \e000
-for the least significant bit to
-.Sq \e077
+ranging from
+.Ql \e000
+(0) for the least significant bit to
+.Ql \e077
 (63) for the most significant bit.
 .
 .Bl -tag -width Cm
@@ -252,15 +252,15 @@ If none of the previous
 .Sq Cm \&=
 or
 .Sq Cm \&:
-conversions matched, prints the field value, using the
-.Xr printf 3
-format
-.Ar fmt .
+conversions matched, prints the format string
+.Ar fmt
+via
+.Xr printf 3 .
 The format string
 .Ar fmt
 may contain a single
 .Vt uintmax_t
-conversion specification that prints the value that did not match.
+conversion specification to print the field value that did not match.
 .El
 .Pp
 The new format is terminated by an additional
@@ -285,15 +285,15 @@ total number of bytes.
 .Sh EXAMPLES
 Two examples of the old formatting style:
 .Bd -literal -offset indent
-snprintb(buf, bufsize, "\e10\e2BITTWO\e1BITONE", 3)
+snprintb(buf, bufsize, "\e010\e002BITTWO\e001BITONE", 3)
 \(rA "03"
 
 snprintb(buf, bufsize,
-"\e20"
-"\ex10NOTBOOT" "\ex0f""FPP" "\ex0eSDVMA"
-"\ex0cVIDEO" "\ex0bLORES" "\ex0a""FPA" "\ex09""DIAG"
-"\ex07""CACHE" "\ex06IOCACHE" "\ex05LOOPBACK"
-"\ex04""DBGCACHE",
+"\e020"
+"\ex10""NOTBOOT"   "\ex0f""FPP"   "\ex0e""SDVMA"
+"\ex0c""VIDEO" "\ex0b""LORES" "\ex0a""FPA"
+"\ex09""DIAG"  "\ex07""CACHE" "\ex06""IOCACHE"
+"\ex05""LOOPBACK"  "\ex04""DBGCACHE",
 0xe860)
 \(rA "0xe860"
 .Ed
@@ -302,9 +302,9 @@ An example of the new formatting style:
 .Bd -literal -offset indent
 snprintb(buf, bufsize,
 "\e177\e020"
-"b\e0LSB\e0" "b\e1BITONE\e0" "f\e4\e4NIBBLE2\e0"
-"f\ex10\e4BURST\e0" "=\e4FOUR\e0" "=\exf""FIFTEEN\e0"
-"b\ex1fMSB\e0",
+"b\e000LSB\e0" "b\e001BITONE\e0" "f\e004\e004NIBBLE2\e0"
+"f\e020\e004BURST\e0" "=\e004FOUR\e0" "=\e017FIFTEEN\e0"
+"b\e037MSB\e0",
 0x800f0701)
 \(rA "0x800f0701"
 .Ed
@@ -313,9 +313,9 @@ The same example using snprintb_m:
 .Bd -literal -offset indent
 snprintb_m(buf, bufsize,
 "\e177\e020"
-"b\e0LSB\e0" "b\e1BITONE\e0" "f\e4\e4NIBBLE2\e0"
-"f\ex10\e4BURST\e0" "=\e4FOUR\e0" "=\exf""FIFTEEN\e0"
-"b\ex1fMSB\e0",
+"b\e000LSB\e0" "b\e001BITONE\e0" "f\e004\e004NIBBLE2\e0"
+"f\e020\e004BURST\e0" "=\e004FOUR\e0" "=\e017FIFTEEN\e0"
+"b\e037MSB\e0",
 0x800f0701, 34)
 \(rA "0x800f0701\e0"
"0x800f0701\e0"



CVS commit: src/lib/libutil

2024-04-07 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Apr  7 14:28:27 UTC 2024

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

Log Message:
snprintb.3: clean up formatting and wording, prefer octal in examples

Using hexadecimal character escapes requires separate string literals if
the description starts with one of the letters A-F; octal character
escapes have at most 3 digits, reducing ambiguity.


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/lib/libutil/snprintb.3

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



CVS commit: src/external/gpl2/texinfo/dist/util

2024-04-07 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Apr  7 12:30:38 UTC 2024

Modified Files:
src/external/gpl2/texinfo/dist/util: texindex.c

Log Message:
make qsort sorting deterministic


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/gpl2/texinfo/dist/util/texindex.c

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

Modified files:

Index: src/external/gpl2/texinfo/dist/util/texindex.c
diff -u src/external/gpl2/texinfo/dist/util/texindex.c:1.2 src/external/gpl2/texinfo/dist/util/texindex.c:1.3
--- src/external/gpl2/texinfo/dist/util/texindex.c:1.2	Wed Jan 13 19:34:53 2016
+++ src/external/gpl2/texinfo/dist/util/texindex.c	Sun Apr  7 08:30:38 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: texindex.c,v 1.2 2016/01/14 00:34:53 christos Exp $	*/
+/*	$NetBSD: texindex.c,v 1.3 2024/04/07 12:30:38 christos Exp $	*/
 
 /* texindex -- sort TeX index dribble output into an actual index.
Id: texindex.c,v 1.11 2004/04/11 17:56:47 karl Exp 
@@ -55,6 +55,7 @@ struct lineinfo
 long number;/* The numeric value (for numeric comparison). */
   } key;
   long keylen;  /* Length of KEY field. */
+  size_t idx;		/* tie breaker */
 };
 
 /* This structure describes a field to use as a sort key. */
@@ -369,7 +370,9 @@ compare_full (const void *p1, const void
 }
 }
 
-  return 0; /* Lines match exactly. */
+  if (*line1 == *line2)
+abort ();
+  return *line1 < *line2 ? -1 : 1;
 }
 
 /* Compare LINE1 and LINE2, described by structures
@@ -428,7 +431,9 @@ compare_prepared (const void *p1, const 
 }
 }
 
-  return 0; /* Lines match exactly. */
+  if (line1->idx == line2->idx)
+abort ();
+  return line1->idx < line2->idx ? -1 : 1;
 }
 
 /* Like compare_full but more general.
@@ -799,11 +804,13 @@ sort_in_core (char *infile, int total, c
 
   if (lineinfo)
 {
+  size_t idx = 0;
   struct lineinfo *lp;
   char **p;
 
   for (lp = lineinfo, p = linearray; p != nextline; lp++, p++)
 {
+	  lp->idx = idx++;
   lp->text = *p;
   lp->key.text = find_field (keyfields, *p, >keylen);
   if (keyfields->numeric)



CVS commit: src/external/gpl2/texinfo/dist/util

2024-04-07 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Apr  7 12:30:38 UTC 2024

Modified Files:
src/external/gpl2/texinfo/dist/util: texindex.c

Log Message:
make qsort sorting deterministic


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/gpl2/texinfo/dist/util/texindex.c

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



CVS commit: src

2024-04-07 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Apr  7 12:05:23 UTC 2024

Modified Files:
src/common/lib/libutil: snprintb.c
src/lib/libutil: snprintb.3
src/tests/lib/libutil: t_snprintb.c

Log Message:
snprintb: reject combinations of 'f' with ':' as well as 'F' with '='

These combinations would lead to garbled output.


To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.47 src/common/lib/libutil/snprintb.c
cvs rdiff -u -r1.36 -r1.37 src/lib/libutil/snprintb.3
cvs rdiff -u -r1.33 -r1.34 src/tests/lib/libutil/t_snprintb.c

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

Modified files:

Index: src/common/lib/libutil/snprintb.c
diff -u src/common/lib/libutil/snprintb.c:1.46 src/common/lib/libutil/snprintb.c:1.47
--- src/common/lib/libutil/snprintb.c:1.46	Sun Apr  7 10:10:54 2024
+++ src/common/lib/libutil/snprintb.c	Sun Apr  7 12:05:23 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: snprintb.c,v 1.46 2024/04/07 10:10:54 rillig Exp $	*/
+/*	$NetBSD: snprintb.c,v 1.47 2024/04/07 12:05:23 rillig Exp $	*/
 
 /*-
  * Copyright (c) 2002, 2024 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
 
 #  include 
 #  if defined(LIBC_SCCS)
-__RCSID("$NetBSD: snprintb.c,v 1.46 2024/04/07 10:10:54 rillig Exp $");
+__RCSID("$NetBSD: snprintb.c,v 1.47 2024/04/07 12:05:23 rillig Exp $");
 #  endif
 
 #  include 
@@ -46,7 +46,7 @@ __RCSID("$NetBSD: snprintb.c,v 1.46 2024
 #  include 
 # else /* ! _KERNEL */
 #  include 
-__KERNEL_RCSID(0, "$NetBSD: snprintb.c,v 1.46 2024/04/07 10:10:54 rillig Exp $");
+__KERNEL_RCSID(0, "$NetBSD: snprintb.c,v 1.47 2024/04/07 12:05:23 rillig Exp $");
 #  include 
 #  include 
 #  include 
@@ -150,7 +150,8 @@ old_style(state *s)
 static int
 new_style(state *s)
 {
-	uint64_t field = s->val;
+	uint8_t field_kind = 0;	// 0 or 'f' or 'F'
+	uint64_t field = 0;	// valid if field_kind != '\0'
 	int matched = 1;
 	const char *prev_bitfmt = s->bitfmt;
 	while (*s->bitfmt != '\0') {
@@ -158,6 +159,7 @@ new_style(state *s)
 		uint8_t kind = cur_bitfmt[0];
 		switch (kind) {
 		case 'b':
+			field_kind = 0;
 			prev_bitfmt = cur_bitfmt;
 			uint8_t b_bit = cur_bitfmt[1];
 			if (b_bit >= 64)
@@ -174,6 +176,7 @@ new_style(state *s)
 			break;
 		case 'f':
 		case 'F':
+			field_kind = kind;
 			prev_bitfmt = cur_bitfmt;
 			matched = 0;
 			uint8_t f_lsb = cur_bitfmt[1];
@@ -200,6 +203,10 @@ new_style(state *s)
 		case '=':
 		case ':':
 			s->bitfmt += 2;
+			if (kind == '=' && field_kind != 'f')
+return -1;
+			if (kind == ':' && field_kind != 'F')
+return -1;
 			uint8_t cmp = cur_bitfmt[1];
 			if (cur_bitfmt[2] == '\0')
 return -1;
@@ -213,6 +220,8 @@ new_style(state *s)
 			maybe_wrap_line(s, prev_bitfmt);
 			break;
 		case '*':
+			if (field_kind == 0)
+return -1;
 			if (cur_bitfmt[1] == '\0')
 return -1;
 			s->bitfmt++;

Index: src/lib/libutil/snprintb.3
diff -u src/lib/libutil/snprintb.3:1.36 src/lib/libutil/snprintb.3:1.37
--- src/lib/libutil/snprintb.3:1.36	Thu Feb 29 21:08:54 2024
+++ src/lib/libutil/snprintb.3	Sun Apr  7 12:05:23 2024
@@ -1,4 +1,4 @@
-.\" $NetBSD: snprintb.3,v 1.36 2024/02/29 21:08:54 rillig Exp $
+.\" $NetBSD: snprintb.3,v 1.37 2024/04/07 12:05:23 rillig Exp $
 .\"
 .\" Copyright (c) 1998, 2024 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -48,7 +48,6 @@ The
 .Fn snprintb
 function formats a bitmask into a mnemonic form suitable for printing.
 .Pp
-This conversion is useful for decoding bit fields in device registers.
 It formats the integer
 .Fa val
 into the buffer
@@ -103,13 +102,18 @@ character
 The decoding directive in
 .Fa fmt
 describes how the bitfield is to be interpreted and displayed.
-It follows two possible syntaxes, referred to as
+It follows two possible formats, referred to as
 .Dq old
 and
 .Dq new .
-The main advantage of the
+The
+.Dq old
+format is limited to describing single bits in a 32-bit value,
+the bit positions are 1-based.
+The
 .Dq new
-formatting is that it is capable of handling multi-bit fields.
+format supports multi-bit fields and 64-bit values,
+the bit positions are 0-based.
 .Pp
 If the first character of
 .Fa fmt
@@ -119,153 +123,149 @@ the remainder of the
 .Fa fmt
 argument follows the
 .Dq new
-syntax.
-The second character
-.Pq the first for the old format
-is a binary character representation of the
-output numeral base in which the bitfield will be printed before it is decoded.
-Recognized radix values
+format.
+.Pp
+The next character
+.Po the first for the
+.Dq old
+format
+.Pc
+specifies the numeral base in which to print the numbers in the output.
+The possible values
 .Pq in C escape-character format
 are
-.Ql \e10
-.Pq octal ,
-.Ql \e12
-.Pq decimal ,
-and
-.Ql \e20
-.Pq hexadecimal .
+.Ql \e010
+for octal,
+.Ql \e012
+for decimal, and
+.Ql \e020
+for hexadecimal.
 .Pp
 The remaining characters in the
 .Fa fmt
-argument are interpreted as a list of formatting directives.
+argument represent 

CVS commit: src

2024-04-07 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Apr  7 12:05:23 UTC 2024

Modified Files:
src/common/lib/libutil: snprintb.c
src/lib/libutil: snprintb.3
src/tests/lib/libutil: t_snprintb.c

Log Message:
snprintb: reject combinations of 'f' with ':' as well as 'F' with '='

These combinations would lead to garbled output.


To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.47 src/common/lib/libutil/snprintb.c
cvs rdiff -u -r1.36 -r1.37 src/lib/libutil/snprintb.3
cvs rdiff -u -r1.33 -r1.34 src/tests/lib/libutil/t_snprintb.c

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



CVS commit: src

2024-04-07 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Apr  7 10:10:54 UTC 2024

Modified Files:
src/common/lib/libutil: snprintb.c
src/tests/lib/libutil: t_snprintb.c

Log Message:
snprintb: reject empty descriptions

In cases where the snprintb output is garbled, it is not trustworthy, so
make sure the mistakes in the bitfmt are fixed early.


To generate a diff of this commit:
cvs rdiff -u -r1.45 -r1.46 src/common/lib/libutil/snprintb.c
cvs rdiff -u -r1.32 -r1.33 src/tests/lib/libutil/t_snprintb.c

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



CVS commit: src

2024-04-07 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Apr  7 10:10:54 UTC 2024

Modified Files:
src/common/lib/libutil: snprintb.c
src/tests/lib/libutil: t_snprintb.c

Log Message:
snprintb: reject empty descriptions

In cases where the snprintb output is garbled, it is not trustworthy, so
make sure the mistakes in the bitfmt are fixed early.


To generate a diff of this commit:
cvs rdiff -u -r1.45 -r1.46 src/common/lib/libutil/snprintb.c
cvs rdiff -u -r1.32 -r1.33 src/tests/lib/libutil/t_snprintb.c

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

Modified files:

Index: src/common/lib/libutil/snprintb.c
diff -u src/common/lib/libutil/snprintb.c:1.45 src/common/lib/libutil/snprintb.c:1.46
--- src/common/lib/libutil/snprintb.c:1.45	Mon Apr  1 08:53:42 2024
+++ src/common/lib/libutil/snprintb.c	Sun Apr  7 10:10:54 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: snprintb.c,v 1.45 2024/04/01 08:53:42 rillig Exp $	*/
+/*	$NetBSD: snprintb.c,v 1.46 2024/04/07 10:10:54 rillig Exp $	*/
 
 /*-
  * Copyright (c) 2002, 2024 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
 
 #  include 
 #  if defined(LIBC_SCCS)
-__RCSID("$NetBSD: snprintb.c,v 1.45 2024/04/01 08:53:42 rillig Exp $");
+__RCSID("$NetBSD: snprintb.c,v 1.46 2024/04/07 10:10:54 rillig Exp $");
 #  endif
 
 #  include 
@@ -46,7 +46,7 @@ __RCSID("$NetBSD: snprintb.c,v 1.45 2024
 #  include 
 # else /* ! _KERNEL */
 #  include 
-__KERNEL_RCSID(0, "$NetBSD: snprintb.c,v 1.45 2024/04/01 08:53:42 rillig Exp $");
+__KERNEL_RCSID(0, "$NetBSD: snprintb.c,v 1.46 2024/04/07 10:10:54 rillig Exp $");
 #  include 
 #  include 
 #  include 
@@ -162,6 +162,8 @@ new_style(state *s)
 			uint8_t b_bit = cur_bitfmt[1];
 			if (b_bit >= 64)
 return -1;
+			if (cur_bitfmt[2] == '\0')
+return -1;
 			s->bitfmt += 2;
 			if (((s->val >> b_bit) & 1) == 0)
 goto skip_description;
@@ -180,6 +182,8 @@ new_style(state *s)
 			uint8_t f_width = cur_bitfmt[2];
 			if (f_width > 64)
 return -1;
+			if (kind == 'f' && cur_bitfmt[3] == '\0')
+return -1;
 			field = s->val >> f_lsb;
 			if (f_width < 64)
 field &= ((uint64_t) 1 << f_width) - 1;
@@ -197,6 +201,8 @@ new_style(state *s)
 		case ':':
 			s->bitfmt += 2;
 			uint8_t cmp = cur_bitfmt[1];
+			if (cur_bitfmt[2] == '\0')
+return -1;
 			if (field != cmp)
 goto skip_description;
 			matched = 1;
@@ -207,6 +213,8 @@ new_style(state *s)
 			maybe_wrap_line(s, prev_bitfmt);
 			break;
 		case '*':
+			if (cur_bitfmt[1] == '\0')
+return -1;
 			s->bitfmt++;
 			if (matched)
 goto skip_description;

Index: src/tests/lib/libutil/t_snprintb.c
diff -u src/tests/lib/libutil/t_snprintb.c:1.32 src/tests/lib/libutil/t_snprintb.c:1.33
--- src/tests/lib/libutil/t_snprintb.c:1.32	Mon Apr  1 09:15:51 2024
+++ src/tests/lib/libutil/t_snprintb.c	Sun Apr  7 10:10:54 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: t_snprintb.c,v 1.32 2024/04/01 09:15:51 rillig Exp $ */
+/* $NetBSD: t_snprintb.c,v 1.33 2024/04/07 10:10:54 rillig Exp $ */
 
 /*
  * Copyright (c) 2002, 2004, 2008, 2010, 2024 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
 #include 
 __COPYRIGHT("@(#) Copyright (c) 2008, 2010, 2024\
  The NetBSD Foundation, inc. All rights reserved.");
-__RCSID("$NetBSD: t_snprintb.c,v 1.32 2024/04/01 09:15:51 rillig Exp $");
+__RCSID("$NetBSD: t_snprintb.c,v 1.33 2024/04/07 10:10:54 rillig Exp $");
 
 #include 
 #include 
@@ -415,16 +415,20 @@ ATF_TC_BODY(snprintb, tc)
 	0xff,
 	"0xff");
 
-	// new style single bits, empty description
-	h_snprintb(
+	// new style single bits, 'b' with empty description
+	//
+	// The description of a 'b' conversion must not be empty, as the
+	// output would contain several commas in a row.
+	h_snprintb_len(
+	1024,
 	"\177\020"
 	"b\000lsb\0"
 	"b\001\0"
 	"b\002\0"
-	"b\007msb\0"
-	,
+	"b\007msb\0",
 	0xff,
-	"0xff");
+	-1,
+	"0xff");
+	-1,
+	"0x1");
+	-1,
+	"0x1<#");
 
 	// new style bit-field, 'F', ':' with empty description, '*'
 	//
-	// An empty description of a ':' directive that matches results in
-	// normal-looking output, but if it didn't match, the output would
-	// contain empty angle brackets, which is a mistake.
-	h_snprintb(
+	// The description of a ':' conversion must not be empty, as the
+	// output would contain empty angle brackets. Not in this particular
+	// test case, as the value is different, but the structural error is
+	// detected nevertheless.
+	h_snprintb_len(
+	1024,
 	"\177\020"
 	"F\000\004\0"
 		":\001\0"
 		"*default\0",
 	0x2,
-	"0x2");
+	-1,
+	"0x2<#");
 
 	// new style bit-field, 'f' with non-exhaustive '='
 	h_snprintb(