CVS commit: src/sys/kern

2022-02-28 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Mon Feb 28 08:44:04 UTC 2022

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

Log Message:
vrelel(): no VOP_UNLOCK() with v_interlock or vmobjlock held.


To generate a diff of this commit:
cvs rdiff -u -r1.133 -r1.134 src/sys/kern/vfs_vnode.c

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



CVS commit: src/sys/kern

2022-02-28 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Mon Feb 28 08:44:04 UTC 2022

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

Log Message:
vrelel(): no VOP_UNLOCK() with v_interlock or vmobjlock held.


To generate a diff of this commit:
cvs rdiff -u -r1.133 -r1.134 src/sys/kern/vfs_vnode.c

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

Modified files:

Index: src/sys/kern/vfs_vnode.c
diff -u src/sys/kern/vfs_vnode.c:1.133 src/sys/kern/vfs_vnode.c:1.134
--- src/sys/kern/vfs_vnode.c:1.133	Thu Feb 17 14:39:51 2022
+++ src/sys/kern/vfs_vnode.c	Mon Feb 28 08:44:04 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_vnode.c,v 1.133 2022/02/17 14:39:51 hannken Exp $	*/
+/*	$NetBSD: vfs_vnode.c,v 1.134 2022/02/28 08:44:04 hannken Exp $	*/
 
 /*-
  * Copyright (c) 1997-2011, 2019, 2020 The NetBSD Foundation, Inc.
@@ -148,7 +148,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vfs_vnode.c,v 1.133 2022/02/17 14:39:51 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_vnode.c,v 1.134 2022/02/28 08:44:04 hannken Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_pax.h"
@@ -801,16 +801,16 @@ retry:
 	 */
 	for (use = atomic_load_relaxed(&vp->v_usecount);; use = next) {
 		if (__predict_false((use & VUSECOUNT_MASK) > 1)) {
+			if (objlock_held) {
+objlock_held = false;
+rw_exit(vp->v_uobj.vmobjlock);
+			}
 			if (lktype != LK_NONE) {
 mutex_exit(vp->v_interlock);
 lktype = LK_NONE;
 VOP_UNLOCK(vp);
 mutex_enter(vp->v_interlock);
 			}
-			if (objlock_held) {
-objlock_held = false;
-rw_exit(vp->v_uobj.vmobjlock);
-			}
 			if (vtryrele(vp)) {
 mutex_exit(vp->v_interlock);
 return;
@@ -843,6 +843,10 @@ retry:
 	 * deactivate this node.
 	 */
 	if (VSTATE_GET(vp) == VS_RECLAIMED) {
+		if (objlock_held) {
+			objlock_held = false;
+			rw_exit(vp->v_uobj.vmobjlock);
+		}
 		if (lktype != LK_NONE) {
 			mutex_exit(vp->v_interlock);
 			lktype = LK_NONE;
@@ -884,7 +888,9 @@ retry:
 		 * clean it here.  We donate it our last reference.
 		 */
 		if (lktype != LK_NONE) {
+			mutex_exit(vp->v_interlock);
 			VOP_UNLOCK(vp);
+			mutex_enter(vp->v_interlock);
 		}
 		lru_requeue(vp, &lru_list[LRU_VRELE]);
 		mutex_exit(vp->v_interlock);



CVS commit: src/sys/nfs

2022-02-28 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Mon Feb 28 08:45:36 UTC 2022

Modified Files:
src/sys/nfs: nfs_clntsubs.c

Log Message:
Revert the hack from the last commit now that VOP_UNLOCK()
no longer may hold v_interlock or vmobjlock.


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

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



CVS commit: src/sys/nfs

2022-02-28 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Mon Feb 28 08:45:36 UTC 2022

Modified Files:
src/sys/nfs: nfs_clntsubs.c

Log Message:
Revert the hack from the last commit now that VOP_UNLOCK()
no longer may hold v_interlock or vmobjlock.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/nfs/nfs_clntsubs.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/nfs/nfs_clntsubs.c
diff -u src/sys/nfs/nfs_clntsubs.c:1.5 src/sys/nfs/nfs_clntsubs.c:1.6
--- src/sys/nfs/nfs_clntsubs.c:1.5	Fri Jan 14 19:19:34 2022
+++ src/sys/nfs/nfs_clntsubs.c	Mon Feb 28 08:45:36 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: nfs_clntsubs.c,v 1.5 2022/01/14 19:19:34 christos Exp $	*/
+/*	$NetBSD: nfs_clntsubs.c,v 1.6 2022/02/28 08:45:36 hannken Exp $	*/
 
 /*
  * Copyright (c) 1989, 1993
@@ -70,7 +70,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: nfs_clntsubs.c,v 1.5 2022/01/14 19:19:34 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nfs_clntsubs.c,v 1.6 2022/02/28 08:45:36 hannken Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_nfs.h"
@@ -360,20 +360,9 @@ nfs_delayedtruncate(struct vnode *vp)
 		np->n_flag &= ~NTRUNCDELAYED;
 		genfs_node_wrlock(vp);
 		rw_enter(vp->v_uobj.vmobjlock, RW_WRITER);
-
-		/*
-		 * This is disgusting but we can be called from VOP_UNLOCK
-		 * where the interlock is sometimes held, and we want to
-		 * make sure that it is unlocked when we call VOP_PUTPAGES
-		 * and uvm_vnp_setsize.
-		 */
-		int got = mutex_tryenter(vp->v_interlock);
-		mutex_exit(vp->v_interlock);
 		(void)VOP_PUTPAGES(vp, 0,
 		0, PGO_SYNCIO | PGO_CLEANIT | PGO_FREE | PGO_ALLPAGES);
 		uvm_vnp_setsize(vp, np->n_size);
-		if (!got)
-			mutex_enter(vp->v_interlock);
 		genfs_node_unlock(vp);
 	}
 }



CVS commit: src/usr.bin/seq

2022-02-28 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Mon Feb 28 13:49:50 UTC 2022

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

Log Message:
seq(1): add more examples, improve wording

>From OpenBSD via jmc@OpenBSD


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

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



CVS commit: src/usr.bin/seq

2022-02-28 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Mon Feb 28 13:49:50 UTC 2022

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

Log Message:
seq(1): add more examples, improve wording

>From OpenBSD via jmc@OpenBSD


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

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

Modified files:

Index: src/usr.bin/seq/seq.1
diff -u src/usr.bin/seq/seq.1:1.11 src/usr.bin/seq/seq.1:1.12
--- src/usr.bin/seq/seq.1:1.11	Mon Nov  1 21:28:03 2021
+++ src/usr.bin/seq/seq.1	Mon Feb 28 13:49:50 2022
@@ -1,4 +1,4 @@
-.\"	$NetBSD: seq.1,v 1.11 2021/11/01 21:28:03 andvar Exp $
+.\"	$NetBSD: seq.1,v 1.12 2022/02/28 13:49:50 wiz Exp $
 .\"
 .\" Copyright (c) 2005 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -45,12 +45,11 @@
 .Sh DESCRIPTION
 The
 .Nm
-utility prints a sequence of numbers, one per line
-.Pq default ,
+utility prints a sequence of numbers, one per line by default,
 from
 .Ar first
-.Pq default 1 ,
-to near
+.Pq default 1
+to as near
 .Ar last
 as possible, in increments of
 .Ar incr
@@ -131,22 +130,51 @@ the default conversion is changed to
 .Sh EXIT STATUS
 .Ex -std
 .Sh EXAMPLES
+Generate a sequence from 1 to 3 (inclusive) with a default increment of 1:
 .Bd -literal -offset indent
-# seq 1 3
+$ seq 1 3
 1
 2
 3
-
-# seq 3 1
+.Ed
+.Pp
+Generate a sequence from 3 to 1 (inclusive) with a default increment of -1:
+.Bd -literal -offset indent
+$ seq 3 1
 3
 2
 1
-
-# seq -w 0 .05 .1
+.Ed
+.Pp
+Generate a sequence from 0 to 0.1 (inclusive) with an increment of 0.05
+and padding with leading zeroes:
+.Bd -literal -offset indent
+$ seq -w 0 .05 .1
 0.00
 0.05
 0.10
 .Ed
+.Pp
+Generate a sequence from 1 to 3 (inclusive) with a default increment of 1,
+and a custom separator string:
+.Bd -literal -offset indent
+$ seq -s "," 1 3
+1,2,3
+.Ed
+.Pp
+Generate a sequence from 1 to 2 (inclusive) with an increment of 0.2 and
+print the results with two digits after the decimal point (using a
+.Xr printf 3
+style format):
+.Bd -literal -offset indent
+$ seq -f %.2f 1 0.2 2
+1.00
+1.20
+1.40
+1.60
+1.80
+2.00
+.Ed
 .Sh SEE ALSO
 .Xr jot 1 ,
 .Xr printf 1 ,



CVS commit: src/external/apache2/llvm

2022-02-28 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Mon Feb 28 16:30:10 UTC 2022

Modified Files:
src/external/apache2/llvm: Makefile.inc

Log Message:
When MKDEBUG is use, build LLVM with -g1 to significantly reduce debug
information. This still includes types and line tables, but skips e.g.
local variables and inline tracking.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/external/apache2/llvm/Makefile.inc

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



CVS commit: src/external/apache2/llvm

2022-02-28 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Mon Feb 28 16:30:10 UTC 2022

Modified Files:
src/external/apache2/llvm: Makefile.inc

Log Message:
When MKDEBUG is use, build LLVM with -g1 to significantly reduce debug
information. This still includes types and line tables, but skips e.g.
local variables and inline tracking.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/external/apache2/llvm/Makefile.inc

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

Modified files:

Index: src/external/apache2/llvm/Makefile.inc
diff -u src/external/apache2/llvm/Makefile.inc:1.5 src/external/apache2/llvm/Makefile.inc:1.6
--- src/external/apache2/llvm/Makefile.inc:1.5	Sun May 30 01:56:45 2021
+++ src/external/apache2/llvm/Makefile.inc	Mon Feb 28 16:30:10 2022
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.5 2021/05/30 01:56:45 joerg Exp $
+#	$NetBSD: Makefile.inc,v 1.6 2022/02/28 16:30:10 joerg Exp $
 
 .if !defined(LLVM_TOPLEVEL_MK)
 LLVM_TOPLEVEL_MK=
@@ -50,6 +50,9 @@ LLVM_TARGETS=	x86,powerpc,sparc,aarch64,
 CXXFLAGS+=		${${ACTIVE_CC} == "clang":? ${MODULES_CXXFLAGS} :}
 
 CXXFLAGS+=	-std=c++14
+.if ${MKDEBUG:Uno} != "no"
+CXXFLAGS+=	-g1
+.endif
 CXXFLAGS+=	-fno-rtti -fno-exceptions ${${ACTIVE_CC} == "gcc" :? -fno-strict-aliasing :}
 CXXFLAGS+=	-ffunction-sections -fdata-sections
 LDFLAGS+=	-Wl,--gc-sections



CVS commit: [netbsd-9] src/include

2022-02-28 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Feb 28 16:37:34 UTC 2022

Modified Files:
src/include [netbsd-9]: math.h

Log Message:
Pull up following revision(s) (requested by gdt in ticket #1430):

include/math.h: revision 1.66

Correct C99 / C++11 feature testing. Document remaining missing symbols.


To generate a diff of this commit:
cvs rdiff -u -r1.65 -r1.65.4.1 src/include/math.h

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



CVS commit: [netbsd-9] src/include

2022-02-28 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Feb 28 16:37:34 UTC 2022

Modified Files:
src/include [netbsd-9]: math.h

Log Message:
Pull up following revision(s) (requested by gdt in ticket #1430):

include/math.h: revision 1.66

Correct C99 / C++11 feature testing. Document remaining missing symbols.


To generate a diff of this commit:
cvs rdiff -u -r1.65 -r1.65.4.1 src/include/math.h

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

Modified files:

Index: src/include/math.h
diff -u src/include/math.h:1.65 src/include/math.h:1.65.4.1
--- src/include/math.h:1.65	Sun Jun 24 23:55:29 2018
+++ src/include/math.h	Mon Feb 28 16:37:34 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: math.h,v 1.65 2018/06/24 23:55:29 christos Exp $	*/
+/*	$NetBSD: math.h,v 1.65.4.1 2022/02/28 16:37:34 martin Exp $	*/
 
 /*
  * 
@@ -21,6 +21,16 @@
 #include 
 #include 
 
+/*
+ * Missing for C99 support:
+ * - MATH_ERRNO
+ * - MATH_ERREXCEPT
+ * - FP_FAST_FMA
+ * - FP_FAST_FMAF
+ * - FP_FAST_FMAL
+ * - math_errhandling
+ */
+
 union __float_u {
 	unsigned char __dummy[sizeof(float)];
 	float __val;
@@ -40,7 +50,14 @@ union __long_double_u {
 	   or __long_double_u */
 #include 			/* for INT_{MIN,MAX} */
 
-#if ((_POSIX_C_SOURCE - 0) >= 200809L || defined(_NETBSD_SOURCE))
+#if (!defined(_ANSI_SOURCE) && !defined(_POSIX_C_SOURCE) && \
+!defined(_XOPEN_SOURCE)) || ((_POSIX_C_SOURCE - 0) >= 200809L || \
+ defined(_ISOC99_SOURCE) || (__STDC_VERSION__ - 0) >= 199901L || \
+ (__cplusplus - 0) >= 201103L || defined(_NETBSD_SOURCE))
+#define __MATH_C99_FEATURES
+#endif
+
+#ifdef __MATH_C99_FEATURES
 #  if defined(__FLT_EVAL_METHOD__) && (__FLT_EVAL_METHOD__ - 0) == 0
 typedef double double_t;
 typedef float float_t;
@@ -83,12 +100,8 @@ extern const union __double_u __infinity
 /*
  * ISO C99
  */
-#if !defined(_ANSI_SOURCE) && !defined(_POSIX_C_SOURCE) && \
-!defined(_XOPEN_SOURCE) || \
-((__STDC_VERSION__ - 0) >= 199901L) || \
-((_POSIX_C_SOURCE - 0) >= 200112L) || \
-((_XOPEN_SOURCE  - 0) >= 600) || \
-defined(_ISOC99_SOURCE) || defined(_NETBSD_SOURCE)
+#if defined(__MATH_C99_FEATURES) || \
+(_POSIX_C_SOURCE - 0) >= 200112L || (_XOPEN_SOURCE  - 0) >= 600
 /* 7.12#3 HUGE_VAL, HUGELF, HUGE_VALL */
 #if __GNUC_PREREQ__(3, 3)
 #define	HUGE_VALF	__builtin_huge_valf()
@@ -133,7 +146,7 @@ extern const union __float_u __nanf;
 #define	FP_ILOGB0	INT_MIN
 #define	FP_ILOGBNAN	INT_MAX
 
-#endif /* !_ANSI_SOURCE && ... */
+#endif /* C99 || _XOPEN_SOURCE >= 600 */
 
 /*
  * XOPEN/SVID
@@ -238,16 +251,18 @@ double	fabs(double);
 double	floor(double);
 double	fmod(double, double);
 
-#if defined(_XOPEN_SOURCE) || defined(_NETBSD_SOURCE)
+#if defined(__MATH_C99_FEATURES) || defined(_XOPEN_SOURCE)
 double	erf(double);
 double	erfc(double);
-double	gamma(double);
 double	hypot(double, double);
+#endif
+
+#if defined(_XOPEN_SOURCE) || defined(_NETBSD_SOURCE)
 int	finite(double);
+double	gamma(double);
 double	j0(double);
 double	j1(double);
 double	jn(int, double);
-double	lgamma(double);
 double	y0(double);
 double	y1(double);
 double	yn(int, double);
@@ -260,12 +275,7 @@ double	scalb(double, double);
 /*
  * ISO C99
  */
-#if !defined(_ANSI_SOURCE) && !defined(_POSIX_C_SOURCE) && \
-!defined(_XOPEN_SOURCE) || \
-((__STDC_VERSION__ - 0) >= 199901L) || \
-((_POSIX_C_SOURCE - 0) >= 200809L) || \
-((_XOPEN_SOURCE  - 0) >= 500) || \
-defined(_ISOC99_SOURCE) || defined(_NETBSD_SOURCE)
+#if defined(__MATH_C99_FEATURES) || (_XOPEN_SOURCE - 0) >= 500
 double	acosh(double);
 double	asinh(double);
 double	atanh(double);
@@ -279,12 +289,8 @@ double	remainder(double, double);
 double	rint(double);
 #endif
 
-#if !defined(_ANSI_SOURCE) && !defined(_POSIX_C_SOURCE) && \
-!defined(_XOPEN_SOURCE) || \
-((__STDC_VERSION__ - 0) >= 199901L) || \
-((_POSIX_C_SOURCE - 0) >= 200112L) || \
-((_XOPEN_SOURCE  - 0) >= 600) || \
-defined(_ISOC99_SOURCE) || defined(_NETBSD_SOURCE)
+#if defined(__MATH_C99_FEATURES) || (_XOPEN_SOURCE - 0) >= 600 || \
+(_POSIX_C_SOURCE - 0) >= 200112L
 /* 7.12.3.1 int fpclassify(real-floating x) */
 #define	fpclassify(__x)	__fpmacro_unary_floating(fpclassify, __x)
 
@@ -331,6 +337,8 @@ long double	sinhl(long double);
 long double	tanhl(long double);
 
 /* 7.12.6 exp / log */
+double	scalbn(double, int);
+double	scalbln(double, long);
 
 float	expf(float);
 float	exp2f(float);
@@ -378,6 +386,7 @@ long double	sqrtl(long double);
 
 /* 7.12.8 error / gamma */
 
+double	lgamma(double);
 double	tgamma(double);
 float	erff(float);
 float	erfcf(float);
@@ -436,6 +445,7 @@ long double	remquol(long double, long do
 
 /* 7.12.11 manipulation */
 
+double	copysign(double, double);
 double	nan(const char *);
 double	nearbyint(double);
 double	nexttoward(double, long double);
@@ -474,11 +484,7 @@ long double fminl(long double, long doub
 
 #endif /* !

CVS commit: [netbsd-9] src/doc

2022-02-28 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Feb 28 16:39:22 UTC 2022

Modified Files:
src/doc [netbsd-9]: CHANGES-9.3

Log Message:
Ticket #1430


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.78 -r1.1.2.79 src/doc/CHANGES-9.3

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

Modified files:

Index: src/doc/CHANGES-9.3
diff -u src/doc/CHANGES-9.3:1.1.2.78 src/doc/CHANGES-9.3:1.1.2.79
--- src/doc/CHANGES-9.3:1.1.2.78	Mon Feb 21 17:59:04 2022
+++ src/doc/CHANGES-9.3	Mon Feb 28 16:39:22 2022
@@ -1,4 +1,4 @@
-29~# $NetBSD: CHANGES-9.3,v 1.1.2.78 2022/02/21 17:59:04 martin Exp $
+29~# $NetBSD: CHANGES-9.3,v 1.1.2.79 2022/02/28 16:39:22 martin Exp $
 
 A complete list of changes from the NetBSD 9.2 release to the NetBSD 9.3
 release:
@@ -1497,4 +1497,8 @@ bin/sh/histedit.c1.60
 	sh(1): fix "fc -e".
 	[kre, ticket #1429]
 
+include/math.h	1.66
+
+	Correct C99 / C++11 feature testing.
+	[gdt, ticket #1430]
 



CVS commit: [netbsd-9] src/doc

2022-02-28 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Feb 28 16:39:22 UTC 2022

Modified Files:
src/doc [netbsd-9]: CHANGES-9.3

Log Message:
Ticket #1430


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.78 -r1.1.2.79 src/doc/CHANGES-9.3

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



CVS commit: src/sys/external/bsd/drm2

2022-02-28 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon Feb 28 17:15:30 UTC 2022

Modified Files:
src/sys/external/bsd/drm2/dist/drm/radeon: radeon_bios.c
src/sys/external/bsd/drm2/linux: linux_acpi.c

Log Message:
drm: Fix ACPI crud in ALL kernel build.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 \
src/sys/external/bsd/drm2/dist/drm/radeon/radeon_bios.c
cvs rdiff -u -r1.1 -r1.2 src/sys/external/bsd/drm2/linux/linux_acpi.c

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



CVS commit: src/sys/external/bsd/drm2

2022-02-28 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon Feb 28 17:15:30 UTC 2022

Modified Files:
src/sys/external/bsd/drm2/dist/drm/radeon: radeon_bios.c
src/sys/external/bsd/drm2/linux: linux_acpi.c

Log Message:
drm: Fix ACPI crud in ALL kernel build.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 \
src/sys/external/bsd/drm2/dist/drm/radeon/radeon_bios.c
cvs rdiff -u -r1.1 -r1.2 src/sys/external/bsd/drm2/linux/linux_acpi.c

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

Modified files:

Index: src/sys/external/bsd/drm2/dist/drm/radeon/radeon_bios.c
diff -u src/sys/external/bsd/drm2/dist/drm/radeon/radeon_bios.c:1.10 src/sys/external/bsd/drm2/dist/drm/radeon/radeon_bios.c:1.11
--- src/sys/external/bsd/drm2/dist/drm/radeon/radeon_bios.c:1.10	Sun Feb 27 14:24:27 2022
+++ src/sys/external/bsd/drm2/dist/drm/radeon/radeon_bios.c	Mon Feb 28 17:15:29 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: radeon_bios.c,v 1.10 2022/02/27 14:24:27 riastradh Exp $	*/
+/*	$NetBSD: radeon_bios.c,v 1.11 2022/02/28 17:15:29 riastradh Exp $	*/
 
 /*
  * Copyright 2008 Advanced Micro Devices, Inc.
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: radeon_bios.c,v 1.10 2022/02/27 14:24:27 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: radeon_bios.c,v 1.11 2022/02/28 17:15:29 riastradh Exp $");
 
 #include 
 #include 
@@ -41,7 +41,12 @@ __KERNEL_RCSID(0, "$NetBSD: radeon_bios.
 #include "radeon.h"
 #include "radeon_reg.h"
 
+#ifdef __NetBSD__
+#include 
+#define	_COMPONENT	ACPI_DISPLAY_COMPONENT
+ACPI_MODULE_NAME("radeon_acpi")
 #include 
+#endif
 
 /*
  * BIOS.

Index: src/sys/external/bsd/drm2/linux/linux_acpi.c
diff -u src/sys/external/bsd/drm2/linux/linux_acpi.c:1.1 src/sys/external/bsd/drm2/linux/linux_acpi.c:1.2
--- src/sys/external/bsd/drm2/linux/linux_acpi.c:1.1	Sun Feb 27 14:22:21 2022
+++ src/sys/external/bsd/drm2/linux/linux_acpi.c	Mon Feb 28 17:15:30 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux_acpi.c,v 1.1 2022/02/27 14:22:21 riastradh Exp $	*/
+/*	$NetBSD: linux_acpi.c,v 1.2 2022/02/28 17:15:30 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2022 The NetBSD Foundation, Inc.
@@ -27,10 +27,15 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: linux_acpi.c,v 1.1 2022/02/27 14:22:21 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_acpi.c,v 1.2 2022/02/28 17:15:30 riastradh Exp $");
+
+#include 
 
 #include 
 
+#define	_COMPONENT	ACPI_BUS_COMPONENT
+ACPI_MODULE_NAME("linux_acpi")
+
 union acpi_object *
 acpi_evaluate_dsm(acpi_handle handle, const guid_t *uuid, u64 rev, u64 func,
 union acpi_object *argv4)



re: CVS commit: src/usr.bin/vmstat

2022-02-28 Thread matthew green
"Roland Illig" writes:
> Module Name:  src
> Committed By: rillig
> Date: Sun Feb 27 19:00:46 UTC 2022
>
> Modified Files:
>   src/usr.bin/vmstat: vmstat.c
>
> Log Message:
> vmstat: unexport file-scope variable numdisks
>
> There is no need to make this variable externally visible.  There are
> several more variables in this file that could be unexported, leave
> these for someone who knows whether vmstat.c is used by other parts of
> the tree as well.
>
> No functional change, OK mrg.

thanks!


CVS commit: src/usr.bin/xlint/lint1

2022-02-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Feb 28 22:41:07 UTC 2022

Modified Files:
src/usr.bin/xlint/lint1: lex.c

Log Message:
lint: constify lexer keywords

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.105 -r1.106 src/usr.bin/xlint/lint1/lex.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/xlint/lint1/lex.c
diff -u src/usr.bin/xlint/lint1/lex.c:1.105 src/usr.bin/xlint/lint1/lex.c:1.106
--- src/usr.bin/xlint/lint1/lex.c:1.105	Sun Feb 27 22:46:04 2022
+++ src/usr.bin/xlint/lint1/lex.c	Mon Feb 28 22:41:07 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: lex.c,v 1.105 2022/02/27 22:46:04 rillig Exp $ */
+/* $NetBSD: lex.c,v 1.106 2022/02/28 22:41:07 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -38,7 +38,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: lex.c,v 1.105 2022/02/27 22:46:04 rillig Exp $");
+__RCSID("$NetBSD: lex.c,v 1.106 2022/02/28 22:41:07 rillig Exp $");
 #endif
 
 #include 
@@ -87,7 +87,7 @@ bool in_system_header;
 	kwdef(name, token, 0, 0, 0,		0, 0, 1, 1, 5)
 
 /* During initialization, these keywords are written to the symbol table. */
-static struct keyword {
+static const struct keyword {
 	const	char *kw_name;	/* keyword */
 	int	kw_token;	/* token returned by yylex() */
 	scl_t	kw_scl;		/* storage class if kw_token T_SCLASS */
@@ -344,7 +344,7 @@ add_keyword(const struct keyword *kw, bo
 void
 initscan(void)
 {
-	struct keyword *kw;
+	const struct keyword *kw;
 
 	for (kw = keywords; kw->kw_name != NULL; kw++) {
 		if ((kw->kw_c90 || kw->kw_c99) && tflag)



CVS commit: src/usr.bin/xlint/lint1

2022-02-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Feb 28 22:41:07 UTC 2022

Modified Files:
src/usr.bin/xlint/lint1: lex.c

Log Message:
lint: constify lexer keywords

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.105 -r1.106 src/usr.bin/xlint/lint1/lex.c

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



re: CVS commit: src/external/apache2/llvm

2022-02-28 Thread matthew green
"Joerg Sonnenberger" writes:
> Module Name:  src
> Committed By: joerg
> Date: Mon Feb 28 16:30:10 UTC 2022
>
> Modified Files:
>   src/external/apache2/llvm: Makefile.inc
>
> Log Message:
> When MKDEBUG is use, build LLVM with -g1 to significantly reduce debug
> information. This still includes types and line tables, but skips e.g.
> local variables and inline tracking.

tempted to do this for GCC as well.  i'll see what happens to the
size of eg gallium.so.0.debug (currently larger than the full
base install itself.)  it's kind of insane:

-r--r--r--  1 root  wheel  1828732744 Nov 14 00:15 
/usr/libdata/debug/usr/X11R7/lib/modules/dri/gallium_dri.so.0.debug

yesterday-when-i-was-mad /usr/src> readelf --debug-dump 
/usr/libdata/debug/usr/X11R7/lib/modules/dri/gallium_dri.so.0.debug >& /dev/null
320.988u 1.149s 5:22.15 99.9%   0+0k 1+0io 0pf+0w

... and that's a zen3 cpu.


.mrg.


CVS commit: src/usr.bin/xlint/lint1

2022-02-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Tue Mar  1 00:17:12 UTC 2022

Modified Files:
src/usr.bin/xlint/lint1: cgram.y debug.c decl.c externs1.h lex.c

Log Message:
lint: add debug logging for symbols and the symbol table

This logging is not active by default, the functions debug_sym and
debug_symtab can be called as needed during a debug session.


To generate a diff of this commit:
cvs rdiff -u -r1.386 -r1.387 src/usr.bin/xlint/lint1/cgram.y
cvs rdiff -u -r1.8 -r1.9 src/usr.bin/xlint/lint1/debug.c
cvs rdiff -u -r1.251 -r1.252 src/usr.bin/xlint/lint1/decl.c
cvs rdiff -u -r1.148 -r1.149 src/usr.bin/xlint/lint1/externs1.h
cvs rdiff -u -r1.106 -r1.107 src/usr.bin/xlint/lint1/lex.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/xlint/lint1

2022-02-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Tue Mar  1 00:17:12 UTC 2022

Modified Files:
src/usr.bin/xlint/lint1: cgram.y debug.c decl.c externs1.h lex.c

Log Message:
lint: add debug logging for symbols and the symbol table

This logging is not active by default, the functions debug_sym and
debug_symtab can be called as needed during a debug session.


To generate a diff of this commit:
cvs rdiff -u -r1.386 -r1.387 src/usr.bin/xlint/lint1/cgram.y
cvs rdiff -u -r1.8 -r1.9 src/usr.bin/xlint/lint1/debug.c
cvs rdiff -u -r1.251 -r1.252 src/usr.bin/xlint/lint1/decl.c
cvs rdiff -u -r1.148 -r1.149 src/usr.bin/xlint/lint1/externs1.h
cvs rdiff -u -r1.106 -r1.107 src/usr.bin/xlint/lint1/lex.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/xlint/lint1/cgram.y
diff -u src/usr.bin/xlint/lint1/cgram.y:1.386 src/usr.bin/xlint/lint1/cgram.y:1.387
--- src/usr.bin/xlint/lint1/cgram.y:1.386	Sun Feb 27 19:32:51 2022
+++ src/usr.bin/xlint/lint1/cgram.y	Tue Mar  1 00:17:12 2022
@@ -1,5 +1,5 @@
 %{
-/* $NetBSD: cgram.y,v 1.386 2022/02/27 19:32:51 rillig Exp $ */
+/* $NetBSD: cgram.y,v 1.387 2022/03/01 00:17:12 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -35,7 +35,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: cgram.y,v 1.386 2022/02/27 19:32:51 rillig Exp $");
+__RCSID("$NetBSD: cgram.y,v 1.387 2022/03/01 00:17:12 rillig Exp $");
 #endif
 
 #include 
@@ -2162,9 +2162,6 @@ yyerror(const char *msg)
 static const char *
 cgram_to_string(int token, YYSTYPE val)
 {
-	static const char *tqual_name[] = {
-		"const", "volatile", "restrict", "_Thread_local"
-	};
 
 	switch (token) {
 	case T_INCDEC:
@@ -2181,7 +2178,7 @@ cgram_to_string(int token, YYSTYPE val)
 	case T_STRUCT_OR_UNION:
 		return tspec_name(val.y_tspec);
 	case T_QUAL:
-		return tqual_name[val.y_tqual];
+		return tqual_name(val.y_tqual);
 	case T_NAME:
 		return val.y_name->sb_name;
 	default:

Index: src/usr.bin/xlint/lint1/debug.c
diff -u src/usr.bin/xlint/lint1/debug.c:1.8 src/usr.bin/xlint/lint1/debug.c:1.9
--- src/usr.bin/xlint/lint1/debug.c:1.8	Sun Feb 27 18:29:14 2022
+++ src/usr.bin/xlint/lint1/debug.c	Tue Mar  1 00:17:12 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: debug.c,v 1.8 2022/02/27 18:29:14 rillig Exp $ */
+/* $NetBSD: debug.c,v 1.9 2022/03/01 00:17:12 rillig Exp $ */
 
 /*-
  * Copyright (c) 2021 The NetBSD Foundation, Inc.
@@ -35,12 +35,13 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: debug.c,v 1.8 2022/02/27 18:29:14 rillig Exp $");
+__RCSID("$NetBSD: debug.c,v 1.9 2022/03/01 00:17:12 rillig Exp $");
 #endif
 
 #include 
 
 #include "lint1.h"
+#include "cgram.h"
 
 
 #ifdef DEBUG
@@ -129,9 +130,11 @@ debug_node(const tnode_t *tn)
 	else if (op == CON && is_floating(tn->tn_type->t_tspec))
 		debug_printf(", value %Lg", tn->tn_val->v_ldbl);
 	else if (op == CON && is_uinteger(tn->tn_type->t_tspec))
-		debug_printf(", value %llu\n", (unsigned long long)tn->tn_val->v_quad);
+		debug_printf(", value %llu\n",
+		(unsigned long long)tn->tn_val->v_quad);
 	else if (op == CON && is_integer(tn->tn_type->t_tspec))
-		debug_printf(", value %lld\n", (long long)tn->tn_val->v_quad);
+		debug_printf(", value %lld\n",
+		(long long)tn->tn_val->v_quad);
 	else if (op == CON && tn->tn_type->t_tspec == BOOL)
 		debug_printf(", value %s\n",
 		tn->tn_val->v_quad != 0 ? "true" : "false");
@@ -160,4 +163,138 @@ debug_node(const tnode_t *tn)
 	}
 }
 
+static const char *
+def_name(def_t def)
+{
+	static const char *const name[] = {
+		"not-declared",
+		"declared",
+		"tentative-defined",
+		"defined",
+	};
+
+	return name[def];
+}
+
+const char *
+scl_name(scl_t scl)
+{
+	static const char *const name[] = {
+		"none",
+		"extern",
+		"static",
+		"auto",
+		"register",
+		"typedef",
+		"struct",
+		"union",
+		"enum",
+		"member-of-struct",
+		"member-of-union",
+		"compile-time-constant",
+		"abstract",
+		"old-style-function-argument",
+		"prototype-argument",
+		"inline",
+	};
+
+	return name[scl];
+}
+
+const char *
+symt_name(symt_t kind)
+{
+	static const char *const name[] = {
+		"var-func-type",
+		"member",
+		"tag",
+		"label",
+	};
+
+	return name[kind];
+}
+
+const char *
+tqual_name(tqual_t qual)
+{
+	static const char *const name[] = {
+		"const",
+		"volatile",
+		"restrict",
+		"_Thread_local",
+	};
+
+	return name[qual];
+}
+
+static void
+debug_word(bool flag, const char *name)
+{
+
+	if (flag)
+		debug_printf(" %s", name);
+}
+
+void
+debug_sym(const sym_t *sym)
+{
+
+	debug_print_indent();
+	debug_printf("%s", sym->s_name);
+	if (sym->s_type != NULL)
+		debug_printf(" type='%s'", type_name(sym->s_type));
+	if (sym->s_rename != NULL)
+		debug_printf(" rename=%s", sym->s_rename);
+	debug_printf(" %s", symt_name(sym->s_kind));
+	debug_word(sym->s_keyword != NULL, "keyword");
+	debug_word(sym->s_bitfield, "bit-field");
+	debu

Re: CVS commit: src/external/apache2/llvm

2022-02-28 Thread Joerg Sonnenberger
Am Tue, Mar 01, 2022 at 10:17:18AM +1100 schrieb matthew green:
> "Joerg Sonnenberger" writes:
> > Module Name:src
> > Committed By:   joerg
> > Date:   Mon Feb 28 16:30:10 UTC 2022
> >
> > Modified Files:
> > src/external/apache2/llvm: Makefile.inc
> >
> > Log Message:
> > When MKDEBUG is use, build LLVM with -g1 to significantly reduce debug
> > information. This still includes types and line tables, but skips e.g.
> > local variables and inline tracking.
> 
> tempted to do this for GCC as well.  i'll see what happens to the
> size of eg gallium.so.0.debug (currently larger than the full
> base install itself.)  it's kind of insane:
> 
> -r--r--r--  1 root  wheel  1828732744 Nov 14 00:15 
> /usr/libdata/debug/usr/X11R7/lib/modules/dri/gallium_dri.so.0.debug
> 
> yesterday-when-i-was-mad /usr/src> readelf --debug-dump 
> /usr/libdata/debug/usr/X11R7/lib/modules/dri/gallium_dri.so.0.debug >& 
> /dev/null
> 320.988u 1.149s 5:22.15 99.9%   0+0k 1+0io 0pf+0w
> 
> ... and that's a zen3 cpu.

This is applied to both GCC and Clang as base compiler.

Joerg


CVS commit: src/tests/lib/libcurses

2022-02-28 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Tue Mar  1 06:41:27 UTC 2022

Modified Files:
src/tests/lib/libcurses: debug_test

Log Message:
Add the -F flag to the getopt string, it was there in the help and
in the arguments handling but getopt was not told about it.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/tests/lib/libcurses/debug_test

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



CVS commit: src/tests/lib/libcurses

2022-02-28 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Tue Mar  1 06:41:27 UTC 2022

Modified Files:
src/tests/lib/libcurses: debug_test

Log Message:
Add the -F flag to the getopt string, it was there in the help and
in the arguments handling but getopt was not told about it.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/tests/lib/libcurses/debug_test

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/libcurses/debug_test
diff -u src/tests/lib/libcurses/debug_test:1.6 src/tests/lib/libcurses/debug_test:1.7
--- src/tests/lib/libcurses/debug_test:1.6	Tue Jan 25 03:23:05 2022
+++ src/tests/lib/libcurses/debug_test	Tue Mar  1 06:41:27 2022
@@ -41,7 +41,7 @@ usage() {
 #ARGS="-T ${BASEDIR} -I ${INCLUDE_PATH} -C ${CHECK_PATH}"
 ARGS="-T ${BASEDIR} -C ${CHECK_PATH}"
 #
-while getopts cf:L:s:vg opt
+while getopts cf:F:L:s:vg opt
 do
 case "${opt}" in
 	c)