CVS commit: src/sys

2019-05-08 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Thu May  9 05:00:32 UTC 2019

Modified Files:
src/sys/external/bsd/drm2/linux: linux_ww_mutex.c
src/sys/kern: kern_lock.c kern_mutex.c kern_rwlock.c subr_lockdebug.c
src/sys/sys: lockdebug.h

Log Message:
Avoid prepending a timestamp to lock debug outputs on ddb

Lock printer functions (lockops_t#lo_dump) use printf_nolog to print, but
printf_nolog now prepends a timestamp which is unnecessary for ddb:

db{0}> show all locks/t
[Locks tracked through LWPs]
Locks held by an LWP (iperf):
Lock 0 (initialized at soinit)
lock address : 0xedeb84b06080 type : sleep/adaptive
initialized  : 0x806d8c3f
shared holds :  0 exclusive:  1
shares wanted:  0 exclusive: 11
current cpu  :  0 last held:  1
current lwp  : 0xedeb849ff040 last held: 0xedeb7dfdb240
last locked* : 0x806d8335 unlocked : 0x806d8385
[ 79103.0868574] owner field  : 0xedeb7dfdb240 wait/spin:   
 1/0

Fix it by passing a printer function to lo_dump functions, i.e., make the
functions use db_printf on ddb.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/external/bsd/drm2/linux/linux_ww_mutex.c
cvs rdiff -u -r1.162 -r1.163 src/sys/kern/kern_lock.c
cvs rdiff -u -r1.78 -r1.79 src/sys/kern/kern_mutex.c
cvs rdiff -u -r1.53 -r1.54 src/sys/kern/kern_rwlock.c
cvs rdiff -u -r1.69 -r1.70 src/sys/kern/subr_lockdebug.c
cvs rdiff -u -r1.20 -r1.21 src/sys/sys/lockdebug.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/external/bsd/drm2/linux/linux_ww_mutex.c
diff -u src/sys/external/bsd/drm2/linux/linux_ww_mutex.c:1.6 src/sys/external/bsd/drm2/linux/linux_ww_mutex.c:1.7
--- src/sys/external/bsd/drm2/linux/linux_ww_mutex.c:1.6	Tue Apr 16 10:00:04 2019
+++ src/sys/external/bsd/drm2/linux/linux_ww_mutex.c	Thu May  9 05:00:31 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux_ww_mutex.c,v 1.6 2019/04/16 10:00:04 mrg Exp $	*/
+/*	$NetBSD: linux_ww_mutex.c,v 1.7 2019/05/09 05:00:31 ozaki-r Exp $	*/
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: linux_ww_mutex.c,v 1.6 2019/04/16 10:00:04 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_ww_mutex.c,v 1.7 2019/05/09 05:00:31 ozaki-r Exp $");
 
 #include 
 #include 
@@ -123,40 +123,40 @@ ww_acquire_fini(struct ww_acquire_ctx *c
 
 #ifdef LOCKDEBUG
 static void
-ww_dump(const volatile void *cookie)
+ww_dump(const volatile void *cookie, lockop_printer_t pr)
 {
 	const volatile struct ww_mutex *mutex = cookie;
 
-	printf_nolog("%-13s: ", "state");
+	pr("%-13s: ", "state");
 	switch (mutex->wwm_state) {
 	case WW_UNLOCKED:
-		printf_nolog("unlocked\n");
+		pr("unlocked\n");
 		break;
 	case WW_OWNED:
-		printf_nolog("owned by lwp\n");
-		printf_nolog("%-13s: %p\n", "owner", mutex->wwm_u.owner);
-		printf_nolog("%-13s: %s\n", "waiters",
+		pr("owned by lwp\n");
+		pr("%-13s: %p\n", "owner", mutex->wwm_u.owner);
+		pr("%-13s: %s\n", "waiters",
 		cv_has_waiters((void *)(intptr_t)&mutex->wwm_cv)
 			? "yes" : "no");
 		break;
 	case WW_CTX:
-		printf_nolog("owned via ctx\n");
-		printf_nolog("%-13s: %p\n", "context", mutex->wwm_u.ctx);
-		printf_nolog("%-13s: %p\n", "lwp",
+		pr("owned via ctx\n");
+		pr("%-13s: %p\n", "context", mutex->wwm_u.ctx);
+		pr("%-13s: %p\n", "lwp",
 		mutex->wwm_u.ctx->wwx_owner);
-		printf_nolog("%-13s: %s\n", "waiters",
+		pr("%-13s: %s\n", "waiters",
 		cv_has_waiters((void *)(intptr_t)&mutex->wwm_cv)
 			? "yes" : "no");
 		break;
 	case WW_WANTOWN:
-		printf_nolog("owned via ctx\n");
-		printf_nolog("%-13s: %p\n", "context", mutex->wwm_u.ctx);
-		printf_nolog("%-13s: %p\n", "lwp",
+		pr("owned via ctx\n");
+		pr("%-13s: %p\n", "context", mutex->wwm_u.ctx);
+		pr("%-13s: %p\n", "lwp",
 		mutex->wwm_u.ctx->wwx_owner);
-		printf_nolog("%-13s: %s\n", "waiters", "yes (noctx)");
+		pr("%-13s: %s\n", "waiters", "yes (noctx)");
 		break;
 	default:
-		printf_nolog("unknown\n");
+		pr("unknown\n");
 		break;
 	}
 }

Index: src/sys/kern/kern_lock.c
diff -u src/sys/kern/kern_lock.c:1.162 src/sys/kern/kern_lock.c:1.163
--- src/sys/kern/kern_lock.c:1.162	Thu May  9 04:53:52 2019
+++ src/sys/kern/kern_lock.c	Thu May  9 05:00:31 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_lock.c,v 1.162 2019/05/09 04:53:52 ozaki-r Exp $	*/
+/*	$NetBSD: kern_lock.c,v 1.163 2019/05/09 05:00:31 ozaki-r Exp $	*/
 
 /*-
  * Copyright (c) 2002, 2006, 2007, 2008, 2009 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_lock.c,v 1.162 2019/05/09 04:53:52 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_lock.c,v 1.163 2019/05/09 05:00:31 ozaki-r Exp $");
 
 #include 
 #include 
@@ -117,7 +117,7 @@ do {	\
 #define	_KE

CVS commit: src/sys/kern

2019-05-08 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Thu May  9 04:53:52 UTC 2019

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

Log Message:
Make _kernel_lock_dump static


To generate a diff of this commit:
cvs rdiff -u -r1.161 -r1.162 src/sys/kern/kern_lock.c

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

Modified files:

Index: src/sys/kern/kern_lock.c
diff -u src/sys/kern/kern_lock.c:1.161 src/sys/kern/kern_lock.c:1.162
--- src/sys/kern/kern_lock.c:1.161	Mon Dec 25 09:13:40 2017
+++ src/sys/kern/kern_lock.c	Thu May  9 04:53:52 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_lock.c,v 1.161 2017/12/25 09:13:40 ozaki-r Exp $	*/
+/*	$NetBSD: kern_lock.c,v 1.162 2019/05/09 04:53:52 ozaki-r Exp $	*/
 
 /*-
  * Copyright (c) 2002, 2006, 2007, 2008, 2009 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_lock.c,v 1.161 2017/12/25 09:13:40 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_lock.c,v 1.162 2019/05/09 04:53:52 ozaki-r Exp $");
 
 #include 
 #include 
@@ -117,7 +117,7 @@ do {	\
 #define	_KERNEL_LOCK_ASSERT(cond)	/* nothing */
 #endif
 
-void	_kernel_lock_dump(const volatile void *);
+static void	_kernel_lock_dump(const volatile void *);
 
 lockops_t _kernel_lock_ops = {
 	.lo_name = "Kernel lock",
@@ -141,7 +141,7 @@ CTASSERT(CACHE_LINE_SIZE >= sizeof(__cpu
 /*
  * Print debugging information about the kernel lock.
  */
-void
+static void
 _kernel_lock_dump(const volatile void *junk)
 {
 	struct cpu_info *ci = curcpu();



CVS commit: src/sys/kern

2019-05-08 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Thu May  9 04:53:00 UTC 2019

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

Log Message:
Add missing "static" declaration


To generate a diff of this commit:
cvs rdiff -u -r1.77 -r1.78 src/sys/kern/kern_mutex.c

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

Modified files:

Index: src/sys/kern/kern_mutex.c
diff -u src/sys/kern/kern_mutex.c:1.77 src/sys/kern/kern_mutex.c:1.78
--- src/sys/kern/kern_mutex.c:1.77	Wed Apr 17 02:29:43 2019
+++ src/sys/kern/kern_mutex.c	Thu May  9 04:52:59 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_mutex.c,v 1.77 2019/04/17 02:29:43 ozaki-r Exp $	*/
+/*	$NetBSD: kern_mutex.c,v 1.78 2019/05/09 04:52:59 ozaki-r Exp $	*/
 
 /*-
  * Copyright (c) 2002, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -40,7 +40,7 @@
 #define	__MUTEX_PRIVATE
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_mutex.c,v 1.77 2019/04/17 02:29:43 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_mutex.c,v 1.78 2019/05/09 04:52:59 ozaki-r Exp $");
 
 #include 
 #include 
@@ -298,7 +298,7 @@ syncobj_t mutex_syncobj = {
  *
  *	Dump the contents of a mutex structure.
  */
-void
+static void
 mutex_dump(const volatile void *cookie)
 {
 	const volatile kmutex_t *mtx = cookie;
@@ -315,7 +315,7 @@ mutex_dump(const volatile void *cookie)
  *	generates a lot of machine code in the DIAGNOSTIC case, so
  *	we ask the compiler to not inline it.
  */
-void __noinline
+static void __noinline
 mutex_abort(const char *func, size_t line, const kmutex_t *mtx, const char *msg)
 {
 



CVS commit: src/sys/dev/usb

2019-05-08 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Thu May  9 02:43:35 UTC 2019

Modified Files:
src/sys/dev/usb: u3g.c uark.c ubsa.c ubsa_common.c ubsavar.h uchcom.c
ucom.c ucomvar.h uftdi.c ugensa.c uhmodem.c uipaq.c ukyopon.c
umcs.c umct.c umodem.c umodem_common.c umodemvar.h uplcom.c uslsa.c
uvisor.c uvscom.c

Log Message:
clean up ucom parents some more:
- it's always "bool sc_dying" now, with true/false
- heavy use of static functions
- remove all ucom parent ca_activate callbacks.  they're never called.
- callbacks should generally do little to nothing if sc_dying is set
- open resources should be released in detach after setting sc_dying
- don't complain about usbd_abort_pipe() or usbd_close_pipe() failure
- when releasing resources, zero the softc member as well
- remove ucom_methods members no longer destined to be filled in
- generally, DPRINTF() before sc_dying short circuit
- use EIO when dying, not ENXIO or 0
- add some ucom_open() callbacks that simply return EIO if dying


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/sys/dev/usb/u3g.c
cvs rdiff -u -r1.14 -r1.15 src/sys/dev/usb/uark.c
cvs rdiff -u -r1.37 -r1.38 src/sys/dev/usb/ubsa.c
cvs rdiff -u -r1.11 -r1.12 src/sys/dev/usb/ubsa_common.c \
src/sys/dev/usb/umodemvar.h
cvs rdiff -u -r1.10 -r1.11 src/sys/dev/usb/ubsavar.h
cvs rdiff -u -r1.32 -r1.33 src/sys/dev/usb/uchcom.c
cvs rdiff -u -r1.124 -r1.125 src/sys/dev/usb/ucom.c
cvs rdiff -u -r1.22 -r1.23 src/sys/dev/usb/ucomvar.h
cvs rdiff -u -r1.69 -r1.70 src/sys/dev/usb/uftdi.c
cvs rdiff -u -r1.38 -r1.39 src/sys/dev/usb/ugensa.c src/sys/dev/usb/umct.c
cvs rdiff -u -r1.18 -r1.19 src/sys/dev/usb/uhmodem.c
cvs rdiff -u -r1.24 -r1.25 src/sys/dev/usb/uipaq.c
cvs rdiff -u -r1.23 -r1.24 src/sys/dev/usb/ukyopon.c
cvs rdiff -u -r1.12 -r1.13 src/sys/dev/usb/umcs.c
cvs rdiff -u -r1.71 -r1.72 src/sys/dev/usb/umodem.c
cvs rdiff -u -r1.29 -r1.30 src/sys/dev/usb/umodem_common.c
cvs rdiff -u -r1.83 -r1.84 src/sys/dev/usb/uplcom.c
cvs rdiff -u -r1.27 -r1.28 src/sys/dev/usb/uslsa.c
cvs rdiff -u -r1.50 -r1.51 src/sys/dev/usb/uvisor.c
cvs rdiff -u -r1.34 -r1.35 src/sys/dev/usb/uvscom.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/u3g.c
diff -u src/sys/dev/usb/u3g.c:1.36 src/sys/dev/usb/u3g.c:1.37
--- src/sys/dev/usb/u3g.c:1.36	Sat May  4 08:04:13 2019
+++ src/sys/dev/usb/u3g.c	Thu May  9 02:43:35 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: u3g.c,v 1.36 2019/05/04 08:04:13 mrg Exp $	*/
+/*	$NetBSD: u3g.c,v 1.37 2019/05/09 02:43:35 mrg Exp $	*/
 
 /*-
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -50,7 +50,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: u3g.c,v 1.36 2019/05/04 08:04:13 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: u3g.c,v 1.37 2019/05/09 02:43:35 mrg Exp $");
 
 #include 
 #include 
@@ -148,11 +148,10 @@ struct u3g_softc {
 static int u3g_match(device_t, cfdata_t, void *);
 static void u3g_attach(device_t, device_t, void *);
 static int u3g_detach(device_t, int);
-static int u3g_activate(device_t, enum devact);
 static void u3g_childdet(device_t, device_t);
 
 CFATTACH_DECL2_NEW(u3g, sizeof(struct u3g_softc), u3g_match,
-u3g_attach, u3g_detach, u3g_activate, NULL, u3g_childdet);
+u3g_attach, u3g_detach, NULL, NULL, u3g_childdet);
 
 
 static void u3g_intr(struct usbd_xfer *, void *, usbd_status);
@@ -348,7 +347,6 @@ u3g_attach(device_t parent, device_t sel
 	ucaa.ucaa_portno = -1;
 	ucaa.ucaa_bulkin = ucaa.ucaa_bulkout = -1;
 
-
 	sc->sc_ifaceno = uiaa->uiaa_ifaceno;
 	intr_address = -1;
 	intr_size = 0;
@@ -431,25 +429,13 @@ static int
 u3g_detach(device_t self, int flags)
 {
 	struct u3g_softc *sc = device_private(self);
-	int rv;
-
-	if (sc->sc_dying)
-		return 0;
-
-	pmf_device_deregister(self);
+	int rv = 0;
 
-	for (size_t i = 0; i < sc->sc_ncom; i++)
-		if (sc->sc_com[i].c_dev != NULL) {
-			rv = config_detach(sc->sc_com[i].c_dev, flags);
-			if (rv != 0) {
-aprint_verbose_dev(self, "Can't deallocate "
-"port (%d)", rv);
-			}
-		}
+	sc->sc_dying = true;
 
 	if (sc->sc_intr_pipe != NULL) {
-		(void) usbd_abort_pipe(sc->sc_intr_pipe);
-		(void) usbd_close_pipe(sc->sc_intr_pipe);
+		usbd_abort_pipe(sc->sc_intr_pipe);
+		usbd_close_pipe(sc->sc_intr_pipe);
 		sc->sc_intr_pipe = NULL;
 	}
 	if (sc->sc_intr_buff != NULL) {
@@ -457,7 +443,22 @@ u3g_detach(device_t self, int flags)
 		sc->sc_intr_buff = NULL;
 	}
 
-	return 0;
+	for (size_t i = 0; i < sc->sc_ncom; i++)
+		if (sc->sc_com[i].c_dev != NULL) {
+			int port_rv;
+
+			port_rv = config_detach(sc->sc_com[i].c_dev, flags);
+			if (port_rv != 0) {
+aprint_verbose_dev(self, "Can't deallocate "
+"port (%d)", port_rv);
+			}
+			rv |= port_rv;
+			sc->sc_com[i].c_dev = NULL;
+		}
+
+	pmf_device_deregister(self);
+
+	return rv;
 }
 
 static void
@@ -470,29 +471,6 @@ u3g_childdet(device_t self, device_t chi
 			sc->sc_com[i].c_dev = NUL

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

2019-05-08 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Thu May  9 01:46:37 UTC 2019

Modified Files:
src/sys/arch/arm/sunxi: sunxi_emac.c

Log Message:
Protect ether_multi list

The list can be racy if NET_MPSAFE is enabled and the driver is executed without
KERNEL_LOCK.

Fix PR 54153


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/arm/sunxi/sunxi_emac.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/sunxi/sunxi_emac.c
diff -u src/sys/arch/arm/sunxi/sunxi_emac.c:1.25 src/sys/arch/arm/sunxi/sunxi_emac.c:1.26
--- src/sys/arch/arm/sunxi/sunxi_emac.c:1.25	Mon Apr 22 14:53:51 2019
+++ src/sys/arch/arm/sunxi/sunxi_emac.c	Thu May  9 01:46:37 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: sunxi_emac.c,v 1.25 2019/04/22 14:53:51 maya Exp $ */
+/* $NetBSD: sunxi_emac.c,v 1.26 2019/05/09 01:46:37 ozaki-r Exp $ */
 
 /*-
  * Copyright (c) 2016-2017 Jared McNeill 
@@ -33,7 +33,7 @@
 #include "opt_net_mpsafe.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sunxi_emac.c,v 1.25 2019/04/22 14:53:51 maya Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sunxi_emac.c,v 1.26 2019/05/09 01:46:37 ozaki-r Exp $");
 
 #include 
 #include 
@@ -543,6 +543,7 @@ sunxi_emac_setup_rxfilter(struct sunxi_e
 		hash[0] = hash[1] = ~0;
 	} else {
 		val |= HASH_MULTICAST;
+		ETHER_LOCK(&sc->ec);
 		ETHER_FIRST_MULTI(step, &sc->ec, enm);
 		while (enm != NULL) {
 			crc = ether_crc32_le(enm->enm_addrlo, ETHER_ADDR_LEN);
@@ -553,6 +554,7 @@ sunxi_emac_setup_rxfilter(struct sunxi_e
 			hash[hashreg] |= (1 << hashbit);
 			ETHER_NEXT_MULTI(step, enm);
 		}
+		ETHER_UNLOCK(&sc->ec);
 	}
 
 	/* Write our unicast address */



CVS commit: src/doc

2019-05-08 Thread Nathanial Sloss
Module Name:src
Committed By:   nat
Date:   Wed May  8 22:01:47 UTC 2019

Modified Files:
src/doc: RESPONSIBLE

Log Message:
Sync with reality.


To generate a diff of this commit:
cvs rdiff -u -r1.122 -r1.123 src/doc/RESPONSIBLE

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

Modified files:

Index: src/doc/RESPONSIBLE
diff -u src/doc/RESPONSIBLE:1.122 src/doc/RESPONSIBLE:1.123
--- src/doc/RESPONSIBLE:1.122	Fri Nov  9 07:54:25 2018
+++ src/doc/RESPONSIBLE	Wed May  8 22:01:47 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: RESPONSIBLE,v 1.122 2018/11/09 07:54:25 mbalmer Exp $
+#	$NetBSD: RESPONSIBLE,v 1.123 2019/05/08 22:01:47 nat Exp $
 
 List of sections of the system, and who is responsible for them (or at
 least considered an expert on them).
@@ -117,7 +117,7 @@ Kernel:
 device support:
 
 acpi		thorpej*, kochi*, jmcneill, joerg
-audio		augustss*, jmcneill, nat
+audio		augustss*, jmcneill
 cgd		elric
 firewire	jmc*
 flash		ahoka



CVS commit: src/share/man/man4

2019-05-08 Thread Constantine A. Murenin
Module Name:src
Committed By:   cnst
Date:   Wed May  8 19:34:09 UTC 2019

Modified Files:
src/share/man/man4: bio.4

Log Message:
bio(4): document the state of setstate more thoroughly


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/share/man/man4/bio.4

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

Modified files:

Index: src/share/man/man4/bio.4
diff -u src/share/man/man4/bio.4:1.16 src/share/man/man4/bio.4:1.17
--- src/share/man/man4/bio.4:1.16	Wed May  8 07:41:23 2019
+++ src/share/man/man4/bio.4	Wed May  8 19:34:09 2019
@@ -1,4 +1,4 @@
-.\"	$NetBSD: bio.4,v 1.16 2019/05/08 07:41:23 wiz Exp $
+.\"	$NetBSD: bio.4,v 1.17 2019/05/08 19:34:09 cnst Exp $
 .\"	$OpenBSD: bio.4,v 1.19 2006/09/20 22:22:37 jmc Exp $
 .\"
 .\" Copyright (c) 2002 Niklas Hallqvist
@@ -99,6 +99,10 @@ but doesn't require the disks to be in v
 applies to any physical disk connected to the controller.
 .Pp
 Note: this ioctl might not be supported on all hardware.
+It is a
+.Nx
+extension of
+.Nm .
 It is supported by
 .Xr arcmsr 4 ,
 .Xr ciss 4 ,
@@ -140,7 +144,8 @@ and
 .It Dv BIOCSETSTATE
 Alter the state of specified physical disk.
 Supported states are: create/remove hot-spare, create/remove pass through
-disk, start/stop consistency check in a volume, online disk and offline disk.
+disk, start/stop consistency check in a volume, online disk and offline disk,
+and a manual rebuild kick-off designation.
 .Pp
 Note: These options might not be supported on all hardware.
 Some of these options are supported by
@@ -148,13 +153,33 @@ Some of these options are supported by
 .Xr mfi 4 ,
 and
 .Xr mfii 4 .
+.Pp
+Online, offline and hotspare designations are supported by
+.Xr mfi 4
+and
+.Xr mfii 4 ,
+plus a rebuild designation is supported by
+.Xr mfii 4 ;
+all four of these state options are the original states from
+.Ox ,
+the other options, including hotspare unmarking, being
+.Nx
+extensions of
+.Nm .
+.Pp
+Hotspare, pass through and consistency check options are supported by
+.Xr arcmsr 4 .
 .It Dv BIOCVOLOPS
 For operations in volume sets.
 It's able to create and remove a volume
 set in a supported RAID controller.
 .Pp
 Note: this ioctl might not be supported on all hardware.
-It is supported by
+It is a
+.Nx
+extension of
+.Nm ,
+and is supported by
 .Xr arcmsr 4 .
 .El
 .Sh FILES



CVS commit: src/doc

2019-05-08 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed May  8 18:00:16 UTC 2019

Modified Files:
src/doc: 3RDPARTY

Log Message:
fix acpica


To generate a diff of this commit:
cvs rdiff -u -r1.1618 -r1.1619 src/doc/3RDPARTY

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

Modified files:

Index: src/doc/3RDPARTY
diff -u src/doc/3RDPARTY:1.1618 src/doc/3RDPARTY:1.1619
--- src/doc/3RDPARTY:1.1618	Sat May  4 05:43:16 2019
+++ src/doc/3RDPARTY	Wed May  8 14:00:16 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.1618 2019/05/04 09:43:16 roy Exp $
+#	$NetBSD: 3RDPARTY,v 1.1619 2019/05/08 18:00:16 christos Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -41,7 +41,7 @@
 #
 
 Package:	acpica
-Version:	20181213
+Version:	20190405
 Current Vers:	20190405
 Maintainer:	Intel
 Archive Site:	http://www.acpica.org/downloads/



CVS commit: src/sys/uvm

2019-05-08 Thread Chuck Silvers
Module Name:src
Committed By:   chs
Date:   Wed May  8 16:00:01 UTC 2019

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

Log Message:
uvm_pagealloc() uses UVM_PGA_* flags, not UVM_KMF_* flags,
and it is always nowait.  fix uarea_poolpage_alloc() to not use
flags from the wrong collection for calling uvm_pagealloc()
and to wait itself if a page is not immediately available.


To generate a diff of this commit:
cvs rdiff -u -r1.167 -r1.168 src/sys/uvm/uvm_glue.c

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

Modified files:

Index: src/sys/uvm/uvm_glue.c
diff -u src/sys/uvm/uvm_glue.c:1.167 src/sys/uvm/uvm_glue.c:1.168
--- src/sys/uvm/uvm_glue.c:1.167	Sun Apr  7 09:20:04 2019
+++ src/sys/uvm/uvm_glue.c	Wed May  8 16:00:01 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_glue.c,v 1.167 2019/04/07 09:20:04 maxv Exp $	*/
+/*	$NetBSD: uvm_glue.c,v 1.168 2019/05/08 16:00:01 chs Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -62,7 +62,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uvm_glue.c,v 1.167 2019/04/07 09:20:04 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_glue.c,v 1.168 2019/05/08 16:00:01 chs Exp $");
 
 #include "opt_kgdb.h"
 #include "opt_kstack.h"
@@ -242,19 +242,22 @@ static pool_cache_t uvm_uarea_system_cac
 static void *
 uarea_poolpage_alloc(struct pool *pp, int flags)
 {
+
+	KASSERT((flags & PR_WAITOK) != 0);
+
 #if defined(PMAP_MAP_POOLPAGE)
-	if (USPACE == PAGE_SIZE && USPACE_ALIGN == 0) {
+	while (USPACE == PAGE_SIZE && USPACE_ALIGN == 0) {
 		struct vm_page *pg;
 		vaddr_t va;
 #if defined(PMAP_ALLOC_POOLPAGE)
-		pg = PMAP_ALLOC_POOLPAGE(
-		   ((flags & PR_WAITOK) == 0 ? UVM_KMF_NOWAIT : 0));
+		pg = PMAP_ALLOC_POOLPAGE(0);
 #else
-		pg = uvm_pagealloc(NULL, 0, NULL,
-		   ((flags & PR_WAITOK) == 0 ? UVM_KMF_NOWAIT : 0));
+		pg = uvm_pagealloc(NULL, 0, NULL, 0);
 #endif
-		if (pg == NULL)
-			return NULL;
+		if (pg == NULL) {
+			uvm_wait("uarea");
+			continue;
+		}
 		va = PMAP_MAP_POOLPAGE(VM_PAGE_TO_PHYS(pg));
 		KASSERT(va != 0);
 		return (void *)va;
@@ -266,9 +269,7 @@ uarea_poolpage_alloc(struct pool *pp, in
 		return (void *)va;
 #endif
 	return (void *)uvm_km_alloc(kernel_map, pp->pr_alloc->pa_pagesz,
-	USPACE_ALIGN, UVM_KMF_WIRED |
-	((flags & PR_WAITOK) ? UVM_KMF_WAITVA :
-	(UVM_KMF_NOWAIT | UVM_KMF_TRYLOCK)));
+	USPACE_ALIGN, UVM_KMF_WIRED | UVM_KMF_WAITVA);
 }
 
 static void



CVS commit: src/lib/libc/gen

2019-05-08 Thread Christoph Badura
Module Name:src
Committed By:   bad
Date:   Wed May  8 15:37:41 UTC 2019

Modified Files:
src/lib/libc/gen: unvis.3

Log Message:
Clarify that strunvisx() and strnunvisx() take the same flags as unvis().
Document VIS_NOESCAPE for unvis().
Bump date.


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/lib/libc/gen/unvis.3

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

Modified files:

Index: src/lib/libc/gen/unvis.3
diff -u src/lib/libc/gen/unvis.3:1.29 src/lib/libc/gen/unvis.3:1.30
--- src/lib/libc/gen/unvis.3:1.29	Tue Oct 24 19:14:55 2017
+++ src/lib/libc/gen/unvis.3	Wed May  8 15:37:41 2019
@@ -1,4 +1,4 @@
-.\"	$NetBSD: unvis.3,v 1.29 2017/10/24 19:14:55 abhinav Exp $
+.\"	$NetBSD: unvis.3,v 1.30 2019/05/08 15:37:41 bad Exp $
 .\"
 .\" Copyright (c) 1989, 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -29,7 +29,7 @@
 .\"
 .\" @(#)unvis.3	8.2 (Berkeley) 12/11/93
 .\"
-.Dd March 12, 2011
+.Dd May 8, 2019
 .Dt UNVIS 3
 .Os
 .Sh NAME
@@ -99,16 +99,18 @@ should be equal to the size of
 .Pp
 The
 .Fn strunvisx
-function does the same as the
+and
+.Fn strnunvisx
+functions do the same as the
 .Fn strunvis
-function,
-but it allows you to add a flag that specifies the style the string
+and
+.Fn strnunvis
+functions,
+but take a flag that specifies the style the string
 .Ar src
 is encoded with.
-Currently, the supported flags are:
-.Dv VIS_HTTPSTYLE
-and
-.Dv VIS_MIMESTYLE .
+The meaning of the flag is the same as explained below for
+.Fn unvis .
 .Pp
 The
 .Fn unvis
@@ -157,6 +159,10 @@ The
 .Fa flag
 argument is also used to specify the encoding style of the source.
 If set to
+.Dv VIS_NOESCAPE
+.Fn unvis
+will not decode backslash escapes.
+If set to
 .Dv VIS_HTTPSTYLE
 or
 .Dv VIS_HTTP1808 ,



CVS commit: src/usr.bin/audio/ctl

2019-05-08 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Wed May  8 14:44:42 UTC 2019

Modified Files:
src/usr.bin/audio/ctl: audioctl.1 ctl.c

Log Message:
Remove -p option.  AUDIO_SETCHAN is insecure and is obsoleted.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/usr.bin/audio/ctl/audioctl.1
cvs rdiff -u -r1.43 -r1.44 src/usr.bin/audio/ctl/ctl.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/ctl/audioctl.1
diff -u src/usr.bin/audio/ctl/audioctl.1:1.21 src/usr.bin/audio/ctl/audioctl.1:1.22
--- src/usr.bin/audio/ctl/audioctl.1:1.21	Fri Feb 10 19:31:42 2017
+++ src/usr.bin/audio/ctl/audioctl.1	Wed May  8 14:44:42 2019
@@ -1,4 +1,4 @@
-.\" $NetBSD: audioctl.1,v 1.21 2017/02/10 19:31:42 nat Exp $
+.\" $NetBSD: audioctl.1,v 1.22 2019/05/08 14:44:42 isaki Exp $
 .\"
 .\" Copyright (c) 1997, 1999 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -35,17 +35,14 @@
 .Sh SYNOPSIS
 .Nm
 .Op Fl d Ar device
-.Op Fl p Ar channel
 .Op Fl n
 .Fl a
 .Nm
 .Op Fl d Ar device
-.Op Fl p Ar channel
 .Op Fl n
 .Ar name ...
 .Nm
 .Op Fl d Ar device
-.Op Fl p Ar channel
 .Op Fl n
 .Fl w
 .Ar name=value ...
@@ -71,11 +68,6 @@ flag can be used to give an alternative 
 .Pa /dev/audioctl0 .
 .Pp
 The
-.Fl p
-flag can be used to give a virtual channel to control, the default is a new
-channel.
-.Pp
-The
 .Fl n
 flag suppresses printing of the variable name.
 .Sh ENVIRONMENT
@@ -93,10 +85,10 @@ audio control device
 audio I/O device (does not reset on open)
 .El
 .Sh EXAMPLES
-To set the playing sampling rate to 11025, for the channel 3 you can use
-.Dl audioctl -p 3 -w play.sample_rate=11025
+To set the playing sampling rate to 11025, you can use
+.Dl audioctl -w play.sample_rate=11025
 To set all of the play parameters for CD-quality audio, you can use
-.Dl audioctl -p 3 -w play=44100,2,16,slinear_le
+.Dl audioctl -w play=44100,2,16,slinear_le
 Note that many of the variables that can be inspected and changed with
 .Nm
 are reset when

Index: src/usr.bin/audio/ctl/ctl.c
diff -u src/usr.bin/audio/ctl/ctl.c:1.43 src/usr.bin/audio/ctl/ctl.c:1.44
--- src/usr.bin/audio/ctl/ctl.c:1.43	Tue Mar 21 07:04:29 2017
+++ src/usr.bin/audio/ctl/ctl.c	Wed May  8 14:44:42 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: ctl.c,v 1.43 2017/03/21 07:04:29 nat Exp $	*/
+/*	$NetBSD: ctl.c,v 1.44 2019/05/08 14:44:42 isaki Exp $	*/
 
 /*
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 #include 
 
 #ifndef lint
-__RCSID("$NetBSD: ctl.c,v 1.43 2017/03/21 07:04:29 nat Exp $");
+__RCSID("$NetBSD: ctl.c,v 1.44 2019/05/08 14:44:42 isaki Exp $");
 #endif
 
 
@@ -66,7 +66,6 @@ static char encbuf[1000];
 
 static int properties, fullduplex, rerror;
 
-int channel;
 int verbose;
 
 static struct field {
@@ -291,9 +290,6 @@ getinfo(int fd)
 {
 	int pos, i;
 
-	if (channel >= 0 && ioctl(fd, AUDIO_SETCHAN, &channel) < 0)
-		err(1, "AUDIO_SETCHAN");
-
 	if (ioctl(fd, AUDIO_GETDEV, &adev) < 0)
 		err(1, "AUDIO_GETDEV");
 	for (pos = 0, i = 0; ; i++) {
@@ -326,11 +322,9 @@ usage(void)
 {
 	const char *prog = getprogname();
 
-	fprintf(stderr, "Usage: %s [-d file] [-p] channel "
-			"[-n] name ...\n", prog);
-	fprintf(stderr, "Usage: %s [-d file] [-p] channel [-n] "
-			"-w name=value ...\n", prog);
-	fprintf(stderr, "Usage: %s [-d file] [-p] channel [-n] -a\n", prog);
+	fprintf(stderr, "Usage: %s [-d file] [-n] name ...\n", prog);
+	fprintf(stderr, "Usage: %s [-d file] [-n] -w name=value ...\n", prog);
+	fprintf(stderr, "Usage: %s [-d file] [-n] -a\n", prog);
 	exit(1);
 }
 
@@ -343,12 +337,11 @@ main(int argc, char *argv[])
 	const char *file;
 	const char *sep = "=";
 
-	channel = -1;
 	file = getenv("AUDIOCTLDEVICE");
 	if (file == NULL)
 		file = deffile;
 
-	while ((ch = getopt(argc, argv, "ad:f:np:w")) != -1) {
+	while ((ch = getopt(argc, argv, "ad:f:nw")) != -1) {
 		switch(ch) {
 		case 'a':
 			aflag++;
@@ -359,9 +352,6 @@ main(int argc, char *argv[])
 		case 'n':
 			sep = 0;
 			break;
-		case 'p':
-			channel = atoi(optarg);
-			break;
 		case 'f': /* compatibility */
 		case 'd':
 			file = optarg;
@@ -440,9 +430,6 @@ audioctl_write(int fd, int argc, char *a
 {
 	struct field *p;
 
-	if (channel >= 0 && ioctl(fd, AUDIO_SETCHAN, &channel) < 0)
-		err(1, "AUDIO_SETCHAN");
-
 	AUDIO_INITINFO(&info);
 	while (argc--) {
 		char *q;



CVS commit: src/usr.bin/audiocfg

2019-05-08 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Wed May  8 14:36:12 UTC 2019

Modified Files:
src/usr.bin/audiocfg: audiocfg.1 audiodev.c audiodev.h main.c

Log Message:
Update respond to isaki-audio2 branch.
- Extend list command to display supported hardware formats.
- Add set command to set hardware format.
- Use correct /dev/audioctl instead of /dev/audio.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/usr.bin/audiocfg/audiocfg.1
cvs rdiff -u -r1.6 -r1.7 src/usr.bin/audiocfg/audiodev.c
cvs rdiff -u -r1.4 -r1.5 src/usr.bin/audiocfg/audiodev.h
cvs rdiff -u -r1.7 -r1.8 src/usr.bin/audiocfg/main.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/audiocfg/audiocfg.1
diff -u src/usr.bin/audiocfg/audiocfg.1:1.3 src/usr.bin/audiocfg/audiocfg.1:1.4
--- src/usr.bin/audiocfg/audiocfg.1:1.3	Wed Sep  1 09:17:31 2010
+++ src/usr.bin/audiocfg/audiocfg.1	Wed May  8 14:36:12 2019
@@ -1,4 +1,4 @@
-.\"	$NetBSD: audiocfg.1,v 1.3 2010/09/01 09:17:31 wiz Exp $
+.\"	$NetBSD: audiocfg.1,v 1.4 2019/05/08 14:36:12 isaki Exp $
 .\"
 .\" Copyright (c) 2010 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -40,6 +40,14 @@
 .Cm default
 .Ar index
 .Nm
+.Cm set
+.Ar index
+.Ar direction
+.Ar encoding
+.Ar precision
+.Ar channels
+.Ar sample_rate
+.Nm
 .Cm test
 .Ar index
 .Sh DESCRIPTION
@@ -51,6 +59,25 @@ Run with
 .Dq Cm list ,
 it lists the available audio devices and shows the currently selected
 default audio device.
+.Pp
+Run with
+.Dq Cm set ,
+if sets the hardware format.
+The
+.Ar direction
+is represented by either of 'p'(playback) or 'r'(record), or both of them,
+indicates direction you want to set to.
+The remaining parameters
+.Ar encoding ,
+.Ar precision ,
+.Ar channels
+and
+.Ar sample_rate
+indicate the hardware format you want to set to.
+These parameters must be selected from the candidates displayed by
+.Nm
+.Cm list .
+.Pp
 Called with
 .Dq Cm test ,
 it plays a tone of 2 seconds for each channel of the device with the index

Index: src/usr.bin/audiocfg/audiodev.c
diff -u src/usr.bin/audiocfg/audiodev.c:1.6 src/usr.bin/audiocfg/audiodev.c:1.7
--- src/usr.bin/audiocfg/audiodev.c:1.6	Sat Mar  5 22:10:39 2016
+++ src/usr.bin/audiocfg/audiodev.c	Wed May  8 14:36:12 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: audiodev.c,v 1.6 2016/03/05 22:10:39 mrg Exp $ */
+/* $NetBSD: audiodev.c,v 1.7 2019/05/08 14:36:12 isaki Exp $ */
 
 /*
  * Copyright (c) 2010 Jared D. McNeill 
@@ -31,6 +31,7 @@
 #include 
 #include 
 
+#include 
 #include 
 #include 
 #include 
@@ -47,51 +48,23 @@ static TAILQ_HEAD(audiodevhead, audiodev
 
 #define AUDIODEV_SAMPLE_RATE	44100
 
-static unsigned int
-audiodev_probe_pchans(struct audiodev *adev)
-{
-	audio_info_t info;
-	unsigned int nchans = 0, n;
-	int error;
-
-	AUDIO_INITINFO(&info);
-	info.play.sample_rate = AUDIODEV_SAMPLE_RATE;
-	info.play.precision = 16;
-	info.play.encoding = AUDIO_ENCODING_SLINEAR_LE;
-	info.play.channels = 1;
-	info.mode = AUMODE_PLAY;
-	error = ioctl(adev->fd, AUDIO_SETINFO, &info);
-	if (error == -1)
-		return 0;
-	nchans = 1;
-
-	for (n = 2; n <= 16; n += 2) {
-		info.play.channels = n;
-		error = ioctl(adev->fd, AUDIO_SETINFO, &info);
-		if (error == -1)
-			break;
-		nchans = info.play.channels;
-	}
-
-	return nchans;
-}
-
 static int
 audiodev_getinfo(struct audiodev *adev)
 {
 	struct stat st;
+	struct audiofmt *f;
+	audio_format_query_t query;
+	int i;
 
-	if (stat(adev->path, &st) == -1)
+	if (stat(adev->ctlpath, &st) == -1)
 		return -1;
 	adev->dev = st.st_rdev;
 
-	if (stat(_PATH_AUDIO, &st) != -1 && st.st_rdev == adev->dev)
+	if (stat(_PATH_AUDIOCTL, &st) != -1 && st.st_rdev == adev->dev)
 		adev->defaultdev = true;
 
-	adev->fd = open(adev->path, O_RDWR);
+	adev->fd = open(adev->ctlpath, O_RDONLY);
 	if (adev->fd == -1) {
-		adev->fd = open(adev->path, O_WRONLY);
-		if (adev->fd == -1)
 			return -1;
 	}
 	if (ioctl(adev->fd, AUDIO_GETDEV, &adev->audio_device) == -1) {
@@ -99,7 +72,29 @@ audiodev_getinfo(struct audiodev *adev)
 		return -1;
 	}
 
-	adev->pchan = audiodev_probe_pchans(adev);
+	for (i = 0; ;i++) {
+		memset(&query, 0, sizeof(query));
+		query.index = i;
+		if (ioctl(adev->fd, AUDIO_QUERYFORMAT, &query) == -1) {
+			if (errno == ENODEV) {
+/* QUERYFORMAT not supported. */
+break;
+			}
+			if (errno == EINVAL)
+break;
+			close(adev->fd);
+			return -1;
+		}
+
+		f = calloc(1, sizeof(*f));
+		f->fmt = query.fmt;
+		TAILQ_INSERT_TAIL(&adev->formats, f, next);
+	}
+
+	if (ioctl(adev->fd, AUDIO_GETFORMAT, &adev->info) == -1) {
+		close(adev->fd);
+		return -1;
+	}
 
 	return 0;
 }
@@ -115,8 +110,10 @@ audiodev_add(const char *pdev, const cha
 
 	strlcpy(adev->pxname, pdev, sizeof(adev->pxname));
 	strlcpy(adev->xname, dev, sizeof(adev->xname));
-	snprintf(adev->path, sizeof(adev->path) - 1, "/dev/%s", dev);
+	snprintf(adev->path, sizeof(adev->path), "/dev/%s", dev);
+	snprintf(adev->ctlpath, sizeof(

CVS commit: src

2019-05-08 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Wed May  8 14:25:39 UTC 2019

Modified Files:
src/distrib/sets/lists/comp: mi
src/share/man/man4: audio.4
src/share/man/man9: Makefile audio.9 intro.9
Removed Files:
src/share/man/man9: audio_system.9

Log Message:
Update manpages respond to isaki-audio2 branch.


To generate a diff of this commit:
cvs rdiff -u -r1.2272 -r1.2273 src/distrib/sets/lists/comp/mi
cvs rdiff -u -r1.87 -r1.88 src/share/man/man4/audio.4
cvs rdiff -u -r1.436 -r1.437 src/share/man/man9/Makefile
cvs rdiff -u -r1.51 -r1.52 src/share/man/man9/audio.9
cvs rdiff -u -r1.1 -r0 src/share/man/man9/audio_system.9
cvs rdiff -u -r1.23 -r1.24 src/share/man/man9/intro.9

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

Modified files:

Index: src/distrib/sets/lists/comp/mi
diff -u src/distrib/sets/lists/comp/mi:1.2272 src/distrib/sets/lists/comp/mi:1.2273
--- src/distrib/sets/lists/comp/mi:1.2272	Sat Apr 27 23:04:31 2019
+++ src/distrib/sets/lists/comp/mi	Wed May  8 14:25:38 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: mi,v 1.2272 2019/04/27 23:04:31 kamil Exp $
+#	$NetBSD: mi,v 1.2273 2019/05/08 14:25:38 isaki Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 ./etc/mtree/set.compcomp-sys-root
@@ -10654,7 +10654,7 @@
 ./usr/share/man/cat9/arpresolve.0		comp-sys-catman		.cat
 ./usr/share/man/cat9/atop.0			comp-sys-catman		.cat
 ./usr/share/man/cat9/audio.0			comp-sys-catman		.cat
-./usr/share/man/cat9/audio_system.0		comp-sys-catman		.cat
+./usr/share/man/cat9/audio_system.0		comp-sys-catman		obsolete
 ./usr/share/man/cat9/autoconf.0			comp-sys-catman		.cat
 ./usr/share/man/cat9/bawrite.0			comp-sys-catman		.cat
 ./usr/share/man/cat9/bcdtobin.0			comp-sys-catman		.cat
@@ -18591,7 +18591,7 @@
 ./usr/share/man/html9/arpresolve.html		comp-sys-htmlman	html
 ./usr/share/man/html9/atop.html			comp-sys-htmlman	html
 ./usr/share/man/html9/audio.html		comp-sys-htmlman	html
-./usr/share/man/html9/audio_system.html		comp-sys-htmlman	html
+./usr/share/man/html9/audio_system.html		comp-sys-htmlman	obsolete
 ./usr/share/man/html9/autoconf.html		comp-sys-htmlman	html
 ./usr/share/man/html9/bawrite.html		comp-sys-htmlman	html
 ./usr/share/man/html9/bcdtobin.html		comp-sys-htmlman	html
@@ -26631,7 +26631,7 @@
 ./usr/share/man/man9/arpresolve.9		comp-sys-man		.man
 ./usr/share/man/man9/atop.9			comp-sys-man		.man
 ./usr/share/man/man9/audio.9			comp-sys-man		.man
-./usr/share/man/man9/audio_system.9		comp-sys-man		.man
+./usr/share/man/man9/audio_system.9		comp-sys-man		obsolete
 ./usr/share/man/man9/autoconf.9			comp-sys-man		.man
 ./usr/share/man/man9/bawrite.9			comp-sys-man		.man
 ./usr/share/man/man9/bcdtobin.9			comp-sys-man		.man

Index: src/share/man/man4/audio.4
diff -u src/share/man/man4/audio.4:1.87 src/share/man/man4/audio.4:1.88
--- src/share/man/man4/audio.4:1.87	Sat Feb 16 06:50:14 2019
+++ src/share/man/man4/audio.4	Wed May  8 14:25:39 2019
@@ -1,4 +1,4 @@
-.\"	$NetBSD: audio.4,v 1.87 2019/02/16 06:50:14 isaki Exp $
+.\"	$NetBSD: audio.4,v 1.88 2019/05/08 14:25:39 isaki Exp $
 .\"
 .\" Copyright (c) 1996 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -66,137 +66,40 @@ accepts the same
 operations as
 .Pa /dev/sound ,
 but no other operations.
+It can be opened at any time and can be used to manipulate the
+audio device while it is in use.
 .Pp
-.Pa /dev/sound
-and
-.Pa /dev/audio
-can be opened at
-.Em any
-time and audio sources of different precision and playback
-parameters i.e frequency will be mixed and played back simultaneously.
-.Pp
-.Pa /dev/audioctl
-can be used to manipulate the audio device
-while it is in use.
 .Sh SAMPLING DEVICES
 When
 .Pa /dev/audio
-is opened, it automatically directs the underlying driver to manipulate
-monaural 8-bit mu-law samples.
-In addition, if it is opened read-only
-(write-only) the device is set to half-duplex record (play) mode with
-recording (playing) unpaused and playing (recording) paused.
+is opened, it automatically sets the track to manipulate
+monaural 8-bit mu-law 8000Hz.
 When
 .Pa /dev/sound
-is opened, it maintains the previous audio sample mode and
-record/playback mode most recently set on
-.Pa /dev/sound
-by any open channel.
+is opened, it maintains the audio format and pause/unpause
+state of the most recently opened track.
 In all other respects
 .Pa /dev/audio
 and
 .Pa /dev/sound
 are identical.
-.Sh VIRTUAL CHANNELS
-Any process may open a sampling device at a given time.
-Any number of devices per process and file descriptors may be shared between
-processes.
-.Pp
-Virtual channels are converted to a common format, signed linear encoding,
-frequency channels and precision.
-These can be modified to taste by the following
-.Xr sysctl 8
-variables:
-.Bl -tag -width "hw.driverN.precision" -compact -offset indent
-.It Li hw. Ns Ar driverN Ns Li .precision
-.It Li hw. Ns Ar driverN Ns Li .frequency
-.

CVS commit: src/lib/libc/sys

2019-05-08 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed May  8 14:10:42 UTC 2019

Modified Files:
src/lib/libc/sys: getsockopt.2

Log Message:
mention truncation of the result if the size in optlen is less that the
size of the option to be returned in optval.


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/lib/libc/sys/getsockopt.2

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

Modified files:

Index: src/lib/libc/sys/getsockopt.2
diff -u src/lib/libc/sys/getsockopt.2:1.39 src/lib/libc/sys/getsockopt.2:1.40
--- src/lib/libc/sys/getsockopt.2:1.39	Mon Nov  5 04:18:55 2018
+++ src/lib/libc/sys/getsockopt.2	Wed May  8 10:10:42 2019
@@ -1,4 +1,4 @@
-.\"	$NetBSD: getsockopt.2,v 1.39 2018/11/05 09:18:55 wiz Exp $
+.\"	$NetBSD: getsockopt.2,v 1.40 2019/05/08 14:10:42 christos Exp $
 .\"
 .\" Copyright (c) 1983, 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -29,7 +29,7 @@
 .\"
 .\" @(#)getsockopt.2	8.4 (Berkeley) 5/2/95
 .\"
-.Dd November 3, 2018
+.Dd May 8, 2019
 .Dt GETSOCKOPT 2
 .Os
 .Sh NAME
@@ -104,6 +104,15 @@ size of the buffer pointed to by
 .Fa optval ,
 and modified on return to indicate the actual size of
 the value returned.
+If the size of the requested option value to be stored in
+.Fa optval 
+is greater than the size indicated in
+.Fa optlen
+then only
+.Fa optlen
+bytes will be stored in
+.Fa optval 
+and the result will be silently truncated.
 If no option value is to be supplied or returned,
 .Fa optval
 may be



CVS commit: src/sys/kern

2019-05-08 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed May  8 14:05:19 UTC 2019

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

Log Message:
PR/54176: Anthony Mallet:
getsockopt(2) does not silently truncate returned optval


To generate a diff of this commit:
cvs rdiff -u -r1.278 -r1.279 src/sys/kern/uipc_socket.c

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

Modified files:

Index: src/sys/kern/uipc_socket.c
diff -u src/sys/kern/uipc_socket.c:1.278 src/sys/kern/uipc_socket.c:1.279
--- src/sys/kern/uipc_socket.c:1.278	Mon Apr 15 06:53:17 2019
+++ src/sys/kern/uipc_socket.c	Wed May  8 10:05:18 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: uipc_socket.c,v 1.278 2019/04/15 10:53:17 pgoyette Exp $	*/
+/*	$NetBSD: uipc_socket.c,v 1.279 2019/05/08 14:05:18 christos Exp $	*/
 
 /*
  * Copyright (c) 2002, 2007, 2008, 2009 The NetBSD Foundation, Inc.
@@ -71,7 +71,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uipc_socket.c,v 1.278 2019/04/15 10:53:17 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uipc_socket.c,v 1.279 2019/05/08 14:05:18 christos Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -2082,11 +2082,8 @@ sockopt_set(struct sockopt *sopt, const 
 			return error;
 	}
 
-	if (sopt->sopt_size < len)
-		return EINVAL;
-
-	memcpy(sopt->sopt_data, buf, len);
-	sopt->sopt_retsize = len;
+	sopt->sopt_retsize = MIN(sopt->sopt_size, len);
+	memcpy(sopt->sopt_data, buf, sopt->sopt_retsize);
 
 	return 0;
 }
@@ -2146,12 +2143,9 @@ sockopt_setmbuf(struct sockopt *sopt, st
 			return error;
 	}
 
-	if (sopt->sopt_size < len)
-		return EINVAL;
-
-	m_copydata(m, 0, len, sopt->sopt_data);
+	sopt->sopt_retsize = MIN(sopt->sopt_size, len);
+	m_copydata(m, 0, sopt->sopt_retsize, sopt->sopt_data);
 	m_freem(m);
-	sopt->sopt_retsize = len;
 
 	return 0;
 }



CVS commit: src

2019-05-08 Thread Leonardo Taccari
Module Name:src
Committed By:   leot
Date:   Wed May  8 14:03:58 UTC 2019

Modified Files:
src: BUILDING
src/doc: BUILDING.mdoc

Log Message:
Fix a typo

Reported by Tobias Ulmer via netbsd-docs@ ML, thanks!


To generate a diff of this commit:
cvs rdiff -u -r1.134 -r1.135 src/BUILDING
cvs rdiff -u -r1.125 -r1.126 src/doc/BUILDING.mdoc

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

Modified files:

Index: src/BUILDING
diff -u src/BUILDING:1.134 src/BUILDING:1.135
--- src/BUILDING:1.134	Sun Jul 29 20:53:41 2018
+++ src/BUILDING	Wed May  8 14:03:57 2019
@@ -206,7 +206,7 @@ CONFIGURATION
  Directory containing sources of externally added programs and
  libraries.  If specified, must be an absolute path.
 
- Default: NETBSDRCDIR/../extsrc, if that exists; otherwise
+ Default: NETBSDSRCDIR/../extsrc, if that exists; otherwise
  /usr/extsrc.
 
  MAKECONFThe name of the make(1) configuration file.  Only settable in
@@ -461,7 +461,7 @@ CONFIGURATION
  must be an absolute path.  The main modular Xorg source is
  found in X11SRCDIR/external/mit.
 
- Default: NETBSDRCDIR/../xsrc, if that exists; otherwise
+ Default: NETBSDSRCDIR/../xsrc, if that exists; otherwise
  /usr/xsrc.
 
"make" variables for full builds

Index: src/doc/BUILDING.mdoc
diff -u src/doc/BUILDING.mdoc:1.125 src/doc/BUILDING.mdoc:1.126
--- src/doc/BUILDING.mdoc:1.125	Sun Jul 29 20:53:29 2018
+++ src/doc/BUILDING.mdoc	Wed May  8 14:03:57 2019
@@ -1,4 +1,4 @@
-.\"	$NetBSD: BUILDING.mdoc,v 1.125 2018/07/29 20:53:29 sevan Exp $
+.\"	$NetBSD: BUILDING.mdoc,v 1.126 2019/05/08 14:03:57 leot Exp $
 .\"
 .\" Copyright (c) 2001-2011 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -430,7 +430,7 @@ Directory containing sources of external
 and libraries.
 If specified, must be an absolute path.
 .DFLT
-.Sy NETBSDRCDIR Ns Pa /../extsrc ,
+.Sy NETBSDSRCDIR Ns Pa /../extsrc ,
 if that exists; otherwise
 .Pa /usr/extsrc .
 .
@@ -814,7 +814,7 @@ If specified, must be an absolute path.
 The main modular Xorg source is found in
 .Sy X11SRCDIR Ns Pa /external/mit .
 .DFLT
-.Sy NETBSDRCDIR Ns Pa /../xsrc ,
+.Sy NETBSDSRCDIR Ns Pa /../xsrc ,
 if that exists; otherwise
 .Pa /usr/xsrc .
 .



CVS commit: src/sys/sys

2019-05-08 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Wed May  8 13:47:33 UTC 2019

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

Log Message:
Merge isaki-audio2 branch.

Welcome to 8.99.39.


To generate a diff of this commit:
cvs rdiff -u -r1.586 -r1.587 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/sys/sys/param.h
diff -u src/sys/sys/param.h:1.586 src/sys/sys/param.h:1.587
--- src/sys/sys/param.h:1.586	Mon May  6 08:07:41 2019
+++ src/sys/sys/param.h	Wed May  8 13:47:33 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: param.h,v 1.586 2019/05/06 08:07:41 kamil Exp $	*/
+/*	$NetBSD: param.h,v 1.587 2019/05/08 13:47:33 isaki Exp $	*/
 
 /*-
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -67,7 +67,7 @@
  *	2.99.9		(299000900)
  */
 
-#define	__NetBSD_Version__	899003800	/* NetBSD 8.99.38 */
+#define	__NetBSD_Version__	899003900	/* NetBSD 8.99.39 */
 
 #define __NetBSD_Prereq__(M,m,p) (M) * 1) + \
 (m) * 100) + (p) * 100) <= __NetBSD_Version__)



CVS commit: src/sys

2019-05-08 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Wed May  8 13:40:20 UTC 2019

Modified Files:
src/sys/arch/amiga/conf: files.amiga
src/sys/arch/amiga/dev: aucc.c melody.c repulse.c toccata.c
src/sys/arch/amigappc/conf: files.amigappc
src/sys/arch/arm/broadcom: bcm2835_vcaudio.c files.bcm2835
src/sys/arch/arm/imx: imx23_digfilt.c
src/sys/arch/arm/iomd: files.iomd vidcaudio.c
src/sys/arch/arm/sunxi: files.sunxi sun4i_a10_codec.c
sun50i_a64_acodec.c sun6i_a31_codec.c sun8i_codec.c
sun8i_h3_codec.c sunxi_codec.c sunxi_codec.h sunxi_i2s.c
src/sys/arch/arm/xscale: files.pxa2x0 pxa2x0_ac97.c pxa2x0_i2s.c
pxa2x0_i2s.h
src/sys/arch/dreamcast/conf: files.dreamcast
src/sys/arch/dreamcast/dev/g2: aica.c
src/sys/arch/evbarm/conf: files.mini2440
src/sys/arch/evbarm/mini2440: audio_mini2440.c
src/sys/arch/hp300/dev: arcofi_dio.c
src/sys/arch/hpcmips/vr: vraiu.c
src/sys/arch/hppa/conf: files.hppa
src/sys/arch/hppa/gsc: harmony.c harmonyvar.h
src/sys/arch/i386/pnpbios: ess_pnpbios.c sb_pnpbios.c wss_pnpbios.c
ym_pnpbios.c
src/sys/arch/ibmnws/conf: files.ibmnws
src/sys/arch/macppc/conf: files.macppc
src/sys/arch/macppc/dev: awacs.c snapper.c
src/sys/arch/mips/conf: files.alchemy
src/sys/arch/prep/conf: files.prep
src/sys/arch/prep/isa: paud_isa.c
src/sys/arch/sgimips/hpc: files.hpc haltwo.c
src/sys/arch/sgimips/mace: files.mace mavb.c
src/sys/arch/sparc/conf: GENERIC TADPOLE3GX
src/sys/arch/sparc/dev: audioamd.c
src/sys/arch/usermode/conf: files.usermode
src/sys/arch/usermode/dev: vaudio.c
src/sys/arch/usermode/include: thunk.h
src/sys/arch/usermode/usermode: thunk.c
src/sys/arch/vax/vsa: vsaudio.c
src/sys/arch/x68k/conf: files.x68k
src/sys/arch/x68k/dev: vs.c vsvar.h
src/sys/arch/zaurus/conf: files.zaurus
src/sys/arch/zaurus/dev: wm8731_zaudio.c wm8750_zaudio.c zaudio.c
zaudiovar.h
src/sys/dev: DEVNAMES files.audio midi.c midisyn.c spkr_audio.c
src/sys/dev/acpi: wss_acpi.c ym_acpi.c
src/sys/dev/bluetooth: btsco.c files.bluetooth
src/sys/dev/ebus: cs4231_ebus.c
src/sys/dev/fdt: ausoc.c fdtvar.h
src/sys/dev/hdaudio: files.hdaudio hdafg.c hdaudiovar.h
src/sys/dev/ic: ac97.c ad1848.c ad1848var.h am7930.c am7930var.h
arcofi.c arcofivar.h cs4231.c interwave.c interwavevar.h msm6258.c
msm6258var.h opl.c pl041.c pl041var.h tms320av110.c
tms320av110var.h uda1341.c uda1341var.h
src/sys/dev/isa: ad1848_isa.c ad1848var.h aria.c cms.c ess.c files.isa
gus.c ics2101.c joy_ess.c midi_pcppi.c mpu_sb.c mpu_ym.c opl_ess.c
opl_isa.c opl_sb.c opl_wss.c opl_ym.c pas.c sb.c sb_isa.c sbdsp.c
sbdspvar.h wss.c wss_isa.c ym.c
src/sys/dev/isapnp: ess_isapnp.c gus_isapnp.c mpu_isapnp.c sb_isapnp.c
wss_isapnp.c ym_isapnp.c
src/sys/dev/ofisa: ess_ofisa.c sb_ofisa.c
src/sys/dev/pad: files.pad pad.c padvar.h
src/sys/dev/pci: auacer.c auich.c auixp.c auixpvar.h autri.c auvia.c
auviavar.h azalia.c azalia.h cmpci.c cs4280.c cs4280reg.h cs4281.c
cs428x.c cs428x.h eap.c emuxki.c esa.c esm.c esmvar.h eso.c
esoreg.h files.pci fms.c gcscaudio.c joy_eap.c joy_eso.c
mpu_cmpci.c mpu_eso.c mpu_fms.c mpu_yds.c neo.c opl_cmpci.c
opl_eso.c opl_fms.c opl_sv.c opl_yds.c sv.c yds.c ydsvar.h
src/sys/dev/pci/igma: files.igma
src/sys/dev/pci/voyager: files.voyager
src/sys/dev/sbus: cs4231_sbus.c dbri.c dbrivar.h files.sbus
src/sys/dev/tc: bba.c files.tc
src/sys/dev/usb: files.usb uaudio.c umidi.c umidi_quirks.c
src/sys/modules/audio: Makefile
src/sys/modules/spkr: Makefile
src/sys/rump/dev/lib/libaudio: Makefile audio_component.c
src/sys/sys: audioio.h file.h
Added Files:
src/sys/dev/audio: alaw.c audio.c audio_dai.h audio_if.h audiobell.c
audiobellvar.h audiodef.h audiofil.h audiovar.h linear.c linear.h
mulaw.c mulaw.h
Removed Files:
src/sys/dev: auconv.c auconv.h audio.c audio_dai.h audio_if.h
audiobell.c audiobelldata.h audiobellvar.h audiovar.h aurateconv.c
auvolconv.c auvolconv.h mulaw.c mulaw.h
src/sys/dev/pci: emuxkivar.h
src/sys/rump/dev/lib/libaudio: aurateconv.h mulaw.h

Log Message:
Merge isaki-audio2 branch, the overhaul of audio subsystem.
- Interrupt-oriented system rather than thread-oriented.
- Improve stability, quality and performance.
- Split playback and record cleanly.  Improve halfduplex support.
- Many bugs are fixed including deadlocks, resource leaks, abuses, etc.
- Simplify audio filter mechanism.  The encoding/cha

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

2019-05-08 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed May  8 13:18:47 UTC 2019

Modified Files:
src/sys/arch/arm/arm32: arm32_kvminit.c

Log Message:
Really go back to pre-whitespace change (1.52) arm32_kernel_vm_init


To generate a diff of this commit:
cvs rdiff -u -r1.54 -r1.55 src/sys/arch/arm/arm32/arm32_kvminit.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/arm32/arm32_kvminit.c
diff -u src/sys/arch/arm/arm32/arm32_kvminit.c:1.54 src/sys/arch/arm/arm32/arm32_kvminit.c:1.55
--- src/sys/arch/arm/arm32/arm32_kvminit.c:1.54	Tue Apr 23 16:14:32 2019
+++ src/sys/arch/arm/arm32/arm32_kvminit.c	Wed May  8 13:18:47 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: arm32_kvminit.c,v 1.54 2019/04/23 16:14:32 skrll Exp $	*/
+/*	$NetBSD: arm32_kvminit.c,v 1.55 2019/05/08 13:18:47 skrll Exp $	*/
 
 /*
  * Copyright (c) 2002, 2003, 2005  Genetec Corporation.  All rights reserved.
@@ -127,7 +127,7 @@
 #include "opt_multiprocessor.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: arm32_kvminit.c,v 1.54 2019/04/23 16:14:32 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: arm32_kvminit.c,v 1.55 2019/05/08 13:18:47 skrll Exp $");
 
 #include 
 #include 
@@ -755,8 +755,6 @@ arm32_kernel_vm_init(vaddr_t kernel_vm_b
 	while (pv != NULL) {
 		if (mapallmem_p) {
 			if (concat_pvaddr(&cur_pv, pv)) {
-cur_pv.pv_size += pv->pv_size;
-
 pv = SLIST_NEXT(pv, pv_list);
 continue;
 			}



CVS commit: [isaki-audio2] src/sys/modules/spkr

2019-05-08 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Wed May  8 12:48:01 UTC 2019

Modified Files:
src/sys/modules/spkr [isaki-audio2]: Makefile

Log Message:
Add WARNS flag.  (It was left at my local in previous commit..)


To generate a diff of this commit:
cvs rdiff -u -r1.8.2.1 -r1.8.2.2 src/sys/modules/spkr/Makefile

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

Modified files:

Index: src/sys/modules/spkr/Makefile
diff -u src/sys/modules/spkr/Makefile:1.8.2.1 src/sys/modules/spkr/Makefile:1.8.2.2
--- src/sys/modules/spkr/Makefile:1.8.2.1	Tue May  7 15:01:50 2019
+++ src/sys/modules/spkr/Makefile	Wed May  8 12:48:01 2019
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.8.2.1 2019/05/07 15:01:50 isaki Exp $
+# $NetBSD: Makefile,v 1.8.2.2 2019/05/08 12:48:01 isaki Exp $
 
 .include "../Makefile.inc"
 
@@ -14,6 +14,8 @@ SRCS+=	spkr_audio.c
 .PATH:	${S}/dev/audio
 SRCS+=	audiobell.c
 
+WARNS=	3
+
 CPPFLAGS+=	-DNWSMUX=1
 
 .include 



CVS commit: [isaki-audio2] src/sys/dev/audio

2019-05-08 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Wed May  8 11:57:53 UTC 2019

Modified Files:
src/sys/dev/audio [isaki-audio2]: audio_if.h

Log Message:
Good bye stream_filter.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.1 -r1.1.2.2 src/sys/dev/audio/audio_if.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/dev/audio/audio_if.h
diff -u src/sys/dev/audio/audio_if.h:1.1.2.1 src/sys/dev/audio/audio_if.h:1.1.2.2
--- src/sys/dev/audio/audio_if.h:1.1.2.1	Sat May  4 07:20:09 2019
+++ src/sys/dev/audio/audio_if.h	Wed May  8 11:57:52 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: audio_if.h,v 1.1.2.1 2019/05/04 07:20:09 isaki Exp $	*/
+/*	$NetBSD: audio_if.h,v 1.1.2.2 2019/05/08 11:57:52 isaki Exp $	*/
 
 /*
  * Copyright (c) 1994 Havard Eidnes.
@@ -72,107 +72,6 @@ typedef struct audio_params {
 #define	AUFMT_VALIDATE(fmt)	(fmt)->mode &= 0x7fff
 #define	AUFMT_IS_VALID(fmt)	(((fmt)->mode & 0x8000) == 0)
 
-/**
- * audio stream buffer
- */
-typedef struct audio_stream {
-	size_t bufsize;		/* allocated memory */
-	uint8_t *start;		/* start of buffer area */
-	uint8_t *end;		/* end of valid buffer area */
-	uint8_t *inp;		/* address to be written next */
-	const uint8_t *outp;	/* address to be read next */
-	int used;		/* valid data size in this stream */
-	audio_params_t param;	/* represents this stream */
-	bool loop;
-} audio_stream_t;
-
-static __inline int
-audio_stream_get_space(const audio_stream_t *s)
-{
-	if (s)
-		return (s->end - s->start) - s->used;
-	return 0;
-}
-
-static __inline int
-audio_stream_get_used(const audio_stream_t *s)
-{
-	return s ? s->used : 0;
-}
-
-static __inline uint8_t *
-audio_stream_add_inp(audio_stream_t *s, uint8_t *v, int diff)
-{
-	s->used += diff;
-	v += diff;
-	if (v >= s->end)
-		v -= s->end - s->start;
-	return v;
-}
-
-static __inline const uint8_t *
-audio_stream_add_outp(audio_stream_t *s, const uint8_t *v, int diff)
-{
-	s->used -= diff;
-	v += diff;
-	if (v >= s->end)
-		v -= s->end - s->start;
-	return v;
-}
-
-/**
- * an interface to fill a audio stream buffer
- */
-typedef struct stream_fetcher {
-	int (*fetch_to)(struct audio_softc *, struct stream_fetcher *,
-audio_stream_t *, int);
-} stream_fetcher_t;
-
-/**
- * audio stream filter.
- * This must be an extension of stream_fetcher_t.
- */
-typedef struct stream_filter {
-/* public: */
-	stream_fetcher_t base;
-	void (*dtor)(struct stream_filter *);
-	void (*set_fetcher)(struct stream_filter *, stream_fetcher_t *);
-	void (*set_inputbuffer)(struct stream_filter *, audio_stream_t *);
-/* private: */
-	stream_fetcher_t *prev;
-	audio_stream_t *src;
-} stream_filter_t;
-
-/**
- * factory method for stream_filter_t
- */
-typedef stream_filter_t *stream_filter_factory_t(struct audio_softc *,
-	const audio_params_t *, const audio_params_t *);
-
-/**
- * filter pipeline request
- *
- * filters[0] is the first filter for playing or the last filter for recording.
- * The audio_params_t instance for the hardware is filters[0].param.
- */
-#ifndef AUDIO_MAX_FILTERS
-# define AUDIO_MAX_FILTERS	8
-#endif
-typedef struct stream_filter_list {
-	void (*append)(struct stream_filter_list *, stream_filter_factory_t,
-		   const audio_params_t *);
-	void (*prepend)(struct stream_filter_list *, stream_filter_factory_t,
-			const audio_params_t *);
-	void (*set)(struct stream_filter_list *, int, stream_filter_factory_t,
-		const audio_params_t *);
-	int req_size;
-	struct stream_filter_req {
-		stream_filter_factory_t *factory;
-		audio_params_t param; /* from-param for recording,
-	 to-param for playing */
-	} filters[AUDIO_MAX_FILTERS];
-} stream_filter_list_t;
-
 #include 
 
 struct audio_hw_if {
@@ -232,7 +131,6 @@ struct audio_hw_if {
 		void (*)(void *), void *, const audio_params_t *);
 	int	(*dev_ioctl)(void *, u_long, void *, int, struct lwp *);
 	void	(*get_locks)(void *, kmutex_t **, kmutex_t **);
-
 };
 
 struct audio_attach_args {



CVS commit: [isaki-audio2] src/sys/arch/vax/vsa

2019-05-08 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Wed May  8 11:56:09 UTC 2019

Modified Files:
src/sys/arch/vax/vsa [isaki-audio2]: vsaudio.c

Log Message:
Remove commented out old filters.


To generate a diff of this commit:
cvs rdiff -u -r1.4.2.2 -r1.4.2.3 src/sys/arch/vax/vsa/vsaudio.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/vax/vsa/vsaudio.c
diff -u src/sys/arch/vax/vsa/vsaudio.c:1.4.2.2 src/sys/arch/vax/vsa/vsaudio.c:1.4.2.3
--- src/sys/arch/vax/vsa/vsaudio.c:1.4.2.2	Sat May  4 07:20:08 2019
+++ src/sys/arch/vax/vsa/vsaudio.c	Wed May  8 11:56:09 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: vsaudio.c,v 1.4.2.2 2019/05/04 07:20:08 isaki Exp $	*/
+/*	$NetBSD: vsaudio.c,v 1.4.2.3 2019/05/08 11:56:09 isaki Exp $	*/
 /*	$OpenBSD: vsaudio.c,v 1.4 2013/05/15 21:21:11 ratchov Exp $	*/
 
 /*
@@ -516,57 +516,4 @@ vsaudio_get_locks(void *opaque, kmutex_t
 	*thread = &sc->sc_lock;
 }
 
-/*
-static stream_filter_t *
-vsaudio_input_conv(struct audio_softc *sc, const audio_params_t *from,
-		const audio_params_t *to)
-{
-	return auconv_nocontext_filter_factory(vsaudio_input_conv_fetch_to);
-}
-
-static int
-vsaudio_input_conv_fetch_to(struct audio_softc *sc, stream_fetcher_t *self,
-		audio_stream_t *dst, int max_used)
-{
-	stream_filter_t *this;
-	int m, err;
-
-	this = (stream_filter_t *)self;
-	if ((err = this->prev->fetch_to(sc, this->prev, this->src, max_used * 4)))
-		return err;
-	m = dst->end - dst->start;
-	m = uimin(m, max_used);
-	FILTER_LOOP_PROLOGUE(this->src, 4, dst, 1, m) {
-		*d = ((*(const uint32_t *)s) >> 16) & 0xff;
-	} FILTER_LOOP_EPILOGUE(this->src, dst);
-	return 0;
-}
-
-static stream_filter_t *
-vsaudio_output_conv(struct audio_softc *sc, const audio_params_t *from,
-		const audio_params_t *to)
-{
-	return auconv_nocontext_filter_factory(vsaudio_output_conv_fetch_to);
-}
-
-static int
-vsaudio_output_conv_fetch_to(struct audio_softc *sc, stream_fetcher_t *self,
-		audio_stream_t *dst, int max_used)
-{
-	stream_filter_t *this;
-	int m, err;
-
-	this = (stream_filter_t *)self;
-	max_used = (max_used + 3) & ~3;
-	if ((err = this->prev->fetch_to(sc, this->prev, this->src, max_used / 4)))
-		return err;
-	m = (dst->end - dst->start) & ~3;
-	m = uimin(m, max_used);
-	FILTER_LOOP_PROLOGUE(this->src, 1, dst, 4, m) {
-		*(uint32_t *)d = (*s << 16);
-	} FILTER_LOOP_EPILOGUE(this->src, dst);
-	return 0;
-}
-*/
-
 #endif /* NAUDIO > 0 */



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

2019-05-08 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Wed May  8 09:53:43 UTC 2019

Modified Files:
src/sys/arch/arm/sunxi: sun4i_emac.c

Log Message:
Protect ether_multi list

PR 54153


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/arm/sunxi/sun4i_emac.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/sunxi/sun4i_emac.c
diff -u src/sys/arch/arm/sunxi/sun4i_emac.c:1.7 src/sys/arch/arm/sunxi/sun4i_emac.c:1.8
--- src/sys/arch/arm/sunxi/sun4i_emac.c:1.7	Mon Apr 22 07:51:16 2019
+++ src/sys/arch/arm/sunxi/sun4i_emac.c	Wed May  8 09:53:43 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: sun4i_emac.c,v 1.7 2019/04/22 07:51:16 msaitoh Exp $ */
+/* $NetBSD: sun4i_emac.c,v 1.8 2019/05/08 09:53:43 ozaki-r Exp $ */
 
 /*-
  * Copyright (c) 2013-2017 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include 
 
-__KERNEL_RCSID(1, "$NetBSD: sun4i_emac.c,v 1.7 2019/04/22 07:51:16 msaitoh Exp $");
+__KERNEL_RCSID(1, "$NetBSD: sun4i_emac.c,v 1.8 2019/05/08 09:53:43 ozaki-r Exp $");
 
 #include 
 #include 
@@ -864,9 +864,11 @@ sun4i_emac_rx_hash(struct sun4i_emac_sof
 	if ((ifp->if_flags & IFF_PROMISC) == 0) {
 		hash[0] = hash[1] = 0;
 
+		ETHER_LOCK(&sc->sc_ec);
 		ETHER_FIRST_MULTI(step, &sc->sc_ec, enm);
 		while (enm != NULL) {
 			if (memcmp(enm->enm_addrlo, enm->enm_addrhi, ETHER_ADDR_LEN)) {
+ETHER_UNLOCK(&sc->sc_ec);
 /*
  * We must listen to a range of multicast addresses.
  * For now, just accept all multicasts, rather than
@@ -889,6 +891,7 @@ sun4i_emac_rx_hash(struct sun4i_emac_sof
 			hash[crc >> 5] |= __BIT(crc & 31);
 	ETHER_NEXT_MULTI(step, enm);
 		}
+		ETHER_UNLOCK(&sc->sc_ec);
 		ifp->if_flags &= ~IFF_ALLMULTI;
 		rxctl |= EMAC_RX_CTL_MHF;
 	}



CVS commit: src/share/man/man4

2019-05-08 Thread Constantine A. Murenin
Module Name:src
Committed By:   cnst
Date:   Wed May  8 07:44:28 UTC 2019

Modified Files:
src/share/man/man4: cac.4

Log Message:
cac(4): Xr bio(4) and friends, and mention when it was first introduced


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/share/man/man4/cac.4

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

Modified files:

Index: src/share/man/man4/cac.4
diff -u src/share/man/man4/cac.4:1.13 src/share/man/man4/cac.4:1.14
--- src/share/man/man4/cac.4:1.13	Wed Apr 30 13:10:53 2008
+++ src/share/man/man4/cac.4	Wed May  8 07:44:28 2019
@@ -1,4 +1,4 @@
-.\"	$NetBSD: cac.4,v 1.13 2008/04/30 13:10:53 martin Exp $
+.\"	$NetBSD: cac.4,v 1.14 2019/05/08 07:44:28 cnst Exp $
 .\"
 .\" Copyright (c) 2000 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -27,7 +27,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd October 17, 2000
+.Dd May 8, 2019
 .Dt CAC 4
 .Os
 .Sh NAME
@@ -45,6 +45,13 @@ controllers.
 Disk arrays are supported by the
 .Nm ld
 driver.
+Monitoring of volume status is supported through the
+.Xr bioctl 8
+and
+.Xr envstat 8
+utilities, as well as the
+.Xr powerd 8
+monitoring daemon.
 .Sh HARDWARE
 The
 .Nm
@@ -69,10 +76,21 @@ driver provides support for the followin
 .It Tn Compaq SMART-2SL
 .El
 .Sh SEE ALSO
+.Xr bio 4 ,
+.Xr envsys 4 ,
 .Xr intro 4 ,
-.Xr ld 4
+.Xr ld 4 ,
+.Xr bioctl 8 ,
+.Xr envstat 8 ,
+.Xr powerd 8
 .Sh HISTORY
 The
 .Nm cac
 driver first appeared in
 .Nx 1.5 .
+Support for volume monitoring through
+.Xr bio 4
+and
+.Xr envsys 4
+was added in
+.Nx 5.0 .



CVS commit: src/share/man/man4

2019-05-08 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Wed May  8 07:41:23 UTC 2019

Modified Files:
src/share/man/man4: bio.4

Log Message:
Make enumerations consistent, and use Dv for BIO*.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/share/man/man4/bio.4

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

Modified files:

Index: src/share/man/man4/bio.4
diff -u src/share/man/man4/bio.4:1.15 src/share/man/man4/bio.4:1.16
--- src/share/man/man4/bio.4:1.15	Wed May  8 06:57:18 2019
+++ src/share/man/man4/bio.4	Wed May  8 07:41:23 2019
@@ -1,4 +1,4 @@
-.\"	$NetBSD: bio.4,v 1.15 2019/05/08 06:57:18 cnst Exp $
+.\"	$NetBSD: bio.4,v 1.16 2019/05/08 07:41:23 wiz Exp $
 .\"	$OpenBSD: bio.4,v 1.19 2006/09/20 22:22:37 jmc Exp $
 .\"
 .\" Copyright (c) 2002 Niklas Hallqvist
@@ -94,7 +94,7 @@ vendor name, serial number, and processo
 .\" or safte
 .It Dv BIOCDISK_NOVOL
 Is just the same as
-.Em BIOCDISK
+.Dv BIOCDISK
 but doesn't require the disks to be in volume sets, so this
 applies to any physical disk connected to the controller.
 .Pp
@@ -102,11 +102,12 @@ Note: this ioctl might not be supported 
 It is supported by
 .Xr arcmsr 4 ,
 .Xr ciss 4 ,
+and
 .Xr mpt 4 .
 It is also supported by
 .Xr cac 4 ,
 but handled exactly the same as
-.Em BIOCDISK .
+.Dv BIOCDISK .
 .It Dv BIOCVOL
 Retrieve detailed information for the specified volume.
 Information returned can include status, size, RAID level, number of disks,
@@ -119,7 +120,7 @@ test alarm.
 Note: These options might not be supported on all hardware.
 It is supported by
 .Xr arcmsr 4 ,
-.Xr mfi 4
+.Xr mfi 4 ,
 and
 .Xr mfii 4 .
 .It Dv BIOCBLINK
@@ -133,8 +134,8 @@ Note: This option is only supported if t
 and the hardware supports hardware blinking.
 It is supported by
 .Xr ciss 4 ,
-.Xr mfi 4
-and 
+.Xr mfi 4 ,
+and
 .Xr mfii 4 .
 .It Dv BIOCSETSTATE
 Alter the state of specified physical disk.
@@ -144,7 +145,7 @@ disk, start/stop consistency check in a 
 Note: These options might not be supported on all hardware.
 Some of these options are supported by
 .Xr arcmsr 4 ,
-.Xr mfi 4
+.Xr mfi 4 ,
 and
 .Xr mfii 4 .
 .It Dv BIOCVOLOPS



CVS commit: src/share/man/man4

2019-05-08 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Wed May  8 07:17:29 UTC 2019

Modified Files:
src/share/man/man4: mpii.4

Log Message:
Revert previous, misunderstanding.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/share/man/man4/mpii.4

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

Modified files:

Index: src/share/man/man4/mpii.4
diff -u src/share/man/man4/mpii.4:1.6 src/share/man/man4/mpii.4:1.7
--- src/share/man/man4/mpii.4:1.6	Wed May  8 06:09:51 2019
+++ src/share/man/man4/mpii.4	Wed May  8 07:17:29 2019
@@ -1,4 +1,4 @@
-.\"	$NetBSD: mpii.4,v 1.6 2019/05/08 06:09:51 wiz Exp $
+.\"	$NetBSD: mpii.4,v 1.7 2019/05/08 07:17:29 wiz Exp $
 .\"	OpenBSD: mpii.4,v 1.8 2010/10/01 12:27:36 mikeb Exp
 .\"
 .\" Copyright (c) 2010 Marco Peereboom 
@@ -99,7 +99,7 @@ The
 .Nm
 driver first appeared in
 .Ox 4.7 .
-.Nm
+.Nx
 support was added in
 .Nx 6.0 .
 .Sh AUTHORS