CVS commit: src/usr.bin/pwait

2015-03-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Mar  2 21:43:39 UTC 2015

Added Files:
src/usr.bin/pwait: Makefile pwait.1 pwait.c

Log Message:
Add pwait, from FreeBSD


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/usr.bin/pwait/Makefile src/usr.bin/pwait/pwait.1 \
src/usr.bin/pwait/pwait.c

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

Added files:

Index: src/usr.bin/pwait/Makefile
diff -u /dev/null src/usr.bin/pwait/Makefile:1.1
--- /dev/null	Mon Mar  2 16:43:39 2015
+++ src/usr.bin/pwait/Makefile	Mon Mar  2 16:43:39 2015
@@ -0,0 +1,6 @@
+# $NetBSD: Makefile,v 1.1 2015/03/02 21:43:39 christos Exp $
+WARNS=6
+
+PROG=	pwait
+
+.include bsd.prog.mk
Index: src/usr.bin/pwait/pwait.1
diff -u /dev/null src/usr.bin/pwait/pwait.1:1.1
--- /dev/null	Mon Mar  2 16:43:39 2015
+++ src/usr.bin/pwait/pwait.1	Mon Mar  2 16:43:39 2015
@@ -0,0 +1,78 @@
+.\	$NetBSD: pwait.1,v 1.1 2015/03/02 21:43:39 christos Exp $
+.\
+.\ Copyright (c) 2004-2009, Jilles Tjoelker
+.\ 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 OWNER 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: head/bin/pwait/pwait.1 233648 2012-03-29 05:02:12Z eadler $
+.\
+.Dd November 1, 2009
+.Dt PWAIT 1
+.Os
+.Sh NAME
+.Nm pwait
+.Nd wait for processes to terminate
+.Sh SYNOPSIS
+.Nm
+.Op Fl v
+.Ar pid
+\...
+.Sh DESCRIPTION
+The
+.Nm
+utility will wait until each of the given processes has terminated.
+.Pp
+The following option is available:
+.Bl -tag -width indent
+.It Fl v
+Print the exit status when each process terminates.
+.El
+.Sh DIAGNOSTICS
+The
+.Nm
+utility returns 0 on success, and 0 if an error occurs.
+.Pp
+Invalid pids elicit a warning message but are otherwise ignored.
+.Sh SEE ALSO
+.Xr kill 1 ,
+.Xr pkill 1 ,
+.Xr ps 1 ,
+.Xr wait 1 ,
+.Xr kqueue 2
+.Sh NOTES
+.Nm
+is not a substitute for the
+.Xr wait 1
+builtin
+as it will not clean up any zombies or state in the parent process.
+.Sh HISTORY
+A
+.Nm
+command first appeared in SunOS 5.8.
Index: src/usr.bin/pwait/pwait.c
diff -u /dev/null src/usr.bin/pwait/pwait.c:1.1
--- /dev/null	Mon Mar  2 16:43:39 2015
+++ src/usr.bin/pwait/pwait.c	Mon Mar  2 16:43:39 2015
@@ -0,0 +1,150 @@
+/*	$NetBSD: pwait.c,v 1.1 2015/03/02 21:43:39 christos Exp $	*/
+
+/*-
+ * Copyright (c) 2004-2009, Jilles Tjoelker
+ * 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 OWNER 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 

CVS commit: [nick-nhusb] src/sys/dev/usb

2015-03-02 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon Mar  2 21:52:02 UTC 2015

Modified Files:
src/sys/dev/usb [nick-nhusb]: ehci.c ehcivar.h

Log Message:
ex_isdone / ux_state tidyup


To generate a diff of this commit:
cvs rdiff -u -r1.234.2.34 -r1.234.2.35 src/sys/dev/usb/ehci.c
cvs rdiff -u -r1.42.14.9 -r1.42.14.10 src/sys/dev/usb/ehcivar.h

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

Modified files:

Index: src/sys/dev/usb/ehci.c
diff -u src/sys/dev/usb/ehci.c:1.234.2.34 src/sys/dev/usb/ehci.c:1.234.2.35
--- src/sys/dev/usb/ehci.c:1.234.2.34	Sun Mar  1 08:26:55 2015
+++ src/sys/dev/usb/ehci.c	Mon Mar  2 21:52:02 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: ehci.c,v 1.234.2.34 2015/03/01 08:26:55 skrll Exp $ */
+/*	$NetBSD: ehci.c,v 1.234.2.35 2015/03/02 21:52:02 skrll Exp $ */
 
 /*
  * Copyright (c) 2004-2012 The NetBSD Foundation, Inc.
@@ -53,7 +53,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ehci.c,v 1.234.2.34 2015/03/01 08:26:55 skrll Exp $);
+__KERNEL_RCSID(0, $NetBSD: ehci.c,v 1.234.2.35 2015/03/02 21:52:02 skrll Exp $);
 
 #include ohci.h
 #include uhci.h
@@ -1018,16 +1018,15 @@ ehci_idone(struct ehci_xfer *ex)
 	USBHIST_LOG(ehcidebug, ex=%p, ex, 0, 0, 0);
 
 #ifdef DIAGNOSTIC
-	if (ex-ex_isdone) {
-		printf(ehci_idone: ex=%p is done!\n, ex);
 #ifdef EHCI_DEBUG
+	if (ex-ex_isdone) {
 		USBHIST_LOGN(ehcidebug, 5, --- dump start ---, 0, 0, 0, 0);
 		ehci_dump_exfer(ex);
 		USBHIST_LOGN(ehcidebug, 5, --- dump end ---, 0, 0, 0, 0);
-#endif
-		return;
 	}
-	ex-ex_isdone = 1;
+#endif
+	KASSERT(!ex-ex_isdone);
+	ex-ex_isdone = true;
 #endif
 
 	if (xfer-ux_status == USBD_CANCELLED ||
@@ -1519,7 +1518,7 @@ ehci_allocx(struct usbd_bus *bus)
 	if (xfer != NULL) {
 		memset(xfer, 0, sizeof(struct ehci_xfer));
 #ifdef DIAGNOSTIC
-		EXFER(xfer)-ex_isdone = 1;
+		EXFER(xfer)-ex_isdone = true;
 		xfer-ux_state = XFER_BUSY;
 #endif
 	}
@@ -1531,15 +1530,10 @@ ehci_freex(struct usbd_bus *bus, usbd_xf
 {
 	struct ehci_softc *sc = bus-ub_hcpriv;
 
+	KASSERT(xfer-ux_state == XFER_BUSY);
+	KASSERT(EXFER(xfer)-ex_isdone);
 #ifdef DIAGNOSTIC
-	if (xfer-ux_state != XFER_BUSY) {
-		printf(ehci_freex: xfer=%p not busy, 0x%08x\n, xfer,
-		   xfer-ux_state);
-	}
 	xfer-ux_state = XFER_FREE;
-	if (!EXFER(xfer)-ex_isdone) {
-		printf(ehci_freex: !isdone\n);
-	}
 #endif
 	pool_cache_put(sc-sc_xferpool, xfer);
 }
@@ -3238,7 +3232,7 @@ ehci_abort_xfer(usbd_xfer_handle xfer, u
 	 * Step 4: Execute callback.
 	 */
 #ifdef DIAGNOSTIC
-	exfer-ex_isdone = 1;
+	exfer-ex_isdone = true;
 #endif
 	wake = xfer-ux_hcflags  UXFER_ABORTWAIT;
 	xfer-ux_hcflags = ~(UXFER_ABORTING | UXFER_ABORTWAIT);
