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

2024-03-12 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Tue Mar 12 21:27:14 UTC 2024

Modified Files:
src/sys/arch/evbmips/evbmips: interrupt.c

Log Message:
Fix non-DIAGNOSTIC build for evbmips.

mtx_count, biglock_count and blcnt are defined inside DIAGNOSTIC block, thus
KASSERTs using them should be guarded as well.

Seemingly introduced with matt-nb5-mips64 merge in 2011.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/evbmips/evbmips/interrupt.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/evbmips/evbmips

2024-03-12 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Tue Mar 12 21:27:14 UTC 2024

Modified Files:
src/sys/arch/evbmips/evbmips: interrupt.c

Log Message:
Fix non-DIAGNOSTIC build for evbmips.

mtx_count, biglock_count and blcnt are defined inside DIAGNOSTIC block, thus
KASSERTs using them should be guarded as well.

Seemingly introduced with matt-nb5-mips64 merge in 2011.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/evbmips/evbmips/interrupt.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/evbmips/evbmips/interrupt.c
diff -u src/sys/arch/evbmips/evbmips/interrupt.c:1.25 src/sys/arch/evbmips/evbmips/interrupt.c:1.26
--- src/sys/arch/evbmips/evbmips/interrupt.c:1.25	Sat Jun 10 07:30:57 2023
+++ src/sys/arch/evbmips/evbmips/interrupt.c	Tue Mar 12 21:27:14 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: interrupt.c,v 1.25 2023/06/10 07:30:57 skrll Exp $	*/
+/*	$NetBSD: interrupt.c,v 1.26 2024/03/12 21:27:14 andvar Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: interrupt.c,v 1.25 2023/06/10 07:30:57 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: interrupt.c,v 1.26 2024/03/12 21:27:14 andvar Exp $");
 
 #include 
 #include 
@@ -94,9 +94,11 @@ cpu_intr(int ppl, vaddr_t pc, uint32_t s
 			/* Process I/O and error interrupts. */
 			evbmips_iointr(ipl, pending, );
 		}
+#ifdef DIAGNOSTIC
 		KASSERT(biglock_count == ci->ci_biglock_count);
 		KASSERT(blcnt == curlwp->l_blcnt);
 		KASSERT(mtx_count == ci->ci_mtx_count);
+#endif
 
 		/*
 		 * If even our spl is higher now (due to interrupting while



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

2024-03-12 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Tue Mar 12 20:35:29 UTC 2024

Modified Files:
src/tests/usr.bin/xlint/lint1: msg_132.c

Log Message:
tests/lint: extend test for previously wrong warning about bit-fields


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/tests/usr.bin/xlint/lint1/msg_132.c

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



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

2024-03-12 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Tue Mar 12 20:35:29 UTC 2024

Modified Files:
src/tests/usr.bin/xlint/lint1: msg_132.c

Log Message:
tests/lint: extend test for previously wrong warning about bit-fields


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/tests/usr.bin/xlint/lint1/msg_132.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/usr.bin/xlint/lint1/msg_132.c
diff -u src/tests/usr.bin/xlint/lint1/msg_132.c:1.35 src/tests/usr.bin/xlint/lint1/msg_132.c:1.36
--- src/tests/usr.bin/xlint/lint1/msg_132.c:1.35	Tue Mar 12 07:56:08 2024
+++ src/tests/usr.bin/xlint/lint1/msg_132.c	Tue Mar 12 20:35:29 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg_132.c,v 1.35 2024/03/12 07:56:08 rillig Exp $	*/
+/*	$NetBSD: msg_132.c,v 1.36 2024/03/12 20:35:29 rillig Exp $	*/
 # 3 "msg_132.c"
 
 // Test for message: conversion from '%s' to '%s' may lose accuracy [132]
@@ -404,16 +404,26 @@ test_ic_conditional(char c1, char c2)
 }
 
 void
-fp_classify(void)
+compare_bit_field_to_integer_constant(void)
 {
-	static struct ieee_ext {
-		unsigned long long ext_exp:15;
-	} x;
+	static _Bool b;
+	static struct {
+		short s16:15;
+		unsigned short u16:15;
+		int s32:15;
+		unsigned u32:15;
+		long long s64:15;
+		unsigned long long u64:15;
+	} s;
 
 	// Since decl.c 1.180 from 2021-05-02 and before tree.c 1.624 from
 	// 2024-03-12, lint warned about a possible loss of accuracy [132]
-	// when promoting a small unsigned bit-field to 'int'.
-	if (x.ext_exp == 0) {
-	} else if (x.ext_exp == 0x7fff) {
-	}
+	// when promoting an 'unsigned long long' bit-field to 'int'.
+	b = s.s16 == 0;
+	b = s.u16 == 0;
+	b = s.s32 == 0;
+	b = s.u32 == 0;
+	b = s.s64 == 0;
+	b = s.u64 == 0;
+	b = !b;
 }



CVS commit: [netbsd-8] src/doc

2024-03-12 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Mar 12 12:50:10 UTC 2024

Modified Files:
src/doc [netbsd-8]: CHANGES-8.3

Log Message:
Tickets #1940 and #1948


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.223 -r1.1.2.224 src/doc/CHANGES-8.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-8.3
diff -u src/doc/CHANGES-8.3:1.1.2.223 src/doc/CHANGES-8.3:1.1.2.224
--- src/doc/CHANGES-8.3:1.1.2.223	Mon Mar 11 20:06:31 2024
+++ src/doc/CHANGES-8.3	Tue Mar 12 12:50:10 2024
@@ -1,4 +1,4 @@
-$NetBSD: CHANGES-8.3,v 1.1.2.223 2024/03/11 20:06:31 martin Exp $
+$NetBSD: CHANGES-8.3,v 1.1.2.224 2024/03/12 12:50:10 martin Exp $
 
 A complete list of changes from the NetBSD 8.2 release to the NetBSD 8.3
 release:
