CVS commit: src/sys/ufs/lfs

2017-04-10 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Apr 11 05:48:04 UTC 2017

Modified Files:
src/sys/ufs/lfs: lfs_vnops.c ulfs_vnops.c

Log Message:
Sprinkle lock ownership assertions.


To generate a diff of this commit:
cvs rdiff -u -r1.310 -r1.311 src/sys/ufs/lfs/lfs_vnops.c
cvs rdiff -u -r1.46 -r1.47 src/sys/ufs/lfs/ulfs_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/ufs/lfs/lfs_vnops.c
diff -u src/sys/ufs/lfs/lfs_vnops.c:1.310 src/sys/ufs/lfs/lfs_vnops.c:1.311
--- src/sys/ufs/lfs/lfs_vnops.c:1.310	Sat Apr  1 17:34:21 2017
+++ src/sys/ufs/lfs/lfs_vnops.c	Tue Apr 11 05:48:04 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: lfs_vnops.c,v 1.310 2017/04/01 17:34:21 maya Exp $	*/
+/*	$NetBSD: lfs_vnops.c,v 1.311 2017/04/11 05:48:04 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2002, 2003 The NetBSD Foundation, Inc.
@@ -125,7 +125,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: lfs_vnops.c,v 1.310 2017/04/01 17:34:21 maya Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lfs_vnops.c,v 1.311 2017/04/11 05:48:04 riastradh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -407,6 +407,7 @@ lfs_makeinode(struct vattr *vap, struct 
 	if (error)
 		goto bad;
 	*vpp = tvp;
+	KASSERT(VOP_ISLOCKED(*vpp) == LK_EXCLUSIVE);
 	return (0);
 
  bad:
@@ -438,17 +439,20 @@ lfs_fsync(void *v)
 		off_t offhi;
 	} */ *ap = v;
 	struct vnode *vp = ap->a_vp;
-	int error, wait;
+	int wait;
 	struct inode *ip = VTOI(vp);
 	struct lfs *fs = ip->i_lfs;
+	int error = 0;
+
+	KASSERT(VOP_ISLOCKED(vp) == LK_EXCLUSIVE);
 
 	/* If we're mounted read-only, don't try to sync. */
 	if (fs->lfs_ronly)
-		return 0;
+		goto out;
 
 	/* If a removed vnode is being cleaned, no need to sync here. */
 	if ((ap->a_flags & FSYNC_RECLAIM) != 0 && ip->i_mode == 0)
-		return 0;
+		goto out;
 
 	/*
 	 * Trickle sync simply adds this vnode to the pager list, as if
@@ -465,7 +469,7 @@ lfs_fsync(void *v)
 			cv_broadcast(_writerd_cv);
 			mutex_exit(_lock);
 		}
-		return 0;
+		goto out;
 	}
 
 	/*
@@ -491,7 +495,7 @@ lfs_fsync(void *v)
 		}
 	} while (error == EAGAIN);
 	if (error)
-		return error;
+		goto out;
 
 	if ((ap->a_flags & FSYNC_DATAONLY) == 0)
 		error = lfs_update(vp, NULL, NULL, wait ? UPDATE_WAIT : 0);
@@ -504,6 +508,8 @@ lfs_fsync(void *v)
 	if (wait && !VPISEMPTY(vp))
 		LFS_SET_UINO(ip, IN_MODIFIED);
 
+out:
+	KASSERT(VOP_ISLOCKED(vp) == LK_EXCLUSIVE);
 	return error;
 }
 
@@ -517,6 +523,8 @@ lfs_inactive(void *v)
 		struct vnode *a_vp;
 	} */ *ap = v;
 
+	KASSERT(VOP_ISLOCKED(ap->a_vp) == LK_EXCLUSIVE);
+
 	lfs_unmark_vnode(ap->a_vp);
 
 	/*
@@ -552,8 +560,8 @@ lfs_set_dirop(struct vnode *dvp, struct 
 	struct lfs *fs;
 	int error;
 
-	KASSERT(VOP_ISLOCKED(dvp));
-	KASSERT(vp == NULL || VOP_ISLOCKED(vp));
+	KASSERT(VOP_ISLOCKED(dvp) == LK_EXCLUSIVE);
+	KASSERT(vp == NULL || VOP_ISLOCKED(vp) == LK_EXCLUSIVE);
 
 	fs = VTOI(dvp)->i_lfs;
 
@@ -701,6 +709,7 @@ lfs_symlink(void *v)
 	dvp = ap->a_dvp;
 	vpp = ap->a_vpp;
 
+	KASSERT(VOP_ISLOCKED(dvp) == LK_EXCLUSIVE);
 	KASSERT(vpp != NULL);
 	KASSERT(*vpp == NULL);
 	KASSERT(ap->a_vap->va_type == VLNK);
@@ -723,6 +732,7 @@ lfs_symlink(void *v)
 	if (error) {
 		goto out;
 	}
+	KASSERT(VOP_ISLOCKED(*vpp) == LK_EXCLUSIVE);
 
 	VN_KNOTE(ap->a_dvp, NOTE_WRITE);
 	ip = VTOI(*vpp);
@@ -787,9 +797,10 @@ lfs_mknod(void *v)
 	vpp = ap->a_vpp;
 	vap = ap->a_vap;
 
+	KASSERT(VOP_ISLOCKED(dvp) == LK_EXCLUSIVE);
 	KASSERT(vpp != NULL);
 	KASSERT(*vpp == NULL);
-	
+
 	/* XXX should handle this material another way */
 	ulr = (dvp)->i_crap;
 	ULFS_CHECK_CRAPCOUNTER(VTOI(dvp));
@@ -816,6 +827,7 @@ lfs_mknod(void *v)
 		*vpp = NULL;
 		return (error);
 	}
+	KASSERT(VOP_ISLOCKED(*vpp) == LK_EXCLUSIVE);
 
 	VN_KNOTE(dvp, NOTE_WRITE);
 	ip = VTOI(*vpp);
@@ -864,6 +876,7 @@ lfs_create(void *v)
 	vpp = ap->a_vpp;
 	vap = ap->a_vap;
 
+	KASSERT(VOP_ISLOCKED(dvp) == LK_EXCLUSIVE);
 	KASSERT(vpp != NULL);
 	KASSERT(*vpp == NULL);
 
@@ -885,6 +898,7 @@ lfs_create(void *v)
 	if (error) {
 		goto out;
 	}
+	KASSERT(VOP_ISLOCKED(*vpp) == LK_EXCLUSIVE);
 	VN_KNOTE(dvp, NOTE_WRITE);
 	VOP_UNLOCK(*vpp);
 
@@ -927,6 +941,8 @@ lfs_mkdir(void *v)
 	cnp = ap->a_cnp;
 	vap = ap->a_vap;
 
+	KASSERT(VOP_ISLOCKED(dvp) == LK_EXCLUSIVE);
+
 	dp = VTOI(dvp);
 	ip = NULL;
 
@@ -1078,6 +1094,10 @@ lfs_remove(void *v)
 
 	dvp = ap->a_dvp;
 	vp = ap->a_vp;
