CVS commit: src/sys

2016-07-05 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Wed Jul  6 05:27:52 UTC 2016

Modified Files:
src/sys/net: if_spppsubr.c
src/sys/netinet: in.c in_var.h ip_input.c

Log Message:
Add and use pslist(9)-based hashtable for IPv4 addresses

Note that we leave the old hashtable to keep vmstat -H working.


To generate a diff of this commit:
cvs rdiff -u -r1.144 -r1.145 src/sys/net/if_spppsubr.c
cvs rdiff -u -r1.169 -r1.170 src/sys/netinet/in.c
cvs rdiff -u -r1.74 -r1.75 src/sys/netinet/in_var.h
cvs rdiff -u -r1.333 -r1.334 src/sys/netinet/ip_input.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/net/if_spppsubr.c
diff -u src/sys/net/if_spppsubr.c:1.144 src/sys/net/if_spppsubr.c:1.145
--- src/sys/net/if_spppsubr.c:1.144	Thu Jun 30 01:34:53 2016
+++ src/sys/net/if_spppsubr.c	Wed Jul  6 05:27:52 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_spppsubr.c,v 1.144 2016/06/30 01:34:53 ozaki-r Exp $	 */
+/*	$NetBSD: if_spppsubr.c,v 1.145 2016/07/06 05:27:52 ozaki-r Exp $	 */
 
 /*
  * Synchronous PPP/Cisco link level subroutines.
@@ -41,7 +41,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_spppsubr.c,v 1.144 2016/06/30 01:34:53 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_spppsubr.c,v 1.145 2016/07/06 05:27:52 ozaki-r Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_inet.h"
@@ -4897,10 +4897,16 @@ found:
 *dest = new_dst; /* fix dstaddr in place */
 			}
 		}
+
 		LIST_REMOVE(ifatoia(ifa), ia_hash);
+		IN_ADDRHASH_WRITER_REMOVE(ifatoia(ifa));
+
 		error = in_ifinit(ifp, ifatoia(ifa), _sin, 0, hostIsNew);
+
 		LIST_INSERT_HEAD(_IFADDR_HASH(ifatoia(ifa)->ia_addr.sin_addr.s_addr),
 		ifatoia(ifa), ia_hash);