@@ -4340,3 +4340,28 @@ lib/libc/gen/getcap.c1.58
 	libc: fix memory leak in getent().
 	[ozaki-r, ticket #1947]
 
+sys/dev/usb/usbdi.c1.248
+
+	usbdi(9): PR 57783: avoid locking against self when racing with
+	the host controller softint to enter ddb.
+	[riastradh, ticket #1940]
+
+usr.bin/audio/common/auconv.h   up to 1.6
+usr.bin/audio/common/audio.cup to 1.27
+usr.bin/audio/common/decode.c   up to 1.2
+usr.bin/audio/common/libaudio.h up to 1.22
+usr.bin/audio/common/sun.c  up to 1.11
+usr.bin/audio/common/wav.c  up to 1.22
+usr.bin/audio/play/audioplay.1  up to 1.34
+usr.bin/audio/play/play.c   up to 1.64
+usr.bin/audio/record/audiorecord.1  up to 1.45
+usr.bin/audio/record/record.c   up to 1.58
+
+	audioplay(1), audiorecord(1):
+	- support for playing 32-bit and 64-bit IEEE FP .wav files
+	- support for recording 24 bit .wav files  
+	- read-overflow fixes for .wav files, and other fixes for the
+	  wav parser
+	- audioplay gains -n flag (no play, like make -n)
+	- audiorecord manual gained useful examples
+	[mrg, ticket #1948]



CVS commit: [netbsd-8] src/doc

2024-03-12 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Mar 12 12:50:10 UTC 2024

Modified Files:
src/doc [netbsd-8]: CHANGES-8.3

Log Message:
Tickets #1940 and #1948


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.223 -r1.1.2.224 src/doc/CHANGES-8.3

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



CVS commit: [netbsd-8] src/usr.bin/audio

2024-03-12 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Mar 12 12:47:41 UTC 2024

Modified Files:
src/usr.bin/audio/common [netbsd-8]: auconv.h audio.c decode.c
libaudio.h sun.c wav.c
src/usr.bin/audio/play [netbsd-8]: audioplay.1 play.c
src/usr.bin/audio/record [netbsd-8]: audiorecord.1 record.c

Log Message:
Pull up the following revisions, requested by mrg in ticket #1948:

usr.bin/audio/common/auconv.h   up to 1.6
usr.bin/audio/common/audio.cup to 1.27
usr.bin/audio/common/decode.c   up to 1.2
usr.bin/audio/common/libaudio.h up to 1.22
usr.bin/audio/common/sun.c  up to 1.11
usr.bin/audio/common/wav.c  up to 1.22
usr.bin/audio/play/audioplay.1  up to 1.34
usr.bin/audio/play/play.c   up to 1.64
usr.bin/audio/record/audiorecord.1  up to 1.45
usr.bin/audio/record/record.c   up to 1.58

- support for playing 32-bit and 64-bit IEEE FP .wav files
- support for recording 24 bit .wav files
- read-overflow fixes for .wav files, and other fixes for the
  wav parser
- audioplay gains -n flag (no play, like make -n)
- audiorecord manual gained useful examples


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.5.54.1 src/usr.bin/audio/common/auconv.h
cvs rdiff -u -r1.25 -r1.25.8.1 src/usr.bin/audio/common/audio.c
cvs rdiff -u -r1.1 -r1.1.8.1 src/usr.bin/audio/common/decode.c
cvs rdiff -u -r1.20 -r1.20.8.1 src/usr.bin/audio/common/libaudio.h
cvs rdiff -u -r1.9 -r1.9.8.1 src/usr.bin/audio/common/sun.c
cvs rdiff -u -r1.13.8.1 -r1.13.8.2 src/usr.bin/audio/common/wav.c
cvs rdiff -u -r1.26 -r1.26.18.1 src/usr.bin/audio/play/audioplay.1
cvs rdiff -u -r1.55 -r1.55.8.1 src/usr.bin/audio/play/play.c
cvs rdiff -u -r1.42 -r1.42.18.1 src/usr.bin/audio/record/audiorecord.1
cvs rdiff -u -r1.54 -r1.54.8.1 src/usr.bin/audio/record/record.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/audio/common/auconv.h
diff -u src/usr.bin/audio/common/auconv.h:1.5 src/usr.bin/audio/common/auconv.h:1.5.54.1
--- src/usr.bin/audio/common/auconv.h:1.5	Mon Apr 28 20:24:12 2008
+++ src/usr.bin/audio/common/auconv.h	Tue Mar 12 12:47:40 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: auconv.h,v 1.5 2008/04/28 20:24:12 martin Exp $	*/
+/*	$NetBSD: auconv.h,v 1.5.54.1 2024/03/12 12:47:40 martin Exp $	*/
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -78,6 +78,24 @@ change_sign16_be(u_char *p, int cc)
 }
 
 static inline void
+change_sign24_le(u_char *p, int cc)
+{
+	while ((cc -= 3) >= 0) {
+		p[2] ^= 0x80;
+		p += 3;
+	}
+}
+
+static inline void
+change_sign24_be(u_char *p, int cc)
+{
+	while ((cc -= 3) >= 0) {
+		p[0] ^= 0x80;
+		p += 3;
+	}
+}
+
+static inline void
 change_sign32_le(u_char *p, int cc)
 {
 	while ((cc -= 4) >= 0) {
@@ -163,6 +181,44 @@ change_sign16_swap_bytes_be(u_char *p, i
 }
 
 static inline void
+swap_bytes_change_sign24_le(u_char *p, int cc)
+{
+	u_char t;
+
+	while ((cc -= 3) >= 0) {
+		t = p[2];
+		p[2] = p[0] ^ 0x80;
+		p[0] = t;
+		p += 3;
+	}
+}
+
+static inline void
+swap_bytes_change_sign24_be(u_char *p, int cc)
+{
+	u_char t;
+
+	while ((cc -= 3) >= 0) {
+		t = p[0];
+		p[0] = p[2] ^ 0x80;
+		p[2] = t;
+		p += 3;
+	}
+}
+
+static inline void
+change_sign24_swap_bytes_le(u_char *p, int cc)
+{
+	swap_bytes_change_sign24_be(p, cc);
+}
+
+static inline void
+change_sign24_swap_bytes_be(u_char *p, int cc)
+{
+	swap_bytes_change_sign24_le(p, cc);
+}
+
+static inline void
 swap_bytes_change_sign32_le(u_char *p, int cc)
 {
 	u_char t;

Index: src/usr.bin/audio/common/audio.c
diff -u src/usr.bin/audio/common/audio.c:1.25 src/usr.bin/audio/common/audio.c:1.25.8.1
--- src/usr.bin/audio/common/audio.c:1.25	Wed Aug  5 06:54:39 2015
+++ src/usr.bin/audio/common/audio.c	Tue Mar 12 12:47:40 2024
@@ -1,7 +1,7 @@
-/*	$NetBSD: audio.c,v 1.25 2015/08/05 06:54:39 mrg Exp $	*/
+/*	$NetBSD: audio.c,v 1.25.8.1 2024/03/12 12:47:40 martin Exp $	*/
 
 /*
- * Copyright (c) 1999 Matthew R. Green
+ * Copyright (c) 1999, 2013, 2015, 2019 Matthew R. Green
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -32,7 +32,7 @@
 #include 
 
 #ifndef lint
-__RCSID("$NetBSD: audio.c,v 1.25 2015/08/05 06:54:39 mrg Exp $");
+__RCSID("$NetBSD: audio.c,v 1.25.8.1 2024/03/12 12:47:40 martin Exp $");
 #endif
 
 
@@ -110,6 +110,8 @@ static const struct {
 	{ AudioEmpeg_l2_packets,AUDIO_ENCODING_MPEG_L2_PACKETS },
 	{ AudioEmpeg_l2_system,	AUDIO_ENCODING_MPEG_L2_SYSTEM },
 	{ AudioEac3,		AUDIO_ENCODING_AC3 },
+	{ "ieee_float32",	AUDIO_ENCODING_LIBAUDIO_FLOAT32 },
+	{ "ieee_float64",	AUDIO_ENCODING_LIBAUDIO_FLOAT64 },
 	{ NULL, -1 }
 };
 
@@ -203,7 +205,7 @@ write_header(struct track_info *ti)
 
 	veclen = 0;
 	tlen = 0;

CVS commit: [netbsd-8] src/usr.bin/audio

2024-03-12 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Mar 12 12:47:41 UTC 2024

Modified Files:
src/usr.bin/audio/common [netbsd-8]: auconv.h audio.c decode.c
libaudio.h sun.c wav.c
src/usr.bin/audio/play [netbsd-8]: audioplay.1 play.c
src/usr.bin/audio/record [netbsd-8]: audiorecord.1 record.c

Log Message:
Pull up the following revisions, requested by mrg in ticket #1948:

usr.bin/audio/common/auconv.h   up to 1.6
usr.bin/audio/common/audio.cup to 1.27
usr.bin/audio/common/decode.c   up to 1.2
usr.bin/audio/common/libaudio.h up to 1.22
usr.bin/audio/common/sun.c  up to 1.11
usr.bin/audio/common/wav.c  up to 1.22
usr.bin/audio/play/audioplay.1  up to 1.34
usr.bin/audio/play/play.c   up to 1.64
usr.bin/audio/record/audiorecord.1  up to 1.45
usr.bin/audio/record/record.c   up to 1.58

- support for playing 32-bit and 64-bit IEEE FP .wav files
- support for recording 24 bit .wav files
- read-overflow fixes for .wav files, and other fixes for the
  wav parser
- audioplay gains -n flag (no play, like make -n)
- audiorecord manual gained useful examples


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.5.54.1 src/usr.bin/audio/common/auconv.h
cvs rdiff -u -r1.25 -r1.25.8.1 src/usr.bin/audio/common/audio.c
cvs rdiff -u -r1.1 -r1.1.8.1 src/usr.bin/audio/common/decode.c
cvs rdiff -u -r1.20 -r1.20.8.1 src/usr.bin/audio/common/libaudio.h
cvs rdiff -u -r1.9 -r1.9.8.1 src/usr.bin/audio/common/sun.c
cvs rdiff -u -r1.13.8.1 -r1.13.8.2 src/usr.bin/audio/common/wav.c
cvs rdiff -u -r1.26 -r1.26.18.1 src/usr.bin/audio/play/audioplay.1
cvs rdiff -u -r1.55 -r1.55.8.1 src/usr.bin/audio/play/play.c
cvs rdiff -u -r1.42 -r1.42.18.1 src/usr.bin/audio/record/audiorecord.1
cvs rdiff -u -r1.54 -r1.54.8.1 src/usr.bin/audio/record/record.c

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



CVS commit: [netbsd-9] src/doc

2024-03-12 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Mar 12 12:45:42 UTC 2024

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

Log Message:
Tickets #1807 and #1818


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.140 -r1.1.2.141 src/doc/CHANGES-9.4

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



CVS commit: [netbsd-9] src/usr.bin/audio

2024-03-12 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Mar 12 12:41:39 UTC 2024

Modified Files:
src/usr.bin/audio/common [netbsd-9]: auconv.h audio.c decode.c
libaudio.h sun.c wav.c
src/usr.bin/audio/ctl [netbsd-9]: audioctl.1
src/usr.bin/audio/play [netbsd-9]: audioplay.1 play.c
src/usr.bin/audio/record [netbsd-9]: audiorecord.1 record.c

Log Message:
Pull up the following revisions, requested by mrg in ticket #1818:

usr.bin/audio/common/auconv.h   up to 1.6
usr.bin/audio/common/audio.cup to 1.27
usr.bin/audio/common/decode.c   up to 1.2
usr.bin/audio/common/libaudio.h up to 1.22
usr.bin/audio/common/sun.c  up to 1.11
usr.bin/audio/common/wav.c  up to 1.22
usr.bin/audio/ctl/audioctl.1up to 1.25
usr.bin/audio/play/audioplay.1  up to 1.34
usr.bin/audio/play/play.c   up to 1.64
usr.bin/audio/record/audiorecord.1  up to 1.45
usr.bin/audio/record/record.c   up to 1.58

- support for playing 32-bit and 64-bit IEEE FP .wav files
- support for recording 24 bit .wav files
- read-overflow fixes for .wav files, and other fixes for the
  wav parser
- audioplay gains -n flag (no play, like make -n)
- audioctl manual spruced up
- audiorecord manual gained useful examples


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.5.64.1 src/usr.bin/audio/common/auconv.h
cvs rdiff -u -r1.25 -r1.25.18.1 src/usr.bin/audio/common/audio.c
cvs rdiff -u -r1.1 -r1.1.18.1 src/usr.bin/audio/common/decode.c
cvs rdiff -u -r1.20 -r1.20.18.1 src/usr.bin/audio/common/libaudio.h
cvs rdiff -u -r1.9 -r1.9.18.1 src/usr.bin/audio/common/sun.c
cvs rdiff -u -r1.14 -r1.14.6.1 src/usr.bin/audio/common/wav.c
cvs rdiff -u -r1.23 -r1.23.2.1 src/usr.bin/audio/ctl/audioctl.1
cvs rdiff -u -r1.26.28.1 -r1.26.28.2 src/usr.bin/audio/play/audioplay.1
cvs rdiff -u -r1.57 -r1.57.2.1 src/usr.bin/audio/play/play.c
cvs rdiff -u -r1.42 -r1.42.28.1 src/usr.bin/audio/record/audiorecord.1
cvs rdiff -u -r1.54 -r1.54.18.1 src/usr.bin/audio/record/record.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/audio/common/auconv.h
diff -u src/usr.bin/audio/common/auconv.h:1.5 src/usr.bin/audio/common/auconv.h:1.5.64.1
--- src/usr.bin/audio/common/auconv.h:1.5	Mon Apr 28 20:24:12 2008
+++ src/usr.bin/audio/common/auconv.h	Tue Mar 12 12:41:38 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: auconv.h,v 1.5 2008/04/28 20:24:12 martin Exp $	*/
+/*	$NetBSD: auconv.h,v 1.5.64.1 2024/03/12 12:41:38 martin Exp $	*/
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -78,6 +78,24 @@ change_sign16_be(u_char *p, int cc)
 }
 
 static inline void
+change_sign24_le(u_char *p, int cc)
+{
+	while ((cc -= 3) >= 0) {
+		p[2] ^= 0x80;
+		p += 3;
+	}
+}
+
+static inline void
+change_sign24_be(u_char *p, int cc)
+{
+	while ((cc -= 3) >= 0) {
+		p[0] ^= 0x80;
+		p += 3;
+	}
+}
+
+static inline void
 change_sign32_le(u_char *p, int cc)
 {
 	while ((cc -= 4) >= 0) {
@@ -163,6 +181,44 @@ change_sign16_swap_bytes_be(u_char *p, i
 }
 
 static inline void
+swap_bytes_change_sign24_le(u_char *p, int cc)
+{
+	u_char t;
+
+	while ((cc -= 3) >= 0) {
+		t = p[2];
+		p[2] = p[0] ^ 0x80;
+		p[0] = t;
+		p += 3;
+	}
+}
+
+static inline void
+swap_bytes_change_sign24_be(u_char *p, int cc)
+{
+	u_char t;
+
+	while ((cc -= 3) >= 0) {
+		t = p[0];
+		p[0] = p[2] ^ 0x80;
+		p[2] = t;
+		p += 3;
+	}
+}
+
+static inline void
+change_sign24_swap_bytes_le(u_char *p, int cc)
+{
+	swap_bytes_change_sign24_be(p, cc);
+}
+
+static inline void
+change_sign24_swap_bytes_be(u_char *p, int cc)
+{
+	swap_bytes_change_sign24_le(p, cc);
+}
+
+static inline void
 swap_bytes_change_sign32_le(u_char *p, int cc)
 {
 	u_char t;

Index: src/usr.bin/audio/common/audio.c
diff -u src/usr.bin/audio/common/audio.c:1.25 src/usr.bin/audio/common/audio.c:1.25.18.1
--- src/usr.bin/audio/common/audio.c:1.25	Wed Aug  5 06:54:39 2015
+++ src/usr.bin/audio/common/audio.c	Tue Mar 12 12:41:38 2024
@@ -1,7 +1,7 @@
-/*	$NetBSD: audio.c,v 1.25 2015/08/05 06:54:39 mrg Exp $	*/
+/*	$NetBSD: audio.c,v 1.25.18.1 2024/03/12 12:41:38 martin Exp $	*/
 
 /*
- * Copyright (c) 1999 Matthew R. Green
+ * Copyright (c) 1999, 2013, 2015, 2019 Matthew R. Green
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -32,7 +32,7 @@
 #include 
 
 #ifndef lint
-__RCSID("$NetBSD: audio.c,v 1.25 2015/08/05 06:54:39 mrg Exp $");
+__RCSID("$NetBSD: audio.c,v 1.25.18.1 2024/03/12 12:41:38 martin Exp $");
 #endif
 
 
@@ -110,6 +110,8 @@ static const struct {
 	{ AudioEmpeg_l2_packets,AUDIO_ENCODING_MPEG_L2_PACKETS },
 	{ AudioEmpeg_l2_system,	AUDIO_ENCODING_MPEG_L2_SYSTEM },
 	{ AudioEac3,		

CVS commit: [netbsd-9] src/usr.bin/audio

2024-03-12 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Mar 12 12:41:39 UTC 2024

Modified Files:
src/usr.bin/audio/common [netbsd-9]: auconv.h audio.c decode.c
libaudio.h sun.c wav.c
src/usr.bin/audio/ctl [netbsd-9]: audioctl.1
src/usr.bin/audio/play [netbsd-9]: audioplay.1 play.c
src/usr.bin/audio/record [netbsd-9]: audiorecord.1 record.c

Log Message:
Pull up the following revisions, requested by mrg in ticket #1818:

usr.bin/audio/common/auconv.h   up to 1.6
usr.bin/audio/common/audio.cup to 1.27
usr.bin/audio/common/decode.c   up to 1.2
usr.bin/audio/common/libaudio.h up to 1.22
usr.bin/audio/common/sun.c  up to 1.11
usr.bin/audio/common/wav.c  up to 1.22
usr.bin/audio/ctl/audioctl.1up to 1.25
usr.bin/audio/play/audioplay.1  up to 1.34
usr.bin/audio/play/play.c   up to 1.64
usr.bin/audio/record/audiorecord.1  up to 1.45
usr.bin/audio/record/record.c   up to 1.58

- support for playing 32-bit and 64-bit IEEE FP .wav files
- support for recording 24 bit .wav files
- read-overflow fixes for .wav files, and other fixes for the
  wav parser
- audioplay gains -n flag (no play, like make -n)
- audioctl manual spruced up
- audiorecord manual gained useful examples


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.5.64.1 src/usr.bin/audio/common/auconv.h
cvs rdiff -u -r1.25 -r1.25.18.1 src/usr.bin/audio/common/audio.c
cvs rdiff -u -r1.1 -r1.1.18.1 src/usr.bin/audio/common/decode.c
cvs rdiff -u -r1.20 -r1.20.18.1 src/usr.bin/audio/common/libaudio.h
cvs rdiff -u -r1.9 -r1.9.18.1 src/usr.bin/audio/common/sun.c
cvs rdiff -u -r1.14 -r1.14.6.1 src/usr.bin/audio/common/wav.c
cvs rdiff -u -r1.23 -r1.23.2.1 src/usr.bin/audio/ctl/audioctl.1
cvs rdiff -u -r1.26.28.1 -r1.26.28.2 src/usr.bin/audio/play/audioplay.1
cvs rdiff -u -r1.57 -r1.57.2.1 src/usr.bin/audio/play/play.c
cvs rdiff -u -r1.42 -r1.42.28.1 src/usr.bin/audio/record/audiorecord.1
cvs rdiff -u -r1.54 -r1.54.18.1 src/usr.bin/audio/record/record.c

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



CVS commit: [netbsd-8] src/sys/dev/usb

2024-03-12 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Mar 12 12:36:17 UTC 2024

Modified Files:
src/sys/dev/usb [netbsd-8]: usbdi.c

Log Message:
Pull up following revision(s) (requested by riastradh in ticket #1940):

sys/dev/usb/usbdi.c: revision 1.248

usbdi(9): Avoid calling ubm_softint with lock held and polling on.

PR kern/57783


To generate a diff of this commit:
cvs rdiff -u -r1.173.2.5 -r1.173.2.6 src/sys/dev/usb/usbdi.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/usb/usbdi.c
diff -u src/sys/dev/usb/usbdi.c:1.173.2.5 src/sys/dev/usb/usbdi.c:1.173.2.6
--- src/sys/dev/usb/usbdi.c:1.173.2.5	Fri Jan 11 15:52:24 2019
+++ src/sys/dev/usb/usbdi.c	Tue Mar 12 12:36:17 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: usbdi.c,v 1.173.2.5 2019/01/11 15:52:24 martin Exp $	*/
+/*	$NetBSD: usbdi.c,v 1.173.2.6 2024/03/12 12:36:17 martin Exp $	*/
 
 /*
  * Copyright (c) 1998, 2012, 2015 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: usbdi.c,v 1.173.2.5 2019/01/11 15:52:24 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: usbdi.c,v 1.173.2.6 2024/03/12 12:36:17 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -1169,14 +1169,34 @@ usbd_dopoll(struct usbd_interface *iface
 void
 usbd_set_polling(struct usbd_device *dev, int on)
 {
-	if (on)
-		dev->ud_bus->ub_usepolling++;
-	else
-		dev->ud_bus->ub_usepolling--;
 
-	/* Kick the host controller when switching modes */
 	mutex_enter(dev->ud_bus->ub_lock);
-	dev->ud_bus->ub_methods->ubm_softint(dev->ud_bus);
+	if (on) {
+		/*
+		 * Enabling polling.  If we're enabling for the first
+		 * time, call the softint routine on transition while
+		 * we hold the lock and polling is still disabled, and
+		 * then enable polling -- once polling is enabled, we
+		 * must not hold the lock when we call the softint
+		 * routine.
+		 */
+		KASSERT(dev->ud_bus->ub_usepolling < __type_max(char));
+		if (dev->ud_bus->ub_usepolling == 0)
+			dev->ud_bus->ub_methods->ubm_softint(dev->ud_bus);
+		dev->ud_bus->ub_usepolling++;
+	} else {
+		/*
+		 * Disabling polling.  If we're disabling polling for
+		 * the last time, disable polling first and then call
+		 * the softint routine while we hold the lock -- until
+		 * polling is disabled, we must not hold the lock when
+		 * we call the softint routine.
+		 */
+		KASSERT(dev->ud_bus->ub_usepolling > 0);
+		dev->ud_bus->ub_usepolling--;
+		if (dev->ud_bus->ub_usepolling == 0)
+			dev->ud_bus->ub_methods->ubm_softint(dev->ud_bus);
+	}
 	mutex_exit(dev->ud_bus->ub_lock);
 }
 



CVS commit: [netbsd-8] src/sys/dev/usb

2024-03-12 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Mar 12 12:36:17 UTC 2024

Modified Files:
src/sys/dev/usb [netbsd-8]: usbdi.c

Log Message:
Pull up following revision(s) (requested by riastradh in ticket #1940):

sys/dev/usb/usbdi.c: revision 1.248

usbdi(9): Avoid calling ubm_softint with lock held and polling on.

PR kern/57783


To generate a diff of this commit:
cvs rdiff -u -r1.173.2.5 -r1.173.2.6 src/sys/dev/usb/usbdi.c

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



CVS commit: [netbsd-9] src/sys/dev/usb

2024-03-12 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Mar 12 12:34:50 UTC 2024

Modified Files:
src/sys/dev/usb [netbsd-9]: usbdi.c

Log Message:
Pull up following revision(s) (requested by riastradh in ticket #1807):

sys/dev/usb/usbdi.c: revision 1.248

usbdi(9): Avoid calling ubm_softint with lock held and polling on.

PR kern/57783


To generate a diff of this commit:
cvs rdiff -u -r1.182.4.5 -r1.182.4.6 src/sys/dev/usb/usbdi.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/usb/usbdi.c
diff -u src/sys/dev/usb/usbdi.c:1.182.4.5 src/sys/dev/usb/usbdi.c:1.182.4.6
--- src/sys/dev/usb/usbdi.c:1.182.4.5	Sat Jul 18 15:09:28 2020
+++ src/sys/dev/usb/usbdi.c	Tue Mar 12 12:34:50 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: usbdi.c,v 1.182.4.5 2020/07/18 15:09:28 martin Exp $	*/
+/*	$NetBSD: usbdi.c,v 1.182.4.6 2024/03/12 12:34:50 martin Exp $	*/
 
 /*
  * Copyright (c) 1998, 2012, 2015 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: usbdi.c,v 1.182.4.5 2020/07/18 15:09:28 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: usbdi.c,v 1.182.4.6 2024/03/12 12:34:50 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -1229,14 +1229,34 @@ usbd_dopoll(struct usbd_interface *iface
 void
 usbd_set_polling(struct usbd_device *dev, int on)
 {
-	if (on)
-		dev->ud_bus->ub_usepolling++;
-	else
-		dev->ud_bus->ub_usepolling--;
 
-	/* Kick the host controller when switching modes */
 	mutex_enter(dev->ud_bus->ub_lock);
-	dev->ud_bus->ub_methods->ubm_softint(dev->ud_bus);
+	if (on) {
+		/*
+		 * Enabling polling.  If we're enabling for the first
+		 * time, call the softint routine on transition while
+		 * we hold the lock and polling is still disabled, and
+		 * then enable polling -- once polling is enabled, we
+		 * must not hold the lock when we call the softint
+		 * routine.
+		 */
+		KASSERT(dev->ud_bus->ub_usepolling < __type_max(char));
+		if (dev->ud_bus->ub_usepolling == 0)
+			dev->ud_bus->ub_methods->ubm_softint(dev->ud_bus);
+		dev->ud_bus->ub_usepolling++;
+	} else {
+		/*
+		 * Disabling polling.  If we're disabling polling for
+		 * the last time, disable polling first and then call
+		 * the softint routine while we hold the lock -- until
+		 * polling is disabled, we must not hold the lock when
+		 * we call the softint routine.
+		 */
+		KASSERT(dev->ud_bus->ub_usepolling > 0);
+		dev->ud_bus->ub_usepolling--;
+		if (dev->ud_bus->ub_usepolling == 0)
+			dev->ud_bus->ub_methods->ubm_softint(dev->ud_bus);
+	}
 	mutex_exit(dev->ud_bus->ub_lock);
 }
 



CVS commit: [netbsd-9] src/sys/dev/usb

2024-03-12 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Mar 12 12:34:50 UTC 2024

Modified Files:
src/sys/dev/usb [netbsd-9]: usbdi.c

Log Message:
Pull up following revision(s) (requested by riastradh in ticket #1807):

sys/dev/usb/usbdi.c: revision 1.248

usbdi(9): Avoid calling ubm_softint with lock held and polling on.

PR kern/57783


To generate a diff of this commit:
cvs rdiff -u -r1.182.4.5 -r1.182.4.6 src/sys/dev/usb/usbdi.c

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



CVS commit: [netbsd-10] src

2024-03-12 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Mar 12 10:19:02 UTC 2024

Modified Files:
src/doc [netbsd-10]: CHANGES-10.0
src/external/gpl2/groff/tmac [netbsd-10]: mdoc.local
src/sys/sys [netbsd-10]: param.h

Log Message:
Welcome to 10.0 RC6


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.211 -r1.1.2.212 src/doc/CHANGES-10.0
cvs rdiff -u -r1.7.6.6 -r1.7.6.7 src/external/gpl2/groff/tmac/mdoc.local
cvs rdiff -u -r1.722.2.6 -r1.722.2.7 src/sys/sys/param.h

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-10.0
diff -u src/doc/CHANGES-10.0:1.1.2.211 src/doc/CHANGES-10.0:1.1.2.212
--- src/doc/CHANGES-10.0:1.1.2.211	Tue Mar 12 10:14:28 2024
+++ src/doc/CHANGES-10.0	Tue Mar 12 10:19:02 2024
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-10.0,v 1.1.2.211 2024/03/12 10:14:28 martin Exp $
+# $NetBSD: CHANGES-10.0,v 1.1.2.212 2024/03/12 10:19:02 martin Exp $
 
 A complete list of changes from the initial NetBSD 10.0 branch on 2022-12-16
 until the 10.0 release:
@@ -21441,3 +21441,8 @@ usr.bin/kdump/kdump.c1.141-1.144
 	Decode some {g,s}etsockopt*.
 	[kre, ticket #635]
 
+external/gpl2/groff/tmac/mdoc.local		(manually edited)
+sys/sys/param.h (manually edited)
+
+	Welcome to 10.0_RC6
+

Index: src/external/gpl2/groff/tmac/mdoc.local
diff -u src/external/gpl2/groff/tmac/mdoc.local:1.7.6.6 src/external/gpl2/groff/tmac/mdoc.local:1.7.6.7
--- src/external/gpl2/groff/tmac/mdoc.local:1.7.6.6	Tue Feb 27 05:27:39 2024
+++ src/external/gpl2/groff/tmac/mdoc.local	Tue Mar 12 10:19:02 2024
@@ -1,4 +1,4 @@
-.\" $NetBSD: mdoc.local,v 1.7.6.6 2024/02/27 05:27:39 martin Exp $
+.\" $NetBSD: mdoc.local,v 1.7.6.7 2024/03/12 10:19:02 martin Exp $
 .\"
 .\" Copyright (c) 2003, 2004 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -46,7 +46,7 @@
 .\" Default .Os value
 .ds doc-operating-system NetBSD\~10.0_BETA
 .\" Default footer operating system value
-.ds doc-default-operating-system NetBSD\~10.0_RC5
+.ds doc-default-operating-system NetBSD\~10.0_RC6
 .\" Other known versions, not yet in groff distribution
 .ds doc-operating-system-NetBSD-1.3.3  1.3.3
 .ds doc-operating-system-NetBSD-1.6.3  1.6.3

Index: src/sys/sys/param.h
diff -u src/sys/sys/param.h:1.722.2.6 src/sys/sys/param.h:1.722.2.7
--- src/sys/sys/param.h:1.722.2.6	Tue Feb 27 05:27:39 2024
+++ src/sys/sys/param.h	Tue Mar 12 10:19:01 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: param.h,v 1.722.2.6 2024/02/27 05:27:39 martin Exp $	*/
+/*	$NetBSD: param.h,v 1.722.2.7 2024/03/12 10:19:01 martin Exp $	*/
 
 /*-
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -67,7 +67,7 @@
  *	2.99.9		(299000900)
  */
 
-#define	__NetBSD_Version__	10	/* NetBSD 10.0_RC5 */
+#define	__NetBSD_Version__	10	/* NetBSD 10.0_RC6 */
 
 #define __NetBSD_Prereq__(M,m,p) (M) * 1) + \
 (m) * 100) + (p) * 100) <= __NetBSD_Version__)



CVS commit: [netbsd-10] src

2024-03-12 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Mar 12 10:19:02 UTC 2024

Modified Files:
src/doc [netbsd-10]: CHANGES-10.0
src/external/gpl2/groff/tmac [netbsd-10]: mdoc.local
src/sys/sys [netbsd-10]: param.h

Log Message:
Welcome to 10.0 RC6


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.211 -r1.1.2.212 src/doc/CHANGES-10.0
cvs rdiff -u -r1.7.6.6 -r1.7.6.7 src/external/gpl2/groff/tmac/mdoc.local
cvs rdiff -u -r1.722.2.6 -r1.722.2.7 src/sys/sys/param.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/doc

2024-03-12 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Mar 12 10:15:04 UTC 2024

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

Log Message:
Ticket #1817


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.139 -r1.1.2.140 src/doc/CHANGES-9.4

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.4
diff -u src/doc/CHANGES-9.4:1.1.2.139 src/doc/CHANGES-9.4:1.1.2.140
--- src/doc/CHANGES-9.4:1.1.2.139	Mon Mar 11 20:04:38 2024
+++ src/doc/CHANGES-9.4	Tue Mar 12 10:15:04 2024
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-9.4,v 1.1.2.139 2024/03/11 20:04:38 martin Exp $
+# $NetBSD: CHANGES-9.4,v 1.1.2.140 2024/03/12 10:15:04 martin Exp $
 
 A complete list of changes from the NetBSD 9.3 release to the NetBSD 9.4
 release:
@@ -13464,3 +13464,8 @@ lib/libc/gen/getcap.c1.58
 	libc: fix memory leak in getent().
 	[ozaki-r, ticket #1816]
 
+sys/dev/ic/nvme.c1.69
+
+	nvme(4): PR 58025: fix nvmectl(8) after suspend/resume cycle.
+	[riastradh, ticket #1817]
+



CVS commit: [netbsd-9] src/doc

2024-03-12 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Mar 12 10:15:04 UTC 2024

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

Log Message:
Ticket #1817


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.139 -r1.1.2.140 src/doc/CHANGES-9.4

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



CVS commit: [netbsd-10] src/doc

2024-03-12 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Mar 12 10:14:28 UTC 2024

Modified Files:
src/doc [netbsd-10]: CHANGES-10.0

Log Message:
Tickets #633 - #635


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.210 -r1.1.2.211 src/doc/CHANGES-10.0

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



CVS commit: [netbsd-10] src/doc

2024-03-12 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Mar 12 10:14:28 UTC 2024

Modified Files:
src/doc [netbsd-10]: CHANGES-10.0

Log Message:
Tickets #633 - #635


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.210 -r1.1.2.211 src/doc/CHANGES-10.0

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-10.0
diff -u src/doc/CHANGES-10.0:1.1.2.210 src/doc/CHANGES-10.0:1.1.2.211
--- src/doc/CHANGES-10.0:1.1.2.210	Mon Mar 11 20:11:22 2024
+++ src/doc/CHANGES-10.0	Tue Mar 12 10:14:28 2024
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-10.0,v 1.1.2.210 2024/03/11 20:11:22 martin Exp $
+# $NetBSD: CHANGES-10.0,v 1.1.2.211 2024/03/12 10:14:28 martin Exp $
 
 A complete list of changes from the initial NetBSD 10.0 branch on 2022-12-16
 until the 10.0 release:
@@ -21412,3 +21412,32 @@ sys/dev/pci/xhci_pci.c1.33
 	chipset tag value.
 	[riastradh, ticket #632]
 
+sys/dev/ic/nvme.c1.69
+
+	nvme(4): PR 58025: fix nvmectl(8) after suspend/resume cycle.
+	[riastradh, ticket #633]
+
+usr.bin/audio/common/auconv.h   up to 1.6
+usr.bin/audio/common/audio.cup to 1.27
+usr.bin/audio/common/decode.c   up to 1.2
+usr.bin/audio/common/libaudio.h up to 1.22
+usr.bin/audio/common/sun.c  up to 1.11
+usr.bin/audio/common/wav.c  up to 1.22
+usr.bin/audio/play/audioplay.1  up to 1.34
+usr.bin/audio/play/play.c   up to 1.64
+usr.bin/audio/record/audiorecord.1  up to 1.45
+usr.bin/audio/record/record.c   up to 1.58
+
+	audioplay(1), audioctl(1), audiorecord(1):
+	- support for recording 24 bit .wav files
+	- read-overflow fixes for .wav files, and other fixes for the
+	  wav parser  
+	- audioplay gains -n flag (no play, like make -n)
+	[mrg, ticket #634]
+
+usr.bin/kdump/kdump.c1.141-1.144
+
+	kdump(1): PR 57918: fix decoding of sign extended ioctl codes.
+	Decode some {g,s}etsockopt*.
+	[kre, ticket #635]
+



CVS commit: [netbsd-10] src/usr.bin/kdump

2024-03-12 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Mar 12 10:13:05 UTC 2024

Modified Files:
src/usr.bin/kdump [netbsd-10]: kdump.c

Log Message:
Pull up following revision(s) (requested by kre in ticket #635):

usr.bin/kdump/kdump.c: revision 1.141
usr.bin/kdump/kdump.c: revision 1.142
usr.bin/kdump/kdump.c: revision 1.143
usr.bin/kdump/kdump.c: revision 1.144

PR/57918: Taylor R Campbell: Don't try to print symbolically ioctls that
have bits set on the high 32 bits of a 64 bit long.

PR bin/57918

Redo the previous correctly, the test should be whether or not only the
bottom 32 bits are set, rather than whether any of bits 32..63 are set.

This makes no difference if u_long (or unsigned long long) is 64 bits,
it is the same test in that case, but if u_long were 128 bits there is
a notable difference (though for the particular issue observed in the PR,
it is likely to work either way).
decode some {g,s}etsockopt*.

kdump: keep the comment with its corresponding code
No binary change.


To generate a diff of this commit:
cvs rdiff -u -r1.140 -r1.140.2.1 src/usr.bin/kdump/kdump.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/kdump/kdump.c
diff -u src/usr.bin/kdump/kdump.c:1.140 src/usr.bin/kdump/kdump.c:1.140.2.1
--- src/usr.bin/kdump/kdump.c:1.140	Sun Jun 20 00:25:29 2021
+++ src/usr.bin/kdump/kdump.c	Tue Mar 12 10:13:05 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: kdump.c,v 1.140 2021/06/20 00:25:29 chs Exp $	*/
+/*	$NetBSD: kdump.c,v 1.140.2.1 2024/03/12 10:13:05 martin Exp $	*/
 
 /*-
  * Copyright (c) 1988, 1993
@@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1988, 19
 #if 0
 static char sccsid[] = "@(#)kdump.c	8.4 (Berkeley) 4/28/95";
 #else
-__RCSID("$NetBSD: kdump.c,v 1.140 2021/06/20 00:25:29 chs Exp $");
+__RCSID("$NetBSD: kdump.c,v 1.140.2.1 2024/03/12 10:13:05 martin Exp $");
 #endif
 #endif /* not lint */
 
@@ -69,11 +69,16 @@ __RCSID("$NetBSD: kdump.c,v 1.140 2021/0
 #include 
 #include 
 
+#include 
+#include 
+
 #include "ktrace.h"
 #include "setemul.h"
 
 #include 
 
+#define	CASERETURN(a)	case a:	return # a
+
 #define TIMESTAMP_NONE		0x0
 #define TIMESTAMP_ABSOLUTE	0x1
 #define TIMESTAMP_ELAPSED	0x2
@@ -552,23 +557,152 @@ output_long(u_long it, int as_x)
 static const char *
 fcntlname(u_long cmd)
 {
-#define	FCNTLCASE(a)	case a:	return # a
 	switch (cmd) {
-	FCNTLCASE(F_DUPFD);
-	FCNTLCASE(F_GETFD);
-	FCNTLCASE(F_SETFD);
-	FCNTLCASE(F_GETFL);
-	FCNTLCASE(F_SETFL);
-	FCNTLCASE(F_GETOWN);
-	FCNTLCASE(F_SETOWN);
-	FCNTLCASE(F_GETLK);
-	FCNTLCASE(F_SETLK);
-	FCNTLCASE(F_SETLKW);
-	FCNTLCASE(F_CLOSEM);
-	FCNTLCASE(F_MAXFD);
-	FCNTLCASE(F_DUPFD_CLOEXEC);
-	FCNTLCASE(F_GETNOSIGPIPE);
-	FCNTLCASE(F_SETNOSIGPIPE);
+	CASERETURN(F_DUPFD);
+	CASERETURN(F_GETFD);
+	CASERETURN(F_SETFD);
+	CASERETURN(F_GETFL);
+	CASERETURN(F_SETFL);
+	CASERETURN(F_GETOWN);
+	CASERETURN(F_SETOWN);
+	CASERETURN(F_GETLK);
+	CASERETURN(F_SETLK);
+	CASERETURN(F_SETLKW);
+	CASERETURN(F_CLOSEM);
+	CASERETURN(F_MAXFD);
+	CASERETURN(F_DUPFD_CLOEXEC);
+	CASERETURN(F_GETNOSIGPIPE);
+	CASERETURN(F_SETNOSIGPIPE);
+	default:
+		return NULL;
+	}
+}
+
+static const char *
+sockproto(register_t proto)
+{
+	switch (proto) {
+	CASERETURN(IPPROTO_IP);
+	CASERETURN(IPPROTO_ICMP);
+	CASERETURN(IPPROTO_IGMP);
+	CASERETURN(IPPROTO_GGP);
+//	CASERETURN(IPPROTO_IPV4);
+	CASERETURN(IPPROTO_IPIP);
+	CASERETURN(IPPROTO_TCP);
+	CASERETURN(IPPROTO_EGP);
+	CASERETURN(IPPROTO_PUP);
+	CASERETURN(IPPROTO_UDP);
+	CASERETURN(IPPROTO_IDP);
+	CASERETURN(IPPROTO_TP);
+	CASERETURN(IPPROTO_DCCP);
+	CASERETURN(IPPROTO_IPV6);
+	CASERETURN(IPPROTO_ROUTING);
+	CASERETURN(IPPROTO_FRAGMENT);
+	CASERETURN(IPPROTO_RSVP);
+	CASERETURN(IPPROTO_GRE);
+	CASERETURN(IPPROTO_ESP);
+	CASERETURN(IPPROTO_AH);
+	CASERETURN(IPPROTO_MOBILE);
+//	CASERETURN(IPPROTO_IPV6_ICMP);
+	CASERETURN(IPPROTO_ICMPV6);
+	CASERETURN(IPPROTO_NONE);
+	CASERETURN(IPPROTO_DSTOPTS);
+	CASERETURN(IPPROTO_EON);
+	CASERETURN(IPPROTO_ETHERIP);
+	CASERETURN(IPPROTO_ENCAP);
+	CASERETURN(IPPROTO_PIM);
+	CASERETURN(IPPROTO_IPCOMP);
+	CASERETURN(IPPROTO_VRRP);
+//	CASERETURN(IPPROTO_CARP);
+	CASERETURN(IPPROTO_L2TP);
+	CASERETURN(IPPROTO_SCTP);
+	CASERETURN(IPPROTO_PFSYNC);
+	CASERETURN(IPPROTO_RAW);
+	CASERETURN(IPPROTO_MAX);
+	CASERETURN(IPPROTO_DONE);
+	CASERETURN(SOL_SOCKET);
+	default:
+		return NULL;
+	}
+}
+
+static const char *
+sockoptname(register_t optname)
+{
+	switch (optname) {
+	CASERETURN(SO_ACCEPTCONN);
+	CASERETURN(SO_ACCEPTFILTER);
+	CASERETURN(SO_BROADCAST);
+	CASERETURN(SO_DEBUG);
+	CASERETURN(SO_DONTROUTE);
+	CASERETURN(SO_ERROR);
+	CASERETURN(SO_KEEPALIVE);
+	CASERETURN(SO_LINGER);
+	CASERETURN(SO_NOHEADER);
+	CASERETURN(SO_NOSIGPIPE);
+	CASERETURN(SO_OOBINLINE);
+	CASERETURN(SO_OVERFLOWED);
+	CASERETURN(SO_RCVBUF);
+	CASERETURN(SO_RCVLOWAT);
+	CASERETURN(SO_RCVTIMEO);
+	CASERETURN(SO_RERROR);
+	CASERETURN(SO_REUSEADDR);
+	

CVS commit: [netbsd-10] src/usr.bin/kdump

2024-03-12 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Mar 12 10:13:05 UTC 2024

Modified Files:
src/usr.bin/kdump [netbsd-10]: kdump.c

Log Message:
Pull up following revision(s) (requested by kre in ticket #635):

usr.bin/kdump/kdump.c: revision 1.141
usr.bin/kdump/kdump.c: revision 1.142
usr.bin/kdump/kdump.c: revision 1.143
usr.bin/kdump/kdump.c: revision 1.144

PR/57918: Taylor R Campbell: Don't try to print symbolically ioctls that
have bits set on the high 32 bits of a 64 bit long.

PR bin/57918

Redo the previous correctly, the test should be whether or not only the
bottom 32 bits are set, rather than whether any of bits 32..63 are set.

This makes no difference if u_long (or unsigned long long) is 64 bits,
it is the same test in that case, but if u_long were 128 bits there is
a notable difference (though for the particular issue observed in the PR,
it is likely to work either way).
decode some {g,s}etsockopt*.

kdump: keep the comment with its corresponding code
No binary change.


To generate a diff of this commit:
cvs rdiff -u -r1.140 -r1.140.2.1 src/usr.bin/kdump/kdump.c

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



CVS commit: [netbsd-10] src/usr.bin/audio

2024-03-12 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Mar 12 10:04:23 UTC 2024

Modified Files:
src/usr.bin/audio/common [netbsd-10]: auconv.h audio.c decode.c
libaudio.h sun.c wav.c
src/usr.bin/audio/play [netbsd-10]: audioplay.1 play.c
src/usr.bin/audio/record [netbsd-10]: audiorecord.1 record.c

Log Message:
Pull up the following revisions, requested by mrg in ticket #634:

usr.bin/audio/common/auconv.h   up to 1.6
usr.bin/audio/common/audio.cup to 1.27
usr.bin/audio/common/decode.c   up to 1.2
usr.bin/audio/common/libaudio.h up to 1.22
usr.bin/audio/common/sun.c  up to 1.11
usr.bin/audio/common/wav.c  up to 1.22
usr.bin/audio/play/audioplay.1  up to 1.34
usr.bin/audio/play/play.c   up to 1.64
usr.bin/audio/record/audiorecord.1  up to 1.45
usr.bin/audio/record/record.c   up to 1.58

- support for recording 24 bit .wav files
- read-overflow fixes for .wav files, and other fixes for the
  wav parser
- audioplay gains -n flag (no play, like make -n)


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.5.72.1 src/usr.bin/audio/common/auconv.h
cvs rdiff -u -r1.26 -r1.26.8.1 src/usr.bin/audio/common/audio.c
cvs rdiff -u -r1.1 -r1.1.26.1 src/usr.bin/audio/common/decode.c
cvs rdiff -u -r1.21 -r1.21.8.1 src/usr.bin/audio/common/libaudio.h
cvs rdiff -u -r1.10 -r1.10.8.1 src/usr.bin/audio/common/sun.c
cvs rdiff -u -r1.15 -r1.15.8.1 src/usr.bin/audio/common/wav.c
cvs rdiff -u -r1.30.6.1 -r1.30.6.2 src/usr.bin/audio/play/audioplay.1
cvs rdiff -u -r1.61 -r1.61.2.1 src/usr.bin/audio/play/play.c
cvs rdiff -u -r1.44 -r1.44.6.1 src/usr.bin/audio/record/audiorecord.1
cvs rdiff -u -r1.56 -r1.56.2.1 src/usr.bin/audio/record/record.c

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



CVS commit: [netbsd-10] src/usr.bin/audio

2024-03-12 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Mar 12 10:04:23 UTC 2024

Modified Files:
src/usr.bin/audio/common [netbsd-10]: auconv.h audio.c decode.c
libaudio.h sun.c wav.c
src/usr.bin/audio/play [netbsd-10]: audioplay.1 play.c
src/usr.bin/audio/record [netbsd-10]: audiorecord.1 record.c

Log Message:
Pull up the following revisions, requested by mrg in ticket #634:

usr.bin/audio/common/auconv.h   up to 1.6
usr.bin/audio/common/audio.cup to 1.27
usr.bin/audio/common/decode.c   up to 1.2
usr.bin/audio/common/libaudio.h up to 1.22
usr.bin/audio/common/sun.c  up to 1.11
usr.bin/audio/common/wav.c  up to 1.22
usr.bin/audio/play/audioplay.1  up to 1.34
usr.bin/audio/play/play.c   up to 1.64
usr.bin/audio/record/audiorecord.1  up to 1.45
usr.bin/audio/record/record.c   up to 1.58

- support for recording 24 bit .wav files
- read-overflow fixes for .wav files, and other fixes for the
  wav parser
- audioplay gains -n flag (no play, like make -n)


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.5.72.1 src/usr.bin/audio/common/auconv.h
cvs rdiff -u -r1.26 -r1.26.8.1 src/usr.bin/audio/common/audio.c
cvs rdiff -u -r1.1 -r1.1.26.1 src/usr.bin/audio/common/decode.c
cvs rdiff -u -r1.21 -r1.21.8.1 src/usr.bin/audio/common/libaudio.h
cvs rdiff -u -r1.10 -r1.10.8.1 src/usr.bin/audio/common/sun.c
cvs rdiff -u -r1.15 -r1.15.8.1 src/usr.bin/audio/common/wav.c
cvs rdiff -u -r1.30.6.1 -r1.30.6.2 src/usr.bin/audio/play/audioplay.1
cvs rdiff -u -r1.61 -r1.61.2.1 src/usr.bin/audio/play/play.c
cvs rdiff -u -r1.44 -r1.44.6.1 src/usr.bin/audio/record/audiorecord.1
cvs rdiff -u -r1.56 -r1.56.2.1 src/usr.bin/audio/record/record.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/audio/common/auconv.h
diff -u src/usr.bin/audio/common/auconv.h:1.5 src/usr.bin/audio/common/auconv.h:1.5.72.1
--- src/usr.bin/audio/common/auconv.h:1.5	Mon Apr 28 20:24:12 2008
+++ src/usr.bin/audio/common/auconv.h	Tue Mar 12 10:04:22 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: auconv.h,v 1.5 2008/04/28 20:24:12 martin Exp $	*/
+/*	$NetBSD: auconv.h,v 1.5.72.1 2024/03/12 10:04:22 martin Exp $	*/
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -78,6 +78,24 @@ change_sign16_be(u_char *p, int cc)
 }
 
 static inline void
+change_sign24_le(u_char *p, int cc)
+{
+	while ((cc -= 3) >= 0) {
+		p[2] ^= 0x80;
+		p += 3;
+	}
+}
+
+static inline void
+change_sign24_be(u_char *p, int cc)
+{
+	while ((cc -= 3) >= 0) {
+		p[0] ^= 0x80;
+		p += 3;
+	}
+}
+
+static inline void
 change_sign32_le(u_char *p, int cc)
 {
 	while ((cc -= 4) >= 0) {
@@ -163,6 +181,44 @@ change_sign16_swap_bytes_be(u_char *p, i
 }
 
 static inline void
+swap_bytes_change_sign24_le(u_char *p, int cc)
+{
+	u_char t;
+
+	while ((cc -= 3) >= 0) {
+		t = p[2];
+		p[2] = p[0] ^ 0x80;
+		p[0] = t;
+		p += 3;
+	}
+}
+
+static inline void
+swap_bytes_change_sign24_be(u_char *p, int cc)
+{
+	u_char t;
+
+	while ((cc -= 3) >= 0) {
+		t = p[0];
+		p[0] = p[2] ^ 0x80;
+		p[2] = t;
+		p += 3;
+	}
+}
+
+static inline void
+change_sign24_swap_bytes_le(u_char *p, int cc)
+{
+	swap_bytes_change_sign24_be(p, cc);
+}
+
+static inline void
+change_sign24_swap_bytes_be(u_char *p, int cc)
+{
+	swap_bytes_change_sign24_le(p, cc);
+}
+
+static inline void
 swap_bytes_change_sign32_le(u_char *p, int cc)
 {
 	u_char t;

Index: src/usr.bin/audio/common/audio.c
diff -u src/usr.bin/audio/common/audio.c:1.26 src/usr.bin/audio/common/audio.c:1.26.8.1
--- src/usr.bin/audio/common/audio.c:1.26	Sat Nov  9 12:46:44 2019
+++ src/usr.bin/audio/common/audio.c	Tue Mar 12 10:04:22 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: audio.c,v 1.26 2019/11/09 12:46:44 mrg Exp $	*/
+/*	$NetBSD: audio.c,v 1.26.8.1 2024/03/12 10:04:22 martin Exp $	*/
 
 /*
  * Copyright (c) 1999, 2013, 2015, 2019 Matthew R. Green
@@ -32,7 +32,7 @@
 #include 
 
 #ifndef lint
-__RCSID("$NetBSD: audio.c,v 1.26 2019/11/09 12:46:44 mrg Exp $");
+__RCSID("$NetBSD: audio.c,v 1.26.8.1 2024/03/12 10:04:22 martin Exp $");
 #endif
 
 
@@ -205,7 +205,7 @@ write_header(struct track_info *ti)
 
 	veclen = 0;
 	tlen = 0;
-		
+
 	if (hdrlen != 0) {
 		iv[veclen].iov_base = hdr;
 		iv[veclen].iov_len = hdrlen;

Index: src/usr.bin/audio/common/decode.c
diff -u src/usr.bin/audio/common/decode.c:1.1 src/usr.bin/audio/common/decode.c:1.1.26.1
--- src/usr.bin/audio/common/decode.c:1.1	Sun Jun 21 06:06:01 2015
+++ src/usr.bin/audio/common/decode.c	Tue Mar 12 10:04:22 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: decode.c,v 1.1 2015/06/21 06:06:01 mrg Exp $	*/
+/*	$NetBSD: decode.c,v 1.1.26.1 2024/03/12 10:04:22 martin Exp $	*/
 
 /*
  * Copyright (c) 1999 Matthew R. Green
@@ -29,7 +29,7 @@
 #include 

CVS commit: [netbsd-9] src/sys/dev/ic

2024-03-12 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Mar 12 09:59:31 UTC 2024

Modified Files:
src/sys/dev/ic [netbsd-9]: nvme.c

Log Message:
Pull up following revision(s) (requested by riastradh in ticket #1817):

sys/dev/ic/nvme.c: revision 1.69

nvme(4): Disestablish admin q interrupt while suspended.

And re-establish on resume.  Fixes nvmectl(8) after a suspend/resume
cycle on some systems.

Adapted from a patch by mrg@.

PR kern/58025


To generate a diff of this commit:
cvs rdiff -u -r1.44.2.6 -r1.44.2.7 src/sys/dev/ic/nvme.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/ic/nvme.c
diff -u src/sys/dev/ic/nvme.c:1.44.2.6 src/sys/dev/ic/nvme.c:1.44.2.7
--- src/sys/dev/ic/nvme.c:1.44.2.6	Mon Jun 21 17:25:48 2021
+++ src/sys/dev/ic/nvme.c	Tue Mar 12 09:59:31 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: nvme.c,v 1.44.2.6 2021/06/21 17:25:48 martin Exp $	*/
+/*	$NetBSD: nvme.c,v 1.44.2.7 2024/03/12 09:59:31 martin Exp $	*/
 /*	$OpenBSD: nvme.c,v 1.49 2016/04/18 05:59:50 dlg Exp $ */
 
 /*
@@ -18,7 +18,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: nvme.c,v 1.44.2.6 2021/06/21 17:25:48 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nvme.c,v 1.44.2.7 2024/03/12 09:59:31 martin Exp $");
 
 #include 
 #include 
@@ -552,7 +552,6 @@ nvme_detach(struct nvme_softc *sc, int f
 		return error;
 
 	/* from now on we are committed to detach, following will never fail */
-	sc->sc_intr_disestablish(sc, NVME_ADMIN_Q);
 	for (i = 0; i < sc->sc_nq; i++)
 		nvme_q_free(sc, sc->sc_q[i]);
 	kmem_free(sc->sc_q, sizeof(*sc->sc_q) * sc->sc_nq);
@@ -582,6 +581,11 @@ nvme_resume(struct nvme_softc *sc)
 	}
 
 	nvme_q_reset(sc, sc->sc_admin_q);
+	if (sc->sc_intr_establish(sc, NVME_ADMIN_Q, sc->sc_admin_q)) {
+		error = EIO;
+		device_printf(sc->sc_dev, "unable to establish admin q\n");
+		goto disable;
+	}
 
 	error = nvme_enable(sc, ffs(sc->sc_mps) - 1);
 	if (error) {
@@ -643,6 +647,8 @@ nvme_shutdown(struct nvme_softc *sc)
 	if (disabled)
 		goto disable;
 
+	sc->sc_intr_disestablish(sc, NVME_ADMIN_Q);
+
 	cc = nvme_read4(sc, NVME_CC);
 	CLR(cc, NVME_CC_SHN_MASK);
 	SET(cc, NVME_CC_SHN(NVME_CC_SHN_NORMAL));



CVS commit: [netbsd-9] src/sys/dev/ic

2024-03-12 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Mar 12 09:59:31 UTC 2024

Modified Files:
src/sys/dev/ic [netbsd-9]: nvme.c

Log Message:
Pull up following revision(s) (requested by riastradh in ticket #1817):

sys/dev/ic/nvme.c: revision 1.69

nvme(4): Disestablish admin q interrupt while suspended.

And re-establish on resume.  Fixes nvmectl(8) after a suspend/resume
cycle on some systems.

Adapted from a patch by mrg@.

PR kern/58025


To generate a diff of this commit:
cvs rdiff -u -r1.44.2.6 -r1.44.2.7 src/sys/dev/ic/nvme.c

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



CVS commit: [netbsd-10] src/sys/dev/ic

2024-03-12 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Mar 12 09:58:27 UTC 2024

Modified Files:
src/sys/dev/ic [netbsd-10]: nvme.c

Log Message:
Pull up following revision(s) (requested by riastradh in ticket #633):

sys/dev/ic/nvme.c: revision 1.69

nvme(4): Disestablish admin q interrupt while suspended.

And re-establish on resume.  Fixes nvmectl(8) after a suspend/resume
cycle on some systems.

Adapted from a patch by mrg@.

PR kern/58025


To generate a diff of this commit:
cvs rdiff -u -r1.67 -r1.67.4.1 src/sys/dev/ic/nvme.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/ic/nvme.c
diff -u src/sys/dev/ic/nvme.c:1.67 src/sys/dev/ic/nvme.c:1.67.4.1
--- src/sys/dev/ic/nvme.c:1.67	Tue Sep 13 10:14:20 2022
+++ src/sys/dev/ic/nvme.c	Tue Mar 12 09:58:26 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: nvme.c,v 1.67 2022/09/13 10:14:20 riastradh Exp $	*/
+/*	$NetBSD: nvme.c,v 1.67.4.1 2024/03/12 09:58:26 martin Exp $	*/
 /*	$OpenBSD: nvme.c,v 1.49 2016/04/18 05:59:50 dlg Exp $ */
 
 /*
@@ -18,7 +18,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: nvme.c,v 1.67 2022/09/13 10:14:20 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nvme.c,v 1.67.4.1 2024/03/12 09:58:26 martin Exp $");
 
 #include 
 #include 
@@ -575,7 +575,6 @@ nvme_detach(struct nvme_softc *sc, int f
 		return error;
 
 	/* from now on we are committed to detach, following will never fail */
-	sc->sc_intr_disestablish(sc, NVME_ADMIN_Q);
 	for (i = 0; i < sc->sc_nq; i++)
 		nvme_q_free(sc, sc->sc_q[i]);
 	kmem_free(sc->sc_q, sizeof(*sc->sc_q) * sc->sc_nq);
@@ -603,6 +602,11 @@ nvme_resume(struct nvme_softc *sc)
 	}
 
 	nvme_q_reset(sc, sc->sc_admin_q);
+	if (sc->sc_intr_establish(sc, NVME_ADMIN_Q, sc->sc_admin_q)) {
+		error = EIO;
+		device_printf(sc->sc_dev, "unable to establish admin q\n");
+		goto disable;
+	}
 
 	error = nvme_enable(sc, ffs(sc->sc_mps) - 1);
 	if (error) {
@@ -650,6 +654,8 @@ nvme_shutdown(struct nvme_softc *sc)
 	if (disabled)
 		goto disable;
 
+	sc->sc_intr_disestablish(sc, NVME_ADMIN_Q);
+
 	cc = nvme_read4(sc, NVME_CC);
 	CLR(cc, NVME_CC_SHN_MASK);
 	SET(cc, NVME_CC_SHN(NVME_CC_SHN_NORMAL));



CVS commit: [netbsd-10] src/sys/dev/ic

2024-03-12 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Mar 12 09:58:27 UTC 2024

Modified Files:
src/sys/dev/ic [netbsd-10]: nvme.c

Log Message:
Pull up following revision(s) (requested by riastradh in ticket #633):

sys/dev/ic/nvme.c: revision 1.69

nvme(4): Disestablish admin q interrupt while suspended.

And re-establish on resume.  Fixes nvmectl(8) after a suspend/resume
cycle on some systems.

Adapted from a patch by mrg@.

PR kern/58025


To generate a diff of this commit:
cvs rdiff -u -r1.67 -r1.67.4.1 src/sys/dev/ic/nvme.c

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



CVS commit: xsrc/local/programs/bdfload

2024-03-12 Thread Michael Lorenz
Module Name:xsrc
Committed By:   macallan
Date:   Tue Mar 12 09:42:55 UTC 2024

Modified Files:
xsrc/local/programs/bdfload: bdfload.c

Log Message:
remove accidentally left in debug goop


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 xsrc/local/programs/bdfload/bdfload.c

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



CVS commit: xsrc/local/programs/bdfload

2024-03-12 Thread Michael Lorenz
Module Name:xsrc
Committed By:   macallan
Date:   Tue Mar 12 09:42:55 UTC 2024

Modified Files:
xsrc/local/programs/bdfload: bdfload.c

Log Message:
remove accidentally left in debug goop


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 xsrc/local/programs/bdfload/bdfload.c

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

Modified files:

Index: xsrc/local/programs/bdfload/bdfload.c
diff -u xsrc/local/programs/bdfload/bdfload.c:1.22 xsrc/local/programs/bdfload/bdfload.c:1.23
--- xsrc/local/programs/bdfload/bdfload.c:1.22	Tue Mar 12 09:36:06 2024
+++ xsrc/local/programs/bdfload/bdfload.c	Tue Mar 12 09:42:55 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: bdfload.c,v 1.22 2024/03/12 09:36:06 macallan Exp $	*/
+/*	$NetBSD: bdfload.c,v 1.23 2024/03/12 09:42:55 macallan Exp $	*/
 
 /*
  * Copyright (c) 2018 Michael Lorenz
@@ -520,21 +520,6 @@ interpret(FILE *foo)
 		f.stride = stride;
 		f.data = [first * charsize];
 	}
-if (0) {
-	int i;
-	uint16_t pixbuf[16];
-	double_pixels([charsize * 'Q'], pixbuf, charsize);
-	fill_dup(pixbuf, charsize);
-	for (i = 0; i < charsize * 2; i++) {	
-		printf("%2d: ", i);
-		dump_line((char *)[i], 2); 
-	}
-	smoothe_pixels(pixbuf, charsize * 2);
-	for (i = 0; i < charsize * 2; i++) {	
-		printf("%2d: ", i);
-		dump_line((char *)[i], 2); 
-	}
-}
 
 	if (ofile == NULL) {
 		int fdev = open("/dev/wsfont", O_RDWR, 0);



CVS commit: xsrc/local/programs/bdfload

2024-03-12 Thread Michael Lorenz
Module Name:xsrc
Committed By:   macallan
Date:   Tue Mar 12 09:36:06 UTC 2024

Modified Files:
xsrc/local/programs/bdfload: README bdfload.c

Log Message:
use uint8_t for all 8bit masks and data to avoid sign extending weirdness
found by running this on hppa with gcc12


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 xsrc/local/programs/bdfload/README
cvs rdiff -u -r1.21 -r1.22 xsrc/local/programs/bdfload/bdfload.c

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

Modified files:

Index: xsrc/local/programs/bdfload/README
diff -u xsrc/local/programs/bdfload/README:1.2 xsrc/local/programs/bdfload/README:1.3
--- xsrc/local/programs/bdfload/README:1.2	Thu Jul 27 08:30:02 2023
+++ xsrc/local/programs/bdfload/README	Tue Mar 12 09:36:06 2024
@@ -15,6 +15,8 @@ Command line options:
  -d dump glyph shapes to the console, mostly for font debugging
  -e  override the font's encoding
  -N  override the font's name for both file output and wsdisplay
+ -2 double the size of a font
+ -s smoothe pixel staircases when enlarging
 
 Caveats:
 - fonts wider than 16 pixels won't work yet

Index: xsrc/local/programs/bdfload/bdfload.c
diff -u xsrc/local/programs/bdfload/bdfload.c:1.21 xsrc/local/programs/bdfload/bdfload.c:1.22
--- xsrc/local/programs/bdfload/bdfload.c:1.21	Mon Jan  8 18:09:33 2024
+++ xsrc/local/programs/bdfload/bdfload.c	Tue Mar 12 09:36:06 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: bdfload.c,v 1.21 2024/01/08 18:09:33 macallan Exp $	*/
+/*	$NetBSD: bdfload.c,v 1.22 2024/03/12 09:36:06 macallan Exp $	*/
 
 /*
  * Copyright (c) 2018 Michael Lorenz
@@ -168,9 +168,10 @@ int
 write_header(const char *filename, struct wsdisplay_font *f)
 {
 	FILE *output;
-	char *buffer = f->data;
+	uint8_t *buffer = f->data;
+	uint8_t c, msk;
 	int i, j, x, y, idx, pxls, left;
-	char name[64], c, msk;
+	char name[64];
 	
 	/* now output as a header file */
 	snprintf(name, sizeof(name), "%s_%dx%d", f->name, 



CVS commit: xsrc/local/programs/bdfload

2024-03-12 Thread Michael Lorenz
Module Name:xsrc
Committed By:   macallan
Date:   Tue Mar 12 09:36:06 UTC 2024

Modified Files:
xsrc/local/programs/bdfload: README bdfload.c

Log Message:
use uint8_t for all 8bit masks and data to avoid sign extending weirdness
found by running this on hppa with gcc12


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 xsrc/local/programs/bdfload/README
cvs rdiff -u -r1.21 -r1.22 xsrc/local/programs/bdfload/bdfload.c

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



CVS commit: src

2024-03-12 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Tue Mar 12 07:56:08 UTC 2024

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

Log Message:
lint: fix warning about loss of conversion for unsigned bit-fields

Since decl.c 1.180 from 2021-05-02.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/tests/usr.bin/xlint/lint1/msg_132.c
cvs rdiff -u -r1.7 -r1.8 src/tests/usr.bin/xlint/lint1/msg_267.c
cvs rdiff -u -r1.623 -r1.624 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/tests/usr.bin/xlint/lint1/msg_132.c
diff -u src/tests/usr.bin/xlint/lint1/msg_132.c:1.34 src/tests/usr.bin/xlint/lint1/msg_132.c:1.35
--- src/tests/usr.bin/xlint/lint1/msg_132.c:1.34	Tue Mar 12 07:29:39 2024
+++ src/tests/usr.bin/xlint/lint1/msg_132.c	Tue Mar 12 07:56:08 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg_132.c,v 1.34 2024/03/12 07:29:39 rillig Exp $	*/
+/*	$NetBSD: msg_132.c,v 1.35 2024/03/12 07:56:08 rillig Exp $	*/
 # 3 "msg_132.c"
 
 // Test for message: conversion from '%s' to '%s' may lose accuracy [132]
@@ -410,11 +410,10 @@ fp_classify(void)
 		unsigned long long ext_exp:15;
 	} x;
 
-	/* FIXME: There is no loss of accuracy here. */
-	/* expect+1: warning: conversion from 'unsigned long long:15' to 'int:15' may lose accuracy [132] */
+	// Since decl.c 1.180 from 2021-05-02 and before tree.c 1.624 from
+	// 2024-03-12, lint warned about a possible loss of accuracy [132]
+	// when promoting a small unsigned bit-field to 'int'.
 	if (x.ext_exp == 0) {
-	/* FIXME: There is no loss of accuracy here. */
-	/* expect+1: warning: conversion from 'unsigned long long:15' to 'int:15' may lose accuracy [132] */
 	} else if (x.ext_exp == 0x7fff) {
 	}
 }

Index: src/tests/usr.bin/xlint/lint1/msg_267.c
diff -u src/tests/usr.bin/xlint/lint1/msg_267.c:1.7 src/tests/usr.bin/xlint/lint1/msg_267.c:1.8
--- src/tests/usr.bin/xlint/lint1/msg_267.c:1.7	Fri Jul  7 19:45:22 2023
+++ src/tests/usr.bin/xlint/lint1/msg_267.c	Tue Mar 12 07:56:08 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg_267.c,v 1.7 2023/07/07 19:45:22 rillig Exp $	*/
+/*	$NetBSD: msg_267.c,v 1.8 2024/03/12 07:56:08 rillig Exp $	*/
 # 3 "msg_267.c"
 
 // Test for message: shift amount %u equals bit-size of '%s' [267]
@@ -57,20 +57,28 @@ shift_bit_field(void)
 	(s.bit_field >> 18) &
 	(s.bit_field >> 19) &
 	(s.bit_field >> 31) &
-	/* XXX: Why 'int:18', not 'unsigned int:18'? */
-	/* expect+1: warning: shift amount 32 equals bit-size of 'int:18' [267] */
+	// When promoting 'unsigned int:18', the target type is 'int', as
+	// it can represent all possible values; this is a bit misleading
+	// as its sign bit is always 0.
+	/* expect+1: warning: shift amount 32 equals bit-size of 'int:19' [267] */
 	(s.bit_field >> 32) &
-	/* XXX: Why 'int', not 'unsigned int:18'? */
+	// When promoting 'unsigned int:18', the target type is 'int', as
+	// it can represent all possible values; this is a bit misleading
+	// as its sign bit is always 0.
 	/* expect+1: warning: shift amount 33 is greater than bit-size 32 of 'int' [122] */
 	(s.bit_field >> 33) &
 	(s.bit_field << 17) &
 	(s.bit_field << 18) &
 	(s.bit_field << 19) &
 	(s.bit_field << 31) &
-	/* XXX: Why 'int:18', not 'unsigned int:18'? */
-	/* expect+1: warning: shift amount 32 equals bit-size of 'int:18' [267] */
+	// When promoting 'unsigned int:18', the target type is 'int', as
+	// it can represent all possible values; this is a bit misleading
+	// as its sign bit is always 0.
+	/* expect+1: warning: shift amount 32 equals bit-size of 'int:19' [267] */
 	(s.bit_field << 32) &
-	/* XXX: Why 'int', not 'unsigned int:18'? */
+	// When promoting 'unsigned int:18', the target type is 'int', as
+	// it can represent all possible values; this is a bit misleading
+	// as its sign bit is always 0.
 	/* expect+1: warning: shift amount 33 is greater than bit-size 32 of 'int' [122] */
 	(s.bit_field << 33) &
 	15;

Index: src/usr.bin/xlint/lint1/tree.c
diff -u src/usr.bin/xlint/lint1/tree.c:1.623 src/usr.bin/xlint/lint1/tree.c:1.624
--- src/usr.bin/xlint/lint1/tree.c:1.623	Sun Mar 10 19:45:14 2024
+++ src/usr.bin/xlint/lint1/tree.c	Tue Mar 12 07:56:08 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: tree.c,v 1.623 2024/03/10 19:45:14 rillig Exp $	*/
+/*	$NetBSD: tree.c,v 1.624 2024/03/12 07:56:08 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID)
-__RCSID("$NetBSD: tree.c,v 1.623 2024/03/10 19:45:14 rillig Exp $");
+__RCSID("$NetBSD: tree.c,v 1.624 2024/03/12 07:56:08 rillig Exp $");
 #endif
 
 #include 
@@ -3256,7 +3256,8 @@ tnode_t *
 promote(op_t op, bool farg, tnode_t *tn)
 {
 
-	tspec_t ot = tn->tn_type->t_tspec;
+	const type_t *otp = tn->tn_type;
+	tspec_t ot 

CVS commit: src

2024-03-12 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Tue Mar 12 07:56:08 UTC 2024

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

Log Message:
lint: fix warning about loss of conversion for unsigned bit-fields

Since decl.c 1.180 from 2021-05-02.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/tests/usr.bin/xlint/lint1/msg_132.c
cvs rdiff -u -r1.7 -r1.8 src/tests/usr.bin/xlint/lint1/msg_267.c
cvs rdiff -u -r1.623 -r1.624 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/tests/usr.bin/xlint/lint1

2024-03-12 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Tue Mar 12 07:29:40 UTC 2024

Modified Files:
src/tests/usr.bin/xlint/lint1: msg_132.c

Log Message:
tests/lint: demonstrate wrong warning when comparing a bit-field

Since decl.c 1.180 from 2021-05-02, which allowed arbitrary integer
types to be used as the underlying type for bit-fields in GCC mode.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/tests/usr.bin/xlint/lint1/msg_132.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/usr.bin/xlint/lint1/msg_132.c
diff -u src/tests/usr.bin/xlint/lint1/msg_132.c:1.33 src/tests/usr.bin/xlint/lint1/msg_132.c:1.34
--- src/tests/usr.bin/xlint/lint1/msg_132.c:1.33	Sun Jan 28 08:17:27 2024
+++ src/tests/usr.bin/xlint/lint1/msg_132.c	Tue Mar 12 07:29:39 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg_132.c,v 1.33 2024/01/28 08:17:27 rillig Exp $	*/
+/*	$NetBSD: msg_132.c,v 1.34 2024/03/12 07:29:39 rillig Exp $	*/
 # 3 "msg_132.c"
 
 // Test for message: conversion from '%s' to '%s' may lose accuracy [132]
@@ -402,3 +402,19 @@ test_ic_conditional(char c1, char c2)
 	/* expect+1: warning: conversion from 'int' to 'unsigned char' may lose accuracy [132] */
 	u8 = cond ? s8 : u8;
 }
+
+void
+fp_classify(void)
+{
+	static struct ieee_ext {
+		unsigned long long ext_exp:15;
+	} x;
+
+	/* FIXME: There is no loss of accuracy here. */
+	/* expect+1: warning: conversion from 'unsigned long long:15' to 'int:15' may lose accuracy [132] */
+	if (x.ext_exp == 0) {
+	/* FIXME: There is no loss of accuracy here. */
+	/* expect+1: warning: conversion from 'unsigned long long:15' to 'int:15' may lose accuracy [132] */
+	} else if (x.ext_exp == 0x7fff) {
+	}
+}



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

2024-03-12 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Tue Mar 12 07:29:40 UTC 2024

Modified Files:
src/tests/usr.bin/xlint/lint1: msg_132.c

Log Message:
tests/lint: demonstrate wrong warning when comparing a bit-field

Since decl.c 1.180 from 2021-05-02, which allowed arbitrary integer
types to be used as the underlying type for bit-fields in GCC mode.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/tests/usr.bin/xlint/lint1/msg_132.c

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