CVS commit: src/sys/external/bsd/drm2/dist

2018-09-13 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Thu Sep 13 08:25:55 UTC 2018

Modified Files:
src/sys/external/bsd/drm2/dist/drm/i915: i915_dma.c i915_drv.c
i915_drv.h i915_gem_stolen.c i915_irq.c i915_reg.h intel_csr.c
intel_ddi.c intel_display.c intel_dp.c intel_fbc.c
intel_guc_loader.c intel_i2c.c intel_mocs.c intel_panel.c
intel_pm.c intel_ringbuffer.c intel_runtime_pm.c
src/sys/external/bsd/drm2/dist/include/drm: i915_pciids.h

Log Message:
add support for kabylake and skylake GT4 (untested) GPUs.
largely taken from openbsd and linux 4.13 trees (which
have this code identical), with mimimal porting to netbsd.

i have not installed (and thus tested) the newer referenced
firmware files.

only real local change is to fix IS_BROXTON() macro to check
the things valid in this era of drm.  previous match would
attach on KBL, and then a loop would never exit.

tested on kabylake P630.  needs mesa 11.x or newer for GL
to work.

ok @riastradh.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/sys/external/bsd/drm2/dist/drm/i915/i915_dma.c
cvs rdiff -u -r1.15 -r1.16 src/sys/external/bsd/drm2/dist/drm/i915/i915_drv.c \
src/sys/external/bsd/drm2/dist/drm/i915/intel_pm.c
cvs rdiff -u -r1.27 -r1.28 src/sys/external/bsd/drm2/dist/drm/i915/i915_drv.h
cvs rdiff -u -r1.10 -r1.11 \
src/sys/external/bsd/drm2/dist/drm/i915/i915_gem_stolen.c \
src/sys/external/bsd/drm2/dist/drm/i915/intel_panel.c
cvs rdiff -u -r1.16 -r1.17 src/sys/external/bsd/drm2/dist/drm/i915/i915_irq.c \
src/sys/external/bsd/drm2/dist/drm/i915/intel_i2c.c
cvs rdiff -u -r1.4 -r1.5 src/sys/external/bsd/drm2/dist/drm/i915/i915_reg.h \
src/sys/external/bsd/drm2/dist/drm/i915/intel_csr.c
cvs rdiff -u -r1.7 -r1.8 src/sys/external/bsd/drm2/dist/drm/i915/intel_ddi.c
cvs rdiff -u -r1.22 -r1.23 \
src/sys/external/bsd/drm2/dist/drm/i915/intel_display.c
cvs rdiff -u -r1.18 -r1.19 src/sys/external/bsd/drm2/dist/drm/i915/intel_dp.c
cvs rdiff -u -r1.3 -r1.4 src/sys/external/bsd/drm2/dist/drm/i915/intel_fbc.c
cvs rdiff -u -r1.12 -r1.13 \
src/sys/external/bsd/drm2/dist/drm/i915/intel_guc_loader.c
cvs rdiff -u -r1.2 -r1.3 src/sys/external/bsd/drm2/dist/drm/i915/intel_mocs.c
cvs rdiff -u -r1.8 -r1.9 \
src/sys/external/bsd/drm2/dist/drm/i915/intel_ringbuffer.c
cvs rdiff -u -r1.5 -r1.6 \
src/sys/external/bsd/drm2/dist/drm/i915/intel_runtime_pm.c
cvs rdiff -u -r1.2 -r1.3 \
src/sys/external/bsd/drm2/dist/include/drm/i915_pciids.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/external/bsd/drm2/dist/drm/i915/i915_dma.c
diff -u src/sys/external/bsd/drm2/dist/drm/i915/i915_dma.c:1.25 src/sys/external/bsd/drm2/dist/drm/i915/i915_dma.c:1.26
--- src/sys/external/bsd/drm2/dist/drm/i915/i915_dma.c:1.25	Tue Aug 28 03:41:38 2018
+++ src/sys/external/bsd/drm2/dist/drm/i915/i915_dma.c	Thu Sep 13 08:25:55 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: i915_dma.c,v 1.25 2018/08/28 03:41:38 riastradh Exp $	*/
+/*	$NetBSD: i915_dma.c,v 1.26 2018/09/13 08:25:55 mrg Exp $	*/
 
 /* i915_dma.c -- DMA support for the I915 -*- linux-c -*-
  */
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: i915_dma.c,v 1.25 2018/08/28 03:41:38 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i915_dma.c,v 1.26 2018/09/13 08:25:55 mrg Exp $");
 
 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
 
@@ -693,7 +693,8 @@ static void gen9_sseu_info_init(struct d
 	 * supports EU power gating on devices with more than one EU
 	 * pair per subslice.
 	*/
-	info->has_slice_pg = (IS_SKYLAKE(dev) && (info->slice_total > 1));
+	info->has_slice_pg = ((IS_SKYLAKE(dev) || IS_KABYLAKE(dev)) &&
+			   (info->slice_total > 1));
 	info->has_subslice_pg = (IS_BROXTON(dev) && (info->subslice_total > 1));
 	info->has_eu_pg = (info->eu_per_subslice > 2);
 }

Index: src/sys/external/bsd/drm2/dist/drm/i915/i915_drv.c
diff -u src/sys/external/bsd/drm2/dist/drm/i915/i915_drv.c:1.15 src/sys/external/bsd/drm2/dist/drm/i915/i915_drv.c:1.16
--- src/sys/external/bsd/drm2/dist/drm/i915/i915_drv.c:1.15	Mon Aug 27 15:22:54 2018
+++ src/sys/external/bsd/drm2/dist/drm/i915/i915_drv.c	Thu Sep 13 08:25:55 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: i915_drv.c,v 1.15 2018/08/27 15:22:54 riastradh Exp $	*/
+/*	$NetBSD: i915_drv.c,v 1.16 2018/09/13 08:25:55 mrg Exp $	*/
 
 /* i915_drv.c -- i830,i845,i855,i865,i915 driver -*- linux-c -*-
  */
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: i915_drv.c,v 1.15 2018/08/27 15:22:54 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i915_drv.c,v 1.16 2018/09/13 08:25:55 mrg Exp $");
 
 #include 
 #include 
@@ -406,6 +406,34 @@ static const struct intel_device_info in
 	IVB_CURSOR_OFFSETS,
 };
 
+static const struct intel_device_info intel_kabylake_info = {
+	.is_kabylake = 1,
+	.gen = 9,
+	.num_pipes = 3,
+	.need_gfx_hws = 1, .has_hotplug = 1,
+	.ring_mask = RENDER_RING | BSD_RING | 

CVS commit: src/lib/libedit

2018-09-13 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Thu Sep 13 09:03:40 UTC 2018

Modified Files:
src/lib/libedit: history.c

Log Message:
Fix editing mistake, remove ) from func call that is now gone.


To generate a diff of this commit:
cvs rdiff -u -r1.61 -r1.62 src/lib/libedit/history.c

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

Modified files:

Index: src/lib/libedit/history.c
diff -u src/lib/libedit/history.c:1.61 src/lib/libedit/history.c:1.62
--- src/lib/libedit/history.c:1.61	Thu Sep 13 01:26:33 2018
+++ src/lib/libedit/history.c	Thu Sep 13 09:03:40 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: history.c,v 1.61 2018/09/13 01:26:33 christos Exp $	*/
+/*	$NetBSD: history.c,v 1.62 2018/09/13 09:03:40 kre Exp $	*/
 
 /*-
  * Copyright (c) 1992, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)history.c	8.1 (Berkeley) 6/4/93";
 #else
-__RCSID("$NetBSD: history.c,v 1.61 2018/09/13 01:26:33 christos Exp $");
+__RCSID("$NetBSD: history.c,v 1.62 2018/09/13 09:03:40 kre Exp $");
 #endif
 #endif /* not lint && not SCCSID */
 
@@ -811,7 +811,7 @@ history_load(TYPE(History) *h, const cha
 		decode_result = ct_decode_string(ptr, &conv);
 		if (decode_result == NULL)
 			continue;
-		if (HENTER(h, &ev, decode_result)) == -1) {
+		if (HENTER(h, &ev, decode_result) == -1) {
 			i = -1;
 			goto oomem;
 		}



CVS commit: [pgoyette-compat] src/sys/modules/compat_50

2018-09-13 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Thu Sep 13 10:16:51 UTC 2018

Modified Files:
src/sys/modules/compat_50 [pgoyette-compat]: Makefile

Log Message:
Include rtsock_50.c in the build for compat_50 module.  It might be
reachable via the rtsock code, but there's stuff in the compat_09
module that refers to the _50 stuff.  Including this allows us to
modload the compat_09 module.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.7 -r1.1.2.8 src/sys/modules/compat_50/Makefile

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

Modified files:

Index: src/sys/modules/compat_50/Makefile
diff -u src/sys/modules/compat_50/Makefile:1.1.2.7 src/sys/modules/compat_50/Makefile:1.1.2.8
--- src/sys/modules/compat_50/Makefile:1.1.2.7	Sat Mar 24 23:52:19 2018
+++ src/sys/modules/compat_50/Makefile	Thu Sep 13 10:16:51 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.1.2.7 2018/03/24 23:52:19 pgoyette Exp $
+#	$NetBSD: Makefile,v 1.1.2.8 2018/09/13 10:16:51 pgoyette Exp $
 
 .include "../Makefile.inc"
 
@@ -12,7 +12,7 @@ SRCS+=	compat_50_mod.c
 SRCS+=	kern_50.c kern_time_50.c kern_select_50.c
 SRCS+=	vfs_syscalls_50.c uipc_syscalls_50.c uvm_50.c
 SRCS+=	rndpseudo_50.c clockctl_50.c if_spppsubr50.c
-#SRCS+=	rtsock_50.c
+SRCS+=	rtsock_50.c
 
 .PATH:	${S}/opencrypto
 



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

2018-09-13 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Thu Sep 13 12:53:00 UTC 2018

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

Log Message:
Wrap arm_fdt_cpu_okay with #ifdef MULTIPROCESSOR


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/arm/fdt/cpu_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/cpu_fdt.c
diff -u src/sys/arch/arm/fdt/cpu_fdt.c:1.13 src/sys/arch/arm/fdt/cpu_fdt.c:1.14
--- src/sys/arch/arm/fdt/cpu_fdt.c:1.13	Mon Sep 10 19:15:16 2018
+++ src/sys/arch/arm/fdt/cpu_fdt.c	Thu Sep 13 12:53:00 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu_fdt.c,v 1.13 2018/09/10 19:15:16 jmcneill Exp $ */
+/* $NetBSD: cpu_fdt.c,v 1.14 2018/09/13 12:53:00 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2017 Jared McNeill 
@@ -30,7 +30,7 @@
 #include "psci_fdt.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cpu_fdt.c,v 1.13 2018/09/10 19:15:16 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu_fdt.c,v 1.14 2018/09/13 12:53:00 jmcneill Exp $");
 
 #include 
 #include 
@@ -205,6 +205,7 @@ spintable_cpu_on(u_int cpuindex, paddr_t
 }
 #endif /* MULTIPROCESSOR */
 
+#ifdef MULTIPROCESSOR
 static bool
 arm_fdt_cpu_okay(const int child)
 {
@@ -225,6 +226,7 @@ arm_fdt_cpu_okay(const int child)
 		return true;
 	}
 }
+#endif /* MULTIPROCESSOR */
 
 void
 arm_fdt_cpu_bootstrap(void)



CVS commit: src/sys/kern

