CVS commit: src/bin/sh

2017-07-24 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Mon Jul 24 14:17:12 UTC 2017

Modified Files:
src/bin/sh: jobs.c option.list sh.1

Log Message:
Implement the "pipefail" option (same semantics as in other shells)
to cause (when set, which it is not by default) the exit status of a
pipe to be 0 iff all commands in the pipe exited with status 0, and
otherwise, the status of the rightmost command to exit with a non-0
status.

In the doc, while describing this, also reword some of the text about
commands in general, how they are structured, and when they are executed.


To generate a diff of this commit:
cvs rdiff -u -r1.87 -r1.88 src/bin/sh/jobs.c
cvs rdiff -u -r1.5 -r1.6 src/bin/sh/option.list
cvs rdiff -u -r1.161 -r1.162 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/jobs.c
diff -u src/bin/sh/jobs.c:1.87 src/bin/sh/jobs.c:1.88
--- src/bin/sh/jobs.c:1.87	Sat Jun 17 12:12:50 2017
+++ src/bin/sh/jobs.c	Mon Jul 24 14:17:11 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: jobs.c,v 1.87 2017/06/17 12:12:50 kre Exp $	*/
+/*	$NetBSD: jobs.c,v 1.88 2017/07/24 14:17:11 kre Exp $	*/
 
 /*-
  * Copyright (c) 1991, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)jobs.c	8.5 (Berkeley) 5/4/95";
 #else
-__RCSID("$NetBSD: jobs.c,v 1.87 2017/06/17 12:12:50 kre Exp $");
+__RCSID("$NetBSD: jobs.c,v 1.88 2017/07/24 14:17:11 kre Exp $");
 #endif
 #endif /* not lint */
 
@@ -649,7 +649,17 @@ waitcmd(int argc, char **argv)
 			if (dowait(WBLOCK|WNOFREE, job) == -1)
 			   return 128 + lastsig();
 		}
-		status = job->ps[job->nprocs ? job->nprocs - 1 : 0].status;
+		if (pipefail && job->nprocs) {
+			int i;
+
+			status = 0;
+			for (i = 0; i < job->nprocs; i++)
+if (job->ps[i].status != 0)
+	status = job->ps[i].status;
+		} else
+			status =
+			job->ps[job->nprocs ? job->nprocs - 1 : 0].status;
+
 		if (WIFEXITED(status))
 			retval = WEXITSTATUS(status);
 #if JOBS
@@ -1013,7 +1023,13 @@ waitforjob(struct job *jp)
 	if (jp->state == JOBSTOPPED && curjob != jp - jobtab)
 		set_curjob(jp, 2);
 #endif
-	status = jp->ps[jp->nprocs - 1].status;
+	if (pipefail) {
+		status = 0;
+		for (st = 0; st < jp->nprocs; st++)
+			if (jp->ps[st].status != 0)
+status = jp->ps[st].status;
+	} else
+		status = jp->ps[jp->nprocs - 1].status;
 	/* convert to 8 bits */
 	if (WIFEXITED(status))
 		st = WEXITSTATUS(status);

Index: src/bin/sh/option.list
diff -u src/bin/sh/option.list:1.5 src/bin/sh/option.list:1.6
--- src/bin/sh/option.list:1.5	Fri Jun 30 23:02:56 2017
+++ src/bin/sh/option.list	Mon Jul 24 14:17:11 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: option.list,v 1.5 2017/06/30 23:02:56 kre Exp $ */
+/* $NetBSD: option.list,v 1.6 2017/07/24 14:17:11 kre Exp $ */
 
 /*
  * define the shell's settable options
@@ -65,6 +65,7 @@ posix	posix# be closer to POSIX comp
 qflag	quietprofile	q		# disable -v/-x in startup files
 fnline1	local_lineno	L on		# number lines in funcs starting at 1
 promptcmds promptcmds			# allow $( ) in PS1 (et al).
+pipefail pipefail			# pipe exit status
 
 // editline/history related options ("vi" is standard, 'V' and others are not)
 // only one of vi/emacs can be set, hence the "set" definition, value

Index: src/bin/sh/sh.1
diff -u src/bin/sh/sh.1:1.161 src/bin/sh/sh.1:1.162
--- src/bin/sh/sh.1:1.161	Mon Jul 24 13:21:14 2017
+++ src/bin/sh/sh.1	Mon Jul 24 14:17:11 2017
@@ -1,4 +1,4 @@
-.\"	$NetBSD: sh.1,v 1.161 2017/07/24 13:21:14 kre Exp $
+.\"	$NetBSD: sh.1,v 1.162 2017/07/24 14:17:11 kre Exp $
 .\" Copyright (c) 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
 .\"
@@ -453,6 +453,12 @@ in the
 .Sx Built-ins
 section.)
 (Not implemented.)
+.It "\ \ " Em pipefail
+If set, the way the exit status of a pipeline is determined
+is altered.
+See
+.Sx Pipelines
+below for the details.
 .It "\ \ " Em posix
 Enables closer adherence to the POSIX shell standard.
 This option will default set at shell startup if the
@@ -822,22 +828,26 @@ is returned.
 .Ss Complex Commands
 Complex commands are combinations of simple commands with control
 operators or reserved words, together creating a larger complex command.
-More generally, a command is one of the following:
-.Bl -bullet
-.It
-simple command
-.It
-pipeline
-.It
-list or compound-list
-.It
-compound command
-.It
-function definition
+Overall, a shell program is a:
+.Bl -tag -width XpipelineX
+.It list
+Which is a sequence of one or more AND-OR lists. 
+.It "AND-OR list"
+is a sequence of one or more pipelines.
+.It pipeline
+is a sequence of one or more commands.
+.It command
+is one of a simple command, a compound command, or a function definition.
+.It "simple command"
+has been explained above, and is the basic building block.
+.It "compound command"
+provides mechanisms to group lists to achieve different effects.
+.It "function definition"
+allows new simple commands to be created as groupings of 

CVS commit: src/bin/sh

2017-07-24 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Mon Jul 24 14:17:12 UTC 2017

Modified Files:
src/bin/sh: jobs.c option.list sh.1

Log Message:
Implement the "pipefail" option (same semantics as in other shells)
to cause (when set, which it is not by default) the exit status of a
pipe to be 0 iff all commands in the pipe exited with status 0, and
otherwise, the status of the rightmost command to exit with a non-0
status.

In the doc, while describing this, also reword some of the text about
commands in general, how they are structured, and when they are executed.


To generate a diff of this commit:
cvs rdiff -u -r1.87 -r1.88 src/bin/sh/jobs.c
cvs rdiff -u -r1.5 -r1.6 src/bin/sh/option.list
cvs rdiff -u -r1.161 -r1.162 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/bin/sh

2017-07-24 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Mon Jul 24 13:36:15 UTC 2017

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

Log Message:
NFC: DEBUG mode only change - add a little more tracing.


To generate a diff of this commit:
cvs rdiff -u -r1.65 -r1.66 src/bin/sh/var.c

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-07-24 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Mon Jul 24 13:36:15 UTC 2017

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

Log Message:
NFC: DEBUG mode only change - add a little more tracing.


To generate a diff of this commit:
cvs rdiff -u -r1.65 -r1.66 src/bin/sh/var.c

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

Modified files:

Index: src/bin/sh/var.c
diff -u src/bin/sh/var.c:1.65 src/bin/sh/var.c:1.66
--- src/bin/sh/var.c:1.65	Wed Jul 12 19:06:16 2017
+++ src/bin/sh/var.c	Mon Jul 24 13:36:15 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: var.c,v 1.65 2017/07/12 19:06:16 kre Exp $	*/
+/*	$NetBSD: var.c,v 1.66 2017/07/24 13:36:15 kre Exp $	*/
 
 /*-
  * Copyright (c) 1991, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)var.c	8.3 (Berkeley) 5/4/95";
 #else
-__RCSID("$NetBSD: var.c,v 1.65 2017/07/12 19:06:16 kre Exp $");
+__RCSID("$NetBSD: var.c,v 1.66 2017/07/24 13:36:15 kre Exp $");
 #endif
 #endif /* not lint */
 
@@ -422,10 +422,13 @@ setvareq(char *s, int flags)
 	struct var *vp, **vpp;
 	int nlen;
 
