CVS commit: src

2017-02-22 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Thu Feb 23 07:57:10 UTC 2017

Modified Files:
src/sys/net: if.c if.h
src/sys/netinet6: in6.c in6_ifattach.c in6_var.h mld6.c
src/sys/netipsec: key.c
src/usr.bin/netstat: if.c
src/usr.sbin/ifmcstat: ifmcstat.c

Log Message:
Remove mkludge stuffs

For unknown reasons, IPv6 multicast addresses are linked to a first
IPv6 address assigned to an interface. Due to the design, when removing
a first address having multicast addresses, we need to save them to
somewhere and later restore them once a new IPv6 address is activated.
mkludge stuffs support the operations.

This change links multicast addresses to an interface directly and
throws the kludge away.

Note that as usual some obsolete member variables remain for kvm(3)
users. And also sysctl net.inet6.multicast_kludge remains to avoid
breaking old ifmcstat.

TODO: currently ifnet has a list of in6_multi but obviously the list
should be protocol independent. Provide a common structure (if_multi
or something) to handle in6_multi and in_multi together as well as
ifaddr does for in_ifaddr and in6_ifaddr.


To generate a diff of this commit:
cvs rdiff -u -r1.380 -r1.381 src/sys/net/if.c
cvs rdiff -u -r1.234 -r1.235 src/sys/net/if.h
cvs rdiff -u -r1.237 -r1.238 src/sys/netinet6/in6.c
cvs rdiff -u -r1.111 -r1.112 src/sys/netinet6/in6_ifattach.c
cvs rdiff -u -r1.92 -r1.93 src/sys/netinet6/in6_var.h
cvs rdiff -u -r1.82 -r1.83 src/sys/netinet6/mld6.c
cvs rdiff -u -r1.102 -r1.103 src/sys/netipsec/key.c
cvs rdiff -u -r1.93 -r1.94 src/usr.bin/netstat/if.c
cvs rdiff -u -r1.20 -r1.21 src/usr.sbin/ifmcstat/ifmcstat.c

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

Modified files:

Index: src/sys/net/if.c
diff -u src/sys/net/if.c:1.380 src/sys/net/if.c:1.381
--- src/sys/net/if.c:1.380	Fri Feb 17 03:57:17 2017
+++ src/sys/net/if.c	Thu Feb 23 07:57:10 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: if.c,v 1.380 2017/02/17 03:57:17 ozaki-r Exp $	*/
+/*	$NetBSD: if.c,v 1.381 2017/02/23 07:57:10 ozaki-r Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2008 The NetBSD Foundation, Inc.
@@ -90,7 +90,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.380 2017/02/17 03:57:17 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.381 2017/02/23 07:57:10 ozaki-r Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_inet.h"
@@ -720,6 +720,7 @@ if_initialize(ifnet_t *ifp)
 	PSLIST_INIT(>if_addr_pslist);
 	psref_target_init(>if_psref, ifnet_psref_class);
 	ifp->if_ioctl_lock = mutex_obj_alloc(MUTEX_DEFAULT, IPL_NONE);
+	LIST_INIT(>if_multiaddrs);
 
 	IFNET_LOCK();
 	if_getindex(ifp);

Index: src/sys/net/if.h
diff -u src/sys/net/if.h:1.234 src/sys/net/if.h:1.235
--- src/sys/net/if.h:1.234	Fri Feb 17 03:57:17 2017
+++ src/sys/net/if.h	Thu Feb 23 07:57:10 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: if.h,v 1.234 2017/02/17 03:57:17 ozaki-r Exp $	*/
+/*	$NetBSD: if.h,v 1.235 2017/02/23 07:57:10 ozaki-r Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2001 The NetBSD Foundation, Inc.
@@ -231,6 +231,7 @@ struct callout;
 struct krwlock;
 struct if_percpuq;
 struct if_deferred_start;
+struct in6_multi;
 
 typedef unsigned short if_index_t;
 
@@ -344,6 +345,8 @@ typedef struct ifnet {
 	struct psref_target if_psref;
 	struct pslist_head	if_addr_pslist;
 	struct if_deferred_start	*if_deferred_start;
+	/* XXX should be protocol independent */
+	LIST_HEAD(, in6_multi) if_multiaddrs;
 #endif
 } ifnet_t;
  

Index: src/sys/netinet6/in6.c
diff -u src/sys/netinet6/in6.c:1.237 src/sys/netinet6/in6.c:1.238
--- src/sys/netinet6/in6.c:1.237	Mon Jan 23 10:19:03 2017
+++ src/sys/netinet6/in6.c	Thu Feb 23 07:57:10 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: in6.c,v 1.237 2017/01/23 10:19:03 ozaki-r Exp $	*/
+/*	$NetBSD: in6.c,v 1.238 2017/02/23 07:57:10 ozaki-r Exp $	*/
 /*	$KAME: in6.c,v 1.198 2001/07/18 09:12:38 itojun Exp $	*/
 
 /*
@@ -62,7 +62,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: in6.c,v 1.237 2017/01/23 10:19:03 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: in6.c,v 1.238 2017/02/23 07:57:10 ozaki-r Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -1370,23 +1370,6 @@ in6_unlink_ifa(struct in6_ifaddr *ia, st
 	mutex_exit(_ifaddr_lock);
 
 	/*
-	 * XXX thor...@netbsd.org -- if the interface is going
-	 * XXX away, don't save the multicast entries, delete them!
-	 */
-	if (LIST_EMPTY(>ia6_multiaddrs))
-		;
-	else if (if_is_deactivated(ia->ia_ifa.ifa_ifp)) {
-		struct in6_multi *in6m, *next;
-
-		for (in6m = LIST_FIRST(>ia6_multiaddrs); in6m != NULL;
-		 in6m = next) {
-			next = LIST_NEXT(in6m, in6m_entry);
-			in6_delmulti(in6m);
-		}
-	} else
-		in6_savemkludge(ia);
-
-	/*
 	 * Release the reference to the ND prefix.
 	 */
 	if (ia->ia6_ndpr != NULL) {
@@ -1754,9 +1737,6 @@ in6_ifinit(struct ifnet *ifp, struct in6
 		return error;
 	}
 
-	if (ifp->if_flags & IFF_MULTICAST)
-		in6_restoremkludge(ia, ifp);
-
 	return error;
 }
 

Index: 

CVS commit: src/lib/libc/sys

2017-02-22 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Thu Feb 23 05:48:14 UTC 2017

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

Log Message:
Document PT_GETDBREGS and PT_SETDBRGS in ptrace(2)

Not this interface in MD part.
Explain design choices.

Sponsored by 


To generate a diff of this commit:
cvs rdiff -u -r1.60 -r1.61 src/lib/libc/sys/ptrace.2

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

Modified files:

Index: src/lib/libc/sys/ptrace.2
diff -u src/lib/libc/sys/ptrace.2:1.60 src/lib/libc/sys/ptrace.2:1.61
--- src/lib/libc/sys/ptrace.2:1.60	Wed Feb 22 23:43:43 2017
+++ src/lib/libc/sys/ptrace.2	Thu Feb 23 05:48:14 2017
@@ -1,7 +1,7 @@
-.\"	$NetBSD: ptrace.2,v 1.60 2017/02/22 23:43:43 kamil Exp $
+.\"	$NetBSD: ptrace.2,v 1.61 2017/02/23 05:48:14 kamil Exp $
 .\"
 .\" This file is in the public domain.
-.Dd February 12, 2016
+.Dd February 23, 2017
 .Dt PTRACE 2
 .Os
 .Sh NAME
@@ -90,7 +90,8 @@ with
 .Dv si_code
 set to
 .Dv TRAP_TRACE .
-This event is always enabled and cannot be disabled.
+This event is not maskable
+.Dv PT_SET_EVENT_MASK .
 .Pp
 Child program traps are reported with
 .Dv SIGTRAP
@@ -105,6 +106,46 @@ check with
 .Dv PT_GET_PROCESS_STATE
 the details of the process state associated with this event.
 .Pp
+Design choices for Debug Register accessors
+.Bl -dash
+.It
+.Dv exec()
+(
+.Dv TRAP_EXEC
+event ) must remove debug registers from LWP
+.It
+debug registers are only per-LWP, not per-process globally
+.It
+debug registers must not be inherited after (v)forking a process
+.It
+debug registers must not be inherited after forking a thread
+.It
+a debugger is responsible to set global watchpoints/breakpoints with the
+debug registers,
+to achieve this
+.Dv PTRACE_LWP_CREATE
+/
+.Dv PTRACE_LWP_EXIT
+event monitoring function is designed to be used
+.It
+debug register traps must generate
+.Dv SIGTRAP with
+.Dv si_code
+.Dv TRAP_DBREG
+.It
+debugger is responsible to retrieve debug register state to distinguish
+the exact debug register trap
+.It
+kernel must not remove debug register traps after triggering a trap event;
+a debugger is responsible to detach this trap with appropriate
+.Dv PT_SETDBREGS
+call
+.It
+debug registers must not be exposed in mcontext
+.It
+userland must not be allowed to set a trap on the kernel
+.El
+.Pp
 A debugger might reuse a port specific symbols,
 to help writing portable code as described in the port specific part of the
 .In sys/ptrace.h
@@ -641,6 +682,33 @@ The
 argument contains the LWP ID of the thread whose registers are to
 be written.
 If zero is supplied, the first thread of the process is written.
+.It Dv PT_GETDBREGS
+This request reads the traced process' debug registers into
+the
+.Dq Li "struct dbreg"
+(defined in
+.In machine/reg.h )
+pointed to by
+.Fa addr .
+The
+.Fa data
+argument contains the LWP ID of the thread whose registers are to
+be read.
+If zero is supplied, the first thread of the process is read.
+.It Dv PT_SETDBREGS
+This request is the converse of
+.Dv PT_GETDBREGS ;
+it loads the traced process' debug registers from the
+.Dq Li "struct dbreg"
+(defined in
+.In machine/reg.h )
+pointed to by
+.Fa addr .
+The
+.Fa data
+argument contains the LWP ID of the thread whose registers are to
+be written.
+If zero is supplied, the first thread of the process is written.
 .It Dv PT_GETXMMREGS
 This request reads the traced process' XMM registers into
 the



CVS commit: src/share/misc

2017-02-22 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Thu Feb 23 05:04:14 UTC 2017

Modified Files:
src/share/misc: acronyms.comp

Log Message:
Add SSA to wtf(6)

SSAstatic single assignment

Fix position of AMP.


To generate a diff of this commit:
cvs rdiff -u -r1.174 -r1.175 src/share/misc/acronyms.comp

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

Modified files:

Index: src/share/misc/acronyms.comp
diff -u src/share/misc/acronyms.comp:1.174 src/share/misc/acronyms.comp:1.175
--- src/share/misc/acronyms.comp:1.174	Thu Jan 26 19:00:13 2017
+++ src/share/misc/acronyms.comp	Thu Feb 23 05:04:14 2017
@@ -1,4 +1,4 @@
-$NetBSD: acronyms.comp,v 1.174 2017/01/26 19:00:13 ginsbach Exp $
+$NetBSD: acronyms.comp,v 1.175 2017/02/23 05:04:14 kamil Exp $
 3WHS	three-way handshake
 8VSB	8-state vestigial side band modulation
 AA	anti-aliasing
@@ -42,8 +42,8 @@ AM	access method
 AM	alignment mask
 AM	amplitude modulation
 AMI	alternate mark inversion
-AMQP	advanced message queuing protocol
 AMP	asymmetric multiprocessing
+AMQP	advanced message queuing protocol
 AMT	active management technology
 AN	Arabic number
 ANSI	American National Standards Institute
@@ -1219,6 +1219,7 @@ SRAM	static random access memory
 SRC	sample rate conversion
 SS	self-snoop
 SS	stack segment
+SSA	static single assignment
 SSAP	source service access point
 SSB	single-sideband modulation
 SSD	solid state drive



CVS commit: src/sys/kern

2017-02-22 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Thu Feb 23 04:48:36 UTC 2017

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

Log Message:
Fix build of ports without PT_STEP

Fallout after PT_*DBREGS introduction.

Sponsored by 


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/kern/sys_ptrace_common.c

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

Modified files:

Index: src/sys/kern/sys_ptrace_common.c
diff -u src/sys/kern/sys_ptrace_common.c:1.17 src/sys/kern/sys_ptrace_common.c:1.18
--- src/sys/kern/sys_ptrace_common.c:1.17	Thu Feb 23 03:34:22 2017
+++ src/sys/kern/sys_ptrace_common.c	Thu Feb 23 04:48:36 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: sys_ptrace_common.c,v 1.17 2017/02/23 03:34:22 kamil Exp $	*/
+/*	$NetBSD: sys_ptrace_common.c,v 1.18 2017/02/23 04:48:36 kamil Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -118,7 +118,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sys_ptrace_common.c,v 1.17 2017/02/23 03:34:22 kamil Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sys_ptrace_common.c,v 1.18 2017/02/23 04:48:36 kamil Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ptrace.h"
@@ -297,9 +297,7 @@ do_ptrace(struct ptrace_methods *ptm, st
 {
 	struct proc *p = l->l_proc;
 	struct lwp *lt;
-#ifdef PT_STEP
 	struct lwp *lt2;
-#endif
 	struct proc *t;/* target process */
 	struct uio uio;
 	struct iovec iov;



CVS commit: src/sys/sys

2017-02-22 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Thu Feb 23 03:48:20 UTC 2017

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

Log Message:
Welcome to 7.99.62!

New ptrace(2) operations:
 - PT_RESUME
 - PT_SUSPEND
 - PT_SETDBREGS
 - PT_GETDBREGS

Sponsored by 


To generate a diff of this commit:
cvs rdiff -u -r1.528 -r1.529 src/sys/sys/param.h

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

Modified files:

Index: src/sys/sys/param.h
diff -u src/sys/sys/param.h:1.528 src/sys/sys/param.h:1.529
--- src/sys/sys/param.h:1.528	Wed Feb 22 09:50:13 2017
+++ src/sys/sys/param.h	Thu Feb 23 03:48:20 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: param.h,v 1.528 2017/02/22 09:50:13 hannken Exp $	*/
+/*	$NetBSD: param.h,v 1.529 2017/02/23 03:48:20 kamil Exp $	*/
 
 /*-
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -67,7 +67,7 @@
  *	2.99.9		(299000900)
  */
 
-#define	__NetBSD_Version__	799006100	/* NetBSD 7.99.61 */
+#define	__NetBSD_Version__	799006200	/* NetBSD 7.99.62 */
 
 #define __NetBSD_Prereq__(M,m,p) (M) * 1) + \
 (m) * 100) + (p) * 100) <= __NetBSD_Version__)



CVS commit: src

2017-02-22 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Thu Feb 23 03:34:23 UTC 2017

Modified Files:
src/distrib/sets/lists/comp: md.amd64 md.i386
src/sys/arch/amd64/amd64: machdep.c netbsd32_machdep.c
process_machdep.c trap.c
src/sys/arch/amd64/include: netbsd32_machdep.h pcb.h proc.h ptrace.h
reg.h userret.h
src/sys/arch/i386/i386: machdep.c process_machdep.c trap.c
src/sys/arch/i386/include: pcb.h proc.h ptrace.h reg.h userret.h
src/sys/arch/x86/include: dbregs.h
src/sys/arch/x86/x86: dbregs.c vm_machdep.c
src/sys/compat/netbsd32: netbsd32_ptrace.c
src/sys/kern: sys_ptrace.c sys_ptrace_common.c
src/sys/sys: proc.h ptrace.h

