CVS commit: src

2024-05-10 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat May 11 02:07:54 UTC 2024

Modified Files:
src/lib/libm/src: s_nexttoward.c
src/tests/lib/libm: t_next.c

Log Message:
nexttoward(3): Fix high-word test on small positive subnormals.

By this point in the logic, x can't be zero, so it's either positive
or negative.

The high word hx, however, can be zero, when x is a small positive
subnormal.  This means x is a small positive subnormal, so if x > y
we are computing nextDown, and if x < y we are computing nextUp.

hx is a (signed 32-bit) integer, not a double floating-point number,
so it's a little silly to compare hx > 0.0.  But that on its own
isn't enough to trigger the bug because all signed 32-bit integers
can be represented by double on all NetBSD architectures.

PR lib/58236


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/lib/libm/src/s_nexttoward.c
cvs rdiff -u -r1.5 -r1.6 src/tests/lib/libm/t_next.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/libm/src/s_nexttoward.c
diff -u src/lib/libm/src/s_nexttoward.c:1.2 src/lib/libm/src/s_nexttoward.c:1.3
--- src/lib/libm/src/s_nexttoward.c:1.2	Wed Aug 21 13:03:56 2013
+++ src/lib/libm/src/s_nexttoward.c	Sat May 11 02:07:53 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: s_nexttoward.c,v 1.2 2013/08/21 13:03:56 martin Exp $	*/
+/*	$NetBSD: s_nexttoward.c,v 1.3 2024/05/11 02:07:53 riastradh Exp $	*/
 
 /* @(#)s_nextafter.c 5.1 93/09/24 */
 /*
@@ -13,7 +13,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: s_nexttoward.c,v 1.2 2013/08/21 13:03:56 martin Exp $");
+__RCSID("$NetBSD: s_nexttoward.c,v 1.3 2024/05/11 02:07:53 riastradh Exp $");
 
 /*
  * We assume that a long double has a 15-bit exponent.  On systems
@@ -71,7 +71,7 @@ nexttoward(double x, long double y)
 			return x;		/* raise underflow flag */
 	}
 