+
+	KASSERT(VOP_ISLOCKED(dvp) == LK_EXCLUSIVE);
+	KASSERT(VOP_ISLOCKED(vp) == LK_EXCLUSIVE);
+
 	ip = VTOI(vp);
 	if ((error = lfs_set_dirop(dvp, vp)) != 0) {
 		if (dvp == vp)
@@ -1118,6 +1138,10 @@ lfs_rmdir(void *v)
 	int error;
 
 	vp = ap->a_vp;
+
+	KASSERT(VOP_ISLOCKED(ap->a_dvp) == LK_EXCLUSIVE);
+	KASSERT(VOP_ISLOCKED(vp) == LK_EXCLUSIVE);
+
 	ip = VTOI(vp);
 	if ((error = lfs_set_dirop(ap->a_dvp, ap->a_vp)) != 0) {
 		if (ap->a_dvp == vp)
@@ -1158,6 +1182,8 @@ lfs_link(void *v)
 
 	dvp = ap->a_dvp;
 
+	KASSERT(VOP_ISLOCKED(dvp) == 

CVS commit: src/sys/ufs/lfs

2017-04-10 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Apr 11 05:48:04 UTC 2017

Modified Files:
src/sys/ufs/lfs: lfs_vnops.c ulfs_vnops.c

Log Message:
Sprinkle lock ownership assertions.


To generate a diff of this commit:
cvs rdiff -u -r1.310 -r1.311 src/sys/ufs/lfs/lfs_vnops.c
cvs rdiff -u -r1.46 -r1.47 src/sys/ufs/lfs/ulfs_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/external/bsd/drm2/dist/drm/nouveau

2017-04-10 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Apr 11 04:43:12 UTC 2017

Modified Files:
src/sys/external/bsd/drm2/dist/drm/nouveau: nouveau_nv50_display.c

Log Message:
Use a spin lock -- we take this in interrupt context.

The nv_wait is a busy-wait, so holding a spin lock over it is OK.

Found, fixed, and tested by maya.  Cosmetically tweaked by me.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 \
src/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_nv50_display.c

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

Modified files:

Index: src/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_nv50_display.c
diff -u src/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_nv50_display.c:1.5 src/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_nv50_display.c:1.6
--- src/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_nv50_display.c:1.5	Fri Feb  5 23:46:40 2016
+++ src/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_nv50_display.c	Tue Apr 11 04:43:12 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: nouveau_nv50_display.c,v 1.5 2016/02/05 23:46:40 riastradh Exp $	*/
+/*	$NetBSD: nouveau_nv50_display.c,v 1.6 2017/04/11 04:43:12 riastradh Exp $	*/
 
 	/*
  * Copyright 2011 Red Hat Inc.
@@ -25,7 +25,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: nouveau_nv50_display.c,v 1.5 2016/02/05 23:46:40 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nouveau_nv50_display.c,v 1.6 2017/04/11 04:43:12 riastradh Exp $");
 
 #include 
 #include 
@@ -163,7 +163,7 @@ struct nv50_dmac {
 	/* Protects against concurrent pushbuf access to this channel, lock is
 	 * grabbed by evo_wait (if the pushbuf reservation is successful) and
 	 * dropped again by evo_kick. */
-	struct mutex lock;
+	struct spinlock lock;
 };
 
 static void
@@ -187,7 +187,7 @@ nv50_dmac_destroy(struct nouveau_object 
 	}
 
 #ifdef __NetBSD__
-	linux_mutex_destroy(>lock);
+	spin_lock_destroy(>lock);
 #endif
 
 	nv50_chan_destroy(core, >base);
@@ -323,11 +323,7 @@ nv50_dmac_create(struct nouveau_object *
 	u32 pushbuf = *(u32 *)data;
 	int ret;
 
-#ifdef __NetBSD__
-	linux_mutex_init(>lock);
-#else
-	mutex_init(>lock);
-#endif
+	spin_lock_init(>lock);
 
 #ifdef __NetBSD__
 {
@@ -495,13 +491,13 @@ evo_wait(void *evoc, int nr)
 	struct nv50_dmac *dmac = evoc;
 	u32 put = nv_ro32(dmac->base.user, 0x) / 4;
 
-	mutex_lock(>lock);
+	spin_lock(>lock);
 	if (put + nr >= (PAGE_SIZE / 4) - 8) {
 		dmac->ptr[put] = 0x2000;
 
 		nv_wo32(dmac->base.user, 0x, 0x);
 		if (!nv_wait(dmac->base.user, 0x0004, ~0, 0x)) {
-			mutex_unlock(>lock);
+			spin_unlock(>lock);
 			NV_ERROR(dmac->base.user, "channel stalled\n");
 			return NULL;
 		}
@@ -517,7 +513,7 @@ evo_kick(u32 *push, void *evoc)
 {
 	struct nv50_dmac *dmac = evoc;
 	nv_wo32(dmac->base.user, 0x, (push - dmac->ptr) << 2);
-	mutex_unlock(>lock);
+	spin_unlock(>lock);
 }
 
 #define evo_mthd(p,m,s) *((p)++) = (((s) << 18) | (m))



Re: CVS commit: src/sys/dev/scsipi

2017-04-10 Thread Christos Zoulas
In article <20170410215338.12a45f...@cvs.netbsd.org>,
Jaromir Dolecek  wrote:
>-=-=-=-=-=-
>
>just do not autoload scsiverbose module, it causes deadlock if it happens
>while root fs is being mounted
>
>adresses second part of PR kern/52147 by Michael van Elst, thank you

Can't we fix this a different way? What's the problem?

christos



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

2017-04-10 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Apr 11 01:22:13 UTC 2017

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

Log Message:
add more dc, sort


To generate a diff of this commit:
cvs rdiff -u -r1.203 -r1.204 src/distrib/sets/lists/misc/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/misc/mi
diff -u src/distrib/sets/lists/misc/mi:1.203 src/distrib/sets/lists/misc/mi:1.204
--- src/distrib/sets/lists/misc/mi:1.203	Mon Apr 10 12:39:12 2017
+++ src/distrib/sets/lists/misc/mi	Mon Apr 10 21:22:13 2017
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.203 2017/04/10 16:39:12 christos Exp $
+# $NetBSD: mi,v 1.204 2017/04/11 01:22:13 christos Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -584,6 +584,7 @@
 ./usr/share/doc/reference/ref1/csh/csh7.png			misc-usd-doc		doc,html,groffhtmldoc
 ./usr/share/doc/reference/ref1/csh/csh8.png			misc-usd-doc		doc,html,groffhtmldoc
 ./usr/share/doc/reference/ref1/csh/csh9.png			misc-usd-doc		doc,html,groffhtmldoc
+./usr/share/doc/reference/ref1/dcmisc-usd-doc
 ./usr/share/doc/reference/ref1/dc/dc.ps.gz			misc-usd-doc		doc
 ./usr/share/doc/reference/ref1/dc/dc.txt			misc-usd-doc		doc
 ./usr/share/doc/reference/ref1/ex/reference.html		misc-usd-doc		doc,html,groffhtmldoc
@@ -1617,11 +1618,11 @@
 ./usr/share/examples/tmux			misc-tmux-examples
 ./usr/share/examples/tmux/example_tmux.conf	misc-tmux-examples	share
 ./usr/share/examples/tmux/screen-keys.conf	misc-obsolete		obsolete
+./usr/share/examples/unbound/unbound.conf	misc-netutil-examples	share,unbound
 ./usr/share/examples/usermgmt			misc-obsolete		obsolete
 ./usr/share/examples/usermgmt/.cshrc		misc-obsolete		obsolete
 ./usr/share/examples/usermgmt/.login		misc-obsolete		obsolete
 ./usr/share/examples/usermgmt/.profile		misc-obsolete		obsolete
-./usr/share/examples/unbound/unbound.conf	misc-netutil-examples	share,unbound
 ./usr/share/misc/NetBSD.el			misc-reference-share	share
 ./usr/share/misc/airport			misc-reference-share	share
 ./usr/share/misc/birthtoken			misc-reference-share	share



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

2017-04-10 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Apr 11 01:22:13 UTC 2017

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

Log Message:
add more dc, sort


To generate a diff of this commit:
cvs rdiff -u -r1.203 -r1.204 src/distrib/sets/lists/misc/mi

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



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

2017-04-10 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Tue Apr 11 00:03:16 UTC 2017

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

Log Message:
The new bc/dc has no dc.info file.


To generate a diff of this commit:
cvs rdiff -u -r1.1552 -r1.1553 src/distrib/sets/lists/man/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/man/mi
diff -u src/distrib/sets/lists/man/mi:1.1552 src/distrib/sets/lists/man/mi:1.1553
--- src/distrib/sets/lists/man/mi:1.1552	Thu Apr  6 14:35:15 2017
+++ src/distrib/sets/lists/man/mi	Tue Apr 11 00:03:16 2017
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1552 2017/04/06 14:35:15 wiz Exp $
+# $NetBSD: mi,v 1.1553 2017/04/11 00:03:16 kre Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -12,7 +12,7 @@
 ./usr/share/info/cpp.info			man-util-info		gcccmds,info
 ./usr/share/info/cvs.info			man-cvs-info		cvs,info
 ./usr/share/info/cvsclient.info			man-cvs-info		cvs,info
-./usr/share/info/dc.info			man-util-info		info
+./usr/share/info/dc.info			man-obsolete		obsolete
 ./usr/share/info/diff.info			man-util-info		info
 ./usr/share/info/dirman-info-share		info
 ./usr/share/info/flex.info			man-computil-info	info



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

2017-04-10 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Tue Apr 11 00:03:16 UTC 2017

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

Log Message:
The new bc/dc has no dc.info file.


To generate a diff of this commit:
cvs rdiff -u -r1.1552 -r1.1553 src/distrib/sets/lists/man/mi

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



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

2017-04-10 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Mon Apr 10 22:57:03 UTC 2017

Modified Files:
src/sys/dev/ata [jdolecek-ncq]: ata.c ata_wdc.c atavar.h
src/sys/dev/ic [jdolecek-ncq]: ahcisata_core.c mvsata.c siisata.c wdc.c
src/sys/dev/pci [jdolecek-ncq]: artsata.c cmdide.c cypide.c
pciide_common.c pdcsata.c satalink.c viaide.c
src/sys/dev/scsipi [jdolecek-ncq]: atapi_wdc.c

Log Message:
ATA infrastructure improvements to eventually support more outstanding
commands

patch by Matt Thomas


To generate a diff of this commit:
cvs rdiff -u -r1.132 -r1.132.8.1 src/sys/dev/ata/ata.c
cvs rdiff -u -r1.105 -r1.105.6.1 src/sys/dev/ata/ata_wdc.c
cvs rdiff -u -r1.92 -r1.92.8.1 src/sys/dev/ata/atavar.h
cvs rdiff -u -r1.57 -r1.57.6.1 src/sys/dev/ic/ahcisata_core.c
cvs rdiff -u -r1.35 -r1.35.6.1 src/sys/dev/ic/mvsata.c
cvs rdiff -u -r1.30 -r1.30.4.1 src/sys/dev/ic/siisata.c
cvs rdiff -u -r1.283 -r1.283.2.1 src/sys/dev/ic/wdc.c
cvs rdiff -u -r1.26 -r1.26.18.1 src/sys/dev/pci/artsata.c
cvs rdiff -u -r1.38 -r1.38.28.1 src/sys/dev/pci/cmdide.c
cvs rdiff -u -r1.30 -r1.30.18.1 src/sys/dev/pci/cypide.c
cvs rdiff -u -r1.62 -r1.62.4.1 src/sys/dev/pci/pciide_common.c
cvs rdiff -u -r1.27 -r1.27.18.1 src/sys/dev/pci/pdcsata.c
cvs rdiff -u -r1.53 -r1.53.4.1 src/sys/dev/pci/satalink.c
cvs rdiff -u -r1.84 -r1.84.18.1 src/sys/dev/pci/viaide.c
cvs rdiff -u -r1.123 -r1.123.4.1 src/sys/dev/scsipi/atapi_wdc.c

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

Modified files:

Index: src/sys/dev/ata/ata.c
diff -u src/sys/dev/ata/ata.c:1.132 src/sys/dev/ata/ata.c:1.132.8.1
--- src/sys/dev/ata/ata.c:1.132	Wed Sep 10 07:04:48 2014
+++ src/sys/dev/ata/ata.c	Mon Apr 10 22:57:02 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: ata.c,v 1.132 2014/09/10 07:04:48 matt Exp $	*/
+/*	$NetBSD: ata.c,v 1.132.8.1 2017/04/10 22:57:02 jdolecek Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Manuel Bouyer.  All rights reserved.
@@ -25,7 +25,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ata.c,v 1.132 2014/09/10 07:04:48 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ata.c,v 1.132.8.1 2017/04/10 22:57:02 jdolecek Exp $");
 
 #include "opt_ata.h"
 
@@ -180,6 +180,56 @@ ataprint(void *aux, const char *pnp)
 	return (UNCONF);
 }
 
+static void
+ata_queue_reset(struct ata_queue *chq)
+{
+	/* make sure that we can use polled commands */
+	TAILQ_INIT(>queue_xfer);
+	chq->queue_freeze = 0;
+	chq->queue_active = 0;
+	for (u_int i = 0; i < chq->queue_openings; i++) {
+		chq->active_xfers[0] = NULL;
+	}
+}
+
+struct ata_xfer *
+ata_queue_hwslot_to_xfer(struct ata_queue *chq, int hwslot)
+{
+	KASSERT(hwslot < chq->queue_openings);
+	if (chq->queue_openings == 1) {
+		struct ata_xfer *xfer = chq->active_xfers[0];
+		KASSERT(xfer == NULL || xfer->c_hwslot == hwslot);
+		return xfer;
+	}
+	for (u_int i = 0; i < chq->queue_openings; i++) {
+		struct ata_xfer *xfer = chq->active_xfers[i];
+		if (xfer != NULL && xfer->c_hwslot == hwslot) {
+			return xfer;
+		}
+	}
+	return NULL;
+}
+
+struct ata_queue *
+ata_queue_alloc(int openings)
+{
+	if (openings == 0)
+		openings = 1;
+	struct ata_queue *chq = malloc(offsetof(struct ata_queue, active_xfers[openings]),
+	M_DEVBUF, M_WAITOK);
+	if (chq != NULL) {
+		chq->queue_openings = openings;
+		ata_queue_reset(chq);
+	}
+	return chq;
+}
+
+void
+ata_queue_free(struct ata_queue *chq)
+{
+	free(chq, M_DEVBUF);
+}
+
 /*
  * ata_channel_attach:
  *
@@ -188,6 +238,7 @@ ataprint(void *aux, const char *pnp)
 void
 ata_channel_attach(struct ata_channel *chp)
 {
+	struct ata_queue * const chq = chp->ch_queue;
 
 	if (chp->ch_flags & ATACH_DISABLED)
 		return;
@@ -195,10 +246,9 @@ ata_channel_attach(struct ata_channel *c
 	/* XXX callout_destroy */
 	callout_init(>ch_callout, 0);
 
-	TAILQ_INIT(>ch_queue->queue_xfer);
-	chp->ch_queue->queue_freeze = 0;
-	chp->ch_queue->queue_flags = 0;
-	chp->ch_queue->active_xfer = NULL;
+	chq->queue_openings = 1;	/* XXX */
+
+	ata_queue_reset(chq);
 
 	chp->atabus = config_found_ia(chp->ch_atac->atac_dev, "ata", chp,
 		atabusprint);
@@ -350,7 +400,7 @@ atabusconfig_thread(void *arg)
 		memset(, 0, sizeof(struct ata_device));
 		adev.adev_bustype = atac->atac_bustype_ata;
 		adev.adev_channel = chp->ch_channel;
-		adev.adev_openings = 1;
+		adev.adev_openings = chp->ch_queue->queue_openings;
 		adev.adev_drv_data = >ch_drive[i];
 		chp->ch_drive[i].drv_softc = config_found_ia(atabus_sc->sc_dev,
 		"ata_hl", , ataprint);
@@ -418,6 +468,7 @@ atabus_thread(void *arg)
 {
 	struct atabus_softc *sc = arg;
 	struct ata_channel *chp = sc->sc_chan;
+	struct ata_queue *chq = chp->ch_queue;
 	struct ata_xfer *xfer;
 	int i, s;
 
@@ -442,8 +493,7 @@ atabus_thread(void *arg)
 	s = splbio();
 	for (;;) {
 		if ((chp->ch_flags & (ATACH_TH_RESET | ATACH_SHUTDOWN)) == 0 &&
-		(chp->ch_queue->active_xfer == NULL ||
-		 chp->ch_queue->queue_freeze == 0)) {
+		(chq->queue_active == 0 || chq->queue_freeze == 

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

2017-04-10 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Mon Apr 10 22:57:03 UTC 2017

Modified Files:
src/sys/dev/ata [jdolecek-ncq]: ata.c ata_wdc.c atavar.h
src/sys/dev/ic [jdolecek-ncq]: ahcisata_core.c mvsata.c siisata.c wdc.c
src/sys/dev/pci [jdolecek-ncq]: artsata.c cmdide.c cypide.c
pciide_common.c pdcsata.c satalink.c viaide.c
src/sys/dev/scsipi [jdolecek-ncq]: atapi_wdc.c

Log Message:
ATA infrastructure improvements to eventually support more outstanding
commands

patch by Matt Thomas


To generate a diff of this commit:
cvs rdiff -u -r1.132 -r1.132.8.1 src/sys/dev/ata/ata.c
cvs rdiff -u -r1.105 -r1.105.6.1 src/sys/dev/ata/ata_wdc.c
cvs rdiff -u -r1.92 -r1.92.8.1 src/sys/dev/ata/atavar.h
cvs rdiff -u -r1.57 -r1.57.6.1 src/sys/dev/ic/ahcisata_core.c
cvs rdiff -u -r1.35 -r1.35.6.1 src/sys/dev/ic/mvsata.c
cvs rdiff -u -r1.30 -r1.30.4.1 src/sys/dev/ic/siisata.c
cvs rdiff -u -r1.283 -r1.283.2.1 src/sys/dev/ic/wdc.c
cvs rdiff -u -r1.26 -r1.26.18.1 src/sys/dev/pci/artsata.c
cvs rdiff -u -r1.38 -r1.38.28.1 src/sys/dev/pci/cmdide.c
cvs rdiff -u -r1.30 -r1.30.18.1 src/sys/dev/pci/cypide.c
cvs rdiff -u -r1.62 -r1.62.4.1 src/sys/dev/pci/pciide_common.c
cvs rdiff -u -r1.27 -r1.27.18.1 src/sys/dev/pci/pdcsata.c
cvs rdiff -u -r1.53 -r1.53.4.1 src/sys/dev/pci/satalink.c
cvs rdiff -u -r1.84 -r1.84.18.1 src/sys/dev/pci/viaide.c
cvs rdiff -u -r1.123 -r1.123.4.1 src/sys/dev/scsipi/atapi_wdc.c

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



CVS commit: src/share/man/man9

2017-04-10 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Mon Apr 10 22:49:35 UTC 2017

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

Log Message:
Bump date for previous.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/share/man/man9/buffercache.9

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

Modified files:

Index: src/share/man/man9/buffercache.9
diff -u src/share/man/man9/buffercache.9:1.31 src/share/man/man9/buffercache.9:1.32
--- src/share/man/man9/buffercache.9:1.31	Mon Apr 10 22:36:14 2017
+++ src/share/man/man9/buffercache.9	Mon Apr 10 22:49:35 2017
@@ -1,4 +1,4 @@
-.\" $NetBSD: buffercache.9,v 1.31 2017/04/10 22:36:14 riastradh Exp $
+.\" $NetBSD: buffercache.9,v 1.32 2017/04/10 22:49:35 maya Exp $
 .\"
 .\" Copyright (c)2003 YAMAMOTO Takashi,
 .\" All rights reserved.
@@ -101,7 +101,7 @@
 .\"
 .\"
 .\" 
-.Dd March 28, 2015
+.Dd April 11, 2017
 .Dt BUFFERCACHE 9
 .Os
 .Sh NAME



CVS commit: src/share/man/man9

2017-04-10 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Mon Apr 10 22:49:35 UTC 2017

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

Log Message:
Bump date for previous.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/share/man/man9/buffercache.9

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



CVS commit: src/share/man/man9

2017-04-10 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon Apr 10 22:36:14 UTC 2017

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

Log Message:
B_DELWRI got renamed BO_DELWRI ages ago.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/share/man/man9/buffercache.9

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

Modified files:

Index: src/share/man/man9/buffercache.9
diff -u src/share/man/man9/buffercache.9:1.30 src/share/man/man9/buffercache.9:1.31
--- src/share/man/man9/buffercache.9:1.30	Mon Apr 20 06:50:13 2015
+++ src/share/man/man9/buffercache.9	Mon Apr 10 22:36:14 2017
@@ -1,4 +1,4 @@
-.\" $NetBSD: buffercache.9,v 1.30 2015/04/20 06:50:13 wiz Exp $
+.\" $NetBSD: buffercache.9,v 1.31 2017/04/10 22:36:14 riastradh Exp $
 .\"
 .\" Copyright (c)2003 YAMAMOTO Takashi,
 .\" All rights reserved.
@@ -253,7 +253,7 @@ Unlike
 .Fn bdwrite
 won't start any I/O.
 It only marks the buffer as dirty
-.Pq Dv B_DELWRI
+.Pq Dv BO_DELWRI
 and unbusy it.
 .\" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 .It Fn getblk "vp" "blkno" "size" "slpflag" "slptimeo"



CVS commit: src/share/man/man9

2017-04-10 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon Apr 10 22:36:14 UTC 2017

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

Log Message:
B_DELWRI got renamed BO_DELWRI ages ago.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/share/man/man9/buffercache.9

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



CVS commit: src/distrib/utils/embedded/conf

2017-04-10 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Apr 10 22:25:36 UTC 2017

Modified Files:
src/distrib/utils/embedded/conf: armv7.conf

Log Message:
tegra: set loadaddr to 0x9000 (the default kernel_addr_r overlaps
fdt_addr_r on TK1 + L4T 21.x), and set default root device to ld0a to
match new device probe order.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/distrib/utils/embedded/conf/armv7.conf

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

Modified files:

Index: src/distrib/utils/embedded/conf/armv7.conf
diff -u src/distrib/utils/embedded/conf/armv7.conf:1.10 src/distrib/utils/embedded/conf/armv7.conf:1.11
--- src/distrib/utils/embedded/conf/armv7.conf:1.10	Sat Dec 19 14:57:49 2015
+++ src/distrib/utils/embedded/conf/armv7.conf	Mon Apr 10 22:25:36 2017
@@ -1,4 +1,4 @@
-# $NetBSD: armv7.conf,v 1.10 2015/12/19 14:57:49 skrll Exp $
+# $NetBSD: armv7.conf,v 1.11 2017/04/10 22:25:36 jmcneill Exp $
 # ARMv7 customization script used by mkimage
 #
 board=armv7
@@ -107,14 +107,15 @@ EOF
 
 populate_tegra() {
 	tegra_kernelimg=netbsd-TEGRA.ub
+	tegra_loadaddr=0x9000
 
 	# Create a boot.scr for Tegra U-Boot
 	cat > "${mnt}/boot/boot-TEGRA.txt" << EOF
-setenv bootargs root=ld1a
-fatload mmc 1:1 \${kernel_addr_r} ${tegra_kernelimg}
+setenv bootargs root=ld0a
+fatload mmc 1:1 ${tegra_loadaddr} ${tegra_kernelimg}
 fatload mmc 1:1 \${fdt_addr_r} tegra124-\${board}.dtb
 fdt addr \${fdt_addr_r}
-bootm \${kernel_addr_r} - \${fdt_addr_r}
+bootm ${tegra_loadaddr} - \${fdt_addr_r}
 EOF
 	"${MKUBOOTIMAGE}" -A arm -C none -O netbsd -T script -a 0 -n "NetBSD/tegra boot" "${mnt}/boot/boot-TEGRA.txt" "${mnt}/boot/boot.scr"
 }



CVS commit: src/distrib/utils/embedded/conf

2017-04-10 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Apr 10 22:25:36 UTC 2017

Modified Files:
src/distrib/utils/embedded/conf: armv7.conf

Log Message:
tegra: set loadaddr to 0x9000 (the default kernel_addr_r overlaps
fdt_addr_r on TK1 + L4T 21.x), and set default root device to ld0a to
match new device probe order.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/distrib/utils/embedded/conf/armv7.conf

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



CVS commit: src/sys/dev/scsipi

2017-04-10 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Mon Apr 10 21:53:37 UTC 2017

Modified Files:
src/sys/dev/scsipi: scsipiconf.c

Log Message:
just do not autoload scsiverbose module, it causes deadlock if it happens
while root fs is being mounted

adresses second part of PR kern/52147 by Michael van Elst, thank you


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.43 src/sys/dev/scsipi/scsipiconf.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/scsipi/scsipiconf.c
diff -u src/sys/dev/scsipi/scsipiconf.c:1.42 src/sys/dev/scsipi/scsipiconf.c:1.43
--- src/sys/dev/scsipi/scsipiconf.c:1.42	Sun Nov 20 15:37:19 2016
+++ src/sys/dev/scsipi/scsipiconf.c	Mon Apr 10 21:53:37 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: scsipiconf.c,v 1.42 2016/11/20 15:37:19 mlelstv Exp $	*/
+/*	$NetBSD: scsipiconf.c,v 1.43 2017/04/10 21:53:37 jdolecek Exp $	*/
 
 /*-
  * Copyright (c) 1998, 1999, 2004 The NetBSD Foundation, Inc.
@@ -48,7 +48,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: scsipiconf.c,v 1.42 2016/11/20 15:37:19 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: scsipiconf.c,v 1.43 2017/04/10 21:53:37 jdolecek Exp $");
 
 #include 
 #include 
@@ -72,7 +72,6 @@ int scsi_verbose_loaded = 0; 
 int
 scsipi_print_sense_stub(struct scsipi_xfer * xs, int verbosity)
 {
-	scsipi_load_verbose();
 	if (scsi_verbose_loaded)
 		return scsipi_print_sense(xs, verbosity);
 	else
@@ -82,7 +81,6 @@ scsipi_print_sense_stub(struct scsipi_xf
 void
 scsipi_print_sense_data_stub(struct scsi_sense_data *sense, int verbosity)
 {
-	scsipi_load_verbose();
 	if (scsi_verbose_loaded)
 		scsipi_print_sense_data(sense, verbosity);
 }
@@ -110,16 +108,6 @@ scsipi_command(struct scsipi_periph *per
 	return rc;
 }
 
-/* 
- * Load the scsiverbose module
- */   
-void
-scsipi_load_verbose(void)
-{
-	if (scsi_verbose_loaded == 0)
-		module_autoload("scsiverbose", MODULE_CLASS_MISC);
-}
-
 /*
  * allocate and init a scsipi_periph structure for a new device.
  */



CVS commit: src/sys/dev/scsipi

2017-04-10 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Mon Apr 10 21:53:37 UTC 2017

Modified Files:
src/sys/dev/scsipi: scsipiconf.c

Log Message:
just do not autoload scsiverbose module, it causes deadlock if it happens
while root fs is being mounted

adresses second part of PR kern/52147 by Michael van Elst, thank you


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.43 src/sys/dev/scsipi/scsipiconf.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-04-10 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Mon Apr 10 21:36:05 UTC 2017

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

Log Message:
rename allow_fuadpo to allow_dpofua, so it's the same order as the SCSI flag


To generate a diff of this commit:
cvs rdiff -u -r1.95 -r1.96 src/sys/kern/vfs_wapbl.c

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

Modified files:

Index: src/sys/kern/vfs_wapbl.c
diff -u src/sys/kern/vfs_wapbl.c:1.95 src/sys/kern/vfs_wapbl.c:1.96
--- src/sys/kern/vfs_wapbl.c:1.95	Mon Apr 10 21:34:37 2017
+++ src/sys/kern/vfs_wapbl.c	Mon Apr 10 21:36:05 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_wapbl.c,v 1.95 2017/04/10 21:34:37 jdolecek Exp $	*/
+/*	$NetBSD: vfs_wapbl.c,v 1.96 2017/04/10 21:36:05 jdolecek Exp $	*/
 
 /*-
  * Copyright (c) 2003, 2008, 2009 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
 #define WAPBL_INTERNAL
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vfs_wapbl.c,v 1.95 2017/04/10 21:34:37 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_wapbl.c,v 1.96 2017/04/10 21:36:05 jdolecek Exp $");
 
 #include 
 #include 
@@ -71,7 +71,7 @@ __KERNEL_RCSID(0, "$NetBSD: vfs_wapbl.c,
 static struct sysctllog *wapbl_sysctl;
 static int wapbl_flush_disk_cache = 1;
 static int wapbl_verbose_commit = 0;
-static int wapbl_allow_fuadpo = 0; 	/* switched off by default for now */
+static int wapbl_allow_dpofua = 0; 	/* switched off by default for now */
 static int wapbl_journal_iobufs = 4;
 
 static inline size_t wapbl_space_free(size_t, off_t, off_t);
@@ -237,7 +237,7 @@ struct wapbl {
 
 	int wl_dkcache;		/* r: 	disk cache flags */
 #define WAPBL_USE_FUA(wl)	\
-		(wapbl_allow_fuadpo && ISSET((wl)->wl_dkcache, DKCACHE_FUA))
+		(wapbl_allow_dpofua && ISSET((wl)->wl_dkcache, DKCACHE_FUA))
 #define WAPBL_JFLAGS(wl)	\
 		(WAPBL_USE_FUA(wl) ? (wl)->wl_jwrite_flags : 0)
 #define WAPBL_MFLAGS(wl)	\
@@ -356,9 +356,9 @@ wapbl_sysctl_init(void)
 
 	rv = sysctl_createv(_sysctl, 0, , ,
 		   CTLFLAG_PERMANENT|CTLFLAG_READWRITE,
-		   CTLTYPE_INT, "allow_fuadpo",
+		   CTLTYPE_INT, "allow_dpofua",
 		   SYSCTL_DESCR("allow use of FUA/DPO instead of cash flush if available"),
-		   NULL, 0, _allow_fuadpo, 0,
+		   NULL, 0, _allow_dpofua, 0,
 		   CTL_CREATE, CTL_EOL);
 	if (rv)
 		return rv;



CVS commit: src/sys/kern

2017-04-10 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Mon Apr 10 21:36:05 UTC 2017

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

Log Message:
rename allow_fuadpo to allow_dpofua, so it's the same order as the SCSI flag


To generate a diff of this commit:
cvs rdiff -u -r1.95 -r1.96 src/sys/kern/vfs_wapbl.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-04-10 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Mon Apr 10 21:34:37 UTC 2017

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

Log Message:
improve performance of journal writes by parallelizing the I/O - use 4 bufs
by default, add sysctl vfs.wapbl.journal_iobufs to control it

this also removes need to allocate iobuf during commit, so it
might help to avoid deadlock during memory shortages like PR kern/47030


To generate a diff of this commit:
cvs rdiff -u -r1.94 -r1.95 src/sys/kern/vfs_wapbl.c

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

Modified files:

Index: src/sys/kern/vfs_wapbl.c
diff -u src/sys/kern/vfs_wapbl.c:1.94 src/sys/kern/vfs_wapbl.c:1.95
--- src/sys/kern/vfs_wapbl.c:1.94	Mon Apr 10 19:52:38 2017
+++ src/sys/kern/vfs_wapbl.c	Mon Apr 10 21:34:37 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_wapbl.c,v 1.94 2017/04/10 19:52:38 jdolecek Exp $	*/
+/*	$NetBSD: vfs_wapbl.c,v 1.95 2017/04/10 21:34:37 jdolecek Exp $	*/
 
 /*-
  * Copyright (c) 2003, 2008, 2009 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
 #define WAPBL_INTERNAL
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vfs_wapbl.c,v 1.94 2017/04/10 19:52:38 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_wapbl.c,v 1.95 2017/04/10 21:34:37 jdolecek Exp $");
 
 #include 
 #include 
@@ -72,6 +72,7 @@ static struct sysctllog *wapbl_sysctl;
 static int wapbl_flush_disk_cache = 1;
 static int wapbl_verbose_commit = 0;
 static int wapbl_allow_fuadpo = 0; 	/* switched off by default for now */
+static int wapbl_journal_iobufs = 4;
 
 static inline size_t wapbl_space_free(size_t, off_t, off_t);
 
@@ -191,6 +192,8 @@ struct wapbl {
 	char wl_ev_group[EVCNT_STRING_MAX];	/* r	*/
 	struct evcnt wl_ev_commit;		/* l	*/
 	struct evcnt wl_ev_journalwrite;	/* l	*/
+	struct evcnt wl_ev_jbufs_bio_nowait;	/* l	*/
+	struct evcnt wl_ev_jbufs_bio_wait;	/* l	*/
 	struct evcnt wl_ev_metawrite;		/* lm	*/
 	struct evcnt wl_ev_cacheflush;		/* l	*/
 #endif
@@ -228,9 +231,9 @@ struct wapbl {
 	SIMPLEQ_HEAD(, wapbl_entry) wl_entries; /* On disk transaction
 		   accounting */
 
-	u_char *wl_buffer;	/* l:   buffer for wapbl_buffered_write() */
-	daddr_t wl_buffer_dblk;	/* l:   buffer disk block address */
-	size_t wl_buffer_used;	/* l:   buffer current use */
+	/* buffers for wapbl_buffered_write() */
+	TAILQ_HEAD(, buf) wl_iobufs;		/* l: Free or filling bufs */
+	TAILQ_HEAD(, buf) wl_iobufs_busy;	/* l: In-transit bufs */
 
 	int wl_dkcache;		/* r: 	disk cache flags */
 #define WAPBL_USE_FUA(wl)	\
@@ -360,6 +363,15 @@ wapbl_sysctl_init(void)
 	if (rv)
 		return rv;
 
+	rv = sysctl_createv(_sysctl, 0, , ,
+		   CTLFLAG_PERMANENT|CTLFLAG_READWRITE,
+		   CTLTYPE_INT, "journal_iobufs",
+		   SYSCTL_DESCR("count of bufs used for journal I/O (max async count)"),
+		   NULL, 0, _journal_iobufs, 0,
+		   CTL_CREATE, CTL_EOL);
+	if (rv)
+		return rv;
+
 	return rv;
 }
 
@@ -401,6 +413,10 @@ wapbl_evcnt_init(struct wapbl *wl)
 	NULL, wl->wl_ev_group, "commit");
 	evcnt_attach_dynamic(>wl_ev_journalwrite, EVCNT_TYPE_MISC,
 	NULL, wl->wl_ev_group, "journal sync block write");
+	evcnt_attach_dynamic(>wl_ev_jbufs_bio_nowait, EVCNT_TYPE_MISC,
+	NULL, wl->wl_ev_group, "journal I/O bufs no wait");
+	evcnt_attach_dynamic(>wl_ev_jbufs_bio_wait, EVCNT_TYPE_MISC,
+	NULL, wl->wl_ev_group, "journal I/O bufs biowait");
 	evcnt_attach_dynamic(>wl_ev_metawrite, EVCNT_TYPE_MISC,
 	NULL, wl->wl_ev_group, "metadata finished block write");
 	evcnt_attach_dynamic(>wl_ev_cacheflush, EVCNT_TYPE_MISC,
@@ -412,6 +428,8 @@ wapbl_evcnt_free(struct wapbl *wl)
 {
 	evcnt_detach(>wl_ev_commit);
 	evcnt_detach(>wl_ev_journalwrite);
+	evcnt_detach(>wl_ev_jbufs_bio_nowait);
+	evcnt_detach(>wl_ev_jbufs_bio_wait);
 	evcnt_detach(>wl_ev_metawrite);
 	evcnt_detach(>wl_ev_cacheflush);
 }
@@ -605,9 +623,6 @@ wapbl_start(struct wapbl ** wlp, struct 
 	wl->wl_dealloclim = wl->wl_bufbytes_max / mp->mnt_stat.f_bsize / 2;
 	TAILQ_INIT(>wl_dealloclist);
 
-	wl->wl_buffer = wapbl_alloc(MAXPHYS);
-	wl->wl_buffer_used = 0;
-
 	wapbl_inodetrk_init(wl, WAPBL_INODETRK_SIZE);
 
 	wapbl_evcnt_init(wl);
@@ -630,6 +645,25 @@ wapbl_start(struct wapbl ** wlp, struct 
 		wl->wl_wc_scratch = wapbl_alloc(len);
 	}
 
+	TAILQ_INIT(>wl_iobufs);
+	TAILQ_INIT(>wl_iobufs_busy);
+	for (int i = 0; i < wapbl_journal_iobufs; i++) {
+		struct buf *bp;
+
+		if ((bp = geteblk(MAXPHYS)) == NULL)
+			goto errout;
+
+		mutex_enter(_lock);
+		mutex_enter(devvp->v_interlock);
+		bgetvp(devvp, bp);
+		mutex_exit(devvp->v_interlock);
+		mutex_exit(_lock);
+
+		bp->b_dev = devvp->v_rdev;
+
+		TAILQ_INSERT_TAIL(>wl_iobufs, bp, b_wapbllist);
+	}
+
 	/*
 	 * if there was an existing set of unlinked but
 	 * allocated inodes, preserve it in the new
@@ -656,7 +690,13 @@ wapbl_start(struct wapbl ** wlp, struct 
 	wapbl_discard(wl);
 	wapbl_free(wl->wl_wc_scratch, wl->wl_wc_header->wc_len);
 	wapbl_free(wl->wl_wc_header, wl->wl_wc_header->wc_len);
-	

CVS commit: src/sys/kern

2017-04-10 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Mon Apr 10 21:34:37 UTC 2017

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

Log Message:
improve performance of journal writes by parallelizing the I/O - use 4 bufs
by default, add sysctl vfs.wapbl.journal_iobufs to control it

this also removes need to allocate iobuf during commit, so it
might help to avoid deadlock during memory shortages like PR kern/47030


To generate a diff of this commit:
cvs rdiff -u -r1.94 -r1.95 src/sys/kern/vfs_wapbl.c

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



CVS commit: src/sys

2017-04-10 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Mon Apr 10 19:52:38 UTC 2017

Modified Files:
src/sys/kern: vfs_wapbl.c
src/sys/sys: buf.h param.h

Log Message:
change b_wapbllist to TAILQ, to preserve the LRU order


To generate a diff of this commit:
cvs rdiff -u -r1.93 -r1.94 src/sys/kern/vfs_wapbl.c
cvs rdiff -u -r1.127 -r1.128 src/sys/sys/buf.h
cvs rdiff -u -r1.534 -r1.535 src/sys/sys/param.h

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

Modified files:

Index: src/sys/kern/vfs_wapbl.c
diff -u src/sys/kern/vfs_wapbl.c:1.93 src/sys/kern/vfs_wapbl.c:1.94
--- src/sys/kern/vfs_wapbl.c:1.93	Wed Apr  5 20:38:53 2017
+++ src/sys/kern/vfs_wapbl.c	Mon Apr 10 19:52:38 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_wapbl.c,v 1.93 2017/04/05 20:38:53 jdolecek Exp $	*/
+/*	$NetBSD: vfs_wapbl.c,v 1.94 2017/04/10 19:52:38 jdolecek Exp $	*/
 
 /*-
  * Copyright (c) 2003, 2008, 2009 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
 #define WAPBL_INTERNAL
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vfs_wapbl.c,v 1.93 2017/04/05 20:38:53 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_wapbl.c,v 1.94 2017/04/10 19:52:38 jdolecek Exp $");
 
 #include 
 #include 
@@ -199,7 +199,7 @@ struct wapbl {
 	size_t wl_bufcount;	/* m:	Count of buffers in wl_bufs */
 	size_t wl_bcount;	/* m:	Total bcount of wl_bufs */
 
-	LIST_HEAD(, buf) wl_bufs; /* m:	Buffers in current transaction */
+	TAILQ_HEAD(, buf) wl_bufs; /* m: Buffers in current transaction */
 
 	kcondvar_t wl_reclaimable_cv;	/* m (obviously) */
 	size_t wl_reclaimable_bytes; /* m:	Amount of space available for
@@ -542,7 +542,7 @@ wapbl_start(struct wapbl ** wlp, struct 
 	rw_init(>wl_rwlock);
 	mutex_init(>wl_mtx, MUTEX_DEFAULT, IPL_NONE);
 	cv_init(>wl_reclaimable_cv, "wapblrec");
-	LIST_INIT(>wl_bufs);
+	TAILQ_INIT(>wl_bufs);
 	SIMPLEQ_INIT(>wl_entries);
 
 	wl->wl_logvp = vp;
@@ -750,7 +750,7 @@ wapbl_discard(struct wapbl *wl)
 	 */
 	mutex_enter(_lock);
 	mutex_enter(>wl_mtx);
-	while ((bp = LIST_FIRST(>wl_bufs)) != NULL) {
+	while ((bp = TAILQ_FIRST(>wl_bufs)) != NULL) {
 		if (bbusy(bp, 0, 0, >wl_mtx) == 0) {
 			/*
 			 * The buffer will be unlocked and
@@ -791,7 +791,7 @@ wapbl_discard(struct wapbl *wl)
 	KASSERT(wl->wl_bufbytes == 0);
 	KASSERT(wl->wl_bcount == 0);
 	KASSERT(wl->wl_bufcount == 0);
-	KASSERT(LIST_EMPTY(>wl_bufs));
+	KASSERT(TAILQ_EMPTY(>wl_bufs));
 	KASSERT(SIMPLEQ_EMPTY(>wl_entries));
 	KASSERT(wl->wl_inohashcnt == 0);
 	KASSERT(TAILQ_EMPTY(>wl_dealloclist));
@@ -826,7 +826,7 @@ wapbl_stop(struct wapbl *wl, int force)
 	KASSERT(wl->wl_bufbytes == 0);
 	KASSERT(wl->wl_bcount == 0);
 	KASSERT(wl->wl_bufcount == 0);
-	KASSERT(LIST_EMPTY(>wl_bufs));
+	KASSERT(TAILQ_EMPTY(>wl_bufs));
 	KASSERT(wl->wl_dealloccnt == 0);
 	KASSERT(SIMPLEQ_EMPTY(>wl_entries));
 	KASSERT(wl->wl_inohashcnt == 0);
@@ -1180,7 +1180,7 @@ wapbl_add_buf(struct wapbl *wl, struct b
 
 	mutex_enter(>wl_mtx);
 	if (bp->b_flags & B_LOCKED) {
-		LIST_REMOVE(bp, b_wapbllist);
+		TAILQ_REMOVE(>wl_bufs, bp, b_wapbllist);
 		WAPBL_PRINTF(WAPBL_PRINT_BUFFER2,
 		   ("wapbl_add_buf thread %d.%d re-adding buf %p "
 		"with %d bytes %d bcount\n",
@@ -1198,7 +1198,7 @@ wapbl_add_buf(struct wapbl *wl, struct b
 		curproc->p_pid, curlwp->l_lid, bp, bp->b_bufsize,
 		bp->b_bcount));
 	}
-	LIST_INSERT_HEAD(>wl_bufs, bp, b_wapbllist);
+	TAILQ_INSERT_TAIL(>wl_bufs, bp, b_wapbllist);
 	mutex_exit(>wl_mtx);
 
 	bp->b_flags |= B_LOCKED;
@@ -1236,7 +1236,7 @@ wapbl_remove_buf_locked(struct wapbl * w
 	wl->wl_bufcount--;
 	KASSERT((wl->wl_bufcount == 0) == (wl->wl_bufbytes == 0));
 	KASSERT((wl->wl_bufcount == 0) == (wl->wl_bcount == 0));
-	LIST_REMOVE(bp, b_wapbllist);
+	TAILQ_REMOVE(>wl_bufs, bp, b_wapbllist);
 
 	bp->b_flags &= ~B_LOCKED;
 }
@@ -1799,12 +1799,10 @@ wapbl_flush(struct wapbl *wl, int waitfo
 	SIMPLEQ_INSERT_TAIL(>wl_entries, we, we_entries);
 
 	/*
-	 * this flushes bufs in reverse order than they were queued
-	 * it shouldn't matter, but if we care we could use TAILQ instead.
-	 * XXX Note they will get put on the lru queue when they flush
-	 * so we might actually want to change this to preserve order.
+	 * This flushes bufs in order than they were queued, so the LRU
+	 * order is preserved.
 	 */
-	while ((bp = LIST_FIRST(>wl_bufs)) != NULL) {
+	while ((bp = TAILQ_FIRST(>wl_bufs)) != NULL) {
 		if (bbusy(bp, 0, 0, >wl_mtx)) {
 			continue;
 		}
@@ -1969,8 +1967,8 @@ wapbl_print(struct wapbl *wl,
 	if (full) {
 		int cnt = 0;
 		(*pr)("bufs =");
-		LIST_FOREACH(bp, >wl_bufs, b_wapbllist) {
-			if (!LIST_NEXT(bp, b_wapbllist)) {
+		TAILQ_FOREACH(bp, >wl_bufs, b_wapbllist) {
+			if (!TAILQ_NEXT(bp, b_wapbllist)) {
 (*pr)(" %p", bp);
 			} else if ((++cnt % 6) == 0) {
 (*pr)(" %p,\n\t", bp);
@@ -2406,7 +2404,7 @@ wapbl_write_blocks(struct wapbl *wl, off
 
 	KASSERT(rw_write_held(>wl_rwlock));
 
-	bp = LIST_FIRST(>wl_bufs);
+	bp = TAILQ_FIRST(>wl_bufs);
 
 	while (bp) {
 		int cnt;

CVS commit: src/sys

2017-04-10 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Mon Apr 10 19:52:38 UTC 2017

Modified Files:
src/sys/kern: vfs_wapbl.c
src/sys/sys: buf.h param.h

Log Message:
change b_wapbllist to TAILQ, to preserve the LRU order


To generate a diff of this commit:
cvs rdiff -u -r1.93 -r1.94 src/sys/kern/vfs_wapbl.c
cvs rdiff -u -r1.127 -r1.128 src/sys/sys/buf.h
cvs rdiff -u -r1.534 -r1.535 src/sys/sys/param.h

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



CVS commit: src/sbin/luactl

2017-04-10 Thread Sevan Janiyan
Module Name:src
Committed By:   sevan
Date:   Mon Apr 10 19:49:39 UTC 2017

Modified Files:
src/sbin/luactl: luactl.8

Log Message:
Direct reader to intro(9lua), lua(9) does not exist.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sbin/luactl/luactl.8

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

Modified files:

Index: src/sbin/luactl/luactl.8
diff -u src/sbin/luactl/luactl.8:1.6 src/sbin/luactl/luactl.8:1.7
--- src/sbin/luactl/luactl.8:1.6	Sun Sep 11 23:07:50 2016
+++ src/sbin/luactl/luactl.8	Mon Apr 10 19:49:39 2017
@@ -1,4 +1,4 @@
-.\" $NetBSD: luactl.8,v 1.6 2016/09/11 23:07:50 sevan Exp $
+.\" $NetBSD: luactl.8,v 1.7 2017/04/10 19:49:39 sevan Exp $
 .\"
 .\" Copyright (c) 2011, 2013 Marc Balmer 
 .\"
@@ -14,7 +14,7 @@
 .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 .\"
-.Dd October 17, 2013
+.Dd April 10, 2017
 .Dt LUACTL 8
 .Os
 .Sh NAME
@@ -114,7 +114,7 @@ Lua device file.
 .Xr module 7 ,
 .Xr modload 8 ,
 .Xr modunload 8 ,
-.Xr lua 9
+.Xr intro 9lua
 .Sh HISTORY
 The
 .Nm



CVS commit: src/sbin/luactl

2017-04-10 Thread Sevan Janiyan
Module Name:src
Committed By:   sevan
Date:   Mon Apr 10 19:49:39 UTC 2017

Modified Files:
src/sbin/luactl: luactl.8

Log Message:
Direct reader to intro(9lua), lua(9) does not exist.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sbin/luactl/luactl.8

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



CVS commit: src/sys/dev/scsipi

2017-04-10 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Mon Apr 10 18:20:43 UTC 2017

Modified Files:
src/sys/dev/scsipi: sd.c

Log Message:
execute the cache page MODE SENSE with XS_CTL_SILENT; it's pretty normal
for e.g. USB sticks thus showing error is not really useful, and the pretty
printing triggers autoload of scsiverbose module and immediate deadlock when
the DIOCGCACHE call is made by WAPBL during root mount

adresses PR kern/52147 by Michael van Elst


To generate a diff of this commit:
cvs rdiff -u -r1.323 -r1.324 src/sys/dev/scsipi/sd.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/scsipi/sd.c
diff -u src/sys/dev/scsipi/sd.c:1.323 src/sys/dev/scsipi/sd.c:1.324
--- src/sys/dev/scsipi/sd.c:1.323	Wed Apr  5 20:15:49 2017
+++ src/sys/dev/scsipi/sd.c	Mon Apr 10 18:20:43 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: sd.c,v 1.323 2017/04/05 20:15:49 jdolecek Exp $	*/
+/*	$NetBSD: sd.c,v 1.324 2017/04/10 18:20:43 jdolecek Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2003, 2004 The NetBSD Foundation, Inc.
@@ -47,7 +47,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sd.c,v 1.323 2017/04/05 20:15:49 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sd.c,v 1.324 2017/04/10 18:20:43 jdolecek Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_scsi.h"
@@ -1823,7 +1823,7 @@ sd_getcache(struct sd_softc *sd, int *bi
 
 	memset(_sense, 0, sizeof(scsipi_sense));
 	error = sd_mode_sense(sd, SMS_DBD, _sense,
-	sizeof(scsipi_sense.pages.caching_params), 8, 0, );
+	sizeof(scsipi_sense.pages.caching_params), 8, XS_CTL_SILENT, );
 	if (error)
 		return (error);
 
@@ -1852,7 +1852,7 @@ sd_getcache(struct sd_softc *sd, int *bi
 	memset(_sense, 0, sizeof(scsipi_sense));
 	error = sd_mode_sense(sd, SMS_DBD, _sense,
 	sizeof(scsipi_sense.pages.caching_params),
-	SMS_PCTRL_CHANGEABLE|8, 0, );
+	SMS_PCTRL_CHANGEABLE|8, XS_CTL_SILENT, );
 	if (error == 0) {
 		if (big)
 			pages = (void *)(_sense.header.big + 1);



CVS commit: src/sys/dev/scsipi

2017-04-10 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Mon Apr 10 18:20:43 UTC 2017

Modified Files:
src/sys/dev/scsipi: sd.c

Log Message:
execute the cache page MODE SENSE with XS_CTL_SILENT; it's pretty normal
for e.g. USB sticks thus showing error is not really useful, and the pretty
printing triggers autoload of scsiverbose module and immediate deadlock when
the DIOCGCACHE call is made by WAPBL during root mount

adresses PR kern/52147 by Michael van Elst


To generate a diff of this commit:
cvs rdiff -u -r1.323 -r1.324 src/sys/dev/scsipi/sd.c

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



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

2017-04-10 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Apr 10 18:13:46 UTC 2017

Modified Files:
src/external/bsd/bc/bin: Makefile

Log Message:
Add CVSID.


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

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

Modified files:

Index: src/external/bsd/bc/bin/Makefile
diff -u src/external/bsd/bc/bin/Makefile:1.1 src/external/bsd/bc/bin/Makefile:1.2
--- src/external/bsd/bc/bin/Makefile:1.1	Sun Apr  9 22:28:48 2017
+++ src/external/bsd/bc/bin/Makefile	Mon Apr 10 14:13:46 2017
@@ -1,5 +1,9 @@
+#	$NetBSD: Makefile,v 1.2 2017/04/10 18:13:46 christos Exp $
+
 .include 
 
+WARNS=5
+
 PROG=	bc
 BINDIR= /usr/bin
 
@@ -11,10 +15,8 @@ SRCS=	 	global.c load.c util.c execute.c
 
 CPPFLAGS+=	-I. -I${SRCDIR} -D_POSIX_SOURCE
 CFLAGS+=	-funsigned-char
-YFLAGS+=	
 LFLAGS+=	-I8
-YHEADER=1
-WARNS=5
+YHEADER=	1
 
 LDADD+= -ll -ledit -ltermcap
 DPADD+=	${LIBL} ${LIBEDIT} ${LIBTERMCAP}



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

2017-04-10 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Apr 10 18:13:46 UTC 2017

Modified Files:
src/external/bsd/bc/bin: Makefile

Log Message:
Add CVSID.


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

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



CVS commit: src/tests/lib/libc/sys

2017-04-10 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Mon Apr 10 16:45:57 UTC 2017

Modified Files:
src/tests/lib/libc/sys: t_ptrace_wait.c

Log Message:
fork1 and siginfo5 no longer fails on !x86 platforms in t_ptrace_wait*

The PTRACE_FORK operation has been fixed. Patch committed by 

PR kern/52117


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/lib/libc/sys/t_ptrace_wait.c

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

Modified files:

Index: src/tests/lib/libc/sys/t_ptrace_wait.c
diff -u src/tests/lib/libc/sys/t_ptrace_wait.c:1.2 src/tests/lib/libc/sys/t_ptrace_wait.c:1.3
--- src/tests/lib/libc/sys/t_ptrace_wait.c:1.2	Sat Apr  8 00:25:50 2017
+++ src/tests/lib/libc/sys/t_ptrace_wait.c	Mon Apr 10 16:45:57 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_ptrace_wait.c,v 1.2 2017/04/08 00:25:50 kamil Exp $	*/
+/*	$NetBSD: t_ptrace_wait.c,v 1.3 2017/04/10 16:45:57 kamil Exp $	*/
 
 /*-
  * Copyright (c) 2016 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: t_ptrace_wait.c,v 1.2 2017/04/08 00:25:50 kamil Exp $");
+__RCSID("$NetBSD: t_ptrace_wait.c,v 1.3 2017/04/10 16:45:57 kamil Exp $");
 
 #include 
 #include 
@@ -1321,11 +1321,6 @@ ATF_TC_BODY(fork1, tc)
 	ptrace_event_t event;
 	const int elen = sizeof(event);
 
-#if defined(__sparc__) || defined(__alpha__) || defined(__arm__)
-	/* ptrace(2) PTRACE_FORK fails on some platforms */
-	atf_tc_expect_fail("PR kern/52117");
-#endif
-
 	printf("Before forking process PID=%d\n", getpid());
 	ATF_REQUIRE((child = fork()) != -1);
 	if (child == 0) {
@@ -5191,11 +5186,6 @@ ATF_TC_BODY(siginfo5, tc)
 	const int elen = sizeof(event);
 	struct ptrace_siginfo info;
 
-#if defined(__sparc__) || defined(__alpha__) || defined(__arm__)
-	/* ptrace(2) PTRACE_FORK fails on some platforms */
-	atf_tc_expect_fail("PR kern/52117");
-#endif
-
 	memset(, 0, sizeof(info));
 
 	printf("Before forking process PID=%d\n", getpid());



CVS commit: src/tests/lib/libc/sys

2017-04-10 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Mon Apr 10 16:45:57 UTC 2017

Modified Files:
src/tests/lib/libc/sys: t_ptrace_wait.c

Log Message:
fork1 and siginfo5 no longer fails on !x86 platforms in t_ptrace_wait*

The PTRACE_FORK operation has been fixed. Patch committed by 

PR kern/52117


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/lib/libc/sys/t_ptrace_wait.c

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



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

2017-04-10 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Apr 10 16:39:12 UTC 2017

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

Log Message:
PSD docs for dc


To generate a diff of this commit:
cvs rdiff -u -r1.202 -r1.203 src/distrib/sets/lists/misc/mi

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



CVS commit: src/gnu/usr.bin

2017-04-10 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Apr 10 16:40:11 UTC 2017

Modified Files:
src/gnu/usr.bin: Makefile

Log Message:
Don't descend into dc


To generate a diff of this commit:
cvs rdiff -u -r1.147 -r1.148 src/gnu/usr.bin/Makefile

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



CVS commit: src/doc

2017-04-10 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Apr 10 16:44:46 UTC 2017

Modified Files:
src/doc: 3RDPARTY CHANGES

Log Message:
mention new dc


To generate a diff of this commit:
cvs rdiff -u -r1.1428 -r1.1429 src/doc/3RDPARTY
cvs rdiff -u -r1.2269 -r1.2270 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/3RDPARTY
diff -u src/doc/3RDPARTY:1.1428 src/doc/3RDPARTY:1.1429
--- src/doc/3RDPARTY:1.1428	Sun Apr  2 15:37:03 2017
+++ src/doc/3RDPARTY	Mon Apr 10 12:44:46 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.1428 2017/04/02 19:37:03 roy Exp $
+#	$NetBSD: 3RDPARTY,v 1.1429 2017/04/10 16:44:46 christos Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -1689,3 +1689,16 @@ Mailing List:	https://sourceforge.net/pr
 Responsible:
 License:	BSD-like (3-clause)
 Location:	sys/external/bsd/gnu-efi
+
+Package:	dc
+Version:	20170410
+Current Vers:	20170410
+Maintainer:	The OpenBSD Project
+Archive Site:	http://www.openbsd.org/cgi-bin/cvsweb/src/usr.bin/dc
+Home Page:	http://www.openbsd.org/
+Mailing List:	
+License:	BSD
+Responsible:	christos
+Location:	usr.bin/dc
+Notes:
+		Uses OpenSSL's bignum

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.2269 src/doc/CHANGES:1.2270
--- src/doc/CHANGES:1.2269	Fri Apr  7 21:29:31 2017
+++ src/doc/CHANGES	Mon Apr 10 12:44:46 2017
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2269 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2270 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -495,3 +495,4 @@ Changes from NetBSD 7.0 to NetBSD 8.0:
 	dhcpcd(8): Import dhcpcd-7.0.0-beta2 [roy 20170402]
 	ptrace(2): Add operations to single step specified threads:
 		PT_SETSTEP and PT_CLEARSTEP [kamil 20170408]
+	dc(1): Import from OpenBSD (replaced GPL version) [christos 20170410]



CVS commit: src/gnu/usr.bin

2017-04-10 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Apr 10 16:40:11 UTC 2017

Modified Files:
src/gnu/usr.bin: Makefile

Log Message:
Don't descend into dc


To generate a diff of this commit:
cvs rdiff -u -r1.147 -r1.148 src/gnu/usr.bin/Makefile

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

Modified files:

Index: src/gnu/usr.bin/Makefile
diff -u src/gnu/usr.bin/Makefile:1.147 src/gnu/usr.bin/Makefile:1.148
--- src/gnu/usr.bin/Makefile:1.147	Sun Apr  9 22:57:35 2017
+++ src/gnu/usr.bin/Makefile	Mon Apr 10 12:40:11 2017
@@ -1,7 +1,5 @@
-#	$NetBSD: Makefile,v 1.147 2017/04/10 02:57:35 phil Exp $
+#	$NetBSD: Makefile,v 1.148 2017/04/10 16:40:11 christos Exp $
 
 .include 
 
-SUBDIR+=	dc
-
 .include 



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

2017-04-10 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Apr 10 16:39:12 UTC 2017

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

Log Message:
PSD docs for dc


To generate a diff of this commit:
cvs rdiff -u -r1.202 -r1.203 src/distrib/sets/lists/misc/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/misc/mi
diff -u src/distrib/sets/lists/misc/mi:1.202 src/distrib/sets/lists/misc/mi:1.203
--- src/distrib/sets/lists/misc/mi:1.202	Thu Feb  9 08:26:56 2017
+++ src/distrib/sets/lists/misc/mi	Mon Apr 10 12:39:12 2017
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.202 2017/02/09 13:26:56 szptvlfn Exp $
+# $NetBSD: mi,v 1.203 2017/04/10 16:39:12 christos Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -584,6 +584,8 @@
 ./usr/share/doc/reference/ref1/csh/csh7.png			misc-usd-doc		doc,html,groffhtmldoc
 ./usr/share/doc/reference/ref1/csh/csh8.png			misc-usd-doc		doc,html,groffhtmldoc
 ./usr/share/doc/reference/ref1/csh/csh9.png			misc-usd-doc		doc,html,groffhtmldoc
+./usr/share/doc/reference/ref1/dc/dc.ps.gz			misc-usd-doc		doc
+./usr/share/doc/reference/ref1/dc/dc.txt			misc-usd-doc		doc
 ./usr/share/doc/reference/ref1/ex/reference.html		misc-usd-doc		doc,html,groffhtmldoc
 ./usr/share/doc/reference/ref1/ex/reference.ps.gz		misc-usd-doc		doc
 ./usr/share/doc/reference/ref1/ex/reference.txt			misc-usd-doc		doc



CVS commit: src/doc

2017-04-10 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Apr 10 16:44:46 UTC 2017

Modified Files:
src/doc: 3RDPARTY CHANGES

Log Message:
mention new dc


To generate a diff of this commit:
cvs rdiff -u -r1.1428 -r1.1429 src/doc/3RDPARTY
cvs rdiff -u -r1.2269 -r1.2270 src/doc/CHANGES

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



CVS commit: src/etc/mtree

2017-04-10 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Apr 10 16:38:40 UTC 2017

Modified Files:
src/etc/mtree: NetBSD.dist.base

Log Message:
Add dc docs


To generate a diff of this commit:
cvs rdiff -u -r1.158 -r1.159 src/etc/mtree/NetBSD.dist.base

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



CVS commit: src/usr.bin

2017-04-10 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Apr 10 16:38:19 UTC 2017

Modified Files:
src/usr.bin: Makefile

Log Message:
switch to the OpenBSD dc


To generate a diff of this commit:
cvs rdiff -u -r1.227 -r1.228 src/usr.bin/Makefile

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



CVS commit: src/etc/mtree

2017-04-10 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Apr 10 16:38:40 UTC 2017

Modified Files:
src/etc/mtree: NetBSD.dist.base

Log Message:
Add dc docs


To generate a diff of this commit:
cvs rdiff -u -r1.158 -r1.159 src/etc/mtree/NetBSD.dist.base

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

Modified files:

Index: src/etc/mtree/NetBSD.dist.base
diff -u src/etc/mtree/NetBSD.dist.base:1.158 src/etc/mtree/NetBSD.dist.base:1.159
--- src/etc/mtree/NetBSD.dist.base:1.158	Mon Feb 13 20:11:27 2017
+++ src/etc/mtree/NetBSD.dist.base	Mon Apr 10 12:38:40 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: NetBSD.dist.base,v 1.158 2017/02/14 01:11:27 christos Exp $
+#	$NetBSD: NetBSD.dist.base,v 1.159 2017/04/10 16:38:40 christos Exp $
 #	@(#)4.4BSD.dist	8.1 (Berkeley) 6/13/93
 
 # Do not customize this file as it may be overwritten on upgrades.
@@ -294,6 +294,7 @@
 ./usr/share/doc/reference/ref1
 ./usr/share/doc/reference/ref1/atf
 ./usr/share/doc/reference/ref1/bzip2
+./usr/share/doc/reference/ref1/dc
 ./usr/share/doc/reference/ref1/config
 ./usr/share/doc/reference/ref1/csh
 ./usr/share/doc/reference/ref1/ex



CVS commit: src/usr.bin

2017-04-10 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Apr 10 16:38:19 UTC 2017

Modified Files:
src/usr.bin: Makefile

Log Message:
switch to the OpenBSD dc


To generate a diff of this commit:
cvs rdiff -u -r1.227 -r1.228 src/usr.bin/Makefile

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

Modified files:

Index: src/usr.bin/Makefile
diff -u src/usr.bin/Makefile:1.227 src/usr.bin/Makefile:1.228
--- src/usr.bin/Makefile:1.227	Mon Feb  6 11:04:07 2017
+++ src/usr.bin/Makefile	Mon Apr 10 12:38:19 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.227 2017/02/06 16:04:07 christos Exp $
+#	$NetBSD: Makefile,v 1.228 2017/04/10 16:38:19 christos Exp $
 #	from: @(#)Makefile	8.3 (Berkeley) 1/7/94
 
 .include 
@@ -8,7 +8,7 @@ SUBDIR= apply asa at audio audiocfg \
 	bzip2 bzip2recover c11 c89 c99 cal calendar cap_mkdb cdplay \
 	checknr chflags chpass cksum cmp cleantags col colcrt colrm \
 	column comm compress config crunch csplit ctags cut cvslatest \
-	deroff db dirname du \
+	dc deroff db dirname du \
 	eject elf2aout elf2ecoff env error expand extattr \
 	false fdformat fgen fincore find finger flock fmt fold fpr from \
 	fsplit fstat ftp gcore genassym gencat getaddrinfo getconf getent \



CVS commit: src/usr.bin/dc

2017-04-10 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Apr 10 16:37:49 UTC 2017

Modified Files:
src/usr.bin/dc: Makefile bcode.c dc.1 dc.c inout.c main.c mem.c stack.c
src/usr.bin/dc/USD.doc: Makefile
Added Files:
src/usr.bin/dc: misc.c

Log Message:
build fixes.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 src/usr.bin/dc/Makefile src/usr.bin/dc/bcode.c \
src/usr.bin/dc/dc.1 src/usr.bin/dc/dc.c src/usr.bin/dc/inout.c \
src/usr.bin/dc/main.c src/usr.bin/dc/mem.c src/usr.bin/dc/stack.c
cvs rdiff -u -r0 -r1.1 src/usr.bin/dc/misc.c
cvs rdiff -u -r1.1.1.1 -r1.2 src/usr.bin/dc/USD.doc/Makefile

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

Modified files:

Index: src/usr.bin/dc/Makefile
diff -u src/usr.bin/dc/Makefile:1.1.1.1 src/usr.bin/dc/Makefile:1.2
--- src/usr.bin/dc/Makefile:1.1.1.1	Mon Apr 10 12:34:18 2017
+++ src/usr.bin/dc/Makefile	Mon Apr 10 12:37:48 2017
@@ -1,9 +1,25 @@
-#	$OpenBSD: Makefile,v 1.3 2015/10/10 19:28:54 deraadt Exp $
+#	$NetBSD: Makefile,v 1.2 2017/04/10 16:37:48 christos Exp $
+
+.include 
 
 PROG=	dc
 SRCS=	main.c dc.c bcode.c inout.c mem.c stack.c
-COPTS+= -Wall
+
+.if ${MKCRYPTO:Uno} == "yes"
+WARNS=6
 LDADD=	-lcrypto
 DPADD=	${LIBCRYPTO}
+.else
+OPENSSL=${NETBSDSRCDIR}/crypto/external/bsd/openssl/dist
+.PATH: ${OPENSSL}/crypto/bn
+CPPFLAGS+=-I${OPENSSL} -I${OPENSSL}/crypto
+SRCS+= bn_lib.c bn_add.c bn_mul.c bn_div.c bn_asm.c bn_word.c bn_shift.c
+SRCS+= bn_ctx.c bn_exp.c bn_mod.c bn_sqr.c bn_mont.c bn_recp.c bn_gcd.c
+SRCS+= misc.c
+COPTS.bn_lib.c += -Wno-cast-qual
+.endif
+
+SUBDIR+=USD.doc
 
 .include 
+.include 
Index: src/usr.bin/dc/bcode.c
diff -u src/usr.bin/dc/bcode.c:1.1.1.1 src/usr.bin/dc/bcode.c:1.2
--- src/usr.bin/dc/bcode.c:1.1.1.1	Mon Apr 10 12:34:18 2017
+++ src/usr.bin/dc/bcode.c	Mon Apr 10 12:37:48 2017
@@ -1,3 +1,4 @@
+/*	$NetBSD: bcode.c,v 1.2 2017/04/10 16:37:48 christos Exp $	*/
 /*	$OpenBSD: bcode.c,v 1.51 2017/02/26 11:29:55 otto Exp $	*/
 
 /*
@@ -15,6 +16,8 @@
  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
+#include 
+__RCSID("$NetBSD: bcode.c,v 1.2 2017/04/10 16:37:48 christos Exp $");
 
 #include 
 #include 
@@ -227,7 +230,7 @@ sighandler(int ignored)
 void
 init_bmachine(bool extended_registers)
 {
-	int i;
+	size_t i;
 
 	bmachine.extended_regs = extended_registers;
 	bmachine.reg_array_size = bmachine.extended_regs ?
@@ -342,12 +345,12 @@ static unsigned long factors[] = {
 void
 scale_number(BIGNUM *n, int s)
 {
-	int abs_scale;
+	size_t abs_scale;
 
 	if (s == 0)
 		return;
 
-	abs_scale = s > 0 ? s : -s;
+	abs_scale = (size_t)(s > 0 ? s : -s);
 
 	if (abs_scale < sizeof(factors)/sizeof(factors[0])) {
 		if (s > 0)
@@ -415,7 +418,7 @@ split_number(const struct number *n, BIG
 void
 normalize(struct number *n, u_int s)
 {
-	scale_number(n->number, s - n->scale);
+	scale_number(n->number, (int)(s - n->scale));
 	n->scale = s;
 }
 
@@ -785,7 +788,7 @@ readreg(void)
 		} else
 			idx = (ch1 << 8) + ch2 + UCHAR_MAX + 1;
 	}
-	if (idx < 0 || idx >= bmachine.reg_array_size) {
+	if (idx < 0 || (size_t)idx >= bmachine.reg_array_size) {
 		warnx("internal error: reg num = %d", idx);
 		idx = -1;
 	}
@@ -1244,7 +1247,7 @@ bexp(void)
 			bn_check(BN_one(one));
 			ctx = BN_CTX_new();
 			bn_checkp(ctx);
-			scale_number(one, r->scale + rscale);
+			scale_number(one, (int)(r->scale + rscale));
 
 			if (BN_is_zero(r->number))
 warnx("divide by zero");
@@ -1683,11 +1686,10 @@ eval_string(char *p)
 	}
 	if (bmachine.readsp == bmachine.readstack_sz - 1) {
 		size_t newsz = bmachine.readstack_sz * 2;
-		struct source *stack;
-		stack = reallocarray(bmachine.readstack, newsz,
-		sizeof(struct source));
-		if (stack == NULL)
-			err(1, "recursion too deep");
+		struct source *stack = bmachine.readstack;
+		int ret = reallocarr(, newsz, sizeof(struct source));
+		if (ret)
+			errc(1, ret, "recursion too deep");
 		bmachine.readstack_sz = newsz;
 		bmachine.readstack = stack;
 	}
Index: src/usr.bin/dc/dc.1
diff -u src/usr.bin/dc/dc.1:1.1.1.1 src/usr.bin/dc/dc.1:1.2
--- src/usr.bin/dc/dc.1:1.1.1.1	Mon Apr 10 12:34:18 2017
+++ src/usr.bin/dc/dc.1	Mon Apr 10 12:37:48 2017
@@ -1,3 +1,4 @@
+.\"	$NetBSD: dc.1,v 1.2 2017/04/10 16:37:48 christos Exp $
 .\"	$OpenBSD: dc.1,v 1.30 2017/02/23 06:40:17 otto Exp $
 .\"
 .\" Copyright (C) Caldera International Inc.  2001-2002.
@@ -34,7 +35,7 @@
 .\"
 .\"	@(#)dc.1	8.1 (Berkeley) 6/6/93
 .\"
-.Dd $Mdocdate: February 23 2017 $
+.Dd February 23, 2017
 .Dt DC 1
 .Os
 .Sh NAME
Index: src/usr.bin/dc/dc.c
diff -u src/usr.bin/dc/dc.c:1.1.1.1 src/usr.bin/dc/dc.c:1.2
--- src/usr.bin/dc/dc.c:1.1.1.1	Mon Apr 10 12:34:18 2017
+++ src/usr.bin/dc/dc.c	Mon Apr 10 12:37:48 2017
@@ -1,3 +1,4 @@
+/*	$NetBSD: dc.c,v 1.2 2017/04/10 16:37:48 christos Exp $	*/
 /*	$OpenBSD: dc.c,v 1.18 2016/07/17 17:30:47 otto Exp $	*/
 
 /*

CVS commit: src/usr.bin/dc

2017-04-10 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Apr 10 16:37:49 UTC 2017

Modified Files:
src/usr.bin/dc: Makefile bcode.c dc.1 dc.c inout.c main.c mem.c stack.c
src/usr.bin/dc/USD.doc: Makefile
Added Files:
src/usr.bin/dc: misc.c

Log Message:
build fixes.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 src/usr.bin/dc/Makefile src/usr.bin/dc/bcode.c \
src/usr.bin/dc/dc.1 src/usr.bin/dc/dc.c src/usr.bin/dc/inout.c \
src/usr.bin/dc/main.c src/usr.bin/dc/mem.c src/usr.bin/dc/stack.c
cvs rdiff -u -r0 -r1.1 src/usr.bin/dc/misc.c
cvs rdiff -u -r1.1.1.1 -r1.2 src/usr.bin/dc/USD.doc/Makefile

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



CVS import: src/usr.bin/dc

2017-04-10 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Apr 10 16:34:18 UTC 2017

Update of /cvsroot/src/usr.bin/dc
In directory ivanova.netbsd.org:/tmp/cvs-serv29455

Log Message:
Import OpenBSD's dc.

Status:

Vendor Tag: OPENBSD
Release Tags:   OpenBSD-20170410

N src/usr.bin/dc/bcode.c
N src/usr.bin/dc/dc.1
N src/usr.bin/dc/dc.c
N src/usr.bin/dc/bcode.h
N src/usr.bin/dc/inout.c
N src/usr.bin/dc/mem.c
N src/usr.bin/dc/extern.h
N src/usr.bin/dc/stack.c
N src/usr.bin/dc/Makefile
N src/usr.bin/dc/main.c
N src/usr.bin/dc/USD.doc/Makefile
N src/usr.bin/dc/USD.doc/dc

No conflicts created by this import



CVS import: src/usr.bin/dc

2017-04-10 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Apr 10 16:34:18 UTC 2017

Update of /cvsroot/src/usr.bin/dc
In directory ivanova.netbsd.org:/tmp/cvs-serv29455

Log Message:
Import OpenBSD's dc.

Status:

Vendor Tag: OPENBSD
Release Tags:   OpenBSD-20170410

N src/usr.bin/dc/bcode.c
N src/usr.bin/dc/dc.1
N src/usr.bin/dc/dc.c
N src/usr.bin/dc/bcode.h
N src/usr.bin/dc/inout.c
N src/usr.bin/dc/mem.c
N src/usr.bin/dc/extern.h
N src/usr.bin/dc/stack.c
N src/usr.bin/dc/Makefile
N src/usr.bin/dc/main.c
N src/usr.bin/dc/USD.doc/Makefile
N src/usr.bin/dc/USD.doc/dc

No conflicts created by this import



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

2017-04-10 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Apr 10 15:13:22 UTC 2017

Modified Files:
src/external/bsd/bc/dist: proto.h

Log Message:
Add missing attributes to fix clang compilation


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/external/bsd/bc/dist/proto.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/bsd/bc/dist/proto.h
diff -u src/external/bsd/bc/dist/proto.h:1.1 src/external/bsd/bc/dist/proto.h:1.2
--- src/external/bsd/bc/dist/proto.h:1.1	Sun Apr  9 22:28:23 2017
+++ src/external/bsd/bc/dist/proto.h	Mon Apr 10 11:13:22 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: proto.h,v 1.1 2017/04/10 02:28:23 phil Exp $ */
+/*	$NetBSD: proto.h,v 1.2 2017/04/10 15:13:22 christos Exp $ */
 
 /*
  * Copyright (C) 1991-1994, 1997, 2006, 2008, 2012-2017 Free Software Foundation, Inc.
@@ -80,16 +80,20 @@ int insert_id_rec (id_rec **root, id_rec
 void init_tree (void);
 int lookup (char *name, int namekind);
 void *bc_malloc (size_t);
-void out_of_memory (void);
+void out_of_memory (void) __attribute__((__noreturn__));
 void welcome (void);
 void warranty (const char *);
 void show_bc_version (void);
 void limits (void);
-void yyerror (const char *str ,...);
-void ct_warn (const char *mesg ,...);
-void rt_error (const char *mesg ,...);
-void rt_warn (const char *mesg ,...);
-void bc_exit (int);
+void yyerror (const char *str, ...)
+__attribute__((__format__ (__printf__, 1, 2)));
+void ct_warn (const char *mesg, ...)
+__attribute__((__format__ (__printf__, 1, 2)));
+void rt_error (const char *mesg, ...)
+__attribute__((__format__ (__printf__, 1, 2)));
+void rt_warn (const char *mesg, ...)
+__attribute__((__format__ (__printf__, 1, 2)));
+void bc_exit (int) __attribute__((__noreturn__));
 
 /* From load.c */
 void init_load (void);
@@ -101,7 +105,7 @@ void load_code (const char *code);
 /* From main.c */
 int open_new_file (void);
 void new_yy_file (FILE *file);
-void use_quit (int);
+void use_quit (int) __attribute__((__noreturn__));
 
 /* From storage.c */
 void init_storage (void);



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

2017-04-10 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Apr 10 15:13:22 UTC 2017

Modified Files:
src/external/bsd/bc/dist: proto.h

Log Message:
Add missing attributes to fix clang compilation


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

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



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

2017-04-10 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Apr 10 15:13:04 UTC 2017

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

Log Message:
Add missign % (yyerror argument is a printf format)


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

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

Modified files:

Index: src/external/bsd/bc/dist/bc.y
diff -u src/external/bsd/bc/dist/bc.y:1.1 src/external/bsd/bc/dist/bc.y:1.2
--- src/external/bsd/bc/dist/bc.y:1.1	Sun Apr  9 22:28:23 2017
+++ src/external/bsd/bc/dist/bc.y	Mon Apr 10 11:13:04 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: bc.y,v 1.1 2017/04/10 02:28:23 phil Exp $ */
+/*	$NetBSD: bc.y,v 1.2 2017/04/10 15:13:04 christos Exp $ */
 
 /*
  * Copyright (C) 1991-1994, 1997, 2006, 2008, 2012-2017 Free Software Foundation, Inc.
@@ -618,7 +618,7 @@ expression		:  named_expression ASSIGN_O
 			| expression '%' expression
 			{
 			  if (($1 & EX_VOID) || ($3 & EX_VOID))
-yyerror ("void expression with %");
+yyerror ("void expression with %%");
 			  generate ("%");
 			  $$ = ($1 | $3) & ~EX_PAREN;
 			}



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

2017-04-10 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Apr 10 15:13:04 UTC 2017

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

Log Message:
Add missign % (yyerror argument is a printf format)


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

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



CVS commit: src/sys/compat

2017-04-10 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Mon Apr 10 15:04:32 UTC 2017

Modified Files:
src/sys/compat/linux/common: linux_futex.c linux_futex.h
src/sys/compat/linux32/common: linux32_misc.c

Log Message:
Return value pointers should be the last argument.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/sys/compat/linux/common/linux_futex.c
cvs rdiff -u -r1.7 -r1.8 src/sys/compat/linux/common/linux_futex.h
cvs rdiff -u -r1.25 -r1.26 src/sys/compat/linux32/common/linux32_misc.c

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



CVS commit: src/sys/compat

2017-04-10 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Mon Apr 10 15:04:32 UTC 2017

Modified Files:
src/sys/compat/linux/common: linux_futex.c linux_futex.h
src/sys/compat/linux32/common: linux32_misc.c

Log Message:
Return value pointers should be the last argument.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/sys/compat/linux/common/linux_futex.c
cvs rdiff -u -r1.7 -r1.8 src/sys/compat/linux/common/linux_futex.h
cvs rdiff -u -r1.25 -r1.26 src/sys/compat/linux32/common/linux32_misc.c

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

Modified files:

Index: src/sys/compat/linux/common/linux_futex.c
diff -u src/sys/compat/linux/common/linux_futex.c:1.36 src/sys/compat/linux/common/linux_futex.c:1.37
--- src/sys/compat/linux/common/linux_futex.c:1.36	Sun Apr  9 00:02:30 2017
+++ src/sys/compat/linux/common/linux_futex.c	Mon Apr 10 15:04:32 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux_futex.c,v 1.36 2017/04/09 00:02:30 dholland Exp $ */
+/*	$NetBSD: linux_futex.c,v 1.37 2017/04/10 15:04:32 dholland Exp $ */
 
 /*-
  * Copyright (c) 2005 Emmanuel Dreyfus, all rights reserved.
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(1, "$NetBSD: linux_futex.c,v 1.36 2017/04/09 00:02:30 dholland Exp $");
+__KERNEL_RCSID(1, "$NetBSD: linux_futex.c,v 1.37 2017/04/10 15:04:32 dholland Exp $");
 
 #include 
 #include 
@@ -135,12 +135,15 @@ linux_sys_futex(struct lwp *l, const str
 		}
 		linux_to_native_timespec(, );
 	}
-	return linux_do_futex(l, uap, retval, );
+	return linux_do_futex(l, uap, , retval);
 }
 
+/*
+ * Note: TS can't be const because ts2timo destroys it.
+ */
 int
 linux_do_futex(struct lwp *l, const struct linux_sys_futex_args *uap,
-	register_t *retval, struct timespec *ts)
+	struct timespec *ts, register_t *retval)
 {
 	/* {
 		syscallarg(int *) uaddr;

Index: src/sys/compat/linux/common/linux_futex.h
diff -u src/sys/compat/linux/common/linux_futex.h:1.7 src/sys/compat/linux/common/linux_futex.h:1.8
--- src/sys/compat/linux/common/linux_futex.h:1.7	Tue Apr 16 23:03:05 2013
+++ src/sys/compat/linux/common/linux_futex.h	Mon Apr 10 15:04:32 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux_futex.h,v 1.7 2013/04/16 23:03:05 christos Exp $ */
+/*	$NetBSD: linux_futex.h,v 1.8 2017/04/10 15:04:32 dholland Exp $ */
 
 /*-
  * Copyright (c) 2005 Emmanuel Dreyfus, all rights reserved.
@@ -86,7 +86,7 @@ struct linux_robust_list_head {
 void	release_futexes(struct lwp *);
 struct linux_sys_futex_args;
 int	linux_do_futex(struct lwp *, const struct linux_sys_futex_args *,
-		   register_t *, struct timespec *);
+		   struct timespec *, register_t *);
 void	linux_futex_init(void);
 void	linux_futex_fini(void);
 

Index: src/sys/compat/linux32/common/linux32_misc.c
diff -u src/sys/compat/linux32/common/linux32_misc.c:1.25 src/sys/compat/linux32/common/linux32_misc.c:1.26
--- src/sys/compat/linux32/common/linux32_misc.c:1.25	Sat Nov 22 13:12:22 2014
+++ src/sys/compat/linux32/common/linux32_misc.c	Mon Apr 10 15:04:32 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux32_misc.c,v 1.25 2014/11/22 13:12:22 njoly Exp $	*/
+/*	$NetBSD: linux32_misc.c,v 1.26 2017/04/10 15:04:32 dholland Exp $	*/
 
 /*-
  * Copyright (c) 1995, 1998, 1999 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: linux32_misc.c,v 1.25 2014/11/22 13:12:22 njoly Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux32_misc.c,v 1.26 2017/04/10 15:04:32 dholland Exp $");
 
 #include 
 #include 
@@ -262,7 +262,7 @@ linux32_sys_futex(struct lwp *l,
 		}
 		linux32_to_native_timespec(, );
 	}
-	return linux_do_futex(l, , retval, );
+	return linux_do_futex(l, , , retval);
 }
 
 int



CVS commit: src/lib/libedit

2017-04-10 Thread Abhinav Upadhyay
Module Name:src
Committed By:   abhinav
Date:   Mon Apr 10 15:02:40 UTC 2017

Modified Files:
src/lib/libedit: editline.3

Log Message:
Add missing argument for H_SET.

ok christos@


To generate a diff of this commit:
cvs rdiff -u -r1.92 -r1.93 src/lib/libedit/editline.3

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



CVS commit: src/lib/libedit

2017-04-10 Thread Abhinav Upadhyay
Module Name:src
Committed By:   abhinav
Date:   Mon Apr 10 15:02:40 UTC 2017

Modified Files:
src/lib/libedit: editline.3

Log Message:
Add missing argument for H_SET.

ok christos@


To generate a diff of this commit:
cvs rdiff -u -r1.92 -r1.93 src/lib/libedit/editline.3

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

Modified files:

Index: src/lib/libedit/editline.3
diff -u src/lib/libedit/editline.3:1.92 src/lib/libedit/editline.3:1.93
--- src/lib/libedit/editline.3:1.92	Sun May 22 23:54:20 2016
+++ src/lib/libedit/editline.3	Mon Apr 10 15:02:40 2017
@@ -1,4 +1,4 @@
-.\"	$NetBSD: editline.3,v 1.92 2016/05/22 23:54:20 christos Exp $
+.\"	$NetBSD: editline.3,v 1.93 2017/04/10 15:02:40 abhinav Exp $
 .\"
 .\" Copyright (c) 1997-2014 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -786,7 +786,7 @@ Return the next element in the history.
 It is older than the current one.
 .It Dv H_CURR
 Return the current element in the history.
-.It Dv H_SET
+.It Dv H_SET , Fa "int position"
 Set the cursor to point to the requested element.
 .It Dv H_ADD , Fa "const char *str"
 Append



CVS commit: src/sys/netipsec

2017-04-10 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Apr 10 14:19:23 UTC 2017

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

Log Message:
PR/52150: Ryota Ozaki: ipsec: kernel panic on adding a key with an invalid
length.


To generate a diff of this commit:
cvs rdiff -u -r1.47 -r1.48 src/sys/netipsec/xform_esp.c

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

Modified files:

Index: src/sys/netipsec/xform_esp.c
diff -u src/sys/netipsec/xform_esp.c:1.47 src/sys/netipsec/xform_esp.c:1.48
--- src/sys/netipsec/xform_esp.c:1.47	Thu Apr  6 05:20:07 2017
+++ src/sys/netipsec/xform_esp.c	Mon Apr 10 10:19:22 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: xform_esp.c,v 1.47 2017/04/06 09:20:07 ozaki-r Exp $	*/
+/*	$NetBSD: xform_esp.c,v 1.48 2017/04/10 14:19:22 christos Exp $	*/
 /*	$FreeBSD: src/sys/netipsec/xform_esp.c,v 1.2.2.1 2003/01/24 05:11:36 sam Exp $	*/
 /*	$OpenBSD: ip_esp.c,v 1.69 2001/06/26 06:18:59 angelos Exp $ */
 
@@ -39,7 +39,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: xform_esp.c,v 1.47 2017/04/06 09:20:07 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xform_esp.c,v 1.48 2017/04/10 14:19:22 christos Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_inet.h"
@@ -183,31 +183,31 @@ static int
 esp_init(struct secasvar *sav, const struct xformsw *xsp)
 {
 	const struct enc_xform *txform;
-	struct cryptoini cria, crie;
+	struct cryptoini cria, crie, *cr;
 	int keylen;
 	int error;
 
 	txform = esp_algorithm_lookup(sav->alg_enc);
 	if (txform == NULL) {
-		DPRINTF(("esp_init: unsupported encryption algorithm %d\n",
-			sav->alg_enc));
+		DPRINTF(("%s: unsupported encryption algorithm %d\n", __func__,
+		sav->alg_enc));
 		return EINVAL;
 	}
 	if (sav->key_enc == NULL) {
-		DPRINTF(("esp_init: no encoding key for %s algorithm\n",
-			 txform->name));
+		DPRINTF(("%s: no encoding key for %s algorithm\n", __func__,
+		txform->name));
 		return EINVAL;
 	}
 	if ((sav->flags&(SADB_X_EXT_OLD|SADB_X_EXT_IV4B)) == SADB_X_EXT_IV4B) {
-		DPRINTF(("esp_init: 4-byte IV not supported with protocol\n"));
+		DPRINTF(("%s: 4-byte IV not supported with protocol\n",
+		__func__));
 		return EINVAL;
 	}
 	keylen = _KEYLEN(sav->key_enc);
 	if (txform->minkey > keylen || keylen > txform->maxkey) {
-		DPRINTF(("esp_init: invalid key length %u, must be in "
-			"the range [%u..%u] for algorithm %s\n",
-			keylen, txform->minkey, txform->maxkey,
-			txform->name));
+		DPRINTF(("%s: invalid key length %u, must be in "
+		"the range [%u..%u] for algorithm %s\n", __func__,
+		keylen, txform->minkey, txform->maxkey, txform->name));
 		return EINVAL;
 	}
 
@@ -226,8 +226,9 @@ esp_init(struct secasvar *sav, const str
 	sav->tdb_xform = xsp;
 	sav->tdb_encalgxform = txform;
 
-	if (sav->alg_enc == SADB_X_EALG_AESGCM16 ||
-	sav->alg_enc == SADB_X_EALG_AESGMAC) {
+	switch (sav->alg_enc) {
+	case SADB_X_EALG_AESGCM16:
+	case SADB_X_EALG_AESGMAC:
 		switch (keylen) {
 		case 20:
 			sav->alg_auth = SADB_X_AALG_AES128GMAC;
@@ -241,11 +242,19 @@ esp_init(struct secasvar *sav, const str
 			sav->alg_auth = SADB_X_AALG_AES256GMAC;
 			sav->tdb_authalgxform = _hash_gmac_aes_256;
 			break;
-		}
+		default:
+			DPRINTF(("%s: invalid key length %u, must be either of "
+"20, 28 or 36\n", __func__, keylen));
+			return EINVAL;
+}
+
 		memset(, 0, sizeof(cria));
 		cria.cri_alg = sav->tdb_authalgxform->type;
 		cria.cri_klen = _KEYBITS(sav->key_enc);
 		cria.cri_key = _KEYBUF(sav->key_enc);
+		break;
+	default:
+		break;
 	}
 
 	/* Initialize crypto session. */
@@ -258,20 +267,19 @@ esp_init(struct secasvar *sav, const str
 	if (sav->tdb_authalgxform && sav->tdb_encalgxform) {
 		/* init both auth & enc */
 		crie.cri_next = 
-		error = crypto_newsession(>tdb_cryptoid,
-	  , crypto_support);
+		cr = 
 	} else if (sav->tdb_encalgxform) {
-		error = crypto_newsession(>tdb_cryptoid,
-	  , crypto_support);
+		cr = 
 	} else if (sav->tdb_authalgxform) {
-		error = crypto_newsession(>tdb_cryptoid,
-	  , crypto_support);
+		cr = 
 	} else {
 		/* XXX cannot happen? */
-		DPRINTF(("esp_init: no encoding OR authentication xform!\n"));
-		error = EINVAL;
+		DPRINTF(("%s: no encoding OR authentication xform!\n",
+		__func__));
+		return EINVAL;
 	}
-	return error;
+
+	return crypto_newsession(>tdb_cryptoid, cr, crypto_support);
 }
 
 /*



CVS commit: src/sys/netipsec

2017-04-10 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Apr 10 14:19:23 UTC 2017

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

Log Message:
PR/52150: Ryota Ozaki: ipsec: kernel panic on adding a key with an invalid
length.


To generate a diff of this commit:
cvs rdiff -u -r1.47 -r1.48 src/sys/netipsec/xform_esp.c

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



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

2017-04-10 Thread Phil Nelson
On Monday 10 April 2017 02:26:50 co...@sdf.org wrote:
> -DIGIT [0-9A-F]
> +DIGIT [0-9A-Z]
> 
> Looks off, is that intended?

$ ./bc
ibase
10
obase
10
ibase = Z+1
ibase
36

1679615
obase = Z+1
obase
 01 00

 35 35 35 35
1Z36AQ16836
 01 35 03 06 10 26 01 06 08 03 06
quit

The real question is outputting stuff in base 36 should also use G-Z, but that
might need to be a flag to bc because that breaks POSIX output.  Allowing
base 36 inputs doesn't cause problems with existing programs.

--Phil




CVS commit: src/sys/netipsec

2017-04-10 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Mon Apr 10 14:02:25 UTC 2017

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

Log Message:
Fix assertion failure in in6_lookup_multi via key_ismyaddr

in6_lookup_multi was forgotten to be migrated to in6_multi_group.
Also psz should be changed to psz/psref because in6_multi_group is
sleepable.

Fix PR kern/52151


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

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

Modified files:

Index: src/sys/netipsec/key.c
diff -u src/sys/netipsec/key.c:1.104 src/sys/netipsec/key.c:1.105
--- src/sys/netipsec/key.c:1.104	Thu Apr  6 09:20:07 2017
+++ src/sys/netipsec/key.c	Mon Apr 10 14:02:25 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: key.c,v 1.104 2017/04/06 09:20:07 ozaki-r Exp $	*/
+/*	$NetBSD: key.c,v 1.105 2017/04/10 14:02:25 ozaki-r Exp $	*/
 /*	$FreeBSD: src/sys/netipsec/key.c,v 1.3.2.3 2004/02/14 22:23:23 bms Exp $	*/
 /*	$KAME: key.c,v 1.191 2001/06/27 10:46:49 sakane Exp $	*/
 
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: key.c,v 1.104 2017/04/06 09:20:07 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: key.c,v 1.105 2017/04/10 14:02:25 ozaki-r Exp $");
 
 /*
  * This code is referd to RFC 2367
@@ -67,6 +67,8 @@ __KERNEL_RCSID(0, "$NetBSD: key.c,v 1.10
 #include 
 #include 
 #include 
+#include 
+#include 
 
 #include 
 #include 
@@ -4169,16 +4171,23 @@ static int
 key_ismyaddr6(const struct sockaddr_in6 *sin6)
 {
 	struct in6_ifaddr *ia;
-	const struct in6_multi *in6m;
 	int s;
+	struct psref psref;
+	int bound;
+	int ours = 1;
 
+	bound = curlwp_bind();
 	s = pserialize_read_enter();
 	IN6_ADDRLIST_READER_FOREACH(ia) {
+		bool ingroup;
+
 		if (key_sockaddrcmp((const struct sockaddr *),
 		(const struct sockaddr *)>ia_addr, 0) == 0) {
 			pserialize_read_exit(s);
-			return 1;
+			goto ours;
 		}
+		ia6_acquire(ia, );
+		pserialize_read_exit(s);
 
 		/*
 		 * XXX Multicast
@@ -4186,19 +4195,26 @@ key_ismyaddr6(const struct sockaddr_in6 
 		 * about IPv4 multicast??
 		 * XXX scope
 		 */
-		in6m = in6_lookup_multi(>sin6_addr, ia->ia_ifp);
-		if (in6m) {
-			pserialize_read_exit(s);
-			return 1;
+		ingroup = in6_multi_group(>sin6_addr, ia->ia_ifp);
+		if (ingroup) {
+			ia6_release(ia, );
+			goto ours;
 		}
+
+		s = pserialize_read_enter();
+		ia6_release(ia, );
 	}
 	pserialize_read_exit(s);
 
 	/* loopback, just for safety */
 	if (IN6_IS_ADDR_LOOPBACK(>sin6_addr))
-		return 1;
+		goto ours;
 
-	return 0;
+	ours = 0;
+ours:
+	curlwp_bindx(bound);
+
+	return ours;
 }
 #endif /*INET6*/
 



CVS commit: src/sys/netipsec

2017-04-10 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Mon Apr 10 14:02:25 UTC 2017

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

Log Message:
Fix assertion failure in in6_lookup_multi via key_ismyaddr

in6_lookup_multi was forgotten to be migrated to in6_multi_group.
Also psz should be changed to psz/psref because in6_multi_group is
sleepable.

Fix PR kern/52151


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

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



CVS commit: src/usr.sbin/crash

2017-04-10 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Apr 10 12:05:52 UTC 2017

Modified Files:
src/usr.sbin/crash: Makefile

Log Message:
Protect the right part.


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/usr.sbin/crash/Makefile

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/crash/Makefile
diff -u src/usr.sbin/crash/Makefile:1.35 src/usr.sbin/crash/Makefile:1.36
--- src/usr.sbin/crash/Makefile:1.35	Sun Apr  9 17:57:59 2017
+++ src/usr.sbin/crash/Makefile	Mon Apr 10 08:05:52 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.35 2017/04/09 21:57:59 christos Exp $
+#	$NetBSD: Makefile,v 1.36 2017/04/10 12:05:52 christos Exp $
 
 PROG=		crash
 MAN=		crash.8
@@ -97,12 +97,12 @@ SRCS+=	unsupported.c
 
 .endif# }
 
+.if  ${MACHINE} == "sparc" \
+|| ${MACHINE} == "sparc64"
 COPTS.kern_timeout.c += -Wno-stack-protector
+.endif
 
-.if  ${MACHINE} == "sparc"
-|| ${MACHINE} == "sparc64"
 .include "../../compat/exec.mk"
-.endif
 
 .include 
 .include 



CVS commit: src/usr.sbin/crash

2017-04-10 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Apr 10 12:05:52 UTC 2017

Modified Files:
src/usr.sbin/crash: Makefile

Log Message:
Protect the right part.


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/usr.sbin/crash/Makefile

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



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

2017-04-10 Thread coypu
joerg mentions you can get around the dummy returns/breaks after bc_exit
to quiet compiler warnings by tagging it dead


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

2017-04-10 Thread coypu
Hi,

-DIGIT [0-9A-F]
+DIGIT [0-9A-Z]

Looks off, is that intended?

Thanks.