CVS commit: src/sys

2019-08-13 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Wed Aug 14 03:44:58 UTC 2019

Modified Files:
src/sys/dev/usb: if_axe.c if_axen.c if_cdce.c if_smsc.c if_udav.c
if_ure.c if_urndis.c usbnet.c usbnet.h
src/sys/sys: param.h

Log Message:
introduce usbnet_set_dying().  will be used by url(4) conversion.
bump version.

introduce USBNET_MODULE() that encompasses almost all the module
specific code for usbnet modules.  they still need to include
the relevant ioconf.c, but everything else is now just, eg,

USBNET_MODULE(axen)


To generate a diff of this commit:
cvs rdiff -u -r1.113 -r1.114 src/sys/dev/usb/if_axe.c
cvs rdiff -u -r1.62 -r1.63 src/sys/dev/usb/if_axen.c
cvs rdiff -u -r1.64 -r1.65 src/sys/dev/usb/if_cdce.c
cvs rdiff -u -r1.56 -r1.57 src/sys/dev/usb/if_smsc.c
cvs rdiff -u -r1.66 -r1.67 src/sys/dev/usb/if_udav.c
cvs rdiff -u -r1.25 -r1.26 src/sys/dev/usb/if_ure.c
cvs rdiff -u -r1.29 -r1.30 src/sys/dev/usb/if_urndis.c
cvs rdiff -u -r1.13 -r1.14 src/sys/dev/usb/usbnet.c
cvs rdiff -u -r1.10 -r1.11 src/sys/dev/usb/usbnet.h
cvs rdiff -u -r1.606 -r1.607 src/sys/sys/param.h

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



CVS commit: src/sys

2019-08-13 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Wed Aug 14 03:44:58 UTC 2019

Modified Files:
src/sys/dev/usb: if_axe.c if_axen.c if_cdce.c if_smsc.c if_udav.c
if_ure.c if_urndis.c usbnet.c usbnet.h
src/sys/sys: param.h

Log Message:
introduce usbnet_set_dying().  will be used by url(4) conversion.
bump version.

introduce USBNET_MODULE() that encompasses almost all the module
specific code for usbnet modules.  they still need to include
the relevant ioconf.c, but everything else is now just, eg,

USBNET_MODULE(axen)


To generate a diff of this commit:
cvs rdiff -u -r1.113 -r1.114 src/sys/dev/usb/if_axe.c
cvs rdiff -u -r1.62 -r1.63 src/sys/dev/usb/if_axen.c
cvs rdiff -u -r1.64 -r1.65 src/sys/dev/usb/if_cdce.c
cvs rdiff -u -r1.56 -r1.57 src/sys/dev/usb/if_smsc.c
cvs rdiff -u -r1.66 -r1.67 src/sys/dev/usb/if_udav.c
cvs rdiff -u -r1.25 -r1.26 src/sys/dev/usb/if_ure.c
cvs rdiff -u -r1.29 -r1.30 src/sys/dev/usb/if_urndis.c
cvs rdiff -u -r1.13 -r1.14 src/sys/dev/usb/usbnet.c
cvs rdiff -u -r1.10 -r1.11 src/sys/dev/usb/usbnet.h
cvs rdiff -u -r1.606 -r1.607 src/sys/sys/param.h

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

Modified files:

Index: src/sys/dev/usb/if_axe.c
diff -u src/sys/dev/usb/if_axe.c:1.113 src/sys/dev/usb/if_axe.c:1.114
--- src/sys/dev/usb/if_axe.c:1.113	Sun Aug 11 23:55:43 2019
+++ src/sys/dev/usb/if_axe.c	Wed Aug 14 03:44:58 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_axe.c,v 1.113 2019/08/11 23:55:43 mrg Exp $	*/
+/*	$NetBSD: if_axe.c,v 1.114 2019/08/14 03:44:58 mrg Exp $	*/
 /*	$OpenBSD: if_axe.c,v 1.137 2016/04/13 11:03:37 mpi Exp $ */
 
 /*
@@ -87,7 +87,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_axe.c,v 1.113 2019/08/11 23:55:43 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_axe.c,v 1.114 2019/08/14 03:44:58 mrg Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -95,11 +95,6 @@ __KERNEL_RCSID(0, "$NetBSD: if_axe.c,v 1
 #endif
 
 #include 
-#include 
-#include 
-#include 
-#include 
-#include 
 
 #include 
 #include 
@@ -1391,31 +1386,8 @@ axe_stop(struct ifnet *ifp, int disable)
 	usbnet_unlock_mii_un_locked(un);
 }
 
-MODULE(MODULE_CLASS_DRIVER, if_axe, "usbnet");
-
 #ifdef _MODULE
 #include "ioconf.c"
 #endif
 
-static int
-if_axe_modcmd(modcmd_t cmd, void *aux)
-{
-	int error = 0;
-
-	switch (cmd) {
-	case MODULE_CMD_INIT:
-#ifdef _MODULE
-		error = config_init_component(cfdriver_ioconf_axe,
-		cfattach_ioconf_axe, cfdata_ioconf_axe);
-#endif
-		return error;
-	case MODULE_CMD_FINI:
-#ifdef _MODULE
-		error = config_fini_component(cfdriver_ioconf_axe,
-		cfattach_ioconf_axe, cfdata_ioconf_axe);
-#endif
-		return error;
-	default:
-		return ENOTTY;
-	}
-}
+USBNET_MODULE(axe)

Index: src/sys/dev/usb/if_axen.c
diff -u src/sys/dev/usb/if_axen.c:1.62 src/sys/dev/usb/if_axen.c:1.63
--- src/sys/dev/usb/if_axen.c:1.62	Sun Aug 11 08:57:36 2019
+++ src/sys/dev/usb/if_axen.c	Wed Aug 14 03:44:58 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_axen.c,v 1.62 2019/08/11 08:57:36 skrll Exp $	*/
+/*	$NetBSD: if_axen.c,v 1.63 2019/08/14 03:44:58 mrg Exp $	*/
 /*	$OpenBSD: if_axen.c,v 1.3 2013/10/21 10:10:22 yuo Exp $	*/
 
 /*
@@ -23,14 +23,13 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_axen.c,v 1.62 2019/08/11 08:57:36 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_axen.c,v 1.63 2019/08/14 03:44:58 mrg Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
 #endif
 
 #include 
-#include 
 
 #include 		/* XXX for netinet/ip.h */
 #include 		/* XXX for IP_MAXPACKET */
@@ -969,31 +968,8 @@ axen_stop_cb(struct ifnet *ifp, int disa
 	usbnet_unlock_mii_un_locked(un);
 }
 
-MODULE(MODULE_CLASS_DRIVER, if_axen, "usbnet");
-
 #ifdef _MODULE
 #include "ioconf.c"
 #endif
 
-static int
-if_axen_modcmd(modcmd_t cmd, void *aux)
-{
-	int error = 0;
-
-	switch (cmd) {
-	case MODULE_CMD_INIT:
-#ifdef _MODULE
-		error = config_init_component(cfdriver_ioconf_axen,
-		cfattach_ioconf_axen, cfdata_ioconf_axen);
-#endif
-		return error;
-	case MODULE_CMD_FINI:
-#ifdef _MODULE
-		error = config_fini_component(cfdriver_ioconf_axen,
-		cfattach_ioconf_axen, cfdata_ioconf_axen);
-#endif
-		return error;
-	default:
-		return ENOTTY;
-	}
-}
+USBNET_MODULE(axen)

Index: src/sys/dev/usb/if_cdce.c
diff -u src/sys/dev/usb/if_cdce.c:1.64 src/sys/dev/usb/if_cdce.c:1.65
--- src/sys/dev/usb/if_cdce.c:1.64	Mon Aug 12 08:52:39 2019
+++ src/sys/dev/usb/if_cdce.c	Wed Aug 14 03:44:58 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_cdce.c,v 1.64 2019/08/12 08:52:39 skrll Exp $ */
+/*	$NetBSD: if_cdce.c,v 1.65 2019/08/14 03:44:58 mrg Exp $ */
 
 /*
  * Copyright (c) 1997, 1998, 1999, 2000-2003 Bill Paul 
@@ -40,10 +40,9 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_cdce.c,v 1.64 2019/08/12 08:52:39 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_cdce.c,v 1.65 2019/08/14 03:44:58 mrg Exp $");
 
 #include 
-#include 
 
 #include 
 #include 
@@ -202,7 +201,7 @@ cdce_attach(device_t parent, device_t se
 		}
 		/* Find 

CVS commit: src

2019-08-13 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Wed Aug 14 01:42:08 UTC 2019

Modified Files:
src/distrib/sets/lists/base: md.amd64 mi
src/distrib/sets/lists/comp: mi
src/etc/mtree: NetBSD.dist.base
src/external/bsd: Makefile

Log Message:
Add LLVM sanitizers in the MKLLVM=yes build

Enable in all the supported variations for NetBSD/amd64:

 - Address Sanitizer
 - Thread Sanitizer
 - Memory Sanitizer
 - Undefined Behavior Sanitizer
 - SafeStack
 - libFuzzer
 - XRay

This change enables the features on amd64 for start.


To generate a diff of this commit:
cvs rdiff -u -r1.277 -r1.278 src/distrib/sets/lists/base/md.amd64
cvs rdiff -u -r1.1209 -r1.1210 src/distrib/sets/lists/base/mi
cvs rdiff -u -r1.2279 -r1.2280 src/distrib/sets/lists/comp/mi
cvs rdiff -u -r1.201 -r1.202 src/etc/mtree/NetBSD.dist.base
cvs rdiff -u -r1.63 -r1.64 src/external/bsd/Makefile

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



CVS commit: src

2019-08-13 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Wed Aug 14 01:42:08 UTC 2019

Modified Files:
src/distrib/sets/lists/base: md.amd64 mi
src/distrib/sets/lists/comp: mi
src/etc/mtree: NetBSD.dist.base
src/external/bsd: Makefile

Log Message:
Add LLVM sanitizers in the MKLLVM=yes build

Enable in all the supported variations for NetBSD/amd64:

 - Address Sanitizer
 - Thread Sanitizer
 - Memory Sanitizer
 - Undefined Behavior Sanitizer
 - SafeStack
 - libFuzzer
 - XRay

This change enables the features on amd64 for start.


To generate a diff of this commit:
cvs rdiff -u -r1.277 -r1.278 src/distrib/sets/lists/base/md.amd64
cvs rdiff -u -r1.1209 -r1.1210 src/distrib/sets/lists/base/mi
cvs rdiff -u -r1.2279 -r1.2280 src/distrib/sets/lists/comp/mi
cvs rdiff -u -r1.201 -r1.202 src/etc/mtree/NetBSD.dist.base
cvs rdiff -u -r1.63 -r1.64 src/external/bsd/Makefile

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

Modified files:

Index: src/distrib/sets/lists/base/md.amd64
diff -u src/distrib/sets/lists/base/md.amd64:1.277 src/distrib/sets/lists/base/md.amd64:1.278
--- src/distrib/sets/lists/base/md.amd64:1.277	Sun Nov 11 12:03:08 2018
+++ src/distrib/sets/lists/base/md.amd64	Wed Aug 14 01:42:08 2019
@@ -1,10 +1,56 @@
-# $NetBSD: md.amd64,v 1.277 2018/11/11 12:03:08 maxv Exp $
+# $NetBSD: md.amd64,v 1.278 2019/08/14 01:42:08 kamil Exp $
 ./dev/lms0	base-obsolete		obsolete
 ./dev/mms0	base-obsolete		obsolete
 ./libexec/ld.elf_so-i386			base-sys-shlib		compat,pic
 ./usr/bin/fdformatbase-util-bin
 ./usr/bin/iasl	base-util-bin
 ./usr/bin/pmc	base-obsolete		obsolete
+./usr/lib/clang/7.0.0/lib/netbsd/libclang_rt.asan-i386.a	comp-cxx-lib	llvm
+./usr/lib/clang/7.0.0/lib/netbsd/libclang_rt.asan-x86_64.a	comp-cxx-lib	llvm
+./usr/lib/clang/7.0.0/lib/netbsd/libclang_rt.asan-i386.so	comp-cxx-lib	llvm
+./usr/lib/clang/7.0.0/lib/netbsd/libclang_rt.asan-i386.so.0	comp-cxx-lib	llvm
+./usr/lib/clang/7.0.0/lib/netbsd/libclang_rt.asan-i386.so.0.0	comp-cxx-lib	llvm
+./usr/lib/clang/7.0.0/lib/netbsd/libclang_rt.asan-x86_64.so	comp-cxx-lib	llvm
+./usr/lib/clang/7.0.0/lib/netbsd/libclang_rt.asan-x86_64.so.0	comp-cxx-lib	llvm
+./usr/lib/clang/7.0.0/lib/netbsd/libclang_rt.asan-x86_64.so.0.0	comp-cxx-lib	llvm
+./usr/lib/clang/7.0.0/lib/netbsd/libclang_rt.asan-preinit-i386.a	comp-cxx-lib	llvm
+./usr/lib/clang/7.0.0/lib/netbsd/libclang_rt.asan-preinit-x86_64.a	comp-cxx-lib	llvm
+./usr/lib/clang/7.0.0/lib/netbsd/libclang_rt.asan_cxx-i386.a	comp-cxx-lib	llvm
+./usr/lib/clang/7.0.0/lib/netbsd/libclang_rt.asan_cxx-x86_64.a	comp-cxx-lib	llvm
+./usr/lib/clang/7.0.0/lib/netbsd/libclang_rt.dd-x86_64.a	comp-cxx-lib	llvm
+./usr/lib/clang/7.0.0/lib/netbsd/libclang_rt.dyndd-x86_64.so	comp-cxx-lib	llvm
+./usr/lib/clang/7.0.0/lib/netbsd/libclang_rt.dyndd-x86_64.so.0	comp-cxx-lib	llvm
+./usr/lib/clang/7.0.0/lib/netbsd/libclang_rt.dyndd-x86_64.so.0.0	comp-cxx-lib	llvm
+./usr/lib/clang/7.0.0/lib/netbsd/libclang_rt.fuzzer-x86_64.a	comp-cxx-lib	llvm
+./usr/lib/clang/7.0.0/lib/netbsd/libclang_rt.fuzzer_no_main-x86_64.a	comp-cxx-lib	llvm
+./usr/lib/clang/7.0.0/lib/netbsd/libclang_rt.msan-x86_64.a	comp-cxx-lib	llvm
+./usr/lib/clang/7.0.0/lib/netbsd/libclang_rt.msan_cxx-x86_64.a	comp-cxx-lib	llvm
+./usr/lib/clang/7.0.0/lib/netbsd/libclang_rt.safestack-i386.a	comp-cxx-lib	llvm
+./usr/lib/clang/7.0.0/lib/netbsd/libclang_rt.safestack-x86_64.a	comp-cxx-lib	llvm
+./usr/lib/clang/7.0.0/lib/netbsd/libclang_rt.tsan-x86_64.a	comp-cxx-lib	llvm
+./usr/lib/clang/7.0.0/lib/netbsd/libclang_rt.tsan_cxx-x86_64.a	comp-cxx-lib	llvm
+./usr/lib/clang/7.0.0/lib/netbsd/libclang_rt.ubsan_minimal-i386.a	comp-cxx-lib	llvm
+./usr/lib/clang/7.0.0/lib/netbsd/libclang_rt.ubsan_minimal-x86_64.a	comp-cxx-lib	llvm
+./usr/lib/clang/7.0.0/lib/netbsd/libclang_rt.ubsan_minimal-i386.so	comp-cxx-lib	llvm
+./usr/lib/clang/7.0.0/lib/netbsd/libclang_rt.ubsan_minimal-i386.so.0	comp-cxx-lib	llvm
+./usr/lib/clang/7.0.0/lib/netbsd/libclang_rt.ubsan_minimal-i386.so.0.0	comp-cxx-lib	llvm
+./usr/lib/clang/7.0.0/lib/netbsd/libclang_rt.ubsan_minimal-x86_64.so	comp-cxx-lib	llvm
+./usr/lib/clang/7.0.0/lib/netbsd/libclang_rt.ubsan_minimal-x86_64.so.0	comp-cxx-lib	llvm
+./usr/lib/clang/7.0.0/lib/netbsd/libclang_rt.ubsan_minimal-x86_64.so.0.0	comp-cxx-lib	llvm
+./usr/lib/clang/7.0.0/lib/netbsd/libclang_rt.ubsan_standalone-i386.a	comp-cxx-lib	llvm
+./usr/lib/clang/7.0.0/lib/netbsd/libclang_rt.ubsan_standalone-x86_64.a	comp-cxx-lib	llvm
+./usr/lib/clang/7.0.0/lib/netbsd/libclang_rt.ubsan_standalone-i386.so	comp-cxx-lib	llvm
+./usr/lib/clang/7.0.0/lib/netbsd/libclang_rt.ubsan_standalone-i386.so.0	comp-cxx-lib	llvm
+./usr/lib/clang/7.0.0/lib/netbsd/libclang_rt.ubsan_standalone-i386.so.0.0	comp-cxx-lib	llvm
+./usr/lib/clang/7.0.0/lib/netbsd/libclang_rt.ubsan_standalone-x86_64.so	comp-cxx-lib	llvm
+./usr/lib/clang/7.0.0/lib/netbsd/libclang_rt.ubsan_standalone-x86_64.so.0	comp-cxx-lib	llvm

CVS commit: src/sys/external/bsd/compiler_rt/dist/lib

2019-08-13 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Wed Aug 14 00:51:48 UTC 2019

Modified Files:
src/sys/external/bsd/compiler_rt/dist/lib/asan: asan_posix.cc
src/sys/external/bsd/compiler_rt/dist/lib/sanitizer_common:
sanitizer_interceptors_ioctl_netbsd.inc
sanitizer_platform_limits_netbsd.cc
sanitizer_platform_limits_netbsd.h

Log Message:
Cherry-pick upstream compiler-rt patches for LLVM sanitizers

Upstream no longer accepts patches for LLVM-8, therefore pull needed changes 
downstream.

Enhancements:

 * resolved build failured with NetBSD 9.99.3
 * ioctl(2) lists are synced with NetBSD 9.99.3
 * fixes dynamic asan (-fsanitize=address -shared-libasa) crash on init

commit 092068cd7429659138d6779a3072298462ad3e9c
Author: Kamil Rytarowski 
Date:   Wed Aug 7 21:56:43 2019 +

Restrict the NetBSD ASan TSD fallback to !ASAN_DYNAMIC

The fallback to the alternative implementation of TSD with TLS
is only needed for the static version of ASan for NetBSD.

The same code cannot be reused for the dynamic version of ASan as
TLS breaks and TSD code works.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@368219 
91177308-0d34-0410-b5e6-96231b3b80d8

commit 0bd9d23c4317d5d1c440e19892e178a29c9fe7be
Author: Kamil Rytarowski 
Date:   Thu Aug 8 02:21:44 2019 +

Sync ioctl(2) list with NetBSD 9.99.3

Register 36 new ioctl(2) calls.

Enable NVMM for amd64 as the API has been stabilized.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@368247 
91177308-0d34-0410-b5e6-96231b3b80d8

commit 08d3c10606f09a4545487e9c3fad919ee396e3a6
Author: Tom Stellard 
Date:   Wed May 15 20:29:49 2019 +

Merging r360212:


r360212 | kamil | 2019-05-07 17:44:41 -0700 (Tue, 07 May 2019) | 6 lines

Fix build on NetBSD 8.99.38

With recent changes the dev/nvmm/nvmm_ioctl.h header is no longer
a standalone NVMM header. Disable it until the NVMM operations will
stabilize and be included in the ioctl(2) interceptors.



git-svn-id: 
https://llvm.org/svn/llvm-project/compiler-rt/branches/release_80@360811 
91177308-0d34-0410-b5e6-96231b3b80d8


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 \
src/sys/external/bsd/compiler_rt/dist/lib/asan/asan_posix.cc
cvs rdiff -u -r1.1.1.1 -r1.2 \

src/sys/external/bsd/compiler_rt/dist/lib/sanitizer_common/sanitizer_interceptors_ioctl_netbsd.inc
 \

src/sys/external/bsd/compiler_rt/dist/lib/sanitizer_common/sanitizer_platform_limits_netbsd.cc
 \

src/sys/external/bsd/compiler_rt/dist/lib/sanitizer_common/sanitizer_platform_limits_netbsd.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/compiler_rt/dist/lib/asan/asan_posix.cc
diff -u src/sys/external/bsd/compiler_rt/dist/lib/asan/asan_posix.cc:1.1.1.1 src/sys/external/bsd/compiler_rt/dist/lib/asan/asan_posix.cc:1.2
--- src/sys/external/bsd/compiler_rt/dist/lib/asan/asan_posix.cc:1.1.1.1	Tue Jan  8 05:40:28 2019
+++ src/sys/external/bsd/compiler_rt/dist/lib/asan/asan_posix.cc	Wed Aug 14 00:51:48 2019
@@ -40,8 +40,8 @@ void AsanOnDeadlySignal(int signo, void 
 
 // -- TSD  {{{1
 
-#if SANITIZER_NETBSD || SANITIZER_FREEBSD
-// Thread Static Data cannot be used in early init on NetBSD and FreeBSD.
+#if (SANITIZER_NETBSD && !ASAN_DYNAMIC) || SANITIZER_FREEBSD
+// Thread Static Data cannot be used in early static ASan init on NetBSD.
 // Reuse the Asan TSD API for compatibility with existing code
 // with an alternative implementation.
 

Index: src/sys/external/bsd/compiler_rt/dist/lib/sanitizer_common/sanitizer_interceptors_ioctl_netbsd.inc
diff -u src/sys/external/bsd/compiler_rt/dist/lib/sanitizer_common/sanitizer_interceptors_ioctl_netbsd.inc:1.1.1.1 src/sys/external/bsd/compiler_rt/dist/lib/sanitizer_common/sanitizer_interceptors_ioctl_netbsd.inc:1.2
--- src/sys/external/bsd/compiler_rt/dist/lib/sanitizer_common/sanitizer_interceptors_ioctl_netbsd.inc:1.1.1.1	Tue Jan  8 05:40:29 2019
+++ src/sys/external/bsd/compiler_rt/dist/lib/sanitizer_common/sanitizer_interceptors_ioctl_netbsd.inc	Wed Aug 14 00:51:48 2019
@@ -25,7 +25,7 @@ struct ioctl_desc {
   const char *name;
 };
 
-const unsigned ioctl_table_max = 1202;
+const unsigned ioctl_table_max = 1236;
 static ioctl_desc ioctl_table[ioctl_table_max];
 static unsigned ioctl_table_size = 0;
 
@@ -298,9 +298,6 @@ static void ioctl_table_fill() {
   _(IRFRAMETTY_GET_DEVICE, WRITE, sizeof(unsigned int));
   _(IRFRAMETTY_GET_DONGLE, WRITE, sizeof(unsigned int));
   _(IRFRAMETTY_SET_DONGLE, READ, sizeof(unsigned int));
-  /* Entries from file: dev/isa/satlinkio.h */
-  _(SATIORESET, NONE, 0);
-  _(SATIOGID, WRITE, 

CVS commit: src/sys/external/bsd/compiler_rt/dist/lib

2019-08-13 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Wed Aug 14 00:51:48 UTC 2019

Modified Files:
src/sys/external/bsd/compiler_rt/dist/lib/asan: asan_posix.cc
src/sys/external/bsd/compiler_rt/dist/lib/sanitizer_common:
sanitizer_interceptors_ioctl_netbsd.inc
sanitizer_platform_limits_netbsd.cc
sanitizer_platform_limits_netbsd.h

Log Message:
Cherry-pick upstream compiler-rt patches for LLVM sanitizers

Upstream no longer accepts patches for LLVM-8, therefore pull needed changes 
downstream.

Enhancements:

 * resolved build failured with NetBSD 9.99.3
 * ioctl(2) lists are synced with NetBSD 9.99.3
 * fixes dynamic asan (-fsanitize=address -shared-libasa) crash on init

commit 092068cd7429659138d6779a3072298462ad3e9c
Author: Kamil Rytarowski 
Date:   Wed Aug 7 21:56:43 2019 +

Restrict the NetBSD ASan TSD fallback to !ASAN_DYNAMIC

The fallback to the alternative implementation of TSD with TLS
is only needed for the static version of ASan for NetBSD.

The same code cannot be reused for the dynamic version of ASan as
TLS breaks and TSD code works.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@368219 
91177308-0d34-0410-b5e6-96231b3b80d8

commit 0bd9d23c4317d5d1c440e19892e178a29c9fe7be
Author: Kamil Rytarowski 
Date:   Thu Aug 8 02:21:44 2019 +

Sync ioctl(2) list with NetBSD 9.99.3

Register 36 new ioctl(2) calls.

Enable NVMM for amd64 as the API has been stabilized.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@368247 
91177308-0d34-0410-b5e6-96231b3b80d8

commit 08d3c10606f09a4545487e9c3fad919ee396e3a6
Author: Tom Stellard 
Date:   Wed May 15 20:29:49 2019 +

Merging r360212:


r360212 | kamil | 2019-05-07 17:44:41 -0700 (Tue, 07 May 2019) | 6 lines

Fix build on NetBSD 8.99.38

With recent changes the dev/nvmm/nvmm_ioctl.h header is no longer
a standalone NVMM header. Disable it until the NVMM operations will
stabilize and be included in the ioctl(2) interceptors.



git-svn-id: 
https://llvm.org/svn/llvm-project/compiler-rt/branches/release_80@360811 
91177308-0d34-0410-b5e6-96231b3b80d8


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 \
src/sys/external/bsd/compiler_rt/dist/lib/asan/asan_posix.cc
cvs rdiff -u -r1.1.1.1 -r1.2 \

src/sys/external/bsd/compiler_rt/dist/lib/sanitizer_common/sanitizer_interceptors_ioctl_netbsd.inc
 \

src/sys/external/bsd/compiler_rt/dist/lib/sanitizer_common/sanitizer_platform_limits_netbsd.cc
 \

src/sys/external/bsd/compiler_rt/dist/lib/sanitizer_common/sanitizer_platform_limits_netbsd.h

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



CVS commit: src/sys/dev/rasops

2019-08-13 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Wed Aug 14 00:51:11 UTC 2019

Modified Files:
src/sys/dev/rasops: rasops.h rasops15.c rasops2.c rasops24.c rasops32.c
rasops4.c rasops8.c rasops_putchar_width.h

Log Message:
When using stamp, drop attributions other than back and foreground
colors so that stamp is not updated unnecessarily.


To generate a diff of this commit:
cvs rdiff -u -r1.47 -r1.48 src/sys/dev/rasops/rasops.h
cvs rdiff -u -r1.38 -r1.39 src/sys/dev/rasops/rasops15.c
cvs rdiff -u -r1.32 -r1.33 src/sys/dev/rasops/rasops2.c
cvs rdiff -u -r1.49 -r1.50 src/sys/dev/rasops/rasops24.c
cvs rdiff -u -r1.45 -r1.46 src/sys/dev/rasops/rasops32.c
cvs rdiff -u -r1.27 -r1.28 src/sys/dev/rasops/rasops4.c
cvs rdiff -u -r1.50 -r1.51 src/sys/dev/rasops/rasops8.c
cvs rdiff -u -r1.14 -r1.15 src/sys/dev/rasops/rasops_putchar_width.h

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

Modified files:

Index: src/sys/dev/rasops/rasops.h
diff -u src/sys/dev/rasops/rasops.h:1.47 src/sys/dev/rasops/rasops.h:1.48
--- src/sys/dev/rasops/rasops.h:1.47	Sat Aug 10 01:24:17 2019
+++ src/sys/dev/rasops/rasops.h	Wed Aug 14 00:51:10 2019
@@ -1,4 +1,4 @@
-/* 	$NetBSD: rasops.h,v 1.47 2019/08/10 01:24:17 rin Exp $ */
+/* 	$NetBSD: rasops.h,v 1.48 2019/08/14 00:51:10 rin Exp $ */
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -203,6 +203,9 @@ void	rasops32_init(struct rasops_info *)
 #define	ATTR_BG(ri, attr) ((ri)->ri_devcmap[((uint32_t)(attr) >> 16) & 0xf])
 #define	ATTR_FG(ri, attr) ((ri)->ri_devcmap[((uint32_t)(attr) >> 24) & 0xf])
 
+#define	ATTR_MASK_BG __BITS(16, 19)
+#define	ATTR_MASK_FG __BITS(24, 27)
+
 #define	DELTA(p, d, cast) ((p) = (cast)((uint8_t *)(p) + (d)))
 
 #define	FBOFFSET(ri, row, col)		\

Index: src/sys/dev/rasops/rasops15.c
diff -u src/sys/dev/rasops/rasops15.c:1.38 src/sys/dev/rasops/rasops15.c:1.39
--- src/sys/dev/rasops/rasops15.c:1.38	Sat Aug 10 01:24:17 2019
+++ src/sys/dev/rasops/rasops15.c	Wed Aug 14 00:51:10 2019
@@ -1,4 +1,4 @@
-/* 	$NetBSD: rasops15.c,v 1.38 2019/08/10 01:24:17 rin Exp $	*/
+/* 	$NetBSD: rasops15.c,v 1.39 2019/08/14 00:51:10 rin Exp $	*/
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rasops15.c,v 1.38 2019/08/10 01:24:17 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rasops15.c,v 1.39 2019/08/14 00:51:10 rin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_rasops.h"
@@ -109,7 +109,7 @@ rasops15_init(struct rasops_info *ri)
 	}
 
 #ifndef RASOPS_SMALL
