CVS commit: src/sys/compat/linux/arch/powerpc

2017-02-02 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Feb  3 07:57:11 UTC 2017

Modified Files:
src/sys/compat/linux/arch/powerpc: syscalls.master

Log Message:
Add accept4


To generate a diff of this commit:
cvs rdiff -u -r1.70 -r1.71 src/sys/compat/linux/arch/powerpc/syscalls.master

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

Modified files:

Index: src/sys/compat/linux/arch/powerpc/syscalls.master
diff -u src/sys/compat/linux/arch/powerpc/syscalls.master:1.70 src/sys/compat/linux/arch/powerpc/syscalls.master:1.71
--- src/sys/compat/linux/arch/powerpc/syscalls.master:1.70	Mon Jan  2 16:32:10 2017
+++ src/sys/compat/linux/arch/powerpc/syscalls.master	Fri Feb  3 07:57:11 2017
@@ -1,4 +1,4 @@
-	$NetBSD: syscalls.master,v 1.70 2017/01/02 16:32:10 manu Exp $  
+	$NetBSD: syscalls.master,v 1.71 2017/02/03 07:57:11 martin Exp $  
 
 ;	@(#)syscalls.master	8.1 (Berkeley) 7/19/93
 
@@ -542,3 +542,28 @@
 320	UNIMPL		preadv
 321	UNIMPL		pwritev
 322	UNIMPL		rt_tgsigqueueinfo
+323	UNIMPL
+324	UNIMPL
+325	UNIMPL
+326	UNIMPL
+327	UNIMPL
+328	UNIMPL
+329	UNIMPL
+330	UNIMPL
+331	UNIMPL
+332	UNIMPL
+333	UNIMPL
+334	UNIMPL
+335	UNIMPL
+336	UNIMPL
+337	UNIMPL
+338	UNIMPL
+339	UNIMPL
+340	UNIMPL
+341	UNIMPL
+342	UNIMPL
+343	UNIMPL
+344	STD		{ int|linux_sys||accept4(int s, \
+			struct osockaddr *name, \
+			int *anamelen, int flags); }
+



CVS commit: src/sys/compat/linux/arch/powerpc

2017-02-02 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Feb  3 07:57:22 UTC 2017

Modified Files:
src/sys/compat/linux/arch/powerpc: linux_syscall.h linux_syscallargs.h
linux_syscalls.c linux_sysent.c

Log Message:
regen


To generate a diff of this commit:
cvs rdiff -u -r1.80 -r1.81 src/sys/compat/linux/arch/powerpc/linux_syscall.h \
src/sys/compat/linux/arch/powerpc/linux_sysent.c
cvs rdiff -u -r1.79 -r1.80 \
src/sys/compat/linux/arch/powerpc/linux_syscallargs.h \
src/sys/compat/linux/arch/powerpc/linux_syscalls.c

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

Modified files:

Index: src/sys/compat/linux/arch/powerpc/linux_syscall.h
diff -u src/sys/compat/linux/arch/powerpc/linux_syscall.h:1.80 src/sys/compat/linux/arch/powerpc/linux_syscall.h:1.81
--- src/sys/compat/linux/arch/powerpc/linux_syscall.h:1.80	Mon Jan 16 00:11:09 2017
+++ src/sys/compat/linux/arch/powerpc/linux_syscall.h	Fri Feb  3 07:57:22 2017
@@ -1,10 +1,10 @@
-/* $NetBSD: linux_syscall.h,v 1.80 2017/01/16 00:11:09 christos Exp $ */
+/* $NetBSD: linux_syscall.h,v 1.81 2017/02/03 07:57:22 martin Exp $ */
 
 /*
  * System call numbers.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * created from	NetBSD: syscalls.master,v 1.70 2017/01/02 16:32:10 manu Exp  
+ * created from	NetBSD: syscalls.master,v 1.71 2017/02/03 07:57:11 martin Exp  
  */
 
 #ifndef _LINUX_SYS_SYSCALL_H_
@@ -657,6 +657,9 @@
 /* syscall: "pipe2" ret: "int" args: "int *" "int" */
 #define	LINUX_SYS_pipe2	317
 
-#define	LINUX_SYS_MAXSYSCALL	323
+/* syscall: "accept4" ret: "int" args: "int" "struct osockaddr *" "int *" "int" */
+#define	LINUX_SYS_accept4	344
+
+#define	LINUX_SYS_MAXSYSCALL	345
 #define	LINUX_SYS_NSYSENT	512
 #endif /* _LINUX_SYS_SYSCALL_H_ */
Index: src/sys/compat/linux/arch/powerpc/linux_sysent.c
diff -u src/sys/compat/linux/arch/powerpc/linux_sysent.c:1.80 src/sys/compat/linux/arch/powerpc/linux_sysent.c:1.81
--- src/sys/compat/linux/arch/powerpc/linux_sysent.c:1.80	Mon Jan 16 00:11:09 2017
+++ src/sys/compat/linux/arch/powerpc/linux_sysent.c	Fri Feb  3 07:57:22 2017
@@ -1,14 +1,14 @@
-/* $NetBSD: linux_sysent.c,v 1.80 2017/01/16 00:11:09 christos Exp $ */
+/* $NetBSD: linux_sysent.c,v 1.81 2017/02/03 07:57:22 martin Exp $ */
 
 /*
  * System call switch table.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * created from	NetBSD: syscalls.master,v 1.70 2017/01/02 16:32:10 manu Exp  
+ * created from	NetBSD: syscalls.master,v 1.71 2017/02/03 07:57:11 martin Exp  
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: linux_sysent.c,v 1.80 2017/01/16 00:11:09 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_sysent.c,v 1.81 2017/02/03 07:57:22 martin Exp $");
 
 #include 
 #include 
@@ -1411,8 +1411,10 @@ struct sysent linux_sysent[] = {
 		.sy_call = linux_sys_nosys,
 	},		/* 343 = filler */
 	{
-		.sy_call = linux_sys_nosys,
-	},		/* 344 = filler */
+		ns(struct linux_sys_accept4_args),
+		.sy_flags = SYCALL_ARG_PTR,
+		.sy_call = (sy_call_t *)linux_sys_accept4
+	},		/* 344 = accept4 */
 	{
 		.sy_call = linux_sys_nosys,
 	},		/* 345 = filler */

Index: src/sys/compat/linux/arch/powerpc/linux_syscallargs.h
diff -u src/sys/compat/linux/arch/powerpc/linux_syscallargs.h:1.79 src/sys/compat/linux/arch/powerpc/linux_syscallargs.h:1.80
--- src/sys/compat/linux/arch/powerpc/linux_syscallargs.h:1.79	Mon Jan 16 00:11:09 2017
+++ src/sys/compat/linux/arch/powerpc/linux_syscallargs.h	Fri Feb  3 07:57:22 2017
@@ -1,10 +1,10 @@
-/* $NetBSD: linux_syscallargs.h,v 1.79 2017/01/16 00:11:09 christos Exp $ */
+/* $NetBSD: linux_syscallargs.h,v 1.80 2017/02/03 07:57:22 martin Exp $ */
 
 /*
  * System call argument lists.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * created from	NetBSD: syscalls.master,v 1.70 2017/01/02 16:32:10 manu Exp  
+ * created from	NetBSD: syscalls.master,v 1.71 2017/02/03 07:57:11 martin Exp  
  */
 
 #ifndef _LINUX_SYS_SYSCALLARGS_H_
@@ -1024,6 +1024,14 @@ struct linux_sys_pipe2_args {
 };
 check_syscall_args(linux_sys_pipe2)
 
+struct linux_sys_accept4_args {
+	syscallarg(int) s;
+	syscallarg(struct osockaddr *) name;
+	syscallarg(int *) anamelen;
+	syscallarg(int) flags;
+};
+check_syscall_args(linux_sys_accept4)
+
 /*
  * System call prototypes.
  */
