CVS commit: src/sys/dev/pci

2017-06-06 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Jun  7 05:30:49 UTC 2017

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

Log Message:
 Fix to print the following bit fields correctly.
  -  Supported Link Speeds Vector in LCAP2
  -  Lower SKP OS Generation Supported Speed Vector  in LCAP2
  -  Lower SKP OS Reception Supported Speed Vector in LCAP2
  -  Enable Lower SKP OS Generation Vector in LCTL3

Note that the above bitfields start from 0 and the follwing bitfields start
from 1:
  -  Maximum Link Speed in LCAP
  -  Current Link Speed in LCSR
  -  Target Link Speed in LCSR2


To generate a diff of this commit:
cvs rdiff -u -r1.184 -r1.185 src/sys/dev/pci/pci_subr.c

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



CVS commit: src/sys/dev/pci

2017-06-06 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Jun  7 05:30:49 UTC 2017

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

Log Message:
 Fix to print the following bit fields correctly.
  -  Supported Link Speeds Vector in LCAP2
  -  Lower SKP OS Generation Supported Speed Vector  in LCAP2
  -  Lower SKP OS Reception Supported Speed Vector in LCAP2
  -  Enable Lower SKP OS Generation Vector in LCTL3

Note that the above bitfields start from 0 and the follwing bitfields start
from 1:
  -  Maximum Link Speed in LCAP
  -  Current Link Speed in LCSR
  -  Target Link Speed in LCSR2


To generate a diff of this commit:
cvs rdiff -u -r1.184 -r1.185 src/sys/dev/pci/pci_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/pci/pci_subr.c
diff -u src/sys/dev/pci/pci_subr.c:1.184 src/sys/dev/pci/pci_subr.c:1.185
--- src/sys/dev/pci/pci_subr.c:1.184	Mon Jun  5 13:35:33 2017
+++ src/sys/dev/pci/pci_subr.c	Wed Jun  7 05:30:49 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: pci_subr.c,v 1.184 2017/06/05 13:35:33 msaitoh Exp $	*/
+/*	$NetBSD: pci_subr.c,v 1.185 2017/06/07 05:30:49 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 1997 Zubin D. Dittia.  All rights reserved.
@@ -40,7 +40,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pci_subr.c,v 1.184 2017/06/05 13:35:33 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pci_subr.c,v 1.185 2017/06/07 05:30:49 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_pci.h"
@@ -1606,18 +1606,34 @@ pci_print_pcie_compl_timeout(uint32_t va
 	}
 }
 
-static const char * const pcie_linkspeeds[] = {"2.5", "2.5", "5.0", "8.0"};
+static const char * const pcie_linkspeeds[] = {"2.5", "5.0", "8.0"};
 
+/*
+ * Print link speed. This function is used for the following register bits:
+ *   Maximum Link Speed in LCAP
+ *   Current Link Speed in LCSR
+ *   Target Link Speed in LCSR2
+ * All of above bitfield's values start from 1.
+ */
 static void
 pci_print_pcie_linkspeed(pcireg_t val)
 {
 
-	if (val > __arraycount(pcie_linkspeeds))
+	if ((val < 1) || (val > __arraycount(pcie_linkspeeds)))
 		printf("unknown value (%u)\n", val);
 	else
-		printf("%sGT/s\n", pcie_linkspeeds[val]);
+		printf("%sGT/s\n", pcie_linkspeeds[val - 1]);
 }
 