+	VTRACE(DBG_VARS, ("setvareq([%s],%#x) aflag=%d ", s, flags, aflag));
 	if (aflag && !(flags & VNOEXPORT))
 		flags |= VEXPORT;
 	vp = find_var(s, , );
 	if (vp != NULL) {
+		VTRACE(DBG_VARS, ("was [%s] fl:%#x\n", vp->text,
+		vp->flags));
 		if (vp->flags & VREADONLY) {
 			if ((flags & (VTEXTFIXED|VSTACK)) == 0)
 ckfree(s);
@@ -465,6 +468,7 @@ setvareq(char *s, int flags)
 		INTON;
 		return;
 	}
+	VTRACE(DBG_VARS, ("new\n"));
 	/* not found */
 	if (flags & VNOSET) {
 		if ((flags & (VTEXTFIXED|VSTACK)) == 0)



CVS commit: src/sys/arch

2017-07-24 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Mon Jul 24 19:37:41 UTC 2017

Modified Files:
src/sys/arch/arm/cortex: a9_mpsubr.S
src/sys/arch/evbarm/conf: mk.sunxi

Log Message:
Replace assembler flags with .arch* annotation.


To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 src/sys/arch/arm/cortex/a9_mpsubr.S
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/evbarm/conf/mk.sunxi

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

Modified files:

Index: src/sys/arch/arm/cortex/a9_mpsubr.S
diff -u src/sys/arch/arm/cortex/a9_mpsubr.S:1.48 src/sys/arch/arm/cortex/a9_mpsubr.S:1.49
--- src/sys/arch/arm/cortex/a9_mpsubr.S:1.48	Wed Jul  5 20:53:40 2017
+++ src/sys/arch/arm/cortex/a9_mpsubr.S	Mon Jul 24 19:37:41 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: a9_mpsubr.S,v 1.48 2017/07/05 20:53:40 skrll Exp $	*/
+/*	$NetBSD: a9_mpsubr.S,v 1.49 2017/07/24 19:37:41 joerg Exp $	*/
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -50,6 +50,10 @@
 	blx	ip
 #endif
 
+#if defined(CPU_CORTEXA7) || defined(CPU_CORTEXA15) || defined(CPU_CORTEXA17)
+	.arch		armv7a
+	.arch_extension virt
+#endif
 
 // We'll modify va and pa at run time so we can use relocatable addresses.
 #define MMU_INIT(va,pa,n_sec,attr) \

Index: src/sys/arch/evbarm/conf/mk.sunxi
diff -u src/sys/arch/evbarm/conf/mk.sunxi:1.1 src/sys/arch/evbarm/conf/mk.sunxi:1.2
--- src/sys/arch/evbarm/conf/mk.sunxi:1.1	Wed Jun 28 23:51:29 2017
+++ src/sys/arch/evbarm/conf/mk.sunxi	Mon Jul 24 19:37:41 2017
@@ -1,11 +1,8 @@
-#	$NetBSD: mk.sunxi,v 1.1 2017/06/28 23:51:29 jmcneill Exp $
+#	$NetBSD: mk.sunxi,v 1.2 2017/07/24 19:37:41 joerg Exp $
 
 SYSTEM_FIRST_OBJ=	sunxi_start.o
 SYSTEM_FIRST_SFILE=	${THISARM}/sunxi/sunxi_start.S
 
-AFLAGS.sunxi_start.S+=	-Wa,-march=armv7-a+virt
-AFLAGS.psci_arm.S+=	-Wa,-march=armv7-a+sec+virt
-
 GENASSYM_EXTRAS+=	${THISARM}/sunxi/genassym.cf
 
 _OSRELEASE!=		${HOST_SH} $S/conf/osrelease.sh



CVS commit: src/sys/sys

2017-07-24 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon Jul 24 19:22:32 UTC 2017

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

Log Message:
Use __BIT(3) for bit values.  No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/sys/extent.h

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

Modified files:

Index: src/sys/sys/extent.h
diff -u src/sys/sys/extent.h:1.19 src/sys/sys/extent.h:1.20
--- src/sys/sys/extent.h:1.19	Fri Jan 27 18:53:10 2012
+++ src/sys/sys/extent.h	Mon Jul 24 19:22:32 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: extent.h,v 1.19 2012/01/27 18:53:10 para Exp $	*/
+/*	$NetBSD: extent.h,v 1.20 2017/07/24 19:22:32 skrll Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1998 The NetBSD Foundation, Inc.
@@ -66,21 +66,21 @@ struct extent_fixed {
 };
 
 /* ex_flags; for internal use only */
-#define EXF_FIXED	0x01		/* extent uses fixed storage */
-#define EXF_NOCOALESCE	0x02		/* coalescing of regions not allowed */
-#define EXF_FLWANTED	0x08		/* someone asleep on freelist */
+#define EXF_FIXED	__BIT(1)	/* extent uses fixed storage */
+#define EXF_NOCOALESCE	__BIT(2)	/* coalescing of regions not allowed */
+#define EXF_FLWANTED	__BIT(4)	/* someone asleep on freelist */
 
 #define EXF_BITS	"\20\4FLWANTED\2NOCOALESCE\1FIXED"
 
 /* misc. flags passed to extent functions */
-#define EX_NOWAIT	0x00		/* not safe to sleep */
-#define EX_WAITOK	0x01		/* safe to sleep */
-#define EX_FAST		0x02		/* take first fit in extent_alloc() */
-#define EX_CATCH	0x04		/* catch signals while sleeping */
-#define EX_NOCOALESCE	0x08		/* create a non-coalescing extent */
-#define EX_MALLOCOK	0x10		/* safe to call kmem_alloc() */
-#define EX_WAITSPACE	0x20		/* wait for space to become free */
-#define EX_BOUNDZERO	0x40		/* boundary lines start at 0 */
+#define EX_NOWAIT	0		/* not safe to sleep */
+#define EX_WAITOK	__BIT(1)	/* safe to sleep */
+#define EX_FAST		__BIT(2)	/* take first fit in extent_alloc() */
+#define EX_CATCH	__BIT(3)	/* catch signals while sleeping */
+#define EX_NOCOALESCE	__BIT(4)	/* create a non-coalescing extent */
+#define EX_MALLOCOK	__BIT(5)	/* safe to call kmem_alloc() */
+#define EX_WAITSPACE	__BIT(6)	/* wait for space to become free */
+#define EX_BOUNDZERO	__BIT(7)	/* boundary lines start at 0 */
 
 /*
  * Special place holders for "alignment" and "boundary" arguments,



CVS commit: src/sys/sys

2017-07-24 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon Jul 24 19:22:32 UTC 2017

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

Log Message:
Use __BIT(3) for bit values.  No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/sys/extent.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

2017-07-24 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Mon Jul 24 19:37:41 UTC 2017

Modified Files:
src/sys/arch/arm/cortex: a9_mpsubr.S
src/sys/arch/evbarm/conf: mk.sunxi

Log Message:
Replace assembler flags with .arch* annotation.


To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 src/sys/arch/arm/cortex/a9_mpsubr.S
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/evbarm/conf/mk.sunxi

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



CVS commit: src/sys

2017-07-24 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon Jul 24 19:56:07 UTC 2017

Modified Files:
src/sys/kern: subr_extent.c
src/sys/sys: extent.h

Log Message:
Add a condition variable (ex_flwanted) to struct extent so that ex_flags
becomes an invariant.

Remove strange locking for ex_flags as a result.


To generate a diff of this commit:
cvs rdiff -u -r1.80 -r1.81 src/sys/kern/subr_extent.c
cvs rdiff -u -r1.20 -r1.21 src/sys/sys/extent.h

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



CVS commit: src/sys

2017-07-24 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon Jul 24 19:56:07 UTC 2017

Modified Files:
src/sys/kern: subr_extent.c
src/sys/sys: extent.h

Log Message:
Add a condition variable (ex_flwanted) to struct extent so that ex_flags
becomes an invariant.

Remove strange locking for ex_flags as a result.


To generate a diff of this commit:
cvs rdiff -u -r1.80 -r1.81 src/sys/kern/subr_extent.c
cvs rdiff -u -r1.20 -r1.21 src/sys/sys/extent.h

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

Modified files:

Index: src/sys/kern/subr_extent.c
diff -u src/sys/kern/subr_extent.c:1.80 src/sys/kern/subr_extent.c:1.81
--- src/sys/kern/subr_extent.c:1.80	Mon Dec 19 13:02:14 2016
+++ src/sys/kern/subr_extent.c	Mon Jul 24 19:56:07 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: subr_extent.c,v 1.80 2016/12/19 13:02:14 cherry Exp $	*/
+/*	$NetBSD: subr_extent.c,v 1.81 2017/07/24 19:56:07 skrll Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1998, 2007 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: subr_extent.c,v 1.80 2016/12/19 13:02:14 cherry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_extent.c,v 1.81 2017/07/24 19:56:07 skrll Exp $");
 
 #ifdef _KERNEL
 #ifdef _KERNEL_OPT
@@ -126,17 +126,9 @@ static struct extent_region *
 extent_alloc_region_descriptor(struct extent *ex, int flags)
 {
 	struct extent_region *rp;
-	int exflags, error;
-
-	/*
-	 * XXX Make a static, create-time flags word, so we don't
-	 * XXX have to lock to read it!
-	 */
-	mutex_enter(>ex_lock);
-	exflags = ex->ex_flags;
-	mutex_exit(>ex_lock);
+	int error;
 
-	if (exflags & EXF_FIXED) {
+	if (ex->ex_flags & EXF_FIXED) {
 		struct extent_fixed *fex = (struct extent_fixed *)ex;
 
 		mutex_enter(>ex_lock);
@@ -160,7 +152,7 @@ extent_alloc_region_descriptor(struct ex
 mutex_exit(>ex_lock);
 return (NULL);
 			}
-			ex->ex_flags |= EXF_FLWANTED;
+			ex->ex_flwanted = true;
 			if ((flags & EX_CATCH) != 0)
 error = cv_wait_sig(>ex_cv, >ex_lock);
 			else {
@@ -199,7 +191,7 @@ extent_free_region_descriptor(struct ext
 		 * just free'ing it back to the system.
 		 */
 		if (rp->er_flags & ER_ALLOC) {
-			if (ex->ex_flags & EXF_FLWANTED) {
+			if (ex->ex_flwanted) {
 /* Clear all but ER_ALLOC flag. */
 rp->er_flags = ER_ALLOC;
 LIST_INSERT_HEAD(>fex_freelist, rp,
@@ -214,7 +206,7 @@ extent_free_region_descriptor(struct ext
 		}
 
  wake_em_up:
-		ex->ex_flags &= ~EXF_FLWANTED;
+		ex->ex_flwanted = false;
 		cv_broadcast(>ex_cv);
 		return;
 	}
@@ -300,6 +292,7 @@ extent_create(const char *name, u_long s
 	ex->ex_start = start;
 	ex->ex_end = end;
 	ex->ex_flags = 0;
+	ex->ex_flwanted = false;
 	if (fixed_extent)
 		ex->ex_flags |= EXF_FIXED;
 	if (flags & EX_NOCOALESCE)
@@ -1009,7 +1002,6 @@ extent_free(struct extent *ex, u_long st
 {
 	struct extent_region *rp, *nrp = NULL;
 	u_long end = start + (size - 1);
-	int coalesce;
 
 #ifdef DIAGNOSTIC
 	/*
@@ -1040,13 +1032,8 @@ extent_free(struct extent *ex, u_long st
 	/*
 	 * If we're allowing coalescing, we must allocate a region
 	 * descriptor now, since it might block.
-	 *
-	 * XXX Make a static, create-time flags word, so we don't
-	 * XXX have to lock to read it!
 	 */
-	mutex_enter(>ex_lock);
-	coalesce = (ex->ex_flags & EXF_NOCOALESCE) == 0;
-	mutex_exit(>ex_lock);
+	const bool coalesce = (ex->ex_flags & EXF_NOCOALESCE) == 0;
 
 	if (coalesce) {
 		/* Allocate a region descriptor. */

Index: src/sys/sys/extent.h
diff -u src/sys/sys/extent.h:1.20 src/sys/sys/extent.h:1.21
--- src/sys/sys/extent.h:1.20	Mon Jul 24 19:22:32 2017
+++ src/sys/sys/extent.h	Mon Jul 24 19:56:07 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: extent.h,v 1.20 2017/07/24 19:22:32 skrll Exp $	*/
+/*	$NetBSD: extent.h,v 1.21 2017/07/24 19:56:07 skrll Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1998 The NetBSD Foundation, Inc.
@@ -55,6 +55,7 @@ struct extent {
 	u_long	ex_start;		/* start of extent */
 	u_long	ex_end;			/* end of extent */
 	int	ex_flags;		/* misc. information */
+	bool	ex_flwanted;		/* someone asleep on freelist */
 };
 
 struct extent_fixed {



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

2017-07-24 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Mon Jul 24 06:15:54 UTC 2017

Modified Files:
src/libexec/ld.elf_so [netbsd-8]: rtld.h

Log Message:
Pull up following revision(s) (requested by joerg in ticket #126):
libexec/ld.elf_so/rtld.h: revision 1.128
Drop comments about symbol exporting, the relevant code is gone.


To generate a diff of this commit:
cvs rdiff -u -r1.126.6.1 -r1.126.6.2 src/libexec/ld.elf_so/rtld.h

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

Modified files:

Index: src/libexec/ld.elf_so/rtld.h
diff -u src/libexec/ld.elf_so/rtld.h:1.126.6.1 src/libexec/ld.elf_so/rtld.h:1.126.6.2
--- src/libexec/ld.elf_so/rtld.h:1.126.6.1	Tue Jul  4 12:47:58 2017
+++ src/libexec/ld.elf_so/rtld.h	Mon Jul 24 06:15:54 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: rtld.h,v 1.126.6.1 2017/07/04 12:47:58 martin Exp $	 */
+/*	$NetBSD: rtld.h,v 1.126.6.2 2017/07/24 06:15:54 snj Exp $	 */
 
 /*
  * Copyright 1996 John D. Polstra.
@@ -345,8 +345,6 @@ extern Elf_Sym _rtld_sym_zero;
 #define	RTLD_STATIC_TLS_RESERVATION	64
 
 /* rtld.c */
-
-/* We export these symbols using _rtld_symbol_lookup and is_exported. */
 __dso_public char *dlerror(void);
 __dso_public void *dlopen(const char *, int);
 __dso_public void *dlsym(void *, const char *);
@@ -416,7 +414,6 @@ Elf_Addr _rtld_resolve_ifunc(const Obj_E
 Obj_Entry *_rtld_load_library(const char *, const Obj_Entry *, int);
 
 /* symbol.c */
-bool _rtld_is_exported(const Elf_Sym *);
 unsigned long _rtld_elf_hash(const char *);
 const Elf_Sym *_rtld_symlook_obj(const char *, unsigned long,
 const Obj_Entry *, u_int, const Ver_Entry *);



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

2017-07-24 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Mon Jul 24 06:15:54 UTC 2017

Modified Files:
src/libexec/ld.elf_so [netbsd-8]: rtld.h

Log Message:
Pull up following revision(s) (requested by joerg in ticket #126):
libexec/ld.elf_so/rtld.h: revision 1.128
Drop comments about symbol exporting, the relevant code is gone.


To generate a diff of this commit:
cvs rdiff -u -r1.126.6.1 -r1.126.6.2 src/libexec/ld.elf_so/rtld.h

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



CVS commit: [netbsd-8] src

2017-07-24 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Mon Jul 24 06:03:42 UTC 2017

Modified Files:
src/sys/uvm [netbsd-8]: uvm_fault.c
src/tests/lib/libc/sys [netbsd-8]: t_write.c

Log Message:
Pull up following revision(s) (requested by kamil in ticket #120):
sys/uvm/uvm_fault.c: revision 1.200
tests/lib/libc/sys/t_write.c: revision 1.4-1.6
PR/52384: make uvm_fault_check() return EFAULT not EACCES, like our man
pages
(but not OpenGroup which does not document EFAULT for read/write, and onl=
y
documents EACCES for sockets) say for read/write.
--
check for EFAULT on reads and writes to memory with not permission.
--
add munmap
#define for const.
--
add another missing munmap (Kamil)


To generate a diff of this commit:
cvs rdiff -u -r1.199 -r1.199.6.1 src/sys/uvm/uvm_fault.c
cvs rdiff -u -r1.3 -r1.3.6.1 src/tests/lib/libc/sys/t_write.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/uvm/uvm_fault.c
diff -u src/sys/uvm/uvm_fault.c:1.199 src/sys/uvm/uvm_fault.c:1.199.6.1
--- src/sys/uvm/uvm_fault.c:1.199	Mon Mar 20 15:51:41 2017
+++ src/sys/uvm/uvm_fault.c	Mon Jul 24 06:03:42 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_fault.c,v 1.199 2017/03/20 15:51:41 skrll Exp $	*/
+/*	$NetBSD: uvm_fault.c,v 1.199.6.1 2017/07/24 06:03:42 snj Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uvm_fault.c,v 1.199 2017/03/20 15:51:41 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_fault.c,v 1.199.6.1 2017/07/24 06:03:42 snj Exp $");
 
 #include "opt_uvmhist.h"
 
@@ -950,7 +950,7 @@ uvm_fault_check(
 		"<- protection failure (prot=%#x, access=%#x)",
 		ufi->entry->protection, flt->access_type, 0, 0);
 		uvmfault_unlockmaps(ufi, false);
-		return EACCES;
+		return EFAULT;
 	}
 
 	/*

Index: src/tests/lib/libc/sys/t_write.c
diff -u src/tests/lib/libc/sys/t_write.c:1.3 src/tests/lib/libc/sys/t_write.c:1.3.6.1
--- src/tests/lib/libc/sys/t_write.c:1.3	Fri Jan 13 19:27:23 2017
+++ src/tests/lib/libc/sys/t_write.c	Mon Jul 24 06:03:42 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: t_write.c,v 1.3 2017/01/13 19:27:23 christos Exp $ */
+/* $NetBSD: t_write.c,v 1.3.6.1 2017/07/24 06:03:42 snj Exp $ */
 
 /*-
  * Copyright (c) 2001, 2008 The NetBSD Foundation, Inc.
@@ -29,9 +29,10 @@
 #include 
 __COPYRIGHT("@(#) Copyright (c) 2008\
  The NetBSD Foundation, inc. All rights reserved.");
-__RCSID("$NetBSD: t_write.c,v 1.3 2017/01/13 19:27:23 christos Exp $");
+__RCSID("$NetBSD: t_write.c,v 1.3.6.1 2017/07/24 06:03:42 snj Exp $");
 
 #include 
+#include 
 
 #include 
 #include 
@@ -42,6 +43,7 @@ __RCSID("$NetBSD: t_write.c,v 1.3 2017/0
 #include 
 #include 
 #include 
+#include 
 
 static void		 sighandler(int);
 
@@ -213,6 +215,60 @@ ATF_TC_BODY(writev_iovmax, tc)
 	ATF_REQUIRE_EQ_MSG(errno, EINVAL, "got: %s", strerror(errno));
 }
 
+ATF_TC(write_fault);
+
+ATF_TC_HEAD(write_fault, tc)
+{
+	atf_tc_set_md_var(tc, "descr",
+	"Check that writing to non-permitted space returns EFAULT");
+}
+
+#define SIZE 8192
+
+ATF_TC_BODY(write_fault, tc)
+{
+	int fd[2];
+	ATF_REQUIRE(pipe(fd) != -1);
+	// Can't use /dev/null cause it doesn't access the buffer.
+
+	void *map = mmap(NULL, SIZE, PROT_NONE, MAP_ANON | MAP_PRIVATE, -1, 0);  
+	ATF_REQUIRE(map != MAP_FAILED);
+
+	ssize_t retval = write(fd[1], map, SIZE); 
+
+	ATF_REQUIRE_EQ_MSG(retval, -1, "got: %zd", retval);
+	ATF_REQUIRE_EQ_MSG(errno, EFAULT, "got: %s", strerror(errno));
+
+	munmap(map, SIZE);
+	close(fd[0]); 
+	close(fd[1]); 
+}
+
+ATF_TC(read_fault);
+
+ATF_TC_HEAD(read_fault, tc)
+{
+	atf_tc_set_md_var(tc, "descr",
+	"Check that reading from non-permitted space returns EFAULT");
+}
+
+ATF_TC_BODY(read_fault, tc)
+{
+	int fd = open(_PATH_DEVZERO, O_RDONLY);
+	ATF_REQUIRE(fd != -1);
+
+	void *map = mmap(NULL, SIZE, PROT_NONE, MAP_ANON | MAP_PRIVATE, -1, 0);  
+	ATF_REQUIRE(map != MAP_FAILED);
+
+	ssize_t retval = read(fd, map, SIZE); 
+
+	ATF_REQUIRE_EQ_MSG(retval, -1, "got: %zd", retval);
+	ATF_REQUIRE_EQ_MSG(errno, EFAULT, "got: %s", strerror(errno));
+
+	munmap(map, SIZE);
+	close(fd); 
+}
+
 ATF_TP_ADD_TCS(tp)
 {
 
@@ -221,6 +277,8 @@ ATF_TP_ADD_TCS(tp)
 	ATF_TP_ADD_TC(tp, write_pos);
 	ATF_TP_ADD_TC(tp, write_ret);
 	ATF_TP_ADD_TC(tp, writev_iovmax);
+	ATF_TP_ADD_TC(tp, write_fault);
+	ATF_TP_ADD_TC(tp, read_fault);
 
 	return atf_no_error();
 }



CVS commit: [netbsd-8] src

2017-07-24 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Mon Jul 24 06:03:42 UTC 2017

Modified Files:
src/sys/uvm [netbsd-8]: uvm_fault.c
src/tests/lib/libc/sys [netbsd-8]: t_write.c

Log Message:
Pull up following revision(s) (requested by kamil in ticket #120):
sys/uvm/uvm_fault.c: revision 1.200
tests/lib/libc/sys/t_write.c: revision 1.4-1.6
PR/52384: make uvm_fault_check() return EFAULT not EACCES, like our man
pages
(but not OpenGroup which does not document EFAULT for read/write, and onl=
y
documents EACCES for sockets) say for read/write.
--
check for EFAULT on reads and writes to memory with not permission.
--
add munmap
#define for const.
--
add another missing munmap (Kamil)


To generate a diff of this commit:
cvs rdiff -u -r1.199 -r1.199.6.1 src/sys/uvm/uvm_fault.c
cvs rdiff -u -r1.3 -r1.3.6.1 src/tests/lib/libc/sys/t_write.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-07-24 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Mon Jul 24 06:20:34 UTC 2017

Modified Files:
src/sys/conf [netbsd-8]: Makefile.kern.inc
Added Files:
src/sys/arch/arm/dts [netbsd-8]: sun8i-h3-nanopi-neo.dts
sun8i-h3-orangepi-plus2e.dts sun8i-h3.dtsi

Log Message:
Pull up following revision(s) (requested by jmcneill in ticket #128):
sys/conf/Makefile.kern.inc: revision 1.259
sys/arch/arm/dts/sun8i-h3-orangepi-plus2e.dts: revision 1.1
sys/arch/arm/dts/sun8i-h3.dtsi: revision 1.1
sys/arch/arm/dts/sun8i-h3-nanopi-neo.dts: revision 1.1
Add support for dts files outside of external/gpl2.
--
Add local patches to sun8i-h3-orangepi-plus2e and sun8i-h3-nanopi-neo to
enable ethernet support.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1.4.2 src/sys/arch/arm/dts/sun8i-h3-nanopi-neo.dts \
src/sys/arch/arm/dts/sun8i-h3-orangepi-plus2e.dts \
src/sys/arch/arm/dts/sun8i-h3.dtsi
cvs rdiff -u -r1.256.8.1 -r1.256.8.2 src/sys/conf/Makefile.kern.inc

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

Modified files:

Index: src/sys/conf/Makefile.kern.inc
diff -u src/sys/conf/Makefile.kern.inc:1.256.8.1 src/sys/conf/Makefile.kern.inc:1.256.8.2
--- src/sys/conf/Makefile.kern.inc:1.256.8.1	Tue Jul 18 19:13:09 2017
+++ src/sys/conf/Makefile.kern.inc	Mon Jul 24 06:20:33 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.kern.inc,v 1.256.8.1 2017/07/18 19:13:09 snj Exp $
+#	$NetBSD: Makefile.kern.inc,v 1.256.8.2 2017/07/24 06:20:33 snj Exp $
 #
 # This file contains common `MI' targets and definitions and it is included
 # at the bottom of each `MD' ${MACHINE}/conf/Makefile.${MACHINE}.
@@ -537,17 +537,18 @@ build_kernel: .USE
 # Begin DTS handling
 
 DTSINC?=$S/external/gpl2/dts/dist/include
-DTSPATH?=$S/external/gpl2/dts/dist/arch/${MACHINE_CPU}/boot/dts
+DTSGNUPATH?=$S/external/gpl2/dts/dist/arch/${MACHINE_CPU}/boot/dts
+DTSPATH?=$S/arch/${MACHINE_CPU}/dts
 DTSPADDING?=1024
 
 .SUFFIXES: .dtb .dts
 .dts.dtb:
-	${CPP} -P -xassembler-with-cpp -I ${DTSINC} -I ${DTSPATH} \
+	${CPP} -P -xassembler-with-cpp -I ${DTSINC} -I ${DTSPATH} -I ${DTSGNUPATH} \
 	-include ${.IMPSRC} /dev/null | \
-	${TOOL_DTC} -i ${DTSINC} -i ${DTSPATH} -I dts -O dtb \
+	${TOOL_DTC} -i ${DTSINC} -i ${DTSPATH} -i ${DTSGNUPATH} -I dts -O dtb \
 	-p ${DTSPADDING} -b 0 -o ${.TARGET}
 
-.PATH.dts: ${DTSPATH}
+.PATH.dts: ${DTSPATH} ${DTSGNUPATH}
 
 DTB= ${DTS:.dts=.dtb}
 all: ${DTB}

Added files:

Index: src/sys/arch/arm/dts/sun8i-h3-nanopi-neo.dts
diff -u /dev/null src/sys/arch/arm/dts/sun8i-h3-nanopi-neo.dts:1.1.4.2
--- /dev/null	Mon Jul 24 06:20:34 2017
+++ src/sys/arch/arm/dts/sun8i-h3-nanopi-neo.dts	Mon Jul 24 06:20:33 2017
@@ -0,0 +1,43 @@
+/* $NetBSD: sun8i-h3-nanopi-neo.dts,v 1.1.4.2 2017/07/24 06:20:33 snj Exp $ */
+
+/*-
+ * Copyright (c) 2017 Jared McNeill 
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include "../../../external/gpl2/dts/dist/arch/arm/boot/dts/sun8i-h3-nanopi-neo.dts"
+#include "sun8i-h3.dtsi"
+
+ {
+	phy-mode = "mii";
+	phy = <>;
+
+	allwinner,use-internal-phy;
+	allwinner,leds-active-low;
+	status = "okay";
+
+	phy1: ethernet-phy@1 {
+		reg = <1>;
+	};
+};
Index: src/sys/arch/arm/dts/sun8i-h3-orangepi-plus2e.dts
diff -u /dev/null src/sys/arch/arm/dts/sun8i-h3-orangepi-plus2e.dts:1.1.4.2
--- /dev/null	Mon Jul 24 06:20:34 2017
+++ src/sys/arch/arm/dts/sun8i-h3-orangepi-plus2e.dts	Mon Jul 24 06:20:33 2017
@@ -0,0 +1,59 @@
+/* $NetBSD: sun8i-h3-orangepi-plus2e.dts,v 1.1.4.2 2017/07/24 06:20:33 snj Exp $ */
+
+/*-
+ * Copyright (c) 2017 Jared McNeill 
+ * All rights reserved.
+ *
+ * Redistribution and use in 

CVS commit: [netbsd-8] src/share/man/man7

2017-07-24 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Mon Jul 24 06:11:40 UTC 2017

Modified Files:
src/share/man/man7 [netbsd-8]: sysctl.7

Log Message:
Pull up following revision(s) (requested by joerg in ticket #125):
share/man/man7/sysctl.7: revision 1.115
Document vm.guard_size and vm.thread_guard_size


To generate a diff of this commit:
cvs rdiff -u -r1.113 -r1.113.4.1 src/share/man/man7/sysctl.7

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

Modified files:

Index: src/share/man/man7/sysctl.7
diff -u src/share/man/man7/sysctl.7:1.113 src/share/man/man7/sysctl.7:1.113.4.1
--- src/share/man/man7/sysctl.7:1.113	Sat Mar 25 05:58:50 2017
+++ src/share/man/man7/sysctl.7	Mon Jul 24 06:11:39 2017
@@ -1,4 +1,4 @@
-.\"	$NetBSD: sysctl.7,v 1.113 2017/03/25 05:58:50 pgoyette Exp $
+.\"	$NetBSD: sysctl.7,v 1.113.4.1 2017/07/24 06:11:39 snj Exp $
 .\"
 .\" Copyright (c) 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -29,7 +29,7 @@
 .\"
 .\"	@(#)sysctl.3	8.4 (Berkeley) 5/9/95
 .\"
-.Dd March 25, 2017
+.Dd July 2, 2017
 .Dt SYSCTL 7
 .Os
 .Sh NAME
@@ -2381,6 +2381,8 @@ privilege may change the value.
 .It vm.uvmexp2	struct uvmexp_sysctl	no
 .It vm.vmmeter	struct vmtotal	no
 .It vm.proc.map	struct kinfo_vmentry	no
+.It vm.guard_size	unsigned int	no
+.It vm.thread_guard_size	unsigned int	yes
 .El
 .Bl -tag -width "123456"
 .It Li vm.anonmax ( Dv VM_ANONMAX )
@@ -2443,6 +2445,11 @@ The returned data consists of a
 Return system wide virtual memory statistics.
 The returned data consists of a
 .Vt struct uvmexp_sysctl .
+.It Li vm.guard_size
+Return system wide guard size for the main thread of a program.
+.It Li vm.thread_guard_size
+Return system wide default size for the guard area of all other threads
+of a program.
 .\" XXX vm.idlezero
 .El
 .Ss The ddb.* subtree ( Dv CTL_DDB )



CVS commit: [netbsd-8] src/share/man/man7

2017-07-24 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Mon Jul 24 06:11:40 UTC 2017

Modified Files:
src/share/man/man7 [netbsd-8]: sysctl.7

Log Message:
Pull up following revision(s) (requested by joerg in ticket #125):
share/man/man7/sysctl.7: revision 1.115
Document vm.guard_size and vm.thread_guard_size


To generate a diff of this commit:
cvs rdiff -u -r1.113 -r1.113.4.1 src/share/man/man7/sysctl.7

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/ufs/ffs

2017-07-24 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Mon Jul 24 06:21:57 UTC 2017

Modified Files:
src/sys/ufs/ffs [netbsd-8]: ffs_alloc.c

Log Message:
Pull up following revision(s) (requested by hannken in ticket #129):
sys/ufs/ffs/ffs_alloc.c: revision 1.157
When initializing more inodes make sure to write them to disk
before writing the cylinder group with updated cg_initediblk.


To generate a diff of this commit:
cvs rdiff -u -r1.156 -r1.156.6.1 src/sys/ufs/ffs/ffs_alloc.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/ufs/ffs

2017-07-24 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Mon Jul 24 06:21:57 UTC 2017

Modified Files:
src/sys/ufs/ffs [netbsd-8]: ffs_alloc.c

Log Message:
Pull up following revision(s) (requested by hannken in ticket #129):
sys/ufs/ffs/ffs_alloc.c: revision 1.157
When initializing more inodes make sure to write them to disk
before writing the cylinder group with updated cg_initediblk.


To generate a diff of this commit:
cvs rdiff -u -r1.156 -r1.156.6.1 src/sys/ufs/ffs/ffs_alloc.c

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

Modified files:

Index: src/sys/ufs/ffs/ffs_alloc.c
diff -u src/sys/ufs/ffs/ffs_alloc.c:1.156 src/sys/ufs/ffs/ffs_alloc.c:1.156.6.1
--- src/sys/ufs/ffs/ffs_alloc.c:1.156	Sat Mar 18 05:20:04 2017
+++ src/sys/ufs/ffs/ffs_alloc.c	Mon Jul 24 06:21:57 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: ffs_alloc.c,v 1.156 2017/03/18 05:20:04 riastradh Exp $	*/
+/*	$NetBSD: ffs_alloc.c,v 1.156.6.1 2017/07/24 06:21:57 snj Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -70,7 +70,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ffs_alloc.c,v 1.156 2017/03/18 05:20:04 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ffs_alloc.c,v 1.156.6.1 2017/07/24 06:21:57 snj Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_ffs.h"
@@ -1379,8 +1379,8 @@ gotit:
 	}
 	mutex_exit(>um_lock);
 	if (ibp != NULL) {
+		bwrite(ibp);
 		bwrite(bp);
-		bawrite(ibp);
 	} else
 		bdwrite(bp);
 	return (cg * fs->fs_ipg + ipref);



CVS commit: [netbsd-8] src/doc

2017-07-24 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Mon Jul 24 06:37:46 UTC 2017

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

Log Message:
118, 119, 120, 125, 126, 128, 129


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.30 -r1.1.2.31 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.30 src/doc/CHANGES-8.0:1.1.2.31
--- src/doc/CHANGES-8.0:1.1.2.30	Sun Jul 23 15:06:16 2017
+++ src/doc/CHANGES-8.0	Mon Jul 24 06:37:45 2017
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-8.0,v 1.1.2.30 2017/07/23 15:06:16 snj Exp $
+# $NetBSD: CHANGES-8.0,v 1.1.2.31 2017/07/24 06:37:45 snj Exp $
 
 A complete list of changes from the initial NetBSD 8.0 branch on 2017-06-04
 until the 8.0 release:
@@ -4580,3 +4580,50 @@ share/man/man7/environ.7			1.27
 	Document EDITRC
 	[kre, ticket #105]
 
+share/man/man8/MAKEDEV.8			1.46
+
+	MAKEDEV(8): Regenerate, documenting lua, dk, plcom, wmcom,
+	hdmicec, mfi, nvme, nvme ns, tpm, and dtrace devices.
+	[sevan, ticket #118]
+
+lib/libpthread/pthread_tsd.c			1.16
+
+	PR/52386: Use the number of iterations we document.
+	[kamil, ticket #119]
+
+sys/uvm/uvm_fault.c1.200
+tests/lib/libc/sys/t_write.c			1.4-1.6`
+
+	PR/52384: make uvm_fault_check() return EFAULT not EACCES, like
+	our man pages (but not OpenGroup which does not document EFAULT
+	for read/write, and only documents EACCES for sockets) say for
+	read/write.
+	[kamil, ticket #120]
+
+share/man/man7/sysctl.71.115
+
+	Document vm.guard_size and vm.thread_guard_size
+	[joerg, ticket #125]
+
+libexec/ld.elf_so/rtld.h			1.128
+
+	Drop comments about symbol exporting, the relevant code is gone.
+	[joerg, ticket #126]
+
+sys/arch/arm/dts/sun8i-h3-nanopi-neo.dts	1.1
+sys/arch/arm/dts/sun8i-h3-orangepi-plus2e.dts	1.1
+sys/arch/arm/dts/sun8i-h3.dtsi			1.1
+sys/conf/Makefile.kern.inc			1.259
+
+	Add support for dts files outside of external/gpl2.
+
+	Add local patches to sun8i-h3-orangepi-plus2e and
+	sun8i-h3-nanopi-neo to enable ethernet support.
+	[jmcneill, ticket #128]
+
+sys/ufs/ffs/ffs_alloc.c1.157
+
+	When initializing more inodes make sure to write them to disk
+	before writing the cylinder group with updated cg_initediblk.
+	[hannken, ticket #129]
+



CVS commit: [netbsd-8] src/doc

2017-07-24 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Mon Jul 24 06:37:46 UTC 2017

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

Log Message:
118, 119, 120, 125, 126, 128, 129


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.30 -r1.1.2.31 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: src/tests/lib/libm

2017-07-24 Thread Havard Eidnes
Module Name:src
Committed By:   he
Date:   Mon Jul 24 18:13:36 UTC 2017

Modified Files:
src/tests/lib/libm: t_fe_round.c

Log Message:
Swap around the two last args to the check for expected fegetround(),
so the error message makes sense.


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

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

Modified files:

Index: src/tests/lib/libm/t_fe_round.c
diff -u src/tests/lib/libm/t_fe_round.c:1.2 src/tests/lib/libm/t_fe_round.c:1.3
--- src/tests/lib/libm/t_fe_round.c:1.2	Tue Dec 20 06:07:38 2016
+++ src/tests/lib/libm/t_fe_round.c	Mon Jul 24 18:13:36 2017
@@ -89,7 +89,7 @@ ATF_TC_BODY(fe_round, tc)
 		(fegetround() == values[i].round_mode),
 		"Didn't get the same rounding mode out!\n"
 		"(index %d) fed in %d rounding mode, got %d out\n",
-		i, fegetround(), values[i].round_mode);
+		i, values[i].round_mode, fegetround());
 	}
 }
 



CVS commit: src/tests/lib/libm

2017-07-24 Thread Havard Eidnes
Module Name:src
Committed By:   he
Date:   Mon Jul 24 18:13:36 UTC 2017

Modified Files:
src/tests/lib/libm: t_fe_round.c

Log Message:
Swap around the two last args to the check for expected fegetround(),
so the error message makes sense.


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

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



CVS commit: src/tests/lib/libm

2017-07-24 Thread Havard Eidnes
Module Name:src
Committed By:   he
Date:   Mon Jul 24 18:14:46 UTC 2017

Modified Files:
src/tests/lib/libm: t_fe_round.c

Log Message:
Add a test checking nearbyint(), using the same table as used by
the existing lrint() test.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/lib/libm/t_fe_round.c

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



CVS commit: src/tests/lib/libm

2017-07-24 Thread Havard Eidnes
Module Name:src
Committed By:   he
Date:   Mon Jul 24 18:14:46 UTC 2017

Modified Files:
src/tests/lib/libm: t_fe_round.c

Log Message:
Add a test checking nearbyint(), using the same table as used by
the existing lrint() test.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/lib/libm/t_fe_round.c

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

Modified files:

Index: src/tests/lib/libm/t_fe_round.c
diff -u src/tests/lib/libm/t_fe_round.c:1.3 src/tests/lib/libm/t_fe_round.c:1.4
--- src/tests/lib/libm/t_fe_round.c:1.3	Mon Jul 24 18:13:36 2017
+++ src/tests/lib/libm/t_fe_round.c	Mon Jul 24 18:14:46 2017
@@ -93,10 +93,40 @@ ATF_TC_BODY(fe_round, tc)
 	}
 }
 
+ATF_TC(fe_nearbyint);
+ATF_TC_HEAD(fe_nearbyint, tc)
+{
+	atf_tc_set_md_var(tc, "descr","Checking IEEE 754 rounding modes using nearbyint");
+}
+
+ATF_TC_BODY(fe_nearbyint, tc)
+{
+	double received;
+
+	for (unsigned int i = 0; i < __arraycount(values); i++) {
+		fesetround(values[i].round_mode);
+
+		received = nearbyint(values[i].input);
+		ATF_CHECK_MSG(
+		(fabs(received - values[i].expected) < EPSILON),
+		"nearbyint rounding wrong, difference too large\n"
+		"input: %f (index %d): got %f, expected %ld\n",
+		values[i].input, i, received, values[i].expected);
+
+		/* Do we get the same rounding mode out? */
+		ATF_CHECK_MSG(
+		(fegetround() == values[i].round_mode),
+		"Didn't get the same rounding mode out!\n"
+		"(index %d) fed in %d rounding mode, got %d out\n",
+		i, values[i].round_mode, fegetround());
+	}
+}
+
 ATF_TP_ADD_TCS(tp)
 {
 
 	ATF_TP_ADD_TC(tp, fe_round);
+	ATF_TP_ADD_TC(tp, fe_nearbyint);
 
 	return atf_no_error();
 }
@@ -109,15 +139,27 @@ ATF_TC_HEAD(t_nofe_round, tc)
 	"dummy test case - no fenv.h support");
 }
 
-
 ATF_TC_BODY(t_nofe_round, tc)
 {
 	atf_tc_skip("no fenv.h support on this architecture");
 }
 
+ATF_TC_HEAD(t_nofe_nearbyint, tc)
+{
+	atf_tc_set_md_var(tc, "descr",
+	"dummy test case - no fenv.h support");
+}
+
+ATF_TC_BODY(t_nofe_nearbyint, tc)
+{
+	atf_tc_skip("no fenv.h support on this architecture");
+}
+
+
 ATF_TP_ADD_TCS(tp)
 {
 	ATF_TP_ADD_TC(tp, t_nofe_round);
+	ATF_TP_ADD_TC(tp, t_nofe_nearbyint);
 	return atf_no_error();
 }
 



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

2017-07-24 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Jul 25 01:34:23 UTC 2017

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

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


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

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

Modified files:

Index: src/sbin/route/rtutil.c
diff -u src/sbin/route/rtutil.c:1.8.8.1 src/sbin/route/rtutil.c:1.8.8.2
--- src/sbin/route/rtutil.c:1.8.8.1	Fri Jul  7 13:57:26 2017
+++ src/sbin/route/rtutil.c	Tue Jul 25 01:34:23 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: rtutil.c,v 1.8.8.1 2017/07/07 13:57:26 martin Exp $	*/
+/*	$NetBSD: rtutil.c,v 1.8.8.2 2017/07/25 01:34:23 snj Exp $	*/
 /*	$OpenBSD: show.c,v 1.1 2006/05/27 19:16:37 claudio Exp $	*/
 
 /*
@@ -304,6 +304,8 @@ p_rtentry(struct rt_msghdr *rtm, int fla
 	putchar('\n');
 	if (flags & RT_VFLAG)
 		p_rtrmx(>rtm_rmx);
+#else
+	putchar('\n');
 #endif
 }
 



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

2017-07-24 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Jul 25 01:34:23 UTC 2017

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

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


To generate a diff of this commit:
cvs rdiff -u -r1.8.8.1 -r1.8.8.2 src/sbin/route/rtutil.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-07-24 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Jul 25 01:49:13 UTC 2017

Modified Files:
src/sys/arch/arm/sunxi [netbsd-8]: sunxi_mmc.c
src/sys/dev/sdmmc [netbsd-8]: ld_sdmmc.c sdmmc_mem.c sdmmcreg.h
sdmmcvar.h

Log Message:
Pull up following revision(s) (requested by jmcneill in ticket #139):
sys/arch/arm/sunxi/sunxi_mmc.c: revision 1.2
sys/dev/sdmmc/ld_sdmmc.c: revision 1.31
sys/dev/sdmmc/sdmmc_mem.c: revision 1.61
sys/dev/sdmmc/sdmmcreg.h: revision 1.32
sys/dev/sdmmc/sdmmcvar.h: revision 1.28
Add support for eMMC 4.5's optional cache feature. If a cache is present,
and the host controller reports the SMC_CAPS_POLLING capability (needed
to flush cache at shutdown), it will be automatically enabled and used.
--
Add SMC_CAPS_POLLING support.


To generate a diff of this commit:
cvs rdiff -u -r1.3.4.2 -r1.3.4.3 src/sys/arch/arm/sunxi/sunxi_mmc.c
cvs rdiff -u -r1.26.4.3 -r1.26.4.4 src/sys/dev/sdmmc/ld_sdmmc.c
cvs rdiff -u -r1.56.4.2 -r1.56.4.3 src/sys/dev/sdmmc/sdmmc_mem.c
cvs rdiff -u -r1.29.6.1 -r1.29.6.2 src/sys/dev/sdmmc/sdmmcreg.h
cvs rdiff -u -r1.23.6.2 -r1.23.6.3 src/sys/dev/sdmmc/sdmmcvar.h

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-07-24 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Jul 25 01:49:13 UTC 2017

Modified Files:
src/sys/arch/arm/sunxi [netbsd-8]: sunxi_mmc.c
src/sys/dev/sdmmc [netbsd-8]: ld_sdmmc.c sdmmc_mem.c sdmmcreg.h
sdmmcvar.h

Log Message:
Pull up following revision(s) (requested by jmcneill in ticket #139):
sys/arch/arm/sunxi/sunxi_mmc.c: revision 1.2
sys/dev/sdmmc/ld_sdmmc.c: revision 1.31
sys/dev/sdmmc/sdmmc_mem.c: revision 1.61
sys/dev/sdmmc/sdmmcreg.h: revision 1.32
sys/dev/sdmmc/sdmmcvar.h: revision 1.28
Add support for eMMC 4.5's optional cache feature. If a cache is present,
and the host controller reports the SMC_CAPS_POLLING capability (needed
to flush cache at shutdown), it will be automatically enabled and used.
--
Add SMC_CAPS_POLLING support.


To generate a diff of this commit:
cvs rdiff -u -r1.3.4.2 -r1.3.4.3 src/sys/arch/arm/sunxi/sunxi_mmc.c
cvs rdiff -u -r1.26.4.3 -r1.26.4.4 src/sys/dev/sdmmc/ld_sdmmc.c
cvs rdiff -u -r1.56.4.2 -r1.56.4.3 src/sys/dev/sdmmc/sdmmc_mem.c
cvs rdiff -u -r1.29.6.1 -r1.29.6.2 src/sys/dev/sdmmc/sdmmcreg.h
cvs rdiff -u -r1.23.6.2 -r1.23.6.3 src/sys/dev/sdmmc/sdmmcvar.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/arch/arm/sunxi/sunxi_mmc.c
diff -u src/sys/arch/arm/sunxi/sunxi_mmc.c:1.3.4.2 src/sys/arch/arm/sunxi/sunxi_mmc.c:1.3.4.3
--- src/sys/arch/arm/sunxi/sunxi_mmc.c:1.3.4.2	Tue Jul 18 19:13:08 2017
+++ src/sys/arch/arm/sunxi/sunxi_mmc.c	Tue Jul 25 01:49:13 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: sunxi_mmc.c,v 1.3.4.2 2017/07/18 19:13:08 snj Exp $ */
+/* $NetBSD: sunxi_mmc.c,v 1.3.4.3 2017/07/25 01:49:13 snj Exp $ */
 
 /*-
  * Copyright (c) 2014-2017 Jared McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sunxi_mmc.c,v 1.3.4.2 2017/07/18 19:13:08 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sunxi_mmc.c,v 1.3.4.3 2017/07/25 01:49:13 snj Exp $");
 
 #include 
 #include 
@@ -317,7 +317,8 @@ sunxi_mmc_attach_i(device_t self)
 		   SMC_CAPS_MULTI_SEG_DMA |
 		   SMC_CAPS_AUTO_STOP |
 		   SMC_CAPS_SD_HIGHSPEED |
-		   SMC_CAPS_MMC_HIGHSPEED;
+		   SMC_CAPS_MMC_HIGHSPEED |
+		   SMC_CAPS_POLLING;
 	if (width == 4)
 		saa.saa_caps |= SMC_CAPS_4BIT_MODE;
 	if (width == 8)
@@ -368,7 +369,8 @@ sunxi_mmc_intr(void *priv)
 }
 
 static int
-sunxi_mmc_wait_rint(struct sunxi_mmc_softc *sc, uint32_t mask, int timeout)
+sunxi_mmc_wait_rint(struct sunxi_mmc_softc *sc, uint32_t mask,
+int timeout, bool poll)
 {
 	int retry;
 	int error;
@@ -378,15 +380,24 @@ sunxi_mmc_wait_rint(struct sunxi_mmc_sof
 	if (sc->sc_intr_rint & mask)
 		return 0;
 
-	retry = timeout / hz;
+	if (poll)
+		retry = timeout / hz * 1000;
+	else
+		retry = timeout / hz;
 
 	while (retry > 0) {
-		error = cv_timedwait(>sc_intr_cv,
-		>sc_intr_lock, hz);
-		if (error && error != EWOULDBLOCK)
-			return error;
+		if (poll) {
+			sc->sc_intr_rint |= MMC_READ(sc, SUNXI_MMC_RINT);
+		} else {
+			error = cv_timedwait(>sc_intr_cv,
+			>sc_intr_lock, hz);
+			if (error && error != EWOULDBLOCK)
+return error;
+		}
 		if (sc->sc_intr_rint & mask)
 			return 0;
+		if (poll)
+			delay(1000);	
 		--retry;
 	}
 
@@ -420,7 +431,6 @@ sunxi_mmc_host_reset(sdmmc_chipset_handl
 	MMC_WRITE(sc, SUNXI_MMC_GCTRL,
 	MMC_READ(sc, SUNXI_MMC_GCTRL) | SUNXI_MMC_GCTRL_INTEN);
 
-
 	return 0;
 }
 
@@ -680,13 +690,14 @@ sunxi_mmc_exec_command(sdmmc_chipset_han
 {
 	struct sunxi_mmc_softc *sc = sch;
 	uint32_t cmdval = SUNXI_MMC_CMD_START;
+	const bool poll = (cmd->c_flags & SCF_POLL) != 0;
 	int retry;
 
 #ifdef SUNXI_MMC_DEBUG
 	aprint_normal_dev(sc->sc_dev,
-	"opcode %d flags 0x%x data %p datalen %d blklen %d\n",
+	"opcode %d flags 0x%x data %p datalen %d blklen %d poll %d\n",
 	cmd->c_opcode, cmd->c_flags, cmd->c_data, cmd->c_datalen,
-	cmd->c_blklen);
+	cmd->c_blklen, poll);
 #endif
 
 	mutex_enter(>sc_intr_lock);
@@ -766,7 +777,7 @@ sunxi_mmc_exec_command(sdmmc_chipset_han
 	}
 
 	cmd->c_error = sunxi_mmc_wait_rint(sc,
-	SUNXI_MMC_INT_ERROR|SUNXI_MMC_INT_CMD_DONE, hz * 10);
+	SUNXI_MMC_INT_ERROR|SUNXI_MMC_INT_CMD_DONE, hz * 10, poll);
 	if (cmd->c_error == 0 && (sc->sc_intr_rint & SUNXI_MMC_INT_ERROR)) {
 		if (sc->sc_intr_rint & SUNXI_MMC_INT_RESP_TIMEOUT) {
 			cmd->c_error = ETIMEDOUT;
@@ -787,7 +798,7 @@ sunxi_mmc_exec_command(sdmmc_chipset_han
 		SUNXI_MMC_INT_ERROR|
 		SUNXI_MMC_INT_AUTO_CMD_DONE|
 		SUNXI_MMC_INT_DATA_OVER,
-		hz*10);
+		hz*10, poll);
 		if (cmd->c_error == 0 &&
 		(sc->sc_intr_rint & SUNXI_MMC_INT_ERROR)) {
 			cmd->c_error = ETIMEDOUT;

Index: src/sys/dev/sdmmc/ld_sdmmc.c
diff -u src/sys/dev/sdmmc/ld_sdmmc.c:1.26.4.3 src/sys/dev/sdmmc/ld_sdmmc.c:1.26.4.4
--- src/sys/dev/sdmmc/ld_sdmmc.c:1.26.4.3	Mon Jul 10 12:29:47 2017
+++ src/sys/dev/sdmmc/ld_sdmmc.c	Tue Jul 25 01:49:13 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: 

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

2017-07-24 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Jul 25 01:58:09 UTC 2017

Modified Files:
src/sys/conf [netbsd-8]: Makefile.kern.inc
Added Files:
src/sys/conf [netbsd-8]: dts.mk

Log Message:
Pull up following revision(s) (requested by jmcneill in ticket #141):
sys/conf/dts.mk: 1.1-1.2
sys/conf/Makefile.kern.inc: revision 1.260
Move the dts rule to a separate file and add dependencies handling.
--
do dts depend processing in two passes, one for /include/ and one for #include


To generate a diff of this commit:
cvs rdiff -u -r1.256.8.2 -r1.256.8.3 src/sys/conf/Makefile.kern.inc
cvs rdiff -u -r0 -r1.2.4.2 src/sys/conf/dts.mk

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/conf

2017-07-24 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Jul 25 01:58:09 UTC 2017

Modified Files:
src/sys/conf [netbsd-8]: Makefile.kern.inc
Added Files:
src/sys/conf [netbsd-8]: dts.mk

Log Message:
Pull up following revision(s) (requested by jmcneill in ticket #141):
sys/conf/dts.mk: 1.1-1.2
sys/conf/Makefile.kern.inc: revision 1.260
Move the dts rule to a separate file and add dependencies handling.
--
do dts depend processing in two passes, one for /include/ and one for #include


To generate a diff of this commit:
cvs rdiff -u -r1.256.8.2 -r1.256.8.3 src/sys/conf/Makefile.kern.inc
cvs rdiff -u -r0 -r1.2.4.2 src/sys/conf/dts.mk

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

Modified files:

Index: src/sys/conf/Makefile.kern.inc
diff -u src/sys/conf/Makefile.kern.inc:1.256.8.2 src/sys/conf/Makefile.kern.inc:1.256.8.3
--- src/sys/conf/Makefile.kern.inc:1.256.8.2	Mon Jul 24 06:20:33 2017
+++ src/sys/conf/Makefile.kern.inc	Tue Jul 25 01:58:09 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.kern.inc,v 1.256.8.2 2017/07/24 06:20:33 snj Exp $
+#	$NetBSD: Makefile.kern.inc,v 1.256.8.3 2017/07/25 01:58:09 snj Exp $
 #
 # This file contains common `MI' targets and definitions and it is included
 # at the bottom of each `MD' ${MACHINE}/conf/Makefile.${MACHINE}.
@@ -321,6 +321,7 @@ ${_s:T:R}.o: ${_s}
 .include "${S}/conf/cscope.mk"
 .include "${S}/conf/gdbinit.mk"
 .include "${S}/conf/ssp.mk"
+.include "${S}/conf/dts.mk"
 
 ##
 ## (7) misc targets: install, clean(dir), depend(all), lint, links, tags,
@@ -534,27 +535,6 @@ build_kernel: .USE
 	@${KCOMPILE.s} -pg
 .endif # ___USE_SUFFIX_RULES___
 
-# Begin DTS handling
-
-DTSINC?=$S/external/gpl2/dts/dist/include
-DTSGNUPATH?=$S/external/gpl2/dts/dist/arch/${MACHINE_CPU}/boot/dts
-DTSPATH?=$S/arch/${MACHINE_CPU}/dts
-DTSPADDING?=1024
-
-.SUFFIXES: .dtb .dts
-.dts.dtb:
-	${CPP} -P -xassembler-with-cpp -I ${DTSINC} -I ${DTSPATH} -I ${DTSGNUPATH} \
-	-include ${.IMPSRC} /dev/null | \
-	${TOOL_DTC} -i ${DTSINC} -i ${DTSPATH} -i ${DTSGNUPATH} -I dts -O dtb \
-	-p ${DTSPADDING} -b 0 -o ${.TARGET}
-
-.PATH.dts: ${DTSPATH} ${DTSGNUPATH}
-
-DTB= ${DTS:.dts=.dtb}
-all: ${DTB}
-
-# End DTS handling
-
 ##
 ## the end
 ##

Added files:

Index: src/sys/conf/dts.mk
diff -u /dev/null src/sys/conf/dts.mk:1.2.4.2
--- /dev/null	Tue Jul 25 01:58:09 2017
+++ src/sys/conf/dts.mk	Tue Jul 25 01:58:09 2017
@@ -0,0 +1,34 @@
+# $NetBSD: dts.mk,v 1.2.4.2 2017/07/25 01:58:09 snj Exp $
+
+DTSINC?=$S/external/gpl2/dts/dist/include
+DTSGNUPATH?=$S/external/gpl2/dts/dist/arch/${MACHINE_CPU}/boot/dts
+DTSPATH?=$S/arch/${MACHINE_CPU}/dts
+DTSPADDING?=1024
+
+.SUFFIXES: .dtd .dtb .dts
+
+.dts.dtd:
+	(${CPP} -P -xassembler-with-cpp -I ${DTSINC} -I ${DTSPATH} \
+	-I ${DTSGNUPATH} -include ${.IMPSRC} /dev/null | \
+	${TOOL_DTC} -i ${DTSINC} -i ${DTSPATH} -i ${DTSGNUPATH} -I dts -O dtb \
+	-p ${DTSPADDING} -b 0 -o /dev/null -d /dev/stdout | \
+	${TOOL_SED} -e 's@/dev/null@${.TARGET:.dtd=.dtb}@' \
+	-e 's@@${.IMPSRC}@' && \
+	${CPP} -P -xassembler-with-cpp -I ${DTSINC} -I ${DTSPATH} \
+	-I ${DTSGNUPATH} -include ${.IMPSRC} -M /dev/null | \
+	${TOOL_SED} -e 's@null.o@${.TARGET:.dtd=.dtb}@' \
+	-e 's@/dev/null@@') > ${.TARGET}
+
+
+.dts.dtb:
+	${CPP} -P -xassembler-with-cpp -I ${DTSINC} -I ${DTSPATH} \
+	-I ${DTSGNUPATH} -include ${.IMPSRC} /dev/null | \
+	${TOOL_DTC} -i ${DTSINC} -i ${DTSPATH} -i ${DTSGNUPATH} -I dts -O dtb \
+	-p ${DTSPADDING} -b 0 -o ${.TARGET}
+
+.PATH.dts: ${DTSPATH} ${DTSGNUPATH}
+
+DEPS+= ${DTS:.dts=.dtd}
+DTB= ${DTS:.dts=.dtb}
+
+all: ${DTB}



CVS commit: [netbsd-8] src/tests/lib/libc/arch/sh3

2017-07-24 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Jul 25 02:06:10 UTC 2017

Modified Files:
src/tests/lib/libc/arch/sh3 [netbsd-8]: return_one.S

Log Message:
Pull up following revision(s) (requested by uwe in ticket #148):
tests/lib/libc/arch/sh3/return_one.S: revision 1.2
Don't execute random garbage.  Fixes mprotect_mremap_exec test.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.1.34.1 src/tests/lib/libc/arch/sh3/return_one.S

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



CVS commit: [netbsd-8] src/tests/lib/libc/arch/sh3

2017-07-24 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Jul 25 02:06:10 UTC 2017

Modified Files:
src/tests/lib/libc/arch/sh3 [netbsd-8]: return_one.S

Log Message:
Pull up following revision(s) (requested by uwe in ticket #148):
tests/lib/libc/arch/sh3/return_one.S: revision 1.2
Don't execute random garbage.  Fixes mprotect_mremap_exec test.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.1.34.1 src/tests/lib/libc/arch/sh3/return_one.S

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

Modified files:

Index: src/tests/lib/libc/arch/sh3/return_one.S
diff -u src/tests/lib/libc/arch/sh3/return_one.S:1.1 src/tests/lib/libc/arch/sh3/return_one.S:1.1.34.1
--- src/tests/lib/libc/arch/sh3/return_one.S:1.1	Mon Jul 18 23:16:10 2011
+++ src/tests/lib/libc/arch/sh3/return_one.S	Tue Jul 25 02:06:10 2017
@@ -1,8 +1,10 @@
-/*	$NetBSD: return_one.S,v 1.1 2011/07/18 23:16:10 jym Exp $ */
+/*	$NetBSD: return_one.S,v 1.1.34.1 2017/07/25 02:06:10 snj Exp $ */
 
 #include 
 
-.globl	return_one, return_one_end;
-
-return_one: return_one_end:
-	nop
+NENTRY(return_one)
+	rts
+	 mov	#1, r0
+	SET_ENTRY_SIZE(return_one)
+	.globl	return_one_end
+return_one_end:



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

2017-07-24 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Jul 25 02:07:12 UTC 2017

Modified Files:
src/sys/net [netbsd-8]: if_pppoe.c

Log Message:
Pull up following revision(s) (requested by knakahara in ticket #149):
sys/net/if_pppoe.c: revision 1.126
fix panic when PPPOE_DEBUG enabled. implemented by s-yamaguchi@IIJ, thanks.


To generate a diff of this commit:
cvs rdiff -u -r1.125 -r1.125.6.1 src/sys/net/if_pppoe.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/arch/pmax

2017-07-24 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Jul 25 02:15:20 UTC 2017

Modified Files:
src/sys/arch/pmax/conf [netbsd-8]: files.pmax
src/sys/arch/pmax/include [netbsd-8]: bus.h

Log Message:
Apply patch (requested by flxd in ticket #154):
Revert pmax switch to common MIPS bus_space and bus_dma.


To generate a diff of this commit:
cvs rdiff -u -r1.118 -r1.118.8.1 src/sys/arch/pmax/conf/files.pmax
cvs rdiff -u -r1.31 -r1.31.8.1 src/sys/arch/pmax/include/bus.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/arch/pmax/conf/files.pmax
diff -u src/sys/arch/pmax/conf/files.pmax:1.118 src/sys/arch/pmax/conf/files.pmax:1.118.8.1
--- src/sys/arch/pmax/conf/files.pmax:1.118	Wed Nov 16 19:37:06 2016
+++ src/sys/arch/pmax/conf/files.pmax	Tue Jul 25 02:15:19 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: files.pmax,v 1.118 2016/11/16 19:37:06 macallan Exp $
+#	$NetBSD: files.pmax,v 1.118.8.1 2017/07/25 02:15:19 snj Exp $
 # DECstation-specific configuration info
 
 # maxpartitions must be first item in files.${ARCH}.
@@ -16,12 +16,6 @@ device cpu# not optional
 attach cpu at mainbus
 file arch/pmax/pmax/cpu.c		cpu
 
-#
-# common mips stuff
-#
-file arch/mips/mips/bus_dma.c
-
-
 # Model support option headers
 defflag	DEC_3100	# DECstation 2100, 3100 (kn01)
 defflag	DEC_5100	# DECsystem 5100 (kn230)
@@ -128,7 +122,8 @@ attach le at ibus with le_pmax:		le24, l
 file	arch/pmax/ibus/if_le_ibus.c	le_pmax
 
 file	arch/pmax/pmax/autoconf.c
-file	arch/pmax/pmax/bus.c
+file	arch/pmax/pmax/bus_dma.c
+file	arch/pmax/pmax/bus_space.c
 file	arch/pmax/pmax/disksubr.c
 file	arch/pmax/pmax/machdep.c
 file	arch/pmax/pmax/mainbus.c
@@ -138,6 +133,7 @@ file	arch/pmax/pmax/sysconf.c
 file	arch/pmax/stand/common/callvec.c
 file	dev/cons.c
 
+file	dev/bus_dma/bus_dmamem_common.c
 
 #
 # Workstation console devices

Index: src/sys/arch/pmax/include/bus.h
diff -u src/sys/arch/pmax/include/bus.h:1.31 src/sys/arch/pmax/include/bus.h:1.31.8.1
--- src/sys/arch/pmax/include/bus.h:1.31	Wed Nov 16 19:37:06 2016
+++ src/sys/arch/pmax/include/bus.h	Tue Jul 25 02:15:20 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus.h,v 1.31 2016/11/16 19:37:06 macallan Exp $	*/
+/*	$NetBSD: bus.h,v 1.31.8.1 2017/07/25 02:15:20 snj Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2001 The NetBSD Foundation, Inc.
@@ -41,13 +41,629 @@
 #define	__PB_TYPENAME_PREFIX(BITS)	___CONCAT(u_int,BITS)
 #define	__PB_TYPENAME(BITS)		___CONCAT(__PB_TYPENAME_PREFIX(BITS),_t)
 
-#include 
-#include 
-#include 
-#include 
-
-void pmax_bus_dma_init(void);
-extern bus_space_tag_t normal_memt;
-extern struct mips_bus_dma_tag pmax_default_bus_dma_tag;
+/*
+ * Bus address and size types
+ */
+typedef u_long bus_addr_t;
+typedef u_long bus_size_t;
+
+/*
+ * Access methods for bus resources and address space.
+ */
+typedef int	bus_space_tag_t;
+typedef u_long	bus_space_handle_t;
+
+/*
+ *	int bus_space_map(bus_space_tag_t t, bus_addr_t addr,
+ *	bus_size_t size, int flags, bus_space_handle_t *bshp);
+ *
+ * Map a region of bus space.
+ */
+
+#define	BUS_SPACE_MAP_CACHEABLE		0x01
+#define	BUS_SPACE_MAP_LINEAR		0x02
+#define	BUS_SPACE_MAP_PREFETCHABLE	0x04
+
+int	bus_space_map(bus_space_tag_t, bus_addr_t, bus_size_t,
+	int, bus_space_handle_t *);
+
+/*
+ *	void bus_space_unmap(bus_space_tag_t t,
+ *	bus_space_handle_t bsh, bus_size_t size);
+ *
+ * Unmap a region of bus space.
+ */
+
+void	bus_space_unmap(bus_space_tag_t, bus_space_handle_t, bus_size_t);
+
+/*
+ *	int bus_space_subregion(bus_space_tag_t t,
+ *	bus_space_handle_t bsh, bus_size_t offset, bus_size_t size,
+ *	bus_space_handle_t *nbshp);
+ *
+ * Get a new handle for a subregion of an already-mapped area of bus space.
+ */
+
+int	bus_space_subregion(bus_space_tag_t t, bus_space_handle_t bsh,
+	bus_size_t offset, bus_size_t size, bus_space_handle_t *nbshp);
+
+/*
+ *	int bus_space_alloc(bus_space_tag_t t, bus_addr_t, rstart,
+ *	bus_addr_t rend, bus_size_t size, bus_size_t align,
+ *	bus_size_t boundary, int flags, bus_addr_t *addrp,
+ *	bus_space_handle_t *bshp);
+ *
+ * Allocate a region of bus space.
+ */
+
+int	bus_space_alloc(bus_space_tag_t t, bus_addr_t rstart,
+	bus_addr_t rend, bus_size_t size, bus_size_t align,
+	bus_size_t boundary, int cacheable, bus_addr_t *addrp,
+	bus_space_handle_t *bshp);
+
+/*
+ *	int bus_space_free(bus_space_tag_t t,
+ *	bus_space_handle_t bsh, bus_size_t size);
+ *
+ * Free a region of bus space.
+ */
+
+void	bus_space_free(bus_space_tag_t t, bus_space_handle_t bsh,
+	bus_size_t size);
+
+/*
+ *	void *bus_space_vaddr(bus_space_tag_t, bus_space_handle_t);
+ *
+ * Get the kernel virtual address for the mapped bus space.
+ * Only allowed for regions mapped with BUS_SPACE_MAP_LINEAR.
+ *  (XXX not enforced)
+ */
+#define bus_space_vaddr(t, h) \
+	((void *)(h))
+
+/*
+ *	u_intN_t bus_space_read_N(bus_space_tag_t tag,
+ *	

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

2017-07-24 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Jul 25 02:15:20 UTC 2017

Modified Files:
src/sys/arch/pmax/conf [netbsd-8]: files.pmax
src/sys/arch/pmax/include [netbsd-8]: bus.h

Log Message:
Apply patch (requested by flxd in ticket #154):
Revert pmax switch to common MIPS bus_space and bus_dma.


To generate a diff of this commit:
cvs rdiff -u -r1.118 -r1.118.8.1 src/sys/arch/pmax/conf/files.pmax
cvs rdiff -u -r1.31 -r1.31.8.1 src/sys/arch/pmax/include/bus.h

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-07-24 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Jul 25 02:23:33 UTC 2017

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

Log Message:
tickets 130-134, 136-143, 145, 148-157


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.31 -r1.1.2.32 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.31 src/doc/CHANGES-8.0:1.1.2.32
--- src/doc/CHANGES-8.0:1.1.2.31	Mon Jul 24 06:37:45 2017
+++ src/doc/CHANGES-8.0	Tue Jul 25 02:23:33 2017
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-8.0,v 1.1.2.31 2017/07/24 06:37:45 snj Exp $
+# $NetBSD: CHANGES-8.0,v 1.1.2.32 2017/07/25 02:23:33 snj Exp $
 
 A complete list of changes from the initial NetBSD 8.0 branch on 2017-06-04
 until the 8.0 release:
@@ -4627,3 +4627,186 @@ sys/ufs/ffs/ffs_alloc.c1.157
 	before writing the cylinder group with updated cg_initediblk.
 	[hannken, ticket #129]
 
+sys/kern/vnode_if.cregen
+sys/kern/vnode_if.src1.77
+sys/rump/include/rump/rumpvnode_if.h		regen
+sys/rump/librump/rumpvfs/rumpvnode_if.c		regen
+sys/sys/vnode_if.hregen
+
+	As VOP_ADVLOCK() may block indefinitely we cannot take
+	fstrans here.  Fixes PR kern/52364.
+	[hannken, ticket #130]
+
+sbin/route/rtutil.c1.10
+
+	Fix route and netstat -r output when built with -DSMALL
+	[manu, ticket #131]
+
+sys/arch/arm/sunxi/sunxi_platform.c		1.5
+sys/arch/evbarm/conf/SUNXI			1.17
+
+	Add support for Allwinner H2+ as found in the Orange Pi Zero.
+	[jmcneill, ticket #132]
+
+libexec/ld.elf_so/tls.c1.11
+
+	Fix two bugs related to promotion of DSO TLS blocks into the
+	static thread allocation:
+	(1) Set the DTV vector up whenever an offset into the static
+	allocation is assigned, even if the block itself is not
+	initialized. This has been seen in libstdc++.
+	(2) Do not free a DTV block if it is part of the static thread
+	allocation.
+	[joerg, ticket #133]
+
+sys/lib/libunwind/Registers.hpp			1.20
+
+	GCC 5.3 likes to emit unwind data with float registers,
+	i.e. register halfs. Compensate.
+	[joerg, ticket #134]
+
+sys/dev/usb/uhci.c1.276
+
+	Only call uhci_free_stds if there are TDs to free.
+
+	In uhci_alloc_std_chain ensure we fill the TD array correctly
+	and note the number of allocated TDs so that uhci_free_stds
+	will do the right thing.
+	[skrll, ticket #136]
+
+share/mk/bsd.man.mk1.119
+
+	Latest mandoc no longer supports multiple -O options. Instead
+	it expects option values to be separated by commas.
+	PR toolchain/52402
+	[jmcneill, ticket #137]
+
+usr.bin/systat/iostat.c1.38
+usr.bin/systat/vmstat.c1.82
+usr.bin/vmstat/drvstats.c			1.11
+usr.bin/vmstat/drvstats.h			1.5
+usr.bin/vmstat/vmstat.c1.217
+usr.sbin/iostat/iostat.c			1.65
+
+	Use I/O timestamps to compute disk statistics for better
+	precision.  Fix bug where garbage was printed if a disk was
+	detached while iostat was running.
+	[mlelstv, ticket #138]
+
+sys/arch/arm/sunxi/sunxi_mmc.c			1.2
+sys/dev/sdmmc/ld_sdmmc.c			1.31
+sys/dev/sdmmc/sdmmc_mem.c			1.61
+sys/dev/sdmmc/sdmmcreg.h			1.32
+sys/dev/sdmmc/sdmmcvar.h			1.28
+
+
+	Add support for eMMC 4.5's optional cache feature.
+	Enable in the sunxi mmc driver.
+	[jmcneill, ticket #139]
+
+sys/kern/uipc_domain.c1.97-1.99
+sys/net/rtsock.c1.225-1.227
+sys/sys/socket.h1.123
+
+	route(8) passes a sockaddr for netmask that is truncated
+	with its prefixlen. However the kernel basically doesn't
+	expect such format and may read beyond the data. So restore
+	the original length of the the data at the beginning of the
+	kernel for the rest components.
+	[ozaki-r, ticket #140]
+
+sys/conf/Makefile.kern.inc			1.260
+sys/conf/dts.mk	1.1-1.2
+
+	Add dependency handling (#include and /include/) to the
+	.dts -> .dtb conversion code.
+	[jmcneill, ticket #141]
+
+usr.bin/mkubootimage/mkubootimage.1		1.9-1.10
+usr.bin/mkubootimage/mkubootimage.c		1.20
+usr.bin/mkubootimage/uboot.h			1.7
+
+	Add support for "kernel_noload" image types. This type is
+	the same as the "kernel" type, except it can run from any
+	load address.
+	[jmcneill, ticket #142]
+
+sys/arch/arm/sunxi/files.sunxi			1.12
+sys/arch/arm/sunxi/sun8i_h3_ccu.c		1.8
+sys/arch/arm/sunxi/sunxi_ccu.c			1.6
+sys/arch/arm/sunxi/sunxi_ccu.h			1.7
+sys/arch/arm/sunxi/sunxi_ccu_phase.c		1.1
+sys/arch/arm/sunxi/sunxi_mmc.c			1.3
+sys/arch/arm/sunxi/sunxi_mmc.h			1.2
+
+	Enable eMMC DDR52 support for sunxi boards.
+	[jmcneill, ticket #143]
+
+sys/fs/union/union.h1.29
+sys/fs/union/union_subr.c			1.76
+
+	Make union_newlower() ans union_newupper() local to
+	union_subr.c, expand and remove union_updatevp() and take
+	care to transfer the vnode lock from the union vnode to
+	its new upper vnode without breaking the fstrans state.
+	[hannken, ticket #145]
+
+tests/lib/libc/arch/sh3/return_one.S		1.2
+
+	Don't execute random garbage.  Fixes mprotect_mremap_exec test.
+	[uwe, ticket #148]
+

CVS commit: [netbsd-8] src/doc

2017-07-24 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Jul 25 02:23:33 UTC 2017

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

Log Message:
tickets 130-134, 136-143, 145, 148-157


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.31 -r1.1.2.32 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-07-24 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Jul 25 01:29:56 UTC 2017

Modified Files:
src/sys/kern [netbsd-8]: vnode_if.c
src/sys/rump/include/rump [netbsd-8]: rumpvnode_if.h
src/sys/rump/librump/rumpvfs [netbsd-8]: rumpvnode_if.c
src/sys/sys [netbsd-8]: vnode_if.h

Log Message:
regen for ticket 130


To generate a diff of this commit:
cvs rdiff -u -r1.104.2.1 -r1.104.2.2 src/sys/kern/vnode_if.c
cvs rdiff -u -r1.28.2.1 -r1.28.2.2 src/sys/rump/include/rump/rumpvnode_if.h
cvs rdiff -u -r1.28.2.1 -r1.28.2.2 \
src/sys/rump/librump/rumpvfs/rumpvnode_if.c
cvs rdiff -u -r1.99.2.1 -r1.99.2.2 src/sys/sys/vnode_if.h

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/kern

2017-07-24 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Jul 25 01:29:23 UTC 2017

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

Log Message:
Pull up following revision(s) (requested by hannken in ticket #130):
sys/kern/vnode_if.src: revision 1.77
As VOP_ADVLOCK() may block indefinitely we cannot take fstrans here.
Fixes PR kern/52364: System hangs not much before showing the login prompt


To generate a diff of this commit:
cvs rdiff -u -r1.75.2.1 -r1.75.2.2 src/sys/kern/vnode_if.src

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

Modified files:

Index: src/sys/kern/vnode_if.src
diff -u src/sys/kern/vnode_if.src:1.75.2.1 src/sys/kern/vnode_if.src:1.75.2.2
--- src/sys/kern/vnode_if.src:1.75.2.1	Sun Jun  4 20:35:01 2017
+++ src/sys/kern/vnode_if.src	Tue Jul 25 01:29:23 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: vnode_if.src,v 1.75.2.1 2017/06/04 20:35:01 bouyer Exp $
+#	$NetBSD: vnode_if.src,v 1.75.2.2 2017/07/25 01:29:23 snj Exp $
 #
 # Copyright (c) 1992, 1993
 #	The Regents of the University of California.  All rights reserved.
@@ -468,6 +468,7 @@ vop_pathconf {
 #% advlockvp  U U U
 #
 vop_advlock {
+	FSTRANS=NO
 	IN LOCKED=NO struct vnode *vp;
 	IN void *id;
 	IN int op;



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

2017-07-24 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Jul 25 01:29:23 UTC 2017

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

Log Message:
Pull up following revision(s) (requested by hannken in ticket #130):
sys/kern/vnode_if.src: revision 1.77
As VOP_ADVLOCK() may block indefinitely we cannot take fstrans here.
Fixes PR kern/52364: System hangs not much before showing the login prompt


To generate a diff of this commit:
cvs rdiff -u -r1.75.2.1 -r1.75.2.2 src/sys/kern/vnode_if.src

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/arch

2017-07-24 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Jul 25 01:35:53 UTC 2017

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

Log Message:
Pull up following revision(s) (requested by jmcneill in ticket #132):
sys/arch/arm/sunxi/sunxi_platform.c: revision 1.5
sys/arch/evbarm/conf/SUNXI: revision 1.17
Add support for Allwinner H2+ as found in the Orange Pi Zero.
--
Build sun8i-h2-plus-orangepi-zero.dts


To generate a diff of this commit:
cvs rdiff -u -r1.5.4.2 -r1.5.4.3 src/sys/arch/arm/sunxi/sunxi_platform.c
cvs rdiff -u -r1.17.4.2 -r1.17.4.3 src/sys/arch/evbarm/conf/SUNXI

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



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

2017-07-24 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Jul 25 01:35:53 UTC 2017

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

Log Message:
Pull up following revision(s) (requested by jmcneill in ticket #132):
sys/arch/arm/sunxi/sunxi_platform.c: revision 1.5
sys/arch/evbarm/conf/SUNXI: revision 1.17
Add support for Allwinner H2+ as found in the Orange Pi Zero.
--
Build sun8i-h2-plus-orangepi-zero.dts


To generate a diff of this commit:
cvs rdiff -u -r1.5.4.2 -r1.5.4.3 src/sys/arch/arm/sunxi/sunxi_platform.c
cvs rdiff -u -r1.17.4.2 -r1.17.4.3 src/sys/arch/evbarm/conf/SUNXI

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

Modified files:

Index: src/sys/arch/arm/sunxi/sunxi_platform.c
diff -u src/sys/arch/arm/sunxi/sunxi_platform.c:1.5.4.2 src/sys/arch/arm/sunxi/sunxi_platform.c:1.5.4.3
--- src/sys/arch/arm/sunxi/sunxi_platform.c:1.5.4.2	Tue Jul 18 19:13:08 2017
+++ src/sys/arch/arm/sunxi/sunxi_platform.c	Tue Jul 25 01:35:53 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: sunxi_platform.c,v 1.5.4.2 2017/07/18 19:13:08 snj Exp $ */
+/* $NetBSD: sunxi_platform.c,v 1.5.4.3 2017/07/25 01:35:53 snj Exp $ */
 
 /*-
  * Copyright (c) 2017 Jared McNeill 
@@ -31,7 +31,7 @@
 #include "opt_fdt_arm.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sunxi_platform.c,v 1.5.4.2 2017/07/18 19:13:08 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sunxi_platform.c,v 1.5.4.3 2017/07/25 01:35:53 snj Exp $");
 
 #include 
 #include 
@@ -153,6 +153,7 @@ static const struct arm_platform sun8i_p
 	.uart_freq = sunxi_platform_uart_freq,
 };
 
+ARM_PLATFORM(sun8i_h2plus, "allwinner,sun8i-h2-plus", _platform);
 ARM_PLATFORM(sun8i_h3, "allwinner,sun8i-h3", _platform);
 ARM_PLATFORM(sun8i_a83t, "allwinner,sun8i-a83t", _platform);
 

Index: src/sys/arch/evbarm/conf/SUNXI
diff -u src/sys/arch/evbarm/conf/SUNXI:1.17.4.2 src/sys/arch/evbarm/conf/SUNXI:1.17.4.3
--- src/sys/arch/evbarm/conf/SUNXI:1.17.4.2	Tue Jul 18 19:13:09 2017
+++ src/sys/arch/evbarm/conf/SUNXI	Tue Jul 25 01:35:53 2017
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: SUNXI,v 1.17.4.2 2017/07/18 19:13:09 snj Exp $
+#	$NetBSD: SUNXI,v 1.17.4.3 2017/07/25 01:35:53 snj Exp $
 #
 #	Allwinner sunxi family
 #
@@ -15,6 +15,8 @@ makeoptions	DTS="
 	sun6i-a31-m9.dts
 	sun6i-a31-mele-a1000g-quad.dts
 
+	sun8i-h2-plus-orangepi-zero.dts
+
 	sun8i-h3-bananapi-m2-plus.dts
 	sun8i-h3-beelink-x2.dts
 	sun8i-h3-nanopi-m1.dts



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

2017-07-24 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Jul 25 01:36:58 UTC 2017

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

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


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

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

Modified files:

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



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

2017-07-24 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Jul 25 01:36:58 UTC 2017

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

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


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

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



CVS commit: [netbsd-8] src/usr.bin/mkubootimage

2017-07-24 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Jul 25 02:00:33 UTC 2017

Modified Files:
src/usr.bin/mkubootimage [netbsd-8]: mkubootimage.1 mkubootimage.c
uboot.h

Log Message:
Pull up following revision(s) (requested by jmcneill in ticket #142):
usr.bin/mkubootimage/mkubootimage.1: 1.9-1.10
usr.bin/mkubootimage/mkubootimage.c: 1.20
usr.bin/mkubootimage/uboot.h: 1.7
Add support for "kernel_noload" image types. This type is the same as the
"kernel" type, except it can run from any load address.
--
Remove unnecessary macros. Use standard headers.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.8.8.1 src/usr.bin/mkubootimage/mkubootimage.1
cvs rdiff -u -r1.18.8.1 -r1.18.8.2 src/usr.bin/mkubootimage/mkubootimage.c
cvs rdiff -u -r1.6 -r1.6.8.1 src/usr.bin/mkubootimage/uboot.h

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.bin/mkubootimage

2017-07-24 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Jul 25 02:00:33 UTC 2017

Modified Files:
src/usr.bin/mkubootimage [netbsd-8]: mkubootimage.1 mkubootimage.c
uboot.h

Log Message:
Pull up following revision(s) (requested by jmcneill in ticket #142):
usr.bin/mkubootimage/mkubootimage.1: 1.9-1.10
usr.bin/mkubootimage/mkubootimage.c: 1.20
usr.bin/mkubootimage/uboot.h: 1.7
Add support for "kernel_noload" image types. This type is the same as the
"kernel" type, except it can run from any load address.
--
Remove unnecessary macros. Use standard headers.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.8.8.1 src/usr.bin/mkubootimage/mkubootimage.1
cvs rdiff -u -r1.18.8.1 -r1.18.8.2 src/usr.bin/mkubootimage/mkubootimage.c
cvs rdiff -u -r1.6 -r1.6.8.1 src/usr.bin/mkubootimage/uboot.h

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

Modified files:

Index: src/usr.bin/mkubootimage/mkubootimage.1
diff -u src/usr.bin/mkubootimage/mkubootimage.1:1.8 src/usr.bin/mkubootimage/mkubootimage.1:1.8.8.1
--- src/usr.bin/mkubootimage/mkubootimage.1:1.8	Tue Sep 30 10:30:35 2014
+++ src/usr.bin/mkubootimage/mkubootimage.1	Tue Jul 25 02:00:33 2017
@@ -1,4 +1,4 @@
-.\"	$NetBSD: mkubootimage.1,v 1.8 2014/09/30 10:30:35 wiz Exp $
+.\"	$NetBSD: mkubootimage.1,v 1.8.8.1 2017/07/25 02:00:33 snj Exp $
 .\"
 .\" Copyright (c) 2012 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 September 30, 2014
+.Dd July 15, 2017
 .Dt MKUBOOTIMAGE 1
 .Os
 .Sh NAME
@@ -38,13 +38,13 @@
 .Op Fl h
 .Fl A No ( arm Ns | Ns arm64 Ns | Ns i386 Ns | Ns mips Ns | Ns mips64 Ns | Ns or1k Ns | Ns powerpc )
 .Fl a Ar address
-.Op Fl C No Po bz2 Ns | Ns gz Ns | Ns lzma Ns | Ns lzo Ns | Ns none Pc
+.Op Fl C Po bz2 Ns | Ns gz Ns | Ns lzma Ns | Ns lzo Ns | Ns none Pc
 .Op Fl E Ar address
 .Op Fl e Ar address
 .Op Fl m Ar magic
 .Fl n Ar image
-.Op Fl O No Po freebsd Ns | Ns linux Ns | Ns netbsd Ns | Ns openbsd Pc
-.Fl T No ( fs Ns | Ns kernel Ns | Ns ramdisk Ns | Ns standalone )
+.Op Fl O Po freebsd Ns | Ns linux Ns | Ns netbsd Ns | Ns openbsd Pc
+.Fl T No ( fs Ns | Ns kernel Ns | Ns kernel_noload Ns | Ns ramdisk Ns | Ns standalone )
 .Ar source destination
 .\"
 .Sh DESCRIPTION
@@ -62,7 +62,7 @@ This is required.
 Sets the image load address.
 This is an integer between 0 and
 .Dv UINT32_MAX .
-This is required.
+This is required for all image types except for script, ramdisk, and kernel_noload.
 .It Fl C No ( bz2 Ns | Ns gz Ns | Ns lzma Ns | Ns lzo Ns | Ns none )
 Defines the compression.
 The default is
@@ -108,7 +108,7 @@ This is required.
 Defines the operating system type.
 The default OS name is
 .Qq netbsd .
-.It Fl T No ( fs Ns | Ns kernel Ns | Ns ramdisk Ns | Ns standalone Ns | Ns script )
+.It Fl T No ( fs Ns | Ns kernel Ns | Ns kernel_noload Ns | Ns ramdisk Ns | Ns standalone Ns | Ns script )
 Defines the image type.
 This is required.
 .El
@@ -120,7 +120,7 @@ The required
 .Ar destination
 argument is the filename of the image file that is created.
 .\"
-.Sh RETURN VALUES
+.Sh EXIT STATUS
 .Nm
 returns 1 on failure to read the kernel,
 generate a header, or create the image.

Index: src/usr.bin/mkubootimage/mkubootimage.c
diff -u src/usr.bin/mkubootimage/mkubootimage.c:1.18.8.1 src/usr.bin/mkubootimage/mkubootimage.c:1.18.8.2
--- src/usr.bin/mkubootimage/mkubootimage.c:1.18.8.1	Wed Jul  5 20:15:33 2017
+++ src/usr.bin/mkubootimage/mkubootimage.c	Tue Jul 25 02:00:33 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: mkubootimage.c,v 1.18.8.1 2017/07/05 20:15:33 snj Exp $ */
+/* $NetBSD: mkubootimage.c,v 1.18.8.2 2017/07/25 02:00:33 snj Exp $ */
 
 /*-
  * Copyright (c) 2010 Jared D. McNeill 
@@ -30,7 +30,7 @@
 #endif
 
 #include 
-__RCSID("$NetBSD: mkubootimage.c,v 1.18.8.1 2017/07/05 20:15:33 snj Exp $");
+__RCSID("$NetBSD: mkubootimage.c,v 1.18.8.2 2017/07/25 02:00:33 snj Exp $");
 
 #include 
 #include 
@@ -144,11 +144,12 @@ static const struct uboot_type {
 	enum uboot_image_type type;
 	const char *name;
 } uboot_type[] = {
-	{ IH_TYPE_STANDALONE,	"standalone" },
-	{ IH_TYPE_KERNEL,	"kernel" },
-	{ IH_TYPE_RAMDISK,	"ramdisk" },
-	{ IH_TYPE_FILESYSTEM,	"fs" },
-	{ IH_TYPE_SCRIPT,	"script" },
+	{ IH_TYPE_STANDALONE,		"standalone" },
+	{ IH_TYPE_KERNEL,		"kernel" },
+	{ IH_TYPE_KERNEL_NOLOAD,	"kernel_noload" },
+	{ IH_TYPE_RAMDISK,		"ramdisk" },
+	{ IH_TYPE_FILESYSTEM,		"fs" },
+	{ IH_TYPE_SCRIPT,		"script" },
 };
 
 static enum uboot_image_type
@@ -221,7 +222,7 @@ usage(void)
 	"");
 	fprintf(stderr, " -C ");
 	fprintf(stderr, " -O ");
-	fprintf(stderr, " -T ");
+	fprintf(stderr, " -T ");
 	

CVS commit: [netbsd-8] src/lib/libc/compiler_rt

2017-07-24 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Jul 25 02:21:27 UTC 2017

Modified Files:
src/lib/libc/compiler_rt [netbsd-8]: Makefile.inc

Log Message:
Pull up following revision(s) (requested by martin in ticket #157):
lib/libc/compiler_rt/Makefile.inc: revision 1.35
Do not use IEEE 754 specific functions for VAX


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.33.2.1 src/lib/libc/compiler_rt/Makefile.inc

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



CVS commit: [netbsd-8] src/lib/libc/compiler_rt

2017-07-24 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Jul 25 02:21:27 UTC 2017

Modified Files:
src/lib/libc/compiler_rt [netbsd-8]: Makefile.inc

Log Message:
Pull up following revision(s) (requested by martin in ticket #157):
lib/libc/compiler_rt/Makefile.inc: revision 1.35
Do not use IEEE 754 specific functions for VAX


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.33.2.1 src/lib/libc/compiler_rt/Makefile.inc

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/compiler_rt/Makefile.inc
diff -u src/lib/libc/compiler_rt/Makefile.inc:1.33 src/lib/libc/compiler_rt/Makefile.inc:1.33.2.1
--- src/lib/libc/compiler_rt/Makefile.inc:1.33	Fri May 26 22:56:50 2017
+++ src/lib/libc/compiler_rt/Makefile.inc	Tue Jul 25 02:21:26 2017
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.inc,v 1.33 2017/05/26 22:56:50 joerg Exp $
+# $NetBSD: Makefile.inc,v 1.33.2.1 2017/07/25 02:21:26 snj Exp $
 
 COMPILER_RT_SRCDIR=	${NETBSDSRCDIR}/sys/external/bsd/compiler_rt/dist
 
@@ -31,6 +31,52 @@ GENERIC_SRCS+= \
 	gcc_personality_v0.c
 .endif
 
+GENERIC_SRCS+= \
+	absvsi2.c \
+	absvti2.c \
+	addvsi3.c \
+	addvti3.c \
+	ashlti3.c \
+	ashrti3.c \
+	clzti2.c \
+	cmpti2.c \
+	ctzti2.c \
+	divti3.c \
+	ffsti2.c \
+	fixsfdi.c \
+	fixdfdi.c \
+	fixunsdfdi.c \
+	fixunsdfsi.c \
+	fixunssfdi.c \
+	fixunssfsi.c \
+	fixunsxfdi.c \
+	fixunsxfsi.c \
+	int_util.c \
+	lshrti3.c \
+	modti3.c \
+	muldc3.c \
+	mulosi4.c \
+	muloti4.c \
+	multi3.c \
+	mulvsi3.c \
+	mulvti3.c \
+	negti2.c \
+	negvsi2.c \
+	negvti2.c \
+	paritysi2.c \
+	parityti2.c \
+	popcountsi2.c \
+	popcountti2.c \
+	subvsi3.c \
+	subvti3.c \
+	ucmpti2.c \
+	udivmodti4.c \
+	udivti3.c \
+	umodti3.c
+
+# only used for machines using IEEE 754 floating point formats
+.if ${MACHINE_ARCH} != "vax"
+
 .if 0
 # Conflicts with soft-float
 GENERIC_SRCS+= \
@@ -64,60 +110,21 @@ GENERIC_SRCS+= \
 	trunctfsf2.c
 .endif
 
-GENERIC_SRCS+= \
-	absvsi2.c \
-	absvti2.c \
-	addvsi3.c \
-	addvti3.c \
-	ashlti3.c \
-	ashrti3.c \
-	clzti2.c \
-	cmpti2.c \
-	ctzti2.c \
-	divti3.c \
-	ffsti2.c \
-	fixsfdi.c \
-	fixdfdi.c \
-	fixunsdfdi.c \
-	fixunsdfsi.c \
-	fixunssfdi.c \
-	fixunssfsi.c \
-	fixunsxfdi.c \
-	fixunsxfsi.c \
+GENERIC_SRCS+=	\
 	floatdidf.c \
 	floatdisf.c \
 	floatdixf.c \
 	floatundidf.c \
 	floatundisf.c \
 	floatundixf.c \
-	int_util.c \
-	lshrti3.c \
-	modti3.c \
-	muldc3.c \
-	mulosi4.c \
-	muloti4.c \
-	multi3.c \
-	mulvsi3.c \
-	mulvti3.c \
 	negdf2.c \
 	negsf2.c \
-	negti2.c \
-	negvsi2.c \
-	negvti2.c \
-	paritysi2.c \
-	parityti2.c \
-	popcountsi2.c \
-	popcountti2.c \
 	powidf2.c \
 	powisf2.c \
 	powitf2.c \
-	powixf2.c \
-	subvsi3.c \
-	subvti3.c \
-	ucmpti2.c \
-	udivmodti4.c \
-	udivti3.c \
-	umodti3.c
+	powixf2.c
+
+.endif # IEEE 754 only machines
 
 .if ${MACHINE_ARCH} != "m68k"
 GENERIC_SRCS+= \



CVS commit: [netbsd-8] src/sys

2017-07-24 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Jul 25 01:29:56 UTC 2017

Modified Files:
src/sys/kern [netbsd-8]: vnode_if.c
src/sys/rump/include/rump [netbsd-8]: rumpvnode_if.h
src/sys/rump/librump/rumpvfs [netbsd-8]: rumpvnode_if.c
src/sys/sys [netbsd-8]: vnode_if.h

Log Message:
regen for ticket 130


To generate a diff of this commit:
cvs rdiff -u -r1.104.2.1 -r1.104.2.2 src/sys/kern/vnode_if.c
cvs rdiff -u -r1.28.2.1 -r1.28.2.2 src/sys/rump/include/rump/rumpvnode_if.h
cvs rdiff -u -r1.28.2.1 -r1.28.2.2 \
src/sys/rump/librump/rumpvfs/rumpvnode_if.c
cvs rdiff -u -r1.99.2.1 -r1.99.2.2 src/sys/sys/vnode_if.h

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

Modified files:

Index: src/sys/kern/vnode_if.c
diff -u src/sys/kern/vnode_if.c:1.104.2.1 src/sys/kern/vnode_if.c:1.104.2.2
--- src/sys/kern/vnode_if.c:1.104.2.1	Sun Jun  4 20:35:01 2017
+++ src/sys/kern/vnode_if.c	Tue Jul 25 01:29:56 2017
@@ -1,13 +1,13 @@
-/*	$NetBSD: vnode_if.c,v 1.104.2.1 2017/06/04 20:35:01 bouyer Exp $	*/
+/*	$NetBSD: vnode_if.c,v 1.104.2.2 2017/07/25 01:29:56 snj Exp $	*/
 
 /*
  * Warning: DO NOT EDIT! This file is automatically generated!
  * (Modifications made here may easily be lost!)
  *
  * Created from the file:
- *	NetBSD: vnode_if.src,v 1.76 2017/06/04 07:59:17 hannken Exp
+ *	NetBSD: vnode_if.src,v 1.75.2.2 2017/07/25 01:29:23 snj Exp
  * by the script:
- *	NetBSD: vnode_if.sh,v 1.66 2017/06/04 08:03:26 hannken Exp
+ *	NetBSD: vnode_if.sh,v 1.64.4.1 2017/06/04 20:35:01 bouyer Exp
  */
 
 /*
@@ -40,7 +40,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vnode_if.c,v 1.104.2.1 2017/06/04 20:35:01 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vnode_if.c,v 1.104.2.2 2017/07/25 01:29:56 snj Exp $");
 
 #include 
 #include 
@@ -1510,11 +1510,11 @@ VOP_ADVLOCK(struct vnode *vp,
 	a.a_op = op;
 	a.a_fl = fl;
 	a.a_flags = flags;
-	error = vop_pre(vp, , , FST_YES);
+	error = vop_pre(vp, , , FST_NO);
 	if (error)
 		return error;
 	error = (VCALL(vp, VOFFSET(vop_advlock), ));
-	vop_post(vp, mp, mpsafe, FST_YES);
+	vop_post(vp, mp, mpsafe, FST_NO);
 	return error;
 }
 

Index: src/sys/rump/include/rump/rumpvnode_if.h
diff -u src/sys/rump/include/rump/rumpvnode_if.h:1.28.2.1 src/sys/rump/include/rump/rumpvnode_if.h:1.28.2.2
--- src/sys/rump/include/rump/rumpvnode_if.h:1.28.2.1	Sun Jun  4 20:35:01 2017
+++ src/sys/rump/include/rump/rumpvnode_if.h	Tue Jul 25 01:29:56 2017
@@ -1,13 +1,13 @@
-/*	$NetBSD: rumpvnode_if.h,v 1.28.2.1 2017/06/04 20:35:01 bouyer Exp $	*/
+/*	$NetBSD: rumpvnode_if.h,v 1.28.2.2 2017/07/25 01:29:56 snj Exp $	*/
 
 /*
  * Warning: DO NOT EDIT! This file is automatically generated!
  * (Modifications made here may easily be lost!)
  *
  * Created from the file:
- *	NetBSD: vnode_if.src,v 1.76 2017/06/04 07:59:17 hannken Exp
+ *	NetBSD: vnode_if.src,v 1.75.2.2 2017/07/25 01:29:23 snj Exp
  * by the script:
- *	NetBSD: vnode_if.sh,v 1.66 2017/06/04 08:03:26 hannken Exp
+ *	NetBSD: vnode_if.sh,v 1.64.4.1 2017/06/04 20:35:01 bouyer Exp
  */
 
 /*

Index: src/sys/rump/librump/rumpvfs/rumpvnode_if.c
diff -u src/sys/rump/librump/rumpvfs/rumpvnode_if.c:1.28.2.1 src/sys/rump/librump/rumpvfs/rumpvnode_if.c:1.28.2.2
--- src/sys/rump/librump/rumpvfs/rumpvnode_if.c:1.28.2.1	Sun Jun  4 20:35:01 2017
+++ src/sys/rump/librump/rumpvfs/rumpvnode_if.c	Tue Jul 25 01:29:56 2017
@@ -1,13 +1,13 @@
-/*	$NetBSD: rumpvnode_if.c,v 1.28.2.1 2017/06/04 20:35:01 bouyer Exp $	*/
+/*	$NetBSD: rumpvnode_if.c,v 1.28.2.2 2017/07/25 01:29:56 snj Exp $	*/
 
 /*
  * Warning: DO NOT EDIT! This file is automatically generated!
  * (Modifications made here may easily be lost!)
  *
  * Created from the file:
- *	NetBSD: vnode_if.src,v 1.76 2017/06/04 07:59:17 hannken Exp
+ *	NetBSD: vnode_if.src,v 1.75.2.2 2017/07/25 01:29:23 snj Exp
  * by the script:
- *	NetBSD: vnode_if.sh,v 1.66 2017/06/04 08:03:26 hannken Exp
+ *	NetBSD: vnode_if.sh,v 1.64.4.1 2017/06/04 20:35:01 bouyer Exp
  */
 
 /*
@@ -40,7 +40,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rumpvnode_if.c,v 1.28.2.1 2017/06/04 20:35:01 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rumpvnode_if.c,v 1.28.2.2 2017/07/25 01:29:56 snj Exp $");
 
 #include 
 #include 

Index: src/sys/sys/vnode_if.h
diff -u src/sys/sys/vnode_if.h:1.99.2.1 src/sys/sys/vnode_if.h:1.99.2.2
--- src/sys/sys/vnode_if.h:1.99.2.1	Sun Jun  4 20:35:01 2017
+++ src/sys/sys/vnode_if.h	Tue Jul 25 01:29:56 2017
@@ -1,13 +1,13 @@
-/*	$NetBSD: vnode_if.h,v 1.99.2.1 2017/06/04 20:35:01 bouyer Exp $	*/
+/*	$NetBSD: vnode_if.h,v 1.99.2.2 2017/07/25 01:29:56 snj Exp $	*/
 
 /*
  * Warning: DO NOT EDIT! This file is automatically generated!
  * (Modifications made here may easily be lost!)
  *
  * Created from the file:
- *	NetBSD: vnode_if.src,v 1.76 2017/06/04 07:59:17 hannken Exp
+ *	NetBSD: vnode_if.src,v 1.75.2.2 2017/07/25 01:29:23 snj Exp
  * by the script:
- *	NetBSD: vnode_if.sh,v 1.66 2017/06/04 08:03:26 hannken 

CVS commit: [netbsd-8] src/sys/dev/usb

2017-07-24 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Jul 25 01:39:42 UTC 2017

Modified Files:
src/sys/dev/usb [netbsd-8]: uhci.c

Log Message:
Pull up following revision(s) (requested by skrll in ticket #136):
sys/dev/usb/uhci.c: revision 1.276
Only call uhci_free_stds if there are TDs to free.
In uhci_alloc_std_chain ensure we fill the TD array correctly and note
the number of allocated TDs so that uhci_free_stds will do the right thing
Fixes a problem seen by anon


To generate a diff of this commit:
cvs rdiff -u -r1.275 -r1.275.2.1 src/sys/dev/usb/uhci.c

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

Modified files:

Index: src/sys/dev/usb/uhci.c
diff -u src/sys/dev/usb/uhci.c:1.275 src/sys/dev/usb/uhci.c:1.275.2.1
--- src/sys/dev/usb/uhci.c:1.275	Thu Jun  1 02:45:12 2017
+++ src/sys/dev/usb/uhci.c	Tue Jul 25 01:39:41 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: uhci.c,v 1.275 2017/06/01 02:45:12 chs Exp $	*/
+/*	$NetBSD: uhci.c,v 1.275.2.1 2017/07/25 01:39:41 snj Exp $	*/
 
 /*
  * Copyright (c) 1998, 2004, 2011, 2012 The NetBSD Foundation, Inc.
@@ -42,7 +42,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uhci.c,v 1.275 2017/06/01 02:45:12 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uhci.c,v 1.275.2.1 2017/07/25 01:39:41 snj Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -1995,7 +1995,6 @@ uhci_alloc_std_chain(uhci_softc_t *sc, s
 
 	uxfer->ux_stds = NULL;
 	uxfer->ux_nstd = ntd;
-	p = NULL;
 	if (ntd == 0) {
 		*sp = NULL;
 		DPRINTF("ntd=0", 0, 0, 0, 0);
@@ -2004,11 +2003,13 @@ uhci_alloc_std_chain(uhci_softc_t *sc, s
 	uxfer->ux_stds = kmem_alloc(sizeof(uhci_soft_td_t *) * ntd,
 	KM_SLEEP);
 
-	ntd--;
-	for (int i = ntd; i >= 0; i--) {
+	for (int i = 0; i < ntd; i++) {
 		p = uhci_alloc_std(sc);
 		if (p == NULL) {
-			uhci_free_stds(sc, uxfer);
+			if (i != 0) {
+uxfer->ux_nstd = i;
+uhci_free_stds(sc, uxfer);
+			}
 			kmem_free(uxfer->ux_stds,
 			sizeof(uhci_soft_td_t *) * ntd);
 			return ENOMEM;
@@ -2212,9 +2213,10 @@ uhci_device_bulk_fini(struct usbd_xfer *
 
 	KASSERT(ux->ux_type == UX_BULK);
 
-	uhci_free_stds(sc, ux);
-	if (ux->ux_nstd)
+	if (ux->ux_nstd) {
+		uhci_free_stds(sc, ux);
 		kmem_free(ux->ux_stds, sizeof(uhci_soft_td_t *) * ux->ux_nstd);
+	}
 }
 
 usbd_status
@@ -2482,9 +2484,10 @@ uhci_device_ctrl_fini(struct usbd_xfer *
 
 	KASSERT(ux->ux_type == UX_CTRL);
 
-	uhci_free_stds(sc, ux);
-	if (ux->ux_nstd)
+	if (ux->ux_nstd) {
+		uhci_free_stds(sc, ux);
 		kmem_free(ux->ux_stds, sizeof(uhci_soft_td_t *) * ux->ux_nstd);
+	}
 }
 
 usbd_status
@@ -2687,9 +2690,10 @@ uhci_device_intr_fini(struct usbd_xfer *
 
 	KASSERT(ux->ux_type == UX_INTR);
 
-	uhci_free_stds(sc, ux);
-	if (ux->ux_nstd)
+	if (ux->ux_nstd) {
+		uhci_free_stds(sc, ux);
 		kmem_free(ux->ux_stds, sizeof(uhci_soft_td_t *) * ux->ux_nstd);
+	}
 }
 
 usbd_status



CVS commit: [netbsd-8] src/sys/dev/usb

2017-07-24 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Jul 25 01:39:42 UTC 2017

Modified Files:
src/sys/dev/usb [netbsd-8]: uhci.c

Log Message:
Pull up following revision(s) (requested by skrll in ticket #136):
sys/dev/usb/uhci.c: revision 1.276
Only call uhci_free_stds if there are TDs to free.
In uhci_alloc_std_chain ensure we fill the TD array correctly and note
the number of allocated TDs so that uhci_free_stds will do the right thing
Fixes a problem seen by anon


To generate a diff of this commit:
cvs rdiff -u -r1.275 -r1.275.2.1 src/sys/dev/usb/uhci.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/lib/libunwind

2017-07-24 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Jul 25 01:38:42 UTC 2017

Modified Files:
src/sys/lib/libunwind [netbsd-8]: Registers.hpp

Log Message:
Pull up following revision(s) (requested by joerg in ticket #134):
sys/lib/libunwind/Registers.hpp: revision 1.20
GCC 5.3 likes to emit unwind data with float registers, i.e. register
halfs. Compensate.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.19.12.1 src/sys/lib/libunwind/Registers.hpp

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

Modified files:

Index: src/sys/lib/libunwind/Registers.hpp
diff -u src/sys/lib/libunwind/Registers.hpp:1.19 src/sys/lib/libunwind/Registers.hpp:1.19.12.1
--- src/sys/lib/libunwind/Registers.hpp:1.19	Sat Sep 27 12:08:46 2014
+++ src/sys/lib/libunwind/Registers.hpp	Tue Jul 25 01:38:42 2017
@@ -12,6 +12,7 @@
 #ifndef __REGISTERS_HPP__
 #define __REGISTERS_HPP__
 
+#include 
 #include 
 #include 
 
@@ -323,8 +324,8 @@ enum {
   DWARF_ARM32_R0 = 0,
   DWARF_ARM32_R15 = 15,
   DWARF_ARM32_SPSR = 128,
-  DWARF_ARM32_OLD_S0 = 64,
-  DWARF_ARM32_OLD_S31 = 91,
+  DWARF_ARM32_S0 = 64,
+  DWARF_ARM32_S31 = 91,
   DWARF_ARM32_D0 = 256,
   DWARF_ARM32_D31 = 287,
   REGNO_ARM32_R0 = 0,
@@ -334,6 +335,8 @@ enum {
   REGNO_ARM32_D0 = 17,
   REGNO_ARM32_D15 = 32,
   REGNO_ARM32_D31 = 48,
+  REGNO_ARM32_S0 = 49,
+  REGNO_ARM32_S31 = 70,
 };
 
 class Registers_arm32 {
@@ -354,9 +357,8 @@ public:
   return REGNO_ARM32_SPSR;
 if (num >= DWARF_ARM32_D0 && num <= DWARF_ARM32_D31)
   return REGNO_ARM32_D0 + (num - DWARF_ARM32_D0);
-if (num >= DWARF_ARM32_OLD_S0 && num <= DWARF_ARM32_OLD_S31) {
-  assert(num % 2 == 0);
-  return REGNO_ARM32_D0 + (num - DWARF_ARM32_OLD_S0) / 2;
+if (num >= DWARF_ARM32_S0 && num <= DWARF_ARM32_S31) {
+  return REGNO_ARM32_S0 + (num - DWARF_ARM32_S0);
 }
 return LAST_REGISTER + 1;
   }
@@ -384,10 +386,28 @@ public:
   void setSP(uint64_t value) { reg[REGNO_ARM32_SP] = value; }
 
   bool validFloatVectorRegister(int num) const {
-return (num >= REGNO_ARM32_D0 && num <= REGNO_ARM32_D31);
+return (num >= REGNO_ARM32_D0 && num <= REGNO_ARM32_S31);
   }
 
   void copyFloatVectorRegister(int num, uint64_t addr_) {
+const void *addr = reinterpret_cast(addr_);
+if (num >= REGNO_ARM32_S0 && num <= REGNO_ARM32_S31) {
+  if ((flags & 1) == 0) {
+lazyVFP1();
+flags |= 1;
+  }
+  /*
+   * Emulate single precision register as half of the
+   * corresponding double register.
+   */
+  int dnum = (num - REGNO_ARM32_S0) / 2;
+  int part = (num - REGNO_ARM32_S0) % 2;
+#if _BYTE_ORDER == _BIG_ENDIAN
+  part = 1 - part;
+#endif
+  memcpy(fpreg + dnum + part * sizeof(fpreg[0]) / 2,
+addr, sizeof(fpreg[0]) / 2);
+}
 if (num <= REGNO_ARM32_D15) {
   if ((flags & 1) == 0) {
 lazyVFP1();
@@ -399,7 +419,6 @@ public:
 flags |= 2;
   }
 }
-const void *addr = reinterpret_cast(addr_);
 memcpy(fpreg + (num - REGNO_ARM32_D0), addr, sizeof(fpreg[0]));
   }
 



CVS commit: [netbsd-8] src/sys/lib/libunwind

2017-07-24 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Jul 25 01:38:42 UTC 2017

Modified Files:
src/sys/lib/libunwind [netbsd-8]: Registers.hpp

Log Message:
Pull up following revision(s) (requested by joerg in ticket #134):
sys/lib/libunwind/Registers.hpp: revision 1.20
GCC 5.3 likes to emit unwind data with float registers, i.e. register
halfs. Compensate.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.19.12.1 src/sys/lib/libunwind/Registers.hpp

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/arch/arm/sunxi

2017-07-24 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Jul 25 02:03:17 UTC 2017

Modified Files:
src/sys/arch/arm/sunxi [netbsd-8]: files.sunxi sun8i_h3_ccu.c
sunxi_ccu.c sunxi_ccu.h sunxi_mmc.c sunxi_mmc.h
Added Files:
src/sys/arch/arm/sunxi [netbsd-8]: sunxi_ccu_phase.c

Log Message:
Pull up following revision(s) (requested by jmcneill in ticket #143):
sys/arch/arm/sunxi/files.sunxi: revision 1.12
sys/arch/arm/sunxi/sun8i_h3_ccu.c: revision 1.8
sys/arch/arm/sunxi/sunxi_ccu.c: revision 1.6
sys/arch/arm/sunxi/sunxi_ccu.h: revision 1.7
sys/arch/arm/sunxi/sunxi_ccu_phase.c: revision 1.1
sys/arch/arm/sunxi/sunxi_mmc.c: revision 1.3
sys/arch/arm/sunxi/sunxi_mmc.h: revision 1.2
Add SDMMC[012] sample/output clock phase controls.
--
Add support for eMMC DDR52 transfer mode.


To generate a diff of this commit:
cvs rdiff -u -r1.12.4.2 -r1.12.4.3 src/sys/arch/arm/sunxi/files.sunxi
cvs rdiff -u -r1.8.4.2 -r1.8.4.3 src/sys/arch/arm/sunxi/sun8i_h3_ccu.c
cvs rdiff -u -r1.6.4.2 -r1.6.4.3 src/sys/arch/arm/sunxi/sunxi_ccu.c
cvs rdiff -u -r1.7.4.2 -r1.7.4.3 src/sys/arch/arm/sunxi/sunxi_ccu.h
cvs rdiff -u -r0 -r1.1.4.2 src/sys/arch/arm/sunxi/sunxi_ccu_phase.c
cvs rdiff -u -r1.3.4.3 -r1.3.4.4 src/sys/arch/arm/sunxi/sunxi_mmc.c
cvs rdiff -u -r1.2.4.2 -r1.2.4.3 src/sys/arch/arm/sunxi/sunxi_mmc.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/arch/arm/sunxi/files.sunxi
diff -u src/sys/arch/arm/sunxi/files.sunxi:1.12.4.2 src/sys/arch/arm/sunxi/files.sunxi:1.12.4.3
--- src/sys/arch/arm/sunxi/files.sunxi:1.12.4.2	Tue Jul 18 19:13:08 2017
+++ src/sys/arch/arm/sunxi/files.sunxi	Tue Jul 25 02:03:16 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: files.sunxi,v 1.12.4.2 2017/07/18 19:13:08 snj Exp $
+#	$NetBSD: files.sunxi,v 1.12.4.3 2017/07/25 02:03:16 snj Exp $
 #
 # Configuration info for Allwinner sunxi family SoCs
 #
@@ -24,6 +24,7 @@ file	arch/arm/sunxi/sunxi_ccu_div.c		sun
 file	arch/arm/sunxi/sunxi_ccu_gate.c		sunxi_ccu
 file	arch/arm/sunxi/sunxi_ccu_nm.c		sunxi_ccu
 file	arch/arm/sunxi/sunxi_ccu_nkmp.c		sunxi_ccu
+file	arch/arm/sunxi/sunxi_ccu_phase.c	sunxi_ccu
 file	arch/arm/sunxi/sunxi_ccu_prediv.c	sunxi_ccu
 
 # CCU (A31)

Index: src/sys/arch/arm/sunxi/sun8i_h3_ccu.c
diff -u src/sys/arch/arm/sunxi/sun8i_h3_ccu.c:1.8.4.2 src/sys/arch/arm/sunxi/sun8i_h3_ccu.c:1.8.4.3
--- src/sys/arch/arm/sunxi/sun8i_h3_ccu.c:1.8.4.2	Tue Jul 18 19:13:08 2017
+++ src/sys/arch/arm/sunxi/sun8i_h3_ccu.c	Tue Jul 25 02:03:16 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: sun8i_h3_ccu.c,v 1.8.4.2 2017/07/18 19:13:08 snj Exp $ */
+/* $NetBSD: sun8i_h3_ccu.c,v 1.8.4.3 2017/07/25 02:03:16 snj Exp $ */
 
 /*-
  * Copyright (c) 2017 Jared McNeill 
@@ -29,7 +29,7 @@
 
 #include 
 
-__KERNEL_RCSID(1, "$NetBSD: sun8i_h3_ccu.c,v 1.8.4.2 2017/07/18 19:13:08 snj Exp $");
+__KERNEL_RCSID(1, "$NetBSD: sun8i_h3_ccu.c,v 1.8.4.3 2017/07/25 02:03:16 snj Exp $");
 
 #include 
 #include 
@@ -184,12 +184,24 @@ static struct sunxi_ccu_clk sun8i_h3_ccu
 	SUNXI_CCU_NM(H3_CLK_MMC0, "mmc0", mod_parents,
 	SDMMC0_CLK_REG, __BITS(17, 16), __BITS(3,0), __BITS(25, 24), __BIT(31),
 	SUNXI_CCU_NM_POWER_OF_TWO|SUNXI_CCU_NM_ROUND_DOWN),
+	SUNXI_CCU_PHASE(H3_CLK_MMC0_SAMPLE, "mmc0_sample", "mmc0",
+	SDMMC0_CLK_REG, __BITS(22,20)),
+	SUNXI_CCU_PHASE(H3_CLK_MMC0_OUTPUT, "mmc0_output", "mmc0",
+	SDMMC0_CLK_REG, __BITS(10,8)),
 	SUNXI_CCU_NM(H3_CLK_MMC1, "mmc1", mod_parents,
 	SDMMC1_CLK_REG, __BITS(17, 16), __BITS(3,0), __BITS(25, 24), __BIT(31),
 	SUNXI_CCU_NM_POWER_OF_TWO|SUNXI_CCU_NM_ROUND_DOWN),
+	SUNXI_CCU_PHASE(H3_CLK_MMC1_SAMPLE, "mmc1_sample", "mmc1",
+	SDMMC1_CLK_REG, __BITS(22,20)),
+	SUNXI_CCU_PHASE(H3_CLK_MMC1_OUTPUT, "mmc1_output", "mmc1",
+	SDMMC1_CLK_REG, __BITS(10,8)),
 	SUNXI_CCU_NM(H3_CLK_MMC2, "mmc2", mod_parents,
 	SDMMC2_CLK_REG, __BITS(17, 16), __BITS(3,0), __BITS(25, 24), __BIT(31),
 	SUNXI_CCU_NM_POWER_OF_TWO|SUNXI_CCU_NM_ROUND_DOWN),
+	SUNXI_CCU_PHASE(H3_CLK_MMC2_SAMPLE, "mmc2_sample", "mmc2",
+	SDMMC2_CLK_REG, __BITS(22,20)),
+	SUNXI_CCU_PHASE(H3_CLK_MMC2_OUTPUT, "mmc2_output", "mmc2",
+	SDMMC2_CLK_REG, __BITS(10,8)),
 
 	SUNXI_CCU_GATE(H3_CLK_BUS_MMC0, "bus-mmc0", "ahb1",
 	BUS_CLK_GATING_REG0, 8),

Index: src/sys/arch/arm/sunxi/sunxi_ccu.c
diff -u src/sys/arch/arm/sunxi/sunxi_ccu.c:1.6.4.2 src/sys/arch/arm/sunxi/sunxi_ccu.c:1.6.4.3
--- src/sys/arch/arm/sunxi/sunxi_ccu.c:1.6.4.2	Tue Jul 18 19:13:08 2017
+++ src/sys/arch/arm/sunxi/sunxi_ccu.c	Tue Jul 25 02:03:16 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: sunxi_ccu.c,v 1.6.4.2 2017/07/18 19:13:08 snj Exp $ */
+/* $NetBSD: sunxi_ccu.c,v 1.6.4.3 2017/07/25 02:03:16 snj Exp $ */
 
 /*-
  * Copyright (c) 2017 Jared McNeill 
@@ -31,7 +31,7 @@
 #include "opt_fdt_arm.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sunxi_ccu.c,v 1.6.4.2 2017/07/18 19:13:08 snj Exp $");

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

2017-07-24 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Jul 25 02:03:17 UTC 2017

Modified Files:
src/sys/arch/arm/sunxi [netbsd-8]: files.sunxi sun8i_h3_ccu.c
sunxi_ccu.c sunxi_ccu.h sunxi_mmc.c sunxi_mmc.h
Added Files:
src/sys/arch/arm/sunxi [netbsd-8]: sunxi_ccu_phase.c

Log Message:
Pull up following revision(s) (requested by jmcneill in ticket #143):
sys/arch/arm/sunxi/files.sunxi: revision 1.12
sys/arch/arm/sunxi/sun8i_h3_ccu.c: revision 1.8
sys/arch/arm/sunxi/sunxi_ccu.c: revision 1.6
sys/arch/arm/sunxi/sunxi_ccu.h: revision 1.7
sys/arch/arm/sunxi/sunxi_ccu_phase.c: revision 1.1
sys/arch/arm/sunxi/sunxi_mmc.c: revision 1.3
sys/arch/arm/sunxi/sunxi_mmc.h: revision 1.2
Add SDMMC[012] sample/output clock phase controls.
--
Add support for eMMC DDR52 transfer mode.


To generate a diff of this commit:
cvs rdiff -u -r1.12.4.2 -r1.12.4.3 src/sys/arch/arm/sunxi/files.sunxi
cvs rdiff -u -r1.8.4.2 -r1.8.4.3 src/sys/arch/arm/sunxi/sun8i_h3_ccu.c
cvs rdiff -u -r1.6.4.2 -r1.6.4.3 src/sys/arch/arm/sunxi/sunxi_ccu.c
cvs rdiff -u -r1.7.4.2 -r1.7.4.3 src/sys/arch/arm/sunxi/sunxi_ccu.h
cvs rdiff -u -r0 -r1.1.4.2 src/sys/arch/arm/sunxi/sunxi_ccu_phase.c
cvs rdiff -u -r1.3.4.3 -r1.3.4.4 src/sys/arch/arm/sunxi/sunxi_mmc.c
cvs rdiff -u -r1.2.4.2 -r1.2.4.3 src/sys/arch/arm/sunxi/sunxi_mmc.h

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/fs/union

2017-07-24 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Jul 25 02:04:43 UTC 2017

Modified Files:
src/sys/fs/union [netbsd-8]: union.h union_subr.c

Log Message:
Pull up following revision(s) (requested by hannken in ticket #145):
sys/fs/union/union.h: revision 1.29
sys/fs/union/union_subr.c: revision 1.76
Make union_newlower() ans union_newupper() local to union_subr.c,
expand and remove union_updatevp() and take care to transfer the
vnode lock from the union vnode to its new upper vnode without
breaking the fstrans state.
Add assertions that un_lowervp and un_uppervp never change from
non-NULL to non-NULL.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.28.10.1 src/sys/fs/union/union.h
cvs rdiff -u -r1.75 -r1.75.2.1 src/sys/fs/union/union_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/fs/union/union.h
diff -u src/sys/fs/union/union.h:1.28 src/sys/fs/union/union.h:1.28.10.1
--- src/sys/fs/union/union.h:1.28	Mon Feb 16 10:22:00 2015
+++ src/sys/fs/union/union.h	Tue Jul 25 02:04:42 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: union.h,v 1.28 2015/02/16 10:22:00 hannken Exp $	*/
+/*	$NetBSD: union.h,v 1.28.10.1 2017/07/25 02:04:42 snj Exp $	*/
 
 /*
  * Copyright (c) 1994 The Regents of the University of California.
@@ -158,8 +158,6 @@ extern int union_cn_close(struct vnode *
 struct lwp *);
 extern void union_removed_upper(struct union_node *un);
 extern struct vnode *union_lowervp(struct vnode *);
-extern void union_newlower(struct union_node *, struct vnode *);
-extern void union_newupper(struct union_node *, struct vnode *);
 extern void union_newsize(struct vnode *, off_t, off_t);
 int union_readdirhook(struct vnode **, struct file *, struct lwp *);
 

Index: src/sys/fs/union/union_subr.c
diff -u src/sys/fs/union/union_subr.c:1.75 src/sys/fs/union/union_subr.c:1.75.2.1
--- src/sys/fs/union/union_subr.c:1.75	Thu Jun  1 02:45:13 2017
+++ src/sys/fs/union/union_subr.c	Tue Jul 25 02:04:42 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: union_subr.c,v 1.75 2017/06/01 02:45:13 chs Exp $	*/
+/*	$NetBSD: union_subr.c,v 1.75.2.1 2017/07/25 02:04:42 snj Exp $	*/
 
 /*
  * Copyright (c) 1994
@@ -72,7 +72,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: union_subr.c,v 1.75 2017/06/01 02:45:13 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: union_subr.c,v 1.75.2.1 2017/07/25 02:04:42 snj Exp $");
 
 #include 
 #include 
@@ -104,7 +104,8 @@ static u_long uhash_mask;		/* size of ha
 
 static kmutex_t uhash_lock;
 
-void union_updatevp(struct union_node *, struct vnode *, struct vnode *);
+static void union_newupper(struct union_node *, struct vnode *);
+static void union_newlower(struct union_node *, struct vnode *);
 static void union_ref(struct union_node *);
 static void union_rele(struct union_node *);
 static int union_do_lookup(struct vnode *, struct componentname *, kauth_cred_t,const char *);
@@ -160,71 +161,28 @@ union_done(void)
 }
 
 void
-union_updatevp(struct union_node *un, struct vnode *uppervp,
-	struct vnode *lowervp)
+union_newlower(struct union_node *un, struct vnode *lowervp)
 {
 	int ohash = UNION_HASH(un->un_uppervp, un->un_lowervp);
-	int nhash = UNION_HASH(uppervp, lowervp);
-	int docache = (lowervp != NULLVP || uppervp != NULLVP);
-	bool un_unlock;
+	int nhash = UNION_HASH(un->un_uppervp, lowervp);
+
+	if (un->un_lowervp == lowervp)
+		return;
 
 	KASSERT(VOP_ISLOCKED(UNIONTOV(un)) == LK_EXCLUSIVE);
+	KASSERT(un->un_lowervp == NULL);
 
 	mutex_enter(_lock);
 
-	if (!docache || ohash != nhash) {
-		if (un->un_cflags & UN_CACHED) {
-			un->un_cflags &= ~UN_CACHED;
-			LIST_REMOVE(un, un_cache);
-		}
-	}
-
-	if (un->un_lowervp != lowervp) {
-		if (un->un_lowervp) {
-			vrele(un->un_lowervp);
-			if (un->un_path) {
-free(un->un_path, M_TEMP);
-un->un_path = 0;
-			}
-			if (un->un_dirvp) {
-vrele(un->un_dirvp);
-un->un_dirvp = NULLVP;
-			}
-		}
-		un->un_lowervp = lowervp;
-		mutex_enter(>un_lock);
-		un->un_lowersz = VNOVAL;
-		mutex_exit(>un_lock);
-	}
-
-	if (un->un_uppervp != uppervp) {
-		if (un->un_uppervp) {
-			un_unlock = false;
-			vrele(un->un_uppervp);
-		} else
-			un_unlock = true;
-
-		mutex_enter(>un_lock);
-		un->un_uppervp = uppervp;
-		mutex_exit(>un_lock);
-		if (un_unlock) {
-			struct vop_unlock_args ap;
-
-			ap.a_vp = UNIONTOV(un);
-			genfs_unlock();
-		}
-		mutex_enter(>un_lock);
-		un->un_uppersz = VNOVAL;
-		mutex_exit(>un_lock);
-		/* Update union vnode interlock. */
-		if (uppervp != NULL) {
-			mutex_obj_hold(uppervp->v_interlock);
-			uvm_obj_setlock((un)->v_uobj,
-			uppervp->v_interlock);
-		}
+	if (ohash != nhash && (un->un_cflags & UN_CACHED)) {
+		un->un_cflags &= ~UN_CACHED;
+		LIST_REMOVE(un, un_cache);
 	}
-
-	if (docache && (ohash != nhash)) {
+	mutex_enter(>un_lock);
+	un->un_lowervp = lowervp;
+	un->un_lowersz = VNOVAL;
+	mutex_exit(>un_lock);
+	if (ohash != nhash) {
 		LIST_INSERT_HEAD([nhash], un, un_cache);
 

CVS commit: [netbsd-8] src/sys/fs/union

2017-07-24 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Jul 25 02:04:43 UTC 2017

Modified Files:
src/sys/fs/union [netbsd-8]: union.h union_subr.c

Log Message:
Pull up following revision(s) (requested by hannken in ticket #145):
sys/fs/union/union.h: revision 1.29
sys/fs/union/union_subr.c: revision 1.76
Make union_newlower() ans union_newupper() local to union_subr.c,
expand and remove union_updatevp() and take care to transfer the
vnode lock from the union vnode to its new upper vnode without
breaking the fstrans state.
Add assertions that un_lowervp and un_uppervp never change from
non-NULL to non-NULL.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.28.10.1 src/sys/fs/union/union.h
cvs rdiff -u -r1.75 -r1.75.2.1 src/sys/fs/union/union_subr.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

2017-07-24 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Jul 25 02:11:14 UTC 2017

Modified Files:
src/sys/arch/sparc/conf [netbsd-8]: files.sparc
src/sys/arch/sparc/sparc [netbsd-8]: db_interface.c
src/usr.sbin/crash [netbsd-8]: Makefile
Added Files:
src/sys/arch/sparc/sparc [netbsd-8]: db_machdep.c

Log Message:
Pull up following revision(s) (requested by nakayama in ticket #152):
usr.sbin/crash/Makefile: revision 1.37
sys/arch/sparc/conf/files.sparc: revision 1.157
sys/arch/sparc/sparc/db_interface.c: revision 1.94
sys/arch/sparc/sparc/db_machdep.c: revision 1.1
Move the ddb registers and empty command table used for crash(8) into
db_machdep.c like other archs.
--
sparc has db_machdep.c now.


To generate a diff of this commit:
cvs rdiff -u -r1.156 -r1.156.10.1 src/sys/arch/sparc/conf/files.sparc
cvs rdiff -u -r1.93 -r1.93.8.1 src/sys/arch/sparc/sparc/db_interface.c
cvs rdiff -u -r0 -r1.1.2.2 src/sys/arch/sparc/sparc/db_machdep.c
cvs rdiff -u -r1.36 -r1.36.4.1 src/usr.sbin/crash/Makefile

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/arch/evbarm/fdt

2017-07-24 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Jul 25 02:09:33 UTC 2017

Modified Files:
src/sys/arch/evbarm/fdt [netbsd-8]: fdt_machdep.c

Log Message:
Pull up following revision(s) (requested by jmcneill in ticket #151):
sys/arch/evbarm/fdt/fdt_machdep.c: revision 1.11
Fix reserved memory handling.


To generate a diff of this commit:
cvs rdiff -u -r1.4.2.3 -r1.4.2.4 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.4.2.3 src/sys/arch/evbarm/fdt/fdt_machdep.c:1.4.2.4
--- src/sys/arch/evbarm/fdt/fdt_machdep.c:1.4.2.3	Tue Jul 18 19:13:09 2017
+++ src/sys/arch/evbarm/fdt/fdt_machdep.c	Tue Jul 25 02:09:32 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: fdt_machdep.c,v 1.4.2.3 2017/07/18 19:13:09 snj Exp $ */
+/* $NetBSD: fdt_machdep.c,v 1.4.2.4 2017/07/25 02:09:32 snj Exp $ */
 
 /*-
  * Copyright (c) 2015-2017 Jared McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: fdt_machdep.c,v 1.4.2.3 2017/07/18 19:13:09 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fdt_machdep.c,v 1.4.2.4 2017/07/25 02:09:32 snj Exp $");
 
 #include "opt_machdep.h"
 #include "opt_ddb.h"
@@ -182,25 +182,32 @@ fdt_add_reserved_memory_range(uint64_t a
 {
 	int error;
 
+	addr = trunc_page(addr);
+	size = round_page(size);
+
 	error = extent_free(fdt_memory_ext, addr, size, EX_NOWAIT);
 	if (error != 0)
-		printf("MEM ERROR: add %llx-%llx failed: %d\n",
-		addr, size, error);
-	DPRINTF("MEM: res %llx-%llx: %d\n", addr, size, error);
+		printf("MEM ERROR: res %llx-%llx failed: %d\n",
+		addr, addr + size, error);
+	else
+		DPRINTF("MEM: res %llx-%llx\n", addr, addr + size);
 }
 
 /*
- * Exclude memory ranges from memory config from a /reserved-memory/ child
+ * Exclude memory ranges from memory config from the device tree
  */
 static void
-fdt_add_reserved_memory(int phandle, uint64_t max_addr)
+fdt_add_reserved_memory(uint64_t max_addr)
 {
 	uint64_t addr, size;
-	int index;
+	int index, error;
 
-	for (index = 0;
-	 fdtbus_get_reg64(phandle, index, , ) == 0;
-	 index++) {
+	const int num = fdt_num_mem_rsv(fdtbus_get_data());
+	for (index = 0; index <= num; index++) {
+		error = fdt_get_mem_rsv(fdtbus_get_data(), index,
+		, );
+		if (error != 0 || size == 0)
+			continue;
 		if (addr >= max_addr)
 			continue;
 		if (addr + size > max_addr)
@@ -220,7 +227,7 @@ fdt_build_bootconfig(uint64_t mem_addr, 
 	BootConfig *bc = 
 	struct extent_region *er;
 	uint64_t addr, size;
-	int index, child, error;
+	int index, error;
  
 	fdt_memory_ext = extent_create("FDT Memory", mem_addr, max_addr,
 	fdt_memory_ext_storage, sizeof(fdt_memory_ext_storage), 0);
@@ -241,10 +248,7 @@ fdt_build_bootconfig(uint64_t mem_addr, 
 		DPRINTF("MEM: add %llx-%llx\n", addr, size);
 	}
 
-	const int reserved = OF_finddevice("/reserved-memory");
-	if (reserved > 0)
-		for (child = OF_child(reserved); child; child = OF_peer(child))
-			fdt_add_reserved_memory(child, max_addr);
+	fdt_add_reserved_memory(max_addr);
 
 	const uint64_t initrd_size = initrd_end - initrd_start;
 	if (initrd_size > 0)
@@ -331,7 +335,6 @@ initarm(void *arg)
 {
 	const struct arm_platform *plat;
 	uint64_t memory_addr, memory_size;
-	psize_t ram_size = 0;
 
 	/* Load FDT */
 	const uint8_t *fdt_addr_r = (const uint8_t *)uboot_args[2];
@@ -414,16 +417,14 @@ initarm(void *arg)
 		memory_size = 0x1 - memory_addr - PAGE_SIZE;
 #endif
 
-	ram_size = (bus_size_t)memory_size;
-
 #ifdef __HAVE_MM_MD_DIRECT_MAPPED_PHYS
 	const bool mapallmem_p = true;
 #ifndef PMAP_NEED_ALLOC_POOLPAGE
-	if (ram_size > KERNEL_VM_BASE - KERNEL_BASE) {
+	if (memory_size > KERNEL_VM_BASE - KERNEL_BASE) {
 		DPRINTF("%s: dropping RAM size from %luMB to %uMB\n",
-		__func__, (unsigned long) (ram_size >> 20), 
+		__func__, (unsigned long) (memory_size >> 20), 
 		(KERNEL_VM_BASE - KERNEL_BASE) >> 20);
-		ram_size = KERNEL_VM_BASE - KERNEL_BASE;
+		memory_size = KERNEL_VM_BASE - KERNEL_BASE;
 	}
 #endif
 #else
@@ -436,7 +437,7 @@ initarm(void *arg)
 	/* Populate bootconfig structure for the benefit of pmap.c. */
 	fdt_build_bootconfig(memory_addr, memory_size);
 
-	arm32_bootmem_init(bootconfig.dram[0].address, ram_size,
+	arm32_bootmem_init(bootconfig.dram[0].address, memory_size,
 	KERNEL_BASE_PHYS);
 	arm32_kernel_vm_init(KERNEL_VM_BASE, ARM_VECTORS_HIGH, 0,
 	plat->devmap(), mapallmem_p);



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

2017-07-24 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Jul 25 02:09:33 UTC 2017

Modified Files:
src/sys/arch/evbarm/fdt [netbsd-8]: fdt_machdep.c

Log Message:
Pull up following revision(s) (requested by jmcneill in ticket #151):
sys/arch/evbarm/fdt/fdt_machdep.c: revision 1.11
Fix reserved memory handling.


To generate a diff of this commit:
cvs rdiff -u -r1.4.2.3 -r1.4.2.4 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: [netbsd-8] src/libexec/ld.elf_so/arch/sparc64

2017-07-24 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Jul 25 02:19:04 UTC 2017

Modified Files:
src/libexec/ld.elf_so/arch/sparc64 [netbsd-8]: mdreloc.c

Log Message:
Pull up following revision(s) (requested by martin in ticket #156):
libexec/ld.elf_so/arch/sparc64/mdreloc.c: 1.62, 1.63
Simplify and fix the offset calculation when doing a %pc relative
branch from the PLT slot to the target.
--
Fix thinko in previous: even if the address is an unsigned value and we
have verified the range before, we still need to mask the bit pattern
to the target instruction field.


To generate a diff of this commit:
cvs rdiff -u -r1.59.6.1 -r1.59.6.2 \
src/libexec/ld.elf_so/arch/sparc64/mdreloc.c

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

Modified files:

Index: src/libexec/ld.elf_so/arch/sparc64/mdreloc.c
diff -u src/libexec/ld.elf_so/arch/sparc64/mdreloc.c:1.59.6.1 src/libexec/ld.elf_so/arch/sparc64/mdreloc.c:1.59.6.2
--- src/libexec/ld.elf_so/arch/sparc64/mdreloc.c:1.59.6.1	Tue Jul  4 12:47:58 2017
+++ src/libexec/ld.elf_so/arch/sparc64/mdreloc.c	Tue Jul 25 02:19:03 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: mdreloc.c,v 1.59.6.1 2017/07/04 12:47:58 martin Exp $	*/
+/*	$NetBSD: mdreloc.c,v 1.59.6.2 2017/07/25 02:19:03 snj Exp $	*/
 
 /*-
  * Copyright (c) 2000 Eduardo Horvath.
@@ -32,7 +32,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: mdreloc.c,v 1.59.6.1 2017/07/04 12:47:58 martin Exp $");
+__RCSID("$NetBSD: mdreloc.c,v 1.59.6.2 2017/07/25 02:19:03 snj Exp $");
 #endif /* not lint */
 
 #include 
@@ -579,7 +579,7 @@ _rtld_relocate_plt_object(const Obj_Entr
 	Elf_Word *where = (Elf_Word *)(obj->relocbase + rela->r_offset);
 	const Elf_Sym *def;
 	const Obj_Entry *defobj;
-	Elf_Addr value, offset;
+	Elf_Addr value, offset, offBAA;
 	unsigned long info = rela->r_info;
 
 	assert(ELF_R_TYPE(info) == R_TYPE(JMP_SLOT));
@@ -625,6 +625,7 @@ _rtld_relocate_plt_object(const Obj_Entr
 	 */
 
 	offset = ((Elf_Addr)where) - value;
+	offBAA = value - (((Elf_Addr)where) +4);	/* ba,a at where[1] */
 	if (rela->r_addend) {
 		Elf_Addr *ptr = (Elf_Addr *)where;
 		/*
@@ -634,7 +635,7 @@ _rtld_relocate_plt_object(const Obj_Entr
 		 */
 		ptr[0] += value - (Elf_Addr)obj->pltgot;
 
-	} else if (offset <= (1L<<20) && (Elf_SOff)offset >= -(1L<<20)) {
+	} else if (offBAA <= (1L<<20) && (Elf_SOff)offBAA >= -(1L<<20)) {
 		/* 
 		 * We're within 1MB -- we can use a direct branch insn.
 		 *
@@ -650,7 +651,7 @@ _rtld_relocate_plt_object(const Obj_Entr
 		 *	nop
 		 *
 		 */
-		where[1] = BAA | ((offset >> 2) & 0x7);
+		where[1] = BAA | ((offBAA >> 2) & 0x7);
 		__asm volatile("iflush %0+4" : : "r" (where));
 	} else if (value < (1L<<32)) {
 		/* 



CVS commit: [netbsd-8] src/libexec/ld.elf_so/arch/sparc64

2017-07-24 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Jul 25 02:19:04 UTC 2017

Modified Files:
src/libexec/ld.elf_so/arch/sparc64 [netbsd-8]: mdreloc.c

Log Message:
Pull up following revision(s) (requested by martin in ticket #156):
libexec/ld.elf_so/arch/sparc64/mdreloc.c: 1.62, 1.63
Simplify and fix the offset calculation when doing a %pc relative
branch from the PLT slot to the target.
--
Fix thinko in previous: even if the address is an unsigned value and we
have verified the range before, we still need to mask the bit pattern
to the target instruction field.


To generate a diff of this commit:
cvs rdiff -u -r1.59.6.1 -r1.59.6.2 \
src/libexec/ld.elf_so/arch/sparc64/mdreloc.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/share/mk

2017-07-24 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Jul 25 01:41:29 UTC 2017

Modified Files:
src/share/mk [netbsd-8]: bsd.man.mk

Log Message:
Pull up following revision(s) (requested by jmcneill in ticket #137):
share/mk/bsd.man.mk: revision 1.119
Latest mandoc no longer supports multiple -O options. Instead it expects
option values to be separated by commas. PR toolchain/52402


To generate a diff of this commit:
cvs rdiff -u -r1.118 -r1.118.8.1 src/share/mk/bsd.man.mk

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

Modified files:

Index: src/share/mk/bsd.man.mk
diff -u src/share/mk/bsd.man.mk:1.118 src/share/mk/bsd.man.mk:1.118.8.1
--- src/share/mk/bsd.man.mk:1.118	Mon Oct 19 17:08:11 2015
+++ src/share/mk/bsd.man.mk	Tue Jul 25 01:41:29 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.man.mk,v 1.118 2015/10/19 17:08:11 dholland Exp $
+#	$NetBSD: bsd.man.mk,v 1.118.8.1 2017/07/25 01:41:29 snj Exp $
 #	@(#)bsd.man.mk	8.1 (Berkeley) 6/8/93
 
 .include 
@@ -217,7 +217,7 @@ ${_MSECTIONS:@N@.$N.html$N@}: # buil
 	${_MKTARGET_FORMAT}
 .if ${MKMANDOC} == yes && !defined(NOMANDOC)
 	if test ""${NOMANDOC.${.IMPSRC:T}:tl:Q} != "yes"; then \
-	${TOOL_MANDOC_HTML} -Oman=${HTMLLINKS} -Ostyle=${HTMLSTYLE} \
+	${TOOL_MANDOC_HTML} -Oman=${HTMLLINKS},style=${HTMLSTYLE} \
 		${.IMPSRC} > ${.TARGET}.tmp && \
 		mv ${.TARGET}.tmp ${.TARGET}; \
 	else \



CVS commit: [netbsd-8] src/share/mk

2017-07-24 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Jul 25 01:41:29 UTC 2017

Modified Files:
src/share/mk [netbsd-8]: bsd.man.mk

Log Message:
Pull up following revision(s) (requested by jmcneill in ticket #137):
share/mk/bsd.man.mk: revision 1.119
Latest mandoc no longer supports multiple -O options. Instead it expects
option values to be separated by commas. PR toolchain/52402


To generate a diff of this commit:
cvs rdiff -u -r1.118 -r1.118.8.1 src/share/mk/bsd.man.mk

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



CVS commit: [netbsd-8] src

2017-07-24 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Jul 25 01:43:37 UTC 2017

Modified Files:
src/usr.bin/systat [netbsd-8]: iostat.c vmstat.c
src/usr.bin/vmstat [netbsd-8]: drvstats.c drvstats.h vmstat.c
src/usr.sbin/iostat [netbsd-8]: iostat.c

Log Message:
Pull up following revision(s) (requested by mlelstv in ticket #138):
usr.bin/systat/iostat.c: revision 1.38
usr.bin/systat/vmstat.c: revision 1.82
usr.bin/vmstat/drvstats.c: revision 1.11
usr.bin/vmstat/drvstats.h: revision 1.5
usr.bin/vmstat/vmstat.c: revision 1.217
usr.sbin/iostat/iostat.c: revision 1.65
Use I/O timestamps to compute disk statistics for better precision.
Disk statistics are collected in a fixed size array, that got corrupted
when a disk was detached. Adapt by skipping entries of detached disks
and detect reused disknames at the array end.
--
Use I/O timestamps to compute disk statistics for better precisison.


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.37.38.1 src/usr.bin/systat/iostat.c
cvs rdiff -u -r1.81 -r1.81.8.1 src/usr.bin/systat/vmstat.c
cvs rdiff -u -r1.10 -r1.10.4.1 src/usr.bin/vmstat/drvstats.c
cvs rdiff -u -r1.4 -r1.4.4.1 src/usr.bin/vmstat/drvstats.h
cvs rdiff -u -r1.216 -r1.216.6.1 src/usr.bin/vmstat/vmstat.c
cvs rdiff -u -r1.64 -r1.64.4.1 src/usr.sbin/iostat/iostat.c

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

Modified files:

Index: src/usr.bin/systat/iostat.c
diff -u src/usr.bin/systat/iostat.c:1.37 src/usr.bin/systat/iostat.c:1.37.38.1
--- src/usr.bin/systat/iostat.c:1.37	Mon Apr 13 23:20:27 2009
+++ src/usr.bin/systat/iostat.c	Tue Jul 25 01:43:37 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: iostat.c,v 1.37 2009/04/13 23:20:27 lukem Exp $	*/
+/*	$NetBSD: iostat.c,v 1.37.38.1 2017/07/25 01:43:37 snj Exp $	*/
 
 /*
  * Copyright (c) 1980, 1992, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)iostat.c	8.1 (Berkeley) 6/6/93";
 #endif
-__RCSID("$NetBSD: iostat.c,v 1.37 2009/04/13 23:20:27 lukem Exp $");
+__RCSID("$NetBSD: iostat.c,v 1.37.38.1 2017/07/25 01:43:37 snj Exp $");
 #endif /* not lint */
 
 #include 
@@ -46,7 +46,7 @@ __RCSID("$NetBSD: iostat.c,v 1.37 2009/0
 #include "drvstats.h"
 
 static  int linesperregion;
-static  double etime;
+static	double etime;
 static  int numbers = 0;		/* default display bar graphs */
 static  int secs = 0;			/* default seconds shown */
 static  int read_write = 0;		/* default read/write shown */
@@ -252,9 +252,15 @@ showiostat(void)
 static int
 stats(int row, int col, int dn)
 {
-	double atime, rwords, wwords;
+	double atime, dtime, rwords, wwords;
 	uint64_t rxfer;
 
+	/* elapsed time for disk stats */
+	dtime = etime;
+	if (cur.timestamp[dn].tv_sec || cur.timestamp[dn].tv_usec)
+		dtime = (double)cur.timestamp[dn].tv_sec +
+			((double)cur.timestamp[dn].tv_usec / (double)100);
+
 	/* time busy in disk activity */
 	atime = (double)cur.time[dn].tv_sec +
 		((double)cur.time[dn].tv_usec / (double)100);
@@ -269,30 +275,30 @@ stats(int row, int col, int dn)
 	}
 	if (numbers) {
 		mvwprintw(wnd, row, col, "%5.0f%4.0f",
-		rwords / etime, rxfer / etime);
+		rwords / dtime, rxfer / dtime);
 		if (secs)
-			wprintw(wnd, "%5.1f", atime / etime);
+			wprintw(wnd, "%5.1f", atime / dtime);
 		if (read_write)
 			wprintw(wnd, " %5.0f%4.0f",
-			wwords / etime, cur.wxfer[dn] / etime);
+			wwords / dtime, cur.wxfer[dn] / dtime);
 		return (row);
 	}
 
 	wmove(wnd, row++, col);
-	histogram(rwords / etime, 50, 0.5);
+	histogram(rwords / dtime, 50, 0.5);
 	wmove(wnd, row++, col);
-	histogram(rxfer / etime, 50, 0.5);
+	histogram(rxfer / dtime, 50, 0.5);
 	if (read_write) {
 		wmove(wnd, row++, col);
-		histogram(wwords / etime, 50, 0.5);
+		histogram(wwords / dtime, 50, 0.5);
 		wmove(wnd, row++, col);
-		histogram(cur.wxfer[dn] / etime, 50, 0.5);
+		histogram(cur.wxfer[dn] / dtime, 50, 0.5);
 	}
 
 	if (secs) {
 		wmove(wnd, row++, col);
 		atime *= 1000;	/* In milliseconds */
-		histogram(atime / etime, 50, 0.5);
+		histogram(atime / dtime, 50, 0.5);
 	}
 	return (row);
 }

Index: src/usr.bin/systat/vmstat.c
diff -u src/usr.bin/systat/vmstat.c:1.81 src/usr.bin/systat/vmstat.c:1.81.8.1
--- src/usr.bin/systat/vmstat.c:1.81	Wed Dec 24 20:01:22 2014
+++ src/usr.bin/systat/vmstat.c	Tue Jul 25 01:43:37 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: vmstat.c,v 1.81 2014/12/24 20:01:22 dennis Exp $	*/
+/*	$NetBSD: vmstat.c,v 1.81.8.1 2017/07/25 01:43:37 snj Exp $	*/
 
 /*-
  * Copyright (c) 1983, 1989, 1992, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)vmstat.c	8.2 (Berkeley) 1/12/94";
 #endif
-__RCSID("$NetBSD: vmstat.c,v 1.81 2014/12/24 20:01:22 dennis Exp $");
+__RCSID("$NetBSD: vmstat.c,v 1.81.8.1 2017/07/25 01:43:37 snj Exp $");
 #endif /* not lint */
 
 /*
@@ -827,24 +827,31 @@ copyinfo(struct Info *from, struct Info 
 static void
 dinfo(int dn, int r, int c)
 {
-	double atime;
+	double atime, dtime;
 

CVS commit: [netbsd-8] src

2017-07-24 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Jul 25 01:43:37 UTC 2017

Modified Files:
src/usr.bin/systat [netbsd-8]: iostat.c vmstat.c
src/usr.bin/vmstat [netbsd-8]: drvstats.c drvstats.h vmstat.c
src/usr.sbin/iostat [netbsd-8]: iostat.c

Log Message:
Pull up following revision(s) (requested by mlelstv in ticket #138):
usr.bin/systat/iostat.c: revision 1.38
usr.bin/systat/vmstat.c: revision 1.82
usr.bin/vmstat/drvstats.c: revision 1.11
usr.bin/vmstat/drvstats.h: revision 1.5
usr.bin/vmstat/vmstat.c: revision 1.217
usr.sbin/iostat/iostat.c: revision 1.65
Use I/O timestamps to compute disk statistics for better precision.
Disk statistics are collected in a fixed size array, that got corrupted
when a disk was detached. Adapt by skipping entries of detached disks
and detect reused disknames at the array end.
--
Use I/O timestamps to compute disk statistics for better precisison.


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.37.38.1 src/usr.bin/systat/iostat.c
cvs rdiff -u -r1.81 -r1.81.8.1 src/usr.bin/systat/vmstat.c
cvs rdiff -u -r1.10 -r1.10.4.1 src/usr.bin/vmstat/drvstats.c
cvs rdiff -u -r1.4 -r1.4.4.1 src/usr.bin/vmstat/drvstats.h
cvs rdiff -u -r1.216 -r1.216.6.1 src/usr.bin/vmstat/vmstat.c
cvs rdiff -u -r1.64 -r1.64.4.1 src/usr.sbin/iostat/iostat.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-07-24 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Jul 25 01:55:21 UTC 2017

Modified Files:
src/sys/kern [netbsd-8]: uipc_domain.c
src/sys/net [netbsd-8]: rtsock.c
src/sys/sys [netbsd-8]: socket.h

Log Message:
Pull up following revision(s) (requested by ozaki-r in ticket #140):
sys/kern/uipc_domain.c: 1.97-1.99
sys/net/rtsock.c: 1.225-1.227
sys/sys/socket.h: 1.123
Restore the original length of a sockaddr for netmask
route(8) passes a sockaddr for netmask that is truncated with its
prefixlen. However the kernel basically doesn't expect such format
and may read beyond the data. So restore the original length of the
the data at the beginning of the kernel for the rest components.
Failures of ATF tests such as route_flags_blackhole6 should
be fixed.
--
Avoid DIAGNOSTIC warning with previous fix and simplify it (don't require
memory alloc/free).
--
put the code that returns the sizeof the socket by family in one place.
--
don't warn about AF_LINK sockets with sa_len less than the size of the sockaddr
--
don't print diagnostic for AF_LINK


To generate a diff of this commit:
cvs rdiff -u -r1.96 -r1.96.10.1 src/sys/kern/uipc_domain.c
cvs rdiff -u -r1.213.2.1 -r1.213.2.2 src/sys/net/rtsock.c
cvs rdiff -u -r1.122 -r1.122.2.1 src/sys/sys/socket.h

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

Modified files:

Index: src/sys/kern/uipc_domain.c
diff -u src/sys/kern/uipc_domain.c:1.96 src/sys/kern/uipc_domain.c:1.96.10.1
--- src/sys/kern/uipc_domain.c:1.96	Tue Dec  2 19:45:58 2014
+++ src/sys/kern/uipc_domain.c	Tue Jul 25 01:55:21 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: uipc_domain.c,v 1.96 2014/12/02 19:45:58 christos Exp $	*/
+/*	$NetBSD: uipc_domain.c,v 1.96.10.1 2017/07/25 01:55:21 snj Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1993
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uipc_domain.c,v 1.96 2014/12/02 19:45:58 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uipc_domain.c,v 1.96.10.1 2017/07/25 01:55:21 snj Exp $");
 
 #include 
 #include 
@@ -228,7 +228,7 @@ sockaddr_const_addr(const struct sockadd
 }
 
 const struct sockaddr *
-sockaddr_any_by_family(int family)
+sockaddr_any_by_family(sa_family_t family)
 {
 	const struct domain *dom;
 
@@ -255,43 +255,45 @@ sockaddr_anyaddr(const struct sockaddr *
 	return sockaddr_const_addr(any, slenp);
 }
 
-#ifdef DIAGNOSTIC
-static void
-sockaddr_checklen(const struct sockaddr *sa)
+socklen_t
+sockaddr_getsize_by_family(sa_family_t af)
 {
-	socklen_t len = 0;
-	switch (sa->sa_family) {
+	switch (af) {
 	case AF_INET:
-		len = sizeof(struct sockaddr_in);
-		break;
+		return sizeof(struct sockaddr_in);
 	case AF_INET6:
-		len = sizeof(struct sockaddr_in6);
-		break;
+		return sizeof(struct sockaddr_in6);
 	case AF_UNIX:
-		len = sizeof(struct sockaddr_un);
-		break;
+		return sizeof(struct sockaddr_un);
 	case AF_LINK:
-		len = sizeof(struct sockaddr_dl);
-		// As long as it is not 0...
-		if (sa->sa_len != 0)
-			return;
-		break;
+		return sizeof(struct sockaddr_dl);
 	case AF_APPLETALK:
-		len = sizeof(struct sockaddr_at);
-		break;
+		return sizeof(struct sockaddr_at);
 	default:
-		printf("%s: Unhandled af=%hhu socklen=%hhu\n", __func__,
-		sa->sa_family, sa->sa_len);
-		return;
-	}
-	if (len != sa->sa_len) {
-		char buf[512];
-		sockaddr_format(sa, buf, sizeof(buf));
-		printf("%s: %p bad len af=%hhu socklen=%hhu len=%u [%s]\n",
-		__func__, sa, sa->sa_family, sa->sa_len,
-		(unsigned)len, buf);
+#ifdef DIAGNOSTIC
+		printf("%s: Unhandled address family=%hhu\n", __func__, af);
+#endif
+		return 0;
 	}
 }
+
+#ifdef DIAGNOSTIC
+static void
+sockaddr_checklen(const struct sockaddr *sa)
+{
+	// Can't tell how much was allocated, if it was allocated.
+	if (sa->sa_family == AF_LINK)
+		return;
+
+	socklen_t len = sockaddr_getsize_by_family(sa->sa_family);
+	if (len == 0 || len == sa->sa_len)
+		return;
+
+	char buf[512];
+	sockaddr_format(sa, buf, sizeof(buf));
+	printf("%s: %p bad len af=%hhu socklen=%hhu len=%u [%s]\n",
+	__func__, sa, sa->sa_family, sa->sa_len, (unsigned)len, buf);
+}
 #else
 #define sockaddr_checklen(sa) ((void)0)
 #endif

Index: src/sys/net/rtsock.c
diff -u src/sys/net/rtsock.c:1.213.2.1 src/sys/net/rtsock.c:1.213.2.2
--- src/sys/net/rtsock.c:1.213.2.1	Fri Jul  7 13:57:26 2017
+++ src/sys/net/rtsock.c	Tue Jul 25 01:55:21 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: rtsock.c,v 1.213.2.1 2017/07/07 13:57:26 martin Exp $	*/
+/*	$NetBSD: rtsock.c,v 1.213.2.2 2017/07/25 01:55:21 snj Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -61,7 +61,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rtsock.c,v 1.213.2.1 2017/07/07 13:57:26 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rtsock.c,v 1.213.2.2 2017/07/25 01:55:21 snj Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -736,6 +736,7 @@ COMPATNAME(route_output)(struct mbuf *m,
 	struct sockaddr_dl sdl;
 	int bound = 

CVS commit: [netbsd-8] src/sys

2017-07-24 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Jul 25 01:55:21 UTC 2017

Modified Files:
src/sys/kern [netbsd-8]: uipc_domain.c
src/sys/net [netbsd-8]: rtsock.c
src/sys/sys [netbsd-8]: socket.h

Log Message:
Pull up following revision(s) (requested by ozaki-r in ticket #140):
sys/kern/uipc_domain.c: 1.97-1.99
sys/net/rtsock.c: 1.225-1.227
sys/sys/socket.h: 1.123
Restore the original length of a sockaddr for netmask
route(8) passes a sockaddr for netmask that is truncated with its
prefixlen. However the kernel basically doesn't expect such format
and may read beyond the data. So restore the original length of the
the data at the beginning of the kernel for the rest components.
Failures of ATF tests such as route_flags_blackhole6 should
be fixed.
--
Avoid DIAGNOSTIC warning with previous fix and simplify it (don't require
memory alloc/free).
--
put the code that returns the sizeof the socket by family in one place.
--
don't warn about AF_LINK sockets with sa_len less than the size of the sockaddr
--
don't print diagnostic for AF_LINK


To generate a diff of this commit:
cvs rdiff -u -r1.96 -r1.96.10.1 src/sys/kern/uipc_domain.c
cvs rdiff -u -r1.213.2.1 -r1.213.2.2 src/sys/net/rtsock.c
cvs rdiff -u -r1.122 -r1.122.2.1 src/sys/sys/socket.h

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/net

2017-07-24 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Jul 25 02:07:12 UTC 2017

Modified Files:
src/sys/net [netbsd-8]: if_pppoe.c

Log Message:
Pull up following revision(s) (requested by knakahara in ticket #149):
sys/net/if_pppoe.c: revision 1.126
fix panic when PPPOE_DEBUG enabled. implemented by s-yamaguchi@IIJ, thanks.


To generate a diff of this commit:
cvs rdiff -u -r1.125 -r1.125.6.1 src/sys/net/if_pppoe.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/net/if_pppoe.c
diff -u src/sys/net/if_pppoe.c:1.125 src/sys/net/if_pppoe.c:1.125.6.1
--- src/sys/net/if_pppoe.c:1.125	Tue Feb  7 02:33:54 2017
+++ src/sys/net/if_pppoe.c	Tue Jul 25 02:07:11 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: if_pppoe.c,v 1.125 2017/02/07 02:33:54 ozaki-r Exp $ */
+/* $NetBSD: if_pppoe.c,v 1.125.6.1 2017/07/25 02:07:11 snj Exp $ */
 
 /*-
  * Copyright (c) 2002, 2008 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_pppoe.c,v 1.125 2017/02/07 02:33:54 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_pppoe.c,v 1.125.6.1 2017/07/25 02:07:11 snj Exp $");
 
 #ifdef _KERNEL_OPT
 #include "pppoe.h"
@@ -1366,7 +1366,6 @@ pppoe_send_padi(struct pppoe_softc *sc)
 	}
 
 #ifdef PPPOE_DEBUG
-	p += sizeof sc;
 	if (p - mtod(m0, uint8_t *) != len + PPPOE_HEADERLEN)
 		panic("pppoe_send_padi: garbled output len, should be %ld, is %ld",
 		(long)(len + PPPOE_HEADERLEN), (long)(p - mtod(m0, uint8_t *)));
@@ -1666,7 +1665,6 @@ pppoe_send_padr(struct pppoe_softc *sc)
 	}
 
 #ifdef PPPOE_DEBUG
-	p += sizeof sc;
 	if (p - mtod(m0, uint8_t *) != len + PPPOE_HEADERLEN)
 		panic("pppoe_send_padr: garbled output len, should be %ld, is %ld",
 			(long)(len + PPPOE_HEADERLEN), (long)(p - mtod(m0, uint8_t *)));



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

2017-07-24 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Jul 25 02:08:31 UTC 2017

Modified Files:
src/sys/dev/ic [netbsd-8]: rt2860.c

Log Message:
Pull up following revision(s) (requested by maya in ticket #150):
sys/dev/ic/rt2860.c: revision 1.27
Use kmem_free for kmem_alloc'd memory
Fixes diagnostic crash on detach, tested by Riccardo Mottola


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.26.2.1 src/sys/dev/ic/rt2860.c

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

Modified files:

Index: src/sys/dev/ic/rt2860.c
diff -u src/sys/dev/ic/rt2860.c:1.26 src/sys/dev/ic/rt2860.c:1.26.2.1
--- src/sys/dev/ic/rt2860.c:1.26	Tue May 23 02:19:14 2017
+++ src/sys/dev/ic/rt2860.c	Tue Jul 25 02:08:31 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: rt2860.c,v 1.26 2017/05/23 02:19:14 ozaki-r Exp $	*/
+/*	$NetBSD: rt2860.c,v 1.26.2.1 2017/07/25 02:08:31 snj Exp $	*/
 /*	$OpenBSD: rt2860.c,v 1.90 2016/04/13 10:49:26 mpi Exp $	*/
 /*	$FreeBSD: head/sys/dev/ral/rt2860.c 306591 2016-10-02 20:35:55Z avos $ */
 
@@ -25,7 +25,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rt2860.c,v 1.26 2017/05/23 02:19:14 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rt2860.c,v 1.26.2.1 2017/07/25 02:08:31 snj Exp $");
 
 #include 
 #include 
@@ -466,7 +466,7 @@ rt2860_detach(void *xsc)
 	}
 
 	if (sc->ucode != NULL)
-		free(sc->ucode, M_DEVBUF);
+		firmware_free(sc->ucode, sc->ucsize);
 
 	return 0;
 }



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

2017-07-24 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Jul 25 02:08:31 UTC 2017

Modified Files:
src/sys/dev/ic [netbsd-8]: rt2860.c

Log Message:
Pull up following revision(s) (requested by maya in ticket #150):
sys/dev/ic/rt2860.c: revision 1.27
Use kmem_free for kmem_alloc'd memory
Fixes diagnostic crash on detach, tested by Riccardo Mottola


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.26.2.1 src/sys/dev/ic/rt2860.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

2017-07-24 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Jul 25 02:11:14 UTC 2017

Modified Files:
src/sys/arch/sparc/conf [netbsd-8]: files.sparc
src/sys/arch/sparc/sparc [netbsd-8]: db_interface.c
src/usr.sbin/crash [netbsd-8]: Makefile
Added Files:
src/sys/arch/sparc/sparc [netbsd-8]: db_machdep.c

Log Message:
Pull up following revision(s) (requested by nakayama in ticket #152):
usr.sbin/crash/Makefile: revision 1.37
sys/arch/sparc/conf/files.sparc: revision 1.157
sys/arch/sparc/sparc/db_interface.c: revision 1.94
sys/arch/sparc/sparc/db_machdep.c: revision 1.1
Move the ddb registers and empty command table used for crash(8) into
db_machdep.c like other archs.
--
sparc has db_machdep.c now.


To generate a diff of this commit:
cvs rdiff -u -r1.156 -r1.156.10.1 src/sys/arch/sparc/conf/files.sparc
cvs rdiff -u -r1.93 -r1.93.8.1 src/sys/arch/sparc/sparc/db_interface.c
cvs rdiff -u -r0 -r1.1.2.2 src/sys/arch/sparc/sparc/db_machdep.c
cvs rdiff -u -r1.36 -r1.36.4.1 src/usr.sbin/crash/Makefile

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

Modified files:

Index: src/sys/arch/sparc/conf/files.sparc
diff -u src/sys/arch/sparc/conf/files.sparc:1.156 src/sys/arch/sparc/conf/files.sparc:1.156.10.1
--- src/sys/arch/sparc/conf/files.sparc:1.156	Sat Apr 30 05:24:45 2016
+++ src/sys/arch/sparc/conf/files.sparc	Tue Jul 25 02:11:13 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: files.sparc,v 1.156 2016/04/30 05:24:45 macallan Exp $
+#	$NetBSD: files.sparc,v 1.156.10.1 2017/07/25 02:11:13 snj Exp $
 
 # @(#)files.sparc	8.1 (Berkeley) 7/19/93
 # sparc-specific configuration info
@@ -317,6 +317,7 @@ file	arch/sparc/sparc/trap.c
 file	arch/sparc/sparc/vm_machdep.c
 
 file	arch/sparc/sparc/db_interface.c	ddb | kgdb
+file	arch/sparc/sparc/db_machdep.c	ddb
 file	arch/sparc/sparc/db_trace.c	ddb
 file	arch/sparc/sparc/db_disasm.c	ddb
 

Index: src/sys/arch/sparc/sparc/db_interface.c
diff -u src/sys/arch/sparc/sparc/db_interface.c:1.93 src/sys/arch/sparc/sparc/db_interface.c:1.93.8.1
--- src/sys/arch/sparc/sparc/db_interface.c:1.93	Wed Dec 14 18:50:56 2016
+++ src/sys/arch/sparc/sparc/db_interface.c	Tue Jul 25 02:11:14 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: db_interface.c,v 1.93 2016/12/14 18:50:56 mrg Exp $ */
+/*	$NetBSD: db_interface.c,v 1.93.8.1 2017/07/25 02:11:14 snj Exp $ */
 
 /*
  * Mach Operating System
@@ -33,7 +33,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: db_interface.c,v 1.93 2016/12/14 18:50:56 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_interface.c,v 1.93.8.1 2017/07/25 02:11:14 snj Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ddb.h"
@@ -113,8 +113,6 @@ db_write_bytes(vaddr_t addr, size_t size
 }
 #endif
 
-db_regs_t *ddb_regp;
-
 #if defined(DDB)
 
 /*
@@ -132,81 +130,6 @@ cpu_Debugger(void)
 
 #if defined(DDB) || defined(_KMEMUSER)
 
-static long nil;
-
-/*
- * Machine register set.
- */
-#define dbreg(xx) (long *)offsetof(db_regs_t, db_tf.tf_ ## xx)
-#define dbregfr(xx) (long *)offsetof(db_regs_t, db_fr.fr_ ## xx)
-
-static int db_sparc_regop(const struct db_variable *, db_expr_t *, int);
-
-const struct db_variable db_regs[] = {
-	{ "psr",	dbreg(psr),		db_sparc_regop, NULL, },
-	{ "pc",		dbreg(pc),		db_sparc_regop, NULL, },
-	{ "npc",	dbreg(npc),		db_sparc_regop, NULL, },
-	{ "y",		dbreg(y),		db_sparc_regop, NULL, },
-	{ "wim",	dbreg(global[0]),	db_sparc_regop, NULL, }, /* see reg.h */
-	{ "g0",		,			FCN_NULL, 	NULL, },
-	{ "g1",		dbreg(global[1]),	db_sparc_regop, NULL, },
-	{ "g2",		dbreg(global[2]),	db_sparc_regop, NULL, },
-	{ "g3",		dbreg(global[3]),	db_sparc_regop, NULL, },
-	{ "g4",		dbreg(global[4]),	db_sparc_regop, NULL, },
-	{ "g5",		dbreg(global[5]),	db_sparc_regop, NULL, },
-	{ "g6",		dbreg(global[6]),	db_sparc_regop, NULL, },
-	{ "g7",		dbreg(global[7]),	db_sparc_regop, NULL, },
-	{ "o0",		dbreg(out[0]),		db_sparc_regop, NULL, },
-	{ "o1",		dbreg(out[1]),		db_sparc_regop, NULL, },
-	{ "o2",		dbreg(out[2]),		db_sparc_regop, NULL, },
-	{ "o3",		dbreg(out[3]),		db_sparc_regop, NULL, },
-	{ "o4",		dbreg(out[4]),		db_sparc_regop, NULL, },
-	{ "o5",		dbreg(out[5]),		db_sparc_regop, NULL, },
-	{ "o6",		dbreg(out[6]),		db_sparc_regop, NULL, },
-	{ "o7",		dbreg(out[7]),		db_sparc_regop, NULL, },
-	{ "l0",		dbregfr(local[0]),	db_sparc_regop, NULL, },
-	{ "l1",		dbregfr(local[1]),	db_sparc_regop, NULL, },
-	{ "l2",		dbregfr(local[2]),	db_sparc_regop, NULL, },
-	{ "l3",		dbregfr(local[3]),	db_sparc_regop, NULL, },
-	{ "l4",		dbregfr(local[4]),	db_sparc_regop, NULL, },
-	{ "l5",		dbregfr(local[5]),	db_sparc_regop, NULL, },
-	{ "l6",		dbregfr(local[6]),	db_sparc_regop, NULL, },
-	{ "l7",		dbregfr(local[7]),	db_sparc_regop, NULL, },
-	{ "i0",		dbregfr(arg[0]),	db_sparc_regop, NULL, },
-	{ "i1",		dbregfr(arg[1]),	db_sparc_regop, NULL, },
-	{ "i2",		dbregfr(arg[2]),	db_sparc_regop, NULL, },
-	{ "i3",		dbregfr(arg[3]),	db_sparc_regop, NULL, },
-	{ "i4",		dbregfr(arg[4]),	db_sparc_regop, 

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

2017-07-24 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Jul 25 02:12:35 UTC 2017

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

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


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

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

Modified files:

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

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



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

2017-07-24 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Jul 25 02:12:35 UTC 2017

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

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


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

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



CVS commit: [netbsd-8] src/sys/net/npf

2017-07-24 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Jul 25 02:17:16 UTC 2017

Modified Files:
src/sys/net/npf [netbsd-8]: npf_os.c

Log Message:
Pull up following revision(s) (requested by pgoyette in ticket #155):
sys/net/npf/npf_os.c: revision 1.7
The npf module depends on some stuff from the bpf module, so set the
required modules list accordingly.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.6.8.1 src/sys/net/npf/npf_os.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/net/npf/npf_os.c
diff -u src/sys/net/npf/npf_os.c:1.6 src/sys/net/npf/npf_os.c:1.6.8.1
--- src/sys/net/npf/npf_os.c:1.6	Fri Jan 27 17:25:34 2017
+++ src/sys/net/npf/npf_os.c	Tue Jul 25 02:17:16 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: npf_os.c,v 1.6 2017/01/27 17:25:34 ryo Exp $	*/
+/*	$NetBSD: npf_os.c,v 1.6.8.1 2017/07/25 02:17:16 snj Exp $	*/
 
 /*-
  * Copyright (c) 2009-2016 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
 
 #ifdef _KERNEL
 #include 
-__KERNEL_RCSID(0, "$NetBSD: npf_os.c,v 1.6 2017/01/27 17:25:34 ryo Exp $");
+__KERNEL_RCSID(0, "$NetBSD: npf_os.c,v 1.6.8.1 2017/07/25 02:17:16 snj Exp $");
 
 #ifdef _KERNEL_OPT
 #include "pf.h"
@@ -79,10 +79,10 @@ __KERNEL_RCSID(0, "$NetBSD: npf_os.c,v 1
  * So we make this misc; a better way would be to have early boot and late
  * boot drivers.
  */
-MODULE(MODULE_CLASS_MISC, npf, NULL);
+MODULE(MODULE_CLASS_MISC, npf, "bpf");
 #else
 /* This module autoloads via /dev/npf so it needs to be a driver */
-MODULE(MODULE_CLASS_DRIVER, npf, NULL);
+MODULE(MODULE_CLASS_DRIVER, npf, "bpf");
 #endif
 
 static int	npf_dev_open(dev_t, int, int, lwp_t *);



CVS commit: [netbsd-8] src/sys/net/npf

2017-07-24 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Jul 25 02:17:16 UTC 2017

Modified Files:
src/sys/net/npf [netbsd-8]: npf_os.c

Log Message:
Pull up following revision(s) (requested by pgoyette in ticket #155):
sys/net/npf/npf_os.c: revision 1.7
The npf module depends on some stuff from the bpf module, so set the
required modules list accordingly.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.6.8.1 src/sys/net/npf/npf_os.c

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



CVS commit: src/sys/rump/librump/rumpkern

2017-07-24 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Tue Jul 25 05:01:25 UTC 2017

Modified Files:
src/sys/rump/librump/rumpkern: Makefile.rumpkern

Log Message:
Add localcount to rump kernels


To generate a diff of this commit:
cvs rdiff -u -r1.169 -r1.170 src/sys/rump/librump/rumpkern/Makefile.rumpkern

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

Modified files:

Index: src/sys/rump/librump/rumpkern/Makefile.rumpkern
diff -u src/sys/rump/librump/rumpkern/Makefile.rumpkern:1.169 src/sys/rump/librump/rumpkern/Makefile.rumpkern:1.170
--- src/sys/rump/librump/rumpkern/Makefile.rumpkern:1.169	Sat Apr  8 23:46:39 2017
+++ src/sys/rump/librump/rumpkern/Makefile.rumpkern	Tue Jul 25 05:01:25 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.rumpkern,v 1.169 2017/04/08 23:46:39 christos Exp $
+#	$NetBSD: Makefile.rumpkern,v 1.170 2017/07/25 05:01:25 ozaki-r Exp $
 #
 
 .include "${RUMPTOP}/Makefile.rump"
@@ -109,6 +109,7 @@ SRCS+=	init_sysctl_base.c	\
 	subr_kcpuset.c		\
 	subr_kmem.c		\
 	subr_kobj.c		\
+	subr_localcount.c	\
 	subr_log.c		\
 	subr_lwp_specificdata.c	\
 	subr_once.c		\



CVS commit: src/sys/rump/librump/rumpkern

2017-07-24 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Tue Jul 25 05:01:25 UTC 2017

Modified Files:
src/sys/rump/librump/rumpkern: Makefile.rumpkern

Log Message:
Add localcount to rump kernels


To generate a diff of this commit:
cvs rdiff -u -r1.169 -r1.170 src/sys/rump/librump/rumpkern/Makefile.rumpkern

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



CVS commit: src/share/man/man4/man4.pmax

2017-07-24 Thread Ryo ONODERA
Module Name:src
Committed By:   ryoon
Date:   Tue Jul 25 03:51:41 UTC 2017

Modified Files:
src/share/man/man4/man4.pmax: autoconf.4 ibus.4 intro.4 sii.4

Log Message:
Fix pmax/ cross references


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/share/man/man4/man4.pmax/autoconf.4
cvs rdiff -u -r1.5 -r1.6 src/share/man/man4/man4.pmax/ibus.4
cvs rdiff -u -r1.18 -r1.19 src/share/man/man4/man4.pmax/intro.4
cvs rdiff -u -r1.12 -r1.13 src/share/man/man4/man4.pmax/sii.4

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

Modified files:

Index: src/share/man/man4/man4.pmax/autoconf.4
diff -u src/share/man/man4/man4.pmax/autoconf.4:1.4 src/share/man/man4/man4.pmax/autoconf.4:1.5
--- src/share/man/man4/man4.pmax/autoconf.4:1.4	Fri Feb 17 22:24:47 2017
+++ src/share/man/man4/man4.pmax/autoconf.4	Tue Jul 25 03:51:41 2017
@@ -1,4 +1,4 @@
-.\" $NetBSD: autoconf.4,v 1.4 2017/02/17 22:24:47 christos Exp $
+.\" $NetBSD: autoconf.4,v 1.5 2017/07/25 03:51:41 ryoon Exp $
 .\"
 .\" Copyright (c) 1994 Christopher G. Demetriou
 .\" All rights reserved.
@@ -63,5 +63,5 @@ doesn't) understand.
 .El
 .Sh SEE ALSO
 .Xr config 1 ,
-.Xr pmax/pmax/intro 4 ,
+.Xr pmax/intro 4 ,
 .Xr boot 8

Index: src/share/man/man4/man4.pmax/ibus.4
diff -u src/share/man/man4/man4.pmax/ibus.4:1.5 src/share/man/man4/man4.pmax/ibus.4:1.6
--- src/share/man/man4/man4.pmax/ibus.4:1.5	Fri Feb 17 22:24:47 2017
+++ src/share/man/man4/man4.pmax/ibus.4	Tue Jul 25 03:51:41 2017
@@ -1,4 +1,4 @@
-.\"	$NetBSD: ibus.4,v 1.5 2017/02/17 22:24:47 christos Exp $
+.\"	$NetBSD: ibus.4,v 1.6 2017/07/25 03:51:41 ryoon Exp $
 .\"
 .\" Copyright (c) 1998 MINOURA Makoto
 .\" Copyright (c) 1998 NetBSD Foundation, Inc.
@@ -70,6 +70,6 @@ is always required to run the
 .Nx
 kernel.
 .Sh SEE ALSO
-.Xr pmax/pmax/intro 4 ,
+.Xr pmax/intro 4 ,
 .Xr bus_dma 9 ,
 .Xr bus_space 9

Index: src/share/man/man4/man4.pmax/intro.4
diff -u src/share/man/man4/man4.pmax/intro.4:1.18 src/share/man/man4/man4.pmax/intro.4:1.19
--- src/share/man/man4/man4.pmax/intro.4:1.18	Fri Feb 17 22:24:47 2017
+++ src/share/man/man4/man4.pmax/intro.4	Tue Jul 25 03:51:41 2017
@@ -27,7 +27,7 @@
 .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.\"	$NetBSD: intro.4,v 1.18 2017/02/17 22:24:47 christos Exp $
+.\"	$NetBSD: intro.4,v 1.19 2017/07/25 03:51:41 ryoon Exp $
 .\"
 .Dd February 17, 2017
 .Dt INTRO 4 pmax
@@ -84,11 +84,11 @@ To enable a device which did not autocon
 the system must be rebooted.
 .Pp
 The autoconfiguration system is described in
-.Xr pmax/pmax/autoconf 4 .
+.Xr pmax/autoconf 4 .
 A list of the supported devices is given below.
 .Sh SEE ALSO
 .Xr config 1 ,
-.Xr pmax/pmax/autoconf 4
+.Xr pmax/autoconf 4
 .Sh SUPPORTED SYSTEMS
 The following systems are supported:
 .Pp

Index: src/share/man/man4/man4.pmax/sii.4
diff -u src/share/man/man4/man4.pmax/sii.4:1.12 src/share/man/man4/man4.pmax/sii.4:1.13
--- src/share/man/man4/man4.pmax/sii.4:1.12	Fri Feb 17 22:24:47 2017
+++ src/share/man/man4/man4.pmax/sii.4	Tue Jul 25 03:51:41 2017
@@ -27,7 +27,7 @@
 .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.\"	$NetBSD: sii.4,v 1.12 2017/02/17 22:24:47 christos Exp $
+.\"	$NetBSD: sii.4,v 1.13 2017/07/25 03:51:41 ryoon Exp $
 .\"
 .Dd February 17, 2017
 .Dt SII 4 pmax
@@ -63,8 +63,8 @@ to and from the DMA region.
 .Sh SEE ALSO
 .Xr cd 4 ,
 .Xr ch 4 ,
-.Xr pmax/pmax/ibus 4 ,
-.Xr pmax/pmax/intro 4 ,
+.Xr pmax/ibus 4 ,
+.Xr pmax/intro 4 ,
 .Xr sd 4 ,
 .Xr st 4
 .Sh HISTORY



CVS commit: src/share/man/man4/man4.pmax

2017-07-24 Thread Ryo ONODERA
Module Name:src
Committed By:   ryoon
Date:   Tue Jul 25 03:51:41 UTC 2017

Modified Files:
src/share/man/man4/man4.pmax: autoconf.4 ibus.4 intro.4 sii.4

Log Message:
Fix pmax/ cross references


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/share/man/man4/man4.pmax/autoconf.4
cvs rdiff -u -r1.5 -r1.6 src/share/man/man4/man4.pmax/ibus.4
cvs rdiff -u -r1.18 -r1.19 src/share/man/man4/man4.pmax/intro.4
cvs rdiff -u -r1.12 -r1.13 src/share/man/man4/man4.pmax/sii.4

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



CVS commit: src/sys/sys

2017-07-24 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Jul 25 04:36:33 UTC 2017

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

Log Message:
Stupid old C versions do not know "bool" - include stdbool.h to the
rescue.


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

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

Modified files:

Index: src/sys/sys/extent.h
diff -u src/sys/sys/extent.h:1.21 src/sys/sys/extent.h:1.22
--- src/sys/sys/extent.h:1.21	Mon Jul 24 19:56:07 2017
+++ src/sys/sys/extent.h	Tue Jul 25 04:36:33 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: extent.h,v 1.21 2017/07/24 19:56:07 skrll Exp $	*/
+/*	$NetBSD: extent.h,v 1.22 2017/07/25 04:36:33 martin Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1998 The NetBSD Foundation, Inc.
@@ -36,6 +36,10 @@
 #include 
 #include 
 
+#ifndef _KERNEL
+#include 
+#endif
+
 struct extent_region {
 	LIST_ENTRY(extent_region) er_link;	/* link in region list */
 	u_long 	er_start;		/* start of region */



CVS commit: src/sys/sys

2017-07-24 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Jul 25 04:36:33 UTC 2017

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

Log Message:
Stupid old C versions do not know "bool" - include stdbool.h to the
rescue.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/sys/extent.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

2017-07-24 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Mon Jul 24 09:56:46 UTC 2017

Modified Files:
src/sys/arch/evbmips/conf: SBMIPS SBMIPS.MP SBMIPS64 SBMIPS64.MP
files.sbmips std.sbmips
src/sys/arch/evbmips/include: param.h pci_machdep.h
src/sys/arch/evbmips/sbmips: cpu.c machdep.c rtc.c sb1250_icu.c
systemsw.c zbbus.c
src/sys/arch/mips/conf: files.sibyte
src/sys/arch/mips/include: pmap.h
src/sys/arch/mips/sibyte/dev: sbbuswatch.c sbmac.c sbscn.c sbsmbus.c
sbtimer.c sbwdog.c
src/sys/arch/mips/sibyte/pci: sbbrz_pci.c

Log Message:
mostly converted sbmips -> evbmips.  the SBMIPS kernel builds fully
sans disksubr.c.  intr.h does not need any additional fixes now,
only disklabel.h.

also test-built some other mips kernels.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 src/sys/arch/evbmips/conf/SBMIPS \
src/sys/arch/evbmips/conf/SBMIPS.MP src/sys/arch/evbmips/conf/SBMIPS64 \
src/sys/arch/evbmips/conf/SBMIPS64.MP \
src/sys/arch/evbmips/conf/files.sbmips \
src/sys/arch/evbmips/conf/std.sbmips
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/evbmips/include/param.h
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/evbmips/include/pci_machdep.h
cvs rdiff -u -r1.1.1.1 -r1.2 src/sys/arch/evbmips/sbmips/cpu.c \
src/sys/arch/evbmips/sbmips/machdep.c src/sys/arch/evbmips/sbmips/rtc.c \
src/sys/arch/evbmips/sbmips/sb1250_icu.c \
src/sys/arch/evbmips/sbmips/systemsw.c \
src/sys/arch/evbmips/sbmips/zbbus.c
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/mips/conf/files.sibyte
cvs rdiff -u -r1.69 -r1.70 src/sys/arch/mips/include/pmap.h
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/mips/sibyte/dev/sbbuswatch.c
cvs rdiff -u -r1.48 -r1.49 src/sys/arch/mips/sibyte/dev/sbmac.c
cvs rdiff -u -r1.42 -r1.43 src/sys/arch/mips/sibyte/dev/sbscn.c
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/mips/sibyte/dev/sbsmbus.c
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/mips/sibyte/dev/sbtimer.c
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/mips/sibyte/dev/sbwdog.c
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/mips/sibyte/pci/sbbrz_pci.c

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

Modified files:

Index: src/sys/arch/evbmips/conf/SBMIPS
diff -u src/sys/arch/evbmips/conf/SBMIPS:1.1.1.1 src/sys/arch/evbmips/conf/SBMIPS:1.2
--- src/sys/arch/evbmips/conf/SBMIPS:1.1.1.1	Mon Jul 24 08:56:29 2017
+++ src/sys/arch/evbmips/conf/SBMIPS	Mon Jul 24 09:56:45 2017
@@ -1,10 +1,10 @@
-# $NetBSD: SBMIPS,v 1.1.1.1 2017/07/24 08:56:29 mrg Exp $
+# $NetBSD: SBMIPS,v 1.2 2017/07/24 09:56:45 mrg Exp $
 
-include 	"arch/sbmips/conf/std.sbmips"
+include 	"arch/evbmips/conf/std.sbmips"
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		"GENERIC-$Revision: 1.1.1.1 $"
+#ident 		"GENERIC-$Revision: 1.2 $"
 
 #options 	LOCKDEBUG	# XXX XXX XXX XXX
 #options 	DEBUG		# extra kernel debugging support
Index: src/sys/arch/evbmips/conf/SBMIPS.MP
diff -u src/sys/arch/evbmips/conf/SBMIPS.MP:1.1.1.1 src/sys/arch/evbmips/conf/SBMIPS.MP:1.2
--- src/sys/arch/evbmips/conf/SBMIPS.MP:1.1.1.1	Mon Jul 24 08:56:29 2017
+++ src/sys/arch/evbmips/conf/SBMIPS.MP	Mon Jul 24 09:56:45 2017
@@ -1,5 +1,6 @@
+# $NetBSD: SBMIPS.MP,v 1.2 2017/07/24 09:56:45 mrg Exp $
 
-include "arch/sbmips/conf/GENERIC"
+include "arch/evbmips/conf/SBMIPS"
 
 options 	MULTIPROCESSOR
 options 	LOCKDEBUG
Index: src/sys/arch/evbmips/conf/SBMIPS64
diff -u src/sys/arch/evbmips/conf/SBMIPS64:1.1.1.1 src/sys/arch/evbmips/conf/SBMIPS64:1.2
--- src/sys/arch/evbmips/conf/SBMIPS64:1.1.1.1	Mon Jul 24 08:56:29 2017
+++ src/sys/arch/evbmips/conf/SBMIPS64	Mon Jul 24 09:56:45 2017
@@ -1,5 +1,6 @@
+# $NetBSD: SBMIPS64,v 1.2 2017/07/24 09:56:45 mrg Exp $
 
-include "arch/sbmips/conf/GENERIC"
+include "arch/evbmips/conf/SBMIPS"
 
 makeoptions	LP64="yes"
 options 	EXEC_ELF64
Index: src/sys/arch/evbmips/conf/SBMIPS64.MP
diff -u src/sys/arch/evbmips/conf/SBMIPS64.MP:1.1.1.1 src/sys/arch/evbmips/conf/SBMIPS64.MP:1.2
--- src/sys/arch/evbmips/conf/SBMIPS64.MP:1.1.1.1	Mon Jul 24 08:56:29 2017
+++ src/sys/arch/evbmips/conf/SBMIPS64.MP	Mon Jul 24 09:56:45 2017
@@ -1,5 +1,6 @@
+# $NetBSD: SBMIPS64.MP,v 1.2 2017/07/24 09:56:45 mrg Exp $
 
-include "arch/sbmips/conf/GENERIC64"
+include "arch/evbmips/conf/SBMIPS64"
 
 options 	MULTIPROCESSOR
 options 	LOCKDEBUG
Index: src/sys/arch/evbmips/conf/files.sbmips
diff -u src/sys/arch/evbmips/conf/files.sbmips:1.1.1.1 src/sys/arch/evbmips/conf/files.sbmips:1.2
--- src/sys/arch/evbmips/conf/files.sbmips:1.1.1.1	Mon Jul 24 08:56:29 2017
+++ src/sys/arch/evbmips/conf/files.sbmips	Mon Jul 24 09:56:45 2017
@@ -1,17 +1,16 @@
-# $NetBSD: files.sbmips,v 1.1.1.1 2017/07/24 08:56:29 mrg Exp $
+# $NetBSD: files.sbmips,v 1.2 2017/07/24 09:56:45 mrg Exp $
 
 maxpartitions 8
 
-maxusers 1 8 64
+#maxusers 1 8 64
 
-file arch/sbmips/sbmips/autoconf.c
-file arch/sbmips/sbmips/machdep.c
-file arch/sbmips/sbmips/console.c
-file 

CVS commit: src/sys/arch

2017-07-24 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Mon Jul 24 09:56:46 UTC 2017

Modified Files:
src/sys/arch/evbmips/conf: SBMIPS SBMIPS.MP SBMIPS64 SBMIPS64.MP
files.sbmips std.sbmips
src/sys/arch/evbmips/include: param.h pci_machdep.h
src/sys/arch/evbmips/sbmips: cpu.c machdep.c rtc.c sb1250_icu.c
systemsw.c zbbus.c
src/sys/arch/mips/conf: files.sibyte
src/sys/arch/mips/include: pmap.h
src/sys/arch/mips/sibyte/dev: sbbuswatch.c sbmac.c sbscn.c sbsmbus.c
sbtimer.c sbwdog.c
src/sys/arch/mips/sibyte/pci: sbbrz_pci.c

Log Message:
mostly converted sbmips -> evbmips.  the SBMIPS kernel builds fully
sans disksubr.c.  intr.h does not need any additional fixes now,
only disklabel.h.

also test-built some other mips kernels.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 src/sys/arch/evbmips/conf/SBMIPS \
src/sys/arch/evbmips/conf/SBMIPS.MP src/sys/arch/evbmips/conf/SBMIPS64 \
src/sys/arch/evbmips/conf/SBMIPS64.MP \
src/sys/arch/evbmips/conf/files.sbmips \
src/sys/arch/evbmips/conf/std.sbmips
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/evbmips/include/param.h
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/evbmips/include/pci_machdep.h
cvs rdiff -u -r1.1.1.1 -r1.2 src/sys/arch/evbmips/sbmips/cpu.c \
src/sys/arch/evbmips/sbmips/machdep.c src/sys/arch/evbmips/sbmips/rtc.c \
src/sys/arch/evbmips/sbmips/sb1250_icu.c \
src/sys/arch/evbmips/sbmips/systemsw.c \
src/sys/arch/evbmips/sbmips/zbbus.c
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/mips/conf/files.sibyte
cvs rdiff -u -r1.69 -r1.70 src/sys/arch/mips/include/pmap.h
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/mips/sibyte/dev/sbbuswatch.c
cvs rdiff -u -r1.48 -r1.49 src/sys/arch/mips/sibyte/dev/sbmac.c
cvs rdiff -u -r1.42 -r1.43 src/sys/arch/mips/sibyte/dev/sbscn.c
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/mips/sibyte/dev/sbsmbus.c
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/mips/sibyte/dev/sbtimer.c
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/mips/sibyte/dev/sbwdog.c
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/mips/sibyte/pci/sbbrz_pci.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/evbmips/include

2017-07-24 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Mon Jul 24 10:04:09 UTC 2017

Modified Files:
src/sys/arch/evbmips/include: disklabel.h

Log Message:
ugly hack -- for SB1, use the contents of sbmips/include/disklabel.h.
with this, i can build the 32 bit little endian SBMIPS kernel in the
evbmips directory.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/evbmips/include/disklabel.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/arch/evbmips/include/disklabel.h
diff -u src/sys/arch/evbmips/include/disklabel.h:1.5 src/sys/arch/evbmips/include/disklabel.h:1.6
--- src/sys/arch/evbmips/include/disklabel.h:1.5	Tue Aug 30 12:39:54 2011
+++ src/sys/arch/evbmips/include/disklabel.h	Mon Jul 24 10:04:09 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: disklabel.h,v 1.5 2011/08/30 12:39:54 bouyer Exp $	*/
+/*	$NetBSD: disklabel.h,v 1.6 2017/07/24 10:04:09 mrg Exp $	*/
 
 /*
  * Copyright (c) 1994 Christopher G. Demetriou
@@ -30,11 +30,163 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+/*
+ * Copyright 2000, 2001
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and copied only
+ * in accordance with the following terms and conditions.  Subject to these
+ * conditions, you may download, copy, install, use, modify and distribute
+ * modified or unmodified copies of this software in source and/or binary
+ * form. No title or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce and
+ *retain this copyright notice and list of conditions as they appear in
+ *the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or logo of
+ *Broadcom Corporation.  The "Broadcom Corporation" name may not be
+ *used to endorse or promote products derived from this software
+ *without the prior written permission of Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR IMPLIED
+ *WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED WARRANTIES OF
+ *MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR
+ *NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL BROADCOM BE LIABLE
+ *FOR ANY DAMAGES WHATSOEVER, AND IN PARTICULAR, BROADCOM SHALL NOT BE
+ *LIABLE FOR 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), EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
 #ifndef _EVBMIPS_DISKLABEL_H_
 #define _EVBMIPS_DISKLABEL_H_
+
 #ifdef _KERNEL_OPT
 #include "opt_pmon.h"
+#include "opt_cputype.h"
+#endif
+
+#ifdef MIPS64_SB1
+
+#define LABELUSESMBR	0		/* no MBR partitionning */
+#define	LABELSECTOR	1		/* sector containing label */
+#define	LABELOFFSET	0		/* offset of label in sector */
+#define	MAXPARTITIONS	16
+#define	RAW_PART	3
+
+#ifdef __NetBSD__
+/* Pull in MBR partition definitions. */
+#if HAVE_NBTOOL_CONFIG_H
+#include 
+#else
+#include 
+#endif /* HAVE_NBTOOL_CONFIG_H */
+
+#ifndef __ASSEMBLER__
+#if HAVE_NBTOOL_CONFIG_H
+#include 
+#else
+#include 
+#endif /* HAVE_NBTOOL_CONFIG_H */
+struct cpu_disklabel {
+	struct mbr_partition mbrparts[MBR_PART_COUNT];
+#define __HAVE_DISKLABEL_DKBAD
+	struct dkbad bad;
+};
 #endif
+#endif
+
+/*
+ * CFE boot block, modeled loosely on Alpha.
+ *
+ * It consists of:
+ *
+ * 		BSD disk label
+ *		
+ *		Boot block info (5 uint_64s)
+ *
+ * The boot block portion looks like:
+ *
+ *
+ *	+---+---+---+---+---+---+---+---+
+ *	|BOOT_MAGIC_NUMBER  |
+ *	+---+---+---+---+---+---+---+---+
+ *	| Flags |   Reserved| Vers  |  Header Checksum  |
+ *	+---+---+---+---+---+---+---+---+
+ *	| Secondary Loader Location (bytes) |
+ *	+---+---+---+---+---+---+---+---+
+ *	| Loader Checksum   | Size of loader (bytes)|
+ *	+---+---+---+---+---+---+---+---+
+ *	|  Reserved |Architecture Information   |
+ *	+---+---+---+---+---+---+---+---+
+ *
+ * Boot block fields should always be read as 64-bit numbers.
+ *
+ */
+
+
+struct boot_block {
+	uint64_t cfe_bb_data[64];	/* data (disklabel, also as below) */
+};
+#define	cfe_bb_magic	cfe_bb_data[59]	/* magic number */
+#define	cfe_bb_hdrinfo	cfe_bb_data[60]	/* header checksum, ver, flags */
+#define	cfe_bb_secstart	cfe_bb_data[61]	/* secondary start (bytes) */
+#define	

CVS commit: src/sys/arch/evbmips/include

2017-07-24 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Mon Jul 24 10:04:09 UTC 2017

Modified Files:
src/sys/arch/evbmips/include: disklabel.h

Log Message:
ugly hack -- for SB1, use the contents of sbmips/include/disklabel.h.
with this, i can build the 32 bit little endian SBMIPS kernel in the
evbmips directory.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/evbmips/include/disklabel.h

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



CVS import: src/sys/arch/evbmips

2017-07-24 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Mon Jul 24 08:56:29 UTC 2017

Update of /cvsroot/src/sys/arch/evbmips
In directory ivanova.netbsd.org:/tmp/cvs-serv26314

Log Message:
import most of the sbmips port into evbmips.  the renames are:
- TODO -> evbmips/sbmips/TODO
- sbmips -> evbmips/sbmips
- stand -> evbmips/stand
- conf/files* -> evbmips/conf/files*
- conf/GENERIC* -> evbmips/conf/SBMIPS*

this is not yet ported and will need to be updated, but it's a first step,
and it doesn't handle any include/* issues that need to be dealt with.

Status:

Vendor Tag: NetBSD
Release Tags:   NetBSD-2017-07-22

N src/sys/arch/evbmips/sbmips/TODO
N src/sys/arch/evbmips/sbmips/disksubr.c
N src/sys/arch/evbmips/sbmips/autoconf.c
N src/sys/arch/evbmips/sbmips/console.c
N src/sys/arch/evbmips/sbmips/machdep.c
N src/sys/arch/evbmips/sbmips/locore_machdep.S
N src/sys/arch/evbmips/sbmips/rtc.c
N src/sys/arch/evbmips/sbmips/sb1250_icu.c
N src/sys/arch/evbmips/sbmips/systemsw.c
N src/sys/arch/evbmips/sbmips/zbbus.c
N src/sys/arch/evbmips/sbmips/cpu.c
N src/sys/arch/evbmips/conf/SBMIPS
N src/sys/arch/evbmips/conf/SBMIPS64
N src/sys/arch/evbmips/conf/SBMIPS64.MP
N src/sys/arch/evbmips/conf/files.sbmips
N src/sys/arch/evbmips/conf/std.sbmips
N src/sys/arch/evbmips/conf/SBMIPS.MP
N src/sys/arch/evbmips/stand/sbmips/Makefile
N src/sys/arch/evbmips/stand/sbmips/Makefile.bootprogs
N src/sys/arch/evbmips/stand/sbmips/Makefile.bootxx
N src/sys/arch/evbmips/stand/sbmips/Makefile.inc
N src/sys/arch/evbmips/stand/sbmips/boot/Makefile
N src/sys/arch/evbmips/stand/sbmips/boot/filesystem.c
N src/sys/arch/evbmips/stand/sbmips/boot/version
N src/sys/arch/evbmips/stand/sbmips/bootxx_cd9660/Makefile
N src/sys/arch/evbmips/stand/sbmips/bootxx_ffs/Makefile
N src/sys/arch/evbmips/stand/sbmips/bootxx_lfs/Makefile
N src/sys/arch/evbmips/stand/sbmips/common/bbinfo.h
N src/sys/arch/evbmips/stand/sbmips/common/blkdev.c
N src/sys/arch/evbmips/stand/sbmips/common/blkdev.h
N src/sys/arch/evbmips/stand/sbmips/common/boot.c
N src/sys/arch/evbmips/stand/sbmips/common/boot.ldscript
N src/sys/arch/evbmips/stand/sbmips/common/booted_dev.c
N src/sys/arch/evbmips/stand/sbmips/common/bootxx.c
N src/sys/arch/evbmips/stand/sbmips/common/cfe.c
N src/sys/arch/evbmips/stand/sbmips/common/cfe_api.c
N src/sys/arch/evbmips/stand/sbmips/common/cfe_api.h
N src/sys/arch/evbmips/stand/sbmips/common/cfe_api_int.h
N src/sys/arch/evbmips/stand/sbmips/common/cfe_error.h
N src/sys/arch/evbmips/stand/sbmips/common/cfe_ioctl.h
N src/sys/arch/evbmips/stand/sbmips/common/checksize.sh
N src/sys/arch/evbmips/stand/sbmips/common/common.h
N src/sys/arch/evbmips/stand/sbmips/common/panic_putstr.c
N src/sys/arch/evbmips/stand/sbmips/common/putstr.c
N src/sys/arch/evbmips/stand/sbmips/common/start.S
N src/sys/arch/evbmips/stand/sbmips/netboot/Makefile
N src/sys/arch/evbmips/stand/sbmips/netboot/conf.c
N src/sys/arch/evbmips/stand/sbmips/netboot/dev_net.c
N src/sys/arch/evbmips/stand/sbmips/netboot/getsecs.c
N src/sys/arch/evbmips/stand/sbmips/netboot/if_cfe.c
N src/sys/arch/evbmips/stand/sbmips/netboot/version
N src/sys/arch/evbmips/stand/sbmips/netboot/devopen.c

No conflicts created by this import



CVS import: src/sys/arch/evbmips

2017-07-24 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Mon Jul 24 09:21:50 UTC 2017

Update of /cvsroot/src/sys/arch/evbmips
In directory ivanova.netbsd.org:/tmp/cvs-serv11701

Log Message:
sbmips->evbmips merge:  import all the all the header files except
intr.h and disklabel.h that are needed.  both of these will need
some special attention.

Status:

Vendor Tag: NetBSD
Release Tags:   NetBSD-2017-07-22

N src/sys/arch/evbmips/sbmips/autoconf.h
N src/sys/arch/evbmips/sbmips/cpuvar.h
N src/sys/arch/evbmips/sbmips/leds.h
N src/sys/arch/evbmips/sbmips/swarm.h
N src/sys/arch/evbmips/sbmips/systemsw.h
N src/sys/arch/evbmips/include/loadfile_machdep.h

No conflicts created by this import



CVS commit: src/libexec/ld.elf_so/arch/sparc64

2017-07-24 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Jul 24 08:08:34 UTC 2017

Modified Files:
src/libexec/ld.elf_so/arch/sparc64: mdreloc.c

Log Message:
Fix thinko in previous: even if the address is an unsigned value and we
have verified the range before, we still need to mask the bit pattern
to the target instruction field.


To generate a diff of this commit:
cvs rdiff -u -r1.62 -r1.63 src/libexec/ld.elf_so/arch/sparc64/mdreloc.c

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

Modified files:

Index: src/libexec/ld.elf_so/arch/sparc64/mdreloc.c
diff -u src/libexec/ld.elf_so/arch/sparc64/mdreloc.c:1.62 src/libexec/ld.elf_so/arch/sparc64/mdreloc.c:1.63
--- src/libexec/ld.elf_so/arch/sparc64/mdreloc.c:1.62	Sun Jul 23 14:37:51 2017
+++ src/libexec/ld.elf_so/arch/sparc64/mdreloc.c	Mon Jul 24 08:08:34 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: mdreloc.c,v 1.62 2017/07/23 14:37:51 martin Exp $	*/
+/*	$NetBSD: mdreloc.c,v 1.63 2017/07/24 08:08:34 martin Exp $	*/
 
 /*-
  * Copyright (c) 2000 Eduardo Horvath.
@@ -32,7 +32,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: mdreloc.c,v 1.62 2017/07/23 14:37:51 martin Exp $");
+__RCSID("$NetBSD: mdreloc.c,v 1.63 2017/07/24 08:08:34 martin Exp $");
 #endif /* not lint */
 
 #include 
@@ -651,7 +651,7 @@ _rtld_relocate_plt_object(const Obj_Entr
 		 *	nop
 		 *
 		 */
-		where[1] = BAA | (offBAA >> 2);
+		where[1] = BAA | ((offBAA >> 2) & 0x7);
 		__asm volatile("iflush %0+4" : : "r" (where));
 	} else if (value < (1L<<32)) {
 		/* 



CVS commit: src/libexec/ld.elf_so/arch/sparc64

2017-07-24 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Jul 24 08:08:34 UTC 2017

Modified Files:
src/libexec/ld.elf_so/arch/sparc64: mdreloc.c

Log Message:
Fix thinko in previous: even if the address is an unsigned value and we
have verified the range before, we still need to mask the bit pattern
to the target instruction field.


To generate a diff of this commit:
cvs rdiff -u -r1.62 -r1.63 src/libexec/ld.elf_so/arch/sparc64/mdreloc.c

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



CVS import: src/sys/arch/evbmips

2017-07-24 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Mon Jul 24 08:56:29 UTC 2017

Update of /cvsroot/src/sys/arch/evbmips
In directory ivanova.netbsd.org:/tmp/cvs-serv26314

Log Message:
import most of the sbmips port into evbmips.  the renames are:
- TODO -> evbmips/sbmips/TODO
- sbmips -> evbmips/sbmips
- stand -> evbmips/stand
- conf/files* -> evbmips/conf/files*
- conf/GENERIC* -> evbmips/conf/SBMIPS*

this is not yet ported and will need to be updated, but it's a first step,
and it doesn't handle any include/* issues that need to be dealt with.

Status:

Vendor Tag: NetBSD
Release Tags:   NetBSD-2017-07-22

N src/sys/arch/evbmips/sbmips/TODO
N src/sys/arch/evbmips/sbmips/disksubr.c
N src/sys/arch/evbmips/sbmips/autoconf.c
N src/sys/arch/evbmips/sbmips/console.c
N src/sys/arch/evbmips/sbmips/machdep.c
N src/sys/arch/evbmips/sbmips/locore_machdep.S
N src/sys/arch/evbmips/sbmips/rtc.c
N src/sys/arch/evbmips/sbmips/sb1250_icu.c
N src/sys/arch/evbmips/sbmips/systemsw.c
N src/sys/arch/evbmips/sbmips/zbbus.c
N src/sys/arch/evbmips/sbmips/cpu.c
N src/sys/arch/evbmips/conf/SBMIPS
N src/sys/arch/evbmips/conf/SBMIPS64
N src/sys/arch/evbmips/conf/SBMIPS64.MP
N src/sys/arch/evbmips/conf/files.sbmips
N src/sys/arch/evbmips/conf/std.sbmips
N src/sys/arch/evbmips/conf/SBMIPS.MP
N src/sys/arch/evbmips/stand/sbmips/Makefile
N src/sys/arch/evbmips/stand/sbmips/Makefile.bootprogs
N src/sys/arch/evbmips/stand/sbmips/Makefile.bootxx
N src/sys/arch/evbmips/stand/sbmips/Makefile.inc
N src/sys/arch/evbmips/stand/sbmips/boot/Makefile
N src/sys/arch/evbmips/stand/sbmips/boot/filesystem.c
N src/sys/arch/evbmips/stand/sbmips/boot/version
N src/sys/arch/evbmips/stand/sbmips/bootxx_cd9660/Makefile
N src/sys/arch/evbmips/stand/sbmips/bootxx_ffs/Makefile
N src/sys/arch/evbmips/stand/sbmips/bootxx_lfs/Makefile
N src/sys/arch/evbmips/stand/sbmips/common/bbinfo.h
N src/sys/arch/evbmips/stand/sbmips/common/blkdev.c
N src/sys/arch/evbmips/stand/sbmips/common/blkdev.h
N src/sys/arch/evbmips/stand/sbmips/common/boot.c
N src/sys/arch/evbmips/stand/sbmips/common/boot.ldscript
N src/sys/arch/evbmips/stand/sbmips/common/booted_dev.c
N src/sys/arch/evbmips/stand/sbmips/common/bootxx.c
N src/sys/arch/evbmips/stand/sbmips/common/cfe.c
N src/sys/arch/evbmips/stand/sbmips/common/cfe_api.c
N src/sys/arch/evbmips/stand/sbmips/common/cfe_api.h
N src/sys/arch/evbmips/stand/sbmips/common/cfe_api_int.h
N src/sys/arch/evbmips/stand/sbmips/common/cfe_error.h
N src/sys/arch/evbmips/stand/sbmips/common/cfe_ioctl.h
N src/sys/arch/evbmips/stand/sbmips/common/checksize.sh
N src/sys/arch/evbmips/stand/sbmips/common/common.h
N src/sys/arch/evbmips/stand/sbmips/common/panic_putstr.c
N src/sys/arch/evbmips/stand/sbmips/common/putstr.c
N src/sys/arch/evbmips/stand/sbmips/common/start.S
N src/sys/arch/evbmips/stand/sbmips/netboot/Makefile
N src/sys/arch/evbmips/stand/sbmips/netboot/conf.c
N src/sys/arch/evbmips/stand/sbmips/netboot/dev_net.c
N src/sys/arch/evbmips/stand/sbmips/netboot/getsecs.c
N src/sys/arch/evbmips/stand/sbmips/netboot/if_cfe.c
N src/sys/arch/evbmips/stand/sbmips/netboot/version
N src/sys/arch/evbmips/stand/sbmips/netboot/devopen.c

No conflicts created by this import



CVS import: src/sys/arch/evbmips

2017-07-24 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Mon Jul 24 09:21:50 UTC 2017

Update of /cvsroot/src/sys/arch/evbmips
In directory ivanova.netbsd.org:/tmp/cvs-serv11701

Log Message:
sbmips->evbmips merge:  import all the all the header files except
intr.h and disklabel.h that are needed.  both of these will need
some special attention.

Status:

Vendor Tag: NetBSD
Release Tags:   NetBSD-2017-07-22

N src/sys/arch/evbmips/sbmips/autoconf.h
N src/sys/arch/evbmips/sbmips/cpuvar.h
N src/sys/arch/evbmips/sbmips/leds.h
N src/sys/arch/evbmips/sbmips/swarm.h
N src/sys/arch/evbmips/sbmips/systemsw.h
N src/sys/arch/evbmips/include/loadfile_machdep.h

No conflicts created by this import



CVS commit: src/bin/sh

2017-07-24 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Mon Jul 24 12:35:12 UTC 2017

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

Log Message:
PR bin/52348

Avoid a reference after free (detected by asan) - harmless here, but
easy to fix.


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 src/bin/sh/error.c

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

Modified files:

Index: src/bin/sh/error.c
diff -u src/bin/sh/error.c:1.40 src/bin/sh/error.c:1.41
--- src/bin/sh/error.c:1.40	Wed Jul  5 20:00:27 2017
+++ src/bin/sh/error.c	Mon Jul 24 12:35:12 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: error.c,v 1.40 2017/07/05 20:00:27 kre Exp $	*/
+/*	$NetBSD: error.c,v 1.41 2017/07/24 12:35:12 kre Exp $	*/
 
 /*-
  * Copyright (c) 1991, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)error.c	8.2 (Berkeley) 5/4/95";
 #else
-__RCSID("$NetBSD: error.c,v 1.40 2017/07/05 20:00:27 kre Exp $");
+__RCSID("$NetBSD: error.c,v 1.41 2017/07/24 12:35:12 kre Exp $");
 #endif
 #endif /* not lint */
 
@@ -129,7 +129,8 @@ exvwarning(int sv_errno, const char *msg
 	 *	printf '%d %d %d\n' 1 a 2
 	 * both generate sensible text when stdout and stderr are merged.
 	 */
-	if (output.nextc != output.buf && output.nextc[-1] == '\n')
+	if (output.buf != NULL && output.nextc != output.buf &&
+	output.nextc[-1] == '\n')
 		flushout();
 	if (commandname)
 		outfmt(, "%s: ", commandname);



CVS commit: src/bin/sh

2017-07-24 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Mon Jul 24 12:34:46 UTC 2017

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

Log Message:
PR bin/52348

Silence nuisance testing environments - avoid << of a negative number
(a signed char -- in a hash function, the result is irrelevant, as long
as it is repeatable).


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/bin/sh/alias.c

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-07-24 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Mon Jul 24 12:34:46 UTC 2017

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

Log Message:
PR bin/52348

Silence nuisance testing environments - avoid << of a negative number
(a signed char -- in a hash function, the result is irrelevant, as long
as it is repeatable).


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/bin/sh/alias.c

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

Modified files:

Index: src/bin/sh/alias.c
diff -u src/bin/sh/alias.c:1.15 src/bin/sh/alias.c:1.16
--- src/bin/sh/alias.c:1.15	Wed Jun 18 18:17:30 2014
+++ src/bin/sh/alias.c	Mon Jul 24 12:34:45 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: alias.c,v 1.15 2014/06/18 18:17:30 christos Exp $	*/
+/*	$NetBSD: alias.c,v 1.16 2017/07/24 12:34:45 kre Exp $	*/
 
 /*-
  * Copyright (c) 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)alias.c	8.3 (Berkeley) 5/4/95";
 #else
-__RCSID("$NetBSD: alias.c,v 1.15 2014/06/18 18:17:30 christos Exp $");
+__RCSID("$NetBSD: alias.c,v 1.16 2017/07/24 12:34:45 kre Exp $");
 #endif
 #endif /* not lint */
 
@@ -268,8 +268,8 @@ hashalias(const char *p)
 {
 	unsigned int hashval;
 
-	hashval = *p << 4;
+	hashval = *(const unsigned char *)p << 4;
 	while (*p)
-		hashval+= *p++;
+		hashval += *p++;
 	return [hashval % ATABSIZE];
 }



CVS commit: src/bin/sh

2017-07-24 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Mon Jul 24 12:36:02 UTC 2017

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

Log Message:
Document the times builtin command, reported as lost in space
by rudolf at eq.cz on tech-userlevel (July 15, 2017.)

Also correct a typo, de-correct some entirely proper English so
the doc remains written in American instead.  And note that
interactive mode is set when stdin & stderr are terminals, not
stding and stdout.


To generate a diff of this commit:
cvs rdiff -u -r1.159 -r1.160 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.159 src/bin/sh/sh.1:1.160
--- src/bin/sh/sh.1:1.159	Sat Jul  1 05:11:57 2017
+++ src/bin/sh/sh.1	Mon Jul 24 12:36:02 2017
@@ -1,4 +1,4 @@
-.\"	$NetBSD: sh.1,v 1.159 2017/07/01 05:11:57 wiz Exp $
+.\"	$NetBSD: sh.1,v 1.160 2017/07/24 12:36:02 kre Exp $
 .\" Copyright (c) 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
 .\"
@@ -31,7 +31,7 @@
 .\"
 .\"	@(#)sh.1	8.6 (Berkeley) 5/4/95
 .\"
-.Dd July 1, 2017
+.Dd July 15, 2017
 .Dt SH 1
 .\" everything except c o and s (keep them ordered)
 .ds flags abCEeFfhIiLmnpquVvx
@@ -113,8 +113,8 @@ can be typed directly to the running she
 the file can be executed directly by the shell.
 .Ss Invocation
 If no arguments are present and if the standard input,
-and output, of the shell
-are connected to a terminal (or if the
+and standard error output, of the shell
+are connected to a terminal (or terminals, or if the
 .Fl i
 flag is set),
 and the
@@ -396,7 +396,7 @@ Read commands from standard input (set a
 neither
 .Fl c
 nor file arguments are present).
-If after procesing a command_string with the
+If after processing a command_string with the
 .Fl c
 option, the shell has not exited, and the
 .Fl s
@@ -2515,6 +2515,24 @@ The shift count must be less than or equ
 positional parameters (
 .Dq $# )
 before the shift.
+.It times
+Prints two lines to standard output.
+Each line contains two accumulated time values, expressed
+in minutes and seconds (including fractions of a second.)
+The first value gives the user time consumed, the second the system time.
+.Pp
+The first output line gives the cpu and system times consumed by the
+shell itself.
+The second line gives the accumulated times for children of this
+shell (and their descendants) which have exited, and then been
+successfully waited for by the relevant parent.
+See
+.Xr times 3
+for more information.
+.Pp
+.Ic times
+has no parameters, and exits with an exit status of 0 unless
+an attempt is made to give it an option.
 .It trap Ar action signal ...
 .It trap \-
 .It trap Oo Fl l Oc
@@ -3086,7 +3104,7 @@ is enabled.
 defaults to
 .Dq + \  .
 .It Ev PSc
-Initialised by the shell, ignoring any value from the environment,
+Initialized by the shell, ignoring any value from the environment,
 to a single character string, either
 .Sq 

CVS commit: src/bin/sh

2017-07-24 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Mon Jul 24 12:36:02 UTC 2017

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

Log Message:
Document the times builtin command, reported as lost in space
by rudolf at eq.cz on tech-userlevel (July 15, 2017.)

Also correct a typo, de-correct some entirely proper English so
the doc remains written in American instead.  And note that
interactive mode is set when stdin & stderr are terminals, not
stding and stdout.


To generate a diff of this commit:
cvs rdiff -u -r1.159 -r1.160 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/bin/sh

2017-07-24 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Mon Jul 24 12:35:12 UTC 2017

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

Log Message:
PR bin/52348

Avoid a reference after free (detected by asan) - harmless here, but
easy to fix.


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 src/bin/sh/error.c

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-07-24 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Mon Jul 24 12:35:37 UTC 2017

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

Log Message:
PR standards/52406

Absent other information, the shell should be interactive if reading
from stdin, and stdin and stderr are ttys, not stdin and stdout.

So sayeth the great lord posix.


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/bin/sh/options.c

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

Modified files:

Index: src/bin/sh/options.c
diff -u src/bin/sh/options.c:1.49 src/bin/sh/options.c:1.50
--- src/bin/sh/options.c:1.49	Mon May 29 14:03:23 2017
+++ src/bin/sh/options.c	Mon Jul 24 12:35:37 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: options.c,v 1.49 2017/05/29 14:03:23 kre Exp $	*/
+/*	$NetBSD: options.c,v 1.50 2017/07/24 12:35:37 kre Exp $	*/
 
 /*-
  * Copyright (c) 1991, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)options.c	8.2 (Berkeley) 5/4/95";
 #else
-__RCSID("$NetBSD: options.c,v 1.49 2017/05/29 14:03:23 kre Exp $");
+__RCSID("$NetBSD: options.c,v 1.50 2017/07/24 12:35:37 kre Exp $");
 #endif
 #endif /* not lint */
 
@@ -107,7 +107,7 @@ procargs(int argc, char **argv)
 
 	if (*argptr == NULL && minusc == NULL)
 		sflag = 1;
-	if (iflag == 2 && sflag == 1 && isatty(0) && isatty(1))
+	if (iflag == 2 && sflag == 1 && isatty(0) && isatty(2))
 		iflag = 1;
 	if (iflag == 1 && sflag == 2)
 		iflag = 2;



  1   2   >