CVS commit: src/sys/netipsec

2017-08-01 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Wed Aug  2 04:03:29 UTC 2017

Modified Files:
src/sys/netipsec: ipsec.c

Log Message:
Comment out unused functions


To generate a diff of this commit:
cvs rdiff -u -r1.114 -r1.115 src/sys/netipsec/ipsec.c

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



CVS commit: src/sys/netipsec

2017-08-01 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Wed Aug  2 04:03:29 UTC 2017

Modified Files:
src/sys/netipsec: ipsec.c

Log Message:
Comment out unused functions


To generate a diff of this commit:
cvs rdiff -u -r1.114 -r1.115 src/sys/netipsec/ipsec.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/netipsec/ipsec.c
diff -u src/sys/netipsec/ipsec.c:1.114 src/sys/netipsec/ipsec.c:1.115
--- src/sys/netipsec/ipsec.c:1.114	Wed Aug  2 03:45:57 2017
+++ src/sys/netipsec/ipsec.c	Wed Aug  2 04:03:28 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: ipsec.c,v 1.114 2017/08/02 03:45:57 ozaki-r Exp $	*/
+/*	$NetBSD: ipsec.c,v 1.115 2017/08/02 04:03:28 ozaki-r Exp $	*/
 /*	$FreeBSD: /usr/local/www/cvsroot/FreeBSD/src/sys/netipsec/ipsec.c,v 1.2.2.2 2003/07/01 01:38:13 sam Exp $	*/
 /*	$KAME: ipsec.c,v 1.103 2001/05/24 07:14:18 sakane Exp $	*/
 
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ipsec.c,v 1.114 2017/08/02 03:45:57 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ipsec.c,v 1.115 2017/08/02 04:03:28 ozaki-r Exp $");
 
 /*
  * IPsec controller part.
@@ -198,7 +198,9 @@ static void ipsec6_get_ulp (struct mbuf 
 static int ipsec6_setspidx_ipaddr (struct mbuf *, struct secpolicyindex *);
 #endif
 static void ipsec_delpcbpolicy (struct inpcbpolicy *);
+#if 0 /* unused */
 static struct secpolicy *ipsec_deepcopy_policy (const struct secpolicy *);
+#endif
 static int ipsec_set_policy (struct secpolicy **, int, const void *, size_t,
 kauth_cred_t);
 static int ipsec_get_policy (struct secpolicy *, struct mbuf **);
@@ -1277,6 +1279,7 @@ ipsec_init_policy(struct socket *so, str
 	return 0;
 }
 
+#if 0 /* unused */
 /* copy old ipsec policy into new */
 int
 ipsec_copy_policy(const struct inpcbpolicy *old, struct inpcbpolicy *new)
@@ -1346,6 +1349,7 @@ ipsec_deepcopy_policy(const struct secpo
 
 	return dst;
 }
+#endif
 
 static void
 ipsec_destroy_policy(struct secpolicy *sp)



CVS commit: src/sys/netipsec

2017-08-01 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Wed Aug  2 03:45:57 UTC 2017

Modified Files:
src/sys/netipsec: ipsec.c key.c

Log Message:
Don't use KEY_NEWSP for dummy SP entries

By the change KEY_NEWSP is now not called from softint anymore
and we can use kmem_zalloc with KM_SLEEP for KEY_NEWSP.


To generate a diff of this commit:
cvs rdiff -u -r1.113 -r1.114 src/sys/netipsec/ipsec.c
cvs rdiff -u -r1.199 -r1.200 src/sys/netipsec/key.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/netipsec/ipsec.c
diff -u src/sys/netipsec/ipsec.c:1.113 src/sys/netipsec/ipsec.c:1.114
--- src/sys/netipsec/ipsec.c:1.113	Wed Aug  2 01:28:03 2017
+++ src/sys/netipsec/ipsec.c	Wed Aug  2 03:45:57 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: ipsec.c,v 1.113 2017/08/02 01:28:03 ozaki-r Exp $	*/
+/*	$NetBSD: ipsec.c,v 1.114 2017/08/02 03:45:57 ozaki-r Exp $	*/
 /*	$FreeBSD: /usr/local/www/cvsroot/FreeBSD/src/sys/netipsec/ipsec.c,v 1.2.2.2 2003/07/01 01:38:13 sam Exp $	*/
 /*	$KAME: ipsec.c,v 1.103 2001/05/24 07:14:18 sakane Exp $	*/
 
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ipsec.c,v 1.113 2017/08/02 01:28:03 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ipsec.c,v 1.114 2017/08/02 03:45:57 ozaki-r Exp $");
 
 /*
  * IPsec controller part.
@@ -1253,7 +1253,8 @@ ipsec_init_policy(struct socket *so, str
 	 * These SPs are dummy. Never be used because the policy
 	 * is ENTRUST. See ipsec_getpolicybysock.
 	 */
