CVS commit: src/sys/netipsec

2017-04-17 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Tue Apr 18 05:26:42 UTC 2017

Modified Files:
src/sys/netipsec: ipsec.c ipsec_input.c ipsec_mbuf.c ipsec_output.c
key.c xform_ah.c xform_esp.c xform_ipcomp.c xform_ipip.c

Log Message:
Convert IPSEC_ASSERT to KASSERT or KASSERTMSG

IPSEC_ASSERT just discarded specified message...


To generate a diff of this commit:
cvs rdiff -u -r1.72 -r1.73 src/sys/netipsec/ipsec.c
cvs rdiff -u -r1.39 -r1.40 src/sys/netipsec/ipsec_input.c
cvs rdiff -u -r1.13 -r1.14 src/sys/netipsec/ipsec_mbuf.c
cvs rdiff -u -r1.43 -r1.44 src/sys/netipsec/ipsec_output.c
cvs rdiff -u -r1.107 -r1.108 src/sys/netipsec/key.c
cvs rdiff -u -r1.51 -r1.52 src/sys/netipsec/xform_ah.c
cvs rdiff -u -r1.52 -r1.53 src/sys/netipsec/xform_esp.c
cvs rdiff -u -r1.35 -r1.36 src/sys/netipsec/xform_ipcomp.c
cvs rdiff -u -r1.46 -r1.47 src/sys/netipsec/xform_ipip.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.72 src/sys/netipsec/ipsec.c:1.73
--- src/sys/netipsec/ipsec.c:1.72	Tue Apr 18 05:25:32 2017
+++ src/sys/netipsec/ipsec.c	Tue Apr 18 05:26:41 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: ipsec.c,v 1.72 2017/04/18 05:25:32 ozaki-r Exp $	*/
+/*	$NetBSD: ipsec.c,v 1.73 2017/04/18 05:26:41 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.72 2017/04/18 05:25:32 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ipsec.c,v 1.73 2017/04/18 05:26:41 ozaki-r Exp $");
 
 /*
  * IPsec controller part.
@@ -439,14 +439,14 @@ ipsec_getpolicy(const struct tdb_ident *
 {
 	struct secpolicy *sp;
 
-	IPSEC_ASSERT(tdbi != NULL, ("%s: null tdbi", __func__));
-	IPSEC_ASSERT(dir == IPSEC_DIR_INBOUND || dir == IPSEC_DIR_OUTBOUND,
-	("%s: invalid direction %u", __func__, dir));
+	KASSERT(tdbi != NULL);
+	KASSERTMSG(dir == IPSEC_DIR_INBOUND || dir == IPSEC_DIR_OUTBOUND,
+	"invalid direction %u", dir);
 
 	sp = KEY_ALLOCSP2(tdbi->spi, >dst, tdbi->proto, dir);
 	if (sp == NULL)			/*XXX*/
 		sp = KEY_ALLOCSP_DEFAULT(tdbi->dst.sa.sa_family);
-	IPSEC_ASSERT(sp != NULL, ("%s: null SP", __func__));
+	KASSERT(sp != NULL);
 	return sp;
 }
 