+		IN_ADDRHASH_WRITER_INSERT_HEAD(ifatoia(ifa));
+
 		if (debug && error)
 		{
 			log(LOG_DEBUG, "%s: sppp_set_ip_addrs: in_ifinit "
@@ -4953,10 +4959,16 @@ found:
 		if (sp->ipcp.flags & IPCP_HISADDR_DYN)
 			/* replace peer addr in place */
 			dest->sin_addr.s_addr = sp->ipcp.saved_hisaddr;
+
 		LIST_REMOVE(ifatoia(ifa), ia_hash);
+		IN_ADDRHASH_WRITER_REMOVE(ifatoia(ifa));
+
 		in_ifinit(ifp, ifatoia(ifa), _sin, 0, 0);
+
 		LIST_INSERT_HEAD(_IFADDR_HASH(ifatoia(ifa)->ia_addr.sin_addr.s_addr),
 		ifatoia(ifa), ia_hash);
+		IN_ADDRHASH_WRITER_INSERT_HEAD(ifatoia(ifa));
+
 		(void)pfil_run_hooks(if_pfil,
 		(struct mbuf **)SIOCDIFADDR, ifp, PFIL_IFADDR);
 	}

Index: src/sys/netinet/in.c
diff -u src/sys/netinet/in.c:1.169 src/sys/netinet/in.c:1.170
--- src/sys/netinet/in.c:1.169	Thu Jun 30 01:34:53 2016
+++ src/sys/netinet/in.c	Wed Jul  6 05:27:52 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: in.c,v 1.169 2016/06/30 01:34:53 ozaki-r Exp $	*/
+/*	$NetBSD: in.c,v 1.170 2016/07/06 05:27:52 ozaki-r Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -91,7 +91,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: in.c,v 1.169 2016/06/30 01:34:53 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: in.c,v 1.170 2016/07/06 05:27:52 ozaki-r Exp $");
 
 #include "arp.h"
 
@@ -185,10 +185,14 @@ static krwlock_t		in_multilock;
 #define IN_MULTI_HASH(x, ifp) \
 (in_multihashtbl[(u_long)((x) ^ (ifp->if_index)) % IN_MULTI_HASH_SIZE])
 
+/* XXX DEPRECATED. Keep it to avoid breaking kvm(3) users. */
 struct in_ifaddrhashhead *	in_ifaddrhashtbl;
 u_longin_ifaddrhash;
 struct in_ifaddrhead		in_ifaddrhead;
 
+struct pslist_head *		in_ifaddrhashtbl_pslist;
+u_longin_ifaddrhash_pslist;
+
 void
 in_init(void)
 {
@@ -198,6 +202,8 @@ in_init(void)
 
 	in_ifaddrhashtbl = hashinit(IN_IFADDR_HASH_SIZE, HASH_LIST, true,
 	_ifaddrhash);
+	in_ifaddrhashtbl_pslist = hashinit(IN_IFADDR_HASH_SIZE, HASH_PSLIST,
+	true, _ifaddrhash_pslist);
 	in_multihashtbl = hashinit(IN_IFADDR_HASH_SIZE, HASH_LIST, true,
 	_multihash);
 	rw_init(_multilock);
@@ -388,15 +394,15 @@ in_control(struct socket *so, u_long cmd
 	case SIOCDIFADDR:
 	case SIOCGIFALIAS:
 	case SIOCGIFAFLAG_IN:
-		if (ifra->ifra_addr.sin_family == AF_INET)
-			LIST_FOREACH(ia,
-			_IFADDR_HASH(ifra->ifra_addr.sin_addr.s_addr),
-			ia_hash) {
+		if (ifra->ifra_addr.sin_family == AF_INET) {
+			IN_ADDRHASH_READER_FOREACH(ia,
+			ifra->ifra_addr.sin_addr.s_addr) {
 if (ia->ia_ifp == ifp &&
 in_hosteq(ia->ia_addr.sin_addr,
 ifra->ifra_addr.sin_addr))
 	break;
 			}
+		}
 		if ((cmd == SIOCDIFADDR ||
 		cmd == SIOCGIFALIAS ||
 		cmd == SIOCGIFAFLAG_IN) &&
@@ -459,6 +465,7 @@ in_control(struct socket *so, u_long cmd
 			ia->ia_ifp = ifp;
 			ia->ia_idsalt = cprng_fast32() % 65535;
 			LIST_INIT(>ia_multiaddrs);
+			IN_ADDRHASH_ENTRY_INIT(ia);
 
 			newifaddr = 1;
 		}
@@ -535,6 +542,7 @@ in_control(struct socket *so, u_long cmd
 	case SIOCSIFADDR:
 		if (!newifaddr) {
 			LIST_REMOVE(ia, ia_hash);
+			IN_ADDRHASH_WRITER_REMOVE(ia);
 			need_reinsert = true;
 		}
 		error = in_ifinit(ifp, ia, satocsin(ifreq_getaddr(cmd, ifr)),
@@ -549,6 +557,7 @@ in_control(struct socket *so, u_long cmd
 		

CVS commit: src/sys

2016-07-05 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Wed Jul  6 05:20:48 UTC 2016

Modified Files:
src/sys/kern: subr_hash.c
src/sys/sys: systm.h

Log Message:
Add HASH_PSLIST (pslist(9)) type for hashinit()


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/kern/subr_hash.c
cvs rdiff -u -r1.270 -r1.271 src/sys/sys/systm.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/kern/subr_hash.c
diff -u src/sys/kern/subr_hash.c:1.6 src/sys/kern/subr_hash.c:1.7
--- src/sys/kern/subr_hash.c:1.6	Thu May 29 21:15:55 2014
+++ src/sys/kern/subr_hash.c	Wed Jul  6 05:20:48 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: subr_hash.c,v 1.6 2014/05/29 21:15:55 rmind Exp $	*/
+/*	$NetBSD: subr_hash.c,v 1.7 2016/07/06 05:20:48 ozaki-r Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1991, 1993
@@ -37,12 +37,13 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: subr_hash.c,v 1.6 2014/05/29 21:15:55 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_hash.c,v 1.7 2016/07/06 05:20:48 ozaki-r Exp $");
 
 #include 
 #include 
 #include 
 #include 
+#include 
 
 static size_t
 hash_list_size(enum hashtype htype)
@@ -50,12 +51,16 @@ hash_list_size(enum hashtype htype)
 	LIST_HEAD(, generic) *hashtbl_list;
 	SLIST_HEAD(, generic) *hashtbl_slist;
 	TAILQ_HEAD(, generic) *hashtbl_tailq;
+	struct pslist_head *hashtbl_pslist;
 	size_t esize;
 
 	switch (htype) {
 	case HASH_LIST:
 		esize = sizeof(*hashtbl_list);
 		break;
+	case HASH_PSLIST:
+		esize = sizeof(*hashtbl_pslist);
+		break;
 	case HASH_SLIST:
 		esize = sizeof(*hashtbl_slist);
 		break;
@@ -80,6 +85,7 @@ hashinit(u_int elements, enum hashtype h
 	LIST_HEAD(, generic) *hashtbl_list;
 	SLIST_HEAD(, generic) *hashtbl_slist;
 	TAILQ_HEAD(, generic) *hashtbl_tailq;
+	struct pslist_head *hashtbl_pslist;
 	u_long hashsize, i;
 	size_t esize;
 	void *p;
@@ -103,6 +109,11 @@ hashinit(u_int elements, enum hashtype h
 		for (i = 0; i < hashsize; i++)
 			LIST_INIT(_list[i]);
 		break;
+	case HASH_PSLIST:
+		hashtbl_pslist = p;
+		for (i = 0; i < hashsize; i++)
+			PSLIST_INIT(_pslist[i]);
+		break;
 	case HASH_SLIST:
 		hashtbl_slist = p;
 		for (i = 0; i < hashsize; i++)

Index: src/sys/sys/systm.h
diff -u src/sys/sys/systm.h:1.270 src/sys/sys/systm.h:1.271
--- src/sys/sys/systm.h:1.270	Sat Jan 23 20:44:06 2016
+++ src/sys/sys/systm.h	Wed Jul  6 05:20:48 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: systm.h,v 1.270 2016/01/23 20:44:06 christos Exp $	*/
+/*	$NetBSD: systm.h,v 1.271 2016/07/06 05:20:48 ozaki-r Exp $	*/
 
 /*-
  * Copyright (c) 1982, 1988, 1991, 1993
@@ -177,7 +177,8 @@ int	eopnotsupp(void);
 enum hashtype {
 	HASH_LIST,
 	HASH_SLIST,
-	HASH_TAILQ
+	HASH_TAILQ,
+	HASH_PSLIST
 };
 
 #ifdef _KERNEL



CVS commit: src/sys/netinet

2016-07-05 Thread Kengo NAKAHARA
Module Name:src
Committed By:   knakahara
Date:   Wed Jul  6 01:10:07 UTC 2016

Modified Files:
src/sys/netinet: in_gif.c

Log Message:
fix build failure when defined GIF_ENCAPCHECK


To generate a diff of this commit:
cvs rdiff -u -r1.79 -r1.80 src/sys/netinet/in_gif.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/netinet/in_gif.c
diff -u src/sys/netinet/in_gif.c:1.79 src/sys/netinet/in_gif.c:1.80
--- src/sys/netinet/in_gif.c:1.79	Wed Jul  6 00:30:55 2016
+++ src/sys/netinet/in_gif.c	Wed Jul  6 01:10:07 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: in_gif.c,v 1.79 2016/07/06 00:30:55 ozaki-r Exp $	*/
+/*	$NetBSD: in_gif.c,v 1.80 2016/07/06 01:10:07 knakahara Exp $	*/
 /*	$KAME: in_gif.c,v 1.66 2001/07/29 04:46:09 itojun Exp $	*/
 
 /*
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: in_gif.c,v 1.79 2016/07/06 00:30:55 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: in_gif.c,v 1.80 2016/07/06 01:10:07 knakahara Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -199,8 +199,6 @@ in_gif_input(struct mbuf *m, int off, in
 	const struct ip *ip;
 	int af;
 	u_int8_t otos;
-	struct ifnet *rcvif;
-	struct psref psref;
 
 	ip = mtod(m, const struct ip *);
 
@@ -221,6 +219,8 @@ in_gif_input(struct mbuf *m, int off, in
 		return;
 	}
 
+	struct ifnet *rcvif;
+	struct psref psref;
 	rcvif = m_get_rcvif_psref(m, );
 	if (!gif_validate4(ip, sc, rcvif)) {
 		m_put_rcvif_psref(rcvif, );



CVS commit: src/sys

2016-07-05 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Wed Jul  6 00:30:55 UTC 2016

Modified Files:
src/sys/netinet: in_gif.c
src/sys/netinet6: in6_gif.c

Log Message:
Apply m_get_rcvif_psref (kill m_get_rcvif_NOMPSAFE)


To generate a diff of this commit:
cvs rdiff -u -r1.78 -r1.79 src/sys/netinet/in_gif.c
cvs rdiff -u -r1.77 -r1.78 src/sys/netinet6/in6_gif.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/netinet/in_gif.c
diff -u src/sys/netinet/in_gif.c:1.78 src/sys/netinet/in_gif.c:1.79
--- src/sys/netinet/in_gif.c:1.78	Mon Jul  4 04:22:47 2016
+++ src/sys/netinet/in_gif.c	Wed Jul  6 00:30:55 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: in_gif.c,v 1.78 2016/07/04 04:22:47 knakahara Exp $	*/
+/*	$NetBSD: in_gif.c,v 1.79 2016/07/06 00:30:55 ozaki-r Exp $	*/
 /*	$KAME: in_gif.c,v 1.66 2001/07/29 04:46:09 itojun Exp $	*/
 
 /*
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: in_gif.c,v 1.78 2016/07/04 04:22:47 knakahara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: in_gif.c,v 1.79 2016/07/06 00:30:55 ozaki-r Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -349,15 +349,21 @@ gif_encapcheck4(struct mbuf *m, int off,
 {
 	struct ip ip;
 	struct gif_softc *sc;
-	struct ifnet *ifp;
+	struct ifnet *ifp = NULL;
+	int r;
+	struct psref psref;
 
 	/* sanity check done in caller */
 	sc = arg;
 
 	m_copydata(m, 0, sizeof(ip), );
-	ifp = ((m->m_flags & M_PKTHDR) != 0) ? m_get_rcvif_NOMPSAFE(m) : NULL;
+	if ((m->m_flags & M_PKTHDR) != 0)
+		ifp = m_get_rcvif_psref(m, );
+
+	r = gif_validate4(, sc, ifp);
 
-	return gif_validate4(, sc, ifp);
+	m_put_rcvif_psref(ifp, );
+	return r;
 }
 #endif
 

Index: src/sys/netinet6/in6_gif.c
diff -u src/sys/netinet6/in6_gif.c:1.77 src/sys/netinet6/in6_gif.c:1.78
--- src/sys/netinet6/in6_gif.c:1.77	Mon Jul  4 04:22:47 2016
+++ src/sys/netinet6/in6_gif.c	Wed Jul  6 00:30:55 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: in6_gif.c,v 1.77 2016/07/04 04:22:47 knakahara Exp $	*/
+/*	$NetBSD: in6_gif.c,v 1.78 2016/07/06 00:30:55 ozaki-r Exp $	*/
 /*	$KAME: in6_gif.c,v 1.62 2001/07/29 04:27:25 itojun Exp $	*/
 
 /*
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: in6_gif.c,v 1.77 2016/07/04 04:22:47 knakahara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: in6_gif.c,v 1.78 2016/07/06 00:30:55 ozaki-r Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -349,15 +349,21 @@ gif_encapcheck6(struct mbuf *m, int off,
 {
 	struct ip6_hdr ip6;
 	struct gif_softc *sc;
-	struct ifnet *ifp;
+	struct ifnet *ifp = NULL;
+	int r;
+	struct psref psref;
 
 	/* sanity check done in caller */
 	sc = arg;
 
 	m_copydata(m, 0, sizeof(ip6), (void *));
-	ifp = ((m->m_flags & M_PKTHDR) != 0) ? m_get_rcvif_NOMPSAFE(m) : NULL;
+	if ((m->m_flags & M_PKTHDR) != 0)
+		ifp = m_get_rcvif_psref(m, );
+
+	r = gif_validate6(, sc, ifp);
 
-	return gif_validate6(, sc, ifp);
+	m_put_rcvif_psref(ifp, );
+	return r;
 }
 #endif
 



CVS commit: src

2016-07-05 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Jul  5 21:13:12 UTC 2016

Modified Files:
src/distrib/sets/lists/comp: mi
src/lib/librt: Makefile sched.3

Log Message:
man page for sched_protect (Charles Cui, GSoC 2016)


To generate a diff of this commit:
cvs rdiff -u -r1.2049 -r1.2050 src/distrib/sets/lists/comp/mi
cvs rdiff -u -r1.18 -r1.19 src/lib/librt/Makefile
cvs rdiff -u -r1.12 -r1.13 src/lib/librt/sched.3

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

Modified files:

Index: src/distrib/sets/lists/comp/mi
diff -u src/distrib/sets/lists/comp/mi:1.2049 src/distrib/sets/lists/comp/mi:1.2050
--- src/distrib/sets/lists/comp/mi:1.2049	Sun Jul  3 22:05:56 2016
+++ src/distrib/sets/lists/comp/mi	Tue Jul  5 17:13:12 2016
@@ -1,4 +1,4 @@
-#	$NetBSD: mi,v 1.2049 2016/07/04 02:05:56 christos Exp $
+#	$NetBSD: mi,v 1.2050 2016/07/05 21:13:12 christos Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 ./etc/mtree/set.compcomp-sys-root
@@ -8683,6 +8683,7 @@
 ./usr/share/man/cat3/sched_get_priority_min.0	comp-c-catman		.cat
 ./usr/share/man/cat3/sched_getparam.0		comp-c-catman		.cat
 ./usr/share/man/cat3/sched_getscheduler.0	comp-c-catman		.cat
+./usr/share/man/cat3/sched_protect.0		comp-c-catman		.cat
 ./usr/share/man/cat3/sched_rr_get_interval.0	comp-c-catman		.cat
 ./usr/share/man/cat3/sched_setparam.0		comp-c-catman		.cat
 ./usr/share/man/cat3/sched_setscheduler.0	comp-c-catman		.cat
@@ -15912,6 +15913,7 @@
 ./usr/share/man/html3/sched_get_priority_min.html	comp-c-htmlman		html
 ./usr/share/man/html3/sched_getparam.html	comp-c-htmlman		html
 ./usr/share/man/html3/sched_getscheduler.html	comp-c-htmlman		html
+./usr/share/man/html3/sched_protect.html	comp-c-htmlman		html
 ./usr/share/man/html3/sched_rr_get_interval.html	comp-c-htmlman		html
 ./usr/share/man/html3/sched_setparam.html	comp-c-htmlman		html
 ./usr/share/man/html3/sched_setscheduler.html	comp-c-htmlman		html
@@ -23142,6 +23144,7 @@
 ./usr/share/man/man3/sched_get_priority_min.3	comp-c-man		.man
 ./usr/share/man/man3/sched_getparam.3		comp-c-man		.man
 ./usr/share/man/man3/sched_getscheduler.3	comp-c-man		.man
+./usr/share/man/man3/sched_protect.3		comp-c-man		.man
 ./usr/share/man/man3/sched_rr_get_interval.3	comp-c-man		.man
 ./usr/share/man/man3/sched_setparam.3		comp-c-man		.man
 ./usr/share/man/man3/sched_setscheduler.3	comp-c-man		.man

Index: src/lib/librt/Makefile
diff -u src/lib/librt/Makefile:1.18 src/lib/librt/Makefile:1.19
--- src/lib/librt/Makefile:1.18	Thu Dec 19 14:40:08 2013
+++ src/lib/librt/Makefile	Tue Jul  5 17:13:12 2016
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.18 2013/12/19 19:40:08 rmind Exp $
+#	$NetBSD: Makefile,v 1.19 2016/07/05 21:13:12 christos Exp $
 #
 
 .include 
@@ -33,6 +33,7 @@ MLINKS+=	pset.3 pset_destroy.3
 
 MLINKS+=	sched.3 sched_setparam.3
 MLINKS+=	sched.3 sched_getparam.3
+MLINKS+=	sched.3 sched_protect.3
 MLINKS+=	sched.3 sched_setscheduler.3
 MLINKS+=	sched.3 sched_getscheduler.3
 MLINKS+=	sched.3 sched_get_priority_max.3

Index: src/lib/librt/sched.3
diff -u src/lib/librt/sched.3:1.12 src/lib/librt/sched.3:1.13
--- src/lib/librt/sched.3:1.12	Sat Feb 20 11:00:10 2016
+++ src/lib/librt/sched.3	Tue Jul  5 17:13:12 2016
@@ -1,4 +1,4 @@
-.\"	$NetBSD: sched.3,v 1.12 2016/02/20 16:00:10 riastradh Exp $
+.\"	$NetBSD: sched.3,v 1.13 2016/07/05 21:13:12 christos Exp $
 .\"
 .\" Copyright (c) 2008 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -27,7 +27,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd December 4, 2011
+.Dd July 5, 2016
 .Dt SCHED 3
 .Os
 .Sh NAME
@@ -38,7 +38,8 @@
 .Nm sched_get_priority_max ,
 .Nm sched_get_priority_min ,
 .Nm sched_rr_get_interval ,
-.Nm sched_yield
+.Nm sched_yield ,
+.Nm sched_protect
 .Nd process scheduling
 .Sh LIBRARY
 .Lb librt
@@ -60,6 +61,8 @@
 .Fn sched_rr_get_interval "pid_t pid" "struct timespec *interval"
 .Ft int
 .Fn sched_yield "void"
+.Ft int
+.Fn sched_protect "int priority"
 .Sh DESCRIPTION
 This section describes the functions used to get scheduling information
 about processes, and control the scheduling of processes.
@@ -152,6 +155,10 @@ Get the affinity mask of the process spe
 .Fa pid
 into the
 .Fa cpuset .
+.It Fn sched_protect priority
+Performs priority protection for PTHREAD_PRIO_PROTECT protocol.
+This function will increase the priority of the caller thread to
+.Fa priority.
 .El
 .Sh IMPLEMENTATION NOTES
 Setting CPU
@@ -170,6 +177,7 @@ and
 .Fn sched_getaffinity_np
 functions.
 .Sh RETURN VALUES
+.Fn sched_protect ,
 .Fn sched_setparam ,
 .Fn sched_getparam ,
 .Fn sched_rr_get_interval ,



CVS commit: [netbsd-7] src/doc

2016-07-05 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Jul  5 19:20:55 UTC 2016

Modified Files:
src/doc [netbsd-7]: CHANGES-7.1

Log Message:
1182, 1185-1187


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.95 -r1.1.2.96 src/doc/CHANGES-7.1

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-7.1
diff -u src/doc/CHANGES-7.1:1.1.2.95 src/doc/CHANGES-7.1:1.1.2.96
--- src/doc/CHANGES-7.1:1.1.2.95	Fri Jul  1 07:50:06 2016
+++ src/doc/CHANGES-7.1	Tue Jul  5 19:20:55 2016
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-7.1,v 1.1.2.95 2016/07/01 07:50:06 snj Exp $
+# $NetBSD: CHANGES-7.1,v 1.1.2.96 2016/07/05 19:20:55 snj Exp $
 
 A complete list of changes from the NetBSD 7.0 release to the NetBSD 7.1
 release:
@@ -4916,3 +4916,39 @@ xsrc/external/mit/glu/dist/include/GL/gl
 	in a double, or 1e15 if DBL_MAX_10_EXP is not large enough.
 	[bouyer, ticket #1181]
 
+bin/cat/cat.c	1.57
+distrib/sets/lists/tests/mi			1.675 via patch
+tests/bin/cat/Makefile1.2
+tests/bin/cat/d_se_output.in			1.1
+tests/bin/cat/d_se_output.out			1.1
+tests/bin/cat/t_cat.sh1.3
+
+	When invoked with -se, print a '$' on blank lines
+	Obtained from OpenBSD r1.13 of src/bin/cat/cat.c
+	PR bin/51250
+	[sevan, ticket #1182]
+
+sys/kern/kern_subr.c1.215
+
+	Don't crash if rootspec is invalid.
+	[mlelstv, ticket #1185]
+
+sys/dev/ata/wd.c1.421
+sys/kern/subr_autoconf.c			1.242 via patch
+sys/sys/device.h1.149
+
+	Add a new config_detach() flag, DETACH_POWEROFF, which is set
+	when detaching devices at shutdown time with RB_POWERDOWN.
+	When detaching wd(4), put the drive in standby before detach
+	for DETACH_POWEROFF.  Fix PR kern/51252
+	[bouyer, ticket #1186]
+
+sys/dev/adb/adb_kbd.c1.23
+sys/dev/adb/adb_keymap.h			1.5, 1.6
+sys/dev/adb/adb_usb_map.c			1.2
+
+	ADB: ask the keyboard to distinguish between left and right
+	Control, Alt and Shift keys.  Add us.dvorak keymap variant.
+	PR port-macppc/51255.
+	[sevan, ticket #1187]
+



CVS commit: [netbsd-7] src/sys/dev/adb

2016-07-05 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Jul  5 19:14:59 UTC 2016

Modified Files:
src/sys/dev/adb [netbsd-7]: adb_kbd.c adb_keymap.h adb_usb_map.c

Log Message:
Pull up following revision(s) (requested by sevan in ticket #1187):
sys/dev/adb/adb_kbd.c: revision 1.23
sys/dev/adb/adb_keymap.h: revisions 1.5, 1.6
sys/dev/adb/adb_usb_map.c: revision 1.2
nicely ask the keyboard to distinguish between left and right Control, Alt
and Shift keys.
Welcome to the world of accents and diacritics!
--
Add us.dvorak keymap variant for ADB keyboards.  Addresses PR 51255.
Tested by sevan@.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.22.4.1 src/sys/dev/adb/adb_kbd.c
cvs rdiff -u -r1.4 -r1.4.14.1 src/sys/dev/adb/adb_keymap.h
cvs rdiff -u -r1.1 -r1.1.16.1 src/sys/dev/adb/adb_usb_map.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/adb/adb_kbd.c
diff -u src/sys/dev/adb/adb_kbd.c:1.22 src/sys/dev/adb/adb_kbd.c:1.22.4.1
--- src/sys/dev/adb/adb_kbd.c:1.22	Mon Nov 18 11:02:34 2013
+++ src/sys/dev/adb/adb_kbd.c	Tue Jul  5 19:14:59 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: adb_kbd.c,v 1.22 2013/11/18 11:02:34 nisimura Exp $	*/
+/*	$NetBSD: adb_kbd.c,v 1.22.4.1 2016/07/05 19:14:59 snj Exp $	*/
 
 /*
  * Copyright (C) 1998	Colin Wood
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: adb_kbd.c,v 1.22 2013/11/18 11:02:34 nisimura Exp $");
+__KERNEL_RCSID(0, "$NetBSD: adb_kbd.c,v 1.22.4.1 2016/07/05 19:14:59 snj Exp $");
 
 #include 
 #include 
@@ -190,6 +190,7 @@ adbkbd_attach(device_t parent, device_t 
 #if NWSMOUSE > 0
 	struct wsmousedev_attach_args am;
 #endif
+	uint8_t buffer[2];
 
 	sc->sc_dev = self;
 	sc->sc_ops = aaa->ops;
@@ -333,6 +334,27 @@ adbkbd_attach(device_t parent, device_t 
 		break;
 	}
 
+	/*
+	 * try to switch to extended protocol
+	 * as in, tell the keyboard to distinguish between left and right
+	 * Shift, Control and Alt keys
+	 */
+	cmd = ADBLISTEN(sc->sc_adbdev->current_addr, 3);
+	buffer[0] = sc->sc_adbdev->current_addr;
+	buffer[1] = 3;
+	sc->sc_msg_len = 0;
+	sc->sc_ops->send(sc->sc_ops->cookie, sc->sc_poll, cmd, 2, buffer);
+	adbkbd_wait(sc, 10);
+
+	cmd = ADBTALK(sc->sc_adbdev->current_addr, 3);
+	sc->sc_msg_len = 0;
+	sc->sc_ops->send(sc->sc_ops->cookie, sc->sc_poll, cmd, 0, NULL);
+	adbkbd_wait(sc, 10);
+	if ((sc->sc_msg_len == 4) && (sc->sc_buffer[3] == 3)) {
+		printf("%s: extended protocol enabled\n",
+		device_xname(sc->sc_dev));
+	}
+
 	if (adbkbd_is_console && (adbkbd_console_attached == 0)) {
 		wskbd_cnattach(_consops, sc, _keymapdata);
 		adbkbd_console_attached = 1;

Index: src/sys/dev/adb/adb_keymap.h
diff -u src/sys/dev/adb/adb_keymap.h:1.4 src/sys/dev/adb/adb_keymap.h:1.4.14.1
--- src/sys/dev/adb/adb_keymap.h:1.4	Wed Aug 29 02:44:07 2012
+++ src/sys/dev/adb/adb_keymap.h	Tue Jul  5 19:14:59 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: adb_keymap.h,v 1.4 2012/08/29 02:44:07 macallan Exp $	*/
+/*	$NetBSD: adb_keymap.h,v 1.4.14.1 2016/07/05 19:14:59 snj Exp $	*/
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -148,10 +148,56 @@ static const keysym_t akbd_keydesc_us[] 
 KC(120),KS_Cmd_Screen1,	KS_f2,
 KC(121),KS_Cmd_ScrollFastDown, KS_Next,
 KC(122),KS_Cmd_Screen0,	KS_f1,
-
+KC(123),			KS_Shift_R,
+KC(124),			KS_Alt_R,
+KC(125),			KS_Control_R,
 KC(127),  KS_Cmd_Debugger,
 };
 
+static const keysym_t akbd_keydesc_us_dvorak[] = {
+/*  pos  command		normal		shifted */
+KC(0),			KS_a,
+KC(1),			KS_o,
+KC(2),			KS_e,
+KC(3),			KS_u,
+KC(4),			KS_d,
+KC(5),			KS_i,
+KC(6),			KS_semicolon,	KS_colon,
+KC(7),			KS_q,
+KC(8),			KS_j,
+KC(9),			KS_k,
+
+KC(11),			KS_x,
+KC(12),			KS_apostrophe,	KS_quotedbl,
+KC(13),			KS_comma,	KS_less,
+KC(14),			KS_period,	KS_greater,
+KC(15),			KS_p,
+KC(16),			KS_f,
+KC(17),			KS_y,
+
+KC(24),			KS_bracketright, KS_braceright,
+KC(27),			KS_bracketleft,	KS_braceleft,
+
+KC(30),			KS_equal,	KS_plus,
+KC(31),			KS_r,
+KC(32),			KS_g,
+KC(33),			KS_slash,	KS_question,
+KC(34),			KS_c,
+KC(35),			KS_l,
+
+KC(37),			KS_n,
+KC(38),			KS_h,
+KC(39),			KS_minus,	KS_underscore,
+KC(40),			KS_t,
+KC(41),			KS_s,
+
+KC(43),			KS_w,
+KC(44),			KS_z,
+KC(45),			KS_b,
+KC(46),			KS_m,
+KC(47),			KS_v,
+};
+
 static const keysym_t akbd_keydesc_fr[] = {
 /*  pos		normal		shifted		altgr		shift-altgr */
 KC(0),	KS_q,
@@ -404,6 +450,7 @@ static const keysym_t akbd_keydesc_pt[] 
 
 static const struct wscons_keydesc akbd_keydesctab[] = {
 	KBD_MAP(KB_US,			0,	akbd_keydesc_us),
+	KBD_MAP(KB_US | KB_DVORAK,  KB_US,  akbd_keydesc_us_dvorak),
 	KBD_MAP(KB_FR,			KB_US,	akbd_keydesc_fr),
 	KBD_MAP(KB_JP,			KB_US,	akbd_keydesc_jp),
 	KBD_MAP(KB_FR | KB_NODEAD,	KB_FR,	akbd_keydesc_fr_nodead),

Index: src/sys/dev/adb/adb_usb_map.c
diff 

CVS commit: [netbsd-7] src/sys

2016-07-05 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Jul  5 19:09:17 UTC 2016

Modified Files:
src/sys/dev/ata [netbsd-7]: wd.c
src/sys/kern [netbsd-7]: subr_autoconf.c
src/sys/sys [netbsd-7]: device.h

Log Message:
Pull up following revision(s) (requested by bouyer in ticket #1186):
sys/dev/ata/wd.c: revision 1.421
sys/kern/subr_autoconf.c: revision 1.242 via patch
sys/sys/device.h: revision 1.149
Add a new config_detach() flag, DETACH_POWEROFF, which is set when
detaching devices at shutdown time with RB_POWERDOWN.
When detaching wd(4), put the drive in standby before detach
for DETACH_POWEROFF.
Fix PR kern/51252


To generate a diff of this commit:
cvs rdiff -u -r1.412.2.1 -r1.412.2.2 src/sys/dev/ata/wd.c
cvs rdiff -u -r1.231.2.2 -r1.231.2.3 src/sys/kern/subr_autoconf.c
cvs rdiff -u -r1.144.4.1 -r1.144.4.2 src/sys/sys/device.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/wd.c
diff -u src/sys/dev/ata/wd.c:1.412.2.1 src/sys/dev/ata/wd.c:1.412.2.2
--- src/sys/dev/ata/wd.c:1.412.2.1	Tue Nov 11 10:36:41 2014
+++ src/sys/dev/ata/wd.c	Tue Jul  5 19:09:17 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: wd.c,v 1.412.2.1 2014/11/11 10:36:41 martin Exp $ */
+/*	$NetBSD: wd.c,v 1.412.2.2 2016/07/05 19:09:17 snj Exp $ */
 
 /*
  * Copyright (c) 1998, 2001 Manuel Bouyer.  All rights reserved.
@@ -54,7 +54,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: wd.c,v 1.412.2.1 2014/11/11 10:36:41 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wd.c,v 1.412.2.2 2016/07/05 19:09:17 snj Exp $");
 
 #include "opt_ata.h"
 
@@ -464,6 +464,8 @@ wddetach(device_t self, int flags)
 
 	bufq_free(sc->sc_q);
 	sc->atabus->ata_killpending(sc->drvp);
+	if (flags & DETACH_POWEROFF)
+		wd_standby(sc, AT_POLL);
 
 	splx(s);
 

Index: src/sys/kern/subr_autoconf.c
diff -u src/sys/kern/subr_autoconf.c:1.231.2.2 src/sys/kern/subr_autoconf.c:1.231.2.3
--- src/sys/kern/subr_autoconf.c:1.231.2.2	Mon Nov 16 14:40:41 2015
+++ src/sys/kern/subr_autoconf.c	Tue Jul  5 19:09:17 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: subr_autoconf.c,v 1.231.2.2 2015/11/16 14:40:41 msaitoh Exp $ */
+/* $NetBSD: subr_autoconf.c,v 1.231.2.3 2016/07/05 19:09:17 snj Exp $ */
 
 /*
  * Copyright (c) 1996, 2000 Christopher G. Demetriou
@@ -77,7 +77,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: subr_autoconf.c,v 1.231.2.2 2015/11/16 14:40:41 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_autoconf.c,v 1.231.2.3 2016/07/05 19:09:17 snj Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ddb.h"
@@ -1864,14 +1864,20 @@ config_detach_all(int how)
 	static struct shutdown_state s;
 	device_t curdev;
 	bool progress = false;
+	int flags;
 
 	if ((how & RB_NOSYNC) != 0)
 		return false;
 
+	if ((how & RB_POWERDOWN) == RB_POWERDOWN)
+		flags = DETACH_SHUTDOWN | DETACH_POWEROFF;
+	else
+		flags = DETACH_SHUTDOWN;
+
 	for (curdev = shutdown_first(); curdev != NULL;
 	 curdev = shutdown_next()) {
 		aprint_debug(" detaching %s, ", device_xname(curdev));
-		if (config_detach(curdev, DETACH_SHUTDOWN) == 0) {
+		if (config_detach(curdev, flags) == 0) {
 			progress = true;
 			aprint_debug("success.");
 		} else

Index: src/sys/sys/device.h
diff -u src/sys/sys/device.h:1.144.4.1 src/sys/sys/device.h:1.144.4.2
--- src/sys/sys/device.h:1.144.4.1	Mon Mar  9 08:56:02 2015
+++ src/sys/sys/device.h	Tue Jul  5 19:09:17 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: device.h,v 1.144.4.1 2015/03/09 08:56:02 snj Exp $ */
+/* $NetBSD: device.h,v 1.144.4.2 2016/07/05 19:09:17 snj Exp $ */
 
 /*
  * Copyright (c) 1996, 2000 Christopher G. Demetriou
@@ -347,6 +347,7 @@ struct cfattach __CONCAT(name,_ca) = {		
 #define	DETACH_FORCE	0x01		/* force detachment; hardware gone */
 #define	DETACH_QUIET	0x02		/* don't print a notice */
 #define	DETACH_SHUTDOWN	0x04		/* detach because of system shutdown */
+#define	DETACH_POWEROFF	0x08		/* going to power off; power down devices */
 
 struct cfdriver {
 	LIST_ENTRY(cfdriver) cd_list;	/* link on allcfdrivers */



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

2016-07-05 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Jul  5 19:06:48 UTC 2016

Modified Files:
src/sys/kern [netbsd-7]: kern_subr.c

Log Message:
Pull up following revision(s) (requested by mlelstv in ticket #1185):
sys/kern/kern_subr.c: revision 1.215
don't crash if rootspec is invalid


To generate a diff of this commit:
cvs rdiff -u -r1.214 -r1.214.4.1 src/sys/kern/kern_subr.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_subr.c
diff -u src/sys/kern/kern_subr.c:1.214 src/sys/kern/kern_subr.c:1.214.4.1
--- src/sys/kern/kern_subr.c:1.214	Mon Dec  9 16:49:43 2013
+++ src/sys/kern/kern_subr.c	Tue Jul  5 19:06:48 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_subr.c,v 1.214 2013/12/09 16:49:43 pooka Exp $	*/
+/*	$NetBSD: kern_subr.c,v 1.214.4.1 2016/07/05 19:06:48 snj Exp $	*/
 
 /*-
  * Copyright (c) 1997, 1998, 1999, 2002, 2007, 2008 The NetBSD Foundation, Inc.
@@ -79,7 +79,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_subr.c,v 1.214 2013/12/09 16:49:43 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_subr.c,v 1.214.4.1 2016/07/05 19:06:48 snj Exp $");
 
 #include "opt_ddb.h"
 #include "opt_md.h"
@@ -422,7 +422,8 @@ setroot(device_t bootdv, int bootpartiti
 		}
 
 		if (rootdev == NODEV &&
-		device_class(dv) == DV_DISK && device_is_a(dv, "dk") &&
+		dv != NULL && device_class(dv) == DV_DISK &&
+		device_is_a(dv, "dk") &&
 		(majdev = devsw_name2blk(device_xname(dv), NULL, 0)) >= 0)
 			rootdev = makedev(majdev, device_unit(dv));
 



CVS commit: [netbsd-7] src

2016-07-05 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Jul  5 19:03:31 UTC 2016

Modified Files:
src/bin/cat [netbsd-7]: cat.c
src/distrib/sets/lists/tests [netbsd-7]: mi
src/tests/bin/cat [netbsd-7]: Makefile t_cat.sh
Added Files:
src/tests/bin/cat [netbsd-7]: d_se_output.in d_se_output.out

Log Message:
Pull up following revision(s) (requested by sevan in ticket #1182):
bin/cat/cat.c: revision 1.57
distrib/sets/lists/tests/mi: revision 1.675
tests/bin/cat/Makefile: revision 1.2
tests/bin/cat/d_se_output.in: revision 1.1
tests/bin/cat/d_se_output.out: revision 1.1
tests/bin/cat/t_cat.sh: revision 1.3
When invoked with -se, print a '$' on blank lines
Obtained from OpenBSD r1.13 of src/bin/cat/cat.c
Closes PR bin/51250
Reviewed by Christos@
--
Add a unit test for PR bin/51250 called se_output. se_output checks
the output of cat when invoked with '-se', to ensure that a '$' is
printed on blank lines.
--
Add input/output files for new test case - fix build


To generate a diff of this commit:
cvs rdiff -u -r1.54 -r1.54.4.1 src/bin/cat/cat.c
cvs rdiff -u -r1.584.2.3 -r1.584.2.4 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.1 -r1.1.12.1 src/tests/bin/cat/Makefile
cvs rdiff -u -r0 -r1.1.2.2 src/tests/bin/cat/d_se_output.in \
src/tests/bin/cat/d_se_output.out
cvs rdiff -u -r1.2 -r1.2.12.1 src/tests/bin/cat/t_cat.sh

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

Modified files:

Index: src/bin/cat/cat.c
diff -u src/bin/cat/cat.c:1.54 src/bin/cat/cat.c:1.54.4.1
--- src/bin/cat/cat.c:1.54	Sun Dec  8 08:32:13 2013
+++ src/bin/cat/cat.c	Tue Jul  5 19:03:31 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: cat.c,v 1.54 2013/12/08 08:32:13 spz Exp $	*/
+/* $NetBSD: cat.c,v 1.54.4.1 2016/07/05 19:03:31 snj Exp $	*/
 
 /*
  * Copyright (c) 1989, 1993
@@ -44,7 +44,7 @@ __COPYRIGHT(
 #if 0
 static char sccsid[] = "@(#)cat.c	8.2 (Berkeley) 4/27/95";
 #else
-__RCSID("$NetBSD: cat.c,v 1.54 2013/12/08 08:32:13 spz Exp $");
+__RCSID("$NetBSD: cat.c,v 1.54.4.1 2016/07/05 19:03:31 snj Exp $");
 #endif
 #endif /* not lint */
 
@@ -175,18 +175,16 @@ cook_buf(FILE *fp)
 	line = gobble = 0;
 	for (prev = '\n'; (ch = getc(fp)) != EOF; prev = ch) {
 		if (prev == '\n') {
-			if (ch == '\n') {
-if (sflag) {
-	if (!gobble && nflag && !bflag)
-		(void)fprintf(stdout,
-			"%6d\t\n", ++line);
-	else if (!gobble && putchar(ch) == EOF)
-		break;
+			if (sflag) {
+if (ch == '\n') {
+	if (gobble)
+		continue;
 	gobble = 1;
-	continue;
+} else
+	gobble = 0;
 }
 if (nflag) {
-	if (!bflag) {
+	if (!bflag || ch != '\n') {
 		(void)fprintf(stdout,
 		"%6d\t", ++line);
 		if (ferror(stdout))
@@ -198,13 +196,7 @@ cook_buf(FILE *fp)
 			break;
 	}
 }
-			} else if (nflag) {
-(void)fprintf(stdout, "%6d\t", ++line);
-if (ferror(stdout))
-	break;
 			}
-		}
-		gobble = 0;
 		if (ch == '\n') {
 			if (eflag)
 if (putchar('$') == EOF)

Index: src/distrib/sets/lists/tests/mi
diff -u src/distrib/sets/lists/tests/mi:1.584.2.3 src/distrib/sets/lists/tests/mi:1.584.2.4
--- src/distrib/sets/lists/tests/mi:1.584.2.3	Thu Aug  6 21:13:43 2015
+++ src/distrib/sets/lists/tests/mi	Tue Jul  5 19:03:31 2016
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.584.2.3 2015/08/06 21:13:43 snj Exp $
+# $NetBSD: mi,v 1.584.2.4 2016/07/05 19:03:31 snj Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -801,6 +801,8 @@
 ./usr/tests/bin/cat/Kyuafile			tests-bin-tests		atf,kyua
 ./usr/tests/bin/cat/d_align.in			tests-bin-tests		atf
 ./usr/tests/bin/cat/d_align.out			tests-bin-tests		atf
+./usr/tests/bin/cat/d_se_output.in		tests-bin-tests		atf
+./usr/tests/bin/cat/d_se_output.out		tests-bin-tests		atf
 ./usr/tests/bin/cat/t_cat			tests-bin-tests		atf
 ./usr/tests/bin/cptests-bin-tests
 ./usr/tests/bin/cp/Atffile			tests-bin-tests		atf

Index: src/tests/bin/cat/Makefile
diff -u src/tests/bin/cat/Makefile:1.1 src/tests/bin/cat/Makefile:1.1.12.1
--- src/tests/bin/cat/Makefile:1.1	Tue Mar 27 08:16:33 2012
+++ src/tests/bin/cat/Makefile	Tue Jul  5 19:03:31 2016
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.1 2012/03/27 08:16:33 jruoho Exp $
+# $NetBSD: Makefile,v 1.1.12.1 2016/07/05 19:03:31 snj Exp $
 
 .include 
 
@@ -8,5 +8,7 @@ TESTS_SH=	t_cat
 FILESDIR=	${TESTSDIR}
 FILES+=		d_align.in
 FILES+=		d_align.out
+FILES+= 	d_se_output.in
+FILES+= 	d_se_output.out
 
 .include 

Index: src/tests/bin/cat/t_cat.sh
diff -u src/tests/bin/cat/t_cat.sh:1.2 src/tests/bin/cat/t_cat.sh:1.2.12.1
--- src/tests/bin/cat/t_cat.sh:1.2	Tue Mar 27 17:57:02 2012
+++ src/tests/bin/cat/t_cat.sh	Tue Jul  5 19:03:31 2016
@@ -1,4 +1,4 @@
-# $NetBSD: t_cat.sh,v 1.2 2012/03/27 17:57:02 jruoho Exp $
+# $NetBSD: t_cat.sh,v 1.2.12.1 2016/07/05 19:03:31 snj Exp $
 #
 # Copyright (c) 2012 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ 

CVS commit: src/usr.sbin/makemandb

2016-07-05 Thread Abhinav Upadhyay
Module Name:src
Committed By:   abhinav
Date:   Tue Jul  5 16:24:18 UTC 2016

Modified Files:
src/usr.sbin/makemandb: makemandb.c

Log Message:
Reuse variable from previous line.


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/usr.sbin/makemandb/makemandb.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/makemandb.c
diff -u src/usr.sbin/makemandb/makemandb.c:1.37 src/usr.sbin/makemandb/makemandb.c:1.38
--- src/usr.sbin/makemandb/makemandb.c:1.37	Wed Apr 13 11:48:29 2016
+++ src/usr.sbin/makemandb/makemandb.c	Tue Jul  5 16:24:18 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: makemandb.c,v 1.37 2016/04/13 11:48:29 christos Exp $	*/
+/*	$NetBSD: makemandb.c,v 1.38 2016/07/05 16:24:18 abhinav Exp $	*/
 /*
  * Copyright (c) 2011 Abhinav Upadhyay 
  * Copyright (c) 2011 Kristaps Dzonsons 
@@ -17,7 +17,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: makemandb.c,v 1.37 2016/04/13 11:48:29 christos Exp $");
+__RCSID("$NetBSD: makemandb.c,v 1.38 2016/07/05 16:24:18 abhinav Exp $");
 
 #include 
 #include 
@@ -2103,7 +2103,7 @@ parse_escape(const char *str)
 		if (backslash[1] == '-' || backslash[1] == ' ') {
 			*iter++ = backslash[1];
 			last_backslash = backslash + 2;
-			backslash = strchr(backslash + 2, '\\');
+			backslash = strchr(last_backslash, '\\');
 		} else {
 			++backslash;
 			mandoc_escape(, NULL, NULL);



CVS commit: src/lib/libpthread

2016-07-05 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Tue Jul  5 10:04:17 UTC 2016

Modified Files:
src/lib/libpthread: pthread_attr_getstack.3 pthread_barrier.3
pthread_barrierattr.3 pthread_cond.3 pthread_condattr.3
pthread_mutex.3 pthread_mutexattr.3 pthread_once.3 pthread_rwlock.3
pthread_rwlockattr.3

Log Message:
Fix some lint.

Too much or too little whitespace;
improve macro usage;
add missing .El;
merge error sections for same error code.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/lib/libpthread/pthread_attr_getstack.3 \
src/lib/libpthread/pthread_barrier.3 src/lib/libpthread/pthread_rwlock.3
cvs rdiff -u -r1.10 -r1.11 src/lib/libpthread/pthread_barrierattr.3 \
src/lib/libpthread/pthread_condattr.3
cvs rdiff -u -r1.6 -r1.7 src/lib/libpthread/pthread_cond.3
cvs rdiff -u -r1.7 -r1.8 src/lib/libpthread/pthread_mutex.3
cvs rdiff -u -r1.12 -r1.13 src/lib/libpthread/pthread_mutexattr.3
cvs rdiff -u -r1.9 -r1.10 src/lib/libpthread/pthread_once.3 \
src/lib/libpthread/pthread_rwlockattr.3

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

Modified files:

Index: src/lib/libpthread/pthread_attr_getstack.3
diff -u src/lib/libpthread/pthread_attr_getstack.3:1.5 src/lib/libpthread/pthread_attr_getstack.3:1.6
--- src/lib/libpthread/pthread_attr_getstack.3:1.5	Fri Jul  9 17:15:59 2010
+++ src/lib/libpthread/pthread_attr_getstack.3	Tue Jul  5 10:04:17 2016
@@ -1,4 +1,4 @@
-.\"	$NetBSD: pthread_attr_getstack.3,v 1.5 2010/07/09 17:15:59 jruoho Exp $
+.\"	$NetBSD: pthread_attr_getstack.3,v 1.6 2016/07/05 10:04:17 wiz Exp $
 .\"
 .\" Copyright (c) 2010 Jukka Ruohonen 
 .\" All rights reserved.
@@ -38,10 +38,10 @@
 .Ft int
 .Fn pthread_attr_getstack \
 "const pthread_attr_t * restrict attr" \
-"void ** restrict stackaddr, size_t * restrict stacksize"
+"void ** restrict stackaddr" "size_t * restrict stacksize"
 .Ft int
 .Fn pthread_attr_setstack \
-"pthread_attr_t * restrict attr" "void *stackaddr, size_t stacksize"
+"pthread_attr_t * restrict attr" "void *stackaddr" "size_t stacksize"
 .Ft int
 .Fn pthread_attr_getstacksize \
 "const pthread_attr_t * restrict attr" "size_t * restrict stacksize"
Index: src/lib/libpthread/pthread_barrier.3
diff -u src/lib/libpthread/pthread_barrier.3:1.5 src/lib/libpthread/pthread_barrier.3:1.6
--- src/lib/libpthread/pthread_barrier.3:1.5	Sun Jul  3 14:24:58 2016
+++ src/lib/libpthread/pthread_barrier.3	Tue Jul  5 10:04:17 2016
@@ -1,4 +1,4 @@
-.\" $NetBSD: pthread_barrier.3,v 1.5 2016/07/03 14:24:58 christos Exp $
+.\" $NetBSD: pthread_barrier.3,v 1.6 2016/07/05 10:04:17 wiz Exp $
 .\"
 .\" Copyright (c) 2002, 2010 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -25,7 +25,6 @@
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
 .\" 
-
 .Dd June 12, 2016
 .Dt PTHREAD_BARRIER 3
 .Os
@@ -48,9 +47,8 @@
 "int * __restrict pshared"
 .Ft int
 .Fn pthread_barrierattr_setpshared "pthread_barrierattr_t * attr" \
-"int pshared" 
+"int pshared"
 .\" 
-
 .Sh DESCRIPTION
 The
 .Fn pthread_barrier_init
@@ -98,15 +96,14 @@ calls and continue execution.
 .Pp
 .\" -
 The
-.Fn pthread_barrierattr_getpshared 
+.Fn pthread_barrierattr_getpshared
 function shall obtain the value of the process-shared attribute from the
-attributes object referenced by attr. 
+attributes object referenced by attr.
 The
 .Fn pthread_barrierattr_setpshared
 function shall set the process-shared attribute in an initialized attributes
-object referenced by attr. 
+object referenced by attr.
 .\" 
-
 .Sh RETURN VALUES
 If successful,
 .Fn pthread_barrier_init
@@ -136,7 +133,7 @@ In the case of failure, an error value w
 .\" -
 If successful,
 .Fn pthread_barrierattr_getpshared
-shall return zero and store the value of the process-shared attribute of attr 
+shall return zero and store the value of the process-shared attribute of attr
 into the object referenced by the
 .Fa pshared
 parameter.
@@ -146,9 +143,8 @@ Otherwise, an error number shall be retu
 If successful,
 .Fn pthread_barrierattr_setpshared
 shall return zero;
-Otherwise, an error number shall be returned to indicate the error. 
+Otherwise, an error number shall be returned to indicate the error.
 .\" 
-
 .Sh ERRORS
 The
 .Fn pthread_barrier_init
@@ -189,9 +185,9 @@ is invalid.
 .El
 .Pp
 .\" -
-The 
+The
 .Fn pthread_barrierattr_setpshared
-function and 
+function and
 the
 .Fn pthread_barrierattr_getpshared
 function may fail if:
@@ -200,7 +196,7 @@ function may fail if:
 The value specified by
 .Fa attr
 is invalid.
-
+.El
 .\" 

CVS commit: src/lib/libc/gen

2016-07-05 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Tue Jul  5 09:51:11 UTC 2016

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

Log Message:
Bump date for _SC_THREAD_PRIO_PROTECT.


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/lib/libc/gen/sysconf.3

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

Modified files:

Index: src/lib/libc/gen/sysconf.3
diff -u src/lib/libc/gen/sysconf.3:1.49 src/lib/libc/gen/sysconf.3:1.50
--- src/lib/libc/gen/sysconf.3:1.49	Sun Jul  3 14:24:58 2016
+++ src/lib/libc/gen/sysconf.3	Tue Jul  5 09:51:10 2016
@@ -1,4 +1,4 @@
-.\"	$NetBSD: sysconf.3,v 1.49 2016/07/03 14:24:58 christos Exp $
+.\"	$NetBSD: sysconf.3,v 1.50 2016/07/05 09:51:10 wiz Exp $
 .\"
 .\" Copyright (c) 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -29,7 +29,7 @@
 .\"
 .\"	@(#)sysconf.3	8.3 (Berkeley) 4/19/94
 .\"
-.Dd June 10, 2016
+.Dd July 3, 2016
 .Dt SYSCONF 3
 .Os
 .Sh NAME



CVS commit: src/sys/compat/linux32/common

2016-07-05 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Tue Jul  5 08:48:51 UTC 2016

Modified Files:
src/sys/compat/linux32/common: linux32_socket.c

Log Message:
Fix psref isn't released in a case of IFADDR_EMPTY


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/compat/linux32/common/linux32_socket.c

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

Modified files:

Index: src/sys/compat/linux32/common/linux32_socket.c
diff -u src/sys/compat/linux32/common/linux32_socket.c:1.23 src/sys/compat/linux32/common/linux32_socket.c:1.24
--- src/sys/compat/linux32/common/linux32_socket.c:1.23	Thu Jun 16 02:38:40 2016
+++ src/sys/compat/linux32/common/linux32_socket.c	Tue Jul  5 08:48:51 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux32_socket.c,v 1.23 2016/06/16 02:38:40 ozaki-r Exp $ */
+/*	$NetBSD: linux32_socket.c,v 1.24 2016/07/05 08:48:51 ozaki-r Exp $ */
 
 /*-
  * Copyright (c) 2006 Emmanuel Dreyfus, all rights reserved.
@@ -33,7 +33,7 @@
 
 #include 
 
-__KERNEL_RCSID(0, "$NetBSD: linux32_socket.c,v 1.23 2016/06/16 02:38:40 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux32_socket.c,v 1.24 2016/07/05 08:48:51 ozaki-r Exp $");
 
 #include 
 #include 
@@ -450,8 +450,7 @@ linux32_getifconf(struct lwp *l, registe
 			error = ENAMETOOLONG;
 			goto release_exit;
 		}
-		if (IFADDR_EMPTY(ifp))
-			continue;
+
 		IFADDR_FOREACH(ifa, ifp) {
 			sa = ifa->ifa_addr;
 			if (sa->sa_family != AF_INET ||



CVS commit: src/sys/compat/linux/common

2016-07-05 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Tue Jul  5 07:55:08 UTC 2016

Modified Files:
src/sys/compat/linux/common: linux_socket.c

Log Message:
Fix psref isn't released in a case of IFADDR_EMPTY


To generate a diff of this commit:
cvs rdiff -u -r1.129 -r1.130 src/sys/compat/linux/common/linux_socket.c

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

Modified files:

Index: src/sys/compat/linux/common/linux_socket.c
diff -u src/sys/compat/linux/common/linux_socket.c:1.129 src/sys/compat/linux/common/linux_socket.c:1.130
--- src/sys/compat/linux/common/linux_socket.c:1.129	Thu Jun 16 02:38:40 2016
+++ src/sys/compat/linux/common/linux_socket.c	Tue Jul  5 07:55:08 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux_socket.c,v 1.129 2016/06/16 02:38:40 ozaki-r Exp $	*/
+/*	$NetBSD: linux_socket.c,v 1.130 2016/07/05 07:55:08 ozaki-r Exp $	*/
 
 /*-
  * Copyright (c) 1995, 1998, 2008 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: linux_socket.c,v 1.129 2016/06/16 02:38:40 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_socket.c,v 1.130 2016/07/05 07:55:08 ozaki-r Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_inet.h"
@@ -1149,8 +1149,7 @@ linux_getifconf(struct lwp *l, register_
 			error = ENAMETOOLONG;
 			goto release_exit;
 		}
-		if (IFADDR_EMPTY(ifp))
-			continue;
+
 		IFADDR_FOREACH(ifa, ifp) {
 			sa = ifa->ifa_addr;
 			if (sa->sa_family != AF_INET ||



CVS commit: src/sys/net

2016-07-05 Thread Kengo NAKAHARA
Module Name:src
Committed By:   knakahara
Date:   Tue Jul  5 07:42:52 UTC 2016

Modified Files:
src/sys/net: if.c

Log Message:
fix evbsh3 build


To generate a diff of this commit:
cvs rdiff -u -r1.352 -r1.353 src/sys/net/if.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/net/if.c
diff -u src/sys/net/if.c:1.352 src/sys/net/if.c:1.353
--- src/sys/net/if.c:1.352	Mon Jul  4 04:35:09 2016
+++ src/sys/net/if.c	Tue Jul  5 07:42:51 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: if.c,v 1.352 2016/07/04 04:35:09 knakahara Exp $	*/
+/*	$NetBSD: if.c,v 1.353 2016/07/05 07:42:51 knakahara Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2008 The NetBSD Foundation, Inc.
@@ -90,7 +90,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.352 2016/07/04 04:35:09 knakahara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.353 2016/07/05 07:42:51 knakahara Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_inet.h"
@@ -262,7 +262,7 @@ ifinit(void)
 		sysctl_net_pktq_setup(NULL, PF_INET6);
 #endif
 
-#ifndef IPSEC
+#if (defined(INET) || defined(INET6)) && !defined(IPSEC)
 	encapinit();
 #endif
 



CVS commit: src/sys/netinet6

2016-07-05 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Tue Jul  5 06:32:18 UTC 2016

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

Log Message:
Constify an argument of regen_tmpaddr


To generate a diff of this commit:
cvs rdiff -u -r1.200 -r1.201 src/sys/netinet6/nd6.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/nd6.c
diff -u src/sys/netinet6/nd6.c:1.200 src/sys/netinet6/nd6.c:1.201
--- src/sys/netinet6/nd6.c:1.200	Tue Jul  5 04:25:23 2016
+++ src/sys/netinet6/nd6.c	Tue Jul  5 06:32:18 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: nd6.c,v 1.200 2016/07/05 04:25:23 ozaki-r Exp $	*/
+/*	$NetBSD: nd6.c,v 1.201 2016/07/05 06:32:18 ozaki-r Exp $	*/
 /*	$KAME: nd6.c,v 1.279 2002/06/08 11:16:51 itojun Exp $	*/
 
 /*
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: nd6.c,v 1.200 2016/07/05 04:25:23 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nd6.c,v 1.201 2016/07/05 06:32:18 ozaki-r Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -109,7 +109,7 @@ int nd6_recalc_reachtm_interval = ND6_RE
 
 static void nd6_setmtu0(struct ifnet *, struct nd_ifinfo *);
 static void nd6_slowtimo(void *);
-static int regen_tmpaddr(struct in6_ifaddr *);
+static int regen_tmpaddr(const struct in6_ifaddr *);
 static void nd6_free(struct llentry *, int);
 static void nd6_llinfo_timer(void *);
 static void nd6_timer(void *);
@@ -680,7 +680,7 @@ nd6_timer(void *ignored_arg)
 
 /* ia6: deprecated/invalidated temporary address */
 static int
-regen_tmpaddr(struct in6_ifaddr *ia6)
+regen_tmpaddr(const struct in6_ifaddr *ia6)
 {
 	struct ifaddr *ifa;
 	struct ifnet *ifp;