-	if ((hx > 0.0) ^ (x < y)) {		/* x -= ulp */
+	if ((hx >= 0) ^ (x < y)) {		/* x -= ulp */
 		if (lx == 0) hx -= 1;
 		lx -= 1;
 	} else {/* x += ulp */

Index: src/tests/lib/libm/t_next.c
diff -u src/tests/lib/libm/t_next.c:1.5 src/tests/lib/libm/t_next.c:1.6
--- src/tests/lib/libm/t_next.c:1.5	Sat May 11 01:44:12 2024
+++ src/tests/lib/libm/t_next.c	Sat May 11 02:07:54 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_next.c,v 1.5 2024/05/11 01:44:12 riastradh Exp $	*/
+/*	$NetBSD: t_next.c,v 1.6 2024/05/11 02:07:54 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2024 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: t_next.c,v 1.5 2024/05/11 01:44:12 riastradh Exp $");
+__RCSID("$NetBSD: t_next.c,v 1.6 2024/05/11 02:07:54 riastradh Exp $");
 
 #include 
 #include 
@@ -391,9 +391,6 @@ ATF_TC_BODY(next_near_0, tc)
 #endif
 	};
 
-#ifdef __HAVE_LONG_DOUBLE
-	atf_tc_expect_fail("PR 58236: nexttoward(3) is broken on subnormals");
-#endif
 	check(x, __arraycount(x));
 }
 



CVS commit: src

2024-05-10 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat May 11 02:07:54 UTC 2024

Modified Files:
src/lib/libm/src: s_nexttoward.c
src/tests/lib/libm: t_next.c

Log Message:
nexttoward(3): Fix high-word test on small positive subnormals.

By this point in the logic, x can't be zero, so it's either positive
or negative.

The high word hx, however, can be zero, when x is a small positive
subnormal.  This means x is a small positive subnormal, so if x > y
we are computing nextDown, and if x < y we are computing nextUp.

hx is a (signed 32-bit) integer, not a double floating-point number,
so it's a little silly to compare hx > 0.0.  But that on its own
isn't enough to trigger the bug because all signed 32-bit integers
can be represented by double on all NetBSD architectures.

PR lib/58236


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/lib/libm/src/s_nexttoward.c
cvs rdiff -u -r1.5 -r1.6 src/tests/lib/libm/t_next.c

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



CVS commit: src/tests/lib/libm

2024-05-10 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat May 11 01:44:12 UTC 2024

Modified Files:
src/tests/lib/libm: t_next.c

Log Message:
tests/lib/libm/t_next: nexttoward works if it's just nextafter.

It's broken on platforms where long double and double aren't the same
and nexttoward isn't an alias for nextafter.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/tests/lib/libm/t_next.c

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

Modified files:

Index: src/tests/lib/libm/t_next.c
diff -u src/tests/lib/libm/t_next.c:1.4 src/tests/lib/libm/t_next.c:1.5
--- src/tests/lib/libm/t_next.c:1.4	Wed May  8 17:27:03 2024
+++ src/tests/lib/libm/t_next.c	Sat May 11 01:44:12 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_next.c,v 1.4 2024/05/08 17:27:03 riastradh Exp $	*/
+/*	$NetBSD: t_next.c,v 1.5 2024/05/11 01:44:12 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2024 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: t_next.c,v 1.4 2024/05/08 17:27:03 riastradh Exp $");
+__RCSID("$NetBSD: t_next.c,v 1.5 2024/05/11 01:44:12 riastradh Exp $");
 
 #include 
 #include 
@@ -391,7 +391,9 @@ ATF_TC_BODY(next_near_0, tc)
 #endif
 	};
 
+#ifdef __HAVE_LONG_DOUBLE
 	atf_tc_expect_fail("PR 58236: nexttoward(3) is broken on subnormals");
+#endif
 	check(x, __arraycount(x));
 }
 



CVS commit: src/tests/lib/libm

2024-05-10 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat May 11 01:44:12 UTC 2024

Modified Files:
src/tests/lib/libm: t_next.c

Log Message:
tests/lib/libm/t_next: nexttoward works if it's just nextafter.

It's broken on platforms where long double and double aren't the same
and nexttoward isn't an alias for nextafter.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/tests/lib/libm/t_next.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

2024-05-10 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri May 10 21:43:40 UTC 2024

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

Log Message:
lint: clean up conversion from floating point constant


To generate a diff of this commit:
cvs rdiff -u -r1.640 -r1.641 src/usr.bin/xlint/lint1/tree.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/tree.c
diff -u src/usr.bin/xlint/lint1/tree.c:1.640 src/usr.bin/xlint/lint1/tree.c:1.641
--- src/usr.bin/xlint/lint1/tree.c:1.640	Fri May  3 04:04:18 2024
+++ src/usr.bin/xlint/lint1/tree.c	Fri May 10 21:43:40 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: tree.c,v 1.640 2024/05/03 04:04:18 rillig Exp $	*/
+/*	$NetBSD: tree.c,v 1.641 2024/05/10 21:43:40 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID)
-__RCSID("$NetBSD: tree.c,v 1.640 2024/05/03 04:04:18 rillig Exp $");
+__RCSID("$NetBSD: tree.c,v 1.641 2024/05/10 21:43:40 rillig Exp $");
 #endif
 
 #include 
@@ -3680,8 +3680,8 @@ convert(op_t op, int arg, type_t *tp, tn
 }
 
 static void
-convert_constant_floating(op_t op, int arg, tspec_t ot, const type_t *tp,
-			  tspec_t nt, val_t *v, val_t *nv)
+convert_constant_from_floating(op_t op, int arg, const type_t *ntp,
+			   tspec_t nt, val_t *nv, val_t *ov)
 {
 	long double max = 0.0, min = 0.0;
 
@@ -3715,36 +3715,34 @@ convert_constant_floating(op_t op, int a
 	case DOUBLE:
 	case DCOMPLEX:
 		max = DBL_MAX;		min = -DBL_MAX;		break;
-	case PTR:
-		/* Already got an error because of float --> ptr */
 	case LDOUBLE:
 	case LCOMPLEX:
-		/* LINTED 248 */
+		/* LINTED 248; see floating_error_value. */
 		max = LDBL_MAX;		min = -max;		break;
 	default:
 		lint_assert(/*CONSTCOND*/false);
 	}
-	if (v->u.floating > max || v->u.floating < min) {
+	if (ov->u.floating > max || ov->u.floating < min) {
 		lint_assert(nt != LDOUBLE);
-		if (op == FARG) {
+		const char *ot_name = type_name(gettyp(ov->v_tspec));
+		const char *nt_name = type_name(ntp);
+		if (op == FARG)
 			/* conversion of '%s' to '%s' is out of range, ... */
-			warning(295,
-			type_name(gettyp(ot)), type_name(tp), arg);
-		} else {
+			warning(295, ot_name, nt_name, arg);
+		else
 			/* conversion of '%s' to '%s' is out of range */
-			warning(119, type_name(gettyp(ot)), type_name(tp));
-		}
-		v->u.floating = v->u.floating > 0 ? max : min;
+			warning(119, ot_name, nt_name);
+		ov->u.floating = ov->u.floating > 0 ? max : min;
 	}
 
 	if (nt == FLOAT || nt == FCOMPLEX)
-		nv->u.floating = (float)v->u.floating;
+		nv->u.floating = (float)ov->u.floating;
 	else if (nt == DOUBLE || nt == DCOMPLEX)
-		nv->u.floating = (double)v->u.floating;
+		nv->u.floating = (double)ov->u.floating;
 	else if (nt == LDOUBLE || nt == LCOMPLEX)
-		nv->u.floating = v->u.floating;
+		nv->u.floating = ov->u.floating;
 	else
-		nv->u.integer = (int64_t)v->u.floating;
+		nv->u.integer = (int64_t)ov->u.floating;
 }
 
 static bool
@@ -3925,7 +3923,7 @@ convert_constant(op_t op, int arg, const
 	}
 
 	if (ot == FLOAT || ot == DOUBLE || ot == LDOUBLE)
-		convert_constant_floating(op, arg, ot, ntp, nt, ov, nv);
+		convert_constant_from_floating(op, arg, ntp, nt, nv, ov);
 	else if (!convert_constant_to_floating(nt, nv, ot, ov)) {
 		range_check = true;	/* Check for lost precision. */
 		nv->u.integer = ov->u.integer;



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

2024-05-10 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri May 10 21:43:40 UTC 2024

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

Log Message:
lint: clean up conversion from floating point constant


To generate a diff of this commit:
cvs rdiff -u -r1.640 -r1.641 src/usr.bin/xlint/lint1/tree.c

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



CVS commit: src/sbin/newfs

2024-05-10 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Fri May 10 20:36:34 UTC 2024

Modified Files:
src/sbin/newfs: mkfs.c

Log Message:
s/superbock/superblock/ in comment.


To generate a diff of this commit:
cvs rdiff -u -r1.136 -r1.137 src/sbin/newfs/mkfs.c

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



CVS commit: src/sbin/newfs

2024-05-10 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Fri May 10 20:36:34 UTC 2024

Modified Files:
src/sbin/newfs: mkfs.c

Log Message:
s/superbock/superblock/ in comment.


To generate a diff of this commit:
cvs rdiff -u -r1.136 -r1.137 src/sbin/newfs/mkfs.c

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

Modified files:

Index: src/sbin/newfs/mkfs.c
diff -u src/sbin/newfs/mkfs.c:1.136 src/sbin/newfs/mkfs.c:1.137
--- src/sbin/newfs/mkfs.c:1.136	Thu Feb 22 02:11:29 2024
+++ src/sbin/newfs/mkfs.c	Fri May 10 20:36:34 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: mkfs.c,v 1.136 2024/02/22 02:11:29 mrg Exp $	*/
+/*	$NetBSD: mkfs.c,v 1.137 2024/05/10 20:36:34 andvar Exp $	*/
 
 /*
  * Copyright (c) 1980, 1989, 1993
@@ -73,7 +73,7 @@
 #if 0
 static char sccsid[] = "@(#)mkfs.c	8.11 (Berkeley) 5/3/95";
 #else
-__RCSID("$NetBSD: mkfs.c,v 1.136 2024/02/22 02:11:29 mrg Exp $");
+__RCSID("$NetBSD: mkfs.c,v 1.137 2024/05/10 20:36:34 andvar Exp $");
 #endif
 #endif /* not lint */
 
@@ -611,7 +611,7 @@ mkfs(const char *fsys, int fi, int fo,
 
 		/*
 		 * Ensure there is nothing that looks like a filesystem
-		 * superbock anywhere other than where ours will be.
+		 * superblock anywhere other than where ours will be.
 		 * If fsck finds the wrong one all hell breaks loose!
 		 */
 		for (i = 0; ; i++) {



CVS commit: src/sys/arch/hpcsh/dev

2024-05-10 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Fri May 10 20:08:04 UTC 2024

Modified Files:
src/sys/arch/hpcsh/dev: psh3pwr.c

Log Message:
s/covnerter/converter/ in comment.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/hpcsh/dev/psh3pwr.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/hpcsh/dev/psh3pwr.c
diff -u src/sys/arch/hpcsh/dev/psh3pwr.c:1.6 src/sys/arch/hpcsh/dev/psh3pwr.c:1.7
--- src/sys/arch/hpcsh/dev/psh3pwr.c:1.6	Mon Oct 29 12:51:38 2012
+++ src/sys/arch/hpcsh/dev/psh3pwr.c	Fri May 10 20:08:04 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: psh3pwr.c,v 1.6 2012/10/29 12:51:38 chs Exp $	*/
+/*	$NetBSD: psh3pwr.c,v 1.7 2024/05/10 20:08:04 andvar Exp $	*/
 /*
  * Copyright (c) 2005, 2007 KIYOHARA Takashi
  * All rights reserved.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: psh3pwr.c,v 1.6 2012/10/29 12:51:38 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: psh3pwr.c,v 1.7 2024/05/10 20:08:04 andvar Exp $");
 
 #include 
 #include 
@@ -55,7 +55,7 @@ __KERNEL_RCSID(0, "$NetBSD: psh3pwr.c,v 
 #endif
 
 
-/* A/D covnerter channels to get power stats from */
+/* A/D converter channels to get power stats from */
 #define ADC_CHANNEL_BATTERY	3
 
 /* On/Off bit for Green LED. pin 7 in SH7709 GPIO port H. */



CVS commit: src/sys/arch/hpcsh/dev

2024-05-10 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Fri May 10 20:08:04 UTC 2024

Modified Files:
src/sys/arch/hpcsh/dev: psh3pwr.c

Log Message:
s/covnerter/converter/ in comment.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/hpcsh/dev/psh3pwr.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/acpi

2024-05-10 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Fri May 10 19:29:46 UTC 2024

Modified Files:
src/sys/dev/acpi: acpi_display.c

Log Message:
Add quirk for machines were the getting the brightness value always
returns the same result by keeping a local copy of the last set value.

This makes the brightness buttons work on my Thinkpad T450s, and will
probably fix PR kern/57825 as well.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/dev/acpi/acpi_display.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/acpi/acpi_display.c
diff -u src/sys/dev/acpi/acpi_display.c:1.23 src/sys/dev/acpi/acpi_display.c:1.24
--- src/sys/dev/acpi/acpi_display.c:1.23	Fri Mar 17 17:16:06 2023
+++ src/sys/dev/acpi/acpi_display.c	Fri May 10 19:29:46 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: acpi_display.c,v 1.23 2023/03/17 17:16:06 andvar Exp $	*/
+/*	$NetBSD: acpi_display.c,v 1.24 2024/05/10 19:29:46 maya Exp $	*/
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -66,7 +66,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: acpi_display.c,v 1.23 2023/03/17 17:16:06 andvar Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_display.c,v 1.24 2024/05/10 19:29:46 maya Exp $");
 
 #include 
 #include 
@@ -270,6 +270,12 @@ struct acpidisp_brctl {
 	uint8_t		*bc_level;		/* Array of levels */
 	uint16_t	 bc_level_count;	/* Number of levels */
 	uint8_t		 bc_current;		/* Current level */
+
+	/* 
+	 * Quirk if firmware returns wrong values for _BQC
+	 * (acpidisp_get_brightness) 
+	 */
+	bool		bc_bqc_broken;
 };
 
 /*
@@ -376,6 +382,7 @@ static int	acpidisp_get_brightness(const
 		uint8_t *);
 static int	acpidisp_set_brightness(const struct acpidisp_out_softc *,
 		uint8_t);
+static int	acpidisp_quirk_get_brightness(const struct acpidisp_out_softc *);
 
 static void	acpidisp_print_odinfo(device_t, const struct acpidisp_odinfo *);
 static void	acpidisp_print_brctl(device_t, const struct acpidisp_brctl *);
@@ -717,6 +724,10 @@ acpidisp_out_attach(device_t parent, dev
 			kmem_free(bc, sizeof(*bc));
 			osc->sc_brctl = NULL;
 		} else {
+			if (acpidisp_quirk_get_brightness(osc)) {
+aprint_error_dev(self,
+"failed to test _BQC quirk\n");
+			}
 			acpidisp_print_brctl(self, osc->sc_brctl);
 		}
 	}
@@ -1860,6 +1871,11 @@ acpidisp_get_brightness(const struct acp
 	if (!(osc->sc_caps & ACPI_DISP_OUT_CAP__BQC))
 		return ENODEV;
 
+	if (osc->sc_brctl->bc_bqc_broken) {
+		*valuep = osc->sc_brctl->bc_current;
+		return 0;
+	}
+
 	rv = acpi_eval_integer(hdl, "_BQC", );
 	if (ACPI_FAILURE(rv)) {
 		aprint_error_dev(osc->sc_dev, "failed to evaluate %s.%s: %s\n",
@@ -1878,6 +1894,60 @@ acpidisp_get_brightness(const struct acp
 	return 0;
 }
 
+/*
+ * Quirk for when getting the brightness value always returns the same
+ * result, which breaks brightness controls which try to lower the
+ * brightness by a specific value and then check if it worked.
+ */
+static int
+acpidisp_quirk_get_brightness(const struct acpidisp_out_softc *osc)
+{
+	struct acpidisp_brctl *bc;
+	uint8_t original_brightness, test_brightness;
+	int error;
+
+	bc = osc->sc_brctl;
+
+	/* Avoid false results if quirk already enabled */
+	bc->bc_bqc_broken = false;
+
+	error = acpidisp_get_brightness(osc, >bc_current);
+	if (error)
+		return error;
+	original_brightness = bc->bc_current;
+
+	/* Find a different brightness value */
+	test_brightness = bc->bc_level[bc->bc_level_count - 1];
+	if (test_brightness == original_brightness)
+		test_brightness = bc->bc_level[0];
+
+	if (test_brightness == original_brightness) {
+		aprint_error_dev(osc->sc_dev,
+		"couldn't find different brightness levels"
+		" for _BQC quirk test\n");
+		return 0;
+	}
+
+	bc->bc_current = test_brightness;
+	error = acpidisp_set_brightness(osc, bc->bc_current);
+	if (error)
+		return error;
+
+	error = acpidisp_get_brightness(osc, >bc_current);
+	if (error)
+		return error;
+
+	/* We set a different value, but got the original value back */
+	if (bc->bc_current == original_brightness) {
+		aprint_normal_dev(osc->sc_dev, "_BQC broken, enabling quirk\n");
+		bc->bc_bqc_broken = true;
+	}
+
+	/* Restore original value */
+	bc->bc_current = original_brightness;
+	return acpidisp_set_brightness(osc, bc->bc_current);
+}
+
 static int
 acpidisp_set_brightness(const struct acpidisp_out_softc *osc, uint8_t value)
 {



CVS commit: src/sys/dev/acpi

2024-05-10 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Fri May 10 19:29:46 UTC 2024

Modified Files:
src/sys/dev/acpi: acpi_display.c

Log Message:
Add quirk for machines were the getting the brightness value always
returns the same result by keeping a local copy of the last set value.

This makes the brightness buttons work on my Thinkpad T450s, and will
probably fix PR kern/57825 as well.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/dev/acpi/acpi_display.c

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



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

2024-05-10 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri May 10 14:42:21 UTC 2024

Modified Files:
src/sys/arch/arm/fdt: cpu_fdt.c

Log Message:
arm/fdt/cpu_fdt.c: Use `cpu' iattr to attach cpufreq.

Now that cpu has an explicit interface attribute, cpufeaturebus,
_all_ children of cpu must use an explicit interface attribute to
disambiguate.  For children that weren't previously attached using an
explicit interface attribute, the name of the parent, `cpu', serves
as the iattr.

XXX I think we should either
(a) not use cpufreqbus, since in the aarch64 case it doesn't seem to
be passing any information through attach args, or
(b) create another iattr like cpufdtbus for use by cpufreq_dt.c,
which does rely on attach args, if it has to attach differently
from the rest of fdtbus.
But for now this should get aarch64 on fdt booting again.


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 src/sys/arch/arm/fdt/cpu_fdt.c

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



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

2024-05-10 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri May 10 14:42:21 UTC 2024

Modified Files:
src/sys/arch/arm/fdt: cpu_fdt.c

Log Message:
arm/fdt/cpu_fdt.c: Use `cpu' iattr to attach cpufreq.

Now that cpu has an explicit interface attribute, cpufeaturebus,
_all_ children of cpu must use an explicit interface attribute to
disambiguate.  For children that weren't previously attached using an
explicit interface attribute, the name of the parent, `cpu', serves
as the iattr.

XXX I think we should either
(a) not use cpufreqbus, since in the aarch64 case it doesn't seem to
be passing any information through attach args, or
(b) create another iattr like cpufdtbus for use by cpufreq_dt.c,
which does rely on attach args, if it has to attach differently
from the rest of fdtbus.
But for now this should get aarch64 on fdt booting again.


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 src/sys/arch/arm/fdt/cpu_fdt.c

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

Modified files:

Index: src/sys/arch/arm/fdt/cpu_fdt.c
diff -u src/sys/arch/arm/fdt/cpu_fdt.c:1.43 src/sys/arch/arm/fdt/cpu_fdt.c:1.44
--- src/sys/arch/arm/fdt/cpu_fdt.c:1.43	Thu May  9 12:41:08 2024
+++ src/sys/arch/arm/fdt/cpu_fdt.c	Fri May 10 14:42:21 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu_fdt.c,v 1.43 2024/05/09 12:41:08 pho Exp $ */
+/* $NetBSD: cpu_fdt.c,v 1.44 2024/05/10 14:42:21 riastradh Exp $ */
 
 /*-
  * Copyright (c) 2017 Jared McNeill 
@@ -30,7 +30,7 @@
 #include "psci_fdt.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cpu_fdt.c,v 1.43 2024/05/09 12:41:08 pho Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu_fdt.c,v 1.44 2024/05/10 14:42:21 riastradh Exp $");
 
 #include 
 #include 
@@ -98,7 +98,7 @@ cpu_fdt_attach(device_t parent, device_t
 	cpu_attach(self, cpuid);
 
 	/* Attach CPU frequency scaling provider */
-	config_found(self, faa, NULL, CFARGS_NONE);
+	config_found(self, faa, NULL, CFARGS(.iattr = "cpu"));
 }
 
 #if defined(MULTIPROCESSOR) && (NPSCI_FDT > 0 || defined(__aarch64__))



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

2024-05-10 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri May 10 12:24:08 UTC 2024

Modified Files:
src/distrib/sets/lists/xdebug: shl.mi

Log Message:
xdebug/shl.mi: Delete libXxf86misc.so.2.0.debug.

Loading existing applications that linked against this into a
debugger should continue to work, so it shouldn't be obsoleted, but
the file is no longer installed.


To generate a diff of this commit:
cvs rdiff -u -r1.69 -r1.70 src/distrib/sets/lists/xdebug/shl.mi

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



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

2024-05-10 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri May 10 12:24:08 UTC 2024

Modified Files:
src/distrib/sets/lists/xdebug: shl.mi

Log Message:
xdebug/shl.mi: Delete libXxf86misc.so.2.0.debug.

Loading existing applications that linked against this into a
debugger should continue to work, so it shouldn't be obsoleted, but
the file is no longer installed.


To generate a diff of this commit:
cvs rdiff -u -r1.69 -r1.70 src/distrib/sets/lists/xdebug/shl.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/xdebug/shl.mi
diff -u src/distrib/sets/lists/xdebug/shl.mi:1.69 src/distrib/sets/lists/xdebug/shl.mi:1.70
--- src/distrib/sets/lists/xdebug/shl.mi:1.69	Mon Sep  4 19:07:59 2023
+++ src/distrib/sets/lists/xdebug/shl.mi	Fri May 10 12:24:08 2024
@@ -1,4 +1,4 @@
-# $NetBSD: shl.mi,v 1.69 2023/09/04 19:07:59 riastradh Exp $
+# $NetBSD: shl.mi,v 1.70 2024/05/10 12:24:08 riastradh Exp $
 ./usr/libdata/debug/usr/X11R7/lib	base-sys-usr		xorg,debug,compatx11dir
 ./usr/libdata/debug/usr/X11R7/lib/X11/locale/lib/common/libximcp.so.2.0.debug	obsolete		obsolete
 ./usr/libdata/debug/usr/X11R7/lib/X11/locale/lib/common/libxlcDef.so.2.0.debug	obsolete		obsolete
@@ -50,7 +50,6 @@
 ./usr/libdata/debug/usr/X11R7/lib/libXvMC.so.2.0.debug	xdebug-libXvMC-debug		xorg,debug,compatx11file
 ./usr/libdata/debug/usr/X11R7/lib/libXvMCW.so.1.0.debug	xdebug-libXvMCW-debug		xorg,debug,compatx11file
 ./usr/libdata/debug/usr/X11R7/lib/libXxf86dga.so.2.0.debug	xdebug-libXxf86dga-debug		xorg,debug,compatx11file
-./usr/libdata/debug/usr/X11R7/lib/libXxf86misc.so.2.0.debug	xdebug-libXxf86misc-debug		xorg,debug,compatx11file
 ./usr/libdata/debug/usr/X11R7/lib/libXxf86vm.so.2.0.debug	xdebug-libXxf86vm-debug		xorg,debug,compatx11file
 ./usr/libdata/debug/usr/X11R7/lib/libdrm.so.3.7.debug	xdebug-libdrm-debug		xorg,debug,compatx11file
 ./usr/libdata/debug/usr/X11R7/lib/libdrm_radeon.so.0.0.debug	xdebug-libdrm_radeon-debug		xorg,debug,compatx11file



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

2024-05-10 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri May 10 12:21:49 UTC 2024

Modified Files:
src/distrib/sets/lists/xbase: shl.mi

Log Message:
xbase/shl.mi: Delete, rather than obsolete, libXxf86misc.so.M(.N).

Obsolete lines here will lead postinstall to delete the shlib, which
will break any existing applications linked against it.  Deleting the
lines has no effect on postinstall.

(We should maybe have a different way to mark them instead, as
suggested in PR 57581, but we don't, so this is what we do for now.)

However, keep the obsolete line for libXxf86misc.so, since the .so
symlink itself is only used when linking new applications.


To generate a diff of this commit:
cvs rdiff -u -r1.105 -r1.106 src/distrib/sets/lists/xbase/shl.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/xbase/shl.mi
diff -u src/distrib/sets/lists/xbase/shl.mi:1.105 src/distrib/sets/lists/xbase/shl.mi:1.106
--- src/distrib/sets/lists/xbase/shl.mi:1.105	Fri May 10 12:18:16 2024
+++ src/distrib/sets/lists/xbase/shl.mi	Fri May 10 12:21:49 2024
@@ -1,4 +1,4 @@
-# $NetBSD: shl.mi,v 1.105 2024/05/10 12:18:16 riastradh Exp $
+# $NetBSD: shl.mi,v 1.106 2024/05/10 12:21:49 riastradh Exp $
 #
 # Note:	Don't delete entries from here - mark them as "obsolete" instead,
 #	unless otherwise stated below.
@@ -152,8 +152,6 @@
 ./usr/X11R7/lib/libXxf86dga.so.2		xbase-libXxf86dga-lib		xorg,compatx11file
 ./usr/X11R7/lib/libXxf86dga.so.2.0		xbase-libXxf86dga-lib		xorg,compatx11file
 ./usr/X11R7/lib/libXxf86misc.so			xbase-obsolete		obsolete
-./usr/X11R7/lib/libXxf86misc.so.2		xbase-obsolete		obsolete
-./usr/X11R7/lib/libXxf86misc.so.2.0		xbase-obsolete		obsolete
 ./usr/X11R7/lib/libXxf86vm.so			xbase-libXxf86vm-lib		xorg,compatx11file
 ./usr/X11R7/lib/libXxf86vm.so.2			xbase-libXxf86vm-lib		xorg,compatx11file
 ./usr/X11R7/lib/libXxf86vm.so.2.0		xbase-libXxf86vm-lib		xorg,compatx11file



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

2024-05-10 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri May 10 12:21:49 UTC 2024

Modified Files:
src/distrib/sets/lists/xbase: shl.mi

Log Message:
xbase/shl.mi: Delete, rather than obsolete, libXxf86misc.so.M(.N).

Obsolete lines here will lead postinstall to delete the shlib, which
will break any existing applications linked against it.  Deleting the
lines has no effect on postinstall.

(We should maybe have a different way to mark them instead, as
suggested in PR 57581, but we don't, so this is what we do for now.)

However, keep the obsolete line for libXxf86misc.so, since the .so
symlink itself is only used when linking new applications.


To generate a diff of this commit:
cvs rdiff -u -r1.105 -r1.106 src/distrib/sets/lists/xbase/shl.mi

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



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

2024-05-10 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri May 10 12:18:16 UTC 2024

Modified Files:
src/distrib/sets/lists/xbase: shl.mi

Log Message:
xbase/shl.mi: Copy comment about delete vs obsolete from base/shl.mi.


To generate a diff of this commit:
cvs rdiff -u -r1.104 -r1.105 src/distrib/sets/lists/xbase/shl.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/xbase/shl.mi
diff -u src/distrib/sets/lists/xbase/shl.mi:1.104 src/distrib/sets/lists/xbase/shl.mi:1.105
--- src/distrib/sets/lists/xbase/shl.mi:1.104	Thu May  9 06:38:27 2024
+++ src/distrib/sets/lists/xbase/shl.mi	Fri May 10 12:18:16 2024
@@ -1,6 +1,15 @@
-# $NetBSD: shl.mi,v 1.104 2024/05/09 06:38:27 nia Exp $
+# $NetBSD: shl.mi,v 1.105 2024/05/10 12:18:16 riastradh Exp $
 #
-# Note: don't delete entries from here - mark them as "obsolete" instead.
+# Note:	Don't delete entries from here - mark them as "obsolete" instead,
+#	unless otherwise stated below.
+#
+# Note:	Do not mark "old" major and major.minor shared libraries as
+#	"obsolete"; just remove the entry, as third-party applications
+#	may be linked against the old major shared library, and
+#	that is a symlink to the old major.minor shared library.
+#	e.g., "lib.so." and "lib.so.."
+#	Exceptions to this rule may include shared libraries that
+#	are dlopen()ed at run-time, such as extra locales, etc.
 #
 ./usr/X11R7/lib/X11/locale/lib/common/ximcp.so		obsolete	obsolete
 ./usr/X11R7/lib/X11/locale/lib/common/ximcp.so.2	obsolete	obsolete



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

2024-05-10 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri May 10 12:18:16 UTC 2024

Modified Files:
src/distrib/sets/lists/xbase: shl.mi

Log Message:
xbase/shl.mi: Copy comment about delete vs obsolete from base/shl.mi.


To generate a diff of this commit:
cvs rdiff -u -r1.104 -r1.105 src/distrib/sets/lists/xbase/shl.mi

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-05-10 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri May 10 09:30:47 UTC 2024

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

Log Message:
sys/ktrace.h: fix off-by-one error in snprintb for ktrace flags


To generate a diff of this commit:
cvs rdiff -u -r1.68 -r1.69 src/sys/sys/ktrace.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/ktrace.h
diff -u src/sys/sys/ktrace.h:1.68 src/sys/sys/ktrace.h:1.69
--- src/sys/sys/ktrace.h:1.68	Wed Jun 29 22:10:43 2022
+++ src/sys/sys/ktrace.h	Fri May 10 09:30:47 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: ktrace.h,v 1.68 2022/06/29 22:10:43 riastradh Exp $	*/
+/*	$NetBSD: ktrace.h,v 1.69 2024/05/10 09:30:47 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1993
@@ -265,9 +265,9 @@ struct ktr_execfd {
 "b\16MIB\0" \
 "b\17EXEC_FD\0" \
 "f\30\4VERSION\0" \
-"b\36TRC_EMUL\0" \
-"b\37INHERIT\0" \
-"b\40PERSISTENT\0"
+"b\35TRC_EMUL\0" \
+"b\36INHERIT\0" \
+"b\37PERSISTENT\0"
 
 /*
  * trace flags (also in p_traceflags)



CVS commit: src/sys/sys

2024-05-10 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri May 10 09:30:47 UTC 2024

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

Log Message:
sys/ktrace.h: fix off-by-one error in snprintb for ktrace flags


To generate a diff of this commit:
cvs rdiff -u -r1.68 -r1.69 src/sys/sys/ktrace.h

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



CVS commit: src/usr.bin/error

2024-05-10 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri May 10 09:27:27 UTC 2024

Modified Files:
src/usr.bin/error: Makefile

Log Message:
error: disable lint's strict bool mode when building with Clang

The Clang preprocessor does not mark sections from system headers.
Lint's strict bool mode relies on these markers to allow the functions
from  to be used as 'bool', even though their declared return
type is 'int'. Without these markers, lint complains that the "right
operand of '&&' must be bool, not 'int'". Until this is fixed in lint,
disable strict bool mode.


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

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/error/Makefile
diff -u src/usr.bin/error/Makefile:1.11 src/usr.bin/error/Makefile:1.12
--- src/usr.bin/error/Makefile:1.11	Sat Aug 26 14:50:53 2023
+++ src/usr.bin/error/Makefile	Fri May 10 09:27:27 2024
@@ -1,5 +1,5 @@
 #	@(#)Makefile	8.1 (Berkeley) 6/6/93
-#	$NetBSD: Makefile,v 1.11 2023/08/26 14:50:53 rillig Exp $
+#	$NetBSD: Makefile,v 1.12 2024/05/10 09:27:27 rillig Exp $
 
 PROG=	error
 SRCS=	main.c input.c pi.c subr.c filter.c touch.c
@@ -8,6 +8,6 @@ DPADD+=	${LIBUTIL}
 LDADD+=	-lutil
 
 LINTFLAGS+=	-w		# treat warnings as errors
-LINTFLAGS+=	-T		# strict bool mode
+LINTFLAGS+=	${HAVE_LLVM:U-T:D}	# strict bool mode
 
 .include 



CVS commit: src/usr.bin/error

2024-05-10 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri May 10 09:27:27 UTC 2024

Modified Files:
src/usr.bin/error: Makefile

Log Message:
error: disable lint's strict bool mode when building with Clang

The Clang preprocessor does not mark sections from system headers.
Lint's strict bool mode relies on these markers to allow the functions
from  to be used as 'bool', even though their declared return
type is 'int'. Without these markers, lint complains that the "right
operand of '&&' must be bool, not 'int'". Until this is fixed in lint,
disable strict bool mode.


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

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



CVS commit: src/doc

2024-05-10 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Fri May 10 09:15:27 UTC 2024

Modified Files:
src/doc: CHANGES

Log Message:
doc: mention install(1) -v


To generate a diff of this commit:
cvs rdiff -u -r1.3054 -r1.3055 src/doc/CHANGES

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
diff -u src/doc/CHANGES:1.3054 src/doc/CHANGES:1.3055
--- src/doc/CHANGES:1.3054	Fri May 10 08:09:54 2024
+++ src/doc/CHANGES	Fri May 10 09:15:27 2024
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.3054 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.3055 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -384,3 +384,4 @@ Changes from NetBSD 10.0 to NetBSD 11.0:
 	hp300: Preliminary CD boot support.  [tsutsui 20240509]
 	lint(1): Support new keywords in C23 mode, including nullptr.
 		[rillig 20240509]
+	install(1): Support -v (verbose). [wiz 20240510]



CVS commit: src/doc

2024-05-10 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Fri May 10 09:15:27 UTC 2024

Modified Files:
src/doc: CHANGES

Log Message:
doc: mention install(1) -v


To generate a diff of this commit:
cvs rdiff -u -r1.3054 -r1.3055 src/doc/CHANGES

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



CVS commit: src/usr.bin/xinstall

2024-05-10 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Fri May 10 09:14:52 UTC 2024

Modified Files:
src/usr.bin/xinstall: install.1 xinstall.c

Log Message:
nstall(1): add support for -v

Reviewed by rillig@ and thorpej@, thanks!


To generate a diff of this commit:
cvs rdiff -u -r1.47 -r1.48 src/usr.bin/xinstall/install.1
cvs rdiff -u -r1.127 -r1.128 src/usr.bin/xinstall/xinstall.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/xinstall/install.1
diff -u src/usr.bin/xinstall/install.1:1.47 src/usr.bin/xinstall/install.1:1.48
--- src/usr.bin/xinstall/install.1:1.47	Sun Apr  8 22:00:40 2012
+++ src/usr.bin/xinstall/install.1	Fri May 10 09:14:52 2024
@@ -1,4 +1,4 @@
-.\"	$NetBSD: install.1,v 1.47 2012/04/08 22:00:40 wiz Exp $
+.\"	$NetBSD: install.1,v 1.48 2024/05/10 09:14:52 wiz Exp $
 .\"
 .\" Copyright (c) 1987, 1990, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -29,7 +29,7 @@
 .\"
 .\" @(#)install.1	8.1 (Berkeley) 6/6/93
 .\"
-.Dd May 1, 2009
+.Dd May 9, 2024
 .Dt INSTALL 1
 .Os
 .Sh NAME
@@ -37,7 +37,7 @@
 .Nd install binaries
 .Sh SYNOPSIS
 .Nm
-.Op Fl bcprsU
+.Op Fl bcprsUv
 .Op Fl a Ar command
 .Op Fl B Ar suffix
 .Op Fl D Ar destdir
@@ -297,6 +297,11 @@ try to change the owner, the group, or t
 The information that would have been updated can be stored in a log
 file with
 .Fl M Ar metalog .
+.It Fl v
+Cause
+.Nm
+to be verbose,
+showing files as they are installed or backed up.
 .El
 .Pp
 By default,

Index: src/usr.bin/xinstall/xinstall.c
diff -u src/usr.bin/xinstall/xinstall.c:1.127 src/usr.bin/xinstall/xinstall.c:1.128
--- src/usr.bin/xinstall/xinstall.c:1.127	Thu Jul 20 16:21:23 2023
+++ src/usr.bin/xinstall/xinstall.c	Fri May 10 09:14:52 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: xinstall.c,v 1.127 2023/07/20 16:21:23 lukem Exp $	*/
+/*	$NetBSD: xinstall.c,v 1.128 2024/05/10 09:14:52 wiz Exp $	*/
 
 /*
  * Copyright (c) 1987, 1993
@@ -78,7 +78,7 @@ __COPYRIGHT("@(#) Copyright (c) 1987, 19
 #if 0
 static char sccsid[] = "@(#)xinstall.c	8.1 (Berkeley) 7/21/93";
 #else
-__RCSID("$NetBSD: xinstall.c,v 1.127 2023/07/20 16:21:23 lukem Exp $");
+__RCSID("$NetBSD: xinstall.c,v 1.128 2024/05/10 09:14:52 wiz Exp $");
 #endif
 #endif /* not lint */
 
@@ -120,6 +120,7 @@ __RCSID("$NetBSD: xinstall.c,v 1.127 202
 static int	dobackup, dodir, dostrip, dolink, dopreserve, dorename, dounpriv;
 static int	haveopt_f, haveopt_g, haveopt_m, haveopt_o;
 static int	numberedbackup;
+static int	verbose;
 static int	mode = S_IRWXU|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH;
 static char	pathbuf[MAXPATHLEN];
 static uid_t	uid = -1;
@@ -186,7 +187,7 @@ main(int argc, char *argv[])
 	setprogname(argv[0]);
 
 	iflags = 0;
-	while ((ch = getopt(argc, argv, "a:cbB:dD:f:g:h:l:m:M:N:o:prsS:T:U"))
+	while ((ch = getopt(argc, argv, "a:cbB:dD:f:g:h:l:m:M:N:o:prsS:T:Uv"))
 	!= -1)
 		switch((char)ch) {
 		case 'a':
@@ -307,6 +308,9 @@ main(int argc, char *argv[])
 		case 'U':
 			dounpriv = 1;
 			break;
+		case 'v':
+			verbose = 1;
+			break;
 		case '?':
 		default:
 			usage();
@@ -477,9 +481,12 @@ do_link(char *from_name, char *to_name)
 			 */
 			(void)unlink(tmpl);
 		}
-		return (ret);
-	} else
-		return (link(from_name, to_name));
+} else {
+		ret = link(from_name, to_name);
+	}
+	if (ret == 0 && verbose)
+		(void)printf("install: link %s -> %s\n", from_name, to_name);
+	return ret;
 }
 
 /*
@@ -509,6 +516,8 @@ do_symlink(char *from_name, char *to_nam
 		if (symlink(from_name, to_name) == -1)
 			err(EXIT_FAILURE, "symlink %s -> %s", from_name, to_name);
 	}
+	if (verbose)
+		(void)printf("install: symlink %s -> %s\n", from_name, to_name);
 }
 
 /*
@@ -641,7 +650,7 @@ makelink(char *from_name, char *to_name)
 	}
 
 	/*
-	 * If absolute or relative was not specified, 
+	 * If absolute or relative was not specified,
 	 * try the names the user provided
 	 */
 	do_symlink(from_name, to_name);
@@ -821,6 +830,8 @@ install(char *from_name, char *to_name, 
 			err(EXIT_FAILURE, "%s: rename", to_name);
 		to_name = oto_name;
 	}
+	if (verbose)
+		(void)printf("install: %s -> %s\n", from_name, to_name);
 
 	/*
 	 * If provided a set of flags, set them, otherwise, preserve the
@@ -1116,12 +1127,12 @@ static void
 backup(const char *to_name)
 {
 	char	bname[FILENAME_MAX];
-	
+
 	if (numberedbackup) {
 		/* Do numbered backup */
 		int cnt;
 		char suffix_expanded[FILENAME_MAX];
-		
+
 		cnt=0;
 		do {
 			(void)snprintf(suffix_expanded, FILENAME_MAX, suffix,
@@ -1129,13 +1140,16 @@ backup(const char *to_name)
 			(void)snprintf(bname, FILENAME_MAX, "%s%s", to_name,
 			suffix_expanded);
 			cnt++;
-		} while (access(bname, F_OK) == 0); 
+		} while (access(bname, F_OK) == 0);
 	} else {
 		/* Do simple backup */
 		(void)snprintf(bname, FILENAME_MAX, "%s%s", to_name, suffix);
 	}
-	
-	(void)rename(to_name, bname);
+
+	if (rename(to_name, bname) == 0) {
+		if (verbose)
+			

CVS commit: src/usr.bin/xinstall

2024-05-10 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Fri May 10 09:14:52 UTC 2024

Modified Files:
src/usr.bin/xinstall: install.1 xinstall.c

Log Message:
nstall(1): add support for -v

Reviewed by rillig@ and thorpej@, thanks!


To generate a diff of this commit:
cvs rdiff -u -r1.47 -r1.48 src/usr.bin/xinstall/install.1
cvs rdiff -u -r1.127 -r1.128 src/usr.bin/xinstall/xinstall.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/include

2024-05-10 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri May 10 08:20:37 UTC 2024

Modified Files:
src/sys/arch/riscv/include: fenv.h

Log Message:
Use __BIT and fix FE_INEXACT


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/riscv/include/fenv.h

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

Modified files:

Index: src/sys/arch/riscv/include/fenv.h
diff -u src/sys/arch/riscv/include/fenv.h:1.3 src/sys/arch/riscv/include/fenv.h:1.4
--- src/sys/arch/riscv/include/fenv.h:1.3	Sat Mar 14 16:12:16 2020
+++ src/sys/arch/riscv/include/fenv.h	Fri May 10 08:20:37 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: fenv.h,v 1.3 2020/03/14 16:12:16 skrll Exp $	*/
+/*	$NetBSD: fenv.h,v 1.4 2024/05/10 08:20:37 skrll Exp $	*/
 
 /*
  * Based on ieeefp.h written by J.T. Conklin, Apr 28, 1995
@@ -11,13 +11,14 @@
 typedef int fenv_t;		/* FPSCR */
 typedef int fexcept_t;
 
-#define	FE_INEXACT	0x00	/* Result inexact */
-#define	FE_UNDERFLOW	0x02	/* Result underflowed */
-#define	FE_OVERFLOW	0x04	/* Result overflowed */
-#define	FE_DIVBYZERO	0x08	/* divide-by-zero */
-#define	FE_INVALID	0x10	/* Result invalid */
+#define	FE_INEXACT	__BIT(0)	/* Result inexact */
+#define	FE_UNDERFLOW	__BIT(1)	/* Result underflowed */
+#define	FE_OVERFLOW	__BIT(2)	/* Result overflowed */
+#define	FE_DIVBYZERO	__BIT(3)	/* divide-by-zero */
+#define	FE_INVALID	__BIT(4)	/* Result invalid */
 
-#define	FE_ALL_EXCEPT	0x1f
+#define	FE_ALL_EXCEPT	\
+(FE_INEXACT | FE_UNDERFLOW | FE_OVERFLOW | FE_DIVBYZERO | FE_INVALID)
 
 #define	FE_TONEAREST	0	/* round to nearest representable number */
 #define	FE_TOWARDZERO	1	/* round to zero (truncate) */



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

2024-05-10 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri May 10 08:20:37 UTC 2024

Modified Files:
src/sys/arch/riscv/include: fenv.h

Log Message:
Use __BIT and fix FE_INEXACT


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/riscv/include/fenv.h

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



CVS commit: src/doc

2024-05-10 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Fri May 10 08:09:54 UTC 2024

Modified Files:
src/doc: CHANGES

Log Message:
recent changes


To generate a diff of this commit:
cvs rdiff -u -r1.3053 -r1.3054 src/doc/CHANGES

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
diff -u src/doc/CHANGES:1.3053 src/doc/CHANGES:1.3054
--- src/doc/CHANGES:1.3053	Sat May  4 16:57:15 2024
+++ src/doc/CHANGES	Fri May 10 08:09:54 2024
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.3053 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.3054 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -370,3 +370,17 @@ Changes from NetBSD 10.0 to NetBSD 11.0:
 		properly. [tsutsui 20240501]
 	evbarm: Add device tree for Red Pitaya SDRlab 122-16.
 		[dyoung 20240504]
+	libm: Add an assembly implementation of rintl(3) for x86.
+		[riastradh 20240505]
+	libm: Expose more long double functions on vax.
+		[riastradh 20240506]
+	libm: Expand tests for modf/modff/modfl, nextafter/nexttoward,
+		nearbyint/nearbyintl/rint.  [riastradh 20240506]
+	mk: Use --compress-debug-sections when creating debug files
+		to reduce the size of the installed debug set.
+		[mrg 20240506]
+	makefs(8): Add an option to warn and error out for mtree missing
+		entries.  [christos 20240508]
+	hp300: Preliminary CD boot support.  [tsutsui 20240509]
+	lint(1): Support new keywords in C23 mode, including nullptr.
+		[rillig 20240509]



CVS commit: src/doc

2024-05-10 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Fri May 10 08:09:54 UTC 2024

Modified Files:
src/doc: CHANGES

Log Message:
recent changes


To generate a diff of this commit:
cvs rdiff -u -r1.3053 -r1.3054 src/doc/CHANGES

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