@@ -3343,7 +3337,7 @@ ehci_abort_isoc_xfer(usbd_xfer_handle xf
 	cv_wait(sc-sc_softwake_cv, sc-sc_lock);
 
 #ifdef DIAGNOSTIC
-	exfer-ex_isdone = 1;
+	exfer-ex_isdone = true;
 #endif
 	wake = xfer-ux_hcflags  UXFER_ABORTWAIT;
 	xfer-ux_hcflags = ~(UXFER_ABORTING | UXFER_ABORTWAIT);
@@ -3613,11 +3607,9 @@ ehci_device_request(usbd_xfer_handle xfe
 
 	exfer-ex_sqtdstart = setup;
 	exfer-ex_sqtdend = stat;
+	KASSERT(exfer-ex_isdone);
 #ifdef DIAGNOSTIC
-	if (!exfer-ex_isdone) {
-		printf(ehci_device_request: not done, exfer=%p\n, exfer);
-	}
-	exfer-ex_isdone = 0;
+	exfer-ex_isdone = false;
 #endif
 
 	/* Insert qTD in QH list. */
@@ -3748,11 +3740,9 @@ ehci_device_bulk_start(usbd_xfer_handle 
 	/* Set up interrupt info. */
 	exfer-ex_sqtdstart = data;
 	exfer-ex_sqtdend = dataend;
+	KASSERT(exfer-ex_isdone);
 #ifdef DIAGNOSTIC
-	if (!exfer-ex_isdone) {
-		printf(ehci_device_bulk_start: not done, ex=%p\n, exfer);
-	}
-	exfer-ex_isdone = 0;
+	exfer-ex_isdone = false;
 #endif
 
 	ehci_set_qh_qtd(sqh, data); /* also does usb_syncmem(sqh) */
@@ -3936,11 +3926,9 @@ ehci_device_intr_start(usbd_xfer_handle 
 	/* Set up interrupt info. */
 	exfer-ex_sqtdstart = data;
 	exfer-ex_sqtdend = dataend;
+	KASSERT(exfer-ex_isdone);
 #ifdef DIAGNOSTIC
-	if (!exfer-ex_isdone) {
-		printf(ehci_device_intr_start: not done, ex=%p\n, exfer);
-	}
-	exfer-ex_isdone = 0;
+	exfer-ex_isdone = false;
 #endif
 
 	ehci_set_qh_qtd(sqh, data); /* also does usb_syncmem(sqh) */
@@ -4039,14 +4027,9 @@ ehci_device_intr_done(usbd_xfer_handle x
 		/* Set up interrupt info. */
 		exfer-ex_sqtdstart = data;
 		exfer-ex_sqtdend = dataend;
+		KASSERT(exfer-ex_isdone);
 #ifdef DIAGNOSTIC
-		if (!exfer-ex_isdone) {
-			USBHIST_LOG(ehcidebug, marked not done, ex = %p,
-exfer, 0, 0, 0);
-			printf(ehci_device_intr_done: not done, ex=%p\n,
-			exfer);
-		}
-		exfer-ex_isdone = 0;
+		exfer-ex_isdone = false;
 #endif
 
 		ehci_set_qh_qtd(sqh, data); /* also does usb_syncmem(sqh) */
@@ -4135,11 +4118,10 @@ ehci_device_fs_isoc_start(usbd_xfer_hand
 	}
 
 	KASSERT(!(xfer-ux_rqflags  URQ_REQUEST));
+	KASSERT(exfer-ex_isdone);
 
 #ifdef DIAGNOSTIC
-	if (!exfer-ex_isdone)
-		printf(ehci_device_fs_isoc_start: not done, ex = %p\n, exfer);
-	exfer-ex_isdone = 0;
+	exfer-ex_isdone = false;
 #endif
 
 	/*

CVS commit: src/distrib/sets/lists

2015-03-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Mar  2 21:55:45 UTC 2015

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

Log Message:
add pwait.


To generate a diff of this commit:
cvs rdiff -u -r1.1096 -r1.1097 src/distrib/sets/lists/base/mi
cvs rdiff -u -r1.1495 -r1.1496 src/distrib/sets/lists/man/mi

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

Modified files:

Index: src/distrib/sets/lists/base/mi
diff -u src/distrib/sets/lists/base/mi:1.1096 src/distrib/sets/lists/base/mi:1.1097
--- src/distrib/sets/lists/base/mi:1.1096	Fri Feb 13 13:57:46 2015
+++ src/distrib/sets/lists/base/mi	Mon Mar  2 16:55:44 2015
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1096 2015/02/13 18:57:46 nonaka Exp $
+# $NetBSD: mi,v 1.1097 2015/03/02 21:55:44 christos Exp $
 #
 # Note:	Don't delete entries from here - mark them as obsolete instead,
 #	unless otherwise stated below.
@@ -674,6 +674,7 @@
 ./usr/bin/printfbase-util-bin
 ./usr/bin/progressbase-util-bin
 ./usr/bin/purgestatbase-mailwrapper-bin
+./usr/bin/pwait	base-util-bin
 ./usr/bin/pwhashbase-util-bin
 ./usr/bin/qsafe	base-util-bin		crypto
 ./usr/bin/qsievebase-util-bin		crypto

Index: src/distrib/sets/lists/man/mi
diff -u src/distrib/sets/lists/man/mi:1.1495 src/distrib/sets/lists/man/mi:1.1496
--- src/distrib/sets/lists/man/mi:1.1495	Sun Feb  8 11:44:09 2015
+++ src/distrib/sets/lists/man/mi	Mon Mar  2 16:55:45 2015
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1495 2015/02/08 16:44:09 wiz Exp $
+# $NetBSD: mi,v 1.1496 2015/03/02 21:55:45 christos Exp $
 #
 # Note: don't delete entries from here - mark them as obsolete instead.
 #
@@ -453,6 +453,7 @@
 ./usr/share/man/cat1/pstat.0			man-obsolete		obsolete
 ./usr/share/man/cat1/pushd.0			man-util-catman		.cat
 ./usr/share/man/cat1/pwd.0			man-util-catman		.cat
+./usr/share/man/cat1/pwait.0			man-util-catman		.cat
 ./usr/share/man/cat1/pwhash.0			man-util-catman		.cat
 ./usr/share/man/cat1/qsafe.0			man-util-catman		crypto,.cat
 ./usr/share/man/cat1/qsieve.0			man-util-catman		crypto,.cat
@@ -3568,6 +3569,7 @@
 ./usr/share/man/html1/ps.html			man-util-htmlman	html
 ./usr/share/man/html1/pushd.html		man-util-htmlman	html
 ./usr/share/man/html1/pwd.html			man-util-htmlman	html
+./usr/share/man/html1/pwait.html		man-util-htmlman	html
 ./usr/share/man/html1/pwhash.html		man-util-htmlman	html
 ./usr/share/man/html1/qsafe.html		man-util-htmlman	crypto,html
 ./usr/share/man/html1/qsieve.html		man-util-htmlman	crypto,html
@@ -6334,6 +6336,7 @@
 ./usr/share/man/man1/pstat.1			man-obsolete		obsolete
 ./usr/share/man/man1/pushd.1			man-util-man		.man
 ./usr/share/man/man1/pwd.1			man-util-man		.man
+./usr/share/man/man1/pwait.1			man-util-man		.man
 ./usr/share/man/man1/pwhash.1			man-util-man		.man
 ./usr/share/man/man1/qsafe.1			man-util-man		crypto,.man
 ./usr/share/man/man1/qsieve.1			man-util-man		crypto,.man



CVS commit: [nick-nhusb] src/sys/dev/usb

2015-03-02 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon Mar  2 22:16:38 UTC 2015

Modified Files:
src/sys/dev/usb [nick-nhusb]: ehci.c

Log Message:
Simplify - no functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.234.2.35 -r1.234.2.36 src/sys/dev/usb/ehci.c

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

Modified files:

Index: src/sys/dev/usb/ehci.c
diff -u src/sys/dev/usb/ehci.c:1.234.2.35 src/sys/dev/usb/ehci.c:1.234.2.36
--- src/sys/dev/usb/ehci.c:1.234.2.35	Mon Mar  2 21:52:02 2015
+++ src/sys/dev/usb/ehci.c	Mon Mar  2 22:16:38 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: ehci.c,v 1.234.2.35 2015/03/02 21:52:02 skrll Exp $ */
+/*	$NetBSD: ehci.c,v 1.234.2.36 2015/03/02 22:16:38 skrll Exp $ */
 
 /*
  * Copyright (c) 2004-2012 The NetBSD Foundation, Inc.
@@ -53,7 +53,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ehci.c,v 1.234.2.35 2015/03/02 21:52:02 skrll Exp $);
+__KERNEL_RCSID(0, $NetBSD: ehci.c,v 1.234.2.36 2015/03/02 22:16:38 skrll Exp $);
 
 #include ohci.h
 #include uhci.h
@@ -2767,7 +2767,7 @@ ehci_alloc_sqtd_chain(struct ehci_pipe *
 	int len, curlen, mps;
 	int i, tog;
 	int pages, pageoffs;
-	bus_size_t curoffs;
+	size_t curoffs;
 	vaddr_t va, va_offs;
 	usb_dma_t *dma = xfer-ux_dmabuf;
 	uint16_t flags = xfer-ux_flags;
@@ -2814,7 +2814,7 @@ ehci_alloc_sqtd_chain(struct ehci_pipe *
 			KASSERT(curlen != 0);
 		}
 		USBHIST_LOG(ehcidebug, len=%d curlen=%d curoffs=%zu,
-			len, curlen, (size_t)curoffs, 0);
+			len, curlen, curoffs, 0);
 
 		/*
 		 * Allocate another transfer if there's more data left,
@@ -2857,7 +2857,7 @@ ehci_alloc_sqtd_chain(struct ehci_pipe *
 		cur-len = curlen;
 
 		USBHIST_LOG(ehcidebug, cbp=0x%08zx end=0x%08zx,
-		(size_t)curoffs, (size_t)(curoffs + curlen), 0, 0);
+		curoffs, curoffs + curlen, 0, 0);
 
 		/*
 		 * adjust the toggle based on the number of packets in this



CVS commit: src/usr.bin

2015-03-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Mar  2 21:54:13 UTC 2015

Modified Files:
src/usr.bin: Makefile

Log Message:
add pwait


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

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

Modified files:

Index: src/usr.bin/Makefile
diff -u src/usr.bin/Makefile:1.219 src/usr.bin/Makefile:1.220
--- src/usr.bin/Makefile:1.219	Mon Dec 29 23:22:18 2014
+++ src/usr.bin/Makefile	Mon Mar  2 16:54:13 2015
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.219 2014/12/30 04:22:18 mrg Exp $
+#	$NetBSD: Makefile,v 1.220 2015/03/02 21:54:13 christos Exp $
 #	from: @(#)Makefile	8.3 (Berkeley) 1/7/94
 
 .include bsd.own.mk
@@ -21,7 +21,7 @@ SUBDIR= apply asa at audio audiocfg \
 	moduli msgc msgs \
 	nbperf netgroup netstat newgrp newsyslog nfsstat nice nl nohup \
 	pagesize passwd paste patch pathchk pkill pmap pmc pr \
-	printenv printf progress pwhash qsubst quota radioctl rdist \
+	printenv printf progress pwait pwhash qsubst quota radioctl rdist \
 	renice rev revoke rfcomm_sppd rlogin rpcgen rpcinfo rs rsh \
 	rup ruptime rusers rwall rwho \
 	script sdiff sdpquery sed seq shar shlock \



CVS commit: src/sys/external/bsd/drm2/dist/drm/i915

2015-03-02 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon Mar  2 23:05:03 UTC 2015

Modified Files:
src/sys/external/bsd/drm2/dist/drm/i915: intel_i2c.c

Log Message:
Narrow the scope of the gmbus wait lock to where we need it.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 \
src/sys/external/bsd/drm2/dist/drm/i915/intel_i2c.c

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

Modified files:

Index: src/sys/external/bsd/drm2/dist/drm/i915/intel_i2c.c
diff -u src/sys/external/bsd/drm2/dist/drm/i915/intel_i2c.c:1.11 src/sys/external/bsd/drm2/dist/drm/i915/intel_i2c.c:1.12
--- src/sys/external/bsd/drm2/dist/drm/i915/intel_i2c.c:1.11	Mon Mar  2 18:36:49 2015
+++ src/sys/external/bsd/drm2/dist/drm/i915/intel_i2c.c	Mon Mar  2 23:05:03 2015
@@ -285,21 +285,19 @@ gmbus_wait_hw_status(struct drm_i915_pri
 	I915_WRITE(GMBUS4 + reg_offset, gmbus4_irq_en);
 
 #ifdef __NetBSD__
-	spin_lock(dev_priv-gmbus_wait_lock);
 	if (cold) {
 		i = 50;
 		while (gmbus2 = I915_READ_NOTRACE(GMBUS2 + reg_offset),
 		!ISSET(gmbus2, (GMBUS_SATOER | gmbus2_status))) {
 			if (i-- == 0)
 break;
-			spin_unlock(dev_priv-gmbus_wait_lock);
 			DELAY(1000);
-			spin_lock(dev_priv-gmbus_wait_lock);
 		}
 	} else {
 		for (i = 0; i  mstohz(50); i++) {
 			int ret;
 
+			spin_lock(dev_priv-gmbus_wait_lock);
 			DRM_SPIN_TIMED_WAIT_NOINTR_UNTIL(ret,
 			dev_priv-gmbus_wait_queue,
 			dev_priv-gmbus_wait_lock,
@@ -307,9 +305,9 @@ gmbus_wait_hw_status(struct drm_i915_pri
 			(gmbus2 = I915_READ_NOTRACE(GMBUS2 + reg_offset),
 ISSET(gmbus2,
 (GMBUS_SATOER | gmbus2_status;
+			spin_unlock(dev_priv-gmbus_wait_lock);
 		}
 	}
-	spin_unlock(dev_priv-gmbus_wait_lock);
 #else
 	for (i = 0; i  msecs_to_jiffies_timeout(50); i++) {
 		prepare_to_wait(dev_priv-gmbus_wait_queue, wait,



CVS commit: src/usr.bin/pwait

2015-03-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Mar  2 21:53:48 UTC 2015

Modified Files:
src/usr.bin/pwait: pwait.1 pwait.c

Log Message:
Add -s option, cleanup warnings.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/usr.bin/pwait/pwait.1 src/usr.bin/pwait/pwait.c

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

Modified files:

Index: src/usr.bin/pwait/pwait.1
diff -u src/usr.bin/pwait/pwait.1:1.1 src/usr.bin/pwait/pwait.1:1.2
--- src/usr.bin/pwait/pwait.1:1.1	Mon Mar  2 16:43:39 2015
+++ src/usr.bin/pwait/pwait.1	Mon Mar  2 16:53:48 2015
@@ -1,4 +1,4 @@
-.\	$NetBSD: pwait.1,v 1.1 2015/03/02 21:43:39 christos Exp $
+.\	$NetBSD: pwait.1,v 1.2 2015/03/02 21:53:48 christos Exp $
 .\
 .\ Copyright (c) 2004-2009, Jilles Tjoelker
 .\ All rights reserved.
@@ -33,7 +33,7 @@
 .\
 .\ $FreeBSD: head/bin/pwait/pwait.1 233648 2012-03-29 05:02:12Z eadler $
 .\
-.Dd November 1, 2009
+.Dd March 2, 2015
 .Dt PWAIT 1
 .Os
 .Sh NAME
@@ -41,7 +41,7 @@
 .Nd wait for processes to terminate
 .Sh SYNOPSIS
 .Nm
-.Op Fl v
+.Op Fl sv
 .Ar pid
 \...
 .Sh DESCRIPTION
@@ -51,6 +51,8 @@ utility will wait until each of the give
 .Pp
 The following option is available:
 .Bl -tag -width indent
+.It Fl s
+Exit with the status code of the first non-zero exit status pid.
 .It Fl v
 Print the exit status when each process terminates.
 .El
Index: src/usr.bin/pwait/pwait.c
diff -u src/usr.bin/pwait/pwait.c:1.1 src/usr.bin/pwait/pwait.c:1.2
--- src/usr.bin/pwait/pwait.c:1.1	Mon Mar  2 16:43:39 2015
+++ src/usr.bin/pwait/pwait.c	Mon Mar  2 16:53:48 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: pwait.c,v 1.1 2015/03/02 21:43:39 christos Exp $	*/
+/*	$NetBSD: pwait.c,v 1.2 2015/03/02 21:53:48 christos Exp $	*/
 
 /*-
  * Copyright (c) 2004-2009, Jilles Tjoelker
@@ -37,7 +37,7 @@
 #ifdef __FBSDID
 __FBSDID($FreeBSD: head/bin/pwait/pwait.c 245506 2013-01-16 18:15:25Z delphij $);
 #endif
-__RCSID($NetBSD: pwait.c,v 1.1 2015/03/02 21:43:39 christos Exp $);
+__RCSID($NetBSD: pwait.c,v 1.2 2015/03/02 21:53:48 christos Exp $);
 
 #include sys/types.h
 #include sys/event.h
@@ -70,13 +70,17 @@ main(int argc, char *argv[])
 {
 	int kq;
 	struct kevent *e;
-	int verbose = 0;
-	int opt, nleft, n, i, duplicate, status;
-	long pid;
+	int verbose = 0, childstatus = 0;
+	int opt, duplicate, status;
+	size_t nleft, n, i;
+	pid_t pid;
 	char *s, *end;
 
-	while ((opt = getopt(argc, argv, v)) != -1) {
+	while ((opt = getopt(argc, argv, sv)) != -1) {
 		switch (opt) {
+		case 's':
+			childstatus = 1;
+			break;
 		case 'v':
 			verbose = 1;
 			break;
@@ -94,43 +98,45 @@ main(int argc, char *argv[])
 
 	kq = kqueue();
 	if (kq == -1)
-		err(1, kqueue);
+		err(EXIT_FAILURE, kqueue);
 
-	e = malloc(argc * sizeof(struct kevent));
+	e = malloc((size_t)argc * sizeof(*e));
 	if (e == NULL)
-		err(1, malloc);
+		err(EXIT_FAILURE, malloc);
 	nleft = 0;
-	for (n = 0; n  argc; n++) {
+	for (n = 0; n  (size_t)argc; n++) {
+		long pidl;
 		s = argv[n];
 		if (!strncmp(s, /proc/, 6)) /* Undocumented Solaris compat */
 			s += 6;
 		errno = 0;
-		pid = strtol(s, end, 10);
-		if (pid  0 || *end != '\0' || errno != 0) {
+		pidl = strtol(s, end, 10);
+		if (pidl  0 || *end != '\0' || errno != 0) {
 			warnx(%s: bad process id, s);
 			continue;
 		}
+		pid = (pid_t)pidl;
 		duplicate = 0;
 		for (i = 0; i  nleft; i++)
 			if (e[i].ident == (uintptr_t)pid)
 duplicate = 1;
 		if (!duplicate) {
-			EV_SET(e + nleft, pid, EVFILT_PROC, EV_ADD, NOTE_EXIT,
-			0, NULL);
+			EV_SET(e + nleft, (uintptr_t)pid, EVFILT_PROC, EV_ADD,
+			NOTE_EXIT, 0, NULL);
 			if (kevent(kq, e + nleft, 1, NULL, 0, NULL) == -1)
-warn(%ld, pid);
+warn(%jd, (intmax_t)pid);
 			else
 nleft++;
 		}
 	}
 
 	while (nleft  0) {
-		n = kevent(kq, NULL, 0, e, nleft, NULL);
-		if (n == -1)
-			err(1, kevent);
-		if (verbose)
-			for (i = 0; i  n; i++) {
-status = e[i].data;
+		int rv = kevent(kq, NULL, 0, e, nleft, NULL);
+		if (rv == -1)
+			err(EXIT_FAILURE, kevent);
+		for (i = 0; i  n; i++) {
+			status = (int)e[i].data;
+			if (verbose) {
 if (WIFEXITED(status))
 	printf(%ld: exited with status %d.\n,
 	(long)e[i].ident,
@@ -143,8 +149,11 @@ main(int argc, char *argv[])
 	printf(%ld: terminated.\n,
 	(long)e[i].ident);
 			}
+			if (childstatus)
+return status;
+		}
 		nleft -= n;
 	}
 
-	exit(EX_OK);
+	return EX_OK;
 }



CVS commit: src/sys/external/bsd/drm2/dist/drm/radeon

2015-03-02 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon Mar  2 23:29:56 UTC 2015

Modified Files:
src/sys/external/bsd/drm2/dist/drm/radeon: radeon_fence.c

Log Message:
Replace `out' label by break.

Reduces diff from upstream a little.

No functional change, confirmed by diffing `objdump -dr' output.


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

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

Modified files:

Index: src/sys/external/bsd/drm2/dist/drm/radeon/radeon_fence.c
diff -u src/sys/external/bsd/drm2/dist/drm/radeon/radeon_fence.c:1.6 src/sys/external/bsd/drm2/dist/drm/radeon/radeon_fence.c:1.7
--- src/sys/external/bsd/drm2/dist/drm/radeon/radeon_fence.c:1.6	Mon Mar  2 17:53:00 2015
+++ src/sys/external/bsd/drm2/dist/drm/radeon/radeon_fence.c	Mon Mar  2 23:29:56 2015
@@ -372,12 +372,12 @@ static int radeon_fence_wait_seq(struct 
 		}
 
 		if (unlikely(r  0))
-			goto out;
+			break;
 
 		if (unlikely(!signaled)) {
 			if (rdev-needs_reset) {
 r = -EDEADLK;
-goto out;
+break;
 			}
 
 			/* we were interrupted for some reason and fence
@@ -420,11 +420,11 @@ static int radeon_fence_wait_seq(struct 
 wake_up_all(rdev-fence_queue);
 #endif
 r = -EDEADLK;
-goto out;
+break;
 			}
 		}
 	}
-out:	spin_unlock(rdev-fence_lock);
+	spin_unlock(rdev-fence_lock);
 	return r;
 }
 



CVS commit: src/bin/cp

2015-03-02 Thread enami tsugutomo
Module Name:src
Committed By:   enami
Date:   Tue Mar  3 00:20:38 UTC 2015

Modified Files:
src/bin/cp: utils.c

Log Message:
Fix the name of failed function in warning message.


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 src/bin/cp/utils.c

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

Modified files:

Index: src/bin/cp/utils.c
diff -u src/bin/cp/utils.c:1.43 src/bin/cp/utils.c:1.44
--- src/bin/cp/utils.c:1.43	Mon Mar  2 03:17:24 2015
+++ src/bin/cp/utils.c	Tue Mar  3 00:20:38 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: utils.c,v 1.43 2015/03/02 03:17:24 enami Exp $ */
+/* $NetBSD: utils.c,v 1.44 2015/03/03 00:20:38 enami Exp $ */
 
 /*-
  * Copyright (c) 1991, 1993, 1994
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = @(#)utils.c	8.3 (Berkeley) 4/1/94;
 #else
-__RCSID($NetBSD: utils.c,v 1.43 2015/03/02 03:17:24 enami Exp $);
+__RCSID($NetBSD: utils.c,v 1.44 2015/03/03 00:20:38 enami Exp $);
 #endif
 #endif /* not lint */
 
@@ -68,7 +68,7 @@ set_utimes(const char *file, struct stat
 ts[1] = fs-st_mtimespec;
 
 if (lutimens(file, ts)) {
-	warn(lutimes: %s, file);
+	warn(lutimens: %s, file);
 	return (1);
 }
 return (0);



CVS commit: src/lib/librumphijack

2015-03-02 Thread enami tsugutomo
Module Name:src
Committed By:   enami
Date:   Tue Mar  3 00:19:07 UTC 2015

Modified Files:
src/lib/librumphijack: hijack.c

Log Message:
Hijack utimensat(2) so that t_vfs test passes after cp(1)/mv(1) are
changed to use the system call.  Linux also has this system call, but
not tested this on linux.


To generate a diff of this commit:
cvs rdiff -u -r1.111 -r1.112 src/lib/librumphijack/hijack.c

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

Modified files:

Index: src/lib/librumphijack/hijack.c
diff -u src/lib/librumphijack/hijack.c:1.111 src/lib/librumphijack/hijack.c:1.112
--- src/lib/librumphijack/hijack.c:1.111	Tue Nov  4 19:05:17 2014
+++ src/lib/librumphijack/hijack.c	Tue Mar  3 00:19:07 2015
@@ -1,4 +1,4 @@
-/*  $NetBSD: hijack.c,v 1.111 2014/11/04 19:05:17 pooka Exp $	*/
+/*  $NetBSD: hijack.c,v 1.112 2015/03/03 00:19:07 enami Exp $	*/
 
 /*-
  * Copyright (c) 2011 Antti Kantee.  All Rights Reserved.
@@ -34,7 +34,7 @@
 #include rump/rumpuser_port.h
 
 #if !defined(lint)
-__RCSID($NetBSD: hijack.c,v 1.111 2014/11/04 19:05:17 pooka Exp $);
+__RCSID($NetBSD: hijack.c,v 1.112 2015/03/03 00:19:07 enami Exp $);
 #endif
 
 #include sys/param.h
@@ -113,6 +113,7 @@ enum dualcall {
 	DUALCALL_LINK, DUALCALL_RENAME,
 	DUALCALL_MKDIR, DUALCALL_RMDIR,
 	DUALCALL_UTIMES, DUALCALL_LUTIMES, DUALCALL_FUTIMES,
+	DUALCALL_UTIMENSAT,
 	DUALCALL_TRUNCATE, DUALCALL_FTRUNCATE,
 	DUALCALL_FSYNC,
 	DUALCALL_ACCESS,
@@ -305,6 +306,7 @@ struct sysnames {
 	{ DUALCALL_UTIMES,	S(REALUTIMES),	RSYS_NAME(UTIMES)	},
 	{ DUALCALL_LUTIMES,	S(REALLUTIMES),	RSYS_NAME(LUTIMES)	},
 	{ DUALCALL_FUTIMES,	S(REALFUTIMES),	RSYS_NAME(FUTIMES)	},
+	{ DUALCALL_UTIMENSAT,	utimensat,	RSYS_NAME(UTIMENSAT)	},
 	{ DUALCALL_OPEN,	open,		RSYS_NAME(OPEN)		},
 	{ DUALCALL_CHDIR,	chdir,	RSYS_NAME(CHDIR)	},
 	{ DUALCALL_FCHDIR,	fchdir,	RSYS_NAME(FCHDIR)	},
@@ -2496,6 +2498,11 @@ PATHCALL(int, lutimes, DUALCALL_LUTIMES,
 	(const char *, const struct timeval *),\
 	(path, tv))
 
+PATHCALL(int, utimensat, DUALCALL_UTIMENSAT,\
+	(int fd, const char *path, const struct timespec *ts, int flags), \
+	(int, const char *, const struct timespec *, int),		\
+	(fd, path, ts, flags))
+
 #ifdef HAVE_CHFLAGS
 PATHCALL(int, chflags, DUALCALL_CHFLAGS,\
 	(const char *path, u_long flags),\



CVS commit: xsrc/external/mit/MesaLib/dist/src/gbm/backends/dri

2015-03-02 Thread Christos Zoulas
Module Name:xsrc
Committed By:   christos
Date:   Tue Mar  3 02:27:24 UTC 2015

Modified Files:
xsrc/external/mit/MesaLib/dist/src/gbm/backends/dri: gbm_dri.c

Log Message:
void function can't return value.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.2 -r1.2 \
xsrc/external/mit/MesaLib/dist/src/gbm/backends/dri/gbm_dri.c

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

Modified files:

Index: xsrc/external/mit/MesaLib/dist/src/gbm/backends/dri/gbm_dri.c
diff -u xsrc/external/mit/MesaLib/dist/src/gbm/backends/dri/gbm_dri.c:1.1.1.2 xsrc/external/mit/MesaLib/dist/src/gbm/backends/dri/gbm_dri.c:1.2
--- xsrc/external/mit/MesaLib/dist/src/gbm/backends/dri/gbm_dri.c:1.1.1.2	Thu Dec 18 01:02:07 2014
+++ xsrc/external/mit/MesaLib/dist/src/gbm/backends/dri/gbm_dri.c	Mon Mar  2 21:27:24 2015
@@ -169,8 +169,8 @@ swrast_put_image(__DRIdrawable *driDrawa
  char  *data,
  void  *loaderPrivate)
 {
-   return swrast_put_image2(driDrawable, op, x, y, width, height,
-width * 4, data, loaderPrivate);
+   swrast_put_image2(driDrawable, op, x, y, width, height,
+ width * 4, data, loaderPrivate);
 }
 
 static void



CVS commit: src/lib/librumphijack

2015-03-02 Thread enami tsugutomo
Module Name:src
Committed By:   enami
Date:   Tue Mar  3 01:24:39 UTC 2015

Modified Files:
src/lib/librumphijack: hijack.c

Log Message:
Also hijack futimens(2) so that t_sh test passes.


To generate a diff of this commit:
cvs rdiff -u -r1.112 -r1.113 src/lib/librumphijack/hijack.c

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

Modified files:

Index: src/lib/librumphijack/hijack.c
diff -u src/lib/librumphijack/hijack.c:1.112 src/lib/librumphijack/hijack.c:1.113
--- src/lib/librumphijack/hijack.c:1.112	Tue Mar  3 00:19:07 2015
+++ src/lib/librumphijack/hijack.c	Tue Mar  3 01:24:39 2015
@@ -1,4 +1,4 @@
-/*  $NetBSD: hijack.c,v 1.112 2015/03/03 00:19:07 enami Exp $	*/
+/*  $NetBSD: hijack.c,v 1.113 2015/03/03 01:24:39 enami Exp $	*/
 
 /*-
  * Copyright (c) 2011 Antti Kantee.  All Rights Reserved.
@@ -34,7 +34,7 @@
 #include rump/rumpuser_port.h
 
 #if !defined(lint)
-__RCSID($NetBSD: hijack.c,v 1.112 2015/03/03 00:19:07 enami Exp $);
+__RCSID($NetBSD: hijack.c,v 1.113 2015/03/03 01:24:39 enami Exp $);
 #endif
 
 #include sys/param.h
@@ -113,7 +113,7 @@ enum dualcall {
 	DUALCALL_LINK, DUALCALL_RENAME,
 	DUALCALL_MKDIR, DUALCALL_RMDIR,
 	DUALCALL_UTIMES, DUALCALL_LUTIMES, DUALCALL_FUTIMES,
-	DUALCALL_UTIMENSAT,
+	DUALCALL_UTIMENSAT, DUALCALL_FUTIMENS,
 	DUALCALL_TRUNCATE, DUALCALL_FTRUNCATE,
 	DUALCALL_FSYNC,
 	DUALCALL_ACCESS,
@@ -307,6 +307,7 @@ struct sysnames {
 	{ DUALCALL_LUTIMES,	S(REALLUTIMES),	RSYS_NAME(LUTIMES)	},
 	{ DUALCALL_FUTIMES,	S(REALFUTIMES),	RSYS_NAME(FUTIMES)	},
 	{ DUALCALL_UTIMENSAT,	utimensat,	RSYS_NAME(UTIMENSAT)	},
+	{ DUALCALL_FUTIMENS,	futimens,	RSYS_NAME(FUTIMENS)	},
 	{ DUALCALL_OPEN,	open,		RSYS_NAME(OPEN)		},
 	{ DUALCALL_CHDIR,	chdir,	RSYS_NAME(CHDIR)	},
 	{ DUALCALL_FCHDIR,	fchdir,	RSYS_NAME(FCHDIR)	},
@@ -2392,6 +2393,11 @@ FDCALL(int, futimes, DUALCALL_FUTIMES,		
 	(int, const struct timeval *),	\
 	(fd, tv))
 
+FDCALL(int, futimens, DUALCALL_FUTIMENS,\
+	(int fd, const struct timespec *ts),\
+	(int, const struct timespec *),	\
+	(fd, ts))
+
 #ifdef HAVE_CHFLAGS
 FDCALL(int, fchflags, DUALCALL_FCHFLAGS,\
 	(int fd, u_long flags),		\



CVS commit: [netbsd-7] src/sys/dev/ic

2015-03-02 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Mar  3 07:14:03 UTC 2015

Modified Files:
src/sys/dev/ic [netbsd-7]: tulip.c

Log Message:
Pull up following revision(s) (requested by nakayama in ticket #558):
sys/dev/ic/tulip.c: revision 1.185
Stop the interface before detaching to avoid the race between
tlp_detach() and tlp_intr().
While there, add missing callout_destroy()s.


To generate a diff of this commit:
cvs rdiff -u -r1.184 -r1.184.2.1 src/sys/dev/ic/tulip.c

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

Modified files:

Index: src/sys/dev/ic/tulip.c
diff -u src/sys/dev/ic/tulip.c:1.184 src/sys/dev/ic/tulip.c:1.184.2.1
--- src/sys/dev/ic/tulip.c:1.184	Sun Aug 10 16:44:35 2014
+++ src/sys/dev/ic/tulip.c	Tue Mar  3 07:14:03 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: tulip.c,v 1.184 2014/08/10 16:44:35 tls Exp $	*/
+/*	$NetBSD: tulip.c,v 1.184.2.1 2015/03/03 07:14:03 snj Exp $	*/
 
 /*-
  * Copyright (c) 1998, 1999, 2000, 2002 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: tulip.c,v 1.184 2014/08/10 16:44:35 tls Exp $);
+__KERNEL_RCSID(0, $NetBSD: tulip.c,v 1.184.2.1 2015/03/03 07:14:03 snj Exp $);
 
 
 #include sys/param.h
@@ -592,7 +592,7 @@ tlp_detach(struct tulip_softc *sc)
 	struct tulip_rxsoft *rxs;
 	struct tulip_txsoft *txs;
 	device_t self = sc-sc_dev;
-	int i;
+	int i, s;
 
 	/*
 	 * Succeed now if there isn't any work to do.
@@ -600,9 +600,14 @@ tlp_detach(struct tulip_softc *sc)
 	if ((sc-sc_flags  TULIPF_ATTACHED) == 0)
 		return (0);
 
-	/* Unhook our tick handler. */
-	if (sc-sc_tick)
-		callout_stop(sc-sc_tick_callout);
+	s = splnet();
+	/* Stop the interface. Callouts are stopped in it. */
+	tlp_stop(ifp, 1);
+	splx(s);
+
+	/* Destroy our callouts. */
+	callout_destroy(sc-sc_nway_callout);
+	callout_destroy(sc-sc_tick_callout);
 
 	if (sc-sc_flags  TULIPF_HAS_MII) {
 		/* Detach all PHYs */



CVS commit: [nick-nhusb] src/sys/dev/usb

2015-03-02 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Mar  3 06:36:53 UTC 2015

Modified Files:
src/sys/dev/usb [nick-nhusb]: ehci.c ehcireg.h

Log Message:
Improve EHCI_PAGE macros and usage.

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.234.2.36 -r1.234.2.37 src/sys/dev/usb/ehci.c
cvs rdiff -u -r1.34.14.4 -r1.34.14.5 src/sys/dev/usb/ehcireg.h

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

Modified files:

Index: src/sys/dev/usb/ehci.c
diff -u src/sys/dev/usb/ehci.c:1.234.2.36 src/sys/dev/usb/ehci.c:1.234.2.37
--- src/sys/dev/usb/ehci.c:1.234.2.36	Mon Mar  2 22:16:38 2015
+++ src/sys/dev/usb/ehci.c	Tue Mar  3 06:36:53 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: ehci.c,v 1.234.2.36 2015/03/02 22:16:38 skrll Exp $ */
+/*	$NetBSD: ehci.c,v 1.234.2.37 2015/03/03 06:36:53 skrll Exp $ */
 
 /*
  * Copyright (c) 2004-2012 The NetBSD Foundation, Inc.
@@ -53,7 +53,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ehci.c,v 1.234.2.36 2015/03/02 22:16:38 skrll Exp $);
+__KERNEL_RCSID(0, $NetBSD: ehci.c,v 1.234.2.37 2015/03/03 06:36:53 skrll Exp $);
 
 #include ohci.h
 #include uhci.h
@@ -2835,12 +2835,12 @@ ehci_alloc_sqtd_chain(struct ehci_pipe *
 		}
 
 		/* Find number of pages we'll be using, insert dma addresses */
-		pages = EHCI_PAGE(curlen + EHCI_PAGE_SIZE - 1)  12;
+		pages = EHCI_NPAGES(curlen);
 		KASSERT(pages = EHCI_QTD_NBUFFERS);
 		pageoffs = EHCI_PAGE(curoffs);
 		for (i = 0; i  pages; i++) {
 			a = DMAADDR(dma, pageoffs + i * EHCI_PAGE_SIZE);
-			cur-qtd.qtd_buffer[i] = htole32(a  0xF000);
+			cur-qtd.qtd_buffer[i] = htole32(EHCI_PAGE(a));
 			/* Cast up to avoid compiler warnings */
 			cur-qtd.qtd_buffer_hi[i] = htole32((uint64_t)a  32);
 		}

Index: src/sys/dev/usb/ehcireg.h
diff -u src/sys/dev/usb/ehcireg.h:1.34.14.4 src/sys/dev/usb/ehcireg.h:1.34.14.5
--- src/sys/dev/usb/ehcireg.h:1.34.14.4	Sun Feb  1 08:45:04 2015
+++ src/sys/dev/usb/ehcireg.h	Tue Mar  3 06:36:53 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: ehcireg.h,v 1.34.14.4 2015/02/01 08:45:04 skrll Exp $	*/
+/*	$NetBSD: ehcireg.h,v 1.34.14.5 2015/03/03 06:36:53 skrll Exp $	*/
 
 /*
  * Copyright (c) 2001, 2004 The NetBSD Foundation, Inc.
@@ -188,10 +188,12 @@
 #define EHCI_MAX_PORTS		16 /* only 4 bits available in EHCI_HCS_N_PORTS */
 
 /* No data structure may cross a page boundary. */
-#define EHCI_PAGE_SIZE 0x1000
-#define EHCI_PAGE_MASK (EHCI_PAGE_SIZE - 1)
-#define EHCI_PAGE(x) ((x)  ~EHCI_PAGE_MASK)
-#define EHCI_PAGE_OFFSET(x) ((x)  EHCI_PAGE_MASK)
+#define EHCI_PAGE_SHIFT		12
+#define EHCI_PAGE_SIZE		(1  EHCI_PAGE_SHIFT)
+#define EHCI_PAGE_MASK		(EHCI_PAGE_SIZE - 1)
+#define EHCI_PAGE(x)		((x)  ~EHCI_PAGE_MASK)
+#define EHCI_PAGE_OFFSET(x)	((x)  EHCI_PAGE_MASK)
+#define EHCI_NPAGES(x)		(((x) + EHCI_PAGE_MASK)  EHCI_PAGE_SHIFT)
 
 typedef uint32_t ehci_link_t;
 #define EHCI_LINK_TERMINATE	0x0001



CVS commit: src/doc

2015-03-02 Thread Matthias Scheler
Module Name:src
Committed By:   tron
Date:   Tue Mar  3 07:32:56 UTC 2015

Modified Files:
src/doc: CHANGES CHANGES.prev

Log Message:
Postfix 2.11.4 will ship with NetBSD 7.0.


To generate a diff of this commit:
cvs rdiff -u -r1.2048 -r1.2049 src/doc/CHANGES
cvs rdiff -u -r1.125 -r1.126 src/doc/CHANGES.prev

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

Modified files:

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.2048 src/doc/CHANGES:1.2049
--- src/doc/CHANGES:1.2048	Thu Feb 26 10:14:33 2015
+++ src/doc/CHANGES	Tue Mar  3 07:32:56 2015
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			$Revision: 1.2048 $
+# LIST OF CHANGES FROM LAST RELEASE:			$Revision: 1.2049 $
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -131,6 +131,5 @@ Changes from NetBSD 7.0 to NetBSD 8.0:
 	dhcpcd(8): Import dhcpcd-6.7.1. [roy 20150130]
 	zoneinfo: Import tzdata2015a. [apb 20150131]
 	libc: Import tzdata2015a. [christos 20150131]
-	postfix(1): Import version 2.11.4. [tron 20150221]
 	bind: patch to version 9.10.1-P2. [spz 20150221]
 	network: introduce RTF_LOCAL for local address routes. [roy 20150226]

Index: src/doc/CHANGES.prev
diff -u src/doc/CHANGES.prev:1.125 src/doc/CHANGES.prev:1.126
--- src/doc/CHANGES.prev:1.125	Tue Jan 27 18:20:56 2015
+++ src/doc/CHANGES.prev	Tue Mar  3 07:32:56 2015
@@ -1,4 +1,4 @@
-LIST OF CHANGES FROM PREVIOUS RELEASES:			$Revision: 1.125 $
+LIST OF CHANGES FROM PREVIOUS RELEASES:			$Revision: 1.126 $
 
 
 Changes from 386bsd 0.1 + patchkit 0.2.2 to NetBSD 0.8:
@@ -11712,3 +11712,4 @@ Changes from NetBSD 6.0 to NetBSD 7.0:
 			QEMU, KVM, and Google Compute Engine.  From OpenBSD.
 			[tls 20141026]
 	postfix(1): Import version 2.11.3. [tron 20150124]
+	postfix(1): Import version 2.11.4. [tron 20150221]



CVS commit: [netbsd-7] src

2015-03-02 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Mar  3 07:11:08 UTC 2015

Modified Files:
src/doc [netbsd-7]: 3RDPARTY
src/external/ibm-public/postfix/dist [netbsd-7]: HISTORY
src/external/ibm-public/postfix/dist/src/cleanup [netbsd-7]:
cleanup_map1n.c
src/external/ibm-public/postfix/dist/src/global [netbsd-7]:
mail_version.h tok822_tree.c
src/external/ibm-public/postfix/dist/src/postconf [netbsd-7]:
postconf_master.c
src/external/ibm-public/postfix/dist/src/smtp [netbsd-7]:
smtp_tls_policy.c

Log Message:
Apply patch (requested by tron in ticket #556):
Update Postfix to 2.11.4.


To generate a diff of this commit:
cvs rdiff -u -r1.1145.2.8 -r1.1145.2.9 src/doc/3RDPARTY
cvs rdiff -u -r1.1.1.21.2.1 -r1.1.1.21.2.2 \
src/external/ibm-public/postfix/dist/HISTORY
cvs rdiff -u -r1.1.1.4 -r1.1.1.4.2.1 \
src/external/ibm-public/postfix/dist/src/cleanup/cleanup_map1n.c
cvs rdiff -u -r1.1.1.21.2.1 -r1.1.1.21.2.2 \
src/external/ibm-public/postfix/dist/src/global/mail_version.h
cvs rdiff -u -r1.1.1.1 -r1.1.1.1.28.1 \
src/external/ibm-public/postfix/dist/src/global/tok822_tree.c
cvs rdiff -u -r1.3 -r1.3.2.1 \
src/external/ibm-public/postfix/dist/src/postconf/postconf_master.c
cvs rdiff -u -r1.1.1.1 -r1.1.1.1.4.1 \
src/external/ibm-public/postfix/dist/src/smtp/smtp_tls_policy.c

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

Modified files:

Index: src/doc/3RDPARTY
diff -u src/doc/3RDPARTY:1.1145.2.8 src/doc/3RDPARTY:1.1145.2.9
--- src/doc/3RDPARTY:1.1145.2.8	Thu Feb  5 15:13:12 2015
+++ src/doc/3RDPARTY	Tue Mar  3 07:11:08 2015
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.1145.2.8 2015/02/05 15:13:12 martin Exp $
+#	$NetBSD: 3RDPARTY,v 1.1145.2.9 2015/03/03 07:11:08 snj Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -1102,8 +1102,8 @@ and more. Vern's ping is gone. We are to
 now to do a new import.
 
 Package:	Postfix
-Version:	2.11.3
-Current Vers:	2.11.3
+Version:	3.0
+Current Vers:	2.11.4
 Maintainer:	Wietse Venema wie...@porcupine.org
 Archive Site:	ftp://postfix.cloud9.net/official/
 Home Page:	http://www.postfix.org/

Index: src/external/ibm-public/postfix/dist/HISTORY
diff -u src/external/ibm-public/postfix/dist/HISTORY:1.1.1.21.2.1 src/external/ibm-public/postfix/dist/HISTORY:1.1.1.21.2.2
--- src/external/ibm-public/postfix/dist/HISTORY:1.1.1.21.2.1	Tue Jan 27 08:14:03 2015
+++ src/external/ibm-public/postfix/dist/HISTORY	Tue Mar  3 07:11:08 2015
@@ -19618,3 +19618,26 @@ Apologies for any names omitted.
 	Cleanup: revert the workaround that places headers inserted
 	with PREPEND actions or policy requests BELOW Postfix's own
 	Received: message header. File: smtpd/smtpd.c.
+
+20141025
+
+	Bugfix (introduced: Postfix 2.11): core dump when
+	smtp_policy_maps specifies an invalid TLS level. Viktor
+	Dukhovni. File: smtp/smtp_tls_policy.c.
+
+20150106
+
+	Robustness: don't segfault due to excessive recursion after
+	a faulty configuration runs into the virtual_alias_recursion_limit.
+	File: global/tok822_tree.c.
+
+20150115
+
+	Safety: stop aliasing loops that exponentially increase the
+	address length with each iteration. Back-ported from Postfix
+	3.0. File: cleanup/cleanup_map1n.c.
+
+20150117
+
+	Cleanup: missing  in \%s\ in postconf(1) fatal error
+	messages. Iain Hibbert. File: postconf/postconf_master.c.

Index: src/external/ibm-public/postfix/dist/src/cleanup/cleanup_map1n.c
diff -u src/external/ibm-public/postfix/dist/src/cleanup/cleanup_map1n.c:1.1.1.4 src/external/ibm-public/postfix/dist/src/cleanup/cleanup_map1n.c:1.1.1.4.2.1
--- src/external/ibm-public/postfix/dist/src/cleanup/cleanup_map1n.c:1.1.1.4	Sun Jul  6 19:27:49 2014
+++ src/external/ibm-public/postfix/dist/src/cleanup/cleanup_map1n.c	Tue Mar  3 07:11:08 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: cleanup_map1n.c,v 1.1.1.4 2014/07/06 19:27:49 tron Exp $	*/
+/*	$NetBSD: cleanup_map1n.c,v 1.1.1.4.2.1 2015/03/03 07:11:08 snj Exp $	*/
 
 /*++
 /* NAME
@@ -141,6 +141,15 @@ ARGV   *cleanup_map1n_internal(CLEANUP_S
 	if ((lookup = mail_addr_map(maps, STR(state-temp1), propagate)) != 0) {
 		saved_lhs = mystrdup(argv-argv[arg]);
 		for (i = 0; i  lookup-argc; i++) {
+		if (strlen(lookup-argv[i])  var_line_limit) {
+			msg_warn(%s: unreasonable %s result %.300s... -- 
+ message not accepted, try again later,
+			 state-queue_id, maps-title, lookup-argv[i]);
+			state-errs |= CLEANUP_STAT_DEFER;
+			UPDATE(state-reason, 4.6.0 Alias expansion error);
+			UNEXPAND(argv, addr);
+			RETURN(argv);
+		}
 		unquote_822_local(state-temp1, lookup-argv[i]);
 		if (i == 0) {
 			UPDATE(argv-argv[arg], STR(state-temp1));

Index: src/external/ibm-public/postfix/dist/src/global/mail_version.h
diff -u 

CVS commit: src/usr.sbin/makemandb

2015-03-02 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Mon Mar  2 13:51:24 UTC 2015

Modified Files:
src/usr.sbin/makemandb: makemandb.c

Log Message:
Explicitly deal with end of lists. PR 49708.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/usr.sbin/makemandb/makemandb.c

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

Modified files:

Index: src/usr.sbin/makemandb/makemandb.c
diff -u src/usr.sbin/makemandb/makemandb.c:1.25 src/usr.sbin/makemandb/makemandb.c:1.26
--- src/usr.sbin/makemandb/makemandb.c:1.25	Sat Oct 18 08:33:31 2014
+++ src/usr.sbin/makemandb/makemandb.c	Mon Mar  2 13:51:24 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: makemandb.c,v 1.25 2014/10/18 08:33:31 snj Exp $	*/
+/*	$NetBSD: makemandb.c,v 1.26 2015/03/02 13:51:24 joerg Exp $	*/
 /*
  * Copyright (c) 2011 Abhinav Upadhyay er.abhinav.upadh...@gmail.com
  * Copyright (c) 2011 Kristaps Dzonsons krist...@bsd.lv
@@ -17,7 +17,7 @@
  */
 
 #include sys/cdefs.h
-__RCSID($NetBSD: makemandb.c,v 1.25 2014/10/18 08:33:31 snj Exp $);
+__RCSID($NetBSD: makemandb.c,v 1.26 2015/03/02 13:51:24 joerg Exp $);
 
 #include sys/stat.h
 #include sys/types.h
@@ -981,7 +981,7 @@ pmdoc_Nd(const struct mdoc_node *n, mand
 	char *temp;
 	char *nd_text;
 
-	if (n == NULL)
+	if (n == NULL || n-tok == MDOC_MAX)
 		return;
 
 	if (n-type == MDOC_TEXT) {
@@ -1104,7 +1104,7 @@ pmdoc_Pp(const struct mdoc_node *n, mand
 static void
 pmdoc_Sh(const struct mdoc_node *n, mandb_rec *rec)
 {
-	if (n == NULL)
+	if (n == NULL || n-tok == MDOC_MAX)
 		return;
 	int xr_found = 0;
 



CVS commit: src/sys/arch/sparc/sparc

2015-03-02 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Mar  2 13:53:19 UTC 2015

Modified Files:
src/sys/arch/sparc/sparc: trap.c

Log Message:
Handle EINVAL in the fault path, send SIGSEGV on mmap access past EOF.


To generate a diff of this commit:
cvs rdiff -u -r1.191 -r1.192 src/sys/arch/sparc/sparc/trap.c

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

Modified files:

Index: src/sys/arch/sparc/sparc/trap.c
diff -u src/sys/arch/sparc/sparc/trap.c:1.191 src/sys/arch/sparc/sparc/trap.c:1.192
--- src/sys/arch/sparc/sparc/trap.c:1.191	Fri Nov  1 06:22:46 2013
+++ src/sys/arch/sparc/sparc/trap.c	Mon Mar  2 13:53:19 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: trap.c,v 1.191 2013/11/01 06:22:46 mrg Exp $ */
+/*	$NetBSD: trap.c,v 1.192 2015/03/02 13:53:19 martin Exp $ */
 
 /*
  * Copyright (c) 1996
@@ -49,7 +49,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: trap.c,v 1.191 2013/11/01 06:22:46 mrg Exp $);
+__KERNEL_RCSID(0, $NetBSD: trap.c,v 1.192 2015/03/02 13:53:19 martin Exp $);
 
 #include opt_ddb.h
 #include opt_compat_svr4.h
@@ -949,17 +949,24 @@ kfault:
 			return;
 		}
 		KSI_INIT_TRAP(ksi);
-		if (rv == ENOMEM) {
+		switch (rv) {
+		case ENOMEM:
 			printf(UVM: pid %d (%s), uid %d killed: out of swap\n,
 			   p-p_pid, p-p_comm,
 			   l-l_cred ?
 			   kauth_cred_geteuid(l-l_cred) : -1);
 			ksi.ksi_signo = SIGKILL;
-			ksi.ksi_code = SI_NOINFO;
-		} else {
+			break;
+		case EINVAL:
+			ksi.ksi_signo = SIGBUS;
+			ksi.ksi_code = BUS_ADRERR;
+		case EACCES:
 			ksi.ksi_signo = SIGSEGV;
-			ksi.ksi_code = (rv == EACCES
-? SEGV_ACCERR : SEGV_MAPERR);
+			ksi.ksi_code = SEGV_ACCERR;
+		default:
+			ksi.ksi_signo = SIGSEGV;
+			ksi.ksi_code = SEGV_MAPERR;
+			break;
 		}
 		ksi.ksi_trap = type;
 		ksi.ksi_addr = (void *)v;
@@ -1236,17 +1243,24 @@ kfault:
 			return;
 		}
 		KSI_INIT_TRAP(ksi);
-		if (rv == ENOMEM) {
+		switch (rv) {
+		case ENOMEM:
 			printf(UVM: pid %d (%s), uid %d killed: out of swap\n,
 			   p-p_pid, p-p_comm,
 			   l-l_cred ?
 			   kauth_cred_geteuid(l-l_cred) : -1);
 			ksi.ksi_signo = SIGKILL;
-			ksi.ksi_code = SI_NOINFO;
-		} else {
+			break;
+		case EINVAL:
+			ksi.ksi_signo = SIGBUS;
+			ksi.ksi_code = BUS_ADRERR;
+		case EACCES:
 			ksi.ksi_signo = SIGSEGV;
-			ksi.ksi_code = (rv == EACCES)
-? SEGV_ACCERR : SEGV_MAPERR;
+			ksi.ksi_code = SEGV_ACCERR;
+		default:
+			ksi.ksi_signo = SIGSEGV;
+			ksi.ksi_code = SEGV_MAPERR;
+			break;
 		}
 		ksi.ksi_trap = type;
 		ksi.ksi_addr = (void *)sfva;



CVS commit: src/sys/arch/sparc64

2015-03-02 Thread Takeshi Nakayama
Module Name:src
Committed By:   nakayama
Date:   Mon Mar  2 14:17:06 UTC 2015

Modified Files:
src/sys/arch/sparc64/dev: consinit.c
src/sys/arch/sparc64/sparc64: db_tlb_access.S locore.s ofw_machdep.c

Log Message:
prom_printf converts \n to \r\n internally, so omit \r.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/sys/arch/sparc64/dev/consinit.c
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/sparc64/sparc64/db_tlb_access.S
cvs rdiff -u -r1.380 -r1.381 src/sys/arch/sparc64/sparc64/locore.s
cvs rdiff -u -r1.43 -r1.44 src/sys/arch/sparc64/sparc64/ofw_machdep.c

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

Modified files:

Index: src/sys/arch/sparc64/dev/consinit.c
diff -u src/sys/arch/sparc64/dev/consinit.c:1.27 src/sys/arch/sparc64/dev/consinit.c:1.28
--- src/sys/arch/sparc64/dev/consinit.c:1.27	Thu Sep 12 12:57:48 2013
+++ src/sys/arch/sparc64/dev/consinit.c	Mon Mar  2 14:17:06 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: consinit.c,v 1.27 2013/09/12 12:57:48 martin Exp $	*/
+/*	$NetBSD: consinit.c,v 1.28 2015/03/02 14:17:06 nakayama Exp $	*/
 
 /*-
  * Copyright (c) 1999 Eduardo E. Horvath
@@ -29,7 +29,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: consinit.c,v 1.27 2013/09/12 12:57:48 martin Exp $);
+__KERNEL_RCSID(0, $NetBSD: consinit.c,v 1.28 2015/03/02 14:17:06 nakayama Exp $);
 
 #include opt_ddb.h
 #include pcons.h
@@ -172,7 +172,7 @@ consinit(void)
 	char buffer[128];
 	const char *consname = unknown;
 
-	DBPRINT((consinit()\r\n));
+	DBPRINT((consinit()\n));
 
 	if (cn_tab != consdev_prom)
 		return;
@@ -180,13 +180,13 @@ consinit(void)
 	if ((prom_stdin_node = prom_instance_to_package(prom_stdin())) == 0) {
 		printf(WARNING: no PROM stdin\n);
 	}
-	DBPRINT((stdin node = %x\r\n, prom_stdin_node));
+	DBPRINT((stdin node = %x\n, prom_stdin_node));
 
 	if ((prom_stdout_node = prom_instance_to_package(prom_stdout())) == 0)
 		printf(WARNING: no PROM stdout\n);
-	DBPRINT((stdout package = %x\r\n, prom_stdout_node));
+	DBPRINT((stdout package = %x\n, prom_stdout_node));
 
-	DBPRINT((buffer @ %p\r\n, buffer));
+	DBPRINT((buffer @ %p\n, buffer));
 
 	if (prom_stdin_node != 0 
 	(prom_getproplen(prom_stdin_node, keyboard) = 0)) {

Index: src/sys/arch/sparc64/sparc64/db_tlb_access.S
diff -u src/sys/arch/sparc64/sparc64/db_tlb_access.S:1.2 src/sys/arch/sparc64/sparc64/db_tlb_access.S:1.3
--- src/sys/arch/sparc64/sparc64/db_tlb_access.S:1.2	Tue Feb 23 05:32:08 2010
+++ src/sys/arch/sparc64/sparc64/db_tlb_access.S	Mon Mar  2 14:17:06 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: db_tlb_access.S,v 1.2 2010/02/23 05:32:08 mrg Exp $	*/
+/*	$NetBSD: db_tlb_access.S,v 1.3 2015/03/02 14:17:06 nakayama Exp $	*/
 
 /*
  * Copyright (c) 1996-2002 Eduardo Horvath
@@ -105,7 +105,7 @@ ENTRY_NOPROFILE(print_itlb)
 2:
 	.asciz	%2d:%016lx %016lx 
 3:
-	.asciz	%2d:%016lx %016lx\r\n
+	.asciz	%2d:%016lx %016lx\n
 	.text
 #else
 ENTRY_NOPROFILE(print_dtlb)
@@ -196,6 +196,6 @@ ENTRY_NOPROFILE(print_itlb)
 2:
 	.asciz	%2d:%08x:%08x %08x:%08x 
 3:
-	.asciz	%2d:%08x:%08x %08x:%08x\r\n
+	.asciz	%2d:%08x:%08x %08x:%08x\n
 	.text
 #endif

Index: src/sys/arch/sparc64/sparc64/locore.s
diff -u src/sys/arch/sparc64/sparc64/locore.s:1.380 src/sys/arch/sparc64/sparc64/locore.s:1.381
--- src/sys/arch/sparc64/sparc64/locore.s:1.380	Mon Mar  2 13:58:55 2015
+++ src/sys/arch/sparc64/sparc64/locore.s	Mon Mar  2 14:17:06 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.s,v 1.380 2015/03/02 13:58:55 nakayama Exp $	*/
+/*	$NetBSD: locore.s,v 1.381 2015/03/02 14:17:06 nakayama Exp $	*/
 
 /*
  * Copyright (c) 2006-2010 Matthew R. Green
@@ -1627,7 +1627,7 @@ asmptechk:
 
 	.data
 2:
-	.asciz	asmptechk: %x %x %x %x:%x\r\n
+	.asciz	asmptechk: %x %x %x %x:%x\n
 	_ALIGN
 	.text
 #endif
@@ -3513,7 +3513,7 @@ setup_sparcintr:
 
 	STACKFRAME(-CC64FSZ)		! Get a clean register window
 	LOAD_ASCIZ(%o0,\
-	interrupt_vector: number %lx softint mask %lx pil %lu slot %p\r\n)
+	interrupt_vector: number %lx softint mask %lx pil %lu slot %p\n)
 	mov	%g2, %o1
 	rdpr	%pil, %o3
 	mov	%g1, %o4
@@ -3545,7 +3545,7 @@ ret_from_intr_vector:
 #if 1
 	set	PANICSTACK-STKB, %g1	! Use panic stack temporarily
 	save	%g1, -CC64FSZ, %sp	! Get a clean register window
-	LOAD_ASCIZ(%o0, interrupt_vector: spurious vector %lx at pil %d\r\n)
+	LOAD_ASCIZ(%o0, interrupt_vector: spurious vector %lx at pil %d\n)
 	mov	%g7, %o1
 	GLOBTOLOC
 	clr	%g4
@@ -3830,7 +3830,7 @@ sparc_intr_retry:
 	 nop
 
 	STACKFRAME(-CC64FSZ)		! Get a clean register window
-	LOAD_ASCIZ(%o0, sparc_interrupt: func %p arg %p\r\n)
+	LOAD_ASCIZ(%o0, sparc_interrupt: func %p arg %p\n)
 	mov	%i0, %o2		! arg
 	GLOBTOLOC
 	call	prom_printf
@@ -3890,7 +3890,7 @@ intrcmplt:
 	 nop
 
 	STACKFRAME(-CC64FSZ)		! Get a clean register window
-	LOAD_ASCIZ(%o0, sparc_interrupt:  done\r\n)
+	LOAD_ASCIZ(%o0, sparc_interrupt:  done\n)
 	GLOBTOLOC
 	call	prom_printf
 	 nop
@@ -4542,7 +4542,7 @@ ENTRY_NOPROFILE(cpu_initialize)	/* for c
 

CVS commit: src/sys/arch/sparc64/sparc64

2015-03-02 Thread Takeshi Nakayama
Module Name:src
Committed By:   nakayama
Date:   Mon Mar  2 13:48:00 UTC 2015

Modified Files:
src/sys/arch/sparc64/sparc64: locore.s

Log Message:
Use panic stack temporarily for calling prom_printf in a trap
handler.

It seems that openfirmware cannot handle over 4GB pointers, and
stack pointers may point to over 4GB since VA layout was rearranged
by rev 1.33 of vmparam.h.  Therefore, use panic stack to avoid
panicking in OF_write used by prom_printf.


To generate a diff of this commit:
cvs rdiff -u -r1.378 -r1.379 src/sys/arch/sparc64/sparc64/locore.s

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

Modified files:

Index: src/sys/arch/sparc64/sparc64/locore.s
diff -u src/sys/arch/sparc64/sparc64/locore.s:1.378 src/sys/arch/sparc64/sparc64/locore.s:1.379
--- src/sys/arch/sparc64/sparc64/locore.s:1.378	Mon Feb 23 12:36:58 2015
+++ src/sys/arch/sparc64/sparc64/locore.s	Mon Mar  2 13:48:00 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.s,v 1.378 2015/02/23 12:36:58 palle Exp $	*/
+/*	$NetBSD: locore.s,v 1.379 2015/03/02 13:48:00 nakayama Exp $	*/
 
 /*
  * Copyright (c) 2006-2010 Matthew R. Green
@@ -3547,7 +3547,8 @@ ret_from_intr_vector:
 	 nop
 #endif
 #if 1
-	STACKFRAME(-CC64FSZ)		! Get a clean register window
+	set	PANICSTACK-STKB, %g1	! Use panic stack temporarily
+	save	%g1, -CC64FSZ, %sp	! Get a clean register window
 	LOAD_ASCIZ(%o0, interrupt_vector: spurious vector %lx at pil %d\r\n)
 	mov	%g7, %o1
 	GLOBTOLOC



CVS commit: src/sys/arch/sparc64/sparc64

2015-03-02 Thread Takeshi Nakayama
Module Name:src
Committed By:   nakayama
Date:   Mon Mar  2 13:58:55 UTC 2015

Modified Files:
src/sys/arch/sparc64/sparc64: locore.s

Log Message:
PANICSTACK is a pointer itself, not a pointer to pointer.


To generate a diff of this commit:
cvs rdiff -u -r1.379 -r1.380 src/sys/arch/sparc64/sparc64/locore.s

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

Modified files:

Index: src/sys/arch/sparc64/sparc64/locore.s
diff -u src/sys/arch/sparc64/sparc64/locore.s:1.379 src/sys/arch/sparc64/sparc64/locore.s:1.380
--- src/sys/arch/sparc64/sparc64/locore.s:1.379	Mon Mar  2 13:48:00 2015
+++ src/sys/arch/sparc64/sparc64/locore.s	Mon Mar  2 13:58:55 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.s,v 1.379 2015/03/02 13:48:00 nakayama Exp $	*/
+/*	$NetBSD: locore.s,v 1.380 2015/03/02 13:58:55 nakayama Exp $	*/
 
 /*
  * Copyright (c) 2006-2010 Matthew R. Green
@@ -2145,9 +2145,7 @@ winfixspill:
 	wrpr	%g0, 0, %otherwin
 	or	%lo(2f), %o0, %o0
 	wrpr	%g0, WSTATE_KERN, %wstate
-	sethi	%hi(PANICSTACK), %sp
-	LDPTR	[%sp + %lo(PANICSTACK)], %sp
-	add	%sp, -CC64FSZ-STKB, %sp
+	set	PANICSTACK-CC64FSZ-STKB, %sp
 	ta	1; nop	! This helps out traptrace.
 	call	_C_LABEL(panic)! This needs to be fixed properly but we should panic here
 	 mov	%g1, %o1
@@ -2927,9 +2925,7 @@ slowtrap:
 	cmp	%g7, WSTATE_KERN
 	bnz,pt	%icc, 1f		! User stack -- we'll blow it away
 	 nop
-	sethi	%hi(PANICSTACK), %sp
-	LDPTR	[%sp + %lo(PANICSTACK)], %sp
-	add	%sp, -CC64FSZ-STKB, %sp	
+	set	PANICSTACK-CC64FSZ-STKB, %sp
 1:
 #endif
 	rdpr	%tt, %g4



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

2015-03-02 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Mar  2 13:36:36 UTC 2015

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

Log Message:
Handle EINVAL in the fault path and send SIGBUS for mmap acces past EOF.


To generate a diff of this commit:
cvs rdiff -u -r1.102 -r1.103 src/sys/arch/arm/arm32/fault.c

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

Modified files:

Index: src/sys/arch/arm/arm32/fault.c
diff -u src/sys/arch/arm/arm32/fault.c:1.102 src/sys/arch/arm/arm32/fault.c:1.103
--- src/sys/arch/arm/arm32/fault.c:1.102	Sat Oct 25 10:58:12 2014
+++ src/sys/arch/arm/arm32/fault.c	Mon Mar  2 13:36:36 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: fault.c,v 1.102 2014/10/25 10:58:12 skrll Exp $	*/
+/*	$NetBSD: fault.c,v 1.103 2015/03/02 13:36:36 martin Exp $	*/
 
 /*
  * Copyright 2003 Wasabi Systems, Inc.
@@ -81,7 +81,7 @@
 #include opt_kgdb.h
 
 #include sys/types.h
-__KERNEL_RCSID(0, $NetBSD: fault.c,v 1.102 2014/10/25 10:58:12 skrll Exp $);
+__KERNEL_RCSID(0, $NetBSD: fault.c,v 1.103 2015/03/02 13:36:36 martin Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -507,15 +507,26 @@ data_abort_handler(trapframe_t *tf)
 
 	KSI_INIT_TRAP(ksi);
 
-	if (error == ENOMEM) {
+	switch (error) {
+	case ENOMEM:
 		printf(UVM: pid %d (%s), uid %d killed: 
 		out of swap\n, l-l_proc-p_pid, l-l_proc-p_comm,
 		l-l_cred ? kauth_cred_geteuid(l-l_cred) : -1);
 		ksi.ksi_signo = SIGKILL;
-	} else
+		break;
+	case EACCES:
 		ksi.ksi_signo = SIGSEGV;
-
-	ksi.ksi_code = (error == EACCES) ? SEGV_ACCERR : SEGV_MAPERR;
+		ksi.ksi_code = SEGV_ACCERR;
+		break;
+	case EINVAL:
+		ksi.ksi_signo = SIGBUS;
+		ksi.ksi_code = BUS_ADRERR;
+		break;
+	default:
+		ksi.ksi_signo = SIGSEGV;
+		ksi.ksi_code = SEGV_MAPERR;
+		break;
+	}
 	ksi.ksi_addr = (uint32_t *)(intptr_t) far;
 	ksi.ksi_trap = fsr;
 	UVMHIST_LOG(maphist,  - error (%d), error, 0, 0, 0);



CVS commit: src/sys/dev/pci

2015-03-02 Thread NONAKA Kimihiro
Module Name:src
Committed By:   nonaka
Date:   Mon Mar  2 12:07:27 UTC 2015

Modified Files:
src/sys/dev/pci: if_iwm.c

Log Message:
Correctly set lowest_present_ofdm in iwm_mvm_ack_rates().
From OpenBSD rev.1.23.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/dev/pci/if_iwm.c

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

Modified files:

Index: src/sys/dev/pci/if_iwm.c
diff -u src/sys/dev/pci/if_iwm.c:1.15 src/sys/dev/pci/if_iwm.c:1.16
--- src/sys/dev/pci/if_iwm.c:1.15	Wed Feb 25 12:41:15 2015
+++ src/sys/dev/pci/if_iwm.c	Mon Mar  2 12:07:27 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_iwm.c,v 1.15 2015/02/25 12:41:15 nonaka Exp $	*/
+/*	$NetBSD: if_iwm.c,v 1.16 2015/03/02 12:07:27 nonaka Exp $	*/
 /*	OpenBSD: if_iwm.c,v 1.18 2015/02/11 01:12:42 brad Exp	*/
 
 /*
@@ -105,7 +105,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_iwm.c,v 1.15 2015/02/25 12:41:15 nonaka Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_iwm.c,v 1.16 2015/03/02 12:07:27 nonaka Exp $);
 
 #include sys/param.h
 #include sys/conf.h
@@ -4775,8 +4775,8 @@ iwm_mvm_ack_rates(struct iwm_softc *sc, 
 	for (i = IWM_FIRST_OFDM_RATE; i = IWM_LAST_NON_HT_RATE; i++) {
 		int adj = i - IWM_FIRST_OFDM_RATE;
 		ofdm |= (1  adj);
-		if (lowest_present_cck  adj)
-			lowest_present_cck = adj;
+		if (lowest_present_ofdm  adj)
+			lowest_present_ofdm = adj;
 	}
 
 	/*



CVS commit: src/sys/arch/hppa/hppa

2015-03-02 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Mar  2 11:05:12 UTC 2015

Modified Files:
src/sys/arch/hppa/hppa: trap.c

Log Message:
Send SIGBUS when accessing mmap() past end of file (handle EINVAL in fault
path). While there, handle ENOMEM as well.


To generate a diff of this commit:
cvs rdiff -u -r1.106 -r1.107 src/sys/arch/hppa/hppa/trap.c

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

Modified files:

Index: src/sys/arch/hppa/hppa/trap.c
diff -u src/sys/arch/hppa/hppa/trap.c:1.106 src/sys/arch/hppa/hppa/trap.c:1.107
--- src/sys/arch/hppa/hppa/trap.c:1.106	Thu Mar  6 19:02:58 2014
+++ src/sys/arch/hppa/hppa/trap.c	Mon Mar  2 11:05:12 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: trap.c,v 1.106 2014/03/06 19:02:58 skrll Exp $	*/
+/*	$NetBSD: trap.c,v 1.107 2015/03/02 11:05:12 martin Exp $	*/
 
 /*-
  * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
@@ -58,7 +58,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: trap.c,v 1.106 2014/03/06 19:02:58 skrll Exp $);
+__KERNEL_RCSID(0, $NetBSD: trap.c,v 1.107 2015/03/02 11:05:12 martin Exp $);
 
 /* #define INTRDEBUG */
 /* #define TRAPDEBUG */
@@ -79,6 +79,7 @@ __KERNEL_RCSID(0, $NetBSD: trap.c,v 1.1
 #include sys/acct.h
 #include sys/signal.h
 #include sys/device.h
+#include sys/kauth.h
 #include sys/kmem.h
 #include sys/userret.h
 
@@ -881,9 +882,29 @@ do_onfault:
 user_backtrace(frame, l, type);
 #endif
 KSI_INIT_TRAP(ksi);
-ksi.ksi_signo = SIGSEGV;
-ksi.ksi_code = (ret == EACCES ?
-		SEGV_ACCERR : SEGV_MAPERR);
+switch (ret) {
+case EACCES:
+	ksi.ksi_signo = SIGSEGV;
+	ksi.ksi_code = SEGV_ACCERR;
+	break;
+case ENOMEM:
+	ksi.ksi_signo = SIGKILL;
+	printf(UVM: pid %d (%s), uid %d 
+	killed: out of swap\n,
+	p-p_pid, p-p_comm,
+	l-l_cred ? 
+		kauth_cred_geteuid(l-l_cred)
+		: -1);
+	break;
+case EINVAL:
+	ksi.ksi_signo = SIGBUS;
+	ksi.ksi_code = BUS_ADRERR;
+	break;
+default:
+	ksi.ksi_signo = SIGSEGV;
+	ksi.ksi_code = SEGV_MAPERR;
+	break;
+}
 ksi.ksi_trap = type;
 ksi.ksi_addr = (void *)va;
 trapsignal(l, ksi);



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

2015-03-02 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Mar  2 11:37:25 UTC 2015

Modified Files:
src/sys/arch/arm/cortex: gic.c

Log Message:
sc_gic_lines is the total number of valid lines but pic_sources[] is sparse; 
when initializing mpsafe targets make sure to go all the way to the end 
(sc_pic.pic_maxsources) instead


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/arm/cortex/gic.c

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

Modified files:

Index: src/sys/arch/arm/cortex/gic.c
diff -u src/sys/arch/arm/cortex/gic.c:1.12 src/sys/arch/arm/cortex/gic.c:1.13
--- src/sys/arch/arm/cortex/gic.c:1.12	Wed Oct 29 19:27:36 2014
+++ src/sys/arch/arm/cortex/gic.c	Mon Mar  2 11:37:25 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: gic.c,v 1.12 2014/10/29 19:27:36 skrll Exp $	*/
+/*	$NetBSD: gic.c,v 1.13 2015/03/02 11:37:25 jmcneill Exp $	*/
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -34,7 +34,7 @@
 #define _INTR_PRIVATE
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: gic.c,v 1.12 2014/10/29 19:27:36 skrll Exp $);
+__KERNEL_RCSID(0, $NetBSD: gic.c,v 1.13 2015/03/02 11:37:25 jmcneill Exp $);
 
 #include sys/param.h
 #include sys/bus.h
@@ -441,7 +441,7 @@ armgic_cpu_init_targets(struct armgic_so
 	/*
 	 * Update the mpsafe targets 
 	 */
-	for (size_t irq = 32; irq  sc-sc_gic_lines; irq++) {
+	for (size_t irq = 32; irq  sc-sc_pic.pic_maxsources; irq++) {
 		struct intrsource * const is = sc-sc_pic.pic_sources[irq];
 		const bus_size_t targets_reg = GICD_ITARGETSRn(irq / 4);
 		if (is != NULL  is-is_mpsafe) {



CVS commit: src/sys/arch/alpha/alpha

2015-03-02 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Mar  2 11:07:16 UTC 2015

Modified Files:
src/sys/arch/alpha/alpha: trap.c

Log Message:
Handle EINVAL in fault path, so mmap() access past EOF gets SIGBUS.


To generate a diff of this commit:
cvs rdiff -u -r1.131 -r1.132 src/sys/arch/alpha/alpha/trap.c

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

Modified files:

Index: src/sys/arch/alpha/alpha/trap.c
diff -u src/sys/arch/alpha/alpha/trap.c:1.131 src/sys/arch/alpha/alpha/trap.c:1.132
--- src/sys/arch/alpha/alpha/trap.c:1.131	Fri May 16 06:11:21 2014
+++ src/sys/arch/alpha/alpha/trap.c	Mon Mar  2 11:07:16 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: trap.c,v 1.131 2014/05/16 06:11:21 martin Exp $ */
+/* $NetBSD: trap.c,v 1.132 2015/03/02 11:07:16 martin Exp $ */
 
 /*-
  * Copyright (c) 2000, 2001 The NetBSD Foundation, Inc.
@@ -93,7 +93,7 @@
 
 #include sys/cdefs.h			/* RCS ID  Copyright macro defns */
 
-__KERNEL_RCSID(0, $NetBSD: trap.c,v 1.131 2014/05/16 06:11:21 martin Exp $);
+__KERNEL_RCSID(0, $NetBSD: trap.c,v 1.132 2015/03/02 11:07:16 martin Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -496,19 +496,28 @@ do_fault:
 			KSI_INIT_TRAP(ksi);
 			ksi.ksi_addr = (void *)a0;
 			ksi.ksi_trap = a1; /* MMCSR VALUE */
-			if (rv == ENOMEM) {
+			switch (rv) {
+			case ENOMEM:
 printf(UVM: pid %d (%s), uid %d killed: 
 out of swap\n, l-l_proc-p_pid,
 l-l_proc-p_comm,
 l-l_cred ?
 kauth_cred_geteuid(l-l_cred) : -1);
 ksi.ksi_signo = SIGKILL;
-			} else
+break;
+			case EINVAL:
+ksi.ksi_signo = SIGBUS;
+ksi.ksi_code = BUS_ADRERR;
+break;
+			case EACCES:
 ksi.ksi_signo = SIGSEGV;
-			if (rv == EACCES)
 ksi.ksi_code = SEGV_ACCERR;
-			else
+break;
+			default:
+ksi.ksi_signo = SIGSEGV;
 ksi.ksi_code = SEGV_MAPERR;
+break;
+			}
 			break;
 		}
 



CVS commit: src/sys/dev/pci

2015-03-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Mar  2 15:26:57 UTC 2015

Modified Files:
src/sys/dev/pci: amr.c amrvar.h ld_amr.c

Log Message:
From Tom Ivar Helbekkmo:

- Use mutexes and condvars instead of spl() calls.
- Add a couple of bugfixes from FreeBSD (the easily observed ones).
- Add a simple watchdog thread for the newer versions of the hardware,
  that tickles the controller at task submission time if it seems not ready
  (from FreeBSD).
- Add a buffer allocation size hack to the ioctl handler, to work around
  a firmware bug in some versions of the controller (also from FreeBSD).
- Rearrange the bus_dmamap_sync() calls to make the use match the
  documentation.


To generate a diff of this commit:
cvs rdiff -u -r1.58 -r1.59 src/sys/dev/pci/amr.c
cvs rdiff -u -r1.9 -r1.10 src/sys/dev/pci/amrvar.h
cvs rdiff -u -r1.21 -r1.22 src/sys/dev/pci/ld_amr.c

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

Modified files:

Index: src/sys/dev/pci/amr.c
diff -u src/sys/dev/pci/amr.c:1.58 src/sys/dev/pci/amr.c:1.59
--- src/sys/dev/pci/amr.c:1.58	Fri Jul 25 04:10:38 2014
+++ src/sys/dev/pci/amr.c	Mon Mar  2 10:26:57 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: amr.c,v 1.58 2014/07/25 08:10:38 dholland Exp $	*/
+/*	$NetBSD: amr.c,v 1.59 2015/03/02 15:26:57 christos Exp $	*/
 
 /*-
  * Copyright (c) 2002, 2003 The NetBSD Foundation, Inc.
@@ -64,7 +64,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: amr.c,v 1.58 2014/07/25 08:10:38 dholland Exp $);
+__KERNEL_RCSID(0, $NetBSD: amr.c,v 1.59 2015/03/02 15:26:57 christos Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -77,6 +77,8 @@ __KERNEL_RCSID(0, $NetBSD: amr.c,v 1.58
 #include sys/conf.h
 #include sys/kthread.h
 #include sys/kauth.h
+#include sys/mutex.h
+#include sys/condvar.h
 
 #include machine/endian.h
 #include sys/bus.h
@@ -100,7 +102,8 @@ static int	amr_match(device_t, cfdata_t,
 static int	amr_print(void *, const char *);
 static void	amr_shutdown(void *);
 static void	amr_teardown(struct amr_softc *);
-static void	amr_thread(void *);
+static void	amr_quartz_thread(void *);
+static void	amr_std_thread(void *);
 
 static int	amr_quartz_get_work(struct amr_softc *,
 struct amr_mailbox_resp *);
@@ -186,13 +189,15 @@ static struct {
 
 static void	*amr_sdh;
 
+static kcondvar_t thread_cv;
+static kmutex_t	thread_mutex;
+
 static int	amr_max_segs;
 int		amr_max_xfer;
 
 static inline u_int8_t
 amr_inb(struct amr_softc *amr, int off)
 {
-
 	bus_space_barrier(amr-amr_iot, amr-amr_ioh, off, 1,
 	BUS_SPACE_BARRIER_WRITE | BUS_SPACE_BARRIER_READ);
 	return (bus_space_read_1(amr-amr_iot, amr-amr_ioh, off));
@@ -201,7 +206,6 @@ amr_inb(struct amr_softc *amr, int off)
 static inline u_int32_t
 amr_inl(struct amr_softc *amr, int off)
 {
-
 	bus_space_barrier(amr-amr_iot, amr-amr_ioh, off, 4,
 	BUS_SPACE_BARRIER_WRITE | BUS_SPACE_BARRIER_READ);
 	return (bus_space_read_4(amr-amr_iot, amr-amr_ioh, off));
@@ -210,7 +214,6 @@ amr_inl(struct amr_softc *amr, int off)
 static inline void
 amr_outb(struct amr_softc *amr, int off, u_int8_t val)
 {
-
 	bus_space_write_1(amr-amr_iot, amr-amr_ioh, off, val);
 	bus_space_barrier(amr-amr_iot, amr-amr_ioh, off, 1,
 	BUS_SPACE_BARRIER_WRITE);
@@ -219,7 +222,6 @@ amr_outb(struct amr_softc *amr, int off,
 static inline void
 amr_outl(struct amr_softc *amr, int off, u_int32_t val)
 {
-
 	bus_space_write_4(amr-amr_iot, amr-amr_ioh, off, val);
 	bus_space_barrier(amr-amr_iot, amr-amr_ioh, off, 4,
 	BUS_SPACE_BARRIER_WRITE);
@@ -282,6 +284,9 @@ amr_attach(device_t parent, device_t sel
 
 	amr = device_private(self);
 	amr-amr_dv = self;
+
+	mutex_init(amr-amr_mutex, MUTEX_DEFAULT, IPL_BIO);
+
 	pa = (struct pci_attach_args *)aux;
 	pc = pa-pa_pc;
 
@@ -303,7 +308,6 @@ amr_attach(device_t parent, device_t sel
 			if (PCI_MAPREG_IO_SIZE(reg) != 0)
 ioreg = i;
 			break;
-
 		}
 	}
 
@@ -424,6 +428,8 @@ amr_attach(device_t parent, device_t sel
 			break;
 
 		ac-ac_ident = i;
+		cv_init(ac-ac_cv, amr1ccb);
+		mutex_init(ac-ac_mutex, MUTEX_DEFAULT, IPL_NONE);
 		amr_ccb_free(amr, ac);
 	}
 	if (i != AMR_MAX_CMDS) {
@@ -491,16 +497,23 @@ amr_attach(device_t parent, device_t sel
 
 	SIMPLEQ_INIT(amr-amr_ccb_queue);
 
-	/* XXX This doesn't work for newer boards yet. */
+	cv_init(thread_cv, amrwdog);
+	mutex_init(thread_mutex, MUTEX_DEFAULT, IPL_NONE);
+
 	if ((apt-apt_flags  AT_QUARTZ) == 0) {
-		rv = kthread_create(PRI_NONE, 0, NULL, amr_thread, amr,
-		amr-amr_thread, %s, device_xname(amr-amr_dv));
- 		if (rv != 0)
-			aprint_error_dev(amr-amr_dv, unable to create thread (%d),
- 			rv);
- 		else
- 			amr-amr_flags |= AMRF_THREAD;
+		rv = kthread_create(PRI_NONE, KTHREAD_MPSAFE, NULL,
+amr_std_thread, amr, amr-amr_thread,
+%s, device_xname(amr-amr_dv));
+	} else {
+		rv = kthread_create(PRI_NONE, KTHREAD_MPSAFE, NULL,
+amr_quartz_thread, amr, amr-amr_thread,
+%s, 

CVS commit: src/sys/sys

2015-03-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Mar  2 16:16:08 UTC 2015

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

Log Message:
Add more zeroes in the constants, no functional change


To generate a diff of this commit:
cvs rdiff -u -r1.156 -r1.157 src/sys/sys/mbuf.h

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

Modified files:

Index: src/sys/sys/mbuf.h
diff -u src/sys/sys/mbuf.h:1.156 src/sys/sys/mbuf.h:1.157
--- src/sys/sys/mbuf.h:1.156	Fri Sep  5 01:48:59 2014
+++ src/sys/sys/mbuf.h	Mon Mar  2 11:16:08 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: mbuf.h,v 1.156 2014/09/05 05:48:59 matt Exp $	*/
+/*	$NetBSD: mbuf.h,v 1.157 2015/03/02 16:16:08 christos Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1999, 2001, 2007 The NetBSD Foundation, Inc.
@@ -322,29 +322,34 @@ MBUF_DEFINE(_mbuf_dummy, 1, 1);
 MBUF_DEFINE(mbuf, MHLEN, MLEN);
 
 /* mbuf flags */
-#define	M_EXT		0x1	/* has associated external storage */
-#define	M_PKTHDR	0x2	/* start of record */
-#define	M_EOR		0x4	/* end of record */
-#define	M_PROTO1	0x8	/* protocol-specific */
+#define	M_EXT		0x0001	/* has associated external storage */
+#define	M_PKTHDR	0x0002	/* start of record */
+#define	M_EOR		0x0004	/* end of record */
+#define	M_PROTO1	0x0008	/* protocol-specific */
 
 /* mbuf pkthdr flags, also in m_flags */
-#define M_AUTHIPHDR	0x00010	/* data origin authentication for IP header */
-#define M_DECRYPTED	0x00020	/* confidentiality */
-#define M_LOOP		0x00040	/* for Mbuf statistics */
-#define M_AUTHIPDGM 0x00080  /* data origin authentication */
-#define	M_BCAST		0x00100	/* send/received as link-level broadcast */
-#define	M_MCAST		0x00200	/* send/received as link-level multicast */
-#define	M_CANFASTFWD	0x00400	/* used by filters to indicate packet can
-   be fast-forwarded */
-#define	M_ANYCAST6	0x00800	/* received as IPv6 anycast */
-#define	M_LINK0		0x01000	/* link layer specific flag */
-#define	M_LINK1		0x02000	/* link layer specific flag */
-#define	M_LINK2		0x04000	/* link layer specific flag */
-#define	M_LINK3		0x08000	/* link layer specific flag */
-#define	M_LINK4		0x1	/* link layer specific flag */
-#define	M_LINK5		0x2	/* link layer specific flag */
-#define	M_LINK6		0x4	/* link layer specific flag */
-#define	M_LINK7		0x8	/* link layer specific flag */
+#define	M_AUTHIPHDR	0x0010	/* data origin authentication for
+	 * IP header */
+#define	M_DECRYPTED	0x0020	/* confidentiality */
+#define	M_LOOP		0x0040	/* for Mbuf statistics */
+#define	M_AUTHIPDGM 0x0080	/* data origin authentication */
+#define	M_BCAST		0x0100	/* send/received as link-level
+	 * broadcast */
+#define	M_MCAST		0x0200	/* send/received as link-level
+	 * multicast */
+#define	M_CANFASTFWD	0x0400	/* used by filters to indicate
+	 * packet can be fast-forwarded */
+#define	M_ANYCAST6	0x0800	/* received as IPv6 anycast */
+
+#define	M_LINK0		0x1000	/* link layer specific flag */
+#define	M_LINK1		0x2000	/* link layer specific flag */
+#define	M_LINK2		0x4000	/* link layer specific flag */
+
+#define	M_LINK3		0x8000	/* link layer specific flag */
+#define	M_LINK4		0x0001	/* link layer specific flag */
+#define	M_LINK5		0x0002	/* link layer specific flag */
+#define	M_LINK6		0x0004	/* link layer specific flag */
+#define	M_LINK7		0x0008	/* link layer specific flag */
 
 /* additional flags for M_EXT mbufs */
 #define	M_EXT_FLAGS	0xff00



CVS commit: src/sys/external/bsd/drm2/dist/drm/i915

2015-03-02 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon Mar  2 17:30:17 UTC 2015

Modified Files:
src/sys/external/bsd/drm2/dist/drm/i915: i915_gem.c

Log Message:
Make sure wedged actually gets set on all code paths.

Otherwise GCC helpfully realizes we're invoking undefined behaviour
and optimizes away the possibility that this routine will return
success, without saying a word about it.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/external/bsd/drm2/dist/drm/i915/i915_gem.c

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

Modified files:

Index: src/sys/external/bsd/drm2/dist/drm/i915/i915_gem.c
diff -u src/sys/external/bsd/drm2/dist/drm/i915/i915_gem.c:1.23 src/sys/external/bsd/drm2/dist/drm/i915/i915_gem.c:1.24
--- src/sys/external/bsd/drm2/dist/drm/i915/i915_gem.c:1.23	Sat Feb 28 04:47:44 2015
+++ src/sys/external/bsd/drm2/dist/drm/i915/i915_gem.c	Mon Mar  2 17:30:17 2015
@@ -1409,8 +1409,8 @@ __wait_seqno(struct intel_ring_buffer *r
 	nanotime(before);
 	spin_lock(dev_priv-irq_lock);
 #define	EXIT_COND			  \
-	(((reset_counter != atomic_read(dev_priv-gpu_error.reset_counter))  \
-	? wedged = true : false) ||	  \
+	((wedged = (reset_counter !=	  \
+		atomic_read(dev_priv-gpu_error.reset_counter))) ||	  \
 	i915_seqno_passed(ring-get_seqno(ring, false),		  \
 		seqno))
 



CVS commit: src/sys/external/bsd/drm2/drm

2015-03-02 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon Mar  2 17:34:23 UTC 2015

Modified Files:
src/sys/external/bsd/drm2/drm: drm_vma_manager.c

Log Message:
Don't sleep in the drm_vma allocator.  Fail with ENOSPC, not ENOMEM.

Caller has dev-struct_mutex locked and will handle ENOSPC anyway.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/external/bsd/drm2/drm/drm_vma_manager.c

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

Modified files:

Index: src/sys/external/bsd/drm2/drm/drm_vma_manager.c
diff -u src/sys/external/bsd/drm2/drm/drm_vma_manager.c:1.1 src/sys/external/bsd/drm2/drm/drm_vma_manager.c:1.2
--- src/sys/external/bsd/drm2/drm/drm_vma_manager.c:1.1	Wed Jul 16 20:56:25 2014
+++ src/sys/external/bsd/drm2/drm/drm_vma_manager.c	Mon Mar  2 17:34:23 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: drm_vma_manager.c,v 1.1 2014/07/16 20:56:25 riastradh Exp $	*/
+/*	$NetBSD: drm_vma_manager.c,v 1.2 2015/03/02 17:34:23 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: drm_vma_manager.c,v 1.1 2014/07/16 20:56:25 riastradh Exp $);
+__KERNEL_RCSID(0, $NetBSD: drm_vma_manager.c,v 1.2 2015/03/02 17:34:23 riastradh Exp $);
 
 #include sys/kmem.h
 #include sys/rbtree.h
@@ -164,11 +164,14 @@ drm_vma_offset_add(struct drm_vma_offset
 	if (0  node-von_npages)
 		return 0;
 
-	error = vmem_alloc(mgr-vom_vmem, npages, VM_SLEEP|VM_BESTFIT,
+	error = vmem_alloc(mgr-vom_vmem, npages, VM_NOSLEEP|VM_BESTFIT,
 	startpage);
-	if (error)
+	if (error) {
+		if (error == ENOMEM)
+			error = ENOSPC;
 		/* XXX errno NetBSD-Linux */
 		return -error;
+	}
 
 	node-von_startpage = startpage;
 	node-von_npages = npages;



CVS commit: src/sys/external/bsd/drm2/dist/drm/radeon

2015-03-02 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon Mar  2 17:53:00 UTC 2015

Modified Files:
src/sys/external/bsd/drm2/dist/drm/radeon: radeon_fence.c

Log Message:
Return the error if there is one in radeon_fence_wait_seq.

Don't just always say we succeeded!


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

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

Modified files:

Index: src/sys/external/bsd/drm2/dist/drm/radeon/radeon_fence.c
diff -u src/sys/external/bsd/drm2/dist/drm/radeon/radeon_fence.c:1.5 src/sys/external/bsd/drm2/dist/drm/radeon/radeon_fence.c:1.6
--- src/sys/external/bsd/drm2/dist/drm/radeon/radeon_fence.c:1.5	Wed Aug  6 22:12:51 2014
+++ src/sys/external/bsd/drm2/dist/drm/radeon/radeon_fence.c	Mon Mar  2 17:53:00 2015
@@ -323,7 +323,7 @@ static int radeon_fence_wait_seq(struct 
 {
 	uint64_t last_seq[RADEON_NUM_RINGS];
 	bool signaled;
-	int i, r;
+	int i, r = 0;
 
 	spin_lock(rdev-fence_lock);
 	while (!radeon_fence_any_seq_signaled(rdev, target_seq)) {
@@ -425,7 +425,7 @@ static int radeon_fence_wait_seq(struct 
 		}
 	}
 out:	spin_unlock(rdev-fence_lock);
-	return 0;
+	return r;
 }
 
 /**



CVS commit: src/sys/external/bsd/drm2/dist/drm/i915

2015-03-02 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon Mar  2 18:36:49 UTC 2015

Modified Files:
src/sys/external/bsd/drm2/dist/drm/i915: intel_i2c.c

Log Message:
Drop the gmbus wait lock to delay.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 \
src/sys/external/bsd/drm2/dist/drm/i915/intel_i2c.c

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

Modified files:

Index: src/sys/external/bsd/drm2/dist/drm/i915/intel_i2c.c
diff -u src/sys/external/bsd/drm2/dist/drm/i915/intel_i2c.c:1.10 src/sys/external/bsd/drm2/dist/drm/i915/intel_i2c.c:1.11
--- src/sys/external/bsd/drm2/dist/drm/i915/intel_i2c.c:1.10	Sat Feb 28 14:10:00 2015
+++ src/sys/external/bsd/drm2/dist/drm/i915/intel_i2c.c	Mon Mar  2 18:36:49 2015
@@ -292,7 +292,9 @@ gmbus_wait_hw_status(struct drm_i915_pri
 		!ISSET(gmbus2, (GMBUS_SATOER | gmbus2_status))) {
 			if (i-- == 0)
 break;
+			spin_unlock(dev_priv-gmbus_wait_lock);
 			DELAY(1000);
+			spin_lock(dev_priv-gmbus_wait_lock);
 		}
 	} else {
 		for (i = 0; i  mstohz(50); i++) {



CVS commit: src/lib/libc/sys

2015-03-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Mar  2 19:24:19 UTC 2015

Modified Files:
src/lib/libc/sys: kqueue.2

Log Message:
say that we put the exit code in data.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/lib/libc/sys/kqueue.2

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

Modified files:

Index: src/lib/libc/sys/kqueue.2
diff -u src/lib/libc/sys/kqueue.2:1.33 src/lib/libc/sys/kqueue.2:1.34
--- src/lib/libc/sys/kqueue.2:1.33	Sat Nov 24 10:16:52 2012
+++ src/lib/libc/sys/kqueue.2	Mon Mar  2 14:24:19 2015
@@ -1,4 +1,4 @@
-.\	$NetBSD: kqueue.2,v 1.33 2012/11/24 15:16:52 christos Exp $
+.\	$NetBSD: kqueue.2,v 1.34 2015/03/02 19:24:19 christos Exp $
 .\
 .\ Copyright (c) 2000 Jonathan Lemon
 .\ All rights reserved.
@@ -32,7 +32,7 @@
 .\
 .\ $FreeBSD: src/lib/libc/sys/kqueue.2,v 1.22 2001/06/27 19:55:57 dd Exp $
 .\
-.Dd November 24, 2012
+.Dd March 2, 2015
 .Dt KQUEUE 2
 .Os
 .Sh NAME
@@ -413,6 +413,8 @@ The events to monitor are:
 .Bl -tag -width XXNOTE_TRACKERR
 .It NOTE_EXIT
 The process has exited.
+The exit code of the process is stored in
+.Va data .
 .It NOTE_FORK
 The process has called
 .Fn fork .



CVS commit: src/sys/kern

2015-03-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Mar  2 19:24:54 UTC 2015

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

Log Message:
put the exit code of the process in data, like FreeBSD does.


To generate a diff of this commit:
cvs rdiff -u -r1.82 -r1.83 src/sys/kern/kern_event.c

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

Modified files:

Index: src/sys/kern/kern_event.c
diff -u src/sys/kern/kern_event.c:1.82 src/sys/kern/kern_event.c:1.83
--- src/sys/kern/kern_event.c:1.82	Fri Sep  5 05:20:59 2014
+++ src/sys/kern/kern_event.c	Mon Mar  2 14:24:53 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_event.c,v 1.82 2014/09/05 09:20:59 matt Exp $	*/
+/*	$NetBSD: kern_event.c,v 1.83 2015/03/02 19:24:53 christos Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -58,7 +58,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: kern_event.c,v 1.82 2014/09/05 09:20:59 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: kern_event.c,v 1.83 2015/03/02 19:24:53 christos Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -548,6 +548,10 @@ filt_proc(struct knote *kn, long hint)
 		fflag |= event;
 
 	if (event == NOTE_EXIT) {
+		struct proc *p = kn-kn_obj;
+
+		if (p != NULL)
+			kn-kn_data = p-p_xstat;
 		/*
 		 * Process is gone, so flag the event as finished.
 		 *