-	stamp_attr = 0;
+	stamp_attr = -1;
 	stamp_ri = NULL;
 #endif
 }

Index: src/sys/dev/rasops/rasops2.c
diff -u src/sys/dev/rasops/rasops2.c:1.32 src/sys/dev/rasops/rasops2.c:1.33
--- src/sys/dev/rasops/rasops2.c:1.32	Sat Aug 10 01:24:17 2019
+++ src/sys/dev/rasops/rasops2.c	Wed Aug 14 00:51:10 2019
@@ -1,4 +1,4 @@
-/* 	$NetBSD: rasops2.c,v 1.32 2019/08/10 01:24:17 rin Exp $	*/
+/* 	$NetBSD: rasops2.c,v 1.33 2019/08/14 00:51:10 rin Exp $	*/
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rasops2.c,v 1.32 2019/08/10 01:24:17 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rasops2.c,v 1.33 2019/08/14 00:51:10 rin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_rasops.h"
@@ -111,7 +111,7 @@ rasops2_init(struct rasops_info *ri)
 	}
 
 #ifndef RASOPS_SMALL
-	stamp_attr = 0;
+	stamp_attr = -1;
 	stamp_ri = NULL;
 #endif
 }

Index: src/sys/dev/rasops/rasops24.c
diff -u src/sys/dev/rasops/rasops24.c:1.49 src/sys/dev/rasops/rasops24.c:1.50
--- src/sys/dev/rasops/rasops24.c:1.49	Sat Aug 10 01:24:17 2019
+++ src/sys/dev/rasops/rasops24.c	Wed Aug 14 00:51:10 2019
@@ -1,4 +1,4 @@
-/* 	$NetBSD: rasops24.c,v 1.49 2019/08/10 01:24:17 rin Exp $	*/
+/* 	$NetBSD: rasops24.c,v 1.50 2019/08/14 00:51:10 rin Exp $	*/
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rasops24.c,v 1.49 2019/08/10 01:24:17 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rasops24.c,v 1.50 2019/08/14 00:51:10 rin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_rasops.h"
@@ -120,7 +120,7 @@ rasops24_init(struct rasops_info *ri)
 	}
 
 #ifndef RASOPS_SMALL
-	stamp_attr = 0;
+	stamp_attr = -1;
 	stamp_ri = NULL;
 #endif
 }

Index: src/sys/dev/rasops/rasops32.c
diff -u src/sys/dev/rasops/rasops32.c:1.45 src/sys/dev/rasops/rasops32.c:1.46
--- src/sys/dev/rasops/rasops32.c:1.45	Sat Aug 10 01:24:17 2019
+++ src/sys/dev/rasops/rasops32.c	Wed Aug 14 00:51:10 2019
@@ -1,4 +1,4 @@
-/*	 $NetBSD: rasops32.c,v 1.45 2019/08/10 01:24:17 rin Exp $	*/
+/*	 $NetBSD: rasops32.c,v 1.46 2019/08/14 00:51:10 rin Exp $	*/
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rasops32.c,v 1.45 2019/08/10 01:24:17 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rasops32.c,v 1.46 2019/08/14 00:51:10 rin Exp $");
 
 #ifdef _KERNEL_OPT
 

CVS commit: src/sys/dev/rasops

2019-08-13 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Wed Aug 14 00:51:11 UTC 2019

Modified Files:
src/sys/dev/rasops: rasops.h rasops15.c rasops2.c rasops24.c rasops32.c
rasops4.c rasops8.c rasops_putchar_width.h

Log Message:
When using stamp, drop attributions other than back and foreground
colors so that stamp is not updated unnecessarily.


To generate a diff of this commit:
cvs rdiff -u -r1.47 -r1.48 src/sys/dev/rasops/rasops.h
cvs rdiff -u -r1.38 -r1.39 src/sys/dev/rasops/rasops15.c
cvs rdiff -u -r1.32 -r1.33 src/sys/dev/rasops/rasops2.c
cvs rdiff -u -r1.49 -r1.50 src/sys/dev/rasops/rasops24.c
cvs rdiff -u -r1.45 -r1.46 src/sys/dev/rasops/rasops32.c
cvs rdiff -u -r1.27 -r1.28 src/sys/dev/rasops/rasops4.c
cvs rdiff -u -r1.50 -r1.51 src/sys/dev/rasops/rasops8.c
cvs rdiff -u -r1.14 -r1.15 src/sys/dev/rasops/rasops_putchar_width.h

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



re: CVS commit: src/share/mk

2019-08-13 Thread Paul Goyette

So 9.99.7 does not install *_pic.a any longer while earlier versions did.
Shouldn't they be marked as "obsolete" in the set lists?


this would break builds that do want them.

they've been built conditionally for a long time, we just changed
the default value of the condition is all.

i understand where you are coming from -- i have to clean my
destdir for dozens of builds now -- but there's no easy answer
to this besides manual fixing..

(it fortunately does not leave anything in the objdir, as these
files are created as part of creating the shlibs -- the only
difference now is that we don't install them by dfeault.)


Ah, got it!  Thanks for the detailed explanation.



++--+---+
| Paul Goyette   | PGP Key fingerprint: | E-mail addresses: |
| (Retired)  | FA29 0E3B 35AF E8AE 6651 | p...@whooppee.com |
| Software Developer | 0786 F758 55DE 53BA 7731 | pgoye...@netbsd.org   |
++--+---+


re: CVS commit: src/share/mk

2019-08-13 Thread matthew green
Thomas Klausner writes:
> On Sat, Aug 10, 2019 at 08:20:17AM -0400, Christos Zoulas wrote:
> > Module Name:src
> > Committed By:   christos
> > Date:   Sat Aug 10 12:20:17 UTC 2019
> > 
> > Modified Files:
> > src/share/mk: bsd.own.mk
> > 
> > Log Message:
> > Don't install PIC libraries by default because they are too big since they
> > contain debug symbols. I supplied a patch in PR/54449 to remove the 
> > debugging
> > symbols but folks preferred to not install them at all.
> 
> So 9.99.7 does not install *_pic.a any longer while earlier versions did.
> Shouldn't they be marked as "obsolete" in the set lists?

this would break builds that do want them.

they've been built conditionally for a long time, we just changed
the default value of the condition is all.

i understand where you are coming from -- i have to clean my 
destdir for dozens of builds now -- but there's no easy answer
to this besides manual fixing..

(it fortunately does not leave anything in the objdir, as these
files are created as part of creating the shlibs -- the only
difference now is that we don't install them by dfeault.)


.mrg.


Re: CVS commit: src/share/mk

2019-08-13 Thread Paul Goyette

On Wed, 14 Aug 2019, Thomas Klausner wrote:


On Sat, Aug 10, 2019 at 08:20:17AM -0400, Christos Zoulas wrote:

Module Name:src
Committed By:   christos
Date:   Sat Aug 10 12:20:17 UTC 2019

Modified Files:
src/share/mk: bsd.own.mk

Log Message:
Don't install PIC libraries by default because they are too big since they
contain debug symbols. I supplied a patch in PR/54449 to remove the debugging
symbols but folks preferred to not install them at all.


So 9.99.7 does not install *_pic.a any longer while earlier versions did.
Shouldn't they be marked as "obsolete" in the set lists?


Yes.  They should be obsolete.


++--+---+
| Paul Goyette   | PGP Key fingerprint: | E-mail addresses: |
| (Retired)  | FA29 0E3B 35AF E8AE 6651 | p...@whooppee.com |
| Software Developer | 0786 F758 55DE 53BA 7731 | pgoye...@netbsd.org   |
++--+---+


Re: CVS commit: src/share/mk

2019-08-13 Thread Thomas Klausner
On Sat, Aug 10, 2019 at 08:20:17AM -0400, Christos Zoulas wrote:
> Module Name:  src
> Committed By: christos
> Date: Sat Aug 10 12:20:17 UTC 2019
> 
> Modified Files:
>   src/share/mk: bsd.own.mk
> 
> Log Message:
> Don't install PIC libraries by default because they are too big since they
> contain debug symbols. I supplied a patch in PR/54449 to remove the debugging
> symbols but folks preferred to not install them at all.

So 9.99.7 does not install *_pic.a any longer while earlier versions did.
Shouldn't they be marked as "obsolete" in the set lists?
 Thomas


CVS commit: src/sys/netinet

2019-08-13 Thread Robert Swindells
Module Name:src
Committed By:   rjs
Date:   Tue Aug 13 19:55:40 UTC 2019

Modified Files:
src/sys/netinet: sctp_crc32.c sctp_crc32.h sctputil.c

Log Message:
Remove unused checksum code.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/netinet/sctp_crc32.c
cvs rdiff -u -r1.1 -r1.2 src/sys/netinet/sctp_crc32.h
cvs rdiff -u -r1.14 -r1.15 src/sys/netinet/sctputil.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/sctp_crc32.c
diff -u src/sys/netinet/sctp_crc32.c:1.2 src/sys/netinet/sctp_crc32.c:1.3
--- src/sys/netinet/sctp_crc32.c:1.2	Fri Aug 12 19:08:54 2016
+++ src/sys/netinet/sctp_crc32.c	Tue Aug 13 19:55:40 2019
@@ -1,5 +1,5 @@
 /*	$KAME: sctp_crc32.c,v 1.12 2005/03/06 16:04:17 itojun Exp $	*/
-/*	$NetBSD: sctp_crc32.c,v 1.2 2016/08/12 19:08:54 jdolecek Exp $ */
+/*	$NetBSD: sctp_crc32.c,v 1.3 2019/08/13 19:55:40 rjs Exp $ */
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Cisco Systems, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sctp_crc32.c,v 1.2 2016/08/12 19:08:54 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sctp_crc32.c,v 1.3 2019/08/13 19:55:40 rjs Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_sctp.h"
@@ -43,8 +43,6 @@ __KERNEL_RCSID(0, "$NetBSD: sctp_crc32.c
 #include 
 #include 
 
-#ifndef SCTP_USE_ADLER32
-
 #define SCTP_CRC32C_POLY 0x1EDC6F41
 #define SCTP_CRC32C(c, d) (c = ((c) >> 8) ^ sctp_crc_c[((c) ^ (d)) & 0xFF])
 
@@ -181,4 +179,3 @@ sctp_csum_finalize(u_int32_t crc32c)
 	return (crc32c);
 }
 
-#endif

Index: src/sys/netinet/sctp_crc32.h
diff -u src/sys/netinet/sctp_crc32.h:1.1 src/sys/netinet/sctp_crc32.h:1.2
--- src/sys/netinet/sctp_crc32.h:1.1	Tue Oct 13 21:28:35 2015
+++ src/sys/netinet/sctp_crc32.h	Tue Aug 13 19:55:40 2019
@@ -1,5 +1,5 @@
 /*	$KAME: sctp_crc32.h,v 1.5 2004/08/17 04:06:16 itojun Exp $	*/
-/*	$NetBSD: sctp_crc32.h,v 1.1 2015/10/13 21:28:35 rjs Exp $ */
+/*	$NetBSD: sctp_crc32.h,v 1.2 2019/08/13 19:55:40 rjs Exp $ */
 
 #ifndef __SCTP_CRC32C_H__
 #define __SCTP_CRC32C_H__
@@ -38,12 +38,10 @@
 
 #include 
 
-#ifndef SCTP_USE_ADLER32
 #if defined(_KERNEL)
 u_int32_t update_crc32(u_int32_t, unsigned char *, unsigned int);
 
 u_int32_t sctp_csum_finalize(u_int32_t);
 
 #endif /* _KERNEL */
-#endif /* !SCTP_USE_ADLER32 */
 #endif /* __SCTP_CRC32C_H__ */

Index: src/sys/netinet/sctputil.c
diff -u src/sys/netinet/sctputil.c:1.14 src/sys/netinet/sctputil.c:1.15
--- src/sys/netinet/sctputil.c:1.14	Thu Nov  8 06:34:40 2018
+++ src/sys/netinet/sctputil.c	Tue Aug 13 19:55:40 2019
@@ -1,5 +1,5 @@
 /*	$KAME: sctputil.c,v 1.39 2005/06/16 20:54:06 jinmei Exp $	*/
-/*	$NetBSD: sctputil.c,v 1.14 2018/11/08 06:34:40 msaitoh Exp $	*/
+/*	$NetBSD: sctputil.c,v 1.15 2019/08/13 19:55:40 rjs Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Cisco Systems, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sctputil.c,v 1.14 2018/11/08 06:34:40 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sctputil.c,v 1.15 2019/08/13 19:55:40 rjs Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -1572,47 +1572,6 @@ sctp_timer_stop(int t_type, struct sctp_
 	return (0);
 }
 
-#ifdef SCTP_USE_ADLER32
-static uint32_t
-update_adler32(uint32_t adler, uint8_t *buf, int32_t len)
-{
-	u_int32_t s1 = adler & 0x;
-	u_int32_t s2 = (adler >> 16) & 0x;
-	int n;
-
-	for (n = 0; n < len; n++, buf++) {
-		/* s1 = (s1 + buf[n]) % BASE */
-		/* first we add */
-		s1 = (s1 + *buf);
-		/*
-		 * now if we need to, we do a mod by subtracting. It seems
-		 * a bit faster since I really will only ever do one subtract
-		 * at the MOST, since buf[n] is a max of 255.
-		 */
-		if (s1 >= SCTP_ADLER32_BASE) {
-			s1 -= SCTP_ADLER32_BASE;
-		}
-		/* s2 = (s2 + s1) % BASE */
-		/* first we add */
-		s2 = (s2 + s1);
-		/*
-		 * again, it is more efficent (it seems) to subtract since
-		 * the most s2 will ever be is (BASE-1 + BASE-1) in the worse
-		 * case. This would then be (2 * BASE) - 2, which will still
-		 * only do one subtract. On Intel this is much better to do
-		 * this way and avoid the divide. Have not -pg'd on sparc.
-		 */
-		if (s2 >= SCTP_ADLER32_BASE) {
-			s2 -= SCTP_ADLER32_BASE;
-		}
-	}
-	/* Return the adler32 of the bytes buf[0..len-1] */
-	return ((s2 << 16) + s1);
-}
-
-#endif
-
-
 u_int32_t
 sctp_calculate_len(struct mbuf *m)
 {
@@ -1626,31 +1585,6 @@ sctp_calculate_len(struct mbuf *m)
 	return (tlen);
 }
 