Log Message:
Introduce PT_GETDBREGS and PT_SETDBREGS in ptrace(2) on i386 and amd64

This interface is modeled after FreeBSD API with the usage.

This replaced previous watchpoint API. The previous one was introduced
recently in NetBSD-current and remove its spurs without any
backward-compatibility.

Design choices for Debug Register accessors:
 - exec() (TRAP_EXEC event) must remove debug registers from LWP
 - debug registers are only per-LWP, not per-process globally
 - debug registers must not be inherited after (v)forking a process
 - debug registers must not be inherited after forking a thread
 - a debugger is responsible to set global watchpoints/breakpoints with the
   debug registers, to achieve this PTRACE_LWP_CREATE/PTRACE_LWP_EXIT event
   monitoring function is designed to be used
 - debug register traps must generate SIGTRAP with si_code TRAP_DBREG
 - debugger is responsible to retrieve debug register state to distinguish
   the exact debug register trap (DR6 is Status Register on x86)
 - kernel must not remove debug register traps after triggering a trap event
   a debugger is responsible to detach this trap with appropriate PT_SETDBREGS
   call (DR7 is Control Register on x86)
 - debug registers must not be exposed in mcontext
 - userland must not be allowed to set a trap on the kernel

Implementation notes on i386 and amd64:
 - the initial state of debug register is retrieved on boot and this value is
   stored in a local copy (initdbregs), this value is used to initialize dbreg
   context after PT_GETDBREGS
 - struct dbregs is stored in pcb as a pointer and by default not initialized
 - reserved registers (DR4-DR5, DR9-DR15) are ignored

Further ideas:
 - restrict this interface with securelevel

Tested on real hardware i386 (Intel Pentium IV) and amd64 (Intel i7).

This commit enables 390 debug register ATF tests in kernel/arch/x86.
All tests are passing.

This commit does not cover netbsd32 compat code. Currently other interface
PT_GET_SIGINFO/PT_SET_SIGINFO is required in netbsd32 compat code in order to
validate reliably PT_GETDBREGS/PT_SETDBREGS.

This implementation does not cover FreeBSD specific defines in their
: DBREG_DR7_LOCAL_ENABLE, DBREG_DR7_GLOBAL_ENABLE, DBREG_DR7_LEN_1
etc. These values tend to be reinvented by each tracer on its own. GNU
Debugger (GDB) works with NetBSD debug registers after adding this patch:

--- gdb/amd64bsd-nat.c.orig 2016-02-10 03:19:39.0 +
+++ gdb/amd64bsd-nat.c
@@ -167,6 +167,10 @@ amd64bsd_target (void)

 #ifdef HAVE_PT_GETDBREGS