2018-09-13 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Thu Sep 13 14:44:09 UTC 2018

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

Log Message:
Don't leak kernel pointers to userland in kern.file2, same as kern.proc2.


To generate a diff of this commit:
cvs rdiff -u -r1.236 -r1.237 src/sys/kern/kern_descrip.c

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

Modified files:

Index: src/sys/kern/kern_descrip.c
diff -u src/sys/kern/kern_descrip.c:1.236 src/sys/kern/kern_descrip.c:1.237
--- src/sys/kern/kern_descrip.c:1.236	Mon Sep  3 16:29:35 2018
+++ src/sys/kern/kern_descrip.c	Thu Sep 13 14:44:09 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_descrip.c,v 1.236 2018/09/03 16:29:35 riastradh Exp $	*/
+/*	$NetBSD: kern_descrip.c,v 1.237 2018/09/13 14:44:09 maxv Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -70,7 +70,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_descrip.c,v 1.236 2018/09/03 16:29:35 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_descrip.c,v 1.237 2018/09/13 14:44:09 maxv Exp $");
 
 #include 
 #include 
@@ -2283,35 +2283,50 @@ sysctl_kern_file2(SYSCTLFN_ARGS)
 	return error;
 }
 
+#define SET_KERN_ADDR(dst, src, allow)	\
+	do {\
+		if (allow)		\
+			dst = src;	\
+	} while (0);
+
 static void
 fill_file(struct kinfo_file *kp, const file_t *fp, const fdfile_t *ff,
 	  int i, pid_t pid)
 {
+	bool allowaddr;
+	int error;
+
+	/* If not privileged, don't expose kernel addresses. */
+	error = kauth_authorize_process(kauth_cred_get(), KAUTH_PROCESS_CANSEE,
+	curproc, KAUTH_ARG(KAUTH_REQ_PROCESS_CANSEE_KPTR), NULL, NULL);
+	allowaddr = (error == 0);
 
 	memset(kp, 0, sizeof(*kp));
 
-	kp->ki_fileaddr =	PTRTOUINT64(fp);
+	SET_KERN_ADDR(kp->ki_fileaddr, PTRTOUINT64(fp), allowaddr);
 	kp->ki_flag =		fp->f_flag;
 	kp->ki_iflags =		0;
 	kp->ki_ftype =		fp->f_type;
 	kp->ki_count =		fp->f_count;
 	kp->ki_msgcount =	fp->f_msgcount;
-	kp->ki_fucred =		PTRTOUINT64(fp->f_cred);
+	SET_KERN_ADDR(kp->ki_fucred, PTRTOUINT64(fp->f_cred), allowaddr);
 	kp->ki_fuid =		kauth_cred_geteuid(fp->f_cred);
 	kp->ki_fgid =		kauth_cred_getegid(fp->f_cred);
-	kp->ki_fops =		PTRTOUINT64(fp->f_ops);
+	SET_KERN_ADDR(kp->ki_fops, PTRTOUINT64(fp->f_ops), allowaddr);
 	kp->ki_foffset =	fp->f_offset;
-	kp->ki_fdata =		PTRTOUINT64(fp->f_data);
+	SET_KERN_ADDR(kp->ki_fdata, PTRTOUINT64(fp->f_data), allowaddr);
 
 	/* vnode information to glue this file to something */
 	if (fp->f_type == DTYPE_VNODE) {
 		struct vnode *vp = fp->f_vnode;
 
-		kp->ki_vun =	PTRTOUINT64(vp->v_un.vu_socket);
+		SET_KERN_ADDR(kp->ki_vun, PTRTOUINT64(vp->v_un.vu_socket),
+		allowaddr);
 		kp->ki_vsize =	vp->v_size;
 		kp->ki_vtype =	vp->v_type;
 		kp->ki_vtag =	vp->v_tag;
-		kp->ki_vdata =	PTRTOUINT64(vp->v_data);
+		SET_KERN_ADDR(kp->ki_vdata, PTRTOUINT64(vp->v_data),
+		allowaddr);
 	}
 
 	/* process information when retrieved via KERN_FILE_BYPID */



CVS commit: src/sys/arch

2018-09-13 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu Sep 13 18:55:01 UTC 2018

Removed Files:
src/sys/arch/arm/cortina: files.g2 g2_intr.h g2_reg.h
src/sys/arch/evbarm/conf: GOLDENGATE files.goldengate mk.goldengate
std.goldengate

Log Message:
G/C GOLDENGATE


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r0 src/sys/arch/arm/cortina/files.g2
cvs rdiff -u -r1.1 -r0 src/sys/arch/arm/cortina/g2_intr.h \
src/sys/arch/arm/cortina/g2_reg.h
cvs rdiff -u -r1.19 -r0 src/sys/arch/evbarm/conf/GOLDENGATE
cvs rdiff -u -r1.2 -r0 src/sys/arch/evbarm/conf/files.goldengate \
src/sys/arch/evbarm/conf/std.goldengate
cvs rdiff -u -r1.1 -r0 src/sys/arch/evbarm/conf/mk.goldengate

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



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

2018-09-13 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Thu Sep 13 21:42:25 UTC 2018

Modified Files:
src/sys/compat/common [pgoyette-compat]: compat_20_mod.c

Log Message:
Fix typo - Don't try to re-init the submodule when doing MODULE_CMD_fINI!


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.2 -r1.1.2.3 src/sys/compat/common/compat_20_mod.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/common/compat_20_mod.c
diff -u src/sys/compat/common/compat_20_mod.c:1.1.2.2 src/sys/compat/common/compat_20_mod.c:1.1.2.3
--- src/sys/compat/common/compat_20_mod.c:1.1.2.2	Mon Sep 10 08:41:47 2018
+++ src/sys/compat/common/compat_20_mod.c	Thu Sep 13 21:42:24 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: compat_20_mod.c,v 1.1.2.2 2018/09/10 08:41:47 pgoyette Exp $	*/
+/*	$NetBSD: compat_20_mod.c,v 1.1.2.3 2018/09/13 21:42:24 pgoyette Exp $	*/
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: compat_20_mod.c,v 1.1.2.2 2018/09/10 08:41:47 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: compat_20_mod.c,v 1.1.2.3 2018/09/13 21:42:24 pgoyette Exp $");
 
 #include 
 #include 
@@ -90,7 +90,7 @@ compat_20_modcmd(modcmd_t cmd, void *arg
 	case MODULE_CMD_INIT:
 		return compat_20_init();
 	case MODULE_CMD_FINI:
-		return compat_20_init();
+		return compat_20_fini();
 	default:
 		return ENOTTY;
 	}



CVS commit: src/bin/test

2018-09-13 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Thu Sep 13 22:00:58 UTC 2018

Modified Files:
src/bin/test: test.c

Log Message:
Allow SMALL (and TINY) builds of test (for SMALL/TINY builds of sh)
which support only the defined modes of operation of test, to allow
the version of sh on small install media be kept as small as possible.


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.43 src/bin/test/test.c

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

Modified files:

Index: src/bin/test/test.c
diff -u src/bin/test/test.c:1.42 src/bin/test/test.c:1.43
--- src/bin/test/test.c:1.42	Wed Sep 12 23:33:31 2018
+++ src/bin/test/test.c	Thu Sep 13 22:00:58 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: test.c,v 1.42 2018/09/12 23:33:31 kre Exp $ */
+/* $NetBSD: test.c,v 1.43 2018/09/13 22:00:58 kre Exp $ */
 
 /*
  * test(1); version 7-like  --  author Erik Baalbergen
@@ -12,7 +12,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: test.c,v 1.42 2018/09/12 23:33:31 kre Exp $");
+__RCSID("$NetBSD: test.c,v 1.43 2018/09/13 22:00:58 kre Exp $");
 #endif
 
 #include 
@@ -91,10 +91,13 @@ enum token {
 
 enum token_types {
 	UNOP,
-	BINOP,
+	BINOP
+#ifndef SMALL
+		,
 	BUNOP,
 	BBINOP,
 	PAREN
+#endif
 };
 
 struct t_op {
@@ -103,9 +106,11 @@ struct t_op {
 };
 
 static const struct t_op cop[] = {
+#ifndef SMALL
 	{"!",	UNOT,	BUNOP},
 	{"(",	LPAREN,	PAREN},
 	{")",	RPAREN,	PAREN},
+#endif
 	{"<",	STRLT,	BINOP},
 	{"=",	STREQ,	BINOP},
 	{">",	STRGT,	BINOP},
@@ -132,7 +137,9 @@ static const struct t_op mop2[] = {
 	{"L",	FILSYM,	UNOP},
 	{"O",	FILUID,	UNOP},
 	{"S",	FILSOCK,UNOP},
+#ifndef SMALL
 	{"a",	BAND,	BBINOP},
+#endif
 	{"b",	FILBDEV,UNOP},
 	{"c",	FILCDEV,UNOP},
 	{"d",	FILDIR,	UNOP},
@@ -142,7 +149,9 @@ static const struct t_op mop2[] = {
 	{"h",	FILSYM,	UNOP},		/* for backwards compat */
 	{"k",	FILSTCK,UNOP},
 	{"n",	STRNZ,	UNOP},
+#ifndef SMALL
 	{"o",	BOR,	BBINOP},
+#endif
 	{"p",	FILFIFO,UNOP},
 	{"r",	FILRD,	UNOP},
 	{"s",	FILGZ,	UNOP},
@@ -153,22 +162,26 @@ static const struct t_op mop2[] = {
 	{"z",	STREZ,	UNOP},
 };
 
+#ifndef SMALL
 static char **t_wp;
 static struct t_op const *t_wp_op;
+#endif
 
+#ifndef SMALL
 __dead static void syntax(const char *, const char *);
 static int oexpr(enum token);
 static int aexpr(enum token);
 static int nexpr(enum token);
-static struct t_op const *findop(const char *);
 static int primary(enum token);
 static int binop(void);
+static enum token t_lex(char *);
+static int isoperand(void);
+#endif
+static struct t_op const *findop(const char *);
 static int perform_unop(enum token, const char *);
 static int perform_binop(enum token, const char *, const char *);
 static int test_access(struct stat *, mode_t);
 static int filstat(const char *, enum token);
-static enum token t_lex(char *);
-static int isoperand(void);
 static long long getn(const char *);
 static int newerf(const char *, const char *);
 static int olderf(const char *, const char *);
@@ -292,6 +305,10 @@ main(int argc, char *argv[])
 	 * operators and operands that happen to look like operators)
 	 */
 
+#ifdef SMALL
+	error("SMALL test, no fallback usage");
+#else
+
 	t_wp = &argv[1];
 	res = !oexpr(t_lex(*t_wp));
 
@@ -299,8 +316,10 @@ main(int argc, char *argv[])
 		syntax(*t_wp, "unexpected operator");
 
 	return res;
+#endif
 }
 
+#ifndef SMALL
 static void
 syntax(const char *op, const char *msg)
 {
@@ -310,6 +329,7 @@ syntax(const char *op, const char *msg)
 	else
 		error("%s", msg);
 }	
+#endif
 
 static int
 one_arg(const char *arg)
@@ -333,12 +353,14 @@ two_arg(const char *a1, const char *a2)
 	if (op != NULL && op->op_type == UNOP)
 		return !perform_unop(op->op_num, a2);
 
+#ifndef TINY
 	/*
 	 * an extension, but as we've entered the realm of the unspecified
 	 * we're allowed...		test ( $a )	where a=''
 	 */
 	if (a1[0] == '(' && a2[0] == ')' && (a1[1] | a2[1]) == 0)
 		return 1;
