CVS commit: src/sys/kern

2017-07-01 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jul  2 02:39:18 UTC 2017

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

Log Message:
don't warn about AF_LINK sockets with sa_len less than the size of the sockaddr


To generate a diff of this commit:
cvs rdiff -u -r1.97 -r1.98 src/sys/kern/uipc_domain.c

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



CVS commit: src/sys/kern

2017-07-01 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jul  2 02:39:18 UTC 2017

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

Log Message:
don't warn about AF_LINK sockets with sa_len less than the size of the sockaddr


To generate a diff of this commit:
cvs rdiff -u -r1.97 -r1.98 src/sys/kern/uipc_domain.c

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

Modified files:

Index: src/sys/kern/uipc_domain.c
diff -u src/sys/kern/uipc_domain.c:1.97 src/sys/kern/uipc_domain.c:1.98
--- src/sys/kern/uipc_domain.c:1.97	Sat Jul  1 12:59:12 2017
+++ src/sys/kern/uipc_domain.c	Sat Jul  1 22:39:18 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: uipc_domain.c,v 1.97 2017/07/01 16:59:12 christos Exp $	*/
+/*	$NetBSD: uipc_domain.c,v 1.98 2017/07/02 02:39:18 christos Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1993
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uipc_domain.c,v 1.97 2017/07/01 16:59:12 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uipc_domain.c,v 1.98 2017/07/02 02:39:18 christos Exp $");
 
 #include 
 #include 
@@ -284,6 +284,8 @@ sockaddr_checklen(const struct sockaddr 
 	socklen_t len = sockaddr_getsize_by_family(sa->sa_family);
 	if (len == 0 || len == sa->sa_len)
 		return;
+	if (sa->sa_family == AF_LINK && sa->sa_len <= len)
+		return;
 
 	char buf[512];
 	sockaddr_format(sa, buf, sizeof(buf));



CVS commit: src/sys/arch

2017-07-01 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Jul  2 00:14:09 UTC 2017

Modified Files:
src/sys/arch/arm/sunxi: files.sunxi sunxi_ccu.c sunxi_ccu.h
sunxi_ccu_nkmp.c sunxi_platform.c sunxi_usbphy.c
src/sys/arch/evbarm/conf: SUNXI
Added Files:
src/sys/arch/arm/sunxi: sun6i_a31_ccu.c sun6i_a31_ccu.h sunxi_ccu_div.c

Log Message:
Add basic support for Allwinner A31.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/arm/sunxi/files.sunxi
cvs rdiff -u -r0 -r1.1 src/sys/arch/arm/sunxi/sun6i_a31_ccu.c \
src/sys/arch/arm/sunxi/sun6i_a31_ccu.h \
src/sys/arch/arm/sunxi/sunxi_ccu_div.c
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/arm/sunxi/sunxi_ccu.c \
src/sys/arch/arm/sunxi/sunxi_ccu.h
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/arm/sunxi/sunxi_ccu_nkmp.c \
src/sys/arch/arm/sunxi/sunxi_platform.c \
src/sys/arch/arm/sunxi/sunxi_usbphy.c
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/evbarm/conf/SUNXI

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

Modified files:

Index: src/sys/arch/arm/sunxi/files.sunxi
diff -u src/sys/arch/arm/sunxi/files.sunxi:1.6 src/sys/arch/arm/sunxi/files.sunxi:1.7
--- src/sys/arch/arm/sunxi/files.sunxi:1.6	Sat Jul  1 16:25:16 2017
+++ src/sys/arch/arm/sunxi/files.sunxi	Sun Jul  2 00:14:09 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: files.sunxi,v 1.6 2017/07/01 16:25:16 jmcneill Exp $
+#	$NetBSD: files.sunxi,v 1.7 2017/07/02 00:14:09 jmcneill Exp $
 #
 # Configuration info for Allwinner sunxi family SoCs
 #
@@ -20,11 +20,17 @@ file	arch/arm/sunxi/sunxi_platform.c		so
 # CCU
 define	sunxi_ccu
 file	arch/arm/sunxi/sunxi_ccu.c		sunxi_ccu
+file	arch/arm/sunxi/sunxi_ccu_div.c		sunxi_ccu
 file	arch/arm/sunxi/sunxi_ccu_gate.c		sunxi_ccu
 file	arch/arm/sunxi/sunxi_ccu_nm.c		sunxi_ccu
 file	arch/arm/sunxi/sunxi_ccu_nkmp.c		sunxi_ccu
 file	arch/arm/sunxi/sunxi_ccu_prediv.c	sunxi_ccu
 
+# CCU (A31)
+device	sun6ia31ccu: sunxi_ccu
+attach	sun6ia31ccu at fdt with sunxi_a31_ccu
+file	arch/arm/sunxi/sun6i_a31_ccu.c		sunxi_a31_ccu
+
 # CCU (H3)
 device	sun8ih3ccu: sunxi_ccu
 attach	sun8ih3ccu at fdt with sunxi_h3_ccu
@@ -71,3 +77,5 @@ file	arch/arm/sunxi/sunxi_emac.c		sunxi_
 defflag	opt_soc.h			SOC_SUNXI
 defflag	opt_soc.h			SOC_SUN8I: SOC_SUNXI
 defflag	opt_soc.h			SOC_SUN8I_H3: SOC_SUN8I
+defflag	opt_soc.h			SOC_SUN6I: SOC_SUNXI
+defflag	opt_soc.h			SOC_SUN6I_A31: SOC_SUN6I

Index: src/sys/arch/arm/sunxi/sunxi_ccu.c
diff -u src/sys/arch/arm/sunxi/sunxi_ccu.c:1.4 src/sys/arch/arm/sunxi/sunxi_ccu.c:1.5
--- src/sys/arch/arm/sunxi/sunxi_ccu.c:1.4	Thu Jun 29 21:34:50 2017
+++ src/sys/arch/arm/sunxi/sunxi_ccu.c	Sun Jul  2 00:14:09 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: sunxi_ccu.c,v 1.4 2017/06/29 21:34:50 jmcneill Exp $ */
+/* $NetBSD: sunxi_ccu.c,v 1.5 2017/07/02 00:14:09 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2017 Jared McNeill 
@@ -31,7 +31,7 @@
 #include "opt_fdt_arm.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sunxi_ccu.c,v 1.4 2017/06/29 21:34:50 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sunxi_ccu.c,v 1.5 2017/07/02 00:14:09 jmcneill Exp $");
 
 #include 
 #include 
@@ -328,16 +328,17 @@ sunxi_ccu_print(struct sunxi_ccu_softc *
 		case SUNXI_CCU_NM:	type = "nm"; break;
 		case SUNXI_CCU_NKMP:	type = "nkmp"; break;
 		case SUNXI_CCU_PREDIV:	type = "prediv"; break;
+		case SUNXI_CCU_DIV:	type = "div"; break;
 		default:		type = "???"; break;
 		}
 
 	aprint_debug_dev(sc->sc_dev,
-		"%3d %-12s %2s %-12s %-7s %10d Hz\n",
+		"%3d %-12s %2s %-12s %-7s ",
 		i,
 	clk->base.name,
 	clkp_parent ? "<-" : "",
 	clkp_parent ? clkp_parent->name : "",
-	type,
-		clk_get_rate(>base));
+	type);
+		aprint_debug("%10d Hz\n", clk_get_rate(>base));
 	}
 }
Index: src/sys/arch/arm/sunxi/sunxi_ccu.h
diff -u src/sys/arch/arm/sunxi/sunxi_ccu.h:1.4 src/sys/arch/arm/sunxi/sunxi_ccu.h:1.5
--- src/sys/arch/arm/sunxi/sunxi_ccu.h:1.4	Thu Jun 29 17:08:52 2017
+++ src/sys/arch/arm/sunxi/sunxi_ccu.h	Sun Jul  2 00:14:09 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: sunxi_ccu.h,v 1.4 2017/06/29 17:08:52 jmcneill Exp $ */
+/* $NetBSD: sunxi_ccu.h,v 1.5 2017/07/02 00:14:09 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2017 Jared McNeill 
@@ -60,6 +60,7 @@ enum sunxi_ccu_clktype {
 	SUNXI_CCU_NM,
 	SUNXI_CCU_NKMP,
 	SUNXI_CCU_PREDIV,
+	SUNXI_CCU_DIV,
 };
 
 struct sunxi_ccu_gate {
@@ -170,6 +171,44 @@ const char *sunxi_ccu_nm_get_parent(stru
 		.get_parent = sunxi_ccu_nm_get_parent,		\
 	}
 
+struct sunxi_ccu_div {
+	bus_size_t	reg;
+	const char	**parents;
+	u_int		nparents;
+	uint32_t	div;
+	uint32_t	sel;
+	uint32_t	flags;
+#define	SUNXI_CCU_DIV_POWER_OF_TWO	__BIT(0)
+#define	SUNXI_CCU_DIV_ZERO_IS_ONE	__BIT(1)
+};
+
+u_int	sunxi_ccu_div_get_rate(struct sunxi_ccu_softc *,
+			   struct sunxi_ccu_clk *);
+int	sunxi_ccu_div_set_rate(struct sunxi_ccu_softc *,
+			   struct sunxi_ccu_clk *, 

CVS commit: src/sys/arch

2017-07-01 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Jul  2 00:14:09 UTC 2017

Modified Files:
src/sys/arch/arm/sunxi: files.sunxi sunxi_ccu.c sunxi_ccu.h
sunxi_ccu_nkmp.c sunxi_platform.c sunxi_usbphy.c
src/sys/arch/evbarm/conf: SUNXI
Added Files:
src/sys/arch/arm/sunxi: sun6i_a31_ccu.c sun6i_a31_ccu.h sunxi_ccu_div.c

Log Message:
Add basic support for Allwinner A31.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/arm/sunxi/files.sunxi
cvs rdiff -u -r0 -r1.1 src/sys/arch/arm/sunxi/sun6i_a31_ccu.c \
src/sys/arch/arm/sunxi/sun6i_a31_ccu.h \
src/sys/arch/arm/sunxi/sunxi_ccu_div.c
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/arm/sunxi/sunxi_ccu.c \
src/sys/arch/arm/sunxi/sunxi_ccu.h
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/arm/sunxi/sunxi_ccu_nkmp.c \
src/sys/arch/arm/sunxi/sunxi_platform.c \
src/sys/arch/arm/sunxi/sunxi_usbphy.c
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/evbarm/conf/SUNXI

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



CVS commit: src/sys

2017-07-01 Thread Nathanial Sloss
Module Name:src
Committed By:   nat
Date:   Sat Jul  1 23:31:19 UTC 2017

Modified Files:
src/sys/dev/pad: pad.c padvar.h
src/sys/sys: file.h

Log Message:
Pad is now clones its device, attaching upon open and detaching upon close.
This means that only one pad device is required in /dev.

The code contains a compile time limit of 128 units.

Ok christos@.


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/sys/dev/pad/pad.c
cvs rdiff -u -r1.10 -r1.11 src/sys/dev/pad/padvar.h
cvs rdiff -u -r1.81 -r1.82 src/sys/sys/file.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/pad/pad.c
diff -u src/sys/dev/pad/pad.c:1.38 src/sys/dev/pad/pad.c:1.39
--- src/sys/dev/pad/pad.c:1.38	Sat Jul  1 05:50:10 2017
+++ src/sys/dev/pad/pad.c	Sat Jul  1 23:31:19 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: pad.c,v 1.38 2017/07/01 05:50:10 nat Exp $ */
+/* $NetBSD: pad.c,v 1.39 2017/07/01 23:31:19 nat Exp $ */
 
 /*-
  * Copyright (c) 2007 Jared D. McNeill 
@@ -27,18 +27,23 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pad.c,v 1.38 2017/07/01 05:50:10 nat Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pad.c,v 1.39 2017/07/01 23:31:19 nat Exp $");
 
 #include 
 #include 
 #include 
 #include 
+#include 
+#include 
+#include 
+#include 
 #include 
 #include 
 #include 
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -52,6 +57,7 @@ __KERNEL_RCSID(0, "$NetBSD: pad.c,v 1.38
 
 #include 
 
+#define MAXDEVS		128
 #define PADUNIT(x)	minor(x)
 
 #define PADFREQ		44100
@@ -104,7 +110,15 @@ static stream_filter_t *pad_swvol_filter
 const audio_params_t *, const audio_params_t *);
 static void	pad_swvol_dtor(stream_filter_t *);
 
-static bool	pad_is_attached;	/* Do we have an audio* child? */
+static int pad_close(struct file *);
+static int pad_read(struct file *, off_t *, struct uio *, kauth_cred_t, int);
+static int pad_write(struct file *, off_t *, struct uio *, kauth_cred_t, int);
+static int pad_ioctl(struct file *, u_long, void *);
+static int pad_kqfilter(struct file *, struct knote *);
+static int pad_poll(struct file *, int);
+static int pad_stat(struct file *, struct stat *);
+static int pad_mmap(struct file *, off_t *, size_t, int, int *, int *,
+			   struct uvm_object **, int *);
 
 static const struct audio_hw_if pad_hw_if = {
 	.open = pad_audio_open,
@@ -135,13 +149,11 @@ static int	pad_add_block(pad_softc_t *, 
 static int	pad_get_block(pad_softc_t *, pad_block_t *, int);
 
 dev_type_open(pad_open);
-dev_type_close(pad_close);
-dev_type_read(pad_read);
 
 const struct cdevsw pad_cdevsw = {
 	.d_open = pad_open,
-	.d_close = pad_close,
-	.d_read = pad_read,
+	.d_close = noclose,
+	.d_read = noread,
 	.d_write = nowrite,
 	.d_ioctl = noioctl,
 	.d_stop = nostop,
@@ -153,35 +165,35 @@ const struct cdevsw pad_cdevsw = {
 	.d_flag = D_OTHER | D_MPSAFE,
 };
 
+const struct fileops pad_fileops = {
+	.fo_read = pad_read,
+	.fo_write = pad_write,
+	.fo_ioctl = pad_ioctl,
+	.fo_fcntl = fnullop_fcntl,
+	.fo_stat = pad_stat,
+	.fo_poll = pad_poll,
+	.fo_close = pad_close,
+	.fo_mmap = pad_mmap,
+	.fo_kqfilter = pad_kqfilter,
+	.fo_restart = fnullop_restart
+};
+
 CFATTACH_DECL2_NEW(pad, sizeof(pad_softc_t), pad_match, pad_attach, pad_detach,
 NULL, NULL, pad_childdet);
 
 void
 padattach(int n)
 {
-	int i, err;
-	cfdata_t cf;
-
-	aprint_debug("pad: requested %d units\n", n);
+	int error;
 
-	err = config_cfattach_attach(pad_cd.cd_name, _ca);
-	if (err) {
+	error = config_cfattach_attach(pad_cd.cd_name, _ca);
+	if (error) {
 		aprint_error("%s: couldn't register cfattach: %d\n",
-		pad_cd.cd_name, err);
+		pad_cd.cd_name, error);
 		config_cfdriver_detach(_cd);
 		return;
 	}
 
-	for (i = 0; i < n; i++) {
-		cf = kmem_alloc(sizeof(struct cfdata), KM_SLEEP);
-		cf->cf_name = pad_cd.cd_name;
-		cf->cf_atname = pad_cd.cd_name;
-		cf->cf_unit = i;
-		cf->cf_fstate = FSTATE_STAR;
-
-		(void)config_attach_pseudo(cf);
-	}
-
 	return;
 }
 
@@ -258,51 +270,37 @@ pad_childdet(device_t self, device_t chi
 static void
 pad_attach(device_t parent, device_t self, void *opaque)
 {
-	pad_softc_t *sc = device_private(self);
-
 	aprint_normal_dev(self, "outputs: 44100Hz, 16-bit, stereo\n");
 
-	sc->sc_dev = self;
-	sc->sc_open = 0;
-	if (auconv_create_encodings(pad_formats, PAD_NFORMATS,
-	>sc_encodings) != 0) {
-		aprint_error_dev(self, "couldn't create encodings\n");
-		return;
-	}
-
-	cv_init(>sc_condvar, device_xname(self));
-	mutex_init(>sc_lock, MUTEX_DEFAULT, IPL_NONE);
-	mutex_init(>sc_intr_lock, MUTEX_DEFAULT, IPL_NONE);
-
-	sc->sc_swvol = 255;
-	sc->sc_buflen = 0;
-	sc->sc_rpos = sc->sc_wpos = 0;
-	sc->sc_audiodev = audio_attach_mi(_hw_if, sc, sc->sc_dev);
-
-	if (!pmf_device_register(self, NULL, NULL))
-		aprint_error_dev(self, "couldn't establish power handler\n");
-
-	pad_is_attached = true;
 	return;
 }
 
 static int
 pad_detach(device_t 

CVS commit: src/sys

2017-07-01 Thread Nathanial Sloss
Module Name:src
Committed By:   nat
Date:   Sat Jul  1 23:31:19 UTC 2017

Modified Files:
src/sys/dev/pad: pad.c padvar.h
src/sys/sys: file.h

Log Message:
Pad is now clones its device, attaching upon open and detaching upon close.
This means that only one pad device is required in /dev.

The code contains a compile time limit of 128 units.

Ok christos@.


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/sys/dev/pad/pad.c
cvs rdiff -u -r1.10 -r1.11 src/sys/dev/pad/padvar.h
cvs rdiff -u -r1.81 -r1.82 src/sys/sys/file.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

2017-07-01 Thread Nathanial Sloss
Module Name:src
Committed By:   nat
Date:   Sat Jul  1 23:27:17 UTC 2017

Modified Files:
src/sys/dev: spkr.c

Log Message:
On a forcefull detach wait for spkr to close as the detach has to
succeed.

Ok christos@.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/dev/spkr.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/spkr.c
diff -u src/sys/dev/spkr.c:1.13 src/sys/dev/spkr.c:1.14
--- src/sys/dev/spkr.c:1.13	Wed Jun 14 06:55:37 2017
+++ src/sys/dev/spkr.c	Sat Jul  1 23:27:17 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: spkr.c,v 1.13 2017/06/14 06:55:37 nat Exp $	*/
+/*	$NetBSD: spkr.c,v 1.14 2017/07/01 23:27:17 nat Exp $	*/
 
 /*
  * Copyright (c) 1990 Eric S. Raymond (e...@snark.thyrsus.com)
@@ -43,7 +43,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: spkr.c,v 1.13 2017/06/14 06:55:37 nat Exp $");
+__KERNEL_RCSID(0, "$NetBSD: spkr.c,v 1.14 2017/07/01 23:27:17 nat Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "wsmux.h"
@@ -388,6 +388,10 @@ spkr_detach(device_t self, int flags)
 #endif /* SPKRDEBUG */
 	if (sc == NULL)
 		return ENXIO;
+
+	/* XXXNS If speaker never closes, we cannot complete the detach. */
+	while ((flags & DETACH_FORCE) != 0 && sc->sc_inbuf != NULL)
+		kpause("spkrwait", TRUE, 1, NULL);
 	if (sc->sc_inbuf != NULL)
 		return EBUSY;
 



CVS commit: src/sys/dev

2017-07-01 Thread Nathanial Sloss
Module Name:src
Committed By:   nat
Date:   Sat Jul  1 23:27:17 UTC 2017

Modified Files:
src/sys/dev: spkr.c

Log Message:
On a forcefull detach wait for spkr to close as the detach has to
succeed.

Ok christos@.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/dev/spkr.c

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



CVS commit: src/bin/ksh

2017-07-01 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Sat Jul  1 23:12:09 UTC 2017

Modified Files:
src/bin/ksh: edit.c edit.h exec.c expr.c proto.h var.c

Log Message:
Kill enough K cruft to build with clang again.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/bin/ksh/edit.c
cvs rdiff -u -r1.4 -r1.5 src/bin/ksh/edit.h
cvs rdiff -u -r1.23 -r1.24 src/bin/ksh/exec.c
cvs rdiff -u -r1.10 -r1.11 src/bin/ksh/expr.c
cvs rdiff -u -r1.9 -r1.10 src/bin/ksh/proto.h
cvs rdiff -u -r1.20 -r1.21 src/bin/ksh/var.c

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

Modified files:

Index: src/bin/ksh/edit.c
diff -u src/bin/ksh/edit.c:1.33 src/bin/ksh/edit.c:1.34
--- src/bin/ksh/edit.c:1.33	Fri Jun 30 05:18:36 2017
+++ src/bin/ksh/edit.c	Sat Jul  1 23:12:08 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: edit.c,v 1.33 2017/06/30 05:18:36 kamil Exp $	*/
+/*	$NetBSD: edit.c,v 1.34 2017/07/01 23:12:08 joerg Exp $	*/
 
 /*
  * Command line editing - common code
@@ -7,7 +7,7 @@
 #include 
 
 #ifndef lint
-__RCSID("$NetBSD: edit.c,v 1.33 2017/06/30 05:18:36 kamil Exp $");
+__RCSID("$NetBSD: edit.c,v 1.34 2017/07/01 23:12:08 joerg Exp $");
 #endif
 
 #include 
@@ -194,8 +194,7 @@ x_puts(s)
 }
 
 bool
-x_mode(onoff)
-	bool	onoff;
+x_mode(bool onoff)
 {
 	static bool	x_cur_mode;
 	bool		prev;

Index: src/bin/ksh/edit.h
diff -u src/bin/ksh/edit.h:1.4 src/bin/ksh/edit.h:1.5
--- src/bin/ksh/edit.h:1.4	Fri Jun 30 04:41:19 2017
+++ src/bin/ksh/edit.h	Sat Jul  1 23:12:08 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: edit.h,v 1.4 2017/06/30 04:41:19 kamil Exp $	*/
+/*	$NetBSD: edit.h,v 1.5 2017/07/01 23:12:08 joerg Exp $	*/
 
 /* NAME:
  *  edit.h - globals for edit modes
@@ -10,7 +10,7 @@
  *  
  *
  * RCSid:
- *  $NetBSD: edit.h,v 1.4 2017/06/30 04:41:19 kamil Exp $
+ *  $NetBSD: edit.h,v 1.5 2017/07/01 23:12:08 joerg Exp $
  *
  */
 
@@ -50,7 +50,7 @@ int 	x_getc		ARGS((void));
 void 	x_flush		ARGS((void));
 void 	x_putc		ARGS((int c));
 void 	x_puts		ARGS((const char *s));
-bool 	x_mode		ARGS((bool onoff));
+bool 	x_mode(bool onoff);
 int 	promptlen	ARGS((const char *cp, const char **spp));
 int	x_do_comment	ARGS((char *buf, int bsize, int *lenp));
 void	x_print_expansions ARGS((int nwords, char *const *words, int is_command));

Index: src/bin/ksh/exec.c
diff -u src/bin/ksh/exec.c:1.23 src/bin/ksh/exec.c:1.24
--- src/bin/ksh/exec.c:1.23	Fri Jun 30 04:41:19 2017
+++ src/bin/ksh/exec.c	Sat Jul  1 23:12:08 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: exec.c,v 1.23 2017/06/30 04:41:19 kamil Exp $	*/
+/*	$NetBSD: exec.c,v 1.24 2017/07/01 23:12:08 joerg Exp $	*/
 
 /*
  * execute command tree
@@ -6,7 +6,7 @@
 #include 
 
 #ifndef lint
-__RCSID("$NetBSD: exec.c,v 1.23 2017/06/30 04:41:19 kamil Exp $");
+__RCSID("$NetBSD: exec.c,v 1.24 2017/07/01 23:12:08 joerg Exp $");
 #endif
 
 #include 
@@ -30,7 +30,7 @@ static int	call_builtin ARGS((struct tbl
 static int	iosetup ARGS((struct ioword *, struct tbl *));
 static int	herein ARGS((const char *, int));
 #ifdef KSH
-static char 	*do_selectargs ARGS((char **, bool));
+static char 	*do_selectargs(char **, bool);
 #endif /* KSH */
 #ifdef KSH
 static int	dbteste_isa ARGS((Test_env *, Test_meta));
@@ -1322,9 +1322,7 @@ herein(content, sub)
  *	print the args in column form - assuming that we can
  */
 static char *
-do_selectargs(ap, print_menu)
-	register char **ap;
-	bool print_menu;
+do_selectargs(char **ap, bool print_menu)
 {
 	static const char *const read_args[] = {
 	"read", "-r", "REPLY", (char *) 0

Index: src/bin/ksh/expr.c
diff -u src/bin/ksh/expr.c:1.10 src/bin/ksh/expr.c:1.11
--- src/bin/ksh/expr.c:1.10	Fri Jun 30 04:41:19 2017
+++ src/bin/ksh/expr.c	Sat Jul  1 23:12:08 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: expr.c,v 1.10 2017/06/30 04:41:19 kamil Exp $	*/
+/*	$NetBSD: expr.c,v 1.11 2017/07/01 23:12:08 joerg Exp $	*/
 
 /*
  * Korn expression evaluation
@@ -9,7 +9,7 @@
 #include 
 
 #ifndef lint
-__RCSID("$NetBSD: expr.c,v 1.10 2017/06/30 04:41:19 kamil Exp $");
+__RCSID("$NetBSD: expr.c,v 1.11 2017/07/01 23:12:08 joerg Exp $");
 #endif
 
 
@@ -138,8 +138,7 @@ static voidevalerr  ARGS((Expr_s
   const char *str)) GCC_FUNC_ATTR(noreturn);
 static struct tbl *evalexpr ARGS((Expr_state *es, enum prec prec));
 static voidtokenARGS((Expr_state *es));
-static struct tbl *do_ppmm  ARGS((Expr_state *es, enum token op,
-  struct tbl *vasn, bool is_prefix));
+static struct tbl *do_ppmm(Expr_state *, enum token, struct tbl *, bool);
 static void	   assign_check ARGS((Expr_state *es, enum token op,
   struct tbl *vasn));
 static struct tbl *tempvar  ARGS((void));
@@ -537,11 +536,7 @@ token(es)
 
 /* Do a ++ or -- operation */
 static struct tbl *
-do_ppmm(es, op, vasn, is_prefix)
-	Expr_state *es;
-	enum token op;
-	struct tbl *vasn;
-	bool is_prefix;
+do_ppmm(Expr_state *es, enum token op, struct tbl *vasn, bool is_prefix)
 {
 	struct tbl *vl;
 	int oval;

Index: src/bin/ksh/proto.h
diff 

CVS commit: src/bin/ksh

2017-07-01 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Sat Jul  1 23:12:09 UTC 2017

Modified Files:
src/bin/ksh: edit.c edit.h exec.c expr.c proto.h var.c

Log Message:
Kill enough K cruft to build with clang again.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/bin/ksh/edit.c
cvs rdiff -u -r1.4 -r1.5 src/bin/ksh/edit.h
cvs rdiff -u -r1.23 -r1.24 src/bin/ksh/exec.c
cvs rdiff -u -r1.10 -r1.11 src/bin/ksh/expr.c
cvs rdiff -u -r1.9 -r1.10 src/bin/ksh/proto.h
cvs rdiff -u -r1.20 -r1.21 src/bin/ksh/var.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/sunxi

2017-07-01 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Jul  1 22:49:09 UTC 2017

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

Log Message:
Fix dmesg


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/sunxi/sunxi_twi.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/sunxi

2017-07-01 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Jul  1 22:49:09 UTC 2017

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

Log Message:
Fix dmesg


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/sunxi/sunxi_twi.c

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

Modified files:

Index: src/sys/arch/arm/sunxi/sunxi_twi.c
diff -u src/sys/arch/arm/sunxi/sunxi_twi.c:1.1 src/sys/arch/arm/sunxi/sunxi_twi.c:1.2
--- src/sys/arch/arm/sunxi/sunxi_twi.c:1.1	Thu Jun 29 19:16:08 2017
+++ src/sys/arch/arm/sunxi/sunxi_twi.c	Sat Jul  1 22:49:09 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: sunxi_twi.c,v 1.1 2017/06/29 19:16:08 jmcneill Exp $ */
+/* $NetBSD: sunxi_twi.c,v 1.2 2017/07/01 22:49:09 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2017 Jared McNeill 
@@ -28,7 +28,7 @@
 
 #include 
 
-__KERNEL_RCSID(0, "$NetBSD: sunxi_twi.c,v 1.1 2017/06/29 19:16:08 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sunxi_twi.c,v 1.2 2017/07/01 22:49:09 jmcneill Exp $");
 
 #include 
 #include 
@@ -119,9 +119,6 @@ sunxi_twi_attach(device_t parent, device
 
 	gttwsi_attach_subr(self, bst, bsh);
 
-	aprint_naive("\n");
-	aprint_normal(": TWI\n");
-
 	ih = fdtbus_intr_establish(phandle, 0, IPL_VM, 0, gttwsi_intr, sc);
 	if (ih == NULL) {
 		aprint_error_dev(self, "couldn't establish interrupt on %s\n",



CVS commit: src/sys

2017-07-01 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jul  1 20:08:56 UTC 2017

Modified Files:
src/sys/kern: kern_event.c
src/sys/sys: event.h

Log Message:
fix file descriptor locking (from joerg).
fixes kernel crashes by running go
XXX: pullup-7


To generate a diff of this commit:
cvs rdiff -u -r1.91 -r1.92 src/sys/kern/kern_event.c
cvs rdiff -u -r1.29 -r1.30 src/sys/sys/event.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/kern_event.c
diff -u src/sys/kern/kern_event.c:1.91 src/sys/kern/kern_event.c:1.92
--- src/sys/kern/kern_event.c:1.91	Thu May 11 19:50:17 2017
+++ src/sys/kern/kern_event.c	Sat Jul  1 16:08:56 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_event.c,v 1.91 2017/05/11 23:50:17 christos Exp $	*/
+/*	$NetBSD: kern_event.c,v 1.92 2017/07/01 20:08:56 christos Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -58,7 +58,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_event.c,v 1.91 2017/05/11 23:50:17 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_event.c,v 1.92 2017/07/01 20:08:56 christos Exp $");
 
 #include 
 #include 
@@ -1021,8 +1021,9 @@ kqueue_register(struct kqueue *kq, struc
 			if (error != 0) {
 #ifdef DIAGNOSTIC
 
-printf("%s: event not supported for file type"
-" %d (error %d)\n", __func__, kn->kn_obj ?
+printf("%s: event type %d not supported for "
+"file type %d (error %d)\n", __func__,
+kn->kn_filter, kn->kn_obj ?
 ((file_t *)kn->kn_obj)->f_type : -1, error);
 #endif
 /* knote_detach() drops fdp->fd_lock */
@@ -1204,10 +1205,19 @@ kqueue_scan(file_t *fp, size_t maxevents
 	error = 0;
 			}
 		}
+		mutex_spin_exit(>kq_lock);
 	} else {
 		/* mark end of knote list */
 		TAILQ_INSERT_TAIL(>kq_head, marker, kn_tqe);
 
+		/*
+		 * Acquire the fdp->fd_lock interlock to avoid races with
+		 * file creation/destruction from other threads.
+		 */
+		mutex_spin_exit(>kq_lock);
+		mutex_enter(>fd_lock);
+		mutex_spin_enter(>kq_lock);
+
 		while (count != 0) {
 			kn = TAILQ_FIRST(>kq_head);	/* get next knote */
 			while ((kn->kn_status & KN_MARKER) != 0) {
@@ -1218,6 +1228,7 @@ kqueue_scan(file_t *fp, size_t maxevents
 	(timeout = gettimeleft(,
 	)) <= 0))
 		goto done;
+	mutex_exit(>fd_lock);
 	goto retry;
 }
 /* someone else's marker. */
@@ -1239,6 +1250,7 @@ kqueue_scan(file_t *fp, size_t maxevents
 KASSERT(kn->kn_fop != NULL);
 KASSERT(kn->kn_fop->f_event != NULL);
 KERNEL_LOCK(1, NULL);		/* XXXSMP */
+KASSERT(mutex_owned(>fd_lock));
 rv = (*kn->kn_fop->f_event)(kn, 0);
 KERNEL_UNLOCK_ONE(NULL);	/* XXXSMP */
 mutex_spin_enter(>kq_lock);
@@ -1261,10 +1273,10 @@ kqueue_scan(file_t *fp, size_t maxevents
 			nkev++;
 			if (kn->kn_flags & EV_ONESHOT) {
 /* delete ONESHOT events after retrieval */
-mutex_spin_exit(>kq_lock);
-mutex_enter(>fd_lock);
 kn->kn_status &= ~KN_BUSY;
+mutex_spin_exit(>kq_lock);
 knote_detach(kn, fdp, true);
+mutex_enter(>fd_lock);
 mutex_spin_enter(>kq_lock);
 			} else if (kn->kn_flags & EV_CLEAR) {
 /* clear state after retrieval */
@@ -1286,9 +1298,11 @@ kqueue_scan(file_t *fp, size_t maxevents
 			if (nkev == kevcnt) {
 /* do copyouts in kevcnt chunks */
 mutex_spin_exit(>kq_lock);
+mutex_exit(>fd_lock);
 error = (*keops->keo_put_events)
 (keops->keo_private,
 kevbuf, ulistp, nevents, nkev);
+mutex_enter(>fd_lock);
 mutex_spin_enter(>kq_lock);
 nevents += nkev;
 nkev = 0;
@@ -1301,9 +1315,10 @@ kqueue_scan(file_t *fp, size_t maxevents
 break;
 			}
 		}
-	}
  done:
- 	mutex_spin_exit(>kq_lock);
+		mutex_spin_exit(>kq_lock);
+		mutex_exit(>fd_lock);
+	}
 	if (nkev != 0) {
 		/* copyout remaining events */
 		error = (*keops->keo_put_events)(keops->keo_private,

Index: src/sys/sys/event.h
diff -u src/sys/sys/event.h:1.29 src/sys/sys/event.h:1.30
--- src/sys/sys/event.h:1.29	Wed Jun 14 12:37:05 2017
+++ src/sys/sys/event.h	Sat Jul  1 16:08:56 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: event.h,v 1.29 2017/06/14 16:37:05 christos Exp $	*/
+/*	$NetBSD: event.h,v 1.30 2017/07/01 20:08:56 christos Exp $	*/
 
 /*-
  * Copyright (c) 1999,2000,2001 Jonathan Lemon 
@@ -188,10 +188,10 @@ struct knote {
 	TAILQ_ENTRY(knote)	kn_tqe;		/* q: for struct kqueue */
 	struct kqueue		*kn_kq;		/* q: which queue we are on */
 	struct kevent		kn_kevent;
-	uint32_t		kn_status;
-	uint32_t		kn_sfflags;	/*   saved filter flags */
-	uintptr_t		kn_sdata;	/*   saved data field */
-	void			*kn_obj;	/*   pointer to monitored obj */
+	uint32_t		kn_status;	/* q: flags below */
+	uint32_t		kn_sfflags;	/*saved filter flags */
+	uintptr_t		kn_sdata;	/*saved data field */
+	void			*kn_obj;	/*monitored obj */
 	const struct filterops	*kn_fop;
 	struct kfilter		*kn_kfilter;
 	void 			*kn_hook;
@@ -201,7 +201,8 @@ 

CVS commit: src/sys

2017-07-01 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jul  1 20:08:56 UTC 2017

Modified Files:
src/sys/kern: kern_event.c
src/sys/sys: event.h

Log Message:
fix file descriptor locking (from joerg).
fixes kernel crashes by running go
XXX: pullup-7


To generate a diff of this commit:
cvs rdiff -u -r1.91 -r1.92 src/sys/kern/kern_event.c
cvs rdiff -u -r1.29 -r1.30 src/sys/sys/event.h

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



CVS commit: src/sys/miscfs/genfs

2017-07-01 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jul  1 20:07:00 UTC 2017

Modified Files:
src/sys/miscfs/genfs: genfs_vnops.c

Log Message:
Provide EVFILT_WRITE; this is what FreeBSD does and go wants it.
Makes go unit tests pass.


To generate a diff of this commit:
cvs rdiff -u -r1.197 -r1.198 src/sys/miscfs/genfs/genfs_vnops.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/miscfs/genfs/genfs_vnops.c
diff -u src/sys/miscfs/genfs/genfs_vnops.c:1.197 src/sys/miscfs/genfs/genfs_vnops.c:1.198
--- src/sys/miscfs/genfs/genfs_vnops.c:1.197	Sun Jun  4 04:02:26 2017
+++ src/sys/miscfs/genfs/genfs_vnops.c	Sat Jul  1 16:07:00 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: genfs_vnops.c,v 1.197 2017/06/04 08:02:26 hannken Exp $	*/
+/*	$NetBSD: genfs_vnops.c,v 1.198 2017/07/01 20:07:00 christos Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -57,7 +57,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: genfs_vnops.c,v 1.197 2017/06/04 08:02:26 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: genfs_vnops.c,v 1.198 2017/07/01 20:07:00 christos Exp $");
 
 #include 
 #include 
@@ -500,6 +500,32 @@ filt_genfsread(struct knote *kn, long hi
 }
 
 static int
+filt_genfswrite(struct knote *kn, long hint)
+{
+	struct vnode *vp = (struct vnode *)kn->kn_hook;
+
+	/*
+	 * filesystem is gone, so set the EOF flag and schedule
+	 * the knote for deletion.
+	 */
+	switch (hint) {
+	case NOTE_REVOKE:
+		KASSERT(mutex_owned(vp->v_interlock));
+		kn->kn_flags |= (EV_EOF | EV_ONESHOT);
+		return (1);
+	case 0:
+		mutex_enter(vp->v_interlock);
+		kn->kn_data = 0;
+		mutex_exit(vp->v_interlock);
+		return 1;
+	default:
+		KASSERT(mutex_owned(vp->v_interlock));
+		kn->kn_data = 0;
+		return 1;
+	}
+}
+
+static int
 filt_genfsvnode(struct knote *kn, long hint)
 {
 	struct vnode *vp = (struct vnode *)kn->kn_hook;
@@ -530,6 +556,8 @@ filt_genfsvnode(struct knote *kn, long h
 
 static const struct filterops genfsread_filtops =
 	{ 1, NULL, filt_genfsdetach, filt_genfsread };
+static const struct filterops genfswrite_filtops =
+	{ 1, NULL, filt_genfsdetach, filt_genfswrite };
 static const struct filterops genfsvnode_filtops =
 	{ 1, NULL, filt_genfsdetach, filt_genfsvnode };
 
@@ -549,6 +577,9 @@ genfs_kqfilter(void *v)
 	case EVFILT_READ:
 		kn->kn_fop = _filtops;
 		break;
+	case EVFILT_WRITE:
+		kn->kn_fop = _filtops;
+		break;
 	case EVFILT_VNODE:
 		kn->kn_fop = _filtops;
 		break;



CVS commit: src/sys/miscfs/genfs

2017-07-01 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jul  1 20:07:00 UTC 2017

Modified Files:
src/sys/miscfs/genfs: genfs_vnops.c

Log Message:
Provide EVFILT_WRITE; this is what FreeBSD does and go wants it.
Makes go unit tests pass.


To generate a diff of this commit:
cvs rdiff -u -r1.197 -r1.198 src/sys/miscfs/genfs/genfs_vnops.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-07-01 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jul  1 16:59:12 UTC 2017

Modified Files:
src/sys/kern: uipc_domain.c
src/sys/net: rtsock.c
src/sys/sys: socket.h

Log Message:
put the code that returns the sizeof the socket by family in one place.


To generate a diff of this commit:
cvs rdiff -u -r1.96 -r1.97 src/sys/kern/uipc_domain.c
cvs rdiff -u -r1.226 -r1.227 src/sys/net/rtsock.c
cvs rdiff -u -r1.122 -r1.123 src/sys/sys/socket.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/uipc_domain.c
diff -u src/sys/kern/uipc_domain.c:1.96 src/sys/kern/uipc_domain.c:1.97
--- src/sys/kern/uipc_domain.c:1.96	Tue Dec  2 14:45:58 2014
+++ src/sys/kern/uipc_domain.c	Sat Jul  1 12:59:12 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: uipc_domain.c,v 1.96 2014/12/02 19:45:58 christos Exp $	*/
+/*	$NetBSD: uipc_domain.c,v 1.97 2017/07/01 16:59:12 christos Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1993
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uipc_domain.c,v 1.96 2014/12/02 19:45:58 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uipc_domain.c,v 1.97 2017/07/01 16:59:12 christos Exp $");
 
 #include 
 #include 
@@ -228,7 +228,7 @@ sockaddr_const_addr(const struct sockadd
 }
 
 const struct sockaddr *
-sockaddr_any_by_family(int family)
+sockaddr_any_by_family(sa_family_t family)
 {
 	const struct domain *dom;
 
@@ -255,43 +255,41 @@ sockaddr_anyaddr(const struct sockaddr *
 	return sockaddr_const_addr(any, slenp);
 }
 
-#ifdef DIAGNOSTIC
-static void
-sockaddr_checklen(const struct sockaddr *sa)
+socklen_t
+sockaddr_getsize_by_family(sa_family_t af)
 {
-	socklen_t len = 0;
-	switch (sa->sa_family) {
+	switch (af) {
 	case AF_INET:
-		len = sizeof(struct sockaddr_in);
-		break;
+		return sizeof(struct sockaddr_in);
 	case AF_INET6:
-		len = sizeof(struct sockaddr_in6);
-		break;
+		return sizeof(struct sockaddr_in6);
 	case AF_UNIX:
-		len = sizeof(struct sockaddr_un);
-		break;
+		return sizeof(struct sockaddr_un);
 	case AF_LINK:
-		len = sizeof(struct sockaddr_dl);
-		// As long as it is not 0...
-		if (sa->sa_len != 0)
-			return;
-		break;
+		return sizeof(struct sockaddr_dl);
 	case AF_APPLETALK:
-		len = sizeof(struct sockaddr_at);
-		break;
+		return sizeof(struct sockaddr_at);
 	default:
-		printf("%s: Unhandled af=%hhu socklen=%hhu\n", __func__,
-		sa->sa_family, sa->sa_len);
-		return;
-	}
-	if (len != sa->sa_len) {
-		char buf[512];
-		sockaddr_format(sa, buf, sizeof(buf));
-		printf("%s: %p bad len af=%hhu socklen=%hhu len=%u [%s]\n",
-		__func__, sa, sa->sa_family, sa->sa_len,
-		(unsigned)len, buf);
+#ifdef DIAGNOSTIC
+		printf("%s: Unhandled address family=%hhu\n", __func__, af);
+#endif
+		return 0;
 	}
 }
+
+#ifdef DIAGNOSTIC
+static void
+sockaddr_checklen(const struct sockaddr *sa)
+{
+	socklen_t len = sockaddr_getsize_by_family(sa->sa_family);
+	if (len == 0 || len == sa->sa_len)
+		return;
+
+	char buf[512];
+	sockaddr_format(sa, buf, sizeof(buf));
+	printf("%s: %p bad len af=%hhu socklen=%hhu len=%u [%s]\n",
+	__func__, sa, sa->sa_family, sa->sa_len, (unsigned)len, buf);
+}
 #else
 #define sockaddr_checklen(sa) ((void)0)
 #endif

Index: src/sys/net/rtsock.c
diff -u src/sys/net/rtsock.c:1.226 src/sys/net/rtsock.c:1.227
--- src/sys/net/rtsock.c:1.226	Fri Jun 30 14:28:31 2017
+++ src/sys/net/rtsock.c	Sat Jul  1 12:59:12 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: rtsock.c,v 1.226 2017/06/30 18:28:31 christos Exp $	*/
+/*	$NetBSD: rtsock.c,v 1.227 2017/07/01 16:59:12 christos Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -61,7 +61,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rtsock.c,v 1.226 2017/06/30 18:28:31 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rtsock.c,v 1.227 2017/07/01 16:59:12 christos Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -721,24 +721,6 @@ out:
 	return error;
 }
 
-static socklen_t
-sa_addrlen(const struct sockaddr *sa)
-{
-
-	switch (sa->sa_family) {
-#ifdef INET
-	case AF_INET:
-		return sizeof(struct sockaddr_in);
-#endif
-#ifdef INET6
-	case AF_INET6:
-		return sizeof(struct sockaddr_in6);
-#endif
-	default:
-		return 0;
-	}
-}
-
 /*ARGSUSED*/
 int
 COMPATNAME(route_output)(struct mbuf *m, struct socket *so)
@@ -819,8 +801,10 @@ COMPATNAME(route_output)(struct mbuf *m,
 	 * (padded with 0's). We keep the original length of the sockaddr.
 	 */
 	if (info.rti_info[RTAX_NETMASK]) {
-		socklen_t sa_len = sa_addrlen(info.rti_info[RTAX_NETMASK]);
-		socklen_t masklen = info.rti_info[RTAX_NETMASK]->sa_len;
+		socklen_t sa_len = sockaddr_getsize_by_family(
+		info.rti_info[RTAX_NETMASK]->sa_family);
+		socklen_t masklen = sockaddr_getlen(
+		info.rti_info[RTAX_NETMASK]);
 		if (sa_len != 0 && sa_len > masklen) {
 			KASSERT(sa_len <= sizeof(netmask));
 			memcpy(, info.rti_info[RTAX_NETMASK], masklen);

Index: src/sys/sys/socket.h
diff -u src/sys/sys/socket.h:1.122 

CVS commit: src/sys

2017-07-01 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jul  1 16:59:12 UTC 2017

Modified Files:
src/sys/kern: uipc_domain.c
src/sys/net: rtsock.c
src/sys/sys: socket.h

Log Message:
put the code that returns the sizeof the socket by family in one place.


To generate a diff of this commit:
cvs rdiff -u -r1.96 -r1.97 src/sys/kern/uipc_domain.c
cvs rdiff -u -r1.226 -r1.227 src/sys/net/rtsock.c
cvs rdiff -u -r1.122 -r1.123 src/sys/sys/socket.h

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-07-01 Thread Pierre Pronchery
Module Name:src
Committed By:   khorben
Date:   Sat Jul  1 16:36:46 UTC 2017

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

Log Message:
Typo


To generate a diff of this commit:
cvs rdiff -u -r1.340 -r1.341 src/sys/sys/proc.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/proc.h
diff -u src/sys/sys/proc.h:1.340 src/sys/sys/proc.h:1.341
--- src/sys/sys/proc.h:1.340	Thu Mar 30 20:17:11 2017
+++ src/sys/sys/proc.h	Sat Jul  1 16:36:46 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: proc.h,v 1.340 2017/03/30 20:17:11 christos Exp $	*/
+/*	$NetBSD: proc.h,v 1.341 2017/07/01 16:36:46 khorben Exp $	*/
 
 /*-
  * Copyright (c) 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -200,7 +200,7 @@ struct emul {
 };
 
 /*
- * Emulation miscelaneous flags
+ * Emulation miscellaneous flags
  */
 #define	EMUL_HAS_SYS___syscall	0x001	/* Has SYS___syscall */
 



CVS commit: src/sys/sys

2017-07-01 Thread Pierre Pronchery
Module Name:src
Committed By:   khorben
Date:   Sat Jul  1 16:36:46 UTC 2017

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

Log Message:
Typo


To generate a diff of this commit:
cvs rdiff -u -r1.340 -r1.341 src/sys/sys/proc.h

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



CVS commit: src/sys/external/bsd/ipf/netinet

2017-07-01 Thread Pierre Pronchery
Module Name:src
Committed By:   khorben
Date:   Sat Jul  1 16:34:17 UTC 2017

Modified Files:
src/sys/external/bsd/ipf/netinet: ip_nat.c ip_state.c

Log Message:
Typo


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/external/bsd/ipf/netinet/ip_nat.c
cvs rdiff -u -r1.7 -r1.8 src/sys/external/bsd/ipf/netinet/ip_state.c

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

Modified files:

Index: src/sys/external/bsd/ipf/netinet/ip_nat.c
diff -u src/sys/external/bsd/ipf/netinet/ip_nat.c:1.17 src/sys/external/bsd/ipf/netinet/ip_nat.c:1.18
--- src/sys/external/bsd/ipf/netinet/ip_nat.c:1.17	Tue Oct  4 14:36:46 2016
+++ src/sys/external/bsd/ipf/netinet/ip_nat.c	Sat Jul  1 16:34:17 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: ip_nat.c,v 1.17 2016/10/04 14:36:46 sborrill Exp $	*/
+/*	$NetBSD: ip_nat.c,v 1.18 2017/07/01 16:34:17 khorben Exp $	*/
 
 /*
  * Copyright (C) 2012 by Darren Reed.
@@ -113,7 +113,7 @@ extern struct ifnet vpnif;
 #if !defined(lint)
 #if defined(__NetBSD__)
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ip_nat.c,v 1.17 2016/10/04 14:36:46 sborrill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip_nat.c,v 1.18 2017/07/01 16:34:17 khorben Exp $");
 #else
 static const char sccsid[] = "@(#)ip_nat.c	1.11 6/5/96 (C) 1995 Darren Reed";
 static const char rcsid[] = "@(#)Id: ip_nat.c,v 1.1.1.2 2012/07/22 13:45:27 darrenr Exp";
@@ -6012,7 +6012,7 @@ ipf_nat_icmpquerytype(int icmptype)
 	{
 	case ICMP_ECHOREPLY:
 	case ICMP_ECHO:
-	/* route aedvertisement/solliciation is currently unsupported: */
+	/* route advertisement/sollicitation is currently unsupported: */
 	/* it would require rewriting the ICMP data section*/
 	case ICMP_TSTAMP:
 	case ICMP_TSTAMPREPLY:

Index: src/sys/external/bsd/ipf/netinet/ip_state.c
diff -u src/sys/external/bsd/ipf/netinet/ip_state.c:1.7 src/sys/external/bsd/ipf/netinet/ip_state.c:1.8
--- src/sys/external/bsd/ipf/netinet/ip_state.c:1.7	Sun Apr 23 20:47:22 2017
+++ src/sys/external/bsd/ipf/netinet/ip_state.c	Sat Jul  1 16:34:17 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: ip_state.c,v 1.7 2017/04/23 20:47:22 christos Exp $	*/
+/*	$NetBSD: ip_state.c,v 1.8 2017/07/01 16:34:17 khorben Exp $	*/
 
 /*
  * Copyright (C) 2012 by Darren Reed.
@@ -100,7 +100,7 @@ struct file;
 #if !defined(lint)
 #if defined(__NetBSD__)
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ip_state.c,v 1.7 2017/04/23 20:47:22 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip_state.c,v 1.8 2017/07/01 16:34:17 khorben Exp $");
 #else
 static const char sccsid[] = "@(#)ip_state.c	1.8 6/5/96 (C) 1993-2000 Darren Reed";
 static const char rcsid[] = "@(#)Id: ip_state.c,v 1.1.1.2 2012/07/22 13:45:37 darrenr Exp";
@@ -1349,7 +1349,7 @@ ipf_state_add(ipf_main_softc_t *softc, f
 
 	/*
 	 * If a packet that was created locally is trying to go out but we
-	 * do not match here here because of this lock, it is likely that
+	 * do not match here because of this lock, it is likely that
 	 * the policy will block it and return network unreachable back up
 	 * the stack. To mitigate this error, EAGAIN is returned instead,
 	 * telling the IP stack to try sending this packet again later.
@@ -1414,7 +1414,7 @@ ipf_state_add(ipf_main_softc_t *softc, f
 	is->is_die = 1 + softc->ipf_ticks;
 	/*
 	 * We want to check everything that is a property of this packet,
-	 * but we don't (automatically) care about it's fragment status as
+	 * but we don't (automatically) care about its fragment status as
 	 * this may change.
 	 */
 	is->is_pass = pass;



CVS commit: src/sys/external/bsd/ipf/netinet

2017-07-01 Thread Pierre Pronchery
Module Name:src
Committed By:   khorben
Date:   Sat Jul  1 16:34:17 UTC 2017

Modified Files:
src/sys/external/bsd/ipf/netinet: ip_nat.c ip_state.c

Log Message:
Typo


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/external/bsd/ipf/netinet/ip_nat.c
cvs rdiff -u -r1.7 -r1.8 src/sys/external/bsd/ipf/netinet/ip_state.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

2017-07-01 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Jul  1 16:25:16 UTC 2017

Modified Files:
src/sys/arch/arm/sunxi: files.sunxi sun8i_h3_ccu.c
src/sys/arch/evbarm/conf: SUNXI
Added Files:
src/sys/arch/arm/sunxi: sunxi_emac.c sunxi_emac.h

Log Message:
Add driver for Allwinner Gigabit Ethernet (EMAC) as found in sun8i and
later family SoCs.

This is a port of my FreeBSD driver which has been confirmed to work on
Allwinner H3, A83T, and A64 SoCs.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/arm/sunxi/files.sunxi
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/arm/sunxi/sun8i_h3_ccu.c
cvs rdiff -u -r0 -r1.1 src/sys/arch/arm/sunxi/sunxi_emac.c \
src/sys/arch/arm/sunxi/sunxi_emac.h
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/evbarm/conf/SUNXI

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

Modified files:

Index: src/sys/arch/arm/sunxi/files.sunxi
diff -u src/sys/arch/arm/sunxi/files.sunxi:1.5 src/sys/arch/arm/sunxi/files.sunxi:1.6
--- src/sys/arch/arm/sunxi/files.sunxi:1.5	Thu Jun 29 19:38:24 2017
+++ src/sys/arch/arm/sunxi/files.sunxi	Sat Jul  1 16:25:16 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: files.sunxi,v 1.5 2017/06/29 19:38:24 jmcneill Exp $
+#	$NetBSD: files.sunxi,v 1.6 2017/07/01 16:25:16 jmcneill Exp $
 #
 # Configuration info for Allwinner sunxi family SoCs
 #
@@ -62,6 +62,11 @@ device	sunxirtc
 attach	sunxirtc at fdt with sunxi_rtc
 file	arch/arm/sunxi/sunxi_rtc.c		sunxi_rtc
 
+# EMAC
+device	sunxiemac: arp, ether, ifnet, mii
+attach	sunxiemac at fdt with sunxi_emac
+file	arch/arm/sunxi/sunxi_emac.c		sunxi_emac
+
 # SOC parameters
 defflag	opt_soc.h			SOC_SUNXI
 defflag	opt_soc.h			SOC_SUN8I: SOC_SUNXI

Index: src/sys/arch/arm/sunxi/sun8i_h3_ccu.c
diff -u src/sys/arch/arm/sunxi/sun8i_h3_ccu.c:1.4 src/sys/arch/arm/sunxi/sun8i_h3_ccu.c:1.5
--- src/sys/arch/arm/sunxi/sun8i_h3_ccu.c:1.4	Thu Jun 29 17:08:52 2017
+++ src/sys/arch/arm/sunxi/sun8i_h3_ccu.c	Sat Jul  1 16:25:16 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: sun8i_h3_ccu.c,v 1.4 2017/06/29 17:08:52 jmcneill Exp $ */
+/* $NetBSD: sun8i_h3_ccu.c,v 1.5 2017/07/01 16:25:16 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2017 Jared McNeill 
@@ -29,7 +29,7 @@
 
 #include 
 
-__KERNEL_RCSID(1, "$NetBSD: sun8i_h3_ccu.c,v 1.4 2017/06/29 17:08:52 jmcneill Exp $");
+__KERNEL_RCSID(1, "$NetBSD: sun8i_h3_ccu.c,v 1.5 2017/07/01 16:25:16 jmcneill Exp $");
 
 #include 
 #include 
@@ -185,6 +185,8 @@ static struct sunxi_ccu_clk sun8i_h3_ccu
 	BUS_CLK_GATING_REG0, 9),
 	SUNXI_CCU_GATE(H3_CLK_BUS_MMC2, "bus-mmc2", "ahb1",
 	BUS_CLK_GATING_REG0, 10),
+	SUNXI_CCU_GATE(H3_CLK_BUS_EMAC, "bus-emac", "ahb2",
+	BUS_CLK_GATING_REG0, 17),
 	SUNXI_CCU_GATE(H3_CLK_BUS_OTG, "bus-otg", "ahb1",
 	BUS_CLK_GATING_REG0, 23),
 	SUNXI_CCU_GATE(H3_CLK_BUS_EHCI0, "bus-ehci0", "ahb1",

Index: src/sys/arch/evbarm/conf/SUNXI
diff -u src/sys/arch/evbarm/conf/SUNXI:1.6 src/sys/arch/evbarm/conf/SUNXI:1.7
--- src/sys/arch/evbarm/conf/SUNXI:1.6	Thu Jun 29 19:38:24 2017
+++ src/sys/arch/evbarm/conf/SUNXI	Sat Jul  1 16:25:15 2017
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: SUNXI,v 1.6 2017/06/29 19:38:24 jmcneill Exp $
+#	$NetBSD: SUNXI,v 1.7 2017/07/01 16:25:15 jmcneill Exp $
 #
 #	Allwinner sunxi family
 #
@@ -77,8 +77,9 @@ armgic0		at gic?
 #gpio*		at gpiobus?
 
 # Ethernet
-#awg*		at pci? dev ? function ?	# Allwinner Gigabit Ethernet
-#ukphy*		at mii? phy ?
+sunxiemac*	at fdt?			# Allwinner Gigabit Ethernet
+rgephy*		at mii? phy ?
+ukphy*		at mii? phy ?
 
 # UART
 com*		at fdt?			# UART

Added files:

Index: src/sys/arch/arm/sunxi/sunxi_emac.c
diff -u /dev/null src/sys/arch/arm/sunxi/sunxi_emac.c:1.1
--- /dev/null	Sat Jul  1 16:25:16 2017
+++ src/sys/arch/arm/sunxi/sunxi_emac.c	Sat Jul  1 16:25:16 2017
@@ -0,0 +1,1435 @@
+/* $NetBSD: sunxi_emac.c,v 1.1 2017/07/01 16:25:16 jmcneill Exp $ */
+
+/*-
+ * Copyright (c) 2016-2017 Jared McNeill 
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR 

CVS commit: src/sys/arch

2017-07-01 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Jul  1 16:25:16 UTC 2017

Modified Files:
src/sys/arch/arm/sunxi: files.sunxi sun8i_h3_ccu.c
src/sys/arch/evbarm/conf: SUNXI
Added Files:
src/sys/arch/arm/sunxi: sunxi_emac.c sunxi_emac.h

Log Message:
Add driver for Allwinner Gigabit Ethernet (EMAC) as found in sun8i and
later family SoCs.

This is a port of my FreeBSD driver which has been confirmed to work on
Allwinner H3, A83T, and A64 SoCs.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/arm/sunxi/files.sunxi
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/arm/sunxi/sun8i_h3_ccu.c
cvs rdiff -u -r0 -r1.1 src/sys/arch/arm/sunxi/sunxi_emac.c \
src/sys/arch/arm/sunxi/sunxi_emac.h
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/evbarm/conf/SUNXI

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



CVS commit: src/sys/dev/ic

2017-07-01 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Sat Jul  1 15:54:09 UTC 2017

Modified Files:
src/sys/dev/ic: ncr53c9x.c

Log Message:
do what other SCSI drivers do - ack MSG_IGN_WIDE_RESIDUE messages and move on
instead of erroring out and resetting the drive
while there, when rejecting a message print which one it is
now my U2 boots without resetting its disk 3 times


To generate a diff of this commit:
cvs rdiff -u -r1.147 -r1.148 src/sys/dev/ic/ncr53c9x.c

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

Modified files:

Index: src/sys/dev/ic/ncr53c9x.c
diff -u src/sys/dev/ic/ncr53c9x.c:1.147 src/sys/dev/ic/ncr53c9x.c:1.148
--- src/sys/dev/ic/ncr53c9x.c:1.147	Wed Jan 11 07:16:48 2017
+++ src/sys/dev/ic/ncr53c9x.c	Sat Jul  1 15:54:08 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: ncr53c9x.c,v 1.147 2017/01/11 07:16:48 skrll Exp $	*/
+/*	$NetBSD: ncr53c9x.c,v 1.148 2017/07/01 15:54:08 macallan Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2002 The NetBSD Foundation, Inc.
@@ -70,7 +70,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ncr53c9x.c,v 1.147 2017/01/11 07:16:48 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ncr53c9x.c,v 1.148 2017/07/01 15:54:08 macallan Exp $");
 
 #include 
 #include 
@@ -1837,12 +1837,15 @@ gotit:
 goto reject;
 			}
 			break;
+		case MSG_IGN_WIDE_RESIDUE:
+			NCR_MSGS(("ignore wide residue "));
+			break;
 
 		default:
 			NCR_MSGS(("ident "));
 			scsipi_printaddr(ecb->xs->xs_periph);
-			printf("%s: unrecognized MESSAGE; sending REJECT\n",
-			device_xname(sc->sc_dev));
+			printf("%s: unrecognized MESSAGE (%x); sending REJECT\n",
+			device_xname(sc->sc_dev), sc->sc_imess[0]);
 		reject:
 			ncr53c9x_sched_msgout(SEND_REJECT);
 			break;



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

2017-07-01 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Jul  1 15:30:41 UTC 2017

Modified Files:
src/sys/arch/arm/arm32: cpuswitch.S

Log Message:
Whitespace (align comments)


To generate a diff of this commit:
cvs rdiff -u -r1.91 -r1.92 src/sys/arch/arm/arm32/cpuswitch.S

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/cpuswitch.S
diff -u src/sys/arch/arm/arm32/cpuswitch.S:1.91 src/sys/arch/arm/arm32/cpuswitch.S:1.92
--- src/sys/arch/arm/arm32/cpuswitch.S:1.91	Sat Jul  1 15:28:18 2017
+++ src/sys/arch/arm/arm32/cpuswitch.S	Sat Jul  1 15:30:41 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpuswitch.S,v 1.91 2017/07/01 15:28:18 skrll Exp $	*/
+/*	$NetBSD: cpuswitch.S,v 1.92 2017/07/01 15:30:41 skrll Exp $	*/
 
 /*
  * Copyright 2003 Wasabi Systems, Inc.
@@ -87,7 +87,7 @@
 #include 
 #include 
 
-	RCSID("$NetBSD: cpuswitch.S,v 1.91 2017/07/01 15:28:18 skrll Exp $")
+	RCSID("$NetBSD: cpuswitch.S,v 1.92 2017/07/01 15:30:41 skrll Exp $")
 
 /* LINTSTUB: include  */
 
@@ -354,25 +354,25 @@ AST_ALIGNMENT_FAULT_LOCALS
 ENTRY_NP(softint_switch)
 	push	{r4, r6, r7, lr}
 
-	ldr	r7, [r0, #L_CPU]		/* get curcpu */
+	ldr	r7, [r0, #L_CPU]	/* get curcpu */
 #if defined(TPIDRPRW_IS_CURLWP)
-	mrc	p15, 0, r4, c13, c0, 4		/* get old lwp */
+	mrc	p15, 0, r4, c13, c0, 4	/* get old lwp */
 #else
-	ldr	r4, [r7, #(CI_CURLWP)]		/* get old lwp */
+	ldr	r4, [r7, #(CI_CURLWP)]	/* get old lwp */
 #endif
-	mrs	r6, cpsr			/* we need to save this */
+	mrs	r6, cpsr		/* we need to save this */
 
 	/*
 	 * If the soft lwp blocks, it needs to return to softint_tramp
 	 */
-	mov	r2, sp/* think ip */
-	adr	r3, softint_tramp		/* think lr */
+	mov	r2, sp			/* think ip */
+	adr	r3, softint_tramp	/* think lr */
 	push	{r2-r3}
 	push	{r4-r7}
 
-	mov	r5, r0/* save new lwp */
+	mov	r5, r0			/* save new lwp */
 
-	ldr	r2, [r4, #(L_PCB)]		/* get old lwp's pcb */
+	ldr	r2, [r4, #(L_PCB)]	/* get old lwp's pcb */
 
 	/* Save all the registers into the old lwp's pcb */
 #if defined(__XSCALE__) || defined(_ARM_ARCH_6)
@@ -401,9 +401,9 @@ ENTRY_NP(softint_switch)
 	 * We're switching to a bound LWP so its l_cpu is already correct.
 	 */
 #if defined(TPIDRPRW_IS_CURLWP)
-	mcr	p15, 0, r5, c13, c0, 4		/* save new lwp */
+	mcr	p15, 0, r5, c13, c0, 4	/* save new lwp */
 #endif
-	str	r5, [r7, #(CI_CURLWP)]		/* save new lwp */
+	str	r5, [r7, #(CI_CURLWP)]	/* save new lwp */
 
 	/*
 	 * Normally, we'd get {r8-r13} but since this is a softint lwp
@@ -429,9 +429,9 @@ ENTRY_NP(softint_switch)
 
 	IRQdisable
 #if defined(TPIDRPRW_IS_CURLWP)
-	mcr	p15, 0, r4, c13, c0, 4		/* restore pinned lwp */
+	mcr	p15, 0, r4, c13, c0, 4	/* restore pinned lwp */
 #endif
-	str	r4, [r7, #(CI_CURLWP)]		/* restore pinned lwp */
+	str	r4, [r7, #(CI_CURLWP)]	/* restore pinned lwp */
 	ldr	sp, [r2, #(PCB_KSP)]	/* now running on the old stack. */
 
 	/* At this point we can allow IRQ's again. */



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

2017-07-01 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Jul  1 15:30:41 UTC 2017

Modified Files:
src/sys/arch/arm/arm32: cpuswitch.S

Log Message:
Whitespace (align comments)


To generate a diff of this commit:
cvs rdiff -u -r1.91 -r1.92 src/sys/arch/arm/arm32/cpuswitch.S

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-07-01 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Jul  1 15:28:18 UTC 2017

Modified Files:
src/sys/arch/arm/arm32: cpuswitch.S

Log Message:
Trailing whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.90 -r1.91 src/sys/arch/arm/arm32/cpuswitch.S

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/cpuswitch.S
diff -u src/sys/arch/arm/arm32/cpuswitch.S:1.90 src/sys/arch/arm/arm32/cpuswitch.S:1.91
--- src/sys/arch/arm/arm32/cpuswitch.S:1.90	Wed Apr  8 12:07:40 2015
+++ src/sys/arch/arm/arm32/cpuswitch.S	Sat Jul  1 15:28:18 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpuswitch.S,v 1.90 2015/04/08 12:07:40 matt Exp $	*/
+/*	$NetBSD: cpuswitch.S,v 1.91 2017/07/01 15:28:18 skrll Exp $	*/
 
 /*
  * Copyright 2003 Wasabi Systems, Inc.
@@ -87,7 +87,7 @@
 #include 
 #include 
 
-	RCSID("$NetBSD: cpuswitch.S,v 1.90 2015/04/08 12:07:40 matt Exp $")
+	RCSID("$NetBSD: cpuswitch.S,v 1.91 2017/07/01 15:28:18 skrll Exp $")
 
 /* LINTSTUB: include  */
 
@@ -250,7 +250,7 @@ ENTRY(cpu_switchto)
 	vmsrne	fpexc, r0
 #endif
 
-	/* 
+	/*
 	 * Check for restartable atomic sequences (RAS).
 	 */
 



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

2017-07-01 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Jul  1 15:28:18 UTC 2017

Modified Files:
src/sys/arch/arm/arm32: cpuswitch.S

Log Message:
Trailing whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.90 -r1.91 src/sys/arch/arm/arm32/cpuswitch.S

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



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

2017-07-01 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Jul  1 14:51:59 UTC 2017

Modified Files:
src/sys/arch/evbarm/conf: std.amlogic

Log Message:
Define __HAVE_CPU_UAREA_ALLOC_IDLELWP


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/evbarm/conf/std.amlogic

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



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

2017-07-01 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Jul  1 14:51:59 UTC 2017

Modified Files:
src/sys/arch/evbarm/conf: std.amlogic

Log Message:
Define __HAVE_CPU_UAREA_ALLOC_IDLELWP


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/evbarm/conf/std.amlogic

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

Modified files:

Index: src/sys/arch/evbarm/conf/std.amlogic
diff -u src/sys/arch/evbarm/conf/std.amlogic:1.2 src/sys/arch/evbarm/conf/std.amlogic:1.3
--- src/sys/arch/evbarm/conf/std.amlogic:1.2	Fri Feb 27 17:33:31 2015
+++ src/sys/arch/evbarm/conf/std.amlogic	Sat Jul  1 14:51:59 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: std.amlogic,v 1.2 2015/02/27 17:33:31 jmcneill Exp $
+#	$NetBSD: std.amlogic,v 1.3 2017/07/01 14:51:59 skrll Exp $
 #
 
 machine	evbarm arm
@@ -9,6 +9,7 @@ include		"arch/evbarm/conf/files.amlogic
 options 	MODULAR
 options 	MODULAR_DEFAULT_AUTOLOAD
 options 	__HAVE_CPU_COUNTER
+options 	 __HAVE_CPU_UAREA_ALLOC_IDLELWP
 options 	CORTEX_PMC
 options 	__HAVE_FAST_SOFTINTS		# should be in types.h
 options 	ARM_HAS_VBAR



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

2017-07-01 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Jul  1 12:52:01 UTC 2017

Modified Files:
src/sys/arch/evbarm/conf: std.nitrogen6

Log Message:
Define __HAVE_CPU_UAREA_ALLOC_IDLELWP


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/evbarm/conf/std.nitrogen6

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

Modified files:

Index: src/sys/arch/evbarm/conf/std.nitrogen6
diff -u src/sys/arch/evbarm/conf/std.nitrogen6:1.4 src/sys/arch/evbarm/conf/std.nitrogen6:1.5
--- src/sys/arch/evbarm/conf/std.nitrogen6:1.4	Thu Nov 24 12:06:44 2016
+++ src/sys/arch/evbarm/conf/std.nitrogen6	Sat Jul  1 12:52:01 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: std.nitrogen6,v 1.4 2016/11/24 12:06:44 hkenken Exp $
+#	$NetBSD: std.nitrogen6,v 1.5 2017/07/01 12:52:01 skrll Exp $
 #
 # standard NetBSD/evbarm options for Nitrogen6X
 
@@ -12,6 +12,7 @@ options 	NITROGEN6
 
 options 	ARM_HAS_VBAR
 options 	__HAVE_CPU_COUNTER
+options 	__HAVE_CPU_UAREA_ALLOC_IDLELWP
 options 	__HAVE_FAST_SOFTINTS		# should be in types.h
 options 	TPIDRPRW_IS_CURCPU
 options 	PCI_NETBSD_CONFIGURE



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

2017-07-01 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Jul  1 12:52:01 UTC 2017

Modified Files:
src/sys/arch/evbarm/conf: std.nitrogen6

Log Message:
Define __HAVE_CPU_UAREA_ALLOC_IDLELWP


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/evbarm/conf/std.nitrogen6

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



CVS commit: src/tools/gdb

2017-07-01 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Jul  1 12:23:09 UTC 2017

Modified Files:
src/tools/gdb: Makefile

Log Message:
--disable-nls does not work in gdb subdir, so add am_cv_func_iconv=no to
configure env. Fixes build on FreeBSD.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/tools/gdb/Makefile

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

Modified files:

Index: src/tools/gdb/Makefile
diff -u src/tools/gdb/Makefile:1.30 src/tools/gdb/Makefile:1.31
--- src/tools/gdb/Makefile:1.30	Sun Oct 16 04:37:42 2016
+++ src/tools/gdb/Makefile	Sat Jul  1 12:23:09 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.30 2016/10/16 04:37:42 mrg Exp $
+#	$NetBSD: Makefile,v 1.31 2017/07/01 12:23:09 jmcneill Exp $
 
 .include 
 
@@ -43,6 +43,8 @@ MKNATIVE_CONFIGURE_PRESET= \
 	bash_cv_func_strcoll_broken=no \
 	bash_cv_must_reinstall_sighandlers=no
 
+CONFIGURE_ENV+=	am_cv_func_iconv=no
+
 # Recent versions of Solaris have ncurses, but they hide the lib in an
 # odd directory. Prevent configure from finding the ncurses headers,
 # Solaris curses is sufficient.



CVS commit: src/tools/gdb

2017-07-01 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Jul  1 12:23:09 UTC 2017

Modified Files:
src/tools/gdb: Makefile

Log Message:
--disable-nls does not work in gdb subdir, so add am_cv_func_iconv=no to
configure env. Fixes build on FreeBSD.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/tools/gdb/Makefile

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



CVS commit: src/sys/arch

2017-07-01 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sat Jul  1 10:44:43 UTC 2017

Modified Files:
src/sys/arch/amd64/amd64: locore.S
src/sys/arch/i386/i386: locore.S machdep.c trap.c

Log Message:
Remove the osyscall call gate on i386, and emulate it. There is a one-
instruction race in it that could panic the kernel.


To generate a diff of this commit:
cvs rdiff -u -r1.123 -r1.124 src/sys/arch/amd64/amd64/locore.S
cvs rdiff -u -r1.145 -r1.146 src/sys/arch/i386/i386/locore.S
cvs rdiff -u -r1.782 -r1.783 src/sys/arch/i386/i386/machdep.c
cvs rdiff -u -r1.287 -r1.288 src/sys/arch/i386/i386/trap.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

2017-07-01 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sat Jul  1 10:44:43 UTC 2017

Modified Files:
src/sys/arch/amd64/amd64: locore.S
src/sys/arch/i386/i386: locore.S machdep.c trap.c

Log Message:
Remove the osyscall call gate on i386, and emulate it. There is a one-
instruction race in it that could panic the kernel.


To generate a diff of this commit:
cvs rdiff -u -r1.123 -r1.124 src/sys/arch/amd64/amd64/locore.S
cvs rdiff -u -r1.145 -r1.146 src/sys/arch/i386/i386/locore.S
cvs rdiff -u -r1.782 -r1.783 src/sys/arch/i386/i386/machdep.c
cvs rdiff -u -r1.287 -r1.288 src/sys/arch/i386/i386/trap.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/amd64/locore.S
diff -u src/sys/arch/amd64/amd64/locore.S:1.123 src/sys/arch/amd64/amd64/locore.S:1.124
--- src/sys/arch/amd64/amd64/locore.S:1.123	Sat Mar 25 15:07:21 2017
+++ src/sys/arch/amd64/amd64/locore.S	Sat Jul  1 10:44:42 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.S,v 1.123 2017/03/25 15:07:21 maxv Exp $	*/
+/*	$NetBSD: locore.S,v 1.124 2017/07/01 10:44:42 maxv Exp $	*/
 
 /*
  * Copyright-o-rama!
@@ -1409,7 +1409,6 @@ IDTVEC(osyscall)
 	addq $0x10,%rsp
 #endif
 	pushq	$2		/* size of instruction for restart */
-osyscall1:
 	pushq	$T_ASTFLT	/* trap # for doing ASTs */
 	INTRENTRY
 	STI(si)

Index: src/sys/arch/i386/i386/locore.S
diff -u src/sys/arch/i386/i386/locore.S:1.145 src/sys/arch/i386/i386/locore.S:1.146
--- src/sys/arch/i386/i386/locore.S:1.145	Thu Feb  2 19:12:09 2017
+++ src/sys/arch/i386/i386/locore.S	Sat Jul  1 10:44:42 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.S,v 1.145 2017/02/02 19:12:09 maxv Exp $	*/
+/*	$NetBSD: locore.S,v 1.146 2017/07/01 10:44:42 maxv Exp $	*/
 
 /*
  * Copyright-o-rama!
@@ -128,7 +128,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: locore.S,v 1.145 2017/02/02 19:12:09 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: locore.S,v 1.146 2017/07/01 10:44:42 maxv Exp $");
 
 #include "opt_compat_oldboot.h"
 #include "opt_copy_symtab.h"
@@ -1239,30 +1239,12 @@ ENTRY(savectx)
 END(savectx)
 
 /*
- * osyscall()
- *
- * Old call gate entry for syscall
- */
-IDTVEC(osyscall)
-#ifndef XEN
-	/* XXX we are in trouble! interrupts be off here. */
-	cli			/* must be first instruction */
-#endif
-	pushfl			/* set eflags in trap frame */
-	popl	8(%esp)
-	orl	$PSL_I,8(%esp)	/* re-enable ints on return to user */
-	pushl	$7		/* size of instruction for restart */
-	jmp	syscall1
-IDTVEC_END(osyscall)
-
-/*
  * syscall()
  *
  * Trap gate entry for syscall
  */
 IDTVEC(syscall)
 	pushl	$2		/* size of instruction for restart */
-syscall1:
 	pushl	$T_ASTFLT	/* trap # for doing ASTs */
 	INTRENTRY
 	STI(%eax)

Index: src/sys/arch/i386/i386/machdep.c
diff -u src/sys/arch/i386/i386/machdep.c:1.782 src/sys/arch/i386/i386/machdep.c:1.783
--- src/sys/arch/i386/i386/machdep.c:1.782	Fri Mar 24 17:09:36 2017
+++ src/sys/arch/i386/i386/machdep.c	Sat Jul  1 10:44:42 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.782 2017/03/24 17:09:36 maxv Exp $	*/
+/*	$NetBSD: machdep.c,v 1.783 2017/07/01 10:44:42 maxv Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2000, 2004, 2006, 2008, 2009
@@ -67,7 +67,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.782 2017/03/24 17:09:36 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.783 2017/07/01 10:44:42 maxv Exp $");
 
 #include "opt_beep.h"
 #include "opt_compat_ibcs2.h"
@@ -933,7 +933,6 @@ setsegment(struct segment_descriptor *sd
 #define	IDTVEC(name)	__CONCAT(X, name)
 typedef void (vector)(void);
 extern vector IDTVEC(syscall);
-extern vector IDTVEC(osyscall);
 extern vector *IDTVEC(exceptions)[];
 extern vector IDTVEC(svr4_fasttrap);
 void (*svr4_fasttrap_vec)(void) = (void (*)(void))nullop;
@@ -1290,14 +1289,9 @@ init386(paddr_t first_avail)
 #endif /* XEN */
 
 	/* make ldt gates and memory segments */
-	setgate([LSYS5CALLS_SEL].gd, (osyscall), 1,
-	SDT_SYS386CGT, SEL_UPL, GSEL(GCODE_SEL, SEL_KPL));
-
 	ldtstore[LUCODE_SEL] = gdtstore[GUCODE_SEL];
 	ldtstore[LUCODEBIG_SEL] = gdtstore[GUCODEBIG_SEL];
 	ldtstore[LUDATA_SEL] = gdtstore[GUDATA_SEL];
-	ldtstore[LSOL26CALLS_SEL] = ldtstore[LBSDICALLS_SEL] =
-	ldtstore[LSYS5CALLS_SEL];
 
 #ifndef XEN
 	/* exceptions */

Index: src/sys/arch/i386/i386/trap.c
diff -u src/sys/arch/i386/i386/trap.c:1.287 src/sys/arch/i386/i386/trap.c:1.288
--- src/sys/arch/i386/i386/trap.c:1.287	Sat Mar 18 13:39:23 2017
+++ src/sys/arch/i386/i386/trap.c	Sat Jul  1 10:44:42 2017
@@ -1,5 +1,5 @@
 
-/*	$NetBSD: trap.c,v 1.287 2017/03/18 13:39:23 maxv Exp $	*/
+/*	$NetBSD: trap.c,v 1.288 2017/07/01 10:44:42 maxv Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2000, 2005, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -69,7 +69,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.287 2017/03/18 13:39:23 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.288 2017/07/01 10:44:42 maxv Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ 

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

2017-07-01 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Jul  1 09:26:51 UTC 2017

Modified Files:
src/sys/arch/evbarm/conf: std.armadaxp std.awin

Log Message:
Define __HAVE_CPU_UAREA_ALLOC_IDLELWP


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/evbarm/conf/std.armadaxp
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/evbarm/conf/std.awin

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

Modified files:

Index: src/sys/arch/evbarm/conf/std.armadaxp
diff -u src/sys/arch/evbarm/conf/std.armadaxp:1.3 src/sys/arch/evbarm/conf/std.armadaxp:1.4
--- src/sys/arch/evbarm/conf/std.armadaxp:1.3	Sat Mar 29 15:02:00 2014
+++ src/sys/arch/evbarm/conf/std.armadaxp	Sat Jul  1 09:26:51 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: std.armadaxp,v 1.3 2014/03/29 15:02:00 matt Exp $
+#	$NetBSD: std.armadaxp,v 1.4 2017/07/01 09:26:51 skrll Exp $
 #
 # standard NetBSD/evbarm for ARMADAXP options
 
@@ -14,6 +14,7 @@ options 	EXEC_SCRIPT
 options 	ARM32
 options 	__HAVE_FAST_SOFTINTS		# should be in types.h
 options 	__HAVE_PCI_CONF_HOOK		# should be in types.h
+options 	__HAVE_CPU_UAREA_ALLOC_IDLELWP
 
 
 # Build for armv7-a, soft-floats only

Index: src/sys/arch/evbarm/conf/std.awin
diff -u src/sys/arch/evbarm/conf/std.awin:1.9 src/sys/arch/evbarm/conf/std.awin:1.10
--- src/sys/arch/evbarm/conf/std.awin:1.9	Sat Dec 19 13:28:22 2015
+++ src/sys/arch/evbarm/conf/std.awin	Sat Jul  1 09:26:51 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: std.awin,v 1.9 2015/12/19 13:28:22 skrll Exp $
+#	$NetBSD: std.awin,v 1.10 2017/07/01 09:26:51 skrll Exp $
 #
 # standard NetBSD/evbarm for Allwinner based options
 
@@ -12,6 +12,7 @@ include		"arch/evbarm/conf/files.awin"
 options 	MODULAR
 options 	MODULAR_DEFAULT_AUTOLOAD
 options 	__HAVE_CPU_COUNTER
+options 	__HAVE_CPU_UAREA_ALLOC_IDLELWP
 options 	CORTEX_PMC
 options 	__HAVE_FAST_SOFTINTS		# should be in types.h
 options 	ARM_HAS_VBAR



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

2017-07-01 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Jul  1 09:26:51 UTC 2017

Modified Files:
src/sys/arch/evbarm/conf: std.armadaxp std.awin

Log Message:
Define __HAVE_CPU_UAREA_ALLOC_IDLELWP


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/evbarm/conf/std.armadaxp
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/evbarm/conf/std.awin

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-07-01 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Jul  1 09:18:31 UTC 2017

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

Log Message:
Report an error if compiled with MULTIPROCESSOR support but without
__HAVE_CPU_UAREA_ALLOC_IDLELWP


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/sys/arch/arm/arm32/arm32_kvminit.c

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



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

2017-07-01 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Jul  1 09:18:31 UTC 2017

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

Log Message:
Report an error if compiled with MULTIPROCESSOR support but without
__HAVE_CPU_UAREA_ALLOC_IDLELWP


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/sys/arch/arm/arm32/arm32_kvminit.c

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

Modified files:

Index: src/sys/arch/arm/arm32/arm32_kvminit.c
diff -u src/sys/arch/arm/arm32/arm32_kvminit.c:1.38 src/sys/arch/arm/arm32/arm32_kvminit.c:1.39
--- src/sys/arch/arm/arm32/arm32_kvminit.c:1.38	Sat Dec 24 09:19:23 2016
+++ src/sys/arch/arm/arm32/arm32_kvminit.c	Sat Jul  1 09:18:31 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: arm32_kvminit.c,v 1.38 2016/12/24 09:19:23 skrll Exp $	*/
+/*	$NetBSD: arm32_kvminit.c,v 1.39 2017/07/01 09:18:31 skrll Exp $	*/
 
 /*
  * Copyright (c) 2002, 2003, 2005  Genetec Corporation.  All rights reserved.
@@ -124,7 +124,7 @@
 #include "opt_multiprocessor.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: arm32_kvminit.c,v 1.38 2016/12/24 09:19:23 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: arm32_kvminit.c,v 1.39 2017/07/01 09:18:31 skrll Exp $");
 
 #include 
 #include 
@@ -142,6 +142,12 @@ __KERNEL_RCSID(0, "$NetBSD: arm32_kvmini
 #include 
 #include 
 
+#ifdef MULTIPROCESSOR
+#ifndef __HAVE_CPU_UAREA_ALLOC_IDLELWP
+#error __HAVE_CPU_UAREA_ALLOC_IDLELWP required to not waste pages for idlestack
+#endif
+#endif
+
 struct bootmem_info bootmem_info;
 
 extern void *msgbufaddr;



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

2017-07-01 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Jul  1 09:17:44 UTC 2017

Modified Files:
src/sys/arch/evbarm/conf: std.tegra

Log Message:
Define __HAVE_CPU_UAREA_ALLOC_IDLELWP to make use of the idlelwp stacks
created by arm32_kvminit.c


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/evbarm/conf/std.tegra

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



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

2017-07-01 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Jul  1 09:17:44 UTC 2017

Modified Files:
src/sys/arch/evbarm/conf: std.tegra

Log Message:
Define __HAVE_CPU_UAREA_ALLOC_IDLELWP to make use of the idlelwp stacks
created by arm32_kvminit.c


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/evbarm/conf/std.tegra

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

Modified files:

Index: src/sys/arch/evbarm/conf/std.tegra
diff -u src/sys/arch/evbarm/conf/std.tegra:1.13 src/sys/arch/evbarm/conf/std.tegra:1.14
--- src/sys/arch/evbarm/conf/std.tegra:1.13	Tue May 30 22:00:25 2017
+++ src/sys/arch/evbarm/conf/std.tegra	Sat Jul  1 09:17:44 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: std.tegra,v 1.13 2017/05/30 22:00:25 jmcneill Exp $
+#	$NetBSD: std.tegra,v 1.14 2017/07/01 09:17:44 skrll Exp $
 #
 
 machine	evbarm arm
@@ -12,6 +12,7 @@ options 	MODULAR_DEFAULT_AUTOLOAD
 options 	__HAVE_CPU_COUNTER
 options 	__HAVE_FAST_SOFTINTS		# should be in types.h
 options 	ARM_HAS_VBAR
+options 	__HAVE_CPU_UAREA_ALLOC_IDLELWP
 #options 	__HAVE_MM_MD_DIRECT_MAPPED_PHYS
 #options 	PMAP_NEED_ALLOC_POOLPAGE
 options 	TPIDRPRW_IS_CURCPU



CVS commit: [netbsd-8] src/doc

2017-07-01 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Jul  1 08:58:41 UTC 2017

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

Log Message:
tickets 65-67, 72, 73, 75-77


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

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



CVS commit: [netbsd-8] src/doc

2017-07-01 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Jul  1 08:58:41 UTC 2017

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

Log Message:
tickets 65-67, 72, 73, 75-77


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

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

Modified files:

Index: src/doc/CHANGES-8.0
diff -u src/doc/CHANGES-8.0:1.1.2.14 src/doc/CHANGES-8.0:1.1.2.15
--- src/doc/CHANGES-8.0:1.1.2.14	Fri Jun 30 07:00:24 2017
+++ src/doc/CHANGES-8.0	Sat Jul  1 08:58:41 2017
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-8.0,v 1.1.2.14 2017/06/30 07:00:24 snj Exp $
+# $NetBSD: CHANGES-8.0,v 1.1.2.15 2017/07/01 08:58:41 snj Exp $
 
 A complete list of changes from the initial NetBSD 8.0 branch on 2017-06-04
 until the 8.0 release:
@@ -1492,3 +1492,74 @@ sys/dev/mulaw.c	1.31, 1.32
 	Fix big endian bug.
 	[nat, ticket #74]
 
+share/man/man4/tc.41.7
+sys/arch/alpha/tc/tcasic.c			1.46
+sys/arch/pmax/tc/tcbus.c			1.33
+sys/arch/vax/conf/files.vax			1.121
+sys/arch/vax/vsa/tc_vsbus.c			1.8, 1.9
+sys/dev/tc/tc.c	1.55
+sys/dev/tc/tcvar.h1.27
+
+	vax: Add support for VAXstation 4000 TURBOchannel.
+	[flxd, ticket #65]
+
+sys/dev/tc/tc.c	1.56
+
+	Fix missing TC bus speed.
+	[flxd, ticket #66]
+
+sys/dev/sdmmc/ld_sdmmc.c			1.28
+sys/dev/sdmmc/sdmmc_mem.c			1.58-1.60
+sys/dev/sdmmc/sdmmcreg.h			1.30, 1.31
+sys/dev/sdmmc/sdmmcvar.h			1.25-1.27
+
+	- Add discard support to ld@sdmmc using the ERASE (CMD38) command.
+	- Read SD status register and print card status when a new SD card
+	  is found.
+	[jmcneill, ticket #67]
+
+sys/arch/evbarm/conf/BCM5301X			1.27
+sys/arch/evbarm/conf/BCM56340			1.12
+sys/arch/evbarm/conf/BEAGLEBOARDXM		1.24
+sys/arch/evbarm/conf/BEAGLEBONE			1.43
+sys/arch/evbarm/conf/GEMINI			1.34
+sys/arch/evbarm/conf/GEMINI_MASTER		1.34
+sys/arch/evbarm/conf/GEMINI_SLAVE		1.35
+sys/arch/evbarm/conf/GOLDENGATE			1.14
+sys/arch/evbarm/conf/N900			1.24
+sys/arch/evbarm/conf/PANDABOARD			1.22
+
+	Add a heading to describe the class of device axe(4) is.
+	[sevan, ticket #72]
+
+sys/netinet6/ip6_output.c			1.192
+
+	Fix a KASSERT failure due to misusage of ip6_get_membership. 
+	PR kern/52324
+	[ozaki-r, ticket #73]
+
+sys/fs/udf/udf_vfsops.c1.76
+
+	No need to call vflush from failing udf_mount().  If the system
+	nodes really have to disappear we should change vrele() to
+	vrecycle() here.
+	[hannken, ticket #75]
+
+sys/miscfs/specfs/spec_vnops.c			1.174
+
+	Refuse to open a block device with zero open count when it has
+	a mountpoint set.  This may happen after forced detach or unplug
+	of a mounted block device.
+	[hannken, ticket #76]
+
+sys/net/if.c	1.395
+sys/net/if.h	1.240
+sys/netinet/if_arp.c1.253
+
+	Introduce if_get_bylla to find an interface with the active
+	local link address.
+
+	Allow any ARP message we receieved from another interface to
+	be correctly dropped.
+	[roy, ticket #77]
+



CVS commit: [netbsd-8] src/sys

2017-07-01 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Jul  1 08:56:07 UTC 2017

Modified Files:
src/sys/net [netbsd-8]: if.c if.h
src/sys/netinet [netbsd-8]: if_arp.c

Log Message:
Pull up following revision(s) (requested by roy in ticket #77):
sys/net/if.h: revision 1.240
sys/netinet/if_arp.c: revision 1.253
sys/net/if.c: revision 1.395
Introduce if_get_bylla to find an interface with the active
local link address.
--
Use if_get_bylla() instead of just looking at the lla of the interface
the address belongs to.
This allows any ARP message we receieved from another interface to
be correctly dropped.
While here, move the protocol length check higher up the food chain.


To generate a diff of this commit:
cvs rdiff -u -r1.394 -r1.394.2.1 src/sys/net/if.c
cvs rdiff -u -r1.239 -r1.239.2.1 src/sys/net/if.h
cvs rdiff -u -r1.250 -r1.250.2.1 src/sys/netinet/if_arp.c

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



CVS commit: [netbsd-8] src/sys

2017-07-01 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Jul  1 08:56:07 UTC 2017

Modified Files:
src/sys/net [netbsd-8]: if.c if.h
src/sys/netinet [netbsd-8]: if_arp.c

Log Message:
Pull up following revision(s) (requested by roy in ticket #77):
sys/net/if.h: revision 1.240
sys/netinet/if_arp.c: revision 1.253
sys/net/if.c: revision 1.395
Introduce if_get_bylla to find an interface with the active
local link address.
--
Use if_get_bylla() instead of just looking at the lla of the interface
the address belongs to.
This allows any ARP message we receieved from another interface to
be correctly dropped.
While here, move the protocol length check higher up the food chain.


To generate a diff of this commit:
cvs rdiff -u -r1.394 -r1.394.2.1 src/sys/net/if.c
cvs rdiff -u -r1.239 -r1.239.2.1 src/sys/net/if.h
cvs rdiff -u -r1.250 -r1.250.2.1 src/sys/netinet/if_arp.c

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

Modified files:

Index: src/sys/net/if.c
diff -u src/sys/net/if.c:1.394 src/sys/net/if.c:1.394.2.1
--- src/sys/net/if.c:1.394	Thu Jun  1 02:45:14 2017
+++ src/sys/net/if.c	Sat Jul  1 08:56:06 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: if.c,v 1.394 2017/06/01 02:45:14 chs Exp $	*/
+/*	$NetBSD: if.c,v 1.394.2.1 2017/07/01 08:56:06 snj Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2008 The NetBSD Foundation, Inc.
@@ -90,7 +90,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.394 2017/06/01 02:45:14 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.394.2.1 2017/07/01 08:56:06 snj Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_inet.h"
@@ -2599,8 +2599,8 @@ out:
 }
 
 /*
- * Release a reference of an ifnet object given by if_get or
- * if_get_byindex.
+ * Release a reference of an ifnet object given by if_get, if_get_byindex
+ * or if_get_bylla.
  */
 void
 if_put(const struct ifnet *ifp, struct psref *psref)
@@ -2643,6 +2643,29 @@ if_get_byindex(u_int idx, struct psref *
 	return ifp;
 }
 
+ifnet_t *
+if_get_bylla(const void *lla, unsigned char lla_len, struct psref *psref)
+{
+	ifnet_t *ifp;
+	int s;
+
+	s = pserialize_read_enter();
+	IFNET_READER_FOREACH(ifp) {
+		if (if_is_deactivated(ifp))
+			continue;
+		if (ifp->if_addrlen != lla_len)
+			continue;
+		if (memcmp(lla, CLLADDR(ifp->if_sadl), lla_len) == 0) {
+			psref_acquire(psref, >if_psref,
+			ifnet_psref_class);
+			break;
+		}
+	}
+	pserialize_read_exit(s);
+
+	return ifp;
+}
+
 /*
  * Note that it's safe only if the passed ifp is guaranteed to not be freed,
  * for example using pserialize or the ifp is already held or some other

Index: src/sys/net/if.h
diff -u src/sys/net/if.h:1.239 src/sys/net/if.h:1.239.2.1
--- src/sys/net/if.h:1.239	Fri May 19 08:53:51 2017
+++ src/sys/net/if.h	Sat Jul  1 08:56:06 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: if.h,v 1.239 2017/05/19 08:53:51 ozaki-r Exp $	*/
+/*	$NetBSD: if.h,v 1.239.2.1 2017/07/01 08:56:06 snj Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2001 The NetBSD Foundation, Inc.
@@ -974,6 +974,7 @@ struct	ifnet *ifunit(const char *);
 struct	ifnet *if_get(const char *, struct psref *);
 ifnet_t *if_byindex(u_int);
 ifnet_t *if_get_byindex(u_int, struct psref *);
+ifnet_t *if_get_bylla(const void *, unsigned char, struct psref *);
 void	if_put(const struct ifnet *, struct psref *);
 void	if_acquire(struct ifnet *, struct psref *);
 #define	if_release	if_put

Index: src/sys/netinet/if_arp.c
diff -u src/sys/netinet/if_arp.c:1.250 src/sys/netinet/if_arp.c:1.250.2.1
--- src/sys/netinet/if_arp.c:1.250	Thu May 18 06:33:11 2017
+++ src/sys/netinet/if_arp.c	Sat Jul  1 08:56:06 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_arp.c,v 1.250 2017/05/18 06:33:11 ozaki-r Exp $	*/
+/*	$NetBSD: if_arp.c,v 1.250.2.1 2017/07/01 08:56:06 snj Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2000, 2008 The NetBSD Foundation, Inc.
@@ -68,7 +68,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_arp.c,v 1.250 2017/05/18 06:33:11 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_arp.c,v 1.250.2.1 2017/07/01 08:56:06 snj Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ddb.h"
@@ -1020,6 +1020,16 @@ in_arpinput(struct mbuf *m)
 	ah = mtod(m, struct arphdr *);
 	op = ntohs(ah->ar_op);
 
+	if (ah->ar_pln != sizeof(struct in_addr))
+		goto out;
+
+	ifp = if_get_bylla(ar_sha(ah), ah->ar_hln, );
+	if (ifp) {
+		if_put(ifp, );
+		ARP_STATINC(ARP_STAT_RCVLOCALSHA);
+		goto out;	/* it's from me, ignore it. */
+	}
+
 	rcvif = ifp = m_get_rcvif_psref(m, );
 	if (__predict_false(rcvif == NULL))
 		goto drop;
@@ -1041,9 +1051,6 @@ in_arpinput(struct mbuf *m)
 		break;
 	}
 
-	if (ah->ar_pln != sizeof(struct in_addr))
-		goto drop;
-
 	memcpy(, ar_spa(ah), sizeof(isaddr));
 	memcpy(, ar_tpa(ah), sizeof(itaddr));
 
@@ -1130,12 +1137,6 @@ in_arpinput(struct mbuf *m)
 	myaddr = ia->ia_addr.sin_addr;
 
 	/* XXX checks for bridge case? */
-	if (!memcmp(ar_sha(ah), CLLADDR(ifp->if_sadl), ifp->if_addrlen)) {
-		ARP_STATINC(ARP_STAT_RCVLOCALSHA);
-		

CVS commit: [netbsd-8] src/sys/miscfs/specfs

2017-07-01 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Jul  1 08:54:08 UTC 2017

Modified Files:
src/sys/miscfs/specfs [netbsd-8]: spec_vnops.c

Log Message:
Pull up following revision(s) (requested by hannken in ticket #76):
sys/miscfs/specfs/spec_vnops.c: revision 1.174
Refuse to open a block device with zero open count when it has
a mountpoint set.  This may happen after forced detach or unplug
of a mounted block device.


To generate a diff of this commit:
cvs rdiff -u -r1.173 -r1.173.2.1 src/sys/miscfs/specfs/spec_vnops.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/miscfs/specfs/spec_vnops.c
diff -u src/sys/miscfs/specfs/spec_vnops.c:1.173 src/sys/miscfs/specfs/spec_vnops.c:1.173.2.1
--- src/sys/miscfs/specfs/spec_vnops.c:1.173	Thu Jun  1 02:45:14 2017
+++ src/sys/miscfs/specfs/spec_vnops.c	Sat Jul  1 08:54:08 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: spec_vnops.c,v 1.173 2017/06/01 02:45:14 chs Exp $	*/
+/*	$NetBSD: spec_vnops.c,v 1.173.2.1 2017/07/01 08:54:08 snj Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -58,7 +58,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: spec_vnops.c,v 1.173 2017/06/01 02:45:14 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: spec_vnops.c,v 1.173.2.1 2017/07/01 08:54:08 snj Exp $");
 
 #include 
 #include 
@@ -580,13 +580,16 @@ spec_open(void *v)
 		 * For block devices, permit only one open.  The buffer
 		 * cache cannot remain self-consistent with multiple
 		 * vnodes holding a block device open.
+		 *
+		 * Treat zero opencnt with non-NULL mountpoint as open.
+		 * This may happen after forced detach of a mounted device.
 		 */
 		mutex_enter(_lock);
 		if (sn->sn_gone) {
 			mutex_exit(_lock);
 			return (EBADF);
 		}
-		if (sd->sd_opencnt != 0) {
+		if (sd->sd_opencnt != 0 || sd->sd_mountpoint != NULL) {
 			mutex_exit(_lock);
 			return EBUSY;
 		}



CVS commit: [netbsd-8] src/sys/miscfs/specfs

2017-07-01 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Jul  1 08:54:08 UTC 2017

Modified Files:
src/sys/miscfs/specfs [netbsd-8]: spec_vnops.c

Log Message:
Pull up following revision(s) (requested by hannken in ticket #76):
sys/miscfs/specfs/spec_vnops.c: revision 1.174
Refuse to open a block device with zero open count when it has
a mountpoint set.  This may happen after forced detach or unplug
of a mounted block device.


To generate a diff of this commit:
cvs rdiff -u -r1.173 -r1.173.2.1 src/sys/miscfs/specfs/spec_vnops.c

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



CVS commit: [netbsd-8] src/sys/fs/udf

2017-07-01 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Jul  1 08:53:06 UTC 2017

Modified Files:
src/sys/fs/udf [netbsd-8]: udf_vfsops.c

Log Message:
Pull up following revision(s) (requested by hannken in ticket #75):
sys/fs/udf/udf_vfsops.c: revision 1.76
No need to call vflush from failing udf_mount().  If the system nodes
really have to disappear we should change vrele() to vrecycle() here.


To generate a diff of this commit:
cvs rdiff -u -r1.75 -r1.75.6.1 src/sys/fs/udf/udf_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/udf/udf_vfsops.c
diff -u src/sys/fs/udf/udf_vfsops.c:1.75 src/sys/fs/udf/udf_vfsops.c:1.75.6.1
--- src/sys/fs/udf/udf_vfsops.c:1.75	Sat Apr  1 19:35:56 2017
+++ src/sys/fs/udf/udf_vfsops.c	Sat Jul  1 08:53:06 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: udf_vfsops.c,v 1.75 2017/04/01 19:35:56 riastradh Exp $ */
+/* $NetBSD: udf_vfsops.c,v 1.75.6.1 2017/07/01 08:53:06 snj Exp $ */
 
 /*
  * Copyright (c) 2006, 2008 Reinoud Zandijk
@@ -28,7 +28,7 @@
 
 #include 
 #ifndef lint
-__KERNEL_RCSID(0, "$NetBSD: udf_vfsops.c,v 1.75 2017/04/01 19:35:56 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: udf_vfsops.c,v 1.75.6.1 2017/07/01 08:53:06 snj Exp $");
 #endif /* not lint */
 
 
@@ -277,7 +277,6 @@ static void
 udf_release_system_nodes(struct mount *mp)
 {
 	struct udf_mount *ump = VFSTOUDF(mp);
-	int error;
 
 	/* if we haven't even got an ump, dont bother */
 	if (!ump)
@@ -294,10 +293,6 @@ udf_release_system_nodes(struct mount *m
 		vrele(ump->metadatamirror_node->vnode);
 	if (ump->metadatabitmap_node)
 		vrele(ump->metadatabitmap_node->vnode);
-
-	/* This flush should NOT write anything nor allow any node to remain */
-	if ((error = vflush(ump->vfs_mountp, NULLVP, 0)) != 0)
-		panic("Failure to flush UDF system vnodes\n");
 }
 
 
@@ -520,6 +515,10 @@ udf_unmount(struct mount *mp, int mntfla
 	/* NOTE release system nodes should NOT write anything */
 	udf_release_system_nodes(mp);
 
+	/* This flush should NOT write anything nor allow any node to remain */
+	if ((error = vflush(ump->vfs_mountp, NULLVP, 0)) != 0)
+		panic("Failure to flush UDF system vnodes\n");
+
 	/* finalise disc strategy */
 	udf_discstrat_finish(ump);
 



CVS commit: [netbsd-8] src/sys/fs/udf

2017-07-01 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Jul  1 08:53:06 UTC 2017

Modified Files:
src/sys/fs/udf [netbsd-8]: udf_vfsops.c

Log Message:
Pull up following revision(s) (requested by hannken in ticket #75):
sys/fs/udf/udf_vfsops.c: revision 1.76
No need to call vflush from failing udf_mount().  If the system nodes
really have to disappear we should change vrele() to vrecycle() here.


To generate a diff of this commit:
cvs rdiff -u -r1.75 -r1.75.6.1 src/sys/fs/udf/udf_vfsops.c

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



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

2017-07-01 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Jul  1 08:51:04 UTC 2017

Modified Files:
src/sys/netinet6 [netbsd-8]: ip6_output.c

Log Message:
Pull up following revision(s) (requested by ozaki-r in ticket #73):
sys/netinet6/ip6_output.c: revision 1.192
Fix usage of ip6_get_membership
It may set nothing to ifp even if returning 0. So we need to NULL-clear
ifp before calling it.
Fix PR kern/52324


To generate a diff of this commit:
cvs rdiff -u -r1.191 -r1.191.6.1 src/sys/netinet6/ip6_output.c

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

Modified files:

Index: src/sys/netinet6/ip6_output.c
diff -u src/sys/netinet6/ip6_output.c:1.191 src/sys/netinet6/ip6_output.c:1.191.6.1
--- src/sys/netinet6/ip6_output.c:1.191	Fri Mar  3 07:13:06 2017
+++ src/sys/netinet6/ip6_output.c	Sat Jul  1 08:51:04 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: ip6_output.c,v 1.191 2017/03/03 07:13:06 ozaki-r Exp $	*/
+/*	$NetBSD: ip6_output.c,v 1.191.6.1 2017/07/01 08:51:04 snj Exp $	*/
 /*	$KAME: ip6_output.c,v 1.172 2001/03/25 09:55:56 itojun Exp $	*/
 
 /*
@@ -62,7 +62,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ip6_output.c,v 1.191 2017/03/03 07:13:06 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip6_output.c,v 1.191.6.1 2017/07/01 08:51:04 snj Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -2561,8 +2561,10 @@ ip6_setmoptions(const struct sockopt *so
 		 * Group must be a valid IP6 multicast address.
 		 */
 		bound = curlwp_bind();
+		ifp = NULL;
 		error = ip6_get_membership(sopt, , , , sizeof(ia));
 		if (error != 0) {
+			KASSERT(ifp == NULL);
 			curlwp_bindx(bound);
 			return error;
 		}



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

2017-07-01 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Jul  1 08:51:04 UTC 2017

Modified Files:
src/sys/netinet6 [netbsd-8]: ip6_output.c

Log Message:
Pull up following revision(s) (requested by ozaki-r in ticket #73):
sys/netinet6/ip6_output.c: revision 1.192
Fix usage of ip6_get_membership
It may set nothing to ifp even if returning 0. So we need to NULL-clear
ifp before calling it.
Fix PR kern/52324


To generate a diff of this commit:
cvs rdiff -u -r1.191 -r1.191.6.1 src/sys/netinet6/ip6_output.c

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



CVS commit: [netbsd-8] src/sys/arch/evbarm/conf

2017-07-01 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Jul  1 08:49:29 UTC 2017

Modified Files:
src/sys/arch/evbarm/conf [netbsd-8]: BCM5301X BCM56340 BEAGLEBOARDXM
BEAGLEBONE GEMINI GEMINI_MASTER GEMINI_SLAVE GOLDENGATE N900
PANDABOARD

Log Message:
Pull up following revision(s) (requested by sevan in ticket #72):
sys/arch/evbarm/conf/GEMINI_SLAVE: revision 1.35
sys/arch/evbarm/conf/N900: revision 1.24
sys/arch/evbarm/conf/GOLDENGATE: revision 1.14
sys/arch/evbarm/conf/GEMINI_MASTER: revision 1.34
sys/arch/evbarm/conf/BEAGLEBONE: revision 1.43
sys/arch/evbarm/conf/BCM56340: revision 1.12
sys/arch/evbarm/conf/GEMINI: revision 1.34
sys/arch/evbarm/conf/BEAGLEBOARDXM: revision 1.24
sys/arch/evbarm/conf/BCM5301X: revision 1.27
sys/arch/evbarm/conf/PANDABOARD: revision 1.22
Add a heading to describe the class of device axe(4) is.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.26.6.1 src/sys/arch/evbarm/conf/BCM5301X
cvs rdiff -u -r1.11 -r1.11.6.1 src/sys/arch/evbarm/conf/BCM56340
cvs rdiff -u -r1.23 -r1.23.6.1 src/sys/arch/evbarm/conf/BEAGLEBOARDXM \
src/sys/arch/evbarm/conf/N900
cvs rdiff -u -r1.42 -r1.42.2.1 src/sys/arch/evbarm/conf/BEAGLEBONE
cvs rdiff -u -r1.33 -r1.33.6.1 src/sys/arch/evbarm/conf/GEMINI \
src/sys/arch/evbarm/conf/GEMINI_MASTER
cvs rdiff -u -r1.34 -r1.34.6.1 src/sys/arch/evbarm/conf/GEMINI_SLAVE
cvs rdiff -u -r1.13 -r1.13.6.1 src/sys/arch/evbarm/conf/GOLDENGATE
cvs rdiff -u -r1.21 -r1.21.6.1 src/sys/arch/evbarm/conf/PANDABOARD

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

Modified files:

Index: src/sys/arch/evbarm/conf/BCM5301X
diff -u src/sys/arch/evbarm/conf/BCM5301X:1.26 src/sys/arch/evbarm/conf/BCM5301X:1.26.6.1
--- src/sys/arch/evbarm/conf/BCM5301X:1.26	Sun Feb 19 07:47:00 2017
+++ src/sys/arch/evbarm/conf/BCM5301X	Sat Jul  1 08:49:28 2017
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: BCM5301X,v 1.26 2017/02/19 07:47:00 rin Exp $
+#	$NetBSD: BCM5301X,v 1.26.6.1 2017/07/01 08:49:28 snj Exp $
 #
 #	BCM5301X -- Broadcom BCM5301X Eval Board Kernel
 #
@@ -265,6 +265,7 @@ scsibus*	at scsi?
 sd*		at scsibus? target ? lun ?
 #wd*		at umass?
 
+# USB Ethernet adapters
 axe*		at uhub? port ? configuration ? interface ?
 
 # Hardware clocking and power management

Index: src/sys/arch/evbarm/conf/BCM56340
diff -u src/sys/arch/evbarm/conf/BCM56340:1.11 src/sys/arch/evbarm/conf/BCM56340:1.11.6.1
--- src/sys/arch/evbarm/conf/BCM56340:1.11	Sun Feb 19 07:47:00 2017
+++ src/sys/arch/evbarm/conf/BCM56340	Sat Jul  1 08:49:28 2017
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: BCM56340,v 1.11 2017/02/19 07:47:00 rin Exp $
+#	$NetBSD: BCM56340,v 1.11.6.1 2017/07/01 08:49:28 snj Exp $
 #
 #	BCM5301X -- Broadcom BCM5301X Eval Board Kernel
 #
@@ -265,6 +265,7 @@ scsibus*	at scsi?
 sd*		at scsibus? target ? lun ?
 #wd*		at umass?
 
+# USB Ethernet adapters
 axe*		at uhub? port ? configuration ? interface ?
 
 # Hardware clocking and power management

Index: src/sys/arch/evbarm/conf/BEAGLEBOARDXM
diff -u src/sys/arch/evbarm/conf/BEAGLEBOARDXM:1.23 src/sys/arch/evbarm/conf/BEAGLEBOARDXM:1.23.6.1
--- src/sys/arch/evbarm/conf/BEAGLEBOARDXM:1.23	Sun Feb 19 07:47:00 2017
+++ src/sys/arch/evbarm/conf/BEAGLEBOARDXM	Sat Jul  1 08:49:28 2017
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: BEAGLEBOARDXM,v 1.23 2017/02/19 07:47:00 rin Exp $
+#	$NetBSD: BEAGLEBOARDXM,v 1.23.6.1 2017/07/01 08:49:28 snj Exp $
 #
 #	BEAGLEBOARD -- TI OMAP 3530 Eval Board Kernel
 #
@@ -264,6 +264,7 @@ prcm*		at obio1 addr 0x48306000 size 0x2
 #wskbd*		at ukbd?
 #wsmouse*	at ums?
 
+# USB Ethernet adapters
 #axe*		at uhub? port ? configuration ? interface ?
 
 # Hardware clocking and power management
Index: src/sys/arch/evbarm/conf/N900
diff -u src/sys/arch/evbarm/conf/N900:1.23 src/sys/arch/evbarm/conf/N900:1.23.6.1
--- src/sys/arch/evbarm/conf/N900:1.23	Sun Feb 19 07:47:00 2017
+++ src/sys/arch/evbarm/conf/N900	Sat Jul  1 08:49:28 2017
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: N900,v 1.23 2017/02/19 07:47:00 rin Exp $
+#	$NetBSD: N900,v 1.23.6.1 2017/07/01 08:49:28 snj Exp $
 #
 #	N900 -- Nokia N900 Kernel
 #
@@ -312,6 +312,7 @@ prcm*		at obio1 addr 0x48306000 size 0x2
 #wskbd*		at ukbd?
 #wsmouse*	at ums?
 
+# USB Ethernet adapters
 #axe*		at uhub? port ? configuration ? interface ?
 
 # Hardware clocking and power management

Index: src/sys/arch/evbarm/conf/BEAGLEBONE
diff -u src/sys/arch/evbarm/conf/BEAGLEBONE:1.42 src/sys/arch/evbarm/conf/BEAGLEBONE:1.42.2.1
--- src/sys/arch/evbarm/conf/BEAGLEBONE:1.42	Tue May  9 01:57:04 2017
+++ src/sys/arch/evbarm/conf/BEAGLEBONE	Sat Jul  1 08:49:28 2017
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: BEAGLEBONE,v 1.42 2017/05/09 01:57:04 sevan Exp $
+#	$NetBSD: BEAGLEBONE,v 1.42.2.1 2017/07/01 08:49:28 snj Exp $
 #
 #	BEAGLEBONE -- TI AM335x board Kernel
 #
@@ -211,6 +211,7 @@ scsibus*	at scsi?
 # SCSI devices
 sd*		at scsibus? target ? lun ?  # SCSI disk drives
 
+# 

CVS commit: [netbsd-8] src/sys/arch/evbarm/conf

2017-07-01 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Jul  1 08:49:29 UTC 2017

Modified Files:
src/sys/arch/evbarm/conf [netbsd-8]: BCM5301X BCM56340 BEAGLEBOARDXM
BEAGLEBONE GEMINI GEMINI_MASTER GEMINI_SLAVE GOLDENGATE N900
PANDABOARD

Log Message:
Pull up following revision(s) (requested by sevan in ticket #72):
sys/arch/evbarm/conf/GEMINI_SLAVE: revision 1.35
sys/arch/evbarm/conf/N900: revision 1.24
sys/arch/evbarm/conf/GOLDENGATE: revision 1.14
sys/arch/evbarm/conf/GEMINI_MASTER: revision 1.34
sys/arch/evbarm/conf/BEAGLEBONE: revision 1.43
sys/arch/evbarm/conf/BCM56340: revision 1.12
sys/arch/evbarm/conf/GEMINI: revision 1.34
sys/arch/evbarm/conf/BEAGLEBOARDXM: revision 1.24
sys/arch/evbarm/conf/BCM5301X: revision 1.27
sys/arch/evbarm/conf/PANDABOARD: revision 1.22
Add a heading to describe the class of device axe(4) is.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.26.6.1 src/sys/arch/evbarm/conf/BCM5301X
cvs rdiff -u -r1.11 -r1.11.6.1 src/sys/arch/evbarm/conf/BCM56340
cvs rdiff -u -r1.23 -r1.23.6.1 src/sys/arch/evbarm/conf/BEAGLEBOARDXM \
src/sys/arch/evbarm/conf/N900
cvs rdiff -u -r1.42 -r1.42.2.1 src/sys/arch/evbarm/conf/BEAGLEBONE
cvs rdiff -u -r1.33 -r1.33.6.1 src/sys/arch/evbarm/conf/GEMINI \
src/sys/arch/evbarm/conf/GEMINI_MASTER
cvs rdiff -u -r1.34 -r1.34.6.1 src/sys/arch/evbarm/conf/GEMINI_SLAVE
cvs rdiff -u -r1.13 -r1.13.6.1 src/sys/arch/evbarm/conf/GOLDENGATE
cvs rdiff -u -r1.21 -r1.21.6.1 src/sys/arch/evbarm/conf/PANDABOARD

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



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

2017-07-01 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Jul  1 08:45:03 UTC 2017

Modified Files:
src/sys/dev/sdmmc [netbsd-8]: ld_sdmmc.c sdmmc_mem.c sdmmcreg.h
sdmmcvar.h

Log Message:
Pull up following revision(s) (requested by jmcneill in ticket #67):
sys/dev/sdmmc/ld_sdmmc.c: 1.28
sys/dev/sdmmc/sdmmc_mem.c: 1.58-1.60
sys/dev/sdmmc/sdmmcreg.h: 1.30, 1.31
sys/dev/sdmmc/sdmmcvar.h: 1.25-1.27
Add discard support to ld@sdmmc using the ERASE (CMD38) command.
--
Read SD status register and print card status when a new SD card is found:
  sdmmc0: SD card status: 4-bit, C10, U1, V10
If the SD status register reports discard support, set the DISCARD arg to
the ERASE operation to let the card know that the host doesn't care if the
erase is performed.
--
Revert part of previous; the SD card spec recommends not to issue a DISCARD
command to the file system area.


To generate a diff of this commit:
cvs rdiff -u -r1.26.4.1 -r1.26.4.2 src/sys/dev/sdmmc/ld_sdmmc.c
cvs rdiff -u -r1.56.4.1 -r1.56.4.2 src/sys/dev/sdmmc/sdmmc_mem.c
cvs rdiff -u -r1.29 -r1.29.6.1 src/sys/dev/sdmmc/sdmmcreg.h
cvs rdiff -u -r1.23.6.1 -r1.23.6.2 src/sys/dev/sdmmc/sdmmcvar.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/sdmmc/ld_sdmmc.c
diff -u src/sys/dev/sdmmc/ld_sdmmc.c:1.26.4.1 src/sys/dev/sdmmc/ld_sdmmc.c:1.26.4.2
--- src/sys/dev/sdmmc/ld_sdmmc.c:1.26.4.1	Fri Jun  9 16:52:10 2017
+++ src/sys/dev/sdmmc/ld_sdmmc.c	Sat Jul  1 08:45:03 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: ld_sdmmc.c,v 1.26.4.1 2017/06/09 16:52:10 snj Exp $	*/
+/*	$NetBSD: ld_sdmmc.c,v 1.26.4.2 2017/07/01 08:45:03 snj Exp $	*/
 
 /*
  * Copyright (c) 2008 KIYOHARA Takashi
@@ -28,7 +28,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ld_sdmmc.c,v 1.26.4.1 2017/06/09 16:52:10 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ld_sdmmc.c,v 1.26.4.2 2017/07/01 08:45:03 snj Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_sdmmc.h"
@@ -93,6 +93,7 @@ static int ld_sdmmc_detach(device_t, int
 static int ld_sdmmc_dump(struct ld_softc *, void *, int, int);
 static int ld_sdmmc_start(struct ld_softc *, struct buf *);
 static void ld_sdmmc_restart(void *);
+static int ld_sdmmc_discard(struct ld_softc *, off_t, off_t);
 
 static void ld_sdmmc_doattach(void *);
 static void ld_sdmmc_dobio(void *);
@@ -149,6 +150,7 @@ ld_sdmmc_attach(device_t parent, device_
 	ld->sc_maxqueuecnt = LD_SDMMC_MAXQUEUECNT;
 	ld->sc_dump = ld_sdmmc_dump;
 	ld->sc_start = ld_sdmmc_start;
+	ld->sc_discard = ld_sdmmc_discard;
 
 	/*
 	 * It is avoided that the error occurs when the card attaches it,
@@ -297,6 +299,14 @@ ld_sdmmc_dump(struct ld_softc *ld, void 
 	blkcnt * ld->sc_secsize);
 }
 
+static int
+ld_sdmmc_discard(struct ld_softc *ld, off_t pos, off_t len)
+{
+	struct ld_sdmmc_softc *sc = device_private(ld->sc_dv);
+
+	return sdmmc_mem_discard(sc->sc_sf, pos, len);
+}
+
 MODULE(MODULE_CLASS_DRIVER, ld_sdmmc, "ld");
 
 #ifdef _MODULE

Index: src/sys/dev/sdmmc/sdmmc_mem.c
diff -u src/sys/dev/sdmmc/sdmmc_mem.c:1.56.4.1 src/sys/dev/sdmmc/sdmmc_mem.c:1.56.4.2
--- src/sys/dev/sdmmc/sdmmc_mem.c:1.56.4.1	Sun Jun  4 20:45:54 2017
+++ src/sys/dev/sdmmc/sdmmc_mem.c	Sat Jul  1 08:45:03 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: sdmmc_mem.c,v 1.56.4.1 2017/06/04 20:45:54 bouyer Exp $	*/
+/*	$NetBSD: sdmmc_mem.c,v 1.56.4.2 2017/07/01 08:45:03 snj Exp $	*/
 /*	$OpenBSD: sdmmc_mem.c,v 1.10 2009/01/09 10:55:22 jsg Exp $	*/
 
 /*
@@ -45,7 +45,7 @@
 /* Routines for SD/MMC memory cards. */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sdmmc_mem.c,v 1.56.4.1 2017/06/04 20:45:54 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sdmmc_mem.c,v 1.56.4.2 2017/07/01 08:45:03 snj Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_sdmmc.h"
@@ -79,6 +79,10 @@ static int sdmmc_mem_send_csd(struct sdm
 static int sdmmc_mem_send_scr(struct sdmmc_softc *, struct sdmmc_function *,
 uint32_t *scr);
 static int sdmmc_mem_decode_scr(struct sdmmc_softc *, struct sdmmc_function *);
+static int sdmmc_mem_send_ssr(struct sdmmc_softc *, struct sdmmc_function *,
+sdmmc_bitfield512_t *);
+static int sdmmc_mem_decode_ssr(struct sdmmc_softc *, struct sdmmc_function *,
+sdmmc_bitfield512_t *);
 static int sdmmc_mem_send_cxd_data(struct sdmmc_softc *, int, void *, size_t);
 static int sdmmc_set_bus_width(struct sdmmc_function *, int);
 static int sdmmc_mem_sd_switch(struct sdmmc_function *, int, int, int, sdmmc_bitfield512_t *);
@@ -778,7 +782,7 @@ static int
 sdmmc_mem_sd_init(struct sdmmc_softc *sc, struct sdmmc_function *sf)
 {
 	int support_func, best_func, bus_clock, error, i;
-	sdmmc_bitfield512_t status; /* Switch Function Status */
+	sdmmc_bitfield512_t status;
 	bool ddr = false;
 
 	/* change bus clock */
@@ -888,6 +892,15 @@ sdmmc_mem_sd_init(struct sdmmc_softc *sc
 	sc->sc_transfer_mode = switch_group0_functions[best_func].name;
 	sc->sc_busddr = ddr;
 
+	/* get card status */
+	error = 

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

2017-07-01 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Jul  1 08:45:03 UTC 2017

Modified Files:
src/sys/dev/sdmmc [netbsd-8]: ld_sdmmc.c sdmmc_mem.c sdmmcreg.h
sdmmcvar.h

Log Message:
Pull up following revision(s) (requested by jmcneill in ticket #67):
sys/dev/sdmmc/ld_sdmmc.c: 1.28
sys/dev/sdmmc/sdmmc_mem.c: 1.58-1.60
sys/dev/sdmmc/sdmmcreg.h: 1.30, 1.31
sys/dev/sdmmc/sdmmcvar.h: 1.25-1.27
Add discard support to ld@sdmmc using the ERASE (CMD38) command.
--
Read SD status register and print card status when a new SD card is found:
  sdmmc0: SD card status: 4-bit, C10, U1, V10
If the SD status register reports discard support, set the DISCARD arg to
the ERASE operation to let the card know that the host doesn't care if the
erase is performed.
--
Revert part of previous; the SD card spec recommends not to issue a DISCARD
command to the file system area.


To generate a diff of this commit:
cvs rdiff -u -r1.26.4.1 -r1.26.4.2 src/sys/dev/sdmmc/ld_sdmmc.c
cvs rdiff -u -r1.56.4.1 -r1.56.4.2 src/sys/dev/sdmmc/sdmmc_mem.c
cvs rdiff -u -r1.29 -r1.29.6.1 src/sys/dev/sdmmc/sdmmcreg.h
cvs rdiff -u -r1.23.6.1 -r1.23.6.2 src/sys/dev/sdmmc/sdmmcvar.h

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



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

2017-07-01 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Jul  1 08:41:23 UTC 2017

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

Log Message:
Pull up following revision(s) (requested by flxd in ticket #66):
sys/dev/tc/tc.c: revision 1.56
Fix missing TC bus speed.


To generate a diff of this commit:
cvs rdiff -u -r1.54.8.1 -r1.54.8.2 src/sys/dev/tc/tc.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/tc/tc.c
diff -u src/sys/dev/tc/tc.c:1.54.8.1 src/sys/dev/tc/tc.c:1.54.8.2
--- src/sys/dev/tc/tc.c:1.54.8.1	Sat Jul  1 08:39:21 2017
+++ src/sys/dev/tc/tc.c	Sat Jul  1 08:41:23 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: tc.c,v 1.54.8.1 2017/07/01 08:39:21 snj Exp $	*/
+/*	$NetBSD: tc.c,v 1.54.8.2 2017/07/01 08:41:23 snj Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Carnegie-Mellon University.
@@ -28,7 +28,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: tc.c,v 1.54.8.1 2017/07/01 08:39:21 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tc.c,v 1.54.8.2 2017/07/01 08:41:23 snj Exp $");
 
 #include "opt_tcverbose.h"
 
@@ -168,6 +168,7 @@ tcattach(device_t parent, device_t self,
 		ta.ta_offset = 0;
 		ta.ta_addr = tcaddr;
 		ta.ta_cookie = slot->tcs_cookie;
+		ta.ta_busspeed = sc->sc_speed;
 
 		/*
 		 * Mark the slot as used.



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

2017-07-01 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Jul  1 08:41:23 UTC 2017

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

Log Message:
Pull up following revision(s) (requested by flxd in ticket #66):
sys/dev/tc/tc.c: revision 1.56
Fix missing TC bus speed.


To generate a diff of this commit:
cvs rdiff -u -r1.54.8.1 -r1.54.8.2 src/sys/dev/tc/tc.c

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



CVS commit: [netbsd-8] src

2017-07-01 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Jul  1 08:39:22 UTC 2017

Modified Files:
src/share/man/man4 [netbsd-8]: tc.4
src/sys/arch/alpha/tc [netbsd-8]: tcasic.c
src/sys/arch/pmax/tc [netbsd-8]: tcbus.c
src/sys/arch/vax/conf [netbsd-8]: files.vax
src/sys/arch/vax/vsa [netbsd-8]: tc_vsbus.c
src/sys/dev/tc [netbsd-8]: tc.c tcvar.h

Log Message:
Pull up following revision(s) (requested by flxd in ticket #65):
share/man/man4/tc.4: revision 1.7
sys/arch/alpha/tc/tcasic.c: revision 1.46
sys/arch/pmax/tc/tcbus.c: revision 1.33
sys/arch/vax/conf/files.vax: revision 1.121
sys/arch/vax/vsa/tc_vsbus.c: revision 1.8, 1.9
sys/dev/tc/tc.c: revision 1.55
sys/dev/tc/tcvar.h: revision 1.27
Make VAXstation 4000 TURBOchannel adaptor work.
PIO and IRQ tested on VS4000/60 and /96 with TC-USB (slhci) and PMAD-AA (le).
DMA is untested.
vax needs space to be mapped out, so memory space is pre-mapped for TC option
drivers not bus_space'ified yet, also providing custom bus_space methods for
this kludge.
--
whitespace
--
Add vax.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.6.6.1 src/share/man/man4/tc.4
cvs rdiff -u -r1.45 -r1.45.8.1 src/sys/arch/alpha/tc/tcasic.c
cvs rdiff -u -r1.32 -r1.32.8.1 src/sys/arch/pmax/tc/tcbus.c
cvs rdiff -u -r1.120 -r1.120.10.1 src/sys/arch/vax/conf/files.vax
cvs rdiff -u -r1.7 -r1.7.46.1 src/sys/arch/vax/vsa/tc_vsbus.c
cvs rdiff -u -r1.54 -r1.54.8.1 src/sys/dev/tc/tc.c
cvs rdiff -u -r1.26 -r1.26.46.1 src/sys/dev/tc/tcvar.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/tc.4
diff -u src/share/man/man4/tc.4:1.6 src/share/man/man4/tc.4:1.6.6.1
--- src/share/man/man4/tc.4:1.6	Mon Dec 26 16:03:50 2016
+++ src/share/man/man4/tc.4	Sat Jul  1 08:39:21 2017
@@ -1,4 +1,4 @@
-.\" $NetBSD: tc.4,v 1.6 2016/12/26 16:03:50 wiz Exp $
+.\" $NetBSD: tc.4,v 1.6.6.1 2017/07/01 08:39:21 snj Exp $
 .\"
 .\" Copyright (c) 1996, 1997 Jonathan Stone.
 .\" All rights reserved.
@@ -28,7 +28,7 @@
 .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd December 26, 2016
+.Dd June 23, 2017
 .Dt TC 4
 .Os
 .Sh NAME
@@ -39,12 +39,15 @@
 .Cd "tc* at tcasic?"
 .Ss pmax
 .Cd "tc* at mainbus0"
+.Ss vax
+.Cd "tc0 at vsbus0"
 .Sh DESCRIPTION
 The
 .Nm
 driver provides machine-independent support for the DEC TURBOchannel
-expansion bus found on all DEC 5000-series machines with MIPS and DEC
-3000-series with Alpha processors.
+expansion bus found on all DEC 5000-series machines with MIPS, DEC
+3000-series with Alpha processors and VAXstation 4000 machines with the
+optional TURBOchannel adaptor.
 .Pp
 Your system may support additional
 .Tn TURBOchannel

Index: src/sys/arch/alpha/tc/tcasic.c
diff -u src/sys/arch/alpha/tc/tcasic.c:1.45 src/sys/arch/alpha/tc/tcasic.c:1.45.8.1
--- src/sys/arch/alpha/tc/tcasic.c:1.45	Mon Dec 12 17:03:40 2016
+++ src/sys/arch/alpha/tc/tcasic.c	Sat Jul  1 08:39:21 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: tcasic.c,v 1.45 2016/12/12 17:03:40 flxd Exp $ */
+/* $NetBSD: tcasic.c,v 1.45.8.1 2017/07/01 08:39:21 snj Exp $ */
 
 /*
  * Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University.
@@ -32,7 +32,7 @@
 
 #include 			/* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: tcasic.c,v 1.45 2016/12/12 17:03:40 flxd Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tcasic.c,v 1.45.8.1 2017/07/01 08:39:21 snj Exp $");
 
 #include 
 #include 
@@ -222,7 +222,7 @@ tc_fb_cnattach(tc_addr_t tcaddr)
 	char tcname[TC_ROM_LLEN];
 	int i;
 
-	if (tc_badaddr(tcaddr) || (tc_checkslot(tcaddr, tcname) == 0))
+	if (tc_badaddr(tcaddr) || (tc_checkslot(tcaddr, tcname, NULL) == 0))
 		return (EINVAL);
 
 	for (i = 0; i < sizeof(cnboards) / sizeof(cnboards[0]); i++)

Index: src/sys/arch/pmax/tc/tcbus.c
diff -u src/sys/arch/pmax/tc/tcbus.c:1.32 src/sys/arch/pmax/tc/tcbus.c:1.32.8.1
--- src/sys/arch/pmax/tc/tcbus.c:1.32	Mon Dec 12 17:03:41 2016
+++ src/sys/arch/pmax/tc/tcbus.c	Sat Jul  1 08:39:21 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: tcbus.c,v 1.32 2016/12/12 17:03:41 flxd Exp $	*/
+/*	$NetBSD: tcbus.c,v 1.32.8.1 2017/07/01 08:39:21 snj Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: tcbus.c,v 1.32 2016/12/12 17:03:41 flxd Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tcbus.c,v 1.32.8.1 2017/07/01 08:39:21 snj Exp $");
 
 #define	_PMAX_BUS_DMA_PRIVATE
 /*
@@ -221,7 +221,7 @@ tcfb_cnattach(int slotno)
 	int i;
 
 	tcaddr = promcall(callv->_slot_address, slotno);
-	if (tc_badaddr(tcaddr) || tc_checkslot(tcaddr, tcname) == 0)
+	if (tc_badaddr(tcaddr) || tc_checkslot(tcaddr, tcname, NULL) == 0)
 		panic("TC console designated by PROM does not exist!?");
 
 	for (i = 0; i < __arraycount(cnboards); i++) {

Index: 

CVS commit: [netbsd-8] src

2017-07-01 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Jul  1 08:39:22 UTC 2017

Modified Files:
src/share/man/man4 [netbsd-8]: tc.4
src/sys/arch/alpha/tc [netbsd-8]: tcasic.c
src/sys/arch/pmax/tc [netbsd-8]: tcbus.c
src/sys/arch/vax/conf [netbsd-8]: files.vax
src/sys/arch/vax/vsa [netbsd-8]: tc_vsbus.c
src/sys/dev/tc [netbsd-8]: tc.c tcvar.h

Log Message:
Pull up following revision(s) (requested by flxd in ticket #65):
share/man/man4/tc.4: revision 1.7
sys/arch/alpha/tc/tcasic.c: revision 1.46
sys/arch/pmax/tc/tcbus.c: revision 1.33
sys/arch/vax/conf/files.vax: revision 1.121
sys/arch/vax/vsa/tc_vsbus.c: revision 1.8, 1.9
sys/dev/tc/tc.c: revision 1.55
sys/dev/tc/tcvar.h: revision 1.27
Make VAXstation 4000 TURBOchannel adaptor work.
PIO and IRQ tested on VS4000/60 and /96 with TC-USB (slhci) and PMAD-AA (le).
DMA is untested.
vax needs space to be mapped out, so memory space is pre-mapped for TC option
drivers not bus_space'ified yet, also providing custom bus_space methods for
this kludge.
--
whitespace
--
Add vax.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.6.6.1 src/share/man/man4/tc.4
cvs rdiff -u -r1.45 -r1.45.8.1 src/sys/arch/alpha/tc/tcasic.c
cvs rdiff -u -r1.32 -r1.32.8.1 src/sys/arch/pmax/tc/tcbus.c
cvs rdiff -u -r1.120 -r1.120.10.1 src/sys/arch/vax/conf/files.vax
cvs rdiff -u -r1.7 -r1.7.46.1 src/sys/arch/vax/vsa/tc_vsbus.c
cvs rdiff -u -r1.54 -r1.54.8.1 src/sys/dev/tc/tc.c
cvs rdiff -u -r1.26 -r1.26.46.1 src/sys/dev/tc/tcvar.h

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



CVS commit: src/bin/sh

2017-07-01 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Sat Jul  1 06:14:51 UTC 2017

Modified Files:
src/bin/sh: mkoptions.sh

Log Message:
Make $- list flags in the same order they appear in sh(1)


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/bin/sh/mkoptions.sh

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

Modified files:

Index: src/bin/sh/mkoptions.sh
diff -u src/bin/sh/mkoptions.sh:1.3 src/bin/sh/mkoptions.sh:1.4
--- src/bin/sh/mkoptions.sh:1.3	Mon Jun 19 02:43:55 2017
+++ src/bin/sh/mkoptions.sh	Sat Jul  1 06:14:51 2017
@@ -1,6 +1,6 @@
 #! /bin/sh
 
-# $NetBSD: mkoptions.sh,v 1.3 2017/06/19 02:43:55 kre Exp $
+# $NetBSD: mkoptions.sh,v 1.4 2017/07/01 06:14:51 kre Exp $
 
 #
 # It would be more sensible to generate 2 .h files, one which
@@ -158,7 +158,7 @@ do
 
 	printf '%s _SH_OPT_%s %s\n' "${chr}" "${var}" "${COND}"
 
-done 4>>"${OF}" | sort -t' ' -k1,1f -k1,1r | while read chr index COND
+done 4>>"${OF}" | sort -t' ' -k1,1f -k1,1 | while read chr index COND
 do
 	if $FIRST
 	then



CVS commit: src/bin/sh

2017-07-01 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Sat Jul  1 06:14:51 UTC 2017

Modified Files:
src/bin/sh: mkoptions.sh

Log Message:
Make $- list flags in the same order they appear in sh(1)


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/bin/sh/mkoptions.sh

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