Re: CVS commit: src/distrib/sets/lists/man

2024-08-15 Thread Paul Goyette

On Thu, 15 Aug 2024, Christos Zoulas wrote:


Module Name:src
Committed By:   christos
Date:   Thu Aug 15 21:51:35 UTC 2024

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

Log Message:
sigh, no more info files for gdb.


Can we please try and find someone to package up the info files into
pkgsrc?  It would be a real shame to not have docs...


+-+--+--+
| Paul Goyette (.sig) | PGP Key fingerprint: | E-mail addresses:|
| (Retired)   | 1B11 1849 721C 56C8 F63A | p...@whooppee.com|
| Software Developer  | 6E2E 05FD 15CE 9F2D 5102 | pgoye...@netbsd.org  |
| & Network Engineer  |  | pgoyett...@gmail.com |
+-+--+--+


CVS commit: src

2024-08-15 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Thu Aug 15 23:44:50 UTC 2024

Modified Files:
src/include: limits.h unistd.h
src/lib/libc/gen: getentropy.3

Log Message:
getentropy(3): Make this visible to POSIX.1-2024 applications.

Likewise GETENTROPY_MAX.

It is now part of POSIX:

https://pubs.opengroup.org/onlinepubs/9799919799.2024edition/functions/getentropy.html

Cite standard in man page too.  While here, use `.Nm' rather than
`.Fn getentropy' for self-reference in the man page, for consistency
with other usage.

PR standards/58603: getentropy(3): update visibility and documentation
for POSIX.1-2024


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 src/include/limits.h
cvs rdiff -u -r1.166 -r1.167 src/include/unistd.h
cvs rdiff -u -r1.6 -r1.7 src/lib/libc/gen/getentropy.3

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

Modified files:

Index: src/include/limits.h
diff -u src/include/limits.h:1.43 src/include/limits.h:1.44
--- src/include/limits.h:1.43	Tue May 31 13:42:59 2022
+++ src/include/limits.h	Thu Aug 15 23:44:49 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: limits.h,v 1.43 2022/05/31 13:42:59 riastradh Exp $	*/
+/*	$NetBSD: limits.h,v 1.44 2024/08/15 23:44:49 riastradh Exp $	*/
 
 /*
  * Copyright (c) 1988, 1993
@@ -140,14 +140,18 @@
 #endif
 #endif /* _POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE || _NETBSD_SOURCE */
 
+/*
+ * IEEE Std 1003.1-2024 (POSIX.1-2024)
+ */
+#if (_POSIX_C_SOURCE - 0) >= 202405L || (_XOPEN_SOURCE - 0) >= 800 || \
+defined(_NETBSD_SOURCE)
+#define	GETENTROPY_MAX		256
+#endif
+
 #endif /* _POSIX_C_SOURCE || _XOPEN_SOURCE || _NETBSD_SOURCE */
 
 #define MB_LEN_MAX		32	/* Allow ISO/IEC 2022 */
 
-#ifdef _NETBSD_SOURCE
-#define	GETENTROPY_MAX		256
-#endif
-
 #include 
 
 #ifdef __CHAR_UNSIGNED__

Index: src/include/unistd.h
diff -u src/include/unistd.h:1.166 src/include/unistd.h:1.167
--- src/include/unistd.h:1.166	Mon May 20 01:30:33 2024
+++ src/include/unistd.h	Thu Aug 15 23:44:49 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: unistd.h,v 1.166 2024/05/20 01:30:33 christos Exp $	*/
+/*	$NetBSD: unistd.h,v 1.167 2024/08/15 23:44:49 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 1998, 1999, 2008 The NetBSD Foundation, Inc.
@@ -320,6 +320,14 @@ int	unlinkat(int, const char *, int);
 int	fexecve(int, char * const *, char * const *);
 #endif
 
+/*
+ * IEEE Std 1003.1-2024 (POSIX.1-2024)
+ */
+#if (_POSIX_C_SOURCE - 0) >= 202405L || (_XOPEN_SOURCE - 0 >= 800) || \
+defined(_NETBSD_SOURCE)
+int	 getentropy(void *, size_t);
+#endif
+
 
 /*
  * Implementation-defined extensions
@@ -340,7 +348,6 @@ int	 fchroot(int);
 int	 fdiscard(int, off_t, off_t);
 int	 fsync_range(int, int, off_t, off_t);
 int	 getdomainname(char *, size_t);
-int	 getentropy(void *, size_t);
 int	 getgrouplist(const char *, gid_t, gid_t *, int *);
 int	 getgroupmembership(const char *, gid_t, gid_t *, int, int *);
 mode_t	 getmode(const void *, mode_t);

Index: src/lib/libc/gen/getentropy.3
diff -u src/lib/libc/gen/getentropy.3:1.6 src/lib/libc/gen/getentropy.3:1.7
--- src/lib/libc/gen/getentropy.3:1.6	Fri Jun 30 22:15:14 2023
+++ src/lib/libc/gen/getentropy.3	Thu Aug 15 23:44:49 2024
@@ -1,4 +1,4 @@
-.\"	$NetBSD: getentropy.3,v 1.6 2023/06/30 22:15:14 uwe Exp $ $
+.\"	$NetBSD: getentropy.3,v 1.7 2024/08/15 23:44:49 riastradh Exp $ $
 .\"
 .\" Copyright (c) 2020 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -71,7 +71,7 @@ must be at most 256.
 .Sh RETURN VALUES
 .Rv -std getentropy
 .Sh ERRORS
-.Fn getentropy
+.Nm
 will succeed unless:
 .Bl -tag -width Er
 .It Bq Er EFAULT
@@ -105,12 +105,12 @@ secret seed material from such hardware 
 .Xr entropy 7
 .Sh STANDARDS
 The
-.Fn getentropy
-function is nonstandard.
-However, it is likely to be included in the next revision of POSIX.
+.Nm
+function conforms to
+.St -p1003.1-2024 .
 .Sh HISTORY
 The
-.Fn getentropy
+.Nm
 function first appeared in
 .Ox 5.6 ,
 then in



CVS commit: src

2024-08-15 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Thu Aug 15 23:44:50 UTC 2024

Modified Files:
src/include: limits.h unistd.h
src/lib/libc/gen: getentropy.3

Log Message:
getentropy(3): Make this visible to POSIX.1-2024 applications.

Likewise GETENTROPY_MAX.

It is now part of POSIX:

https://pubs.opengroup.org/onlinepubs/9799919799.2024edition/functions/getentropy.html

Cite standard in man page too.  While here, use `.Nm' rather than
`.Fn getentropy' for self-reference in the man page, for consistency
with other usage.

PR standards/58603: getentropy(3): update visibility and documentation
for POSIX.1-2024


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 src/include/limits.h
cvs rdiff -u -r1.166 -r1.167 src/include/unistd.h
cvs rdiff -u -r1.6 -r1.7 src/lib/libc/gen/getentropy.3

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



CVS commit: src/lib/libc/locale

2024-08-15 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Thu Aug 15 22:23:17 UTC 2024

Modified Files:
src/lib/libc/locale: c8rtomb.c mbrtoc8.c

Log Message:
c8rtomb(3), mbrtoc8(3): Use namespace.h to get private aliases.

This way applications defining the symbols c32rtomb or mbrtoc32 won't
clobber our private definitions, which are slightly more constrained
about their use of mbstate_t than is obvious from the interface
contract.

PR standards/58601: uchar.h C23 compliance: char8_t, mbrtoc8, c8rtomb


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/lib/libc/locale/c8rtomb.c \
src/lib/libc/locale/mbrtoc8.c

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

Modified files:

Index: src/lib/libc/locale/c8rtomb.c
diff -u src/lib/libc/locale/c8rtomb.c:1.1 src/lib/libc/locale/c8rtomb.c:1.2
--- src/lib/libc/locale/c8rtomb.c:1.1	Thu Aug 15 21:19:45 2024
+++ src/lib/libc/locale/c8rtomb.c	Thu Aug 15 22:23:17 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: c8rtomb.c,v 1.1 2024/08/15 21:19:45 riastradh Exp $	*/
+/*	$NetBSD: c8rtomb.c,v 1.2 2024/08/15 22:23:17 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2024 The NetBSD Foundation, Inc.
@@ -55,7 +55,9 @@
  */
 
 #include 
-__RCSID("$NetBSD: c8rtomb.c,v 1.1 2024/08/15 21:19:45 riastradh Exp $");
+__RCSID("$NetBSD: c8rtomb.c,v 1.2 2024/08/15 22:23:17 riastradh Exp $");
+
+#include "namespace.h"
 
 #include 
 #include 
Index: src/lib/libc/locale/mbrtoc8.c
diff -u src/lib/libc/locale/mbrtoc8.c:1.1 src/lib/libc/locale/mbrtoc8.c:1.2
--- src/lib/libc/locale/mbrtoc8.c:1.1	Thu Aug 15 21:19:45 2024
+++ src/lib/libc/locale/mbrtoc8.c	Thu Aug 15 22:23:17 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: mbrtoc8.c,v 1.1 2024/08/15 21:19:45 riastradh Exp $	*/
+/*	$NetBSD: mbrtoc8.c,v 1.2 2024/08/15 22:23:17 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2024 The NetBSD Foundation, Inc.
@@ -72,7 +72,9 @@
  */
 
 #include 
-__RCSID("$NetBSD: mbrtoc8.c,v 1.1 2024/08/15 21:19:45 riastradh Exp $");
+__RCSID("$NetBSD: mbrtoc8.c,v 1.2 2024/08/15 22:23:17 riastradh Exp $");
+
+#include "namespace.h"
 
 #include 
 #include 



CVS commit: src/lib/libc/locale

2024-08-15 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Thu Aug 15 22:23:17 UTC 2024

Modified Files:
src/lib/libc/locale: c8rtomb.c mbrtoc8.c

Log Message:
c8rtomb(3), mbrtoc8(3): Use namespace.h to get private aliases.

This way applications defining the symbols c32rtomb or mbrtoc32 won't
clobber our private definitions, which are slightly more constrained
about their use of mbstate_t than is obvious from the interface
contract.

PR standards/58601: uchar.h C23 compliance: char8_t, mbrtoc8, c8rtomb


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/lib/libc/locale/c8rtomb.c \
src/lib/libc/locale/mbrtoc8.c

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



CVS commit: src/lib/libc

2024-08-15 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Thu Aug 15 22:22:35 UTC 2024

Modified Files:
src/lib/libc/include: namespace.h
src/lib/libc/locale: c16rtomb.c c32rtomb.c mbrtoc16.c mbrtoc32.c

Log Message:
libc: c32rtomb and mbrtoc32 are used internally, so weak-alias them.

PR lib/52374:  missing


To generate a diff of this commit:
cvs rdiff -u -r1.203 -r1.204 src/lib/libc/include/namespace.h
cvs rdiff -u -r1.2 -r1.3 src/lib/libc/locale/c16rtomb.c \
src/lib/libc/locale/mbrtoc32.c
cvs rdiff -u -r1.1 -r1.2 src/lib/libc/locale/c32rtomb.c
cvs rdiff -u -r1.3 -r1.4 src/lib/libc/locale/mbrtoc16.c

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

Modified files:

Index: src/lib/libc/include/namespace.h
diff -u src/lib/libc/include/namespace.h:1.203 src/lib/libc/include/namespace.h:1.204
--- src/lib/libc/include/namespace.h:1.203	Tue May 31 13:42:59 2022
+++ src/lib/libc/include/namespace.h	Thu Aug 15 22:22:34 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: namespace.h,v 1.203 2022/05/31 13:42:59 riastradh Exp $	*/
+/*	$NetBSD: namespace.h,v 1.204 2024/08/15 22:22:34 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 1997-2004 The NetBSD Foundation, Inc.
@@ -224,6 +224,7 @@
 #define bm_comp			_bm_comp
 #define bm_exec			_bm_exec
 #define bm_free			_bm_free
+#define c32rtomb		_c32rtomb
 #define callrpc			_callrpc
 #define cdbr_close		_cdbr_close
 #define cdbr_find		_cdbr_find
@@ -511,6 +512,7 @@
 #define lockf			_lockf
 #define lrand48			_lrand48
 #define lseek			_lseek
+#define mbrtoc32		_mbrtoc32
 #define membar_producer		_membar_producer
 #define mergesort		_mergesort
 #define mi_vector_hash		_mi_vector_hash

Index: src/lib/libc/locale/c16rtomb.c
diff -u src/lib/libc/locale/c16rtomb.c:1.2 src/lib/libc/locale/c16rtomb.c:1.3
--- src/lib/libc/locale/c16rtomb.c:1.2	Thu Aug 15 15:46:40 2024
+++ src/lib/libc/locale/c16rtomb.c	Thu Aug 15 22:22:35 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: c16rtomb.c,v 1.2 2024/08/15 15:46:40 riastradh Exp $	*/
+/*	$NetBSD: c16rtomb.c,v 1.3 2024/08/15 22:22:35 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2024 The NetBSD Foundation, Inc.
@@ -66,7 +66,9 @@
  */
 
 #include 
-__RCSID("$NetBSD: c16rtomb.c,v 1.2 2024/08/15 15:46:40 riastradh Exp $");
+__RCSID("$NetBSD: c16rtomb.c,v 1.3 2024/08/15 22:22:35 riastradh Exp $");
+
+#include "namespace.h"
 
 #include 
 #include 
Index: src/lib/libc/locale/mbrtoc32.c
diff -u src/lib/libc/locale/mbrtoc32.c:1.2 src/lib/libc/locale/mbrtoc32.c:1.3
--- src/lib/libc/locale/mbrtoc32.c:1.2	Thu Aug 15 15:46:40 2024
+++ src/lib/libc/locale/mbrtoc32.c	Thu Aug 15 22:22:35 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: mbrtoc32.c,v 1.2 2024/08/15 15:46:40 riastradh Exp $	*/
+/*	$NetBSD: mbrtoc32.c,v 1.3 2024/08/15 22:22:35 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2024 The NetBSD Foundation, Inc.
@@ -52,7 +52,9 @@
  */
 
 #include 
-__RCSID("$NetBSD: mbrtoc32.c,v 1.2 2024/08/15 15:46:40 riastradh Exp $");
+__RCSID("$NetBSD: mbrtoc32.c,v 1.3 2024/08/15 22:22:35 riastradh Exp $");
+
+#include "namespace.h"
 
 #include 		/* MIN */
 #include 		/* broken citrus_*.h */
