CVS commit: src/sys/dev/pci

2017-07-26 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Jul 27 03:21:43 UTC 2017

Modified Files:
src/sys/dev/pci: if_wm.c if_wmvar.h

Log Message:
 Add WM_F_WA_I210_CLSEM flag for a workaround. FreeBSD/Linux drivers say
"In rare circumstances, the SW semaphore may already be held unintentionally."
on I21[01]. PXE boot is one of the case.

XXX pullup-[678].


To generate a diff of this commit:
cvs rdiff -u -r1.532 -r1.533 src/sys/dev/pci/if_wm.c
cvs rdiff -u -r1.36 -r1.37 src/sys/dev/pci/if_wmvar.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/pci/if_wm.c
diff -u src/sys/dev/pci/if_wm.c:1.532 src/sys/dev/pci/if_wm.c:1.533
--- src/sys/dev/pci/if_wm.c:1.532	Wed Jul 26 08:09:59 2017
+++ src/sys/dev/pci/if_wm.c	Thu Jul 27 03:21:42 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wm.c,v 1.532 2017/07/26 08:09:59 msaitoh Exp $	*/
+/*	$NetBSD: if_wm.c,v 1.533 2017/07/27 03:21:42 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -83,7 +83,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.532 2017/07/26 08:09:59 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.533 2017/07/27 03:21:42 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -2215,6 +2215,8 @@ alloc_retry:
 		break;
 	case WM_T_I210:
 	case WM_T_I211:
+		/* Allow a single clear of the SW semaphore on I210 and newer*/
+		sc->sc_flags |= WM_F_WA_I210_CLSEM;
 		if (wm_nvm_get_flash_presence_i210(sc)) {
 			sc->nvm.read = wm_nvm_read_eerd;
 			/* Don't use WM_F_LOCK_EECD because we use EERD */
@@ -12704,6 +12706,7 @@ wm_get_swsm_semaphore(struct wm_softc *s
 		device_xname(sc->sc_dev), __func__));
 	KASSERT(sc->sc_nvm_wordsize > 0);
 