-#if defined(SCTP_WITH_NO_CSUM)
-
-uint32_t
-sctp_calculate_sum(struct mbuf *m, int32_t *pktlen, uint32_t offset)
-{
-	/*
-	 * given a mbuf chain with a packetheader offset by 'offset'
-	 * pointing at a sctphdr (with csum set to 0) go through
-	 * the chain of m_next's and calculate the SCTP checksum.
-	 * This is currently Adler32 but will change to CRC32x
-	 * soon. Also has a side bonus calculate the total length
-	 * of the mbuf chain.
-	 * Note: if offset is greater than the total mbuf length,
-	 

CVS commit: src/sys/netinet

2019-08-13 Thread Robert Swindells
Module Name:src
Committed By:   rjs
Date:   Tue Aug 13 19:55:40 UTC 2019

Modified Files:
src/sys/netinet: sctp_crc32.c sctp_crc32.h sctputil.c

Log Message:
Remove unused checksum code.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/netinet/sctp_crc32.c
cvs rdiff -u -r1.1 -r1.2 src/sys/netinet/sctp_crc32.h
cvs rdiff -u -r1.14 -r1.15 src/sys/netinet/sctputil.c

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



CVS commit: src/usr.sbin/sysinst

2019-08-13 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Aug 13 17:57:49 UTC 2019

Modified Files:
src/usr.sbin/sysinst: partman.c

Log Message:
Make sure to completely initialize dynamic menu entries.


To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.42 src/usr.sbin/sysinst/partman.c

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



CVS commit: src/usr.sbin/sysinst

2019-08-13 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Aug 13 17:57:49 UTC 2019

Modified Files:
src/usr.sbin/sysinst: partman.c

Log Message:
Make sure to completely initialize dynamic menu entries.


To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.42 src/usr.sbin/sysinst/partman.c

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

Modified files:

Index: src/usr.sbin/sysinst/partman.c
diff -u src/usr.sbin/sysinst/partman.c:1.41 src/usr.sbin/sysinst/partman.c:1.42
--- src/usr.sbin/sysinst/partman.c:1.41	Thu Jul 25 19:01:08 2019
+++ src/usr.sbin/sysinst/partman.c	Tue Aug 13 17:57:49 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: partman.c,v 1.41 2019/07/25 19:01:08 martin Exp $ */
+/*	$NetBSD: partman.c,v 1.42 2019/08/13 17:57:49 martin Exp $ */
 
 /*
  * Copyright 2012 Eugene Lozovoy
@@ -2802,8 +2802,7 @@ pm_upddevlist(menudesc *m, void *arg)
 		return -1;
 
 	SLIST_FOREACH(pm_i, _head, l) {
-		m->opts[i].opt_name = NULL;
-		m->opts[i].opt_exp_name = NULL;
+		memset(>opts[i], 0, sizeof m->opts[i]);
 		m->opts[i].opt_action = pm_submenu;
 		((struct part_entry *)arg)[i].dev_ptr = pm_i;
 		((struct part_entry *)arg)[i].id = NO_PART;
@@ -2837,8 +2836,7 @@ pm_upddevlist(menudesc *m, void *arg)
 if (i >= MAX_ENTRIES)
 	break;
 i++;
-m->opts[i].opt_name = NULL;
-m->opts[i].opt_exp_name = NULL;
+memset(>opts[i], 0, sizeof m->opts[i]);
 m->opts[i].opt_action = pm_submenu;
 ((struct part_entry *)arg)[i].parts =
 pm_i->parts;
@@ -2860,8 +2858,7 @@ pm_upddevlist(menudesc *m, void *arg)
 if (i >= MAX_ENTRIES)
 	break;
 i++;
-m->opts[i].opt_name = NULL;
-m->opts[i].opt_exp_name = NULL;
+memset(>opts[i], 0, sizeof m->opts[i]);
 m->opts[i].opt_action = pm_submenu;
 ((struct part_entry *)arg)[i].parts = secondary;
 ((struct part_entry *)arg)[i].dev_ptr = pm_i;



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

2019-08-13 Thread Tobias Nygren
Module Name:src
Committed By:   tnn
Date:   Tue Aug 13 17:15:55 UTC 2019

Modified Files:
src/sys/arch/arm/rockchip: rk_spi.c

Log Message:
rk_spi: register controller with fdt


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

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



CVS commit: src/sys

2019-08-13 Thread Tobias Nygren
Module Name:src
Committed By:   tnn
Date:   Tue Aug 13 17:03:11 UTC 2019

Modified Files:
src/sys/arch/arm/at91: at91spi.c
src/sys/arch/arm/broadcom: bcm2835_spi.c
src/sys/arch/arm/imx: imxspi.c
src/sys/arch/arm/rockchip: rk_spi.c
src/sys/arch/arm/sunxi: sun4i_spi.c sun6i_spi.c
src/sys/arch/mips/alchemy/dev: auspi.c
src/sys/arch/mips/atheros/dev: arspi.c
src/sys/dev/marvell: mvspi.c

Log Message:
ensure spibus_attach_args is zero'ed


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/at91/at91spi.c
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/arm/broadcom/bcm2835_spi.c
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/imx/imxspi.c
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/rockchip/rk_spi.c
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/sunxi/sun4i_spi.c
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/arm/sunxi/sun6i_spi.c
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/mips/alchemy/dev/auspi.c
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/mips/atheros/dev/arspi.c
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/marvell/mvspi.c

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



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

2019-08-13 Thread Tobias Nygren
Module Name:src
Committed By:   tnn
Date:   Tue Aug 13 17:15:55 UTC 2019

Modified Files:
src/sys/arch/arm/rockchip: rk_spi.c

Log Message:
rk_spi: register controller with fdt


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/arm/rockchip/rk_spi.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/rockchip/rk_spi.c
diff -u src/sys/arch/arm/rockchip/rk_spi.c:1.2 src/sys/arch/arm/rockchip/rk_spi.c:1.3
--- src/sys/arch/arm/rockchip/rk_spi.c:1.2	Tue Aug 13 17:03:10 2019
+++ src/sys/arch/arm/rockchip/rk_spi.c	Tue Aug 13 17:15:55 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: rk_spi.c,v 1.2 2019/08/13 17:03:10 tnn Exp $	*/
+/*	$NetBSD: rk_spi.c,v 1.3 2019/08/13 17:15:55 tnn Exp $	*/
 
 /*
  * Copyright (c) 2019 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rk_spi.c,v 1.2 2019/08/13 17:03:10 tnn Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rk_spi.c,v 1.3 2019/08/13 17:15:55 tnn Exp $");
 
 #include 
 #include 
@@ -170,6 +170,7 @@ struct rk_spi_softc {
 #define SPIREG_WRITE(sc, reg, val) \
 bus_space_write_4((sc)->sc_bst, (sc)->sc_bsh, (reg), (val))
 
+static struct spi_controller *rk_spi_get_controller(device_t);
 static int rk_spi_match(device_t, cfdata_t, void *);
 static void rk_spi_attach(device_t, device_t, void *);
 
@@ -186,6 +187,18 @@ static int rk_spi_intr(void *);
 CFATTACH_DECL_NEW(rk_spi, sizeof(struct rk_spi_softc),
 rk_spi_match, rk_spi_attach, NULL, NULL);
 
+static const struct fdtbus_spi_controller_func rk_spi_funcs = {
+	.get_controller = rk_spi_get_controller
+};
+
+static struct spi_controller *
+rk_spi_get_controller(device_t dev)
+{
+	struct rk_spi_softc * const sc = device_private(dev);
+
+	return >sc_spi;
+}
+
 static int
 rk_spi_match(device_t parent, cfdata_t cf, void *aux)
 {
@@ -204,8 +217,7 @@ rk_spi_attach(device_t parent, device_t 
 	bus_size_t size;
 	struct clk *sclk, *pclk;
 	char intrstr[128];
-	struct spibus_attach_args sba;
-	
+
 	sc->sc_dev = self;
 	sc->sc_bst = faa->faa_bst;
 	SIMPLEQ_INIT(>sc_q);
@@ -253,10 +265,8 @@ rk_spi_attach(device_t parent, device_t 
 	sc->sc_spi.sct_transfer = rk_spi_transfer;
 	sc->sc_spi.sct_nslaves = 2;
 
-	memset(, 0, sizeof(sba));
-	sba.sba_controller = >sc_spi;
-
-	(void) config_found_ia(self, "spibus", , spibus_print);
+	fdtbus_register_spi_controller(self, phandle, _spi_funcs);
+	(void) fdtbus_attach_spibus(self, phandle, spibus_print);
 }
 
 static int



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

2019-08-13 Thread Tobias Nygren
Module Name:src
Committed By:   tnn
Date:   Tue Aug 13 17:24:25 UTC 2019

Modified Files:
src/sys/arch/arm/dts: rk3399-rockpro64.dts

Log Message:
rk3399-rockpro64.dts: enable spi1 and add spiflash as a child node


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/arm/dts/rk3399-rockpro64.dts

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



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

2019-08-13 Thread Tobias Nygren
Module Name:src
Committed By:   tnn
Date:   Tue Aug 13 17:24:25 UTC 2019

Modified Files:
src/sys/arch/arm/dts: rk3399-rockpro64.dts

Log Message:
rk3399-rockpro64.dts: enable spi1 and add spiflash as a child node


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/arm/dts/rk3399-rockpro64.dts

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/dts/rk3399-rockpro64.dts
diff -u src/sys/arch/arm/dts/rk3399-rockpro64.dts:1.7 src/sys/arch/arm/dts/rk3399-rockpro64.dts:1.8
--- src/sys/arch/arm/dts/rk3399-rockpro64.dts:1.7	Sun Jul 28 10:03:56 2019
+++ src/sys/arch/arm/dts/rk3399-rockpro64.dts	Tue Aug 13 17:24:25 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: rk3399-rockpro64.dts,v 1.7 2019/07/28 10:03:56 jmcneill Exp $ */
+/* $NetBSD: rk3399-rockpro64.dts,v 1.8 2019/08/13 17:24:25 tnn Exp $ */
 
 /*-
  * Copyright (c) 2019 Jared McNeill 
@@ -79,3 +79,12 @@
 	vpcie3v3-supply = <_pcie>;
 	status = "okay";
 };
+
+ {
+	status = "okay";
+	spiflash {
+		compatible = "jedec,spi-nor";
+		reg = <0>;
+		status = "okay";
+	};
+};



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

2019-08-13 Thread Tobias Nygren
Module Name:src
Committed By:   tnn
Date:   Tue Aug 13 17:21:01 UTC 2019

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

Log Message:
include the spiflash driver in the stock 64-bit kernel

As it can be attached via fdt now. For Rockpro64.


To generate a diff of this commit:
cvs rdiff -u -r1.104 -r1.105 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.



CVS commit: src/sys/dev/spi

2019-08-13 Thread Tobias Nygren
Module Name:src
Committed By:   tnn
Date:   Tue Aug 13 17:11:32 UTC 2019

Modified Files:
src/sys/dev/spi: m25p.c

Log Message:
m25p: add compatible entry for "jedec,spi-nor" and match on it


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/dev/spi/m25p.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/spi/m25p.c
diff -u src/sys/dev/spi/m25p.c:1.10 src/sys/dev/spi/m25p.c:1.11
--- src/sys/dev/spi/m25p.c:1.10	Sun Aug  4 22:13:24 2019
+++ src/sys/dev/spi/m25p.c	Tue Aug 13 17:11:32 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: m25p.c,v 1.10 2019/08/04 22:13:24 tnn Exp $ */
+/* $NetBSD: m25p.c,v 1.11 2019/08/13 17:11:32 tnn Exp $ */
 
 /*-
  * Copyright (c) 2006 Urbana-Champaign Independent Media Center.
@@ -42,7 +42,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: m25p.c,v 1.10 2019/08/04 22:13:24 tnn Exp $");
+__KERNEL_RCSID(0, "$NetBSD: m25p.c,v 1.11 2019/08/13 17:11:32 tnn Exp $");
 
 #include 
 #include 
@@ -114,16 +114,26 @@ static const struct m25p_info {
 	{ 0 }
 };
 
+static const struct device_compatible_entry compat_data[] = {
+	{ "jedec,spi-nor",	0 },
+	{ NULL,			0 }
+};
+
 static int
 m25p_match(device_t parent, cfdata_t cf, void *aux)
 {
 	struct spi_attach_args *sa = aux;
+	int res;
+
+	res = spi_compatible_match(sa, cf, compat_data);
+	if (!res)
+		return res;
 
 	/* configure for 20MHz, which is the max for normal reads */
 	if (spi_configure(sa->sa_handle, SPI_MODE_0, 2000))
-		return 0;
+		res = 0;
 
-	return 1;
+	return res;
 }
 
 static void



CVS commit: src/sys

2019-08-13 Thread Tobias Nygren
Module Name:src
Committed By:   tnn
Date:   Tue Aug 13 17:03:11 UTC 2019

Modified Files:
src/sys/arch/arm/at91: at91spi.c
src/sys/arch/arm/broadcom: bcm2835_spi.c
src/sys/arch/arm/imx: imxspi.c
src/sys/arch/arm/rockchip: rk_spi.c
src/sys/arch/arm/sunxi: sun4i_spi.c sun6i_spi.c
src/sys/arch/mips/alchemy/dev: auspi.c
src/sys/arch/mips/atheros/dev: arspi.c
src/sys/dev/marvell: mvspi.c

Log Message:
ensure spibus_attach_args is zero'ed


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/at91/at91spi.c
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/arm/broadcom/bcm2835_spi.c
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/imx/imxspi.c
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/rockchip/rk_spi.c
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/sunxi/sun4i_spi.c
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/arm/sunxi/sun6i_spi.c
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/mips/alchemy/dev/auspi.c
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/mips/atheros/dev/arspi.c
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/marvell/mvspi.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/at91/at91spi.c
diff -u src/sys/arch/arm/at91/at91spi.c:1.3 src/sys/arch/arm/at91/at91spi.c:1.4
--- src/sys/arch/arm/at91/at91spi.c:1.3	Fri Jul  1 19:31:17 2011
+++ src/sys/arch/arm/at91/at91spi.c	Tue Aug 13 17:03:10 2019
@@ -1,5 +1,5 @@
-/*	$Id: at91spi.c,v 1.3 2011/07/01 19:31:17 dyoung Exp $	*/
-/*	$NetBSD: at91spi.c,v 1.3 2011/07/01 19:31:17 dyoung Exp $	*/
+/*	$Id: at91spi.c,v 1.4 2019/08/13 17:03:10 tnn Exp $	*/
+/*	$NetBSD: at91spi.c,v 1.4 2019/08/13 17:03:10 tnn Exp $	*/
 
 /*-
  * Copyright (c) 2007 Embedtronics Oy. All rights reserved.
@@ -46,7 +46,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: at91spi.c,v 1.3 2011/07/01 19:31:17 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: at91spi.c,v 1.4 2019/08/13 17:03:10 tnn Exp $");
 
 #include "locators.h"
 
@@ -155,6 +155,7 @@ at91spi_attach_common(device_t parent, d
 		aprint_error("%s: no slaves!\n", device_xname(sc->sc_dev));
 	}
 
+	memset(, 0, sizeof(sba));
 	sba.sba_controller = >sc_spi;
 
 	/* initialize the queue */

Index: src/sys/arch/arm/broadcom/bcm2835_spi.c
diff -u src/sys/arch/arm/broadcom/bcm2835_spi.c:1.5 src/sys/arch/arm/broadcom/bcm2835_spi.c:1.6
--- src/sys/arch/arm/broadcom/bcm2835_spi.c:1.5	Sun Dec 10 21:38:26 2017
+++ src/sys/arch/arm/broadcom/bcm2835_spi.c	Tue Aug 13 17:03:10 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: bcm2835_spi.c,v 1.5 2017/12/10 21:38:26 skrll Exp $	*/
+/*	$NetBSD: bcm2835_spi.c,v 1.6 2019/08/13 17:03:10 tnn Exp $	*/
 
 /*
  * Copyright (c) 2012 Jonathan A. Kollasch
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: bcm2835_spi.c,v 1.5 2017/12/10 21:38:26 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bcm2835_spi.c,v 1.6 2019/08/13 17:03:10 tnn Exp $");
 
 #include 
 #include 
@@ -135,6 +135,7 @@ bcmspi_attach(device_t parent, device_t 
 	sc->sc_spi.sct_transfer = bcmspi_transfer;
 	sc->sc_spi.sct_nslaves = 3;
 
+	memset(, 0, sizeof(sba));
 	sba.sba_controller = >sc_spi;
 
 	(void) config_found_ia(self, "spibus", , spibus_print);

Index: src/sys/arch/arm/imx/imxspi.c
diff -u src/sys/arch/arm/imx/imxspi.c:1.3 src/sys/arch/arm/imx/imxspi.c:1.4
--- src/sys/arch/arm/imx/imxspi.c:1.3	Mon Aug  7 09:24:43 2017
+++ src/sys/arch/arm/imx/imxspi.c	Tue Aug 13 17:03:10 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: imxspi.c,v 1.3 2017/08/07 09:24:43 hkenken Exp $	*/
+/*	$NetBSD: imxspi.c,v 1.4 2019/08/13 17:03:10 tnn Exp $	*/
 
 /*-
  * Copyright (c) 2014  Genetec Corporation.  All rights reserved.
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: imxspi.c,v 1.3 2017/08/07 09:24:43 hkenken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: imxspi.c,v 1.4 2019/08/13 17:03:10 tnn Exp $");
 
 #include "opt_imx.h"
 #include "opt_imxspi.h"
@@ -114,6 +114,7 @@ imxspi_attach_common(device_t parent, st
 	if (!sc->sc_spi.sct_nslaves)
 		aprint_error_dev(sc->sc_dev, "no slaves!\n");
 
+	memset(, 0, sizeof(sba));
 	sba.sba_controller = >sc_spi;
 
 	/* initialize the queue */