@@ -1452,4 +1460,6 @@ int	linux_sys_dup3(struct lwp *, const s
 
 int	linux_sys_pipe2(struct lwp *, const struct linux_sys_pipe2_args *, register_t *);
 
+int	linux_sys_accept4(struct lwp *, const struct linux_sys_accept4_args *, register_t *);
+
 #endif /* _LINUX_SYS_SYSCALLARGS_H_ */
Index: src/sys/compat/linux/arch/powerpc/linux_syscalls.c
diff -u src/sys/compat/linux/arch/powerpc/linux_syscalls.c:1.79 src/sys/compat/linux/arch/powerpc/linux_syscalls.c:1.80
--- src/sys/compat/linux/arch/powerpc/linux_syscalls.c:1.79	Mon Jan 16 00:11:09 2017
+++ src/sys/compat/linux/arch/powerpc/linux_syscalls.c	Fri Feb  3 07:57:22 2017
@@ -1,14 +1,14 @@
-/* $NetBSD: 

CVS commit: src/sys/compat/linux/arch/m68k

2017-02-02 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Feb  3 07:54:39 UTC 2017

Modified Files:
src/sys/compat/linux/arch/m68k: linux_syscall.h linux_syscallargs.h
linux_syscalls.c linux_sysent.c

Log Message:
regen


To generate a diff of this commit:
cvs rdiff -u -r1.102 -r1.103 src/sys/compat/linux/arch/m68k/linux_syscall.h \
src/sys/compat/linux/arch/m68k/linux_syscalls.c \
src/sys/compat/linux/arch/m68k/linux_sysent.c
cvs rdiff -u -r1.101 -r1.102 \
src/sys/compat/linux/arch/m68k/linux_syscallargs.h

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

Modified files:

Index: src/sys/compat/linux/arch/m68k/linux_syscall.h
diff -u src/sys/compat/linux/arch/m68k/linux_syscall.h:1.102 src/sys/compat/linux/arch/m68k/linux_syscall.h:1.103
--- src/sys/compat/linux/arch/m68k/linux_syscall.h:1.102	Mon Jan 16 00:11:09 2017
+++ src/sys/compat/linux/arch/m68k/linux_syscall.h	Fri Feb  3 07:54:39 2017
@@ -1,10 +1,10 @@
-/* $NetBSD: linux_syscall.h,v 1.102 2017/01/16 00:11:09 christos Exp $ */
+/* $NetBSD: linux_syscall.h,v 1.103 2017/02/03 07:54:39 martin Exp $ */
 
 /*
  * System call numbers.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * created from	NetBSD: syscalls.master,v 1.91 2017/01/02 16:32:09 manu Exp
+ * created from	NetBSD: syscalls.master,v 1.92 2017/02/03 07:54:26 martin Exp
  */
 
 #ifndef _LINUX_SYS_SYSCALL_H_
@@ -720,6 +720,9 @@
 /* syscall: "pipe2" ret: "int" args: "int *" "int" */
 #define	LINUX_SYS_pipe2	327
 
-#define	LINUX_SYS_MAXSYSCALL	337
+/* syscall: "accept4" ret: "int" args: "int" "struct osockaddr *" "int *" "int" */
+#define	LINUX_SYS_accept4	361
+
+#define	LINUX_SYS_MAXSYSCALL	362
 #define	LINUX_SYS_NSYSENT	512
 #endif /* _LINUX_SYS_SYSCALL_H_ */
Index: src/sys/compat/linux/arch/m68k/linux_syscalls.c
diff -u src/sys/compat/linux/arch/m68k/linux_syscalls.c:1.102 src/sys/compat/linux/arch/m68k/linux_syscalls.c:1.103
--- src/sys/compat/linux/arch/m68k/linux_syscalls.c:1.102	Mon Jan 16 00:11:09 2017
+++ src/sys/compat/linux/arch/m68k/linux_syscalls.c	Fri Feb  3 07:54:39 2017
@@ -1,14 +1,14 @@
-/* $NetBSD: linux_syscalls.c,v 1.102 2017/01/16 00:11:09 christos Exp $ */
+/* $NetBSD: linux_syscalls.c,v 1.103 2017/02/03 07:54:39 martin Exp $ */
 
 /*
  * System call names.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * created from	NetBSD: syscalls.master,v 1.91 2017/01/02 16:32:09 manu Exp
+ * created from	NetBSD: syscalls.master,v 1.92 2017/02/03 07:54:26 martin Exp
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: linux_syscalls.c,v 1.102 2017/01/16 00:11:09 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_syscalls.c,v 1.103 2017/02/03 07:54:39 martin Exp $");
 
 #if defined(_KERNEL_OPT)
 #if defined(_KERNEL_OPT)
@@ -391,31 +391,31 @@ const char *const linux_syscallnames[] =
 	/* 334 */	"#334 (unimplemented get_thread_area)",
 	/* 335 */	"#335 (unimplemented atomic_cmpxchg_32)",
 	/* 336 */	"#336 (unimplemented atomic_barrier)",
-	/* 337 */	"# filler",
-	/* 338 */	"# filler",
-	/* 339 */	"# filler",
-	/* 340 */	"# filler",
-	/* 341 */	"# filler",
-	/* 342 */	"# filler",
-	/* 343 */	"# filler",
-	/* 344 */	"# filler",
-	/* 345 */	"# filler",
-	/* 346 */	"# filler",
-	/* 347 */	"# filler",
-	/* 348 */	"# filler",
-	/* 349 */	"# filler",
-	/* 350 */	"# filler",
-	/* 351 */	"# filler",
-	/* 352 */	"# filler",
-	/* 353 */	"# filler",
-	/* 354 */	"# filler",
-	/* 355 */	"# filler",
-	/* 356 */	"# filler",
-	/* 357 */	"# filler",
-	/* 358 */	"# filler",
-	/* 359 */	"# filler",
-	/* 360 */	"# filler",
-	/* 361 */	"# filler",
+	/* 337 */	"#337 (unimplemented)",
+	/* 338 */	"#338 (unimplemented)",
+	/* 339 */	"#339 (unimplemented)",
+	/* 340 */	"#340 (unimplemented)",
+	/* 341 */	"#341 (unimplemented)",
+	/* 342 */	"#342 (unimplemented)",
+	/* 343 */	"#343 (unimplemented)",
+	/* 344 */	"#344 (unimplemented)",
+	/* 345 */	"#345 (unimplemented)",
+	/* 346 */	"#346 (unimplemented)",
+	/* 347 */	"#347 (unimplemented)",
+	/* 348 */	"#348 (unimplemented)",
+	/* 349 */	"#349 (unimplemented)",
+	/* 350 */	"#350 (unimplemented)",
+	/* 351 */	"#351 (unimplemented)",
+	/* 352 */	"#352 (unimplemented)",
+	/* 353 */	"#353 (unimplemented)",
+	/* 354 */	"#354 (unimplemented)",
+	/* 355 */	"#355 (unimplemented)",
+	/* 356 */	"#356 (unimplemented)",
+	/* 357 */	"#357 (unimplemented)",
+	/* 358 */	"#358 (unimplemented)",
+	/* 359 */	"#359 (unimplemented)",
+	/* 360 */	"#360 (unimplemented)",
+	/* 361 */	"accept4",
 	/* 362 */	"# filler",
 	/* 363 */	"# filler",
 	/* 364 */	"# filler",
@@ -929,31 +929,31 @@ const char *const altlinux_syscallnames[
 	/* 334 */	NULL, /* unimplemented get_thread_area */
 	/* 335 */	NULL, /* unimplemented atomic_cmpxchg_32 */
 	/* 336 */	NULL, /* unimplemented atomic_barrier */
-	/* 337 */	NULL, /* filler */
-	/* 338 */	NULL, /* filler */
-	/* 339 */	NULL, /* filler */
-	/* 340 */	NULL, /* filler */
-	/* 341 */	NULL, /* filler */
-	/* 342 */	NULL, /* 

CVS commit: [nick-nhusb] src/sys/dev/usb

2017-02-02 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Feb  3 07:54:44 UTC 2017

Modified Files:
src/sys/dev/usb [nick-nhusb]: if_kue.c

Log Message:
Sync with HEAD


To generate a diff of this commit:
cvs rdiff -u -r1.81.4.11 -r1.81.4.12 src/sys/dev/usb/if_kue.c

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

Modified files:

Index: src/sys/dev/usb/if_kue.c
diff -u src/sys/dev/usb/if_kue.c:1.81.4.11 src/sys/dev/usb/if_kue.c:1.81.4.12
--- src/sys/dev/usb/if_kue.c:1.81.4.11	Mon Dec  5 10:55:18 2016
+++ src/sys/dev/usb/if_kue.c	Fri Feb  3 07:54:44 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_kue.c,v 1.81.4.11 2016/12/05 10:55:18 skrll Exp $	*/
+/*	$NetBSD: if_kue.c,v 1.81.4.12 2017/02/03 07:54:44 skrll Exp $	*/
 
 /*
  * Copyright (c) 1997, 1998, 1999, 2000
@@ -71,7 +71,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_kue.c,v 1.81.4.11 2016/12/05 10:55:18 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_kue.c,v 1.81.4.12 2017/02/03 07:54:44 skrll Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -500,7 +500,7 @@ kue_attach(device_t parent, device_t sel
 	ifp->if_ioctl = kue_ioctl;
 	ifp->if_start = kue_start;
 	ifp->if_watchdog = kue_watchdog;
-	strncpy(ifp->if_xname, device_xname(sc->kue_dev), IFNAMSIZ);
+	strlcpy(ifp->if_xname, device_xname(sc->kue_dev), IFNAMSIZ);
 
 	IFQ_SET_READY(>if_snd);
 



CVS commit: src/sys/compat/linux/arch/m68k

2017-02-02 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Feb  3 07:54:26 UTC 2017

Modified Files:
src/sys/compat/linux/arch/m68k: syscalls.master

Log Message:
Add accept4


To generate a diff of this commit:
cvs rdiff -u -r1.91 -r1.92 src/sys/compat/linux/arch/m68k/syscalls.master

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

Modified files:

Index: src/sys/compat/linux/arch/m68k/syscalls.master
diff -u src/sys/compat/linux/arch/m68k/syscalls.master:1.91 src/sys/compat/linux/arch/m68k/syscalls.master:1.92
--- src/sys/compat/linux/arch/m68k/syscalls.master:1.91	Mon Jan  2 16:32:09 2017
+++ src/sys/compat/linux/arch/m68k/syscalls.master	Fri Feb  3 07:54:26 2017
@@ -1,4 +1,4 @@
-	$NetBSD: syscalls.master,v 1.91 2017/01/02 16:32:09 manu Exp $
+	$NetBSD: syscalls.master,v 1.92 2017/02/03 07:54:26 martin Exp $
 
 ;	@(#)syscalls.master	8.1 (Berkeley) 7/19/93
 
@@ -558,3 +558,31 @@
 334	UNIMPL		get_thread_area
 335	UNIMPL		atomic_cmpxchg_32
 336	UNIMPL		atomic_barrier
+337	UNIMPL
+338	UNIMPL
+339	UNIMPL
+340	UNIMPL
+341	UNIMPL
+342	UNIMPL
+343	UNIMPL
+344	UNIMPL
+345	UNIMPL
+346	UNIMPL
+347	UNIMPL
+348	UNIMPL
+349	UNIMPL
+350	UNIMPL
+351	UNIMPL
+352	UNIMPL
+353	UNIMPL
+354	UNIMPL
+355	UNIMPL
+356	UNIMPL
+357	UNIMPL
+358	UNIMPL
+359	UNIMPL
+360	UNIMPL
+361	STD		{ int|linux_sys||accept4(int s, \
+			struct osockaddr *name, \
+			int *anamelen, int flags); }
+



CVS commit: [nick-nhusb] src/sys/dev/usb

2017-02-02 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Feb  3 07:48:05 UTC 2017

Modified Files:
src/sys/dev/usb [nick-nhusb]: if_axe.c if_smsc.c

Log Message:
Simplify.  No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.67.4.13 -r1.67.4.14 src/sys/dev/usb/if_axe.c
cvs rdiff -u -r1.22.2.29 -r1.22.2.30 src/sys/dev/usb/if_smsc.c

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

Modified files:

Index: src/sys/dev/usb/if_axe.c
diff -u src/sys/dev/usb/if_axe.c:1.67.4.13 src/sys/dev/usb/if_axe.c:1.67.4.14
--- src/sys/dev/usb/if_axe.c:1.67.4.13	Mon Dec 12 13:15:39 2016
+++ src/sys/dev/usb/if_axe.c	Fri Feb  3 07:48:05 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_axe.c,v 1.67.4.13 2016/12/12 13:15:39 skrll Exp $	*/
+/*	$NetBSD: if_axe.c,v 1.67.4.14 2017/02/03 07:48:05 skrll Exp $	*/
 /*	$OpenBSD: if_axe.c,v 1.137 2016/04/13 11:03:37 mpi Exp $ */
 
 /*
@@ -87,7 +87,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_axe.c,v 1.67.4.13 2016/12/12 13:15:39 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_axe.c,v 1.67.4.14 2017/02/03 07:48:05 skrll Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -1877,12 +1877,12 @@ axe_ioctl(struct ifnet *ifp, u_long cmd,
 
 	if (error == ENETRESET) {
 		error = 0;
-		if (cmd != SIOCADDMULTI && cmd != SIOCDELMULTI)
-			;
-		else if (ifp->if_flags & IFF_RUNNING) {
-			mutex_enter(>axe_lock);
-			axe_setmulti(sc);
-			mutex_exit(>axe_lock);
+		if (cmd == SIOCADDMULTI || cmd == SIOCDELMULTI) {
+			if (ifp->if_flags & IFF_RUNNING) {
+mutex_enter(>axe_lock);
+axe_setmulti(sc);
+mutex_exit(>axe_lock);
+			}
 		}
 	}
 

Index: src/sys/dev/usb/if_smsc.c
diff -u src/sys/dev/usb/if_smsc.c:1.22.2.29 src/sys/dev/usb/if_smsc.c:1.22.2.30
--- src/sys/dev/usb/if_smsc.c:1.22.2.29	Thu Feb  2 07:40:51 2017
+++ src/sys/dev/usb/if_smsc.c	Fri Feb  3 07:48:05 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_smsc.c,v 1.22.2.29 2017/02/02 07:40:51 skrll Exp $	*/
+/*	$NetBSD: if_smsc.c,v 1.22.2.30 2017/02/03 07:48:05 skrll Exp $	*/
 
 /*	$OpenBSD: if_smsc.c,v 1.4 2012/09/27 12:38:11 jsg Exp $	*/
 /*	$FreeBSD: src/sys/dev/usb/net/if_smsc.c,v 1.1 2012/08/15 04:03:55 gonzo Exp $ */
@@ -978,12 +978,12 @@ smsc_ioctl(struct ifnet *ifp, u_long cmd
 
 	if (error == ENETRESET) {
 		error = 0;
-		if (cmd != SIOCADDMULTI && cmd != SIOCDELMULTI)
-			;
-		else if (ifp->if_flags & IFF_RUNNING) {
-			mutex_enter(>sc_lock);
-			smsc_setmulti(sc);
-			mutex_exit(>sc_lock);
+		if (cmd == SIOCADDMULTI || cmd == SIOCDELMULTI) {
+			if (ifp->if_flags & IFF_RUNNING) {
+mutex_enter(>sc_lock);
+smsc_setmulti(sc);
+mutex_exit(>sc_lock);
+			}
 		}
 	}
 	return error;



CVS commit: src/share/man/man5

2017-02-02 Thread Abhinav Upadhyay
Module Name:src
Committed By:   abhinav
Date:   Fri Feb  3 07:42:43 UTC 2017

Modified Files:
src/share/man/man5: ttyaction.5

Log Message:
Use Xr to refer fnmatch(3).


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/share/man/man5/ttyaction.5

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

Modified files:

Index: src/share/man/man5/ttyaction.5
diff -u src/share/man/man5/ttyaction.5:1.8 src/share/man/man5/ttyaction.5:1.9
--- src/share/man/man5/ttyaction.5:1.8	Wed Apr 30 13:10:57 2008
+++ src/share/man/man5/ttyaction.5	Fri Feb  3 07:42:43 2017
@@ -1,4 +1,4 @@
-.\" $NetBSD: ttyaction.5,v 1.8 2008/04/30 13:10:57 martin Exp $
+.\" $NetBSD: ttyaction.5,v 1.9 2017/02/03 07:42:43 abhinav Exp $
 .\"
 .\" Copyright (c) 1996 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -64,7 +64,7 @@ The first two fields are delimited with 
 and the command field is all text to the end of the line.
 Either or both of first two fields may contain wildcard
 match patterns as implemented by the
-.Fn fnmatch
+.Xr fnmatch 3
 library function.
 .Pp
 All command strings are executed by passing them to



CVS commit: src/sys/compat/linux/arch

2017-02-02 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Feb  3 06:07:29 UTC 2017

Modified Files:
src/sys/compat/linux/arch/alpha: linux_syscall.h linux_syscallargs.h
linux_syscalls.c linux_sysent.c
src/sys/compat/linux/arch/arm: linux_syscall.h linux_syscallargs.h
linux_syscalls.c linux_sysent.c linux_systrace_args.c

Log Message:
Regen for accept4


To generate a diff of this commit:
cvs rdiff -u -r1.103 -r1.104 src/sys/compat/linux/arch/alpha/linux_syscall.h \
src/sys/compat/linux/arch/alpha/linux_sysent.c
cvs rdiff -u -r1.102 -r1.103 \
src/sys/compat/linux/arch/alpha/linux_syscallargs.h
cvs rdiff -u -r1.104 -r1.105 src/sys/compat/linux/arch/alpha/linux_syscalls.c
cvs rdiff -u -r1.76 -r1.77 src/sys/compat/linux/arch/arm/linux_syscall.h \
src/sys/compat/linux/arch/arm/linux_syscallargs.h \
src/sys/compat/linux/arch/arm/linux_syscalls.c \
src/sys/compat/linux/arch/arm/linux_sysent.c
cvs rdiff -u -r1.9 -r1.10 src/sys/compat/linux/arch/arm/linux_systrace_args.c

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

Modified files:

Index: src/sys/compat/linux/arch/alpha/linux_syscall.h
diff -u src/sys/compat/linux/arch/alpha/linux_syscall.h:1.103 src/sys/compat/linux/arch/alpha/linux_syscall.h:1.104
--- src/sys/compat/linux/arch/alpha/linux_syscall.h:1.103	Mon Jan 16 00:11:09 2017
+++ src/sys/compat/linux/arch/alpha/linux_syscall.h	Fri Feb  3 06:07:29 2017
@@ -1,10 +1,10 @@
-/* $NetBSD: linux_syscall.h,v 1.103 2017/01/16 00:11:09 christos Exp $ */
+/* $NetBSD: linux_syscall.h,v 1.104 2017/02/03 06:07:29 martin Exp $ */
 
 /*
  * System call numbers.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * created from	NetBSD: syscalls.master,v 1.92 2017/01/02 16:32:09 manu Exp
+ * created from	NetBSD: syscalls.master,v 1.93 2017/02/03 06:06:08 martin Exp
  */
 
 #ifndef _LINUX_SYS_SYSCALL_H_
@@ -660,6 +660,9 @@
 /* syscall: "pipe2" ret: "int" args: "int *" "int" */
 #define	LINUX_SYS_pipe2	488
 
-#define	LINUX_SYS_MAXSYSCALL	494
+/* syscall: "accept4" ret: "int" args: "int" "struct osockaddr *" "int *" "int" */
+#define	LINUX_SYS_accept4	502
+
+#define	LINUX_SYS_MAXSYSCALL	503
 #define	LINUX_SYS_NSYSENT	512
 #endif /* _LINUX_SYS_SYSCALL_H_ */
Index: src/sys/compat/linux/arch/alpha/linux_sysent.c
diff -u src/sys/compat/linux/arch/alpha/linux_sysent.c:1.103 src/sys/compat/linux/arch/alpha/linux_sysent.c:1.104
--- src/sys/compat/linux/arch/alpha/linux_sysent.c:1.103	Mon Jan 16 00:11:09 2017
+++ src/sys/compat/linux/arch/alpha/linux_sysent.c	Fri Feb  3 06:07:29 2017
@@ -1,14 +1,14 @@
-/* $NetBSD: linux_sysent.c,v 1.103 2017/01/16 00:11:09 christos Exp $ */
+/* $NetBSD: linux_sysent.c,v 1.104 2017/02/03 06:07:29 martin Exp $ */
 
 /*
  * System call switch table.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * created from	NetBSD: syscalls.master,v 1.92 2017/01/02 16:32:09 manu Exp
+ * created from	NetBSD: syscalls.master,v 1.93 2017/02/03 06:06:08 martin Exp
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: linux_sysent.c,v 1.103 2017/01/16 00:11:09 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_sysent.c,v 1.104 2017/02/03 06:07:29 martin Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_sysv.h"
@@ -1969,8 +1969,10 @@ struct sysent linux_sysent[] = {
 		.sy_call = linux_sys_nosys,
 	},		/* 501 = filler */
 	{
-		.sy_call = linux_sys_nosys,
-	},		/* 502 = filler */
+		ns(struct linux_sys_accept4_args),
+		.sy_flags = SYCALL_ARG_PTR,
+		.sy_call = (sy_call_t *)linux_sys_accept4
+	},		/* 502 = accept4 */
 	{
 		.sy_call = linux_sys_nosys,
 	},		/* 503 = filler */

Index: src/sys/compat/linux/arch/alpha/linux_syscallargs.h
diff -u src/sys/compat/linux/arch/alpha/linux_syscallargs.h:1.102 src/sys/compat/linux/arch/alpha/linux_syscallargs.h:1.103
--- src/sys/compat/linux/arch/alpha/linux_syscallargs.h:1.102	Mon Jan 16 00:11:09 2017
+++ src/sys/compat/linux/arch/alpha/linux_syscallargs.h	Fri Feb  3 06:07:29 2017
@@ -1,10 +1,10 @@
-/* $NetBSD: linux_syscallargs.h,v 1.102 2017/01/16 00:11:09 christos Exp $ */
+/* $NetBSD: linux_syscallargs.h,v 1.103 2017/02/03 06:07:29 martin Exp $ */
 
 /*
  * System call argument lists.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * created from	NetBSD: syscalls.master,v 1.92 2017/01/02 16:32:09 manu Exp
+ * created from	NetBSD: syscalls.master,v 1.93 2017/02/03 06:06:08 martin Exp
  */
 
 #ifndef _LINUX_SYS_SYSCALLARGS_H_
@@ -1127,6 +1127,14 @@ struct linux_sys_pipe2_args {
 };
 check_syscall_args(linux_sys_pipe2)
 
+struct linux_sys_accept4_args {
+	syscallarg(int) s;
+	syscallarg(struct osockaddr *) name;
+	syscallarg(int *) anamelen;
+	syscallarg(int) flags;
+};
+check_syscall_args(linux_sys_accept4)
+
 /*
  * System call prototypes.
  */
@@ -1597,4 +1605,6 @@ int	linux_sys_dup3(struct lwp *, const s
 
 int	linux_sys_pipe2(struct lwp *, const struct linux_sys_pipe2_args *, register_t *);
 
+int	

CVS commit: src/sys/compat/linux/arch

2017-02-02 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Feb  3 06:06:09 UTC 2017

Modified Files:
src/sys/compat/linux/arch/alpha: syscalls.master
src/sys/compat/linux/arch/arm: syscalls.master

Log Message:
Add accept4 definitions


To generate a diff of this commit:
cvs rdiff -u -r1.92 -r1.93 src/sys/compat/linux/arch/alpha/syscalls.master
cvs rdiff -u -r1.65 -r1.66 src/sys/compat/linux/arch/arm/syscalls.master

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

Modified files:

Index: src/sys/compat/linux/arch/alpha/syscalls.master
diff -u src/sys/compat/linux/arch/alpha/syscalls.master:1.92 src/sys/compat/linux/arch/alpha/syscalls.master:1.93
--- src/sys/compat/linux/arch/alpha/syscalls.master:1.92	Mon Jan  2 16:32:09 2017
+++ src/sys/compat/linux/arch/alpha/syscalls.master	Fri Feb  3 06:06:08 2017
@@ -1,4 +1,4 @@
-	$NetBSD: syscalls.master,v 1.92 2017/01/02 16:32:09 manu Exp $
+	$NetBSD: syscalls.master,v 1.93 2017/02/03 06:06:08 martin Exp $
 ;
 ;	@(#)syscalls.master	8.1 (Berkeley) 7/19/93
 
@@ -771,3 +771,15 @@
 491	UNIMPL		pwritev
 492	UNIMPL		rt_tgsigqueueinfo
 493	UNIMPL		perf_counter_open
+494	UNIMPL
+495	UNIMPL
+496	UNIMPL
+497	UNIMPL
+498	UNIMPL
+499	UNIMPL
+500	UNIMPL
+501	UNIMPL
+502	STD		{ int|linux_sys||accept4(int s, \
+			struct osockaddr *name, \
+			int *anamelen, int flags); }
+

Index: src/sys/compat/linux/arch/arm/syscalls.master
diff -u src/sys/compat/linux/arch/arm/syscalls.master:1.65 src/sys/compat/linux/arch/arm/syscalls.master:1.66
--- src/sys/compat/linux/arch/arm/syscalls.master:1.65	Mon Jan  2 16:32:09 2017
+++ src/sys/compat/linux/arch/arm/syscalls.master	Fri Feb  3 06:06:09 2017
@@ -1,4 +1,4 @@
-	$NetBSD: syscalls.master,v 1.65 2017/01/02 16:32:09 manu Exp $
+	$NetBSD: syscalls.master,v 1.66 2017/02/03 06:06:09 martin Exp $
 
 ; Derived from sys/compat/linux/arch/*/syscalls.master
 ; and from Linux 2.4.12 arch/arm/kernel/calls.S
@@ -570,7 +570,9 @@
 363	UNIMPL		rt_tgsigqueueinfo
 364	UNIMPL		perf_counter_open
 365	UNIMPL		recvmmsg
-366	UNIMPL
+366	STD		{ int|linux_sys||accept4(int s, \
+			struct osockaddr *name, \
+			int *anamelen, int flags); }
 367	UNIMPL
 368	UNIMPL
 369	UNIMPL



CVS commit: src/distrib/sets/lists

2017-02-02 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Feb  2 22:07:33 UTC 2017

Modified Files:
src/distrib/sets/lists/debug: mi
src/distrib/sets/lists/tests: mi

Log Message:
Add test program for PR kern/51762


To generate a diff of this commit:
cvs rdiff -u -r1.194 -r1.195 src/distrib/sets/lists/debug/mi
cvs rdiff -u -r1.715 -r1.716 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/debug/mi
diff -u src/distrib/sets/lists/debug/mi:1.194 src/distrib/sets/lists/debug/mi:1.195
--- src/distrib/sets/lists/debug/mi:1.194	Sat Jan 28 16:55:54 2017
+++ src/distrib/sets/lists/debug/mi	Thu Feb  2 22:07:33 2017
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.194 2017/01/28 16:55:54 nat Exp $
+# $NetBSD: mi,v 1.195 2017/02/02 22:07:33 martin Exp $
 ./etc/mtree/set.debug   comp-sys-root
 ./usr/lib	comp-sys-usr		compatdir
 ./usr/lib/i18n/libBIG5_g.a			comp-c-debuglib		debuglib,compatfile
@@ -1640,6 +1640,7 @@
 ./usr/libdata/debug/usr/tests/fs/union/t_pr.debug			tests-fs-debug		debug,atf,rump
 ./usr/libdata/debug/usr/tests/fs/vfs/t_full.debug			tests-fs-debug		debug,atf,rump
 ./usr/libdata/debug/usr/tests/fs/vfs/t_io.debug			tests-fs-debug		debug,atf,rump
+./usr/libdata/debug/usr/tests/fs/vfs/t_mtime_otrunc.debug		tests-fs-debug		debug,atf,rump
 ./usr/libdata/debug/usr/tests/fs/vfs/t_renamerace.debug			tests-fs-debug		debug,atf,rump
 ./usr/libdata/debug/usr/tests/fs/vfs/t_rmdirrace.debug			tests-fs-debug		debug,atf,rump
 ./usr/libdata/debug/usr/tests/fs/vfs/t_ro.debug			tests-fs-debug		debug,atf,rump

Index: src/distrib/sets/lists/tests/mi
diff -u src/distrib/sets/lists/tests/mi:1.715 src/distrib/sets/lists/tests/mi:1.716
--- src/distrib/sets/lists/tests/mi:1.715	Fri Jan 27 10:45:11 2017
+++ src/distrib/sets/lists/tests/mi	Thu Feb  2 22:07:33 2017
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.715 2017/01/27 10:45:11 hannken Exp $
+# $NetBSD: mi,v 1.716 2017/02/02 22:07:33 martin Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -1546,6 +1546,7 @@
 ./usr/tests/fs/vfs/Kyuafiletests-fs-tests		atf,rump,kyua
 ./usr/tests/fs/vfs/t_fulltests-fs-tests		atf,rump
 ./usr/tests/fs/vfs/t_io	tests-fs-tests		atf,rump
+./usr/tests/fs/vfs/t_mtime_otrunc			tests-fs-tests		atf,rump
 ./usr/tests/fs/vfs/t_renameracetests-fs-tests		atf,rump
 ./usr/tests/fs/vfs/t_rmdirracetests-fs-tests		atf,rump
 ./usr/tests/fs/vfs/t_ro	tests-fs-tests		atf,rump



CVS commit: src/tests/fs/vfs

2017-02-02 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Feb  2 22:07:05 UTC 2017

Modified Files:
src/tests/fs/vfs: Makefile
Added Files:
src/tests/fs/vfs: t_mtime_otrunc.c

Log Message:
PR kern/51762: add a test program


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/tests/fs/vfs/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/fs/vfs/t_mtime_otrunc.c

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

Modified files:

Index: src/tests/fs/vfs/Makefile
diff -u src/tests/fs/vfs/Makefile:1.23 src/tests/fs/vfs/Makefile:1.24
--- src/tests/fs/vfs/Makefile:1.23	Fri Jan 27 10:45:11 2017
+++ src/tests/fs/vfs/Makefile	Thu Feb  2 22:07:05 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.23 2017/01/27 10:45:11 hannken Exp $
+#	$NetBSD: Makefile,v 1.24 2017/02/02 22:07:05 martin Exp $
 #
 
 .include 
@@ -14,6 +14,7 @@ TESTS_C+=	t_rmdirrace
 TESTS_C+=	t_rwtoro
 TESTS_C+=	t_union
 TESTS_C+=	t_unpriv
+TESTS_C+=	t_mtime_otrunc
 TESTS_C+=	t_vfsops
 TESTS_C+=	t_vnops
 

Added files:

Index: src/tests/fs/vfs/t_mtime_otrunc.c
diff -u /dev/null src/tests/fs/vfs/t_mtime_otrunc.c:1.1
--- /dev/null	Thu Feb  2 22:07:05 2017
+++ src/tests/fs/vfs/t_mtime_otrunc.c	Thu Feb  2 22:07:05 2017
@@ -0,0 +1,86 @@
+/*-
+ * Copyright (c) 2017 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include 
+__COPYRIGHT("@(#) Copyright (c) 2013\
+ The NetBSD Foundation, inc. All rights reserved.");
+__RCSID("$NetBSD: t_mtime_otrunc.c,v 1.1 2017/02/02 22:07:05 martin Exp $");
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+#include "../common/h_fsmacros.h"
+
+#define LOCKFILE	"lock"
+
+static time_t
+lock_it(void)
+{
+	struct stat st;
+
+	if (rump_sys_stat(LOCKFILE, ) != 0)
+		st.st_mtime = 0;
+
+	int f = rump_sys_open(LOCKFILE, O_WRONLY|O_CREAT|O_TRUNC, 0666);
+	if (f == -1) return 0;
+	rump_sys_close(f);
+
+	return st.st_mtime;
+}
+
+static void
+otrunc_mtime_update(const atf_tc_t *tc, const char *path)
+{
+	time_t last_ts = 0;
+	int res;
+
+	/* atf_tc_expect_fail("PR kern/51762"); */
+
+	res = rump_sys_chdir(path);
+	if (res == -1)
+		atf_tc_fail("chdir failed");
+
+	for (int i = 0; i < 5; i++) {
+		time_t l = lock_it();
+		printf("last lock: %ld\n", (long)l);
+		ATF_REQUIRE_MSG(i == 0 || l > last_ts,
+		"iteration %d: lock time did not increase, old time %lu, "
+		"new time %lu", i,
+		(unsigned long)last_ts, (unsigned long)l);
+		last_ts = l;
+		sleep(2);
+	}
+	rump_sys_chdir("/");
+}
+
+ATF_FSAPPLY(otrunc_mtime_update, "Checks for mtime updates by open(O_TRUNC) (PR kern/51762)");



CVS commit: src/sys/arch

2017-02-02 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Thu Feb  2 21:53:55 UTC 2017

Modified Files:
src/sys/arch/atari/include: vmparam.h
src/sys/arch/cesfic/include: vmparam.h
src/sys/arch/hp300/include: vmparam.h
src/sys/arch/luna68k/include: vmparam.h
src/sys/arch/mac68k/include: vmparam.h
src/sys/arch/mvme68k/include: vmparam.h
src/sys/arch/news68k/include: vmparam.h
src/sys/arch/next68k/include: vmparam.h
src/sys/arch/sun3/include: vmparam3.h vmparam3x.h
src/sys/arch/x68k/include: vmparam.h

Log Message:
PR port-mac68k/51923
Bump default MAXTSIZ to 32MB for m68k ports, which allos us to use GCC 5.4 on
GENERIC kernels.
Ok jklos


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/sys/arch/atari/include/vmparam.h
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/cesfic/include/vmparam.h
cvs rdiff -u -r1.38 -r1.39 src/sys/arch/hp300/include/vmparam.h
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/luna68k/include/vmparam.h
cvs rdiff -u -r1.43 -r1.44 src/sys/arch/mac68k/include/vmparam.h
cvs rdiff -u -r1.35 -r1.36 src/sys/arch/mvme68k/include/vmparam.h
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/news68k/include/vmparam.h
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/next68k/include/vmparam.h
cvs rdiff -u -r1.37 -r1.38 src/sys/arch/sun3/include/vmparam3.h
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/sun3/include/vmparam3x.h
cvs rdiff -u -r1.37 -r1.38 src/sys/arch/x68k/include/vmparam.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/atari/include/vmparam.h
diff -u src/sys/arch/atari/include/vmparam.h:1.30 src/sys/arch/atari/include/vmparam.h:1.31
--- src/sys/arch/atari/include/vmparam.h:1.30	Thu Feb  2 21:50:22 2017
+++ src/sys/arch/atari/include/vmparam.h	Thu Feb  2 21:53:54 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: vmparam.h,v 1.30 2017/02/02 21:50:22 rin Exp $	*/
+/*	$NetBSD: vmparam.h,v 1.31 2017/02/02 21:53:54 rin Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -65,7 +65,7 @@
  */
 
 #ifndef MAXTSIZ
-#define	MAXTSIZ		(16*1024*1024)		/* max text size */
+#define	MAXTSIZ		(32*1024*1024)		/* max text size */
 #endif
 #ifndef DFLDSIZ
 #define	DFLDSIZ		(32*1024*1024)		/* initial data size limit */

Index: src/sys/arch/cesfic/include/vmparam.h
diff -u src/sys/arch/cesfic/include/vmparam.h:1.16 src/sys/arch/cesfic/include/vmparam.h:1.17
--- src/sys/arch/cesfic/include/vmparam.h:1.16	Thu Feb  2 21:50:22 2017
+++ src/sys/arch/cesfic/include/vmparam.h	Thu Feb  2 21:53:54 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: vmparam.h,v 1.16 2017/02/02 21:50:22 rin Exp $	*/
+/*	$NetBSD: vmparam.h,v 1.17 2017/02/02 21:53:54 rin Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -70,7 +70,7 @@
  * Virtual memory related constants, all in bytes
  */
 #ifndef MAXTSIZ
-#define	MAXTSIZ		(8*1024*1024)		/* max text size */
+#define	MAXTSIZ		(32*1024*1024)		/* max text size */
 #endif
 #ifndef DFLDSIZ
 #define	DFLDSIZ		(32*1024*1024)		/* initial data size limit */

Index: src/sys/arch/hp300/include/vmparam.h
diff -u src/sys/arch/hp300/include/vmparam.h:1.38 src/sys/arch/hp300/include/vmparam.h:1.39
--- src/sys/arch/hp300/include/vmparam.h:1.38	Thu Feb  2 21:50:22 2017
+++ src/sys/arch/hp300/include/vmparam.h	Thu Feb  2 21:53:54 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: vmparam.h,v 1.38 2017/02/02 21:50:22 rin Exp $	*/
+/*	$NetBSD: vmparam.h,v 1.39 2017/02/02 21:53:54 rin Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -70,7 +70,7 @@
  * Virtual memory related constants, all in bytes
  */
 #ifndef MAXTSIZ
-#define	MAXTSIZ		(16*1024*1024)		/* max text size */
+#define	MAXTSIZ		(32*1024*1024)		/* max text size */
 #endif
 #ifndef DFLDSIZ
 #define	DFLDSIZ		(32*1024*1024)		/* initial data size limit */

Index: src/sys/arch/luna68k/include/vmparam.h
diff -u src/sys/arch/luna68k/include/vmparam.h:1.20 src/sys/arch/luna68k/include/vmparam.h:1.21
--- src/sys/arch/luna68k/include/vmparam.h:1.20	Thu Feb  2 21:50:22 2017
+++ src/sys/arch/luna68k/include/vmparam.h	Thu Feb  2 21:53:54 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: vmparam.h,v 1.20 2017/02/02 21:50:22 rin Exp $	*/
+/*	$NetBSD: vmparam.h,v 1.21 2017/02/02 21:53:54 rin Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -58,7 +58,7 @@
  * Virtual memory related constants, all in bytes
  */
 #ifndef MAXTSIZ
-#define MAXTSIZ		(8*1024*1024)		/* max text size */
+#define MAXTSIZ		(32*1024*1024)		/* max text size */
 #endif
 #ifndef DFLDSIZ
 #define DFLDSIZ		(16*1024*1024)		/* initial data size limit */

Index: src/sys/arch/mac68k/include/vmparam.h
diff -u src/sys/arch/mac68k/include/vmparam.h:1.43 src/sys/arch/mac68k/include/vmparam.h:1.44
--- src/sys/arch/mac68k/include/vmparam.h:1.43	Thu Feb  2 21:50:22 2017
+++ src/sys/arch/mac68k/include/vmparam.h	Thu Feb  2 21:53:54 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: vmparam.h,v 1.43 2017/02/02 21:50:22 rin Exp $	*/
+/*	$NetBSD: vmparam.h,v 1.44 2017/02/02 21:53:54 rin Exp $	*/

CVS commit: src/sys/arch/landisk/landisk

2017-02-02 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Thu Feb  2 21:57:03 UTC 2017

Modified Files:
src/sys/arch/landisk/landisk: machdep.c

Log Message:
Pass kernend as the start parameter to uvm_page_physload().  This
fixes pmap_steal_memory() as it can now unplug from the start of the
segment.  This might be the right thing to do too as the pages before
kernend are accessed via directly mapped P1, but i need to ask someone
with a clue.  This is also what evbsh3 always did.

Anyway, this at least unbreaks landisk after uvm hotplug fallout.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/landisk/landisk/machdep.c

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

Modified files:

Index: src/sys/arch/landisk/landisk/machdep.c
diff -u src/sys/arch/landisk/landisk/machdep.c:1.21 src/sys/arch/landisk/landisk/machdep.c:1.22
--- src/sys/arch/landisk/landisk/machdep.c:1.21	Thu Feb  2 21:11:25 2017
+++ src/sys/arch/landisk/landisk/machdep.c	Thu Feb  2 21:57:03 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.21 2017/02/02 21:11:25 uwe Exp $	*/
+/*	$NetBSD: machdep.c,v 1.22 2017/02/02 21:57:03 uwe Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -65,7 +65,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.21 2017/02/02 21:11:25 uwe Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.22 2017/02/02 21:57:03 uwe Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -219,7 +219,7 @@ landisk_startup(int howto, void *bi)
 	physmem = atop(IOM_RAM_SIZE);
 	kernend = atop(round_page(SH3_P1SEG_TO_PHYS(kernend)));
 	uvm_page_physload(
-		atop(IOM_RAM_BEGIN), atop(IOM_RAM_BEGIN + IOM_RAM_SIZE),
+		kernend, atop(IOM_RAM_BEGIN + IOM_RAM_SIZE),
 		kernend, atop(IOM_RAM_BEGIN + IOM_RAM_SIZE),
 		VM_FREELIST_DEFAULT);
 



CVS commit: src/sys/arch

2017-02-02 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Thu Feb  2 21:50:23 UTC 2017

Modified Files:
src/sys/arch/atari/include: vmparam.h
src/sys/arch/cesfic/include: vmparam.h
src/sys/arch/hp300/include: vmparam.h
src/sys/arch/luna68k/include: vmparam.h
src/sys/arch/mac68k/include: vmparam.h
src/sys/arch/mac68k/mac68k: genassym.cf
src/sys/arch/mvme68k/include: vmparam.h
src/sys/arch/news68k/include: vmparam.h
src/sys/arch/next68k/include: vmparam.h
src/sys/arch/x68k/include: vmparam.h

Log Message:
PR port-mac68k/51923
Remove unused SYSPTSIZE and USRPTSIZE from m68k ports.
Ok jklos


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/sys/arch/atari/include/vmparam.h
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/cesfic/include/vmparam.h
cvs rdiff -u -r1.37 -r1.38 src/sys/arch/hp300/include/vmparam.h
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/luna68k/include/vmparam.h
cvs rdiff -u -r1.42 -r1.43 src/sys/arch/mac68k/include/vmparam.h
cvs rdiff -u -r1.37 -r1.38 src/sys/arch/mac68k/mac68k/genassym.cf
cvs rdiff -u -r1.34 -r1.35 src/sys/arch/mvme68k/include/vmparam.h
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/news68k/include/vmparam.h
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/next68k/include/vmparam.h
cvs rdiff -u -r1.36 -r1.37 src/sys/arch/x68k/include/vmparam.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/atari/include/vmparam.h
diff -u src/sys/arch/atari/include/vmparam.h:1.29 src/sys/arch/atari/include/vmparam.h:1.30
--- src/sys/arch/atari/include/vmparam.h:1.29	Sat Jul 26 13:24:34 2014
+++ src/sys/arch/atari/include/vmparam.h	Thu Feb  2 21:50:22 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: vmparam.h,v 1.29 2014/07/26 13:24:34 tsutsui Exp $	*/
+/*	$NetBSD: vmparam.h,v 1.30 2017/02/02 21:50:22 rin Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -81,13 +81,6 @@
 #endif
 
 /*
- * Sizes of the system and user portions of the system page table.
- */
-/* SYSPTSIZE IS SILLY; IT SHOULD BE COMPUTED AT BOOT TIME */
-#define	SYSPTSIZE	(2 * NPTEPG)	/* 16mb */
-#define	USRPTSIZE 	(1 * NPTEPG)	/* 16mb */
-
-/*
  * PTEs for mapping user space into the kernel for phyio operations.
  * One page is enough to handle 16Mb of simultaneous raw IO operations.
  */
@@ -133,5 +126,5 @@ struct pmap_physseg { 
 /*
  * number of kernel PT pages (initial only, can grow dynamically)
  */
-#define VM_KERNEL_PT_PAGES	((vsize_t)4)		/* XXX: SYSPTSIZE */
+#define VM_KERNEL_PT_PAGES	((vsize_t)4)
 #endif /* !_MACHINE_VMPARAM_H_ */

Index: src/sys/arch/cesfic/include/vmparam.h
diff -u src/sys/arch/cesfic/include/vmparam.h:1.15 src/sys/arch/cesfic/include/vmparam.h:1.16
--- src/sys/arch/cesfic/include/vmparam.h:1.15	Tue Feb  8 20:20:11 2011
+++ src/sys/arch/cesfic/include/vmparam.h	Thu Feb  2 21:50:22 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: vmparam.h,v 1.15 2011/02/08 20:20:11 rmind Exp $	*/
+/*	$NetBSD: vmparam.h,v 1.16 2017/02/02 21:50:22 rin Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -96,13 +96,6 @@
 #define	DMMAX	4096			/* largest potential swap allocation */
 
 /*
- * Sizes of the system and user portions of the system page table.
- */
-/* SYSPTSIZE IS SILLY; IT SHOULD BE COMPUTED AT BOOT TIME */
-#define	SYSPTSIZE	(2 * NPTEPG)	/* 8mb */
-#define	USRPTSIZE 	(1 * NPTEPG)	/* 4mb */
-
-/*
  * PTEs for mapping user space into the kernel for phyio operations.
  * One page is enough to handle 4Mb of simultaneous raw IO operations.
  */
@@ -125,7 +118,7 @@
 #define VM_PHYS_SIZE		(USRIOSIZE*PAGE_SIZE)
 
 /* # of kernel PT pages (initial only, can grow dynamically) */
-#define VM_KERNEL_PT_PAGES	((vsize_t)2)		/* XXX: SYSPTSIZE */
+#define VM_KERNEL_PT_PAGES	((vsize_t)2)
 
 /* Use new VM page bootstrap interface. */
 #define	MACHINE_NEW_NONCONTIG

Index: src/sys/arch/hp300/include/vmparam.h
diff -u src/sys/arch/hp300/include/vmparam.h:1.37 src/sys/arch/hp300/include/vmparam.h:1.38
--- src/sys/arch/hp300/include/vmparam.h:1.37	Tue Feb  8 20:20:14 2011
+++ src/sys/arch/hp300/include/vmparam.h	Thu Feb  2 21:50:22 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: vmparam.h,v 1.37 2011/02/08 20:20:14 rmind Exp $	*/
+/*	$NetBSD: vmparam.h,v 1.38 2017/02/02 21:50:22 rin Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -86,13 +86,6 @@
 #endif
 
 /*
- * Sizes of the system and user portions of the system page table.
- */
-/* SYSPTSIZE IS SILLY; IT SHOULD BE COMPUTED AT BOOT TIME */
-#define	SYSPTSIZE	(2 * NPTEPG)	/* 8mb */
-#define	USRPTSIZE 	(1 * NPTEPG)	/* 4mb */
-
-/*
  * PTEs for mapping user space into the kernel for phyio operations.
  * One page is enough to handle 4Mb of simultaneous raw IO operations.
  */
@@ -125,7 +118,7 @@
 #define VM_PHYS_SIZE		(USRIOSIZE*PAGE_SIZE)
 
 /* # of kernel PT pages (initial only, can grow dynamically) */
-#define VM_KERNEL_PT_PAGES	((vsize_t)2)		/* XXX: SYSPTSIZE */
+#define VM_KERNEL_PT_PAGES	((vsize_t)2)
 
 /*
  * Constants 

CVS commit: src/sys/arch/sh3/sh3

2017-02-02 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Thu Feb  2 21:35:29 UTC 2017

Modified Files:
src/sys/arch/sh3/sh3: pmap.c

Log Message:
pmap_steal_memory - a few more s/start/avail_start/ fixes for the
hotplug conversion.


To generate a diff of this commit:
cvs rdiff -u -r1.81 -r1.82 src/sys/arch/sh3/sh3/pmap.c

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

Modified files:

Index: src/sys/arch/sh3/sh3/pmap.c
diff -u src/sys/arch/sh3/sh3/pmap.c:1.81 src/sys/arch/sh3/sh3/pmap.c:1.82
--- src/sys/arch/sh3/sh3/pmap.c:1.81	Thu Feb  2 21:17:40 2017
+++ src/sys/arch/sh3/sh3/pmap.c	Thu Feb  2 21:35:29 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.81 2017/02/02 21:17:40 uwe Exp $	*/
+/*	$NetBSD: pmap.c,v 1.82 2017/02/02 21:35:29 uwe Exp $	*/
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.81 2017/02/02 21:17:40 uwe Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.82 2017/02/02 21:35:29 uwe Exp $");
 
 #include 
 #include 
@@ -140,7 +140,8 @@ pmap_steal_memory(vsize_t size, vaddr_t 
 	for (bank = uvm_physseg_get_first();
 	 uvm_physseg_valid_p(bank);
 	 bank = uvm_physseg_get_next(bank)) {
-		if (npage <= uvm_physseg_get_end(bank) - uvm_physseg_get_start(bank))
+		if (npage <= uvm_physseg_get_avail_end(bank)
+- uvm_physseg_get_avail_start(bank))
 			break;
 	}
 



CVS commit: src/sys/uvm

2017-02-02 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Thu Feb  2 21:22:08 UTC 2017

Modified Files:
src/sys/uvm: uvm_physseg.c

Log Message:
Add missing spaces in split string literals.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/uvm/uvm_physseg.c

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

Modified files:

Index: src/sys/uvm/uvm_physseg.c
diff -u src/sys/uvm/uvm_physseg.c:1.6 src/sys/uvm/uvm_physseg.c:1.7
--- src/sys/uvm/uvm_physseg.c:1.6	Thu Dec 29 12:58:38 2016
+++ src/sys/uvm/uvm_physseg.c	Thu Feb  2 21:22:08 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: uvm_physseg.c,v 1.6 2016/12/29 12:58:38 rin Exp $ */
+/* $NetBSD: uvm_physseg.c,v 1.7 2017/02/02 21:22:08 uwe Exp $ */
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -166,7 +166,7 @@ uvm_physseg_alloc(size_t sz)
 	if (__predict_false(uvm.page_init_done == false)) {
 		if (sz % sizeof(struct uvm_physseg))
 			panic("%s: tried to alloc size other than multiple"
-			"of struct uvm_physseg at boot\n", __func__);
+			" of struct uvm_physseg at boot\n", __func__);
 
 		size_t n = sz / sizeof(struct uvm_physseg);
 		nseg += n;
@@ -200,7 +200,7 @@ uvm_physseg_free(void *p, size_t sz)
 	if (__predict_false(uvm.page_init_done == false)) {
 		if (sz % sizeof(struct uvm_physseg))
 			panic("%s: tried to free size other than struct uvm_physseg"
-			"at boot\n", __func__);
+			" at boot\n", __func__);
 
 	}
 
@@ -213,7 +213,7 @@ uvm_physseg_free(void *p, size_t sz)
 	(struct uvm_physseg *)p < (uvm_physseg + VM_PHYSSEG_MAX)) {
 		if (sz % sizeof(struct uvm_physseg))
 			panic("%s: tried to free() other than struct uvm_physseg"
-			"from static array\n", __func__);
+			" from static array\n", __func__);
 
 		if ((sz / sizeof(struct uvm_physseg)) >= VM_PHYSSEG_MAX)
 			panic("%s: tried to free() the entire static array!", __func__);
@@ -1349,7 +1349,7 @@ uvm_physseg_unplug(paddr_t pfn, size_t p
 		uvm_physseg_graph.nentries++;
 #else /* UVM_HOTPLUG */
 		panic("%s: can't unplug() from the middle of a segment without"
-		"UVM_HOTPLUG\n",  __func__);
+		" UVM_HOTPLUG\n",  __func__);
 		/* NOTREACHED */
 #endif /* UVM_HOTPLUG */
 		return true;



CVS commit: src/sys/arch/sh3/sh3

2017-02-02 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Thu Feb  2 21:17:40 UTC 2017

Modified Files:
src/sys/arch/sh3/sh3: pmap.c

Log Message:
pmap_steal_memory - s/start/avail_start/ to fix mistake in the hotplug
conversion.  The kernel now panics (can't unplug memory from the
middle of a segment) instead of triggering a reset.


To generate a diff of this commit:
cvs rdiff -u -r1.80 -r1.81 src/sys/arch/sh3/sh3/pmap.c

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

Modified files:

Index: src/sys/arch/sh3/sh3/pmap.c
diff -u src/sys/arch/sh3/sh3/pmap.c:1.80 src/sys/arch/sh3/sh3/pmap.c:1.81
--- src/sys/arch/sh3/sh3/pmap.c:1.80	Sat Dec 24 17:18:00 2016
+++ src/sys/arch/sh3/sh3/pmap.c	Thu Feb  2 21:17:40 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.80 2016/12/24 17:18:00 cherry Exp $	*/
+/*	$NetBSD: pmap.c,v 1.81 2017/02/02 21:17:40 uwe Exp $	*/
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.80 2016/12/24 17:18:00 cherry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.81 2017/02/02 21:17:40 uwe Exp $");
 
 #include 
 #include 
@@ -147,7 +147,7 @@ pmap_steal_memory(vsize_t size, vaddr_t 
 	KDASSERT(uvm_physseg_valid_p(bank));
 
 	/* Steal pages */
-	pa = ptoa(uvm_physseg_get_start(bank));
+	pa = ptoa(uvm_physseg_get_avail_start(bank));
 	uvm_physseg_unplug(atop(pa), npage);
 	va = SH3_PHYS_TO_P1SEG(pa);
 	memset((void *)va, 0, size);



CVS commit: src/sys/arch/landisk/landisk

2017-02-02 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Thu Feb  2 21:11:25 UTC 2017

Modified Files:
src/sys/arch/landisk/landisk: machdep.c

Log Message:
It's completely bogus to pass physmem (i.e. the memory size) as the
"start" parameter to uvm_page_physload().  I guess it never exploded
only because it's the correct "avail_start" that is used.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/landisk/landisk/machdep.c

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

Modified files:

Index: src/sys/arch/landisk/landisk/machdep.c
diff -u src/sys/arch/landisk/landisk/machdep.c:1.20 src/sys/arch/landisk/landisk/machdep.c:1.21
--- src/sys/arch/landisk/landisk/machdep.c:1.20	Sat Dec 17 01:32:22 2016
+++ src/sys/arch/landisk/landisk/machdep.c	Thu Feb  2 21:11:25 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.20 2016/12/17 01:32:22 uwe Exp $	*/
+/*	$NetBSD: machdep.c,v 1.21 2017/02/02 21:11:25 uwe Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -65,7 +65,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.20 2016/12/17 01:32:22 uwe Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.21 2017/02/02 21:11:25 uwe Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -219,7 +219,7 @@ landisk_startup(int howto, void *bi)
 	physmem = atop(IOM_RAM_SIZE);
 	kernend = atop(round_page(SH3_P1SEG_TO_PHYS(kernend)));
 	uvm_page_physload(
-		physmem, atop(IOM_RAM_BEGIN + IOM_RAM_SIZE),
+		atop(IOM_RAM_BEGIN), atop(IOM_RAM_BEGIN + IOM_RAM_SIZE),
 		kernend, atop(IOM_RAM_BEGIN + IOM_RAM_SIZE),
 		VM_FREELIST_DEFAULT);
 



CVS commit: src/etc

2017-02-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Feb  2 20:49:55 UTC 2017

Modified Files:
src/etc: rc

Log Message:
add +


To generate a diff of this commit:
cvs rdiff -u -r1.171 -r1.172 src/etc/rc

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

Modified files:

Index: src/etc/rc
diff -u src/etc/rc:1.171 src/etc/rc:1.172
--- src/etc/rc:1.171	Thu Feb  2 15:01:36 2017
+++ src/etc/rc	Thu Feb  2 15:49:55 2017
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: rc,v 1.171 2017/02/02 20:01:36 christos Exp $
+# $NetBSD: rc,v 1.172 2017/02/02 20:49:55 christos Exp $
 #
 # rc --
 #	Run the scripts in /etc/rc.d with rcorder, and log output
@@ -65,7 +65,7 @@ _rc_original_stdout_fd=7; export _rc_ori
 _rc_original_stderr_fd=8; export _rc_original_stderr_fd
 eval "exec ${_rc_original_stdout_fd}>&1"
 eval "exec ${_rc_original_stderr_fd}>&2"
-fdflags -s cloexec 7 8
+fdflags -s +cloexec 7 8
 
 #
 # rc_real_work



CVS commit: src/etc

2017-02-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Feb  2 20:01:36 UTC 2017

Modified Files:
src/etc: rc

Log Message:
set 7 and 8 to close on exec.


To generate a diff of this commit:
cvs rdiff -u -r1.170 -r1.171 src/etc/rc

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

Modified files:

Index: src/etc/rc
diff -u src/etc/rc:1.170 src/etc/rc:1.171
--- src/etc/rc:1.170	Tue Jul 29 16:39:16 2014
+++ src/etc/rc	Thu Feb  2 15:01:36 2017
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: rc,v 1.170 2014/07/29 20:39:16 apb Exp $
+# $NetBSD: rc,v 1.171 2017/02/02 20:01:36 christos Exp $
 #
 # rc --
 #	Run the scripts in /etc/rc.d with rcorder, and log output
@@ -65,6 +65,7 @@ _rc_original_stdout_fd=7; export _rc_ori
 _rc_original_stderr_fd=8; export _rc_original_stderr_fd
 eval "exec ${_rc_original_stdout_fd}>&1"
 eval "exec ${_rc_original_stderr_fd}>&2"
+fdflags -s cloexec 7 8
 
 #
 # rc_real_work



CVS commit: src/bin/sh

2017-02-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Feb  2 20:00:40 UTC 2017

Modified Files:
src/bin/sh: builtins.def redir.c sh.1

Log Message:
Add fdflags builtin. Discussed with Chet and he has implemented it for
bash too.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/bin/sh/builtins.def
cvs rdiff -u -r1.49 -r1.50 src/bin/sh/redir.c
cvs rdiff -u -r1.123 -r1.124 src/bin/sh/sh.1

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

Modified files:

Index: src/bin/sh/builtins.def
diff -u src/bin/sh/builtins.def:1.23 src/bin/sh/builtins.def:1.24
--- src/bin/sh/builtins.def:1.23	Sun May 10 16:30:54 2015
+++ src/bin/sh/builtins.def	Thu Feb  2 15:00:40 2017
@@ -1,5 +1,5 @@
 #!/bin/sh -
-#	$NetBSD: builtins.def,v 1.23 2015/05/10 20:30:54 joerg Exp $
+#	$NetBSD: builtins.def,v 1.24 2017/02/02 20:00:40 christos Exp $
 #
 # Copyright (c) 1991, 1993
 #	The Regents of the University of California.  All rights reserved.
@@ -73,6 +73,7 @@ pwdcmd		-u pwd
 readcmd		-u read
 returncmd	-s return
 setcmd		-s set
+fdflagscmd	fdflags
 setvarcmd	setvar
 shiftcmd	-s shift
 timescmd	-s times

Index: src/bin/sh/redir.c
diff -u src/bin/sh/redir.c:1.49 src/bin/sh/redir.c:1.50
--- src/bin/sh/redir.c:1.49	Sat Jan 21 18:03:36 2017
+++ src/bin/sh/redir.c	Thu Feb  2 15:00:40 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: redir.c,v 1.49 2017/01/21 23:03:36 christos Exp $	*/
+/*	$NetBSD: redir.c,v 1.50 2017/02/02 20:00:40 christos Exp $	*/
 
 /*-
  * Copyright (c) 1991, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)redir.c	8.2 (Berkeley) 5/4/95";
 #else
-__RCSID("$NetBSD: redir.c,v 1.49 2017/01/21 23:03:36 christos Exp $");
+__RCSID("$NetBSD: redir.c,v 1.50 2017/02/02 20:00:40 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -56,6 +56,7 @@ __RCSID("$NetBSD: redir.c,v 1.49 2017/01
  */
 
 #include "main.h"
+#include "builtins.h"
 #include "shell.h"
 #include "nodes.h"
 #include "jobs.h"
@@ -552,3 +553,201 @@ to_upper_fd(int fd)
 	(void)fcntl(fd, F_SETFD, FD_CLOEXEC);
 	return fd;
 }
+
+static const struct {
+	const char *name;
+	uint32_t value;
+} nv[] = {
+#ifdef O_APPEND
+	{ "append",	O_APPEND 	},
+#endif
+#ifdef O_ASYNC
+	{ "async",	O_ASYNC		},
+#endif
+#ifdef O_SYNC
+	{ "sync",	O_SYNC		},
+#endif
+#ifdef O_NONBLOCK
+	{ "nonblock",	O_NONBLOCK	},
+#endif
+#ifdef O_FSYNC
+	{ "fsync",	O_FSYNC		},
+#endif
+#ifdef O_DSYNC
+	{ "dsync",	O_DSYNC		},
+#endif
+#ifdef O_RSYNC
+	{ "rsync",	O_RSYNC		},
+#endif
+#ifdef O_ALTIO
+	{ "altio",	O_ALT_IO	},
+#endif
+#ifdef O_DIRECT
+	{ "direct",	O_DIRECT	},
+#endif
+#ifdef O_NOSIGPIPE
+	{ "nosigpipe",	O_NOSIGPIPE	},
+#endif
+#ifdef O_CLOEXEC
+	{ "cloexec",	O_CLOEXEC	},
+#endif
+};
+#define ALLFLAGS (O_APPEND|O_ASYNC|O_SYNC|O_NONBLOCK|O_DSYNC|O_RSYNC|\
+O_ALT_IO|O_DIRECT|O_NOSIGPIPE|O_CLOEXEC)
+
+static int
+getflags(int fd, int p)
+{
+	int c, f;
+
+	if ((c = fcntl(fd, F_GETFD)) == -1) {
+		if (!p)
+			return -1;
+		error("Can't get status for fd=%d (%s)", fd, strerror(errno));
+	}
+	if ((f = fcntl(fd, F_GETFL)) == -1) {
+		if (!p)
+			return -1;
+		error("Can't get flags for fd=%d (%s)", fd, strerror(errno));
+	}
+	if (c)
+		f |= O_CLOEXEC;
+	return f & ALLFLAGS;
+}
+
+static void
+printone(int fd, int p, int verbose)
+{
+	int f = getflags(fd, p);
+
+	if (f == -1)
+		return;
+
+	outfmt(out1, "%d:", fd);
+	for (size_t i = 0; i < __arraycount(nv); i++) {
+		if (f & nv[i].value) {
+			outfmt(out1, "%s%s", verbose ? "+" : "", nv[i].name);
+			f &= ~nv[i].value;
+		} else if (verbose)
+			outfmt(out1, "-%s", nv[i].name);
+		else
+			continue;
+		if (f || (verbose && i != __arraycount(nv) - 1))
+			outfmt(out1, ",");
+	}
+	outfmt(out1, "\n");
+}
+
+static int
+parseflags(char *s, int *p, int *n)
+{
+	int f = 0, *v;
+
+	*p = 0;
+	*n = 0;
+	for (s = strtok(s, ","); s; s = strtok(NULL, ",")) {
+		size_t i;
+		switch (*s) {
+		case '+':
+			v = p;
+			s++;
+			break;
+		case '-':
+			v = n;
+			s++;
+			break;
+		default:
+			v = 
+			break;
+		}
+			
+		for (i = 0; i < __arraycount(nv); i++)
+			if (strcmp(s, nv[i].name) == 0) {
+*v |= nv[i].value;
+break;
+			}
+		if (i == __arraycount(nv))
+			error("Bad flag `%s'", s);
+	}
+	return f;
+}
+
+static void
+setone(int fd, int pos, int neg, int verbose)
+{
+	int f = getflags(fd, 1);
+	if (f == -1)
+		return;
+
+	int cloexec = -1;
+	if ((pos & O_CLOEXEC) && !(f & O_CLOEXEC))
+		cloexec = FD_CLOEXEC;
+	if ((neg & O_CLOEXEC) && (f & O_CLOEXEC))
+		cloexec = 0;
+
+	if (cloexec != -1 && fcntl(fd, F_SETFD, cloexec) == -1)
+		error("Can't set status for fd=%d (%s)", fd, strerror(errno));
+
+	pos &= ~O_CLOEXEC;
+	neg &= ~O_CLOEXEC;
+	f &= ~O_CLOEXEC;
+	int n = f;
+	n |= pos;
+	n &= ~neg;
+	if (n != f && fcntl(fd, F_SETFL, n) == -1)
+		error("Can't set flags for fd=%d (%s)", fd, strerror(errno));
+	if (verbose)
+		printone(fd, 1, verbose);
+}
+
+int
+fdflagscmd(int argc, char *argv[])
+{
+	char *num;
+	int verbose = 0, ch, pos = 0, neg = 0;
+	char 

CVS commit: src/sys/dev/ic

2017-02-02 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Thu Feb  2 19:55:05 UTC 2017

Modified Files:
src/sys/dev/ic: ct65550.c ct65550reg.h ct65550var.h

Log Message:
support anti-aliased fonts, glyphcache etc.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/dev/ic/ct65550.c
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/ic/ct65550reg.h \
src/sys/dev/ic/ct65550var.h

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

Modified files:

Index: src/sys/dev/ic/ct65550.c
diff -u src/sys/dev/ic/ct65550.c:1.11 src/sys/dev/ic/ct65550.c:1.12
--- src/sys/dev/ic/ct65550.c:1.11	Fri Aug 26 22:50:11 2016
+++ src/sys/dev/ic/ct65550.c	Thu Feb  2 19:55:05 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: ct65550.c,v 1.11 2016/08/26 22:50:11 macallan Exp $	*/
+/*	$NetBSD: ct65550.c,v 1.12 2017/02/02 19:55:05 macallan Exp $	*/
 
 /*
  * Copyright (c) 2006 Michael Lorenz
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ct65550.c,v 1.11 2016/08/26 22:50:11 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ct65550.c,v 1.12 2017/02/02 19:55:05 macallan Exp $");
 
 #include 
 #include 
@@ -71,11 +71,12 @@ static int 	chipsfb_getcmap(struct chips
 static int 	chipsfb_putpalreg(struct chipsfb_softc *, uint8_t, uint8_t,
 			uint8_t, uint8_t);
 
-static void	chipsfb_bitblt(struct chipsfb_softc *, int, int, int, int,
-			int, int, uint8_t);
+static void	chipsfb_bitblt(void *, int, int, int, int,
+			int, int, int);
 static void	chipsfb_rectfill(struct chipsfb_softc *, int, int, int, int,
 			int);
 static void	chipsfb_putchar(void *, int, int, u_int, long);
+static void	chipsfb_putchar_aa(void *, int, int, u_int, long);
 static void	chipsfb_setup_mono(struct chipsfb_softc *, int, int, int,
 			int, uint32_t, uint32_t);
 static void	chipsfb_feed(struct chipsfb_softc *, int, uint8_t *);
@@ -159,7 +160,7 @@ chipsfb_read_indexed(struct chipsfb_soft
 	return chipsfb_read_vga(sc, reg | 0x0001);
 }
 
-__unused static inline void
+static inline void
 chipsfb_write_indexed(struct chipsfb_softc *sc, uint32_t reg, uint8_t index,
 uint8_t val)
 {
@@ -224,14 +225,14 @@ chipsfb_do_attach(struct chipsfb_softc *
 	} else
 		aprint_verbose("Panel size: %d x %d\n", width, height);
 
-	if (!prop_dictionary_get_uint32(dict, "width", >width))
-		sc->width = width;
-	if (!prop_dictionary_get_uint32(dict, "height", >height))
-		sc->height = height;
-	if (!prop_dictionary_get_uint32(dict, "depth", >bits_per_pixel))
-		sc->bits_per_pixel = 8;
-	if (!prop_dictionary_get_uint32(dict, "linebytes", >linebytes))
-		sc->linebytes = (sc->width * sc->bits_per_pixel) >> 3;
+	if (!prop_dictionary_get_uint32(dict, "width", >sc_width))
+		sc->sc_width = width;
+	if (!prop_dictionary_get_uint32(dict, "height", >sc_height))
+		sc->sc_height = height;
+	if (!prop_dictionary_get_uint32(dict, "depth", >sc_bits_per_pixel))
+		sc->sc_bits_per_pixel = 8;
+	if (!prop_dictionary_get_uint32(dict, "linebytes", >sc_linebytes))
+		sc->sc_linebytes = (sc->sc_width * sc->sc_bits_per_pixel) >> 3;
 
 	prop_dictionary_get_bool(dict, "is_console", );
 
@@ -243,6 +244,10 @@ chipsfb_do_attach(struct chipsfb_softc *
 	vcons_init(>vd, sc, _defaultscreen, _accessops);
 	sc->vd.init_screen = chipsfb_init_screen;
 
+	sc->sc_gc.gc_bitblt = chipsfb_bitblt;
+	sc->sc_gc.gc_blitcookie = sc;
+	sc->sc_gc.gc_rop = ROP_COPY;
+
 	ri = _console_screen.scr_ri;
 	if (console) {
 		vcons_init_screen(>vd, _console_screen, 1,
@@ -253,6 +258,12 @@ chipsfb_do_attach(struct chipsfb_softc *
 		chipsfb_defaultscreen.capabilities = ri->ri_caps;
 		chipsfb_defaultscreen.nrows = ri->ri_rows;
 		chipsfb_defaultscreen.ncols = ri->ri_cols;
+		glyphcache_init(>sc_gc, sc->sc_height + 1,
+(sc->sc_fbsize / sc->sc_linebytes) - sc->sc_height - 1,
+sc->sc_width,
+ri->ri_font->fontwidth,
+ri->ri_font->fontheight,
+defattr);
 		wsdisplay_cnattach(_defaultscreen, ri, 0, 0, defattr);
 	} else {
 		if (chipsfb_console_screen.scr_ri.ri_rows == 0) {
@@ -262,6 +273,12 @@ chipsfb_do_attach(struct chipsfb_softc *
 		} else
 			(*ri->ri_ops.allocattr)(ri, 0, 0, 0, );
 
+		glyphcache_init(>sc_gc, sc->sc_height + 1,
+(sc->sc_fbsize / sc->sc_linebytes) - sc->sc_height - 1,
+sc->sc_width,
+ri->ri_font->fontwidth,
+ri->ri_font->fontheight,
+defattr);
 	}
 
 	rasops_unpack_attr(defattr, , , );
@@ -378,7 +395,7 @@ chipsfb_getcmap(struct chipsfb_softc *sc
 static void
 chipsfb_clearscreen(struct chipsfb_softc *sc)
 {
-	chipsfb_rectfill(sc, 0, 0, sc->width, sc->height, sc->sc_bg);
+	chipsfb_rectfill(sc, 0, 0, sc->sc_width, sc->sc_height, sc->sc_bg);
 }
 
 /*
@@ -508,16 +525,17 @@ chipsfb_eraserows(void *cookie, int row,
 }
 
 static void
-chipsfb_bitblt(struct chipsfb_softc *sc, int xs, int ys, int xd, int yd,
-int width, int height, uint8_t rop)
+chipsfb_bitblt(void *cookie, int xs, int ys, int xd, int yd,
+int width, int height, int rop)
 {
+	struct chipsfb_softc *sc = cookie;
 	uint32_t 

CVS commit: src/sys/conf

2017-02-02 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Thu Feb  2 19:50:35 UTC 2017

Modified Files:
src/sys/conf: files

Log Message:
chipsfb needs glyphcache now


To generate a diff of this commit:
cvs rdiff -u -r1.1168 -r1.1169 src/sys/conf/files

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

Modified files:

Index: src/sys/conf/files
diff -u src/sys/conf/files:1.1168 src/sys/conf/files:1.1169
--- src/sys/conf/files:1.1168	Mon Dec 26 23:12:33 2016
+++ src/sys/conf/files	Thu Feb  2 19:50:35 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: files,v 1.1168 2016/12/26 23:12:33 pgoyette Exp $
+#	$NetBSD: files,v 1.1169 2017/02/02 19:50:35 macallan Exp $
 #	@(#)files.newconf	7.5 (Berkeley) 5/10/93
 
 version 	20150846
@@ -1213,7 +1213,7 @@ device	igsfb: wsemuldisplaydev, rasops8,
 file	dev/ic/igsfb.c			igsfb			needs-flag
 file	dev/ic/igsfb_subr.c		igsfb
 
-device	chipsfb: wsemuldisplaydev, rasops8, vcons, videomode
+device	chipsfb: wsemuldisplaydev, rasops8, vcons, videomode, glyphcache
 file	dev/ic/ct65550.c		chipsfb
 defflag	opt_chipsfb.h	CHIPSFB_DEBUG
 defflag	opt_chipsfb.h	CHIPSFB_WAIT



CVS commit: src/bin/sh

2017-02-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Feb  2 19:26:38 UTC 2017

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

Log Message:
Who Ride Wit Us?


To generate a diff of this commit:
cvs rdiff -u -r1.129 -r1.130 src/bin/sh/eval.c

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

Modified files:

Index: src/bin/sh/eval.c
diff -u src/bin/sh/eval.c:1.129 src/bin/sh/eval.c:1.130
--- src/bin/sh/eval.c:1.129	Tue Jan 10 15:43:08 2017
+++ src/bin/sh/eval.c	Thu Feb  2 14:26:37 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: eval.c,v 1.129 2017/01/10 20:43:08 christos Exp $	*/
+/*	$NetBSD: eval.c,v 1.130 2017/02/02 19:26:37 christos Exp $	*/
 
 /*-
  * Copyright (c) 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)eval.c	8.9 (Berkeley) 6/8/95";
 #else
-__RCSID("$NetBSD: eval.c,v 1.129 2017/01/10 20:43:08 christos Exp $");
+__RCSID("$NetBSD: eval.c,v 1.130 2017/02/02 19:26:37 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -1044,7 +1044,7 @@ normal_fork:
 		temp_path = 0;
 		if (!setjmp(jmploc.loc)) {
 			/* We need to ensure the command hash table isn't
-			 * corruped by temporary PATH assignments.
+			 * corrupted by temporary PATH assignments.
 			 * However we must ensure the 'local' command works!
 			 */
 			if (path != pathval() && (cmdentry.u.bltin == hashcmd ||



CVS commit: src/sys/arch

2017-02-02 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Thu Feb  2 19:12:09 UTC 2017

Modified Files:
src/sys/arch/amd64/amd64: locore.S
src/sys/arch/i386/i386: locore.S

Log Message:
Fix these comments, we probably won't want to keep them up to date.


To generate a diff of this commit:
cvs rdiff -u -r1.118 -r1.119 src/sys/arch/amd64/amd64/locore.S
cvs rdiff -u -r1.144 -r1.145 src/sys/arch/i386/i386/locore.S

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

Modified files:

Index: src/sys/arch/amd64/amd64/locore.S
diff -u src/sys/arch/amd64/amd64/locore.S:1.118 src/sys/arch/amd64/amd64/locore.S:1.119
--- src/sys/arch/amd64/amd64/locore.S:1.118	Sat Dec 17 13:49:05 2016
+++ src/sys/arch/amd64/amd64/locore.S	Thu Feb  2 19:12:09 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.S,v 1.118 2016/12/17 13:49:05 maxv Exp $	*/
+/*	$NetBSD: locore.S,v 1.119 2017/02/02 19:12:09 maxv Exp $	*/
 
 /*
  * Copyright-o-rama!
@@ -647,7 +647,7 @@ no_NOX:
 	 */
 	leal	(PROC0_PTP1_OFF)(%esi),%ebx
 
-	/* Skip the first MB. */
+	/* Skip the area below the kernel text. */
 	movl	$(KERNTEXTOFF_LO - KERNBASE_LO),%ecx
 	shrl	$PGSHIFT,%ecx
 	fillkpt_blank

Index: src/sys/arch/i386/i386/locore.S
diff -u src/sys/arch/i386/i386/locore.S:1.144 src/sys/arch/i386/i386/locore.S:1.145
--- src/sys/arch/i386/i386/locore.S:1.144	Fri Jan  6 08:36:56 2017
+++ src/sys/arch/i386/i386/locore.S	Thu Feb  2 19:12:09 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.S,v 1.144 2017/01/06 08:36:56 maxv Exp $	*/
+/*	$NetBSD: locore.S,v 1.145 2017/02/02 19:12:09 maxv Exp $	*/
 
 /*
  * Copyright-o-rama!
@@ -128,7 +128,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: locore.S,v 1.144 2017/01/06 08:36:56 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: locore.S,v 1.145 2017/02/02 19:12:09 maxv Exp $");
 
 #include "opt_compat_oldboot.h"
 #include "opt_copy_symtab.h"
@@ -671,7 +671,7 @@ no_NOX:
 	 */
 	leal	(PROC0_PTP1_OFF)(%esi),%ebx
 
-	/* Skip the first MB. */
+	/* Skip the area below the kernel text. */
 	movl	$(KERNTEXTOFF - KERNBASE),%ecx
 	shrl	$PGSHIFT,%ecx
 	fillkpt_blank



CVS commit: src/sys/arch

2017-02-02 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Thu Feb  2 19:09:08 UTC 2017

Modified Files:
src/sys/arch/amd64/conf: Makefile.amd64
src/sys/arch/amd64/include: param.h
src/sys/arch/xen/conf: Makefile.xen

Log Message:
Increase KERNTEXTOFF from 1MB to 2MB on amd64. [1MB; 2MB[ is now handled
by UVM, so there is no physical loss.

On amd64 we always remap the kernel text with 2MB pages, and because of the
1MB start address we were forced to map [0MB; 2MB[ inside the first large
page. The problem is, the lower half is used by UVM to allocate physical
pages, and it is possible that some of these could be used by userland. We
could end up with userland-controllable data mapped into the kernel text on
a privileged page, which is far from being a good idea from a security pov.

I am not fixing i386 yet, because the large page size depends on PAE, and
we probably don't want to have a text located at 4MB on low-memory systems.

(note: I didn't introduce this issue, it was already there when I came in)


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 src/sys/arch/amd64/conf/Makefile.amd64
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/amd64/include/param.h
cvs rdiff -u -r1.40 -r1.41 src/sys/arch/xen/conf/Makefile.xen

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

Modified files:

Index: src/sys/arch/amd64/conf/Makefile.amd64
diff -u src/sys/arch/amd64/conf/Makefile.amd64:1.55 src/sys/arch/amd64/conf/Makefile.amd64:1.56
--- src/sys/arch/amd64/conf/Makefile.amd64:1.55	Fri Apr 29 02:17:25 2016
+++ src/sys/arch/amd64/conf/Makefile.amd64	Thu Feb  2 19:09:08 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.amd64,v 1.55 2016/04/29 02:17:25 christos Exp $
+#	$NetBSD: Makefile.amd64,v 1.56 2017/02/02 19:09:08 maxv Exp $
 
 # Makefile for NetBSD
 #
@@ -60,7 +60,7 @@ KERN_AS=	library
 ##
 ## (5) link settings
 ##
-TEXTADDR?=	0x8010
+TEXTADDR?=	0x8020
 EXTRA_LINKFLAGS=	-z max-page-size=0x10
 LINKFLAGS_NORMAL=	-X
 KERNLDSCRIPT?= ${AMD64}/conf/kern.ldscript

Index: src/sys/arch/amd64/include/param.h
diff -u src/sys/arch/amd64/include/param.h:1.20 src/sys/arch/amd64/include/param.h:1.21
--- src/sys/arch/amd64/include/param.h:1.20	Fri Jan 20 00:29:28 2017
+++ src/sys/arch/amd64/include/param.h	Thu Feb  2 19:09:08 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: param.h,v 1.20 2017/01/20 00:29:28 maya Exp $	*/
+/*	$NetBSD: param.h,v 1.21 2017/02/02 19:09:08 maxv Exp $	*/
 
 #ifdef __x86_64__
 
@@ -34,11 +34,11 @@
  * config info into account.
  */
 #define	KERNBASE	0x8000 /* start of kernel virtual space */
-#define	KERNTEXTOFF	0x8010 /* start of kernel text */
+#define	KERNTEXTOFF	0x8020 /* start of kernel text */
 #define	BTOPKERNBASE	((u_long)KERNBASE >> PGSHIFT)
 
 #define KERNTEXTOFF_HI	0x
-#define KERNTEXTOFF_LO	0x8010
+#define KERNTEXTOFF_LO	0x8020
 
 #define KERNBASE_HI	0x
 #define KERNBASE_LO	0x8000

Index: src/sys/arch/xen/conf/Makefile.xen
diff -u src/sys/arch/xen/conf/Makefile.xen:1.40 src/sys/arch/xen/conf/Makefile.xen:1.41
--- src/sys/arch/xen/conf/Makefile.xen:1.40	Mon Aug 24 14:04:25 2015
+++ src/sys/arch/xen/conf/Makefile.xen	Thu Feb  2 19:09:08 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.xen,v 1.40 2015/08/24 14:04:25 uebayasi Exp $
+#	$NetBSD: Makefile.xen,v 1.41 2017/02/02 19:09:08 maxv Exp $
 #	NetBSD: Makefile.i386,v 1.132 2003/07/05 16:56:10 simonb Exp 
 
 # Makefile for NetBSD
@@ -105,7 +105,7 @@ vector.o: $S/arch/${XEN_BUILD}/${XEN_BUI
 .if ${XEN_BUILD} == i386
 TEXTADDR?=	0xc010
 .elif ${XEN_BUILD} == amd64
-TEXTADDR?=	0x8010
+TEXTADDR?=	0x8020
 .endif
 LINKFLAGS_NORMAL=	-X
 KERNLDSCRIPT?=	$S/arch/${XEN_BUILD}/conf/kern.ldscript.Xen



CVS commit: src/sys/sys

2017-02-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Feb  2 18:01:16 UTC 2017

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

Log Message:
declare sockaddr_big;


To generate a diff of this commit:
cvs rdiff -u -r1.142 -r1.143 src/sys/sys/socketvar.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/socketvar.h
diff -u src/sys/sys/socketvar.h:1.142 src/sys/sys/socketvar.h:1.143
--- src/sys/sys/socketvar.h:1.142	Thu Feb  2 10:37:42 2017
+++ src/sys/sys/socketvar.h	Thu Feb  2 13:01:16 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: socketvar.h,v 1.142 2017/02/02 15:37:42 christos Exp $	*/
+/*	$NetBSD: socketvar.h,v 1.143 2017/02/02 18:01:16 christos Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -247,6 +247,7 @@ struct lwp;
 struct msghdr;
 struct stat;
 struct knote;
+struct sockaddr_big;
 
 struct	mbuf *getsombuf(struct socket *, int);
 



CVS commit: src/sys/arch/x86/x86

2017-02-02 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Thu Feb  2 17:37:49 UTC 2017

Modified Files:
src/sys/arch/x86/x86: pmap.c

Log Message:
The first va should depend on the text offset, not the kernel base. Use
rounddown. Note: this value is still wrong, it should be roundup. But
that's another issue that will be fixed in amd64 soon.


To generate a diff of this commit:
cvs rdiff -u -r1.238 -r1.239 src/sys/arch/x86/x86/pmap.c

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

Modified files:

Index: src/sys/arch/x86/x86/pmap.c
diff -u src/sys/arch/x86/x86/pmap.c:1.238 src/sys/arch/x86/x86/pmap.c:1.239
--- src/sys/arch/x86/x86/pmap.c:1.238	Thu Feb  2 08:57:04 2017
+++ src/sys/arch/x86/x86/pmap.c	Thu Feb  2 17:37:49 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.238 2017/02/02 08:57:04 maxv Exp $	*/
+/*	$NetBSD: pmap.c,v 1.239 2017/02/02 17:37:49 maxv Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2010, 2016, 2017 The NetBSD Foundation, Inc.
@@ -171,7 +171,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.238 2017/02/02 08:57:04 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.239 2017/02/02 17:37:49 maxv Exp $");
 
 #include "opt_user_ldt.h"
 #include "opt_lockdebug.h"
@@ -1595,7 +1595,7 @@ pmap_remap_largepages(void)
 	paddr_t pa;
 
 	/* Remap the kernel text using large pages. */
-	kva = KERNBASE;
+	kva = rounddown((vaddr_t)KERNTEXTOFF, NBPD_L2);
 	kva_end = rounddown((vaddr_t)&__rodata_start, NBPD_L1);
 	pa = kva - KERNBASE;
 	for (/* */; kva + NBPD_L2 <= kva_end; kva += NBPD_L2, pa += NBPD_L2) {



CVS commit: src/sys

2017-02-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Feb  2 15:37:42 UTC 2017

Modified Files:
src/sys/kern: uipc_syscalls.c
src/sys/sys: socketvar.h

Log Message:
expose copyout_sockname_sb


To generate a diff of this commit:
cvs rdiff -u -r1.184 -r1.185 src/sys/kern/uipc_syscalls.c
cvs rdiff -u -r1.141 -r1.142 src/sys/sys/socketvar.h

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

Modified files:

Index: src/sys/kern/uipc_syscalls.c
diff -u src/sys/kern/uipc_syscalls.c:1.184 src/sys/kern/uipc_syscalls.c:1.185
--- src/sys/kern/uipc_syscalls.c:1.184	Sat Dec  3 17:28:16 2016
+++ src/sys/kern/uipc_syscalls.c	Thu Feb  2 10:37:42 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: uipc_syscalls.c,v 1.184 2016/12/03 22:28:16 christos Exp $	*/
+/*	$NetBSD: uipc_syscalls.c,v 1.185 2017/02/02 15:37:42 christos Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -61,7 +61,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uipc_syscalls.c,v 1.184 2016/12/03 22:28:16 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uipc_syscalls.c,v 1.185 2017/02/02 15:37:42 christos Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_pipe.h"
@@ -94,8 +94,6 @@ __KERNEL_RCSID(0, "$NetBSD: uipc_syscall
 extern const struct fileops socketops;
 
 static int	sockargs_sb(struct sockaddr_big *, const void *, socklen_t);
-static int	copyout_sockname_sb(struct sockaddr *, unsigned int *,
-		int , struct sockaddr_big *);
 
 int
 sys___socket30(struct lwp *l, const struct sys___socket30_args *uap,

Index: src/sys/sys/socketvar.h
diff -u src/sys/sys/socketvar.h:1.141 src/sys/sys/socketvar.h:1.142
--- src/sys/sys/socketvar.h:1.141	Tue Sep 13 03:01:08 2016
+++ src/sys/sys/socketvar.h	Thu Feb  2 10:37:42 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: socketvar.h,v 1.141 2016/09/13 07:01:08 martin Exp $	*/
+/*	$NetBSD: socketvar.h,v 1.142 2017/02/02 15:37:42 christos Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -346,6 +346,8 @@ int	sockopt_setmbuf(struct sockopt *, st
 struct mbuf *sockopt_getmbuf(const struct sockopt *);
 
 int	copyout_sockname(struct sockaddr *, unsigned int *, int, struct mbuf *);
+int	copyout_sockname_sb(struct sockaddr *, unsigned int *,
+int , struct sockaddr_big *);
 int	copyout_msg_control(struct lwp *, struct msghdr *, struct mbuf *);
 void	free_control_mbuf(struct lwp *, struct mbuf *, struct mbuf *);
 



CVS commit: src/sys/compat/linux/common

2017-02-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Feb  2 15:36:55 UTC 2017

Modified Files:
src/sys/compat/linux/common: linux_socket.c

Log Message:
implement accept4


To generate a diff of this commit:
cvs rdiff -u -r1.133 -r1.134 src/sys/compat/linux/common/linux_socket.c

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

Modified files:

Index: src/sys/compat/linux/common/linux_socket.c
diff -u src/sys/compat/linux/common/linux_socket.c:1.133 src/sys/compat/linux/common/linux_socket.c:1.134
--- src/sys/compat/linux/common/linux_socket.c:1.133	Tue Sep 13 03:01:07 2016
+++ src/sys/compat/linux/common/linux_socket.c	Thu Feb  2 10:36:55 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux_socket.c,v 1.133 2016/09/13 07:01:07 martin Exp $	*/
+/*	$NetBSD: linux_socket.c,v 1.134 2017/02/02 15:36:55 christos Exp $	*/
 
 /*-
  * Copyright (c) 1995, 1998, 2008 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: linux_socket.c,v 1.133 2016/09/13 07:01:07 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_socket.c,v 1.134 2017/02/02 15:36:55 christos Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_inet.h"
@@ -1707,3 +1707,38 @@ linux_sys_accept(struct lwp *l, const st
 
 	return (0);
 }
+
+int
+linux_sys_accept4(struct lwp *l, const struct linux_sys_accept4_args *uap, register_t *retval)
+{
+	/* {
+		syscallarg(int) s;
+		syscallarg(struct osockaddr *) name;
+		syscallarg(int *) anamelen;
+		syscallarg(int) flags;
+	} */
+	int error, flags;
+	struct sockaddr_big name;
+
+	if ((flags = linux_to_bsd_type(SCARG(uap, flags))) == -1)
+		return EINVAL;
+
+	name.sb_len = UCHAR_MAX;
+	error = do_sys_accept(l, SCARG(uap, s), (struct sockaddr *),
+	retval, NULL, flags, 0);
+	if (error != 0)
+		return error;
+
+	error = copyout_sockname_sb((struct sockaddr *)SCARG(uap, name),
+	SCARG(uap, anamelen), MSG_LENUSRSPACE, );
+	if (error != 0) {
+		int fd = (int)*retval;
+		if (fd_getfile(fd) != NULL)
+			(void)fd_close(fd);
+		return error;
+	}
+	if (SCARG(uap, name) && (error = linux_sa_put(SCARG(uap, name
+		return error;
+
+	return 0;
+}



CVS commit: src/sys/compat/linux/arch

2017-02-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Feb  2 15:36:12 UTC 2017

Modified Files:
src/sys/compat/linux/arch/amd64: linux_syscall.h linux_syscallargs.h
linux_syscalls.c linux_sysent.c linux_systrace_args.c
src/sys/compat/linux/arch/mips: linux_syscall.h linux_syscallargs.h
linux_syscalls.c linux_sysent.c

Log Message:
regen


To generate a diff of this commit:
cvs rdiff -u -r1.64 -r1.65 src/sys/compat/linux/arch/amd64/linux_syscall.h \
src/sys/compat/linux/arch/amd64/linux_syscallargs.h \
src/sys/compat/linux/arch/amd64/linux_syscalls.c \
src/sys/compat/linux/arch/amd64/linux_sysent.c
cvs rdiff -u -r1.8 -r1.9 \
src/sys/compat/linux/arch/amd64/linux_systrace_args.c
cvs rdiff -u -r1.71 -r1.72 src/sys/compat/linux/arch/mips/linux_syscall.h
cvs rdiff -u -r1.70 -r1.71 src/sys/compat/linux/arch/mips/linux_syscallargs.h \
src/sys/compat/linux/arch/mips/linux_syscalls.c \
src/sys/compat/linux/arch/mips/linux_sysent.c

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

Modified files:

Index: src/sys/compat/linux/arch/amd64/linux_syscall.h
diff -u src/sys/compat/linux/arch/amd64/linux_syscall.h:1.64 src/sys/compat/linux/arch/amd64/linux_syscall.h:1.65
--- src/sys/compat/linux/arch/amd64/linux_syscall.h:1.64	Sun Jan 15 19:11:09 2017
+++ src/sys/compat/linux/arch/amd64/linux_syscall.h	Thu Feb  2 10:36:12 2017
@@ -1,10 +1,10 @@
-/* $NetBSD: linux_syscall.h,v 1.64 2017/01/16 00:11:09 christos Exp $ */
+/* $NetBSD: linux_syscall.h,v 1.65 2017/02/02 15:36:12 christos Exp $ */
 
 /*
  * System call numbers.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * created from	NetBSD: syscalls.master,v 1.58 2017/01/02 16:32:09 manu Exp
+ * created from	NetBSD: syscalls.master,v 1.59 2017/02/02 15:35:46 christos Exp
  */
 
 #ifndef _LINUX_SYS_SYSCALL_H_
@@ -645,6 +645,9 @@
 /* syscall: "utimensat" ret: "int" args: "int" "const char *" "struct linux_timespec *" "int" */
 #define	LINUX_SYS_utimensat	280
 
+/* syscall: "accept4" ret: "int" args: "int" "struct osockaddr *" "int *" "int" */
+#define	LINUX_SYS_accept4	288
+
 /* syscall: "dup3" ret: "int" args: "int" "int" "int" */
 #define	LINUX_SYS_dup3	292
 
Index: src/sys/compat/linux/arch/amd64/linux_syscallargs.h
diff -u src/sys/compat/linux/arch/amd64/linux_syscallargs.h:1.64 src/sys/compat/linux/arch/amd64/linux_syscallargs.h:1.65
--- src/sys/compat/linux/arch/amd64/linux_syscallargs.h:1.64	Sun Jan 15 19:11:09 2017
+++ src/sys/compat/linux/arch/amd64/linux_syscallargs.h	Thu Feb  2 10:36:12 2017
@@ -1,10 +1,10 @@
-/* $NetBSD: linux_syscallargs.h,v 1.64 2017/01/16 00:11:09 christos Exp $ */
+/* $NetBSD: linux_syscallargs.h,v 1.65 2017/02/02 15:36:12 christos Exp $ */
 
 /*
  * System call argument lists.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * created from	NetBSD: syscalls.master,v 1.58 2017/01/02 16:32:09 manu Exp
+ * created from	NetBSD: syscalls.master,v 1.59 2017/02/02 15:35:46 christos Exp
  */
 
 #ifndef _LINUX_SYS_SYSCALLARGS_H_
@@ -1004,6 +1004,14 @@ struct linux_sys_utimensat_args {
 };
 check_syscall_args(linux_sys_utimensat)
 
+struct linux_sys_accept4_args {
+	syscallarg(int) s;
+	syscallarg(struct osockaddr *) name;
+	syscallarg(int *) anamelen;
+	syscallarg(int) flags;
+};
+check_syscall_args(linux_sys_accept4)
+
 struct linux_sys_dup3_args {
 	syscallarg(int) from;
 	syscallarg(int) to;
@@ -1448,6 +1456,8 @@ int	linux_sys_get_robust_list(struct lwp
 
 int	linux_sys_utimensat(struct lwp *, const struct linux_sys_utimensat_args *, register_t *);
 
+int	linux_sys_accept4(struct lwp *, const struct linux_sys_accept4_args *, register_t *);
+
 int	linux_sys_dup3(struct lwp *, const struct linux_sys_dup3_args *, register_t *);
 
 int	linux_sys_pipe2(struct lwp *, const struct linux_sys_pipe2_args *, register_t *);
Index: src/sys/compat/linux/arch/amd64/linux_syscalls.c
diff -u src/sys/compat/linux/arch/amd64/linux_syscalls.c:1.64 src/sys/compat/linux/arch/amd64/linux_syscalls.c:1.65
--- src/sys/compat/linux/arch/amd64/linux_syscalls.c:1.64	Sun Jan 15 19:11:09 2017
+++ src/sys/compat/linux/arch/amd64/linux_syscalls.c	Thu Feb  2 10:36:12 2017
@@ -1,14 +1,14 @@
-/* $NetBSD: linux_syscalls.c,v 1.64 2017/01/16 00:11:09 christos Exp $ */
+/* $NetBSD: linux_syscalls.c,v 1.65 2017/02/02 15:36:12 christos Exp $ */
 
 /*
  * System call names.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * created from	NetBSD: syscalls.master,v 1.58 2017/01/02 16:32:09 manu Exp
+ * created from	NetBSD: syscalls.master,v 1.59 2017/02/02 15:35:46 christos Exp
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: linux_syscalls.c,v 1.64 2017/01/16 00:11:09 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_syscalls.c,v 1.65 2017/02/02 15:36:12 christos Exp $");
 
 #if defined(_KERNEL_OPT)
 #if defined(_KERNEL_OPT)
@@ -354,7 +354,7 @@ const char *const linux_syscallnames[] =
 	/* 285 */	"#285 (unimplemented 

CVS commit: src/sys/compat/linux/arch

2017-02-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Feb  2 15:35:46 UTC 2017

Modified Files:
src/sys/compat/linux/arch/amd64: syscalls.master
src/sys/compat/linux/arch/mips: syscalls.master

Log Message:
implement accept4
XXX: mips looks busted (the syscalls file has lots of NOARGS syscalls that
should be STD).


To generate a diff of this commit:
cvs rdiff -u -r1.58 -r1.59 src/sys/compat/linux/arch/amd64/syscalls.master
cvs rdiff -u -r1.61 -r1.62 src/sys/compat/linux/arch/mips/syscalls.master

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

Modified files:

Index: src/sys/compat/linux/arch/amd64/syscalls.master
diff -u src/sys/compat/linux/arch/amd64/syscalls.master:1.58 src/sys/compat/linux/arch/amd64/syscalls.master:1.59
--- src/sys/compat/linux/arch/amd64/syscalls.master:1.58	Mon Jan  2 11:32:09 2017
+++ src/sys/compat/linux/arch/amd64/syscalls.master	Thu Feb  2 10:35:46 2017
@@ -1,4 +1,4 @@
-	$NetBSD: syscalls.master,v 1.58 2017/01/02 16:32:09 manu Exp $
+	$NetBSD: syscalls.master,v 1.59 2017/02/02 15:35:46 christos Exp $
 
 ;	@(#)syscalls.master	8.1 (Berkeley) 7/19/93
 
@@ -516,7 +516,9 @@
 285	UNIMPL		fallocate
 286	UNIMPL		timerfd_settime
 287	UNIMPL		timerfd_gettime
-288	UNIMPL		accept4
+288	STD		{ int|linux_sys||accept4(int s, \
+			struct osockaddr *name, \
+			int *anamelen, int flags); }
 289	UNIMPL		signalfd4
 290	UNIMPL		eventfd2
 291	UNIMPL		epoll_create1

Index: src/sys/compat/linux/arch/mips/syscalls.master
diff -u src/sys/compat/linux/arch/mips/syscalls.master:1.61 src/sys/compat/linux/arch/mips/syscalls.master:1.62
--- src/sys/compat/linux/arch/mips/syscalls.master:1.61	Mon Jan  2 11:32:10 2017
+++ src/sys/compat/linux/arch/mips/syscalls.master	Thu Feb  2 10:35:46 2017
@@ -1,4 +1,4 @@
-	$NetBSD: syscalls.master,v 1.61 2017/01/02 16:32:10 manu Exp $  
+	$NetBSD: syscalls.master,v 1.62 2017/02/02 15:35:46 christos Exp $  
 
 ;	@(#)syscalls.master	8.1 (Berkeley) 7/19/93
 
@@ -543,5 +543,7 @@
 331	UNIMPL		pwritev
 332	UNIMPL		rt_tgsigqueueinfo
 333	UNIMPL		perf_event_open
-334	UNIMPL		accept4
+334	STD		{ int|linux_sys||accept4(int s, \
+			struct osockaddr *name, \
+			int *anamelen, int flags); }
 335	UNIMPL		recvmmsg



CVS commit: src/lib/libpthread

2017-02-02 Thread Nicolas Joly
Module Name:src
Committed By:   njoly
Date:   Thu Feb  2 10:48:22 UTC 2017

Modified Files:
src/lib/libpthread: pthread_mutexattr.3

Log Message:
Fix a typo : pthread_mutexaddr_init -> pthread_mutexattr_init.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/lib/libpthread/pthread_mutexattr.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/libpthread/pthread_mutexattr.3
diff -u src/lib/libpthread/pthread_mutexattr.3:1.13 src/lib/libpthread/pthread_mutexattr.3:1.14
--- src/lib/libpthread/pthread_mutexattr.3:1.13	Tue Jul  5 10:04:17 2016
+++ src/lib/libpthread/pthread_mutexattr.3	Thu Feb  2 10:48:22 2017
@@ -1,4 +1,4 @@
-.\" $NetBSD: pthread_mutexattr.3,v 1.13 2016/07/05 10:04:17 wiz Exp $
+.\" $NetBSD: pthread_mutexattr.3,v 1.14 2017/02/02 10:48:22 njoly Exp $
 .\"
 .\" Copyright (c) 2002, 2010 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -173,7 +173,7 @@ Attempts to unlock an already unlocked
 mutex will result in undefined behavior.
 .Pp
 This is the default mutex type for
-.Fn pthread_mutexaddr_init .
+.Fn pthread_mutexattr_init .
 .El
 .Pp
 The



CVS commit: src/sys/dev/pci

2017-02-02 Thread Kengo NAKAHARA
Module Name:src
Committed By:   knakahara
Date:   Thu Feb  2 10:29:10 UTC 2017

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

Log Message:
remove WM_CORE_LOCK in deferred start routine.

It is enough to check each txq's txq_stopping with
mutex_enter(not mutex_tryenter).

reviewed by ozaki-r@n.o.


To generate a diff of this commit:
cvs rdiff -u -r1.475 -r1.476 src/sys/dev/pci/if_wm.c

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

Modified files:

Index: src/sys/dev/pci/if_wm.c
diff -u src/sys/dev/pci/if_wm.c:1.475 src/sys/dev/pci/if_wm.c:1.476
--- src/sys/dev/pci/if_wm.c:1.475	Wed Feb  1 08:56:41 2017
+++ src/sys/dev/pci/if_wm.c	Thu Feb  2 10:29:10 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wm.c,v 1.475 2017/02/01 08:56:41 msaitoh Exp $	*/
+/*	$NetBSD: if_wm.c,v 1.476 2017/02/02 10:29:10 knakahara Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -84,7 +84,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.475 2017/02/01 08:56:41 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.476 2017/02/02 10:29:10 knakahara Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -4720,6 +4720,9 @@ wm_turnon(struct wm_softc *sc)
 
 	KASSERT(WM_CORE_LOCKED(sc));
 
+	/*
+	 * must unset stopping flags in ascending order.
+	 */
 	for(i = 0; i < sc->sc_nqueues; i++) {
 		struct wm_txqueue *txq = >sc_queue[i].wmq_txq;
 		struct wm_rxqueue *rxq = >sc_queue[i].wmq_rxq;
@@ -4745,6 +4748,9 @@ wm_turnoff(struct wm_softc *sc)
 
 	sc->sc_core_stopping = true;
 
+	/*
+	 * must set stopping flags in ascending order.
+	 */
 	for(i = 0; i < sc->sc_nqueues; i++) {
 		struct wm_rxqueue *rxq = >sc_queue[i].wmq_rxq;
 		struct wm_txqueue *txq = >sc_queue[i].wmq_txq;
@@ -7334,22 +7340,23 @@ wm_deferred_start(struct ifnet *ifp)
 	 * Try to transmit on all Tx queues. Passing a txq somehow and
 	 * transmitting only on the txq may be better.
 	 */
-restart:
-	WM_CORE_LOCK(sc);
-	if (sc->sc_core_stopping)
-		goto out;
-
 	for (; qid < sc->sc_nqueues; qid++) {
 		struct wm_txqueue *txq = >sc_queue[qid].wmq_txq;
 
-		if (!mutex_tryenter(txq->txq_lock))
-			continue;
-
+		/*
+		 * We must mutex_enter(txq->txq_lock) instead of
+		 * mutex_tryenter(txq->txq_lock) here.
+		 * mutex_tryenter(txq->txq_lock) would fail as this txq's
+		 * txq_stopping flag is being set. In this case, this device
+		 * begin to stop, so we must not start any Tx processing.
+		 * However, it may start Tx processing for sc_queue[qid+1]
+		 * if we use mutex_tryenter() here.
+		 */
+		mutex_enter(txq->txq_lock);
 		if (txq->txq_stopping) {
 			mutex_exit(txq->txq_lock);
-			continue;
+			return;
 		}
-		WM_CORE_UNLOCK(sc);
 
 		if ((sc->sc_flags & WM_F_NEWQUEUE) != 0) {
 			/* XXX need for ALTQ */
@@ -7363,12 +7370,7 @@ restart:
 			wm_transmit_locked(ifp, txq);
 		}
 		mutex_exit(txq->txq_lock);
-
-		qid++;
-		goto restart;
 	}
-out:
-	WM_CORE_UNLOCK(sc);
 }
 
 /* Interrupt */



CVS commit: src/sys

2017-02-02 Thread NONAKA Kimihiro
Module Name:src
Committed By:   nonaka
Date:   Thu Feb  2 10:05:35 UTC 2017

Modified Files:
src/sys/dev/ic: an.c anvar.h arn5008.c arn9003.c ath.c ath_netbsd.h
athn.c athnvar.h atw.c atwvar.h awi.c awivar.h bwi.c bwivar.h
malo.c malovar.h rt2560.c rt2560var.h rt2661.c rt2661var.h rt2860.c
rt2860var.h rtw.c rtwvar.h wi.c wivar.h
src/sys/dev/pci: if_ipw.c if_ipwvar.h if_iwi.c if_iwivar.h if_iwm.c
if_iwmvar.h if_iwn.c if_iwnvar.h if_malo_pci.c if_rtwn.c
if_rtwnreg.h if_wpi.c if_wpivar.h
src/sys/dev/pcmcia: if_malo_pcmcia.c if_malo_pcmciavar.h
src/sys/net80211: ieee80211_input.c ieee80211_proto.c

Log Message:
wlan interfaces make interrupt routine running on softint context.

see http://mail-index.netbsd.org/tech-kern/2016/12/06/msg021281.html

tested device:
 * ath at pci: AR5212, AR5424
 * athn at pci: AR9287
 * ipw at pci: 2100BG
 * iwi at pci: 2915ABG
 * iwm at pci: 3165, 7260, 8260
 * iwn at pci: 4945, 6235
 * ral at pci: RT2560
 * rtwn at pci: RTL8192CE


To generate a diff of this commit:
cvs rdiff -u -r1.63 -r1.64 src/sys/dev/ic/an.c
cvs rdiff -u -r1.20 -r1.21 src/sys/dev/ic/anvar.h
cvs rdiff -u -r1.11 -r1.12 src/sys/dev/ic/arn5008.c \
src/sys/dev/ic/rt2661var.h
cvs rdiff -u -r1.9 -r1.10 src/sys/dev/ic/arn9003.c src/sys/dev/ic/bwivar.h \
src/sys/dev/ic/rt2560var.h
cvs rdiff -u -r1.122 -r1.123 src/sys/dev/ic/ath.c
cvs rdiff -u -r1.15 -r1.16 src/sys/dev/ic/ath_netbsd.h
cvs rdiff -u -r1.14 -r1.15 src/sys/dev/ic/athn.c
cvs rdiff -u -r1.5 -r1.6 src/sys/dev/ic/athnvar.h
cvs rdiff -u -r1.160 -r1.161 src/sys/dev/ic/atw.c
cvs rdiff -u -r1.37 -r1.38 src/sys/dev/ic/atwvar.h
cvs rdiff -u -r1.90 -r1.91 src/sys/dev/ic/awi.c
cvs rdiff -u -r1.27 -r1.28 src/sys/dev/ic/awivar.h
cvs rdiff -u -r1.30 -r1.31 src/sys/dev/ic/bwi.c
cvs rdiff -u -r1.8 -r1.9 src/sys/dev/ic/malo.c
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/ic/malovar.h
cvs rdiff -u -r1.28 -r1.29 src/sys/dev/ic/rt2560.c
cvs rdiff -u -r1.33 -r1.34 src/sys/dev/ic/rt2661.c
cvs rdiff -u -r1.24 -r1.25 src/sys/dev/ic/rt2860.c
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/ic/rt2860var.h
cvs rdiff -u -r1.124 -r1.125 src/sys/dev/ic/rtw.c
cvs rdiff -u -r1.44 -r1.45 src/sys/dev/ic/rtwvar.h
cvs rdiff -u -r1.241 -r1.242 src/sys/dev/ic/wi.c
cvs rdiff -u -r1.65 -r1.66 src/sys/dev/ic/wivar.h
cvs rdiff -u -r1.62 -r1.63 src/sys/dev/pci/if_ipw.c
cvs rdiff -u -r1.17 -r1.18 src/sys/dev/pci/if_ipwvar.h
cvs rdiff -u -r1.101 -r1.102 src/sys/dev/pci/if_iwi.c
cvs rdiff -u -r1.18 -r1.19 src/sys/dev/pci/if_iwivar.h \
src/sys/dev/pci/if_iwnvar.h
cvs rdiff -u -r1.69 -r1.70 src/sys/dev/pci/if_iwm.c
cvs rdiff -u -r1.16 -r1.17 src/sys/dev/pci/if_iwmvar.h
cvs rdiff -u -r1.83 -r1.84 src/sys/dev/pci/if_iwn.c
cvs rdiff -u -r1.5 -r1.6 src/sys/dev/pci/if_malo_pci.c
cvs rdiff -u -r1.10 -r1.11 src/sys/dev/pci/if_rtwn.c
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/pci/if_rtwnreg.h
cvs rdiff -u -r1.76 -r1.77 src/sys/dev/pci/if_wpi.c
cvs rdiff -u -r1.20 -r1.21 src/sys/dev/pci/if_wpivar.h
cvs rdiff -u -r1.12 -r1.13 src/sys/dev/pcmcia/if_malo_pcmcia.c
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/pcmcia/if_malo_pcmciavar.h
cvs rdiff -u -r1.86 -r1.87 src/sys/net80211/ieee80211_input.c
cvs rdiff -u -r1.33 -r1.34 src/sys/net80211/ieee80211_proto.c

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

Modified files:

Index: src/sys/dev/ic/an.c
diff -u src/sys/dev/ic/an.c:1.63 src/sys/dev/ic/an.c:1.64
--- src/sys/dev/ic/an.c:1.63	Fri Jun 10 13:27:13 2016
+++ src/sys/dev/ic/an.c	Thu Feb  2 10:05:35 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: an.c,v 1.63 2016/06/10 13:27:13 ozaki-r Exp $	*/
+/*	$NetBSD: an.c,v 1.64 2017/02/02 10:05:35 nonaka Exp $	*/
 /*
  * Copyright (c) 1997, 1998, 1999
  *	Bill Paul .  All rights reserved.
@@ -77,7 +77,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: an.c,v 1.63 2016/06/10 13:27:13 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: an.c,v 1.64 2017/02/02 10:05:35 nonaka Exp $");
 
 
 #include 
@@ -96,6 +96,7 @@ __KERNEL_RCSID(0, "$NetBSD: an.c,v 1.63 
 #include 
 
 #include 
+#include 
 
 #include 
 #include 
@@ -116,6 +117,7 @@ __KERNEL_RCSID(0, "$NetBSD: an.c,v 1.63 
 
 static int	an_reset(struct an_softc *);
 static void	an_wait(struct an_softc *);
+static void	an_softintr(void *);
 static int	an_init(struct ifnet *);
 static void	an_stop(struct ifnet *, int);
 static void	an_start(struct ifnet *);
@@ -178,6 +180,13 @@ an_attach(struct an_softc *sc)
 		return 1;
 	}
 
+	sc->sc_soft_ih = softint_establish(SOFTINT_NET, an_softintr, sc);
+	if (sc->sc_soft_ih == NULL) {
+		splx(s);
+		aprint_error_dev(sc->sc_dev, "failed to establish softint\n");
+		return 1;
+	}
+
 	/* Load factory config */
 	if (an_cmd(sc, AN_CMD_READCFG, 0) != 0) {
 		splx(s);
@@ -308,8 +317,10 @@ an_attach(struct an_softc *sc)
 	/*
 	 * Call MI attach routine.
 	 */
-	if_attach(ifp);
+	if_initialize(ifp);
 	ieee80211_ifattach(ic);
+	ifp->if_percpuq = 

CVS commit: src/sys/arch

2017-02-02 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Thu Feb  2 08:57:04 UTC 2017

Modified Files:
src/sys/arch/x86/x86: cpu.c identcpu.c pmap.c
src/sys/arch/xen/x86: cpu.c x86_xpmap.c

Log Message:
Use __read_mostly on these variables, to reduce the probability of false
sharing.


To generate a diff of this commit:
cvs rdiff -u -r1.121 -r1.122 src/sys/arch/x86/x86/cpu.c
cvs rdiff -u -r1.51 -r1.52 src/sys/arch/x86/x86/identcpu.c
cvs rdiff -u -r1.237 -r1.238 src/sys/arch/x86/x86/pmap.c
cvs rdiff -u -r1.106 -r1.107 src/sys/arch/xen/x86/cpu.c
cvs rdiff -u -r1.70 -r1.71 src/sys/arch/xen/x86/x86_xpmap.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/x86/x86/cpu.c
diff -u src/sys/arch/x86/x86/cpu.c:1.121 src/sys/arch/x86/x86/cpu.c:1.122
--- src/sys/arch/x86/x86/cpu.c:1.121	Sun Oct 16 10:24:58 2016
+++ src/sys/arch/x86/x86/cpu.c	Thu Feb  2 08:57:04 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.c,v 1.121 2016/10/16 10:24:58 maxv Exp $	*/
+/*	$NetBSD: cpu.c,v 1.122 2017/02/02 08:57:04 maxv Exp $	*/
 
 /*-
  * Copyright (c) 2000-2012 NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.121 2016/10/16 10:24:58 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.122 2017/02/02 08:57:04 maxv Exp $");
 
 #include "opt_ddb.h"
 #include "opt_mpbios.h"		/* for MPDEBUG */
@@ -177,7 +177,7 @@ static void	tss_init(struct i386tss *, v
 
 static void	cpu_init_idle_lwp(struct cpu_info *);
 
-uint32_t cpu_feature[7]; /* X86 CPUID feature bits */
+uint32_t cpu_feature[7] __read_mostly; /* X86 CPUID feature bits */
 			/* [0] basic features cpuid.1:%edx
 			 * [1] basic features cpuid.1:%ecx (CPUID2_xxx bits)
 			 * [2] extended features cpuid:8001:%edx

Index: src/sys/arch/x86/x86/identcpu.c
diff -u src/sys/arch/x86/x86/identcpu.c:1.51 src/sys/arch/x86/x86/identcpu.c:1.52
--- src/sys/arch/x86/x86/identcpu.c:1.51	Sat Dec 17 15:23:08 2016
+++ src/sys/arch/x86/x86/identcpu.c	Thu Feb  2 08:57:04 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: identcpu.c,v 1.51 2016/12/17 15:23:08 maxv Exp $	*/
+/*	$NetBSD: identcpu.c,v 1.52 2017/02/02 08:57:04 maxv Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: identcpu.c,v 1.51 2016/12/17 15:23:08 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: identcpu.c,v 1.52 2017/02/02 08:57:04 maxv Exp $");
 
 #include "opt_xen.h"
 
@@ -61,9 +61,9 @@ static const struct x86_cache_info amd_c
 int cpu_vendor;
 char cpu_brand_string[49];
 
-int x86_fpu_save = FPU_SAVE_FSAVE;
-unsigned int x86_fpu_save_size = 512;
-uint64_t x86_xsave_features = 0;
+int x86_fpu_save __read_mostly = FPU_SAVE_FSAVE;
+unsigned int x86_fpu_save_size __read_mostly = 512;
+uint64_t x86_xsave_features __read_mostly = 0;
 
 /*
  * Note: these are just the ones that may not have a cpuid instruction.

Index: src/sys/arch/x86/x86/pmap.c
diff -u src/sys/arch/x86/x86/pmap.c:1.237 src/sys/arch/x86/x86/pmap.c:1.238
--- src/sys/arch/x86/x86/pmap.c:1.237	Sun Jan 22 20:04:35 2017
+++ src/sys/arch/x86/x86/pmap.c	Thu Feb  2 08:57:04 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.237 2017/01/22 20:04:35 maxv Exp $	*/
+/*	$NetBSD: pmap.c,v 1.238 2017/02/02 08:57:04 maxv Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2010, 2016, 2017 The NetBSD Foundation, Inc.
@@ -171,7 +171,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.237 2017/01/22 20:04:35 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.238 2017/02/02 08:57:04 maxv Exp $");
 
 #include "opt_user_ldt.h"
 #include "opt_lockdebug.h"
@@ -480,8 +480,8 @@ static vaddr_t virtual_end __read_mostly
 /*
  * LAPIC virtual address, and fake physical address.
  */
-volatile vaddr_t local_apic_va;
-paddr_t local_apic_pa;
+volatile vaddr_t local_apic_va __read_mostly;
+paddr_t local_apic_pa __read_mostly;
 #endif
 
 /*

Index: src/sys/arch/xen/x86/cpu.c
diff -u src/sys/arch/xen/x86/cpu.c:1.106 src/sys/arch/xen/x86/cpu.c:1.107
--- src/sys/arch/xen/x86/cpu.c:1.106	Sun Jan 22 19:42:48 2017
+++ src/sys/arch/xen/x86/cpu.c	Thu Feb  2 08:57:04 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.c,v 1.106 2017/01/22 19:42:48 maxv Exp $	*/
+/*	$NetBSD: cpu.c,v 1.107 2017/02/02 08:57:04 maxv Exp $	*/
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -65,7 +65,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.106 2017/01/22 19:42:48 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.107 2017/02/02 08:57:04 maxv Exp $");
 
 #include "opt_ddb.h"
 #include "opt_multiprocessor.h"
@@ -171,7 +171,7 @@ struct cpu_info phycpu_info_primary __al
 struct cpu_info *cpu_info_list = _info_primary;
 struct cpu_info *phycpu_info_list = _info_primary;
 
-uint32_t cpu_feature[7]; /* X86 CPUID feature bits
+uint32_t cpu_feature[7] __read_mostly; /* X86 CPUID feature bits
 			  *	[0] basic features %edx
 			  *	[1] basic features %ecx
 			  *	[2] extended features 

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

2017-02-02 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Feb  2 08:12:08 UTC 2017

Modified Files:
src/sys/arch/sparc/include: elf_machdep.h

Log Message:
PR port-sparc64/51925: cosmetic cleanup, no functional change


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/sparc/include/elf_machdep.h

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

Modified files:

Index: src/sys/arch/sparc/include/elf_machdep.h
diff -u src/sys/arch/sparc/include/elf_machdep.h:1.7 src/sys/arch/sparc/include/elf_machdep.h:1.8
--- src/sys/arch/sparc/include/elf_machdep.h:1.7	Sat May 30 05:56:53 2009
+++ src/sys/arch/sparc/include/elf_machdep.h	Thu Feb  2 08:12:08 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: elf_machdep.h,v 1.7 2009/05/30 05:56:53 skrll Exp $	*/
+/*	$NetBSD: elf_machdep.h,v 1.8 2017/02/02 08:12:08 martin Exp $	*/
 
 #define ELF32_MACHDEP_ENDIANNESS	ELFDATA2MSB
 #define	ELF32_MACHDEP_ID_CASES		\
@@ -6,13 +6,11 @@
 		case EM_SPARC32PLUS:	\
 			break;
 
-#define	ELF64_MACHDEP_ENDIANNESS	ELFDATA2MSB
+#define	ELF64_MACHDEP_ENDIANNESS	XXX	/* break compilation */
 #define	ELF64_MACHDEP_ID_CASES		\
-		case EM_SPARC32PLUS:	\
-		case EM_SPARCV9:	\
 		/* no 64-bit ELF machine types supported */
 
-#define	ELF32_MACHDEP_ID	EM_SPARC	/* XXX right? */
+#define	ELF32_MACHDEP_ID	EM_SPARC
 
 #define ARCH_ELFSIZE		32	/* MD native binary size */