+#ifndef DBREG_DRX
+#defineDBREG_DRX(d,x)  ((d)->dr[(x)])
+#endif
+
 static unsigned long
 amd64bsd_dr_get (ptid_t ptid, int regnum)
 {

Another reason to stop introducing unpopular defines covering machine
specific register macros is that these value varies across generations of
the same CPU family.

GDB demo:
  (gdb) c
  Continuing.

  Watchpoint 2: traceme

  Old value = 0
  New value = 16
  main (argc=1, argv=0x7f7fff79fe30) at test.c:8
  8   printf("traceme=%d\n", traceme);

(Currently the GDB interface is not reliable due to NetBSD support bugs)

Sponsored by 


To generate a diff of this commit:
cvs rdiff -u -r1.242 -r1.243 src/distrib/sets/lists/comp/md.amd64
cvs rdiff -u -r1.162 -r1.163 src/distrib/sets/lists/comp/md.i386
cvs rdiff -u -r1.251 -r1.252 src/sys/arch/amd64/amd64/machdep.c
cvs rdiff -u -r1.103 -r1.104 src/sys/arch/amd64/amd64/netbsd32_machdep.c
cvs rdiff -u -r1.31 -r1.32 src/sys/arch/amd64/amd64/process_machdep.c
cvs rdiff -u -r1.91 -r1.92 src/sys/arch/amd64/amd64/trap.c
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/amd64/include/netbsd32_machdep.h
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/amd64/include/pcb.h
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/amd64/include/proc.h
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/amd64/include/ptrace.h \
src/sys/arch/amd64/include/reg.h
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/amd64/include/userret.h
cvs rdiff -u -r1.779 -r1.780 src/sys/arch/i386/i386/machdep.c
cvs rdiff -u -r1.88 -r1.89 src/sys/arch/i386/i386/process_machdep.c
cvs rdiff -u -r1.283 -r1.284 src/sys/arch/i386/i386/trap.c
cvs rdiff -u -r1.54 -r1.55 src/sys/arch/i386/include/pcb.h
cvs rdiff -u -r1.43 -r1.44 src/sys/arch/i386/include/proc.h
cvs rdiff 

CVS commit: src/tests/usr.bin/mixerctl

2017-02-22 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Thu Feb 23 02:28:10 UTC 2017

Modified Files:
src/tests/usr.bin/mixerctl: t_mixerctl.sh

Log Message:
Limit previous to the i386 qemu kernels, the tests work on amd64 and sparc
(which have some audio configured.)


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/usr.bin/mixerctl/t_mixerctl.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/usr.bin/mixerctl/t_mixerctl.sh
diff -u src/tests/usr.bin/mixerctl/t_mixerctl.sh:1.2 src/tests/usr.bin/mixerctl/t_mixerctl.sh:1.3
--- src/tests/usr.bin/mixerctl/t_mixerctl.sh:1.2	Thu Feb 23 02:09:24 2017
+++ src/tests/usr.bin/mixerctl/t_mixerctl.sh	Thu Feb 23 02:28:10 2017
@@ -1,15 +1,16 @@
-# $NetBSD: t_mixerctl.sh,v 1.2 2017/02/23 02:09:24 kre Exp $
+# $NetBSD: t_mixerctl.sh,v 1.3 2017/02/23 02:28:10 kre Exp $
 
 atf_test_case noargs_usage
 noargs_usage_head() {
 	atf_set "descr" "Ensure mixerctl(1) with no args prints a usage message"
 }
 noargs_usage_body() {
-if sysctl machdep.cpu_brand 2>/dev/null | grep QEMU >/dev/null 2>&1
+if sysctl machdep.cpu_brand 2>/dev/null | grep QEMU >/dev/null 2>&1 &&
+	test $(uname -m) = i386
 	then
 	# better would be for mixerctl to not open the device...
 	# but for now, it does.
-	atf_skip "ATF qemu kernel has no audio"
+	atf_skip "i386 ATF qemu kernel has no audio"
 	fi
 	atf_check -s exit:0 -o not-empty -e ignore \
 		mixerctl
@@ -20,9 +21,10 @@ showvalue_head() {
 	atf_set "descr" "Ensure mixerctl(1) can print the value for all variables"
 }
 showvalue_body() {
-if sysctl machdep.cpu_brand 2>/dev/null | grep QEMU >/dev/null 2>&1
+if sysctl machdep.cpu_brand 2>/dev/null | grep QEMU >/dev/null 2>&1 &&
+	test $(uname -m) = i386
 	then
-	atf_skip "ATF qemu kernel has no audio"
+	atf_skip "i386 ATF qemu kernel has no audio"
 	fi
 	for var in $(mixerctl -a | awk -F= '{print $1}'); do
 		atf_check -s exit:0 -e ignore -o match:"^${var}=" \
@@ -35,9 +37,10 @@ nflag_head() {
 	atf_set "descr" "Ensure 'mixerctl -n' actually suppresses some output"
 }
 nflag_body() {
-if sysctl machdep.cpu_brand 2>/dev/null | grep QEMU >/dev/null 2>&1
+if sysctl machdep.cpu_brand 2>/dev/null | grep QEMU >/dev/null 2>&1 &&
+	test $(uname -m) = i386
 	then
-	atf_skip "ATF qemu kernel has no audio"
+	atf_skip "i386 ATF qemu kernel has no audio"
 	fi
 	varname="$(mixerctl -a | sed -e 's/=.*//' -e q)"
 



CVS commit: src/tests/usr.bin/mixerctl

2017-02-22 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Thu Feb 23 02:09:24 UTC 2017

Modified Files:
src/tests/usr.bin/mixerctl: t_mixerctl.sh

Log Message:
Skip most of the mixerctl tests when running under QEMU (assumed to be for ATF)
as the kernel that runs them has no audio (and no mixers) configured.

The usage message test might be returned some day if /usr/bin/mixerctl
gets modified so it doesn't attempt to open the device (and error out)
in cases where the device isn't actually going to be used (and -d wasn't
given to set the device name explicitly).


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/usr.bin/mixerctl/t_mixerctl.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/usr.bin/mixerctl/t_mixerctl.sh
diff -u src/tests/usr.bin/mixerctl/t_mixerctl.sh:1.1 src/tests/usr.bin/mixerctl/t_mixerctl.sh:1.2
--- src/tests/usr.bin/mixerctl/t_mixerctl.sh:1.1	Mon Jan  2 15:40:09 2017
+++ src/tests/usr.bin/mixerctl/t_mixerctl.sh	Thu Feb 23 02:09:24 2017
@@ -1,10 +1,16 @@
-# $NetBSD: t_mixerctl.sh,v 1.1 2017/01/02 15:40:09 christos Exp $
+# $NetBSD: t_mixerctl.sh,v 1.2 2017/02/23 02:09:24 kre Exp $
 
 atf_test_case noargs_usage
 noargs_usage_head() {
 	atf_set "descr" "Ensure mixerctl(1) with no args prints a usage message"
 }
 noargs_usage_body() {
+if sysctl machdep.cpu_brand 2>/dev/null | grep QEMU >/dev/null 2>&1
+	then
+	# better would be for mixerctl to not open the device...
+	# but for now, it does.
+	atf_skip "ATF qemu kernel has no audio"
+	fi
 	atf_check -s exit:0 -o not-empty -e ignore \
 		mixerctl
 }
@@ -14,6 +20,10 @@ showvalue_head() {
 	atf_set "descr" "Ensure mixerctl(1) can print the value for all variables"
 }
 showvalue_body() {
+if sysctl machdep.cpu_brand 2>/dev/null | grep QEMU >/dev/null 2>&1
+	then
+	atf_skip "ATF qemu kernel has no audio"
+	fi
 	for var in $(mixerctl -a | awk -F= '{print $1}'); do
 		atf_check -s exit:0 -e ignore -o match:"^${var}=" \
 			mixerctl ${var}
@@ -25,7 +35,11 @@ nflag_head() {
 	atf_set "descr" "Ensure 'mixerctl -n' actually suppresses some output"
 }
 nflag_body() {
-	varname="$(mixerctl -a | head -1 | awk -F= '{print $1}')"
+if sysctl machdep.cpu_brand 2>/dev/null | grep QEMU >/dev/null 2>&1
+	then
+	atf_skip "ATF qemu kernel has no audio"
+	fi
+	varname="$(mixerctl -a | sed -e 's/=.*//' -e q)"
 
 	atf_check -s exit:0 -o match:"${varname}" -e ignore \
 		mixerctl ${varname}



CVS commit: src/include

2017-02-22 Thread Sean Cole
Module Name:src
Committed By:   scole
Date:   Thu Feb 23 02:06:12 UTC 2017

Modified Files:
src/include: fenv.h

Log Message:
Add fenv for ia64, imported from FreeBSD, compile tested only.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/include/fenv.h

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

Modified files:

Index: src/include/fenv.h
diff -u src/include/fenv.h:1.23 src/include/fenv.h:1.24
--- src/include/fenv.h:1.23	Thu Aug 25 12:12:59 2016
+++ src/include/fenv.h	Thu Feb 23 02:06:12 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: fenv.h,v 1.23 2016/08/25 12:12:59 christos Exp $	*/
+/*	$NetBSD: fenv.h,v 1.24 2017/02/23 02:06:12 scole Exp $	*/
 /*
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -30,6 +30,7 @@
 #include 
 
 #if !defined(__aarch64__) && !defined(__arm__) && !defined(__i386__) \
+&& !defined(__ia64__) \
 && !defined(__hppa__) && !defined(__powerpc__) && !defined(__mips__) \
 && !defined(__or1k__) && !defined(__riscv__) && !defined(__sparc__) \
 && !defined(__x86_64__) && !defined(__alpha__) && !defined(__sh__) \



CVS commit: src/lib/libm

2017-02-22 Thread Sean Cole
Module Name:src
Committed By:   scole
Date:   Thu Feb 23 02:05:30 UTC 2017

Modified Files:
src/lib/libm: Makefile
Added Files:
src/lib/libm/arch/ia64: fenv.c

Log Message:
Add fenv for ia64, imported from FreeBSD, compile tested only.


To generate a diff of this commit:
cvs rdiff -u -r1.187 -r1.188 src/lib/libm/Makefile
cvs rdiff -u -r0 -r1.1 src/lib/libm/arch/ia64/fenv.c

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

Modified files:

Index: src/lib/libm/Makefile
diff -u src/lib/libm/Makefile:1.187 src/lib/libm/Makefile:1.188
--- src/lib/libm/Makefile:1.187	Thu Dec  8 18:42:01 2016
+++ src/lib/libm/Makefile	Thu Feb 23 02:05:30 2017
@@ -1,4 +1,4 @@
-#  $NetBSD: Makefile,v 1.187 2016/12/08 18:42:01 christos Exp $
+#  $NetBSD: Makefile,v 1.188 2017/02/23 02:05:30 scole Exp $
 #
 #  @(#)Makefile 5.1beta 93/09/24
 #
@@ -77,6 +77,9 @@ COMMON_SRCS+= s_fma.c s_fmaf.c s_fmal.c
 .PATH.S: ${.CURDIR}/arch/arm
 ARCH_SRCS = e_sqrt.S e_sqrtf.S lrint.S lrintf.S s_fabsf.S s_fma.S s_fmaf.S
 .endif
+.elif (${LIBC_MACHINE_ARCH} == "ia64")
+.PATH: ${.CURDIR}/arch/ia64
+COMMON_SRCS += fenv.c
 .elif (${LIBC_MACHINE_ARCH} == "hppa")
 .PATH.c: ${.CURDIR}/arch/hppa
 COMMON_SRCS+= fenv.c s_nexttowardf.c \

Added files:

Index: src/lib/libm/arch/ia64/fenv.c
diff -u /dev/null src/lib/libm/arch/ia64/fenv.c:1.1
--- /dev/null	Thu Feb 23 02:05:30 2017
+++ src/lib/libm/arch/ia64/fenv.c	Thu Feb 23 02:05:30 2017
@@ -0,0 +1,69 @@
+/*	$NetBSD: fenv.c,v 1.1 2017/02/23 02:05:30 scole Exp $	*/
+
+/*-
+ * Copyright (c) 2004 David Schultz 
+ * 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 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 AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD: releng/10.1/lib/msun/ia64/fenv.c 226415 2011-10-16 05:37:56Z das $
+ */
+
+#include 
+__RCSID("$NetBSD: fenv.c,v 1.1 2017/02/23 02:05:30 scole Exp $");
+
+#define	__fenv_static
+#include "fenv.h"
+
+#if defined(__GNUC_GNU_INLINE__) && !defined(__lint__)
+#error "This file must be compiled with C99 'inline' semantics"
+#endif
+
+const fenv_t __fe_dfl_env = 0x0009804c8a70033fULL;
+
+extern inline int feclearexcept(int __excepts);
+extern inline int fegetexceptflag(fexcept_t *__flagp, int __excepts);
+extern inline int fesetexceptflag(const fexcept_t *__flagp, int __excepts);
+extern inline int feraiseexcept(int __excepts);
+extern inline int fetestexcept(int __excepts);
+extern inline int fegetround(void);
+extern inline int fesetround(int __round);
+extern inline int fegetenv(fenv_t *__envp);
+extern inline int feholdexcept(fenv_t *__envp);
+extern inline int fesetenv(const fenv_t *__envp);
+
+/*
+ * It doesn't pay to inline feupdateenv() because it includes one of
+ * the rare uses of feraiseexcept() where the argument is not a
+ * constant.  Thus, no dead code elimination can occur, resulting in
+ * significant bloat.
+ */
+int
+feupdateenv(const fenv_t *envp)
+{
+	fenv_t fpsr;
+
+	__stfpsr();
+	__ldfpsr(*envp);
+	feraiseexcept((fpsr >> _FPUSW_SHIFT) & FE_ALL_EXCEPT);
+	return (0);
+}



CVS commit: src/distrib/sets/lists/comp

2017-02-22 Thread Sean Cole
Module Name:src
Committed By:   scole
Date:   Thu Feb 23 02:04:11 UTC 2017

Modified Files:
src/distrib/sets/lists/comp: md.ia64

Log Message:
Add fenv.h for ia64, imported from FreeBSD, compile tested only.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/distrib/sets/lists/comp/md.ia64

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

Modified files:

Index: src/distrib/sets/lists/comp/md.ia64
diff -u src/distrib/sets/lists/comp/md.ia64:1.2 src/distrib/sets/lists/comp/md.ia64:1.3
--- src/distrib/sets/lists/comp/md.ia64:1.2	Thu Jan  5 13:45:51 2017
+++ src/distrib/sets/lists/comp/md.ia64	Thu Feb 23 02:04:11 2017
@@ -1,4 +1,4 @@
-# $NetBSD: md.ia64,v 1.2 2017/01/05 13:45:51 wiz Exp $
+# $NetBSD: md.ia64,v 1.3 2017/02/23 02:04:11 scole Exp $
 ./usr/include/gcc-4.8/ia64intrin.h	comp-obsolete			obsolete
 ./usr/include/gcc-4.8/tgmath.h		comp-obsolete			obsolete
 ./usr/include/gcc-5/ia64intrin.h	comp-c-include
@@ -21,6 +21,7 @@
 ./usr/include/ia64/elf_machdep.h	comp-c-include
 ./usr/include/ia64/endian.h		comp-c-include
 ./usr/include/ia64/endian_machdep.h	comp-c-include
+./usr/include/ia64/fenv.h		comp-c-include
 ./usr/include/ia64/float.h		comp-c-include
 ./usr/include/ia64/fpu.h		comp-c-include
 ./usr/include/ia64/frame.h		comp-c-include



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

2017-02-22 Thread Sean Cole
Module Name:src
Committed By:   scole
Date:   Thu Feb 23 02:03:27 UTC 2017

Modified Files:
src/sys/arch/ia64/include: Makefile ieeefp.h
Added Files:
src/sys/arch/ia64/include: fenv.h

Log Message:
Add fenv.h for ia64, imported from FreeBSD, compile tested only.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/ia64/include/Makefile
cvs rdiff -u -r0 -r1.1 src/sys/arch/ia64/include/fenv.h
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/ia64/include/ieeefp.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/ia64/include/Makefile
diff -u src/sys/arch/ia64/include/Makefile:1.7 src/sys/arch/ia64/include/Makefile:1.8
--- src/sys/arch/ia64/include/Makefile:1.7	Fri Aug  5 16:56:43 2016
+++ src/sys/arch/ia64/include/Makefile	Thu Feb 23 02:03:27 2017
@@ -1,11 +1,11 @@
-#	$NetBSD: Makefile,v 1.7 2016/08/05 16:56:43 scole Exp $
+#	$NetBSD: Makefile,v 1.8 2017/02/23 02:03:27 scole Exp $
 
 INCSDIR= /usr/include/ia64
 
 INCS=	_regset.h acpi_machdep.h ansi.h \
 	aout_machdep.h asm.h atomic.h bootinfo.h bswap.h cdefs.h \
-	cpu.h cpufunc.h dig64.h disklabel.h efi.h \
-	elf_machdep.h endian.h endian_machdep.h float.h fpu.h frame.h \
+	cpu.h cpufunc.h dig64.h disklabel.h efi.h elf_machdep.h \
+	endian.h endian_machdep.h fenv.h float.h fpu.h frame.h \
 	ia64_cpu.h ieee.h ieeefp.h int_const.h int_fmtio.h int_limits.h \
 	int_mwgwtypes.h int_types.h intr.h limits.h \
 	loadfile_machdep.h lock.h math.h mca_machdep.h mcontext.h md_var.h \

Index: src/sys/arch/ia64/include/ieeefp.h
diff -u src/sys/arch/ia64/include/ieeefp.h:1.1 src/sys/arch/ia64/include/ieeefp.h:1.2
--- src/sys/arch/ia64/include/ieeefp.h:1.1	Wed Dec 26 19:43:10 2012
+++ src/sys/arch/ia64/include/ieeefp.h	Thu Feb 23 02:03:27 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: ieeefp.h,v 1.1 2012/12/26 19:43:10 martin Exp $ */
+/* $NetBSD: ieeefp.h,v 1.2 2017/02/23 02:03:27 scole Exp $ */
 
 /*
  * Written by J.T. Conklin, Apr 28, 1995
@@ -12,26 +12,19 @@
 
 #if defined(_NETBSD_SOURCE) || defined(_ISOC99_SOURCE)
 
-typedef int fenv_t;
-typedef int fexcept_t;
-
-#define	FE_INVALID	0x01	/* invalid operation exception */
-#define	FE_DIVBYZERO	0x02	/* divide-by-zero exception */
-#define	FE_OVERFLOW	0x04	/* overflow exception */
-#define	FE_UNDERFLOW	0x08	/* underflow exception */
-#define	FE_INEXACT	0x10	/* imprecise (loss of precision; "inexact") */
-#define	FE_IOVERFLOW	0x20/* integer overflow */
-
-#define	FE_ALL_EXCEPT	0x3f
+#include 
 
 /*
  * These bits match the fpcr as well as bits 12:11
  * in fp operate instructions
  */
+/* XXX remove since fenv.h now contains (but with different values)? */
+#if 0
 #define	FE_TOWARDZERO	0	/* round to zero (truncate) */
 #define	FE_DOWNWARD	1	/* round toward negative infinity */
 #define	FE_TONEAREST	2	/* round to nearest representable number */
 #define	FE_UPWARD	3	/* round toward positive infinity */
+#endif
 
 #if !defined(_ISOC99_SOURCE)
 

Added files:

Index: src/sys/arch/ia64/include/fenv.h
diff -u /dev/null src/sys/arch/ia64/include/fenv.h:1.1
--- /dev/null	Thu Feb 23 02:03:27 2017
+++ src/sys/arch/ia64/include/fenv.h	Thu Feb 23 02:03:27 2017
@@ -0,0 +1,248 @@
+/*-
+ * Copyright (c) 2004-2005 David Schultz 
+ * 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 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 AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD: releng/10.1/lib/msun/ia64/fenv.h 226218 2011-10-10 15:43:09Z das $
+ */
+
+#ifndef	_IA64_FENV_H_
+#define	_IA64_FENV_H_
+
+#include 
+
+#ifndef	__fenv_static
+#define	__fenv_static	static
+#endif
+
+typedef	__uint64_t	fenv_t;
+typedef	__uint16_t	fexcept_t;
+
+/* Exception flags */
+#define	FE_INVALID	0x01
+#define	FE_DENORMAL	0x02
+#define	

CVS commit: src

2017-02-22 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Thu Feb 23 00:50:09 UTC 2017

Modified Files:
src/sys/kern: sys_ptrace_common.c
src/tests/kernel: t_ptrace_wait.c

Log Message:
Improve PT_SET_SIGMASK and PT_GET_SIGMASK API in ptrace(2)

Use proper check for LW_SYSTEM, don't depend on PT_GETREGS/PT_SETREGS.
Don't allow to mask SA_CANTMASK signals with PT_SET_SIGMASK (this covers
SIGSTOP and SIGKILL).

Add new ATF tests:
 - setsigmask5
   Verify that sigmask cannot be set to SIGKILL

 - setsigmask6
   Verify that sigmask cannot be set to SIGSTOP

Sponsored by 


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/kern/sys_ptrace_common.c
cvs rdiff -u -r1.71 -r1.72 src/tests/kernel/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/sys/kern/sys_ptrace_common.c
diff -u src/sys/kern/sys_ptrace_common.c:1.15 src/sys/kern/sys_ptrace_common.c:1.16
--- src/sys/kern/sys_ptrace_common.c:1.15	Wed Feb 22 23:43:43 2017
+++ src/sys/kern/sys_ptrace_common.c	Thu Feb 23 00:50:09 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: sys_ptrace_common.c,v 1.15 2017/02/22 23:43:43 kamil Exp $	*/
+/*	$NetBSD: sys_ptrace_common.c,v 1.16 2017/02/23 00:50:09 kamil Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -118,7 +118,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sys_ptrace_common.c,v 1.15 2017/02/22 23:43:43 kamil Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sys_ptrace_common.c,v 1.16 2017/02/23 00:50:09 kamil Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ptrace.h"
@@ -1098,11 +1098,12 @@ do_ptrace(struct ptrace_methods *ptm, st
 			mutex_exit(t->p_lock);
 		}
 
-		if (!process_validregs(lt))
+		if (lt->l_flag & LW_SYSTEM)
 			error = EINVAL;
-		else if (write == 1)
+		else if (write == 1) {
 			error = copyin(addr, >l_sigmask, sizeof(sigset_t));
-		else
+			sigminusset(, >l_sigmask);
+		} else
 			error = copyout(>l_sigmask, addr, sizeof(sigset_t));
 			
 		break;

Index: src/tests/kernel/t_ptrace_wait.c
diff -u src/tests/kernel/t_ptrace_wait.c:1.71 src/tests/kernel/t_ptrace_wait.c:1.72
--- src/tests/kernel/t_ptrace_wait.c:1.71	Wed Feb 22 23:43:43 2017
+++ src/tests/kernel/t_ptrace_wait.c	Thu Feb 23 00:50:09 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_ptrace_wait.c,v 1.71 2017/02/22 23:43:43 kamil Exp $	*/
+/*	$NetBSD: t_ptrace_wait.c,v 1.72 2017/02/23 00:50:09 kamil Exp $	*/
 
 /*-
  * Copyright (c) 2016 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: t_ptrace_wait.c,v 1.71 2017/02/22 23:43:43 kamil Exp $");
+__RCSID("$NetBSD: t_ptrace_wait.c,v 1.72 2017/02/23 00:50:09 kamil Exp $");
 
 #include 
 #include 
@@ -6947,6 +6947,128 @@ ATF_TC_BODY(setsigmask4, tc)
 	TWAIT_REQUIRE_FAILURE(ECHILD, wpid = TWAIT_GENERIC(child, , 0));
 }
 
+ATF_TC(setsigmask5);
+ATF_TC_HEAD(setsigmask5, tc)
+{
+	atf_tc_set_md_var(tc, "descr",
+	"Verify that sigmask cannot be set to SIGKILL");
+}
+
+ATF_TC_BODY(setsigmask5, tc)
+{
+	const int exitval = 5;
+	const int sigval = SIGSTOP;
+	pid_t child, wpid;
+#if defined(TWAIT_HAVE_STATUS)
+	int status;
+#endif
+	sigset_t new_mask;
+	sigset_t mask;
+	ATF_REQUIRE(sigemptyset(_mask) == 0);
+	ATF_REQUIRE(sigemptyset() == 0);
+	ATF_REQUIRE(sigaddset(, SIGKILL) == 0);
+
+	printf("Before forking process PID=%d\n", getpid());
+	ATF_REQUIRE((child = fork()) != -1);
+	if (child == 0) {
+		printf("Before calling PT_TRACE_ME from child %d\n", getpid());
+		FORKEE_ASSERT(ptrace(PT_TRACE_ME, 0, NULL, 0) != -1);
+
+		printf("Before raising %s from child\n", strsignal(sigval));
+		FORKEE_ASSERT(raise(sigval) == 0);
+
+		printf("Before exiting of the child process\n");
+		_exit(exitval);
+	}
+	printf("Parent process PID=%d, child's PID=%d\n", getpid(), child);
+
+	printf("Before calling %s() for the child\n", TWAIT_FNAME);
+	TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, , 0), child);
+
+	validate_status_stopped(status, sigval);
+
+	printf("Before calling PT_SET_SIGMASK for new mask with SIGINT\n");
+	ATF_REQUIRE(ptrace(PT_SET_SIGMASK, child, , 0) != -1);
+
+	printf("Before calling PT_GET_SIGMASK to store it in new_mask\n");
+	ATF_REQUIRE(ptrace(PT_GET_SIGMASK, child, _mask, 0) != -1);
+
+	ATF_REQUIRE(memcmp(, _mask, sizeof(sigset_t)) != 0);
+
+	printf("Before resuming the child process where it left off and "
+	"without signal to be sent\n");
+	ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
+
+	printf("Before calling %s() for the child\n", TWAIT_FNAME);
+	TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, , 0), child);
+
+	validate_status_exited(status, exitval);
+
+	printf("Before calling %s() for the child\n", TWAIT_FNAME);
+	TWAIT_REQUIRE_FAILURE(ECHILD, wpid = TWAIT_GENERIC(child, , 0));
+}
+
+ATF_TC(setsigmask6);
+ATF_TC_HEAD(setsigmask6, tc)
+{
+	atf_tc_set_md_var(tc, "descr",
+	"Verify that sigmask cannot be set to SIGSTOP");
+}
+
+ATF_TC_BODY(setsigmask6, tc)
+{
+	const int exitval = 5;
+	const int 

CVS commit: src

2017-02-22 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Wed Feb 22 23:43:44 UTC 2017

Modified Files:
src/lib/libc/sys: ptrace.2
src/sys/kern: sys_ptrace_common.c
src/sys/sys: ptrace.h
src/tests/kernel: t_ptrace_wait.c

Log Message:
Introduce new ptrace(2) API to allow/prevent exection of LWP

Introduce new API for debuggers to allow/prevent execution of the specified
thread.

New ptrace(2) operations:

 PT_RESUME Allow execution of a specified thread, change its state
   from suspended to continued.  The addr argument is unused.
   The data argument specifies the LWP ID.

   This call is equivalent to _lwp_continue(2) called by a
   traced process.  This call does not change the general
   process state from stopped to continued.

 PT_SUSPENDPrevent execution of a specified thread, change its state
   from continued to suspended.  The addr argument is unused.
   The data argument specifies the requested LWP ID.

   This call is equivalent to _lwp_suspend(2) called by a
   traced process.  This call does not change the general
   process state from continued to stopped.

This interface is modeled after FreeBSD, however with NetBSD specific arguments
passed to ptrace(2) -- FreeBSD passes only thread id, NetBSD passes process and
thread id.

Extend PT_LWPINFO operation in ptrace(2) to report suspended threads. In the
ptrace_lwpinfo structure in pl_event next to PL_EVENT_NONE and PL_EVENT_SIGNAL
add new value PL_EVENT_SUSPENDED.

Add new errno(2) value EDEADLK that might be returned by ptrace(2). It prevents
dead-locking in a scenario of resuming a process or thread that is prevented
from execution. This fixes bug that old API was vulnerable to this scenario.

Kernel bump delayed till introduction of PT_GETDBREGS/PT_SETDBREGS soon.

Add new ATF tests:
 - resume1
   Verify that a thread can be suspended by a debugger and later
   resumed by the debugger

 - suspend1
   Verify that a thread can be suspended by a debugger and later
   resumed by a tracee

 - suspend2
   Verify that the while the only thread within a process is
   suspended, the whole process cannot be unstopped

Sponsored by 


To generate a diff of this commit:
cvs rdiff -u -r1.59 -r1.60 src/lib/libc/sys/ptrace.2
cvs rdiff -u -r1.14 -r1.15 src/sys/kern/sys_ptrace_common.c
cvs rdiff -u -r1.56 -r1.57 src/sys/sys/ptrace.h
cvs rdiff -u -r1.70 -r1.71 src/tests/kernel/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/lib/libc/sys/ptrace.2
diff -u src/lib/libc/sys/ptrace.2:1.59 src/lib/libc/sys/ptrace.2:1.60
--- src/lib/libc/sys/ptrace.2:1.59	Sun Feb 12 06:09:53 2017
+++ src/lib/libc/sys/ptrace.2	Wed Feb 22 23:43:43 2017
@@ -1,4 +1,4 @@
-.\"	$NetBSD: ptrace.2,v 1.59 2017/02/12 06:09:53 kamil Exp $
+.\"	$NetBSD: ptrace.2,v 1.60 2017/02/22 23:43:43 kamil Exp $
 .\"
 .\" This file is in the public domain.
 .Dd February 12, 2016
@@ -355,6 +355,7 @@ Possible values are:
 .Bl -tag -width 30n -offset indent -compact
 .It Dv PL_EVENT_NONE
 .It Dv PL_EVENT_SIGNAL
+.It Dv PL_EVENT_SUSPENDED
 .El
 .Pp
 The
@@ -539,6 +540,34 @@ The
 .Fa data
 argument contains the LWP ID of the thread whose mask is to be read.
 If zero is supplied, the first thread of the process is read.
+.It Dv PT_RESUME
+Allow execution of a specified thread,
+change its state from suspended to continued.
+The
+.Fa addr
+argument is unused.
+The
+.Fa data
+argument specifies the LWP ID.
+.Pp
+This call is equivalent to
+.Xr _lwp_continue 2
+called by a traced process.
+This call does not change the general process state from stopped to continued.
+.It Dv PT_SUSPEND
+Prevent execution of a specified thread,
+change its state from continued to suspended.
+The
+.Fa addr
+argument is unused.
+The
+.Fa data
+argument specifies the requested LWP ID.
+.Pp
+This call is equivalent to
+.Xr _lwp_suspend 2
+called by a traced process.
+This call does not change the general process state from continued to stopped.
 .El
 .Pp
 Additionally, the following requests exist but are
@@ -692,6 +721,8 @@ A request (other than
 .Dv PT_ATTACH )
 specified a process that wasn't stopped.
 .El
+.It Bq Er EDEADLK
+An attempt to unstop a process with locked threads.
 .It Bq Er EINVAL
 .Bl -bullet -compact
 .It
@@ -761,3 +792,10 @@ should be able to sidestep this.
 .Dv PTRACE_VFORK
 is currently unimplemented and it will return
 .Er ENOTSUP .
+.Pp
+.Dv PT_SET_SIGINFO ,
+.Dv PT_RESUME
+and
+.Dv PT_SUSPEND
+can change the image of process returned by
+.Dv PT_LWPINFO .

Index: src/sys/kern/sys_ptrace_common.c
diff -u src/sys/kern/sys_ptrace_common.c:1.14 src/sys/kern/sys_ptrace_common.c:1.15
--- src/sys/kern/sys_ptrace_common.c:1.14	Sun Feb 12 06:09:52 2017
+++ src/sys/kern/sys_ptrace_common.c	Wed Feb 22 23:43:43 

CVS commit: src/lib/libc/stdio

2017-02-22 Thread Abhinav Upadhyay
Module Name:src
Committed By:   abhinav
Date:   Wed Feb 22 15:08:55 UTC 2017

Modified Files:
src/lib/libc/stdio: putc.3

Log Message:
Add reference to flockfile(3) in SEE ALSO section.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/lib/libc/stdio/putc.3

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

Modified files:

Index: src/lib/libc/stdio/putc.3
diff -u src/lib/libc/stdio/putc.3:1.12 src/lib/libc/stdio/putc.3:1.13
--- src/lib/libc/stdio/putc.3:1.12	Thu May  6 09:01:34 2010
+++ src/lib/libc/stdio/putc.3	Wed Feb 22 15:08:55 2017
@@ -1,4 +1,4 @@
-.\"	$NetBSD: putc.3,v 1.12 2010/05/06 09:01:34 jruoho Exp $
+.\"	$NetBSD: putc.3,v 1.13 2017/02/22 15:08:55 abhinav Exp $
 .\"
 .\" Copyright (c) 1990, 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -133,6 +133,7 @@ a write error occurs,
 or if an attempt is made to write a read-only stream.
 .Sh SEE ALSO
 .Xr ferror 3 ,
+.Xr flockfile 3 ,
 .Xr fopen 3 ,
 .Xr getc 3 ,
 .Xr stdio 3



CVS commit: src/lib/libc/stdio

2017-02-22 Thread Abhinav Upadhyay
Module Name:src
Committed By:   abhinav
Date:   Wed Feb 22 14:58:33 UTC 2017

Modified Files:
src/lib/libc/stdio: fputs.3

Log Message:
Fix a sentence.
Add write(2) in SEE ALSO.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/lib/libc/stdio/fputs.3

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

Modified files:

Index: src/lib/libc/stdio/fputs.3
diff -u src/lib/libc/stdio/fputs.3:1.11 src/lib/libc/stdio/fputs.3:1.12
--- src/lib/libc/stdio/fputs.3:1.11	Thu Aug  7 16:43:24 2003
+++ src/lib/libc/stdio/fputs.3	Wed Feb 22 14:58:33 2017
@@ -1,4 +1,4 @@
-.\"	$NetBSD: fputs.3,v 1.11 2003/08/07 16:43:24 agc Exp $
+.\"	$NetBSD: fputs.3,v 1.12 2017/02/22 14:58:33 abhinav Exp $
 .\"
 .\" Copyright (c) 1990, 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -92,9 +92,10 @@ and
 .Fn puts
 may also fail and set
 .Va errno
-for any of the errors specified for the routines
+for any of the errors specified for the routine
 .Xr write 2 .
 .Sh SEE ALSO
+.Xr write 2 ,
 .Xr ferror 3 ,
 .Xr putc 3 ,
 .Xr stdio 3



CVS commit: src/usr.sbin/mtree

2017-02-22 Thread Abhinav Upadhyay
Module Name:src
Committed By:   abhinav
Date:   Wed Feb 22 14:15:15 UTC 2017

Modified Files:
src/usr.sbin/mtree: mtree.8

Log Message:
Fix typo.


To generate a diff of this commit:
cvs rdiff -u -r1.71 -r1.72 src/usr.sbin/mtree/mtree.8

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

Modified files:

Index: src/usr.sbin/mtree/mtree.8
diff -u src/usr.sbin/mtree/mtree.8:1.71 src/usr.sbin/mtree/mtree.8:1.72
--- src/usr.sbin/mtree/mtree.8:1.71	Fri Jan 23 03:31:58 2015
+++ src/usr.sbin/mtree/mtree.8	Wed Feb 22 14:15:15 2017
@@ -1,4 +1,4 @@
-.\"	$NetBSD: mtree.8,v 1.71 2015/01/23 03:31:58 wiz Exp $
+.\"	$NetBSD: mtree.8,v 1.72 2017/02/22 14:15:15 abhinav Exp $
 .\"
 .\" Copyright (c) 1989, 1990, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -161,7 +161,7 @@ The
 .Sy freebsd9
 and
 .Sy netbsd6
-flavors attempt to preserve output compatiblity and command line option
+flavors attempt to preserve output compatibility and command line option
 backward compatibility with
 .Fx 9.0
 and



CVS commit: src/usr.bin/qsubst

2017-02-22 Thread Abhinav Upadhyay
Module Name:src
Committed By:   abhinav
Date:   Wed Feb 22 14:01:40 UTC 2017

Modified Files:
src/usr.bin/qsubst: qsubst.1

Log Message:
Use Nm to refer the program name.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/usr.bin/qsubst/qsubst.1

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/qsubst/qsubst.1
diff -u src/usr.bin/qsubst/qsubst.1:1.5 src/usr.bin/qsubst/qsubst.1:1.6
--- src/usr.bin/qsubst/qsubst.1:1.5	Tue Mar 18 18:20:45 2014
+++ src/usr.bin/qsubst/qsubst.1	Wed Feb 22 14:01:40 2017
@@ -1,4 +1,4 @@
-.\"	$NetBSD: qsubst.1,v 1.5 2014/03/18 18:20:45 riastradh Exp $
+.\"	$NetBSD: qsubst.1,v 1.6 2017/02/22 14:01:40 abhinav Exp $
 .\"
 .\" This file is in the public domain.
 .Dd September 4, 1999
@@ -49,12 +49,16 @@ Don't change this one or any others in t
 on to the next file.
 .It \&!
 Change the rest in this file without asking, then go on to the next
-file (at which point qsubst will start asking again).
+file (at which point
+.Nm
+will start asking again).
 .It \&?
 Print out the current filename and ask again.
 .El
 .Pp
-The first two arguments to qsubst are always the string to replace and
+The first two arguments to
+.Nm
+are always the string to replace and
 the string to replace it with.
 The options are as follows:
 .Bl -tag -width "-F filename" -compact -offset indent
@@ -99,7 +103,9 @@ lines of context below the line with the
 .It Fl f Ar filename
 The
 .Ar filename
-argument is one of the files qsubst should perform substitutions in.
+argument is one of the files
+.Nm
+should perform substitutions in.
 .It Fl F Ar filename
 .Nm
 reads
@@ -136,9 +142,13 @@ is limited to 512 characters; there is n
 .Ar str2 .
 Neither one may contain a NUL.
 .Pp
-NULs in the file may cause qsubst to make various mistakes.
+NULs in the file may cause
+.Nm
+to make various mistakes.
 .Pp
-If any other program modifies the file while qsubst is running, all
+If any other program modifies the file while
+.Nm
+is running, all
 bets are off.
 .Sh AUTHORS
 .An der Mouse Aq Mt mo...@rodents.montreal.qc.ca



CVS commit: src/usr.bin/tic

2017-02-22 Thread Abhinav Upadhyay
Module Name:src
Committed By:   abhinav
Date:   Wed Feb 22 13:43:15 UTC 2017

Modified Files:
src/usr.bin/tic: tic.1

Log Message:
Fix spelling of "discovered"


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/usr.bin/tic/tic.1

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/tic/tic.1
diff -u src/usr.bin/tic/tic.1:1.12 src/usr.bin/tic/tic.1:1.13
--- src/usr.bin/tic/tic.1:1.12	Tue Mar 18 18:20:45 2014
+++ src/usr.bin/tic/tic.1	Wed Feb 22 13:43:15 2017
@@ -1,4 +1,4 @@
-.\"	$NetBSD: tic.1,v 1.12 2014/03/18 18:20:45 riastradh Exp $
+.\"	$NetBSD: tic.1,v 1.13 2017/02/22 13:43:15 abhinav Exp $
 .\"
 .\" Copyright (c) 2009, 2010 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -77,7 +77,7 @@ discovers a
 capability, the terminal description for
 .Va term
 is merged in.
-Capabilities do not overwrite previously disovered ones and capabilities
+Capabilities do not overwrite previously discovered ones and capabilities
 ending with @ are marked as absent so the terminal does not inherit the
 capability from
 .Sy use Ns d



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

2017-02-22 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Wed Feb 22 13:34:39 UTC 2017

Modified Files:
src/sys/arch/mips/conf: Makefile.mips

Log Message:
leave the part for GCC >= 5.3 in.

Was a little over-eager and accidentally removed the else case.


To generate a diff of this commit:
cvs rdiff -u -r1.66 -r1.67 src/sys/arch/mips/conf/Makefile.mips

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

Modified files:

Index: src/sys/arch/mips/conf/Makefile.mips
diff -u src/sys/arch/mips/conf/Makefile.mips:1.66 src/sys/arch/mips/conf/Makefile.mips:1.67
--- src/sys/arch/mips/conf/Makefile.mips:1.66	Wed Feb 22 13:17:29 2017
+++ src/sys/arch/mips/conf/Makefile.mips	Wed Feb 22 13:34:39 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.mips,v 1.66 2017/02/22 13:17:29 maya Exp $
+#	$NetBSD: Makefile.mips,v 1.67 2017/02/22 13:34:39 maya Exp $
 
 # Makefile for NetBSD
 #
@@ -47,6 +47,11 @@ CPPFLAGS+=	-D${MACHINE}
 DEFGP?=		-G 0
 GP?=		${DEFGP}
 
+.if ${ACTIVE_CC} == "gcc"
+COPTS.mips_fpu.c+=	-mhard-float -Wa,-mhard-float
+AFLAGS.fp.S+=		-Wa,-mhard-float
+.endif
+
 CFLAGS+=	${GP} -mno-abicalls -msoft-float -ffixed-24
 .if defined(LP64) && ${LP64} == "yes"
 .if ${MACHINE_ARCH} == "mips64eb" || ${MACHINE_ARCH} == "mips64el"



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

2017-02-22 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Wed Feb 22 13:17:29 UTC 2017

Modified Files:
src/sys/arch/mips/conf: Makefile.mips

Log Message:
GC workaround for GCC 4.8 fixed in GCC 5+


To generate a diff of this commit:
cvs rdiff -u -r1.65 -r1.66 src/sys/arch/mips/conf/Makefile.mips

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

Modified files:

Index: src/sys/arch/mips/conf/Makefile.mips
diff -u src/sys/arch/mips/conf/Makefile.mips:1.65 src/sys/arch/mips/conf/Makefile.mips:1.66
--- src/sys/arch/mips/conf/Makefile.mips:1.65	Tue Mar 29 18:40:32 2016
+++ src/sys/arch/mips/conf/Makefile.mips	Wed Feb 22 13:17:29 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.mips,v 1.65 2016/03/29 18:40:32 macallan Exp $
+#	$NetBSD: Makefile.mips,v 1.66 2017/02/22 13:17:29 maya Exp $
 
 # Makefile for NetBSD
 #
@@ -47,22 +47,6 @@ CPPFLAGS+=	-D${MACHINE}
 DEFGP?=		-G 0
 GP?=		${DEFGP}
 
-.if ${ACTIVE_CC} == "gcc" && ${HAVE_GCC} == "48"
-# XXX
-# gcc does not pass floating point options to the assembler
-# by default, because it is afraid that the stricter tests
-# will break userland code. The new binutils is pickier about
-# this. Gcc 5.x fixes the issue so for now, set explicitly
-# the assembler soft-float flags when we build the kernel.
-# see: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64569
-
-CFLAGS+=	-Wa,-msoft-float
-COPTS.mips_fpu.c+=	-Wa,-mhard-float
-.else
-COPTS.mips_fpu.c+=	-mhard-float -Wa,-mhard-float
-AFLAGS.fp.S+=		-Wa,-mhard-float
-.endif
-
 CFLAGS+=	${GP} -mno-abicalls -msoft-float -ffixed-24
 .if defined(LP64) && ${LP64} == "yes"
 .if ${MACHINE_ARCH} == "mips64eb" || ${MACHINE_ARCH} == "mips64el"



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

2017-02-22 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Wed Feb 22 13:14:45 UTC 2017

Modified Files:
src/sys/arch/evbarm/stand/boot2440: Makefile
src/sys/arch/evbarm/stand/bootimx23: Makefile

Log Message:
Get rid of more -mno-thumb -mno-thumb-interwork for GCC < 4.8


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/evbarm/stand/boot2440/Makefile
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/evbarm/stand/bootimx23/Makefile

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

Modified files:

Index: src/sys/arch/evbarm/stand/boot2440/Makefile
diff -u src/sys/arch/evbarm/stand/boot2440/Makefile:1.16 src/sys/arch/evbarm/stand/boot2440/Makefile:1.17
--- src/sys/arch/evbarm/stand/boot2440/Makefile:1.16	Sun Jan 12 15:26:28 2014
+++ src/sys/arch/evbarm/stand/boot2440/Makefile	Wed Feb 22 13:14:45 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.16 2014/01/12 15:26:28 tsutsui Exp $
+#	$NetBSD: Makefile,v 1.17 2017/02/22 13:14:45 maya Exp $
 
 S=		${.CURDIR}/../../../..
 
@@ -16,11 +16,7 @@ CPPFLAGS+=	-DDM9000MAC="0x08,0x08,0x11,0
 CPPFLAGS+=	-DDEFAULT_BOOTFILE="ld0a:netbsd;net:"
 CPPFLAGS+=	-nostdinc -I. -I${.OBJDIR} -I${S} -I${S}/arch
 CPPFLAGS+=	-march=armv4 ${ARM_APCS_FLAGS}
-.if ${HAVE_LLVM:Uno} != "no" || ${HAVE_GCC:U0} >= 48
 CPPFLAGS+=	-marm
-.else
-CPPFLAGS+=	-mno-thumb -mno-thumb-interwork
-.endif
 CPUFLAGS=
 DBG=		-Os
 

Index: src/sys/arch/evbarm/stand/bootimx23/Makefile
diff -u src/sys/arch/evbarm/stand/bootimx23/Makefile:1.14 src/sys/arch/evbarm/stand/bootimx23/Makefile:1.15
--- src/sys/arch/evbarm/stand/bootimx23/Makefile:1.14	Tue Jul 22 17:46:59 2014
+++ src/sys/arch/evbarm/stand/bootimx23/Makefile	Wed Feb 22 13:14:45 2017
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.14 2014/07/22 17:46:59 bouyer Exp $
+# $Id: Makefile,v 1.15 2017/02/22 13:14:45 maya Exp $
 
 S=		${.CURDIR}/../../../../
 PROG=		bootimx23
@@ -13,11 +13,7 @@ CPPFLAGS+=	-D_STANDALONE -DMEMSIZE=64
 CPPFLAGS+=	-DKERNEL_BOOT_ARGS=\"root=ld0a\"
 CPPFLAGS+=	-nostdinc -I. -I${.CURDIR} -I${.OBJDIR} -I${S} -I${S}/arch
 CPPFLAGS+=	${ARM_APCS_FLAGS}
-.if ${HAVE_LLVM:Uno} != "no" || ${HAVE_GCC:U0} >= 48
 CPPFLAGS+=	-marm
-.else
-CPPFLAGS+=	-mno-thumb -mno-thumb-interwork
-.endif
 #CPPFLAGS+=	-DDEBUG
 #CPPFLAGS+=	-DDIAGNOSTIC
 DBG=		-g



CVS commit: src/sys/arch

2017-02-22 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Wed Feb 22 12:51:38 UTC 2017

Modified Files:
src/sys/arch/evbarm/stand/gzboot: Makefile.gzboot
src/sys/arch/zaurus/stand/zboot: Makefile

Log Message:
GC more logic that was intended for GCC <4.8 (or !LLVM)

Same as before (-marm implies -mno-thumb), but now the condition was flipped


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sys/arch/evbarm/stand/gzboot/Makefile.gzboot
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/zaurus/stand/zboot/Makefile

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

Modified files:

Index: src/sys/arch/evbarm/stand/gzboot/Makefile.gzboot
diff -u src/sys/arch/evbarm/stand/gzboot/Makefile.gzboot:1.34 src/sys/arch/evbarm/stand/gzboot/Makefile.gzboot:1.35
--- src/sys/arch/evbarm/stand/gzboot/Makefile.gzboot:1.34	Tue Mar  1 16:08:22 2016
+++ src/sys/arch/evbarm/stand/gzboot/Makefile.gzboot	Wed Feb 22 12:51:38 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.gzboot,v 1.34 2016/03/01 16:08:22 joerg Exp $
+#	$NetBSD: Makefile.gzboot,v 1.35 2017/02/22 12:51:38 maya Exp $
 
 NOMAN=  # defined
 
@@ -39,11 +39,7 @@ CPPFLAGS+= -nostdinc -I. -I${EVBARM_STAN
 CPPFLAGS+= -I${S} -I${S}/arch -I${S}/lib/libsa
 CPPFLAGS+= -I${S}/../common/dist/zlib
 CPPFLAGS+= ${ARM_APCS_FLAGS}
-.if ${HAVE_LLVM:Uno} != "no" || ${HAVE_GCC:U0} >= 48
 CPPFLAGS+=	-marm
-.else
-CPPFLAGS+=	-mno-thumb -mno-thumb-interwork
-.endif
 
 CPPFLAGS+= -D_STANDALONE
 

Index: src/sys/arch/zaurus/stand/zboot/Makefile
diff -u src/sys/arch/zaurus/stand/zboot/Makefile:1.18 src/sys/arch/zaurus/stand/zboot/Makefile:1.19
--- src/sys/arch/zaurus/stand/zboot/Makefile:1.18	Sun Jan 31 15:32:12 2016
+++ src/sys/arch/zaurus/stand/zboot/Makefile	Wed Feb 22 12:51:38 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.18 2016/01/31 15:32:12 christos Exp $
+#	$NetBSD: Makefile,v 1.19 2017/02/22 12:51:38 maya Exp $
 
 PROG=		zboot
 
@@ -22,11 +22,7 @@ CPPFLAGS+=	-nostdinc -I. -I${.CURDIR} -I
 CPPFLAGS+=	-D_STANDALONE -DHEAP_VARIABLE
 CPPFLAGS+=	-DLIBSA_ENABLE_LS_OP
 CPPFLAGS+=	${ARM_APCS_FLAGS} -mcpu=xscale
-.if ${HAVE_LLVM:Uno} != "no" || ${HAVE_GCC:U0} >= 48
 CPPFLAGS+=	-marm
-.else
-CPPFLAGS+=	-mno-thumb -mno-thumb-interwork
-.endif
 CPUFLAGS=
 AFLAGS+=	-D_LOCORE
 LDFLAGS+=	-nostdlib -Bstatic



CVS commit: src/sys/arch

2017-02-22 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Wed Feb 22 12:44:22 UTC 2017

Modified Files:
src/sys/arch/acorn26/stand: Makefile.buildboot
src/sys/arch/acorn32/stand: Makefile.buildboot

Log Message:
GC gcc < 4.8 logic.

-marm implies -mno-thumb, and -mno-thumb-interwork is a GCC default.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/acorn26/stand/Makefile.buildboot
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/acorn32/stand/Makefile.buildboot

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/acorn26/stand/Makefile.buildboot
diff -u src/sys/arch/acorn26/stand/Makefile.buildboot:1.21 src/sys/arch/acorn26/stand/Makefile.buildboot:1.22
--- src/sys/arch/acorn26/stand/Makefile.buildboot:1.21	Sun Jan 12 15:26:28 2014
+++ src/sys/arch/acorn26/stand/Makefile.buildboot	Wed Feb 22 12:44:21 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.buildboot,v 1.21 2014/01/12 15:26:28 tsutsui Exp $
+#	$NetBSD: Makefile.buildboot,v 1.22 2017/02/22 12:44:21 maya Exp $
 
 S?=	${.CURDIR}/../../../..
 
@@ -35,11 +35,7 @@ CPPFLAGS+=	-D_STANDALONE -DHIMEM=0x28000
 CPPFLAGS+=	-I. -I${.CURDIR}/../../.. -I${.CURDIR}/../../../..
 CPPFLAGS+=	-I${.CURDIR}/../lib
 CPPFLAGS+=	${ARM_APCS_FLAGS} -march=armv2
-.if ${HAVE_GCC} < 48
-CPPFLAGS+=	-mno-thumb -mno-thumb-interwork
-.else
 CPPFLAGS+=	-marm
-.endif
 CFLAGS=		-O2
 CFLAGS+=	-ffreestanding -fno-unwind-tables
 CFLAGS+=	-Wall -Wstrict-prototypes -Wmissing-prototypes

Index: src/sys/arch/acorn32/stand/Makefile.buildboot
diff -u src/sys/arch/acorn32/stand/Makefile.buildboot:1.21 src/sys/arch/acorn32/stand/Makefile.buildboot:1.22
--- src/sys/arch/acorn32/stand/Makefile.buildboot:1.21	Sun Jan 12 15:26:28 2014
+++ src/sys/arch/acorn32/stand/Makefile.buildboot	Wed Feb 22 12:44:21 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.buildboot,v 1.21 2014/01/12 15:26:28 tsutsui Exp $
+#	$NetBSD: Makefile.buildboot,v 1.22 2017/02/22 12:44:21 maya Exp $
 
 S?=	${.CURDIR}/../../../..
 
@@ -45,11 +45,7 @@ CPPFLAGS+=	-D_STANDALONE 
 CPPFLAGS+=	-I. -I${.CURDIR}/../../.. -I${.CURDIR}/../../../..
 CPPFLAGS+=	-I${.CURDIR}/../lib
 CPPFLAGS+=	${ARM_APCS_FLAGS} -march=armv3m
-.if ${HAVE_GCC} < 48
-CPPFLAGS+=	-mno-thumb -mno-thumb-interwork
-.else
 CPPFLAGS+=	-marm
-.endif
 CPUFLAGS=
 CFLAGS=		-O2
 CFLAGS+=	-ffreestanding -fno-unwind-tables



CVS commit: src

2017-02-22 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Wed Feb 22 12:34:49 UTC 2017

Modified Files:
src/external/bsd/file: Makefile.inc
src/tests/lib/libc/sync: Makefile
src/tools/gcc: gcc-version.mk

Log Message:
GC more gcc 4.8 specific (dead) logic


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/external/bsd/file/Makefile.inc
cvs rdiff -u -r1.6 -r1.7 src/tests/lib/libc/sync/Makefile
cvs rdiff -u -r1.6 -r1.7 src/tools/gcc/gcc-version.mk

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

Modified files:

Index: src/external/bsd/file/Makefile.inc
diff -u src/external/bsd/file/Makefile.inc:1.5 src/external/bsd/file/Makefile.inc:1.6
--- src/external/bsd/file/Makefile.inc:1.5	Fri Jan 17 20:24:20 2014
+++ src/external/bsd/file/Makefile.inc	Wed Feb 22 12:34:49 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.5 2014/01/17 20:24:20 martin Exp $
+#	$NetBSD: Makefile.inc,v 1.6 2017/02/22 12:34:49 maya Exp $
 
 WARNS=4
 DIST=${NETBSDSRCDIR}/external/bsd/file/dist
@@ -20,8 +20,4 @@ CPPFLAGS+=	-DMAGIC='"${MAGIC}"' -DHAVE_C
 		-DELFCORE -DVERSION='"${VERSION}"'
 CPPFLAGS+=	-I${.CURDIR}/../include -I${DIST}/src
 
-.if ${ACTIVE_CC}=="gcc" && ${HAVE_GCC}=="48"
-CPPFLAGS.readelf.c	+= -Wno-error=maybe-uninitialized
-.endif
-
 .PATH:		${DIST}/src ${DIST}/doc

Index: src/tests/lib/libc/sync/Makefile
diff -u src/tests/lib/libc/sync/Makefile:1.6 src/tests/lib/libc/sync/Makefile:1.7
--- src/tests/lib/libc/sync/Makefile:1.6	Sat Oct 18 02:22:35 2014
+++ src/tests/lib/libc/sync/Makefile	Wed Feb 22 12:34:49 2017
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.6 2014/10/18 02:22:35 joerg Exp $
+# $NetBSD: Makefile,v 1.7 2017/02/22 12:34:49 maya Exp $
 
 WARNS=0
 NOMAN=1
@@ -7,12 +7,9 @@ NOMAN=1
 
 PROG=	all_sync_ops_linkable
 
-.if "${ACTIVE_CC}" == "clang" || \
-("${ACTIVE_CC}" == "gcc" && "${HAVE_GCC}" == "48")
-
+.if "${ACTIVE_CC}" == "clang"
 CXXFLAGS+= -std=c++11
 PROG_CXX+=	cpp_atomic_ops_linkable
-
 .endif
 
 proginstall:

Index: src/tools/gcc/gcc-version.mk
diff -u src/tools/gcc/gcc-version.mk:1.6 src/tools/gcc/gcc-version.mk:1.7
--- src/tools/gcc/gcc-version.mk:1.6	Tue Jun  7 08:12:13 2016
+++ src/tools/gcc/gcc-version.mk	Wed Feb 22 12:34:49 2017
@@ -1,9 +1,5 @@
-#	$NetBSD: gcc-version.mk,v 1.6 2016/06/07 08:12:13 mrg Exp $
+#	$NetBSD: gcc-version.mk,v 1.7 2017/02/22 12:34:49 maya Exp $
 
 # common location for tools and native build
 
-.if ${HAVE_GCC} == 48
-NETBSD_GCC_VERSION=nb3 20151015
-.else
 NETBSD_GCC_VERSION=nb1 20160606
-.endif



CVS commit: src

2017-02-22 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Wed Feb 22 12:17:16 UTC 2017

Modified Files:
src/doc: HACKS
src/external/bsd/libevent/lib/libevent: Makefile
src/sys/rump/net/lib/libnetbt: Makefile
src/usr.sbin/racoon: Makefile

Log Message:
GC some GCC 4.8 specific sh3 HACKS entries.

These existed to avoid compile errors, and haven't been effect
since gcc.old was removed.


To generate a diff of this commit:
cvs rdiff -u -r1.184 -r1.185 src/doc/HACKS
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/libevent/lib/libevent/Makefile
cvs rdiff -u -r1.6 -r1.7 src/sys/rump/net/lib/libnetbt/Makefile
cvs rdiff -u -r1.28 -r1.29 src/usr.sbin/racoon/Makefile

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

Modified files:

Index: src/doc/HACKS
diff -u src/doc/HACKS:1.184 src/doc/HACKS:1.185
--- src/doc/HACKS:1.184	Thu Feb 16 01:05:01 2017
+++ src/doc/HACKS	Wed Feb 22 12:17:16 2017
@@ -1,4 +1,4 @@
-# $NetBSD: HACKS,v 1.184 2017/02/16 01:05:01 rin Exp $
+# $NetBSD: HACKS,v 1.185 2017/02/22 12:17:16 maya Exp $
 #
 # This file is intended to document workarounds for currently unsolved
 # (mostly) compiler bugs.
@@ -644,47 +644,6 @@ port	sh3
 		-fno-loop-optimize.
 	kcah
 
-port	sh3eb
-	hack	gcc4.8.1
-	cdate	Thu Nov  7 16:31:23 EST 2013
-	who	christos
-	file	src/sys/rump/net/lib/libnetbt/Makefile	: 1.2
-	desrc
-		for profiling
-		compile l2cap_signal.c with -O0 to avoid:
-		./netbt/l2cap_signal.c:36:
-		/p/netbsd/cvsroot/src/sys/rump/net/lib/libnetbt/../../../../\
-		netbt/l2cap_signal.c: In function 'l2cap_recv_signal':
-		./sh3/byte_swap.h:20:2: error: 'asm' operand requires \
-		impossible reload
-		  __asm volatile ("swap.b %1,%0" : "=r"(rval) : "r"(x));
-	kcah
-
-port	sh3el
-	hack	gcc4.8.1
-	cdate	Fri Nov  8 19:27:01 EST 2013
-	who	christos
-	file	src/external/bsd/libevent/lib/libevent/Makefile	: 1.2
-	desrc
-		for profiling
-		compile evdns.c with -O0 to avoid:
-		./sh3/byte_swap.h:20:2: error: 'asm' operand requires \
-		impossible reload
-		  __asm volatile ("swap.b %1,%0" : "=r"(rval) : "r"(x));
-	kcah
-	
-	hack	gcc4.8.1
-	cdate	Fri Nov  8 19:34:48 EST 2013
-	who	christos
-	file	src/usr.sbin/racoon/Makefile	: 1.27
-	desrc
-		for profiling
-		compile ipsec_doi.c with -O0 to avoid:
-		./sh3/byte_swap.h:20:2: error: 'asm' operand requires \
-		impossible reload
-		  __asm volatile ("swap.b %1,%0" : "=r"(rval) : "r"(x));
-	kcah
-
 port	m68000
 
 	hack	gcc4-m68000

Index: src/external/bsd/libevent/lib/libevent/Makefile
diff -u src/external/bsd/libevent/lib/libevent/Makefile:1.3 src/external/bsd/libevent/lib/libevent/Makefile:1.4
--- src/external/bsd/libevent/lib/libevent/Makefile:1.3	Tue Jan 31 23:17:40 2017
+++ src/external/bsd/libevent/lib/libevent/Makefile	Wed Feb 22 12:17:16 2017
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.3 2017/01/31 23:17:40 christos Exp $
+# $NetBSD: Makefile,v 1.4 2017/02/22 12:17:16 maya Exp $
 
 USE_SHLIBDIR=yes
 .include 
@@ -29,10 +29,4 @@ poll.c \
 select.c \
 signal.c
 
-.if defined(HAVE_GCC) && ${HAVE_GCC} == 48
-.if ${MACHINE_ARCH} == "sh3el"
-COPTS.evdns.c=	-O0
-.endif
-.endif
-
 .include 

Index: src/sys/rump/net/lib/libnetbt/Makefile
diff -u src/sys/rump/net/lib/libnetbt/Makefile:1.6 src/sys/rump/net/lib/libnetbt/Makefile:1.7
--- src/sys/rump/net/lib/libnetbt/Makefile:1.6	Mon Oct 19 16:16:38 2015
+++ src/sys/rump/net/lib/libnetbt/Makefile	Wed Feb 22 12:17:16 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.6 2015/10/19 16:16:38 pooka Exp $
+#	$NetBSD: Makefile,v 1.7 2017/02/22 12:17:16 maya Exp $
 #
 
 NOLINT=	#defined
@@ -18,11 +18,6 @@ SRCS=	bt_proto.c bt_sysctl.c		\
 	rfcomm_dlc.c rfcomm_session.c rfcomm_socket.c rfcomm_upper.c	\
 	sco_socket.c sco_upper.c
 
-.if ${HAVE_GCC:U} == "48"
-.if ${MACHINE_ARCH} == "sh3eb" || ${MACHINE_ARCH} == "sh3el"
-COPTS.l2cap_signal.c=	-O0
-.endif
-.endif
 SRCS+=	netbt_component.c
 
 .include 

Index: src/usr.sbin/racoon/Makefile
diff -u src/usr.sbin/racoon/Makefile:1.28 src/usr.sbin/racoon/Makefile:1.29
--- src/usr.sbin/racoon/Makefile:1.28	Sat Jan 28 23:42:36 2017
+++ src/usr.sbin/racoon/Makefile	Wed Feb 22 12:17:16 2017
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.28 2017/01/28 23:42:36 christos Exp $
+# $NetBSD: Makefile,v 1.29 2017/02/22 12:17:16 maya Exp $
 
 WARNS?=	0	# XXX third-party program, many issues
 NOCLANGERROR=	# defined
@@ -72,9 +72,4 @@ prsa_tok.c: ${DIST}/src/racoon/prsa_tok.
 prsa_par.c: ${DIST}/src/racoon/prsa_par.y
 	${YACC} -pprsa -d -o ${.TARGET} ${.ALLSRC}
 
-.if defined(HAVE_GCC) && ${HAVE_GCC} == 48
-.if ${MACHINE_ARCH} == "sh3el"
-COPTS.ipsec_doi.c=	-O0
-.endif
-.endif
 .include 



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

2017-02-22 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Wed Feb 22 11:20:59 UTC 2017

Modified Files:
src/sys/rump/librump/rumpkern: emul.c

Log Message:
Add weak aliases for _fstrans_start() and fstrans_done().


To generate a diff of this commit:
cvs rdiff -u -r1.180 -r1.181 src/sys/rump/librump/rumpkern/emul.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/librump/rumpkern/emul.c
diff -u src/sys/rump/librump/rumpkern/emul.c:1.180 src/sys/rump/librump/rumpkern/emul.c:1.181
--- src/sys/rump/librump/rumpkern/emul.c:1.180	Thu Dec 22 16:05:15 2016
+++ src/sys/rump/librump/rumpkern/emul.c	Wed Feb 22 11:20:59 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: emul.c,v 1.180 2016/12/22 16:05:15 cherry Exp $	*/
+/*	$NetBSD: emul.c,v 1.181 2017/02/22 11:20:59 hannken Exp $	*/
 
 /*
  * Copyright (c) 2007-2011 Antti Kantee.  All Rights Reserved.
@@ -26,11 +26,12 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: emul.c,v 1.180 2016/12/22 16:05:15 cherry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: emul.c,v 1.181 2017/02/22 11:20:59 hannken Exp $");
 
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -240,6 +241,25 @@ void (*delay_func)(unsigned int) = rump_
 __strong_alias(delay,rump_delay);
 __strong_alias(_delay,rump_delay);
 
+/* Weak aliases for fstrans to be used unless librumpvfs is present. */
+
+int rump__fstrans_start(struct mount *, enum fstrans_lock_type, int);
+int
+rump__fstrans_start(struct mount *mp, enum fstrans_lock_type lock, int wait)
+{
+
+	return 0;
+}
+__weak_alias(_fstrans_start,rump__fstrans_start);
+
+void rump_fstrans_done(struct mount *);
+void
+rump_fstrans_done(struct mount *mp)
+{
+
+}
+__weak_alias(fstrans_done,rump_fstrans_done);
+
 /*
  * Provide weak aliases for tty routines used by printf.
  * They will be used unless the rumpkern_tty component is present.



CVS commit: src/sys

2017-02-22 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Wed Feb 22 09:50:13 UTC 2017

Modified Files:
src/sys/fs/msdosfs: msdosfs_vfsops.c
src/sys/kern: vfs_mount.c
src/sys/sys: param.h
src/sys/ufs/ffs: ffs_vfsops.c

Log Message:
Enable fstrans on all file systems.

Welcome to 7.99.61


To generate a diff of this commit:
cvs rdiff -u -r1.122 -r1.123 src/sys/fs/msdosfs/msdosfs_vfsops.c
cvs rdiff -u -r1.47 -r1.48 src/sys/kern/vfs_mount.c
cvs rdiff -u -r1.527 -r1.528 src/sys/sys/param.h
cvs rdiff -u -r1.345 -r1.346 src/sys/ufs/ffs/ffs_vfsops.c

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

Modified files:

Index: src/sys/fs/msdosfs/msdosfs_vfsops.c
diff -u src/sys/fs/msdosfs/msdosfs_vfsops.c:1.122 src/sys/fs/msdosfs/msdosfs_vfsops.c:1.123
--- src/sys/fs/msdosfs/msdosfs_vfsops.c:1.122	Fri Feb 17 08:31:24 2017
+++ src/sys/fs/msdosfs/msdosfs_vfsops.c	Wed Feb 22 09:50:13 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: msdosfs_vfsops.c,v 1.122 2017/02/17 08:31:24 hannken Exp $	*/
+/*	$NetBSD: msdosfs_vfsops.c,v 1.123 2017/02/22 09:50:13 hannken Exp $	*/
 
 /*-
  * Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank.
@@ -48,7 +48,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: msdosfs_vfsops.c,v 1.122 2017/02/17 08:31:24 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: msdosfs_vfsops.c,v 1.123 2017/02/22 09:50:13 hannken Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_netbsd.h"
@@ -478,10 +478,6 @@ msdosfs_mountfs(struct vnode *devvp, str
 	bp  = NULL; /* both used in error_exit */
 	pmp = NULL;
 
-	error = fstrans_mount(mp);
-	if (error)
-		goto error_exit;
-
 	error = getdisksize(devvp, , );
 	if (error) {
 		if (argp->flags & MSDOSFSMNT_GEMDOSFS)
@@ -858,7 +854,6 @@ msdosfs_mountfs(struct vnode *devvp, str
 	return (0);
 
 error_exit:
-	fstrans_unmount(mp);
 	if (bp)
 		brelse(bp, BC_AGE);
 	if (pmp) {
@@ -923,7 +918,6 @@ msdosfs_unmount(struct mount *mp, int mn
 	free(pmp, M_MSDOSFSMNT);
 	mp->mnt_data = NULL;
 	mp->mnt_flag &= ~MNT_LOCAL;
-	fstrans_unmount(mp);
 	return (0);
 }
 

Index: src/sys/kern/vfs_mount.c
diff -u src/sys/kern/vfs_mount.c:1.47 src/sys/kern/vfs_mount.c:1.48
--- src/sys/kern/vfs_mount.c:1.47	Fri Jan 27 10:50:10 2017
+++ src/sys/kern/vfs_mount.c	Wed Feb 22 09:50:13 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_mount.c,v 1.47 2017/01/27 10:50:10 hannken Exp $	*/
+/*	$NetBSD: vfs_mount.c,v 1.48 2017/02/22 09:50:13 hannken Exp $	*/
 
 /*-
  * Copyright (c) 1997-2011 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vfs_mount.c,v 1.47 2017/01/27 10:50:10 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_mount.c,v 1.48 2017/02/22 09:50:13 hannken Exp $");
 
 #include 
 #include 
@@ -82,6 +82,7 @@ __KERNEL_RCSID(0, "$NetBSD: vfs_mount.c,
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -710,6 +711,12 @@ mount_domount(struct lwp *l, vnode_t **v
 		return ENOMEM;
 	}
 
+	if ((error = fstrans_mount(mp)) != 0) {
+		vfs_unbusy(mp, false, NULL);
+		vfs_destroy(mp);
+		return error;
+	}
+
 	mp->mnt_stat.f_owner = kauth_cred_geteuid(l->l_cred);
 
 	/*
@@ -794,6 +801,7 @@ err_mounted:
 err_unmounted:
 	vp->v_mountedhere = NULL;
 	mutex_exit(>mnt_updating);
+	fstrans_unmount(mp);
 	vfs_unbusy(mp, false, NULL);
 	vfs_destroy(mp);
 
@@ -919,6 +927,7 @@ dounmount(struct mount *mp, int flags, s
 		mutex_exit(_mutex);
 	vfs_hooks_unmount(mp);
 
+	fstrans_unmount(mp);
 	vfs_destroy(mp);	/* reference from mount() */
 	if (coveredvp != NULLVP) {
 		vrele(coveredvp);
@@ -1200,6 +1209,8 @@ done:
 		mp = TAILQ_FIRST();
 		mp->mnt_flag |= MNT_ROOTFS;
 		mp->mnt_op->vfs_refcount++;
+		error = fstrans_mount(mp);
+		KASSERT(error == 0);
 
 		/*
 		 * Get the vnode for '/'.  Set cwdi0.cwdi_cdir to

Index: src/sys/sys/param.h
diff -u src/sys/sys/param.h:1.527 src/sys/sys/param.h:1.528
--- src/sys/sys/param.h:1.527	Fri Feb 17 08:32:04 2017
+++ src/sys/sys/param.h	Wed Feb 22 09:50:13 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: param.h,v 1.527 2017/02/17 08:32:04 hannken Exp $	*/
+/*	$NetBSD: param.h,v 1.528 2017/02/22 09:50:13 hannken Exp $	*/
 
 /*-
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -67,7 +67,7 @@
  *	2.99.9		(299000900)
  */
 
-#define	__NetBSD_Version__	799006000	/* NetBSD 7.99.60 */
+#define	__NetBSD_Version__	799006100	/* NetBSD 7.99.61 */
 
 #define __NetBSD_Prereq__(M,m,p) (M) * 1) + \
 (m) * 100) + (p) * 100) <= __NetBSD_Version__)

Index: src/sys/ufs/ffs/ffs_vfsops.c
diff -u src/sys/ufs/ffs/ffs_vfsops.c:1.345 src/sys/ufs/ffs/ffs_vfsops.c:1.346
--- src/sys/ufs/ffs/ffs_vfsops.c:1.345	Fri Feb 17 08:31:26 2017
+++ src/sys/ufs/ffs/ffs_vfsops.c	Wed Feb 22 09:50:13 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: ffs_vfsops.c,v 1.345 2017/02/17 08:31:26 hannken Exp $	*/
+/*	$NetBSD: ffs_vfsops.c,v 1.346 2017/02/22 09:50:13 hannken Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -61,7 +61,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, 

CVS commit: src/sys

2017-02-22 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Wed Feb 22 09:47:18 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.96 -r1.97 src/sys/kern/vnode_if.c
cvs rdiff -u -r1.20 -r1.21 src/sys/rump/include/rump/rumpvnode_if.h
cvs rdiff -u -r1.20 -r1.21 src/sys/rump/librump/rumpvfs/rumpvnode_if.c
cvs rdiff -u -r1.91 -r1.92 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.96 src/sys/kern/vnode_if.c:1.97
--- src/sys/kern/vnode_if.c:1.96	Tue Jan 26 23:30:10 2016
+++ src/sys/kern/vnode_if.c	Wed Feb 22 09:47:18 2017
@@ -1,13 +1,13 @@
-/*	$NetBSD: vnode_if.c,v 1.96 2016/01/26 23:30:10 pooka Exp $	*/
+/*	$NetBSD: vnode_if.c,v 1.97 2017/02/22 09:47:18 hannken 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.69 2015/04/20 23:08:07 riastradh Exp
+ *	NetBSD: vnode_if.src,v 1.70 2017/02/22 09:45:51 hannken Exp
  * by the script:
- *	NetBSD: vnode_if.sh,v 1.60 2014/01/13 12:07:55 hannken Exp
+ *	NetBSD: vnode_if.sh,v 1.62 2017/02/22 09:45:51 hannken Exp
  */
 
 /*
@@ -40,13 +40,14 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vnode_if.c,v 1.96 2016/01/26 23:30:10 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vnode_if.c,v 1.97 2017/02/22 09:47:18 hannken Exp $");
 
 #include 
 #include 
 #include 
 #include 
 #include 
+#include 
 
 const struct vnodeop_desc vop_default_desc = {
 	0,
@@ -79,12 +80,15 @@ VOP_BWRITE(struct vnode *vp,
 	int error;
 	bool mpsafe;
 	struct vop_bwrite_args a;
+	struct mount *mp = vp->v_mount;
 	a.a_desc = VDESC(vop_bwrite);
 	a.a_vp = vp;
 	a.a_bp = bp;
 	mpsafe = (vp->v_vflag & VV_MPSAFE);
 	if (!mpsafe) { KERNEL_LOCK(1, curlwp); }
+	fstrans_start(mp, FSTRANS_SHARED);
 	error = (VCALL(vp, VOFFSET(vop_bwrite), ));
+	fstrans_done(mp);
 	if (!mpsafe) { KERNEL_UNLOCK_ONE(curlwp); }
 	return error;
 }
@@ -588,12 +592,15 @@ VOP_POLL(struct vnode *vp,
 	int error;
 	bool mpsafe;
 	struct vop_poll_args a;
+	struct mount *mp = vp->v_mount;
 	a.a_desc = VDESC(vop_poll);
 	a.a_vp = vp;
 	a.a_events = events;
 	mpsafe = (vp->v_vflag & VV_MPSAFE);
 	if (!mpsafe) { KERNEL_LOCK(1, curlwp); }
+	fstrans_start(mp, FSTRANS_SHARED);
 	error = (VCALL(vp, VOFFSET(vop_poll), ));
+	fstrans_done(mp);
 	if (!mpsafe) { KERNEL_UNLOCK_ONE(curlwp); }
 	return error;
 }
@@ -618,12 +625,15 @@ VOP_KQFILTER(struct vnode *vp,
 	int error;
 	bool mpsafe;
 	struct vop_kqfilter_args a;
+	struct mount *mp = vp->v_mount;
 	a.a_desc = VDESC(vop_kqfilter);
 	a.a_vp = vp;
 	a.a_kn = kn;
 	mpsafe = (vp->v_vflag & VV_MPSAFE);
 	if (!mpsafe) { KERNEL_LOCK(1, curlwp); }
+	fstrans_start(mp, FSTRANS_SHARED);
 	error = (VCALL(vp, VOFFSET(vop_kqfilter), ));
+	fstrans_done(mp);
 	if (!mpsafe) { KERNEL_UNLOCK_ONE(curlwp); }
 	return error;
 }
@@ -679,13 +689,16 @@ VOP_MMAP(struct vnode *vp,
 	int error;
 	bool mpsafe;
 	struct vop_mmap_args a;
+	struct mount *mp = vp->v_mount;
 	a.a_desc = VDESC(vop_mmap);
 	a.a_vp = vp;
 	a.a_prot = prot;
 	a.a_cred = cred;
 	mpsafe = (vp->v_vflag & VV_MPSAFE);
 	if (!mpsafe) { KERNEL_LOCK(1, curlwp); }
+	fstrans_start(mp, FSTRANS_SHARED);
 	error = (VCALL(vp, VOFFSET(vop_mmap), ));
+	fstrans_done(mp);
 	if (!mpsafe) { KERNEL_UNLOCK_ONE(curlwp); }
 	return error;
 }
@@ -748,6 +761,7 @@ VOP_SEEK(struct vnode *vp,
 	int error;
 	bool mpsafe;
 	struct vop_seek_args a;
+	struct mount *mp = vp->v_mount;
 	a.a_desc = VDESC(vop_seek);
 	a.a_vp = vp;
 	a.a_oldoff = oldoff;
@@ -755,7 +769,9 @@ VOP_SEEK(struct vnode *vp,
 	a.a_cred = cred;
 	mpsafe = (vp->v_vflag & VV_MPSAFE);
 	if (!mpsafe) { KERNEL_LOCK(1, curlwp); }
+	fstrans_start(mp, FSTRANS_SHARED);
 	error = (VCALL(vp, VOFFSET(vop_seek), ));
+	fstrans_done(mp);
 	if (!mpsafe) { KERNEL_UNLOCK_ONE(curlwp); }
 	return error;
 }
@@ -853,6 +869,7 @@ VOP_RENAME(struct vnode *fdvp,
 	int error;
 	bool mpsafe;
 	struct vop_rename_args a;
+	struct mount *mp = fdvp->v_mount;
 	a.a_desc = VDESC(vop_rename);
 	a.a_fdvp = fdvp;
 	a.a_fvp = fvp;
@@ -862,7 +879,9 @@ VOP_RENAME(struct vnode *fdvp,
 	a.a_tcnp = tcnp;
 	mpsafe = (fdvp->v_vflag & VV_MPSAFE);
 	if (!mpsafe) { KERNEL_LOCK(1, curlwp); }
+	fstrans_start(mp, FSTRANS_SHARED);
 	error = (VCALL(fdvp, VOFFSET(vop_rename), ));
+	fstrans_done(mp);
 	if (!mpsafe) { KERNEL_UNLOCK_ONE(curlwp); }
 	return error;
 }
@@ -1070,12 +1089,15 @@ VOP_ABORTOP(struct vnode *dvp,
 	int error;
 	bool mpsafe;
 	struct vop_abortop_args a;
+	struct mount *mp = dvp->v_mount;
 	a.a_desc = VDESC(vop_abortop);
 	a.a_dvp = dvp;
 	a.a_cnp = cnp;
 	mpsafe = (dvp->v_vflag & VV_MPSAFE);
 	if (!mpsafe) { KERNEL_LOCK(1, curlwp); 

CVS commit: src/sys/kern

2017-02-22 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Wed Feb 22 09:45:52 UTC 2017

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

Log Message:
Prepare to move fstrans into vnode_if.c, allow "FSTRANS=YES"
and "FSTRANS=NO" in the vop description.
Add fstrans_start()/fstrans_done() to all vops that have FSTRANS=YES
or have the first vnode unlocked.


To generate a diff of this commit:
cvs rdiff -u -r1.61 -r1.62 src/sys/kern/vnode_if.sh
cvs rdiff -u -r1.69 -r1.70 src/sys/kern/vnode_if.src

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

Modified files:

Index: src/sys/kern/vnode_if.sh
diff -u src/sys/kern/vnode_if.sh:1.61 src/sys/kern/vnode_if.sh:1.62
--- src/sys/kern/vnode_if.sh:1.61	Tue Jan 26 23:28:06 2016
+++ src/sys/kern/vnode_if.sh	Wed Feb 22 09:45:51 2017
@@ -29,7 +29,7 @@ copyright="\
  * SUCH DAMAGE.
  */
 "
-SCRIPT_ID='$NetBSD: vnode_if.sh,v 1.61 2016/01/26 23:28:06 pooka Exp $'
+SCRIPT_ID='$NetBSD: vnode_if.sh,v 1.62 2017/02/22 09:45:51 hannken Exp $'
 
 # Script to produce VFS front-end sugar.
 #
@@ -100,6 +100,7 @@ awk_parser='
 	args_name=$1;
 	argc=0;
 	willmake=-1;
+	fstrans=0;
 	next;
 }
 # Last line of description
@@ -112,6 +113,12 @@ awk_parser='
 	if ($1 == "VERSION") {
 		args_name=args_name "_v" $2;
 		next;
+	} else if ($1 == "FSTRANS=YES") {
+		fstrans = 1;
+		next;
+	} else if ($1 == "FSTRANS=NO") {
+		fstrans = -1;
+		next;
 	}
 
 	argdir[argc] = $1; i=2;
@@ -144,6 +151,8 @@ awk_parser='
 		willmake=argc;
 		i++;
 	}
+	if (argc == 0 && fstrans == 0 && lockstate[0] != 1)
+		fstrans = 1;
 
 	# XXX: replace non-portable types for rump.  We should really
 	# nuke the types from the kernel, but that is a battle for
@@ -305,6 +314,7 @@ echo '
 #include 
 #include 
 #include '
+[ -z "${rump}" ] && echo '#include '
 [ ! -z "${rump}" ] && echo '#include '		\
 	&& echo '#include '
 
@@ -397,6 +407,8 @@ function bodyrump() {
 function bodynorm() {
 	printf("{\n\tint error;\n\tbool mpsafe;\n\tstruct %s_args a;\n",
 		args_name);
+	if (fstrans == 1)
+		printf("\tstruct mount *mp = %s->v_mount;\n", argname[0]);
 	if (lockdebug) {
 		printf("#ifdef VNODE_LOCKDEBUG\n");
 		for (i=0; iv_vflag & VV_MPSAFE);\n", argname[0]);
 	printf("\tif (!mpsafe) { KERNEL_LOCK(1, curlwp); }\n");
+	if (fstrans == 1)
+		printf("\tfstrans_start(mp, FSTRANS_SHARED);\n");
 	printf("\terror = (VCALL(%s, VOFFSET(%s), ));\n",
 		argname[0], name);
+	if (fstrans == 1)
+		printf("\tfstrans_done(mp);\n");
 	printf("\tif (!mpsafe) { KERNEL_UNLOCK_ONE(curlwp); }\n");
 	if (willmake != -1) {
 		printf("#ifdef DIAGNOSTIC\n");

Index: src/sys/kern/vnode_if.src
diff -u src/sys/kern/vnode_if.src:1.69 src/sys/kern/vnode_if.src:1.70
--- src/sys/kern/vnode_if.src:1.69	Mon Apr 20 23:08:07 2015
+++ src/sys/kern/vnode_if.src	Wed Feb 22 09:45:51 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: vnode_if.src,v 1.69 2015/04/20 23:08:07 riastradh Exp $
+#	$NetBSD: vnode_if.src,v 1.70 2017/02/22 09:45:51 hannken Exp $
 #
 # Copyright (c) 1992, 1993
 #	The Regents of the University of California.  All rights reserved.
@@ -72,7 +72,7 @@ vop_bwrite {
 #
 vop_lookup {
 	VERSION 2
-	IN struct vnode *dvp;
+	IN LOCKED=YES struct vnode *dvp;
 	OUT WILLMAKE struct vnode **vpp;
 	IN struct componentname *cnp;
 };
@@ -136,7 +136,7 @@ vop_access {
 #% getattrvp  L L L
 #
 vop_getattr {
-	IN struct vnode *vp;
+	IN LOCKED=YES struct vnode *vp;
 	IN struct vattr *vap;
 	IN kauth_cred_t cred;
 };
@@ -192,6 +192,7 @@ vop_fdiscard {
 #% ioctl  vp  U U U
 #
 vop_ioctl {
+	FSTRANS=NO
 	IN LOCKED=NO struct vnode *vp;
 	IN u_long command;
 	IN void *data;
@@ -203,6 +204,7 @@ vop_ioctl {
 #% fcntl  vp  U U U
 #
 vop_fcntl {
+	FSTRANS=NO
 	IN LOCKED=NO struct vnode *vp;
 	IN u_int command;
 	IN void *data;
@@ -230,6 +232,7 @@ vop_kqfilter {
 #% revoke vp  U U U
 #
 vop_revoke {
+	FSTRANS=NO
 	IN LOCKED=NO struct vnode *vp;
 	IN int flags;
 };
@@ -392,6 +395,7 @@ vop_inactive {
 #% reclaimvp  U U U
 #
 vop_reclaim {
+	FSTRANS=NO
 	IN LOCKED=NO struct vnode *vp;
 };
 
@@ -399,6 +403,7 @@ vop_reclaim {
 #% lock   vp  U L U
 #
 vop_lock {
+	FSTRANS=NO
 	IN LOCKED=NO struct vnode *vp;
 	IN int flags;
 };
@@ -407,6 +412,7 @@ vop_lock {
 #% unlock vp  L U L
 #
 vop_unlock {
+	FSTRANS=NO
 	IN LOCKED=YES struct vnode *vp;
 };
 
@@ -441,6 +447,7 @@ vop_print {
 #% islocked   vp  = = =
 #
 vop_islocked {
+	FSTRANS=NO
 	IN struct vnode *vp;
 };
 
@@ -481,6 +488,7 @@ vop_whiteout {
 #% getpages	vp = = =
 #
 vop_getpages {
+	FSTRANS=NO
 	IN struct vnode *vp;
 	IN voff_t offset;
 	IN struct vm_page **m;
@@ -495,6 +503,7 @@ vop_getpages {
 #% putpages	vp = = =
 #
 vop_putpages {
+	FSTRANS=NO
 	IN struct vnode *vp;
 	IN voff_t offlo;
 	IN voff_t offhi;



CVS commit: src/sys/arch

2017-02-22 Thread NONAKA Kimihiro
Module Name:src
Committed By:   nonaka
Date:   Wed Feb 22 09:45:16 UTC 2017

Modified Files:
src/sys/arch/acorn32/podulebus: if_ie.c
src/sys/arch/amiga/dev: if_es.c if_qn.c
src/sys/arch/arm/ep93xx: epe.c
src/sys/arch/arm/xscale: ixp425_if_npe.c
src/sys/arch/mac68k/dev: if_mc.c
src/sys/arch/macppc/dev: am79c950.c
src/sys/arch/newsmips/apbus: if_sn.c
src/sys/arch/sun3/dev: if_ie.c

Log Message:
Apply deferred if_start to more MD drivers.


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/sys/arch/acorn32/podulebus/if_ie.c
cvs rdiff -u -r1.56 -r1.57 src/sys/arch/amiga/dev/if_es.c
cvs rdiff -u -r1.43 -r1.44 src/sys/arch/amiga/dev/if_qn.c
cvs rdiff -u -r1.35 -r1.36 src/sys/arch/arm/ep93xx/epe.c
cvs rdiff -u -r1.32 -r1.33 src/sys/arch/arm/xscale/ixp425_if_npe.c
cvs rdiff -u -r1.44 -r1.45 src/sys/arch/mac68k/dev/if_mc.c
cvs rdiff -u -r1.37 -r1.38 src/sys/arch/macppc/dev/am79c950.c
cvs rdiff -u -r1.37 -r1.38 src/sys/arch/newsmips/apbus/if_sn.c
cvs rdiff -u -r1.61 -r1.62 src/sys/arch/sun3/dev/if_ie.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/acorn32/podulebus/if_ie.c
diff -u src/sys/arch/acorn32/podulebus/if_ie.c:1.38 src/sys/arch/acorn32/podulebus/if_ie.c:1.39
--- src/sys/arch/acorn32/podulebus/if_ie.c:1.38	Thu Dec 15 09:28:02 2016
+++ src/sys/arch/acorn32/podulebus/if_ie.c	Wed Feb 22 09:45:15 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: if_ie.c,v 1.38 2016/12/15 09:28:02 ozaki-r Exp $ */
+/* $NetBSD: if_ie.c,v 1.39 2017/02/22 09:45:15 nonaka Exp $ */
 
 /*
  * Copyright (c) 1995 Melvin Tang-Richardson.
@@ -53,7 +53,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_ie.c,v 1.38 2016/12/15 09:28:02 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ie.c,v 1.39 2017/02/22 09:45:15 nonaka Exp $");
 
 #define IGNORE_ETHER1_IDROM_CHECKSUM
 
@@ -452,6 +452,7 @@ ieattach(device_t parent, device_t self,
 	
 	/* Signed, dated then sent */
 if_attach (ifp);
+	if_deferred_start_init(ifp, NULL);
 	ether_ifattach(ifp, hwaddr);
 
 	/* "Hmm," said nuts, "what if the attach fails" */
@@ -1555,7 +1556,7 @@ ietint(struct ie_softc *sc)
 if ( sc->xmit_free
-__KERNEL_RCSID(0, "$NetBSD: if_es.c,v 1.56 2016/12/15 09:28:02 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_es.c,v 1.57 2017/02/22 09:45:15 nonaka Exp $");
 
 
 #include 
@@ -185,6 +185,7 @@ esattach(device_t parent, device_t self,
 
 	/* Attach the interface. */
 	if_attach(ifp);
+	if_deferred_start_init(ifp, NULL);
 	ether_ifattach(ifp, myaddr);
 
 	/* Print additional info when attached. */
@@ -292,7 +293,7 @@ esinit(struct es_softc *sc)
 	ifp->if_flags &= ~IFF_OACTIVE;
 
 	/* Attempt to start output, if any. */
-	esstart(ifp);
+	if_schedule_deferred_start(ifp);
 
 	splx(s);
 }

Index: src/sys/arch/amiga/dev/if_qn.c
diff -u src/sys/arch/amiga/dev/if_qn.c:1.43 src/sys/arch/amiga/dev/if_qn.c:1.44
--- src/sys/arch/amiga/dev/if_qn.c:1.43	Thu Dec 15 09:28:02 2016
+++ src/sys/arch/amiga/dev/if_qn.c	Wed Feb 22 09:45:15 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_qn.c,v 1.43 2016/12/15 09:28:02 ozaki-r Exp $ */
+/*	$NetBSD: if_qn.c,v 1.44 2017/02/22 09:45:15 nonaka Exp $ */
 
 /*
  * Copyright (c) 1995 Mika Kortelainen
@@ -66,7 +66,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_qn.c,v 1.43 2016/12/15 09:28:02 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_qn.c,v 1.44 2017/02/22 09:45:15 nonaka Exp $");
 
 #include "qn.h"
 #if NQN > 0
@@ -237,6 +237,7 @@ qnattach(device_t parent, device_t self,
 
 	/* Attach the interface. */
 	if_attach(ifp);
+	if_deferred_start_init(ifp, NULL);
 	ether_ifattach(ifp, myaddr);
 
 #ifdef QN_DEBUG
@@ -292,7 +293,7 @@ qninit(struct qn_softc *sc)
 	*sc->nic_reset = ENABLE_DLC;
 
 	/* Attempt to start output, if any. */
-	qnstart(ifp);
+	if_schedule_deferred_start(ifp);
 }
 
 /*
@@ -779,7 +780,7 @@ qnintr(void *arg)
 		qn_rint(sc, rint);
 
 	if ((sc->sc_ethercom.ec_if.if_flags & IFF_OACTIVE) == 0)
-		qnstart(>sc_ethercom.ec_if);
+		if_schedule_deferred_start(>sc_ethercom.ec_if);
 	else if (return_tintmask == 1)
 		*sc->nic_t_mask = tintmask;
 

Index: src/sys/arch/arm/ep93xx/epe.c
diff -u src/sys/arch/arm/ep93xx/epe.c:1.35 src/sys/arch/arm/ep93xx/epe.c:1.36
--- src/sys/arch/arm/ep93xx/epe.c:1.35	Thu Dec 15 09:28:02 2016
+++ src/sys/arch/arm/ep93xx/epe.c	Wed Feb 22 09:45:15 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: epe.c,v 1.35 2016/12/15 09:28:02 ozaki-r Exp $	*/
+/*	$NetBSD: epe.c,v 1.36 2017/02/22 09:45:15 nonaka Exp $	*/
 
 /*
  * Copyright (c) 2004 Jesse Off
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: epe.c,v 1.35 2016/12/15 09:28:02 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: epe.c,v 1.36 2017/02/22 09:45:15 nonaka Exp $");
 
 #include 
 #include 
@@ -271,7 +271,7 @@ begin:
 	}
 
 	if (epe_gctx(sc) > 0 && IFQ_IS_EMPTY(>if_snd) == 0) {
-		epe_ifstart(ifp);
+		if_schedule_deferred_start(ifp);
 	} 
 
 	irq = EPE_READ(IntStsC);
@@ 

CVS commit: src

2017-02-22 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Feb 22 09:20:39 UTC 2017

Modified Files:
src/distrib/sets/lists/comp: mi
src/share/man/man9: Makefile

Log Message:
Add links for kmem_intr_alloc.9, kmem_intr_free.9 and kmem_intr_zalloc.9.


To generate a diff of this commit:
cvs rdiff -u -r1.2110 -r1.2111 src/distrib/sets/lists/comp/mi
cvs rdiff -u -r1.401 -r1.402 src/share/man/man9/Makefile

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

Modified files:

Index: src/distrib/sets/lists/comp/mi
diff -u src/distrib/sets/lists/comp/mi:1.2110 src/distrib/sets/lists/comp/mi:1.2111
--- src/distrib/sets/lists/comp/mi:1.2110	Thu Feb 16 08:39:10 2017
+++ src/distrib/sets/lists/comp/mi	Wed Feb 22 09:20:39 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: mi,v 1.2110 2017/02/16 08:39:10 knakahara Exp $
+#	$NetBSD: mi,v 1.2111 2017/02/22 09:20:39 msaitoh Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 ./etc/mtree/set.compcomp-sys-root
@@ -10562,6 +10562,9 @@
 ./usr/share/man/cat9/kmem.0			comp-sys-catman		.cat
 ./usr/share/man/cat9/kmem_alloc.0		comp-sys-catman		.cat
 ./usr/share/man/cat9/kmem_asprintf.0		comp-sys-catman		.cat
+./usr/share/man/cat9/kmem_intr_alloc.0		comp-sys-catman		.cat
+./usr/share/man/cat9/kmem_intr_free.0		comp-sys-catman		.cat
+./usr/share/man/cat9/kmem_intr_zalloc.0		comp-sys-catman		.cat
 ./usr/share/man/cat9/kmem_free.0		comp-sys-catman		.cat
 ./usr/share/man/cat9/kmem_zalloc.0		comp-sys-catman		.cat
 ./usr/share/man/cat9/knote.0			comp-sys-catman		.cat
@@ -17853,6 +17856,9 @@
 ./usr/share/man/html9/kmem.html			comp-sys-htmlman	html
 ./usr/share/man/html9/kmem_alloc.html		comp-sys-htmlman	html
 ./usr/share/man/html9/kmem_asprintf.html	comp-sys-htmlman	html
+./usr/share/man/html9/kmem_intr_alloc.html	comp-sys-htmlman	html
+./usr/share/man/html9/kmem_intr_free.html	comp-sys-htmlman	html
+./usr/share/man/html9/kmem_intr_zalloc.html	comp-sys-htmlman	html
 ./usr/share/man/html9/kmem_free.html		comp-sys-htmlman	html
 ./usr/share/man/html9/kmem_zalloc.html		comp-sys-htmlman	html
 ./usr/share/man/html9/knote.html		comp-sys-htmlman	html
@@ -25296,6 +25302,9 @@
 ./usr/share/man/man9/kmem.9			comp-sys-man		.man
 ./usr/share/man/man9/kmem_alloc.9		comp-sys-man		.man
 ./usr/share/man/man9/kmem_asprintf.9		comp-sys-man		.man
+./usr/share/man/man9/kmem_intr_alloc.9		comp-sys-man		.man
+./usr/share/man/man9/kmem_intr_free.9		comp-sys-man		.man
+./usr/share/man/man9/kmem_intr_zalloc.9		comp-sys-man		.man
 ./usr/share/man/man9/kmem_free.9		comp-sys-man		.man
 ./usr/share/man/man9/kmem_zalloc.9		comp-sys-man		.man
 ./usr/share/man/man9/knote.9			comp-sys-man		.man

Index: src/share/man/man9/Makefile
diff -u src/share/man/man9/Makefile:1.401 src/share/man/man9/Makefile:1.402
--- src/share/man/man9/Makefile:1.401	Sat Jan  7 04:44:12 2017
+++ src/share/man/man9/Makefile	Wed Feb 22 09:20:39 2017
@@ -1,4 +1,4 @@
-#   $NetBSD: Makefile,v 1.401 2017/01/07 04:44:12 ozaki-r Exp $
+#   $NetBSD: Makefile,v 1.402 2017/02/22 09:20:39 msaitoh Exp $
 
 #	Makefile for section 9 (kernel function and variable) manual pages.
 
@@ -429,6 +429,9 @@ MLINKS+=kcpuset.9 kcpuset_create.9 \
 MLINKS+=kmem.9 kmem_alloc.9 \
 	kmem.9 kmem_free.9 \
 	kmem.9 kmem_zalloc.9 \
+	kmem.9 kmem_intr_alloc.9 \
+	kmem.9 kmem_intr_free.9 \
+	kmem.9 kmem_intr_zalloc.9 \
 	kmem.9 kmem_asprintf.9
 MAN+=	kpreempt.9
 MLINKS+=kpreempt.9 kpreempt_disable.9 \



CVS commit: src/distrib/sets/lists/tests

2017-02-22 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Wed Feb 22 09:09:49 UTC 2017

Modified Files:
src/distrib/sets/lists/tests: md.amd64 md.i386 mi

Log Message:
Fix build of !x86 ports

Mark debug/usr/tests/kernel/arch/x86 as MI directory.

Sponsored by 


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/distrib/sets/lists/tests/md.amd64
cvs rdiff -u -r1.3 -r1.4 src/distrib/sets/lists/tests/md.i386
cvs rdiff -u -r1.723 -r1.724 src/distrib/sets/lists/tests/mi

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

Modified files:

Index: src/distrib/sets/lists/tests/md.amd64
diff -u src/distrib/sets/lists/tests/md.amd64:1.1 src/distrib/sets/lists/tests/md.amd64:1.2
--- src/distrib/sets/lists/tests/md.amd64:1.1	Wed Feb 22 01:07:13 2017
+++ src/distrib/sets/lists/tests/md.amd64	Wed Feb 22 09:09:49 2017
@@ -1,6 +1,4 @@
-# $NetBSD: md.amd64,v 1.1 2017/02/22 01:07:13 kamil Exp $
-./usr/libdata/debug/usr/tests/kernel/arch/x86	tests-kernel-tests	compattestfile,atf
-./usr/tests/kernel/arch/x86			tests-kernel-tests	compattestfile,atf
+# $NetBSD: md.amd64,v 1.2 2017/02/22 09:09:49 kamil Exp $
 ./usr/tests/kernel/arch/x86/Atffile		tests-kernel-tests	compattestfile,atf
 ./usr/tests/kernel/arch/x86/Kyuafile		tests-kernel-tests	compattestfile,atf,kyua
 ./usr/tests/kernel/arch/x86/t_ptrace_wait	tests-kernel-tests	compattestfile,atf

Index: src/distrib/sets/lists/tests/md.i386
diff -u src/distrib/sets/lists/tests/md.i386:1.3 src/distrib/sets/lists/tests/md.i386:1.4
--- src/distrib/sets/lists/tests/md.i386:1.3	Wed Feb 22 01:07:13 2017
+++ src/distrib/sets/lists/tests/md.i386	Wed Feb 22 09:09:49 2017
@@ -1,6 +1,4 @@
-# $NetBSD: md.i386,v 1.3 2017/02/22 01:07:13 kamil Exp $
-./usr/libdata/debug/usr/tests/kernel/arch/x86	tests-kernel-tests	compattestfile,atf
-./usr/tests/kernel/arch/x86			tests-kernel-tests	compattestfile,atf
+# $NetBSD: md.i386,v 1.4 2017/02/22 09:09:49 kamil Exp $
 ./usr/tests/kernel/arch/x86/Atffile		tests-kernel-tests	compattestfile,atf
 ./usr/tests/kernel/arch/x86/Kyuafile		tests-kernel-tests	compattestfile,atf,kyua
 ./usr/tests/kernel/arch/x86/t_ptrace_wait	tests-kernel-tests	compattestfile,atf

Index: src/distrib/sets/lists/tests/mi
diff -u src/distrib/sets/lists/tests/mi:1.723 src/distrib/sets/lists/tests/mi:1.724
--- src/distrib/sets/lists/tests/mi:1.723	Tue Feb 21 10:40:30 2017
+++ src/distrib/sets/lists/tests/mi	Wed Feb 22 09:09:49 2017
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.723 2017/02/21 10:40:30 kre Exp $
+# $NetBSD: mi,v 1.724 2017/02/22 09:09:49 kamil Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -58,6 +58,7 @@
 ./usr/libdata/debug/usr/tests/kernel/archtests-kernel-tests	compattestfile,atf
 ./usr/libdata/debug/usr/tests/kernel/arch/amd64tests-kernel-tests	compattestfile,atf
 ./usr/libdata/debug/usr/tests/kernel/arch/i386tests-kernel-tests	compattestfile,atf
+./usr/libdata/debug/usr/tests/kernel/arch/x86tests-kernel-tests	compattestfile,atf
 ./usr/libdata/debug/usr/tests/kernel/kqueuetests-kernel-tests	compattestfile,atf
 ./usr/libdata/debug/usr/tests/kernel/kqueue/read			tests-kernel-tests	compattestfile,atf
 ./usr/libdata/debug/usr/tests/kernel/kqueue/write			tests-kernel-tests	compattestfile,atf
@@ -2107,6 +2108,7 @@
 ./usr/tests/kernel/arch/i386/t_ptrace_wait6	tests-kernel-tests	compattestfile,atf,machine=i386
 ./usr/tests/kernel/arch/i386/t_ptrace_waitid	tests-kernel-tests	compattestfile,atf,machine=i386
 ./usr/tests/kernel/arch/i386/t_ptrace_waitpid	tests-kernel-tests	compattestfile,atf,machine=i386
+./usr/tests/kernel/arch/x86			tests-kernel-tests	compattestfile,atf
 ./usr/tests/kernel/h_ps_strings1		tests-kernel-tests	compattestfile,atf
 ./usr/tests/kernel/h_ps_strings2		tests-kernel-tests	compattestfile,atf
 ./usr/tests/kernel/kqueue			tests-kernel-tests	compattestfile,atf