+retry:
 	/* Get the SW semaphore. */
 	timeout = sc->sc_nvm_wordsize + 1;
 	while (timeout) {
@@ -12717,6 +12720,16 @@ wm_get_swsm_semaphore(struct wm_softc *s
 	}
 
 	if (timeout == 0) {
+		if ((sc->sc_flags & WM_F_WA_I210_CLSEM) != 0) {
+			/*
+			 * In rare circumstances, the SW semaphore may already
+			 * be held unintentionally. Clear the semaphore once
+			 * before giving up.
+			 */
+			sc->sc_flags &= ~WM_F_WA_I210_CLSEM;
+			wm_put_swsm_semaphore(sc);
+			goto retry;
+		}
 		aprint_error_dev(sc->sc_dev,
 		"could not acquire SWSM SMBI\n");
 		return 1;

Index: src/sys/dev/pci/if_wmvar.h
diff -u src/sys/dev/pci/if_wmvar.h:1.36 src/sys/dev/pci/if_wmvar.h:1.37
--- src/sys/dev/pci/if_wmvar.h:1.36	Wed Jul 26 06:48:49 2017
+++ src/sys/dev/pci/if_wmvar.h	Thu Jul 27 03:21:42 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wmvar.h,v 1.36 2017/07/26 06:48:49 msaitoh Exp $	*/
+/*	$NetBSD: if_wmvar.h,v 1.37 2017/07/27 03:21:42 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -96,6 +96,7 @@
 #define WM_F_80003_MDIC_WA	0x0100 /* 80003 MDIC workaround */
 #define	WM_F_PCS_DIS_AUTONEGO	0x0200 /* PCS Disable Autonego */
 #define	WM_F_PLL_WA_I210	0x0400 /* I21[01] PLL workaround */
+#define	WM_F_WA_I210_CLSEM	0x0800 /* I21[01] Semaphore workaround */
 
 #define WM_FLAGS "\20" \
 	"\1" "HAS_MII"	"\2" "LOCK_EECD" "\3" "_B02"	"\4" "_B03"	\



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

2017-07-26 Thread NONAKA Kimihiro
Module Name:src
Committed By:   nonaka
Date:   Thu Jul 27 02:11:24 UTC 2017

Modified Files:
src/sys/external/bsd/drm2/pci: drm_pci.c

Log Message:
PR/52409: Avoid panic at resume.

XXX: pullup-8


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/external/bsd/drm2/pci/drm_pci.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/pci/drm_pci.c
diff -u src/sys/external/bsd/drm2/pci/drm_pci.c:1.17 src/sys/external/bsd/drm2/pci/drm_pci.c:1.18
--- src/sys/external/bsd/drm2/pci/drm_pci.c:1.17	Thu Jun  1 02:45:12 2017
+++ src/sys/external/bsd/drm2/pci/drm_pci.c	Thu Jul 27 02:11:24 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: drm_pci.c,v 1.17 2017/06/01 02:45:12 chs Exp $	*/
+/*	$NetBSD: drm_pci.c,v 1.18 2017/07/27 02:11:24 nonaka Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: drm_pci.c,v 1.17 2017/06/01 02:45:12 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: drm_pci.c,v 1.18 2017/07/27 02:11:24 nonaka Exp $");
 
 #include 
 #include 
@@ -243,11 +243,23 @@ drm_pci_irq_install(struct drm_device *d
 	irq_cookie = kmem_alloc(sizeof(*irq_cookie), KM_SLEEP);
 
 	if (dev->pdev->msi_enabled) {
-		irq_cookie->intr_handles = dev->pdev->intr_handles;
-		dev->pdev->intr_handles = NULL;
+		if (dev->pdev->intr_handles == NULL) {
+			if (pci_msi_alloc_exact(pa, _cookie->intr_handles,
+			1)) {
+aprint_error_dev(dev->dev,
+"couldn't allocate MSI (%s)\n", name);
+goto error;
+			}
+		} else {
+			irq_cookie->intr_handles = dev->pdev->intr_handles;
+			dev->pdev->intr_handles = NULL;
+		}
 	} else {
-		if (pci_intx_alloc(pa, _cookie->intr_handles))
-			return -ENOENT;
+		if (pci_intx_alloc(pa, _cookie->intr_handles)) {
+			aprint_error_dev(dev->dev,
+			"couldn't allocate INTx interrupt (%s)\n", name);
+			goto error;
+		}
 	}
 
 	intrstr = pci_intr_string(pa->pa_pc, irq_cookie->intr_handles[0],
@@ -257,12 +269,17 @@ drm_pci_irq_install(struct drm_device *d
 	if (irq_cookie->ih_cookie == NULL) {
 		aprint_error_dev(dev->dev,
 		"couldn't establish interrupt at %s (%s)\n", intrstr, name);
-		return -ENOENT;
+		pci_intr_release(pa->pa_pc, irq_cookie->intr_handles, 1);
+		goto error;
 	}
 
 	aprint_normal_dev(dev->dev, "interrupting at %s (%s)\n", intrstr, name);
 	*cookiep = irq_cookie;
 	return 0;
+
+error:
+	kmem_free(irq_cookie, sizeof(*irq_cookie));
+	return -ENOENT;
 }
 
 static void



CVS commit: src/bin/sh

2017-07-26 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Wed Jul 26 23:09:41 UTC 2017

Modified Files:
src/bin/sh: parser.c

Log Message:
PR bin/48498   PR bin/52426

Don't ignore unexpected reserved words after ';'
Don't allow any random token type as a case stmt pattern, only a word.
Those are ancient ash bugs and do not affect correct scripts.

Don't ignore redirects in a case stmt list where the list is nothing but
redirects (if the pattern matches, the redirects should be performed).
That was introduced when a redirect only case stmt list was allowed
(older shells had generated a syntax error.)

Random cleanups/refactoring taken from or inspired by the FreeBSD sh
parser ...  use makename() consistently to create a NARG node - we
were using it in a couple of places but most NARG node creation was open
coded.  Introduce consumetoken() (from FreeBSD) to handle the fairly
common case where exactly one token type must come next, and we need to
check that, and skip past it when found (or error) and linebreak() (new)
to handle places where optional \n's are permitted.
Both previously open coded.

Simplify list() by removing its second arg, which was only ever used when
handling the end of a `` (old style command substitution).  Simply move
the code from inside list() to just after its call in the `` case (from
FreeBSD.)


To generate a diff of this commit:
cvs rdiff -u -r1.141 -r1.142 src/bin/sh/parser.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/sh/parser.c
diff -u src/bin/sh/parser.c:1.141 src/bin/sh/parser.c:1.142
--- src/bin/sh/parser.c:1.141	Mon Jul  3 20:16:44 2017
+++ src/bin/sh/parser.c	Wed Jul 26 23:09:41 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: parser.c,v 1.141 2017/07/03 20:16:44 kre Exp $	*/
+/*	$NetBSD: parser.c,v 1.142 2017/07/26 23:09:41 kre Exp $	*/
 
 /*-
  * Copyright (c) 1991, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)parser.c	8.7 (Berkeley) 5/16/95";
 #else
-__RCSID("$NetBSD: parser.c,v 1.141 2017/07/03 20:16:44 kre Exp $");
+__RCSID("$NetBSD: parser.c,v 1.142 2017/07/26 23:09:41 kre Exp $");
 #endif
 #endif /* not lint */
 
@@ -103,12 +103,12 @@ static const struct parse_state init_par
 	.ps_elided_nl = 0,
 };
 
-STATIC union node *list(int, int);
+STATIC union node *list(int);
 STATIC union node *andor(void);
 STATIC union node *pipeline(void);
 STATIC union node *command(void);
 STATIC union node *simplecmd(union node **, union node *);
-STATIC union node *makename(void);
+STATIC union node *makename(int);
 STATIC void parsefname(void);
 STATIC int slurp_heredoc(char *const, const int, const int);
 STATIC void readheredocs(void);
@@ -117,6 +117,8 @@ STATIC int readtoken(void);
 STATIC int xxreadtoken(void);
 STATIC int readtoken1(int, char const *, int);
 STATIC int noexpand(char *);
+STATIC void linebreak(void);
+STATIC void consumetoken(int);
 STATIC void synexpect(int, const char *) __dead;
 STATIC void synerror(const char *) __dead;
 STATIC void setprompt(int);
@@ -143,6 +145,7 @@ parsecmd(int interact)
 	parsing++;
 #endif
 	tokpushback = 0;
+	checkkwd = 0;
 	doprompt = interact;
 	if (doprompt)
 		setprompt(1);
@@ -162,7 +165,7 @@ parsecmd(int interact)
 	parsing++;
 #endif
 	tokpushback++;
-	n = list(1, 0);
+	n = list(1);
 #ifdef DEBUG
 	parsing--;
 #endif
@@ -174,12 +177,12 @@ parsecmd(int interact)
 
 
 STATIC union node *
-list(int nlflag, int erflag)
+list(int nlflag)
 {
 	union node *n1, *n2, *n3;
 	int tok;
 
-	CTRACE(DBG_PARSE, ("list(%d,%d): entered @%d\n",nlflag,erflag,plinno));
+	CTRACE(DBG_PARSE, ("list(%d): entered @%d\n",nlflag,plinno));
 
 	checkkwd = 2;
 	if (nlflag == 0 && tokendlist[peektoken()])
@@ -189,11 +192,11 @@ list(int nlflag, int erflag)
 		n2 = andor();
 		tok = readtoken();
 		if (tok == TBACKGND) {
-			if (n2->type == NCMD || n2->type == NPIPE) {
+			if (n2->type == NCMD || n2->type == NPIPE)
 n2->ncmd.backgnd = 1;
-			} else if (n2->type == NREDIR) {
+			else if (n2->type == NREDIR)
 n2->type = NBACKGND;
-			} else {
+			else {
 n3 = stalloc(sizeof(struct nredir));
 n3->type = NBACKGND;
 n3->nredir.n = n2;
@@ -201,16 +204,16 @@ list(int nlflag, int erflag)
 n2 = n3;
 			}
 		}
-		if (n1 == NULL) {
-			n1 = n2;
-		}
-		else {
+
+		if (n1 != NULL) {
 			n3 = stalloc(sizeof(struct nbinary));
 			n3->type = NSEMI;
 			n3->nbinary.ch1 = n1;
 			n3->nbinary.ch2 = n2;
 			n1 = n3;
-		}
+		} else
+			n1 = n2;
+
 		switch (tok) {
 		case TBACKGND:
 		case TSEMI:
@@ -221,18 +224,20 @@ list(int nlflag, int erflag)
 readheredocs();
 if (nlflag)
 	return n1;
-			} else {
+			} else if (tok == TEOF && nlflag)
+return n1;
+			else
 tokpushback++;
-			}
+
 			checkkwd = 2;
-			if (tokendlist[peektoken()])
+			if (!nlflag && tokendlist[peektoken()])
 return n1;
 			break;
 		case TEOF:
 			pungetc();	/* push back EOF on input */
 			return n1;
 		default:
-			if (nlflag || 

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

2017-07-26 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Wed Jul 26 18:12:12 UTC 2017

Modified Files:
src/sys/dev/ata [jdolecek-ncq]: satapmp_subr.c

Log Message:
write the device and channel for port multiplier attach (not just the atabus),
so it's easier to check


To generate a diff of this commit:
cvs rdiff -u -r1.12.24.4 -r1.12.24.5 src/sys/dev/ata/satapmp_subr.c

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

Modified files:

Index: src/sys/dev/ata/satapmp_subr.c
diff -u src/sys/dev/ata/satapmp_subr.c:1.12.24.4 src/sys/dev/ata/satapmp_subr.c:1.12.24.5
--- src/sys/dev/ata/satapmp_subr.c:1.12.24.4	Tue Jun 20 20:58:22 2017
+++ src/sys/dev/ata/satapmp_subr.c	Wed Jul 26 18:12:12 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: satapmp_subr.c,v 1.12.24.4 2017/06/20 20:58:22 jdolecek Exp $	*/
+/*	$NetBSD: satapmp_subr.c,v 1.12.24.5 2017/07/26 18:12:12 jdolecek Exp $	*/
 
 /*
  * Copyright (c) 2012 Manuel Bouyer.  All rights reserved.
@@ -25,7 +25,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: satapmp_subr.c,v 1.12.24.4 2017/06/20 20:58:22 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: satapmp_subr.c,v 1.12.24.5 2017/07/26 18:12:12 jdolecek Exp $");
 
 #include 
 #include 
@@ -274,8 +274,10 @@ satapmp_attach(struct ata_channel *chp)
 		return;
 	}
 
-	aprint_normal_dev(chp->atabus,
-	"SATA port multiplier, %d ports\n", PMP_INF_NPORTS(inf));
+	aprint_normal("%s at %s channel %d: SATA port multiplier, %d ports\n",
+	device_xname(chp->atabus),
+	device_xname(chp->ch_atac->atac_dev), chp->ch_channel,
+	PMP_INF_NPORTS(inf));
 	aprint_verbose_dev(chp->atabus,
 	"vendor 0x%04x, product 0x%04x",
 	PMP_ID_VEND(id), PMP_ID_DEV(id));



CVS commit: src/tests/bin/sh

2017-07-26 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Wed Jul 26 17:50:21 UTC 2017

Modified Files:
src/tests/bin/sh: t_syntax.sh

Log Message:
PR bin/48498   PR bin/52426

Add two new sh syntax test cases to check for bug fixes for the parser
problems (syntax errors unidentified) reported in the two PRs.

In the latter case, also include some tests that test similar
looking, valid, syntax - to make sure the fix for the PR does not
break code that should not fail.  This is not needed for the earlier
PR as other tests, and just normal parsing, is sufficient.

These tests have been verified to fail with a current /bin/sh and to
pass with the sh updates that are to be committed soon -- and because that
fix is expected within hours, the tests are not marked as expected to
fail, just let them actually fail for now.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/tests/bin/sh/t_syntax.sh

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

Modified files:

Index: src/tests/bin/sh/t_syntax.sh
diff -u src/tests/bin/sh/t_syntax.sh:1.5 src/tests/bin/sh/t_syntax.sh:1.6
--- src/tests/bin/sh/t_syntax.sh:1.5	Sat Jun 24 11:09:42 2017
+++ src/tests/bin/sh/t_syntax.sh	Wed Jul 26 17:50:20 2017
@@ -1,4 +1,4 @@
-# $NetBSD: t_syntax.sh,v 1.5 2017/06/24 11:09:42 kre Exp $
+# $NetBSD: t_syntax.sh,v 1.6 2017/07/26 17:50:20 kre Exp $
 #
 # Copyright (c) 2017 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -988,6 +988,131 @@ x_functions_body() {
 		'f1() { eval "$1() { :; }"; }; f1 f2; f2'
 }
 
+atf_test_case z_PR_48498
+z_PR_48498_head() {
+	atf_set "descr" "Check for detecting the syntax error from PR bin/48498"
+}
+z_PR_48498_body() {
+
+	# reserved words/operators that end things,
+	# were completely ignored after a ';' or '&'
+	# many of these tests lifted directly from the PR
+
+	atf_check -s not-exit:0 -o ignore -e not-empty ${TEST_SH} -c \
+		'true; fi'
+	atf_check -s not-exit:0 -o ignore -e not-empty ${TEST_SH} -c \
+		'false; fi'
+	atf_check -s not-exit:0 -o ignore -e not-empty ${TEST_SH} -c \
+		'false; then echo wut'
+	atf_check -s not-exit:0 -o ignore -e not-empty ${TEST_SH} -c \
+		'true; then echo wut'
+	atf_check -s not-exit:0 -o ignore -e not-empty ${TEST_SH} -c \
+		'true; do echo wut'
+	atf_check -s not-exit:0 -o ignore -e not-empty ${TEST_SH} -c \
+		'true; then'
+	atf_check -s not-exit:0 -o ignore -e not-empty ${TEST_SH} -c \
+		'true; else'
+	atf_check -s not-exit:0 -o ignore -e not-empty ${TEST_SH} -c \
+		'true; do'
+	atf_check -s not-exit:0 -o ignore -e not-empty ${TEST_SH} -c \
+		'true; done'
+		# {
+	atf_check -s not-exit:0 -o ignore -e not-empty ${TEST_SH} -c \
+		': ; }'
+		# (
+	atf_check -s not-exit:0 -o ignore -e not-empty ${TEST_SH} -c \
+		':;)'
+
+	atf_check -s not-exit:0 -o ignore -e not-empty ${TEST_SH} -c \
+		'true& fi'
+	atf_check -s not-exit:0 -o ignore -e not-empty ${TEST_SH} -c \
+		'false& fi'
+	atf_check -s not-exit:0 -o ignore -e not-empty ${TEST_SH} -c \
+		'false& then echo wut'
+	atf_check -s not-exit:0 -o ignore -e not-empty ${TEST_SH} -c \
+		'true& then echo wut'
+	atf_check -s not-exit:0 -o ignore -e not-empty ${TEST_SH} -c \
+		'true& do echo wut'
+	atf_check -s not-exit:0 -o ignore -e not-empty ${TEST_SH} -c \
+		'true& then'
+	atf_check -s not-exit:0 -o ignore -e not-empty ${TEST_SH} -c \
+		'true& else'
+	atf_check -s not-exit:0 -o ignore -e not-empty ${TEST_SH} -c \
+		'true& do'
+	atf_check -s not-exit:0 -o ignore -e not-empty ${TEST_SH} -c \
+		'true'
+		# {
+	atf_check -s not-exit:0 -o ignore -e not-empty ${TEST_SH} -c \
+		':&}'
+		# (
+	atf_check -s not-exit:0 -o ignore -e not-empty ${TEST_SH} -c \
+		':&)'
+}
+
+atf_test_case z_PR_52426
+z_PR_52426_head() {
+	atf_set "descr" "Check for detecting the syntax error from PR bin/52426"
+}
+z_PR_52426_body() {
+	# Absoluely anything was permitted as a pattern of a case
+	# statement, any token (except 'esac') would serve
+	# What follows are a few "pretty" examples that were accepted.
+	# The first is the example from the PR
+
+	# Note we use only ;; type case lists, ;& should do the same, but
+	# only for shells that support it, we do not want the shell to
+	# object to any of these just because it does not support ;&
+
+	atf_check -s not-exit:0 -o ignore -e not-empty ${TEST_SH} -c \
+		'case x in <|() ;; esac'
+
+	atf_check -s not-exit:0 -o ignore -e not-empty ${TEST_SH} -c \
+		'case x in ((|)) ;; esac'
+	atf_check -s not-exit:0 -o ignore -e not-empty ${TEST_SH} -c \
+		'case x in _|() ;; esac'
+	atf_check -s not-exit:0 -o ignore -e not-empty ${TEST_SH} -c \
+		'case x in ()|() ;; esac'
+	atf_check -s not-exit:0 -o ignore -e not-empty ${TEST_SH} -c \
+		'case x in -|;) ;; esac'
+	atf_check -s not-exit:0 -o ignore -e not-empty ${TEST_SH} -c \
+		'case x in (;|-) ;; esac'
+	atf_check -s not-exit:0 -o ignore -e not-empty ${TEST_SH} -c \
+		'case x in ;;|;) ;; esac'
+	atf_check -s not-exit:0 -o ignore -e not-empty ${TEST_SH} -c \

CVS commit: src/sys/ufs/lfs

2017-07-26 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Wed Jul 26 16:42:37 UTC 2017

Modified Files:
src/sys/ufs/lfs: lfs.h lfs_extern.h lfs_segment.c lfs_subr.c
lfs_syscalls.c lfs_vfsops.c lfs_vnops.c

Log Message:
change lfs_nextsegsleep and lfs_allclean_wakeup to use condvar

XXX had to use lfs_lock in lfs_segwait, removed kernel_lock, is this
appropriate?


To generate a diff of this commit:
cvs rdiff -u -r1.202 -r1.203 src/sys/ufs/lfs/lfs.h
cvs rdiff -u -r1.112 -r1.113 src/sys/ufs/lfs/lfs_extern.h
cvs rdiff -u -r1.273 -r1.274 src/sys/ufs/lfs/lfs_segment.c
cvs rdiff -u -r1.96 -r1.97 src/sys/ufs/lfs/lfs_subr.c
cvs rdiff -u -r1.174 -r1.175 src/sys/ufs/lfs/lfs_syscalls.c
cvs rdiff -u -r1.359 -r1.360 src/sys/ufs/lfs/lfs_vfsops.c
cvs rdiff -u -r1.317 -r1.318 src/sys/ufs/lfs/lfs_vnops.c

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

Modified files:

Index: src/sys/ufs/lfs/lfs.h
diff -u src/sys/ufs/lfs/lfs.h:1.202 src/sys/ufs/lfs/lfs.h:1.203
--- src/sys/ufs/lfs/lfs.h:1.202	Mon Jun  5 01:01:42 2017
+++ src/sys/ufs/lfs/lfs.h	Wed Jul 26 16:42:37 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: lfs.h,v 1.202 2017/06/05 01:01:42 maya Exp $	*/
+/*	$NetBSD: lfs.h,v 1.203 2017/07/26 16:42:37 maya Exp $	*/
 
 /*  from NetBSD: dinode.h,v 1.25 2016/01/22 23:06:10 dholland Exp  */
 /*  from NetBSD: dir.h,v 1.25 2015/09/01 06:16:03 dholland Exp  */
@@ -1047,7 +1047,7 @@ struct lfs {
 	/* XXX: should be replaced with a condvar */
 	int lfs_availsleep;
 	/* This one replaces _nextseg... all ditto */
-	int lfs_nextsegsleep;
+	kcondvar_t lfs_nextsegsleep;
 
 	/* Cleaner lwp, set on first bmapv syscall. */
 	struct lwp *lfs_cleaner_thread;

Index: src/sys/ufs/lfs/lfs_extern.h
diff -u src/sys/ufs/lfs/lfs_extern.h:1.112 src/sys/ufs/lfs/lfs_extern.h:1.113
--- src/sys/ufs/lfs/lfs_extern.h:1.112	Thu Jun  8 01:23:01 2017
+++ src/sys/ufs/lfs/lfs_extern.h	Wed Jul 26 16:42:37 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: lfs_extern.h,v 1.112 2017/06/08 01:23:01 chs Exp $	*/
+/*	$NetBSD: lfs_extern.h,v 1.113 2017/07/26 16:42:37 maya Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2002, 2003 The NetBSD Foundation, Inc.
@@ -109,7 +109,7 @@ __BEGIN_DECLS
 
 #if defined(_KERNEL)
 
-extern int lfs_allclean_wakeup;
+extern kcondvar_t lfs_allclean_wakeup;
 extern struct pool lfs_inode_pool;		/* memory pool for inodes */
 extern struct pool lfs_dinode_pool;		/* memory pool for dinodes */
 extern struct pool lfs_inoext_pool;	/* memory pool for inode extension */

Index: src/sys/ufs/lfs/lfs_segment.c
diff -u src/sys/ufs/lfs/lfs_segment.c:1.273 src/sys/ufs/lfs/lfs_segment.c:1.274
--- src/sys/ufs/lfs/lfs_segment.c:1.273	Wed Jul 26 15:07:27 2017
+++ src/sys/ufs/lfs/lfs_segment.c	Wed Jul 26 16:42:37 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: lfs_segment.c,v 1.273 2017/07/26 15:07:27 maya Exp $	*/
+/*	$NetBSD: lfs_segment.c,v 1.274 2017/07/26 16:42:37 maya Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2002, 2003 The NetBSD Foundation, Inc.
@@ -60,7 +60,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: lfs_segment.c,v 1.273 2017/07/26 15:07:27 maya Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lfs_segment.c,v 1.274 2017/07/26 16:42:37 maya Exp $");
 
 #ifdef DEBUG
 # define vndebug(vp, str) do {		\
@@ -145,7 +145,7 @@ int	 lfs_writevnodes(struct lfs *fs, str
 static void lfs_shellsort(struct lfs *, struct buf **, union lfs_blocks *,
 			  int, int);
 
-int	lfs_allclean_wakeup;		/* Cleaner wakeup address. */
+kcondvar_t	lfs_allclean_wakeup;	/* Cleaner wakeup address. */
 int	lfs_writeindir = 1;		/* whether to flush indir on non-ckp */
 int	lfs_clean_vnhead = 0;		/* Allow freeing to head of vn list */
 int	lfs_dirvcount = 0;		/* # active dirops */

Index: src/sys/ufs/lfs/lfs_subr.c
diff -u src/sys/ufs/lfs/lfs_subr.c:1.96 src/sys/ufs/lfs/lfs_subr.c:1.97
--- src/sys/ufs/lfs/lfs_subr.c:1.96	Wed Jul 26 14:38:59 2017
+++ src/sys/ufs/lfs/lfs_subr.c	Wed Jul 26 16:42:37 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: lfs_subr.c,v 1.96 2017/07/26 14:38:59 maya Exp $	*/
+/*	$NetBSD: lfs_subr.c,v 1.97 2017/07/26 16:42:37 maya Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2002, 2003 The NetBSD Foundation, Inc.
@@ -60,7 +60,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: lfs_subr.c,v 1.96 2017/07/26 14:38:59 maya Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lfs_subr.c,v 1.97 2017/07/26 16:42:37 maya Exp $");
 
 #include 
 #include 
@@ -649,6 +649,6 @@ lfs_wakeup_cleaner(struct lfs *fs)
 	if (fs->lfs_nowrap > 0)
 		return;
 
-	wakeup(>lfs_nextsegsleep);
-	wakeup(_allclean_wakeup);
+	cv_broadcast(>lfs_nextsegsleep);
+	cv_broadcast(_allclean_wakeup);
 }

Index: src/sys/ufs/lfs/lfs_syscalls.c
diff -u src/sys/ufs/lfs/lfs_syscalls.c:1.174 src/sys/ufs/lfs/lfs_syscalls.c:1.175
--- src/sys/ufs/lfs/lfs_syscalls.c:1.174	Mon Apr 17 08:32:01 2017
+++ src/sys/ufs/lfs/lfs_syscalls.c	Wed Jul 26 16:42:37 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: lfs_syscalls.c,v 1.174 2017/04/17 08:32:01 hannken Exp $	*/
+/*	$NetBSD: lfs_syscalls.c,v 1.175 

CVS commit: [netbsd-7] src/doc

2017-07-26 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Wed Jul 26 16:11:31 UTC 2017

Modified Files:
src/doc [netbsd-7]: CHANGES-7.2

Log Message:
tickets 1435, 1449, 1450, 1454, 1455, 1458, 1559


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.32 -r1.1.2.33 src/doc/CHANGES-7.2

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-7.2
diff -u src/doc/CHANGES-7.2:1.1.2.32 src/doc/CHANGES-7.2:1.1.2.33
--- src/doc/CHANGES-7.2:1.1.2.32	Tue Jul 25 19:51:29 2017
+++ src/doc/CHANGES-7.2	Wed Jul 26 16:11:31 2017
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-7.2,v 1.1.2.32 2017/07/25 19:51:29 snj Exp $
+# $NetBSD: CHANGES-7.2,v 1.1.2.33 2017/07/26 16:11:31 snj Exp $
 
 A complete list of changes from the NetBSD 7.1 release to the NetBSD 7.2
 release:
@@ -2615,3 +2615,69 @@ sys/dev/pci/if_iwmvar.hpatch
 	and 416x series.  Ported from OpenBSD.
 	[nonaka, ticket #1413]
 
+external/broadcom/rpi-firmware/dist/bootcode.bin up to 1.10
+external/broadcom/rpi-firmware/dist/fixup.dat	up to 1.10
+external/broadcom/rpi-firmware/dist/fixup_cd.dat up to 1.10
+external/broadcom/rpi-firmware/dist/start.elf	up to 1.10
+external/broadcom/rpi-firmware/dist/start_cd.elf up to 1.10
+sys/arch/arm/arm32/cpu.c			1.113 via patch
+sys/arch/arm/broadcom/bcm2835_bsc.c		1.6 via patch
+sys/arch/arm/broadcom/bcm2835_plcom.c		1.4 via patch
+sys/arch/arm/cortex/gtmr.c			1.18 via patch
+sys/arch/arm/include/armreg.h			1.110 via patch
+sys/arch/arm/include/vfpreg.h			1.15 via patch
+sys/arch/arm/vfp/vfp_init.c			1.50 via patch
+sys/arch/evbarm/rpi/rpi_machdep.c		1.59 via patch
+sys/arch/evbarm/rpi/rpi_machdep.c		1.70 via patch
+sys/arch/evbarm/rpi/rpi_machdep.c		1.71 via patch
+sys/arch/evbarm/rpi/rpi_machdep.c		1.72 via patch
+sys/arch/evbarm/rpi/vcprop.h			1.16 via patch
+
+	Add support for Raspberry Pi 3.
+	[jmcneill, ticket #1435]
+
+gnu/dist/gettext/gettext-tools/doc/texi2html	patch
+
+	Don't use defined() on perl arrays.
+	[mrg, ticket #1449]
+
+doc/3RDPARTY	1.1425 via patch
+external/public-domain/tz/dist/NEWS up to 1.1.1.18
+external/public-domain/tz/dist/TZDATA_VERSION   up to 1.8
+external/public-domain/tz/dist/africa   up to 1.1.1.11
+external/public-domain/tz/dist/iso3166.tab  up to 1.1.1.5
+external/public-domain/tz/dist/northamerica up to 1.1.1.16
+external/public-domain/tz/dist/version  up to 1.1.1.5
+
+	Update tzdata to 2017b.  This makes a (current) change for
+	Haiti, and a change to historic data for Liberia.
+	[kre, ticket #1450]
+
+sbin/route/rtutil.c1.10
+
+	Fix route and netstat -r output when built with -DSMALL
+	[manu, ticket #1454]
+
+libexec/ld.elf_so/tls.c1.11
+
+	Fix two bugs related to promotion of DSO TLS blocks into the
+	static thread allocation:
+	(1) Set the DTV vector up whenever an offset into the static
+	allocation is assigned, even if the block itself is not
+	initialized. This has been seen in libstdc++.
+	(2) Do not free a DTV block if it is part of the static
+	thread allocation.
+	[joerg, ticket #1455]
+
+sys/dev/pci/aceride.c1.37
+sys/dev/pci/pciide_acer_reg.h			1.13
+
+	Apply workaround from FreeBSD to fix read data corruption
+	seen on Fire V100 and mSATA-SSD with mSATA to IDE adapter.
+	[nakayama, ticket #1458]
+
+sys/dev/pci/if_iwm.c1.72
+
+	iwm(4): match Wireless 8265 device.
+	[nonaka, ticket #1459]
+



CVS commit: [netbsd-7-1] src/doc

2017-07-26 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Wed Jul 26 16:07:41 UTC 2017

Modified Files:
src/doc [netbsd-7-1]: CHANGES-7.1.1

Log Message:
1449, 1450


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.18 -r1.1.2.19 src/doc/CHANGES-7.1.1

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-7.1.1
diff -u src/doc/CHANGES-7.1.1:1.1.2.18 src/doc/CHANGES-7.1.1:1.1.2.19
--- src/doc/CHANGES-7.1.1:1.1.2.18	Sun Jul 23 06:15:49 2017
+++ src/doc/CHANGES-7.1.1	Wed Jul 26 16:07:41 2017
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-7.1.1,v 1.1.2.18 2017/07/23 06:15:49 snj Exp $
+# $NetBSD: CHANGES-7.1.1,v 1.1.2.19 2017/07/26 16:07:41 snj Exp $
 
 A complete list of changes from the NetBSD 7.1 release to the NetBSD 7.1.1
 release:
@@ -1724,3 +1724,20 @@ sys/modules/lua/lua.c1.21
 	Fixes PR kern/52225.
 	[mbalmer, ticket #1418]
 
+gnu/dist/gettext/gettext-tools/doc/texi2html	patch
+
+	Don't use defined() on perl arrays.
+	[mrg, ticket #1449]
+
+doc/3RDPARTY	1.1425 via patch
+external/public-domain/tz/dist/NEWS up to 1.1.1.18
+external/public-domain/tz/dist/TZDATA_VERSION   up to 1.8
+external/public-domain/tz/dist/africa   up to 1.1.1.11
+external/public-domain/tz/dist/iso3166.tab  up to 1.1.1.5
+external/public-domain/tz/dist/northamerica up to 1.1.1.16
+external/public-domain/tz/dist/version  up to 1.1.1.5
+
+	Update tzdata to 2017b.  This makes a (current) change for
+	Haiti, and a change to historic data for Liberia.
+	[kre, ticket #1450]
+



CVS commit: [netbsd-7-0] src/doc

2017-07-26 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Wed Jul 26 16:04:26 UTC 2017

Modified Files:
src/doc [netbsd-7-0]: CHANGES-7.0.3

Log Message:
1449, 1450


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.49 -r1.1.2.50 src/doc/CHANGES-7.0.3

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-7.0.3
diff -u src/doc/CHANGES-7.0.3:1.1.2.49 src/doc/CHANGES-7.0.3:1.1.2.50
--- src/doc/CHANGES-7.0.3:1.1.2.49	Thu Jul 20 01:42:54 2017
+++ src/doc/CHANGES-7.0.3	Wed Jul 26 16:04:26 2017
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-7.0.3,v 1.1.2.49 2017/07/20 01:42:54 snj Exp $
+# $NetBSD: CHANGES-7.0.3,v 1.1.2.50 2017/07/26 16:04:26 snj Exp $
 
 A complete list of changes from the NetBSD 7.0.2 release to the NetBSD 7.0.3
 release:
@@ -3014,3 +3014,20 @@ sys/arch/i386/i386/trap.c			1.288 via pa
 	the kernel.
 	[maxv, ticket #1441]
 
+gnu/dist/gettext/gettext-tools/doc/texi2html	patch
+
+	Don't use defined() on perl arrays.
+	[mrg, ticket #1449]
+
+doc/3RDPARTY	1.1425 via patch
+external/public-domain/tz/dist/NEWS up to 1.1.1.18
+external/public-domain/tz/dist/TZDATA_VERSION   up to 1.8
+external/public-domain/tz/dist/africa   up to 1.1.1.11
+external/public-domain/tz/dist/iso3166.tab  up to 1.1.1.5
+external/public-domain/tz/dist/northamerica up to 1.1.1.16
+external/public-domain/tz/dist/version  up to 1.1.1.5
+
+	Update tzdata to 2017b.  This makes a (current) change for
+	Haiti, and a change to historic data for Liberia.
+	[kre, ticket #1450]
+



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

2017-07-26 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Wed Jul 26 15:58:58 UTC 2017

Modified Files:
src/sys/dev/pci [netbsd-7]: if_iwm.c

Log Message:
Pull up following revision(s) (requested by nonaka in ticket #1459):
sys/dev/pci/if_iwm.c: revision 1.72
iwm(4): match Wireless 8265 device.


To generate a diff of this commit:
cvs rdiff -u -r1.75.2.2 -r1.75.2.3 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.75.2.2 src/sys/dev/pci/if_iwm.c:1.75.2.3
--- src/sys/dev/pci/if_iwm.c:1.75.2.2	Tue Jul 25 19:43:03 2017
+++ src/sys/dev/pci/if_iwm.c	Wed Jul 26 15:58:58 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_iwm.c,v 1.75.2.2 2017/07/25 19:43:03 snj Exp $	*/
+/*	$NetBSD: if_iwm.c,v 1.75.2.3 2017/07/26 15:58:58 snj Exp $	*/
 /*	OpenBSD: if_iwm.c,v 1.148 2016/11/19 21:07:08 stsp Exp	*/
 #define IEEE80211_NO_HT
 /*
@@ -106,7 +106,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_iwm.c,v 1.75.2.2 2017/07/25 19:43:03 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_iwm.c,v 1.75.2.3 2017/07/26 15:58:58 snj Exp $");
 
 #include 
 #include 
@@ -7784,6 +7784,7 @@ static const pci_product_id_t iwm_device
 	PCI_PRODUCT_INTEL_WIFI_LINK_8260_2,
 	PCI_PRODUCT_INTEL_WIFI_LINK_4165_1,
 	PCI_PRODUCT_INTEL_WIFI_LINK_4165_2,
+	PCI_PRODUCT_INTEL_WIFI_LINK_8265,
 };
 
 static int



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

2017-07-26 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Wed Jul 26 15:57:53 UTC 2017

Modified Files:
src/sys/dev/pci [netbsd-7]: aceride.c pciide_acer_reg.h

Log Message:
Pull up following revision(s) (requested by nakayama in ticket #1458):
sys/dev/pci/aceride.c: revision 1.37
sys/dev/pci/pciide_acer_reg.h: revision 1.13
Apply workaround from FreeBSD to fix read data corruption observed
on Fire V100 and mSATA-SSD with mSATA to IDE adapter.
The patch is from port-sparc64@.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.36.4.1 src/sys/dev/pci/aceride.c
cvs rdiff -u -r1.12 -r1.12.38.1 src/sys/dev/pci/pciide_acer_reg.h

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

Modified files:

Index: src/sys/dev/pci/aceride.c
diff -u src/sys/dev/pci/aceride.c:1.36 src/sys/dev/pci/aceride.c:1.36.4.1
--- src/sys/dev/pci/aceride.c:1.36	Mon Oct  7 19:51:55 2013
+++ src/sys/dev/pci/aceride.c	Wed Jul 26 15:57:53 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: aceride.c,v 1.36 2013/10/07 19:51:55 jakllsch Exp $	*/
+/*	$NetBSD: aceride.c,v 1.36.4.1 2017/07/26 15:57:53 snj Exp $	*/
 
 /*
  * Copyright (c) 1999, 2000, 2001 Manuel Bouyer.
@@ -25,7 +25,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: aceride.c,v 1.36 2013/10/07 19:51:55 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: aceride.c,v 1.36.4.1 2017/07/26 15:57:53 snj Exp $");
 
 #include 
 #include 
@@ -194,8 +194,13 @@ acer_chip_map(struct pciide_softc *sc, c
 	interface = PCI_INTERFACE(pci_conf_read(sc->sc_pc, sc->sc_tag,
 	PCI_CLASS_REG));
 
-	/* From linux: enable "Cable Detection" */
 	if (rev >= 0xC2) {
+		/* From FreeBSD: use device interrupt as byte count end */
+		pciide_pci_write(sc->sc_pc, sc->sc_tag, ACER_0x4A,
+		pciide_pci_read(sc->sc_pc, sc->sc_tag, ACER_0x4A)
+		| ACER_0x4A_BCEINT);
+
+		/* From linux: enable "Cable Detection" */
 		pciide_pci_write(sc->sc_pc, sc->sc_tag, ACER_0x4B,
 		pciide_pci_read(sc->sc_pc, sc->sc_tag, ACER_0x4B)
 		| ACER_0x4B_CDETECT);

Index: src/sys/dev/pci/pciide_acer_reg.h
diff -u src/sys/dev/pci/pciide_acer_reg.h:1.12 src/sys/dev/pci/pciide_acer_reg.h:1.12.38.1
--- src/sys/dev/pci/pciide_acer_reg.h:1.12	Mon Oct 19 18:41:15 2009
+++ src/sys/dev/pci/pciide_acer_reg.h	Wed Jul 26 15:57:53 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: pciide_acer_reg.h,v 1.12 2009/10/19 18:41:15 bouyer Exp $	*/
+/*	$NetBSD: pciide_acer_reg.h,v 1.12.38.1 2017/07/26 15:57:53 snj Exp $	*/
 
 /*
  * Copyright (c) 1999 Manuel Bouyer.
@@ -37,6 +37,8 @@
  * bit 1 is 0 -> secondary has 80 pin cable
  */
 #define ACER_0x4A_80PIN(chan)	(0x1 << (chan))
+/* From FreeBSD, use device interrupt as byte count end */
+#define ACER_0x4A_BCEINT	0x20
 
 /* From FreeBSD, for UDMA mode > 2 */
 #define ACER_0x4B	0x4b



CVS commit: [netbsd-7] src/libexec/ld.elf_so

2017-07-26 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Wed Jul 26 15:54:15 UTC 2017

Modified Files:
src/libexec/ld.elf_so [netbsd-7]: tls.c

Log Message:
Pull up following revision(s) (requested by joerg in ticket #1455):
libexec/ld.elf_so/tls.c: revision 1.11
Fix two bugs related to promotion of DSO TLS blocks into the static
thread allocation:
(1) Set the DTV vector up whenever an offset into the static allocation
is assigned, even if the block itself is not initialized. This has been
seen in libstdc++.
(2) Do not free a DTV block if it is part of the static thread
allocation.


To generate a diff of this commit:
cvs rdiff -u -r1.9.4.1 -r1.9.4.2 src/libexec/ld.elf_so/tls.c

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

Modified files:

Index: src/libexec/ld.elf_so/tls.c
diff -u src/libexec/ld.elf_so/tls.c:1.9.4.1 src/libexec/ld.elf_so/tls.c:1.9.4.2
--- src/libexec/ld.elf_so/tls.c:1.9.4.1	Wed Dec 31 06:51:08 2014
+++ src/libexec/ld.elf_so/tls.c	Wed Jul 26 15:54:15 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: tls.c,v 1.9.4.1 2014/12/31 06:51:08 snj Exp $	*/
+/*	$NetBSD: tls.c,v 1.9.4.2 2017/07/26 15:54:15 snj Exp $	*/
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -29,7 +29,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: tls.c,v 1.9.4.1 2014/12/31 06:51:08 snj Exp $");
+__RCSID("$NetBSD: tls.c,v 1.9.4.2 2017/07/26 15:54:15 snj Exp $");
 
 #include 
 #include 
@@ -134,7 +134,7 @@ _rtld_tls_allocate_locked(void)
 	SET_DTV_GENERATION(tcb->tcb_dtv, _rtld_tls_dtv_generation);
 
 	for (obj = _rtld_objlist; obj != NULL; obj = obj->next) {
-		if (obj->tlsinitsize && obj->tls_done) {
+		if (obj->tls_done) {
 #ifdef __HAVE_TLS_VARIANT_I
 			q = p + obj->tlsoffset;
 #else
@@ -142,7 +142,8 @@ _rtld_tls_allocate_locked(void)
 #endif
 			dbg(("obj %p dtv %p tlsoffset %zu",
 			obj, q, obj->tlsoffset));
-			memcpy(q, obj->tlsinit, obj->tlsinitsize);
+			if (obj->tlsinitsize)
+memcpy(q, obj->tlsinit, obj->tlsinitsize);
 			tcb->tcb_dtv[obj->tlsindex] = q;
 		}
 	}
@@ -167,21 +168,25 @@ void
 _rtld_tls_free(struct tls_tcb *tcb)
 {
 	size_t i, max_index;
-	uint8_t *p;
+	uint8_t *p, *p_end;
 	sigset_t mask;
 
 	_rtld_exclusive_enter();
 
-	max_index = DTV_MAX_INDEX(tcb->tcb_dtv);
-	for (i = 1; i <= max_index; ++i)
-		xfree(tcb->tcb_dtv[i]);
-	xfree(tcb->tcb_dtv - 1);
-
 #ifdef __HAVE_TLS_VARIANT_I
 	p = (uint8_t *)tcb;
 #else
 	p = (uint8_t *)tcb - _rtld_tls_static_space;
 #endif
+	p_end = p + _rtld_tls_static_space;
+
+	max_index = DTV_MAX_INDEX(tcb->tcb_dtv);
+	for (i = 1; i <= max_index; ++i) {
+		if ((uint8_t *)tcb->tcb_dtv[i] < p ||
+		(uint8_t *)tcb->tcb_dtv[i] >= p_end)
+			xfree(tcb->tcb_dtv[i]);
+	}
+	xfree(tcb->tcb_dtv - 1);
 	xfree(p);
 
 	_rtld_exclusive_exit();



CVS commit: [netbsd-7] src/sbin/route

2017-07-26 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Wed Jul 26 15:52:58 UTC 2017

Modified Files:
src/sbin/route [netbsd-7]: rtutil.c

Log Message:
Pull up following revision(s) (requested by manu in ticket #1454):
sbin/route/rtutil.c: revision 1.10
Fix route and netstat -r output when built with -DSMALL
A missing \n caused the routing table to be printed all in one line
if -DSMALL was used.


To generate a diff of this commit:
cvs rdiff -u -r1.4.2.3 -r1.4.2.4 src/sbin/route/rtutil.c

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

Modified files:

Index: src/sbin/route/rtutil.c
diff -u src/sbin/route/rtutil.c:1.4.2.3 src/sbin/route/rtutil.c:1.4.2.4
--- src/sbin/route/rtutil.c:1.4.2.3	Thu Jan  8 11:47:11 2015
+++ src/sbin/route/rtutil.c	Wed Jul 26 15:52:57 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: rtutil.c,v 1.4.2.3 2015/01/08 11:47:11 martin Exp $	*/
+/*	$NetBSD: rtutil.c,v 1.4.2.4 2017/07/26 15:52:57 snj Exp $	*/
 /*	$OpenBSD: show.c,v 1.1 2006/05/27 19:16:37 claudio Exp $	*/
 
 /*
@@ -293,6 +293,8 @@ p_rtentry(struct rt_msghdr *rtm, int fla
 	putchar('\n');
 	if (flags & RT_VFLAG)
 		p_rtrmx(>rtm_rmx);
+#else
+	putchar('\n');
 #endif
 }
 



CVS commit: [netbsd-7] src

2017-07-26 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Wed Jul 26 15:51:45 UTC 2017

Modified Files:
src/doc [netbsd-7]: 3RDPARTY
src/external/public-domain/tz/dist [netbsd-7]: NEWS TZDATA_VERSION
africa iso3166.tab northamerica version

Log Message:
Pull up following revision(s) (requested by kre in ticket #1450):
doc/3RDPARTY: revision 1.1425 via patch
external/public-domain/tz/dist/NEWS: up to 1.1.1.18
external/public-domain/tz/dist/TZDATA_VERSION: up to 1.8
external/public-domain/tz/dist/africa: up to 1.1.1.11
external/public-domain/tz/dist/iso3166.tab: up to 1.1.1.5
external/public-domain/tz/dist/northamerica: up to 1.1.1.16
external/public-domain/tz/dist/version: up to 1.1.1.5
Update tzdata to 2017b.


To generate a diff of this commit:
cvs rdiff -u -r1.1145.2.43 -r1.1145.2.44 src/doc/3RDPARTY
cvs rdiff -u -r1.1.1.1.4.7 -r1.1.1.1.4.8 \
src/external/public-domain/tz/dist/NEWS \
src/external/public-domain/tz/dist/northamerica
cvs rdiff -u -r1.6.4.3 -r1.6.4.4 \
src/external/public-domain/tz/dist/TZDATA_VERSION
cvs rdiff -u -r1.1.1.1.4.5 -r1.1.1.1.4.6 \
src/external/public-domain/tz/dist/africa
cvs rdiff -u -r1.1.1.1.4.3 -r1.1.1.1.4.4 \
src/external/public-domain/tz/dist/iso3166.tab
cvs rdiff -u -r1.1.1.3.4.3 -r1.1.1.3.4.4 \
src/external/public-domain/tz/dist/version

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.43 src/doc/3RDPARTY:1.1145.2.44
--- src/doc/3RDPARTY:1.1145.2.43	Wed Jun 21 17:23:41 2017
+++ src/doc/3RDPARTY	Wed Jul 26 15:51:45 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.1145.2.43 2017/06/21 17:23:41 snj Exp $
+#	$NetBSD: 3RDPARTY,v 1.1145.2.44 2017/07/26 15:51:45 snj Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -1300,8 +1300,8 @@ Notes:
 Added changes from a5 -> a12 manually.
 
 Package:	tz
-Version:	tzcode2014j (+ upgraded zic) / tzdata2017a
-Current Vers:	tzcode2017a / tzdata2017a
+Version:	tzcode2014j (+ upgraded zic) / tzdata2017b
+Current Vers:	tzcode2017b / tzdata2017b
 Maintainer:	Paul Eggert 
 Archive Site:	ftp://ftp.iana.org/tz/releases/
 Archive Site:	ftp://munnari.oz.au/pub/oldtz/

Index: src/external/public-domain/tz/dist/NEWS
diff -u src/external/public-domain/tz/dist/NEWS:1.1.1.1.4.7 src/external/public-domain/tz/dist/NEWS:1.1.1.1.4.8
--- src/external/public-domain/tz/dist/NEWS:1.1.1.1.4.7	Thu Mar  2 07:46:02 2017
+++ src/external/public-domain/tz/dist/NEWS	Wed Jul 26 15:51:45 2017
@@ -1,5 +1,21 @@
 News for the tz database
 
+Release 2017b - 2017-03-17 07:30:38 -0700
+
+  Briefly: Haiti has resumed DST.
+
+  Changes to past and future time stamps
+
+Haiti resumed observance of DST in 2017.  (Thanks to Steffen Thorsen.)
+
+  Changes to past time stamps
+
+Liberia changed from -004430 to +00 on 1972-01-07, not 1972-05-01.
+
+Use "MMT" to abbreviate Liberia's time zone before 1972, as "-004430"
+is one byte over the POSIX limit.  (Problem reported by Derick Rethans.)
+
+
 Release 2017a - 2017-02-28 00:05:36 -0800
 
   Briefly: Southern Chile moves from -04/-03 to -03, and Mongolia
Index: src/external/public-domain/tz/dist/northamerica
diff -u src/external/public-domain/tz/dist/northamerica:1.1.1.1.4.7 src/external/public-domain/tz/dist/northamerica:1.1.1.1.4.8
--- src/external/public-domain/tz/dist/northamerica:1.1.1.1.4.7	Thu Mar  2 07:46:02 2017
+++ src/external/public-domain/tz/dist/northamerica	Wed Jul 26 15:51:45 2017
@@ -3139,6 +3139,12 @@ Zone America/Guatemala	-6:02:04 -	LMT	19
 # http://www.vantbefinfo.com/changement-dheure-pas-pour-haiti/
 # http://news.anmwe.com/haiti-lheure-nationale-ne-sera-ni-avancee-ni-reculee-cette-annee/
 
+# From Steffen Thorsen (2017-03-12):
+# We have received 4 mails from different people telling that Haiti
+# has started DST again today, and this source seems to confirm that,
+# I have not been able to find a more authoritative source:
+# https://www.haitilibre.com/en/news-20319-haiti-notices-time-change-in-haiti.html
+
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule	Haiti	1983	only	-	May	8	0:00	1:00	D
 Rule	Haiti	1984	1987	-	Apr	lastSun	0:00	1:00	D
@@ -3151,6 +3157,8 @@ Rule	Haiti	2005	2006	-	Apr	Sun>=1	0:00	1
 Rule	Haiti	2005	2006	-	Oct	lastSun	0:00	0	S
 Rule	Haiti	2012	2015	-	Mar	Sun>=8	2:00	1:00	D
 Rule	Haiti	2012	2015	-	Nov	Sun>=1	2:00	0	S
+Rule	Haiti	2017	max	-	Mar	Sun>=8	2:00	1:00	D
+Rule	Haiti	2017	max	-	Nov	Sun>=1	2:00	0	S
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone America/Port-au-Prince -4:49:20 -	LMT	1890
 			-4:49	-	PPMT	1917 Jan 24 12:00 # P-a-P MT

Index: src/external/public-domain/tz/dist/TZDATA_VERSION
diff -u src/external/public-domain/tz/dist/TZDATA_VERSION:1.6.4.3 src/external/public-domain/tz/dist/TZDATA_VERSION:1.6.4.4
--- 

CVS commit: [netbsd-7-1] src

2017-07-26 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Wed Jul 26 15:51:13 UTC 2017

Modified Files:
src/doc [netbsd-7-1]: 3RDPARTY
src/external/public-domain/tz/dist [netbsd-7-1]: NEWS TZDATA_VERSION
africa iso3166.tab northamerica version

Log Message:
Pull up following revision(s) (requested by kre in ticket #1450):
doc/3RDPARTY: revision 1.1425 via patch
external/public-domain/tz/dist/NEWS: up to 1.1.1.18
external/public-domain/tz/dist/TZDATA_VERSION: up to 1.8
external/public-domain/tz/dist/africa: up to 1.1.1.11
external/public-domain/tz/dist/iso3166.tab: up to 1.1.1.5
external/public-domain/tz/dist/northamerica: up to 1.1.1.16
external/public-domain/tz/dist/version: up to 1.1.1.5
Update tzdata to 2017b.


To generate a diff of this commit:
cvs rdiff -u -r1.1145.2.37.2.4 -r1.1145.2.37.2.5 src/doc/3RDPARTY
cvs rdiff -u -r1.1.1.1.4.7 -r1.1.1.1.4.7.2.1 \
src/external/public-domain/tz/dist/NEWS \
src/external/public-domain/tz/dist/northamerica
cvs rdiff -u -r1.6.4.3 -r1.6.4.3.2.1 \
src/external/public-domain/tz/dist/TZDATA_VERSION
cvs rdiff -u -r1.1.1.1.4.5 -r1.1.1.1.4.5.2.1 \
src/external/public-domain/tz/dist/africa
cvs rdiff -u -r1.1.1.1.4.3 -r1.1.1.1.4.3.2.1 \
src/external/public-domain/tz/dist/iso3166.tab
cvs rdiff -u -r1.1.1.3.4.3 -r1.1.1.3.4.3.2.1 \
src/external/public-domain/tz/dist/version

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.37.2.4 src/doc/3RDPARTY:1.1145.2.37.2.5
--- src/doc/3RDPARTY:1.1145.2.37.2.4	Tue Jun 20 17:01:56 2017
+++ src/doc/3RDPARTY	Wed Jul 26 15:51:13 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.1145.2.37.2.4 2017/06/20 17:01:56 snj Exp $
+#	$NetBSD: 3RDPARTY,v 1.1145.2.37.2.5 2017/07/26 15:51:13 snj Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -1300,8 +1300,8 @@ Notes:
 Added changes from a5 -> a12 manually.
 
 Package:	tz
-Version:	tzcode2014j (+ upgraded zic) / tzdata2017a
-Current Vers:	tzcode2017a / tzdata2017a
+Version:	tzcode2014j (+ upgraded zic) / tzdata2017b
+Current Vers:	tzcode2017b / tzdata2017b
 Maintainer:	Paul Eggert 
 Archive Site:	ftp://ftp.iana.org/tz/releases/
 Archive Site:	ftp://munnari.oz.au/pub/oldtz/

Index: src/external/public-domain/tz/dist/NEWS
diff -u src/external/public-domain/tz/dist/NEWS:1.1.1.1.4.7 src/external/public-domain/tz/dist/NEWS:1.1.1.1.4.7.2.1
--- src/external/public-domain/tz/dist/NEWS:1.1.1.1.4.7	Thu Mar  2 07:46:02 2017
+++ src/external/public-domain/tz/dist/NEWS	Wed Jul 26 15:51:13 2017
@@ -1,5 +1,21 @@
 News for the tz database
 
+Release 2017b - 2017-03-17 07:30:38 -0700
+
+  Briefly: Haiti has resumed DST.
+
+  Changes to past and future time stamps
+
+Haiti resumed observance of DST in 2017.  (Thanks to Steffen Thorsen.)
+
+  Changes to past time stamps
+
+Liberia changed from -004430 to +00 on 1972-01-07, not 1972-05-01.
+
+Use "MMT" to abbreviate Liberia's time zone before 1972, as "-004430"
+is one byte over the POSIX limit.  (Problem reported by Derick Rethans.)
+
+
 Release 2017a - 2017-02-28 00:05:36 -0800
 
   Briefly: Southern Chile moves from -04/-03 to -03, and Mongolia
Index: src/external/public-domain/tz/dist/northamerica
diff -u src/external/public-domain/tz/dist/northamerica:1.1.1.1.4.7 src/external/public-domain/tz/dist/northamerica:1.1.1.1.4.7.2.1
--- src/external/public-domain/tz/dist/northamerica:1.1.1.1.4.7	Thu Mar  2 07:46:02 2017
+++ src/external/public-domain/tz/dist/northamerica	Wed Jul 26 15:51:13 2017
@@ -3139,6 +3139,12 @@ Zone America/Guatemala	-6:02:04 -	LMT	19
 # http://www.vantbefinfo.com/changement-dheure-pas-pour-haiti/
 # http://news.anmwe.com/haiti-lheure-nationale-ne-sera-ni-avancee-ni-reculee-cette-annee/
 
+# From Steffen Thorsen (2017-03-12):
+# We have received 4 mails from different people telling that Haiti
+# has started DST again today, and this source seems to confirm that,
+# I have not been able to find a more authoritative source:
+# https://www.haitilibre.com/en/news-20319-haiti-notices-time-change-in-haiti.html
+
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule	Haiti	1983	only	-	May	8	0:00	1:00	D
 Rule	Haiti	1984	1987	-	Apr	lastSun	0:00	1:00	D
@@ -3151,6 +3157,8 @@ Rule	Haiti	2005	2006	-	Apr	Sun>=1	0:00	1
 Rule	Haiti	2005	2006	-	Oct	lastSun	0:00	0	S
 Rule	Haiti	2012	2015	-	Mar	Sun>=8	2:00	1:00	D
 Rule	Haiti	2012	2015	-	Nov	Sun>=1	2:00	0	S
+Rule	Haiti	2017	max	-	Mar	Sun>=8	2:00	1:00	D
+Rule	Haiti	2017	max	-	Nov	Sun>=1	2:00	0	S
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone America/Port-au-Prince -4:49:20 -	LMT	1890
 			-4:49	-	PPMT	1917 Jan 24 12:00 # P-a-P MT

Index: src/external/public-domain/tz/dist/TZDATA_VERSION
diff -u src/external/public-domain/tz/dist/TZDATA_VERSION:1.6.4.3 

CVS commit: [netbsd-7-0] src

2017-07-26 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Wed Jul 26 15:50:28 UTC 2017

Modified Files:
src/doc [netbsd-7-0]: 3RDPARTY
src/external/public-domain/tz/dist [netbsd-7-0]: NEWS TZDATA_VERSION
africa iso3166.tab northamerica version

Log Message:
Pull up following revision(s) (requested by kre in ticket #1450):
doc/3RDPARTY: revision 1.1425 via patch
external/public-domain/tz/dist/NEWS: up to 1.1.1.18
external/public-domain/tz/dist/TZDATA_VERSION: up to 1.8
external/public-domain/tz/dist/africa: up to 1.1.1.11
external/public-domain/tz/dist/iso3166.tab: up to 1.1.1.5
external/public-domain/tz/dist/northamerica: up to 1.1.1.16
external/public-domain/tz/dist/version: up to 1.1.1.5
Update tzdata to 2017b.


To generate a diff of this commit:
cvs rdiff -u -r1.1145.2.18.2.21 -r1.1145.2.18.2.22 src/doc/3RDPARTY
cvs rdiff -u -r1.1.1.1.4.4.2.3 -r1.1.1.1.4.4.2.4 \
src/external/public-domain/tz/dist/NEWS \
src/external/public-domain/tz/dist/northamerica
cvs rdiff -u -r1.6.2.3 -r1.6.2.4 \
src/external/public-domain/tz/dist/TZDATA_VERSION
cvs rdiff -u -r1.1.1.1.4.3.2.2 -r1.1.1.1.4.3.2.3 \
src/external/public-domain/tz/dist/africa
cvs rdiff -u -r1.1.1.1.4.1.2.2 -r1.1.1.1.4.1.2.3 \
src/external/public-domain/tz/dist/iso3166.tab
cvs rdiff -u -r1.1.1.3.2.3 -r1.1.1.3.2.4 \
src/external/public-domain/tz/dist/version

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.18.2.21 src/doc/3RDPARTY:1.1145.2.18.2.22
--- src/doc/3RDPARTY:1.1145.2.18.2.21	Wed Jun 21 17:09:13 2017
+++ src/doc/3RDPARTY	Wed Jul 26 15:50:28 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.1145.2.18.2.21 2017/06/21 17:09:13 snj Exp $
+#	$NetBSD: 3RDPARTY,v 1.1145.2.18.2.22 2017/07/26 15:50:28 snj Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -1300,8 +1300,8 @@ Notes:
 Added changes from a5 -> a12 manually.
 
 Package:	tz
-Version:	tzcode2014j (+ upgraded zic) / tzdata2017a
-Current Vers:	tzcode2017a / tzdata2017a
+Version:	tzcode2014j (+ upgraded zic) / tzdata2017b
+Current Vers:	tzcode2017b / tzdata2017b
 Maintainer:	Paul Eggert 
 Archive Site:	ftp://ftp.iana.org/tz/releases/
 Archive Site:	ftp://munnari.oz.au/pub/oldtz/

Index: src/external/public-domain/tz/dist/NEWS
diff -u src/external/public-domain/tz/dist/NEWS:1.1.1.1.4.4.2.3 src/external/public-domain/tz/dist/NEWS:1.1.1.1.4.4.2.4
--- src/external/public-domain/tz/dist/NEWS:1.1.1.1.4.4.2.3	Thu Mar  2 07:44:13 2017
+++ src/external/public-domain/tz/dist/NEWS	Wed Jul 26 15:50:28 2017
@@ -1,5 +1,21 @@
 News for the tz database
 
+Release 2017b - 2017-03-17 07:30:38 -0700
+
+  Briefly: Haiti has resumed DST.
+
+  Changes to past and future time stamps
+
+Haiti resumed observance of DST in 2017.  (Thanks to Steffen Thorsen.)
+
+  Changes to past time stamps
+
+Liberia changed from -004430 to +00 on 1972-01-07, not 1972-05-01.
+
+Use "MMT" to abbreviate Liberia's time zone before 1972, as "-004430"
+is one byte over the POSIX limit.  (Problem reported by Derick Rethans.)
+
+
 Release 2017a - 2017-02-28 00:05:36 -0800
 
   Briefly: Southern Chile moves from -04/-03 to -03, and Mongolia
Index: src/external/public-domain/tz/dist/northamerica
diff -u src/external/public-domain/tz/dist/northamerica:1.1.1.1.4.4.2.3 src/external/public-domain/tz/dist/northamerica:1.1.1.1.4.4.2.4
--- src/external/public-domain/tz/dist/northamerica:1.1.1.1.4.4.2.3	Thu Mar  2 07:44:13 2017
+++ src/external/public-domain/tz/dist/northamerica	Wed Jul 26 15:50:28 2017
@@ -3139,6 +3139,12 @@ Zone America/Guatemala	-6:02:04 -	LMT	19
 # http://www.vantbefinfo.com/changement-dheure-pas-pour-haiti/
 # http://news.anmwe.com/haiti-lheure-nationale-ne-sera-ni-avancee-ni-reculee-cette-annee/
 
+# From Steffen Thorsen (2017-03-12):
+# We have received 4 mails from different people telling that Haiti
+# has started DST again today, and this source seems to confirm that,
+# I have not been able to find a more authoritative source:
+# https://www.haitilibre.com/en/news-20319-haiti-notices-time-change-in-haiti.html
+
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule	Haiti	1983	only	-	May	8	0:00	1:00	D
 Rule	Haiti	1984	1987	-	Apr	lastSun	0:00	1:00	D
@@ -3151,6 +3157,8 @@ Rule	Haiti	2005	2006	-	Apr	Sun>=1	0:00	1
 Rule	Haiti	2005	2006	-	Oct	lastSun	0:00	0	S
 Rule	Haiti	2012	2015	-	Mar	Sun>=8	2:00	1:00	D
 Rule	Haiti	2012	2015	-	Nov	Sun>=1	2:00	0	S
+Rule	Haiti	2017	max	-	Mar	Sun>=8	2:00	1:00	D
+Rule	Haiti	2017	max	-	Nov	Sun>=1	2:00	0	S
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone America/Port-au-Prince -4:49:20 -	LMT	1890
 			-4:49	-	PPMT	1917 Jan 24 12:00 # P-a-P MT

Index: src/external/public-domain/tz/dist/TZDATA_VERSION
diff -u 

CVS commit: [netbsd-7-0] src/gnu/dist/gettext/gettext-tools/doc

2017-07-26 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Wed Jul 26 15:38:31 UTC 2017

Modified Files:
src/gnu/dist/gettext/gettext-tools/doc [netbsd-7-0]: texi2html

Log Message:
Apply patch (requested by mrg in ticket #1449):
Don't use defined() on perl arrays.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.1.1.1.64.1 \
src/gnu/dist/gettext/gettext-tools/doc/texi2html

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

Modified files:

Index: src/gnu/dist/gettext/gettext-tools/doc/texi2html
diff -u src/gnu/dist/gettext/gettext-tools/doc/texi2html:1.1.1.1 src/gnu/dist/gettext/gettext-tools/doc/texi2html:1.1.1.1.64.1
--- src/gnu/dist/gettext/gettext-tools/doc/texi2html:1.1.1.1	Fri Apr 29 15:07:26 2005
+++ src/gnu/dist/gettext/gettext-tools/doc/texi2html	Wed Jul 26 15:38:31 2017
@@ -1532,7 +1532,7 @@ sub update_sec_num {
 $level--; # here we start at 0
 if ($name =~ /^appendix/) {
 	# appendix style
-	if (defined(@appendix_sec_num)) {
+	if (@appendix_sec_num) {
 	_sec_num($level, @appendix_sec_num);
 	} else {
 	@appendix_sec_num = ('A', 0, 0, 0);
@@ -1540,7 +1540,7 @@ sub update_sec_num {
 	return(join('.', @appendix_sec_num[0..$level]));
 } else {
 	# normal style
-	if (defined(@normal_sec_num)) {
+	if (@normal_sec_num) {
 	_sec_num($level, @normal_sec_num);
 	} else {
 	@normal_sec_num = (1, 0, 0, 0);



CVS commit: [netbsd-7-1] src/gnu/dist/gettext/gettext-tools/doc

2017-07-26 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Wed Jul 26 15:38:12 UTC 2017

Modified Files:
src/gnu/dist/gettext/gettext-tools/doc [netbsd-7-1]: texi2html

Log Message:
Apply patch (requested by mrg in ticket #1449):
Don't use defined() on perl arrays.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.1.1.1.68.1 \
src/gnu/dist/gettext/gettext-tools/doc/texi2html

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

Modified files:

Index: src/gnu/dist/gettext/gettext-tools/doc/texi2html
diff -u src/gnu/dist/gettext/gettext-tools/doc/texi2html:1.1.1.1 src/gnu/dist/gettext/gettext-tools/doc/texi2html:1.1.1.1.68.1
--- src/gnu/dist/gettext/gettext-tools/doc/texi2html:1.1.1.1	Fri Apr 29 15:07:26 2005
+++ src/gnu/dist/gettext/gettext-tools/doc/texi2html	Wed Jul 26 15:38:12 2017
@@ -1532,7 +1532,7 @@ sub update_sec_num {
 $level--; # here we start at 0
 if ($name =~ /^appendix/) {
 	# appendix style
-	if (defined(@appendix_sec_num)) {
+	if (@appendix_sec_num) {
 	_sec_num($level, @appendix_sec_num);
 	} else {
 	@appendix_sec_num = ('A', 0, 0, 0);
@@ -1540,7 +1540,7 @@ sub update_sec_num {
 	return(join('.', @appendix_sec_num[0..$level]));
 } else {
 	# normal style
-	if (defined(@normal_sec_num)) {
+	if (@normal_sec_num) {
 	_sec_num($level, @normal_sec_num);
 	} else {
 	@normal_sec_num = (1, 0, 0, 0);



CVS commit: [netbsd-7] src/gnu/dist/gettext/gettext-tools/doc

2017-07-26 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Wed Jul 26 15:37:58 UTC 2017

Modified Files:
src/gnu/dist/gettext/gettext-tools/doc [netbsd-7]: texi2html

Log Message:
Apply patch (requested by mrg in ticket #1449):
Don't use defined() on perl arrays.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.1.1.1.62.1 \
src/gnu/dist/gettext/gettext-tools/doc/texi2html

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

Modified files:

Index: src/gnu/dist/gettext/gettext-tools/doc/texi2html
diff -u src/gnu/dist/gettext/gettext-tools/doc/texi2html:1.1.1.1 src/gnu/dist/gettext/gettext-tools/doc/texi2html:1.1.1.1.62.1
--- src/gnu/dist/gettext/gettext-tools/doc/texi2html:1.1.1.1	Fri Apr 29 15:07:26 2005
+++ src/gnu/dist/gettext/gettext-tools/doc/texi2html	Wed Jul 26 15:37:58 2017
@@ -1532,7 +1532,7 @@ sub update_sec_num {
 $level--; # here we start at 0
 if ($name =~ /^appendix/) {
 	# appendix style
-	if (defined(@appendix_sec_num)) {
+	if (@appendix_sec_num) {
 	_sec_num($level, @appendix_sec_num);
 	} else {
 	@appendix_sec_num = ('A', 0, 0, 0);
@@ -1540,7 +1540,7 @@ sub update_sec_num {
 	return(join('.', @appendix_sec_num[0..$level]));
 } else {
 	# normal style
-	if (defined(@normal_sec_num)) {
+	if (@normal_sec_num) {
 	_sec_num($level, @normal_sec_num);
 	} else {
 	@normal_sec_num = (1, 0, 0, 0);



CVS commit: src/share/man/man7

2017-07-26 Thread Leonardo Taccari
Module Name:src
Committed By:   leot
Date:   Wed Jul 26 15:32:09 UTC 2017

Modified Files:
src/share/man/man7: release.7

Log Message:
Document xetc.tgz installation set.

Thanks to  for the review!


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/share/man/man7/release.7

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

Modified files:

Index: src/share/man/man7/release.7
diff -u src/share/man/man7/release.7:1.37 src/share/man/man7/release.7:1.38
--- src/share/man/man7/release.7:1.37	Mon Jul  3 21:30:59 2017
+++ src/share/man/man7/release.7	Wed Jul 26 15:32:09 2017
@@ -1,4 +1,4 @@
-.\"	$NetBSD: release.7,v 1.37 2017/07/03 21:30:59 wiz Exp $
+.\"	$NetBSD: release.7,v 1.38 2017/07/26 15:32:09 leot Exp $
 .\"
 .\" Copyright (c) 1997, 2000, 2005 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -27,7 +27,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd November 3, 2014
+.Dd July 26, 2017
 .Dt RELEASE 7
 .Os
 .Sh NAME
@@ -314,6 +314,8 @@ all related programs, and their manual p
 .It Sy xbase.tgz
 This set includes the base X11 distribution, including manual pages
 and excluding everything contained in the other X11 sets.
+.It Sy xetc.tgz
+This set includes X11 configuration files.
 .It Sy xcomp.tgz
 This set includes the X11 include files and static X11 libraries.
 .It Sy xfont.tgz



CVS commit: [netbsd-7] src

2017-07-26 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Wed Jul 26 15:22:37 UTC 2017

Modified Files:
src/external/broadcom/rpi-firmware/dist [netbsd-7]: bootcode.bin
fixup.dat fixup_cd.dat start.elf start_cd.elf
src/sys/arch/arm/arm32 [netbsd-7]: cpu.c
src/sys/arch/arm/broadcom [netbsd-7]: bcm2835_bsc.c bcm2835_plcom.c
src/sys/arch/arm/cortex [netbsd-7]: gtmr.c
src/sys/arch/arm/include [netbsd-7]: armreg.h vfpreg.h
src/sys/arch/arm/vfp [netbsd-7]: vfp_init.c
src/sys/arch/evbarm/rpi [netbsd-7]: rpi_machdep.c vcprop.h

Log Message:
Pull up following revision(s) (requested by jmcneill in ticket #1435):
sys/arch/arm/arm32/cpu.c: 1.113 via patch
sys/arch/arm/broadcom/bcm2835_bsc.c: 1.6 via patch
sys/arch/arm/broadcom/bcm2835_plcom.c: 1.4 via patch
sys/arch/arm/cortex/gtmr.c: 1.18 via patch
sys/arch/arm/include/armreg.h: 1.110 via patch
sys/arch/arm/include/vfpreg.h: 1.15 via patch
sys/arch/arm/vfp/vfp_init.c: 1.50 via patch
sys/arch/evbarm/rpi/rpi_machdep.c: 1.59, 1.70-1.72 via patch
sys/arch/evbarm/rpi/vcprop.h: 1.16
Get the RPI3 working (in aarch32 mode) by recognising Cortex A53 CPUs.
While I'm here add some A57/A72 info as well.
My RPI3 works with FB console - the uart needs some help with its clocks.
--
Do invalidate the cache as RPI2 build with Clang can't fetch the memory
config otherwise.
--
Use the VC property mailbox to request the UART clock rate and use it
appropriately
Newer firmwares use 48MHz
--
Disable BSC0 on Raspberry Pi 3 and Zero W boards.
--
Interrupts are enabled before the timer is configured. Ensure that the
timer is disabled when attaching so it doesn't go crazy between the time
interrupts are enabled and clocks are initialized. My RPI3 makes it
multi-user now.
--
Enable UART0 (PL011) on GPIO header for Raspberry Pi 3 / Zero W


To generate a diff of this commit:
cvs rdiff -u -r1.5.2.2 -r1.5.2.3 \
src/external/broadcom/rpi-firmware/dist/bootcode.bin \
src/external/broadcom/rpi-firmware/dist/fixup.dat \
src/external/broadcom/rpi-firmware/dist/fixup_cd.dat \
src/external/broadcom/rpi-firmware/dist/start.elf \
src/external/broadcom/rpi-firmware/dist/start_cd.elf
cvs rdiff -u -r1.104.4.1 -r1.104.4.2 src/sys/arch/arm/arm32/cpu.c
cvs rdiff -u -r1.2.4.1 -r1.2.4.2 src/sys/arch/arm/broadcom/bcm2835_bsc.c
cvs rdiff -u -r1.1 -r1.1.18.1 src/sys/arch/arm/broadcom/bcm2835_plcom.c
cvs rdiff -u -r1.8.2.2 -r1.8.2.3 src/sys/arch/arm/cortex/gtmr.c
cvs rdiff -u -r1.97.2.2 -r1.97.2.3 src/sys/arch/arm/include/armreg.h
cvs rdiff -u -r1.13 -r1.13.4.1 src/sys/arch/arm/include/vfpreg.h
cvs rdiff -u -r1.41.2.2 -r1.41.2.3 src/sys/arch/arm/vfp/vfp_init.c
cvs rdiff -u -r1.43.2.6 -r1.43.2.7 src/sys/arch/evbarm/rpi/rpi_machdep.c
cvs rdiff -u -r1.9 -r1.9.2.1 src/sys/arch/evbarm/rpi/vcprop.h

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

Modified files:

Index: src/external/broadcom/rpi-firmware/dist/bootcode.bin
Binary files are different
Index: src/external/broadcom/rpi-firmware/dist/fixup.dat
Binary files are different
Index: src/external/broadcom/rpi-firmware/dist/fixup_cd.dat
Binary files are different
Index: src/external/broadcom/rpi-firmware/dist/start.elf
Binary files are different
Index: src/external/broadcom/rpi-firmware/dist/start_cd.elf
Binary files are different

Index: src/sys/arch/arm/arm32/cpu.c
diff -u src/sys/arch/arm/arm32/cpu.c:1.104.4.1 src/sys/arch/arm/arm32/cpu.c:1.104.4.2
--- src/sys/arch/arm/arm32/cpu.c:1.104.4.1	Mon Apr  6 01:57:57 2015
+++ src/sys/arch/arm/arm32/cpu.c	Wed Jul 26 15:22:36 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.c,v 1.104.4.1 2015/04/06 01:57:57 snj Exp $	*/
+/*	$NetBSD: cpu.c,v 1.104.4.2 2017/07/26 15:22:36 snj Exp $	*/
 
 /*
  * Copyright (c) 1995 Mark Brinicombe.
@@ -46,7 +46,7 @@
 
 #include 
 
-__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.104.4.1 2015/04/06 01:57:57 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.104.4.2 2017/07/26 15:22:36 snj Exp $");
 
 #include 
 #include 
@@ -511,6 +511,14 @@ const struct cpuidtab cpuids[] = {
 	  pN_steppings, "7A" },
 	{ CPU_ID_CORTEXA15R3,	CPU_CLASS_CORTEX,	"Cortex-A15 r3",
 	  pN_steppings, "7A" },
+	{ CPU_ID_CORTEXA53R0,	CPU_CLASS_CORTEX,	"Cortex-A53 r0",
+	  pN_steppings, "8A" },
+	{ CPU_ID_CORTEXA57R0,	CPU_CLASS_CORTEX,	"Cortex-A57 r0",
+	  pN_steppings, "8A" },
+	{ CPU_ID_CORTEXA57R1,	CPU_CLASS_CORTEX,	"Cortex-A57 r1",
+	  pN_steppings, "8A" },
+	{ CPU_ID_CORTEXA72R0,	CPU_CLASS_CORTEX,	"Cortex-A72 r0",
+	  pN_steppings, "8A" },
 
 	{ CPU_ID_MV88SV581X_V6, CPU_CLASS_PJ4B,  "Sheeva 88SV581x",
 	  generic_steppings },

Index: src/sys/arch/arm/broadcom/bcm2835_bsc.c
diff -u src/sys/arch/arm/broadcom/bcm2835_bsc.c:1.2.4.1 src/sys/arch/arm/broadcom/bcm2835_bsc.c:1.2.4.2
--- src/sys/arch/arm/broadcom/bcm2835_bsc.c:1.2.4.1	Thu Sep 11 13:46:49 2014
+++ src/sys/arch/arm/broadcom/bcm2835_bsc.c	Wed Jul 26 15:22:36 

CVS commit: src/sys/ufs/lfs

2017-07-26 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Wed Jul 26 15:07:27 UTC 2017

Modified Files:
src/sys/ufs/lfs: lfs_segment.c

Log Message:
Revert r1.272 fix to PR kern/52301, the performance hit is making things
unusable.


To generate a diff of this commit:
cvs rdiff -u -r1.272 -r1.273 src/sys/ufs/lfs/lfs_segment.c

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

Modified files:

Index: src/sys/ufs/lfs/lfs_segment.c
diff -u src/sys/ufs/lfs/lfs_segment.c:1.272 src/sys/ufs/lfs/lfs_segment.c:1.273
--- src/sys/ufs/lfs/lfs_segment.c:1.272	Thu Jun 15 14:37:30 2017
+++ src/sys/ufs/lfs/lfs_segment.c	Wed Jul 26 15:07:27 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: lfs_segment.c,v 1.272 2017/06/15 14:37:30 maya Exp $	*/
+/*	$NetBSD: lfs_segment.c,v 1.273 2017/07/26 15:07:27 maya Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2002, 2003 The NetBSD Foundation, Inc.
@@ -60,7 +60,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: lfs_segment.c,v 1.272 2017/06/15 14:37:30 maya Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lfs_segment.c,v 1.273 2017/07/26 15:07:27 maya Exp $");
 
 #ifdef DEBUG
 # define vndebug(vp, str) do {		\
@@ -603,6 +603,7 @@ lfs_segwrite(struct mount *mp, int flags
 	SEGUSE *segusep;
 	int do_ckp, did_ckp, error;
 	unsigned n, segleft, maxseg, sn, i, curseg;
+	int writer_set = 0;
 	int dirty;
 	int redo;
 	SEGSUM *ssp;
@@ -627,8 +628,6 @@ lfs_segwrite(struct mount *mp, int flags
 	if (do_ckp)
 		flags &= ~SEGM_SINGLE;
 
-	lfs_writer_enter(fs, "lfs segwrite");
-
 	lfs_seglock(fs, flags | (do_ckp ? SEGM_CKP : 0));
 	sp = fs->lfs_sp;
 	if (sp->seg_flags & (SEGM_CLEAN | SEGM_CKP))
@@ -654,7 +653,11 @@ lfs_segwrite(struct mount *mp, int flags
 break;
 			}
 
-			if (do_ckp) {
+			if (do_ckp || fs->lfs_dirops == 0) {
+if (!writer_set) {
+	lfs_writer_enter(fs, "lfs writer");
+	writer_set = 1;
+}
 error = lfs_writevnodes(fs, mp, sp, VN_DIROP);
 if (um_error == 0)
 	um_error = error;
@@ -803,7 +806,8 @@ lfs_segwrite(struct mount *mp, int flags
 
 	/* Note Ifile no longer needs to be written */
 	fs->lfs_doifile = 0;
-	lfs_writer_leave(fs);
+	if (writer_set)
+		lfs_writer_leave(fs);
 
 	/*
 	 * If we didn't write the Ifile, we didn't really do anything.



CVS commit: src/sys/ufs/lfs

2017-07-26 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Wed Jul 26 14:39:00 UTC 2017

Modified Files:
src/sys/ufs/lfs: lfs_subr.c

Log Message:
Deduplicate sanity check that seglock is held on segunlock


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

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

Modified files:

Index: src/sys/ufs/lfs/lfs_subr.c
diff -u src/sys/ufs/lfs/lfs_subr.c:1.95 src/sys/ufs/lfs/lfs_subr.c:1.96
--- src/sys/ufs/lfs/lfs_subr.c:1.95	Mon Jun 19 12:09:37 2017
+++ src/sys/ufs/lfs/lfs_subr.c	Wed Jul 26 14:38:59 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: lfs_subr.c,v 1.95 2017/06/19 12:09:37 maya Exp $	*/
+/*	$NetBSD: lfs_subr.c,v 1.96 2017/07/26 14:38:59 maya Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2002, 2003 The NetBSD Foundation, Inc.
@@ -60,7 +60,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: lfs_subr.c,v 1.95 2017/06/19 12:09:37 maya Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lfs_subr.c,v 1.96 2017/07/26 14:38:59 maya Exp $");
 
 #include 
 #include 
@@ -430,7 +430,10 @@ lfs_segunlock(struct lfs *fs)
 	sp = fs->lfs_sp;
 
 	mutex_enter(_lock);
-	KASSERT(LFS_SEGLOCK_HELD(fs));
+
+	if (!LFS_SEGLOCK_HELD(fs))
+		panic("lfs seglock not held");
+
 	if (fs->lfs_seglock == 1) {
 		if ((sp->seg_flags & (SEGM_PROT | SEGM_CLEAN)) == 0)
 			do_unmark_dirop = 1;
@@ -534,9 +537,6 @@ lfs_segunlock(struct lfs *fs)
 		rw_exit(>lfs_fraglock);
 		if (do_unmark_dirop)
 			lfs_unmark_dirop(fs);
-	} else if (fs->lfs_seglock == 0) {
-		mutex_exit(_lock);
-		panic ("Seglock not held");
 	} else {
 		--fs->lfs_seglock;
 		mutex_exit(_lock);



CVS commit: src/lib/libm

2017-07-26 Thread Havard Eidnes
Module Name:src
Committed By:   he
Date:   Wed Jul 26 09:53:09 UTC 2017

Modified Files:
src/lib/libm: Makefile

Log Message:
Add s_nearbyint.c to alpha, ia64, riscv, mips, powerpc, and sh3 ports.


To generate a diff of this commit:
cvs rdiff -u -r1.192 -r1.193 src/lib/libm/Makefile

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

Modified files:

Index: src/lib/libm/Makefile
diff -u src/lib/libm/Makefile:1.192 src/lib/libm/Makefile:1.193
--- src/lib/libm/Makefile:1.192	Wed Jul 26 09:42:12 2017
+++ src/lib/libm/Makefile	Wed Jul 26 09:53:09 2017
@@ -1,4 +1,4 @@
-#  $NetBSD: Makefile,v 1.192 2017/07/26 09:42:12 he Exp $
+#  $NetBSD: Makefile,v 1.193 2017/07/26 09:53:09 he Exp $
 #
 #  @(#)Makefile 5.1beta 93/09/24
 #
@@ -62,11 +62,11 @@ COMMON_SRCS+= fenv.c
 .endif
 COMMON_SRCS+= e_sqrtl.c
 COMMON_SRCS+= s_fma.c s_fmaf.c s_fmal.c
-.elif (${LIBC_MACHINE_ARCH} == "alpha")
 
+.elif (${LIBC_MACHINE_ARCH} == "alpha")
 .PATH: ${.CURDIR}/arch/alpha
 ARCH_SRCS = s_copysign.S s_copysignf.S lrint.S
-COMMON_SRCS+= fenv.c
+COMMON_SRCS+= fenv.c s_nearbyint.c
 COPTS+=	-mfloat-ieee -mieee-with-inexact -mfp-trap-mode=sui -mtrap-precision=i
 
 .elif (${LIBC_MACHINE_CPU} == "arm")
@@ -82,11 +82,11 @@ COMMON_SRCS+= s_fma.c s_fmaf.c s_fmal.c
 .if (${MKSOFTFLOAT} == "no")
 .PATH.S: ${.CURDIR}/arch/arm
 ARCH_SRCS = e_sqrt.S e_sqrtf.S lrint.S lrintf.S s_fabsf.S s_fma.S s_fmaf.S
-
 .endif
+
 .elif (${LIBC_MACHINE_ARCH} == "ia64")
 .PATH: ${.CURDIR}/arch/ia64
-COMMON_SRCS += fenv.c
+COMMON_SRCS += fenv.c s_nearbyint.c
 
 .elif (${LIBC_MACHINE_ARCH} == "hppa")
 .PATH.c: ${.CURDIR}/arch/hppa
@@ -154,7 +154,7 @@ ARCH_SRCS = e_acos.S e_asin.S e_atanh.S 
 	e_log10.S e_remainder.S e_scalb.S e_sinh.S e_sqrt.S s_atan.S \
 	s_ceil.S s_copysign.S s_cos.S s_expm1.S s_finite.S s_floor.S \
 	s_log1p.S s_logb.S s_rint.S s_scalbn.S s_sin.S s_tan.S s_tanh.S
-COMMON_SRCS += fenv.c
+COMMON_SRCS += fenv.c s_nearbyint.c
 .endif
 .endif
 # end of m68k
@@ -174,7 +174,7 @@ WARNS?=5
 .PATH:	${.CURDIR}/arch/riscv
 
 .if ${MKSOFTFLOAT} == "no"
-COMMON_SRCS += fenv.c
+COMMON_SRCS += fenv.c s_nearbyint.c
 ARCH_SRCS = e_sqrt.S e_sqrtf.S
 ARCH_SRCS += s_copysign.S s_copysignf.S
 ARCH_SRCS += s_fabs.S s_fabsf.S
@@ -186,22 +186,22 @@ ARCH_SRCS += s_fmin.S s_fminf.S
 .elif (${LIBC_MACHINE_ARCH} == "powerpc")
 .PATH:	${.CURDIR}/arch/powerpc
 .if ${MKSOFTFLOAT} == "no"
-COMMON_SRCS += fenv.c
+COMMON_SRCS += fenv.c s_nearbyint.c
 .endif
 
 .elif (${LIBC_MACHINE_CPU} == "mips")
 .PATH:	${.CURDIR}/arch/mips
 .if ${MKSOFTFLOAT} == "no"
-COMMON_SRCS += fenv.c
+COMMON_SRCS += fenv.c s_nearbyint.c
 .endif
 
 .elif (${LIBC_MACHINE_CPU} == "sh3")
 .PATH:	${.CURDIR}/arch/sh3
 .if ${MKSOFTFLOAT} == "no"
-COMMON_SRCS += fenv.c
+COMMON_SRCS += fenv.c s_nearbyint.c
 .endif
 .endif
-# End of long list of CPU tests
+# End of list of CPU tests
 
 WARNS?=5
 



CVS commit: src/lib/libm

2017-07-26 Thread Havard Eidnes
Module Name:src
Committed By:   he
Date:   Wed Jul 26 09:42:12 UTC 2017

Modified Files:
src/lib/libm: Makefile

Log Message:
Add some blank lines to separate the different CPU archs,
for a minimal readability improvement.


To generate a diff of this commit:
cvs rdiff -u -r1.191 -r1.192 src/lib/libm/Makefile

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

Modified files:

Index: src/lib/libm/Makefile
diff -u src/lib/libm/Makefile:1.191 src/lib/libm/Makefile:1.192
--- src/lib/libm/Makefile:1.191	Sat May  6 18:03:24 2017
+++ src/lib/libm/Makefile	Wed Jul 26 09:42:12 2017
@@ -1,4 +1,4 @@
-#  $NetBSD: Makefile,v 1.191 2017/05/06 18:03:24 christos Exp $
+#  $NetBSD: Makefile,v 1.192 2017/07/26 09:42:12 he Exp $
 #
 #  @(#)Makefile 5.1beta 93/09/24
 #
@@ -63,10 +63,12 @@ COMMON_SRCS+= fenv.c
 COMMON_SRCS+= e_sqrtl.c
 COMMON_SRCS+= s_fma.c s_fmaf.c s_fmal.c
 .elif (${LIBC_MACHINE_ARCH} == "alpha")
+
 .PATH: ${.CURDIR}/arch/alpha
 ARCH_SRCS = s_copysign.S s_copysignf.S lrint.S
 COMMON_SRCS+= fenv.c
 COPTS+=	-mfloat-ieee -mieee-with-inexact -mfp-trap-mode=sui -mtrap-precision=i
+
 .elif (${LIBC_MACHINE_CPU} == "arm")
 .PATH.c: ${.CURDIR}/arch/arm
 .if ${MKSOFTFLOAT} == "no"
@@ -80,17 +82,21 @@ COMMON_SRCS+= s_fma.c s_fmaf.c s_fmal.c
 .if (${MKSOFTFLOAT} == "no")
 .PATH.S: ${.CURDIR}/arch/arm
 ARCH_SRCS = e_sqrt.S e_sqrtf.S lrint.S lrintf.S s_fabsf.S s_fma.S s_fmaf.S
+
 .endif
 .elif (${LIBC_MACHINE_ARCH} == "ia64")
 .PATH: ${.CURDIR}/arch/ia64
 COMMON_SRCS += fenv.c
+
 .elif (${LIBC_MACHINE_ARCH} == "hppa")
 .PATH.c: ${.CURDIR}/arch/hppa
 COMMON_SRCS+= fenv.c s_nexttowardf.c s_nearbyint.c s_rintl.c
+
 .elif (${LIBC_MACHINE_ARCH} == "sparc")
 .PATH: ${.CURDIR}/arch/sparc
 COMMON_SRCS+= fenv.c
 COMMON_SRCS+= s_fma.c s_fmaf.c s_fmal.c
+
 .elif (${LIBC_MACHINE_ARCH} == "sparc64")
 .PATH: ${.CURDIR}/arch/sparc64
 COMMON_SRCS+= fenv.c
@@ -99,6 +105,7 @@ COMMON_SRCS+= s_nexttowardf.c s_nearbyin
 COMMON_SRCS+= s_nexttoward.c
 .endif
 COMMON_SRCS+= s_fma.c s_fmaf.c s_fmal.c
+
 .elif ((${MACHINE_ARCH} == "i386") || (${MACHINE_ARCH} == "x86_64"))
 
 # XXX consider making this LIBC_MACHINE_ARCH?
@@ -128,6 +135,7 @@ s_${f}.o s_${f}.pico s_${f}.po s_${f}.go
 .if (${MACHINE_ARCH} == "i386")
 SUBDIR=arch/i387
 .endif
+
 .elif (${LIBC_MACHINE_ARCH} == "m68k")
 .if defined(M68060)
 .PATH:	${.CURDIR}/arch/m68060
@@ -150,6 +158,7 @@ COMMON_SRCS += fenv.c
 .endif
 .endif
 # end of m68k
+
 .elif (${LIBC_MACHINE_ARCH} == "vax")
 .PATH:	${.CURDIR}/arch/vax
 
@@ -160,6 +169,7 @@ COMMON_SRCS += fenv.c
 # and emulation code isn't written yet.
 ARCH_SRCS = n_scalbn.S
 WARNS?=5
+
 .elif (${LIBC_MACHINE_CPU} == "riscv")
 .PATH:	${.CURDIR}/arch/riscv
 
@@ -172,22 +182,26 @@ ARCH_SRCS += s_fma.S s_fmaf.S
 ARCH_SRCS += s_fmax.S s_fmaxf.S
 ARCH_SRCS += s_fmin.S s_fminf.S
 .endif
+
 .elif (${LIBC_MACHINE_ARCH} == "powerpc")
 .PATH:	${.CURDIR}/arch/powerpc
 .if ${MKSOFTFLOAT} == "no"
 COMMON_SRCS += fenv.c
 .endif
+
 .elif (${LIBC_MACHINE_CPU} == "mips")
 .PATH:	${.CURDIR}/arch/mips
 .if ${MKSOFTFLOAT} == "no"
 COMMON_SRCS += fenv.c
 .endif
+
 .elif (${LIBC_MACHINE_CPU} == "sh3")
 .PATH:	${.CURDIR}/arch/sh3
 .if ${MKSOFTFLOAT} == "no"
 COMMON_SRCS += fenv.c
 .endif
 .endif
+# End of long list of CPU tests
 
 WARNS?=5
 



CVS commit: src/sys/netipsec

2017-07-26 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Wed Jul 26 09:18:15 UTC 2017

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

Log Message:
Use pslist(9) for sptree


To generate a diff of this commit:
cvs rdiff -u -r1.56 -r1.57 src/sys/netipsec/ipsec.h
cvs rdiff -u -r1.193 -r1.194 src/sys/netipsec/key.c

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

Modified files:

Index: src/sys/netipsec/ipsec.h
diff -u src/sys/netipsec/ipsec.h:1.56 src/sys/netipsec/ipsec.h:1.57
--- src/sys/netipsec/ipsec.h:1.56	Fri Jul 21 04:55:36 2017
+++ src/sys/netipsec/ipsec.h	Wed Jul 26 09:18:15 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: ipsec.h,v 1.56 2017/07/21 04:55:36 ozaki-r Exp $	*/
+/*	$NetBSD: ipsec.h,v 1.57 2017/07/26 09:18:15 ozaki-r Exp $	*/
 /*	$FreeBSD: /usr/local/www/cvsroot/FreeBSD/src/sys/netipsec/ipsec.h,v 1.2.4.2 2004/02/14 22:23:23 bms Exp $	*/
 /*	$KAME: ipsec.h,v 1.53 2001/11/20 08:32:38 itojun Exp $	*/
 
@@ -74,7 +74,7 @@ struct secpolicyindex {
 
 /* Security Policy Data Base */
 struct secpolicy {
-	LIST_ENTRY(secpolicy) chain;
+	struct pslist_entry pslist_entry;
 
 	u_int refcnt;			/* reference count */
 	struct secpolicyindex spidx;	/* selector */

Index: src/sys/netipsec/key.c
diff -u src/sys/netipsec/key.c:1.193 src/sys/netipsec/key.c:1.194
--- src/sys/netipsec/key.c:1.193	Wed Jul 26 03:59:59 2017
+++ src/sys/netipsec/key.c	Wed Jul 26 09:18:15 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: key.c,v 1.193 2017/07/26 03:59:59 ozaki-r Exp $	*/
+/*	$NetBSD: key.c,v 1.194 2017/07/26 09:18:15 ozaki-r Exp $	*/
 /*	$FreeBSD: src/sys/netipsec/key.c,v 1.3.2.3 2004/02/14 22:23:23 bms Exp $	*/
 /*	$KAME: key.c,v 1.191 2001/06/27 10:46:49 sakane Exp $	*/
 
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: key.c,v 1.193 2017/07/26 03:59:59 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: key.c,v 1.194 2017/07/26 09:18:15 ozaki-r Exp $");
 
 /*
  * This code is referd to RFC 2367
@@ -66,6 +66,7 @@ __KERNEL_RCSID(0, "$NetBSD: key.c,v 1.19
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -142,7 +143,7 @@ static int key_prefered_oldsa = 0;	/* pr
 
 static u_int32_t acq_seq = 0;
 
-static LIST_HEAD(_sptree, secpolicy) sptree[IPSEC_DIR_MAX];	/* SPD */
+static struct pslist_head sptree[IPSEC_DIR_MAX];		/* SPD */
 static LIST_HEAD(_sahtree, secashead) sahtree;			/* SAD */
 static LIST_HEAD(_regtree, secreg) regtree[SADB_SATYPE_MAX + 1];
 			/* registed list */
@@ -153,6 +154,46 @@ static LIST_HEAD(_acqtree, secacq) acqtr
 static LIST_HEAD(_spacqtree, secspacq) spacqtree;	/* SP acquiring list */
 #endif
 
+#define SPLIST_ENTRY_INIT(sp)		\
+	PSLIST_ENTRY_INIT((sp), pslist_entry)
+#define SPLIST_ENTRY_DESTROY(sp)	\
+	PSLIST_ENTRY_DESTROY((sp), pslist_entry)
+#define SPLIST_WRITER_REMOVE(sp)	\
+	PSLIST_WRITER_REMOVE((sp), pslist_entry)
+#define SPLIST_READER_EMPTY(dir)	\
+	(PSLIST_READER_FIRST([(dir)], struct secpolicy,		\
+	 pslist_entry) == NULL)
+#define SPLIST_READER_FOREACH(sp, dir)	\
+	PSLIST_READER_FOREACH((sp), [(dir)], struct secpolicy,	\
+	  pslist_entry)
+#define SPLIST_WRITER_FOREACH(sp, dir)	\
+	PSLIST_WRITER_FOREACH((sp), [(dir)], struct secpolicy,	\
+	  pslist_entry)
+#define SPLIST_WRITER_INSERT_AFTER(sp, new)\
+	PSLIST_WRITER_INSERT_AFTER((sp), (new), pslist_entry)
+#define SPLIST_WRITER_EMPTY(dir)	\
+	(PSLIST_WRITER_FIRST([(dir)], struct secpolicy,		\
+	 pslist_entry) == NULL)
+#define SPLIST_WRITER_INSERT_HEAD(dir, sp)\
+	PSLIST_WRITER_INSERT_HEAD([(dir)], (sp), pslist_entry)
+#define SPLIST_WRITER_NEXT(sp)		\
+	PSLIST_WRITER_NEXT((sp), struct secpolicy, pslist_entry)
+#define SPLIST_WRITER_INSERT_TAIL(dir, new)\
+	do {\
+		if (SPLIST_WRITER_EMPTY((dir))) {			\
+			SPLIST_WRITER_INSERT_HEAD((dir), (new));	\
+		} else {		\
+			struct secpolicy *__sp;\
+			SPLIST_WRITER_FOREACH(__sp, (dir)) {		\
+if (SPLIST_WRITER_NEXT(__sp) == NULL) {	\
+	SPLIST_WRITER_INSERT_AFTER(__sp,\
+	(new));			\
+	break;\
+}	\
+			}		\
+		}			\
+	} while (0)
+
 /*
  * Protect regtree, acqtree and items stored in the lists.
  */
@@ -625,8 +666,7 @@ key_sp_unlink(struct secpolicy *sp)
 {
 
 	/* remove from SP index */
-	KASSERT(__LIST_CHAINED(sp));
-	LIST_REMOVE(sp, chain);
+	SPLIST_WRITER_REMOVE(sp);
 	/* Release refcount held just for being on chain */
 	KEY_FREESP();
 }
@@ -641,7 +681,7 @@ int
 key_havesp(u_int dir)
 {
 	return (dir == IPSEC_DIR_INBOUND || dir == IPSEC_DIR_OUTBOUND ?
-		!LIST_EMPTY([dir]) : 1);
+		!SPLIST_READER_EMPTY(dir) : 1);
 }
 
 /* %%% IPsec policy management */
@@ -670,7 +710,7 @@ key_lookup_sp_byspidx(const struct secpo
 		kdebug_secpolicyindex(spidx);
 	}
 
-	LIST_FOREACH(sp, [dir], chain) {
+	SPLIST_READER_FOREACH(sp, dir) {
 		if (KEYDEBUG_ON(KEYDEBUG_IPSEC_DATA)) {
 			printf("*** in SPD\n");
 			kdebug_secpolicyindex(>spidx);
@@ 

CVS commit: src/sys/dev/pci

2017-07-26 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Jul 26 08:57:24 UTC 2017

Modified Files:
src/sys/dev/pci: pcidevs

Log Message:
Add Intel 5520/X58 QuickPath from OpenBSD.


To generate a diff of this commit:
cvs rdiff -u -r1.1294 -r1.1295 src/sys/dev/pci/pcidevs

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/pcidevs
diff -u src/sys/dev/pci/pcidevs:1.1294 src/sys/dev/pci/pcidevs:1.1295
--- src/sys/dev/pci/pcidevs:1.1294	Sat Jul 22 08:58:24 2017
+++ src/sys/dev/pci/pcidevs	Wed Jul 26 08:57:24 2017
@@ -1,4 +1,4 @@
-$NetBSD: pcidevs,v 1.1294 2017/07/22 08:58:24 msaitoh Exp $
+$NetBSD: pcidevs,v 1.1295 2017/07/26 08:57:24 msaitoh Exp $
 
 /*
  * Copyright (c) 1995, 1996 Christopher G. Demetriou
@@ -3972,6 +3972,8 @@ product INTEL 82X58_PCIE_7	0x340e	5520/5
 product INTEL 82X58_PCIE_8	0x340f	5520/5500/X58 PCIE Root Port 8
 product INTEL 82X58_PCIE_9	0x3410	5520/5500/X58 PCIE Root Port 9
 product INTEL 82X58_PCIE_10	0x3411	5520/5500/X58 PCIE Root Port 10
+product INTEL 82X58_QP0_PHY	0x3418	5520/X58 QuickPath
+product INTEL 5520_QP1_PHY	0x3419	5520 QuickPath
 product INTEL 82X58_PCIE_0_0	0x3420	5520/5500/X58 PCIE Root Port 0
 product INTEL 82X58_PCIE_0_1	0x3421	5520/5500/X58 PCIE Root Port 0
 product INTEL 82X58_GPIO	0x3422	5520/5500/X58 Scratchpads and GPIO



CVS commit: src/sys/dev/pci

2017-07-26 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Jul 26 08:09:59 UTC 2017

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

Log Message:
 On 8254[17] with SPI ROM, wm_nvm_set_addrbits_size_eecd() calls wm_nvm_read(),
so it's required to set flags and functions before calling it. It was broken
again in if_wm.c rev. 1.530 (see also 1.313). Tested with Dell Power Edge 1850.


To generate a diff of this commit:
cvs rdiff -u -r1.531 -r1.532 src/sys/dev/pci/if_wm.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_wm.c
diff -u src/sys/dev/pci/if_wm.c:1.531 src/sys/dev/pci/if_wm.c:1.532
--- src/sys/dev/pci/if_wm.c:1.531	Wed Jul 26 06:48:49 2017
+++ src/sys/dev/pci/if_wm.c	Wed Jul 26 08:09:59 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wm.c,v 1.531 2017/07/26 06:48:49 msaitoh Exp $	*/
+/*	$NetBSD: if_wm.c,v 1.532 2017/07/26 08:09:59 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -83,7 +83,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.531 2017/07/26 06:48:49 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.532 2017/07/26 08:09:59 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -2078,6 +2078,13 @@ alloc_retry:
 	case WM_T_82547:
 	case WM_T_82547_2:
 		reg = CSR_READ(sc, WMREG_EECD);
+		/*
+		 * wm_nvm_set_addrbits_size_eecd() accesses SPI in it only
+		 * on 8254[17], so set flags and functios before calling it.
+		 */
+		sc->sc_flags |= WM_F_LOCK_EECD;
+		sc->nvm.acquire = wm_get_eecd;
+		sc->nvm.release = wm_put_eecd;
 		if (reg & EECD_EE_TYPE) {
 			/* SPI */
 			sc->nvm.read = wm_nvm_read_spi;
@@ -2094,9 +2101,6 @@ alloc_retry:
 sc->sc_nvm_addrbits = 6;
 			}
 		}
-		sc->sc_flags |= WM_F_LOCK_EECD;
-		sc->nvm.acquire = wm_get_eecd;
-		sc->nvm.release = wm_put_eecd;
 		break;
 	case WM_T_82571:
 	case WM_T_82572:



CVS commit: src/sys/dev/usb

2017-07-26 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Wed Jul 26 07:45:05 UTC 2017

Modified Files:
src/sys/dev/usb: uaudio.c

Log Message:
uaudio: don't block suspend.

audio after resume hasn't been fully tested due to other issues, but
the problem machine resumes. tested by Ricardo Mottola


To generate a diff of this commit:
cvs rdiff -u -r1.154 -r1.155 src/sys/dev/usb/uaudio.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/uaudio.c
diff -u src/sys/dev/usb/uaudio.c:1.154 src/sys/dev/usb/uaudio.c:1.155
--- src/sys/dev/usb/uaudio.c:1.154	Fri Jun  9 10:11:20 2017
+++ src/sys/dev/usb/uaudio.c	Wed Jul 26 07:45:05 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: uaudio.c,v 1.154 2017/06/09 10:11:20 nat Exp $	*/
+/*	$NetBSD: uaudio.c,v 1.155 2017/07/26 07:45:05 maya Exp $	*/
 
 /*
  * Copyright (c) 1999, 2012 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uaudio.c,v 1.154 2017/06/09 10:11:20 nat Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uaudio.c,v 1.155 2017/07/26 07:45:05 maya Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -504,6 +504,9 @@ uaudio_attach(device_t parent, device_t 
 	DPRINTF("%s", "doing audio_attach_mi\n");
 	sc->sc_audiodev = audio_attach_mi(_hw_if, sc, sc->sc_dev);
 
+	if (!pmf_device_register(self, NULL, NULL))
+		aprint_error_dev(self, "couldn't establish power handler\n");
+
 	return;
 }
 
@@ -534,9 +537,10 @@ int
 uaudio_detach(device_t self, int flags)
 {
 	struct uaudio_softc *sc = device_private(self);
-	int rv;
+	int rv = 0;
+
+	pmf_device_deregister(self);
 
-	rv = 0;
 	/* Wait for outstanding requests to complete. */
 	usbd_delay_ms(sc->sc_udev, UAUDIO_NCHANBUFS * UAUDIO_NFRAMES);
 



CVS commit: [netbsd-8] src/doc

2017-07-26 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Jul 26 07:40:01 UTC 2017

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

Log Message:
Tickets #158 - #161


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

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

Modified files:

Index: src/doc/CHANGES-8.0
diff -u src/doc/CHANGES-8.0:1.1.2.32 src/doc/CHANGES-8.0:1.1.2.33
--- src/doc/CHANGES-8.0:1.1.2.32	Tue Jul 25 02:23:33 2017
+++ src/doc/CHANGES-8.0	Wed Jul 26 07:40:01 2017
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-8.0,v 1.1.2.32 2017/07/25 02:23:33 snj Exp $
+# $NetBSD: CHANGES-8.0,v 1.1.2.33 2017/07/26 07:40:01 martin Exp $
 
 A complete list of changes from the initial NetBSD 8.0 branch on 2017-06-04
 until the 8.0 release:
@@ -4810,3 +4810,28 @@ lib/libc/compiler_rt/Makefile.inc		1.35
 	Do not use IEEE 754 specific functions for VAX
 	[martin, ticket #157]
 
+sys/kern/sched_4bsd.c1.31-1.33
+
+	Fix the load factor calculation.
+	[maxv, ticket #158]
+
+sys/arch/arm/sunxi/files.sunxi			1.14
+sys/arch/arm/sunxi/sunxi_wdt.c			1.1
+sys/arch/evbarm/conf/SUNXI			1.18
+
+	Add watchdog timer support.
+	[jmcneill, ticket #159]
+
+sys/arch/dreamcast/conf/G1IDE			1.2
+sys/arch/dreamcast/conf/GENERIC			1.126
+sys/arch/dreamcast/dev/g2/aica.c		1.23
+
+	Dreamcast audio only supports playback so set it in the props.
+	Use the correct attachment for dreamcast audio.
+	[nat, ticket #160]
+
+sys/rump/librump/rumpkern/Makefile.rumpkern	1.170
+
+	Add localcount to rump kernels
+	[ozaki-r, ticket #161]
+



CVS commit: src/sys/netipsec

2017-07-26 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Wed Jul 26 07:39:54 UTC 2017

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

Log Message:
Fix indentation

Pointed out by knakahara@


To generate a diff of this commit:
cvs rdiff -u -r1.111 -r1.112 src/sys/netipsec/ipsec.c

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

Modified files:

Index: src/sys/netipsec/ipsec.c
diff -u src/sys/netipsec/ipsec.c:1.111 src/sys/netipsec/ipsec.c:1.112
--- src/sys/netipsec/ipsec.c:1.111	Wed Jul 26 03:59:59 2017
+++ src/sys/netipsec/ipsec.c	Wed Jul 26 07:39:54 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: ipsec.c,v 1.111 2017/07/26 03:59:59 ozaki-r Exp $	*/
+/*	$NetBSD: ipsec.c,v 1.112 2017/07/26 07:39:54 ozaki-r Exp $	*/
 /*	$FreeBSD: /usr/local/www/cvsroot/FreeBSD/src/sys/netipsec/ipsec.c,v 1.2.2.2 2003/07/01 01:38:13 sam Exp $	*/
 /*	$KAME: ipsec.c,v 1.103 2001/05/24 07:14:18 sakane Exp $	*/
 
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ipsec.c,v 1.111 2017/07/26 03:59:59 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ipsec.c,v 1.112 2017/07/26 07:39:54 ozaki-r Exp $");
 
 /*
  * IPsec controller part.
@@ -700,8 +700,8 @@ ipsec4_output(struct mbuf *m, struct inp
 		KEY_FREESP();
 		splx(s);
 		return 0;
-}
 	}
+}
 	/*
 	 * Preserve KAME behaviour: ENOENT can be returned
 	 * when an SA acquire is in progress.  Don't propagate



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

2017-07-26 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Jul 26 07:34:37 UTC 2017

Modified Files:
src/sys/arch/dreamcast/conf [netbsd-8]: G1IDE GENERIC
src/sys/arch/dreamcast/dev/g2 [netbsd-8]: aica.c

Log Message:
Pull up following revision(s) (requested by nat in ticket #160):
sys/arch/dreamcast/conf/G1IDE: revision 1.2
sys/arch/dreamcast/conf/GENERIC: revision 1.126
sys/arch/dreamcast/dev/g2/aica.c: revision 1.23
Dreamcast audio only supports playback so set it in the props.
This makes dreamcast audio work again.
Tested by Bjorn Johannesson.
cvs: --
Use the correct attachment for dreamcast audio.
Found and tested by Bjorn Johannesson on port-dreamcast.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.1.12.1 src/sys/arch/dreamcast/conf/G1IDE
cvs rdiff -u -r1.125 -r1.125.8.1 src/sys/arch/dreamcast/conf/GENERIC
cvs rdiff -u -r1.22 -r1.22.42.1 src/sys/arch/dreamcast/dev/g2/aica.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/dreamcast/conf/G1IDE
diff -u src/sys/arch/dreamcast/conf/G1IDE:1.1 src/sys/arch/dreamcast/conf/G1IDE:1.1.12.1
--- src/sys/arch/dreamcast/conf/G1IDE:1.1	Thu Dec 29 11:49:05 2016
+++ src/sys/arch/dreamcast/conf/G1IDE	Wed Jul 26 07:34:37 2017
@@ -1,4 +1,4 @@
-# $NetBSD: G1IDE,v 1.1 2016/12/29 11:49:05 tsutsui Exp $
+# $NetBSD: G1IDE,v 1.1.12.1 2017/07/26 07:34:37 martin Exp $
 
 include 	"arch/dreamcast/conf/std.dreamcast"
 
@@ -190,7 +190,7 @@ rlphy*		at mii? phy ?
 mbe*		at g2bus?			# SEGA LAN Adapter
 
 #aica*		at g2bus?			# AICA Sound Processing Unit
-#audio*		at aica?
+#audio*		at audiobus?
 
 #spkr*		at audio?		# PC speaker (synthesized)
 

Index: src/sys/arch/dreamcast/conf/GENERIC
diff -u src/sys/arch/dreamcast/conf/GENERIC:1.125 src/sys/arch/dreamcast/conf/GENERIC:1.125.8.1
--- src/sys/arch/dreamcast/conf/GENERIC:1.125	Tue Dec 13 20:42:17 2016
+++ src/sys/arch/dreamcast/conf/GENERIC	Wed Jul 26 07:34:37 2017
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.125 2016/12/13 20:42:17 christos Exp $
+# $NetBSD: GENERIC,v 1.125.8.1 2017/07/26 07:34:37 martin Exp $
 #
 # GENERIC machine description file
 # 
@@ -191,7 +191,7 @@ rlphy*		at mii? phy ?
 mbe*		at g2bus?			# SEGA LAN Adapter
 
 aica*		at g2bus?			# AICA Sound Processing Unit
-audio*		at aica?
+audio*		at audiobus?
 
 spkr*		at audio?		# PC speaker (synthesized)
 

Index: src/sys/arch/dreamcast/dev/g2/aica.c
diff -u src/sys/arch/dreamcast/dev/g2/aica.c:1.22 src/sys/arch/dreamcast/dev/g2/aica.c:1.22.42.1
--- src/sys/arch/dreamcast/dev/g2/aica.c:1.22	Wed Nov 23 23:07:29 2011
+++ src/sys/arch/dreamcast/dev/g2/aica.c	Wed Jul 26 07:34:37 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: aica.c,v 1.22 2011/11/23 23:07:29 jmcneill Exp $	*/
+/*	$NetBSD: aica.c,v 1.22.42.1 2017/07/26 07:34:37 martin Exp $	*/
 
 /*
  * Copyright (c) 2003 SHIMIZU Ryo 
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: aica.c,v 1.22 2011/11/23 23:07:29 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: aica.c,v 1.22.42.1 2017/07/26 07:34:37 martin Exp $");
 
 #include 
 #include 
@@ -774,7 +774,7 @@ int
 aica_get_props(void *addr)
 {
 
-	return 0;
+	return AUDIO_PROP_PLAYBACK;
 }
 
 void



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

2017-07-26 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Jul 26 07:32:07 UTC 2017

Modified Files:
src/sys/arch/arm/sunxi [netbsd-8]: files.sunxi
src/sys/arch/evbarm/conf [netbsd-8]: SUNXI
Added Files:
src/sys/arch/arm/sunxi [netbsd-8]: sunxi_wdt.c

Log Message:
Pull up following revision(s) (requested by jmcneill in ticket #159):
sys/arch/evbarm/conf/SUNXI: revision 1.18
sys/arch/arm/sunxi/sunxi_wdt.c: revision 1.1
sys/arch/arm/sunxi/files.sunxi: revision 1.14
Add watchdog timer support.


To generate a diff of this commit:
cvs rdiff -u -r1.12.4.3 -r1.12.4.4 src/sys/arch/arm/sunxi/files.sunxi
cvs rdiff -u -r0 -r1.1.2.2 src/sys/arch/arm/sunxi/sunxi_wdt.c
cvs rdiff -u -r1.17.4.3 -r1.17.4.4 src/sys/arch/evbarm/conf/SUNXI

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

Modified files:

Index: src/sys/arch/arm/sunxi/files.sunxi
diff -u src/sys/arch/arm/sunxi/files.sunxi:1.12.4.3 src/sys/arch/arm/sunxi/files.sunxi:1.12.4.4
--- src/sys/arch/arm/sunxi/files.sunxi:1.12.4.3	Tue Jul 25 02:03:16 2017
+++ src/sys/arch/arm/sunxi/files.sunxi	Wed Jul 26 07:32:06 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: files.sunxi,v 1.12.4.3 2017/07/25 02:03:16 snj Exp $
+#	$NetBSD: files.sunxi,v 1.12.4.4 2017/07/26 07:32:06 martin Exp $
 #
 # Configuration info for Allwinner sunxi family SoCs
 #
@@ -102,6 +102,11 @@ device	sunxiemac: arp, ether, ifnet, mii
 attach	sunxiemac at fdt with sunxi_emac
 file	arch/arm/sunxi/sunxi_emac.c		sunxi_emac
 
+# Watchdog
+device	sunxiwdt: sysmon_wdog
+attach	sunxiwdt at fdt with sunxi_wdt
+file	arch/arm/sunxi/sunxi_wdt.c		sunxi_wdt
+
 # SOC parameters
 defflag	opt_soc.h			SOC_SUNXI
 defflag	opt_soc.h			SOC_SUN8I: SOC_SUNXI

Index: src/sys/arch/evbarm/conf/SUNXI
diff -u src/sys/arch/evbarm/conf/SUNXI:1.17.4.3 src/sys/arch/evbarm/conf/SUNXI:1.17.4.4
--- src/sys/arch/evbarm/conf/SUNXI:1.17.4.3	Tue Jul 25 01:35:53 2017
+++ src/sys/arch/evbarm/conf/SUNXI	Wed Jul 26 07:32:06 2017
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: SUNXI,v 1.17.4.3 2017/07/25 01:35:53 snj Exp $
+#	$NetBSD: SUNXI,v 1.17.4.4 2017/07/26 07:32:06 martin Exp $
 #
 #	Allwinner sunxi family
 #
@@ -79,6 +79,9 @@ gpioleds*	at fdt?
 gtmr*		at fdt? pass 1		# ARM Generic Timer
 armgtmr0	at gtmr?
 
+# Watchdog
+sunxiwdt*	at fdt?			# Allwinner watchdog
+
 # Interrupt controller
 gic*		at fdt? pass 1		# GIC
 armgic0		at gic?

Added files:

Index: src/sys/arch/arm/sunxi/sunxi_wdt.c
diff -u /dev/null src/sys/arch/arm/sunxi/sunxi_wdt.c:1.1.2.2
--- /dev/null	Wed Jul 26 07:32:07 2017
+++ src/sys/arch/arm/sunxi/sunxi_wdt.c	Wed Jul 26 07:32:06 2017
@@ -0,0 +1,199 @@
+/* $NetBSD: sunxi_wdt.c,v 1.1.2.2 2017/07/26 07:32:06 martin Exp $ */
+
+/*-
+ * Copyright (c) 2017 Jared McNeill 
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR 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.
+ */
+
+#include 
+__KERNEL_RCSID(0, "$NetBSD: sunxi_wdt.c,v 1.1.2.2 2017/07/26 07:32:06 martin Exp $");
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+#include 
+
+#define	SUNXI_WDT_PERIOD_DEFAULT	16
+
+#define	WDT_IRQ_EN_REG		0x00
+#define	 WDT_IRQ_EN_EN		__BIT(0)
+#define	WDT_IRQ_STA_REG		0x04
+#define	 WDT_IRQ_STA_PEND	__BIT(0)
+#define	WDT_CTRL_REG		0x10
+#define	 WDT_CTRL_KEY_FIELD	__BITS(12,1)
+#define	  WDT_CTRL_KEY_FIELD_V	0xa57
+#define	 WDT_CTRL_RSTART	__BIT(0)
+#define	WDT_CFG_REG		0x14
+#define	 WDT_CFG_CONFIG		__BITS(1,0)
+#define	  WDT_CFG_CONFIG_SYS	1
+#define	  WDT_CFG_CONFIG_IRQ	2
+#define	WDT_MODE_REG		0x18
+#define	 WDT_MODE_INTV		__BITS(7,4)
+#define	 WDT_MODE_EN		__BIT(0)
+
+static const int sun6i_periods[] = {
+	500, 1000, 2000, 3000,
+	4000, 5000, 6000, 8000,
+	1, 12000, 14000, 16000,
+	-1
+};
+
+static const 

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

2017-07-26 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Jul 26 07:29:34 UTC 2017

Modified Files:
src/sys/kern [netbsd-8]: sched_4bsd.c

Log Message:
Pull up following revision(s) (requested by maxv in ticket #158):
sys/kern/sched_4bsd.c: revision 1.31-1.33

explain a bit
-
Revert rev1.26. l_estcpu is increased by only one cpu, not all of them.
-
Should be loadfactor().


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.30.20.1 src/sys/kern/sched_4bsd.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/sched_4bsd.c
diff -u src/sys/kern/sched_4bsd.c:1.30 src/sys/kern/sched_4bsd.c:1.30.20.1
--- src/sys/kern/sched_4bsd.c:1.30	Tue Jun 24 10:08:45 2014
+++ src/sys/kern/sched_4bsd.c	Wed Jul 26 07:29:34 2017
@@ -1,6 +1,6 @@
-/*	$NetBSD: sched_4bsd.c,v 1.30 2014/06/24 10:08:45 maxv Exp $	*/
+/*	$NetBSD: sched_4bsd.c,v 1.30.20.1 2017/07/26 07:29:34 martin Exp $	*/
 
-/*-
+/*
  * Copyright (c) 1999, 2000, 2004, 2006, 2007, 2008 The NetBSD Foundation, Inc.
  * All rights reserved.
  *
@@ -31,7 +31,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
-/*-
+/*
  * Copyright (c) 1982, 1986, 1990, 1991, 1993
  *	The Regents of the University of California.  All rights reserved.
  * (c) UNIX System Laboratories, Inc.
@@ -68,7 +68,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sched_4bsd.c,v 1.30 2014/06/24 10:08:45 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sched_4bsd.c,v 1.30.20.1 2017/07/26 07:29:34 martin Exp $");
 
 #include "opt_ddb.h"
 #include "opt_lockdebug.h"
@@ -80,13 +80,10 @@ __KERNEL_RCSID(0, "$NetBSD: sched_4bsd.c
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
-#include 
 #include 
-#include 
 #include 
 
 static void updatepri(struct lwp *);
@@ -95,7 +92,7 @@ static void resetpriority(struct lwp *);
 extern unsigned int sched_pstats_ticks; /* defined in kern_synch.c */
 
 /* Number of hardclock ticks per sched_tick() */
-static int rrticks;
+static int rrticks __read_mostly;
 
 /*
  * Force switch among equal priority processes every 100ms.
@@ -133,7 +130,7 @@ sched_tick(struct cpu_info *ci)
 		if (spc->spc_flags & SPCF_SHOULDYIELD) {
 			/*
 			 * Process is stuck in kernel somewhere, probably
-			 * due to buggy or inefficient code.  Force a 
+			 * due to buggy or inefficient code.  Force a
 			 * kernel preemption.
 			 */
 			cpu_need_resched(ci, RESCHED_KPREEMPT);
@@ -170,71 +167,90 @@ sched_tick(struct cpu_info *ci)
 #define	ESTCPULIM(e)	min((e), ESTCPU_MAX)
 
 /*
- * Constants for digital decay and forget:
- *	90% of (l_estcpu) usage in 5 * loadav time
- *	95% of (l_pctcpu) usage in 60 seconds (load insensitive)
- *  Note that, as ps(1) mentions, this can let percentages
- *  total over 100% (I've seen 137.9% for 3 processes).
+ * The main parameter used by this algorithm is 'l_estcpu'. It is an estimate
+ * of the recent CPU utilization of the thread.
+ *
+ * l_estcpu is:
+ *  - increased each time the hardclock ticks and the thread is found to
+ *be executing, in sched_schedclock() called from hardclock()
+ *  - decreased (filtered) on each sched tick, in sched_pstats_hook()
+ * If the lwp is sleeping for more than a second, we don't touch l_estcpu: it
+ * will be updated in sched_setrunnable() when the lwp wakes up, in burst mode
+ * (ie, we decrease it n times).
  *
  * Note that hardclock updates l_estcpu and l_cpticks independently.
  *
- * We wish to decay away 90% of l_estcpu in (5 * loadavg) seconds.
- * That is, the system wants to compute a value of decay such
- * that the following for loop:
- * 	for (i = 0; i < (5 * loadavg); i++)
- * 		l_estcpu *= decay;
- * will compute
- * 	l_estcpu *= 0.1;
- * for all values of loadavg:
+ * -
+ *
+ * Here we describe how l_estcpu is decreased.
+ *
+ * Constants for digital decay (filter):
+ * 90% of l_estcpu usage in (5 * loadavg) seconds
+ *
+ * We wish to decay away 90% of l_estcpu in (5 * loadavg) seconds. That is, we
+ * want to compute a value of decay such that the following loop:
+ * for (i = 0; i < (5 * loadavg); i++)
+ * l_estcpu *= decay;
+ * will result in
+ * l_estcpu *= 0.1;
+ * for all values of loadavg.
  *
  * Mathematically this loop can be expressed by saying:
- * 	decay ** (5 * loadavg) ~= .1
+ * decay ** (5 * loadavg) ~= .1
+ *
+ * And finally, the corresponding value of decay we're using is:
+ * decay = (2 * loadavg) / (2 * loadavg + 1)
  *
- * The system computes decay as:
- * 	decay = (2 * loadavg) / (2 * loadavg + 1)
+ * -
  *
- * We wish to prove that the system's computation of decay
- * will always fulfill the equation:
- * 	decay ** (5 * loadavg) ~= .1
+ * Now, let's prove that the value of decay stated above will always fulfill
+ * the equation:
+ * decay ** (5 * 

CVS commit: src/sys/dev/pci

2017-07-26 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Jul 26 06:48:49 UTC 2017

Modified Files:
src/sys/dev/pci: if_wm.c if_wmreg.h if_wmvar.h

Log Message:
-  Our MII readreg/writereg API has not way to detect an error.
  kmrn_{read,write}reg() are not used for MII API, so it's not required for
  these functions to use the same API. So,
  - Change return value as error code.
  - Change register vaule from int to uint16_t.
  - read: pass pointer for uint16_t as an argument.
  - Check return value on caller side.
- Check whether it's required to use MDIC workaround for 80003 or not in
  wm_reset(). If the workaround isn't required, don't use the workaround code
  in wm_gmii_i80003_{read,write}reg.


To generate a diff of this commit:
cvs rdiff -u -r1.530 -r1.531 src/sys/dev/pci/if_wm.c
cvs rdiff -u -r1.102 -r1.103 src/sys/dev/pci/if_wmreg.h
cvs rdiff -u -r1.35 -r1.36 src/sys/dev/pci/if_wmvar.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/pci/if_wm.c
diff -u src/sys/dev/pci/if_wm.c:1.530 src/sys/dev/pci/if_wm.c:1.531
--- src/sys/dev/pci/if_wm.c:1.530	Tue Jul 25 06:00:17 2017
+++ src/sys/dev/pci/if_wm.c	Wed Jul 26 06:48:49 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wm.c,v 1.530 2017/07/25 06:00:17 msaitoh Exp $	*/
+/*	$NetBSD: if_wm.c,v 1.531 2017/07/26 06:48:49 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -83,7 +83,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.530 2017/07/25 06:00:17 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.531 2017/07/26 06:48:49 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -809,10 +809,10 @@ static void	wm_gmii_statchg(struct ifnet
  * These functions are not for accessing MII registers but for accessing
  * kumeran specific registers.
  */
-static int	wm_kmrn_readreg(struct wm_softc *, int);
-static int	wm_kmrn_readreg_locked(struct wm_softc *, int);
-static void	wm_kmrn_writereg(struct wm_softc *, int, int);
-static void	wm_kmrn_writereg_locked(struct wm_softc *, int, int);
+static int	wm_kmrn_readreg(struct wm_softc *, int, uint16_t *);
+static int	wm_kmrn_readreg_locked(struct wm_softc *, int, uint16_t *);
+static int	wm_kmrn_writereg(struct wm_softc *, int, uint16_t);
+static int	wm_kmrn_writereg_locked(struct wm_softc *, int, uint16_t);
 /* SGMII */
 static bool	wm_sgmii_uses_mdio(struct wm_softc *);
 static int	wm_sgmii_readreg(device_t, int, int);
@@ -4247,6 +4247,8 @@ wm_reset(struct wm_softc *sc)
 	int phy_reset = 0;
 	int i, error = 0;
 	uint32_t reg;
+	uint16_t kmreg;
+	int rv;
 
 	DPRINTF(WM_DEBUG_INIT, ("%s: %s called\n",
 		device_xname(sc->sc_dev), __func__));
@@ -4641,6 +4643,21 @@ wm_reset(struct wm_softc *sc)
 
 	if ((sc->sc_flags & WM_F_PLL_WA_I210) != 0)
 		wm_pll_workaround_i210(sc);
+
+	if (sc->sc_type == WM_T_80003) {
+		/* default to TRUE to enable the MDIC W/A */
+		sc->sc_flags |= WM_F_80003_MDIC_WA;
+	
+		rv = wm_kmrn_readreg(sc,
+		KUMCTRLSTA_OFFSET >> KUMCTRLSTA_OFFSET_SHIFT, );
+		if (rv == 0) {
+			if ((kmreg & KUMCTRLSTA_OPMODE_MASK)
+			== KUMCTRLSTA_OPMODE_INBAND_MDIO)
+sc->sc_flags &= ~WM_F_80003_MDIC_WA;
+			else
+sc->sc_flags |= WM_F_80003_MDIC_WA;
+		}
+	}
 }
 
 /*
@@ -5414,7 +5431,7 @@ wm_init_locked(struct ifnet *ifp)
 	wm_set_vlan(sc);
 
 	if (sc->sc_flags & WM_F_HAS_MII) {
-		int val;
+		uint16_t kmreg;
 
 		switch (sc->sc_type) {
 		case WM_T_80003:
@@ -5433,19 +5450,20 @@ wm_init_locked(struct ifnet *ifp)
 			 */
 			wm_kmrn_writereg(sc, KUMCTRLSTA_OFFSET_TIMEOUTS,
 			0x);
-			val = wm_kmrn_readreg(sc, KUMCTRLSTA_OFFSET_INB_PARAM);
-			val |= 0x3F;
-			wm_kmrn_writereg(sc,
-			KUMCTRLSTA_OFFSET_INB_PARAM, val);
+			wm_kmrn_readreg(sc, KUMCTRLSTA_OFFSET_INB_PARAM,
+			);
+			kmreg |= 0x3F;
+			wm_kmrn_writereg(sc, KUMCTRLSTA_OFFSET_INB_PARAM,
+			kmreg);
 			break;
 		default:
 			break;
 		}
 
 		if (sc->sc_type == WM_T_80003) {
-			val = CSR_READ(sc, WMREG_CTRL_EXT);
-			val &= ~CTRL_EXT_LINK_MODE_MASK;
-			CSR_WRITE(sc, WMREG_CTRL_EXT, val);
+			reg = CSR_READ(sc, WMREG_CTRL_EXT);
+			reg &= ~CTRL_EXT_LINK_MODE_MASK;
+			CSR_WRITE(sc, WMREG_CTRL_EXT, reg);
 
 			/* Bypass RX and TX FIFO's */
 			wm_kmrn_writereg(sc, KUMCTRLSTA_OFFSET_FIFO_CTRL,
@@ -9953,6 +9971,7 @@ static int
 wm_gmii_i80003_readreg(device_t dev, int phy, int reg)
 {
 	struct wm_softc *sc = device_private(dev);
+	int page_select, temp;
 	int rv;
 
 	if (phy != 1) /* only one PHY on kumeran bus */
@@ -9963,19 +9982,35 @@ wm_gmii_i80003_readreg(device_t dev, int
 		return 0;
 	}
 
-	if ((reg & MII_ADDRMASK) < GG82563_MIN_ALT_REG) {
-		wm_gmii_mdic_writereg(dev, phy, GG82563_PHY_PAGE_SELECT,
-		reg >> GG82563_PAGE_SHIFT);
-	} else {
-		wm_gmii_mdic_writereg(dev, phy, GG82563_PHY_PAGE_SELECT_ALT,
-		reg >> GG82563_PAGE_SHIFT);
+	if ((reg & MII_ADDRMASK) < GG82563_MIN_ALT_REG)
+		page_select = GG82563_PHY_PAGE_SELECT;
+	

CVS commit: src/sys/opencrypto

2017-07-26 Thread Kengo NAKAHARA
Module Name:src
Committed By:   knakahara
Date:   Wed Jul 26 06:44:50 UTC 2017

Modified Files:
src/sys/opencrypto: cryptodev.h

Log Message:
update locking notes of opencrypto(9)


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/sys/opencrypto/cryptodev.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/opencrypto/cryptodev.h
diff -u src/sys/opencrypto/cryptodev.h:1.38 src/sys/opencrypto/cryptodev.h:1.39
--- src/sys/opencrypto/cryptodev.h:1.38	Tue Jul 18 06:01:36 2017
+++ src/sys/opencrypto/cryptodev.h	Wed Jul 26 06:44:50 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: cryptodev.h,v 1.38 2017/07/18 06:01:36 knakahara Exp $ */
+/*	$NetBSD: cryptodev.h,v 1.39 2017/07/26 06:44:50 knakahara Exp $ */
 /*	$FreeBSD: src/sys/opencrypto/cryptodev.h,v 1.2.2.6 2003/07/02 17:04:50 sam Exp $	*/
 /*	$OpenBSD: cryptodev.h,v 1.33 2002/07/17 23:52:39 art Exp $	*/
 
@@ -670,12 +670,17 @@ extern int	cuio_getptr(struct uio *, int
  * + crypto_drivers[i] and its all members are protected by
  *   crypto_drivers[i].cc_lock (a spin lock)
  *   spin lock as crypto_unblock() can be called in interrupt context
- * + crp_q and crp_kq are procted by crypto_q_mtx (an adaptive lock)
- * + crp_ret_q, crp_ret_kq and crypto_exit_flag are protected by
- *   crypto_ret_q_mtx (a spin lock)
+ * + percpu'ed crp_q and crp_kq are procted by splsoftnet.
+ * + crp_ret_q, crp_ret_kq and crypto_exit_flag that are members of
+ *   struct crypto_crp_ret_qs are protected by crypto_crp_ret_qs.crp_ret_q_mtx
+ *   (a spin lock)
  *   spin lock as crypto_done() can be called in interrupt context
+ *   NOTE:
+ *   It is not known whether crypto_done()(in interrupt context) is called
+ *   in the same CPU as crypto_dispatch() is called.
+ *   So, struct crypto_crp_ret_qs cannot be percpu(9).
  *
  * Locking order:
- * - crypto_q_mtx => crypto_drv_mtx => crypto_drivers[i].cc_lock
+ * - crypto_drv_mtx => crypto_drivers[i].cc_lock
  */
 #endif /* _CRYPTO_CRYPTO_H_ */



CVS commit: src/sys/opencrypto

2017-07-26 Thread Kengo NAKAHARA
Module Name:src
Committed By:   knakahara
Date:   Wed Jul 26 06:44:01 UTC 2017

Modified Files:
src/sys/opencrypto: crypto.c

Log Message:
divide crp_ret_{,k}q by CPU to avoid reordering.

update locking note later.


To generate a diff of this commit:
cvs rdiff -u -r1.95 -r1.96 src/sys/opencrypto/crypto.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/opencrypto/crypto.c
diff -u src/sys/opencrypto/crypto.c:1.95 src/sys/opencrypto/crypto.c:1.96
--- src/sys/opencrypto/crypto.c:1.95	Wed Jul 26 06:40:42 2017
+++ src/sys/opencrypto/crypto.c	Wed Jul 26 06:44:01 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: crypto.c,v 1.95 2017/07/26 06:40:42 knakahara Exp $ */
+/*	$NetBSD: crypto.c,v 1.96 2017/07/26 06:44:01 knakahara Exp $ */
 /*	$FreeBSD: src/sys/opencrypto/crypto.c,v 1.4.2.5 2003/02/26 00:14:05 sam Exp $	*/
 /*	$OpenBSD: crypto.c,v 1.41 2002/07/17 23:52:38 art Exp $	*/
 
@@ -53,7 +53,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: crypto.c,v 1.95 2017/07/26 06:40:42 knakahara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: crypto.c,v 1.96 2017/07/26 06:44:01 knakahara Exp $");
 
 #include 
 #include 
@@ -69,7 +69,9 @@ __KERNEL_RCSID(0, "$NetBSD: crypto.c,v 1
 #include 
 #include 
 #include 
+#include 
 #include 
+#include 
 
 #if defined(_KERNEL_OPT)
 #include "opt_ocf.h"
@@ -78,8 +80,6 @@ __KERNEL_RCSID(0, "$NetBSD: crypto.c,v 1
 #include 
 #include 			/* XXX for M_XDATA */
 
-static kmutex_t crypto_ret_q_mtx;
-
 /* below are kludges for residual code wrtitten to FreeBSD interfaces */
   #define SWI_CRYPTO 17
   #define register_swi(lvl, fn)  \
@@ -104,7 +104,6 @@ static kmutex_t crypto_drv_mtx;
 static	struct cryptocap *crypto_drivers;
 static	int crypto_drivers_num;
 static	void *softintr_cookie;
-static	int crypto_exit_flag;
 
 static	void *crypto_ret_si;
 
@@ -166,50 +165,51 @@ crypto_crp_qs_init_pc(void *p, void *arg
  * but have two to avoid type futzing (cryptop vs. cryptkop).  See below
  * for how synchronization is handled.
  */
-static	TAILQ_HEAD(crprethead, cryptop) crp_ret_q =	/* callback queues */
-		TAILQ_HEAD_INITIALIZER(crp_ret_q);
-static	TAILQ_HEAD(krprethead, cryptkop) crp_ret_kq =
-		TAILQ_HEAD_INITIALIZER(crp_ret_kq);
-
-#define DEFINIT_CRYPTO_Q_LEN(name)		\
-	static int crypto_##name##_len = 0
-
-#define DEFINIT_CRYPTO_Q_DROPS(name)		\
-	static int crypto_##name##_drops = 0
+TAILQ_HEAD(crypto_crp_ret_q, cryptop);
+TAILQ_HEAD(crypto_crp_ret_kq, cryptkop);
+struct crypto_crp_ret_qs {
+	kmutex_t crp_ret_q_mtx;
+	bool crp_ret_q_exit_flag;
+
+	struct crypto_crp_ret_q crp_ret_q;
+	int crp_ret_q_len;
+	int crp_ret_q_maxlen; /* queue length limit. <=0 means unlimited. */
+	int crp_ret_q_drops;
+
+	struct crypto_crp_ret_kq crp_ret_kq;
+	int crp_ret_kq_len;
+	int crp_ret_kq_maxlen; /* queue length limit. <=0 means unlimited. */
+	int crp_ret_kq_drops;
+};
+struct crypto_crp_ret_qs **crypto_crp_ret_qs_list;
 
-#define DEFINIT_CRYPTO_Q_MAXLEN(name, defval)		\
-	static int crypto_##name##_maxlen = defval
 
-#define CRYPTO_Q_INC(name)			\
-	do {	\
-		crypto_##name##_len++;		\
-	} while(0);
+static inline struct crypto_crp_ret_qs *
+crypto_get_crp_ret_qs(struct cpu_info *ci)
+{
+	u_int cpuid;
+	struct crypto_crp_ret_qs *qs;
 
-#define CRYPTO_Q_DEC(name)			\
-	do {	\
-		crypto_##name##_len--;		\
-	} while(0);
+	KASSERT(ci != NULL);
 
-#define CRYPTO_Q_INC_DROPS(name)		\
-	do {	\
-		crypto_##name##_drops++;	\
-	} while(0);
+	cpuid = cpu_index(ci);
+	qs = crypto_crp_ret_qs_list[cpuid];
+	mutex_enter(>crp_ret_q_mtx);
+	return qs;
+}
 
-#define CRYPTO_Q_IS_FULL(name)	\
-	(crypto_##name##_maxlen > 0\
-	&& (crypto_##name##_len > crypto_##name##_maxlen))
+static inline void
+crypto_put_crp_ret_qs(struct cpu_info *ci)
+{
+	u_int cpuid;
+	struct crypto_crp_ret_qs *qs;
 
-/*
- * current queue length.
- */
-DEFINIT_CRYPTO_Q_LEN(crp_ret_q);
-DEFINIT_CRYPTO_Q_LEN(crp_ret_kq);
+	KASSERT(ci != NULL);
 
-/*
- * queue dropped count.
- */
-DEFINIT_CRYPTO_Q_DROPS(crp_ret_q);
-DEFINIT_CRYPTO_Q_DROPS(crp_ret_kq);
+	cpuid = cpu_index(ci);
+	qs = crypto_crp_ret_qs_list[cpuid];
+	mutex_exit(>crp_ret_q_mtx);
+}
 
 #ifndef CRYPTO_RET_Q_MAXLEN
 #define CRYPTO_RET_Q_MAXLEN 0
@@ -217,57 +217,152 @@ DEFINIT_CRYPTO_Q_DROPS(crp_ret_kq);
 #ifndef CRYPTO_RET_KQ_MAXLEN
 #define CRYPTO_RET_KQ_MAXLEN 0
 #endif
-/*
- * queue length limit.
- * default value is 0. <=0 means unlimited.
- */
-DEFINIT_CRYPTO_Q_MAXLEN(crp_ret_q, CRYPTO_RET_Q_MAXLEN);
-DEFINIT_CRYPTO_Q_MAXLEN(crp_ret_kq, CRYPTO_RET_KQ_MAXLEN);
 
-/*
- * TODO:
- * make percpu
- */
 static int
 sysctl_opencrypto_q_len(SYSCTLFN_ARGS)
 {
-	int error;
+	int error, len = 0;
+	struct sysctlnode node = *rnode;
+
+	for (int i = 0; i < ncpu; i++) {
+		struct crypto_crp_ret_qs *qs;
+		struct cpu_info *ci = cpu_lookup(i);
 
-	error = sysctl_lookup(SYSCTLFN_CALL(rnode));
+		qs = crypto_get_crp_ret_qs(ci);
+		len += qs->crp_ret_q_len;
+		crypto_put_crp_ret_qs(ci);
+	}

CVS commit: src/sys/opencrypto

2017-07-26 Thread Kengo NAKAHARA
Module Name:src
Committed By:   knakahara
Date:   Wed Jul 26 06:40:43 UTC 2017

Modified Files:
src/sys/opencrypto: crypto.c

Log Message:
make crp_{,k}q percpu to scale crypto_dispatch().

update locking note later.


To generate a diff of this commit:
cvs rdiff -u -r1.94 -r1.95 src/sys/opencrypto/crypto.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/opencrypto/crypto.c
diff -u src/sys/opencrypto/crypto.c:1.94 src/sys/opencrypto/crypto.c:1.95
--- src/sys/opencrypto/crypto.c:1.94	Thu Jul 20 23:07:12 2017
+++ src/sys/opencrypto/crypto.c	Wed Jul 26 06:40:42 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: crypto.c,v 1.94 2017/07/20 23:07:12 knakahara Exp $ */
+/*	$NetBSD: crypto.c,v 1.95 2017/07/26 06:40:42 knakahara Exp $ */
 /*	$FreeBSD: src/sys/opencrypto/crypto.c,v 1.4.2.5 2003/02/26 00:14:05 sam Exp $	*/
 /*	$OpenBSD: crypto.c,v 1.41 2002/07/17 23:52:38 art Exp $	*/
 
@@ -53,7 +53,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: crypto.c,v 1.94 2017/07/20 23:07:12 knakahara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: crypto.c,v 1.95 2017/07/26 06:40:42 knakahara Exp $");
 
 #include 
 #include 
@@ -69,6 +69,7 @@ __KERNEL_RCSID(0, "$NetBSD: crypto.c,v 1
 #include 
 #include 
 #include 
+#include 
 
 #if defined(_KERNEL_OPT)
 #include "opt_ocf.h"
@@ -77,7 +78,6 @@ __KERNEL_RCSID(0, "$NetBSD: crypto.c,v 1
 #include 
 #include 			/* XXX for M_XDATA */
 
-static kmutex_t crypto_q_mtx;
 static kmutex_t crypto_ret_q_mtx;
 
 /* below are kludges for residual code wrtitten to FreeBSD interfaces */
@@ -113,10 +113,52 @@ static	void *crypto_ret_si;
  * cipher) operations and one for asymmetric (e.g. MOD) operations.
  * See below for how synchronization is handled.
  */
-static	TAILQ_HEAD(,cryptop) crp_q =		/* request queues */
-		TAILQ_HEAD_INITIALIZER(crp_q);
-static	TAILQ_HEAD(,cryptkop) crp_kq =
-		TAILQ_HEAD_INITIALIZER(crp_kq);
+TAILQ_HEAD(crypto_crp_q, cryptop);
+TAILQ_HEAD(crypto_crp_kq, cryptkop);
+struct crypto_crp_qs {
+	struct crypto_crp_q crp_q;
+	struct crypto_crp_kq crp_kq;
+};
+static percpu_t *crypto_crp_qs_percpu;
+
+static inline struct crypto_crp_qs *
+crypto_get_crp_qs(int *s)
+{
+
+	KASSERT(s != NULL);
+
+	*s = splsoftnet();
+	return percpu_getref(crypto_crp_qs_percpu);
+}
+
+static inline void
+crypto_put_crp_qs(int *s)
+{
+
+	KASSERT(s != NULL);
+
+	percpu_putref(crypto_crp_qs_percpu);
+	splx(*s);
+}
+
+static void
+crypto_crp_q_is_busy_pc(void *p, void *arg, struct cpu_info *ci __unused)
+{
+	struct crypto_crp_qs *qs_pc = p;
+	bool *isempty = arg;
+
+	if (!TAILQ_EMPTY(_pc->crp_q) || !TAILQ_EMPTY(_pc->crp_kq))
+		*isempty = true;
+}
+
+static void
+crypto_crp_qs_init_pc(void *p, void *arg __unused, struct cpu_info *ci __unused)
+{
+	struct crypto_crp_qs *qs = p;
+
+	TAILQ_INIT(>crp_q);
+	TAILQ_INIT(>crp_kq);
+}
 
 /*
  * There are two queues for processing completed crypto requests; one
@@ -397,7 +439,6 @@ crypto_init0(void)
 {
 
 	mutex_init(_drv_mtx, MUTEX_DEFAULT, IPL_NONE);
-	mutex_init(_q_mtx, MUTEX_DEFAULT, IPL_NONE);
 	mutex_init(_ret_q_mtx, MUTEX_DEFAULT, IPL_NET);
 	pool_init(_pool, sizeof(struct cryptop), 0, 0,  
 		  0, "cryptop", NULL, IPL_NET);
@@ -406,6 +447,9 @@ crypto_init0(void)
 	pool_init(_pool, sizeof(struct cryptkop), 0, 0,
 		  0, "cryptkop", NULL, IPL_NET);
 
+	crypto_crp_qs_percpu = percpu_alloc(sizeof(struct crypto_crp_qs));
+	percpu_foreach(crypto_crp_qs_percpu, crypto_crp_qs_init_pc, NULL);
+
 	crypto_drivers = malloc(CRYPTO_DRIVERS_INITIAL *
 	sizeof(struct cryptocap), M_CRYPTO_DATA, M_NOWAIT | M_ZERO);
 	if (crypto_drivers == NULL) {
@@ -462,14 +506,13 @@ crypto_destroy(bool exit_kthread)
 	if (exit_kthread) {
 		struct cryptocap *cap = NULL;
 		uint64_t where;
+		bool is_busy = false;
 
 		/* if we have any in-progress requests, don't unload */
-		mutex_enter(_q_mtx);
-		if (!TAILQ_EMPTY(_q) || !TAILQ_EMPTY(_kq)) {
-			mutex_exit(_q_mtx);
+		percpu_foreach(crypto_crp_qs_percpu, crypto_crp_q_is_busy_pc,
+   _busy);
+		if (is_busy)
 			return EBUSY;
-		}
-		mutex_exit(_q_mtx);
 		/* FIXME:
 		 * prohibit enqueue to crp_q and crp_kq after here.
 		 */
@@ -514,12 +557,13 @@ crypto_destroy(bool exit_kthread)
 		free(crypto_drivers, M_CRYPTO_DATA);
 	mutex_exit(_drv_mtx);
 
+	percpu_free(crypto_crp_qs_percpu, sizeof(struct crypto_crp_qs));
+
 	pool_destroy(_pool);
 	pool_destroy(_pool);
 	pool_destroy(_pool);
 
 	mutex_destroy(_ret_q_mtx);
-	mutex_destroy(_q_mtx);
 	mutex_destroy(_drv_mtx);
 
 	return 0;
@@ -1094,8 +1138,10 @@ crypto_unblock(u_int32_t driverid, int w
 int
 crypto_dispatch(struct cryptop *crp)
 {
-	int result;
+	int result, s;
 	struct cryptocap *cap;
+	struct crypto_crp_qs *crp_qs;
+	struct crypto_crp_q *crp_q;
 
 	KASSERT(crp != NULL);
 
@@ -1118,17 +1164,20 @@ crypto_dispatch(struct cryptop *crp)
 		 *
 		 * don't care list order in batch job.
 		 */
-		mutex_enter(_q_mtx);
-		wasempty  = TAILQ_EMPTY(_q);
-		TAILQ_INSERT_TAIL(_q, crp,