Index: src/sys/arch/arm/rockchip/rk_spi.c
diff -u src/sys/arch/arm/rockchip/rk_spi.c:1.1 src/sys/arch/arm/rockchip/rk_spi.c:1.2
--- src/sys/arch/arm/rockchip/rk_spi.c:1.1	Mon Aug  5 15:22:59 2019
+++ src/sys/arch/arm/rockchip/rk_spi.c	Tue Aug 13 17:03:10 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: rk_spi.c,v 1.1 2019/08/05 15:22:59 tnn Exp $	*/
+/*	$NetBSD: rk_spi.c,v 1.2 2019/08/13 17:03:10 tnn Exp $	*/
 
 /*
  * Copyright (c) 2019 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rk_spi.c,v 1.1 2019/08/05 15:22:59 tnn Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rk_spi.c,v 1.2 2019/08/13 17:03:10 tnn Exp $");
 
 #include 
 #include 
@@ -253,6 +253,7 @@ rk_spi_attach(device_t parent, device_t 
 	sc->sc_spi.sct_transfer = rk_spi_transfer;
 	sc->sc_spi.sct_nslaves = 2;
 
+	memset(, 0, sizeof(sba));
 	sba.sba_controller = 

CVS commit: src/sys/dev/spi

2019-08-13 Thread Tobias Nygren
Module Name:src
Committed By:   tnn
Date:   Tue Aug 13 17:11:32 UTC 2019

Modified Files:
src/sys/dev/spi: m25p.c

Log Message:
m25p: add compatible entry for "jedec,spi-nor" and match on it


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/dev/spi/m25p.c

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



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

2019-08-13 Thread Tobias Nygren
Module Name:src
Committed By:   tnn
Date:   Tue Aug 13 17:21:01 UTC 2019

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

Log Message:
include the spiflash driver in the stock 64-bit kernel

As it can be attached via fdt now. For Rockpro64.


To generate a diff of this commit:
cvs rdiff -u -r1.104 -r1.105 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.104 src/sys/arch/evbarm/conf/GENERIC64:1.105
--- src/sys/arch/evbarm/conf/GENERIC64:1.104	Mon Aug  5 15:30:37 2019
+++ src/sys/arch/evbarm/conf/GENERIC64	Tue Aug 13 17:21:01 2019
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: GENERIC64,v 1.104 2019/08/05 15:30:37 tnn Exp $
+#	$NetBSD: GENERIC64,v 1.105 2019/08/13 17:21:01 tnn Exp $
 #
 #	GENERIC ARM (aarch64) kernel
 #
@@ -401,6 +401,8 @@ ld*		at nvme? nsid ?
 bcmspi*		at fdt?			# Broadcom BCM283x SPI
 rkspi*		at fdt?			# Rockchip SPI
 spi*		at spibus?
+m25p*		at spi?
+spiflash*	at spiflashbus?
 
 # Audio support
 hdaudio*	at fdt?			# Intel HDA



CVS commit: src/sys/dev/fdt

2019-08-13 Thread Tobias Nygren
Module Name:src
Committed By:   tnn
Date:   Tue Aug 13 16:46:49 UTC 2019

Modified Files:
src/sys/dev/fdt: fdtvar.h files.fdt
Added Files:
src/sys/dev/fdt: fdt_spi.c

Log Message:
fdt: add SPI controller frontend


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/dev/fdt/fdt_spi.c
cvs rdiff -u -r1.52 -r1.53 src/sys/dev/fdt/fdtvar.h
cvs rdiff -u -r1.44 -r1.45 src/sys/dev/fdt/files.fdt

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



CVS commit: src/sys/dev/fdt

2019-08-13 Thread Tobias Nygren
Module Name:src
Committed By:   tnn
Date:   Tue Aug 13 16:46:49 UTC 2019

Modified Files:
src/sys/dev/fdt: fdtvar.h files.fdt
Added Files:
src/sys/dev/fdt: fdt_spi.c

Log Message:
fdt: add SPI controller frontend


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/dev/fdt/fdt_spi.c
cvs rdiff -u -r1.52 -r1.53 src/sys/dev/fdt/fdtvar.h
cvs rdiff -u -r1.44 -r1.45 src/sys/dev/fdt/files.fdt

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/fdtvar.h
diff -u src/sys/dev/fdt/fdtvar.h:1.52 src/sys/dev/fdt/fdtvar.h:1.53
--- src/sys/dev/fdt/fdtvar.h:1.52	Fri Jun 14 11:08:18 2019
+++ src/sys/dev/fdt/fdtvar.h	Tue Aug 13 16:46:49 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: fdtvar.h,v 1.52 2019/06/14 11:08:18 hkenken Exp $ */
+/* $NetBSD: fdtvar.h,v 1.53 2019/08/13 16:46:49 tnn Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill 
@@ -82,6 +82,10 @@ struct fdtbus_i2c_controller_func {
 	i2c_tag_t (*get_tag)(device_t);
 };
 
+struct fdtbus_spi_controller_func {
+	struct spi_controller *	(*get_controller)(device_t);
+};
+
 struct fdtbus_gpio_controller;
 
 struct fdtbus_gpio_pin {
@@ -253,6 +257,8 @@ int		fdtbus_register_interrupt_controlle
 		const struct fdtbus_interrupt_controller_func *);
 int		fdtbus_register_i2c_controller(device_t, int,
 		const struct fdtbus_i2c_controller_func *);
+int		fdtbus_register_spi_controller(device_t, int,
+		const struct fdtbus_spi_controller_func *);
 int		fdtbus_register_gpio_controller(device_t, int,
 		const struct fdtbus_gpio_controller_func *);
 int		fdtbus_register_pinctrl_config(device_t, int,
@@ -370,6 +376,7 @@ void		fdtbus_power_reset(void);
 void		fdtbus_power_poweroff(void);
 
 device_t	fdtbus_attach_i2cbus(device_t, int, i2c_tag_t, cfprint_t);
+device_t	fdtbus_attach_spibus(device_t, int, cfprint_t);
 
 bool		fdtbus_set_data(const void *);
 const void *	fdtbus_get_data(void);

Index: src/sys/dev/fdt/files.fdt
diff -u src/sys/dev/fdt/files.fdt:1.44 src/sys/dev/fdt/files.fdt:1.45
--- src/sys/dev/fdt/files.fdt:1.44	Wed Mar 13 12:17:45 2019
+++ src/sys/dev/fdt/files.fdt	Tue Aug 13 16:46:49 2019
@@ -1,4 +1,4 @@
-# $NetBSD: files.fdt,v 1.44 2019/03/13 12:17:45 jmcneill Exp $
+# $NetBSD: files.fdt,v 1.45 2019/08/13 16:46:49 tnn Exp $
 
 include	"external/bsd/libfdt/conf/files.libfdt"
 
@@ -64,6 +64,7 @@ file	dev/fdt/fdt_pwm.c			fdt
 file	dev/fdt/fdt_regulator.c			fdt
 file	dev/fdt/fdt_reset.c			fdt
 file	dev/fdt/fdt_rtc.c			fdt
+file	dev/fdt/fdt_spi.c			fdt
 file	dev/fdt/fdt_syscon.c			fdt
 file	dev/fdt/fdt_pinctrl.c			fdt
 

Added files:

Index: src/sys/dev/fdt/fdt_spi.c
diff -u /dev/null src/sys/dev/fdt/fdt_spi.c:1.1
--- /dev/null	Tue Aug 13 16:46:50 2019
+++ src/sys/dev/fdt/fdt_spi.c	Tue Aug 13 16:46:49 2019
@@ -0,0 +1,114 @@
+/* $NetBSD: fdt_spi.c,v 1.1 2019/08/13 16:46:49 tnn Exp $ */
+
+/*
+ * Copyright (c) 2019 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Tobias Nygren.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include 
+__KERNEL_RCSID(0, "$NetBSD: fdt_spi.c,v 1.1 2019/08/13 16:46:49 tnn Exp $");
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+struct fdtbus_spi_controller {
+	device_t spi_dev;
+	int spi_phandle;
+	const struct fdtbus_spi_controller_func *spi_funcs;
+	LIST_ENTRY(fdtbus_spi_controller) spi_next;
+};
+
+static LIST_HEAD(, fdtbus_spi_controller) fdtbus_spi_controllers =
+LIST_HEAD_INITIALIZER(fdtbus_spi_controllers);
+
+int
+fdtbus_register_spi_controller(device_t dev, int phandle,
+const 

CVS commit: src/sys/dev/spi

2019-08-13 Thread Tobias Nygren
Module Name:src
Committed By:   tnn
Date:   Tue Aug 13 16:37:15 UTC 2019

Modified Files:
src/sys/dev/spi: spi.c spivar.h

Log Message:
spi: prepare for fdt direct attachment of spi slaves

Introduce sba_child_devices array in spibus_attach_args. If the parent has
populated sba_child_devices then attach them first. Then do any devices
devices the user has wired in the kernel config, if any.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/dev/spi/spi.c
cvs rdiff -u -r1.7 -r1.8 src/sys/dev/spi/spivar.h

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



CVS commit: src/sys/dev/spi

2019-08-13 Thread Tobias Nygren
Module Name:src
Committed By:   tnn
Date:   Tue Aug 13 16:37:15 UTC 2019

Modified Files:
src/sys/dev/spi: spi.c spivar.h

Log Message:
spi: prepare for fdt direct attachment of spi slaves

Introduce sba_child_devices array in spibus_attach_args. If the parent has
populated sba_child_devices then attach them first. Then do any devices
devices the user has wired in the kernel config, if any.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/dev/spi/spi.c
cvs rdiff -u -r1.7 -r1.8 src/sys/dev/spi/spivar.h

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

Modified files:

Index: src/sys/dev/spi/spi.c
diff -u src/sys/dev/spi/spi.c:1.11 src/sys/dev/spi/spi.c:1.12
--- src/sys/dev/spi/spi.c:1.11	Sat Mar  9 07:53:12 2019
+++ src/sys/dev/spi/spi.c	Tue Aug 13 16:37:15 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: spi.c,v 1.11 2019/03/09 07:53:12 mlelstv Exp $ */
+/* $NetBSD: spi.c,v 1.12 2019/08/13 16:37:15 tnn Exp $ */
 
 /*-
  * Copyright (c) 2006 Urbana-Champaign Independent Media Center.
@@ -42,7 +42,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: spi.c,v 1.11 2019/03/09 07:53:12 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: spi.c,v 1.12 2019/08/13 16:37:15 tnn Exp $");
 
 #include "locators.h"
 
@@ -102,6 +102,8 @@ struct spi_handle {
 	int			sh_slave;
 	int			sh_mode;
 	int			sh_speed;
+	int			sh_flags;
+#define SPIH_ATTACHED		1
 };
 
 #define SPI_MAXDATA 4096
@@ -151,15 +153,123 @@ spi_search(device_t parent, cfdata_t cf,
 		return -1;
 	}
 
+	memset(, 0, sizeof sa);
 	sa.sa_handle = >sc_slaves[addr];
+	if (ISSET(sa.sa_handle->sh_flags, SPIH_ATTACHED))
+		return -1;
 
-	if (config_match(parent, cf, ) > 0)
+	if (config_match(parent, cf, ) > 0) {
+		SET(sa.sa_handle->sh_flags, SPIH_ATTACHED);
 		config_attach(parent, cf, , spi_print);
+	}
 
 	return 0;
 }
 
 /*
+ * XXX this is the same as i2c_fill_compat. It could be refactored into a
+ * common fill_compat function with pointers to compat & ncompat instead
+ * of attach_args as the first parameter.
+ */
+static void
+spi_fill_compat(struct spi_attach_args *sa, const char *compat, size_t len,
+	char **buffer)
+{
+	int count, i;
+	const char *c, *start, **ptr;
+
+	*buffer = NULL;
+	for (i = count = 0, c = compat; i < len; i++, c++)
+		if (*c == 0)
+			count++;
+	count += 2;
+	ptr = malloc(sizeof(char*)*count, M_TEMP, M_WAITOK);
+	if (!ptr)
+		return;
+
+	for (i = count = 0, start = c = compat; i < len; i++, c++) {
+		if (*c == 0) {
+			ptr[count++] = start;
+			start = c + 1;
+		}
+	}
+	if (start < compat + len) {
+		/* last string not 0 terminated */
+		size_t l = c - start;
+		*buffer = malloc(l + 1, M_TEMP, M_WAITOK);
+		memcpy(*buffer, start, l);
+		(*buffer)[l] = 0;
+		ptr[count++] = *buffer;
+	}
+	ptr[count] = NULL;
+
+	sa->sa_compat = ptr;
+	sa->sa_ncompat = count;
+}
+
+static void
+spi_direct_attach_child_devices(device_t parent, struct spi_softc *sc,
+prop_array_t child_devices)
+{
+	unsigned int count;
+	prop_dictionary_t child;
+	prop_data_t cdata;
+	uint32_t slave;
+	uint64_t cookie;
+	struct spi_attach_args sa;
+	int loc[SPICF_NLOCS];
+	char *buf;
+	int i;
+
+	memset(loc, 0, sizeof loc);
+	count = prop_array_count(child_devices);
+	for (i = 0; i < count; i++) {
+		child = prop_array_get(child_devices, i);
+		if (!child)
+			continue;
+		if (!prop_dictionary_get_uint32(child, "slave", ))
+			continue;
+		if(slave >= sc->sc_controller.sct_nslaves)
+			continue;
+		if (!prop_dictionary_get_uint64(child, "cookie", ))
+			continue;
+		if (!(cdata = prop_dictionary_get(child, "compatible")))
+			continue;
+		loc[SPICF_SLAVE] = slave;
+
+		memset(, 0, sizeof sa);
+		sa.sa_handle = >sc_slaves[i];
+		if (ISSET(sa.sa_handle->sh_flags, SPIH_ATTACHED))
+			continue;
+		SET(sa.sa_handle->sh_flags, SPIH_ATTACHED);
+
+		buf = NULL;
+		spi_fill_compat(,
+prop_data_data_nocopy(cdata),
+prop_data_size(cdata), );
+		(void) config_found_sm_loc(parent, "spi",
+	   loc, , spi_print,
+	   NULL);
+
+		if (sa.sa_compat)
+			free(sa.sa_compat, M_TEMP);
+		if (buf)
+			free(buf, M_TEMP);
+	}
+}
+
+int
+spi_compatible_match(const struct spi_attach_args *sa, const cfdata_t cf,
+		 const struct device_compatible_entry *compats)
+{
+	if (sa->sa_ncompat > 0)
+		return device_compatible_match(sa->sa_compat, sa->sa_ncompat,
+	   compats, NULL);
+
+	return 1;
+}
+
+/*
  * API for device drivers.
  *
  * We provide wrapper routines to decouple the ABI for the SPI
@@ -197,9 +307,11 @@ spi_attach(device_t parent, device_t sel
 		sc->sc_slaves[i].sh_controller = >sc_controller;
 	}
 
-	/*
-	 * Locate and attach child devices
-	 */
+	/* First attach devices known to be present via fdt */
+	if (sba->sba_child_devices) {
+		spi_direct_attach_child_devices(self, sc, sba->sba_child_devices);
+	}
+	/* Then do any other devices the user may have manually wired */
 	config_search_ia(spi_search, self, "spi", NULL);
 }
 

Index: src/sys/dev/spi/spivar.h
diff -u 

CVS commit: [netbsd-9] src/doc

2019-08-13 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Aug 13 14:59:01 UTC 2019

Modified Files:
src/doc [netbsd-9]: CHANGES-9.0

Log Message:
Tickets #49 - #54


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.15 -r1.1.2.16 src/doc/CHANGES-9.0

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



CVS commit: [netbsd-9] src/doc

2019-08-13 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Aug 13 14:59:01 UTC 2019

Modified Files:
src/doc [netbsd-9]: CHANGES-9.0

Log Message:
Tickets #49 - #54


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.15 -r1.1.2.16 src/doc/CHANGES-9.0

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-9.0
diff -u src/doc/CHANGES-9.0:1.1.2.15 src/doc/CHANGES-9.0:1.1.2.16
--- src/doc/CHANGES-9.0:1.1.2.15	Mon Aug 12 17:33:25 2019
+++ src/doc/CHANGES-9.0	Tue Aug 13 14:59:01 2019
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-9.0,v 1.1.2.15 2019/08/12 17:33:25 martin Exp $
+# $NetBSD: CHANGES-9.0,v 1.1.2.16 2019/08/13 14:59:01 martin Exp $
 
 A complete list of changes from the initial NetBSD 9.0 branch on 2019-07-30
 until the 9.0 release:
