CVS commit: src/tests/fs/tmpfs

2016-07-28 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Fri Jul 29 05:23:24 UTC 2016

Modified Files:
src/tests/fs/tmpfs: t_vnd.sh

Log Message:
Update the test - the "official" name of the vnd configuration utility
was changed in NetBSD 7 to vndconfig(8).


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/tests/fs/tmpfs/t_vnd.sh

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

Modified files:

Index: src/tests/fs/tmpfs/t_vnd.sh
diff -u src/tests/fs/tmpfs/t_vnd.sh:1.8 src/tests/fs/tmpfs/t_vnd.sh:1.9
--- src/tests/fs/tmpfs/t_vnd.sh:1.8	Thu Apr 21 22:26:46 2011
+++ src/tests/fs/tmpfs/t_vnd.sh	Fri Jul 29 05:23:24 2016
@@ -1,4 +1,4 @@
-# $NetBSD: t_vnd.sh,v 1.8 2011/04/21 22:26:46 haad Exp $
+# $NetBSD: t_vnd.sh,v 1.9 2016/07/29 05:23:24 pgoyette Exp $
 #
 # Copyright (c) 2006, 2007, 2008 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -38,7 +38,7 @@ basic_body() {
 
 	atf_check -s eq:0 -o ignore -e ignore \
 	dd if=/dev/zero of=disk.img bs=1m count=10
-	atf_check -s eq:0 -o empty -e empty vnconfig /dev/vnd3 disk.img
+	atf_check -s eq:0 -o empty -e empty vndconfig /dev/vnd3 disk.img
 
 	atf_check -s eq:0 -o ignore -e ignore newfs /dev/rvnd3a
 
