CVS commit: src/sys/arch/newsmips

2018-09-29 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sun Sep 30 06:14:23 UTC 2018

Modified Files:
src/sys/arch/newsmips/apbus: apbus.c apbus_subr.c apbusvar.h
src/sys/arch/newsmips/conf: std.newsmips

Log Message:
Fix news5000 panic during boot on APbus attach. PR port-newsmips/53626

Discussed with ryo@ (the original author of news5000 support).
Should be pulled up to netbsd-8.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/newsmips/apbus/apbus.c
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/newsmips/apbus/apbus_subr.c \
src/sys/arch/newsmips/apbus/apbusvar.h
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/newsmips/conf/std.newsmips

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/newsmips/apbus/apbus.c
diff -u src/sys/arch/newsmips/apbus/apbus.c:1.22 src/sys/arch/newsmips/apbus/apbus.c:1.23
--- src/sys/arch/newsmips/apbus/apbus.c:1.22	Sun Feb 20 07:56:31 2011
+++ src/sys/arch/newsmips/apbus/apbus.c	Sun Sep 30 06:14:23 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: apbus.c,v 1.22 2011/02/20 07:56:31 matt Exp $	*/
+/*	$NetBSD: apbus.c,v 1.23 2018/09/30 06:14:23 tsutsui Exp $	*/
 
 /*-
  * Copyright (C) 1999 SHIMIZU Ryo.  All rights reserved.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: apbus.c,v 1.22 2011/02/20 07:56:31 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: apbus.c,v 1.23 2018/09/30 06:14:23 tsutsui Exp $");
 
 #define __INTR_PRIVATE
 
@@ -99,6 +99,7 @@ apbusattach(device_t parent, device_t se
 	struct newsmips_intr *ip;
 	int i;
 
+	apbus_map_romwork();
 	mips_set_wbflush(apbus_wbflush);
 
 	*(volatile uint32_t *)(NEWS5000_APBUS_INTST) = 0x;

Index: src/sys/arch/newsmips/apbus/apbus_subr.c
diff -u src/sys/arch/newsmips/apbus/apbus_subr.c:1.9 src/sys/arch/newsmips/apbus/apbus_subr.c:1.10
--- src/sys/arch/newsmips/apbus/apbus_subr.c:1.9	Mon Mar 24 20:05:20 2014
+++ src/sys/arch/newsmips/apbus/apbus_subr.c	Sun Sep 30 06:14:23 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: apbus_subr.c,v 1.9 2014/03/24 20:05:20 christos Exp $	*/
+/*	$NetBSD: apbus_subr.c,v 1.10 2018/09/30 06:14:23 tsutsui Exp $	*/
 
 /*-
  * Copyright (C) 1999 SHIMIZU Ryo.  All rights reserved.
@@ -27,15 +27,47 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: apbus_subr.c,v 1.9 2014/03/24 20:05:20 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: apbus_subr.c,v 1.10 2018/09/30 06:14:23 tsutsui Exp $");
 
 #include 
 #include 
 
+#include 
+
+#include 
+#include 
+
+#include 
+
 #include 
 
 static void apctl_dump(struct apbus_ctl *);
 
+#define	APBUS_ROMWORK_VA	0xfff0
+
+void
+apbus_map_romwork(void)
+{
+	static bool mapped = false;
+	vaddr_t apbd_work_va;
+	vsize_t apbd_work_sz;
+	paddr_t apbd_work_pa;
+
+	if (!mapped) {
+		/* map PROM work RAM into VA 0xFFF0 - 0x */
+		apbd_work_va = APBUS_ROMWORK_VA;
+		apbd_work_sz = MIPS3_PG_SIZE_MASK_TO_SIZE(MIPS3_PG_SIZE_1M);
+		apbd_work_pa = ctob(physmem);
+
+		mapped = mips3_wired_enter_page(apbd_work_va, apbd_work_pa,
+		apbd_work_sz);
+		if (!mapped) {
+			printf("%s: cannot allocate APbus PROM work\n",
+			__func__);
+		}
+	}
+}
+
 void *
 apbus_device_to_hwaddr(struct apbus_dev *apbus_dev)
 {
Index: src/sys/arch/newsmips/apbus/apbusvar.h
diff -u src/sys/arch/newsmips/apbus/apbusvar.h:1.9 src/sys/arch/newsmips/apbus/apbusvar.h:1.10
--- src/sys/arch/newsmips/apbus/apbusvar.h:1.9	Wed Oct 17 19:55:54 2007
+++ src/sys/arch/newsmips/apbus/apbusvar.h	Sun Sep 30 06:14:23 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: apbusvar.h,v 1.9 2007/10/17 19:55:54 garbled Exp $	*/
+/*	$NetBSD: apbusvar.h,v 1.10 2018/09/30 06:14:23 tsutsui Exp $	*/
 
 /*-
  * Copyright (C) 1999 SHIMIZU Ryo.  All rights reserved.
@@ -39,6 +39,7 @@ struct apbus_attach_args {
 	u_long	apa_hwbase;	/* hardware I/O address */
 };
 
+void apbus_map_romwork(void);
 void *apbus_device_to_hwaddr(struct apbus_dev *);
 struct apbus_dev *apbus_lookupdev(char *);
 void apdevice_dump(struct apbus_dev *);

Index: src/sys/arch/newsmips/conf/std.newsmips
diff -u src/sys/arch/newsmips/conf/std.newsmips:1.17 src/sys/arch/newsmips/conf/std.newsmips:1.18
--- src/sys/arch/newsmips/conf/std.newsmips:1.17	Sun Dec 11 12:18:24 2005
+++ src/sys/arch/newsmips/conf/std.newsmips	Sun Sep 30 06:14:23 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: std.newsmips,v 1.17 2005/12/11 12:18:24 christos Exp $
+#	$NetBSD: std.newsmips,v 1.18 2018/09/30 06:14:23 tsutsui Exp $
 
 machine newsmips mips
 include		"conf/std"	# MI standard options
@@ -7,5 +7,7 @@ makeoptions	MACHINE_ARCH="mipseb"
 options 	EXEC_ELF32	# exec ELF32 binaries
 options 	EXEC_SCRIPT	# exec #! scripts
 
+options 	ENABLE_MIPS3_WIRED_MAP
+
 makeoptions	DEFTEXTADDR="0x80001000"
 makeoptions	LINKFORMAT="-N"



CVS commit: [pgoyette-compat] src/doc

2018-09-29 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Sun Sep 30 01:48:27 UTC 2018

Modified Files:
src/doc [pgoyette-compat]: TODO.compat-module

Log Message:
Note issue with compat_sunos vs sparc64's compat_netbsd32


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.15 -r1.1.2.16 src/doc/TODO.compat-module

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

Modified files:

Index: src/doc/TODO.compat-module
diff -u src/doc/TODO.compat-module:1.1.2.15 src/doc/TODO.compat-module:1.1.2.16
--- src/doc/TODO.compat-module:1.1.2.15	Fri Sep 28 09:36:20 2018
+++ src/doc/TODO.compat-module	Sun Sep 30 01:48:27 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: TODO.compat-module,v 1.1.2.15 2018/09/28 09:36:20 pgoyette Exp $ */
+/* $NetBSD: TODO.compat-module,v 1.1.2.16 2018/09/30 01:48:27 pgoyette Exp $ */
 
 DONE
 
@@ -55,7 +55,9 @@ DONE
 TODO - Required for branch merge
 
 15.  Need to finish cleaning up the netbsd32 machine-dependent code, since
-the MI code assumes that there's MD file available.
+the MI code assumes that there's MD file available.  This is done, but
+there's still an issue with the compat_netbsd32 for sparc64 - it wants
+to reference emul_sunos but doesn't include sunos_exec.c in the build.
 
 16. The ieee_80211 compat code needs to be verified to make sure it is
 handling the if43_20 compat routine cvtcmd() correctly.



CVS commit: src/doc

2018-09-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Sep 30 01:57:41 UTC 2018

Modified Files:
src/doc: 3RDPARTY

Log Message:
mention  only the version with have in current.


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

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

Modified files:

Index: src/doc/3RDPARTY
diff -u src/doc/3RDPARTY:1.1565 src/doc/3RDPARTY:1.1566
--- src/doc/3RDPARTY:1.1565	Tue Sep 25 01:43:43 2018
+++ src/doc/3RDPARTY	Sat Sep 29 21:57:41 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.1565 2018/09/25 05:43:43 joerg Exp $
+#	$NetBSD: 3RDPARTY,v 1.1566 2018/09/30 01:57:41 christos Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -115,7 +115,7 @@ bc includes dc, both of which are in the
 
 Package:	bind [named and utils]
 Version:	9.10.7/BSD	9.12.2-P1/MPL
-Current Vers:	9.10.7/BSD	9.12.2-P1/MPL
+Current Vers:			9.12.2-P1/MPL
 Maintainer:	ISC
 Archive Site:	ftp://ftp.isc.org/isc/bind9/
 Home Page:	http://www.isc.org/software/bind/



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

2018-09-29 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Sep 30 00:42:17 UTC 2018

Modified Files:
src/distrib/sets/lists/comp: ad.m68k

Log Message:
add gcc 4.5 files.  updating a m68k system gave me:

rmdir: /usr/include/gcc-4.5: Directory not empty
Can't remove obsolete directory /usr/include/gcc-4.5

because these two files were still present.


To generate a diff of this commit:
cvs rdiff -u -r1.57 -r1.58 src/distrib/sets/lists/comp/ad.m68k

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

Modified files:

Index: src/distrib/sets/lists/comp/ad.m68k
diff -u src/distrib/sets/lists/comp/ad.m68k:1.57 src/distrib/sets/lists/comp/ad.m68k:1.58
--- src/distrib/sets/lists/comp/ad.m68k:1.57	Wed Aug 22 01:05:21 2018
+++ src/distrib/sets/lists/comp/ad.m68k	Sun Sep 30 00:42:17 2018
@@ -1,5 +1,7 @@
-# $NetBSD: ad.m68k,v 1.57 2018/08/22 01:05:21 msaitoh Exp $
+# $NetBSD: ad.m68k,v 1.58 2018/09/30 00:42:17 mrg Exp $
 ./usr/bin/elf2aoutcomp-sysutil-bin
+./usr/include/gcc-4.5/math-68881.h		comp-c-include		obsolete
+./usr/include/gcc-4.5/tgmath.h			comp-c-include		obsolete
 ./usr/include/gcc-4.8/math-68881.h		comp-c-include		obsolete
 ./usr/include/gcc-4.8/tgmath.h			comp-c-include		obsolete
 ./usr/include/gcc-5/math-68881.h		comp-c-include		gcccmds,gcc=5



CVS commit: [pgoyette-compat] src/sys/arch/sparc64

2018-09-29 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Sun Sep 30 00:17:55 UTC 2018

Modified Files:
src/sys/arch/sparc64/conf [pgoyette-compat]: files.sparc64
src/sys/arch/sparc64/sparc64 [pgoyette-compat]: netbsd32_machdep.c
Added Files:
src/sys/arch/sparc64/sparc64 [pgoyette-compat]: netbsd32_machdep_13.c
netbsd32_machdep_16.c

Log Message:
Split sparc64/netbsd32_machdep.c into pieces specific to versions _13
and _16

XXX Somehow this has broken compat_sunos - must investigate further


To generate a diff of this commit:
cvs rdiff -u -r1.154 -r1.154.2.1 src/sys/arch/sparc64/conf/files.sparc64
cvs rdiff -u -r1.110 -r1.110.14.1 \
src/sys/arch/sparc64/sparc64/netbsd32_machdep.c
cvs rdiff -u -r0 -r1.1.2.1 src/sys/arch/sparc64/sparc64/netbsd32_machdep_13.c \
src/sys/arch/sparc64/sparc64/netbsd32_machdep_16.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/sparc64/conf/files.sparc64
diff -u src/sys/arch/sparc64/conf/files.sparc64:1.154 src/sys/arch/sparc64/conf/files.sparc64:1.154.2.1
--- src/sys/arch/sparc64/conf/files.sparc64:1.154	Tue Dec 19 14:34:08 2017
+++ src/sys/arch/sparc64/conf/files.sparc64	Sun Sep 30 00:17:54 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: files.sparc64,v 1.154 2017/12/19 14:34:08 nakayama Exp $
+#	$NetBSD: files.sparc64,v 1.154.2.1 2018/09/30 00:17:54 pgoyette Exp $
 
 # @(#)files.sparc64	8.1 (Berkeley) 7/19/93
 # sparc64-specific configuration info
@@ -288,8 +288,12 @@ file	arch/sparc64/sparc64/compat_16_mach
 
 # NetBSD/sparc 32-bit Binary compatibility (COMPAT_NETBSD32)
 include "compat/netbsd32/files.netbsd32"
-file	arch/sparc64/sparc64/netbsd32_machdep.c	compat_netbsd32
-file	arch/sparc64/sparc64/netbsd32_sigcode.s	compat_netbsd32
+file	arch/sparc64/sparc64/netbsd32_machdep.c		compat_netbsd32
+file	arch/sparc64/sparc64/netbsd32_machdep_13.c	compat_netbsd32 &
+			compat_13
+file	arch/sparc64/sparc64/netbsd32_machdep_16.c	compat_netbsd32 &
+			compat_16
+file	arch/sparc64/sparc64/netbsd32_sigcode.s		compat_netbsd32
 
 # SVR4 Binary Compatibility (COMPAT_SVR4)
 include "compat/svr4/files.svr4"