@@ -80,6 +82,10 @@ __RCSID("$NetBSD: mbrtoc32.c,v 1.2 2024/
 __CTASSERT(sizeof(struct mbrtoc32state) <= sizeof(mbstate_t));
 __CTASSERT(alignof(struct mbrtoc32state) <= alignof(mbstate_t));
 
+#ifdef __weak_alias
+__weak_alias(mbrtoc32,_mbrtoc32)
+#endif
+
 size_t
 mbrtoc32(char32_t *restrict pc32, const char *restrict s, size_t n,
 mbstate_t *restrict ps)

Index: src/lib/libc/locale/c32rtomb.c
diff -u src/lib/libc/locale/c32rtomb.c:1.1 src/lib/libc/locale/c32rtomb.c:1.2
--- src/lib/libc/locale/c32rtomb.c:1.1	Thu Aug 15 14:16:33 2024
+++ src/lib/libc/locale/c32rtomb.c	Thu Aug 15 22:22:35 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: c32rtomb.c,v 1.1 2024/08/15 14:16:33 riastradh Exp $	*/
+/*	$NetBSD: c32rtomb.c,v 1.2 2024/08/15 22:22:35 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2024 The NetBSD Foundation, Inc.
@@ -49,7 +49,9 @@
  */
 
 #include 
-__RCSID("$NetBSD: c32rtomb.c,v 1.1 2024/08/15 14:16:33 riastradh Exp $");
+__RCSID("$NetBSD: c32rtomb.c,v 1.2 2024/08/15 22:22:35 riastradh Exp $");
+
+#include "namespace.h"
 
 #include 		/* broken citrus_*.h */
 #include 		/* broken citrus_*.h */
@@ -69,6 +71,10 @@ __RCSID("$NetBSD: c32rtomb.c,v 1.1 2024/
 #include "citrus_hash.h"	/* broken citrus_iconv.h */
 #include "citrus_iconv.h"
 
+#ifdef __weak_alias
+__weak_alias(c32rtomb,_c32rtomb)
+#endif
+
 size_t
 c32rtomb(char *restrict s, char32_t c32, mbstate_t *restrict ps)
 {

Index: src/lib/libc/locale/mbrtoc16.c
diff -u src/lib/libc/locale/mbrtoc16.c:1.3 src/lib/libc/locale/mbrtoc16.c:1.4
--- src/lib/libc/locale/mbrtoc16.c:1.3	Thu Aug 15 20:23:26 2024
+++ src/lib/libc/locale/mbrtoc16.c	Thu Aug 15 22:22:35 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: mbrtoc16.c,v 1.3 2024/08/15 20:23:26 riastradh Exp $	*/
+/*	$NetBSD: mbrtoc16.c,v 1.4 2024/08/15 22:22:35 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2024 The NetBSD Foundation, Inc.
@@ -73,7 +73,9 @@
  */
 
 #include 
-_

CVS commit: src/lib/libc

2024-08-15 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Thu Aug 15 22:22:35 UTC 2024

Modified Files:
src/lib/libc/include: namespace.h
src/lib/libc/locale: c16rtomb.c c32rtomb.c mbrtoc16.c mbrtoc32.c

Log Message:
libc: c32rtomb and mbrtoc32 are used internally, so weak-alias them.

PR lib/52374:  missing


To generate a diff of this commit:
cvs rdiff -u -r1.203 -r1.204 src/lib/libc/include/namespace.h
cvs rdiff -u -r1.2 -r1.3 src/lib/libc/locale/c16rtomb.c \
src/lib/libc/locale/mbrtoc32.c
cvs rdiff -u -r1.1 -r1.2 src/lib/libc/locale/c32rtomb.c
cvs rdiff -u -r1.3 -r1.4 src/lib/libc/locale/mbrtoc16.c

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-08-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Aug 15 21:53:48 UTC 2024

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

Log Message:
switch amd64 to gdb 15.1


To generate a diff of this commit:
cvs rdiff -u -r1.1396 -r1.1397 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.1396 src/share/mk/bsd.own.mk:1.1397
--- src/share/mk/bsd.own.mk:1.1396	Thu Aug 15 02:48:00 2024
+++ src/share/mk/bsd.own.mk	Thu Aug 15 17:53:48 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.own.mk,v 1.1396 2024/08/15 06:48:00 mrg Exp $
+#	$NetBSD: bsd.own.mk,v 1.1397 2024/08/15 21:53:48 christos Exp $
 
 # This needs to be before bsd.init.mk
 .if defined(BSD_MK_COMPAT_FILE)
@@ -150,7 +150,12 @@ EXTERNAL_BINUTILS_SUBDIR=	/does/not/exis
 #
 # What GDB is used?
 #
+.if \
+${MACHINE_ARCH} == "x86_64"
+HAVE_GDB?=	1510
+.else
 HAVE_GDB?=	1320
+.endif
 
 .if ${HAVE_GDB} == 1510
 EXTERNAL_GDB_SUBDIR=		gdb



CVS commit: src/share/mk

2024-08-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Aug 15 21:53:48 UTC 2024

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

Log Message:
switch amd64 to gdb 15.1


To generate a diff of this commit:
cvs rdiff -u -r1.1396 -r1.1397 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/distrib/sets/lists/man

2024-08-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Aug 15 21:51:35 UTC 2024

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

Log Message:
sigh, no more info files for gdb.


To generate a diff of this commit:
cvs rdiff -u -r1.1778 -r1.1779 src/distrib/sets/lists/man/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/man/mi
diff -u src/distrib/sets/lists/man/mi:1.1778 src/distrib/sets/lists/man/mi:1.1779
--- src/distrib/sets/lists/man/mi:1.1778	Thu Aug  1 09:41:15 2024
+++ src/distrib/sets/lists/man/mi	Thu Aug 15 17:51:35 2024
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1778 2024/08/01 13:41:15 nat Exp $
+# $NetBSD: mi,v 1.1779 2024/08/15 21:51:35 christos Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 ./etc/mtree/set.manman-sys-root
@@ -18,7 +18,7 @@
 ./usr/share/info/g++FAQ.info			man-obsolete		obsolete
 ./usr/share/info/g77.info			comp-obsolete		obsolete
 ./usr/share/info/gcc.info			man-c-info		gcccmds,info
-./usr/share/info/gdb.info			man-debug-info		gdb,info
+./usr/share/info/gdb.info			man-debug-info		gdb=1320,info
 ./usr/share/info/gdbint.info			man-obsolete		obsolete
 ./usr/share/info/gettext.info			man-sys-info		info
 ./usr/share/info/gprof.info			man-debug-info		binutils,info
@@ -33,7 +33,7 @@
 ./usr/share/info/ld.info			man-computil-info	binutils,info
 ./usr/share/info/ldint.info			man-computil-info	binutils=242,info
 ./usr/share/info/send-pr.info			man-gnats-info		info
-./usr/share/info/stabs.info			man-debug-info		gdb,info
+./usr/share/info/stabs.info			man-debug-info		gdb=1320,info
 ./usr/share/info/tar.info			man-obsolete		obsolete
 ./usr/share/info/texinfo.info			man-texinfo-info	info
 ./usr/share/info/uucp.info			man-obsolete		obsolete



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

2024-08-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Aug 15 21:51:35 UTC 2024

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

Log Message:
sigh, no more info files for gdb.


To generate a diff of this commit:
cvs rdiff -u -r1.1778 -r1.1779 src/distrib/sets/lists/man/mi

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



CVS commit: src

2024-08-15 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Thu Aug 15 21:19:46 UTC 2024

Modified Files:
src/distrib/sets/lists/comp: mi
src/distrib/sets/lists/debug: mi
src/distrib/sets/lists/tests: mi
src/include: uchar.h
src/lib/libc/locale: Makefile.inc
src/share/man/man3: uchar.3
src/tests/lib/libc/locale: Makefile
Added Files:
src/lib/libc/locale: c8rtomb.3 c8rtomb.c mbrtoc8.3 mbrtoc8.c
src/tests/lib/libc/locale: t_c8rtomb.c t_mbrtoc8.c

Log Message:
libc: New functions c8rtomb(3) and mbrtoc8(3).

New in C23, for converting from UTF-8 to locale-dependent multibyte
sequences (c8rtomb) or vice versa (mbrtoc8), along with the new type
char8_t.

Conditional on either:
- _NETBSD_SOURCE
- _ISOC23_SOURCE
- __STDC_VERSION__ >= 202311L

(Riding the libc minor bump from this morning for the UTF-16/UTF-32
versions from C11.)

PR standards/58601: uchar.h C23 compliance: char8_t, mbrtoc8, c8rtomb


To generate a diff of this commit:
cvs rdiff -u -r1.2469 -r1.2470 src/distrib/sets/lists/comp/mi
cvs rdiff -u -r1.443 -r1.444 src/distrib/sets/lists/debug/mi
cvs rdiff -u -r1.1331 -r1.1332 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.1 -r1.2 src/include/uchar.h
cvs rdiff -u -r1.66 -r1.67 src/lib/libc/locale/Makefile.inc
cvs rdiff -u -r0 -r1.1 src/lib/libc/locale/c8rtomb.3 \
src/lib/libc/locale/c8rtomb.c src/lib/libc/locale/mbrtoc8.3 \
src/lib/libc/locale/mbrtoc8.c
cvs rdiff -u -r1.1 -r1.2 src/share/man/man3/uchar.3
cvs rdiff -u -r1.17 -r1.18 src/tests/lib/libc/locale/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/lib/libc/locale/t_c8rtomb.c \
src/tests/lib/libc/locale/t_mbrtoc8.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/sets/lists/comp/mi
diff -u src/distrib/sets/lists/comp/mi:1.2469 src/distrib/sets/lists/comp/mi:1.2470
--- src/distrib/sets/lists/comp/mi:1.2469	Thu Aug 15 14:16:32 2024
+++ src/distrib/sets/lists/comp/mi	Thu Aug 15 21:19:44 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: mi,v 1.2469 2024/08/15 14:16:32 riastradh Exp $
+#	$NetBSD: mi,v 1.2470 2024/08/15 21:19:44 riastradh Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 ./etc/mtree/set.compcomp-sys-root
@@ -6844,6 +6844,7 @@
 ./usr/share/man/cat3/bzero.0			comp-c-catman		.cat
 ./usr/share/man/cat3/c16rtomb.0			comp-c-catman		.cat
 ./usr/share/man/cat3/c32rtomb.0			comp-c-catman		.cat
+./usr/share/man/cat3/c8rtomb.0			comp-c-catman		.cat
 ./usr/share/man/cat3/cabs.0			comp-c-catman		complex,.cat
 ./usr/share/man/cat3/cabsf.0			comp-c-catman		complex,.cat
 ./usr/share/man/cat3/cabsl.0			comp-c-catman		complex,.cat
@@ -9208,6 +9209,7 @@
 ./usr/share/man/cat3/mbrlen.0			comp-c-catman		.cat
 ./usr/share/man/cat3/mbrtoc16.0			comp-c-catman		.cat
 ./usr/share/man/cat3/mbrtoc32.0			comp-c-catman		.cat
+./usr/share/man/cat3/mbrtoc8.0			comp-c-catman		.cat
 ./usr/share/man/cat3/mbrtowc.0			comp-c-catman		.cat
 ./usr/share/man/cat3/mbsinit.0			comp-c-catman		.cat
 ./usr/share/man/cat3/mbsrtowcs.0		comp-c-catman		.cat
@@ -15409,6 +15411,7 @@
 ./usr/share/man/html3/bzero.html		comp-c-htmlman		html
 ./usr/share/man/html3/c16rtomb.html		comp-c-htmlman		html
 ./usr/share/man/html3/c32rtomb.html		comp-c-htmlman		html
+./usr/share/man/html3/c8rtomb.html		comp-c-htmlman		html
 ./usr/share/man/html3/cabs.html			comp-c-htmlman		complex,html
 ./usr/share/man/html3/cabsf.html		comp-c-htmlman		complex,html
 ./usr/share/man/html3/cabsl.html		comp-c-htmlman		complex,html
@@ -17705,6 +17708,7 @@
 ./usr/share/man/html3/mbrlen.html		comp-c-htmlman		html
 ./usr/share/man/html3/mbrtoc16.html		comp-c-htmlman		html
 ./usr/share/man/html3/mbrtoc32.html		comp-c-htmlman		html
+./usr/share/man/html3/mbrtoc8.html		comp-c-htmlman		html
 ./usr/share/man/html3/mbrtowc.html		comp-c-htmlman		html
 ./usr/share/man/html3/mbsinit.html		comp-c-htmlman		html
 ./usr/share/man/html3/mbsrtowcs.html		comp-c-htmlman		html
@@ -23833,6 +23837,7 @@
 ./usr/share/man/man3/bzero.3			comp-c-man		.man
 ./usr/share/man/man3/c16rtomb.3			comp-c-man		.man
 ./usr/share/man/man3/c32rtomb.3			comp-c-man		.man
+./usr/share/man/man3/c8rtomb.3			comp-c-man		.man
 ./usr/share/man/man3/cabs.3			comp-c-man		complex,.man
 ./usr/share/man/man3/cabsf.3			comp-c-man		complex,.man
 ./usr/share/man/man3/cabsl.3			comp-c-man		complex,.man
@@ -26209,6 +26214,7 @@
 ./usr/share/man/man3/mbrlen.3			comp-c-man		.man
 ./usr/share/man/man3/mbrtoc16.3			comp-c-man		.man
 ./usr/share/man/man3/mbrtoc32.3			comp-c-man		.man
+./usr/share/man/man3/mbrtoc8.3			comp-c-man		.man
 ./usr/share/man/man3/mbrtowc.3			comp-c-man		.man
 ./usr/share/man/man3/mbsinit.3			comp-c-man		.man
 ./usr/share/man/man3/mbsrtowcs.3		comp-c-man		.man

Index: src/distrib/sets/lists/debug/mi
diff -u src/distrib/sets/lists/debug/mi:1.443 src/distrib/sets/lists/debug/mi:1.444
--- src/distrib/sets/lists/debug/mi:1.443	Thu Aug 15 14:16:32 2024
+++ src/distrib

CVS commit: src

2024-08-15 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Thu Aug 15 21:19:46 UTC 2024

Modified Files:
src/distrib/sets/lists/comp: mi
src/distrib/sets/lists/debug: mi
src/distrib/sets/lists/tests: mi
src/include: uchar.h
src/lib/libc/locale: Makefile.inc
src/share/man/man3: uchar.3
src/tests/lib/libc/locale: Makefile
Added Files:
src/lib/libc/locale: c8rtomb.3 c8rtomb.c mbrtoc8.3 mbrtoc8.c
src/tests/lib/libc/locale: t_c8rtomb.c t_mbrtoc8.c

Log Message:
libc: New functions c8rtomb(3) and mbrtoc8(3).

New in C23, for converting from UTF-8 to locale-dependent multibyte
sequences (c8rtomb) or vice versa (mbrtoc8), along with the new type
char8_t.

Conditional on either:
- _NETBSD_SOURCE
- _ISOC23_SOURCE
- __STDC_VERSION__ >= 202311L

(Riding the libc minor bump from this morning for the UTF-16/UTF-32
versions from C11.)

PR standards/58601: uchar.h C23 compliance: char8_t, mbrtoc8, c8rtomb


To generate a diff of this commit:
cvs rdiff -u -r1.2469 -r1.2470 src/distrib/sets/lists/comp/mi
cvs rdiff -u -r1.443 -r1.444 src/distrib/sets/lists/debug/mi
cvs rdiff -u -r1.1331 -r1.1332 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.1 -r1.2 src/include/uchar.h
cvs rdiff -u -r1.66 -r1.67 src/lib/libc/locale/Makefile.inc
cvs rdiff -u -r0 -r1.1 src/lib/libc/locale/c8rtomb.3 \
src/lib/libc/locale/c8rtomb.c src/lib/libc/locale/mbrtoc8.3 \
src/lib/libc/locale/mbrtoc8.c
cvs rdiff -u -r1.1 -r1.2 src/share/man/man3/uchar.3
cvs rdiff -u -r1.17 -r1.18 src/tests/lib/libc/locale/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/lib/libc/locale/t_c8rtomb.c \
src/tests/lib/libc/locale/t_mbrtoc8.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

2024-08-15 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Thu Aug 15 21:08:20 UTC 2024

Modified Files:
src/sys/dev: vnd.c

Log Message:
Avoid division by zero when the backing file is revoked (e.g. from umount -f).


To generate a diff of this commit:
cvs rdiff -u -r1.289 -r1.290 src/sys/dev/vnd.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

2024-08-15 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Thu Aug 15 21:08:20 UTC 2024

Modified Files:
src/sys/dev: vnd.c

Log Message:
Avoid division by zero when the backing file is revoked (e.g. from umount -f).


To generate a diff of this commit:
cvs rdiff -u -r1.289 -r1.290 src/sys/dev/vnd.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/vnd.c
diff -u src/sys/dev/vnd.c:1.289 src/sys/dev/vnd.c:1.290
--- src/sys/dev/vnd.c:1.289	Fri May 19 15:42:43 2023
+++ src/sys/dev/vnd.c	Thu Aug 15 21:08:20 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: vnd.c,v 1.289 2023/05/19 15:42:43 mlelstv Exp $	*/
+/*	$NetBSD: vnd.c,v 1.290 2024/08/15 21:08:20 mlelstv Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2008, 2020 The NetBSD Foundation, Inc.
@@ -91,7 +91,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vnd.c,v 1.289 2023/05/19 15:42:43 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vnd.c,v 1.290 2024/08/15 21:08:20 mlelstv Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_vnd.h"
@@ -875,6 +875,9 @@ handle_with_strategy(struct vnd_softc *v
 	bn = obp->b_rawblkno * vnd->sc_dkdev.dk_label->d_secsize;
 
 	bsize = vnd->sc_vp->v_mount->mnt_stat.f_iosize;
+	/* use default if the filesystem didn't specify a block size */
+	if (bsize <= 0)
+		bsize = BLKDEV_IOSIZE;
 	skipped = 0;
 
 	/*



CVS commit: src/sys/sys

2024-08-15 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Thu Aug 15 20:42:59 UTC 2024

Modified Files:
src/sys/sys: featuretest.h

Log Message:
sys/featuretest.h: Cite references for _POSIX_C_SOURCE/_XOPEN_SOURCE.

No functional change intended, comment-only.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/sys/featuretest.h

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



CVS commit: src/sys/sys

2024-08-15 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Thu Aug 15 20:42:59 UTC 2024

Modified Files:
src/sys/sys: featuretest.h

Log Message:
sys/featuretest.h: Cite references for _POSIX_C_SOURCE/_XOPEN_SOURCE.

No functional change intended, comment-only.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/sys/featuretest.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/sys/featuretest.h
diff -u src/sys/sys/featuretest.h:1.11 src/sys/sys/featuretest.h:1.12
--- src/sys/sys/featuretest.h:1.11	Thu Aug 15 20:25:47 2024
+++ src/sys/sys/featuretest.h	Thu Aug 15 20:42:59 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: featuretest.h,v 1.11 2024/08/15 20:25:47 riastradh Exp $	*/
+/*	$NetBSD: featuretest.h,v 1.12 2024/08/15 20:42:59 riastradh Exp $	*/
 
 /*
  * Written by Klaus Klein , February 2, 1998.
@@ -31,6 +31,13 @@
  * _POSIX_C_SOURCE == 200809L   IEEE Std 1003.1-2008
  * _POSIX_C_SOURCE == 202405L   IEEE Std 1003.1-2024
  *
+ * Reference:
+ *
+ *	The Open Group Base Specifications Issue 8, IEEE Std
+ *	1003.1-2024, IEEE and The Open Group, 2024, Sec. 2.2.1.1 `The
+ *	_POSIX_C_SOURCE Feature Test Macro'.
+ *	https://pubs.opengroup.org/onlinepubs/9799919799.2024edition/functions/V2_chap02.html#tag_16_02_01_01
+ *
  * X/Open macros:
  * _XOPEN_SOURCE		System Interfaces and Headers, Issue 4, Ver 2
  * _XOPEN_SOURCE_EXTENDED == 1	XSH4.2 UNIX extensions
@@ -40,6 +47,13 @@
  * _XOPEN_SOURCE == 700		IEEE Std 1003.1-2008, XSI option
  * _XOPEN_SOURCE == 800		IEEE Std 1003.1-2024, XSI option
  *
+ * Reference:
+ *
+ *	The Open Group Base Specifications Issue 8, IEEE Std
+ *	1003.1-2024, IEEE and The Open Group, 2024, Sec. 2.2.1.2 `The
+ *	_XOPEN_SOURCE Feature Test Macro'.
+ *	https://pubs.opengroup.org/onlinepubs/9799919799.2024edition/functions/V2_chap02.html#tag_16_02_01_02
+ *
  * NetBSD macros:
  * _NETBSD_SOURCE == 1		Make all NetBSD features available.
  *



CVS commit: src/sys/sys

2024-08-15 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Thu Aug 15 20:25:47 UTC 2024

Modified Files:
src/sys/sys: featuretest.h

Log Message:
sys/featuretest.h: Update comments for POSIX 2024 and C23.

No functional change intended.

Maybe we should turn this into a man page.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/sys/featuretest.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/sys/featuretest.h
diff -u src/sys/sys/featuretest.h:1.10 src/sys/sys/featuretest.h:1.11
--- src/sys/sys/featuretest.h:1.10	Fri Apr 26 18:29:06 2013
+++ src/sys/sys/featuretest.h	Thu Aug 15 20:25:47 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: featuretest.h,v 1.10 2013/04/26 18:29:06 christos Exp $	*/
+/*	$NetBSD: featuretest.h,v 1.11 2024/08/15 20:25:47 riastradh Exp $	*/
 
 /*
  * Written by Klaus Klein , February 2, 1998.
@@ -29,6 +29,7 @@
  * _POSIX_C_SOURCE == 199506L	ISO/IEC 9945-1:1996
  * _POSIX_C_SOURCE == 200112L	IEEE Std 1003.1-2001
  * _POSIX_C_SOURCE == 200809L   IEEE Std 1003.1-2008
+ * _POSIX_C_SOURCE == 202405L   IEEE Std 1003.1-2024
  *
  * X/Open macros:
  * _XOPEN_SOURCE		System Interfaces and Headers, Issue 4, Ver 2
@@ -37,6 +38,7 @@
  * _XOPEN_SOURCE == 520		Networking Services (XNS), Issue 5.2
  * _XOPEN_SOURCE == 600		IEEE Std 1003.1-2001, XSI option
  * _XOPEN_SOURCE == 700		IEEE Std 1003.1-2008, XSI option
+ * _XOPEN_SOURCE == 800		IEEE Std 1003.1-2024, XSI option
  *
  * NetBSD macros:
  * _NETBSD_SOURCE == 1		Make all NetBSD features available.
@@ -54,11 +56,13 @@
  * defined along with one of the "major" macros.  The "minor" macros
  * are:
  *
- * _REENTRANT
- * _ISOC99_SOURCE
- * _ISOC11_SOURCE
- * _LARGEFILE_SOURCE		Large File Support
- *		
+ * _REENTRANT		Some thread-safety extensions like lgamma_r(3)
+ *			  (mostly subsumed by _POSIX_C_SOURCE >= 199506L)
+ * _ISOC99_SOURCE	C99 extensions like snprintf without -std=c99
+ * _ISOC11_SOURCE	C11 extensions like aligned_alloc without -std=c11
+ * _ISOC23_SOURCE	C23 extensions like mbrtoc8 without -std=c23
+ * _OPENBSD_SOURCE	Nonstandard OpenBSD extensions like strtonum(3)
+ * _GNU_SOURCE		Nonstandard GNU extensions like feenableexcept(3)
  */
 
 #if defined(_POSIX_SOURCE) && !defined(_POSIX_C_SOURCE)



CVS commit: src/sys/sys

2024-08-15 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Thu Aug 15 20:25:47 UTC 2024

Modified Files:
src/sys/sys: featuretest.h

Log Message:
sys/featuretest.h: Update comments for POSIX 2024 and C23.

No functional change intended.

Maybe we should turn this into a man page.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/sys/featuretest.h

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



CVS commit: src/lib/libc/locale

2024-08-15 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Thu Aug 15 20:23:26 UTC 2024

Modified Files:
src/lib/libc/locale: mbrtoc16.c

Log Message:
mbrtoc16(3): Simplify surrogate state test.

Turn the finer-grained test into an assertion.

No semantic change intended: we are supposed to control this state,
and we always arrange it this way.  (But in principle this could
change the behaviour of buggy programs that violate the mbstate_t
abstraction.)

PR lib/52374:  missing


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/lib/libc/locale/mbrtoc16.c

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



CVS commit: src/lib/libc/locale

2024-08-15 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Thu Aug 15 20:23:26 UTC 2024

Modified Files:
src/lib/libc/locale: mbrtoc16.c

Log Message:
mbrtoc16(3): Simplify surrogate state test.

Turn the finer-grained test into an assertion.

No semantic change intended: we are supposed to control this state,
and we always arrange it this way.  (But in principle this could
change the behaviour of buggy programs that violate the mbstate_t
abstraction.)

PR lib/52374:  missing


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/lib/libc/locale/mbrtoc16.c

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

Modified files:

Index: src/lib/libc/locale/mbrtoc16.c
diff -u src/lib/libc/locale/mbrtoc16.c:1.2 src/lib/libc/locale/mbrtoc16.c:1.3
--- src/lib/libc/locale/mbrtoc16.c:1.2	Thu Aug 15 15:46:40 2024
+++ src/lib/libc/locale/mbrtoc16.c	Thu Aug 15 20:23:26 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: mbrtoc16.c,v 1.2 2024/08/15 15:46:40 riastradh Exp $	*/
+/*	$NetBSD: mbrtoc16.c,v 1.3 2024/08/15 20:23:26 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2024 The NetBSD Foundation, Inc.
@@ -73,7 +73,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: mbrtoc16.c,v 1.2 2024/08/15 15:46:40 riastradh Exp $");
+__RCSID("$NetBSD: mbrtoc16.c,v 1.3 2024/08/15 20:23:26 riastradh Exp $");
 
 #include 
 #include 
@@ -134,11 +134,13 @@ mbrtoc16(char16_t *restrict pc16, const 
 	S = (struct mbrtoc16state *)ps;
 
 	/*
-	 * If there is a pending surrogate, stash it and consume no
+	 * If there is a pending surrogate, yield it and consume no
 	 * bytes of the input, returning (size_t)-3 to indicate that no
 	 * bytes of input were consumed.
 	 */
-	if (S->surrogate >= 0xdc00 && S->surrogate <= 0xdfff) {
+	if (S->surrogate != 0) {
+		_DIAGASSERT(S->surrogate >= 0xdc00);
+		_DIAGASSERT(S->surrogate <= 0xdfff);
 		if (pc16)
 			*pc16 = S->surrogate;
 		S->surrogate = 0;
@@ -184,6 +186,8 @@ mbrtoc16(char16_t *restrict pc16, const 
 			*pc16 = w1;
 		S->surrogate = w2;
 		_DIAGASSERT(S->surrogate != 0);
+		_DIAGASSERT(S->surrogate >= 0xdc00);
+		_DIAGASSERT(S->surrogate <= 0xdfff);
 	}
 
 	/*



CVS commit: src/share/misc

2024-08-15 Thread Jan Schaumann
Module Name:src
Committed By:   jschauma
Date:   Thu Aug 15 18:26:36 UTC 2024

Modified Files:
src/share/misc: acronyms.comp

Log Message:
+VHD  virtual hard disk


To generate a diff of this commit:
cvs rdiff -u -r1.390 -r1.391 src/share/misc/acronyms.comp

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

Modified files:

Index: src/share/misc/acronyms.comp
diff -u src/share/misc/acronyms.comp:1.390 src/share/misc/acronyms.comp:1.391
--- src/share/misc/acronyms.comp:1.390	Sun May 19 15:47:38 2024
+++ src/share/misc/acronyms.comp	Thu Aug 15 18:26:36 2024
@@ -1,4 +1,4 @@
-$NetBSD: acronyms.comp,v 1.390 2024/05/19 15:47:38 gutteridge Exp $
+$NetBSD: acronyms.comp,v 1.391 2024/08/15 18:26:36 jschauma Exp $
 3WHS	three-way handshake
 8VSB	8-state vestigial side band modulation
 AA	anti-aliasing
@@ -1849,6 +1849,7 @@ VFO	variable-frequency oscillator
 VFS	virtual file system
 VG	volume group
 VGA	Video Graphics Array
+VHD	virtual hard disk
 VHDCI	very high density cable interconnect
 VID	{VLAN,voltage level} identifier
 VIM	Vi IMproved



CVS commit: src/share/misc

2024-08-15 Thread Jan Schaumann
Module Name:src
Committed By:   jschauma
Date:   Thu Aug 15 18:26:36 UTC 2024

Modified Files:
src/share/misc: acronyms.comp

Log Message:
+VHD  virtual hard disk


To generate a diff of this commit:
cvs rdiff -u -r1.390 -r1.391 src/share/misc/acronyms.comp

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



CVS commit: src/sys/stand/efiboot

2024-08-15 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Thu Aug 15 15:57:36 UTC 2024

Modified Files:
src/sys/stand/efiboot: efifdt.h

Log Message:
efifdt.h: Break overlong line.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/stand/efiboot/efifdt.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/stand/efiboot/efifdt.h
diff -u src/sys/stand/efiboot/efifdt.h:1.13 src/sys/stand/efiboot/efifdt.h:1.14
--- src/sys/stand/efiboot/efifdt.h:1.13	Thu Aug 15 06:01:40 2024
+++ src/sys/stand/efiboot/efifdt.h	Thu Aug 15 15:57:36 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: efifdt.h,v 1.13 2024/08/15 06:01:40 skrll Exp $ */
+/* $NetBSD: efifdt.h,v 1.14 2024/08/15 15:57:36 riastradh Exp $ */
 
 /*-
  * Copyright (c) 2018 Jared McNeill 
@@ -52,4 +52,5 @@ void efi_fdt_system_table(void);
 int efi_fdt_prepare_boot(const char *, const char *, u_long *);
 void efi_fdt_cleanup_boot(void);
 size_t efi_fdt_alloc_size(void);
-void efi_fdt_set_virtual_address_map(EFI_MEMORY_DESCRIPTOR *, UINTN, UINTN, UINTN, UINT32);
+void efi_fdt_set_virtual_address_map(EFI_MEMORY_DESCRIPTOR *, UINTN, UINTN,
+UINTN, UINT32);



CVS commit: src/sys/stand/efiboot

2024-08-15 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Thu Aug 15 15:57:36 UTC 2024

Modified Files:
src/sys/stand/efiboot: efifdt.h

Log Message:
efifdt.h: Break overlong line.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/stand/efiboot/efifdt.h

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



CVS commit: src/lib/libc/locale

2024-08-15 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Thu Aug 15 15:46:40 UTC 2024

Modified Files:
src/lib/libc/locale: c16rtomb.c mbrtoc16.c mbrtoc32.c

Log Message:
libc: Use the more idiomatic alignof from stdalign.h.

No functional change intended.

PR lib/52374:  missing


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/lib/libc/locale/c16rtomb.c \
src/lib/libc/locale/mbrtoc16.c src/lib/libc/locale/mbrtoc32.c

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

Modified files:

Index: src/lib/libc/locale/c16rtomb.c
diff -u src/lib/libc/locale/c16rtomb.c:1.1 src/lib/libc/locale/c16rtomb.c:1.2
--- src/lib/libc/locale/c16rtomb.c:1.1	Thu Aug 15 14:16:33 2024
+++ src/lib/libc/locale/c16rtomb.c	Thu Aug 15 15:46:40 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: c16rtomb.c,v 1.1 2024/08/15 14:16:33 riastradh Exp $	*/
+/*	$NetBSD: c16rtomb.c,v 1.2 2024/08/15 15:46:40 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2024 The NetBSD Foundation, Inc.
@@ -66,11 +66,12 @@
  */
 
 #include 
-__RCSID("$NetBSD: c16rtomb.c,v 1.1 2024/08/15 14:16:33 riastradh Exp $");
+__RCSID("$NetBSD: c16rtomb.c,v 1.2 2024/08/15 15:46:40 riastradh Exp $");
 
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -83,7 +84,7 @@ struct c16rtombstate {
 __CTASSERT(offsetof(struct c16rtombstate, mbs) <= sizeof(mbstate_t));
 __CTASSERT(sizeof(struct c32rtombstate) <= sizeof(mbstate_t) -
 offsetof(struct c16rtombstate, mbs));
-__CTASSERT(_Alignof(struct c16rtombstate) <= _Alignof(mbstate_t));
+__CTASSERT(alignof(struct c16rtombstate) <= alignof(mbstate_t));
 
 size_t
 c16rtomb(char *restrict s, char16_t c16, mbstate_t *restrict ps)
Index: src/lib/libc/locale/mbrtoc16.c
diff -u src/lib/libc/locale/mbrtoc16.c:1.1 src/lib/libc/locale/mbrtoc16.c:1.2
--- src/lib/libc/locale/mbrtoc16.c:1.1	Thu Aug 15 14:16:33 2024
+++ src/lib/libc/locale/mbrtoc16.c	Thu Aug 15 15:46:40 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: mbrtoc16.c,v 1.1 2024/08/15 14:16:33 riastradh Exp $	*/
+/*	$NetBSD: mbrtoc16.c,v 1.2 2024/08/15 15:46:40 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2024 The NetBSD Foundation, Inc.
@@ -73,10 +73,11 @@
  */
 
 #include 
-__RCSID("$NetBSD: mbrtoc16.c,v 1.1 2024/08/15 14:16:33 riastradh Exp $");
+__RCSID("$NetBSD: mbrtoc16.c,v 1.2 2024/08/15 15:46:40 riastradh Exp $");
 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -89,7 +90,7 @@ struct mbrtoc16state {
 __CTASSERT(offsetof(struct mbrtoc16state, mbs) <= sizeof(mbstate_t));
 __CTASSERT(sizeof(struct mbrtoc32state) <= sizeof(mbstate_t) -
 offsetof(struct mbrtoc16state, mbs));
-__CTASSERT(_Alignof(struct mbrtoc16state) <= _Alignof(mbstate_t));
+__CTASSERT(alignof(struct mbrtoc16state) <= alignof(mbstate_t));
 
 size_t
 mbrtoc16(char16_t *restrict pc16, const char *restrict s, size_t n,
Index: src/lib/libc/locale/mbrtoc32.c
diff -u src/lib/libc/locale/mbrtoc32.c:1.1 src/lib/libc/locale/mbrtoc32.c:1.2
--- src/lib/libc/locale/mbrtoc32.c:1.1	Thu Aug 15 14:16:33 2024
+++ src/lib/libc/locale/mbrtoc32.c	Thu Aug 15 15:46:40 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: mbrtoc32.c,v 1.1 2024/08/15 14:16:33 riastradh Exp $	*/
+/*	$NetBSD: mbrtoc32.c,v 1.2 2024/08/15 15:46:40 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2024 The NetBSD Foundation, Inc.
@@ -52,7 +52,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: mbrtoc32.c,v 1.1 2024/08/15 14:16:33 riastradh Exp $");
+__RCSID("$NetBSD: mbrtoc32.c,v 1.2 2024/08/15 15:46:40 riastradh Exp $");
 
 #include 		/* MIN */
 #include 		/* broken citrus_*.h */
@@ -63,6 +63,7 @@ __RCSID("$NetBSD: mbrtoc32.c,v 1.1 2024/
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -77,7 +78,7 @@ __RCSID("$NetBSD: mbrtoc32.c,v 1.1 2024/
 #include "mbrtoc32.h"
 
 __CTASSERT(sizeof(struct mbrtoc32state) <= sizeof(mbstate_t));
-__CTASSERT(_Alignof(struct mbrtoc32state) <= _Alignof(mbstate_t));
+__CTASSERT(alignof(struct mbrtoc32state) <= alignof(mbstate_t));
 
 size_t
 mbrtoc32(char32_t *restrict pc32, const char *restrict s, size_t n,



CVS commit: src/lib/libc/locale

2024-08-15 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Thu Aug 15 15:46:40 UTC 2024

Modified Files:
src/lib/libc/locale: c16rtomb.c mbrtoc16.c mbrtoc32.c

Log Message:
libc: Use the more idiomatic alignof from stdalign.h.

No functional change intended.

PR lib/52374:  missing


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/lib/libc/locale/c16rtomb.c \
src/lib/libc/locale/mbrtoc16.c src/lib/libc/locale/mbrtoc32.c

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



CVS commit: src/lib/libc/locale

2024-08-15 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Thu Aug 15 14:58:00 UTC 2024

Modified Files:
src/lib/libc/locale: c16rtomb.3 c32rtomb.3

Log Message:
c16rtomb(3), c32rtomb(3): Fix more \n in man pages.

Also, tighten an assertion: we left room for a NUL byte at the end.

PR lib/52374:  missing


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/lib/libc/locale/c16rtomb.3 \
src/lib/libc/locale/c32rtomb.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/libc/locale/c16rtomb.3
diff -u src/lib/libc/locale/c16rtomb.3:1.1 src/lib/libc/locale/c16rtomb.3:1.2
--- src/lib/libc/locale/c16rtomb.3:1.1	Thu Aug 15 14:16:33 2024
+++ src/lib/libc/locale/c16rtomb.3	Thu Aug 15 14:58:00 2024
@@ -1,4 +1,4 @@
-.\"	$NetBSD: c16rtomb.3,v 1.1 2024/08/15 14:16:33 riastradh Exp $
+.\"	$NetBSD: c16rtomb.3,v 1.2 2024/08/15 14:58:00 riastradh Exp $
 .\"
 .\" Copyright (c) 2024 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -113,11 +113,11 @@ for (i = 0; i < __arraycount(c16); i++) 
 	len = c16rtomb(s, c16[i], &mbs);
 	if (len == (size_t)-1)
 		err(1, "c16rtomb");
-	assert(len <= sizeof(buf) - (s - buf));
+	assert(len < sizeof(buf) - (s - buf));
 	s += len;
 }
 *s = '\e0';		/* NUL-terminate */
-printf("%s\n", buf);
+printf("%s\en", buf);
 .Ed
 .\"
 .Sh ERRORS
Index: src/lib/libc/locale/c32rtomb.3
diff -u src/lib/libc/locale/c32rtomb.3:1.1 src/lib/libc/locale/c32rtomb.3:1.2
--- src/lib/libc/locale/c32rtomb.3:1.1	Thu Aug 15 14:16:33 2024
+++ src/lib/libc/locale/c32rtomb.3	Thu Aug 15 14:58:00 2024
@@ -1,4 +1,4 @@
-.\"	$NetBSD: c32rtomb.3,v 1.1 2024/08/15 14:16:33 riastradh Exp $
+.\"	$NetBSD: c32rtomb.3,v 1.2 2024/08/15 14:58:00 riastradh Exp $
 .\"
 .\" Copyright (c) 2024 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -96,11 +96,11 @@ for (i = 0; i < __arraycount(c32); i++) 
 	len = c32rtomb(s, c32[i], &mbs);
 	if (len == (size_t)-1)
 		err(1, "c32rtomb");
-	assert(len <= sizeof(buf) - (s - buf));
+	assert(len < sizeof(buf) - (s - buf));
 	s += len;
 }
 *s = '\e0';		/* NUL-terminate */
-printf("%s\n", buf);
+printf("%s\en", buf);
 .Ed
 .\"
 .Sh ERRORS



CVS commit: src/lib/libc/locale

2024-08-15 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Thu Aug 15 14:58:00 UTC 2024

Modified Files:
src/lib/libc/locale: c16rtomb.3 c32rtomb.3

Log Message:
c16rtomb(3), c32rtomb(3): Fix more \n in man pages.

Also, tighten an assertion: we left room for a NUL byte at the end.

PR lib/52374:  missing


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/lib/libc/locale/c16rtomb.3 \
src/lib/libc/locale/c32rtomb.3

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



CVS commit: src/lib/libc/locale

2024-08-15 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Thu Aug 15 14:42:20 UTC 2024

Modified Files:
src/lib/libc/locale: mbrtoc16.3 mbrtoc32.3

Log Message:
mbrtoc16(3), mbrtoc32(3): Fix \n in man page examples.

Need to write \en to pacify roff.

PR lib/52374:  missing


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/lib/libc/locale/mbrtoc16.3 \
src/lib/libc/locale/mbrtoc32.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/libc/locale/mbrtoc16.3
diff -u src/lib/libc/locale/mbrtoc16.3:1.1 src/lib/libc/locale/mbrtoc16.3:1.2
--- src/lib/libc/locale/mbrtoc16.3:1.1	Thu Aug 15 14:16:33 2024
+++ src/lib/libc/locale/mbrtoc16.3	Thu Aug 15 14:42:20 2024
@@ -1,4 +1,4 @@
-.\"	$NetBSD: mbrtoc16.3,v 1.1 2024/08/15 14:16:33 riastradh Exp $
+.\"	$NetBSD: mbrtoc16.3,v 1.2 2024/08/15 14:42:20 riastradh Exp $
 .\"
 .\" Copyright (c) 2024 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -244,16 +244,16 @@ while (n) {
 		assert(c16 == L'\e0');
 		goto out;
 	default:	/* scalar value or high surrogate */
-		printf("U+%04"PRIx16"\n", (uint16_t)c16);
+		printf("U+%04"PRIx16"\en", (uint16_t)c16);
 		break;
 	case (size_t)-3: /* low surrogate */
-		printf("continue U+%04"PRIx16"\n", (uint16_t)c16);
+		printf("continue U+%04"PRIx16"\en", (uint16_t)c16);
 		break;
 	case (size_t)-2: /* incomplete */
 		printf("incomplete\en");
 		goto readmore;
 	case (size_t)-1: /* error */
-		printf("error: %d\n", errno);
+		printf("error: %d\en", errno);
 		goto out;
 	}
 	s += len;
Index: src/lib/libc/locale/mbrtoc32.3
diff -u src/lib/libc/locale/mbrtoc32.3:1.1 src/lib/libc/locale/mbrtoc32.3:1.2
--- src/lib/libc/locale/mbrtoc32.3:1.1	Thu Aug 15 14:16:33 2024
+++ src/lib/libc/locale/mbrtoc32.3	Thu Aug 15 14:42:20 2024
@@ -1,4 +1,4 @@
-.\"	$NetBSD: mbrtoc32.3,v 1.1 2024/08/15 14:16:33 riastradh Exp $
+.\"	$NetBSD: mbrtoc32.3,v 1.2 2024/08/15 14:42:20 riastradh Exp $
 .\"
 .\" Copyright (c) 2024 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -185,13 +185,13 @@ while (n) {
 		assert(c32 == L'\e0');
 		goto out;
 	default:		/* scalar value */
-		printf("U+%04"PRIx32"\n", (uint32_t)c32);
+		printf("U+%04"PRIx32"\en", (uint32_t)c32);
 		break;
 	case (size_t)-2:	/* incomplete */
 		printf("incomplete\en");
 		goto readmore;
 	case (size_t)-1:	/* error */
-		printf("error: %d\n", errno);
+		printf("error: %d\en", errno);
 		goto out;
 	}
 	s += len;



CVS commit: src/lib/libc/locale

2024-08-15 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Thu Aug 15 14:42:20 UTC 2024

Modified Files:
src/lib/libc/locale: mbrtoc16.3 mbrtoc32.3

Log Message:
mbrtoc16(3), mbrtoc32(3): Fix \n in man page examples.

Need to write \en to pacify roff.

PR lib/52374:  missing


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/lib/libc/locale/mbrtoc16.3 \
src/lib/libc/locale/mbrtoc32.3

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



CVS commit: src

2024-08-15 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Thu Aug 15 14:16:34 UTC 2024

Modified Files:
src/distrib/sets/lists/base: shl.mi
src/distrib/sets/lists/comp: mi
src/distrib/sets/lists/debug: mi
src/distrib/sets/lists/tests: mi
src/lib/libc: shlib_version
src/lib/libc/locale: Makefile.inc
src/share/man/man3: Makefile
src/tests/lib/libc/locale: Makefile
Added Files:
src/lib/libc/locale: c16rtomb.3 c16rtomb.c c32rtomb.3 c32rtomb.c
c32rtomb.h mbrtoc16.3 mbrtoc16.c mbrtoc32.3 mbrtoc32.c mbrtoc32.h
src/share/man/man3: uchar.3
src/tests/lib/libc/locale: t_c16rtomb.c t_c32rtomb.c t_mbrtoc16.c
t_mbrtoc32.c

Log Message:
libc: New C11 functions mbrtoc16, mbrtoc32, c16rtomb, c32rtomb.

The mbrtoc16/32 functions read mulitbyte strings according to the
current locale into UTF-16/32 code unit sequences; the c16/32rtomb
functions write UTF-16/32 code unit sequences into multibyte strings
according to the current locale.  The `r' means restartable: they
work incrementally and pick up where they left off.

NOTE: This bumps the libc minor version, since it adds new symbols.

PR lib/52374:  missing


To generate a diff of this commit:
cvs rdiff -u -r1.987 -r1.988 src/distrib/sets/lists/base/shl.mi
cvs rdiff -u -r1.2468 -r1.2469 src/distrib/sets/lists/comp/mi
cvs rdiff -u -r1.442 -r1.443 src/distrib/sets/lists/debug/mi
cvs rdiff -u -r1.1330 -r1.1331 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.296 -r1.297 src/lib/libc/shlib_version
cvs rdiff -u -r1.65 -r1.66 src/lib/libc/locale/Makefile.inc
cvs rdiff -u -r0 -r1.1 src/lib/libc/locale/c16rtomb.3 \
src/lib/libc/locale/c16rtomb.c src/lib/libc/locale/c32rtomb.3 \
src/lib/libc/locale/c32rtomb.c src/lib/libc/locale/c32rtomb.h \
src/lib/libc/locale/mbrtoc16.3 src/lib/libc/locale/mbrtoc16.c \
src/lib/libc/locale/mbrtoc32.3 src/lib/libc/locale/mbrtoc32.c \
src/lib/libc/locale/mbrtoc32.h
cvs rdiff -u -r1.92 -r1.93 src/share/man/man3/Makefile
cvs rdiff -u -r0 -r1.1 src/share/man/man3/uchar.3
cvs rdiff -u -r1.16 -r1.17 src/tests/lib/libc/locale/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/lib/libc/locale/t_c16rtomb.c \
src/tests/lib/libc/locale/t_c32rtomb.c \
src/tests/lib/libc/locale/t_mbrtoc16.c \
src/tests/lib/libc/locale/t_mbrtoc32.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/sets/lists/base/shl.mi
diff -u src/distrib/sets/lists/base/shl.mi:1.987 src/distrib/sets/lists/base/shl.mi:1.988
--- src/distrib/sets/lists/base/shl.mi:1.987	Fri Aug  2 17:25:38 2024
+++ src/distrib/sets/lists/base/shl.mi	Thu Aug 15 14:16:32 2024
@@ -1,4 +1,4 @@
-# $NetBSD: shl.mi,v 1.987 2024/08/02 17:25:38 christos Exp $
+# $NetBSD: shl.mi,v 1.988 2024/08/15 14:16:32 riastradh Exp $
 #
 # Note:	Don't delete entries from here - mark them as "obsolete" instead,
 #	unless otherwise stated below.
@@ -22,7 +22,7 @@
 ./lib/libblocklist.so.0.1			base-sys-shlib		dynamicroot
 ./lib/libc.so	base-sys-shlib		dynamicroot
 ./lib/libc.so.12base-sys-shlib		dynamicroot
-./lib/libc.so.12.221base-sys-shlib		dynamicroot
+./lib/libc.so.12.222base-sys-shlib		dynamicroot
 ./lib/libcrypt.sobase-sys-shlib		dynamicroot
 ./lib/libcrypt.so.1base-sys-shlib		dynamicroot
 ./lib/libcrypt.so.1.0base-sys-shlib		dynamicroot
@@ -257,7 +257,7 @@
 ./usr/lib/libc++.so.1.0base-sys-shlib		compatfile,libcxx
 ./usr/lib/libc.sobase-sys-shlib		compatfile
 ./usr/lib/libc.so.12base-sys-shlib		compatfile
-./usr/lib/libc.so.12.221			base-sys-shlib		compatfile
+./usr/lib/libc.so.12.222			base-sys-shlib		compatfile
 ./usr/lib/libcbor.sobase-sys-shlib		compatfile
 ./usr/lib/libcbor.so.0base-sys-shlib		compatfile
 ./usr/lib/libcbor.so.0.5			base-sys-shlib		compatfile

Index: src/distrib/sets/lists/comp/mi
diff -u src/distrib/sets/lists/comp/mi:1.2468 src/distrib/sets/lists/comp/mi:1.2469
--- src/distrib/sets/lists/comp/mi:1.2468	Thu Aug 15 13:14:43 2024
+++ src/distrib/sets/lists/comp/mi	Thu Aug 15 14:16:32 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: mi,v 1.2468 2024/08/15 13:14:43 riastradh Exp $
+#	$NetBSD: mi,v 1.2469 2024/08/15 14:16:32 riastradh Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 ./etc/mtree/set.compcomp-sys-root
@@ -6842,6 +6842,8 @@
 ./usr/share/man/cat3/bufferevent_write_buffer.0 comp-obsolete		obsolete
 ./usr/share/man/cat3/byteorder.0		comp-c-catman		.cat
 ./usr/share/man/cat3/bzero.0			comp-c-catman		.cat
+./usr/share/man/cat3/c16rtomb.0			comp-c-catman		.cat
+./usr/share/man/cat3/c32rtomb.0			comp-c-catman		.cat
 ./usr/share/man/cat3/cabs.0			comp-c-catman		complex,.cat
 ./usr/share/man/cat3/cabsf.0			comp-c-catman		complex,.cat
 ./usr/share/man/cat3/cabsl.0			comp-c-catman		complex,.cat
@@ -9204,6 +9206,8 @@
 ./usr/share/man/cat3/math.0			comp-c-catman		.cat
 ./usr/share/man/cat3/mblen.0			comp-c-cat

CVS commit: src

2024-08-15 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Thu Aug 15 14:16:34 UTC 2024

Modified Files:
src/distrib/sets/lists/base: shl.mi
src/distrib/sets/lists/comp: mi
src/distrib/sets/lists/debug: mi
src/distrib/sets/lists/tests: mi
src/lib/libc: shlib_version
src/lib/libc/locale: Makefile.inc
src/share/man/man3: Makefile
src/tests/lib/libc/locale: Makefile
Added Files:
src/lib/libc/locale: c16rtomb.3 c16rtomb.c c32rtomb.3 c32rtomb.c
c32rtomb.h mbrtoc16.3 mbrtoc16.c mbrtoc32.3 mbrtoc32.c mbrtoc32.h
src/share/man/man3: uchar.3
src/tests/lib/libc/locale: t_c16rtomb.c t_c32rtomb.c t_mbrtoc16.c
t_mbrtoc32.c

Log Message:
libc: New C11 functions mbrtoc16, mbrtoc32, c16rtomb, c32rtomb.

The mbrtoc16/32 functions read mulitbyte strings according to the
current locale into UTF-16/32 code unit sequences; the c16/32rtomb
functions write UTF-16/32 code unit sequences into multibyte strings
according to the current locale.  The `r' means restartable: they
work incrementally and pick up where they left off.

NOTE: This bumps the libc minor version, since it adds new symbols.

PR lib/52374:  missing


To generate a diff of this commit:
cvs rdiff -u -r1.987 -r1.988 src/distrib/sets/lists/base/shl.mi
cvs rdiff -u -r1.2468 -r1.2469 src/distrib/sets/lists/comp/mi
cvs rdiff -u -r1.442 -r1.443 src/distrib/sets/lists/debug/mi
cvs rdiff -u -r1.1330 -r1.1331 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.296 -r1.297 src/lib/libc/shlib_version
cvs rdiff -u -r1.65 -r1.66 src/lib/libc/locale/Makefile.inc
cvs rdiff -u -r0 -r1.1 src/lib/libc/locale/c16rtomb.3 \
src/lib/libc/locale/c16rtomb.c src/lib/libc/locale/c32rtomb.3 \
src/lib/libc/locale/c32rtomb.c src/lib/libc/locale/c32rtomb.h \
src/lib/libc/locale/mbrtoc16.3 src/lib/libc/locale/mbrtoc16.c \
src/lib/libc/locale/mbrtoc32.3 src/lib/libc/locale/mbrtoc32.c \
src/lib/libc/locale/mbrtoc32.h
cvs rdiff -u -r1.92 -r1.93 src/share/man/man3/Makefile
cvs rdiff -u -r0 -r1.1 src/share/man/man3/uchar.3
cvs rdiff -u -r1.16 -r1.17 src/tests/lib/libc/locale/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/lib/libc/locale/t_c16rtomb.c \
src/tests/lib/libc/locale/t_c32rtomb.c \
src/tests/lib/libc/locale/t_mbrtoc16.c \
src/tests/lib/libc/locale/t_mbrtoc32.c

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



CVS commit: src

2024-08-15 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Thu Aug 15 13:14:44 UTC 2024

Modified Files:
src/distrib/sets/lists/comp: mi
src/distrib/sets/lists/debug: mi
src/distrib/sets/lists/tests: mi
src/include: Makefile
src/tests/lib/libc/locale: Makefile
Added Files:
src/include: uchar.h
src/tests/lib/libc/locale: t_uchar.c

Log Message:
uchar.h: New header file for C11 (and C++11) compliance.

Implementation of the new functions mbrtoc16, c16rtomb, mbrtoc32, and
c32rtomb to come later.  Updates for C23 to come later.

PR lib/52374:  missing


To generate a diff of this commit:
cvs rdiff -u -r1.2467 -r1.2468 src/distrib/sets/lists/comp/mi
cvs rdiff -u -r1.441 -r1.442 src/distrib/sets/lists/debug/mi
cvs rdiff -u -r1.1329 -r1.1330 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.146 -r1.147 src/include/Makefile
cvs rdiff -u -r0 -r1.1 src/include/uchar.h
cvs rdiff -u -r1.15 -r1.16 src/tests/lib/libc/locale/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/lib/libc/locale/t_uchar.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/sets/lists/comp/mi
diff -u src/distrib/sets/lists/comp/mi:1.2467 src/distrib/sets/lists/comp/mi:1.2468
--- src/distrib/sets/lists/comp/mi:1.2467	Mon Aug  5 13:06:38 2024
+++ src/distrib/sets/lists/comp/mi	Thu Aug 15 13:14:43 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: mi,v 1.2467 2024/08/05 13:06:38 christos Exp $
+#	$NetBSD: mi,v 1.2468 2024/08/15 13:14:43 riastradh Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 ./etc/mtree/set.compcomp-sys-root
@@ -3679,6 +3679,7 @@
 ./usr/include/tss/tss_typedef.h			comp-c-include		tpm
 ./usr/include/ttyent.hcomp-c-include
 ./usr/include/tzfile.hcomp-c-include
+./usr/include/uchar.hcomp-c-include
 ./usr/include/ucontext.h			comp-c-include
 ./usr/include/ufs/ext2fs/ext2fs.h		comp-c-include
 ./usr/include/ufs/ext2fs/ext2fs_dinode.h	comp-c-include

Index: src/distrib/sets/lists/debug/mi
diff -u src/distrib/sets/lists/debug/mi:1.441 src/distrib/sets/lists/debug/mi:1.442
--- src/distrib/sets/lists/debug/mi:1.441	Fri Aug  9 23:24:15 2024
+++ src/distrib/sets/lists/debug/mi	Thu Aug 15 13:14:44 2024
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.441 2024/08/09 23:24:15 bad Exp $
+# $NetBSD: mi,v 1.442 2024/08/15 13:14:44 riastradh Exp $
 #
 ./etc/mtree/set.debug   comp-sys-root
 ./usr/lib	comp-sys-usr		compatdir
@@ -2070,6 +2070,7 @@
 ./usr/libdata/debug/usr/tests/lib/libc/locale/t_sprintf.debug		tests-lib-debug		debug,atf,compattestfile
 ./usr/libdata/debug/usr/tests/lib/libc/locale/t_strfmon.debug		tests-lib-debug		debug,atf,compattestfile
 ./usr/libdata/debug/usr/tests/lib/libc/locale/t_toupper.debug		tests-lib-debug		debug,atf,compattestfile
+./usr/libdata/debug/usr/tests/lib/libc/locale/t_uchar.debug		tests-lib-debug		debug,atf,compattestfile
 ./usr/libdata/debug/usr/tests/lib/libc/locale/t_wcscoll.debug		tests-lib-debug		debug,atf,compattestfile
 ./usr/libdata/debug/usr/tests/lib/libc/locale/t_wcscspn.debug		tests-lib-debug		debug,atf,compattestfile
 ./usr/libdata/debug/usr/tests/lib/libc/locale/t_wcspbrk.debug		tests-lib-debug		debug,atf,compattestfile

Index: src/distrib/sets/lists/tests/mi
diff -u src/distrib/sets/lists/tests/mi:1.1329 src/distrib/sets/lists/tests/mi:1.1330
--- src/distrib/sets/lists/tests/mi:1.1329	Fri Aug  9 23:24:15 2024
+++ src/distrib/sets/lists/tests/mi	Thu Aug 15 13:14:44 2024
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1329 2024/08/09 23:24:15 bad Exp $
+# $NetBSD: mi,v 1.1330 2024/08/15 13:14:44 riastradh Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -3085,6 +3085,7 @@
 ./usr/tests/lib/libc/locale/t_sprintf			tests-lib-tests		compattestfile,atf
 ./usr/tests/lib/libc/locale/t_strfmon			tests-lib-tests		compattestfile,atf
 ./usr/tests/lib/libc/locale/t_toupper			tests-lib-tests		compattestfile,atf
+./usr/tests/lib/libc/locale/t_uchar			tests-lib-tests		compattestfile,atf
 ./usr/tests/lib/libc/locale/t_wcscoll			tests-lib-tests		compattestfile,atf
 ./usr/tests/lib/libc/locale/t_wcscspn			tests-lib-tests		compattestfile,atf
 ./usr/tests/lib/libc/locale/t_wcspbrk			tests-lib-tests		compattestfile,atf

Index: src/include/Makefile
diff -u src/include/Makefile:1.146 src/include/Makefile:1.147
--- src/include/Makefile:1.146	Tue Jun  4 15:07:55 2019
+++ src/include/Makefile	Thu Aug 15 13:14:44 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.146 2019/06/04 15:07:55 hannken Exp $
+#	$NetBSD: Makefile,v 1.147 2024/08/15 13:14:44 riastradh Exp $
 #	@(#)Makefile	8.2 (Berkeley) 1/4/94
 
 # Doing a make includes builds /usr/include
@@ -21,6 +21,7 @@ INCS=	a.out.h aio.h ar.h assert.h atomic
 	string.h sgtty.h signal.h spawn.h stab.h stdalign.h stddef.h stdio.h \
 	stdlib.h stdnoreturn.h strings.h stringlist.h struct.h sysexits.h \
 	tar.h time.h ttyent.h tzfile.h \
+	uchar.h \
 	ucontext.h ulimi

CVS commit: src

2024-08-15 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Thu Aug 15 13:14:44 UTC 2024

Modified Files:
src/distrib/sets/lists/comp: mi
src/distrib/sets/lists/debug: mi
src/distrib/sets/lists/tests: mi
src/include: Makefile
src/tests/lib/libc/locale: Makefile
Added Files:
src/include: uchar.h
src/tests/lib/libc/locale: t_uchar.c

Log Message:
uchar.h: New header file for C11 (and C++11) compliance.

Implementation of the new functions mbrtoc16, c16rtomb, mbrtoc32, and
c32rtomb to come later.  Updates for C23 to come later.

PR lib/52374:  missing


To generate a diff of this commit:
cvs rdiff -u -r1.2467 -r1.2468 src/distrib/sets/lists/comp/mi
cvs rdiff -u -r1.441 -r1.442 src/distrib/sets/lists/debug/mi
cvs rdiff -u -r1.1329 -r1.1330 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.146 -r1.147 src/include/Makefile
cvs rdiff -u -r0 -r1.1 src/include/uchar.h
cvs rdiff -u -r1.15 -r1.16 src/tests/lib/libc/locale/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/lib/libc/locale/t_uchar.c

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



CVS commit: src/sys/uvm

2024-08-15 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Thu Aug 15 11:33:21 UTC 2024

Modified Files:
src/sys/uvm: uvm_map.c

Log Message:
uvm_map(9): Apply the same orig_hint clamp again to the same entry.

Previous change dealt with case like length=0x1000 and:

[0x7defb000,0x7defc000) entry above orig_hint (entry->next)
0x77895000  orig_hint
[0x77894000,0x77895000) entry below orig_hint (entry)

by changing

entry->next->start - length

to

MIN(orig_hint, entry->next->start - length)

in order to enforce monotonicity of search.

In this case, if the tree search for a gap has failed, we retry with
a list search with exactly the same orig_hint and entry -- nothing
has changed them (only hint and tmp).  So apply the same clamping.

PR kern/51254: uvm assertion "!topdown || hint <= orig_hint" failed


To generate a diff of this commit:
cvs rdiff -u -r1.424 -r1.425 src/sys/uvm/uvm_map.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/uvm_map.c
diff -u src/sys/uvm/uvm_map.c:1.424 src/sys/uvm/uvm_map.c:1.425
--- src/sys/uvm/uvm_map.c:1.424	Wed Aug 14 22:24:09 2024
+++ src/sys/uvm/uvm_map.c	Thu Aug 15 11:33:21 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_map.c,v 1.424 2024/08/14 22:24:09 rin Exp $	*/
+/*	$NetBSD: uvm_map.c,v 1.425 2024/08/15 11:33:21 riastradh Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -66,7 +66,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uvm_map.c,v 1.424 2024/08/14 22:24:09 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_map.c,v 1.425 2024/08/15 11:33:21 riastradh Exp $");
 
 #include "opt_ddb.h"
 #include "opt_pax.h"
@@ -2256,7 +2256,8 @@ nextgap:
 	INVARIANTS();
 	for (;;) {
 		/* Update hint for current gap. */
-		hint = topdown ? entry->next->start - length : entry->end;
+		hint = topdown ? MIN(orig_hint, entry->next->start - length)
+		: entry->end;
 		INVARIANTS();
 
 		/* See if it fits. */



CVS commit: src/sys/uvm

2024-08-15 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Thu Aug 15 11:33:21 UTC 2024

Modified Files:
src/sys/uvm: uvm_map.c

Log Message:
uvm_map(9): Apply the same orig_hint clamp again to the same entry.

Previous change dealt with case like length=0x1000 and:

[0x7defb000,0x7defc000) entry above orig_hint (entry->next)
0x77895000  orig_hint
[0x77894000,0x77895000) entry below orig_hint (entry)

by changing

entry->next->start - length

to

MIN(orig_hint, entry->next->start - length)

in order to enforce monotonicity of search.

In this case, if the tree search for a gap has failed, we retry with
a list search with exactly the same orig_hint and entry -- nothing
has changed them (only hint and tmp).  So apply the same clamping.

PR kern/51254: uvm assertion "!topdown || hint <= orig_hint" failed


To generate a diff of this commit:
cvs rdiff -u -r1.424 -r1.425 src/sys/uvm/uvm_map.c

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



CVS commit: src/sys/net

2024-08-15 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Thu Aug 15 11:23:39 UTC 2024

Modified Files:
src/sys/net: bpf.c

Log Message:
bpf(4): KNF whitespace fixes.  No functional change intended.

Preparation for:

kern/58596: bpf(4) MP-safety issues


To generate a diff of this commit:
cvs rdiff -u -r1.254 -r1.255 src/sys/net/bpf.c

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



CVS commit: src/sys/net

2024-08-15 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Thu Aug 15 11:23:39 UTC 2024

Modified Files:
src/sys/net: bpf.c

Log Message:
bpf(4): KNF whitespace fixes.  No functional change intended.

Preparation for:

kern/58596: bpf(4) MP-safety issues


To generate a diff of this commit:
cvs rdiff -u -r1.254 -r1.255 src/sys/net/bpf.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/net/bpf.c
diff -u src/sys/net/bpf.c:1.254 src/sys/net/bpf.c:1.255
--- src/sys/net/bpf.c:1.254	Thu Aug 15 11:23:29 2024
+++ src/sys/net/bpf.c	Thu Aug 15 11:23:39 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: bpf.c,v 1.254 2024/08/15 11:23:29 riastradh Exp $	*/
+/*	$NetBSD: bpf.c,v 1.255 2024/08/15 11:23:39 riastradh Exp $	*/
 
 /*
  * Copyright (c) 1990, 1991, 1993
@@ -39,7 +39,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: bpf.c,v 1.254 2024/08/15 11:23:29 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bpf.c,v 1.255 2024/08/15 11:23:39 riastradh Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_bpf.h"
@@ -185,10 +185,10 @@ static struct pslist_head bpf_dlist;
 	PSLIST_WRITER_INSERT_HEAD(&bpf_dlist, (__d), bd_bpf_dlist_entry)
 #define BPF_DLIST_READER_FOREACH(__d)	\
 	PSLIST_READER_FOREACH((__d), &bpf_dlist, struct bpf_d,		\
-	  bd_bpf_dlist_entry)
+	bd_bpf_dlist_entry)
 #define BPF_DLIST_WRITER_FOREACH(__d)	\
 	PSLIST_WRITER_FOREACH((__d), &bpf_dlist, struct bpf_d,		\
-	  bd_bpf_dlist_entry)
+	bd_bpf_dlist_entry)
 #define BPF_DLIST_ENTRY_INIT(__d)	\
 	PSLIST_ENTRY_INIT((__d), bd_bpf_dlist_entry)
 #define BPF_DLIST_WRITER_REMOVE(__d)	\
@@ -201,10 +201,10 @@ static struct pslist_head bpf_dlist;
 	PSLIST_WRITER_INSERT_HEAD(&bpf_iflist, (__bp), bif_iflist_entry)
 #define BPF_IFLIST_READER_FOREACH(__bp)	\
 	PSLIST_READER_FOREACH((__bp), &bpf_iflist, struct bpf_if,	\
-	  bif_iflist_entry)
+	bif_iflist_entry)
 #define BPF_IFLIST_WRITER_FOREACH(__bp)	\
 	PSLIST_WRITER_FOREACH((__bp), &bpf_iflist, struct bpf_if,	\
-	  bif_iflist_entry)
+	bif_iflist_entry)
 #define BPF_IFLIST_WRITER_REMOVE(__bp)	\
 	PSLIST_WRITER_REMOVE((__bp), bif_iflist_entry)
 #define BPF_IFLIST_ENTRY_INIT(__bp)	\
@@ -215,35 +215,35 @@ static struct pslist_head bpf_dlist;
 /* Macros for bpf_d on bpf_if#bif_dlist_pslist */
 #define BPFIF_DLIST_READER_FOREACH(__d, __bp)\
 	PSLIST_READER_FOREACH((__d), &(__bp)->bif_dlist_head, struct bpf_d, \
-	  bd_bif_dlist_entry)
+	bd_bif_dlist_entry)
 #define BPFIF_DLIST_WRITER_INSERT_HEAD(__bp, __d)			\
 	PSLIST_WRITER_INSERT_HEAD(&(__bp)->bif_dlist_head, (__d),	\
-	  bd_bif_dlist_entry)
+	bd_bif_dlist_entry)
 #define BPFIF_DLIST_WRITER_REMOVE(__d)	\
 	PSLIST_WRITER_REMOVE((__d), bd_bif_dlist_entry)
 #define BPFIF_DLIST_ENTRY_INIT(__d)	\
 	PSLIST_ENTRY_INIT((__d), bd_bif_dlist_entry)
 #define	BPFIF_DLIST_READER_EMPTY(__bp)	\
 	(PSLIST_READER_FIRST(&(__bp)->bif_dlist_head, struct bpf_d,	\
-	 bd_bif_dlist_entry) == NULL)
+	bd_bif_dlist_entry) == NULL)
 #define	BPFIF_DLIST_WRITER_EMPTY(__bp)	\
 	(PSLIST_WRITER_FIRST(&(__bp)->bif_dlist_head, struct bpf_d,	\
-	 bd_bif_dlist_entry) == NULL)
+	bd_bif_dlist_entry) == NULL)
 #define BPFIF_DLIST_ENTRY_DESTROY(__d)	\
 	PSLIST_ENTRY_DESTROY((__d), bd_bif_dlist_entry)
 
 static int	bpf_allocbufs(struct bpf_d *);
 static u_int	bpf_xfilter(struct bpf_filter **, void *, u_int, u_int);
 static void	bpf_deliver(struct bpf_if *,
-		void *(*cpfn)(void *, const void *, size_t),
-		void *, u_int, u_int, const u_int);
+		void *(*cpfn)(void *, const void *, size_t),
+		void *, u_int, u_int, const u_int);
 static void	bpf_freed(struct bpf_d *);
 static void	bpf_free_filter(struct bpf_filter *);
 static void	bpf_ifname(struct ifnet *, struct ifreq *);
 static void	*bpf_mcpy(void *, const void *, size_t);
 static int	bpf_movein(struct ifnet *, struct uio *, int, uint64_t,
-			struct mbuf **, struct sockaddr *,
-struct bpf_filter **);
+		struct mbuf **, struct sockaddr *,
+		struct bpf_filter **);
 static void	bpf_attachd(struct bpf_d *, struct bpf_if *);
 static void	bpf_detachd(struct bpf_d *);
 static int	bpf_setif(struct bpf_d *, struct ifreq *);
