From owner-svn-src-projects@freebsd.org  Sun Jan 15 01:34:08 2017
Return-Path: <owner-svn-src-projects@freebsd.org>
Delivered-To: svn-src-projects@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id E6522CA4139
 for <svn-src-projects@mailman.ysv.freebsd.org>;
 Sun, 15 Jan 2017 01:34:08 +0000 (UTC) (envelope-from dim@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id B2F171E79;
 Sun, 15 Jan 2017 01:34:08 +0000 (UTC) (envelope-from dim@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0F1Y7t2075140;
 Sun, 15 Jan 2017 01:34:07 GMT (envelope-from dim@FreeBSD.org)
Received: (from dim@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0F1Y7Ui075139;
 Sun, 15 Jan 2017 01:34:07 GMT (envelope-from dim@FreeBSD.org)
Message-Id: <201701150134.v0F1Y7Ui075139@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org
 using -f
From: Dimitry Andric <dim@FreeBSD.org>
Date: Sun, 15 Jan 2017 01:34:07 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject: svn commit: r312206 -
 projects/clang400-import/contrib/llvm/tools/clang/lib/Frontend
X-SVN-Group: projects
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-projects@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the src &quot; projects&quot;
 tree" <svn-src-projects.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-projects>, 
 <mailto:svn-src-projects-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-projects/>
List-Post: <mailto:svn-src-projects@freebsd.org>
List-Help: <mailto:svn-src-projects-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-projects>, 
 <mailto:svn-src-projects-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 15 Jan 2017 01:34:09 -0000

Author: dim
Date: Sun Jan 15 01:34:07 2017
New Revision: 312206
URL: https://svnweb.freebsd.org/changeset/base/312206

Log:
  Pull in r292032 from upstream llvm trunk (by Yaron Keren):
  
    Fix PR31644 introduced by r287138 and add a regression test.
    Thanks Dimitry Andric for the report and fix!
  
  This should restore -MP output to what it was before.
  
  Reported by:	jbeich
  PR:		216043

Modified:
  projects/clang400-import/contrib/llvm/tools/clang/lib/Frontend/DependencyFile.cpp

Modified: projects/clang400-import/contrib/llvm/tools/clang/lib/Frontend/DependencyFile.cpp
==============================================================================
--- projects/clang400-import/contrib/llvm/tools/clang/lib/Frontend/DependencyFile.cpp	Sun Jan 15 00:50:10 2017	(r312205)
+++ projects/clang400-import/contrib/llvm/tools/clang/lib/Frontend/DependencyFile.cpp	Sun Jan 15 01:34:07 2017	(r312206)
@@ -447,9 +447,9 @@ void DFGImpl::OutputDependencyFile() {
   // Create phony targets if requested.
   if (PhonyTarget && !Files.empty()) {
     // Skip the first entry, this is always the input file itself.
-    for (StringRef File : Files) {
+    for (auto I = Files.begin() + 1, E = Files.end(); I != E; ++I) {
       OS << '\n';
-      PrintFilename(OS, File, OutputFormat);
+      PrintFilename(OS, *I, OutputFormat);
       OS << ":\n";
     }
   }

From owner-svn-src-projects@freebsd.org  Sun Jan 15 01:36:47 2017
Return-Path: <owner-svn-src-projects@freebsd.org>
Delivered-To: svn-src-projects@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 017B3CA42B8
 for <svn-src-projects@mailman.ysv.freebsd.org>;
 Sun, 15 Jan 2017 01:36:47 +0000 (UTC) (envelope-from dim@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id B884D110B;
 Sun, 15 Jan 2017 01:36:46 +0000 (UTC) (envelope-from dim@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0F1ajBt075514;
 Sun, 15 Jan 2017 01:36:45 GMT (envelope-from dim@FreeBSD.org)
Received: (from dim@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0F1ajsM075511;
 Sun, 15 Jan 2017 01:36:45 GMT (envelope-from dim@FreeBSD.org)
Message-Id: <201701150136.v0F1ajsM075511@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org
 using -f
From: Dimitry Andric <dim@FreeBSD.org>
Date: Sun, 15 Jan 2017 01:36:45 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject: svn commit: r312207 - in projects/clang400-import/sys:
 dev/etherswitch/micrel kern mips/conf net
X-SVN-Group: projects
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-projects@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the src &quot; projects&quot;
 tree" <svn-src-projects.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-projects>, 
 <mailto:svn-src-projects-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-projects/>
List-Post: <mailto:svn-src-projects@freebsd.org>
List-Help: <mailto:svn-src-projects-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-projects>, 
 <mailto:svn-src-projects-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 15 Jan 2017 01:36:47 -0000

Author: dim
Date: Sun Jan 15 01:36:45 2017
New Revision: 312207
URL: https://svnweb.freebsd.org/changeset/base/312207

Log:
  Merge ^/head r312201 through r312206.

Added:
  projects/clang400-import/sys/dev/etherswitch/micrel/
     - copied from r312206, head/sys/dev/etherswitch/micrel/
Modified:
  projects/clang400-import/sys/kern/subr_gtaskqueue.c
  projects/clang400-import/sys/mips/conf/ONIONOMEGA.hints
  projects/clang400-import/sys/net/iflib.c
Directory Properties:
  projects/clang400-import/   (props changed)

Modified: projects/clang400-import/sys/kern/subr_gtaskqueue.c
==============================================================================
--- projects/clang400-import/sys/kern/subr_gtaskqueue.c	Sun Jan 15 01:34:07 2017	(r312206)
+++ projects/clang400-import/sys/kern/subr_gtaskqueue.c	Sun Jan 15 01:36:45 2017	(r312207)
@@ -647,7 +647,7 @@ taskqgroup_attach(struct taskqgroup *qgr
 	qgroup->tqg_queue[qid].tgc_cnt++;
 	LIST_INSERT_HEAD(&qgroup->tqg_queue[qid].tgc_tasks, gtask, gt_list);
 	gtask->gt_taskqueue = qgroup->tqg_queue[qid].tgc_taskq;
-	if (irq != -1 && smp_started) {
+	if (irq != -1 && (smp_started || mp_ncpus == 1)) {
 		gtask->gt_cpu = qgroup->tqg_queue[qid].tgc_cpu;
 		CPU_ZERO(&mask);
 		CPU_SET(qgroup->tqg_queue[qid].tgc_cpu, &mask);
@@ -697,7 +697,7 @@ taskqgroup_attach_cpu(struct taskqgroup 
 	gtask->gt_irq = irq;
 	gtask->gt_cpu = cpu;
 	mtx_lock(&qgroup->tqg_lock);
-	if (smp_started) {
+	if (smp_started || mp_ncpus == 1) {
 		for (i = 0; i < qgroup->tqg_cnt; i++)
 			if (qgroup->tqg_queue[i].tgc_cpu == cpu) {
 				qid = i;
@@ -717,7 +717,7 @@ taskqgroup_attach_cpu(struct taskqgroup 
 
 	CPU_ZERO(&mask);
 	CPU_SET(cpu, &mask);
-	if (irq != -1 && smp_started)
+	if (irq != -1 && (smp_started || mp_ncpus == 1))
 		intr_setaffinity(irq, &mask);
 	return (0);
 }
@@ -731,7 +731,7 @@ taskqgroup_attach_cpu_deferred(struct ta
 	qid = -1;
 	irq = gtask->gt_irq;
 	cpu = gtask->gt_cpu;
-	MPASS(smp_started);
+	MPASS(smp_started || mp_ncpus == 1);
 	mtx_lock(&qgroup->tqg_lock);
 	for (i = 0; i < qgroup->tqg_cnt; i++)
 		if (qgroup->tqg_queue[i].tgc_cpu == cpu) {
@@ -824,7 +824,7 @@ _taskqgroup_adjust(struct taskqgroup *qg
 
 	mtx_assert(&qgroup->tqg_lock, MA_OWNED);
 
-	if (cnt < 1 || cnt * stride > mp_ncpus || !smp_started) {
+	if (cnt < 1 || cnt * stride > mp_ncpus || (!smp_started && (mp_ncpus != 1))) {
 		printf("taskqgroup_adjust failed cnt: %d stride: %d mp_ncpus: %d smp_started: %d\n",
 			   cnt, stride, mp_ncpus, smp_started);
 		return (EINVAL);

Modified: projects/clang400-import/sys/mips/conf/ONIONOMEGA.hints
==============================================================================
--- projects/clang400-import/sys/mips/conf/ONIONOMEGA.hints	Sun Jan 15 01:34:07 2017	(r312206)
+++ projects/clang400-import/sys/mips/conf/ONIONOMEGA.hints	Sun Jan 15 01:36:45 2017	(r312207)
@@ -31,6 +31,10 @@ hint.arge.1.media=1000
 hint.arge.1.fduplex=1
 hint.arge.1.eeprommac=0x1fff0006
 
+# ath0
+hint.ath.0.eepromaddr=0x1fff0000
+hint.ath.0.eepromsize=16384
+
 # 16MB flash layout:
 # [    0.510000] 5 tp-link partitions found on MTD device spi0.0
 # [    0.510000] Creating 5 MTD partitions on "spi0.0":
@@ -92,3 +96,30 @@ hint.map.6.start=0x00ff0000
 hint.map.6.end=0x01000000
 hint.map.6.name="ART"
 hint.map.6.readonly=1
+
+# GPIO
+hint.gpio.0.pinmask=0x0c8ff1c3
+
+hint.gpioled.0.at="gpiobus0"
+hint.gpioled.0.pins=0x08000000
+hint.gpioled.0.name="board"
+hint.gpioled.0.invert=0
+
+#Red
+hint.gpioled.1.at="gpiobus0"
+hint.gpioled.1.pins=0x00020000
+hint.gpioled.1.name="red"
+hint.gpioled.1.invert=0
+
+#Green
+hint.gpioled.2.at="gpiobus0"
+hint.gpioled.2.pins=0x00010000
+hint.gpioled.2.name="green"
+hint.gpioled.2.invert=0
+
+#Blue
+hint.gpioled.3.at="gpiobus0"
+hint.gpioled.3.pins=0x00008000
+hint.gpioled.3.name="blue"
+hint.gpioled.3.invert=0
+

Modified: projects/clang400-import/sys/net/iflib.c
==============================================================================
--- projects/clang400-import/sys/net/iflib.c	Sun Jan 15 01:34:07 2017	(r312206)
+++ projects/clang400-import/sys/net/iflib.c	Sun Jan 15 01:36:45 2017	(r312207)
@@ -133,10 +133,13 @@ typedef struct iflib_rxq *iflib_rxq_t;
 struct iflib_fl;
 typedef struct iflib_fl *iflib_fl_t;
 
+struct iflib_ctx;
+
 typedef struct iflib_filter_info {
 	driver_filter_t *ifi_filter;
 	void *ifi_filter_arg;
 	struct grouptask *ifi_task;
+	struct iflib_ctx *ifi_ctx;
 } *iflib_filter_info_t;
 
 struct iflib_ctx {
@@ -300,6 +303,8 @@ typedef struct iflib_sw_tx_desc_array {
 #define	IFC_MULTISEG		0x04
 #define	IFC_DMAR		0x08
 #define	IFC_SC_ALLOCATED	0x10
+#define	IFC_INIT_DONE		0x20
+
 
 #define CSUM_OFFLOAD		(CSUM_IP_TSO|CSUM_IP6_TSO|CSUM_IP| \
 				 CSUM_IP_UDP|CSUM_IP_TCP|CSUM_IP_SCTP| \
@@ -1194,7 +1199,7 @@ iflib_fast_intr(void *arg)
 	iflib_filter_info_t info = arg;
 	struct grouptask *gtask = info->ifi_task;
 
-	if (!smp_started)
+	if (!smp_started && mp_ncpus > 1)
 		return (FILTER_HANDLED);
 
 	DBG_COUNTER_INC(fast_intrs);
@@ -3753,6 +3758,7 @@ iflib_device_register(device_t dev, void
 
 	if_setgetcounterfn(ctx->ifc_ifp, iflib_if_get_counter);
 	iflib_add_device_sysctl_post(ctx);
+	ctx->ifc_flags |= IFC_INIT_DONE;
 	return (0);
 fail_detach:
 	ether_ifdetach(ctx->ifc_ifp);
@@ -4471,6 +4477,7 @@ iflib_irq_alloc_generic(if_ctx_t ctx, if
 	info->ifi_filter = filter;
 	info->ifi_filter_arg = filter_arg;
 	info->ifi_task = gtask;
+	info->ifi_ctx = ctx;
 
 	err = _iflib_irq_alloc(ctx, irq, rid, iflib_fast_intr, NULL, info,  name);
 	if (err != 0) {
@@ -4567,6 +4574,7 @@ iflib_legacy_setup(if_ctx_t ctx, driver_
 	info->ifi_filter = filter;
 	info->ifi_filter_arg = filter_arg;
 	info->ifi_task = gtask;
+	info->ifi_ctx = ctx;
 
 	/* We allocate a single interrupt resource */
 	if ((err = _iflib_irq_alloc(ctx, irq, tqrid, iflib_fast_intr, NULL, info, name)) != 0)

From owner-svn-src-projects@freebsd.org  Sun Jan 15 09:33:33 2017
Return-Path: <owner-svn-src-projects@freebsd.org>
Delivered-To: svn-src-projects@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3B576CA450C
 for <svn-src-projects@mailman.ysv.freebsd.org>;
 Sun, 15 Jan 2017 09:33:33 +0000 (UTC)
 (envelope-from ngie@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id F3E2E1B05;
 Sun, 15 Jan 2017 09:33:32 +0000 (UTC)
 (envelope-from ngie@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0F9XWdd073855;
 Sun, 15 Jan 2017 09:33:32 GMT (envelope-from ngie@FreeBSD.org)
Received: (from ngie@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0F9XTps073828;
 Sun, 15 Jan 2017 09:33:29 GMT (envelope-from ngie@FreeBSD.org)
Message-Id: <201701150933.v0F9XTps073828@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: ngie set sender to
 ngie@FreeBSD.org using -f
From: Ngie Cooper <ngie@FreeBSD.org>
Date: Sun, 15 Jan 2017 09:33:29 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject: svn commit: r312218 - in projects/netbsd-tests-upstream-01-2017:
 lib/msun/tests release/tools sys/ddb sys/dev/etherswitch/micrel sys/i386/i386
 sys/kern sys/mips/atheros sys/mips/conf sys/net sys/sy...
X-SVN-Group: projects
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-projects@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the src &quot; projects&quot;
 tree" <svn-src-projects.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-projects>, 
 <mailto:svn-src-projects-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-projects/>
List-Post: <mailto:svn-src-projects@freebsd.org>
List-Help: <mailto:svn-src-projects-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-projects>, 
 <mailto:svn-src-projects-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 15 Jan 2017 09:33:33 -0000

Author: ngie
Date: Sun Jan 15 09:33:29 2017
New Revision: 312218
URL: https://svnweb.freebsd.org/changeset/base/312218

Log:
  MFhead@r312217

Added:
  projects/netbsd-tests-upstream-01-2017/sys/dev/etherswitch/micrel/
     - copied from r312217, head/sys/dev/etherswitch/micrel/
Modified:
  projects/netbsd-tests-upstream-01-2017/lib/msun/tests/Makefile
  projects/netbsd-tests-upstream-01-2017/lib/msun/tests/fmaxmin_test.c
  projects/netbsd-tests-upstream-01-2017/release/tools/ec2.conf
  projects/netbsd-tests-upstream-01-2017/sys/ddb/db_input.c
  projects/netbsd-tests-upstream-01-2017/sys/i386/i386/pmap.c
  projects/netbsd-tests-upstream-01-2017/sys/kern/kern_acct.c
  projects/netbsd-tests-upstream-01-2017/sys/kern/kern_shutdown.c
  projects/netbsd-tests-upstream-01-2017/sys/kern/subr_gtaskqueue.c
  projects/netbsd-tests-upstream-01-2017/sys/kern/uipc_mbuf.c
  projects/netbsd-tests-upstream-01-2017/sys/mips/atheros/ar71xxreg.h
  projects/netbsd-tests-upstream-01-2017/sys/mips/atheros/uart_bus_ar71xx.c
  projects/netbsd-tests-upstream-01-2017/sys/mips/conf/ONIONOMEGA.hints
  projects/netbsd-tests-upstream-01-2017/sys/net/iflib.c
  projects/netbsd-tests-upstream-01-2017/sys/sys/ata.h
  projects/netbsd-tests-upstream-01-2017/sys/vm/vm_object.c
  projects/netbsd-tests-upstream-01-2017/sys/vm/vm_page.c
  projects/netbsd-tests-upstream-01-2017/tests/sys/kern/acct/Makefile
  projects/netbsd-tests-upstream-01-2017/tests/sys/mac/bsdextended/ugidfw_test.c
  projects/netbsd-tests-upstream-01-2017/tests/sys/vfs/lookup_cap_dotdot.c
  projects/netbsd-tests-upstream-01-2017/usr.sbin/ctld/ctld.c
  projects/netbsd-tests-upstream-01-2017/usr.sbin/ctld/ctld.h
  projects/netbsd-tests-upstream-01-2017/usr.sbin/ctld/login.c
  projects/netbsd-tests-upstream-01-2017/usr.sbin/inetd/inetd.c
  projects/netbsd-tests-upstream-01-2017/usr.sbin/iscsid/iscsid.c
  projects/netbsd-tests-upstream-01-2017/usr.sbin/iscsid/iscsid.h
  projects/netbsd-tests-upstream-01-2017/usr.sbin/iscsid/login.c
Directory Properties:
  projects/netbsd-tests-upstream-01-2017/   (props changed)

Modified: projects/netbsd-tests-upstream-01-2017/lib/msun/tests/Makefile
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/lib/msun/tests/Makefile	Sun Jan 15 09:31:14 2017	(r312217)
+++ projects/netbsd-tests-upstream-01-2017/lib/msun/tests/Makefile	Sun Jan 15 09:33:29 2017	(r312218)
@@ -55,10 +55,7 @@ TAP_TESTS_C+=	ctrig_test
 TAP_TESTS_C+=	exponential_test
 TAP_TESTS_C+=	fenv_test
 TAP_TESTS_C+=	fma_test
-# clang 3.8.0 fails always fails this test. See: bug 208703
-.if ! (${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} >= 30800)
 TAP_TESTS_C+=	fmaxmin_test
-.endif
 TAP_TESTS_C+=	ilogb2_test
 TAP_TESTS_C+=	invtrig_test
 TAP_TESTS_C+=	invctrig_test

Modified: projects/netbsd-tests-upstream-01-2017/lib/msun/tests/fmaxmin_test.c
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/lib/msun/tests/fmaxmin_test.c	Sun Jan 15 09:31:14 2017	(r312217)
+++ projects/netbsd-tests-upstream-01-2017/lib/msun/tests/fmaxmin_test.c	Sun Jan 15 09:33:29 2017	(r312218)
@@ -86,6 +86,8 @@ testall_r(long double big, long double s
 	return (ok);
 }
 
+const char *comment = NULL;
+
 /*
  * Test all the functions: fmaxf, fmax, fmaxl, fminf, fmin, and fminl,
  * in all rounding modes and with the arguments in different orders.
@@ -107,10 +109,17 @@ testall(int testnum, long double big, lo
 			break;
 		}
 	}
-	printf("%sok %d - big = %.20Lg, small = %.20Lg\n",
-	       (i == 4) ? "" : "not ", testnum, big, small);
+	printf("%sok %d - big = %.20Lg, small = %.20Lg%s\n",
+	       (i == 4) ? "" : "not ", testnum, big, small,
+	       comment == NULL ? "" : comment);
 }
 
+/* Clang 3.8.0+ fails the invariants for testcase 6, 7, 10, and 11. */
+#if defined(__clang__) && \
+    (__clang_major__ >= 3 && __clang_minor__ >= 8 && __clang_patchlevel__ >= 0)
+#define	affected_by_bug_208703
+#endif
+
 int
 main(int argc, char *argv[])
 {
@@ -122,15 +131,23 @@ main(int argc, char *argv[])
 	testall(3, nextafterf(42.0, INFINITY), 42.0);
 	testall(4, -5.0, -5.0);
 	testall(5, -3.0, -4.0);
+#ifdef affected_by_bug_208703
+	comment = "# TODO: testcase 6-7 fails invariant with clang 3.8+ (bug 208703)";
+#endif
 	testall(6, 1.0, NAN);
 	testall(7, INFINITY, NAN);
+	comment = NULL;
 	testall(8, INFINITY, 1.0);
 	testall(9, -3.0, -INFINITY);
 	testall(10, 3.0, -INFINITY);
+#ifdef affected_by_bug_208703
+	comment = "# TODO: testcase 11-12 fails invariant with clang 3.8+ (bug 208703)";
+#endif
 	testall(11, NAN, NAN);
 
 	/* This test isn't strictly required to work by C99. */
 	testall(12, 0.0, -0.0);
+	comment = NULL;
 
 	return (0);
 }

Modified: projects/netbsd-tests-upstream-01-2017/release/tools/ec2.conf
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/release/tools/ec2.conf	Sun Jan 15 09:31:14 2017	(r312217)
+++ projects/netbsd-tests-upstream-01-2017/release/tools/ec2.conf	Sun Jan 15 09:33:29 2017	(r312218)
@@ -6,7 +6,7 @@
 # Packages to install into the image we're creating.  This is a deliberately
 # minimalist set, providing only the packages necessary to bootstrap further
 # package installation as specified via EC2 user-data.
-export VM_EXTRA_PACKAGES="ec2-scripts firstboot-freebsd-update firstboot-pkgs"
+export VM_EXTRA_PACKAGES="ec2-scripts firstboot-freebsd-update firstboot-pkgs dual-dhclient"
 
 # Set to a list of third-party software to enable in rc.conf(5).
 export VM_RC_LIST="ec2_configinit ec2_fetchkey ec2_ephemeralswap ec2_loghostkey firstboot_freebsd_update firstboot_pkgs"
@@ -39,8 +39,9 @@ vm_extra_pre_umount() {
 	# time; expand our filesystem to fill the disk.
 	echo 'growfs_enable="YES"' >> ${DESTDIR}/etc/rc.conf
 
-	# EC2 instances use DHCP to get their network configuration.
-	echo 'ifconfig_DEFAULT="SYNCDHCP"' >> ${DESTDIR}/etc/rc.conf
+	# EC2 instances use DHCP to get their network configuration.  IPv6
+	# requires accept_rtadv.
+	echo 'ifconfig_DEFAULT="SYNCDHCP accept_rtadv"' >> ${DESTDIR}/etc/rc.conf
 
 	# Unless the system has been configured via EC2 user-data, the user
 	# will need to SSH in to do anything.
@@ -51,6 +52,10 @@ vm_extra_pre_umount() {
 	# via EC2 user-data.
 	echo 'firstboot_pkgs_list="awscli"' >> ${DESTDIR}/etc/rc.conf
 
+	# Enable IPv6 on all interfaces, and use DHCP on both IPv4 and IPv6.
+	echo 'ipv6_activate_all_interfaces="YES"' >> ${DESTDIR}/etc/rc.conf
+	echo 'dhclient_program="/usr/local/sbin/dual-dhclient"' >> ${DESTDIR}/etc/rc.conf
+
 	# The EC2 console is output-only, so while printing a backtrace can
 	# be useful, there's no point dropping into a debugger or waiting
 	# for a keypress.

Modified: projects/netbsd-tests-upstream-01-2017/sys/ddb/db_input.c
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/sys/ddb/db_input.c	Sun Jan 15 09:31:14 2017	(r312217)
+++ projects/netbsd-tests-upstream-01-2017/sys/ddb/db_input.c	Sun Jan 15 09:33:29 2017	(r312218)
@@ -63,6 +63,7 @@ static int	db_lhist_nlines;
 #define	BLANK		' '
 #define	BACKUP		'\b'
 
+static int	cnmaygetc(void);
 static void	db_delete(int n, int bwd);
 static int	db_inputchar(int c);
 static void	db_putnchars(int c, int count);
@@ -290,6 +291,12 @@ db_inputchar(c)
 	return (0);
 }
 
+static int
+cnmaygetc()
+{
+	return (-1);
+}
+
 int
 db_readline(lstart, lsize)
 	char *	lstart;
@@ -343,7 +350,7 @@ db_check_interrupt(void)
 {
 	int	c;
 
-	c = cncheckc();
+	c = cnmaygetc();
 	switch (c) {
 	    case -1:		/* no character */
 		return;
@@ -354,7 +361,7 @@ db_check_interrupt(void)
 
 	    case CTRL('s'):
 		do {
-		    c = cncheckc();
+		    c = cnmaygetc();
 		    if (c == CTRL('c'))
 			db_error((char *)0);
 		} while (c != CTRL('q'));

Modified: projects/netbsd-tests-upstream-01-2017/sys/i386/i386/pmap.c
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/sys/i386/i386/pmap.c	Sun Jan 15 09:31:14 2017	(r312217)
+++ projects/netbsd-tests-upstream-01-2017/sys/i386/i386/pmap.c	Sun Jan 15 09:33:29 2017	(r312218)
@@ -4216,8 +4216,14 @@ pmap_zero_page(vm_page_t m)
 	invlcaddr(pc->pc_cmap_addr2);
 	pagezero(pc->pc_cmap_addr2);
 	*cmap_pte2 = 0;
-	mtx_unlock(&pc->pc_cmap_lock);
+
+	/*
+	 * Unpin the thread before releasing the lock.  Otherwise the thread
+	 * could be rescheduled while still bound to the current CPU, only
+	 * to unpin itself immediately upon resuming execution.
+	 */
 	sched_unpin();
+	mtx_unlock(&pc->pc_cmap_lock);
 }
 
 /*
@@ -4244,8 +4250,8 @@ pmap_zero_page_area(vm_page_t m, int off
 	else
 		bzero(pc->pc_cmap_addr2 + off, size);
 	*cmap_pte2 = 0;
-	mtx_unlock(&pc->pc_cmap_lock);
 	sched_unpin();
+	mtx_unlock(&pc->pc_cmap_lock);
 }
 
 /*
@@ -4275,8 +4281,8 @@ pmap_copy_page(vm_page_t src, vm_page_t 
 	bcopy(pc->pc_cmap_addr1, pc->pc_cmap_addr2, PAGE_SIZE);
 	*cmap_pte1 = 0;
 	*cmap_pte2 = 0;
-	mtx_unlock(&pc->pc_cmap_lock);
 	sched_unpin();
+	mtx_unlock(&pc->pc_cmap_lock);
 }
 
 int unmapped_buf_allowed = 1;
@@ -4323,8 +4329,8 @@ pmap_copy_pages(vm_page_t ma[], vm_offse
 	}
 	*cmap_pte1 = 0;
 	*cmap_pte2 = 0;
-	mtx_unlock(&pc->pc_cmap_lock);
 	sched_unpin();
+	mtx_unlock(&pc->pc_cmap_lock);
 }
 
 /*
@@ -5310,8 +5316,8 @@ pmap_flush_page(vm_page_t m)
 		if (useclflushopt || cpu_vendor_id != CPU_VENDOR_INTEL)
 			mfence();
 		*cmap_pte2 = 0;
-		mtx_unlock(&pc->pc_cmap_lock);
 		sched_unpin();
+		mtx_unlock(&pc->pc_cmap_lock);
 	} else
 		pmap_invalidate_cache();
 }

Modified: projects/netbsd-tests-upstream-01-2017/sys/kern/kern_acct.c
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/sys/kern/kern_acct.c	Sun Jan 15 09:31:14 2017	(r312217)
+++ projects/netbsd-tests-upstream-01-2017/sys/kern/kern_acct.c	Sun Jan 15 09:33:29 2017	(r312218)
@@ -469,8 +469,8 @@ static uint32_t
 encode_timeval(struct timeval tv)
 {
 	int log2_s;
-	int val, exponent;	/* Unnormalized value and exponent */
-	int norm_exponent;	/* Normalized exponent */
+	int val, exp;	/* Unnormalized value and exponent */
+	int norm_exp;	/* Normalized exponent */
 	int shift;
 
 	/*
@@ -481,7 +481,7 @@ encode_timeval(struct timeval tv)
 	if (tv.tv_sec == 0) {
 		if (tv.tv_usec == 0)
 			return (0);
-		exponent = 0;
+		exp = 0;
 		val = tv.tv_usec;
 	} else {
 		/*
@@ -490,24 +490,24 @@ encode_timeval(struct timeval tv)
 		 */
 		log2_s = fls(tv.tv_sec) - 1;
 		if (log2_s + LOG2_1M < CALC_BITS) {
-			exponent = 0;
+			exp = 0;
 			val = 1000000 * tv.tv_sec + tv.tv_usec;
 		} else {
-			exponent = log2_s + LOG2_1M - CALC_BITS;
+			exp = log2_s + LOG2_1M - CALC_BITS;
 			val = (unsigned int)(((uint64_t)1000000 * tv.tv_sec +
-			    tv.tv_usec) >> exponent);
+			    tv.tv_usec) >> exp);
 		}
 	}
 	/* Now normalize and pack the value into an IEEE-754 float. */
-	norm_exponent = fls(val) - 1;
-	shift = FLT_MANT_DIG - norm_exponent - 1;
+	norm_exp = fls(val) - 1;
+	shift = FLT_MANT_DIG - norm_exp - 1;
 #ifdef ACCT_DEBUG
 	printf("val=%d exp=%d shift=%d log2(val)=%d\n",
-	    val, exponent, shift, norm_exponent);
-	printf("exp=%x mant=%x\n", FLT_MAX_EXP - 1 + exponent + norm_exponent,
+	    val, exp, shift, norm_exp);
+	printf("exp=%x mant=%x\n", FLT_MAX_EXP - 1 + exp + norm_exp,
 	    ((shift > 0 ? (val << shift) : (val >> -shift)) & MANT_MASK));
 #endif
-	return (((FLT_MAX_EXP - 1 + exponent + norm_exponent) << (FLT_MANT_DIG - 1)) |
+	return (((FLT_MAX_EXP - 1 + exp + norm_exp) << (FLT_MANT_DIG - 1)) |
 	    ((shift > 0 ? val << shift : val >> -shift) & MANT_MASK));
 }
 
@@ -518,7 +518,7 @@ encode_timeval(struct timeval tv)
 static uint32_t
 encode_long(long val)
 {
-	int norm_exponent;	/* Normalized exponent */
+	int norm_exp;	/* Normalized exponent */
 	int shift;
 
 	if (val == 0)
@@ -529,15 +529,15 @@ encode_long(long val)
 		    val);
 		val = LONG_MAX;
 	}
-	norm_exponent = fls(val) - 1;
-	shift = FLT_MANT_DIG - norm_exponent - 1;
+	norm_exp = fls(val) - 1;
+	shift = FLT_MANT_DIG - norm_exp - 1;
 #ifdef ACCT_DEBUG
 	printf("val=%d shift=%d log2(val)=%d\n",
-	    val, shift, norm_exponent);
-	printf("exp=%x mant=%x\n", FLT_MAX_EXP - 1 + exp + norm_exponent,
+	    val, shift, norm_exp);
+	printf("exp=%x mant=%x\n", FLT_MAX_EXP - 1 + exp + norm_exp,
 	    ((shift > 0 ? (val << shift) : (val >> -shift)) & MANT_MASK));
 #endif
-	return (((FLT_MAX_EXP - 1 + norm_exponent) << (FLT_MANT_DIG - 1)) |
+	return (((FLT_MAX_EXP - 1 + norm_exp) << (FLT_MANT_DIG - 1)) |
 	    ((shift > 0 ? val << shift : val >> -shift) & MANT_MASK));
 }
 

Modified: projects/netbsd-tests-upstream-01-2017/sys/kern/kern_shutdown.c
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/sys/kern/kern_shutdown.c	Sun Jan 15 09:31:14 2017	(r312217)
+++ projects/netbsd-tests-upstream-01-2017/sys/kern/kern_shutdown.c	Sun Jan 15 09:33:29 2017	(r312218)
@@ -733,13 +733,13 @@ vpanic(const char *fmt, va_list ap)
 		CPU_CLR(PCPU_GET(cpuid), &other_cpus);
 		stop_cpus_hard(other_cpus);
 	}
+#endif
 
 	/*
 	 * Ensure that the scheduler is stopped while panicking, even if panic
 	 * has been entered from kdb.
 	 */
 	td->td_stopsched = 1;
-#endif
 
 	bootopt = RB_AUTOBOOT;
 	newpanic = 0;

Modified: projects/netbsd-tests-upstream-01-2017/sys/kern/subr_gtaskqueue.c
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/sys/kern/subr_gtaskqueue.c	Sun Jan 15 09:31:14 2017	(r312217)
+++ projects/netbsd-tests-upstream-01-2017/sys/kern/subr_gtaskqueue.c	Sun Jan 15 09:33:29 2017	(r312218)
@@ -647,7 +647,7 @@ taskqgroup_attach(struct taskqgroup *qgr
 	qgroup->tqg_queue[qid].tgc_cnt++;
 	LIST_INSERT_HEAD(&qgroup->tqg_queue[qid].tgc_tasks, gtask, gt_list);
 	gtask->gt_taskqueue = qgroup->tqg_queue[qid].tgc_taskq;
-	if (irq != -1 && smp_started) {
+	if (irq != -1 && (smp_started || mp_ncpus == 1)) {
 		gtask->gt_cpu = qgroup->tqg_queue[qid].tgc_cpu;
 		CPU_ZERO(&mask);
 		CPU_SET(qgroup->tqg_queue[qid].tgc_cpu, &mask);
@@ -697,7 +697,7 @@ taskqgroup_attach_cpu(struct taskqgroup 
 	gtask->gt_irq = irq;
 	gtask->gt_cpu = cpu;
 	mtx_lock(&qgroup->tqg_lock);
-	if (smp_started) {
+	if (smp_started || mp_ncpus == 1) {
 		for (i = 0; i < qgroup->tqg_cnt; i++)
 			if (qgroup->tqg_queue[i].tgc_cpu == cpu) {
 				qid = i;
@@ -717,7 +717,7 @@ taskqgroup_attach_cpu(struct taskqgroup 
 
 	CPU_ZERO(&mask);
 	CPU_SET(cpu, &mask);
-	if (irq != -1 && smp_started)
+	if (irq != -1 && (smp_started || mp_ncpus == 1))
 		intr_setaffinity(irq, &mask);
 	return (0);
 }
@@ -731,7 +731,7 @@ taskqgroup_attach_cpu_deferred(struct ta
 	qid = -1;
 	irq = gtask->gt_irq;
 	cpu = gtask->gt_cpu;
-	MPASS(smp_started);
+	MPASS(smp_started || mp_ncpus == 1);
 	mtx_lock(&qgroup->tqg_lock);
 	for (i = 0; i < qgroup->tqg_cnt; i++)
 		if (qgroup->tqg_queue[i].tgc_cpu == cpu) {
@@ -824,7 +824,7 @@ _taskqgroup_adjust(struct taskqgroup *qg
 
 	mtx_assert(&qgroup->tqg_lock, MA_OWNED);
 
-	if (cnt < 1 || cnt * stride > mp_ncpus || !smp_started) {
+	if (cnt < 1 || cnt * stride > mp_ncpus || (!smp_started && (mp_ncpus != 1))) {
 		printf("taskqgroup_adjust failed cnt: %d stride: %d mp_ncpus: %d smp_started: %d\n",
 			   cnt, stride, mp_ncpus, smp_started);
 		return (EINVAL);

Modified: projects/netbsd-tests-upstream-01-2017/sys/kern/uipc_mbuf.c
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/sys/kern/uipc_mbuf.c	Sun Jan 15 09:31:14 2017	(r312217)
+++ projects/netbsd-tests-upstream-01-2017/sys/kern/uipc_mbuf.c	Sun Jan 15 09:33:29 2017	(r312218)
@@ -169,7 +169,7 @@ CTASSERT(sizeof(struct m_ext) == 28);
  * plain pointer does.
  */
 #ifdef INVARIANTS
-static struct mbuf m_assertbuf;
+static struct mbuf __used m_assertbuf;
 CTASSERT(sizeof(m_assertbuf.m_slist) == sizeof(m_assertbuf.m_next));
 CTASSERT(sizeof(m_assertbuf.m_stailq) == sizeof(m_assertbuf.m_next));
 CTASSERT(sizeof(m_assertbuf.m_slistpkt) == sizeof(m_assertbuf.m_nextpkt));

Modified: projects/netbsd-tests-upstream-01-2017/sys/mips/atheros/ar71xxreg.h
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/sys/mips/atheros/ar71xxreg.h	Sun Jan 15 09:31:14 2017	(r312217)
+++ projects/netbsd-tests-upstream-01-2017/sys/mips/atheros/ar71xxreg.h	Sun Jan 15 09:33:29 2017	(r312218)
@@ -111,6 +111,10 @@
 #define PCI_WINDOW7_CONF_ADDR		0x07000000
 
 #define	AR71XX_UART_ADDR		0x18020000
+#define		AR71XX_UART_THR		0x0
+#define		AR71XX_UART_LSR		0x14
+#define		AR71XX_UART_LSR_THRE	(1 << 5)
+#define		AR71XX_UART_LSR_TEMT	(1 << 6)
 
 #define	AR71XX_USB_CTRL_FLADJ		0x18030000
 #define		USB_CTRL_FLADJ_HOST_SHIFT	12

Modified: projects/netbsd-tests-upstream-01-2017/sys/mips/atheros/uart_bus_ar71xx.c
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/sys/mips/atheros/uart_bus_ar71xx.c	Sun Jan 15 09:31:14 2017	(r312217)
+++ projects/netbsd-tests-upstream-01-2017/sys/mips/atheros/uart_bus_ar71xx.c	Sun Jan 15 09:33:29 2017	(r312218)
@@ -86,4 +86,21 @@ uart_ar71xx_probe(device_t dev)
 	return (uart_bus_probe(dev, 2, freq, 0, 0));
 }
 
+#ifdef	EARLY_PRINTF
+static void
+ar71xx_early_putc(int c)
+{
+	int i;
+
+	for (i = 0; i < 1000; i++) {
+		if (ATH_READ_REG(AR71XX_UART_ADDR + AR71XX_UART_LSR)
+		    & AR71XX_UART_LSR_THRE)
+			break;
+	}
+
+	ATH_WRITE_REG(AR71XX_UART_ADDR + AR71XX_UART_THR, (c & 0xff));
+}
+early_putc_t *early_putc = ar71xx_early_putc;
+#endif
+
 DRIVER_MODULE(uart, apb, uart_ar71xx_driver, uart_devclass, 0, 0);

Modified: projects/netbsd-tests-upstream-01-2017/sys/mips/conf/ONIONOMEGA.hints
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/sys/mips/conf/ONIONOMEGA.hints	Sun Jan 15 09:31:14 2017	(r312217)
+++ projects/netbsd-tests-upstream-01-2017/sys/mips/conf/ONIONOMEGA.hints	Sun Jan 15 09:33:29 2017	(r312218)
@@ -31,6 +31,10 @@ hint.arge.1.media=1000
 hint.arge.1.fduplex=1
 hint.arge.1.eeprommac=0x1fff0006
 
+# ath0
+hint.ath.0.eepromaddr=0x1fff0000
+hint.ath.0.eepromsize=16384
+
 # 16MB flash layout:
 # [    0.510000] 5 tp-link partitions found on MTD device spi0.0
 # [    0.510000] Creating 5 MTD partitions on "spi0.0":
@@ -92,3 +96,30 @@ hint.map.6.start=0x00ff0000
 hint.map.6.end=0x01000000
 hint.map.6.name="ART"
 hint.map.6.readonly=1
+
+# GPIO
+hint.gpio.0.pinmask=0x0c8ff1c3
+
+hint.gpioled.0.at="gpiobus0"
+hint.gpioled.0.pins=0x08000000
+hint.gpioled.0.name="board"
+hint.gpioled.0.invert=0
+
+#Red
+hint.gpioled.1.at="gpiobus0"
+hint.gpioled.1.pins=0x00020000
+hint.gpioled.1.name="red"
+hint.gpioled.1.invert=0
+
+#Green
+hint.gpioled.2.at="gpiobus0"
+hint.gpioled.2.pins=0x00010000
+hint.gpioled.2.name="green"
+hint.gpioled.2.invert=0
+
+#Blue
+hint.gpioled.3.at="gpiobus0"
+hint.gpioled.3.pins=0x00008000
+hint.gpioled.3.name="blue"
+hint.gpioled.3.invert=0
+

Modified: projects/netbsd-tests-upstream-01-2017/sys/net/iflib.c
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/sys/net/iflib.c	Sun Jan 15 09:31:14 2017	(r312217)
+++ projects/netbsd-tests-upstream-01-2017/sys/net/iflib.c	Sun Jan 15 09:33:29 2017	(r312218)
@@ -133,10 +133,13 @@ typedef struct iflib_rxq *iflib_rxq_t;
 struct iflib_fl;
 typedef struct iflib_fl *iflib_fl_t;
 
+struct iflib_ctx;
+
 typedef struct iflib_filter_info {
 	driver_filter_t *ifi_filter;
 	void *ifi_filter_arg;
 	struct grouptask *ifi_task;
+	struct iflib_ctx *ifi_ctx;
 } *iflib_filter_info_t;
 
 struct iflib_ctx {
@@ -300,6 +303,8 @@ typedef struct iflib_sw_tx_desc_array {
 #define	IFC_MULTISEG		0x04
 #define	IFC_DMAR		0x08
 #define	IFC_SC_ALLOCATED	0x10
+#define	IFC_INIT_DONE		0x20
+
 
 #define CSUM_OFFLOAD		(CSUM_IP_TSO|CSUM_IP6_TSO|CSUM_IP| \
 				 CSUM_IP_UDP|CSUM_IP_TCP|CSUM_IP_SCTP| \
@@ -1194,7 +1199,7 @@ iflib_fast_intr(void *arg)
 	iflib_filter_info_t info = arg;
 	struct grouptask *gtask = info->ifi_task;
 
-	if (!smp_started)
+	if (!smp_started && mp_ncpus > 1)
 		return (FILTER_HANDLED);
 
 	DBG_COUNTER_INC(fast_intrs);
@@ -3753,6 +3758,7 @@ iflib_device_register(device_t dev, void
 
 	if_setgetcounterfn(ctx->ifc_ifp, iflib_if_get_counter);
 	iflib_add_device_sysctl_post(ctx);
+	ctx->ifc_flags |= IFC_INIT_DONE;
 	return (0);
 fail_detach:
 	ether_ifdetach(ctx->ifc_ifp);
@@ -4471,6 +4477,7 @@ iflib_irq_alloc_generic(if_ctx_t ctx, if
 	info->ifi_filter = filter;
 	info->ifi_filter_arg = filter_arg;
 	info->ifi_task = gtask;
+	info->ifi_ctx = ctx;
 
 	err = _iflib_irq_alloc(ctx, irq, rid, iflib_fast_intr, NULL, info,  name);
 	if (err != 0) {
@@ -4567,6 +4574,7 @@ iflib_legacy_setup(if_ctx_t ctx, driver_
 	info->ifi_filter = filter;
 	info->ifi_filter_arg = filter_arg;
 	info->ifi_task = gtask;
+	info->ifi_ctx = ctx;
 
 	/* We allocate a single interrupt resource */
 	if ((err = _iflib_irq_alloc(ctx, irq, tqrid, iflib_fast_intr, NULL, info, name)) != 0)

Modified: projects/netbsd-tests-upstream-01-2017/sys/sys/ata.h
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/sys/sys/ata.h	Sun Jan 15 09:31:14 2017	(r312217)
+++ projects/netbsd-tests-upstream-01-2017/sys/sys/ata.h	Sun Jan 15 09:33:29 2017	(r312218)
@@ -682,7 +682,7 @@ struct atapi_sense {
 #define	ATA_IDL_ATA_STRINGS	0x05	/* ATA Strings */
 #define	ATA_IDL_SECURITY	0x06	/* Security */
 #define	ATA_IDL_PARALLEL_ATA	0x07	/* Parallel ATA */
-#define	ATA_IDL_SERIAL_ATA	0x08	/* Seiral ATA */
+#define	ATA_IDL_SERIAL_ATA	0x08	/* Serial ATA */
 #define	ATA_IDL_ZDI		0x09	/* Zoned Device Information */
 
 struct ata_gp_log_dir {

Modified: projects/netbsd-tests-upstream-01-2017/sys/vm/vm_object.c
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/sys/vm/vm_object.c	Sun Jan 15 09:31:14 2017	(r312217)
+++ projects/netbsd-tests-upstream-01-2017/sys/vm/vm_object.c	Sun Jan 15 09:33:29 2017	(r312218)
@@ -1097,7 +1097,7 @@ vm_object_sync(vm_object_t object, vm_oo
  */
 void
 vm_object_madvise(vm_object_t object, vm_pindex_t pindex, vm_pindex_t end,
-    int advise)
+    int advice)
 {
 	vm_pindex_t tpindex;
 	vm_object_t backing_object, tobject;
@@ -1105,11 +1105,9 @@ vm_object_madvise(vm_object_t object, vm
 
 	if (object == NULL)
 		return;
+
 	VM_OBJECT_WLOCK(object);
-	/*
-	 * Locate and adjust resident pages
-	 */
-	for (; pindex < end; pindex += 1) {
+	for (m = NULL; pindex < end; pindex++) {
 relookup:
 		tobject = object;
 		tpindex = pindex;
@@ -1118,7 +1116,7 @@ shadowlookup:
 		 * MADV_FREE only operates on OBJT_DEFAULT or OBJT_SWAP pages
 		 * and those pages must be OBJ_ONEMAPPING.
 		 */
-		if (advise == MADV_FREE) {
+		if (advice == MADV_FREE) {
 			if ((tobject->type != OBJT_DEFAULT &&
 			     tobject->type != OBJT_SWAP) ||
 			    (tobject->flags & OBJ_ONEMAPPING) == 0) {
@@ -1126,15 +1124,29 @@ shadowlookup:
 			}
 		} else if ((tobject->flags & OBJ_UNMANAGED) != 0)
 			goto unlock_tobject;
-		m = vm_page_lookup(tobject, tpindex);
-		if (m == NULL) {
-			/*
-			 * There may be swap even if there is no backing page
-			 */
-			if (advise == MADV_FREE && tobject->type == OBJT_SWAP)
+
+		/*
+		 * In the common case where the object has no backing object, we
+		 * can avoid performing lookups at each pindex.  In either case,
+		 * when applying MADV_FREE we take care to release any swap
+		 * space used to store non-resident pages.
+		 */
+		if (object->backing_object == NULL) {
+			m = (m != NULL) ? TAILQ_NEXT(m, listq) :
+			    vm_page_find_least(object, pindex);
+			tpindex = (m != NULL && m->pindex < end) ?
+			    m->pindex : end;
+			if (advice == MADV_FREE && object->type == OBJT_SWAP &&
+			    tpindex > pindex)
+				swap_pager_freespace(object, pindex,
+				    tpindex - pindex);
+			if ((pindex = tpindex) == end)
+				break;
+		} else if ((m = vm_page_lookup(tobject, tpindex)) == NULL) {
+			if (advice == MADV_FREE && tobject->type == OBJT_SWAP)
 				swap_pager_freespace(tobject, tpindex, 1);
 			/*
-			 * next object
+			 * Prepare to search the next object in the chain.
 			 */
 			backing_object = tobject->backing_object;
 			if (backing_object == NULL)
@@ -1145,11 +1157,13 @@ shadowlookup:
 				VM_OBJECT_WUNLOCK(tobject);
 			tobject = backing_object;
 			goto shadowlookup;
-		} else if (m->valid != VM_PAGE_BITS_ALL)
-			goto unlock_tobject;
+		}
+
 		/*
 		 * If the page is not in a normal state, skip it.
 		 */
+		if (m->valid != VM_PAGE_BITS_ALL)
+			goto unlock_tobject;
 		vm_page_lock(m);
 		if (m->hold_count != 0 || m->wire_count != 0) {
 			vm_page_unlock(m);
@@ -1160,7 +1174,7 @@ shadowlookup:
 		KASSERT((m->oflags & VPO_UNMANAGED) == 0,
 		    ("vm_object_madvise: page %p is not managed", m));
 		if (vm_page_busied(m)) {
-			if (advise == MADV_WILLNEED) {
+			if (advice == MADV_WILLNEED) {
 				/*
 				 * Reference the page before unlocking and
 				 * sleeping so that the page daemon is less
@@ -1172,21 +1186,18 @@ shadowlookup:
 				VM_OBJECT_WUNLOCK(object);
 			VM_OBJECT_WUNLOCK(tobject);
 			vm_page_busy_sleep(m, "madvpo", false);
+			m = NULL;
 			VM_OBJECT_WLOCK(object);
   			goto relookup;
 		}
-		if (advise == MADV_WILLNEED) {
-			vm_page_activate(m);
-		} else {
-			vm_page_advise(m, advise);
-		}
+		vm_page_advise(m, advice);
 		vm_page_unlock(m);
-		if (advise == MADV_FREE && tobject->type == OBJT_SWAP)
+		if (advice == MADV_FREE && tobject->type == OBJT_SWAP)
 			swap_pager_freespace(tobject, tpindex, 1);
 unlock_tobject:
 		if (tobject != object)
 			VM_OBJECT_WUNLOCK(tobject);
-	}	
+	}
 	VM_OBJECT_WUNLOCK(object);
 }
 

Modified: projects/netbsd-tests-upstream-01-2017/sys/vm/vm_page.c
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/sys/vm/vm_page.c	Sun Jan 15 09:31:14 2017	(r312217)
+++ projects/netbsd-tests-upstream-01-2017/sys/vm/vm_page.c	Sun Jan 15 09:33:29 2017	(r312218)
@@ -3002,7 +3002,7 @@ vm_page_try_to_free(vm_page_t m)
 /*
  * vm_page_advise
  *
- * 	Deactivate or do nothing, as appropriate.
+ * 	Apply the specified advice to the given page.
  *
  *	The object and page must be locked.
  */
@@ -3020,8 +3020,11 @@ vm_page_advise(vm_page_t m, int advice)
 		 * would result in a page fault on a later access.
 		 */
 		vm_page_undirty(m);
-	else if (advice != MADV_DONTNEED)
+	else if (advice != MADV_DONTNEED) {
+		if (advice == MADV_WILLNEED)
+			vm_page_activate(m);
 		return;
+	}
 
 	/*
 	 * Clear any references to the page.  Otherwise, the page daemon will

Modified: projects/netbsd-tests-upstream-01-2017/tests/sys/kern/acct/Makefile
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/tests/sys/kern/acct/Makefile	Sun Jan 15 09:31:14 2017	(r312217)
+++ projects/netbsd-tests-upstream-01-2017/tests/sys/kern/acct/Makefile	Sun Jan 15 09:33:29 2017	(r312218)
@@ -13,6 +13,7 @@ acct_test.o: convert.c
 
 convert.c: ${SRCTOP}/sys/kern/kern_acct.c
 	sed -n -e 's/log(/syslog(/g' \
+	       -e 's/exp/expected/g' \
 	       -e '/FLOAT_CONVERSION_START/,/FLOAT_CONVERSION_END/p' ${.ALLSRC} >${.TARGET}.tmp
 	mv ${.TARGET}.tmp ${.TARGET}
 

Modified: projects/netbsd-tests-upstream-01-2017/tests/sys/mac/bsdextended/ugidfw_test.c
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/tests/sys/mac/bsdextended/ugidfw_test.c	Sun Jan 15 09:31:14 2017	(r312217)
+++ projects/netbsd-tests-upstream-01-2017/tests/sys/mac/bsdextended/ugidfw_test.c	Sun Jan 15 09:33:29 2017	(r312218)
@@ -222,7 +222,7 @@ main(void)
 		return (0);
 	}
 
-	printf("1..%lu\n", nitems(test_users) + nitems(test_groups) +
+	printf("1..%zu\n", nitems(test_users) + nitems(test_groups) +
 	    3 * nitems(test_strings) + 2);
 
 	test_libugidfw_strings();

Modified: projects/netbsd-tests-upstream-01-2017/tests/sys/vfs/lookup_cap_dotdot.c
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/tests/sys/vfs/lookup_cap_dotdot.c	Sun Jan 15 09:31:14 2017	(r312217)
+++ projects/netbsd-tests-upstream-01-2017/tests/sys/vfs/lookup_cap_dotdot.c	Sun Jan 15 09:33:29 2017	(r312218)
@@ -124,6 +124,8 @@ ATF_TC_BODY(lookup_cap_dotdot__basic, tc
 	cap_rights_init(&rights, CAP_LOOKUP, CAP_READ);
 	ATF_REQUIRE(cap_rights_limit(dirfd, &rights) >= 0);
 
+	atf_tc_expect_signal(SIGABRT, "needs change done upstream in atf/kyua according to cem: bug 215690");
+
 	ATF_REQUIRE(cap_enter() >= 0);
 
 	ATF_REQUIRE_MSG(openat(dirfd, "d1/..", O_RDONLY) >= 0, "%s",
@@ -144,6 +146,8 @@ ATF_TC_BODY(lookup_cap_dotdot__advanced,
 	check_capsicum();
 	prepare_dotdot_tests();
 
+	atf_tc_expect_signal(SIGABRT, "needs change done upstream in atf/kyua according to cem: bug 215690");
+
 	cap_rights_init(&rights, CAP_LOOKUP, CAP_READ);
 	ATF_REQUIRE(cap_rights_limit(dirfd, &rights) >= 0);
 
@@ -187,6 +191,8 @@ ATF_TC_BODY(capmode__negative, tc)
 	check_capsicum();
 	prepare_dotdot_tests();
 
+	atf_tc_expect_signal(SIGABRT, "needs change done upstream in atf/kyua according to cem: bug 215690");
+
 	ATF_REQUIRE(cap_enter() == 0);
 
 	/* open() not permitted in capability mode */
@@ -225,6 +231,8 @@ ATF_TC_BODY(lookup_cap_dotdot__negative,
 	cap_rights_init(&rights, CAP_LOOKUP, CAP_READ);
 	ATF_REQUIRE(cap_rights_limit(dirfd, &rights) >= 0);
 
+	atf_tc_expect_signal(SIGABRT, "needs change done upstream in atf/kyua according to cem: bug 215690");
+
 	ATF_REQUIRE(cap_enter() >= 0);
 
 	ATF_REQUIRE_ERRNO(ENOTCAPABLE, openat(dirfd, "..", O_RDONLY) < 0);

Modified: projects/netbsd-tests-upstream-01-2017/usr.sbin/ctld/ctld.c
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/usr.sbin/ctld/ctld.c	Sun Jan 15 09:31:14 2017	(r312217)
+++ projects/netbsd-tests-upstream-01-2017/usr.sbin/ctld/ctld.c	Sun Jan 15 09:33:29 2017	(r312218)
@@ -1582,6 +1582,7 @@ connection_new(struct portal *portal, in
 	 * Default values, from RFC 3720, section 12.
 	 */
 	conn->conn_max_recv_data_segment_length = 8192;
+	conn->conn_max_send_data_segment_length = 8192;
 	conn->conn_max_burst_length = 262144;
 	conn->conn_first_burst_length = 65536;
 	conn->conn_immediate_data = true;

Modified: projects/netbsd-tests-upstream-01-2017/usr.sbin/ctld/ctld.h
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/usr.sbin/ctld/ctld.h	Sun Jan 15 09:31:14 2017	(r312217)
+++ projects/netbsd-tests-upstream-01-2017/usr.sbin/ctld/ctld.h	Sun Jan 15 09:33:29 2017	(r312218)
@@ -48,8 +48,6 @@
 #define	MAX_LUNS			1024
 #define	MAX_NAME_LEN			223
 #define	MAX_DATA_SEGMENT_LENGTH		(128 * 1024)
-#define	MAX_BURST_LENGTH		16776192
-#define	FIRST_BURST_LENGTH		(128 * 1024)
 #define	SOCKBUF_SIZE			1048576
 
 struct auth {
@@ -242,6 +240,10 @@ struct connection {
 	struct sockaddr_storage	conn_initiator_sa;
 	uint32_t		conn_cmdsn;
 	uint32_t		conn_statsn;
+	int			conn_max_recv_data_segment_limit;
+	int			conn_max_send_data_segment_limit;
+	int			conn_max_burst_limit;
+	int			conn_first_burst_limit;
 	int			conn_max_recv_data_segment_length;
 	int			conn_max_send_data_segment_length;
 	int			conn_max_burst_length;

Modified: projects/netbsd-tests-upstream-01-2017/usr.sbin/ctld/login.c
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/usr.sbin/ctld/login.c	Sun Jan 15 09:31:14 2017	(r312217)
+++ projects/netbsd-tests-upstream-01-2017/usr.sbin/ctld/login.c	Sun Jan 15 09:33:29 2017	(r312218)
@@ -557,13 +557,15 @@ login_negotiate_key(struct pdu *request,
 		 * our MaxRecvDataSegmentLength is not influenced by the
 		 * initiator in any way.
 		 */
-		if ((int)tmp > conn->conn_max_send_data_segment_length) {
-			log_debugx("capping max_send_data_segment_length "
+		if ((int)tmp > conn->conn_max_send_data_segment_limit) {
+			log_debugx("capping MaxRecvDataSegmentLength "
 			    "from %zd to %d", tmp,
-			    conn->conn_max_send_data_segment_length);
-			tmp = conn->conn_max_send_data_segment_length;
+			    conn->conn_max_send_data_segment_limit);
+			tmp = conn->conn_max_send_data_segment_limit;
 		}
 		conn->conn_max_send_data_segment_length = tmp;
+		conn->conn_max_recv_data_segment_length =
+		    conn->conn_max_recv_data_segment_limit;
 		keys_add_int(response_keys, name,
 		    conn->conn_max_recv_data_segment_length);
 	} else if (strcmp(name, "MaxBurstLength") == 0) {
@@ -572,10 +574,10 @@ login_negotiate_key(struct pdu *request,
 			login_send_error(request, 0x02, 0x00);
 			log_errx(1, "received invalid MaxBurstLength");
 		}
-		if ((int)tmp > conn->conn_max_burst_length) {
+		if ((int)tmp > conn->conn_max_burst_limit) {
 			log_debugx("capping MaxBurstLength from %zd to %d",
-			    tmp, conn->conn_max_burst_length);
-			tmp = conn->conn_max_burst_length;
+			    tmp, conn->conn_max_burst_limit);
+			tmp = conn->conn_max_burst_limit;
 		}
 		conn->conn_max_burst_length = tmp;
 		keys_add_int(response_keys, name, tmp);
@@ -585,10 +587,10 @@ login_negotiate_key(struct pdu *request,
 			login_send_error(request, 0x02, 0x00);
 			log_errx(1, "received invalid FirstBurstLength");
 		}
-		if ((int)tmp > conn->conn_first_burst_length) {
+		if ((int)tmp > conn->conn_first_burst_limit) {
 			log_debugx("capping FirstBurstLength from %zd to %d",
-			    tmp, conn->conn_first_burst_length);
-			tmp = conn->conn_first_burst_length;
+			    tmp, conn->conn_first_burst_limit);
+			tmp = conn->conn_first_burst_limit;
 		}
 		conn->conn_first_burst_length = tmp;
 		keys_add_int(response_keys, name, tmp);
@@ -694,25 +696,42 @@ login_negotiate(struct connection *conn,
 		 * offload, it depends on hardware capabilities.
 		 */
 		assert(conn->conn_target != NULL);
+		conn->conn_max_recv_data_segment_limit = (1 << 24) - 1;
+		conn->conn_max_send_data_segment_limit = (1 << 24) - 1;
+		conn->conn_max_burst_limit = (1 << 24) - 1;
+		conn->conn_first_burst_limit = (1 << 24) - 1;
 		kernel_limits(conn->conn_portal->p_portal_group->pg_offload,
-		    &conn->conn_max_recv_data_segment_length,
-		    &conn->conn_max_send_data_segment_length,
-		    &conn->conn_max_burst_length,
-		    &conn->conn_first_burst_length);
+		    &conn->conn_max_recv_data_segment_limit,
+		    &conn->conn_max_send_data_segment_limit,
+		    &conn->conn_max_burst_limit,
+		    &conn->conn_first_burst_limit);
 
 		/* We expect legal, usable values at this point. */
-		assert(conn->conn_max_recv_data_segment_length >= 512);
-		assert(conn->conn_max_recv_data_segment_length < (1 << 24));
-		assert(conn->conn_max_burst_length >= 512);
-		assert(conn->conn_max_burst_length < (1 << 24));
-		assert(conn->conn_first_burst_length >= 512);
-		assert(conn->conn_first_burst_length < (1 << 24));
-		assert(conn->conn_first_burst_length <=
-		    conn->conn_max_burst_length);
+		assert(conn->conn_max_recv_data_segment_limit >= 512);
+		assert(conn->conn_max_recv_data_segment_limit < (1 << 24));
+		assert(conn->conn_max_send_data_segment_limit >= 512);
+		assert(conn->conn_max_send_data_segment_limit < (1 << 24));
+		assert(conn->conn_max_burst_limit >= 512);
+		assert(conn->conn_max_burst_limit < (1 << 24));
+		assert(conn->conn_first_burst_limit >= 512);
+		assert(conn->conn_first_burst_limit < (1 << 24));
+		assert(conn->conn_first_burst_limit <=
+		    conn->conn_max_burst_limit);
+
+		/*
+		 * Limit default send length in case it won't be negotiated.
+		 * We can't do it for other limits, since they may affect both
+		 * sender and receiver operation, and we must obey defaults.
+		 */
+		if (conn->conn_max_send_data_segment_limit <
+		    conn->conn_max_send_data_segment_length) {
+			conn->conn_max_send_data_segment_length =
+			    conn->conn_max_send_data_segment_limit;
+		}
 	} else {
-		conn->conn_max_recv_data_segment_length =
+		conn->conn_max_recv_data_segment_limit =
 		    MAX_DATA_SEGMENT_LENGTH;
-		conn->conn_max_send_data_segment_length =
+		conn->conn_max_send_data_segment_limit =
 		    MAX_DATA_SEGMENT_LENGTH;
 	}
 

Modified: projects/netbsd-tests-upstream-01-2017/usr.sbin/inetd/inetd.c
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/usr.sbin/inetd/inetd.c	Sun Jan 15 09:31:14 2017	(r312217)
+++ projects/netbsd-tests-upstream-01-2017/usr.sbin/inetd/inetd.c	Sun Jan 15 09:33:29 2017	(r312218)
@@ -138,7 +138,9 @@ __FBSDID("$FreeBSD$");
 #include <string.h>
 #include <sysexits.h>
 #include <syslog.h>
+#ifdef LIBWRAP
 #include <tcpd.h>
+#endif
 #include <unistd.h>
 
 #include "inetd.h"
@@ -307,6 +309,7 @@ getvalue(const char *arg, int *value, co
 	return 0;				/* success */
 }
 
+#ifdef LIBWRAP
 static sa_family_t
 whichaf(struct request_info *req)
 {
@@ -322,6 +325,7 @@ whichaf(struct request_info *req)
 #endif
 	return sa->sa_family;
 }
+#endif
 
 int
 main(int argc, char **argv)

Modified: projects/netbsd-tests-upstream-01-2017/usr.sbin/iscsid/iscsid.c
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/usr.sbin/iscsid/iscsid.c	Sun Jan 15 09:31:14 2017	(r312217)
+++ projects/netbsd-tests-upstream-01-2017/usr.sbin/iscsid/iscsid.c	Sun Jan 15 09:33:29 2017	(r312218)
@@ -172,8 +172,10 @@ connection_new(int iscsi_fd, const struc
 	conn->conn_data_digest = CONN_DIGEST_NONE;
 	conn->conn_initial_r2t = true;
 	conn->conn_immediate_data = true;
-	conn->conn_max_burst_length = MAX_BURST_LENGTH;
-	conn->conn_first_burst_length = FIRST_BURST_LENGTH;
+	conn->conn_max_recv_data_segment_length = 8192;
+	conn->conn_max_send_data_segment_length = 8192;
+	conn->conn_max_burst_length = 262144;
+	conn->conn_first_burst_length = 65536;
 	conn->conn_iscsi_fd = iscsi_fd;
 
 	conn->conn_session_id = request->idr_session_id;
@@ -190,31 +192,28 @@ connection_new(int iscsi_fd, const struc
 	 */
 	isl = &conn->conn_limits;
 	memcpy(isl, &request->idr_limits, sizeof(*isl));
-	if (isl->isl_max_recv_data_segment_length == 0) {
-		conn->conn_max_recv_data_segment_length = 8192;
-		conn->conn_max_send_data_segment_length = 8192;
-		isl->isl_max_recv_data_segment_length = 8192;
-	} else {
-		conn->conn_max_recv_data_segment_length =
-		    isl->isl_max_recv_data_segment_length;
-		conn->conn_max_send_data_segment_length =
-		    isl->isl_max_recv_data_segment_length;
-	}
-	if (isl->isl_max_send_data_segment_length == 0) {
+	if (isl->isl_max_recv_data_segment_length == 0)
+		isl->isl_max_recv_data_segment_length = (1 << 24) - 1;
+	if (isl->isl_max_send_data_segment_length == 0)
 		isl->isl_max_send_data_segment_length =
 		    isl->isl_max_recv_data_segment_length;
-	} else {
+	if (isl->isl_max_burst_length == 0)
+		isl->isl_max_burst_length = (1 << 24) - 1;
+	if (isl->isl_first_burst_length == 0)
+		isl->isl_first_burst_length = (1 << 24) - 1;
+	if (isl->isl_first_burst_length > isl->isl_max_burst_length)
+		isl->isl_first_burst_length = isl->isl_max_burst_length;
+
+	/*
+	 * Limit default send length in case it won't be negotiated.
+	 * We can't do it for other limits, since they may affect both
+	 * sender and receiver operation, and we must obey defaults.
+	 */
+	if (conn->conn_max_send_data_segment_length >
+	    isl->isl_max_send_data_segment_length) {
 		conn->conn_max_send_data_segment_length =
 		    isl->isl_max_send_data_segment_length;
 	}
-	if (isl->isl_max_burst_length == 0)
-		isl->isl_max_burst_length = conn->conn_max_burst_length;
-	if (isl->isl_first_burst_length == 0) {
-		if (isl->isl_max_burst_length < (int)conn->conn_first_burst_length)
-			isl->isl_first_burst_length = isl->isl_max_burst_length;
-		else
-			isl->isl_first_burst_length = conn->conn_first_burst_length;
-	}
 
 	from_addr = conn->conn_conf.isc_initiator_addr;
 	to_addr = conn->conn_conf.isc_target_addr;

Modified: projects/netbsd-tests-upstream-01-2017/usr.sbin/iscsid/iscsid.h
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/usr.sbin/iscsid/iscsid.h	Sun Jan 15 09:31:14 2017	(r312217)
+++ projects/netbsd-tests-upstream-01-2017/usr.sbin/iscsid/iscsid.h	Sun Jan 15 09:33:29 2017	(r312218)
@@ -44,8 +44,6 @@
 
 #define	CONN_MUTUAL_CHALLENGE_LEN	1024
 #define	SOCKBUF_SIZE			1048576
-#define	MAX_BURST_LENGTH		(256 * 1024)
-#define	FIRST_BURST_LENGTH		(128 * 1024)
 
 struct connection {
 	int			conn_iscsi_fd;

Modified: projects/netbsd-tests-upstream-01-2017/usr.sbin/iscsid/login.c
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/usr.sbin/iscsid/login.c	Sun Jan 15 09:31:14 2017	(r312217)
+++ projects/netbsd-tests-upstream-01-2017/usr.sbin/iscsid/login.c	Sun Jan 15 09:33:29 2017	(r312218)
@@ -397,6 +397,9 @@ login_negotiate_key(struct connection *c
 			tmp = isl->isl_max_send_data_segment_length;
 		}
 		conn->conn_max_send_data_segment_length = tmp;
+		/* We received target's limit, that means it accepted our's. */
+		conn->conn_max_recv_data_segment_length =
+		    isl->isl_max_recv_data_segment_length;
 	} else if (strcmp(name, "MaxBurstLength") == 0) {
 		tmp = strtoul(value, NULL, 10);
 		if (tmp <= 0)

From owner-svn-src-projects@freebsd.org  Sun Jan 15 10:03:05 2017
Return-Path: <owner-svn-src-projects@freebsd.org>
Delivered-To: svn-src-projects@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0FC70CA51C4
 for <svn-src-projects@mailman.ysv.freebsd.org>;
 Sun, 15 Jan 2017 10:03:05 +0000 (UTC)
 (envelope-from ngie@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id D283A1DC8;
 Sun, 15 Jan 2017 10:03:04 +0000 (UTC)
 (envelope-from ngie@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0FA34Cg086320;
 Sun, 15 Jan 2017 10:03:04 GMT (envelope-from ngie@FreeBSD.org)
Received: (from ngie@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0FA34KT086319;
 Sun, 15 Jan 2017 10:03:04 GMT (envelope-from ngie@FreeBSD.org)
Message-Id: <201701151003.v0FA34KT086319@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: ngie set sender to
 ngie@FreeBSD.org using -f
From: Ngie Cooper <ngie@FreeBSD.org>
Date: Sun, 15 Jan 2017 10:03:04 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject: svn commit: r312220 -
 projects/netbsd-tests-upstream-01-2017/lib/libc/tests/regex
X-SVN-Group: projects
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-projects@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the src &quot; projects&quot;
 tree" <svn-src-projects.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-projects>, 
 <mailto:svn-src-projects-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-projects/>
List-Post: <mailto:svn-src-projects@freebsd.org>
List-Help: <mailto:svn-src-projects-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-projects>, 
 <mailto:svn-src-projects-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 15 Jan 2017 10:03:05 -0000

Author: ngie
Date: Sun Jan 15 10:03:03 2017
New Revision: 312220
URL: https://svnweb.freebsd.org/changeset/base/312220

Log:
  Add -DSKIP_LEFTASSOC to CFLAGS so leftassoc is skipped, like on NetBSD

Modified:
  projects/netbsd-tests-upstream-01-2017/lib/libc/tests/regex/Makefile

Modified: projects/netbsd-tests-upstream-01-2017/lib/libc/tests/regex/Makefile
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/lib/libc/tests/regex/Makefile	Sun Jan 15 09:35:49 2017	(r312219)
+++ projects/netbsd-tests-upstream-01-2017/lib/libc/tests/regex/Makefile	Sun Jan 15 10:03:03 2017	(r312220)
@@ -6,7 +6,8 @@ PACKAGE=	tests
 
 BINDIR=		${TESTSDIR}
 
-IMPLEMENTATION?=      -DREGEX_SPENCER
+# SKIP_LEFTASSOC -> these testcases fail on FreeBSD.
+IMPLEMENTATION?=      -DREGEX_SPENCER -DSKIP_LEFTASSOC
 
 CFLAGS.h_regex+=-I${TESTSRC} -I${.CURDIR:H:H}/regex
 PROGS+=		h_regex

From owner-svn-src-projects@freebsd.org  Sun Jan 15 10:04:22 2017
Return-Path: <owner-svn-src-projects@freebsd.org>
Delivered-To: svn-src-projects@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id C0CD5CA529C
 for <svn-src-projects@mailman.ysv.freebsd.org>;
 Sun, 15 Jan 2017 10:04:22 +0000 (UTC)
 (envelope-from ngie@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 5EF081FA1;
 Sun, 15 Jan 2017 10:04:22 +0000 (UTC)
 (envelope-from ngie@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0FA4Ljp086414;
 Sun, 15 Jan 2017 10:04:21 GMT (envelope-from ngie@FreeBSD.org)
Received: (from ngie@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0FA4Kcg086400;
 Sun, 15 Jan 2017 10:04:20 GMT (envelope-from ngie@FreeBSD.org)
Message-Id: <201701151004.v0FA4Kcg086400@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: ngie set sender to
 ngie@FreeBSD.org using -f
From: Ngie Cooper <ngie@FreeBSD.org>
Date: Sun, 15 Jan 2017 10:04:20 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject: svn commit: r312221 - in
 projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests: kernel
 lib/libc/c063 lib/libc/gen lib/libc/regex lib/libc/setjmp lib/libc/string
 lib/libc/sys lib/librt usr.bin...
X-SVN-Group: projects
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-projects@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the src &quot; projects&quot;
 tree" <svn-src-projects.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-projects>, 
 <mailto:svn-src-projects-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-projects/>
List-Post: <mailto:svn-src-projects@freebsd.org>
List-Help: <mailto:svn-src-projects-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-projects>, 
 <mailto:svn-src-projects-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 15 Jan 2017 10:04:22 -0000

Author: ngie
Date: Sun Jan 15 10:04:20 2017
New Revision: 312221
URL: https://svnweb.freebsd.org/changeset/base/312221

Log:
  Pull in ^/vendor/NetBSD/tests/dist@r312219
  
  Remove divergence with upstream where possible

Modified:
  projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/kernel/t_mqueue.c
  projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/kernel/t_ptrace_wait.c
  projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/c063/t_mkfifoat.c
  projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/gen/t_glob.c
  projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/regex/t_regex_att.c
  projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/setjmp/t_setjmp.c
  projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/setjmp/t_threadjmp.c
  projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/string/t_strlen.c
  projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/sys/t_mincore.c
  projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/sys/t_msync.c
  projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/sys/t_unlink.c
  projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/librt/t_sem.c
  projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/usr.bin/grep/t_grep.sh
  projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/usr.sbin/mtree/t_mtree.sh
Directory Properties:
  projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/   (props changed)

Modified: projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/kernel/t_mqueue.c
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/kernel/t_mqueue.c	Sun Jan 15 10:03:03 2017	(r312220)
+++ projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/kernel/t_mqueue.c	Sun Jan 15 10:04:20 2017	(r312221)
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_mqueue.c,v 1.5 2017/01/10 22:10:22 christos Exp $ */
+/*	$NetBSD: t_mqueue.c,v 1.6 2017/01/14 20:57:24 christos Exp $ */
 
 /*
  * Test for POSIX message queue priority handling.
@@ -6,23 +6,20 @@
  * This file is in the Public Domain.
  */
 
-#ifdef __FreeBSD__
 #include <sys/stat.h>
-#include <fcntl.h>
-
-#include "freebsd_test_suite/macros.h"
-#endif
 
 #include <atf-c.h>
-#include <sys/stat.h>
-
+#include <errno.h>
+#include <fcntl.h>
+#include <mqueue.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <errno.h>
 #include <unistd.h>
 
-#include <mqueue.h>
+#ifdef __FreeBSD__
+#include "freebsd_test_suite/macros.h"
+#endif
 
 #define	MQ_PRIO_BASE	24
 

Modified: projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/kernel/t_ptrace_wait.c
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/kernel/t_ptrace_wait.c	Sun Jan 15 10:03:03 2017	(r312220)
+++ projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/kernel/t_ptrace_wait.c	Sun Jan 15 10:04:20 2017	(r312221)
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_ptrace_wait.c,v 1.58 2017/01/14 04:37:55 kamil Exp $	*/
+/*	$NetBSD: t_ptrace_wait.c,v 1.60 2017/01/14 19:17:10 kamil Exp $	*/
 
 /*-
  * Copyright (c) 2016 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: t_ptrace_wait.c,v 1.58 2017/01/14 04:37:55 kamil Exp $");
+__RCSID("$NetBSD: t_ptrace_wait.c,v 1.60 2017/01/14 19:17:10 kamil Exp $");
 
 #include <sys/param.h>
 #include <sys/types.h>
@@ -39,6 +39,7 @@ __RCSID("$NetBSD: t_ptrace_wait.c,v 1.58
 #include <machine/reg.h>
 #include <err.h>
 #include <errno.h>
+#include <lwp.h>
 #include <signal.h>
 #include <stdint.h>
 #include <stdio.h>
@@ -1184,6 +1185,116 @@ ATF_TC_BODY(eventmask4, tc)
 	TWAIT_REQUIRE_FAILURE(ECHILD, wpid = TWAIT_GENERIC(child, &status, 0));
 }
 
+ATF_TC(eventmask5);
+ATF_TC_HEAD(eventmask5, tc)
+{
+	atf_tc_set_md_var(tc, "descr",
+	    "Verify that PTRACE_LWP_CREATE in EVENT_MASK is preserved");
+}
+
+ATF_TC_BODY(eventmask5, tc)
+{
+	const int exitval = 5;
+	const int sigval = SIGSTOP;
+	pid_t child, wpid;
+#if defined(TWAIT_HAVE_STATUS)
+	int status;
+#endif
+	ptrace_event_t set_event, get_event;
+	const int len = sizeof(ptrace_event_t);
+
+	printf("Before forking process PID=%d\n", getpid());
+	ATF_REQUIRE((child = fork()) != -1);
+	if (child == 0) {
+		printf("Before calling PT_TRACE_ME from child %d\n", getpid());
+		FORKEE_ASSERT(ptrace(PT_TRACE_ME, 0, NULL, 0) != -1);
+
+		printf("Before raising %s from child\n", strsignal(sigval));
+		FORKEE_ASSERT(raise(sigval) == 0);
+
+		printf("Before exiting of the child process\n");
+		_exit(exitval);
+	}
+	printf("Parent process PID=%d, child's PID=%d\n", getpid(), child);
+
+	printf("Before calling %s() for the child\n", TWAIT_FNAME);
+	TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
+
+	validate_status_stopped(status, sigval);
+
+	set_event.pe_set_event = PTRACE_LWP_CREATE;
+	ATF_REQUIRE(ptrace(PT_SET_EVENT_MASK, child, &set_event, len) != -1);
+	ATF_REQUIRE(ptrace(PT_GET_EVENT_MASK, child, &get_event, len) != -1);
+	ATF_REQUIRE(memcmp(&set_event, &get_event, len) == 0);
+
+	printf("Before resuming the child process where it left off and "
+	    "without signal to be sent\n");
+	ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
+
+	printf("Before calling %s() for the child\n", TWAIT_FNAME);
+	TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
+
+	validate_status_exited(status, exitval);
+
+	printf("Before calling %s() for the child\n", TWAIT_FNAME);
+	TWAIT_REQUIRE_FAILURE(ECHILD, wpid = TWAIT_GENERIC(child, &status, 0));
+}
+
+ATF_TC(eventmask6);
+ATF_TC_HEAD(eventmask6, tc)
+{
+	atf_tc_set_md_var(tc, "descr",
+	    "Verify that PTRACE_LWP_EXIT in EVENT_MASK is preserved");
+}
+
+ATF_TC_BODY(eventmask6, tc)
+{
+	const int exitval = 5;
+	const int sigval = SIGSTOP;
+	pid_t child, wpid;
+#if defined(TWAIT_HAVE_STATUS)
+	int status;
+#endif
+	ptrace_event_t set_event, get_event;
+	const int len = sizeof(ptrace_event_t);
+
+	printf("Before forking process PID=%d\n", getpid());
+	ATF_REQUIRE((child = fork()) != -1);
+	if (child == 0) {
+		printf("Before calling PT_TRACE_ME from child %d\n", getpid());
+		FORKEE_ASSERT(ptrace(PT_TRACE_ME, 0, NULL, 0) != -1);
+
+		printf("Before raising %s from child\n", strsignal(sigval));
+		FORKEE_ASSERT(raise(sigval) == 0);
+
+		printf("Before exiting of the child process\n");
+		_exit(exitval);
+	}
+	printf("Parent process PID=%d, child's PID=%d\n", getpid(), child);
+
+	printf("Before calling %s() for the child\n", TWAIT_FNAME);
+	TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
+
+	validate_status_stopped(status, sigval);
+
+	set_event.pe_set_event = PTRACE_LWP_EXIT;
+	ATF_REQUIRE(ptrace(PT_SET_EVENT_MASK, child, &set_event, len) != -1);
+	ATF_REQUIRE(ptrace(PT_GET_EVENT_MASK, child, &get_event, len) != -1);
+	ATF_REQUIRE(memcmp(&set_event, &get_event, len) == 0);
+
+	printf("Before resuming the child process where it left off and "
+	    "without signal to be sent\n");
+	ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
+
+	printf("Before calling %s() for the child\n", TWAIT_FNAME);
+	TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
+
+	validate_status_exited(status, exitval);
+
+	printf("Before calling %s() for the child\n", TWAIT_FNAME);
+	TWAIT_REQUIRE_FAILURE(ECHILD, wpid = TWAIT_GENERIC(child, &status, 0));
+}
+
 #if defined(TWAIT_HAVE_PID)
 ATF_TC(fork1);
 ATF_TC_HEAD(fork1, tc)
@@ -5286,6 +5397,207 @@ ATF_TC_BODY(siginfo6, tc)
 }
 #endif
 
+volatile lwpid_t the_lwp_id = 0;
+
+static void
+lwp_main_func(void *arg)
+{
+	the_lwp_id = _lwp_self();
+	_lwp_exit();
+}
+
+ATF_TC(lwp_create1);
+ATF_TC_HEAD(lwp_create1, tc)
+{
+	atf_tc_set_md_var(tc, "descr",
+	    "Verify that 1 LWP creation is intercepted by ptrace(2) with "
+	    "EVENT_MASK set to PTRACE_LWP_CREATE");
+}
+
+ATF_TC_BODY(lwp_create1, tc)
+{
+	const int exitval = 5;
+	const int sigval = SIGSTOP;
+	pid_t child, wpid;
+#if defined(TWAIT_HAVE_STATUS)
+	int status;
+#endif
+	ptrace_state_t state;
+	const int slen = sizeof(state);
+	ptrace_event_t event;
+	const int elen = sizeof(event);
+	ucontext_t uc;
+	lwpid_t lid;
+	static const size_t ssize = 16*1024;
+	void *stack;
+
+	printf("Before forking process PID=%d\n", getpid());
+	ATF_REQUIRE((child = fork()) != -1);
+	if (child == 0) {
+		printf("Before calling PT_TRACE_ME from child %d\n", getpid());
+		FORKEE_ASSERT(ptrace(PT_TRACE_ME, 0, NULL, 0) != -1);
+
+		printf("Before raising %s from child\n", strsignal(sigval));
+		FORKEE_ASSERT(raise(sigval) == 0);
+
+		printf("Before allocating memory for stack in child\n");
+		FORKEE_ASSERT((stack = malloc(ssize)) != NULL);
+
+		printf("Before making context for new lwp in child\n");
+		_lwp_makecontext(&uc, lwp_main_func, NULL, NULL, stack, ssize);
+
+		printf("Before creating new in child\n");
+		FORKEE_ASSERT(_lwp_create(&uc, 0, &lid) == 0);
+
+		printf("Before waiting for lwp %d to exit\n", lid);
+		FORKEE_ASSERT(_lwp_wait(lid, NULL) == 0);
+
+		printf("Before verifying that reported %d and running lid %d "
+		    "are the same\n", lid, the_lwp_id);
+		FORKEE_ASSERT_EQ(lid, the_lwp_id);
+
+		printf("Before exiting of the child process\n");
+		_exit(exitval);
+	}
+	printf("Parent process PID=%d, child's PID=%d\n", getpid(), child);
+
+	printf("Before calling %s() for the child\n", TWAIT_FNAME);
+	TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
+
+	validate_status_stopped(status, sigval);
+
+	printf("Set empty EVENT_MASK for the child %d\n", child);
+	event.pe_set_event = PTRACE_LWP_CREATE;
+	ATF_REQUIRE(ptrace(PT_SET_EVENT_MASK, child, &event, elen) != -1);
+
+	printf("Before resuming the child process where it left off and "
+	    "without signal to be sent\n");
+	ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
+
+	printf("Before calling %s() for the child - expected stopped "
+	    "SIGTRAP\n", TWAIT_FNAME);
+	TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
+
+	validate_status_stopped(status, SIGTRAP);
+
+	ATF_REQUIRE(ptrace(PT_GET_PROCESS_STATE, child, &state, slen) != -1);
+
+	ATF_REQUIRE_EQ(state.pe_report_event, PTRACE_LWP_CREATE);
+
+	lid = state.pe_lwp;
+	printf("Reported PTRACE_LWP_CREATE event with lid %d\n", lid);
+
+	printf("Before resuming the child process where it left off and "
+	    "without signal to be sent\n");
+	ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
+
+	printf("Before calling %s() for the child - expected exited\n",
+	    TWAIT_FNAME);
+	TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
+
+	validate_status_exited(status, exitval);
+
+	printf("Before calling %s() for the child - expected no process\n",
+	    TWAIT_FNAME);
+	TWAIT_REQUIRE_FAILURE(ECHILD, wpid = TWAIT_GENERIC(child, &status, 0));
+}
+
+ATF_TC(lwp_exit1);
+ATF_TC_HEAD(lwp_exit1, tc)
+{
+	atf_tc_set_md_var(tc, "descr",
+	    "Verify that 1 LWP creation is intercepted by ptrace(2) with "
+	    "EVENT_MASK set to PTRACE_LWP_EXIT");
+}
+
+ATF_TC_BODY(lwp_exit1, tc)
+{
+	const int exitval = 5;
+	const int sigval = SIGSTOP;
+	pid_t child, wpid;
+#if defined(TWAIT_HAVE_STATUS)
+	int status;
+#endif
+	ptrace_state_t state;
+	const int slen = sizeof(state);
+	ptrace_event_t event;
+	const int elen = sizeof(event);
+	ucontext_t uc;
+	lwpid_t lid;
+	static const size_t ssize = 16*1024;
+	void *stack;
+
+	printf("Before forking process PID=%d\n", getpid());
+	ATF_REQUIRE((child = fork()) != -1);
+	if (child == 0) {
+		printf("Before calling PT_TRACE_ME from child %d\n", getpid());
+		FORKEE_ASSERT(ptrace(PT_TRACE_ME, 0, NULL, 0) != -1);
+
+		printf("Before raising %s from child\n", strsignal(sigval));
+		FORKEE_ASSERT(raise(sigval) == 0);
+
+		printf("Before allocating memory for stack in child\n");
+		FORKEE_ASSERT((stack = malloc(ssize)) != NULL);
+
+		printf("Before making context for new lwp in child\n");
+		_lwp_makecontext(&uc, lwp_main_func, NULL, NULL, stack, ssize);
+
+		printf("Before creating new in child\n");
+		FORKEE_ASSERT(_lwp_create(&uc, 0, &lid) == 0);
+
+		printf("Before waiting for lwp %d to exit\n", lid);
+		FORKEE_ASSERT(_lwp_wait(lid, NULL) == 0);
+
+		printf("Before verifying that reported %d and running lid %d "
+		    "are the same\n", lid, the_lwp_id);
+		FORKEE_ASSERT_EQ(lid, the_lwp_id);
+
+		printf("Before exiting of the child process\n");
+		_exit(exitval);
+	}
+	printf("Parent process PID=%d, child's PID=%d\n", getpid(), child);
+
+	printf("Before calling %s() for the child\n", TWAIT_FNAME);
+	TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
+
+	validate_status_stopped(status, sigval);
+
+	printf("Set empty EVENT_MASK for the child %d\n", child);
+	event.pe_set_event = PTRACE_LWP_EXIT;
+	ATF_REQUIRE(ptrace(PT_SET_EVENT_MASK, child, &event, elen) != -1);
+
+	printf("Before resuming the child process where it left off and "
+	    "without signal to be sent\n");
+	ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
+
+	printf("Before calling %s() for the child - expected stopped "
+	    "SIGTRAP\n", TWAIT_FNAME);
+	TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
+
+	validate_status_stopped(status, SIGTRAP);
+
+	ATF_REQUIRE(ptrace(PT_GET_PROCESS_STATE, child, &state, slen) != -1);
+
+	ATF_REQUIRE_EQ(state.pe_report_event, PTRACE_LWP_EXIT);
+
+	lid = state.pe_lwp;
+	printf("Reported PTRACE_LWP_EXIT event with lid %d\n", lid);
+
+	printf("Before resuming the child process where it left off and "
+	    "without signal to be sent\n");
+	ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
+
+	printf("Before calling %s() for the child - expected exited\n",
+	    TWAIT_FNAME);
+	TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
+
+	validate_status_exited(status, exitval);
+
+	printf("Before calling %s() for the child - expected no process\n",
+	    TWAIT_FNAME);
+	TWAIT_REQUIRE_FAILURE(ECHILD, wpid = TWAIT_GENERIC(child, &status, 0));
+}
+
 ATF_TP_ADD_TCS(tp)
 {
 	setvbuf(stdout, NULL, _IONBF, 0);
@@ -5307,6 +5619,8 @@ ATF_TP_ADD_TCS(tp)
 	ATF_TP_ADD_TC(tp, eventmask2);
 	ATF_TP_ADD_TC(tp, eventmask3);
 	ATF_TP_ADD_TC(tp, eventmask4);
+	ATF_TP_ADD_TC(tp, eventmask5);
+	ATF_TP_ADD_TC(tp, eventmask6);
 
 	ATF_TP_ADD_TC_HAVE_PID(tp, fork1);
 	ATF_TP_ADD_TC(tp, fork2);
@@ -5380,5 +5694,9 @@ ATF_TP_ADD_TCS(tp)
 	ATF_TP_ADD_TC_HAVE_PID(tp, siginfo5);
 	ATF_TP_ADD_TC_PT_STEP(tp, siginfo6);
 
+	ATF_TP_ADD_TC(tp, lwp_create1);
+
+	ATF_TP_ADD_TC(tp, lwp_exit1);
+
 	return atf_no_error();
 }

Modified: projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/c063/t_mkfifoat.c
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/c063/t_mkfifoat.c	Sun Jan 15 10:03:03 2017	(r312220)
+++ projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/c063/t_mkfifoat.c	Sun Jan 15 10:04:20 2017	(r312221)
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_mkfifoat.c,v 1.3 2017/01/10 15:15:09 christos Exp $ */
+/*	$NetBSD: t_mkfifoat.c,v 1.4 2017/01/14 20:55:26 christos Exp $ */
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: t_mkfifoat.c,v 1.3 2017/01/10 15:15:09 christos Exp $");
+__RCSID("$NetBSD: t_mkfifoat.c,v 1.4 2017/01/14 20:55:26 christos Exp $");
 
 #include <atf-c.h>
 #include <errno.h>
@@ -55,13 +55,11 @@ ATF_TC_HEAD(mkfifoat_fd, tc)
 ATF_TC_BODY(mkfifoat_fd, tc)
 {
 	int dfd;
-	int fd;
 	mode_t mode = 0600;
 
 	ATF_REQUIRE(mkdir(DIR, 0755) == 0);
 	ATF_REQUIRE((dfd = open(DIR, O_RDONLY, 0)) != -1);
-	ATF_REQUIRE((fd = mkfifoat(dfd, BASEFIFO, mode)) != -1);
-	ATF_REQUIRE(close(fd) == 0);
+	ATF_REQUIRE(mkfifoat(dfd, BASEFIFO, mode) != -1);
 	ATF_REQUIRE(access(FIFO, F_OK) == 0);
 	(void)close(dfd);
 }
@@ -74,12 +72,10 @@ ATF_TC_HEAD(mkfifoat_fdcwd, tc)
 }
 ATF_TC_BODY(mkfifoat_fdcwd, tc)
 {
-	int fd;
 	mode_t mode = 0600;
 
 	ATF_REQUIRE(mkdir(DIR, 0755) == 0);
-	ATF_REQUIRE((fd = mkfifoat(AT_FDCWD, FIFO, mode)) != -1);
-	ATF_REQUIRE(close(fd) == 0);
+	ATF_REQUIRE(mkfifoat(AT_FDCWD, FIFO, mode) != -1);
 	ATF_REQUIRE(access(FIFO, F_OK) == 0);
 }
 
@@ -91,10 +87,9 @@ ATF_TC_HEAD(mkfifoat_fdcwderr, tc)
 }
 ATF_TC_BODY(mkfifoat_fdcwderr, tc)
 {
-	int fd;
 	mode_t mode = 0600;
 
-	ATF_REQUIRE((fd = mkfifoat(AT_FDCWD, FIFOERR, mode)) == -1);
+	ATF_REQUIRE(mkfifoat(AT_FDCWD, FIFOERR, mode) == -1);
 }
 
 ATF_TC(mkfifoat_fderr);
@@ -110,7 +105,7 @@ ATF_TC_BODY(mkfifoat_fderr, tc)
 	ATF_REQUIRE(mkdir(DIR, 0755) == 0);
 	ATF_REQUIRE((fd = open(FIFO, O_CREAT|O_RDWR, 0644)) != -1);
 	ATF_REQUIRE(close(fd) == 0);
-	ATF_REQUIRE((fd = mkfifoat(-1, FIFO, mode)) == -1);
+	ATF_REQUIRE(mkfifoat(-1, FIFO, mode) == -1);
 }
 
 ATF_TP_ADD_TCS(tp)

Modified: projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/gen/t_glob.c
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/gen/t_glob.c	Sun Jan 15 10:03:03 2017	(r312220)
+++ projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/gen/t_glob.c	Sun Jan 15 10:04:20 2017	(r312221)
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_glob.c,v 1.4 2017/01/13 21:30:41 christos Exp $	*/
+/*	$NetBSD: t_glob.c,v 1.5 2017/01/14 20:47:41 christos Exp $	*/
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: t_glob.c,v 1.4 2017/01/13 21:30:41 christos Exp $");
+__RCSID("$NetBSD: t_glob.c,v 1.5 2017/01/14 20:47:41 christos Exp $");
 
 #include <atf-c.h>
 
@@ -50,7 +50,6 @@ __RCSID("$NetBSD: t_glob.c,v 1.4 2017/01
 
 #ifdef __FreeBSD__
 #define	__gl_stat_t struct stat
-#define	_S_IFDIR S_IFDIR
 #endif
 
 
@@ -157,7 +156,7 @@ gl_stat(const char *name , __gl_stat_t *
 	memset(st, 0, sizeof(*st));
 
 	if (strcmp(buf, "a") == 0 || strcmp(buf, "a/b") == 0) {
-		st->st_mode |= _S_IFDIR;
+		st->st_mode |= S_IFDIR;
 		return 0;
 	}
 

Modified: projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/regex/t_regex_att.c
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/regex/t_regex_att.c	Sun Jan 15 10:03:03 2017	(r312220)
+++ projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/regex/t_regex_att.c	Sun Jan 15 10:04:20 2017	(r312221)
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_regex_att.c,v 1.2 2017/01/14 00:50:56 christos Exp $	*/
+/*	$NetBSD: t_regex_att.c,v 1.3 2017/01/14 20:59:23 christos Exp $	*/
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -37,20 +37,18 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: t_regex_att.c,v 1.2 2017/01/14 00:50:56 christos Exp $");
+__RCSID("$NetBSD: t_regex_att.c,v 1.3 2017/01/14 20:59:23 christos Exp $");
 
 #include <sys/param.h>
 
-#include <stdio.h>
+#include <atf-c.h>
+#include <ctype.h>
 #include <regex.h>
-#include <string.h>
+#include <stdio.h>
 #include <stdlib.h>
+#include <string.h>
+#include <util.h>
 #include <vis.h>
-#include <ctype.h>
-#include <atf-c.h>
-#ifdef __FreeBSD__
-#include <libutil.h>
-#endif
 
 static const char sep[] = "\r\n\t";
 static const char delim[3] = "\\\\\0";
@@ -576,9 +574,6 @@ ATF_TC_BODY(leftassoc, tc)
 	 * any explation.  Mark as broken here, but I don't know why. */
 	atf_tc_expect_fail("Reason for breakage unknown");
 #endif
-#ifdef __FreeBSD__
-	atf_tc_expect_fail("The expected and matched groups are mismatched on FreeBSD");
-#endif
 	att_test(tc, "leftassoc");
 }
 

Modified: projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/setjmp/t_setjmp.c
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/setjmp/t_setjmp.c	Sun Jan 15 10:03:03 2017	(r312220)
+++ projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/setjmp/t_setjmp.c	Sun Jan 15 10:04:20 2017	(r312221)
@@ -1,4 +1,4 @@
-/* $NetBSD: t_setjmp.c,v 1.1 2010/12/27 19:35:31 pgoyette Exp $ */
+/* $NetBSD: t_setjmp.c,v 1.2 2017/01/14 21:08:17 christos Exp $ */
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -63,7 +63,7 @@
 #include <sys/cdefs.h>
 __COPYRIGHT("@(#) Copyright (c) 2008\
  The NetBSD Foundation, inc. All rights reserved.");
-__RCSID("$NetBSD: t_setjmp.c,v 1.1 2010/12/27 19:35:31 pgoyette Exp $");
+__RCSID("$NetBSD: t_setjmp.c,v 1.2 2017/01/14 21:08:17 christos Exp $");
 
 #include <sys/types.h>
 

Modified: projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/setjmp/t_threadjmp.c
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/setjmp/t_threadjmp.c	Sun Jan 15 10:03:03 2017	(r312220)
+++ projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/setjmp/t_threadjmp.c	Sun Jan 15 10:04:20 2017	(r312221)
@@ -1,4 +1,4 @@
-/* $NetBSD: t_threadjmp.c,v 1.1 2011/04/21 18:58:20 martin Exp $ */
+/* $NetBSD: t_threadjmp.c,v 1.2 2017/01/14 21:08:17 christos Exp $ */
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -63,7 +63,7 @@
 #include <sys/cdefs.h>
 __COPYRIGHT("@(#) Copyright (c) 2008\
  The NetBSD Foundation, inc. All rights reserved.");
-__RCSID("$NetBSD: t_threadjmp.c,v 1.1 2011/04/21 18:58:20 martin Exp $");
+__RCSID("$NetBSD: t_threadjmp.c,v 1.2 2017/01/14 21:08:17 christos Exp $");
 
 #include <sys/types.h>
 

Modified: projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/string/t_strlen.c
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/string/t_strlen.c	Sun Jan 15 10:03:03 2017	(r312220)
+++ projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/string/t_strlen.c	Sun Jan 15 10:04:20 2017	(r312221)
@@ -1,4 +1,4 @@
-/* $NetBSD: t_strlen.c,v 1.5 2011/07/14 07:33:20 jruoho Exp $ */
+/* $NetBSD: t_strlen.c,v 1.6 2017/01/14 20:49:24 christos Exp $ */
 
 /*
  * Written by J.T. Conklin <jtc@acorntoolworks.com>
@@ -40,9 +40,7 @@ ATF_TC_HEAD(strlen_basic, tc)
 
 ATF_TC_BODY(strlen_basic, tc)
 {
-#ifdef	__FreeBSD__
 	void *dl_handle;
-#endif
 	/* try to trick the compiler */
 	size_t (*strlen_fn)(const char *);
 
@@ -110,12 +108,8 @@ ATF_TC_BODY(strlen_basic, tc)
 	 * During testing it is useful have the rest of the program
 	 * use a known good version!
 	 */
-#ifdef	__FreeBSD__
 	dl_handle = dlopen(NULL, RTLD_LAZY);
 	strlen_fn = dlsym(dl_handle, "test_strlen");
-#else
-	strlen_fn = dlsym(dlopen(NULL, RTLD_LAZY), "test_strlen");
-#endif
 	if (!strlen_fn)
 		strlen_fn = strlen;
 
@@ -142,9 +136,7 @@ ATF_TC_BODY(strlen_basic, tc)
 			}
 		}
 	}
-#ifdef	__FreeBSD__
 	(void)dlclose(dl_handle);
-#endif
 }
 
 ATF_TC(strlen_huge);

Modified: projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/sys/t_mincore.c
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/sys/t_mincore.c	Sun Jan 15 10:03:03 2017	(r312220)
+++ projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/sys/t_mincore.c	Sun Jan 15 10:04:20 2017	(r312221)
@@ -1,4 +1,4 @@
-/* $NetBSD: t_mincore.c,v 1.9 2017/01/10 22:36:29 christos Exp $ */
+/* $NetBSD: t_mincore.c,v 1.10 2017/01/14 20:51:13 christos Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -59,7 +59,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: t_mincore.c,v 1.9 2017/01/10 22:36:29 christos Exp $");
+__RCSID("$NetBSD: t_mincore.c,v 1.10 2017/01/14 20:51:13 christos Exp $");
 
 #include <sys/mman.h>
 #include <sys/stat.h>
@@ -141,9 +141,7 @@ ATF_TC_WITH_CLEANUP(mincore_resid);
 ATF_TC_HEAD(mincore_resid, tc)
 {
 	atf_tc_set_md_var(tc, "descr", "Test page residency with mincore(2)");
-#ifdef __FreeBSD__
 	atf_tc_set_md_var(tc, "require.user", "root");
-#endif
 }
 
 ATF_TC_BODY(mincore_resid, tc)
@@ -155,13 +153,11 @@ ATF_TC_BODY(mincore_resid, tc)
 	struct rlimit rlim;
 
 	ATF_REQUIRE(getrlimit(RLIMIT_MEMLOCK, &rlim) == 0);
-#ifdef __FreeBSD__
 	/*
 	 * Bump the mlock limit to unlimited so the rest of the testcase
 	 * passes instead of failing on the mlock call.
 	 */
 	rlim.rlim_max = RLIM_INFINITY;
-#endif
 	rlim.rlim_cur = rlim.rlim_max;
 	ATF_REQUIRE(setrlimit(RLIMIT_MEMLOCK, &rlim) == 0);
 
@@ -276,9 +272,7 @@ ATF_TC_BODY(mincore_resid, tc)
 	(void)munmap(addr2, npgs * page);
 	(void)munmap(addr3, npgs * page);
 	(void)unlink(path);
-#ifdef	__FreeBSD__
 	free(buf);
-#endif
 }
 
 ATF_TC_CLEANUP(mincore_resid, tc)

Modified: projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/sys/t_msync.c
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/sys/t_msync.c	Sun Jan 15 10:03:03 2017	(r312220)
+++ projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/sys/t_msync.c	Sun Jan 15 10:04:20 2017	(r312221)
@@ -1,4 +1,4 @@
-/* $NetBSD: t_msync.c,v 1.2 2012/03/16 06:15:17 matt Exp $ */
+/* $NetBSD: t_msync.c,v 1.3 2017/01/14 20:52:42 christos Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: t_msync.c,v 1.2 2012/03/16 06:15:17 matt Exp $");
+__RCSID("$NetBSD: t_msync.c,v 1.3 2017/01/14 20:52:42 christos Exp $");
 
 #include <sys/mman.h>
 
@@ -52,12 +52,7 @@ msync_sync(const char *garbage, int flag
 {
 	char *buf, *map = MAP_FAILED;
 	const char *str = NULL;
-#ifdef __FreeBSD__
 	size_t len;
-#else
-	size_t i, len;
-	ssize_t tot;
-#endif
 	int fd, rv;
 
 	/*
@@ -69,41 +64,17 @@ msync_sync(const char *garbage, int flag
 	if (buf == NULL)
 		return NULL;
 
-#ifdef __FreeBSD__
 	memset(buf, 'x', page);
-#else
-	for (i = 0; i < (size_t)page; i++)
-		buf[i] = 'x';
-#endif
 
 	fd = open(path, O_RDWR | O_CREAT, 0700);
 
 	if (fd < 0) {
-#ifdef	__FreeBSD__
 		free(buf);
 		return "failed to open";
-#else
-		str = "failed to open";
-		goto out;
-#endif
 	}
 
-#if __FreeBSD__
-	(void)write(fd, buf, page);
-#else
-	tot = 0;
-
-	while (tot < page) {
-
-		rv = write(fd, buf, sizeof(buf));
-		if (rv < 0) {
-			str = "failed to write";
-			goto out;
-		}
-
-		tot += rv;
-	}
-#endif
+	ATF_REQUIRE_MSG(write(fd, buf, page) != -1, "write(2) failed: %s",
+	    strerror(errno));
 
 	map = mmap(NULL, page, PROT_READ | PROT_WRITE, MAP_FILE|MAP_PRIVATE,
 	     fd, 0);

Modified: projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/sys/t_unlink.c
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/sys/t_unlink.c	Sun Jan 15 10:03:03 2017	(r312220)
+++ projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/sys/t_unlink.c	Sun Jan 15 10:04:20 2017	(r312221)
@@ -1,4 +1,4 @@
-/* $NetBSD: t_unlink.c,v 1.3 2017/01/13 19:33:03 christos Exp $ */
+/* $NetBSD: t_unlink.c,v 1.4 2017/01/14 20:55:26 christos Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: t_unlink.c,v 1.3 2017/01/13 19:33:03 christos Exp $");
+__RCSID("$NetBSD: t_unlink.c,v 1.4 2017/01/14 20:55:26 christos Exp $");
 
 #include <sys/stat.h>
 
@@ -111,11 +111,8 @@ ATF_TC_HEAD(unlink_fifo, tc)
 
 ATF_TC_BODY(unlink_fifo, tc)
 {
-	int fd;
 
-	ATF_REQUIRE_MSG((fd = mkfifo(path, 0666)) == 0,
-	    "mkfifo failed: %s", strerror(errno));
-	(void)close(fd);
+	ATF_REQUIRE(mkfifo(path, 0666) == 0);
 	ATF_REQUIRE(unlink(path) == 0);
 
 	errno = 0;

Modified: projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/librt/t_sem.c
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/librt/t_sem.c	Sun Jan 15 10:03:03 2017	(r312220)
+++ projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/librt/t_sem.c	Sun Jan 15 10:04:20 2017	(r312221)
@@ -1,4 +1,4 @@
-/* $NetBSD: t_sem.c,v 1.2 2010/11/08 13:05:49 njoly Exp $ */
+/* $NetBSD: t_sem.c,v 1.3 2017/01/14 20:58:20 christos Exp $ */
 
 /*
  * Copyright (c) 2008, 2010 The NetBSD Foundation, Inc.
@@ -58,7 +58,7 @@
 #include <sys/cdefs.h>
 __COPYRIGHT("@(#) Copyright (c) 2008, 2010\
  The NetBSD Foundation, inc. All rights reserved.");
-__RCSID("$NetBSD: t_sem.c,v 1.2 2010/11/08 13:05:49 njoly Exp $");
+__RCSID("$NetBSD: t_sem.c,v 1.3 2017/01/14 20:58:20 christos Exp $");
 
 #include <sys/wait.h>
 

Modified: projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/usr.bin/grep/t_grep.sh
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/usr.bin/grep/t_grep.sh	Sun Jan 15 10:03:03 2017	(r312220)
+++ projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/usr.bin/grep/t_grep.sh	Sun Jan 15 10:04:20 2017	(r312221)
@@ -1,4 +1,4 @@
-# $NetBSD: t_grep.sh,v 1.2 2013/05/17 15:39:17 christos Exp $
+# $NetBSD: t_grep.sh,v 1.3 2017/01/14 20:43:52 christos Exp $
 #
 # Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -43,20 +43,9 @@ binary_head()
 }
 binary_body()
 {
-	# Begin FreeBSD
-	#
-	# Generate stable output instead of depending on uname to match the
-	# branded OS name of /bin/sh
-	if true; then
 	dd if=/dev/zero count=1 of=test.file
 	echo -n "foobar" >> test.file
 	atf_check -o file:"$(atf_get_srcdir)/d_binary.out" grep foobar test.file
-	else
-	# End FreeBSD
-	atf_check -o file:"$(atf_get_srcdir)/d_binary.out" grep $(uname) /bin/sh
-	# Begin FreeBSD
-	fi
-	# End FreeBSD
 }
 
 atf_test_case recurse
@@ -70,15 +59,7 @@ recurse_body()
 	echo -e "cod\ndover sole\nhaddock\nhalibut\npilchard" > recurse/d/fish
 	echo -e "cod\nhaddock\nplaice" > recurse/a/f/favourite-fish
 
-	# Begin FreeBSD
-	if true; then
-		atf_check -o file:"$(atf_get_srcdir)/d_recurse.out" -x "grep -r haddock recurse | sort"
-	else
-	# End FreeBSD
-	atf_check -o file:"$(atf_get_srcdir)/d_recurse.out" grep -r haddock recurse
-	# Begin FreeBSD
-	fi
-	# End FreeBSD
+	atf_check -o file:"$(atf_get_srcdir)/d_recurse.out" -x "grep -r haddock recurse | sort"
 }
 
 atf_test_case recurse_symlink

Modified: projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/usr.sbin/mtree/t_mtree.sh
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/usr.sbin/mtree/t_mtree.sh	Sun Jan 15 10:03:03 2017	(r312220)
+++ projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/usr.sbin/mtree/t_mtree.sh	Sun Jan 15 10:04:20 2017	(r312221)
@@ -1,4 +1,4 @@
-# $NetBSD: t_mtree.sh,v 1.6 2013/02/05 16:49:42 christos Exp $
+# $NetBSD: t_mtree.sh,v 1.7 2017/01/14 20:45:16 christos Exp $
 #
 # Copyright (c) 2009, 2012 The NetBSD Foundation, Inc.
 # All rights reserved.

From owner-svn-src-projects@freebsd.org  Sun Jan 15 10:16:21 2017
Return-Path: <owner-svn-src-projects@freebsd.org>
Delivered-To: svn-src-projects@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id E3AB5CA567D
 for <svn-src-projects@mailman.ysv.freebsd.org>;
 Sun, 15 Jan 2017 10:16:21 +0000 (UTC)
 (envelope-from ngie@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 9A800145E;
 Sun, 15 Jan 2017 10:16:21 +0000 (UTC)
 (envelope-from ngie@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0FAGKet090541;
 Sun, 15 Jan 2017 10:16:20 GMT (envelope-from ngie@FreeBSD.org)
Received: (from ngie@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0FAGKN6090540;
 Sun, 15 Jan 2017 10:16:20 GMT (envelope-from ngie@FreeBSD.org)
Message-Id: <201701151016.v0FAGKN6090540@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: ngie set sender to
 ngie@FreeBSD.org using -f
From: Ngie Cooper <ngie@FreeBSD.org>
Date: Sun, 15 Jan 2017 10:16:20 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject: svn commit: r312222 -
 projects/netbsd-tests-upstream-01-2017/lib/libnetbsd
X-SVN-Group: projects
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-projects@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the src &quot; projects&quot;
 tree" <svn-src-projects.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-projects>, 
 <mailto:svn-src-projects-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-projects/>
List-Post: <mailto:svn-src-projects@freebsd.org>
List-Help: <mailto:svn-src-projects-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-projects>, 
 <mailto:svn-src-projects-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 15 Jan 2017 10:16:22 -0000

Author: ngie
Date: Sun Jan 15 10:16:20 2017
New Revision: 312222
URL: https://svnweb.freebsd.org/changeset/base/312222

Log:
  libnetbsd: add compat header for glob.h
  
  This is to diff reduce unnecessary additions to
  contrib/netbsd-tests/lib/libc/gen/t_glob.c

Added:
  projects/netbsd-tests-upstream-01-2017/lib/libnetbsd/glob.h   (contents, props changed)

Added: projects/netbsd-tests-upstream-01-2017/lib/libnetbsd/glob.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ projects/netbsd-tests-upstream-01-2017/lib/libnetbsd/glob.h	Sun Jan 15 10:16:20 2017	(r312222)
@@ -0,0 +1,42 @@
+/*	$FreeBSD$	*/
+
+/*-
+ * Copyright (c) 2012 SRI International
+ * All rights reserved.
+ *
+ * This software was developed by SRI International and the University of
+ * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237)
+ * ("CTSRD"), as part of the DARPA CRASH research programme.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#ifndef _LIBNETBSD_GLOB_H_
+#define _LIBNETBSD_GLOB_H_
+
+#include_next <glob.h>
+
+#ifndef	__gl_stat_t
+#define	__gl_stat_t struct stat
+#endif
+
+#endif /* _SHA1_H_ */

From owner-svn-src-projects@freebsd.org  Sun Jan 15 10:17:16 2017
Return-Path: <owner-svn-src-projects@freebsd.org>
Delivered-To: svn-src-projects@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id BD8F9CA56BC
 for <svn-src-projects@mailman.ysv.freebsd.org>;
 Sun, 15 Jan 2017 10:17:16 +0000 (UTC)
 (envelope-from ngie@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 8D0C215B4;
 Sun, 15 Jan 2017 10:17:16 +0000 (UTC)
 (envelope-from ngie@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0FAHF7I090616;
 Sun, 15 Jan 2017 10:17:15 GMT (envelope-from ngie@FreeBSD.org)
Received: (from ngie@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0FAHF6S090615;
 Sun, 15 Jan 2017 10:17:15 GMT (envelope-from ngie@FreeBSD.org)
Message-Id: <201701151017.v0FAHF6S090615@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: ngie set sender to
 ngie@FreeBSD.org using -f
From: Ngie Cooper <ngie@FreeBSD.org>
Date: Sun, 15 Jan 2017 10:17:15 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject: svn commit: r312223 -
 projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/gen
X-SVN-Group: projects
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-projects@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the src &quot; projects&quot;
 tree" <svn-src-projects.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-projects>, 
 <mailto:svn-src-projects-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-projects/>
List-Post: <mailto:svn-src-projects@freebsd.org>
List-Help: <mailto:svn-src-projects-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-projects>, 
 <mailto:svn-src-projects-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 15 Jan 2017 10:17:16 -0000

Author: ngie
Date: Sun Jan 15 10:17:15 2017
New Revision: 312223
URL: https://svnweb.freebsd.org/changeset/base/312223

Log:
  lib/libc/gen/t_glob.c: diff reduce with NetBSD's copy

Modified:
  projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/gen/t_glob.c

Modified: projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/gen/t_glob.c
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/gen/t_glob.c	Sun Jan 15 10:16:20 2017	(r312222)
+++ projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/gen/t_glob.c	Sun Jan 15 10:17:15 2017	(r312223)
@@ -48,10 +48,6 @@ __RCSID("$NetBSD: t_glob.c,v 1.5 2017/01
 
 #include "h_macros.h"
 
-#ifdef __FreeBSD__
-#define	__gl_stat_t struct stat
-#endif
-
 
 #ifdef DEBUG
 #define DPRINTF(a) printf a

From owner-svn-src-projects@freebsd.org  Sun Jan 15 10:24:46 2017
Return-Path: <owner-svn-src-projects@freebsd.org>
Delivered-To: svn-src-projects@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id B660DCA5B19
 for <svn-src-projects@mailman.ysv.freebsd.org>;
 Sun, 15 Jan 2017 10:24:46 +0000 (UTC)
 (envelope-from ngie@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 8E7A51BD8;
 Sun, 15 Jan 2017 10:24:46 +0000 (UTC)
 (envelope-from ngie@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0FAOjaA094670;
 Sun, 15 Jan 2017 10:24:45 GMT (envelope-from ngie@FreeBSD.org)
Received: (from ngie@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0FAOjlA094669;
 Sun, 15 Jan 2017 10:24:45 GMT (envelope-from ngie@FreeBSD.org)
Message-Id: <201701151024.v0FAOjlA094669@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: ngie set sender to
 ngie@FreeBSD.org using -f
From: Ngie Cooper <ngie@FreeBSD.org>
Date: Sun, 15 Jan 2017 10:24:45 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject: svn commit: r312225 -
 projects/netbsd-tests-upstream-01-2017/lib/libnetbsd
X-SVN-Group: projects
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-projects@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the src &quot; projects&quot;
 tree" <svn-src-projects.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-projects>, 
 <mailto:svn-src-projects-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-projects/>
List-Post: <mailto:svn-src-projects@freebsd.org>
List-Help: <mailto:svn-src-projects-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-projects>, 
 <mailto:svn-src-projects-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 15 Jan 2017 10:24:46 -0000

Author: ngie
Date: Sun Jan 15 10:24:45 2017
New Revision: 312225
URL: https://svnweb.freebsd.org/changeset/base/312225

Log:
  Fix copy-pasted copyright
  
  - Add Dell instead of "SRI International"
  - Use standard BSD 2-clause copyright
  - Remove DARPA sponsorship advertisement

Modified:
  projects/netbsd-tests-upstream-01-2017/lib/libnetbsd/glob.h

Modified: projects/netbsd-tests-upstream-01-2017/lib/libnetbsd/glob.h
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/lib/libnetbsd/glob.h	Sun Jan 15 10:21:25 2017	(r312224)
+++ projects/netbsd-tests-upstream-01-2017/lib/libnetbsd/glob.h	Sun Jan 15 10:24:45 2017	(r312225)
@@ -1,33 +1,30 @@
-/*	$FreeBSD$	*/
-
 /*-
- * Copyright (c) 2012 SRI International
+ * Copyright (c) 2017 Dell, Inc.
  * All rights reserved.
  *
- * This software was developed by SRI International and the University of
- * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237)
- * ("CTSRD"), as part of the DARPA CRASH research programme.
- *
  * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
  *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * $FreeBSD$
  */
 
 #ifndef _LIBNETBSD_GLOB_H_

From owner-svn-src-projects@freebsd.org  Sun Jan 15 10:33:54 2017
Return-Path: <owner-svn-src-projects@freebsd.org>
Delivered-To: svn-src-projects@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 379C0CA5EA7
 for <svn-src-projects@mailman.ysv.freebsd.org>;
 Sun, 15 Jan 2017 10:33:54 +0000 (UTC)
 (envelope-from ngie@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id EC8E411CE;
 Sun, 15 Jan 2017 10:33:53 +0000 (UTC)
 (envelope-from ngie@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0FAXr0o098602;
 Sun, 15 Jan 2017 10:33:53 GMT (envelope-from ngie@FreeBSD.org)
Received: (from ngie@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0FAXq0m098596;
 Sun, 15 Jan 2017 10:33:52 GMT (envelope-from ngie@FreeBSD.org)
Message-Id: <201701151033.v0FAXq0m098596@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: ngie set sender to
 ngie@FreeBSD.org using -f
From: Ngie Cooper <ngie@FreeBSD.org>
Date: Sun, 15 Jan 2017 10:33:52 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject: svn commit: r312227 - in projects/netbsd-tests-upstream-01-2017:
 sys/dev/etherswitch/arswitch tests/sys/kern/acct
X-SVN-Group: projects
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-projects@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the src &quot; projects&quot;
 tree" <svn-src-projects.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-projects>, 
 <mailto:svn-src-projects-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-projects/>
List-Post: <mailto:svn-src-projects@freebsd.org>
List-Help: <mailto:svn-src-projects-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-projects>, 
 <mailto:svn-src-projects-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 15 Jan 2017 10:33:54 -0000

Author: ngie
Date: Sun Jan 15 10:33:52 2017
New Revision: 312227
URL: https://svnweb.freebsd.org/changeset/base/312227

Log:
  MFhead@r312226

Modified:
  projects/netbsd-tests-upstream-01-2017/sys/dev/etherswitch/arswitch/arswitch.c
  projects/netbsd-tests-upstream-01-2017/sys/dev/etherswitch/arswitch/arswitch_7240.c
  projects/netbsd-tests-upstream-01-2017/sys/dev/etherswitch/arswitch/arswitch_8316.c
  projects/netbsd-tests-upstream-01-2017/sys/dev/etherswitch/arswitch/arswitch_8327.c
  projects/netbsd-tests-upstream-01-2017/sys/dev/etherswitch/arswitch/arswitch_9340.c
  projects/netbsd-tests-upstream-01-2017/tests/sys/kern/acct/Makefile
Directory Properties:
  projects/netbsd-tests-upstream-01-2017/   (props changed)

Modified: projects/netbsd-tests-upstream-01-2017/sys/dev/etherswitch/arswitch/arswitch.c
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/sys/dev/etherswitch/arswitch/arswitch.c	Sun Jan 15 10:29:53 2017	(r312226)
+++ projects/netbsd-tests-upstream-01-2017/sys/dev/etherswitch/arswitch/arswitch.c	Sun Jan 15 10:33:52 2017	(r312227)
@@ -845,6 +845,7 @@ static int
 arswitch_setled(struct arswitch_softc *sc, int phy, int led, int style)
 {
 	int shift;
+	int err;
 
 	if (phy < 0 || phy > sc->numphys)
 		return EINVAL;
@@ -852,10 +853,15 @@ arswitch_setled(struct arswitch_softc *s
 	if (style < 0 || style > ETHERSWITCH_PORT_LED_MAX)
 		return (EINVAL);
 
+	ARSWITCH_LOCK(sc);
+
 	shift = ar8327_led_mapping[phy][led].shift;
-	return (arswitch_modifyreg(sc->sc_dev,
+	err = (arswitch_modifyreg(sc->sc_dev,
 	    ar8327_led_mapping[phy][led].reg,
 	    0x03 << shift, led_pattern_table[style] << shift));
+	ARSWITCH_UNLOCK(sc);
+
+	return (err);
 }
 
 static void

Modified: projects/netbsd-tests-upstream-01-2017/sys/dev/etherswitch/arswitch/arswitch_7240.c
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/sys/dev/etherswitch/arswitch/arswitch_7240.c	Sun Jan 15 10:29:53 2017	(r312226)
+++ projects/netbsd-tests-upstream-01-2017/sys/dev/etherswitch/arswitch/arswitch_7240.c	Sun Jan 15 10:33:52 2017	(r312227)
@@ -81,6 +81,8 @@ static int
 ar7240_hw_global_setup(struct arswitch_softc *sc)
 {
 
+	ARSWITCH_LOCK(sc);
+
 	/* Enable CPU port; disable mirror port */
 	arswitch_writereg(sc->sc_dev, AR8X16_REG_CPU_PORT,
 	    AR8X16_CPU_PORT_EN | AR8X16_CPU_MIRROR_DIS);
@@ -103,6 +105,8 @@ ar7240_hw_global_setup(struct arswitch_s
 	arswitch_modifyreg(sc->sc_dev, AR8X16_REG_SERVICE_TAG,
 	    AR8X16_SERVICE_TAG_MASK, 0);
 
+	ARSWITCH_UNLOCK(sc);
+
 	return (0);
 }
 

Modified: projects/netbsd-tests-upstream-01-2017/sys/dev/etherswitch/arswitch/arswitch_8316.c
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/sys/dev/etherswitch/arswitch/arswitch_8316.c	Sun Jan 15 10:29:53 2017	(r312226)
+++ projects/netbsd-tests-upstream-01-2017/sys/dev/etherswitch/arswitch/arswitch_8316.c	Sun Jan 15 10:33:52 2017	(r312227)
@@ -127,6 +127,8 @@ static int
 ar8316_hw_global_setup(struct arswitch_softc *sc)
 {
 
+	ARSWITCH_LOCK(sc);
+
 	arswitch_writereg(sc->sc_dev, 0x38, AR8X16_MAGIC);
 
 	/* Enable CPU port and disable mirror port. */
@@ -156,6 +158,7 @@ ar8316_hw_global_setup(struct arswitch_s
 	arswitch_modifyreg(sc->sc_dev, AR8X16_REG_SERVICE_TAG,
 	    AR8X16_SERVICE_TAG_MASK, 0);
 
+	ARSWITCH_UNLOCK(sc);
 	return (0);
 }
 

Modified: projects/netbsd-tests-upstream-01-2017/sys/dev/etherswitch/arswitch/arswitch_8327.c
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/sys/dev/etherswitch/arswitch/arswitch_8327.c	Sun Jan 15 10:29:53 2017	(r312226)
+++ projects/netbsd-tests-upstream-01-2017/sys/dev/etherswitch/arswitch/arswitch_8327.c	Sun Jan 15 10:33:52 2017	(r312227)
@@ -708,6 +708,8 @@ ar8327_hw_global_setup(struct arswitch_s
 {
 	uint32_t t;
 
+	ARSWITCH_LOCK(sc);
+
 	/* enable CPU port and disable mirror port */
 	t = AR8327_FWD_CTRL0_CPU_PORT_EN |
 	    AR8327_FWD_CTRL0_MIRROR_PORT;
@@ -741,6 +743,7 @@ ar8327_hw_global_setup(struct arswitch_s
 	/* GMAC0 (CPU), GMAC1..5 (PHYs), GMAC6 (CPU) */
 	sc->info.es_nports = 7;
 
+	ARSWITCH_UNLOCK(sc);
 	return (0);
 }
 

Modified: projects/netbsd-tests-upstream-01-2017/sys/dev/etherswitch/arswitch/arswitch_9340.c
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/sys/dev/etherswitch/arswitch/arswitch_9340.c	Sun Jan 15 10:29:53 2017	(r312226)
+++ projects/netbsd-tests-upstream-01-2017/sys/dev/etherswitch/arswitch/arswitch_9340.c	Sun Jan 15 10:33:52 2017	(r312227)
@@ -81,6 +81,8 @@ static int
 ar9340_hw_global_setup(struct arswitch_softc *sc)
 {
 
+	ARSWITCH_LOCK(sc);
+
 	/* Enable CPU port; disable mirror port */
 	arswitch_writereg(sc->sc_dev, AR8X16_REG_CPU_PORT,
 	    AR8X16_CPU_PORT_EN | AR8X16_CPU_MIRROR_DIS);
@@ -142,6 +144,7 @@ ar9340_hw_global_setup(struct arswitch_s
 	} else {
 		device_printf(sc->sc_dev, "%s: need is_gmii or is_mii set\n",
 		    __func__);
+		ARSWITCH_UNLOCK(sc);
 		return (ENXIO);
 	}
 
@@ -163,6 +166,7 @@ ar9340_hw_global_setup(struct arswitch_s
 	/* Settle time */
 	DELAY(1000);
 
+	ARSWITCH_UNLOCK(sc);
 	return (0);
 }
 

Modified: projects/netbsd-tests-upstream-01-2017/tests/sys/kern/acct/Makefile
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/tests/sys/kern/acct/Makefile	Sun Jan 15 10:29:53 2017	(r312226)
+++ projects/netbsd-tests-upstream-01-2017/tests/sys/kern/acct/Makefile	Sun Jan 15 10:33:52 2017	(r312227)
@@ -13,7 +13,7 @@ acct_test.o: convert.c
 
 convert.c: ${SRCTOP}/sys/kern/kern_acct.c
 	sed -n -e 's/log(/syslog(/g' \
-	       -e 's/exp/expected/g' \
+	       -e 's/exp/exponent/g' \
 	       -e '/FLOAT_CONVERSION_START/,/FLOAT_CONVERSION_END/p' ${.ALLSRC} >${.TARGET}.tmp
 	mv ${.TARGET}.tmp ${.TARGET}
 

From owner-svn-src-projects@freebsd.org  Sun Jan 15 12:58:16 2017
Return-Path: <owner-svn-src-projects@freebsd.org>
Delivered-To: svn-src-projects@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 27EBFCAEDC7
 for <svn-src-projects@mailman.ysv.freebsd.org>;
 Sun, 15 Jan 2017 12:58:16 +0000 (UTC) (envelope-from dim@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id D5AE61EB9;
 Sun, 15 Jan 2017 12:58:15 +0000 (UTC) (envelope-from dim@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0FCwF1Q056775;
 Sun, 15 Jan 2017 12:58:15 GMT (envelope-from dim@FreeBSD.org)
Received: (from dim@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0FCwFhn056774;
 Sun, 15 Jan 2017 12:58:15 GMT (envelope-from dim@FreeBSD.org)
Message-Id: <201701151258.v0FCwFhn056774@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org
 using -f
From: Dimitry Andric <dim@FreeBSD.org>
Date: Sun, 15 Jan 2017 12:58:15 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject: svn commit: r312229 - projects/clang400-import/lib/clang/libclang
X-SVN-Group: projects
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-projects@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the src &quot; projects&quot;
 tree" <svn-src-projects.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-projects>, 
 <mailto:svn-src-projects-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-projects/>
List-Post: <mailto:svn-src-projects@freebsd.org>
List-Help: <mailto:svn-src-projects-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-projects>, 
 <mailto:svn-src-projects-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 15 Jan 2017 12:58:16 -0000

Author: dim
Date: Sun Jan 15 12:58:14 2017
New Revision: 312229
URL: https://svnweb.freebsd.org/changeset/base/312229

Log:
  Fix some erroneous minimization in libclang.

Modified:
  projects/clang400-import/lib/clang/libclang/Makefile

Modified: projects/clang400-import/lib/clang/libclang/Makefile
==============================================================================
--- projects/clang400-import/lib/clang/libclang/Makefile	Sun Jan 15 12:24:23 2017	(r312228)
+++ projects/clang400-import/lib/clang/libclang/Makefile	Sun Jan 15 12:58:14 2017	(r312229)
@@ -112,7 +112,7 @@ SRCS_MIN+=	Analysis/CFGStmtMap.cpp
 SRCS_FUL+=	Analysis/CallGraph.cpp
 SRCS_MIN+=	Analysis/CloneDetection.cpp
 SRCS_MIN+=	Analysis/CocoaConventions.cpp
-#SRCS_FUL+=	Analysis/CodeInjector.cpp
+SRCS_FUL+=	Analysis/CodeInjector.cpp
 SRCS_MIN+=	Analysis/Consumed.cpp
 SRCS_FUL+=	Analysis/Dominators.cpp
 SRCS_MIN+=	Analysis/FormatString.cpp
@@ -393,7 +393,7 @@ SRCS_MIN+=	Serialization/GlobalModuleInd
 SRCS_MIN+=	Serialization/Module.cpp
 SRCS_MIN+=	Serialization/ModuleFileExtension.cpp
 SRCS_MIN+=	Serialization/ModuleManager.cpp
-#SRCS_FUL+=	StaticAnalyzer/Checkers/AllocationDiagnostics.cpp
+SRCS_FUL+=	StaticAnalyzer/Checkers/AllocationDiagnostics.cpp
 SRCS_FUL+=	StaticAnalyzer/Checkers/AnalysisOrderChecker.cpp
 SRCS_FUL+=	StaticAnalyzer/Checkers/AnalyzerStatsChecker.cpp
 SRCS_FUL+=	StaticAnalyzer/Checkers/ArrayBoundChecker.cpp
@@ -480,7 +480,7 @@ SRCS_FUL+=	StaticAnalyzer/Checkers/VLASi
 SRCS_FUL+=	StaticAnalyzer/Checkers/ValistChecker.cpp
 SRCS_FUL+=	StaticAnalyzer/Checkers/VforkChecker.cpp
 SRCS_FUL+=	StaticAnalyzer/Checkers/VirtualCallChecker.cpp
-#SRCS_FUL+=	StaticAnalyzer/Core/APSIntType.cpp
+SRCS_FUL+=	StaticAnalyzer/Core/APSIntType.cpp
 SRCS_FUL+=	StaticAnalyzer/Core/AnalysisManager.cpp
 SRCS_FUL+=	StaticAnalyzer/Core/AnalyzerOptions.cpp
 SRCS_FUL+=	StaticAnalyzer/Core/BasicValueFactory.cpp
@@ -493,7 +493,7 @@ SRCS_FUL+=	StaticAnalyzer/Core/CheckerCo
 SRCS_FUL+=	StaticAnalyzer/Core/CheckerHelpers.cpp
 SRCS_FUL+=	StaticAnalyzer/Core/CheckerManager.cpp
 SRCS_FUL+=	StaticAnalyzer/Core/CheckerRegistry.cpp
-#SRCS_FUL+=	StaticAnalyzer/Core/CommonBugCategories.cpp
+SRCS_FUL+=	StaticAnalyzer/Core/CommonBugCategories.cpp
 SRCS_FUL+=	StaticAnalyzer/Core/ConstraintManager.cpp
 SRCS_FUL+=	StaticAnalyzer/Core/CoreEngine.cpp
 SRCS_FUL+=	StaticAnalyzer/Core/DynamicTypeMap.cpp

From owner-svn-src-projects@freebsd.org  Sun Jan 15 21:19:00 2017
Return-Path: <owner-svn-src-projects@freebsd.org>
Delivered-To: svn-src-projects@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 42E4CCB1B82
 for <svn-src-projects@mailman.ysv.freebsd.org>;
 Sun, 15 Jan 2017 21:19:00 +0000 (UTC)
 (envelope-from ngie@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 0298612D0;
 Sun, 15 Jan 2017 21:18:59 +0000 (UTC)
 (envelope-from ngie@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0FLIxjp063818;
 Sun, 15 Jan 2017 21:18:59 GMT (envelope-from ngie@FreeBSD.org)
Received: (from ngie@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0FLIxrX063817;
 Sun, 15 Jan 2017 21:18:59 GMT (envelope-from ngie@FreeBSD.org)
Message-Id: <201701152118.v0FLIxrX063817@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: ngie set sender to
 ngie@FreeBSD.org using -f
From: Ngie Cooper <ngie@FreeBSD.org>
Date: Sun, 15 Jan 2017 21:18:59 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject: svn commit: r312238 -
 projects/netbsd-tests-upstream-01-2017/lib/libnetbsd
X-SVN-Group: projects
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-projects@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the src &quot; projects&quot;
 tree" <svn-src-projects.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-projects>, 
 <mailto:svn-src-projects-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-projects/>
List-Post: <mailto:svn-src-projects@freebsd.org>
List-Help: <mailto:svn-src-projects-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-projects>, 
 <mailto:svn-src-projects-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 15 Jan 2017 21:19:00 -0000

Author: ngie
Date: Sun Jan 15 21:18:58 2017
New Revision: 312238
URL: https://svnweb.freebsd.org/changeset/base/312238

Log:
  libnetbsd: more portability fixes with stdio.h and util.h
  
  - stdio.h needs to pull in stdio.h/util.h for fparseln, not util.h
  - util.h needs to #include sys/types.h for flags_to_string, etc as
    flags_to_string uses u_long, which is typedef'ed in sys/types.h on
    FreeBSD

Added:
  projects/netbsd-tests-upstream-01-2017/lib/libnetbsd/stdio.h   (contents, props changed)
Modified:
  projects/netbsd-tests-upstream-01-2017/lib/libnetbsd/util.h

Added: projects/netbsd-tests-upstream-01-2017/lib/libnetbsd/stdio.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ projects/netbsd-tests-upstream-01-2017/lib/libnetbsd/stdio.h	Sun Jan 15 21:18:58 2017	(r312238)
@@ -0,0 +1,37 @@
+/*-
+ * Copyright (c) 2017 Dell, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef _LIBNETBSD_STDIO_H_
+#define _LIBNETBSD_STDIO_H_
+
+#include_next <stdio.h>
+
+#include "util.h"
+
+#endif /* _SHA1_H_ */

Modified: projects/netbsd-tests-upstream-01-2017/lib/libnetbsd/util.h
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/lib/libnetbsd/util.h	Sun Jan 15 20:03:13 2017	(r312237)
+++ projects/netbsd-tests-upstream-01-2017/lib/libnetbsd/util.h	Sun Jan 15 21:18:58 2017	(r312238)
@@ -33,7 +33,7 @@
 #ifndef _LIBNETBSD_UTIL_H_
 #define _LIBNETBSD_UTIL_H_
 
-#include <stdio.h>	/* for fparseln(3) */
+#include <sys/types.h>
 #include <libutil.h>
 
 char	*flags_to_string(u_long flags, const char *def);

From owner-svn-src-projects@freebsd.org  Sun Jan 15 21:38:21 2017
Return-Path: <owner-svn-src-projects@freebsd.org>
Delivered-To: svn-src-projects@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 00BF4CB1007
 for <svn-src-projects@mailman.ysv.freebsd.org>;
 Sun, 15 Jan 2017 21:38:21 +0000 (UTC)
 (envelope-from ngie@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id C3C67103B;
 Sun, 15 Jan 2017 21:38:20 +0000 (UTC)
 (envelope-from ngie@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0FLcJeV072187;
 Sun, 15 Jan 2017 21:38:19 GMT (envelope-from ngie@FreeBSD.org)
Received: (from ngie@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0FLcJsO072185;
 Sun, 15 Jan 2017 21:38:19 GMT (envelope-from ngie@FreeBSD.org)
Message-Id: <201701152138.v0FLcJsO072185@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: ngie set sender to
 ngie@FreeBSD.org using -f
From: Ngie Cooper <ngie@FreeBSD.org>
Date: Sun, 15 Jan 2017 21:38:19 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject: svn commit: r312239 -
 projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/stdlib
X-SVN-Group: projects
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-projects@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the src &quot; projects&quot;
 tree" <svn-src-projects.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-projects>, 
 <mailto:svn-src-projects-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-projects/>
List-Post: <mailto:svn-src-projects@freebsd.org>
List-Help: <mailto:svn-src-projects-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-projects>, 
 <mailto:svn-src-projects-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 15 Jan 2017 21:38:21 -0000

Author: ngie
Date: Sun Jan 15 21:38:19 2017
New Revision: 312239
URL: https://svnweb.freebsd.org/changeset/base/312239

Log:
  Remove libutil.h #include on FreeBSD and instead favor stdio.h from libnetbsd

Modified:
  projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/stdlib/h_getopt.c
  projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/stdlib/h_getopt_long.c

Modified: projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/stdlib/h_getopt.c
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/stdlib/h_getopt.c	Sun Jan 15 21:18:58 2017	(r312238)
+++ projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/stdlib/h_getopt.c	Sun Jan 15 21:38:19 2017	(r312239)
@@ -34,9 +34,6 @@
 #include <stdlib.h>
 #include <unistd.h>
 #include <err.h>
-#ifdef __FreeBSD__
-#include <libutil.h>
-#endif
 
 #define	WS	"\t\n "
 #define	debug	0

Modified: projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/stdlib/h_getopt_long.c
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/stdlib/h_getopt_long.c	Sun Jan 15 21:18:58 2017	(r312238)
+++ projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/stdlib/h_getopt_long.c	Sun Jan 15 21:38:19 2017	(r312239)
@@ -36,9 +36,6 @@
 #include <string.h>
 #include <stdlib.h>
 #include <unistd.h>
-#ifdef __FreeBSD__
-#include <libutil.h>
-#endif
 
 #define SKIPWS(p)	while (isspace((int)(*p))) p++
 #define	WS	"\t\n "

From owner-svn-src-projects@freebsd.org  Sun Jan 15 21:52:35 2017
Return-Path: <owner-svn-src-projects@freebsd.org>
Delivered-To: svn-src-projects@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 46F3ECB191F
 for <svn-src-projects@mailman.ysv.freebsd.org>;
 Sun, 15 Jan 2017 21:52:35 +0000 (UTC)
 (envelope-from ngie@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id E48C61D18;
 Sun, 15 Jan 2017 21:52:34 +0000 (UTC)
 (envelope-from ngie@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0FLqYEh079900;
 Sun, 15 Jan 2017 21:52:34 GMT (envelope-from ngie@FreeBSD.org)
Received: (from ngie@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0FLqYSU079899;
 Sun, 15 Jan 2017 21:52:34 GMT (envelope-from ngie@FreeBSD.org)
Message-Id: <201701152152.v0FLqYSU079899@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: ngie set sender to
 ngie@FreeBSD.org using -f
From: Ngie Cooper <ngie@FreeBSD.org>
Date: Sun, 15 Jan 2017 21:52:34 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject: svn commit: r312240 -
 projects/netbsd-tests-upstream-01-2017/lib/libnetbsd/sys
X-SVN-Group: projects
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-projects@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the src &quot; projects&quot;
 tree" <svn-src-projects.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-projects>, 
 <mailto:svn-src-projects-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-projects/>
List-Post: <mailto:svn-src-projects@freebsd.org>
List-Help: <mailto:svn-src-projects-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-projects>, 
 <mailto:svn-src-projects-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 15 Jan 2017 21:52:35 -0000

Author: ngie
Date: Sun Jan 15 21:52:33 2017
New Revision: 312240
URL: https://svnweb.freebsd.org/changeset/base/312240

Log:
  libnetbsd: add sys/wait.h compat header
  
  This just defines wrusage to __wrusage for now (they're both structs).

Added:
  projects/netbsd-tests-upstream-01-2017/lib/libnetbsd/sys/wait.h   (contents, props changed)

Added: projects/netbsd-tests-upstream-01-2017/lib/libnetbsd/sys/wait.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ projects/netbsd-tests-upstream-01-2017/lib/libnetbsd/sys/wait.h	Sun Jan 15 21:52:33 2017	(r312240)
@@ -0,0 +1,37 @@
+/*-
+ * Copyright (c) 2017 Dell, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$ *
+ */
+
+#ifndef _LIBNETBSD_SYS_WAIT_H_
+#define	_LIBNETBSD_SYS_WAIT_H_
+
+#include_next <sys/wait.h>
+
+#define	wrusage	__wrusage
+
+#endif

From owner-svn-src-projects@freebsd.org  Sun Jan 15 21:53:12 2017
Return-Path: <owner-svn-src-projects@freebsd.org>
Delivered-To: svn-src-projects@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 47093CB197D
 for <svn-src-projects@mailman.ysv.freebsd.org>;
 Sun, 15 Jan 2017 21:53:12 +0000 (UTC)
 (envelope-from ngie@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 00B181E59;
 Sun, 15 Jan 2017 21:53:11 +0000 (UTC)
 (envelope-from ngie@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0FLrBYC079966;
 Sun, 15 Jan 2017 21:53:11 GMT (envelope-from ngie@FreeBSD.org)
Received: (from ngie@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0FLrB1Z079965;
 Sun, 15 Jan 2017 21:53:11 GMT (envelope-from ngie@FreeBSD.org)
Message-Id: <201701152153.v0FLrB1Z079965@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: ngie set sender to
 ngie@FreeBSD.org using -f
From: Ngie Cooper <ngie@FreeBSD.org>
Date: Sun, 15 Jan 2017 21:53:11 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject: svn commit: r312241 -
 projects/netbsd-tests-upstream-01-2017/lib/libnetbsd/sys
X-SVN-Group: projects
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-projects@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the src &quot; projects&quot;
 tree" <svn-src-projects.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-projects>, 
 <mailto:svn-src-projects-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-projects/>
List-Post: <mailto:svn-src-projects@freebsd.org>
List-Help: <mailto:svn-src-projects-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-projects>, 
 <mailto:svn-src-projects-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 15 Jan 2017 21:53:12 -0000

Author: ngie
Date: Sun Jan 15 21:53:11 2017
New Revision: 312241
URL: https://svnweb.freebsd.org/changeset/base/312241

Log:
  libnetbsd: add sys/types.h header which pollutes itself with sys/param.h to
  pick up NBBY, etc

Added:
  projects/netbsd-tests-upstream-01-2017/lib/libnetbsd/sys/types.h   (contents, props changed)

Added: projects/netbsd-tests-upstream-01-2017/lib/libnetbsd/sys/types.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ projects/netbsd-tests-upstream-01-2017/lib/libnetbsd/sys/types.h	Sun Jan 15 21:53:11 2017	(r312241)
@@ -0,0 +1,37 @@
+/*-
+ * Copyright (c) 2017 Dell, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$ *
+ */
+
+#ifndef _LIBNETBSD_SYS_TYPES_H_
+#define	_LIBNETBSD_SYS_TYPES_H_
+
+#include_next <sys/types.h>
+
+#include <sys/param.h>	/* For NBBY */
+
+#endif

From owner-svn-src-projects@freebsd.org  Sun Jan 15 22:00:31 2017
Return-Path: <owner-svn-src-projects@freebsd.org>
Delivered-To: svn-src-projects@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id E23F6CB1A0B
 for <svn-src-projects@mailman.ysv.freebsd.org>;
 Sun, 15 Jan 2017 22:00:31 +0000 (UTC)
 (envelope-from ngie@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 9BBA51FC9;
 Sun, 15 Jan 2017 22:00:31 +0000 (UTC)
 (envelope-from ngie@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0FM0Uso080382;
 Sun, 15 Jan 2017 22:00:30 GMT (envelope-from ngie@FreeBSD.org)
Received: (from ngie@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0FM0Umu080380;
 Sun, 15 Jan 2017 22:00:30 GMT (envelope-from ngie@FreeBSD.org)
Message-Id: <201701152200.v0FM0Umu080380@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: ngie set sender to
 ngie@FreeBSD.org using -f
From: Ngie Cooper <ngie@FreeBSD.org>
Date: Sun, 15 Jan 2017 22:00:30 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject: svn commit: r312242 -
 projects/netbsd-tests-upstream-01-2017/lib/libnetbsd/sys
X-SVN-Group: projects
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-projects@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the src &quot; projects&quot;
 tree" <svn-src-projects.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-projects>, 
 <mailto:svn-src-projects-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-projects/>
List-Post: <mailto:svn-src-projects@freebsd.org>
List-Help: <mailto:svn-src-projects-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-projects>, 
 <mailto:svn-src-projects-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 15 Jan 2017 22:00:32 -0000

Author: ngie
Date: Sun Jan 15 22:00:30 2017
New Revision: 312242
URL: https://svnweb.freebsd.org/changeset/base/312242

Log:
  libnetbsd: add sys/event.h compat header
  
  This adds in necessary sys/types.h pollution for uintptr_t used in
  sys/event.h, which according to kqueue(2) on NetBSD isn't necessary.

Added:
  projects/netbsd-tests-upstream-01-2017/lib/libnetbsd/sys/event.h   (contents, props changed)

Added: projects/netbsd-tests-upstream-01-2017/lib/libnetbsd/sys/event.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ projects/netbsd-tests-upstream-01-2017/lib/libnetbsd/sys/event.h	Sun Jan 15 22:00:30 2017	(r312242)
@@ -0,0 +1,42 @@
+/*-
+ * Copyright (c) 2017 Dell, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$ *
+ */
+
+#ifndef _LIBNETBSD_SYS_EVENT_H_
+#define	_LIBNETBSD_SYS_EVENT_H_
+
+/*
+ * kqueue on FreeBSD requires sys/event.h, which in turn uses uintptr_t
+ * (defined in sys/types.h), so in order to accomodate their requirements,
+ * pull in sys/types.h as part of event.h.
+ */
+#include <sys/types.h>
+
+#include_next <sys/event.h>
+
+#endif

From owner-svn-src-projects@freebsd.org  Sun Jan 15 22:01:01 2017
Return-Path: <owner-svn-src-projects@freebsd.org>
Delivered-To: svn-src-projects@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 916CACB1A44
 for <svn-src-projects@mailman.ysv.freebsd.org>;
 Sun, 15 Jan 2017 22:01:01 +0000 (UTC)
 (envelope-from ngie@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 6950D1120;
 Sun, 15 Jan 2017 22:01:01 +0000 (UTC)
 (envelope-from ngie@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0FM10NK081180;
 Sun, 15 Jan 2017 22:01:00 GMT (envelope-from ngie@FreeBSD.org)
Received: (from ngie@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0FM0xaG080448;
 Sun, 15 Jan 2017 22:00:59 GMT (envelope-from ngie@FreeBSD.org)
Message-Id: <201701152200.v0FM0xaG080448@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: ngie set sender to
 ngie@FreeBSD.org using -f
From: Ngie Cooper <ngie@FreeBSD.org>
Date: Sun, 15 Jan 2017 22:00:59 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject: svn commit: r312243 - in
 projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests: kernel/kqueue
 lib/libc/gen lib/libc/sys
X-SVN-Group: projects
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-projects@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the src &quot; projects&quot;
 tree" <svn-src-projects.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-projects>, 
 <mailto:svn-src-projects-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-projects/>
List-Post: <mailto:svn-src-projects@freebsd.org>
List-Help: <mailto:svn-src-projects-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-projects>, 
 <mailto:svn-src-projects-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 15 Jan 2017 22:01:01 -0000

Author: ngie
Date: Sun Jan 15 22:00:59 2017
New Revision: 312243
URL: https://svnweb.freebsd.org/changeset/base/312243

Log:
  Diff reduce with upstream and consolidate #ifdefs where possible

Modified:
  projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/kernel/kqueue/t_proc2.c
  projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/kernel/kqueue/t_proc3.c
  projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/kernel/kqueue/t_sig.c
  projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/kernel/kqueue/t_vnode.c
  projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/gen/t_sleep.c
  projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/sys/t_kevent.c
  projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/sys/t_mmap.c
  projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/sys/t_wait.c
  projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/sys/t_wait_noproc.c

Modified: projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/kernel/kqueue/t_proc2.c
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/kernel/kqueue/t_proc2.c	Sun Jan 15 22:00:30 2017	(r312242)
+++ projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/kernel/kqueue/t_proc2.c	Sun Jan 15 22:00:59 2017	(r312243)
@@ -34,9 +34,6 @@ __COPYRIGHT("@(#) Copyright (c) 2008\
  The NetBSD Foundation, inc. All rights reserved.");
 __RCSID("$NetBSD: t_proc2.c,v 1.3 2017/01/13 21:30:41 christos Exp $");
 
-#ifdef __FreeBSD__
-#include <sys/types.h> /* for kqueue(2) */
-#endif
 #include <sys/event.h>
 #include <sys/time.h>
 #include <sys/types.h>

Modified: projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/kernel/kqueue/t_proc3.c
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/kernel/kqueue/t_proc3.c	Sun Jan 15 22:00:30 2017	(r312242)
+++ projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/kernel/kqueue/t_proc3.c	Sun Jan 15 22:00:59 2017	(r312243)
@@ -32,9 +32,6 @@
 #include <sys/cdefs.h>
 __RCSID("$NetBSD: t_proc3.c,v 1.3 2017/01/13 21:30:41 christos Exp $");
 
-#ifdef __FreeBSD__
-#include <sys/types.h> /* for kqueue(2) */
-#endif
 #include <sys/event.h>
 #include <sys/time.h>
 #include <sys/types.h>

Modified: projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/kernel/kqueue/t_sig.c
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/kernel/kqueue/t_sig.c	Sun Jan 15 22:00:30 2017	(r312242)
+++ projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/kernel/kqueue/t_sig.c	Sun Jan 15 22:00:59 2017	(r312243)
@@ -34,9 +34,6 @@ __COPYRIGHT("@(#) Copyright (c) 2008\
  The NetBSD Foundation, inc. All rights reserved.");
 __RCSID("$NetBSD: t_sig.c,v 1.3 2017/01/13 21:30:41 christos Exp $");
 
-#ifdef __FreeBSD__
-#include <sys/types.h> /* for kqueue(2) */
-#endif
 #include <sys/event.h>
 #include <sys/ioctl.h>
 #include <sys/param.h>

Modified: projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/kernel/kqueue/t_vnode.c
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/kernel/kqueue/t_vnode.c	Sun Jan 15 22:00:30 2017	(r312242)
+++ projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/kernel/kqueue/t_vnode.c	Sun Jan 15 22:00:59 2017	(r312243)
@@ -1,6 +1,3 @@
-#ifdef __FreeBSD__
-#include <sys/types.h> /* for kqueue(2) */
-#endif
 #include <sys/event.h>
 #include <sys/stat.h>
 #include <sys/time.h>

Modified: projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/gen/t_sleep.c
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/gen/t_sleep.c	Sun Jan 15 22:00:30 2017	(r312242)
+++ projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/gen/t_sleep.c	Sun Jan 15 22:00:59 2017	(r312243)
@@ -26,10 +26,6 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifdef __FreeBSD__
-/* kqueue(2) on FreeBSD requires sys/types.h for uintptr_t; NetBSD doesn't. */
-#include <sys/types.h>
-#endif
 #include <sys/cdefs.h>
 #include <sys/event.h>
 #include <sys/signal.h>

Modified: projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/sys/t_kevent.c
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/sys/t_kevent.c	Sun Jan 15 22:00:30 2017	(r312242)
+++ projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/sys/t_kevent.c	Sun Jan 15 22:00:59 2017	(r312243)
@@ -45,16 +45,14 @@ __RCSID("$NetBSD: t_kevent.c,v 1.7 2015/
 #include <err.h>
 #ifdef __NetBSD__
 #include <sys/drvctlio.h>
+#else
+#define	DRVCTLDEV "/nonexistent"
 #endif
 #include <sys/event.h>
 #include <sys/time.h>
 #include <sys/socket.h>
 #include <sys/wait.h>
 
-#ifdef __FreeBSD__
-#define	DRVCTLDEV "/nonexistent"
-#endif
-
 ATF_TC(kevent_zerotimer);
 ATF_TC_HEAD(kevent_zerotimer, tc)
 {

Modified: projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/sys/t_mmap.c
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/sys/t_mmap.c	Sun Jan 15 22:00:30 2017	(r312242)
+++ projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/sys/t_mmap.c	Sun Jan 15 22:00:59 2017	(r312243)
@@ -75,11 +75,9 @@ __RCSID("$NetBSD: t_mmap.c,v 1.11 2017/0
 #include <paths.h>
 #ifdef __NetBSD__
 #include <machine/disklabel.h>
-#endif
-
-#ifdef __FreeBSD__
-#include <sys/disklabel.h>
+#else
 #include <stdint.h>
+#include <sys/disklabel.h>
 #endif
 
 static long	page = 0;

Modified: projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/sys/t_wait.c
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/sys/t_wait.c	Sun Jan 15 22:00:30 2017	(r312242)
+++ projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/sys/t_wait.c	Sun Jan 15 22:00:59 2017	(r312243)
@@ -45,10 +45,6 @@ __RCSID("$NetBSD: t_wait.c,v 1.8 2017/01
 
 #include <atf-c.h>
 
-#ifdef __FreeBSD__
-#define	wrusage	__wrusage
-#endif
-
 ATF_TC(wait6_invalid);
 ATF_TC_HEAD(wait6_invalid, tc)
 {

Modified: projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/sys/t_wait_noproc.c
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/sys/t_wait_noproc.c	Sun Jan 15 22:00:30 2017	(r312242)
+++ projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/sys/t_wait_noproc.c	Sun Jan 15 22:00:59 2017	(r312243)
@@ -29,9 +29,6 @@
 #include <sys/cdefs.h>
 __RCSID("$NetBSD: t_wait_noproc.c,v 1.5 2016/11/09 17:50:19 kamil Exp $");
 
-#ifdef __FreeBSD__
-#include <sys/param.h> /* For NBBY -- it's in sys/types.h on NetBSD */
-#endif
 #include <sys/wait.h>
 #include <sys/resource.h>
 

From owner-svn-src-projects@freebsd.org  Mon Jan 16 07:34:46 2017
Return-Path: <owner-svn-src-projects@freebsd.org>
Delivered-To: svn-src-projects@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 896F7CB263A
 for <svn-src-projects@mailman.ysv.freebsd.org>;
 Mon, 16 Jan 2017 07:34:46 +0000 (UTC)
 (envelope-from ngie@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 55CCD15FE;
 Mon, 16 Jan 2017 07:34:46 +0000 (UTC)
 (envelope-from ngie@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0G7YjkV016779;
 Mon, 16 Jan 2017 07:34:45 GMT (envelope-from ngie@FreeBSD.org)
Received: (from ngie@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0G7YjAY016778;
 Mon, 16 Jan 2017 07:34:45 GMT (envelope-from ngie@FreeBSD.org)
Message-Id: <201701160734.v0G7YjAY016778@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: ngie set sender to
 ngie@FreeBSD.org using -f
From: Ngie Cooper <ngie@FreeBSD.org>
Date: Mon, 16 Jan 2017 07:34:45 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject: svn commit: r312274 -
 projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/db
X-SVN-Group: projects
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-projects@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the src &quot; projects&quot;
 tree" <svn-src-projects.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-projects>, 
 <mailto:svn-src-projects-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-projects/>
List-Post: <mailto:svn-src-projects@freebsd.org>
List-Help: <mailto:svn-src-projects-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-projects>, 
 <mailto:svn-src-projects-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 16 Jan 2017 07:34:46 -0000

Author: ngie
Date: Mon Jan 16 07:34:45 2017
New Revision: 312274
URL: https://svnweb.freebsd.org/changeset/base/312274

Log:
  Drop unnecessary diff rewriting dict(..) function
  
  This is already being properly handled via ATF config require.files call

Modified:
  projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/db/t_db.sh

Modified: projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/db/t_db.sh
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/db/t_db.sh	Mon Jan 16 07:17:43 2017	(r312273)
+++ projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/db/t_db.sh	Mon Jan 16 07:34:45 2017	(r312274)
@@ -46,13 +46,6 @@ dict()
 	fi
 }
 
-# Begin FreeBSD
-dict()
-{
-	echo /usr/share/dict/words
-}
-# End FreeBSD
-
 SEVEN_SEVEN="abcdefg|abcdefg|abcdefg|abcdefg|abcdefg|abcdefg|abcdefg"
 
 atf_test_case small_btree

From owner-svn-src-projects@freebsd.org  Mon Jan 16 07:39:09 2017
Return-Path: <owner-svn-src-projects@freebsd.org>
Delivered-To: svn-src-projects@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id A3805CB269B
 for <svn-src-projects@mailman.ysv.freebsd.org>;
 Mon, 16 Jan 2017 07:39:09 +0000 (UTC)
 (envelope-from ngie@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 756971848;
 Mon, 16 Jan 2017 07:39:09 +0000 (UTC)
 (envelope-from ngie@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0G7d8FF016971;
 Mon, 16 Jan 2017 07:39:08 GMT (envelope-from ngie@FreeBSD.org)
Received: (from ngie@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0G7d828016970;
 Mon, 16 Jan 2017 07:39:08 GMT (envelope-from ngie@FreeBSD.org)
Message-Id: <201701160739.v0G7d828016970@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: ngie set sender to
 ngie@FreeBSD.org using -f
From: Ngie Cooper <ngie@FreeBSD.org>
Date: Mon, 16 Jan 2017 07:39:08 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject: svn commit: r312275 -
 projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/gen/posix_spawn
X-SVN-Group: projects
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-projects@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the src &quot; projects&quot;
 tree" <svn-src-projects.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-projects>, 
 <mailto:svn-src-projects-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-projects/>
List-Post: <mailto:svn-src-projects@freebsd.org>
List-Help: <mailto:svn-src-projects-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-projects>, 
 <mailto:svn-src-projects-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 16 Jan 2017 07:39:09 -0000

Author: ngie
Date: Mon Jan 16 07:39:08 2017
New Revision: 312275
URL: https://svnweb.freebsd.org/changeset/base/312275

Log:
  Remove sys/param.h
  
  It was used for nitems, but I converted it to __arraycount later, and
  is already pulled in by header pollution on FreeBSD as well as NetBSD
  ala sys/cdefs.h

Modified:
  projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/gen/posix_spawn/t_spawnattr.c

Modified: projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/gen/posix_spawn/t_spawnattr.c
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/gen/posix_spawn/t_spawnattr.c	Mon Jan 16 07:34:45 2017	(r312274)
+++ projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/gen/posix_spawn/t_spawnattr.c	Mon Jan 16 07:39:08 2017	(r312275)
@@ -30,7 +30,6 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include <sys/param.h>
 #include <atf-c.h>
 #include <stdio.h>
 #include <stdlib.h>

From owner-svn-src-projects@freebsd.org  Mon Jan 16 07:41:40 2017
Return-Path: <owner-svn-src-projects@freebsd.org>
Delivered-To: svn-src-projects@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id D51A4CB2868
 for <svn-src-projects@mailman.ysv.freebsd.org>;
 Mon, 16 Jan 2017 07:41:40 +0000 (UTC)
 (envelope-from ngie@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 83C641A8B;
 Mon, 16 Jan 2017 07:41:40 +0000 (UTC)
 (envelope-from ngie@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0G7fdex019193;
 Mon, 16 Jan 2017 07:41:39 GMT (envelope-from ngie@FreeBSD.org)
Received: (from ngie@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0G7fdNa019192;
 Mon, 16 Jan 2017 07:41:39 GMT (envelope-from ngie@FreeBSD.org)
Message-Id: <201701160741.v0G7fdNa019192@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: ngie set sender to
 ngie@FreeBSD.org using -f
From: Ngie Cooper <ngie@FreeBSD.org>
Date: Mon, 16 Jan 2017 07:41:39 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject: svn commit: r312276 -
 projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/gen
X-SVN-Group: projects
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-projects@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the src &quot; projects&quot;
 tree" <svn-src-projects.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-projects>, 
 <mailto:svn-src-projects-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-projects/>
List-Post: <mailto:svn-src-projects@freebsd.org>
List-Help: <mailto:svn-src-projects-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-projects>, 
 <mailto:svn-src-projects-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 16 Jan 2017 07:41:41 -0000

Author: ngie
Date: Mon Jan 16 07:41:39 2017
New Revision: 312276
URL: https://svnweb.freebsd.org/changeset/base/312276

Log:
  Add GLOB_STAR #ifdef to testcases which require GLOB_STAR support

Modified:
  projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/gen/t_glob.c

Modified: projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/gen/t_glob.c
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/gen/t_glob.c	Mon Jan 16 07:39:08 2017	(r312275)
+++ projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/gen/t_glob.c	Mon Jan 16 07:41:39 2017	(r312276)
@@ -85,7 +85,7 @@ static struct gl_dir d[] = {
 	{ "a/b", b, __arraycount(b), 0 },
 };
 
-#ifndef __FreeBSD__
+#ifdef GLOB_STAR
 static const char *glob_star[] = {
     "a/1", "a/3", "a/4", "a/b", "a/b/w", "a/b/x", "a/b/y", "a/b/z",
 };
@@ -219,7 +219,7 @@ run(const char *p, int flags, const char
 }
 
 
-#ifndef __FreeBSD__
+#ifdef GLOB_STAR
 ATF_TC(glob_star);
 ATF_TC_HEAD(glob_star, tc)
 {
@@ -268,7 +268,7 @@ ATF_TC_BODY(glob_nocheck, tc)
 
 ATF_TP_ADD_TCS(tp)
 {
-#ifndef __FreeBSD__
+#ifdef GLOB_STAR
 	ATF_TP_ADD_TC(tp, glob_star);
 #endif
 	ATF_TP_ADD_TC(tp, glob_star_not);

From owner-svn-src-projects@freebsd.org  Mon Jan 16 17:43:46 2017
Return-Path: <owner-svn-src-projects@freebsd.org>
Delivered-To: svn-src-projects@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 42E67CB2068
 for <svn-src-projects@mailman.ysv.freebsd.org>;
 Mon, 16 Jan 2017 17:43:46 +0000 (UTC)
 (envelope-from ngie@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 118C213F0;
 Mon, 16 Jan 2017 17:43:45 +0000 (UTC)
 (envelope-from ngie@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0GHhjIP071337;
 Mon, 16 Jan 2017 17:43:45 GMT (envelope-from ngie@FreeBSD.org)
Received: (from ngie@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0GHhin5071324;
 Mon, 16 Jan 2017 17:43:44 GMT (envelope-from ngie@FreeBSD.org)
Message-Id: <201701161743.v0GHhin5071324@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: ngie set sender to
 ngie@FreeBSD.org using -f
From: Ngie Cooper <ngie@FreeBSD.org>
Date: Mon, 16 Jan 2017 17:43:44 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject: svn commit: r312295 - in
 projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests: lib/libc/ssp
 lib/libc/sys lib/libpthread net/carp
X-SVN-Group: projects
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-projects@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the src &quot; projects&quot;
 tree" <svn-src-projects.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-projects>, 
 <mailto:svn-src-projects-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-projects/>
List-Post: <mailto:svn-src-projects@freebsd.org>
List-Help: <mailto:svn-src-projects-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-projects>, 
 <mailto:svn-src-projects-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 16 Jan 2017 17:43:46 -0000

Author: ngie
Date: Mon Jan 16 17:43:43 2017
New Revision: 312295
URL: https://svnweb.freebsd.org/changeset/base/312295

Log:
  Merge ^/vendor/NetBSD/tests/dist@r312294
  
  This includes a number of accepted upstream fixes, as well as
  a reimplementation of the net/carp/... testcase (which is
  currently unused).

Added:
  projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/net/carp/t_basic.sh
     - copied unchanged from r312294, vendor/NetBSD/tests/dist/net/carp/t_basic.sh
Deleted:
  projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/net/carp/t_basic.c
Modified:
  projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/ssp/h_memset.c
  projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/ssp/h_read.c
  projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/sys/t_mmap.c
  projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/sys/t_timer_create.c
  projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libpthread/t_condwait.c
  projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libpthread/t_detach.c
  projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libpthread/t_fork.c
  projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libpthread/t_fpu.c
  projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libpthread/t_mutex.c
  projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libpthread/t_sem.c
  projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libpthread/t_swapcontext.c
Directory Properties:
  projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/   (props changed)

Modified: projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/ssp/h_memset.c
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/ssp/h_memset.c	Mon Jan 16 17:25:48 2017	(r312294)
+++ projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/ssp/h_memset.c	Mon Jan 16 17:43:43 2017	(r312295)
@@ -1,4 +1,4 @@
-/* $NetBSD: h_memset.c,v 1.1 2010/12/27 02:04:19 pgoyette Exp $ */
+/* $NetBSD: h_memset.c,v 1.2 2017/01/16 16:34:24 christos Exp $ */
 
 /*
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
 #include <sys/cdefs.h>
 __COPYRIGHT("@(#) Copyright (c) 2008\
  The NetBSD Foundation, inc. All rights reserved.");
-__RCSID("$NetBSD: h_memset.c,v 1.1 2010/12/27 02:04:19 pgoyette Exp $");
+__RCSID("$NetBSD: h_memset.c,v 1.2 2017/01/16 16:34:24 christos Exp $");
 
 #include <stdio.h>
 #include <string.h>
@@ -41,9 +41,5 @@ main(int argc, char *argv[])
 	char b[10];
 	size_t len =  atoi(argv[1]);
 	(void)memset(b, 0, len);
-#ifdef __FreeBSD__
 	return b[0]; /* keeps optimizer from zapping the call to memset() */
-#else
-	return 0;
-#endif
 }

Modified: projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/ssp/h_read.c
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/ssp/h_read.c	Mon Jan 16 17:25:48 2017	(r312294)
+++ projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/ssp/h_read.c	Mon Jan 16 17:43:43 2017	(r312295)
@@ -1,4 +1,4 @@
-/* $NetBSD: h_read.c,v 1.1 2010/12/27 02:04:19 pgoyette Exp $ */
+/* $NetBSD: h_read.c,v 1.2 2017/01/16 16:35:57 christos Exp $ */
 
 /*
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -29,17 +29,15 @@
 #include <sys/cdefs.h>
 __COPYRIGHT("@(#) Copyright (c) 2008\
  The NetBSD Foundation, inc. All rights reserved.");
-__RCSID("$NetBSD: h_read.c,v 1.1 2010/12/27 02:04:19 pgoyette Exp $");
+__RCSID("$NetBSD: h_read.c,v 1.2 2017/01/16 16:35:57 christos Exp $");
 
 #include <sys/param.h>
+#include <fcntl.h>
+#include <paths.h>
 #include <stdio.h>
 #include <unistd.h>
 #include <stdlib.h>
 
-#ifdef __FreeBSD__
-#include <fcntl.h>
-#include <paths.h>
-
 int
 main(int argc, char *argv[])
 {
@@ -54,14 +52,3 @@ main(int argc, char *argv[])
 	(void)printf("%s\n", b);
 	return (0);
 }
-#else
-int
-main(int argc, char *argv[])
-{
-	char b[MAXPATHLEN];
-	size_t len = atoi(argv[1]);
-
-	(void)printf("%s\n", b);
-	return 0;
-}
-#endif

Modified: projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/sys/t_mmap.c
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/sys/t_mmap.c	Mon Jan 16 17:25:48 2017	(r312294)
+++ projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/sys/t_mmap.c	Mon Jan 16 17:43:43 2017	(r312295)
@@ -1,4 +1,4 @@
-/* $NetBSD: t_mmap.c,v 1.11 2017/01/13 20:43:11 christos Exp $ */
+/* $NetBSD: t_mmap.c,v 1.12 2017/01/16 16:31:05 christos Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -55,9 +55,10 @@
  * SUCH DAMAGE.
  */
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: t_mmap.c,v 1.11 2017/01/13 20:43:11 christos Exp $");
+__RCSID("$NetBSD: t_mmap.c,v 1.12 2017/01/16 16:31:05 christos Exp $");
 
 #include <sys/param.h>
+#include <sys/disklabel.h>
 #include <sys/mman.h>
 #include <sys/stat.h>
 #include <sys/socket.h>
@@ -73,11 +74,8 @@ __RCSID("$NetBSD: t_mmap.c,v 1.11 2017/0
 #include <string.h>
 #include <unistd.h>
 #include <paths.h>
-#ifdef __NetBSD__
-#include <machine/disklabel.h>
-#else
+#ifdef __FreeBSD__
 #include <stdint.h>
-#include <sys/disklabel.h>
 #endif
 
 static long	page = 0;

Modified: projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/sys/t_timer_create.c
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/sys/t_timer_create.c	Mon Jan 16 17:25:48 2017	(r312294)
+++ projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/sys/t_timer_create.c	Mon Jan 16 17:43:43 2017	(r312295)
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_timer_create.c,v 1.4 2012/03/18 07:00:52 jruoho Exp $ */
+/*	$NetBSD: t_timer_create.c,v 1.5 2017/01/16 16:32:13 christos Exp $ */
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -38,11 +38,7 @@ static timer_t t;
 static bool fail = true;
 
 static void
-#ifdef __FreeBSD__
 timer_signal_handler(int signo, siginfo_t *si, void *osi __unused)
-#else
-timer_signal_handler(int signo, siginfo_t *si, void *osi)
-#endif
 {
 	timer_t *tp;
 

Modified: projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libpthread/t_condwait.c
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libpthread/t_condwait.c	Mon Jan 16 17:25:48 2017	(r312294)
+++ projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libpthread/t_condwait.c	Mon Jan 16 17:43:43 2017	(r312295)
@@ -1,4 +1,4 @@
-/* $NetBSD: t_condwait.c,v 1.4 2013/04/12 17:18:11 christos Exp $ */
+/* $NetBSD: t_condwait.c,v 1.5 2017/01/16 16:29:19 christos Exp $ */
 
 /*
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -26,8 +26,9 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: t_condwait.c,v 1.4 2013/04/12 17:18:11 christos Exp $");
+__RCSID("$NetBSD: t_condwait.c,v 1.5 2017/01/16 16:29:19 christos Exp $");
 
+#include <sys/time.h>
 #include <errno.h>
 #include <pthread.h>
 #include <stdio.h>
@@ -40,11 +41,7 @@ __RCSID("$NetBSD: t_condwait.c,v 1.4 201
 
 #include "isqemu.h"
 
-#ifdef __FreeBSD__
-#include <sys/time.h>
-
 #include "h_common.h"
-#endif
 
 #define WAITTIME 2	/* Timeout wait secound */
 
@@ -62,13 +59,8 @@ run(void *param)
 
 
 	clck = *(clockid_t *)param;
-#ifdef	__FreeBSD__
 	PTHREAD_REQUIRE(pthread_condattr_init(&attr));
 	PTHREAD_REQUIRE(pthread_condattr_setclock(&attr, clck));
-#else
-	pthread_condattr_init(&attr);
-	pthread_condattr_setclock(&attr, clck); /* MONOTONIC or MONOTONIC */
-#endif
 	pthread_cond_init(&cond, &attr);
 
 	ATF_REQUIRE_EQ((ret = pthread_mutex_lock(&m)), 0);

Modified: projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libpthread/t_detach.c
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libpthread/t_detach.c	Mon Jan 16 17:25:48 2017	(r312294)
+++ projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libpthread/t_detach.c	Mon Jan 16 17:43:43 2017	(r312295)
@@ -1,4 +1,4 @@
-/* $NetBSD: t_detach.c,v 1.1 2011/03/24 13:52:04 jruoho Exp $ */
+/* $NetBSD: t_detach.c,v 1.2 2017/01/16 16:29:54 christos Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -29,10 +29,11 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: t_detach.c,v 1.1 2011/03/24 13:52:04 jruoho Exp $");
+__RCSID("$NetBSD: t_detach.c,v 1.2 2017/01/16 16:29:54 christos Exp $");
 
-#include <pthread.h>
 #include <errno.h>
+#include <pthread.h>
+#include <time.h>
 
 #include <atf-c.h>
 
@@ -47,9 +48,7 @@ static void	*func(void *);
 static void *
 func(void *arg)
 {
-#ifdef __FreeBSD__
 	sleep(2);
-#endif
 	return NULL;
 }
 
@@ -79,25 +78,17 @@ ATF_TC_BODY(pthread_detach, tc)
 	 */
 	PTHREAD_REQUIRE(pthread_detach(t));
 
-#ifdef __FreeBSD__
 	sleep(1);
-#endif
 	rv = pthread_join(t, NULL);
 	ATF_REQUIRE(rv == EINVAL);
 
-#ifdef __FreeBSD__
 	sleep(3);
-#endif
 
 	/*
 	 * As usual, ESRCH should follow if
 	 * we try to detach an invalid thread.
 	 */
-#ifdef __NetBSD__
-	rv = pthread_cancel(NULL);
-#else
 	rv = pthread_cancel(t);
-#endif
 	ATF_REQUIRE(rv == ESRCH);
 }
 

Modified: projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libpthread/t_fork.c
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libpthread/t_fork.c	Mon Jan 16 17:25:48 2017	(r312294)
+++ projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libpthread/t_fork.c	Mon Jan 16 17:43:43 2017	(r312295)
@@ -1,4 +1,4 @@
-/* $NetBSD: t_fork.c,v 1.1 2010/07/16 15:42:53 jmmv Exp $ */
+/* $NetBSD: t_fork.c,v 1.2 2017/01/16 16:28:27 christos Exp $ */
 
 /*
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
 #include <sys/cdefs.h>
 __COPYRIGHT("@(#) Copyright (c) 2008\
  The NetBSD Foundation, inc. All rights reserved.");
-__RCSID("$NetBSD: t_fork.c,v 1.1 2010/07/16 15:42:53 jmmv Exp $");
+__RCSID("$NetBSD: t_fork.c,v 1.2 2017/01/16 16:28:27 christos Exp $");
 
 /*
  * Written by Love Hörnquist Åstrand <lha@NetBSD.org>, March 2003.
@@ -61,11 +61,7 @@ print_pid(void *arg)
 
 	thread_survived = 1;
 	if (parent != getpid()) {
-#ifdef __FreeBSD__
 		_exit(1);
-#else
-		exit(1);
-#endif
 	}
 	return NULL;
 }
@@ -99,11 +95,7 @@ ATF_TC_BODY(fork, tc)
 		ATF_REQUIRE_EQ_MSG(WEXITSTATUS(status), 0, "thread survived in child");
 	} else {
 		sleep(5);
-#ifdef __FreeBSD__
 		_exit(thread_survived ? 1 : 0);
-#else
-		exit(thread_survived ? 1 : 0);
-#endif
 	}
 }
 

Modified: projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libpthread/t_fpu.c
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libpthread/t_fpu.c	Mon Jan 16 17:25:48 2017	(r312294)
+++ projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libpthread/t_fpu.c	Mon Jan 16 17:43:43 2017	(r312295)
@@ -1,4 +1,4 @@
-/* $NetBSD: t_fpu.c,v 1.2 2013/01/27 14:47:37 mbalmer Exp $ */
+/* $NetBSD: t_fpu.c,v 1.3 2017/01/16 16:27:43 christos Exp $ */
 
 /*
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
 #include <sys/cdefs.h>
 __COPYRIGHT("@(#) Copyright (c) 2008\
  The NetBSD Foundation, inc. All rights reserved.");
-__RCSID("$NetBSD: t_fpu.c,v 1.2 2013/01/27 14:47:37 mbalmer Exp $");
+__RCSID("$NetBSD: t_fpu.c,v 1.3 2017/01/16 16:27:43 christos Exp $");
 
 /*
  * This is adapted from part of csw/cstest of the MPD implementation by
@@ -49,10 +49,12 @@ __RCSID("$NetBSD: t_fpu.c,v 1.2 2013/01/
  * <is@netbsd.org>.
  */
 
+#include <errno.h>
 #include <math.h>
 #include <pthread.h>
 #include <sched.h>
 #include <stdio.h>
+#include <string.h>
 #include <stdlib.h>
 #include <unistd.h>
 
@@ -82,24 +84,16 @@ stir(void *p)
 
 	for (;;) {
 		x = sin ((y = cos (x + y + .4)) - (z = cos (x + z + .6)));
-#ifdef	__FreeBSD__
 		ATF_REQUIRE_MSG(sched_yield() == 0,
 		    "sched_yield failed: %s", strerror(errno));
-#else
-		PTHREAD_REQUIRE(sched_yield());
-#endif
 	}
 }
 
 static double
 mul3(double x, double y, double z)
 {
-#ifdef	__FreeBSD__
 	ATF_REQUIRE_MSG(sched_yield() == 0,
 	    "sched_yield failed: %s", strerror(errno));
-#else
-	PTHREAD_REQUIRE(sched_yield());
-#endif
 
 	return x * y * z;
 }
@@ -129,11 +123,7 @@ bar(void *p)
 static void
 recurse(void) {
 	pthread_t s2;
-#ifdef	__FreeBSD__
 	PTHREAD_REQUIRE(pthread_create(&s2, 0, bar, 0));
-#else
-	pthread_create(&s2, 0, bar, 0);
-#endif
 	sleep(20); /* XXX must be long enough for our slowest machine */
 }
 
@@ -153,11 +143,7 @@ ATF_TC_BODY(fpu, tc)
 
 	PTHREAD_REQUIRE(pthread_mutex_init(&recursion_depth_lock, 0));
 
-#ifdef	__FreeBSD__
 	PTHREAD_REQUIRE(pthread_create(&s5, 0, stir, stirseed));
-#else
-	pthread_create(&s5, 0, stir, stirseed);
-#endif
 	recurse();
 
 	atf_tc_fail("exiting from main");

Modified: projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libpthread/t_mutex.c
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libpthread/t_mutex.c	Mon Jan 16 17:25:48 2017	(r312294)
+++ projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libpthread/t_mutex.c	Mon Jan 16 17:43:43 2017	(r312295)
@@ -1,4 +1,4 @@
-/* $NetBSD: t_mutex.c,v 1.14 2016/10/31 23:51:20 christos Exp $ */
+/* $NetBSD: t_mutex.c,v 1.15 2017/01/16 16:23:41 christos Exp $ */
 
 /*
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -29,12 +29,10 @@
 #include <sys/cdefs.h>
 __COPYRIGHT("@(#) Copyright (c) 2008\
  The NetBSD Foundation, inc. All rights reserved.");
-__RCSID("$NetBSD: t_mutex.c,v 1.14 2016/10/31 23:51:20 christos Exp $");
+__RCSID("$NetBSD: t_mutex.c,v 1.15 2017/01/16 16:23:41 christos Exp $");
 
-#ifdef __FreeBSD__
 #include <sys/time.h> /* For timespecadd */
 #include <inttypes.h> /* For UINT16_MAX */
-#endif
 #include <pthread.h>
 #include <stdio.h>
 #include <string.h>
@@ -594,20 +592,16 @@ ATF_TC_BODY(mutexattr2, tc)
 	int min_prio = sched_get_priority_min(SCHED_FIFO);
 	for (int i = min_prio; i <= max_prio; i++) {
 		int prioceiling;
-#ifdef __FreeBSD__
 		int protocol;
 
 		PTHREAD_REQUIRE(pthread_mutexattr_getprotocol(&mattr,
 		    &protocol));
 
 		printf("priority: %d\nprotocol: %d\n", i, protocol);
-#endif
 		PTHREAD_REQUIRE(pthread_mutexattr_setprioceiling(&mattr, i));
 		PTHREAD_REQUIRE(pthread_mutexattr_getprioceiling(&mattr,
 		    &prioceiling));
-#ifdef __FreeBSD__
 		printf("prioceiling: %d\n", prioceiling);
-#endif
 		ATF_REQUIRE_EQ(i, prioceiling);
 	}
 }

Modified: projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libpthread/t_sem.c
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libpthread/t_sem.c	Mon Jan 16 17:25:48 2017	(r312294)
+++ projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libpthread/t_sem.c	Mon Jan 16 17:43:43 2017	(r312295)
@@ -1,4 +1,4 @@
-/* $NetBSD: t_sem.c,v 1.8 2014/11/04 00:20:19 justin Exp $ */
+/* $NetBSD: t_sem.c,v 1.9 2017/01/16 16:22:22 christos Exp $ */
 
 /*
  * Copyright (c) 2008, 2010 The NetBSD Foundation, Inc.
@@ -86,8 +86,9 @@
 #include <sys/cdefs.h>
 __COPYRIGHT("@(#) Copyright (c) 2008, 2010\
  The NetBSD Foundation, inc. All rights reserved.");
-__RCSID("$NetBSD: t_sem.c,v 1.8 2014/11/04 00:20:19 justin Exp $");
+__RCSID("$NetBSD: t_sem.c,v 1.9 2017/01/16 16:22:22 christos Exp $");
 
+#include <sys/time.h>
 #include <errno.h>
 #include <fcntl.h>
 #include <pthread.h>

Modified: projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libpthread/t_swapcontext.c
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libpthread/t_swapcontext.c	Mon Jan 16 17:25:48 2017	(r312294)
+++ projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libpthread/t_swapcontext.c	Mon Jan 16 17:43:43 2017	(r312295)
@@ -1,4 +1,4 @@
-/* $NetBSD: t_swapcontext.c,v 1.2 2014/08/25 16:31:15 bouyer Exp $ */
+/* $NetBSD: t_swapcontext.c,v 1.3 2017/01/16 16:27:06 christos Exp $ */
 
 /*
  * Copyright (c) 2012 Emmanuel Dreyfus. All rights reserved.
@@ -28,15 +28,13 @@
 #include <sys/cdefs.h>
 __RCSID("$NetBSD");
 
-#ifdef __FreeBSD__
 #include <sys/types.h>
 #include <errno.h>
-#include <string.h>
-#endif
 #include <pthread.h>
-#include <ucontext.h>
 #include <stdio.h>
 #include <stdlib.h>
+#include <string.h>
+#include <ucontext.h>
 
 #include <atf-c.h>
 
@@ -82,12 +80,8 @@ threadfunc(void *arg)
        
 	oself = (void *)pthread_self();
 	printf("before swapcontext self = %p\n", oself);
-#ifdef	__FreeBSD__
 	ATF_REQUIRE_MSG(swapcontext(&octx, &nctx) != -1, "swapcontext failed: %s",
 	    strerror(errno));
-#else
-	PTHREAD_REQUIRE(swapcontext(&octx, &nctx));
-#endif
 
 	/* NOTREACHED */
 	return NULL;
@@ -118,12 +112,8 @@ ATF_TC_BODY(swapcontext1, tc)
 
 	printf("Testing if swapcontext() alters pthread_self()\n");
 
-#ifdef	__FreeBSD__
 	ATF_REQUIRE_MSG(getcontext(&nctx) != -1, "getcontext failed: %s",
 	    strerror(errno));
-#else
-	PTHREAD_REQUIRE(getcontext(&nctx));
-#endif
 	PTHREAD_REQUIRE(pthread_create(&thread, NULL, threadfunc, NULL));
 	PTHREAD_REQUIRE(pthread_join(thread, NULL));
 }

Copied: projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/net/carp/t_basic.sh (from r312294, vendor/NetBSD/tests/dist/net/carp/t_basic.sh)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/net/carp/t_basic.sh	Mon Jan 16 17:43:43 2017	(r312295, copy of r312294, vendor/NetBSD/tests/dist/net/carp/t_basic.sh)
@@ -0,0 +1,165 @@
+#	$NetBSD: t_basic.sh,v 1.1 2017/01/16 08:18:11 ozaki-r Exp $
+#
+# Copyright (c) 2017 Internet Initiative Japan Inc.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+
+SOCK_CLIENT=unix://carp_client
+SOCK_MASTER=unix://carp_master
+SOCK_BACKUP=unix://carp_backup
+BUS=bus_carp
+IP_CLIENT=10.1.1.240
+IP_MASTER=10.1.1.1
+IP_BACKUP=10.1.1.2
+IP_CARP=10.1.1.100
+TIMEOUT=3
+
+atf_test_case carp_handover cleanup
+
+carp_handover_head()
+{
+
+	atf_set "descr" "Tests for CARP handover"
+	atf_set "require.progs" "rump_server"
+}
+
+setup_carp()
+{
+	local sock=$1
+	local master=$2
+	local carpif= ip= advskew=
+
+	if $master; then
+		carpif=carp0
+		ip=$IP_MASTER
+		advskew=0
+	else
+		carpif=carp1
+		ip=$IP_BACKUP
+		advskew=200
+	fi
+
+	export RUMP_SERVER=$sock
+	atf_check -s exit:0 rump.ifconfig $carpif create
+	atf_check -s exit:0 rump.ifconfig shmif0 $ip/24 up
+	atf_check -s exit:0 rump.ifconfig $carpif \
+	    vhid 175 advskew $advskew advbase 1 pass s3cret \
+	    $IP_CARP netmask 255.255.255.0
+	atf_check -s exit:0 rump.ifconfig -w 10
+}
+
+wait_handover()
+{
+	local i=0
+
+	export RUMP_SERVER=$SOCK_CLIENT
+
+	while [ $i -ne 5 ]; do
+		$DEBUG && echo "Trying ping $IP_CARP"
+		rump.ping -n -w 1 -c 1 $IP_CARP >/dev/null
+		if [ $? = 0 ]; then
+			$DEBUG && echo "Passed ping $IP_CARP"
+			break;
+		fi
+		$DEBUG && echo "Failed ping $IP_CARP"
+		i=$((i + 1))
+	done
+
+	if [ $i -eq 5 ]; then
+		atf_fail "Failed to failover (5 sec)"
+	fi
+}
+
+carp_handover_body()
+{
+
+	rump_server_start $SOCK_CLIENT
+	rump_server_start $SOCK_MASTER
+	rump_server_start $SOCK_BACKUP
+
+	rump_server_add_iface $SOCK_CLIENT shmif0 $BUS
+	rump_server_add_iface $SOCK_MASTER shmif0 $BUS
+	rump_server_add_iface $SOCK_BACKUP shmif0 $BUS
+
+	setup_carp $SOCK_MASTER true
+	setup_carp $SOCK_BACKUP false
+
+	export RUMP_SERVER=$SOCK_CLIENT
+	atf_check -s exit:0 rump.ifconfig shmif0 $IP_CLIENT/24 up
+	atf_check -s exit:0 rump.ifconfig -w 10
+
+	# Check that the primary addresses are up
+	atf_check -s exit:0 -o ignore \
+	    rump.ping -n -w $TIMEOUT -c 1 $IP_MASTER
+	atf_check -s exit:0 -o ignore \
+	    rump.ping -n -w $TIMEOUT -c 1 $IP_BACKUP
+
+	# Give carp a while to croak
+	sleep 4
+
+	# Check state
+	export RUMP_SERVER=$SOCK_MASTER
+	$DEBUG && rump.ifconfig
+	atf_check -s exit:0 -o match:'carp: MASTER carpdev shmif0' \
+	    rump.ifconfig carp0
+	export RUMP_SERVER=$SOCK_BACKUP
+	$DEBUG && rump.ifconfig
+	atf_check -s exit:0 -o match:'carp: BACKUP carpdev shmif0' \
+	    rump.ifconfig carp1
+	export RUMP_SERVER=$SOCK_CLIENT
+
+	# Check that the shared IP works
+	atf_check -s exit:0 -o ignore \
+	    rump.ping -n -w $TIMEOUT -c 1 $IP_CARP
+
+	# KILLING SPREE
+	env RUMP_SERVER=$SOCK_MASTER rump.halt
+	sleep 1
+
+	# Check that primary is now dead
+	atf_check -s not-exit:0 -o ignore \
+	    rump.ping -n -w $TIMEOUT -c 1 $IP_MASTER
+
+	# Do it in installments. carp will cluck meanwhile
+	wait_handover
+
+	# Check state
+	export RUMP_SERVER=$SOCK_BACKUP
+	$DEBUG && rump.ifconfig
+	atf_check -s exit:0 -o match:'carp: MASTER carpdev shmif0' \
+	    rump.ifconfig carp1
+}
+
+carp_handover_cleanup()
+{
+
+	$DEBUG && dump
+	cleanup
+}
+
+atf_init_test_cases()
+{
+
+	atf_add_test_case carp_handover
+}

From owner-svn-src-projects@freebsd.org  Mon Jan 16 17:49:55 2017
Return-Path: <owner-svn-src-projects@freebsd.org>
Delivered-To: svn-src-projects@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8A989CB222B
 for <svn-src-projects@mailman.ysv.freebsd.org>;
 Mon, 16 Jan 2017 17:49:55 +0000 (UTC)
 (envelope-from ngie@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 34A1718D8;
 Mon, 16 Jan 2017 17:49:55 +0000 (UTC)
 (envelope-from ngie@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0GHnsHx071708;
 Mon, 16 Jan 2017 17:49:54 GMT (envelope-from ngie@FreeBSD.org)
Received: (from ngie@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0GHnsbI071706;
 Mon, 16 Jan 2017 17:49:54 GMT (envelope-from ngie@FreeBSD.org)
Message-Id: <201701161749.v0GHnsbI071706@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: ngie set sender to
 ngie@FreeBSD.org using -f
From: Ngie Cooper <ngie@FreeBSD.org>
Date: Mon, 16 Jan 2017 17:49:54 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject: svn commit: r312297 - in projects/netbsd-tests-upstream-01-2017:
 contrib/netbsd-tests/fs/tmpfs tests/sys/fs/tmpfs
X-SVN-Group: projects
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-projects@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the src &quot; projects&quot;
 tree" <svn-src-projects.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-projects>, 
 <mailto:svn-src-projects-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-projects/>
List-Post: <mailto:svn-src-projects@freebsd.org>
List-Help: <mailto:svn-src-projects-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-projects>, 
 <mailto:svn-src-projects-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 16 Jan 2017 17:49:55 -0000

Author: ngie
Date: Mon Jan 16 17:49:53 2017
New Revision: 312297
URL: https://svnweb.freebsd.org/changeset/base/312297

Log:
  Use _SED to rewrite mknod ... p command as mkfifo instead of
  adding an unnecessary diff to the test

Modified:
  projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/fs/tmpfs/t_readdir.sh
  projects/netbsd-tests-upstream-01-2017/tests/sys/fs/tmpfs/Makefile

Modified: projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/fs/tmpfs/t_readdir.sh
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/fs/tmpfs/t_readdir.sh	Mon Jan 16 17:46:38 2017	(r312296)
+++ projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/fs/tmpfs/t_readdir.sh	Mon Jan 16 17:49:53 2017	(r312297)
@@ -59,15 +59,7 @@ types_body() {
 	atf_check -s eq:0 -o empty -e empty ln -s reg lnk
 	atf_check -s eq:0 -o empty -e empty mknod blk b 0 0
 	atf_check -s eq:0 -o empty -e empty mknod chr c 0 0
-	# Begin FreeBSD
-	if true; then
-	atf_check -s eq:0 -o empty -e empty mkfifo fifo
-	else
-	# End FreeBSD
 	atf_check -s eq:0 -o empty -e empty mknod fifo p
-	# Begin FreeBSD
-	fi
-	# End FreeBSD
 	atf_check -s eq:0 -o empty -e empty \
 	    $(atf_get_srcdir)/h_tools sockets sock
 

Modified: projects/netbsd-tests-upstream-01-2017/tests/sys/fs/tmpfs/Makefile
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/tests/sys/fs/tmpfs/Makefile	Mon Jan 16 17:46:38 2017	(r312296)
+++ projects/netbsd-tests-upstream-01-2017/tests/sys/fs/tmpfs/Makefile	Mon Jan 16 17:49:53 2017	(r312297)
@@ -47,6 +47,7 @@ ATF_TESTS_SH_SED_mount_test=		\
 					-e 's,-o -s,-o size=,g' \
 					-e 's,-o -u,-o uid=,g' \
 					-e 's,mount_${FILESYSTEM},mount -t ${FILESYSTEM},g'
+ATF_TESTS_SH_SED_readdir_test=		-e 's,mknod fifo p,mkfifo fifo,g'
 ATF_TESTS_SH_SED_sizes_test=		-e 's,-o -s,-o size=,g'
 ATF_TESTS_SH_SED_statvfs_test=		-e 's,-o -s,-o size=,g'
 ATF_TESTS_SH_SED_vnode_leak_test=	-e 's,-o -s,-o size=,g'

From owner-svn-src-projects@freebsd.org  Mon Jan 16 17:53:59 2017
Return-Path: <owner-svn-src-projects@freebsd.org>
Delivered-To: svn-src-projects@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id CD5ABCB2424
 for <svn-src-projects@mailman.ysv.freebsd.org>;
 Mon, 16 Jan 2017 17:53:59 +0000 (UTC)
 (envelope-from ngie@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 844EC1DE9;
 Mon, 16 Jan 2017 17:53:59 +0000 (UTC)
 (envelope-from ngie@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0GHrwVJ075381;
 Mon, 16 Jan 2017 17:53:58 GMT (envelope-from ngie@FreeBSD.org)
Received: (from ngie@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0GHrwi5075379;
 Mon, 16 Jan 2017 17:53:58 GMT (envelope-from ngie@FreeBSD.org)
Message-Id: <201701161753.v0GHrwi5075379@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: ngie set sender to
 ngie@FreeBSD.org using -f
From: Ngie Cooper <ngie@FreeBSD.org>
Date: Mon, 16 Jan 2017 17:53:58 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject: svn commit: r312298 - in projects/netbsd-tests-upstream-01-2017:
 contrib/netbsd-tests/fs/tmpfs tests/sys/fs/tmpfs
X-SVN-Group: projects
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-projects@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the src &quot; projects&quot;
 tree" <svn-src-projects.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-projects>, 
 <mailto:svn-src-projects-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-projects/>
List-Post: <mailto:svn-src-projects@freebsd.org>
List-Help: <mailto:svn-src-projects-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-projects>, 
 <mailto:svn-src-projects-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 16 Jan 2017 17:53:59 -0000

Author: ngie
Date: Mon Jan 16 17:53:58 2017
New Revision: 312298
URL: https://svnweb.freebsd.org/changeset/base/312298

Log:
  Use _SED instead of hacking tests rewriting mknod ... p as mkfifo
  
  Similar to r312297

Modified:
  projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/fs/tmpfs/t_mknod.sh
  projects/netbsd-tests-upstream-01-2017/tests/sys/fs/tmpfs/Makefile

Modified: projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/fs/tmpfs/t_mknod.sh
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/fs/tmpfs/t_mknod.sh	Mon Jan 16 17:49:53 2017	(r312297)
+++ projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/fs/tmpfs/t_mknod.sh	Mon Jan 16 17:53:58 2017	(r312298)
@@ -106,15 +106,7 @@ pipe_body() {
 	test_mount
 	umask 022
 
-	# Begin FreeBSD
-	if true; then
-	atf_check -s eq:0 -o empty -e empty mkfifo pipe
-	else
-	# End FreeBSD
 	atf_check -s eq:0 -o empty -e empty mknod pipe p
-	# Begin FreeBSD
-	fi
-	# End FreeBSD
 	eval $(stat -s pipe)
 	[ ${st_mode} = 010644 ] || atf_fail "Invalid mode"
 
@@ -132,15 +124,7 @@ pipe_kqueue_body() {
 	umask 022
 
 	atf_check -s eq:0 -o empty -e empty mkdir dir
-	# Begin FreeBSD
-	if true; then
-	echo 'mkfifo dir/pipe' | kqueue_monitor 1 dir
-	else
-	# End FreeBSD
 	echo 'mknod dir/pipe p' | kqueue_monitor 1 dir
-	# Begin FreeBSD
-	fi
-	# End FreeBSD
 	kqueue_check dir NOTE_WRITE
 
 	test_unmount

Modified: projects/netbsd-tests-upstream-01-2017/tests/sys/fs/tmpfs/Makefile
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/tests/sys/fs/tmpfs/Makefile	Mon Jan 16 17:49:53 2017	(r312297)
+++ projects/netbsd-tests-upstream-01-2017/tests/sys/fs/tmpfs/Makefile	Mon Jan 16 17:53:58 2017	(r312298)
@@ -41,6 +41,10 @@ ${PACKAGE}FILESDIR=	${TESTSDIR}
 PROGS+=			h_tools
 BINDIR.h_tools=		${TESTSDIR}
 
+ATF_TESTS_SH_SED_mknod_test=		\
+					-e 's,mknod pipe p,mkfifo pipe,g' \
+					-e 's,mknod dir/pipe p,mkfifo dir/pipe,g'
+
 ATF_TESTS_SH_SED_mount_test=		\
 					-e 's,-o -g,-o gid=,g' \
 					-e 's,-o -m,-o mode=,g' \

From owner-svn-src-projects@freebsd.org  Mon Jan 16 18:04:16 2017
Return-Path: <owner-svn-src-projects@freebsd.org>
Delivered-To: svn-src-projects@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 13DBACB2867
 for <svn-src-projects@mailman.ysv.freebsd.org>;
 Mon, 16 Jan 2017 18:04:16 +0000 (UTC)
 (envelope-from ngie@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id DA08D1636;
 Mon, 16 Jan 2017 18:04:15 +0000 (UTC)
 (envelope-from ngie@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0GI4FSZ079349;
 Mon, 16 Jan 2017 18:04:15 GMT (envelope-from ngie@FreeBSD.org)
Received: (from ngie@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0GI4FFM079348;
 Mon, 16 Jan 2017 18:04:15 GMT (envelope-from ngie@FreeBSD.org)
Message-Id: <201701161804.v0GI4FFM079348@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: ngie set sender to
 ngie@FreeBSD.org using -f
From: Ngie Cooper <ngie@FreeBSD.org>
Date: Mon, 16 Jan 2017 18:04:15 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject: svn commit: r312299 -
 projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/sys
X-SVN-Group: projects
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-projects@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the src &quot; projects&quot;
 tree" <svn-src-projects.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-projects>, 
 <mailto:svn-src-projects-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-projects/>
List-Post: <mailto:svn-src-projects@freebsd.org>
List-Help: <mailto:svn-src-projects-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-projects>, 
 <mailto:svn-src-projects-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 16 Jan 2017 18:04:16 -0000

Author: ngie
Date: Mon Jan 16 18:04:14 2017
New Revision: 312299
URL: https://svnweb.freebsd.org/changeset/base/312299

Log:
  Remove unnecessary whitespace diff

Modified:
  projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/sys/t_mmap.c

Modified: projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/sys/t_mmap.c
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/sys/t_mmap.c	Mon Jan 16 17:53:58 2017	(r312298)
+++ projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/sys/t_mmap.c	Mon Jan 16 18:04:14 2017	(r312299)
@@ -377,6 +377,7 @@ ATF_TC_BODY(mmap_prot_3, tc)
 	 * the access should generate SIGSEGV.
 	 */
 	fd = open(path, O_RDWR | O_CREAT, 0700);
+
 	if (fd < 0)
 #ifdef	__FreeBSD__
 		atf_tc_skip("opening %s failed; skipping testcase: %s",

From owner-svn-src-projects@freebsd.org  Mon Jan 16 18:17:55 2017
Return-Path: <owner-svn-src-projects@freebsd.org>
Delivered-To: svn-src-projects@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 02B02CB2DA2
 for <svn-src-projects@mailman.ysv.freebsd.org>;
 Mon, 16 Jan 2017 18:17:55 +0000 (UTC)
 (envelope-from ngie@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id C6ECC1EA4;
 Mon, 16 Jan 2017 18:17:54 +0000 (UTC)
 (envelope-from ngie@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0GIHrnK083883;
 Mon, 16 Jan 2017 18:17:53 GMT (envelope-from ngie@FreeBSD.org)
Received: (from ngie@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0GIHrvS083882;
 Mon, 16 Jan 2017 18:17:53 GMT (envelope-from ngie@FreeBSD.org)
Message-Id: <201701161817.v0GIHrvS083882@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: ngie set sender to
 ngie@FreeBSD.org using -f
From: Ngie Cooper <ngie@FreeBSD.org>
Date: Mon, 16 Jan 2017 18:17:53 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject: svn commit: r312300 -
 projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/sys
X-SVN-Group: projects
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-projects@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the src &quot; projects&quot;
 tree" <svn-src-projects.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-projects>, 
 <mailto:svn-src-projects-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-projects/>
List-Post: <mailto:svn-src-projects@freebsd.org>
List-Help: <mailto:svn-src-projects-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-projects>, 
 <mailto:svn-src-projects-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 16 Jan 2017 18:17:55 -0000

Author: ngie
Date: Mon Jan 16 18:17:53 2017
New Revision: 312300
URL: https://svnweb.freebsd.org/changeset/base/312300

Log:
  Use sys/param.h instead of sys/types.h to prep for upstreaming to NetBSD

Modified:
  projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/sys/t_mlock.c

Modified: projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/sys/t_mlock.c
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/sys/t_mlock.c	Mon Jan 16 18:04:14 2017	(r312299)
+++ projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/sys/t_mlock.c	Mon Jan 16 18:17:53 2017	(r312300)
@@ -32,7 +32,7 @@
 __RCSID("$NetBSD: t_mlock.c,v 1.6 2016/08/09 12:02:44 kre Exp $");
 
 #ifdef __FreeBSD__
-#include <sys/types.h>
+#include <sys/param.h> /* NetBSD requires sys/param.h for sysctl(3), unlike FreeBSD */
 #endif
 #include <sys/mman.h>
 #include <sys/resource.h>

From owner-svn-src-projects@freebsd.org  Mon Jan 16 18:36:39 2017
Return-Path: <owner-svn-src-projects@freebsd.org>
Delivered-To: svn-src-projects@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id C9EDDCB261E
 for <svn-src-projects@mailman.ysv.freebsd.org>;
 Mon, 16 Jan 2017 18:36:39 +0000 (UTC)
 (envelope-from ngie@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 9BD521B63;
 Mon, 16 Jan 2017 18:36:39 +0000 (UTC)
 (envelope-from ngie@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0GIacP0092067;
 Mon, 16 Jan 2017 18:36:38 GMT (envelope-from ngie@FreeBSD.org)
Received: (from ngie@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0GIac6Z092066;
 Mon, 16 Jan 2017 18:36:38 GMT (envelope-from ngie@FreeBSD.org)
Message-Id: <201701161836.v0GIac6Z092066@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: ngie set sender to
 ngie@FreeBSD.org using -f
From: Ngie Cooper <ngie@FreeBSD.org>
Date: Mon, 16 Jan 2017 18:36:38 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject: svn commit: r312301 -
 projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/rpc
X-SVN-Group: projects
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-projects@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the src &quot; projects&quot;
 tree" <svn-src-projects.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-projects>, 
 <mailto:svn-src-projects-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-projects/>
List-Post: <mailto:svn-src-projects@freebsd.org>
List-Help: <mailto:svn-src-projects-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-projects>, 
 <mailto:svn-src-projects-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 16 Jan 2017 18:36:39 -0000

Author: ngie
Date: Mon Jan 16 18:36:38 2017
New Revision: 312301
URL: https://svnweb.freebsd.org/changeset/base/312301

Log:
  Diff reduce with upstream by using macros and logic integrated in
  later revisions of the test

Modified:
  projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/rpc/t_rpc.c

Modified: projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/rpc/t_rpc.c
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/rpc/t_rpc.c	Mon Jan 16 18:17:53 2017	(r312300)
+++ projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/rpc/t_rpc.c	Mon Jan 16 18:36:38 2017	(r312301)
@@ -24,13 +24,6 @@ __RCSID("$NetBSD: t_rpc.c,v 1.10 2016/08
 	return ev;					\
 } while(/*CONSTCOND*/0)
 
-#ifdef __FreeBSD__
-#define SKIPXI(ev, msg, ...)	do {			\
-	atf_tc_skip(msg, __VA_ARGS__);			\
-	return ev;					\
-} while(/*CONSTCOND*/0)
-#endif
-
 #else
 #define ERRX(ev, msg, ...)	errx(EXIT_FAILURE, msg, __VA_ARGS__)
 #define SKIPX(ev, msg, ...)	errx(EXIT_FAILURE, msg, __VA_ARGS__)
@@ -196,7 +189,7 @@ regtest(const char *hostname, const char
 #endif
 	if (!svc_create(server, PROGNUM, VERSNUM, transp))
 	{
-		SKIPXI(EXIT_FAILURE, "Cannot create server %d", num);
+		SKIPX(EXIT_FAILURE, "Cannot create server %d", num);
 	}
 
 	switch ((pid = fork())) {

From owner-svn-src-projects@freebsd.org  Mon Jan 16 18:44:42 2017
Return-Path: <owner-svn-src-projects@freebsd.org>
Delivered-To: svn-src-projects@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 14B29CB27E4
 for <svn-src-projects@mailman.ysv.freebsd.org>;
 Mon, 16 Jan 2017 18:44:42 +0000 (UTC)
 (envelope-from ngie@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id CA7A21F90;
 Mon, 16 Jan 2017 18:44:41 +0000 (UTC)
 (envelope-from ngie@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0GIietZ095976;
 Mon, 16 Jan 2017 18:44:40 GMT (envelope-from ngie@FreeBSD.org)
Received: (from ngie@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0GIiewh095972;
 Mon, 16 Jan 2017 18:44:40 GMT (envelope-from ngie@FreeBSD.org)
Message-Id: <201701161844.v0GIiewh095972@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: ngie set sender to
 ngie@FreeBSD.org using -f
From: Ngie Cooper <ngie@FreeBSD.org>
Date: Mon, 16 Jan 2017 18:44:40 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject: svn commit: r312302 -
 projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libpthread
X-SVN-Group: projects
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-projects@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the src &quot; projects&quot;
 tree" <svn-src-projects.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-projects>, 
 <mailto:svn-src-projects-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-projects/>
List-Post: <mailto:svn-src-projects@freebsd.org>
List-Help: <mailto:svn-src-projects-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-projects>, 
 <mailto:svn-src-projects-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 16 Jan 2017 18:44:42 -0000

Author: ngie
Date: Mon Jan 16 18:44:40 2017
New Revision: 312302
URL: https://svnweb.freebsd.org/changeset/base/312302

Log:
  Diff reduce with upstream and prep for next set of content pushes

Modified:
  projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libpthread/t_detach.c
  projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libpthread/t_fpu.c
  projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libpthread/t_once.c
  projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libpthread/t_sem.c

Modified: projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libpthread/t_detach.c
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libpthread/t_detach.c	Mon Jan 16 18:36:38 2017	(r312301)
+++ projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libpthread/t_detach.c	Mon Jan 16 18:44:40 2017	(r312302)
@@ -39,10 +39,6 @@ __RCSID("$NetBSD: t_detach.c,v 1.2 2017/
 
 #include "h_common.h"
 
-#ifdef __FreeBSD__
-#include <time.h>
-#endif
-
 static void	*func(void *);
 
 static void *

Modified: projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libpthread/t_fpu.c
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libpthread/t_fpu.c	Mon Jan 16 18:36:38 2017	(r312301)
+++ projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libpthread/t_fpu.c	Mon Jan 16 18:44:40 2017	(r312302)
@@ -60,11 +60,6 @@ __RCSID("$NetBSD: t_fpu.c,v 1.3 2017/01/
 
 #include <atf-c.h>
 
-#ifdef	__FreeBSD__
-#include <errno.h>
-#include <string.h>
-#endif
-
 #include "h_common.h"
 
 #define N_RECURSE 10

Modified: projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libpthread/t_once.c
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libpthread/t_once.c	Mon Jan 16 18:36:38 2017	(r312301)
+++ projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libpthread/t_once.c	Mon Jan 16 18:44:40 2017	(r312302)
@@ -31,6 +31,9 @@ __COPYRIGHT("@(#) Copyright (c) 2008\
  The NetBSD Foundation, inc. All rights reserved.");
 __RCSID("$NetBSD: t_once.c,v 1.1 2010/07/16 15:42:53 jmmv Exp $");
 
+#ifdef __FreeBSD__
+#include <sys/time.h> /* For itimer*, etc. */
+#endif
 #include <pthread.h>
 #include <signal.h>
 #include <stdio.h>
@@ -46,10 +49,6 @@ static int x;
 
 #define NTHREADS 25
 
-#ifdef __FreeBSD__
-#include <sys/time.h>
-#endif
-
 static void
 ofunc(void)
 {

Modified: projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libpthread/t_sem.c
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libpthread/t_sem.c	Mon Jan 16 18:36:38 2017	(r312301)
+++ projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libpthread/t_sem.c	Mon Jan 16 18:44:40 2017	(r312302)
@@ -112,10 +112,6 @@ __RCSID("$NetBSD: t_sem.c,v 1.9 2017/01/
 
 static sem_t sem;
 
-#ifdef __FreeBSD__
-#include <sys/time.h>
-#endif
-
 ATF_TC(named);
 ATF_TC_HEAD(named, tc)
 {

From owner-svn-src-projects@freebsd.org  Mon Jan 16 18:51:28 2017
Return-Path: <owner-svn-src-projects@freebsd.org>
Delivered-To: svn-src-projects@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id B08F4CB2994
 for <svn-src-projects@mailman.ysv.freebsd.org>;
 Mon, 16 Jan 2017 18:51:28 +0000 (UTC)
 (envelope-from ngie@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 67E4D1498;
 Mon, 16 Jan 2017 18:51:28 +0000 (UTC)
 (envelope-from ngie@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0GIpRwb097883;
 Mon, 16 Jan 2017 18:51:27 GMT (envelope-from ngie@FreeBSD.org)
Received: (from ngie@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0GIpRDa097882;
 Mon, 16 Jan 2017 18:51:27 GMT (envelope-from ngie@FreeBSD.org)
Message-Id: <201701161851.v0GIpRDa097882@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: ngie set sender to
 ngie@FreeBSD.org using -f
From: Ngie Cooper <ngie@FreeBSD.org>
Date: Mon, 16 Jan 2017 18:51:27 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject: svn commit: r312303 -
 projects/netbsd-tests-upstream-01-2017/lib/libnetbsd
X-SVN-Group: projects
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-projects@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the src &quot; projects&quot;
 tree" <svn-src-projects.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-projects>, 
 <mailto:svn-src-projects-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-projects/>
List-Post: <mailto:svn-src-projects@freebsd.org>
List-Help: <mailto:svn-src-projects-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-projects>, 
 <mailto:svn-src-projects-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 16 Jan 2017 18:51:28 -0000

Author: ngie
Date: Mon Jan 16 18:51:27 2017
New Revision: 312303
URL: https://svnweb.freebsd.org/changeset/base/312303

Log:
  libnetbsd: add pthread.h compat header
  
  FreeBSD has pthread_np.h, which is used for consolidating all non-POSIX
  functions, but NetBSD doesn't have this concept. Make _np functions work
  seamlessly when ported from NetBSD to FreeBSD

Added:
  projects/netbsd-tests-upstream-01-2017/lib/libnetbsd/pthread.h   (contents, props changed)

Added: projects/netbsd-tests-upstream-01-2017/lib/libnetbsd/pthread.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ projects/netbsd-tests-upstream-01-2017/lib/libnetbsd/pthread.h	Mon Jan 16 18:51:27 2017	(r312303)
@@ -0,0 +1,36 @@
+/*-
+ * Copyright (c) 2017 Dell, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef _LIBNETBSD_PTHREAD_H_
+#define _LIBNETBSD_PTHREAD_H_
+
+#include_next <pthread.h>
+#include <pthread_np.h>
+
+#endif /* _SHA1_H_ */

From owner-svn-src-projects@freebsd.org  Mon Jan 16 18:52:06 2017
Return-Path: <owner-svn-src-projects@freebsd.org>
Delivered-To: svn-src-projects@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id E0D28CB29B6
 for <svn-src-projects@mailman.ysv.freebsd.org>;
 Mon, 16 Jan 2017 18:52:06 +0000 (UTC)
 (envelope-from ngie@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id B0547165E;
 Mon, 16 Jan 2017 18:52:06 +0000 (UTC)
 (envelope-from ngie@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0GIq5sB097953;
 Mon, 16 Jan 2017 18:52:05 GMT (envelope-from ngie@FreeBSD.org)
Received: (from ngie@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0GIq5BP097952;
 Mon, 16 Jan 2017 18:52:05 GMT (envelope-from ngie@FreeBSD.org)
Message-Id: <201701161852.v0GIq5BP097952@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: ngie set sender to
 ngie@FreeBSD.org using -f
From: Ngie Cooper <ngie@FreeBSD.org>
Date: Mon, 16 Jan 2017 18:52:05 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject: svn commit: r312304 -
 projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libpthread
X-SVN-Group: projects
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-projects@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the src &quot; projects&quot;
 tree" <svn-src-projects.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-projects>, 
 <mailto:svn-src-projects-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-projects/>
List-Post: <mailto:svn-src-projects@freebsd.org>
List-Help: <mailto:svn-src-projects-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-projects>, 
 <mailto:svn-src-projects-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 16 Jan 2017 18:52:07 -0000

Author: ngie
Date: Mon Jan 16 18:52:05 2017
New Revision: 312304
URL: https://svnweb.freebsd.org/changeset/base/312304

Log:
  Remove explicit pthread_np.h #include, per change in libnetbsd@r312303

Modified:
  projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libpthread/t_join.c

Modified: projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libpthread/t_join.c
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libpthread/t_join.c	Mon Jan 16 18:51:27 2017	(r312303)
+++ projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libpthread/t_join.c	Mon Jan 16 18:52:05 2017	(r312304)
@@ -37,10 +37,6 @@ __RCSID("$NetBSD: t_join.c,v 1.8 2012/03
 
 #include <atf-c.h>
 
-#ifdef __FreeBSD__
-#include <pthread_np.h>
-#endif
-
 #include "h_common.h"
 
 #ifdef CHECK_STACK_ALIGNMENT

From owner-svn-src-projects@freebsd.org  Mon Jan 16 19:05:03 2017
Return-Path: <owner-svn-src-projects@freebsd.org>
Delivered-To: svn-src-projects@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id E09F2CB20EE
 for <svn-src-projects@mailman.ysv.freebsd.org>;
 Mon, 16 Jan 2017 19:05:03 +0000 (UTC)
 (envelope-from ngie@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 8ABED1235;
 Mon, 16 Jan 2017 19:05:03 +0000 (UTC)
 (envelope-from ngie@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0GJ52gh004828;
 Mon, 16 Jan 2017 19:05:02 GMT (envelope-from ngie@FreeBSD.org)
Received: (from ngie@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0GJ4v9w004768;
 Mon, 16 Jan 2017 19:04:57 GMT (envelope-from ngie@FreeBSD.org)
Message-Id: <201701161904.v0GJ4v9w004768@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: ngie set sender to
 ngie@FreeBSD.org using -f
From: Ngie Cooper <ngie@FreeBSD.org>
Date: Mon, 16 Jan 2017 19:04:57 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject: svn commit: r312306 - in projects/netbsd-tests-upstream-01-2017:
 lib/libc/sys libexec/rtld-elf/amd64 sbin/camcontrol share/man/man4
 share/man/man9 share/skel sys/amd64/vmm sys/arm/arm sys/arm/frees...
X-SVN-Group: projects
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-projects@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the src &quot; projects&quot;
 tree" <svn-src-projects.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-projects>, 
 <mailto:svn-src-projects-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-projects/>
List-Post: <mailto:svn-src-projects@freebsd.org>
List-Help: <mailto:svn-src-projects-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-projects>, 
 <mailto:svn-src-projects-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 16 Jan 2017 19:05:04 -0000

Author: ngie
Date: Mon Jan 16 19:04:57 2017
New Revision: 312306
URL: https://svnweb.freebsd.org/changeset/base/312306

Log:
  MFhead@r312305

Added:
  projects/netbsd-tests-upstream-01-2017/sys/dev/gpio/gpioths.c
     - copied unchanged from r312305, head/sys/dev/gpio/gpioths.c
  projects/netbsd-tests-upstream-01-2017/tools/regression/sockets/udp_pingpong/
     - copied from r312305, head/tools/regression/sockets/udp_pingpong/
Deleted:
  projects/netbsd-tests-upstream-01-2017/sys/arm/include/cpuconf.h
Modified:
  projects/netbsd-tests-upstream-01-2017/lib/libc/sys/getsockopt.2
  projects/netbsd-tests-upstream-01-2017/libexec/rtld-elf/amd64/rtld_machdep.h
  projects/netbsd-tests-upstream-01-2017/libexec/rtld-elf/amd64/rtld_start.S
  projects/netbsd-tests-upstream-01-2017/sbin/camcontrol/camcontrol.8
  projects/netbsd-tests-upstream-01-2017/sbin/camcontrol/camcontrol.c
  projects/netbsd-tests-upstream-01-2017/share/man/man4/alc.4
  projects/netbsd-tests-upstream-01-2017/share/man/man4/ehci.4
  projects/netbsd-tests-upstream-01-2017/share/man/man4/iicbus.4
  projects/netbsd-tests-upstream-01-2017/share/man/man4/scsi.4
  projects/netbsd-tests-upstream-01-2017/share/man/man9/BUS_CONFIG_INTR.9
  projects/netbsd-tests-upstream-01-2017/share/man/man9/DEVICE_ATTACH.9
  projects/netbsd-tests-upstream-01-2017/share/man/man9/DEVICE_IDENTIFY.9
  projects/netbsd-tests-upstream-01-2017/share/man/man9/DRIVER_MODULE.9
  projects/netbsd-tests-upstream-01-2017/share/man/man9/bus_generic_attach.9
  projects/netbsd-tests-upstream-01-2017/share/man/man9/bus_generic_detach.9
  projects/netbsd-tests-upstream-01-2017/share/man/man9/bus_generic_new_pass.9
  projects/netbsd-tests-upstream-01-2017/share/man/man9/bus_generic_print_child.9
  projects/netbsd-tests-upstream-01-2017/share/man/man9/bus_generic_read_ivar.9
  projects/netbsd-tests-upstream-01-2017/share/man/man9/bus_generic_shutdown.9
  projects/netbsd-tests-upstream-01-2017/share/man/man9/bus_space.9
  projects/netbsd-tests-upstream-01-2017/share/man/man9/device.9
  projects/netbsd-tests-upstream-01-2017/share/man/man9/device_add_child.9
  projects/netbsd-tests-upstream-01-2017/share/man/man9/pci.9
  projects/netbsd-tests-upstream-01-2017/share/skel/dot.shrc
  projects/netbsd-tests-upstream-01-2017/sys/amd64/vmm/vmm_host.h
  projects/netbsd-tests-upstream-01-2017/sys/arm/arm/bus_space_asm_generic.S
  projects/netbsd-tests-upstream-01-2017/sys/arm/arm/cpufunc.c
  projects/netbsd-tests-upstream-01-2017/sys/arm/arm/identcpu-v4.c
  projects/netbsd-tests-upstream-01-2017/sys/arm/arm/locore-v4.S
  projects/netbsd-tests-upstream-01-2017/sys/arm/arm/locore-v6.S
  projects/netbsd-tests-upstream-01-2017/sys/arm/arm/ofw_machdep.c
  projects/netbsd-tests-upstream-01-2017/sys/arm/arm/trap-v4.c
  projects/netbsd-tests-upstream-01-2017/sys/arm/freescale/imx/imx6_ccm.c
  projects/netbsd-tests-upstream-01-2017/sys/arm/freescale/imx/imx6_machdep.c
  projects/netbsd-tests-upstream-01-2017/sys/arm/freescale/imx/imx_i2c.c
  projects/netbsd-tests-upstream-01-2017/sys/arm/include/atomic.h
  projects/netbsd-tests-upstream-01-2017/sys/arm/include/cpufunc.h
  projects/netbsd-tests-upstream-01-2017/sys/arm/include/pcpu.h
  projects/netbsd-tests-upstream-01-2017/sys/arm/include/pmap-v4.h
  projects/netbsd-tests-upstream-01-2017/sys/arm/mv/mv_pci.c
  projects/netbsd-tests-upstream-01-2017/sys/boot/efi/loader/main.c
  projects/netbsd-tests-upstream-01-2017/sys/cam/cam_compat.h
  projects/netbsd-tests-upstream-01-2017/sys/cam/cam_iosched.h
  projects/netbsd-tests-upstream-01-2017/sys/cam/cam_xpt.c
  projects/netbsd-tests-upstream-01-2017/sys/cam/cam_xpt_internal.h
  projects/netbsd-tests-upstream-01-2017/sys/cam/ctl/ctl.c
  projects/netbsd-tests-upstream-01-2017/sys/cam/ctl/ctl_backend_block.c
  projects/netbsd-tests-upstream-01-2017/sys/cam/ctl/ctl_backend_ramdisk.c
  projects/netbsd-tests-upstream-01-2017/sys/cam/ctl/ctl_error.c
  projects/netbsd-tests-upstream-01-2017/sys/cam/ctl/ctl_error.h
  projects/netbsd-tests-upstream-01-2017/sys/cam/ctl/ctl_frontend_cam_sim.c
  projects/netbsd-tests-upstream-01-2017/sys/cam/ctl/ctl_frontend_ioctl.c
  projects/netbsd-tests-upstream-01-2017/sys/cam/ctl/ctl_frontend_iscsi.c
  projects/netbsd-tests-upstream-01-2017/sys/cam/ctl/ctl_tpc.c
  projects/netbsd-tests-upstream-01-2017/sys/cam/ctl/ctl_tpc_local.c
  projects/netbsd-tests-upstream-01-2017/sys/cam/ctl/ctl_util.c
  projects/netbsd-tests-upstream-01-2017/sys/cam/ctl/ctl_util.h
  projects/netbsd-tests-upstream-01-2017/sys/cam/ctl/scsi_ctl.c
  projects/netbsd-tests-upstream-01-2017/sys/cam/scsi/scsi_all.c
  projects/netbsd-tests-upstream-01-2017/sys/conf/files
  projects/netbsd-tests-upstream-01-2017/sys/dev/alc/if_alc.c
  projects/netbsd-tests-upstream-01-2017/sys/dev/alc/if_alcreg.h
  projects/netbsd-tests-upstream-01-2017/sys/dev/bhnd/bhnd.h
  projects/netbsd-tests-upstream-01-2017/sys/dev/fdt/simplebus.c
  projects/netbsd-tests-upstream-01-2017/sys/dev/isp/isp.c
  projects/netbsd-tests-upstream-01-2017/sys/dev/mmc/mmcreg.h
  projects/netbsd-tests-upstream-01-2017/sys/dev/mpt/mpt.c
  projects/netbsd-tests-upstream-01-2017/sys/dev/mpt/mpt.h
  projects/netbsd-tests-upstream-01-2017/sys/dev/mpt/mpt_raid.c
  projects/netbsd-tests-upstream-01-2017/sys/dev/pccbb/pccbb_pci.c
  projects/netbsd-tests-upstream-01-2017/sys/dev/pci/hostb_pci.c
  projects/netbsd-tests-upstream-01-2017/sys/dev/pci/pci.c
  projects/netbsd-tests-upstream-01-2017/sys/dev/pci/pci_private.h
  projects/netbsd-tests-upstream-01-2017/sys/dev/pci/pci_subr.c
  projects/netbsd-tests-upstream-01-2017/sys/dev/spibus/spibus.c
  projects/netbsd-tests-upstream-01-2017/sys/dev/usb/usb_hub.c
  projects/netbsd-tests-upstream-01-2017/sys/kern/bus_if.m
  projects/netbsd-tests-upstream-01-2017/sys/kern/kern_event.c
  projects/netbsd-tests-upstream-01-2017/sys/kern/sched_ule.c
  projects/netbsd-tests-upstream-01-2017/sys/kern/subr_bus.c
  projects/netbsd-tests-upstream-01-2017/sys/kern/uipc_socket.c
  projects/netbsd-tests-upstream-01-2017/sys/kern/uipc_usrreq.c
  projects/netbsd-tests-upstream-01-2017/sys/net80211/ieee80211.h
  projects/netbsd-tests-upstream-01-2017/sys/netinet/cc/cc.h
  projects/netbsd-tests-upstream-01-2017/sys/netinet/ip_input.c
  projects/netbsd-tests-upstream-01-2017/sys/netinet6/ip6_input.c
  projects/netbsd-tests-upstream-01-2017/sys/sys/buf_ring.h
  projects/netbsd-tests-upstream-01-2017/sys/sys/bus.h
  projects/netbsd-tests-upstream-01-2017/sys/sys/busdma_bufalloc.h
  projects/netbsd-tests-upstream-01-2017/sys/sys/devmap.h
  projects/netbsd-tests-upstream-01-2017/sys/sys/event.h
  projects/netbsd-tests-upstream-01-2017/sys/sys/eventvar.h
  projects/netbsd-tests-upstream-01-2017/sys/sys/gtaskqueue.h
  projects/netbsd-tests-upstream-01-2017/sys/sys/ksem.h
  projects/netbsd-tests-upstream-01-2017/sys/sys/pipe.h
  projects/netbsd-tests-upstream-01-2017/sys/sys/socket.h
  projects/netbsd-tests-upstream-01-2017/sys/sys/socketvar.h
  projects/netbsd-tests-upstream-01-2017/sys/sys/sockopt.h
  projects/netbsd-tests-upstream-01-2017/sys/sys/taskqueue.h
  projects/netbsd-tests-upstream-01-2017/sys/x86/pci/pci_bus.c
  projects/netbsd-tests-upstream-01-2017/sys/x86/x86/mptable.c
  projects/netbsd-tests-upstream-01-2017/sys/x86/x86/nexus.c
  projects/netbsd-tests-upstream-01-2017/sys/xen/xenbus/xenbusb.c
  projects/netbsd-tests-upstream-01-2017/sys/xen/xenbus/xenbusb.h
  projects/netbsd-tests-upstream-01-2017/tools/regression/sockets/unix_cmsg/Makefile
  projects/netbsd-tests-upstream-01-2017/tools/regression/sockets/unix_cmsg/unix_cmsg.c
  projects/netbsd-tests-upstream-01-2017/usr.sbin/mptutil/mpt_cam.c
Directory Properties:
  projects/netbsd-tests-upstream-01-2017/   (props changed)

Modified: projects/netbsd-tests-upstream-01-2017/lib/libc/sys/getsockopt.2
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/lib/libc/sys/getsockopt.2	Mon Jan 16 19:01:41 2017	(r312305)
+++ projects/netbsd-tests-upstream-01-2017/lib/libc/sys/getsockopt.2	Mon Jan 16 19:04:57 2017	(r312306)
@@ -187,6 +187,7 @@ The following options are recognized in
 .It Dv SO_LISTENQLEN Ta "get complete queue length of the socket (get only)"
 .It Dv SO_LISTENINCQLEN Ta "get incomplete queue length of the socket (get only)"
 .It Dv SO_USER_COOKIE Ta "set the 'so_user_cookie' value for the socket (uint32_t, set only)"
+.It Dv SO_TS_CLOCK Ta "set specific format of timestamp returned by SO_TIMESTAMP"
 .El
 .Pp
 .Dv SO_DEBUG
@@ -435,7 +436,7 @@ for
 .Dv SO_BINTIME .
 The
 .Vt cmsghdr
-fields have the following values for TIMESTAMP:
+fields have the following values for TIMESTAMP by default:
 .Bd -literal
      cmsg_len = CMSG_LEN(sizeof(struct timeval));
      cmsg_level = SOL_SOCKET;
@@ -450,6 +451,24 @@ and for
      cmsg_type = SCM_BINTIME;
 .Ed
 .Pp
+Additional timestamp types are available by following
+.Dv SO_TIMESTAMP
+with
+.Dv SO_TS_CLOCK ,
+which requests specific timestamp format to be returned instead of
+.Dv SCM_TIMESTAMP when
+.Dv SO_TIMESTAMP is enabled.
+The following
+.Dv SO_TS_CLOCK
+values are recognized in
+.Fx :
+.Bl -column SO_TS_CLOCK -offset indent
+.It Dv SO_TS_REALTIME_MICRO Ta "realtime (SCM_TIMESTAMP, struct timeval), default"
+.It Dv SO_TS_BINTIME Ta "realtime (SCM_BINTIME, struct bintime)"
+.It Dv SO_TS_REALTIME Ta "realtime (SCM_REALTIME, struct timespec)"
+.It Dv SO_TS_MONOTONIC Ta "monotonic time (SCM_MONOTONIC, struct timespec)"
+.El
+.Pp
 .Dv SO_ACCEPTCONN ,
 .Dv SO_TYPE ,
 .Dv SO_PROTOCOL

Modified: projects/netbsd-tests-upstream-01-2017/libexec/rtld-elf/amd64/rtld_machdep.h
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/libexec/rtld-elf/amd64/rtld_machdep.h	Mon Jan 16 19:01:41 2017	(r312305)
+++ projects/netbsd-tests-upstream-01-2017/libexec/rtld-elf/amd64/rtld_machdep.h	Mon Jan 16 19:04:57 2017	(r312306)
@@ -35,8 +35,8 @@
 struct Struct_Obj_Entry;
 
 /* Return the address of the .dynamic section in the dynamic linker. */
-#define rtld_dynamic(obj) \
-    ((const Elf_Dyn *)((obj)->relocbase + (Elf_Addr)&_DYNAMIC))
+Elf_Dyn *rtld_dynamic_addr(void);
+#define	rtld_dynamic(obj)	rtld_dynamic_addr()
 
 /* Fixup the jump slot at "where" to transfer control to "target". */
 static inline Elf_Addr

Modified: projects/netbsd-tests-upstream-01-2017/libexec/rtld-elf/amd64/rtld_start.S
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/libexec/rtld-elf/amd64/rtld_start.S	Mon Jan 16 19:01:41 2017	(r312305)
+++ projects/netbsd-tests-upstream-01-2017/libexec/rtld-elf/amd64/rtld_start.S	Mon Jan 16 19:04:57 2017	(r312306)
@@ -156,4 +156,16 @@ _rtld_bind_start:
 	.cfi_endproc
 	.size	_rtld_bind_start, . - _rtld_bind_start
 
+	.align	4
+	.globl	rtld_dynamic_addr
+	.type	rtld_dynamic_addr,@function
+rtld_dynamic_addr:
+	.cfi_startproc
+	.weak _DYNAMIC
+	.hidden _DYNAMIC
+	lea	_DYNAMIC(%rip),%rax
+	ret
+	.cfi_endproc
+	.size	rtld_dynamic_addr, . - rtld_dynamic_addr
+
 	.section .note.GNU-stack,"",%progbits

Modified: projects/netbsd-tests-upstream-01-2017/sbin/camcontrol/camcontrol.8
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/sbin/camcontrol/camcontrol.8	Mon Jan 16 19:01:41 2017	(r312305)
+++ projects/netbsd-tests-upstream-01-2017/sbin/camcontrol/camcontrol.8	Mon Jan 16 19:04:57 2017	(r312306)
@@ -27,7 +27,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd January 6, 2017
+.Dd January 15, 2017
 .Dt CAMCONTROL 8
 .Os
 .Sh NAME
@@ -565,12 +565,12 @@ start bit set and the load/eject bit set
 Send the SCSI Start/Stop Unit (0x1B) command to the given device with the
 start bit cleared and the load/eject bit set.
 .It Ic rescan
-Tell the kernel to scan all busses in the system (with the
+Tell the kernel to scan all buses in the system (with the
 .Ar all
 argument), the given bus (XPT_SCAN_BUS), or bus:target:lun
 (XPT_SCAN_LUN) for new devices or devices that have gone away.
 The user
-may specify a scan of all busses, a single bus, or a lun.
+may specify a scan of all buses, a single bus, or a lun.
 Scanning all luns
 on a target is not supported.
 .It Ic reprobe
@@ -580,7 +580,7 @@ notify the upper layer,
 This includes sending the SCSI READ CAPACITY command and updating
 the disk size visible to the rest of the system.
 .It Ic reset
-Tell the kernel to reset all busses in the system (with the
+Tell the kernel to reset all buses in the system (with the
 .Ar all
 argument) or the given bus (XPT_RESET_BUS) by issuing a SCSI bus
 reset for that bus, or to reset the given bus:target:lun
@@ -2557,7 +2557,7 @@ write reallocation settings, among other
 .Pp
 .Dl camcontrol rescan all
 .Pp
-Rescan all SCSI busses in the system for devices that have been added,
+Rescan all SCSI buses in the system for devices that have been added,
 removed or changed.
 .Pp
 .Dl camcontrol rescan 0

Modified: projects/netbsd-tests-upstream-01-2017/sbin/camcontrol/camcontrol.c
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/sbin/camcontrol/camcontrol.c	Mon Jan 16 19:01:41 2017	(r312305)
+++ projects/netbsd-tests-upstream-01-2017/sbin/camcontrol/camcontrol.c	Mon Jan 16 19:04:57 2017	(r312306)
@@ -3179,8 +3179,8 @@ rescan_or_reset_bus(path_id_t bus, int r
 	/*
 	 * The right way to handle this is to modify the xpt so that it can
 	 * handle a wildcarded bus in a rescan or reset CCB.  At the moment
-	 * that isn't implemented, so instead we enumerate the busses and
-	 * send the rescan or reset to those busses in the case where the
+	 * that isn't implemented, so instead we enumerate the buses and
+	 * send the rescan or reset to those buses in the case where the
 	 * given bus is -1 (wildcard).  We don't send a rescan or reset
 	 * to the xpt bus; sending a rescan to the xpt bus is effectively a
 	 * no-op, sending a rescan to the xpt bus would result in a status of
@@ -4150,7 +4150,7 @@ scsicmd(struct cam_device *device, int a
 	u_int8_t cdb[20];
 	u_int8_t atacmd[12];
 	struct get_hook hook;
-	int c, data_bytes = 0;
+	int c, data_bytes = 0, valid_bytes;
 	int cdb_len = 0;
 	int atacmd_len = 0;
 	int dmacmd = 0;
@@ -4454,16 +4454,20 @@ scsicmd(struct cam_device *device, int a
 		}
 	}
 
+	if (cdb_len)
+		valid_bytes = ccb->csio.dxfer_len - ccb->csio.resid;
+	else
+		valid_bytes = ccb->ataio.dxfer_len - ccb->ataio.resid;
 	if (((ccb->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP)
 	 && (arglist & CAM_ARG_CMD_IN)
-	 && (data_bytes > 0)) {
+	 && (valid_bytes > 0)) {
 		if (fd_data == 0) {
-			buff_decode_visit(data_ptr, data_bytes, datastr,
+			buff_decode_visit(data_ptr, valid_bytes, datastr,
 					  arg_put, NULL);
 			fprintf(stdout, "\n");
 		} else {
 			ssize_t amt_written;
-			int amt_to_write = data_bytes;
+			int amt_to_write = valid_bytes;
 			u_int8_t *buf_ptr = data_ptr;
 
 			for (amt_written = 0; (amt_to_write > 0) &&
@@ -4478,7 +4482,7 @@ scsicmd(struct cam_device *device, int a
 			} else if ((amt_written == 0)
 				&& (amt_to_write > 0)) {
 				warnx("only wrote %u bytes out of %u",
-				      data_bytes - amt_to_write, data_bytes);
+				      valid_bytes - amt_to_write, valid_bytes);
 			}
 		}
 	}
@@ -8950,8 +8954,8 @@ usage(int printlong)
 "load        send a Start Unit command to the device with the load bit set\n"
 "eject       send a Stop Unit command to the device with the eject bit set\n"
 "reprobe     update capacity information of the given device\n"
-"rescan      rescan all busses, the given bus, or bus:target:lun\n"
-"reset       reset all busses, the given bus, or bus:target:lun\n"
+"rescan      rescan all buses, the given bus, or bus:target:lun\n"
+"reset       reset all buses, the given bus, or bus:target:lun\n"
 "defects     read the defect list of the specified device\n"
 "modepage    display or edit (-e) the given mode page\n"
 "cmd         send the given SCSI command, may need -i or -o as well\n"

Modified: projects/netbsd-tests-upstream-01-2017/share/man/man4/alc.4
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/share/man/man4/alc.4	Mon Jan 16 19:01:41 2017	(r312305)
+++ projects/netbsd-tests-upstream-01-2017/share/man/man4/alc.4	Mon Jan 16 19:04:57 2017	(r312306)
@@ -124,6 +124,8 @@ Atheros AR8172 PCI Express Fast Ethernet
 Killer E2200 Gigabit Ethernet controller
 .It
 Killer E2400 Gigabit Ethernet controller
+.It
+Killer E2500 Gigabit Ethernet controller
 .El
 .Sh LOADER TUNABLES
 Tunables can be set at the

Modified: projects/netbsd-tests-upstream-01-2017/share/man/man4/ehci.4
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/share/man/man4/ehci.4	Mon Jan 16 19:01:41 2017	(r312305)
+++ projects/netbsd-tests-upstream-01-2017/share/man/man4/ehci.4	Mon Jan 16 19:04:57 2017	(r312306)
@@ -29,7 +29,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd March 4, 2012
+.Dd January 15, 2017
 .Dt EHCI 4
 .Os
 .Sh NAME
@@ -68,7 +68,7 @@ but can be noticed since
 1.x and
 .Tn USB
 2.0 devices plugged in to the same
-connector appear to connect to different USB busses.
+connector appear to connect to different USB buses.
 .Sh SEE ALSO
 .Xr ohci 4 ,
 .Xr uhci 4 ,

Modified: projects/netbsd-tests-upstream-01-2017/share/man/man4/iicbus.4
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/share/man/man4/iicbus.4	Mon Jan 16 19:01:41 2017	(r312305)
+++ projects/netbsd-tests-upstream-01-2017/share/man/man4/iicbus.4	Mon Jan 16 19:04:57 2017	(r312306)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd November 17, 2014
+.Dd January 15, 2017
 .Dt IICBUS 4
 .Os
 .Sh NAME
@@ -112,11 +112,11 @@ different speed.
 A general purpose I2C bus, such as those found in many embedded systems,
 will often support multiple bus frequencies.
 .Pp
-When a system supports multiple I2C busses, a different frequency can
+When a system supports multiple I2C buses, a different frequency can
 be configured for each bus by number, represented by the
 .Va %d
 in the variable names below.
-Busses can be configured using any combination of device hints,
+Buses can be configured using any combination of device hints,
 Flattened Device Tree (FDT) data, tunables set via
 .Xr loader 8 ,
 or at runtime using

Modified: projects/netbsd-tests-upstream-01-2017/share/man/man4/scsi.4
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/share/man/man4/scsi.4	Mon Jan 16 19:01:41 2017	(r312305)
+++ projects/netbsd-tests-upstream-01-2017/share/man/man4/scsi.4	Mon Jan 16 19:04:57 2017	(r312306)
@@ -24,7 +24,7 @@
 .\" SUCH DAMAGE.
 .\"
 .\" $FreeBSD$
-.Dd June 7, 2012
+.Dd January 15, 2017
 .Dt CAM 4
 .Os
 .Sh NAME
@@ -62,7 +62,7 @@ devices, and to utilize different
 and
 .Tn ATA
 host adapters through host adapter drivers.
-When the system probes busses, it attaches any devices it finds to the
+When the system probes buses, it attaches any devices it finds to the
 appropriate drivers.
 The
 .Xr pass 4
@@ -150,7 +150,7 @@ In that case, the
 will be reset to 100ms.
 .El
 .Pp
-All devices and busses support dynamic allocation so that
+All devices and buses support dynamic allocation so that
 an upper number of devices and controllers does not need to be configured;
 .Cd "device da"
 will suffice for any number of disk drivers.
@@ -297,7 +297,7 @@ see printfs for multiple debugging level
 This allows to set the various debugging flags from a kernel config file.
 .It Dv CAM_DEBUG_BUS
 Specify a bus to debug.
-To debug all busses, set this to -1.
+To debug all buses, set this to -1.
 .It Dv CAM_DEBUG_TARGET
 Specify a target to debug.
 To debug all targets, set this to -1.

Modified: projects/netbsd-tests-upstream-01-2017/share/man/man9/BUS_CONFIG_INTR.9
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/share/man/man9/BUS_CONFIG_INTR.9	Mon Jan 16 19:01:41 2017	(r312305)
+++ projects/netbsd-tests-upstream-01-2017/share/man/man9/BUS_CONFIG_INTR.9	Mon Jan 16 19:04:57 2017	(r312306)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd January 6, 2005
+.Dd January 15, 2017
 .Dt BUS_CONFIG_INTR 9
 .Os
 .\"
@@ -45,7 +45,7 @@
 The
 .Fn BUS_CONFIG_INTR
 method allows bus or device drivers to provide interrupt polarity and trigger
-mode to parent busses.
+mode to parent buses.
 This typically bubbles all the way up to the root bus (e.g.\& nexus) where the
 necessary actions are taken to actually program the hardware.
 Since the

Modified: projects/netbsd-tests-upstream-01-2017/share/man/man9/DEVICE_ATTACH.9
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/share/man/man9/DEVICE_ATTACH.9	Mon Jan 16 19:01:41 2017	(r312305)
+++ projects/netbsd-tests-upstream-01-2017/share/man/man9/DEVICE_ATTACH.9	Mon Jan 16 19:04:57 2017	(r312306)
@@ -28,7 +28,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd January 6, 2005
+.Dd January 15, 2017
 .Dt DEVICE_ATTACH 9
 .Os
 .Sh NAME
@@ -51,7 +51,7 @@ system resources (such as
 .Xr devfs 5
 entries).
 .Pp
-Devices which implement busses should use this method to probe for
+Devices which implement buses should use this method to probe for
 the existence of devices attached to the bus and add them as
 children.
 If this is combined with the use of

Modified: projects/netbsd-tests-upstream-01-2017/share/man/man9/DEVICE_IDENTIFY.9
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/share/man/man9/DEVICE_IDENTIFY.9	Mon Jan 16 19:01:41 2017	(r312305)
+++ projects/netbsd-tests-upstream-01-2017/share/man/man9/DEVICE_IDENTIFY.9	Mon Jan 16 19:04:57 2017	(r312306)
@@ -28,7 +28,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd May 13, 2004
+.Dd January 15, 2017
 .Dt DEVICE_IDENTIFY 9
 .Os
 .Sh NAME
@@ -40,7 +40,7 @@
 .Ft void
 .Fn DEVICE_IDENTIFY "driver_t *driver" "device_t parent"
 .Sh DESCRIPTION
-The identify function for a device is only needed for devices on busses
+The identify function for a device is only needed for devices on buses
 that cannot identify their children independently, e.g.\& the ISA bus.
 It is used to recognize the device (usually done by accessing non-ambiguous
 registers in the hardware) and to tell the kernel about it and thus

Modified: projects/netbsd-tests-upstream-01-2017/share/man/man9/DRIVER_MODULE.9
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/share/man/man9/DRIVER_MODULE.9	Mon Jan 16 19:01:41 2017	(r312305)
+++ projects/netbsd-tests-upstream-01-2017/share/man/man9/DRIVER_MODULE.9	Mon Jan 16 19:04:57 2017	(r312306)
@@ -28,7 +28,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd August 21, 2012
+.Dd January 15, 2017
 .Dt DRIVER_MODULE 9
 .Os
 .Sh NAME
@@ -69,9 +69,9 @@ or
 The identifier used in
 .Fn DRIVER_MODULE
 can be different from the driver name.
-Also, the same driver identifier can exist on different busses,
+Also, the same driver identifier can exist on different buses,
 which is a pretty clean way of making front ends for different cards
-using the same driver on the same or different busses.
+using the same driver on the same or different buses.
 For example, the following is allowed:
 .Pp
 .Fn DRIVER_MODULE foo isa foo_driver foo_devclass NULL NULL ;

Modified: projects/netbsd-tests-upstream-01-2017/share/man/man9/bus_generic_attach.9
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/share/man/man9/bus_generic_attach.9	Mon Jan 16 19:01:41 2017	(r312305)
+++ projects/netbsd-tests-upstream-01-2017/share/man/man9/bus_generic_attach.9	Mon Jan 16 19:04:57 2017	(r312306)
@@ -28,14 +28,14 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd June 16, 1998
+.Dd January 15, 2017
 .Dt BUS_GENERIC_ATTACH 9
 .Os
 .Sh NAME
 .Nm bus_generic_attach
 .Nd generic implementation of
 .Dv DEVICE_ATTACH
-for busses
+for buses
 .Sh SYNOPSIS
 .In sys/param.h
 .In sys/bus.h

Modified: projects/netbsd-tests-upstream-01-2017/share/man/man9/bus_generic_detach.9
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/share/man/man9/bus_generic_detach.9	Mon Jan 16 19:01:41 2017	(r312305)
+++ projects/netbsd-tests-upstream-01-2017/share/man/man9/bus_generic_detach.9	Mon Jan 16 19:04:57 2017	(r312306)
@@ -28,14 +28,14 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd June 16, 1998
+.Dd January 15, 2017
 .Dt BUS_GENERIC_DETACH 9
 .Os
 .Sh NAME
 .Nm bus_generic_detach
 .Nd generic implementation of
 .Dv DEVICE_DETACH
-for busses
+for buses
 .Sh SYNOPSIS
 .In sys/param.h
 .In sys/bus.h

Modified: projects/netbsd-tests-upstream-01-2017/share/man/man9/bus_generic_new_pass.9
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/share/man/man9/bus_generic_new_pass.9	Mon Jan 16 19:01:41 2017	(r312305)
+++ projects/netbsd-tests-upstream-01-2017/share/man/man9/bus_generic_new_pass.9	Mon Jan 16 19:04:57 2017	(r312306)
@@ -27,7 +27,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd June 8, 2009
+.Dd January 15, 2017
 .Dt BUS_GENERIC_NEW_PASS 9
 .Os
 .Sh NAME
@@ -47,7 +47,7 @@ It first invokes the
 method for any drivers whose pass level is equal to the new pass level.
 Then, for each attached child device it calls
 .Xr BUS_NEW_PASS 9
-to rescan child busses,
+to rescan child buses,
 and for each unattached child device it calls
 .Xr device_probe_and_attach 9 .
 .Sh SEE ALSO

Modified: projects/netbsd-tests-upstream-01-2017/share/man/man9/bus_generic_print_child.9
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/share/man/man9/bus_generic_print_child.9	Mon Jan 16 19:01:41 2017	(r312305)
+++ projects/netbsd-tests-upstream-01-2017/share/man/man9/bus_generic_print_child.9	Mon Jan 16 19:04:57 2017	(r312306)
@@ -28,14 +28,14 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd June 16, 1998
+.Dd January 15, 2017
 .Dt BUS_GENERIC_PRINT_CHILD 9
 .Os
 .Sh NAME
 .Nm bus_generic_print_child
 .Nd generic implementation of
 .Dv DEVICE_PRINT_CHILD
-for busses
+for buses
 .Sh SYNOPSIS
 .In sys/param.h
 .In sys/bus.h

Modified: projects/netbsd-tests-upstream-01-2017/share/man/man9/bus_generic_read_ivar.9
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/share/man/man9/bus_generic_read_ivar.9	Mon Jan 16 19:01:41 2017	(r312305)
+++ projects/netbsd-tests-upstream-01-2017/share/man/man9/bus_generic_read_ivar.9	Mon Jan 16 19:04:57 2017	(r312306)
@@ -28,7 +28,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd June 16, 1998
+.Dd January 15, 2017
 .Dt BUS_GENERIC_READ_IVAR 9
 .Os
 .Sh NAME
@@ -38,7 +38,7 @@
 .Dv BUS_READ_IVAR
 and
 .Dv BUS_WRITE_IVAR
-for busses
+for buses
 .Sh SYNOPSIS
 .In sys/param.h
 .In sys/bus.h

Modified: projects/netbsd-tests-upstream-01-2017/share/man/man9/bus_generic_shutdown.9
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/share/man/man9/bus_generic_shutdown.9	Mon Jan 16 19:01:41 2017	(r312305)
+++ projects/netbsd-tests-upstream-01-2017/share/man/man9/bus_generic_shutdown.9	Mon Jan 16 19:04:57 2017	(r312306)
@@ -28,14 +28,14 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd June 16, 1998
+.Dd January 15, 2017
 .Dt BUS_GENERIC_SHUTDOWN 9
 .Os
 .Sh NAME
 .Nm bus_generic_shutdown
 .Nd generic implementation of
 .Dv DEVICE_SHUTDOWN
-for busses
+for buses
 .Sh SYNOPSIS
 .In sys/param.h
 .In sys/bus.h

Modified: projects/netbsd-tests-upstream-01-2017/share/man/man9/bus_space.9
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/share/man/man9/bus_space.9	Mon Jan 16 19:01:41 2017	(r312305)
+++ projects/netbsd-tests-upstream-01-2017/share/man/man9/bus_space.9	Mon Jan 16 19:04:57 2017	(r312306)
@@ -51,7 +51,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd June 13, 2005
+.Dd January 15, 2017
 .Dt BUS_SPACE 9
 .Os
 .Sh NAME
@@ -601,7 +601,7 @@ of devices on different system architect
 object file to manipulate a set of devices on multiple bus types on a
 single architecture.
 .Pp
-Not all busses have to implement all functions described in this
+Not all buses have to implement all functions described in this
 document, though that is encouraged if the operations are logically
 supported by the bus.
 Unimplemented functions should cause
@@ -625,7 +625,7 @@ machine-dependent code.
 A given machine may have several different types
 of bus space (e.g.\& memory space and I/O space), and thus may provide
 multiple different bus space tags.
-Individual busses or devices on a machine may use more than one bus space
+Individual buses or devices on a machine may use more than one bus space
 tag.
 For instance, ISA devices are
 given an ISA memory space tag and an ISA I/O space tag.
@@ -639,7 +639,7 @@ The
 bus address describes the start of the range in bus space.
 The bus
 size describes the size of the range in bytes.
-Busses which are not byte
+Buses which are not byte
 addressable may require use of bus space ranges with appropriately
 aligned addresses and properly rounded sizes.
 .Pp
@@ -656,7 +656,7 @@ argument, at least one handle argument, 
 The bus space tag specifies the space, each handle specifies a region in
 the space, and each offset specifies the offset into the region of the
 actual location(s) to be accessed.
-Offsets are given in bytes, though busses
+Offsets are given in bytes, though buses
 may impose alignment constraints.
 The offset used to access data
 relative to a given handle must be such that all of the data being
@@ -1049,7 +1049,7 @@ The
 and
 .Fn bus_space_write_N
 families of functions provide
-the ability to read and write 1, 2, 4, and 8 byte data items on busses
+the ability to read and write 1, 2, 4, and 8 byte data items on buses
 which support those access sizes.
 .Ss Fn bus_space_read_1 space handle offset
 .Ss Fn bus_space_read_2 space handle offset

Modified: projects/netbsd-tests-upstream-01-2017/share/man/man9/device.9
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/share/man/man9/device.9	Mon Jan 16 19:01:41 2017	(r312305)
+++ projects/netbsd-tests-upstream-01-2017/share/man/man9/device.9	Mon Jan 16 19:04:57 2017	(r312306)
@@ -28,7 +28,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd June 16, 1998
+.Dd January 15, 2017
 .Dt DEVICE 9
 .Os
 .Sh NAME
@@ -44,7 +44,7 @@ The system defines one device,
 .Va root_bus
 and all other devices are created dynamically during
 autoconfiguration.
-Normally devices representing top-level busses in
+Normally devices representing top-level buses in
 the system (ISA, PCI etc.) will be attached directly to
 .Va root_bus
 and other devices will be added as children of their relevant bus.

Modified: projects/netbsd-tests-upstream-01-2017/share/man/man9/device_add_child.9
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/share/man/man9/device_add_child.9	Mon Jan 16 19:01:41 2017	(r312305)
+++ projects/netbsd-tests-upstream-01-2017/share/man/man9/device_add_child.9	Mon Jan 16 19:04:57 2017	(r312306)
@@ -28,7 +28,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd October 28, 2015
+.Dd January 15, 2017
 .Dt DEVICE_ADD_CHILD 9
 .Os
 .Sh NAME
@@ -63,10 +63,10 @@ If no name is given then all drivers for
 In any event, only the name of the device is stored so that one may
 safely unload/load a driver bound to that name.
 .Pp
-This allows busses which can uniquely identify device instances (such
+This allows buses which can uniquely identify device instances (such
 as PCI) to allow each driver to check each device instance for a
 match.
-For busses which rely on supplied probe hints where only one
+For buses which rely on supplied probe hints where only one
 driver can have a chance of probing the device, the driver name should
 be specified as the device name.
 .Pp

Modified: projects/netbsd-tests-upstream-01-2017/share/man/man9/pci.9
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/share/man/man9/pci.9	Mon Jan 16 19:01:41 2017	(r312305)
+++ projects/netbsd-tests-upstream-01-2017/share/man/man9/pci.9	Mon Jan 16 19:04:57 2017	(r312306)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd September 6, 2016
+.Dd January 15, 2017
 .Dt PCI 9
 .Os
 .Sh NAME
@@ -583,14 +583,14 @@ full functionality to the user.
 .It Dv PCI_POWERSTATE_D1
 Class-specific low-power state in which device context may or
 may not be lost.
-Busses in this state cannot do anything to the bus, to
+Buses in this state cannot do anything to the bus, to
 force devices to lose context.
 .It Dv PCI_POWERSTATE_D2
 Class-specific low-power state in which device context may or
 may not be lost.
 Attains greater power savings than
 .Dv PCI_POWERSTATE_D1 .
-Busses in this state can cause devices to lose some context.
+Buses in this state can cause devices to lose some context.
 Devices
 .Em must
 be prepared for the bus to be in this state or higher.

Modified: projects/netbsd-tests-upstream-01-2017/share/skel/dot.shrc
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/share/skel/dot.shrc	Mon Jan 16 19:01:41 2017	(r312305)
+++ projects/netbsd-tests-upstream-01-2017/share/skel/dot.shrc	Mon Jan 16 19:04:57 2017	(r312306)
@@ -13,10 +13,6 @@
 #
 # umask	022
 
-# Enable the builtin emacs(1) command line editor in sh(1),
-# e.g. C-a -> beginning-of-line.
-set -o emacs
-
 # Uncomment this and comment the above to enable the builtin vi(1) command
 # line editor in sh(1), e.g. ESC to go into visual mode.
 # set -o vi

Modified: projects/netbsd-tests-upstream-01-2017/sys/amd64/vmm/vmm_host.h
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/sys/amd64/vmm/vmm_host.h	Mon Jan 16 19:01:41 2017	(r312305)
+++ projects/netbsd-tests-upstream-01-2017/sys/amd64/vmm/vmm_host.h	Mon Jan 16 19:04:57 2017	(r312306)
@@ -30,7 +30,7 @@
 #define	_VMM_HOST_H_
 
 #ifndef	_KERNEL
-#error "no user-servicable parts inside"
+#error "no user-serviceable parts inside"
 #endif
 
 struct xsave_limits {

Modified: projects/netbsd-tests-upstream-01-2017/sys/arm/arm/bus_space_asm_generic.S
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/sys/arm/arm/bus_space_asm_generic.S	Mon Jan 16 19:01:41 2017	(r312305)
+++ projects/netbsd-tests-upstream-01-2017/sys/arm/arm/bus_space_asm_generic.S	Mon Jan 16 19:04:57 2017	(r312306)
@@ -36,7 +36,6 @@
  */
 
 #include <machine/asm.h>
-#include <machine/cpuconf.h>
 __FBSDID("$FreeBSD$");
 
 /*

Modified: projects/netbsd-tests-upstream-01-2017/sys/arm/arm/cpufunc.c
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/sys/arm/arm/cpufunc.c	Mon Jan 16 19:01:41 2017	(r312305)
+++ projects/netbsd-tests-upstream-01-2017/sys/arm/arm/cpufunc.c	Mon Jan 16 19:04:57 2017	(r312306)
@@ -57,7 +57,6 @@ __FBSDID("$FreeBSD$");
 #include <vm/pmap.h>
 #include <vm/uma.h>
 
-#include <machine/cpuconf.h>
 #include <machine/cpufunc.h>
 
 #if defined(CPU_XSCALE_81342)

Modified: projects/netbsd-tests-upstream-01-2017/sys/arm/arm/identcpu-v4.c
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/sys/arm/arm/identcpu-v4.c	Mon Jan 16 19:01:41 2017	(r312305)
+++ projects/netbsd-tests-upstream-01-2017/sys/arm/arm/identcpu-v4.c	Mon Jan 16 19:04:57 2017	(r312306)
@@ -51,7 +51,6 @@ __FBSDID("$FreeBSD$");
 #include <machine/cpu.h>
 #include <machine/endian.h>
 
-#include <machine/cpuconf.h>
 #include <machine/md_var.h>
 
 char machine[] = "arm";

Modified: projects/netbsd-tests-upstream-01-2017/sys/arm/arm/locore-v4.S
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/sys/arm/arm/locore-v4.S	Mon Jan 16 19:01:41 2017	(r312305)
+++ projects/netbsd-tests-upstream-01-2017/sys/arm/arm/locore-v4.S	Mon Jan 16 19:04:57 2017	(r312306)
@@ -37,7 +37,6 @@
 #include <sys/syscall.h>
 #include <machine/asm.h>
 #include <machine/armreg.h>
-#include <machine/cpuconf.h>
 #include <machine/pte-v4.h>
 
 __FBSDID("$FreeBSD$");

Modified: projects/netbsd-tests-upstream-01-2017/sys/arm/arm/locore-v6.S
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/sys/arm/arm/locore-v6.S	Mon Jan 16 19:01:41 2017	(r312305)
+++ projects/netbsd-tests-upstream-01-2017/sys/arm/arm/locore-v6.S	Mon Jan 16 19:04:57 2017	(r312306)
@@ -34,7 +34,6 @@
 #include <machine/asmacros.h>
 #include <machine/armreg.h>
 #include <machine/sysreg.h>
-#include <machine/cpuconf.h>
 #include <machine/pte-v6.h>
 
 __FBSDID("$FreeBSD$");

Modified: projects/netbsd-tests-upstream-01-2017/sys/arm/arm/ofw_machdep.c
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/sys/arm/arm/ofw_machdep.c	Mon Jan 16 19:01:41 2017	(r312305)
+++ projects/netbsd-tests-upstream-01-2017/sys/arm/arm/ofw_machdep.c	Mon Jan 16 19:04:57 2017	(r312306)
@@ -50,7 +50,7 @@ OF_decode_addr(phandle_t dev, int regno,
 		return (res);
 
 	/*
-	 * Nothing special to do for PCI busses right now.
+	 * Nothing special to do for PCI buses right now.
 	 * This may need to be handled per-platform when it does come up.
 	 */
 #ifdef notyet

Modified: projects/netbsd-tests-upstream-01-2017/sys/arm/arm/trap-v4.c
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/sys/arm/arm/trap-v4.c	Mon Jan 16 19:01:41 2017	(r312305)
+++ projects/netbsd-tests-upstream-01-2017/sys/arm/arm/trap-v4.c	Mon Jan 16 19:04:57 2017	(r312306)
@@ -139,11 +139,7 @@ static const struct data_abort data_abor
 	{dab_align,	"Alignment Fault 3"},
 	{dab_buserr,	"External Linefetch Abort (S)"},
 	{NULL,		"Translation Fault (S)"},
-#if (ARM_MMU_V6 + ARM_MMU_V7) != 0
-	{NULL,		"Translation Flag Fault"},
-#else
 	{dab_buserr,	"External Linefetch Abort (P)"},
-#endif
 	{NULL,		"Translation Fault (P)"},
 	{dab_buserr,	"External Non-Linefetch Abort (S)"},
 	{NULL,		"Domain Fault (S)"},

Modified: projects/netbsd-tests-upstream-01-2017/sys/arm/freescale/imx/imx6_ccm.c
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/sys/arm/freescale/imx/imx6_ccm.c	Mon Jan 16 19:01:41 2017	(r312305)
+++ projects/netbsd-tests-upstream-01-2017/sys/arm/freescale/imx/imx6_ccm.c	Mon Jan 16 19:04:57 2017	(r312306)
@@ -90,7 +90,7 @@ ccm_init_gates(struct ccm_softc *sc)
 {
 	uint32_t reg;
 
- 	/* ahpbdma, aipstz 1 & 2 busses */
+ 	/* ahpbdma, aipstz 1 & 2 buses */
 	reg = CCGR0_AIPS_TZ1 | CCGR0_AIPS_TZ2 | CCGR0_ABPHDMA;
 	WR4(sc, CCM_CCGR0, reg);
 

Modified: projects/netbsd-tests-upstream-01-2017/sys/arm/freescale/imx/imx6_machdep.c
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/sys/arm/freescale/imx/imx6_machdep.c	Mon Jan 16 19:01:41 2017	(r312305)
+++ projects/netbsd-tests-upstream-01-2017/sys/arm/freescale/imx/imx6_machdep.c	Mon Jan 16 19:04:57 2017	(r312306)
@@ -117,7 +117,7 @@ fdt_pic_decode_t fdt_pic_table[] = {
  *  - GIC node exists and is its own interrupt parent.
  *
  * This applies to all models of imx6.  Luckily all of them have the devices
- * involved at the same addresses on the same busses, so we don't need any
+ * involved at the same addresses on the same buses, so we don't need any
  * per-soc logic.  We handle this at platform attach time rather than via the
  * fdt_fixup_table, because the latter requires matching on the FDT "model"
  * property, and this applies to all boards including those not yet invented.

Modified: projects/netbsd-tests-upstream-01-2017/sys/arm/freescale/imx/imx_i2c.c
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/sys/arm/freescale/imx/imx_i2c.c	Mon Jan 16 19:01:41 2017	(r312305)
+++ projects/netbsd-tests-upstream-01-2017/sys/arm/freescale/imx/imx_i2c.c	Mon Jan 16 19:04:57 2017	(r312306)
@@ -35,7 +35,7 @@
  * Note that the hardware is capable of running as both a master and a slave.
  * This driver currently implements only master-mode operations.
  *
- * This driver supports multi-master i2c busses, by detecting bus arbitration
+ * This driver supports multi-master i2c buses, by detecting bus arbitration
  * loss and returning IIC_EBUSBSY status.  Notably, it does not do any kind of
  * retries if some other master jumps onto the bus and interrupts one of our
  * transfer cycles resulting in arbitration loss in mid-transfer.  The caller

Modified: projects/netbsd-tests-upstream-01-2017/sys/arm/include/atomic.h
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/sys/arm/include/atomic.h	Mon Jan 16 19:01:41 2017	(r312305)
+++ projects/netbsd-tests-upstream-01-2017/sys/arm/include/atomic.h	Mon Jan 16 19:04:57 2017	(r312306)
@@ -44,8 +44,6 @@
 
 #ifndef _KERNEL
 #include <machine/sysarch.h>
-#else
-#include <machine/cpuconf.h>
 #endif
 
 #if __ARM_ARCH >= 6

Modified: projects/netbsd-tests-upstream-01-2017/sys/arm/include/cpufunc.h
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/sys/arm/include/cpufunc.h	Mon Jan 16 19:01:41 2017	(r312305)
+++ projects/netbsd-tests-upstream-01-2017/sys/arm/include/cpufunc.h	Mon Jan 16 19:04:57 2017	(r312306)
@@ -48,7 +48,6 @@
 
 #include <sys/types.h>
 #include <machine/armreg.h>
-#include <machine/cpuconf.h>
 
 static __inline void
 breakpoint(void)

Modified: projects/netbsd-tests-upstream-01-2017/sys/arm/include/pcpu.h
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/sys/arm/include/pcpu.h	Mon Jan 16 19:01:41 2017	(r312305)
+++ projects/netbsd-tests-upstream-01-2017/sys/arm/include/pcpu.h	Mon Jan 16 19:04:57 2017	(r312306)
@@ -32,8 +32,6 @@
 
 #ifdef _KERNEL
 
-#include <machine/cpuconf.h>
-
 #define	ALT_STACK_SIZE	128
 
 struct vmspace;

Modified: projects/netbsd-tests-upstream-01-2017/sys/arm/include/pmap-v4.h
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/sys/arm/include/pmap-v4.h	Mon Jan 16 19:01:41 2017	(r312305)
+++ projects/netbsd-tests-upstream-01-2017/sys/arm/include/pmap-v4.h	Mon Jan 16 19:04:57 2017	(r312306)
@@ -51,7 +51,30 @@
 #define _MACHINE_PMAP_V4_H_
 
 #include <machine/pte-v4.h>
-#include <machine/cpuconf.h>
+
+/*
+ * Define the MMU types we support based on the cpu types.  While the code has
+ * some theoretical support for multiple MMU types in a single kernel, there are
+ * no actual working configurations that use that feature.
+ */
+#if (defined(CPU_ARM9) || defined(CPU_ARM9E) ||	defined(CPU_FA526))
+#define	ARM_MMU_GENERIC		1
+#else
+#define	ARM_MMU_GENERIC		0
+#endif
+
+#if (defined(CPU_XSCALE_PXA2X0) || defined(CPU_XSCALE_IXP425) ||	\
+     defined(CPU_XSCALE_81342))
+#define	ARM_MMU_XSCALE		1
+#else
+#define	ARM_MMU_XSCALE		0
+#endif
+
+#define	ARM_NMMUS		(ARM_MMU_GENERIC + ARM_MMU_XSCALE)
+#if ARM_NMMUS == 0 && !defined(KLD_MODULE) && defined(_KERNEL)
+#error ARM_NMMUS is 0
+#endif
+
 /*
  * Pte related macros
  */

Modified: projects/netbsd-tests-upstream-01-2017/sys/arm/mv/mv_pci.c
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/sys/arm/mv/mv_pci.c	Mon Jan 16 19:01:41 2017	(r312305)
+++ projects/netbsd-tests-upstream-01-2017/sys/arm/mv/mv_pci.c	Mon Jan 16 19:04:57 2017	(r312306)
@@ -147,7 +147,7 @@ mv_pci_ranges_decode(phandle_t node, str
 	/*
 	 * Initialize the ranges so that we don't have to worry about
 	 * having them all defined in the FDT. In particular, it is
-	 * perfectly fine not to want I/O space on PCI busses.
+	 * perfectly fine not to want I/O space on PCI buses.
 	 */
 	bzero(io_space, sizeof(*io_space));
 	bzero(mem_space, sizeof(*mem_space));

Modified: projects/netbsd-tests-upstream-01-2017/sys/boot/efi/loader/main.c
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/sys/boot/efi/loader/main.c	Mon Jan 16 19:01:41 2017	(r312305)
+++ projects/netbsd-tests-upstream-01-2017/sys/boot/efi/loader/main.c	Mon Jan 16 19:04:57 2017	(r312306)
@@ -219,20 +219,19 @@ find_currdev(EFI_LOADED_IMAGE *img, stru
 		if (h == NULL)
 			break;
 
-		if (efi_handle_lookup(h, dev, unit, extra) == 0) {
-			if (copy != NULL)
-				free(copy);
+		free(copy);
+		copy = NULL;
+
+		if (efi_handle_lookup(h, dev, unit, extra) == 0)
 			return (0);
-		}
 
-		if (copy != NULL)
-			free(copy);
 		devpath = efi_lookup_devpath(h);
 		if (devpath != NULL) {
 			copy = efi_devpath_trim(devpath);
 			devpath = copy;
 		}
 	}
+	free(copy);
 
 	/* Try to fallback on first device */
 	if (devsw[0] != NULL) {

Modified: projects/netbsd-tests-upstream-01-2017/sys/cam/cam_compat.h
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/sys/cam/cam_compat.h	Mon Jan 16 19:01:41 2017	(r312305)
+++ projects/netbsd-tests-upstream-01-2017/sys/cam/cam_compat.h	Mon Jan 16 19:04:57 2017	(r312306)
@@ -31,7 +31,7 @@
 #ifndef _CAM_CAM_COMPAT_H
 #define _CAM_CAM_COMPAT_H
 
-/* No user-servicable parts in here. */
+/* No user-serviceable parts in here. */
 #ifdef _KERNEL
 
 int cam_compat_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flag,

Modified: projects/netbsd-tests-upstream-01-2017/sys/cam/cam_iosched.h
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/sys/cam/cam_iosched.h	Mon Jan 16 19:01:41 2017	(r312305)
+++ projects/netbsd-tests-upstream-01-2017/sys/cam/cam_iosched.h	Mon Jan 16 19:04:57 2017	(r312306)
@@ -31,7 +31,7 @@
 #ifndef _CAM_CAM_IOSCHED_H
 #define _CAM_CAM_IOSCHED_H
 
-/* No user-servicable parts in here. */
+/* No user-serviceable parts in here. */
 #ifdef _KERNEL
 
 /* Forward declare all structs to keep interface thin */

Modified: projects/netbsd-tests-upstream-01-2017/sys/cam/cam_xpt.c
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/sys/cam/cam_xpt.c	Mon Jan 16 19:01:41 2017	(r312305)
+++ projects/netbsd-tests-upstream-01-2017/sys/cam/cam_xpt.c	Mon Jan 16 19:04:57 2017	(r312306)
@@ -106,7 +106,12 @@ struct xpt_softc {
 	int buses_to_config;
 	int buses_config_done;
 
-	/* Registered busses */
+	/*
+	 * Registered buses
+	 *
+	 * N.B., "busses" is an archaic spelling of "buses".  In new code
+	 * "buses" is preferred.
+	 */
 	TAILQ_HEAD(,cam_eb)	xpt_busses;
 	u_int			bus_generation;
 
@@ -892,7 +897,7 @@ xpt_init(void *dummy)
 	/*
 	 * The xpt layer is, itself, the equivalent of a SIM.
 	 * Allow 16 ccbs in the ccb pool for it.  This should
-	 * give decent parallelism when we probe busses and
+	 * give decent parallelism when we probe buses and
 	 * perform other XPT functions.
 	 */
 	devq = cam_simq_alloc(16);
@@ -1627,7 +1632,7 @@ xptedtbusfunc(struct cam_eb *bus, void *
 	}
 
 	/*
-	 * If the user is only interested in busses, there's no
+	 * If the user is only interested in buses, there's no
 	 * reason to descend to the next level in the tree.
 	 */
 	if ((retval & DM_RET_ACTION_MASK) == DM_RET_STOP)
@@ -2070,7 +2075,7 @@ xptperiphlistmatch(struct ccb_dev_match 
 
 	/*
 	 * At this point in the edt traversal function, we check the bus
-	 * list generation to make sure that no busses have been added or
+	 * list generation to make sure that no buses have been added or
 	 * removed since the user last sent a XPT_DEV_MATCH ccb through.
 	 * For the peripheral driver list traversal function, however, we
 	 * don't have to worry about new peripheral driver types coming or
@@ -2816,7 +2821,7 @@ call_sim:
 		/*
 		 * There are two ways of getting at information in the EDT.
 		 * The first way is via the primary EDT tree.  It starts
-		 * with a list of busses, then a list of targets on a bus,
+		 * with a list of buses, then a list of targets on a bus,
 		 * then devices/luns on a target, and then peripherals on a
 		 * device/lun.  The "other" way is by the peripheral driver
 		 * lists.  The peripheral driver lists are organized by
@@ -3356,7 +3361,7 @@ xpt_run_devq(struct cam_devq *devq)
 
 		/*
 		 * Device queues can be shared among multiple SIM instances
-		 * that reside on different busses.  Use the SIM from the
+		 * that reside on different buses.  Use the SIM from the
 		 * queued device, rather than the one from the calling bus.
 		 */
 		sim = device->sim;
@@ -3865,7 +3870,7 @@ CAM_XPT_XPORT(xport_default);
  * A sim structure, listing the SIM entry points and instance
  * identification info is passed to xpt_bus_register to hook the SIM
  * into the CAM framework.  xpt_bus_register creates a cam_eb entry
- * for this new bus and places it in the array of busses and assigns
+ * for this new bus and places it in the array of buses and assigns
  * it a path_id.  The path_id may be influenced by "hard wiring"
  * information specified by the user.  Once interrupt services are
  * available, the bus will be probed.
@@ -5040,7 +5045,7 @@ xpt_release_boot(void)
 
 		xsoftc.buses_config_done = 1;
 		xpt_unlock_buses();
-		/* Call manually because we don't have any busses */
+		/* Call manually because we don't have any buses */
 		task = malloc(sizeof(struct xpt_task), M_CAMXPT, M_NOWAIT);
 		if (task != NULL) {
 			TASK_INIT(&task->task, 0, xpt_finishconfig_task, task);
@@ -5138,7 +5143,7 @@ xpt_register_async(int event, ac_callbac
 	    (csa.event_enable & AC_PATH_REGISTERED)) {
 		/*
 		 * Get this peripheral up to date with all
-		 * the currently existing busses.
+		 * the currently existing buses.
 		 */
 		xpt_for_all_busses(xptsetasyncbusfunc, &csa);
 	}

Modified: projects/netbsd-tests-upstream-01-2017/sys/cam/cam_xpt_internal.h
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/sys/cam/cam_xpt_internal.h	Mon Jan 16 19:01:41 2017	(r312305)
+++ projects/netbsd-tests-upstream-01-2017/sys/cam/cam_xpt_internal.h	Mon Jan 16 19:04:57 2017	(r312306)
@@ -88,7 +88,7 @@ SET_DECLARE(cam_xpt_proto_set, struct xp
 
 /*
  * The CAM EDT (Existing Device Table) contains the device information for
- * all devices for all busses in the system.  The table contains a
+ * all devices for all buses in the system.  The table contains a
  * cam_ed structure for each device on the bus.
  */
 struct cam_ed {

Modified: projects/netbsd-tests-upstream-01-2017/sys/cam/ctl/ctl.c
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/sys/cam/ctl/ctl.c	Mon Jan 16 19:01:41 2017	(r312305)
+++ projects/netbsd-tests-upstream-01-2017/sys/cam/ctl/ctl.c	Mon Jan 16 19:04:57 2017	(r312306)
@@ -5053,18 +5053,13 @@ ctl_config_move_done(union ctl_io *io)
 	if ((io->io_hdr.port_status != 0) &&
 	    ((io->io_hdr.status & CTL_STATUS_MASK) == CTL_STATUS_NONE ||
 	     (io->io_hdr.status & CTL_STATUS_MASK) == CTL_SUCCESS)) {
-		/*
-		 * For hardware error sense keys, the sense key
-		 * specific value is defined to be a retry count,
-		 * but we use it to pass back an internal FETD
-		 * error code.  XXX KDM  Hopefully the FETD is only
-		 * using 16 bits for an error code, since that's
-		 * all the space we have in the sks field.
-		 */
-		ctl_set_internal_failure(&io->scsiio,
-					 /*sks_valid*/ 1,
-					 /*retry_count*/
-					 io->io_hdr.port_status);
+		ctl_set_internal_failure(&io->scsiio, /*sks_valid*/ 1,
+		    /*retry_count*/ io->io_hdr.port_status);
+	} else if (io->scsiio.kern_data_resid != 0 &&
+	    (io->io_hdr.flags & CTL_FLAG_DATA_MASK) == CTL_FLAG_DATA_OUT &&
+	    ((io->io_hdr.status & CTL_STATUS_MASK) == CTL_STATUS_NONE ||
+	     (io->io_hdr.status & CTL_STATUS_MASK) == CTL_SUCCESS)) {
+		ctl_set_invalid_field_ciu(&io->scsiio);
 	}
 
 	if (ctl_debug & CTL_DEBUG_CDB_DATA)
@@ -5462,7 +5457,6 @@ ctl_format(struct ctl_scsiio *ctsio)
 		ctsio->kern_data_ptr = malloc(length, M_CTL, M_WAITOK);
 		ctsio->kern_data_len = length;
 		ctsio->kern_total_len = length;
-		ctsio->kern_data_resid = 0;
 		ctsio->kern_rel_offset = 0;
 		ctsio->kern_sg_entries = 0;

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***

From owner-svn-src-projects@freebsd.org  Mon Jan 16 19:53:20 2017
Return-Path: <owner-svn-src-projects@freebsd.org>
Delivered-To: svn-src-projects@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 27030CB35CC
 for <svn-src-projects@mailman.ysv.freebsd.org>;
 Mon, 16 Jan 2017 19:53:20 +0000 (UTC) (envelope-from dim@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id F2F601891;
 Mon, 16 Jan 2017 19:53:19 +0000 (UTC) (envelope-from dim@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0GJrJum026192;
 Mon, 16 Jan 2017 19:53:19 GMT (envelope-from dim@FreeBSD.org)
Received: (from dim@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0GJrIMd026190;
 Mon, 16 Jan 2017 19:53:18 GMT (envelope-from dim@FreeBSD.org)
Message-Id: <201701161953.v0GJrIMd026190@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org
 using -f
From: Dimitry Andric <dim@FreeBSD.org>
Date: Mon, 16 Jan 2017 19:53:18 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject: svn commit: r312308 - in projects/clang400-import/contrib/llvm:
 include/llvm/Analysis lib/Analysis
X-SVN-Group: projects
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-projects@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the src &quot; projects&quot;
 tree" <svn-src-projects.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-projects>, 
 <mailto:svn-src-projects-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-projects/>
List-Post: <mailto:svn-src-projects@freebsd.org>
List-Help: <mailto:svn-src-projects-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-projects>, 
 <mailto:svn-src-projects-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 16 Jan 2017 19:53:20 -0000

Author: dim
Date: Mon Jan 16 19:53:18 2017
New Revision: 312308
URL: https://svnweb.freebsd.org/changeset/base/312308

Log:
  Pull in r292133 from upstream llvm trunk (by Hal Finkel):
  
    Fix use-after-free bug in AffectedValueCallbackVH::allUsesReplacedWith
  
    When transferring affected values in the cache from an old value,
    identified by the value of the current callback, to the specified new
    value we might need to insert a new entry into the DenseMap which
    constitutes the cache. Doing so might delete the current callback
    object. Move the copying logic into a new function, a member of the
    assumption cache itself, so that we don't run into UB should the
    callback handle itself be removed mid-copy.
  
    Differential Revision: https://reviews.llvm.org/D28749
  
  This should fix crashes when building lld (as part of the llvmXY ports).
  
  Reported by:	jbeich
  PR:		216117

Modified:
  projects/clang400-import/contrib/llvm/include/llvm/Analysis/AssumptionCache.h
  projects/clang400-import/contrib/llvm/lib/Analysis/AssumptionCache.cpp

Modified: projects/clang400-import/contrib/llvm/include/llvm/Analysis/AssumptionCache.h
==============================================================================
--- projects/clang400-import/contrib/llvm/include/llvm/Analysis/AssumptionCache.h	Mon Jan 16 19:35:19 2017	(r312307)
+++ projects/clang400-import/contrib/llvm/include/llvm/Analysis/AssumptionCache.h	Mon Jan 16 19:53:18 2017	(r312308)
@@ -68,7 +68,10 @@ class AssumptionCache {
   AffectedValuesMap AffectedValues;
 
   /// Get the vector of assumptions which affect a value from the cache.
-  SmallVector<WeakVH, 1> &getAffectedValues(Value *V);
+  SmallVector<WeakVH, 1> &getOrInsertAffectedValues(Value *V);
+
+  /// Copy affected values in the cache for OV to be affected values for NV.
+  void copyAffectedValuesInCache(Value *OV, Value *NV);
 
   /// \brief Flag tracking whether we have scanned the function yet.
   ///

Modified: projects/clang400-import/contrib/llvm/lib/Analysis/AssumptionCache.cpp
==============================================================================
--- projects/clang400-import/contrib/llvm/lib/Analysis/AssumptionCache.cpp	Mon Jan 16 19:35:19 2017	(r312307)
+++ projects/clang400-import/contrib/llvm/lib/Analysis/AssumptionCache.cpp	Mon Jan 16 19:53:18 2017	(r312308)
@@ -24,7 +24,7 @@
 using namespace llvm;
 using namespace llvm::PatternMatch;
 
-SmallVector<WeakVH, 1> &AssumptionCache::getAffectedValues(Value *V) {
+SmallVector<WeakVH, 1> &AssumptionCache::getOrInsertAffectedValues(Value *V) {
   // Try using find_as first to avoid creating extra value handles just for the
   // purpose of doing the lookup.
   auto AVI = AffectedValues.find_as(V);
@@ -98,7 +98,7 @@ void AssumptionCache::updateAffectedValu
   }
 
   for (auto &AV : Affected) {
-    auto &AVV = getAffectedValues(AV);
+    auto &AVV = getOrInsertAffectedValues(AV);
     if (std::find(AVV.begin(), AVV.end(), CI) == AVV.end())
       AVV.push_back(CI);
   }
@@ -111,20 +111,27 @@ void AssumptionCache::AffectedValueCallb
   // 'this' now dangles!
 }
 
+void AssumptionCache::copyAffectedValuesInCache(Value *OV, Value *NV) {
+  auto &NAVV = getOrInsertAffectedValues(NV);
+  auto AVI = AffectedValues.find(OV);
+  if (AVI == AffectedValues.end())
+    return;
+
+  for (auto &A : AVI->second)
+    if (std::find(NAVV.begin(), NAVV.end(), A) == NAVV.end())
+      NAVV.push_back(A);
+}
+
 void AssumptionCache::AffectedValueCallbackVH::allUsesReplacedWith(Value *NV) {
   if (!isa<Instruction>(NV) && !isa<Argument>(NV))
     return;
 
   // Any assumptions that affected this value now affect the new value.
 
-  auto &NAVV = AC->getAffectedValues(NV);
-  auto AVI = AC->AffectedValues.find(getValPtr());
-  if (AVI == AC->AffectedValues.end())
-    return;
-
-  for (auto &A : AVI->second)
-    if (std::find(NAVV.begin(), NAVV.end(), A) == NAVV.end())
-      NAVV.push_back(A);
+  AC->copyAffectedValuesInCache(getValPtr(), NV);
+  // 'this' now might dangle! If the AffectedValues map was resized to add an
+  // entry for NV then this object might have been destroyed in favor of some
+  // copy in the grown map.
 }
 
 void AssumptionCache::scanFunction() {

From owner-svn-src-projects@freebsd.org  Mon Jan 16 19:56:34 2017
Return-Path: <owner-svn-src-projects@freebsd.org>
Delivered-To: svn-src-projects@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 15E82CB3673
 for <svn-src-projects@mailman.ysv.freebsd.org>;
 Mon, 16 Jan 2017 19:56:34 +0000 (UTC) (envelope-from dim@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id B03031B3B;
 Mon, 16 Jan 2017 19:56:33 +0000 (UTC) (envelope-from dim@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0GJuWdR026462;
 Mon, 16 Jan 2017 19:56:32 GMT (envelope-from dim@FreeBSD.org)
Received: (from dim@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0GJuR8b026413;
 Mon, 16 Jan 2017 19:56:27 GMT (envelope-from dim@FreeBSD.org)
Message-Id: <201701161956.v0GJuR8b026413@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org
 using -f
From: Dimitry Andric <dim@FreeBSD.org>
Date: Mon, 16 Jan 2017 19:56:27 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject: svn commit: r312309 - in projects/clang400-import: lib/libc/sys
 lib/msun/tests libexec/rtld-elf/amd64 release/tools sbin/camcontrol
 share/man/man4 share/man/man9 share/skel sys/amd64/vmm sys/arm/ar...
X-SVN-Group: projects
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-projects@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the src &quot; projects&quot;
 tree" <svn-src-projects.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-projects>, 
 <mailto:svn-src-projects-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-projects/>
List-Post: <mailto:svn-src-projects@freebsd.org>
List-Help: <mailto:svn-src-projects-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-projects>, 
 <mailto:svn-src-projects-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 16 Jan 2017 19:56:34 -0000

Author: dim
Date: Mon Jan 16 19:56:27 2017
New Revision: 312309
URL: https://svnweb.freebsd.org/changeset/base/312309

Log:
  Merge ^/head r312207 through r312308.

Added:
  projects/clang400-import/sys/dev/gpio/gpioths.c
     - copied unchanged from r312308, head/sys/dev/gpio/gpioths.c
  projects/clang400-import/tools/regression/sockets/udp_pingpong/
     - copied from r312308, head/tools/regression/sockets/udp_pingpong/
Deleted:
  projects/clang400-import/sys/arm/include/cpuconf.h
Modified:
  projects/clang400-import/lib/libc/sys/getsockopt.2
  projects/clang400-import/lib/msun/tests/Makefile
  projects/clang400-import/lib/msun/tests/fmaxmin_test.c
  projects/clang400-import/libexec/rtld-elf/amd64/rtld_machdep.h
  projects/clang400-import/libexec/rtld-elf/amd64/rtld_start.S
  projects/clang400-import/release/tools/ec2.conf
  projects/clang400-import/sbin/camcontrol/camcontrol.8
  projects/clang400-import/sbin/camcontrol/camcontrol.c
  projects/clang400-import/share/man/man4/alc.4
  projects/clang400-import/share/man/man4/ehci.4
  projects/clang400-import/share/man/man4/iicbus.4
  projects/clang400-import/share/man/man4/scsi.4
  projects/clang400-import/share/man/man9/BUS_CONFIG_INTR.9
  projects/clang400-import/share/man/man9/DEVICE_ATTACH.9
  projects/clang400-import/share/man/man9/DEVICE_IDENTIFY.9
  projects/clang400-import/share/man/man9/DRIVER_MODULE.9
  projects/clang400-import/share/man/man9/bus_generic_attach.9
  projects/clang400-import/share/man/man9/bus_generic_detach.9
  projects/clang400-import/share/man/man9/bus_generic_new_pass.9
  projects/clang400-import/share/man/man9/bus_generic_print_child.9
  projects/clang400-import/share/man/man9/bus_generic_read_ivar.9
  projects/clang400-import/share/man/man9/bus_generic_shutdown.9
  projects/clang400-import/share/man/man9/bus_space.9
  projects/clang400-import/share/man/man9/device.9
  projects/clang400-import/share/man/man9/device_add_child.9
  projects/clang400-import/share/man/man9/pci.9
  projects/clang400-import/share/skel/dot.shrc
  projects/clang400-import/sys/amd64/vmm/vmm_host.h
  projects/clang400-import/sys/arm/arm/bus_space_asm_generic.S
  projects/clang400-import/sys/arm/arm/cpufunc.c
  projects/clang400-import/sys/arm/arm/identcpu-v4.c
  projects/clang400-import/sys/arm/arm/locore-v4.S
  projects/clang400-import/sys/arm/arm/locore-v6.S
  projects/clang400-import/sys/arm/arm/ofw_machdep.c
  projects/clang400-import/sys/arm/arm/trap-v4.c
  projects/clang400-import/sys/arm/freescale/imx/imx6_ccm.c
  projects/clang400-import/sys/arm/freescale/imx/imx6_machdep.c
  projects/clang400-import/sys/arm/freescale/imx/imx_i2c.c
  projects/clang400-import/sys/arm/include/atomic.h
  projects/clang400-import/sys/arm/include/cpufunc.h
  projects/clang400-import/sys/arm/include/pcpu.h
  projects/clang400-import/sys/arm/include/pmap-v4.h
  projects/clang400-import/sys/arm/mv/mv_pci.c
  projects/clang400-import/sys/boot/efi/loader/main.c
  projects/clang400-import/sys/cam/cam_compat.h
  projects/clang400-import/sys/cam/cam_iosched.h
  projects/clang400-import/sys/cam/cam_xpt.c
  projects/clang400-import/sys/cam/cam_xpt_internal.h
  projects/clang400-import/sys/cam/ctl/ctl.c
  projects/clang400-import/sys/cam/ctl/ctl_backend_block.c
  projects/clang400-import/sys/cam/ctl/ctl_backend_ramdisk.c
  projects/clang400-import/sys/cam/ctl/ctl_error.c
  projects/clang400-import/sys/cam/ctl/ctl_error.h
  projects/clang400-import/sys/cam/ctl/ctl_frontend_cam_sim.c
  projects/clang400-import/sys/cam/ctl/ctl_frontend_ioctl.c
  projects/clang400-import/sys/cam/ctl/ctl_frontend_iscsi.c
  projects/clang400-import/sys/cam/ctl/ctl_tpc.c
  projects/clang400-import/sys/cam/ctl/ctl_tpc_local.c
  projects/clang400-import/sys/cam/ctl/ctl_util.c
  projects/clang400-import/sys/cam/ctl/ctl_util.h
  projects/clang400-import/sys/cam/ctl/scsi_ctl.c
  projects/clang400-import/sys/cam/scsi/scsi_all.c
  projects/clang400-import/sys/conf/files
  projects/clang400-import/sys/dev/alc/if_alc.c
  projects/clang400-import/sys/dev/alc/if_alcreg.h
  projects/clang400-import/sys/dev/bhnd/bhnd.h
  projects/clang400-import/sys/dev/etherswitch/arswitch/arswitch.c
  projects/clang400-import/sys/dev/etherswitch/arswitch/arswitch_7240.c
  projects/clang400-import/sys/dev/etherswitch/arswitch/arswitch_8316.c
  projects/clang400-import/sys/dev/etherswitch/arswitch/arswitch_8327.c
  projects/clang400-import/sys/dev/etherswitch/arswitch/arswitch_9340.c
  projects/clang400-import/sys/dev/fdt/simplebus.c
  projects/clang400-import/sys/dev/isp/isp.c
  projects/clang400-import/sys/dev/mmc/mmcreg.h
  projects/clang400-import/sys/dev/mpt/mpt.c
  projects/clang400-import/sys/dev/mpt/mpt.h
  projects/clang400-import/sys/dev/mpt/mpt_raid.c
  projects/clang400-import/sys/dev/pccbb/pccbb_pci.c
  projects/clang400-import/sys/dev/pci/hostb_pci.c
  projects/clang400-import/sys/dev/pci/pci.c
  projects/clang400-import/sys/dev/pci/pci_private.h
  projects/clang400-import/sys/dev/pci/pci_subr.c
  projects/clang400-import/sys/dev/spibus/spibus.c
  projects/clang400-import/sys/dev/usb/usb_hub.c
  projects/clang400-import/sys/kern/bus_if.m
  projects/clang400-import/sys/kern/kern_acct.c
  projects/clang400-import/sys/kern/kern_event.c
  projects/clang400-import/sys/kern/sched_ule.c
  projects/clang400-import/sys/kern/subr_bus.c
  projects/clang400-import/sys/kern/uipc_mbuf.c
  projects/clang400-import/sys/kern/uipc_socket.c
  projects/clang400-import/sys/kern/uipc_usrreq.c
  projects/clang400-import/sys/mips/atheros/ar71xxreg.h
  projects/clang400-import/sys/mips/atheros/uart_bus_ar71xx.c
  projects/clang400-import/sys/net80211/ieee80211.h
  projects/clang400-import/sys/netinet/cc/cc.h
  projects/clang400-import/sys/netinet/ip_input.c
  projects/clang400-import/sys/netinet6/in6_proto.c
  projects/clang400-import/sys/netinet6/ip6_input.c
  projects/clang400-import/sys/sys/ata.h
  projects/clang400-import/sys/sys/buf_ring.h
  projects/clang400-import/sys/sys/bus.h
  projects/clang400-import/sys/sys/busdma_bufalloc.h
  projects/clang400-import/sys/sys/devmap.h
  projects/clang400-import/sys/sys/event.h
  projects/clang400-import/sys/sys/eventvar.h
  projects/clang400-import/sys/sys/gtaskqueue.h
  projects/clang400-import/sys/sys/ksem.h
  projects/clang400-import/sys/sys/pipe.h
  projects/clang400-import/sys/sys/socket.h
  projects/clang400-import/sys/sys/socketvar.h
  projects/clang400-import/sys/sys/sockopt.h
  projects/clang400-import/sys/sys/taskqueue.h
  projects/clang400-import/sys/vm/vm_object.c
  projects/clang400-import/sys/vm/vm_page.c
  projects/clang400-import/sys/x86/pci/pci_bus.c
  projects/clang400-import/sys/x86/x86/mptable.c
  projects/clang400-import/sys/x86/x86/nexus.c
  projects/clang400-import/sys/xen/xenbus/xenbusb.c
  projects/clang400-import/sys/xen/xenbus/xenbusb.h
  projects/clang400-import/tests/sys/kern/acct/Makefile
  projects/clang400-import/tests/sys/vfs/lookup_cap_dotdot.c
  projects/clang400-import/tools/regression/sockets/unix_cmsg/Makefile
  projects/clang400-import/tools/regression/sockets/unix_cmsg/unix_cmsg.c
  projects/clang400-import/usr.sbin/mptutil/mpt_cam.c
Directory Properties:
  projects/clang400-import/   (props changed)

Modified: projects/clang400-import/lib/libc/sys/getsockopt.2
==============================================================================
--- projects/clang400-import/lib/libc/sys/getsockopt.2	Mon Jan 16 19:53:18 2017	(r312308)
+++ projects/clang400-import/lib/libc/sys/getsockopt.2	Mon Jan 16 19:56:27 2017	(r312309)
@@ -187,6 +187,7 @@ The following options are recognized in
 .It Dv SO_LISTENQLEN Ta "get complete queue length of the socket (get only)"
 .It Dv SO_LISTENINCQLEN Ta "get incomplete queue length of the socket (get only)"
 .It Dv SO_USER_COOKIE Ta "set the 'so_user_cookie' value for the socket (uint32_t, set only)"
+.It Dv SO_TS_CLOCK Ta "set specific format of timestamp returned by SO_TIMESTAMP"
 .El
 .Pp
 .Dv SO_DEBUG
@@ -435,7 +436,7 @@ for
 .Dv SO_BINTIME .
 The
 .Vt cmsghdr
-fields have the following values for TIMESTAMP:
+fields have the following values for TIMESTAMP by default:
 .Bd -literal
      cmsg_len = CMSG_LEN(sizeof(struct timeval));
      cmsg_level = SOL_SOCKET;
@@ -450,6 +451,24 @@ and for
      cmsg_type = SCM_BINTIME;
 .Ed
 .Pp
+Additional timestamp types are available by following
+.Dv SO_TIMESTAMP
+with
+.Dv SO_TS_CLOCK ,
+which requests specific timestamp format to be returned instead of
+.Dv SCM_TIMESTAMP when
+.Dv SO_TIMESTAMP is enabled.
+The following
+.Dv SO_TS_CLOCK
+values are recognized in
+.Fx :
+.Bl -column SO_TS_CLOCK -offset indent
+.It Dv SO_TS_REALTIME_MICRO Ta "realtime (SCM_TIMESTAMP, struct timeval), default"
+.It Dv SO_TS_BINTIME Ta "realtime (SCM_BINTIME, struct bintime)"
+.It Dv SO_TS_REALTIME Ta "realtime (SCM_REALTIME, struct timespec)"
+.It Dv SO_TS_MONOTONIC Ta "monotonic time (SCM_MONOTONIC, struct timespec)"
+.El
+.Pp
 .Dv SO_ACCEPTCONN ,
 .Dv SO_TYPE ,
 .Dv SO_PROTOCOL

Modified: projects/clang400-import/lib/msun/tests/Makefile
==============================================================================
--- projects/clang400-import/lib/msun/tests/Makefile	Mon Jan 16 19:53:18 2017	(r312308)
+++ projects/clang400-import/lib/msun/tests/Makefile	Mon Jan 16 19:56:27 2017	(r312309)
@@ -55,10 +55,7 @@ TAP_TESTS_C+=	ctrig_test
 TAP_TESTS_C+=	exponential_test
 TAP_TESTS_C+=	fenv_test
 TAP_TESTS_C+=	fma_test
-# clang 3.8.0 fails always fails this test. See: bug 208703
-.if ! (${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} >= 30800)
 TAP_TESTS_C+=	fmaxmin_test
-.endif
 TAP_TESTS_C+=	ilogb2_test
 TAP_TESTS_C+=	invtrig_test
 TAP_TESTS_C+=	invctrig_test

Modified: projects/clang400-import/lib/msun/tests/fmaxmin_test.c
==============================================================================
--- projects/clang400-import/lib/msun/tests/fmaxmin_test.c	Mon Jan 16 19:53:18 2017	(r312308)
+++ projects/clang400-import/lib/msun/tests/fmaxmin_test.c	Mon Jan 16 19:56:27 2017	(r312309)
@@ -86,6 +86,8 @@ testall_r(long double big, long double s
 	return (ok);
 }
 
+const char *comment = NULL;
+
 /*
  * Test all the functions: fmaxf, fmax, fmaxl, fminf, fmin, and fminl,
  * in all rounding modes and with the arguments in different orders.
@@ -107,10 +109,17 @@ testall(int testnum, long double big, lo
 			break;
 		}
 	}
-	printf("%sok %d - big = %.20Lg, small = %.20Lg\n",
-	       (i == 4) ? "" : "not ", testnum, big, small);
+	printf("%sok %d - big = %.20Lg, small = %.20Lg%s\n",
+	       (i == 4) ? "" : "not ", testnum, big, small,
+	       comment == NULL ? "" : comment);
 }
 
+/* Clang 3.8.0+ fails the invariants for testcase 6, 7, 10, and 11. */
+#if defined(__clang__) && \
+    (__clang_major__ >= 3 && __clang_minor__ >= 8 && __clang_patchlevel__ >= 0)
+#define	affected_by_bug_208703
+#endif
+
 int
 main(int argc, char *argv[])
 {
@@ -122,15 +131,23 @@ main(int argc, char *argv[])
 	testall(3, nextafterf(42.0, INFINITY), 42.0);
 	testall(4, -5.0, -5.0);
 	testall(5, -3.0, -4.0);
+#ifdef affected_by_bug_208703
+	comment = "# TODO: testcase 6-7 fails invariant with clang 3.8+ (bug 208703)";
+#endif
 	testall(6, 1.0, NAN);
 	testall(7, INFINITY, NAN);
+	comment = NULL;
 	testall(8, INFINITY, 1.0);
 	testall(9, -3.0, -INFINITY);
 	testall(10, 3.0, -INFINITY);
+#ifdef affected_by_bug_208703
+	comment = "# TODO: testcase 11-12 fails invariant with clang 3.8+ (bug 208703)";
+#endif
 	testall(11, NAN, NAN);
 
 	/* This test isn't strictly required to work by C99. */
 	testall(12, 0.0, -0.0);
+	comment = NULL;
 
 	return (0);
 }

Modified: projects/clang400-import/libexec/rtld-elf/amd64/rtld_machdep.h
==============================================================================
--- projects/clang400-import/libexec/rtld-elf/amd64/rtld_machdep.h	Mon Jan 16 19:53:18 2017	(r312308)
+++ projects/clang400-import/libexec/rtld-elf/amd64/rtld_machdep.h	Mon Jan 16 19:56:27 2017	(r312309)
@@ -35,8 +35,8 @@
 struct Struct_Obj_Entry;
 
 /* Return the address of the .dynamic section in the dynamic linker. */
-#define rtld_dynamic(obj) \
-    ((const Elf_Dyn *)((obj)->relocbase + (Elf_Addr)&_DYNAMIC))
+Elf_Dyn *rtld_dynamic_addr(void);
+#define	rtld_dynamic(obj)	rtld_dynamic_addr()
 
 /* Fixup the jump slot at "where" to transfer control to "target". */
 static inline Elf_Addr

Modified: projects/clang400-import/libexec/rtld-elf/amd64/rtld_start.S
==============================================================================
--- projects/clang400-import/libexec/rtld-elf/amd64/rtld_start.S	Mon Jan 16 19:53:18 2017	(r312308)
+++ projects/clang400-import/libexec/rtld-elf/amd64/rtld_start.S	Mon Jan 16 19:56:27 2017	(r312309)
@@ -156,4 +156,16 @@ _rtld_bind_start:
 	.cfi_endproc
 	.size	_rtld_bind_start, . - _rtld_bind_start
 
+	.align	4
+	.globl	rtld_dynamic_addr
+	.type	rtld_dynamic_addr,@function
+rtld_dynamic_addr:
+	.cfi_startproc
+	.weak _DYNAMIC
+	.hidden _DYNAMIC
+	lea	_DYNAMIC(%rip),%rax
+	ret
+	.cfi_endproc
+	.size	rtld_dynamic_addr, . - rtld_dynamic_addr
+
 	.section .note.GNU-stack,"",%progbits

Modified: projects/clang400-import/release/tools/ec2.conf
==============================================================================
--- projects/clang400-import/release/tools/ec2.conf	Mon Jan 16 19:53:18 2017	(r312308)
+++ projects/clang400-import/release/tools/ec2.conf	Mon Jan 16 19:56:27 2017	(r312309)
@@ -6,7 +6,7 @@
 # Packages to install into the image we're creating.  This is a deliberately
 # minimalist set, providing only the packages necessary to bootstrap further
 # package installation as specified via EC2 user-data.
-export VM_EXTRA_PACKAGES="ec2-scripts firstboot-freebsd-update firstboot-pkgs"
+export VM_EXTRA_PACKAGES="ec2-scripts firstboot-freebsd-update firstboot-pkgs dual-dhclient"
 
 # Set to a list of third-party software to enable in rc.conf(5).
 export VM_RC_LIST="ec2_configinit ec2_fetchkey ec2_ephemeralswap ec2_loghostkey firstboot_freebsd_update firstboot_pkgs"
@@ -39,8 +39,9 @@ vm_extra_pre_umount() {
 	# time; expand our filesystem to fill the disk.
 	echo 'growfs_enable="YES"' >> ${DESTDIR}/etc/rc.conf
 
-	# EC2 instances use DHCP to get their network configuration.
-	echo 'ifconfig_DEFAULT="SYNCDHCP"' >> ${DESTDIR}/etc/rc.conf
+	# EC2 instances use DHCP to get their network configuration.  IPv6
+	# requires accept_rtadv.
+	echo 'ifconfig_DEFAULT="SYNCDHCP accept_rtadv"' >> ${DESTDIR}/etc/rc.conf
 
 	# Unless the system has been configured via EC2 user-data, the user
 	# will need to SSH in to do anything.
@@ -51,6 +52,10 @@ vm_extra_pre_umount() {
 	# via EC2 user-data.
 	echo 'firstboot_pkgs_list="awscli"' >> ${DESTDIR}/etc/rc.conf
 
+	# Enable IPv6 on all interfaces, and use DHCP on both IPv4 and IPv6.
+	echo 'ipv6_activate_all_interfaces="YES"' >> ${DESTDIR}/etc/rc.conf
+	echo 'dhclient_program="/usr/local/sbin/dual-dhclient"' >> ${DESTDIR}/etc/rc.conf
+
 	# The EC2 console is output-only, so while printing a backtrace can
 	# be useful, there's no point dropping into a debugger or waiting
 	# for a keypress.

Modified: projects/clang400-import/sbin/camcontrol/camcontrol.8
==============================================================================
--- projects/clang400-import/sbin/camcontrol/camcontrol.8	Mon Jan 16 19:53:18 2017	(r312308)
+++ projects/clang400-import/sbin/camcontrol/camcontrol.8	Mon Jan 16 19:56:27 2017	(r312309)
@@ -27,7 +27,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd January 6, 2017
+.Dd January 15, 2017
 .Dt CAMCONTROL 8
 .Os
 .Sh NAME
@@ -565,12 +565,12 @@ start bit set and the load/eject bit set
 Send the SCSI Start/Stop Unit (0x1B) command to the given device with the
 start bit cleared and the load/eject bit set.
 .It Ic rescan
-Tell the kernel to scan all busses in the system (with the
+Tell the kernel to scan all buses in the system (with the
 .Ar all
 argument), the given bus (XPT_SCAN_BUS), or bus:target:lun
 (XPT_SCAN_LUN) for new devices or devices that have gone away.
 The user
-may specify a scan of all busses, a single bus, or a lun.
+may specify a scan of all buses, a single bus, or a lun.
 Scanning all luns
 on a target is not supported.
 .It Ic reprobe
@@ -580,7 +580,7 @@ notify the upper layer,
 This includes sending the SCSI READ CAPACITY command and updating
 the disk size visible to the rest of the system.
 .It Ic reset
-Tell the kernel to reset all busses in the system (with the
+Tell the kernel to reset all buses in the system (with the
 .Ar all
 argument) or the given bus (XPT_RESET_BUS) by issuing a SCSI bus
 reset for that bus, or to reset the given bus:target:lun
@@ -2557,7 +2557,7 @@ write reallocation settings, among other
 .Pp
 .Dl camcontrol rescan all
 .Pp
-Rescan all SCSI busses in the system for devices that have been added,
+Rescan all SCSI buses in the system for devices that have been added,
 removed or changed.
 .Pp
 .Dl camcontrol rescan 0

Modified: projects/clang400-import/sbin/camcontrol/camcontrol.c
==============================================================================
--- projects/clang400-import/sbin/camcontrol/camcontrol.c	Mon Jan 16 19:53:18 2017	(r312308)
+++ projects/clang400-import/sbin/camcontrol/camcontrol.c	Mon Jan 16 19:56:27 2017	(r312309)
@@ -3179,8 +3179,8 @@ rescan_or_reset_bus(path_id_t bus, int r
 	/*
 	 * The right way to handle this is to modify the xpt so that it can
 	 * handle a wildcarded bus in a rescan or reset CCB.  At the moment
-	 * that isn't implemented, so instead we enumerate the busses and
-	 * send the rescan or reset to those busses in the case where the
+	 * that isn't implemented, so instead we enumerate the buses and
+	 * send the rescan or reset to those buses in the case where the
 	 * given bus is -1 (wildcard).  We don't send a rescan or reset
 	 * to the xpt bus; sending a rescan to the xpt bus is effectively a
 	 * no-op, sending a rescan to the xpt bus would result in a status of
@@ -4150,7 +4150,7 @@ scsicmd(struct cam_device *device, int a
 	u_int8_t cdb[20];
 	u_int8_t atacmd[12];
 	struct get_hook hook;
-	int c, data_bytes = 0;
+	int c, data_bytes = 0, valid_bytes;
 	int cdb_len = 0;
 	int atacmd_len = 0;
 	int dmacmd = 0;
@@ -4454,16 +4454,20 @@ scsicmd(struct cam_device *device, int a
 		}
 	}
 
+	if (cdb_len)
+		valid_bytes = ccb->csio.dxfer_len - ccb->csio.resid;
+	else
+		valid_bytes = ccb->ataio.dxfer_len - ccb->ataio.resid;
 	if (((ccb->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP)
 	 && (arglist & CAM_ARG_CMD_IN)
-	 && (data_bytes > 0)) {
+	 && (valid_bytes > 0)) {
 		if (fd_data == 0) {
-			buff_decode_visit(data_ptr, data_bytes, datastr,
+			buff_decode_visit(data_ptr, valid_bytes, datastr,
 					  arg_put, NULL);
 			fprintf(stdout, "\n");
 		} else {
 			ssize_t amt_written;
-			int amt_to_write = data_bytes;
+			int amt_to_write = valid_bytes;
 			u_int8_t *buf_ptr = data_ptr;
 
 			for (amt_written = 0; (amt_to_write > 0) &&
@@ -4478,7 +4482,7 @@ scsicmd(struct cam_device *device, int a
 			} else if ((amt_written == 0)
 				&& (amt_to_write > 0)) {
 				warnx("only wrote %u bytes out of %u",
-				      data_bytes - amt_to_write, data_bytes);
+				      valid_bytes - amt_to_write, valid_bytes);
 			}
 		}
 	}
@@ -8950,8 +8954,8 @@ usage(int printlong)
 "load        send a Start Unit command to the device with the load bit set\n"
 "eject       send a Stop Unit command to the device with the eject bit set\n"
 "reprobe     update capacity information of the given device\n"
-"rescan      rescan all busses, the given bus, or bus:target:lun\n"
-"reset       reset all busses, the given bus, or bus:target:lun\n"
+"rescan      rescan all buses, the given bus, or bus:target:lun\n"
+"reset       reset all buses, the given bus, or bus:target:lun\n"
 "defects     read the defect list of the specified device\n"
 "modepage    display or edit (-e) the given mode page\n"
 "cmd         send the given SCSI command, may need -i or -o as well\n"

Modified: projects/clang400-import/share/man/man4/alc.4
==============================================================================
--- projects/clang400-import/share/man/man4/alc.4	Mon Jan 16 19:53:18 2017	(r312308)
+++ projects/clang400-import/share/man/man4/alc.4	Mon Jan 16 19:56:27 2017	(r312309)
@@ -124,6 +124,8 @@ Atheros AR8172 PCI Express Fast Ethernet
 Killer E2200 Gigabit Ethernet controller
 .It
 Killer E2400 Gigabit Ethernet controller
+.It
+Killer E2500 Gigabit Ethernet controller
 .El
 .Sh LOADER TUNABLES
 Tunables can be set at the

Modified: projects/clang400-import/share/man/man4/ehci.4
==============================================================================
--- projects/clang400-import/share/man/man4/ehci.4	Mon Jan 16 19:53:18 2017	(r312308)
+++ projects/clang400-import/share/man/man4/ehci.4	Mon Jan 16 19:56:27 2017	(r312309)
@@ -29,7 +29,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd March 4, 2012
+.Dd January 15, 2017
 .Dt EHCI 4
 .Os
 .Sh NAME
@@ -68,7 +68,7 @@ but can be noticed since
 1.x and
 .Tn USB
 2.0 devices plugged in to the same
-connector appear to connect to different USB busses.
+connector appear to connect to different USB buses.
 .Sh SEE ALSO
 .Xr ohci 4 ,
 .Xr uhci 4 ,

Modified: projects/clang400-import/share/man/man4/iicbus.4
==============================================================================
--- projects/clang400-import/share/man/man4/iicbus.4	Mon Jan 16 19:53:18 2017	(r312308)
+++ projects/clang400-import/share/man/man4/iicbus.4	Mon Jan 16 19:56:27 2017	(r312309)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd November 17, 2014
+.Dd January 15, 2017
 .Dt IICBUS 4
 .Os
 .Sh NAME
@@ -112,11 +112,11 @@ different speed.
 A general purpose I2C bus, such as those found in many embedded systems,
 will often support multiple bus frequencies.
 .Pp
-When a system supports multiple I2C busses, a different frequency can
+When a system supports multiple I2C buses, a different frequency can
 be configured for each bus by number, represented by the
 .Va %d
 in the variable names below.
-Busses can be configured using any combination of device hints,
+Buses can be configured using any combination of device hints,
 Flattened Device Tree (FDT) data, tunables set via
 .Xr loader 8 ,
 or at runtime using

Modified: projects/clang400-import/share/man/man4/scsi.4
==============================================================================
--- projects/clang400-import/share/man/man4/scsi.4	Mon Jan 16 19:53:18 2017	(r312308)
+++ projects/clang400-import/share/man/man4/scsi.4	Mon Jan 16 19:56:27 2017	(r312309)
@@ -24,7 +24,7 @@
 .\" SUCH DAMAGE.
 .\"
 .\" $FreeBSD$
-.Dd June 7, 2012
+.Dd January 15, 2017
 .Dt CAM 4
 .Os
 .Sh NAME
@@ -62,7 +62,7 @@ devices, and to utilize different
 and
 .Tn ATA
 host adapters through host adapter drivers.
-When the system probes busses, it attaches any devices it finds to the
+When the system probes buses, it attaches any devices it finds to the
 appropriate drivers.
 The
 .Xr pass 4
@@ -150,7 +150,7 @@ In that case, the
 will be reset to 100ms.
 .El
 .Pp
-All devices and busses support dynamic allocation so that
+All devices and buses support dynamic allocation so that
 an upper number of devices and controllers does not need to be configured;
 .Cd "device da"
 will suffice for any number of disk drivers.
@@ -297,7 +297,7 @@ see printfs for multiple debugging level
 This allows to set the various debugging flags from a kernel config file.
 .It Dv CAM_DEBUG_BUS
 Specify a bus to debug.
-To debug all busses, set this to -1.
+To debug all buses, set this to -1.
 .It Dv CAM_DEBUG_TARGET
 Specify a target to debug.
 To debug all targets, set this to -1.

Modified: projects/clang400-import/share/man/man9/BUS_CONFIG_INTR.9
==============================================================================
--- projects/clang400-import/share/man/man9/BUS_CONFIG_INTR.9	Mon Jan 16 19:53:18 2017	(r312308)
+++ projects/clang400-import/share/man/man9/BUS_CONFIG_INTR.9	Mon Jan 16 19:56:27 2017	(r312309)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd January 6, 2005
+.Dd January 15, 2017
 .Dt BUS_CONFIG_INTR 9
 .Os
 .\"
@@ -45,7 +45,7 @@
 The
 .Fn BUS_CONFIG_INTR
 method allows bus or device drivers to provide interrupt polarity and trigger
-mode to parent busses.
+mode to parent buses.
 This typically bubbles all the way up to the root bus (e.g.\& nexus) where the
 necessary actions are taken to actually program the hardware.
 Since the

Modified: projects/clang400-import/share/man/man9/DEVICE_ATTACH.9
==============================================================================
--- projects/clang400-import/share/man/man9/DEVICE_ATTACH.9	Mon Jan 16 19:53:18 2017	(r312308)
+++ projects/clang400-import/share/man/man9/DEVICE_ATTACH.9	Mon Jan 16 19:56:27 2017	(r312309)
@@ -28,7 +28,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd January 6, 2005
+.Dd January 15, 2017
 .Dt DEVICE_ATTACH 9
 .Os
 .Sh NAME
@@ -51,7 +51,7 @@ system resources (such as
 .Xr devfs 5
 entries).
 .Pp
-Devices which implement busses should use this method to probe for
+Devices which implement buses should use this method to probe for
 the existence of devices attached to the bus and add them as
 children.
 If this is combined with the use of

Modified: projects/clang400-import/share/man/man9/DEVICE_IDENTIFY.9
==============================================================================
--- projects/clang400-import/share/man/man9/DEVICE_IDENTIFY.9	Mon Jan 16 19:53:18 2017	(r312308)
+++ projects/clang400-import/share/man/man9/DEVICE_IDENTIFY.9	Mon Jan 16 19:56:27 2017	(r312309)
@@ -28,7 +28,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd May 13, 2004
+.Dd January 15, 2017
 .Dt DEVICE_IDENTIFY 9
 .Os
 .Sh NAME
@@ -40,7 +40,7 @@
 .Ft void
 .Fn DEVICE_IDENTIFY "driver_t *driver" "device_t parent"
 .Sh DESCRIPTION
-The identify function for a device is only needed for devices on busses
+The identify function for a device is only needed for devices on buses
 that cannot identify their children independently, e.g.\& the ISA bus.
 It is used to recognize the device (usually done by accessing non-ambiguous
 registers in the hardware) and to tell the kernel about it and thus

Modified: projects/clang400-import/share/man/man9/DRIVER_MODULE.9
==============================================================================
--- projects/clang400-import/share/man/man9/DRIVER_MODULE.9	Mon Jan 16 19:53:18 2017	(r312308)
+++ projects/clang400-import/share/man/man9/DRIVER_MODULE.9	Mon Jan 16 19:56:27 2017	(r312309)
@@ -28,7 +28,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd August 21, 2012
+.Dd January 15, 2017
 .Dt DRIVER_MODULE 9
 .Os
 .Sh NAME
@@ -69,9 +69,9 @@ or
 The identifier used in
 .Fn DRIVER_MODULE
 can be different from the driver name.
-Also, the same driver identifier can exist on different busses,
+Also, the same driver identifier can exist on different buses,
 which is a pretty clean way of making front ends for different cards
-using the same driver on the same or different busses.
+using the same driver on the same or different buses.
 For example, the following is allowed:
 .Pp
 .Fn DRIVER_MODULE foo isa foo_driver foo_devclass NULL NULL ;

Modified: projects/clang400-import/share/man/man9/bus_generic_attach.9
==============================================================================
--- projects/clang400-import/share/man/man9/bus_generic_attach.9	Mon Jan 16 19:53:18 2017	(r312308)
+++ projects/clang400-import/share/man/man9/bus_generic_attach.9	Mon Jan 16 19:56:27 2017	(r312309)
@@ -28,14 +28,14 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd June 16, 1998
+.Dd January 15, 2017
 .Dt BUS_GENERIC_ATTACH 9
 .Os
 .Sh NAME
 .Nm bus_generic_attach
 .Nd generic implementation of
 .Dv DEVICE_ATTACH
-for busses
+for buses
 .Sh SYNOPSIS
 .In sys/param.h
 .In sys/bus.h

Modified: projects/clang400-import/share/man/man9/bus_generic_detach.9
==============================================================================
--- projects/clang400-import/share/man/man9/bus_generic_detach.9	Mon Jan 16 19:53:18 2017	(r312308)
+++ projects/clang400-import/share/man/man9/bus_generic_detach.9	Mon Jan 16 19:56:27 2017	(r312309)
@@ -28,14 +28,14 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd June 16, 1998
+.Dd January 15, 2017
 .Dt BUS_GENERIC_DETACH 9
 .Os
 .Sh NAME
 .Nm bus_generic_detach
 .Nd generic implementation of
 .Dv DEVICE_DETACH
-for busses
+for buses
 .Sh SYNOPSIS
 .In sys/param.h
 .In sys/bus.h

Modified: projects/clang400-import/share/man/man9/bus_generic_new_pass.9
==============================================================================
--- projects/clang400-import/share/man/man9/bus_generic_new_pass.9	Mon Jan 16 19:53:18 2017	(r312308)
+++ projects/clang400-import/share/man/man9/bus_generic_new_pass.9	Mon Jan 16 19:56:27 2017	(r312309)
@@ -27,7 +27,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd June 8, 2009
+.Dd January 15, 2017
 .Dt BUS_GENERIC_NEW_PASS 9
 .Os
 .Sh NAME
@@ -47,7 +47,7 @@ It first invokes the
 method for any drivers whose pass level is equal to the new pass level.
 Then, for each attached child device it calls
 .Xr BUS_NEW_PASS 9
-to rescan child busses,
+to rescan child buses,
 and for each unattached child device it calls
 .Xr device_probe_and_attach 9 .
 .Sh SEE ALSO

Modified: projects/clang400-import/share/man/man9/bus_generic_print_child.9
==============================================================================
--- projects/clang400-import/share/man/man9/bus_generic_print_child.9	Mon Jan 16 19:53:18 2017	(r312308)
+++ projects/clang400-import/share/man/man9/bus_generic_print_child.9	Mon Jan 16 19:56:27 2017	(r312309)
@@ -28,14 +28,14 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd June 16, 1998
+.Dd January 15, 2017
 .Dt BUS_GENERIC_PRINT_CHILD 9
 .Os
 .Sh NAME
 .Nm bus_generic_print_child
 .Nd generic implementation of
 .Dv DEVICE_PRINT_CHILD
-for busses
+for buses
 .Sh SYNOPSIS
 .In sys/param.h
 .In sys/bus.h

Modified: projects/clang400-import/share/man/man9/bus_generic_read_ivar.9
==============================================================================
--- projects/clang400-import/share/man/man9/bus_generic_read_ivar.9	Mon Jan 16 19:53:18 2017	(r312308)
+++ projects/clang400-import/share/man/man9/bus_generic_read_ivar.9	Mon Jan 16 19:56:27 2017	(r312309)
@@ -28,7 +28,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd June 16, 1998
+.Dd January 15, 2017
 .Dt BUS_GENERIC_READ_IVAR 9
 .Os
 .Sh NAME
@@ -38,7 +38,7 @@
 .Dv BUS_READ_IVAR
 and
 .Dv BUS_WRITE_IVAR
-for busses
+for buses
 .Sh SYNOPSIS
 .In sys/param.h
 .In sys/bus.h

Modified: projects/clang400-import/share/man/man9/bus_generic_shutdown.9
==============================================================================
--- projects/clang400-import/share/man/man9/bus_generic_shutdown.9	Mon Jan 16 19:53:18 2017	(r312308)
+++ projects/clang400-import/share/man/man9/bus_generic_shutdown.9	Mon Jan 16 19:56:27 2017	(r312309)
@@ -28,14 +28,14 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd June 16, 1998
+.Dd January 15, 2017
 .Dt BUS_GENERIC_SHUTDOWN 9
 .Os
 .Sh NAME
 .Nm bus_generic_shutdown
 .Nd generic implementation of
 .Dv DEVICE_SHUTDOWN
-for busses
+for buses
 .Sh SYNOPSIS
 .In sys/param.h
 .In sys/bus.h

Modified: projects/clang400-import/share/man/man9/bus_space.9
==============================================================================
--- projects/clang400-import/share/man/man9/bus_space.9	Mon Jan 16 19:53:18 2017	(r312308)
+++ projects/clang400-import/share/man/man9/bus_space.9	Mon Jan 16 19:56:27 2017	(r312309)
@@ -51,7 +51,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd June 13, 2005
+.Dd January 15, 2017
 .Dt BUS_SPACE 9
 .Os
 .Sh NAME
@@ -601,7 +601,7 @@ of devices on different system architect
 object file to manipulate a set of devices on multiple bus types on a
 single architecture.
 .Pp
-Not all busses have to implement all functions described in this
+Not all buses have to implement all functions described in this
 document, though that is encouraged if the operations are logically
 supported by the bus.
 Unimplemented functions should cause
@@ -625,7 +625,7 @@ machine-dependent code.
 A given machine may have several different types
 of bus space (e.g.\& memory space and I/O space), and thus may provide
 multiple different bus space tags.
-Individual busses or devices on a machine may use more than one bus space
+Individual buses or devices on a machine may use more than one bus space
 tag.
 For instance, ISA devices are
 given an ISA memory space tag and an ISA I/O space tag.
@@ -639,7 +639,7 @@ The
 bus address describes the start of the range in bus space.
 The bus
 size describes the size of the range in bytes.
-Busses which are not byte
+Buses which are not byte
 addressable may require use of bus space ranges with appropriately
 aligned addresses and properly rounded sizes.
 .Pp
@@ -656,7 +656,7 @@ argument, at least one handle argument, 
 The bus space tag specifies the space, each handle specifies a region in
 the space, and each offset specifies the offset into the region of the
 actual location(s) to be accessed.
-Offsets are given in bytes, though busses
+Offsets are given in bytes, though buses
 may impose alignment constraints.
 The offset used to access data
 relative to a given handle must be such that all of the data being
@@ -1049,7 +1049,7 @@ The
 and
 .Fn bus_space_write_N
 families of functions provide
-the ability to read and write 1, 2, 4, and 8 byte data items on busses
+the ability to read and write 1, 2, 4, and 8 byte data items on buses
 which support those access sizes.
 .Ss Fn bus_space_read_1 space handle offset
 .Ss Fn bus_space_read_2 space handle offset

Modified: projects/clang400-import/share/man/man9/device.9
==============================================================================
--- projects/clang400-import/share/man/man9/device.9	Mon Jan 16 19:53:18 2017	(r312308)
+++ projects/clang400-import/share/man/man9/device.9	Mon Jan 16 19:56:27 2017	(r312309)
@@ -28,7 +28,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd June 16, 1998
+.Dd January 15, 2017
 .Dt DEVICE 9
 .Os
 .Sh NAME
@@ -44,7 +44,7 @@ The system defines one device,
 .Va root_bus
 and all other devices are created dynamically during
 autoconfiguration.
-Normally devices representing top-level busses in
+Normally devices representing top-level buses in
 the system (ISA, PCI etc.) will be attached directly to
 .Va root_bus
 and other devices will be added as children of their relevant bus.

Modified: projects/clang400-import/share/man/man9/device_add_child.9
==============================================================================
--- projects/clang400-import/share/man/man9/device_add_child.9	Mon Jan 16 19:53:18 2017	(r312308)
+++ projects/clang400-import/share/man/man9/device_add_child.9	Mon Jan 16 19:56:27 2017	(r312309)
@@ -28,7 +28,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd October 28, 2015
+.Dd January 15, 2017
 .Dt DEVICE_ADD_CHILD 9
 .Os
 .Sh NAME
@@ -63,10 +63,10 @@ If no name is given then all drivers for
 In any event, only the name of the device is stored so that one may
 safely unload/load a driver bound to that name.
 .Pp
-This allows busses which can uniquely identify device instances (such
+This allows buses which can uniquely identify device instances (such
 as PCI) to allow each driver to check each device instance for a
 match.
-For busses which rely on supplied probe hints where only one
+For buses which rely on supplied probe hints where only one
 driver can have a chance of probing the device, the driver name should
 be specified as the device name.
 .Pp

Modified: projects/clang400-import/share/man/man9/pci.9
==============================================================================
--- projects/clang400-import/share/man/man9/pci.9	Mon Jan 16 19:53:18 2017	(r312308)
+++ projects/clang400-import/share/man/man9/pci.9	Mon Jan 16 19:56:27 2017	(r312309)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd September 6, 2016
+.Dd January 15, 2017
 .Dt PCI 9
 .Os
 .Sh NAME
@@ -583,14 +583,14 @@ full functionality to the user.
 .It Dv PCI_POWERSTATE_D1
 Class-specific low-power state in which device context may or
 may not be lost.
-Busses in this state cannot do anything to the bus, to
+Buses in this state cannot do anything to the bus, to
 force devices to lose context.
 .It Dv PCI_POWERSTATE_D2
 Class-specific low-power state in which device context may or
 may not be lost.
 Attains greater power savings than
 .Dv PCI_POWERSTATE_D1 .
-Busses in this state can cause devices to lose some context.
+Buses in this state can cause devices to lose some context.
 Devices
 .Em must
 be prepared for the bus to be in this state or higher.

Modified: projects/clang400-import/share/skel/dot.shrc
==============================================================================
--- projects/clang400-import/share/skel/dot.shrc	Mon Jan 16 19:53:18 2017	(r312308)
+++ projects/clang400-import/share/skel/dot.shrc	Mon Jan 16 19:56:27 2017	(r312309)
@@ -13,10 +13,6 @@
 #
 # umask	022
 
-# Enable the builtin emacs(1) command line editor in sh(1),
-# e.g. C-a -> beginning-of-line.
-set -o emacs
-
 # Uncomment this and comment the above to enable the builtin vi(1) command
 # line editor in sh(1), e.g. ESC to go into visual mode.
 # set -o vi

Modified: projects/clang400-import/sys/amd64/vmm/vmm_host.h
==============================================================================
--- projects/clang400-import/sys/amd64/vmm/vmm_host.h	Mon Jan 16 19:53:18 2017	(r312308)
+++ projects/clang400-import/sys/amd64/vmm/vmm_host.h	Mon Jan 16 19:56:27 2017	(r312309)
@@ -30,7 +30,7 @@
 #define	_VMM_HOST_H_
 
 #ifndef	_KERNEL
-#error "no user-servicable parts inside"
+#error "no user-serviceable parts inside"
 #endif
 
 struct xsave_limits {

Modified: projects/clang400-import/sys/arm/arm/bus_space_asm_generic.S
==============================================================================
--- projects/clang400-import/sys/arm/arm/bus_space_asm_generic.S	Mon Jan 16 19:53:18 2017	(r312308)
+++ projects/clang400-import/sys/arm/arm/bus_space_asm_generic.S	Mon Jan 16 19:56:27 2017	(r312309)
@@ -36,7 +36,6 @@
  */
 
 #include <machine/asm.h>
-#include <machine/cpuconf.h>
 __FBSDID("$FreeBSD$");
 
 /*

Modified: projects/clang400-import/sys/arm/arm/cpufunc.c
==============================================================================
--- projects/clang400-import/sys/arm/arm/cpufunc.c	Mon Jan 16 19:53:18 2017	(r312308)
+++ projects/clang400-import/sys/arm/arm/cpufunc.c	Mon Jan 16 19:56:27 2017	(r312309)
@@ -57,7 +57,6 @@ __FBSDID("$FreeBSD$");
 #include <vm/pmap.h>
 #include <vm/uma.h>
 
-#include <machine/cpuconf.h>
 #include <machine/cpufunc.h>
 
 #if defined(CPU_XSCALE_81342)

Modified: projects/clang400-import/sys/arm/arm/identcpu-v4.c
==============================================================================
--- projects/clang400-import/sys/arm/arm/identcpu-v4.c	Mon Jan 16 19:53:18 2017	(r312308)
+++ projects/clang400-import/sys/arm/arm/identcpu-v4.c	Mon Jan 16 19:56:27 2017	(r312309)
@@ -51,7 +51,6 @@ __FBSDID("$FreeBSD$");
 #include <machine/cpu.h>
 #include <machine/endian.h>
 
-#include <machine/cpuconf.h>
 #include <machine/md_var.h>
 
 char machine[] = "arm";

Modified: projects/clang400-import/sys/arm/arm/locore-v4.S
==============================================================================
--- projects/clang400-import/sys/arm/arm/locore-v4.S	Mon Jan 16 19:53:18 2017	(r312308)
+++ projects/clang400-import/sys/arm/arm/locore-v4.S	Mon Jan 16 19:56:27 2017	(r312309)
@@ -37,7 +37,6 @@
 #include <sys/syscall.h>
 #include <machine/asm.h>
 #include <machine/armreg.h>
-#include <machine/cpuconf.h>
 #include <machine/pte-v4.h>
 
 __FBSDID("$FreeBSD$");

Modified: projects/clang400-import/sys/arm/arm/locore-v6.S
==============================================================================
--- projects/clang400-import/sys/arm/arm/locore-v6.S	Mon Jan 16 19:53:18 2017	(r312308)
+++ projects/clang400-import/sys/arm/arm/locore-v6.S	Mon Jan 16 19:56:27 2017	(r312309)
@@ -34,7 +34,6 @@
 #include <machine/asmacros.h>
 #include <machine/armreg.h>
 #include <machine/sysreg.h>
-#include <machine/cpuconf.h>
 #include <machine/pte-v6.h>
 
 __FBSDID("$FreeBSD$");

Modified: projects/clang400-import/sys/arm/arm/ofw_machdep.c
==============================================================================
--- projects/clang400-import/sys/arm/arm/ofw_machdep.c	Mon Jan 16 19:53:18 2017	(r312308)
+++ projects/clang400-import/sys/arm/arm/ofw_machdep.c	Mon Jan 16 19:56:27 2017	(r312309)
@@ -50,7 +50,7 @@ OF_decode_addr(phandle_t dev, int regno,
 		return (res);
 
 	/*
-	 * Nothing special to do for PCI busses right now.
+	 * Nothing special to do for PCI buses right now.
 	 * This may need to be handled per-platform when it does come up.
 	 */
 #ifdef notyet

Modified: projects/clang400-import/sys/arm/arm/trap-v4.c
==============================================================================
--- projects/clang400-import/sys/arm/arm/trap-v4.c	Mon Jan 16 19:53:18 2017	(r312308)
+++ projects/clang400-import/sys/arm/arm/trap-v4.c	Mon Jan 16 19:56:27 2017	(r312309)
@@ -139,11 +139,7 @@ static const struct data_abort data_abor
 	{dab_align,	"Alignment Fault 3"},
 	{dab_buserr,	"External Linefetch Abort (S)"},
 	{NULL,		"Translation Fault (S)"},
-#if (ARM_MMU_V6 + ARM_MMU_V7) != 0
-	{NULL,		"Translation Flag Fault"},
-#else
 	{dab_buserr,	"External Linefetch Abort (P)"},
-#endif
 	{NULL,		"Translation Fault (P)"},
 	{dab_buserr,	"External Non-Linefetch Abort (S)"},
 	{NULL,		"Domain Fault (S)"},

Modified: projects/clang400-import/sys/arm/freescale/imx/imx6_ccm.c
==============================================================================
--- projects/clang400-import/sys/arm/freescale/imx/imx6_ccm.c	Mon Jan 16 19:53:18 2017	(r312308)
+++ projects/clang400-import/sys/arm/freescale/imx/imx6_ccm.c	Mon Jan 16 19:56:27 2017	(r312309)
@@ -90,7 +90,7 @@ ccm_init_gates(struct ccm_softc *sc)
 {
 	uint32_t reg;
 
- 	/* ahpbdma, aipstz 1 & 2 busses */
+ 	/* ahpbdma, aipstz 1 & 2 buses */
 	reg = CCGR0_AIPS_TZ1 | CCGR0_AIPS_TZ2 | CCGR0_ABPHDMA;
 	WR4(sc, CCM_CCGR0, reg);
 

Modified: projects/clang400-import/sys/arm/freescale/imx/imx6_machdep.c
==============================================================================
--- projects/clang400-import/sys/arm/freescale/imx/imx6_machdep.c	Mon Jan 16 19:53:18 2017	(r312308)
+++ projects/clang400-import/sys/arm/freescale/imx/imx6_machdep.c	Mon Jan 16 19:56:27 2017	(r312309)
@@ -117,7 +117,7 @@ fdt_pic_decode_t fdt_pic_table[] = {
  *  - GIC node exists and is its own interrupt parent.
  *
  * This applies to all models of imx6.  Luckily all of them have the devices
- * involved at the same addresses on the same busses, so we don't need any
+ * involved at the same addresses on the same buses, so we don't need any
  * per-soc logic.  We handle this at platform attach time rather than via the
  * fdt_fixup_table, because the latter requires matching on the FDT "model"
  * property, and this applies to all boards including those not yet invented.

Modified: projects/clang400-import/sys/arm/freescale/imx/imx_i2c.c
==============================================================================
--- projects/clang400-import/sys/arm/freescale/imx/imx_i2c.c	Mon Jan 16 19:53:18 2017	(r312308)
+++ projects/clang400-import/sys/arm/freescale/imx/imx_i2c.c	Mon Jan 16 19:56:27 2017	(r312309)
@@ -35,7 +35,7 @@
  * Note that the hardware is capable of running as both a master and a slave.
  * This driver currently implements only master-mode operations.
  *
- * This driver supports multi-master i2c busses, by detecting bus arbitration
+ * This driver supports multi-master i2c buses, by detecting bus arbitration
  * loss and returning IIC_EBUSBSY status.  Notably, it does not do any kind of
  * retries if some other master jumps onto the bus and interrupts one of our
  * transfer cycles resulting in arbitration loss in mid-transfer.  The caller

Modified: projects/clang400-import/sys/arm/include/atomic.h
==============================================================================
--- projects/clang400-import/sys/arm/include/atomic.h	Mon Jan 16 19:53:18 2017	(r312308)
+++ projects/clang400-import/sys/arm/include/atomic.h	Mon Jan 16 19:56:27 2017	(r312309)
@@ -44,8 +44,6 @@
 
 #ifndef _KERNEL
 #include <machine/sysarch.h>
-#else
-#include <machine/cpuconf.h>
 #endif
 
 #if __ARM_ARCH >= 6

Modified: projects/clang400-import/sys/arm/include/cpufunc.h
==============================================================================
--- projects/clang400-import/sys/arm/include/cpufunc.h	Mon Jan 16 19:53:18 2017	(r312308)
+++ projects/clang400-import/sys/arm/include/cpufunc.h	Mon Jan 16 19:56:27 2017	(r312309)
@@ -48,7 +48,6 @@
 
 #include <sys/types.h>
 #include <machine/armreg.h>
-#include <machine/cpuconf.h>
 
 static __inline void
 breakpoint(void)

Modified: projects/clang400-import/sys/arm/include/pcpu.h
==============================================================================
--- projects/clang400-import/sys/arm/include/pcpu.h	Mon Jan 16 19:53:18 2017	(r312308)
+++ projects/clang400-import/sys/arm/include/pcpu.h	Mon Jan 16 19:56:27 2017	(r312309)
@@ -32,8 +32,6 @@
 
 #ifdef _KERNEL
 
-#include <machine/cpuconf.h>
-
 #define	ALT_STACK_SIZE	128
 
 struct vmspace;

Modified: projects/clang400-import/sys/arm/include/pmap-v4.h
==============================================================================
--- projects/clang400-import/sys/arm/include/pmap-v4.h	Mon Jan 16 19:53:18 2017	(r312308)
+++ projects/clang400-import/sys/arm/include/pmap-v4.h	Mon Jan 16 19:56:27 2017	(r312309)
@@ -51,7 +51,30 @@
 #define _MACHINE_PMAP_V4_H_
 
 #include <machine/pte-v4.h>
-#include <machine/cpuconf.h>
+
+/*
+ * Define the MMU types we support based on the cpu types.  While the code has
+ * some theoretical support for multiple MMU types in a single kernel, there are
+ * no actual working configurations that use that feature.
+ */
+#if (defined(CPU_ARM9) || defined(CPU_ARM9E) ||	defined(CPU_FA526))
+#define	ARM_MMU_GENERIC		1
+#else
+#define	ARM_MMU_GENERIC		0
+#endif
+
+#if (defined(CPU_XSCALE_PXA2X0) || defined(CPU_XSCALE_IXP425) ||	\
+     defined(CPU_XSCALE_81342))
+#define	ARM_MMU_XSCALE		1
+#else
+#define	ARM_MMU_XSCALE		0
+#endif
+
+#define	ARM_NMMUS		(ARM_MMU_GENERIC + ARM_MMU_XSCALE)
+#if ARM_NMMUS == 0 && !defined(KLD_MODULE) && defined(_KERNEL)
+#error ARM_NMMUS is 0
+#endif
+
 /*
  * Pte related macros
  */

Modified: projects/clang400-import/sys/arm/mv/mv_pci.c
==============================================================================
--- projects/clang400-import/sys/arm/mv/mv_pci.c	Mon Jan 16 19:53:18 2017	(r312308)
+++ projects/clang400-import/sys/arm/mv/mv_pci.c	Mon Jan 16 19:56:27 2017	(r312309)
@@ -147,7 +147,7 @@ mv_pci_ranges_decode(phandle_t node, str
 	/*
 	 * Initialize the ranges so that we don't have to worry about
 	 * having them all defined in the FDT. In particular, it is
-	 * perfectly fine not to want I/O space on PCI busses.
+	 * perfectly fine not to want I/O space on PCI buses.
 	 */
 	bzero(io_space, sizeof(*io_space));
 	bzero(mem_space, sizeof(*mem_space));

Modified: projects/clang400-import/sys/boot/efi/loader/main.c
==============================================================================
--- projects/clang400-import/sys/boot/efi/loader/main.c	Mon Jan 16 19:53:18 2017	(r312308)
+++ projects/clang400-import/sys/boot/efi/loader/main.c	Mon Jan 16 19:56:27 2017	(r312309)
@@ -219,20 +219,19 @@ find_currdev(EFI_LOADED_IMAGE *img, stru
 		if (h == NULL)
 			break;
 
-		if (efi_handle_lookup(h, dev, unit, extra) == 0) {
-			if (copy != NULL)
-				free(copy);
+		free(copy);
+		copy = NULL;
+
+		if (efi_handle_lookup(h, dev, unit, extra) == 0)
 			return (0);
-		}
 
-		if (copy != NULL)
-			free(copy);
 		devpath = efi_lookup_devpath(h);
 		if (devpath != NULL) {
 			copy = efi_devpath_trim(devpath);
 			devpath = copy;
 		}
 	}
+	free(copy);
 
 	/* Try to fallback on first device */
 	if (devsw[0] != NULL) {

Modified: projects/clang400-import/sys/cam/cam_compat.h
==============================================================================
--- projects/clang400-import/sys/cam/cam_compat.h	Mon Jan 16 19:53:18 2017	(r312308)
+++ projects/clang400-import/sys/cam/cam_compat.h	Mon Jan 16 19:56:27 2017	(r312309)
@@ -31,7 +31,7 @@
 #ifndef _CAM_CAM_COMPAT_H
 #define _CAM_CAM_COMPAT_H
 
-/* No user-servicable parts in here. */
+/* No user-serviceable parts in here. */
 #ifdef _KERNEL
 
 int cam_compat_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flag,

Modified: projects/clang400-import/sys/cam/cam_iosched.h
==============================================================================
--- projects/clang400-import/sys/cam/cam_iosched.h	Mon Jan 16 19:53:18 2017	(r312308)
+++ projects/clang400-import/sys/cam/cam_iosched.h	Mon Jan 16 19:56:27 2017	(r312309)
@@ -31,7 +31,7 @@
 #ifndef _CAM_CAM_IOSCHED_H
 #define _CAM_CAM_IOSCHED_H
 
-/* No user-servicable parts in here. */
+/* No user-serviceable parts in here. */
 #ifdef _KERNEL
 
 /* Forward declare all structs to keep interface thin */

Modified: projects/clang400-import/sys/cam/cam_xpt.c
==============================================================================
--- projects/clang400-import/sys/cam/cam_xpt.c	Mon Jan 16 19:53:18 2017	(r312308)
+++ projects/clang400-import/sys/cam/cam_xpt.c	Mon Jan 16 19:56:27 2017	(r312309)
@@ -106,7 +106,12 @@ struct xpt_softc {
 	int buses_to_config;
 	int buses_config_done;
 
-	/* Registered busses */
+	/*
+	 * Registered buses
+	 *
+	 * N.B., "busses" is an archaic spelling of "buses".  In new code
+	 * "buses" is preferred.
+	 */
 	TAILQ_HEAD(,cam_eb)	xpt_busses;
 	u_int			bus_generation;
 
@@ -892,7 +897,7 @@ xpt_init(void *dummy)
 	/*
 	 * The xpt layer is, itself, the equivalent of a SIM.
 	 * Allow 16 ccbs in the ccb pool for it.  This should
-	 * give decent parallelism when we probe busses and
+	 * give decent parallelism when we probe buses and
 	 * perform other XPT functions.
 	 */
 	devq = cam_simq_alloc(16);
@@ -1627,7 +1632,7 @@ xptedtbusfunc(struct cam_eb *bus, void *
 	}
 
 	/*
-	 * If the user is only interested in busses, there's no
+	 * If the user is only interested in buses, there's no
 	 * reason to descend to the next level in the tree.

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***

From owner-svn-src-projects@freebsd.org  Mon Jan 16 20:29:29 2017
Return-Path: <owner-svn-src-projects@freebsd.org>
Delivered-To: svn-src-projects@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5EC4BCB3FB0
 for <svn-src-projects@mailman.ysv.freebsd.org>;
 Mon, 16 Jan 2017 20:29:29 +0000 (UTC)
 (envelope-from ngie@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 23FAA1E15;
 Mon, 16 Jan 2017 20:29:29 +0000 (UTC)
 (envelope-from ngie@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0GKTSCi038775;
 Mon, 16 Jan 2017 20:29:28 GMT (envelope-from ngie@FreeBSD.org)
Received: (from ngie@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0GKTSqP038774;
 Mon, 16 Jan 2017 20:29:28 GMT (envelope-from ngie@FreeBSD.org)
Message-Id: <201701162029.v0GKTSqP038774@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: ngie set sender to
 ngie@FreeBSD.org using -f
From: Ngie Cooper <ngie@FreeBSD.org>
Date: Mon, 16 Jan 2017 20:29:28 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject: svn commit: r312310 -
 projects/netbsd-tests-upstream-01-2017/lib/libutil
X-SVN-Group: projects
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-projects@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the src &quot; projects&quot;
 tree" <svn-src-projects.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-projects>, 
 <mailto:svn-src-projects-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-projects/>
List-Post: <mailto:svn-src-projects@freebsd.org>
List-Help: <mailto:svn-src-projects-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-projects>, 
 <mailto:svn-src-projects-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 16 Jan 2017 20:29:29 -0000

Author: ngie
Date: Mon Jan 16 20:29:28 2017
New Revision: 312310
URL: https://svnweb.freebsd.org/changeset/base/312310

Log:
  Clarify #includes for hexdump vs sbuf_hexdump

Modified:
  projects/netbsd-tests-upstream-01-2017/lib/libutil/hexdump.3

Modified: projects/netbsd-tests-upstream-01-2017/lib/libutil/hexdump.3
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/lib/libutil/hexdump.3	Mon Jan 16 19:56:27 2017	(r312309)
+++ projects/netbsd-tests-upstream-01-2017/lib/libutil/hexdump.3	Mon Jan 16 20:29:28 2017	(r312310)
@@ -28,7 +28,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd May 8, 2014
+.Dd January 16, 2017
 .Dt HEXDUMP 3
 .Os
 .Sh NAME
@@ -36,9 +36,10 @@
 .Nd "dump a block of bytes to standard out in hexadecimal form"
 .Sh SYNOPSIS
 .In libutil.h
-.In sys/sbuf.h
 .Ft void
 .Fn hexdump "void *ptr" "int length" "const char *hdr" "int flags"
+.In libutil.h
+.In sys/sbuf.h
 .Ft void
 .Fo sbuf_hexdump
 .Fa "struct sbuf *sb"

From owner-svn-src-projects@freebsd.org  Mon Jan 16 20:43:31 2017
Return-Path: <owner-svn-src-projects@freebsd.org>
Delivered-To: svn-src-projects@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7242FCB2934
 for <svn-src-projects@mailman.ysv.freebsd.org>;
 Mon, 16 Jan 2017 20:43:31 +0000 (UTC)
 (envelope-from ngie@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 3F49F1CBC;
 Mon, 16 Jan 2017 20:43:31 +0000 (UTC)
 (envelope-from ngie@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0GKhUjo046750;
 Mon, 16 Jan 2017 20:43:30 GMT (envelope-from ngie@FreeBSD.org)
Received: (from ngie@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0GKhUX7046749;
 Mon, 16 Jan 2017 20:43:30 GMT (envelope-from ngie@FreeBSD.org)
Message-Id: <201701162043.v0GKhUX7046749@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: ngie set sender to
 ngie@FreeBSD.org using -f
From: Ngie Cooper <ngie@FreeBSD.org>
Date: Mon, 16 Jan 2017 20:43:30 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject: svn commit: r312312 -
 projects/netbsd-tests-upstream-01-2017/lib/libnetbsd
X-SVN-Group: projects
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-projects@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the src &quot; projects&quot;
 tree" <svn-src-projects.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-projects>, 
 <mailto:svn-src-projects-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-projects/>
List-Post: <mailto:svn-src-projects@freebsd.org>
List-Help: <mailto:svn-src-projects-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-projects>, 
 <mailto:svn-src-projects-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 16 Jan 2017 20:43:31 -0000

Author: ngie
Date: Mon Jan 16 20:43:30 2017
New Revision: 312312
URL: https://svnweb.freebsd.org/changeset/base/312312

Log:
  Remove util.h (libutil.h) pollution from stdio.h compat header
  
  Introducing libutil.h causes grief later because hexdump(3) in FreeBSD
  and contrib/netbsd-tests/lib/libc/db/h_hash.c conflict.
  
  I'm working adapting h_hash.c, but for now, unbreak the build in the
  easiest way possible.

Modified:
  projects/netbsd-tests-upstream-01-2017/lib/libnetbsd/stdio.h

Modified: projects/netbsd-tests-upstream-01-2017/lib/libnetbsd/stdio.h
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/lib/libnetbsd/stdio.h	Mon Jan 16 20:34:42 2017	(r312311)
+++ projects/netbsd-tests-upstream-01-2017/lib/libnetbsd/stdio.h	Mon Jan 16 20:43:30 2017	(r312312)
@@ -32,6 +32,4 @@
 
 #include_next <stdio.h>
 
-#include "util.h"
-
 #endif /* _SHA1_H_ */

From owner-svn-src-projects@freebsd.org  Mon Jan 16 20:46:42 2017
Return-Path: <owner-svn-src-projects@freebsd.org>
Delivered-To: svn-src-projects@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 338CCCB296A
 for <svn-src-projects@mailman.ysv.freebsd.org>;
 Mon, 16 Jan 2017 20:46:42 +0000 (UTC)
 (envelope-from ngie@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 050B11E26;
 Mon, 16 Jan 2017 20:46:41 +0000 (UTC)
 (envelope-from ngie@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0GKkfHb046921;
 Mon, 16 Jan 2017 20:46:41 GMT (envelope-from ngie@FreeBSD.org)
Received: (from ngie@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0GKkfV6046919;
 Mon, 16 Jan 2017 20:46:41 GMT (envelope-from ngie@FreeBSD.org)
Message-Id: <201701162046.v0GKkfV6046919@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: ngie set sender to
 ngie@FreeBSD.org using -f
From: Ngie Cooper <ngie@FreeBSD.org>
Date: Mon, 16 Jan 2017 20:46:41 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject: svn commit: r312313 -
 projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/stdlib
X-SVN-Group: projects
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-projects@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the src &quot; projects&quot;
 tree" <svn-src-projects.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-projects>, 
 <mailto:svn-src-projects-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-projects/>
List-Post: <mailto:svn-src-projects@freebsd.org>
List-Help: <mailto:svn-src-projects-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-projects>, 
 <mailto:svn-src-projects-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 16 Jan 2017 20:46:42 -0000

Author: ngie
Date: Mon Jan 16 20:46:40 2017
New Revision: 312313
URL: https://svnweb.freebsd.org/changeset/base/312313

Log:
  Reintroduce libutil.h #include for FreeBSD only for fparseln

Modified:
  projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/stdlib/h_getopt.c
  projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/stdlib/h_getopt_long.c

Modified: projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/stdlib/h_getopt.c
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/stdlib/h_getopt.c	Mon Jan 16 20:43:30 2017	(r312312)
+++ projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/stdlib/h_getopt.c	Mon Jan 16 20:46:40 2017	(r312313)
@@ -34,6 +34,13 @@
 #include <stdlib.h>
 #include <unistd.h>
 #include <err.h>
+#ifdef __FreeBSD__
+/*
+ * Needed to avoid libutil.h pollution in stdio.h, which causes grief with
+ * with hexdump(3) in lib/libc/db/h_hash.c
+ */
+#include <libutil.h>
+#endif
 
 #define	WS	"\t\n "
 #define	debug	0

Modified: projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/stdlib/h_getopt_long.c
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/stdlib/h_getopt_long.c	Mon Jan 16 20:43:30 2017	(r312312)
+++ projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/stdlib/h_getopt_long.c	Mon Jan 16 20:46:40 2017	(r312313)
@@ -36,6 +36,13 @@
 #include <string.h>
 #include <stdlib.h>
 #include <unistd.h>
+#ifdef __FreeBSD__
+/*
+ * Needed to avoid libutil.h pollution in stdio.h, which causes grief with
+ * with hexdump(3) in lib/libc/db/h_hash.c
+ */
+#include <libutil.h>
+#endif
 
 #define SKIPWS(p)	while (isspace((int)(*p))) p++
 #define	WS	"\t\n "

From owner-svn-src-projects@freebsd.org  Tue Jan 17 12:43:57 2017
Return-Path: <owner-svn-src-projects@freebsd.org>
Delivered-To: svn-src-projects@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1C8BACB2C6D
 for <svn-src-projects@mailman.ysv.freebsd.org>;
 Tue, 17 Jan 2017 12:43:57 +0000 (UTC) (envelope-from ae@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id C6C14179B;
 Tue, 17 Jan 2017 12:43:56 +0000 (UTC) (envelope-from ae@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0HChtEH040910;
 Tue, 17 Jan 2017 12:43:55 GMT (envelope-from ae@FreeBSD.org)
Received: (from ae@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0HChtBl040909;
 Tue, 17 Jan 2017 12:43:55 GMT (envelope-from ae@FreeBSD.org)
Message-Id: <201701171243.v0HChtBl040909@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org
 using -f
From: "Andrey V. Elsukov" <ae@FreeBSD.org>
Date: Tue, 17 Jan 2017 12:43:55 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject: svn commit: r312342 - projects/ipsec/sys/netipsec
X-SVN-Group: projects
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-projects@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the src &quot; projects&quot;
 tree" <svn-src-projects.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-projects>, 
 <mailto:svn-src-projects-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-projects/>
List-Post: <mailto:svn-src-projects@freebsd.org>
List-Help: <mailto:svn-src-projects-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-projects>, 
 <mailto:svn-src-projects-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 17 Jan 2017 12:43:57 -0000

Author: ae
Date: Tue Jan 17 12:43:55 2017
New Revision: 312342
URL: https://svnweb.freebsd.org/changeset/base/312342

Log:
  RFC2367 doesn't allow update anything but state and lifetimes for SAs in
  MATURE state.
  
  Do not require presence of SADB_EXT_KEY_ENCRYPT and SADB_EXT_KEY_AUTH
  in the general checks for SADB_UPDATE message. They only required for
  MATURE SAs. For LARVAL SAs on the contrary these headers are not allowed.

Modified:
  projects/ipsec/sys/netipsec/key.c

Modified: projects/ipsec/sys/netipsec/key.c
==============================================================================
--- projects/ipsec/sys/netipsec/key.c	Tue Jan 17 10:50:28 2017	(r312341)
+++ projects/ipsec/sys/netipsec/key.c	Tue Jan 17 12:43:55 2017	(r312342)
@@ -4968,12 +4968,6 @@ key_update(struct socket *so, struct mbu
 	if (SADB_CHECKHDR(mhp, SADB_EXT_SA) ||
 	    SADB_CHECKHDR(mhp, SADB_EXT_ADDRESS_SRC) ||
 	    SADB_CHECKHDR(mhp, SADB_EXT_ADDRESS_DST) ||
-	    (mhp->msg->sadb_msg_satype == SADB_SATYPE_ESP && (
-		SADB_CHECKHDR(mhp, SADB_EXT_KEY_ENCRYPT) ||
-		SADB_CHECKLEN(mhp, SADB_EXT_KEY_ENCRYPT))) ||
-	    (mhp->msg->sadb_msg_satype == SADB_SATYPE_AH && (
-		SADB_CHECKHDR(mhp, SADB_EXT_KEY_AUTH) ||
-		SADB_CHECKLEN(mhp, SADB_EXT_KEY_AUTH))) ||
 	    (SADB_CHECKHDR(mhp, SADB_EXT_LIFETIME_HARD) &&
 		!SADB_CHECKHDR(mhp, SADB_EXT_LIFETIME_SOFT)) ||
 	    (SADB_CHECKHDR(mhp, SADB_EXT_LIFETIME_SOFT) &&
@@ -5053,6 +5047,16 @@ key_update(struct socket *so, struct mbu
 	}
 
 	if (sav->state == SADB_SASTATE_LARVAL) {
+		if ((mhp->msg->sadb_msg_satype == SADB_SATYPE_ESP &&
+		    SADB_CHECKHDR(mhp, SADB_EXT_KEY_ENCRYPT)) ||
+		    (mhp->msg->sadb_msg_satype == SADB_SATYPE_AH &&
+		    SADB_CHECKHDR(mhp, SADB_EXT_KEY_AUTH))) {
+			ipseclog((LOG_DEBUG,
+			    "%s: invalid message: missing required header.\n",
+			    __func__));
+			key_freesav(&sav);
+			return key_senderror(so, m, EINVAL);
+		}
 		/*
 		 * We can set any values except src, dst and SPI.
 		 */

From owner-svn-src-projects@freebsd.org  Tue Jan 17 12:58:15 2017
Return-Path: <owner-svn-src-projects@freebsd.org>
Delivered-To: svn-src-projects@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id E7889CB307F
 for <svn-src-projects@mailman.ysv.freebsd.org>;
 Tue, 17 Jan 2017 12:58:15 +0000 (UTC)
 (envelope-from bu7cher@yandex.ru)
Received: from forward3j.cmail.yandex.net (forward3j.cmail.yandex.net
 [IPv6:2a02:6b8:0:1630::16])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "forwards.mail.yandex.net", Issuer "Yandex CA" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id A04051F07;
 Tue, 17 Jan 2017 12:58:15 +0000 (UTC)
 (envelope-from bu7cher@yandex.ru)
Received: from smtp3m.mail.yandex.net (smtp3m.mail.yandex.net [77.88.61.130])
 by forward3j.cmail.yandex.net (Yandex) with ESMTP id 6B15D20D90;
 Tue, 17 Jan 2017 15:58:11 +0300 (MSK)
Received: from smtp3m.mail.yandex.net (localhost.localdomain [127.0.0.1])
 by smtp3m.mail.yandex.net (Yandex) with ESMTP id B65412840EFA;
 Tue, 17 Jan 2017 15:58:08 +0300 (MSK)
Received: by smtp3m.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id
 7lp7xhiSFg-w7OOmYXL; Tue, 17 Jan 2017 15:58:07 +0300
 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
 (Client certificate not present)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail;
 t=1484657888; bh=YUKK7jEbb2s+0xYAOCQYMBZIopAqieIdqDUYhbQfzcA=;
 h=Subject:To:References:From:Message-ID:Date:In-Reply-To;
 b=g6I4cmcocKwmqQl+LUfy/UVsxelIQBAqYELj4mbR5pI0WekO3HV4gog5GzAE5lj5F
 T1E2re3E1w2RzDfKRtILONzwN0kIB/uezIVCi2lPicejTShInkCa4Fnrn3lMTG8GRB
 YframUQY68QPmAGFCBE4B+Np9u8Pm1d2Smd61efQ=
Authentication-Results: smtp3m.mail.yandex.net; dkim=pass header.i=@yandex.ru
X-Yandex-Suid-Status: 1 0,1 0
Subject: Re: svn commit: r312342 - projects/ipsec/sys/netipsec
To: src-committers@freebsd.org, svn-src-projects@freebsd.org
References: <201701171243.v0HChtBl040909@repo.freebsd.org>
From: "Andrey V. Elsukov" <bu7cher@yandex.ru>
Message-ID: <10fa0a2f-2e78-e5c0-a657-28265c5e31c3@yandex.ru>
Date: Tue, 17 Jan 2017 15:57:15 +0300
User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101
 Thunderbird/45.5.1
MIME-Version: 1.0
In-Reply-To: <201701171243.v0HChtBl040909@repo.freebsd.org>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
X-BeenThere: svn-src-projects@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the src &quot; projects&quot;
 tree" <svn-src-projects.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-projects>, 
 <mailto:svn-src-projects-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-projects/>
List-Post: <mailto:svn-src-projects@freebsd.org>
List-Help: <mailto:svn-src-projects-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-projects>, 
 <mailto:svn-src-projects-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 17 Jan 2017 12:58:16 -0000

On 17.01.2017 15:43, Andrey V. Elsukov wrote:
> Author: ae
> Date: Tue Jan 17 12:43:55 2017
> New Revision: 312342
> URL: https://svnweb.freebsd.org/changeset/base/312342
>
> Log:
>   RFC2367 doesn't allow update anything but state and lifetimes for SAs in
>   MATURE state.
>
>   Do not require presence of SADB_EXT_KEY_ENCRYPT and SADB_EXT_KEY_AUTH
>   in the general checks for SADB_UPDATE message. They only required for
>   MATURE SAs. For LARVAL SAs on the contrary these headers are not allowed.

This should be:

 > They only required for LARVAL SAs. For MATURE SAs on the contrary 
these headers are not allowed.

-- 
WBR, Andrey V. Elsukov

From owner-svn-src-projects@freebsd.org  Tue Jan 17 16:20:22 2017
Return-Path: <owner-svn-src-projects@freebsd.org>
Delivered-To: svn-src-projects@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 68BC8CB408B
 for <svn-src-projects@mailman.ysv.freebsd.org>;
 Tue, 17 Jan 2017 16:20:22 +0000 (UTC) (envelope-from ae@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 436011E8A;
 Tue, 17 Jan 2017 16:20:22 +0000 (UTC) (envelope-from ae@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0HGKLM1027609;
 Tue, 17 Jan 2017 16:20:21 GMT (envelope-from ae@FreeBSD.org)
Received: (from ae@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0HGKL89027607;
 Tue, 17 Jan 2017 16:20:21 GMT (envelope-from ae@FreeBSD.org)
Message-Id: <201701171620.v0HGKL89027607@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org
 using -f
From: "Andrey V. Elsukov" <ae@FreeBSD.org>
Date: Tue, 17 Jan 2017 16:20:21 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject: svn commit: r312345 - projects/ipsec/sys/netipsec
X-SVN-Group: projects
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-projects@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the src &quot; projects&quot;
 tree" <svn-src-projects.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-projects>, 
 <mailto:svn-src-projects-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-projects/>
List-Post: <mailto:svn-src-projects@freebsd.org>
List-Help: <mailto:svn-src-projects-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-projects>, 
 <mailto:svn-src-projects-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 17 Jan 2017 16:20:22 -0000

Author: ae
Date: Tue Jan 17 16:20:21 2017
New Revision: 312345
URL: https://svnweb.freebsd.org/changeset/base/312345

Log:
  Make the kernel smarter with regards to natt_cksum_policy sysctl variable.
  
  Now natt_cksum_policy variable controls only two behaviors:
  0 - automatically handle checksums, and any other value - fully recompute
  checksums. When checksums are handled automatically and if IKEd has
  specified original IP addresses (i.e. checksum delta is known), checksums
  will be computed incrementally. If IKEd didn't configured original
  addresses, UDP checksums will be reset to zero and TCP checksums will be
  ignored. When natt_cksum_policy isn't zero, checksums will be always
  fully recomputed.
  
  This allows to have NAT-T support for transport mode out of the box without
  any configuration from the user side.

Modified:
  projects/ipsec/sys/netipsec/ipsec.c
  projects/ipsec/sys/netipsec/udpencap.c

Modified: projects/ipsec/sys/netipsec/ipsec.c
==============================================================================
--- projects/ipsec/sys/netipsec/ipsec.c	Tue Jan 17 14:52:48 2017	(r312344)
+++ projects/ipsec/sys/netipsec/ipsec.c	Tue Jan 17 16:20:21 2017	(r312345)
@@ -152,9 +152,10 @@ VNET_DEFINE(int, crypto_support) = CRYPT
 /*
  * TCP/UDP checksum handling policy for transport mode NAT-T (RFC3948)
  *
- * 0 - incrementally recompute.
+ * 0 - auto: incrementally recompute, when checksum delta is known;
+ *     if checksum delta isn't known, reset checksum to zero for UDP,
+ *     and mark csum_flags as valid for TCP.
  * 1 - fully recompute TCP/UDP checksum.
- * 2 - for UDP reset checksum to zero; for TCP mark csum_flags as valid.
  */
 VNET_DEFINE(int, natt_cksum_policy) = 0;
 

Modified: projects/ipsec/sys/netipsec/udpencap.c
==============================================================================
--- projects/ipsec/sys/netipsec/udpencap.c	Tue Jan 17 14:52:48 2017	(r312344)
+++ projects/ipsec/sys/netipsec/udpencap.c	Tue Jan 17 16:20:21 2017	(r312345)
@@ -261,14 +261,25 @@ udp_ipsec_adjust_cksum(struct mbuf *m, s
 	else
 		off = offsetof(struct tcphdr, th_sum);
 
-	switch (V_natt_cksum_policy) {
-	case 0:	/* Incrementally recompute. */
-		if (sav->natt->cksum == 0) /* No OA from IKEd */
-			return;
-		m_copydata(m, skip + off, sizeof(cksum), (caddr_t)&cksum);
-		cksum = in_addword(cksum, sav->natt->cksum);
-		break;
-	case 1: /* Fully recompute */
+	if (V_natt_cksum_policy == 0) {	/* auto */
+		if (sav->natt->cksum != 0) {
+			/* Incrementally recompute. */
+			m_copydata(m, skip + off, sizeof(cksum),
+			    (caddr_t)&cksum);
+			cksum = in_addword(cksum, sav->natt->cksum);
+		} else {
+			/* No OA from IKEd. */
+			if (proto == IPPROTO_TCP) {
+				/* Ignore for TCP. */
+				m->m_pkthdr.csum_data = 0xffff;
+				m->m_pkthdr.csum_flags |= (CSUM_DATA_VALID |
+				    CSUM_PSEUDO_HDR);
+				return;
+			}
+			cksum = 0; /* Reset for UDP. */
+		}
+		m_copyback(m, skip + off, sizeof(cksum), (caddr_t)&cksum);
+	} else { /* Fully recompute */
 		ip = mtod(m, struct ip *);
 		cksum = in_pseudo(ip->ip_src.s_addr, ip->ip_dst.s_addr,
 		    htons(m->m_pkthdr.len - skip + proto));
@@ -278,16 +289,6 @@ udp_ipsec_adjust_cksum(struct mbuf *m, s
 		m->m_pkthdr.csum_data = off;
 		in_delayed_cksum(m);
 		m->m_pkthdr.csum_flags &= ~CSUM_DELAY_DATA;
-		return;
-	default:/* Reset for UDP, ignore for TCP */
-		if (proto == IPPROTO_UDP) {
-			cksum = 0;
-			break;
-		}
-		m->m_pkthdr.csum_data = 0xffff;
-		m->m_pkthdr.csum_flags |= (CSUM_DATA_VALID | CSUM_PSEUDO_HDR);
-		return;
 	}
-	m_copyback(m, skip + off, sizeof(cksum), (caddr_t)&cksum);
 }
 

From owner-svn-src-projects@freebsd.org  Wed Jan 18 05:36:11 2017
Return-Path: <owner-svn-src-projects@freebsd.org>
Delivered-To: svn-src-projects@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1CDA9CB326E
 for <svn-src-projects@mailman.ysv.freebsd.org>;
 Wed, 18 Jan 2017 05:36:11 +0000 (UTC)
 (envelope-from ngie@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id DF7F01A86;
 Wed, 18 Jan 2017 05:36:10 +0000 (UTC)
 (envelope-from ngie@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0I5aAER053997;
 Wed, 18 Jan 2017 05:36:10 GMT (envelope-from ngie@FreeBSD.org)
Received: (from ngie@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0I5a9w4053995;
 Wed, 18 Jan 2017 05:36:10 GMT (envelope-from ngie@FreeBSD.org)
Message-Id: <201701180536.v0I5a9w4053995@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: ngie set sender to
 ngie@FreeBSD.org using -f
From: Ngie Cooper <ngie@FreeBSD.org>
Date: Wed, 18 Jan 2017 05:36:09 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject: svn commit: r312372 - in
 projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests:
 kernel/arch/amd64 lib/libpthread
X-SVN-Group: projects
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-projects@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the src &quot; projects&quot;
 tree" <svn-src-projects.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-projects>, 
 <mailto:svn-src-projects-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-projects/>
List-Post: <mailto:svn-src-projects@freebsd.org>
List-Help: <mailto:svn-src-projects-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-projects>, 
 <mailto:svn-src-projects-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Wed, 18 Jan 2017 05:36:11 -0000

Author: ngie
Date: Wed Jan 18 05:36:09 2017
New Revision: 312372
URL: https://svnweb.freebsd.org/changeset/base/312372

Log:
  Merge ^/vendor/NetBSD/tests/dist@r312370

Modified:
  projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/kernel/arch/amd64/t_ptrace_wait.c
  projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libpthread/h_common.h
Directory Properties:
  projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/   (props changed)

Modified: projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/kernel/arch/amd64/t_ptrace_wait.c
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/kernel/arch/amd64/t_ptrace_wait.c	Wed Jan 18 05:35:34 2017	(r312371)
+++ projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/kernel/arch/amd64/t_ptrace_wait.c	Wed Jan 18 05:36:09 2017	(r312372)
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_ptrace_wait.c,v 1.9 2017/01/13 21:30:41 christos Exp $	*/
+/*	$NetBSD: t_ptrace_wait.c,v 1.11 2017/01/18 05:14:34 kamil Exp $	*/
 
 /*-
  * Copyright (c) 2016 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: t_ptrace_wait.c,v 1.9 2017/01/13 21:30:41 christos Exp $");
+__RCSID("$NetBSD: t_ptrace_wait.c,v 1.11 2017/01/18 05:14:34 kamil Exp $");
 
 #include <sys/param.h>
 #include <sys/types.h>
@@ -247,6 +247,7 @@ ATF_TC_BODY(watchpoint_read, tc)
 		printf("struct ptrace {\n");
 		printf("\t.pw_index=%d\n", pw.pw_index);
 		printf("\t.pw_lwpid=%d\n", pw.pw_lwpid);
+		printf("\t.pw_type=%#x\n", pw.pw_type);
 		printf("\t.pw_md.md_address=%p\n", pw.pw_md.md_address);
 		printf("\t.pw_md.md_condition=%#x\n", pw.pw_md.md_condition);
 		printf("\t.pw_md.md_length=%#x\n", pw.pw_md.md_length);
@@ -320,6 +321,7 @@ ATF_TC_BODY(watchpoint_write_unmodified,
 		printf("struct ptrace {\n");
 		printf("\t.pw_index=%d\n", pw.pw_index);
 		printf("\t.pw_lwpid=%d\n", pw.pw_lwpid);
+		printf("\t.pw_type=%#x\n", pw.pw_type);
 		printf("\t.pw_md.md_address=%p\n", pw.pw_md.md_address);
 		printf("\t.pw_md.md_condition=%#x\n", pw.pw_md.md_condition);
 		printf("\t.pw_md.md_length=%#x\n", pw.pw_md.md_length);
@@ -364,6 +366,8 @@ ATF_TC_BODY(watchpoint_trap_code0, tc)
 	struct ptrace_watchpoint pw;
 	int len = sizeof(pw);
 	int watchme = 1234;
+	struct ptrace_siginfo info;
+	memset(&info, 0, sizeof(info));
 
 	printf("Before forking process PID=%d\n", getpid());
 	ATF_REQUIRE((child = fork()) != -1);
@@ -390,6 +394,7 @@ ATF_TC_BODY(watchpoint_trap_code0, tc)
 
 	pw.pw_index = i;
 	pw.pw_lwpid = 0;
+	pw.pw_type = PTRACE_PW_TYPE_DBREGS;
 	pw.pw_md.md_address = (void *)check_happy;
 	pw.pw_md.md_condition = X86_HW_WATCHPOINT_DR7_CONDITION_EXECUTION;
 	pw.pw_md.md_length = X86_HW_WATCHPOINT_DR7_LENGTH_BYTE;
@@ -397,6 +402,7 @@ ATF_TC_BODY(watchpoint_trap_code0, tc)
 	printf("struct ptrace {\n");
 	printf("\t.pw_index=%d\n", pw.pw_index);
 	printf("\t.pw_lwpid=%d\n", pw.pw_lwpid);
+	printf("\t.pw_type=%#x\n", pw.pw_type);
 	printf("\t.pw_md.md_address=%p\n", pw.pw_md.md_address);
 	printf("\t.pw_md.md_condition=%#x\n", pw.pw_md.md_condition);
 	printf("\t.pw_md.md_length=%#x\n", pw.pw_md.md_length);
@@ -414,6 +420,20 @@ ATF_TC_BODY(watchpoint_trap_code0, tc)
 
 	validate_status_stopped(status, SIGTRAP);
 
+	printf("Before calling ptrace(2) with PT_GET_SIGINFO for child\n");
+	ATF_REQUIRE(ptrace(PT_GET_SIGINFO, child, &info, sizeof(info)) != -1);
+
+	printf("Signal traced to lwpid=%d\n", info.psi_lwpid);
+	printf("Signal properties: si_signo=%#x si_code=%#x si_errno=%#x\n",
+	    info.psi_siginfo.si_signo, info.psi_siginfo.si_code,
+	    info.psi_siginfo.si_errno);
+
+	printf("Before checking siginfo_t\n");
+	ATF_REQUIRE_EQ(info.psi_siginfo.si_signo, SIGTRAP);
+	ATF_REQUIRE_EQ(info.psi_siginfo.si_code, TRAP_HWWPT);
+	ATF_REQUIRE_EQ(info.psi_siginfo.si_trap2, 0);
+	ATF_REQUIRE_EQ(info.psi_siginfo.si_trap3, X86_HW_WATCHPOINT_EVENT_FIRED);
+
 	pw.pw_md.md_address = NULL;
 	printf("Before writing watchpoint %d (disable it)\n", i);
 	ATF_REQUIRE(ptrace(PT_WRITE_WATCHPOINT, child, &pw, len) != -1);
@@ -452,6 +472,8 @@ ATF_TC_BODY(watchpoint_trap_code1, tc)
 	struct ptrace_watchpoint pw;
 	int len = sizeof(pw);
 	int watchme = 1234;
+	struct ptrace_siginfo info;
+	memset(&info, 0, sizeof(info));
 
 	printf("Before forking process PID=%d\n", getpid());
 	ATF_REQUIRE((child = fork()) != -1);
@@ -478,6 +500,7 @@ ATF_TC_BODY(watchpoint_trap_code1, tc)
 
 	pw.pw_index = i;
 	pw.pw_lwpid = 0;
+	pw.pw_type = PTRACE_PW_TYPE_DBREGS;
 	pw.pw_md.md_address = (void *)check_happy;
 	pw.pw_md.md_condition = X86_HW_WATCHPOINT_DR7_CONDITION_EXECUTION;
 	pw.pw_md.md_length = X86_HW_WATCHPOINT_DR7_LENGTH_BYTE;
@@ -485,6 +508,7 @@ ATF_TC_BODY(watchpoint_trap_code1, tc)
 	printf("struct ptrace {\n");
 	printf("\t.pw_index=%d\n", pw.pw_index);
 	printf("\t.pw_lwpid=%d\n", pw.pw_lwpid);
+	printf("\t.pw_type=%d\n", pw.pw_type);
 	printf("\t.pw_md.md_address=%p\n", pw.pw_md.md_address);
 	printf("\t.pw_md.md_condition=%#x\n", pw.pw_md.md_condition);
 	printf("\t.pw_md.md_length=%#x\n", pw.pw_md.md_length);
@@ -502,6 +526,20 @@ ATF_TC_BODY(watchpoint_trap_code1, tc)
 
 	validate_status_stopped(status, SIGTRAP);
 
+	printf("Before calling ptrace(2) with PT_GET_SIGINFO for child\n");
+	ATF_REQUIRE(ptrace(PT_GET_SIGINFO, child, &info, sizeof(info)) != -1);
+
+	printf("Signal traced to lwpid=%d\n", info.psi_lwpid);
+	printf("Signal properties: si_signo=%#x si_code=%#x si_errno=%#x\n",
+	    info.psi_siginfo.si_signo, info.psi_siginfo.si_code,
+	    info.psi_siginfo.si_errno);
+
+	printf("Before checking siginfo_t\n");
+	ATF_REQUIRE_EQ(info.psi_siginfo.si_signo, SIGTRAP);
+	ATF_REQUIRE_EQ(info.psi_siginfo.si_code, TRAP_HWWPT);
+	ATF_REQUIRE_EQ(info.psi_siginfo.si_trap2, 1);
+	ATF_REQUIRE_EQ(info.psi_siginfo.si_trap3, X86_HW_WATCHPOINT_EVENT_FIRED);
+
 	pw.pw_md.md_address = NULL;
 	printf("Before writing watchpoint %d (disable it)\n", i);
 	ATF_REQUIRE(ptrace(PT_WRITE_WATCHPOINT, child, &pw, len) != -1);
@@ -540,6 +578,8 @@ ATF_TC_BODY(watchpoint_trap_code2, tc)
 	struct ptrace_watchpoint pw;
 	int len = sizeof(pw);
 	int watchme = 1234;
+	struct ptrace_siginfo info;
+	memset(&info, 0, sizeof(info));
 
 	printf("Before forking process PID=%d\n", getpid());
 	ATF_REQUIRE((child = fork()) != -1);
@@ -566,6 +606,7 @@ ATF_TC_BODY(watchpoint_trap_code2, tc)
 
 	pw.pw_index = i;
 	pw.pw_lwpid = 0;
+	pw.pw_type = PTRACE_PW_TYPE_DBREGS;
 	pw.pw_md.md_address = (void *)check_happy;
 	pw.pw_md.md_condition = X86_HW_WATCHPOINT_DR7_CONDITION_EXECUTION;
 	pw.pw_md.md_length = X86_HW_WATCHPOINT_DR7_LENGTH_BYTE;
@@ -573,6 +614,7 @@ ATF_TC_BODY(watchpoint_trap_code2, tc)
 	printf("struct ptrace {\n");
 	printf("\t.pw_index=%d\n", pw.pw_index);
 	printf("\t.pw_lwpid=%d\n", pw.pw_lwpid);
+	printf("\t.pw_type=%#x\n", pw.pw_type);
 	printf("\t.pw_md.md_address=%p\n", pw.pw_md.md_address);
 	printf("\t.pw_md.md_condition=%#x\n", pw.pw_md.md_condition);
 	printf("\t.pw_md.md_length=%#x\n", pw.pw_md.md_length);
@@ -590,6 +632,20 @@ ATF_TC_BODY(watchpoint_trap_code2, tc)
 
 	validate_status_stopped(status, SIGTRAP);
 
+	printf("Before calling ptrace(2) with PT_GET_SIGINFO for child\n");
+	ATF_REQUIRE(ptrace(PT_GET_SIGINFO, child, &info, sizeof(info)) != -1);
+
+	printf("Signal traced to lwpid=%d\n", info.psi_lwpid);
+	printf("Signal properties: si_signo=%#x si_code=%#x si_errno=%#x\n",
+	    info.psi_siginfo.si_signo, info.psi_siginfo.si_code,
+	    info.psi_siginfo.si_errno);
+
+	printf("Before checking siginfo_t\n");
+	ATF_REQUIRE_EQ(info.psi_siginfo.si_signo, SIGTRAP);
+	ATF_REQUIRE_EQ(info.psi_siginfo.si_code, TRAP_HWWPT);
+	ATF_REQUIRE_EQ(info.psi_siginfo.si_trap2, 2);
+	ATF_REQUIRE_EQ(info.psi_siginfo.si_trap3, X86_HW_WATCHPOINT_EVENT_FIRED);
+
 	pw.pw_md.md_address = NULL;
 	printf("Before writing watchpoint %d (disable it)\n", i);
 	ATF_REQUIRE(ptrace(PT_WRITE_WATCHPOINT, child, &pw, len) != -1);
@@ -628,6 +684,8 @@ ATF_TC_BODY(watchpoint_trap_code3, tc)
 	struct ptrace_watchpoint pw;
 	int len = sizeof(pw);
 	int watchme = 1234;
+	struct ptrace_siginfo info;
+	memset(&info, 0, sizeof(info));
 
 	printf("Before forking process PID=%d\n", getpid());
 	ATF_REQUIRE((child = fork()) != -1);
@@ -654,6 +712,7 @@ ATF_TC_BODY(watchpoint_trap_code3, tc)
 
 	pw.pw_index = i;
 	pw.pw_lwpid = 0;
+	pw.pw_type = PTRACE_PW_TYPE_DBREGS;
 	pw.pw_md.md_address = (void *)check_happy;
 	pw.pw_md.md_condition = X86_HW_WATCHPOINT_DR7_CONDITION_EXECUTION;
 	pw.pw_md.md_length = X86_HW_WATCHPOINT_DR7_LENGTH_BYTE;
@@ -661,6 +720,7 @@ ATF_TC_BODY(watchpoint_trap_code3, tc)
 	printf("struct ptrace {\n");
 	printf("\t.pw_index=%d\n", pw.pw_index);
 	printf("\t.pw_lwpid=%d\n", pw.pw_lwpid);
+	printf("\t.pw_type=%#x\n", pw.pw_type);
 	printf("\t.pw_md.md_address=%p\n", pw.pw_md.md_address);
 	printf("\t.pw_md.md_condition=%#x\n", pw.pw_md.md_condition);
 	printf("\t.pw_md.md_length=%#x\n", pw.pw_md.md_length);
@@ -678,6 +738,20 @@ ATF_TC_BODY(watchpoint_trap_code3, tc)
 
 	validate_status_stopped(status, SIGTRAP);
 
+	printf("Before calling ptrace(2) with PT_GET_SIGINFO for child\n");
+	ATF_REQUIRE(ptrace(PT_GET_SIGINFO, child, &info, sizeof(info)) != -1);
+
+	printf("Signal traced to lwpid=%d\n", info.psi_lwpid);
+	printf("Signal properties: si_signo=%#x si_code=%#x si_errno=%#x\n",
+	    info.psi_siginfo.si_signo, info.psi_siginfo.si_code,
+	    info.psi_siginfo.si_errno);
+
+	printf("Before checking siginfo_t\n");
+	ATF_REQUIRE_EQ(info.psi_siginfo.si_signo, SIGTRAP);
+	ATF_REQUIRE_EQ(info.psi_siginfo.si_code, TRAP_HWWPT);
+	ATF_REQUIRE_EQ(info.psi_siginfo.si_trap2, 3);
+	ATF_REQUIRE_EQ(info.psi_siginfo.si_trap3, X86_HW_WATCHPOINT_EVENT_FIRED);
+
 	pw.pw_md.md_address = NULL;
 	printf("Before writing watchpoint %d (disable it)\n", i);
 	ATF_REQUIRE(ptrace(PT_WRITE_WATCHPOINT, child, &pw, len) != -1);
@@ -716,6 +790,8 @@ ATF_TC_BODY(watchpoint_trap_data_write0,
 	struct ptrace_watchpoint pw;
 	int len = sizeof(pw);
 	int watchme = 1234;
+	struct ptrace_siginfo info;
+	memset(&info, 0, sizeof(info));
 
 	printf("Before forking process PID=%d\n", getpid());
 	ATF_REQUIRE((child = fork()) != -1);
@@ -741,6 +817,7 @@ ATF_TC_BODY(watchpoint_trap_data_write0,
 	printf("Preparing code watchpoint trap %d\n", i);
 
 	pw.pw_index = 0;
+	pw.pw_type = PTRACE_PW_TYPE_DBREGS;
 	pw.pw_md.md_address = &watchme;
 	pw.pw_md.md_condition = X86_HW_WATCHPOINT_DR7_CONDITION_DATA_WRITE;
 	pw.pw_md.md_length = X86_HW_WATCHPOINT_DR7_LENGTH_BYTE;
@@ -748,6 +825,7 @@ ATF_TC_BODY(watchpoint_trap_data_write0,
 	printf("struct ptrace {\n");
 	printf("\t.pw_index=%d\n", pw.pw_index);
 	printf("\t.pw_lwpid=%d\n", pw.pw_lwpid);
+	printf("\t.pw_type=%#x\n", pw.pw_type);
 	printf("\t.pw_md.md_address=%p\n", pw.pw_md.md_address);
 	printf("\t.pw_md.md_condition=%#x\n", pw.pw_md.md_condition);
 	printf("\t.pw_md.md_length=%#x\n", pw.pw_md.md_length);
@@ -765,6 +843,20 @@ ATF_TC_BODY(watchpoint_trap_data_write0,
 
 	validate_status_stopped(status, SIGTRAP);
 
+	printf("Before calling ptrace(2) with PT_GET_SIGINFO for child\n");
+	ATF_REQUIRE(ptrace(PT_GET_SIGINFO, child, &info, sizeof(info)) != -1);
+
+	printf("Signal traced to lwpid=%d\n", info.psi_lwpid);
+	printf("Signal properties: si_signo=%#x si_code=%#x si_errno=%#x\n",
+	    info.psi_siginfo.si_signo, info.psi_siginfo.si_code,
+	    info.psi_siginfo.si_errno);
+
+	printf("Before checking siginfo_t\n");
+	ATF_REQUIRE_EQ(info.psi_siginfo.si_signo, SIGTRAP);
+	ATF_REQUIRE_EQ(info.psi_siginfo.si_code, TRAP_HWWPT);
+	ATF_REQUIRE_EQ(info.psi_siginfo.si_trap2, 0);
+	ATF_REQUIRE_EQ(info.psi_siginfo.si_trap3, X86_HW_WATCHPOINT_EVENT_FIRED);
+
 	printf("Before resuming the child process where it left off and "
 	    "without signal to be sent\n");
 	ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
@@ -799,6 +891,8 @@ ATF_TC_BODY(watchpoint_trap_data_write1,
 	struct ptrace_watchpoint pw;
 	int len = sizeof(pw);
 	int watchme = 1234;
+	struct ptrace_siginfo info;
+	memset(&info, 0, sizeof(info));
 
 	printf("Before forking process PID=%d\n", getpid());
 	ATF_REQUIRE((child = fork()) != -1);
@@ -824,6 +918,7 @@ ATF_TC_BODY(watchpoint_trap_data_write1,
 	printf("Preparing code watchpoint trap %d\n", i);
 
 	pw.pw_index = i;
+	pw.pw_type = PTRACE_PW_TYPE_DBREGS;
 	pw.pw_md.md_address = &watchme;
 	pw.pw_md.md_condition = X86_HW_WATCHPOINT_DR7_CONDITION_DATA_WRITE;
 	pw.pw_md.md_length = X86_HW_WATCHPOINT_DR7_LENGTH_BYTE;
@@ -831,6 +926,7 @@ ATF_TC_BODY(watchpoint_trap_data_write1,
 	printf("struct ptrace {\n");
 	printf("\t.pw_index=%d\n", pw.pw_index);
 	printf("\t.pw_lwpid=%d\n", pw.pw_lwpid);
+	printf("\t.pw_type=%#x\n", pw.pw_type);
 	printf("\t.pw_md.md_address=%p\n", pw.pw_md.md_address);
 	printf("\t.pw_md.md_condition=%#x\n", pw.pw_md.md_condition);
 	printf("\t.pw_md.md_length=%#x\n", pw.pw_md.md_length);
@@ -848,6 +944,20 @@ ATF_TC_BODY(watchpoint_trap_data_write1,
 
 	validate_status_stopped(status, SIGTRAP);
 
+	printf("Before calling ptrace(2) with PT_GET_SIGINFO for child\n");
+	ATF_REQUIRE(ptrace(PT_GET_SIGINFO, child, &info, sizeof(info)) != -1);
+
+	printf("Signal traced to lwpid=%d\n", info.psi_lwpid);
+	printf("Signal properties: si_signo=%#x si_code=%#x si_errno=%#x\n",
+	    info.psi_siginfo.si_signo, info.psi_siginfo.si_code,
+	    info.psi_siginfo.si_errno);
+
+	printf("Before checking siginfo_t\n");
+	ATF_REQUIRE_EQ(info.psi_siginfo.si_signo, SIGTRAP);
+	ATF_REQUIRE_EQ(info.psi_siginfo.si_code, TRAP_HWWPT);
+	ATF_REQUIRE_EQ(info.psi_siginfo.si_trap2, 1);
+	ATF_REQUIRE_EQ(info.psi_siginfo.si_trap3, X86_HW_WATCHPOINT_EVENT_FIRED);
+
 	printf("Before resuming the child process where it left off and "
 	    "without signal to be sent\n");
 	ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
@@ -882,6 +992,8 @@ ATF_TC_BODY(watchpoint_trap_data_write2,
 	struct ptrace_watchpoint pw;
 	int len = sizeof(pw);
 	int watchme = 1234;
+	struct ptrace_siginfo info;
+	memset(&info, 0, sizeof(info));
 
 	printf("Before forking process PID=%d\n", getpid());
 	ATF_REQUIRE((child = fork()) != -1);
@@ -907,6 +1019,7 @@ ATF_TC_BODY(watchpoint_trap_data_write2,
 	printf("Preparing code watchpoint trap %d\n", i);
 
 	pw.pw_index = i;
+	pw.pw_type = PTRACE_PW_TYPE_DBREGS;
 	pw.pw_md.md_address = &watchme;
 	pw.pw_md.md_condition = X86_HW_WATCHPOINT_DR7_CONDITION_DATA_WRITE;
 	pw.pw_md.md_length = X86_HW_WATCHPOINT_DR7_LENGTH_BYTE;
@@ -914,6 +1027,7 @@ ATF_TC_BODY(watchpoint_trap_data_write2,
 	printf("struct ptrace {\n");
 	printf("\t.pw_index=%d\n", pw.pw_index);
 	printf("\t.pw_lwpid=%d\n", pw.pw_lwpid);
+	printf("\t.pw_type=%#x\n", pw.pw_type);
 	printf("\t.pw_md.md_address=%p\n", pw.pw_md.md_address);
 	printf("\t.pw_md.md_condition=%#x\n", pw.pw_md.md_condition);
 	printf("\t.pw_md.md_length=%#x\n", pw.pw_md.md_length);
@@ -931,6 +1045,20 @@ ATF_TC_BODY(watchpoint_trap_data_write2,
 
 	validate_status_stopped(status, SIGTRAP);
 
+	printf("Before calling ptrace(2) with PT_GET_SIGINFO for child\n");
+	ATF_REQUIRE(ptrace(PT_GET_SIGINFO, child, &info, sizeof(info)) != -1);
+
+	printf("Signal traced to lwpid=%d\n", info.psi_lwpid);
+	printf("Signal properties: si_signo=%#x si_code=%#x si_errno=%#x\n",
+	    info.psi_siginfo.si_signo, info.psi_siginfo.si_code,
+	    info.psi_siginfo.si_errno);
+
+	printf("Before checking siginfo_t\n");
+	ATF_REQUIRE_EQ(info.psi_siginfo.si_signo, SIGTRAP);
+	ATF_REQUIRE_EQ(info.psi_siginfo.si_code, TRAP_HWWPT);
+	ATF_REQUIRE_EQ(info.psi_siginfo.si_trap2, 2);
+	ATF_REQUIRE_EQ(info.psi_siginfo.si_trap3, X86_HW_WATCHPOINT_EVENT_FIRED);
+
 	printf("Before resuming the child process where it left off and "
 	    "without signal to be sent\n");
 	ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
@@ -966,6 +1094,8 @@ ATF_TC_BODY(watchpoint_trap_data_write3,
 	struct ptrace_watchpoint pw;
 	int len = sizeof(pw);
 	int watchme = 1234;
+	struct ptrace_siginfo info;
+	memset(&info, 0, sizeof(info));
 
 	printf("Before forking process PID=%d\n", getpid());
 	ATF_REQUIRE((child = fork()) != -1);
@@ -991,6 +1121,7 @@ ATF_TC_BODY(watchpoint_trap_data_write3,
 	printf("Preparing code watchpoint trap %d\n", i);
 
 	pw.pw_index = i;
+	pw.pw_type = PTRACE_PW_TYPE_DBREGS;
 	pw.pw_md.md_address = &watchme;
 	pw.pw_md.md_condition = X86_HW_WATCHPOINT_DR7_CONDITION_DATA_WRITE;
 	pw.pw_md.md_length = X86_HW_WATCHPOINT_DR7_LENGTH_BYTE;
@@ -998,6 +1129,7 @@ ATF_TC_BODY(watchpoint_trap_data_write3,
 	printf("struct ptrace {\n");
 	printf("\t.pw_index=%d\n", pw.pw_index);
 	printf("\t.pw_lwpid=%d\n", pw.pw_lwpid);
+	printf("\t.pw_type=%#x\n", pw.pw_type);
 	printf("\t.pw_md.md_address=%p\n", pw.pw_md.md_address);
 	printf("\t.pw_md.md_condition=%#x\n", pw.pw_md.md_condition);
 	printf("\t.pw_md.md_length=%#x\n", pw.pw_md.md_length);
@@ -1015,6 +1147,20 @@ ATF_TC_BODY(watchpoint_trap_data_write3,
 
 	validate_status_stopped(status, SIGTRAP);
 
+	printf("Before calling ptrace(2) with PT_GET_SIGINFO for child\n");
+	ATF_REQUIRE(ptrace(PT_GET_SIGINFO, child, &info, sizeof(info)) != -1);
+
+	printf("Signal traced to lwpid=%d\n", info.psi_lwpid);
+	printf("Signal properties: si_signo=%#x si_code=%#x si_errno=%#x\n",
+	    info.psi_siginfo.si_signo, info.psi_siginfo.si_code,
+	    info.psi_siginfo.si_errno);
+
+	printf("Before checking siginfo_t\n");
+	ATF_REQUIRE_EQ(info.psi_siginfo.si_signo, SIGTRAP);
+	ATF_REQUIRE_EQ(info.psi_siginfo.si_code, TRAP_HWWPT);
+	ATF_REQUIRE_EQ(info.psi_siginfo.si_trap2, 3);
+	ATF_REQUIRE_EQ(info.psi_siginfo.si_trap3, X86_HW_WATCHPOINT_EVENT_FIRED);
+
 	printf("Before resuming the child process where it left off and "
 	    "without signal to be sent\n");
 	ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
@@ -1049,6 +1195,8 @@ ATF_TC_BODY(watchpoint_trap_data_rw0, tc
 	struct ptrace_watchpoint pw;
 	int len = sizeof(pw);
 	int watchme = 1234;
+	struct ptrace_siginfo info;
+	memset(&info, 0, sizeof(info));
 
 	printf("Before forking process PID=%d\n", getpid());
 	ATF_REQUIRE((child = fork()) != -1);
@@ -1074,6 +1222,7 @@ ATF_TC_BODY(watchpoint_trap_data_rw0, tc
 	printf("Preparing code watchpoint trap %d\n", i);
 
 	pw.pw_index = i;
+	pw.pw_type = PTRACE_PW_TYPE_DBREGS;
 	pw.pw_md.md_address = &watchme;
 	pw.pw_md.md_condition = X86_HW_WATCHPOINT_DR7_CONDITION_DATA_READWRITE;
 	pw.pw_md.md_length = X86_HW_WATCHPOINT_DR7_LENGTH_BYTE;
@@ -1081,6 +1230,7 @@ ATF_TC_BODY(watchpoint_trap_data_rw0, tc
 	printf("struct ptrace {\n");
 	printf("\t.pw_index=%d\n", pw.pw_index);
 	printf("\t.pw_lwpid=%d\n", pw.pw_lwpid);
+	printf("\t.pw_type=%#x\n", pw.pw_type);
 	printf("\t.pw_md.md_address=%p\n", pw.pw_md.md_address);
 	printf("\t.pw_md.md_condition=%#x\n", pw.pw_md.md_condition);
 	printf("\t.pw_md.md_length=%#x\n", pw.pw_md.md_length);
@@ -1098,6 +1248,20 @@ ATF_TC_BODY(watchpoint_trap_data_rw0, tc
 
 	validate_status_stopped(status, SIGTRAP);
 
+	printf("Before calling ptrace(2) with PT_GET_SIGINFO for child\n");
+	ATF_REQUIRE(ptrace(PT_GET_SIGINFO, child, &info, sizeof(info)) != -1);
+
+	printf("Signal traced to lwpid=%d\n", info.psi_lwpid);
+	printf("Signal properties: si_signo=%#x si_code=%#x si_errno=%#x\n",
+	    info.psi_siginfo.si_signo, info.psi_siginfo.si_code,
+	    info.psi_siginfo.si_errno);
+
+	printf("Before checking siginfo_t\n");
+	ATF_REQUIRE_EQ(info.psi_siginfo.si_signo, SIGTRAP);
+	ATF_REQUIRE_EQ(info.psi_siginfo.si_code, TRAP_HWWPT);
+	ATF_REQUIRE_EQ(info.psi_siginfo.si_trap2, 0);
+	ATF_REQUIRE_EQ(info.psi_siginfo.si_trap3, X86_HW_WATCHPOINT_EVENT_FIRED);
+
 	printf("Before resuming the child process where it left off and "
 	    "without signal to be sent\n");
 	ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
@@ -1132,6 +1296,8 @@ ATF_TC_BODY(watchpoint_trap_data_rw1, tc
 	struct ptrace_watchpoint pw;
 	int len = sizeof(pw);
 	int watchme = 1234;
+	struct ptrace_siginfo info;
+	memset(&info, 0, sizeof(info));
 
 	printf("Before forking process PID=%d\n", getpid());
 	ATF_REQUIRE((child = fork()) != -1);
@@ -1157,6 +1323,7 @@ ATF_TC_BODY(watchpoint_trap_data_rw1, tc
 	printf("Preparing code watchpoint trap %d\n", i);
 
 	pw.pw_index = i;
+	pw.pw_type = PTRACE_PW_TYPE_DBREGS;
 	pw.pw_md.md_address = &watchme;
 	pw.pw_md.md_condition = X86_HW_WATCHPOINT_DR7_CONDITION_DATA_READWRITE;
 	pw.pw_md.md_length = X86_HW_WATCHPOINT_DR7_LENGTH_BYTE;
@@ -1164,6 +1331,7 @@ ATF_TC_BODY(watchpoint_trap_data_rw1, tc
 	printf("struct ptrace {\n");
 	printf("\t.pw_index=%d\n", pw.pw_index);
 	printf("\t.pw_lwpid=%d\n", pw.pw_lwpid);
+	printf("\t.pw_type=%#x\n", pw.pw_type);
 	printf("\t.pw_md.md_address=%p\n", pw.pw_md.md_address);
 	printf("\t.pw_md.md_condition=%#x\n", pw.pw_md.md_condition);
 	printf("\t.pw_md.md_length=%#x\n", pw.pw_md.md_length);
@@ -1181,6 +1349,20 @@ ATF_TC_BODY(watchpoint_trap_data_rw1, tc
 
 	validate_status_stopped(status, SIGTRAP);
 
+	printf("Before calling ptrace(2) with PT_GET_SIGINFO for child\n");
+	ATF_REQUIRE(ptrace(PT_GET_SIGINFO, child, &info, sizeof(info)) != -1);
+
+	printf("Signal traced to lwpid=%d\n", info.psi_lwpid);
+	printf("Signal properties: si_signo=%#x si_code=%#x si_errno=%#x\n",
+	    info.psi_siginfo.si_signo, info.psi_siginfo.si_code,
+	    info.psi_siginfo.si_errno);
+
+	printf("Before checking siginfo_t\n");
+	ATF_REQUIRE_EQ(info.psi_siginfo.si_signo, SIGTRAP);
+	ATF_REQUIRE_EQ(info.psi_siginfo.si_code, TRAP_HWWPT);
+	ATF_REQUIRE_EQ(info.psi_siginfo.si_trap2, 1);
+	ATF_REQUIRE_EQ(info.psi_siginfo.si_trap3, X86_HW_WATCHPOINT_EVENT_FIRED);
+
 	printf("Before resuming the child process where it left off and "
 	    "without signal to be sent\n");
 	ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
@@ -1215,6 +1397,8 @@ ATF_TC_BODY(watchpoint_trap_data_rw2, tc
 	struct ptrace_watchpoint pw;
 	int len = sizeof(pw);
 	int watchme = 1234;
+	struct ptrace_siginfo info;
+	memset(&info, 0, sizeof(info));
 
 	printf("Before forking process PID=%d\n", getpid());
 	ATF_REQUIRE((child = fork()) != -1);
@@ -1240,6 +1424,7 @@ ATF_TC_BODY(watchpoint_trap_data_rw2, tc
 	printf("Preparing code watchpoint trap %d\n", i);
 
 	pw.pw_index = i;
+	pw.pw_type = PTRACE_PW_TYPE_DBREGS;
 	pw.pw_md.md_address = &watchme;
 	pw.pw_md.md_condition = X86_HW_WATCHPOINT_DR7_CONDITION_DATA_READWRITE;
 	pw.pw_md.md_length = X86_HW_WATCHPOINT_DR7_LENGTH_BYTE;
@@ -1247,6 +1432,7 @@ ATF_TC_BODY(watchpoint_trap_data_rw2, tc
 	printf("struct ptrace {\n");
 	printf("\t.pw_index=%d\n", pw.pw_index);
 	printf("\t.pw_lwpid=%d\n", pw.pw_lwpid);
+	printf("\t.pw_type=%#x\n", pw.pw_type);
 	printf("\t.pw_md.md_address=%p\n", pw.pw_md.md_address);
 	printf("\t.pw_md.md_condition=%#x\n", pw.pw_md.md_condition);
 	printf("\t.pw_md.md_length=%#x\n", pw.pw_md.md_length);
@@ -1264,6 +1450,20 @@ ATF_TC_BODY(watchpoint_trap_data_rw2, tc
 
 	validate_status_stopped(status, SIGTRAP);
 
+	printf("Before calling ptrace(2) with PT_GET_SIGINFO for child\n");
+	ATF_REQUIRE(ptrace(PT_GET_SIGINFO, child, &info, sizeof(info)) != -1);
+
+	printf("Signal traced to lwpid=%d\n", info.psi_lwpid);
+	printf("Signal properties: si_signo=%#x si_code=%#x si_errno=%#x\n",
+	    info.psi_siginfo.si_signo, info.psi_siginfo.si_code,
+	    info.psi_siginfo.si_errno);
+
+	printf("Before checking siginfo_t\n");
+	ATF_REQUIRE_EQ(info.psi_siginfo.si_signo, SIGTRAP);
+	ATF_REQUIRE_EQ(info.psi_siginfo.si_code, TRAP_HWWPT);
+	ATF_REQUIRE_EQ(info.psi_siginfo.si_trap2, 2);
+	ATF_REQUIRE_EQ(info.psi_siginfo.si_trap3, X86_HW_WATCHPOINT_EVENT_FIRED);
+
 	printf("Before resuming the child process where it left off and "
 	    "without signal to be sent\n");
 	ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
@@ -1298,6 +1498,8 @@ ATF_TC_BODY(watchpoint_trap_data_rw3, tc
 	struct ptrace_watchpoint pw;
 	int len = sizeof(pw);
 	int watchme = 1234;
+	struct ptrace_siginfo info;
+	memset(&info, 0, sizeof(info));
 
 	printf("Before forking process PID=%d\n", getpid());
 	ATF_REQUIRE((child = fork()) != -1);
@@ -1323,6 +1525,7 @@ ATF_TC_BODY(watchpoint_trap_data_rw3, tc
 	printf("Preparing code watchpoint trap %d\n", i);
 
 	pw.pw_index = i;
+	pw.pw_type = PTRACE_PW_TYPE_DBREGS;
 	pw.pw_md.md_address = &watchme;
 	pw.pw_md.md_condition = X86_HW_WATCHPOINT_DR7_CONDITION_DATA_READWRITE;
 	pw.pw_md.md_length = X86_HW_WATCHPOINT_DR7_LENGTH_BYTE;
@@ -1330,6 +1533,7 @@ ATF_TC_BODY(watchpoint_trap_data_rw3, tc
 	printf("struct ptrace {\n");
 	printf("\t.pw_index=%d\n", pw.pw_index);
 	printf("\t.pw_lwpid=%d\n", pw.pw_lwpid);
+	printf("\t.pw_type=%#x\n", pw.pw_type);
 	printf("\t.pw_md.md_address=%p\n", pw.pw_md.md_address);
 	printf("\t.pw_md.md_condition=%#x\n", pw.pw_md.md_condition);
 	printf("\t.pw_md.md_length=%#x\n", pw.pw_md.md_length);
@@ -1347,6 +1551,20 @@ ATF_TC_BODY(watchpoint_trap_data_rw3, tc
 
 	validate_status_stopped(status, SIGTRAP);
 
+	printf("Before calling ptrace(2) with PT_GET_SIGINFO for child\n");
+	ATF_REQUIRE(ptrace(PT_GET_SIGINFO, child, &info, sizeof(info)) != -1);
+
+	printf("Signal traced to lwpid=%d\n", info.psi_lwpid);
+	printf("Signal properties: si_signo=%#x si_code=%#x si_errno=%#x\n",
+	    info.psi_siginfo.si_signo, info.psi_siginfo.si_code,
+	    info.psi_siginfo.si_errno);
+
+	printf("Before checking siginfo_t\n");
+	ATF_REQUIRE_EQ(info.psi_siginfo.si_signo, SIGTRAP);
+	ATF_REQUIRE_EQ(info.psi_siginfo.si_code, TRAP_HWWPT);
+	ATF_REQUIRE_EQ(info.psi_siginfo.si_trap2, 3);
+	ATF_REQUIRE_EQ(info.psi_siginfo.si_trap3, X86_HW_WATCHPOINT_EVENT_FIRED);
+
 	printf("Before resuming the child process where it left off and "
 	    "without signal to be sent\n");
 	ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);

Modified: projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libpthread/h_common.h
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libpthread/h_common.h	Wed Jan 18 05:35:34 2017	(r312371)
+++ projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libpthread/h_common.h	Wed Jan 18 05:36:09 2017	(r312372)
@@ -5,14 +5,14 @@
 
 #define PTHREAD_REQUIRE(x) \
     do { \
-        int ret = (x); \
-        ATF_REQUIRE_MSG(ret == 0, "%s: %s", #x, strerror(ret)); \
+        int _ret = (x); \
+        ATF_REQUIRE_MSG(_ret == 0, "%s: %s", #x, strerror(_ret)); \
     } while (0)
 
 #define PTHREAD_REQUIRE_STATUS(x, v) \
     do { \
-        int ret = (x); \
-        ATF_REQUIRE_MSG(ret == (v), "%s: %s", #x, strerror(ret)); \
+        int _ret = (x); \
+        ATF_REQUIRE_MSG(_ret == (v), "%s: %s", #x, strerror(_ret)); \
     } while (0)
 
 #endif // H_COMMON_H

From owner-svn-src-projects@freebsd.org  Wed Jan 18 09:46:03 2017
Return-Path: <owner-svn-src-projects@freebsd.org>
Delivered-To: svn-src-projects@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9D478CB442C
 for <svn-src-projects@mailman.ysv.freebsd.org>;
 Wed, 18 Jan 2017 09:46:03 +0000 (UTC)
 (envelope-from ngie@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 6CB071B09;
 Wed, 18 Jan 2017 09:46:03 +0000 (UTC)
 (envelope-from ngie@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0I9k2ZV054238;
 Wed, 18 Jan 2017 09:46:02 GMT (envelope-from ngie@FreeBSD.org)
Received: (from ngie@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0I9k2Ww054237;
 Wed, 18 Jan 2017 09:46:02 GMT (envelope-from ngie@FreeBSD.org)
Message-Id: <201701180946.v0I9k2Ww054237@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: ngie set sender to
 ngie@FreeBSD.org using -f
From: Ngie Cooper <ngie@FreeBSD.org>
Date: Wed, 18 Jan 2017 09:46:02 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject: svn commit: r312376 -
 projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/sys
X-SVN-Group: projects
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-projects@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the src &quot; projects&quot;
 tree" <svn-src-projects.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-projects>, 
 <mailto:svn-src-projects-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-projects/>
List-Post: <mailto:svn-src-projects@freebsd.org>
List-Help: <mailto:svn-src-projects-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-projects>, 
 <mailto:svn-src-projects-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Wed, 18 Jan 2017 09:46:03 -0000

Author: ngie
Date: Wed Jan 18 09:46:02 2017
New Revision: 312376
URL: https://svnweb.freebsd.org/changeset/base/312376

Log:
  Add back #else block accidentally removed in r312145
  
  This fixes the build with !(amd64|arm64|mips*)

Modified:
  projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/sys/t_getcontext.c

Modified: projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/sys/t_getcontext.c
==============================================================================
--- projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/sys/t_getcontext.c	Wed Jan 18 08:20:36 2017	(r312375)
+++ projects/netbsd-tests-upstream-01-2017/contrib/netbsd-tests/lib/libc/sys/t_getcontext.c	Wed Jan 18 09:46:02 2017	(r312376)
@@ -58,6 +58,8 @@ run(int n, ...)
 	for (i = 0; i < 7; i++) {
 #elif defined(__mips__)
 	for (i = 0; i < 5; i++) {
+#else
+	for (i = 0; i < 9; i++) {
 #endif
 #else
 	for (i = 0; i < 9; i++) {

From owner-svn-src-projects@freebsd.org  Wed Jan 18 10:21:07 2017
Return-Path: <owner-svn-src-projects@freebsd.org>
Delivered-To: svn-src-projects@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9B396CB5D21
 for <svn-src-projects@mailman.ysv.freebsd.org>;
 Wed, 18 Jan 2017 10:21:07 +0000 (UTC) (envelope-from ae@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 72BB01CF4;
 Wed, 18 Jan 2017 10:21:07 +0000 (UTC) (envelope-from ae@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0IAL6dR066490;
 Wed, 18 Jan 2017 10:21:06 GMT (envelope-from ae@FreeBSD.org)
Received: (from ae@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0IAL6sZ066489;
 Wed, 18 Jan 2017 10:21:06 GMT (envelope-from ae@FreeBSD.org)
Message-Id: <201701181021.v0IAL6sZ066489@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org
 using -f
From: "Andrey V. Elsukov" <ae@FreeBSD.org>
Date: Wed, 18 Jan 2017 10:21:06 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject: svn commit: r312377 - projects/ipsec/sys/netipsec
X-SVN-Group: projects
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-projects@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the src &quot; projects&quot;
 tree" <svn-src-projects.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-projects>, 
 <mailto:svn-src-projects-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-projects/>
List-Post: <mailto:svn-src-projects@freebsd.org>
List-Help: <mailto:svn-src-projects-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-projects>, 
 <mailto:svn-src-projects-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Wed, 18 Jan 2017 10:21:07 -0000

Author: ae
Date: Wed Jan 18 10:21:06 2017
New Revision: 312377
URL: https://svnweb.freebsd.org/changeset/base/312377

Log:
  Do not require the presence of tunnel mode IPsec request for outbound
  security policies used by IPSEC_FORWARD() method.
  
  The rationale for this requirement was the need for handling encrypted
  replies. We can handle replies, only if they are destined for our
  addresses. And since we are doing forwarding, this usually means that
  source address of packet is not our own. But some users reported, that
  they are doing source address translation for forwarded packets. In this
  case pfil(9) does NAT and source address becomes our own, then packet
  is sent to forwarding routine, where it can be matched by security policy
  with transport mode IPsec request.

Modified:
  projects/ipsec/sys/netipsec/ipsec_output.c

Modified: projects/ipsec/sys/netipsec/ipsec_output.c
==============================================================================
--- projects/ipsec/sys/netipsec/ipsec_output.c	Wed Jan 18 09:46:02 2017	(r312376)
+++ projects/ipsec/sys/netipsec/ipsec_output.c	Wed Jan 18 10:21:06 2017	(r312377)
@@ -302,7 +302,7 @@ static int
 ipsec4_common_output(struct mbuf *m, struct inpcb *inp, int forwarding)
 {
 	struct secpolicy *sp;
-	int error, idx;
+	int error;
 
 	/* Lookup for the corresponding outbound security policy */
 	sp = ipsec4_checkpolicy(m, inp, &error);
@@ -315,22 +315,15 @@ ipsec4_common_output(struct mbuf *m, str
 		return (0); /* No IPsec required. */
 	}
 
-	if (forwarding) {
-		/*
-		 * Check that SP has tunnel mode IPsec transform.
-		 * We can't use transport mode when forwarding.
-		 */
-		for (idx = 0; idx < sp->tcount; idx++) {
-			if (sp->req[idx]->saidx.mode == IPSEC_MODE_TUNNEL)
-				break;
-		}
-		if (idx == sp->tcount) {
-			IPSECSTAT_INC(ips_out_inval);
-			key_freesp(&sp);
-			m_freem(m);
-			return (EACCES);
-		}
-	} else {
+	/*
+	 * Usually we have to have tunnel mode IPsec security policy
+	 * when we are forwarding a packet. Otherwise we could not handle
+	 * encrypted replies, because they are not destined for us. But
+	 * some users are doing source address translation for forwarded
+	 * packets, and thus, even if they are forwarded, the replies will
+	 * return back to us.
+	 */
+	if (!forwarding) {
 		/*
 		 * Do delayed checksums now because we send before
 		 * this is done in the normal processing path.
@@ -616,7 +609,7 @@ static int
 ipsec6_common_output(struct mbuf *m, struct inpcb *inp, int forwarding)
 {
 	struct secpolicy *sp;
-	int error, idx;
+	int error;
 
 	/* Lookup for the corresponding outbound security policy */
 	sp = ipsec6_checkpolicy(m, inp, &error);
@@ -629,29 +622,7 @@ ipsec6_common_output(struct mbuf *m, str
 		return (0); /* No IPsec required. */
 	}
 
-	if (forwarding) {
-		/*
-		 * Check that SP has tunnel mode IPsec transform.
-		 * We can't use transport mode when forwarding.
-		 *
-		 * RFC2473 says:
-		 * "A tunnel IPv6 packet resulting from the encapsulation of
-		 * an original packet is considered an IPv6 packet originating
-		 * from the tunnel entry-point node."
-		 * So, we don't need MTU checking, after IPsec processing
-		 * we will just fragment it if needed.
-		 */
-		for (idx = 0; idx < sp->tcount; idx++) {
-			if (sp->req[idx]->saidx.mode == IPSEC_MODE_TUNNEL)
-				break;
-		}
-		if (idx == sp->tcount) {
-			IPSEC6STAT_INC(ips_out_inval);
-			key_freesp(&sp);
-			m_freem(m);
-			return (EACCES);
-		}
-	} else {
+	if (!forwarding) {
 		/*
 		 * Do delayed checksums now because we send before
 		 * this is done in the normal processing path.

From owner-svn-src-projects@freebsd.org  Fri Jan 20 16:52:35 2017
Return-Path: <owner-svn-src-projects@freebsd.org>
Delivered-To: svn-src-projects@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4E82BCB90D2
 for <svn-src-projects@mailman.ysv.freebsd.org>;
 Fri, 20 Jan 2017 16:52:35 +0000 (UTC) (envelope-from ae@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 1A5051C82;
 Fri, 20 Jan 2017 16:52:35 +0000 (UTC) (envelope-from ae@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0KGqYEk030538;
 Fri, 20 Jan 2017 16:52:34 GMT (envelope-from ae@FreeBSD.org)
Received: (from ae@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0KGqYdE030537;
 Fri, 20 Jan 2017 16:52:34 GMT (envelope-from ae@FreeBSD.org)
Message-Id: <201701201652.v0KGqYdE030537@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org
 using -f
From: "Andrey V. Elsukov" <ae@FreeBSD.org>
Date: Fri, 20 Jan 2017 16:52:34 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject: svn commit: r312541 - projects/ipsec/sys/netipsec
X-SVN-Group: projects
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-projects@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the src &quot; projects&quot;
 tree" <svn-src-projects.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-projects>, 
 <mailto:svn-src-projects-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-projects/>
List-Post: <mailto:svn-src-projects@freebsd.org>
List-Help: <mailto:svn-src-projects-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-projects>, 
 <mailto:svn-src-projects-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Fri, 20 Jan 2017 16:52:35 -0000

Author: ae
Date: Fri Jan 20 16:52:34 2017
New Revision: 312541
URL: https://svnweb.freebsd.org/changeset/base/312541

Log:
  Fix build with VIMAGE enabled.
  
  Reported by:	Eugene Grosbein

Modified:
  projects/ipsec/sys/netipsec/key.c

Modified: projects/ipsec/sys/netipsec/key.c
==============================================================================
--- projects/ipsec/sys/netipsec/key.c	Fri Jan 20 16:04:39 2017	(r312540)
+++ projects/ipsec/sys/netipsec/key.c	Fri Jan 20 16:52:34 2017	(r312541)
@@ -7833,7 +7833,8 @@ key_destroy(void)
 	struct secpolicy *sp, *nextsp;
 	struct secacq *acq, *nextacq;
 	struct secspacq *spacq, *nextspacq;
-	struct secashead *sah, *nextsah;
+	struct secashead *sah;
+	struct secasvar *sav;
 	struct secreg *reg;
 	int i;
 

From owner-svn-src-projects@freebsd.org  Fri Jan 20 17:03:46 2017
Return-Path: <owner-svn-src-projects@freebsd.org>
Delivered-To: svn-src-projects@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 373AECB955C
 for <svn-src-projects@mailman.ysv.freebsd.org>;
 Fri, 20 Jan 2017 17:03:46 +0000 (UTC) (envelope-from ae@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 11EBC154E;
 Fri, 20 Jan 2017 17:03:45 +0000 (UTC) (envelope-from ae@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0KH3jI0034997;
 Fri, 20 Jan 2017 17:03:45 GMT (envelope-from ae@FreeBSD.org)
Received: (from ae@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0KH3joM034995;
 Fri, 20 Jan 2017 17:03:45 GMT (envelope-from ae@FreeBSD.org)
Message-Id: <201701201703.v0KH3joM034995@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org
 using -f
From: "Andrey V. Elsukov" <ae@FreeBSD.org>
Date: Fri, 20 Jan 2017 17:03:45 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject: svn commit: r312542 - projects/ipsec/lib/libipsec
X-SVN-Group: projects
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-projects@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the src &quot; projects&quot;
 tree" <svn-src-projects.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-projects>, 
 <mailto:svn-src-projects-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-projects/>
List-Post: <mailto:svn-src-projects@freebsd.org>
List-Help: <mailto:svn-src-projects-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-projects>, 
 <mailto:svn-src-projects-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Fri, 20 Jan 2017 17:03:46 -0000

Author: ae
Date: Fri Jan 20 17:03:44 2017
New Revision: 312542
URL: https://svnweb.freebsd.org/changeset/base/312542

Log:
  Since NAT-T support is now always enabled, add related information
  to the `setkey -D` output.

Modified:
  projects/ipsec/lib/libipsec/pfkey.c
  projects/ipsec/lib/libipsec/pfkey_dump.c

Modified: projects/ipsec/lib/libipsec/pfkey.c
==============================================================================
--- projects/ipsec/lib/libipsec/pfkey.c	Fri Jan 20 16:52:34 2017	(r312541)
+++ projects/ipsec/lib/libipsec/pfkey.c	Fri Jan 20 17:03:44 2017	(r312542)
@@ -1776,21 +1776,15 @@ pfkey_align(msg, mhp)
 		case SADB_EXT_SPIRANGE:
 		case SADB_X_EXT_POLICY:
 		case SADB_X_EXT_SA2:
-		case SADB_X_EXT_SA_REPLAY:
-			mhp[ext->sadb_ext_type] = (caddr_t)ext;
-			break;
 		case SADB_X_EXT_NAT_T_TYPE:
 		case SADB_X_EXT_NAT_T_SPORT:
 		case SADB_X_EXT_NAT_T_DPORT:
-		/* case SADB_X_EXT_NAT_T_OA: is OAI */
 		case SADB_X_EXT_NAT_T_OAI:
 		case SADB_X_EXT_NAT_T_OAR:
 		case SADB_X_EXT_NAT_T_FRAG:
-			if (feature_present("ipsec_natt")) {
-				mhp[ext->sadb_ext_type] = (caddr_t)ext;
-				break;
-			}
-			/* FALLTHROUGH */
+		case SADB_X_EXT_SA_REPLAY:
+			mhp[ext->sadb_ext_type] = (caddr_t)ext;
+			break;
 		default:
 			__ipsec_errcode = EIPSEC_INVAL_EXTTYPE;
 			return -1;

Modified: projects/ipsec/lib/libipsec/pfkey_dump.c
==============================================================================
--- projects/ipsec/lib/libipsec/pfkey_dump.c	Fri Jan 20 16:52:34 2017	(r312541)
+++ projects/ipsec/lib/libipsec/pfkey_dump.c	Fri Jan 20 17:03:44 2017	(r312542)
@@ -220,6 +220,9 @@ pfkey_sadump(m)
 	struct sadb_ident *m_sid, *m_did;
 	struct sadb_sens *m_sens;
 	struct sadb_x_sa_replay *m_sa_replay;
+	struct sadb_x_nat_t_type *natt_type;
+	struct sadb_x_nat_t_port *natt_sport, *natt_dport;
+	struct sadb_address *natt_oai, *natt_oar;
 
 	/* check pfkey message. */
 	if (pfkey_align(m, mhp)) {
@@ -245,33 +248,46 @@ pfkey_sadump(m)
 	m_did = (struct sadb_ident *)mhp[SADB_EXT_IDENTITY_DST];
 	m_sens = (struct sadb_sens *)mhp[SADB_EXT_SENSITIVITY];
 	m_sa_replay = (struct sadb_x_sa_replay *)mhp[SADB_X_EXT_SA_REPLAY];
+	natt_type = (struct sadb_x_nat_t_type *)mhp[SADB_X_EXT_NAT_T_TYPE];
+	natt_sport = (struct sadb_x_nat_t_port *)mhp[SADB_X_EXT_NAT_T_SPORT];
+	natt_dport = (struct sadb_x_nat_t_port *)mhp[SADB_X_EXT_NAT_T_DPORT];
+	natt_oai = (struct sadb_address *)mhp[SADB_X_EXT_NAT_T_OAI];
+	natt_oar = (struct sadb_address *)mhp[SADB_X_EXT_NAT_T_OAR];
+
 
 	/* source address */
 	if (m_saddr == NULL) {
 		printf("no ADDRESS_SRC extension.\n");
 		return;
 	}
-	printf("%s ", str_ipaddr((struct sockaddr *)(m_saddr + 1)));
+	printf("%s", str_ipaddr((struct sockaddr *)(m_saddr + 1)));
+	if (natt_type != NULL && natt_sport != NULL)
+		printf("[%u]", ntohs(natt_sport->sadb_x_nat_t_port_port));
 
 	/* destination address */
 	if (m_daddr == NULL) {
-		printf("no ADDRESS_DST extension.\n");
+		printf("\nno ADDRESS_DST extension.\n");
 		return;
 	}
-	printf("%s ", str_ipaddr((struct sockaddr *)(m_daddr + 1)));
+	printf(" %s", str_ipaddr((struct sockaddr *)(m_daddr + 1)));
+	if (natt_type != NULL && natt_dport != NULL)
+		printf("[%u]", ntohs(natt_dport->sadb_x_nat_t_port_port));
 
 	/* SA type */
 	if (m_sa == NULL) {
-		printf("no SA extension.\n");
+		printf("\nno SA extension.\n");
 		return;
 	}
 	if (m_sa2 == NULL) {
-		printf("no SA2 extension.\n");
+		printf("\nno SA2 extension.\n");
 		return;
 	}
 	printf("\n\t");
 
-	GETMSGSTR(str_satype, m->sadb_msg_satype);
+	if (m->sadb_msg_satype == SADB_SATYPE_ESP && natt_type != NULL)
+		printf("esp-udp ");
+	else
+		GETMSGSTR(str_satype, m->sadb_msg_satype);
 
 	printf("mode=");
 	GETMSGSTR(str_mode, m_sa2->sadb_x_sa2_mode);
@@ -282,6 +298,18 @@ pfkey_sadump(m)
 		(u_int32_t)m_sa2->sadb_x_sa2_reqid,
 		(u_int32_t)m_sa2->sadb_x_sa2_reqid);
 
+	/* other NAT-T information */
+	if (natt_type != NULL && (natt_oai != NULL || natt_oar != NULL)) {
+		printf("\tNAT:");
+		if (natt_oai != NULL)
+			printf(" OAI=%s",
+			    str_ipaddr((struct sockaddr *)(natt_oai + 1)));
+		if (natt_oar != NULL)
+			printf(" OAR=%s",
+			    str_ipaddr((struct sockaddr *)(natt_oar + 1)));
+		printf("\n");
+	}
+
 	/* encryption key */
 	if (m->sadb_msg_satype == SADB_X_SATYPE_IPCOMP) {
 		printf("\tC: ");

From owner-svn-src-projects@freebsd.org  Fri Jan 20 17:21:01 2017
Return-Path: <owner-svn-src-projects@freebsd.org>
Delivered-To: svn-src-projects@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 26964CB9CE4
 for <svn-src-projects@mailman.ysv.freebsd.org>;
 Fri, 20 Jan 2017 17:21:01 +0000 (UTC) (envelope-from ae@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id E8DB6122B;
 Fri, 20 Jan 2017 17:21:00 +0000 (UTC) (envelope-from ae@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0KHL0cv040230;
 Fri, 20 Jan 2017 17:21:00 GMT (envelope-from ae@FreeBSD.org)
Received: (from ae@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0KHL0ov040229;
 Fri, 20 Jan 2017 17:21:00 GMT (envelope-from ae@FreeBSD.org)
Message-Id: <201701201721.v0KHL0ov040229@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org
 using -f
From: "Andrey V. Elsukov" <ae@FreeBSD.org>
Date: Fri, 20 Jan 2017 17:21:00 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject: svn commit: r312545 - projects/ipsec/sys/netipsec
X-SVN-Group: projects
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-projects@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the src &quot; projects&quot;
 tree" <svn-src-projects.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-projects>, 
 <mailto:svn-src-projects-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-projects/>
List-Post: <mailto:svn-src-projects@freebsd.org>
List-Help: <mailto:svn-src-projects-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-projects>, 
 <mailto:svn-src-projects-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Fri, 20 Jan 2017 17:21:01 -0000

Author: ae
Date: Fri Jan 20 17:20:59 2017
New Revision: 312545
URL: https://svnweb.freebsd.org/changeset/base/312545

Log:
  Count more malloc fails in the PFKEY statistics.

Modified:
  projects/ipsec/sys/netipsec/key.c

Modified: projects/ipsec/sys/netipsec/key.c
==============================================================================
--- projects/ipsec/sys/netipsec/key.c	Fri Jan 20 17:16:48 2017	(r312544)
+++ projects/ipsec/sys/netipsec/key.c	Fri Jan 20 17:20:59 2017	(r312545)
@@ -2659,8 +2659,10 @@ key_newsah(struct secasindex *saidx)
 
 	sah = malloc(sizeof(struct secashead), M_IPSEC_SAH,
 	    M_NOWAIT | M_ZERO);
-	if (sah == NULL)
+	if (sah == NULL) {
+		PFKEYSTAT_INC(in_nomem);
 		return (NULL);
+	}
 	TAILQ_INIT(&sah->savtree_larval);
 	TAILQ_INIT(&sah->savtree_alive);
 	sah->saidx = *saidx;
@@ -2746,12 +2748,14 @@ key_newsav(const struct sadb_msghdr *mhp
 
 	sav = malloc(sizeof(struct secasvar), M_IPSEC_SA, M_NOWAIT | M_ZERO);
 	if (sav == NULL) {
+		PFKEYSTAT_INC(in_nomem);
 		ipseclog((LOG_DEBUG, "%s: No more memory.\n", __func__));
 		*errp = ENOBUFS;
 		goto done;
 	}
 	sav->lft_c = uma_zalloc(V_key_lft_zone, M_NOWAIT);
 	if (sav->lft_c == NULL) {
+		PFKEYSTAT_INC(in_nomem);
 		ipseclog((LOG_DEBUG, "%s: No more memory.\n", __func__));
 		free(sav, M_IPSEC_SA), sav = NULL;
 		*errp = ENOBUFS;

From owner-svn-src-projects@freebsd.org  Fri Jan 20 17:28:53 2017
Return-Path: <owner-svn-src-projects@freebsd.org>
Delivered-To: svn-src-projects@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 992E2CB9FBE
 for <svn-src-projects@mailman.ysv.freebsd.org>;
 Fri, 20 Jan 2017 17:28:53 +0000 (UTC) (envelope-from ae@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 692511735;
 Fri, 20 Jan 2017 17:28:53 +0000 (UTC) (envelope-from ae@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0KHSqa1043362;
 Fri, 20 Jan 2017 17:28:52 GMT (envelope-from ae@FreeBSD.org)
Received: (from ae@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0KHSq6p043361;
 Fri, 20 Jan 2017 17:28:52 GMT (envelope-from ae@FreeBSD.org)
Message-Id: <201701201728.v0KHSq6p043361@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org
 using -f
From: "Andrey V. Elsukov" <ae@FreeBSD.org>
Date: Fri, 20 Jan 2017 17:28:52 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject: svn commit: r312546 - projects/ipsec/sys/netipsec
X-SVN-Group: projects
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-projects@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the src &quot; projects&quot;
 tree" <svn-src-projects.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-projects>, 
 <mailto:svn-src-projects-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-projects/>
List-Post: <mailto:svn-src-projects@freebsd.org>
List-Help: <mailto:svn-src-projects-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-projects>, 
 <mailto:svn-src-projects-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Fri, 20 Jan 2017 17:28:53 -0000

Author: ae
Date: Fri Jan 20 17:28:52 2017
New Revision: 312546
URL: https://svnweb.freebsd.org/changeset/base/312546

Log:
  Check sadb_sa_flags received from userland for correctness and
  report back only supported flags (they are defined in pfkeyv2.h).

Modified:
  projects/ipsec/sys/netipsec/key.c

Modified: projects/ipsec/sys/netipsec/key.c
==============================================================================
--- projects/ipsec/sys/netipsec/key.c	Fri Jan 20 17:20:59 2017	(r312545)
+++ projects/ipsec/sys/netipsec/key.c	Fri Jan 20 17:28:52 2017	(r312546)
@@ -3108,6 +3108,13 @@ key_setsaval(struct secasvar *sav, const
 		sav->alg_auth = sa0->sadb_sa_auth;
 		sav->alg_enc = sa0->sadb_sa_encrypt;
 		sav->flags = sa0->sadb_sa_flags;
+		if ((sav->flags & SADB_KEY_FLAGS_MAX) != sav->flags) {
+			ipseclog((LOG_DEBUG,
+			    "%s: invalid sa_flags 0x%08x.\n", __func__,
+			    sav->flags));
+			error = EINVAL;
+			goto fail;
+		}
 
 		/* Optional replay window */
 		replay = 0;
@@ -3608,9 +3615,8 @@ key_setsadbsa(struct secasvar *sav)
 	p->sadb_sa_state = sav->state;
 	p->sadb_sa_auth = sav->alg_auth;
 	p->sadb_sa_encrypt = sav->alg_enc;
-	p->sadb_sa_flags = sav->flags;
-
-	return m;
+	p->sadb_sa_flags = sav->flags & SADB_KEY_FLAGS_MAX;
+	return (m);
 }
 
 /*