Index: src/sys/arch/sparc64/sparc64/netbsd32_machdep.c
diff -u src/sys/arch/sparc64/sparc64/netbsd32_machdep.c:1.110 src/sys/arch/sparc64/sparc64/netbsd32_machdep.c:1.110.14.1
--- src/sys/arch/sparc64/sparc64/netbsd32_machdep.c:1.110	Wed Oct 19 09:44:01 2016
+++ src/sys/arch/sparc64/sparc64/netbsd32_machdep.c	Sun Sep 30 00:17:55 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_machdep.c,v 1.110 2016/10/19 09:44:01 skrll Exp $	*/
+/*	$NetBSD: netbsd32_machdep.c,v 1.110.14.1 2018/09/30 00:17:55 pgoyette Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Matthew R. Green
@@ -27,13 +27,14 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.110 2016/10/19 09:44:01 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.110.14.1 2018/09/30 00:17:55 pgoyette Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
 #include "opt_compat_sunos.h"
 #include "opt_modular.h"
 #include "opt_execfmt.h"
+#include "opt_coredump.h"
 #include "firm_events.h"
 #endif
 
@@ -88,6 +89,8 @@ __KERNEL_RCSID(0, "$NetBSD: netbsd32_mac
 const char	machine32[] = "sparc";	
 const char	machine_arch32[] = "sparc";	
 
+int netbsd32_sendsig_siginfo(const ksiginfo_t *, const sigset_t *);
+
 #if NFIRM_EVENTS > 0
 static int ev_out32(struct firm_event *, int, struct uio *);
 #endif
@@ -150,166 +153,12 @@ netbsd32_setregs(struct lwp *l, struct e
 	tf->tf_out[7] = 0;
 }
 
-#ifdef COMPAT_16
-/*
- * NB: since this is a 32-bit address world, sf_scp and sf_sc
- *	can't be a pointer since those are 64-bits wide.
- */
-struct sparc32_sigframe {
-	int	sf_signo;		/* signal number */
-	int	sf_code;		/* code */
-	u_int	sf_scp;			/* SunOS user addr of sigcontext */
-	int	sf_addr;		/* SunOS compat, always 0 for now */
-	struct	netbsd32_sigcontext sf_sc;	/* actual sigcontext */
-};
-
-#undef DEBUG
-#ifdef DEBUG
-extern int sigdebug;
-#endif
-
-static void
-netbsd32_sendsig_sigcontext(const ksiginfo_t *ksi, const sigset_t *mask)
-{
-	int sig = ksi->ksi_signo;
-	struct lwp *l = curlwp;
-	struct proc *p = l->l_proc;
-	struct sparc32_sigframe *fp;
-	struct trapframe64 *tf;
-	int addr, onstack, error;
-	struct rwindow32 *oldsp, *newsp;
-	register32_t sp;
-	sig_t catcher = SIGACTION(p, sig).sa_handler;
-	struct sparc32_sigframe sf;
-	extern char netbsd32_sigcode[], netbsd32_esigcode[];
-#define	szsigcode	(netbsd32_esigcode - netbsd32_sigcode)
-
-	tf = l->l_md.md_tf;
-	/* Need to attempt to zero extend this 32-bit pointer */
-	oldsp = (struct rwindow32 *)(u_long)(u_int)tf->tf_out[6];
-	/* Do we need to jump onto the signal stack? */
-	onstack =
-	(l->l_sigstk.ss_flags & (SS_DISABLE | SS_ONSTACK)) == 0 &&
-	(SIGACTION(p, sig).sa_flags & SA_ONSTACK) != 0;
-	if (onstack) {
-		fp = (struct sparc32_sigframe *)((char *)l->l_sigstk.ss_sp +
-	l->l_sigstk.ss_size);
-		l->l_si

CVS commit: src/doc

2018-09-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Sep 29 21:53:38 UTC 2018

Modified Files:
src/doc: CHANGES

Log Message:
new ntpd


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

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

Modified files:

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.2444 src/doc/CHANGES:1.2445
--- src/doc/CHANGES:1.2444	Sat Sep 29 14:48:55 2018
+++ src/doc/CHANGES	Sat Sep 29 17:53:38 2018
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2444 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2445 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -229,3 +229,4 @@ Changes from NetBSD 8.0 to NetBSD 9.0:
 		ifpci(4), ifritz, iwic(4), and all the ISDN-related
 		userland tools. [maxv 20180923]
 	npf: Converted to use libnv [rmind 20180929]
+	ntp: Import ntp 4.2.8p12. [christos 20180929]



CVS commit: src/lib/libcurses

2018-09-29 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Sat Sep 29 22:04:58 UTC 2018

Modified Files:
src/lib/libcurses: curses_slk.3

Log Message:
Fix the documented function prototype of slk_attr_set(3)

Note the missing argument short pair.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/lib/libcurses/curses_slk.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/libcurses/curses_slk.3
diff -u src/lib/libcurses/curses_slk.3:1.1 src/lib/libcurses/curses_slk.3:1.2
--- src/lib/libcurses/curses_slk.3:1.1	Tue Jan 24 17:27:30 2017
+++ src/lib/libcurses/curses_slk.3	Sat Sep 29 22:04:57 2018
@@ -1,4 +1,4 @@
-.\"	$NetBSD: curses_slk.3,v 1.1 2017/01/24 17:27:30 roy Exp $
+.\"	$NetBSD: curses_slk.3,v 1.2 2018/09/29 22:04:57 kamil Exp $
 .\"
 .\" Copyright (c) 2017 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -28,7 +28,7 @@
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
 .\"
-.Dd January 12, 2017
+.Dd September 29, 2018
 .Dt CURSES_SLK 3
 .Os
 .Sh NAME
@@ -64,7 +64,7 @@
 .Ft int
 .Fn slk_attrset "const chtype attr"
 .Ft int
-.Fn slk_attr_set "const attr_t attr" "void *opt"
+.Fn slk_attr_set "const attr_t attr" "short pair" "void *opt"
 .Ft void
 .Fn slk_clear "void"
 .Ft int



CVS commit: src/lib/libcurses

2018-09-29 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Sat Sep 29 21:52:29 UTC 2018

Modified Files:
src/lib/libcurses: curses_underscore.3

Log Message:
Fix function prototypes in curses_underscore.3

Correct function prototype of wunderscore(3) and wunderend(3).


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/lib/libcurses/curses_underscore.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/libcurses/curses_underscore.3
diff -u src/lib/libcurses/curses_underscore.3:1.5 src/lib/libcurses/curses_underscore.3:1.6
--- src/lib/libcurses/curses_underscore.3:1.5	Wed Apr 30 13:10:51 2008
+++ src/lib/libcurses/curses_underscore.3	Sat Sep 29 21:52:29 2018
@@ -1,4 +1,4 @@
-.\"	$NetBSD: curses_underscore.3,v 1.5 2008/04/30 13:10:51 martin Exp $
+.\"	$NetBSD: curses_underscore.3,v 1.6 2018/09/29 21:52:29 kamil Exp $
 .\" Copyright (c) 2002 The NetBSD Foundation, Inc.
 .\" All rights reserved.
 .\"
@@ -25,7 +25,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd October 13, 2002
+.Dd September 29, 2018
 .Dt CURSES_UNDERSCORE 3
 .Os
 .Sh NAME
@@ -44,9 +44,9 @@
 .Ft int
 .Fn underend void
 .Ft int
-.Fn wunderscore void
+.Fn wunderscore "WINDOW *"
 .Ft int
-.Fn wunderend void
+.Fn wunderend "WINDOW *"
 .Sh DESCRIPTION
 These functions manipulate the underscore attribute on
 .Dv stdscr



CVS commit: [pgoyette-compat] src/sys

2018-09-29 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Sat Sep 29 21:36:15 UTC 2018

Modified Files:
src/sys/arch/amd64/amd64 [pgoyette-compat]: netbsd32_machdep.c
src/sys/arch/mips/mips [pgoyette-compat]: netbsd32_machdep.c
src/sys/compat/common [pgoyette-compat]: if_43.c
src/sys/compat/netbsd32 [pgoyette-compat]: netbsd32_module.c
src/sys/dev [pgoyette-compat]: bio.c ccd.c clockctl.c vnd.c
src/sys/dev/raidframe [pgoyette-compat]: rf_netbsdkintf.c
src/sys/dev/sysmon [pgoyette-compat]: sysmon_power.c
src/sys/dev/usb [pgoyette-compat]: ugen.c uhid.c usb.c
src/sys/dev/wscons [pgoyette-compat]: wsevent.c
src/sys/fs/puffs [pgoyette-compat]: puffs_msgif.c
src/sys/kern [pgoyette-compat]: kern_proc.c sys_module.c
src/sys/net [pgoyette-compat]: if.c if_spppsubr.c rtsock.c
src/sys/net80211 [pgoyette-compat]: ieee80211_ioctl.c
src/sys/opencrypto [pgoyette-compat]: cryptodev.c
src/sys/sys [pgoyette-compat]: module_hook.h

Log Message:
In MODULE_HOOK_CALL_DECL we don't need to provide the actual argument
list for calling the hook function, nor do we need to provide the
default value (for when the hook has not been set).


To generate a diff of this commit:
cvs rdiff -u -r1.115.2.10 -r1.115.2.11 \
src/sys/arch/amd64/amd64/netbsd32_machdep.c
cvs rdiff -u -r1.15.2.6 -r1.15.2.7 src/sys/arch/mips/mips/netbsd32_machdep.c
cvs rdiff -u -r1.14.2.5 -r1.14.2.6 src/sys/compat/common/if_43.c
cvs rdiff -u -r1.6.2.8 -r1.6.2.9 src/sys/compat/netbsd32/netbsd32_module.c
cvs rdiff -u -r1.13.16.4 -r1.13.16.5 src/sys/dev/bio.c
cvs rdiff -u -r1.175.2.7 -r1.175.2.8 src/sys/dev/ccd.c
cvs rdiff -u -r1.35.14.7 -r1.35.14.8 src/sys/dev/clockctl.c
cvs rdiff -u -r1.263.2.6 -r1.263.2.7 src/sys/dev/vnd.c
cvs rdiff -u -r1.356.2.5 -r1.356.2.6 src/sys/dev/raidframe/rf_netbsdkintf.c
cvs rdiff -u -r1.58.2.4 -r1.58.2.5 src/sys/dev/sysmon/sysmon_power.c
cvs rdiff -u -r1.139.2.4 -r1.139.2.5 src/sys/dev/usb/ugen.c
cvs rdiff -u -r1.101.2.4 -r1.101.2.5 src/sys/dev/usb/uhid.c
cvs rdiff -u -r1.168.2.5 -r1.168.2.6 src/sys/dev/usb/usb.c
cvs rdiff -u -r1.37.2.5 -r1.37.2.6 src/sys/dev/wscons/wsevent.c
cvs rdiff -u -r1.101.10.5 -r1.101.10.6 src/sys/fs/puffs/puffs_msgif.c
cvs rdiff -u -r1.209.2.6 -r1.209.2.7 src/sys/kern/kern_proc.c
cvs rdiff -u -r1.23.2.12 -r1.23.2.13 src/sys/kern/sys_module.c
cvs rdiff -u -r1.419.2.13 -r1.419.2.14 src/sys/net/if.c
cvs rdiff -u -r1.179.2.6 -r1.179.2.7 src/sys/net/if_spppsubr.c
cvs rdiff -u -r1.238.2.9 -r1.238.2.10 src/sys/net/rtsock.c
cvs rdiff -u -r1.60.16.3 -r1.60.16.4 src/sys/net80211/ieee80211_ioctl.c
cvs rdiff -u -r1.98.2.6 -r1.98.2.7 src/sys/opencrypto/cryptodev.c
cvs rdiff -u -r1.1.2.3 -r1.1.2.4 src/sys/sys/module_hook.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/amd64/amd64/netbsd32_machdep.c
diff -u src/sys/arch/amd64/amd64/netbsd32_machdep.c:1.115.2.10 src/sys/arch/amd64/amd64/netbsd32_machdep.c:1.115.2.11
--- src/sys/arch/amd64/amd64/netbsd32_machdep.c:1.115.2.10	Sat Sep 29 07:34:12 2018
+++ src/sys/arch/amd64/amd64/netbsd32_machdep.c	Sat Sep 29 21:36:13 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_machdep.c,v 1.115.2.10 2018/09/29 07:34:12 pgoyette Exp $	*/
+/*	$NetBSD: netbsd32_machdep.c,v 1.115.2.11 2018/09/29 21:36:13 pgoyette Exp $	*/
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.115.2.10 2018/09/29 07:34:12 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.115.2.11 2018/09/29 21:36:13 pgoyette Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -276,8 +276,7 @@ netbsd32_sendsig_siginfo(const ksiginfo_
 struct netbsd32_sendsig_hook_t netbsd32_sendsig_hook;
 
 MODULE_CALL_HOOK_DECL(netbsd32_sendsig_hook, f,
-(const ksiginfo_t *ksi, const sigset_t *mask), (ksi, mask),
-netbsd32_sendsig_siginfo(ksi, mask));
+(const ksiginfo_t *ksi, const sigset_t *mask));
 MODULE_CALL_HOOK(netbsd32_sendsig_hook, f,
 (const ksiginfo_t *ksi, const sigset_t *mask), (ksi, mask),
 netbsd32_sendsig_siginfo(ksi, mask));

Index: src/sys/arch/mips/mips/netbsd32_machdep.c
diff -u src/sys/arch/mips/mips/netbsd32_machdep.c:1.15.2.6 src/sys/arch/mips/mips/netbsd32_machdep.c:1.15.2.7
--- src/sys/arch/mips/mips/netbsd32_machdep.c:1.15.2.6	Sat Sep 29 10:22:36 2018
+++ src/sys/arch/mips/mips/netbsd32_machdep.c	Sat Sep 29 21:36:13 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_machdep.c,v 1.15.2.6 2018/09/29 10:22:36 pgoyette Exp $	*/
+/*	$NetBSD: netbsd32_machdep.c,v 1.15.2.7 2018/09/29 21:36:13 pgoyette Exp $	*/
 
 /*-
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.15.2.6 2018/09/29 10:22:36 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.15.2.7 2018/09/29 21:36:13 pgoyet

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

2018-09-29 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Sep 29 20:58:31 UTC 2018

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

Log Message:
If the total size of the DTB exceeds our static storage, attempt to pack
it in place to make it fit.


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

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

Modified files:

Index: src/sys/arch/evbarm/fdt/fdt_machdep.c
diff -u src/sys/arch/evbarm/fdt/fdt_machdep.c:1.40 src/sys/arch/evbarm/fdt/fdt_machdep.c:1.41
--- src/sys/arch/evbarm/fdt/fdt_machdep.c:1.40	Sat Sep 29 15:50:29 2018
+++ src/sys/arch/evbarm/fdt/fdt_machdep.c	Sat Sep 29 20:58:31 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: fdt_machdep.c,v 1.40 2018/09/29 15:50:29 jmcneill Exp $ */
+/* $NetBSD: fdt_machdep.c,v 1.41 2018/09/29 20:58:31 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2015-2017 Jared McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: fdt_machdep.c,v 1.40 2018/09/29 15:50:29 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fdt_machdep.c,v 1.41 2018/09/29 20:58:31 jmcneill Exp $");
 
 #include "opt_machdep.h"
 #include "opt_bootconfig.h"
@@ -377,6 +377,9 @@ initarm(void *arg)
 	/* Load FDT */
 	int error = fdt_check_header(fdt_addr_r);
 	if (error == 0) {
+		/* If the DTB is too big, try to pack it in place first. */
+		if (fdt_totalsize(fdt_addr_r) > sizeof(fdt_data))
+			(void)fdt_pack(__UNCONST(fdt_addr_r));
 		error = fdt_open_into(fdt_addr_r, fdt_data, sizeof(fdt_data));
 		if (error != 0)
 			panic("fdt_move failed: %s", fdt_strerror(error));



CVS commit: src/crypto/external/bsd/openssl/lib/libcrypto/arch/arm

2018-09-29 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Sep 29 19:45:18 UTC 2018

Modified Files:
src/crypto/external/bsd/openssl/lib/libcrypto/arch/arm: aes-armv4.S
aesv8-armx.S arm64cpuid.S armv4-gf2m.S armv4-mont.S armv4cpuid.S
armv8-mont.S bsaes-armv7.S chacha-armv4.S chacha-armv8.S
ecp_nistz256-armv4.S ecp_nistz256-armv8.S ghash-armv4.S
ghashv8-armx.S keccak1600-armv4.S keccak1600-armv8.S
poly1305-armv4.S poly1305-armv8.S sha1-armv4-large.S sha1-armv8.S
sha256-armv4.S sha512-armv4.S sha512-armv8.S vpaes-armv8.S

Log Message:
Regen


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 \
src/crypto/external/bsd/openssl/lib/libcrypto/arch/arm/aes-armv4.S \
src/crypto/external/bsd/openssl/lib/libcrypto/arch/arm/armv4cpuid.S \
src/crypto/external/bsd/openssl/lib/libcrypto/arch/arm/ghashv8-armx.S \
src/crypto/external/bsd/openssl/lib/libcrypto/arch/arm/sha256-armv4.S
cvs rdiff -u -r1.3 -r1.4 \
src/crypto/external/bsd/openssl/lib/libcrypto/arch/arm/aesv8-armx.S \
src/crypto/external/bsd/openssl/lib/libcrypto/arch/arm/armv4-gf2m.S \
src/crypto/external/bsd/openssl/lib/libcrypto/arch/arm/armv4-mont.S \
src/crypto/external/bsd/openssl/lib/libcrypto/arch/arm/bsaes-armv7.S \
src/crypto/external/bsd/openssl/lib/libcrypto/arch/arm/sha1-armv4-large.S \
src/crypto/external/bsd/openssl/lib/libcrypto/arch/arm/sha512-armv4.S
cvs rdiff -u -r1.2 -r1.3 \
src/crypto/external/bsd/openssl/lib/libcrypto/arch/arm/arm64cpuid.S \
src/crypto/external/bsd/openssl/lib/libcrypto/arch/arm/chacha-armv4.S \
src/crypto/external/bsd/openssl/lib/libcrypto/arch/arm/ecp_nistz256-armv4.S 
\
src/crypto/external/bsd/openssl/lib/libcrypto/arch/arm/ecp_nistz256-armv8.S 
\
src/crypto/external/bsd/openssl/lib/libcrypto/arch/arm/poly1305-armv4.S \
src/crypto/external/bsd/openssl/lib/libcrypto/arch/arm/sha512-armv8.S \
src/crypto/external/bsd/openssl/lib/libcrypto/arch/arm/vpaes-armv8.S
cvs rdiff -u -r1.1 -r1.2 \
src/crypto/external/bsd/openssl/lib/libcrypto/arch/arm/armv8-mont.S \
src/crypto/external/bsd/openssl/lib/libcrypto/arch/arm/chacha-armv8.S \
src/crypto/external/bsd/openssl/lib/libcrypto/arch/arm/keccak1600-armv4.S \
src/crypto/external/bsd/openssl/lib/libcrypto/arch/arm/keccak1600-armv8.S \
src/crypto/external/bsd/openssl/lib/libcrypto/arch/arm/poly1305-armv8.S \
src/crypto/external/bsd/openssl/lib/libcrypto/arch/arm/sha1-armv8.S
cvs rdiff -u -r1.5 -r1.6 \
src/crypto/external/bsd/openssl/lib/libcrypto/arch/arm/ghash-armv4.S

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

Modified files:

Index: src/crypto/external/bsd/openssl/lib/libcrypto/arch/arm/aes-armv4.S
diff -u src/crypto/external/bsd/openssl/lib/libcrypto/arch/arm/aes-armv4.S:1.4 src/crypto/external/bsd/openssl/lib/libcrypto/arch/arm/aes-armv4.S:1.5
--- src/crypto/external/bsd/openssl/lib/libcrypto/arch/arm/aes-armv4.S:1.4	Sun Sep 23 13:33:04 2018
+++ src/crypto/external/bsd/openssl/lib/libcrypto/arch/arm/aes-armv4.S	Sat Sep 29 19:45:18 2018
@@ -1,3 +1,4 @@
+#include "arm_asm.h"
 @ Copyright 2007-2018 The OpenSSL Project Authors. All Rights Reserved.
 @
 @ Licensed under the OpenSSL license (the "License").  You may not use
@@ -708,7 +709,7 @@ _armv4_AES_set_encrypt_key:
 	ldmia	sp!,{r4,r5,r6,r7,r8,r9,r10,r11,r12,lr}
 .Labrt:
 #if __ARM_ARCH__>=5
-	bx	lr@ .word	0xe12fff1e
+	RET@ .word	0xe12fff1e
 #else
 	tst	lr,#1
 	moveq	pc,lr			@ be binary compatible with V4, yet
Index: src/crypto/external/bsd/openssl/lib/libcrypto/arch/arm/armv4cpuid.S
diff -u src/crypto/external/bsd/openssl/lib/libcrypto/arch/arm/armv4cpuid.S:1.4 src/crypto/external/bsd/openssl/lib/libcrypto/arch/arm/armv4cpuid.S:1.5
--- src/crypto/external/bsd/openssl/lib/libcrypto/arch/arm/armv4cpuid.S:1.4	Sun Sep 23 13:33:04 2018
+++ src/crypto/external/bsd/openssl/lib/libcrypto/arch/arm/armv4cpuid.S	Sat Sep 29 19:45:18 2018
@@ -1,3 +1,4 @@
+#include "arm_asm.h"
 #include "arm_arch.h"
 
 .text
@@ -20,7 +21,7 @@ OPENSSL_atomic_add:
 	cmp	r2,#0
 	bne	.Ladd
 	mov	r0,r3
-	bx	lr
+	RET
 #else
 	stmdb	sp!,{r4,r5,r6,lr}
 	ldr	r2,.Lspinlock
@@ -42,7 +43,7 @@ OPENSSL_atomic_add:
 	ldmia	sp!,{r4,r5,r6,lr}
 	tst	lr,#1
 	moveq	pc,lr
-.word	0xe12fff1e	@ bx	lr
+.word	0xe12fff1e	@ RET
 #endif
 .size	OPENSSL_atomic_add,.-OPENSSL_atomic_add
 
@@ -77,11 +78,11 @@ OPENSSL_cleanse:
 	bne	.Little
 .Lcleanse_done:
 #if __ARM_ARCH__>=5
-	bx	lr
+	RET
 #else
 	tst	lr,#1
 	moveq	pc,lr
-.word	0xe12fff1e	@ bx	lr
+.word	0xe12fff1e	@ RET
 #endif
 .size	OPENSSL_cleanse,.-OPENSSL_cleanse
 
@@ -107,11 +108,11 @@ CRYPTO_memcmp:
 	rsb	r0,ip,#0
 	mov	r0,r0,lsr#31
 #if __ARM_ARCH__>=5
-	bx	lr
+	RET
 #else
 	tst	lr,#1
 	moveq	pc,lr
-.word	0xe12fff1e	@ bx	lr
+.word	0xe12fff1e	@ RET
 #endif
 .size	CRYPTO_memcmp,.-CRYPTO_memcmp
 
@@ -124,7 +125,7 @@ CRYPTO_memcmp:
 .type	_armv7_neon_probe,%function
 _armv7_

CVS commit: src/crypto/external/bsd/openssl/lib/libcrypto/arch/arm

2018-09-29 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Sep 29 19:44:58 UTC 2018

Modified Files:
src/crypto/external/bsd/openssl/lib/libcrypto/arch/arm: Makefile

Log Message:
Upstream does not support armv4 any more - but it is trivial to add
add regen time. Make the "regen" target here do it.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 \
src/crypto/external/bsd/openssl/lib/libcrypto/arch/arm/Makefile

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

Modified files:

Index: src/crypto/external/bsd/openssl/lib/libcrypto/arch/arm/Makefile
diff -u src/crypto/external/bsd/openssl/lib/libcrypto/arch/arm/Makefile:1.2 src/crypto/external/bsd/openssl/lib/libcrypto/arch/arm/Makefile:1.3
--- src/crypto/external/bsd/openssl/lib/libcrypto/arch/arm/Makefile:1.2	Sun Mar  4 00:24:21 2018
+++ src/crypto/external/bsd/openssl/lib/libcrypto/arch/arm/Makefile	Sat Sep 29 19:44:57 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.2 2018/03/04 00:24:21 christos Exp $
+#	$NetBSD: Makefile,v 1.3 2018/09/29 19:44:57 martin Exp $
 
 .include "bsd.own.mk"
 
@@ -9,8 +9,10 @@ regen:
 	for i in $$(find ${OPENSSLSRC} -name \*arm\*.pl); do \
 		case $$i in \
 		(*/charmap.pl|*/arm-xlate.pl);; \
-		(*) perl -I${OPENSSLSRC}/crypto/perlasm \
+		(*) printf '#include "arm_asm.h"\n' > $$(basename $$i .pl).S; \
+		perl -I${OPENSSLSRC}/crypto/perlasm \
 		-I${OPENSSLSRC}/crypto/bn/asm $$i linux /dev/stdout \
-		> $$(basename $$i .pl).S;; \
+		| sed -E 's/bx[[:space:]]+lr/RET/' \
+		>> $$(basename $$i .pl).S;; \
 		esac; \
 	done



CVS commit: src/external/cddl/dtracetoolkit/dist/Include

2018-09-29 Thread Sevan Janiyan
Module Name:src
Committed By:   sevan
Date:   Sat Sep 29 19:40:58 UTC 2018

Modified Files:
src/external/cddl/dtracetoolkit/dist/Include: test.ksh

Log Message:
Fix comment markers.
https://github.com/opendtrace/toolkit/issues/11


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 \
src/external/cddl/dtracetoolkit/dist/Include/test.ksh

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

Modified files:

Index: src/external/cddl/dtracetoolkit/dist/Include/test.ksh
diff -u src/external/cddl/dtracetoolkit/dist/Include/test.ksh:1.1.1.1 src/external/cddl/dtracetoolkit/dist/Include/test.ksh:1.2
--- src/external/cddl/dtracetoolkit/dist/Include/test.ksh:1.1.1.1	Wed Sep 30 22:01:09 2015
+++ src/external/cddl/dtracetoolkit/dist/Include/test.ksh	Sat Sep 29 19:40:58 2018
@@ -1,27 +1,27 @@
 #!/usr/bin/ksh
-/*
- * test.ksh - DTrace include file test script.
- *
- * $Id: test.ksh,v 1.1.1.1 2015/09/30 22:01:09 christos Exp $
- *
- * COPYRIGHT: Copyright (c) 2007 Brendan Gregg.
- *
- * CDDL HEADER START
- *
- *  The contents of this file are subject to the terms of the
- *  Common Development and Distribution License, Version 1.0 only
- *  (the "License").  You may not use this file except in compliance
- *  with the License.
- *
- *  You can obtain a copy of the license at Docs/cddl1.txt
- *  or http://www.opensolaris.org/os/licensing.
- *  See the License for the specific language governing permissions
- *  and limitations under the License.
- *
- * CDDL HEADER END
- *
- * 16-Sep-2007	Brendan Gregg	Created this.
- */
+#
+# test.ksh - DTrace include file test script.
+#
+# $Id: test.ksh,v 1.2 2018/09/29 19:40:58 sevan Exp $
+#
+# COPYRIGHT: Copyright (c) 2007 Brendan Gregg.
+#
+# CDDL HEADER START
+#
+#  The contents of this file are subject to the terms of the
+#  Common Development and Distribution License, Version 1.0 only
+#  (the "License").  You may not use this file except in compliance
+#  with the License.
+#
+#  You can obtain a copy of the license at Docs/cddl1.txt
+#  or http://www.opensolaris.org/os/licensing.
+#  See the License for the specific language governing permissions
+#  and limitations under the License.
+#
+# CDDL HEADER END
+#
+# 16-Sep-2007	Brendan Gregg	Created this.
+#
 
 dtrace -CI . -s /dev/stdin << END
 



CVS commit: src/doc

2018-09-29 Thread Mindaugas Rasiukevicius
Module Name:src
Committed By:   rmind
Date:   Sat Sep 29 18:48:55 UTC 2018

Modified Files:
src/doc: CHANGES

Log Message:
Mention that NPF was converted to use libnv.


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

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

Modified files:

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.2443 src/doc/CHANGES:1.2444
--- src/doc/CHANGES:1.2443	Sun Sep 23 13:46:53 2018
+++ src/doc/CHANGES	Sat Sep 29 18:48:55 2018
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2443 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2444 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -228,3 +228,4 @@ Changes from NetBSD 8.0 to NetBSD 9.0:
 	kernel: Remove the ISDN code, including daic(4), iavc(4), isic(4),
 		ifpci(4), ifritz, iwic(4), and all the ISDN-related
 		userland tools. [maxv 20180923]
+	npf: Converted to use libnv [rmind 20180929]



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

2018-09-29 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Sep 29 18:27:36 UTC 2018

Modified Files:
src/sys/arch/arm/fdt: gicv3_fdt.c

Log Message:
Stop searching for redistributors in a region after we find a redistributor
with the Last bit set in GICR_TYPER.


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

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

Modified files:

Index: src/sys/arch/arm/fdt/gicv3_fdt.c
diff -u src/sys/arch/arm/fdt/gicv3_fdt.c:1.2 src/sys/arch/arm/fdt/gicv3_fdt.c:1.3
--- src/sys/arch/arm/fdt/gicv3_fdt.c:1.2	Sun Aug 12 21:44:17 2018
+++ src/sys/arch/arm/fdt/gicv3_fdt.c	Sat Sep 29 18:27:36 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: gicv3_fdt.c,v 1.2 2018/08/12 21:44:17 jmcneill Exp $ */
+/* $NetBSD: gicv3_fdt.c,v 1.3 2018/09/29 18:27:36 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2015-2018 Jared McNeill 
@@ -29,7 +29,7 @@
 #define	_INTR_PRIVATE
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: gicv3_fdt.c,v 1.2 2018/08/12 21:44:17 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gicv3_fdt.c,v 1.3 2018/09/29 18:27:36 jmcneill Exp $");
 
 #include 
 #include 
@@ -44,6 +44,7 @@ __KERNEL_RCSID(0, "$NetBSD: gicv3_fdt.c,
 #include 
 
 #include 
+#include 
 
 #define	GICV3_MAXIRQ	1020
 
@@ -163,7 +164,7 @@ gicv3_fdt_map_registers(struct gicv3_fdt
 	bus_size_t size, region_off;
 	bus_addr_t addr;
 	size_t reg_off;
-	int n, r;
+	int n, r, max_redist, redist;
 
 	if (of_getprop_uint32(phandle, "#redistributor-regions", &redistributor_regions))
 		redistributor_regions = 1;
@@ -185,15 +186,15 @@ gicv3_fdt_map_registers(struct gicv3_fdt
 	/*
 	 * GIC Redistributors (GICR)
 	 */
-	for (reg_off = 1, n = 0; n < redistributor_regions; n++, reg_off++) {
+	for (reg_off = 1, max_redist = 0, n = 0; n < redistributor_regions; n++, reg_off++) {
 		if (fdtbus_get_reg(phandle, reg_off, NULL, &size) != 0) {
 			aprint_error_dev(gic->sc_dev, "couldn't get redistributor registers\n");
 			return ENXIO;
 		}
-		gic->sc_bsh_r_count += howmany(size, redistributor_stride);
+		max_redist += howmany(size, redistributor_stride);
 	}
-	gic->sc_bsh_r = kmem_alloc(sizeof(bus_space_handle_t) * gic->sc_bsh_r_count, KM_SLEEP);
-	for (reg_off = 1, n = 0; n < redistributor_regions; n++, reg_off++) {
+	gic->sc_bsh_r = kmem_alloc(sizeof(bus_space_handle_t) * max_redist, KM_SLEEP);
+	for (reg_off = 1, redist = 0, n = 0; n < redistributor_regions; n++, reg_off++) {
 		if (fdtbus_get_reg(phandle, reg_off, &addr, &size) != 0) {
 			aprint_error_dev(gic->sc_dev, "couldn't get redistributor registers\n");
 			return ENXIO;
@@ -204,12 +205,18 @@ gicv3_fdt_map_registers(struct gicv3_fdt
 		}
 		const int count = howmany(size, redistributor_stride);
 		for (r = 0, region_off = 0; r < count; r++, region_off += redistributor_stride) {
-			if (bus_space_subregion(sc->sc_gic.sc_bst, bsh, region_off, redistributor_stride, &gic->sc_bsh_r[r]) != 0) {
+			if (bus_space_subregion(sc->sc_gic.sc_bst, bsh, region_off, redistributor_stride, &gic->sc_bsh_r[redist++]) != 0) {
 aprint_error_dev(gic->sc_dev, "couldn't subregion redistributor registers\n");
 return ENXIO;
 			}
+
+			/* If this is the last redist in this region, skip to the next one */
+			const uint32_t typer = bus_space_read_4(sc->sc_gic.sc_bst, gic->sc_bsh_r[redist - 1], GICR_TYPER);
+			if (typer & GICR_TYPER_Last)
+break;
 		}
 	}
+	gic->sc_bsh_r_count = redist;
 
 	return 0;
 }



CVS commit: src/sys/net/npf

2018-09-29 Thread Mindaugas Rasiukevicius
Module Name:src
Committed By:   rmind
Date:   Sat Sep 29 18:00:36 UTC 2018

Modified Files:
src/sys/net/npf: npf_sendpkt.c

Log Message:
npf_return_tcp: fix no-INET6 case.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/net/npf/npf_sendpkt.c

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

Modified files:

Index: src/sys/net/npf/npf_sendpkt.c
diff -u src/sys/net/npf/npf_sendpkt.c:1.20 src/sys/net/npf/npf_sendpkt.c:1.21
--- src/sys/net/npf/npf_sendpkt.c:1.20	Sat Sep 29 14:41:36 2018
+++ src/sys/net/npf/npf_sendpkt.c	Sat Sep 29 18:00:35 2018
@@ -33,7 +33,7 @@
 
 #ifdef _KERNEL
 #include 
-__KERNEL_RCSID(0, "$NetBSD: npf_sendpkt.c,v 1.20 2018/09/29 14:41:36 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: npf_sendpkt.c,v 1.21 2018/09/29 18:00:35 rmind Exp $");
 
 #include 
 #include 
@@ -56,16 +56,16 @@ __KERNEL_RCSID(0, "$NetBSD: npf_sendpkt.
 #define	DEFAULT_IP_TTL		(ip_defttl)
 
 #if defined(_NPF_STANDALONE)
-#define	m_gethdr(t, f)		npf->mbufops->alloc(0, 0)
-#define	m_freem(m)		npc->npc_ctx->mbufops->free(m)
-#define	mtod(m,t)		((t)((npf)->mbufops->getdata(m)))
+#define	m_gethdr(t, f)		(npf)->mbufops->alloc(0, 0)
+#define	m_freem(m)		(npc)->npc_ctx->mbufops->free(m)
+#define	mtod(m,t)		((t)((npc)->npc_ctx->mbufops->getdata(m)))
 #endif
 
 #if !defined(INET6) || defined(_NPF_STANDALONE)
 #define	in6_cksum(...)		0
 #define	ip6_output(...)		0
 #define	icmp6_error(m, ...)	m_freem(m)
-#define	npf_ip6_setscope(n, i)	0
+#define	npf_ip6_setscope(n, i)	((void)(i), 0)
 #endif
 
 #if defined(INET6)
@@ -190,21 +190,19 @@ npf_return_tcp(npf_cache_t *npc)
 		KASSERT(npf_iscached(npc, NPC_IP6));
 		th->th_sum = in6_cksum(m, IPPROTO_TCP, sizeof(struct ip6_hdr),
 		sizeof(struct tcphdr));
-	}
 
-	/* Handle IPv6 scopes */
-	if (npf_iscached(npc, NPC_IP6) && npf_ip6_setscope(npc, ip6) != 0) {
-		goto bad;
+		/* Handle IPv6 scopes */
+		if (npf_ip6_setscope(npc, ip6) != 0) {
+			goto bad;
+		}
 	}
 
 	/* Pass to IP layer. */
 	if (npf_iscached(npc, NPC_IP4)) {
 		return ip_output(m, NULL, NULL, IP_FORWARDING, NULL, NULL);
 	}
-#if defined(INET6)
 	return ip6_output(m, NULL, NULL, IPV6_FORWARDING, NULL, NULL, NULL);
 bad:
-#endif
 	m_freem(m);
 	return EINVAL;
 }



CVS import: src/external/bsd/ntp/dist

2018-09-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Sep 29 17:29:20 UTC 2018

Update of /cvsroot/src/external/bsd/ntp/dist
In directory ivanova.netbsd.org:/tmp/cvs-serv22010

Log Message:
---
(4.2.8p12) 2018/08/14 Released by Harlan Stenn 

* [Sec 3505] CVE-2018-12327 - Arbitrary Code Execution Vulnerability
  - fixed stack buffer overflow in the openhost() command-line call
of NTPQ/NTPDC 
* [Sec 3012] noepeer tweaks.  
* [Bug 3521] Fix a logic bug in the INVALIDNAK checks.  
* [Bug 3509] Add support for running as non-root on FreeBSD, Darwin,
 other TrustedBSD platforms
  - applied patch by Ian Lepore 
* [Bug 3506] Service Control Manager interacts poorly with NTPD 

  - changed interaction with SCM to signal pending startup
* [Bug 3486] Buffer overflow in ntpq/ntpq.c:tstflags() 
  - applied patch by Gerry Garvey
* [Bug 3485] Undefined sockaddr used in error messages in ntp_config.c 

  - applied patch by Gerry Garvey
* [Bug 3484] ntpq response from ntpd is incorrect when REFID is null 

  - rework of ntpq 'nextvar()' key/value parsing
* [Bug 3482] Fixes for compilation warnings (ntp_io.c & ntpq-subs.c) 

  - applied patch by Gerry Garvey (with mods)
* [Bug 3480] Refclock sample filter not cleared on clock STEP 

  - applied patch by Gerry Garvey
* [Bug 3479] ctl_putrefid() allows unsafe characters through to ntpq 

  - applied patch by Gerry Garvey (with mods)
* [Bug 3476]ctl_putstr() sends empty unquoted string [...] 
  - applied patch by Gerry Garvey (with mods); not sure if that's bug or 
feature, though
* [Bug 3475] modify prettydate() to suppress output of zero time 

  - applied patch by Gerry Garvey
* [Bug 3474] Missing pmode in mode7 peer info response 
  - applied patch by Gerry Garvey
* [Bug 3471] Check for openssl/[ch]mac.h.  HStenn.
  - add #define ENABLE_CMAC support in configure.  HStenn.
* [Bug 3470] ntpd4.2.8p11 fails to compile without OpenSSL 
* [Bug 3469] Incomplete string compare [...] in is_refclk_addr 

  - patch by Stephen Friedl
* [Bug 3467] Potential memory fault in ntpq [...] 
  - fixed IO redirection and CTRL-C handling in ntq and ntpdc
* [Bug 3465] Default TTL values cannot be used 
* [Bug 3461] refclock_shm.c: clear error status on clock recovery 

  - initial patch by Hal Murray; also fixed refclock_report() trouble
* [Bug 3460] Fix typo in ntpq.texi, reported by Kenyon Ralph.  
* [Bug 3456] Use uintptr_t rather than size_t to store an integer in a pointer
  - According to Brooks Davis, there was only one location 
* [Bug 3449] ntpq - display "loop" instead of refid [...] 
  - applied patch by Gerry Garvey
* [Bug 3445] Symmetric peer won't sync on startup 
  - applied patch by Gerry Garvey
* [Bug 3442] Fixes for ntpdate as suggested by Gerry Garvey,
  with modifications
  New macro REFID_ISTEXT() which is also used in ntpd/ntp_control.c.
* [Bug 3434] ntpd clears STA_UNSYNC on start 
  - applied patch by Miroslav Lichvar
* [Bug 3426] ntpdate.html -t default is 2 seconds.  Leonid Evdokimov.
* [Bug 3121] Drop root privileges for the forked DNS worker 
  - integrated patch by  Reinhard Max
* [Bug 2821] minor build issues 
  - applied patches by Christos Zoulas, including real bug fixes
* html/authopt.html: cleanup, from 
* ntpd/ntpd.c: DROPROOT cleanup.  
* Symmetric key range is 1-65535.  Update docs.  
* html/authentic.html: cleanup, from 

Status:

Vendor Tag: UDEL
Release Tags:   ntp-4-2-8p12

U src/external/bsd/ntp/dist/CommitLog
U src/external/bsd/ntp/dist/includes.mf
U src/external/bsd/ntp/dist/INSTALL
U src/external/bsd/ntp/dist/TODO
U src/external/bsd/ntp/dist/configure
U src/external/bsd/ntp/dist/Makefile.am
U src/external/bsd/ntp/dist/depsver.mf
U src/external/bsd/ntp/dist/README.leapsmear
U src/external/bsd/ntp/dist/COPYRIGHT
U src/external/bsd/ntp/dist/bincheck.mf
C src/external/bsd/ntp/dist/configure.ac
U src/external/bsd/ntp/dist/README.versions
U src/external/bsd/ntp/dist/bootstrap
U src/external/bsd/ntp/dist/ChangeLog
U src/external/bsd/ntp/dist/deps-ver
U src/external/bsd/ntp/dist/aclocal.m4
U src/external/bsd/ntp/dist/WHERE-TO-START
U src/external/bsd/ntp/dist/README.hackers
U src/external/bsd/ntp/dist/Makefile.in
U src/external/bsd/ntp/dist/build
U src/external/bsd/ntp/dist/NEWS
U src/external/bsd/ntp/dist/README.patches
U src/external/bsd/ntp/dist/README.bk
U src/external/bsd/ntp/dist/README.pullrequests
U src/external/bsd/ntp/dist/README
U src/external/bsd/ntp/dist/check-libopts.mf
U src/external/bsd/ntp/dist/packageinfo.sh
U src/external/bsd/ntp/dist/dot.emacs
U src/external/bsd/ntp/dist/README.refclocks
U src/external/bsd/ntp/dist/flock-build
U src/external/bsd/ntp/dist/config.h.in
U src/external/bsd/ntp/dist/readme.y2kfixes
U src/external/bsd/ntp/dist/CommitLog-4.1.0
U src/external/bsd/ntp/dist/NOTES.y2kfixes
U src/external/bsd/ntp/dist/results.y2kfixes
U src/external/bsd/ntp/dist/ntpd/invoke-ntp.conf.texi
U src/external/bsd/ntp/dist/ntpd/invoke-ntp.conf.menu
U src/external/bsd/ntp/dist/ntpd/ntpd.man.in
C 

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

2018-09-29 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Sep 29 17:05:55 UTC 2018

Modified Files:
src/sys/arch/evbarm/conf: mk.generic64

Log Message:
Set load offset to +2M to make room for QEMU's bootloader stub


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/evbarm/conf/mk.generic64

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

Modified files:

Index: src/sys/arch/evbarm/conf/mk.generic64
diff -u src/sys/arch/evbarm/conf/mk.generic64:1.2 src/sys/arch/evbarm/conf/mk.generic64:1.3
--- src/sys/arch/evbarm/conf/mk.generic64:1.2	Fri Sep 14 09:06:12 2018
+++ src/sys/arch/evbarm/conf/mk.generic64	Sat Sep 29 17:05:55 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: mk.generic64,v 1.2 2018/09/14 09:06:12 skrll Exp $
+#	$NetBSD: mk.generic64,v 1.3 2018/09/29 17:05:55 jmcneill Exp $
 
 SYSTEM_FIRST_OBJ=	start.o
 SYSTEM_FIRST_SFILE=	${ARM}/aarch64/start.S
@@ -7,7 +7,7 @@ _OSRELEASE!=		${HOST_SH} $S/conf/osrelea
 
 BOARDTYPE=		evbarm64
 
-MKUBOOTIMAGEARGS=	-f arm64
+MKUBOOTIMAGEARGS=	-f arm64 -a 0x20
 MKKNLIMG=		${THISARM}/compile/rpi-mkknlimg.sh
 
 SYSTEM_LD_TAIL_EXTRA+=; \



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

2018-09-29 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Sep 29 16:02:09 UTC 2018

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

Log Message:
Add virtio


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/sys/arch/evbarm/conf/GENERIC64

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

Modified files:

Index: src/sys/arch/evbarm/conf/GENERIC64
diff -u src/sys/arch/evbarm/conf/GENERIC64:1.38 src/sys/arch/evbarm/conf/GENERIC64:1.39
--- src/sys/arch/evbarm/conf/GENERIC64:1.38	Wed Sep 26 20:25:51 2018
+++ src/sys/arch/evbarm/conf/GENERIC64	Sat Sep 29 16:02:09 2018
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: GENERIC64,v 1.38 2018/09/26 20:25:51 jakllsch Exp $
+#	$NetBSD: GENERIC64,v 1.39 2018/09/29 16:02:09 jmcneill Exp $
 #
 #	GENERIC ARM (aarch64) kernel
 #
@@ -361,4 +361,12 @@ usb*		at usbus?
 include "dev/usb/usbdevices.config"
 midi*		at midibus?
 
+# Virtio devices
+virtio*		at fdt?			# Virtio MMIO device
+#viomb*		at virtio?		# Virtio memory balloon device
+ld*		at virtio?		# Virtio disk device
+vioif*		at virtio?		# Virtio network device
+viornd*		at virtio?		# Virtio entropy device
+vioscsi*	at virtio?		# Virtio SCSI device
+
 cinclude "arch/evbarm/conf/GENERIC64.local"



CVS commit: src/sys/dev/fdt

2018-09-29 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Sep 29 15:56:25 UTC 2018

Modified Files:
src/sys/dev/fdt: virtio_mmio_fdt.c

Log Message:
Fix 64-bit build


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/fdt/virtio_mmio_fdt.c

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

Modified files:

Index: src/sys/dev/fdt/virtio_mmio_fdt.c
diff -u src/sys/dev/fdt/virtio_mmio_fdt.c:1.2 src/sys/dev/fdt/virtio_mmio_fdt.c:1.3
--- src/sys/dev/fdt/virtio_mmio_fdt.c:1.2	Fri Jun 15 17:13:43 2018
+++ src/sys/dev/fdt/virtio_mmio_fdt.c	Sat Sep 29 15:56:25 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: virtio_mmio_fdt.c,v 1.2 2018/06/15 17:13:43 jakllsch Exp $ */
+/* $NetBSD: virtio_mmio_fdt.c,v 1.3 2018/09/29 15:56:25 jmcneill Exp $ */
 
 /*
  * Copyright (c) 2018 Jonathan A. Kollasch
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: virtio_mmio_fdt.c,v 1.2 2018/06/15 17:13:43 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: virtio_mmio_fdt.c,v 1.3 2018/09/29 15:56:25 jmcneill Exp $");
 
 #include 
 #include 
@@ -95,7 +95,7 @@ virtio_mmio_fdt_attach(device_t parent, 
 
 	error = bus_space_map(msc->sc_iot, addr, size, 0, &msc->sc_ioh);
 	if (error) {
-		aprint_error_dev(self, "couldn't map %#llx: %d",
+		aprint_error_dev(self, "couldn't map %#" PRIx64 ": %d",
 		(uint64_t)addr, error);
 		return;
 	}



CVS commit: src/lib/libnpf

2018-09-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Sep 29 15:52:44 UTC 2018

Modified Files:
src/lib/libnpf: Makefile

Log Message:
- re-enable lint (otherwise the sets break)
- no space after -I (for consistency)


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/lib/libnpf/Makefile

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

Modified files:

Index: src/lib/libnpf/Makefile
diff -u src/lib/libnpf/Makefile:1.7 src/lib/libnpf/Makefile:1.8
--- src/lib/libnpf/Makefile:1.7	Sat Sep 29 10:41:36 2018
+++ src/lib/libnpf/Makefile	Sat Sep 29 11:52:44 2018
@@ -1,9 +1,7 @@
-# $NetBSD: Makefile,v 1.7 2018/09/29 14:41:36 rmind Exp $
+# $NetBSD: Makefile,v 1.8 2018/09/29 15:52:44 christos Exp $
 
 USE_SHLIBDIR=   yes
 
-NOLINT=		# disabled deliberately
-
 .include 
 
 LIB=		npf
@@ -14,7 +12,7 @@ SRCS=		npf.c
 INCS=		npf.h
 INCSDIR=	/usr/include
 
-CPPFLAGS+=	-I ${NETBSDSRCDIR}/sys/external/bsd/libnv/dist
+CPPFLAGS+=	-I${NETBSDSRCDIR}/sys/external/bsd/libnv/dist
 
 WARNS=		5
 



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

2018-09-29 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Sep 29 15:50:29 UTC 2018

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

Log Message:
Increase storage space for DTB (for QEMU)


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

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

Modified files:

Index: src/sys/arch/evbarm/fdt/fdt_machdep.c
diff -u src/sys/arch/evbarm/fdt/fdt_machdep.c:1.39 src/sys/arch/evbarm/fdt/fdt_machdep.c:1.40
--- src/sys/arch/evbarm/fdt/fdt_machdep.c:1.39	Wed Sep 26 09:06:48 2018
+++ src/sys/arch/evbarm/fdt/fdt_machdep.c	Sat Sep 29 15:50:29 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: fdt_machdep.c,v 1.39 2018/09/26 09:06:48 bouyer Exp $ */
+/* $NetBSD: fdt_machdep.c,v 1.40 2018/09/29 15:50:29 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2015-2017 Jared McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: fdt_machdep.c,v 1.39 2018/09/26 09:06:48 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fdt_machdep.c,v 1.40 2018/09/29 15:50:29 jmcneill Exp $");
 
 #include "opt_machdep.h"
 #include "opt_bootconfig.h"
@@ -112,7 +112,7 @@ static uint64_t initrd_start, initrd_end
 
 #include 
 #include 
-#define FDT_BUF_SIZE	(256*1024)
+#define FDT_BUF_SIZE	(512*1024)
 static uint8_t fdt_data[FDT_BUF_SIZE];
 
 extern char KERNEL_BASE_phys[];



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

2018-09-29 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Sep 29 15:49:38 UTC 2018

Modified Files:
src/sys/arch/arm/virt: virt_platform.h

Log Message:
No need to cover boot ROM with devmap


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/virt/virt_platform.h

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

Modified files:

Index: src/sys/arch/arm/virt/virt_platform.h
diff -u src/sys/arch/arm/virt/virt_platform.h:1.1 src/sys/arch/arm/virt/virt_platform.h:1.2
--- src/sys/arch/arm/virt/virt_platform.h:1.1	Thu Jun 14 10:56:39 2018
+++ src/sys/arch/arm/virt/virt_platform.h	Sat Sep 29 15:49:38 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: virt_platform.h,v 1.1 2018/06/14 10:56:39 jmcneill Exp $ */
+/* $NetBSD: virt_platform.h,v 1.2 2018/09/29 15:49:38 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2018 Jared McNeill 
@@ -32,8 +32,8 @@
 #include 
 
 #define	VIRT_CORE_VBASE		KERNEL_IO_VBASE
-#define	VIRT_CORE_PBASE		0x
-#define	VIRT_CORE_SIZE		0x1000
+#define	VIRT_CORE_PBASE		0x0800
+#define	VIRT_CORE_SIZE		0x0800
 
 #define	VIRT_CORE_PTOV(p)	(((p) - VIRT_CORE_PBASE) + VIRT_CORE_VBASE)
 



CVS commit: src/crypto/external/bsd/openssh/dist

2018-09-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Sep 29 15:10:45 UTC 2018

Modified Files:
src/crypto/external/bsd/openssh/dist: monitor_wrap.c packet.c
serverloop.c

Log Message:
be less aggressive about blocking connections from disconnected sessions.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 \
src/crypto/external/bsd/openssh/dist/monitor_wrap.c \
src/crypto/external/bsd/openssh/dist/serverloop.c
cvs rdiff -u -r1.33 -r1.34 src/crypto/external/bsd/openssh/dist/packet.c

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

Modified files:

Index: src/crypto/external/bsd/openssh/dist/monitor_wrap.c
diff -u src/crypto/external/bsd/openssh/dist/monitor_wrap.c:1.21 src/crypto/external/bsd/openssh/dist/monitor_wrap.c:1.22
--- src/crypto/external/bsd/openssh/dist/monitor_wrap.c:1.21	Sun Aug 26 03:46:36 2018
+++ src/crypto/external/bsd/openssh/dist/monitor_wrap.c	Sat Sep 29 11:10:44 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: monitor_wrap.c,v 1.21 2018/08/26 07:46:36 christos Exp $	*/
+/*	$NetBSD: monitor_wrap.c,v 1.22 2018/09/29 15:10:44 christos Exp $	*/
 /* $OpenBSD: monitor_wrap.c,v 1.107 2018/07/20 03:46:34 djm Exp $ */
 
 /*
@@ -28,7 +28,7 @@
  */
 
 #include "includes.h"
-__RCSID("$NetBSD: monitor_wrap.c,v 1.21 2018/08/26 07:46:36 christos Exp $");
+__RCSID("$NetBSD: monitor_wrap.c,v 1.22 2018/09/29 15:10:44 christos Exp $");
 #include 
 #include 
 #include 
@@ -151,7 +151,7 @@ mm_request_receive(int sock, struct sshb
 
 	if (atomicio(read, sock, buf, sizeof(buf)) != sizeof(buf)) {
 		if (errno == EPIPE)
-			cleanup_exit(254);
+			cleanup_exit(255);
 		fatal("%s: read: %s", __func__, strerror(errno));
 	}
 	msg_len = PEEK_U32(buf);
Index: src/crypto/external/bsd/openssh/dist/serverloop.c
diff -u src/crypto/external/bsd/openssh/dist/serverloop.c:1.21 src/crypto/external/bsd/openssh/dist/serverloop.c:1.22
--- src/crypto/external/bsd/openssh/dist/serverloop.c:1.21	Sun Aug 26 03:46:36 2018
+++ src/crypto/external/bsd/openssh/dist/serverloop.c	Sat Sep 29 11:10:44 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: serverloop.c,v 1.21 2018/08/26 07:46:36 christos Exp $	*/
+/*	$NetBSD: serverloop.c,v 1.22 2018/09/29 15:10:44 christos Exp $	*/
 /* $OpenBSD: serverloop.c,v 1.209 2018/07/27 05:13:02 dtucker Exp $ */
 
 /*
@@ -38,7 +38,7 @@
  */
 
 #include "includes.h"
-__RCSID("$NetBSD: serverloop.c,v 1.21 2018/08/26 07:46:36 christos Exp $");
+__RCSID("$NetBSD: serverloop.c,v 1.22 2018/09/29 15:10:44 christos Exp $");
 
 #include 	/* MIN MAX */
 #include 
@@ -343,7 +343,7 @@ process_input(struct ssh *ssh, fd_set *r
 "%.100s port %d: %.100s",
 ssh_remote_ipaddr(ssh),
 ssh_remote_port(ssh), strerror(errno));
-cleanup_exit(254);
+cleanup_exit(255);
 			}
 		} else {
 			/* Buffer any received data. */
@@ -440,7 +440,7 @@ server_loop2(struct ssh *ssh, Authctxt *
 		if (received_sigterm) {
 			logit("Exiting on signal %d", (int)received_sigterm);
 			/* Clean up sessions, utmp, etc. */
-			cleanup_exit(254);
+			cleanup_exit(255);
 		}
 
 		collect_children(ssh);

Index: src/crypto/external/bsd/openssh/dist/packet.c
diff -u src/crypto/external/bsd/openssh/dist/packet.c:1.33 src/crypto/external/bsd/openssh/dist/packet.c:1.34
--- src/crypto/external/bsd/openssh/dist/packet.c:1.33	Sun Aug 26 03:46:36 2018
+++ src/crypto/external/bsd/openssh/dist/packet.c	Sat Sep 29 11:10:44 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: packet.c,v 1.33 2018/08/26 07:46:36 christos Exp $	*/
+/*	$NetBSD: packet.c,v 1.34 2018/09/29 15:10:44 christos Exp $	*/
 /* $OpenBSD: packet.c,v 1.277 2018/07/16 03:09:13 djm Exp $ */
 
 /*
@@ -40,7 +40,7 @@
  */
 
 #include "includes.h"
-__RCSID("$NetBSD: packet.c,v 1.33 2018/08/26 07:46:36 christos Exp $");
+__RCSID("$NetBSD: packet.c,v 1.34 2018/09/29 15:10:44 christos Exp $");
 
 #include 	/* MIN roundup */
 #include 
@@ -1883,7 +1883,7 @@ ssh_packet_disconnect(struct ssh *ssh, c
 
 	/* Close the connection. */
 	ssh_packet_close(ssh);
-	cleanup_exit(254);
+	cleanup_exit(255);
 }
 
 /*



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

2018-09-29 Thread Cherry G. Mathew
Module Name:src
Committed By:   cherry
Date:   Sat Sep 29 13:19:38 UTC 2018

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

Log Message:
For i386 XEN3PAE_DOM0, use the "native" idt registration
infrastructure by removing the #ifndef XEN clause.

This will hopefully be the last commit to "fix" boot
breakage of XEN3PAE_DOM0

Thanks to bouyer@ to focussed bug reports with

# xl dmesg
and relevant ddb> bt


To generate a diff of this commit:
cvs rdiff -u -r1.307 -r1.308 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.307 src/sys/arch/x86/x86/pmap.c:1.308
--- src/sys/arch/x86/x86/pmap.c:1.307	Wed Aug 29 16:26:25 2018
+++ src/sys/arch/x86/x86/pmap.c	Sat Sep 29 13:19:38 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.307 2018/08/29 16:26:25 maxv Exp $	*/
+/*	$NetBSD: pmap.c,v 1.308 2018/09/29 13:19:38 cherry Exp $	*/
 
 /*
  * Copyright (c) 2008, 2010, 2016, 2017 The NetBSD Foundation, Inc.
@@ -130,7 +130,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.307 2018/08/29 16:26:25 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.308 2018/09/29 13:19:38 cherry Exp $");
 
 #include "opt_user_ldt.h"
 #include "opt_lockdebug.h"
@@ -1225,7 +1225,7 @@ pmap_bootstrap(vaddr_t kva_start)
 #endif
 	ldt_paddr = pmap_bootstrap_palloc(1);
 
-#if !defined(__x86_64__) && !defined(XEN)
+#if !defined(__x86_64__)
 	/* pentium f00f bug stuff */
 	pentium_idt_vaddr = pmap_bootstrap_valloc(1);
 #endif



CVS commit: src/lib/libcurses

2018-09-29 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Sat Sep 29 11:23:18 UTC 2018

Modified Files:
src/lib/libcurses: curses_background.3

Log Message:
Correct function prototypes in curses_background(3)

Fix prototypes for: bkgdset(3), wbkgd(3) and wbkgdset(3).


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/lib/libcurses/curses_background.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/libcurses/curses_background.3
diff -u src/lib/libcurses/curses_background.3:1.6 src/lib/libcurses/curses_background.3:1.7
--- src/lib/libcurses/curses_background.3:1.6	Wed Apr 30 13:10:51 2008
+++ src/lib/libcurses/curses_background.3	Sat Sep 29 11:23:18 2018
@@ -1,4 +1,4 @@
-.\"	$NetBSD: curses_background.3,v 1.6 2008/04/30 13:10:51 martin Exp $
+.\"	$NetBSD: curses_background.3,v 1.7 2018/09/29 11:23:18 kamil Exp $
 .\" Copyright (c) 2002 The NetBSD Foundation, Inc.
 .\" All rights reserved.
 .\"
@@ -25,7 +25,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd January 15, 2006
+.Dd September 29, 2018
 .Dt CURSES_BACKGROUND 3
 .Os
 .Sh NAME
@@ -42,14 +42,14 @@
 .In curses.h
 .Ft int
 .Fn bkgd chtype
-.Ft int
+.Ft void
 .Fn bkgdset chtype
 .Ft chtype
 .Fn getbkgd "WINDOW *"
 .Ft int
-.Fn wbkgd chtype
-.Ft int
-.Fn wbkgdset chtype
+.Fn wbkgd "WINDOW *" chtype
+.Ft void
+.Fn wbkgdset "WINDOW *" chtype
 .Sh DESCRIPTION
 These functions manipulate the background attributes on
 .Dv stdscr



CVS commit: [pgoyette-compat] src/sys/arch/mips/mips

2018-09-29 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Sat Sep 29 10:59:00 UTC 2018

Modified Files:
src/sys/arch/mips/mips [pgoyette-compat]: netbsd32_machdep_13.c

Log Message:
Remove redundant definition of machine_arch32 and machine32


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.2 -r1.1.2.3 src/sys/arch/mips/mips/netbsd32_machdep_13.c

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

Modified files:

Index: src/sys/arch/mips/mips/netbsd32_machdep_13.c
diff -u src/sys/arch/mips/mips/netbsd32_machdep_13.c:1.1.2.2 src/sys/arch/mips/mips/netbsd32_machdep_13.c:1.1.2.3
--- src/sys/arch/mips/mips/netbsd32_machdep_13.c:1.1.2.2	Sat Sep 29 08:07:54 2018
+++ src/sys/arch/mips/mips/netbsd32_machdep_13.c	Sat Sep 29 10:59:00 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_machdep_13.c,v 1.1.2.2 2018/09/29 08:07:54 pgoyette Exp $	*/
+/*	$NetBSD: netbsd32_machdep_13.c,v 1.1.2.3 2018/09/29 10:59:00 pgoyette Exp $	*/
 
 /*-
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep_13.c,v 1.1.2.2 2018/09/29 08:07:54 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep_13.c,v 1.1.2.3 2018/09/29 10:59:00 pgoyette Exp $");
 
 #include "opt_compat_netbsd.h"
 #include "opt_coredump.h"
@@ -66,9 +66,6 @@ __KERNEL_RCSID(0, "$NetBSD: netbsd32_mac
 
 #include 
 
-const char machine32[] = MACHINE;
-const char machine_arch32[] = MACHINE32_ARCH;
-
 #if 0
 cpu_coredump32
 netbsd32_cpu_upcall



CVS commit: src/tests/crypto/libcrypto

2018-09-29 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Sat Sep 29 10:54:35 UTC 2018

Modified Files:
src/tests/crypto/libcrypto: t_pubkey.sh

Log Message:
A timeout of 480 seconds is not enough for the t_pubkey:ec test case
on qemu/sparc.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/tests/crypto/libcrypto/t_pubkey.sh

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

Modified files:

Index: src/tests/crypto/libcrypto/t_pubkey.sh
diff -u src/tests/crypto/libcrypto/t_pubkey.sh:1.4 src/tests/crypto/libcrypto/t_pubkey.sh:1.5
--- src/tests/crypto/libcrypto/t_pubkey.sh:1.4	Thu Oct 13 09:25:37 2016
+++ src/tests/crypto/libcrypto/t_pubkey.sh	Sat Sep 29 10:54:35 2018
@@ -1,4 +1,4 @@
-# $NetBSD: t_pubkey.sh,v 1.4 2016/10/13 09:25:37 martin Exp $
+# $NetBSD: t_pubkey.sh,v 1.5 2018/09/29 10:54:35 gson Exp $
 #
 # Copyright (c) 2008, 2009, 2010 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -60,7 +60,7 @@ atf_test_case ec
 ec_head()
 {
 	atf_set "descr" "Checks EC cipher"
-	atf_set "timeout" "480"
+	atf_set "timeout" "960"
 }
 ec_body()
 {



CVS commit: src/tests/crypto/libcrypto

2018-09-29 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Sat Sep 29 10:50:33 UTC 2018

Modified Files:
src/tests/crypto/libcrypto: t_ciphers.sh

Log Message:
The default timeout of 300 seconds is not enough for the t_ciphers:evp
test case on qemu/sparc since the import of openssl 1.1.0i on 2018-08-18.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/tests/crypto/libcrypto/t_ciphers.sh

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

Modified files:

Index: src/tests/crypto/libcrypto/t_ciphers.sh
diff -u src/tests/crypto/libcrypto/t_ciphers.sh:1.6 src/tests/crypto/libcrypto/t_ciphers.sh:1.7
--- src/tests/crypto/libcrypto/t_ciphers.sh:1.6	Sun Sep 23 13:34:57 2018
+++ src/tests/crypto/libcrypto/t_ciphers.sh	Sat Sep 29 10:50:33 2018
@@ -1,4 +1,4 @@
-# $NetBSD: t_ciphers.sh,v 1.6 2018/09/23 13:34:57 christos Exp $
+# $NetBSD: t_ciphers.sh,v 1.7 2018/09/29 10:50:33 gson Exp $
 #
 # Copyright (c) 2008, 2009, 2010 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -60,6 +60,7 @@ atf_test_case evp
 evp_head()
 {
 	atf_set "descr" "Checks EVP cipher"
+	atf_set "timeout" "600"
 }
 evp_body()
 {



CVS commit: [pgoyette-compat] src/sys/arch/mips/mips

2018-09-29 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Sat Sep 29 10:22:36 UTC 2018

Modified Files:
src/sys/arch/mips/mips [pgoyette-compat]: netbsd32_machdep.c

Log Message:
Make netbsd32_sendsig_sigino() non-static since we need to call it from
the _md_16 code.

While here, use __func__ in a diagnostic message rather than hardcoding
the function name.


To generate a diff of this commit:
cvs rdiff -u -r1.15.2.5 -r1.15.2.6 src/sys/arch/mips/mips/netbsd32_machdep.c

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

Modified files:

Index: src/sys/arch/mips/mips/netbsd32_machdep.c
diff -u src/sys/arch/mips/mips/netbsd32_machdep.c:1.15.2.5 src/sys/arch/mips/mips/netbsd32_machdep.c:1.15.2.6
--- src/sys/arch/mips/mips/netbsd32_machdep.c:1.15.2.5	Sat Sep 29 09:45:51 2018
+++ src/sys/arch/mips/mips/netbsd32_machdep.c	Sat Sep 29 10:22:36 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_machdep.c,v 1.15.2.5 2018/09/29 09:45:51 pgoyette Exp $	*/
+/*	$NetBSD: netbsd32_machdep.c,v 1.15.2.6 2018/09/29 10:22:36 pgoyette Exp $	*/
 
 /*-
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.15.2.5 2018/09/29 09:45:51 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.15.2.6 2018/09/29 10:22:36 pgoyette Exp $");
 
 #include "opt_compat_netbsd.h"
 #include "opt_coredump.h"
@@ -75,7 +75,7 @@ netbsd32_cpu_upcall
 netbsd32_vm_default_addr
 #endif
 
-static int netbsd32_sendsig_siginfo(const ksiginfo_t *, const sigset_t *);
+int netbsd32_sendsig_siginfo(const ksiginfo_t *, const sigset_t *);
 
 struct sigframe_siginfo32 {
 	siginfo32_t sf_si;
@@ -85,7 +85,7 @@ struct sigframe_siginfo32 {
 /*
  * Send a signal to process.
  */
-static int
+int
 netbsd32_sendsig_siginfo(const ksiginfo_t *ksi, const sigset_t *mask)
 {
 	struct lwp * const l = curlwp;
@@ -108,7 +108,7 @@ netbsd32_sendsig_siginfo(const ksiginfo_
 case 0: /* handled by sendsig_sigcontext */
 case 1: /* handled by sendsig_sigcontext */
 default:/* unknown version */
-printf("sendsig_siginfo: bad version %d\n",
+printf("%s: bad version %d\n", __func__,
 ps->sa_sigdesc[sig].sd_vers);
 sigexit(l, SIGILL);
 case 2:



CVS commit: [pgoyette-compat] src/sys/arch/mips/mips

2018-09-29 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Sat Sep 29 10:18:29 UTC 2018

Modified Files:
src/sys/arch/mips/mips [pgoyette-compat]: netbsd32_machdep_16.c

Log Message:
Use proper names for netbsd32_machdep_md_16_{init,fini}() routines


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.7 -r1.1.2.8 src/sys/arch/mips/mips/netbsd32_machdep_16.c

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

Modified files:

Index: src/sys/arch/mips/mips/netbsd32_machdep_16.c
diff -u src/sys/arch/mips/mips/netbsd32_machdep_16.c:1.1.2.7 src/sys/arch/mips/mips/netbsd32_machdep_16.c:1.1.2.8
--- src/sys/arch/mips/mips/netbsd32_machdep_16.c:1.1.2.7	Sat Sep 29 10:11:34 2018
+++ src/sys/arch/mips/mips/netbsd32_machdep_16.c	Sat Sep 29 10:18:29 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_machdep_16.c,v 1.1.2.7 2018/09/29 10:11:34 pgoyette Exp $	*/
+/*	$NetBSD: netbsd32_machdep_16.c,v 1.1.2.8 2018/09/29 10:18:29 pgoyette Exp $	*/
 
 /*-
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep_16.c,v 1.1.2.7 2018/09/29 10:11:34 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep_16.c,v 1.1.2.8 2018/09/29 10:18:29 pgoyette Exp $");
 
 #include "opt_compat_netbsd.h"
 #include "opt_coredump.h"
@@ -101,14 +101,14 @@ MODULE_SET_HOOK(netbsd32_sendsig_hook, "
 MODULE_UNSET_HOOK(netbsd32_sendsig_hook);
 
 void
-netbsd32_machdep_md_init(void)
+netbsd32_machdep_md_16_init(void)
 {   
 
 	netbsd32_sendsig_hook_set();
 }   
 
 void
-netbsd32_machdep_md_fini(void)
+netbsd32_machdep_md_16_fini(void)
 {   
 
 	netbsd32_sendsig_hook_unset();



CVS commit: [pgoyette-compat] src/sys/arch/mips/mips

2018-09-29 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Sat Sep 29 10:11:34 UTC 2018

Modified Files:
src/sys/arch/mips/mips [pgoyette-compat]: netbsd32_machdep_16.c

Log Message:
Add prototype for the default netbsd32_sendsig_siginfo()


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.6 -r1.1.2.7 src/sys/arch/mips/mips/netbsd32_machdep_16.c

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

Modified files:

Index: src/sys/arch/mips/mips/netbsd32_machdep_16.c
diff -u src/sys/arch/mips/mips/netbsd32_machdep_16.c:1.1.2.6 src/sys/arch/mips/mips/netbsd32_machdep_16.c:1.1.2.7
--- src/sys/arch/mips/mips/netbsd32_machdep_16.c:1.1.2.6	Sat Sep 29 10:02:37 2018
+++ src/sys/arch/mips/mips/netbsd32_machdep_16.c	Sat Sep 29 10:11:34 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_machdep_16.c,v 1.1.2.6 2018/09/29 10:02:37 pgoyette Exp $	*/
+/*	$NetBSD: netbsd32_machdep_16.c,v 1.1.2.7 2018/09/29 10:11:34 pgoyette Exp $	*/
 
 /*-
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep_16.c,v 1.1.2.6 2018/09/29 10:02:37 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep_16.c,v 1.1.2.7 2018/09/29 10:11:34 pgoyette Exp $");
 
 #include "opt_compat_netbsd.h"
 #include "opt_coredump.h"
@@ -70,6 +70,7 @@ __KERNEL_RCSID(0, "$NetBSD: netbsd32_mac
 int netbsd32_sendsig_16(const ksiginfo_t *, const sigset_t *);
 
 void sendsig_context(const ksiginfo_t *, const sigset_t *);
+int netbsd32_sendsig_siginfo(const ksiginfo_t *, const sigset_t *);
 
 extern struct netbsd32_sendsig_hook_t netbsd32_sendsig_hook;
 



CVS commit: [pgoyette-compat] src/sys/arch/mips/mips

2018-09-29 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Sat Sep 29 10:02:37 UTC 2018

Modified Files:
src/sys/arch/mips/mips [pgoyette-compat]: netbsd32_machdep_16.c

Log Message:
Here there is no 32-bit specific sendsig_sigcontext() so just use the
native one.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.5 -r1.1.2.6 src/sys/arch/mips/mips/netbsd32_machdep_16.c

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

Modified files:

Index: src/sys/arch/mips/mips/netbsd32_machdep_16.c
diff -u src/sys/arch/mips/mips/netbsd32_machdep_16.c:1.1.2.5 src/sys/arch/mips/mips/netbsd32_machdep_16.c:1.1.2.6
--- src/sys/arch/mips/mips/netbsd32_machdep_16.c:1.1.2.5	Sat Sep 29 09:44:53 2018
+++ src/sys/arch/mips/mips/netbsd32_machdep_16.c	Sat Sep 29 10:02:37 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_machdep_16.c,v 1.1.2.5 2018/09/29 09:44:53 pgoyette Exp $	*/
+/*	$NetBSD: netbsd32_machdep_16.c,v 1.1.2.6 2018/09/29 10:02:37 pgoyette Exp $	*/
 
 /*-
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep_16.c,v 1.1.2.5 2018/09/29 09:44:53 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep_16.c,v 1.1.2.6 2018/09/29 10:02:37 pgoyette Exp $");
 
 #include "opt_compat_netbsd.h"
 #include "opt_coredump.h"
@@ -89,7 +89,7 @@ int
 netbsd32_sendsig_16(const ksiginfo_t *ksi, const sigset_t *mask)
 {   
 	if (curproc->p_sigacts->sa_sigdesc[ksi->ksi_signo].sd_vers < 2)
-		netbsd32_sendsig_sigcontext(ksi, mask);
+		sendsig_sigcontext(ksi, mask);
 	else
 		netbsd32_sendsig_siginfo(ksi, mask);
 



CVS commit: [pgoyette-compat] src/sys/arch/mips/mips

2018-09-29 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Sat Sep 29 09:45:51 UTC 2018

Modified Files:
src/sys/arch/mips/mips [pgoyette-compat]: netbsd32_machdep.c

Log Message:
Put netbsd32_sendsig_siginfo() here, where it belongs.


To generate a diff of this commit:
cvs rdiff -u -r1.15.2.4 -r1.15.2.5 src/sys/arch/mips/mips/netbsd32_machdep.c

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

Modified files:

Index: src/sys/arch/mips/mips/netbsd32_machdep.c
diff -u src/sys/arch/mips/mips/netbsd32_machdep.c:1.15.2.4 src/sys/arch/mips/mips/netbsd32_machdep.c:1.15.2.5
--- src/sys/arch/mips/mips/netbsd32_machdep.c:1.15.2.4	Sat Sep 29 08:38:45 2018
+++ src/sys/arch/mips/mips/netbsd32_machdep.c	Sat Sep 29 09:45:51 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_machdep.c,v 1.15.2.4 2018/09/29 08:38:45 pgoyette Exp $	*/
+/*	$NetBSD: netbsd32_machdep.c,v 1.15.2.5 2018/09/29 09:45:51 pgoyette Exp $	*/
 
 /*-
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.15.2.4 2018/09/29 08:38:45 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.15.2.5 2018/09/29 09:45:51 pgoyette Exp $");
 
 #include "opt_compat_netbsd.h"
 #include "opt_coredump.h"
@@ -75,6 +75,92 @@ netbsd32_cpu_upcall
 netbsd32_vm_default_addr
 #endif
 
+static int netbsd32_sendsig_siginfo(const ksiginfo_t *, const sigset_t *);
+
+struct sigframe_siginfo32 {
+	siginfo32_t sf_si;
+	ucontext32_t sf_uc;
+};
+
+/*
+ * Send a signal to process.
+ */
+static int
+netbsd32_sendsig_siginfo(const ksiginfo_t *ksi, const sigset_t *mask)
+{
+	struct lwp * const l = curlwp;
+	struct proc * const p = l->l_proc;
+	struct sigacts * const ps = p->p_sigacts;
+	int onstack, error;
+	int sig = ksi->ksi_signo;
+	struct sigframe_siginfo32 *sfp = getframe(l, sig, &onstack);
+	struct sigframe_siginfo32 sf;
+	struct trapframe * const tf = l->l_md.md_utf;
+	size_t sfsz;
+	sig_t catcher = SIGACTION(p, sig).sa_handler;
+
+	sfp--;
+
+	netbsd32_si_to_si32(&sf.sf_si, (const siginfo_t *)&ksi->ksi_info);
+
+/* Build stack frame for signal trampoline. */
+switch (ps->sa_sigdesc[sig].sd_vers) {
+case 0: /* handled by sendsig_sigcontext */
+case 1: /* handled by sendsig_sigcontext */
+default:/* unknown version */
+printf("sendsig_siginfo: bad version %d\n",
+ps->sa_sigdesc[sig].sd_vers);
+sigexit(l, SIGILL);
+case 2:
+break;
+}
+
+	sf.sf_uc.uc_flags = _UC_SIGMASK
+	| ((l->l_sigstk.ss_flags & SS_ONSTACK)
+	? _UC_SETSTACK : _UC_CLRSTACK);
+	sf.sf_uc.uc_sigmask = *mask;
+	sf.sf_uc.uc_link = (intptr_t)l->l_ctxlink;
+	memset(&sf.sf_uc.uc_stack, 0, sizeof(sf.sf_uc.uc_stack));
+	sfsz = offsetof(struct sigframe_siginfo32, sf_uc.uc_mcontext);
+	if (p->p_md.md_abi == _MIPS_BSD_API_O32)
+		sfsz += sizeof(mcontext_o32_t);
+	else
+		sfsz += sizeof(mcontext32_t);
+	sendsig_reset(l, sig);
+	mutex_exit(p->p_lock);
+	cpu_getmcontext32(l, &sf.sf_uc.uc_mcontext, &sf.sf_uc.uc_flags);
+	error = copyout(&sf, sfp, sfsz);
+	mutex_enter(p->p_lock);
+	if (error != 0) {
+		/*
+		 * Process has trashed its stack; give it an illegal
+		 * instruction to halt it in its tracks.
+		 */
+		sigexit(l, SIGILL);
+		/* NOTREACHED */
+	}
+
+	/*
+	 * Set up the registers to directly invoke the signal
+	 * handler.  The return address will be set up to point
+	 * to the signal trampoline to bounce us back.
+	 */
+	tf->tf_regs[_R_A0] = sig;
+	tf->tf_regs[_R_A1] = (intptr_t)&sfp->sf_si;
+	tf->tf_regs[_R_A2] = (intptr_t)&sfp->sf_uc;
+
+	tf->tf_regs[_R_PC] = (intptr_t)catcher;
+	tf->tf_regs[_R_T9] = (intptr_t)catcher;
+	tf->tf_regs[_R_SP] = (intptr_t)sfp;
+	tf->tf_regs[_R_RA] = (intptr_t)ps->sa_sigdesc[sig].sd_tramp;
+
+	/* Remember that we're now on the signal stack. */
+	if (onstack)
+		l->l_sigstk.ss_flags |= SS_ONSTACK;
+
+	return 0;
+}
+
 int
 netbsd32_sysarch(struct lwp *l, const struct netbsd32_sysarch_args *uap,
 	register_t *retval)
@@ -124,12 +210,6 @@ netbsd32_vm_default_addr(struct proc *p,
 		return VM_DEFAULT_ADDRESS32_BOTTOMUP(base, size);
 }
 
-
-struct sigframe_siginfo32 {
-	siginfo32_t sf_si;
-	ucontext32_t sf_uc;
-};
-
 void
 cpu_getmcontext32(struct lwp *l, mcontext32_t *mc32, unsigned int *flagsp)
 {



CVS commit: [pgoyette-compat] src/sys/arch/mips/mips

2018-09-29 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Sat Sep 29 09:44:53 UTC 2018

Modified Files:
src/sys/arch/mips/mips [pgoyette-compat]: netbsd32_machdep_16.c

Log Message:
Remove netbsd32_sendsig_sigcontext() - it belongs in netbsd32_machdep.c


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.4 -r1.1.2.5 src/sys/arch/mips/mips/netbsd32_machdep_16.c

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

Modified files:

Index: src/sys/arch/mips/mips/netbsd32_machdep_16.c
diff -u src/sys/arch/mips/mips/netbsd32_machdep_16.c:1.1.2.4 src/sys/arch/mips/mips/netbsd32_machdep_16.c:1.1.2.5
--- src/sys/arch/mips/mips/netbsd32_machdep_16.c:1.1.2.4	Sat Sep 29 07:47:46 2018
+++ src/sys/arch/mips/mips/netbsd32_machdep_16.c	Sat Sep 29 09:44:53 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_machdep_16.c,v 1.1.2.4 2018/09/29 07:47:46 pgoyette Exp $	*/
+/*	$NetBSD: netbsd32_machdep_16.c,v 1.1.2.5 2018/09/29 09:44:53 pgoyette Exp $	*/
 
 /*-
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep_16.c,v 1.1.2.4 2018/09/29 07:47:46 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep_16.c,v 1.1.2.5 2018/09/29 09:44:53 pgoyette Exp $");
 
 #include "opt_compat_netbsd.h"
 #include "opt_coredump.h"
@@ -67,10 +67,10 @@ __KERNEL_RCSID(0, "$NetBSD: netbsd32_mac
 
 #include 
 
-void netbsd32_sendsig_siginfo(const ksiginfo_t *, const sigset_t *);
-
 int netbsd32_sendsig_16(const ksiginfo_t *, const sigset_t *);
 
+void sendsig_context(const ksiginfo_t *, const sigset_t *);
+
 extern struct netbsd32_sendsig_hook_t netbsd32_sendsig_hook;
 
 int
@@ -85,89 +85,6 @@ compat_16_netbsd32___sigreturn14(struct 
 	return compat_16_sys___sigreturn14(l, &ua, retval);
 }
 
-struct sigframe_siginfo32 {
-	siginfo32_t sf_si;
-	ucontext32_t sf_uc;
-};
-
-/*
- * Send a signal to process.
- */
-static void
-netbsd32_sendsig_sigcontext(const ksiginfo_t *ksi, const sigset_t *mask)
-{
-	struct lwp * const l = curlwp;
-	struct proc * const p = l->l_proc;
-	struct sigacts * const ps = p->p_sigacts;
-	int onstack, error;
-	int sig = ksi->ksi_signo;
-	struct sigframe_siginfo32 *sfp = getframe(l, sig, &onstack);
-	struct sigframe_siginfo32 sf;
-	struct trapframe * const tf = l->l_md.md_utf;
-	size_t sfsz;
-	sig_t catcher = SIGACTION(p, sig).sa_handler;
-
-	sfp--;
-
-	netbsd32_si_to_si32(&sf.sf_si, (const siginfo_t *)&ksi->ksi_info);
-
-/* Build stack frame for signal trampoline. */
-switch (ps->sa_sigdesc[sig].sd_vers) {
-case 0: /* handled by sendsig_sigcontext */
-case 1: /* handled by sendsig_sigcontext */
-default:/* unknown version */
-printf("%s: bad version %d\n", __func__,
-ps->sa_sigdesc[sig].sd_vers);
-sigexit(l, SIGILL);
-case 2:
-break;
-}
-
-	sf.sf_uc.uc_flags = _UC_SIGMASK
-	| ((l->l_sigstk.ss_flags & SS_ONSTACK)
-	? _UC_SETSTACK : _UC_CLRSTACK);
-	sf.sf_uc.uc_sigmask = *mask;
-	sf.sf_uc.uc_link = (intptr_t)l->l_ctxlink;
-	memset(&sf.sf_uc.uc_stack, 0, sizeof(sf.sf_uc.uc_stack));
-	sfsz = offsetof(struct sigframe_siginfo32, sf_uc.uc_mcontext);
-	if (p->p_md.md_abi == _MIPS_BSD_API_O32)
-		sfsz += sizeof(mcontext_o32_t);
-	else
-		sfsz += sizeof(mcontext32_t);
-	sendsig_reset(l, sig);
-	mutex_exit(p->p_lock);
-	cpu_getmcontext32(l, &sf.sf_uc.uc_mcontext, &sf.sf_uc.uc_flags);
-	error = copyout(&sf, sfp, sfsz);
-	mutex_enter(p->p_lock);
-
-	if (error != 0) {
-		/*
-		 * Process has trashed its stack; give it an illegal
-		 * instruction to halt it in its tracks.
-		 */
-		sigexit(l, SIGILL);
-		/* NOTREACHED */
-	}
-
-	/*
-	 * Set up the registers to directly invoke the signal
-	 * handler.  The return address will be set up to point
-	 * to the signal trampoline to bounce us back.
-	 */
-	tf->tf_regs[_R_A0] = sig;
-	tf->tf_regs[_R_A1] = (intptr_t)&sfp->sf_si;
-	tf->tf_regs[_R_A2] = (intptr_t)&sfp->sf_uc;
-
-	tf->tf_regs[_R_PC] = (intptr_t)catcher;
-	tf->tf_regs[_R_T9] = (intptr_t)catcher;
-	tf->tf_regs[_R_SP] = (intptr_t)sfp;
-	tf->tf_regs[_R_RA] = (intptr_t)ps->sa_sigdesc[sig].sd_tramp;
-
-	/* Remember that we're now on the signal stack. */
-	if (onstack)
-		l->l_sigstk.ss_flags |= SS_ONSTACK;
-}
-
 int
 netbsd32_sendsig_16(const ksiginfo_t *ksi, const sigset_t *mask)
 {   



CVS commit: [pgoyette-compat] src/sys/arch/mips/mips

2018-09-29 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Sat Sep 29 08:38:45 UTC 2018

Modified Files:
src/sys/arch/mips/mips [pgoyette-compat]: netbsd32_machdep.c

Log Message:
Define the netbsd32_sendsig_hook and create its accessor function.


To generate a diff of this commit:
cvs rdiff -u -r1.15.2.3 -r1.15.2.4 src/sys/arch/mips/mips/netbsd32_machdep.c

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

Modified files:

Index: src/sys/arch/mips/mips/netbsd32_machdep.c
diff -u src/sys/arch/mips/mips/netbsd32_machdep.c:1.15.2.3 src/sys/arch/mips/mips/netbsd32_machdep.c:1.15.2.4
--- src/sys/arch/mips/mips/netbsd32_machdep.c:1.15.2.3	Sat Sep 29 08:25:36 2018
+++ src/sys/arch/mips/mips/netbsd32_machdep.c	Sat Sep 29 08:38:45 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_machdep.c,v 1.15.2.3 2018/09/29 08:25:36 pgoyette Exp $	*/
+/*	$NetBSD: netbsd32_machdep.c,v 1.15.2.4 2018/09/29 08:38:45 pgoyette Exp $	*/
 
 /*-
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.15.2.3 2018/09/29 08:25:36 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.15.2.4 2018/09/29 08:38:45 pgoyette Exp $");
 
 #include "opt_compat_netbsd.h"
 #include "opt_coredump.h"
@@ -227,6 +227,15 @@ cpu_coredump32(struct lwp *l, struct cor
 }
 #endif
 
+struct netbsd32_sendsig_hook_t netbsd32_sendsig_hook;
+ 
+MODULE_CALL_HOOK_DECL(netbsd32_sendsig_hook, f,
+(const ksiginfo_t *ksi, const sigset_t *mask), (ksi, mask),
+netbsd32_sendsig_siginfo(ksi, mask));
+MODULE_CALL_HOOK(netbsd32_sendsig_hook, f,
+(const ksiginfo_t *ksi, const sigset_t *mask), (ksi, mask),  
+netbsd32_sendsig_siginfo(ksi, mask));
+
 void
 netbsd32_sendsig(const ksiginfo_t *ksi, const sigset_t *mask)
 {



CVS commit: [pgoyette-compat] src/sys/arch/mips/mips

2018-09-29 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Sat Sep 29 08:25:36 UTC 2018

Modified Files:
src/sys/arch/mips/mips [pgoyette-compat]: netbsd32_machdep.c

Log Message:
Add a routine to actually invoke the hook for netbsd32_sendsig()


To generate a diff of this commit:
cvs rdiff -u -r1.15.2.2 -r1.15.2.3 src/sys/arch/mips/mips/netbsd32_machdep.c

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

Modified files:

Index: src/sys/arch/mips/mips/netbsd32_machdep.c
diff -u src/sys/arch/mips/mips/netbsd32_machdep.c:1.15.2.2 src/sys/arch/mips/mips/netbsd32_machdep.c:1.15.2.3
--- src/sys/arch/mips/mips/netbsd32_machdep.c:1.15.2.2	Sat Sep 29 08:07:54 2018
+++ src/sys/arch/mips/mips/netbsd32_machdep.c	Sat Sep 29 08:25:36 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_machdep.c,v 1.15.2.2 2018/09/29 08:07:54 pgoyette Exp $	*/
+/*	$NetBSD: netbsd32_machdep.c,v 1.15.2.3 2018/09/29 08:25:36 pgoyette Exp $	*/
 
 /*-
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.15.2.2 2018/09/29 08:07:54 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.15.2.3 2018/09/29 08:25:36 pgoyette Exp $");
 
 #include "opt_compat_netbsd.h"
 #include "opt_coredump.h"
@@ -227,6 +227,13 @@ cpu_coredump32(struct lwp *l, struct cor
 }
 #endif
 
+void
+netbsd32_sendsig(const ksiginfo_t *ksi, const sigset_t *mask)
+{
+
+	netbsd32_sendsig_hook_f_call(ksi, mask);
+}
+
 void
 netbsd32_machdep_md_init(void)
 {   



CVS commit: [pgoyette-compat] src/sys/arch/mips/mips

2018-09-29 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Sat Sep 29 08:07:54 UTC 2018

Modified Files:
src/sys/arch/mips/mips [pgoyette-compat]: netbsd32_machdep.c
netbsd32_machdep_13.c

Log Message:
Keep only one copy of the netbsd32_compat_16 code.

Remove unnecessary #ifdef COMPAT_13 since the source file will only be
processed if COMPAT_13 is already defined.


To generate a diff of this commit:
cvs rdiff -u -r1.15.2.1 -r1.15.2.2 src/sys/arch/mips/mips/netbsd32_machdep.c
cvs rdiff -u -r1.1.2.1 -r1.1.2.2 src/sys/arch/mips/mips/netbsd32_machdep_13.c

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

Modified files:

Index: src/sys/arch/mips/mips/netbsd32_machdep.c
diff -u src/sys/arch/mips/mips/netbsd32_machdep.c:1.15.2.1 src/sys/arch/mips/mips/netbsd32_machdep.c:1.15.2.2
--- src/sys/arch/mips/mips/netbsd32_machdep.c:1.15.2.1	Sat Sep 29 06:31:02 2018
+++ src/sys/arch/mips/mips/netbsd32_machdep.c	Sat Sep 29 08:07:54 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_machdep.c,v 1.15.2.1 2018/09/29 06:31:02 pgoyette Exp $	*/
+/*	$NetBSD: netbsd32_machdep.c,v 1.15.2.2 2018/09/29 08:07:54 pgoyette Exp $	*/
 
 /*-
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.15.2.1 2018/09/29 06:31:02 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.15.2.2 2018/09/29 08:07:54 pgoyette Exp $");
 
 #include "opt_compat_netbsd.h"
 #include "opt_coredump.h"
@@ -114,34 +114,6 @@ netbsd32_sysarch(struct lwp *l, const st
 	return (error);
 }
 
-#ifdef COMPAT_13
-int
-compat_13_netbsd32_sigreturn(struct lwp *l,
-	const struct compat_13_netbsd32_sigreturn_args *uap,
-	register_t *retval)
-{
-	struct compat_13_sys_sigreturn_args ua;
-
-	NETBSD32TOP_UAP(sigcntxp, struct sigcontext13 *);
-
-	return compat_13_sys_sigreturn(l, &ua, retval);
-}
-#endif
-
-#ifdef COMPAT_16
-int
-compat_16_netbsd32___sigreturn14(struct lwp *l,
-	const struct compat_16_netbsd32___sigreturn14_args *uap,
-	register_t *retval)
-{
-	struct compat_16_sys___sigreturn14_args ua;
-
-	NETBSD32TOP_UAP(sigcntxp, struct sigcontext *);
-
-	return compat_16_sys___sigreturn14(l, &ua, retval);
-}
-#endif
-
 vaddr_t
 netbsd32_vm_default_addr(struct proc *p, vaddr_t base, vsize_t size,
 int topdown)
@@ -158,95 +130,6 @@ struct sigframe_siginfo32 {
 	ucontext32_t sf_uc;
 };
 
-/*
- * Send a signal to process.
- */
-static void
-netbsd32_sendsig_siginfo(const ksiginfo_t *ksi, const sigset_t *mask)
-{
-	struct lwp * const l = curlwp;
-	struct proc * const p = l->l_proc;
-	struct sigacts * const ps = p->p_sigacts;
-	int onstack, error;
-	int sig = ksi->ksi_signo;
-	struct sigframe_siginfo32 *sfp = getframe(l, sig, &onstack);
-	struct sigframe_siginfo32 sf;
-	struct trapframe * const tf = l->l_md.md_utf;
-	size_t sfsz;
-	sig_t catcher = SIGACTION(p, sig).sa_handler;
-
-	sfp--;
-
-	netbsd32_si_to_si32(&sf.sf_si, (const siginfo_t *)&ksi->ksi_info);
-
-/* Build stack frame for signal trampoline. */
-switch (ps->sa_sigdesc[sig].sd_vers) {
-case 0: /* handled by sendsig_sigcontext */
-case 1: /* handled by sendsig_sigcontext */
-default:/* unknown version */
-printf("sendsig_siginfo: bad version %d\n",
-ps->sa_sigdesc[sig].sd_vers);
-sigexit(l, SIGILL);
-case 2:
-break;
-}
-
-	sf.sf_uc.uc_flags = _UC_SIGMASK
-	| ((l->l_sigstk.ss_flags & SS_ONSTACK)
-	? _UC_SETSTACK : _UC_CLRSTACK);
-	sf.sf_uc.uc_sigmask = *mask;
-	sf.sf_uc.uc_link = (intptr_t)l->l_ctxlink;
-	memset(&sf.sf_uc.uc_stack, 0, sizeof(sf.sf_uc.uc_stack));
-	sfsz = offsetof(struct sigframe_siginfo32, sf_uc.uc_mcontext);
-	if (p->p_md.md_abi == _MIPS_BSD_API_O32)
-		sfsz += sizeof(mcontext_o32_t);
-	else
-		sfsz += sizeof(mcontext32_t);
-	sendsig_reset(l, sig);
-	mutex_exit(p->p_lock);
-	cpu_getmcontext32(l, &sf.sf_uc.uc_mcontext, &sf.sf_uc.uc_flags);
-	error = copyout(&sf, sfp, sfsz);
-	mutex_enter(p->p_lock);
-
-	if (error != 0) {
-		/*
-		 * Process has trashed its stack; give it an illegal
-		 * instruction to halt it in its tracks.
-		 */
-		sigexit(l, SIGILL);
-		/* NOTREACHED */
-	}
-
-	/*
-	 * Set up the registers to directly invoke the signal
-	 * handler.  The return address will be set up to point
-	 * to the signal trampoline to bounce us back.
-	 */
-	tf->tf_regs[_R_A0] = sig;
-	tf->tf_regs[_R_A1] = (intptr_t)&sfp->sf_si;
-	tf->tf_regs[_R_A2] = (intptr_t)&sfp->sf_uc;
-
-	tf->tf_regs[_R_PC] = (intptr_t)catcher;
-	tf->tf_regs[_R_T9] = (intptr_t)catcher;
-	tf->tf_regs[_R_SP] = (intptr_t)sfp;
-	tf->tf_regs[_R_RA] = (intptr_t)ps->sa_sigdesc[sig].sd_tramp;
-
-	/* Remember that we're now on the signal stack. */
-	if (onstack)
-		l->l_sigstk.ss_flags |= SS_ONSTACK;
-}
-
-void
-netbsd32_sendsig(const ksiginfo_t *ksi, const sigset_t *mask)
-{   
-#ifdef COMPAT_16  

CVS commit: [pgoyette-compat] src/sys/compat/netbsd32

2018-09-29 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Sat Sep 29 07:52:39 UTC 2018

Modified Files:
src/sys/compat/netbsd32 [pgoyette-compat]: netbsd32_compat_13.c

Log Message:
Make sure that the netbsd32_compat_16 code is available to compat_netbsd_13


To generate a diff of this commit:
cvs rdiff -u -r1.26.28.7 -r1.26.28.8 \
src/sys/compat/netbsd32/netbsd32_compat_13.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/netbsd32/netbsd32_compat_13.c
diff -u src/sys/compat/netbsd32/netbsd32_compat_13.c:1.26.28.7 src/sys/compat/netbsd32/netbsd32_compat_13.c:1.26.28.8
--- src/sys/compat/netbsd32/netbsd32_compat_13.c:1.26.28.7	Thu Sep 27 03:53:30 2018
+++ src/sys/compat/netbsd32/netbsd32_compat_13.c	Sat Sep 29 07:52:39 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_compat_13.c,v 1.26.28.7 2018/09/27 03:53:30 pgoyette Exp $	*/
+/*	$NetBSD: netbsd32_compat_13.c,v 1.26.28.8 2018/09/29 07:52:39 pgoyette Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Matthew R. Green
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_13.c,v 1.26.28.7 2018/09/27 03:53:30 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_13.c,v 1.26.28.8 2018/09/29 07:52:39 pgoyette Exp $");
 
 #include 
 #include 
@@ -104,7 +104,8 @@ static struct syscall_package compat_net
 	{ 0, 0, NULL }
 }; 
 
-MODULE(MODULE_CLASS_EXEC, compat_netbsd32_13, "compat_netbsd32,compat_13");
+MODULE(MODULE_CLASS_EXEC, compat_netbsd32_13,
+"compat_netbsd32,compat_13,compat_netbsd32_16");
 
 static int
 compat_netbsd32_13_modcmd(modcmd_t cmd, void *arg)



CVS commit: [pgoyette-compat] src/sys/arch/mips/mips

2018-09-29 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Sat Sep 29 07:47:46 UTC 2018

Modified Files:
src/sys/arch/mips/mips [pgoyette-compat]: netbsd32_machdep_16.c

Log Message:
Don't fall off the end of a non-void function.  (It used to be void,
but now returns an int to conform with requirements of the MP-safe
module_hook stuff.)


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.3 -r1.1.2.4 src/sys/arch/mips/mips/netbsd32_machdep_16.c

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

Modified files:

Index: src/sys/arch/mips/mips/netbsd32_machdep_16.c
diff -u src/sys/arch/mips/mips/netbsd32_machdep_16.c:1.1.2.3 src/sys/arch/mips/mips/netbsd32_machdep_16.c:1.1.2.4
--- src/sys/arch/mips/mips/netbsd32_machdep_16.c:1.1.2.3	Sat Sep 29 07:36:44 2018
+++ src/sys/arch/mips/mips/netbsd32_machdep_16.c	Sat Sep 29 07:47:46 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_machdep_16.c,v 1.1.2.3 2018/09/29 07:36:44 pgoyette Exp $	*/
+/*	$NetBSD: netbsd32_machdep_16.c,v 1.1.2.4 2018/09/29 07:47:46 pgoyette Exp $	*/
 
 /*-
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep_16.c,v 1.1.2.3 2018/09/29 07:36:44 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep_16.c,v 1.1.2.4 2018/09/29 07:47:46 pgoyette Exp $");
 
 #include "opt_compat_netbsd.h"
 #include "opt_coredump.h"
@@ -175,6 +175,8 @@ netbsd32_sendsig_16(const ksiginfo_t *ks
 		netbsd32_sendsig_sigcontext(ksi, mask);
 	else
 		netbsd32_sendsig_siginfo(ksi, mask);
+
+	return 0;
 }   
 
 MODULE_SET_HOOK(netbsd32_sendsig_hook, "nb32_16", netbsd32_sendsig_16); 



CVS commit: [pgoyette-compat] src/sys/arch/mips/mips

2018-09-29 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Sat Sep 29 07:36:44 UTC 2018

Modified Files:
src/sys/arch/mips/mips [pgoyette-compat]: netbsd32_machdep_16.c

Log Message:
Remove unnecesasry #ifdef COMPAT_16 (this file won't get selected unless
COMPAT_16 is defined).

Rename some functions for consistency with other architectures' machdep
code.

Provide some prototypes/declarations.

Use __func__ in a diagnostic message rather than hardcoding it in the
message string.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.2 -r1.1.2.3 src/sys/arch/mips/mips/netbsd32_machdep_16.c

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

Modified files:

Index: src/sys/arch/mips/mips/netbsd32_machdep_16.c
diff -u src/sys/arch/mips/mips/netbsd32_machdep_16.c:1.1.2.2 src/sys/arch/mips/mips/netbsd32_machdep_16.c:1.1.2.3
--- src/sys/arch/mips/mips/netbsd32_machdep_16.c:1.1.2.2	Sat Sep 29 06:55:33 2018
+++ src/sys/arch/mips/mips/netbsd32_machdep_16.c	Sat Sep 29 07:36:44 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_machdep_16.c,v 1.1.2.2 2018/09/29 06:55:33 pgoyette Exp $	*/
+/*	$NetBSD: netbsd32_machdep_16.c,v 1.1.2.3 2018/09/29 07:36:44 pgoyette Exp $	*/
 
 /*-
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep_16.c,v 1.1.2.2 2018/09/29 06:55:33 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep_16.c,v 1.1.2.3 2018/09/29 07:36:44 pgoyette Exp $");
 
 #include "opt_compat_netbsd.h"
 #include "opt_coredump.h"
@@ -69,7 +69,10 @@ __KERNEL_RCSID(0, "$NetBSD: netbsd32_mac
 
 void netbsd32_sendsig_siginfo(const ksiginfo_t *, const sigset_t *);
 
-#ifdef COMPAT_16
+int netbsd32_sendsig_16(const ksiginfo_t *, const sigset_t *);
+
+extern struct netbsd32_sendsig_hook_t netbsd32_sendsig_hook;
+
 int
 compat_16_netbsd32___sigreturn14(struct lwp *l,
 	const struct compat_16_netbsd32___sigreturn14_args *uap,
@@ -81,7 +84,6 @@ compat_16_netbsd32___sigreturn14(struct 
 
 	return compat_16_sys___sigreturn14(l, &ua, retval);
 }
-#endif
 
 struct sigframe_siginfo32 {
 	siginfo32_t sf_si;
@@ -92,7 +94,7 @@ struct sigframe_siginfo32 {
  * Send a signal to process.
  */
 static void
-netbsd32_sendsig_siginfo(const ksiginfo_t *ksi, const sigset_t *mask)
+netbsd32_sendsig_sigcontext(const ksiginfo_t *ksi, const sigset_t *mask)
 {
 	struct lwp * const l = curlwp;
 	struct proc * const p = l->l_proc;
@@ -114,7 +116,7 @@ netbsd32_sendsig_siginfo(const ksiginfo_
 case 0: /* handled by sendsig_sigcontext */
 case 1: /* handled by sendsig_sigcontext */
 default:/* unknown version */
-printf("sendsig_siginfo: bad version %d\n",
+printf("%s: bad version %d\n", __func__,
 ps->sa_sigdesc[sig].sd_vers);
 sigexit(l, SIGILL);
 case 2:
@@ -166,14 +168,12 @@ netbsd32_sendsig_siginfo(const ksiginfo_
 		l->l_sigstk.ss_flags |= SS_ONSTACK;
 }
 
-void
+int
 netbsd32_sendsig_16(const ksiginfo_t *ksi, const sigset_t *mask)
 {   
-#ifdef COMPAT_16
 	if (curproc->p_sigacts->sa_sigdesc[ksi->ksi_signo].sd_vers < 2)
 		netbsd32_sendsig_sigcontext(ksi, mask);
 	else
-#endif  
 		netbsd32_sendsig_siginfo(ksi, mask);
 }   
 



CVS commit: [pgoyette-compat] src/sys/arch/amd64/amd64

2018-09-29 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Sat Sep 29 07:34:12 UTC 2018

Modified Files:
src/sys/arch/amd64/amd64 [pgoyette-compat]: netbsd32_machdep.c
netbsd32_machdep_16.c

Log Message:
Allocate the netbsd32_sendsig_hook in the main compat_netbsd32 code
(where it call be called) and not in a subsidiary module which may
not even exist.


To generate a diff of this commit:
cvs rdiff -u -r1.115.2.9 -r1.115.2.10 \
src/sys/arch/amd64/amd64/netbsd32_machdep.c
cvs rdiff -u -r1.1.2.8 -r1.1.2.9 \
src/sys/arch/amd64/amd64/netbsd32_machdep_16.c

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

Modified files:

Index: src/sys/arch/amd64/amd64/netbsd32_machdep.c
diff -u src/sys/arch/amd64/amd64/netbsd32_machdep.c:1.115.2.9 src/sys/arch/amd64/amd64/netbsd32_machdep.c:1.115.2.10
--- src/sys/arch/amd64/amd64/netbsd32_machdep.c:1.115.2.9	Sat Sep 29 06:19:42 2018
+++ src/sys/arch/amd64/amd64/netbsd32_machdep.c	Sat Sep 29 07:34:12 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_machdep.c,v 1.115.2.9 2018/09/29 06:19:42 pgoyette Exp $	*/
+/*	$NetBSD: netbsd32_machdep.c,v 1.115.2.10 2018/09/29 07:34:12 pgoyette Exp $	*/
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.115.2.9 2018/09/29 06:19:42 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.115.2.10 2018/09/29 07:34:12 pgoyette Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -273,6 +273,8 @@ netbsd32_sendsig_siginfo(const ksiginfo_
 	return 0;
 }
 
+struct netbsd32_sendsig_hook_t netbsd32_sendsig_hook;
+
 MODULE_CALL_HOOK_DECL(netbsd32_sendsig_hook, f,
 (const ksiginfo_t *ksi, const sigset_t *mask), (ksi, mask),
 netbsd32_sendsig_siginfo(ksi, mask));

Index: src/sys/arch/amd64/amd64/netbsd32_machdep_16.c
diff -u src/sys/arch/amd64/amd64/netbsd32_machdep_16.c:1.1.2.8 src/sys/arch/amd64/amd64/netbsd32_machdep_16.c:1.1.2.9
--- src/sys/arch/amd64/amd64/netbsd32_machdep_16.c:1.1.2.8	Sat Sep 29 07:13:01 2018
+++ src/sys/arch/amd64/amd64/netbsd32_machdep_16.c	Sat Sep 29 07:34:12 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_machdep_16.c,v 1.1.2.8 2018/09/29 07:13:01 pgoyette Exp $	*/
+/*	$NetBSD: netbsd32_machdep_16.c,v 1.1.2.9 2018/09/29 07:34:12 pgoyette Exp $	*/
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep_16.c,v 1.1.2.8 2018/09/29 07:13:01 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep_16.c,v 1.1.2.9 2018/09/29 07:34:12 pgoyette Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -86,7 +86,7 @@ int check_sigcontext32(struct lwp *, con
 
 int netbsd32_sendsig_16(const ksiginfo_t *, const sigset_t *);
 
-struct netbsd32_sendsig_hook_t netbsd32_sendsig_hook;
+extern struct netbsd32_sendsig_hook_t netbsd32_sendsig_hook;
 
 static void
 netbsd32_sendsig_sigcontext(const ksiginfo_t *ksi, const sigset_t *mask)



CVS commit: [pgoyette-compat] src/sys/arch/amd64/amd64

2018-09-29 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Sat Sep 29 07:13:01 UTC 2018

Modified Files:
src/sys/arch/amd64/amd64 [pgoyette-compat]: netbsd32_machdep_16.c

Log Message:
Wrap long line, KNF


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.7 -r1.1.2.8 \
src/sys/arch/amd64/amd64/netbsd32_machdep_16.c

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

Modified files:

Index: src/sys/arch/amd64/amd64/netbsd32_machdep_16.c
diff -u src/sys/arch/amd64/amd64/netbsd32_machdep_16.c:1.1.2.7 src/sys/arch/amd64/amd64/netbsd32_machdep_16.c:1.1.2.8
--- src/sys/arch/amd64/amd64/netbsd32_machdep_16.c:1.1.2.7	Tue Sep 25 01:26:58 2018
+++ src/sys/arch/amd64/amd64/netbsd32_machdep_16.c	Sat Sep 29 07:13:01 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_machdep_16.c,v 1.1.2.7 2018/09/25 01:26:58 pgoyette Exp $	*/
+/*	$NetBSD: netbsd32_machdep_16.c,v 1.1.2.8 2018/09/29 07:13:01 pgoyette Exp $	*/
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep_16.c,v 1.1.2.7 2018/09/25 01:26:58 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep_16.c,v 1.1.2.8 2018/09/29 07:13:01 pgoyette Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -187,7 +187,9 @@ netbsd32_sendsig_16(const ksiginfo_t *ks
 }
 
 int
-compat_16_netbsd32___sigreturn14(struct lwp *l, const struct compat_16_netbsd32___sigreturn14_args *uap, register_t *retval)
+compat_16_netbsd32___sigreturn14(struct lwp *l,
+const struct compat_16_netbsd32___sigreturn14_args *uap,
+register_t *retval)
 {
 	/* {
 		syscallarg(netbsd32_sigcontextp_t) sigcntxp;



CVS commit: src/sys/arch/i386/i386

2018-09-29 Thread Cherry G. Mathew
Module Name:src
Committed By:   cherry
Date:   Sat Sep 29 07:00:20 UTC 2018

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

Log Message:
Fix "use before init" of *idt.
This should fix boot time pagefaulting and panic(9)
on XEN kernels due to the boottime idt API reorg.


To generate a diff of this commit:
cvs rdiff -u -r1.810 -r1.811 src/sys/arch/i386/i386/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/i386/i386/machdep.c
diff -u src/sys/arch/i386/i386/machdep.c:1.810 src/sys/arch/i386/i386/machdep.c:1.811
--- src/sys/arch/i386/i386/machdep.c:1.810	Sun Sep 23 15:28:48 2018
+++ src/sys/arch/i386/i386/machdep.c	Sat Sep 29 07:00:20 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.810 2018/09/23 15:28:48 cherry Exp $	*/
+/*	$NetBSD: machdep.c,v 1.811 2018/09/29 07:00:20 cherry Exp $	*/
 
 /*
  * Copyright (c) 1996, 1997, 1998, 2000, 2004, 2006, 2008, 2009, 2017
@@ -67,7 +67,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.810 2018/09/23 15:28:48 cherry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.811 2018/09/29 07:00:20 cherry Exp $");
 
 #include "opt_beep.h"
 #include "opt_compat_freebsd.h"
@@ -1307,13 +1307,13 @@ init386(paddr_t first_avail)
 	memset((void *)gdt_vaddr, 0, PAGE_SIZE);
 	memset((void *)ldt_vaddr, 0, PAGE_SIZE);
 
-#ifndef XEN
 	pmap_kenter_pa(pentium_idt_vaddr, idt_paddr, VM_PROT_READ, 0);
 	pmap_update(pmap_kernel());
 	pentium_idt = (union descriptor *)pentium_idt_vaddr;
+	idt = (idt_descriptor_t *)idt_vaddr;
 
+#ifndef XEN	
 	tgdt = gdtstore;
-	idt = (struct gate_descriptor *)idt_vaddr;
 	gdtstore = (union descriptor *)gdt_vaddr;
 	ldtstore = (union descriptor *)ldt_vaddr;