+/*
+ * Print link speed "vector".
+ * This function is used for the following register bits:
+ *   Supported Link Speeds Vector in LCAP2
+ *   Lower SKP OS Generation Supported Speed Vector  in LCAP2
+ *   Lower SKP OS Reception Supported Speed Vector in LCAP2
+ *   Enable Lower SKP OS Generation Vector in LCTL3
+ * All of above bitfield's values start from 0.
+ */
 static void
 pci_print_pcie_linkspeedvector(pcireg_t val)
 {



CVS commit: src/lib/libc/sys

2017-06-06 Thread Abhinav Upadhyay
Module Name:src
Committed By:   abhinav
Date:   Wed Jun  7 05:26:19 UTC 2017

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

Log Message:
s/filesystem/file system/

Thanks to Thomas for pointing out that in NetBSD man pages we try to use the 
convention of writing it
as "file system".


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

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

Modified files:

Index: src/lib/libc/sys/kqueue.2
diff -u src/lib/libc/sys/kqueue.2:1.43 src/lib/libc/sys/kqueue.2:1.44
--- src/lib/libc/sys/kqueue.2:1.43	Tue Jun  6 20:12:54 2017
+++ src/lib/libc/sys/kqueue.2	Wed Jun  7 05:26:19 2017
@@ -1,4 +1,4 @@
-.\"	$NetBSD: kqueue.2,v 1.43 2017/06/06 20:12:54 abhinav Exp $
+.\"	$NetBSD: kqueue.2,v 1.44 2017/06/07 05:26:19 abhinav Exp $
 .\"
 .\" Copyright (c) 2000 Jonathan Lemon
 .\" All rights reserved.
@@ -424,7 +424,7 @@ The file referenced by the descriptor wa
 .It NOTE_REVOKE
 Access to the file was revoked via
 .Xr revoke 2
-or the underlying filesystem was unmounted.
+or the underlying file system was unmounted.
 .El
 .Pp
 On return,



CVS commit: src/lib/libc/sys

2017-06-06 Thread Abhinav Upadhyay
Module Name:src
Committed By:   abhinav
Date:   Wed Jun  7 05:26:19 UTC 2017

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

Log Message:
s/filesystem/file system/

Thanks to Thomas for pointing out that in NetBSD man pages we try to use the 
convention of writing it
as "file system".


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

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



CVS commit: src/bin/sh

2017-06-06 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Wed Jun  7 05:08:32 UTC 2017

Modified Files:
src/bin/sh: arith_token.c arith_tokens.h arithmetic.c arithmetic.h
eval.c exec.c exec.h expand.c expand.h input.c jobs.c nodetypes
option.list parser.c parser.h sh.1 show.c syntax.c syntax.h var.c
var.h

Log Message:
A better LINENO implementation.   This version deletes (well, #if 0's out)
the LINENO hack, and uses the LINENO var for both ${LINENO} and $((LINENO)).
(Code to invert the LINENO hack when required, like when de-compiling the
execution tree to provide the "jobs" command strings, is still included,
that can be deleted when the LINENO hack is completely removed - look for
refs to VSLINENO throughout the code.  The var funclinno in parser.c can
also be removed, it is used only for the LINENO hack.)

This version produces accurate results: $((LINENO)) was made as accurate
as the LINENO hack made ${LINENO} which is very good.  That's why the
LINENO hack is not yet completely removed, so it can be easily re-enabled.
If you can tell the difference when it is in use, or not in use, then
something has broken (or I managed to miss a case somewhere.)

The way that LINENO works is documented in its own (new) section in the
man page, so nothing more about that, or the new options, etc, here.

This version introduces the possibility of having a "reference" function
associated with a variable, which gets called whenever the value of the
variable is required (that's what implements LINENO).  There is just
one function pointer however, so any particular variable gets at most
one of the set function (as used for PATH, etc) or the reference function.
The VFUNCREF bit in the var flags indicates which func the variable in
question uses (if any - the func ptr, as before, can be NULL).

I would not call the results of this perfect yet, but it is close.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/bin/sh/arith_token.c
cvs rdiff -u -r1.1 -r1.2 src/bin/sh/arith_tokens.h src/bin/sh/arithmetic.h
cvs rdiff -u -r1.2 -r1.3 src/bin/sh/arithmetic.c src/bin/sh/option.list
cvs rdiff -u -r1.142 -r1.143 src/bin/sh/eval.c
cvs rdiff -u -r1.48 -r1.49 src/bin/sh/exec.c
cvs rdiff -u -r1.25 -r1.26 src/bin/sh/exec.h
cvs rdiff -u -r1.112 -r1.113 src/bin/sh/expand.c
cvs rdiff -u -r1.22 -r1.23 src/bin/sh/expand.h
cvs rdiff -u -r1.57 -r1.58 src/bin/sh/input.c
cvs rdiff -u -r1.85 -r1.86 src/bin/sh/jobs.c
cvs rdiff -u -r1.16 -r1.17 src/bin/sh/nodetypes
cvs rdiff -u -r1.133 -r1.134 src/bin/sh/parser.c
cvs rdiff -u -r1.21 -r1.22 src/bin/sh/parser.h
cvs rdiff -u -r1.148 -r1.149 src/bin/sh/sh.1
cvs rdiff -u -r1.42 -r1.43 src/bin/sh/show.c
cvs rdiff -u -r1.3 -r1.4 src/bin/sh/syntax.c
cvs rdiff -u -r1.7 -r1.8 src/bin/sh/syntax.h
cvs rdiff -u -r1.56 -r1.57 src/bin/sh/var.c
cvs rdiff -u -r1.29 -r1.30 src/bin/sh/var.h

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/arith_token.c
diff -u src/bin/sh/arith_token.c:1.4 src/bin/sh/arith_token.c:1.5
--- src/bin/sh/arith_token.c:1.4	Mon May 29 22:54:07 2017
+++ src/bin/sh/arith_token.c	Wed Jun  7 05:08:32 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: arith_token.c,v 1.4 2017/05/29 22:54:07 kre Exp $	*/
+/*	$NetBSD: arith_token.c,v 1.5 2017/06/07 05:08:32 kre Exp $	*/
 
 /*-
  * Copyright (c) 2002
@@ -39,7 +39,7 @@
 #include 
 
 #ifndef lint
-__RCSID("$NetBSD: arith_token.c,v 1.4 2017/05/29 22:54:07 kre Exp $");
+__RCSID("$NetBSD: arith_token.c,v 1.5 2017/06/07 05:08:32 kre Exp $");
 #endif /* not lint */
 
 #include 
@@ -98,6 +98,7 @@ arith_token(void)
 			 * and nothing else does.  They continue for the
 			 * longest unbroken sequence of alphanumerics ( + _ )
 			 */
+			arith_var_lno = arith_lno;
 			p = buf;
 			while (buf++, is_in_name(*buf))
 ;
@@ -115,6 +116,7 @@ arith_token(void)
 			 * operator, white space, or an error.
 			 */
 		case '\n':
+			arith_lno++;
 			VTRACE(DBG_ARITH, ("Arith: newline\n"));
 			/* FALLTHROUGH */
 		case ' ':

Index: src/bin/sh/arith_tokens.h
diff -u src/bin/sh/arith_tokens.h:1.1 src/bin/sh/arith_tokens.h:1.2
--- src/bin/sh/arith_tokens.h:1.1	Mon Mar 20 11:26:07 2017
+++ src/bin/sh/arith_tokens.h	Wed Jun  7 05:08:32 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: arith_tokens.h,v 1.1 2017/03/20 11:26:07 kre Exp $	*/
+/*	$NetBSD: arith_tokens.h,v 1.2 2017/06/07 05:08:32 kre Exp $	*/
 
 /*-
  * Copyright (c) 1993
@@ -112,4 +112,6 @@ union a_token_val {
 
 extern union a_token_val a_t_val;
 
+extern int arith_lno, arith_var_lno;
+
 int arith_token(void);
Index: src/bin/sh/arithmetic.h
diff -u src/bin/sh/arithmetic.h:1.1 src/bin/sh/arithmetic.h:1.2
--- src/bin/sh/arithmetic.h:1.1	Mon Mar 20 11:26:07 2017
+++ src/bin/sh/arithmetic.h	Wed Jun  7 05:08:32 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: arithmetic.h,v 1.1 2017/03/20 11:26:07 kre Exp $	*/
+/*	$NetBSD: arithmetic.h,v 1.2 2017/06/07 05:08:32 kre Exp $	*/
 
 /*-
  * Copyright (c) 1995
@@ 

CVS commit: src/bin/sh

2017-06-06 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Wed Jun  7 05:08:32 UTC 2017

Modified Files:
src/bin/sh: arith_token.c arith_tokens.h arithmetic.c arithmetic.h
eval.c exec.c exec.h expand.c expand.h input.c jobs.c nodetypes
option.list parser.c parser.h sh.1 show.c syntax.c syntax.h var.c
var.h

Log Message:
A better LINENO implementation.   This version deletes (well, #if 0's out)
the LINENO hack, and uses the LINENO var for both ${LINENO} and $((LINENO)).
(Code to invert the LINENO hack when required, like when de-compiling the
execution tree to provide the "jobs" command strings, is still included,
that can be deleted when the LINENO hack is completely removed - look for
refs to VSLINENO throughout the code.  The var funclinno in parser.c can
also be removed, it is used only for the LINENO hack.)

This version produces accurate results: $((LINENO)) was made as accurate
as the LINENO hack made ${LINENO} which is very good.  That's why the
LINENO hack is not yet completely removed, so it can be easily re-enabled.
If you can tell the difference when it is in use, or not in use, then
something has broken (or I managed to miss a case somewhere.)

The way that LINENO works is documented in its own (new) section in the
man page, so nothing more about that, or the new options, etc, here.

This version introduces the possibility of having a "reference" function
associated with a variable, which gets called whenever the value of the
variable is required (that's what implements LINENO).  There is just
one function pointer however, so any particular variable gets at most
one of the set function (as used for PATH, etc) or the reference function.
The VFUNCREF bit in the var flags indicates which func the variable in
question uses (if any - the func ptr, as before, can be NULL).

I would not call the results of this perfect yet, but it is close.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/bin/sh/arith_token.c
cvs rdiff -u -r1.1 -r1.2 src/bin/sh/arith_tokens.h src/bin/sh/arithmetic.h
cvs rdiff -u -r1.2 -r1.3 src/bin/sh/arithmetic.c src/bin/sh/option.list
cvs rdiff -u -r1.142 -r1.143 src/bin/sh/eval.c
cvs rdiff -u -r1.48 -r1.49 src/bin/sh/exec.c
cvs rdiff -u -r1.25 -r1.26 src/bin/sh/exec.h
cvs rdiff -u -r1.112 -r1.113 src/bin/sh/expand.c
cvs rdiff -u -r1.22 -r1.23 src/bin/sh/expand.h
cvs rdiff -u -r1.57 -r1.58 src/bin/sh/input.c
cvs rdiff -u -r1.85 -r1.86 src/bin/sh/jobs.c
cvs rdiff -u -r1.16 -r1.17 src/bin/sh/nodetypes
cvs rdiff -u -r1.133 -r1.134 src/bin/sh/parser.c
cvs rdiff -u -r1.21 -r1.22 src/bin/sh/parser.h
cvs rdiff -u -r1.148 -r1.149 src/bin/sh/sh.1
cvs rdiff -u -r1.42 -r1.43 src/bin/sh/show.c
cvs rdiff -u -r1.3 -r1.4 src/bin/sh/syntax.c
cvs rdiff -u -r1.7 -r1.8 src/bin/sh/syntax.h
cvs rdiff -u -r1.56 -r1.57 src/bin/sh/var.c
cvs rdiff -u -r1.29 -r1.30 src/bin/sh/var.h

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



CVS commit: src/bin/sh

2017-06-06 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Wed Jun  7 04:44:17 UTC 2017

Modified Files:
src/bin/sh: eval.c input.c input.h nodetypes parser.c var.c var.h

Log Message:
An initial attempt at implementing LINENO to meet the specs.

Aside from one problem (not too hard to fix if it was ever needed) this version
does about as well as most other shell implementations when expanding
$((LINENO)) and better for ${LINENO} as it retains the "LINENO hack" for the
latter, and that is very accurate.

Unfortunately that means that ${LINENO} and $((LINENO)) do not always produce
the same value when used on the same line (a defect that other shells do not
share - aside from the FreeBSD sh as it is today, where only the LINENO hack
exists and so (like for us before this commit) $((LINENO)) is always either
0, or at least whatever value was last set, perhaps by
LINENO=${LINENO}
which does actually work ... for that one line...)

This could be corrected by simply removing the LINENO hack (look for the string
LINENO in parser.c) in which case ${LINENO} and $((LINENO)) would give the
same (not perfectly accurate) values, as do most other shells.

POSIX requires that LINENO be set before each command, and this implementation
does that fairly literally - except that we only bother before the commands
which actually expand words (for, case and simple commands).   Unfortunately
this forgot that expansions also occur in redirects, and the other compound
commands can also have redirects, so if a redirect on one of the other compound
commands wants to use the value of $((LINENO)) as a part of a generated file
name, then it will get an incorrect value.  This is the "one problem" above.
(Because the LINENO hack is still enabled, using ${LINENO} works.)

This could be fixed, but as this version of the LINENO implementation is just
for reference purposes (it will be superseded within minutes by a better one)
I won't bother.  However should anyone else decide that this is a better choice
(it is probably a smaller implementation, in terms of code & data space then
the replacement, but also I would expect, slower, and definitely less accurate)
this defect is something to bear in mind, and fix.

This version retains the *BSD historical practice that line numbers in functions
(all functions) count from 1 from the start of the function, and elsewhere,
start from 1 from where the shell started reading the input file/stream in
question.  In an "eval" expression the line number starts at the line of the
"eval" (and then increases if the input is a multi-line string).

Note: this version is not documented (beyond as much as LINENO was before)
hence this slightly longer than usual commit message.


To generate a diff of this commit:
cvs rdiff -u -r1.141 -r1.142 src/bin/sh/eval.c
cvs rdiff -u -r1.56 -r1.57 src/bin/sh/input.c
cvs rdiff -u -r1.18 -r1.19 src/bin/sh/input.h
cvs rdiff -u -r1.15 -r1.16 src/bin/sh/nodetypes
cvs rdiff -u -r1.132 -r1.133 src/bin/sh/parser.c
cvs rdiff -u -r1.55 -r1.56 src/bin/sh/var.c
cvs rdiff -u -r1.28 -r1.29 src/bin/sh/var.h

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



CVS commit: src/bin/sh

2017-06-06 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Wed Jun  7 04:44:17 UTC 2017

Modified Files:
src/bin/sh: eval.c input.c input.h nodetypes parser.c var.c var.h

Log Message:
An initial attempt at implementing LINENO to meet the specs.

Aside from one problem (not too hard to fix if it was ever needed) this version
does about as well as most other shell implementations when expanding
$((LINENO)) and better for ${LINENO} as it retains the "LINENO hack" for the
latter, and that is very accurate.

Unfortunately that means that ${LINENO} and $((LINENO)) do not always produce
the same value when used on the same line (a defect that other shells do not
share - aside from the FreeBSD sh as it is today, where only the LINENO hack
exists and so (like for us before this commit) $((LINENO)) is always either
0, or at least whatever value was last set, perhaps by
LINENO=${LINENO}
which does actually work ... for that one line...)

This could be corrected by simply removing the LINENO hack (look for the string
LINENO in parser.c) in which case ${LINENO} and $((LINENO)) would give the
same (not perfectly accurate) values, as do most other shells.

POSIX requires that LINENO be set before each command, and this implementation
does that fairly literally - except that we only bother before the commands
which actually expand words (for, case and simple commands).   Unfortunately
this forgot that expansions also occur in redirects, and the other compound
commands can also have redirects, so if a redirect on one of the other compound
commands wants to use the value of $((LINENO)) as a part of a generated file
name, then it will get an incorrect value.  This is the "one problem" above.
(Because the LINENO hack is still enabled, using ${LINENO} works.)

This could be fixed, but as this version of the LINENO implementation is just
for reference purposes (it will be superseded within minutes by a better one)
I won't bother.  However should anyone else decide that this is a better choice
(it is probably a smaller implementation, in terms of code & data space then
the replacement, but also I would expect, slower, and definitely less accurate)
this defect is something to bear in mind, and fix.

This version retains the *BSD historical practice that line numbers in functions
(all functions) count from 1 from the start of the function, and elsewhere,
start from 1 from where the shell started reading the input file/stream in
question.  In an "eval" expression the line number starts at the line of the
"eval" (and then increases if the input is a multi-line string).

Note: this version is not documented (beyond as much as LINENO was before)
hence this slightly longer than usual commit message.


To generate a diff of this commit:
cvs rdiff -u -r1.141 -r1.142 src/bin/sh/eval.c
cvs rdiff -u -r1.56 -r1.57 src/bin/sh/input.c
cvs rdiff -u -r1.18 -r1.19 src/bin/sh/input.h
cvs rdiff -u -r1.15 -r1.16 src/bin/sh/nodetypes
cvs rdiff -u -r1.132 -r1.133 src/bin/sh/parser.c
cvs rdiff -u -r1.55 -r1.56 src/bin/sh/var.c
cvs rdiff -u -r1.28 -r1.29 src/bin/sh/var.h

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/eval.c
diff -u src/bin/sh/eval.c:1.141 src/bin/sh/eval.c:1.142
--- src/bin/sh/eval.c:1.141	Sun Jun  4 20:27:14 2017
+++ src/bin/sh/eval.c	Wed Jun  7 04:44:17 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: eval.c,v 1.141 2017/06/04 20:27:14 kre Exp $	*/
+/*	$NetBSD: eval.c,v 1.142 2017/06/07 04:44:17 kre Exp $	*/
 
 /*-
  * Copyright (c) 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)eval.c	8.9 (Berkeley) 6/8/95";
 #else
-__RCSID("$NetBSD: eval.c,v 1.141 2017/06/04 20:27:14 kre Exp $");
+__RCSID("$NetBSD: eval.c,v 1.142 2017/06/07 04:44:17 kre Exp $");
 #endif
 #endif /* not lint */
 
@@ -117,6 +117,7 @@ STATIC void expredir(union node *);
 STATIC void evalpipe(union node *);
 STATIC void evalcommand(union node *, int, struct backcmd *);
 STATIC void prehash(union node *);
+STATIC void set_lineno(int);
 
 STATIC char *find_dot_file(char *);
 
@@ -216,7 +217,7 @@ evalstring(char *s, int flag)
 	struct stackmark smark;
 
 	setstackmark();
-	setinputstring(s, 1);
+	setinputstring(s, 1, atoi(line_num.text + line_num.name_len + 1));
 
 	while ((n = parsecmd(0)) != NEOF) {
 		TRACE(("evalstring: "); showtree(n));
@@ -308,9 +309,11 @@ evaltree(union node *n, int flags)
 		evalloop(n, sflags);
 		break;
 	case NFOR:
+		set_lineno(n->nfor.lineno);
 		evalfor(n, sflags);
 		break;
 	case NCASE:
+		set_lineno(n->ncase.lineno);
 		evalcase(n, sflags);
 		break;
 	case NDEFUN:
@@ -770,6 +773,9 @@ evalcommand(union node *cmd, int flgs, s
 	setstackmark();
 	back_exitstatus = 0;
 
+	if (cmd != NULL)
+		set_lineno(cmd->ncmd.lineno);
+
 	arglist.lastp = 
 	varflag = 1;
 	/* Expand arguments, ignoring the initial 'name=value' ones */
@@ -1456,3 +1462,12 @@ timescmd(int argc, char **argv)
 
 	return 0;
 }
+
+STATIC void
+set_lineno(int lno)
+{
+	

CVS commit: src/sys/net

2017-06-06 Thread Kengo NAKAHARA
Module Name:src
Committed By:   knakahara
Date:   Wed Jun  7 03:53:11 UTC 2017

Modified Files:
src/sys/net: if_vlan.c if_vlanvar.h

Log Message:
vlan(4) MP-ify. contributed by s-yamaguchi@IIJ, thanks.

XXX Pull-ups needed for netbsd-8 branch


To generate a diff of this commit:
cvs rdiff -u -r1.97 -r1.98 src/sys/net/if_vlan.c
cvs rdiff -u -r1.9 -r1.10 src/sys/net/if_vlanvar.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/net/if_vlan.c
diff -u src/sys/net/if_vlan.c:1.97 src/sys/net/if_vlan.c:1.98
--- src/sys/net/if_vlan.c:1.97	Mon May 29 02:55:49 2017
+++ src/sys/net/if_vlan.c	Wed Jun  7 03:53:11 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_vlan.c,v 1.97 2017/05/29 02:55:49 ozaki-r Exp $	*/
+/*	$NetBSD: if_vlan.c,v 1.98 2017/06/07 03:53:11 knakahara Exp $	*/
 
 /*-
  * Copyright (c) 2000, 2001 The NetBSD Foundation, Inc.
@@ -78,7 +78,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_vlan.c,v 1.97 2017/05/29 02:55:49 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_vlan.c,v 1.98 2017/06/07 03:53:11 knakahara Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -86,6 +86,7 @@ __KERNEL_RCSID(0, "$NetBSD: if_vlan.c,v 
 #endif
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -95,6 +96,12 @@ __KERNEL_RCSID(0, "$NetBSD: if_vlan.c,v 
 #include 
 #include 
 #include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
 #include 
 #include 
 
@@ -116,6 +123,10 @@ __KERNEL_RCSID(0, "$NetBSD: if_vlan.c,v 
 
 #include "ioconf.h"
 
+#ifdef NET_MPSAFE
+#define VLAN_MPSAFE		1
+#endif
+
 struct vlan_mc_entry {
 	LIST_ENTRY(vlan_mc_entry)	mc_entries;
 	/*
@@ -131,21 +142,33 @@ struct vlan_mc_entry {
 
 #define	mc_enm		mc_u.mcu_enm
 
+
+struct ifvlan_linkmib {
+	struct ifvlan *ifvm_ifvlan;
+	const struct vlan_multisw *ifvm_msw;
+	int	ifvm_encaplen;	/* encapsulation length */
+	int	ifvm_mtufudge;	/* MTU fudged by this much */
+	int	ifvm_mintu;	/* min transmission unit */
+	uint16_t ifvm_proto;	/* encapsulation ethertype */
+	uint16_t ifvm_tag;	/* tag to apply on packets */
+	struct ifnet *ifvm_p;		/* parent interface of this vlan */
+
+	struct psref_target ifvm_psref;
+};
+
 struct ifvlan {
 	union {
 		struct ethercom ifvu_ec;
 	} ifv_u;
-	struct ifnet *ifv_p;	/* parent interface of this vlan */
-	struct ifv_linkmib {
-		const struct vlan_multisw *ifvm_msw;
-		int	ifvm_encaplen;	/* encapsulation length */
-		int	ifvm_mtufudge;	/* MTU fudged by this much */
-		int	ifvm_mintu;	/* min transmission unit */
-		uint16_t ifvm_proto;	/* encapsulation ethertype */
-		uint16_t ifvm_tag;	/* tag to apply on packets */
-	} ifv_mib;
+	struct ifvlan_linkmib *ifv_mib;	/*
+	 * reader must use vlan_getref_linkmib()
+	 * instead of direct dereference
+	 */
+	kmutex_t ifv_lock;		/* writer lock for ifv_mib */
+
 	LIST_HEAD(__vlan_mchead, vlan_mc_entry) ifv_mc_listhead;
 	LIST_ENTRY(ifvlan) ifv_list;
+	struct pslist_entry ifv_hash;
 	int ifv_flags;
 };
 
@@ -179,15 +202,47 @@ const struct vlan_multisw vlan_ether_mul
 
 static int	vlan_clone_create(struct if_clone *, int);
 static int	vlan_clone_destroy(struct ifnet *);
-static int	vlan_config(struct ifvlan *, struct ifnet *);
+static int	vlan_config(struct ifvlan *, struct ifnet *,
+uint16_t);
 static int	vlan_ioctl(struct ifnet *, u_long, void *);
 static void	vlan_start(struct ifnet *);
+static int	vlan_transmit(struct ifnet *, struct mbuf *);
 static void	vlan_unconfig(struct ifnet *);
+static int	vlan_unconfig_locked(struct ifvlan *,
+struct ifvlan_linkmib *);
+static void	vlan_hash_init(void);
+static int	vlan_hash_fini(void);
+static struct ifvlan_linkmib*	vlan_getref_linkmib(struct ifvlan *,
+struct psref *);
+static void	vlan_putref_linkmib(struct ifvlan_linkmib *,
+struct psref *);
+static void	vlan_linkmib_update(struct ifvlan *,
+struct ifvlan_linkmib *);
+static struct ifvlan_linkmib*	vlan_lookup_tag_psref(struct ifnet *,
+uint16_t, struct psref *);
+static int	tag_hash_func(uint16_t, u_long);
+
+LIST_HEAD(vlan_ifvlist, ifvlan);
+static struct {
+	kmutex_t lock;
+	struct vlan_ifvlist list;
+} ifv_list __cacheline_aligned;
 
-/* XXX This should be a hash table with the tag as the basis of the key. */
-static LIST_HEAD(, ifvlan) ifv_list;
 
-static kmutex_t ifv_mtx __cacheline_aligned;
+#if !defined(VLAN_TAG_HASH_SIZE)
+#define VLAN_TAG_HASH_SIZE 32
+#endif
+static struct {
+	kmutex_t lock;
+	struct pslist_head *lists;
+	u_long mask;
+} ifv_hash __cacheline_aligned = {
+	.lists = NULL,
+	.mask = 0,
+};
+
+pserialize_t vlan_psz __read_mostly;
+static struct psref_class *ifvm_psref_class __read_mostly;
 
 struct if_clone vlan_cloner =
 IF_CLONE_INITIALIZER("vlan", vlan_clone_create, vlan_clone_destroy);
@@ -208,10 +263,15 @@ vlanattach(int n)
 static void
 vlaninit(void)
 {
+	mutex_init(_list.lock, MUTEX_DEFAULT, IPL_NONE);
+	LIST_INIT(_list.list);
 
-	LIST_INIT(_list);
-	mutex_init(_mtx, MUTEX_DEFAULT, 

CVS commit: src/sys/net

2017-06-06 Thread Kengo NAKAHARA
Module Name:src
Committed By:   knakahara
Date:   Wed Jun  7 03:53:11 UTC 2017

Modified Files:
src/sys/net: if_vlan.c if_vlanvar.h

Log Message:
vlan(4) MP-ify. contributed by s-yamaguchi@IIJ, thanks.

XXX Pull-ups needed for netbsd-8 branch


To generate a diff of this commit:
cvs rdiff -u -r1.97 -r1.98 src/sys/net/if_vlan.c
cvs rdiff -u -r1.9 -r1.10 src/sys/net/if_vlanvar.h

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



CVS commit: src/sys/dev/mii

2017-06-06 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Jun  7 03:32:39 UTC 2017

Modified Files:
src/sys/dev/mii: mdio.h

Log Message:
Fix typo.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/mii/mdio.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/mii/mdio.h
diff -u src/sys/dev/mii/mdio.h:1.4 src/sys/dev/mii/mdio.h:1.5
--- src/sys/dev/mii/mdio.h:1.4	Tue Jun  6 04:56:12 2017
+++ src/sys/dev/mii/mdio.h	Wed Jun  7 03:32:39 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: mdio.h,v 1.4 2017/06/06 04:56:12 msaitoh Exp $	*/
+/*	$NetBSD: mdio.h,v 1.5 2017/06/07 03:32:39 msaitoh Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -102,7 +102,7 @@
 #define MDIO_PMAPMD_10PDSRSCONF		53  /* 10P downstream ReedSolomon cnf*/
 #define MDIO_PMAPMD_10PUSDR1		54  /* 10P upstream data rate cnf1 */
 #define MDIO_PMAPMD_10PUSDR2		55  /* 10P upstream data rate cnf2 */
-#define MDIO_PMAPMD_10PUSRSCONF		56  /* 10P upnstream ReedSolomon cnf */
+#define MDIO_PMAPMD_10PUSRSCONF		56  /* 10P upstream ReedSolomon cnf */
 #define MDIO_PMAPMD_10PTONEGROUP1	57  /* 10P tone group 1 */
 #define MDIO_PMAPMD_10PTONEGROUP2	58  /* 10P tone group 2 */
 #define MDIO_PMAPMD_10PTONEPARAM1	59  /* 10P tone parameter 1 */



CVS commit: src/sys/dev/mii

2017-06-06 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Jun  7 03:32:39 UTC 2017

Modified Files:
src/sys/dev/mii: mdio.h

Log Message:
Fix typo.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/mii/mdio.h

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



CVS commit: src/sys/dev/mii

2017-06-06 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Jun  7 03:21:31 UTC 2017

Modified Files:
src/sys/dev/mii: mii.h

Log Message:
- Add some bit definitions:
   - Unidirectional enable
   - Unidirectional ability
   - Extended Next Page
   - Receive Next Page Location Able
   - Received Next Page Storage Location
   - Data Link Layer Classification capability
   - Enable Physical Layer Classification
   - Invalid Class in PD Class
   - PSE Status bit definitions
- Sort registers
- Modify comments.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/dev/mii/mii.h

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



CVS commit: src/sys/dev/mii

2017-06-06 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Jun  7 03:21:31 UTC 2017

Modified Files:
src/sys/dev/mii: mii.h

Log Message:
- Add some bit definitions:
   - Unidirectional enable
   - Unidirectional ability
   - Extended Next Page
   - Receive Next Page Location Able
   - Received Next Page Storage Location
   - Data Link Layer Classification capability
   - Enable Physical Layer Classification
   - Invalid Class in PD Class
   - PSE Status bit definitions
- Sort registers
- Modify comments.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/dev/mii/mii.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/mii/mii.h
diff -u src/sys/dev/mii/mii.h:1.21 src/sys/dev/mii/mii.h:1.22
--- src/sys/dev/mii/mii.h:1.21	Wed Jun  7 03:08:44 2017
+++ src/sys/dev/mii/mii.h	Wed Jun  7 03:21:31 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: mii.h,v 1.21 2017/06/07 03:08:44 msaitoh Exp $	*/
+/*	$NetBSD: mii.h,v 1.22 2017/06/07 03:21:31 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 1997 Manuel Bouyer.  All rights reserved.
@@ -58,6 +58,7 @@
 #define	BMCR_FDX	0x0100	/* Set duplex mode */
 #define	BMCR_CTEST	0x0080	/* collision test */
 #define	BMCR_SPEED1	0x0040	/* speed selection (MSB) */
+#define	BMCR_UNIDIR	0x0020	/* Unidirectional enable */
 
 #define	BMCR_S10	0x		/* 10 Mb/s */
 #define	BMCR_S100	BMCR_SPEED0	/* 100 Mb/s */
@@ -74,6 +75,7 @@
 #define	BMSR_100T2FDX	0x0400	/* 100 base T2 full duplex capable */
 #define	BMSR_100T2HDX	0x0200	/* 100 base T2 half duplex capable */
 #define	BMSR_EXTSTAT	0x0100	/* Extended status in register 15 */
+#define	BMSR_UNIDIR	0x0080	/* Unidirectional ability */
 #define	BMSR_MFPS	0x0040	/* MII Frame Preamble Suppression */
 #define	BMSR_ACOMP	0x0020	/* Autonegotiation complete */
 #define	BMSR_RFAULT	0x0010	/* Link partner fault */
@@ -109,6 +111,7 @@
 #define ANAR_NP		0x8000	/* Next page (ro) */
 #define	ANAR_ACK	0x4000	/* link partner abilities acknowledged (ro) */
 #define ANAR_RF		0x2000	/* remote fault (ro) */
+#define ANAR_ENP	0x1000	/* Extended Next Page */
 		/* Annex 28B.2 */
 #define	ANAR_FC		0x0400	/* local device supports PAUSE */
 #define ANAR_T4		0x0200	/* local device supports 100bT4 */
@@ -130,7 +133,7 @@
 #define	ANAR_X_PAUSE_ASYM	(2 << 7)
 #define	ANAR_X_PAUSE_TOWARDS	(3 << 7)
 
-#define	MII_ANLPAR	0x05	/* Autonegotiation link partner abilities (rw) */
+#define	MII_ANLPAR	0x05	/* ANEG Link Partner Base Page abilities (rw)*/
 		/* section 28.2.4.1 and 37.2.6.1 */
 #define ANLPAR_NP	0x8000	/* Next page (ro) */
 #define	ANLPAR_ACK	0x4000	/* link partner accepted ACK (ro) */
@@ -158,13 +161,15 @@
 
 #define	MII_ANER	0x06	/* Autonegotiation expansion (ro) */
 		/* section 28.2.4.1 and 37.2.6.1 */
+#define ANER_RNPLA	0x0040	/* Receive Next Page Location Able */
+#define ANER_RNPSL	0x0020	/* Received Next Page Storage Location */
 #define ANER_MLF	0x0010	/* multiple link detection fault */
 #define ANER_LPNP	0x0008	/* link partner next page-able */
 #define ANER_NP		0x0004	/* next page-able */
 #define ANER_PAGE_RX	0x0002	/* Page received */
 #define ANER_LPAN	0x0001	/* link partner autoneg-able */
 
-#define	MII_ANNP	0x07	/* Autonegotiation next page */
+#define	MII_ANNP	0x07	/* Autonegotiation next page (rw) */
 		/* section 28.2.4.1 and 37.2.6.1 */
 
 #define	MII_ANLPRNP	0x08	/* Autonegotiation link partner rx next page */
@@ -191,10 +196,12 @@
 #define	GTSR_IDLE_ERR	0x00ff	/* IDLE error count */
 
 #define	MII_PSECR	0x0b	/* PSE control register */
+#define	PSECR_DLLC	0x0020	/* Data Link Layer Classification capability */
+#define	PSECR_EPLC	0x0010	/* Enable Physical Layer Classification */
 #define	PSECR_PACTLMASK	0x000c	/* pair control mask */
-#define	PSECR_PSEENMASK	0x0003	/* PSE enable mask */
 #define	PSECR_PINOUTB	0x0008	/* PSE pinout Alternative B */
 #define	PSECR_PINOUTA	0x0004	/* PSE pinout Alternative A */
+#define	PSECR_PSEENMASK	0x0003	/* PSE enable mask */
 #define	PSECR_FOPOWTST	0x0002	/* Force Power Test Mode */
 #define	PSECR_PSEEN	0x0001	/* PSE Enabled */
 #define	PSECR_PSEDIS	0x	/* PSE Disabled */
@@ -209,11 +216,18 @@
 #define	PSESR_PDCLMASK	0x0070	/* PD Class mask */
 #define	PSESR_STATMASK	0x000e	/* PSE Status mask */
 #define	PSESR_PAIRCTABL	0x0001	/* PAIR Control Ability */
+#define	PSESR_PDCL_INVALID	(5 << 4)	/* Invalid Class */
 #define	PSESR_PDCL_4		(4 << 4)	/* Class 4 */
 #define	PSESR_PDCL_3		(3 << 4)	/* Class 3 */
 #define	PSESR_PDCL_2		(2 << 4)	/* Class 2 */
 #define	PSESR_PDCL_1		(1 << 4)	/* Class 1 */
 #define	PSESR_PDCL_0		(0 << 4)	/* Class 0 */
+#define	PSESR_STAT_ISFLT	(5 << 1)	/* Implement specific fault */
+#define	PSESR_STAT_TSTERR	(4 << 1)	/* Test Error */
+#define	PSESR_STAT_TSTMODE	(3 << 1)	/* Test Mode */
+#define	PSESR_STAT_DELVPWR	(2 << 1)	/* Delivering power */
+#define	PSESR_STAT_SEARCH	(1 << 1)	/* Searching */
+#define	PSESR_STAT_DIS		(0 << 1)	/* Disabled */
 
 #define	MII_MMDACR	0x0d	/* MMD 

CVS commit: src/sys/dev/mii

2017-06-06 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Jun  7 03:08:44 UTC 2017

Modified Files:
src/sys/dev/mii: mii.h

Log Message:
 Fix typos.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/dev/mii/mii.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/mii/mii.h
diff -u src/sys/dev/mii/mii.h:1.20 src/sys/dev/mii/mii.h:1.21
--- src/sys/dev/mii/mii.h:1.20	Fri Oct 28 05:47:16 2016
+++ src/sys/dev/mii/mii.h	Wed Jun  7 03:08:44 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: mii.h,v 1.20 2016/10/28 05:47:16 msaitoh Exp $	*/
+/*	$NetBSD: mii.h,v 1.21 2017/06/07 03:08:44 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 1997 Manuel Bouyer.  All rights reserved.
@@ -130,7 +130,7 @@
 #define	ANAR_X_PAUSE_ASYM	(2 << 7)
 #define	ANAR_X_PAUSE_TOWARDS	(3 << 7)
 
-#define	MII_ANLPAR	0x05	/* Autonegotiation lnk partner abilities (rw) */
+#define	MII_ANLPAR	0x05	/* Autonegotiation link partner abilities (rw) */
 		/* section 28.2.4.1 and 37.2.6.1 */
 #define ANLPAR_NP	0x8000	/* Next page (ro) */
 #define	ANLPAR_ACK	0x4000	/* link partner accepted ACK (ro) */
@@ -159,10 +159,10 @@
 #define	MII_ANER	0x06	/* Autonegotiation expansion (ro) */
 		/* section 28.2.4.1 and 37.2.6.1 */
 #define ANER_MLF	0x0010	/* multiple link detection fault */
-#define ANER_LPNP	0x0008	/* link parter next page-able */
+#define ANER_LPNP	0x0008	/* link partner next page-able */
 #define ANER_NP		0x0004	/* next page-able */
 #define ANER_PAGE_RX	0x0002	/* Page received */
-#define ANER_LPAN	0x0001	/* link parter autoneg-able */
+#define ANER_LPAN	0x0001	/* link partner autoneg-able */
 
 #define	MII_ANNP	0x07	/* Autonegotiation next page */
 		/* section 28.2.4.1 and 37.2.6.1 */



CVS commit: src/sys/dev/mii

2017-06-06 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Jun  7 03:08:44 UTC 2017

Modified Files:
src/sys/dev/mii: mii.h

Log Message:
 Fix typos.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/dev/mii/mii.h

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



CVS commit: src/bin/sh

2017-06-06 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Tue Jun  6 22:38:52 UTC 2017

Modified Files:
src/bin/sh: sh.1

Log Message:
Fix a typo (or rather a remnant of an earlier intent).


To generate a diff of this commit:
cvs rdiff -u -r1.147 -r1.148 src/bin/sh/sh.1

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/sh.1
diff -u src/bin/sh/sh.1:1.147 src/bin/sh/sh.1:1.148
--- src/bin/sh/sh.1:1.147	Sun Jun  4 20:27:14 2017
+++ src/bin/sh/sh.1	Tue Jun  6 22:38:52 2017
@@ -1,4 +1,4 @@
-.\"	$NetBSD: sh.1,v 1.147 2017/06/04 20:27:14 kre Exp $
+.\"	$NetBSD: sh.1,v 1.148 2017/06/06 22:38:52 kre Exp $
 .\" Copyright (c) 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
 .\"
@@ -2219,7 +2219,7 @@ assign a value to a read-only variable.
 Note that either
 .Fl I
 or
-.Fl U
+.Fl N
 should always be used, or variables made local should always
 be given a value, or explicitly unset, as the default behavior
 (inheriting the earlier value, or starting unset after



CVS commit: src/bin/sh

2017-06-06 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Tue Jun  6 22:38:52 UTC 2017

Modified Files:
src/bin/sh: sh.1

Log Message:
Fix a typo (or rather a remnant of an earlier intent).


To generate a diff of this commit:
cvs rdiff -u -r1.147 -r1.148 src/bin/sh/sh.1

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



CVS commit: src/sys/dev/sdmmc

2017-06-06 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Tue Jun  6 21:01:07 UTC 2017

Modified Files:
src/sys/dev/sdmmc: ld_sdmmc.c

Log Message:
Fix a race between ld_sdmmc_start and ld_sdmmc_dobio that could result in
tasks getting lost from the task queue. The symptom of this is a NULL
deref in ld_sdmmc_start since the code assumes that a task will always be
available from the pool.

This changes the code to use pcq(9) instead of a TAILQ to manage the free
task list.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/sys/dev/sdmmc/ld_sdmmc.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/sdmmc/ld_sdmmc.c
diff -u src/sys/dev/sdmmc/ld_sdmmc.c:1.26 src/sys/dev/sdmmc/ld_sdmmc.c:1.27
--- src/sys/dev/sdmmc/ld_sdmmc.c:1.26	Sat Apr 22 14:19:36 2017
+++ src/sys/dev/sdmmc/ld_sdmmc.c	Tue Jun  6 21:01:07 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: ld_sdmmc.c,v 1.26 2017/04/22 14:19:36 jmcneill Exp $	*/
+/*	$NetBSD: ld_sdmmc.c,v 1.27 2017/06/06 21:01:07 jmcneill Exp $	*/
 
 /*
  * Copyright (c) 2008 KIYOHARA Takashi
@@ -28,7 +28,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ld_sdmmc.c,v 1.26 2017/04/22 14:19:36 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ld_sdmmc.c,v 1.27 2017/06/06 21:01:07 jmcneill Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_sdmmc.h"
@@ -48,6 +48,7 @@ __KERNEL_RCSID(0, "$NetBSD: ld_sdmmc.c,v
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -82,7 +83,7 @@ struct ld_sdmmc_softc {
 	struct sdmmc_function *sc_sf;
 #define LD_SDMMC_MAXQUEUECNT 4
 	struct ld_sdmmc_task sc_task[LD_SDMMC_MAXQUEUECNT];
-	TAILQ_HEAD(, sdmmc_task) sc_freeq;
+	pcq_t *sc_freeq;
 };
 
 static int ld_sdmmc_match(device_t, cfdata_t, void *);
@@ -129,12 +130,13 @@ ld_sdmmc_attach(device_t parent, device_
 	sa->sf->cid.rev, sa->sf->cid.psn, sa->sf->cid.mdt);
 	aprint_naive("\n");
 
-	TAILQ_INIT(>sc_freeq);
-	for (i = 0; i < __arraycount(sc->sc_task); i++) {
+	const int ntask = __arraycount(sc->sc_task);
+	sc->sc_freeq = pcq_create(ntask, KM_SLEEP);
+	for (i = 0; i < ntask; i++) {
 		task = >sc_task[i];
 		task->task_sc = sc;
-		callout_init(>task_restart_ch, 0);
-		TAILQ_INSERT_TAIL(>sc_freeq, >task, next);
+		callout_init(>task_restart_ch, CALLOUT_MPSAFE);
+		pcq_put(sc->sc_freeq, task);
 	}
 
 	sc->sc_hwunit = 0;	/* always 0? */
@@ -193,6 +195,8 @@ ld_sdmmc_detach(device_t dev, int flags)
 	for (i = 0; i < __arraycount(sc->sc_task); i++)
 		callout_destroy(>sc_task[i].task_restart_ch);
 
+	pcq_destroy(sc->sc_freeq);
+
 	return 0;
 }
 
@@ -200,9 +204,10 @@ static int
 ld_sdmmc_start(struct ld_softc *ld, struct buf *bp)
 {
 	struct ld_sdmmc_softc *sc = device_private(ld->sc_dv);
-	struct ld_sdmmc_task *task = (void *)TAILQ_FIRST(>sc_freeq);
+	struct ld_sdmmc_task *task = pcq_get(sc->sc_freeq);
 
-	TAILQ_REMOVE(>sc_freeq, >task, next);
+	if (task == NULL)
+		return EAGAIN;
 
 	task->task_bp = bp;
 	task->task_retries = 0;
@@ -278,7 +283,7 @@ ld_sdmmc_dobio(void *arg)
 	}
 
 done:
-	TAILQ_INSERT_TAIL(>sc_freeq, >task, next);
+	pcq_put(sc->sc_freeq, task);
 
 	lddone(>sc_ld, bp);
 }



CVS commit: src/sys/dev/sdmmc

2017-06-06 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Tue Jun  6 21:01:07 UTC 2017

Modified Files:
src/sys/dev/sdmmc: ld_sdmmc.c

Log Message:
Fix a race between ld_sdmmc_start and ld_sdmmc_dobio that could result in
tasks getting lost from the task queue. The symptom of this is a NULL
deref in ld_sdmmc_start since the code assumes that a task will always be
available from the pool.

This changes the code to use pcq(9) instead of a TAILQ to manage the free
task list.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/sys/dev/sdmmc/ld_sdmmc.c

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



CVS commit: src/external/gpl2/dtc/dist

2017-06-06 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Jun  6 20:19:04 UTC 2017

Modified Files:
src/external/gpl2/dtc/dist: data.c dtc.h fdtdump.c fdtput.c flattree.c
srcpos.c util.h
src/external/gpl2/dtc/dist/tests: mangle-layout.c move_and_save.c
tests.h

Log Message:
Reduce number of ALIGN macros defines and rename to avoid namespace clash


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/gpl2/dtc/dist/data.c \
src/external/gpl2/dtc/dist/dtc.h src/external/gpl2/dtc/dist/fdtdump.c \
src/external/gpl2/dtc/dist/fdtput.c src/external/gpl2/dtc/dist/flattree.c \
src/external/gpl2/dtc/dist/srcpos.c src/external/gpl2/dtc/dist/util.h
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/gpl2/dtc/dist/tests/mangle-layout.c \
src/external/gpl2/dtc/dist/tests/move_and_save.c \
src/external/gpl2/dtc/dist/tests/tests.h

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



CVS commit: src/external/gpl2/dtc/dist

2017-06-06 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Jun  6 20:19:04 UTC 2017

Modified Files:
src/external/gpl2/dtc/dist: data.c dtc.h fdtdump.c fdtput.c flattree.c
srcpos.c util.h
src/external/gpl2/dtc/dist/tests: mangle-layout.c move_and_save.c
tests.h

Log Message:
Reduce number of ALIGN macros defines and rename to avoid namespace clash


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/gpl2/dtc/dist/data.c \
src/external/gpl2/dtc/dist/dtc.h src/external/gpl2/dtc/dist/fdtdump.c \
src/external/gpl2/dtc/dist/fdtput.c src/external/gpl2/dtc/dist/flattree.c \
src/external/gpl2/dtc/dist/srcpos.c src/external/gpl2/dtc/dist/util.h
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/gpl2/dtc/dist/tests/mangle-layout.c \
src/external/gpl2/dtc/dist/tests/move_and_save.c \
src/external/gpl2/dtc/dist/tests/tests.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/gpl2/dtc/dist/data.c
diff -u src/external/gpl2/dtc/dist/data.c:1.1.1.1 src/external/gpl2/dtc/dist/data.c:1.2
--- src/external/gpl2/dtc/dist/data.c:1.1.1.1	Fri Dec  4 12:30:05 2015
+++ src/external/gpl2/dtc/dist/data.c	Tue Jun  6 20:19:04 2017
@@ -233,7 +233,7 @@ struct data data_append_zeroes(struct da
 
 struct data data_append_align(struct data d, int align)
 {
-	int newlen = ALIGN(d.len, align);
+	int newlen = FDTALIGN2(d.len, align);
 	return data_append_zeroes(d, newlen - d.len);
 }
 
Index: src/external/gpl2/dtc/dist/dtc.h
diff -u src/external/gpl2/dtc/dist/dtc.h:1.1.1.1 src/external/gpl2/dtc/dist/dtc.h:1.2
--- src/external/gpl2/dtc/dist/dtc.h:1.1.1.1	Fri Dec  4 12:30:05 2015
+++ src/external/gpl2/dtc/dist/dtc.h	Tue Jun  6 20:19:04 2017
@@ -65,8 +65,6 @@ typedef uint32_t cell_t;
 #define streq(a, b)	(strcmp((a), (b)) == 0)
 #define strneq(a, b, n)	(strncmp((a), (b), (n)) == 0)
 
-#define ALIGN(x, a)	(((x) + (a) - 1) & ~((a) - 1))
-
 /* Data blobs */
 enum markertype {
 	REF_PHANDLE,
Index: src/external/gpl2/dtc/dist/fdtdump.c
diff -u src/external/gpl2/dtc/dist/fdtdump.c:1.1.1.1 src/external/gpl2/dtc/dist/fdtdump.c:1.2
--- src/external/gpl2/dtc/dist/fdtdump.c:1.1.1.1	Fri Dec  4 12:30:05 2015
+++ src/external/gpl2/dtc/dist/fdtdump.c	Tue Jun  6 20:19:04 2017
@@ -15,8 +15,6 @@
 
 #include "util.h"
 
-#define ALIGN(x, a)	(((x) + ((a) - 1)) & ~((a) - 1))
-#define PALIGN(p, a)	((void *)(ALIGN((unsigned long)(p), (a
 #define GET_CELL(p)	(p += 4, *((const uint32_t *)(p-4)))
 
 static const char *tagname(uint32_t tag)
Index: src/external/gpl2/dtc/dist/fdtput.c
diff -u src/external/gpl2/dtc/dist/fdtput.c:1.1.1.1 src/external/gpl2/dtc/dist/fdtput.c:1.2
--- src/external/gpl2/dtc/dist/fdtput.c:1.1.1.1	Fri Dec  4 12:30:05 2015
+++ src/external/gpl2/dtc/dist/fdtput.c	Tue Jun  6 20:19:04 2017
@@ -128,7 +128,7 @@ static int encode_value(struct display_i
 	return 0;
 }
 
-#define ALIGN(x)		(((x) + (FDT_TAGSIZE) - 1) & ~((FDT_TAGSIZE) - 1))
+#define FDTALIGN(x)		(((x) + (FDT_TAGSIZE) - 1) & ~((FDT_TAGSIZE) - 1))
 
 static char *_realloc_fdt(char *fdt, int delta)
 {
@@ -142,7 +142,7 @@ static char *realloc_node(char *fdt, con
 {
 	int delta;
 	/* FDT_BEGIN_NODE, node name in off_struct and FDT_END_NODE */
-	delta = sizeof(struct fdt_node_header) + ALIGN(strlen(name) + 1)
+	delta = sizeof(struct fdt_node_header) + FDTALIGN(strlen(name) + 1)
 			+ FDT_TAGSIZE;
 	return _realloc_fdt(fdt, delta);
 }
@@ -159,7 +159,7 @@ static char *realloc_property(char *fdt,
 
 	if (newlen > oldlen)
 		/* actual value in off_struct */
-		delta += ALIGN(newlen) - ALIGN(oldlen);
+		delta += FDTALIGN(newlen) - FDTALIGN(oldlen);
 
 	return _realloc_fdt(fdt, delta);
 }
Index: src/external/gpl2/dtc/dist/flattree.c
diff -u src/external/gpl2/dtc/dist/flattree.c:1.1.1.1 src/external/gpl2/dtc/dist/flattree.c:1.2
--- src/external/gpl2/dtc/dist/flattree.c:1.1.1.1	Fri Dec  4 12:30:05 2015
+++ src/external/gpl2/dtc/dist/flattree.c	Tue Jun  6 20:19:04 2017
@@ -350,7 +350,7 @@ static void make_fdt_header(struct fdt_h
 	fdt->last_comp_version = cpu_to_fdt32(vi->last_comp_version);
 
 	/* Reserve map should be doubleword aligned */
-	reserve_off = ALIGN(vi->hdr_size, 8);
+	reserve_off = FDTALIGN2(vi->hdr_size, 8);
 
 	fdt->off_mem_rsvmap = cpu_to_fdt32(reserve_off);
 	fdt->off_dt_struct = cpu_to_fdt32(reserve_off + reservesize);
@@ -613,7 +613,7 @@ static void flat_realign(struct inbuf *i
 {
 	int off = inb->ptr - inb->base;
 
-	inb->ptr = inb->base + ALIGN(off, align);
+	inb->ptr = inb->base + FDTALIGN2(off, align);
 	if (inb->ptr > inb->limit)
 		die("Premature end of data parsing flat device tree\n");
 }
Index: src/external/gpl2/dtc/dist/srcpos.c
diff -u src/external/gpl2/dtc/dist/srcpos.c:1.1.1.1 src/external/gpl2/dtc/dist/srcpos.c:1.2
--- src/external/gpl2/dtc/dist/srcpos.c:1.1.1.1	Fri Dec  4 12:30:05 2015
+++ src/external/gpl2/dtc/dist/srcpos.c	Tue Jun  6 20:19:04 2017
@@ -226,7 +226,7 @@ void 

CVS commit: src/lib/libc/sys

2017-06-06 Thread Abhinav Upadhyay
Module Name:src
Committed By:   abhinav
Date:   Tue Jun  6 20:12:54 UTC 2017

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

Log Message:
Bump date for previous
Fix typo: fileystem -> filesystem


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

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

Modified files:

Index: src/lib/libc/sys/kqueue.2
diff -u src/lib/libc/sys/kqueue.2:1.42 src/lib/libc/sys/kqueue.2:1.43
--- src/lib/libc/sys/kqueue.2:1.42	Tue Jun  6 17:01:59 2017
+++ src/lib/libc/sys/kqueue.2	Tue Jun  6 20:12:54 2017
@@ -1,4 +1,4 @@
-.\"	$NetBSD: kqueue.2,v 1.42 2017/06/06 17:01:59 kamil Exp $
+.\"	$NetBSD: kqueue.2,v 1.43 2017/06/06 20:12:54 abhinav Exp $
 .\"
 .\" Copyright (c) 2000 Jonathan Lemon
 .\" All rights reserved.
@@ -32,7 +32,7 @@
 .\"
 .\" $FreeBSD: src/lib/libc/sys/kqueue.2,v 1.22 2001/06/27 19:55:57 dd Exp $
 .\"
-.Dd December 8, 2015
+.Dd June 6, 2017
 .Dt KQUEUE 2
 .Os
 .Sh NAME
@@ -424,7 +424,7 @@ The file referenced by the descriptor wa
 .It NOTE_REVOKE
 Access to the file was revoked via
 .Xr revoke 2
-or the underlying fileystem was unmounted.
+or the underlying filesystem was unmounted.
 .El
 .Pp
 On return,



CVS commit: src/lib/libc/sys

2017-06-06 Thread Abhinav Upadhyay
Module Name:src
Committed By:   abhinav
Date:   Tue Jun  6 20:12:54 UTC 2017

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

Log Message:
Bump date for previous
Fix typo: fileystem -> filesystem


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

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



CVS commit: src/usr.sbin/arp

2017-06-06 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Tue Jun  6 19:59:10 UTC 2017

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

Log Message:
whitespace police


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 src/usr.sbin/arp/arp.c

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



CVS commit: src/usr.sbin/arp

2017-06-06 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Tue Jun  6 19:59:10 UTC 2017

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

Log Message:
whitespace police


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 src/usr.sbin/arp/arp.c

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

Modified files:

Index: src/usr.sbin/arp/arp.c
diff -u src/usr.sbin/arp/arp.c:1.55 src/usr.sbin/arp/arp.c:1.56
--- src/usr.sbin/arp/arp.c:1.55	Mon Apr  4 07:37:08 2016
+++ src/usr.sbin/arp/arp.c	Tue Jun  6 19:59:10 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: arp.c,v 1.55 2016/04/04 07:37:08 ozaki-r Exp $ */
+/*	$NetBSD: arp.c,v 1.56 2017/06/06 19:59:10 ryo Exp $ */
 
 /*
  * Copyright (c) 1984, 1993
@@ -42,7 +42,7 @@ __COPYRIGHT("@(#) Copyright (c) 1984, 19
 #if 0
 static char sccsid[] = "@(#)arp.c	8.3 (Berkeley) 4/28/95";
 #else
-__RCSID("$NetBSD: arp.c,v 1.55 2016/04/04 07:37:08 ozaki-r Exp $");
+__RCSID("$NetBSD: arp.c,v 1.56 2017/06/06 19:59:10 ryo Exp $");
 #endif
 #endif /* not lint */
 
@@ -96,7 +96,7 @@ static int set(int, char **);
 static void usage(void) __dead;
 
 static int aflag, nflag, vflag;
-static struct sockaddr_in so_mask = { 
+static struct sockaddr_in so_mask = {
 	.sin_len = 8,
 	.sin_addr = {
 		.s_addr = 0x
@@ -206,7 +206,7 @@ file(const char *name)
 		inputstring = line;
 		for (ap = argv; ap < [sizeof(argv) / sizeof(argv[0])] &&
 		(*ap = stresep(, " \t", '\\')) != NULL;) {
-		   if (**ap != '\0')
+			if (**ap != '\0')
 ap++;
 		}
 		i = ap - argv;
@@ -257,7 +257,7 @@ getlink(const char *name, struct sockadd
 }
 
 /*
- * Set an individual arp entry 
+ * Set an individual arp entry
  */
 static int
 set(int argc, char **argv)
@@ -291,8 +291,8 @@ set(int argc, char **argv)
 			flags |= RTF_ANNOUNCE;
 			doing_proxy = 1;
 			if (argc && strncmp(argv[1], "pro", 3) == 0) {
-			export_only = 1;
-			argc--; argv++;
+export_only = 1;
+argc--; argv++;
 			}
 		} else if (strncmp(argv[0], "trail", 5) == 0) {
 			warnx("%s: Sending trailers is no longer supported",
@@ -387,7 +387,7 @@ is_llinfo(const struct sockaddr_dl *sdl,
 }
 
 /*
- * Delete an arp entry 
+ * Delete an arp entry
  */
 int
 delete(const char *host, const char *info)
@@ -401,7 +401,7 @@ delete(const char *host, const char *inf
 
 	s = getsocket();
 	if (info && strncmp(info, "pro", 3) == 0)
-		 sin_m.sin_other = SIN_PROXY;
+		sin_m.sin_other = SIN_PROXY;
 	if (getinetaddr(host, _m.sin_addr) == -1)
 		return (1);
 tryagain:
@@ -572,13 +572,13 @@ atosdl(const char *ss, struct sockaddr_d
 	int i;
 	unsigned long b;
 	char *endp;
-	char *p; 
+	char *p;
 	char *t, *r;
 
 	p = LLADDR(sdl);
 	endp = ((char *)(void *)sdl) + sdl->sdl_len;
 	i = 0;
-	
+
 	b = strtoul(ss, , 16);
 	if (b > 255 || t == ss)
 		return 1;
@@ -605,8 +605,8 @@ usage(void)
 
 	progname = getprogname();
 	(void)fprintf(stderr, "Usage: %s [-n] hostname\n", progname);
-	(void)fprintf(stderr, "	  %s [-nv] -a\n", progname);
-	(void)fprintf(stderr, "	  %s [-v] -d [-a|hostname [pub [proxy]]]\n",
+	(void)fprintf(stderr, "   %s [-nv] -a\n", progname);
+	(void)fprintf(stderr, "   %s [-v] -d [-a|hostname [pub [proxy]]]\n",
 	progname);
 	(void)fprintf(stderr, "   %s -s hostname ether_addr [temp] [pub [proxy]]\n",
 	progname);
@@ -725,7 +725,7 @@ getifname(u_int16_t ifindex, char *ifnam
 	}
 
 	for (addr = ifaddrs; addr; addr = addr->ifa_next) {
-		if (addr->ifa_addr == NULL || 
+		if (addr->ifa_addr == NULL ||
 		addr->ifa_addr->sa_family != AF_LINK)
 			continue;
 



CVS commit: src/lib/librumphijack

2017-06-06 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Jun  6 19:48:42 UTC 2017

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

Log Message:
since ln(1) now uses linkat(2) provide a dumb wrapper.


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

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

Modified files:

Index: src/lib/librumphijack/hijack.c
diff -u src/lib/librumphijack/hijack.c:1.122 src/lib/librumphijack/hijack.c:1.123
--- src/lib/librumphijack/hijack.c:1.122	Thu Feb 16 03:08:01 2017
+++ src/lib/librumphijack/hijack.c	Tue Jun  6 15:48:42 2017
@@ -1,4 +1,4 @@
-/*  $NetBSD: hijack.c,v 1.122 2017/02/16 08:08:01 ozaki-r Exp $	*/
+/*  $NetBSD: hijack.c,v 1.123 2017/06/06 19:48:42 christos Exp $	*/
 
 /*-
  * Copyright (c) 2011 Antti Kantee.  All Rights Reserved.
@@ -34,7 +34,7 @@
 #include 
 
 #if !defined(lint)
-__RCSID("$NetBSD: hijack.c,v 1.122 2017/02/16 08:08:01 ozaki-r Exp $");
+__RCSID("$NetBSD: hijack.c,v 1.123 2017/06/06 19:48:42 christos Exp $");
 #endif
 
 #include 
@@ -163,6 +163,9 @@ enum dualcall {
 #ifdef HAVE___QUOTACTL
 	DUALCALL_QUOTACTL,
 #endif
+#ifdef __NetBSD__
+	DUALCALL_LINKAT,
+#endif
 	DUALCALL__NUM
 };
 
@@ -379,6 +382,9 @@ struct sysnames {
 	{ DUALCALL_QUOTACTL,	"__quotactl",	RSYS_NAME(__QUOTACTL)	},
 #endif /* HAVE___QUOTACTL */
 
+#ifdef __NetBSD__
+	{ DUALCALL_LINKAT,	"linkat",	RSYS_NAME(LINKAT)	},
+#endif
 };
 #undef S
 
@@ -1271,6 +1277,19 @@ moveish(const char *from, const char *to
 	return op(from, to);
 }
 
+#ifdef __NetBSD__
+int
+linkat(int fromfd, const char *from, int tofd, const char *to, int flags)
+{
+	if (fromfd != AT_FDCWD || tofd != AT_FDCWD
+	|| flags != AT_SYMLINK_FOLLOW)
+		return ENOSYS;
+
+	return moveish(from, to,
+	GETSYSCALL(rump, LINK), GETSYSCALL(host, LINK));
+}
+#endif
+
 int
 link(const char *from, const char *to)
 {



CVS commit: src/lib/librumphijack

2017-06-06 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Jun  6 19:48:42 UTC 2017

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

Log Message:
since ln(1) now uses linkat(2) provide a dumb wrapper.


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

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



CVS commit: src/sys/opencrypto

2017-06-06 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Jun  6 18:08:23 UTC 2017

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

Log Message:
- acquire lock
- use c99 loop indexes
- initialize featp


To generate a diff of this commit:
cvs rdiff -u -r1.84 -r1.85 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.84 src/sys/opencrypto/crypto.c:1.85
--- src/sys/opencrypto/crypto.c:1.84	Tue Jun  6 00:11:41 2017
+++ src/sys/opencrypto/crypto.c	Tue Jun  6 14:08:23 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: crypto.c,v 1.84 2017/06/06 04:11:41 knakahara Exp $ */
+/*	$NetBSD: crypto.c,v 1.85 2017/06/06 18:08:23 christos 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.84 2017/06/06 04:11:41 knakahara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: crypto.c,v 1.85 2017/06/06 18:08:23 christos Exp $");
 
 #include 
 #include 
@@ -1530,34 +1530,36 @@ crypto_kdone(struct cryptkop *krp)
 int
 crypto_getfeat(int *featp)
 {
-	int hid, kalg, feat = 0;
 
-	if (crypto_userasymcrypto == 0)
+	if (crypto_userasymcrypto == 0) {
+		*featp = 0;
 		return 0;
+	}
 
 	mutex_enter(_drv_mtx);
 
-	for (hid = 0; hid < crypto_drivers_num; hid++) {
+	int feat = 0;
+	for (int hid = 0; hid < crypto_drivers_num; hid++) {
 		struct cryptocap *cap;
 		cap = crypto_checkdriver_uninit(hid);
 		if (cap == NULL)
 			continue;
 
+		crypto_driver_lock(cap);
+
 		if ((cap->cc_flags & CRYPTOCAP_F_SOFTWARE) &&
-		crypto_devallowsoft == 0) {
-			crypto_driver_unlock(cap);
-			continue;
-		}
-		if (cap->cc_kprocess == NULL) {
-			crypto_driver_unlock(cap);
-			continue;
-		}
-		for (kalg = 0; kalg < CRK_ALGORITHM_MAX; kalg++)
+		crypto_devallowsoft == 0)
+			goto unlock;
+
+		if (cap->cc_kprocess == NULL)
+			goto unlock;
+
+		for (int kalg = 0; kalg < CRK_ALGORITHM_MAX; kalg++)
 			if ((cap->cc_kalg[kalg] &
 			CRYPTO_ALG_FLAG_SUPPORTED) != 0)
 feat |=  1 << kalg;
 
-		crypto_driver_unlock(cap);
+unlock:		crypto_driver_unlock(cap);
 	}
 
 	mutex_exit(_drv_mtx);



CVS commit: src/sys/opencrypto

2017-06-06 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Jun  6 18:08:23 UTC 2017

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

Log Message:
- acquire lock
- use c99 loop indexes
- initialize featp


To generate a diff of this commit:
cvs rdiff -u -r1.84 -r1.85 src/sys/opencrypto/crypto.c

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



CVS commit: src/lib/libc/sys

2017-06-06 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Tue Jun  6 17:01:59 UTC 2017

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

Log Message:
Update the EV_SET() description with newer implementation.

EV_SET(2) is a macro again, that wraps an inline function which is still
new in NetBSD 8.0.

Sponsored by 


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

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

Modified files:

Index: src/lib/libc/sys/kqueue.2
diff -u src/lib/libc/sys/kqueue.2:1.41 src/lib/libc/sys/kqueue.2:1.42
--- src/lib/libc/sys/kqueue.2:1.41	Wed May 31 01:03:01 2017
+++ src/lib/libc/sys/kqueue.2	Tue Jun  6 17:01:59 2017
@@ -1,4 +1,4 @@
-.\"	$NetBSD: kqueue.2,v 1.41 2017/05/31 01:03:01 kamil Exp $
+.\"	$NetBSD: kqueue.2,v 1.42 2017/06/06 17:01:59 kamil Exp $
 .\"
 .\" Copyright (c) 2000 Jonathan Lemon
 .\" All rights reserved.
@@ -155,10 +155,19 @@ and
 .Fa eventlist .
 .Pp
 .Fn EV_SET
-is a static inline function which is provided for ease of initializing a
-kevent structure.
-Its original form was a preprocessor macro,
-which caused bugs in third party code.
+is a macro which is provided for ease of initializing a kevent structure.
+It wraps an internal static inline function to prevent preprocessor misuse.
+In the past this code would behave incorrectly and damage process's memory,
+if incrementation or decrementation would be used as the first argument.
+This example has been taken from LLDB, that caused the memory corruption and
+inspired the
+.Nx
+developers for improving the implementation.
+.Bd -literal -offset indent
+EV_SET(_events[i++], fd.first, EVFILT_READ, EV_ADD, 0, 0, 0);
+.Ed
+.Pp
+This macro is now safe in all major BSDs.
 .Pp
 The
 .Va kevent
@@ -673,5 +682,5 @@ function first appeared in
 .Nx 6.0 .
 .Pp
 .Fn EV_SET
-was converted from a macro to a static inline function in
+was converted from a macro implementation to the macro wrapping a static inline function in
 .Nx 8.0 .



CVS commit: src/lib/libc/sys

2017-06-06 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Tue Jun  6 17:01:59 UTC 2017

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

Log Message:
Update the EV_SET() description with newer implementation.

EV_SET(2) is a macro again, that wraps an inline function which is still
new in NetBSD 8.0.

Sponsored by 


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

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



CVS commit: [netbsd-8] src/doc

2017-06-06 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Jun  6 16:29:36 UTC 2017

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

Log Message:
ticket 13


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.5 -r1.1.2.6 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.5 src/doc/CHANGES-8.0:1.1.2.6
--- src/doc/CHANGES-8.0:1.1.2.5	Tue Jun  6 09:31:21 2017
+++ src/doc/CHANGES-8.0	Tue Jun  6 16:29:36 2017
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-8.0,v 1.1.2.5 2017/06/06 09:31:21 martin Exp $
+# $NetBSD: CHANGES-8.0,v 1.1.2.6 2017/06/06 16:29:36 snj Exp $
 
 A complete list of changes from the initial NetBSD 8.0 branch on 2017-06-04
 until the 8.0 release:
@@ -123,3 +123,14 @@ external/bsd/blacklist/bin/blacklistd.co
 	Improve wording.
 	[sevan, ticket #12]
 
+sys/arch/arm/fdt/plfb_fdt.c			1.2
+sys/arch/arm/vexpress/vexpress_platform.c	1.3
+sys/arch/evbarm/conf/VEXPRESS_A15		1.13
+sys/arch/evbarm/fdt/fdt_machdep.c		1.5
+sys/arch/evbarm/fdt/fdt_machdep.c		1.6
+sys/dev/ic/pl050.c1.2
+
+	Enable using the fb driver as console device on VEXPRESS_A15
+	by passing the "console=fb" argument on the kernel cmdline.
+	[jmcneill, ticket #13]
+



CVS commit: [netbsd-8] src/doc

2017-06-06 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Jun  6 16:29:36 UTC 2017

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

Log Message:
ticket 13


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

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



CVS commit: [netbsd-8] src/sys

2017-06-06 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Jun  6 16:26:53 UTC 2017

Modified Files:
src/sys/arch/arm/fdt [netbsd-8]: plfb_fdt.c
src/sys/arch/arm/vexpress [netbsd-8]: vexpress_platform.c
src/sys/arch/evbarm/conf [netbsd-8]: VEXPRESS_A15
src/sys/arch/evbarm/fdt [netbsd-8]: fdt_machdep.c
src/sys/dev/ic [netbsd-8]: pl050.c

Log Message:
Pull up following revision(s) (requested by jmcneill in ticket #13):
sys/arch/arm/fdt/plfb_fdt.c: revision 1.2
sys/arch/arm/vexpress/vexpress_platform.c: revision 1.3
sys/arch/evbarm/conf/VEXPRESS_A15: revision 1.13
sys/arch/evbarm/fdt/fdt_machdep.c: revisions 1.5, 1.6
sys/dev/ic/pl050.c: revision 1.2
Fix spelling of WS_DEFAULT_FG and WS_KERNEL_FG options.
--
Attach kbd slot to console
--
Allow plfb to be the console device
--
Add support for stdout-path= kernel cmdline option to override the
console device specified in the FDT.
--
Initialize boot_args before bootstrap for the benefit of platform code.
--
Allow 'console=fb' to act as a shortcut on vexpress for
'stdout-path=/smb@0800/motherboard/iofpga@3,/clcd@1f'


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.1.2.1 src/sys/arch/arm/fdt/plfb_fdt.c
cvs rdiff -u -r1.2 -r1.2.2.1 src/sys/arch/arm/vexpress/vexpress_platform.c
cvs rdiff -u -r1.12 -r1.12.2.1 src/sys/arch/evbarm/conf/VEXPRESS_A15
cvs rdiff -u -r1.4 -r1.4.2.1 src/sys/arch/evbarm/fdt/fdt_machdep.c
cvs rdiff -u -r1.1 -r1.1.2.1 src/sys/dev/ic/pl050.c

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



CVS commit: [netbsd-8] src/sys

2017-06-06 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Jun  6 16:26:53 UTC 2017

Modified Files:
src/sys/arch/arm/fdt [netbsd-8]: plfb_fdt.c
src/sys/arch/arm/vexpress [netbsd-8]: vexpress_platform.c
src/sys/arch/evbarm/conf [netbsd-8]: VEXPRESS_A15
src/sys/arch/evbarm/fdt [netbsd-8]: fdt_machdep.c
src/sys/dev/ic [netbsd-8]: pl050.c

Log Message:
Pull up following revision(s) (requested by jmcneill in ticket #13):
sys/arch/arm/fdt/plfb_fdt.c: revision 1.2
sys/arch/arm/vexpress/vexpress_platform.c: revision 1.3
sys/arch/evbarm/conf/VEXPRESS_A15: revision 1.13
sys/arch/evbarm/fdt/fdt_machdep.c: revisions 1.5, 1.6
sys/dev/ic/pl050.c: revision 1.2
Fix spelling of WS_DEFAULT_FG and WS_KERNEL_FG options.
--
Attach kbd slot to console
--
Allow plfb to be the console device
--
Add support for stdout-path= kernel cmdline option to override the
console device specified in the FDT.
--
Initialize boot_args before bootstrap for the benefit of platform code.
--
Allow 'console=fb' to act as a shortcut on vexpress for
'stdout-path=/smb@0800/motherboard/iofpga@3,/clcd@1f'


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.1.2.1 src/sys/arch/arm/fdt/plfb_fdt.c
cvs rdiff -u -r1.2 -r1.2.2.1 src/sys/arch/arm/vexpress/vexpress_platform.c
cvs rdiff -u -r1.12 -r1.12.2.1 src/sys/arch/evbarm/conf/VEXPRESS_A15
cvs rdiff -u -r1.4 -r1.4.2.1 src/sys/arch/evbarm/fdt/fdt_machdep.c
cvs rdiff -u -r1.1 -r1.1.2.1 src/sys/dev/ic/pl050.c

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

Modified files:

Index: src/sys/arch/arm/fdt/plfb_fdt.c
diff -u src/sys/arch/arm/fdt/plfb_fdt.c:1.1 src/sys/arch/arm/fdt/plfb_fdt.c:1.1.2.1
--- src/sys/arch/arm/fdt/plfb_fdt.c:1.1	Sat Jun  3 14:50:39 2017
+++ src/sys/arch/arm/fdt/plfb_fdt.c	Tue Jun  6 16:26:53 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: plfb_fdt.c,v 1.1 2017/06/03 14:50:39 jmcneill Exp $ */
+/* $NetBSD: plfb_fdt.c,v 1.1.2.1 2017/06/06 16:26:53 snj Exp $ */
 
 /*-
  * Copyright (c) 2017 Jared McNeill 
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: plfb_fdt.c,v 1.1 2017/06/03 14:50:39 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: plfb_fdt.c,v 1.1.2.1 2017/06/06 16:26:53 snj Exp $");
 
 #include 
 #include 
@@ -68,6 +68,8 @@ __KERNEL_RCSID(0, "$NetBSD: plfb_fdt.c,v
 
 #define	PLFB_BPP		32
 
+static int plfb_console_phandle = -1;
+
 struct plfb_softc {
 	struct genfb_softc	sc_gen;
 	bus_space_tag_t		sc_bst;
@@ -170,7 +172,8 @@ plfb_attach(device_t parent, device_t se
 	plfb_init(sc);
 
 	sc->sc_wstype = WSDISPLAY_TYPE_PLFB;
-	prop_dictionary_set_bool(dict, "is_console", false);
+	prop_dictionary_set_bool(dict, "is_console",
+	phandle == plfb_console_phandle);
 
 	genfb_init(>sc_gen);
 
@@ -294,3 +297,23 @@ plfb_init(struct plfb_softc *sc)
 	LCDCONTROL_PWR | LCDCONTROL_EN | LCDCONTROL_BPP_24 |
 	LCDCONTROL_BGR);
 }
+
+static int
+plfb_console_match(int phandle)
+{
+	return of_match_compatible(phandle, compatible);
+}
+
+static void
+plfb_console_consinit(struct fdt_attach_args *faa, u_int uart_freq)
+{
+	plfb_console_phandle = faa->faa_phandle;
+	genfb_cnattach();
+}
+
+static const struct fdt_console plfb_fdt_console = {
+	.match = plfb_console_match,
+	.consinit = plfb_console_consinit
+};
+
+FDT_CONSOLE(plfb, _fdt_console);

Index: src/sys/arch/arm/vexpress/vexpress_platform.c
diff -u src/sys/arch/arm/vexpress/vexpress_platform.c:1.2 src/sys/arch/arm/vexpress/vexpress_platform.c:1.2.2.1
--- src/sys/arch/arm/vexpress/vexpress_platform.c:1.2	Fri Jun  2 20:16:05 2017
+++ src/sys/arch/arm/vexpress/vexpress_platform.c	Tue Jun  6 16:26:53 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: vexpress_platform.c,v 1.2 2017/06/02 20:16:05 jmcneill Exp $ */
+/* $NetBSD: vexpress_platform.c,v 1.2.2.1 2017/06/06 16:26:53 snj Exp $ */
 
 /*-
  * Copyright (c) 2017 Jared McNeill 
@@ -30,7 +30,7 @@
 #include "opt_fdt_arm.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vexpress_platform.c,v 1.2 2017/06/02 20:16:05 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vexpress_platform.c,v 1.2.2.1 2017/06/06 16:26:53 snj Exp $");
 
 #include 
 #include 
@@ -55,6 +55,10 @@ __KERNEL_RCSID(0, "$NetBSD: vexpress_pla
 
 #include 
 
+#include 
+
+#define	VEXPRESS_CLCD_NODE_PATH	\
+	"/smb@0800/motherboard/iofpga@3,/clcd@1f"
 #define	VEXPRESS_REF_FREQ	2400
 
 #define	DEVMAP_ALIGN(a)	((a) & ~L1_S_OFFSET)
@@ -165,6 +169,14 @@ vexpress_platform_bootstrap(void)
 	arm_cpu_max = 1 + __SHIFTOUT(armreg_l2ctrl_read(), L2CTRL_NUMCPU);
 
 	vexpress_a15_smp_init();
+
+	if (match_bootconf_option(boot_args, "console", "fb")) {
+		void *fdt_data = __UNCONST(fdtbus_get_data());
+		const int chosen_off = fdt_path_offset(fdt_data, "/chosen");
+		if (chosen_off >= 0)
+			fdt_setprop_string(fdt_data, chosen_off, "stdout-path",
+			VEXPRESS_CLCD_NODE_PATH);
+	}
 }
 
 static void

Index: 

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

2017-06-06 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Tue Jun  6 15:58:59 UTC 2017

Modified Files:
src/sys/arch/macppc/conf: files.macppc

Log Message:
SMU config goo


To generate a diff of this commit:
cvs rdiff -u -r1.103 -r1.104 src/sys/arch/macppc/conf/files.macppc

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/macppc/conf/files.macppc
diff -u src/sys/arch/macppc/conf/files.macppc:1.103 src/sys/arch/macppc/conf/files.macppc:1.104
--- src/sys/arch/macppc/conf/files.macppc:1.103	Thu Jun 16 14:51:56 2016
+++ src/sys/arch/macppc/conf/files.macppc	Tue Jun  6 15:58:59 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: files.macppc,v 1.103 2016/06/16 14:51:56 macallan Exp $
+#	$NetBSD: files.macppc,v 1.104 2017/06/06 15:58:59 macallan Exp $
 #
 # macppc-specific configuration info
 
@@ -180,6 +180,22 @@ device zstty: tty
 attach zstty at zsc
 file dev/ic/z8530tty.czstty needs-flag
 
+define smu {}
+device smu: smu, obio
+attach smu at mainbus
+file arch/macppc/dev/smu.c			smu needs-flag
+defflag	opt_smu.h	SMU_DEBUG
+
+define smuiic {}
+device smuiic: smuiic, i2cbus
+attach smuiic at smu
+file arch/macppc/dev/smuiic.c			smuiic
+
+device smusat
+attach smusat at smuiic
+file arch/macppc/dev/smusat.c			smusat
+defflag	opt_smusat.h	SMUSAT_DEBUG
+
 include "dev/adb/files.adb"
 
 defflag	opt_cuda.h	CUDA_DEBUG



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

2017-06-06 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Tue Jun  6 15:58:59 UTC 2017

Modified Files:
src/sys/arch/macppc/conf: files.macppc

Log Message:
SMU config goo


To generate a diff of this commit:
cvs rdiff -u -r1.103 -r1.104 src/sys/arch/macppc/conf/files.macppc

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



CVS commit: src/sys/arch/macppc/dev

2017-06-06 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Tue Jun  6 15:58:17 UTC 2017

Added Files:
src/sys/arch/macppc/dev: smu.c smuiic.c smuiicvar.h smusat.c smuvar.h

Log Message:
SMU support, from Phileas Fogg


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/arch/macppc/dev/smu.c \
src/sys/arch/macppc/dev/smuiic.c src/sys/arch/macppc/dev/smuiicvar.h \
src/sys/arch/macppc/dev/smusat.c src/sys/arch/macppc/dev/smuvar.h

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



CVS commit: src/sys/arch/macppc/dev

2017-06-06 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Tue Jun  6 15:58:17 UTC 2017

Added Files:
src/sys/arch/macppc/dev: smu.c smuiic.c smuiicvar.h smusat.c smuvar.h

Log Message:
SMU support, from Phileas Fogg


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/arch/macppc/dev/smu.c \
src/sys/arch/macppc/dev/smuiic.c src/sys/arch/macppc/dev/smuiicvar.h \
src/sys/arch/macppc/dev/smusat.c src/sys/arch/macppc/dev/smuvar.h

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

Added files:

Index: src/sys/arch/macppc/dev/smu.c
diff -u /dev/null src/sys/arch/macppc/dev/smu.c:1.1
--- /dev/null	Tue Jun  6 15:58:17 2017
+++ src/sys/arch/macppc/dev/smu.c	Tue Jun  6 15:58:17 2017
@@ -0,0 +1,827 @@
+/*-
+ * Copyright (c) 2013 Phileas Fogg
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+#include "opt_smu.h"
+
+struct smu_softc;
+
+struct smu_cmd {
+	u_char cmd;
+	u_char len;
+	u_char data[254];
+};
+
+struct smu_fan {
+	struct smu_softc* sc;
+
+	char location[32];
+	int reg;
+	int zone;
+	int rpm_ctl;
+	int min_rpm;
+	int max_rpm;
+	int default_rpm;
+	int current_rpm;
+	time_t last_update;
+};
+
+struct smu_iicbus {
+	struct smu_softc* sc;
+
+	int reg;
+	struct i2c_controller i2c;
+};
+
+#define SMU_MAX_FANS		8
+#define SMU_MAX_IICBUS		3
+#define SMU_MAX_SME_SENSORS	SMU_MAX_FANS
+
+struct smu_softc {
+	device_t sc_dev;
+	int sc_node;
+	struct sysctlnode *sc_sysctl_me;
+
+	kmutex_t sc_cmd_lock;
+	struct smu_cmd *sc_cmd;
+	paddr_t sc_cmd_paddr;
+	int sc_dbell_mbox;
+	int sc_dbell_gpio;
+
+	int sc_num_fans;
+	struct smu_fan sc_fans[SMU_MAX_FANS];
+
+	kmutex_t sc_iicbus_lock;
+	int sc_num_iicbus;
+	struct smu_iicbus sc_iicbus[SMU_MAX_IICBUS];
+
+	struct todr_chip_handle sc_todr;
+
+	struct sysmon_envsys *sc_sme;
+	envsys_data_t sc_sme_sensors[SMU_MAX_SME_SENSORS];
+};
+
+#define SMU_CMD_FAN	0x4a
+#define SMU_CMD_RTC	0x8e
+#define SMU_CMD_I2C	0x9a
+#define SMU_CMD_POWER	0xaa
+
+#ifdef SMU_DEBUG
+#define DPRINTF printf
+#else
+#define DPRINTF while (0) printf
+#endif
+
+static int smu_match(device_t, struct cfdata *, void *);
+static void smu_attach(device_t, device_t, void *);
+static int smu_setup_doorbell(struct smu_softc *);
+static void smu_setup_fans(struct smu_softc *);
+static void smu_setup_iicbus(struct smu_softc *);
+static void smu_setup_sme(struct smu_softc *);
+static int smu_iicbus_print(void *, const char *);
+static void smu_sme_refresh(struct sysmon_envsys *, envsys_data_t *);
+static int smu_do_cmd(struct smu_softc *, struct smu_cmd *, int);
+static int smu_dbell_gpio_intr(void *);
+static int smu_todr_gettime_ymdhms(todr_chip_handle_t, struct clock_ymdhms *);
+static int smu_todr_settime_ymdhms(todr_chip_handle_t, struct clock_ymdhms *);
+static int smu_fan_update_rpm(struct smu_fan *);
+static int smu_fan_get_rpm(struct smu_fan *, int *);
+static int smu_fan_set_rpm(struct smu_fan *, int);
+static int smu_iicbus_acquire_bus(void *, int);
+static void smu_iicbus_release_bus(void *, int);
+static int smu_iicbus_exec(void *, i2c_op_t, i2c_addr_t, const void *,
+size_t, void *, size_t, int);
+static int smu_sysctl_fan_rpm(SYSCTLFN_ARGS);
+
+CFATTACH_DECL_NEW(smu, sizeof(struct smu_softc),
+smu_match, smu_attach, NULL, NULL);
+
+static struct smu_softc *smu0 = NULL;
+
+static int
+smu_match(device_t parent, struct cfdata *cf, void *aux)
+{
+	struct confargs *ca = aux;
+
+	if (strcmp(ca->ca_name, "smu") == 0)
+		

CVS commit: src/doc

2017-06-06 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Jun  6 12:56:43 UTC 2017

Modified Files:
src/doc: 3RDPARTY

Log Message:
Document current dtc/libfdt status (even if it is a mess)


To generate a diff of this commit:
cvs rdiff -u -r1.1445 -r1.1446 src/doc/3RDPARTY

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.1445 src/doc/3RDPARTY:1.1446
--- src/doc/3RDPARTY:1.1445	Mon Jun  5 18:56:16 2017
+++ src/doc/3RDPARTY	Tue Jun  6 12:56:42 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.1445 2017/06/05 18:56:16 christos Exp $
+#	$NetBSD: 3RDPARTY,v 1.1446 2017/06/06 12:56:42 skrll Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -1702,3 +1702,14 @@ Responsible:	christos
 Location:	usr.bin/dc
 Notes:
 		Uses OpenSSL's bignum
+
+Package:	dtc,libfdt
+Version:	1.4.1
+Current Vers:	1.4.4
+Maintainer:	David Gibson , Jon Loeliger 
+Archive Site:	https://git.kernel.org/pub/scm/utils/dtc/dtc.git
+Home Page:	https://git.kernel.org/pub/scm/utils/dtc/dtc.git
+Mailing List:	mailto:devicetree-compi...@vger.kernel.org
+Responsible:	skrll
+License:	GPLv2 (dtc), BSD (libfdt)
+Location:	external/gpl2/dtc, sys/external/bsd/libfdt



CVS commit: src/doc

2017-06-06 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Jun  6 12:56:43 UTC 2017

Modified Files:
src/doc: 3RDPARTY

Log Message:
Document current dtc/libfdt status (even if it is a mess)


To generate a diff of this commit:
cvs rdiff -u -r1.1445 -r1.1446 src/doc/3RDPARTY

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



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

2017-06-06 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Tue Jun  6 09:56:57 UTC 2017

Modified Files:
src/sys/arch/arm/vexpress: vexpress_platform.c

Log Message:
Allow 'console=fb' to act as a shortcut on vexpress for
'stdout-path=/smb@0800/motherboard/iofpga@3,/clcd@1f'


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/arm/vexpress/vexpress_platform.c

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

Modified files:

Index: src/sys/arch/arm/vexpress/vexpress_platform.c
diff -u src/sys/arch/arm/vexpress/vexpress_platform.c:1.2 src/sys/arch/arm/vexpress/vexpress_platform.c:1.3
--- src/sys/arch/arm/vexpress/vexpress_platform.c:1.2	Fri Jun  2 20:16:05 2017
+++ src/sys/arch/arm/vexpress/vexpress_platform.c	Tue Jun  6 09:56:57 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: vexpress_platform.c,v 1.2 2017/06/02 20:16:05 jmcneill Exp $ */
+/* $NetBSD: vexpress_platform.c,v 1.3 2017/06/06 09:56:57 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2017 Jared McNeill 
@@ -30,7 +30,7 @@
 #include "opt_fdt_arm.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vexpress_platform.c,v 1.2 2017/06/02 20:16:05 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vexpress_platform.c,v 1.3 2017/06/06 09:56:57 jmcneill Exp $");
 
 #include 
 #include 
@@ -55,6 +55,10 @@ __KERNEL_RCSID(0, "$NetBSD: vexpress_pla
 
 #include 
 
+#include 
+
+#define	VEXPRESS_CLCD_NODE_PATH	\
+	"/smb@0800/motherboard/iofpga@3,/clcd@1f"
 #define	VEXPRESS_REF_FREQ	2400
 
 #define	DEVMAP_ALIGN(a)	((a) & ~L1_S_OFFSET)
@@ -165,6 +169,14 @@ vexpress_platform_bootstrap(void)
 	arm_cpu_max = 1 + __SHIFTOUT(armreg_l2ctrl_read(), L2CTRL_NUMCPU);
 
 	vexpress_a15_smp_init();
+
+	if (match_bootconf_option(boot_args, "console", "fb")) {
+		void *fdt_data = __UNCONST(fdtbus_get_data());
+		const int chosen_off = fdt_path_offset(fdt_data, "/chosen");
+		if (chosen_off >= 0)
+			fdt_setprop_string(fdt_data, chosen_off, "stdout-path",
+			VEXPRESS_CLCD_NODE_PATH);
+	}
 }
 
 static void



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

2017-06-06 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Tue Jun  6 09:56:57 UTC 2017

Modified Files:
src/sys/arch/arm/vexpress: vexpress_platform.c

Log Message:
Allow 'console=fb' to act as a shortcut on vexpress for
'stdout-path=/smb@0800/motherboard/iofpga@3,/clcd@1f'


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/arm/vexpress/vexpress_platform.c

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



CVS commit: src/sys/arch/evbarm/fdt

2017-06-06 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Tue Jun  6 09:56:00 UTC 2017

Modified Files:
src/sys/arch/evbarm/fdt: fdt_machdep.c

Log Message:
Initialize boot_args before bootstrap for the benefit of platform code.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/evbarm/fdt/fdt_machdep.c

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



CVS commit: src/sys/arch/evbarm/fdt

2017-06-06 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Tue Jun  6 09:56:00 UTC 2017

Modified Files:
src/sys/arch/evbarm/fdt: fdt_machdep.c

Log Message:
Initialize boot_args before bootstrap for the benefit of platform code.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/evbarm/fdt/fdt_machdep.c

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

Modified files:

Index: src/sys/arch/evbarm/fdt/fdt_machdep.c
diff -u src/sys/arch/evbarm/fdt/fdt_machdep.c:1.5 src/sys/arch/evbarm/fdt/fdt_machdep.c:1.6
--- src/sys/arch/evbarm/fdt/fdt_machdep.c:1.5	Tue Jun  6 00:28:05 2017
+++ src/sys/arch/evbarm/fdt/fdt_machdep.c	Tue Jun  6 09:56:00 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: fdt_machdep.c,v 1.5 2017/06/06 00:28:05 jmcneill Exp $ */
+/* $NetBSD: fdt_machdep.c,v 1.6 2017/06/06 09:56:00 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2015-2017 Jared McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: fdt_machdep.c,v 1.5 2017/06/06 00:28:05 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fdt_machdep.c,v 1.6 2017/06/06 09:56:00 jmcneill Exp $");
 
 #include "opt_machdep.h"
 #include "opt_ddb.h"
@@ -168,6 +168,11 @@ initarm(void *arg)
 	DPRINTN((uintptr_t)fdt_addr_r, 16);
 	DPRINT(">");
 
+	const int chosen = OF_finddevice("/chosen");
+	if (chosen >= 0)
+		OF_getprop(chosen, "bootargs", bootargs, sizeof(bootargs));
+	boot_args = bootargs;
+
 	DPRINT(" devmap");
 	pmap_devmap_register(plat->devmap());
 
@@ -179,11 +184,6 @@ initarm(void *arg)
 	if (set_cpufuncs())
 		panic("cpu not recognized!");
 
-	const int chosen = OF_finddevice("/chosen");
-	if (chosen >= 0)
-		OF_getprop(chosen, "bootargs", bootargs, sizeof(bootargs));
-	boot_args = bootargs;
-
 	/*
 	 * If stdout-path is specified on the command line, override the
 	 * value in /chosen/stdout-path before initializing console.



CVS commit: [netbsd-8] src/doc

2017-06-06 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Jun  6 09:31:21 UTC 2017

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

Log Message:
Tickets #9 .. #12


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.4 -r1.1.2.5 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.4 src/doc/CHANGES-8.0:1.1.2.5
--- src/doc/CHANGES-8.0:1.1.2.4	Mon Jun  5 08:21:39 2017
+++ src/doc/CHANGES-8.0	Tue Jun  6 09:31:21 2017
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-8.0,v 1.1.2.4 2017/06/05 08:21:39 snj Exp $
+# $NetBSD: CHANGES-8.0,v 1.1.2.5 2017/06/06 09:31:21 martin Exp $
 
 A complete list of changes from the initial NetBSD 8.0 branch on 2017-06-04
 until the 8.0 release:
@@ -99,3 +99,27 @@ sys/arch/arm/cortex/gic.c			1.22
 	the interrupts
 	[skrll, ticket #8]
 
+usr.sbin/service/service			1.8
+
+	Only match first instance of name and rcvar in file.
+	[sborrill, ticket #9]
+
+sys/arch/mips/mips/pmap_machdep.c		1.20
+
+	Fix the PMAP_NO_PV_UNCACHED pmap_md_vca_add case where the
+	pmap_update call would cause problems for pmap_remove_all
+	case where the deferred activate should not be done...
+
+	Add a comment about what's going on.
+	[skrll, ticket #10]
+
+sys/gdbscripts/cpus1.2-1.3
+
+	Make cpus MI
+	[skrll, ticket #11]
+
+external/bsd/blacklist/bin/blacklistd.conf.5	1.6
+
+	Improve wording.
+	[sevan, ticket #12]
+



CVS commit: [netbsd-8] src/doc

2017-06-06 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Jun  6 09:31:21 UTC 2017

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

Log Message:
Tickets #9 .. #12


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

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



CVS commit: [netbsd-8] src/external/bsd/blacklist/bin

2017-06-06 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Jun  6 09:30:24 UTC 2017

Modified Files:
src/external/bsd/blacklist/bin [netbsd-8]: blacklistd.conf.5

Log Message:
Pull up following revision(s) (requested by sevan in ticket #12):
external/bsd/blacklist/bin/blacklistd.conf.5: revision 1.6
Improve wording.
Bump date.
ok christos


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.5.8.1 src/external/bsd/blacklist/bin/blacklistd.conf.5

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

Modified files:

Index: src/external/bsd/blacklist/bin/blacklistd.conf.5
diff -u src/external/bsd/blacklist/bin/blacklistd.conf.5:1.5 src/external/bsd/blacklist/bin/blacklistd.conf.5:1.5.8.1
--- src/external/bsd/blacklist/bin/blacklistd.conf.5:1.5	Wed Jun  8 12:48:37 2016
+++ src/external/bsd/blacklist/bin/blacklistd.conf.5	Tue Jun  6 09:30:24 2017
@@ -1,4 +1,4 @@
-.\" $NetBSD: blacklistd.conf.5,v 1.5 2016/06/08 12:48:37 wiz Exp $
+.\" $NetBSD: blacklistd.conf.5,v 1.5.8.1 2017/06/06 09:30:24 martin Exp $
 .\"
 .\" Copyright (c) 2015 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 June 7, 2016
+.Dd June 5, 2017
 .Dt BLACKLISTD.CONF 5
 .Os
 .Sh NAME
@@ -36,12 +36,13 @@
 .Sh DESCRIPTION
 The
 .Nm
-files contains configuration lines for
-.Xr blacklistd 8 .
-It contains one entry per line, and is similar to
+files contains configuration entries for
+.Xr blacklistd 8
+in a fashion similar to
 .Xr inetd.conf 5 .
-There must be an entry for each field of the configuration file, with
-entries for each field separated by a tab or a space.
+Only one entry per line is permitted.
+Every entry must have all fields populated.
+Each field can be separated by a tab or a space.
 Comments are denoted by a
 .Dq #
 at the beginning of a line.
@@ -109,7 +110,7 @@ The
 can be an IPv4 address in numeric format, an IPv6 address
 in numeric format and enclosed by square brackets, or an interface name.
 Mask modifiers are not allowed on interfaces because interfaces
-have multiple address in different protocols where the mask has a different
+can have multiple addresses in different protocols where the mask has a different
 size.
 .Pp
 The
@@ -150,8 +151,8 @@ If the
 contains a
 .Dq / ,
 the remaining portion of the name is interpreted as the mask to be
-applied to the address specified in the rule, so one can block whole
-subnets for a single rule violation.
+applied to the address specified in the rule, causing a single rule violation to
+block the entire subnet for the configured prefix.
 .Pp
 The
 .Va nfail
@@ -176,10 +177,11 @@ for days.
 .Pp
 Matching is done first by checking the
 .Va local
-rules one by one, from the most specific to the least specific.
+rules individually, in the order of the most specific to the least specific.
 If a match is found, then the
 .Va remote
-rules are applied, and if a match is found the
+rules are applied.
+The
 .Va name ,
 .Va nfail ,
 and
@@ -191,8 +193,8 @@ rule that matched.
 The
 .Va remote
 rules can be used for whitelisting specific addresses, changing the mask
-size, or the rule that the packet filter uses, the number of failed attempts,
-or the blocked duration.
+size, the rule that the packet filter uses, the number of failed attempts,
+or the block duration.
 .Sh FILES
 .Bl -tag -width /etc/blacklistd.conf -compact
 .It Pa /etc/blacklistd.conf



CVS commit: [netbsd-8] src/external/bsd/blacklist/bin

2017-06-06 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Jun  6 09:30:24 UTC 2017

Modified Files:
src/external/bsd/blacklist/bin [netbsd-8]: blacklistd.conf.5

Log Message:
Pull up following revision(s) (requested by sevan in ticket #12):
external/bsd/blacklist/bin/blacklistd.conf.5: revision 1.6
Improve wording.
Bump date.
ok christos


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.5.8.1 src/external/bsd/blacklist/bin/blacklistd.conf.5

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



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

2017-06-06 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Jun  6 09:28:26 UTC 2017

Modified Files:
src/sys/gdbscripts [netbsd-8]: cpus

Log Message:
Pull up following revision(s) (requested by skrll in ticket #11):
sys/gdbscripts/cpus: revision 1.2
sys/gdbscripts/cpus: revision 1.3
Make cpus MI
Typo in previous


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.1.94.1 src/sys/gdbscripts/cpus

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



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

2017-06-06 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Jun  6 09:28:26 UTC 2017

Modified Files:
src/sys/gdbscripts [netbsd-8]: cpus

Log Message:
Pull up following revision(s) (requested by skrll in ticket #11):
sys/gdbscripts/cpus: revision 1.2
sys/gdbscripts/cpus: revision 1.3
Make cpus MI
Typo in previous


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.1.94.1 src/sys/gdbscripts/cpus

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

Modified files:

Index: src/sys/gdbscripts/cpus
diff -u src/sys/gdbscripts/cpus:1.1 src/sys/gdbscripts/cpus:1.1.94.1
--- src/sys/gdbscripts/cpus:1.1	Wed Feb 20 21:01:23 2008
+++ src/sys/gdbscripts/cpus	Tue Jun  6 09:28:26 2017
@@ -1,10 +1,11 @@
-#	$NetBSD: cpus,v 1.1 2008/02/20 21:01:23 ad Exp $
+#	$NetBSD: cpus,v 1.1.94.1 2017/06/06 09:28:26 martin Exp $
 
 define cpus
-	set $ci = _info_primary
+	set $cpu = 0
 	printf "\t cpu id   curlwp\n"
-	while ($ci != 0)
+	while ($cpu < ncpu)
+		set $ci = cpu_infos[$cpu]
 		printf "%16lx %2d %16lx\n", $ci, $ci->ci_cpuid, $ci->ci_curlwp
-		set $ci = $ci->ci_next
+		set $cpu++
 	end
 end



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

2017-06-06 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Jun  6 09:25:49 UTC 2017

Modified Files:
src/sys/arch/mips/mips [netbsd-8]: pmap_machdep.c

Log Message:
Pull up following revision(s) (requested by skrll in ticket #10):
sys/arch/mips/mips/pmap_machdep.c: revision 1.20
Fix the PMAP_NO_PV_UNCACHED pmap_md_vca_add case where the pmap_update
call would cause problems for pmap_remove_all case where the deferred
activate should not be done...
Add a comment about what's going on.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.19.2.1 src/sys/arch/mips/mips/pmap_machdep.c

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

Modified files:

Index: src/sys/arch/mips/mips/pmap_machdep.c
diff -u src/sys/arch/mips/mips/pmap_machdep.c:1.19 src/sys/arch/mips/mips/pmap_machdep.c:1.19.2.1
--- src/sys/arch/mips/mips/pmap_machdep.c:1.19	Thu May 18 13:20:37 2017
+++ src/sys/arch/mips/mips/pmap_machdep.c	Tue Jun  6 09:25:49 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap_machdep.c,v 1.19 2017/05/18 13:20:37 skrll Exp $	*/
+/*	$NetBSD: pmap_machdep.c,v 1.19.2.1 2017/06/06 09:25:49 martin Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2001 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
 
 #include 
 
-__KERNEL_RCSID(0, "$NetBSD: pmap_machdep.c,v 1.19 2017/05/18 13:20:37 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap_machdep.c,v 1.19.2.1 2017/06/06 09:25:49 martin Exp $");
 
 /*
  *	Manages physical address maps.
@@ -954,7 +954,14 @@ pmap_md_vca_add(struct vm_page *pg, vadd
 		pmap_t npm = npv->pv_pmap;
 		VM_PAGEMD_PVLIST_UNLOCK(mdpg);
 		pmap_remove(npm, nva, nva + PAGE_SIZE);
-		pmap_update(npm);
+
+		/*
+		 * pmap_update is not required here as we're the pmap
+		 * and we know that the invalidation happened or the
+		 * asid has been released (and activation is deferred)
+		 *
+		 * A deferred activation should NOT occur here.
+		 */
 		(void)VM_PAGEMD_PVLIST_LOCK(mdpg);
 
 		npv = pv;



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

2017-06-06 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Jun  6 09:25:49 UTC 2017

Modified Files:
src/sys/arch/mips/mips [netbsd-8]: pmap_machdep.c

Log Message:
Pull up following revision(s) (requested by skrll in ticket #10):
sys/arch/mips/mips/pmap_machdep.c: revision 1.20
Fix the PMAP_NO_PV_UNCACHED pmap_md_vca_add case where the pmap_update
call would cause problems for pmap_remove_all case where the deferred
activate should not be done...
Add a comment about what's going on.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.19.2.1 src/sys/arch/mips/mips/pmap_machdep.c

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



CVS commit: [netbsd-8] src/usr.sbin/service

2017-06-06 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Jun  6 09:20:14 UTC 2017

Modified Files:
src/usr.sbin/service [netbsd-8]: service

Log Message:
Pull up following revision(s) (requested by sborrill in ticket #9):
usr.sbin/service/service: revision 1.8
Only match first instance of name and rcvar in file.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.7.10.1 src/usr.sbin/service/service

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



CVS commit: [netbsd-8] src/usr.sbin/service

2017-06-06 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Jun  6 09:20:14 UTC 2017

Modified Files:
src/usr.sbin/service [netbsd-8]: service

Log Message:
Pull up following revision(s) (requested by sborrill in ticket #9):
usr.sbin/service/service: revision 1.8
Only match first instance of name and rcvar in file.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.7.10.1 src/usr.sbin/service/service

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

Modified files:

Index: src/usr.sbin/service/service
diff -u src/usr.sbin/service/service:1.7 src/usr.sbin/service/service:1.7.10.1
--- src/usr.sbin/service/service:1.7	Sun Apr  5 11:33:15 2015
+++ src/usr.sbin/service/service	Tue Jun  6 09:20:14 2017
@@ -1,5 +1,5 @@
 #!/bin/sh
-#$NetBSD: service,v 1.7 2015/04/05 11:33:15 apb Exp $
+#$NetBSD: service,v 1.7.10.1 2017/06/06 09:20:14 martin Exp $
 #service -- run or list system services
 #
 #  Taken from FreeBSD: releng/10.1/usr.sbin/service/service.sh 268098
@@ -84,8 +84,8 @@ if [ -n "${ENABLED}" ]; then
 _rc_files | $flt | while read file
 do
 if grep -q ^rcvar "$file"; then
-eval $( grep ^name= "$file" )
-eval $( grep ^rcvar "$file" )
+eval $( grep -m 1 ^name= "$file" )
+eval $( grep -m 1 ^rcvar "$file" )
 if [ -n "${rcvar}" ]; then
 load_rc_config ${rcvar}
 checkyesno ${rcvar} 2>/dev/null && echo ${file}



CVS commit: src/tools

2017-06-06 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Jun  6 08:21:53 UTC 2017

Modified Files:
src/tools: Makefile

Log Message:
Disable dtc/libfdt for now


To generate a diff of this commit:
cvs rdiff -u -r1.189 -r1.190 src/tools/Makefile

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



CVS commit: src/tools

2017-06-06 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Jun  6 08:21:53 UTC 2017

Modified Files:
src/tools: Makefile

Log Message:
Disable dtc/libfdt for now


To generate a diff of this commit:
cvs rdiff -u -r1.189 -r1.190 src/tools/Makefile

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

Modified files:

Index: src/tools/Makefile
diff -u src/tools/Makefile:1.189 src/tools/Makefile:1.190
--- src/tools/Makefile:1.189	Mon Jun  5 23:55:43 2017
+++ src/tools/Makefile	Tue Jun  6 08:21:53 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.189 2017/06/05 23:55:43 christos Exp $
+#	$NetBSD: Makefile,v 1.190 2017/06/06 08:21:53 skrll Exp $
 
 .include 
 .include 
@@ -210,8 +210,8 @@ SUBDIR+=	elftosb
 .if ${MACHINE} == "evbarm" || ${MACHINE} == "evbmips" || \
 ${MACHINE} == "evbppc" || ${MACHINE} == "sandpoint"
 SUBDIR+=	mkubootimage
-SUBDIR+=	libfdt .WAIT
-SUBDIR+=	dtc
+#SUBDIR+=	libfdt .WAIT
+#SUBDIR+=	dtc
 .endif
 
 .if ${MKX11} != "no"



CVS commit: src/tools/libfdt

2017-06-06 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Jun  6 07:45:39 UTC 2017

Added Files:
src/tools/libfdt: Makefile

Log Message:
Add libfdt


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/tools/libfdt/Makefile

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

Added files:

Index: src/tools/libfdt/Makefile
diff -u /dev/null src/tools/libfdt/Makefile:1.1
--- /dev/null	Tue Jun  6 07:45:39 2017
+++ src/tools/libfdt/Makefile	Tue Jun  6 07:45:39 2017
@@ -0,0 +1,24 @@
+#	$NetBSD: Makefile,v 1.1 2017/06/06 07:45:39 skrll Exp $
+
+HOSTLIB=	fdt
+
+.include 
+
+LIBFDT_DIR=	${.CURDIR}/../../external/gpl2/dtc/dist/libfdt
+
+.include "${LIBFDT_DIR}/Makefile.libfdt"
+
+SRCS=	${LIBFDT_SRCS}
+
+CPPFLAGS+=	-I${.CURDIR}/../compat -I${LIBFDT_DIR}
+CPPFLAGS+=	-I${TOOLDIR}/include/nbinclude
+
+.PATH:		${LIBFDT_DIR}
+
+CPPFLAGS+=	-DHAVE_NBTOOL_CONFIG_H=1 -D_FILE_OFFSET_BITS=64
+
+HOST_CPPFLAGS:=	${CPPFLAGS} ${HOST_CPPFLAGS}
+CPPFLAGS:=	# empty
+
+.include "${.CURDIR}/../Makefile.nbincludes"
+.include 



CVS commit: src/tools/libfdt

2017-06-06 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Jun  6 07:45:39 UTC 2017

Added Files:
src/tools/libfdt: Makefile

Log Message:
Add libfdt


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/tools/libfdt/Makefile

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



CVS commit: src/sys/dev/pad

2017-06-06 Thread Nathanial Sloss
Module Name:src
Committed By:   nat
Date:   Tue Jun  6 07:32:41 UTC 2017

Modified Files:
src/sys/dev/pad: pad.c

Log Message:
Style change.


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/sys/dev/pad/pad.c

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



CVS commit: src/sys/dev/pad

2017-06-06 Thread Nathanial Sloss
Module Name:src
Committed By:   nat
Date:   Tue Jun  6 07:32:41 UTC 2017

Modified Files:
src/sys/dev/pad: pad.c

Log Message:
Style change.


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/sys/dev/pad/pad.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/pad/pad.c
diff -u src/sys/dev/pad/pad.c:1.35 src/sys/dev/pad/pad.c:1.36
--- src/sys/dev/pad/pad.c:1.35	Tue Jun  6 07:29:35 2017
+++ src/sys/dev/pad/pad.c	Tue Jun  6 07:32:41 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: pad.c,v 1.35 2017/06/06 07:29:35 nat Exp $ */
+/* $NetBSD: pad.c,v 1.36 2017/06/06 07:32:41 nat Exp $ */
 
 /*-
  * Copyright (c) 2007 Jared D. McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pad.c,v 1.35 2017/06/06 07:29:35 nat Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pad.c,v 1.36 2017/06/06 07:32:41 nat Exp $");
 
 #include 
 #include 
@@ -318,9 +318,8 @@ pad_open(dev_t dev, int flags, int fmt, 
 	if (sc == NULL)
 		return ENXIO;
 
-	if (atomic_swap_uint(>sc_open, 1) != 0) {
+	if (atomic_swap_uint(>sc_open, 1) != 0)
 		return EBUSY;
-	}
 	
 	return 0;
 }



CVS commit: src/sys/dev/pad

2017-06-06 Thread Nathanial Sloss
Module Name:src
Committed By:   nat
Date:   Tue Jun  6 07:31:41 UTC 2017

Modified Files:
src/sys/dev/pad: padvar.h

Log Message:
pad blocksize 1024 -> 8192.  Helps when sleeping in rate limiter.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/dev/pad/padvar.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/pad/padvar.h
diff -u src/sys/dev/pad/padvar.h:1.8 src/sys/dev/pad/padvar.h:1.9
--- src/sys/dev/pad/padvar.h:1.8	Sat May 27 10:02:26 2017
+++ src/sys/dev/pad/padvar.h	Tue Jun  6 07:31:40 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: padvar.h,v 1.8 2017/05/27 10:02:26 nat Exp $ */
+/* $NetBSD: padvar.h,v 1.9 2017/06/06 07:31:40 nat Exp $ */
 
 /*-
  * Copyright (c) 2007 Jared D. McNeill 
@@ -44,7 +44,7 @@ typedef struct pad_softc {
 	struct audio_softc *sc_audiodev;
 	int		sc_blksize;
 
-#define PAD_BLKSIZE	1024
+#define PAD_BLKSIZE	8192
 #define PAD_BUFSIZE	65536
 	uint8_t		sc_audiobuf[PAD_BUFSIZE];
 	uint32_t	sc_buflen;



CVS commit: src/sys/dev/pad

2017-06-06 Thread Nathanial Sloss
Module Name:src
Committed By:   nat
Date:   Tue Jun  6 07:31:41 UTC 2017

Modified Files:
src/sys/dev/pad: padvar.h

Log Message:
pad blocksize 1024 -> 8192.  Helps when sleeping in rate limiter.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/dev/pad/padvar.h

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



CVS commit: src/sys/dev/pad

2017-06-06 Thread Nathanial Sloss
Module Name:src
Committed By:   nat
Date:   Tue Jun  6 07:29:35 UTC 2017

Modified Files:
src/sys/dev/pad: pad.c

Log Message:
Simplification of rate limiter.  It now works uni/multiprocessor.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sys/dev/pad/pad.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/pad/pad.c
diff -u src/sys/dev/pad/pad.c:1.34 src/sys/dev/pad/pad.c:1.35
--- src/sys/dev/pad/pad.c:1.34	Tue Jun  6 07:27:15 2017
+++ src/sys/dev/pad/pad.c	Tue Jun  6 07:29:35 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: pad.c,v 1.34 2017/06/06 07:27:15 nat Exp $ */
+/* $NetBSD: pad.c,v 1.35 2017/06/06 07:29:35 nat Exp $ */
 
 /*-
  * Copyright (c) 2007 Jared D. McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pad.c,v 1.34 2017/06/06 07:27:15 nat Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pad.c,v 1.35 2017/06/06 07:29:35 nat Exp $");
 
 #include 
 #include 
@@ -370,10 +370,11 @@ pad_read(dev_t dev, struct uio *uio, int
 		nowusec = (now.tv_sec * 100) + now.tv_usec;
 		lastusec = (sc->sc_last.tv_sec * 100) +
 		 sc->sc_last.tv_usec;
-		if (lastusec + TIMENEXTREAD > nowusec &&
-		 sc->sc_bytes_count >= BYTESTOSLEEP) {
-			sc->sc_remainder +=
-			((lastusec + TIMENEXTREAD) - nowusec);
+		if (lastusec + TIMENEXTREAD > nowusec) {
+			if (sc->sc_bytes_count >= BYTESTOSLEEP) {
+sc->sc_remainder +=
+((lastusec + TIMENEXTREAD) - nowusec);
+			}
 			
 			wait_ticks = (hz * sc->sc_remainder) / 100;
 			if (wait_ticks > 0) {
@@ -381,19 +382,14 @@ pad_read(dev_t dev, struct uio *uio, int
 kpause("padwait", TRUE, wait_ticks,
 >sc_lock);
 			}
+		}
 
+		if (sc->sc_bytes_count >= BYTESTOSLEEP)
 			sc->sc_bytes_count -= BYTESTOSLEEP;
-			getmicrotime(>sc_last);
-		} else if (sc->sc_bytes_count >= BYTESTOSLEEP) {
-			sc->sc_bytes_count -= BYTESTOSLEEP;
-			getmicrotime(>sc_last);
-		} else if (lastusec + TIMENEXTREAD <= nowusec) {
-			getmicrotime(>sc_last);
-			sc->sc_remainder = 0;
-		}
 
 		err = pad_get_block(sc, , min(uio->uio_resid, PAD_BLKSIZE));
 		if (!err) {
+			getmicrotime(>sc_last);
 			sc->sc_bytes_count += pb.pb_len;
 			mutex_exit(>sc_lock);
 			err = uiomove(pb.pb_ptr, pb.pb_len, uio);



CVS commit: src/sys/dev/pad

2017-06-06 Thread Nathanial Sloss
Module Name:src
Committed By:   nat
Date:   Tue Jun  6 07:29:35 UTC 2017

Modified Files:
src/sys/dev/pad: pad.c

Log Message:
Simplification of rate limiter.  It now works uni/multiprocessor.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sys/dev/pad/pad.c

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



CVS commit: [netbsd-8] src/doc

2017-06-06 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Jun  6 07:28:29 UTC 2017

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

Log Message:
PR misc/52274: typo in CHANGES file


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

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



CVS commit: [netbsd-8] src/doc

2017-06-06 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Jun  6 07:28:29 UTC 2017

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

Log Message:
PR misc/52274: typo in CHANGES file


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

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

Modified files:

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.2286 src/doc/CHANGES:1.2286.2.1
--- src/doc/CHANGES:1.2286	Sat May 27 21:05:02 2017
+++ src/doc/CHANGES	Tue Jun  6 07:28:29 2017
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2286 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2286.2.1 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -283,7 +283,7 @@ Changes from NetBSD 7.0 to NetBSD 8.0:
 	wpa_supplicant(8): Added interface matching rules [roy 20160323]
 	lua: Applied second and third patch from http://lua.org/bugs.html
 		[mbalmer 20160325]
-	i366: Add a GENERIC_PAE kernel that supports >4GB systems.  [mrg 20160326]
+	i386: Add a GENERIC_PAE kernel that supports >4GB systems.  [mrg 20160326]
 	network: Drop the concept of cloning/cloned routes [ozaki-r 20160404]
 	network: Remove RTF_CLONING, RTF_XRESOLVE, RTF_LLINFO, RTF_CLONED and
 		RTM_RESOLVE [ozaki-r 20160404]



CVS commit: src/sys/dev/pad

2017-06-06 Thread Nathanial Sloss
Module Name:src
Committed By:   nat
Date:   Tue Jun  6 07:27:15 UTC 2017

Modified Files:
src/sys/dev/pad: pad.c

Log Message:
sc_bytes_count needs to be set in pad_audio_open not pad_open.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/dev/pad/pad.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/pad/pad.c
diff -u src/sys/dev/pad/pad.c:1.33 src/sys/dev/pad/pad.c:1.34
--- src/sys/dev/pad/pad.c:1.33	Tue Jun  6 07:18:38 2017
+++ src/sys/dev/pad/pad.c	Tue Jun  6 07:27:15 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: pad.c,v 1.33 2017/06/06 07:18:38 nat Exp $ */
+/* $NetBSD: pad.c,v 1.34 2017/06/06 07:27:15 nat Exp $ */
 
 /*-
  * Copyright (c) 2007 Jared D. McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pad.c,v 1.33 2017/06/06 07:18:38 nat Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pad.c,v 1.34 2017/06/06 07:27:15 nat Exp $");
 
 #include 
 #include 
@@ -322,10 +322,6 @@ pad_open(dev_t dev, int flags, int fmt, 
 		return EBUSY;
 	}
 	
-	getmicrotime(>sc_last);
-	sc->sc_bytes_count = 0;
-	sc->sc_remainder = 0;
-
 	return 0;
 }
 
@@ -438,6 +434,7 @@ pad_audio_open(void *opaque, int flags)
 		return EIO;
 
 	getmicrotime(>sc_last);
+	sc->sc_bytes_count = 0;
 	sc->sc_remainder = 0;
 
 	return 0;



CVS commit: src/sys/dev/pad

2017-06-06 Thread Nathanial Sloss
Module Name:src
Committed By:   nat
Date:   Tue Jun  6 07:27:15 UTC 2017

Modified Files:
src/sys/dev/pad: pad.c

Log Message:
sc_bytes_count needs to be set in pad_audio_open not pad_open.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/dev/pad/pad.c

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



CVS commit: src/sys/dev/pad

2017-06-06 Thread Nathanial Sloss
Module Name:src
Committed By:   nat
Date:   Tue Jun  6 07:18:38 UTC 2017

Modified Files:
src/sys/dev/pad: pad.c

Log Message:
Express BYTESTOSLEEP as an 64 bit integer.
Use BYTESTOSLEEP in expresson of BYTES_PER_SEC.


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/sys/dev/pad/pad.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/pad/pad.c
diff -u src/sys/dev/pad/pad.c:1.32 src/sys/dev/pad/pad.c:1.33
--- src/sys/dev/pad/pad.c:1.32	Thu Jun  1 09:44:30 2017
+++ src/sys/dev/pad/pad.c	Tue Jun  6 07:18:38 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: pad.c,v 1.32 2017/06/01 09:44:30 pgoyette Exp $ */
+/* $NetBSD: pad.c,v 1.33 2017/06/06 07:18:38 nat Exp $ */
 
 /*-
  * Copyright (c) 2007 Jared D. McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pad.c,v 1.32 2017/06/01 09:44:30 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pad.c,v 1.33 2017/06/06 07:18:38 nat Exp $");
 
 #include 
 #include 
@@ -345,8 +345,8 @@ pad_close(dev_t dev, int flags, int fmt,
 }
 
 #define PAD_BYTES_PER_SEC   (44100 * sizeof(int16_t) * 2)
-#define TIMENEXTREAD	(PAD_BLKSIZE * 100 / PAD_BYTES_PER_SEC)
-#define BYTESTOSLEEP 	(PAD_BLKSIZE)
+#define BYTESTOSLEEP 	(int64_t)(PAD_BLKSIZE)
+#define TIMENEXTREAD	(int64_t)(BYTESTOSLEEP * 100 / PAD_BYTES_PER_SEC)
 
 int
 pad_read(dev_t dev, struct uio *uio, int flags)



CVS commit: src/sys/dev/pad

2017-06-06 Thread Nathanial Sloss
Module Name:src
Committed By:   nat
Date:   Tue Jun  6 07:18:38 UTC 2017

Modified Files:
src/sys/dev/pad: pad.c

Log Message:
Express BYTESTOSLEEP as an 64 bit integer.
Use BYTESTOSLEEP in expresson of BYTES_PER_SEC.


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/sys/dev/pad/pad.c

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



CVS commit: src/doc

2017-06-06 Thread Marc Balmer
Module Name:src
Committed By:   mbalmer
Date:   Tue Jun  6 07:13:06 UTC 2017

Modified Files:
src/doc: CHANGES.prev

Log Message:
Fix a typo, i366 -> i386.
>From PR misc/52274.


To generate a diff of this commit:
cvs rdiff -u -r1.132 -r1.133 src/doc/CHANGES.prev

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



CVS commit: src/doc

2017-06-06 Thread Marc Balmer
Module Name:src
Committed By:   mbalmer
Date:   Tue Jun  6 07:13:06 UTC 2017

Modified Files:
src/doc: CHANGES.prev

Log Message:
Fix a typo, i366 -> i386.
>From PR misc/52274.


To generate a diff of this commit:
cvs rdiff -u -r1.132 -r1.133 src/doc/CHANGES.prev

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

Modified files:

Index: src/doc/CHANGES.prev
diff -u src/doc/CHANGES.prev:1.132 src/doc/CHANGES.prev:1.133
--- src/doc/CHANGES.prev:1.132	Sun Jun  4 07:18:22 2017
+++ src/doc/CHANGES.prev	Tue Jun  6 07:13:06 2017
@@ -1,4 +1,4 @@
-LIST OF CHANGES FROM PREVIOUS RELEASES:			<$Revision: 1.132 $>
+LIST OF CHANGES FROM PREVIOUS RELEASES:			<$Revision: 1.133 $>
 
 
 Changes from 386bsd 0.1 + patchkit 0.2.2 to NetBSD 0.8:
@@ -11983,7 +11983,7 @@ Changes from NetBSD 7.0 to NetBSD 8.0:
 	wpa_supplicant(8): Added interface matching rules [roy 20160323]
 	lua: Applied second and third patch from http://lua.org/bugs.html
 		[mbalmer 20160325]
-	i366: Add a GENERIC_PAE kernel that supports >4GB systems.  [mrg 20160326]
+	i386: Add a GENERIC_PAE kernel that supports >4GB systems.  [mrg 20160326]
 	network: Drop the concept of cloning/cloned routes [ozaki-r 20160404]
 	network: Remove RTF_CLONING, RTF_XRESOLVE, RTF_LLINFO, RTF_CLONED and
 		RTM_RESOLVE [ozaki-r 20160404]