-	if ((new->sp_in = KEY_NEWSP()) == NULL) {
+	new->sp_in = kmem_intr_zalloc(sizeof(struct secpolicy), KM_NOSLEEP);
+	if (new->sp_in == NULL) {
 		ipsec_delpcbpolicy(new);
 		return ENOBUFS;
 	}
@@ -1261,8 +1262,9 @@ ipsec_init_policy(struct socket *so, str
 	new->sp_in->policy = IPSEC_POLICY_ENTRUST;
 	new->sp_in->created = 0; /* Indicates dummy */
 
-	if ((new->sp_out = KEY_NEWSP()) == NULL) {
-		KEY_SP_UNREF(>sp_in);
+	new->sp_out = kmem_intr_zalloc(sizeof(struct secpolicy), KM_NOSLEEP);
+	if (new->sp_out == NULL) {
+		kmem_intr_free(new->sp_in, sizeof(struct secpolicy));
 		ipsec_delpcbpolicy(new);
 		return ENOBUFS;
 	}
@@ -1351,7 +1353,7 @@ ipsec_destroy_policy(struct secpolicy *s
 
 	if (sp->created == 0)
 		/* It's dummy. We can simply free it */
-		key_free_sp(sp);
+		kmem_intr_free(sp, sizeof(*sp));
 	else {
 		/*
 		 * We cannot destroy here because it can be called in

Index: src/sys/netipsec/key.c
diff -u src/sys/netipsec/key.c:1.199 src/sys/netipsec/key.c:1.200
--- src/sys/netipsec/key.c:1.199	Wed Aug  2 02:12:42 2017
+++ src/sys/netipsec/key.c	Wed Aug  2 03:45:57 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: key.c,v 1.199 2017/08/02 02:12:42 ozaki-r Exp $	*/
+/*	$NetBSD: key.c,v 1.200 2017/08/02 03:45:57 ozaki-r Exp $	*/
 /*	$FreeBSD: src/sys/netipsec/key.c,v 1.3.2.3 2004/02/14 22:23:23 bms Exp $	*/
 /*	$KAME: key.c,v 1.191 2001/06/27 10:46:49 sakane Exp $	*/
 
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: key.c,v 1.199 2017/08/02 02:12:42 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: key.c,v 1.200 2017/08/02 03:45:57 ozaki-r Exp $");
 
 /*
  * This code is referd to RFC 2367
@@ -1376,11 +1376,11 @@ key_free_sp(struct secpolicy *sp)
 
 	while (isr != NULL) {
 		nextisr = isr->next;
-		kmem_intr_free(isr, sizeof(*isr));
+		kmem_free(isr, sizeof(*isr));
 		isr = nextisr;
 	}
 
-	kmem_intr_free(sp, sizeof(*sp));
+	kmem_free(sp, sizeof(*sp));
 }
 
 void
@@ -1516,7 +1516,7 @@ key_newsp(const char* where, int tag)
 {
 	struct secpolicy *newsp = NULL;
 
-	newsp = kmem_intr_zalloc(sizeof(struct secpolicy), KM_NOSLEEP);
+	newsp = kmem_zalloc(sizeof(struct secpolicy), KM_SLEEP);
 
 	KEYDEBUG_PRINTF(KEYDEBUG_IPSEC_STAMP,
 	"DP from %s:%u return SP:%p\n", where, tag, newsp);



CVS commit: src/sys/netipsec

2017-08-01 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Wed Aug  2 03:45:57 UTC 2017

Modified Files:
src/sys/netipsec: ipsec.c key.c

Log Message:
Don't use KEY_NEWSP for dummy SP entries

By the change KEY_NEWSP is now not called from softint anymore
and we can use kmem_zalloc with KM_SLEEP for KEY_NEWSP.


To generate a diff of this commit:
cvs rdiff -u -r1.113 -r1.114 src/sys/netipsec/ipsec.c
cvs rdiff -u -r1.199 -r1.200 src/sys/netipsec/key.c

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



CVS commit: src

2017-08-01 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Wed Aug  2 02:19:57 UTC 2017

Modified Files:
src/distrib/sets/lists/tests: mi
src/tests/net/ipsec: Makefile
Added Files:
src/tests/net/ipsec: t_ipsec_sockopt.sh

Log Message:
Add test cases for setsockopt(IP_IPSEC_POLICY)


To generate a diff of this commit:
cvs rdiff -u -r1.758 -r1.759 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.8 -r1.9 src/tests/net/ipsec/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/net/ipsec/t_ipsec_sockopt.sh

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/tests/mi
diff -u src/distrib/sets/lists/tests/mi:1.758 src/distrib/sets/lists/tests/mi:1.759
--- src/distrib/sets/lists/tests/mi:1.758	Sun Jul 23 19:26:06 2017
+++ src/distrib/sets/lists/tests/mi	Wed Aug  2 02:19:56 2017
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.758 2017/07/23 19:26:06 perseant Exp $
+# $NetBSD: mi,v 1.759 2017/08/02 02:19:56 ozaki-r Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -3322,6 +3322,7 @@
 ./usr/tests/net/ipsec/t_ipsec_gif		tests-net-tests		atf,rump
 ./usr/tests/net/ipsec/t_ipsec_l2tp		tests-net-tests		atf,rump
 ./usr/tests/net/ipsec/t_ipsec_misc		tests-net-tests		atf,rump
+./usr/tests/net/ipsec/t_ipsec_sockopt		tests-net-tests		atf,rump
 ./usr/tests/net/ipsec/t_ipsec_sysctl		tests-net-tests		atf,rump
 ./usr/tests/net/ipsec/t_ipsec_tcp		tests-net-tests		atf,rump
 ./usr/tests/net/ipsec/t_ipsec_transport		tests-net-tests		atf,rump

Index: src/tests/net/ipsec/Makefile
diff -u src/tests/net/ipsec/Makefile:1.8 src/tests/net/ipsec/Makefile:1.9
--- src/tests/net/ipsec/Makefile:1.8	Tue Jul 18 02:16:07 2017
+++ src/tests/net/ipsec/Makefile	Wed Aug  2 02:19:56 2017
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.8 2017/07/18 02:16:07 ozaki-r Exp $
+# $NetBSD: Makefile,v 1.9 2017/08/02 02:19:56 ozaki-r Exp $
 #
 
 .include 
@@ -6,8 +6,8 @@
 TESTSDIR=	${TESTSBASE}/net/ipsec
 
 .for name in ipsec_ah_keys ipsec_esp_keys ipsec_gif ipsec_l2tp ipsec_misc \
-ipsec_sysctl ipsec_tcp ipsec_transport ipsec_tunnel ipsec_tunnel_ipcomp \
-ipsec_tunnel_odd
+ipsec_sockopt ipsec_sysctl ipsec_tcp ipsec_transport ipsec_tunnel \
+ipsec_tunnel_ipcomp ipsec_tunnel_odd
 TESTS_SH+=		t_${name}
 TESTS_SH_SRC_t_${name}=	../net_common.sh ./common.sh ./algorithms.sh \
 t_${name}.sh

Added files:

Index: src/tests/net/ipsec/t_ipsec_sockopt.sh
diff -u /dev/null src/tests/net/ipsec/t_ipsec_sockopt.sh:1.1
--- /dev/null	Wed Aug  2 02:19:57 2017
+++ src/tests/net/ipsec/t_ipsec_sockopt.sh	Wed Aug  2 02:19:56 2017
@@ -0,0 +1,390 @@
+#	$NetBSD: t_ipsec_sockopt.sh,v 1.1 2017/08/02 02:19:56 ozaki-r Exp $
+#
+# Copyright (c) 2017 Internet Initiative Japan Inc.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#notice, this list of conditions and the following disclaimer in the
+#documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+
+SOCK_LOCAL=unix://ipsec_local
+SOCK_PEER=unix://ipsec_peer
+BUS=./bus_ipsec
+
+DEBUG=${DEBUG:-false}
+
+check_packets()
+{
+	local outfile=$1
+	local src=$2
+	local dst=$3
+	local pktproto_out=$4
+	local pktproto_in=${5:-$4}
+
+	atf_check -s exit:0 -o match:"$src > $dst: $pktproto_out" cat $outfile
+	atf_check -s exit:0 -o match:"$dst > $src: $pktproto_in" cat $outfile
+}
+
+test_ipsec4_IP_IPSEC_POLICY()
+{
+	local proto=$1
+	local algo=$2
+	local ip_local=10.0.0.1
+	local ip_peer=10.0.0.2
+	local tmpfile=./tmp
+	local outfile=./out
+	local pktproto=$(generate_pktproto $proto)
+	local algo_args="$(generate_algo_args $proto $algo)"
+	local pktsizeopt=
+	local pingopt= pingopt2=
+
+	rump_server_crypto_start $SOCK_LOCAL netipsec
+	rump_server_crypto_start $SOCK_PEER netipsec
+	rump_server_add_iface $SOCK_LOCAL shmif0 $BUS
+	rump_server_add_iface 

CVS commit: src

2017-08-01 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Wed Aug  2 02:19:57 UTC 2017

Modified Files:
src/distrib/sets/lists/tests: mi
src/tests/net/ipsec: Makefile
Added Files:
src/tests/net/ipsec: t_ipsec_sockopt.sh

Log Message:
Add test cases for setsockopt(IP_IPSEC_POLICY)


To generate a diff of this commit:
cvs rdiff -u -r1.758 -r1.759 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.8 -r1.9 src/tests/net/ipsec/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/net/ipsec/t_ipsec_sockopt.sh

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



CVS commit: src/sys/netinet6

2017-08-01 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Wed Aug  2 02:18:17 UTC 2017

Modified Files:
src/sys/netinet6: icmp6.c

Log Message:
Add missing IPsec policy checks to icmp6_rip6_input

icmp6_rip6_input is quite similar to rip6_input and the same checks exist
in rip6_input.


To generate a diff of this commit:
cvs rdiff -u -r1.212 -r1.213 src/sys/netinet6/icmp6.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/netinet6/icmp6.c
diff -u src/sys/netinet6/icmp6.c:1.212 src/sys/netinet6/icmp6.c:1.213
--- src/sys/netinet6/icmp6.c:1.212	Fri Jul  7 00:55:15 2017
+++ src/sys/netinet6/icmp6.c	Wed Aug  2 02:18:17 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: icmp6.c,v 1.212 2017/07/07 00:55:15 knakahara Exp $	*/
+/*	$NetBSD: icmp6.c,v 1.213 2017/08/02 02:18:17 ozaki-r Exp $	*/
 /*	$KAME: icmp6.c,v 1.217 2001/06/20 15:03:29 jinmei Exp $	*/
 
 /*
@@ -62,7 +62,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: icmp6.c,v 1.212 2017/07/07 00:55:15 knakahara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: icmp6.c,v 1.213 2017/08/02 02:18:17 ozaki-r Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -104,6 +104,9 @@ __KERNEL_RCSID(0, "$NetBSD: icmp6.c,v 1.
 
 #ifdef IPSEC
 #include 
+#include 
+#include 
+#include 
 #include 
 #endif
 
@@ -2005,6 +2008,12 @@ icmp6_rip6_input(struct mbuf **mp, int o
 			continue;
 		if (last) {
 			struct	mbuf *n;
+#ifdef IPSEC
+			/*
+			 * Check AH/ESP integrity
+			 */
+			if (ipsec_used && !ipsec6_in_reject(m, last))
+#endif /* IPSEC */
 			if ((n = m_copy(m, 0, (int)M_COPYALL)) != NULL) {
 if (last->in6p_flags & IN6P_CONTROLOPTS)
 	ip6_savecontrol(last, , ip6, n);
@@ -2023,6 +2032,20 @@ icmp6_rip6_input(struct mbuf **mp, int o
 		}
 		last = in6p;
 	}
+#ifdef IPSEC
+	if (ipsec_used && last && ipsec6_in_reject(m, last)) {
+		m_freem(m);
+		/*
+		 * XXX ipsec6_in_reject update stat if there is an error
+		 * so we just need to update stats by hand in the case of last is
+		 * NULL
+		 */
+		if (!last)
+			IPSEC6_STATINC(IPSEC_STAT_IN_POLVIO);
+			IP6_STATDEC(IP6_STAT_DELIVERED);
+			/* do not inject data into pcb */
+		} else
+#endif /* IPSEC */
 	if (last) {
 		if (last->in6p_flags & IN6P_CONTROLOPTS)
 			ip6_savecontrol(last, , ip6, m);



CVS commit: src/sys/netinet6

2017-08-01 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Wed Aug  2 02:18:17 UTC 2017

Modified Files:
src/sys/netinet6: icmp6.c

Log Message:
Add missing IPsec policy checks to icmp6_rip6_input

icmp6_rip6_input is quite similar to rip6_input and the same checks exist
in rip6_input.


To generate a diff of this commit:
cvs rdiff -u -r1.212 -r1.213 src/sys/netinet6/icmp6.c

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



CVS commit: src/sys/netipsec

2017-08-01 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Wed Aug  2 02:12:42 UTC 2017

Modified Files:
src/sys/netipsec: key.c

Log Message:
Fix updating ipsec_used; turn on when SPs on sockets are added


To generate a diff of this commit:
cvs rdiff -u -r1.198 -r1.199 src/sys/netipsec/key.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/netipsec/key.c
diff -u src/sys/netipsec/key.c:1.198 src/sys/netipsec/key.c:1.199
--- src/sys/netipsec/key.c:1.198	Wed Aug  2 01:59:26 2017
+++ src/sys/netipsec/key.c	Wed Aug  2 02:12:42 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: key.c,v 1.198 2017/08/02 01:59:26 ozaki-r Exp $	*/
+/*	$NetBSD: key.c,v 1.199 2017/08/02 02:12:42 ozaki-r Exp $	*/
 /*	$FreeBSD: src/sys/netipsec/key.c,v 1.3.2.3 2004/02/14 22:23:23 bms Exp $	*/
 /*	$KAME: key.c,v 1.191 2001/06/27 10:46:49 sakane Exp $	*/
 
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: key.c,v 1.198 2017/08/02 01:59:26 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: key.c,v 1.199 2017/08/02 02:12:42 ozaki-r Exp $");
 
 /*
  * This code is referd to RFC 2367
@@ -252,6 +252,9 @@ static struct pslist_head key_socksplist
 #define SOCKSPLIST_WRITER_FOREACH(sp)	\
 	PSLIST_WRITER_FOREACH((sp), _socksplist, struct secpolicy,	\
 	  pslist_entry)
+#define SOCKSPLIST_READER_EMPTY()	\
+	(PSLIST_READER_FIRST(_socksplist, struct secpolicy,		\
+	 pslist_entry) == NULL)
 
 /*
  * Protect regtree, acqtree and items stored in the lists.
@@ -1387,6 +1390,8 @@ key_socksplist_add(struct secpolicy *sp)
 	mutex_enter(_sp_mtx);
 	PSLIST_WRITER_INSERT_HEAD(_socksplist, sp, pslist_entry);
 	mutex_exit(_sp_mtx);
+
+	key_update_used();
 }
 
 /*
@@ -8069,7 +8074,8 @@ key_setspddump(int *errorp, pid_t pid)
 int
 key_get_used(void) {
 	return !SPLIST_READER_EMPTY(IPSEC_DIR_INBOUND) ||
-	!SPLIST_READER_EMPTY(IPSEC_DIR_OUTBOUND);
+	!SPLIST_READER_EMPTY(IPSEC_DIR_OUTBOUND) ||
+	!SOCKSPLIST_READER_EMPTY();
 }
 
 void



CVS commit: src/sys/netipsec

2017-08-01 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Wed Aug  2 02:12:42 UTC 2017

Modified Files:
src/sys/netipsec: key.c

Log Message:
Fix updating ipsec_used; turn on when SPs on sockets are added


To generate a diff of this commit:
cvs rdiff -u -r1.198 -r1.199 src/sys/netipsec/key.c

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



CVS commit: src/sys/netipsec

2017-08-01 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Wed Aug  2 01:59:26 UTC 2017

Modified Files:
src/sys/netipsec: key.c

Log Message:
Fix updating ipsec_used

- key_update_used wasn't called in key_api_spddelete2 and key_api_spdflush
- key_update_used wasn't called if an SP had been added/deleted but
  a reply to userland failed


To generate a diff of this commit:
cvs rdiff -u -r1.197 -r1.198 src/sys/netipsec/key.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/netipsec/key.c
diff -u src/sys/netipsec/key.c:1.197 src/sys/netipsec/key.c:1.198
--- src/sys/netipsec/key.c:1.197	Wed Aug  2 01:28:03 2017
+++ src/sys/netipsec/key.c	Wed Aug  2 01:59:26 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: key.c,v 1.197 2017/08/02 01:28:03 ozaki-r Exp $	*/
+/*	$NetBSD: key.c,v 1.198 2017/08/02 01:59:26 ozaki-r Exp $	*/
 /*	$FreeBSD: src/sys/netipsec/key.c,v 1.3.2.3 2004/02/14 22:23:23 bms Exp $	*/
 /*	$KAME: key.c,v 1.191 2001/06/27 10:46:49 sakane Exp $	*/
 
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: key.c,v 1.197 2017/08/02 01:28:03 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: key.c,v 1.198 2017/08/02 01:59:26 ozaki-r Exp $");
 
 /*
  * This code is referd to RFC 2367
@@ -1362,6 +1362,8 @@ key_destroy_sp(struct secpolicy *sp)
 	localcount_fini(>localcount);
 
 	key_free_sp(sp);
+
+	key_update_used();
 }
 
 void
@@ -2028,6 +2030,8 @@ key_api_spdadd(struct socket *so, struct
 #endif /* INET6 */
 #endif /* GATEWAY */
 
+	key_update_used();
+
 {
 	struct mbuf *n, *mpolicy;
 	int off;
@@ -2064,7 +2068,6 @@ key_api_spdadd(struct socket *so, struct
 	xpl->sadb_x_policy_id = newsp->id;
 
 	m_freem(m);
-	key_update_used();
 	return key_sendup_mbuf(so, n, KEY_SENDUP_ALL);
 }
 }
@@ -2177,7 +2180,6 @@ key_api_spddelete(struct socket *so, str
 		return key_senderror(so, m, ENOBUFS);
 
 	m_freem(m);
-	key_update_used();
 	return key_sendup_mbuf(so, n, KEY_SENDUP_ALL);
 }
 }



CVS commit: src/sys/netipsec

2017-08-01 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Wed Aug  2 01:59:26 UTC 2017

Modified Files:
src/sys/netipsec: key.c

Log Message:
Fix updating ipsec_used

- key_update_used wasn't called in key_api_spddelete2 and key_api_spdflush
- key_update_used wasn't called if an SP had been added/deleted but
  a reply to userland failed


To generate a diff of this commit:
cvs rdiff -u -r1.197 -r1.198 src/sys/netipsec/key.c

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



CVS commit: src/sys

2017-08-01 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Wed Aug  2 01:28:03 UTC 2017

Modified Files:
src/sys/netinet6: ip6_forward.c ip6_output.c
src/sys/netipsec: ipsec.c ipsec.h key.c key.h xform_ah.c xform_esp.c
xform_ipcomp.c
src/sys/rump/librump/rumpnet: net_stub.c

Log Message:
Make IPsec SPD MP-safe

We use localcount(9), not psref(9), to make the sptree and secpolicy (SP)
entries MP-safe because SPs need to be referenced over opencrypto
processing that executes a callback in a different context.

SPs on sockets aren't managed by the sptree and can be destroyed in softint.
localcount_drain cannot be used in softint so we delay the destruction of
such SPs to a thread context. To do so, a list to manage such SPs is added
(key_socksplist) and key_timehandler_spd deletes dead SPs in the list.

For more details please read the locking notes in key.c.

Proposed on tech-kern@ and tech-net@


To generate a diff of this commit:
cvs rdiff -u -r1.87 -r1.88 src/sys/netinet6/ip6_forward.c
cvs rdiff -u -r1.192 -r1.193 src/sys/netinet6/ip6_output.c
cvs rdiff -u -r1.112 -r1.113 src/sys/netipsec/ipsec.c
cvs rdiff -u -r1.57 -r1.58 src/sys/netipsec/ipsec.h
cvs rdiff -u -r1.196 -r1.197 src/sys/netipsec/key.c
cvs rdiff -u -r1.25 -r1.26 src/sys/netipsec/key.h
cvs rdiff -u -r1.69 -r1.70 src/sys/netipsec/xform_ah.c
cvs rdiff -u -r1.67 -r1.68 src/sys/netipsec/xform_esp.c
cvs rdiff -u -r1.48 -r1.49 src/sys/netipsec/xform_ipcomp.c
cvs rdiff -u -r1.26 -r1.27 src/sys/rump/librump/rumpnet/net_stub.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/netinet6/ip6_forward.c
diff -u src/sys/netinet6/ip6_forward.c:1.87 src/sys/netinet6/ip6_forward.c:1.88
--- src/sys/netinet6/ip6_forward.c:1.87	Tue May  9 04:24:10 2017
+++ src/sys/netinet6/ip6_forward.c	Wed Aug  2 01:28:03 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: ip6_forward.c,v 1.87 2017/05/09 04:24:10 ozaki-r Exp $	*/
+/*	$NetBSD: ip6_forward.c,v 1.88 2017/08/02 01:28:03 ozaki-r Exp $	*/
 /*	$KAME: ip6_forward.c,v 1.109 2002/09/11 08:10:17 sakane Exp $	*/
 
 /*
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ip6_forward.c,v 1.87 2017/05/09 04:24:10 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip6_forward.c,v 1.88 2017/08/02 01:28:03 ozaki-r Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_gateway.h"
@@ -462,7 +462,7 @@ ip6_forward(struct mbuf *m, int srcrt)
  out:
 #ifdef IPSEC
 	if (sp != NULL)
-		KEY_FREESP();
+		KEY_SP_UNREF();
 #endif
 	rtcache_unref(rt, ro);
 	if (ro != NULL)

Index: src/sys/netinet6/ip6_output.c
diff -u src/sys/netinet6/ip6_output.c:1.192 src/sys/netinet6/ip6_output.c:1.193
--- src/sys/netinet6/ip6_output.c:1.192	Mon Jun 26 08:01:53 2017
+++ src/sys/netinet6/ip6_output.c	Wed Aug  2 01:28:03 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: ip6_output.c,v 1.192 2017/06/26 08:01:53 ozaki-r Exp $	*/
+/*	$NetBSD: ip6_output.c,v 1.193 2017/08/02 01:28:03 ozaki-r Exp $	*/
 /*	$KAME: ip6_output.c,v 1.172 2001/03/25 09:55:56 itojun Exp $	*/
 
 /*
@@ -62,7 +62,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ip6_output.c,v 1.192 2017/06/26 08:01:53 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip6_output.c,v 1.193 2017/08/02 01:28:03 ozaki-r Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -1069,7 +1069,7 @@ done:
 
 #ifdef IPSEC
 	if (sp != NULL)
-		KEY_FREESP();
+		KEY_SP_UNREF();
 #endif /* IPSEC */
 
 	if_put(ifp, );

Index: src/sys/netipsec/ipsec.c
diff -u src/sys/netipsec/ipsec.c:1.112 src/sys/netipsec/ipsec.c:1.113
--- src/sys/netipsec/ipsec.c:1.112	Wed Jul 26 07:39:54 2017
+++ src/sys/netipsec/ipsec.c	Wed Aug  2 01:28:03 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: ipsec.c,v 1.112 2017/07/26 07:39:54 ozaki-r Exp $	*/
+/*	$NetBSD: ipsec.c,v 1.113 2017/08/02 01:28:03 ozaki-r Exp $	*/
 /*	$FreeBSD: /usr/local/www/cvsroot/FreeBSD/src/sys/netipsec/ipsec.c,v 1.2.2.2 2003/07/01 01:38:13 sam Exp $	*/
 /*	$KAME: ipsec.c,v 1.103 2001/05/24 07:14:18 sakane Exp $	*/
 
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ipsec.c,v 1.112 2017/07/26 07:39:54 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ipsec.c,v 1.113 2017/08/02 01:28:03 ozaki-r Exp $");
 
 /*
  * IPsec controller part.
@@ -59,6 +59,7 @@ __KERNEL_RCSID(0, "$NetBSD: ipsec.c,v 1.
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -201,6 +202,7 @@ static struct secpolicy *ipsec_deepcopy_
 static int ipsec_set_policy (struct secpolicy **, int, const void *, size_t,
 kauth_cred_t);
 static int ipsec_get_policy (struct secpolicy *, struct mbuf **);
+static void ipsec_destroy_policy(struct secpolicy *);
 static void vshiftl (unsigned char *, int, int);
 static size_t ipsec_hdrsiz (const struct secpolicy *);
 
@@ -211,34 +213,49 @@ static struct secpolicy *
 ipsec_checkpcbcache(struct mbuf *m, struct inpcbpolicy *pcbsp, int dir)
 {
 	struct secpolicyindex spidx;
+	struct secpolicy *sp = NULL;
+	int s;
 
 	KASSERT(IPSEC_DIR_IS_VALID(dir));
 	KASSERT(pcbsp 

CVS commit: src/sys

2017-08-01 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Wed Aug  2 01:28:03 UTC 2017

Modified Files:
src/sys/netinet6: ip6_forward.c ip6_output.c
src/sys/netipsec: ipsec.c ipsec.h key.c key.h xform_ah.c xform_esp.c
xform_ipcomp.c
src/sys/rump/librump/rumpnet: net_stub.c

Log Message:
Make IPsec SPD MP-safe

We use localcount(9), not psref(9), to make the sptree and secpolicy (SP)
entries MP-safe because SPs need to be referenced over opencrypto
processing that executes a callback in a different context.

SPs on sockets aren't managed by the sptree and can be destroyed in softint.
localcount_drain cannot be used in softint so we delay the destruction of
such SPs to a thread context. To do so, a list to manage such SPs is added
(key_socksplist) and key_timehandler_spd deletes dead SPs in the list.

For more details please read the locking notes in key.c.

Proposed on tech-kern@ and tech-net@


To generate a diff of this commit:
cvs rdiff -u -r1.87 -r1.88 src/sys/netinet6/ip6_forward.c
cvs rdiff -u -r1.192 -r1.193 src/sys/netinet6/ip6_output.c
cvs rdiff -u -r1.112 -r1.113 src/sys/netipsec/ipsec.c
cvs rdiff -u -r1.57 -r1.58 src/sys/netipsec/ipsec.h
cvs rdiff -u -r1.196 -r1.197 src/sys/netipsec/key.c
cvs rdiff -u -r1.25 -r1.26 src/sys/netipsec/key.h
cvs rdiff -u -r1.69 -r1.70 src/sys/netipsec/xform_ah.c
cvs rdiff -u -r1.67 -r1.68 src/sys/netipsec/xform_esp.c
cvs rdiff -u -r1.48 -r1.49 src/sys/netipsec/xform_ipcomp.c
cvs rdiff -u -r1.26 -r1.27 src/sys/rump/librump/rumpnet/net_stub.c

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



CVS commit: src/sys/dev/hpc

2017-08-01 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Wed Aug  2 00:58:18 UTC 2017

Modified Files:
src/sys/dev/hpc: hpf1275a_tty.c

Log Message:
Fix the previous fix that doesn't even compile.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/sys/dev/hpc/hpf1275a_tty.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/hpc/hpf1275a_tty.c
diff -u src/sys/dev/hpc/hpf1275a_tty.c:1.27 src/sys/dev/hpc/hpf1275a_tty.c:1.28
--- src/sys/dev/hpc/hpf1275a_tty.c:1.27	Fri Jun 28 14:44:15 2013
+++ src/sys/dev/hpc/hpf1275a_tty.c	Wed Aug  2 00:58:18 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: hpf1275a_tty.c,v 1.27 2013/06/28 14:44:15 christos Exp $ */
+/*	$NetBSD: hpf1275a_tty.c,v 1.28 2017/08/02 00:58:18 uwe Exp $ */
 
 /*
  * Copyright (c) 2004 Valeriy E. Ushakov
@@ -28,7 +28,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: hpf1275a_tty.c,v 1.27 2013/06/28 14:44:15 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hpf1275a_tty.c,v 1.28 2017/08/02 00:58:18 uwe Exp $");
 
 #include "opt_wsdisplay_compat.h"
 
@@ -307,7 +307,7 @@ hpf1275a_open(dev_t dev, struct tty *tp)
 		.cf_fstate = FSTATE_STAR,
 	};
 	struct lwp *l = curlwp;		/* XXX */
-	struct hpf1275a_softc *sc = device_private(self);
+	struct hpf1275a_softc *sc;
 	device_t self;
 	int error, s;
 
@@ -328,6 +328,7 @@ hpf1275a_open(dev_t dev, struct tty *tp)
 		return (EIO);
 	}
 
+	sc = device_private(self);
 	tp->t_sc = sc;
 	sc->sc_tp = tp;
 



CVS commit: src/sys/dev/hpc

2017-08-01 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Wed Aug  2 00:58:18 UTC 2017

Modified Files:
src/sys/dev/hpc: hpf1275a_tty.c

Log Message:
Fix the previous fix that doesn't even compile.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/sys/dev/hpc/hpf1275a_tty.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/doc

2017-08-01 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Aug  1 23:41:13 UTC 2017

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

Log Message:
tickets 162-169, 171, 173, 174


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.33 -r1.1.2.34 src/doc/CHANGES-8.0

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



CVS commit: [netbsd-8] src/doc

2017-08-01 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Aug  1 23:41:13 UTC 2017

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

Log Message:
tickets 162-169, 171, 173, 174


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.33 -r1.1.2.34 src/doc/CHANGES-8.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-8.0
diff -u src/doc/CHANGES-8.0:1.1.2.33 src/doc/CHANGES-8.0:1.1.2.34
--- src/doc/CHANGES-8.0:1.1.2.33	Wed Jul 26 07:40:01 2017
+++ src/doc/CHANGES-8.0	Tue Aug  1 23:41:13 2017
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-8.0,v 1.1.2.33 2017/07/26 07:40:01 martin Exp $
+# $NetBSD: CHANGES-8.0,v 1.1.2.34 2017/08/01 23:41:13 snj Exp $
 
 A complete list of changes from the initial NetBSD 8.0 branch on 2017-06-04
 until the 8.0 release:
@@ -4835,3 +4835,158 @@ sys/rump/librump/rumpkern/Makefile.rumpk
 	Add localcount to rump kernels
 	[ozaki-r, ticket #161]
 
+sys/dev/ic/rt2860.c1.28
+sys/dev/ic/rt2860var.h1.5
+sys/dev/pci/if_ral_pci.c			1.24
+
+	ral(4): Enable rt2860 power management code.
+	[maya, ticket #162]
+
+sys/external/bsd/drm2/pci/drm_pci.c		1.18
+
+	PR/52409: Avoid panic at resume.
+	[nonaka, ticket #163]
+
+distrib/sets/lists/base/md.amd64		1.269
+distrib/sets/lists/debug/md.amd64		1.97
+sys/arch/amd64/conf/GENERIC			1.460
+sys/arch/amd64/conf/files.amd64			1.89
+sys/arch/i386/conf/GENERIC			1.1157
+sys/arch/i386/conf/files.i386			1.379
+sys/arch/i386/i386/i386_trap.S			1.7-1.8
+sys/arch/i386/include/frameasm.h		1.16
+sys/arch/x86/include/sysarch.h			1.12
+sys/arch/x86/x86/pmc.c1.8-1.10
+sys/arch/x86/x86/sys_machdep.c			1.36
+sys/arch/xen/conf/files.compat			1.26
+sys/secmodel/suser/secmodel_suser.c		1.43
+sys/sys/kauth.h	1.74
+usr.bin/pmc/Makefile1.5
+usr.bin/pmc/pmc.11.12-1.13
+usr.bin/pmc/pmc.c1.24-1.25
+
+	Enable PMCs (performance-monitoring counters) on amd64 and i386.
+	[maxv, ticket #164]
+
+sys/dev/auconv.c1.29
+sys/dev/auconv.h1.19
+sys/dev/ic/am7930.c1.56
+
+	Add a null_filter to help with the audio autoconfig of pmax.
+	[nat, ticket #165]
+
+sys/dev/auconv.c1.30
+sys/dev/audio.c	1.372
+sys/dev/ic/ac97.c1.97
+sys/dev/pci/azalia_codec.c			1.81
+
+	Mixer device bounds checking.
+	[nat, ticket #166]
+
+sys/dev/audio.c	1.373-1.375
+
+	Refactoring of parameters for vchan_autoconfig.  Removal of
+	dead/unused code as found by isaki@.  PRs kern/52435,
+	kern/52434, and kern/52433.
+	[nat, ticket #167]
+
+sys/kern/kern_malloc.c1.146
+
+	Avoid integer overflow in kern_malloc().
+	[martin, ticket #168]
+
+sys/dev/usb/if_ural.c1.52
+
+	Free the RX list if ural_alloc_rx_list fails part way through.
+	[skrll, ticket #169]
+
+external/gpl3/gcc/dist/gcc/config/i386/i386.c	1.13
+
+	Apply upstream patch:
+	Incorrect codegen from rdseed intrinsic use (CVE-2017-11671)
+	[maya, ticket #171]
+
+sys/dev/pci/if_wmreg.h1.99-1.103
+sys/dev/pci/if_wmvar.h1.34-1.37
+sys/dev/pci/if_wm.c1.510-1.537
+sys/dev/mii/ihphyreg.h1.2
+sys/dev/mii/inbmphyreg.h			1.10
+sys/dev/mii/igphy.c1.27
+
+	Sync wm(4) up to if_wm.c rev. 1.537:
+	- Set WMREG_KABGTXD not in wm_init_locked() but in wm_reset().
+	- If a legacy interrupt is a spurious interrupt, don't print debug
+	  message.
+	- Don't print the Image Unique ID if an NVM is iNVM (i210 and I211).
+	- Fix a bug that a RAL was written at incorrect address when the index
+	  number is more than 16 on 82544 and newer.
+	- The layout of RAL on PCH* are different from others. Fix it.
+	- Flush every MTA write. Same as Linux.
+	- Move the location of calling wm_set_filter. Same as some other OSes.
+	- Flush writing WMREG_CTRL in wm_gmii_mediachange().
+	- Make new wm_phy_post_reset() and use this function at all location
+	  after resetting phy.
+	- Add I219 specific workaround for legacy interrupt. From OpenBSD.
+	- Move the location of calling wm_lplu_d0_disable().
+	- Disable D0 LPLU on 8257[12356], 82580, I350 and I21[01], too. Before
+	  this commit, above devices and non-PCIe devices accessed wrong
+	  register.
+	- Fix latency calculation in wm_platform_pm_pch_lpt().
+	- Set OBFF water mark and enable OBFF on PCH_LPT and newer.
+	- Fix a bug that wm_gmii_i82544_{read,write}reg() didn't take care of
+	  page select. PHY access from igphy() automatically did it, but
+	  accessing from wm(4) for workaround didn't work correctly. This
+	  change affects 8254[17], 8257[12] ICH8, ICH9 and ICH10.
+	- Call wm_kmrn_lock_loss_workaround_ich8lan() before any PHY access in
+	  wm_linkintr_gmii().
+	- Register access in wm_kmrn_lock_loss_workaround_ich8lan() now works
+	  correctly. Enable this function.
+	- IF TX is not required to flush, RX is also not required to flush in
+	  wm_flush_desc_rings(). Same as other OSes.
+	- Remove wrong semaphore access in wm_nvm_{read,write}_{ich8,spt} to
+	  prevent hangup. A semaphore is get/put in wm_nvm_{read,write}.
+	- Move some initialization stuff 

CVS commit: [netbsd-8] src

2017-08-01 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Aug  1 23:36:08 UTC 2017

Modified Files:
src/external/gpl3/binutils/usr.sbin/mdsetimage [netbsd-8]: bin_bfd.c
src/sys/arch/evbmips/conf [netbsd-8]: CI20

Log Message:
Pull up following revision(s) (requested by mrg in ticket #174):
external/gpl3/binutils/usr.sbin/mdsetimage/bin_bfd.c: revision 1.2
sys/arch/evbmips/conf/CI20: revision 1.23
initialise some stack variables to zero so that later checking ensures
they are considered "unfound" instead of some random value.
part 1 in fixing the CI20 kernel build.  this one actually will cause
the build to fail, but it's outputting broken objects right now anyway.
part 2 coming up in the CI20 configuration itself.
--
don't set NEED_MDSETIMAGE when we don't enable the md_root.  move the
option in with the commented md_root options.
part 2 of the CI20 kernel build fix.  now evbmips builds completes
sanely for me.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.1.8.1 \
src/external/gpl3/binutils/usr.sbin/mdsetimage/bin_bfd.c
cvs rdiff -u -r1.22 -r1.22.6.1 src/sys/arch/evbmips/conf/CI20

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



CVS commit: [netbsd-8] src

2017-08-01 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Aug  1 23:36:08 UTC 2017

Modified Files:
src/external/gpl3/binutils/usr.sbin/mdsetimage [netbsd-8]: bin_bfd.c
src/sys/arch/evbmips/conf [netbsd-8]: CI20

Log Message:
Pull up following revision(s) (requested by mrg in ticket #174):
external/gpl3/binutils/usr.sbin/mdsetimage/bin_bfd.c: revision 1.2
sys/arch/evbmips/conf/CI20: revision 1.23
initialise some stack variables to zero so that later checking ensures
they are considered "unfound" instead of some random value.
part 1 in fixing the CI20 kernel build.  this one actually will cause
the build to fail, but it's outputting broken objects right now anyway.
part 2 coming up in the CI20 configuration itself.
--
don't set NEED_MDSETIMAGE when we don't enable the md_root.  move the
option in with the commented md_root options.
part 2 of the CI20 kernel build fix.  now evbmips builds completes
sanely for me.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.1.8.1 \
src/external/gpl3/binutils/usr.sbin/mdsetimage/bin_bfd.c
cvs rdiff -u -r1.22 -r1.22.6.1 src/sys/arch/evbmips/conf/CI20

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

Modified files:

Index: src/external/gpl3/binutils/usr.sbin/mdsetimage/bin_bfd.c
diff -u src/external/gpl3/binutils/usr.sbin/mdsetimage/bin_bfd.c:1.1 src/external/gpl3/binutils/usr.sbin/mdsetimage/bin_bfd.c:1.1.8.1
--- src/external/gpl3/binutils/usr.sbin/mdsetimage/bin_bfd.c:1.1	Wed Sep 21 21:52:26 2016
+++ src/external/gpl3/binutils/usr.sbin/mdsetimage/bin_bfd.c	Tue Aug  1 23:36:08 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: bin_bfd.c,v 1.1 2016/09/21 21:52:26 christos Exp $	*/
+/*	$NetBSD: bin_bfd.c,v 1.1.8.1 2017/08/01 23:36:08 snj Exp $	*/
 
 /*
  * Copyright (c) 1996, 2002 Christopher G. Demetriou
@@ -34,7 +34,7 @@
 #endif
 
 #include 
-__RCSID("$NetBSD: bin_bfd.c,v 1.1 2016/09/21 21:52:26 christos Exp $");
+__RCSID("$NetBSD: bin_bfd.c,v 1.1.8.1 2017/08/01 23:36:08 snj Exp $");
 
 #include 
 #include 
@@ -75,6 +75,8 @@ bin_find_md_root(void *bin, const char *
 		size_t offset;
 	} *s, symbols[3];
 
+	symbols[0].offset = 0;
+	symbols[1].offset = 0;
 	symbols[0].name = root_name;
 	symbols[1].name = size_name;
 	symbols[2].name = NULL;

Index: src/sys/arch/evbmips/conf/CI20
diff -u src/sys/arch/evbmips/conf/CI20:1.22 src/sys/arch/evbmips/conf/CI20:1.22.6.1
--- src/sys/arch/evbmips/conf/CI20:1.22	Sun Feb 19 07:47:00 2017
+++ src/sys/arch/evbmips/conf/CI20	Tue Aug  1 23:36:08 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: CI20,v 1.22 2017/02/19 07:47:00 rin Exp $
+#	$NetBSD: CI20,v 1.22.6.1 2017/08/01 23:36:08 snj Exp $
 #
 # MIPS Creator CI20
 #
@@ -7,7 +7,7 @@ include 	"arch/evbmips/conf/std.ingenic"
 
 #options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		"CI20-$Revision: 1.22 $"
+#ident 		"CI20-$Revision: 1.22.6.1 $"
 
 maxusers	32
 
@@ -15,13 +15,13 @@ maxusers	32
 
 options 	MIPS32R2
 makeoptions	CPUFLAGS+="-mips32r2"
-makeoptions	NEED_MDSETIMAGE="yes"
 makeoptions	NEED_BINARY="yes"
 makeoptions	NEED_UBOOTIMAGE="gz"
 options 	COM_TOLERANCE=50	# +/- 5%
 options 	CONSPEED=115200	# u-boot default
 
 # Options for necessary to use MD
+#makeoptions	NEED_MDSETIMAGE="yes"
 #options 	MEMORY_DISK_HOOKS
 #options 	MEMORY_DISK_IS_ROOT	# force root on memory disk
 #options 	MEMORY_DISK_SERVER=0	# no userspace memory disk support



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

2017-08-01 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Aug  1 23:33:18 UTC 2017

Modified Files:
src/sys/dev/mii [netbsd-8]: igphy.c ihphyreg.h inbmphyreg.h
src/sys/dev/pci [netbsd-8]: if_wm.c if_wmreg.h if_wmvar.h

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #173):
sys/dev/pci/if_wmreg.h: 1.99-1.103
sys/dev/pci/if_wmvar.h: 1.34-1.37
sys/dev/pci/if_wm.c: 1.510-1.537
sys/dev/mii/ihphyreg.h: 1.2
sys/dev/mii/inbmphyreg.h: 1.10
sys/dev/mii/igphy.c: 1.27
Sync wm(4) up to if_wm.c rev. 1.537:
- Set WMREG_KABGTXD not in wm_init_locked() but in wm_reset().
- If a legacy interrupt is a spurious interrupt, don't print debug
  message.
- Don't print the Image Unique ID if an NVM is iNVM (i210 and I211).
- Fix a bug that a RAL was written at incorrect address when the index
  number is more than 16 on 82544 and newer.
- The layout of RAL on PCH* are different from others. Fix it.
- Flush every MTA write. Same as Linux.
- Move the location of calling wm_set_filter. Same as some other OSes.
- Flush writing WMREG_CTRL in wm_gmii_mediachange().
- Make new wm_phy_post_reset() and use this function at all location
  after resetting phy.
- Add I219 specific workaround for legacy interrupt. From OpenBSD.
- Move the location of calling wm_lplu_d0_disable().
- Disable D0 LPLU on 8257[12356], 82580, I350 and I21[01], too. Before
  this commit, above devices and non-PCIe devices accessed wrong
  register.
- Fix latency calculation in wm_platform_pm_pch_lpt().
- Set OBFF water mark and enable OBFF on PCH_LPT and newer.
- Fix a bug that wm_gmii_i82544_{read,write}reg() didn't take care of
  page select. PHY access from igphy() automatically did it, but
  accessing from wm(4) for workaround didn't work correctly. This
  change affects 8254[17], 8257[12] ICH8, ICH9 and ICH10.
- Call wm_kmrn_lock_loss_workaround_ich8lan() before any PHY access in
  wm_linkintr_gmii().
- Register access in wm_kmrn_lock_loss_workaround_ich8lan() now works
  correctly. Enable this function.
- IF TX is not required to flush, RX is also not required to flush in
  wm_flush_desc_rings(). Same as other OSes.
- Remove wrong semaphore access in wm_nvm_{read,write}_{ich8,spt} to
  prevent hangup. A semaphore is get/put in wm_nvm_{read,write}.
- Move some initialization stuff in wm_attach() before wm_reset().
  Some flags and callback function is required to set correctly before
  wm_reset() because wm_reset() and some helper functions refer them.
- Add wm_write_smbus_addr() to set SMBus address by software.
- Modify wm_gmii_hv_{read,write}reg_locked() to make them access
  HV_SMB_ADDR correctly.
- Configure the LCD with the extended configuration region in NVM if
  it's required. Tested with Thinkpad X220.
- 8257[12]: Don't directly access SPI but use EERD register.
- 82575-I354: If the size of SPI ROM >= 32K words, use direct SPI
  access instead of EERD register access.
- Add wm_nvm_eec_clock_raise() and wm_nvm_eec_clock_lower() and use
  them for Microwire/SPI bus control. Same as Linux and FreeBSD.
- Reduce timeout value for 80003 in wm_get_swfw_semaphore(). Same as
  Linux and FreeBSD.
- Change API of kmrn_{read,write}reg() and check the return value.
- Check whether it's required to use MDIC workaround for 80003 or not
  in wm_reset(). If the workaround isn't required, don't use the
  workaround code in wm_gmii_i80003_{read,write}reg.
- Add WM_F_WA_I210_CLSEM flag for a workaround. FreeBSD/Linux drivers
  say "In rare circumstances, the SW semaphore may already be held
  unintentionally." on I21[01]. PXE boot is one of the case.
- Qemu's e1000e emulation (82574L)'s SPI has only 64 words. I've never
  seen on real 82574 hardware with such small SPI ROM. Check
  NVM word size before accessing higher address words to prevent
  timeout.
- Check some wm_nvm_read()'s return vale.
- Use device_printf() instead of aprint_error_dev() for PHY read/write
  functions because those are used not only in device attach.
- Print internal driver flags when attaching.
- Add debug printf()s.
- Rename variables.
- Add comment, update comment and remove wrong comment.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.26.10.1 src/sys/dev/mii/igphy.c
cvs rdiff -u -r1.1 -r1.1.56.1 src/sys/dev/mii/ihphyreg.h
cvs rdiff -u -r1.9 -r1.9.8.1 src/sys/dev/mii/inbmphyreg.h
cvs rdiff -u -r1.508.4.1 -r1.508.4.2 src/sys/dev/pci/if_wm.c
cvs rdiff -u -r1.98 -r1.98.6.1 src/sys/dev/pci/if_wmreg.h
cvs rdiff -u -r1.33 -r1.33.6.1 src/sys/dev/pci/if_wmvar.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/mii/igphy.c
diff -u src/sys/dev/mii/igphy.c:1.26 src/sys/dev/mii/igphy.c:1.26.10.1
--- src/sys/dev/mii/igphy.c:1.26	Thu Jul  7 06:55:41 2016
+++ src/sys/dev/mii/igphy.c	Tue Aug  1 23:33:18 2017
@@ -1,8 +1,8 @@
-/*	$NetBSD: igphy.c,v 1.26 2016/07/07 06:55:41 msaitoh Exp $	*/
+/*	$NetBSD: 

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

2017-08-01 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Aug  1 23:33:18 UTC 2017

Modified Files:
src/sys/dev/mii [netbsd-8]: igphy.c ihphyreg.h inbmphyreg.h
src/sys/dev/pci [netbsd-8]: if_wm.c if_wmreg.h if_wmvar.h

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #173):
sys/dev/pci/if_wmreg.h: 1.99-1.103
sys/dev/pci/if_wmvar.h: 1.34-1.37
sys/dev/pci/if_wm.c: 1.510-1.537
sys/dev/mii/ihphyreg.h: 1.2
sys/dev/mii/inbmphyreg.h: 1.10
sys/dev/mii/igphy.c: 1.27
Sync wm(4) up to if_wm.c rev. 1.537:
- Set WMREG_KABGTXD not in wm_init_locked() but in wm_reset().
- If a legacy interrupt is a spurious interrupt, don't print debug
  message.
- Don't print the Image Unique ID if an NVM is iNVM (i210 and I211).
- Fix a bug that a RAL was written at incorrect address when the index
  number is more than 16 on 82544 and newer.
- The layout of RAL on PCH* are different from others. Fix it.
- Flush every MTA write. Same as Linux.
- Move the location of calling wm_set_filter. Same as some other OSes.
- Flush writing WMREG_CTRL in wm_gmii_mediachange().
- Make new wm_phy_post_reset() and use this function at all location
  after resetting phy.
- Add I219 specific workaround for legacy interrupt. From OpenBSD.
- Move the location of calling wm_lplu_d0_disable().
- Disable D0 LPLU on 8257[12356], 82580, I350 and I21[01], too. Before
  this commit, above devices and non-PCIe devices accessed wrong
  register.
- Fix latency calculation in wm_platform_pm_pch_lpt().
- Set OBFF water mark and enable OBFF on PCH_LPT and newer.
- Fix a bug that wm_gmii_i82544_{read,write}reg() didn't take care of
  page select. PHY access from igphy() automatically did it, but
  accessing from wm(4) for workaround didn't work correctly. This
  change affects 8254[17], 8257[12] ICH8, ICH9 and ICH10.
- Call wm_kmrn_lock_loss_workaround_ich8lan() before any PHY access in
  wm_linkintr_gmii().
- Register access in wm_kmrn_lock_loss_workaround_ich8lan() now works
  correctly. Enable this function.
- IF TX is not required to flush, RX is also not required to flush in
  wm_flush_desc_rings(). Same as other OSes.
- Remove wrong semaphore access in wm_nvm_{read,write}_{ich8,spt} to
  prevent hangup. A semaphore is get/put in wm_nvm_{read,write}.
- Move some initialization stuff in wm_attach() before wm_reset().
  Some flags and callback function is required to set correctly before
  wm_reset() because wm_reset() and some helper functions refer them.
- Add wm_write_smbus_addr() to set SMBus address by software.
- Modify wm_gmii_hv_{read,write}reg_locked() to make them access
  HV_SMB_ADDR correctly.
- Configure the LCD with the extended configuration region in NVM if
  it's required. Tested with Thinkpad X220.
- 8257[12]: Don't directly access SPI but use EERD register.
- 82575-I354: If the size of SPI ROM >= 32K words, use direct SPI
  access instead of EERD register access.
- Add wm_nvm_eec_clock_raise() and wm_nvm_eec_clock_lower() and use
  them for Microwire/SPI bus control. Same as Linux and FreeBSD.
- Reduce timeout value for 80003 in wm_get_swfw_semaphore(). Same as
  Linux and FreeBSD.
- Change API of kmrn_{read,write}reg() and check the return value.
- Check whether it's required to use MDIC workaround for 80003 or not
  in wm_reset(). If the workaround isn't required, don't use the
  workaround code in wm_gmii_i80003_{read,write}reg.
- Add WM_F_WA_I210_CLSEM flag for a workaround. FreeBSD/Linux drivers
  say "In rare circumstances, the SW semaphore may already be held
  unintentionally." on I21[01]. PXE boot is one of the case.
- Qemu's e1000e emulation (82574L)'s SPI has only 64 words. I've never
  seen on real 82574 hardware with such small SPI ROM. Check
  NVM word size before accessing higher address words to prevent
  timeout.
- Check some wm_nvm_read()'s return vale.
- Use device_printf() instead of aprint_error_dev() for PHY read/write
  functions because those are used not only in device attach.
- Print internal driver flags when attaching.
- Add debug printf()s.
- Rename variables.
- Add comment, update comment and remove wrong comment.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.26.10.1 src/sys/dev/mii/igphy.c
cvs rdiff -u -r1.1 -r1.1.56.1 src/sys/dev/mii/ihphyreg.h
cvs rdiff -u -r1.9 -r1.9.8.1 src/sys/dev/mii/inbmphyreg.h
cvs rdiff -u -r1.508.4.1 -r1.508.4.2 src/sys/dev/pci/if_wm.c
cvs rdiff -u -r1.98 -r1.98.6.1 src/sys/dev/pci/if_wmreg.h
cvs rdiff -u -r1.33 -r1.33.6.1 src/sys/dev/pci/if_wmvar.h

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



CVS commit: [netbsd-8] src/external/gpl3/gcc/dist/gcc/config/i386

2017-08-01 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Aug  1 23:30:04 UTC 2017

Modified Files:
src/external/gpl3/gcc/dist/gcc/config/i386 [netbsd-8]: i386.c

Log Message:
Pull up following revision(s) (requested by maya in ticket #171):
external/gpl3/gcc/dist/gcc/config/i386/i386.c: revision 1.13
Apply upstream patch:
Incorrect codegen from rdseed intrinsic use (CVE-2017-11671)
We should not expand call arguments in between flags reg setting and
flags reg using instructions, as it may expand with flags reg
clobbering insn (ADD in this case).
Attached patch moves expansion out of the link. Also, change
zero-extension to non-flags reg clobbering sequence in case we perform
zero-extension with and.
2017-03-25  Uros Bizjak  


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.12.8.1 \
src/external/gpl3/gcc/dist/gcc/config/i386/i386.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/external/gpl3/gcc/dist/gcc/config/i386

2017-08-01 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Aug  1 23:30:04 UTC 2017

Modified Files:
src/external/gpl3/gcc/dist/gcc/config/i386 [netbsd-8]: i386.c

Log Message:
Pull up following revision(s) (requested by maya in ticket #171):
external/gpl3/gcc/dist/gcc/config/i386/i386.c: revision 1.13
Apply upstream patch:
Incorrect codegen from rdseed intrinsic use (CVE-2017-11671)
We should not expand call arguments in between flags reg setting and
flags reg using instructions, as it may expand with flags reg
clobbering insn (ADD in this case).
Attached patch moves expansion out of the link. Also, change
zero-extension to non-flags reg clobbering sequence in case we perform
zero-extension with and.
2017-03-25  Uros Bizjak  


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.12.8.1 \
src/external/gpl3/gcc/dist/gcc/config/i386/i386.c

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

Modified files:

Index: src/external/gpl3/gcc/dist/gcc/config/i386/i386.c
diff -u src/external/gpl3/gcc/dist/gcc/config/i386/i386.c:1.12 src/external/gpl3/gcc/dist/gcc/config/i386/i386.c:1.12.8.1
--- src/external/gpl3/gcc/dist/gcc/config/i386/i386.c:1.12	Tue Jun  7 06:14:17 2016
+++ src/external/gpl3/gcc/dist/gcc/config/i386/i386.c	Tue Aug  1 23:30:04 2017
@@ -39529,9 +39529,6 @@ ix86_expand_builtin (tree exp, rtx targe
   mode0 = DImode;
 
 rdrand_step:
-  op0 = gen_reg_rtx (mode0);
-  emit_insn (GEN_FCN (icode) (op0));
-
   arg0 = CALL_EXPR_ARG (exp, 0);
   op1 = expand_normal (arg0);
   if (!address_operand (op1, VOIDmode))
@@ -39539,6 +39536,10 @@ rdrand_step:
 	  op1 = convert_memory_address (Pmode, op1);
 	  op1 = copy_addr_to_reg (op1);
 	}
+
+  op0 = gen_reg_rtx (mode0);
+  emit_insn (GEN_FCN (icode) (op0));
+
   emit_move_insn (gen_rtx_MEM (mode0, op1), op0);
 
   op1 = gen_reg_rtx (SImode);
@@ -39547,8 +39548,20 @@ rdrand_step:
   /* Emit SImode conditional move.  */
   if (mode0 == HImode)
 	{
-	  op2 = gen_reg_rtx (SImode);
-	  emit_insn (gen_zero_extendhisi2 (op2, op0));
+	  if (TARGET_ZERO_EXTEND_WITH_AND
+	  && optimize_function_for_speed_p (cfun))
+	{
+	  op2 = force_reg (SImode, const0_rtx);
+
+	  emit_insn (gen_movstricthi
+			 (gen_lowpart (HImode, op2), op0));
+	}
+	  else
+	{
+	  op2 = gen_reg_rtx (SImode);
+
+	  emit_insn (gen_zero_extendhisi2 (op2, op0));
+	}
 	}
   else if (mode0 == SImode)
 	op2 = op0;
@@ -39580,9 +39593,6 @@ rdrand_step:
   mode0 = DImode;
 
 rdseed_step:
-  op0 = gen_reg_rtx (mode0);
-  emit_insn (GEN_FCN (icode) (op0));
-
   arg0 = CALL_EXPR_ARG (exp, 0);
   op1 = expand_normal (arg0);
   if (!address_operand (op1, VOIDmode))
@@ -39590,6 +39600,10 @@ rdseed_step:
 	  op1 = convert_memory_address (Pmode, op1);
 	  op1 = copy_addr_to_reg (op1);
 	}
+
+  op0 = gen_reg_rtx (mode0);
+  emit_insn (GEN_FCN (icode) (op0));
+
   emit_move_insn (gen_rtx_MEM (mode0, op1), op0);
 
   op2 = gen_reg_rtx (QImode);



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

2017-08-01 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Aug  1 23:28:41 UTC 2017

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

Log Message:
Pull up following revision(s) (requested by skrll in ticket #169):
sys/dev/usb/if_ural.c: revision 1.52
Free the RX list if ural_alloc_rx_list fails part way through.
Reported by Ilja Van Sprundel.


To generate a diff of this commit:
cvs rdiff -u -r1.51 -r1.51.8.1 src/sys/dev/usb/if_ural.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

2017-08-01 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Aug  1 23:28:41 UTC 2017

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

Log Message:
Pull up following revision(s) (requested by skrll in ticket #169):
sys/dev/usb/if_ural.c: revision 1.52
Free the RX list if ural_alloc_rx_list fails part way through.
Reported by Ilja Van Sprundel.


To generate a diff of this commit:
cvs rdiff -u -r1.51 -r1.51.8.1 src/sys/dev/usb/if_ural.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/if_ural.c
diff -u src/sys/dev/usb/if_ural.c:1.51 src/sys/dev/usb/if_ural.c:1.51.8.1
--- src/sys/dev/usb/if_ural.c:1.51	Fri Nov 25 12:56:29 2016
+++ src/sys/dev/usb/if_ural.c	Tue Aug  1 23:28:41 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_ural.c,v 1.51 2016/11/25 12:56:29 skrll Exp $ */
+/*	$NetBSD: if_ural.c,v 1.51.8.1 2017/08/01 23:28:41 snj Exp $ */
 /*	$FreeBSD: /repoman/r/ncvs/src/sys/dev/usb/if_ural.c,v 1.40 2006/06/02 23:14:40 sam Exp $	*/
 
 /*-
@@ -24,7 +24,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_ural.c,v 1.51 2016/11/25 12:56:29 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ural.c,v 1.51.8.1 2017/08/01 23:28:41 snj Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -652,7 +652,7 @@ ural_alloc_rx_list(struct ural_softc *sc
 
 	return 0;
 
-fail:	ural_free_tx_list(sc);
+fail:	ural_free_rx_list(sc);
 	return error;
 }
 



CVS commit: [netbsd-8] src/sys/kern

2017-08-01 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Aug  1 23:26:58 UTC 2017

Modified Files:
src/sys/kern [netbsd-8]: kern_malloc.c

Log Message:
Pull up following revision(s) (requested by martin in ticket #168):
sys/kern/kern_malloc.c: revision 1.146
Avoid integer overflow in kern_malloc(). Reported by Ilja Van Sprundel.


To generate a diff of this commit:
cvs rdiff -u -r1.145 -r1.145.10.1 src/sys/kern/kern_malloc.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/kern

2017-08-01 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Aug  1 23:26:58 UTC 2017

Modified Files:
src/sys/kern [netbsd-8]: kern_malloc.c

Log Message:
Pull up following revision(s) (requested by martin in ticket #168):
sys/kern/kern_malloc.c: revision 1.146
Avoid integer overflow in kern_malloc(). Reported by Ilja Van Sprundel.


To generate a diff of this commit:
cvs rdiff -u -r1.145 -r1.145.10.1 src/sys/kern/kern_malloc.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_malloc.c
diff -u src/sys/kern/kern_malloc.c:1.145 src/sys/kern/kern_malloc.c:1.145.10.1
--- src/sys/kern/kern_malloc.c:1.145	Fri Feb  6 18:21:29 2015
+++ src/sys/kern/kern_malloc.c	Tue Aug  1 23:26:58 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_malloc.c,v 1.145 2015/02/06 18:21:29 maxv Exp $	*/
+/*	$NetBSD: kern_malloc.c,v 1.145.10.1 2017/08/01 23:26:58 snj Exp $	*/
 
 /*
  * Copyright (c) 1987, 1991, 1993
@@ -70,7 +70,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_malloc.c,v 1.145 2015/02/06 18:21:29 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_malloc.c,v 1.145.10.1 2017/08/01 23:26:58 snj Exp $");
 
 #include 
 #include 
@@ -105,7 +105,10 @@ kern_malloc(unsigned long size, int flag
 	void *p;
 
 	if (size >= PAGE_SIZE) {
-		allocsize = PAGE_SIZE + size; /* for page alignment */
+		if (size > (ULONG_MAX-PAGE_SIZE))
+			allocsize = ULONG_MAX;	/* this will fail later */
+		else
+			allocsize = PAGE_SIZE + size; /* for page alignment */
 		hdroffset = PAGE_SIZE - sizeof(struct malloc_header);
 	} else {
 		allocsize = sizeof(struct malloc_header) + size;



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

2017-08-01 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Aug  1 23:25:11 UTC 2017

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

Log Message:
Pull up following revision(s) (requested by nat in ticket #167):
sys/dev/audio.c: revision 1.373
sys/dev/audio.c: revision 1.374
sys/dev/audio.c: revision 1.375
Refactoring of order of auto config combinations.  Most common formats
come first.
Do not exceed AUDIO_MAX_CHANNELS.
Addresses PR kern/52435.
--
Remove unused code from audio_set_params.
Addresses PR kern/52434.
--
Remove dead code from audio open.  Found by isaki@.
Better error handling incase memory for the streams' ringbuffers cannot be
allocated.
Addresses PR kern/52433.


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

2017-08-01 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Aug  1 23:25:11 UTC 2017

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

Log Message:
Pull up following revision(s) (requested by nat in ticket #167):
sys/dev/audio.c: revision 1.373
sys/dev/audio.c: revision 1.374
sys/dev/audio.c: revision 1.375
Refactoring of order of auto config combinations.  Most common formats
come first.
Do not exceed AUDIO_MAX_CHANNELS.
Addresses PR kern/52435.
--
Remove unused code from audio_set_params.
Addresses PR kern/52434.
--
Remove dead code from audio open.  Found by isaki@.
Better error handling incase memory for the streams' ringbuffers cannot be
allocated.
Addresses PR kern/52433.


To generate a diff of this commit:
cvs rdiff -u -r1.357.2.3 -r1.357.2.4 src/sys/dev/audio.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/audio.c
diff -u src/sys/dev/audio.c:1.357.2.3 src/sys/dev/audio.c:1.357.2.4
--- src/sys/dev/audio.c:1.357.2.3	Tue Aug  1 23:23:00 2017
+++ src/sys/dev/audio.c	Tue Aug  1 23:25:11 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: audio.c,v 1.357.2.3 2017/08/01 23:23:00 snj Exp $	*/
+/*	$NetBSD: audio.c,v 1.357.2.4 2017/08/01 23:25:11 snj Exp $	*/
 
 /*-
  * Copyright (c) 2016 Nathanial Sloss 
@@ -148,7 +148,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.357.2.3 2017/08/01 23:23:00 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.357.2.4 2017/08/01 23:25:11 snj Exp $");
 
 #ifdef _KERNEL_OPT
 #include "audio.h"
@@ -447,8 +447,8 @@ const struct audio_params audio_default 
 	.channels = 1,
 };
 
-int auto_config_precision[] = { 32, 16, 8 };
-int auto_config_channels[] = { 32, 24, 16, 8, 6, 4, 2, 1};
+int auto_config_precision[] = { 16, 8, 32 };
+int auto_config_channels[] = { 2, AUDIO_MAX_CHANNELS, 10, 8, 6, 4, 1 };
 int auto_config_freq[] = { 48000, 44100, 96000, 192000, 32000,
 			   22050, 16000, 11025, 8000, 4000 };
 
@@ -2164,13 +2164,6 @@ audio_open(dev_t dev, struct audio_softc
 	DPRINTF(("audio_open: flags=0x%x sc=%p hdl=%p\n",
 		 flags, sc, sc->hw_hdl));
 
-	if (((flags & FREAD) && (vc->sc_open & AUOPEN_READ)) ||
-	((flags & FWRITE) && (vc->sc_open & AUOPEN_WRITE))) {
-		kmem_free(vc, sizeof(struct virtual_channel));
-		kmem_free(chan, sizeof(struct audio_chan));
-		return EBUSY;
-	}
-
 	error = audio_alloc_ring(sc, >sc_mpr,
 		AUMODE_PLAY, AU_RING_SIZE);
 	if (!error) {
@@ -2178,6 +2171,8 @@ audio_open(dev_t dev, struct audio_softc
 		AUMODE_RECORD, AU_RING_SIZE);
 	}
 	if (error) {
+		audio_free_ring(sc, >sc_mrr);
+		audio_free_ring(sc, >sc_mpr);
 		kmem_free(vc, sizeof(struct virtual_channel));
 		kmem_free(chan, sizeof(struct audio_chan));
 		return error;
@@ -5866,16 +5861,10 @@ audio_set_params(struct audio_softc *sc,
 	VAUDIO_NFORMATS, AUMODE_PLAY, play, true, pfil) < 0)
 		return EINVAL;
 
-	if (pfil->req_size > 0)
-		play = >filters[0].param;
-
 	if (setmode & AUMODE_RECORD && auconv_set_converter(sc->sc_format,
 	VAUDIO_NFORMATS, AUMODE_RECORD, rec, true, rfil) < 0)
 		return EINVAL;
 
-	if (rfil->req_size > 0)
-		rec = >filters[0].param;
-
 	return 0;
 }
 



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

2017-08-01 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Aug  1 23:23:01 UTC 2017

Modified Files:
src/sys/dev [netbsd-8]: auconv.c audio.c
src/sys/dev/ic [netbsd-8]: ac97.c
src/sys/dev/pci [netbsd-8]: azalia_codec.c

Log Message:
Pull up following revision(s) (requested by nat in ticket #166):
sys/dev/auconv.c: revision 1.30
sys/dev/audio.c: revision 1.372
sys/dev/ic/ac97.c: revision 1.97
sys/dev/pci/azalia_codec.c: revision 1.81
Mixer device bounds checking.
Analysis by Ilja van Sprundel.


To generate a diff of this commit:
cvs rdiff -u -r1.26.2.2 -r1.26.2.3 src/sys/dev/auconv.c
cvs rdiff -u -r1.357.2.2 -r1.357.2.3 src/sys/dev/audio.c
cvs rdiff -u -r1.96 -r1.96.10.1 src/sys/dev/ic/ac97.c
cvs rdiff -u -r1.80 -r1.80.2.1 src/sys/dev/pci/azalia_codec.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/auconv.c
diff -u src/sys/dev/auconv.c:1.26.2.2 src/sys/dev/auconv.c:1.26.2.3
--- src/sys/dev/auconv.c:1.26.2.2	Tue Aug  1 23:21:30 2017
+++ src/sys/dev/auconv.c	Tue Aug  1 23:23:00 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: auconv.c,v 1.26.2.2 2017/08/01 23:21:30 snj Exp $	*/
+/*	$NetBSD: auconv.c,v 1.26.2.3 2017/08/01 23:23:00 snj Exp $	*/
 
 /*
  * Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: auconv.c,v 1.26.2.2 2017/08/01 23:21:30 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: auconv.c,v 1.26.2.3 2017/08/01 23:23:00 snj Exp $");
 
 #include 
 #include 
@@ -1391,7 +1391,7 @@ int
 auconv_query_encoding(const struct audio_encoding_set *encodings,
 		  audio_encoding_t *aep)
 {
-	if (aep->index >= encodings->size)
+	if (aep->index < 0 || aep->index >= encodings->size)
 		return EINVAL;
 	strlcpy(aep->name, encodings->items[aep->index].name,
 		MAX_AUDIO_DEV_LEN);

Index: src/sys/dev/audio.c
diff -u src/sys/dev/audio.c:1.357.2.2 src/sys/dev/audio.c:1.357.2.3
--- src/sys/dev/audio.c:1.357.2.2	Fri Jun 30 06:43:07 2017
+++ src/sys/dev/audio.c	Tue Aug  1 23:23:00 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: audio.c,v 1.357.2.2 2017/06/30 06:43:07 snj Exp $	*/
+/*	$NetBSD: audio.c,v 1.357.2.3 2017/08/01 23:23:00 snj Exp $	*/
 
 /*-
  * Copyright (c) 2016 Nathanial Sloss 
@@ -148,7 +148,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.357.2.2 2017/06/30 06:43:07 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.357.2.3 2017/08/01 23:23:00 snj Exp $");
 
 #ifdef _KERNEL_OPT
 #include "audio.h"
@@ -5123,7 +5123,7 @@ mixer_ioctl(struct audio_softc *sc, u_lo
 
 		if (device_is_active(sc->sc_dev))
 			error = audio_get_port(sc, mc);
-		else if (mc->dev >= sc->sc_nmixer_states)
+		else if (mc->dev < 0 || mc->dev >= sc->sc_nmixer_states)
 			error = ENXIO;
 		else {
 			int dev = mc->dev;

Index: src/sys/dev/ic/ac97.c
diff -u src/sys/dev/ic/ac97.c:1.96 src/sys/dev/ic/ac97.c:1.96.10.1
--- src/sys/dev/ic/ac97.c:1.96	Sat Apr  4 15:09:45 2015
+++ src/sys/dev/ic/ac97.c	Tue Aug  1 23:23:00 2017
@@ -1,4 +1,4 @@
-/*  $NetBSD: ac97.c,v 1.96 2015/04/04 15:09:45 christos Exp $ */
+/*  $NetBSD: ac97.c,v 1.96.10.1 2017/08/01 23:23:00 snj Exp $ */
 /*	$OpenBSD: ac97.c,v 1.8 2000/07/19 09:01:35 csapuntz Exp $	*/
 
 /*
@@ -63,7 +63,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ac97.c,v 1.96 2015/04/04 15:09:45 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ac97.c,v 1.96.10.1 2017/08/01 23:23:00 snj Exp $");
 
 #include 
 #include 
@@ -1677,7 +1677,7 @@ ac97_query_devinfo(struct ac97_codec_if 
 	const char *name;
 
 	as = (struct ac97_softc *)codec_if;
-	if (dip->index < as->num_source_info) {
+	if (dip->index >= 0 && dip->index < as->num_source_info) {
 		si = >source_info[dip->index];
 		dip->type = si->type;
 		dip->mixer_class = si->mixer_class;

Index: src/sys/dev/pci/azalia_codec.c
diff -u src/sys/dev/pci/azalia_codec.c:1.80 src/sys/dev/pci/azalia_codec.c:1.80.2.1
--- src/sys/dev/pci/azalia_codec.c:1.80	Thu Jun  1 02:45:11 2017
+++ src/sys/dev/pci/azalia_codec.c	Tue Aug  1 23:23:00 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: azalia_codec.c,v 1.80 2017/06/01 02:45:11 chs Exp $	*/
+/*	$NetBSD: azalia_codec.c,v 1.80.2.1 2017/08/01 23:23:00 snj Exp $	*/
 
 /*-
  * Copyright (c) 2005, 2008 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: azalia_codec.c,v 1.80 2017/06/01 02:45:11 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: azalia_codec.c,v 1.80.2.1 2017/08/01 23:23:00 snj Exp $");
 
 #include 
 #include 
@@ -2062,7 +2062,7 @@ generic_set_port(codec_t *this, mixer_ct
 {
 	const mixer_item_t *m;
 
-	if (mc->dev >= this->nmixers)
+	if (mc->dev < 0 || mc->dev >= this->nmixers)
 		return ENXIO;
 	m = >mixers[mc->dev];
 	if (mc->type != m->devinfo.type)
@@ -2077,7 +2077,7 @@ generic_get_port(codec_t *this, mixer_ct
 {
 	const mixer_item_t *m;
 
-	if (mc->dev >= this->nmixers)
+	if (mc->dev < 0 || mc->dev >= this->nmixers)
 		return ENXIO;
 	m = 

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

2017-08-01 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Aug  1 23:23:01 UTC 2017

Modified Files:
src/sys/dev [netbsd-8]: auconv.c audio.c
src/sys/dev/ic [netbsd-8]: ac97.c
src/sys/dev/pci [netbsd-8]: azalia_codec.c

Log Message:
Pull up following revision(s) (requested by nat in ticket #166):
sys/dev/auconv.c: revision 1.30
sys/dev/audio.c: revision 1.372
sys/dev/ic/ac97.c: revision 1.97
sys/dev/pci/azalia_codec.c: revision 1.81
Mixer device bounds checking.
Analysis by Ilja van Sprundel.


To generate a diff of this commit:
cvs rdiff -u -r1.26.2.2 -r1.26.2.3 src/sys/dev/auconv.c
cvs rdiff -u -r1.357.2.2 -r1.357.2.3 src/sys/dev/audio.c
cvs rdiff -u -r1.96 -r1.96.10.1 src/sys/dev/ic/ac97.c
cvs rdiff -u -r1.80 -r1.80.2.1 src/sys/dev/pci/azalia_codec.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

2017-08-01 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Aug  1 23:21:30 UTC 2017

Modified Files:
src/sys/dev [netbsd-8]: auconv.c auconv.h
src/sys/dev/ic [netbsd-8]: am7930.c

Log Message:
Pull up following revision(s) (requested by nat in ticket #165):
sys/dev/auconv.c: revision 1.29
sys/dev/auconv.h: revision 1.19
sys/dev/ic/am7930.c: revision 1.56
Add a null_filter to help with the audio autoconfig of pmax.
Tested by flxd@.


To generate a diff of this commit:
cvs rdiff -u -r1.26.2.1 -r1.26.2.2 src/sys/dev/auconv.c
cvs rdiff -u -r1.16.42.1 -r1.16.42.2 src/sys/dev/auconv.h
cvs rdiff -u -r1.53.8.1 -r1.53.8.2 src/sys/dev/ic/am7930.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/auconv.c
diff -u src/sys/dev/auconv.c:1.26.2.1 src/sys/dev/auconv.c:1.26.2.2
--- src/sys/dev/auconv.c:1.26.2.1	Fri Jun 30 06:38:00 2017
+++ src/sys/dev/auconv.c	Tue Aug  1 23:21:30 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: auconv.c,v 1.26.2.1 2017/06/30 06:38:00 snj Exp $	*/
+/*	$NetBSD: auconv.c,v 1.26.2.2 2017/08/01 23:21:30 snj Exp $	*/
 
 /*
  * Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: auconv.c,v 1.26.2.1 2017/06/30 06:38:00 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: auconv.c,v 1.26.2.2 2017/08/01 23:21:30 snj Exp $");
 
 #include 
 #include 
@@ -456,6 +456,24 @@ DEFINE_FILTER(swap_bytes)
 	return 0;
 }
 
+DEFINE_FILTER(null_filter)
+{
+	stream_filter_t *this;
+	int m, err;
+
+	this = (stream_filter_t *)self;
+	max_used = (max_used + 1) & ~1; /* round up to even */
+	if ((err = this->prev->fetch_to(sc, this->prev, this->src, max_used)))
+		return err;
+	m = (dst->end - dst->start) & ~1;
+	m = min(m, max_used);
+	FILTER_LOOP_PROLOGUE(this->src, 1, dst, 1, m) {
+		*d = *s;
+	} FILTER_LOOP_EPILOGUE(this->src, dst);
+	
+	return 0;
+}
+
 DEFINE_FILTER(swap_bytes_change_sign16)
 {
 	stream_filter_t *this;

Index: src/sys/dev/auconv.h
diff -u src/sys/dev/auconv.h:1.16.42.1 src/sys/dev/auconv.h:1.16.42.2
--- src/sys/dev/auconv.h:1.16.42.1	Fri Jun 30 06:38:00 2017
+++ src/sys/dev/auconv.h	Tue Aug  1 23:21:30 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: auconv.h,v 1.16.42.1 2017/06/30 06:38:00 snj Exp $	*/
+/*	$NetBSD: auconv.h,v 1.16.42.2 2017/08/01 23:21:30 snj Exp $	*/
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -82,6 +82,7 @@ extern stream_filter_factory_t linear8_8
 extern stream_filter_factory_t linear8_8_to_linear24;
 extern stream_filter_factory_t linear8_8_to_linear16;
 extern stream_filter_factory_t linear8_8_to_linear8;
+extern stream_filter_factory_t null_filter;
 
 #define linear16_to_linear8 linear16_16_to_linear8
 #define linear8_to_linear16 linear8_8_to_linear16

Index: src/sys/dev/ic/am7930.c
diff -u src/sys/dev/ic/am7930.c:1.53.8.1 src/sys/dev/ic/am7930.c:1.53.8.2
--- src/sys/dev/ic/am7930.c:1.53.8.1	Fri Jun 30 06:32:21 2017
+++ src/sys/dev/ic/am7930.c	Tue Aug  1 23:21:30 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: am7930.c,v 1.53.8.1 2017/06/30 06:32:21 snj Exp $	*/
+/*	$NetBSD: am7930.c,v 1.53.8.2 2017/08/01 23:21:30 snj Exp $	*/
 
 /*
  * Copyright (c) 1995 Rolf Grossmann
@@ -36,7 +36,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: am7930.c,v 1.53.8.1 2017/06/30 06:32:21 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: am7930.c,v 1.53.8.2 2017/08/01 23:21:30 snj Exp $");
 
 #include "audio.h"
 #if NAUDIO > 0
@@ -137,6 +137,7 @@ static const uint16_t ger_coeff[] = {
 #define NGER (sizeof(ger_coeff) / sizeof(ger_coeff[0]))
 };
 
+extern stream_filter_factory_t null_filter;
 
 /*
  * Reset chip and set boot-time softc defaults.
@@ -239,11 +240,14 @@ am7930_set_params(void *addr, int setmod
 		if (sc->sc_glue->output_conv != NULL) {
 			hw = *p;
 			hw.encoding = AUDIO_ENCODING_NONE;
+			hw.precision = 8;
+			pfil->append(pfil, null_filter, );
 			hw.precision *= sc->sc_glue->factor;
 			pfil->append(pfil, sc->sc_glue->output_conv, );
 		}
 		if (p->encoding == AUDIO_ENCODING_SLINEAR) {
 			hw = *p;
+			hw.precision = 8;
 			hw.encoding = AUDIO_ENCODING_ULAW;
 			pfil->append(pfil, linear8_to_mulaw, );
 		}
@@ -260,11 +264,14 @@ am7930_set_params(void *addr, int setmod
 		if (sc->sc_glue->input_conv != NULL) {
 			hw = *r;
 			hw.encoding = AUDIO_ENCODING_NONE;
+			hw.precision = 8;
+			pfil->append(pfil, null_filter, );
 			hw.precision *= sc->sc_glue->factor;
 			pfil->append(rfil, sc->sc_glue->input_conv, );
 		}
 		if (r->encoding == AUDIO_ENCODING_SLINEAR) {
 			hw = *r;
+			hw.precision = 8;
 			hw.encoding = AUDIO_ENCODING_ULAW;
 			rfil->append(rfil, mulaw_to_linear8, );
 		}



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

2017-08-01 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Aug  1 23:21:30 UTC 2017

Modified Files:
src/sys/dev [netbsd-8]: auconv.c auconv.h
src/sys/dev/ic [netbsd-8]: am7930.c

Log Message:
Pull up following revision(s) (requested by nat in ticket #165):
sys/dev/auconv.c: revision 1.29
sys/dev/auconv.h: revision 1.19
sys/dev/ic/am7930.c: revision 1.56
Add a null_filter to help with the audio autoconfig of pmax.
Tested by flxd@.


To generate a diff of this commit:
cvs rdiff -u -r1.26.2.1 -r1.26.2.2 src/sys/dev/auconv.c
cvs rdiff -u -r1.16.42.1 -r1.16.42.2 src/sys/dev/auconv.h
cvs rdiff -u -r1.53.8.1 -r1.53.8.2 src/sys/dev/ic/am7930.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

2017-08-01 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Aug  1 23:18:31 UTC 2017

Modified Files:
src/distrib/sets/lists/base [netbsd-8]: md.amd64
src/distrib/sets/lists/debug [netbsd-8]: md.amd64
src/sys/arch/amd64/conf [netbsd-8]: GENERIC files.amd64
src/sys/arch/i386/conf [netbsd-8]: GENERIC files.i386
src/sys/arch/i386/i386 [netbsd-8]: i386_trap.S
src/sys/arch/i386/include [netbsd-8]: frameasm.h
src/sys/arch/x86/include [netbsd-8]: sysarch.h
src/sys/arch/x86/x86 [netbsd-8]: pmc.c sys_machdep.c
src/sys/arch/xen/conf [netbsd-8]: files.compat
src/sys/secmodel/suser [netbsd-8]: secmodel_suser.c
src/sys/sys [netbsd-8]: kauth.h
src/usr.bin/pmc [netbsd-8]: Makefile pmc.1 pmc.c

Log Message:
Pull up following revision(s) (requested by maxv in ticket #164):
distrib/sets/lists/base/md.amd64: revision 1.269
distrib/sets/lists/debug/md.amd64: revision 1.97
sys/arch/amd64/conf/GENERIC: revision 1.460
sys/arch/amd64/conf/files.amd64: revision 1.89
sys/arch/i386/conf/GENERIC: revision 1.1157
sys/arch/i386/conf/files.i386: revision 1.379
sys/arch/i386/i386/i386_trap.S: revision 1.7-1.8
sys/arch/i386/include/frameasm.h: revision 1.16
sys/arch/x86/include/sysarch.h: revision 1.12
sys/arch/x86/x86/pmc.c: revision 1.8-1.10
sys/arch/x86/x86/sys_machdep.c: revision 1.36
sys/arch/xen/conf/files.compat: revision 1.26
sys/secmodel/suser/secmodel_suser.c: revision 1.43
sys/sys/kauth.h: revision 1.74
usr.bin/pmc/Makefile: revision 1.5
usr.bin/pmc/pmc.1: revision 1.12-1.13
usr.bin/pmc/pmc.c: revision 1.24-1.25
style
--
style
--
Disable interrupts for T_NMI (inline calltrap). Note that there's still a
way to evade the NMI mode here, if a segment register faults in
INTRFASTEXIT; but we don't care. I didn't test this change, but it seems
fine enough.
--
Make the PMC syscalls privileged.
--
Check argc, and add a message.
--
include opt_pmc.h
--
Build the pmc tool on amd64.
--
Properly handle overflows, and take them into account in userland.
--
Update.
--
Enable PMCs by default.
--
Sort sections. Fix macro usage.


To generate a diff of this commit:
cvs rdiff -u -r1.268 -r1.268.4.1 src/distrib/sets/lists/base/md.amd64
cvs rdiff -u -r1.96 -r1.96.2.1 src/distrib/sets/lists/debug/md.amd64
cvs rdiff -u -r1.459.2.1 -r1.459.2.2 src/sys/arch/amd64/conf/GENERIC
cvs rdiff -u -r1.88 -r1.88.8.1 src/sys/arch/amd64/conf/files.amd64
cvs rdiff -u -r1.1156.2.1 -r1.1156.2.2 src/sys/arch/i386/conf/GENERIC
cvs rdiff -u -r1.378 -r1.378.6.1 src/sys/arch/i386/conf/files.i386
cvs rdiff -u -r1.6 -r1.6.6.1 src/sys/arch/i386/i386/i386_trap.S
cvs rdiff -u -r1.15 -r1.15.46.1 src/sys/arch/i386/include/frameasm.h
cvs rdiff -u -r1.11 -r1.11.6.1 src/sys/arch/x86/include/sysarch.h
cvs rdiff -u -r1.7 -r1.7.2.1 src/sys/arch/x86/x86/pmc.c
cvs rdiff -u -r1.35 -r1.35.6.1 src/sys/arch/x86/x86/sys_machdep.c
cvs rdiff -u -r1.25 -r1.25.8.1 src/sys/arch/xen/conf/files.compat
cvs rdiff -u -r1.42 -r1.42.10.1 src/sys/secmodel/suser/secmodel_suser.c
cvs rdiff -u -r1.73 -r1.73.10.1 src/sys/sys/kauth.h
cvs rdiff -u -r1.4 -r1.4.4.1 src/usr.bin/pmc/Makefile
cvs rdiff -u -r1.11 -r1.11.4.1 src/usr.bin/pmc/pmc.1
cvs rdiff -u -r1.23 -r1.23.4.1 src/usr.bin/pmc/pmc.c

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

Modified files:

Index: src/distrib/sets/lists/base/md.amd64
diff -u src/distrib/sets/lists/base/md.amd64:1.268 src/distrib/sets/lists/base/md.amd64:1.268.4.1
--- src/distrib/sets/lists/base/md.amd64:1.268	Tue Jan 24 11:09:14 2017
+++ src/distrib/sets/lists/base/md.amd64	Tue Aug  1 23:18:30 2017
@@ -1,9 +1,10 @@
-# $NetBSD: md.amd64,v 1.268 2017/01/24 11:09:14 nonaka Exp $
+# $NetBSD: md.amd64,v 1.268.4.1 2017/08/01 23:18:30 snj Exp $
 ./dev/lms0	base-obsolete		obsolete
 ./dev/mms0	base-obsolete		obsolete
 ./libexec/ld.elf_so-i386			base-sys-shlib		compat,pic
 ./usr/bin/fdformatbase-util-bin
 ./usr/bin/iasl	base-util-bin
+./usr/bin/pmc	base-util-bin
 ./usr/lib/i386/libi386.so.1			base-compat-shlib	compat,pic
 ./usr/lib/i386/libi386.so.1.0			base-compat-shlib	compat,pic
 ./usr/lib/i386/libproc.so.0			base-compat-shlib	compat,pic,dtrace

Index: src/distrib/sets/lists/debug/md.amd64
diff -u src/distrib/sets/lists/debug/md.amd64:1.96 src/distrib/sets/lists/debug/md.amd64:1.96.2.1
--- src/distrib/sets/lists/debug/md.amd64:1.96	Sun May  7 02:05:56 2017
+++ src/distrib/sets/lists/debug/md.amd64	Tue Aug  1 23:18:30 2017
@@ -1,4 +1,4 @@
-# $NetBSD: md.amd64,v 1.96 2017/05/07 02:05:56 kamil Exp $
+# $NetBSD: md.amd64,v 1.96.2.1 2017/08/01 23:18:30 snj Exp $
 ./usr/lib/i386/12.202++_g.a			comp-c-debuglib		debuglib,compat,12.202xx
 ./usr/lib/i386/libi386_g.a			comp-c-debuglib		debuglib,compat
 ./usr/lib/i386/libiberty_g.a			comp-obsolete		obsolete
@@ -6,6 +6,7 @@
 

CVS commit: [netbsd-8] src

2017-08-01 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Aug  1 23:18:31 UTC 2017

Modified Files:
src/distrib/sets/lists/base [netbsd-8]: md.amd64
src/distrib/sets/lists/debug [netbsd-8]: md.amd64
src/sys/arch/amd64/conf [netbsd-8]: GENERIC files.amd64
src/sys/arch/i386/conf [netbsd-8]: GENERIC files.i386
src/sys/arch/i386/i386 [netbsd-8]: i386_trap.S
src/sys/arch/i386/include [netbsd-8]: frameasm.h
src/sys/arch/x86/include [netbsd-8]: sysarch.h
src/sys/arch/x86/x86 [netbsd-8]: pmc.c sys_machdep.c
src/sys/arch/xen/conf [netbsd-8]: files.compat
src/sys/secmodel/suser [netbsd-8]: secmodel_suser.c
src/sys/sys [netbsd-8]: kauth.h
src/usr.bin/pmc [netbsd-8]: Makefile pmc.1 pmc.c

Log Message:
Pull up following revision(s) (requested by maxv in ticket #164):
distrib/sets/lists/base/md.amd64: revision 1.269
distrib/sets/lists/debug/md.amd64: revision 1.97
sys/arch/amd64/conf/GENERIC: revision 1.460
sys/arch/amd64/conf/files.amd64: revision 1.89
sys/arch/i386/conf/GENERIC: revision 1.1157
sys/arch/i386/conf/files.i386: revision 1.379
sys/arch/i386/i386/i386_trap.S: revision 1.7-1.8
sys/arch/i386/include/frameasm.h: revision 1.16
sys/arch/x86/include/sysarch.h: revision 1.12
sys/arch/x86/x86/pmc.c: revision 1.8-1.10
sys/arch/x86/x86/sys_machdep.c: revision 1.36
sys/arch/xen/conf/files.compat: revision 1.26
sys/secmodel/suser/secmodel_suser.c: revision 1.43
sys/sys/kauth.h: revision 1.74
usr.bin/pmc/Makefile: revision 1.5
usr.bin/pmc/pmc.1: revision 1.12-1.13
usr.bin/pmc/pmc.c: revision 1.24-1.25
style
--
style
--
Disable interrupts for T_NMI (inline calltrap). Note that there's still a
way to evade the NMI mode here, if a segment register faults in
INTRFASTEXIT; but we don't care. I didn't test this change, but it seems
fine enough.
--
Make the PMC syscalls privileged.
--
Check argc, and add a message.
--
include opt_pmc.h
--
Build the pmc tool on amd64.
--
Properly handle overflows, and take them into account in userland.
--
Update.
--
Enable PMCs by default.
--
Sort sections. Fix macro usage.


To generate a diff of this commit:
cvs rdiff -u -r1.268 -r1.268.4.1 src/distrib/sets/lists/base/md.amd64
cvs rdiff -u -r1.96 -r1.96.2.1 src/distrib/sets/lists/debug/md.amd64
cvs rdiff -u -r1.459.2.1 -r1.459.2.2 src/sys/arch/amd64/conf/GENERIC
cvs rdiff -u -r1.88 -r1.88.8.1 src/sys/arch/amd64/conf/files.amd64
cvs rdiff -u -r1.1156.2.1 -r1.1156.2.2 src/sys/arch/i386/conf/GENERIC
cvs rdiff -u -r1.378 -r1.378.6.1 src/sys/arch/i386/conf/files.i386
cvs rdiff -u -r1.6 -r1.6.6.1 src/sys/arch/i386/i386/i386_trap.S
cvs rdiff -u -r1.15 -r1.15.46.1 src/sys/arch/i386/include/frameasm.h
cvs rdiff -u -r1.11 -r1.11.6.1 src/sys/arch/x86/include/sysarch.h
cvs rdiff -u -r1.7 -r1.7.2.1 src/sys/arch/x86/x86/pmc.c
cvs rdiff -u -r1.35 -r1.35.6.1 src/sys/arch/x86/x86/sys_machdep.c
cvs rdiff -u -r1.25 -r1.25.8.1 src/sys/arch/xen/conf/files.compat
cvs rdiff -u -r1.42 -r1.42.10.1 src/sys/secmodel/suser/secmodel_suser.c
cvs rdiff -u -r1.73 -r1.73.10.1 src/sys/sys/kauth.h
cvs rdiff -u -r1.4 -r1.4.4.1 src/usr.bin/pmc/Makefile
cvs rdiff -u -r1.11 -r1.11.4.1 src/usr.bin/pmc/pmc.1
cvs rdiff -u -r1.23 -r1.23.4.1 src/usr.bin/pmc/pmc.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/external/bsd/drm2/pci

2017-08-01 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Aug  1 23:12:06 UTC 2017

Modified Files:
src/sys/external/bsd/drm2/pci [netbsd-8]: drm_pci.c

Log Message:
Pull up following revision(s) (requested by nonaka in ticket #163):
sys/external/bsd/drm2/pci/drm_pci.c: revision 1.18
PR/52409: Avoid panic at resume.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.17.2.1 src/sys/external/bsd/drm2/pci/drm_pci.c

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

Modified files:

Index: src/sys/external/bsd/drm2/pci/drm_pci.c
diff -u src/sys/external/bsd/drm2/pci/drm_pci.c:1.17 src/sys/external/bsd/drm2/pci/drm_pci.c:1.17.2.1
--- src/sys/external/bsd/drm2/pci/drm_pci.c:1.17	Thu Jun  1 02:45:12 2017
+++ src/sys/external/bsd/drm2/pci/drm_pci.c	Tue Aug  1 23:12:06 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: drm_pci.c,v 1.17 2017/06/01 02:45:12 chs Exp $	*/
+/*	$NetBSD: drm_pci.c,v 1.17.2.1 2017/08/01 23:12:06 snj Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: drm_pci.c,v 1.17 2017/06/01 02:45:12 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: drm_pci.c,v 1.17.2.1 2017/08/01 23:12:06 snj Exp $");
 
 #include 
 #include 
@@ -243,11 +243,23 @@ drm_pci_irq_install(struct drm_device *d
 	irq_cookie = kmem_alloc(sizeof(*irq_cookie), KM_SLEEP);
 
 	if (dev->pdev->msi_enabled) {
-		irq_cookie->intr_handles = dev->pdev->intr_handles;
-		dev->pdev->intr_handles = NULL;
+		if (dev->pdev->intr_handles == NULL) {
+			if (pci_msi_alloc_exact(pa, _cookie->intr_handles,
+			1)) {
+aprint_error_dev(dev->dev,
+"couldn't allocate MSI (%s)\n", name);
+goto error;
+			}
+		} else {
+			irq_cookie->intr_handles = dev->pdev->intr_handles;
+			dev->pdev->intr_handles = NULL;
+		}
 	} else {
-		if (pci_intx_alloc(pa, _cookie->intr_handles))
-			return -ENOENT;
+		if (pci_intx_alloc(pa, _cookie->intr_handles)) {
+			aprint_error_dev(dev->dev,
+			"couldn't allocate INTx interrupt (%s)\n", name);
+			goto error;
+		}
 	}
 
 	intrstr = pci_intr_string(pa->pa_pc, irq_cookie->intr_handles[0],
@@ -257,12 +269,17 @@ drm_pci_irq_install(struct drm_device *d
 	if (irq_cookie->ih_cookie == NULL) {
 		aprint_error_dev(dev->dev,
 		"couldn't establish interrupt at %s (%s)\n", intrstr, name);
-		return -ENOENT;
+		pci_intr_release(pa->pa_pc, irq_cookie->intr_handles, 1);
+		goto error;
 	}
 
 	aprint_normal_dev(dev->dev, "interrupting at %s (%s)\n", intrstr, name);
 	*cookiep = irq_cookie;
 	return 0;
+
+error:
+	kmem_free(irq_cookie, sizeof(*irq_cookie));
+	return -ENOENT;
 }
 
 static void



CVS commit: [netbsd-8] src/sys/external/bsd/drm2/pci

2017-08-01 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Aug  1 23:12:06 UTC 2017

Modified Files:
src/sys/external/bsd/drm2/pci [netbsd-8]: drm_pci.c

Log Message:
Pull up following revision(s) (requested by nonaka in ticket #163):
sys/external/bsd/drm2/pci/drm_pci.c: revision 1.18
PR/52409: Avoid panic at resume.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.17.2.1 src/sys/external/bsd/drm2/pci/drm_pci.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

2017-08-01 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Aug  1 23:10:00 UTC 2017

Modified Files:
src/sys/dev/ic [netbsd-8]: rt2860.c rt2860var.h
src/sys/dev/pci [netbsd-8]: if_ral_pci.c

Log Message:
Pull up following revision(s) (requested by maya in ticket #162):
sys/dev/pci/if_ral_pci.c: revision 1.24
sys/dev/ic/rt2860.c: revision 1.28
sys/dev/ic/rt2860var.h: revision 1.5
enable rt2860 power management code
adjust to fit netbsd:
make suspend,resume functions match desired pmf* prototypes
remove wakeup/activate wrapper functions
avoid jumping to NULL on resume by initializing if_stop
the problem machine has other issues on resume, so there might be further
issues, but it's an improvement over a jump to NULL.
tested by Riccardo Mottola


To generate a diff of this commit:
cvs rdiff -u -r1.26.2.1 -r1.26.2.2 src/sys/dev/ic/rt2860.c
cvs rdiff -u -r1.4 -r1.4.6.1 src/sys/dev/ic/rt2860var.h
cvs rdiff -u -r1.23 -r1.23.10.1 src/sys/dev/pci/if_ral_pci.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/rt2860.c
diff -u src/sys/dev/ic/rt2860.c:1.26.2.1 src/sys/dev/ic/rt2860.c:1.26.2.2
--- src/sys/dev/ic/rt2860.c:1.26.2.1	Tue Jul 25 02:08:31 2017
+++ src/sys/dev/ic/rt2860.c	Tue Aug  1 23:10:00 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: rt2860.c,v 1.26.2.1 2017/07/25 02:08:31 snj Exp $	*/
+/*	$NetBSD: rt2860.c,v 1.26.2.2 2017/08/01 23:10:00 snj Exp $	*/
 /*	$OpenBSD: rt2860.c,v 1.90 2016/04/13 10:49:26 mpi Exp $	*/
 /*	$FreeBSD: head/sys/dev/ral/rt2860.c 306591 2016-10-02 20:35:55Z avos $ */
 
@@ -25,7 +25,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rt2860.c,v 1.26.2.1 2017/07/25 02:08:31 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rt2860.c,v 1.26.2.2 2017/08/01 23:10:00 snj Exp $");
 
 #include 
 #include 
@@ -74,6 +74,8 @@ int rt2860_debug = 0;
 #define MAXQS	6 /* Tx (4 EDCAs + HCCA + Mgt) and Rx rings */
 
 static void	rt2860_attachhook(device_t);
+static bool	rt2860_suspend(device_t self, const pmf_qual_t *qual);
+static bool	rt2860_wakeup(device_t self, const pmf_qual_t *qual);
 static int	rt2860_alloc_tx_ring(struct rt2860_softc *,
 		struct rt2860_tx_ring *);
 static void	rt2860_reset_tx_ring(struct rt2860_softc *,
@@ -394,6 +396,7 @@ rt2860_attachhook(device_t self)
 	ifp->if_init = rt2860_init;
 	ifp->if_ioctl = rt2860_ioctl;
 	ifp->if_start = rt2860_start;
+	ifp->if_stop = rt2860_stop;
 	ifp->if_watchdog = rt2860_watchdog;
 	IFQ_SET_READY(>if_snd);
 	memcpy(ifp->if_xname, device_xname(sc->sc_dev), IFNAMSIZ);
@@ -434,7 +437,7 @@ rt2860_attachhook(device_t self)
 
 	ieee80211_announce(ic);
 
-	if (pmf_device_register(sc->sc_dev, NULL, NULL))
+	if (pmf_device_register(sc->sc_dev, rt2860_wakeup, rt2860_suspend))
 		pmf_class_network_register(sc->sc_dev, ifp);
 	else
 		aprint_error_dev(sc->sc_dev,
@@ -471,24 +474,31 @@ rt2860_detach(void *xsc)
 	return 0;
 }
 
-void
-rt2860_suspend(void *xsc)
+static bool
+rt2860_suspend(device_t self, const pmf_qual_t *qual)
 {
-	struct rt2860_softc *sc = xsc;
+	struct rt2860_softc *sc = device_private(self);
 	struct ifnet *ifp = >sc_if;
 
 	if (ifp->if_flags & IFF_RUNNING)
 		rt2860_stop(ifp, 1);
+
+	return true;
 }
 
-void
-rt2860_wakeup(void *xsc)
+static bool
+rt2860_wakeup(device_t self, const pmf_qual_t *qual)
 {
-	struct rt2860_softc *sc = xsc;
+	struct rt2860_softc *sc = device_private(self);
 	struct ifnet *ifp = >sc_if;
+	int s;
 
+	s = splnet();
 	if (ifp->if_flags & IFF_UP)
 		rt2860_init(ifp);
+	splx(s);
+
+	return true;
 }
 
 static int

Index: src/sys/dev/ic/rt2860var.h
diff -u src/sys/dev/ic/rt2860var.h:1.4 src/sys/dev/ic/rt2860var.h:1.4.6.1
--- src/sys/dev/ic/rt2860var.h:1.4	Thu Feb  2 10:05:35 2017
+++ src/sys/dev/ic/rt2860var.h	Tue Aug  1 23:10:00 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: rt2860var.h,v 1.4 2017/02/02 10:05:35 nonaka Exp $	*/
+/*	$NetBSD: rt2860var.h,v 1.4.6.1 2017/08/01 23:10:00 snj Exp $	*/
 /*	$OpenBSD: rt2860var.h,v 1.23 2016/03/21 21:16:30 stsp Exp $	*/
 
 /*-
@@ -212,6 +212,4 @@ struct rt2860_softc {
 
 int	rt2860_attach(void *, int);
 int	rt2860_detach(void *);
-void	rt2860_suspend(void *);
-void	rt2860_wakeup(void *);
 int	rt2860_intr(void *);

Index: src/sys/dev/pci/if_ral_pci.c
diff -u src/sys/dev/pci/if_ral_pci.c:1.23 src/sys/dev/pci/if_ral_pci.c:1.23.10.1
--- src/sys/dev/pci/if_ral_pci.c:1.23	Wed Jul  6 14:28:51 2016
+++ src/sys/dev/pci/if_ral_pci.c	Tue Aug  1 23:10:00 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_ral_pci.c,v 1.23 2016/07/06 14:28:51 christos Exp $	*/
+/*	$NetBSD: if_ral_pci.c,v 1.23.10.1 2017/08/01 23:10:00 snj Exp $	*/
 /*	$OpenBSD: if_ral_pci.c,v 1.24 2015/11/24 17:11:39 mpi Exp $  */
 
 /*-
@@ -21,7 +21,7 @@
  * PCI front-end for the Ralink RT2560/RT2561/RT2860/RT3090 driver.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_ral_pci.c,v 1.23 2016/07/06 14:28:51 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ral_pci.c,v 1.23.10.1 2017/08/01 23:10:00 snj Exp $");
 
 
 #include 
@@ 

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

2017-08-01 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Aug  1 23:10:00 UTC 2017

Modified Files:
src/sys/dev/ic [netbsd-8]: rt2860.c rt2860var.h
src/sys/dev/pci [netbsd-8]: if_ral_pci.c

Log Message:
Pull up following revision(s) (requested by maya in ticket #162):
sys/dev/pci/if_ral_pci.c: revision 1.24
sys/dev/ic/rt2860.c: revision 1.28
sys/dev/ic/rt2860var.h: revision 1.5
enable rt2860 power management code
adjust to fit netbsd:
make suspend,resume functions match desired pmf* prototypes
remove wakeup/activate wrapper functions
avoid jumping to NULL on resume by initializing if_stop
the problem machine has other issues on resume, so there might be further
issues, but it's an improvement over a jump to NULL.
tested by Riccardo Mottola


To generate a diff of this commit:
cvs rdiff -u -r1.26.2.1 -r1.26.2.2 src/sys/dev/ic/rt2860.c
cvs rdiff -u -r1.4 -r1.4.6.1 src/sys/dev/ic/rt2860var.h
cvs rdiff -u -r1.23 -r1.23.10.1 src/sys/dev/pci/if_ral_pci.c

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



CVS commit: [jdolecek-ncq] src/sys/dev/ata

2017-08-01 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Tue Aug  1 22:04:48 UTC 2017

Modified Files:
src/sys/dev/ata [jdolecek-ncq]: TODO.ncq

Log Message:
another one down


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.31 -r1.1.2.32 src/sys/dev/ata/TODO.ncq

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



CVS commit: [jdolecek-ncq] src/sys/dev/ata

2017-08-01 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Tue Aug  1 22:04:48 UTC 2017

Modified Files:
src/sys/dev/ata [jdolecek-ncq]: TODO.ncq

Log Message:
another one down


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.31 -r1.1.2.32 src/sys/dev/ata/TODO.ncq

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/ata/TODO.ncq
diff -u src/sys/dev/ata/TODO.ncq:1.1.2.31 src/sys/dev/ata/TODO.ncq:1.1.2.32
--- src/sys/dev/ata/TODO.ncq:1.1.2.31	Mon Jul 31 20:11:17 2017
+++ src/sys/dev/ata/TODO.ncq	Tue Aug  1 22:04:48 2017
@@ -18,12 +18,6 @@ active system? make sure to not trigger 
 kill active transfers after software drive reset - race timeout vs.
 error recovery
 
-multi-pmp disk open+i/o on siisata fails - track down and fix
-#!/bin/sh
-for disk in $disks; do
-(echo $disk; for i in `seq 0 3`; do dd if=/dev/r${disk}d bs=16m of=/dev/null count=1; done)&
-done;
-
 Other random notes (do outside the NCQ branch):
 -
 implement support for PM FIS-based switching, remove restriction in atastart()



CVS commit: [jdolecek-ncq] src/sys/dev/ic

2017-08-01 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Tue Aug  1 22:02:32 UTC 2017

Modified Files:
src/sys/dev/ic [jdolecek-ncq]: ahcisata_core.c ahcisatavar.h
mvsatavar.h siisata.c siisatavar.h

Log Message:
fix logic bug in processing of finished commands - mask of active
commands can change during the loop as c_intr() callback can queue
new commands, so the interrupt routine should only mark as finished
those which were actually active before the loop started; otherwise
the code marked as finished commands which were just started, and
being executed by HBA, leading to all sorts of data corruption

while here mark the active mask volatile, as it is modified from
interrupt context

this fixes for good the random crashes, short reads, and fatal command
errors which I've been tracing down for past couple weeks

thanks to Jonathan (jakllsch@) for testing, and a script to easily
triggered the condition, and led to this bug being finally found and squashed


To generate a diff of this commit:
cvs rdiff -u -r1.57.6.24 -r1.57.6.25 src/sys/dev/ic/ahcisata_core.c
cvs rdiff -u -r1.17.6.2 -r1.17.6.3 src/sys/dev/ic/ahcisatavar.h
cvs rdiff -u -r1.2.48.2 -r1.2.48.3 src/sys/dev/ic/mvsatavar.h
cvs rdiff -u -r1.30.4.30 -r1.30.4.31 src/sys/dev/ic/siisata.c
cvs rdiff -u -r1.6.48.2 -r1.6.48.3 src/sys/dev/ic/siisatavar.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/ic/ahcisata_core.c
diff -u src/sys/dev/ic/ahcisata_core.c:1.57.6.24 src/sys/dev/ic/ahcisata_core.c:1.57.6.25
--- src/sys/dev/ic/ahcisata_core.c:1.57.6.24	Sat Jul 29 16:50:32 2017
+++ src/sys/dev/ic/ahcisata_core.c	Tue Aug  1 22:02:32 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: ahcisata_core.c,v 1.57.6.24 2017/07/29 16:50:32 jdolecek Exp $	*/
+/*	$NetBSD: ahcisata_core.c,v 1.57.6.25 2017/08/01 22:02:32 jdolecek Exp $	*/
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ahcisata_core.c,v 1.57.6.24 2017/07/29 16:50:32 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ahcisata_core.c,v 1.57.6.25 2017/08/01 22:02:32 jdolecek Exp $");
 
 #include 
 #include 
@@ -559,7 +559,7 @@ ahci_intr(void *v)
 static void
 ahci_intr_port(struct ahci_softc *sc, struct ahci_channel *achp)
 {
-	uint32_t is, tfd, active;
+	uint32_t is, tfd, sact;
 	struct ata_channel *chp = >ata_channel;
 	struct ata_xfer *xfer;
 	int slot;
@@ -578,12 +578,12 @@ ahci_intr_port(struct ahci_softc *sc, st
 
 	if ((chp->ch_flags & ATACH_NCQ) == 0) {
 		/* Non-NCQ operation */
-		active = AHCI_READ(sc, AHCI_P_CI(chp->ch_channel));
+		sact = AHCI_READ(sc, AHCI_P_CI(chp->ch_channel));
 		slot = (AHCI_READ(sc, AHCI_P_CMD(chp->ch_channel))
 			& AHCI_P_CMD_CCS_MASK) >> AHCI_P_CMD_CCS_SHIFT;
 	} else {
 		/* NCQ operation */
-		active = AHCI_READ(sc, AHCI_P_SACT(chp->ch_channel));
+		sact = AHCI_READ(sc, AHCI_P_SACT(chp->ch_channel));
 		slot = -1;
 	}
 
@@ -595,7 +595,7 @@ ahci_intr_port(struct ahci_softc *sc, st
 			tfd = AHCI_READ(sc, AHCI_P_TFD(chp->ch_channel));
 
 			aprint_error("%s port %d: active %x is 0x%x tfd 0x%x\n",
-			AHCINAME(sc), chp->ch_channel, active, is, tfd);
+			AHCINAME(sc), chp->ch_channel, sact, is, tfd);
 		} else {
 			/* mark an error, and set BSY */
 			tfd = (WDCE_ABRT << AHCI_P_TFD_ERR_SHIFT) |
@@ -630,8 +630,8 @@ ahci_intr_port(struct ahci_softc *sc, st
 		ata_channel_freeze(chp);
 
 	if (slot >= 0) {
-		if ((achp->ahcic_cmds_active & (1 << slot)) != 0 &&
-		(active & (1 << slot)) == 0) {
+		if ((achp->ahcic_cmds_active & __BIT(slot)) != 0 &&
+		(sact & __BIT(slot)) == 0) {
 			xfer = ata_queue_hwslot_to_xfer(chp, slot);
 			xfer->c_intr(chp, xfer, tfd);
 		}
@@ -641,10 +641,15 @@ ahci_intr_port(struct ahci_softc *sc, st
 		 * and any further D2H FISes are ignored until the error
 		 * condition is cleared. Hence if a command is inactive,
 		 * it means it actually already finished successfully.
+		 * Note: active slots can change as c_intr() callback
+		 * can activate another command(s), so must only process
+		 * commands active before we start processing.
 		 */
+		uint32_t aslots = achp->ahcic_cmds_active;
+
 		for (slot=0; slot < sc->sc_ncmds; slot++) {
-			if ((achp->ahcic_cmds_active & (1 << slot)) != 0 &&
-			(active & (1 << slot)) == 0) {
+			if ((aslots & __BIT(slot)) != 0 &&
+			(sact & __BIT(slot)) == 0) {
 xfer = ata_queue_hwslot_to_xfer(chp, slot);
 xfer->c_intr(chp, xfer, 0);
 			}

Index: src/sys/dev/ic/ahcisatavar.h
diff -u src/sys/dev/ic/ahcisatavar.h:1.17.6.2 src/sys/dev/ic/ahcisatavar.h:1.17.6.3
--- src/sys/dev/ic/ahcisatavar.h:1.17.6.2	Sat Jul 29 15:07:46 2017
+++ src/sys/dev/ic/ahcisatavar.h	Tue Aug  1 22:02:32 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: ahcisatavar.h,v 1.17.6.2 2017/07/29 15:07:46 jdolecek Exp $	*/
+/*	$NetBSD: ahcisatavar.h,v 1.17.6.3 2017/08/01 22:02:32 jdolecek Exp $	*/
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -82,7 +82,7 @@ struct 

CVS commit: [jdolecek-ncq] src/sys/dev/ic

2017-08-01 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Tue Aug  1 22:02:32 UTC 2017

Modified Files:
src/sys/dev/ic [jdolecek-ncq]: ahcisata_core.c ahcisatavar.h
mvsatavar.h siisata.c siisatavar.h

Log Message:
fix logic bug in processing of finished commands - mask of active
commands can change during the loop as c_intr() callback can queue
new commands, so the interrupt routine should only mark as finished
those which were actually active before the loop started; otherwise
the code marked as finished commands which were just started, and
being executed by HBA, leading to all sorts of data corruption

while here mark the active mask volatile, as it is modified from
interrupt context

this fixes for good the random crashes, short reads, and fatal command
errors which I've been tracing down for past couple weeks

thanks to Jonathan (jakllsch@) for testing, and a script to easily
triggered the condition, and led to this bug being finally found and squashed


To generate a diff of this commit:
cvs rdiff -u -r1.57.6.24 -r1.57.6.25 src/sys/dev/ic/ahcisata_core.c
cvs rdiff -u -r1.17.6.2 -r1.17.6.3 src/sys/dev/ic/ahcisatavar.h
cvs rdiff -u -r1.2.48.2 -r1.2.48.3 src/sys/dev/ic/mvsatavar.h
cvs rdiff -u -r1.30.4.30 -r1.30.4.31 src/sys/dev/ic/siisata.c
cvs rdiff -u -r1.6.48.2 -r1.6.48.3 src/sys/dev/ic/siisatavar.h

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



CVS commit: src/share/mk

2017-08-01 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Tue Aug  1 21:50:36 UTC 2017

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

Log Message:
convert two pairs of MACHINE_ARCH into two single MACHINE_CPU checks.


To generate a diff of this commit:
cvs rdiff -u -r1.271 -r1.272 src/share/mk/bsd.sys.mk

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

Modified files:

Index: src/share/mk/bsd.sys.mk
diff -u src/share/mk/bsd.sys.mk:1.271 src/share/mk/bsd.sys.mk:1.272
--- src/share/mk/bsd.sys.mk:1.271	Thu Apr 20 09:29:11 2017
+++ src/share/mk/bsd.sys.mk	Tue Aug  1 21:50:36 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.sys.mk,v 1.271 2017/04/20 09:29:11 ozaki-r Exp $
+#	$NetBSD: bsd.sys.mk,v 1.272 2017/08/01 21:50:36 mrg Exp $
 #
 # Build definitions used for NetBSD source tree builds.
 
@@ -114,10 +114,8 @@ CFLAGS+=	${${ACTIVE_CC} == "clang":? -Wp
 .endif
 .if (defined(HAVE_GCC) \
  && (${MACHINE_ARCH} == "coldfire" || \
-	 ${MACHINE_ARCH} == "sh3eb" || \
-	 ${MACHINE_ARCH} == "sh3el" || \
-	 ${MACHINE_ARCH} == "m68k" || \
-	 ${MACHINE_ARCH} == "m68000"))
+	 ${MACHINE_CPU} == "sh3" || \
+	 ${MACHINE_CPU} == "m68k"))
 # XXX GCC 4.5 for sh3 and m68k (which we compile with -Os) is extra noisy for
 # cases it should be better with
 CFLAGS+=	-Wno-uninitialized



CVS commit: src/share/mk

2017-08-01 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Tue Aug  1 21:50:36 UTC 2017

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

Log Message:
convert two pairs of MACHINE_ARCH into two single MACHINE_CPU checks.


To generate a diff of this commit:
cvs rdiff -u -r1.271 -r1.272 src/share/mk/bsd.sys.mk

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



CVS commit: [jdolecek-ncq] src/sys/dev/ic

2017-08-01 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Tue Aug  1 21:43:49 UTC 2017

Modified Files:
src/sys/dev/ic [jdolecek-ncq]: siisata.c

Log Message:
adjust code to be closer to HEAD to it's easier to compare and find
regressions, undoing some changes which were actually not necessary


To generate a diff of this commit:
cvs rdiff -u -r1.30.4.29 -r1.30.4.30 src/sys/dev/ic/siisata.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/siisata.c
diff -u src/sys/dev/ic/siisata.c:1.30.4.29 src/sys/dev/ic/siisata.c:1.30.4.30
--- src/sys/dev/ic/siisata.c:1.30.4.29	Sun Jul 30 20:46:31 2017
+++ src/sys/dev/ic/siisata.c	Tue Aug  1 21:43:49 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: siisata.c,v 1.30.4.29 2017/07/30 20:46:31 jdolecek Exp $ */
+/* $NetBSD: siisata.c,v 1.30.4.30 2017/08/01 21:43:49 jdolecek Exp $ */
 
 /* from ahcisata_core.c */
 
@@ -79,7 +79,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: siisata.c,v 1.30.4.29 2017/07/30 20:46:31 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: siisata.c,v 1.30.4.30 2017/08/01 21:43:49 jdolecek Exp $");
 
 #include 
 #include 
@@ -245,7 +245,10 @@ siisata_enable_port_interrupt(struct ata
 {
 	struct siisata_softc *sc = (struct siisata_softc *)chp->ch_atac;
 
-	/* enable CmdErrr+CmdCmpl interrupting */
+	/* clear any interrupts */
+	(void)PRREAD(sc, PRX(chp->ch_channel, PRO_PSS));
+	PRWRITE(sc, PRX(chp->ch_channel, PRO_PIS), 0x);
+	/* and enable CmdErrr+CmdCmpl interrupting */
 	PRWRITE(sc, PRX(chp->ch_channel, PRO_PIES),
 	PR_PIS_CMDERRR | PR_PIS_CMDCMPL);
 }
@@ -259,12 +262,9 @@ siisata_init_port(struct siisata_softc *
 	schp = >sc_channels[port];
 	chp = (struct ata_channel *)schp;
 
-	/*
-	 * Come out of reset. Disable no clearing of PR_PIS_CMDCMPL on read
-	 * of PR_PSS. Disable 32-bit PRB activation, we use 64-bit activation.
-	 */
+	/* come out of reset, 64-bit activation */
 	PRWRITE(sc, PRX(chp->ch_channel, PRO_PCC),
-	PR_PC_32BA | PR_PC_INCOR | PR_PC_PORT_RESET);
+	PR_PC_32BA | PR_PC_PORT_RESET);
 	/* initialize port */
 	siisata_reinit_port(chp, -1);
 	/* enable CmdErrr+CmdCmpl interrupting */
@@ -474,29 +474,25 @@ siisata_intr_port(struct siisata_channel
 	struct siisata_softc *sc =
 	(struct siisata_softc *)schp->ata_channel.ch_atac;
 	struct ata_channel *chp = >ata_channel;
-	struct ata_xfer *xfer;
-	int slot = -1;
+	struct ata_xfer *xfer = NULL;
 	uint32_t pss, pis, tfd = 0;
 	bool recover = false;
 
-	/* get slot status, clearing completion interrupt (PR_PIS_CMDCMPL) */
-	pss = PRREAD(sc, PRX(chp->ch_channel, PRO_PSS));
-
-	SIISATA_DEBUG_PRINT(("%s: %s port %d, pss 0x%x\n",
-	SIISATANAME(sc), __func__, chp->ch_channel, pss), DEBUG_INTR);
-
-	/* if no errors, just process finished commands and we're done */
-	if (__predict_true((pss & PR_PSS_ATTENTION) == 0))
-		goto process;
-
 	pis = PRREAD(sc, PRX(chp->ch_channel, PRO_PIS));
 
 	SIISATA_DEBUG_PRINT(("%s: %s port %d, pis 0x%x ",
 	SIISATANAME(sc), __func__, chp->ch_channel, pis),
 	DEBUG_INTR);
 
-	/* clear */
-	PRWRITE(sc, PRX(chp->ch_channel, PRO_PIS), pis);
+	if (pis & PR_PIS_CMDCMPL) {
+		/* get slot status, clearing completion interrupt */
+		pss = PRREAD(sc, PRX(chp->ch_channel, PRO_PSS));
+
+		SIISATA_DEBUG_PRINT(("pss 0x%x\n", pss), DEBUG_INTR);
+	} else {
+		/* commands will be killed after recovery */
+		pss = 0x;
+	}
 
 	if (pis & PR_PIS_CMDERRR) {
 		uint32_t ec;
@@ -510,15 +506,12 @@ siisata_intr_port(struct siisata_channel
 		if (ec <= PR_PCE_DATAFISERROR) {
 			if (ec == PR_PCE_DEVICEERROR
 			&& (chp->ch_flags & ATACH_NCQ) == 0) {
-uint32_t ps = PRREAD(sc,
-PRX(chp->ch_channel, PRO_PS));
-/* This is only relevant for non-NCQ commands */
-slot = PR_PS_ACTIVE_SLOT(ps);
+xfer = ata_queue_get_active_xfer(chp);
 
 /* read in specific information about error */
 uint32_t prbfis = bus_space_read_stream_4(
 sc->sc_prt, sc->sc_prh,
-PRSX(chp->ch_channel, slot,
+PRSX(chp->ch_channel, xfer->c_slot,
 PRSO_FIS));
 
 /* get status and error */
@@ -528,30 +521,39 @@ siisata_intr_port(struct siisata_channel
 if (ATACH_ST(ntfd) & WDCS_ERR)
 	tfd = ntfd;
 			}
+
+			/*
+			 * We don't expect the recovery to trigger error,
+			 * but handle this just in case.
+			 */
+			if (!schp->sch_recovering) 
+recover = true;
+			else {
+aprint_error_dev(sc->sc_atac.atac_dev,
+"error ec %x while recovering\n", ec);
+
+/* Command will be marked as errored out */
+pss = 0;
+			}
 		} else {
 			aprint_error_dev(sc->sc_atac.atac_dev, "fatal error %d"
 			" on channel %d (ctx 0x%x), resetting\n",
 			ec, chp->ch_channel,
 			PRREAD(sc, PRX(chp->ch_channel, PRO_PCR)));
 
-			tfd |= ATACH_ERR_ST(0, WDCS_BSY);
+			/* okay, we have a "Fatal Error" */
+			siisata_device_reset(chp);
 		}
-
-		if (!schp->sch_recovering)
-			recover = true;
-	} else {

CVS commit: [jdolecek-ncq] src/sys/dev/ic

2017-08-01 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Tue Aug  1 21:43:49 UTC 2017

Modified Files:
src/sys/dev/ic [jdolecek-ncq]: siisata.c

Log Message:
adjust code to be closer to HEAD to it's easier to compare and find
regressions, undoing some changes which were actually not necessary


To generate a diff of this commit:
cvs rdiff -u -r1.30.4.29 -r1.30.4.30 src/sys/dev/ic/siisata.c

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



CVS commit: [jdolecek-ncq] src/sys/dev/ata

2017-08-01 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Tue Aug  1 21:41:26 UTC 2017

Modified Files:
src/sys/dev/ata [jdolecek-ncq]: ata.c

Log Message:
make atastart() schedule as many commands as possible, instead of always
only one; makes it able to pick up pace again after processing non-NCQ command


To generate a diff of this commit:
cvs rdiff -u -r1.132.8.23 -r1.132.8.24 src/sys/dev/ata/ata.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/ata/ata.c
diff -u src/sys/dev/ata/ata.c:1.132.8.23 src/sys/dev/ata/ata.c:1.132.8.24
--- src/sys/dev/ata/ata.c:1.132.8.23	Tue Aug  1 21:39:51 2017
+++ src/sys/dev/ata/ata.c	Tue Aug  1 21:41:25 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: ata.c,v 1.132.8.23 2017/08/01 21:39:51 jdolecek Exp $	*/
+/*	$NetBSD: ata.c,v 1.132.8.24 2017/08/01 21:41:25 jdolecek Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Manuel Bouyer.  All rights reserved.
@@ -25,7 +25,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ata.c,v 1.132.8.23 2017/08/01 21:39:51 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ata.c,v 1.132.8.24 2017/08/01 21:41:25 jdolecek Exp $");
 
 #include "opt_ata.h"
 
@@ -1240,6 +1240,7 @@ atastart(struct ata_channel *chp)
 	splx(spl1);
 #endif /* ATA_DEBUG */
 
+again:
 	mutex_enter(>ch_lock);
 
 	KASSERT(chq->queue_active <= chq->queue_openings);
@@ -1318,6 +1319,11 @@ atastart(struct ata_channel *chp)
 	 * routine for polled commands.
 	 */
 	xfer->c_start(chp, xfer);
+
+	/* Queue more commands if possible */
+	if (chq->queue_active < chq->queue_openings)
+		goto again;
+
 	return;
 
 out:



CVS commit: [jdolecek-ncq] src/sys/dev/ata

2017-08-01 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Tue Aug  1 21:41:26 UTC 2017

Modified Files:
src/sys/dev/ata [jdolecek-ncq]: ata.c

Log Message:
make atastart() schedule as many commands as possible, instead of always
only one; makes it able to pick up pace again after processing non-NCQ command


To generate a diff of this commit:
cvs rdiff -u -r1.132.8.23 -r1.132.8.24 src/sys/dev/ata/ata.c

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




CVS commit: src/external/bsd/llvm

2017-08-01 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Tue Aug  1 21:40:03 UTC 2017

Modified Files:
src/external/bsd/llvm/bin/llvm-ar: Makefile
src/external/bsd/llvm/lib: Makefile
Added Files:
src/external/bsd/llvm/lib/libLLVMToolDriversDlltool: Makefile

Log Message:
Fix linking for the optional llvm-ar tool.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/external/bsd/llvm/bin/llvm-ar/Makefile
cvs rdiff -u -r1.45 -r1.46 src/external/bsd/llvm/lib/Makefile
cvs rdiff -u -r0 -r1.1 \
src/external/bsd/llvm/lib/libLLVMToolDriversDlltool/Makefile

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

Modified files:

Index: src/external/bsd/llvm/bin/llvm-ar/Makefile
diff -u src/external/bsd/llvm/bin/llvm-ar/Makefile:1.9 src/external/bsd/llvm/bin/llvm-ar/Makefile:1.10
--- src/external/bsd/llvm/bin/llvm-ar/Makefile:1.9	Tue Aug  1 20:07:38 2017
+++ src/external/bsd/llvm/bin/llvm-ar/Makefile	Tue Aug  1 21:40:03 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.9 2017/08/01 20:07:38 joerg Exp $
+#	$NetBSD: Makefile,v 1.10 2017/08/01 21:40:03 joerg Exp $
 
 PROG_CXX=	llvm-ar
 NOMAN=		yes
@@ -10,6 +10,8 @@ NOMAN=		yes
 SRCS=	llvm-ar.cpp
 
 LLVM_LIBS+= \
+	ToolDriversDlltool \
+	ToolDrivers \
 	AArch64AsmParser \
 	AArch64MCTargetDesc \
 	AArch64AsmPrinter \
@@ -45,7 +47,6 @@ LLVM_LIBS+= \
 	BitReader \
 	IR \
 	BinaryFormat \
-	ToolDrivers \
 	Option \
 	Support \
 	Demangle

Index: src/external/bsd/llvm/lib/Makefile
diff -u src/external/bsd/llvm/lib/Makefile:1.45 src/external/bsd/llvm/lib/Makefile:1.46
--- src/external/bsd/llvm/lib/Makefile:1.45	Tue Aug  1 20:07:40 2017
+++ src/external/bsd/llvm/lib/Makefile	Tue Aug  1 21:40:03 2017
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.45 2017/08/01 20:07:40 joerg Exp $
+# $NetBSD: Makefile,v 1.46 2017/08/01 21:40:03 joerg Exp $
 
 .include 
 
@@ -115,6 +115,7 @@ SUBDIR+= \
 	libLLVMLineEditor \
 	libLLVMObjectYAML \
 	libLLVMToolDrivers \
+	libLLVMToolDriversDlltool \
 	libLLVMXRay
 .endif
 

Added files:

Index: src/external/bsd/llvm/lib/libLLVMToolDriversDlltool/Makefile
diff -u /dev/null src/external/bsd/llvm/lib/libLLVMToolDriversDlltool/Makefile:1.1
--- /dev/null	Tue Aug  1 21:40:03 2017
+++ src/external/bsd/llvm/lib/libLLVMToolDriversDlltool/Makefile	Tue Aug  1 21:40:03 2017
@@ -0,0 +1,21 @@
+#	$NetBSD: Makefile,v 1.1 2017/08/01 21:40:03 joerg Exp $
+
+LIB=	LLVMToolDriversDlltool
+
+.include 
+
+.PATH: ${LLVM_SRCDIR}/lib/ToolDrivers/llvm-dlltool
+
+SRCS+=	DlltoolDriver.cpp
+
+TABLEGEN_SRC=		Options.td
+TABLEGEN_OUTPUT= \
+	Options.inc|-gen-opt-parser-defs
+
+.include "${.PARSEDIR}/../../tablegen.mk"
+
+.if defined(HOSTLIB)
+.include 
+.else
+.include 
+.endif



CVS commit: src/external/bsd/llvm

2017-08-01 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Tue Aug  1 21:40:03 UTC 2017

Modified Files:
src/external/bsd/llvm/bin/llvm-ar: Makefile
src/external/bsd/llvm/lib: Makefile
Added Files:
src/external/bsd/llvm/lib/libLLVMToolDriversDlltool: Makefile

Log Message:
Fix linking for the optional llvm-ar tool.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/external/bsd/llvm/bin/llvm-ar/Makefile
cvs rdiff -u -r1.45 -r1.46 src/external/bsd/llvm/lib/Makefile
cvs rdiff -u -r0 -r1.1 \
src/external/bsd/llvm/lib/libLLVMToolDriversDlltool/Makefile

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



CVS commit: [jdolecek-ncq] src/sys/dev/ata

2017-08-01 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Tue Aug  1 21:39:51 UTC 2017

Modified Files:
src/sys/dev/ata [jdolecek-ncq]: ata.c atavar.h

Log Message:
move the drive recovery block to drive struct, it's inherently per-drive


To generate a diff of this commit:
cvs rdiff -u -r1.132.8.22 -r1.132.8.23 src/sys/dev/ata/ata.c
cvs rdiff -u -r1.92.8.20 -r1.92.8.21 src/sys/dev/ata/atavar.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/ata/ata.c
diff -u src/sys/dev/ata/ata.c:1.132.8.22 src/sys/dev/ata/ata.c:1.132.8.23
--- src/sys/dev/ata/ata.c:1.132.8.22	Sat Jul 29 12:58:29 2017
+++ src/sys/dev/ata/ata.c	Tue Aug  1 21:39:51 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: ata.c,v 1.132.8.22 2017/07/29 12:58:29 jdolecek Exp $	*/
+/*	$NetBSD: ata.c,v 1.132.8.23 2017/08/01 21:39:51 jdolecek Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Manuel Bouyer.  All rights reserved.
@@ -25,7 +25,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ata.c,v 1.132.8.22 2017/07/29 12:58:29 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ata.c,v 1.132.8.23 2017/08/01 21:39:51 jdolecek Exp $");
 
 #include "opt_ata.h"
 
@@ -1051,7 +1051,7 @@ ata_read_log_ext_ncq(struct ata_drive_da
 
 	xfer = ata_get_xfer_ext(chp, C_RECOVERY, 0);
 
-	tb = chp->ch_recovery;
+	tb = drvp->recovery_blk;
 	memset(tb, 0, DEV_BSIZE);
 
 	/*

Index: src/sys/dev/ata/atavar.h
diff -u src/sys/dev/ata/atavar.h:1.92.8.20 src/sys/dev/ata/atavar.h:1.92.8.21
--- src/sys/dev/ata/atavar.h:1.92.8.20	Sat Jul 29 12:58:29 2017
+++ src/sys/dev/ata/atavar.h	Tue Aug  1 21:39:51 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: atavar.h,v 1.92.8.20 2017/07/29 12:58:29 jdolecek Exp $	*/
+/*	$NetBSD: atavar.h,v 1.92.8.21 2017/08/01 21:39:51 jdolecek Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Manuel Bouyer.
@@ -321,6 +321,9 @@ struct ata_drive_datas {
 	struct disklabel *lp;	/* pointer to drive's label info */
 	uint8_t		multi;	/* # of blocks to transfer in multi-mode */
 	daddr_t	badsect[127];	/* 126 plus trailing -1 marker */
+
+	/* Recovery buffer */
+	uint8_t recovery_blk[DEV_BSIZE];
 };
 
 /* User config flags that force (or disable) the use of a mode */
@@ -425,9 +428,6 @@ struct ata_channel {
 
 	/* Number of sata PMP ports, if any */
 	int ch_satapmp_nports;
-
-	/* Recovery buffer */
-	uint8_t ch_recovery[DEV_BSIZE];
 };
 
 /*



CVS commit: [jdolecek-ncq] src/sys/dev/ata

2017-08-01 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Tue Aug  1 21:39:51 UTC 2017

Modified Files:
src/sys/dev/ata [jdolecek-ncq]: ata.c atavar.h

Log Message:
move the drive recovery block to drive struct, it's inherently per-drive


To generate a diff of this commit:
cvs rdiff -u -r1.132.8.22 -r1.132.8.23 src/sys/dev/ata/ata.c
cvs rdiff -u -r1.92.8.20 -r1.92.8.21 src/sys/dev/ata/atavar.h

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



CVS commit: src

2017-08-01 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Tue Aug  1 20:07:43 UTC 2017

Modified Files:
src/distrib/sets/lists/base: mi
src/distrib/sets/lists/comp: ad.arm ad.mips ad.powerpc md.amd64 md.i386
mi
src/etc/mtree: NetBSD.dist.base
src/external/bsd/llvm: Makefile Makefile.inc
src/external/bsd/llvm/bin: Makefile
src/external/bsd/llvm/bin/bugpoint: Makefile
src/external/bsd/llvm/bin/clang: Makefile
src/external/bsd/llvm/bin/clang-tblgen: Makefile
src/external/bsd/llvm/bin/llc: Makefile
src/external/bsd/llvm/bin/lli: Makefile
src/external/bsd/llvm/bin/llvm-ar: Makefile
src/external/bsd/llvm/bin/llvm-as: Makefile
src/external/bsd/llvm/bin/llvm-cov: Makefile
src/external/bsd/llvm/bin/llvm-cxxdump: Makefile
src/external/bsd/llvm/bin/llvm-diff: Makefile
src/external/bsd/llvm/bin/llvm-dis: Makefile
src/external/bsd/llvm/bin/llvm-dwarfdump: Makefile
src/external/bsd/llvm/bin/llvm-dwp: Makefile
src/external/bsd/llvm/bin/llvm-extract: Makefile
src/external/bsd/llvm/bin/llvm-link: Makefile
src/external/bsd/llvm/bin/llvm-nm: Makefile
src/external/bsd/llvm/bin/llvm-objdump: Makefile
src/external/bsd/llvm/bin/llvm-profdata: Makefile
src/external/bsd/llvm/bin/llvm-readobj: Makefile
src/external/bsd/llvm/bin/llvm-size: Makefile
src/external/bsd/llvm/bin/llvm-symbolizer: Makefile
src/external/bsd/llvm/bin/llvm-xray: Makefile
src/external/bsd/llvm/bin/opt: Makefile
src/external/bsd/llvm/bin/sancov: Makefile
src/external/bsd/llvm/bin/sanstats: Makefile
src/external/bsd/llvm/bin/tblgen: Makefile
src/external/bsd/llvm/config/clang/Config: config.h
src/external/bsd/llvm/config/llvm/Config: config.h.in
src/external/bsd/llvm/dist/llvm-configure: configure
src/external/bsd/llvm/dist/llvm-configure/autoconf: configure.ac
src/external/bsd/llvm/dist/llvm-configure/include/llvm/Config:
config.h.in
src/external/bsd/llvm/include: Makefile
src/external/bsd/llvm/lib: Makefile
src/external/bsd/llvm/lib/libLLVMAArch64CodeGen: Makefile
src/external/bsd/llvm/lib/libLLVMAArch64MCTargetDesc: Makefile
src/external/bsd/llvm/lib/libLLVMARMCodeGen: Makefile
src/external/bsd/llvm/lib/libLLVMAnalysis: Makefile
src/external/bsd/llvm/lib/libLLVMCodeGen: Makefile
src/external/bsd/llvm/lib/libLLVMDebugInfoCodeView: Makefile
src/external/bsd/llvm/lib/libLLVMDebugInfoDWARF: Makefile
src/external/bsd/llvm/lib/libLLVMDebugInfoMSF: Makefile
src/external/bsd/llvm/lib/libLLVMDebugInfoPDB: Makefile
src/external/bsd/llvm/lib/libLLVMDebugInfoPDBRaw: Makefile
src/external/bsd/llvm/lib/libLLVMGlobalISel: Makefile
src/external/bsd/llvm/lib/libLLVMIR: Makefile
src/external/bsd/llvm/lib/libLLVMInstrumentation: Makefile
src/external/bsd/llvm/lib/libLLVMMC: Makefile
src/external/bsd/llvm/lib/libLLVMMipsCodeGen: Makefile
src/external/bsd/llvm/lib/libLLVMObject: Makefile
src/external/bsd/llvm/lib/libLLVMObjectYAML: Makefile
src/external/bsd/llvm/lib/libLLVMOrc: Makefile
src/external/bsd/llvm/lib/libLLVMPowerPCCodeGen: Makefile
src/external/bsd/llvm/lib/libLLVMScalarOpts: Makefile
src/external/bsd/llvm/lib/libLLVMSelectionDAG: Makefile
src/external/bsd/llvm/lib/libLLVMSupport: Makefile
src/external/bsd/llvm/lib/libLLVMTransformsUtils: Makefile
src/external/bsd/llvm/lib/libLLVMVectorize: Makefile
src/external/bsd/llvm/lib/libLLVMX86CodeGen: Makefile
src/external/bsd/llvm/lib/libLLVMXRay: Makefile
src/external/bsd/llvm/lib/libclangAST: Makefile
src/external/bsd/llvm/lib/libclangBasic: Makefile
src/external/bsd/llvm/lib/libclangCodeGen: Makefile
src/external/bsd/llvm/lib/libclangDriver: Makefile
src/external/bsd/llvm/lib/libclangFormat: Makefile
src/external/bsd/llvm/lib/libclangFrontend: Makefile
src/external/bsd/llvm/lib/libclangStaticAnalyzerCheckers: Makefile
src/external/bsd/llvm/lib/libclangStaticAnalyzerCore: Makefile
Added Files:
src/external/bsd/llvm/bin/clang-rename: Makefile
src/external/bsd/llvm/lib/libLLVMBinaryFormat: Makefile
src/external/bsd/llvm/lib/libLLVMDebugInfoPDBNative: Makefile
src/external/bsd/llvm/lib/libLLVMToolDrivers: Makefile
src/external/bsd/llvm/lib/libclangToolingRefactoring: Makefile
src/tools/llvm-lib/libLLVMBinaryFormat: Makefile

Log Message:
Update LLVM build glue for 5.0RC1.


To generate a diff of this commit:
cvs rdiff -u -r1.1158 -r1.1159 src/distrib/sets/lists/base/mi
cvs rdiff -u -r1.78 -r1.79 src/distrib/sets/lists/comp/ad.arm
cvs rdiff -u -r1.69 -r1.70 

CVS commit: src/doc

2017-08-01 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Tue Aug  1 20:09:43 UTC 2017

Modified Files:
src/doc: 3RDPARTY

Log Message:
Update LLVM entry.


To generate a diff of this commit:
cvs rdiff -u -r1.1462 -r1.1463 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.1462 src/doc/3RDPARTY:1.1463
--- src/doc/3RDPARTY:1.1462	Tue Aug  1 16:44:19 2017
+++ src/doc/3RDPARTY	Tue Aug  1 20:09:43 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.1462 2017/08/01 16:44:19 wiz Exp $
+#	$NetBSD: 3RDPARTY,v 1.1463 2017/08/01 20:09:43 joerg Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -750,10 +750,10 @@ Notes:
   .so'ing only. Copy the rest to man.
 
 Package:	llvm
-Version:	3.8.1+ (r280599)
-Current Vers.:	3.9.0
-Maintainer:	llvm...@cs.uiuc.edu
-Home Page:	http://llvm.org
+Version:	5.0.0RC1+ (r309604)
+Current Vers.:	6.0.0svn
+Maintainer:	llvm-...@lists.llvm.org
+Home Page:	https://llvm.org
 Responsible:	joerg
 License:	BSD/MIT
 Location:	external/bsd/llvm/dist



CVS commit: src

2017-08-01 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Tue Aug  1 20:07:43 UTC 2017

Modified Files:
src/distrib/sets/lists/base: mi
src/distrib/sets/lists/comp: ad.arm ad.mips ad.powerpc md.amd64 md.i386
mi
src/etc/mtree: NetBSD.dist.base
src/external/bsd/llvm: Makefile Makefile.inc
src/external/bsd/llvm/bin: Makefile
src/external/bsd/llvm/bin/bugpoint: Makefile
src/external/bsd/llvm/bin/clang: Makefile
src/external/bsd/llvm/bin/clang-tblgen: Makefile
src/external/bsd/llvm/bin/llc: Makefile
src/external/bsd/llvm/bin/lli: Makefile
src/external/bsd/llvm/bin/llvm-ar: Makefile
src/external/bsd/llvm/bin/llvm-as: Makefile
src/external/bsd/llvm/bin/llvm-cov: Makefile
src/external/bsd/llvm/bin/llvm-cxxdump: Makefile
src/external/bsd/llvm/bin/llvm-diff: Makefile
src/external/bsd/llvm/bin/llvm-dis: Makefile
src/external/bsd/llvm/bin/llvm-dwarfdump: Makefile
src/external/bsd/llvm/bin/llvm-dwp: Makefile
src/external/bsd/llvm/bin/llvm-extract: Makefile
src/external/bsd/llvm/bin/llvm-link: Makefile
src/external/bsd/llvm/bin/llvm-nm: Makefile
src/external/bsd/llvm/bin/llvm-objdump: Makefile
src/external/bsd/llvm/bin/llvm-profdata: Makefile
src/external/bsd/llvm/bin/llvm-readobj: Makefile
src/external/bsd/llvm/bin/llvm-size: Makefile
src/external/bsd/llvm/bin/llvm-symbolizer: Makefile
src/external/bsd/llvm/bin/llvm-xray: Makefile
src/external/bsd/llvm/bin/opt: Makefile
src/external/bsd/llvm/bin/sancov: Makefile
src/external/bsd/llvm/bin/sanstats: Makefile
src/external/bsd/llvm/bin/tblgen: Makefile
src/external/bsd/llvm/config/clang/Config: config.h
src/external/bsd/llvm/config/llvm/Config: config.h.in
src/external/bsd/llvm/dist/llvm-configure: configure
src/external/bsd/llvm/dist/llvm-configure/autoconf: configure.ac
src/external/bsd/llvm/dist/llvm-configure/include/llvm/Config:
config.h.in
src/external/bsd/llvm/include: Makefile
src/external/bsd/llvm/lib: Makefile
src/external/bsd/llvm/lib/libLLVMAArch64CodeGen: Makefile
src/external/bsd/llvm/lib/libLLVMAArch64MCTargetDesc: Makefile
src/external/bsd/llvm/lib/libLLVMARMCodeGen: Makefile
src/external/bsd/llvm/lib/libLLVMAnalysis: Makefile
src/external/bsd/llvm/lib/libLLVMCodeGen: Makefile
src/external/bsd/llvm/lib/libLLVMDebugInfoCodeView: Makefile
src/external/bsd/llvm/lib/libLLVMDebugInfoDWARF: Makefile
src/external/bsd/llvm/lib/libLLVMDebugInfoMSF: Makefile
src/external/bsd/llvm/lib/libLLVMDebugInfoPDB: Makefile
src/external/bsd/llvm/lib/libLLVMDebugInfoPDBRaw: Makefile
src/external/bsd/llvm/lib/libLLVMGlobalISel: Makefile
src/external/bsd/llvm/lib/libLLVMIR: Makefile
src/external/bsd/llvm/lib/libLLVMInstrumentation: Makefile
src/external/bsd/llvm/lib/libLLVMMC: Makefile
src/external/bsd/llvm/lib/libLLVMMipsCodeGen: Makefile
src/external/bsd/llvm/lib/libLLVMObject: Makefile
src/external/bsd/llvm/lib/libLLVMObjectYAML: Makefile
src/external/bsd/llvm/lib/libLLVMOrc: Makefile
src/external/bsd/llvm/lib/libLLVMPowerPCCodeGen: Makefile
src/external/bsd/llvm/lib/libLLVMScalarOpts: Makefile
src/external/bsd/llvm/lib/libLLVMSelectionDAG: Makefile
src/external/bsd/llvm/lib/libLLVMSupport: Makefile
src/external/bsd/llvm/lib/libLLVMTransformsUtils: Makefile
src/external/bsd/llvm/lib/libLLVMVectorize: Makefile
src/external/bsd/llvm/lib/libLLVMX86CodeGen: Makefile
src/external/bsd/llvm/lib/libLLVMXRay: Makefile
src/external/bsd/llvm/lib/libclangAST: Makefile
src/external/bsd/llvm/lib/libclangBasic: Makefile
src/external/bsd/llvm/lib/libclangCodeGen: Makefile
src/external/bsd/llvm/lib/libclangDriver: Makefile
src/external/bsd/llvm/lib/libclangFormat: Makefile
src/external/bsd/llvm/lib/libclangFrontend: Makefile
src/external/bsd/llvm/lib/libclangStaticAnalyzerCheckers: Makefile
src/external/bsd/llvm/lib/libclangStaticAnalyzerCore: Makefile
Added Files:
src/external/bsd/llvm/bin/clang-rename: Makefile
src/external/bsd/llvm/lib/libLLVMBinaryFormat: Makefile
src/external/bsd/llvm/lib/libLLVMDebugInfoPDBNative: Makefile
src/external/bsd/llvm/lib/libLLVMToolDrivers: Makefile
src/external/bsd/llvm/lib/libclangToolingRefactoring: Makefile
src/tools/llvm-lib/libLLVMBinaryFormat: Makefile

Log Message:
Update LLVM build glue for 5.0RC1.


To generate a diff of this commit:
cvs rdiff -u -r1.1158 -r1.1159 src/distrib/sets/lists/base/mi
cvs rdiff -u -r1.78 -r1.79 src/distrib/sets/lists/comp/ad.arm
cvs rdiff -u -r1.69 -r1.70 

CVS commit: src/doc

2017-08-01 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Tue Aug  1 20:09:43 UTC 2017

Modified Files:
src/doc: 3RDPARTY

Log Message:
Update LLVM entry.


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

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



CVS commit: [LLVM] src/external/bsd/llvm/dist/llvm

2017-08-01 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Tue Aug  1 19:58:42 UTC 2017

Removed Files:
src/external/bsd/llvm/dist/llvm/docs [LLVM]: Dummy.html
src/external/bsd/llvm/dist/llvm/include/llvm/CodeGen [LLVM]:
MachineFunctionInitializer.h
src/external/bsd/llvm/dist/llvm/include/llvm/DebugInfo/CodeView [LLVM]:
CVSymbolTypes.def CVTypeDumper.h ModuleSubstream.h
ModuleSubstreamVisitor.h TypeDatabase.h TypeDatabaseVisitor.h
TypeDumperBase.h TypeRecords.def
src/external/bsd/llvm/dist/llvm/include/llvm/DebugInfo/MSF [LLVM]:
ByteStream.h SequencedItemStream.h StreamArray.h StreamInterface.h
StreamReader.h StreamRef.h StreamWriter.h
src/external/bsd/llvm/dist/llvm/include/llvm/DebugInfo/PDB/Raw [LLVM]:
DbiStream.h DbiStreamBuilder.h EnumTables.h GlobalsStream.h Hash.h
ISectionContribVisitor.h InfoStream.h InfoStreamBuilder.h ModInfo.h
ModStream.h NameHashTable.h NameMap.h NameMapBuilder.h PDBFile.h
PDBFileBuilder.h PublicsStream.h RawConstants.h RawError.h
RawSession.h RawTypes.h SymbolStream.h TpiHashing.h TpiStream.h
TpiStreamBuilder.h
src/external/bsd/llvm/dist/llvm/include/llvm/ExecutionEngine/Orc [LLVM]:
ObjectLinkingLayer.h
src/external/bsd/llvm/dist/llvm/include/llvm/LibDriver [LLVM]:
LibDriver.h
src/external/bsd/llvm/dist/llvm/include/llvm/Object [LLVM]:
ModuleSummaryIndexObjectFile.h
src/external/bsd/llvm/dist/llvm/include/llvm/Support [LLVM]: COFF.h
Dwarf.def Dwarf.h ELF.h MachO.def MachO.h Solaris.h Wasm.h
src/external/bsd/llvm/dist/llvm/include/llvm/Support/ELFRelocs [LLVM]:
AArch64.def AMDGPU.def ARM.def AVR.def BPF.def Hexagon.def
Lanai.def Mips.def PowerPC.def PowerPC64.def RISCV.def Sparc.def
SystemZ.def WebAssembly.def i386.def x86_64.def
src/external/bsd/llvm/dist/llvm/include/llvm/Target [LLVM]:
TargetGlobalISel.td
src/external/bsd/llvm/dist/llvm/include/llvm/Transforms/Utils [LLVM]:
MemorySSA.h
src/external/bsd/llvm/dist/llvm/lib/CodeGen [LLVM]: MIRPrinter.h
src/external/bsd/llvm/dist/llvm/lib/DebugInfo/CodeView [LLVM]:
CVTypeDumper.cpp ModuleSubstream.cpp ModuleSubstreamVisitor.cpp
TypeDatabase.cpp TypeDatabaseVisitor.cpp TypeRecord.cpp
src/external/bsd/llvm/dist/llvm/lib/DebugInfo/MSF [LLVM]:
StreamReader.cpp StreamWriter.cpp
src/external/bsd/llvm/dist/llvm/lib/DebugInfo/PDB/Raw [LLVM]:
DbiStream.cpp DbiStreamBuilder.cpp EnumTables.cpp GSI.cpp GSI.h
GlobalsStream.cpp Hash.cpp InfoStream.cpp InfoStreamBuilder.cpp
ModInfo.cpp ModStream.cpp NameHashTable.cpp NameMap.cpp
NameMapBuilder.cpp PDBFile.cpp PDBFileBuilder.cpp PublicsStream.cpp
RawError.cpp RawSession.cpp SymbolStream.cpp TpiHashing.cpp
TpiStream.cpp TpiStreamBuilder.cpp
src/external/bsd/llvm/dist/llvm/lib/Fuzzer [LLVM]: FuzzerTraceState.cpp
src/external/bsd/llvm/dist/llvm/lib/Fuzzer/test [LLVM]:
UninstrumentedTest.cpp fuzzer-jobs.test
src/external/bsd/llvm/dist/llvm/lib/IR [LLVM]: AttributeSetNode.h
src/external/bsd/llvm/dist/llvm/lib/LibDriver [LLVM]: CMakeLists.txt
LLVMBuild.txt LibDriver.cpp Options.td
src/external/bsd/llvm/dist/llvm/lib/MC [LLVM]: WinCOFFStreamer.cpp
src/external/bsd/llvm/dist/llvm/lib/Object [LLVM]:
ModuleSummaryIndexObjectFile.cpp
src/external/bsd/llvm/dist/llvm/lib/Support [LLVM]: Dwarf.cpp
SearchForAddressOfSpecialSymbol.cpp
src/external/bsd/llvm/dist/llvm/lib/Target/AArch64 [LLVM]:
AArch64AddressTypePromotion.cpp AArch64InstructionSelector.h
AArch64SchedVulcan.td
src/external/bsd/llvm/dist/llvm/lib/Target/AMDGPU [LLVM]:
AMDGPURuntimeMetadata.h SITypeRewriter.cpp
src/external/bsd/llvm/dist/llvm/lib/Target/AMDGPU/MCTargetDesc [LLVM]:
AMDGPURuntimeMD.cpp AMDGPURuntimeMD.h
src/external/bsd/llvm/dist/llvm/lib/Target/ARM [LLVM]:
ARMInstructionSelector.h
src/external/bsd/llvm/dist/llvm/lib/Target/Hexagon [LLVM]:
HexagonCallingConv.td HexagonInstrAlias.td HexagonInstrEnc.td
HexagonInstrInfo.td HexagonInstrInfoV3.td HexagonInstrInfoV4.td
HexagonInstrInfoV5.td HexagonInstrInfoV60.td
HexagonInstrInfoVector.td HexagonIsetDx.td HexagonSystemInst.td
src/external/bsd/llvm/dist/llvm/lib/Target/NVPTX [LLVM]:
NVPTXInferAddressSpaces.cpp
src/external/bsd/llvm/dist/llvm/lib/Target/X86 [LLVM]:
X86InstrTablesInfo.h
src/external/bsd/llvm/dist/llvm/lib/Transforms/Scalar [LLVM]:
LoadCombine.cpp

CVS commit: [LLVM] src/external/bsd/llvm/dist/llvm

2017-08-01 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Tue Aug  1 19:58:42 UTC 2017

Removed Files:
src/external/bsd/llvm/dist/llvm/docs [LLVM]: Dummy.html
src/external/bsd/llvm/dist/llvm/include/llvm/CodeGen [LLVM]:
MachineFunctionInitializer.h
src/external/bsd/llvm/dist/llvm/include/llvm/DebugInfo/CodeView [LLVM]:
CVSymbolTypes.def CVTypeDumper.h ModuleSubstream.h
ModuleSubstreamVisitor.h TypeDatabase.h TypeDatabaseVisitor.h
TypeDumperBase.h TypeRecords.def
src/external/bsd/llvm/dist/llvm/include/llvm/DebugInfo/MSF [LLVM]:
ByteStream.h SequencedItemStream.h StreamArray.h StreamInterface.h
StreamReader.h StreamRef.h StreamWriter.h
src/external/bsd/llvm/dist/llvm/include/llvm/DebugInfo/PDB/Raw [LLVM]:
DbiStream.h DbiStreamBuilder.h EnumTables.h GlobalsStream.h Hash.h
ISectionContribVisitor.h InfoStream.h InfoStreamBuilder.h ModInfo.h
ModStream.h NameHashTable.h NameMap.h NameMapBuilder.h PDBFile.h
PDBFileBuilder.h PublicsStream.h RawConstants.h RawError.h
RawSession.h RawTypes.h SymbolStream.h TpiHashing.h TpiStream.h
TpiStreamBuilder.h
src/external/bsd/llvm/dist/llvm/include/llvm/ExecutionEngine/Orc [LLVM]:
ObjectLinkingLayer.h
src/external/bsd/llvm/dist/llvm/include/llvm/LibDriver [LLVM]:
LibDriver.h
src/external/bsd/llvm/dist/llvm/include/llvm/Object [LLVM]:
ModuleSummaryIndexObjectFile.h
src/external/bsd/llvm/dist/llvm/include/llvm/Support [LLVM]: COFF.h
Dwarf.def Dwarf.h ELF.h MachO.def MachO.h Solaris.h Wasm.h
src/external/bsd/llvm/dist/llvm/include/llvm/Support/ELFRelocs [LLVM]:
AArch64.def AMDGPU.def ARM.def AVR.def BPF.def Hexagon.def
Lanai.def Mips.def PowerPC.def PowerPC64.def RISCV.def Sparc.def
SystemZ.def WebAssembly.def i386.def x86_64.def
src/external/bsd/llvm/dist/llvm/include/llvm/Target [LLVM]:
TargetGlobalISel.td
src/external/bsd/llvm/dist/llvm/include/llvm/Transforms/Utils [LLVM]:
MemorySSA.h
src/external/bsd/llvm/dist/llvm/lib/CodeGen [LLVM]: MIRPrinter.h
src/external/bsd/llvm/dist/llvm/lib/DebugInfo/CodeView [LLVM]:
CVTypeDumper.cpp ModuleSubstream.cpp ModuleSubstreamVisitor.cpp
TypeDatabase.cpp TypeDatabaseVisitor.cpp TypeRecord.cpp
src/external/bsd/llvm/dist/llvm/lib/DebugInfo/MSF [LLVM]:
StreamReader.cpp StreamWriter.cpp
src/external/bsd/llvm/dist/llvm/lib/DebugInfo/PDB/Raw [LLVM]:
DbiStream.cpp DbiStreamBuilder.cpp EnumTables.cpp GSI.cpp GSI.h
GlobalsStream.cpp Hash.cpp InfoStream.cpp InfoStreamBuilder.cpp
ModInfo.cpp ModStream.cpp NameHashTable.cpp NameMap.cpp
NameMapBuilder.cpp PDBFile.cpp PDBFileBuilder.cpp PublicsStream.cpp
RawError.cpp RawSession.cpp SymbolStream.cpp TpiHashing.cpp
TpiStream.cpp TpiStreamBuilder.cpp
src/external/bsd/llvm/dist/llvm/lib/Fuzzer [LLVM]: FuzzerTraceState.cpp
src/external/bsd/llvm/dist/llvm/lib/Fuzzer/test [LLVM]:
UninstrumentedTest.cpp fuzzer-jobs.test
src/external/bsd/llvm/dist/llvm/lib/IR [LLVM]: AttributeSetNode.h
src/external/bsd/llvm/dist/llvm/lib/LibDriver [LLVM]: CMakeLists.txt
LLVMBuild.txt LibDriver.cpp Options.td
src/external/bsd/llvm/dist/llvm/lib/MC [LLVM]: WinCOFFStreamer.cpp
src/external/bsd/llvm/dist/llvm/lib/Object [LLVM]:
ModuleSummaryIndexObjectFile.cpp
src/external/bsd/llvm/dist/llvm/lib/Support [LLVM]: Dwarf.cpp
SearchForAddressOfSpecialSymbol.cpp
src/external/bsd/llvm/dist/llvm/lib/Target/AArch64 [LLVM]:
AArch64AddressTypePromotion.cpp AArch64InstructionSelector.h
AArch64SchedVulcan.td
src/external/bsd/llvm/dist/llvm/lib/Target/AMDGPU [LLVM]:
AMDGPURuntimeMetadata.h SITypeRewriter.cpp
src/external/bsd/llvm/dist/llvm/lib/Target/AMDGPU/MCTargetDesc [LLVM]:
AMDGPURuntimeMD.cpp AMDGPURuntimeMD.h
src/external/bsd/llvm/dist/llvm/lib/Target/ARM [LLVM]:
ARMInstructionSelector.h
src/external/bsd/llvm/dist/llvm/lib/Target/Hexagon [LLVM]:
HexagonCallingConv.td HexagonInstrAlias.td HexagonInstrEnc.td
HexagonInstrInfo.td HexagonInstrInfoV3.td HexagonInstrInfoV4.td
HexagonInstrInfoV5.td HexagonInstrInfoV60.td
HexagonInstrInfoVector.td HexagonIsetDx.td HexagonSystemInst.td
src/external/bsd/llvm/dist/llvm/lib/Target/NVPTX [LLVM]:
NVPTXInferAddressSpaces.cpp
src/external/bsd/llvm/dist/llvm/lib/Target/X86 [LLVM]:
X86InstrTablesInfo.h
src/external/bsd/llvm/dist/llvm/lib/Transforms/Scalar [LLVM]:
LoadCombine.cpp

Re: CVS import: src/external/bsd/llvm/dist/llvm

2017-08-01 Thread Joerg Sonnenberger
On Tue, Aug 01, 2017 at 10:36:09AM +, Joerg Sonnenberger wrote:
> Module Name:  src
> Committed By: joerg
> Date: Tue Aug  1 10:36:09 UTC 2017
> 
> Update of /cvsroot/src/external/bsd/llvm/dist/llvm
> In directory ivanova.netbsd.org:/tmp/cvs-serv21315
> 
> Log Message:
> Import Clang 5.0rc1 r309604.

So this one obviously went into the wrong directory. I've asked Petra to
restore the files from the last backup and recommitted both the LLVM and
clang import, now in the correct location. Sorry about that.

Joerg


CVS commit: [perseant-stdc-iso10646] src/lib/libc/locale

2017-08-01 Thread Konrad Schroder
Module Name:src
Committed By:   perseant
Date:   Tue Aug  1 19:35:51 UTC 2017

Added Files:
src/lib/libc/locale [perseant-stdc-iso10646]: collate.h
ducet_collation_data.h unicode_dm_data.h

Log Message:
Add files missing from last commit (commitid: 7B1ZL3FMi0tUSk1A):

Support loading collation data from file.  Began with FreeBSD's
xlocale_collate, but had to change it somewhat to accommodate the
requirements of the Unicode Collation Algorithm (in particular,
there are maps from single-character collation elements to
multiple collation weight vectors, and multiple-to-multiple
mappings as well).


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1.40.1 src/lib/libc/locale/collate.h
cvs rdiff -u -r0 -r1.1.2.1 src/lib/libc/locale/ducet_collation_data.h \
src/lib/libc/locale/unicode_dm_data.h

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

diffs are larger than 1MB and have been omitted


CVS commit: [perseant-stdc-iso10646] src/lib/libc/locale

2017-08-01 Thread Konrad Schroder
Module Name:src
Committed By:   perseant
Date:   Tue Aug  1 19:35:51 UTC 2017

Added Files:
src/lib/libc/locale [perseant-stdc-iso10646]: collate.h
ducet_collation_data.h unicode_dm_data.h

Log Message:
Add files missing from last commit (commitid: 7B1ZL3FMi0tUSk1A):

Support loading collation data from file.  Began with FreeBSD's
xlocale_collate, but had to change it somewhat to accommodate the
requirements of the Unicode Collation Algorithm (in particular,
there are maps from single-character collation elements to
multiple collation weight vectors, and multiple-to-multiple
mappings as well).


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1.40.1 src/lib/libc/locale/collate.h
cvs rdiff -u -r0 -r1.1.2.1 src/lib/libc/locale/ducet_collation_data.h \
src/lib/libc/locale/unicode_dm_data.h

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



CVS commit: src/external/bsd/libc++/dist/libcxxrt/src

2017-08-01 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Tue Aug  1 18:08:49 UTC 2017

Modified Files:
src/external/bsd/libc++/dist/libcxxrt/src: libelftc_dem_gnu3.c

Log Message:
Inline storage size in one place to avoid depending on DCE for removing
the USE_FORT=yes warning.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.3 -r1.2 \
src/external/bsd/libc++/dist/libcxxrt/src/libelftc_dem_gnu3.c

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



CVS commit: src/external/bsd/libc++/dist/libcxxrt/src

2017-08-01 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Tue Aug  1 18:08:49 UTC 2017

Modified Files:
src/external/bsd/libc++/dist/libcxxrt/src: libelftc_dem_gnu3.c

Log Message:
Inline storage size in one place to avoid depending on DCE for removing
the USE_FORT=yes warning.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.3 -r1.2 \
src/external/bsd/libc++/dist/libcxxrt/src/libelftc_dem_gnu3.c

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

Modified files:

Index: src/external/bsd/libc++/dist/libcxxrt/src/libelftc_dem_gnu3.c
diff -u src/external/bsd/libc++/dist/libcxxrt/src/libelftc_dem_gnu3.c:1.1.1.3 src/external/bsd/libc++/dist/libcxxrt/src/libelftc_dem_gnu3.c:1.2
--- src/external/bsd/libc++/dist/libcxxrt/src/libelftc_dem_gnu3.c:1.1.1.3	Fri Sep 11 11:19:59 2015
+++ src/external/bsd/libc++/dist/libcxxrt/src/libelftc_dem_gnu3.c	Tue Aug  1 18:08:48 2017
@@ -3624,7 +3624,7 @@ decode_fp_to_float80(const char *p, size
 #endif /* ELFTC_BYTE_ORDER == ELFTC_BYTE_ORDER_LITTLE_ENDIAN */
 		}
 
-		memset(, 0, FLOAT_QUADRUPLE_BYTES);
+		memset(, 0, sizeof(f));
 
 #if ELFTC_BYTE_ORDER == ELFTC_BYTE_ORDER_LITTLE_ENDIAN
 		memcpy(, buf, FLOAT_EXTENED_BYTES);



Re: CVS commit: src

2017-08-01 Thread coypu
On Tue, Aug 01, 2017 at 06:28:39PM +0200, Joerg Sonnenberger wrote:
> Correct, do not remove obsolete entries from the set files without a
> very good reason. This one is plain wrong.

Thanks, I reverted that part.


Re: CVS commit: src

2017-08-01 Thread Martin Husemann
On Tue, Aug 01, 2017 at 07:13:22PM +0200, Maxime Villard wrote:
> Mmh, didn't know that. What is the policy to remove entries then? For
> a release old enough? Several svr4_machdep.h entries have been in the other
> md.* files for years.

Never remove obsolete entries unless you added them eroneously (i.e. the
file is actually still installed but accidently marked as obsolete).

The obsolete entries are used to remove files no longer needed on system
updates. We do not expect users to update to every major release, so
if, say, someone updates from NetBSD 0.9 to NetBSD 8, the file should
still be removed.

Martin


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

2017-08-01 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Tue Aug  1 17:04:06 UTC 2017

Modified Files:
src/distrib/sets/lists/modules: md.i386

Log Message:
Mark the compat_svr4 module obsolete.

hopefully fixes the build, this is a blind commit.


To generate a diff of this commit:
cvs rdiff -u -r1.73 -r1.74 src/distrib/sets/lists/modules/md.i386

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/modules/md.i386
diff -u src/distrib/sets/lists/modules/md.i386:1.73 src/distrib/sets/lists/modules/md.i386:1.74
--- src/distrib/sets/lists/modules/md.i386:1.73	Thu Dec 15 12:56:52 2016
+++ src/distrib/sets/lists/modules/md.i386	Tue Aug  1 17:04:06 2017
@@ -1,4 +1,4 @@
-# $NetBSD: md.i386,v 1.73 2016/12/15 12:56:52 kre Exp $
+# $NetBSD: md.i386,v 1.74 2017/08/01 17:04:06 maya Exp $
 #
 # NOTE that there are three sets of files here:
 # @MODULEDIR@, i386-xen, and i386pae-xen
@@ -56,8 +56,8 @@
 ./@MODULEDIR@/compat_ibcs2/compat_ibcs2.kmod	base-kernel-modules	kmod
 ./@MODULEDIR@/compat_linux			base-kernel-modules	kmod
 ./@MODULEDIR@/compat_linux/compat_linux.kmod	base-kernel-modules	kmod
-./@MODULEDIR@/compat_svr4			base-kernel-modules	kmod
-./@MODULEDIR@/compat_svr4/compat_svr4.kmod	base-kernel-modules	kmod
+./@MODULEDIR@/compat_svr4			base-obsolete		obsolete
+./@MODULEDIR@/compat_svr4/compat_svr4.kmod	base-obsolete		obsolete
 ./@MODULEDIR@/corambase-kernel-modules	kmod
 ./@MODULEDIR@/coram/coram.kmod			base-kernel-modules	kmod
 ./@MODULEDIR@/coretempbase-kernel-modules	kmod



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

2017-08-01 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Tue Aug  1 17:04:06 UTC 2017

Modified Files:
src/distrib/sets/lists/modules: md.i386

Log Message:
Mark the compat_svr4 module obsolete.

hopefully fixes the build, this is a blind commit.


To generate a diff of this commit:
cvs rdiff -u -r1.73 -r1.74 src/distrib/sets/lists/modules/md.i386

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



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

2017-08-01 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Tue Aug  1 16:54:19 UTC 2017

Modified Files:
src/distrib/sets/lists/comp: md.amd64 md.i386

Log Message:
Restore marking ./usr/include/i386/svr4_machdep.h obsolete
instead of removing

(so it can be removed by postinstall)


To generate a diff of this commit:
cvs rdiff -u -r1.245 -r1.246 src/distrib/sets/lists/comp/md.amd64
cvs rdiff -u -r1.169 -r1.170 src/distrib/sets/lists/comp/md.i386

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/md.amd64
diff -u src/distrib/sets/lists/comp/md.amd64:1.245 src/distrib/sets/lists/comp/md.amd64:1.246
--- src/distrib/sets/lists/comp/md.amd64:1.245	Tue Aug  1 13:57:03 2017
+++ src/distrib/sets/lists/comp/md.amd64	Tue Aug  1 16:54:19 2017
@@ -1,4 +1,4 @@
-# $NetBSD: md.amd64,v 1.245 2017/08/01 13:57:03 maxv Exp $
+# $NetBSD: md.amd64,v 1.246 2017/08/01 16:54:19 maya Exp $
 
 ./usr/include/amd64comp-c-include
 ./usr/include/amd64/ansi.h			comp-c-include
@@ -468,6 +468,7 @@
 ./usr/include/i386/specialreg.h			comp-c-include
 ./usr/include/i386/spkr.h			comp-c-include
 ./usr/include/i386/stdarg.h			comp-obsolete		obsolete
+./usr/include/i386/svr4_machdep.h		comp-obsolete		obsolete
 ./usr/include/i386/sysarch.h			comp-c-include
 ./usr/include/i386/trap.h			comp-c-include
 ./usr/include/i386/tss.h			comp-c-include

Index: src/distrib/sets/lists/comp/md.i386
diff -u src/distrib/sets/lists/comp/md.i386:1.169 src/distrib/sets/lists/comp/md.i386:1.170
--- src/distrib/sets/lists/comp/md.i386:1.169	Tue Aug  1 13:57:03 2017
+++ src/distrib/sets/lists/comp/md.i386	Tue Aug  1 16:54:19 2017
@@ -1,4 +1,4 @@
-# $NetBSD: md.i386,v 1.169 2017/08/01 13:57:03 maxv Exp $
+# $NetBSD: md.i386,v 1.170 2017/08/01 16:54:19 maya Exp $
 ./usr/include/clang-3.4/__wmmintrin_aes.h	comp-obsolete		obsolete
 ./usr/include/clang-3.4/__wmmintrin_pclmul.h	comp-obsolete		obsolete
 ./usr/include/clang-3.4/ammintrin.h		comp-obsolete		obsolete
@@ -400,6 +400,7 @@
 ./usr/include/i386/specialreg.h			comp-c-include
 ./usr/include/i386/spkr.h			comp-c-include
 ./usr/include/i386/stdarg.h			comp-obsolete		obsolete
+./usr/include/i386/svr4_machdep.h		comp-obsolete		obsolete
 ./usr/include/i386/sysarch.h			comp-c-include
 ./usr/include/i386/trap.h			comp-c-include
 ./usr/include/i386/tss.h			comp-c-include



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

2017-08-01 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Tue Aug  1 16:54:19 UTC 2017

Modified Files:
src/distrib/sets/lists/comp: md.amd64 md.i386

Log Message:
Restore marking ./usr/include/i386/svr4_machdep.h obsolete
instead of removing

(so it can be removed by postinstall)


To generate a diff of this commit:
cvs rdiff -u -r1.245 -r1.246 src/distrib/sets/lists/comp/md.amd64
cvs rdiff -u -r1.169 -r1.170 src/distrib/sets/lists/comp/md.i386

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



CVS commit: src/doc

2017-08-01 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Tue Aug  1 16:44:19 UTC 2017

Modified Files:
src/doc: 3RDPARTY

Log Message:
mandoc-1.14.2 out.


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

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



CVS commit: src/doc

2017-08-01 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Tue Aug  1 16:44:19 UTC 2017

Modified Files:
src/doc: 3RDPARTY

Log Message:
mandoc-1.14.2 out.


To generate a diff of this commit:
cvs rdiff -u -r1.1461 -r1.1462 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.1461 src/doc/3RDPARTY:1.1462
--- src/doc/3RDPARTY:1.1461	Sat Jul 29 23:10:36 2017
+++ src/doc/3RDPARTY	Tue Aug  1 16:44:19 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.1461 2017/07/29 23:10:36 jmcneill Exp $
+#	$NetBSD: 3RDPARTY,v 1.1462 2017/08/01 16:44:19 wiz Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -859,9 +859,9 @@ Responsible:	tsarna
 Location:	external/apache2/mDNSResponder/dist
 Notes:
 
-Package:	mdocml
+Package:	mandoc
 Version:	1.14.1
-Current Vers:	1.14.1
+Current Vers:	1.14.2
 Maintainer:	Kristaps Džonsons
 Archive Site:	http://mdocml.bsd.lv/snapshots/
 Home Page:	http://mdocml.bsd.lv/



Re: CVS commit: src

2017-08-01 Thread coypu
On Tue, Aug 01, 2017 at 01:57:03PM +, Maxime Villard wrote:
> Module Name:  src
> Committed By: maxv
> Date: Tue Aug  1 13:57:03 UTC 2017
> 
> Modified Files:
>   src/distrib/sets/lists/comp: md.amd64 md.i386
> Removed Files:
>   src/sys/arch/i386/include: svr4_machdep.h
> 
> Log Message:
> Remove svr4_machdep.h right away, no one should include it.

I think obsolete means it will be removed by postinstall if asked to
remove obsolete files


CVS commit: src/usr.sbin/makemandb

2017-08-01 Thread Abhinav Upadhyay
Module Name:src
Committed By:   abhinav
Date:   Tue Aug  1 16:16:32 UTC 2017

Modified Files:
src/usr.sbin/makemandb: apropos-utils.c

Log Message:
Don't use the custom tokenizer when compiled with debugging on

Using the custom tokenizer means one cannot interactively query the database
through the SQLite shell, thus thwarting the purpose of the debug build option.

Thanks to leot@ for reporting it.

(While there change the debug macro from DEBUG to APROPOS_DEBUG)


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/usr.sbin/makemandb/apropos-utils.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.sbin/makemandb/apropos-utils.c
diff -u src/usr.sbin/makemandb/apropos-utils.c:1.38 src/usr.sbin/makemandb/apropos-utils.c:1.39
--- src/usr.sbin/makemandb/apropos-utils.c:1.38	Sun Jun 18 16:24:10 2017
+++ src/usr.sbin/makemandb/apropos-utils.c	Tue Aug  1 16:16:32 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: apropos-utils.c,v 1.38 2017/06/18 16:24:10 abhinav Exp $	*/
+/*	$NetBSD: apropos-utils.c,v 1.39 2017/08/01 16:16:32 abhinav Exp $	*/
 /*-
  * Copyright (c) 2011 Abhinav Upadhyay 
  * All rights reserved.
@@ -31,7 +31,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: apropos-utils.c,v 1.38 2017/06/18 16:24:10 abhinav Exp $");
+__RCSID("$NetBSD: apropos-utils.c,v 1.39 2017/08/01 16:16:32 abhinav Exp $");
 
 #include 
 #include 
@@ -81,6 +81,7 @@ static const double col_weights[] = {
 	1.00	//machine
 };
 
+#ifndef APROPOS_DEBUG
 static int
 register_tokenizer(sqlite3 *db)
 {
@@ -102,6 +103,7 @@ register_tokenizer(sqlite3 *db)
 
 	return sqlite3_finalize(stmt);
 }
+#endif
 
 /*
  * lower --
@@ -201,10 +203,12 @@ create_db(sqlite3 *db)
 	"CREATE VIRTUAL TABLE mandb USING fts4(section, name, "
 		"name_desc, desc, lib, return_vals, env, files, "
 		"exit_status, diagnostics, errors, md5_hash UNIQUE, machine, "
-#ifndef DEBUG		
-		"compress=zip, uncompress=unzip, "
+#ifndef APROPOS_DEBUG		
+		"compress=zip, uncompress=unzip, tokenize=custom_apropos_tokenizer, "
+#else
+		"tokenize=porter, "
 #endif		
-		"tokenize=custom_apropos_tokenizer, notindexed=section, notindexed=md5_hash); "
+		"notindexed=section, notindexed=md5_hash); "
 	//mandb_meta
 	"CREATE TABLE IF NOT EXISTS mandb_meta(device, inode, mtime, "
 		"file UNIQUE, md5_hash UNIQUE, id  INTEGER PRIMARY KEY); "
@@ -391,11 +395,13 @@ init_db(mandb_access_mode db_flag, const
 
 	sqlite3_extended_result_codes(db, 1);
 
+#ifndef APROPOS_DEBUG
 	rc = register_tokenizer(db);
 	if (rc != SQLITE_OK) {
 		warnx("Unable to register custom tokenizer: %s", sqlite3_errmsg(db));
 		goto error;
 	}
+#endif
 
 	if (create_db_flag && create_db(db) < 0) {
 		warnx("%s", "Unable to create database schema");



CVS commit: src/usr.sbin/makemandb

2017-08-01 Thread Abhinav Upadhyay
Module Name:src
Committed By:   abhinav
Date:   Tue Aug  1 16:16:32 UTC 2017

Modified Files:
src/usr.sbin/makemandb: apropos-utils.c

Log Message:
Don't use the custom tokenizer when compiled with debugging on

Using the custom tokenizer means one cannot interactively query the database
through the SQLite shell, thus thwarting the purpose of the debug build option.

Thanks to leot@ for reporting it.

(While there change the debug macro from DEBUG to APROPOS_DEBUG)


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/usr.sbin/makemandb/apropos-utils.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/conf

2017-08-01 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Tue Aug  1 16:12:33 UTC 2017

Modified Files:
src/sys/arch/evbmips/conf: CPMBR1400 LINKITSMART7688 ZYXELKX

Log Message:
Wrong architecture for IBCS2 compat! it's stringly an x86 thing.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/evbmips/conf/CPMBR1400
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/evbmips/conf/LINKITSMART7688
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/evbmips/conf/ZYXELKX

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

2017-08-01 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Tue Aug  1 16:12:33 UTC 2017

Modified Files:
src/sys/arch/evbmips/conf: CPMBR1400 LINKITSMART7688 ZYXELKX

Log Message:
Wrong architecture for IBCS2 compat! it's stringly an x86 thing.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/evbmips/conf/CPMBR1400
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/evbmips/conf/LINKITSMART7688
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/evbmips/conf/ZYXELKX

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/conf/CPMBR1400
diff -u src/sys/arch/evbmips/conf/CPMBR1400:1.24 src/sys/arch/evbmips/conf/CPMBR1400:1.25
--- src/sys/arch/evbmips/conf/CPMBR1400:1.24	Tue Aug  1 14:23:42 2017
+++ src/sys/arch/evbmips/conf/CPMBR1400	Tue Aug  1 16:12:32 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: CPMBR1400,v 1.24 2017/08/01 14:23:42 maxv Exp $
+#	$NetBSD: CPMBR1400,v 1.25 2017/08/01 16:12:32 maya Exp $
 
 include		"arch/evbmips/conf/std.rasoc"
 
@@ -77,7 +77,6 @@ options 	COMPAT_70	# NetBSD 7.0 binary c
 #options 	COMPAT_386BSD_MBRPART # recognize old partition ID
 
 #options 	COMPAT_SVR4	# binary compatibility with SVR4
-#options 	COMPAT_IBCS2	# binary compatibility with SCO and ISC
 #options 	COMPAT_LINUX	# binary compatibility with Linux
 #options 	COMPAT_BSDPTY	# /dev/[pt]ty?? ptys.
 

Index: src/sys/arch/evbmips/conf/LINKITSMART7688
diff -u src/sys/arch/evbmips/conf/LINKITSMART7688:1.4 src/sys/arch/evbmips/conf/LINKITSMART7688:1.5
--- src/sys/arch/evbmips/conf/LINKITSMART7688:1.4	Tue Aug  1 14:23:42 2017
+++ src/sys/arch/evbmips/conf/LINKITSMART7688	Tue Aug  1 16:12:32 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: LINKITSMART7688,v 1.4 2017/08/01 14:23:42 maxv Exp $
+#	$NetBSD: LINKITSMART7688,v 1.5 2017/08/01 16:12:32 maya Exp $
 #
 # MediaTek MT7688
 #
@@ -77,7 +77,6 @@ options 	COMPAT_70	# NetBSD 7.0 binary c
 #options 	COMPAT_386BSD_MBRPART # recognize old partition ID
 
 #options 	COMPAT_SVR4	# binary compatibility with SVR4
-#options 	COMPAT_IBCS2	# binary compatibility with SCO and ISC
 #options 	COMPAT_LINUX	# binary compatibility with Linux
 #options 	COMPAT_BSDPTY	# /dev/[pt]ty?? ptys.
 

Index: src/sys/arch/evbmips/conf/ZYXELKX
diff -u src/sys/arch/evbmips/conf/ZYXELKX:1.9 src/sys/arch/evbmips/conf/ZYXELKX:1.10
--- src/sys/arch/evbmips/conf/ZYXELKX:1.9	Tue Aug  1 14:23:42 2017
+++ src/sys/arch/evbmips/conf/ZYXELKX	Tue Aug  1 16:12:32 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: ZYXELKX,v 1.9 2017/08/01 14:23:42 maxv Exp $
+#	$NetBSD: ZYXELKX,v 1.10 2017/08/01 16:12:32 maya Exp $
 
 include		"arch/evbmips/conf/std.rasoc"
 
@@ -73,7 +73,6 @@ options 	COMPAT_70	# NetBSD 7.0 binary c
 #options 	COMPAT_386BSD_MBRPART # recognize old partition ID
 
 #options 	COMPAT_SVR4	# binary compatibility with SVR4
-#options 	COMPAT_IBCS2	# binary compatibility with SCO and ISC
 #options 	COMPAT_LINUX	# binary compatibility with Linux
 #options 	COMPAT_BSDPTY	# /dev/[pt]ty?? ptys.
 



CVS commit: src/sys

2017-08-01 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Tue Aug  1 14:43:54 UTC 2017

Modified Files:
src/sys/arch/i386/conf: files.i386
src/sys/arch/xen/conf: files.xen
src/sys/compat/freebsd: files.freebsd
src/sys/modules/compat_freebsd: Makefile
Added Files:
src/sys/compat/freebsd: freebsd_machdep.c freebsd_sigcode.S
freebsd_syscall.c
Removed Files:
src/sys/arch/i386/i386: freebsd_machdep.c freebsd_sigcode.S
freebsd_syscall.c

Log Message:
Move arch/i386/i386/freebsd_* into compat/freebsd/. COMPAT_FREEBSD is
i386-specific.


To generate a diff of this commit:
cvs rdiff -u -r1.382 -r1.383 src/sys/arch/i386/conf/files.i386
cvs rdiff -u -r1.60 -r0 src/sys/arch/i386/i386/freebsd_machdep.c
cvs rdiff -u -r1.5 -r0 src/sys/arch/i386/i386/freebsd_sigcode.S
cvs rdiff -u -r1.40 -r0 src/sys/arch/i386/i386/freebsd_syscall.c
cvs rdiff -u -r1.151 -r1.152 src/sys/arch/xen/conf/files.xen
cvs rdiff -u -r1.14 -r1.15 src/sys/compat/freebsd/files.freebsd
cvs rdiff -u -r0 -r1.1 src/sys/compat/freebsd/freebsd_machdep.c \
src/sys/compat/freebsd/freebsd_sigcode.S \
src/sys/compat/freebsd/freebsd_syscall.c
cvs rdiff -u -r1.4 -r1.5 src/sys/modules/compat_freebsd/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/arch/i386/conf/files.i386
diff -u src/sys/arch/i386/conf/files.i386:1.382 src/sys/arch/i386/conf/files.i386:1.383
--- src/sys/arch/i386/conf/files.i386:1.382	Tue Aug  1 13:47:49 2017
+++ src/sys/arch/i386/conf/files.i386	Tue Aug  1 14:43:54 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: files.i386,v 1.382 2017/08/01 13:47:49 maxv Exp $
+#	$NetBSD: files.i386,v 1.383 2017/08/01 14:43:54 maxv Exp $
 #
 # new style config file for i386 architecture
 #
@@ -340,9 +340,6 @@ file	arch/x86/x86/linux_trap.c		compat_l
 
 # FreeBSD binary compatibility (COMPAT_FREEBSD)
 include	"compat/freebsd/files.freebsd"
-file	arch/i386/i386/freebsd_machdep.c	compat_freebsd
-file	arch/i386/i386/freebsd_sigcode.S	compat_freebsd
-file	arch/i386/i386/freebsd_syscall.c	compat_freebsd
 
 # NDIS compatibilty (COMPAT_NDIS)
 include "compat/ndis/files.ndis"

Index: src/sys/arch/xen/conf/files.xen
diff -u src/sys/arch/xen/conf/files.xen:1.151 src/sys/arch/xen/conf/files.xen:1.152
--- src/sys/arch/xen/conf/files.xen:1.151	Tue Aug  1 13:47:49 2017
+++ src/sys/arch/xen/conf/files.xen	Tue Aug  1 14:43:54 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: files.xen,v 1.151 2017/08/01 13:47:49 maxv Exp $
+#	$NetBSD: files.xen,v 1.152 2017/08/01 14:43:54 maxv Exp $
 #	NetBSD: files.x86,v 1.10 2003/10/08 17:30:00 bouyer Exp 
 #	NetBSD: files.i386,v 1.254 2004/03/25 23:32:10 jmc Exp 
 
@@ -334,9 +334,6 @@ file	arch/x86/x86/linux_trap.c		compat_l
 
 # FreeBSD binary compatibility (COMPAT_FREEBSD)
 include	"compat/freebsd/files.freebsd"
-file	arch/i386/i386/freebsd_machdep.c	compat_freebsd
-file	arch/i386/i386/freebsd_sigcode.S	compat_freebsd
-file	arch/i386/i386/freebsd_syscall.c	compat_freebsd
 
 elifdef amd64
 

Index: src/sys/compat/freebsd/files.freebsd
diff -u src/sys/compat/freebsd/files.freebsd:1.14 src/sys/compat/freebsd/files.freebsd:1.15
--- src/sys/compat/freebsd/files.freebsd:1.14	Sat Jul 29 10:39:48 2017
+++ src/sys/compat/freebsd/files.freebsd	Tue Aug  1 14:43:54 2017
@@ -1,10 +1,7 @@
-#	$NetBSD: files.freebsd,v 1.14 2017/07/29 10:39:48 maxv Exp $
+#	$NetBSD: files.freebsd,v 1.15 2017/08/01 14:43:54 maxv Exp $
 #
 # Config file description for machine-independent FreeBSD compat code.
-# Included by ports that need it.
-
-# ports should define any machine-specific files they need in their
-# own file lists.
+# Included by ports that need it. Only i386 is supported.
 
 define	compat_freebsd
 file	compat/freebsd/freebsd_exec.c		compat_freebsd
@@ -13,10 +10,14 @@ file	compat/freebsd/freebsd_file.c		comp
 file	compat/freebsd/freebsd_fork.c		compat_freebsd
 file	compat/freebsd/freebsd_ioctl.c		compat_freebsd
 file	compat/freebsd/freebsd_ipc.c		compat_freebsd
+file	compat/freebsd/freebsd_machdep.c	compat_freebsd
 file	compat/freebsd/freebsd_misc.c		compat_freebsd
 file	compat/freebsd/freebsd_mod.c		compat_freebsd
 file	compat/freebsd/freebsd_ptrace.c		compat_freebsd & ptrace
 file	compat/freebsd/freebsd_sched.c		compat_freebsd
+file	compat/freebsd/freebsd_sigcode.S	compat_freebsd
 file	compat/freebsd/freebsd_sysctl.c		compat_freebsd
 file	compat/freebsd/freebsd_sysent.c		compat_freebsd
 file	compat/freebsd/freebsd_syscalls.c	compat_freebsd
+file	compat/freebsd/freebsd_syscall.c	compat_freebsd
+

Index: src/sys/modules/compat_freebsd/Makefile
diff -u src/sys/modules/compat_freebsd/Makefile:1.4 src/sys/modules/compat_freebsd/Makefile:1.5
--- src/sys/modules/compat_freebsd/Makefile:1.4	Sat Jul 29 10:39:48 2017
+++ src/sys/modules/compat_freebsd/Makefile	Tue Aug  1 14:43:54 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.4 2017/07/29 10:39:48 maxv Exp $
+#	$NetBSD: Makefile,v 1.5 2017/08/01 14:43:54 maxv Exp $
 
 

CVS commit: src/sys

2017-08-01 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Tue Aug  1 14:43:54 UTC 2017

Modified Files:
src/sys/arch/i386/conf: files.i386
src/sys/arch/xen/conf: files.xen
src/sys/compat/freebsd: files.freebsd
src/sys/modules/compat_freebsd: Makefile
Added Files:
src/sys/compat/freebsd: freebsd_machdep.c freebsd_sigcode.S
freebsd_syscall.c
Removed Files:
src/sys/arch/i386/i386: freebsd_machdep.c freebsd_sigcode.S
freebsd_syscall.c

Log Message:
Move arch/i386/i386/freebsd_* into compat/freebsd/. COMPAT_FREEBSD is
i386-specific.


To generate a diff of this commit:
cvs rdiff -u -r1.382 -r1.383 src/sys/arch/i386/conf/files.i386
cvs rdiff -u -r1.60 -r0 src/sys/arch/i386/i386/freebsd_machdep.c
cvs rdiff -u -r1.5 -r0 src/sys/arch/i386/i386/freebsd_sigcode.S
cvs rdiff -u -r1.40 -r0 src/sys/arch/i386/i386/freebsd_syscall.c
cvs rdiff -u -r1.151 -r1.152 src/sys/arch/xen/conf/files.xen
cvs rdiff -u -r1.14 -r1.15 src/sys/compat/freebsd/files.freebsd
cvs rdiff -u -r0 -r1.1 src/sys/compat/freebsd/freebsd_machdep.c \
src/sys/compat/freebsd/freebsd_sigcode.S \
src/sys/compat/freebsd/freebsd_syscall.c
cvs rdiff -u -r1.4 -r1.5 src/sys/modules/compat_freebsd/Makefile

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



CVS commit: src/sys/arch

2017-08-01 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Tue Aug  1 14:23:42 UTC 2017

Modified Files:
src/sys/arch/evbarm/conf: MMNET_GENERIC MPCSA_GENERIC
src/sys/arch/evbmips/conf: CPMBR1400 LINKITSMART7688 ZYXELKX
src/sys/arch/ia64/ia64: genassym.cf

Log Message:
Remove references to compat_freebsd when it is not supported.


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/sys/arch/evbarm/conf/MMNET_GENERIC
cvs rdiff -u -r1.50 -r1.51 src/sys/arch/evbarm/conf/MPCSA_GENERIC
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/evbmips/conf/CPMBR1400
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/evbmips/conf/LINKITSMART7688
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/evbmips/conf/ZYXELKX
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/ia64/ia64/genassym.cf

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/evbarm/conf/MMNET_GENERIC
diff -u src/sys/arch/evbarm/conf/MMNET_GENERIC:1.29 src/sys/arch/evbarm/conf/MMNET_GENERIC:1.30
--- src/sys/arch/evbarm/conf/MMNET_GENERIC:1.29	Tue Aug  1 13:02:37 2017
+++ src/sys/arch/evbarm/conf/MMNET_GENERIC	Tue Aug  1 14:23:42 2017
@@ -1,4 +1,4 @@
-# $NetBSD: MMNET_GENERIC,v 1.29 2017/08/01 13:02:37 riastradh Exp $
+# $NetBSD: MMNET_GENERIC,v 1.30 2017/08/01 14:23:42 maxv Exp $
 #
 # GENERIC machine description file
 #
@@ -22,7 +22,7 @@ include		"arch/evbarm/conf/std.mmnet"
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		"GENERIC-$Revision: 1.29 $"
+#ident 		"GENERIC-$Revision: 1.30 $"
 
 maxusers	32		# estimated number of users
 
@@ -112,7 +112,6 @@ options 	COMPAT_43	# 4.3BSD, 386BSD, and
 #options 	COMPAT_SVR4	# binary compatibility with SVR4
 #options 	COMPAT_IBCS2	# binary compatibility with SCO and ISC
 #options 	COMPAT_LINUX	# binary compatibility with Linux
-#options 	COMPAT_FREEBSD	# binary compatibility with FreeBSD
 #options 	COMPAT_NDIS	# NDIS network driver
 options 	COMPAT_BSDPTY	# /dev/[pt]ty?? ptys.
 

Index: src/sys/arch/evbarm/conf/MPCSA_GENERIC
diff -u src/sys/arch/evbarm/conf/MPCSA_GENERIC:1.50 src/sys/arch/evbarm/conf/MPCSA_GENERIC:1.51
--- src/sys/arch/evbarm/conf/MPCSA_GENERIC:1.50	Sat Jul 29 18:08:57 2017
+++ src/sys/arch/evbarm/conf/MPCSA_GENERIC	Tue Aug  1 14:23:42 2017
@@ -1,4 +1,4 @@
-# $NetBSD: MPCSA_GENERIC,v 1.50 2017/07/29 18:08:57 maxv Exp $
+# $NetBSD: MPCSA_GENERIC,v 1.51 2017/08/01 14:23:42 maxv Exp $
 #
 # GENERIC machine description file
 #
@@ -22,7 +22,7 @@ include		"arch/evbarm/conf/std.mpcsa"
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		"GENERIC-$Revision: 1.50 $"
+#ident 		"GENERIC-$Revision: 1.51 $"
 
 maxusers	32		# estimated number of users
 
@@ -112,7 +112,6 @@ options 	COMPAT_43	# 4.3BSD, 386BSD, and
 #options 	COMPAT_SVR4	# binary compatibility with SVR4
 #options 	COMPAT_IBCS2	# binary compatibility with SCO and ISC
 #options 	COMPAT_LINUX	# binary compatibility with Linux
-#options 	COMPAT_FREEBSD	# binary compatibility with FreeBSD
 #options 	COMPAT_NDIS	# NDIS network driver
 options 	COMPAT_BSDPTY	# /dev/[pt]ty?? ptys.
 

Index: src/sys/arch/evbmips/conf/CPMBR1400
diff -u src/sys/arch/evbmips/conf/CPMBR1400:1.23 src/sys/arch/evbmips/conf/CPMBR1400:1.24
--- src/sys/arch/evbmips/conf/CPMBR1400:1.23	Sat Jul 29 18:08:57 2017
+++ src/sys/arch/evbmips/conf/CPMBR1400	Tue Aug  1 14:23:42 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: CPMBR1400,v 1.23 2017/07/29 18:08:57 maxv Exp $
+#	$NetBSD: CPMBR1400,v 1.24 2017/08/01 14:23:42 maxv Exp $
 
 include		"arch/evbmips/conf/std.rasoc"
 
@@ -79,7 +79,6 @@ options 	COMPAT_70	# NetBSD 7.0 binary c
 #options 	COMPAT_SVR4	# binary compatibility with SVR4
 #options 	COMPAT_IBCS2	# binary compatibility with SCO and ISC
 #options 	COMPAT_LINUX	# binary compatibility with Linux
-#options 	COMPAT_FREEBSD	# binary compatibility with FreeBSD
 #options 	COMPAT_BSDPTY	# /dev/[pt]ty?? ptys.
 
 # File systems

Index: src/sys/arch/evbmips/conf/LINKITSMART7688
diff -u src/sys/arch/evbmips/conf/LINKITSMART7688:1.3 src/sys/arch/evbmips/conf/LINKITSMART7688:1.4
--- src/sys/arch/evbmips/conf/LINKITSMART7688:1.3	Sat Jul 29 18:08:57 2017
+++ src/sys/arch/evbmips/conf/LINKITSMART7688	Tue Aug  1 14:23:42 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: LINKITSMART7688,v 1.3 2017/07/29 18:08:57 maxv Exp $
+#	$NetBSD: LINKITSMART7688,v 1.4 2017/08/01 14:23:42 maxv Exp $
 #
 # MediaTek MT7688
 #
@@ -79,7 +79,6 @@ options 	COMPAT_70	# NetBSD 7.0 binary c
 #options 	COMPAT_SVR4	# binary compatibility with SVR4
 #options 	COMPAT_IBCS2	# binary compatibility with SCO and ISC
 #options 	COMPAT_LINUX	# binary compatibility with Linux
-#options 	COMPAT_FREEBSD	# binary compatibility with FreeBSD
 #options 	COMPAT_BSDPTY	# /dev/[pt]ty?? ptys.
 
 # File systems

Index: src/sys/arch/evbmips/conf/ZYXELKX
diff -u src/sys/arch/evbmips/conf/ZYXELKX:1.8 src/sys/arch/evbmips/conf/ZYXELKX:1.9
--- src/sys/arch/evbmips/conf/ZYXELKX:1.8	Sat Jul 29 18:08:57 2017
+++ 

CVS commit: src/sys/arch

2017-08-01 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Tue Aug  1 14:23:42 UTC 2017

Modified Files:
src/sys/arch/evbarm/conf: MMNET_GENERIC MPCSA_GENERIC
src/sys/arch/evbmips/conf: CPMBR1400 LINKITSMART7688 ZYXELKX
src/sys/arch/ia64/ia64: genassym.cf

Log Message:
Remove references to compat_freebsd when it is not supported.


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/sys/arch/evbarm/conf/MMNET_GENERIC
cvs rdiff -u -r1.50 -r1.51 src/sys/arch/evbarm/conf/MPCSA_GENERIC
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/evbmips/conf/CPMBR1400
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/evbmips/conf/LINKITSMART7688
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/evbmips/conf/ZYXELKX
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/ia64/ia64/genassym.cf

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



CVS commit: src

2017-08-01 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Tue Aug  1 13:57:03 UTC 2017

Modified Files:
src/distrib/sets/lists/comp: md.amd64 md.i386
Removed Files:
src/sys/arch/i386/include: svr4_machdep.h

Log Message:
Remove svr4_machdep.h right away, no one should include it.


To generate a diff of this commit:
cvs rdiff -u -r1.244 -r1.245 src/distrib/sets/lists/comp/md.amd64
cvs rdiff -u -r1.168 -r1.169 src/distrib/sets/lists/comp/md.i386
cvs rdiff -u -r1.16 -r0 src/sys/arch/i386/include/svr4_machdep.h

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/md.amd64
diff -u src/distrib/sets/lists/comp/md.amd64:1.244 src/distrib/sets/lists/comp/md.amd64:1.245
--- src/distrib/sets/lists/comp/md.amd64:1.244	Sat Jul 29 19:39:58 2017
+++ src/distrib/sets/lists/comp/md.amd64	Tue Aug  1 13:57:03 2017
@@ -1,4 +1,4 @@
-# $NetBSD: md.amd64,v 1.244 2017/07/29 19:39:58 kre Exp $
+# $NetBSD: md.amd64,v 1.245 2017/08/01 13:57:03 maxv Exp $
 
 ./usr/include/amd64comp-c-include
 ./usr/include/amd64/ansi.h			comp-c-include
@@ -468,7 +468,6 @@
 ./usr/include/i386/specialreg.h			comp-c-include
 ./usr/include/i386/spkr.h			comp-c-include
 ./usr/include/i386/stdarg.h			comp-obsolete		obsolete
-./usr/include/i386/svr4_machdep.h		comp-obsolete		obsolete
 ./usr/include/i386/sysarch.h			comp-c-include
 ./usr/include/i386/trap.h			comp-c-include
 ./usr/include/i386/tss.h			comp-c-include

Index: src/distrib/sets/lists/comp/md.i386
diff -u src/distrib/sets/lists/comp/md.i386:1.168 src/distrib/sets/lists/comp/md.i386:1.169
--- src/distrib/sets/lists/comp/md.i386:1.168	Sat Jul 29 19:39:58 2017
+++ src/distrib/sets/lists/comp/md.i386	Tue Aug  1 13:57:03 2017
@@ -1,4 +1,4 @@
-# $NetBSD: md.i386,v 1.168 2017/07/29 19:39:58 kre Exp $
+# $NetBSD: md.i386,v 1.169 2017/08/01 13:57:03 maxv Exp $
 ./usr/include/clang-3.4/__wmmintrin_aes.h	comp-obsolete		obsolete
 ./usr/include/clang-3.4/__wmmintrin_pclmul.h	comp-obsolete		obsolete
 ./usr/include/clang-3.4/ammintrin.h		comp-obsolete		obsolete
@@ -400,7 +400,6 @@
 ./usr/include/i386/specialreg.h			comp-c-include
 ./usr/include/i386/spkr.h			comp-c-include
 ./usr/include/i386/stdarg.h			comp-obsolete		obsolete
-./usr/include/i386/svr4_machdep.h		comp-obsolete		obsolete
 ./usr/include/i386/sysarch.h			comp-c-include
 ./usr/include/i386/trap.h			comp-c-include
 ./usr/include/i386/tss.h			comp-c-include



CVS commit: src

2017-08-01 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Tue Aug  1 13:57:03 UTC 2017

Modified Files:
src/distrib/sets/lists/comp: md.amd64 md.i386
Removed Files:
src/sys/arch/i386/include: svr4_machdep.h

Log Message:
Remove svr4_machdep.h right away, no one should include it.


To generate a diff of this commit:
cvs rdiff -u -r1.244 -r1.245 src/distrib/sets/lists/comp/md.amd64
cvs rdiff -u -r1.168 -r1.169 src/distrib/sets/lists/comp/md.i386
cvs rdiff -u -r1.16 -r0 src/sys/arch/i386/include/svr4_machdep.h

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



CVS commit: src/sys/modules

2017-08-01 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Tue Aug  1 13:49:51 UTC 2017

Modified Files:
src/sys/modules: Makefile

Log Message:
Don't build the svr4 module on i386.


To generate a diff of this commit:
cvs rdiff -u -r1.193 -r1.194 src/sys/modules/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/Makefile
diff -u src/sys/modules/Makefile:1.193 src/sys/modules/Makefile:1.194
--- src/sys/modules/Makefile:1.193	Mon Jun 12 01:01:01 2017
+++ src/sys/modules/Makefile	Tue Aug  1 13:49:50 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.193 2017/06/12 01:01:01 pgoyette Exp $
+#	$NetBSD: Makefile,v 1.194 2017/08/01 13:49:50 maxv Exp $
 
 .include 
 
@@ -266,7 +266,6 @@ SUBDIR+=	compat_netbsd32_sysvipc
 SUBDIR+=	ati_pcigart
 SUBDIR+=	compat_freebsd
 SUBDIR+=	compat_ibcs2
-SUBDIR+=	compat_svr4
 SUBDIR+=	mach64drm
 SUBDIR+=	mgadrm
 SUBDIR+=	nsclpcsio



CVS commit: src/sys/modules

2017-08-01 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Tue Aug  1 13:49:51 UTC 2017

Modified Files:
src/sys/modules: Makefile

Log Message:
Don't build the svr4 module on i386.


To generate a diff of this commit:
cvs rdiff -u -r1.193 -r1.194 src/sys/modules/Makefile

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



CVS commit: src/sys/arch

2017-08-01 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Tue Aug  1 13:47:49 UTC 2017

Modified Files:
src/sys/arch/amd64/conf: files.amd64
src/sys/arch/i386/conf: files.i386
src/sys/arch/xen/conf: files.xen

Log Message:
Don't include files.svr4 and files.svr4_32.


To generate a diff of this commit:
cvs rdiff -u -r1.89 -r1.90 src/sys/arch/amd64/conf/files.amd64
cvs rdiff -u -r1.381 -r1.382 src/sys/arch/i386/conf/files.i386
cvs rdiff -u -r1.150 -r1.151 src/sys/arch/xen/conf/files.xen

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/amd64/conf/files.amd64
diff -u src/sys/arch/amd64/conf/files.amd64:1.89 src/sys/arch/amd64/conf/files.amd64:1.90
--- src/sys/arch/amd64/conf/files.amd64:1.89	Wed Jul 12 16:59:41 2017
+++ src/sys/arch/amd64/conf/files.amd64	Tue Aug  1 13:47:49 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: files.amd64,v 1.89 2017/07/12 16:59:41 maxv Exp $
+#	$NetBSD: files.amd64,v 1.90 2017/08/01 13:47:49 maxv Exp $
 #
 # new style config file for amd64 architecture
 #
@@ -161,12 +161,6 @@ include "compat/linux32/arch/amd64/files
 file	arch/amd64/amd64/linux32_sigcode.S		compat_linux32
 file	arch/amd64/amd64/linux32_syscall.c		compat_linux32
 
-# SVR4 compatibility (COMPAT_SVR4)
-include "compat/svr4/files.svr4"
-
-# SVR4 compatibility (COMPAT_SVR4_32)
-include "compat/svr4_32/files.svr4_32"
-
 # OSS audio driver compatibility
 include	"compat/ossaudio/files.ossaudio"
 

Index: src/sys/arch/i386/conf/files.i386
diff -u src/sys/arch/i386/conf/files.i386:1.381 src/sys/arch/i386/conf/files.i386:1.382
--- src/sys/arch/i386/conf/files.i386:1.381	Sat Jul 29 11:54:14 2017
+++ src/sys/arch/i386/conf/files.i386	Tue Aug  1 13:47:49 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: files.i386,v 1.381 2017/07/29 11:54:14 maxv Exp $
+#	$NetBSD: files.i386,v 1.382 2017/08/01 13:47:49 maxv Exp $
 #
 # new style config file for i386 architecture
 #
@@ -325,9 +325,6 @@ file	arch/i386/i386/vm86.c			vm86
 file	arch/i386/i386/compat_13_machdep.c	compat_13
 file	arch/i386/i386/compat_16_machdep.c	compat_16 | compat_ibcs2
 
-# SVR4 binary compatibility (COMPAT_SVR4)
-include	"compat/svr4/files.svr4"
-
 # iBCS-2 binary compatibility (COMPAT_IBCS2)
 include	"compat/ibcs2/files.ibcs2"
 file	arch/i386/i386/ibcs2_machdep.c		compat_ibcs2

Index: src/sys/arch/xen/conf/files.xen
diff -u src/sys/arch/xen/conf/files.xen:1.150 src/sys/arch/xen/conf/files.xen:1.151
--- src/sys/arch/xen/conf/files.xen:1.150	Sat Jul 29 11:54:14 2017
+++ src/sys/arch/xen/conf/files.xen	Tue Aug  1 13:47:49 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: files.xen,v 1.150 2017/07/29 11:54:14 maxv Exp $
+#	$NetBSD: files.xen,v 1.151 2017/08/01 13:47:49 maxv Exp $
 #	NetBSD: files.x86,v 1.10 2003/10/08 17:30:00 bouyer Exp 
 #	NetBSD: files.i386,v 1.254 2004/03/25 23:32:10 jmc Exp 
 
@@ -319,9 +319,6 @@ file	arch/i386/i386/vm86.c			vm86
 file	arch/i386/i386/compat_13_machdep.c	compat_13
 file	arch/i386/i386/compat_16_machdep.c	compat_16 | compat_ibcs2
 
-# SVR4 binary compatibility (COMPAT_SVR4)
-include	"compat/svr4/files.svr4"
-
 # iBCS-2 binary compatibility (COMPAT_IBCS2)
 include	"compat/ibcs2/files.ibcs2"
 file	arch/i386/i386/ibcs2_machdep.c		compat_ibcs2



CVS commit: src/sys/arch

2017-08-01 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Tue Aug  1 13:47:49 UTC 2017

Modified Files:
src/sys/arch/amd64/conf: files.amd64
src/sys/arch/i386/conf: files.i386
src/sys/arch/xen/conf: files.xen

Log Message:
Don't include files.svr4 and files.svr4_32.


To generate a diff of this commit:
cvs rdiff -u -r1.89 -r1.90 src/sys/arch/amd64/conf/files.amd64
cvs rdiff -u -r1.381 -r1.382 src/sys/arch/i386/conf/files.i386
cvs rdiff -u -r1.150 -r1.151 src/sys/arch/xen/conf/files.xen

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



CVS commit: src/sys/arch/evbarm/conf

2017-08-01 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Aug  1 13:02:37 UTC 2017

Modified Files:
src/sys/arch/evbarm/conf: MMNET_GENERIC

Log Message:
Remove commented vestiges of bygone compat options.

COMPAT_MACH, COMPAT_DARWIN, EXEC_MACHO, and COMPAT_PECOFF were all
removed ages ago.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/sys/arch/evbarm/conf/MMNET_GENERIC

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



CVS commit: src/sys/arch/evbarm/conf

2017-08-01 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Aug  1 13:02:37 UTC 2017

Modified Files:
src/sys/arch/evbarm/conf: MMNET_GENERIC

Log Message:
Remove commented vestiges of bygone compat options.

COMPAT_MACH, COMPAT_DARWIN, EXEC_MACHO, and COMPAT_PECOFF were all
removed ages ago.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/sys/arch/evbarm/conf/MMNET_GENERIC

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/evbarm/conf/MMNET_GENERIC
diff -u src/sys/arch/evbarm/conf/MMNET_GENERIC:1.28 src/sys/arch/evbarm/conf/MMNET_GENERIC:1.29
--- src/sys/arch/evbarm/conf/MMNET_GENERIC:1.28	Sat Jul 29 18:08:57 2017
+++ src/sys/arch/evbarm/conf/MMNET_GENERIC	Tue Aug  1 13:02:37 2017
@@ -1,4 +1,4 @@
-# $NetBSD: MMNET_GENERIC,v 1.28 2017/07/29 18:08:57 maxv Exp $
+# $NetBSD: MMNET_GENERIC,v 1.29 2017/08/01 13:02:37 riastradh Exp $
 #
 # GENERIC machine description file
 #
@@ -22,7 +22,7 @@ include		"arch/evbarm/conf/std.mmnet"
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		"GENERIC-$Revision: 1.28 $"
+#ident 		"GENERIC-$Revision: 1.29 $"
 
 maxusers	32		# estimated number of users
 
@@ -113,11 +113,7 @@ options 	COMPAT_43	# 4.3BSD, 386BSD, and
 #options 	COMPAT_IBCS2	# binary compatibility with SCO and ISC
 #options 	COMPAT_LINUX	# binary compatibility with Linux
 #options 	COMPAT_FREEBSD	# binary compatibility with FreeBSD
-#options 	COMPAT_MACH	# binary compatibility with Mach binaries
-#options 	COMPAT_DARWIN	# binary compatibility with Darwin binaries
-#options 	EXEC_MACHO	# exec MACH-O binaries
 #options 	COMPAT_NDIS	# NDIS network driver
-#options 	COMPAT_PECOFF	# kernel support to run Win32 apps
 options 	COMPAT_BSDPTY	# /dev/[pt]ty?? ptys.
 
 # File systems



CVS commit: src/lib/libpthread

2017-08-01 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Aug  1 12:31:45 UTC 2017

Modified Files:
src/lib/libpthread: pthread_attr.c

Log Message:
pthread__attr_init_private:
malloc+memset -> calloc. Also initialize all values to the proper
defaults.
This fixes the "rustc panic" discussed on pkgsrc-users.
OK: joerg


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/lib/libpthread/pthread_attr.c

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



CVS commit: src/lib/libpthread

2017-08-01 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Aug  1 12:31:45 UTC 2017

Modified Files:
src/lib/libpthread: pthread_attr.c

Log Message:
pthread__attr_init_private:
malloc+memset -> calloc. Also initialize all values to the proper
defaults.
This fixes the "rustc panic" discussed on pkgsrc-users.
OK: joerg


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/lib/libpthread/pthread_attr.c

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

Modified files:

Index: src/lib/libpthread/pthread_attr.c
diff -u src/lib/libpthread/pthread_attr.c:1.17 src/lib/libpthread/pthread_attr.c:1.18
--- src/lib/libpthread/pthread_attr.c:1.17	Sun Jul  2 16:41:32 2017
+++ src/lib/libpthread/pthread_attr.c	Tue Aug  1 12:31:45 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: pthread_attr.c,v 1.17 2017/07/02 16:41:32 joerg Exp $	*/
+/*	$NetBSD: pthread_attr.c,v 1.18 2017/08/01 12:31:45 martin Exp $	*/
 
 /*-
  * Copyright (c) 2001, 2002, 2003, 2008 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: pthread_attr.c,v 1.17 2017/07/02 16:41:32 joerg Exp $");
+__RCSID("$NetBSD: pthread_attr.c,v 1.18 2017/08/01 12:31:45 martin Exp $");
 
 #include 
 #include 
@@ -58,11 +58,12 @@ pthread__attr_init_private(pthread_attr_
 	if ((p = attr->pta_private) != NULL)
 		return p;
 
-	p = malloc(sizeof(*p));
+	p = calloc(1, sizeof(*p));
 	if (p != NULL) {
-		memset(p, 0, sizeof(*p));
 		attr->pta_private = p;
 		p->ptap_policy = SCHED_OTHER;
+		p->ptap_stacksize = pthread__stacksize;
+		p->ptap_guardsize = pthread__guardsize;
 	}
 	return p;
 }



CVS commit: src/sys/dev/pcmcia

2017-08-01 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Aug  1 12:15:21 UTC 2017

Modified Files:
src/sys/dev/pcmcia: aic_pcmcia.c

Log Message:
>From bjoern johannesson, in netbsd-general... Reset the mask to 0, used to
be 0xa. Is it wrong in the cfe? Should this better be done via a quirk?


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 src/sys/dev/pcmcia/aic_pcmcia.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/pcmcia/aic_pcmcia.c
diff -u src/sys/dev/pcmcia/aic_pcmcia.c:1.43 src/sys/dev/pcmcia/aic_pcmcia.c:1.44
--- src/sys/dev/pcmcia/aic_pcmcia.c:1.43	Thu Nov 12 14:24:06 2009
+++ src/sys/dev/pcmcia/aic_pcmcia.c	Tue Aug  1 08:15:21 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: aic_pcmcia.c,v 1.43 2009/11/12 19:24:06 dyoung Exp $	*/
+/*	$NetBSD: aic_pcmcia.c,v 1.44 2017/08/01 12:15:21 christos Exp $	*/
 
 /*
  * Copyright (c) 1997 Marc Horowitz.  All rights reserved.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: aic_pcmcia.c,v 1.43 2009/11/12 19:24:06 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: aic_pcmcia.c,v 1.44 2017/08/01 12:15:21 christos Exp $");
 
 #include 
 #include 
@@ -101,6 +101,8 @@ aic_pcmcia_validate_config(struct pcmcia
 	cfe->num_memspace != 0 ||
 	cfe->num_iospace != 1)
 		return (EINVAL);
+
+	cfe->iomask = 0;		/* XXX: wrong from cfe?, quirk? */
 	return (0);
 }
 



CVS commit: src/sys/dev/pcmcia

2017-08-01 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Aug  1 12:15:21 UTC 2017

Modified Files:
src/sys/dev/pcmcia: aic_pcmcia.c

Log Message:
>From bjoern johannesson, in netbsd-general... Reset the mask to 0, used to
be 0xa. Is it wrong in the cfe? Should this better be done via a quirk?


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 src/sys/dev/pcmcia/aic_pcmcia.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/hpcmips/stand/libsa

2017-08-01 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Aug  1 11:58:45 UTC 2017

Modified Files:
src/sys/arch/hpcmips/stand/libsa: devopen.c

Log Message:
PR/52446: Devid Binderman: Fix error checking for wcstombs


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/hpcmips/stand/libsa/devopen.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/hpcmips/stand/libsa

2017-08-01 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Aug  1 11:58:45 UTC 2017

Modified Files:
src/sys/arch/hpcmips/stand/libsa: devopen.c

Log Message:
PR/52446: Devid Binderman: Fix error checking for wcstombs


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/hpcmips/stand/libsa/devopen.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/hpcmips/stand/libsa/devopen.c
diff -u src/sys/arch/hpcmips/stand/libsa/devopen.c:1.6 src/sys/arch/hpcmips/stand/libsa/devopen.c:1.7
--- src/sys/arch/hpcmips/stand/libsa/devopen.c:1.6	Sat Mar 14 17:04:09 2009
+++ src/sys/arch/hpcmips/stand/libsa/devopen.c	Tue Aug  1 07:58:45 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: devopen.c,v 1.6 2009/03/14 21:04:09 dsl Exp $	*/
+/*	$NetBSD: devopen.c,v 1.7 2017/08/01 11:58:45 christos Exp $	*/
 
 /*-
  * Copyright (c) 1999 Shin Takemura.
@@ -80,7 +80,7 @@ parsebootfile(const char *fnamexx, char 
 	} else {
 		static char name[1024]; /* XXX */
 
-		if (wcstombs(name, (TCHAR*)fname, sizeof(name)) < 0) {
+		if (wcstombs(name, (TCHAR*)fname, sizeof(name)) == (size_t)-1) {
 			return (ENOENT);
 		}
 		if ('1' <= name[0] && name[0] <= '9' && name[1] == ':') {



CVS commit: src/sys/arch/hpcmips/stand/pbsdboot

2017-08-01 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Aug  1 11:56:58 UTC 2017

Modified Files:
src/sys/arch/hpcmips/stand/pbsdboot: main.c

Log Message:
PR/52445: David Binderman: Fix wcstombs error checking


To generate a diff of this commit:
cvs rdiff -u -r1.62 -r1.63 src/sys/arch/hpcmips/stand/pbsdboot/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/sys/arch/hpcmips/stand/pbsdboot/main.c
diff -u src/sys/arch/hpcmips/stand/pbsdboot/main.c:1.62 src/sys/arch/hpcmips/stand/pbsdboot/main.c:1.63
--- src/sys/arch/hpcmips/stand/pbsdboot/main.c:1.62	Fri Dec 14 16:15:52 2007
+++ src/sys/arch/hpcmips/stand/pbsdboot/main.c	Tue Aug  1 07:56:58 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.62 2007/12/14 21:15:52 pavel Exp $	*/
+/*	$NetBSD: main.c,v 1.63 2017/08/01 11:56:58 christos Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000 Shin Takemura.
@@ -1114,13 +1114,11 @@ BOOL BootKernel(int directboot)
 			szAppName, MB_OK);
 		return FALSE;
 	}
-	GetDlgItemText(hDlgMain, IDC_OPTIONS,
-		woptions, sizeof(woptions));
-	if (wcstombs(options, woptions, sizeof(options)) < 0 ||
-		wcstombs(kernel_name, wkernel_name,
-			 sizeof(kernel_name)) < 0) {
-		MessageBox (NULL, TEXT("invalid character"),
-			szAppName, MB_OK);
+	GetDlgItemText(hDlgMain, IDC_OPTIONS, woptions, sizeof(woptions));
+	if (wcstombs(options, woptions, sizeof(options)) == (size_t)-1 ||
+	wcstombs(kernel_name, wkernel_name, sizeof(kernel_name))
+	== (size_t)-1) {
+		MessageBox(NULL, TEXT("invalid character"), szAppName, MB_OK);
 		return FALSE;
 	}
 	
@@ -1209,8 +1207,8 @@ BOOL BootKernel(int directboot)
 		platid.dw.dw0 = bi.platid_cpu;
 		platid.dw.dw1 = bi.platid_machine;
 		if (set_system_info()) {
-		/*
-		*  boot !
+			/*
+			*  boot !
 			*/
 			pbsdboot(wkernel_name, argc, argv, );
 		}



CVS commit: src/share/man/man4/man4.vax

2017-08-01 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Tue Aug  1 11:12:49 UTC 2017

Modified Files:
src/share/man/man4/man4.vax: mtc.4

Log Message:
Use bullet list.


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

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



CVS commit: src/share/man/man4/man4.vax

2017-08-01 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Tue Aug  1 11:11:17 UTC 2017

Modified Files:
src/share/man/man4/man4.vax: acc.4 autoconf.4 css.4 ddn.4 de.4 dh.4
dl.4 dmc.4 dmf.4 dmv.4 dmz.4 ec.4 en.4 ex.4 hdh.4 hk.4 hp.4 ht.4
hy.4 il.4 intro.4 ix.4 mt.4 mtc.4 np.4 pcl.4 rf.4 tm.4 ts.4 up.4
ut.4 uu.4 va.4 vv.4

Log Message:
Remove superfluous Pp.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/share/man/man4/man4.vax/acc.4 \
src/share/man/man4/man4.vax/ddn.4 src/share/man/man4/man4.vax/de.4 \
src/share/man/man4/man4.vax/ex.4 src/share/man/man4/man4.vax/hdh.4 \
src/share/man/man4/man4.vax/mtc.4 src/share/man/man4/man4.vax/ut.4
cvs rdiff -u -r1.14 -r1.15 src/share/man/man4/man4.vax/autoconf.4 \
src/share/man/man4/man4.vax/dmf.4 src/share/man/man4/man4.vax/ec.4 \
src/share/man/man4/man4.vax/mt.4 src/share/man/man4/man4.vax/tm.4 \
src/share/man/man4/man4.vax/uu.4
cvs rdiff -u -r1.11 -r1.12 src/share/man/man4/man4.vax/css.4
cvs rdiff -u -r1.16 -r1.17 src/share/man/man4/man4.vax/dh.4 \
src/share/man/man4/man4.vax/dmc.4 src/share/man/man4/man4.vax/np.4
cvs rdiff -u -r1.15 -r1.16 src/share/man/man4/man4.vax/dl.4 \
src/share/man/man4/man4.vax/pcl.4 src/share/man/man4/man4.vax/ts.4 \
src/share/man/man4/man4.vax/va.4
cvs rdiff -u -r1.13 -r1.14 src/share/man/man4/man4.vax/dmv.4 \
src/share/man/man4/man4.vax/dmz.4 src/share/man/man4/man4.vax/en.4 \
src/share/man/man4/man4.vax/ht.4 src/share/man/man4/man4.vax/hy.4 \
src/share/man/man4/man4.vax/vv.4
cvs rdiff -u -r1.17 -r1.18 src/share/man/man4/man4.vax/hk.4 \
src/share/man/man4/man4.vax/hp.4 src/share/man/man4/man4.vax/intro.4
cvs rdiff -u -r1.10 -r1.11 src/share/man/man4/man4.vax/il.4
cvs rdiff -u -r1.19 -r1.20 src/share/man/man4/man4.vax/ix.4
cvs rdiff -u -r1.6 -r1.7 src/share/man/man4/man4.vax/rf.4
cvs rdiff -u -r1.18 -r1.19 src/share/man/man4/man4.vax/up.4

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



CVS commit: src/share/man/man4/man4.vax

2017-08-01 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Tue Aug  1 11:12:49 UTC 2017

Modified Files:
src/share/man/man4/man4.vax: mtc.4

Log Message:
Use bullet list.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/share/man/man4/man4.vax/mtc.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/man4.vax/mtc.4
diff -u src/share/man/man4/man4.vax/mtc.4:1.13 src/share/man/man4/man4.vax/mtc.4:1.14
--- src/share/man/man4/man4.vax/mtc.4:1.13	Tue Aug  1 11:11:17 2017
+++ src/share/man/man4/man4.vax/mtc.4	Tue Aug  1 11:12:49 2017
@@ -1,4 +1,4 @@
-.\"	$NetBSD: mtc.4,v 1.13 2017/08/01 11:11:17 wiz Exp $
+.\"	$NetBSD: mtc.4,v 1.14 2017/08/01 11:12:49 wiz Exp $
 .\"
 .\" Copyright (c) 1980, 1987, 1991 Regents of the University of California.
 .\" All rights reserved.
@@ -46,9 +46,11 @@ The
 driver is for UNIBUS
 tape controllers that use MSCP.
 Among these controllers are:
-.Bl -tag -offset indent -compact
-.It DEC KLESI-U UNIBUS ctlr
-.It DEC TK50 Q22 bus ctlr
+.Bl -bullet -offset indent -compact
+.It
+DEC KLESI-U UNIBUS ctlr
+.It
+DEC TK50 Q22 bus ctlr
 .El
 The
 .Nm



  1   2   >