@@ -253,15 +253,16 @@ static inline void
 		bpf_wakeup(struct bpf_d *);
 static int	bpf_hdrlen(struct bpf_d *);
 static void	catchpacket(struct bpf_d *, u_char *, u_int, u_int,
-void *(*)(void *, const void *, size_t), struct timespec *);
+		void *(*)(void *, const void *, size_t),
+		struct timespec *);
 static void	reset_d(struct bpf_d *);
 static int	bpf_getdltlist(struct bpf_d *, struct bpf_dltlist *);
 static int	bpf_setdlt(struct bpf_d *, u_int);
 
 static int	bpf_read(struct file *, off_t *, struct uio *, kauth_cred_t,
-int);
+		int);
 

CVS commit: src/sys/net

2024-08-15 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Thu Aug 15 11:23:29 UTC 2024

Modified Files:
src/sys/net: bpf.c

Log Message:
bpf(4): Sort includes.  No functional change intended.

Preparation for:

kern/58596: bpf(4) MP-safety issues


To generate a diff of this commit:
cvs rdiff -u -r1.253 -r1.254 src/sys/net/bpf.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/net/bpf.c
diff -u src/sys/net/bpf.c:1.253 src/sys/net/bpf.c:1.254
--- src/sys/net/bpf.c:1.253	Thu Aug 15 02:22:46 2024
+++ src/sys/net/bpf.c	Thu Aug 15 11:23:29 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: bpf.c,v 1.253 2024/08/15 02:22:46 rin Exp $	*/
+/*	$NetBSD: bpf.c,v 1.254 2024/08/15 11:23:29 riastradh Exp $	*/
 
 /*
  * Copyright (c) 1990, 1991, 1993
@@ -39,7 +39,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: bpf.c,v 1.253 2024/08/15 02:22:46 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bpf.c,v 1.254 2024/08/15 11:23:29 riastradh Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_bpf.h"
@@ -48,52 +48,48 @@ __KERNEL_RCSID(0, "$NetBSD: bpf.c,v 1.25
 #endif
 
 #include 
-#include 
-#include 
+
+#include 
 #include 
-#include 
-#include 
-#include 
 #include 
-#include 
-#include 
-#include 
-#include 
-#include 
 #include 
-
+#include 
 #include 
 #include 
-#include 
-#include 
-
-#include 
-#include 
-#include 
+#include 
+#include 
 #include 
+#include 
+#include 
+#include 
+#include 
 #include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
 #include 
-#include 
 #include 
-#include 
-#include 
-#include 
+#include 
+#include 
+#include 
+#include 
+#include 
 #include 
 
-#include 
-#include 
-
 #include 
 #include 
 #include 
-
+#include 
 #include 
 #include 
 #include 
+#include 
 
-#include 
 #include 
-
+#include 
 
 #include 
 



CVS commit: src/sys/net

2024-08-15 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Thu Aug 15 11:23:29 UTC 2024

Modified Files:
src/sys/net: bpf.c

Log Message:
bpf(4): Sort includes.  No functional change intended.

Preparation for:

kern/58596: bpf(4) MP-safety issues


To generate a diff of this commit:
cvs rdiff -u -r1.253 -r1.254 src/sys/net/bpf.c

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



CVS commit: src

2024-08-15 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Thu Aug 15 10:48:42 UTC 2024

Modified Files:
src: UPDATING

Log Message:
UPDATING: Nix trailing whitespace.


To generate a diff of this commit:
cvs rdiff -u -r1.355 -r1.356 src/UPDATING

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

Modified files:

Index: src/UPDATING
diff -u src/UPDATING:1.355 src/UPDATING:1.356
--- src/UPDATING:1.355	Tue Aug 13 09:49:05 2024
+++ src/UPDATING	Thu Aug 15 10:48:42 2024
@@ -1,4 +1,4 @@
-$NetBSD: UPDATING,v 1.355 2024/08/13 09:49:05 martin Exp $
+$NetBSD: UPDATING,v 1.356 2024/08/15 10:48:42 riastradh Exp $
 
 This file (UPDATING) is intended to be a brief reference to recent
 changes that might cause problems in the build process, and a guide for
@@ -23,7 +23,7 @@ Recent changes:
 	Update builds will require removing the tools objdir for gdb
 	if building with MKCROSSGDB=yes. All architectures use gdb.old
 	now.
-	
+
 20240630:
 	Update builds will require removing the tools objdir for binutils
 	(as most architectures should use binutils.old now).



CVS commit: src

2024-08-15 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Thu Aug 15 10:48:42 UTC 2024

Modified Files:
src: UPDATING

Log Message:
UPDATING: Nix trailing whitespace.


To generate a diff of this commit:
cvs rdiff -u -r1.355 -r1.356 src/UPDATING

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-08-15 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu Aug 15 07:06:35 UTC 2024

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

Log Message:
KNF


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

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

Modified files:

Index: src/sys/arch/riscv/riscv/autoconf.c
diff -u src/sys/arch/riscv/riscv/autoconf.c:1.6 src/sys/arch/riscv/riscv/autoconf.c:1.7
--- src/sys/arch/riscv/riscv/autoconf.c:1.6	Fri Jan 19 09:09:39 2024
+++ src/sys/arch/riscv/riscv/autoconf.c	Thu Aug 15 07:06:35 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: autoconf.c,v 1.6 2024/01/19 09:09:39 skrll Exp $	*/
+/*	$NetBSD: autoconf.c,v 1.7 2024/08/15 07:06:35 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include 
 
-__RCSID("$NetBSD: autoconf.c,v 1.6 2024/01/19 09:09:39 skrll Exp $");
+__RCSID("$NetBSD: autoconf.c,v 1.7 2024/08/15 07:06:35 skrll Exp $");
 
 #include 
 
@@ -49,7 +49,7 @@ __RCSID("$NetBSD: autoconf.c,v 1.6 2024/
 void
 cpu_configure(void)
 {
-	(void) splhigh();
+	(void)splhigh();
 
 	config_rootfound("mainbus", NULL);
 



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

2024-08-15 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu Aug 15 07:06:35 UTC 2024

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

Log Message:
KNF


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

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



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

2024-08-15 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu Aug 15 07:03:58 UTC 2024

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

Log Message:
Add a comment.


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/sys/arch/riscv/riscv/riscv_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-08-15 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu Aug 15 07:03:58 UTC 2024

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

Log Message:
Add a comment.


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/sys/arch/riscv/riscv/riscv_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/riscv_machdep.c
diff -u src/sys/arch/riscv/riscv/riscv_machdep.c:1.37 src/sys/arch/riscv/riscv/riscv_machdep.c:1.38
--- src/sys/arch/riscv/riscv/riscv_machdep.c:1.37	Tue Mar  5 14:15:34 2024
+++ src/sys/arch/riscv/riscv/riscv_machdep.c	Thu Aug 15 07:03:57 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: riscv_machdep.c,v 1.37 2024/03/05 14:15:34 thorpej Exp $	*/
+/*	$NetBSD: riscv_machdep.c,v 1.38 2024/08/15 07:03:57 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2014, 2019, 2022 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
 #include "opt_riscv_debug.h"
 
 #include 
-__RCSID("$NetBSD: riscv_machdep.c,v 1.37 2024/03/05 14:15:34 thorpej Exp $");
+__RCSID("$NetBSD: riscv_machdep.c,v 1.38 2024/08/15 07:03:57 skrll Exp $");
 
 #include 
 
@@ -206,6 +206,9 @@ md_child_return(struct lwp *l)
 	userret(l);
 }
 
+/*
+ * Process the tail end of a posix_spawn() for the child.
+ */
 void
 cpu_spawn_return(struct lwp *l)
 {



CVS commit: src/share/mk

2024-08-14 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Thu Aug 15 06:48:00 UTC 2024

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

Log Message:
allow HAVE_MESA_VER to be overriden by the environment.


To generate a diff of this commit:
cvs rdiff -u -r1.1395 -r1.1396 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.1395 src/share/mk/bsd.own.mk:1.1396
--- src/share/mk/bsd.own.mk:1.1395	Tue Aug 13 03:08:31 2024
+++ src/share/mk/bsd.own.mk	Thu Aug 15 06:48:00 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.own.mk,v 1.1395 2024/08/13 03:08:31 rin Exp $
+#	$NetBSD: bsd.own.mk,v 1.1396 2024/08/15 06:48:00 mrg Exp $
 
 # This needs to be before bsd.init.mk
 .if defined(BSD_MK_COMPAT_FILE)
@@ -1376,7 +1376,7 @@ HAVE_XORG_SERVER_VER?=120
 # Newer Mesa does not build with old X server
 # VAX build triggers a gcc internal error
 .if ${HAVE_XORG_SERVER_VER} != "120" || ${MACHINE} == "vax"
-HAVE_MESA_VER=19
+HAVE_MESA_VER?=19
 .endif
 
 HAVE_MESA_VER?=	21



CVS commit: src/share/mk

2024-08-14 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Thu Aug 15 06:48:00 UTC 2024

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

Log Message:
allow HAVE_MESA_VER to be overriden by the environment.


To generate a diff of this commit:
cvs rdiff -u -r1.1395 -r1.1396 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/sys/stand/efiboot

2024-08-14 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu Aug 15 06:15:17 UTC 2024

Modified Files:
src/sys/stand/efiboot: efiboot_machdep.h efifdt.c version
src/sys/stand/efiboot/bootaa64: efibootaa64.c
src/sys/stand/efiboot/bootarm: efibootarm.c
src/sys/stand/efiboot/bootriscv64: efibootriscv64.c

Log Message:
Allow an MD check in prepare_boot and use it on arm64 (aarch64) to check
that, if a big endian kernel is seen, the CPU is capable of supporting BE
data accesses at EL0 via ID_AA64MMFR0_EL1.BigEnd.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/stand/efiboot/efiboot_machdep.h
cvs rdiff -u -r1.36 -r1.37 src/sys/stand/efiboot/efifdt.c
cvs rdiff -u -r1.31 -r1.32 src/sys/stand/efiboot/version
cvs rdiff -u -r1.6 -r1.7 src/sys/stand/efiboot/bootaa64/efibootaa64.c
cvs rdiff -u -r1.3 -r1.4 src/sys/stand/efiboot/bootarm/efibootarm.c
cvs rdiff -u -r1.1 -r1.2 src/sys/stand/efiboot/bootriscv64/efibootriscv64.c

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



CVS commit: src/sys/stand/efiboot

2024-08-14 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu Aug 15 06:15:17 UTC 2024

Modified Files:
src/sys/stand/efiboot: efiboot_machdep.h efifdt.c version
src/sys/stand/efiboot/bootaa64: efibootaa64.c
src/sys/stand/efiboot/bootarm: efibootarm.c
src/sys/stand/efiboot/bootriscv64: efibootriscv64.c

Log Message:
Allow an MD check in prepare_boot and use it on arm64 (aarch64) to check
that, if a big endian kernel is seen, the CPU is capable of supporting BE
data accesses at EL0 via ID_AA64MMFR0_EL1.BigEnd.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/stand/efiboot/efiboot_machdep.h
cvs rdiff -u -r1.36 -r1.37 src/sys/stand/efiboot/efifdt.c
cvs rdiff -u -r1.31 -r1.32 src/sys/stand/efiboot/version
cvs rdiff -u -r1.6 -r1.7 src/sys/stand/efiboot/bootaa64/efibootaa64.c
cvs rdiff -u -r1.3 -r1.4 src/sys/stand/efiboot/bootarm/efibootarm.c
cvs rdiff -u -r1.1 -r1.2 src/sys/stand/efiboot/bootriscv64/efibootriscv64.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/stand/efiboot/efiboot_machdep.h
diff -u src/sys/stand/efiboot/efiboot_machdep.h:1.4 src/sys/stand/efiboot/efiboot_machdep.h:1.5
--- src/sys/stand/efiboot/efiboot_machdep.h:1.4	Tue Aug  1 07:04:16 2023
+++ src/sys/stand/efiboot/efiboot_machdep.h	Thu Aug 15 06:15:16 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: efiboot_machdep.h,v 1.4 2023/08/01 07:04:16 mrg Exp $ */
+/* $NetBSD: efiboot_machdep.h,v 1.5 2024/08/15 06:15:16 skrll Exp $ */
 
 /*-
  * Copyright (c) 2018 Jared McNeill 
@@ -33,3 +33,4 @@
 void efi_dcache_flush(u_long, u_long);
 void efi_boot_kernel(u_long[MARK_MAX]);
 void efi_md_show(void);
+int efi_md_prepare_boot(const char *, const char *, u_long *);

Index: src/sys/stand/efiboot/efifdt.c
diff -u src/sys/stand/efiboot/efifdt.c:1.36 src/sys/stand/efiboot/efifdt.c:1.37
--- src/sys/stand/efiboot/efifdt.c:1.36	Thu Aug 15 05:59:49 2024
+++ src/sys/stand/efiboot/efifdt.c	Thu Aug 15 06:15:16 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: efifdt.c,v 1.36 2024/08/15 05:59:49 skrll Exp $ */
+/* $NetBSD: efifdt.c,v 1.37 2024/08/15 06:15:16 skrll Exp $ */
 
 /*-
  * Copyright (c) 2019 Jason R. Thorpe
@@ -598,13 +598,19 @@ load_modules(const char *kernel_name)
 int
 efi_fdt_prepare_boot(const char *fname, const char *args, u_long *marks)
 {
+	int error;
+
 	load_file(get_initrd_path(), 0, false, &initrd_addr, &initrd_size);
 	load_file(get_dtb_path(), 0, false, &dtb_addr, &dtb_size);
 
+	error = efi_md_prepare_boot(fname, args, marks);
+	if (error) {
+		return error;
+	}
 #ifdef EFIBOOT_ACPI
 	/* ACPI support only works for little endian kernels */
 	if (efi_acpi_available() && netbsd_elf_data == ELFDATA2LSB) {
-		int error = efi_fdt_create_acpifdt();
+		error = efi_fdt_create_acpifdt();
 		if (error != 0) {
 			return error;
 		}

Index: src/sys/stand/efiboot/version
diff -u src/sys/stand/efiboot/version:1.31 src/sys/stand/efiboot/version:1.32
--- src/sys/stand/efiboot/version:1.31	Sat Apr  2 11:16:07 2022
+++ src/sys/stand/efiboot/version	Thu Aug 15 06:15:16 2024
@@ -1,4 +1,4 @@
-$NetBSD: version,v 1.31 2022/04/02 11:16:07 skrll Exp $
+$NetBSD: version,v 1.32 2024/08/15 06:15:16 skrll Exp $
 
 NOTE ANY CHANGES YOU MAKE TO THE EFI BOOTLOADER HERE.  The format of this
 file is important - make sure the entries are appended on end, last item
@@ -34,3 +34,4 @@ is taken as the current.
 2.11:	Add support for changing the video mode.
 2.12:	Add userconf support.
 2.13:	Add Arm RT support and change Arm64 (aarch64) RT VAs.
+2.14:	Arm64: check cpu support for big endian kernel.

Index: src/sys/stand/efiboot/bootaa64/efibootaa64.c
diff -u src/sys/stand/efiboot/bootaa64/efibootaa64.c:1.6 src/sys/stand/efiboot/bootaa64/efibootaa64.c:1.7
--- src/sys/stand/efiboot/bootaa64/efibootaa64.c:1.6	Sun Aug 14 11:26:41 2022
+++ src/sys/stand/efiboot/bootaa64/efibootaa64.c	Thu Aug 15 06:15:17 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: efibootaa64.c,v 1.6 2022/08/14 11:26:41 jmcneill Exp $	*/
+/*	$NetBSD: efibootaa64.c,v 1.7 2024/08/15 06:15:17 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2016 Kimihiro Nonaka 
@@ -29,6 +29,7 @@
 #include "../efiboot.h"
 #include "../efifdt.h"
 
+#include 
 #include 
 
 #include 
@@ -76,8 +77,29 @@ efi_aarch64_current_el(void)
 	return (el >> 2) & 0x3;
 }
 
+static bool
+efi_aarch64_BigEnd(void)
+{
+	uint64_t id_aa64mmfr0_el1;
+	__asm __volatile ("mrs %[mmfr0], id_aa64mmfr0_el1"
+: [mmfr0] "=r" (id_aa64mmfr0_el1) :: "memory");
+	return __SHIFTOUT(id_aa64mmfr0_el1, __BITS(11, 8)) == 1;
+}
+
 void
 efi_md_show(void)
 {
 	command_printtab("CurrentEL", "EL%u\n", efi_aarch64_current_el());
 }
+
+int
+efi_md_prepare_boot(const char *fname, const char *args, u_long *marks)
+{
+	if (netbsd_elf_data == ELFDATA2MSB) {
+		if (!efi_aarch64_BigEnd()) {
+			printf("Processor does not support big endian at EL1\n");
+			return ENOTSUP;
+		}
+	}
+	return 0;
+}

Index: src/sys/stand/efiboot/bootarm/efibootarm.c
diff -u src/sys/stand/efib

CVS commit: src/sys/stand/efiboot

2024-08-14 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu Aug 15 06:01:40 UTC 2024

Modified Files:
src/sys/stand/efiboot: efiboot.h efifdt.h

Log Message:
Move function declarations into correct header.

NFCI.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/stand/efiboot/efiboot.h
cvs rdiff -u -r1.12 -r1.13 src/sys/stand/efiboot/efifdt.h

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



CVS commit: src/sys/stand/efiboot

2024-08-14 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu Aug 15 06:01:40 UTC 2024

Modified Files:
src/sys/stand/efiboot: efiboot.h efifdt.h

Log Message:
Move function declarations into correct header.

NFCI.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/stand/efiboot/efiboot.h
cvs rdiff -u -r1.12 -r1.13 src/sys/stand/efiboot/efifdt.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/stand/efiboot/efiboot.h
diff -u src/sys/stand/efiboot/efiboot.h:1.21 src/sys/stand/efiboot/efiboot.h:1.22
--- src/sys/stand/efiboot/efiboot.h:1.21	Thu Aug 15 05:59:49 2024
+++ src/sys/stand/efiboot/efiboot.h	Thu Aug 15 06:01:40 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: efiboot.h,v 1.21 2024/08/15 05:59:49 skrll Exp $	*/
+/*	$NetBSD: efiboot.h,v 1.22 2024/08/15 06:01:40 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2016 Kimihiro Nonaka 
@@ -89,12 +89,6 @@ int efi_device_path_depth(EFI_DEVICE_PAT
 int efi_device_path_count(EFI_DEVICE_PATH *);
 int efi_device_path_ncmp(EFI_DEVICE_PATH *, EFI_DEVICE_PATH *, int);
 
-/* efifdt.c */
-int efi_fdt_prepare_boot(const char *, const char *, u_long *);
-void efi_fdt_cleanup_boot(void);
-size_t efi_fdt_alloc_size(void);
-void efi_fdt_set_virtual_address_map(EFI_MEMORY_DESCRIPTOR *, UINTN, UINTN, UINTN, UINT32);
-
 /* efinet.c */
 struct efi_net_if {
 	const char *if_name;

Index: src/sys/stand/efiboot/efifdt.h
diff -u src/sys/stand/efiboot/efifdt.h:1.12 src/sys/stand/efiboot/efifdt.h:1.13
--- src/sys/stand/efiboot/efifdt.h:1.12	Fri Mar 25 21:23:00 2022
+++ src/sys/stand/efiboot/efifdt.h	Thu Aug 15 06:01:40 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: efifdt.h,v 1.12 2022/03/25 21:23:00 jmcneill Exp $ */
+/* $NetBSD: efifdt.h,v 1.13 2024/08/15 06:01:40 skrll Exp $ */
 
 /*-
  * Copyright (c) 2018 Jared McNeill 
@@ -48,3 +48,8 @@ void efi_fdt_userconf(void);
 void efi_fdt_init(u_long, u_long);
 void efi_fdt_fini(void);
 void efi_fdt_system_table(void);
+
+int efi_fdt_prepare_boot(const char *, const char *, u_long *);
+void efi_fdt_cleanup_boot(void);
+size_t efi_fdt_alloc_size(void);
+void efi_fdt_set_virtual_address_map(EFI_MEMORY_DESCRIPTOR *, UINTN, UINTN, UINTN, UINT32);



CVS commit: src/sys/stand/efiboot

2024-08-14 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu Aug 15 05:59:49 UTC 2024

Modified Files:
src/sys/stand/efiboot: efiboot.c efiboot.h efifdt.c exec.c

Log Message:
Rename some symbols for consistency with the style used elsewhere
in efiboot.

NFCI.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/stand/efiboot/efiboot.c
cvs rdiff -u -r1.20 -r1.21 src/sys/stand/efiboot/efiboot.h
cvs rdiff -u -r1.35 -r1.36 src/sys/stand/efiboot/efifdt.c
cvs rdiff -u -r1.24 -r1.25 src/sys/stand/efiboot/exec.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/stand/efiboot/efiboot.c
diff -u src/sys/stand/efiboot/efiboot.c:1.23 src/sys/stand/efiboot/efiboot.c:1.24
--- src/sys/stand/efiboot/efiboot.c:1.23	Thu Mar 28 18:24:57 2024
+++ src/sys/stand/efiboot/efiboot.c	Thu Aug 15 05:59:49 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: efiboot.c,v 1.23 2024/03/28 18:24:57 riastradh Exp $ */
+/* $NetBSD: efiboot.c,v 1.24 2024/08/15 05:59:49 skrll Exp $ */
 
 /*-
  * Copyright (c) 2018 Jared McNeill 
@@ -132,7 +132,7 @@ efi_cleanup(void)
 	}
 
 #ifdef EFIBOOT_RUNTIME_ADDRESS
-	arch_set_virtual_address_map(memmap, nentries, mapkey, descsize, descver);
+	efi_fdt_set_virtual_address_map(memmap, nentries, mapkey, descsize, descver);
 #endif
 }
 

Index: src/sys/stand/efiboot/efiboot.h
diff -u src/sys/stand/efiboot/efiboot.h:1.20 src/sys/stand/efiboot/efiboot.h:1.21
--- src/sys/stand/efiboot/efiboot.h:1.20	Sun Aug 14 11:26:41 2022
+++ src/sys/stand/efiboot/efiboot.h	Thu Aug 15 05:59:49 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: efiboot.h,v 1.20 2022/08/14 11:26:41 jmcneill Exp $	*/
+/*	$NetBSD: efiboot.h,v 1.21 2024/08/15 05:59:49 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2016 Kimihiro Nonaka 
@@ -43,11 +43,6 @@ struct boot_command {
 	const char *c_help;
 };
 
-int arch_prepare_boot(const char *, const char *, u_long *);
-void arch_cleanup_boot(void);
-size_t arch_alloc_size(void);
-void arch_set_virtual_address_map(EFI_MEMORY_DESCRIPTOR *, UINTN, UINTN, UINTN, UINT32);
-
 /* conf.c */
 extern struct fs_ops null_fs_ops;
 extern struct fs_ops tftp_fs_ops;
@@ -94,6 +89,12 @@ int efi_device_path_depth(EFI_DEVICE_PAT
 int efi_device_path_count(EFI_DEVICE_PATH *);
 int efi_device_path_ncmp(EFI_DEVICE_PATH *, EFI_DEVICE_PATH *, int);
 
+/* efifdt.c */
+int efi_fdt_prepare_boot(const char *, const char *, u_long *);
+void efi_fdt_cleanup_boot(void);
+size_t efi_fdt_alloc_size(void);
+void efi_fdt_set_virtual_address_map(EFI_MEMORY_DESCRIPTOR *, UINTN, UINTN, UINTN, UINT32);
+
 /* efinet.c */
 struct efi_net_if {
 	const char *if_name;

Index: src/sys/stand/efiboot/efifdt.c
diff -u src/sys/stand/efiboot/efifdt.c:1.35 src/sys/stand/efiboot/efifdt.c:1.36
--- src/sys/stand/efiboot/efifdt.c:1.35	Sun Aug 14 11:26:41 2022
+++ src/sys/stand/efiboot/efifdt.c	Thu Aug 15 05:59:49 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: efifdt.c,v 1.35 2022/08/14 11:26:41 jmcneill Exp $ */
+/* $NetBSD: efifdt.c,v 1.36 2024/08/15 05:59:49 skrll Exp $ */
 
 /*-
  * Copyright (c) 2019 Jason R. Thorpe
@@ -596,7 +596,7 @@ load_modules(const char *kernel_name)
  * Prepare kernel arguments and shutdown boot services.
  */
 int
-arch_prepare_boot(const char *fname, const char *args, u_long *marks)
+efi_fdt_prepare_boot(const char *fname, const char *args, u_long *marks)
 {
 	load_file(get_initrd_path(), 0, false, &initrd_addr, &initrd_size);
 	load_file(get_dtb_path(), 0, false, &dtb_addr, &dtb_size);
@@ -650,7 +650,7 @@ arch_prepare_boot(const char *fname, con
  * Free memory after a failed boot.
  */
 void
-arch_cleanup_boot(void)
+efi_fdt_cleanup_boot(void)
 {
 	if (rndseed_addr) {
 		uefi_call_wrapper(BS->FreePages, 2, rndseed_addr, EFI_SIZE_TO_PAGES(rndseed_size));
@@ -670,7 +670,7 @@ arch_cleanup_boot(void)
 }
 
 size_t
-arch_alloc_size(void)
+efi_fdt_alloc_size(void)
 {
 	return FDT_SPACE;
 }
@@ -735,7 +735,7 @@ efi_fdt_runtime_alloc_va(uint64_t npages
 }
 
 void
-arch_set_virtual_address_map(EFI_MEMORY_DESCRIPTOR *memmap, UINTN nentries,
+efi_fdt_set_virtual_address_map(EFI_MEMORY_DESCRIPTOR *memmap, UINTN nentries,
 UINTN mapkey, UINTN descsize, UINT32 descver)
 {
 	EFI_MEMORY_DESCRIPTOR *md, *vmd, *vmemmap;

Index: src/sys/stand/efiboot/exec.c
diff -u src/sys/stand/efiboot/exec.c:1.24 src/sys/stand/efiboot/exec.c:1.25
--- src/sys/stand/efiboot/exec.c:1.24	Wed Jun 14 10:26:45 2023
+++ src/sys/stand/efiboot/exec.c	Thu Aug 15 05:59:49 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: exec.c,v 1.24 2023/06/14 10:26:45 rin Exp $ */
+/* $NetBSD: exec.c,v 1.25 2024/08/15 05:59:49 skrll Exp $ */
 
 /*-
  * Copyright (c) 2019 Jason R. Thorpe
@@ -186,7 +186,7 @@ exec_netbsd(const char *fname, const cha
 	}
 	close(fd);
 	marks[MARK_END] = (((u_long) marks[MARK_END] + sizeof(int) - 1)) & -sizeof(int);
-	alloc_size = marks[MARK_END] - marks[MARK_START] + arch_alloc_size() + EFIBOOT_ALIGN;
+	alloc_size = marks[MARK_END] - marks[MARK_START] + efi_fdt_alloc_size() + EFIBOOT_ALIGN;
 
 #ifdef E

CVS commit: src/sys/stand/efiboot

2024-08-14 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu Aug 15 05:59:49 UTC 2024

Modified Files:
src/sys/stand/efiboot: efiboot.c efiboot.h efifdt.c exec.c

Log Message:
Rename some symbols for consistency with the style used elsewhere
in efiboot.

NFCI.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/stand/efiboot/efiboot.c
cvs rdiff -u -r1.20 -r1.21 src/sys/stand/efiboot/efiboot.h
cvs rdiff -u -r1.35 -r1.36 src/sys/stand/efiboot/efifdt.c
cvs rdiff -u -r1.24 -r1.25 src/sys/stand/efiboot/exec.c

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



CVS commit: src/sys/stand/efiboot

2024-08-14 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu Aug 15 05:58:34 UTC 2024

Modified Files:
src/sys/stand/efiboot: dev_net.c

Log Message:
Trailing whitespace.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/stand/efiboot/dev_net.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/stand/efiboot/dev_net.c
diff -u src/sys/stand/efiboot/dev_net.c:1.2 src/sys/stand/efiboot/dev_net.c:1.3
--- src/sys/stand/efiboot/dev_net.c:1.2	Thu Nov 15 23:52:33 2018
+++ src/sys/stand/efiboot/dev_net.c	Thu Aug 15 05:58:34 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: dev_net.c,v 1.2 2018/11/15 23:52:33 jmcneill Exp $	*/
+/*	$NetBSD: dev_net.c,v 1.3 2024/08/15 05:58:34 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2018 Jared McNeill 
@@ -91,7 +91,7 @@ fail:
 	printf("net_open failed: %d\n", error);
 	netif_close(net_socket);
 	net_socket = -1;
-	return error;	
+	return error;
 }
 
 int



CVS commit: src/sys/stand/efiboot

2024-08-14 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu Aug 15 05:58:34 UTC 2024

Modified Files:
src/sys/stand/efiboot: dev_net.c

Log Message:
Trailing whitespace.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/stand/efiboot/dev_net.c

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



CVS commit: src/external/gpl2/groff/dist/tmac

2024-08-14 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Thu Aug 15 03:56:31 UTC 2024

Modified Files:
src/external/gpl2/groff/dist/tmac: doc-syms groff_mdoc.man

Log Message:
groff: add IEEE Std 1003.1-2024


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/external/gpl2/groff/dist/tmac/doc-syms
cvs rdiff -u -r1.7 -r1.8 src/external/gpl2/groff/dist/tmac/groff_mdoc.man

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/groff/dist/tmac/doc-syms
diff -u src/external/gpl2/groff/dist/tmac/doc-syms:1.5 src/external/gpl2/groff/dist/tmac/doc-syms:1.6
--- src/external/gpl2/groff/dist/tmac/doc-syms:1.5	Fri Jul 27 15:13:01 2018
+++ src/external/gpl2/groff/dist/tmac/doc-syms	Thu Aug 15 03:56:31 2024
@@ -573,6 +573,8 @@
 .as doc-str-St--p1003.1-2004   " (\*[Lq]\)\*[Px]\*[doc-str-St].1\*[Rq])
 .ds doc-str-St--p1003.1-2008   \*[doc-Tn-font-size]\%IEEE\*[doc-str-St] Std 1003.1-2008
 .as doc-str-St--p1003.1-2008   " (\*[Lq]\)\*[Px]\*[doc-str-St].1\*[Rq])
+.ds doc-str-St--p1003.1-2024   \*[doc-Tn-font-size]\%IEEE\*[doc-str-St] Std 1003.1-2024
+.as doc-str-St--p1003.1-2024   " (\*[Lq]\)\*[Px]\*[doc-str-St].1\*[Rq])
 .
 .\" POSIX Part 2: Shell and Utilities
 .ds doc-str-St--p1003.2\*[doc-Tn-font-size]\%IEEE\*[doc-str-St] Std 1003.2

Index: src/external/gpl2/groff/dist/tmac/groff_mdoc.man
diff -u src/external/gpl2/groff/dist/tmac/groff_mdoc.man:1.7 src/external/gpl2/groff/dist/tmac/groff_mdoc.man:1.8
--- src/external/gpl2/groff/dist/tmac/groff_mdoc.man:1.7	Fri Jul 27 15:13:01 2018
+++ src/external/gpl2/groff/dist/tmac/groff_mdoc.man	Thu Aug 15 03:56:31 2024
@@ -1983,6 +1983,8 @@ Part 1: System API
 .St -p1003.1-2004
 .It Li -p1003.1-2008
 .St -p1003.1-2008
+.It Li -p1003.1-2024
+.St -p1003.1-2024
 .El
 .Pp
 .



CVS commit: src/external/bsd/mdocml/dist

2024-08-14 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Thu Aug 15 03:53:34 UTC 2024

Modified Files:
src/external/bsd/mdocml/dist: mdoc.7 st.c

Log Message:
mandoc: merge upstream changes to add IEEE 1003.1-2024 (schwarze, job, jmc)


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/external/bsd/mdocml/dist/mdoc.7
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/mdocml/dist/st.c

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

Modified files:

Index: src/external/bsd/mdocml/dist/mdoc.7
diff -u src/external/bsd/mdocml/dist/mdoc.7:1.5 src/external/bsd/mdocml/dist/mdoc.7:1.6
--- src/external/bsd/mdocml/dist/mdoc.7:1.5	Mon Mar 11 00:15:38 2019
+++ src/external/bsd/mdocml/dist/mdoc.7	Thu Aug 15 03:53:34 2024
@@ -2469,7 +2469,7 @@ It is used as the basis for UNIX 03 cert
 .br
 The second and last Technical Corrigendum.
 .El
-.It Single UNIX Specification version 4
+.It POSIX issues 7 and 8
 .Pp
 .Bl -tag -width "-p1003.1g-2000" -compact
 .It \-p1003.1-2008
@@ -2477,8 +2477,18 @@ The second and last Technical Corrigendu
 .It \-susv4
 .St -susv4
 .br
-This standard is also called
-X/Open Portability Guide version 7.
+This standard is based on C99.
+It is also called the
+Open Group Standard Base Specifications, Issue 7.
+.El
+.Pp
+.Bl -tag -width "-p1003.1g-2000" -compact
+.It \-p1003.1-2024
+.St -p1003.1-2024
+.br
+This standard is based on C17.
+It is also called the
+Open Group Standard Base Specifications, Issue 8.
 .El
 .It Other standards
 .Pp

Index: src/external/bsd/mdocml/dist/st.c
diff -u src/external/bsd/mdocml/dist/st.c:1.2 src/external/bsd/mdocml/dist/st.c:1.3
--- src/external/bsd/mdocml/dist/st.c:1.2	Sat Dec  7 12:45:28 2019
+++ src/external/bsd/mdocml/dist/st.c	Thu Aug 15 03:53:34 2024
@@ -37,6 +37,7 @@ LINE("-p1003.1-96",	"ISO/IEC 9945-1:1996
 LINE("-p1003.1-2001",	"IEEE Std 1003.1-2001 (\\(lqPOSIX.1\\(rq)")
 LINE("-p1003.1-2004",	"IEEE Std 1003.1-2004 (\\(lqPOSIX.1\\(rq)")
 LINE("-p1003.1-2008",	"IEEE Std 1003.1-2008 (\\(lqPOSIX.1\\(rq)")
+LINE("-p1003.1-2024",	"IEEE Std 1003.1-2024 (\\(lqPOSIX.1\\(rq)")
 LINE("-p1003.1",	"IEEE Std 1003.1 (\\(lqPOSIX.1\\(rq)")
 LINE("-p1003.1b",	"IEEE Std 1003.1b (\\(lqPOSIX.1b\\(rq)")
 LINE("-p1003.1b-93",	"IEEE Std 1003.1b-1993 (\\(lqPOSIX.1b\\(rq)")



CVS commit: src/external/bsd/mdocml/dist

2024-08-14 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Thu Aug 15 03:53:34 UTC 2024

Modified Files:
src/external/bsd/mdocml/dist: mdoc.7 st.c

Log Message:
mandoc: merge upstream changes to add IEEE 1003.1-2024 (schwarze, job, jmc)


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/external/bsd/mdocml/dist/mdoc.7
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/mdocml/dist/st.c

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



CVS commit: src/sys/net

2024-08-14 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Thu Aug 15 02:22:46 UTC 2024

Modified Files:
src/sys/net: bpf.c

Log Message:
bpf: Mark bpfread_filtops FILTEROP_MPSAFE

Fix deadlock for non-NET_MPSAFE kernel, reported as
PR kern/58531 (thanks manu@ for test).

I've confirmed that there is no new regression for ATF with
any combination of -HEAD/netbsd-10 and default/NET_MPSAFE
rump kernels (aarch64).

Although, some problems have been reported on MP-safety for
bpf(4), PR kern/58596. But, it should take some time to fix.
At the moment, commit this part in advance.

OK ozaki-r@


To generate a diff of this commit:
cvs rdiff -u -r1.252 -r1.253 src/sys/net/bpf.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/net/bpf.c
diff -u src/sys/net/bpf.c:1.252 src/sys/net/bpf.c:1.253
--- src/sys/net/bpf.c:1.252	Mon Jul 31 17:41:18 2023
+++ src/sys/net/bpf.c	Thu Aug 15 02:22:46 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: bpf.c,v 1.252 2023/07/31 17:41:18 christos Exp $	*/
+/*	$NetBSD: bpf.c,v 1.253 2024/08/15 02:22:46 rin Exp $	*/
 
 /*
  * Copyright (c) 1990, 1991, 1993
@@ -39,7 +39,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: bpf.c,v 1.252 2023/07/31 17:41:18 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bpf.c,v 1.253 2024/08/15 02:22:46 rin Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_bpf.h"
@@ -1611,7 +1611,7 @@ filt_bpfread(struct knote *kn, long hint
 }
 
 static const struct filterops bpfread_filtops = {
-	.f_flags = FILTEROP_ISFD,
+	.f_flags = FILTEROP_ISFD | FILTEROP_MPSAFE,
 	.f_attach = NULL,
 	.f_detach = filt_bpfrdetach,
 	.f_event = filt_bpfread,



CVS commit: src/sys/net

2024-08-14 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Thu Aug 15 02:22:46 UTC 2024

Modified Files:
src/sys/net: bpf.c

Log Message:
bpf: Mark bpfread_filtops FILTEROP_MPSAFE

Fix deadlock for non-NET_MPSAFE kernel, reported as
PR kern/58531 (thanks manu@ for test).

I've confirmed that there is no new regression for ATF with
any combination of -HEAD/netbsd-10 and default/NET_MPSAFE
rump kernels (aarch64).

Although, some problems have been reported on MP-safety for
bpf(4), PR kern/58596. But, it should take some time to fix.
At the moment, commit this part in advance.

OK ozaki-r@


To generate a diff of this commit:
cvs rdiff -u -r1.252 -r1.253 src/sys/net/bpf.c

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



CVS commit: src/tools/gdb

2024-08-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Aug 14 23:56:20 UTC 2024

Modified Files:
src/tools/gdb: Makefile mknative-gdb.old

Log Message:
changes for new gdb (disable zstd, find mpc/mfpr/gmp differently)


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/tools/gdb/Makefile
cvs rdiff -u -r1.2 -r1.3 src/tools/gdb/mknative-gdb.old

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

Modified files:

Index: src/tools/gdb/Makefile
diff -u src/tools/gdb/Makefile:1.49 src/tools/gdb/Makefile:1.50
--- src/tools/gdb/Makefile:1.49	Sat Aug 19 22:30:58 2023
+++ src/tools/gdb/Makefile	Wed Aug 14 19:56:19 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.49 2023/08/20 02:30:58 rin Exp $
+#	$NetBSD: Makefile,v 1.50 2024/08/14 23:56:19 christos Exp $
 
 .include 
 
@@ -10,7 +10,10 @@ FIND_ARGS=	\! \( -type d -name sim -prun
 
 CONFIGURE_ARGS=	--target=${MACHINE_GNU_PLATFORM} --disable-nls \
 		--program-transform-name="s,^,${MACHINE_GNU_PLATFORM}-," \
-		--without-mpfr --with-libgmp-prefix=${TOOLDIR}
+		--with-zstd=no \
+		--with-mpfr=${TOOLDIR} \
+		--with-mpc=${TOOLDIR} \
+		--with-gmp=${TOOLDIR}
 
 .if ${MACHINE} == "ia64"
 CONFIGURE_ARGS+=--enable-obsolete
@@ -125,6 +128,10 @@ native-gdb: .native/.configure_done
 			${MKNATIVE_ENV} ${HOST_SH} ${GNUHOSTDIST}/configure \
 			--prefix=/usr \
 			--with-separate-debug-dir=/usr/libdata/debug \
+			--with-zstd=no \
+			--with-mpfr=${TOOLDIR} \
+			--with-mpc=${TOOLDIR} \
+			--with-gmp=${TOOLDIR} \
 			${CONFIGURE_ARGS_SIM} \
 			${CONFIGURE_ARGS_GDBSERVER} \
 			--build=`${GNUHOSTDIST}/config.guess` \

Index: src/tools/gdb/mknative-gdb.old
diff -u src/tools/gdb/mknative-gdb.old:1.2 src/tools/gdb/mknative-gdb.old:1.3
--- src/tools/gdb/mknative-gdb.old:1.2	Fri Oct  9 19:48:42 2020
+++ src/tools/gdb/mknative-gdb.old	Wed Aug 14 19:56:20 2024
@@ -1,8 +1,8 @@
 #!/bin/sh
-#	$NetBSD: mknative-gdb.old,v 1.2 2020/10/09 23:48:42 rin Exp $
+#	$NetBSD: mknative-gdb.old,v 1.3 2024/08/14 23:56:20 christos Exp $
 #
 # Shell script for generating all the constants needed for a native
-# platform build of src/external/gpl3/gdb.old
+# platform build of src/external/gpl3/gdb
 #
 
 # initialise
@@ -12,7 +12,7 @@ _TOP=$3
 _PLATFORM=$4
 _MACHINE_SUBDIR=$5
 _VPATH=`grep VPATH ${_TMPDIR}/Makefile | sed 's,^.*=[ 	]*,,'`
-_GDB=external/gpl3/gdb.old
+_GDB=external/gpl3/gdb
 
 . $_TOP/tools/gcc/mknative.common
 
@@ -28,7 +28,7 @@ get_gdb_libbfd () {
 			INCLUDES TDEFAULTS
 	} | write_mk $_BFD/arch/$_MACHINE_SUBDIR/defs.mk
 
-	for i in bfd-in3.h bfd_stdint.h config.h bfd.h bfdver.h targmatch.h 
+	for i in bfd-in3.h config.h bfd.h bfdver.h targmatch.h 
 	do
 	write_c $_BFD/arch/$_MACHINE_SUBDIR/$i <$_TMPDIR/bfd/$i
 	done
@@ -71,12 +71,12 @@ get_gdb_libreadline () {
 	mkdir -p $_TOP/$_READLINE/arch/$_MACHINE_SUBDIR
 
 	{
-		getvars readline/Makefile \
+		getvars readline/readline/Makefile \
 			CCFLAGS OBJECTS
 	} | write_mk $_READLINE/arch/$_MACHINE_SUBDIR/defs.mk
 
 	write_c $_READLINE/arch/$_MACHINE_SUBDIR/config.h \
-		<$_TMPDIR/readline/config.h
+		<$_TMPDIR/readline/readline/config.h
 }
 
 # gdb/lib/libdecnumber #
@@ -85,23 +85,108 @@ get_gdb_libdecnumber () {
 	local _DECNUMBER=$_GDB/lib/libdecnumber
 	mkdir -p $_TOP/$_DECNUMBER/arch/$_MACHINE_SUBDIR
 
-	getvars libdecnumber/Makefile \
-		libdecnumber_a_OBJS |
-	sed -e s/libdecnumber_a_// |
+	getvars libdecnumber/Makefile libdecnumber_a_OBJS |
+	sed -e s/libdecnumber_a_//g |
 	write_mk $_DECNUMBER/arch/$_MACHINE_SUBDIR/defs.mk
 
 	write_c $_DECNUMBER/arch/$_MACHINE_SUBDIR/config.h \
-		<$_TMPDIR/readline/config.h
+		<$_TMPDIR/readline/readline/config.h
 
 	write_c $_DECNUMBER/arch/$_MACHINE_SUBDIR/gstdint.h \
 		< $_TMPDIR/libdecnumber/gstdint.h
 }
 
+# gdb/lib/libgdbsupport #
+
+get_gdb_libgdbsupport () {
+	local _GDBSUPPORT=$_GDB/lib/libgdbsupport
+	mkdir -p $_TOP/$_GDBSUPPORT/arch/$_MACHINE_SUBDIR/gdbsupport
+
+	getvars gdbsupport/Makefile libgdbsupport_a_OBJECTS |
+	sed -e s/libgdbsupport_a_//g |
+	write_mk $_GDBSUPPORT/arch/$_MACHINE_SUBDIR/defs.mk
+
+	write_c $_GDBSUPPORT/arch/$_MACHINE_SUBDIR/gdbsupport/config.h \
+		<$_TMPDIR/gdbsupport/config.h
+}
+
+# gdb/lib/libctf #
+
+get_gdb_libctf () {
+	local _CTF=$_GDB/lib/libctf
+	mkdir -p $_TOP/$_CTF/arch/$_MACHINE_SUBDIR
+
+	getvars libctf/Makefile libctf_la_OBJECTS |
+	sed -e s/libctf_la_//g -e 's/\.lo/.o/g' -e s/libctf_la-//g |
+	write_mk $_CTF/arch/$_MACHINE_SUBDIR/defs.mk
+
+	write_c $_CTF/arch/$_MACHINE_SUBDIR/config.h \
+		<$_TMPDIR/libctf/config.h
+}
+
+# gdb/lib/libbacktrace #
+
+get_gdb_libbacktrace () {
+	local _BACKTRACE=$_GDB/lib/libbacktrace
+	mkdir -p $_TOP/$_BACKTRACE/arch/$_MACHINE_SUBDIR
+
+	getvars libbacktrace/Makefile libbacktrace_la_OBJECTS \
+	libbacktrace_la_LIBADD |
+	sed -e s/libbacktrace_la_//g -e 's/\.lo/.o/g' -e s/libbacktrace_la-//g |
+	write_mk $_BACKTRACE/arch/$_MACHINE_SUBDIR/defs.mk
+
+	write_c $_BACKTRACE/arch/$_MACHINE

CVS commit: src/tools/gdb

2024-08-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Aug 14 23:56:20 UTC 2024

Modified Files:
src/tools/gdb: Makefile mknative-gdb.old

Log Message:
changes for new gdb (disable zstd, find mpc/mfpr/gmp differently)


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/tools/gdb/Makefile
cvs rdiff -u -r1.2 -r1.3 src/tools/gdb/mknative-gdb.old

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



CVS commit: src/external/gpl3/gdb

2024-08-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Aug 14 23:54:51 UTC 2024

Modified Files:
src/external/gpl3/gdb: Makefile.inc
src/external/gpl3/gdb/bin/gdb: Makefile
src/external/gpl3/gdb/bin/gdbserver: Makefile
src/external/gpl3/gdb/bin/gdbtui: Makefile
src/external/gpl3/gdb/dist/gdb: amd64-netbsd-tdep.c bsd-kvm.c
i386-netbsd-tdep.c sh-netbsd-tdep.c
src/external/gpl3/gdb/lib/libbacktrace/arch/x86_64:
backtrace-supported.h config.h
src/external/gpl3/gdb/lib/libbfd/arch/x86_64: bfd-in3.h bfd.h bfdver.h
config.h defs.mk targmatch.h
src/external/gpl3/gdb/lib/libctf/arch/x86_64: config.h
src/external/gpl3/gdb/lib/libdecnumber/arch/x86_64: gstdint.h
src/external/gpl3/gdb/lib/libgdb: Makefile
src/external/gpl3/gdb/lib/libgdb/arch/x86_64: config.h defs.mk init.c
jit-reader.h version.c xml-builtin.c
src/external/gpl3/gdb/lib/libgdbsupport: Makefile
src/external/gpl3/gdb/lib/libgdbsupport/arch/x86_64: defs.mk
src/external/gpl3/gdb/lib/libgdbsupport/arch/x86_64/gdbsupport:
config.h
src/external/gpl3/gdb/lib/libiberty/arch/x86_64: config.h
src/external/gpl3/gdb/lib/libopcodes/arch/x86_64: config.h

Log Message:
- regen x86
- api updates
- switch to c++-17
- add new dependencies
- disable installing info files


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/external/gpl3/gdb/Makefile.inc
cvs rdiff -u -r1.26 -r1.27 src/external/gpl3/gdb/bin/gdb/Makefile
cvs rdiff -u -r1.7 -r1.8 src/external/gpl3/gdb/bin/gdbserver/Makefile
cvs rdiff -u -r1.19 -r1.20 src/external/gpl3/gdb/bin/gdbtui/Makefile
cvs rdiff -u -r1.3 -r1.4 src/external/gpl3/gdb/dist/gdb/amd64-netbsd-tdep.c \
src/external/gpl3/gdb/dist/gdb/i386-netbsd-tdep.c
cvs rdiff -u -r1.21 -r1.22 src/external/gpl3/gdb/dist/gdb/bsd-kvm.c
cvs rdiff -u -r1.5 -r1.6 src/external/gpl3/gdb/dist/gdb/sh-netbsd-tdep.c
cvs rdiff -u -r1.1 -r1.2 \
src/external/gpl3/gdb/lib/libbacktrace/arch/x86_64/backtrace-supported.h \
src/external/gpl3/gdb/lib/libbacktrace/arch/x86_64/config.h
cvs rdiff -u -r1.10 -r1.11 \
src/external/gpl3/gdb/lib/libbfd/arch/x86_64/bfd-in3.h \
src/external/gpl3/gdb/lib/libbfd/arch/x86_64/bfd.h \
src/external/gpl3/gdb/lib/libbfd/arch/x86_64/bfdver.h
cvs rdiff -u -r1.13 -r1.14 \
src/external/gpl3/gdb/lib/libbfd/arch/x86_64/config.h
cvs rdiff -u -r1.9 -r1.10 \
src/external/gpl3/gdb/lib/libbfd/arch/x86_64/defs.mk
cvs rdiff -u -r1.16 -r1.17 \
src/external/gpl3/gdb/lib/libbfd/arch/x86_64/targmatch.h
cvs rdiff -u -r1.1 -r1.2 \
src/external/gpl3/gdb/lib/libctf/arch/x86_64/config.h
cvs rdiff -u -r1.13 -r1.14 \
src/external/gpl3/gdb/lib/libdecnumber/arch/x86_64/gstdint.h
cvs rdiff -u -r1.36 -r1.37 src/external/gpl3/gdb/lib/libgdb/Makefile
cvs rdiff -u -r1.17 -r1.18 \
src/external/gpl3/gdb/lib/libgdb/arch/x86_64/config.h
cvs rdiff -u -r1.25 -r1.26 \
src/external/gpl3/gdb/lib/libgdb/arch/x86_64/defs.mk
cvs rdiff -u -r1.21 -r1.22 \
src/external/gpl3/gdb/lib/libgdb/arch/x86_64/init.c
cvs rdiff -u -r1.8 -r1.9 \
src/external/gpl3/gdb/lib/libgdb/arch/x86_64/jit-reader.h
cvs rdiff -u -r1.11 -r1.12 \
src/external/gpl3/gdb/lib/libgdb/arch/x86_64/version.c \
src/external/gpl3/gdb/lib/libgdb/arch/x86_64/xml-builtin.c
cvs rdiff -u -r1.2 -r1.3 src/external/gpl3/gdb/lib/libgdbsupport/Makefile
cvs rdiff -u -r1.2 -r1.3 \
src/external/gpl3/gdb/lib/libgdbsupport/arch/x86_64/defs.mk
cvs rdiff -u -r1.2 -r1.3 \
src/external/gpl3/gdb/lib/libgdbsupport/arch/x86_64/gdbsupport/config.h
cvs rdiff -u -r1.8 -r1.9 \
src/external/gpl3/gdb/lib/libiberty/arch/x86_64/config.h
cvs rdiff -u -r1.9 -r1.10 \
src/external/gpl3/gdb/lib/libopcodes/arch/x86_64/config.h

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



CVS commit: src/external/gpl3/gdb/dist/gdb/doc

2024-08-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Aug 14 23:51:40 UTC 2024

Modified Files:
src/external/gpl3/gdb/dist/gdb/doc: Makefile.in

Log Message:
Disable building info files and man pages for now since our texinfo can't
handle them (and the new texinfo is written in perl)


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/gpl3/gdb/dist/gdb/doc/Makefile.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/gpl3/gdb/dist/gdb/doc/Makefile.in
diff -u src/external/gpl3/gdb/dist/gdb/doc/Makefile.in:1.3 src/external/gpl3/gdb/dist/gdb/doc/Makefile.in:1.4
--- src/external/gpl3/gdb/dist/gdb/doc/Makefile.in:1.3	Mon Aug 12 18:09:31 2024
+++ src/external/gpl3/gdb/dist/gdb/doc/Makefile.in	Wed Aug 14 19:51:40 2024
@@ -88,7 +88,8 @@ SET_TEXINPUTS = \
TEXINPUTS=${TEXIDIR}:.:$(srcdir):$(READLINE_DIR):$(GDBMI_DIR):$$TEXINPUTS
 
 # Files which should be generated via 'info' and installed by 'install-info'
-INFO_DEPS = gdb.info stabs.info annotate.info
+# XXX: our texinfo can't handle them and texinfo-7.1 is in perl
+#INFO_DEPS = gdb.info stabs.info annotate.info
 
 # Files which should be generated via 'dvi' and installed by 'install-dvi'
 DVIFILES = gdb.dvi stabs.dvi refcard.dvi annotate.dvi
@@ -521,6 +522,8 @@ gdb.pdf: ${GDB_DOC_FILES}
 
 # GDB MANUAL: info file
 gdb.info: ${GDB_DOC_FILES}
+	@echo "NOT REBUILDING $@"
+NetBSD_DISABLED_gdb.info:
 	$(ECHO_MAKEINFO) $(MAKEINFO_CMD) $(READLINE_TEXI_INCFLAG) -I ${GDBMI_DIR} -I $(srcdir) \
 		-o gdb.info $(srcdir)/gdb.texinfo
 
@@ -603,6 +606,9 @@ gdb/index.html: ${GDB_DOC_FILES}
 		$(srcdir)/gdb.texinfo
 
 stabs.info: $(STABS_DOC_FILES)
+	@echo "NOT REBUILDING $@"
+NetBSD_DISABLED_stabs.info:
+	$(ECHO_MAKEINFO) $(MAKEINFO_CMD) -I $(srcdir) -o stabs.info $(srcdir)/stabs.texinfo
 	$(ECHO_MAKEINFO) $(MAKEINFO_CMD) -I $(srcdir) -o stabs.info $(srcdir)/stabs.texinfo
 
 # STABS DOCUMENTATION: HTML file
@@ -654,6 +660,8 @@ annotate.pdf: $(ANNOTATE_DOC_FILES)
 		$(srcdir)/annotate.texinfo
 
 annotate.info: $(ANNOTATE_DOC_FILES)
+	@echo "NOT REBUILDING $@"
+NetBSD_DISABLED_annotate.info:
 	$(ECHO_MAKEINFO) $(MAKEINFO_CMD) -I $(srcdir) -o annotate.info $(srcdir)/annotate.texinfo
 
 annotate/index.html: $(ANNOTATE_DOC_FILES)
@@ -676,12 +684,16 @@ annotate/index.html: $(ANNOTATE_DOC_FILE
 # trigger an attempt to rebuild these files while building and
 # installing a release of GDB, which is something we don't want.
 $(MAN1S) : %.1 : $(GDB_DOC_FILES)
+	@echo "NOT REBUILDING $@"
+NetBSD_DISABLED_MAN1S:
 	$(ECHO_TEXI2POD) $(TEXI2POD) $(MANCONF) -D$* < $(srcdir)/gdb.texinfo > $*.pod
 	$(ECHO_TEXI2MAN) ($(POD2MAN1) $*.pod | sed -e '/^.if n .na/d' > $@.T && \
 		mv -f $@.T $@) || (rm -f $@.T && exit 1)
 	$(SILENCE) rm -f $*.pod
 
 $(MAN5S) : %.5 : $(GDB_DOC_FILES)
+	@echo "NOT REBUILDING $@"
+NetBSD_DISABLED_MAN5S:
 	$(ECHO_TEXI2POD) $(TEXI2POD) $(MANCONF) -D$* < $(srcdir)/gdb.texinfo > $*.pod
 	$(ECHO_TEXI2MAN) ($(POD2MAN5) $*.pod | sed -e '/^.if n .na/d' > $@.T && \
 		mv -f $@.T $@) || (rm -f $@.T && exit 1)



CVS commit: src/external/gpl3/gdb/dist/gdb/doc

2024-08-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Aug 14 23:51:40 UTC 2024

Modified Files:
src/external/gpl3/gdb/dist/gdb/doc: Makefile.in

Log Message:
Disable building info files and man pages for now since our texinfo can't
handle them (and the new texinfo is written in perl)


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/gpl3/gdb/dist/gdb/doc/Makefile.in

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

2024-08-14 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Aug 14 23:32:32 UTC 2024

Modified Files:
src/tests/lib/libc/locale: Makefile

Log Message:
tests/lib/libc/locale/Makefile: Sort.

No functional change intended.

Preparation for PR lib/52374.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/tests/lib/libc/locale/Makefile

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/locale/Makefile
diff -u src/tests/lib/libc/locale/Makefile:1.14 src/tests/lib/libc/locale/Makefile:1.15
--- src/tests/lib/libc/locale/Makefile:1.14	Mon Nov 27 19:45:36 2023
+++ src/tests/lib/libc/locale/Makefile	Wed Aug 14 23:32:31 2024
@@ -1,32 +1,32 @@
-# $NetBSD: Makefile,v 1.14 2023/11/27 19:45:36 christos Exp $
+# $NetBSD: Makefile,v 1.15 2024/08/14 23:32:31 riastradh Exp $
 
 .include 
 
 TESTSDIR=	${TESTSBASE}/lib/libc/locale
 
+TESTS_C+=	t_btowc
+TESTS_C+=	t_digittoint
+TESTS_C+=	t_ducet
+TESTS_C+=	t_io
 TESTS_C+=	t_mbrtowc
-TESTS_C+=	t_mbstowcs
 TESTS_C+=	t_mbsnrtowcs
+TESTS_C+=	t_mbstowcs
 TESTS_C+=	t_mbtowc
+TESTS_C+=	t_sprintf
+TESTS_C+=	t_strfmon
+TESTS_C+=	t_toupper
+TESTS_C+=	t_wcscoll
 TESTS_C+=	t_wcscspn
 TESTS_C+=	t_wcspbrk
 TESTS_C+=	t_wcsrtombs
 TESTS_C+=	t_wcsspn
 TESTS_C+=	t_wcstod
 TESTS_C+=	t_wctomb
-TESTS_C+=	t_io
-TESTS_C+=	t_toupper
-TESTS_C+=	t_digittoint
-TESTS_C+=	t_sprintf
 TESTS_C+=	t_wctype
-TESTS_C+=	t_btowc
-TESTS_C+=	t_wcscoll
-TESTS_C+=	t_ducet
-TESTS_C+=	t_strfmon
 
-COPTS.t_wctomb.c += -Wno-stack-protector
-COPTS.t_digittoint.c += -Wno-unused-variable
 COPTS.t_btowc.c += -Wno-unused-variable
+COPTS.t_digittoint.c += -Wno-unused-variable
 COPTS.t_strfmon.c += -Wno-format-nonliteral
+COPTS.t_wctomb.c += -Wno-stack-protector
 
 .include 



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

2024-08-14 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Aug 14 23:32:32 UTC 2024

Modified Files:
src/tests/lib/libc/locale: Makefile

Log Message:
tests/lib/libc/locale/Makefile: Sort.

No functional change intended.

Preparation for PR lib/52374.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/tests/lib/libc/locale/Makefile

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



CVS commit: src/external/gpl3/gdb/dist/gdbserver

2024-08-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Aug 14 23:19:31 UTC 2024

Modified Files:
src/external/gpl3/gdb/dist/gdbserver: server.cc

Log Message:
XXX: something is wrong with our c++ templates. Disable for now. This is
just to pretty-print an error message so no big deal.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.3 -r1.2 src/external/gpl3/gdb/dist/gdbserver/server.cc

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

Modified files:

Index: src/external/gpl3/gdb/dist/gdbserver/server.cc
diff -u src/external/gpl3/gdb/dist/gdbserver/server.cc:1.1.1.3 src/external/gpl3/gdb/dist/gdbserver/server.cc:1.2
--- src/external/gpl3/gdb/dist/gdbserver/server.cc:1.1.1.3	Mon Aug 12 17:39:21 2024
+++ src/external/gpl3/gdb/dist/gdbserver/server.cc	Wed Aug 14 19:19:31 2024
@@ -949,12 +949,17 @@ handle_general_set (char *own_buf)
 
 	  if ((options & ~supported_options) != 0)
 	{
+#if 0
+	  // XXX: see undefined
 	  /* GDB asked for an unknown or unsupported option, so
 		 error out.  */
 	  std::string err
 		= string_printf ("E.Unknown thread options requested: %s\n",
  to_string (options).c_str ());
 	  strcpy (own_buf, err.c_str ());
+#else
+	  strcpy (own_buf, "unsuppported option");
+#endif
 	  return;
 	}
 
@@ -1004,9 +1009,13 @@ handle_general_set (char *own_buf)
 
 	  if (thread->thread_options != options)
 	{
+#if 0
+	  // XXX: undefined reference to
+	  // `to_string[abi:cxx11](enum_flags)'
 	  threads_debug_printf ("[options for %s are now %s]\n",
 target_pid_to_str (ptid_of (thread)).c_str (),
 to_string (options).c_str ());
+#endif
 
 	  thread->thread_options = options;
 	}



CVS commit: src/external/gpl3/gdb/dist/gdbserver

2024-08-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Aug 14 23:19:31 UTC 2024

Modified Files:
src/external/gpl3/gdb/dist/gdbserver: server.cc

Log Message:
XXX: something is wrong with our c++ templates. Disable for now. This is
just to pretty-print an error message so no big deal.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.3 -r1.2 src/external/gpl3/gdb/dist/gdbserver/server.cc

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



CVS commit: src/sys/uvm

2024-08-14 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Wed Aug 14 22:24:09 UTC 2024

Modified Files:
src/sys/uvm: uvm_map.c

Log Message:
uvm_map: Fix build failure with DIAGNOSTIC for rev 1.422

PR kern/51254: uvm assertion "!topdown || hint <= orig_hint" failed


To generate a diff of this commit:
cvs rdiff -u -r1.423 -r1.424 src/sys/uvm/uvm_map.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/uvm_map.c
diff -u src/sys/uvm/uvm_map.c:1.423 src/sys/uvm/uvm_map.c:1.424
--- src/sys/uvm/uvm_map.c:1.423	Wed Aug 14 21:05:11 2024
+++ src/sys/uvm/uvm_map.c	Wed Aug 14 22:24:09 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_map.c,v 1.423 2024/08/14 21:05:11 riastradh Exp $	*/
+/*	$NetBSD: uvm_map.c,v 1.424 2024/08/14 22:24:09 rin Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -66,7 +66,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uvm_map.c,v 1.423 2024/08/14 21:05:11 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_map.c,v 1.424 2024/08/14 22:24:09 rin Exp $");
 
 #include "opt_ddb.h"
 #include "opt_pax.h"
@@ -1868,7 +1868,7 @@ uvm_findspace_invariants(struct vm_map *
 	map, hint, topdown ? ">" : "<", orig_hint,
 	length, uobj, (unsigned long long)uoffset, align,
 	flags, entry, entry ? entry->start : 0, entry ? entry->end : 0,
-	entry && entry->next,
+	entry ? entry->next : NULL,
 	entry && entry->next ? entry->next->start : 0,
 	entry && entry->next ? entry->next->end : 0,
 	line);



CVS commit: src/sys/uvm

2024-08-14 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Wed Aug 14 22:24:09 UTC 2024

Modified Files:
src/sys/uvm: uvm_map.c

Log Message:
uvm_map: Fix build failure with DIAGNOSTIC for rev 1.422

PR kern/51254: uvm assertion "!topdown || hint <= orig_hint" failed


To generate a diff of this commit:
cvs rdiff -u -r1.423 -r1.424 src/sys/uvm/uvm_map.c

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



CVS commit: src/sys/uvm

2024-08-14 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Aug 14 21:05:11 UTC 2024

Modified Files:
src/sys/uvm: uvm_map.c

Log Message:
uvm_map(9): Make sure search in the nearest gap is monotonic.

The algorithm, on a hint clamped to the VM bounds, works as follows
(assuming topdown VM):

1. Make sure the hint is aligned, by subtracting the remainderin
   uvm_map_align_va.

2. If the hint is equal to the VM max, try the first free gap.

3. If the hint is not equal to the VM max, but is already in use, try
   the next gap _below_ the entry covering hint.

4. If the hint is not equal to the VM max and is not already in use,
   try gap between the entry below hint and the next entry after it,
   above hint.

In the last case, `entry' is the one below hint, and `entry->next' is
the one above it.  We would take

entry->next->start - length

as the next candidate hint.

However, this algorithm is supposed to be a monotonic search through
the address space, and we might wind up with something like:

[0x7defb000,0x7defc000) entry above hint (entry->next)
0x77895000  hint
[0x77894000,0x77895000) entry below hint (entry)

In this case, if length=0x1000, we would take

0x7defb000 - 0x1000 = 0x7defa000

as the next candidate hint, but this violates monotonicity of the
search.

Instead, take the _smallest_ of orig_hint or entry->next->start -
length, to avoid violating monotonicity, so hint <= orig_hint.

I didn't commit this change before because it didn't seem to fix all
the manifestations of the problem, but we have more diagnostics now
so maybe we will find there is a _different_ violation of the same
invariants once this is committed -- and I'm pretty sure this change
is necessary to guarantee monotonicity in some cases (but I'm still
not sure why we're only hitting the problem on sh3).

PR kern/51254: uvm assertion "!topdown || hint <= orig_hint" failed


To generate a diff of this commit:
cvs rdiff -u -r1.422 -r1.423 src/sys/uvm/uvm_map.c

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



CVS commit: src/sys/uvm

2024-08-14 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Aug 14 21:05:11 UTC 2024

Modified Files:
src/sys/uvm: uvm_map.c

Log Message:
uvm_map(9): Make sure search in the nearest gap is monotonic.

The algorithm, on a hint clamped to the VM bounds, works as follows
(assuming topdown VM):

1. Make sure the hint is aligned, by subtracting the remainderin
   uvm_map_align_va.

2. If the hint is equal to the VM max, try the first free gap.

3. If the hint is not equal to the VM max, but is already in use, try
   the next gap _below_ the entry covering hint.

4. If the hint is not equal to the VM max and is not already in use,
   try gap between the entry below hint and the next entry after it,
   above hint.

In the last case, `entry' is the one below hint, and `entry->next' is
the one above it.  We would take

entry->next->start - length

as the next candidate hint.

However, this algorithm is supposed to be a monotonic search through
the address space, and we might wind up with something like:

[0x7defb000,0x7defc000) entry above hint (entry->next)
0x77895000  hint
[0x77894000,0x77895000) entry below hint (entry)

In this case, if length=0x1000, we would take

0x7defb000 - 0x1000 = 0x7defa000

as the next candidate hint, but this violates monotonicity of the
search.

Instead, take the _smallest_ of orig_hint or entry->next->start -
length, to avoid violating monotonicity, so hint <= orig_hint.

I didn't commit this change before because it didn't seem to fix all
the manifestations of the problem, but we have more diagnostics now
so maybe we will find there is a _different_ violation of the same
invariants once this is committed -- and I'm pretty sure this change
is necessary to guarantee monotonicity in some cases (but I'm still
not sure why we're only hitting the problem on sh3).

PR kern/51254: uvm assertion "!topdown || hint <= orig_hint" failed


To generate a diff of this commit:
cvs rdiff -u -r1.422 -r1.423 src/sys/uvm/uvm_map.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/uvm_map.c
diff -u src/sys/uvm/uvm_map.c:1.422 src/sys/uvm/uvm_map.c:1.423
--- src/sys/uvm/uvm_map.c:1.422	Wed Aug 14 20:58:25 2024
+++ src/sys/uvm/uvm_map.c	Wed Aug 14 21:05:11 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_map.c,v 1.422 2024/08/14 20:58:25 riastradh Exp $	*/
+/*	$NetBSD: uvm_map.c,v 1.423 2024/08/14 21:05:11 riastradh Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -66,7 +66,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uvm_map.c,v 1.422 2024/08/14 20:58:25 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_map.c,v 1.423 2024/08/14 21:05:11 riastradh Exp $");
 
 #include "opt_ddb.h"
 #include "opt_pax.h"
@@ -2081,7 +2081,7 @@ uvm_map_findspace(struct vm_map *map, va
 		if (length > entry->next->start - vm_map_min(map))
 			hint = vm_map_min(map); /* XXX goto wraparound? */
 		else
-			hint = entry->next->start - length;
+			hint = MIN(orig_hint, entry->next->start - length);
 		KASSERT(hint >= vm_map_min(map));
 	} else {
 		hint = entry->end;



CVS commit: src/sys/uvm

2024-08-14 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Aug 14 20:58:25 UTC 2024

Modified Files:
src/sys/uvm: uvm_map.c

Log Message:
uvm_map(9): Show the next entry when findspace invariants fail too.

PR kern/51254: uvm assertion "!topdown || hint <= orig_hint" failed


To generate a diff of this commit:
cvs rdiff -u -r1.421 -r1.422 src/sys/uvm/uvm_map.c

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



CVS commit: src/sys/uvm

2024-08-14 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Aug 14 20:58:25 UTC 2024

Modified Files:
src/sys/uvm: uvm_map.c

Log Message:
uvm_map(9): Show the next entry when findspace invariants fail too.

PR kern/51254: uvm assertion "!topdown || hint <= orig_hint" failed


To generate a diff of this commit:
cvs rdiff -u -r1.421 -r1.422 src/sys/uvm/uvm_map.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/uvm_map.c
diff -u src/sys/uvm/uvm_map.c:1.421 src/sys/uvm/uvm_map.c:1.422
--- src/sys/uvm/uvm_map.c:1.421	Wed Aug 14 01:26:25 2024
+++ src/sys/uvm/uvm_map.c	Wed Aug 14 20:58:25 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_map.c,v 1.421 2024/08/14 01:26:25 riastradh Exp $	*/
+/*	$NetBSD: uvm_map.c,v 1.422 2024/08/14 20:58:25 riastradh Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -66,7 +66,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uvm_map.c,v 1.421 2024/08/14 01:26:25 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_map.c,v 1.422 2024/08/14 20:58:25 riastradh Exp $");
 
 #include "opt_ddb.h"
 #include "opt_pax.h"
@@ -1862,11 +1862,15 @@ uvm_findspace_invariants(struct vm_map *
 	"%s map=%p hint=%#" PRIxVADDR " %s orig_hint=%#" PRIxVADDR
 	" length=%#" PRIxVSIZE " uobj=%p uoffset=%#llx align=%" PRIxVSIZE
 	" flags=%#x entry@%p=[%" PRIxVADDR ",%" PRIxVADDR ")"
+	" entry->next@%p=[%" PRIxVADDR ",%" PRIxVADDR ")"
 	" (uvm_map_findspace line %d)",
 	topdown ? "topdown" : "bottomup",
 	map, hint, topdown ? ">" : "<", orig_hint,
 	length, uobj, (unsigned long long)uoffset, align,
 	flags, entry, entry ? entry->start : 0, entry ? entry->end : 0,
+	entry && entry->next,
+	entry && entry->next ? entry->next->start : 0,
+	entry && entry->next ? entry->next->end : 0,
 	line);
 }
 



CVS commit: src/sys/dev/pci

2024-08-14 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Wed Aug 14 12:11:48 UTC 2024

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

Log Message:
initialize a screen even if we're not the console


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/dev/pci/pm3fb.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/pm3fb.c
diff -u src/sys/dev/pci/pm3fb.c:1.9 src/sys/dev/pci/pm3fb.c:1.10
--- src/sys/dev/pci/pm3fb.c:1.9	Sun Sep 25 17:52:25 2022
+++ src/sys/dev/pci/pm3fb.c	Wed Aug 14 12:11:48 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: pm3fb.c,v 1.9 2022/09/25 17:52:25 thorpej Exp $ */
+/* $NetBSD: pm3fb.c,v 1.10 2024/08/14 12:11:48 macallan Exp $ */
 
 /*
  * Copyright (c) 2015 Naruaki Etomi
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pm3fb.c,v 1.9 2022/09/25 17:52:25 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pm3fb.c,v 1.10 2024/08/14 12:11:48 macallan Exp $");
 
 #include 
 #include 
@@ -306,30 +306,25 @@ pm3fb_attach(device_t parent, device_t s
 
 	ri = &sc->sc_console_screen.scr_ri;
 
+	vcons_init_screen(&sc->vd, &sc->sc_console_screen, 1, &defattr);
+	sc->sc_console_screen.scr_flags |= VCONS_SCREEN_IS_STATIC;
+
+	pm3fb_rectfill(sc, 0, 0, sc->sc_width, sc->sc_height,
+	ri->ri_devcmap[(defattr >> 16) & 0xff]);
+	pm3fb_init_palette(sc);
+
+	sc->sc_defaultscreen_descr.textops = &ri->ri_ops;
+	sc->sc_defaultscreen_descr.capabilities = ri->ri_caps;
+	sc->sc_defaultscreen_descr.nrows = ri->ri_rows;
+	sc->sc_defaultscreen_descr.ncols = ri->ri_cols;
+
 	if (is_console) {
-		vcons_init_screen(&sc->vd, &sc->sc_console_screen, 1,
-		&defattr);
-		sc->sc_console_screen.scr_flags |= VCONS_SCREEN_IS_STATIC;
-
-		pm3fb_rectfill(sc, 0, 0, sc->sc_width, sc->sc_height,
-		ri->ri_devcmap[(defattr >> 16) & 0xff]);
-		sc->sc_defaultscreen_descr.textops = &ri->ri_ops;
-		sc->sc_defaultscreen_descr.capabilities = ri->ri_caps;
-		sc->sc_defaultscreen_descr.nrows = ri->ri_rows;
-		sc->sc_defaultscreen_descr.ncols = ri->ri_cols;
 
 		wsdisplay_cnattach(&sc->sc_defaultscreen_descr, ri, 0, 0,
 		defattr);
 		vcons_replay_msgbuf(&sc->sc_console_screen);
-	} else {
-		if (sc->sc_console_screen.scr_ri.ri_rows == 0) {
-			/* do some minimal setup to avoid weirdnesses later */
-			vcons_init_screen(&sc->vd, &sc->sc_console_screen, 1,
-			   &defattr);
-		}
 	}
 
-	pm3fb_init_palette(sc);
 
 	aa.console = is_console;
 	aa.scrdata = &sc->sc_screenlist;



CVS commit: src/sys/dev/pci

2024-08-14 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Wed Aug 14 12:11:48 UTC 2024

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

Log Message:
initialize a screen even if we're not the console


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/dev/pci/pm3fb.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/grep

2024-08-13 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Wed Aug 14 05:02:19 UTC 2024

Modified Files:
src/usr.bin/grep: file.c

Log Message:
grep: grep_refill: Fix previous; WITHOUT_BZ2 not WITHOUT_GZIP


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/usr.bin/grep/file.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/grep

2024-08-13 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Wed Aug 14 05:02:19 UTC 2024

Modified Files:
src/usr.bin/grep: file.c

Log Message:
grep: grep_refill: Fix previous; WITHOUT_BZ2 not WITHOUT_GZIP


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/usr.bin/grep/file.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/grep/file.c
diff -u src/usr.bin/grep/file.c:1.12 src/usr.bin/grep/file.c:1.13
--- src/usr.bin/grep/file.c:1.12	Wed Aug 14 04:59:51 2024
+++ src/usr.bin/grep/file.c	Wed Aug 14 05:02:19 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: file.c,v 1.12 2024/08/14 04:59:51 rin Exp $	*/
+/*	$NetBSD: file.c,v 1.13 2024/08/14 05:02:19 rin Exp $	*/
 /*	$FreeBSD: head/usr.bin/grep/file.c 211496 2010-08-19 09:28:59Z des $	*/
 /*	$OpenBSD: file.c,v 1.11 2010/07/02 20:48:48 nicm Exp $	*/
 
@@ -35,7 +35,7 @@
 #endif
 
 #include 
-__RCSID("$NetBSD: file.c,v 1.12 2024/08/14 04:59:51 rin Exp $");
+__RCSID("$NetBSD: file.c,v 1.13 2024/08/14 05:02:19 rin Exp $");
 
 #include 
 #include 
@@ -74,7 +74,7 @@ static inline int
 grep_refill(struct file *f)
 {
 	ssize_t nr = -1;
-#ifndef WITHOUT_GZIP
+#ifndef WITHOUT_BZ2
 	int bzerr;
 #endif
 



CVS commit: src/usr.bin/grep

2024-08-13 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Wed Aug 14 04:59:51 UTC 2024

Modified Files:
src/usr.bin/grep: file.c

Log Message:
grep: grep_refill: Fix -Wunused-variable for WITHOUT_GZIP

NFC otherwise.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/usr.bin/grep/file.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/grep/file.c
diff -u src/usr.bin/grep/file.c:1.11 src/usr.bin/grep/file.c:1.12
--- src/usr.bin/grep/file.c:1.11	Fri Apr  5 13:34:41 2019
+++ src/usr.bin/grep/file.c	Wed Aug 14 04:59:51 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: file.c,v 1.11 2019/04/05 13:34:41 christos Exp $	*/
+/*	$NetBSD: file.c,v 1.12 2024/08/14 04:59:51 rin Exp $	*/
 /*	$FreeBSD: head/usr.bin/grep/file.c 211496 2010-08-19 09:28:59Z des $	*/
 /*	$OpenBSD: file.c,v 1.11 2010/07/02 20:48:48 nicm Exp $	*/
 
@@ -35,7 +35,7 @@
 #endif
 
 #include 
-__RCSID("$NetBSD: file.c,v 1.11 2019/04/05 13:34:41 christos Exp $");
+__RCSID("$NetBSD: file.c,v 1.12 2024/08/14 04:59:51 rin Exp $");
 
 #include 
 #include 
@@ -74,7 +74,9 @@ static inline int
 grep_refill(struct file *f)
 {
 	ssize_t nr = -1;
+#ifndef WITHOUT_GZIP
 	int bzerr;
+#endif
 
 	bufpos = buffer;
 	bufrem = 0;



CVS commit: src/usr.bin/grep

2024-08-13 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Wed Aug 14 04:59:51 UTC 2024

Modified Files:
src/usr.bin/grep: file.c

Log Message:
grep: grep_refill: Fix -Wunused-variable for WITHOUT_GZIP

NFC otherwise.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/usr.bin/grep/file.c

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



CVS commit: src/sys/uvm

2024-08-13 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Aug 14 01:26:25 UTC 2024

Modified Files:
src/sys/uvm: uvm_map.c

Log Message:
uvm_map(9): Take vm map lock around uvm_unmap_remove.

This was tripping one of the assertions I added.  While it is safe
here not to hold the lock -- caller has exclusive access to the map
at this point -- it is better if we can annotate the functions in
question with executable notes about locking rules, and taking a
single uncontended lock in the vm map destruction path is probably a
tiny cost worth those executable notes.

PR kern/51254: uvm assertion "!topdown || hint <= orig_hint" failed


To generate a diff of this commit:
cvs rdiff -u -r1.420 -r1.421 src/sys/uvm/uvm_map.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/uvm_map.c
diff -u src/sys/uvm/uvm_map.c:1.420 src/sys/uvm/uvm_map.c:1.421
--- src/sys/uvm/uvm_map.c:1.420	Wed Aug 14 00:42:02 2024
+++ src/sys/uvm/uvm_map.c	Wed Aug 14 01:26:25 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_map.c,v 1.420 2024/08/14 00:42:02 riastradh Exp $	*/
+/*	$NetBSD: uvm_map.c,v 1.421 2024/08/14 01:26:25 riastradh Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -66,7 +66,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uvm_map.c,v 1.420 2024/08/14 00:42:02 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_map.c,v 1.421 2024/08/14 01:26:25 riastradh Exp $");
 
 #include "opt_ddb.h"
 #include "opt_pax.h"
@@ -1701,7 +1701,7 @@ uvm_map_lookup_entry(struct vm_map *map,
 	UVMHIST_CALLARGS(maphist,"(map=%#jx,addr=%#jx,ent=%#jx)",
 	(uintptr_t)map, address, (uintptr_t)entry, 0);
 
-	KDASSERT(rw_lock_held(&map->lock));
+	KASSERT(rw_lock_held(&map->lock));
 
 	/*
 	 * make a quick check to see if we are already looking at
@@ -2330,6 +2330,8 @@ uvm_unmap_remove(struct vm_map *map, vad
 	(uintptr_t)map, start, end, 0);
 	VM_MAP_RANGE_CHECK(map, start, end);
 
+	KASSERT(vm_map_locked_p(map));
+
 	uvm_map_check(map, "unmap_remove entry");
 
 	/*
@@ -4426,8 +4428,10 @@ uvmspace_free(struct vmspace *vm)
 		(*uvm_shmexit)(vm);
 
 	if (map->nentries) {
+		vm_map_lock(map);
 		uvm_unmap_remove(map, vm_map_min(map), vm_map_max(map),
 		&dead_entries, flags);
+		vm_map_unlock(map);
 		if (dead_entries != NULL)
 			uvm_unmap_detach(dead_entries, 0);
 	}



CVS commit: src/sys/uvm

2024-08-13 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Aug 14 01:26:25 UTC 2024

Modified Files:
src/sys/uvm: uvm_map.c

Log Message:
uvm_map(9): Take vm map lock around uvm_unmap_remove.

This was tripping one of the assertions I added.  While it is safe
here not to hold the lock -- caller has exclusive access to the map
at this point -- it is better if we can annotate the functions in
question with executable notes about locking rules, and taking a
single uncontended lock in the vm map destruction path is probably a
tiny cost worth those executable notes.

PR kern/51254: uvm assertion "!topdown || hint <= orig_hint" failed


To generate a diff of this commit:
cvs rdiff -u -r1.420 -r1.421 src/sys/uvm/uvm_map.c

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



CVS commit: src/sys/uvm

2024-08-13 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Aug 14 00:42:02 UTC 2024

Modified Files:
src/sys/uvm: uvm_map.c

Log Message:
uvm_map(9): Show the entry in findspace invariants.

No functional change intended in the non-crash3 case.

PR kern/51254: uvm assertion "!topdown || hint <= orig_hint" failed


To generate a diff of this commit:
cvs rdiff -u -r1.419 -r1.420 src/sys/uvm/uvm_map.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/uvm_map.c
diff -u src/sys/uvm/uvm_map.c:1.419 src/sys/uvm/uvm_map.c:1.420
--- src/sys/uvm/uvm_map.c:1.419	Wed Aug 14 00:41:46 2024
+++ src/sys/uvm/uvm_map.c	Wed Aug 14 00:42:02 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_map.c,v 1.419 2024/08/14 00:41:46 riastradh Exp $	*/
+/*	$NetBSD: uvm_map.c,v 1.420 2024/08/14 00:42:02 riastradh Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -66,7 +66,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uvm_map.c,v 1.419 2024/08/14 00:41:46 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_map.c,v 1.420 2024/08/14 00:42:02 riastradh Exp $");
 
 #include "opt_ddb.h"
 #include "opt_pax.h"
@@ -1861,11 +1861,13 @@ uvm_findspace_invariants(struct vm_map *
 	UVM_FINDSPACE_KASSERTMSG(hint_location_ok,
 	"%s map=%p hint=%#" PRIxVADDR " %s orig_hint=%#" PRIxVADDR
 	" length=%#" PRIxVSIZE " uobj=%p uoffset=%#llx align=%" PRIxVSIZE
-	" flags=%#x entry=%p (uvm_map_findspace line %d)",
+	" flags=%#x entry@%p=[%" PRIxVADDR ",%" PRIxVADDR ")"
+	" (uvm_map_findspace line %d)",
 	topdown ? "topdown" : "bottomup",
 	map, hint, topdown ? ">" : "<", orig_hint,
 	length, uobj, (unsigned long long)uoffset, align,
-	flags, entry, line);
+	flags, entry, entry ? entry->start : 0, entry ? entry->end : 0,
+	line);
 }
 
 /*



CVS commit: src/sys/uvm

2024-08-13 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Aug 14 00:42:02 UTC 2024

Modified Files:
src/sys/uvm: uvm_map.c

Log Message:
uvm_map(9): Show the entry in findspace invariants.

No functional change intended in the non-crash3 case.

PR kern/51254: uvm assertion "!topdown || hint <= orig_hint" failed


To generate a diff of this commit:
cvs rdiff -u -r1.419 -r1.420 src/sys/uvm/uvm_map.c

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



CVS commit: src/sys/uvm

2024-08-13 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Aug 14 00:41:46 UTC 2024

Modified Files:
src/sys/uvm: uvm_map.c

Log Message:
uvm_map(9): Avoid potential arithmetic overflow.

Should be harmless in this case because vaddr_t is unsigned, so
there's no undefined behaviour here, but let's make it unnecessary to
wonder whether overflow is a problem.

No functional change intended.

PR kern/51254: uvm assertion "!topdown || hint <= orig_hint" failed


To generate a diff of this commit:
cvs rdiff -u -r1.418 -r1.419 src/sys/uvm/uvm_map.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/uvm_map.c
diff -u src/sys/uvm/uvm_map.c:1.418 src/sys/uvm/uvm_map.c:1.419
--- src/sys/uvm/uvm_map.c:1.418	Wed Aug 14 00:41:30 2024
+++ src/sys/uvm/uvm_map.c	Wed Aug 14 00:41:46 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_map.c,v 1.418 2024/08/14 00:41:30 riastradh Exp $	*/
+/*	$NetBSD: uvm_map.c,v 1.419 2024/08/14 00:41:46 riastradh Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -66,7 +66,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uvm_map.c,v 1.418 2024/08/14 00:41:30 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_map.c,v 1.419 2024/08/14 00:41:46 riastradh Exp $");
 
 #include "opt_ddb.h"
 #include "opt_pax.h"
@@ -1820,11 +1820,13 @@ uvm_map_space_avail(vaddr_t *start, vsiz
 	 * Find the end of the proposed new region.  Be sure we didn't
 	 * wrap around the address; if so, we lose.  Otherwise, if the
 	 * proposed new region fits before the next entry, we win.
+	 *
+	 * XXX Should this use vm_map_max(map) as the max?
 	 */
 
-	end = *start + length;
-	if (end < *start)
+	if (length > __type_max(vaddr_t) - *start)
 		return (-1);
+	end = *start + length;
 
 	if (entry->next->start >= end && *start >= entry->end)
 		return (1);
@@ -2019,8 +2021,8 @@ uvm_map_findspace(struct vm_map *map, va
 		KASSERT(entry->next == &map->header ||
 		hint < entry->next->start);
 		if (flags & UVM_FLAG_FIXED) {
-			if (entry->next->start >= hint + length &&
-			hint + length > hint)
+			if (entry->next->start >= hint &&
+			length <= entry->next->start - hint)
 goto found;
 
 			/* "hint" address is gap but too small */
@@ -2286,7 +2288,8 @@ nextgap:
 	UVMHIST_LOG(maphist,"<- got it!  (result=%#jx)", hint, 0,0,0);
 	INVARIANTS();
 	KASSERT(entry->end <= hint);
-	KASSERT(hint + length <= entry->next->start);
+	KASSERT(hint <= entry->next->start);
+	KASSERT(length <= entry->next->start - hint);
 	return (entry);
 
  wraparound:



CVS commit: src/sys/uvm

2024-08-13 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Aug 14 00:41:46 UTC 2024

Modified Files:
src/sys/uvm: uvm_map.c

Log Message:
uvm_map(9): Avoid potential arithmetic overflow.

Should be harmless in this case because vaddr_t is unsigned, so
there's no undefined behaviour here, but let's make it unnecessary to
wonder whether overflow is a problem.

No functional change intended.

PR kern/51254: uvm assertion "!topdown || hint <= orig_hint" failed


To generate a diff of this commit:
cvs rdiff -u -r1.418 -r1.419 src/sys/uvm/uvm_map.c

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



CVS commit: src/sys/uvm

2024-08-13 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Aug 14 00:41:31 UTC 2024

Modified Files:
src/sys/uvm: uvm_map.c

Log Message:
uvm_map(9): Assert another loop invariant in entry lookup.

No functional change intended.

PR kern/51254: uvm assertion "!topdown || hint <= orig_hint" failed


To generate a diff of this commit:
cvs rdiff -u -r1.417 -r1.418 src/sys/uvm/uvm_map.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/uvm_map.c
diff -u src/sys/uvm/uvm_map.c:1.417 src/sys/uvm/uvm_map.c:1.418
--- src/sys/uvm/uvm_map.c:1.417	Tue Aug 13 20:52:52 2024
+++ src/sys/uvm/uvm_map.c	Wed Aug 14 00:41:30 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_map.c,v 1.417 2024/08/13 20:52:52 riastradh Exp $	*/
+/*	$NetBSD: uvm_map.c,v 1.418 2024/08/14 00:41:30 riastradh Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -66,7 +66,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uvm_map.c,v 1.417 2024/08/13 20:52:52 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_map.c,v 1.418 2024/08/14 00:41:30 riastradh Exp $");
 
 #include "opt_ddb.h"
 #include "opt_pax.h"
@@ -1656,6 +1656,7 @@ uvm_map_lookup_entry_bytree(struct vm_ma
 
 	while (cur) {
 		KASSERT(prev == &map->header || prev->end <= address);
+		KASSERT(prev == &map->header || prev->end <= cur->start);
 		UVMMAP_EVCNT_INCR(mlk_treeloop);
 		if (address >= cur->start) {
 			if (address < cur->end) {



CVS commit: src/sys/uvm

2024-08-13 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Aug 14 00:41:31 UTC 2024

Modified Files:
src/sys/uvm: uvm_map.c

Log Message:
uvm_map(9): Assert another loop invariant in entry lookup.

No functional change intended.

PR kern/51254: uvm assertion "!topdown || hint <= orig_hint" failed


To generate a diff of this commit:
cvs rdiff -u -r1.417 -r1.418 src/sys/uvm/uvm_map.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/config

2024-08-13 Thread Valery Ushakov
Module Name:src
Committed By:   uwe
Date:   Tue Aug 13 23:24:23 UTC 2024

Modified Files:
src/usr.bin/config: config.5

Log Message:
config(5): bump date for and fix typo in previous

PR bin/58583


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/usr.bin/config/config.5

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/config/config.5
diff -u src/usr.bin/config/config.5:1.49 src/usr.bin/config/config.5:1.50
--- src/usr.bin/config/config.5:1.49	Tue Aug 13 15:01:52 2024
+++ src/usr.bin/config/config.5	Tue Aug 13 23:24:23 2024
@@ -1,4 +1,4 @@
-.\" $NetBSD: config.5,v 1.49 2024/08/13 15:01:52 uwe Exp $
+.\" $NetBSD: config.5,v 1.50 2024/08/13 23:24:23 uwe Exp $
 .\"
 .\"  Copyright (c) 2006, 2007 The NetBSD Foundation.
 .\"  All rights reserved.
@@ -24,7 +24,7 @@
 .\"  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\"  POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd January 17, 2024
+.Dd August 13, 2024
 .Dt CONFIG 5
 .Os
 .Sh NAME
@@ -744,7 +744,7 @@ Used instead of
 .Ic machine
 in config file snippets for kernel modules to generate just the
 .Pa ioconf.c
-definions.
+definitions.
 The generated file contains subtrees that start with attachments
 declared with
 .Ic pseudo-root .



CVS commit: src/usr.bin/config

2024-08-13 Thread Valery Ushakov
Module Name:src
Committed By:   uwe
Date:   Tue Aug 13 23:24:23 UTC 2024

Modified Files:
src/usr.bin/config: config.5

Log Message:
config(5): bump date for and fix typo in previous

PR bin/58583


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/usr.bin/config/config.5

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



CVS commit: src/external/gpl2/xcvs/dist/doc

2024-08-13 Thread David H. Gutteridge
Module Name:src
Committed By:   gutteridge
Date:   Tue Aug 13 22:30:55 UTC 2024

Modified Files:
src/external/gpl2/xcvs/dist/doc: cvs.1

Log Message:
cvs.1: align update -D paragraph with info file version

Catch up with cvs.texinfo here. In other words, reflect PR bin/56256.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/external/gpl2/xcvs/dist/doc/cvs.1

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/xcvs/dist/doc/cvs.1
diff -u src/external/gpl2/xcvs/dist/doc/cvs.1:1.13 src/external/gpl2/xcvs/dist/doc/cvs.1:1.14
--- src/external/gpl2/xcvs/dist/doc/cvs.1:1.13	Sat Jul  6 00:10:25 2019
+++ src/external/gpl2/xcvs/dist/doc/cvs.1	Tue Aug 13 22:30:55 2024
@@ -4123,7 +4123,7 @@ them):
 \fB-D date\fR
 .IP "" 2
 Use the most recent revision no later than \fIdate\fR.
-This option is sticky, and implies \fB-P\fR.
+This option is sticky.
 See see node `Sticky tags\(aq in the CVS manual, for more information on sticky tags/dates.
 .SP
 .IP "" 0



CVS commit: src/external/gpl2/xcvs/dist/doc

2024-08-13 Thread David H. Gutteridge
Module Name:src
Committed By:   gutteridge
Date:   Tue Aug 13 22:30:55 UTC 2024

Modified Files:
src/external/gpl2/xcvs/dist/doc: cvs.1

Log Message:
cvs.1: align update -D paragraph with info file version

Catch up with cvs.texinfo here. In other words, reflect PR bin/56256.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/external/gpl2/xcvs/dist/doc/cvs.1

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



CVS commit: src/sys/uvm

2024-08-13 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Aug 13 20:52:52 UTC 2024

Modified Files:
src/sys/uvm: uvm_map.c

Log Message:
Redo uvm_map.c 1.414 without the null pointer dereference.

uvm_map(9): Sprinkle assertions and interface contract comments.

No functional change intended.

PR kern/51254: uvm assertion "!topdown || hint <= orig_hint" failed


To generate a diff of this commit:
cvs rdiff -u -r1.416 -r1.417 src/sys/uvm/uvm_map.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/uvm_map.c
diff -u src/sys/uvm/uvm_map.c:1.416 src/sys/uvm/uvm_map.c:1.417
--- src/sys/uvm/uvm_map.c:1.416	Tue Aug 13 20:23:23 2024
+++ src/sys/uvm/uvm_map.c	Tue Aug 13 20:52:52 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_map.c,v 1.416 2024/08/13 20:23:23 riastradh Exp $	*/
+/*	$NetBSD: uvm_map.c,v 1.417 2024/08/13 20:52:52 riastradh Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -66,7 +66,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uvm_map.c,v 1.416 2024/08/13 20:23:23 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_map.c,v 1.417 2024/08/13 20:52:52 riastradh Exp $");
 
 #include "opt_ddb.h"
 #include "opt_pax.h"
@@ -303,11 +303,23 @@ int _uvm_map_sanity(struct vm_map *);
 int _uvm_tree_sanity(struct vm_map *);
 static vsize_t uvm_rb_maxgap(const struct vm_map_entry *);
 
-#define	ROOT_ENTRY(map)		((struct vm_map_entry *)(map)->rb_tree.rbt_root)
-#define	LEFT_ENTRY(entry)	((struct vm_map_entry *)(entry)->rb_node.rb_left)
-#define	RIGHT_ENTRY(entry)	((struct vm_map_entry *)(entry)->rb_node.rb_right)
-#define	PARENT_ENTRY(map, entry) \
-	(ROOT_ENTRY(map) == (entry) \
+/*
+ * Tree iteration.  We violate the rbtree(9) abstraction for various
+ * things here.  Entries are ascending left to right, so, provided the
+ * child entry in question exists:
+ *
+ *	LEFT_ENTRY(entry)->end <= entry->start
+ *	entry->end <= RIGHT_ENTRY(entry)->start
+ */
+__CTASSERT(offsetof(struct vm_map_entry, rb_node) == 0);
+#define	ROOT_ENTRY(map)			  \
+	((struct vm_map_entry *)(map)->rb_tree.rbt_root)
+#define	LEFT_ENTRY(entry)		  \
+	((struct vm_map_entry *)(entry)->rb_node.rb_left)
+#define	RIGHT_ENTRY(entry)		  \
+	((struct vm_map_entry *)(entry)->rb_node.rb_right)
+#define	PARENT_ENTRY(map, entry)	  \
+	(ROOT_ENTRY(map) == (entry)	  \
 	? NULL : (struct vm_map_entry *)RB_FATHER(&(entry)->rb_node))
 
 /*
@@ -1619,6 +1631,18 @@ done:
 
 /*
  * uvm_map_lookup_entry_bytree: lookup an entry in tree
+ *
+ * => map must at least be read-locked by caller.
+ *
+ * => If address lies in an entry, set *entry to it and return true;
+ *then (*entry)->start <= address < (*entry)->end.
+
+ * => If address is below all entries in map, return false and set
+ **entry to &map->header.
+ *
+ * => Otherwise, return false and set *entry to the highest entry below
+ *address, so (*entry)->end <= address, and if (*entry)->next is
+ *not &map->header, address < (*entry)->next->start.
  */
 
 static inline bool
@@ -1628,7 +1652,10 @@ uvm_map_lookup_entry_bytree(struct vm_ma
 	struct vm_map_entry *prev = &map->header;
 	struct vm_map_entry *cur = ROOT_ENTRY(map);
 
+	KASSERT(rw_lock_held(&map->lock));
+
 	while (cur) {
+		KASSERT(prev == &map->header || prev->end <= address);
 		UVMMAP_EVCNT_INCR(mlk_treeloop);
 		if (address >= cur->start) {
 			if (address < cur->end) {
@@ -1636,10 +1663,14 @@ uvm_map_lookup_entry_bytree(struct vm_ma
 return true;
 			}
 			prev = cur;
+			KASSERT(prev->end <= address);
 			cur = RIGHT_ENTRY(cur);
+			KASSERT(cur == NULL || prev->end <= cur->start);
 		} else
 			cur = LEFT_ENTRY(cur);
 	}
+	KASSERT(prev == &map->header || prev->end <= address);
+	KASSERT(prev->next == &map->header || address < prev->next->start);
 	*entry = prev;
 	return false;
 }
@@ -1647,9 +1678,17 @@ uvm_map_lookup_entry_bytree(struct vm_ma
 /*
  * uvm_map_lookup_entry: find map entry at or before an address
  *
- * => map must at least be read-locked by caller
- * => entry is returned in "entry"
- * => return value is true if address is in the returned entry
+ * => map must at least be read-locked by caller.
+ *
+ * => If address lies in an entry, set *entry to it and return true;
+ *then (*entry)->start <= address < (*entry)->end.
+
+ * => If address is below all entries in map, return false and set
+ **entry to &map->header.
+ *
+ * => Otherwise, return false and set *entry to the highest entry below
+ *address, so (*entry)->end <= address, and if (*entry)->next is
+ *not &map->header, address < (*entry)->next->start.
  */
 
 bool
@@ -1661,6 +1700,8 @@ uvm_map_lookup_entry(struct vm_map *map,
 	UVMHIST_CALLARGS(maphist,"(map=%#jx,addr=%#jx,ent=%#jx)",
 	(uintptr_t)map, address, (uintptr_t)entry, 0);
 
+	KDASSERT(rw_lock_held(&map->lock));
+
 	/*
 	 * make a quick check to see if we are already looking at
 	 * the e

CVS commit: src/sys/uvm

2024-08-13 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Aug 13 20:52:52 UTC 2024

Modified Files:
src/sys/uvm: uvm_map.c

Log Message:
Redo uvm_map.c 1.414 without the null pointer dereference.

uvm_map(9): Sprinkle assertions and interface contract comments.

No functional change intended.

PR kern/51254: uvm assertion "!topdown || hint <= orig_hint" failed


To generate a diff of this commit:
cvs rdiff -u -r1.416 -r1.417 src/sys/uvm/uvm_map.c

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



CVS commit: src/sys/uvm

2024-08-13 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Aug 13 20:23:23 UTC 2024

Modified Files:
src/sys/uvm: uvm_map.c

Log Message:
Revert uvm_map.c 1.414.

This was:

   uvm_map(9): Sprinkle assertions and interface contract comments.

Apparently, you have to actually test changes, not just prove they
are correct.  Who knew??

(And the incantation `No functional change intended.' didn't work
either!)

PR kern/51254: uvm assertion "!topdown || hint <= orig_hint" failed


To generate a diff of this commit:
cvs rdiff -u -r1.415 -r1.416 src/sys/uvm/uvm_map.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/uvm_map.c
diff -u src/sys/uvm/uvm_map.c:1.415 src/sys/uvm/uvm_map.c:1.416
--- src/sys/uvm/uvm_map.c:1.415	Tue Aug 13 17:54:59 2024
+++ src/sys/uvm/uvm_map.c	Tue Aug 13 20:23:23 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_map.c,v 1.415 2024/08/13 17:54:59 riastradh Exp $	*/
+/*	$NetBSD: uvm_map.c,v 1.416 2024/08/13 20:23:23 riastradh Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -66,7 +66,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uvm_map.c,v 1.415 2024/08/13 17:54:59 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_map.c,v 1.416 2024/08/13 20:23:23 riastradh Exp $");
 
 #include "opt_ddb.h"
 #include "opt_pax.h"
@@ -303,23 +303,11 @@ int _uvm_map_sanity(struct vm_map *);
 int _uvm_tree_sanity(struct vm_map *);
 static vsize_t uvm_rb_maxgap(const struct vm_map_entry *);
 
-/*
- * Tree iteration.  We violate the rbtree(9) abstraction for various
- * things here.  Entries are ascending left to right, so, provided the
- * child entry in question exists:
- *
- *	LEFT_ENTRY(entry)->end <= entry->start
- *	entry->end <= RIGHT_ENTRY(entry)->start
- */
-__CTASSERT(offsetof(struct vm_map_entry, rb_node) == 0);
-#define	ROOT_ENTRY(map)			  \
-	((struct vm_map_entry *)(map)->rb_tree.rbt_root)
-#define	LEFT_ENTRY(entry)		  \
-	((struct vm_map_entry *)(entry)->rb_node.rb_left)
-#define	RIGHT_ENTRY(entry)		  \
-	((struct vm_map_entry *)(entry)->rb_node.rb_right)
-#define	PARENT_ENTRY(map, entry)	  \
-	(ROOT_ENTRY(map) == (entry)	  \
+#define	ROOT_ENTRY(map)		((struct vm_map_entry *)(map)->rb_tree.rbt_root)
+#define	LEFT_ENTRY(entry)	((struct vm_map_entry *)(entry)->rb_node.rb_left)
+#define	RIGHT_ENTRY(entry)	((struct vm_map_entry *)(entry)->rb_node.rb_right)
+#define	PARENT_ENTRY(map, entry) \
+	(ROOT_ENTRY(map) == (entry) \
 	? NULL : (struct vm_map_entry *)RB_FATHER(&(entry)->rb_node))
 
 /*
@@ -1631,18 +1619,6 @@ done:
 
 /*
  * uvm_map_lookup_entry_bytree: lookup an entry in tree
- *
- * => map must at least be read-locked by caller.
- *
- * => If address lies in an entry, set *entry to it and return true;
- *then (*entry)->start <= address < (*entry)->end.
-
- * => If address is below all entries in map, return false and set
- **entry to &map->header.
- *
- * => Otherwise, return false and set *entry to the highest entry below
- *address, so (*entry)->end <= address, and if (*entry)->next is
- *not &map->header, address < (*entry)->next->start.
  */
 
 static inline bool
@@ -1652,10 +1628,7 @@ uvm_map_lookup_entry_bytree(struct vm_ma
 	struct vm_map_entry *prev = &map->header;
 	struct vm_map_entry *cur = ROOT_ENTRY(map);
 
-	KASSERT(rw_lock_held(&map->lock));
-
 	while (cur) {
-		KASSERT(prev == &map->header || prev->end <= address);
 		UVMMAP_EVCNT_INCR(mlk_treeloop);
 		if (address >= cur->start) {
 			if (address < cur->end) {
@@ -1663,14 +1636,10 @@ uvm_map_lookup_entry_bytree(struct vm_ma
 return true;
 			}
 			prev = cur;
-			KASSERT(prev->end <= address);
 			cur = RIGHT_ENTRY(cur);
-			KASSERT(prev->end <= cur->start);
 		} else
 			cur = LEFT_ENTRY(cur);
 	}
-	KASSERT(prev == &map->header || prev->end <= address);
-	KASSERT(prev->next == &map->header || address < prev->next->start);
 	*entry = prev;
 	return false;
 }
@@ -1678,17 +1647,9 @@ uvm_map_lookup_entry_bytree(struct vm_ma
 /*
  * uvm_map_lookup_entry: find map entry at or before an address
  *
- * => map must at least be read-locked by caller.
- *
- * => If address lies in an entry, set *entry to it and return true;
- *then (*entry)->start <= address < (*entry)->end.
-
- * => If address is below all entries in map, return false and set
- **entry to &map->header.
- *
- * => Otherwise, return false and set *entry to the highest entry below
- *address, so (*entry)->end <= address, and if (*entry)->next is
- *not &map->header, address < (*entry)->next->start.
+ * => map must at least be read-locked by caller
+ * => entry is returned in "entry"
+ * => return value is true if address is in the returned entry
  */
 
 bool
@@ -1700,8 +1661,6 @@ uvm_map_lookup_entry(struct vm_map *map,
 	UVMHIST_CALLARGS(maphist,"(map=%#jx,addr=%#jx,ent=%#jx)",
 	(uintptr_t)map, address, (uintptr_t)entry, 0);
 
-	KDASSERT(rw_

CVS commit: src/sys/uvm

2024-08-13 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Aug 13 20:23:23 UTC 2024

Modified Files:
src/sys/uvm: uvm_map.c

Log Message:
Revert uvm_map.c 1.414.

This was:

   uvm_map(9): Sprinkle assertions and interface contract comments.

Apparently, you have to actually test changes, not just prove they
are correct.  Who knew??

(And the incantation `No functional change intended.' didn't work
either!)

PR kern/51254: uvm assertion "!topdown || hint <= orig_hint" failed


To generate a diff of this commit:
cvs rdiff -u -r1.415 -r1.416 src/sys/uvm/uvm_map.c

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



CVS commit: src/sys/uvm

2024-08-13 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Aug 13 17:54:59 UTC 2024

Modified Files:
src/sys/uvm: uvm_map.c

Log Message:
uvm_map(9): Sprinkle invariant assertions into uvm_map_space_avail.

No functional change intended.

PR kern/51254: uvm assertion "!topdown || hint <= orig_hint" failed


To generate a diff of this commit:
cvs rdiff -u -r1.414 -r1.415 src/sys/uvm/uvm_map.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/uvm_map.c
diff -u src/sys/uvm/uvm_map.c:1.414 src/sys/uvm/uvm_map.c:1.415
--- src/sys/uvm/uvm_map.c:1.414	Tue Aug 13 17:54:44 2024
+++ src/sys/uvm/uvm_map.c	Tue Aug 13 17:54:59 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_map.c,v 1.414 2024/08/13 17:54:44 riastradh Exp $	*/
+/*	$NetBSD: uvm_map.c,v 1.415 2024/08/13 17:54:59 riastradh Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -66,7 +66,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uvm_map.c,v 1.414 2024/08/13 17:54:44 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_map.c,v 1.415 2024/08/13 17:54:59 riastradh Exp $");
 
 #include "opt_ddb.h"
 #include "opt_pax.h"
@@ -1755,16 +1755,34 @@ static int
 uvm_map_space_avail(vaddr_t *start, vsize_t length, voff_t uoffset,
 vsize_t align, int flags, int topdown, struct vm_map_entry *entry)
 {
+	vaddr_t orig_start = *start;
 	vaddr_t end;
 
+#define	INVARIANTS()			  \
+	KASSERTMSG((topdown		  \
+		? *start <= orig_start	  \
+		: *start >= orig_start),  \
+	"[%s] *start=%"PRIxVADDR" orig_start=%"PRIxVADDR		  \
+	" length=%"PRIxVSIZE" uoffset=%#llx align=%"PRIxVSIZE	  \
+	" flags=%x entry@%p=[%"PRIxVADDR",%"PRIxVADDR")"		  \
+	" ncolors=%d colormask=%x",	  \
+	topdown ? "topdown" : "bottomup", *start, orig_start,	  \
+	length, (unsigned long long)uoffset, align,			  \
+	flags, entry, entry->start, entry->end,			  \
+	uvmexp.ncolors, uvmexp.colormask)
+
+	INVARIANTS();
+
 #ifdef PMAP_PREFER
 	/*
 	 * push start address forward as needed to avoid VAC alias problems.
 	 * we only do this if a valid offset is specified.
 	 */
 
-	if (uoffset != UVM_UNKNOWN_OFFSET)
+	if (uoffset != UVM_UNKNOWN_OFFSET) {
 		PMAP_PREFER(uoffset, start, length, topdown);
+		INVARIANTS();
+	}
 #endif
 	if ((flags & UVM_FLAG_COLORMATCH) != 0) {
 		KASSERT(align < uvmexp.ncolors);
@@ -1784,11 +1802,13 @@ uvm_map_space_avail(vaddr_t *start, vsiz
 		hint += colorsize;
 }
 *start = ptoa(hint + align); /* adjust to color */
+INVARIANTS();
 			}
 		}
 	} else {
 		KASSERT(powerof2(align));
 		uvm_map_align_va(start, align, topdown);
+		INVARIANTS();
 		/*
 		 * XXX Should we PMAP_PREFER() here again?
 		 * eh...i think we're okay
@@ -1809,6 +1829,8 @@ uvm_map_space_avail(vaddr_t *start, vsiz
 		return (1);
 
 	return (0);
+
+#undef INVARIANTS
 }
 
 static void



<    5   6   7   8   9   10   11   12   13   14   >