+#endif
 
 	return -1;
 }
@@ -363,8 +385,10 @@ three_arg(const char *a1, const char *a2
 		return res;
 	}
 
+#ifndef TINY
 	if (a1[0] == '(' && a3[0] == ')' && a3[1] == '\0')
 		return one_arg(a2);
+#endif
 
 	return -1;
 }
@@ -384,12 +408,15 @@ four_arg(const char *a1, const char *a2,
 		return res;
 	}
 
+#ifndef TINY
 	if (a1[0] == '(' && a4[0] == ')' && a4[1] == '\0')
 		return two_arg(a2, a3);
+#endif
 
 	return -1;
 }
 
+#ifndef SMALL
 static int
 oexpr(enum token n)
 {
@@ -456,6 +483,7 @@ primary(enum token n)
 
 	return strlen(*t_wp) > 0;
 }
+#endif /* !SMALL */
 
 static int
 perform_unop(enum token n, const char *opnd)
@@ -472,6 +500,7 @@ perform_unop(enum token n, const char *o
 	}
 }
 
+#ifndef SMALL
 static int
 binop(void)
 {
@@ -487,6 +516,7 @@ binop(void)
 		
 	return perform_binop(op->op_num, opnd1, opnd2);
 }
+#endif
 
 static int
 perform_binop(enum token op_num, const char *opnd1, const char *opnd2)
@@ -780,6 +810,7 @@ findop(const char *s)
 	}
 }
 
