CVS commit: [netbsd-7] src/doc

2017-04-16 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Mon Apr 17 06:08:12 UTC 2017

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

Log Message:
1354, 1367


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

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

Modified files:

Index: src/doc/CHANGES-7.2
diff -u src/doc/CHANGES-7.2:1.1.2.8 src/doc/CHANGES-7.2:1.1.2.9
--- src/doc/CHANGES-7.2:1.1.2.8	Tue Apr 11 16:56:31 2017
+++ src/doc/CHANGES-7.2	Mon Apr 17 06:08:12 2017
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-7.2,v 1.1.2.8 2017/04/11 16:56:31 martin Exp $
+# $NetBSD: CHANGES-7.2,v 1.1.2.9 2017/04/17 06:08:12 snj Exp $
 
 A complete list of changes from the NetBSD 7.1 release to the NetBSD 7.2
 release:
@@ -567,4 +567,51 @@ sys/arch/evbarm/conf/TWINTAIL			1.65
 	Comment out more USB options to to fix build.
 	[skrll, ticket #1400]
 
+sys/compat/linux/arch/alpha/linux_syscall.h	regen
+sys/compat/linux/arch/alpha/linux_syscallargs.h	regen
+sys/compat/linux/arch/alpha/linux_syscalls.c	regen
+sys/compat/linux/arch/alpha/linux_sysent.c	regen
+sys/compat/linux/arch/alpha/syscalls.master	1.92 via patch
+sys/compat/linux/arch/amd64/linux_syscall.h	regen
+sys/compat/linux/arch/amd64/linux_syscallargs.h	regen
+sys/compat/linux/arch/amd64/linux_syscalls.c	regen
+sys/compat/linux/arch/amd64/linux_sysent.c	regen
+sys/compat/linux/arch/amd64/syscalls.master	1.58 via patch
+sys/compat/linux/arch/arm/linux_syscall.h	regen
+sys/compat/linux/arch/arm/linux_syscallargs.h	regen
+sys/compat/linux/arch/arm/linux_syscalls.c	regen
+sys/compat/linux/arch/arm/linux_sysent.c	regen
+sys/compat/linux/arch/arm/syscalls.master	1.65 via patch
+sys/compat/linux/arch/i386/linux_syscall.h	regen
+sys/compat/linux/arch/i386/linux_syscallargs.h	regen
+sys/compat/linux/arch/i386/linux_syscalls.c	regen
+sys/compat/linux/arch/i386/linux_sysent.c	regen
+sys/compat/linux/arch/i386/syscalls.master	1.122 via patch
+sys/compat/linux/arch/m68k/linux_syscall.h	regen
+sys/compat/linux/arch/m68k/linux_syscallargs.h	regen
+sys/compat/linux/arch/m68k/linux_syscalls.c	regen
+sys/compat/linux/arch/m68k/linux_sysent.c	regen
+sys/compat/linux/arch/m68k/syscalls.master	1.91 via patch
+sys/compat/linux/arch/mips/linux_syscall.h	regen
+sys/compat/linux/arch/mips/linux_syscallargs.h	regen
+sys/compat/linux/arch/mips/linux_syscalls.c	regen
+sys/compat/linux/arch/mips/linux_sysent.c	regen
+sys/compat/linux/arch/mips/syscalls.master	1.61 via patch
+sys/compat/linux/arch/powerpc/linux_syscall.h	regen
+sys/compat/linux/arch/powerpc/linux_syscallargs.h	regen
+sys/compat/linux/arch/powerpc/linux_syscalls.c	regen
+sys/compat/linux/arch/powerpc/linux_sysent.c	regen
+sys/compat/linux/arch/powerpc/syscalls.master	1.70 via patch
+sys/compat/linux/common/linux_misc.c		1.234
+sys/compat/linux/common/linux_signal.h		1.31
+
+	Add pselect6 Linux system call.
+	[manu, ticket #1354]
+
+sys/arch/amd64/conf/XEN3_DOM0			1.126
+sys/arch/i386/conf/XEN3_DOM0			1.104
+sys/arch/xen/x86/xen_pmap.c			1.25
+
+	Make xen dom0 SMP bootable again.  Disabled by default.
+	[khorben, ticket #1367]
 



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

2017-04-16 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Mon Apr 17 06:02:05 UTC 2017

Modified Files:
src/sys/arch/amd64/conf [netbsd-7]: XEN3_DOM0
src/sys/arch/i386/conf [netbsd-7]: XEN3_DOM0
src/sys/arch/xen/x86 [netbsd-7]: xen_pmap.c

Log Message:
Pull up following revision(s) (requested by khorben in ticket #1367):
sys/arch/amd64/conf/XEN3_DOM0: revision 1.126
sys/arch/i386/conf/XEN3_DOM0: revision 1.104
sys/arch/xen/x86/xen_pmap.c: revision 1.25
In the MP case,
do not attempt to pmap_tlb_shootdown() after a pmap_kenter_ma() during
boot. pmap_tlb_shootdown() assumes post boot. Instead invalidate the
entry on the local CPU only.
XXX: to DTRT, probably this assumption needs re-examination.
XXX: The tradeoff is a (predicted) single word size comparison
  penalty, so perhaps a decision needs performance stats.
xen dom0 SMP is now bootable again.
--
add the 'options MULTIPROCESSOR' in respective configs, but mark them
experimental - and thus disabled by default.


To generate a diff of this commit:
cvs rdiff -u -r1.103.2.5 -r1.103.2.6 src/sys/arch/amd64/conf/XEN3_DOM0
cvs rdiff -u -r1.85.2.6 -r1.85.2.7 src/sys/arch/i386/conf/XEN3_DOM0
cvs rdiff -u -r1.22 -r1.22.14.1 src/sys/arch/xen/x86/xen_pmap.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/amd64/conf/XEN3_DOM0
diff -u src/sys/arch/amd64/conf/XEN3_DOM0:1.103.2.5 src/sys/arch/amd64/conf/XEN3_DOM0:1.103.2.6
--- src/sys/arch/amd64/conf/XEN3_DOM0:1.103.2.5	Fri Dec  9 05:10:45 2016
+++ src/sys/arch/amd64/conf/XEN3_DOM0	Mon Apr 17 06:02:05 2017
@@ -1,7 +1,9 @@
-# $NetBSD: XEN3_DOM0,v 1.103.2.5 2016/12/09 05:10:45 snj Exp $
+# $NetBSD: XEN3_DOM0,v 1.103.2.6 2017/04/17 06:02:05 snj Exp $
 
 include 	"arch/amd64/conf/std.xen"
 
+#options 	MULTIPROCESSOR	# (experimental)
+
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
 #options 	UVMHIST

Index: src/sys/arch/i386/conf/XEN3_DOM0
diff -u src/sys/arch/i386/conf/XEN3_DOM0:1.85.2.6 src/sys/arch/i386/conf/XEN3_DOM0:1.85.2.7
--- src/sys/arch/i386/conf/XEN3_DOM0:1.85.2.6	Fri Dec  9 05:10:45 2016
+++ src/sys/arch/i386/conf/XEN3_DOM0	Mon Apr 17 06:02:05 2017
@@ -1,9 +1,11 @@
-#	$NetBSD: XEN3_DOM0,v 1.85.2.6 2016/12/09 05:10:45 snj Exp $
+#	$NetBSD: XEN3_DOM0,v 1.85.2.7 2017/04/17 06:02:05 snj Exp $
 #
 #	XEN3_0: Xen 3.0 domain0 kernel
 
 include 	"arch/xen/conf/std.xen"
 
+#options 	MULTIPROCESSOR	# (experimental)
+
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
 #options 	UVMHIST

Index: src/sys/arch/xen/x86/xen_pmap.c
diff -u src/sys/arch/xen/x86/xen_pmap.c:1.22 src/sys/arch/xen/x86/xen_pmap.c:1.22.14.1
--- src/sys/arch/xen/x86/xen_pmap.c:1.22	Sun Jun 24 18:31:53 2012
+++ src/sys/arch/xen/x86/xen_pmap.c	Mon Apr 17 06:02:05 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: xen_pmap.c,v 1.22 2012/06/24 18:31:53 jym Exp $	*/
+/*	$NetBSD: xen_pmap.c,v 1.22.14.1 2017/04/17 06:02:05 snj Exp $	*/
 
 /*
  * Copyright (c) 2007 Manuel Bouyer.
@@ -102,7 +102,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: xen_pmap.c,v 1.22 2012/06/24 18:31:53 jym Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xen_pmap.c,v 1.22.14.1 2017/04/17 06:02:05 snj Exp $");
 
 #include "opt_user_ldt.h"
 #include "opt_lockdebug.h"
@@ -192,9 +192,13 @@ pmap_kenter_ma(vaddr_t va, paddr_t ma, v
 
 	if (pmap_valid_entry(opte)) {
 #if defined(MULTIPROCESSOR)
-		kpreempt_disable();
-		pmap_tlb_shootdown(pmap_kernel(), va, opte, TLBSHOOT_KENTER);
-		kpreempt_enable();
+		if (__predict_false(x86_mp_online == false)) {
+			pmap_update_pg(va);
+		} else {
+			kpreempt_disable();
+			pmap_tlb_shootdown(pmap_kernel(), va, opte, TLBSHOOT_KENTER);
+			kpreempt_enable();
+		}
 #else
 		/* Don't bother deferring in the single CPU case. */
 		pmap_update_pg(va);



CVS commit: src/sys/netipsec

2017-04-16 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Mon Apr 17 05:48:18 UTC 2017

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

Log Message:
Accept AH with NULL algorithm of zero-length key


To generate a diff of this commit:
cvs rdiff -u -r1.105 -r1.106 src/sys/netipsec/key.c

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

Modified files:

Index: src/sys/netipsec/key.c
diff -u src/sys/netipsec/key.c:1.105 src/sys/netipsec/key.c:1.106
--- src/sys/netipsec/key.c:1.105	Mon Apr 10 14:02:25 2017
+++ src/sys/netipsec/key.c	Mon Apr 17 05:48:18 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: key.c,v 1.105 2017/04/10 14:02:25 ozaki-r Exp $	*/
+/*	$NetBSD: key.c,v 1.106 2017/04/17 05:48:18 ozaki-r Exp $	*/
 /*	$FreeBSD: src/sys/netipsec/key.c,v 1.3.2.3 2004/02/14 22:23:23 bms Exp $	*/
 /*	$KAME: key.c,v 1.191 2001/06/27 10:46:49 sakane Exp $	*/
 
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: key.c,v 1.105 2017/04/10 14:02:25 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: key.c,v 1.106 2017/04/17 05:48:18 ozaki-r Exp $");
 
 /*
  * This code is referd to RFC 2367
@@ -6121,7 +6121,7 @@ key_getsizes_ah(const struct auth_hash *
 		switch (alg) {
 		case SADB_X_AALG_MD5:	*ksmin = *ksmax = 16; break;
 		case SADB_X_AALG_SHA:	*ksmin = *ksmax = 20; break;
-		case SADB_X_AALG_NULL:	*ksmin = 1; *ksmax = 256; break;
+		case SADB_X_AALG_NULL:	*ksmin = 0; *ksmax = 256; break;
 		default:
 			DPRINTF(("key_getsizes_ah: unknown AH algorithm %u\n",
 alg));



CVS commit: [netbsd-7] src/sys/compat/linux/arch

2017-04-16 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Mon Apr 17 05:23:01 UTC 2017

Modified Files:
src/sys/compat/linux/arch/alpha [netbsd-7]: linux_syscall.h
linux_syscallargs.h linux_syscalls.c linux_sysent.c
src/sys/compat/linux/arch/amd64 [netbsd-7]: linux_syscall.h
linux_syscallargs.h linux_syscalls.c linux_sysent.c
src/sys/compat/linux/arch/arm [netbsd-7]: linux_syscall.h
linux_syscallargs.h linux_syscalls.c linux_sysent.c
src/sys/compat/linux/arch/i386 [netbsd-7]: linux_syscall.h
linux_syscallargs.h linux_syscalls.c linux_sysent.c
src/sys/compat/linux/arch/m68k [netbsd-7]: linux_syscall.h
linux_syscallargs.h linux_syscalls.c linux_sysent.c
src/sys/compat/linux/arch/mips [netbsd-7]: linux_syscall.h
linux_syscallargs.h linux_syscalls.c linux_sysent.c
src/sys/compat/linux/arch/powerpc [netbsd-7]: linux_syscall.h
linux_syscallargs.h linux_syscalls.c linux_sysent.c

Log Message:
regen for ticket 1354


To generate a diff of this commit:
cvs rdiff -u -r1.94 -r1.94.2.1 \
src/sys/compat/linux/arch/alpha/linux_syscall.h \
src/sys/compat/linux/arch/alpha/linux_sysent.c
cvs rdiff -u -r1.93 -r1.93.2.1 \
src/sys/compat/linux/arch/alpha/linux_syscallargs.h
cvs rdiff -u -r1.95 -r1.95.2.1 \
src/sys/compat/linux/arch/alpha/linux_syscalls.c
cvs rdiff -u -r1.54 -r1.54.2.1 \
src/sys/compat/linux/arch/amd64/linux_syscall.h \
src/sys/compat/linux/arch/amd64/linux_syscallargs.h \
src/sys/compat/linux/arch/amd64/linux_syscalls.c \
src/sys/compat/linux/arch/amd64/linux_sysent.c
cvs rdiff -u -r1.64 -r1.64.2.1 src/sys/compat/linux/arch/arm/linux_syscall.h \
src/sys/compat/linux/arch/arm/linux_syscallargs.h \
src/sys/compat/linux/arch/arm/linux_syscalls.c \
src/sys/compat/linux/arch/arm/linux_sysent.c
cvs rdiff -u -r1.103 -r1.103.2.1 \
src/sys/compat/linux/arch/i386/linux_syscall.h \
src/sys/compat/linux/arch/i386/linux_syscallargs.h \
src/sys/compat/linux/arch/i386/linux_sysent.c
cvs rdiff -u -r1.104 -r1.104.2.1 \
src/sys/compat/linux/arch/i386/linux_syscalls.c
cvs rdiff -u -r1.94 -r1.94.2.1 src/sys/compat/linux/arch/m68k/linux_syscall.h \
src/sys/compat/linux/arch/m68k/linux_syscalls.c \
src/sys/compat/linux/arch/m68k/linux_sysent.c
cvs rdiff -u -r1.93 -r1.93.2.1 \
src/sys/compat/linux/arch/m68k/linux_syscallargs.h
cvs rdiff -u -r1.61 -r1.61.2.1 src/sys/compat/linux/arch/mips/linux_syscall.h
cvs rdiff -u -r1.60 -r1.60.2.1 \
src/sys/compat/linux/arch/mips/linux_syscallargs.h \
src/sys/compat/linux/arch/mips/linux_syscalls.c \
src/sys/compat/linux/arch/mips/linux_sysent.c
cvs rdiff -u -r1.70 -r1.70.2.1 \
src/sys/compat/linux/arch/powerpc/linux_syscall.h \
src/sys/compat/linux/arch/powerpc/linux_sysent.c
cvs rdiff -u -r1.69 -r1.69.2.1 \
src/sys/compat/linux/arch/powerpc/linux_syscallargs.h \
src/sys/compat/linux/arch/powerpc/linux_syscalls.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/compat/linux/arch/alpha/linux_syscall.h
diff -u src/sys/compat/linux/arch/alpha/linux_syscall.h:1.94 src/sys/compat/linux/arch/alpha/linux_syscall.h:1.94.2.1
--- src/sys/compat/linux/arch/alpha/linux_syscall.h:1.94	Thu May 29 10:36:31 2014
+++ src/sys/compat/linux/arch/alpha/linux_syscall.h	Mon Apr 17 05:23:00 2017
@@ -1,10 +1,10 @@
-/* $NetBSD: linux_syscall.h,v 1.94 2014/05/29 10:36:31 njoly Exp $ */
+/* $NetBSD: linux_syscall.h,v 1.94.2.1 2017/04/17 05:23:00 snj Exp $ */
 
 /*
  * System call numbers.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * created from	NetBSD: syscalls.master,v 1.88 2014/05/29 10:35:26 njoly Exp
+ * created from	NetBSD: syscalls.master,v 1.88.2.1 2017/04/17 05:19:09 snj Exp
  */
 
 #ifndef _LINUX_SYS_SYSCALL_H_
@@ -639,6 +639,9 @@
 /* syscall: "faccessat" ret: "int" args: "int" "const char *" "int" */
 #define	LINUX_SYS_faccessat	462
 
+/* syscall: "pselect6" ret: "int" args: "int" "fd_set *" "fd_set *" "fd_set *" "struct linux_timespec *" "linux_sized_sigset_t *" */
+#define	LINUX_SYS_pselect6	463
+
 /* syscall: "ppoll" ret: "int" args: "struct pollfd *" "int" "struct linux_timespec *" "linux_sigset_t *" */
 #define	LINUX_SYS_ppoll	464
 
Index: src/sys/compat/linux/arch/alpha/linux_sysent.c
diff -u src/sys/compat/linux/arch/alpha/linux_sysent.c:1.94 src/sys/compat/linux/arch/alpha/linux_sysent.c:1.94.2.1
--- src/sys/compat/linux/arch/alpha/linux_sysent.c:1.94	Thu May 29 10:36:31 2014
+++ src/sys/compat/linux/arch/alpha/linux_sysent.c	Mon Apr 17 05:23:00 2017
@@ -1,14 +1,14 @@
-/* $NetBSD: linux_sysent.c,v 1.94 2014/05/29 10:36:31 njoly Exp $ */
+/* $NetBSD: linux_sysent.c,v 1.94.2.1 2017/04/17 05:23:00 snj Exp $ */
 
 /*
  * System call switch table.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * created from	NetBSD: syscalls.master,v 1.88 2014/05/

CVS commit: [netbsd-7] src/sys/compat/linux

2017-04-16 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Mon Apr 17 05:19:09 UTC 2017

Modified Files:
src/sys/compat/linux/arch/alpha [netbsd-7]: syscalls.master
src/sys/compat/linux/arch/amd64 [netbsd-7]: syscalls.master
src/sys/compat/linux/arch/arm [netbsd-7]: syscalls.master
src/sys/compat/linux/arch/i386 [netbsd-7]: syscalls.master
src/sys/compat/linux/arch/m68k [netbsd-7]: syscalls.master
src/sys/compat/linux/arch/mips [netbsd-7]: syscalls.master
src/sys/compat/linux/arch/powerpc [netbsd-7]: syscalls.master
src/sys/compat/linux/common [netbsd-7]: linux_misc.c linux_signal.h

Log Message:
Pull up following revision(s) (requested by manu in ticket #1354):
sys/compat/linux/arch/alpha/syscalls.master: revision 1.92 via patch
sys/compat/linux/arch/amd64/syscalls.master: revision 1.58 via patch
sys/compat/linux/arch/arm/syscalls.master: revision 1.65 via patch
sys/compat/linux/arch/i386/syscalls.master: revision 1.122 via patch
sys/compat/linux/arch/m68k/syscalls.master: revision 1.91 via patch
sys/compat/linux/arch/mips/syscalls.master: revision 1.61 via patch
sys/compat/linux/arch/powerpc/syscalls.master: revision 1.70 via patch
sys/compat/linux/common/linux_misc.c: revision 1.234
sys/compat/linux/common/linux_signal.h: revision 1.31
Add pselect6 Linux system call.
This lets Matlab R2016A run on NetBSD/amd64


To generate a diff of this commit:
cvs rdiff -u -r1.88 -r1.88.2.1 \
src/sys/compat/linux/arch/alpha/syscalls.master
cvs rdiff -u -r1.52 -r1.52.2.1 \
src/sys/compat/linux/arch/amd64/syscalls.master
cvs rdiff -u -r1.61 -r1.61.2.1 src/sys/compat/linux/arch/arm/syscalls.master
cvs rdiff -u -r1.118 -r1.118.2.1 \
src/sys/compat/linux/arch/i386/syscalls.master
cvs rdiff -u -r1.88 -r1.88.2.1 src/sys/compat/linux/arch/m68k/syscalls.master
cvs rdiff -u -r1.56 -r1.56.2.1 src/sys/compat/linux/arch/mips/syscalls.master
cvs rdiff -u -r1.65 -r1.65.2.1 \
src/sys/compat/linux/arch/powerpc/syscalls.master
cvs rdiff -u -r1.229 -r1.229.2.1 src/sys/compat/linux/common/linux_misc.c
cvs rdiff -u -r1.30 -r1.30.38.1 src/sys/compat/linux/common/linux_signal.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/compat/linux/arch/alpha/syscalls.master
diff -u src/sys/compat/linux/arch/alpha/syscalls.master:1.88 src/sys/compat/linux/arch/alpha/syscalls.master:1.88.2.1
--- src/sys/compat/linux/arch/alpha/syscalls.master:1.88	Thu May 29 10:35:26 2014
+++ src/sys/compat/linux/arch/alpha/syscalls.master	Mon Apr 17 05:19:09 2017
@@ -1,4 +1,4 @@
-	$NetBSD: syscalls.master,v 1.88 2014/05/29 10:35:26 njoly Exp $
+	$NetBSD: syscalls.master,v 1.88.2.1 2017/04/17 05:19:09 snj Exp $
 ;
 ;	@(#)syscalls.master	8.1 (Berkeley) 7/19/93
 
@@ -728,7 +728,10 @@
 			linux_umode_t mode); }
 462	STD		{ int|linux_sys||faccessat(int fd, const char *path, \
 			int amode); }
-463	UNIMPL		pselect6
+463	STD		{ int|linux_sys||pselect6(int nfds, fd_set *readfds, \
+			fd_set *writefds, fd_set *exceptfds, \
+			struct linux_timespec *timeout, \
+			linux_sized_sigset_t *ss); }
 464	STD		{ int|linux_sys||ppoll(struct pollfd *fds, int nfds, \
 			struct linux_timespec *timeout, \
 			linux_sigset_t *sigset); }

Index: src/sys/compat/linux/arch/amd64/syscalls.master
diff -u src/sys/compat/linux/arch/amd64/syscalls.master:1.52 src/sys/compat/linux/arch/amd64/syscalls.master:1.52.2.1
--- src/sys/compat/linux/arch/amd64/syscalls.master:1.52	Sat May 31 08:51:19 2014
+++ src/sys/compat/linux/arch/amd64/syscalls.master	Mon Apr 17 05:19:09 2017
@@ -1,4 +1,4 @@
-	$NetBSD: syscalls.master,v 1.52 2014/05/31 08:51:19 njoly Exp $
+	$NetBSD: syscalls.master,v 1.52.2.1 2017/04/17 05:19:09 snj Exp $
 
 ;	@(#)syscalls.master	8.1 (Berkeley) 7/19/93
 
@@ -489,7 +489,10 @@
 			linux_umode_t mode); }
 269	STD		{ int|linux_sys||faccessat(int fd, const char *path, \
 			int amode); }
-270	UNIMPL		pselect6
+270	STD		{ int|linux_sys||pselect6(int nfds, fd_set *readfds, \
+			fd_set *writefds, fd_set *exceptfds, \
+			struct linux_timespec *timeout, \
+			linux_sized_sigset_t *ss); }
 271	STD		{ int|linux_sys||ppoll(struct pollfd *fds, int nfds, \
 			struct linux_timespec *timeout, \
 			linux_sigset_t *sigset); }

Index: src/sys/compat/linux/arch/arm/syscalls.master
diff -u src/sys/compat/linux/arch/arm/syscalls.master:1.61 src/sys/compat/linux/arch/arm/syscalls.master:1.61.2.1
--- src/sys/compat/linux/arch/arm/syscalls.master:1.61	Sat May 31 08:51:19 2014
+++ src/sys/compat/linux/arch/arm/syscalls.master	Mon Apr 17 05:19:09 2017
@@ -1,4 +1,4 @@
-	$NetBSD: syscalls.master,v 1.61 2014/05/31 08:51:19 njoly Exp $
+	$NetBSD: syscalls.master,v 1.61.2.1 2017/04/17 05:19:09 snj Exp $
 
 ; Derived from sys/compat/linux/arch/*/syscalls.master
 ; and from Linux 2.4.12 arch/arm/kernel/calls.S
@@ -5

CVS commit: src/sys/rump/dev/lib/libugenhc

2017-04-16 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon Apr 17 05:11:05 UTC 2017

Modified Files:
src/sys/rump/dev/lib/libugenhc: ugenhc.c

Log Message:
Fix order of outputs in rumpuser_open call.

Now ugenhc works again after a four-year hiatus...


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/rump/dev/lib/libugenhc/ugenhc.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/rump/dev/lib/libugenhc/ugenhc.c
diff -u src/sys/rump/dev/lib/libugenhc/ugenhc.c:1.24 src/sys/rump/dev/lib/libugenhc/ugenhc.c:1.25
--- src/sys/rump/dev/lib/libugenhc/ugenhc.c:1.24	Sat Apr 23 10:15:30 2016
+++ src/sys/rump/dev/lib/libugenhc/ugenhc.c	Mon Apr 17 05:11:05 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: ugenhc.c,v 1.24 2016/04/23 10:15:30 skrll Exp $	*/
+/*	$NetBSD: ugenhc.c,v 1.25 2017/04/17 05:11:05 riastradh Exp $	*/
 
 /*
  * Copyright (c) 2009, 2010 Antti Kantee.  All Rights Reserved.
@@ -61,7 +61,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ugenhc.c,v 1.24 2016/04/23 10:15:30 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ugenhc.c,v 1.25 2017/04/17 05:11:05 riastradh Exp $");
 
 #include 
 #include 
@@ -489,7 +489,7 @@ rhscintr(void *arg)
 		 */
 
 		for (;;) {
-			fd = rumpuser_open(buf, RUMPUSER_OPEN_RDWR, &error);
+			error = rumpuser_open(buf, RUMPUSER_OPEN_RDWR, &fd);
 			if (fd == -1)
 break;
 



CVS commit: src/tests/crypto/opencrypto

2017-04-16 Thread Kengo NAKAHARA
Module Name:src
Committed By:   knakahara
Date:   Mon Apr 17 03:59:37 UTC 2017

Modified Files:
src/tests/crypto/opencrypto: Makefile t_opencrypto.sh
Added Files:
src/tests/crypto/opencrypto: h_aescbc.c h_cbc3des.c

Log Message:
add opencrypto atf for CRYPTO_3DES_CBC and 
CRYPTO_AES_CBC(=CRYPTO_RIJNDAEL128_CBC).


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/crypto/opencrypto/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/crypto/opencrypto/h_aescbc.c \
src/tests/crypto/opencrypto/h_cbc3des.c
cvs rdiff -u -r1.6 -r1.7 src/tests/crypto/opencrypto/t_opencrypto.sh

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

Modified files:

Index: src/tests/crypto/opencrypto/Makefile
diff -u src/tests/crypto/opencrypto/Makefile:1.2 src/tests/crypto/opencrypto/Makefile:1.3
--- src/tests/crypto/opencrypto/Makefile:1.2	Fri Jan 17 22:33:02 2014
+++ src/tests/crypto/opencrypto/Makefile	Mon Apr 17 03:59:37 2017
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.2 2014/01/17 22:33:02 pgoyette Exp $
+# $NetBSD: Makefile,v 1.3 2017/04/17 03:59:37 knakahara Exp $
 
 .include 
 
@@ -9,11 +9,13 @@ TESTS_SH+=	t_opencrypto
 BINDIR=		${TESTSDIR}
 MKMAN=		no
 
+PROGS+=		h_aescbc
 PROGS+=		h_aesctr1
 PROGS+=		h_aesctr2
 PROGS+=		h_arc4
 PROGS+=		h_camellia
 PROGS+=		h_cbcdes
+PROGS+=		h_cbc3des
 PROGS+=		h_comp
 PROGS+=		h_comp_zlib
 PROGS+=		h_comp_zlib_rnd

Index: src/tests/crypto/opencrypto/t_opencrypto.sh
diff -u src/tests/crypto/opencrypto/t_opencrypto.sh:1.6 src/tests/crypto/opencrypto/t_opencrypto.sh:1.7
--- src/tests/crypto/opencrypto/t_opencrypto.sh:1.6	Sat Dec 26 07:10:03 2015
+++ src/tests/crypto/opencrypto/t_opencrypto.sh	Mon Apr 17 03:59:37 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: t_opencrypto.sh,v 1.6 2015/12/26 07:10:03 pgoyette Exp $
+#	$NetBSD: t_opencrypto.sh,v 1.7 2017/04/17 03:59:37 knakahara Exp $
 #
 # Copyright (c) 2014 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -113,6 +113,19 @@ cbcdes_cleanup() {
 	common_cleanup
 }
 
+atf_test_case cbc3des cleanup
+cbc3des_head() {
+	common_head "Test 3DES_CBC crypto"
+}
+
+cbc3des_body() {
+	common_body h_cbc3des
+}
+
+cbc3des_cleanup() {
+	common_cleanup
+}
+
 atf_test_case comp cleanup
 comp_head() {
 	common_head "Test GZIP_COMP Compression"
@@ -178,6 +191,19 @@ aesctr2_cleanup() {
 	common_cleanup
 }
 
+atf_test_case aescbc cleanup
+aescbc_head() {
+	common_head "Test AES_CBC crypto"
+}
+
+aescbc_body() {
+	common_body h_aescbc
+}
+
+aescbc_cleanup() {
+	common_cleanup
+}
+
 atf_test_case gcm cleanup
 gcm_head() {
 	common_head "Test AES_GCM_16 crypto"
@@ -262,11 +288,13 @@ atf_init_test_cases() {
 	atf_add_test_case arc4
 	atf_add_test_case camellia
 	atf_add_test_case cbcdes
+	atf_add_test_case cbc3des
 	atf_add_test_case comp
 	atf_add_test_case comp_deflate
 	atf_add_test_case comp_zlib_rnd
 	atf_add_test_case aesctr1
 	atf_add_test_case aesctr2
+	atf_add_test_case aescbc
 	atf_add_test_case gcm
 	atf_add_test_case md5
 	atf_add_test_case md5_hmac

Added files:

Index: src/tests/crypto/opencrypto/h_aescbc.c
diff -u /dev/null src/tests/crypto/opencrypto/h_aescbc.c:1.1
--- /dev/null	Mon Apr 17 03:59:37 2017
+++ src/tests/crypto/opencrypto/h_aescbc.c	Mon Apr 17 03:59:37 2017
@@ -0,0 +1,163 @@
+/* $NetBSD: h_aescbc.c,v 1.1 2017/04/17 03:59:37 knakahara Exp $ */
+
+/*-
+ * Copyright (c) 2017 Internet Initiative Japan Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+#include 
+
+/*
+ * Test vectors from RFC 3602
+ */
+
+const struct {
+	size_t len;
+	size_t key_len;
+	unsigned char key[16];
+	unsig

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

2017-04-16 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Apr 17 00:43:42 UTC 2017

Modified Files:
src/sys/arch/arm/nvidia: soc_tegra124.c

Log Message:
Set cpu_cc_freq when changing frequencies.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/arm/nvidia/soc_tegra124.c

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

Modified files:

Index: src/sys/arch/arm/nvidia/soc_tegra124.c
diff -u src/sys/arch/arm/nvidia/soc_tegra124.c:1.14 src/sys/arch/arm/nvidia/soc_tegra124.c:1.15
--- src/sys/arch/arm/nvidia/soc_tegra124.c:1.14	Sun Apr 16 12:26:04 2017
+++ src/sys/arch/arm/nvidia/soc_tegra124.c	Mon Apr 17 00:43:42 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: soc_tegra124.c,v 1.14 2017/04/16 12:26:04 jmcneill Exp $ */
+/* $NetBSD: soc_tegra124.c,v 1.15 2017/04/17 00:43:42 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill 
@@ -30,7 +30,7 @@
 #include "opt_multiprocessor.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: soc_tegra124.c,v 1.14 2017/04/16 12:26:04 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: soc_tegra124.c,v 1.15 2017/04/17 00:43:42 jmcneill Exp $");
 
 #include 
 #include 
@@ -224,6 +224,9 @@ tegra124_cpufreq_set_rate(u_int rate)
 {
 	const u_int nrates = __arraycount(tegra124_cpufreq_rates);
 	const struct tegra124_cpufreq_rate *r = NULL;
+	CPU_INFO_ITERATOR cii;
+	struct cpu_info *ci;
+	int error;
 
 	if (tegra124_speedo_rate_ok(rate) == false)
 		return EINVAL;
@@ -237,7 +240,15 @@ tegra124_cpufreq_set_rate(u_int rate)
 	if (r == NULL)
 		return EINVAL;
 
-	return clk_set_rate(tegra124_clk_pllx, r->rate * 100);
+	error = clk_set_rate(tegra124_clk_pllx, r->rate * 100);
+	if (error == 0) {
+		rate = tegra124_cpufreq_get_rate();
+		for (CPU_INFO_FOREACH(cii, ci)) {
+			ci->ci_data.cpu_cc_freq = rate * 100;
+		}
+	}
+
+	return error;
 }
 
 static u_int



CVS commit: src/usr.bin/vndcompress

2017-04-16 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon Apr 17 00:03:34 UTC 2017

Modified Files:
src/usr.bin/vndcompress: vnduncompress.c

Log Message:
Omit needless XXX comment.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/usr.bin/vndcompress/vnduncompress.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/vndcompress/vnduncompress.c
diff -u src/usr.bin/vndcompress/vnduncompress.c:1.12 src/usr.bin/vndcompress/vnduncompress.c:1.13
--- src/usr.bin/vndcompress/vnduncompress.c:1.12	Sun Apr 16 23:50:40 2017
+++ src/usr.bin/vndcompress/vnduncompress.c	Mon Apr 17 00:03:33 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: vnduncompress.c,v 1.12 2017/04/16 23:50:40 riastradh Exp $	*/
+/*	$NetBSD: vnduncompress.c,v 1.13 2017/04/17 00:03:33 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: vnduncompress.c,v 1.12 2017/04/16 23:50:40 riastradh Exp $");
+__RCSID("$NetBSD: vnduncompress.c,v 1.13 2017/04/17 00:03:33 riastradh Exp $");
 
 #include 
 
@@ -70,7 +70,6 @@ vnduncompress(int argc, char **argv, con
 		err(1, "open(%s)", cloop2_pathname);
 
 	const int image_fd = open(image_pathname,
-	/* XXX O_EXCL, not O_TRUNC */
 	(O_WRONLY | O_CREAT | O_TRUNC), 0777);
 	if (image_fd == -1)
 		err(1, "open(%s)", image_pathname);



CVS commit: src/usr.bin/vndcompress

2017-04-16 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon Apr 17 00:02:45 UTC 2017

Modified Files:
src/usr.bin/vndcompress: vndcompress.c

Log Message:
Omit needless XXX comment.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/usr.bin/vndcompress/vndcompress.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/vndcompress/vndcompress.c
diff -u src/usr.bin/vndcompress/vndcompress.c:1.27 src/usr.bin/vndcompress/vndcompress.c:1.28
--- src/usr.bin/vndcompress/vndcompress.c:1.27	Sun Apr 16 23:50:40 2017
+++ src/usr.bin/vndcompress/vndcompress.c	Mon Apr 17 00:02:45 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: vndcompress.c,v 1.27 2017/04/16 23:50:40 riastradh Exp $	*/
+/*	$NetBSD: vndcompress.c,v 1.28 2017/04/17 00:02:45 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: vndcompress.c,v 1.27 2017/04/16 23:50:40 riastradh Exp $");
+__RCSID("$NetBSD: vndcompress.c,v 1.28 2017/04/17 00:02:45 riastradh Exp $");
 
 #include 
 #include 
@@ -438,7 +438,7 @@ compress_init(int argc, char **argv, con
 
 	int oflags;
 	if (!ISSET(O->flags, FLAG_r))
-		oflags = (O_WRONLY | O_TRUNC | O_CREAT); /* XXX O_EXCL?  */
+		oflags = (O_WRONLY | O_TRUNC | O_CREAT);
 	else if (!ISSET(O->flags, FLAG_R))
 		oflags = (O_RDWR | O_CREAT);
 	else



CVS commit: src/usr.bin/vndcompress

2017-04-16 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Apr 16 23:50:40 UTC 2017

Modified Files:
src/usr.bin/vndcompress: offtab.c offtab.h vndcompress.c
vnduncompress.c

Log Message:
Justify the last unjustified assertion here.

Sprinkle a few more assertions to help along the way.

(Actually, it was justified; I just hadn't made explicit the relation
to the value of fdpos that all two callers specify.)


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/usr.bin/vndcompress/offtab.c
cvs rdiff -u -r1.2 -r1.3 src/usr.bin/vndcompress/offtab.h
cvs rdiff -u -r1.26 -r1.27 src/usr.bin/vndcompress/vndcompress.c
cvs rdiff -u -r1.11 -r1.12 src/usr.bin/vndcompress/vnduncompress.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/vndcompress/offtab.c
diff -u src/usr.bin/vndcompress/offtab.c:1.13 src/usr.bin/vndcompress/offtab.c:1.14
--- src/usr.bin/vndcompress/offtab.c:1.13	Sat Jan 25 16:38:15 2014
+++ src/usr.bin/vndcompress/offtab.c	Sun Apr 16 23:50:40 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: offtab.c,v 1.13 2014/01/25 16:38:15 riastradh Exp $	*/
+/*	$NetBSD: offtab.c,v 1.14 2017/04/16 23:50:40 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: offtab.c,v 1.13 2014/01/25 16:38:15 riastradh Exp $");
+__RCSID("$NetBSD: offtab.c,v 1.14 2017/04/16 23:50:40 riastradh Exp $");
 
 #include 
 #include 
@@ -103,7 +103,9 @@ offtab_compute_window_position(struct of
 	const off_t window_offset = ((off_t)window_start *
 	(off_t)sizeof(uint64_t));
 
-	/* XXX This assertion is not justified.  */
+	assert(offtab->ot_fdpos <= OFFTAB_MAX_FDPOS);
+	__CTASSERT(OFFTAB_MAX_FDPOS <=
+	(OFF_MAX - (off_t)MAX_N_OFFSETS*sizeof(uint64_t)));
 	assert(offtab->ot_fdpos <= (OFF_MAX - window_offset));
 	*pos = (offtab->ot_fdpos + window_offset);
 }
@@ -209,6 +211,7 @@ offtab_init(struct offtab *offtab, uint3
 	assert(0 < n_offsets);
 	assert(0 <= fd);
 	assert(0 <= fdpos);
+	assert(fdpos <= OFFTAB_MAX_FDPOS);
 
 	offtab->ot_n_offsets = n_offsets;
 	if ((window_size == 0) || (n_offsets < window_size))
@@ -293,6 +296,9 @@ offtab_reset_read(struct offtab *offtab,
 		__CTASSERT(MAX_N_OFFSETS <= (OFF_MAX / sizeof(uint64_t)));
 		const off_t offtab_bytes = ((off_t)offtab->ot_n_offsets *
 		(off_t)sizeof(uint64_t));
+		assert(offtab->ot_fdpos <= OFFTAB_MAX_FDPOS);
+		__CTASSERT(OFFTAB_MAX_FDPOS <=
+		(OFF_MAX - (off_t)MAX_N_OFFSETS*sizeof(uint64_t)));
 		assert(offtab->ot_fdpos <= (OFF_MAX - offtab_bytes));
 		const off_t first_offset = (offtab->ot_fdpos + offtab_bytes);
 		if (lseek(offtab->ot_fd, first_offset, SEEK_SET) == -1) {
@@ -367,9 +373,11 @@ offtab_reset_write(struct offtab *offtab
 	__CTASSERT(MAX_N_OFFSETS <= UINT32_MAX);
 	assert(offtab->ot_n_offsets > 0);
 
+	/* Initialize window of all ones.  */
 	for (i = 0; i < offtab->ot_window_size; i++)
 		offtab->ot_window[i] = ~(uint64_t)0;
 
+	/* Write the window to every position in the table.  */
 	const uint32_t n_windows =
 	howmany(offtab->ot_n_offsets, offtab->ot_window_size);
 	for (i = 1; i < n_windows; i++) {
@@ -378,15 +386,25 @@ offtab_reset_write(struct offtab *offtab
 		offtab_write_window(offtab);
 	}
 
-	offtab->ot_window_start = 0;
-	__CTASSERT(MAX_N_OFFSETS <=
-	(MIN(OFF_MAX, UINT64_MAX) / sizeof(uint64_t)));
+	/* Compute the number of bytes in the offset table.  */
+	__CTASSERT(MAX_N_OFFSETS <= OFF_MAX/sizeof(uint64_t));
 	const off_t offtab_bytes = ((off_t)offtab->ot_n_offsets *
 	sizeof(uint64_t));
-	assert(offtab->ot_fdpos <=
-	((off_t)MIN(OFF_MAX, UINT64_MAX) - offtab_bytes));
+
+	/* Compute the offset of the first block.  */
+	assert(offtab->ot_fdpos <= OFFTAB_MAX_FDPOS);
+	__CTASSERT(OFFTAB_MAX_FDPOS <=
+	(OFF_MAX - (off_t)MAX_N_OFFSETS*sizeof(uint64_t)));
+	assert(offtab->ot_fdpos <= (OFF_MAX - offtab_bytes));
 	const off_t first_offset = (offtab->ot_fdpos + offtab_bytes);
-	assert(first_offset <= (off_t)MIN(OFF_MAX, UINT64_MAX));
+
+	/* Assert that it fits in 64 bits.  */
+	__CTASSERT(MAX_N_OFFSETS <= UINT64_MAX/sizeof(uint64_t));
+	__CTASSERT(OFFTAB_MAX_FDPOS <=
+	(UINT64_MAX - (uint64_t)MAX_N_OFFSETS*sizeof(uint64_t)));
+
+	/* Write out the first window with the first offset.  */
+	offtab->ot_window_start = 0;
 	offtab->ot_window[0] = htobe64((uint64_t)first_offset);
 	offtab_write_window(offtab);
 

Index: src/usr.bin/vndcompress/offtab.h
diff -u src/usr.bin/vndcompress/offtab.h:1.2 src/usr.bin/vndcompress/offtab.h:1.3
--- src/usr.bin/vndcompress/offtab.h:1.2	Wed Jan 22 06:15:22 2014
+++ src/usr.bin/vndcompress/offtab.h	Sun Apr 16 23:50:40 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: offtab.h,v 1.2 2014/01/22 06:15:22 riastradh Exp $	*/
+/*	$NetBSD: offtab.h,v 1.3 2017/04/16 23:50:40 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -37,6 +37,8 @@
 #include 
 #include 
 
+#include "common.h"
+
 s

CVS commit: src/usr.bin/vndcompress

2017-04-16 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Apr 16 23:43:57 UTC 2017

Modified Files:
src/usr.bin/vndcompress: common.h

Log Message:
Emphasize that MAX_WINDOW_SIZE is bounded by the maximum uint32_t.

Since we store window sizes in uint32_t, the maximum had better fit
in uint32_t!


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/usr.bin/vndcompress/common.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/vndcompress/common.h
diff -u src/usr.bin/vndcompress/common.h:1.6 src/usr.bin/vndcompress/common.h:1.7
--- src/usr.bin/vndcompress/common.h:1.6	Wed Jan 22 06:18:00 2014
+++ src/usr.bin/vndcompress/common.h	Sun Apr 16 23:43:57 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: common.h,v 1.6 2014/01/22 06:18:00 riastradh Exp $	*/
+/*	$NetBSD: common.h,v 1.7 2017/04/16 23:43:57 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -111,13 +111,13 @@
 #define	MAX_N_OFFSETS		(MAX_N_BLOCKS + 1)
 
 /*
- * The window size is at most the number of offsets, so it has the same
- * maximum bound.  The default window size is chosen so that windows
+ * The window size is at most the number of offsets, or the largest
+ * uint32_t value.  The default window size is chosen so that windows
  * fit in one 4096-byte page of memory.  We could use 64k bytes, or
  * st_blksize, to maximize I/O transfer size, but the transfers won't
  * be aligned without a lot of extra work.
  */
-#define	MAX_WINDOW_SIZE		MAX_N_OFFSETS
+#define	MAX_WINDOW_SIZE		MIN(UINT32_MAX, MAX_N_OFFSETS)
 #define	DEF_WINDOW_SIZE		512
 
 struct cloop2_header {



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

2017-04-16 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Apr 16 22:38:04 UTC 2017

Modified Files:
src/sys/arch/arm/nvidia: tegra_pcie.c

Log Message:
Fix previous; pci_intr_setattr takes a pci_intr_handle_t not the driver's
opaque handle.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/arm/nvidia/tegra_pcie.c

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

Modified files:

Index: src/sys/arch/arm/nvidia/tegra_pcie.c
diff -u src/sys/arch/arm/nvidia/tegra_pcie.c:1.16 src/sys/arch/arm/nvidia/tegra_pcie.c:1.17
--- src/sys/arch/arm/nvidia/tegra_pcie.c:1.16	Sun Apr 16 18:05:35 2017
+++ src/sys/arch/arm/nvidia/tegra_pcie.c	Sun Apr 16 22:38:04 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: tegra_pcie.c,v 1.16 2017/04/16 18:05:35 jmcneill Exp $ */
+/* $NetBSD: tegra_pcie.c,v 1.17 2017/04/16 22:38:04 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: tegra_pcie.c,v 1.16 2017/04/16 18:05:35 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tegra_pcie.c,v 1.17 2017/04/16 22:38:04 jmcneill Exp $");
 
 #include 
 #include 
@@ -52,6 +52,9 @@ __KERNEL_RCSID(0, "$NetBSD: tegra_pcie.c
 
 #include 
 
+/* Interrupt handle flags */
+#define	IH_MPSAFE	0x8000
+
 static int	tegra_pcie_match(device_t, cfdata_t, void *);
 static void	tegra_pcie_attach(device_t, device_t, void *);
 
@@ -591,11 +594,12 @@ tegra_pcie_intr_evcnt(void *v, pci_intr_
 static int
 tegra_pcie_intr_setattr(void *v, pci_intr_handle_t *ih, int attr, uint64_t data)
 {
-	struct tegra_pcie_ih *pcie_ih = (struct tegra_pcie_ih *)*ih;
-
 	switch (attr) {
 	case PCI_INTR_MPSAFE:
-		pcie_ih->ih_mpsafe = data;
+		if (data)
+			*ih |= IH_MPSAFE;
+		else
+			*ih &= ~IH_MPSAFE;
 		return 0;
 	default:
 		return ENODEV;
@@ -616,7 +620,7 @@ tegra_pcie_intr_establish(void *v, pci_i
 	pcie_ih->ih_callback = callback;
 	pcie_ih->ih_arg = arg;
 	pcie_ih->ih_ipl = ipl;
-	pcie_ih->ih_mpsafe = 0;
+	pcie_ih->ih_mpsafe = (ih & IH_MPSAFE) != 0;
 
 	mutex_enter(&sc->sc_lock);
 	TAILQ_INSERT_TAIL(&sc->sc_intrs, pcie_ih, ih_entry);



CVS commit: src/usr.bin/make

2017-04-16 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Apr 16 21:39:49 UTC 2017

Modified Files:
src/usr.bin/make: var.c

Log Message:
Plug memory leak.

CID 978372


To generate a diff of this commit:
cvs rdiff -u -r1.214 -r1.215 src/usr.bin/make/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/usr.bin/make/var.c
diff -u src/usr.bin/make/var.c:1.214 src/usr.bin/make/var.c:1.215
--- src/usr.bin/make/var.c:1.214	Sun Apr 16 19:53:58 2017
+++ src/usr.bin/make/var.c	Sun Apr 16 21:39:49 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: var.c,v 1.214 2017/04/16 19:53:58 riastradh Exp $	*/
+/*	$NetBSD: var.c,v 1.215 2017/04/16 21:39:49 riastradh Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: var.c,v 1.214 2017/04/16 19:53:58 riastradh Exp $";
+static char rcsid[] = "$NetBSD: var.c,v 1.215 2017/04/16 21:39:49 riastradh Exp $";
 #else
 #include 
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)var.c	8.3 (Berkeley) 3/19/94";
 #else
-__RCSID("$NetBSD: var.c,v 1.214 2017/04/16 19:53:58 riastradh Exp $");
+__RCSID("$NetBSD: var.c,v 1.215 2017/04/16 21:39:49 riastradh Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -1837,8 +1837,8 @@ VarLoopExpand(GNode *ctx MAKE_ATTR_UNUSE
 Buf_AddByte(buf, ' ');
 Buf_AddBytes(buf, (slen = strlen(s)), s);
 addSpace = (slen > 0 && s[slen - 1] != '\n');
-free(s);
 }
+	free(s);
 }
 return addSpace;
 }



CVS commit: src/usr.bin/make

2017-04-16 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Apr 16 21:38:38 UTC 2017

Modified Files:
src/usr.bin/make: parse.c

Log Message:
Plug memory leak in ParseTraditionalInclude.


To generate a diff of this commit:
cvs rdiff -u -r1.223 -r1.224 src/usr.bin/make/parse.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/make/parse.c
diff -u src/usr.bin/make/parse.c:1.223 src/usr.bin/make/parse.c:1.224
--- src/usr.bin/make/parse.c:1.223	Sun Apr 16 21:37:37 2017
+++ src/usr.bin/make/parse.c	Sun Apr 16 21:38:38 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: parse.c,v 1.223 2017/04/16 21:37:37 riastradh Exp $	*/
+/*	$NetBSD: parse.c,v 1.224 2017/04/16 21:38:38 riastradh Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: parse.c,v 1.223 2017/04/16 21:37:37 riastradh Exp $";
+static char rcsid[] = "$NetBSD: parse.c,v 1.224 2017/04/16 21:38:38 riastradh Exp $";
 #else
 #include 
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)parse.c	8.3 (Berkeley) 3/19/94";
 #else
-__RCSID("$NetBSD: parse.c,v 1.223 2017/04/16 21:37:37 riastradh Exp $");
+__RCSID("$NetBSD: parse.c,v 1.224 2017/04/16 21:38:38 riastradh Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -2546,7 +2546,7 @@ ParseTraditionalInclude(char *line)
 if (*file == '\0') {
 	Parse_Error(PARSE_FATAL,
 		 "Filename missing from \"include\"");
-	return;
+	goto out;
 }
 
 for (file = all_files; !done; file = cp + 1) {
@@ -2561,6 +2561,7 @@ ParseTraditionalInclude(char *line)
 
 	Parse_include_file(file, FALSE, FALSE, silent);
 }
+out:
 free(all_files);
 }
 #endif



CVS commit: src/usr.bin/make

2017-04-16 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Apr 16 21:37:37 UTC 2017

Modified Files:
src/usr.bin/make: parse.c

Log Message:
Plug memory leak.

CID 978370


To generate a diff of this commit:
cvs rdiff -u -r1.222 -r1.223 src/usr.bin/make/parse.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/make/parse.c
diff -u src/usr.bin/make/parse.c:1.222 src/usr.bin/make/parse.c:1.223
--- src/usr.bin/make/parse.c:1.222	Sun Apr 16 21:35:08 2017
+++ src/usr.bin/make/parse.c	Sun Apr 16 21:37:37 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: parse.c,v 1.222 2017/04/16 21:35:08 riastradh Exp $	*/
+/*	$NetBSD: parse.c,v 1.223 2017/04/16 21:37:37 riastradh Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: parse.c,v 1.222 2017/04/16 21:35:08 riastradh Exp $";
+static char rcsid[] = "$NetBSD: parse.c,v 1.223 2017/04/16 21:37:37 riastradh Exp $";
 #else
 #include 
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)parse.c	8.3 (Berkeley) 3/19/94";
 #else
-__RCSID("$NetBSD: parse.c,v 1.222 2017/04/16 21:35:08 riastradh Exp $");
+__RCSID("$NetBSD: parse.c,v 1.223 2017/04/16 21:37:37 riastradh Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -2611,6 +2611,7 @@ ParseGmakeExport(char *line)
  */
 value = Var_Subst(NULL, value, VAR_CMD, VARF_WANTRES);
 setenv(variable, value, 1);
+free(value);
 }
 #endif
 



CVS commit: src/usr.bin/make

2017-04-16 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Apr 16 21:35:08 UTC 2017

Modified Files:
src/usr.bin/make: parse.c

Log Message:
Make it clearer that this is not a memory leak.

CID 978369


To generate a diff of this commit:
cvs rdiff -u -r1.221 -r1.222 src/usr.bin/make/parse.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/make/parse.c
diff -u src/usr.bin/make/parse.c:1.221 src/usr.bin/make/parse.c:1.222
--- src/usr.bin/make/parse.c:1.221	Sun Apr 16 21:03:13 2017
+++ src/usr.bin/make/parse.c	Sun Apr 16 21:35:08 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: parse.c,v 1.221 2017/04/16 21:03:13 riastradh Exp $	*/
+/*	$NetBSD: parse.c,v 1.222 2017/04/16 21:35:08 riastradh Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: parse.c,v 1.221 2017/04/16 21:03:13 riastradh Exp $";
+static char rcsid[] = "$NetBSD: parse.c,v 1.222 2017/04/16 21:35:08 riastradh Exp $";
 #else
 #include 
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)parse.c	8.3 (Berkeley) 3/19/94";
 #else
-__RCSID("$NetBSD: parse.c,v 1.221 2017/04/16 21:03:13 riastradh Exp $");
+__RCSID("$NetBSD: parse.c,v 1.222 2017/04/16 21:35:08 riastradh Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -1678,10 +1678,12 @@ ParseDoDependency(char *line)
 	}
 	if (paths) {
 	Lst_Destroy(paths, NULL);
+	paths = NULL;
 	}
 	if (specType == ExPath)
 	Dir_SetPATH();
 } else {
+	assert(paths == NULL);
 	while (*line) {
 	/*
 	 * The targets take real sources, so we must beware of archive
@@ -1740,6 +1742,7 @@ ParseDoDependency(char *line)
 }
 
 out:
+assert(paths == NULL);
 if (curTargs)
 	Lst_Destroy(curTargs, NULL);
 }



CVS commit: src/usr.bin/make

2017-04-16 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Apr 16 21:23:43 UTC 2017

Modified Files:
src/usr.bin/make: job.c

Log Message:
Plug memory leak in JobPrintCommand.

CID 978366


To generate a diff of this commit:
cvs rdiff -u -r1.189 -r1.190 src/usr.bin/make/job.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/make/job.c
diff -u src/usr.bin/make/job.c:1.189 src/usr.bin/make/job.c:1.190
--- src/usr.bin/make/job.c:1.189	Sun Apr 16 20:57:14 2017
+++ src/usr.bin/make/job.c	Sun Apr 16 21:23:43 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: job.c,v 1.189 2017/04/16 20:57:14 riastradh Exp $	*/
+/*	$NetBSD: job.c,v 1.190 2017/04/16 21:23:43 riastradh Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -70,14 +70,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: job.c,v 1.189 2017/04/16 20:57:14 riastradh Exp $";
+static char rcsid[] = "$NetBSD: job.c,v 1.190 2017/04/16 21:23:43 riastradh Exp $";
 #else
 #include 
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)job.c	8.2 (Berkeley) 3/19/94";
 #else
-__RCSID("$NetBSD: job.c,v 1.189 2017/04/16 20:57:14 riastradh Exp $");
+__RCSID("$NetBSD: job.c,v 1.190 2017/04/16 21:23:43 riastradh Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -744,6 +744,7 @@ JobPrintCommand(void *cmdp, void *jobp)
 		 * but this one needs to be - use compat mode just for it.
 		 */
 		CompatRunCommand(cmdp, job->node);
+		free(cmdStart);
 		return 0;
 	}
 	break;



CVS commit: src/usr.bin/make

2017-04-16 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Apr 16 21:14:47 UTC 2017

Modified Files:
src/usr.bin/make: dir.c

Log Message:
Plug memory leaks in Dir_FindFile.

CID 978364


To generate a diff of this commit:
cvs rdiff -u -r1.70 -r1.71 src/usr.bin/make/dir.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/make/dir.c
diff -u src/usr.bin/make/dir.c:1.70 src/usr.bin/make/dir.c:1.71
--- src/usr.bin/make/dir.c:1.70	Sun Apr 16 19:53:58 2017
+++ src/usr.bin/make/dir.c	Sun Apr 16 21:14:47 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: dir.c,v 1.70 2017/04/16 19:53:58 riastradh Exp $	*/
+/*	$NetBSD: dir.c,v 1.71 2017/04/16 21:14:47 riastradh Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -70,14 +70,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: dir.c,v 1.70 2017/04/16 19:53:58 riastradh Exp $";
+static char rcsid[] = "$NetBSD: dir.c,v 1.71 2017/04/16 21:14:47 riastradh Exp $";
 #else
 #include 
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)dir.c	8.2 (Berkeley) 1/2/94";
 #else
-__RCSID("$NetBSD: dir.c,v 1.70 2017/04/16 19:53:58 riastradh Exp $");
+__RCSID("$NetBSD: dir.c,v 1.71 2017/04/16 21:14:47 riastradh Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -1315,8 +1315,14 @@ Dir_FindFile(const char *name, Lst path)
 	fprintf(debug_file, "   Trying exact path matches...\n");
 	}
 
-	if (!hasLastDot && cur && (file = DirLookupAbs(cur, name, cp)) != NULL)
-	return *file?file:NULL;
+	if (!hasLastDot && cur && ((file = DirLookupAbs(cur, name, cp))
+		!= NULL)) {
+	if (file[0] == '\0') {
+		free(file);
+		return NULL;
+	}
+	return file;
+	}
 
 	(void)Lst_Open(path);
 	while ((ln = Lst_Next(path)) != NULL) {
@@ -1325,13 +1331,23 @@ Dir_FindFile(const char *name, Lst path)
 		continue;
 	if ((file = DirLookupAbs(p, name, cp)) != NULL) {
 		Lst_Close(path);
-		return *file?file:NULL;
+		if (file[0] == '\0') {
+		free(file);
+		return NULL;
+		}
+		return file;
 	}
 	}
 	Lst_Close(path);
 
-	if (hasLastDot && cur && (file = DirLookupAbs(cur, name, cp)) != NULL)
-	return *file?file:NULL;
+	if (hasLastDot && cur && ((file = DirLookupAbs(cur, name, cp))
+		!= NULL)) {
+	if (file[0] == '\0') {
+		free(file);
+		return NULL;
+	}
+	return file;
+	}
 }
 
 /*



CVS commit: src/usr.bin/make

2017-04-16 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Apr 16 21:04:44 UTC 2017

Modified Files:
src/usr.bin/make: for.c

Log Message:
Clarify that assignment is for effect, not truth of value.

CID 977502


To generate a diff of this commit:
cvs rdiff -u -r1.52 -r1.53 src/usr.bin/make/for.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/make/for.c
diff -u src/usr.bin/make/for.c:1.52 src/usr.bin/make/for.c:1.53
--- src/usr.bin/make/for.c:1.52	Thu Feb 18 18:29:14 2016
+++ src/usr.bin/make/for.c	Sun Apr 16 21:04:44 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: for.c,v 1.52 2016/02/18 18:29:14 christos Exp $	*/
+/*	$NetBSD: for.c,v 1.53 2017/04/16 21:04:44 riastradh Exp $	*/
 
 /*
  * Copyright (c) 1992, The Regents of the University of California.
@@ -30,14 +30,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: for.c,v 1.52 2016/02/18 18:29:14 christos Exp $";
+static char rcsid[] = "$NetBSD: for.c,v 1.53 2017/04/16 21:04:44 riastradh Exp $";
 #else
 #include 
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)for.c	8.1 (Berkeley) 6/6/93";
 #else
-__RCSID("$NetBSD: for.c,v 1.52 2016/02/18 18:29:14 christos Exp $");
+__RCSID("$NetBSD: for.c,v 1.53 2017/04/16 21:04:44 riastradh Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -427,7 +427,7 @@ For_Iterate(void *v_arg, size_t *ret_len
 for (cp = cmd_cp; (cp = strchr(cp, '$')) != NULL;) {
 	char ech;
 	ch = *++cp;
-	if ((ch == '(' && (ech = ')')) || (ch == '{' && (ech = '}'))) {
+	if ((ch == '(' && (ech = ')', 1)) || (ch == '{' && (ech = '}', 1))) {
 	cp++;
 	/* Check variable name against the .for loop variables */
 	STRLIST_FOREACH(var, &arg->vars, i) {



CVS commit: src/usr.bin/make

2017-04-16 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Apr 16 21:03:13 UTC 2017

Modified Files:
src/usr.bin/make: parse.c

Log Message:
Guarantee no arithmetic overflow.


To generate a diff of this commit:
cvs rdiff -u -r1.220 -r1.221 src/usr.bin/make/parse.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/make/parse.c
diff -u src/usr.bin/make/parse.c:1.220 src/usr.bin/make/parse.c:1.221
--- src/usr.bin/make/parse.c:1.220	Sun Apr 16 20:00:58 2017
+++ src/usr.bin/make/parse.c	Sun Apr 16 21:03:13 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: parse.c,v 1.220 2017/04/16 20:00:58 maya Exp $	*/
+/*	$NetBSD: parse.c,v 1.221 2017/04/16 21:03:13 riastradh Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: parse.c,v 1.220 2017/04/16 20:00:58 maya Exp $";
+static char rcsid[] = "$NetBSD: parse.c,v 1.221 2017/04/16 21:03:13 riastradh Exp $";
 #else
 #include 
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)parse.c	8.3 (Berkeley) 3/19/94";
 #else
-__RCSID("$NetBSD: parse.c,v 1.220 2017/04/16 20:00:58 maya Exp $");
+__RCSID("$NetBSD: parse.c,v 1.221 2017/04/16 21:03:13 riastradh Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -129,6 +129,7 @@ __RCSID("$NetBSD: parse.c,v 1.220 2017/0
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -548,9 +549,15 @@ loadfile(const char *path, int fd)
 	while (1) {
 		assert(bufpos <= lf->len);
 		if (bufpos == lf->len) {
+			if (lf->len > SIZE_MAX/2) {
+errno = EFBIG;
+Error("%s: file too large", path);
+exit(1);
+			}
 			lf->len *= 2;
 			lf->buf = bmake_realloc(lf->buf, lf->len);
 		}
+		assert(bufpos < lf->len);
 		result = read(fd, lf->buf + bufpos, lf->len - bufpos);
 		if (result < 0) {
 			Error("%s: read error: %s", path, strerror(errno));



CVS commit: src/usr.bin/make

2017-04-16 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Apr 16 20:59:04 UTC 2017

Modified Files:
src/usr.bin/make: cond.c

Log Message:
Replace dead conditional by assert.

CID 975995


To generate a diff of this commit:
cvs rdiff -u -r1.74 -r1.75 src/usr.bin/make/cond.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/make/cond.c
diff -u src/usr.bin/make/cond.c:1.74 src/usr.bin/make/cond.c:1.75
--- src/usr.bin/make/cond.c:1.74	Thu Feb 18 18:29:14 2016
+++ src/usr.bin/make/cond.c	Sun Apr 16 20:59:04 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: cond.c,v 1.74 2016/02/18 18:29:14 christos Exp $	*/
+/*	$NetBSD: cond.c,v 1.75 2017/04/16 20:59:04 riastradh Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -70,14 +70,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: cond.c,v 1.74 2016/02/18 18:29:14 christos Exp $";
+static char rcsid[] = "$NetBSD: cond.c,v 1.75 2017/04/16 20:59:04 riastradh Exp $";
 #else
 #include 
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)cond.c	8.2 (Berkeley) 1/2/94";
 #else
-__RCSID("$NetBSD: cond.c,v 1.74 2016/02/18 18:29:14 christos Exp $");
+__RCSID("$NetBSD: cond.c,v 1.75 2017/04/16 20:59:04 riastradh Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -91,6 +91,7 @@ __RCSID("$NetBSD: cond.c,v 1.74 2016/02/
  *
  */
 
+#include
 #include
 #include/* For strtoul() error checking */
 
@@ -1174,8 +1175,9 @@ Cond_EvalExpression(const struct If *inf
 		break;
 	dflt_info = info;
 }
+assert(info != NULL);
 
-if_info = info != NULL ? info : ifs + 4;
+if_info = info;
 condExpr = line;
 condPushBack = TOK_NONE;
 



CVS commit: src/usr.bin/make

2017-04-16 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Apr 16 20:57:14 UTC 2017

Modified Files:
src/usr.bin/make: job.c

Log Message:
Check fcntl return values out of paranoia.

CID 975277
CID 975278


To generate a diff of this commit:
cvs rdiff -u -r1.188 -r1.189 src/usr.bin/make/job.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/make/job.c
diff -u src/usr.bin/make/job.c:1.188 src/usr.bin/make/job.c:1.189
--- src/usr.bin/make/job.c:1.188	Fri Aug 26 23:28:39 2016
+++ src/usr.bin/make/job.c	Sun Apr 16 20:57:14 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: job.c,v 1.188 2016/08/26 23:28:39 dholland Exp $	*/
+/*	$NetBSD: job.c,v 1.189 2017/04/16 20:57:14 riastradh Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -70,14 +70,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: job.c,v 1.188 2016/08/26 23:28:39 dholland Exp $";
+static char rcsid[] = "$NetBSD: job.c,v 1.189 2017/04/16 20:57:14 riastradh Exp $";
 #else
 #include 
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)job.c	8.2 (Berkeley) 3/19/94";
 #else
-__RCSID("$NetBSD: job.c,v 1.188 2016/08/26 23:28:39 dholland Exp $");
+__RCSID("$NetBSD: job.c,v 1.189 2017/04/16 20:57:14 riastradh Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -411,7 +411,7 @@ static void JobSigUnlock(sigset_t *omask
 static void
 JobCreatePipe(Job *job, int minfd)
 {
-int i, fd;
+int i, fd, flags;
 
 if (pipe(job->jobPipe) == -1)
 	Punt("Cannot create pipe: %s", strerror(errno));
@@ -426,8 +426,10 @@ JobCreatePipe(Job *job, int minfd)
 }
 
 /* Set close-on-exec flag for both */
-(void)fcntl(job->jobPipe[0], F_SETFD, FD_CLOEXEC);
-(void)fcntl(job->jobPipe[1], F_SETFD, FD_CLOEXEC);
+if (fcntl(job->jobPipe[0], F_SETFD, FD_CLOEXEC) == -1)
+	Punt("Cannot set close-on-exec: %s", strerror(errno));
+if (fcntl(job->jobPipe[1], F_SETFD, FD_CLOEXEC) == -1)
+	Punt("Cannot set close-on-exec: %s", strerror(errno));
 
 /*
  * We mark the input side of the pipe non-blocking; we poll(2) the
@@ -435,8 +437,12 @@ JobCreatePipe(Job *job, int minfd)
  * race for the token when a new one becomes available, so the read 
  * from the pipe should not block.
  */
-fcntl(job->jobPipe[0], F_SETFL, 
-	fcntl(job->jobPipe[0], F_GETFL, 0) | O_NONBLOCK);
+flags = fcntl(job->jobPipe[0], F_GETFL, 0);
+if (flags == -1)
+	Punt("Cannot get flags: %s", strerror(errno));
+flags |= O_NONBLOCK;
+if (fcntl(job->jobPipe[0], F_SETFL, flags) == -1)
+	Punt("Cannot set flags: %s", strerror(errno));
 }
 
 /*-
@@ -1365,15 +1371,27 @@ JobExec(Job *job, char **argv)
 	execError("dup2", "job->cmdFILE");
 	_exit(1);
 	}
-	(void)fcntl(0, F_SETFD, 0);
-	(void)lseek(0, (off_t)0, SEEK_SET);
+	if (fcntl(0, F_SETFD, 0) == -1) {
+	execError("fcntl clear close-on-exec", "stdin");
+	_exit(1);
+	}
+	if (lseek(0, (off_t)0, SEEK_SET) == -1) {
+	execError("lseek to 0", "stdin");
+	_exit(1);
+	}
 
 	if (job->node->type & (OP_MAKE | OP_SUBMAKE)) {
 		/*
 		 * Pass job token pipe to submakes.
 		 */
-		fcntl(tokenWaitJob.inPipe, F_SETFD, 0);
-		fcntl(tokenWaitJob.outPipe, F_SETFD, 0);		
+		if (fcntl(tokenWaitJob.inPipe, F_SETFD, 0) == -1) {
+		execError("clear close-on-exec", "tokenWaitJob.inPipe");
+		_exit(1);
+		}
+		if (fcntl(tokenWaitJob.outPipe, F_SETFD, 0) == -1) {
+		execError("clear close-on-exec", "tokenWaitJob.outPipe");
+		_exit(1);
+		}
 	}
 	
 	/*
@@ -1390,7 +1408,10 @@ JobExec(Job *job, char **argv)
 	 * it before routing the shell's error output to the same place as
 	 * its standard output.
 	 */
-	(void)fcntl(1, F_SETFD, 0);
+	if (fcntl(1, F_SETFD, 0) == -1) {
+	execError("clear close-on-exec", "stdout");
+	_exit(1);
+	}
 	if (dup2(1, 2) == -1) {
 	execError("dup2", "1, 2");
 	_exit(1);



CVS commit: src/usr.bin/make

2017-04-16 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Apr 16 20:49:09 UTC 2017

Modified Files:
src/usr.bin/make: arch.c

Log Message:
Check return value of fseek.

CID 975275
CID 975276


To generate a diff of this commit:
cvs rdiff -u -r1.69 -r1.70 src/usr.bin/make/arch.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/make/arch.c
diff -u src/usr.bin/make/arch.c:1.69 src/usr.bin/make/arch.c:1.70
--- src/usr.bin/make/arch.c:1.69	Wed Apr  6 09:57:00 2016
+++ src/usr.bin/make/arch.c	Sun Apr 16 20:49:09 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: arch.c,v 1.69 2016/04/06 09:57:00 gson Exp $	*/
+/*	$NetBSD: arch.c,v 1.70 2017/04/16 20:49:09 riastradh Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: arch.c,v 1.69 2016/04/06 09:57:00 gson Exp $";
+static char rcsid[] = "$NetBSD: arch.c,v 1.70 2017/04/16 20:49:09 riastradh Exp $";
 #else
 #include 
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)arch.c	8.2 (Berkeley) 1/2/94";
 #else
-__RCSID("$NetBSD: arch.c,v 1.69 2016/04/06 09:57:00 gson Exp $");
+__RCSID("$NetBSD: arch.c,v 1.70 2017/04/16 20:49:09 riastradh Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -679,7 +679,8 @@ ArchStatMember(char *archive, char *memb
 		if (fread(memName, elen, 1, arch) != 1)
 			goto badarch;
 		memName[elen] = '\0';
-		fseek(arch, -elen, SEEK_CUR);
+		if (fseek(arch, -elen, SEEK_CUR) != 0)
+			goto badarch;
 		if (DEBUG(ARCH) || DEBUG(MAKE)) {
 		fprintf(debug_file, "ArchStat: Extended format entry for %s\n", memName);
 		}
@@ -690,7 +691,8 @@ ArchStatMember(char *archive, char *memb
 	Hash_SetValue(he, bmake_malloc(sizeof(struct ar_hdr)));
 	memcpy(Hash_GetValue(he), &arh, sizeof(struct ar_hdr));
 	}
-	fseek(arch, (size + 1) & ~1, SEEK_CUR);
+	if (fseek(arch, (size + 1) & ~1, SEEK_CUR) != 0)
+	goto badarch;
 }
 
 fclose(arch);
@@ -909,7 +911,10 @@ ArchFindMember(char *archive, char *memb
 		 * the file at the actual member, rather than its header, but
 		 * not here...
 		 */
-		fseek(arch, -sizeof(struct ar_hdr), SEEK_CUR);
+		if (fseek(arch, -sizeof(struct ar_hdr), SEEK_CUR) != 0) {
+		fclose(arch);
+		return NULL;
+		}
 		return (arch);
 	}
 	} else
@@ -939,10 +944,17 @@ ArchFindMember(char *archive, char *memb
 		}
 		if (strncmp(ename, member, len) == 0) {
 			/* Found as extended name */
-			fseek(arch, -sizeof(struct ar_hdr) - elen, SEEK_CUR);
+			if (fseek(arch, -sizeof(struct ar_hdr) - elen,
+SEEK_CUR) != 0) {
+			fclose(arch);
+			return NULL;
+			}
 			return (arch);
 		}
-		fseek(arch, -elen, SEEK_CUR);
+		if (fseek(arch, -elen, SEEK_CUR) != 0) {
+		fclose(arch);
+		return NULL;
+		}
 		goto skip;
 	} else
 #endif
@@ -957,7 +969,10 @@ skip:
 	 */
 	arhPtr->ar_size[sizeof(arhPtr->ar_size)-1] = '\0';
 	size = (int)strtol(arhPtr->ar_size, NULL, 10);
-	fseek(arch, (size + 1) & ~1, SEEK_CUR);
+	if (fseek(arch, (size + 1) & ~1, SEEK_CUR) != 0) {
+		fclose(arch);
+		return NULL;
+	}
 	}
 }
 



CVS commit: src/usr.bin/make

2017-04-16 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Apr 16 20:38:18 UTC 2017

Modified Files:
src/usr.bin/make: suff.c

Log Message:
Assert archive member syntax.  Cite who guarantees it.


To generate a diff of this commit:
cvs rdiff -u -r1.85 -r1.86 src/usr.bin/make/suff.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/make/suff.c
diff -u src/usr.bin/make/suff.c:1.85 src/usr.bin/make/suff.c:1.86
--- src/usr.bin/make/suff.c:1.85	Sun Apr 16 19:53:58 2017
+++ src/usr.bin/make/suff.c	Sun Apr 16 20:38:18 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: suff.c,v 1.85 2017/04/16 19:53:58 riastradh Exp $	*/
+/*	$NetBSD: suff.c,v 1.86 2017/04/16 20:38:18 riastradh Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: suff.c,v 1.85 2017/04/16 19:53:58 riastradh Exp $";
+static char rcsid[] = "$NetBSD: suff.c,v 1.86 2017/04/16 20:38:18 riastradh Exp $";
 #else
 #include 
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)suff.c	8.4 (Berkeley) 3/21/94";
 #else
-__RCSID("$NetBSD: suff.c,v 1.85 2017/04/16 19:53:58 riastradh Exp $");
+__RCSID("$NetBSD: suff.c,v 1.86 2017/04/16 20:38:18 riastradh Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -135,6 +135,7 @@ __RCSID("$NetBSD: suff.c,v 1.85 2017/04/
  *order to find the node.
  */
 
+#include	  
 #include	  
 #include	  "make.h"
 #include	  "hash.h"
@@ -1906,6 +1907,13 @@ SuffFindArchiveDeps(GNode *gn, Lst slst)
 eoarch = strchr(gn->name, '(');
 eoname = strchr(eoarch, ')');
 
+/*
+ * Caller guarantees the format `libname(member)', via
+ * Arch_ParseArchive.
+ */
+assert(eoarch != NULL);
+assert(eoname != NULL);
+
 *eoname = '\0';	  /* Nuke parentheses during suffix search */
 *eoarch = '\0';	  /* So a suffix can be found */
 



CVS commit: src/usr.bin/make

2017-04-16 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Sun Apr 16 20:20:24 UTC 2017

Modified Files:
src/usr.bin/make: make_malloc.c

Log Message:
nowadays function specifiers go in declaration_specifiers
(not after the declarator)


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/usr.bin/make/make_malloc.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/make/make_malloc.c
diff -u src/usr.bin/make/make_malloc.c:1.10 src/usr.bin/make/make_malloc.c:1.11
--- src/usr.bin/make/make_malloc.c:1.10	Wed Jun 20 17:46:28 2012
+++ src/usr.bin/make/make_malloc.c	Sun Apr 16 20:20:24 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: make_malloc.c,v 1.10 2012/06/20 17:46:28 sjg Exp $	*/
+/*	$NetBSD: make_malloc.c,v 1.11 2017/04/16 20:20:24 dholland Exp $	*/
 
 /*-
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -28,7 +28,7 @@
 
 #ifdef MAKE_NATIVE
 #include 
-__RCSID("$NetBSD: make_malloc.c,v 1.10 2012/06/20 17:46:28 sjg Exp $");
+__RCSID("$NetBSD: make_malloc.c,v 1.11 2017/04/16 20:20:24 dholland Exp $");
 #endif
 
 #include 
@@ -39,13 +39,13 @@ __RCSID("$NetBSD: make_malloc.c,v 1.10 2
 #include "make.h"
 
 #ifndef USE_EMALLOC
-static void enomem(void) MAKE_ATTR_DEAD;
+static MAKE_ATTR_DEAD void enomem(void);
 
 /*
  * enomem --
  *	die when out of memory.
  */
-static void
+static MAKE_ATTR_DEAD void
 enomem(void)
 {
 	(void)fprintf(stderr, "%s: %s.\n", progname, strerror(ENOMEM));



CVS commit: src/usr.bin/make

2017-04-16 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Apr 16 20:14:49 UTC 2017

Modified Files:
src/usr.bin/make: main.c

Log Message:
Factor out parts of cached_realpath.

This wacky API confused Coverity (CID 1405167) and is no good for
human readers either.


To generate a diff of this commit:
cvs rdiff -u -r1.261 -r1.262 src/usr.bin/make/main.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/make/main.c
diff -u src/usr.bin/make/main.c:1.261 src/usr.bin/make/main.c:1.262
--- src/usr.bin/make/main.c:1.261	Sun Apr 16 20:00:58 2017
+++ src/usr.bin/make/main.c	Sun Apr 16 20:14:49 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.261 2017/04/16 20:00:58 maya Exp $	*/
+/*	$NetBSD: main.c,v 1.262 2017/04/16 20:14:49 riastradh Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,7 +69,7 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: main.c,v 1.261 2017/04/16 20:00:58 maya Exp $";
+static char rcsid[] = "$NetBSD: main.c,v 1.262 2017/04/16 20:14:49 riastradh Exp $";
 #else
 #include 
 #ifndef lint
@@ -81,7 +81,7 @@ __COPYRIGHT("@(#) Copyright (c) 1988, 19
 #if 0
 static char sccsid[] = "@(#)main.c	8.3 (Berkeley) 3/19/94";
 #else
-__RCSID("$NetBSD: main.c,v 1.261 2017/04/16 20:00:58 maya Exp $");
+__RCSID("$NetBSD: main.c,v 1.262 2017/04/16 20:14:49 riastradh Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -183,6 +183,7 @@ static const char *	tracefile;
 static void		MainParseArgs(int, char **);
 static int		ReadMakefile(const void *, const void *);
 static void		usage(void) MAKE_ATTR_DEAD;
+static void		purge_cached_realpaths(void);
 
 static Boolean		ignorePWD;	/* if we use -C, PWD is meaningless */
 static char objdir[MAXPATHLEN + 1];	/* where we chdir'ed to */
@@ -715,7 +716,7 @@ Main_SetObjdir(const char *fmt, ...)
 			Var_Set(".OBJDIR", objdir, VAR_GLOBAL, 0);
 			setenv("PWD", objdir, 1);
 			Dir_InitDot();
-			cached_realpath(".OBJDIR", NULL); /* purge */
+			purge_cached_realpaths();
 			rc = TRUE;
 			if (enterFlag && strcmp(objdir, curdir) != 0)
 enterFlagObj = TRUE;
@@ -1873,42 +1874,56 @@ usage(void)
 	exit(2);
 }
 
-
 /*
  * realpath(3) can get expensive, cache results...
  */
+static GNode *cached_realpaths = NULL;
+
+static GNode *
+get_cached_realpaths(void)
+{
+
+if (!cached_realpaths) {
+	cached_realpaths = Targ_NewGN("Realpath");
+#ifndef DEBUG_REALPATH_CACHE
+	cached_realpaths->flags = INTERNAL;
+#endif
+}
+
+return cached_realpaths;
+}
+
+/* purge any relative paths */
+static void
+purge_cached_realpaths(void)
+{
+GNode *cache = get_cached_realpaths();
+Hash_Entry *he, *nhe;
+Hash_Search hs;
+
+he = Hash_EnumFirst(&cache->context, &hs);
+while (he) {
+	nhe = Hash_EnumNext(&hs);
+	if (he->name[0] != '/') {
+	if (DEBUG(DIR))
+		fprintf(stderr, "cached_realpath: purging %s\n", he->name);
+	Hash_DeleteEntry(&cache->context, he);
+	}
+	he = nhe;
+}
+}
+
 char *
 cached_realpath(const char *pathname, char *resolved)
 {
-static GNode *cache;
+GNode *cache;
 char *rp, *cp;
 
 if (!pathname || !pathname[0])
 	return NULL;
 
-if (!cache) {
-	cache = Targ_NewGN("Realpath");
-#ifndef DEBUG_REALPATH_CACHE
-	cache->flags = INTERNAL;
-#endif
-}
-if (resolved == NULL && strcmp(pathname, ".OBJDIR") == 0) {
-	/* purge any relative paths */
-	Hash_Entry *he, *nhe;
-	Hash_Search hs;
-
-	he = Hash_EnumFirst(&cache->context, &hs);
-	while (he) {
-	nhe = Hash_EnumNext(&hs);
-	if (he->name[0] != '/') {
-		if (DEBUG(DIR))
-		fprintf(stderr, "cached_realpath: purging %s\n", he->name);
-		Hash_DeleteEntry(&cache->context, he);
-	}
-	he = nhe;
-	}
-	return NULL;
-}
+cache = get_cached_realpaths();
+
 if ((rp = Var_Value(pathname, cache, &cp)) != NULL) {
 	/* a hit */
 	strncpy(resolved, rp, MAXPATHLEN);



CVS commit: src/games/fortune/datfiles

2017-04-16 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Sun Apr 16 20:08:59 UTC 2017

Modified Files:
src/games/fortune/datfiles: netbsd

Log Message:
Remove unmaintained link to imrryr from NetBSD specific fortune(6) entries

The original content is not accessible with the original link (missing
closing /). This page does not look to be updated since 2002 and artwork
is not freely reusable.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/games/fortune/datfiles/netbsd

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

Modified files:

Index: src/games/fortune/datfiles/netbsd
diff -u src/games/fortune/datfiles/netbsd:1.27 src/games/fortune/datfiles/netbsd:1.28
--- src/games/fortune/datfiles/netbsd:1.27	Thu Nov 25 13:51:26 2010
+++ src/games/fortune/datfiles/netbsd	Sun Apr 16 20:08:59 2017
@@ -43,9 +43,6 @@ Anagrams for NetBSD-core:
   DEC robs Net
 		-- Julian Assange
 %
-http://www.imrryr.org/NetBSD/logo
-		-- R. C. Dowdeswell
-%
 I always think of NetBSD developers as special gnomes who smoke
 pipes that make big bubbles and if the bubble hits the ceiling
 before popping it gets committed and released.  Lots of lung power



CVS commit: src/usr.bin/make

2017-04-16 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Sun Apr 16 20:00:59 UTC 2017

Modified Files:
src/usr.bin/make: main.c parse.c

Log Message:
Use bmake_malloc where we don't test the return value of malloc currently.

Appeases coverity.


To generate a diff of this commit:
cvs rdiff -u -r1.260 -r1.261 src/usr.bin/make/main.c
cvs rdiff -u -r1.219 -r1.220 src/usr.bin/make/parse.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/make/main.c
diff -u src/usr.bin/make/main.c:1.260 src/usr.bin/make/main.c:1.261
--- src/usr.bin/make/main.c:1.260	Thu Apr 13 13:55:23 2017
+++ src/usr.bin/make/main.c	Sun Apr 16 20:00:58 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.260 2017/04/13 13:55:23 christos Exp $	*/
+/*	$NetBSD: main.c,v 1.261 2017/04/16 20:00:58 maya Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,7 +69,7 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: main.c,v 1.260 2017/04/13 13:55:23 christos Exp $";
+static char rcsid[] = "$NetBSD: main.c,v 1.261 2017/04/16 20:00:58 maya Exp $";
 #else
 #include 
 #ifndef lint
@@ -81,7 +81,7 @@ __COPYRIGHT("@(#) Copyright (c) 1988, 19
 #if 0
 static char sccsid[] = "@(#)main.c	8.3 (Berkeley) 3/19/94";
 #else
-__RCSID("$NetBSD: main.c,v 1.260 2017/04/13 13:55:23 christos Exp $");
+__RCSID("$NetBSD: main.c,v 1.261 2017/04/16 20:00:58 maya Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -323,7 +323,7 @@ parse_debug_options(const char *argvalue
 goto debug_setbuf;
 			}
 			len = strlen(modules);
-			fname = malloc(len + 20);
+			fname = bmake_malloc(len + 20);
 			memcpy(fname, modules, len + 1);
 			/* Let the filename be modified by the pid */
 			if (strcmp(fname + len - 3, ".%d") == 0)

Index: src/usr.bin/make/parse.c
diff -u src/usr.bin/make/parse.c:1.219 src/usr.bin/make/parse.c:1.220
--- src/usr.bin/make/parse.c:1.219	Sun Apr 16 19:53:58 2017
+++ src/usr.bin/make/parse.c	Sun Apr 16 20:00:58 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: parse.c,v 1.219 2017/04/16 19:53:58 riastradh Exp $	*/
+/*	$NetBSD: parse.c,v 1.220 2017/04/16 20:00:58 maya Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: parse.c,v 1.219 2017/04/16 19:53:58 riastradh Exp $";
+static char rcsid[] = "$NetBSD: parse.c,v 1.220 2017/04/16 20:00:58 maya Exp $";
 #else
 #include 
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)parse.c	8.3 (Berkeley) 3/19/94";
 #else
-__RCSID("$NetBSD: parse.c,v 1.219 2017/04/16 19:53:58 riastradh Exp $");
+__RCSID("$NetBSD: parse.c,v 1.220 2017/04/16 20:00:58 maya Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -527,7 +527,7 @@ loadfile(const char *path, int fd)
 		if (lf->buf != MAP_FAILED) {
 			/* succeeded */
 			if (lf->len == lf->maplen && lf->buf[lf->len - 1] != '\n') {
-char *b = malloc(lf->len + 1);
+char *b = bmake_malloc(lf->len + 1);
 b[lf->len] = '\n';
 memcpy(b, lf->buf, lf->len++);
 munmap(lf->buf, lf->maplen);



CVS commit: src/usr.bin/make

2017-04-16 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Apr 16 19:53:58 UTC 2017

Modified Files:
src/usr.bin/make: dir.c parse.c suff.c targ.c var.c

Log Message:
Use, don't kludge, MAKE_ATTR_UNUSED.

CID 1300234
CID 1300237
CID 1300238
CID 1300245
CID 1300255
CID 1300267
CID 1300284


To generate a diff of this commit:
cvs rdiff -u -r1.69 -r1.70 src/usr.bin/make/dir.c
cvs rdiff -u -r1.218 -r1.219 src/usr.bin/make/parse.c
cvs rdiff -u -r1.84 -r1.85 src/usr.bin/make/suff.c
cvs rdiff -u -r1.61 -r1.62 src/usr.bin/make/targ.c
cvs rdiff -u -r1.213 -r1.214 src/usr.bin/make/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/usr.bin/make/dir.c
diff -u src/usr.bin/make/dir.c:1.69 src/usr.bin/make/dir.c:1.70
--- src/usr.bin/make/dir.c:1.69	Tue Jan 31 06:54:23 2017
+++ src/usr.bin/make/dir.c	Sun Apr 16 19:53:58 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: dir.c,v 1.69 2017/01/31 06:54:23 sjg Exp $	*/
+/*	$NetBSD: dir.c,v 1.70 2017/04/16 19:53:58 riastradh Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -70,14 +70,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: dir.c,v 1.69 2017/01/31 06:54:23 sjg Exp $";
+static char rcsid[] = "$NetBSD: dir.c,v 1.70 2017/04/16 19:53:58 riastradh Exp $";
 #else
 #include 
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)dir.c	8.2 (Berkeley) 1/2/94";
 #else
-__RCSID("$NetBSD: dir.c,v 1.69 2017/01/31 06:54:23 sjg Exp $");
+__RCSID("$NetBSD: dir.c,v 1.70 2017/04/16 19:53:58 riastradh Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -803,11 +803,11 @@ DirExpandInt(const char *word, Lst path,
  *---
  */
 static int
-DirPrintWord(void *word, void *dummy)
+DirPrintWord(void *word, void *dummy MAKE_ATTR_UNUSED)
 {
 fprintf(debug_file, "%s ", (char *)word);
 
-return(dummy ? 0 : 0);
+return 0;
 }
 
 /*-
@@ -1851,10 +1851,10 @@ Dir_PrintDirectories(void)
 }
 
 static int
-DirPrintDir(void *p, void *dummy)
+DirPrintDir(void *p, void *dummy MAKE_ATTR_UNUSED)
 {
 fprintf(debug_file, "%s ", ((Path *)p)->name);
-return (dummy ? 0 : 0);
+return 0;
 }
 
 void

Index: src/usr.bin/make/parse.c
diff -u src/usr.bin/make/parse.c:1.218 src/usr.bin/make/parse.c:1.219
--- src/usr.bin/make/parse.c:1.218	Wed Mar  1 16:39:49 2017
+++ src/usr.bin/make/parse.c	Sun Apr 16 19:53:58 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: parse.c,v 1.218 2017/03/01 16:39:49 sjg Exp $	*/
+/*	$NetBSD: parse.c,v 1.219 2017/04/16 19:53:58 riastradh Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: parse.c,v 1.218 2017/03/01 16:39:49 sjg Exp $";
+static char rcsid[] = "$NetBSD: parse.c,v 1.219 2017/04/16 19:53:58 riastradh Exp $";
 #else
 #include 
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)parse.c	8.3 (Berkeley) 3/19/94";
 #else
-__RCSID("$NetBSD: parse.c,v 1.218 2017/03/01 16:39:49 sjg Exp $");
+__RCSID("$NetBSD: parse.c,v 1.219 2017/04/16 19:53:58 riastradh Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -1085,15 +1085,15 @@ ParseDoSrc(int tOp, const char *src)
  *---
  */
 static int
-ParseFindMain(void *gnp, void *dummy)
+ParseFindMain(void *gnp, void *dummy MAKE_ATTR_UNUSED)
 {
 GNode   	  *gn = (GNode *)gnp;
 if ((gn->type & OP_NOTARGET) == 0) {
 	mainNode = gn;
 	Targ_SetMain(gn);
-	return (dummy ? 1 : 1);
+	return 1;
 } else {
-	return (dummy ? 0 : 0);
+	return 0;
 }
 }
 
@@ -1131,10 +1131,10 @@ ParseAddDir(void *path, void *name)
  *---
  */
 static int
-ParseClearPath(void *path, void *dummy)
+ParseClearPath(void *path, void *dummy MAKE_ATTR_UNUSED)
 {
 Dir_ClearPath((Lst) path);
-return(dummy ? 0 : 0);
+return 0;
 }
 
 /*-

Index: src/usr.bin/make/suff.c
diff -u src/usr.bin/make/suff.c:1.84 src/usr.bin/make/suff.c:1.85
--- src/usr.bin/make/suff.c:1.84	Thu Jun 30 05:34:04 2016
+++ src/usr.bin/make/suff.c	Sun Apr 16 19:53:58 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: suff.c,v 1.84 2016/06/30 05:34:04 dholland Exp $	*/
+/*	$NetBSD: suff.c,v 1.85 2017/04/16 19:53:58 riastradh Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: suff.c,v 1.84 2016/06/30 05:34:04 dholland Exp $";
+static char rcsid[] = "$NetBSD: suff.c,v 1.85 2017/04/16 19:53:58 riastradh Exp $";
 #else
 #include 
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)suff.c	8.4 (Berkeley) 3/21/94";
 #else
-__RCSID("$NetBSD: suff.c,v 1.84 2016/06/30 05:34:04 dholland Exp $");
+__RCSID("$NetBSD: suff.c,v 1.85 2017/04/16 19:53:58 riastradh Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -762,12 +762,10 @@ Suff_AddTransform(char *line)
  *-

CVS commit: src/tests/kernel

2017-04-16 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Apr 16 18:24:23 UTC 2017

Modified Files:
src/tests/kernel: t_rnd.c

Log Message:
Stress rump hyperentropy a little harder.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/tests/kernel/t_rnd.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/kernel/t_rnd.c
diff -u src/tests/kernel/t_rnd.c:1.10 src/tests/kernel/t_rnd.c:1.11
--- src/tests/kernel/t_rnd.c:1.10	Fri Jan 13 21:30:41 2017
+++ src/tests/kernel/t_rnd.c	Sun Apr 16 18:24:23 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_rnd.c,v 1.10 2017/01/13 21:30:41 christos Exp $	*/
+/*	$NetBSD: t_rnd.c,v 1.11 2017/04/16 18:24:23 riastradh Exp $	*/
 
 /*
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: t_rnd.c,v 1.10 2017/01/13 21:30:41 christos Exp $");
+__RCSID("$NetBSD: t_rnd.c,v 1.11 2017/04/16 18:24:23 riastradh Exp $");
 
 #include 
 #include 
@@ -35,6 +35,7 @@ __RCSID("$NetBSD: t_rnd.c,v 1.10 2017/01
 #include 
 
 #include 
+#include 
 
 #include 
 #include 
@@ -98,10 +99,15 @@ ATF_TC_BODY(read_random, tc)
 {
 	char buf[128];
 	int fd;
+	unsigned i;
 
 	rump_init();
-	RL(fd = rump_sys_open("/dev/random", O_RDONLY));
-	RL(rump_sys_read(fd, buf, sizeof(buf)));
+	for (i = 0; i < 1000; i++) {
+		alarm(2);
+		RL(fd = rump_sys_open("/dev/random", RUMP_O_RDONLY));
+		RL(rump_sys_read(fd, buf, sizeof(buf)));
+		RZ(rump_sys_close(fd));
+	}
 }
 
 ATF_TP_ADD_TCS(tp)



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

2017-04-16 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Apr 16 18:05:35 UTC 2017

Modified Files:
src/sys/arch/arm/nvidia: tegra_pcie.c

Log Message:
Add support for PCI_INTR_MPSAFE


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/arm/nvidia/tegra_pcie.c

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

Modified files:

Index: src/sys/arch/arm/nvidia/tegra_pcie.c
diff -u src/sys/arch/arm/nvidia/tegra_pcie.c:1.15 src/sys/arch/arm/nvidia/tegra_pcie.c:1.16
--- src/sys/arch/arm/nvidia/tegra_pcie.c:1.15	Wed Aug 17 00:22:56 2016
+++ src/sys/arch/arm/nvidia/tegra_pcie.c	Sun Apr 16 18:05:35 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: tegra_pcie.c,v 1.15 2016/08/17 00:22:56 jakllsch Exp $ */
+/* $NetBSD: tegra_pcie.c,v 1.16 2017/04/16 18:05:35 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: tegra_pcie.c,v 1.15 2016/08/17 00:22:56 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tegra_pcie.c,v 1.16 2017/04/16 18:05:35 jmcneill Exp $");
 
 #include 
 #include 
@@ -62,6 +62,7 @@ struct tegra_pcie_ih {
 	int			(*ih_callback)(void *);
 	void			*ih_arg;
 	int			ih_ipl;
+	int			ih_mpsafe;
 	TAILQ_ENTRY(tegra_pcie_ih) ih_entry;
 };
 
@@ -109,6 +110,8 @@ static int	tegra_pcie_intr_map(const str
 static const char *tegra_pcie_intr_string(void *, pci_intr_handle_t,
 	  char *, size_t);
 const struct evcnt *tegra_pcie_intr_evcnt(void *, pci_intr_handle_t);
+static int	tegra_pcie_intr_setattr(void *, pci_intr_handle_t *, int,
+	uint64_t);
 static void *	tegra_pcie_intr_establish(void *, pci_intr_handle_t,
 	 int, int (*)(void *), void *);
 static void	tegra_pcie_intr_disestablish(void *, void *);
@@ -181,8 +184,8 @@ tegra_pcie_attach(device_t parent, devic
 		return;
 	}
 
-	sc->sc_ih = fdtbus_intr_establish(faa->faa_phandle, 0, IPL_VM, 0,
-	tegra_pcie_intr, sc);
+	sc->sc_ih = fdtbus_intr_establish(faa->faa_phandle, 0, IPL_VM,
+	FDT_INTR_MPSAFE, tegra_pcie_intr, sc);
 	if (sc->sc_ih == NULL) {
 		aprint_error_dev(self, "failed to establish interrupt on %s\n",
 		intrstr);
@@ -248,8 +251,15 @@ tegra_pcie_legacy_intr(struct tegra_pcie
 		TAILQ_FOREACH(pcie_ih, &sc->sc_intrs, ih_entry) {
 			int (*callback)(void *) = pcie_ih->ih_callback;
 			void *arg = pcie_ih->ih_arg;
+			const int mpsafe = pcie_ih->ih_mpsafe;
 			mutex_exit(&sc->sc_lock);
+
+			if (!mpsafe)
+KERNEL_LOCK(1, curlwp);
 			rv += callback(arg);
+			if (!mpsafe)
+KERNEL_UNLOCK_ONE(curlwp);
+
 			mutex_enter(&sc->sc_lock);
 			if (lastgen != sc->sc_intrgen)
 break;
@@ -434,6 +444,7 @@ tegra_pcie_init(pci_chipset_tag_t pc, vo
 	pc->pc_intr_map = tegra_pcie_intr_map;
 	pc->pc_intr_string = tegra_pcie_intr_string;
 	pc->pc_intr_evcnt = tegra_pcie_intr_evcnt;
+	pc->pc_intr_setattr = tegra_pcie_intr_setattr;
 	pc->pc_intr_establish = tegra_pcie_intr_establish;
 	pc->pc_intr_disestablish = tegra_pcie_intr_disestablish;
 }
@@ -577,6 +588,20 @@ tegra_pcie_intr_evcnt(void *v, pci_intr_
 	return NULL;
 }
 
+static int
+tegra_pcie_intr_setattr(void *v, pci_intr_handle_t *ih, int attr, uint64_t data)
+{
+	struct tegra_pcie_ih *pcie_ih = (struct tegra_pcie_ih *)*ih;
+
+	switch (attr) {
+	case PCI_INTR_MPSAFE:
+		pcie_ih->ih_mpsafe = data;
+		return 0;
+	default:
+		return ENODEV;
+	}
+}
+
 static void *
 tegra_pcie_intr_establish(void *v, pci_intr_handle_t ih, int ipl,
 int (*callback)(void *), void *arg)
@@ -591,6 +616,7 @@ tegra_pcie_intr_establish(void *v, pci_i
 	pcie_ih->ih_callback = callback;
 	pcie_ih->ih_arg = arg;
 	pcie_ih->ih_ipl = ipl;
+	pcie_ih->ih_mpsafe = 0;
 
 	mutex_enter(&sc->sc_lock);
 	TAILQ_INSERT_TAIL(&sc->sc_intrs, pcie_ih, ih_entry);



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

2017-04-16 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Apr 16 18:02:50 UTC 2017

Modified Files:
src/sys/arch/arm/include: pci_machdep.h

Log Message:
Add function ptr for pci_intr_setattr to struct arm32_pci_chipset


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/arm/include/pci_machdep.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/include/pci_machdep.h
diff -u src/sys/arch/arm/include/pci_machdep.h:1.10 src/sys/arch/arm/include/pci_machdep.h:1.11
--- src/sys/arch/arm/include/pci_machdep.h:1.10	Sat Mar 29 19:28:26 2014
+++ src/sys/arch/arm/include/pci_machdep.h	Sun Apr 16 18:02:50 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: pci_machdep.h,v 1.10 2014/03/29 19:28:26 christos Exp $	*/
+/*	$NetBSD: pci_machdep.h,v 1.11 2017/04/16 18:02:50 jmcneill Exp $	*/
 
 /*
  * Modified for arm32 by Mark Brinicombe
@@ -70,6 +70,8 @@ struct arm32_pci_chipset {
 	const char	*(*pc_intr_string)(void *, pci_intr_handle_t,
 			char *, size_t);
 	const struct evcnt *(*pc_intr_evcnt)(void *, pci_intr_handle_t);
+	int		(*pc_intr_setattr)(void *, pci_intr_handle_t *,
+			int, uint64_t);
 	void		*(*pc_intr_establish)(void *, pci_intr_handle_t,
 			int, int (*)(void *), void *);
 	void		(*pc_intr_disestablish)(void *, void *);



CVS commit: src/sys/modules/lua

2017-04-16 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Apr 16 17:45:12 UTC 2017

Modified Files:
src/sys/modules/lua: lua.c

Log Message:
Can't destroy pb until we're done using it.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/modules/lua/lua.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/modules/lua/lua.c
diff -u src/sys/modules/lua/lua.c:1.19 src/sys/modules/lua/lua.c:1.20
--- src/sys/modules/lua/lua.c:1.19	Fri Jan 20 12:25:07 2017
+++ src/sys/modules/lua/lua.c	Sun Apr 16 17:45:12 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: lua.c,v 1.19 2017/01/20 12:25:07 maya Exp $ */
+/*	$NetBSD: lua.c,v 1.20 2017/04/16 17:45:12 riastradh Exp $ */
 
 /*
  * Copyright (c) 2014 by Lourival Vieira Neto .
@@ -401,8 +401,8 @@ luaioctl(dev_t dev, u_long cmd, void *da
 if (pb == NULL)
 	return ENOMEM;
 NDINIT(&nd, LOOKUP, FOLLOW | NOCHROOT, pb);
-pathbuf_destroy(pb);
 error = vn_open(&nd, FREAD, 0);
+pathbuf_destroy(pb);
 if (error) {
 	if (lua_verbose)
 		device_printf(sc->sc_dev,



CVS commit: src/sys

2017-04-16 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Apr 16 17:18:55 UTC 2017

Modified Files:
src/sys/kern: vnode_if.c
src/sys/rump/include/rump: rumpvnode_if.h
src/sys/rump/librump/rumpvfs: rumpvnode_if.c
src/sys/sys: vnode_if.h

Log Message:
regen to confirm no functional change


To generate a diff of this commit:
cvs rdiff -u -r1.101 -r1.102 src/sys/kern/vnode_if.c
cvs rdiff -u -r1.25 -r1.26 src/sys/rump/include/rump/rumpvnode_if.h
cvs rdiff -u -r1.25 -r1.26 src/sys/rump/librump/rumpvfs/rumpvnode_if.c
cvs rdiff -u -r1.96 -r1.97 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.101 src/sys/kern/vnode_if.c:1.102
--- src/sys/kern/vnode_if.c:1.101	Sun Apr 16 16:49:26 2017
+++ src/sys/kern/vnode_if.c	Sun Apr 16 17:18:55 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: vnode_if.c,v 1.101 2017/04/16 16:49:26 riastradh Exp $	*/
+/*	$NetBSD: vnode_if.c,v 1.102 2017/04/16 17:18:55 riastradh Exp $	*/
 
 /*
  * Warning: DO NOT EDIT! This file is automatically generated!
@@ -7,7 +7,7 @@
  * Created from the file:
  *	NetBSD: vnode_if.src,v 1.73 2017/04/16 16:48:08 riastradh Exp
  * by the script:
- *	NetBSD: vnode_if.sh,v 1.63 2017/04/11 14:29:32 riastradh Exp
+ *	NetBSD: vnode_if.sh,v 1.64 2017/04/16 17:18:28 riastradh Exp
  */
 
 /*
@@ -40,7 +40,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vnode_if.c,v 1.101 2017/04/16 16:49:26 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vnode_if.c,v 1.102 2017/04/16 17:18:55 riastradh Exp $");
 
 #include 
 #include 

Index: src/sys/rump/include/rump/rumpvnode_if.h
diff -u src/sys/rump/include/rump/rumpvnode_if.h:1.25 src/sys/rump/include/rump/rumpvnode_if.h:1.26
--- src/sys/rump/include/rump/rumpvnode_if.h:1.25	Sun Apr 16 16:49:26 2017
+++ src/sys/rump/include/rump/rumpvnode_if.h	Sun Apr 16 17:18:55 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: rumpvnode_if.h,v 1.25 2017/04/16 16:49:26 riastradh Exp $	*/
+/*	$NetBSD: rumpvnode_if.h,v 1.26 2017/04/16 17:18:55 riastradh Exp $	*/
 
 /*
  * Warning: DO NOT EDIT! This file is automatically generated!
@@ -7,7 +7,7 @@
  * Created from the file:
  *	NetBSD: vnode_if.src,v 1.73 2017/04/16 16:48:08 riastradh Exp
  * by the script:
- *	NetBSD: vnode_if.sh,v 1.63 2017/04/11 14:29:32 riastradh Exp
+ *	NetBSD: vnode_if.sh,v 1.64 2017/04/16 17:18:28 riastradh Exp
  */
 
 /*

Index: src/sys/rump/librump/rumpvfs/rumpvnode_if.c
diff -u src/sys/rump/librump/rumpvfs/rumpvnode_if.c:1.25 src/sys/rump/librump/rumpvfs/rumpvnode_if.c:1.26
--- src/sys/rump/librump/rumpvfs/rumpvnode_if.c:1.25	Sun Apr 16 16:49:26 2017
+++ src/sys/rump/librump/rumpvfs/rumpvnode_if.c	Sun Apr 16 17:18:55 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: rumpvnode_if.c,v 1.25 2017/04/16 16:49:26 riastradh Exp $	*/
+/*	$NetBSD: rumpvnode_if.c,v 1.26 2017/04/16 17:18:55 riastradh Exp $	*/
 
 /*
  * Warning: DO NOT EDIT! This file is automatically generated!
@@ -7,7 +7,7 @@
  * Created from the file:
  *	NetBSD: vnode_if.src,v 1.73 2017/04/16 16:48:08 riastradh Exp
  * by the script:
- *	NetBSD: vnode_if.sh,v 1.63 2017/04/11 14:29:32 riastradh Exp
+ *	NetBSD: vnode_if.sh,v 1.64 2017/04/16 17:18:28 riastradh Exp
  */
 
 /*
@@ -40,7 +40,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rumpvnode_if.c,v 1.25 2017/04/16 16:49:26 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rumpvnode_if.c,v 1.26 2017/04/16 17:18:55 riastradh Exp $");
 
 #include 
 #include 

Index: src/sys/sys/vnode_if.h
diff -u src/sys/sys/vnode_if.h:1.96 src/sys/sys/vnode_if.h:1.97
--- src/sys/sys/vnode_if.h:1.96	Sun Apr 16 16:49:25 2017
+++ src/sys/sys/vnode_if.h	Sun Apr 16 17:18:54 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: vnode_if.h,v 1.96 2017/04/16 16:49:25 riastradh Exp $	*/
+/*	$NetBSD: vnode_if.h,v 1.97 2017/04/16 17:18:54 riastradh Exp $	*/
 
 /*
  * Warning: DO NOT EDIT! This file is automatically generated!
@@ -7,7 +7,7 @@
  * Created from the file:
  *	NetBSD: vnode_if.src,v 1.73 2017/04/16 16:48:08 riastradh Exp
  * by the script:
- *	NetBSD: vnode_if.sh,v 1.63 2017/04/11 14:29:32 riastradh Exp
+ *	NetBSD: vnode_if.sh,v 1.64 2017/04/16 17:18:28 riastradh Exp
  */
 
 /*



CVS commit: src/sys/kern

2017-04-16 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Apr 16 17:18:28 UTC 2017

Modified Files:
src/sys/kern: vnode_if.sh

Log Message:
Count vnode arguments correctly.

Don't count arguments that have WILLRELE/WILLPUT; count arguments
that are struct vnode *.

No functional change currently because it happens that every released
or put vnode argument comes first or after other ones.


To generate a diff of this commit:
cvs rdiff -u -r1.63 -r1.64 src/sys/kern/vnode_if.sh

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.sh
diff -u src/sys/kern/vnode_if.sh:1.63 src/sys/kern/vnode_if.sh:1.64
--- src/sys/kern/vnode_if.sh:1.63	Tue Apr 11 14:29:32 2017
+++ src/sys/kern/vnode_if.sh	Sun Apr 16 17:18:28 2017
@@ -29,7 +29,7 @@ copyright="\
  * SUCH DAMAGE.
  */
 "
-SCRIPT_ID='$NetBSD: vnode_if.sh,v 1.63 2017/04/11 14:29:32 riastradh Exp $'
+SCRIPT_ID='$NetBSD: vnode_if.sh,v 1.64 2017/04/16 17:18:28 riastradh Exp $'
 
 # Script to produce VFS front-end sugar.
 #
@@ -370,8 +370,9 @@ function offsets() {
 word = "RELE";
 			}
 			printf(" | VDESC_VP%s_WILL%s", vpnum, word);
-			vpnum++;
 		}
+		if (argtype[i] == "struct vnode *")
+			vpnum++;
 	}
 	print ",";
 	# vp offsets



CVS commit: src/sys

2017-04-16 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Apr 16 16:49:26 UTC 2017

Modified Files:
src/sys/kern: vnode_if.c
src/sys/rump/include/rump: rumpvnode_if.h
src/sys/rump/librump/rumpvfs: rumpvnode_if.c
src/sys/sys: vnode_if.h

Log Message:
regen


To generate a diff of this commit:
cvs rdiff -u -r1.100 -r1.101 src/sys/kern/vnode_if.c
cvs rdiff -u -r1.24 -r1.25 src/sys/rump/include/rump/rumpvnode_if.h
cvs rdiff -u -r1.24 -r1.25 src/sys/rump/librump/rumpvfs/rumpvnode_if.c
cvs rdiff -u -r1.95 -r1.96 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.100 src/sys/kern/vnode_if.c:1.101
--- src/sys/kern/vnode_if.c:1.100	Sat Apr 15 23:21:46 2017
+++ src/sys/kern/vnode_if.c	Sun Apr 16 16:49:26 2017
@@ -1,11 +1,11 @@
-/*	$NetBSD: vnode_if.c,v 1.100 2017/04/15 23:21:46 riastradh Exp $	*/
+/*	$NetBSD: vnode_if.c,v 1.101 2017/04/16 16:49:26 riastradh 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.72 2017/04/15 23:16:53 riastradh Exp
+ *	NetBSD: vnode_if.src,v 1.73 2017/04/16 16:48:08 riastradh Exp
  * by the script:
  *	NetBSD: vnode_if.sh,v 1.63 2017/04/11 14:29:32 riastradh Exp
  */
@@ -40,7 +40,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vnode_if.c,v 1.100 2017/04/15 23:21:46 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vnode_if.c,v 1.101 2017/04/16 16:49:26 riastradh Exp $");
 
 #include 
 #include 

Index: src/sys/rump/include/rump/rumpvnode_if.h
diff -u src/sys/rump/include/rump/rumpvnode_if.h:1.24 src/sys/rump/include/rump/rumpvnode_if.h:1.25
--- src/sys/rump/include/rump/rumpvnode_if.h:1.24	Sat Apr 15 23:21:46 2017
+++ src/sys/rump/include/rump/rumpvnode_if.h	Sun Apr 16 16:49:26 2017
@@ -1,11 +1,11 @@
-/*	$NetBSD: rumpvnode_if.h,v 1.24 2017/04/15 23:21:46 riastradh Exp $	*/
+/*	$NetBSD: rumpvnode_if.h,v 1.25 2017/04/16 16:49:26 riastradh 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.72 2017/04/15 23:16:53 riastradh Exp
+ *	NetBSD: vnode_if.src,v 1.73 2017/04/16 16:48:08 riastradh Exp
  * by the script:
  *	NetBSD: vnode_if.sh,v 1.63 2017/04/11 14:29:32 riastradh Exp
  */

Index: src/sys/rump/librump/rumpvfs/rumpvnode_if.c
diff -u src/sys/rump/librump/rumpvfs/rumpvnode_if.c:1.24 src/sys/rump/librump/rumpvfs/rumpvnode_if.c:1.25
--- src/sys/rump/librump/rumpvfs/rumpvnode_if.c:1.24	Sat Apr 15 23:21:46 2017
+++ src/sys/rump/librump/rumpvfs/rumpvnode_if.c	Sun Apr 16 16:49:26 2017
@@ -1,11 +1,11 @@
-/*	$NetBSD: rumpvnode_if.c,v 1.24 2017/04/15 23:21:46 riastradh Exp $	*/
+/*	$NetBSD: rumpvnode_if.c,v 1.25 2017/04/16 16:49:26 riastradh 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.72 2017/04/15 23:16:53 riastradh Exp
+ *	NetBSD: vnode_if.src,v 1.73 2017/04/16 16:48:08 riastradh Exp
  * by the script:
  *	NetBSD: vnode_if.sh,v 1.63 2017/04/11 14:29:32 riastradh Exp
  */
@@ -40,7 +40,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rumpvnode_if.c,v 1.24 2017/04/15 23:21:46 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rumpvnode_if.c,v 1.25 2017/04/16 16:49:26 riastradh Exp $");
 
 #include 
 #include 

Index: src/sys/sys/vnode_if.h
diff -u src/sys/sys/vnode_if.h:1.95 src/sys/sys/vnode_if.h:1.96
--- src/sys/sys/vnode_if.h:1.95	Sat Apr 15 23:21:46 2017
+++ src/sys/sys/vnode_if.h	Sun Apr 16 16:49:25 2017
@@ -1,11 +1,11 @@
-/*	$NetBSD: vnode_if.h,v 1.95 2017/04/15 23:21:46 riastradh Exp $	*/
+/*	$NetBSD: vnode_if.h,v 1.96 2017/04/16 16:49:25 riastradh 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.72 2017/04/15 23:16:53 riastradh Exp
+ *	NetBSD: vnode_if.src,v 1.73 2017/04/16 16:48:08 riastradh Exp
  * by the script:
  *	NetBSD: vnode_if.sh,v 1.63 2017/04/11 14:29:32 riastradh Exp
  */



CVS commit: src/sys/kern

2017-04-16 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Apr 16 16:48:08 UTC 2017

Modified Files:
src/sys/kern: vfs_vnode.c vnode_if.src

Log Message:
Back out previous.

Breaks file systems for which VOP_UNLOCK doesn't work on a reclaimed
vnode.

The only case in tree right now is sys/fs/union -- most file systems
use genfs_unlock, which does work on a reclaimed vnode.

Maybe we can work around this -- and still enable VOP_RECLAIM's
callees to assert lock ownership -- by having VOP_RECLAIM unlock the
vnode instead.


To generate a diff of this commit:
cvs rdiff -u -r1.84 -r1.85 src/sys/kern/vfs_vnode.c
cvs rdiff -u -r1.72 -r1.73 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/vfs_vnode.c
diff -u src/sys/kern/vfs_vnode.c:1.84 src/sys/kern/vfs_vnode.c:1.85
--- src/sys/kern/vfs_vnode.c:1.84	Sat Apr 15 23:16:53 2017
+++ src/sys/kern/vfs_vnode.c	Sun Apr 16 16:48:08 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_vnode.c,v 1.84 2017/04/15 23:16:53 riastradh Exp $	*/
+/*	$NetBSD: vfs_vnode.c,v 1.85 2017/04/16 16:48:08 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 1997-2011 The NetBSD Foundation, Inc.
@@ -156,7 +156,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vfs_vnode.c,v 1.84 2017/04/15 23:16:53 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_vnode.c,v 1.85 2017/04/16 16:48:08 riastradh Exp $");
 
 #include 
 #include 
@@ -1554,10 +1554,10 @@ vcache_reclaim(vnode_t *vp)
 	 * Note that the VOP_INACTIVE will not unlock the vnode.
 	 */
 	VOP_INACTIVE(vp, &recycle);
+	VOP_UNLOCK(vp);
 	if (VOP_RECLAIM(vp)) {
 		vnpanic(vp, "%s: cannot reclaim", __func__);
 	}
-	VOP_UNLOCK(vp);
 
 	KASSERT(vp->v_data == NULL);
 	KASSERT(vp->v_uobj.uo_npages == 0);

Index: src/sys/kern/vnode_if.src
diff -u src/sys/kern/vnode_if.src:1.72 src/sys/kern/vnode_if.src:1.73
--- src/sys/kern/vnode_if.src:1.72	Sat Apr 15 23:16:53 2017
+++ src/sys/kern/vnode_if.src	Sun Apr 16 16:48:08 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: vnode_if.src,v 1.72 2017/04/15 23:16:53 riastradh Exp $
+#	$NetBSD: vnode_if.src,v 1.73 2017/04/16 16:48:08 riastradh Exp $
 #
 # Copyright (c) 1992, 1993
 #	The Regents of the University of California.  All rights reserved.
@@ -393,11 +393,11 @@ vop_inactive {
 };
 
 #
-#% reclaimvp  L L L
+#% reclaimvp  U U U
 #
 vop_reclaim {
 	FSTRANS=NO
-	IN LOCKED=YES struct vnode *vp;
+	IN LOCKED=NO struct vnode *vp;
 };
 
 #



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

2017-04-16 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Apr 16 15:52:43 UTC 2017

Modified Files:
src/sys/arch/arm/samsung: exynos5422_clock.c

Log Message:
Adapt for clock domain support


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/arm/samsung/exynos5422_clock.c

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

Modified files:

Index: src/sys/arch/arm/samsung/exynos5422_clock.c
diff -u src/sys/arch/arm/samsung/exynos5422_clock.c:1.4 src/sys/arch/arm/samsung/exynos5422_clock.c:1.5
--- src/sys/arch/arm/samsung/exynos5422_clock.c:1.4	Sat Dec 26 22:57:09 2015
+++ src/sys/arch/arm/samsung/exynos5422_clock.c	Sun Apr 16 15:52:43 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: exynos5422_clock.c,v 1.4 2015/12/26 22:57:09 jmcneill Exp $ */
+/* $NetBSD: exynos5422_clock.c,v 1.5 2017/04/16 15:52:43 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill 
@@ -29,7 +29,7 @@
 #include "locators.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: exynos5422_clock.c,v 1.4 2015/12/26 22:57:09 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: exynos5422_clock.c,v 1.5 2017/04/16 15:52:43 jmcneill Exp $");
 
 #include 
 #include 
@@ -433,6 +433,8 @@ struct exynos5422_clock_softc {
 	device_t		sc_dev;
 	bus_space_tag_t		sc_bst;
 	bus_space_handle_t	sc_bsh;
+
+	struct clk_domain	sc_clkdom;
 };
 
 static void	exynos5422_clock_print_header(void);
@@ -483,7 +485,11 @@ exynos5422_clock_attach(device_t parent,
 	aprint_naive("\n");
 	aprint_normal(": Exynos5422 Clock Controller\n");
 
-	clk_backend_register("exynos5422", &exynos5422_clock_funcs, sc);
+	sc->sc_clkdom.funcs = &exynos5422_clock_funcs;
+	sc->sc_clkdom.priv = sc;
+	for (u_int n = 0; n < __arraycount(exynos5422_clocks); n++) {
+		exynos5422_clocks[n].base.domain = &sc->sc_clkdom;
+	}
 
 	fdtbus_register_clock_controller(self, faa->faa_phandle,
 	&exynos5422_car_fdtclock_funcs);



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

2017-04-16 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Apr 16 15:52:16 UTC 2017

Modified Files:
src/sys/arch/arm/samsung: exynos_fdt.c

Log Message:
Init array no longer required


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/samsung/exynos_fdt.c

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

Modified files:

Index: src/sys/arch/arm/samsung/exynos_fdt.c
diff -u src/sys/arch/arm/samsung/exynos_fdt.c:1.3 src/sys/arch/arm/samsung/exynos_fdt.c:1.4
--- src/sys/arch/arm/samsung/exynos_fdt.c:1.3	Sun Dec 27 12:21:12 2015
+++ src/sys/arch/arm/samsung/exynos_fdt.c	Sun Apr 16 15:52:16 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: exynos_fdt.c,v 1.3 2015/12/27 12:21:12 jmcneill Exp $ */
+/* $NetBSD: exynos_fdt.c,v 1.4 2017/04/16 15:52:16 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill 
@@ -29,7 +29,7 @@
 #include "opt_exynos.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: exynos_fdt.c,v 1.3 2015/12/27 12:21:12 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: exynos_fdt.c,v 1.4 2017/04/16 15:52:16 jmcneill Exp $");
 
 #include 
 #include 
@@ -64,14 +64,6 @@ exynosfdt_match(device_t parent, cfdata_
 void
 exynosfdt_attach(device_t parent, device_t self, void *aux)
 {
-	const char *exynosfdt_init[] = {
-		"interrupt-controller",
-		"clock-controller",
-		"pinctrl",
-		"i2c",
-		"phy"
-	};
-
 	exynosfdt_found = true;
 
 	aprint_naive("\n");
@@ -83,8 +75,6 @@ exynosfdt_attach(device_t parent, device
 		.faa_a4x_bst = &armv7_generic_a4x_bs_tag,
 		.faa_dmat = &exynos_bus_dma_tag,
 		.faa_phandle = OF_peer(0),
-		.faa_init = exynosfdt_init,
-		.faa_ninit = __arraycount(exynosfdt_init)
 	};
 	config_found(self, &faa, NULL);
 }



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

2017-04-16 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Apr 16 15:49:26 UTC 2017

Modified Files:
src/sys/arch/evbarm/conf: EXYNOS

Log Message:
typo fix


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/evbarm/conf/EXYNOS

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/conf/EXYNOS
diff -u src/sys/arch/evbarm/conf/EXYNOS:1.13 src/sys/arch/evbarm/conf/EXYNOS:1.14
--- src/sys/arch/evbarm/conf/EXYNOS:1.13	Fri Apr 14 22:55:06 2017
+++ src/sys/arch/evbarm/conf/EXYNOS	Sun Apr 16 15:49:26 2017
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: EXYNOS,v 1.13 2017/04/14 22:55:06 jmcneill Exp $
+#	$NetBSD: EXYNOS,v 1.14 2017/04/16 15:49:26 jmcneill Exp $
 #
 #	ODROID-XU -- ODROID-XU4 Exynos5422 based kernel
 #
@@ -203,7 +203,7 @@ armgtmr0	at armperiph?			# Generic Timer
 
 # On-board I/O
 exynosfdt0	at mainbus?
-fdt?		at fdtbus?
+fdt*		at fdtbus?
 
 fregulator*	at fdt?
 



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

2017-04-16 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Apr 16 13:27:19 UTC 2017

Modified Files:
src/sys/arch/arm/nvidia: tegra_sdhc.c

Log Message:
Disable SDR104 until the Tegra K1 custom tuning method is implemented.
This is required to work around errata that describes periodic data CRC
errors after autotuning has completed.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/arm/nvidia/tegra_sdhc.c

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

Modified files:

Index: src/sys/arch/arm/nvidia/tegra_sdhc.c
diff -u src/sys/arch/arm/nvidia/tegra_sdhc.c:1.16 src/sys/arch/arm/nvidia/tegra_sdhc.c:1.17
--- src/sys/arch/arm/nvidia/tegra_sdhc.c:1.16	Tue Apr 11 11:06:02 2017
+++ src/sys/arch/arm/nvidia/tegra_sdhc.c	Sun Apr 16 13:27:19 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: tegra_sdhc.c,v 1.16 2017/04/11 11:06:02 jmcneill Exp $ */
+/* $NetBSD: tegra_sdhc.c,v 1.17 2017/04/16 13:27:19 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill 
@@ -29,7 +29,7 @@
 #include "locators.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: tegra_sdhc.c,v 1.16 2017/04/11 11:06:02 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tegra_sdhc.c,v 1.17 2017/04/16 13:27:19 jmcneill Exp $");
 
 #include 
 #include 
@@ -124,6 +124,14 @@ tegra_sdhc_attach(device_t parent, devic
 	}
 	sc->sc_bsz = size;
 
+	/* XXX SDR104 requires a custom tuning method on Tegra K1 */
+	sc->sc.sc_flags |= SDHC_FLAG_HOSTCAPS;
+	sc->sc.sc_caps = bus_space_read_4(sc->sc_bst, sc->sc_bsh,
+	SDHC_CAPABILITIES);
+	sc->sc.sc_caps2 = bus_space_read_4(sc->sc_bst, sc->sc_bsh,
+	SDHC_CAPABILITIES2);
+	sc->sc.sc_caps2 &= ~SDHC_SDR104_SUPP;
+
 	sc->sc_pin_power = fdtbus_gpio_acquire(faa->faa_phandle,
 	"power-gpios", GPIO_PIN_OUTPUT);
 	if (sc->sc_pin_power)



CVS commit: src/tests/lib/libc/sys

2017-04-16 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Sun Apr 16 13:09:40 UTC 2017

Modified Files:
src/tests/lib/libc/sys: t_ptrace_wait.c

Log Message:
ATF test attach2/t_ptrace_wait* is unstable

Mark it broken with:

PR kern/52168 attach2:t_ptrace_wait* is unsable

In order to get reliable failure, abort this test at the end (if we get
there).


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/tests/lib/libc/sys/t_ptrace_wait.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/libc/sys/t_ptrace_wait.c
diff -u src/tests/lib/libc/sys/t_ptrace_wait.c:1.7 src/tests/lib/libc/sys/t_ptrace_wait.c:1.8
--- src/tests/lib/libc/sys/t_ptrace_wait.c:1.7	Sun Apr 16 12:50:59 2017
+++ src/tests/lib/libc/sys/t_ptrace_wait.c	Sun Apr 16 13:09:40 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_ptrace_wait.c,v 1.7 2017/04/16 12:50:59 kamil Exp $	*/
+/*	$NetBSD: t_ptrace_wait.c,v 1.8 2017/04/16 13:09:40 kamil Exp $	*/
 
 /*-
  * Copyright (c) 2016 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: t_ptrace_wait.c,v 1.7 2017/04/16 12:50:59 kamil Exp $");
+__RCSID("$NetBSD: t_ptrace_wait.c,v 1.8 2017/04/16 13:09:40 kamil Exp $");
 
 #include 
 #include 
@@ -413,6 +413,8 @@ ATF_TC_BODY(attach2, tc)
 	int status;
 #endif
 
+	atf_tc_expect_fail("PR kern/52168");
+
 	printf("Spawn tracee\n");
 	ATF_REQUIRE(msg_open(&parent_tracee) == 0);
 	tracee = atf_utils_fork();
@@ -494,6 +496,7 @@ ATF_TC_BODY(attach2, tc)
 	msg_close(&parent_tracer);
 	msg_close(&parent_tracee);
 
+	ATF_REQUIRE(0 && "In order to get reliable failure, abort");
 }
 #endif
 



CVS commit: src/tests/lib/libc/sys

2017-04-16 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Sun Apr 16 12:50:59 UTC 2017

Modified Files:
src/tests/lib/libc/sys: t_ptrace_wait.c

Log Message:
Mark signal3/t_ptrace_wait* with timeout on sparc 32-bit

PR kern/52167 signal3/t_ptrace_wait* timeouts on sparc 32-bit

This test is also marked as failure on other platforms:

PR kern/51918 ptrace tracee can prevent tracer to get its signals by masking

Both issues are valid on sparc 32-bit, but the timeout one wins.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/tests/lib/libc/sys/t_ptrace_wait.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/libc/sys/t_ptrace_wait.c
diff -u src/tests/lib/libc/sys/t_ptrace_wait.c:1.6 src/tests/lib/libc/sys/t_ptrace_wait.c:1.7
--- src/tests/lib/libc/sys/t_ptrace_wait.c:1.6	Sun Apr 16 12:32:03 2017
+++ src/tests/lib/libc/sys/t_ptrace_wait.c	Sun Apr 16 12:50:59 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_ptrace_wait.c,v 1.6 2017/04/16 12:32:03 kamil Exp $	*/
+/*	$NetBSD: t_ptrace_wait.c,v 1.7 2017/04/16 12:50:59 kamil Exp $	*/
 
 /*-
  * Copyright (c) 2016 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: t_ptrace_wait.c,v 1.6 2017/04/16 12:32:03 kamil Exp $");
+__RCSID("$NetBSD: t_ptrace_wait.c,v 1.7 2017/04/16 12:50:59 kamil Exp $");
 
 #include 
 #include 
@@ -5739,6 +5739,7 @@ ATF_TC_BODY(signal2, tc)
 ATF_TC(signal3);
 ATF_TC_HEAD(signal3, tc)
 {
+	atf_tc_set_md_var(tc, "timeout", "5");
 	atf_tc_set_md_var(tc, "descr",
 	"Verify that masking SIGTRAP in tracee does not stop tracer from "
 	"catching software breakpoints");
@@ -5755,7 +5756,14 @@ ATF_TC_BODY(signal3, tc)
 #endif
 	sigset_t intmask;
 
+#if defined(__sparc__) && !defined(__sparc64__)
+	atf_tc_expect_timeout("PR kern/52167");
+
+	// timeout wins, failure still valid
+	// atf_tc_expect_fail("PR kern/51918");
+#else
 	atf_tc_expect_fail("PR kern/51918");
+#endif
 
 	printf("Before forking process PID=%d\n", getpid());
 	ATF_REQUIRE((child = fork()) != -1);



CVS commit: src/tests/lib/libc/sys

2017-04-16 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Sun Apr 16 12:32:03 UTC 2017

Modified Files:
src/tests/lib/libc/sys: t_ptrace_wait.c

Log Message:
Mark syscallemu1/t_ptrace_wait* broken on 32-bit sparc

PR kern/52166


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/tests/lib/libc/sys/t_ptrace_wait.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/libc/sys/t_ptrace_wait.c
diff -u src/tests/lib/libc/sys/t_ptrace_wait.c:1.5 src/tests/lib/libc/sys/t_ptrace_wait.c:1.6
--- src/tests/lib/libc/sys/t_ptrace_wait.c:1.5	Sun Apr 16 12:03:25 2017
+++ src/tests/lib/libc/sys/t_ptrace_wait.c	Sun Apr 16 12:32:03 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_ptrace_wait.c,v 1.5 2017/04/16 12:03:25 kamil Exp $	*/
+/*	$NetBSD: t_ptrace_wait.c,v 1.6 2017/04/16 12:32:03 kamil Exp $	*/
 
 /*-
  * Copyright (c) 2016 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: t_ptrace_wait.c,v 1.5 2017/04/16 12:03:25 kamil Exp $");
+__RCSID("$NetBSD: t_ptrace_wait.c,v 1.6 2017/04/16 12:32:03 kamil Exp $");
 
 #include 
 #include 
@@ -7455,6 +7455,11 @@ ATF_TC_BODY(syscallemu1, tc)
 	int status;
 #endif
 
+#if defined(__sparc__) && !defined(__sparc64__)
+	/* syscallemu does not work on sparc (32-bit) */
+	atf_tc_expect_fail("PR kern/52166");
+#endif
+
 	printf("Before forking process PID=%d\n", getpid());
 	ATF_REQUIRE((child = fork()) != -1);
 	if (child == 0) {



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

2017-04-16 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Apr 16 12:29:40 UTC 2017

Modified Files:
src/sys/arch/evbarm/conf: TEGRA

Log Message:
Add fclock(4)


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/evbarm/conf/TEGRA

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/conf/TEGRA
diff -u src/sys/arch/evbarm/conf/TEGRA:1.13 src/sys/arch/evbarm/conf/TEGRA:1.14
--- src/sys/arch/evbarm/conf/TEGRA:1.13	Fri Apr 14 22:55:06 2017
+++ src/sys/arch/evbarm/conf/TEGRA	Sun Apr 16 12:29:40 2017
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: TEGRA,v 1.13 2017/04/14 22:55:06 jmcneill Exp $
+#	$NetBSD: TEGRA,v 1.14 2017/04/16 12:29:40 jmcneill Exp $
 #
 #	NVIDIA Tegra K1 (T124)
 #
@@ -36,6 +36,7 @@ armgtmr0	at armperiph?# ARM Generic 
 tegrafdt0	at mainbus?
 fdt*		at fdtbus?
 
+fclock*		at fdt?
 fregulator*	at fdt?
 gpiokeys*	at fdt?
 



CVS commit: src/sys/dev/fdt

2017-04-16 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Apr 16 12:29:20 UTC 2017

Modified Files:
src/sys/dev/fdt: files.fdt
Added Files:
src/sys/dev/fdt: fixedclock.c

Log Message:
Add support for simple fixed-rate clock source bindings.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/dev/fdt/files.fdt
cvs rdiff -u -r0 -r1.1 src/sys/dev/fdt/fixedclock.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/fdt/files.fdt
diff -u src/sys/dev/fdt/files.fdt:1.8 src/sys/dev/fdt/files.fdt:1.9
--- src/sys/dev/fdt/files.fdt:1.8	Fri Apr 14 22:55:06 2017
+++ src/sys/dev/fdt/files.fdt	Sun Apr 16 12:29:20 2017
@@ -1,4 +1,4 @@
-# $NetBSD: files.fdt,v 1.8 2017/04/14 22:55:06 jmcneill Exp $
+# $NetBSD: files.fdt,v 1.9 2017/04/16 12:29:20 jmcneill Exp $
 
 include	"external/bsd/libfdt/conf/files.libfdt"
 
@@ -14,6 +14,10 @@ device	fregulator
 attach	fregulator at fdt
 file	dev/fdt/fixedregulator.c		fregulator
 
+device	fclock: clk
+attach	fclock at fdt
+file	dev/fdt/fixedclock.c			fclock
+
 device	gpiokeys
 attach	gpiokeys at fdt
 file	dev/fdt/gpiokeys.c			gpiokeys

Added files:

Index: src/sys/dev/fdt/fixedclock.c
diff -u /dev/null src/sys/dev/fdt/fixedclock.c:1.1
--- /dev/null	Sun Apr 16 12:29:20 2017
+++ src/sys/dev/fdt/fixedclock.c	Sun Apr 16 12:29:20 2017
@@ -0,0 +1,145 @@
+/* $NetBSD: fixedclock.c,v 1.1 2017/04/16 12:29:20 jmcneill Exp $ */
+
+/*-
+ * Copyright (c) 2017 Jared D. McNeill 
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include 
+__KERNEL_RCSID(0, "$NetBSD: fixedclock.c,v 1.1 2017/04/16 12:29:20 jmcneill Exp $");
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+#include 
+
+static int	fixedclock_match(device_t, cfdata_t, void *);
+static void	fixedclock_attach(device_t, device_t, void *);
+
+static struct clk *fixedclock_decode(device_t, const void *, size_t);
+
+static const struct fdtbus_clock_controller_func fixedclock_fdt_funcs = {
+	.decode = fixedclock_decode
+};
+
+static struct clk *fixedclock_get(void *, const char *);
+static void	fixedclock_put(void *, struct clk *);
+static u_int	fixedclock_get_rate(void *, struct clk *);
+
+static const struct clk_funcs fixedclock_clk_funcs = {
+	.get = fixedclock_get,
+	.put = fixedclock_put,
+	.get_rate = fixedclock_get_rate,
+};
+
+struct fixedclock_clk {
+	struct clk	base;
+	u_int		rate;
+};
+
+struct fixedclock_softc {
+	device_t	sc_dev;
+	int		sc_phandle;
+
+	struct clk_domain sc_clkdom;
+	struct fixedclock_clk sc_clk;
+};
+
+CFATTACH_DECL_NEW(fclock, sizeof(struct fixedclock_softc),
+fixedclock_match, fixedclock_attach, NULL, NULL);
+
+static int
+fixedclock_match(device_t parent, cfdata_t cf, void *aux)
+{
+	const char * const compatible[] = { "fixed-clock", NULL };
+	const struct fdt_attach_args *faa = aux;
+
+	return of_match_compatible(faa->faa_phandle, compatible);
+}
+
+static void
+fixedclock_attach(device_t parent, device_t self, void *aux)
+{
+	struct fixedclock_softc * const sc = device_private(self);
+	const struct fdt_attach_args *faa = aux;
+	const int phandle = faa->faa_phandle;
+
+	sc->sc_dev = self;
+	sc->sc_phandle = phandle;
+	sc->sc_clkdom.funcs = &fixedclock_clk_funcs;
+	sc->sc_clkdom.priv = sc;
+	if (of_getprop_uint32(phandle, "clock-frequency",
+	&sc->sc_clk.rate) != 0) {
+		aprint_error(": couldn't determine frequency\n");
+		return;
+	}
+	sc->sc_clk.base.domain = &sc->sc_clkdom;
+	sc->sc_clk.base.name = kmem_asprintf("%s", faa->faa_name);
+
+	aprint_naive(": %u Hz fixed clock (%s)\n", sc->sc_clk.rate,
+	sc->sc_clk.base.name);
+
+	fdtbus_register_clock_controller(self, phandle, &fixedclock_fdt_funcs);
+}
+
+static 

CVS commit: src/sys

2017-04-16 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Apr 16 12:28:21 UTC 2017

Modified Files:
src/sys/arch/arm/nvidia: tegra124_car.c tegra_ahcisata.c tegra_drm.c
tegra_hdaudio.c tegra_soctherm.c tegra_timer.c tegra_xusb.c
src/sys/dev/clk: clk.c clk.h clk_backend.h

Log Message:
Add support for multiple clock domains in clk API.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/arm/nvidia/tegra124_car.c \
src/sys/arch/arm/nvidia/tegra_ahcisata.c
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/arm/nvidia/tegra_drm.c
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/arm/nvidia/tegra_hdaudio.c
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/nvidia/tegra_soctherm.c
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/arm/nvidia/tegra_timer.c \
src/sys/arch/arm/nvidia/tegra_xusb.c
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/clk/clk.c src/sys/dev/clk/clk.h \
src/sys/dev/clk/clk_backend.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/nvidia/tegra124_car.c
diff -u src/sys/arch/arm/nvidia/tegra124_car.c:1.9 src/sys/arch/arm/nvidia/tegra124_car.c:1.10
--- src/sys/arch/arm/nvidia/tegra124_car.c:1.9	Fri Apr 14 09:50:56 2017
+++ src/sys/arch/arm/nvidia/tegra124_car.c	Sun Apr 16 12:28:21 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: tegra124_car.c,v 1.9 2017/04/14 09:50:56 jmcneill Exp $ */
+/* $NetBSD: tegra124_car.c,v 1.10 2017/04/16 12:28:21 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: tegra124_car.c,v 1.9 2017/04/14 09:50:56 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tegra124_car.c,v 1.10 2017/04/16 12:28:21 jmcneill Exp $");
 
 #include 
 #include 
@@ -626,8 +626,6 @@ static struct tegra_clk tegra124_car_clo
 	CLK_GATE_H("fuse", "clk_m", CAR_DEV_H_FUSE),
 	CLK_GATE_U("soc_therm", "div_soc_therm", CAR_DEV_U_SOC_THERM),
 	CLK_GATE_V("tsensor", "div_tsensor", CAR_DEV_V_TSENSOR),
-	CLK_GATE_SIMPLE("watchdog", "clk_m", CAR_RST_SOURCE_REG,
-		CAR_RST_SOURCE_WDT_EN|CAR_RST_SOURCE_WDT_SYS_RST_EN),
 	CLK_GATE_L("host1x", "div_host1x", CAR_DEV_L_HOST1X),
 	CLK_GATE_L("disp1", "mux_disp1", CAR_DEV_L_DISP1),
 	CLK_GATE_L("disp2", "mux_disp2", CAR_DEV_L_DISP2),
@@ -639,6 +637,22 @@ static struct tegra_clk tegra124_car_clo
 	CLK_GATE_X("gpu", "pll_ref", CAR_DEV_X_GPU),
 };
 
+struct tegra124_init_parent {
+	const char *clock;
+	const char *parent;
+} tegra124_init_parents[] = {
+	{ "sata_oob",		"pll_p_out0" },
+	{ "sata",		"pll_p_out0" },
+	{ "hda",		"pll_p_out0" },
+	{ "hda2codec_2x",	"pll_p_out0" },
+	{ "soc_therm",		"pll_p_out0" },
+	{ "tsensor",		"clk_m" },
+	{ "xusb_host_src",	"pll_p_out0" },
+	{ "xusb_falcon_src",	"pll_p_out0" },
+	{ "xusb_ss_src",	"pll_u_480" },
+	{ "xusb_fs_src",	"pll_u_48" },
+};
+
 struct tegra124_car_rst {
 	u_int	set_reg;
 	u_int	clr_reg;
@@ -674,6 +688,8 @@ struct tegra124_car_softc {
 	bus_space_tag_t		sc_bst;
 	bus_space_handle_t	sc_bsh;
 
+	struct clk_domain	sc_clkdom;
+
 	u_int			sc_clock_cells;
 	u_int			sc_reset_cells;
 
@@ -684,6 +700,8 @@ struct tegra124_car_softc {
 static void	tegra124_car_init(struct tegra124_car_softc *);
 static void	tegra124_car_utmip_init(struct tegra124_car_softc *);
 static void	tegra124_car_xusb_init(struct tegra124_car_softc *);
+static void	tegra124_car_watchdog_init(struct tegra124_car_softc *);
+static void	tegra124_car_parent_init(struct tegra124_car_softc *);
 
 static void	tegra124_car_rnd_attach(device_t);
 static void	tegra124_car_rnd_callback(size_t, void *);
@@ -715,7 +733,7 @@ tegra124_car_attach(device_t parent, dev
 	const int phandle = faa->faa_phandle;
 	bus_addr_t addr;
 	bus_size_t size;
-	int error;
+	int error, n;
 
 	if (fdtbus_get_reg(phandle, 0, &addr, &size) != 0) {
 		aprint_error(": couldn't get registers\n");
@@ -737,7 +755,10 @@ tegra124_car_attach(device_t parent, dev
 	aprint_naive("\n");
 	aprint_normal(": CAR\n");
 
-	clk_backend_register("tegra124", &tegra124_car_clock_funcs, sc);
+	sc->sc_clkdom.funcs = &tegra124_car_clock_funcs;
+	sc->sc_clkdom.priv = sc;
+	for (n = 0; n < __arraycount(tegra124_car_clocks); n++)
+		tegra124_car_clocks[n].base.domain = &sc->sc_clkdom;
 
 	fdtbus_register_clock_controller(self, phandle,
 	&tegra124_car_fdtclock_funcs);
@@ -752,8 +773,35 @@ tegra124_car_attach(device_t parent, dev
 static void
 tegra124_car_init(struct tegra124_car_softc *sc)
 {
+	tegra124_car_parent_init(sc);
 	tegra124_car_utmip_init(sc);
 	tegra124_car_xusb_init(sc);
+	tegra124_car_watchdog_init(sc);
+}
+
+static void
+tegra124_car_parent_init(struct tegra124_car_softc *sc)
+{
+	struct clk *clk, *clk_parent;
+	int error;
+	u_int n;
+
+	for (n = 0; n < __arraycount(tegra124_init_parents); n++) {
+		clk = clk_get(&sc->sc_clkdom, tegra124_init_parents[n].clock);
+		KASSERT(clk != NULL);
+		clk_parent = clk_get(&sc->sc_clkdom,
+		tegra124_init_parents[n].parent);
+		KASSERT(clk_parent != NULL);
+
+		error = clk_set_

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

2017-04-16 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Apr 16 12:27:47 UTC 2017

Modified Files:
src/sys/arch/arm/nvidia: tegra_fdt.c

Log Message:
Remove list of init devices


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/nvidia/tegra_fdt.c

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

Modified files:

Index: src/sys/arch/arm/nvidia/tegra_fdt.c
diff -u src/sys/arch/arm/nvidia/tegra_fdt.c:1.3 src/sys/arch/arm/nvidia/tegra_fdt.c:1.4
--- src/sys/arch/arm/nvidia/tegra_fdt.c:1.3	Sat Apr 15 00:35:12 2017
+++ src/sys/arch/arm/nvidia/tegra_fdt.c	Sun Apr 16 12:27:47 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: tegra_fdt.c,v 1.3 2017/04/15 00:35:12 jmcneill Exp $ */
+/* $NetBSD: tegra_fdt.c,v 1.4 2017/04/16 12:27:47 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill 
@@ -29,7 +29,7 @@
 #include "opt_tegra.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: tegra_fdt.c,v 1.3 2017/04/15 00:35:12 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tegra_fdt.c,v 1.4 2017/04/16 12:27:47 jmcneill Exp $");
 
 #include 
 #include 
@@ -64,32 +64,6 @@ tegrafdt_match(device_t parent, cfdata_t
 void
 tegrafdt_attach(device_t parent, device_t self, void *aux)
 {
-	const char *tegrafdt_init[] = {
-		/* interrupt controllers */
-		"nvidia,tegra124-ictlr",
-		"arm,cortex-a15-gic",
-		/* clocks */
-		"nvidia,tegra124-car",
-		"nvidia,tegra124-dfll",
-		/* pinmux */
-		"nvidia,tegra124-pinmux",
-		"nvidia,tegra124-gpio",
-		/* regulators */
-		"regulator-fixed",
-		/* fuse */
-		"nvidia,tegra124-efuse",
-		/* dma */
-		"nvidia,tegra124-apbdma",
-		/* pmc */
-		"nvidia,tegra124-pmc",
-		/* memory controller */
-		"nvidia,tegra124-mc",
-		/* i2c */
-		"nvidia,tegra124-i2c",
-		/* usb phy */
-		"nvidia,tegra124-usb-phy",
-	};
-
 	tegrafdt_found = true;
 
 	aprint_naive("\n");
@@ -101,8 +75,6 @@ tegrafdt_attach(device_t parent, device_
 		.faa_a4x_bst = &armv7_generic_a4x_bs_tag,
 		.faa_dmat = &tegra_dma_tag,
 		.faa_phandle = OF_peer(0),
-		.faa_init = tegrafdt_init,
-		.faa_ninit = __arraycount(tegrafdt_init)
 	};
 	config_found(self, &faa, NULL);
 



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

2017-04-16 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Apr 16 12:26:04 UTC 2017

Modified Files:
src/sys/arch/arm/nvidia: soc_tegra124.c

Log Message:
get cpu pll clock from devicetree


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/arm/nvidia/soc_tegra124.c

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

Modified files:

Index: src/sys/arch/arm/nvidia/soc_tegra124.c
diff -u src/sys/arch/arm/nvidia/soc_tegra124.c:1.13 src/sys/arch/arm/nvidia/soc_tegra124.c:1.14
--- src/sys/arch/arm/nvidia/soc_tegra124.c:1.13	Thu Apr 13 21:20:44 2017
+++ src/sys/arch/arm/nvidia/soc_tegra124.c	Sun Apr 16 12:26:04 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: soc_tegra124.c,v 1.13 2017/04/13 21:20:44 jmcneill Exp $ */
+/* $NetBSD: soc_tegra124.c,v 1.14 2017/04/16 12:26:04 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill 
@@ -30,7 +30,7 @@
 #include "opt_multiprocessor.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: soc_tegra124.c,v 1.13 2017/04/13 21:20:44 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: soc_tegra124.c,v 1.14 2017/04/16 12:26:04 jmcneill Exp $");
 
 #include 
 #include 
@@ -116,14 +116,14 @@ static struct clk *tegra124_clk_pllx = N
 void
 tegra124_cpuinit(void)
 {
-	int node = OF_finddevice("/i2c@7000d000");
-	if (node == -1)
-		node = OF_finddevice("/i2c@0,7000d000"); /* old DTB */
-	if (node == -1) {
+	int i2c_node = OF_finddevice("/i2c@7000d000");
+	if (i2c_node == -1)
+		i2c_node = OF_finddevice("/i2c@0,7000d000"); /* old DTB */
+	if (i2c_node == -1) {
 		aprint_error("cpufreq: ERROR: couldn't find i2c@7000d000\n");
 		return;
 	}
-	i2c_tag_t ic = fdtbus_get_i2c_tag(node);
+	i2c_tag_t ic = fdtbus_get_i2c_tag(i2c_node);
 
 	/* Set VDD_CPU voltage to 1.4V */
 	const u_int target_mv = 1400;
@@ -143,7 +143,9 @@ tegra124_cpuinit(void)
 
 	tegra124_speedo_init();
 
-	tegra124_clk_pllx = clk_get("pll_x");
+	int cpu_node = OF_finddevice("/cpus/cpu@0");
+	if (cpu_node != -1)
+		tegra124_clk_pllx = fdtbus_clock_get(cpu_node, "pll_x");
 	if (tegra124_clk_pllx == NULL) {
 		aprint_error("cpufreq: ERROR: couldn't find pll_x\n");
 		return;



CVS commit: src/sys/dev/fdt

2017-04-16 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Apr 16 12:24:57 UTC 2017

Modified Files:
src/sys/dev/fdt: fdtbus.c fdtvar.h

Log Message:
Attach devices in order of "phandle" property inserted by DTC.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/dev/fdt/fdtbus.c
cvs rdiff -u -r1.8 -r1.9 src/sys/dev/fdt/fdtvar.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/fdt/fdtbus.c
diff -u src/sys/dev/fdt/fdtbus.c:1.7 src/sys/dev/fdt/fdtbus.c:1.8
--- src/sys/dev/fdt/fdtbus.c:1.7	Sat Apr 15 00:34:29 2017
+++ src/sys/dev/fdt/fdtbus.c	Sun Apr 16 12:24:57 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: fdtbus.c,v 1.7 2017/04/15 00:34:29 jmcneill Exp $ */
+/* $NetBSD: fdtbus.c,v 1.8 2017/04/16 12:24:57 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: fdtbus.c,v 1.7 2017/04/15 00:34:29 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fdtbus.c,v 1.8 2017/04/16 12:24:57 jmcneill Exp $");
 
 #include 
 #include 
@@ -43,24 +43,33 @@ __KERNEL_RCSID(0, "$NetBSD: fdtbus.c,v 1
 #define	FDT_MAX_PATH	256
 
 struct fdt_node {
+	device_t	n_bus;
 	device_t	n_dev;
 	int		n_phandle;
 	char		*n_name;
 
+	u_int		n_order;
+
 	TAILQ_ENTRY(fdt_node) n_nodes;
 };
 
+static TAILQ_HEAD(, fdt_node) fdt_nodes =
+TAILQ_HEAD_INITIALIZER(fdt_nodes);
+
 struct fdt_softc {
 	device_t	sc_dev;
 	int		sc_phandle;
 	struct fdt_attach_args sc_faa;
-
-	TAILQ_HEAD(, fdt_node) sc_nodes;
 };
 
 static int	fdt_match(device_t, cfdata_t, void *);
 static void	fdt_attach(device_t, device_t, void *);
-static void	fdt_scan(struct fdt_softc *, const char *, bool);
+static void	fdt_scan_bus(struct fdt_softc *);
+static void	fdt_scan(struct fdt_softc *);
+static void	fdt_add_node(struct fdt_node *);
+static u_int	fdt_get_order(int);
+
+static int	fdt_print(void *, const char *);
 
 static const char * const fdtbus_compatible[] =
 { "simple-bus", NULL };
@@ -68,17 +77,12 @@ static const char * const fdtbus_compati
 CFATTACH_DECL_NEW(fdt, sizeof(struct fdt_softc),
 fdt_match, fdt_attach, NULL, NULL);
 
-static int	fdt_print(void *, const char *);
-
 static int
 fdt_match(device_t parent, cfdata_t cf, void *aux)
 {
 	const struct fdt_attach_args *faa = aux;
 	int match;
 
-	if (!OF_child(faa->faa_phandle))
-		return 0;
-
 	match = of_match_compatible(faa->faa_phandle, fdtbus_compatible);
 	if (match)
 		return match;
@@ -94,12 +98,11 @@ fdt_attach(device_t parent, device_t sel
 	const int phandle = faa->faa_phandle;
 	struct fdt_node *node;
 	char *model, *name, *status;
-	int len, n, child;
+	int len, child;
 
 	sc->sc_dev = self;
-	sc->sc_phandle = faa->faa_phandle;
+	sc->sc_phandle = phandle;
 	sc->sc_faa = *faa;
-	TAILQ_INIT(&sc->sc_nodes);
 
 	aprint_naive("\n");
 	len = OF_getproplen(phandle, "model");
@@ -141,71 +144,111 @@ fdt_attach(device_t parent, device_t sel
 
 		/* Add the node to our device list */
 		node = kmem_alloc(sizeof(*node), KM_SLEEP);
+		node->n_bus = self;
 		node->n_dev = NULL;
 		node->n_phandle = child;
 		node->n_name = name;
-		TAILQ_INSERT_TAIL(&sc->sc_nodes, node, n_nodes);
+		node->n_order = fdt_get_order(node->n_phandle);
+		fdt_add_node(node);
 	}
 
 	/* Scan and attach all known busses in the tree. */
-	for (n = 0; fdtbus_compatible[n] != NULL; n++)
-		fdt_scan(sc, fdtbus_compatible[n], true);
+	fdt_scan_bus(sc);
 
 	/* Only the root bus should scan for devices */
 	if (OF_finddevice("/") != faa->faa_phandle)
 		return;
 
-	/* Scan the tree for "early init" devices */
-	for (n = 0; n < faa->faa_ninit; n++)
-		fdt_scan(sc, faa->faa_init[n], false);
+	/* Scan devices */
+	fdt_scan(sc);
+}
 
-	/* Finally, scan the tree for all other devices */
-	fdt_scan(sc, NULL, false);
+static void
+fdt_init_attach_args(struct fdt_softc *sc, struct fdt_node *node,
+struct fdt_attach_args *faa)
+{
+	*faa = sc->sc_faa;
+	faa->faa_phandle = node->n_phandle;
+	faa->faa_name = node->n_name;
 }
 
 static void
-fdt_scan(struct fdt_softc *sc, const char *compat, bool bus)
+fdt_scan_bus(struct fdt_softc *sc)
 {
 	struct fdt_node *node;
 	struct fdt_attach_args faa;
 	cfdata_t cf;
 
-	TAILQ_FOREACH(node, &sc->sc_nodes, n_nodes) {
-		if (node->n_dev != NULL) {
-			/*
-			 * Child is already attached. If it is a bus,
-			 * recursively scan.
-			 */
-			if (device_is_a(node->n_dev, "fdt"))
-fdt_scan(device_private(node->n_dev), compat,
-bus);
+	TAILQ_FOREACH(node, &fdt_nodes, n_nodes) {
+		if (node->n_bus != sc->sc_dev)
+			continue;
+		if (node->n_dev != NULL)
 			continue;
-		}
 
-		faa = sc->sc_faa;
-		faa.faa_phandle = node->n_phandle;
-		faa.faa_name = node->n_name;
+		fdt_init_attach_args(sc, node, &faa);
 
 		/*
 		 * Only attach busses to nodes where this driver is the best
 		 * match.
 		 */
-		if (compat && bus) {
-			cf = config_search_loc(NULL, sc->sc_dev, NULL, NULL,
-			&faa);
-			if (cf == NULL || strcmp

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

2017-04-16 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Apr 16 12:22:18 UTC 2017

Modified Files:
src/sys/arch/arm/nvidia: tegra_drm_mode.c

Log Message:
Get DC clock parent from devicetree


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

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

Modified files:

Index: src/sys/arch/arm/nvidia/tegra_drm_mode.c
diff -u src/sys/arch/arm/nvidia/tegra_drm_mode.c:1.12 src/sys/arch/arm/nvidia/tegra_drm_mode.c:1.13
--- src/sys/arch/arm/nvidia/tegra_drm_mode.c:1.12	Wed Dec 23 11:58:10 2015
+++ src/sys/arch/arm/nvidia/tegra_drm_mode.c	Sun Apr 16 12:22:18 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: tegra_drm_mode.c,v 1.12 2015/12/23 11:58:10 jmcneill Exp $ */
+/* $NetBSD: tegra_drm_mode.c,v 1.13 2017/04/16 12:22:18 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: tegra_drm_mode.c,v 1.12 2015/12/23 11:58:10 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tegra_drm_mode.c,v 1.13 2017/04/16 12:22:18 jmcneill Exp $");
 
 #include 
 #include 
@@ -284,7 +284,6 @@ tegra_crtc_init(struct drm_device *ddev,
 {
 	struct tegra_drm_softc * const sc = tegra_drm_private(ddev);
 	struct tegra_crtc *crtc;
-	struct clk *clk_parent;
 	bus_addr_t offset;
 	bus_size_t size;
 	u_int intr;
@@ -346,12 +345,8 @@ tegra_crtc_init(struct drm_device *ddev,
 	tegra_pmc_remove_clamping(pmc_partid);
 
 	/* Set parent clock */
-	clk_parent = clk_get("pll_d2_out0");
-	if (clk_parent == NULL) {
-		DRM_ERROR("couldn't find pll_d2_out0\n");
-		return -EIO;
-	}
-	error = clk_set_parent(sc->sc_clk_dc[index], clk_parent);
+	error = clk_set_parent(sc->sc_clk_dc[index],
+	sc->sc_clk_dc_parent[index]);
 	if (error) {
 		DRM_ERROR("failed to set crtc %d clock parent: %d\n",
 		index, error);
@@ -368,7 +363,7 @@ tegra_crtc_init(struct drm_device *ddev,
 	/* Leave reset */
 	fdtbus_reset_deassert(sc->sc_rst_dc[index]);
 
-	crtc->clk_parent = clk_parent;
+	crtc->clk_parent = sc->sc_clk_dc_parent[index];
 
 	DC_WRITE(crtc, DC_CMD_INT_ENABLE_REG, DC_CMD_INT_V_BLANK);
 



CVS commit: src/tests/lib/libc/sys

2017-04-16 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Sun Apr 16 12:03:26 UTC 2017

Modified Files:
src/tests/lib/libc/sys: t_ptrace_wait.c

Log Message:
Restore atf_tc_expect_fail in signal4 of t_ptrace_wait*

Accidentally there was removed a PR, it was never fixed.

PR 51918 "ptrace tracee can prevent tracer to get its signals by masking"


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/tests/lib/libc/sys/t_ptrace_wait.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/libc/sys/t_ptrace_wait.c
diff -u src/tests/lib/libc/sys/t_ptrace_wait.c:1.4 src/tests/lib/libc/sys/t_ptrace_wait.c:1.5
--- src/tests/lib/libc/sys/t_ptrace_wait.c:1.4	Wed Apr 12 18:18:00 2017
+++ src/tests/lib/libc/sys/t_ptrace_wait.c	Sun Apr 16 12:03:25 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_ptrace_wait.c,v 1.4 2017/04/12 18:18:00 kamil Exp $	*/
+/*	$NetBSD: t_ptrace_wait.c,v 1.5 2017/04/16 12:03:25 kamil Exp $	*/
 
 /*-
  * Copyright (c) 2016 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: t_ptrace_wait.c,v 1.4 2017/04/12 18:18:00 kamil Exp $");
+__RCSID("$NetBSD: t_ptrace_wait.c,v 1.5 2017/04/16 12:03:25 kamil Exp $");
 
 #include 
 #include 
@@ -5832,7 +5832,10 @@ ATF_TC_BODY(signal4, tc)
 	int happy;
 
 #if defined(__arm__)
-	atf_tc_expect_fail("PR kern/52119");
+	/* PT_STEP not supported on arm 32-bit */
+	atf_tc_expect_fail("PR kern/51918 PR kern/52119");
+#else
+	atf_tc_expect_fail("PR kern/52118");
 #endif
 
 	printf("Before forking process PID=%d\n", getpid());



CVS commit: src/tests/net/ipsec

2017-04-16 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Sun Apr 16 10:34:49 UTC 2017

Modified Files:
src/tests/net/ipsec: t_ipsec_tunnel.sh

Log Message:
Revert "Mark tests of tunnel/AH/IPv6 as expected failure (PR kern/52161)"

The issue was fixed by christos@


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/net/ipsec/t_ipsec_tunnel.sh

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

Modified files:

Index: src/tests/net/ipsec/t_ipsec_tunnel.sh
diff -u src/tests/net/ipsec/t_ipsec_tunnel.sh:1.2 src/tests/net/ipsec/t_ipsec_tunnel.sh:1.3
--- src/tests/net/ipsec/t_ipsec_tunnel.sh:1.2	Fri Apr 14 03:35:40 2017
+++ src/tests/net/ipsec/t_ipsec_tunnel.sh	Sun Apr 16 10:34:49 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: t_ipsec_tunnel.sh,v 1.2 2017/04/14 03:35:40 ozaki-r Exp $
+#	$NetBSD: t_ipsec_tunnel.sh,v 1.3 2017/04/16 10:34:49 ozaki-r Exp $
 #
 # Copyright (c) 2017 Internet Initiative Japan Inc.
 # All rights reserved.
@@ -312,15 +312,11 @@ add_test_tunnel_mode()
 	local ipproto=$1
 	local proto=$2
 	local algo=$3
-	local expected_failure=$4
 	local _algo=$(echo $algo | sed 's/-//g')
-	local name= desc= expected_failure_code=
+	local name= desc=
 
 	name="ipsec_tunnel_${ipproto}_${proto}_${_algo}"
 	desc="Tests of IPsec ($ipproto) tunnel mode with $proto ($algo)"
-	if [ "$expected_failure" = yes ]; then
-		expected_failure_code="atf_expect_fail 'PR kern/52161';"
-	fi
 
 	atf_test_case ${name} cleanup
 	eval "\
@@ -329,7 +325,6 @@ add_test_tunnel_mode()
 	atf_set \"require.progs\" \"rump_server\" \"setkey\";	\
 	};\
 	${name}_body() {		\
-	$expected_failure_code	\
 	test_tunnel_common $ipproto $proto $algo;		\
 	rump_server_destroy_ifaces;\
 	};\
@@ -352,10 +347,6 @@ atf_init_test_cases()
 
 	for algo in $AH_AUTHENTICATION_ALGORITHMS; do
 		add_test_tunnel_mode ipv4 ah $algo
-		if [ $algo = null ]; then
-			add_test_tunnel_mode ipv6 ah $algo
-		else
-			add_test_tunnel_mode ipv6 ah $algo yes
-		fi
+		add_test_tunnel_mode ipv6 ah $algo
 	done
 }



CVS commit: src/share/man/man9

2017-04-16 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sun Apr 16 07:05:24 UTC 2017

Modified Files:
src/share/man/man9: locking.9

Log Message:
Wording.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/share/man/man9/locking.9

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/man9/locking.9
diff -u src/share/man/man9/locking.9:1.4 src/share/man/man9/locking.9:1.5
--- src/share/man/man9/locking.9:1.4	Sat Apr 15 18:00:32 2017
+++ src/share/man/man9/locking.9	Sun Apr 16 07:05:24 2017
@@ -1,4 +1,4 @@
-.\"	$NetBSD: locking.9,v 1.4 2017/04/15 18:00:32 sevan Exp $
+.\"	$NetBSD: locking.9,v 1.5 2017/04/16 07:05:24 wiz Exp $
 .\"
 .\" Copyright (c) 2015 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -32,7 +32,7 @@
 .Os
 .Sh NAME
 .Nm locking
-.Nd introduction to the kernel synchronization and interrupt control
+.Nd introduction to kernel synchronization and interrupt control
 .Sh DESCRIPTION
 The
 .Nx
@@ -67,12 +67,12 @@ kernel:
 and light-weight processes (represented by
 .Dv struct lwp ,
 also known as kernel threads).
-Code in this context can sleep, block resources and possess address-space.
+Code in this context can sleep, block resources and own address-space.
 .It
 .Em Software interrupt context
 - limited by thread context.
 Code in this context must be processed shortly.
-These interrupts don't possess any address space context.
+These interrupts don't own any address space context.
 Software interrupts are a way of deferring hardware interrupts to do more
 expensive processing at a lower interrupt priority.
 .It
@@ -86,7 +86,7 @@ The main differences between processes a
 .It
 A single process can own multiple kernel threads (LWPs).
 .It
-A process possesses address space context to map userland address space.
+A process owns address space context to map userland address space.
 .It
 Processes are designed for userland executables and kernel threads for
 in-kernel tasks.