@@ -1641,3 +1641,56 @@ sys/arch/arm/acpi/acpi_machdep.c		1.9,1.
 	Use same style test as acpi_md_OsWritable
 	[skrll, ticket #48]
 
+sys/net/npf/npf.c1.40
+sys/net/npf/npf_conf.c1.14
+sys/net/npf/npf_conn.h1.18
+sys/net/npf/npf_ctl.c1.55
+sys/net/npf/npf_handler.c			1.47
+sys/net/npf/npf_if.c1.10
+sys/net/npf/npf_impl.h1.76
+sys/net/npf/npf_inet.c1.55
+sys/net/npf/npf_nat.c1.47
+sys/net/npf/npf_os.c1.14
+sys/net/npf/npf_params.c			1.2
+sys/net/npf/npf_portmap.c			1.4
+sys/net/npf/npf_worker.c			1.7
+sys/net/npf/npfkern.h1.4
+usr.sbin/npf/npf-params.7			1.3
+usr.sbin/npf/npf.71.7
+usr.sbin/npf/npftest/libnpftest/npf_conn_test.c	1.3
+usr.sbin/npf/npftest/libnpftest/npf_nat_test.c	1.13
+usr.sbin/npf/npftest/libnpftest/npf_perf_test.c	1.9
+usr.sbin/npf/npftest/libnpftest/npf_rule_test.c	1.18
+usr.sbin/npf/npftest/libnpftest/npf_test_subr.c	1.16
+
+	NPF: minor API and documentation improvements.
+	[rmind, ticket #49]
+
+lib/libperfuse/ops.c1.87
+
+	Fix filehandles of directories for FUSE lock operations.
+	[manu, ticket #50]
+
+sys/arch/i386/stand/lib/bootinfo_biosgeom.c	1.24
+
+	Fix buffer overflow in BIOS disk geometry collection for bootinfo.
+	[manu, ticket #51]
+
+external/cddl/osnet/dist/uts/common/fs/zfs/dsl_dataset.c 1.5
+
+	Make "zfs promote" work.
+	[hannken, ticket #52]
+
+sys/arch/aarch64/include/bus_funcs.h		1.3
+
+	Really provide bus_funcs.h.
+	[skrll, ticket #53]
+
+sys/arch/aarch64/include/armreg.h		1.26
+sys/arch/arm/cortex/gtmr.c			1.41
+sys/arch/arm/cortex/gtmr_var.h			1.12
+sys/arch/arm/include/armreg.h			1.128
+
+	Add support for physical timers and sprinkle isb where needed.
+	[jmcneill, ticket #54]
+



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

2019-08-13 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Aug 13 14:57:50 UTC 2019

Modified Files:
src/sys/arch/aarch64/include [netbsd-9]: armreg.h
src/sys/arch/arm/cortex [netbsd-9]: gtmr.c gtmr_var.h
src/sys/arch/arm/include [netbsd-9]: armreg.h

Log Message:
Pull up following revision(s) (requested by jmcneill in ticket #54):

sys/arch/aarch64/include/armreg.h: revision 1.26
sys/arch/arm/cortex/gtmr.c: revision 1.41
sys/arch/arm/include/armreg.h: revision 1.128
sys/arch/arm/cortex/gtmr_var.h: revision 1.12

Add support for physical timers and sprinkle isb where needed.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.25.2.1 src/sys/arch/aarch64/include/armreg.h
cvs rdiff -u -r1.40 -r1.40.2.1 src/sys/arch/arm/cortex/gtmr.c
cvs rdiff -u -r1.11 -r1.11.4.1 src/sys/arch/arm/cortex/gtmr_var.h
cvs rdiff -u -r1.127 -r1.127.2.1 src/sys/arch/arm/include/armreg.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/armreg.h
diff -u src/sys/arch/aarch64/include/armreg.h:1.25 src/sys/arch/aarch64/include/armreg.h:1.25.2.1
--- src/sys/arch/aarch64/include/armreg.h:1.25	Sun Jun 16 15:16:15 2019
+++ src/sys/arch/aarch64/include/armreg.h	Tue Aug 13 14:57:49 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: armreg.h,v 1.25 2019/06/16 15:16:15 skrll Exp $ */
+/* $NetBSD: armreg.h,v 1.25.2.1 2019/08/13 14:57:49 martin Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -1138,6 +1138,16 @@ gtmr_cntv_ctl_write(uint32_t val)
 	reg_cntv_ctl_el0_write(val);
 }
 
+/*
+ * Counter-timer Physical Timer Control register
+ */
+static __inline uint32_t
+gtmr_cntp_ctl_read(void)
+{
+
+	return reg_cntp_ctl_el0_read();
+}
+
 static __inline void
 gtmr_cntp_ctl_write(uint32_t val)
 {
@@ -1146,6 +1156,23 @@ gtmr_cntp_ctl_write(uint32_t val)
 }
 
 /*
+ * Counter-timer Physical Timer TimerValue register
+ */
+static __inline uint32_t
+gtmr_cntp_tval_read(void)
+{
+
+	return reg_cntp_tval_el0_read();
+}
+
+static __inline void
+gtmr_cntp_tval_write(uint32_t val)
+{
+
+	reg_cntp_tval_el0_write(val);
+}
+
+/*
  * Counter-timer Virtual Timer TimerValue register
  */
 static __inline uint32_t
@@ -1162,6 +1189,22 @@ gtmr_cntv_tval_write(uint32_t val)
 	reg_cntv_tval_el0_write(val);
 }
 
+/*
+ * Counter-timer Physical Timer CompareValue register
+ */
+static __inline uint64_t
+gtmr_cntp_cval_read(void)
+{
+
+	return reg_cntp_cval_el0_read();
+}
+
+static __inline void
+gtmr_cntp_cval_write(uint64_t val)
+{
+
+	reg_cntp_cval_el0_write(val);
+}
 
 /*
  * Counter-timer Virtual Timer CompareValue register

Index: src/sys/arch/arm/cortex/gtmr.c
diff -u src/sys/arch/arm/cortex/gtmr.c:1.40 src/sys/arch/arm/cortex/gtmr.c:1.40.2.1
--- src/sys/arch/arm/cortex/gtmr.c:1.40	Sun Jun 16 10:57:59 2019
+++ src/sys/arch/arm/cortex/gtmr.c	Tue Aug 13 14:57:50 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: gtmr.c,v 1.40 2019/06/16 10:57:59 jmcneill Exp $	*/
+/*	$NetBSD: gtmr.c,v 1.40.2.1 2019/08/13 14:57:50 martin Exp $	*/
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: gtmr.c,v 1.40 2019/06/16 10:57:59 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gtmr.c,v 1.40.2.1 2019/08/13 14:57:50 martin Exp $");
 
 #include 
 #include 
@@ -55,6 +55,12 @@ static void gtmr_attach(device_t, device
 
 static u_int gtmr_get_timecount(struct timecounter *);
 
+static uint64_t gtmr_read_cntct(struct gtmr_softc *);
+static uint32_t gtmr_read_ctl(struct gtmr_softc *);
+static void gtmr_write_ctl(struct gtmr_softc *, uint32_t);
+static void gtmr_write_tval(struct gtmr_softc *, uint32_t);
+static void gtmr_write_cval(struct gtmr_softc *, uint64_t);
+
 static struct gtmr_softc gtmr_sc;
 
 struct gtmr_percpu {
@@ -99,6 +105,7 @@ gtmr_attach(device_t parent, device_t se
 	struct mpcore_attach_args * const mpcaa = aux;
 	struct gtmr_softc *sc = _sc;
 	prop_dictionary_t dict = device_properties(self);
+	prop_dictionary_t pdict = device_properties(device_parent(self));
 	char freqbuf[sizeof("X.XXX SHz")];
 	bool flag;
 
@@ -108,12 +115,16 @@ gtmr_attach(device_t parent, device_t se
 	if (!prop_dictionary_get_uint32(dict, "frequency", >sc_freq))
 		sc->sc_freq = gtmr_cntfrq_read();
 
+	if (!prop_dictionary_get_bool(dict, "physical", >sc_physical))
+	prop_dictionary_get_bool(pdict, "physical", >sc_physical);
+
 	KASSERT(sc->sc_freq != 0);
 
 	humanize_number(freqbuf, sizeof(freqbuf), sc->sc_freq, "Hz", 1000);
 
 	aprint_naive("\n");
-	aprint_normal(": ARM Generic Timer (%s)\n", freqbuf);
+	aprint_normal(": Generic Timer (%s, %s)\n", freqbuf,
+	sc->sc_physical ? "physical" : "virtual");
 
 	if (prop_dictionary_get_bool(dict, "sun50i-a64-unstable-timer", ) && flag) {
 		sc->sc_flags |= GTMR_FLAG_SUN50I_A64_UNSTABLE_TIMER;
@@ -155,12 +166,14 @@ gtmr_attach(device_t parent, device_t se
 	tc_init(_timecounter);
 
 	/* Disable the timer until we 

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

2019-08-13 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Aug 13 14:57:50 UTC 2019

Modified Files:
src/sys/arch/aarch64/include [netbsd-9]: armreg.h
src/sys/arch/arm/cortex [netbsd-9]: gtmr.c gtmr_var.h
src/sys/arch/arm/include [netbsd-9]: armreg.h

Log Message:
Pull up following revision(s) (requested by jmcneill in ticket #54):

sys/arch/aarch64/include/armreg.h: revision 1.26
sys/arch/arm/cortex/gtmr.c: revision 1.41
sys/arch/arm/include/armreg.h: revision 1.128
sys/arch/arm/cortex/gtmr_var.h: revision 1.12

Add support for physical timers and sprinkle isb where needed.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.25.2.1 src/sys/arch/aarch64/include/armreg.h
cvs rdiff -u -r1.40 -r1.40.2.1 src/sys/arch/arm/cortex/gtmr.c
cvs rdiff -u -r1.11 -r1.11.4.1 src/sys/arch/arm/cortex/gtmr_var.h
cvs rdiff -u -r1.127 -r1.127.2.1 src/sys/arch/arm/include/armreg.h

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



CVS commit: [netbsd-9] src/sys/arch/aarch64/include

2019-08-13 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Aug 13 14:54:32 UTC 2019

Modified Files:
src/sys/arch/aarch64/include [netbsd-9]: bus_funcs.h

Log Message:
Pull up following revision(s) (requested by skrll in ticket #53):

sys/arch/aarch64/include/bus_funcs.h: revision 1.3

Really provide bus_funcs.h


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.2.6.1 src/sys/arch/aarch64/include/bus_funcs.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/bus_funcs.h
diff -u src/sys/arch/aarch64/include/bus_funcs.h:1.2 src/sys/arch/aarch64/include/bus_funcs.h:1.2.6.1
--- src/sys/arch/aarch64/include/bus_funcs.h:1.2	Sun Apr  1 04:35:03 2018
+++ src/sys/arch/aarch64/include/bus_funcs.h	Tue Aug 13 14:54:31 2019
@@ -1,3 +1,3 @@
-/*	$NetBSD: bus_funcs.h,v 1.2 2018/04/01 04:35:03 ryo Exp $	*/
+/*	$NetBSD: bus_funcs.h,v 1.2.6.1 2019/08/13 14:54:31 martin Exp $	*/
 
-#include 
+#include 



CVS commit: [netbsd-9] src/sys/arch/aarch64/include

2019-08-13 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Aug 13 14:54:32 UTC 2019

Modified Files:
src/sys/arch/aarch64/include [netbsd-9]: bus_funcs.h

Log Message:
Pull up following revision(s) (requested by skrll in ticket #53):

sys/arch/aarch64/include/bus_funcs.h: revision 1.3

Really provide bus_funcs.h


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.2.6.1 src/sys/arch/aarch64/include/bus_funcs.h

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



CVS commit: [netbsd-9] src/external/cddl/osnet/dist/uts/common/fs/zfs

2019-08-13 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Aug 13 14:51:53 UTC 2019

Modified Files:
src/external/cddl/osnet/dist/uts/common/fs/zfs [netbsd-9]:
dsl_dataset.c

Log Message:
Pull up following revision(s) (requested by hannken in ticket #52):

external/cddl/osnet/dist/uts/common/fs/zfs/dsl_dataset.c: revision 1.5

Add missing "defined(__NetBSD__)" to make "zfs promote" work.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.4.2.1 \
src/external/cddl/osnet/dist/uts/common/fs/zfs/dsl_dataset.c

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



CVS commit: [netbsd-9] src/external/cddl/osnet/dist/uts/common/fs/zfs

2019-08-13 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Aug 13 14:51:53 UTC 2019

Modified Files:
src/external/cddl/osnet/dist/uts/common/fs/zfs [netbsd-9]:
dsl_dataset.c

Log Message:
Pull up following revision(s) (requested by hannken in ticket #52):

external/cddl/osnet/dist/uts/common/fs/zfs/dsl_dataset.c: revision 1.5

Add missing "defined(__NetBSD__)" to make "zfs promote" work.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.4.2.1 \
src/external/cddl/osnet/dist/uts/common/fs/zfs/dsl_dataset.c

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/osnet/dist/uts/common/fs/zfs/dsl_dataset.c
diff -u src/external/cddl/osnet/dist/uts/common/fs/zfs/dsl_dataset.c:1.4 src/external/cddl/osnet/dist/uts/common/fs/zfs/dsl_dataset.c:1.4.2.1
--- src/external/cddl/osnet/dist/uts/common/fs/zfs/dsl_dataset.c:1.4	Wed May 22 08:45:32 2019
+++ src/external/cddl/osnet/dist/uts/common/fs/zfs/dsl_dataset.c	Tue Aug 13 14:51:52 2019
@@ -2796,7 +2796,7 @@ dsl_dataset_promote_sync(void *arg, dmu_
 		ASSERT(!dsl_prop_hascb(ds));
 	}
 
-#if defined(__FreeBSD__) && defined(_KERNEL)
+#if (defined(__FreeBSD__) || defined(__NetBSD__)) && defined(_KERNEL)
 	mutex_exit(_namespace_lock);
 
 	kmem_free(newname, MAXPATHLEN);



CVS commit: [netbsd-9] src/sys/arch/i386/stand/lib

2019-08-13 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Aug 13 14:46:04 UTC 2019

Modified Files:
src/sys/arch/i386/stand/lib [netbsd-9]: bootinfo_biosgeom.c

Log Message:
Pull up following revision(s) (requested by manu in ticket #51):

sys/arch/i386/stand/lib/bootinfo_biosgeom.c: revision 1.24

Fix buffer overflow in BIOS disk geometry collect for bootinfo

This spares a boot-time panic on iMac with fusion drive, which
feature both a hard drive and a solid-state drive.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.23.18.1 \
src/sys/arch/i386/stand/lib/bootinfo_biosgeom.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/stand/lib/bootinfo_biosgeom.c
diff -u src/sys/arch/i386/stand/lib/bootinfo_biosgeom.c:1.23 src/sys/arch/i386/stand/lib/bootinfo_biosgeom.c:1.23.18.1
--- src/sys/arch/i386/stand/lib/bootinfo_biosgeom.c:1.23	Tue Jan 24 11:09:14 2017
+++ src/sys/arch/i386/stand/lib/bootinfo_biosgeom.c	Tue Aug 13 14:46:04 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: bootinfo_biosgeom.c,v 1.23 2017/01/24 11:09:14 nonaka Exp $	*/
+/*	$NetBSD: bootinfo_biosgeom.c,v 1.23.18.1 2019/08/13 14:46:04 martin Exp $	*/
 
 /*
  * Copyright (c) 1997
@@ -60,6 +60,7 @@ void
 bi_getbiosgeom(void)
 {
 	struct btinfo_biosgeom *bibg;
+	size_t bibg_len = sizeof(*bibg);
 	int i, j, nvalid;
 	int nhd;
 	unsigned int cksum;
@@ -72,8 +73,8 @@ bi_getbiosgeom(void)
 	printf("nhd %d\n", nhd);
 #endif
 
-	bibg = alloc(sizeof(struct btinfo_biosgeom)
-		 + (nhd - 1) * sizeof(struct bi_biosgeom_entry));
+	bibg_len += nhd * sizeof(struct bi_biosgeom_entry); 
+	bibg = alloc(bibg_len);
 	if (bibg == NULL)
 		return;
 
@@ -175,6 +176,8 @@ bi_getbiosgeom(void)
 
 	bibg->num = nvalid;
 
-	BI_ADD(bibg, BTINFO_BIOSGEOM, sizeof(struct btinfo_biosgeom)
-	   + nvalid * sizeof(struct bi_biosgeom_entry));
+	if (nvalid < nhd)
+		bibg_len -= (nhd - nvalid) * sizeof(struct bi_biosgeom_entry);
+
+	BI_ADD(bibg, BTINFO_BIOSGEOM, bibg_len);
 }



CVS commit: [netbsd-9] src/sys/arch/i386/stand/lib

2019-08-13 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Aug 13 14:46:04 UTC 2019

Modified Files:
src/sys/arch/i386/stand/lib [netbsd-9]: bootinfo_biosgeom.c

Log Message:
Pull up following revision(s) (requested by manu in ticket #51):

sys/arch/i386/stand/lib/bootinfo_biosgeom.c: revision 1.24

Fix buffer overflow in BIOS disk geometry collect for bootinfo

This spares a boot-time panic on iMac with fusion drive, which
feature both a hard drive and a solid-state drive.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.23.18.1 \
src/sys/arch/i386/stand/lib/bootinfo_biosgeom.c

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



CVS commit: [netbsd-9] src/lib/libperfuse

2019-08-13 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Aug 13 14:44:37 UTC 2019

Modified Files:
src/lib/libperfuse [netbsd-9]: ops.c

Log Message:
Pull up following revision(s) (requested by manu in ticket #50):

lib/libperfuse/ops.c: revision 1.87

Rollback directory filehandle screening for FUSE lock operations
libfuse has a different usage of filehandles for files and directories.

A directory filehandle is valid only for directory operations such
as OPENDIR, READDIR, RELEASEDIR, FSYNCDIR. Change of src/lib/libperfuse/ops.c
1.85-1.86 made sure filehandles of directories were only sent for that
operations.

However, the status of lock operations GETLK, SETLK, SETLKW was overlooked.

The only FUSE filesystem I found using locks is GlusterFS, and it needs
directory filehandles to be provided on lock operations, otherwise locking
crashes the filesystem. Hence this change brings back filehandles for
lock operations on directories.


To generate a diff of this commit:
cvs rdiff -u -r1.86 -r1.86.2.1 src/lib/libperfuse/ops.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/libperfuse/ops.c
diff -u src/lib/libperfuse/ops.c:1.86 src/lib/libperfuse/ops.c:1.86.2.1
--- src/lib/libperfuse/ops.c:1.86	Sat Feb  9 02:22:45 2019
+++ src/lib/libperfuse/ops.c	Tue Aug 13 14:44:37 2019
@@ -1,4 +1,4 @@
-/*  $NetBSD: ops.c,v 1.86 2019/02/09 02:22:45 manu Exp $ */
+/*  $NetBSD: ops.c,v 1.86.2.1 2019/08/13 14:44:37 martin Exp $ */
 
 /*-
  *  Copyright (c) 2010-2011 Emmanuel Dreyfus. All rights reserved.
@@ -2976,24 +2976,15 @@ perfuse_node_advlock(struct puffs_usermo
 	 * expect one. E.g.: if we provide none, GlusterFS logs an error
 	 * "0-glusterfs-fuse: xl is NULL"
 	 *
-	 * There is one exception with directories where filehandle
-	 * is not included, because libfuse uses different filehandle
-	 * in opendir/releasedir/readdir/fsyncdir compared to other 
-	 * operations. Who locks a directory anyway?
-	 *
 	 * We need the read file handle if the file is open read only,
 	 * in order to support shared locks on read-only files.
 	 * NB: The kernel always sends advlock for read-only
 	 * files at exit time when the process used lock, see
 	 * sys_exit -> exit1 -> fd_free -> fd_close -> VOP_ADVLOCK
 	 */
-	if (!PN_ISDIR(opc)) {
-		if ((fh = perfuse_get_fh(opc, FREAD)) == FUSE_UNKNOWN_FH) {
-			error = EBADF;
-			goto out;
-		}
-	} else {
-		fh = FUSE_UNKNOWN_FH;
+	if ((fh = perfuse_get_fh(opc, FREAD)) == FUSE_UNKNOWN_FH) {
+		error = EBADF;
+		goto out;
 	}
 
 	ps = puffs_getspecific(pu);



CVS commit: [netbsd-9] src/lib/libperfuse

2019-08-13 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Aug 13 14:44:37 UTC 2019

Modified Files:
src/lib/libperfuse [netbsd-9]: ops.c

Log Message:
Pull up following revision(s) (requested by manu in ticket #50):

lib/libperfuse/ops.c: revision 1.87

Rollback directory filehandle screening for FUSE lock operations
libfuse has a different usage of filehandles for files and directories.

A directory filehandle is valid only for directory operations such
as OPENDIR, READDIR, RELEASEDIR, FSYNCDIR. Change of src/lib/libperfuse/ops.c
1.85-1.86 made sure filehandles of directories were only sent for that
operations.

However, the status of lock operations GETLK, SETLK, SETLKW was overlooked.

The only FUSE filesystem I found using locks is GlusterFS, and it needs
directory filehandles to be provided on lock operations, otherwise locking
crashes the filesystem. Hence this change brings back filehandles for
lock operations on directories.


To generate a diff of this commit:
cvs rdiff -u -r1.86 -r1.86.2.1 src/lib/libperfuse/ops.c

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



CVS commit: [netbsd-9] src

2019-08-13 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Aug 13 14:35:56 UTC 2019

Modified Files:
src/sys/net/npf [netbsd-9]: npf.c npf_conf.c npf_conn.h npf_ctl.c
npf_handler.c npf_if.c npf_impl.h npf_inet.c npf_nat.c npf_os.c
npf_params.c npf_portmap.c npf_worker.c npfkern.h
src/usr.sbin/npf [netbsd-9]: npf-params.7 npf.7
src/usr.sbin/npf/npftest/libnpftest [netbsd-9]: npf_conn_test.c
npf_nat_test.c npf_perf_test.c npf_rule_test.c npf_test_subr.c

Log Message:
Pull up following revision(s) (requested by rmind in ticket #49):

usr.sbin/npf/npf.7: revision 1.7
sys/net/npf/npfkern.h: revision 1.4
sys/net/npf/npf_conn.h: revision 1.18
usr.sbin/npf/npftest/libnpftest/npf_nat_test.c: revision 1.13
sys/net/npf/npf_ctl.c: revision 1.55
sys/net/npf/npf_os.c: revision 1.14
sys/net/npf/npf_conf.c: revision 1.14
usr.sbin/npf/npftest/libnpftest/npf_conn_test.c: revision 1.3
usr.sbin/npf/npftest/libnpftest/npf_perf_test.c: revision 1.9
sys/net/npf/npf_impl.h: revision 1.76
sys/net/npf/npf_portmap.c: revision 1.4
sys/net/npf/npf_params.c: revision 1.2
sys/net/npf/npf.c: revision 1.40
usr.sbin/npf/npftest/libnpftest/npf_test_subr.c: revision 1.16
usr.sbin/npf/npftest/libnpftest/npf_rule_test.c: revision 1.18
sys/net/npf/npf_nat.c: revision 1.47
sys/net/npf/npf_handler.c: revision 1.47
sys/net/npf/npf_inet.c: revision 1.55
sys/net/npf/npf_if.c: revision 1.10
sys/net/npf/npf_worker.c: revision 1.7
usr.sbin/npf/npf-params.7: revision 1.3

npf-params(7): add more bpf.jit details.
>From David H. Gutteridge.

Adjust some internal NPF APIs:
* npfkern: use the npfk_ prefix.
* NPF portmap: amend the API so it could be used elsewhere.
* Make npf_connkey_t public.

npf.7: add xref to npf-params.7
(Adding directly here since this particular file isn't included in
rmind@'s upstream GitHub repo at present.)


To generate a diff of this commit:
cvs rdiff -u -r1.38.2.1 -r1.38.2.2 src/sys/net/npf/npf.c
cvs rdiff -u -r1.13 -r1.13.2.1 src/sys/net/npf/npf_conf.c
cvs rdiff -u -r1.16.2.1 -r1.16.2.2 src/sys/net/npf/npf_conn.h
cvs rdiff -u -r1.54 -r1.54.2.1 src/sys/net/npf/npf_ctl.c \
src/sys/net/npf/npf_inet.c
cvs rdiff -u -r1.46 -r1.46.2.1 src/sys/net/npf/npf_handler.c \
src/sys/net/npf/npf_nat.c
cvs rdiff -u -r1.9 -r1.9.4.1 src/sys/net/npf/npf_if.c
cvs rdiff -u -r1.75 -r1.75.2.1 src/sys/net/npf/npf_impl.h
cvs rdiff -u -r1.12 -r1.12.2.1 src/sys/net/npf/npf_os.c
cvs rdiff -u -r1.1 -r1.1.2.1 src/sys/net/npf/npf_params.c
cvs rdiff -u -r1.3 -r1.3.2.1 src/sys/net/npf/npf_portmap.c \
src/sys/net/npf/npfkern.h
cvs rdiff -u -r1.6 -r1.6.4.1 src/sys/net/npf/npf_worker.c
cvs rdiff -u -r1.2 -r1.2.2.1 src/usr.sbin/npf/npf-params.7
cvs rdiff -u -r1.6 -r1.6.2.1 src/usr.sbin/npf/npf.7
cvs rdiff -u -r1.2 -r1.2.2.1 \
src/usr.sbin/npf/npftest/libnpftest/npf_conn_test.c
cvs rdiff -u -r1.12 -r1.12.2.1 \
src/usr.sbin/npf/npftest/libnpftest/npf_nat_test.c
cvs rdiff -u -r1.8 -r1.8.2.1 \
src/usr.sbin/npf/npftest/libnpftest/npf_perf_test.c
cvs rdiff -u -r1.17 -r1.17.2.1 \
src/usr.sbin/npf/npftest/libnpftest/npf_rule_test.c
cvs rdiff -u -r1.15 -r1.15.2.1 \
src/usr.sbin/npf/npftest/libnpftest/npf_test_subr.c

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



CVS commit: [netbsd-9] src

2019-08-13 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Aug 13 14:35:56 UTC 2019

Modified Files:
src/sys/net/npf [netbsd-9]: npf.c npf_conf.c npf_conn.h npf_ctl.c
npf_handler.c npf_if.c npf_impl.h npf_inet.c npf_nat.c npf_os.c
npf_params.c npf_portmap.c npf_worker.c npfkern.h
src/usr.sbin/npf [netbsd-9]: npf-params.7 npf.7
src/usr.sbin/npf/npftest/libnpftest [netbsd-9]: npf_conn_test.c
npf_nat_test.c npf_perf_test.c npf_rule_test.c npf_test_subr.c

Log Message:
Pull up following revision(s) (requested by rmind in ticket #49):

usr.sbin/npf/npf.7: revision 1.7
sys/net/npf/npfkern.h: revision 1.4
sys/net/npf/npf_conn.h: revision 1.18
usr.sbin/npf/npftest/libnpftest/npf_nat_test.c: revision 1.13
sys/net/npf/npf_ctl.c: revision 1.55
sys/net/npf/npf_os.c: revision 1.14
sys/net/npf/npf_conf.c: revision 1.14
usr.sbin/npf/npftest/libnpftest/npf_conn_test.c: revision 1.3
usr.sbin/npf/npftest/libnpftest/npf_perf_test.c: revision 1.9
sys/net/npf/npf_impl.h: revision 1.76
sys/net/npf/npf_portmap.c: revision 1.4
sys/net/npf/npf_params.c: revision 1.2
sys/net/npf/npf.c: revision 1.40
usr.sbin/npf/npftest/libnpftest/npf_test_subr.c: revision 1.16
usr.sbin/npf/npftest/libnpftest/npf_rule_test.c: revision 1.18
sys/net/npf/npf_nat.c: revision 1.47
sys/net/npf/npf_handler.c: revision 1.47
sys/net/npf/npf_inet.c: revision 1.55
sys/net/npf/npf_if.c: revision 1.10
sys/net/npf/npf_worker.c: revision 1.7
usr.sbin/npf/npf-params.7: revision 1.3

npf-params(7): add more bpf.jit details.
>From David H. Gutteridge.

Adjust some internal NPF APIs:
* npfkern: use the npfk_ prefix.
* NPF portmap: amend the API so it could be used elsewhere.
* Make npf_connkey_t public.

npf.7: add xref to npf-params.7
(Adding directly here since this particular file isn't included in
rmind@'s upstream GitHub repo at present.)


To generate a diff of this commit:
cvs rdiff -u -r1.38.2.1 -r1.38.2.2 src/sys/net/npf/npf.c
cvs rdiff -u -r1.13 -r1.13.2.1 src/sys/net/npf/npf_conf.c
cvs rdiff -u -r1.16.2.1 -r1.16.2.2 src/sys/net/npf/npf_conn.h
cvs rdiff -u -r1.54 -r1.54.2.1 src/sys/net/npf/npf_ctl.c \
src/sys/net/npf/npf_inet.c
cvs rdiff -u -r1.46 -r1.46.2.1 src/sys/net/npf/npf_handler.c \
src/sys/net/npf/npf_nat.c
cvs rdiff -u -r1.9 -r1.9.4.1 src/sys/net/npf/npf_if.c
cvs rdiff -u -r1.75 -r1.75.2.1 src/sys/net/npf/npf_impl.h
cvs rdiff -u -r1.12 -r1.12.2.1 src/sys/net/npf/npf_os.c
cvs rdiff -u -r1.1 -r1.1.2.1 src/sys/net/npf/npf_params.c
cvs rdiff -u -r1.3 -r1.3.2.1 src/sys/net/npf/npf_portmap.c \
src/sys/net/npf/npfkern.h
cvs rdiff -u -r1.6 -r1.6.4.1 src/sys/net/npf/npf_worker.c
cvs rdiff -u -r1.2 -r1.2.2.1 src/usr.sbin/npf/npf-params.7
cvs rdiff -u -r1.6 -r1.6.2.1 src/usr.sbin/npf/npf.7
cvs rdiff -u -r1.2 -r1.2.2.1 \
src/usr.sbin/npf/npftest/libnpftest/npf_conn_test.c
cvs rdiff -u -r1.12 -r1.12.2.1 \
src/usr.sbin/npf/npftest/libnpftest/npf_nat_test.c
cvs rdiff -u -r1.8 -r1.8.2.1 \
src/usr.sbin/npf/npftest/libnpftest/npf_perf_test.c
cvs rdiff -u -r1.17 -r1.17.2.1 \
src/usr.sbin/npf/npftest/libnpftest/npf_rule_test.c
cvs rdiff -u -r1.15 -r1.15.2.1 \
src/usr.sbin/npf/npftest/libnpftest/npf_test_subr.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.c
diff -u src/sys/net/npf/npf.c:1.38.2.1 src/sys/net/npf/npf.c:1.38.2.2
--- src/sys/net/npf/npf.c:1.38.2.1	Wed Aug  7 08:28:37 2019
+++ src/sys/net/npf/npf.c	Tue Aug 13 14:35:55 2019
@@ -33,7 +33,7 @@
 
 #ifdef _KERNEL
 #include 
-__KERNEL_RCSID(0, "$NetBSD: npf.c,v 1.38.2.1 2019/08/07 08:28:37 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: npf.c,v 1.38.2.2 2019/08/13 14:35:55 martin Exp $");
 
 #include 
 #include 
@@ -49,7 +49,7 @@ __KERNEL_RCSID(0, "$NetBSD: npf.c,v 1.38
 static __read_mostly npf_t *	npf_kernel_ctx = NULL;
 
 __dso_public int
-npf_sysinit(unsigned nworkers)
+npfk_sysinit(unsigned nworkers)
 {
 	npf_bpf_sysinit();
 	npf_tableset_sysinit();
@@ -58,7 +58,7 @@ npf_sysinit(unsigned nworkers)
 }
 
 __dso_public void
-npf_sysfini(void)
+npfk_sysfini(void)
 {
 	npf_worker_sysfini();
 	npf_nat_sysfini();
@@ -67,7 +67,7 @@ npf_sysfini(void)
 }
 
 __dso_public npf_t *
-npf_create(int flags, const npf_mbufops_t *mbufops, const npf_ifops_t *ifops)
+npfk_create(int flags, const npf_mbufops_t *mbufops, const npf_ifops_t *ifops)
 {
 	npf_t *npf;
 
@@ -94,7 +94,7 @@ npf_create(int flags, const npf_mbufops_
 }
 
 __dso_public void
-npf_destroy(npf_t *npf)
+npfk_destroy(npf_t *npf)
 {
 	/*
 	 * Destroy the current configuration.  Note: at this point all
@@ -117,25 +117,25 @@ npf_destroy(npf_t *npf)
 }
 
 __dso_public int
-npf_load(npf_t *npf, void *config_ref, npf_error_t *err)
+npfk_load(npf_t *npf, void *config_ref, npf_error_t *err)
 {
 	return 

CVS commit: [netbsd-8] src/doc

2019-08-13 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Aug 13 14:30:50 UTC 2019

Modified Files:
src/doc [netbsd-8]: CHANGES-8.2

Log Message:
Tickets #1335 and #1336


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.24 -r1.1.2.25 src/doc/CHANGES-8.2

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



CVS commit: [netbsd-8] src/doc

2019-08-13 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Aug 13 14:30:50 UTC 2019

Modified Files:
src/doc [netbsd-8]: CHANGES-8.2

Log Message:
Tickets #1335 and #1336


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.24 -r1.1.2.25 src/doc/CHANGES-8.2

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

Modified files:

Index: src/doc/CHANGES-8.2
diff -u src/doc/CHANGES-8.2:1.1.2.24 src/doc/CHANGES-8.2:1.1.2.25
--- src/doc/CHANGES-8.2:1.1.2.24	Mon Aug 12 17:20:03 2019
+++ src/doc/CHANGES-8.2	Tue Aug 13 14:30:50 2019
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-8.2,v 1.1.2.24 2019/08/12 17:20:03 martin Exp $
+# $NetBSD: CHANGES-8.2,v 1.1.2.25 2019/08/13 14:30:50 martin Exp $
 
 A complete list of changes from the NetBSD 8.1 release to the NetBSD 8.2
 release:
@@ -561,3 +561,13 @@ sys/dev/usb/ohci.c1.290
 	Adjust KASSERT()s to handle polling case.
 	[mrg, ticket #1334]
 
+lib/libperfuse/ops.c1.87
+
+	Fix filehandles of directories for FUSE lock operations.
+	[manu, ticket #1335]
+
+sys/arch/i386/stand/lib/bootinfo_biosgeom.c	1.24
+
+	Fix buffer overflow in BIOS disk geometry collection for bootinfo.
+	[manu, ticket #1336]
+



CVS commit: [netbsd-8] src/sys/arch/i386/stand/lib

2019-08-13 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Aug 13 14:29:57 UTC 2019

Modified Files:
src/sys/arch/i386/stand/lib [netbsd-8]: bootinfo_biosgeom.c

Log Message:
Pull up following revision(s) (requested by manu in ticket #1336):

sys/arch/i386/stand/lib/bootinfo_biosgeom.c: revision 1.24

Fix buffer overflow in BIOS disk geometry collect for bootinfo

This spares a boot-time panic on iMac with fusion drive, which
feature both a hard drive and a solid-state drive.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.23.6.1 \
src/sys/arch/i386/stand/lib/bootinfo_biosgeom.c

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



CVS commit: [netbsd-8] src/sys/arch/i386/stand/lib

2019-08-13 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Aug 13 14:29:57 UTC 2019

Modified Files:
src/sys/arch/i386/stand/lib [netbsd-8]: bootinfo_biosgeom.c

Log Message:
Pull up following revision(s) (requested by manu in ticket #1336):

sys/arch/i386/stand/lib/bootinfo_biosgeom.c: revision 1.24

Fix buffer overflow in BIOS disk geometry collect for bootinfo

This spares a boot-time panic on iMac with fusion drive, which
feature both a hard drive and a solid-state drive.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.23.6.1 \
src/sys/arch/i386/stand/lib/bootinfo_biosgeom.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/stand/lib/bootinfo_biosgeom.c
diff -u src/sys/arch/i386/stand/lib/bootinfo_biosgeom.c:1.23 src/sys/arch/i386/stand/lib/bootinfo_biosgeom.c:1.23.6.1
--- src/sys/arch/i386/stand/lib/bootinfo_biosgeom.c:1.23	Tue Jan 24 11:09:14 2017
+++ src/sys/arch/i386/stand/lib/bootinfo_biosgeom.c	Tue Aug 13 14:29:57 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: bootinfo_biosgeom.c,v 1.23 2017/01/24 11:09:14 nonaka Exp $	*/
+/*	$NetBSD: bootinfo_biosgeom.c,v 1.23.6.1 2019/08/13 14:29:57 martin Exp $	*/
 
 /*
  * Copyright (c) 1997
@@ -60,6 +60,7 @@ void
 bi_getbiosgeom(void)
 {
 	struct btinfo_biosgeom *bibg;
+	size_t bibg_len = sizeof(*bibg);
 	int i, j, nvalid;
 	int nhd;
 	unsigned int cksum;
@@ -72,8 +73,8 @@ bi_getbiosgeom(void)
 	printf("nhd %d\n", nhd);
 #endif
 
-	bibg = alloc(sizeof(struct btinfo_biosgeom)
-		 + (nhd - 1) * sizeof(struct bi_biosgeom_entry));
+	bibg_len += nhd * sizeof(struct bi_biosgeom_entry); 
+	bibg = alloc(bibg_len);
 	if (bibg == NULL)
 		return;
 
@@ -175,6 +176,8 @@ bi_getbiosgeom(void)
 
 	bibg->num = nvalid;
 
-	BI_ADD(bibg, BTINFO_BIOSGEOM, sizeof(struct btinfo_biosgeom)
-	   + nvalid * sizeof(struct bi_biosgeom_entry));
+	if (nvalid < nhd)
+		bibg_len -= (nhd - nvalid) * sizeof(struct bi_biosgeom_entry);
+
+	BI_ADD(bibg, BTINFO_BIOSGEOM, bibg_len);
 }



CVS commit: [netbsd-8] src/lib/libperfuse

2019-08-13 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Aug 13 14:27:22 UTC 2019

Modified Files:
src/lib/libperfuse [netbsd-8]: ops.c

Log Message:
Pull up following revision(s) (requested by manu in ticket #1335):

lib/libperfuse/ops.c: revision 1.87

Rollback directory filehandle screening for FUSE lock operations
libfuse has a different usage of filehandles for files and directories.

A directory filehandle is valid only for directory operations such
as OPENDIR, READDIR, RELEASEDIR, FSYNCDIR. Change of src/lib/libperfuse/ops.c
1.85-1.86 made sure filehandles of directories were only sent for that
operations.

However, the status of lock operations GETLK, SETLK, SETLKW was overlooked.
The only FUSE filesystem I found using locks is GlusterFS, and it needs
directory filehandles to be provided on lock operations, otherwise locking
crashes the filesystem. Hence this change brings back filehandles for
lock operations on directories.


To generate a diff of this commit:
cvs rdiff -u -r1.84.8.1 -r1.84.8.2 src/lib/libperfuse/ops.c

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



CVS commit: [netbsd-8] src/lib/libperfuse

2019-08-13 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Aug 13 14:27:22 UTC 2019

Modified Files:
src/lib/libperfuse [netbsd-8]: ops.c

Log Message:
Pull up following revision(s) (requested by manu in ticket #1335):

lib/libperfuse/ops.c: revision 1.87

Rollback directory filehandle screening for FUSE lock operations
libfuse has a different usage of filehandles for files and directories.

A directory filehandle is valid only for directory operations such
as OPENDIR, READDIR, RELEASEDIR, FSYNCDIR. Change of src/lib/libperfuse/ops.c
1.85-1.86 made sure filehandles of directories were only sent for that
operations.

However, the status of lock operations GETLK, SETLK, SETLKW was overlooked.
The only FUSE filesystem I found using locks is GlusterFS, and it needs
directory filehandles to be provided on lock operations, otherwise locking
crashes the filesystem. Hence this change brings back filehandles for
lock operations on directories.


To generate a diff of this commit:
cvs rdiff -u -r1.84.8.1 -r1.84.8.2 src/lib/libperfuse/ops.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/libperfuse/ops.c
diff -u src/lib/libperfuse/ops.c:1.84.8.1 src/lib/libperfuse/ops.c:1.84.8.2
--- src/lib/libperfuse/ops.c:1.84.8.1	Sun Feb 10 13:40:41 2019
+++ src/lib/libperfuse/ops.c	Tue Aug 13 14:27:22 2019
@@ -1,4 +1,4 @@
-/*  $NetBSD: ops.c,v 1.84.8.1 2019/02/10 13:40:41 martin Exp $ */
+/*  $NetBSD: ops.c,v 1.84.8.2 2019/08/13 14:27:22 martin Exp $ */
 
 /*-
  *  Copyright (c) 2010-2011 Emmanuel Dreyfus. All rights reserved.
@@ -2976,24 +2976,15 @@ perfuse_node_advlock(struct puffs_usermo
 	 * expect one. E.g.: if we provide none, GlusterFS logs an error
 	 * "0-glusterfs-fuse: xl is NULL"
 	 *
-	 * There is one exception with directories where filehandle
-	 * is not included, because libfuse uses different filehandle
-	 * in opendir/releasedir/readdir/fsyncdir compared to other 
-	 * operations. Who locks a directory anyway?
-	 *
 	 * We need the read file handle if the file is open read only,
 	 * in order to support shared locks on read-only files.
 	 * NB: The kernel always sends advlock for read-only
 	 * files at exit time when the process used lock, see
 	 * sys_exit -> exit1 -> fd_free -> fd_close -> VOP_ADVLOCK
 	 */
-	if (!PN_ISDIR(opc)) {
-		if ((fh = perfuse_get_fh(opc, FREAD)) == FUSE_UNKNOWN_FH) {
-			error = EBADF;
-			goto out;
-		}
-	} else {
-		fh = FUSE_UNKNOWN_FH;
+	if ((fh = perfuse_get_fh(opc, FREAD)) == FUSE_UNKNOWN_FH) {
+		error = EBADF;
+		goto out;
 	}
 
 	ps = puffs_getspecific(pu);



CVS commit: src/share/man/man4

2019-08-13 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Tue Aug 13 13:22:16 UTC 2019

Modified Files:
src/share/man/man4: wsmux.4

Log Message:
Drop xref to wsfontload(8).


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/share/man/man4/wsmux.4

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

Modified files:

Index: src/share/man/man4/wsmux.4
diff -u src/share/man/man4/wsmux.4:1.16 src/share/man/man4/wsmux.4:1.17
--- src/share/man/man4/wsmux.4:1.16	Tue Aug 13 10:31:19 2019
+++ src/share/man/man4/wsmux.4	Tue Aug 13 13:22:16 2019
@@ -1,4 +1,4 @@
-.\" $NetBSD: wsmux.4,v 1.16 2019/08/13 10:31:19 uwe Exp $
+.\" $NetBSD: wsmux.4,v 1.17 2019/08/13 13:22:16 uwe Exp $
 .\"
 .\" Copyright (c) 1999 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -111,7 +111,6 @@ a.k.a.
 .Xr moused 8 ,
 .Xr wsconscfg 8 ,
 .Xr wsconsctl 8 ,
-.Xr wsfontload 8 ,
 .Xr wsmoused 8 ,
 .Xr wsmuxctl 8
 .Sh CAVEATS



CVS commit: src/share/man/man4

2019-08-13 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Tue Aug 13 13:22:16 UTC 2019

Modified Files:
src/share/man/man4: wsmux.4

Log Message:
Drop xref to wsfontload(8).


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/share/man/man4/wsmux.4

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



CVS commit: src/doc

2019-08-13 Thread Sevan Janiyan
Module Name:src
Committed By:   sevan
Date:   Tue Aug 13 12:38:25 UTC 2019

Modified Files:
src/doc: 3RDPARTY

Log Message:
new nawk on Github release page


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

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



CVS commit: src/doc

2019-08-13 Thread Sevan Janiyan
Module Name:src
Committed By:   sevan
Date:   Tue Aug 13 12:38:25 UTC 2019

Modified Files:
src/doc: 3RDPARTY

Log Message:
new nawk on Github release page


To generate a diff of this commit:
cvs rdiff -u -r1.1642 -r1.1643 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.1642 src/doc/3RDPARTY:1.1643
--- src/doc/3RDPARTY:1.1642	Thu Aug  8 13:52:13 2019
+++ src/doc/3RDPARTY	Tue Aug 13 12:38:25 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.1642 2019/08/08 13:52:13 christos Exp $
+#	$NetBSD: 3RDPARTY,v 1.1643 2019/08/13 12:38:25 sevan Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -947,11 +947,11 @@ Delete the otherOS directory before impo
 
 Package:	nawk
 Version:	2012-12-20
-Current Vers:	2012-12-20
+Current Vers:	2018-08-27
 Maintainer:	Brian Kernighan 
 Archive Site:	https://github.com/onetrueawk/awk
 Home Page:	http://www.cs.princeton.edu/~bwk/btl.mirror/
-Date:		2019-01-09
+Date:		2019-08-13
 Mailing List:
 Responsible:	jdolecek
 License:	BSD-like



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

2019-08-13 Thread Yuuki Enomoto
Module Name:src
Committed By:   uki
Date:   Tue Aug 13 12:29:00 UTC 2019

Modified Files:
src/distrib/sets/lists/xbase: mi

Log Message:
Give syspkg names to xbase mi binaries and manuals


To generate a diff of this commit:
cvs rdiff -u -r1.152 -r1.153 src/distrib/sets/lists/xbase/mi

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

Modified files:

Index: src/distrib/sets/lists/xbase/mi
diff -u src/distrib/sets/lists/xbase/mi:1.152 src/distrib/sets/lists/xbase/mi:1.153
--- src/distrib/sets/lists/xbase/mi:1.152	Thu Jun 20 12:09:28 2019
+++ src/distrib/sets/lists/xbase/mi	Tue Aug 13 12:29:00 2019
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.152 2019/06/20 12:09:28 uki Exp $
+# $NetBSD: mi,v 1.153 2019/08/13 12:29:00 uki Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -6,144 +6,144 @@
 ./usr/X11R7		base-x11-root	xorg
 ./usr/X11R7/bin		base-x11-root	xorg
 ./usr/X11R7/bin/Xmark	-unknown-	xorg
-./usr/X11R7/bin/appres	-unknown-	xorg
-./usr/X11R7/bin/atobm	-unknown-	xorg
-./usr/X11R7/bin/bdftopcf-unknown-	xorg
-./usr/X11R7/bin/bdftruncate-unknown-	xorg
-./usr/X11R7/bin/beforelight-unknown-	xorg
-./usr/X11R7/bin/bitmap	-unknown-	xorg
-./usr/X11R7/bin/bmtoa	-unknown-	xorg
-./usr/X11R7/bin/ccmakedep-unknown-	xorg
+./usr/X11R7/bin/appres	xbase-appres-bin	xorg
+./usr/X11R7/bin/atobm	xbase-bitmap-bin	xorg
+./usr/X11R7/bin/bdftopcfxbase-bdftopcf-bin	xorg
+./usr/X11R7/bin/bdftruncatexbase-bdftruncate-bin	xorg
+./usr/X11R7/bin/beforelightxbase-beforelight-bin	xorg
+./usr/X11R7/bin/bitmap	xbase-bitmap-bin	xorg
+./usr/X11R7/bin/bmtoa	xbase-bitmap-bin	xorg
+./usr/X11R7/bin/ccmakedepxbase-ccmakedep-bin	xorg
 ./usr/X11R7/bin/cleanlinks-unknown-	xorg
-./usr/X11R7/bin/ctwm	-unknown-	xorg
-./usr/X11R7/bin/cxpm	-unknown-	xorg
-./usr/X11R7/bin/dga	-unknown-	xorg
-./usr/X11R7/bin/editres	-unknown-	xorg
-./usr/X11R7/bin/fc-cache-unknown-	xorg
-./usr/X11R7/bin/fc-cat	-unknown-	xorg
-./usr/X11R7/bin/fc-conflist-unknown-	xorg
-./usr/X11R7/bin/fc-list	-unknown-	xorg
-./usr/X11R7/bin/fc-match-unknown-	xorg
-./usr/X11R7/bin/fc-pattern-unknown-	xorg
-./usr/X11R7/bin/fc-query-unknown-	xorg
-./usr/X11R7/bin/fc-scan	-unknown-	xorg
-./usr/X11R7/bin/fc-validate-unknown-	xorg
+./usr/X11R7/bin/ctwm	xbase-ctwm-bin	xorg
+./usr/X11R7/bin/cxpm	xbase-cxpm-bin	xorg
+./usr/X11R7/bin/dga	xbase-xf86dga-bin	xorg
+./usr/X11R7/bin/editres	xbase-editres-bin	xorg
+./usr/X11R7/bin/fc-cachexbase-fc-cache-tools	xorg
+./usr/X11R7/bin/fc-cat	xbase-fc-cat-bin	xorg
+./usr/X11R7/bin/fc-conflistxbase-fc-conflist-bin	xorg
+./usr/X11R7/bin/fc-list	xbase-fc-list-bin	xorg
+./usr/X11R7/bin/fc-matchxbase-fc-match-bin	xorg
+./usr/X11R7/bin/fc-patternxbase-fc-pattern-bin	xorg
+./usr/X11R7/bin/fc-queryxbase-fc-query-bin	xorg
+./usr/X11R7/bin/fc-scan	xbase-fc-scan-bin	xorg
+./usr/X11R7/bin/fc-validatexbase-fc-validate-bin	xorg
 ./usr/X11R7/bin/fillblnk-unknown-	xorg
-./usr/X11R7/bin/fonttosfnt-unknown-	xorg
-./usr/X11R7/bin/fslsfonts-unknown-	xorg
-./usr/X11R7/bin/fstobdf	-unknown-	xorg
-./usr/X11R7/bin/glxgears-unknown-	xorg
-./usr/X11R7/bin/glxinfo	-unknown-	xorg
-./usr/X11R7/bin/iceauth	-unknown-	xorg
-./usr/X11R7/bin/ico	-unknown-	xorg
-./usr/X11R7/bin/imake	-unknown-	xorg
+./usr/X11R7/bin/fonttosfntxbase-fonttosfnt-bin	xorg
+./usr/X11R7/bin/fslsfontsxbase-fslsfonts-bin	xorg
+./usr/X11R7/bin/fstobdf	xbase-fstobdf-bin	xorg
+./usr/X11R7/bin/glxgearsxbase-glxgears-bin	xorg
+./usr/X11R7/bin/glxinfo	xbase-glxinfo-bin	xorg
+./usr/X11R7/bin/iceauth	xbase-iceauth-bin	xorg
+./usr/X11R7/bin/ico	xbase-ico-bin	xorg
+./usr/X11R7/bin/imake	xbase-imake-bin	xorg
 ./usr/X11R7/bin/lbxproxyxbase-obsolete	obsolete
-./usr/X11R7/bin/listres	-unknown-	xorg
-./usr/X11R7/bin/lndir	-unknown-	xorg
-./usr/X11R7/bin/luit	-unknown-	xorg
-./usr/X11R7/bin/makedepend-unknown-	xorg
+./usr/X11R7/bin/listres	xbase-listres-bin	xorg
+./usr/X11R7/bin/lndir	xbase-lndir-bin	xorg
+./usr/X11R7/bin/luit	xbase-luit-bin	xorg
+./usr/X11R7/bin/makedependxbase-makedepend-bin	xorg
 ./usr/X11R7/bin/makeg	-unknown-	xorg
-./usr/X11R7/bin/makestrs-unknown-	xorg
-./usr/X11R7/bin/mergelib-unknown-	xorg
+./usr/X11R7/bin/makestrsxbase-makestrs-bin	xorg
+./usr/X11R7/bin/mergelibxbase-mergelib-bin	xorg
 ./usr/X11R7/bin/mkdirhier-unknown-	xorg
-./usr/X11R7/bin/mkfontdir-unknown-	xorg
-./usr/X11R7/bin/mkfontscale-unknown-	xorg
-./usr/X11R7/bin/mkhtmlindex-unknown-	xorg
-./usr/X11R7/bin/oclock	-unknown-	xorg
+./usr/X11R7/bin/mkfontdirxbase-mkfontdir-bin	xorg
+./usr/X11R7/bin/mkfontscalexbase-mkfontscale-tools	xorg
+./usr/X11R7/bin/mkhtmlindexxbase-mkhtmlindex-bin	xorg

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

2019-08-13 Thread Yuuki Enomoto
Module Name:src
Committed By:   uki
Date:   Tue Aug 13 12:29:00 UTC 2019

Modified Files:
src/distrib/sets/lists/xbase: mi

Log Message:
Give syspkg names to xbase mi binaries and manuals


To generate a diff of this commit:
cvs rdiff -u -r1.152 -r1.153 src/distrib/sets/lists/xbase/mi

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



CVS commit: src/share/man/man4

2019-08-13 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Tue Aug 13 10:31:19 UTC 2019

Modified Files:
src/share/man/man4: wsmux.4

Log Message:
Formatting tweaks.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/share/man/man4/wsmux.4

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

Modified files:

Index: src/share/man/man4/wsmux.4
diff -u src/share/man/man4/wsmux.4:1.15 src/share/man/man4/wsmux.4:1.16
--- src/share/man/man4/wsmux.4:1.15	Tue Aug 13 07:09:49 2019
+++ src/share/man/man4/wsmux.4	Tue Aug 13 10:31:19 2019
@@ -1,4 +1,4 @@
-.\" $NetBSD: wsmux.4,v 1.15 2019/08/13 07:09:49 maya Exp $
+.\" $NetBSD: wsmux.4,v 1.16 2019/08/13 10:31:19 uwe Exp $
 .\"
 .\" Copyright (c) 1999 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -84,25 +84,23 @@ user program.
 .\" make it appear on the standard mouse mux.
 .Sh FILES
 For each mux device,
-.Pa /dev/wsmuxN
+.Pa /dev/wsmux Ns Ar N
 there is a control device
-.Pa /dev/wsmuxctlN .
+.Pa /dev/wsmuxctl Ns Ar N .
 The control device has a minor number 128 greater than the regular
 mux device.
 It can be used to control the mux even when it is open,
 e.g., by
 .Xr wsmuxctl 8 .
-.Bl -item
-.It
-.Pa /dev/wsmouse
+.Pp
+.Bl -tag -width ".Pa /dev/wsmouse" -compact
+.It Pa /dev/wsmouse
 a.k.a.
 .Pa /dev/wsmux0
-.It
-.Pa /dev/wskbd
+.It Pa /dev/wskbd
 a.k.a.
 .Pa /dev/wsmux1
-.It
-.Pa /usr/include/dev/wscons/wsconsio.h
+.It Pa /usr/include/dev/wscons/wsconsio.h
 .El
 .Sh SEE ALSO
 .Xr wsbell 4 ,
@@ -117,5 +115,6 @@ a.k.a.
 .Xr wsmoused 8 ,
 .Xr wsmuxctl 8
 .Sh CAVEATS
-If more than one type of keyboard is used, WSKBDIO_GTYPE will return the
-type of the first keyboard.
+If more than one type of keyboard is used,
+.Dv WSKBDIO_GTYPE
+will return the type of the first keyboard.



CVS commit: src/share/man/man4

2019-08-13 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Tue Aug 13 10:31:19 UTC 2019

Modified Files:
src/share/man/man4: wsmux.4

Log Message:
Formatting tweaks.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/share/man/man4/wsmux.4

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



CVS commit: src/sys/arch

2019-08-13 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Aug 13 09:56:09 UTC 2019

Modified Files:
src/sys/arch/arm/amlogic: meson8b_clkc.c meson_platform.c
src/sys/arch/arm/dts: meson8b.dtsi
src/sys/arch/evbarm/conf: GENERIC

Log Message:
Updates to get Odroid-C1 in better shape since the last DTS import


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/amlogic/meson8b_clkc.c
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/arm/amlogic/meson_platform.c
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/arm/dts/meson8b.dtsi
cvs rdiff -u -r1.49 -r1.50 src/sys/arch/evbarm/conf/GENERIC

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



CVS commit: src/sys/arch

2019-08-13 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Aug 13 09:56:09 UTC 2019

Modified Files:
src/sys/arch/arm/amlogic: meson8b_clkc.c meson_platform.c
src/sys/arch/arm/dts: meson8b.dtsi
src/sys/arch/evbarm/conf: GENERIC

Log Message:
Updates to get Odroid-C1 in better shape since the last DTS import


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/amlogic/meson8b_clkc.c
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/arm/amlogic/meson_platform.c
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/arm/dts/meson8b.dtsi
cvs rdiff -u -r1.49 -r1.50 src/sys/arch/evbarm/conf/GENERIC

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/amlogic/meson8b_clkc.c
diff -u src/sys/arch/arm/amlogic/meson8b_clkc.c:1.3 src/sys/arch/arm/amlogic/meson8b_clkc.c:1.4
--- src/sys/arch/arm/amlogic/meson8b_clkc.c:1.3	Mon Feb 25 19:30:17 2019
+++ src/sys/arch/arm/amlogic/meson8b_clkc.c	Tue Aug 13 09:56:08 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: meson8b_clkc.c,v 1.3 2019/02/25 19:30:17 jmcneill Exp $ */
+/* $NetBSD: meson8b_clkc.c,v 1.4 2019/08/13 09:56:08 skrll Exp $ */
 
 /*-
  * Copyright (c) 2019 Jared McNeill 
@@ -28,7 +28,7 @@
 
 #include 
 
-__KERNEL_RCSID(1, "$NetBSD: meson8b_clkc.c,v 1.3 2019/02/25 19:30:17 jmcneill Exp $");
+__KERNEL_RCSID(1, "$NetBSD: meson8b_clkc.c,v 1.4 2019/08/13 09:56:08 skrll Exp $");
 
 #include 
 #include 
@@ -74,6 +74,7 @@ static int meson8b_clkc_match(device_t, 
 static void meson8b_clkc_attach(device_t, device_t, void *);
 
 static const char * const compatible[] = {
+	"amlogic,meson8-clkc",
 	"amlogic,meson8b-clkc",
 	NULL
 };
@@ -333,18 +334,12 @@ meson8b_clkc_attach(device_t parent, dev
 {
 	struct meson_clk_softc * const sc = device_private(self);
 	struct fdt_attach_args * const faa = aux;
-	bus_addr_t addr;
-	bus_size_t size;
 
 	sc->sc_dev = self;
 	sc->sc_phandle = faa->faa_phandle;
-	sc->sc_bst = faa->faa_bst;
-	if (fdtbus_get_reg(sc->sc_phandle, MESON8B_CLKC_REG_INDEX, , ) != 0) {
-		aprint_error(": couldn't get registers\n");
-		return;
-	}
-	if (bus_space_map(sc->sc_bst, addr, size, 0, >sc_bsh) != 0) {
-		aprint_error(": couldn't map registers\n");
+	sc->sc_syscon = fdtbus_syscon_lookup(OF_parent(sc->sc_phandle));
+	if (sc->sc_syscon == NULL) {
+		aprint_error(": couldn't get syscon registers\n");
 		return;
 	}
 

Index: src/sys/arch/arm/amlogic/meson_platform.c
diff -u src/sys/arch/arm/amlogic/meson_platform.c:1.12 src/sys/arch/arm/amlogic/meson_platform.c:1.13
--- src/sys/arch/arm/amlogic/meson_platform.c:1.12	Tue Aug 13 09:52:57 2019
+++ src/sys/arch/arm/amlogic/meson_platform.c	Tue Aug 13 09:56:08 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: meson_platform.c,v 1.12 2019/08/13 09:52:57 skrll Exp $ */
+/* $NetBSD: meson_platform.c,v 1.13 2019/08/13 09:56:08 skrll Exp $ */
 
 /*-
  * Copyright (c) 2019 Jared McNeill 
@@ -33,7 +33,7 @@
 #include "arml2cc.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: meson_platform.c,v 1.12 2019/08/13 09:52:57 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: meson_platform.c,v 1.13 2019/08/13 09:56:08 skrll Exp $");
 
 #include 
 #include 
@@ -447,7 +447,7 @@ static const struct arm_platform meson8b
 	.ap_init_attach_args = meson_platform_init_attach_args,
 	.ap_device_register = meson8b_platform_device_register,
 	.ap_reset = meson8b_platform_reset,
-	.ap_delay = a9tmr_delay,
+	.ap_delay = a9ptmr_delay,
 	.ap_uart_freq = meson_platform_uart_freq,
 	.ap_mpstart = meson8b_mpstart,
 };

Index: src/sys/arch/arm/dts/meson8b.dtsi
diff -u src/sys/arch/arm/dts/meson8b.dtsi:1.5 src/sys/arch/arm/dts/meson8b.dtsi:1.6
--- src/sys/arch/arm/dts/meson8b.dtsi:1.5	Sun Jan 20 17:57:29 2019
+++ src/sys/arch/arm/dts/meson8b.dtsi	Tue Aug 13 09:56:08 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: meson8b.dtsi,v 1.5 2019/01/20 17:57:29 jmcneill Exp $ */
+/* $NetBSD: meson8b.dtsi,v 1.6 2019/08/13 09:56:08 skrll Exp $ */
 
 /*-
  * Copyright (c) 2019 Jared McNeill 
@@ -29,13 +29,6 @@
 #define	CLKID_PERIPH	126
 
 / {
-	timer@c4300200 {
-		compatible = "arm,cortex-a5-global-timer";
-		reg = <0xc4300200 0x20>;
-		interrupts = ;
-		clocks = < CLKID_PERIPH>;
-	};
-
 	genfb: fb@c8006000 {
 		compatible = "amlogic,meson8b-fb";
 		reg = <0xc8006000 0x400>,	/* DMC */

Index: src/sys/arch/evbarm/conf/GENERIC
diff -u src/sys/arch/evbarm/conf/GENERIC:1.49 src/sys/arch/evbarm/conf/GENERIC:1.50
--- src/sys/arch/evbarm/conf/GENERIC:1.49	Sat Aug  3 13:33:10 2019
+++ src/sys/arch/evbarm/conf/GENERIC	Tue Aug 13 09:56:09 2019
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: GENERIC,v 1.49 2019/08/03 13:33:10 tnn Exp $
+#	$NetBSD: GENERIC,v 1.50 2019/08/13 09:56:09 skrll Exp $
 #
 #	GENERIC ARM (aarch32) kernel
 #
@@ -298,6 +298,8 @@ syscon*		at fdt? pass 1		# Generic Syste
 #zynqslcr*	at fdt? pass 1		# Zynq 7000 system Controller
 
 # Timer
+a9ptmr* 	at fdt? pass 2		# ARM Cortex A5/A9 Private Timer
+arma9ptmr* 	at a9ptmr?
 a9tmr* 		at fdt? pass 2		# ARM Cortex A5/A9 Timer
 arma9tmr* 	at a9tmr?
 gtmr*		at 

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

2019-08-13 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Aug 13 09:52:57 UTC 2019

Modified Files:
src/sys/arch/arm/amlogic: meson_platform.c

Log Message:
Trailing whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/arm/amlogic/meson_platform.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/amlogic/meson_platform.c
diff -u src/sys/arch/arm/amlogic/meson_platform.c:1.11 src/sys/arch/arm/amlogic/meson_platform.c:1.12
--- src/sys/arch/arm/amlogic/meson_platform.c:1.11	Sun Apr 21 15:57:33 2019
+++ src/sys/arch/arm/amlogic/meson_platform.c	Tue Aug 13 09:52:57 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: meson_platform.c,v 1.11 2019/04/21 15:57:33 jmcneill Exp $ */
+/* $NetBSD: meson_platform.c,v 1.12 2019/08/13 09:52:57 skrll Exp $ */
 
 /*-
  * Copyright (c) 2019 Jared McNeill 
@@ -33,7 +33,7 @@
 #include "arml2cc.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: meson_platform.c,v 1.11 2019/04/21 15:57:33 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: meson_platform.c,v 1.12 2019/08/13 09:52:57 skrll Exp $");
 
 #include 
 #include 
@@ -256,7 +256,7 @@ meson8b_platform_device_register(device_
 strcat(boot_args, rootarg);
 		}
 	}
-			
+
 	meson_platform_device_register(self, aux);
 }
 #endif



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

2019-08-13 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Aug 13 09:52:57 UTC 2019

Modified Files:
src/sys/arch/arm/amlogic: meson_platform.c

Log Message:
Trailing whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/arm/amlogic/meson_platform.c

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



CVS commit: src

2019-08-13 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Tue Aug 13 09:48:24 UTC 2019

Modified Files:
src/dist/pf/usr.sbin/ftp-proxy: npf.c
src/usr.sbin/pf/ftp-proxy: Makefile

Log Message:
sync with reality


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/dist/pf/usr.sbin/ftp-proxy/npf.c
cvs rdiff -u -r1.8 -r1.9 src/usr.sbin/pf/ftp-proxy/Makefile

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



CVS commit: src

2019-08-13 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Tue Aug 13 09:48:24 UTC 2019

Modified Files:
src/dist/pf/usr.sbin/ftp-proxy: npf.c
src/usr.sbin/pf/ftp-proxy: Makefile

Log Message:
sync with reality


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/dist/pf/usr.sbin/ftp-proxy/npf.c
cvs rdiff -u -r1.8 -r1.9 src/usr.sbin/pf/ftp-proxy/Makefile

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

Modified files:

Index: src/dist/pf/usr.sbin/ftp-proxy/npf.c
diff -u src/dist/pf/usr.sbin/ftp-proxy/npf.c:1.2 src/dist/pf/usr.sbin/ftp-proxy/npf.c:1.3
--- src/dist/pf/usr.sbin/ftp-proxy/npf.c:1.2	Mon Dec 24 01:14:40 2012
+++ src/dist/pf/usr.sbin/ftp-proxy/npf.c	Tue Aug 13 09:48:24 2019
@@ -1,7 +1,7 @@
-/*	$NetBSD: npf.c,v 1.2 2012/12/24 01:14:40 rmind Exp $	*/
+/*	$NetBSD: npf.c,v 1.3 2019/08/13 09:48:24 maxv Exp $	*/
 
 /*
- * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * Copyright (c) 2011, 2019 The NetBSD Foundation, Inc.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -32,15 +32,20 @@
 
 #include 
 #include 
+#include 
+#include 
 
 #include 
 #include 
 #include 
-#include 
+#include 
+
+#define NPF_BPFCOP
 #include 
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -75,7 +80,6 @@ const ftp_proxy_ops_t npf_fprx_ops = {
 #define	sa_to_32(sa)		(((struct sockaddr_in *)sa)->sin_addr.s_addr)
 
 #define	NPF_DEV_PATH		"/dev/npf"
-#define	NPF_FP_RULE_TAG		"ftp-proxy"
 
 typedef struct fp_ent {
 	LIST_ENTRY(fp_ent)	fpe_list;
@@ -88,48 +92,66 @@ typedef struct fp_ent {
 char *npfopts;
 
 static LIST_HEAD(, fp_ent)	fp_ent_list;
-static fp_ent_t *		fp_ent_hint;
 static struct sockaddr_in	fp_server_sa;
-static u_int			fp_if_idx;
+static char *			fp_ifname;
 static int			npf_fd;
 
-static uint32_t ncode[ ] = {
-	/* from  to  port  */
-	NPF_OPCODE_IP4MASK,	0x01,	0xdeadbeef,	0x,
-	NPF_OPCODE_BNE,		15,
-	NPF_OPCODE_IP4MASK,	0x00,	0xdeadbeef,	0x,
-	NPF_OPCODE_BNE,		9,
-	NPF_OPCODE_TCP_PORTS,	0x00,	0xdeadbeef,
-	NPF_OPCODE_BNE,		4,
-	/* Success (0x0) and failure (0xff) paths. */
-	NPF_OPCODE_RET,		0x00,
-	NPF_OPCODE_RET,		0xff
+#define	NPF_BPF_SUCCESS		((u_int)-1)
+#define	NPF_BPF_FAILURE		0
+
+#define INSN_IPSRC	5
+#define INSN_IPDST	7
+#define INSN_DPORT	10
+
+static struct bpf_insn insns[13] = {
+	/* Want IPv4. */
+	BPF_STMT(BPF_LD+BPF_MEM, BPF_MW_IPVER),
+	BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 4, 0, 10),
+	/* Want TCP. */
+	BPF_STMT(BPF_LD+BPF_MEM, BPF_MW_L4PROTO),
+	BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, IPPROTO_TCP, 0, 8),
+	/* Check source IP. */
+	BPF_STMT(BPF_LD+BPF_W+BPF_ABS, offsetof(struct ip, ip_src)),
+	BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 0xDEADBEEF, 0, 6),
+	/* Check destination IP. */
+	BPF_STMT(BPF_LD+BPF_W+BPF_ABS, offsetof(struct ip, ip_dst)),
+	BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 0xDEADBEEF, 0, 4),
+	/* Check port. */
+	BPF_STMT(BPF_LDX+BPF_MEM, BPF_MW_L4OFF),
+	BPF_STMT(BPF_LD+BPF_H+BPF_IND, offsetof(struct tcphdr, th_dport)),
+	BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 0xDEADBEEF, 0, 1),
+	/* Success. */
+	BPF_STMT(BPF_RET+BPF_K, NPF_BPF_SUCCESS),
+	/* Failure. */
+	BPF_STMT(BPF_RET+BPF_K, NPF_BPF_FAILURE),
 };
 
 static void
-ftp_proxy_modify_nc(in_addr_t shost, in_addr_t dhost, in_port_t dport)
+modify_bytecode(in_addr_t shost, in_addr_t dhost, in_port_t dport)
 {
+	/*
+	 * Replace the 0xDEADBEEF by actual values. Note that BPF is in
+	 * host order.
+	 */
+
 	/* Source address to match. */
-	ncode[2] = shost;
+	insns[INSN_IPSRC].k = shost;
 	/* Destination address to match. */
-	ncode[8] = shost;
+	insns[INSN_IPDST].k = dhost;
 	/* Destination port to match. */
-	ncode[14] = ((uint32_t)dport << 16) | dport;
+	insns[INSN_DPORT].k = dport;
 }
 
 static fp_ent_t *
-ftp_proxy_lookup(uint32_t id)
+proxy_lookup(uint32_t id)
 {
 	fp_ent_t *fpe;
 
-	/* Look for FTP proxy entry.  First, try hint (last used). */
-	if (fp_ent_hint && fp_ent_hint->fpe_id == id) {
-		return fp_ent_hint;
-	}
 	LIST_FOREACH(fpe, _ent_list, fpe_list) {
 		if (fpe->fpe_id == id)
 			break;
 	}
+
 	return fpe;
 }
 
@@ -137,24 +159,22 @@ static void
 npf_init_filter(char *opt_qname, char *opt_tagname, int opt_verbose)
 {
 	char *netif = npfopts, *saddr, *port;
+	int kernver, idx;
 
 	/* XXX get rid of this */
-	saddr = strchr(netif, ':');
-	if (saddr == NULL) {
+	if ((saddr = strchr(netif, ':')) == NULL) {
 		errx(EXIT_FAILURE, "invalid -N option string: %s", npfopts);
 	}
 	*saddr++ = '\0';
-	if (saddr == NULL || (port = strchr(saddr, ':')) == NULL) {
+	if ((port = strchr(saddr, ':')) == NULL) {
 		errx(EXIT_FAILURE, "invalid -N option string: %s", npfopts);
 	}
 	*port++ = '\0';
-	if (port == NULL) {
-		errx(EXIT_FAILURE, "invalid -N option string: %s", npfopts);
-	}
 
-	fp_if_idx = if_nametoindex(netif);
-	if (fp_if_idx == 0) {
-		errx(EXIT_FAILURE, "invalid network interface '%s'", netif);
+	fp_ifname = netif;
+	idx = if_nametoindex(fp_ifname);
+	if (idx == 0) {
+		

CVS commit: src/distrib/utils/libhack

2019-08-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Aug 13 08:48:08 UTC 2019

Modified Files:
src/distrib/utils/libhack: strcasecmp.c

Log Message:
use unsigned char to prevent sign extension.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/distrib/utils/libhack/strcasecmp.c

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



CVS commit: src/distrib/utils/libhack

2019-08-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Aug 13 08:48:08 UTC 2019

Modified Files:
src/distrib/utils/libhack: strcasecmp.c

Log Message:
use unsigned char to prevent sign extension.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/distrib/utils/libhack/strcasecmp.c

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

Modified files:

Index: src/distrib/utils/libhack/strcasecmp.c
diff -u src/distrib/utils/libhack/strcasecmp.c:1.2 src/distrib/utils/libhack/strcasecmp.c:1.3
--- src/distrib/utils/libhack/strcasecmp.c:1.2	Mon Aug 12 05:34:53 2019
+++ src/distrib/utils/libhack/strcasecmp.c	Tue Aug 13 04:48:07 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: strcasecmp.c,v 1.2 2019/08/12 09:34:53 martin Exp $	*/
+/*	$NetBSD: strcasecmp.c,v 1.3 2019/08/13 08:48:07 christos Exp $	*/
 
 /*
  * Written by Martin Husemann 
@@ -13,7 +13,7 @@
 int
 strcasecmp(const char *s1, const char *s2)
 {
-	unsigned int c1, c2;
+	unsigned char c1, c2;
 
 	do {
 		c1 = *s1++;



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

2019-08-13 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Aug 13 08:27:42 UTC 2019

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

Log Message:
Add DBM


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

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



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

2019-08-13 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Aug 13 08:27:42 UTC 2019

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

Log Message:
Add DBM


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/aarch64/include/pte.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/pte.h
diff -u src/sys/arch/aarch64/include/pte.h:1.5 src/sys/arch/aarch64/include/pte.h:1.6
--- src/sys/arch/aarch64/include/pte.h:1.5	Thu Oct  4 09:09:29 2018
+++ src/sys/arch/aarch64/include/pte.h	Tue Aug 13 08:27:42 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: pte.h,v 1.5 2018/10/04 09:09:29 ryo Exp $ */
+/* $NetBSD: pte.h,v 1.6 2019/08/13 08:27:42 skrll Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -58,6 +58,7 @@ typedef uint64_t pt_entry_t;	/* L3(4k) t
 #define LX_BLKPAG_UXN		__BIT(54)	/* Unprivileged Execute Never */
 #define LX_BLKPAG_PXN		__BIT(53)	/* Privileged Execute Never */
 #define LX_BLKPAG_CONTIG	__BIT(52)	/* Hint of TLB cache */
+#define LX_BLKPAG_DBM		__BIT(51)	/* Dirty Bit Modifier (V8.1) */
 #define LX_TBL_PA		__BITS(47, 12)
 #define LX_BLKPAG_OA		__BITS(47, 12)
 #define LX_BLKPAG_NG		__BIT(11)	/* Not Global */



CVS commit: src/external/cddl/osnet/dist/uts/common/fs/zfs

2019-08-13 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Tue Aug 13 08:03:25 UTC 2019

Modified Files:
src/external/cddl/osnet/dist/uts/common/fs/zfs: dsl_dataset.c

Log Message:
Add missing "defined(__NetBSD__)" to make "zfs promote" work.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 \
src/external/cddl/osnet/dist/uts/common/fs/zfs/dsl_dataset.c

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



CVS commit: src/external/cddl/osnet/dist/uts/common/fs/zfs

2019-08-13 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Tue Aug 13 08:03:25 UTC 2019

Modified Files:
src/external/cddl/osnet/dist/uts/common/fs/zfs: dsl_dataset.c

Log Message:
Add missing "defined(__NetBSD__)" to make "zfs promote" work.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 \
src/external/cddl/osnet/dist/uts/common/fs/zfs/dsl_dataset.c

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/osnet/dist/uts/common/fs/zfs/dsl_dataset.c
diff -u src/external/cddl/osnet/dist/uts/common/fs/zfs/dsl_dataset.c:1.4 src/external/cddl/osnet/dist/uts/common/fs/zfs/dsl_dataset.c:1.5
--- src/external/cddl/osnet/dist/uts/common/fs/zfs/dsl_dataset.c:1.4	Wed May 22 08:45:32 2019
+++ src/external/cddl/osnet/dist/uts/common/fs/zfs/dsl_dataset.c	Tue Aug 13 08:03:25 2019
@@ -2796,7 +2796,7 @@ dsl_dataset_promote_sync(void *arg, dmu_
 		ASSERT(!dsl_prop_hascb(ds));
 	}
 
-#if defined(__FreeBSD__) && defined(_KERNEL)
+#if (defined(__FreeBSD__) || defined(__NetBSD__)) && defined(_KERNEL)
 	mutex_exit(_namespace_lock);
 
 	kmem_free(newname, MAXPATHLEN);



CVS commit: src/tests/net/ndp

2019-08-13 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Tue Aug 13 07:20:43 UTC 2019

Modified Files:
src/tests/net/ndp: t_ndp.sh

Log Message:
Make a permanet neighbor cache to avoid sending an NS packet disturbing the test

A receiver of an ICMPv6 request packet creates a stale cache entry and it turns
into the delay state on replying the packet.  After 5 second, the receiver sends
an NS packet as a reachability confirmation, which disturbs the test and causes
a unexpected result.

Should fix PR misc/54451


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/tests/net/ndp/t_ndp.sh

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



CVS commit: src/tests/net/ndp

2019-08-13 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Tue Aug 13 07:20:43 UTC 2019

Modified Files:
src/tests/net/ndp: t_ndp.sh

Log Message:
Make a permanet neighbor cache to avoid sending an NS packet disturbing the test

A receiver of an ICMPv6 request packet creates a stale cache entry and it turns
into the delay state on replying the packet.  After 5 second, the receiver sends
an NS packet as a reachability confirmation, which disturbs the test and causes
a unexpected result.

Should fix PR misc/54451


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/tests/net/ndp/t_ndp.sh

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

Modified files:

Index: src/tests/net/ndp/t_ndp.sh
diff -u src/tests/net/ndp/t_ndp.sh:1.33 src/tests/net/ndp/t_ndp.sh:1.34
--- src/tests/net/ndp/t_ndp.sh:1.33	Thu Jul 18 04:00:09 2019
+++ src/tests/net/ndp/t_ndp.sh	Tue Aug 13 07:20:43 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: t_ndp.sh,v 1.33 2019/07/18 04:00:09 ozaki-r Exp $
+#	$NetBSD: t_ndp.sh,v 1.34 2019/08/13 07:20:43 ozaki-r Exp $
 #
 # Copyright (c) 2015 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -114,6 +114,7 @@ get_timeout()
 
 ndp_cache_expiration_body()
 {
+	local macaddr=
 
 	rump_server_start $SOCKSRC netinet6
 	rump_server_start $SOCKDST netinet6
@@ -121,12 +122,19 @@ ndp_cache_expiration_body()
 	setup_dst_server
 	setup_src_server
 
-	export RUMP_SERVER=$SOCKSRC
-
 	# Shorten the expire time of cache entries
+	export RUMP_SERVER=$SOCKSRC
 	atf_check -s exit:0 -o match:'basereachable=7s0ms' \
 	rump.ndp -i shmif0 basereachable=7000
 
+	# Make a permanent cache entry to avoid sending an NS packet disturbing
+	# the test
+	macaddr=$(get_macaddr $SOCKSRC shmif0)
+	export RUMP_SERVER=$SOCKDST
+	atf_check -s exit:0 -o ignore rump.ndp -s $IP6SRC $macaddr
+
+	export RUMP_SERVER=$SOCKSRC
+
 	#
 	# Check if a cache is expired expectedly
 	#
@@ -710,6 +718,7 @@ wait_until_stalled()
 
 ndp_cache_state_body()
 {
+	local macaddr=
 
 	rump_server_start $SOCKSRC netinet6
 	rump_server_start $SOCKDST netinet6
@@ -717,12 +726,19 @@ ndp_cache_state_body()
 	setup_dst_server
 	setup_src_server
 
-	export RUMP_SERVER=$SOCKSRC
-
 	# Shorten the expire time of cache entries
+	export RUMP_SERVER=$SOCKSRC
 	atf_check -s exit:0 -o match:'basereachable=7s0ms' \
 	rump.ndp -i shmif0 basereachable=7000
 
+	# Make a permanent cache entry to avoid sending an NS packet disturbing
+	# the test
+	macaddr=$(get_macaddr $SOCKSRC shmif0)
+	export RUMP_SERVER=$SOCKDST
+	atf_check -s exit:0 -o ignore rump.ndp -s $IP6SRC $macaddr
+
+	export RUMP_SERVER=$SOCKSRC
+
 	#
 	# Reachability confirmation (RFC 4861 7.3.3)
 	#



CVS commit: src/share/man/man4

2019-08-13 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Tue Aug 13 07:09:49 UTC 2019

Modified Files:
src/share/man/man4: wsmux.4

Log Message:
Document pain of using wsmux with more than one type of keyboard from
userland.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/share/man/man4/wsmux.4

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



CVS commit: src/share/man/man4

2019-08-13 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Tue Aug 13 07:09:49 UTC 2019

Modified Files:
src/share/man/man4: wsmux.4

Log Message:
Document pain of using wsmux with more than one type of keyboard from
userland.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/share/man/man4/wsmux.4

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

Modified files:

Index: src/share/man/man4/wsmux.4
diff -u src/share/man/man4/wsmux.4:1.14 src/share/man/man4/wsmux.4:1.15
--- src/share/man/man4/wsmux.4:1.14	Tue Jun 13 08:10:52 2017
+++ src/share/man/man4/wsmux.4	Tue Aug 13 07:09:49 2019
@@ -1,4 +1,4 @@
-.\" $NetBSD: wsmux.4,v 1.14 2017/06/13 08:10:52 wiz Exp $
+.\" $NetBSD: wsmux.4,v 1.15 2019/08/13 07:09:49 maya Exp $
 .\"
 .\" Copyright (c) 1999 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -24,7 +24,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd June 13, 2017
+.Dd August 13, 2019
 .Dt WSMUX 4
 .Os
 .Sh NAME
@@ -116,3 +116,6 @@ a.k.a.
 .Xr wsfontload 8 ,
 .Xr wsmoused 8 ,
 .Xr wsmuxctl 8
+.Sh CAVEATS
+If more than one type of keyboard is used, WSKBDIO_GTYPE will return the
+type of the first keyboard.