@@ -470,20 +470,20 @@ ipsec_getpolicybysock(struct mbuf *m, u_
 	struct secpolicy *sp;
 	int af;
 
-	IPSEC_ASSERT(m != NULL, ("%s: null mbuf", __func__));
-	IPSEC_ASSERT(inp != NULL, ("%s: null inpcb", __func__));
-	IPSEC_ASSERT(error != NULL, ("%s: null error", __func__));
-	IPSEC_ASSERT(dir == IPSEC_DIR_INBOUND || dir == IPSEC_DIR_OUTBOUND,
-	("%s: invalid direction %u", __func__, dir));
+	KASSERT(m != NULL);
+	KASSERT(inp != NULL);
+	KASSERT(error != NULL);
+	KASSERTMSG(dir == IPSEC_DIR_INBOUND || dir == IPSEC_DIR_OUTBOUND,
+	"invalid direction %u", dir);
 
-	IPSEC_ASSERT(PCB_SOCKET(inp) != NULL, ("%s: null socket", __func__));
+	KASSERT(PCB_SOCKET(inp) != NULL);
 
 	/* XXX FIXME inpcb/in6pcb  vs socket*/
 	af = PCB_FAMILY(inp);
-	IPSEC_ASSERT(af == AF_INET || af == AF_INET6,
-	("%s: unexpected protocol family %u", __func__, af));
+	KASSERTMSG(af == AF_INET || af == AF_INET6,
+	"unexpected protocol family %u", af);
 
-	IPSEC_ASSERT(inp->inph_sp != NULL, ("null PCB policy cache"));
+	KASSERT(inp->inph_sp != NULL);
 	/* If we have a cached entry, and if it is still valid, use it. */
 	IPSEC_STATINC(IPSEC_STAT_SPDCACHELOOKUP);
 	currsp = ipsec_checkpcbcache(m, /*inpcb_hdr*/inp->inph_sp, dir);
@@ -518,7 +518,7 @@ ipsec_getpolicybysock(struct mbuf *m, u_
 	if (*error)
 		return NULL;
 
-	IPSEC_ASSERT(pcbsp != NULL, ("%s: null pcbsp", __func__));
+	KASSERT(pcbsp != NULL);
 	switch (dir) {
 	case IPSEC_DIR_INBOUND:
 		currsp = pcbsp->sp_in;
@@ -527,7 +527,7 @@ ipsec_getpolicybysock(struct mbuf *m, u_
 		currsp = pcbsp->sp_out;
 		break;
 	}
-	IPSEC_ASSERT(currsp != NULL, ("%s: null currsp", __func__));
+	KASSERT(currsp != NULL);
 
 	if (pcbsp->priv) {			/* when privilieged socket */
 		switch (currsp->policy) {
@@ -578,9 +578,8 @@ ipsec_getpolicybysock(struct mbuf *m, u_
 			}
 		}
 	}
-	IPSEC_ASSERT(sp != NULL,
-	("%s: null SP (priv %u policy %u", __func__, pcbsp->priv,
-	currsp->policy));
+	KASSERTMSG(sp != NULL, "null SP (priv %u policy %u", pcbsp->priv,
+	currsp->policy);
 	KEYDEBUG(KEYDEBUG_IPSEC_STAMP,
 	printf("DP %s (priv %u policy %u) allocates SP:%p (refcnt %u)\n",
 	__func__, pcbsp->priv, currsp->policy, sp, sp->refcnt));
@@ -604,10 +603,10 @@ ipsec_getpolicybyaddr(struct mbuf *m, u_
 	struct secpolicyindex spidx;
 	struct secpolicy *sp;
 
-	IPSEC_ASSERT(m != NULL, ("%s: null mbuf", __func__));
-	IPSEC_ASSERT(error != NULL, ("%s: null error", __func__));
-	IPSEC_ASSERT(dir == IPSEC_DIR_INBOUND || dir == IPSEC_DIR_OUTBOUND,
-	("%s: invalid direction %u", __func__, 

CVS commit: src/sys/netipsec

2017-04-17 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Tue Apr 18 05:26:42 UTC 2017

Modified Files:
src/sys/netipsec: ipsec.c ipsec_input.c ipsec_mbuf.c ipsec_output.c
key.c xform_ah.c xform_esp.c xform_ipcomp.c xform_ipip.c

Log Message:
Convert IPSEC_ASSERT to KASSERT or KASSERTMSG

IPSEC_ASSERT just discarded specified message...


To generate a diff of this commit:
cvs rdiff -u -r1.72 -r1.73 src/sys/netipsec/ipsec.c
cvs rdiff -u -r1.39 -r1.40 src/sys/netipsec/ipsec_input.c
cvs rdiff -u -r1.13 -r1.14 src/sys/netipsec/ipsec_mbuf.c
cvs rdiff -u -r1.43 -r1.44 src/sys/netipsec/ipsec_output.c
cvs rdiff -u -r1.107 -r1.108 src/sys/netipsec/key.c
cvs rdiff -u -r1.51 -r1.52 src/sys/netipsec/xform_ah.c
cvs rdiff -u -r1.52 -r1.53 src/sys/netipsec/xform_esp.c
cvs rdiff -u -r1.35 -r1.36 src/sys/netipsec/xform_ipcomp.c
cvs rdiff -u -r1.46 -r1.47 src/sys/netipsec/xform_ipip.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-04-17 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Tue Apr 18 05:25:32 UTC 2017

Modified Files:
src/sys/netipsec: ipsec.c ipsec.h ipsec6.h ipsec_input.c ipsec_mbuf.c
ipsec_output.c key.c key_debug.c xform_ah.c xform_esp.c
xform_ipcomp.c xform_ipip.c xform_tcp.c

Log Message:
Remove __FreeBSD__ and __NetBSD__ switches

No functional changes (except for a debug printf).

Note that there remain some __FreeBSD__ for sysctl knobs which counerparts
to NetBSD don't exist. And ipsec_osdep.h isn't touched yet; tidying it up
requires actual code changes.


To generate a diff of this commit:
cvs rdiff -u -r1.71 -r1.72 src/sys/netipsec/ipsec.c
cvs rdiff -u -r1.39 -r1.40 src/sys/netipsec/ipsec.h
cvs rdiff -u -r1.15 -r1.16 src/sys/netipsec/ipsec6.h
cvs rdiff -u -r1.38 -r1.39 src/sys/netipsec/ipsec_input.c
cvs rdiff -u -r1.12 -r1.13 src/sys/netipsec/ipsec_mbuf.c
cvs rdiff -u -r1.42 -r1.43 src/sys/netipsec/ipsec_output.c
cvs rdiff -u -r1.106 -r1.107 src/sys/netipsec/key.c
cvs rdiff -u -r1.14 -r1.15 src/sys/netipsec/key_debug.c
cvs rdiff -u -r1.50 -r1.51 src/sys/netipsec/xform_ah.c
cvs rdiff -u -r1.51 -r1.52 src/sys/netipsec/xform_esp.c
cvs rdiff -u -r1.34 -r1.35 src/sys/netipsec/xform_ipcomp.c
cvs rdiff -u -r1.45 -r1.46 src/sys/netipsec/xform_ipip.c
cvs rdiff -u -r1.9 -r1.10 src/sys/netipsec/xform_tcp.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-04-17 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Tue Apr 18 05:25:32 UTC 2017

Modified Files:
src/sys/netipsec: ipsec.c ipsec.h ipsec6.h ipsec_input.c ipsec_mbuf.c
ipsec_output.c key.c key_debug.c xform_ah.c xform_esp.c
xform_ipcomp.c xform_ipip.c xform_tcp.c

Log Message:
Remove __FreeBSD__ and __NetBSD__ switches

No functional changes (except for a debug printf).

Note that there remain some __FreeBSD__ for sysctl knobs which counerparts
to NetBSD don't exist. And ipsec_osdep.h isn't touched yet; tidying it up
requires actual code changes.


To generate a diff of this commit:
cvs rdiff -u -r1.71 -r1.72 src/sys/netipsec/ipsec.c
cvs rdiff -u -r1.39 -r1.40 src/sys/netipsec/ipsec.h
cvs rdiff -u -r1.15 -r1.16 src/sys/netipsec/ipsec6.h
cvs rdiff -u -r1.38 -r1.39 src/sys/netipsec/ipsec_input.c
cvs rdiff -u -r1.12 -r1.13 src/sys/netipsec/ipsec_mbuf.c
cvs rdiff -u -r1.42 -r1.43 src/sys/netipsec/ipsec_output.c
cvs rdiff -u -r1.106 -r1.107 src/sys/netipsec/key.c
cvs rdiff -u -r1.14 -r1.15 src/sys/netipsec/key_debug.c
cvs rdiff -u -r1.50 -r1.51 src/sys/netipsec/xform_ah.c
cvs rdiff -u -r1.51 -r1.52 src/sys/netipsec/xform_esp.c
cvs rdiff -u -r1.34 -r1.35 src/sys/netipsec/xform_ipcomp.c
cvs rdiff -u -r1.45 -r1.46 src/sys/netipsec/xform_ipip.c
cvs rdiff -u -r1.9 -r1.10 src/sys/netipsec/xform_tcp.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.71 src/sys/netipsec/ipsec.c:1.72
--- src/sys/netipsec/ipsec.c:1.71	Thu Apr  6 09:20:07 2017
+++ src/sys/netipsec/ipsec.c	Tue Apr 18 05:25:32 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: ipsec.c,v 1.71 2017/04/06 09:20:07 ozaki-r Exp $	*/
+/*	$NetBSD: ipsec.c,v 1.72 2017/04/18 05:25:32 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.71 2017/04/06 09:20:07 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ipsec.c,v 1.72 2017/04/18 05:25:32 ozaki-r Exp $");
 
 /*
  * IPsec controller part.
@@ -40,9 +40,6 @@ __KERNEL_RCSID(0, "$NetBSD: ipsec.c,v 1.
 
 #if defined(_KERNEL_OPT)
 #include "opt_inet.h"
-#ifdef __FreeBSD__
-#include "opt_inet6.h"
-#endif
 #include "opt_ipsec.h"
 #endif
 
@@ -140,7 +137,6 @@ struct secpolicy ip4_def_policy;
 int ip4_ipsec_ecn = 0;		/* ECN ignore(-1)/forbidden(0)/allowed(1) */
 int ip4_esp_randpad = -1;
 
-#ifdef __NetBSD__
 u_int ipsec_spdgen = 1;		/* SPD generation # */
 
 static struct secpolicy *ipsec_checkpcbcache (struct mbuf *,
@@ -148,7 +144,6 @@ static struct secpolicy *ipsec_checkpcbc
 static int ipsec_fillpcbcache (struct inpcbpolicy *, struct mbuf *,
 	struct secpolicy *, int);
 static int ipsec_invalpcbcache (struct inpcbpolicy *, int);
-#endif /* __NetBSD__ */
 
 /*
  * Crypto support requirements:
@@ -163,35 +158,11 @@ static struct secpolicy *ipsec_getpolicy
 	PCB_T *, int *);
 
 #ifdef __FreeBSD__
-SYSCTL_DECL(_net_inet_ipsec);
-
 /* net.inet.ipsec */
-SYSCTL_INT(_net_inet_ipsec, IPSECCTL_DEF_POLICY,
-	def_policy, CTLFLAG_RW,	_def_policy.policy,	0, "");
-SYSCTL_INT(_net_inet_ipsec, IPSECCTL_DEF_ESP_TRANSLEV, esp_trans_deflev,
-	CTLFLAG_RW, _esp_trans_deflev,	0, "");
-SYSCTL_INT(_net_inet_ipsec, IPSECCTL_DEF_ESP_NETLEV, esp_net_deflev,
-	CTLFLAG_RW, _esp_net_deflev,	0, "");
-SYSCTL_INT(_net_inet_ipsec, IPSECCTL_DEF_AH_TRANSLEV, ah_trans_deflev,
-	CTLFLAG_RW, _ah_trans_deflev,	0, "");
-SYSCTL_INT(_net_inet_ipsec, IPSECCTL_DEF_AH_NETLEV, ah_net_deflev,
-	CTLFLAG_RW, _ah_net_deflev,	0, "");
-SYSCTL_INT(_net_inet_ipsec, IPSECCTL_AH_CLEARTOS,
-	ah_cleartos, CTLFLAG_RW,	_ah_cleartos,	0, "");
-SYSCTL_INT(_net_inet_ipsec, IPSECCTL_AH_OFFSETMASK,
-	ah_offsetmask, CTLFLAG_RW,	_ah_offsetmask,	0, "");
-SYSCTL_INT(_net_inet_ipsec, IPSECCTL_DFBIT,
-	dfbit, CTLFLAG_RW,	_ipsec_dfbit,	0, "");
-SYSCTL_INT(_net_inet_ipsec, IPSECCTL_ECN,
-	ecn, CTLFLAG_RW,	_ipsec_ecn,	0, "");
-SYSCTL_INT(_net_inet_ipsec, IPSECCTL_DEBUG,
-	debug, CTLFLAG_RW,	_debug,	0, "");
 SYSCTL_INT(_net_inet_ipsec, IPSECCTL_ESP_RANDPAD,
 	esp_randpad, CTLFLAG_RW,	_esp_randpad,	0, "");
 SYSCTL_INT(_net_inet_ipsec, OID_AUTO,
 	crypto_support,	CTLFLAG_RW,	_support,0, "");
-SYSCTL_STRUCT(_net_inet_ipsec, OID_AUTO,
-	ipsecstats,	CTLFLAG_RD,	,	newipsecstat, "");
 SYSCTL_INT(_net_inet_ipsec, OID_AUTO, test_replay, CTLFLAG_RW, _replay, 0,
 	"Emulate replay attack");
 SYSCTL_INT(_net_inet_ipsec, OID_AUTO, test_integrity, CTLFLAG_RW,
@@ -209,27 +180,7 @@ int ip6_esp_randpad = -1;
 
 
 #ifdef __FreeBSD__
-SYSCTL_DECL(_net_inet6_ipsec6);
-
 /* net.inet6.ipsec6 */
-#ifdef COMPAT_KAME
-SYSCTL_OID(_net_inet6_ipsec6, IPSECCTL_STATS, stats, CTLFLAG_RD,
-	0,0, compat_ipsecstats_sysctl, "S", "");
-#endif /* COMPAT_KAME */
-SYSCTL_INT(_net_inet6_ipsec6, IPSECCTL_DEF_POLICY,
-	def_policy, CTLFLAG_RW,	

CVS commit: src/sys/dev/pci

2017-04-17 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Apr 18 05:21:34 UTC 2017

Modified Files:
src/sys/dev/pci: ppb.c ppbvar.h

Log Message:
 Enable PCIe's interrupt as much as possilbe in ppb(4) to detect and count
status change event. HotPlug function itself have not implemented yet.

 - Interrupt and each event are counted by evcnt(9). Example:

   ppb0 Interrupt00 intr
   ppb0 Attention Button Pressed 00 misc
   ppb0 Power Fault Detected 00 misc
   ppb0 MRL Sensor Changed   00 misc
   ppb0 Presence Detect Changed  00 misc
   ppb0 Command Completed00 misc
   ppb0 Data Link Layer State Changed00 misc

 - Print message if ppb_printevent is not zero. The default vaule is 0.
   The output messages:

   Attention Button Pressed
   Power Fault Detected
   MRL Sensor Changed
   Presence Detect Changed
   Command Completed
   Data Link Layer State Changed

 - Remove workaround code to disable interrupt (ppb.c rev. 1.35).

 Tested with Dell Latitude 2120 without if_bge.c rev. 1.304's workaround.
dmesg when bge's device timeout occured:

   ppb3: Presence Detect Changed
   ppb3: Data Link Layer State Changed
   ppb3: Presence Detect Changed

vmstat -e |grep ppb

   ppb3 Interrupt 20 intr
   ppb3 Presence Detect Changed   20 misc
   ppb3 Data Link Layer State Changed 10 misc


To generate a diff of this commit:
cvs rdiff -u -r1.56 -r1.57 src/sys/dev/pci/ppb.c
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/pci/ppbvar.h

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



CVS commit: src/sys/dev/pci

2017-04-17 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Apr 18 05:21:34 UTC 2017

Modified Files:
src/sys/dev/pci: ppb.c ppbvar.h

Log Message:
 Enable PCIe's interrupt as much as possilbe in ppb(4) to detect and count
status change event. HotPlug function itself have not implemented yet.

 - Interrupt and each event are counted by evcnt(9). Example:

   ppb0 Interrupt00 intr
   ppb0 Attention Button Pressed 00 misc
   ppb0 Power Fault Detected 00 misc
   ppb0 MRL Sensor Changed   00 misc
   ppb0 Presence Detect Changed  00 misc
   ppb0 Command Completed00 misc
   ppb0 Data Link Layer State Changed00 misc

 - Print message if ppb_printevent is not zero. The default vaule is 0.
   The output messages:

   Attention Button Pressed
   Power Fault Detected
   MRL Sensor Changed
   Presence Detect Changed
   Command Completed
   Data Link Layer State Changed

 - Remove workaround code to disable interrupt (ppb.c rev. 1.35).

 Tested with Dell Latitude 2120 without if_bge.c rev. 1.304's workaround.
dmesg when bge's device timeout occured:

   ppb3: Presence Detect Changed
   ppb3: Data Link Layer State Changed
   ppb3: Presence Detect Changed

vmstat -e |grep ppb

   ppb3 Interrupt 20 intr
   ppb3 Presence Detect Changed   20 misc
   ppb3 Data Link Layer State Changed 10 misc


To generate a diff of this commit:
cvs rdiff -u -r1.56 -r1.57 src/sys/dev/pci/ppb.c
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/pci/ppbvar.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/pci/ppb.c
diff -u src/sys/dev/pci/ppb.c:1.56 src/sys/dev/pci/ppb.c:1.57
--- src/sys/dev/pci/ppb.c:1.56	Wed Apr  5 03:51:36 2017
+++ src/sys/dev/pci/ppb.c	Tue Apr 18 05:21:34 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: ppb.c,v 1.56 2017/04/05 03:51:36 msaitoh Exp $	*/
+/*	$NetBSD: ppb.c,v 1.57 2017/04/18 05:21:34 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 1996, 1998 Christopher G. Demetriou.  All rights reserved.
@@ -31,12 +31,13 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ppb.c,v 1.56 2017/04/05 03:51:36 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ppb.c,v 1.57 2017/04/18 05:21:34 msaitoh Exp $");
 
 #include 
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -52,8 +53,19 @@ static const char pcie_linkspeed_strings
 	"1.25", "2.5", "5.0", "8.0",
 };
 
-static bool		ppb_resume(device_t, const pmf_qual_t *);
-static bool		ppb_suspend(device_t, const pmf_qual_t *);
+int	ppb_printevent = 0; /* Print event type if the value is not 0 */
+
+static int	ppbmatch(device_t, cfdata_t, void *);
+static void	ppbattach(device_t, device_t, void *);
+static int	ppbdetach(device_t, int);
+static void	ppbchilddet(device_t, device_t);
+static int	ppb_intr(void *);
+static bool	ppb_resume(device_t, const pmf_qual_t *);
+static bool	ppb_suspend(device_t, const pmf_qual_t *);
+
+CFATTACH_DECL3_NEW(ppb, sizeof(struct ppb_softc),
+ppbmatch, ppbattach, ppbdetach, NULL, NULL, ppbchilddet,
+DVF_DETACH_SHUTDOWN);
 
 static int
 ppbmatch(device_t parent, cfdata_t match, void *aux)
@@ -91,7 +103,7 @@ ppbmatch(device_t parent, cfdata_t match
 }
 
 static void
-ppb_fix_pcie(device_t self)
+ppb_print_pcie(device_t self)
 {
 	struct ppb_softc *sc = device_private(self);
 	pcireg_t reg;
@@ -181,14 +193,6 @@ ppb_fix_pcie(device_t self)
 		aprint_normal(">\n");
 		break;
 	}
-
-	reg = pci_conf_read(sc->sc_pc, sc->sc_tag, off + PCIE_SLCSR);
-	if (reg & PCIE_SLCSR_NOTIFY_MASK) {
-		aprint_debug_dev(self, "disabling notification events\n");
-		reg &= ~PCIE_SLCSR_NOTIFY_MASK;
-		pci_conf_write(sc->sc_pc, sc->sc_tag,
-		off + PCIE_SLCSR, reg);
-	}
 }
 
 static void
@@ -198,7 +202,9 @@ ppbattach(device_t parent, device_t self
 	struct pci_attach_args *pa = aux;
 	pci_chipset_tag_t pc = pa->pa_pc;
 	struct pcibus_attach_args pba;
-	pcireg_t busdata;
+	char const *intrstr;
+	char intrbuf[PCI_INTRSTR_LEN];
+	pcireg_t busdata, reg;
 
 	pci_aprint_devinfo(pa, NULL);
 
@@ -213,7 +219,7 @@ ppbattach(device_t parent, device_t self
 		return;
 	}
 
-	ppb_fix_pcie(self);
+	ppb_print_pcie(self);
 
 #if 0
 	/*
@@ -227,6 +233,78 @@ ppbattach(device_t parent, device_t self
 		pa->pa_bus, PPB_BUSINFO_PRIMARY(busdata));
 #endif
 
+	/* Check for PCI Express capabilities and setup hotplug support. */
+	if (pci_get_capability(pc, pa->pa_tag, PCI_CAP_PCIEXPRESS,
+	>sc_pciecapoff, ) && (reg & PCIE_XCAP_SI)) {
+#if 0
+		/*
+		 * XXX Initialize workqueue or something else for
+		 * HotPlug support.
+		 */
+#endif
+
+		if (pci_intr_alloc(pa, >sc_pihp, NULL, 0) == 0)
+			sc->sc_intrhand = 

CVS commit: src/external/bsd/bc/dist

2017-04-17 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Tue Apr 18 04:35:18 UTC 2017

Modified Files:
src/external/bsd/bc/dist: execute.c main.c util.c

Log Message:
Remove dummy breaks and returns after bc_exit
bc_exit being marked nonreturn silences compiler warnings.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/external/bsd/bc/dist/execute.c \
src/external/bsd/bc/dist/main.c src/external/bsd/bc/dist/util.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/bc/dist/execute.c
diff -u src/external/bsd/bc/dist/execute.c:1.1 src/external/bsd/bc/dist/execute.c:1.2
--- src/external/bsd/bc/dist/execute.c:1.1	Mon Apr 10 02:28:23 2017
+++ src/external/bsd/bc/dist/execute.c	Tue Apr 18 04:35:18 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: execute.c,v 1.1 2017/04/10 02:28:23 phil Exp $ */
+/*	$NetBSD: execute.c,v 1.2 2017/04/18 04:35:18 maya Exp $ */
 
 /*
  * Copyright (C) 1991-1994, 1997, 2006, 2008, 2012-2017 Free Software Foundation, Inc.
@@ -313,8 +313,7 @@ execute (void)
   
   case 'h' : /* Halt the machine. */
 	bc_exit (0);
-/* NOTREACHED */
-break;
+	/* NOTREACHED */
 
   case 'i' : /* increment number */
 	var_name = byte();
Index: src/external/bsd/bc/dist/main.c
diff -u src/external/bsd/bc/dist/main.c:1.1 src/external/bsd/bc/dist/main.c:1.2
--- src/external/bsd/bc/dist/main.c:1.1	Mon Apr 10 02:28:23 2017
+++ src/external/bsd/bc/dist/main.c	Tue Apr 18 04:35:18 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.1 2017/04/10 02:28:23 phil Exp $ */
+/*	$NetBSD: main.c,v 1.2 2017/04/18 04:35:18 maya Exp $ */
 
 /*
  * Copyright (C) 1991-1994, 1997, 2006, 2008, 2012-2017 Free Software Foundation, Inc.
@@ -113,7 +113,7 @@ parse_args (int argc, char **argv)
 	case 'h':  /* help */
 	  usage(argv[0]);
 	  bc_exit (0);
-	  break;
+	  /* NOTREACHED */
 
 	case 'i':  /* force interactive */
 	  interactive = TRUE;
@@ -134,7 +134,7 @@ parse_args (int argc, char **argv)
 	case 'v':  /* Print the version. */
 	  show_bc_version ();
 	  bc_exit (0);
-	  break;
+	  /* NOTREACHED */
 
 	case 'w':  /* Non standard features give warnings. */
 	  warn_not_std = TRUE;
@@ -270,7 +270,6 @@ main (int argc, char **argv)
 printf ("\n");
 
   bc_exit (0);
-  return 0; // to keep the compiler from complaining
 }
 
 
Index: src/external/bsd/bc/dist/util.c
diff -u src/external/bsd/bc/dist/util.c:1.1 src/external/bsd/bc/dist/util.c:1.2
--- src/external/bsd/bc/dist/util.c:1.1	Mon Apr 10 02:28:23 2017
+++ src/external/bsd/bc/dist/util.c	Tue Apr 18 04:35:18 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: util.c,v 1.1 2017/04/10 02:28:23 phil Exp $ */
+/*	$NetBSD: util.c,v 1.2 2017/04/18 04:35:18 maya Exp $ */
 
 /*
  * Copyright (C) 1991-1994, 1997, 2006, 2008, 2012-2017 Free Software Foundation, Inc.
@@ -628,7 +628,6 @@ lookup (char *name, int  namekind)
   yyerror ("End of util.c/lookup() reached.  Please report this bug.");
   bc_exit (1);
   /*NOTREACHED*/
-  return 0;
 }
 
 /* Print out the limits of this program. */



CVS commit: src/external/bsd/bc/dist

2017-04-17 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Tue Apr 18 04:35:18 UTC 2017

Modified Files:
src/external/bsd/bc/dist: execute.c main.c util.c

Log Message:
Remove dummy breaks and returns after bc_exit
bc_exit being marked nonreturn silences compiler warnings.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/external/bsd/bc/dist/execute.c \
src/external/bsd/bc/dist/main.c src/external/bsd/bc/dist/util.c

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



Re: CVS commit: src/sys/lib/libsa

2017-04-17 Thread Kimihiro Nonaka
On Tue, Apr 18, 2017 at 3:26 AM, Valery Ushakov  wrote:

> What is really intended here?  Do we need shstr set so that we can
> test for ".SUNW_ctf" section name later?

That's right.

Regards,
-- 
Kimihiro Nonaka


CVS commit: src/crypto/external/bsd/netpgp/lib/verify

2017-04-17 Thread Alistair G. Crooks
Module Name:src
Committed By:   agc
Date:   Mon Apr 17 23:38:51 UTC 2017

Modified Files:
src/crypto/external/bsd/netpgp/lib/verify: shlib_version

Log Message:
libnetpgpverify major bump to 5


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 \
src/crypto/external/bsd/netpgp/lib/verify/shlib_version

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



CVS commit: src/crypto/external/bsd/netpgp/lib/verify

2017-04-17 Thread Alistair G. Crooks
Module Name:src
Committed By:   agc
Date:   Mon Apr 17 23:38:51 UTC 2017

Modified Files:
src/crypto/external/bsd/netpgp/lib/verify: shlib_version

Log Message:
libnetpgpverify major bump to 5


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 \
src/crypto/external/bsd/netpgp/lib/verify/shlib_version

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

Modified files:

Index: src/crypto/external/bsd/netpgp/lib/verify/shlib_version
diff -u src/crypto/external/bsd/netpgp/lib/verify/shlib_version:1.2 src/crypto/external/bsd/netpgp/lib/verify/shlib_version:1.3
--- src/crypto/external/bsd/netpgp/lib/verify/shlib_version:1.2	Tue Nov 20 05:26:26 2012
+++ src/crypto/external/bsd/netpgp/lib/verify/shlib_version	Mon Apr 17 23:38:51 2017
@@ -1,2 +1,2 @@
-major=4
+major=5
 minor=0



CVS commit: src

2017-04-17 Thread Nathanial Sloss
Module Name:src
Committed By:   nat
Date:   Mon Apr 17 22:40:06 UTC 2017

Modified Files:
src/share/man/man4: audio.4
src/sys/dev: audio.c audiovar.h

Log Message:
Improved mixing function - more expensive in cycles though.
hw.driverN.saturate is no longer needed and has been removed.

Mixing function thanks to jmcneill@.


To generate a diff of this commit:
cvs rdiff -u -r1.77 -r1.78 src/share/man/man4/audio.4
cvs rdiff -u -r1.325 -r1.326 src/sys/dev/audio.c
cvs rdiff -u -r1.52 -r1.53 src/sys/dev/audiovar.h

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/audio.4
diff -u src/share/man/man4/audio.4:1.77 src/share/man/man4/audio.4:1.78
--- src/share/man/man4/audio.4:1.77	Mon Apr 17 20:17:08 2017
+++ src/share/man/man4/audio.4	Mon Apr 17 22:40:06 2017
@@ -1,4 +1,4 @@
-.\"	$NetBSD: audio.4,v 1.77 2017/04/17 20:17:08 nat Exp $
+.\"	$NetBSD: audio.4,v 1.78 2017/04/17 22:40:06 nat Exp $
 .\"
 .\" Copyright (c) 1996 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -112,7 +112,6 @@ variables.
 .It hw.driverN.precision
 .It hw.driverN.frequency
 .It hw.driverN.channels
-.It hw.driverN.saturate
 .It hw.driverN.multiuser
 .El
 .Pp
@@ -127,20 +126,6 @@ These variables may only be changed when
 .Pp
 An additional
 .Xr sysctl 8
-variable controls how the samples are combined, hw.driverN.saturate.
-.Pp
-By default is set to 16.
-This means that volumes are not adjusted for the first 16 channels to be mixed.
-All virtual channels will use the
-.Em maximum
-set master volume unless the virtual channel volume is lowered by the user.
-.Pp
-If a greater number of channels are opened all channels are
-.Em divided
-evenly in volume with respect to the master volume.
-.Pp
-An additional
-.Xr sysctl 8
 variable determines if multiple users are allowed to access the sampling
 device, hw.driverN.multiuser.
 .Pp

Index: src/sys/dev/audio.c
diff -u src/sys/dev/audio.c:1.325 src/sys/dev/audio.c:1.326
--- src/sys/dev/audio.c:1.325	Mon Apr 17 20:17:08 2017
+++ src/sys/dev/audio.c	Mon Apr 17 22:40:06 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: audio.c,v 1.325 2017/04/17 20:17:08 nat Exp $	*/
+/*	$NetBSD: audio.c,v 1.326 2017/04/17 22:40:06 nat Exp $	*/
 
 /*-
  * Copyright (c) 2016 Nathanial Sloss 
@@ -148,7 +148,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.325 2017/04/17 20:17:08 nat Exp $");
+__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.326 2017/04/17 22:40:06 nat Exp $");
 
 #include "audio.h"
 #if NAUDIO > 0
@@ -257,7 +257,6 @@ void	audio_play_thread(void *);
 void	audio_rec_thread(void *);
 void	recswvol_func(struct audio_softc *, struct audio_ringbuffer *,
 		  size_t, struct virtual_channel *);
-void	saturate_func(struct audio_softc *);
 void	mix_func(struct audio_softc *, struct audio_ringbuffer *,
 		 struct virtual_channel *);
 void	mix_write(void *);
@@ -641,7 +640,6 @@ bad_rec:
 	}
 
 	sc->sc_lastgain = 128;
-	sc->sc_saturate = 16;
 	sc->sc_multiuser = false;
 	mutex_exit(sc->sc_lock);
 
@@ -837,15 +835,6 @@ bad_rec:
 
 		sysctl_createv(>sc_log, 0, NULL, NULL,
 			CTLFLAG_READWRITE,
-			CTLTYPE_INT, "saturate",
-			SYSCTL_DESCR("saturate to max. volume this many channels"),
-			NULL, 0,
-			>sc_saturate, 0,
-			CTL_HW, node->sysctl_num,
-			CTL_CREATE, CTL_EOL);
-
-		sysctl_createv(>sc_log, 0, NULL, NULL,
-			CTLFLAG_READWRITE,
 			CTLTYPE_BOOL, "multiuser",
 			SYSCTL_DESCR("allow multiple user acess"),
 			NULL, 0,
@@ -3786,8 +3775,6 @@ audio_mix(void *v)
 sc->schedule_rih = true;
 	}
 	mutex_enter(sc->sc_intr_lock);
-	if (sc->sc_opens < sc->sc_saturate && sc->sc_opens > 1)
-		saturate_func(sc);
 
 	vc = SIMPLEQ_FIRST(>sc_audiochan)->vc;
 	cb = >sc_pr;
@@ -5557,12 +5544,14 @@ mix_write(void *arg)
 	}
 }
 
-#define DEF_MIX_FUNC(name, type)	\
+#define DEF_MIX_FUNC(name, type, MINVAL, MAXVAL)		\
 	static void		\
 	mix_func##name(struct audio_softc *sc, struct audio_ringbuffer *cb, \
 		  struct virtual_channel *vc)\
 	{\
 		int blksize, cc, cc1, cc2, m, resid;			\
+		int64_t product;	\
+		int64_t result;		\
 		type *orig, *tomix;	\
 	\
 		blksize = sc->sc_pr.blksize;\
@@ -5581,9 +5570,15 @@ mix_write(void *arg)
 cc = cc2;\
 	\
 			for (m = 0; m < (cc / (name / 8)); m++) {	\
-orig[m] += (type)((int32_t)(tomix[m] *	\
-(vc->sc_swvol + 1)) / (sc->sc_opens * \
-256));\
+tomix[m] = tomix[m] *			\
+(int32_t)(vc->sc_swvol) / 255;	\
+result = orig[m] + tomix[m];		\
+product = orig[m] * tomix[m];		\
+if (orig[m] > 0 && tomix[m] > 0)	\
+	result -= product / MAXVAL;	\
+else if (orig[m] < 0 && tomix[m] < 0)	\
+	result -= product / MINVAL;	\
+orig[m] = result;			\
 			}		\
 	\
 			if ([m] >= (type *)sc->sc_pr.s.end)	\
@@ -5595,9 +5590,9 @@ mix_write(void *arg)
 		}			\
 	}\
 
-DEF_MIX_FUNC(8, int8_t);

CVS commit: src

2017-04-17 Thread Nathanial Sloss
Module Name:src
Committed By:   nat
Date:   Mon Apr 17 22:40:06 UTC 2017

Modified Files:
src/share/man/man4: audio.4
src/sys/dev: audio.c audiovar.h

Log Message:
Improved mixing function - more expensive in cycles though.
hw.driverN.saturate is no longer needed and has been removed.

Mixing function thanks to jmcneill@.


To generate a diff of this commit:
cvs rdiff -u -r1.77 -r1.78 src/share/man/man4/audio.4
cvs rdiff -u -r1.325 -r1.326 src/sys/dev/audio.c
cvs rdiff -u -r1.52 -r1.53 src/sys/dev/audiovar.h

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



Re: CVS commit: src/sys/arch

2017-04-17 Thread Pierre Pronchery

On 17/04/2017 11:41, Manuel Bouyer wrote:

On Mon, Apr 17, 2017 at 07:19:28AM +, Maya Rashish wrote:

Module Name:src
Committed By:   maya
Date:   Mon Apr 17 07:19:28 UTC 2017

Modified Files:
src/sys/arch/amd64/conf: XEN3_DOM0
src/sys/arch/i386/conf: XEN3_DOM0

Log Message:
Uncomment MULTIPROCESSOR in dom0 kernels


Are you sure it's OK ?
It's not clear if the backend drivers, and especially the xenstore,
event channels and grant table stuff, are MP safe (I'm almost sure they
are not). There's still some splfoo()/splx() use there.
At minimum we should KASSERT() that the kernel lock is held here.


I've been using this for > 4 months without a single crash. I know it is 
not definite proof it is actually fine, but it sure works great on my 
laptop here: Lenovo ThinkPad T440s with pkgsrc 2016Q1 (with security 
patches) on netbsd-7 and Xen 4.5, with instances of Linux, FreeBSD and 
OpenBSD as DOMU.


The only concern I could observe was some lost keyboard interrupts under 
heavy CPU load - but it may not even be related.


Cheers,
--
khorben



CVS commit: [bouyer-socketcan] src

2017-04-17 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Mon Apr 17 20:48:36 UTC 2017

Modified Files:
src/distrib/sets/lists/base [bouyer-socketcan]: mi
src/distrib/sets/lists/debug [bouyer-socketcan]: mi
src/distrib/sets/lists/man [bouyer-socketcan]: mi
src/sbin [bouyer-socketcan]: Makefile
Added Files:
src/sbin/canconfig [bouyer-socketcan]: Makefile canconfig.8 canconfig.c

Log Message:
Add canconfig(8), an utility to configure CAN interfaces.
Compile-tested only.


To generate a diff of this commit:
cvs rdiff -u -r1.1150.2.1 -r1.1150.2.2 src/distrib/sets/lists/base/mi
cvs rdiff -u -r1.191.2.1 -r1.191.2.2 src/distrib/sets/lists/debug/mi
cvs rdiff -u -r1.1545 -r1.1545.2.1 src/distrib/sets/lists/man/mi
cvs rdiff -u -r1.129 -r1.129.4.1 src/sbin/Makefile
cvs rdiff -u -r0 -r1.1.2.1 src/sbin/canconfig/Makefile \
src/sbin/canconfig/canconfig.8 src/sbin/canconfig/canconfig.c

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



CVS commit: [bouyer-socketcan] src

2017-04-17 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Mon Apr 17 20:48:36 UTC 2017

Modified Files:
src/distrib/sets/lists/base [bouyer-socketcan]: mi
src/distrib/sets/lists/debug [bouyer-socketcan]: mi
src/distrib/sets/lists/man [bouyer-socketcan]: mi
src/sbin [bouyer-socketcan]: Makefile
Added Files:
src/sbin/canconfig [bouyer-socketcan]: Makefile canconfig.8 canconfig.c

Log Message:
Add canconfig(8), an utility to configure CAN interfaces.
Compile-tested only.


To generate a diff of this commit:
cvs rdiff -u -r1.1150.2.1 -r1.1150.2.2 src/distrib/sets/lists/base/mi
cvs rdiff -u -r1.191.2.1 -r1.191.2.2 src/distrib/sets/lists/debug/mi
cvs rdiff -u -r1.1545 -r1.1545.2.1 src/distrib/sets/lists/man/mi
cvs rdiff -u -r1.129 -r1.129.4.1 src/sbin/Makefile
cvs rdiff -u -r0 -r1.1.2.1 src/sbin/canconfig/Makefile \
src/sbin/canconfig/canconfig.8 src/sbin/canconfig/canconfig.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/mi
diff -u src/distrib/sets/lists/base/mi:1.1150.2.1 src/distrib/sets/lists/base/mi:1.1150.2.2
--- src/distrib/sets/lists/base/mi:1.1150.2.1	Mon Apr 17 20:35:00 2017
+++ src/distrib/sets/lists/base/mi	Mon Apr 17 20:48:36 2017
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1150.2.1 2017/04/17 20:35:00 bouyer Exp $
+# $NetBSD: mi,v 1.1150.2.2 2017/04/17 20:48:36 bouyer Exp $
 #
 # Note:	Don't delete entries from here - mark them as "obsolete" instead,
 #	unless otherwise stated below.
@@ -445,6 +445,7 @@
 ./sbin/blacklistctlbase-sysutil-root
 ./sbin/blacklistdbase-sysutil-root
 ./sbin/brconfig	base-netutil-root
+./sbin/canconfigbase-netutil-root
 ./sbin/ccdconfigbase-sysutil-root
 ./sbin/cgdconfigbase-sysutil-root
 ./sbin/chown	base-sysutil-root

Index: src/distrib/sets/lists/debug/mi
diff -u src/distrib/sets/lists/debug/mi:1.191.2.1 src/distrib/sets/lists/debug/mi:1.191.2.2
--- src/distrib/sets/lists/debug/mi:1.191.2.1	Mon Apr 17 20:35:00 2017
+++ src/distrib/sets/lists/debug/mi	Mon Apr 17 20:48:36 2017
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.191.2.1 2017/04/17 20:35:00 bouyer Exp $
+# $NetBSD: mi,v 1.191.2.2 2017/04/17 20:48:36 bouyer Exp $
 ./etc/mtree/set.debug   comp-sys-root
 ./usr/lib	comp-sys-usr		compatdir
 ./usr/lib/i18n/libBIG5_g.a			comp-c-debuglib		debuglib,compatfile
@@ -307,6 +307,7 @@
 ./usr/libdata/debug/sbin/blacklistctl.debug	comp-sysutil-debug	debug
 ./usr/libdata/debug/sbin/blacklistd.debug	comp-sysutil-debug	debug
 ./usr/libdata/debug/sbin/brconfig.debug		comp-netutil-debug	debug
+./usr/libdata/debug/sbin/canconfig.debug	comp-netutil-debug	debug
 ./usr/libdata/debug/sbin/ccdconfig.debug	comp-sysutil-debug	debug
 ./usr/libdata/debug/sbin/cgdconfig.debug	comp-sysutil-debug	debug
 ./usr/libdata/debug/sbin/chown.debug		comp-sysutil-debug	debug

Index: src/distrib/sets/lists/man/mi
diff -u src/distrib/sets/lists/man/mi:1.1545 src/distrib/sets/lists/man/mi:1.1545.2.1
--- src/distrib/sets/lists/man/mi:1.1545	Sat Jan  7 20:49:23 2017
+++ src/distrib/sets/lists/man/mi	Mon Apr 17 20:48:36 2017
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1545 2017/01/07 20:49:23 christos Exp $
+# $NetBSD: mi,v 1.1545.2.1 2017/04/17 20:48:36 bouyer Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -2365,6 +2365,7 @@
 ./usr/share/man/cat8/bounce.0			man-postfix-catman	postfix,.cat
 ./usr/share/man/cat8/bozohttpd.0		man-netutil-catman	.cat
 ./usr/share/man/cat8/brconfig.0			man-netutil-catman	.cat
+./usr/share/man/cat8/canconfig.0		man-netutil-catman	.cat
 ./usr/share/man/cat8/btattach.0			man-sysutil-catman	.cat
 ./usr/share/man/cat8/btconfig.0			man-sysutil-catman	.cat
 ./usr/share/man/cat8/btcontrol.0		man-obsolete		obsolete
@@ -5337,6 +5338,7 @@
 ./usr/share/man/html8/bounce.html		man-postfix-htmlman	postfix,html
 ./usr/share/man/html8/bozohttpd.html		man-netutil-htmlman	html
 ./usr/share/man/html8/brconfig.html		man-netutil-htmlman	html
+./usr/share/man/html8/canconfig.html		man-netutil-htmlman	html
 ./usr/share/man/html8/btattach.html		man-sysutil-htmlman	html
 ./usr/share/man/html8/btconfig.html		man-sysutil-htmlman	html
 ./usr/share/man/html8/btdevctl.html		man-sysutil-htmlman	html
@@ -8344,6 +8346,7 @@
 ./usr/share/man/man8/bounce.8			man-postfix-man		postfix,.man
 ./usr/share/man/man8/bozohttpd.8		man-netutil-man		.man
 ./usr/share/man/man8/brconfig.8			man-netutil-man		.man
+./usr/share/man/man8/canconfig.8		man-netutil-man		.man
 ./usr/share/man/man8/btattach.8			man-sysutil-man		.man
 ./usr/share/man/man8/btconfig.8			man-sysutil-man		.man
 ./usr/share/man/man8/btcontrol.8		man-obsolete		obsolete

Index: src/sbin/Makefile
diff -u src/sbin/Makefile:1.129 src/sbin/Makefile:1.129.4.1
--- src/sbin/Makefile:1.129	Fri Jul  1 22:50:50 2016
+++ src/sbin/Makefile	Mon Apr 17 20:48:35 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.129 2016/07/01 22:50:50 christos Exp $
+#	

CVS commit: [bouyer-socketcan] src/sys/arch/arm/allwinner

2017-04-17 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Mon Apr 17 20:41:55 UTC 2017

Modified Files:
src/sys/arch/arm/allwinner [bouyer-socketcan]: awin_reg.h

Log Message:
Add CAN registers


To generate a diff of this commit:
cvs rdiff -u -r1.90 -r1.90.2.1 src/sys/arch/arm/allwinner/awin_reg.h

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

Modified files:

Index: src/sys/arch/arm/allwinner/awin_reg.h
diff -u src/sys/arch/arm/allwinner/awin_reg.h:1.90 src/sys/arch/arm/allwinner/awin_reg.h:1.90.2.1
--- src/sys/arch/arm/allwinner/awin_reg.h:1.90	Mon Dec 26 16:20:17 2016
+++ src/sys/arch/arm/allwinner/awin_reg.h	Mon Apr 17 20:41:55 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: awin_reg.h,v 1.90 2016/12/26 16:20:17 rjs Exp $ */
+/* $NetBSD: awin_reg.h,v 1.90.2.1 2017/04/17 20:41:55 bouyer Exp $ */
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -3071,4 +3071,120 @@ struct awin_a31_dma_desc {
 #define AWIN_LRADC_DATA0_REG		0x0c
 #define AWIN_LRADC_DATA1_REG		0x10
 
+/* CAN mode select register */
+#define AWIN_CAN_MODSEL_REG		0x00
+#define AWIN_CAN_MODSEL_SLEEP		__BIT(4)
+#define AWIN_CAN_MODSEL_ACP_FLT_MOD	__BIT(3)
+#define AWIN_CAN_MODSEL_LB_MOD		__BIT(2)
+#define AWIN_CAN_MODSEL_LST_ONLY	__BIT(1)
+#define AWIN_CAN_MODSEL_RST		__BIT(0)
+
+/* CAN command register */
+#define AWIN_CAN_CMD_REG	0x04
+#define AWIN_CAN_CMD_BUS_OFF		__BIT(5)
+#define AWIN_CAN_CMD_SELF_REQ		__BIT(4)
+#define AWIN_CAN_CMD_CLR_OR		__BIT(3)
+#define AWIN_CAN_CMD_REL_RX_BUF		__BIT(2)
+#define AWIN_CAN_CMD_ABT_REQ		__BIT(1)
+#define AWIN_CAN_CMD_TANS_REQ		__BIT(0)
+
+/* CAN status register */
+#define AWIN_CAN_STA_REG	0x08
+#define AWIN_CAN_STA_ERR_CODE		__BITS(23,22)
+#define AWIN_CAN_STA_ERR_CODE_BIT		0
+#define AWIN_CAN_STA_ERR_CODE_FORM		1
+#define AWIN_CAN_STA_ERR_CODE_STUFF		2
+#define AWIN_CAN_STA_ERR_CODE_OTHER		3
+#define AWIN_CAN_STA_ERR_DIR		_BIT(21)
+#define AWIN_CAN_STA_ERR_SEG_CODE	__BITS(20,16)
+#define AWIN_CAN_STA_ARB_LOST		__BITS(12,8)
+#define AWIN_CAN_STA_BUS		__BIT(7)
+#define AWIN_CAN_STA_ERR		__BIT(6)
+#define AWIN_CAN_STA_TX 		__BIT(5)
+#define AWIN_CAN_STA_RX 		__BIT(4)
+#define AWIN_CAN_STA_TX_OVER		__BIT(3)
+#define AWIN_CAN_STA_TX_RDY		__BIT(2)
+#define AWIN_CAN_STA_DATA_OR		__BIT(1)
+#define AWIN_CAN_STA_RX_RDY		__BIT(0)
+
+/* CAN interrupt register */
+#define AWIN_CAN_INT_REG	0x0c
+#define AWIN_CAN_INT_BERR		__BIT(7)
+#define AWIN_CAN_INT_ARB_LOST		__BIT(6)
+#define AWIN_CAN_INT_ERR_PASSIVE	__BIT(5)
+#define AWIN_CAN_INT_WAKEUP		__BIT(4)
+#define AWIN_CAN_INT_DATA_OR		__BIT(3)
+#define AWIN_CAN_INT_ERR		__BIT(2)
+#define AWIN_CAN_INT_TX_FLAG		__BIT(1)
+#define AWIN_CAN_INT_RX_FLAG		__BIT(0)
+
+/* CAN interrupt enable register */
+#define AWIN_CAN_INTE_REG	0x10
+
+/* CAN bus timing register */
+#define AWIN_CAN_BUS_TIME_REG	0x14
+#define AWIN_CAN_BUS_TIME_SAM		__BIT(23)
+#define AWIN_CAN_BUS_TIME_PHSEG2	__BITS(22,20)
+#define AWIN_CAN_BUS_TIME_PHSEG1	__BITS(19,16)
+#define AWIN_CAN_BUS_TIME_SJW		__BITS(15,14)
+#define AWIN_CAN_BUS_TIME_TQ_BRP	__BITS(9,0)
+
+/* CAN tx error warning limit register */
+#define AWIN_CAN_EWL_REG	0x18
+#define AWIN_CAN_EWL_ERR_WRN_LMT	__BITS(7,0)
+
+/* CAN error counter register */
+#define AWIN_CAN_REC_REG	0x1c
+#define AWIN_CAN_REC_RX_ERR_CNT		__BITS(23,16)
+#define AWIN_CAN_REC_TX_ERR_CNT		__BITS(7,0)
+
+/* CAN receive message register */
+#define AWIN_CAN_RMSGC_REG	0x20
+#define AWIN_CAN_RMSGC_RX_MSG_CNT	__BITS(7,0)
+
+/* CAN receive buffer start address register */
+#define AWIN_CAN_RSADDR_REG	0x24
+#define AWIN_CAN_RSADDR_RX_BUF_SADDR	__BITS(5,0)
+
+/* CAN rx/tx message buffer 0 register */
+#define AWIN_CAN_TXBUF0_REG	0x40
+#define AWIN_CAN_TXBUF0_EFF		__BIT(7)
+#define AWIN_CAN_TXBUF0_RTR		__BIT(6)
+#define AWIN_CAN_TXBUF0_DL		__BITS(3,0)
+
+/* CAN rx/tx message buffer registers */
+#define AWIN_CAN_TXBUF1_REG	0x44
+#define AWIN_CAN_TXBUF2_REG	0x48
+#define AWIN_CAN_TXBUF3_REG	0x4c
+#define AWIN_CAN_TXBUF4_REG	0x50
+#define AWIN_CAN_TXBUF5_REG	0x54
+#define AWIN_CAN_TXBUF6_REG	0x58
+#define AWIN_CAN_TXBUF7_REG	0x5c
+#define AWIN_CAN_TXBUF8_REG	0x60
+#define AWIN_CAN_TXBUF9_REG	0x64
+#define AWIN_CAN_TXBUF10_REG	0x68
+#define AWIN_CAN_TXBUF11_REG	0x6c
+#define AWIN_CAN_TXBUF12_REG	0x70
+
+/* CAN acceptance code 0 register */
+#define AWIN_CAN_ACPC		0x40
+
+/* CAN acceptance mask 0 register */
+#define AWIN_CAN_ACPM		0x44
+
+/* CAN transmit buffer for read back registers */
+#define AWIN_CAN_RBUF_RBACK0	0x180
+#define AWIN_CAN_RBUF_RBACK1	0x184
+#define AWIN_CAN_RBUF_RBACK2	0x188
+#define AWIN_CAN_RBUF_RBACK3	0x18c
+#define AWIN_CAN_RBUF_RBACK4	0x190
+#define AWIN_CAN_RBUF_RBACK5	0x194
+#define AWIN_CAN_RBUF_RBACK6	0x198
+#define AWIN_CAN_RBUF_RBACK7	0x19c
+#define AWIN_CAN_RBUF_RBACK8	0x1a0
+#define AWIN_CAN_RBUF_RBACK9	0x1a4
+#define AWIN_CAN_RBUF_RBACK10	0x1a8
+#define AWIN_CAN_RBUF_RBACK11	0x1ac
+#define AWIN_CAN_RBUF_RBACK12	0x1b0
+
 #endif /* _ARM_ALLWINNER_AWIN_REG_H_ */



CVS commit: [bouyer-socketcan] src/sys/arch/arm/allwinner

2017-04-17 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Mon Apr 17 20:41:55 UTC 2017

Modified Files:
src/sys/arch/arm/allwinner [bouyer-socketcan]: awin_reg.h

Log Message:
Add CAN registers


To generate a diff of this commit:
cvs rdiff -u -r1.90 -r1.90.2.1 src/sys/arch/arm/allwinner/awin_reg.h

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



CVS commit: [bouyer-socketcan] src/tests/net/can

2017-04-17 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Mon Apr 17 20:41:26 UTC 2017

Modified Files:
src/tests/net/can [bouyer-socketcan]: h_canutils.c h_canutils.h t_can.c
t_canfilter.c

Log Message:
Make it build from build.sh (fix warnings)


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.4 -r1.1.2.5 src/tests/net/can/h_canutils.c
cvs rdiff -u -r1.1.2.2 -r1.1.2.3 src/tests/net/can/h_canutils.h
cvs rdiff -u -r1.1.2.6 -r1.1.2.7 src/tests/net/can/t_can.c
cvs rdiff -u -r1.1.2.3 -r1.1.2.4 src/tests/net/can/t_canfilter.c

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

Modified files:

Index: src/tests/net/can/h_canutils.c
diff -u src/tests/net/can/h_canutils.c:1.1.2.4 src/tests/net/can/h_canutils.c:1.1.2.5
--- src/tests/net/can/h_canutils.c:1.1.2.4	Sun Feb  5 12:18:20 2017
+++ src/tests/net/can/h_canutils.c	Mon Apr 17 20:41:26 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: h_canutils.c,v 1.1.2.4 2017/02/05 12:18:20 bouyer Exp $	*/
+/*	$NetBSD: h_canutils.c,v 1.1.2.5 2017/04/17 20:41:26 bouyer Exp $	*/
 
 /*-
  * Copyright (c) 2017 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: h_canutils.c,v 1.1.2.4 2017/02/05 12:18:20 bouyer Exp $");
+__RCSID("$NetBSD: h_canutils.c,v 1.1.2.5 2017/04/17 20:41:26 bouyer Exp $");
 #endif /* not lint */
 
 #include 
@@ -124,7 +124,7 @@ can_recvfrom(int s, struct can_frame *cf
 	ATF_CHECK_MSG(sa->can_family == AF_CAN,
 	"recvfrom provided wrong %d family", sa->can_family);   
 ATF_CHECK_MSG(salen == sizeof(struct sockaddr_can),
-"recvfrom provided wrong size %d (!= %d)", salen, sizeof(sa));
+"recvfrom provided wrong size %d (!= %ld)", salen, sizeof(sa));
 	return 0;
 }
 

Index: src/tests/net/can/h_canutils.h
diff -u src/tests/net/can/h_canutils.h:1.1.2.2 src/tests/net/can/h_canutils.h:1.1.2.3
--- src/tests/net/can/h_canutils.h:1.1.2.2	Sun Feb  5 12:03:23 2017
+++ src/tests/net/can/h_canutils.h	Mon Apr 17 20:41:26 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: h_canutils.h,v 1.1.2.2 2017/02/05 12:03:23 bouyer Exp $	*/
+/*	$NetBSD: h_canutils.h,v 1.1.2.3 2017/04/17 20:41:26 bouyer Exp $	*/
 
 /*-
  * Copyright (c) 2017 The NetBSD Foundation, Inc.
@@ -34,3 +34,4 @@ void cancfg_rump_createif(const char *);
 int can_recvfrom(int, struct can_frame *, int *, struct sockaddr_can *);
 int can_read(int, struct can_frame *, int *);
 int can_bind(int s, const char *);
+int can_socket_with_own(void);

Index: src/tests/net/can/t_can.c
diff -u src/tests/net/can/t_can.c:1.1.2.6 src/tests/net/can/t_can.c:1.1.2.7
--- src/tests/net/can/t_can.c:1.1.2.6	Sun Feb  5 12:18:20 2017
+++ src/tests/net/can/t_can.c	Mon Apr 17 20:41:26 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_can.c,v 1.1.2.6 2017/02/05 12:18:20 bouyer Exp $	*/
+/*	$NetBSD: t_can.c,v 1.1.2.7 2017/04/17 20:41:26 bouyer Exp $	*/
 
 /*-
  * Copyright (c) 2017 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: t_can.c,v 1.1.2.6 2017/02/05 12:18:20 bouyer Exp $");
+__RCSID("$NetBSD: t_can.c,v 1.1.2.7 2017/04/17 20:41:26 bouyer Exp $");
 #endif /* not lint */
 
 #include 
@@ -99,13 +99,11 @@ ATF_TC_HEAD(cannoown, tc)
 ATF_TC_BODY(cannoown, tc)
 {
 	const char ifname[] = "canlo0";
-	int s, rv, v, vlen;
+	int s, rv, v;
+	socklen_t vlen;
 	struct sockaddr_can sa;
-	socklen_t salen;
 	int ifindex;
 	struct can_frame cf_send, cf_receive;
-	fd_set rfds;
-	struct timeval tmout;
 
 	rump_init();
 	cancfg_rump_createif(ifname);
@@ -175,7 +173,8 @@ ATF_TC_HEAD(canwritelo, tc)
 ATF_TC_BODY(canwritelo, tc)
 {
 	const char ifname[] = "canlo0";
-	int s, rv, v, vlen;
+	int s, rv, v;
+	socklen_t vlen;
 	struct can_frame cf_send, cf_receive;
 
 	rump_init();
@@ -245,7 +244,6 @@ ATF_TC_BODY(canwriteunbound, tc)
 {
 	const char ifname[] = "canlo0";
 	int s, rv;
-	struct sockaddr_can sa;
 	struct can_frame cf_send;
 
 	rump_init();
@@ -282,7 +280,7 @@ ATF_TC_HEAD(cansendtolo, tc)
 ATF_TC_BODY(cansendtolo, tc)
 {
 	const char ifname[] = "canlo0";
-	int s, v, rv;
+	int s, rv;
 	struct sockaddr_can sa;
 	struct ifreq ifr;
 	struct can_frame cf_send, cf_receive;
@@ -345,7 +343,7 @@ ATF_TC_HEAD(cansendtowrite, tc)
 ATF_TC_BODY(cansendtowrite, tc)
 {
 	const char ifname[] = "canlo0";
-	int s, rv, v;
+	int s, rv;
 	struct sockaddr_can sa;
 	struct ifreq ifr;
 	struct can_frame cf_send, cf_receive;
@@ -411,7 +409,6 @@ ATF_TC_BODY(canreadlocal, tc)
 	const char ifname[] = "canlo0";
 	int s1, rv1;
 	int s2, rv2;
-	int v;
 	struct can_frame cf_send, cf_receive1, cf_receive2;
 
 	rump_init();
@@ -474,9 +471,7 @@ ATF_TC_BODY(canrecvfrom, tc)
 	const char ifname[] = "canlo0";
 	int s1, rv1;
 	int s2, rv2;
-	int v;
 	struct can_frame cf_send, cf_receive1, cf_receive2;
-	socklen_t salen;
 	int ifindex;
 	struct sockaddr_can sa;
 
@@ -541,14 +536,9 @@ ATF_TC_BODY(canbindfilter, tc)
 	const char ifname2[] = "canlo1";
 	int s1, rv1;
 	int s2, rv2;
-	int v;
 	struct sockaddr_can sa;
 	int 

CVS commit: [bouyer-socketcan] src/tests/net/can

2017-04-17 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Mon Apr 17 20:41:26 UTC 2017

Modified Files:
src/tests/net/can [bouyer-socketcan]: h_canutils.c h_canutils.h t_can.c
t_canfilter.c

Log Message:
Make it build from build.sh (fix warnings)


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.4 -r1.1.2.5 src/tests/net/can/h_canutils.c
cvs rdiff -u -r1.1.2.2 -r1.1.2.3 src/tests/net/can/h_canutils.h
cvs rdiff -u -r1.1.2.6 -r1.1.2.7 src/tests/net/can/t_can.c
cvs rdiff -u -r1.1.2.3 -r1.1.2.4 src/tests/net/can/t_canfilter.c

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



CVS commit: [bouyer-socketcan] src

2017-04-17 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Mon Apr 17 20:35:00 UTC 2017

Modified Files:
src/distrib/sets/lists/base [bouyer-socketcan]: mi shl.mi
src/distrib/sets/lists/comp [bouyer-socketcan]: mi shl.mi
src/distrib/sets/lists/debug [bouyer-socketcan]: mi shl.mi
src/distrib/sets/lists/tests [bouyer-socketcan]: mi
src/etc/mtree [bouyer-socketcan]: NetBSD.dist.base NetBSD.dist.tests

Log Message:
Add can-related directories and files; a build.sh release now completes.


To generate a diff of this commit:
cvs rdiff -u -r1.1150 -r1.1150.2.1 src/distrib/sets/lists/base/mi
cvs rdiff -u -r1.796 -r1.796.2.1 src/distrib/sets/lists/base/shl.mi
cvs rdiff -u -r1.2102 -r1.2102.2.1 src/distrib/sets/lists/comp/mi
cvs rdiff -u -r1.299 -r1.299.2.1 src/distrib/sets/lists/comp/shl.mi
cvs rdiff -u -r1.191 -r1.191.2.1 src/distrib/sets/lists/debug/mi
cvs rdiff -u -r1.155 -r1.155.2.1 src/distrib/sets/lists/debug/shl.mi
cvs rdiff -u -r1.714 -r1.714.2.1 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.156 -r1.156.2.1 src/etc/mtree/NetBSD.dist.base
cvs rdiff -u -r1.139 -r1.139.2.1 src/etc/mtree/NetBSD.dist.tests

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/mi
diff -u src/distrib/sets/lists/base/mi:1.1150 src/distrib/sets/lists/base/mi:1.1150.2.1
--- src/distrib/sets/lists/base/mi:1.1150	Fri Jan 13 11:21:47 2017
+++ src/distrib/sets/lists/base/mi	Mon Apr 17 20:35:00 2017
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1150 2017/01/13 11:21:47 nonaka Exp $
+# $NetBSD: mi,v 1.1150.2.1 2017/04/17 20:35:00 bouyer Exp $
 #
 # Note:	Don't delete entries from here - mark them as "obsolete" instead,
 #	unless otherwise stated below.
@@ -1167,6 +1167,7 @@
 ./usr/include/net80211base-c-usr
 ./usr/include/netatalkbase-c-usr
 ./usr/include/netbtbase-c-usr
+./usr/include/netcanbase-c-usr
 ./usr/include/netccittbase-obsolete		obsolete
 ./usr/include/netinetbase-c-usr
 ./usr/include/netinet6base-c-usr

Index: src/distrib/sets/lists/base/shl.mi
diff -u src/distrib/sets/lists/base/shl.mi:1.796 src/distrib/sets/lists/base/shl.mi:1.796.2.1
--- src/distrib/sets/lists/base/shl.mi:1.796	Mon Jan  2 12:38:16 2017
+++ src/distrib/sets/lists/base/shl.mi	Mon Apr 17 20:35:00 2017
@@ -1,4 +1,4 @@
-# $NetBSD: shl.mi,v 1.796 2017/01/02 12:38:16 roy Exp $
+# $NetBSD: shl.mi,v 1.796.2.1 2017/04/17 20:35:00 bouyer Exp $
 #
 # Note:	Don't delete entries from here - mark them as "obsolete" instead,
 #	unless otherwise stated below.
@@ -712,6 +712,9 @@
 ./usr/lib/librumpnet_netbt.so			base-rump-shlib		rump
 ./usr/lib/librumpnet_netbt.so.0			base-rump-shlib		rump
 ./usr/lib/librumpnet_netbt.so.0.0		base-rump-shlib		rump
+./usr/lib/librumpnet_netcan.so			base-rump-shlib		rump
+./usr/lib/librumpnet_netcan.so.0		base-rump-shlib		rump
+./usr/lib/librumpnet_netcan.so.0.0		base-rump-shlib		rump
 ./usr/lib/librumpnet_netinet.so			base-rump-shlib		rump
 ./usr/lib/librumpnet_netinet.so.0		base-rump-shlib		rump
 ./usr/lib/librumpnet_netinet.so.0.0		base-rump-shlib		rump

Index: src/distrib/sets/lists/comp/mi
diff -u src/distrib/sets/lists/comp/mi:1.2102 src/distrib/sets/lists/comp/mi:1.2102.2.1
--- src/distrib/sets/lists/comp/mi:1.2102	Wed Jan 11 12:02:24 2017
+++ src/distrib/sets/lists/comp/mi	Mon Apr 17 20:35:00 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: mi,v 1.2102 2017/01/11 12:02:24 joerg Exp $
+#	$NetBSD: mi,v 1.2102.2.1 2017/04/17 20:35:00 bouyer Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 ./etc/mtree/set.compcomp-sys-root
@@ -2271,6 +2271,8 @@
 ./usr/include/netbt/l2cap.h			comp-c-include
 ./usr/include/netbt/rfcomm.h			comp-c-include
 ./usr/include/netbt/sco.h			comp-c-include
+./usr/include/netcan/can.h			comp-c-include
+./usr/include/netcan/can_link.h			comp-c-include
 ./usr/include/netccitt/dll.h			comp-obsolete		obsolete
 ./usr/include/netccitt/hd_var.h			comp-obsolete		obsolete
 ./usr/include/netccitt/hdlc.h			comp-obsolete		obsolete
@@ -3555,6 +3557,8 @@
 ./usr/lib/librumpnet_net_p.a			comp-c-proflib		rump,profile
 ./usr/lib/librumpnet_netbt.a			comp-c-lib		rump
 ./usr/lib/librumpnet_netbt_p.a			comp-c-proflib		rump,profile
+./usr/lib/librumpnet_netcan.a			comp-c-lib		rump
+./usr/lib/librumpnet_netcan_p.a			comp-c-proflib		rump,profile
 ./usr/lib/librumpnet_netinet.a			comp-c-lib		rump
 ./usr/lib/librumpnet_netinet6.a			comp-c-lib		rump
 ./usr/lib/librumpnet_netinet6_p.a		comp-c-proflib		rump,profile

Index: src/distrib/sets/lists/comp/shl.mi
diff -u src/distrib/sets/lists/comp/shl.mi:1.299 src/distrib/sets/lists/comp/shl.mi:1.299.2.1
--- src/distrib/sets/lists/comp/shl.mi:1.299	Thu Jan  5 13:45:51 2017
+++ src/distrib/sets/lists/comp/shl.mi	Mon Apr 17 20:35:00 2017
@@ -1,4 +1,4 @@
-# $NetBSD: shl.mi,v 1.299 2017/01/05 13:45:51 wiz Exp $
+# $NetBSD: shl.mi,v 1.299.2.1 2017/04/17 20:35:00 bouyer Exp $
 #
 # Note: don't delete entries from 

CVS commit: [bouyer-socketcan] src

2017-04-17 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Mon Apr 17 20:35:00 UTC 2017

Modified Files:
src/distrib/sets/lists/base [bouyer-socketcan]: mi shl.mi
src/distrib/sets/lists/comp [bouyer-socketcan]: mi shl.mi
src/distrib/sets/lists/debug [bouyer-socketcan]: mi shl.mi
src/distrib/sets/lists/tests [bouyer-socketcan]: mi
src/etc/mtree [bouyer-socketcan]: NetBSD.dist.base NetBSD.dist.tests

Log Message:
Add can-related directories and files; a build.sh release now completes.


To generate a diff of this commit:
cvs rdiff -u -r1.1150 -r1.1150.2.1 src/distrib/sets/lists/base/mi
cvs rdiff -u -r1.796 -r1.796.2.1 src/distrib/sets/lists/base/shl.mi
cvs rdiff -u -r1.2102 -r1.2102.2.1 src/distrib/sets/lists/comp/mi
cvs rdiff -u -r1.299 -r1.299.2.1 src/distrib/sets/lists/comp/shl.mi
cvs rdiff -u -r1.191 -r1.191.2.1 src/distrib/sets/lists/debug/mi
cvs rdiff -u -r1.155 -r1.155.2.1 src/distrib/sets/lists/debug/shl.mi
cvs rdiff -u -r1.714 -r1.714.2.1 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.156 -r1.156.2.1 src/etc/mtree/NetBSD.dist.base
cvs rdiff -u -r1.139 -r1.139.2.1 src/etc/mtree/NetBSD.dist.tests

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



CVS commit: [bouyer-socketcan] src/sys/netcan

2017-04-17 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Mon Apr 17 20:32:27 UTC 2017

Modified Files:
src/sys/netcan [bouyer-socketcan]: Makefile can.c can.h can_var.h
Added Files:
src/sys/netcan [bouyer-socketcan]: can_link.h

Log Message:
Add infranstructure to configure timings from userland on a can interface.
This uses the SIOCGDRVSPEC/SIOCSDRVSPEC ioctls.
Compile-tested only.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.1 -r1.1.2.2 src/sys/netcan/Makefile
cvs rdiff -u -r1.1.2.6 -r1.1.2.7 src/sys/netcan/can.c
cvs rdiff -u -r1.1.2.3 -r1.1.2.4 src/sys/netcan/can.h
cvs rdiff -u -r0 -r1.1.2.1 src/sys/netcan/can_link.h
cvs rdiff -u -r1.1.2.4 -r1.1.2.5 src/sys/netcan/can_var.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/netcan/Makefile
diff -u src/sys/netcan/Makefile:1.1.2.1 src/sys/netcan/Makefile:1.1.2.2
--- src/sys/netcan/Makefile:1.1.2.1	Sun Jan 15 20:27:33 2017
+++ src/sys/netcan/Makefile	Mon Apr 17 20:32:27 2017
@@ -1,8 +1,8 @@
-#	$NetBSD: Makefile,v 1.1.2.1 2017/01/15 20:27:33 bouyer Exp $
+#	$NetBSD: Makefile,v 1.1.2.2 2017/04/17 20:32:27 bouyer Exp $
 
 KDIR=	/sys/netcan
 INCSDIR= /usr/include/netcan
 
-INCS=	can.h
+INCS=	can.h can_link.h
 
 .include 

Index: src/sys/netcan/can.c
diff -u src/sys/netcan/can.c:1.1.2.6 src/sys/netcan/can.c:1.1.2.7
--- src/sys/netcan/can.c:1.1.2.6	Sun Feb  5 19:44:53 2017
+++ src/sys/netcan/can.c	Mon Apr 17 20:32:27 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: can.c,v 1.1.2.6 2017/02/05 19:44:53 bouyer Exp $	*/
+/*	$NetBSD: can.c,v 1.1.2.7 2017/04/17 20:32:27 bouyer Exp $	*/
 
 /*-
  * Copyright (c) 2003, 2017 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: can.c,v 1.1.2.6 2017/02/05 19:44:53 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: can.c,v 1.1.2.7 2017/04/17 20:32:27 bouyer Exp $");
 
 #include 
 #include 
@@ -90,6 +90,77 @@ can_init(void)
 /*
  * Generic control operations (ioctl's).
  */
+static int
+can_get_netlink(struct ifnet *ifp, struct ifdrv *ifd)
+{
+	struct canif_softc *csc = ifp->if_softc;
+
+	if (ifp->if_dlt != DLT_CAN_SOCKETCAN || csc == NULL)
+		return EOPNOTSUPP;
+
+	switch(ifd->ifd_cmd) {
+	case CANGLINKTIMECAP:
+		if (ifd->ifd_len != sizeof(struct can_link_timecaps))
+			return EINVAL;
+		return copyout(>csc_timecaps, ifd->ifd_data, ifd->ifd_len);
+	case CANGLINKTIMINGS:
+		if (ifd->ifd_len != sizeof(struct can_link_timings))
+			return EINVAL;
+		return copyout(>csc_timings, ifd->ifd_data, ifd->ifd_len);
+	case CANGLINKMODE:
+		if (ifd->ifd_len != sizeof(uint32_t))
+			return EINVAL;
+		return copyout(>csc_linkmodes, ifd->ifd_data, ifd->ifd_len);
+	}
+	return EOPNOTSUPP;
+}
+
+static int
+can_set_netlink(struct ifnet *ifp, struct ifdrv *ifd)
+{
+	struct canif_softc *csc = ifp->if_softc;
+	uint32_t mode;
+	int error;
+
+	if (ifp->if_dlt != DLT_CAN_SOCKETCAN || csc == NULL)
+		return EOPNOTSUPP;
+
+	error = kauth_authorize_network(curlwp->l_cred,
+		KAUTH_NETWORK_INTERFACE,
+		KAUTH_REQ_NETWORK_INTERFACE_SETPRIV, ifp,
+	(void *)SIOCSDRVSPEC, NULL);
+	if (error != 0)
+		return error;
+
+	if ((ifp->if_flags & IFF_UP) != 0) {
+		return EBUSY;
+	}
+
+	switch(ifd->ifd_cmd) {
+	case CANSLINKTIMINGS:
+		if (ifd->ifd_len != sizeof(struct can_link_timings))
+			return EINVAL;
+		return copyin(ifd->ifd_data, >csc_timings, ifd->ifd_len);
+
+	case CANSLINKMODE:
+	case CANCLINKMODE:
+		if (ifd->ifd_len != sizeof(uint32_t))
+			return EINVAL;
+		error = copyout(ifd->ifd_data, , ifd->ifd_len);
+		if (error)
+			return error;
+		if ((mode & csc->csc_timecaps.cltc_linkmode_caps) != mode)
+			return EINVAL;
+		/* XXX locking */
+		if (ifd->ifd_cmd == CANSLINKMODE)
+			csc->csc_linkmodes |= mode;
+		else
+			csc->csc_linkmodes &= ~mode;
+		return 0;
+	}
+	return EOPNOTSUPP;
+}
+
 /* ARGSUSED */
 static int
 can_control(struct socket *so, u_long cmd, void *data, struct ifnet *ifp)
@@ -98,12 +169,16 @@ can_control(struct socket *so, u_long cm
 	struct can_ifreq *cfr = (struct can_ifreq *)data;
 	int error = 0;
 #endif
-
+	if (ifp == NULL)
+		return (EOPNOTSUPP);
 
 	switch (cmd) {
-
+	case SIOCGDRVSPEC:
+		return can_get_netlink(ifp, (struct ifdrv *) data);
+	case SIOCSDRVSPEC:
+		return can_set_netlink(ifp, (struct ifdrv *) data);
 	default:
-		if (ifp == 0 || ifp->if_ioctl == 0)
+		if (ifp->if_ioctl == 0)
 			return (EOPNOTSUPP);
 		return ((*ifp->if_ioctl)(ifp, cmd, data));
 	}

Index: src/sys/netcan/can.h
diff -u src/sys/netcan/can.h:1.1.2.3 src/sys/netcan/can.h:1.1.2.4
--- src/sys/netcan/can.h:1.1.2.3	Mon Jan 16 18:03:38 2017
+++ src/sys/netcan/can.h	Mon Apr 17 20:32:27 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: can.h,v 1.1.2.3 2017/01/16 18:03:38 bouyer Exp $	*/
+/*	$NetBSD: can.h,v 1.1.2.4 2017/04/17 20:32:27 bouyer Exp $	*/
 
 /*-
  * Copyright (c) 2003, 2017 The NetBSD Foundation, Inc.
@@ -118,12 +118,6 @@ struct can_filter {
 #define CAN_INV_FILTER 0x2000U
 
 #ifdef 

CVS commit: [bouyer-socketcan] src/sys/netcan

2017-04-17 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Mon Apr 17 20:32:27 UTC 2017

Modified Files:
src/sys/netcan [bouyer-socketcan]: Makefile can.c can.h can_var.h
Added Files:
src/sys/netcan [bouyer-socketcan]: can_link.h

Log Message:
Add infranstructure to configure timings from userland on a can interface.
This uses the SIOCGDRVSPEC/SIOCSDRVSPEC ioctls.
Compile-tested only.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.1 -r1.1.2.2 src/sys/netcan/Makefile
cvs rdiff -u -r1.1.2.6 -r1.1.2.7 src/sys/netcan/can.c
cvs rdiff -u -r1.1.2.3 -r1.1.2.4 src/sys/netcan/can.h
cvs rdiff -u -r0 -r1.1.2.1 src/sys/netcan/can_link.h
cvs rdiff -u -r1.1.2.4 -r1.1.2.5 src/sys/netcan/can_var.h

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



CVS commit: src

2017-04-17 Thread Nathanial Sloss
Module Name:src
Committed By:   nat
Date:   Mon Apr 17 20:17:08 UTC 2017

Modified Files:
src/share/man/man4: audio.4
src/sys/dev: audio.c audiovar.h

Log Message:
hw.driverN.saturate bool->integer (default 16).

This means for a greater number than 16 (or user set value) the saturate
function is turned off.  Results in better listening if a large number of
channels are in use.


To generate a diff of this commit:
cvs rdiff -u -r1.76 -r1.77 src/share/man/man4/audio.4
cvs rdiff -u -r1.324 -r1.325 src/sys/dev/audio.c
cvs rdiff -u -r1.51 -r1.52 src/sys/dev/audiovar.h

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



CVS commit: src

2017-04-17 Thread Nathanial Sloss
Module Name:src
Committed By:   nat
Date:   Mon Apr 17 20:17:08 UTC 2017

Modified Files:
src/share/man/man4: audio.4
src/sys/dev: audio.c audiovar.h

Log Message:
hw.driverN.saturate bool->integer (default 16).

This means for a greater number than 16 (or user set value) the saturate
function is turned off.  Results in better listening if a large number of
channels are in use.


To generate a diff of this commit:
cvs rdiff -u -r1.76 -r1.77 src/share/man/man4/audio.4
cvs rdiff -u -r1.324 -r1.325 src/sys/dev/audio.c
cvs rdiff -u -r1.51 -r1.52 src/sys/dev/audiovar.h

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/audio.4
diff -u src/share/man/man4/audio.4:1.76 src/share/man/man4/audio.4:1.77
--- src/share/man/man4/audio.4:1.76	Tue Mar 21 07:04:29 2017
+++ src/share/man/man4/audio.4	Mon Apr 17 20:17:08 2017
@@ -1,4 +1,4 @@
-.\"	$NetBSD: audio.4,v 1.76 2017/03/21 07:04:29 nat Exp $
+.\"	$NetBSD: audio.4,v 1.77 2017/04/17 20:17:08 nat Exp $
 .\"
 .\" Copyright (c) 1996 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -129,13 +129,13 @@ An additional
 .Xr sysctl 8
 variable controls how the samples are combined, hw.driverN.saturate.
 .Pp
-By default it is set to true.
-This means that volumes are not adjusted for each channel to be mixed.
+By default is set to 16.
+This means that volumes are not adjusted for the first 16 channels to be mixed.
 All virtual channels will use the
 .Em maximum
 set master volume unless the virtual channel volume is lowered by the user.
 .Pp
-If set to false the channels are
+If a greater number of channels are opened all channels are
 .Em divided
 evenly in volume with respect to the master volume.
 .Pp

Index: src/sys/dev/audio.c
diff -u src/sys/dev/audio.c:1.324 src/sys/dev/audio.c:1.325
--- src/sys/dev/audio.c:1.324	Fri Apr 14 00:05:46 2017
+++ src/sys/dev/audio.c	Mon Apr 17 20:17:08 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: audio.c,v 1.324 2017/04/14 00:05:46 nat Exp $	*/
+/*	$NetBSD: audio.c,v 1.325 2017/04/17 20:17:08 nat Exp $	*/
 
 /*-
  * Copyright (c) 2016 Nathanial Sloss 
@@ -148,7 +148,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.324 2017/04/14 00:05:46 nat Exp $");
+__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.325 2017/04/17 20:17:08 nat Exp $");
 
 #include "audio.h"
 #if NAUDIO > 0
@@ -641,7 +641,7 @@ bad_rec:
 	}
 
 	sc->sc_lastgain = 128;
-	sc->sc_saturate = true;
+	sc->sc_saturate = 16;
 	sc->sc_multiuser = false;
 	mutex_exit(sc->sc_lock);
 
@@ -837,8 +837,8 @@ bad_rec:
 
 		sysctl_createv(>sc_log, 0, NULL, NULL,
 			CTLFLAG_READWRITE,
-			CTLTYPE_BOOL, "saturate",
-			SYSCTL_DESCR("saturate to max. volume"),
+			CTLTYPE_INT, "saturate",
+			SYSCTL_DESCR("saturate to max. volume this many channels"),
 			NULL, 0,
 			>sc_saturate, 0,
 			CTL_HW, node->sysctl_num,
@@ -3786,7 +3786,7 @@ audio_mix(void *v)
 sc->schedule_rih = true;
 	}
 	mutex_enter(sc->sc_intr_lock);
-	if (sc->sc_saturate == true && sc->sc_opens > 1)
+	if (sc->sc_opens < sc->sc_saturate && sc->sc_opens > 1)
 		saturate_func(sc);
 
 	vc = SIMPLEQ_FIRST(>sc_audiochan)->vc;

Index: src/sys/dev/audiovar.h
diff -u src/sys/dev/audiovar.h:1.51 src/sys/dev/audiovar.h:1.52
--- src/sys/dev/audiovar.h:1.51	Mon Feb 27 23:31:00 2017
+++ src/sys/dev/audiovar.h	Mon Apr 17 20:17:08 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: audiovar.h,v 1.51 2017/02/27 23:31:00 mrg Exp $	*/
+/*	$NetBSD: audiovar.h,v 1.52 2017/04/17 20:17:08 nat Exp $	*/
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -290,7 +290,7 @@ struct audio_softc {
 	int		sc_channels;
 	int		sc_precision;
 	int		sc_iffreq;
-	bool		sc_saturate;
+	int		sc_saturate;
 	struct audio_info 	sc_ai;		/* Recent info for  dev sound */
 	bool			sc_aivalid;
 #define VAUDIO_NFORMATS	1



CVS commit: src/distrib/sets/lists

2017-04-17 Thread Alistair G. Crooks
Module Name:src
Committed By:   agc
Date:   Mon Apr 17 19:51:11 UTC 2017

Modified Files:
src/distrib/sets/lists/base: shl.mi
src/distrib/sets/lists/debug: shl.mi

Log Message:
Bumped libnetpgpverify major from 4 to 5


To generate a diff of this commit:
cvs rdiff -u -r1.808 -r1.809 src/distrib/sets/lists/base/shl.mi
cvs rdiff -u -r1.167 -r1.168 src/distrib/sets/lists/debug/shl.mi

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

Modified files:

Index: src/distrib/sets/lists/base/shl.mi
diff -u src/distrib/sets/lists/base/shl.mi:1.808 src/distrib/sets/lists/base/shl.mi:1.809
--- src/distrib/sets/lists/base/shl.mi:1.808	Mon Apr 17 08:59:37 2017
+++ src/distrib/sets/lists/base/shl.mi	Mon Apr 17 19:51:11 2017
@@ -1,4 +1,4 @@
-# $NetBSD: shl.mi,v 1.808 2017/04/17 08:59:37 riastradh Exp $
+# $NetBSD: shl.mi,v 1.809 2017/04/17 19:51:11 agc Exp $
 #
 # Note:	Don't delete entries from here - mark them as "obsolete" instead,
 #	unless otherwise stated below.
@@ -401,8 +401,8 @@
 ./usr/lib/libnetpgp.so.3			base-crypto-shlib	compatfile,crypto
 ./usr/lib/libnetpgp.so.3.0			base-crypto-shlib	compatfile,crypto
 ./usr/lib/libnetpgpverify.so			base-crypto-shlib	compatfile,crypto
-./usr/lib/libnetpgpverify.so.4			base-crypto-shlib	compatfile,crypto
-./usr/lib/libnetpgpverify.so.4.0		base-crypto-shlib	compatfile,crypto
+./usr/lib/libnetpgpverify.so.5			base-crypto-shlib	compatfile,crypto
+./usr/lib/libnetpgpverify.so.5.0		base-crypto-shlib	compatfile,crypto
 ./usr/lib/libnpf.sobase-npf-shlib		npf,compatfile
 ./usr/lib/libnpf.so.0base-npf-shlib		npf,compatfile
 ./usr/lib/libnpf.so.0.1base-npf-shlib		npf,compatfile

Index: src/distrib/sets/lists/debug/shl.mi
diff -u src/distrib/sets/lists/debug/shl.mi:1.167 src/distrib/sets/lists/debug/shl.mi:1.168
--- src/distrib/sets/lists/debug/shl.mi:1.167	Mon Apr 17 08:59:37 2017
+++ src/distrib/sets/lists/debug/shl.mi	Mon Apr 17 19:51:11 2017
@@ -1,4 +1,4 @@
-# $NetBSD: shl.mi,v 1.167 2017/04/17 08:59:37 riastradh Exp $
+# $NetBSD: shl.mi,v 1.168 2017/04/17 19:51:11 agc Exp $
 ./usr/lib/libbfd_g.a		comp-c-debuglib	debuglib,compatfile,binutils
 ./usr/libdata/debug/lib		base-sys-usr	debug,dynamicroot,compatdir
 ./usr/libdata/debug/lib/libblacklist.so.0.0.debug		comp-sys-debug	debug,dynamicroot
@@ -143,7 +143,7 @@
 ./usr/libdata/debug/usr/lib/libmudflap.so.0.0.debug		comp-sys-debug	debug,compatfile,gcc=48
 ./usr/libdata/debug/usr/lib/libmudflapth.so.0.0.debug		comp-sys-debug	debug,compatfile,gcc=48
 ./usr/libdata/debug/usr/lib/libnetpgp.so.3.0.debug		comp-crypto-debug	debug,compatfile,crypto
-./usr/libdata/debug/usr/lib/libnetpgpverify.so.4.0.debug	comp-crypto-debug	debug,compatfile,crypto
+./usr/libdata/debug/usr/lib/libnetpgpverify.so.5.0.debug	comp-crypto-debug	debug,compatfile,crypto
 ./usr/libdata/debug/usr/lib/libnpf.so.0.1.debug			comp-npf-debug	debug,compatfile,npf
 ./usr/libdata/debug/usr/lib/libnvpair.so.0.0.debug		comp-zfs-debug	debug,compatfile,zfs
 ./usr/libdata/debug/usr/lib/libobjc.so.4.0.debug		comp-sys-debug	debug,compatfile,gcc



CVS commit: src/distrib/sets/lists

2017-04-17 Thread Alistair G. Crooks
Module Name:src
Committed By:   agc
Date:   Mon Apr 17 19:51:11 UTC 2017

Modified Files:
src/distrib/sets/lists/base: shl.mi
src/distrib/sets/lists/debug: shl.mi

Log Message:
Bumped libnetpgpverify major from 4 to 5


To generate a diff of this commit:
cvs rdiff -u -r1.808 -r1.809 src/distrib/sets/lists/base/shl.mi
cvs rdiff -u -r1.167 -r1.168 src/distrib/sets/lists/debug/shl.mi

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



CVS commit: src/crypto/external/bsd/netpgp

2017-04-17 Thread Alistair G. Crooks
Module Name:src
Committed By:   agc
Date:   Mon Apr 17 19:50:28 UTC 2017

Modified Files:
src/crypto/external/bsd/netpgp/bin/netpgpverify: Makefile
src/crypto/external/bsd/netpgp/dist/src/netpgpverify: Makefile.bsd
Makefile.in Makefile.lib.in Makefile.libtool.in array.h bignum.c
digest.c digest.h libnetpgpverify.3 libverify.c main.c
netpgpverify.1 pgpsum.c verify.h
src/crypto/external/bsd/netpgp/lib/verify: Makefile
Removed Files:
src/crypto/external/bsd/netpgp/dist/src/netpgpverify: tiger.c tiger.h

Log Message:
Update netpgpverify sources in base from 20160617 to 20170201 (i.e. bring
over changes from master sources in pkgsrc/security/netpgpverify, version 
20170201):

Changes:

Update netpgpverify (and libnetpgpverify) to 20160614
+ handle signatures created by gpg with "--no-emit-version", don't 
assume
there will always be a version string.
+ add a test for above
Fixes security PR  51240.
Thanks to x...@ubuntu.com for reporting the error

Update netpgpverify and libnetpgpverify to 20160615:
Simplify the method of finding the end of the versioning information
in the signature - back up to the "\n" character at the end of the
signature start:

"-BEGIN PGP SIGNATURE-\n"

and then find the "\n\n" character sequence to denote the start of the
signature itself. The previous version worked, but this is more 
efficient.

Update netpgpverify and libnetpgpverify to 20160616
+ bring over joerg's printflike change from the netpgpverify
version in src/crypto
+ add a test for cleartext signatures with version information
to complement the one with no version information

Update netpgpverify and libnetpgpverify to 20160622 during freeze to fix PR  
51262
+ take a bit of a step backwards, and don't use stdbool.h, just to 
appease
Solaris 10 compiler

Update netpgpverify and libnetpgpverify to 20160623
+ remove use of asprintf and vasprintf from libverify. Inspired
by work from Dimitri John Ledkov. Should allow building on Linux
without superfluous definitions.
+ also free the BIGNUM struct in PGPV_BN_clear() - from Dimitri
John Ledkov

Update netpgpverify and libnetpgpverify to 20160626
+ make the pgpv_t and pgpv_cursor_t structures opaque
+ add new accessor functions for fields in the pgpv_cursor_t struct
+ add new creation functions for the pgpv_t and pgpv_cursor_t structs

Update netpgpverify and libnetpgpverify to 20160704
+ get rid of redundant PGPV_ARRAY definition in libverify.c, brought in 
when
the definitions moved from verify.h
+ fix obuf_add_mem() to use a const void *, as any struct can be
dumped using it
+ remove redundant NO_SUBKEYS definition - unused
+ add an (unused as yet) ARRAY_FREE() macro

Update netpgpverify and libnetpgpverify to 20160705
External API changes

+ add a pgpv_cursor_close() function to free resources associated with
a cursor
Better memory management

+ restructure the way dynamic arrays are used, to avoid memory
corruption issues and memory leaks - keep all dynamic arrays in the 
global
data structure, and use indices in the other data structures to index 
them.
Means lack of data localisation, but avoids stale pointers, and leaks.
+ make signer field of signature a uint8_t array, rather than a pointer
+ use our own version of strdup(3) - don't depend on it being
available in standard library
+ keep track of whether litdata filenames and userid were allocated or 
not,
and free memory in pgpv_close() if it was allocated
+ free up allocated resources which were allocated in pgpv_close()

Update netpgpverify and libnetpgpverify to 20160706
+ 20160705 introduced a bug whereby a key subid would match and verify
fine, but, if formatted, would not display the correct subkey
information.  Fix to show the correct information in this case.

Update netpgpverify and libnetpgpverify to 20160707 to fix some
unusual build errors shown by old gcc versions (works fine for
gcc-5.2.1 on ubuntu and gcc-5.3.0 on NetBSD 7.99.32)
+ use ULL suffix on unsigned 64bit constants, not UL
+ don't typedef the public structs twice - second time just define it
without the typedef
Fixes PR   51327

Update netpgpverify and libnetpgpverify to 20160708
+ clear and free bignums properly - helps immensely with plugging
memory leaks

Update netpgpverify and libnetpgpverify to 20160828
+ bring over change from christos in src/crypto to check for
the end of an ASCII-armored signature
+ no need for 

CVS commit: src/crypto/external/bsd/netpgp

2017-04-17 Thread Alistair G. Crooks
Module Name:src
Committed By:   agc
Date:   Mon Apr 17 19:50:28 UTC 2017

Modified Files:
src/crypto/external/bsd/netpgp/bin/netpgpverify: Makefile
src/crypto/external/bsd/netpgp/dist/src/netpgpverify: Makefile.bsd
Makefile.in Makefile.lib.in Makefile.libtool.in array.h bignum.c
digest.c digest.h libnetpgpverify.3 libverify.c main.c
netpgpverify.1 pgpsum.c verify.h
src/crypto/external/bsd/netpgp/lib/verify: Makefile
Removed Files:
src/crypto/external/bsd/netpgp/dist/src/netpgpverify: tiger.c tiger.h

Log Message:
Update netpgpverify sources in base from 20160617 to 20170201 (i.e. bring
over changes from master sources in pkgsrc/security/netpgpverify, version 
20170201):

Changes:

Update netpgpverify (and libnetpgpverify) to 20160614
+ handle signatures created by gpg with "--no-emit-version", don't 
assume
there will always be a version string.
+ add a test for above
Fixes security PR  51240.
Thanks to x...@ubuntu.com for reporting the error

Update netpgpverify and libnetpgpverify to 20160615:
Simplify the method of finding the end of the versioning information
in the signature - back up to the "\n" character at the end of the
signature start:

"-BEGIN PGP SIGNATURE-\n"

and then find the "\n\n" character sequence to denote the start of the
signature itself. The previous version worked, but this is more 
efficient.

Update netpgpverify and libnetpgpverify to 20160616
+ bring over joerg's printflike change from the netpgpverify
version in src/crypto
+ add a test for cleartext signatures with version information
to complement the one with no version information

Update netpgpverify and libnetpgpverify to 20160622 during freeze to fix PR  
51262
+ take a bit of a step backwards, and don't use stdbool.h, just to 
appease
Solaris 10 compiler

Update netpgpverify and libnetpgpverify to 20160623
+ remove use of asprintf and vasprintf from libverify. Inspired
by work from Dimitri John Ledkov. Should allow building on Linux
without superfluous definitions.
+ also free the BIGNUM struct in PGPV_BN_clear() - from Dimitri
John Ledkov

Update netpgpverify and libnetpgpverify to 20160626
+ make the pgpv_t and pgpv_cursor_t structures opaque
+ add new accessor functions for fields in the pgpv_cursor_t struct
+ add new creation functions for the pgpv_t and pgpv_cursor_t structs

Update netpgpverify and libnetpgpverify to 20160704
+ get rid of redundant PGPV_ARRAY definition in libverify.c, brought in 
when
the definitions moved from verify.h
+ fix obuf_add_mem() to use a const void *, as any struct can be
dumped using it
+ remove redundant NO_SUBKEYS definition - unused
+ add an (unused as yet) ARRAY_FREE() macro

Update netpgpverify and libnetpgpverify to 20160705
External API changes

+ add a pgpv_cursor_close() function to free resources associated with
a cursor
Better memory management

+ restructure the way dynamic arrays are used, to avoid memory
corruption issues and memory leaks - keep all dynamic arrays in the 
global
data structure, and use indices in the other data structures to index 
them.
Means lack of data localisation, but avoids stale pointers, and leaks.
+ make signer field of signature a uint8_t array, rather than a pointer
+ use our own version of strdup(3) - don't depend on it being
available in standard library
+ keep track of whether litdata filenames and userid were allocated or 
not,
and free memory in pgpv_close() if it was allocated
+ free up allocated resources which were allocated in pgpv_close()

Update netpgpverify and libnetpgpverify to 20160706
+ 20160705 introduced a bug whereby a key subid would match and verify
fine, but, if formatted, would not display the correct subkey
information.  Fix to show the correct information in this case.

Update netpgpverify and libnetpgpverify to 20160707 to fix some
unusual build errors shown by old gcc versions (works fine for
gcc-5.2.1 on ubuntu and gcc-5.3.0 on NetBSD 7.99.32)
+ use ULL suffix on unsigned 64bit constants, not UL
+ don't typedef the public structs twice - second time just define it
without the typedef
Fixes PR   51327

Update netpgpverify and libnetpgpverify to 20160708
+ clear and free bignums properly - helps immensely with plugging
memory leaks

Update netpgpverify and libnetpgpverify to 20160828
+ bring over change from christos in src/crypto to check for
the end of an ASCII-armored signature
+ no need for 

CVS commit: src/share/man/man9

2017-04-17 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Mon Apr 17 18:57:23 UTC 2017

Modified Files:
src/share/man/man9: vfssubr.9

Log Message:
Fix month in Dd.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/share/man/man9/vfssubr.9

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



CVS commit: src/share/man/man9

2017-04-17 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Mon Apr 17 18:57:23 UTC 2017

Modified Files:
src/share/man/man9: vfssubr.9

Log Message:
Fix month in Dd.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/share/man/man9/vfssubr.9

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/man9/vfssubr.9
diff -u src/share/man/man9/vfssubr.9:1.26 src/share/man/man9/vfssubr.9:1.27
--- src/share/man/man9/vfssubr.9:1.26	Mon Apr 17 08:33:40 2017
+++ src/share/man/man9/vfssubr.9	Mon Apr 17 18:57:23 2017
@@ -1,4 +1,4 @@
-.\" $NetBSD: vfssubr.9,v 1.26 2017/04/17 08:33:40 hannken Exp $
+.\" $NetBSD: vfssubr.9,v 1.27 2017/04/17 18:57:23 wiz Exp $
 .\"
 .\" Copyright (c) 2003, 2005, 2006 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 Apr 17, 2017
+.Dd April 17, 2017
 .Dt VFSSUBR 9
 .Os
 .Sh NAME



CVS commit: src/usr.sbin/postinstall

2017-04-17 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Apr 17 18:41:49 UTC 2017

Modified Files:
src/usr.sbin/postinstall: postinstall

Log Message:
If -x (xsrc location) is passed for "check", display it also in the
"how to fix" invocation instructions.


To generate a diff of this commit:
cvs rdiff -u -r1.213 -r1.214 src/usr.sbin/postinstall/postinstall

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/postinstall/postinstall
diff -u src/usr.sbin/postinstall/postinstall:1.213 src/usr.sbin/postinstall/postinstall:1.214
--- src/usr.sbin/postinstall/postinstall:1.213	Sat Apr  1 20:14:53 2017
+++ src/usr.sbin/postinstall/postinstall	Mon Apr 17 18:41:48 2017
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: postinstall,v 1.213 2017/04/01 20:14:53 roy Exp $
+# $NetBSD: postinstall,v 1.214 2017/04/17 18:41:48 martin Exp $
 #
 # Copyright (c) 2002-2015 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -2402,6 +2402,7 @@ main()
 			if [ -d "${OPTARG}" ]; then
 # arg refers to a directory.
 XSRC_DIR="${OPTARG}"
+XSRC_DIR_FIX="-x ${OPTARG} "
 			else
 err 2 "Not a directory for -x option"
 			fi
@@ -2563,7 +2564,7 @@ main()
 			[ "$MACHINE" = "$(uname -m)" ] && m= || m=" -m $MACHINE"
 			cat <<_Fix_me_
 To fix, run:
-${HOST_SH} ${0} ${SRC_ARGLIST} -d ${DEST_DIR:-/}$m fix${items_failed}
+${HOST_SH} ${0} ${SRC_ARGLIST} ${XSRC_DIR_FIX}-d ${DEST_DIR:-/}$m fix${items_failed}
 Note that this may overwrite local changes.
 _Fix_me_
 		fi



CVS commit: src/usr.sbin/postinstall

2017-04-17 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Apr 17 18:41:49 UTC 2017

Modified Files:
src/usr.sbin/postinstall: postinstall

Log Message:
If -x (xsrc location) is passed for "check", display it also in the
"how to fix" invocation instructions.


To generate a diff of this commit:
cvs rdiff -u -r1.213 -r1.214 src/usr.sbin/postinstall/postinstall

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



Re: CVS commit: src/sys/lib/libsa

2017-04-17 Thread Valery Ushakov
On Thu, Feb 23, 2017 at 12:13:05 +, NONAKA Kimihiro wrote:

> Module Name:  src
> Committed By: nonaka
> Date: Thu Feb 23 12:13:05 UTC 2017
> 
> Modified Files:
>   src/sys/lib/libsa: loadfile_elf32.c
> 
> Log Message:
> fix CTF section symbol size was not counted with COUNT_KERNEL.
> 
> 
> To generate a diff of this commit:
> cvs rdiff -u -r1.34 -r1.35 src/sys/lib/libsa/loadfile_elf32.c

This change looks suspicious to me.

Reading shstrtab into the elf image we construct for the kernel
symbols is still protected by LOAD_SYM check, but the second part is
no longer protected, so maxp is advanced unconditionally and sh_offset
is also always updated.

What is really intended here?  Do we need shstr set so that we can
test for ".SUNW_ctf" section name later?

Thanks.

-uwe


CVS commit: src/sys/lib/libsa

2017-04-17 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Mon Apr 17 18:06:30 UTC 2017

Modified Files:
src/sys/lib/libsa: loadfile_elf32.c

Log Message:
Section at index 0 is SHN_UNDEF.  When searching for symbol sections
skip it and start with index 1.


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/sys/lib/libsa/loadfile_elf32.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/lib/libsa/loadfile_elf32.c
diff -u src/sys/lib/libsa/loadfile_elf32.c:1.37 src/sys/lib/libsa/loadfile_elf32.c:1.38
--- src/sys/lib/libsa/loadfile_elf32.c:1.37	Mon Apr 17 17:44:48 2017
+++ src/sys/lib/libsa/loadfile_elf32.c	Mon Apr 17 18:06:30 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: loadfile_elf32.c,v 1.37 2017/04/17 17:44:48 uwe Exp $ */
+/* $NetBSD: loadfile_elf32.c,v 1.38 2017/04/17 18:06:30 uwe Exp $ */
 
 /*
  * Copyright (c) 1997, 2008 The NetBSD Foundation, Inc.
@@ -432,7 +432,7 @@ ELFNAMEEND(loadfile)(int fd, Elf_Ehdr *e
 		/*
 		 * First load the section names section.
 		 */
-		if (boot_load_ctf && (elf->e_shstrndx != 0)) {
+		if (boot_load_ctf && (elf->e_shstrndx != SHN_UNDEF)) {
 			Elf_Off shstroff = shp[elf->e_shstrndx].sh_offset;
 			shstrsz = shp[elf->e_shstrndx].sh_size;
 			if (flags & LOAD_SYM) {
@@ -473,7 +473,7 @@ ELFNAMEEND(loadfile)(int fd, Elf_Ehdr *e
 		 * table.
 		 */
 		first = 1;
-		for (i = 0; i < elf->e_shnum; i++) {
+		for (i = 1; i < elf->e_shnum; i++) {
 			if (i == elf->e_shstrndx) {
 /* already loaded this section */
 continue;
@@ -492,7 +492,7 @@ ELFNAMEEND(loadfile)(int fd, Elf_Ehdr *e
 shp[i].sh_offset = 0;
 break;
 			case SHT_STRTAB:
-for (j = 0; j < elf->e_shnum; j++)
+for (j = 1; j < elf->e_shnum; j++)
 	if (shp[j].sh_type == SHT_SYMTAB &&
 	shp[j].sh_link == (unsigned int)i)
 		goto havesym;



CVS commit: src/sys/lib/libsa

2017-04-17 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Mon Apr 17 18:06:30 UTC 2017

Modified Files:
src/sys/lib/libsa: loadfile_elf32.c

Log Message:
Section at index 0 is SHN_UNDEF.  When searching for symbol sections
skip it and start with index 1.


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/sys/lib/libsa/loadfile_elf32.c

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



CVS commit: src/sys/lib/libsa

2017-04-17 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Mon Apr 17 17:44:48 UTC 2017

Modified Files:
src/sys/lib/libsa: loadfile_elf32.c

Log Message:
Don't hide first = 1 assignment inside for(), that just obscures the
loop.  Same object code is generated.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/sys/lib/libsa/loadfile_elf32.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/lib/libsa/loadfile_elf32.c
diff -u src/sys/lib/libsa/loadfile_elf32.c:1.36 src/sys/lib/libsa/loadfile_elf32.c:1.37
--- src/sys/lib/libsa/loadfile_elf32.c:1.36	Thu Feb 23 12:13:59 2017
+++ src/sys/lib/libsa/loadfile_elf32.c	Mon Apr 17 17:44:48 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: loadfile_elf32.c,v 1.36 2017/02/23 12:13:59 nonaka Exp $ */
+/* $NetBSD: loadfile_elf32.c,v 1.37 2017/04/17 17:44:48 uwe Exp $ */
 
 /*
  * Copyright (c) 1997, 2008 The NetBSD Foundation, Inc.
@@ -321,7 +321,8 @@ ELFNAMEEND(loadfile)(int fd, Elf_Ehdr *e
 		goto freephdr;
 	}
 
-	for (first = 1, i = 0; i < elf->e_phnum; i++) {
+	first = 1;
+	for (i = 0; i < elf->e_phnum; i++) {
 		internalize_phdr(elf->e_ident[EI_DATA], [i]);
 
 #ifndef MD_LOADSEG /* Allow processor ABI specific segment loads */
@@ -471,7 +472,8 @@ ELFNAMEEND(loadfile)(int fd, Elf_Ehdr *e
 		 * string table that isn't referenced by a symbol
 		 * table.
 		 */
-		for (first = 1, i = 0; i < elf->e_shnum; i++) {
+		first = 1;
+		for (i = 0; i < elf->e_shnum; i++) {
 			if (i == elf->e_shstrndx) {
 /* already loaded this section */
 continue;



CVS commit: src/sys/lib/libsa

2017-04-17 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Mon Apr 17 17:44:48 UTC 2017

Modified Files:
src/sys/lib/libsa: loadfile_elf32.c

Log Message:
Don't hide first = 1 assignment inside for(), that just obscures the
loop.  Same object code is generated.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/sys/lib/libsa/loadfile_elf32.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/usb

2017-04-17 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon Apr 17 16:42:07 UTC 2017

Modified Files:
src/sys/dev/usb: ualea.c

Log Message:
IPL_SOFTUSB suffices here to synchronize with usb xfer callback.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/usb/ualea.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/ualea.c
diff -u src/sys/dev/usb/ualea.c:1.3 src/sys/dev/usb/ualea.c:1.4
--- src/sys/dev/usb/ualea.c:1.3	Mon Apr 17 15:43:40 2017
+++ src/sys/dev/usb/ualea.c	Mon Apr 17 16:42:07 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: ualea.c,v 1.3 2017/04/17 15:43:40 riastradh Exp $	*/
+/*	$NetBSD: ualea.c,v 1.4 2017/04/17 16:42:07 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2017 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ualea.c,v 1.3 2017/04/17 15:43:40 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ualea.c,v 1.4 2017/04/17 16:42:07 riastradh Exp $");
 
 #include 
 #include 
@@ -103,7 +103,7 @@ ualea_attach(device_t parent, device_t s
 	sc->sc_dev = self;
 	sc->sc_udev = udev;
 	sc->sc_uif = uif;
-	mutex_init(>sc_lock, MUTEX_DEFAULT, IPL_USB);
+	mutex_init(>sc_lock, MUTEX_DEFAULT, IPL_SOFTUSB);
 	rndsource_setcb(>sc_rnd, ualea_get, sc);
 	rnd_attach_source(>sc_rnd, device_xname(self), RND_TYPE_RNG,
 	RND_FLAG_COLLECT_VALUE|RND_FLAG_HASCB);



CVS commit: src/sys/dev/usb

2017-04-17 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon Apr 17 16:42:07 UTC 2017

Modified Files:
src/sys/dev/usb: ualea.c

Log Message:
IPL_SOFTUSB suffices here to synchronize with usb xfer callback.


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

2017-04-17 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon Apr 17 15:43:40 UTC 2017

Modified Files:
src/sys/dev/usb: ualea.c

Log Message:
Follow my own locking rules.


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

2017-04-17 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon Apr 17 15:43:40 UTC 2017

Modified Files:
src/sys/dev/usb: ualea.c

Log Message:
Follow my own locking rules.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/usb/ualea.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/ualea.c
diff -u src/sys/dev/usb/ualea.c:1.2 src/sys/dev/usb/ualea.c:1.3
--- src/sys/dev/usb/ualea.c:1.2	Mon Apr 17 09:16:13 2017
+++ src/sys/dev/usb/ualea.c	Mon Apr 17 15:43:40 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: ualea.c,v 1.2 2017/04/17 09:16:13 riastradh Exp $	*/
+/*	$NetBSD: ualea.c,v 1.3 2017/04/17 15:43:40 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2017 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ualea.c,v 1.2 2017/04/17 09:16:13 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ualea.c,v 1.3 2017/04/17 15:43:40 riastradh Exp $");
 
 #include 
 #include 
@@ -142,7 +142,9 @@ ualea_attach(device_t parent, device_t s
 	ualea_xfer_done);
 
 	/* Success!  We are ready to run.  */
+	mutex_enter(>sc_lock);
 	sc->sc_attached = true;
+	mutex_exit(>sc_lock);
 
 	/* Get some initial entropy now.  */
 	ualea_get(RND_POOLBITS/NBBY, sc);



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

2017-04-17 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon Apr 17 14:52:52 UTC 2017

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

Log Message:
Perform icache syncs for ARM_MMU_EXTENDED as well.  This helps the PT_STEP
code in pr/52119 and probably other things.


To generate a diff of this commit:
cvs rdiff -u -r1.344 -r1.345 src/sys/arch/arm/arm32/pmap.c

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



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

2017-04-17 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon Apr 17 14:52:52 UTC 2017

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

Log Message:
Perform icache syncs for ARM_MMU_EXTENDED as well.  This helps the PT_STEP
code in pr/52119 and probably other things.


To generate a diff of this commit:
cvs rdiff -u -r1.344 -r1.345 src/sys/arch/arm/arm32/pmap.c

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

Modified files:

Index: src/sys/arch/arm/arm32/pmap.c
diff -u src/sys/arch/arm/arm32/pmap.c:1.344 src/sys/arch/arm/arm32/pmap.c:1.345
--- src/sys/arch/arm/arm32/pmap.c:1.344	Sat Feb 25 16:48:03 2017
+++ src/sys/arch/arm/arm32/pmap.c	Mon Apr 17 14:52:52 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.344 2017/02/25 16:48:03 christos Exp $	*/
+/*	$NetBSD: pmap.c,v 1.345 2017/04/17 14:52:52 skrll Exp $	*/
 
 /*
  * Copyright 2003 Wasabi Systems, Inc.
@@ -217,7 +217,7 @@
 
 #include 
 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.344 2017/02/25 16:48:03 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.345 2017/04/17 14:52:52 skrll Exp $");
 
 //#define PMAP_DEBUG
 #ifdef PMAP_DEBUG
@@ -424,13 +424,13 @@ static struct evcnt pmap_ev_exec_synced 
PMAP_EVCNT_INITIALIZER("exec pages synced");
 static struct evcnt pmap_ev_exec_synced_map =
PMAP_EVCNT_INITIALIZER("exec pages synced (MP)");
-#ifndef ARM_MMU_EXTENDED
 static struct evcnt pmap_ev_exec_synced_unmap =
PMAP_EVCNT_INITIALIZER("exec pages synced (UM)");
 static struct evcnt pmap_ev_exec_synced_remap =
PMAP_EVCNT_INITIALIZER("exec pages synced (RM)");
 static struct evcnt pmap_ev_exec_synced_clearbit =
PMAP_EVCNT_INITIALIZER("exec pages synced (DG)");
+#ifndef ARM_MMU_EXTENDED
 static struct evcnt pmap_ev_exec_synced_kremove =
PMAP_EVCNT_INITIALIZER("exec pages synced (KU)");
 #endif
@@ -1052,12 +1052,10 @@ pmap_enter_pv(struct vm_page_md *md, pad
 	 * for this page, make sure to sync the I-cache.
 	 */
 	if (PV_IS_EXEC_P(flags)) {
-#ifndef ARM_MMU_EXTENDED
 		if (!PV_IS_EXEC_P(md->pvh_attrs)) {
 			pmap_syncicache_page(md, pa);
 			PMAPCOUNT(exec_synced_map);
 		}
-#endif
 		PMAPCOUNT(exec_mappings);
 	}
 #endif
@@ -1131,26 +1129,19 @@ pmap_remove_pv(struct vm_page_md *md, pa
 
 			PMAPCOUNT(unmappings);
 #ifdef PMAP_CACHE_VIPT
-			if (!(pv->pv_flags & PVF_WRITE))
-break;
 			/*
 			 * If this page has had an exec mapping, then if
 			 * this was the last mapping, discard the contents,
 			 * otherwise sync the i-cache for this page.
 			 */
 			if (PV_IS_EXEC_P(md->pvh_attrs)) {
-#ifdef ARM_MMU_EXTENDED
-md->pvh_attrs &= ~PVF_EXEC;
-PMAPCOUNT(exec_discarded_unmap);
-#else
 if (SLIST_EMPTY(>pvh_list)) {
 	md->pvh_attrs &= ~PVF_EXEC;
 	PMAPCOUNT(exec_discarded_unmap);
-} else {
+} else if (pv->pv_flags & PVF_WRITE) {
 	pmap_syncicache_page(md, pa);
 	PMAPCOUNT(exec_synced_unmap);
 }
-#endif /* ARM_MMU_EXTENDED */
 			}
 #endif /* PMAP_CACHE_VIPT */
 			break;
@@ -1262,7 +1253,6 @@ pmap_modify_pv(struct vm_page_md *md, pa
 			md->pvh_attrs |= PVF_WRITE;
 		}
 	}
-#ifndef ARM_MMU_EXTENDED
 	/*
 	 * We have two cases here: the first is from enter_pv (new exec
 	 * page), the second is a combined pmap_remove_pv/pmap_enter_pv.
@@ -1275,6 +1265,7 @@ pmap_modify_pv(struct vm_page_md *md, pa
 		pmap_syncicache_page(md, pa);
 		PMAPCOUNT(exec_synced_remap);
 	}
+#ifndef ARM_MMU_EXTENDED
 	KASSERT((md->pvh_attrs & PVF_DMOD) == 0 || (md->pvh_attrs & (PVF_DIRTY|PVF_NC)));
 #endif /* !ARM_MMU_EXTENDED */
 #endif /* PMAP_CACHE_VIPT */
@@ -2324,12 +2315,12 @@ pmap_clearbit(struct vm_page_md *md, pad
 	struct pv_entry *pv;
 #ifdef PMAP_CACHE_VIPT
 	const bool want_syncicache = PV_IS_EXEC_P(md->pvh_attrs);
+	bool need_syncicache = false;
 #ifdef ARM_MMU_EXTENDED
 	const u_int execbits = (maskbits & PVF_EXEC) ? L2_XS_XN : 0;
 #else
 	const u_int execbits = 0;
 	bool need_vac_me_harder = false;
-	bool need_syncicache = false;
 #endif
 #else
 	const u_int execbits = 0;
@@ -2345,12 +2336,9 @@ pmap_clearbit(struct vm_page_md *md, pad
 	 * then we know we definitely need to sync or discard it.
 	 */
 	if (want_syncicache) {
-#ifdef ARM_MMU_EXTENDED
-		if (md->pvh_attrs & PVF_MOD)
-			md->pvh_attrs &= ~PVF_EXEC;
-#else
-		need_syncicache = md->pvh_attrs & PVF_MOD;
-#endif
+		if (md->pvh_attrs & PVF_MOD) {
+			need_syncicache = true;
+		}
 	}
 #endif
 	KASSERT(pmap_page_locked_p(md));
@@ -2361,7 +2349,7 @@ pmap_clearbit(struct vm_page_md *md, pad
 	md->pvh_attrs &= ~(maskbits & (PVF_MOD | PVF_REF));
 
 	if (SLIST_EMPTY(>pvh_list)) {
-#if defined(PMAP_CACHE_VIPT) && !defined(ARM_MMU_EXTENDED)
+#if defined(PMAP_CACHE_VIPT)
 		if (need_syncicache) {
 			/*
 			 * No one has it mapped, so just discard it.  The next
@@ -2472,9 +2460,9 @@ pmap_clearbit(struct vm_page_md *md, pad
 		PMAP_VALIDATE_MD_PAGE(md);
 	}
 }
-#ifndef ARM_MMU_EXTENDED
 if (want_syncicache)
 	need_syncicache = true;
+#ifndef ARM_MMU_EXTENDED
 

CVS commit: src/external/bsd/bc/dist

2017-04-17 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Mon Apr 17 14:01:19 UTC 2017

Modified Files:
src/external/bsd/bc/dist: bc.1

Log Message:
Convert bc(1) to mdoc.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/external/bsd/bc/dist/bc.1

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/bc/dist/bc.1
diff -u src/external/bsd/bc/dist/bc.1:1.1 src/external/bsd/bc/dist/bc.1:1.2
--- src/external/bsd/bc/dist/bc.1:1.1	Mon Apr 10 02:28:23 2017
+++ src/external/bsd/bc/dist/bc.1	Mon Apr 17 14:01:19 2017
@@ -1,9 +1,10 @@
-.\" $NetBSD: bc.1,v 1.1 2017/04/10 02:28:23 phil Exp $
+.\" $NetBSD: bc.1,v 1.2 2017/04/17 14:01:19 wiz Exp $
 .\"
-.\" bc.1 - the *roff document processor source for the bc manual
+.\" bc.1 - the bc manual
 .\"
 .\" Copyright (C) 1991-1994, 1997, 2000, 2003, 2012-2017 Free Software Foundation, Inc.
 .\" Copyright (C) 2004, 2017 Philip A. Nelson
+.\" Copyright (C) 2017 Thomas Klausner
 .\" All rights reserved.
 .\"
 .\" Redistribution and use in source and binary forms, with or without
@@ -32,480 +33,816 @@
 .\"
 .\"
 .\"
-.TH bc 1 .\" "Command Manual" nb1.0 "Jan 23, 2017"
-.SH NAME
-bc - An arbitrary precision calculator language
-.SH SYNTAX
-\fBbc\fR [ \fB-hlwsqv\fR ] [long-options] [ \fI file ...\fR ]
-.SH VERSION
-This man page documents bc version nb1.0.
-.SH DESCRIPTION
-\fBbc\fR is a language that supports arbitrary precision numbers
-with interactive execution of statements.  There are some similarities
-in the syntax to the C programming language. 
+.Dd April 16, 2017
+.Dt BC 1
+.Os
+.Sh NAME
+.Nm bc
+.Nd arbitrary precision calculator language
+.Sh SYNOPSIS
+.Nm
+.Op Fl hilqsvw
+.Op long-options
+.Op Ar
+.Sh DESCRIPTION
+.Nm
+is a language that supports arbitrary precision numbers
+with interactive execution of statements.
+There are some similarities
+in the syntax to the C programming language.
 A standard math library is available by command line option.
 If requested, the math library is defined before processing any files.
-\fBbc\fR starts by processing code from all the files listed
-on the command line in the order listed.  After all files have been
-processed, \fBbc\fR reads from the standard input.  All code is
-executed as it is read.  (If a file contains a command to halt the
-processor, \fBbc\fR will never read from the standard input.)
-.PP
-This version of \fBbc\fR contains several extensions beyond
-traditional \fBbc\fR implementations and the POSIX draft standard.
-Command line options can cause these extensions to print a warning 
-or to be rejected.  This 
-document describes the language accepted by this processor.
+.Nm
+starts by processing code from all the files listed
+on the command line in the order listed.
+After all files have been processed,
+.Nm
+reads from the standard input.
+All code is executed as it is read.
+(If a file contains a command to halt the processor,
+.Nm
+will never read from the standard input.)
+.Pp
+This version of
+.Nm
+contains several extensions beyond traditional
+.Nm
+implementations and the POSIX draft standard.
+Command line options can cause these extensions to print a warning
+or to be rejected.
+This document describes the language accepted by this processor.
 Extensions will be identified as such.
-.SS OPTIONS
-.IP "-h, --help"
+.Ss OPTIONS
+.Bl -tag -width "XXinteractiveXX"
+.It Fl h , Fl Fl help
 Print the usage and exit.
-.IP "-i, --interactive"
+.It Fl i , Fl Fl interactive
 Force interactive mode.
-.IP "-l, --mathlib"
+.It Fl l , Fl Fl mathlib
 Define the standard math library.
-.IP "-w, --warn"
-Give warnings for extensions to POSIX \fBbc\fR.
-.IP "-s, --standard"
-Process exactly the POSIX \fBbc\fR language.
-.IP "-v, --version"
+.It Fl q , Fl Fl quiet
+Quiet mode.
+.It Fl s , Fl Fl standard
+Process exactly the POSIX
+.Nm
+language.
+.It Fl v , Fl Fl version
 Print the version number and copyright and quit.
-.SS NUMBERS
-The most basic element in \fBbc\fR is the number.  Numbers are
-arbitrary precision numbers.  This precision is both in the integer
-part and the fractional part.  All numbers are represented internally
-in decimal and all computation is done in decimal.  (This version
-truncates results from divide and multiply operations.)  There are two
-attributes of numbers, the length and the scale.  The length is the
+.It Fl w , Fl Fl warn
+Give warnings for extensions to POSIX
+.Nm .
+.El
+.Ss NUMBERS
+The most basic element in
+.Nm
+is the number.
+Numbers are arbitrary precision numbers.
+This precision is both in the integer
+part and the fractional part.
+All numbers are represented internally
+in decimal and all computation is done in decimal.
+(This version of
+.Nm
+truncates results from divide and multiply operations.)
+There are two attributes of numbers, the length and the scale.
+The length is the
 total number of significant decimal digits in a number and the scale

CVS commit: src/external/bsd/bc/dist

2017-04-17 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Mon Apr 17 14:01:19 UTC 2017

Modified Files:
src/external/bsd/bc/dist: bc.1

Log Message:
Convert bc(1) to mdoc.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/external/bsd/bc/dist/bc.1

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



CVS commit: src/usr.bin/make

2017-04-17 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Mon Apr 17 13:29:07 UTC 2017

Modified Files:
src/usr.bin/make: parse.c

Log Message:
Use correct header for SIZE_MAX. from a.rin


To generate a diff of this commit:
cvs rdiff -u -r1.224 -r1.225 src/usr.bin/make/parse.c

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



CVS commit: src/usr.bin/make

2017-04-17 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Mon Apr 17 13:29:07 UTC 2017

Modified Files:
src/usr.bin/make: parse.c

Log Message:
Use correct header for SIZE_MAX. from a.rin


To generate a diff of this commit:
cvs rdiff -u -r1.224 -r1.225 src/usr.bin/make/parse.c

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

Modified files:

Index: src/usr.bin/make/parse.c
diff -u src/usr.bin/make/parse.c:1.224 src/usr.bin/make/parse.c:1.225
--- src/usr.bin/make/parse.c:1.224	Sun Apr 16 21:38:38 2017
+++ src/usr.bin/make/parse.c	Mon Apr 17 13:29:07 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: parse.c,v 1.224 2017/04/16 21:38:38 riastradh Exp $	*/
+/*	$NetBSD: parse.c,v 1.225 2017/04/17 13:29:07 maya Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: parse.c,v 1.224 2017/04/16 21:38:38 riastradh Exp $";
+static char rcsid[] = "$NetBSD: parse.c,v 1.225 2017/04/17 13:29:07 maya Exp $";
 #else
 #include 
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)parse.c	8.3 (Berkeley) 3/19/94";
 #else
-__RCSID("$NetBSD: parse.c,v 1.224 2017/04/16 21:38:38 riastradh Exp $");
+__RCSID("$NetBSD: parse.c,v 1.225 2017/04/17 13:29:07 maya Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -129,9 +129,9 @@ __RCSID("$NetBSD: parse.c,v 1.224 2017/0
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
+#include 
 
 #ifndef MAP_FILE
 #define MAP_FILE 0



Re: CVS commit: src/sys/arch

2017-04-17 Thread Manuel Bouyer
On Mon, Apr 17, 2017 at 11:41:26AM +0200, Manuel Bouyer wrote:
> On Mon, Apr 17, 2017 at 07:19:28AM +, Maya Rashish wrote:
> > Module Name:src
> > Committed By:   maya
> > Date:   Mon Apr 17 07:19:28 UTC 2017
> > 
> > Modified Files:
> > src/sys/arch/amd64/conf: XEN3_DOM0
> > src/sys/arch/i386/conf: XEN3_DOM0
> > 
> > Log Message:
> > Uncomment MULTIPROCESSOR in dom0 kernels
> 
> Are you sure it's OK ?

I'm sure it's not. See xen_shm_machdep.c for example. I disabled
MULTIPROCESSOR, with a comment making it clear that it's not ready yet.

-- 
Manuel Bouyer 
 NetBSD: 26 ans d'experience feront toujours la difference
--


CVS commit: src/sys/arch

2017-04-17 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Mon Apr 17 09:54:59 UTC 2017

Modified Files:
src/sys/arch/amd64/conf: XEN3_DOM0
src/sys/arch/i386/conf: XEN3_DOM0

Log Message:
Disable MULTIPROCESSOR for dom0. The dom0 support code is not MP-safe
(see xen_shm_machdep.c for example, but there are probably others).


To generate a diff of this commit:
cvs rdiff -u -r1.133 -r1.134 src/sys/arch/amd64/conf/XEN3_DOM0
cvs rdiff -u -r1.111 -r1.112 src/sys/arch/i386/conf/XEN3_DOM0

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/XEN3_DOM0
diff -u src/sys/arch/amd64/conf/XEN3_DOM0:1.133 src/sys/arch/amd64/conf/XEN3_DOM0:1.134
--- src/sys/arch/amd64/conf/XEN3_DOM0:1.133	Mon Apr 17 07:19:28 2017
+++ src/sys/arch/amd64/conf/XEN3_DOM0	Mon Apr 17 09:54:59 2017
@@ -1,8 +1,8 @@
-# $NetBSD: XEN3_DOM0,v 1.133 2017/04/17 07:19:28 maya Exp $
+# $NetBSD: XEN3_DOM0,v 1.134 2017/04/17 09:54:59 bouyer Exp $
 
 include 	"arch/amd64/conf/std.xen"
 
-options 	MULTIPROCESSOR	# (experimental)
+#options 	MULTIPROCESSOR	# (not yet - dom0 stuff is not MP-safe)
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 

Index: src/sys/arch/i386/conf/XEN3_DOM0
diff -u src/sys/arch/i386/conf/XEN3_DOM0:1.111 src/sys/arch/i386/conf/XEN3_DOM0:1.112
--- src/sys/arch/i386/conf/XEN3_DOM0:1.111	Mon Apr 17 07:19:28 2017
+++ src/sys/arch/i386/conf/XEN3_DOM0	Mon Apr 17 09:54:59 2017
@@ -1,10 +1,10 @@
-#	$NetBSD: XEN3_DOM0,v 1.111 2017/04/17 07:19:28 maya Exp $
+#	$NetBSD: XEN3_DOM0,v 1.112 2017/04/17 09:54:59 bouyer Exp $
 #
 #	XEN3_0: Xen 3.0 domain0 kernel
 
 include 	"arch/xen/conf/std.xen"
 
-options 	MULTIPROCESSOR	# (experimental)
+#options 	MULTIPROCESSOR	# (not yet - dom0 stuff is not MP-safe)
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 



CVS commit: src/sys/arch

2017-04-17 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Mon Apr 17 09:54:59 UTC 2017

Modified Files:
src/sys/arch/amd64/conf: XEN3_DOM0
src/sys/arch/i386/conf: XEN3_DOM0

Log Message:
Disable MULTIPROCESSOR for dom0. The dom0 support code is not MP-safe
(see xen_shm_machdep.c for example, but there are probably others).


To generate a diff of this commit:
cvs rdiff -u -r1.133 -r1.134 src/sys/arch/amd64/conf/XEN3_DOM0
cvs rdiff -u -r1.111 -r1.112 src/sys/arch/i386/conf/XEN3_DOM0

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



Re: CVS commit: src/sys/arch

2017-04-17 Thread Manuel Bouyer
On Mon, Apr 17, 2017 at 07:19:28AM +, Maya Rashish wrote:
> Module Name:  src
> Committed By: maya
> Date: Mon Apr 17 07:19:28 UTC 2017
> 
> Modified Files:
>   src/sys/arch/amd64/conf: XEN3_DOM0
>   src/sys/arch/i386/conf: XEN3_DOM0
> 
> Log Message:
> Uncomment MULTIPROCESSOR in dom0 kernels

Are you sure it's OK ?
It's not clear if the backend drivers, and especially the xenstore,
event channels and grant table stuff, are MP safe (I'm almost sure they
are not). There's still some splfoo()/splx() use there.
At minimum we should KASSERT() that the kernel lock is held here.

-- 
Manuel Bouyer 
 NetBSD: 26 ans d'experience feront toujours la difference
--


CVS commit: src/sys/dev/pci

2017-04-17 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Apr 17 09:33:00 UTC 2017

Modified Files:
src/sys/dev/pci: pci_subr.c pcireg.h

Log Message:
 Use macro. No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.172 -r1.173 src/sys/dev/pci/pci_subr.c
cvs rdiff -u -r1.125 -r1.126 src/sys/dev/pci/pcireg.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/pci/pci_subr.c
diff -u src/sys/dev/pci/pci_subr.c:1.172 src/sys/dev/pci/pci_subr.c:1.173
--- src/sys/dev/pci/pci_subr.c:1.172	Thu Apr  6 08:57:01 2017
+++ src/sys/dev/pci/pci_subr.c	Mon Apr 17 09:33:00 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: pci_subr.c,v 1.172 2017/04/06 08:57:01 msaitoh Exp $	*/
+/*	$NetBSD: pci_subr.c,v 1.173 2017/04/17 09:33:00 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 1997 Zubin D. Dittia.  All rights reserved.
@@ -40,7 +40,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pci_subr.c,v 1.172 2017/04/06 08:57:01 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pci_subr.c,v 1.173 2017/04/17 09:33:00 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_pci.h"
@@ -1907,13 +1907,13 @@ pci_conf_print_pcie_cap(const pcireg_t *
 		case 0x0:
 			printf("reserved\n");
 			break;
-		case 0x1:
+		case PCIE_SLCSR_IND_ON:
 			printf("on\n");
 			break;
-		case 0x2:
+		case PCIE_SLCSR_IND_BLINK:
 			printf("blink\n");
 			break;
-		case 0x3:
+		case PCIE_SLCSR_IND_OFF:
 			printf("off\n");
 			break;
 		}
@@ -1922,13 +1922,13 @@ pci_conf_print_pcie_cap(const pcireg_t *
 		case 0x0:
 			printf("reserved\n");
 			break;
-		case 0x1:
+		case PCIE_SLCSR_IND_ON:
 			printf("on\n");
 			break;
-		case 0x2:
+		case PCIE_SLCSR_IND_BLINK:
 			printf("blink\n");
 			break;
-		case 0x3:
+		case PCIE_SLCSR_IND_OFF:
 			printf("off\n");
 			break;
 		}

Index: src/sys/dev/pci/pcireg.h
diff -u src/sys/dev/pci/pcireg.h:1.125 src/sys/dev/pci/pcireg.h:1.126
--- src/sys/dev/pci/pcireg.h:1.125	Tue Mar 28 10:47:44 2017
+++ src/sys/dev/pci/pcireg.h	Mon Apr 17 09:33:00 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: pcireg.h,v 1.125 2017/03/28 10:47:44 msaitoh Exp $	*/
+/*	$NetBSD: pcireg.h,v 1.126 2017/04/17 09:33:00 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 1995, 1996, 1999, 2000
@@ -1001,6 +1001,9 @@ typedef u_int8_t pci_revision_t;
 #define PCIE_SLCSR_HPE		__BIT(5)   /* Hot Plug Interrupt Enable */
 #define PCIE_SLCSR_AIC		__BITS(7, 6)   /* Attention Indicator Control*/
 #define PCIE_SLCSR_PIC		__BITS(9, 8)   /* Power Indicator Control */
+#define PCIE_SLCSR_IND_ON	0x1	   /* Attn/Power Indicator On */
+#define PCIE_SLCSR_IND_BLINK	0x2	   /* Attn/Power Indicator Blink */
+#define PCIE_SLCSR_IND_OFF	0x3	   /* Attn/Power Indicator Off */
 #define PCIE_SLCSR_PCC		__BIT(10)  /*
 		* Power Controller Control:
 		* 0: Power on, 1: Power off.



CVS commit: src/sys/dev/pci

2017-04-17 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Apr 17 09:33:00 UTC 2017

Modified Files:
src/sys/dev/pci: pci_subr.c pcireg.h

Log Message:
 Use macro. No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.172 -r1.173 src/sys/dev/pci/pci_subr.c
cvs rdiff -u -r1.125 -r1.126 src/sys/dev/pci/pcireg.h

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



CVS commit: src/sys/dev/usb

2017-04-17 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon Apr 17 09:16:13 UTC 2017

Modified Files:
src/sys/dev/usb: ualea.c

Log Message:
Tweak locking rule.  Fix broken unlocked rmw.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/usb/ualea.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/ualea.c
diff -u src/sys/dev/usb/ualea.c:1.1 src/sys/dev/usb/ualea.c:1.2
--- src/sys/dev/usb/ualea.c:1.1	Mon Apr 17 08:59:37 2017
+++ src/sys/dev/usb/ualea.c	Mon Apr 17 09:16:13 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: ualea.c,v 1.1 2017/04/17 08:59:37 riastradh Exp $	*/
+/*	$NetBSD: ualea.c,v 1.2 2017/04/17 09:16:13 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2017 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ualea.c,v 1.1 2017/04/17 08:59:37 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ualea.c,v 1.2 2017/04/17 09:16:13 riastradh Exp $");
 
 #include 
 #include 
@@ -55,11 +55,7 @@ struct ualea_softc {
 	struct usbd_xfer	*sc_xfer;
 	bool			sc_attached:1;
 	bool			sc_inflight:1;
-	/*
-	 * attached true->false only under lock
-	 * inflight false->true only under lock
-	 * issue xfer only under lock, if attached=true and inflight=false
-	 */
+	/* lock covers sc_attached, sc_inflight, and usbd_transfer(sc_xfer) */
 };
 
 static int	ualea_match(device_t, cfdata_t, void *);
@@ -228,5 +224,7 @@ ualea_xfer_done(struct usbd_xfer *xfer, 
 
 out:
 	/* Allow subsequent transfers.  */
+	mutex_enter(>sc_lock);
 	sc->sc_inflight = false;
+	mutex_exit(>sc_lock);
 }



CVS commit: src/sys/dev/usb

2017-04-17 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon Apr 17 09:16:13 UTC 2017

Modified Files:
src/sys/dev/usb: ualea.c

Log Message:
Tweak locking rule.  Fix broken unlocked rmw.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/usb/ualea.c

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

2017-04-17 Thread Kengo NAKAHARA
Module Name:src
Committed By:   knakahara
Date:   Mon Apr 17 09:06:55 UTC 2017

Modified Files:
src/distrib/sets/lists/debug: mi
src/distrib/sets/lists/tests: mi

Log Message:
fix build failure


To generate a diff of this commit:
cvs rdiff -u -r1.207 -r1.208 src/distrib/sets/lists/debug/mi
cvs rdiff -u -r1.734 -r1.735 src/distrib/sets/lists/tests/mi

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

Modified files:

Index: src/distrib/sets/lists/debug/mi
diff -u src/distrib/sets/lists/debug/mi:1.207 src/distrib/sets/lists/debug/mi:1.208
--- src/distrib/sets/lists/debug/mi:1.207	Mon Apr 17 08:59:37 2017
+++ src/distrib/sets/lists/debug/mi	Mon Apr 17 09:06:55 2017
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.207 2017/04/17 08:59:37 riastradh Exp $
+# $NetBSD: mi,v 1.208 2017/04/17 09:06:55 knakahara Exp $
 ./etc/mtree/set.debug   comp-sys-root
 ./usr/lib	comp-sys-usr		compatdir
 ./usr/lib/i18n/libBIG5_g.a			comp-c-debuglib		debuglib,compatfile
@@ -1585,10 +1585,12 @@
 ./usr/libdata/debug/usr/tests/crypto/libcrypto/h_srptest.debug		tests-crypto-debug	debug,atf,crypto,compattestfile
 ./usr/libdata/debug/usr/tests/crypto/libcrypto/h_threadstest.debug	tests-crypto-debug	debug,atf,crypto,compattestfile
 ./usr/libdata/debug/usr/tests/crypto/libcrypto/h_x509v3test.debug	tests-crypto-debug	debug,atf,crypto,compattestfile
+./usr/libdata/debug/usr/tests/crypto/opencrypto/h_aescbc.debug		tests-crypto-debug	debug,atf,crypto,compattestfile
 ./usr/libdata/debug/usr/tests/crypto/opencrypto/h_aesctr1.debug		tests-crypto-debug	debug,atf,crypto,compattestfile
 ./usr/libdata/debug/usr/tests/crypto/opencrypto/h_aesctr2.debug		tests-crypto-debug	debug,atf,crypto,compattestfile
 ./usr/libdata/debug/usr/tests/crypto/opencrypto/h_arc4.debug		tests-crypto-debug	debug,atf,crypto,compattestfile
 ./usr/libdata/debug/usr/tests/crypto/opencrypto/h_camellia.debug		tests-crypto-debug	debug,atf,crypto,compattestfile
+./usr/libdata/debug/usr/tests/crypto/opencrypto/h_cbc3des.debug		tests-crypto-debug	debug,atf,crypto,compattestfile
 ./usr/libdata/debug/usr/tests/crypto/opencrypto/h_cbcdes.debug		tests-crypto-debug	debug,atf,crypto,compattestfile
 ./usr/libdata/debug/usr/tests/crypto/opencrypto/h_comp.debug		tests-crypto-debug	debug,atf,crypto,compattestfile
 ./usr/libdata/debug/usr/tests/crypto/opencrypto/h_comp_zlib.debug		tests-crypto-debug	debug,atf,crypto,compattestfile

Index: src/distrib/sets/lists/tests/mi
diff -u src/distrib/sets/lists/tests/mi:1.734 src/distrib/sets/lists/tests/mi:1.735
--- src/distrib/sets/lists/tests/mi:1.734	Fri Apr 14 02:56:48 2017
+++ src/distrib/sets/lists/tests/mi	Mon Apr 17 09:06:55 2017
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.734 2017/04/14 02:56:48 ozaki-r Exp $
+# $NetBSD: mi,v 1.735 2017/04/17 09:06:55 knakahara Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -1341,11 +1341,13 @@
 ./usr/tests/crypto/opencrypto			tests-crypto-tests	compattestfile,atf
 ./usr/tests/crypto/opencrypto/Atffile		tests-crypto-tests	compattestfile,atf,crypto
 ./usr/tests/crypto/opencrypto/Kyuafile		tests-crypto-tests	compattestfile,atf,crypto,kyua
+./usr/tests/crypto/opencrypto/h_aescbc		tests-crypto-tests	compattestfile,atf,crypto
 ./usr/tests/crypto/opencrypto/h_aesctr1		tests-crypto-tests	compattestfile,atf,crypto
 ./usr/tests/crypto/opencrypto/h_aesctr2		tests-crypto-tests	compattestfile,atf,crypto
 ./usr/tests/crypto/opencrypto/h_arc4		tests-crypto-tests	compattestfile,atf,crypto
 ./usr/tests/crypto/opencrypto/h_camellia	tests-crypto-tests	compattestfile,atf,crypto
 ./usr/tests/crypto/opencrypto/h_cbcdes		tests-crypto-tests	compattestfile,atf,crypto
+./usr/tests/crypto/opencrypto/h_cbc3des		tests-crypto-tests	compattestfile,atf,crypto
 ./usr/tests/crypto/opencrypto/h_comp		tests-crypto-tests	compattestfile,atf,crypto
 ./usr/tests/crypto/opencrypto/h_comp_zlib	tests-crypto-tests	compattestfile,atf,crypto
 ./usr/tests/crypto/opencrypto/h_comp_zlib_rnd	tests-crypto-tests	compattestfile,atf,crypto



CVS commit: src/distrib/sets/lists

2017-04-17 Thread Kengo NAKAHARA
Module Name:src
Committed By:   knakahara
Date:   Mon Apr 17 09:06:55 UTC 2017

Modified Files:
src/distrib/sets/lists/debug: mi
src/distrib/sets/lists/tests: mi

Log Message:
fix build failure


To generate a diff of this commit:
cvs rdiff -u -r1.207 -r1.208 src/distrib/sets/lists/debug/mi
cvs rdiff -u -r1.734 -r1.735 src/distrib/sets/lists/tests/mi

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



CVS commit: src/sys/dev/usb

2017-04-17 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon Apr 17 09:03:50 UTC 2017

Modified Files:
src/sys/dev/usb: usbdevs.h usbdevs_data.h

Log Message:
regen


To generate a diff of this commit:
cvs rdiff -u -r1.721 -r1.722 src/sys/dev/usb/usbdevs.h
cvs rdiff -u -r1.722 -r1.723 src/sys/dev/usb/usbdevs_data.h

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



CVS commit: src

2017-04-17 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon Apr 17 08:59:38 UTC 2017

Modified Files:
src/distrib/sets/lists/base: shl.mi
src/distrib/sets/lists/comp: mi shl.mi
src/distrib/sets/lists/debug: mi shl.mi
src/sys/arch/amd64/conf: ALL GENERIC
src/sys/arch/i386/conf: ALL GENERIC
src/sys/dev/usb: files.usb usbdevices.config usbdevs
src/sys/rump/dev: Makefile.rumpdevcomp
Added Files:
src/sys/dev/usb: ualea.c
src/sys/rump/dev/lib/libualea: Makefile UALEA.ioconf ualea_component.c

Log Message:
New rndsource driver for Araneus Alea II TRNG USB devices.

Disabled by default in x86/GENERIC and usbdevices.config pending
review and testing without rump ugenhc in the way, but enabled in
x86/ALL for compile-testing.

(Hi gson!  Finally found a round tuit in my pocket, next to a certain
rectangular one.)


To generate a diff of this commit:
cvs rdiff -u -r1.807 -r1.808 src/distrib/sets/lists/base/shl.mi
cvs rdiff -u -r1.2123 -r1.2124 src/distrib/sets/lists/comp/mi
cvs rdiff -u -r1.302 -r1.303 src/distrib/sets/lists/comp/shl.mi
cvs rdiff -u -r1.206 -r1.207 src/distrib/sets/lists/debug/mi
cvs rdiff -u -r1.166 -r1.167 src/distrib/sets/lists/debug/shl.mi
cvs rdiff -u -r1.54 -r1.55 src/sys/arch/amd64/conf/ALL
cvs rdiff -u -r1.455 -r1.456 src/sys/arch/amd64/conf/GENERIC
cvs rdiff -u -r1.415 -r1.416 src/sys/arch/i386/conf/ALL
cvs rdiff -u -r1.1152 -r1.1153 src/sys/arch/i386/conf/GENERIC
cvs rdiff -u -r1.142 -r1.143 src/sys/dev/usb/files.usb
cvs rdiff -u -r0 -r1.1 src/sys/dev/usb/ualea.c
cvs rdiff -u -r1.27 -r1.28 src/sys/dev/usb/usbdevices.config
cvs rdiff -u -r1.730 -r1.731 src/sys/dev/usb/usbdevs
cvs rdiff -u -r1.23 -r1.24 src/sys/rump/dev/Makefile.rumpdevcomp
cvs rdiff -u -r0 -r1.1 src/sys/rump/dev/lib/libualea/Makefile \
src/sys/rump/dev/lib/libualea/UALEA.ioconf \
src/sys/rump/dev/lib/libualea/ualea_component.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/shl.mi
diff -u src/distrib/sets/lists/base/shl.mi:1.807 src/distrib/sets/lists/base/shl.mi:1.808
--- src/distrib/sets/lists/base/shl.mi:1.807	Fri Apr 14 02:43:27 2017
+++ src/distrib/sets/lists/base/shl.mi	Mon Apr 17 08:59:37 2017
@@ -1,4 +1,4 @@
-# $NetBSD: shl.mi,v 1.807 2017/04/14 02:43:27 ozaki-r Exp $
+# $NetBSD: shl.mi,v 1.808 2017/04/17 08:59:37 riastradh Exp $
 #
 # Note:	Don't delete entries from here - mark them as "obsolete" instead,
 #	unless otherwise stated below.
@@ -550,6 +550,9 @@
 ./usr/lib/librumpdev_sysmon.so			base-rump-shlib		rump
 ./usr/lib/librumpdev_sysmon.so.0		base-rump-shlib		rump
 ./usr/lib/librumpdev_sysmon.so.0.0		base-rump-shlib		rump
+./usr/lib/librumpdev_ualea.so			base-rump-shlib		rump
+./usr/lib/librumpdev_ualea.so.0			base-rump-shlib		rump
+./usr/lib/librumpdev_ualea.so.0.0		base-rump-shlib		rump
 ./usr/lib/librumpdev_ubt.so			base-rump-shlib		rump
 ./usr/lib/librumpdev_ubt.so.0			base-rump-shlib		rump
 ./usr/lib/librumpdev_ubt.so.0.0			base-rump-shlib		rump

Index: src/distrib/sets/lists/comp/mi
diff -u src/distrib/sets/lists/comp/mi:1.2123 src/distrib/sets/lists/comp/mi:1.2124
--- src/distrib/sets/lists/comp/mi:1.2123	Sat Apr 15 13:52:51 2017
+++ src/distrib/sets/lists/comp/mi	Mon Apr 17 08:59:37 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: mi,v 1.2123 2017/04/15 13:52:51 kamil Exp $
+#	$NetBSD: mi,v 1.2124 2017/04/17 08:59:37 riastradh Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 ./etc/mtree/set.compcomp-sys-root
@@ -3457,6 +3457,8 @@
 ./usr/lib/librumpdev_sysmon_p.a			comp-c-proflib		rump,profile
 ./usr/lib/librumpdev_ubt.a			comp-c-lib		rump
 ./usr/lib/librumpdev_ubt_p.a			comp-c-proflib		rump,profile
+./usr/lib/librumpdev_ualea.a			comp-c-lib		rump
+./usr/lib/librumpdev_ualea_p.a			comp-c-proflib		rump,profile
 ./usr/lib/librumpdev_ucom.a			comp-c-lib		rump
 ./usr/lib/librumpdev_ucom_p.a			comp-c-proflib		rump,profile
 ./usr/lib/librumpdev_ugenhc.a			comp-c-lib		rump

Index: src/distrib/sets/lists/comp/shl.mi
diff -u src/distrib/sets/lists/comp/shl.mi:1.302 src/distrib/sets/lists/comp/shl.mi:1.303
--- src/distrib/sets/lists/comp/shl.mi:1.302	Fri Apr 14 02:43:27 2017
+++ src/distrib/sets/lists/comp/shl.mi	Mon Apr 17 08:59:37 2017
@@ -1,4 +1,4 @@
-# $NetBSD: shl.mi,v 1.302 2017/04/14 02:43:27 ozaki-r Exp $
+# $NetBSD: shl.mi,v 1.303 2017/04/17 08:59:37 riastradh Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -169,6 +169,7 @@
 ./usr/lib/librumpdev_scsipi_pic.a		comp-c-piclib		picinstall,rump
 ./usr/lib/librumpdev_scsitest_pic.a		comp-obsolete		obsolete
 ./usr/lib/librumpdev_sysmon_pic.a		comp-c-piclib		picinstall,rump
+./usr/lib/librumpdev_ualea_pic.a		comp-c-piclib		picinstall,rump
 ./usr/lib/librumpdev_ubt_pic.a			comp-c-piclib		picinstall,rump
 ./usr/lib/librumpdev_ucom_pic.a			comp-c-piclib		picinstall,rump
 

CVS commit: src

2017-04-17 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon Apr 17 08:59:38 UTC 2017

Modified Files:
src/distrib/sets/lists/base: shl.mi
src/distrib/sets/lists/comp: mi shl.mi
src/distrib/sets/lists/debug: mi shl.mi
src/sys/arch/amd64/conf: ALL GENERIC
src/sys/arch/i386/conf: ALL GENERIC
src/sys/dev/usb: files.usb usbdevices.config usbdevs
src/sys/rump/dev: Makefile.rumpdevcomp
Added Files:
src/sys/dev/usb: ualea.c
src/sys/rump/dev/lib/libualea: Makefile UALEA.ioconf ualea_component.c

Log Message:
New rndsource driver for Araneus Alea II TRNG USB devices.

Disabled by default in x86/GENERIC and usbdevices.config pending
review and testing without rump ugenhc in the way, but enabled in
x86/ALL for compile-testing.

(Hi gson!  Finally found a round tuit in my pocket, next to a certain
rectangular one.)


To generate a diff of this commit:
cvs rdiff -u -r1.807 -r1.808 src/distrib/sets/lists/base/shl.mi
cvs rdiff -u -r1.2123 -r1.2124 src/distrib/sets/lists/comp/mi
cvs rdiff -u -r1.302 -r1.303 src/distrib/sets/lists/comp/shl.mi
cvs rdiff -u -r1.206 -r1.207 src/distrib/sets/lists/debug/mi
cvs rdiff -u -r1.166 -r1.167 src/distrib/sets/lists/debug/shl.mi
cvs rdiff -u -r1.54 -r1.55 src/sys/arch/amd64/conf/ALL
cvs rdiff -u -r1.455 -r1.456 src/sys/arch/amd64/conf/GENERIC
cvs rdiff -u -r1.415 -r1.416 src/sys/arch/i386/conf/ALL
cvs rdiff -u -r1.1152 -r1.1153 src/sys/arch/i386/conf/GENERIC
cvs rdiff -u -r1.142 -r1.143 src/sys/dev/usb/files.usb
cvs rdiff -u -r0 -r1.1 src/sys/dev/usb/ualea.c
cvs rdiff -u -r1.27 -r1.28 src/sys/dev/usb/usbdevices.config
cvs rdiff -u -r1.730 -r1.731 src/sys/dev/usb/usbdevs
cvs rdiff -u -r1.23 -r1.24 src/sys/rump/dev/Makefile.rumpdevcomp
cvs rdiff -u -r0 -r1.1 src/sys/rump/dev/lib/libualea/Makefile \
src/sys/rump/dev/lib/libualea/UALEA.ioconf \
src/sys/rump/dev/lib/libualea/ualea_component.c

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



CVS commit: src/sys/sys

2017-04-17 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Mon Apr 17 08:34:58 UTC 2017

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

Log Message:
Welcome to 7.99.70


To generate a diff of this commit:
cvs rdiff -u -r1.536 -r1.537 src/sys/sys/param.h

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

Modified files:

Index: src/sys/sys/param.h
diff -u src/sys/sys/param.h:1.536 src/sys/sys/param.h:1.537
--- src/sys/sys/param.h:1.536	Thu Apr 13 16:32:00 2017
+++ src/sys/sys/param.h	Mon Apr 17 08:34:58 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: param.h,v 1.536 2017/04/13 16:32:00 christos Exp $	*/
+/*	$NetBSD: param.h,v 1.537 2017/04/17 08:34:58 hannken Exp $	*/
 
 /*-
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -67,7 +67,7 @@
  *	2.99.9		(299000900)
  */
 
-#define	__NetBSD_Version__	799006900	/* NetBSD 7.99.69 */
+#define	__NetBSD_Version__	799007000	/* NetBSD 7.99.70 */
 
 #define __NetBSD_Prereq__(M,m,p) (M) * 1) + \
 (m) * 100) + (p) * 100) <= __NetBSD_Version__)



CVS commit: src/sys/sys

2017-04-17 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Mon Apr 17 08:34:58 UTC 2017

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

Log Message:
Welcome to 7.99.70


To generate a diff of this commit:
cvs rdiff -u -r1.536 -r1.537 src/sys/sys/param.h

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



CVS commit: src/sys

2017-04-17 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Mon Apr 17 08:34:27 UTC 2017

Modified Files:
src/sys/kern: vfs_mount.c vfs_subr.c
src/sys/sys: mount.h

Log Message:
Add vfs_trybusy() and mountlist_iterator_trynext() and use it for the syncer.


To generate a diff of this commit:
cvs rdiff -u -r1.57 -r1.58 src/sys/kern/vfs_mount.c
cvs rdiff -u -r1.462 -r1.463 src/sys/kern/vfs_subr.c
cvs rdiff -u -r1.225 -r1.226 src/sys/sys/mount.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/vfs_mount.c
diff -u src/sys/kern/vfs_mount.c:1.57 src/sys/kern/vfs_mount.c:1.58
--- src/sys/kern/vfs_mount.c:1.57	Mon Apr 17 08:32:55 2017
+++ src/sys/kern/vfs_mount.c	Mon Apr 17 08:34:27 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_mount.c,v 1.57 2017/04/17 08:32:55 hannken Exp $	*/
+/*	$NetBSD: vfs_mount.c,v 1.58 2017/04/17 08:34:27 hannken Exp $	*/
 
 /*-
  * Copyright (c) 1997-2011 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vfs_mount.c,v 1.57 2017/04/17 08:32:55 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_mount.c,v 1.58 2017/04/17 08:34:27 hannken Exp $");
 
 #include 
 #include 
@@ -311,13 +311,17 @@ vfs_rele(struct mount *mp)
  * => The caller must hold a pre-existing reference to the mount.
  * => Will fail if the file system is being unmounted, or is unmounted.
  */
-int
-vfs_busy(struct mount *mp)
+static inline int
+_vfs_busy(struct mount *mp, bool wait)
 {
 
 	KASSERT(mp->mnt_refcnt > 0);
 
-	mutex_enter(>mnt_unmounting);
+	if (wait) {
+		mutex_enter(>mnt_unmounting);
+	} else if (!mutex_tryenter(>mnt_unmounting)) {
+		return EBUSY;
+	}
 	if (__predict_false((mp->mnt_iflag & IMNT_GONE) != 0)) {
 		mutex_exit(>mnt_unmounting);
 		return ENOENT;
@@ -329,6 +333,20 @@ vfs_busy(struct mount *mp)
 	return 0;
 }
 
+int
+vfs_busy(struct mount *mp)
+{
+
+	return _vfs_busy(mp, true);
+}
+
+int
+vfs_trybusy(struct mount *mp)
+{
+
+	return _vfs_busy(mp, false);
+}
+
 /*
  * Unbusy a busy filesystem.
  *
@@ -1524,11 +1542,12 @@ mountlist_iterator_destroy(mount_iterato
  * Return the next mount or NULL for this iterator.
  * Mark it busy on success.
  */
-struct mount *
-mountlist_iterator_next(mount_iterator_t *mi)
+static inline struct mount *
+_mountlist_iterator_next(mount_iterator_t *mi, bool wait)
 {
 	struct mountlist_entry *me, *marker = >mi_entry;
 	struct mount *mp;
+	int error;
 
 	if (marker->me_mount != NULL) {
 		vfs_unbusy(marker->me_mount);
@@ -1559,7 +1578,11 @@ mountlist_iterator_next(mount_iterator_t
 		mutex_exit(_lock);
 
 		/* Try to mark this mount busy and return on success. */
-		if (vfs_busy(mp) == 0) {
+		if (wait)
+			error = vfs_busy(mp);
+		else
+			error = vfs_trybusy(mp);
+		if (error == 0) {
 			vfs_rele(mp);
 			marker->me_mount = mp;
 			return mp;
@@ -1569,6 +1592,20 @@ mountlist_iterator_next(mount_iterator_t
 	}
 }
 
+struct mount *
+mountlist_iterator_next(mount_iterator_t *mi)
+{
+
+	return _mountlist_iterator_next(mi, true);
+}
+
+struct mount *
+mountlist_iterator_trynext(mount_iterator_t *mi)
+{
+
+	return _mountlist_iterator_next(mi, false);
+}
+
 /*
  * Attach new mount to the end of the mount list.
  */

Index: src/sys/kern/vfs_subr.c
diff -u src/sys/kern/vfs_subr.c:1.462 src/sys/kern/vfs_subr.c:1.463
--- src/sys/kern/vfs_subr.c:1.462	Wed Apr 12 10:26:33 2017
+++ src/sys/kern/vfs_subr.c	Mon Apr 17 08:34:27 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_subr.c,v 1.462 2017/04/12 10:26:33 hannken Exp $	*/
+/*	$NetBSD: vfs_subr.c,v 1.463 2017/04/17 08:34:27 hannken Exp $	*/
 
 /*-
  * Copyright (c) 1997, 1998, 2004, 2005, 2007, 2008 The NetBSD Foundation, Inc.
@@ -68,7 +68,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vfs_subr.c,v 1.462 2017/04/12 10:26:33 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_subr.c,v 1.463 2017/04/17 08:34:27 hannken Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ddb.h"
@@ -775,7 +775,7 @@ sched_sync(void *arg)
 		 * Sync mounts whose dirty time has expired.
 		 */
 		mountlist_iterator_init();
-		while ((mp = mountlist_iterator_next(iter)) != NULL) {
+		while ((mp = mountlist_iterator_trynext(iter)) != NULL) {
 			if ((mp->mnt_iflag & IMNT_ONWORKLIST) == 0 ||
 			mp->mnt_synclist_slot != syncer_delayno) {
 continue;

Index: src/sys/sys/mount.h
diff -u src/sys/sys/mount.h:1.225 src/sys/sys/mount.h:1.226
--- src/sys/sys/mount.h:1.225	Mon Apr 17 08:32:01 2017
+++ src/sys/sys/mount.h	Mon Apr 17 08:34:27 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: mount.h,v 1.225 2017/04/17 08:32:01 hannken Exp $	*/
+/*	$NetBSD: mount.h,v 1.226 2017/04/17 08:34:27 hannken Exp $	*/
 
 /*
  * Copyright (c) 1989, 1991, 1993
@@ -417,6 +417,7 @@ bool	vfs_unmountall(struct lwp *);	/
 bool	vfs_unmountall1(struct lwp *, bool, bool);
 bool	vfs_unmount_forceone(struct lwp *);
 int 	vfs_busy(struct mount *);
+int 	vfs_trybusy(struct mount *);
 int	vfs_rootmountalloc(const char *, const char *, struct mount **);
 void	

CVS commit: src/sys

2017-04-17 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Mon Apr 17 08:34:27 UTC 2017

Modified Files:
src/sys/kern: vfs_mount.c vfs_subr.c
src/sys/sys: mount.h

Log Message:
Add vfs_trybusy() and mountlist_iterator_trynext() and use it for the syncer.


To generate a diff of this commit:
cvs rdiff -u -r1.57 -r1.58 src/sys/kern/vfs_mount.c
cvs rdiff -u -r1.462 -r1.463 src/sys/kern/vfs_subr.c
cvs rdiff -u -r1.225 -r1.226 src/sys/sys/mount.h

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



CVS commit: src/share/man/man9

2017-04-17 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Mon Apr 17 08:33:40 UTC 2017

Modified Files:
src/share/man/man9: vfssubr.9

Log Message:
Update vfs_busy(), vfs_unbusy(), vfs_mountalloc() and vfs_rootmountalloc().


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/share/man/man9/vfssubr.9

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



CVS commit: src/share/man/man9

2017-04-17 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Mon Apr 17 08:33:40 UTC 2017

Modified Files:
src/share/man/man9: vfssubr.9

Log Message:
Update vfs_busy(), vfs_unbusy(), vfs_mountalloc() and vfs_rootmountalloc().


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/share/man/man9/vfssubr.9

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/man9/vfssubr.9
diff -u src/share/man/man9/vfssubr.9:1.25 src/share/man/man9/vfssubr.9:1.26
--- src/share/man/man9/vfssubr.9:1.25	Sat May 24 17:14:02 2014
+++ src/share/man/man9/vfssubr.9	Mon Apr 17 08:33:40 2017
@@ -1,4 +1,4 @@
-.\" $NetBSD: vfssubr.9,v 1.25 2014/05/24 17:14:02 wiz Exp $
+.\" $NetBSD: vfssubr.9,v 1.26 2017/04/17 08:33:40 hannken Exp $
 .\"
 .\" Copyright (c) 2003, 2005, 2006 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 May 24, 2014
+.Dd Apr 17, 2017
 .Dt VFSSUBR 9
 .Os
 .Sh NAME
@@ -77,9 +77,9 @@
 .Ft void
 .Fn vfs_unmountall  "struct lwp *l"
 .Ft int
-.Fn vfs_busy "struct mount *mp" "struct mount **nextp"
+.Fn vfs_busy "struct mount *mp"
 .Ft void
-.Fn vfs_unbusy "struct mount *mp" "bool keepref" "struct mount **nextp"
+.Fn vfs_unbusy "struct mount *mp"
 .Ft struct mount *
 .Fn vfs_mountalloc "struct vfsops *vfs" "struct vnode *vp"
 .Ft int
@@ -139,42 +139,17 @@ by the vnode
 Mount the root file system.
 .It Fn vfs_unmountall "l"
 Unmount all file systems.
-.It Fn vfs_busy "mp" "nextp"
+.It Fn vfs_busy "mp"
 Mark the mount point specified by
 .Fa mp
 as busy and get a reference to it.
 This function is used to synchronize access and to delay unmounting.
 The caller must hold a pre-existing reference to the mount.
-If
-.Fa nextp
-is not
-.Dv NULL ,
-the caller must hold the
-.Em mountlist_lock
-and
-.Fa nextp
-will receive the next mount from mount list on error.
-The
-.Em mountlist_lock
-is released on return.
-.It Fn vfs_unbusy "mp" "keepref" "nextp"
+.It Fn vfs_unbusy "mp"
 Undo a
 .Fn vfs_busy
 on the mount point specified by
 .Fa mp .
-If
-.Fa keepref
-is true, preserve the reference added by
-.Fn vfs_busy .
-If
-.Fa nextp
-is not
-.Dv NULL ,
-the
-.Em mountlist_lock
-will be aquired and
-.Fa nextp
-will receive the next mount from mount list.
 .It Fn vfs_mountalloc "vfsops" "vp"
 Allocate and initialise a mount structure, setting
 .Em mnt_vnodecovered
@@ -184,14 +159,15 @@ and
 .Em mnt_op
 to
 .Fa vfsops .
-On success, mark the mount structure as busy and return its address.
+On success return the address of the mount structure.
 Otherwise, return
 .Dv NULL .
 .It Fn vfs_rootmountalloc "fstypename" "devname" "mpp"
 Lookup a file system type specified by the name
 .Fa fstypename
 and if found allocate and initialise a mount structure for it.
-The allocated mount structure is returned in the address specified by
+The allocated mount structure is marked as busy and returned in the
+address specified by
 .Fa mpp .
 The device the root file system was mounted from is specified by the
 argument



CVS commit: src/sys/kern

2017-04-17 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Mon Apr 17 08:32:55 UTC 2017

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

Log Message:
No need to keep a not yet visible mount busy.  Move vfs_busy()
from vfs_mountalloc() to vfs_rootmountalloc().

XXX: Do we really need to vfs_busy() for vfs_mountroot?


To generate a diff of this commit:
cvs rdiff -u -r1.56 -r1.57 src/sys/kern/vfs_mount.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/vfs_mount.c
diff -u src/sys/kern/vfs_mount.c:1.56 src/sys/kern/vfs_mount.c:1.57
--- src/sys/kern/vfs_mount.c:1.56	Mon Apr 17 08:32:01 2017
+++ src/sys/kern/vfs_mount.c	Mon Apr 17 08:32:55 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_mount.c,v 1.56 2017/04/17 08:32:01 hannken Exp $	*/
+/*	$NetBSD: vfs_mount.c,v 1.57 2017/04/17 08:32:55 hannken Exp $	*/
 
 /*-
  * Copyright (c) 1997-2011 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vfs_mount.c,v 1.56 2017/04/17 08:32:01 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_mount.c,v 1.57 2017/04/17 08:32:55 hannken Exp $");
 
 #include 
 #include 
@@ -148,7 +148,6 @@ struct mount *
 vfs_mountalloc(struct vfsops *vfsops, vnode_t *vp)
 {
 	struct mount *mp;
-	int error __diagused;
 
 	mp = kmem_zalloc(sizeof(*mp), KM_SLEEP);
 	if (mp == NULL)
@@ -160,8 +159,6 @@ vfs_mountalloc(struct vfsops *vfsops, vn
 	mutex_init(>mnt_unmounting, MUTEX_DEFAULT, IPL_NONE);
 	mutex_init(>mnt_renamelock, MUTEX_DEFAULT, IPL_NONE);
 	mutex_init(>mnt_updating, MUTEX_DEFAULT, IPL_NONE);
-	error = vfs_busy(mp);
-	KASSERT(error == 0);
 	mp->mnt_vnodecovered = vp;
 	mount_initspecific(mp);
 
@@ -184,6 +181,7 @@ vfs_rootmountalloc(const char *fstypenam
 {
 	struct vfsops *vfsp = NULL;
 	struct mount *mp;
+	int error __diagused;
 
 	mutex_enter(_list_lock);
 	LIST_FOREACH(vfsp, _list, vfs_list)
@@ -199,6 +197,8 @@ vfs_rootmountalloc(const char *fstypenam
 
 	if ((mp = vfs_mountalloc(vfsp, NULL)) == NULL)
 		return ENOMEM;
+	error = vfs_busy(mp);
+	KASSERT(error == 0);
 	mp->mnt_flag = MNT_RDONLY;
 	(void)strlcpy(mp->mnt_stat.f_fstypename, vfsp->vfs_name,
 	sizeof(mp->mnt_stat.f_fstypename));
@@ -721,7 +721,6 @@ mount_domount(struct lwp *l, vnode_t **v
 	}
 
 	if ((error = fstrans_mount(mp)) != 0) {
-		vfs_unbusy(mp);
 		vfs_rele(mp);
 		return error;
 	}
@@ -789,7 +788,6 @@ mount_domount(struct lwp *l, vnode_t **v
 
 	/* Hold an additional reference to the mount across VFS_START(). */
 	vfs_ref(mp);
-	vfs_unbusy(mp);
 	(void) VFS_STATVFS(mp, >mnt_stat);
 	error = VFS_START(mp, 0);
if (error) {
@@ -810,7 +808,6 @@ err_unmounted:
 	vp->v_mountedhere = NULL;
 	mutex_exit(>mnt_updating);
 	fstrans_unmount(mp);
-	vfs_unbusy(mp);
 	vfs_rele(mp);
 
 	return error;



CVS commit: src/sys/kern

2017-04-17 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Mon Apr 17 08:32:55 UTC 2017

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

Log Message:
No need to keep a not yet visible mount busy.  Move vfs_busy()
from vfs_mountalloc() to vfs_rootmountalloc().

XXX: Do we really need to vfs_busy() for vfs_mountroot?


To generate a diff of this commit:
cvs rdiff -u -r1.56 -r1.57 src/sys/kern/vfs_mount.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-04-17 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Mon Apr 17 08:32:02 UTC 2017

Modified Files:
src/sys/fs/cd9660: cd9660_vfsops.c
src/sys/fs/filecorefs: filecore_vfsops.c
src/sys/fs/msdosfs: msdosfs_vfsops.c
src/sys/fs/ntfs: ntfs_vfsops.c
src/sys/fs/union: union_vnops.c
src/sys/fs/v7fs: v7fs_vfsops.c
src/sys/kern: vfs_lookup.c vfs_mount.c vfs_syscalls.c vfs_trans.c
vfs_vnode.c
src/sys/nfs: nfs_export.c nfs_vfsops.c
src/sys/rump/librump/rumpvfs: rumpfs.c
src/sys/sys: mount.h
src/sys/ufs/ext2fs: ext2fs_vfsops.c
src/sys/ufs/ffs: ffs_vfsops.c
src/sys/ufs/lfs: lfs_bio.c lfs_syscalls.c lfs_vfsops.c ulfs_vfsops.c
src/sys/ufs/mfs: mfs_vfsops.c
src/sys/ufs/ufs: ufs_vfsops.c

Log Message:
Remove unused argument "nextp" from vfs_busy() and vfs_unbusy().
Remove argument "keepref" from vfs_unbusy() and add vfs_ref() where needed.


To generate a diff of this commit:
cvs rdiff -u -r1.92 -r1.93 src/sys/fs/cd9660/cd9660_vfsops.c
cvs rdiff -u -r1.80 -r1.81 src/sys/fs/filecorefs/filecore_vfsops.c
cvs rdiff -u -r1.126 -r1.127 src/sys/fs/msdosfs/msdosfs_vfsops.c
cvs rdiff -u -r1.106 -r1.107 src/sys/fs/ntfs/ntfs_vfsops.c
cvs rdiff -u -r1.65 -r1.66 src/sys/fs/union/union_vnops.c
cvs rdiff -u -r1.14 -r1.15 src/sys/fs/v7fs/v7fs_vfsops.c
cvs rdiff -u -r1.205 -r1.206 src/sys/kern/vfs_lookup.c
cvs rdiff -u -r1.55 -r1.56 src/sys/kern/vfs_mount.c
cvs rdiff -u -r1.511 -r1.512 src/sys/kern/vfs_syscalls.c
cvs rdiff -u -r1.42 -r1.43 src/sys/kern/vfs_trans.c
cvs rdiff -u -r1.86 -r1.87 src/sys/kern/vfs_vnode.c
cvs rdiff -u -r1.59 -r1.60 src/sys/nfs/nfs_export.c
cvs rdiff -u -r1.234 -r1.235 src/sys/nfs/nfs_vfsops.c
cvs rdiff -u -r1.146 -r1.147 src/sys/rump/librump/rumpvfs/rumpfs.c
cvs rdiff -u -r1.224 -r1.225 src/sys/sys/mount.h
cvs rdiff -u -r1.207 -r1.208 src/sys/ufs/ext2fs/ext2fs_vfsops.c
cvs rdiff -u -r1.352 -r1.353 src/sys/ufs/ffs/ffs_vfsops.c
cvs rdiff -u -r1.138 -r1.139 src/sys/ufs/lfs/lfs_bio.c
cvs rdiff -u -r1.173 -r1.174 src/sys/ufs/lfs/lfs_syscalls.c
cvs rdiff -u -r1.358 -r1.359 src/sys/ufs/lfs/lfs_vfsops.c
cvs rdiff -u -r1.12 -r1.13 src/sys/ufs/lfs/ulfs_vfsops.c
cvs rdiff -u -r1.112 -r1.113 src/sys/ufs/mfs/mfs_vfsops.c
cvs rdiff -u -r1.54 -r1.55 src/sys/ufs/ufs/ufs_vfsops.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/fs/cd9660/cd9660_vfsops.c
diff -u src/sys/fs/cd9660/cd9660_vfsops.c:1.92 src/sys/fs/cd9660/cd9660_vfsops.c:1.93
--- src/sys/fs/cd9660/cd9660_vfsops.c:1.92	Mon Apr 17 08:31:01 2017
+++ src/sys/fs/cd9660/cd9660_vfsops.c	Mon Apr 17 08:32:00 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: cd9660_vfsops.c,v 1.92 2017/04/17 08:31:01 hannken Exp $	*/
+/*	$NetBSD: cd9660_vfsops.c,v 1.93 2017/04/17 08:32:00 hannken Exp $	*/
 
 /*-
  * Copyright (c) 1994
@@ -37,7 +37,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cd9660_vfsops.c,v 1.92 2017/04/17 08:31:01 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cd9660_vfsops.c,v 1.93 2017/04/17 08:32:00 hannken Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_netbsd.h"
@@ -191,13 +191,13 @@ cd9660_mountroot(void)
 
 	args.flags = ISOFSMNT_ROOT;
 	if ((error = iso_mountfs(rootvp, mp, l, )) != 0) {
-		vfs_unbusy(mp, false, NULL);
+		vfs_unbusy(mp);
 		vfs_rele(mp);
 		return (error);
 	}
 	mountlist_append(mp);
 	(void)cd9660_statvfs(mp, >mnt_stat);
-	vfs_unbusy(mp, false, NULL);
+	vfs_unbusy(mp);
 	return (0);
 }
 

Index: src/sys/fs/filecorefs/filecore_vfsops.c
diff -u src/sys/fs/filecorefs/filecore_vfsops.c:1.80 src/sys/fs/filecorefs/filecore_vfsops.c:1.81
--- src/sys/fs/filecorefs/filecore_vfsops.c:1.80	Mon Apr 17 08:31:01 2017
+++ src/sys/fs/filecorefs/filecore_vfsops.c	Mon Apr 17 08:32:00 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: filecore_vfsops.c,v 1.80 2017/04/17 08:31:01 hannken Exp $	*/
+/*	$NetBSD: filecore_vfsops.c,v 1.81 2017/04/17 08:32:00 hannken Exp $	*/
 
 /*-
  * Copyright (c) 1994 The Regents of the University of California.
@@ -66,7 +66,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: filecore_vfsops.c,v 1.80 2017/04/17 08:31:01 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: filecore_vfsops.c,v 1.81 2017/04/17 08:32:00 hannken Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_netbsd.h"
@@ -201,13 +201,13 @@ filecore_mountroot(void)
 
 	args.flags = FILECOREMNT_ROOT;
 	if ((error = filecore_mountfs(rootvp, mp, p, )) != 0) {
-		vfs_unbusy(mp, false, NULL);
+		vfs_unbusy(mp);
 		vfs_rele(mp);
 		return (error);
 	}
 	mountlist_append(mp);
 	(void)filecore_statvfs(mp, >mnt_stat, p);
-	vfs_unbusy(mp, false, NULL);
+	vfs_unbusy(mp);
 	return (0);
 }
 #endif

Index: src/sys/fs/msdosfs/msdosfs_vfsops.c
diff -u src/sys/fs/msdosfs/msdosfs_vfsops.c:1.126 src/sys/fs/msdosfs/msdosfs_vfsops.c:1.127
--- src/sys/fs/msdosfs/msdosfs_vfsops.c:1.126	Mon Apr 17 08:31:01 2017
+++ src/sys/fs/msdosfs/msdosfs_vfsops.c	Mon Apr 17 08:32:00 2017
@@ -1,4 

CVS commit: src/sys

2017-04-17 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Mon Apr 17 08:32:02 UTC 2017

Modified Files:
src/sys/fs/cd9660: cd9660_vfsops.c
src/sys/fs/filecorefs: filecore_vfsops.c
src/sys/fs/msdosfs: msdosfs_vfsops.c
src/sys/fs/ntfs: ntfs_vfsops.c
src/sys/fs/union: union_vnops.c
src/sys/fs/v7fs: v7fs_vfsops.c
src/sys/kern: vfs_lookup.c vfs_mount.c vfs_syscalls.c vfs_trans.c
vfs_vnode.c
src/sys/nfs: nfs_export.c nfs_vfsops.c
src/sys/rump/librump/rumpvfs: rumpfs.c
src/sys/sys: mount.h
src/sys/ufs/ext2fs: ext2fs_vfsops.c
src/sys/ufs/ffs: ffs_vfsops.c
src/sys/ufs/lfs: lfs_bio.c lfs_syscalls.c lfs_vfsops.c ulfs_vfsops.c
src/sys/ufs/mfs: mfs_vfsops.c
src/sys/ufs/ufs: ufs_vfsops.c

Log Message:
Remove unused argument "nextp" from vfs_busy() and vfs_unbusy().
Remove argument "keepref" from vfs_unbusy() and add vfs_ref() where needed.


To generate a diff of this commit:
cvs rdiff -u -r1.92 -r1.93 src/sys/fs/cd9660/cd9660_vfsops.c
cvs rdiff -u -r1.80 -r1.81 src/sys/fs/filecorefs/filecore_vfsops.c
cvs rdiff -u -r1.126 -r1.127 src/sys/fs/msdosfs/msdosfs_vfsops.c
cvs rdiff -u -r1.106 -r1.107 src/sys/fs/ntfs/ntfs_vfsops.c
cvs rdiff -u -r1.65 -r1.66 src/sys/fs/union/union_vnops.c
cvs rdiff -u -r1.14 -r1.15 src/sys/fs/v7fs/v7fs_vfsops.c
cvs rdiff -u -r1.205 -r1.206 src/sys/kern/vfs_lookup.c
cvs rdiff -u -r1.55 -r1.56 src/sys/kern/vfs_mount.c
cvs rdiff -u -r1.511 -r1.512 src/sys/kern/vfs_syscalls.c
cvs rdiff -u -r1.42 -r1.43 src/sys/kern/vfs_trans.c
cvs rdiff -u -r1.86 -r1.87 src/sys/kern/vfs_vnode.c
cvs rdiff -u -r1.59 -r1.60 src/sys/nfs/nfs_export.c
cvs rdiff -u -r1.234 -r1.235 src/sys/nfs/nfs_vfsops.c
cvs rdiff -u -r1.146 -r1.147 src/sys/rump/librump/rumpvfs/rumpfs.c
cvs rdiff -u -r1.224 -r1.225 src/sys/sys/mount.h
cvs rdiff -u -r1.207 -r1.208 src/sys/ufs/ext2fs/ext2fs_vfsops.c
cvs rdiff -u -r1.352 -r1.353 src/sys/ufs/ffs/ffs_vfsops.c
cvs rdiff -u -r1.138 -r1.139 src/sys/ufs/lfs/lfs_bio.c
cvs rdiff -u -r1.173 -r1.174 src/sys/ufs/lfs/lfs_syscalls.c
cvs rdiff -u -r1.358 -r1.359 src/sys/ufs/lfs/lfs_vfsops.c
cvs rdiff -u -r1.12 -r1.13 src/sys/ufs/lfs/ulfs_vfsops.c
cvs rdiff -u -r1.112 -r1.113 src/sys/ufs/mfs/mfs_vfsops.c
cvs rdiff -u -r1.54 -r1.55 src/sys/ufs/ufs/ufs_vfsops.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-04-17 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Mon Apr 17 08:31:02 UTC 2017

Modified Files:
src/sys/fs/cd9660: cd9660_vfsops.c
src/sys/fs/filecorefs: filecore_vfsops.c
src/sys/fs/msdosfs: msdosfs_vfsops.c
src/sys/fs/ntfs: ntfs_vfsops.c
src/sys/fs/puffs: puffs_msgif.c
src/sys/fs/v7fs: v7fs_vfsops.c
src/sys/kern: vfs_mount.c vfs_syscalls.c vfs_trans.c vfs_vnode.c
src/sys/nfs: nfs_vfsops.c
src/sys/sys: mount.h
src/sys/ufs/ext2fs: ext2fs_vfsops.c
src/sys/ufs/ffs: ffs_vfsops.c
src/sys/ufs/lfs: lfs_vfsops.c
src/sys/ufs/mfs: mfs_vfsops.c

Log Message:
Add vfs_ref(mp) and vfs_rele(mp) to add or remove a reference to
struct mount.  Rename vfs_destroy(mp) to vfs_rele(mp) and replace
incrementing mp->mnt_refcnt with vfs_ref(mp).


To generate a diff of this commit:
cvs rdiff -u -r1.91 -r1.92 src/sys/fs/cd9660/cd9660_vfsops.c
cvs rdiff -u -r1.79 -r1.80 src/sys/fs/filecorefs/filecore_vfsops.c
cvs rdiff -u -r1.125 -r1.126 src/sys/fs/msdosfs/msdosfs_vfsops.c
cvs rdiff -u -r1.105 -r1.106 src/sys/fs/ntfs/ntfs_vfsops.c
cvs rdiff -u -r1.100 -r1.101 src/sys/fs/puffs/puffs_msgif.c
cvs rdiff -u -r1.13 -r1.14 src/sys/fs/v7fs/v7fs_vfsops.c
cvs rdiff -u -r1.54 -r1.55 src/sys/kern/vfs_mount.c
cvs rdiff -u -r1.510 -r1.511 src/sys/kern/vfs_syscalls.c
cvs rdiff -u -r1.41 -r1.42 src/sys/kern/vfs_trans.c
cvs rdiff -u -r1.85 -r1.86 src/sys/kern/vfs_vnode.c
cvs rdiff -u -r1.233 -r1.234 src/sys/nfs/nfs_vfsops.c
cvs rdiff -u -r1.223 -r1.224 src/sys/sys/mount.h
cvs rdiff -u -r1.206 -r1.207 src/sys/ufs/ext2fs/ext2fs_vfsops.c
cvs rdiff -u -r1.351 -r1.352 src/sys/ufs/ffs/ffs_vfsops.c
cvs rdiff -u -r1.357 -r1.358 src/sys/ufs/lfs/lfs_vfsops.c
cvs rdiff -u -r1.111 -r1.112 src/sys/ufs/mfs/mfs_vfsops.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/fs/cd9660/cd9660_vfsops.c
diff -u src/sys/fs/cd9660/cd9660_vfsops.c:1.91 src/sys/fs/cd9660/cd9660_vfsops.c:1.92
--- src/sys/fs/cd9660/cd9660_vfsops.c:1.91	Fri Feb 17 08:31:24 2017
+++ src/sys/fs/cd9660/cd9660_vfsops.c	Mon Apr 17 08:31:01 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: cd9660_vfsops.c,v 1.91 2017/02/17 08:31:24 hannken Exp $	*/
+/*	$NetBSD: cd9660_vfsops.c,v 1.92 2017/04/17 08:31:01 hannken Exp $	*/
 
 /*-
  * Copyright (c) 1994
@@ -37,7 +37,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cd9660_vfsops.c,v 1.91 2017/02/17 08:31:24 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cd9660_vfsops.c,v 1.92 2017/04/17 08:31:01 hannken Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_netbsd.h"
@@ -192,7 +192,7 @@ cd9660_mountroot(void)
 	args.flags = ISOFSMNT_ROOT;
 	if ((error = iso_mountfs(rootvp, mp, l, )) != 0) {
 		vfs_unbusy(mp, false, NULL);
-		vfs_destroy(mp);
+		vfs_rele(mp);
 		return (error);
 	}
 	mountlist_append(mp);

Index: src/sys/fs/filecorefs/filecore_vfsops.c
diff -u src/sys/fs/filecorefs/filecore_vfsops.c:1.79 src/sys/fs/filecorefs/filecore_vfsops.c:1.80
--- src/sys/fs/filecorefs/filecore_vfsops.c:1.79	Fri Feb 17 08:31:24 2017
+++ src/sys/fs/filecorefs/filecore_vfsops.c	Mon Apr 17 08:31:01 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: filecore_vfsops.c,v 1.79 2017/02/17 08:31:24 hannken Exp $	*/
+/*	$NetBSD: filecore_vfsops.c,v 1.80 2017/04/17 08:31:01 hannken Exp $	*/
 
 /*-
  * Copyright (c) 1994 The Regents of the University of California.
@@ -66,7 +66,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: filecore_vfsops.c,v 1.79 2017/02/17 08:31:24 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: filecore_vfsops.c,v 1.80 2017/04/17 08:31:01 hannken Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_netbsd.h"
@@ -202,7 +202,7 @@ filecore_mountroot(void)
 	args.flags = FILECOREMNT_ROOT;
 	if ((error = filecore_mountfs(rootvp, mp, p, )) != 0) {
 		vfs_unbusy(mp, false, NULL);
-		vfs_destroy(mp);
+		vfs_rele(mp);
 		return (error);
 	}
 	mountlist_append(mp);

Index: src/sys/fs/msdosfs/msdosfs_vfsops.c
diff -u src/sys/fs/msdosfs/msdosfs_vfsops.c:1.125 src/sys/fs/msdosfs/msdosfs_vfsops.c:1.126
--- src/sys/fs/msdosfs/msdosfs_vfsops.c:1.125	Sat Apr  1 19:35:56 2017
+++ src/sys/fs/msdosfs/msdosfs_vfsops.c	Mon Apr 17 08:31:01 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: msdosfs_vfsops.c,v 1.125 2017/04/01 19:35:56 riastradh Exp $	*/
+/*	$NetBSD: msdosfs_vfsops.c,v 1.126 2017/04/17 08:31:01 hannken Exp $	*/
 
 /*-
  * Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank.
@@ -48,7 +48,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: msdosfs_vfsops.c,v 1.125 2017/04/01 19:35:56 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: msdosfs_vfsops.c,v 1.126 2017/04/17 08:31:01 hannken Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_netbsd.h"
@@ -248,14 +248,14 @@ msdosfs_mountroot(void)
 
 	if ((error = msdosfs_mountfs(rootvp, mp, l, )) != 0) {
 		vfs_unbusy(mp, false, NULL);
-		vfs_destroy(mp);
+		vfs_rele(mp);
 		return (error);
 	}
 
 	if ((error = update_mp(mp, )) != 0) {
 		

CVS commit: src/sys

2017-04-17 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Mon Apr 17 08:31:02 UTC 2017

Modified Files:
src/sys/fs/cd9660: cd9660_vfsops.c
src/sys/fs/filecorefs: filecore_vfsops.c
src/sys/fs/msdosfs: msdosfs_vfsops.c
src/sys/fs/ntfs: ntfs_vfsops.c
src/sys/fs/puffs: puffs_msgif.c
src/sys/fs/v7fs: v7fs_vfsops.c
src/sys/kern: vfs_mount.c vfs_syscalls.c vfs_trans.c vfs_vnode.c
src/sys/nfs: nfs_vfsops.c
src/sys/sys: mount.h
src/sys/ufs/ext2fs: ext2fs_vfsops.c
src/sys/ufs/ffs: ffs_vfsops.c
src/sys/ufs/lfs: lfs_vfsops.c
src/sys/ufs/mfs: mfs_vfsops.c

Log Message:
Add vfs_ref(mp) and vfs_rele(mp) to add or remove a reference to
struct mount.  Rename vfs_destroy(mp) to vfs_rele(mp) and replace
incrementing mp->mnt_refcnt with vfs_ref(mp).


To generate a diff of this commit:
cvs rdiff -u -r1.91 -r1.92 src/sys/fs/cd9660/cd9660_vfsops.c
cvs rdiff -u -r1.79 -r1.80 src/sys/fs/filecorefs/filecore_vfsops.c
cvs rdiff -u -r1.125 -r1.126 src/sys/fs/msdosfs/msdosfs_vfsops.c
cvs rdiff -u -r1.105 -r1.106 src/sys/fs/ntfs/ntfs_vfsops.c
cvs rdiff -u -r1.100 -r1.101 src/sys/fs/puffs/puffs_msgif.c
cvs rdiff -u -r1.13 -r1.14 src/sys/fs/v7fs/v7fs_vfsops.c
cvs rdiff -u -r1.54 -r1.55 src/sys/kern/vfs_mount.c
cvs rdiff -u -r1.510 -r1.511 src/sys/kern/vfs_syscalls.c
cvs rdiff -u -r1.41 -r1.42 src/sys/kern/vfs_trans.c
cvs rdiff -u -r1.85 -r1.86 src/sys/kern/vfs_vnode.c
cvs rdiff -u -r1.233 -r1.234 src/sys/nfs/nfs_vfsops.c
cvs rdiff -u -r1.223 -r1.224 src/sys/sys/mount.h
cvs rdiff -u -r1.206 -r1.207 src/sys/ufs/ext2fs/ext2fs_vfsops.c
cvs rdiff -u -r1.351 -r1.352 src/sys/ufs/ffs/ffs_vfsops.c
cvs rdiff -u -r1.357 -r1.358 src/sys/ufs/lfs/lfs_vfsops.c
cvs rdiff -u -r1.111 -r1.112 src/sys/ufs/mfs/mfs_vfsops.c

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



CVS commit: src

2017-04-17 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Mon Apr 17 08:29:58 UTC 2017

Modified Files:
src/sys/kern: vfs_mount.c
src/sys/sys: mount.h
src/usr.sbin/pstat: pstat.c

Log Message:
Cleanup after mountlist iterator:
- remove now unused field mnt_list.
- rename mount_list to mountlist and make it local to vfs_mount.c.
- make mountlist_lock local to vfs_mount.c.

Change pstat.c to retrieve vnodes by lru lists.


To generate a diff of this commit:
cvs rdiff -u -r1.53 -r1.54 src/sys/kern/vfs_mount.c
cvs rdiff -u -r1.222 -r1.223 src/sys/sys/mount.h
cvs rdiff -u -r1.126 -r1.127 src/usr.sbin/pstat/pstat.c

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



CVS commit: src

2017-04-17 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Mon Apr 17 08:29:58 UTC 2017

Modified Files:
src/sys/kern: vfs_mount.c
src/sys/sys: mount.h
src/usr.sbin/pstat: pstat.c

Log Message:
Cleanup after mountlist iterator:
- remove now unused field mnt_list.
- rename mount_list to mountlist and make it local to vfs_mount.c.
- make mountlist_lock local to vfs_mount.c.

Change pstat.c to retrieve vnodes by lru lists.


To generate a diff of this commit:
cvs rdiff -u -r1.53 -r1.54 src/sys/kern/vfs_mount.c
cvs rdiff -u -r1.222 -r1.223 src/sys/sys/mount.h
cvs rdiff -u -r1.126 -r1.127 src/usr.sbin/pstat/pstat.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/vfs_mount.c
diff -u src/sys/kern/vfs_mount.c:1.53 src/sys/kern/vfs_mount.c:1.54
--- src/sys/kern/vfs_mount.c:1.53	Wed Apr 12 10:35:10 2017
+++ src/sys/kern/vfs_mount.c	Mon Apr 17 08:29:58 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_mount.c,v 1.53 2017/04/12 10:35:10 hannken Exp $	*/
+/*	$NetBSD: vfs_mount.c,v 1.54 2017/04/17 08:29:58 hannken Exp $	*/
 
 /*-
  * Copyright (c) 1997-2011 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vfs_mount.c,v 1.53 2017/04/12 10:35:10 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_mount.c,v 1.54 2017/04/17 08:29:58 hannken Exp $");
 
 #include 
 #include 
@@ -108,8 +108,6 @@ struct mount_iterator {
 	struct mountlist_entry mi_entry;
 };
 
-static TAILQ_HEAD(mountlist, mountlist_entry) mount_list;
-
 static struct vnode *vfs_vnode_iterator_next1(struct vnode_iterator *,
 bool (*)(void *, struct vnode *), void *, bool);
 
@@ -117,10 +115,10 @@ static struct vnode *vfs_vnode_iterator_
 vnode_t *			rootvnode;
 
 /* Mounted filesystem list. */
-struct mntlist			mountlist;
-kmutex_t			mountlist_lock;
-int vnode_offset_next_by_mount	/* XXX: ugly hack for pstat.c */
-= offsetof(vnode_impl_t, vi_mntvnodes.tqe_next);
+static TAILQ_HEAD(mountlist, mountlist_entry) mountlist;
+static kmutex_t			mountlist_lock;
+int vnode_offset_next_by_lru	/* XXX: ugly hack for pstat.c */
+= offsetof(vnode_impl_t, vi_lrulist.tqe_next);
 
 kmutex_t			mntvnode_lock;
 kmutex_t			vfs_list_lock;
@@ -135,7 +133,6 @@ void
 vfs_mount_sysinit(void)
 {
 
-	TAILQ_INIT(_list);
 	TAILQ_INIT();
 	mutex_init(_lock, MUTEX_DEFAULT, IPL_NONE);
 	mutex_init(_lock, MUTEX_DEFAULT, IPL_NONE);
@@ -308,21 +305,16 @@ vfs_busy(struct mount *mp, struct mount 
 
 	KASSERT(mp->mnt_refcnt > 0);
 
+	KASSERT(nextp == NULL);
+
 	mutex_enter(>mnt_unmounting);
 	if (__predict_false((mp->mnt_iflag & IMNT_GONE) != 0)) {
 		mutex_exit(>mnt_unmounting);
-		if (nextp != NULL) {
-			KASSERT(mutex_owned(_lock));
-			*nextp = TAILQ_NEXT(mp, mnt_list);
-		}
 		return ENOENT;
 	}
 	++mp->mnt_busynest;
 	KASSERT(mp->mnt_busynest != 0);
 	mutex_exit(>mnt_unmounting);
-	if (nextp != NULL) {
-		mutex_exit(_lock);
-	}
 	atomic_inc_uint(>mnt_refcnt);
 	return 0;
 }
@@ -341,9 +333,8 @@ vfs_unbusy(struct mount *mp, bool keepre
 
 	KASSERT(mp->mnt_refcnt > 0);
 
-	if (nextp != NULL) {
-		mutex_enter(_lock);
-	}
+	KASSERT(nextp == NULL);
+
 	mutex_enter(>mnt_unmounting);
 	KASSERT(mp->mnt_busynest != 0);
 	mp->mnt_busynest--;
@@ -351,10 +342,6 @@ vfs_unbusy(struct mount *mp, bool keepre
 	if (!keepref) {
 		vfs_destroy(mp);
 	}
-	if (nextp != NULL) {
-		KASSERT(mutex_owned(_lock));
-		*nextp = TAILQ_NEXT(mp, mnt_list);
-	}
 }
 
 struct vnode_iterator {
@@ -1508,7 +1495,7 @@ mountlist_iterator_init(mount_iterator_t
 
 	me = mountlist_alloc(ME_MARKER, NULL);
 	mutex_enter(_lock);
-	TAILQ_INSERT_HEAD(_list, me, me_list);
+	TAILQ_INSERT_HEAD(, me, me_list);
 	mutex_exit(_lock);
 	*mip = (mount_iterator_t *)me;
 }
@@ -1522,7 +1509,7 @@ mountlist_iterator_destroy(mount_iterato
 		vfs_unbusy(marker->me_mount, false, NULL);
 
 	mutex_enter(_lock);
-	TAILQ_REMOVE(_list, marker, me_list);
+	TAILQ_REMOVE(, marker, me_list);
 	mutex_exit(_lock);
 
 	mountlist_free(marker);
@@ -1554,8 +1541,8 @@ mountlist_iterator_next(mount_iterator_t
 			mutex_exit(_lock);
 			return NULL;
 		}
-		TAILQ_REMOVE(_list, marker, me_list);
-		TAILQ_INSERT_AFTER(_list, me, marker, me_list);
+		TAILQ_REMOVE(, marker, me_list);
+		TAILQ_INSERT_AFTER(, me, marker, me_list);
 
 		/* Skip other markers. */
 		if (me->me_type != ME_MOUNT)
@@ -1588,8 +1575,7 @@ mountlist_append(struct mount *mp)
 
 	me = mountlist_alloc(ME_MOUNT, mp);
 	mutex_enter(_lock);
-	TAILQ_INSERT_TAIL(_list, me, me_list);
-	TAILQ_INSERT_TAIL(, mp, mnt_list);
+	TAILQ_INSERT_TAIL(, me, me_list);
 	mutex_exit(_lock);
 }
 
@@ -1601,12 +1587,11 @@ mountlist_remove(struct mount *mp)
 	struct mountlist_entry *me;
 
 	mutex_enter(_lock);
-	TAILQ_FOREACH(me, _list, me_list)
+	TAILQ_FOREACH(me, , me_list)
 		if (me->me_type == ME_MOUNT && me->me_mount == mp)
 			break;
 	KASSERT(me != NULL);
-	TAILQ_REMOVE(_list, me, me_list);
-	TAILQ_REMOVE(, mp, mnt_list);
+	TAILQ_REMOVE(, me, me_list);
 	

CVS commit: src/sys/arch

2017-04-17 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Mon Apr 17 07:19:28 UTC 2017

Modified Files:
src/sys/arch/amd64/conf: XEN3_DOM0
src/sys/arch/i386/conf: XEN3_DOM0

Log Message:
Uncomment MULTIPROCESSOR in dom0 kernels


To generate a diff of this commit:
cvs rdiff -u -r1.132 -r1.133 src/sys/arch/amd64/conf/XEN3_DOM0
cvs rdiff -u -r1.110 -r1.111 src/sys/arch/i386/conf/XEN3_DOM0

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-04-17 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Mon Apr 17 07:19:28 UTC 2017

Modified Files:
src/sys/arch/amd64/conf: XEN3_DOM0
src/sys/arch/i386/conf: XEN3_DOM0

Log Message:
Uncomment MULTIPROCESSOR in dom0 kernels


To generate a diff of this commit:
cvs rdiff -u -r1.132 -r1.133 src/sys/arch/amd64/conf/XEN3_DOM0
cvs rdiff -u -r1.110 -r1.111 src/sys/arch/i386/conf/XEN3_DOM0

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/XEN3_DOM0
diff -u src/sys/arch/amd64/conf/XEN3_DOM0:1.132 src/sys/arch/amd64/conf/XEN3_DOM0:1.133
--- src/sys/arch/amd64/conf/XEN3_DOM0:1.132	Sun Feb 26 12:41:50 2017
+++ src/sys/arch/amd64/conf/XEN3_DOM0	Mon Apr 17 07:19:28 2017
@@ -1,8 +1,8 @@
-# $NetBSD: XEN3_DOM0,v 1.132 2017/02/26 12:41:50 rin Exp $
+# $NetBSD: XEN3_DOM0,v 1.133 2017/04/17 07:19:28 maya Exp $
 
 include 	"arch/amd64/conf/std.xen"
 
-#options 	MULTIPROCESSOR	# (experimental)
+options 	MULTIPROCESSOR	# (experimental)
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 

Index: src/sys/arch/i386/conf/XEN3_DOM0
diff -u src/sys/arch/i386/conf/XEN3_DOM0:1.110 src/sys/arch/i386/conf/XEN3_DOM0:1.111
--- src/sys/arch/i386/conf/XEN3_DOM0:1.110	Sun Feb 26 12:41:50 2017
+++ src/sys/arch/i386/conf/XEN3_DOM0	Mon Apr 17 07:19:28 2017
@@ -1,10 +1,10 @@
-#	$NetBSD: XEN3_DOM0,v 1.110 2017/02/26 12:41:50 rin Exp $
+#	$NetBSD: XEN3_DOM0,v 1.111 2017/04/17 07:19:28 maya Exp $
 #
 #	XEN3_0: Xen 3.0 domain0 kernel
 
 include 	"arch/xen/conf/std.xen"
 
-#options 	MULTIPROCESSOR	# (experimental)
+options 	MULTIPROCESSOR	# (experimental)
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 



CVS commit: src/sys/rump/dev/lib/libugenhc

2017-04-17 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon Apr 17 07:13:30 UTC 2017

Modified Files:
src/sys/rump/dev/lib/libugenhc: ugenhc.c

Log Message:
Fix bulk xfer buffer with usedma = false.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/sys/rump/dev/lib/libugenhc/ugenhc.c

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



CVS commit: src/sys/rump/dev/lib/libugenhc

2017-04-17 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon Apr 17 07:13:30 UTC 2017

Modified Files:
src/sys/rump/dev/lib/libugenhc: ugenhc.c

Log Message:
Fix bulk xfer buffer with usedma = false.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/sys/rump/dev/lib/libugenhc/ugenhc.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/rump/dev/lib/libugenhc/ugenhc.c
diff -u src/sys/rump/dev/lib/libugenhc/ugenhc.c:1.25 src/sys/rump/dev/lib/libugenhc/ugenhc.c:1.26
--- src/sys/rump/dev/lib/libugenhc/ugenhc.c:1.25	Mon Apr 17 05:11:05 2017
+++ src/sys/rump/dev/lib/libugenhc/ugenhc.c	Mon Apr 17 07:13:30 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: ugenhc.c,v 1.25 2017/04/17 05:11:05 riastradh Exp $	*/
+/*	$NetBSD: ugenhc.c,v 1.26 2017/04/17 07:13:30 riastradh Exp $	*/
 
 /*
  * Copyright (c) 2009, 2010 Antti Kantee.  All Rights Reserved.
@@ -61,7 +61,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ugenhc.c,v 1.25 2017/04/17 05:11:05 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ugenhc.c,v 1.26 2017/04/17 07:13:30 riastradh Exp $");
 
 #include 
 #include 
@@ -603,7 +603,7 @@ rumpusb_device_bulk_start(struct usbd_xf
 	endpt = UE_GET_ADDR(endpt);
 	KASSERT(endpt < UGEN_NEPTS);
 
-	buf = KERNADDR(>ux_dmabuf, 0);
+	buf = xfer->ux_buf;
 	done = 0;
 	if ((ed->bmAttributes & UE_XFERTYPE) == UE_ISOCHRONOUS) {
 		for (i = 0, len = 0; i < xfer->ux_nframes; i++)



CVS commit: [netbsd-7] src/doc

2017-04-17 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Mon Apr 17 06:08:12 UTC 2017

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

Log Message:
1354, 1367


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.8 -r1.1.2.9 src/doc/CHANGES-7.2

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.2
diff -u src/doc/CHANGES-7.2:1.1.2.8 src/doc/CHANGES-7.2:1.1.2.9
--- src/doc/CHANGES-7.2:1.1.2.8	Tue Apr 11 16:56:31 2017
+++ src/doc/CHANGES-7.2	Mon Apr 17 06:08:12 2017
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-7.2,v 1.1.2.8 2017/04/11 16:56:31 martin Exp $
+# $NetBSD: CHANGES-7.2,v 1.1.2.9 2017/04/17 06:08:12 snj Exp $
 
 A complete list of changes from the NetBSD 7.1 release to the NetBSD 7.2
 release:
@@ -567,4 +567,51 @@ sys/arch/evbarm/conf/TWINTAIL			1.65
 	Comment out more USB options to to fix build.
 	[skrll, ticket #1400]
 
+sys/compat/linux/arch/alpha/linux_syscall.h	regen
+sys/compat/linux/arch/alpha/linux_syscallargs.h	regen
+sys/compat/linux/arch/alpha/linux_syscalls.c	regen
+sys/compat/linux/arch/alpha/linux_sysent.c	regen
+sys/compat/linux/arch/alpha/syscalls.master	1.92 via patch
+sys/compat/linux/arch/amd64/linux_syscall.h	regen
+sys/compat/linux/arch/amd64/linux_syscallargs.h	regen
+sys/compat/linux/arch/amd64/linux_syscalls.c	regen
+sys/compat/linux/arch/amd64/linux_sysent.c	regen
+sys/compat/linux/arch/amd64/syscalls.master	1.58 via patch
+sys/compat/linux/arch/arm/linux_syscall.h	regen
+sys/compat/linux/arch/arm/linux_syscallargs.h	regen
+sys/compat/linux/arch/arm/linux_syscalls.c	regen
+sys/compat/linux/arch/arm/linux_sysent.c	regen
+sys/compat/linux/arch/arm/syscalls.master	1.65 via patch
+sys/compat/linux/arch/i386/linux_syscall.h	regen
+sys/compat/linux/arch/i386/linux_syscallargs.h	regen
+sys/compat/linux/arch/i386/linux_syscalls.c	regen
+sys/compat/linux/arch/i386/linux_sysent.c	regen
+sys/compat/linux/arch/i386/syscalls.master	1.122 via patch
+sys/compat/linux/arch/m68k/linux_syscall.h	regen
+sys/compat/linux/arch/m68k/linux_syscallargs.h	regen
+sys/compat/linux/arch/m68k/linux_syscalls.c	regen
+sys/compat/linux/arch/m68k/linux_sysent.c	regen
+sys/compat/linux/arch/m68k/syscalls.master	1.91 via patch
+sys/compat/linux/arch/mips/linux_syscall.h	regen
+sys/compat/linux/arch/mips/linux_syscallargs.h	regen
+sys/compat/linux/arch/mips/linux_syscalls.c	regen
+sys/compat/linux/arch/mips/linux_sysent.c	regen
+sys/compat/linux/arch/mips/syscalls.master	1.61 via patch
+sys/compat/linux/arch/powerpc/linux_syscall.h	regen
+sys/compat/linux/arch/powerpc/linux_syscallargs.h	regen
+sys/compat/linux/arch/powerpc/linux_syscalls.c	regen
+sys/compat/linux/arch/powerpc/linux_sysent.c	regen
+sys/compat/linux/arch/powerpc/syscalls.master	1.70 via patch
+sys/compat/linux/common/linux_misc.c		1.234
+sys/compat/linux/common/linux_signal.h		1.31
+
+	Add pselect6 Linux system call.
+	[manu, ticket #1354]
+
+sys/arch/amd64/conf/XEN3_DOM0			1.126
+sys/arch/i386/conf/XEN3_DOM0			1.104
+sys/arch/xen/x86/xen_pmap.c			1.25
+
+	Make xen dom0 SMP bootable again.  Disabled by default.
+	[khorben, ticket #1367]
 



CVS commit: [netbsd-7] src/doc

2017-04-17 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Mon Apr 17 06:08:12 UTC 2017

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

Log Message:
1354, 1367


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.8 -r1.1.2.9 src/doc/CHANGES-7.2

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



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

2017-04-17 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Mon Apr 17 06:02:05 UTC 2017

Modified Files:
src/sys/arch/amd64/conf [netbsd-7]: XEN3_DOM0
src/sys/arch/i386/conf [netbsd-7]: XEN3_DOM0
src/sys/arch/xen/x86 [netbsd-7]: xen_pmap.c

Log Message:
Pull up following revision(s) (requested by khorben in ticket #1367):
sys/arch/amd64/conf/XEN3_DOM0: revision 1.126
sys/arch/i386/conf/XEN3_DOM0: revision 1.104
sys/arch/xen/x86/xen_pmap.c: revision 1.25
In the MP case,
do not attempt to pmap_tlb_shootdown() after a pmap_kenter_ma() during
boot. pmap_tlb_shootdown() assumes post boot. Instead invalidate the
entry on the local CPU only.
XXX: to DTRT, probably this assumption needs re-examination.
XXX: The tradeoff is a (predicted) single word size comparison
  penalty, so perhaps a decision needs performance stats.
xen dom0 SMP is now bootable again.
--
add the 'options MULTIPROCESSOR' in respective configs, but mark them
experimental - and thus disabled by default.


To generate a diff of this commit:
cvs rdiff -u -r1.103.2.5 -r1.103.2.6 src/sys/arch/amd64/conf/XEN3_DOM0
cvs rdiff -u -r1.85.2.6 -r1.85.2.7 src/sys/arch/i386/conf/XEN3_DOM0
cvs rdiff -u -r1.22 -r1.22.14.1 src/sys/arch/xen/x86/xen_pmap.c

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



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

2017-04-17 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Mon Apr 17 06:02:05 UTC 2017

Modified Files:
src/sys/arch/amd64/conf [netbsd-7]: XEN3_DOM0
src/sys/arch/i386/conf [netbsd-7]: XEN3_DOM0
src/sys/arch/xen/x86 [netbsd-7]: xen_pmap.c

Log Message:
Pull up following revision(s) (requested by khorben in ticket #1367):
sys/arch/amd64/conf/XEN3_DOM0: revision 1.126
sys/arch/i386/conf/XEN3_DOM0: revision 1.104
sys/arch/xen/x86/xen_pmap.c: revision 1.25
In the MP case,
do not attempt to pmap_tlb_shootdown() after a pmap_kenter_ma() during
boot. pmap_tlb_shootdown() assumes post boot. Instead invalidate the
entry on the local CPU only.
XXX: to DTRT, probably this assumption needs re-examination.
XXX: The tradeoff is a (predicted) single word size comparison
  penalty, so perhaps a decision needs performance stats.
xen dom0 SMP is now bootable again.
--
add the 'options MULTIPROCESSOR' in respective configs, but mark them
experimental - and thus disabled by default.


To generate a diff of this commit:
cvs rdiff -u -r1.103.2.5 -r1.103.2.6 src/sys/arch/amd64/conf/XEN3_DOM0
cvs rdiff -u -r1.85.2.6 -r1.85.2.7 src/sys/arch/i386/conf/XEN3_DOM0
cvs rdiff -u -r1.22 -r1.22.14.1 src/sys/arch/xen/x86/xen_pmap.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/amd64/conf/XEN3_DOM0
diff -u src/sys/arch/amd64/conf/XEN3_DOM0:1.103.2.5 src/sys/arch/amd64/conf/XEN3_DOM0:1.103.2.6
--- src/sys/arch/amd64/conf/XEN3_DOM0:1.103.2.5	Fri Dec  9 05:10:45 2016
+++ src/sys/arch/amd64/conf/XEN3_DOM0	Mon Apr 17 06:02:05 2017
@@ -1,7 +1,9 @@
-# $NetBSD: XEN3_DOM0,v 1.103.2.5 2016/12/09 05:10:45 snj Exp $
+# $NetBSD: XEN3_DOM0,v 1.103.2.6 2017/04/17 06:02:05 snj Exp $
 
 include 	"arch/amd64/conf/std.xen"
 
+#options 	MULTIPROCESSOR	# (experimental)
+
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
 #options 	UVMHIST

Index: src/sys/arch/i386/conf/XEN3_DOM0
diff -u src/sys/arch/i386/conf/XEN3_DOM0:1.85.2.6 src/sys/arch/i386/conf/XEN3_DOM0:1.85.2.7
--- src/sys/arch/i386/conf/XEN3_DOM0:1.85.2.6	Fri Dec  9 05:10:45 2016
+++ src/sys/arch/i386/conf/XEN3_DOM0	Mon Apr 17 06:02:05 2017
@@ -1,9 +1,11 @@
-#	$NetBSD: XEN3_DOM0,v 1.85.2.6 2016/12/09 05:10:45 snj Exp $
+#	$NetBSD: XEN3_DOM0,v 1.85.2.7 2017/04/17 06:02:05 snj Exp $
 #
 #	XEN3_0: Xen 3.0 domain0 kernel
 
 include 	"arch/xen/conf/std.xen"
 
+#options 	MULTIPROCESSOR	# (experimental)
+
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
 #options 	UVMHIST

Index: src/sys/arch/xen/x86/xen_pmap.c
diff -u src/sys/arch/xen/x86/xen_pmap.c:1.22 src/sys/arch/xen/x86/xen_pmap.c:1.22.14.1
--- src/sys/arch/xen/x86/xen_pmap.c:1.22	Sun Jun 24 18:31:53 2012
+++ src/sys/arch/xen/x86/xen_pmap.c	Mon Apr 17 06:02:05 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: xen_pmap.c,v 1.22 2012/06/24 18:31:53 jym Exp $	*/
+/*	$NetBSD: xen_pmap.c,v 1.22.14.1 2017/04/17 06:02:05 snj Exp $	*/
 
 /*
  * Copyright (c) 2007 Manuel Bouyer.
@@ -102,7 +102,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: xen_pmap.c,v 1.22 2012/06/24 18:31:53 jym Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xen_pmap.c,v 1.22.14.1 2017/04/17 06:02:05 snj Exp $");
 
 #include "opt_user_ldt.h"
 #include "opt_lockdebug.h"
@@ -192,9 +192,13 @@ pmap_kenter_ma(vaddr_t va, paddr_t ma, v
 
 	if (pmap_valid_entry(opte)) {
 #if defined(MULTIPROCESSOR)
-		kpreempt_disable();
-		pmap_tlb_shootdown(pmap_kernel(), va, opte, TLBSHOOT_KENTER);
-		kpreempt_enable();
+		if (__predict_false(x86_mp_online == false)) {
+			pmap_update_pg(va);
+		} else {
+			kpreempt_disable();
+			pmap_tlb_shootdown(pmap_kernel(), va, opte, TLBSHOOT_KENTER);
+			kpreempt_enable();
+		}
 #else
 		/* Don't bother deferring in the single CPU case. */
 		pmap_update_pg(va);