@@ -58,7 +58,7 @@ basic_body() {
 	done
 
 	atf_check -s eq:0 -o empty -e empty umount mnt
-	atf_check -s eq:0 -o empty -e empty vnconfig -u /dev/vnd3
+	atf_check -s eq:0 -o empty -e empty vndconfig -u /dev/vnd3
 
 	test_unmount
 	touch done
@@ -66,7 +66,7 @@ basic_body() {
 basic_cleanup() {
 	if [ ! -f done ]; then
 		umount mnt 2>/dev/null 1>&2
-		vnconfig -u /dev/vnd3 2>/dev/null 1>&2
+		vndconfig -u /dev/vnd3 2>/dev/null 1>&2
 	fi
 }
 



CVS commit: src/usr.sbin/fssconfig

2016-07-28 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Fri Jul 29 05:20:33 UTC 2016

Modified Files:
src/usr.sbin/fssconfig: fssconfig.8

Log Message:
Improve wording, enhance the example


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/usr.sbin/fssconfig/fssconfig.8

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

Modified files:

Index: src/usr.sbin/fssconfig/fssconfig.8
diff -u src/usr.sbin/fssconfig/fssconfig.8:1.11 src/usr.sbin/fssconfig/fssconfig.8:1.12
--- src/usr.sbin/fssconfig/fssconfig.8:1.11	Fri Nov 15 09:13:57 2013
+++ src/usr.sbin/fssconfig/fssconfig.8	Fri Jul 29 05:20:33 2016
@@ -1,4 +1,4 @@
-.\"	$NetBSD: fssconfig.8,v 1.11 2013/11/15 09:13:57 hannken Exp $	*/
+.\"	$NetBSD: fssconfig.8,v 1.12 2016/07/29 05:20:33 pgoyette Exp $	*/
 .\"
 .\"
 .\" Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -28,7 +28,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd November 15, 2013
+.Dd July 29, 2016
 .Dt FSSCONFIG 8
 .Os
 .Sh NAME
@@ -53,9 +53,11 @@ The
 command configures file system snapshot pseudo disk devices.
 It will associate the file system snapshot disk
 .Ar device
-with a snapshot of
-.Ar path
-allowing the latter to be accessed as though it were a disk.
+with a snapshot of the file system mounted on
+.Ar path ,
+allowing
+.Ar device
+to be accessed as though it were a disk.
 .Pp
 If
 .Ar backup
@@ -65,7 +67,7 @@ This snapshot is active until
 is unlinked.
 Persistent snapshots save the file system as if it had been unmounted.
 Unlinked but open files get removed from the snapshot.
-The time to create a persistent snapshot increases with the size of the
+The time needed to create a persistent snapshot increases with the size of the
 file system and decreases with the file system block size.
 This snapshot mode is only supported for FFS file systems.
 .Pp
@@ -84,9 +86,9 @@ Data is saved to
 in units of
 .Ar cluster
 bytes.
-The snapshot is an image in time of the underlying block device.
+The snapshot is an image of the underlying block device at a moment in time.
 Unlinked but open files are still present on the snapshot.
-The time to create a snapshot is independent of the size of the
+The time needed to create a snapshot is independent of the size of the
 file system or the file system block size.
 .Pp
 Options indicate an action to be performed:
@@ -130,12 +132,14 @@ is assumed.
 .El
 .Sh EXAMPLES
 .Dl fssconfig fss0 /usr /tmp/back
+.Dl mount /dev/fss0 /mnt
 .Pp
 Configures the snapshot device
 .Pa fss0
-for a snapshot of the
+as a snapshot of the
 .Pa /usr
-file system.
+file system, and makes the contents of the snapshot available via
+.Pa /mnt .
 Data written through
 .Pa /usr
 will be backed up in
@@ -145,7 +149,7 @@ will be backed up in
 .Pp
 Configures the snapshot device
 .Pa fss1
-for a snapshot of the
+as a snapshot of the
 .Pa /
 file system.
 Data written through
@@ -162,6 +166,7 @@ device.
 .Sh SEE ALSO
 .Xr opendisk 3 ,
 .Xr fss 4 ,
+.Xr dump 8 ,
 .Xr mount 8 ,
 .Xr umount 8
 .Sh HISTORY



CVS commit: [pgoyette-localcount] src/sys/kern

2016-07-28 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Fri Jul 29 02:28:38 UTC 2016

Modified Files:
src/sys/kern [pgoyette-localcount]: tty_pty.c

Log Message:
Add module initializers in the pmax-specific copies of the [bc]devsw's


To generate a diff of this commit:
cvs rdiff -u -r1.142.2.6 -r1.142.2.7 src/sys/kern/tty_pty.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/tty_pty.c
diff -u src/sys/kern/tty_pty.c:1.142.2.6 src/sys/kern/tty_pty.c:1.142.2.7
--- src/sys/kern/tty_pty.c:1.142.2.6	Fri Jul 29 02:19:52 2016
+++ src/sys/kern/tty_pty.c	Fri Jul 29 02:28:38 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: tty_pty.c,v 1.142.2.6 2016/07/29 02:19:52 pgoyette Exp $	*/
+/*	$NetBSD: tty_pty.c,v 1.142.2.7 2016/07/29 02:28:38 pgoyette Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -37,7 +37,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: tty_pty.c,v 1.142.2.6 2016/07/29 02:19:52 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tty_pty.c,v 1.142.2.7 2016/07/29 02:28:38 pgoyette Exp $");
 
 #include "opt_ptm.h"
 
@@ -151,6 +151,7 @@ const struct cdevsw pts_cdevsw = {
  */
 
 const struct cdevsw ptc_ultrix_cdevsw = {
+	DEVSW_MODULE_INIT
 	.d_open = ptcopen,
 	.d_close = ptcclose,
 	.d_read = ptcread,
@@ -166,6 +167,7 @@ const struct cdevsw ptc_ultrix_cdevsw = 
 };
 
 const struct cdevsw pts_ultrix_cdevsw = {
+	DEVSW_MODULE_INIT
 	.d_open = ptsopen,
 	.d_close = ptsclose,
 	.d_read = ptsread,



CVS commit: [pgoyette-localcount] src/sys/kern

2016-07-28 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Fri Jul 29 02:19:52 UTC 2016

Modified Files:
src/sys/kern [pgoyette-localcount]: tty_pty.c

Log Message:
Add a note to revisit the locking for this device.


To generate a diff of this commit:
cvs rdiff -u -r1.142.2.5 -r1.142.2.6 src/sys/kern/tty_pty.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/tty_pty.c
diff -u src/sys/kern/tty_pty.c:1.142.2.5 src/sys/kern/tty_pty.c:1.142.2.6
--- src/sys/kern/tty_pty.c:1.142.2.5	Fri Jul 29 01:49:39 2016
+++ src/sys/kern/tty_pty.c	Fri Jul 29 02:19:52 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: tty_pty.c,v 1.142.2.5 2016/07/29 01:49:39 pgoyette Exp $	*/
+/*	$NetBSD: tty_pty.c,v 1.142.2.6 2016/07/29 02:19:52 pgoyette Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -37,7 +37,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: tty_pty.c,v 1.142.2.5 2016/07/29 01:49:39 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tty_pty.c,v 1.142.2.6 2016/07/29 02:19:52 pgoyette Exp $");
 
 #include "opt_ptm.h"
 
@@ -1046,6 +1046,12 @@ ptytty(dev_t dev)
 int
 ptyioctl(dev_t dev, u_long cmd, void *data, int flag, struct lwp *l)
 {
+/*
+ * XXX	We really should use device_lookup_acquire(...) to lock the
+ * XXX	device before fetching its softc pointer. Acquiring the
+ * XXX	cdevsw prevents the driver from being detached, but doesn't
+ * XXX	prevent the specific instance/unit from disappearing.
+ */
 	struct pt_softc *pti = pt_softc[minor(dev)];
 	struct tty *tp = pti->pt_tty;
 	const struct cdevsw *cdev;



CVS commit: [pgoyette-localcount] src/sys/kern

2016-07-28 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Fri Jul 29 01:49:39 UTC 2016

Modified Files:
src/sys/kern [pgoyette-localcount]: tty_pty.c

Log Message:
Redo previous, restoring "return xxx;" in each case of the select.  This
gets the exit conditions back the way they were, and allows the atf test
kernel/t_pty to pass.


To generate a diff of this commit:
cvs rdiff -u -r1.142.2.4 -r1.142.2.5 src/sys/kern/tty_pty.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/tty_pty.c
diff -u src/sys/kern/tty_pty.c:1.142.2.4 src/sys/kern/tty_pty.c:1.142.2.5
--- src/sys/kern/tty_pty.c:1.142.2.4	Tue Jul 26 05:54:40 2016
+++ src/sys/kern/tty_pty.c	Fri Jul 29 01:49:39 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: tty_pty.c,v 1.142.2.4 2016/07/26 05:54:40 pgoyette Exp $	*/
+/*	$NetBSD: tty_pty.c,v 1.142.2.5 2016/07/29 01:49:39 pgoyette Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -37,7 +37,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: tty_pty.c,v 1.142.2.4 2016/07/26 05:54:40 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tty_pty.c,v 1.142.2.5 2016/07/29 01:49:39 pgoyette Exp $");
 
 #include "opt_ptm.h"
 
@@ -1093,13 +1093,13 @@ ptyioctl(dev_t dev, u_long cmd, void *da
 
 	cdev = cdevsw_lookup_acquire(dev);
 	if (cdev != NULL && cdev->d_open == ptcopen) {
-		error = 0;
 		switch (cmd) {
 #ifndef NO_DEV_PTM
 		case TIOCGRANTPT:
 			if ((error = pty_getmp(l, )) == 0)
 error = pty_grant_slave(l, dev, mp);
-			break;
+			cdevsw_release(cdev);
+			return error;
 #endif
 
 		case TIOCGPGRP:
@@ -1108,7 +1108,8 @@ ptyioctl(dev_t dev, u_long cmd, void *da
 			 * in that case, tp must be the controlling terminal.
 			 */
 			*(int *)data = tp->t_pgrp ? tp->t_pgrp->pg_id : 0;
-			break;
+			cdevsw_release(cdev);
+			return 0;
 
 		case TIOCPKT:
 			if (*(int *)data) {
@@ -1117,7 +1118,8 @@ ptyioctl(dev_t dev, u_long cmd, void *da
 pti->pt_flags |= PF_PKT;
 			} else
 pti->pt_flags &= ~PF_PKT;
-			break;
+			cdevsw_release(cdev);
+			return 0;
 
 		case TIOCUCNTL:
 			if (*(int *)data) {
@@ -1126,7 +1128,8 @@ ptyioctl(dev_t dev, u_long cmd, void *da
 pti->pt_flags |= PF_UCNTL;
 			} else
 pti->pt_flags &= ~PF_UCNTL;
-			break;
+			cdevsw_release(cdev);
+			return 0;
 
 		case TIOCREMOTE:
 			if (*(int *)data)
@@ -1136,7 +1139,8 @@ ptyioctl(dev_t dev, u_long cmd, void *da
 			mutex_spin_enter(_lock);
 			ttyflush(tp, FREAD|FWRITE);
 			mutex_spin_exit(_lock);
-			break;
+			cdevsw_release(cdev);
+			return 0;
 
 		case TIOCSETP:
 		case TIOCSETN:
@@ -1147,7 +1151,6 @@ ptyioctl(dev_t dev, u_long cmd, void *da
 			mutex_spin_enter(_lock);
 			ndflush(>t_outq, tp->t_outq.c_cc);
 			mutex_spin_exit(_lock);
-			error = -1;
 			break;
 
 		case TIOCSIG:
@@ -1160,17 +1163,16 @@ ptyioctl(dev_t dev, u_long cmd, void *da
 			tp->t_state |= TS_SIGINFO;
 			ttysig(tp, TTYSIG_PG1, sig);
 			mutex_spin_exit(_lock);
-			break;
+			error = 0;
+			cdevsw_release(cdev);
+			return 0;
 
 		case FIONREAD:
 			mutex_spin_enter(_lock);
 			*(int *)data = tp->t_outq.c_cc;
 			mutex_spin_exit(_lock);
-			break;
-		}
-		if (error >= 0 ) {
 			cdevsw_release(cdev);
-			return error;
+			return 0;
 		}
 	}
 	error = (*tp->t_linesw->l_ioctl)(tp, cmd, data, flag, l);



CVS commit: [pgoyette-localcount] src/sys/dev

2016-07-28 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Thu Jul 28 23:59:15 UTC 2016

Modified Files:
src/sys/dev [pgoyette-localcount]: md.c

Log Message:
Since md(4) has a pointer from the softc back to the device_t, it is
OK for us to use device_lookup_private_acquire() rather than calling
device_lookup_acquire() followed by device_private().

So, redo earlier changes, which reduces diff to the original code at
the branch-point.


To generate a diff of this commit:
cvs rdiff -u -r1.76.2.5 -r1.76.2.6 src/sys/dev/md.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/md.c
diff -u src/sys/dev/md.c:1.76.2.5 src/sys/dev/md.c:1.76.2.6
--- src/sys/dev/md.c:1.76.2.5	Wed Jul 27 03:25:00 2016
+++ src/sys/dev/md.c	Thu Jul 28 23:59:15 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: md.c,v 1.76.2.5 2016/07/27 03:25:00 pgoyette Exp $	*/
+/*	$NetBSD: md.c,v 1.76.2.6 2016/07/28 23:59:15 pgoyette Exp $	*/
 
 /*
  * Copyright (c) 1995 Gordon W. Ross, Leo Weppelman.
@@ -40,7 +40,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: md.c,v 1.76.2.5 2016/07/27 03:25:00 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: md.c,v 1.76.2.6 2016/07/28 23:59:15 pgoyette Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_md.h"
@@ -243,14 +243,12 @@ static int	md_ioctl_kalloc(struct md_sof
 static int
 mdsize(dev_t dev)
 {
-	device_t self;
 	struct md_softc *sc;
 	int res;
 
-	self = device_lookup_acquire(_cd, MD_UNIT(dev));
-	if (self == NULL)
+	sc = device_lookup_private_acquire(_cd, MD_UNIT(dev));
+	if (sc == NULL)
 		return 0;
-	sc = device_private(self);
 
 	mutex_enter(>sc_lock);
 	if (sc->sc_type == MD_UNCONFIGURED)
@@ -259,14 +257,14 @@ mdsize(dev_t dev)
 		res = sc->sc_size >> DEV_BSHIFT;
 	mutex_exit(>sc_lock);
 
-	device_release(self);
+	device_release(sc->sc_dev);
 	return res;
 }
 
 static int
 mdopen(dev_t dev, int flag, int fmt, struct lwp *l)
 {
-	device_t self;
+	device_t self, new_self;
 	int unit;
 	int part = DISKPART(dev);
 	int pmask = 1 << part;
@@ -279,9 +277,8 @@ mdopen(dev_t dev, int flag, int fmt, str
 
 	mutex_enter(_device_lock);
 	unit = MD_UNIT(dev);
-	sc = NULL;
-	self = device_lookup_acquire(_cd, unit);
-	if (self == NULL) {
+	sc = device_lookup_private_acquire(_cd, unit);
+	if (sc == NULL) {
 		if (part != RAW_PART) {
 			mutex_exit(_device_lock);
 			return ENXIO;
@@ -291,19 +288,16 @@ mdopen(dev_t dev, int flag, int fmt, str
 		cf->cf_atname = md_cd.cd_name;
 		cf->cf_unit = unit;
 		cf->cf_fstate = FSTATE_STAR;
-		self = config_attach_pseudo(cf);
-		if (self != NULL) {
-			device_acquire(self);
-			sc = device_private(self);
-		}
+		new_self = config_attach_pseudo(cf);
+		self = device_lookup_acquire(_cd, unit);
+		KASSERT(self == new_self);
+		sc = device_private(self);
 		if (sc == NULL) {
 			mutex_exit(_device_lock);
-			device_release(self);
+			device_release(sc->sc_dev);
 			return ENOMEM;
 		}
 	}
-	else
-		sc = device_private(self);
 
 	dk = >sc_dkdev;
 
@@ -328,11 +322,11 @@ mdopen(dev_t dev, int flag, int fmt, str
 	 */
 	if (sc->sc_type == MD_UNCONFIGURED) {
 		mutex_exit(_device_lock);
-		device_release(self);
+		device_release(sc->sc_dev);
 		return ENXIO;
 	}
 
-ok:
+ ok:
 	/* XXX duplicates code in dk_open().  Call dk_open(), instead? */
 	mutex_enter(>dk_openlock);
 	/* Mark our unit as open. */
@@ -349,14 +343,13 @@ ok:
 
 	mutex_exit(>dk_openlock);
 	mutex_exit(_device_lock);
-	device_release(self);
+	device_release(sc->sc_dev);
 	return 0;
 }
 
 static int
 mdclose(dev_t dev, int flag, int fmt, struct lwp *l)
 {
-	device_t self;
 	int part = DISKPART(dev);
 	int pmask = 1 << part;
 	int error;
@@ -364,10 +357,9 @@ mdclose(dev_t dev, int flag, int fmt, st
 	struct md_softc *sc;
 	struct disk *dk;
 
-	self = device_lookup_acquire(_cd, MD_UNIT(dev));
-	if (self == NULL)
+	sc = device_lookup_private_acquire(_cd, MD_UNIT(dev));
+	if (sc == NULL)
 		return ENXIO;
-	sc = device_private(self);
 
 	dk = >sc_dkdev;
 
@@ -384,7 +376,7 @@ mdclose(dev_t dev, int flag, int fmt, st
 	dk->dk_openmask = dk->dk_copenmask | dk->dk_bopenmask;
 	if (dk->dk_openmask != 0) {
 		mutex_exit(>dk_openlock);
-		device_release(self);
+		device_release(sc->sc_dev);
 		return 0;
 	}
 
@@ -396,52 +388,48 @@ mdclose(dev_t dev, int flag, int fmt, st
 	if (! error)
 		free(cf, M_DEVBUF);
 	mutex_exit(_device_lock);
-	device_release(self);
+	if (error)
+		device_release(sc->sc_dev);
 	return error;
 }
 
 static int
 mdread(dev_t dev, struct uio *uio, int flags)
 {
-	device_t self;
 	struct md_softc *sc;
 	int error;
 
-	self = device_lookup_acquire(_cd, MD_UNIT(dev));
-	if (self == NULL)
-		return ENXIO;
+	sc = device_lookup_private_acquire(_cd, MD_UNIT(dev));
 
-	sc = device_private(self);
 	if (sc == NULL || sc->sc_type == MD_UNCONFIGURED) {
-		device_release(self);
+		if (sc != NULL)
+			device_release(sc->sc_dev);
 		return ENXIO;
 	}
 
 	error = (physio(mdstrategy, NULL, dev, B_READ, minphys, uio));
-	

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

2016-07-28 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Thu Jul 28 22:46:48 UTC 2016

Modified Files:
src/sys/arch/evbppc/conf: Makefile.ev64260.inc Makefile.obs405.inc
Makefile.walnut.inc

Log Message:
Fix typo in Makefile which resulted in kernel image not being generated

>From Rin Okuyama in PR/51369


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/evbppc/conf/Makefile.ev64260.inc
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/evbppc/conf/Makefile.obs405.inc
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/evbppc/conf/Makefile.walnut.inc

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/evbppc/conf/Makefile.ev64260.inc
diff -u src/sys/arch/evbppc/conf/Makefile.ev64260.inc:1.7 src/sys/arch/evbppc/conf/Makefile.ev64260.inc:1.8
--- src/sys/arch/evbppc/conf/Makefile.ev64260.inc:1.7	Mon Mar  3 19:08:46 2014
+++ src/sys/arch/evbppc/conf/Makefile.ev64260.inc	Thu Jul 28 22:46:48 2016
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.ev64260.inc,v 1.7 2014/03/03 19:08:46 joerg Exp $
+#	$NetBSD: Makefile.ev64260.inc,v 1.8 2016/07/28 22:46:48 maya Exp $
 
 MKIMG?=	${HOST_SH} ${THISPPC}/compile/walnut-mkimg.sh
 
@@ -9,5 +9,5 @@ SYSTEM_FIRST_SFILE=	${THISPPC}/${BOARDTY
 
 SYSTEM_LD_TAIL_EXTRA+=; \
 	echo ${MKIMG} $@ $@.img ; \
-	OBJDUMP=${OBJDUMP}; OBJCOPY=${OBJCOPY}; STAT=${TOOL_STAT]; \
+	OBJDUMP=${OBJDUMP}; OBJCOPY=${OBJCOPY}; STAT=${TOOL_STAT}; \
 		export OBJDUMP OBJCOPY STAT; ${MKIMG} $@ $@.img

Index: src/sys/arch/evbppc/conf/Makefile.obs405.inc
diff -u src/sys/arch/evbppc/conf/Makefile.obs405.inc:1.12 src/sys/arch/evbppc/conf/Makefile.obs405.inc:1.13
--- src/sys/arch/evbppc/conf/Makefile.obs405.inc:1.12	Tue Aug  5 15:40:59 2014
+++ src/sys/arch/evbppc/conf/Makefile.obs405.inc	Thu Jul 28 22:46:48 2016
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.obs405.inc,v 1.12 2014/08/05 15:40:59 apb Exp $
+#	$NetBSD: Makefile.obs405.inc,v 1.13 2016/07/28 22:46:48 maya Exp $
 
 CFLAGS+=-mcpu=405
 AFLAGS+=-mcpu=405
@@ -15,7 +15,7 @@ SYSTEM_FIRST_SFILE=	${THISPPC}/obs405/ob
 
 SYSTEM_LD_TAIL_EXTRA+=; \
 	echo ${MKIMG} $@ $@.img ; \
-	OBJDUMP=${OBJDUMP}; OBJCOPY=${OBJCOPY}; STAT=${TOOL_STAT]; \
+	OBJDUMP=${OBJDUMP}; OBJCOPY=${OBJCOPY}; STAT=${TOOL_STAT}; \
 		export OBJDUMP OBJCOPY STAT; ${MKIMG} $@ $@.img
 
 
@@ -30,7 +30,7 @@ SYSTEM_FIRST_SFILE=	${POWERPC}/${PPCDIR}
 
 SYSTEM_LD_TAIL_EXTRA+=; \
 	echo ${MKIMG} $@ $@.img ; \
-	OBJDUMP=${OBJDUMP}; OBJCOPY=${OBJCOPY}; STAT=${TOOL_STAT]; \
+	OBJDUMP=${OBJDUMP}; OBJCOPY=${OBJCOPY}; STAT=${TOOL_STAT}; \
 		export OBJDUMP OBJCOPY STAT; ${MKIMG} $@ $@.img
 
 

Index: src/sys/arch/evbppc/conf/Makefile.walnut.inc
diff -u src/sys/arch/evbppc/conf/Makefile.walnut.inc:1.8 src/sys/arch/evbppc/conf/Makefile.walnut.inc:1.9
--- src/sys/arch/evbppc/conf/Makefile.walnut.inc:1.8	Mon Mar  3 19:08:46 2014
+++ src/sys/arch/evbppc/conf/Makefile.walnut.inc	Thu Jul 28 22:46:48 2016
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.walnut.inc,v 1.8 2014/03/03 19:08:46 joerg Exp $
+#	$NetBSD: Makefile.walnut.inc,v 1.9 2016/07/28 22:46:48 maya Exp $
 
 MKIMG?=	${HOST_SH} ${THISPPC}/compile/walnut-mkimg.sh
 CFLAGS+=-mcpu=403
@@ -10,5 +10,5 @@ SYSTEM_FIRST_SFILE=	${THISPPC}/walnut/wa
 
 SYSTEM_LD_TAIL_EXTRA_EXTRA+=; \
 	echo ${MKIMG} $@ $@.img ; \
-	OBJDUMP=${OBJDUMP}; OBJCOPY=${OBJCOPY}; STAT=${TOOL_STAT]; \
+	OBJDUMP=${OBJDUMP}; OBJCOPY=${OBJCOPY}; STAT=${TOOL_STAT}; \
 		export OBJDUMP OBJCOPY STAT; ${MKIMG} $@ $@.img



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

2016-07-28 Thread Takeshi Nakayama
Module Name:src
Committed By:   nakayama
Date:   Thu Jul 28 19:24:08 UTC 2016

Modified Files:
src/distrib/sets/lists/base: mi

Log Message:
Resurrect Asia/Tomsk, split off from Asia/Novosibirsk in tzdata2016d.


To generate a diff of this commit:
cvs rdiff -u -r1.1131 -r1.1132 src/distrib/sets/lists/base/mi

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

Modified files:

Index: src/distrib/sets/lists/base/mi
diff -u src/distrib/sets/lists/base/mi:1.1131 src/distrib/sets/lists/base/mi:1.1132
--- src/distrib/sets/lists/base/mi:1.1131	Fri Jul  1 22:52:06 2016
+++ src/distrib/sets/lists/base/mi	Thu Jul 28 19:24:08 2016
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1131 2016/07/01 22:52:06 christos Exp $
+# $NetBSD: mi,v 1.1132 2016/07/28 19:24:08 nakayama Exp $
 #
 # Note:	Don't delete entries from here - mark them as "obsolete" instead,
 #	unless otherwise stated below.
@@ -5520,7 +5520,7 @@
 ./usr/share/zoneinfo/Asia/Thimbu		base-sys-share		share
 ./usr/share/zoneinfo/Asia/Thimphu		base-sys-share		share
 ./usr/share/zoneinfo/Asia/Tokyo			base-sys-share		share
-./usr/share/zoneinfo/Asia/Tomsk			base-obsolete		obsolete
+./usr/share/zoneinfo/Asia/Tomsk			base-sys-share		share
 ./usr/share/zoneinfo/Asia/Ujung_Pandang		base-sys-share		share
 ./usr/share/zoneinfo/Asia/Ulaanbaatar		base-sys-share		share
 ./usr/share/zoneinfo/Asia/Ulan_Bator		base-sys-share		share



CVS commit: src/external/gpl3/binutils

2016-07-28 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Jul 28 12:25:25 UTC 2016

Modified Files:
src/external/gpl3/binutils/lib/libbfd/arch/x86_64: bfd_stdint.h
bfdver.h config.h
src/external/gpl3/binutils/lib/libopcodes/arch/x86_64: config.h
src/external/gpl3/binutils/usr.bin/common/arch/x86_64: config.h defs.mk
src/external/gpl3/binutils/usr.bin/gas/arch/x86_64: config.h
src/external/gpl3/binutils/usr.bin/gprof/arch/x86_64: gconfig.h
src/external/gpl3/binutils/usr.bin/ld/arch/x86_64: config.h

Log Message:
regen amd64.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 \
src/external/gpl3/binutils/lib/libbfd/arch/x86_64/bfd_stdint.h \
src/external/gpl3/binutils/lib/libbfd/arch/x86_64/config.h
cvs rdiff -u -r1.8 -r1.9 \
src/external/gpl3/binutils/lib/libbfd/arch/x86_64/bfdver.h
cvs rdiff -u -r1.4 -r1.5 \
src/external/gpl3/binutils/lib/libopcodes/arch/x86_64/config.h
cvs rdiff -u -r1.4 -r1.5 \
src/external/gpl3/binutils/usr.bin/common/arch/x86_64/config.h
cvs rdiff -u -r1.6 -r1.7 \
src/external/gpl3/binutils/usr.bin/common/arch/x86_64/defs.mk
cvs rdiff -u -r1.4 -r1.5 \
src/external/gpl3/binutils/usr.bin/gas/arch/x86_64/config.h
cvs rdiff -u -r1.4 -r1.5 \
src/external/gpl3/binutils/usr.bin/gprof/arch/x86_64/gconfig.h
cvs rdiff -u -r1.4 -r1.5 \
src/external/gpl3/binutils/usr.bin/ld/arch/x86_64/config.h

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

Modified files:

Index: src/external/gpl3/binutils/lib/libbfd/arch/x86_64/bfd_stdint.h
diff -u src/external/gpl3/binutils/lib/libbfd/arch/x86_64/bfd_stdint.h:1.4 src/external/gpl3/binutils/lib/libbfd/arch/x86_64/bfd_stdint.h:1.5
--- src/external/gpl3/binutils/lib/libbfd/arch/x86_64/bfd_stdint.h:1.4	Fri Jan 29 09:42:48 2016
+++ src/external/gpl3/binutils/lib/libbfd/arch/x86_64/bfd_stdint.h	Thu Jul 28 08:25:24 2016
@@ -2,7 +2,7 @@
 /* Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp  */
 /* Generated from: NetBSD: mknative.common,v 1.11 2014/02/17 21:39:43 christos Exp  */
 
-/* generated for  x86_64--netbsd-gcc (NetBSD nb3 20151015) 4.8.5 */
+/* generated for  x86_64--netbsd-gcc (NetBSD nb1 20160606) 5.4.0 */
 
 #ifndef GCC_GENERATED_STDINT_H
 #define GCC_GENERATED_STDINT_H 1
Index: src/external/gpl3/binutils/lib/libbfd/arch/x86_64/config.h
diff -u src/external/gpl3/binutils/lib/libbfd/arch/x86_64/config.h:1.4 src/external/gpl3/binutils/lib/libbfd/arch/x86_64/config.h:1.5
--- src/external/gpl3/binutils/lib/libbfd/arch/x86_64/config.h:1.4	Fri Jan 29 09:42:48 2016
+++ src/external/gpl3/binutils/lib/libbfd/arch/x86_64/config.h	Thu Jul 28 08:25:24 2016
@@ -298,7 +298,7 @@
 #define PACKAGE_NAME "bfd"
 
 /* Define to the full name and version of this package. */
-#define PACKAGE_STRING "bfd 2.26"
+#define PACKAGE_STRING "bfd 2.26.1"
 
 /* Define to the one symbol short name of this package. */
 #define PACKAGE_TARNAME "bfd"
@@ -307,7 +307,7 @@
 #define PACKAGE_URL ""
 
 /* Define to the version of this package. */
-#define PACKAGE_VERSION "2.26"
+#define PACKAGE_VERSION "2.26.1"
 
 /* The size of `char', as computed by sizeof. */
 /* #undef SIZEOF_CHAR */
@@ -352,7 +352,7 @@
 /* #undef USE_MMAP */
 
 /* Define if we should default to creating read-only plt entries */
-#define USE_SECUREPLT 1
+/* #undef USE_SECUREPLT */
 
 /* Define if we may generate symbols with ELF's STT_COMMON type */
 /* #undef USE_STT_COMMON */
@@ -380,7 +380,7 @@
 
 
 /* Version number of package */
-#define VERSION "2.26"
+#define VERSION "2.26.1"
 
 /* Number of bits in a file offset, on hosts where this is settable. */
 /* #undef _FILE_OFFSET_BITS */

Index: src/external/gpl3/binutils/lib/libbfd/arch/x86_64/bfdver.h
diff -u src/external/gpl3/binutils/lib/libbfd/arch/x86_64/bfdver.h:1.8 src/external/gpl3/binutils/lib/libbfd/arch/x86_64/bfdver.h:1.9
--- src/external/gpl3/binutils/lib/libbfd/arch/x86_64/bfdver.h:1.8	Fri Jan 29 09:42:48 2016
+++ src/external/gpl3/binutils/lib/libbfd/arch/x86_64/bfdver.h	Thu Jul 28 08:25:24 2016
@@ -2,7 +2,7 @@
 /* Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp  */
 /* Generated from: NetBSD: mknative.common,v 1.11 2014/02/17 21:39:43 christos Exp  */
 
-#define BFD_VERSION_DATE 20160125
-#define BFD_VERSION 22600
-#define BFD_VERSION_STRING  "(NetBSD Binutils nb1) " "2.26.20160125"
+#define BFD_VERSION_DATE 20160629
+#define BFD_VERSION 22601
+#define BFD_VERSION_STRING  "(NetBSD Binutils nb1) " "2.26.1"
 #define REPORT_BUGS_TO ""

Index: src/external/gpl3/binutils/lib/libopcodes/arch/x86_64/config.h
diff -u src/external/gpl3/binutils/lib/libopcodes/arch/x86_64/config.h:1.4 src/external/gpl3/binutils/lib/libopcodes/arch/x86_64/config.h:1.5
--- src/external/gpl3/binutils/lib/libopcodes/arch/x86_64/config.h:1.4	Fri Jan 29 09:42:48 2016
+++ 

CVS commit: src/doc

2016-07-28 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Jul 28 09:13:06 UTC 2016

Modified Files:
src/doc: CHANGES

Log Message:
Note sdtemp(4)'s JEDEC TSE2004av support.


To generate a diff of this commit:
cvs rdiff -u -r1.2176 -r1.2177 src/doc/CHANGES

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
diff -u src/doc/CHANGES:1.2176 src/doc/CHANGES:1.2177
--- src/doc/CHANGES:1.2176	Tue Jul 26 07:36:54 2016
+++ src/doc/CHANGES	Thu Jul 28 09:13:06 2016
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2176 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2177 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -335,3 +335,4 @@ Changes from NetBSD 7.0 to NetBSD 8.0:
 		GT30TS00, GT34TS02, Microchip MCP9804, MCP98244, IDT
 		TS3000GB[02], TS3001GB2, TSE200[24]GB2 and On Semiconductor
 		CAT34TS04. [msaitoh 20160726]
+	sdtemp(4): Add JEDEC TSE2004av support. [msaitoh 20160728]



CVS commit: src

2016-07-28 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Jul 28 09:11:14 UTC 2016

Modified Files:
src/share/man/man4: sdtemp.4
src/sys/dev/i2c: sdtemp.c sdtemp_reg.h

Log Message:
 Add JEDEC TSE2004av support. OK'ed by pgoyette. If a device conforms
TES2004av, it can be used without adding new entry into the matching
table.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/share/man/man4/sdtemp.4
cvs rdiff -u -r1.30 -r1.31 src/sys/dev/i2c/sdtemp.c
cvs rdiff -u -r1.9 -r1.10 src/sys/dev/i2c/sdtemp_reg.h

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

Modified files:

Index: src/share/man/man4/sdtemp.4
diff -u src/share/man/man4/sdtemp.4:1.5 src/share/man/man4/sdtemp.4:1.6
--- src/share/man/man4/sdtemp.4:1.5	Tue Jul 26 07:33:30 2016
+++ src/share/man/man4/sdtemp.4	Thu Jul 28 09:11:14 2016
@@ -1,4 +1,4 @@
-.\"	$NetBSD: sdtemp.4,v 1.5 2016/07/26 07:33:30 msaitoh Exp $
+.\"	$NetBSD: sdtemp.4,v 1.6 2016/07/28 09:11:14 msaitoh Exp $
 .\"
 .\" Copyright (c) 2008 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -27,7 +27,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd July 26, 2016
+.Dd July 28, 2016
 .Dt SDTEMP 4
 .Os
 .Sh NAME
@@ -61,7 +61,7 @@ supports temperature ranges from -256 to
 .Pp
 Chips supported by the
 .Nm
-driver include:
+driver include TSE2004av compliant devices and:
 .Pp
 .Bl -bullet -offset indent
 .It

Index: src/sys/dev/i2c/sdtemp.c
diff -u src/sys/dev/i2c/sdtemp.c:1.30 src/sys/dev/i2c/sdtemp.c:1.31
--- src/sys/dev/i2c/sdtemp.c:1.30	Wed Jul 27 09:11:44 2016
+++ src/sys/dev/i2c/sdtemp.c	Thu Jul 28 09:11:13 2016
@@ -1,4 +1,4 @@
-/*  $NetBSD: sdtemp.c,v 1.30 2016/07/27 09:11:44 msaitoh Exp $*/
+/*  $NetBSD: sdtemp.c,v 1.31 2016/07/28 09:11:13 msaitoh Exp $*/
 
 /*
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sdtemp.c,v 1.30 2016/07/27 09:11:44 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sdtemp.c,v 1.31 2016/07/28 09:11:13 msaitoh Exp $");
 
 #include 
 #include 
@@ -159,6 +159,12 @@ sdtemp_dev_table[] = {
 	"Integrated Device Technology TS3000GB2" },
 { IDT_MANUFACTURER_ID,  IDT_TS3001GB2_DEVICE_ID, IDT_TS3001GB2_MASK,  CIDT,
 	"Integrated Device Technology TS3001GB2" },
+/*
+ * Don't change the location of the following two entries. Device specific
+ * entry must be located at above.
+ */
+{ 0,		TSE2004AV_ID,	 TSE2004AV_MASK,	  NULL,
+	"TSE2004av compliant device (generic driver)" },
 { 0, 0, 0, NULL, "Unknown" }
 };
 
@@ -184,6 +190,10 @@ sdtemp_lookup(uint16_t mfg, uint16_t dev
 		sdtemp_dev_table[i].sdtemp_devrev)
 			break;
 	}
+	/* Check TSE2004av */
+	if ((sdtemp_dev_table[i].sdtemp_mfg_id == 0)
+	&& (SDTEMP_IS_TSE2004AV(devrev) == 0))
+			i++; /* Unknown */
 
 	return i;
 }
@@ -192,7 +202,7 @@ static int
 sdtemp_match(device_t parent, cfdata_t cf, void *aux)
 {
 	struct i2c_attach_args *ia = aux;
-	uint16_t mfgid, devid;
+	uint16_t mfgid, devid, cap;
 	struct sdtemp_softc sc;
 	int i, error;
 
@@ -202,23 +212,32 @@ sdtemp_match(device_t parent, cfdata_t c
 	if ((ia->ia_addr & SDTEMP_ADDRMASK) != SDTEMP_ADDR)
 		return 0;
 
-	/* Verify that we can read the manufacturer ID  & Device ID */
+	/* Verify that we can read the manufacturer ID, Device ID and the capability */
 	iic_acquire_bus(sc.sc_tag, 0);
 	error = sdtemp_read_16(, SDTEMP_REG_MFG_ID,  ) |
-		sdtemp_read_16(, SDTEMP_REG_DEV_REV, );
+		sdtemp_read_16(, SDTEMP_REG_DEV_REV, ) |
+		sdtemp_read_16(, SDTEMP_REG_CAPABILITY, );
 	iic_release_bus(sc.sc_tag, 0);
 
 	if (error)
 		return 0;
 
 	i = sdtemp_lookup(mfgid, devid);
-	if (sdtemp_dev_table[i].sdtemp_mfg_id == 0) {
+	if ((sdtemp_dev_table[i].sdtemp_mfg_id == 0) &&
+	(sdtemp_dev_table[i].sdtemp_devrev == 0)) {
 		aprint_debug("sdtemp: No match for mfg 0x%04x dev 0x%02x "
 		"rev 0x%02x at address 0x%02x\n", mfgid, devid >> 8,
 		devid & 0xff, sc.sc_address);
 		return 0;
 	}
 
+	/*
+	 * Check by SDTEMP_IS_TSE2004AV() might not be enough, so check the alarm
+	 * capability, too.
+	 */
+	if ((cap & SDTEMP_CAP_HAS_ALARM) == 0)
+		return 0;
+
 	return 1;
 }
 
@@ -249,10 +268,21 @@ sdtemp_attach(device_t parent, device_t 
 	aprint_naive(": Temp Sensor\n");
 	aprint_normal(": %s Temp Sensor\n", sdtemp_dev_table[i].sdtemp_desc);
 
-	if (sdtemp_dev_table[i].sdtemp_mfg_id == 0)
-		aprint_debug_dev(self,
-		"mfg 0x%04x dev 0x%02x rev 0x%02x at addr 0x%02x\n",
-		mfgid, devid >> 8, devid & 0xff, ia->ia_addr);
+	if (sdtemp_dev_table[i].sdtemp_mfg_id == 0) {
+		if (SDTEMP_IS_TSE2004AV(devid))
+			aprint_normal_dev(self, "TSE2004av compliant. "
+			"Manufacturer ID 0x%04hx, Device revision 0x%02x\n",
+			mfgid, devid & TSE2004AV_REV);
+		else {
+			aprint_error_dev(self,
+			"mfg 0x%04x dev 0x%02x rev 0x%02x at addr 0x%02x\n",
+			

CVS commit: src/sys

2016-07-28 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Thu Jul 28 09:03:51 UTC 2016

Modified Files:
src/sys/netinet: if_arp.c in.c
src/sys/netinet6: in6.c nd6_nbr.c

Log Message:
Fix panic on adding/deleting IP addresses under network load

Adding and deleting IP addresses aren't serialized with other network
opeartions, e.g., forwarding packets. So if we add or delete an IP
address under network load, a kernel panic may happen on manipulating
network-related shared objects such as rtentry and rtcache.

To avoid such panicks, we still need to hold softnet_lock in in_control
and in6_control that are called via ioctl and do network-related operations
including IP address additions/deletions.

Fix PR kern/51356


To generate a diff of this commit:
cvs rdiff -u -r1.219 -r1.220 src/sys/netinet/if_arp.c
cvs rdiff -u -r1.176 -r1.177 src/sys/netinet/in.c
cvs rdiff -u -r1.211 -r1.212 src/sys/netinet6/in6.c
cvs rdiff -u -r1.125 -r1.126 src/sys/netinet6/nd6_nbr.c

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

Modified files:

Index: src/sys/netinet/if_arp.c
diff -u src/sys/netinet/if_arp.c:1.219 src/sys/netinet/if_arp.c:1.220
--- src/sys/netinet/if_arp.c:1.219	Mon Jul 25 04:21:19 2016
+++ src/sys/netinet/if_arp.c	Thu Jul 28 09:03:50 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_arp.c,v 1.219 2016/07/25 04:21:19 ozaki-r Exp $	*/
+/*	$NetBSD: if_arp.c,v 1.220 2016/07/28 09:03:50 ozaki-r Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2000, 2008 The NetBSD Foundation, Inc.
@@ -68,7 +68,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_arp.c,v 1.219 2016/07/25 04:21:19 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_arp.c,v 1.220 2016/07/28 09:03:50 ozaki-r Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ddb.h"
@@ -1505,7 +1505,7 @@ static void
 arp_dad_stoptimer(struct dadq *dp)
 {
 
-	callout_halt(>dad_timer_ch, NULL);
+	callout_halt(>dad_timer_ch, softnet_lock);
 }
 
 static void

Index: src/sys/netinet/in.c
diff -u src/sys/netinet/in.c:1.176 src/sys/netinet/in.c:1.177
--- src/sys/netinet/in.c:1.176	Wed Jul 20 03:36:51 2016
+++ src/sys/netinet/in.c	Thu Jul 28 09:03:50 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: in.c,v 1.176 2016/07/20 03:36:51 ozaki-r Exp $	*/
+/*	$NetBSD: in.c,v 1.177 2016/07/28 09:03:50 ozaki-r Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -91,7 +91,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: in.c,v 1.176 2016/07/20 03:36:51 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: in.c,v 1.177 2016/07/28 09:03:50 ozaki-r Exp $");
 
 #include "arp.h"
 
@@ -360,8 +360,8 @@ in_len2mask(struct in_addr *mask, u_int 
  * Ifp is 0 if not an interface-specific ioctl.
  */
 /* ARGSUSED */
-int
-in_control(struct socket *so, u_long cmd, void *data, struct ifnet *ifp)
+static int
+in_control0(struct socket *so, u_long cmd, void *data, struct ifnet *ifp)
 {
 	struct ifreq *ifr = (struct ifreq *)data;
 	struct in_ifaddr *ia = NULL;
@@ -667,6 +667,18 @@ in_control(struct socket *so, u_long cmd
 	return error;
 }
 
+int
+in_control(struct socket *so, u_long cmd, void *data, struct ifnet *ifp)
+{
+	int error;
+
+	mutex_enter(softnet_lock);
+	error = in_control0(so, cmd, data, ifp);
+	mutex_exit(softnet_lock);
+
+	return error;
+}
+
 /* Add ownaddr as loopback rtentry. */
 static void
 in_ifaddlocal(struct ifaddr *ifa)

Index: src/sys/netinet6/in6.c
diff -u src/sys/netinet6/in6.c:1.211 src/sys/netinet6/in6.c:1.212
--- src/sys/netinet6/in6.c:1.211	Wed Jul 20 07:56:10 2016
+++ src/sys/netinet6/in6.c	Thu Jul 28 09:03:50 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: in6.c,v 1.211 2016/07/20 07:56:10 ozaki-r Exp $	*/
+/*	$NetBSD: in6.c,v 1.212 2016/07/28 09:03:50 ozaki-r Exp $	*/
 /*	$KAME: in6.c,v 1.198 2001/07/18 09:12:38 itojun Exp $	*/
 
 /*
@@ -62,7 +62,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: in6.c,v 1.211 2016/07/20 07:56:10 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: in6.c,v 1.212 2016/07/28 09:03:50 ozaki-r Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -751,7 +751,9 @@ in6_control(struct socket *so, u_long cm
 	}
 
 	s = splnet();
+	mutex_enter(softnet_lock);
 	error = in6_control1(so , cmd, data, ifp);
+	mutex_exit(softnet_lock);
 	splx(s);
 	return error;
 }

Index: src/sys/netinet6/nd6_nbr.c
diff -u src/sys/netinet6/nd6_nbr.c:1.125 src/sys/netinet6/nd6_nbr.c:1.126
--- src/sys/netinet6/nd6_nbr.c:1.125	Mon Jul 25 04:21:20 2016
+++ src/sys/netinet6/nd6_nbr.c	Thu Jul 28 09:03:50 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: nd6_nbr.c,v 1.125 2016/07/25 04:21:20 ozaki-r Exp $	*/
+/*	$NetBSD: nd6_nbr.c,v 1.126 2016/07/28 09:03:50 ozaki-r Exp $	*/
 /*	$KAME: nd6_nbr.c,v 1.61 2001/02/10 16:06:14 jinmei Exp $	*/
 
 /*
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: nd6_nbr.c,v 1.125 2016/07/25 04:21:20 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nd6_nbr.c,v 1.126 2016/07/28 09:03:50 ozaki-r Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -1077,7 +1077,7 @@ static void
 nd6_dad_stoptimer(struct dadq 

CVS commit: src

2016-07-28 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Jul 28 08:24:58 UTC 2016

Modified Files:
src/sbin/fsdb: fsdb.c
src/sys/ufs/ffs: ffs_vfsops.c
src/usr.sbin/quot: quot.c

Log Message:
>From Michael Plass:

The superblock field that distinguishes between 4.2BSD and 4.4BSD
inodes is really only relevant on a UFS1 file system. Make sure that
it is a UFS1 fs before using fs_old_inodefmt.

Note that the NetBSD newfs and mkfs utilities initialize fs_old_inodefmt
even for UFS2, so problems were apparent only on file systems created
by other operating systems, for example, FreeBSD.


To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 src/sbin/fsdb/fsdb.c
cvs rdiff -u -r1.339 -r1.340 src/sys/ufs/ffs/ffs_vfsops.c
cvs rdiff -u -r1.33 -r1.34 src/usr.sbin/quot/quot.c

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

Modified files:

Index: src/sbin/fsdb/fsdb.c
diff -u src/sbin/fsdb/fsdb.c:1.48 src/sbin/fsdb/fsdb.c:1.49
--- src/sbin/fsdb/fsdb.c:1.48	Sun Jun 23 02:06:04 2013
+++ src/sbin/fsdb/fsdb.c	Thu Jul 28 08:24:58 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: fsdb.c,v 1.48 2013/06/23 02:06:04 dholland Exp $	*/
+/*	$NetBSD: fsdb.c,v 1.49 2016/07/28 08:24:58 martin Exp $	*/
 
 /*-
  * Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: fsdb.c,v 1.48 2013/06/23 02:06:04 dholland Exp $");
+__RCSID("$NetBSD: fsdb.c,v 1.49 2016/07/28 08:24:58 martin Exp $");
 #endif /* not lint */
 
 #include 
@@ -1232,7 +1232,7 @@ CMDFUNC(chgroup)
 			return 1;
 		}
 	}
-	if (sblock->fs_old_inodefmt < FS_44INODEFMT)
+	if (!is_ufs2 && sblock->fs_old_inodefmt < FS_44INODEFMT)
 		curinode->dp1.di_ogid = iswap32(gid);
 	else
 		DIP_SET(curinode, gid, iswap32(gid));

Index: src/sys/ufs/ffs/ffs_vfsops.c
diff -u src/sys/ufs/ffs/ffs_vfsops.c:1.339 src/sys/ufs/ffs/ffs_vfsops.c:1.340
--- src/sys/ufs/ffs/ffs_vfsops.c:1.339	Sun Jun 19 22:41:31 2016
+++ src/sys/ufs/ffs/ffs_vfsops.c	Thu Jul 28 08:24:58 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: ffs_vfsops.c,v 1.339 2016/06/19 22:41:31 christos Exp $	*/
+/*	$NetBSD: ffs_vfsops.c,v 1.340 2016/07/28 08:24:58 martin Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -61,7 +61,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ffs_vfsops.c,v 1.339 2016/06/19 22:41:31 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ffs_vfsops.c,v 1.340 2016/07/28 08:24:58 martin Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_ffs.h"
@@ -1605,7 +1605,8 @@ ffs_oldfscompat_read(struct fs *fs, stru
 		fs->fs_old_trackskew = 0;
 	}
 
-	if (fs->fs_old_inodefmt < FS_44INODEFMT) {
+	if (fs->fs_magic == FS_UFS1_MAGIC &&
+	fs->fs_old_inodefmt < FS_44INODEFMT) {
 		fs->fs_maxfilesize = (u_quad_t) 1LL << 39;
 		fs->fs_qbmask = ~fs->fs_bmask;
 		fs->fs_qfmask = ~fs->fs_fmask;
@@ -2092,7 +2093,8 @@ ffs_loadvnode(struct mount *mp, struct v
 	 * fix until fsck has been changed to do the update.
 	 */
 
-	if (fs->fs_old_inodefmt < FS_44INODEFMT) {		/* XXX */
+	if (fs->fs_magic == FS_UFS1_MAGIC &&			/* XXX */
+	fs->fs_old_inodefmt < FS_44INODEFMT) {		/* XXX */
 		ip->i_uid = ip->i_ffs1_ouid;			/* XXX */
 		ip->i_gid = ip->i_ffs1_ogid;			/* XXX */
 	}			/* XXX */

Index: src/usr.sbin/quot/quot.c
diff -u src/usr.sbin/quot/quot.c:1.33 src/usr.sbin/quot/quot.c:1.34
--- src/usr.sbin/quot/quot.c:1.33	Sat Oct 19 17:16:38 2013
+++ src/usr.sbin/quot/quot.c	Thu Jul 28 08:24:58 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: quot.c,v 1.33 2013/10/19 17:16:38 christos Exp $	*/
+/*	$NetBSD: quot.c,v 1.34 2016/07/28 08:24:58 martin Exp $	*/
 
 /*
  * Copyright (C) 1991, 1994 Wolfgang Solfrank.
@@ -33,7 +33,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: quot.c,v 1.33 2013/10/19 17:16:38 christos Exp $");
+__RCSID("$NetBSD: quot.c,v 1.34 2016/07/28 08:24:58 martin Exp $");
 #endif /* not lint */
 
 #include 
@@ -521,7 +521,8 @@ ffs_oldfscompat(struct fs *fs)
 {
 	int i;
 
-	if (fs->fs_old_inodefmt < FS_44INODEFMT) {
+	if (fs->fs_magic == FS_UFS1_MAGIC &&
+	fs->fs_old_inodefmt < FS_44INODEFMT) {
 		quad_t sizepb = fs->fs_bsize;
 
 		fs->fs_maxfilesize = fs->fs_bsize * UFS_NDADDR - 1;



CVS commit: src/sys

2016-07-28 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Jul 28 07:54:31 UTC 2016

Modified Files:
src/sys/net: rtsock.c
src/sys/netinet: tcp_vtw.c

Log Message:
PR kern/51371: avoid shifting negative values


To generate a diff of this commit:
cvs rdiff -u -r1.192 -r1.193 src/sys/net/rtsock.c
cvs rdiff -u -r1.15 -r1.16 src/sys/netinet/tcp_vtw.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/rtsock.c
diff -u src/sys/net/rtsock.c:1.192 src/sys/net/rtsock.c:1.193
--- src/sys/net/rtsock.c:1.192	Thu Jul 21 03:45:56 2016
+++ src/sys/net/rtsock.c	Thu Jul 28 07:54:31 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: rtsock.c,v 1.192 2016/07/21 03:45:56 ozaki-r Exp $	*/
+/*	$NetBSD: rtsock.c,v 1.193 2016/07/28 07:54:31 martin Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -61,7 +61,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rtsock.c,v 1.192 2016/07/21 03:45:56 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rtsock.c,v 1.193 2016/07/28 07:54:31 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -971,9 +971,9 @@ rt_xaddrs(u_char rtmtype, const char *cp
 	 */
 	if (rtmtype == RTM_GET) {
 		if (((rtinfo->rti_addrs &
-		(~((1 << RTAX_IFP) | (1 << RTAX_IFA & (~0 << i)) != 0)
+		(~((1 << RTAX_IFP) | (1 << RTAX_IFA & (~0U << i)) != 0)
 			return 1;
-	} else if ((rtinfo->rti_addrs & (~0 << i)) != 0)
+	} else if ((rtinfo->rti_addrs & (~0U << i)) != 0)
 		return 1;
 	/* Check for bad data length.  */
 	if (cp != cplim) {

Index: src/sys/netinet/tcp_vtw.c
diff -u src/sys/netinet/tcp_vtw.c:1.15 src/sys/netinet/tcp_vtw.c:1.16
--- src/sys/netinet/tcp_vtw.c:1.15	Tue Apr 26 08:44:45 2016
+++ src/sys/netinet/tcp_vtw.c	Thu Jul 28 07:54:31 2016
@@ -123,7 +123,7 @@
 
 #include 
 
-__KERNEL_RCSID(0, "$NetBSD: tcp_vtw.c,v 1.15 2016/04/26 08:44:45 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tcp_vtw.c,v 1.16 2016/07/28 07:54:31 martin Exp $");
 
 #define db_trace(__a, __b)	do { } while (/*CONSTCOND*/0)
 
@@ -1050,7 +1050,7 @@ vtw_next_port_v4(struct tcp_ports_iterat
 			if (!(inuse & (1 << i)))
 continue;
 
-			inuse &= ~0 << i;
+			inuse &= ~0U << i;
 
 			if (i < it->slot_idx)
 continue;
@@ -1164,7 +1164,7 @@ vtw_next_port_v6(struct tcp_ports_iterat
 			if (!(inuse & (1 << i)))
 continue;
 
-			inuse &= ~0 << i;
+			inuse &= ~0U << i;
 
 			if (i < it->slot_idx)
 continue;



CVS commit: src/sys/uvm

2016-07-28 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Jul 28 07:52:06 UTC 2016

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

Log Message:
PR kern/51371: fix misleading indentation


To generate a diff of this commit:
cvs rdiff -u -r1.123 -r1.124 src/sys/uvm/uvm_aobj.c

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

Modified files:

Index: src/sys/uvm/uvm_aobj.c
diff -u src/sys/uvm/uvm_aobj.c:1.123 src/sys/uvm/uvm_aobj.c:1.124
--- src/sys/uvm/uvm_aobj.c:1.123	Mon Aug 24 22:50:32 2015
+++ src/sys/uvm/uvm_aobj.c	Thu Jul 28 07:52:06 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_aobj.c,v 1.123 2015/08/24 22:50:32 pooka Exp $	*/
+/*	$NetBSD: uvm_aobj.c,v 1.124 2016/07/28 07:52:06 martin Exp $	*/
 
 /*
  * Copyright (c) 1998 Chuck Silvers, Charles D. Cranor and
@@ -38,7 +38,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uvm_aobj.c,v 1.123 2015/08/24 22:50:32 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_aobj.c,v 1.124 2016/07/28 07:52:06 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_uvmhist.h"
@@ -929,7 +929,7 @@ uao_get(struct uvm_object *uobj, voff_t 
 (flags & PGO_ALLPAGES) != 0)
 	/* need to do a wait or I/O! */
 	done = false;
-	continue;
+continue;
 			}
 
 			/*



CVS commit: [pgoyette-localcount] src/sys/dev

2016-07-28 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Thu Jul 28 06:45:32 UTC 2016

Modified Files:
src/sys/dev [pgoyette-localcount]: cgd.c

Log Message:
Remove duplicated code (cut-and-paste error)


To generate a diff of this commit:
cvs rdiff -u -r1.108.2.16 -r1.108.2.17 src/sys/dev/cgd.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/cgd.c
diff -u src/sys/dev/cgd.c:1.108.2.16 src/sys/dev/cgd.c:1.108.2.17
--- src/sys/dev/cgd.c:1.108.2.16	Tue Jul 26 05:54:39 2016
+++ src/sys/dev/cgd.c	Thu Jul 28 06:45:32 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: cgd.c,v 1.108.2.16 2016/07/26 05:54:39 pgoyette Exp $ */
+/* $NetBSD: cgd.c,v 1.108.2.17 2016/07/28 06:45:32 pgoyette Exp $ */
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cgd.c,v 1.108.2.16 2016/07/26 05:54:39 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cgd.c,v 1.108.2.17 2016/07/28 06:45:32 pgoyette Exp $");
 
 #include 
 #include 
@@ -1157,12 +1157,6 @@ cgd_modcmd(modcmd_t cmd, void *arg)
 		_cdevsw, _cmajor);
 
 		/*
-		 * Attach the {b,c}devsw's
-		 */
-		error = devsw_attach("cgd", _bdevsw, _bmajor,
-		_cdevsw, _cmajor);
-
-		/*
 		 * If devsw_attach fails, remove from autoconf database
 		 */
 		if (error) {