+#ifndef SMALL
 static enum token
 t_lex(char *s)
 {
@@ -815,6 +84

CVS commit: [pgoyette-compat] src/sys/modules/compat_netbsd32

2018-09-13 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Thu Sep 13 22:10:04 UTC 2018

Modified Files:
src/sys/modules/compat_netbsd32 [pgoyette-compat]: Makefile

Log Message:
Include required MD code for amd64


To generate a diff of this commit:
cvs rdiff -u -r1.20.12.9 -r1.20.12.10 \
src/sys/modules/compat_netbsd32/Makefile

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

Modified files:

Index: src/sys/modules/compat_netbsd32/Makefile
diff -u src/sys/modules/compat_netbsd32/Makefile:1.20.12.9 src/sys/modules/compat_netbsd32/Makefile:1.20.12.10
--- src/sys/modules/compat_netbsd32/Makefile:1.20.12.9	Wed Sep 12 04:35:22 2018
+++ src/sys/modules/compat_netbsd32/Makefile	Thu Sep 13 22:10:04 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.20.12.9 2018/09/12 04:35:22 pgoyette Exp $
+#	$NetBSD: Makefile,v 1.20.12.10 2018/09/13 22:10:04 pgoyette Exp $
 
 .include "../Makefile.inc"
 .include "../Makefile.assym"
@@ -43,6 +43,7 @@ SRCS+=	netbsd32_exec_aout.c
 
 .if ${MACHINE_ARCH} == "x86_64"
 .PATH:	${S}/arch/amd64/amd64
+CPPFLAGS+=	-DCOMPAT_13 -DCOMPAT_16
 SRCS+=	netbsd32_machdep.c netbsd32_sigcode.S netbsd32_syscall.c
 .endif
 



CVS commit: [pgoyette-compat] src/sys/modules/compat_13

2018-09-13 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Thu Sep 13 22:09:20 UTC 2018

Modified Files:
src/sys/modules/compat_13 [pgoyette-compat]: Makefile

Log Message:
Include required MD code for amd64


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.1 -r1.1.2.2 src/sys/modules/compat_13/Makefile

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

Modified files:

Index: src/sys/modules/compat_13/Makefile
diff -u src/sys/modules/compat_13/Makefile:1.1.2.1 src/sys/modules/compat_13/Makefile:1.1.2.2
--- src/sys/modules/compat_13/Makefile:1.1.2.1	Fri Mar 30 11:18:34 2018
+++ src/sys/modules/compat_13/Makefile	Thu Sep 13 22:09:20 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.1.2.1 2018/03/30 11:18:34 pgoyette Exp $
+#	$NetBSD: Makefile,v 1.1.2.2 2018/09/13 22:09:20 pgoyette Exp $
 
 .include "../Makefile.inc"
 
@@ -12,5 +12,10 @@ CPPFLAGS+=	-DCOMPAT_40 -DCOMPAT_50 -DCOM
 SRCS+=	compat_13_mod.c
 SRCS+=	uvm_13.c kern_sig_13.c
 
+.if ${MACHINE_ARCH} == "x86_64"
+.PATH:	${S}/arch/amd64/amd64
+
+SRCS+=	compat_13_machdep.c
+.endif
 
 .include 



CVS commit: src/bin/sh

2018-09-13 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Thu Sep 13 22:12:35 UTC 2018

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

Log Message:
A change in rev 1.91 interacted badly with the way that showjobs()
worked, preventing $(jobs) (and more usefully $(jobs -p) from
working.   Fix that.

XXX pullup -8


To generate a diff of this commit:
cvs rdiff -u -r1.100 -r1.101 src/bin/sh/jobs.c

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

Modified files:

Index: src/bin/sh/jobs.c
diff -u src/bin/sh/jobs.c:1.100 src/bin/sh/jobs.c:1.101
--- src/bin/sh/jobs.c:1.100	Tue Sep  4 23:16:30 2018
+++ src/bin/sh/jobs.c	Thu Sep 13 22:12:35 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: jobs.c,v 1.100 2018/09/04 23:16:30 kre Exp $	*/
+/*	$NetBSD: jobs.c,v 1.101 2018/09/13 22:12:35 kre Exp $	*/
 
 /*-
  * Copyright (c) 1991, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)jobs.c	8.5 (Berkeley) 5/4/95";
 #else
-__RCSID("$NetBSD: jobs.c,v 1.100 2018/09/04 23:16:30 kre Exp $");
+__RCSID("$NetBSD: jobs.c,v 1.101 2018/09/13 22:12:35 kre Exp $");
 #endif
 #endif /* not lint */
 
@@ -586,14 +586,13 @@ showjobs(struct output *out, int mode)
 		silent = 1;
 	}
 #endif
-	if (jobs_invalid)
-		return;
 
 	for (jobno = 1, jp = jobtab ; jobno <= njobs ; jobno++, jp++) {
 		if (!jp->used)
 			continue;
 		if (jp->nprocs == 0) {
-			freejob(jp);
+			if (!jobs_invalid)
+freejob(jp);
 			continue;
 		}
 		if ((mode & SHOW_CHANGED) && !(jp->flags & JOBCHANGED))



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

2018-09-13 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Thu Sep 13 22:53:52 UTC 2018

Modified Files:
src/sys/compat/common [pgoyette-compat]: compat_09_mod.c
compat_10_mod.c compat_12_mod.c compat_13_mod.c compat_14_mod.c
compat_16_mod.c compat_30_mod.c compat_40_mod.c compat_43_mod.c
compat_50_mod.c compat_60_mod.c

Log Message:
When unloading a module with MODULE_CMD_FINI, call the compat_xx_fini()
routine rather than again calling the compat_xx_init() routine!

(Cut&paste strikes again)


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.2 -r1.1.2.3 src/sys/compat/common/compat_09_mod.c \
src/sys/compat/common/compat_10_mod.c \
src/sys/compat/common/compat_14_mod.c \
src/sys/compat/common/compat_16_mod.c \
src/sys/compat/common/compat_43_mod.c
cvs rdiff -u -r1.1.2.3 -r1.1.2.4 src/sys/compat/common/compat_12_mod.c \
src/sys/compat/common/compat_13_mod.c \
src/sys/compat/common/compat_40_mod.c
cvs rdiff -u -r1.1.2.5 -r1.1.2.6 src/sys/compat/common/compat_30_mod.c
cvs rdiff -u -r1.1.2.9 -r1.1.2.10 src/sys/compat/common/compat_50_mod.c
cvs rdiff -u -r1.1.2.16 -r1.1.2.17 src/sys/compat/common/compat_60_mod.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/common/compat_09_mod.c
diff -u src/sys/compat/common/compat_09_mod.c:1.1.2.2 src/sys/compat/common/compat_09_mod.c:1.1.2.3
--- src/sys/compat/common/compat_09_mod.c:1.1.2.2	Mon Sep 10 08:41:47 2018
+++ src/sys/compat/common/compat_09_mod.c	Thu Sep 13 22:53:52 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: compat_09_mod.c,v 1.1.2.2 2018/09/10 08:41:47 pgoyette Exp $	*/
+/*	$NetBSD: compat_09_mod.c,v 1.1.2.3 2018/09/13 22:53:52 pgoyette Exp $	*/
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: compat_09_mod.c,v 1.1.2.2 2018/09/10 08:41:47 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: compat_09_mod.c,v 1.1.2.3 2018/09/13 22:53:52 pgoyette Exp $");
 
 #include 
 #include 
@@ -84,7 +84,7 @@ compat_09_modcmd(modcmd_t cmd, void *arg
 	case MODULE_CMD_INIT:
 		return compat_09_init();
 	case MODULE_CMD_FINI:
-		return compat_09_init();
+		return compat_09_fini();
 	default:
 		return ENOTTY;
 	}
Index: src/sys/compat/common/compat_10_mod.c
diff -u src/sys/compat/common/compat_10_mod.c:1.1.2.2 src/sys/compat/common/compat_10_mod.c:1.1.2.3
--- src/sys/compat/common/compat_10_mod.c:1.1.2.2	Mon Sep 10 08:41:47 2018
+++ src/sys/compat/common/compat_10_mod.c	Thu Sep 13 22:53:52 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: compat_10_mod.c,v 1.1.2.2 2018/09/10 08:41:47 pgoyette Exp $	*/
+/*	$NetBSD: compat_10_mod.c,v 1.1.2.3 2018/09/13 22:53:52 pgoyette Exp $	*/
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: compat_10_mod.c,v 1.1.2.2 2018/09/10 08:41:47 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: compat_10_mod.c,v 1.1.2.3 2018/09/13 22:53:52 pgoyette Exp $");
 
 #include 
 #include 
@@ -76,7 +76,7 @@ compat_10_modcmd(modcmd_t cmd, void *arg
 	case MODULE_CMD_INIT:
 		return compat_10_init();
 	case MODULE_CMD_FINI:
-		return compat_10_init();
+		return compat_10_fini();
 	default:
 		return ENOTTY;
 	}
Index: src/sys/compat/common/compat_14_mod.c
diff -u src/sys/compat/common/compat_14_mod.c:1.1.2.2 src/sys/compat/common/compat_14_mod.c:1.1.2.3
--- src/sys/compat/common/compat_14_mod.c:1.1.2.2	Mon Sep 10 08:41:47 2018
+++ src/sys/compat/common/compat_14_mod.c	Thu Sep 13 22:53:52 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: compat_14_mod.c,v 1.1.2.2 2018/09/10 08:41:47 pgoyette Exp $	*/
+/*	$NetBSD: compat_14_mod.c,v 1.1.2.3 2018/09/13 22:53:52 pgoyette Exp $	*/
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: compat_14_mod.c,v 1.1.2.2 2018/09/10 08:41:47 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: compat_14_mod.c,v 1.1.2.3 2018/09/13 22:53:52 pgoyette Exp $");
 
 #include 
 #include 
@@ -75,7 +75,7 @@ compat_14_modcmd(modcmd_t cmd, void *arg
 	case MODULE_CMD_INIT:
 		return compat_14_init();
 	case MODULE_CMD_FINI:
-		return compat_14_init();
+		return compat_14_fini();
 	default:
 		return ENOTTY;
 	}
Index: src/sys/compat/common/compat_16_mod.c
diff -u src/sys/compat/common/compat_16_mod.c:1.1.2.2 src/sys/compat/common/compat_16_mod.c:1.1.2.3
--- src/sys/compat/common/compat_16_mod.c:1.1.2.2	Mon Sep 10 08:41:47 2018
+++ src/sys/compat/common/compat_16_mod.c	Thu Sep 13 22:53:52 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: compat_16_mod.c,v 1.1.2.2 2018/09/10 08:41:47 pgoyette Exp $	*/
+/*	$NetBSD: compat_16_mod.c,v 1.1.2.3 2018/09/13 22:53:52 pgoyette Exp $	*/
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: compat_16_mod.c,v 1.1.2.2 2018/09/10 08:41:47 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: compat_16_mod.c,v 1.1.2.3 2018/09/13 

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

2018-09-13 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Thu Sep 13 23:33:56 UTC 2018

Modified Files:
src/sys/compat/common [pgoyette-compat]: kern_time_50.c

Log Message:
Remove duplicate syscall package entry for ntp_gettime30.  Duplicate
entries cause a panic when disestablishing, since when it looks at the
second entry it finds that the entrypoint doesn't match what's in the
package (it's alrady been reverted to sys_nosys() by the first entry.)


To generate a diff of this commit:
cvs rdiff -u -r1.31.16.2 -r1.31.16.3 src/sys/compat/common/kern_time_50.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/common/kern_time_50.c
diff -u src/sys/compat/common/kern_time_50.c:1.31.16.2 src/sys/compat/common/kern_time_50.c:1.31.16.3
--- src/sys/compat/common/kern_time_50.c:1.31.16.2	Tue Mar 20 08:11:25 2018
+++ src/sys/compat/common/kern_time_50.c	Thu Sep 13 23:33:56 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_time_50.c,v 1.31.16.2 2018/03/20 08:11:25 pgoyette Exp $	*/
+/*	$NetBSD: kern_time_50.c,v 1.31.16.3 2018/09/13 23:33:56 pgoyette Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_time_50.c,v 1.31.16.2 2018/03/20 08:11:25 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_time_50.c,v 1.31.16.3 2018/09/13 23:33:56 pgoyette Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_aio.h"
@@ -102,8 +102,6 @@ static const struct syscall_package kern
 	(sy_call_t *)compat_50_sys_timer_gettime },
 	{ SYS_compat_50___ntp_gettime30, 0,
 	(sy_call_t *)compat_50_sys___ntp_gettime30 },
-	{ SYS_compat_50___ntp_gettime30, 0,
-	(sy_call_t *)compat_50_sys___ntp_gettime30 },
 	{ 0, 0, NULL }
 }; 
 



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

2018-09-13 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Fri Sep 14 00:47:48 UTC 2018

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

Log Message:
Require coredump since netbsd32 module will be built with COREDUMP enabled.


To generate a diff of this commit:
cvs rdiff -u -r1.13.16.8 -r1.13.16.9 src/sys/compat/netbsd32/netbsd32_mod.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_mod.c
diff -u src/sys/compat/netbsd32/netbsd32_mod.c:1.13.16.8 src/sys/compat/netbsd32/netbsd32_mod.c:1.13.16.9
--- src/sys/compat/netbsd32/netbsd32_mod.c:1.13.16.8	Thu Sep 13 03:51:32 2018
+++ src/sys/compat/netbsd32/netbsd32_mod.c	Fri Sep 14 00:47:48 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_mod.c,v 1.13.16.8 2018/09/13 03:51:32 pgoyette Exp $	*/
+/*	$NetBSD: netbsd32_mod.c,v 1.13.16.9 2018/09/14 00:47:48 pgoyette Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_mod.c,v 1.13.16.8 2018/09/13 03:51:32 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_mod.c,v 1.13.16.9 2018/09/14 00:47:48 pgoyette Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_execfmt.h"
@@ -57,7 +57,7 @@ int compat32_80_modctl_compat_stub(struc
 int (*vec_compat32_80_modctl)(struct lwp *,
 const struct netbsd32_modctl_args *, register_t *);
 
-# define	DEPS1	"ksem,compat_util"
+# define	DEPS1	"ksem,coredump,compat_util"
 
 #if defined(EXEC_ELF32)
 # define	DEPS2	",exec_elf32"



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

2018-09-13 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Fri Sep 14 01:20:52 UTC 2018

Modified Files:
src/sys/compat/netbsd32 [pgoyette-compat]: syscalls.master

Log Message:
Make sigreturn14 MODULAR


To generate a diff of this commit:
cvs rdiff -u -r1.120.2.15 -r1.120.2.16 \
src/sys/compat/netbsd32/syscalls.master

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

Modified files:

Index: src/sys/compat/netbsd32/syscalls.master
diff -u src/sys/compat/netbsd32/syscalls.master:1.120.2.15 src/sys/compat/netbsd32/syscalls.master:1.120.2.16
--- src/sys/compat/netbsd32/syscalls.master:1.120.2.15	Thu Sep 13 03:49:46 2018
+++ src/sys/compat/netbsd32/syscalls.master	Fri Sep 14 01:20:52 2018
@@ -1,4 +1,4 @@
-	$NetBSD: syscalls.master,v 1.120.2.15 2018/09/13 03:49:46 pgoyette Exp $
+	$NetBSD: syscalls.master,v 1.120.2.16 2018/09/14 01:20:52 pgoyette Exp $
 
 ;	from: NetBSD: syscalls.master,v 1.81 1998/07/05 08:49:50 jonathan Exp
 ;	@(#)syscalls.master	8.2 (Berkeley) 1/13/94
@@ -687,7 +687,8 @@
 			netbsd32_sigsetp_t set, \
 			netbsd32_sigsetp_t oset); }
 294	STD		{ int|netbsd32|14|sigsuspend(netbsd32_sigsetp_t set); }
-295	COMPAT_16	{ int|netbsd32|14|sigreturn( \
+295	COMPAT_16 MODULAR compat_netbsd32_16	\
+			{ int|netbsd32|14|sigreturn( \
 			netbsd32_sigcontextp_t sigcntxp); }
 296	STD		{ int|netbsd32||__getcwd(netbsd32_charp bufp, \
 			netbsd32_size_t length); }



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

2018-09-13 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Fri Sep 14 01:21:34 UTC 2018

Modified Files:
src/sys/compat/netbsd32 [pgoyette-compat]: netbsd32_syscall.h
netbsd32_syscallargs.h netbsd32_syscalls.c
netbsd32_syscalls_autoload.c netbsd32_sysent.c
netbsd32_systrace_args.c

Log Message:
Regen


To generate a diff of this commit:
cvs rdiff -u -r1.134.2.12 -r1.134.2.13 \
src/sys/compat/netbsd32/netbsd32_syscall.h
cvs rdiff -u -r1.134.2.11 -r1.134.2.12 \
src/sys/compat/netbsd32/netbsd32_syscallargs.h
cvs rdiff -u -r1.132.2.12 -r1.132.2.13 \
src/sys/compat/netbsd32/netbsd32_syscalls.c
cvs rdiff -u -r1.13.2.11 -r1.13.2.12 \
src/sys/compat/netbsd32/netbsd32_syscalls_autoload.c
cvs rdiff -u -r1.132.2.11 -r1.132.2.12 \
src/sys/compat/netbsd32/netbsd32_sysent.c
cvs rdiff -u -r1.24.2.11 -r1.24.2.12 \
src/sys/compat/netbsd32/netbsd32_systrace_args.c

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

Modified files:

Index: src/sys/compat/netbsd32/netbsd32_syscall.h
diff -u src/sys/compat/netbsd32/netbsd32_syscall.h:1.134.2.12 src/sys/compat/netbsd32/netbsd32_syscall.h:1.134.2.13
--- src/sys/compat/netbsd32/netbsd32_syscall.h:1.134.2.12	Thu Sep 13 03:50:24 2018
+++ src/sys/compat/netbsd32/netbsd32_syscall.h	Fri Sep 14 01:21:34 2018
@@ -1,10 +1,10 @@
-/* $NetBSD: netbsd32_syscall.h,v 1.134.2.12 2018/09/13 03:50:24 pgoyette Exp $ */
+/* $NetBSD: netbsd32_syscall.h,v 1.134.2.13 2018/09/14 01:21:34 pgoyette Exp $ */
 
 /*
  * System call numbers.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * created from	NetBSD: syscalls.master,v 1.120.2.15 2018/09/13 03:49:46 pgoyette Exp
+ * created from	NetBSD: syscalls.master,v 1.120.2.16 2018/09/14 01:20:52 pgoyette Exp
  */
 
 #ifndef _NETBSD32_SYS_SYSCALL_H_

Index: src/sys/compat/netbsd32/netbsd32_syscallargs.h
diff -u src/sys/compat/netbsd32/netbsd32_syscallargs.h:1.134.2.11 src/sys/compat/netbsd32/netbsd32_syscallargs.h:1.134.2.12
--- src/sys/compat/netbsd32/netbsd32_syscallargs.h:1.134.2.11	Thu Sep 13 03:50:24 2018
+++ src/sys/compat/netbsd32/netbsd32_syscallargs.h	Fri Sep 14 01:21:34 2018
@@ -1,10 +1,10 @@
-/* $NetBSD: netbsd32_syscallargs.h,v 1.134.2.11 2018/09/13 03:50:24 pgoyette Exp $ */
+/* $NetBSD: netbsd32_syscallargs.h,v 1.134.2.12 2018/09/14 01:21:34 pgoyette Exp $ */
 
 /*
  * System call argument lists.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * created from	NetBSD: syscalls.master,v 1.120.2.15 2018/09/13 03:49:46 pgoyette Exp
+ * created from	NetBSD: syscalls.master,v 1.120.2.16 2018/09/14 01:20:52 pgoyette Exp
  */
 
 #ifndef _NETBSD32_SYS_SYSCALLARGS_H_

Index: src/sys/compat/netbsd32/netbsd32_syscalls.c
diff -u src/sys/compat/netbsd32/netbsd32_syscalls.c:1.132.2.12 src/sys/compat/netbsd32/netbsd32_syscalls.c:1.132.2.13
--- src/sys/compat/netbsd32/netbsd32_syscalls.c:1.132.2.12	Thu Sep 13 03:50:24 2018
+++ src/sys/compat/netbsd32/netbsd32_syscalls.c	Fri Sep 14 01:21:34 2018
@@ -1,14 +1,14 @@
-/* $NetBSD: netbsd32_syscalls.c,v 1.132.2.12 2018/09/13 03:50:24 pgoyette Exp $ */
+/* $NetBSD: netbsd32_syscalls.c,v 1.132.2.13 2018/09/14 01:21:34 pgoyette Exp $ */
 
 /*
  * System call names.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * created from	NetBSD: syscalls.master,v 1.120.2.15 2018/09/13 03:49:46 pgoyette Exp
+ * created from	NetBSD: syscalls.master,v 1.120.2.16 2018/09/14 01:20:52 pgoyette Exp
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_syscalls.c,v 1.132.2.12 2018/09/13 03:50:24 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_syscalls.c,v 1.132.2.13 2018/09/14 01:21:34 pgoyette Exp $");
 
 #if defined(_KERNEL_OPT)
 #if defined(_KERNEL_OPT)

Index: src/sys/compat/netbsd32/netbsd32_syscalls_autoload.c
diff -u src/sys/compat/netbsd32/netbsd32_syscalls_autoload.c:1.13.2.11 src/sys/compat/netbsd32/netbsd32_syscalls_autoload.c:1.13.2.12
--- src/sys/compat/netbsd32/netbsd32_syscalls_autoload.c:1.13.2.11	Thu Sep 13 03:50:24 2018
+++ src/sys/compat/netbsd32/netbsd32_syscalls_autoload.c	Fri Sep 14 01:21:34 2018
@@ -1,14 +1,14 @@
-/* $NetBSD: netbsd32_syscalls_autoload.c,v 1.13.2.11 2018/09/13 03:50:24 pgoyette Exp $ */
+/* $NetBSD: netbsd32_syscalls_autoload.c,v 1.13.2.12 2018/09/14 01:21:34 pgoyette Exp $ */
 
 /*
  * System call autoload table.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * created from	NetBSD: syscalls.master,v 1.120.2.15 2018/09/13 03:49:46 pgoyette Exp
+ * created from	NetBSD: syscalls.master,v 1.120.2.16 2018/09/14 01:20:52 pgoyette Exp
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_syscalls_autoload.c,v 1.13.2.11 2018/09/13 03:50:24 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_syscalls_autoload.c,v 1.13.2.12 2018/09/14 01:21:34 pgoyette Exp $");
 
 #include 
 static struct sc_autoload netbsd32_syscalls_autoload[] = {
@@ -117,6 +117,7 @@ static struct sc_autoload netbsd32_sysca
 	{ NETBSD32_SY

CVS commit: src/sys/external/bsd/drm

2018-09-13 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Fri Sep 14 01:43:45 UTC 2018

Modified Files:
src/sys/external/bsd/drm/conf: files.drm
Removed Files:
src/sys/external/bsd/drm/dist: libdrm.pc.in libdrm_intel.pc.in
src/sys/external/bsd/drm/dist/bsd-core: nouveau_drv.c nouveau_sgdma.c
src/sys/external/bsd/drm/dist/bsd-core/nouveau: Makefile
src/sys/external/bsd/drm/dist/libdrm: ChangeLog Makefile.am TODO
libdrm_lists.h xf86drm.c xf86drm.h xf86drmHash.c xf86drmMode.c
xf86drmMode.h xf86drmRandom.c xf86drmSL.c xf86mm.h
src/sys/external/bsd/drm/dist/libdrm/intel: Makefile.am intel_bufmgr.c
intel_bufmgr.h intel_bufmgr_fake.c intel_bufmgr_gem.c
intel_bufmgr_priv.h intel_chipset.h mm.c mm.h
src/sys/external/bsd/drm/dist/libdrm/nouveau: Makefile.am
libdrm_nouveau.pc.in nouveau_bo.c nouveau_bo.h nouveau_channel.c
nouveau_channel.h nouveau_class.h nouveau_device.c nouveau_device.h
nouveau_dma.c nouveau_dma.h nouveau_drmif.h nouveau_fence.c
nouveau_grobj.c nouveau_grobj.h nouveau_notifier.c
nouveau_notifier.h nouveau_private.h nouveau_pushbuf.c
nouveau_pushbuf.h nouveau_resource.c nouveau_resource.h
src/sys/external/bsd/drm/dist/shared-core: nouveau_dma.c nouveau_dma.h
nouveau_drm.h nouveau_drv.h nouveau_fifo.c nouveau_irq.c
nouveau_mem.c nouveau_notifier.c nouveau_object.c nouveau_reg.h
nouveau_state.c nouveau_swmthd.c nouveau_swmthd.h nv04_fb.c
nv04_fifo.c nv04_graph.c nv04_instmem.c nv04_mc.c nv04_timer.c
nv10_fb.c nv10_fifo.c nv10_graph.c nv20_graph.c nv40_fb.c
nv40_fifo.c nv40_graph.c nv40_mc.c nv50_fifo.c nv50_graph.c
nv50_grctx.h nv50_instmem.c nv50_mc.c
src/sys/external/bsd/drm/dist/tests: Makefile.am auth.c dristat.c
drmstat.c drmtest.c drmtest.h gem_basic.c gem_flink.c gem_mmap.c
gem_readwrite.c getclient.c getstats.c getversion.c lock.c
openclose.c setversion.c updatedraw.c
src/sys/external/bsd/drm/dist/tests/modeprint: Makefile.am modeprint.c
src/sys/external/bsd/drm/dist/tests/modetest: Makefile.am modetest.c
src/sys/external/bsd/drm/dist/tests/ttmtest: AUTHORS ChangeLog
Makefile.am NEWS README configure.ac reconf
src/sys/external/bsd/drm/dist/tests/ttmtest/src: Makefile.am ttmtest.c
xf86dri.c xf86dri.h xf86dristr.h

Log Message:
remove unused code:
- old drm nouveau was never ported
- the libdrm in this repo was never used
- these tests were never used, and this whole tree is obsolete, but
  we never ported some of the old drivers to new drm.

XXX: probably can delete i915drm.
XXX: would ike to delete old radeondrm, but it is still the only
 functional drm on some older radeon r100/r200 chipsets.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/external/bsd/drm/conf/files.drm
cvs rdiff -u -r1.1.1.1 -r0 src/sys/external/bsd/drm/dist/libdrm.pc.in \
src/sys/external/bsd/drm/dist/libdrm_intel.pc.in
cvs rdiff -u -r1.1.1.1 -r0 \
src/sys/external/bsd/drm/dist/bsd-core/nouveau_drv.c \
src/sys/external/bsd/drm/dist/bsd-core/nouveau_sgdma.c
cvs rdiff -u -r1.1.1.1 -r0 \
src/sys/external/bsd/drm/dist/bsd-core/nouveau/Makefile
cvs rdiff -u -r1.1.1.1 -r0 src/sys/external/bsd/drm/dist/libdrm/ChangeLog \
src/sys/external/bsd/drm/dist/libdrm/TODO \
src/sys/external/bsd/drm/dist/libdrm/libdrm_lists.h \
src/sys/external/bsd/drm/dist/libdrm/xf86drmHash.c \
src/sys/external/bsd/drm/dist/libdrm/xf86drmMode.h \
src/sys/external/bsd/drm/dist/libdrm/xf86drmRandom.c \
src/sys/external/bsd/drm/dist/libdrm/xf86drmSL.c
cvs rdiff -u -r1.1.1.2 -r0 src/sys/external/bsd/drm/dist/libdrm/Makefile.am \
src/sys/external/bsd/drm/dist/libdrm/xf86drm.h \
src/sys/external/bsd/drm/dist/libdrm/xf86mm.h
cvs rdiff -u -r1.4 -r0 src/sys/external/bsd/drm/dist/libdrm/xf86drm.c
cvs rdiff -u -r1.2 -r0 src/sys/external/bsd/drm/dist/libdrm/xf86drmMode.c
cvs rdiff -u -r1.1.1.1 -r0 \
src/sys/external/bsd/drm/dist/libdrm/intel/Makefile.am \
src/sys/external/bsd/drm/dist/libdrm/intel/intel_bufmgr.c \
src/sys/external/bsd/drm/dist/libdrm/intel/intel_bufmgr.h \
src/sys/external/bsd/drm/dist/libdrm/intel/intel_bufmgr_fake.c \
src/sys/external/bsd/drm/dist/libdrm/intel/intel_bufmgr_gem.c \
src/sys/external/bsd/drm/dist/libdrm/intel/intel_bufmgr_priv.h \
src/sys/external/bsd/drm/dist/libdrm/intel/intel_chipset.h \
src/sys/external/bsd/drm/dist/libdrm/intel/mm.c \
src/sys/external/bsd/drm/dist/libdrm/intel/mm.h
cvs rdiff -u -r1.1.1.1 -r0 \
src/sys/external/bsd/drm/dist/libdrm/nouveau/Makefile.am \
src/sys/external/bsd/drm/dist/libdrm/nouveau/libdrm_nouveau.pc.in \
src/sys/external/bsd/drm/dist/libdrm/nouveau/nouveau_bo.c \
src/sys/external/bsd/drm/dist/libdrm/nouveau/nouveau_b

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

2018-09-13 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Fri Sep 14 01:50:51 UTC 2018

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

Log Message:
fix a !MP build issue.


To generate a diff of this commit:
cvs rdiff -u -r1.128 -r1.129 src/sys/arch/x86/x86/intr.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/intr.c
diff -u src/sys/arch/x86/x86/intr.c:1.128 src/sys/arch/x86/x86/intr.c:1.129
--- src/sys/arch/x86/x86/intr.c:1.128	Mon Sep 10 05:08:55 2018
+++ src/sys/arch/x86/x86/intr.c	Fri Sep 14 01:50:51 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: intr.c,v 1.128 2018/09/10 05:08:55 cherry Exp $	*/
+/*	$NetBSD: intr.c,v 1.129 2018/09/14 01:50:51 mrg Exp $	*/
 
 /*
  * Copyright (c) 2007, 2008, 2009 The NetBSD Foundation, Inc.
@@ -133,7 +133,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.128 2018/09/10 05:08:55 cherry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.129 2018/09/14 01:50:51 mrg Exp $");
 
 #include "opt_intrdebug.h"
 #include "opt_multiprocessor.h"
@@ -1462,9 +1462,11 @@ cpu_intr_init(struct cpu_info *ci)
 {
 #if !defined(XEN)
 	struct intrsource *isp;
-#if NLAPIC > 0 && defined(MULTIPROCESSOR)
-	int i;
+#if NLAPIC > 0
 	static int first = 1;
+#if defined(MULTIPROCESSOR)
+	int i;
+#endif
 #endif
 
 #if NLAPIC > 0



CVS commit: src/sys

2018-09-13 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Fri Sep 14 01:55:20 UTC 2018

Modified Files:
src/sys/kern: files.kern
src/sys/rump/librump/rumpkern: Makefile.rumpkern
Added Files:
src/sys/kern: kern_reboot.c kern_scdebug.c

Log Message:
retire kern_xxx.c.  long live kern_xxx.c.

split it into kern_reboot.c and kern_scdebug.c.  while here,
add my copyright to kern_scdebug.c as it was largely rewritten
for kernhist support.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/kern/files.kern
cvs rdiff -u -r0 -r1.1 src/sys/kern/kern_reboot.c src/sys/kern/kern_scdebug.c
cvs rdiff -u -r1.170 -r1.171 src/sys/rump/librump/rumpkern/Makefile.rumpkern

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

Modified files:

Index: src/sys/kern/files.kern
diff -u src/sys/kern/files.kern:1.22 src/sys/kern/files.kern:1.23
--- src/sys/kern/files.kern:1.22	Mon Aug 20 11:35:28 2018
+++ src/sys/kern/files.kern	Fri Sep 14 01:55:19 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: files.kern,v 1.22 2018/08/20 11:35:28 maxv Exp $
+#	$NetBSD: files.kern,v 1.23 2018/09/14 01:55:19 mrg Exp $
 
 #
 # kernel sources
@@ -66,6 +66,7 @@ file	kern/kern_proc.c		kern
 file	kern/kern_prot.c		kern
 file	kern/kern_ras.c			kern
 file	kern/kern_rate.c		kern
+file	kern/kern_reboot.c		kern
 file	kern/kern_resource.c		kern
 file	kern/kern_rndpool.c		kern
 file	kern/kern_rndq.c		kern
@@ -73,6 +74,7 @@ file	kern/kern_rndsink.c		kern
 file	kern/kern_runq.c		kern
 file	kern/kern_rwlock.c		kern
 file	kern/kern_rwlock_obj.c		kern
+file	kern/kern_scdebug.c		kern
 file	kern/kern_sdt.c			kdtrace_hooks
 file	kern/kern_sig.c			kern
 file	kern/kern_sleepq.c		kern
@@ -90,7 +92,6 @@ file	kern/kern_turnstile.c		kern
 file	kern/kern_todr.c		kern
 file	kern/kern_uidinfo.c		kern
 file	kern/kern_uuid.c		kern
-file	kern/kern_xxx.c			kern
 file	kern/kgdb_stub.c		kgdb
 file	kern/sched_4bsd.c		sched_4bsd
 file	kern/sched_m2.c			sched_m2

Index: src/sys/rump/librump/rumpkern/Makefile.rumpkern
diff -u src/sys/rump/librump/rumpkern/Makefile.rumpkern:1.170 src/sys/rump/librump/rumpkern/Makefile.rumpkern:1.171
--- src/sys/rump/librump/rumpkern/Makefile.rumpkern:1.170	Tue Jul 25 05:01:25 2017
+++ src/sys/rump/librump/rumpkern/Makefile.rumpkern	Fri Sep 14 01:55:20 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.rumpkern,v 1.170 2017/07/25 05:01:25 ozaki-r Exp $
+#	$NetBSD: Makefile.rumpkern,v 1.171 2018/09/14 01:55:20 mrg Exp $
 #
 
 .include "${RUMPTOP}/Makefile.rump"
@@ -81,11 +81,13 @@ SRCS+=	init_sysctl_base.c	\
 	kern_proc.c		\
 	kern_prot.c		\
 	kern_rate.c		\
+	kern_reboot.c		\
 	kern_resource.c		\
 	kern_rndpool.c		\
 	kern_rndq.c		\
 	kern_rndsink.c		\
 	kern_rwlock_obj.c	\
+	kern_scdebug.c		\
 	kern_stub.c		\
 	kern_ssp.c		\
 	kern_syscall.c		\
@@ -94,7 +96,6 @@ SRCS+=	init_sysctl_base.c	\
 	kern_time.c		\
 	kern_timeout.c		\
 	kern_uidinfo.c		\
-	kern_xxx.c		\
 	param.c			\
 	subr_callback.c		\
 	subr_copy.c		\

Added files:

Index: src/sys/kern/kern_reboot.c
diff -u /dev/null src/sys/kern/kern_reboot.c:1.1
--- /dev/null	Fri Sep 14 01:55:20 2018
+++ src/sys/kern/kern_reboot.c	Fri Sep 14 01:55:19 2018
@@ -0,0 +1,76 @@
+/*	$NetBSD: kern_reboot.c,v 1.1 2018/09/14 01:55:19 mrg Exp $	*/
+
+/*
+ * Copyright (c) 1982, 1986, 1989, 1993
+ *	The Regents of the University of California.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the University nor the names of its contributors
+ *may be used to endorse or promote products derived from this software
+ *without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ *	@(#)kern_xxx.c	8.3 (Berkeley) 2/14/95
+ *	from: NetBSD: kern_xxx.c,v 1.74 2017/10/28 00:37:1

CVS commit: src/sys/netinet

2018-09-13 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Fri Sep 14 04:25:16 UTC 2018

Modified Files:
src/sys/netinet: tcp_input.c

Log Message:
rename off -> thlen


To generate a diff of this commit:
cvs rdiff -u -r1.409 -r1.410 src/sys/netinet/tcp_input.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/netinet/tcp_input.c
diff -u src/sys/netinet/tcp_input.c:1.409 src/sys/netinet/tcp_input.c:1.410
--- src/sys/netinet/tcp_input.c:1.409	Mon Sep  3 16:29:36 2018
+++ src/sys/netinet/tcp_input.c	Fri Sep 14 04:25:16 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: tcp_input.c,v 1.409 2018/09/03 16:29:36 riastradh Exp $	*/
+/*	$NetBSD: tcp_input.c,v 1.410 2018/09/14 04:25:16 maxv Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -148,7 +148,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: tcp_input.c,v 1.409 2018/09/03 16:29:36 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tcp_input.c,v 1.410 2018/09/14 04:25:16 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -1194,7 +1194,7 @@ tcp_input(struct mbuf *m, ...)
 #endif
 	u_long tiwin;
 	struct tcp_opt_info opti;
-	int off, iphlen;
+	int thlen, iphlen;
 	va_list ap;
 	int af;		/* af on the wire */
 	struct mbuf *tcp_saveti = NULL;
@@ -1327,21 +1327,21 @@ tcp_input(struct mbuf *m, ...)
 	 * Check that TCP offset makes sense, pull out TCP options and
 	 * adjust length.
 	 */
-	off = th->th_off << 2;
-	if (off < sizeof(struct tcphdr) || off > tlen) {
+	thlen = th->th_off << 2;
+	if (thlen < sizeof(struct tcphdr) || thlen > tlen) {
 		TCP_STATINC(TCP_STAT_RCVBADOFF);
 		goto drop;
 	}
-	tlen -= off;
+	tlen -= thlen;
 
-	if (off > sizeof(struct tcphdr)) {
-		M_REGION_GET(th, struct tcphdr *, m, toff, off);
+	if (thlen > sizeof(struct tcphdr)) {
+		M_REGION_GET(th, struct tcphdr *, m, toff, thlen);
 		if (th == NULL) {
 			TCP_STATINC(TCP_STAT_RCVSHORT);
 			return;
 		}
 		KASSERT(TCP_HDR_ALIGNED_P(th));
-		optlen = off - sizeof(struct tcphdr);
+		optlen = thlen - sizeof(struct tcphdr);
 		optp = ((u_int8_t *)th) + sizeof(struct tcphdr);
 
 		/*
@@ -1368,7 +1368,7 @@ tcp_input(struct mbuf *m, ...)
 	/*
 	 * Checksum extended TCP header and data
 	 */
-	if (tcp_input_checksum(af, m, th, toff, off, tlen))
+	if (tcp_input_checksum(af, m, th, toff, thlen, tlen))
 		goto badcsum;
 
 	/*
@@ -2020,7 +2020,7 @@ after_listen:
 	if (!sbreserve(&so->so_rcv,
 	newsize, so))
 		so->so_rcv.sb_flags &= ~SB_AUTOSIZE;
-m_adj(m, toff + off);
+m_adj(m, toff + thlen);
 sbappendstream(&so->so_rcv, m);
 			}
 			sorwakeup(so);
@@ -2039,7 +2039,7 @@ after_listen:
 	/*
 	 * Compute mbuf offset to TCP data segment.
 	 */
-	hdroptlen = toff + off;
+	hdroptlen = toff + thlen;
 
 	/*
 	 * Calculate amount of space in receive window. Receive window is



CVS commit: src/sys/netinet

2018-09-13 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Fri Sep 14 04:29:46 UTC 2018

Modified Files:
src/sys/netinet: tcp_input.c

Log Message:
rename toff -> off


To generate a diff of this commit:
cvs rdiff -u -r1.410 -r1.411 src/sys/netinet/tcp_input.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/netinet/tcp_input.c
diff -u src/sys/netinet/tcp_input.c:1.410 src/sys/netinet/tcp_input.c:1.411
--- src/sys/netinet/tcp_input.c:1.410	Fri Sep 14 04:25:16 2018
+++ src/sys/netinet/tcp_input.c	Fri Sep 14 04:29:46 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: tcp_input.c,v 1.410 2018/09/14 04:25:16 maxv Exp $	*/
+/*	$NetBSD: tcp_input.c,v 1.411 2018/09/14 04:29:46 maxv Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -148,7 +148,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: tcp_input.c,v 1.410 2018/09/14 04:25:16 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tcp_input.c,v 1.411 2018/09/14 04:29:46 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -1183,7 +1183,7 @@ tcp_input(struct mbuf *m, ...)
 #endif
 	u_int8_t *optp = NULL;
 	int optlen = 0;
-	int len, tlen, toff, hdroptlen = 0;
+	int len, tlen, off, hdroptlen = 0;
 	struct tcpcb *tp = NULL;
 	int tiflags;
 	struct socket *so = NULL;
@@ -1207,7 +1207,7 @@ tcp_input(struct mbuf *m, ...)
 
 	MCLAIM(m, &tcp_rx_mowner);
 	va_start(ap, m);
-	toff = va_arg(ap, int);
+	off = va_arg(ap, int);
 	(void)va_arg(ap, int);		/* ignore value, advance ap */
 	va_end(ap);
 
@@ -1237,7 +1237,7 @@ tcp_input(struct mbuf *m, ...)
 	}
 #endif
 
-	M_REGION_GET(th, struct tcphdr *, m, toff, sizeof(struct tcphdr));
+	M_REGION_GET(th, struct tcphdr *, m, off, sizeof(struct tcphdr));
 	if (th == NULL) {
 		TCP_STATINC(TCP_STAT_RCVSHORT);
 		return;
@@ -1262,7 +1262,7 @@ tcp_input(struct mbuf *m, ...)
 
 		/* We do the checksum after PCB lookup... */
 		len = ntohs(ip->ip_len);
-		tlen = len - toff;
+		tlen = len - off;
 		iptos = ip->ip_tos;
 		break;
 #ifdef INET6
@@ -1296,7 +1296,7 @@ tcp_input(struct mbuf *m, ...)
 
 		/* We do the checksum after PCB lookup... */
 		len = m->m_pkthdr.len;
-		tlen = len - toff;
+		tlen = len - off;
 		iptos = (ntohl(ip6->ip6_flow) >> 20) & 0xff;
 		break;
 #endif
@@ -1310,7 +1310,7 @@ tcp_input(struct mbuf *m, ...)
 	 * some cases, see kern/50766 for details.
 	 */
 	if (TCP_HDR_ALIGNED_P(th) == 0) {
-		m = m_copyup(m, toff + sizeof(struct tcphdr), 0);
+		m = m_copyup(m, off + sizeof(struct tcphdr), 0);
 		if (m == NULL) {
 			TCP_STATINC(TCP_STAT_RCVSHORT);
 			return;
@@ -1319,7 +1319,7 @@ tcp_input(struct mbuf *m, ...)
 #ifdef INET6
 		ip6 = mtod(m, struct ip6_hdr *);
 #endif
-		th = (struct tcphdr *)(mtod(m, char *) + toff);
+		th = (struct tcphdr *)(mtod(m, char *) + off);
 	}
 	KASSERT(TCP_HDR_ALIGNED_P(th));
 
@@ -1335,7 +1335,7 @@ tcp_input(struct mbuf *m, ...)
 	tlen -= thlen;
 
 	if (thlen > sizeof(struct tcphdr)) {
-		M_REGION_GET(th, struct tcphdr *, m, toff, thlen);
+		M_REGION_GET(th, struct tcphdr *, m, off, thlen);
 		if (th == NULL) {
 			TCP_STATINC(TCP_STAT_RCVSHORT);
 			return;
@@ -1368,7 +1368,7 @@ tcp_input(struct mbuf *m, ...)
 	/*
 	 * Checksum extended TCP header and data
 	 */
-	if (tcp_input_checksum(af, m, th, toff, thlen, tlen))
+	if (tcp_input_checksum(af, m, th, off, thlen, tlen))
 		goto badcsum;
 
 	/*
@@ -1743,7 +1743,7 @@ nosave:;
 			 * state for it.
 			 */
 			if (so->so_qlen <= so->so_qlimit &&
-			syn_cache_add(&src.sa, &dst.sa, th, toff,
+			syn_cache_add(&src.sa, &dst.sa, th, off,
 			so, m, optp, optlen, &opti))
 m = NULL;
 		}
@@ -1773,7 +1773,7 @@ after_listen:
 #else
 	if (optp)
 #endif
-		if (tcp_dooptions(tp, optp, optlen, th, m, toff, &opti) < 0)
+		if (tcp_dooptions(tp, optp, optlen, th, m, off, &opti) < 0)
 			goto drop;
 
 	if (TCP_SACK_ENABLED(tp)) {
@@ -2020,7 +2020,7 @@ after_listen:
 	if (!sbreserve(&so->so_rcv,
 	newsize, so))
 		so->so_rcv.sb_flags &= ~SB_AUTOSIZE;
-m_adj(m, toff + thlen);
+m_adj(m, off + thlen);
 sbappendstream(&so->so_rcv, m);
 			}
 			sorwakeup(so);
@@ -2039,7 +2039,7 @@ after_listen:
 	/*
 	 * Compute mbuf offset to TCP data segment.
 	 */
-	hdroptlen = toff + thlen;
+	hdroptlen = off + thlen;
 
 	/*
 	 * Calculate amount of space in receive window. Receive window is



CVS commit: src/sys

2018-09-13 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Fri Sep 14 05:09:51 UTC 2018

Modified Files:
src/sys/dist/pf/net: if_pfsync.c if_pfsync.h
src/sys/netinet: dccp_usrreq.c dccp_var.h igmp.c igmp_var.h in_proto.c
ip_carp.c ip_carp.h ip_encap.c ip_encap.h ip_icmp.c ip_icmp.h
ip_mroute.c ip_var.h pim_var.h raw_ip.c sctp_input.c sctp_var.h
tcp_input.c tcp_var.h udp_usrreq.c udp_var.h
src/sys/netipsec: ipsec.h ipsec_input.c
src/sys/sys: protosw.h

Log Message:
Use non-variadic function pointer in protosw::pr_input.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/dist/pf/net/if_pfsync.c
cvs rdiff -u -r1.3 -r1.4 src/sys/dist/pf/net/if_pfsync.h
cvs rdiff -u -r1.19 -r1.20 src/sys/netinet/dccp_usrreq.c
cvs rdiff -u -r1.4 -r1.5 src/sys/netinet/dccp_var.h
cvs rdiff -u -r1.68 -r1.69 src/sys/netinet/igmp.c
cvs rdiff -u -r1.24 -r1.25 src/sys/netinet/igmp_var.h \
src/sys/netinet/ip_encap.h
cvs rdiff -u -r1.129 -r1.130 src/sys/netinet/in_proto.c
cvs rdiff -u -r1.99 -r1.100 src/sys/netinet/ip_carp.c
cvs rdiff -u -r1.9 -r1.10 src/sys/netinet/ip_carp.h
cvs rdiff -u -r1.69 -r1.70 src/sys/netinet/ip_encap.c
cvs rdiff -u -r1.173 -r1.174 src/sys/netinet/ip_icmp.c
cvs rdiff -u -r1.39 -r1.40 src/sys/netinet/ip_icmp.h
cvs rdiff -u -r1.162 -r1.163 src/sys/netinet/ip_mroute.c
cvs rdiff -u -r1.126 -r1.127 src/sys/netinet/ip_var.h
cvs rdiff -u -r1.3 -r1.4 src/sys/netinet/pim_var.h
cvs rdiff -u -r1.177 -r1.178 src/sys/netinet/raw_ip.c
cvs rdiff -u -r1.10 -r1.11 src/sys/netinet/sctp_input.c
cvs rdiff -u -r1.2 -r1.3 src/sys/netinet/sctp_var.h
cvs rdiff -u -r1.411 -r1.412 src/sys/netinet/tcp_input.c
cvs rdiff -u -r1.188 -r1.189 src/sys/netinet/tcp_var.h
cvs rdiff -u -r1.255 -r1.256 src/sys/netinet/udp_usrreq.c
cvs rdiff -u -r1.44 -r1.45 src/sys/netinet/udp_var.h
cvs rdiff -u -r1.82 -r1.83 src/sys/netipsec/ipsec.h
cvs rdiff -u -r1.70 -r1.71 src/sys/netipsec/ipsec_input.c
cvs rdiff -u -r1.68 -r1.69 src/sys/sys/protosw.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/dist/pf/net/if_pfsync.c
diff -u src/sys/dist/pf/net/if_pfsync.c:1.17 src/sys/dist/pf/net/if_pfsync.c:1.18
--- src/sys/dist/pf/net/if_pfsync.c:1.17	Wed Jun 27 03:31:44 2018
+++ src/sys/dist/pf/net/if_pfsync.c	Fri Sep 14 05:09:51 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_pfsync.c,v 1.17 2018/06/27 03:31:44 msaitoh Exp $	*/
+/*	$NetBSD: if_pfsync.c,v 1.18 2018/09/14 05:09:51 maxv Exp $	*/
 /*	$OpenBSD: if_pfsync.c,v 1.83 2007/06/26 14:44:12 mcbride Exp $	*/
 
 /*
@@ -28,7 +28,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_pfsync.c,v 1.17 2018/06/27 03:31:44 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_pfsync.c,v 1.18 2018/09/14 05:09:51 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -348,7 +348,7 @@ pfsync_insert_net_state(struct pfsync_st
 }
 
 void
-pfsync_input(struct mbuf *m, ...)
+pfsync_input(struct mbuf *m, int off, int proto)
 {
 	struct ip *ip = mtod(m, struct ip *);
 	struct pfsync_header *ph;

Index: src/sys/dist/pf/net/if_pfsync.h
diff -u src/sys/dist/pf/net/if_pfsync.h:1.3 src/sys/dist/pf/net/if_pfsync.h:1.4
--- src/sys/dist/pf/net/if_pfsync.h:1.3	Mon Sep 14 10:36:49 2009
+++ src/sys/dist/pf/net/if_pfsync.h	Fri Sep 14 05:09:51 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_pfsync.h,v 1.3 2009/09/14 10:36:49 degroote Exp $	*/
+/*	$NetBSD: if_pfsync.h,v 1.4 2018/09/14 05:09:51 maxv Exp $	*/
 /*	$OpenBSD: if_pfsync.h,v 1.31 2007/05/31 04:11:42 mcbride Exp $	*/
 
 /*
@@ -253,7 +253,7 @@ struct pfsyncreq {
 } while (0)
 
 #ifdef _KERNEL
-void pfsync_input(struct mbuf *, ...);
+void pfsync_input(struct mbuf *, int, int);
 int pfsync_clear_states(u_int32_t, char *);
 int pfsync_pack_state(u_int8_t, struct pf_state *, int);
 #define pfsync_insert_state(st)	do {\

Index: src/sys/netinet/dccp_usrreq.c
diff -u src/sys/netinet/dccp_usrreq.c:1.19 src/sys/netinet/dccp_usrreq.c:1.20
--- src/sys/netinet/dccp_usrreq.c:1.19	Fri May 18 18:58:51 2018
+++ src/sys/netinet/dccp_usrreq.c	Fri Sep 14 05:09:51 2018
@@ -1,5 +1,5 @@
 /*	$KAME: dccp_usrreq.c,v 1.67 2005/11/03 16:05:04 nishida Exp $	*/
-/*	$NetBSD: dccp_usrreq.c,v 1.19 2018/05/18 18:58:51 maxv Exp $ */
+/*	$NetBSD: dccp_usrreq.c,v 1.20 2018/09/14 05:09:51 maxv Exp $ */
 
 /*
  * Copyright (c) 2003 Joacim Häggmark, Magnus Erixzon, Nils-Erik Mattsson 
@@ -67,7 +67,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: dccp_usrreq.c,v 1.19 2018/05/18 18:58:51 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dccp_usrreq.c,v 1.20 2018/09/14 05:09:51 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -181,7 +181,7 @@ dccp_init(void)
 }
 
 void
-dccp_input(struct mbuf *m, ...)
+dccp_input(struct mbuf *m, int off, int proto)
 {
 	int iphlen;
 	struct ip *ip = NULL;
@@ -210,12 +210,7 @@ dccp_input(struct mbuf *m, ...)
 	struct ip6_hdr *ip6 = NULL;
 #endif
 
-	int off;
-	va_list ap;
-	
-	va_start(ap, m);
-	iphlen = off = va_arg(a

CVS commit: src/sys/external/bsd/drm2/dist/drm

2018-09-13 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Fri Sep 14 05:31:14 UTC 2018

Modified Files:
src/sys/external/bsd/drm2/dist/drm: drm_ioctl.c

Log Message:
copy the output from the temp buffer to the actual one on return.

Fixes crashes with updated xf86-video-intel / mesa 18
from riastradh.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/external/bsd/drm2/dist/drm/drm_ioctl.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/external/bsd/drm2/dist/drm/drm_ioctl.c
diff -u src/sys/external/bsd/drm2/dist/drm/drm_ioctl.c:1.10 src/sys/external/bsd/drm2/dist/drm/drm_ioctl.c:1.11
--- src/sys/external/bsd/drm2/dist/drm/drm_ioctl.c:1.10	Tue Aug 28 03:41:38 2018
+++ src/sys/external/bsd/drm2/dist/drm/drm_ioctl.c	Fri Sep 14 05:31:14 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: drm_ioctl.c,v 1.10 2018/08/28 03:41:38 riastradh Exp $	*/
+/*	$NetBSD: drm_ioctl.c,v 1.11 2018/09/14 05:31:14 maya Exp $	*/
 
 /*
  * Created: Fri Jan  8 09:01:26 1999 by fa...@valinux.com
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: drm_ioctl.c,v 1.10 2018/08/28 03:41:38 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: drm_ioctl.c,v 1.11 2018/09/14 05:31:14 maya Exp $");
 
 #include 
 #include 
@@ -703,6 +703,7 @@ drm_ioctl(struct file *fp, unsigned long
 {
 	char stackbuf[128];
 	char *buf = stackbuf;
+	void *data0 = data;
 	struct drm_file *const file = fp->f_data;
 	const unsigned int nr = DRM_IOCTL_NR(cmd);
 	int error;
@@ -761,20 +762,24 @@ drm_ioctl(struct file *fp, unsigned long
 		memcpy(buf, data, IOCPARM_LEN(cmd));
 		memset(buf + IOCPARM_LEN(cmd), 0,
 		IOCPARM_LEN(ioctl->cmd) - IOCPARM_LEN(cmd));
-		data = buf;
+		data0 = buf;
 	}
 
 	if ((drm_core_check_feature(dev, DRIVER_MODESET) && is_driver_ioctl) ||
 	ISSET(ioctl->flags, DRM_UNLOCKED)) {
 		/* XXX errno Linux->NetBSD */
-		error = -(*ioctl->func)(dev, data, file);
+		error = -(*ioctl->func)(dev, data0, file);
 	} else {
 		mutex_lock(&drm_global_mutex);
 		/* XXX errno Linux->NetBSD */
-		error = -(*ioctl->func)(dev, data, file);
+		error = -(*ioctl->func)(dev, data0, file);
 		mutex_unlock(&drm_global_mutex);
 	}
 
+	/* If we used a temporary buffer, copy it back out.  */
+	if (data != data0)
+		memcpy(data, data0, IOCPARM_LEN(cmd));
+
 	/* If we had to allocate a heap buffer, free it.  */
 	if (buf != stackbuf)
 		kmem_free(buf, IOCPARM_LEN(ioctl->cmd));



CVS commit: src/sys/arch/aarch64/aarch64

2018-09-13 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Fri Sep 14 05:33:50 UTC 2018

Modified Files:
src/sys/arch/aarch64/aarch64: vectors.S

Log Message:
use ENTRY_NP to avoid added _PROF_PROLOGUE.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/aarch64/aarch64/vectors.S

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

Modified files:

Index: src/sys/arch/aarch64/aarch64/vectors.S
diff -u src/sys/arch/aarch64/aarch64/vectors.S:1.7 src/sys/arch/aarch64/aarch64/vectors.S:1.8
--- src/sys/arch/aarch64/aarch64/vectors.S:1.7	Mon Jul 30 15:59:44 2018
+++ src/sys/arch/aarch64/aarch64/vectors.S	Fri Sep 14 05:33:50 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: vectors.S,v 1.7 2018/07/30 15:59:44 ryo Exp $	*/
+/*	$NetBSD: vectors.S,v 1.8 2018/09/14 05:33:50 ryo Exp $	*/
 
 #include 
 #include "assym.h"
@@ -78,7 +78,7 @@
 
 
 	.align 11	/* vector table must be aligned 2048 */
-ENTRY(el1_vectors)
+ENTRY_NP(el1_vectors)
 /*
  * Exception taken from current Exception Level with SP_EL0.
  * (These shouldn't happen)



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

2018-09-13 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Fri Sep 14 05:37:42 UTC 2018

Modified Files:
src/sys/arch/aarch64/include: vmparam.h

Log Message:
define VM_KERNEL_IO_SIZE for clarity


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

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

Modified files:

Index: src/sys/arch/aarch64/include/vmparam.h
diff -u src/sys/arch/aarch64/include/vmparam.h:1.5 src/sys/arch/aarch64/include/vmparam.h:1.6
--- src/sys/arch/aarch64/include/vmparam.h:1.5	Fri Sep  7 17:21:38 2018
+++ src/sys/arch/aarch64/include/vmparam.h	Fri Sep 14 05:37:42 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: vmparam.h,v 1.5 2018/09/07 17:21:38 jmcneill Exp $ */
+/* $NetBSD: vmparam.h,v 1.6 2018/09/14 05:37:42 ryo Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -131,6 +131,7 @@
  * see also aarch64/pmap.c:pmap_devmap_*
  */
 #define VM_KERNEL_IO_ADDRESS	0xf000L
+#define VM_KERNEL_IO_SIZE	(VM_MAX_KERNEL_ADDRESS - VM_KERNEL_IO_ADDRESS)
 
 /* virtual sizes (bytes) for various kernel submaps */
 #define USRIOSIZE		(PAGE_SIZE / 8)



CVS commit: [pgoyette-compat] src/sys

2018-09-13 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Fri Sep 14 05:37:08 UTC 2018

Modified Files:
src/sys/arch/amd64/amd64 [pgoyette-compat]: netbsd32_machdep.c
src/sys/compat/netbsd32 [pgoyette-compat]: netbsd32_compat_16.c
netbsd32_mod.c
src/sys/modules/compat_netbsd32 [pgoyette-compat]: Makefile
src/sys/modules/compat_netbsd32_13 [pgoyette-compat]: Makefile
src/sys/modules/compat_netbsd32_16 [pgoyette-compat]: Makefile
Added Files:
src/sys/arch/amd64/amd64 [pgoyette-compat]: netbsd32_machdep_13.c
netbsd32_machdep_16.c

Log Message:
Work in progress - get the arch-specific netbsd32_machdep.c code to
build as a module.

XXX Doesn't work when the code is built-in to the kernel.


To generate a diff of this commit:
cvs rdiff -u -r1.115.2.1 -r1.115.2.2 \
src/sys/arch/amd64/amd64/netbsd32_machdep.c
cvs rdiff -u -r0 -r1.1.2.1 src/sys/arch/amd64/amd64/netbsd32_machdep_13.c \
src/sys/arch/amd64/amd64/netbsd32_machdep_16.c
cvs rdiff -u -r1.1.2.1 -r1.1.2.2 src/sys/compat/netbsd32/netbsd32_compat_16.c
cvs rdiff -u -r1.13.16.9 -r1.13.16.10 src/sys/compat/netbsd32/netbsd32_mod.c
cvs rdiff -u -r1.20.12.10 -r1.20.12.11 \
src/sys/modules/compat_netbsd32/Makefile
cvs rdiff -u -r1.1.2.3 -r1.1.2.4 src/sys/modules/compat_netbsd32_13/Makefile
cvs rdiff -u -r1.1.2.1 -r1.1.2.2 src/sys/modules/compat_netbsd32_16/Makefile

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

Modified files:

Index: src/sys/arch/amd64/amd64/netbsd32_machdep.c
diff -u src/sys/arch/amd64/amd64/netbsd32_machdep.c:1.115.2.1 src/sys/arch/amd64/amd64/netbsd32_machdep.c:1.115.2.2
--- src/sys/arch/amd64/amd64/netbsd32_machdep.c:1.115.2.1	Sat Jul 28 04:37:26 2018
+++ src/sys/arch/amd64/amd64/netbsd32_machdep.c	Fri Sep 14 05:37:08 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_machdep.c,v 1.115.2.1 2018/07/28 04:37:26 pgoyette Exp $	*/
+/*	$NetBSD: netbsd32_machdep.c,v 1.115.2.2 2018/09/14 05:37:08 pgoyette Exp $	*/
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.115.2.1 2018/07/28 04:37:26 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.115.2.2 2018/09/14 05:37:08 pgoyette Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -101,7 +101,12 @@ static int x86_64_set_mtrr32(struct lwp 
 #define x86_64_set_mtrr32(x, y, z)	ENOSYS
 #endif
 
-static int check_sigcontext32(struct lwp *, const struct netbsd32_sigcontext *);
+int check_sigcontext32(struct lwp *, const struct netbsd32_sigcontext *);
+
+void  netbsd32_buildcontext(struct lwp *l, struct trapframe *tf, void *fp,
+sig_t catcher, int onstack);
+
+void netbsd32_sendsig_siginfo(const ksiginfo_t *, const sigset_t *);
 
 #ifdef EXEC_AOUT
 /*
@@ -160,7 +165,7 @@ netbsd32_setregs(struct lwp *l, struct e
 	tf->tf_ss = LSEL(LUDATA32_SEL, SEL_UPL);
 }
 
-static void
+void
 netbsd32_buildcontext(struct lwp *l, struct trapframe *tf, void *fp,
 sig_t catcher, int onstack)
 {
@@ -197,96 +202,7 @@ netbsd32_buildcontext(struct lwp *l, str
 	}
 }
 
-#ifdef COMPAT_16
-static void
-netbsd32_sendsig_sigcontext(const ksiginfo_t *ksi, const sigset_t *mask)
-{
-	struct lwp *l = curlwp;
-	struct proc *p = l->l_proc;
-	struct trapframe *tf;
-	int sig = ksi->ksi_signo;
-	sig_t catcher = SIGACTION(p, sig).sa_handler;
-	struct netbsd32_sigframe_sigcontext *fp, frame;
-	int onstack, error;
-	struct sigacts *ps = p->p_sigacts;
-
-	tf = l->l_md.md_regs;
-
-	/* 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;
-
-	/* Allocate space for the signal handler context. */
-	if (onstack)
-		fp = (struct netbsd32_sigframe_sigcontext *)
-		((char *)l->l_sigstk.ss_sp + l->l_sigstk.ss_size);
-	else
-		fp = (struct netbsd32_sigframe_sigcontext *)tf->tf_rsp;
-	fp--;
-
-	/* Build stack frame for signal trampoline. */
-	switch (ps->sa_sigdesc[sig].sd_vers) {
-	case 0:
-		frame.sf_ra = (uint32_t)(u_long)p->p_sigctx.ps_sigcode;
-		break;
-	case 1:
-		frame.sf_ra = (uint32_t)(u_long)ps->sa_sigdesc[sig].sd_tramp;
-		break;
-	default:
-		/* Don't know what trampoline version; kill it. */
-		sigexit(l, SIGILL);
-	}
-	frame.sf_signum = sig;
-	frame.sf_code = ksi->ksi_trap;
-	frame.sf_scp = (uint32_t)(u_long)&fp->sf_sc;
-
-	frame.sf_sc.sc_ds = tf->tf_ds & 0x;
-	frame.sf_sc.sc_es = tf->tf_es & 0x;
-	frame.sf_sc.sc_fs = tf->tf_fs & 0x;
-	frame.sf_sc.sc_gs = tf->tf_gs & 0x;
-
-	frame.sf_sc.sc_eflags = tf->tf_rflags;
-	frame.sf_sc.sc_edi = tf->tf_rdi;
-	frame.sf_sc.sc_esi = tf->tf_rsi;
-	frame.sf_sc.sc_ebp = tf->tf_rbp;
-	frame.sf_sc.sc_ebx = tf->tf_rbx;
-	frame.sf_sc.sc_edx = tf->tf_rdx;
-	frame.sf_sc.sc_ecx = tf->tf_rcx;
-	frame.sf_sc.sc_eax = tf->tf_rax;
-	frame.sf_sc.sc_eip = tf->tf_rip;
-	frame.sf_sc.sc_cs = tf->tf_cs & 0x;
-	frame.s

CVS commit: src/bin/sh/USD.doc

2018-09-13 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Sep 14 05:59:10 UTC 2018

Modified Files:
src/bin/sh/USD.doc: Rv7man

Log Message:
Fix "every" typo in quote from The Mythical Man-Month


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/bin/sh/USD.doc/Rv7man

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

Modified files:

Index: src/bin/sh/USD.doc/Rv7man
diff -u src/bin/sh/USD.doc/Rv7man:1.1 src/bin/sh/USD.doc/Rv7man:1.2
--- src/bin/sh/USD.doc/Rv7man:1.1	Sun Aug 22 01:58:16 2010
+++ src/bin/sh/USD.doc/Rv7man	Fri Sep 14 05:59:10 2018
@@ -342,7 +342,7 @@ problems of large projects, from someone
 Required reading for any software engineer, even if conclusions may not
 always be agreed with.
 %br
-"The second is the most dangerous system a man every designs." p.55.
+"The second is the most dangerous system a man ever designs." p.55.
 %br
 "Hence plan to throw one away; you will, anyhow." p.116.
 %br



CVS commit: [pgoyette-compat] src/doc

2018-09-13 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Fri Sep 14 06:21:17 UTC 2018

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

Log Message:
Add entry for the need to use localcount(9) to protect removal of
vectored routine pointers.

Thanks riastradh@


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.3 -r1.1.2.4 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.3 src/doc/TODO.compat-module:1.1.2.4
--- src/doc/TODO.compat-module:1.1.2.3	Tue Sep 11 08:42:45 2018
+++ src/doc/TODO.compat-module	Fri Sep 14 06:21:17 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: TODO.compat-module,v 1.1.2.3 2018/09/11 08:42:45 pgoyette Exp $ */
+/* $NetBSD: TODO.compat-module,v 1.1.2.4 2018/09/14 06:21:17 pgoyette Exp $ */
 
 DONE
 
@@ -50,6 +50,11 @@ TODO - Required for branch merge
 also the compat_netbsd32_sysv module) with individual modules.  Update
 dependencies accordingly.
 
+2.  Wherever we have vectors function calls, we need to protect all uses
+of the vector using localcount(9).  And when unloading a module, we
+need to localcount_drain() after replacing the function pointer but
+before letting the module disappear.
+
 
 TODO - Not required for branch merge