CVS commit: [netbsd-8] src

2019-02-06 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Feb  7 06:14:34 UTC 2019

Modified Files:
src/share/man/man4 [netbsd-8]: axen.4
src/sys/dev/usb [netbsd-8]: if_axen.c

Log Message:
Pullup the following revisions (requested by martin in ticket #1182):
sys/dev/usb/if_axen.c   1.14
share/man/man4/axen.4   1.7

Andrius V in Pr kern/53461: add D-Link DUB-1312


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.6.4.1 src/share/man/man4/axen.4
cvs rdiff -u -r1.11.8.2 -r1.11.8.3 src/sys/dev/usb/if_axen.c

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/axen.4
diff -u src/share/man/man4/axen.4:1.6 src/share/man/man4/axen.4:1.6.4.1
--- src/share/man/man4/axen.4:1.6	Thu Apr 13 07:22:50 2017
+++ src/share/man/man4/axen.4	Thu Feb  7 06:14:34 2019
@@ -1,4 +1,4 @@
-.\"	$NetBSD: axen.4,v 1.6 2017/04/13 07:22:50 skrll Exp $
+.\"	$NetBSD: axen.4,v 1.6.4.1 2019/02/07 06:14:34 msaitoh Exp $
 .\"	$OpenBSD: axen.4,v 1.2 2013/10/07 07:18:36 jmc Exp $
 .\"
 .\" Copyright (c) 2013 Yojiro UO 
@@ -15,7 +15,7 @@
 .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 .\"
-.Dd April 13, 2017
+.Dd July 27, 2018
 .Dt AXEN 4
 .Os
 .Sh NAME
@@ -33,6 +33,7 @@ including the following:
 .Pp
 .Bl -tag -width Ds -offset indent -compact
 .It Buffalo LUA4-U3-AGT
+.It D-Link DUB-1312
 .It Kurotoshiko GbE-USB3.0
 .It Kurotoshiko GbE-USB3.0S2
 .It Logitec LAN-GTJU3

Index: src/sys/dev/usb/if_axen.c
diff -u src/sys/dev/usb/if_axen.c:1.11.8.2 src/sys/dev/usb/if_axen.c:1.11.8.3
--- src/sys/dev/usb/if_axen.c:1.11.8.2	Wed Aug  8 10:28:35 2018
+++ src/sys/dev/usb/if_axen.c	Thu Feb  7 06:14:34 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_axen.c,v 1.11.8.2 2018/08/08 10:28:35 martin Exp $	*/
+/*	$NetBSD: if_axen.c,v 1.11.8.3 2019/02/07 06:14:34 msaitoh Exp $	*/
 /*	$OpenBSD: if_axen.c,v 1.3 2013/10/21 10:10:22 yuo Exp $	*/
 
 /*
@@ -23,7 +23,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_axen.c,v 1.11.8.2 2018/08/08 10:28:35 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_axen.c,v 1.11.8.3 2019/02/07 06:14:34 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -79,7 +79,8 @@ static const struct axen_type axen_devs[
 #if 0 /* not tested */
 	{ { USB_VENDOR_ASIX, USB_PRODUCT_ASIX_AX88178A}, AX178A },
 #endif
-	{ { USB_VENDOR_ASIX, USB_PRODUCT_ASIX_AX88179}, AX179 }
+	{ { USB_VENDOR_ASIX, USB_PRODUCT_ASIX_AX88179}, AX179 },
+	{ { USB_VENDOR_DLINK, USB_PRODUCT_DLINK_DUB1312}, AX179 }
 };
 
 #define axen_lookup(v, p) ((const struct axen_type *)usb_lookup(axen_devs, v, p))



CVS commit: [netbsd-8] src/doc

2019-02-06 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Feb  7 06:15:54 UTC 2019

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

Log Message:
ticket #1182.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.101 -r1.1.2.102 src/doc/CHANGES-8.1

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.1
diff -u src/doc/CHANGES-8.1:1.1.2.101 src/doc/CHANGES-8.1:1.1.2.102
--- src/doc/CHANGES-8.1:1.1.2.101	Fri Feb  1 11:26:13 2019
+++ src/doc/CHANGES-8.1	Thu Feb  7 06:15:54 2019
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-8.1,v 1.1.2.101 2019/02/01 11:26:13 martin Exp $
+# $NetBSD: CHANGES-8.1,v 1.1.2.102 2019/02/07 06:15:54 msaitoh Exp $
 
 A complete list of changes from the NetBSD 8.0 release to the NetBSD 8.1
 release:
@@ -2417,3 +2417,11 @@ sys/dev/pci/ppb.c1.66,1.67
 	do it.
 	[msaitoh, ticket #1181]
 
+sys/dev/usb/usbdevs1.753
+sys/dev/usb/usbdevs.hregen
+sys/dev/usb/usbdevs_data.h			regen
+sys/dev/usb/if_axen.c1.14
+share/man/man4/axen.41.7
+
+	Andrius V in Pr kern/53461: add D-Link DUB-1312
+	[martin, ticket #1182]



CVS commit: [netbsd-8] src/sys/dev/usb

2019-02-06 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Feb  7 06:13:26 UTC 2019

Modified Files:
src/sys/dev/usb [netbsd-8]: usbdevs

Log Message:
Pullup the following revision (requested by martin in ticket #1182):
sys/dev/usb/usbdevs 1.753

Andrius V in Pr kern/53461: add D-Link DUB-1312


To generate a diff of this commit:
cvs rdiff -u -r1.736.2.2 -r1.736.2.3 src/sys/dev/usb/usbdevs

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/usbdevs
diff -u src/sys/dev/usb/usbdevs:1.736.2.2 src/sys/dev/usb/usbdevs:1.736.2.3
--- src/sys/dev/usb/usbdevs:1.736.2.2	Mon Nov 12 16:01:35 2018
+++ src/sys/dev/usb/usbdevs	Thu Feb  7 06:13:26 2019
@@ -1,4 +1,4 @@
-$NetBSD: usbdevs,v 1.736.2.2 2018/11/12 16:01:35 martin Exp $
+$NetBSD: usbdevs,v 1.736.2.3 2019/02/07 06:13:26 msaitoh Exp $
 
 /*
  * Copyright (c) 1998-2004 The NetBSD Foundation, Inc.
@@ -1373,6 +1373,7 @@ product DISPLAYLINK FYDVI	0x8060	Display
 /*product DLINK DSBS25		0x0100	DSB-S25 serial adapter*/
 product DLINK DUBE100		0x1a00	10/100 ethernet adapter
 product DLINK DUBE100C1		0x1a02	DUB-E100 rev C1
+product DLINK DUB1312		0x4a00	DUB-1312
 product DLINK DSB650TX4		0x200c	10/100 ethernet adapter
 product DLINK DWL120E		0x3200	DWL-120 rev E
 product DLINK DWA130C		0x3301	DWA-130 rev C



CVS commit: src/sys/dev/wscons

2019-02-06 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Thu Feb  7 06:10:29 UTC 2019

Modified Files:
src/sys/dev/wscons: wsdisplay.c

Log Message:
be consistent in checking cn_getc return value.


To generate a diff of this commit:
cvs rdiff -u -r1.153 -r1.154 src/sys/dev/wscons/wsdisplay.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/wscons/wsdisplay.c
diff -u src/sys/dev/wscons/wsdisplay.c:1.153 src/sys/dev/wscons/wsdisplay.c:1.154
--- src/sys/dev/wscons/wsdisplay.c:1.153	Sun Feb  3 03:19:28 2019
+++ src/sys/dev/wscons/wsdisplay.c	Thu Feb  7 06:10:29 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: wsdisplay.c,v 1.153 2019/02/03 03:19:28 mrg Exp $ */
+/* $NetBSD: wsdisplay.c,v 1.154 2019/02/07 06:10:29 mlelstv Exp $ */
 
 /*
  * Copyright (c) 1996, 1997 Christopher G. Demetriou.  All rights reserved.
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: wsdisplay.c,v 1.153 2019/02/03 03:19:28 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wsdisplay.c,v 1.154 2019/02/07 06:10:29 mlelstv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_wsdisplay_compat.h"
@@ -289,9 +289,9 @@ wsscreen_getc_poll(void *priv)
 		struct tty *tp = scr->scr_tty;
 		do {
 			c = wsdisplay_ocn->cn_getc(wsdisplay_ocn->cn_dev);
-			if (c != -1)
+			if (c >= 0)
 (*tp->t_linesw->l_rint)((unsigned char)c, tp);
-		} while (c != -1);
+		} while (c >= 0);
 	}
 
 	callout_schedule(>scr_getc_ch, mstohz(10));



CVS commit: src/usr.sbin/memswitch

2019-02-06 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Thu Feb  7 06:01:04 UTC 2019

Modified Files:
src/usr.sbin/memswitch: Makefile

Log Message:
disable stringop-overflow warning for GCC 7.  triggers here and seems
impossible on current netbsd given it's takling about argv > 2GB, and
this is only for x68k anyway.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 src/usr.sbin/memswitch/Makefile

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/memswitch/Makefile
diff -u src/usr.sbin/memswitch/Makefile:1.1.1.1 src/usr.sbin/memswitch/Makefile:1.2
--- src/usr.sbin/memswitch/Makefile:1.1.1.1	Mon Jun 21 15:56:03 1999
+++ src/usr.sbin/memswitch/Makefile	Thu Feb  7 06:01:04 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.1.1.1 1999/06/21 15:56:03 minoura Exp $
+#	$NetBSD: Makefile,v 1.2 2019/02/07 06:01:04 mrg Exp $
 
 .if ${MACHINE} == "x68k"
 PROG=	memswitch
@@ -8,4 +8,11 @@ SRCS=	memswitch.c properties.c methods.c
 MAN=	memswitch.8
 MANSUBDIR=	/x68k
 
+.include 
+
+# XXX Not sure how to fix this problem
+.if defined(HAVE_GCC) && ${HAVE_GCC} == 7 && ${ACTIVE_CC} == "gcc"
+COPTS.memswitch.c+=	-Wno-error=stringop-overflow
+.endif
+
 .include 



CVS commit: src/external/gpl3/gcc/usr.bin/backend

2019-02-06 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Thu Feb  7 05:28:38 UTC 2019

Modified Files:
src/external/gpl3/gcc/usr.bin/backend: Makefile

Log Message:
apply -O0 to a few more files for vax.


To generate a diff of this commit:
cvs rdiff -u -r1.52 -r1.53 src/external/gpl3/gcc/usr.bin/backend/Makefile

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

Modified files:

Index: src/external/gpl3/gcc/usr.bin/backend/Makefile
diff -u src/external/gpl3/gcc/usr.bin/backend/Makefile:1.52 src/external/gpl3/gcc/usr.bin/backend/Makefile:1.53
--- src/external/gpl3/gcc/usr.bin/backend/Makefile:1.52	Mon Feb  4 08:15:51 2019
+++ src/external/gpl3/gcc/usr.bin/backend/Makefile	Thu Feb  7 05:28:38 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.52 2019/02/04 08:15:51 mrg Exp $
+#	$NetBSD: Makefile,v 1.53 2019/02/07 05:28:38 mrg Exp $
 
 LIBISPRIVATE=	yes
 
@@ -526,7 +526,9 @@ COPTS.insn-recog.c+=-Wno-error
 .if ${GCC_MACHINE_ARCH} == "vax"
 CPPFLAGS+=-I${.CURDIR}/../../lib/libgcc/libgcov/arch/${GCC_MACHINE_ARCH}
 COPTS.builtins.c+=-O0
+COPTS.calls.c+=-O0
 COPTS.convert.c+=-O0
+COPTS.data-streamer-out.c+=-O0
 COPTS.dwarf2out.c+=-O0
 COPTS.dse.c+=-O0	# XXX port-vax/51967
 COPTS.expmed.c+=-O0
@@ -548,10 +550,12 @@ COPTS.targhooks.c+=-O0
 COPTS.tree-affine.c+=-O0
 COPTS.tree-cfg.c+=-O0
 COPTS.tree-eh.c+=-O0
+COPTS.tree-if-conv.c+=-O0
 COPTS.tree-object-size.c+=-O0
 COPTS.tree-parloops.c+=-O0
 COPTS.tree-predcom.c+=-O0
 COPTS.tree-pretty-print.c+=-O0
+COPTS.tree-ssa.c+=-O0
 COPTS.tree-ssa-alias.c+=-O0
 COPTS.tree-ssa-ccp.c+=-O0
 COPTS.tree-ssa-forwprop.c+=-O0
@@ -564,12 +568,14 @@ COPTS.tree-ssa-reassoc.c+=-O0
 COPTS.tree-ssa-uninit.c+=-O0
 COPTS.tree-switch-conversion.c+=-O0
 COPTS.tree-vect-data-refs.c+=-O0
+COPTS.tree-vect-loop.c+=-O0
 COPTS.tree-vect-loop-manip.c+=-O0
 COPTS.tree-vect-patterns.c+=-O0
 COPTS.tree-vect-stmts.c+=-O0
 COPTS.tree-vrp.c+=-O0
 COPTS.tree.c+=-O0
 COPTS.ubsan.c+=-O0
+COPTS.web.c+=-O0
 COPTS.varasm.c+=-O0
 COPTS.wide-int.cc+=-O0
 .else



CVS commit: src/external/gpl3/gcc/usr.bin/gcc/arch/vax

2019-02-06 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Thu Feb  7 05:28:12 UTC 2019

Modified Files:
src/external/gpl3/gcc/usr.bin/gcc/arch/vax: defs.mk

Log Message:
fix merge botch.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/external/gpl3/gcc/usr.bin/gcc/arch/vax/defs.mk

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

Modified files:

Index: src/external/gpl3/gcc/usr.bin/gcc/arch/vax/defs.mk
diff -u src/external/gpl3/gcc/usr.bin/gcc/arch/vax/defs.mk:1.15 src/external/gpl3/gcc/usr.bin/gcc/arch/vax/defs.mk:1.16
--- src/external/gpl3/gcc/usr.bin/gcc/arch/vax/defs.mk:1.15	Mon Feb  4 02:58:47 2019
+++ src/external/gpl3/gcc/usr.bin/gcc/arch/vax/defs.mk	Thu Feb  7 05:28:12 2019
@@ -2,833 +2,6 @@
 # Generated from: NetBSD: mknative-gcc,v 1.99 2019/02/04 01:46:59 mrg Exp 
 # Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp 
 #
-running CONFIG_SHELL=/bin/sh /bin/sh /usr/src6/external/gpl3/gcc/dist/gcc/configure --srcdir=/usr/src6/tools/gcc/../../external/gpl3/gcc/dist/gcc --cache-file=./config.cache --enable-long-long --enable-threads --with-bugurl=http://www.NetBSD.org/Misc/send-pr.html --with-pkgversion=NetBSD nb1 20190119 --with-system-zlib --without-isl --disable-libstdcxx-dual-abi --enable-__cxa_atexit --enable-libstdcxx-time=rt --enable-libstdcxx-threads --with-diagnostics-color=auto-if-env --with-default-libstdcxx-abi=new --with-mpc-lib=/var/obj/mknative/vax/usr/src6/external/lgpl3/mpc/lib/libmpc --with-mpfr-lib=/var/obj/mknative/vax/usr/src6/external/lgpl3/mpfr/lib/libmpfr --with-gmp-lib=/var/obj/mknative/vax/usr/src6/external/lgpl3/gmp/lib/libgmp --with-mpc-include=/usr/src6/external/lgpl3/mpc/dist/src --with-mpfr-include=/usr/src6/external/lgpl3/mpfr/dist/src --with-gmp-include=/usr/src6/external/lgpl3/gmp/lib/libgmp/arch/vax --disable-multilib --disable-symvers --disable-libstdcxx-pch --with-sysr
 oot=/var/obj/mknative/vax/usr/src6/destdir.vax --enable-languages=c,c++,lto,objc --program-transform-name=s,y,y, --disable-option-checking --build=x86_64-unknown-netbsd8.0 --host=vax--netbsdelf --target=vax--netbsdelf build_alias=x86_64-unknown-netbsd8.0 host_alias=vax--netbsdelf target_alias=vax--netbsdelf CC=/var/obj/mknative/vax/usr/src6/tooldir.NetBSD-8.0_STABLE-amd64/bin/vax--netbsdelf-gcc --sysroot=/var/obj/mknative/vax/usr/src6/destdir.vax -L/var/obj/mknative/vax/usr/src6/destdir.vax/lib -L/var/obj/mknative/vax/usr/src6/destdir.vax/usr/lib -B/var/obj/mknative/vax/usr/src6/destdir.vax/usr/lib/ -I/var/obj/mknative/vax/usr/src6/tools/gcc/.native/gcc/include CFLAGS= LDFLAGS=-static-libstdc++ -static-libgcc  CPPFLAGS= CXX=/var/obj/mknative/vax/usr/src6/tooldir.NetBSD-8.0_STABLE-amd64/bin/vax--netbsdelf-c++ --sysroot=/var/obj/mknative/vax/usr/src6/destdir.vax -L/var/obj/mknative/vax/usr/src6/destdir.vax/lib -L/var/obj/mknative/vax/usr/src6/destdir.vax/usr/lib -B/var/obj/mknative/va
 x/usr/src6/destdir.vax/usr/lib/ -I/var/obj/mknative/vax/usr/src6/tools/gcc/.native/gcc/include --sysroot=/var/obj/mknative/vax/usr/src6/destdir.vax CXXFLAGS= CPP=/var/obj/mknative/vax/usr/src6/tooldir.NetBSD-8.0_STABLE-amd64/bin/vax--netbsdelf-cpp -I/var/obj/mknative/vax/usr/src6/destdir.vax/usr/include -I/var/obj/mknative/vax/usr/src6/destdir.vax/usr/include/g++/bits GMPLIBS=-L/var/obj/mknative/vax/usr/src6/external/lgpl3/gmp/lib/libgmp -L/var/obj/mknative/vax/usr/src6/external/lgpl3/mpfr/lib/libmpfr -L/var/obj/mknative/vax/usr/src6/external/lgpl3/mpc/lib/libmpc -lmpc -lmpfr -lgmp GMPINC=-I/usr/src6/external/lgpl3/gmp/lib/libgmp/arch/vax -I/usr/src6/external/lgpl3/mpfr/dist/src -I/usr/src6/external/lgpl3/mpc/dist/src  ISLLIBS= ISLINC= --no-create --no-recursion
-configure: loading cache ./config.cache
-checking build system type... (cached) x86_64-unknown-netbsd8.0
-checking host system type... (cached) vax--netbsdelf
-checking target system type... (cached) vax--netbsdelf
-checking LIBRARY_PATH variable... ok
-checking GCC_EXEC_PREFIX variable... ok
-checking whether to place generated files in the source directory... no
-checking whether a default linker was specified... no
-checking whether a default assembler was specified... no
-checking for vax--netbsdelf-gcc... (cached) /var/obj/mknative/vax/usr/src6/tooldir.NetBSD-8.0_STABLE-amd64/bin/vax--netbsdelf-gcc --sysroot=/var/obj/mknative/vax/usr/src6/destdir.vax -L/var/obj/mknative/vax/usr/src6/destdir.vax/lib -L/var/obj/mknative/vax/usr/src6/destdir.vax/usr/lib -B/var/obj/mknative/vax/usr/src6/destdir.vax/usr/lib/ -I/var/obj/mknative/vax/usr/src6/tools/gcc/.native/gcc/include
-checking for C compiler default output file name... a.out
-checking whether the C compiler works... yes
-checking whether we are cross compiling... yes
-checking for suffix of executables... 
-checking for suffix of object files... (cached) o
-checking whether we are using the GNU C compiler... (cached) yes
-checking whether 

CVS commit: src/sys/lib/libkern

2019-02-06 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Thu Feb  7 05:22:09 UTC 2019

Modified Files:
src/sys/lib/libkern: Makefile.compiler-rt

Log Message:
apply the previous to all GCC-7 platforms.  it affects vax as well.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/lib/libkern/Makefile.compiler-rt

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

Modified files:

Index: src/sys/lib/libkern/Makefile.compiler-rt
diff -u src/sys/lib/libkern/Makefile.compiler-rt:1.6 src/sys/lib/libkern/Makefile.compiler-rt:1.7
--- src/sys/lib/libkern/Makefile.compiler-rt:1.6	Thu Feb  7 04:33:24 2019
+++ src/sys/lib/libkern/Makefile.compiler-rt	Thu Feb  7 05:22:09 2019
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.compiler-rt,v 1.6 2019/02/07 04:33:24 mrg Exp $
+# $NetBSD: Makefile.compiler-rt,v 1.7 2019/02/07 05:22:09 mrg Exp $
 
 COMPILER_RT_SRCDIR=	${NETBSDSRCDIR}/sys/external/bsd/compiler_rt/dist
 
@@ -129,7 +129,5 @@ CPPFLAGS.int_util.c+=	-DKERNEL_USE
 
 # XXX Explicit divide by zero in udivmoddi4.c -> abort().
 .if defined(HAVE_GCC) && ${HAVE_GCC} == 7 && ${ACTIVE_CC} == "gcc"
-. if ${MACHINE_CPU} == "sh3"
 COPTS.udivmoddi4.c+=	-fnon-call-exceptions
-. endif
 .endif



CVS commit: src/sys/lib/libkern

2019-02-06 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Thu Feb  7 04:33:24 UTC 2019

Modified Files:
src/sys/lib/libkern: Makefile.compiler-rt

Log Message:
for sh3 and GCC 7 pass -fnon-call-exceptions for udivmoddi4.c.
avoids it emitting a call to abort() for an explicit divide by zero.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/lib/libkern/Makefile.compiler-rt

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

Modified files:

Index: src/sys/lib/libkern/Makefile.compiler-rt
diff -u src/sys/lib/libkern/Makefile.compiler-rt:1.5 src/sys/lib/libkern/Makefile.compiler-rt:1.6
--- src/sys/lib/libkern/Makefile.compiler-rt:1.5	Sun Aug 10 05:57:31 2014
+++ src/sys/lib/libkern/Makefile.compiler-rt	Thu Feb  7 04:33:24 2019
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.compiler-rt,v 1.5 2014/08/10 05:57:31 matt Exp $
+# $NetBSD: Makefile.compiler-rt,v 1.6 2019/02/07 04:33:24 mrg Exp $
 
 COMPILER_RT_SRCDIR=	${NETBSDSRCDIR}/sys/external/bsd/compiler_rt/dist
 
@@ -126,3 +126,10 @@ COPTS.${src}+=	-Wno-missing-prototypes \
 .endfor
 
 CPPFLAGS.int_util.c+=	-DKERNEL_USE
+
+# XXX Explicit divide by zero in udivmoddi4.c -> abort().
+.if defined(HAVE_GCC) && ${HAVE_GCC} == 7 && ${ACTIVE_CC} == "gcc"
+. if ${MACHINE_CPU} == "sh3"
+COPTS.udivmoddi4.c+=	-fnon-call-exceptions
+. endif
+.endif



CVS commit: src

2019-02-06 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Thu Feb  7 04:33:58 UTC 2019

Modified Files:
src/distrib/newsmips/floppies/ramdisk: Makefile
src/distrib/sgimips/ramdisk: Makefile
src/distrib/sun3/ramdisk: Makefile
src/sys/arch/newsmips/conf: INSTALL
src/sys/arch/sgimips/conf: INSTALL32_IP2x INSTALL64_IP2x
src/sys/arch/sun3/conf: RAMDISK RAMDISK3X

Log Message:
bump ramdisk sizes to cope with GCC 7 bloat.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/distrib/newsmips/floppies/ramdisk/Makefile
cvs rdiff -u -r1.20 -r1.21 src/distrib/sgimips/ramdisk/Makefile
cvs rdiff -u -r1.40 -r1.41 src/distrib/sun3/ramdisk/Makefile
cvs rdiff -u -r1.46 -r1.47 src/sys/arch/newsmips/conf/INSTALL
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/sgimips/conf/INSTALL32_IP2x
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/sgimips/conf/INSTALL64_IP2x
cvs rdiff -u -r1.54 -r1.55 src/sys/arch/sun3/conf/RAMDISK
cvs rdiff -u -r1.42 -r1.43 src/sys/arch/sun3/conf/RAMDISK3X

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

Modified files:

Index: src/distrib/newsmips/floppies/ramdisk/Makefile
diff -u src/distrib/newsmips/floppies/ramdisk/Makefile:1.34 src/distrib/newsmips/floppies/ramdisk/Makefile:1.35
--- src/distrib/newsmips/floppies/ramdisk/Makefile:1.34	Tue Jul 18 23:07:20 2017
+++ src/distrib/newsmips/floppies/ramdisk/Makefile	Thu Feb  7 04:33:58 2019
@@ -1,10 +1,10 @@
-#	$NetBSD: Makefile,v 1.34 2017/07/18 23:07:20 christos Exp $
+#	$NetBSD: Makefile,v 1.35 2019/02/07 04:33:58 mrg Exp $
 
 .include 
 .include "${NETBSDSRCDIR}/distrib/common/Makefile.distrib"
 
 IMAGE=		ramdisk.fs
-IMAGESIZE=	2800k
+IMAGESIZE=	3000k
 MAKEFS_FLAGS+=	-f 15
 
 WARNS=		1

Index: src/distrib/sgimips/ramdisk/Makefile
diff -u src/distrib/sgimips/ramdisk/Makefile:1.20 src/distrib/sgimips/ramdisk/Makefile:1.21
--- src/distrib/sgimips/ramdisk/Makefile:1.20	Tue Jan 24 18:04:04 2017
+++ src/distrib/sgimips/ramdisk/Makefile	Thu Feb  7 04:33:58 2019
@@ -1,11 +1,11 @@
-#	$NetBSD: Makefile,v 1.20 2017/01/24 18:04:04 christos Exp $
+#	$NetBSD: Makefile,v 1.21 2019/02/07 04:33:58 mrg Exp $
 
 .include 
 .include "${NETBSDSRCDIR}/distrib/common/Makefile.distrib"
 
 IMAGE=		ramdisk.fs
 IMAGETAR=	diskimage.tgz
-IMAGESIZE=	3200k
+IMAGESIZE=	3300k
 MAKEFS_FLAGS+=	-f 15 -o density=4k
 
 WARNS=		1

Index: src/distrib/sun3/ramdisk/Makefile
diff -u src/distrib/sun3/ramdisk/Makefile:1.40 src/distrib/sun3/ramdisk/Makefile:1.41
--- src/distrib/sun3/ramdisk/Makefile:1.40	Tue Jan 24 18:04:05 2017
+++ src/distrib/sun3/ramdisk/Makefile	Thu Feb  7 04:33:58 2019
@@ -1,11 +1,11 @@
-#	$NetBSD: Makefile,v 1.40 2017/01/24 18:04:05 christos Exp $
+#	$NetBSD: Makefile,v 1.41 2019/02/07 04:33:58 mrg Exp $
 
 .include 
 .include "${NETBSDSRCDIR}/distrib/common/Makefile.distrib"
 .include 
 
 IMAGE=		ramdisk.fs
-IMAGESIZE=	600k
+IMAGESIZE=	660k
 MAKEFS_FLAGS+=	-f 6 -o density=3500
 
 WARNS=		1

Index: src/sys/arch/newsmips/conf/INSTALL
diff -u src/sys/arch/newsmips/conf/INSTALL:1.46 src/sys/arch/newsmips/conf/INSTALL:1.47
--- src/sys/arch/newsmips/conf/INSTALL:1.46	Thu Sep 14 07:58:42 2017
+++ src/sys/arch/newsmips/conf/INSTALL	Thu Feb  7 04:33:58 2019
@@ -1,4 +1,4 @@
-# 	$NetBSD: INSTALL,v 1.46 2017/09/14 07:58:42 mrg Exp $
+# 	$NetBSD: INSTALL,v 1.47 2019/02/07 04:33:58 mrg Exp $
 #
 #	INSTALL kernel for RISC-NEWS
 
@@ -14,7 +14,7 @@ maxusers	8
 options 	MEMORY_DISK_HOOKS
 options 	MEMORY_DISK_IS_ROOT		# Force root on ram-disk
 options 	MEMORY_DISK_SERVER=0		# no userspace md(4) support
-options 	MEMORY_DISK_ROOT_SIZE=5700	# 2.85 Megabytes
+options 	MEMORY_DISK_ROOT_SIZE=6000	# 3000 Kilobytes
 options 	MEMORY_DISK_RBFLAGS=RB_SINGLE	# boot in single-user mode
 
 options 	news3400

Index: src/sys/arch/sgimips/conf/INSTALL32_IP2x
diff -u src/sys/arch/sgimips/conf/INSTALL32_IP2x:1.10 src/sys/arch/sgimips/conf/INSTALL32_IP2x:1.11
--- src/sys/arch/sgimips/conf/INSTALL32_IP2x:1.10	Sun Sep  2 08:51:53 2018
+++ src/sys/arch/sgimips/conf/INSTALL32_IP2x	Thu Feb  7 04:33:58 2019
@@ -11,7 +11,7 @@ makeoptions	COPTS="-Os -mmemcpy"
 options MEMORY_DISK_HOOKS
 options MEMORY_DISK_IS_ROOT # force root on memory disk
 options MEMORY_DISK_SERVER=0# no userspace memory disk support
-options MEMORY_DISK_ROOT_SIZE=6400 # size of memory disk in blocks (3200k)
+options MEMORY_DISK_ROOT_SIZE=6600 # size of memory disk in blocks (3300k)
 options MEMORY_DISK_RBFLAGS=RB_SINGLE   # boot in single-user mode
 
 # shrink kernel since ARC BIOS seems to have 8MB limit

Index: src/sys/arch/sgimips/conf/INSTALL64_IP2x
diff -u src/sys/arch/sgimips/conf/INSTALL64_IP2x:1.3 src/sys/arch/sgimips/conf/INSTALL64_IP2x:1.4
--- src/sys/arch/sgimips/conf/INSTALL64_IP2x:1.3	Fri Jun  9 07:32:24 2017
+++ src/sys/arch/sgimips/conf/INSTALL64_IP2x	Thu Feb  7 04:33:58 2019
@@ -11,4 +11,4 @@ makeoptions	COPTS="-Os"
 options MEMORY_DISK_HOOKS
 options 

CVS commit: src/sys/arch/pmax/pmax

2019-02-06 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Thu Feb  7 04:32:38 UTC 2019

Modified Files:
src/sys/arch/pmax/pmax: bus.c

Log Message:
#if 0 the same code as already done


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/pmax/pmax/bus.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/pmax/pmax/bus.c
diff -u src/sys/arch/pmax/pmax/bus.c:1.3 src/sys/arch/pmax/pmax/bus.c:1.4
--- src/sys/arch/pmax/pmax/bus.c:1.3	Sun Jul 16 17:35:20 2017
+++ src/sys/arch/pmax/pmax/bus.c	Thu Feb  7 04:32:38 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus.c,v 1.3 2017/07/16 17:35:20 christos Exp $	*/
+/*	$NetBSD: bus.c,v 1.4 2019/02/07 04:32:38 mrg Exp $	*/
 
 /*-
  * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: bus.c,v 1.3 2017/07/16 17:35:20 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bus.c,v 1.4 2019/02/07 04:32:38 mrg Exp $");
 
 #include "opt_cputype.h"
 
@@ -62,8 +62,10 @@ struct mips_bus_dma_tag pmax_default_bus
 };
 
 static void normal_bus_mem_init(bus_space_tag_t, void *);
+#ifdef MIPS1
 static void _bus_dmamap_sync_r3k(bus_dma_tag_t, bus_dmamap_t, bus_addr_t,
  bus_size_t, int);
+#endif
 #if 0
 static void _bus_dmamap_sync_r4k(bus_dma_tag_t, bus_dmamap_t, bus_addr_t,
  bus_size_t, int);



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

2019-02-06 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Thu Feb  7 04:32:54 UTC 2019

Modified Files:
src/sys/arch/mips/include: bus_dma_defs.h

Log Message:
add missing BUS_DMA_PREFETCHABLE


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/mips/include/bus_dma_defs.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/mips/include/bus_dma_defs.h
diff -u src/sys/arch/mips/include/bus_dma_defs.h:1.3 src/sys/arch/mips/include/bus_dma_defs.h:1.4
--- src/sys/arch/mips/include/bus_dma_defs.h:1.3	Sat Jul 30 06:28:05 2016
+++ src/sys/arch/mips/include/bus_dma_defs.h	Thu Feb  7 04:32:54 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: bus_dma_defs.h,v 1.3 2016/07/30 06:28:05 matt Exp $ */
+/* $NetBSD: bus_dma_defs.h,v 1.4 2019/02/07 04:32:54 mrg Exp $ */
 
 /*-
  * Copyright (c) 1997, 1998, 2000, 2001 The NetBSD Foundation, Inc.
@@ -82,6 +82,8 @@
 #define	BUS_DMA_READ		0x100	/* mapping is device -> memory only */
 #define	BUS_DMA_WRITE		0x200	/* mapping is memory -> device only */
 #define	BUS_DMA_NOCACHE		0x400	/* hint: map non-cached memory */
+#define	BUS_DMA_PREFETCHABLE	0x800	/* hint: map non-cached but allow 
+	 * things like write combining */
 
 /*
  * Private flags stored in the DMA map.



CVS commit: src/sys/arch

2019-02-06 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Thu Feb  7 04:31:49 UTC 2019

Modified Files:
src/sys/arch/arc/include: param.h
src/sys/arch/cobalt/include: bus_defs.h

Log Message:
remove stuff provided by generic mips headers


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/arch/arc/include/param.h
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/cobalt/include/bus_defs.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/arc/include/param.h
diff -u src/sys/arch/arc/include/param.h:1.31 src/sys/arch/arc/include/param.h:1.32
--- src/sys/arch/arc/include/param.h:1.31	Mon Jan  7 22:00:30 2019
+++ src/sys/arch/arc/include/param.h	Thu Feb  7 04:31:49 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: param.h,v 1.31 2019/01/07 22:00:30 jdolecek Exp $	*/
+/*	$NetBSD: param.h,v 1.32 2019/02/07 04:31:49 mrg Exp $	*/
 /*  $OpenBSD: param.h,v 1.9 1997/04/30 09:54:15 niklas Exp $ */
 
 /*
@@ -59,9 +59,6 @@
 #define	KERNBASE	0x8000	/* start of kernel virtual */
 #define	BTOPKERNBASE	((u_long)KERNBASE >> PGSHIFT)
 
-#define	SSIZE		1		/* initial stack size/NBPG */
-#define	SINCR		1		/* increment of stack/NBPG */
-
 #if defined(_LOCORE) && defined(notyet)
 #define	UADDR		0xc000	/* address of u */
 #else
@@ -71,22 +68,6 @@
 #define	UVPN		(UADDR>>PGSHIFT)/* virtual page number of u */
 #define	KERNELSTACK	(UADDR+UPAGES*NBPG)	/* top of kernel stack */
 
-/*
- * Constants related to network buffer management.
- * MCLBYTES must be no larger than NBPG (the software page size), and,
- * on machines that exchange pages of input or output buffers with mbuf
- * clusters (MAPPED_MBUFS), MCLBYTES must also be an integral multiple
- * of the hardware page size.
- */
-#define	MSIZE		256		/* size of an mbuf */
-
-#ifndef MCLSHIFT
-#define	MCLSHIFT	11		/* convert bytes to m_buf clusters */
-	/* 2K cluster can hold Ether frame */
-#endif	/* MCLSHIFT */
-
-#define	MCLBYTES	(1 << MCLSHIFT)	/* size of a m_buf cluster */
-
 /* bytes to disk blocks */
 #define	btodb(x)	((x) >> DEV_BSHIFT)
 #define dbtob(x)	((x) << DEV_BSHIFT)

Index: src/sys/arch/cobalt/include/bus_defs.h
diff -u src/sys/arch/cobalt/include/bus_defs.h:1.3 src/sys/arch/cobalt/include/bus_defs.h:1.4
--- src/sys/arch/cobalt/include/bus_defs.h:1.3	Sat Jan 20 13:56:09 2018
+++ src/sys/arch/cobalt/include/bus_defs.h	Thu Feb  7 04:31:49 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus_defs.h,v 1.3 2018/01/20 13:56:09 skrll Exp $	*/
+/*	$NetBSD: bus_defs.h,v 1.4 2019/02/07 04:31:49 mrg Exp $	*/
 
 /*
  * Copyright (c) 1996, 1997, 1998, 2001 The NetBSD Foundation, Inc.
@@ -33,14 +33,6 @@
 #ifndef _COBALT_BUS_DEFS_H_
 #define _COBALT_BUS_DEFS_H_
 
-/*
- * Bus address and size types
- */
-typedef paddr_t bus_addr_t;
-typedef psize_t bus_size_t;
-#define	PRIxBUSADDR	PRIxPADDR
-#define	PRIxBUSSIZE	PRIxPSIZE
-
 #include 
 
 #define _MIPS_NEED_BUS_DMA_BOUNCE



CVS commit: src/external/gpl3

2019-02-06 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Thu Feb  7 04:32:12 UTC 2019

Modified Files:
src/external/gpl3/binutils.old/dist/bfd: config.bfd
src/external/gpl3/binutils/dist/bfd: config.bfd

Log Message:
add mips ecoff vectors to netbsd-mips64.  for objcopy.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/external/gpl3/binutils.old/dist/bfd/config.bfd
cvs rdiff -u -r1.30 -r1.31 src/external/gpl3/binutils/dist/bfd/config.bfd

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

Modified files:

Index: src/external/gpl3/binutils.old/dist/bfd/config.bfd
diff -u src/external/gpl3/binutils.old/dist/bfd/config.bfd:1.6 src/external/gpl3/binutils.old/dist/bfd/config.bfd:1.7
--- src/external/gpl3/binutils.old/dist/bfd/config.bfd:1.6	Mon Jul  9 11:55:45 2018
+++ src/external/gpl3/binutils.old/dist/bfd/config.bfd	Thu Feb  7 04:32:12 2019
@@ -1088,11 +1088,11 @@ case "${targ}" in
 ;;
   mips64*el-*-netbsd*)
 targ_defvec=mips_elf32_ntrad_le_vec
-targ_selvecs="mips_elf32_ntrad_be_vec mips_elf32_trad_le_vec mips_elf32_trad_be_vec mips_elf64_trad_le_vec mips_elf64_trad_be_vec"
+targ_selvecs="mips_elf32_ntrad_be_vec mips_elf32_trad_le_vec mips_elf32_trad_be_vec mips_elf64_trad_le_vec mips_elf64_trad_be_vec mips_ecoff_le_vec mips_ecoff_be_vec"
 ;;
   mips64*-*-netbsd*)
 targ_defvec=mips_elf32_ntrad_be_vec
-targ_selvecs="mips_elf32_ntrad_le_vec mips_elf32_trad_be_vec mips_elf32_trad_le_vec mips_elf64_trad_be_vec mips_elf64_trad_le_vec"
+targ_selvecs="mips_elf32_ntrad_le_vec mips_elf32_trad_be_vec mips_elf32_trad_le_vec mips_elf64_trad_be_vec mips_elf64_trad_le_vec mips_ecoff_be_vec mips_ecoff_le_vec"
 ;;
   mips*el-*-netbsd*)
 targ_defvec=mips_elf32_trad_le_vec

Index: src/external/gpl3/binutils/dist/bfd/config.bfd
diff -u src/external/gpl3/binutils/dist/bfd/config.bfd:1.30 src/external/gpl3/binutils/dist/bfd/config.bfd:1.31
--- src/external/gpl3/binutils/dist/bfd/config.bfd:1.30	Mon Dec 31 20:57:13 2018
+++ src/external/gpl3/binutils/dist/bfd/config.bfd	Thu Feb  7 04:32:12 2019
@@ -895,11 +895,11 @@ case "${targ}" in
 ;;
   mips64*el-*-netbsd*)
 targ_defvec=mips_elf32_ntrad_le_vec
-targ_selvecs="mips_elf32_ntrad_be_vec mips_elf32_trad_le_vec mips_elf32_trad_be_vec mips_elf64_trad_le_vec mips_elf64_trad_be_vec"
+targ_selvecs="mips_elf32_ntrad_be_vec mips_elf32_trad_le_vec mips_elf32_trad_be_vec mips_elf64_trad_le_vec mips_elf64_trad_be_vec mips_ecoff_le_vec mips_ecoff_be_vec"
 ;;
   mips64*-*-netbsd*)
 targ_defvec=mips_elf32_ntrad_be_vec
-targ_selvecs="mips_elf32_ntrad_le_vec mips_elf32_trad_be_vec mips_elf32_trad_le_vec mips_elf64_trad_be_vec mips_elf64_trad_le_vec"
+targ_selvecs="mips_elf32_ntrad_le_vec mips_elf32_trad_be_vec mips_elf32_trad_le_vec mips_elf64_trad_be_vec mips_elf64_trad_le_vec mips_ecoff_be_vec mips_ecoff_le_vec"
 ;;
   mips*el-*-netbsd*)
 targ_defvec=mips_elf32_trad_le_vec



CVS commit: src/external/gpl3/gcc

2019-02-06 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Thu Feb  7 04:25:48 UTC 2019

Modified Files:
src/external/gpl3/gcc/lib/libbacktrace/arch/m68000:
backtrace-supported.h
src/external/gpl3/gcc/lib/libgcc/arch/m68000: auto-target.h defs.mk
src/external/gpl3/gcc/lib/libgcc/libgcov/arch/m68000: defs.mk
gcov-iov.h
src/external/gpl3/gcc/lib/libgomp/arch/m68000: config.h libgomp_f.h
omp.h
src/external/gpl3/gcc/lib/libobjc/arch/m68000: defs.mk
src/external/gpl3/gcc/lib/libstdc++-v3/arch/m68000: c++config.h
cxxabi_tweaks.h defs.mk gstdint.h gthr-posix.h gthr-single.h gthr.h
src/external/gpl3/gcc/usr.bin/gcc/arch/m68000: auto-host.h bversion.h
configargs.h defs.mk gtyp-input.list insn-modes.h plugin-version.h
src/external/gpl3/gcc/usr.bin/libcpp/arch/m68000: config.h
Added Files:
src/external/gpl3/gcc/lib/libgcc/arch/m68000: gthr-defs.mk
src/external/gpl3/gcc/usr.bin/common-target/arch: m68000.mk

Log Message:
mknative-gcc and GCC 7 and sun2.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 \
src/external/gpl3/gcc/lib/libbacktrace/arch/m68000/backtrace-supported.h
cvs rdiff -u -r1.4 -r1.5 \
src/external/gpl3/gcc/lib/libgcc/arch/m68000/auto-target.h
cvs rdiff -u -r1.11 -r1.12 \
src/external/gpl3/gcc/lib/libgcc/arch/m68000/defs.mk
cvs rdiff -u -r0 -r1.1 \
src/external/gpl3/gcc/lib/libgcc/arch/m68000/gthr-defs.mk
cvs rdiff -u -r1.3 -r1.4 \
src/external/gpl3/gcc/lib/libgcc/libgcov/arch/m68000/defs.mk
cvs rdiff -u -r1.11 -r1.12 \
src/external/gpl3/gcc/lib/libgcc/libgcov/arch/m68000/gcov-iov.h
cvs rdiff -u -r1.5 -r1.6 \
src/external/gpl3/gcc/lib/libgomp/arch/m68000/config.h \
src/external/gpl3/gcc/lib/libgomp/arch/m68000/omp.h
cvs rdiff -u -r1.4 -r1.5 \
src/external/gpl3/gcc/lib/libgomp/arch/m68000/libgomp_f.h
cvs rdiff -u -r1.3 -r1.4 \
src/external/gpl3/gcc/lib/libobjc/arch/m68000/defs.mk
cvs rdiff -u -r1.19 -r1.20 \
src/external/gpl3/gcc/lib/libstdc++-v3/arch/m68000/c++config.h
cvs rdiff -u -r1.4 -r1.5 \
src/external/gpl3/gcc/lib/libstdc++-v3/arch/m68000/cxxabi_tweaks.h \
src/external/gpl3/gcc/lib/libstdc++-v3/arch/m68000/gthr-posix.h \
src/external/gpl3/gcc/lib/libstdc++-v3/arch/m68000/gthr-single.h \
src/external/gpl3/gcc/lib/libstdc++-v3/arch/m68000/gthr.h
cvs rdiff -u -r1.10 -r1.11 \
src/external/gpl3/gcc/lib/libstdc++-v3/arch/m68000/defs.mk
cvs rdiff -u -r1.12 -r1.13 \
src/external/gpl3/gcc/lib/libstdc++-v3/arch/m68000/gstdint.h
cvs rdiff -u -r0 -r1.1 \
src/external/gpl3/gcc/usr.bin/common-target/arch/m68000.mk
cvs rdiff -u -r1.13 -r1.14 \
src/external/gpl3/gcc/usr.bin/gcc/arch/m68000/auto-host.h \
src/external/gpl3/gcc/usr.bin/gcc/arch/m68000/defs.mk
cvs rdiff -u -r1.10 -r1.11 \
src/external/gpl3/gcc/usr.bin/gcc/arch/m68000/bversion.h
cvs rdiff -u -r1.21 -r1.22 \
src/external/gpl3/gcc/usr.bin/gcc/arch/m68000/configargs.h
cvs rdiff -u -r1.4 -r1.5 \
src/external/gpl3/gcc/usr.bin/gcc/arch/m68000/gtyp-input.list
cvs rdiff -u -r1.2 -r1.3 \
src/external/gpl3/gcc/usr.bin/gcc/arch/m68000/insn-modes.h
cvs rdiff -u -r1.11 -r1.12 \
src/external/gpl3/gcc/usr.bin/gcc/arch/m68000/plugin-version.h
cvs rdiff -u -r1.4 -r1.5 \
src/external/gpl3/gcc/usr.bin/libcpp/arch/m68000/config.h

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

Modified files:

Index: src/external/gpl3/gcc/lib/libbacktrace/arch/m68000/backtrace-supported.h
diff -u src/external/gpl3/gcc/lib/libbacktrace/arch/m68000/backtrace-supported.h:1.4 src/external/gpl3/gcc/lib/libbacktrace/arch/m68000/backtrace-supported.h:1.5
--- src/external/gpl3/gcc/lib/libbacktrace/arch/m68000/backtrace-supported.h:1.4	Tue Feb  6 09:18:16 2018
+++ src/external/gpl3/gcc/lib/libbacktrace/arch/m68000/backtrace-supported.h	Thu Feb  7 04:25:47 2019
@@ -1,9 +1,9 @@
 /* This file is automatically generated.  DO NOT EDIT! */
-/* Generated from: NetBSD: mknative-gcc,v 1.92 2018/02/06 07:04:01 mrg Exp  */
-/* Generated from: NetBSD: mknative.common,v 1.15 2017/11/29 03:32:28 christos Exp  */
+/* Generated from: NetBSD: mknative-gcc,v 1.99 2019/02/04 01:46:59 mrg Exp  */
+/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp  */
 
 /* backtrace-supported.h.in -- Whether stack backtrace is supported.
-   Copyright (C) 2012-2016 Free Software Foundation, Inc.
+   Copyright (C) 2012-2017 Free Software Foundation, Inc.
Written by Ian Lance Taylor, Google.
 
 Redistribution and use in source and binary forms, with or without
@@ -11,13 +11,13 @@ modification, are permitted provided tha
 met:
 
 (1) Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer. 
+notice, this list of conditions and the following disclaimer.
 
 (2) Redistributions in binary form must 

CVS commit: src/external/gpl3/gcc/dist/gcc

2019-02-06 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Thu Feb  7 04:12:27 UTC 2019

Modified Files:
src/external/gpl3/gcc/dist/gcc: config.gcc

Log Message:
don't lose the netbsd general tmake_file values for m68010.


To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.47 src/external/gpl3/gcc/dist/gcc/config.gcc

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

Modified files:

Index: src/external/gpl3/gcc/dist/gcc/config.gcc
diff -u src/external/gpl3/gcc/dist/gcc/config.gcc:1.46 src/external/gpl3/gcc/dist/gcc/config.gcc:1.47
--- src/external/gpl3/gcc/dist/gcc/config.gcc:1.46	Tue Feb  5 04:45:50 2019
+++ src/external/gpl3/gcc/dist/gcc/config.gcc	Thu Feb  7 04:12:27 2019
@@ -2018,7 +2018,7 @@ m68010-*-netbsdelf* | m68k-*-netbsdelf* 
 		;;
 	m68010*)
 		target_cpu_default="m68010"
-		tmake_file="m68k/t-m68kelf m68k/t-m68010-netbsd"
+		tmake_file="${tmake_file} m68k/t-m68kelf m68k/t-m68010-netbsd"
 		default_m68k_cpu=68010
 		tmake_file="${tmake_file} m68k/t-floatlib"
 		;;



CVS commit: src/sys/dev/pci

2019-02-06 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Feb  7 04:03:25 UTC 2019

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

Log Message:
 Fix a bug that WOL didn't work on some chips since if_wm.c rev. 1.60.
Set WUC_APME bit older than PCH. Will fixes PR kern/53945 reported by kardel@.
Tested with my own 82574 card.


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

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

Modified files:

Index: src/sys/dev/pci/if_wm.c
diff -u src/sys/dev/pci/if_wm.c:1.624 src/sys/dev/pci/if_wm.c:1.625
--- src/sys/dev/pci/if_wm.c:1.624	Wed Feb  6 07:20:13 2019
+++ src/sys/dev/pci/if_wm.c	Thu Feb  7 04:03:24 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wm.c,v 1.624 2019/02/06 07:20:13 msaitoh Exp $	*/
+/*	$NetBSD: if_wm.c,v 1.625 2019/02/07 04:03:24 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -83,7 +83,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.624 2019/02/06 07:20:13 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.625 2019/02/07 04:03:24 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -15028,7 +15028,7 @@ wm_enable_wakeup(struct wm_softc *sc)
 			goto pme;
 	} else {
 		/* Enable wakeup by the MAC */
-		CSR_WRITE(sc, WMREG_WUC, WUC_PME_EN);
+		CSR_WRITE(sc, WMREG_WUC, WUC_APME | WUC_PME_EN);
 		CSR_WRITE(sc, WMREG_WUFC, WUFC_MAG);
 	}
 



CVS commit: src/sys/dev/raidframe

2019-02-06 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Feb  7 03:03:00 UTC 2019

Modified Files:
src/sys/dev/raidframe: rf_netbsdkintf.c

Log Message:
You need a star :-)


To generate a diff of this commit:
cvs rdiff -u -r1.372 -r1.373 src/sys/dev/raidframe/rf_netbsdkintf.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/raidframe/rf_netbsdkintf.c
diff -u src/sys/dev/raidframe/rf_netbsdkintf.c:1.372 src/sys/dev/raidframe/rf_netbsdkintf.c:1.373
--- src/sys/dev/raidframe/rf_netbsdkintf.c:1.372	Wed Feb  6 18:00:16 2019
+++ src/sys/dev/raidframe/rf_netbsdkintf.c	Wed Feb  6 22:03:00 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: rf_netbsdkintf.c,v 1.372 2019/02/06 23:00:16 christos Exp $	*/
+/*	$NetBSD: rf_netbsdkintf.c,v 1.373 2019/02/07 03:03:00 christos Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2008-2011 The NetBSD Foundation, Inc.
@@ -101,7 +101,7 @@
  ***/
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.372 2019/02/06 23:00:16 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.373 2019/02/07 03:03:00 christos Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_raid_autoconfig.h"
@@ -1167,7 +1167,7 @@ rf_getConfiguration(struct raid_softc *r
 	if (*k_cfg == NULL) {
 		return ENOMEM;
 	}
-	int retcode = copyin(u_cfg, k_cfg, sizeof(RF_Config_t));
+	int retcode = copyin(u_cfg, *k_cfg, sizeof(RF_Config_t));
 	if (retcode == 0)
 		return 0;
 	RF_Free(*k_cfg, sizeof(RF_Config_t));



CVS commit: src/tests/lib/libc/sys

2019-02-06 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Thu Feb  7 00:24:59 UTC 2019

Modified Files:
src/tests/lib/libc/sys: t_ptrace_wait.c

Log Message:
Enable 3 new ptrace(2) tests for SIGILL

Add missing code for SIGILL verification and enable new SIGILL tests:
 - traceme_crash_ill
 - traceme_vfork_crash_ill
 - unrelated_tracer_sees_crash_ill

SIGILL is caused by a crash signal and needs special treatement that has
to be asserted to behave correctly.

In the unrelated_tracer_sees_crash* tests add additional check to catch
scenarios when a test dies due to abnormal condition and it's not caught
as the tracer is collected by initproc.

All tests pass on NetBSD/amd64, other ports have temporarily unimplemented
PTRACE_ILLEGAL_ASM.


To generate a diff of this commit:
cvs rdiff -u -r1.70 -r1.71 src/tests/lib/libc/sys/t_ptrace_wait.c

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

Modified files:

Index: src/tests/lib/libc/sys/t_ptrace_wait.c
diff -u src/tests/lib/libc/sys/t_ptrace_wait.c:1.70 src/tests/lib/libc/sys/t_ptrace_wait.c:1.71
--- src/tests/lib/libc/sys/t_ptrace_wait.c:1.70	Sun Feb  3 03:19:28 2019
+++ src/tests/lib/libc/sys/t_ptrace_wait.c	Thu Feb  7 00:24:59 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_ptrace_wait.c,v 1.70 2019/02/03 03:19:28 mrg Exp $	*/
+/*	$NetBSD: t_ptrace_wait.c,v 1.71 2019/02/07 00:24:59 kamil Exp $	*/
 
 /*-
  * Copyright (c) 2016 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: t_ptrace_wait.c,v 1.70 2019/02/03 03:19:28 mrg Exp $");
+__RCSID("$NetBSD: t_ptrace_wait.c,v 1.71 2019/02/07 00:24:59 kamil Exp $");
 
 #include 
 #include 
@@ -190,6 +190,11 @@ traceme_crash(int sig)
 #endif
 	struct ptrace_siginfo info;
 
+#ifndef PTRACE_ILLEGAL_ASM
+	if (sig == SIGILL)
+		atf_tc_skip("PTRACE_ILLEGAL_ASM not defined");
+#endif
+
 	memset(, 0, sizeof(info));
 
 	DPRINTF("Before forking process PID=%d\n", getpid());
@@ -247,9 +252,9 @@ traceme_crash(int sig)
 	case SIGSEGV:
 		ATF_REQUIRE_EQ(info.psi_siginfo.si_code, SEGV_MAPERR);
 		break;
-//	case SIGILL:
-//		ATF_REQUIRE_EQ(info.psi_siginfo.si_code, ILL_ILLOP);
-//		break;
+	case SIGILL:
+		ATF_REQUIRE_EQ(info.psi_siginfo.si_code, ILL_PRVOPC);
+		break;
 	case SIGFPE:
 		ATF_REQUIRE_EQ(info.psi_siginfo.si_code, FPE_INTDIV);
 		break;
@@ -285,7 +290,7 @@ ATF_TC_BODY(test, tc)			\
 
 TRACEME_CRASH(traceme_crash_trap, SIGTRAP)
 TRACEME_CRASH(traceme_crash_segv, SIGSEGV)
-//TRACEME_CRASH(traceme_crash_ill, SIGILL)
+TRACEME_CRASH(traceme_crash_ill, SIGILL)
 TRACEME_CRASH(traceme_crash_fpe, SIGFPE)
 TRACEME_CRASH(traceme_crash_bus, SIGBUS)
 
@@ -871,6 +876,11 @@ traceme_vfork_crash(int sig)
 	int status;
 #endif
 
+#ifndef PTRACE_ILLEGAL_ASM
+	if (sig == SIGILL)
+		atf_tc_skip("PTRACE_ILLEGAL_ASM not defined");
+#endif
+
 	DPRINTF("Before forking process PID=%d\n", getpid());
 	SYSCALL_REQUIRE((child = vfork()) != -1);
 	if (child == 0) {
@@ -930,7 +940,7 @@ ATF_TC_BODY(test, tc)			\
 
 TRACEME_VFORK_CRASH(traceme_vfork_crash_trap, SIGTRAP)
 TRACEME_VFORK_CRASH(traceme_vfork_crash_segv, SIGSEGV)
-//TRACEME_VFORK_CRASH(traceme_vfork_crash_ill, SIGILL)
+TRACEME_VFORK_CRASH(traceme_vfork_crash_ill, SIGILL)
 TRACEME_VFORK_CRASH(traceme_vfork_crash_fpe, SIGFPE)
 TRACEME_VFORK_CRASH(traceme_vfork_crash_bus, SIGBUS)
 
@@ -1011,6 +1021,11 @@ unrelated_tracer_sees_crash(int sig)
 #endif
 	struct ptrace_siginfo info;
 
+#ifndef PTRACE_ILLEGAL_ASM
+	if (sig == SIGILL)
+		atf_tc_skip("PTRACE_ILLEGAL_ASM not defined");
+#endif
+
 	memset(, 0, sizeof(info));
 
 	DPRINTF("Spawn tracee\n");
@@ -1097,9 +1112,9 @@ unrelated_tracer_sees_crash(int sig)
 		case SIGSEGV:
 			ATF_REQUIRE_EQ(info.psi_siginfo.si_code, SEGV_MAPERR);
 			break;
-//		case SIGILL:
-//			ATF_REQUIRE_EQ(info.psi_siginfo.si_code, ILL_ILLOP);
-//			break;
+		case SIGILL:
+			ATF_REQUIRE_EQ(info.psi_siginfo.si_code, ILL_PRVOPC);
+			break;
 		case SIGFPE:
 			ATF_REQUIRE_EQ(info.psi_siginfo.si_code, FPE_INTDIV);
 			break;
@@ -1119,6 +1134,9 @@ unrelated_tracer_sees_crash(int sig)
 		TWAIT_REQUIRE_FAILURE(ECHILD,
 		wpid = TWAIT_GENERIC(tracee, , 0));
 
+		/* Inform parent that tracer is exiting normally */
+		CHILD_TO_PARENT("tracer done", parent_tracer, msg);
+
 		DPRINTF("Before exiting of the tracer process\n");
 		_exit(0 /* collect by initproc */);
 	}
@@ -1150,6 +1168,9 @@ unrelated_tracer_sees_crash(int sig)
 
 	validate_status_signaled(status, SIGKILL, 0);
 
+	DPRINTF("Await normal exit of tracer\n");
+	PARENT_FROM_CHILD("tracer done", parent_tracer, msg);
+
 	msg_close(_tracer);
 	msg_close(_tracee);
 }
@@ -1171,7 +1192,7 @@ ATF_TC_BODY(test, tc)			\
 
 UNRELATED_TRACER_SEES_CRASH(unrelated_tracer_sees_crash_trap, SIGTRAP)
 UNRELATED_TRACER_SEES_CRASH(unrelated_tracer_sees_crash_segv, SIGSEGV)
-//UNRELATED_TRACER_SEES_CRASH(unrelated_tracer_sees_crash_ill, SIGILL)
+UNRELATED_TRACER_SEES_CRASH(unrelated_tracer_sees_crash_ill, SIGILL)
 

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

2019-02-06 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Thu Feb  7 00:19:54 UTC 2019

Modified Files:
src/sys/arch/amd64/include: ptrace.h

Log Message:
Define PTRACE_ILLEGAL_ASM for NetBSD/amd64 in ptrace.h

Use ud2 instruction that is guaranteed to raise an invalid instruction
exception (through SIGILL).

On NetBSD and FreeBSD this instruction raises ILL_PRVOPC, on Linux
ILL_ILLOPN. It's not clear which opion is better "Privileged opcode" vs
"Illegal operand", because ud2 doesn't seem to be a privileged operation
and it doesn't take any operand.

Assume in future changes that this opcode will raise ILL_PRVOPC and keep
it purely for testing purposes of the SIGILL crash type.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/amd64/include/ptrace.h

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

Modified files:

Index: src/sys/arch/amd64/include/ptrace.h
diff -u src/sys/arch/amd64/include/ptrace.h:1.12 src/sys/arch/amd64/include/ptrace.h:1.13
--- src/sys/arch/amd64/include/ptrace.h:1.12	Wed Apr 12 18:17:59 2017
+++ src/sys/arch/amd64/include/ptrace.h	Thu Feb  7 00:19:54 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: ptrace.h,v 1.12 2017/04/12 18:17:59 kamil Exp $	*/
+/*	$NetBSD: ptrace.h,v 1.13 2019/02/07 00:19:54 kamil Exp $	*/
 
 /*
  * Copyright (c) 1993 Christopher G. Demetriou
@@ -63,6 +63,8 @@
 #define PTRACE_REG_SP(r)	(r)->regs[_REG_RSP]
 #define PTRACE_REG_INTRV(r)	(r)->regs[_REG_RAX]
 
+#define PTRACE_ILLEGAL_ASM	__asm __volatile ("ud2" : : : "memory")
+
 #define PTRACE_BREAKPOINT	((const uint8_t[]) { 0xcc })
 #define PTRACE_BREAKPOINT_ASM	__asm __volatile ("int3" : : : "memory")
 #define PTRACE_BREAKPOINT_SIZE	1



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

2019-02-06 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Thu Feb  7 00:04:56 UTC 2019

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

Log Message:
fix mips64 GCC 7 builds.


To generate a diff of this commit:
cvs rdiff -u -r1.78 -r1.79 src/distrib/sets/lists/comp/ad.mips

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

Modified files:

Index: src/distrib/sets/lists/comp/ad.mips
diff -u src/distrib/sets/lists/comp/ad.mips:1.78 src/distrib/sets/lists/comp/ad.mips:1.79
--- src/distrib/sets/lists/comp/ad.mips:1.78	Sat Jan 19 13:06:50 2019
+++ src/distrib/sets/lists/comp/ad.mips	Thu Feb  7 00:04:56 2019
@@ -1,8 +1,10 @@
-# $NetBSD: ad.mips,v 1.78 2019/01/19 13:06:50 mrg Exp $
+# $NetBSD: ad.mips,v 1.79 2019/02/07 00:04:56 mrg Exp $
 -./usr/lib/64/libgomp.a
 -./usr/lib/64/libgomp.so
 -./usr/lib/64/libgomp.so.1
 -./usr/lib/64/libgomp.so.1.1
+-./usr/lib/64/libgomp.so.2
+-./usr/lib/64/libgomp.so.2.0
 -./usr/lib/64/libgomp_p.a
 -./usr/lib/64/libgomp_pic.a
 ./usr/bin/elf2aoutcomp-obsolete		obsolete



CVS commit: src/sys/rump/dev/lib/libraidframe

2019-02-06 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Feb  6 23:00:56 UTC 2019

Modified Files:
src/sys/rump/dev/lib/libraidframe: Makefile

Log Message:
kill compat code dependencies.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/rump/dev/lib/libraidframe/Makefile

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

Modified files:

Index: src/sys/rump/dev/lib/libraidframe/Makefile
diff -u src/sys/rump/dev/lib/libraidframe/Makefile:1.12 src/sys/rump/dev/lib/libraidframe/Makefile:1.13
--- src/sys/rump/dev/lib/libraidframe/Makefile:1.12	Mon Feb  4 16:57:48 2019
+++ src/sys/rump/dev/lib/libraidframe/Makefile	Wed Feb  6 18:00:56 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.12 2019/02/04 21:57:48 mrg Exp $
+#	$NetBSD: Makefile,v 1.13 2019/02/06 23:00:56 christos Exp $
 #
 
 .PATH:	${.CURDIR}/../../../../dev/raidframe
@@ -27,18 +27,5 @@ SRCS+=	raidframe_component.c
 
 .include 
 
-.if !empty(RUMP_NBCOMPAT:M50)
-SRCS+=	rf_compat50.c
-.endif
-
-.if !empty(RUMP_NBCOMPAT:M80)
-SRCS+=	rf_compat80.c
-.endif
-
-.include "${.CURDIR}/../../../../compat/netbsd32/netbsd32.mk"
-.if ${COMPAT_USE_NETBSD32} != "no"
-CPPFLAGS.rf_netbsdkintf.c+=	-DCOMPAT_NETBSD32
-.endif
-
 .include 
 .include 



CVS commit: src/sys/dev/raidframe

2019-02-06 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Feb  6 23:00:16 UTC 2019

Modified Files:
src/sys/dev/raidframe: rf_netbsdkintf.c

Log Message:
- Restore indirecting through the data pointer
- Don't try to load compat code if the ioctl is not for us.


To generate a diff of this commit:
cvs rdiff -u -r1.371 -r1.372 src/sys/dev/raidframe/rf_netbsdkintf.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/raidframe/rf_netbsdkintf.c
diff -u src/sys/dev/raidframe/rf_netbsdkintf.c:1.371 src/sys/dev/raidframe/rf_netbsdkintf.c:1.372
--- src/sys/dev/raidframe/rf_netbsdkintf.c:1.371	Tue Feb  5 22:37:13 2019
+++ src/sys/dev/raidframe/rf_netbsdkintf.c	Wed Feb  6 18:00:16 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: rf_netbsdkintf.c,v 1.371 2019/02/06 03:37:13 oster Exp $	*/
+/*	$NetBSD: rf_netbsdkintf.c,v 1.372 2019/02/06 23:00:16 christos Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2008-2011 The NetBSD Foundation, Inc.
@@ -101,7 +101,7 @@
  ***/
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.371 2019/02/06 03:37:13 oster Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.372 2019/02/06 23:00:16 christos Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_raid_autoconfig.h"
@@ -1153,6 +1153,8 @@ rf_copyinspecificbuf(RF_Config_t *k_cfg)
 static int
 rf_getConfiguration(struct raid_softc *rs, void *data, RF_Config_t **k_cfg)
 {
+	RF_Config_t *u_cfg = *((RF_Config_t **) data);
+
 	if (rs->sc_r.valid) {
 		/* There is a valid RAID set running on this unit! */
 		printf("raid%d: Device already configured!\n", rs->sc_unit);
@@ -1165,7 +1167,7 @@ rf_getConfiguration(struct raid_softc *r
 	if (*k_cfg == NULL) {
 		return ENOMEM;
 	}
-	int retcode = copyin(data, k_cfg, sizeof(RF_Config_t));
+	int retcode = copyin(u_cfg, k_cfg, sizeof(RF_Config_t));
 	if (retcode == 0)
 		return 0;
 	RF_Free(*k_cfg, sizeof(RF_Config_t));
@@ -1707,6 +1709,13 @@ raidioctl(dev_t dev, u_long cmd, void *d
 		return retcode;
 #endif
 	default:
+		/*
+		 * Don't bother trying to load compat modules
+		 * if it is not our ioctl. This is more efficient
+		 * and makes rump tests not depend on compat code
+		 */
+		if (IOCGROUP(cmd) != 'r')
+			break;
 #ifdef _LP64
 		if ((l->l_proc->p_flag & PK_32) != 0) {
 			module_autoload("compat_netbsd32_raid",



CVS commit: src/sys/dev/usb

2019-02-06 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Wed Feb  6 22:54:41 UTC 2019

Modified Files:
src/sys/dev/usb: if_mue.c if_ure.c

Log Message:
Fix sign compare differently; instead of casting from int to unsigned,
casting from sizeof (and friends) to int.

Suggested by joerg@.


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 src/sys/dev/usb/if_mue.c
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/usb/if_ure.c

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

Modified files:

Index: src/sys/dev/usb/if_mue.c
diff -u src/sys/dev/usb/if_mue.c:1.40 src/sys/dev/usb/if_mue.c:1.41
--- src/sys/dev/usb/if_mue.c:1.40	Wed Feb  6 22:42:11 2019
+++ src/sys/dev/usb/if_mue.c	Wed Feb  6 22:54:41 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_mue.c,v 1.40 2019/02/06 22:42:11 rin Exp $	*/
+/*	$NetBSD: if_mue.c,v 1.41 2019/02/06 22:54:41 rin Exp $	*/
 /*	$OpenBSD: if_mue.c,v 1.3 2018/08/04 16:42:46 jsg Exp $	*/
 
 /*
@@ -20,7 +20,7 @@
 /* Driver for Microchip LAN7500/LAN7800 chipsets. */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_mue.c,v 1.40 2019/02/06 22:42:11 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_mue.c,v 1.41 2019/02/06 22:54:41 rin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -1240,8 +1240,7 @@ mue_encap(struct mue_softc *sc, struct m
 		  M_CSUM_TCPv6 | M_CSUM_UDPv6);
 
 	len = m->m_pkthdr.len;
-	if (__predict_false((!tso && 
-(unsigned)len > MUE_FRAME_LEN(ifp->if_mtu)) ||
+	if (__predict_false((!tso && len > (int)MUE_FRAME_LEN(ifp->if_mtu)) ||
 			( tso && len > MUE_TSO_FRAME_LEN))) {
 		MUE_PRINTF(sc, "packet length %d\n too long", len);
 		return EINVAL;
@@ -1306,7 +1305,7 @@ mue_prepare_tso(struct mue_softc *sc, st
 	uint16_t type, len = 0;
 	int off;
 
-	if (__predict_true((unsigned)m->m_len >= sizeof(*eh))) {
+	if (__predict_true(m->m_len >= (int)sizeof(*eh))) {
 		eh = mtod(m, struct ether_header *);
 		type = eh->ether_type;
 	} else
@@ -1329,14 +1328,14 @@ mue_prepare_tso(struct mue_softc *sc, st
 	}
 
 	if (m->m_pkthdr.csum_flags & M_CSUM_TSOv4) {
-		if (__predict_true((unsigned)m->m_len >= off + sizeof(*ip))) {
+		if (__predict_true(m->m_len >= off + (int)sizeof(*ip))) {
 			ip = (void *)(mtod(m, char *) + off);
 			ip->ip_len = 0;
 		} else
 			m_copyback(m, off + offsetof(struct ip, ip_len),
 			sizeof(len), );
 	} else {
-		if (__predict_true((unsigned)m->m_len >= off + sizeof(*ip6))) {
+		if (__predict_true(m->m_len >= off + (int)sizeof(*ip6))) {
 			ip6 = (void *)(mtod(m, char *) + off);
 			ip6->ip6_plen = 0;
 		} else
@@ -1822,7 +1821,7 @@ mue_start(struct ifnet *ifp)
 	}
 
 	idx = cd->mue_tx_prod;
-	while ((unsigned)cd->mue_tx_cnt < sc->mue_tx_list_cnt) {
+	while (cd->mue_tx_cnt < (int)sc->mue_tx_list_cnt) {
 		IFQ_POLL(>if_snd, m);
 		if (m == NULL)
 			break;
@@ -1842,7 +1841,7 @@ mue_start(struct ifnet *ifp)
 	}
 	cd->mue_tx_prod = idx;
 
-	if ((unsigned)cd->mue_tx_cnt >= sc->mue_tx_list_cnt)
+	if (cd->mue_tx_cnt >= (int)sc->mue_tx_list_cnt)
 		ifp->if_flags |= IFF_OACTIVE;
 
 	/* Set a timeout in case the chip goes out to lunch. */

Index: src/sys/dev/usb/if_ure.c
diff -u src/sys/dev/usb/if_ure.c:1.1 src/sys/dev/usb/if_ure.c:1.2
--- src/sys/dev/usb/if_ure.c:1.1	Wed Feb  6 11:55:06 2019
+++ src/sys/dev/usb/if_ure.c	Wed Feb  6 22:54:41 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_ure.c,v 1.1 2019/02/06 11:55:06 rin Exp $	*/
+/*	$NetBSD: if_ure.c,v 1.2 2019/02/06 22:54:41 rin Exp $	*/
 /*	$OpenBSD: if_ure.c,v 1.10 2018/11/02 21:32:30 jcs Exp $	*/
 /*-
  * Copyright (c) 2015-2016 Kevin Lo 
@@ -29,7 +29,7 @@
 /* RealTek RTL8152/RTL8153 10/100/Gigabit USB Ethernet device */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_ure.c,v 1.1 2019/02/06 11:55:06 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ure.c,v 1.2 2019/02/06 22:54:41 rin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -1608,7 +1608,7 @@ ure_txcsum(struct mbuf *m)
 	if (flags == 0)
 		return 0;
 
-	if (__predict_true((unsigned)m->m_len >= sizeof(*eh))) {
+	if (__predict_true(m->m_len >= (int)sizeof(*eh))) {
 		eh = mtod(m, struct ether_header *);
 		type = eh->ether_type;
 	} else



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

2019-02-06 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Wed Feb  6 22:50:36 UTC 2019

Modified Files:
src/sys/arch/arm/sunxi: sunxi_sramc.c

Log Message:
Match new sun4i-a10 compat string (allwinner,sun4i-a10-system-control)


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/sunxi/sunxi_sramc.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/sunxi/sunxi_sramc.c
diff -u src/sys/arch/arm/sunxi/sunxi_sramc.c:1.3 src/sys/arch/arm/sunxi/sunxi_sramc.c:1.4
--- src/sys/arch/arm/sunxi/sunxi_sramc.c:1.3	Thu Jan 31 01:49:12 2019
+++ src/sys/arch/arm/sunxi/sunxi_sramc.c	Wed Feb  6 22:50:35 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: sunxi_sramc.c,v 1.3 2019/01/31 01:49:12 jmcneill Exp $ */
+/* $NetBSD: sunxi_sramc.c,v 1.4 2019/02/06 22:50:35 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2017 Jared McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sunxi_sramc.c,v 1.3 2019/01/31 01:49:12 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sunxi_sramc.c,v 1.4 2019/02/06 22:50:35 jmcneill Exp $");
 
 #include 
 #include 
@@ -43,7 +43,8 @@ __KERNEL_RCSID(0, "$NetBSD: sunxi_sramc.
 #include 
 
 static const char * compatible[] = {
-	"allwinner,sun4i-a10-sram-controller",
+	"allwinner,sun4i-a10-sram-controller",	/* old compat string */
+	"allwinner,sun4i-a10-system-control",
 	"allwinner,sun8i-h3-system-control",
 	"allwinner,sun50i-a64-system-control",
 	"allwinner,sun50i-h6-system-control",



CVS commit: src/sys/dev/usb

2019-02-06 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Wed Feb  6 22:42:11 UTC 2019

Modified Files:
src/sys/dev/usb: if_mue.c

Log Message:
We cannot use DPRINTF(sc, ...) when sc is not initialized.


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/sys/dev/usb/if_mue.c

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

Modified files:

Index: src/sys/dev/usb/if_mue.c
diff -u src/sys/dev/usb/if_mue.c:1.39 src/sys/dev/usb/if_mue.c:1.40
--- src/sys/dev/usb/if_mue.c:1.39	Wed Feb  6 09:15:01 2019
+++ src/sys/dev/usb/if_mue.c	Wed Feb  6 22:42:11 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_mue.c,v 1.39 2019/02/06 09:15:01 rin Exp $	*/
+/*	$NetBSD: if_mue.c,v 1.40 2019/02/06 22:42:11 rin Exp $	*/
 /*	$OpenBSD: if_mue.c,v 1.3 2018/08/04 16:42:46 jsg Exp $	*/
 
 /*
@@ -20,7 +20,7 @@
 /* Driver for Microchip LAN7500/LAN7800 chipsets. */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_mue.c,v 1.39 2019/02/06 09:15:01 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_mue.c,v 1.40 2019/02/06 22:42:11 rin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -364,18 +364,18 @@ mue_miibus_statchg(struct ifnet *ifp)
 	uint32_t flow, threshold;
 
 	if (ifp == NULL) {
-		DPRINTF(sc, "ifp not ready\n");
+		printf("%s: ifp not ready\n", __func__);
 		return;
 	}
 
+	sc = ifp->if_softc;
+	mii = GET_MII(sc);
+
 	if ((ifp->if_flags & IFF_RUNNING) == 0) {
 		DPRINTF(sc, "not running\n");
 		return;
 	}
 
-	sc = ifp->if_softc;
-	mii = GET_MII(sc);
-
 	if (mii == NULL) {
 		DPRINTF(sc, "mii not ready\n");
 		return;



CVS commit: src/sbin/raidctl

2019-02-06 Thread Greg Oster
Module Name:src
Committed By:   oster
Date:   Wed Feb  6 22:38:10 UTC 2019

Modified Files:
src/sbin/raidctl: raidctl.c

Log Message:
Correct printed IOCTL name that was incorrect since rev 1.5.


To generate a diff of this commit:
cvs rdiff -u -r1.68 -r1.69 src/sbin/raidctl/raidctl.c

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

Modified files:

Index: src/sbin/raidctl/raidctl.c
diff -u src/sbin/raidctl/raidctl.c:1.68 src/sbin/raidctl/raidctl.c:1.69
--- src/sbin/raidctl/raidctl.c:1.68	Mon Feb  4 09:31:22 2019
+++ src/sbin/raidctl/raidctl.c	Wed Feb  6 22:38:10 2019
@@ -1,4 +1,4 @@
-/*  $NetBSD: raidctl.c,v 1.68 2019/02/04 09:31:22 mrg Exp $   */
+/*  $NetBSD: raidctl.c,v 1.69 2019/02/06 22:38:10 oster Exp $   */
 
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -39,7 +39,7 @@
 #include 
 
 #ifndef lint
-__RCSID("$NetBSD: raidctl.c,v 1.68 2019/02/04 09:31:22 mrg Exp $");
+__RCSID("$NetBSD: raidctl.c,v 1.69 2019/02/06 22:38:10 oster Exp $");
 #endif
 
 
@@ -823,7 +823,7 @@ init_component_labels(int fd, int serial
 	component_label.status = 0;
 	
 	do_ioctl( fd, RAIDFRAME_INIT_LABELS, _label,
-		  "RAIDFRAME_SET_COMPONENT_LABEL");
+		  "RAIDFRAME_INIT_LABELS");
 }
 
 static void



CVS commit: src/sys/arch/cobalt/cobalt

2019-02-06 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Wed Feb  6 21:42:46 UTC 2019

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

Log Message:
compare pointers with NULL not nul.


To generate a diff of this commit:
cvs rdiff -u -r1.121 -r1.122 src/sys/arch/cobalt/cobalt/machdep.c

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

Modified files:

Index: src/sys/arch/cobalt/cobalt/machdep.c
diff -u src/sys/arch/cobalt/cobalt/machdep.c:1.121 src/sys/arch/cobalt/cobalt/machdep.c:1.122
--- src/sys/arch/cobalt/cobalt/machdep.c:1.121	Sat Jan 20 13:56:08 2018
+++ src/sys/arch/cobalt/cobalt/machdep.c	Wed Feb  6 21:42:46 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.121 2018/01/20 13:56:08 skrll Exp $	*/
+/*	$NetBSD: machdep.c,v 1.122 2019/02/06 21:42:46 mrg Exp $	*/
 
 /*-
  * Copyright (c) 2006 Izumi Tsutsui.  All rights reserved.
@@ -50,7 +50,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.121 2018/01/20 13:56:08 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.122 2019/02/06 21:42:46 mrg Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -399,7 +399,7 @@ decode_bootstring(void)
 
 	/* break apart bootstring on ' ' boundries and itterate */
 	work = strtok_light(bootstring, ' ');
-	while (work != '\0') {
+	while (work != NULL) {
 		/* if starts with '-', we got options, walk its decode */
 		if (work[0] == '-') {
 			i = 1;
@@ -410,7 +410,7 @@ decode_bootstring(void)
 		} else
 
 		/* if it has a '=' its an assignment, switch and set */
-		if ((equ = strchr(work, '=')) != '\0') {
+		if ((equ = strchr(work, '=')) != NULL) {
 			if (memcmp("nfsroot=", work, 8) == 0) {
 nfsroot_bstr = (equ + 1);
 			} else



CVS commit: src/usr.bin/menuc

2019-02-06 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Feb  6 20:08:15 UTC 2019

Modified Files:
src/usr.bin/menuc: mdb.c menu_sys.def

Log Message:
Provide an accessor for the menu description structure by manu identifier.
Usefull for dynamic menus where you want to change details on the
fly "from the outside" (i.e. while not in one of the callback functions).


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/usr.bin/menuc/mdb.c
cvs rdiff -u -r1.64 -r1.65 src/usr.bin/menuc/menu_sys.def

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

Modified files:

Index: src/usr.bin/menuc/mdb.c
diff -u src/usr.bin/menuc/mdb.c:1.49 src/usr.bin/menuc/mdb.c:1.50
--- src/usr.bin/menuc/mdb.c:1.49	Wed Jan  9 19:43:37 2019
+++ src/usr.bin/menuc/mdb.c	Wed Feb  6 20:08:15 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: mdb.c,v 1.49 2019/01/09 19:43:37 martin Exp $	*/
+/*	$NetBSD: mdb.c,v 1.50 2019/02/06 20:08:15 martin Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -41,7 +41,7 @@
 #include 
 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: mdb.c,v 1.49 2019/01/09 19:43:37 martin Exp $");
+__RCSID("$NetBSD: mdb.c,v 1.50 2019/02/06 20:08:15 martin Exp $");
 #endif
 
 
@@ -248,6 +248,7 @@ write_menu_file(char *initcode)
 			"const char *, const char *);\n"
 			"void free_menu(int);\n"
 			"void set_menu_numopts(int, int);\n"
+			"menudesc *get_menudesc(int);\n"
 			);
 
 	(void)fprintf(out_file, "\n/* Menu names */\n");

Index: src/usr.bin/menuc/menu_sys.def
diff -u src/usr.bin/menuc/menu_sys.def:1.64 src/usr.bin/menuc/menu_sys.def:1.65
--- src/usr.bin/menuc/menu_sys.def:1.64	Wed Jan  9 19:43:37 2019
+++ src/usr.bin/menuc/menu_sys.def	Wed Feb  6 20:08:15 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: menu_sys.def,v 1.64 2019/01/09 19:43:37 martin Exp $	*/
+/*	$NetBSD: menu_sys.def,v 1.65 2019/02/06 20:08:15 martin Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -809,6 +809,15 @@ set_menu_numopts(int menu, int numopts)
 	MENUS(menu).numopts = numopts;
 }
 
+menudesc *
+get_menudesc(int menu)
+{
+	if (menu < 0 || menu >= num_menus)
+		return NULL;
+
+	return (menu);
+}
+
 /* Control L is end of standard routines, remaining only for dynamic. */
 
 /* Beginning of routines for dynamic menus. */



CVS commit: src/external/cddl/osnet/sys/sys

2019-02-06 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Feb  6 17:56:57 UTC 2019

Modified Files:
src/external/cddl/osnet/sys/sys: cred.h

Log Message:
use sizeof() properly (gcc-7)


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/external/cddl/osnet/sys/sys/cred.h

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/sys/sys/cred.h
diff -u src/external/cddl/osnet/sys/sys/cred.h:1.5 src/external/cddl/osnet/sys/sys/cred.h:1.6
--- src/external/cddl/osnet/sys/sys/cred.h:1.5	Mon May 28 17:05:10 2018
+++ src/external/cddl/osnet/sys/sys/cred.h	Wed Feb  6 12:56:57 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: cred.h,v 1.5 2018/05/28 21:05:10 chs Exp $	*/
+/*	$NetBSD: cred.h,v 1.6 2019/02/06 17:56:57 christos Exp $	*/
 
 /*-
  * Copyright (c) 2007 Pawel Jakub Dawidek 
@@ -66,7 +66,7 @@ crgetgroups(cred_t *cr)
 {
 	static gid_t gids[NGROUPS_MAX];
 
-	memset(gids, 0, NGROUPS_MAX);
+	memset(gids, 0, sizeof(gids));
 	if (kauth_cred_getgroups(cr, gids, NGROUPS_MAX, UIO_SYSSPACE) != 0) 
 		return NULL;
 	



CVS commit: src/usr.sbin/sup/source

2019-02-06 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Feb  6 17:21:51 UTC 2019

Modified Files:
src/usr.sbin/sup/source: supextern.h

Log Message:
quit is dead


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/usr.sbin/sup/source/supextern.h

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/sup/source/supextern.h
diff -u src/usr.sbin/sup/source/supextern.h:1.26 src/usr.sbin/sup/source/supextern.h:1.27
--- src/usr.sbin/sup/source/supextern.h:1.26	Wed Feb  6 10:43:13 2019
+++ src/usr.sbin/sup/source/supextern.h	Wed Feb  6 12:21:51 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: supextern.h,v 1.26 2019/02/06 15:43:13 christos Exp $	*/
+/*	$NetBSD: supextern.h,v 1.27 2019/02/06 17:21:51 christos Exp $	*/
 
 struct stat;
 
@@ -43,7 +43,7 @@ void path(const char *, char *, char *);
 
 /* quit.c */
 void quit(int, const char *, ...)
-	__attribute__((__format__(__printf__, 2, 3)));
+	__attribute__((__format__(__printf__, 2, 3))) __dead;
 
 /* read_line.c */
 char *read_line(FILE *, size_t *, size_t *, const char[3], int);



CVS commit: src/external/gpl3/gcc/usr.bin

2019-02-06 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Feb  6 16:57:30 UTC 2019

Modified Files:
src/external/gpl3/gcc/usr.bin/cc1: Makefile
src/external/gpl3/gcc/usr.bin/cc1obj: Makefile
src/external/gpl3/gcc/usr.bin/gcov: Makefile

Log Message:
fix stack protector build


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/external/gpl3/gcc/usr.bin/cc1/Makefile
cvs rdiff -u -r1.11 -r1.12 src/external/gpl3/gcc/usr.bin/cc1obj/Makefile
cvs rdiff -u -r1.8 -r1.9 src/external/gpl3/gcc/usr.bin/gcov/Makefile

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

Modified files:

Index: src/external/gpl3/gcc/usr.bin/cc1/Makefile
diff -u src/external/gpl3/gcc/usr.bin/cc1/Makefile:1.13 src/external/gpl3/gcc/usr.bin/cc1/Makefile:1.14
--- src/external/gpl3/gcc/usr.bin/cc1/Makefile:1.13	Fri Feb  1 05:34:18 2019
+++ src/external/gpl3/gcc/usr.bin/cc1/Makefile	Wed Feb  6 11:57:30 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.13 2019/02/01 10:34:18 mrg Exp $
+#	$NetBSD: Makefile,v 1.14 2019/02/06 16:57:30 christos Exp $
 
 PROG=		cc1
 SRCS=		${G_C_OBJS:S,c-family/,,:S,c/,,:Nlibcpp.a:.o=.c} main.c ${PROG}-checksum.c
@@ -29,6 +29,7 @@ CHECKSUM_OBJS=	${BACKENDOBJ}/libbackend.
 # LDFLAGS+=	-rdynamic
 
 COPTS.c-ada-spec.c=	-Wno-stack-protector
+COPTS.c-attribs.c=	-Wno-stack-protector
 COPTS.c-aux-info.c=	-Wno-stack-protector
 COPTS.c-common.c=	-Wno-stack-protector
 COPTS.c-cppbuiltin.c=	-Wno-stack-protector

Index: src/external/gpl3/gcc/usr.bin/cc1obj/Makefile
diff -u src/external/gpl3/gcc/usr.bin/cc1obj/Makefile:1.11 src/external/gpl3/gcc/usr.bin/cc1obj/Makefile:1.12
--- src/external/gpl3/gcc/usr.bin/cc1obj/Makefile:1.11	Fri Feb  1 05:34:18 2019
+++ src/external/gpl3/gcc/usr.bin/cc1obj/Makefile	Wed Feb  6 11:57:30 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.11 2019/02/01 10:34:18 mrg Exp $
+#	$NetBSD: Makefile,v 1.12 2019/02/06 16:57:30 christos Exp $
 
 MYOBJS=		${G_OBJC_OBJS} ${G_C_AND_OBJC_OBJS} 
 PROG=		cc1obj
@@ -32,6 +32,7 @@ CHECKSUM_OBJS=	${BACKENDOBJ}/libbackend.
 # LDFLAGS+=	-rdynamic
 
 COPTS.c-ada-spec.c+=			-Wno-stack-protector
+COPTS.c-attribs.c+=			-Wno-stack-protector
 COPTS.c-aux-info.c+=			-Wno-stack-protector
 COPTS.c-common.c+=			-Wno-stack-protector
 COPTS.c-cppbuiltin.c+=			-Wno-stack-protector

Index: src/external/gpl3/gcc/usr.bin/gcov/Makefile
diff -u src/external/gpl3/gcc/usr.bin/gcov/Makefile:1.8 src/external/gpl3/gcc/usr.bin/gcov/Makefile:1.9
--- src/external/gpl3/gcc/usr.bin/gcov/Makefile:1.8	Fri Feb  1 05:34:18 2019
+++ src/external/gpl3/gcc/usr.bin/gcov/Makefile	Wed Feb  6 11:57:30 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.8 2019/02/01 10:34:18 mrg Exp $
+#	$NetBSD: Makefile,v 1.9 2019/02/06 16:57:30 christos Exp $
 
 .include 
 
@@ -19,6 +19,8 @@ MAN=		gcov.1
 .include "../Makefile.libiberty"
 .include "../Makefile.libdecnumber"
 
+COPTS.gcov.c += -Wno-stack-protector
+
 LDADD+=		-lintl
 DPADD+=		${LIBINTL}
 



CVS commit: xsrc/external/mit/ctwm/dist

2019-02-06 Thread Roy Marples
Module Name:xsrc
Committed By:   roy
Date:   Wed Feb  6 16:38:23 UTC 2019

Modified Files:
xsrc/external/mit/ctwm/dist: menus.c

Log Message:
modStr needs to be 6 characters to avoid overflow.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 xsrc/external/mit/ctwm/dist/menus.c

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

Modified files:

Index: xsrc/external/mit/ctwm/dist/menus.c
diff -u xsrc/external/mit/ctwm/dist/menus.c:1.8 xsrc/external/mit/ctwm/dist/menus.c:1.9
--- xsrc/external/mit/ctwm/dist/menus.c:1.8	Sat Sep  5 14:27:43 2015
+++ xsrc/external/mit/ctwm/dist/menus.c	Wed Feb  6 16:38:23 2019
@@ -1532,7 +1532,7 @@ Bool PopUpMenu (MenuRoot *menu, int x, i
 if (menu == Scr->Keys) {
 	FuncKey *tmpKey;
 	char *tmpStr, *tmpStr2;
-	char modStr[5];
+	char modStr[6];
 	char *oldact = 0;
 	int oldmod = 0;
 	int tmpLen;



CVS commit: src/usr.sbin/sup/source

2019-02-06 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Feb  6 15:43:13 UTC 2019

Modified Files:
src/usr.sbin/sup/source: supextern.h

Log Message:
done returns if !dontjump


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/usr.sbin/sup/source/supextern.h

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/sup/source/supextern.h
diff -u src/usr.sbin/sup/source/supextern.h:1.25 src/usr.sbin/sup/source/supextern.h:1.26
--- src/usr.sbin/sup/source/supextern.h:1.25	Sun Feb  3 07:13:37 2019
+++ src/usr.sbin/sup/source/supextern.h	Wed Feb  6 10:43:13 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: supextern.h,v 1.25 2019/02/03 12:13:37 mrg Exp $	*/
+/*	$NetBSD: supextern.h,v 1.26 2019/02/06 15:43:13 christos Exp $	*/
 
 struct stat;
 
@@ -43,7 +43,7 @@ void path(const char *, char *, char *);
 
 /* quit.c */
 void quit(int, const char *, ...)
-	__attribute__((__format__(__printf__, 2, 3))) __dead;
+	__attribute__((__format__(__printf__, 2, 3)));
 
 /* read_line.c */
 char *read_line(FILE *, size_t *, size_t *, const char[3], int);



CVS commit: src/tests/lib/libnvmm

2019-02-06 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Wed Feb  6 15:42:31 UTC 2019

Modified Files:
src/tests/lib/libnvmm: h_mem_assist_asm.S

Log Message:
movzx is not AT syntax, but some bastard version of Intel syntax.
Switch to the equivalent mnenomic.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/lib/libnvmm/h_mem_assist_asm.S

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

Modified files:

Index: src/tests/lib/libnvmm/h_mem_assist_asm.S
diff -u src/tests/lib/libnvmm/h_mem_assist_asm.S:1.3 src/tests/lib/libnvmm/h_mem_assist_asm.S:1.4
--- src/tests/lib/libnvmm/h_mem_assist_asm.S:1.3	Fri Feb  1 06:49:58 2019
+++ src/tests/lib/libnvmm/h_mem_assist_asm.S	Wed Feb  6 15:42:31 2019
@@ -185,7 +185,7 @@ test10_begin:
 	movq	$0x12345678,(%rax)
 
 	movq	$0x,%rbx
-	movzxb	(%rax),%ebx
+	movzbl	(%rax),%ebx
 	movq	%rbx,(%rax)
 
 	TEST_END
@@ -197,7 +197,7 @@ test11_begin:
 	movq	$0x12345678,(%rax)
 
 	movq	$0x,%rbx
-	movzxw	(%rax),%rbx
+	movzwq	(%rax),%rbx
 	movq	%rbx,(%rax)
 
 	TEST_END



CVS commit: src/sys/dev/raidframe

2019-02-06 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Feb  6 15:39:41 UTC 2019

Modified Files:
src/sys/dev/raidframe: rf_compat32.c

Log Message:
fix half edited line.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/raidframe/rf_compat32.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/raidframe/rf_compat32.c
diff -u src/sys/dev/raidframe/rf_compat32.c:1.3 src/sys/dev/raidframe/rf_compat32.c:1.4
--- src/sys/dev/raidframe/rf_compat32.c:1.3	Tue Feb  5 18:28:02 2019
+++ src/sys/dev/raidframe/rf_compat32.c	Wed Feb  6 10:39:41 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: rf_compat32.c,v 1.3 2019/02/05 23:28:02 christos Exp $	*/
+/*	$NetBSD: rf_compat32.c,v 1.4 2019/02/06 15:39:41 christos Exp $	*/
 
 /*
  * Copyright (c) 2017 Matthew R. Green
@@ -152,7 +152,7 @@ raidframe_netbsd32_ioctl(struct raid_sof
  
 	switch (cmd) {
 	case RAIDFRAME_GET_INFO32:
-		if (!rf_inited(rs) == 0)
+		if (!rf_inited(rs))
 			return ENXIO;
 		return rf_get_info_netbsd32(raidPtr, data);
 	case RAIDFRAME_CONFIGURE32:



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

2019-02-06 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Feb  6 14:12:25 UTC 2019

Modified Files:
src/sys/arch/arm/arm: armv6_start.S

Log Message:
Don't VPRINTF until we have stack for our CPU setup properly


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/arm/arm/armv6_start.S

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

Modified files:

Index: src/sys/arch/arm/arm/armv6_start.S
diff -u src/sys/arch/arm/arm/armv6_start.S:1.5 src/sys/arch/arm/arm/armv6_start.S:1.6
--- src/sys/arch/arm/arm/armv6_start.S:1.5	Thu Jan  3 10:26:41 2019
+++ src/sys/arch/arm/arm/armv6_start.S	Wed Feb  6 14:12:25 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: armv6_start.S,v 1.5 2019/01/03 10:26:41 skrll Exp $	*/
+/*	$NetBSD: armv6_start.S,v 1.6 2019/02/06 14:12:25 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2012, 2017, 2018 The NetBSD Foundation, Inc.
@@ -757,18 +757,6 @@ ENTRY_NP(cpu_mpstart)
 	ldr	R_VTOPDIFF, =cpu_mpstart
 	sub	R_VTOPDIFF, R_VTOPDIFF, R_TMP2
 
-	ldr	R_TMP2, =start_stacks_top
-	sub	sp, R_TMP2, R_VTOPDIFF
-
-#ifdef VERBOSE_INIT_ARM
-	VPRINTF("\n\rmidr :")
-	mrc	p15, 0, r0, c0, c0, 0		// MIDR
-	VPRINTX(r0)
-	VPRINTF("\n\rmpidr:")
-	mrc	p15, 0, r0, c0, c0, 5		// MPIDR
-	VPRINTX(r0)
-#endif
-
 	mrc	p15, 0, r4, c0, c0, 5		// MPIDR get
 	and	r4, #(MPIDR_AFF2|MPIDR_AFF1|MPIDR_AFF0)
 
@@ -789,15 +777,27 @@ ENTRY_NP(cpu_mpstart)
 2:
 	mov	R_TMP2, r0			// save cpu_index for later
 
-	VPRINTF("index: ")
-	VPRINTX(R_TMP2)
-	XPUTC('\n')
-	XPUTC('\r')
+	ldr	R_TMP1, =start_stacks_top
+	sub	sp, R_TMP1, R_VTOPDIFF
 
 	mov	r5, R_TMP2
 	lsl	r5, #INIT_ARM_STACK_SHIFT
 	sub	sp, sp, r5
 
+#ifdef VERBOSE_INIT_ARM
+	VPRINTF("\n\rmidr  : ")
+	mrc	p15, 0, r0, c0, c0, 0		// MIDR
+	VPRINTX(r0)
+	VPRINTF("\n\rrevidr: ")
+	mrc	p15, 0, r0, c0, c0, 6		// REVIDR
+	VPRINTX(r0)
+	VPRINTF("\n\rmpidr : ")
+	mrc	p15, 0, r0, c0, c0, 5		// MPIDR
+	VPRINTX(r0)
+#endif
+	VPRINTF("\n\rindex : ")
+	VPRINTX(R_TMP2)
+	VPRINTF("\n\rsp: ")
 	VPRINTX(sp)
 	XPUTC('\n')
 	XPUTC('\r')



CVS commit: src/usr.bin/tip

2019-02-06 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Wed Feb  6 14:08:50 UTC 2019

Modified Files:
src/usr.bin/tip: tip.c

Log Message:
Make cu(1) and tip(1) recognize newline (^J) as end-of-line.
Now, tilde (~) after newline works as escape character as in ssh(1).
No objections when proposed on tech-userland.


To generate a diff of this commit:
cvs rdiff -u -r1.59 -r1.60 src/usr.bin/tip/tip.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.bin/tip/tip.c
diff -u src/usr.bin/tip/tip.c:1.59 src/usr.bin/tip/tip.c:1.60
--- src/usr.bin/tip/tip.c:1.59	Mon Sep  5 00:40:30 2016
+++ src/usr.bin/tip/tip.c	Wed Feb  6 14:08:50 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: tip.c,v 1.59 2016/09/05 00:40:30 sevan Exp $	*/
+/*	$NetBSD: tip.c,v 1.60 2019/02/06 14:08:50 rin Exp $	*/
 
 /*
  * Copyright (c) 1983, 1993
@@ -42,7 +42,7 @@ __COPYRIGHT("@(#) Copyright (c) 1983, 19
 #if 0
 static char sccsid[] = "@(#)tip.c	8.1 (Berkeley) 6/6/93";
 #endif
-__RCSID("$NetBSD: tip.c,v 1.59 2016/09/05 00:40:30 sevan Exp $");
+__RCSID("$NetBSD: tip.c,v 1.60 2019/02/06 14:08:50 rin Exp $");
 #endif /* not lint */
 
 /*
@@ -358,11 +358,11 @@ tipin(void)
 		gch && gch == character(value(RAISECHAR))) {
 			setboolean(value(RAISE), !boolean(value(RAISE)));
 			continue;
-		} else if (gch == '\r') {
+		} else if (gch == '\r' || gch == '\n') {
 			bol = 1;
 			xpwrite(FD, , 1);
 			if (boolean(value(HALFDUPLEX)))
-(void)printf("\r\n");
+(void)printf("%s\n", gch == '\r' ? "\r" : "");
 			continue;
 		} else if (!cumode && gch && gch == character(value(FORCE)))
 			gch = getchar()_PAR;



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

2019-02-06 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Feb  6 13:28:08 UTC 2019

Modified Files:
src/sys/arch/arm/arm32: arm32_kvminit.c

Log Message:
Make sure the start stacks are covered by the new translation tables.
They *might* get placed after ARM_BOOTSTRAP_LxPT by the linker.

AP startup uses VA sp in cpu_init_secondary_processor


To generate a diff of this commit:
cvs rdiff -u -r1.51 -r1.52 src/sys/arch/arm/arm32/arm32_kvminit.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/arm32/arm32_kvminit.c
diff -u src/sys/arch/arm/arm32/arm32_kvminit.c:1.51 src/sys/arch/arm/arm32/arm32_kvminit.c:1.52
--- src/sys/arch/arm/arm32/arm32_kvminit.c:1.51	Wed Feb  6 13:22:54 2019
+++ src/sys/arch/arm/arm32/arm32_kvminit.c	Wed Feb  6 13:28:08 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: arm32_kvminit.c,v 1.51 2019/02/06 13:22:54 skrll Exp $	*/
+/*	$NetBSD: arm32_kvminit.c,v 1.52 2019/02/06 13:28:08 skrll Exp $	*/
 
 /*
  * Copyright (c) 2002, 2003, 2005  Genetec Corporation.  All rights reserved.
@@ -127,7 +127,7 @@
 #include "opt_multiprocessor.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: arm32_kvminit.c,v 1.51 2019/02/06 13:22:54 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: arm32_kvminit.c,v 1.52 2019/02/06 13:28:08 skrll Exp $");
 
 #include 
 #include 
@@ -190,12 +190,12 @@ arm32_bootmem_init(paddr_t memstart, psi
 	 */
 #if defined(__HAVE_GENERIC_START)
 	extern char KERNEL_BASE_virt[];
-	extern char ARM_BOOTSTRAP_LxPT[];
+	extern char const __stop__init_memory[];
 
 	VPRINTF("%s: kern_vtopdiff=%#lx\n", __func__, kern_vtopdiff);
 
 	vaddr_t kstartva = trunc_page((vaddr_t)KERNEL_BASE_virt);
-	vaddr_t kendva = round_page((vaddr_t)ARM_BOOTSTRAP_LxPT + L1_TABLE_SIZE);
+	vaddr_t kendva = round_page((vaddr_t)__stop__init_memory);
 
 	kernelstart = KERN_VTOPHYS(kstartva);
 



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

2019-02-06 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Feb  6 13:22:54 UTC 2019

Modified Files:
src/sys/arch/arm/arm32: arm32_kvminit.c

Log Message:
Misc style


To generate a diff of this commit:
cvs rdiff -u -r1.50 -r1.51 src/sys/arch/arm/arm32/arm32_kvminit.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/arm32/arm32_kvminit.c
diff -u src/sys/arch/arm/arm32/arm32_kvminit.c:1.50 src/sys/arch/arm/arm32/arm32_kvminit.c:1.51
--- src/sys/arch/arm/arm32/arm32_kvminit.c:1.50	Wed Feb  6 13:20:29 2019
+++ src/sys/arch/arm/arm32/arm32_kvminit.c	Wed Feb  6 13:22:54 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: arm32_kvminit.c,v 1.50 2019/02/06 13:20:29 skrll Exp $	*/
+/*	$NetBSD: arm32_kvminit.c,v 1.51 2019/02/06 13:22:54 skrll Exp $	*/
 
 /*
  * Copyright (c) 2002, 2003, 2005  Genetec Corporation.  All rights reserved.
@@ -127,7 +127,7 @@
 #include "opt_multiprocessor.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: arm32_kvminit.c,v 1.50 2019/02/06 13:20:29 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: arm32_kvminit.c,v 1.51 2019/02/06 13:22:54 skrll Exp $");
 
 #include 
 #include 
@@ -212,8 +212,8 @@ arm32_bootmem_init(paddr_t memstart, psi
 #endif
 	paddr_t kernelend = KERN_VTOPHYS(kendva);
 
-	VPRINTF("%s: memstart=%#lx, memsize=%#lx\n",
-	__func__, memstart, memsize);
+	VPRINTF("%s: memstart=%#lx, memsize=%#lx\n", __func__,
+	memstart, memsize);
 	VPRINTF("%s: kernelstart=%#lx, kernelend=%#lx\n", __func__,
 	kernelstart, kernelend);
 
@@ -720,7 +720,7 @@ arm32_kernel_vm_init(vaddr_t kernel_vm_b
 	data.pv_pa = text.pv_pa + textsize;
 	data.pv_va = text.pv_va + textsize;
 	data.pv_size = totalsize - textsize;
-	data.pv_prot = VM_PROT_READ|VM_PROT_WRITE;
+	data.pv_prot = VM_PROT_READ | VM_PROT_WRITE;
 	data.pv_cache = PTE_CACHE;
 
 	VPRINTF("%s: adding chunk for kernel data/bss %#lx..%#lx (VA %#lx)\n",



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

2019-02-06 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Feb  6 13:20:29 UTC 2019

Modified Files:
src/sys/arch/arm/arm32: arm32_kvminit.c

Log Message:
Slight update to comment and KNF it while I'm here


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/sys/arch/arm/arm32/arm32_kvminit.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/arm32/arm32_kvminit.c
diff -u src/sys/arch/arm/arm32/arm32_kvminit.c:1.49 src/sys/arch/arm/arm32/arm32_kvminit.c:1.50
--- src/sys/arch/arm/arm32/arm32_kvminit.c:1.49	Mon Feb  4 13:08:43 2019
+++ src/sys/arch/arm/arm32/arm32_kvminit.c	Wed Feb  6 13:20:29 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: arm32_kvminit.c,v 1.49 2019/02/04 13:08:43 skrll Exp $	*/
+/*	$NetBSD: arm32_kvminit.c,v 1.50 2019/02/06 13:20:29 skrll Exp $	*/
 
 /*
  * Copyright (c) 2002, 2003, 2005  Genetec Corporation.  All rights reserved.
@@ -127,7 +127,7 @@
 #include "opt_multiprocessor.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: arm32_kvminit.c,v 1.49 2019/02/04 13:08:43 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: arm32_kvminit.c,v 1.50 2019/02/06 13:20:29 skrll Exp $");
 
 #include 
 #include 
@@ -831,9 +831,11 @@ arm32_kernel_vm_init(vaddr_t kernel_vm_b
 		}
 	}
 
-	// The amount we can direct is limited by the start of the
-	// virtual part of the kernel address space.  Don't overrun
-	// into it.
+	/*
+	 * The amount we can direct map is limited by the start of the
+	 * virtual part of the kernel address space.  Don't overrun
+	 * into it.
+	 */
 	if (mapallmem_p && cur_pv.pv_va + cur_pv.pv_size > kernel_vm_base) {
 		cur_pv.pv_size = kernel_vm_base - cur_pv.pv_va;
 	}



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

2019-02-06 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Feb  6 13:15:59 UTC 2019

Modified Files:
src/sys/arch/arm/sunxi: sunxi_mc_mpstart.S

Log Message:
Trailing whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/sunxi/sunxi_mc_mpstart.S

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

Modified files:

Index: src/sys/arch/arm/sunxi/sunxi_mc_mpstart.S
diff -u src/sys/arch/arm/sunxi/sunxi_mc_mpstart.S:1.1 src/sys/arch/arm/sunxi/sunxi_mc_mpstart.S:1.2
--- src/sys/arch/arm/sunxi/sunxi_mc_mpstart.S:1.1	Thu Jan  3 11:01:59 2019
+++ src/sys/arch/arm/sunxi/sunxi_mc_mpstart.S	Wed Feb  6 13:15:59 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: sunxi_mc_mpstart.S,v 1.1 2019/01/03 11:01:59 jmcneill Exp $ */
+/* $NetBSD: sunxi_mc_mpstart.S,v 1.2 2019/02/06 13:15:59 skrll Exp $ */
 
 /*-
  * Copyright (c) 2018 Jared McNeill 
@@ -42,7 +42,7 @@
 	.global _C_LABEL(sunxi_mc_mpstart)
 _C_LABEL(sunxi_mc_mpstart):
 
-	adr R_TMP1, sunxi_mc_mpstart 
+	adr R_TMP1, sunxi_mc_mpstart
 	ldr R_VTOPDIFF, =sunxi_mc_mpstart
 	sub R_VTOPDIFF, R_VTOPDIFF, R_TMP1
 



CVS commit: src/sys/arch/xen/xen

2019-02-06 Thread Cherry G. Mathew
Module Name:src
Committed By:   cherry
Date:   Wed Feb  6 12:24:46 UTC 2019

Modified Files:
src/sys/arch/xen/xen: xengnt.c

Log Message:
Add the codepath for grant table updates for VMs with an auto
translated physmap.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/xen/xen/xengnt.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/xen/xen/xengnt.c
diff -u src/sys/arch/xen/xen/xengnt.c:1.25 src/sys/arch/xen/xen/xengnt.c:1.26
--- src/sys/arch/xen/xen/xengnt.c:1.25	Wed Oct 24 13:07:46 2012
+++ src/sys/arch/xen/xen/xengnt.c	Wed Feb  6 12:24:46 2019
@@ -1,4 +1,4 @@
-/*  $NetBSD: xengnt.c,v 1.25 2012/10/24 13:07:46 royger Exp $  */
+/*  $NetBSD: xengnt.c,v 1.26 2019/02/06 12:24:46 cherry Exp $  */
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: xengnt.c,v 1.25 2012/10/24 13:07:46 royger Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xengnt.c,v 1.26 2019/02/06 12:24:46 cherry Exp $");
 
 #include 
 #include 
@@ -174,22 +174,44 @@ xengnt_more_entries(void)
 	if (pages == NULL)
 		return ENOMEM;
 
-	setup.dom = DOMID_SELF;
-	setup.nr_frames = nframes_new;
-	set_xen_guest_handle(setup.frame_list, pages);
-
-	/*
-	 * setup the grant table, made of nframes_new frames
-	 * and return the list of their virtual addresses
-	 * in 'pages'
-	 */
-	if (HYPERVISOR_grant_table_op(GNTTABOP_setup_table, , 1) != 0)
-		panic("%s: setup table failed", __func__);
-	if (setup.status != GNTST_okay) {
-		aprint_error("%s: setup table returned %d\n",
-		__func__, setup.status);
-		free(pages, M_DEVBUF);
-		return ENOMEM;
+	if (xen_feature(XENFEAT_auto_translated_physmap)) {
+		/*
+		 * Note: Although we allocate space for the entire
+		 * table, in this mode we only update one entry at a
+		 * time.
+		 */
+		struct vm_page *pg;
+		struct xen_add_to_physmap xmap;
+
+		pg = uvm_pagealloc(NULL, 0, NULL, UVM_PGA_USERESERVE|UVM_PGA_ZERO);
+		pages[gnt_nr_grant_frames] = atop(uvm_vm_page_to_phys(pg));
+
+		xmap.domid = DOMID_SELF;
+		xmap.space = XENMAPSPACE_grant_table;
+		xmap.idx = gnt_nr_grant_frames;
+		xmap.gpfn = pages[gnt_nr_grant_frames];
+
+		if (HYPERVISOR_memory_op(XENMEM_add_to_physmap, ) < 0)
+			panic("%s: Unable to register HYPERVISOR_shared_info\n", __func__);
+
+	} else {
+		setup.dom = DOMID_SELF;
+		setup.nr_frames = nframes_new;
+		set_xen_guest_handle(setup.frame_list, pages);
+
+		/*
+		 * setup the grant table, made of nframes_new frames
+		 * and return the list of their virtual addresses
+		 * in 'pages'
+		 */
+		if (HYPERVISOR_grant_table_op(GNTTABOP_setup_table, , 1) != 0)
+			panic("%s: setup table failed", __func__);
+		if (setup.status != GNTST_okay) {
+			aprint_error("%s: setup table returned %d\n",
+			__func__, setup.status);
+			free(pages, M_DEVBUF);
+			return ENOMEM;
+		}
 	}
 
 	DPRINTF(("xengnt_more_entries: map 0x%lx -> %p\n",



CVS commit: src/share/man/man4

2019-02-06 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Wed Feb  6 12:10:00 UTC 2019

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

Log Message:
Add StarTech USB21000S2 to list of supported adapters.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/share/man/man4/mue.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/mue.4
diff -u src/share/man/man4/mue.4:1.2 src/share/man/man4/mue.4:1.3
--- src/share/man/man4/mue.4:1.2	Sun Aug 26 06:47:27 2018
+++ src/share/man/man4/mue.4	Wed Feb  6 12:10:00 2019
@@ -1,4 +1,4 @@
-.\" $NetBSD: mue.4,v 1.2 2018/08/26 06:47:27 wiz Exp $
+.\" $NetBSD: mue.4,v 1.3 2019/02/06 12:10:00 rin Exp $
 .\" $OpenBSD: mue.4,v 1.2 2018/08/03 06:13:14 jmc Exp $
 .\"
 .\" Copyright (c) 2018 Kevin Lo 
@@ -15,7 +15,7 @@
 .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 .\"
-.Dd August 25, 2018
+.Dd February 6, 2019
 .Dt MUE 4
 .Os
 .Sh NAME
@@ -34,6 +34,7 @@ including the following:
 .Bl -tag -width Ds -offset indent -compact
 .It Raspberry Pi 3 Model B+
 .It Microchip EVB-LAN7800LC
+.It StarTech USB21000S2
 .It Z-TEK ZE582
 .El
 .Pp



CVS commit: src/sys

2019-02-06 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Wed Feb  6 11:58:32 UTC 2019

Modified Files:
src/sys/arch/algor/conf: P4032 P5064 P6032
src/sys/arch/alpha/conf: GENERIC
src/sys/arch/amd64/conf: ALL XEN3_DOM0
src/sys/arch/cats/conf: GENERIC INSTALL
src/sys/arch/evbarm/conf: BEAGLEBOARD BEAGLEBONE EXYNOS HDL_G HPT5325
HUMMINGBOARD IMX23_OLINUXINO KOBO MINI2440 MMNET_GENERIC
MPCSA_GENERIC MV2120 NETWALKER NSLU2 OPENBLOCKS_A6 PARALLELLA
SHEEVAPLUG SMDK2410 TEGRA TS7200 ZEDBOARD
src/sys/arch/evbmips/conf: LINKITSMART7688
src/sys/arch/evbppc/conf: OPENBLOCKS266_OPT PMPPC
src/sys/arch/hpcarm/conf: WZERO3
src/sys/arch/hpcmips/conf: GENERIC TX3922 VR41XX
src/sys/arch/hppa/conf: GENERIC
src/sys/arch/i386/conf: ALL GENERIC_TINY INSTALL_FLOPPY XEN3PAE_DOM0
src/sys/arch/landisk/conf: GENERIC
src/sys/arch/macppc/conf: GENERIC
src/sys/arch/ofppc/conf: GENERIC
src/sys/arch/playstation2/conf: DEBUG
src/sys/arch/pmax/conf: GENERIC64_USB GENERIC_USB
src/sys/arch/prep/conf: GENERIC
src/sys/arch/sgimips/conf: GENERIC32_IP3x
src/sys/arch/sparc64/conf: GENERIC
src/sys/arch/vax/conf: GENERIC_USB
src/sys/arch/x68k/conf: GENERIC
src/sys/arch/zaurus/conf: GENERIC INSTALL_C700
src/sys/dev/usb: usbdevices.config

Log Message:
Add ure(4) to kernel config files. Also add PHY drivers where necessary.


To generate a diff of this commit:
cvs rdiff -u -r1.77 -r1.78 src/sys/arch/algor/conf/P4032
cvs rdiff -u -r1.88 -r1.89 src/sys/arch/algor/conf/P5064
cvs rdiff -u -r1.79 -r1.80 src/sys/arch/algor/conf/P6032
cvs rdiff -u -r1.388 -r1.389 src/sys/arch/alpha/conf/GENERIC
cvs rdiff -u -r1.114 -r1.115 src/sys/arch/amd64/conf/ALL
cvs rdiff -u -r1.164 -r1.165 src/sys/arch/amd64/conf/XEN3_DOM0
cvs rdiff -u -r1.170 -r1.171 src/sys/arch/cats/conf/GENERIC
cvs rdiff -u -r1.107 -r1.108 src/sys/arch/cats/conf/INSTALL
cvs rdiff -u -r1.64 -r1.65 src/sys/arch/evbarm/conf/BEAGLEBOARD
cvs rdiff -u -r1.46 -r1.47 src/sys/arch/evbarm/conf/BEAGLEBONE \
src/sys/arch/evbarm/conf/NSLU2
cvs rdiff -u -r1.35 -r1.36 src/sys/arch/evbarm/conf/EXYNOS
cvs rdiff -u -r1.55 -r1.56 src/sys/arch/evbarm/conf/HDL_G
cvs rdiff -u -r1.40 -r1.41 src/sys/arch/evbarm/conf/HPT5325
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/evbarm/conf/HUMMINGBOARD
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/evbarm/conf/IMX23_OLINUXINO
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/evbarm/conf/KOBO
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/evbarm/conf/MINI2440
cvs rdiff -u -r1.44 -r1.45 src/sys/arch/evbarm/conf/MMNET_GENERIC
cvs rdiff -u -r1.65 -r1.66 src/sys/arch/evbarm/conf/MPCSA_GENERIC
cvs rdiff -u -r1.38 -r1.39 src/sys/arch/evbarm/conf/MV2120 \
src/sys/arch/evbarm/conf/TEGRA
cvs rdiff -u -r1.36 -r1.37 src/sys/arch/evbarm/conf/NETWALKER
cvs rdiff -u -r1.34 -r1.35 src/sys/arch/evbarm/conf/OPENBLOCKS_A6
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/evbarm/conf/PARALLELLA
cvs rdiff -u -r1.62 -r1.63 src/sys/arch/evbarm/conf/SHEEVAPLUG
cvs rdiff -u -r1.69 -r1.70 src/sys/arch/evbarm/conf/SMDK2410
cvs rdiff -u -r1.72 -r1.73 src/sys/arch/evbarm/conf/TS7200
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/evbarm/conf/ZEDBOARD
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/evbmips/conf/LINKITSMART7688
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/evbppc/conf/OPENBLOCKS266_OPT
cvs rdiff -u -r1.47 -r1.48 src/sys/arch/evbppc/conf/PMPPC
cvs rdiff -u -r1.47 -r1.48 src/sys/arch/hpcarm/conf/WZERO3
cvs rdiff -u -r1.237 -r1.238 src/sys/arch/hpcmips/conf/GENERIC
cvs rdiff -u -r1.108 -r1.109 src/sys/arch/hpcmips/conf/TX3922
cvs rdiff -u -r1.71 -r1.72 src/sys/arch/hpcmips/conf/VR41XX
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/hppa/conf/GENERIC
cvs rdiff -u -r1.462 -r1.463 src/sys/arch/i386/conf/ALL
cvs rdiff -u -r1.162 -r1.163 src/sys/arch/i386/conf/GENERIC_TINY
cvs rdiff -u -r1.48 -r1.49 src/sys/arch/i386/conf/INSTALL_FLOPPY
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/i386/conf/XEN3PAE_DOM0
cvs rdiff -u -r1.61 -r1.62 src/sys/arch/landisk/conf/GENERIC
cvs rdiff -u -r1.350 -r1.351 src/sys/arch/macppc/conf/GENERIC
cvs rdiff -u -r1.168 -r1.169 src/sys/arch/ofppc/conf/GENERIC
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/playstation2/conf/DEBUG
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/pmax/conf/GENERIC64_USB \
src/sys/arch/pmax/conf/GENERIC_USB
cvs rdiff -u -r1.187 -r1.188 src/sys/arch/prep/conf/GENERIC
cvs rdiff -u -r1.121 -r1.122 src/sys/arch/sgimips/conf/GENERIC32_IP3x
cvs rdiff -u -r1.213 -r1.214 src/sys/arch/sparc64/conf/GENERIC
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/vax/conf/GENERIC_USB
cvs rdiff -u -r1.192 -r1.193 src/sys/arch/x68k/conf/GENERIC
cvs rdiff -u -r1.79 -r1.80 src/sys/arch/zaurus/conf/GENERIC
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/zaurus/conf/INSTALL_C700
cvs rdiff -u -r1.34 -r1.35 src/sys/dev/usb/usbdevices.config

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

Modified files:

CVS commit: src/share/man/man4

2019-02-06 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Wed Feb  6 11:57:17 UTC 2019

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

Log Message:
Fix date. Break line after Ox/Nx.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/share/man/man4/ure.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/ure.4
diff -u src/share/man/man4/ure.4:1.1 src/share/man/man4/ure.4:1.2
--- src/share/man/man4/ure.4:1.1	Wed Feb  6 11:55:05 2019
+++ src/share/man/man4/ure.4	Wed Feb  6 11:57:17 2019
@@ -1,4 +1,4 @@
-.\" $NetBSD: ure.4,v 1.1 2019/02/06 11:55:05 rin Exp $
+.\" $NetBSD: ure.4,v 1.2 2019/02/06 11:57:17 wiz Exp $
 .\" $OpenBSD: ure.4,v 1.5 2017/04/16 20:26:34 jmc Exp $
 .\"
 .\" Copyright (c) 2015 Kevin Lo 
@@ -27,7 +27,7 @@
 .\"
 .\" $FreeBSD: head/share/man/man4/ure.4 291557 2015-12-01 05:12:13Z kevlo $
 .\"
-.Dd $Mdocdate: April 16 2017 $
+.Dd February 6, 2019
 .Dt URE 4
 .Os
 .Sh NAME
@@ -74,6 +74,8 @@ The
 driver was written by
 .An Kevin Lo Aq Mt ke...@freebsd.org
 for
-.Ox and ported to
-.Nx by
+.Ox
+and ported to
+.Nx
+by
 .An Rin Okuyama Aq Mt r...@netbsd.org .



CVS commit: src

2019-02-06 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Wed Feb  6 11:55:06 UTC 2019

Modified Files:
src/distrib/sets/lists/man: mi
src/distrib/sets/lists/modules: mi
src/doc: CHANGES
src/share/man/man4: Makefile
src/sys/dev/usb: files.usb
src/sys/modules: Makefile
Added Files:
src/share/man/man4: ure.4
src/sys/dev/usb: if_ure.c if_urereg.h if_urevar.h
src/sys/modules/if_ure: Makefile if_ure.ioconf

Log Message:
Add ure(4): RealTek RTL8152/RTL8153 10/100/Gigabit USB Ethernet device.
Ported from OpenBSD. Support for RX/TX checksum offload added by myself.


To generate a diff of this commit:
cvs rdiff -u -r1.1636 -r1.1637 src/distrib/sets/lists/man/mi
cvs rdiff -u -r1.118 -r1.119 src/distrib/sets/lists/modules/mi
cvs rdiff -u -r1.2497 -r1.2498 src/doc/CHANGES
cvs rdiff -u -r1.676 -r1.677 src/share/man/man4/Makefile
cvs rdiff -u -r0 -r1.1 src/share/man/man4/ure.4
cvs rdiff -u -r1.153 -r1.154 src/sys/dev/usb/files.usb
cvs rdiff -u -r0 -r1.1 src/sys/dev/usb/if_ure.c src/sys/dev/usb/if_urereg.h \
src/sys/dev/usb/if_urevar.h
cvs rdiff -u -r1.218 -r1.219 src/sys/modules/Makefile
cvs rdiff -u -r0 -r1.1 src/sys/modules/if_ure/Makefile \
src/sys/modules/if_ure/if_ure.ioconf

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/man/mi
diff -u src/distrib/sets/lists/man/mi:1.1636 src/distrib/sets/lists/man/mi:1.1637
--- src/distrib/sets/lists/man/mi:1.1636	Sat Dec 29 11:30:11 2018
+++ src/distrib/sets/lists/man/mi	Wed Feb  6 11:55:05 2019
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1636 2018/12/29 11:30:11 maxv Exp $
+# $NetBSD: mi,v 1.1637 2019/02/06 11:55:05 rin Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -1883,6 +1883,7 @@
 ./usr/share/man/cat4/upl.0			man-sys-catman		.cat
 ./usr/share/man/cat4/uplcom.0			man-sys-catman		.cat
 ./usr/share/man/cat4/urandom.0			man-sys-catman		.cat
+./usr/share/man/cat4/ure.0			man-sys-catman		.cat
 ./usr/share/man/cat4/urio.0			man-sys-catman		.cat
 ./usr/share/man/cat4/url.0			man-sys-catman		.cat
 ./usr/share/man/cat4/urlphy.0			man-sys-catman		.cat
@@ -4963,6 +4964,7 @@
 ./usr/share/man/html4/upl.html			man-sys-htmlman		html
 ./usr/share/man/html4/uplcom.html		man-sys-htmlman		html
 ./usr/share/man/html4/urandom.html		man-sys-htmlman		html
+./usr/share/man/html4/ure.html			man-sys-htmlman		html
 ./usr/share/man/html4/urio.html			man-sys-htmlman		html
 ./usr/share/man/html4/url.html			man-sys-htmlman		html
 ./usr/share/man/html4/urlphy.html		man-sys-htmlman		html
@@ -7967,6 +7969,7 @@
 ./usr/share/man/man4/upl.4			man-sys-man		.man
 ./usr/share/man/man4/uplcom.4			man-sys-man		.man
 ./usr/share/man/man4/urandom.4			man-sys-man		.man
+./usr/share/man/man4/ure.4			man-sys-man		.man
 ./usr/share/man/man4/urio.4			man-sys-man		.man
 ./usr/share/man/man4/url.4			man-sys-man		.man
 ./usr/share/man/man4/urlphy.4			man-sys-man		.man

Index: src/distrib/sets/lists/modules/mi
diff -u src/distrib/sets/lists/modules/mi:1.118 src/distrib/sets/lists/modules/mi:1.119
--- src/distrib/sets/lists/modules/mi:1.118	Sun Jan 27 02:08:33 2019
+++ src/distrib/sets/lists/modules/mi	Wed Feb  6 11:55:05 2019
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.118 2019/01/27 02:08:33 pgoyette Exp $
+# $NetBSD: mi,v 1.119 2019/02/06 11:55:05 rin Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -230,6 +230,8 @@
 ./@MODULEDIR@/if_strip/if_strip.kmod		base-kernel-modules	kmod
 ./@MODULEDIR@/if_tunbase-kernel-modules	kmod
 ./@MODULEDIR@/if_tun/if_tun.kmod		base-kernel-modules	kmod
+./@MODULEDIR@/if_urebase-kernel-modules	kmod
+./@MODULEDIR@/if_ure/if_ure.kmod		base-kernel-modules	kmod
 ./@MODULEDIR@/if_vioifbase-obsolete		obsolete
 ./@MODULEDIR@/if_vioif/if_vioif.kmod		base-obsolete		obsolete
 ./@MODULEDIR@/if_vlanbase-kernel-modules	kmod

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.2497 src/doc/CHANGES:1.2498
--- src/doc/CHANGES:1.2497	Mon Jan 28 03:31:57 2019
+++ src/doc/CHANGES	Wed Feb  6 11:55:05 2019
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2497 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2498 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -322,3 +322,5 @@ Changes from NetBSD 8.0 to NetBSD 9.0:
 		the kernel module framework. [pgoyette 20190127]
 	macppc: Include EDID block for Clamshell iBook G3 displays.
 		[sevan 20190128]
+	ure(4): Add driver for Realtek RTL8152/RTL8153 from OpenBSD.
+		[rin 20190206]

Index: src/share/man/man4/Makefile
diff -u src/share/man/man4/Makefile:1.676 src/share/man/man4/Makefile:1.677
--- src/share/man/man4/Makefile:1.676	Wed Dec 12 08:20:53 2018
+++ src/share/man/man4/Makefile	Wed Feb  6 11:55:05 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.676 2018/12/12 08:20:53 maxv Exp $
+#	$NetBSD: Make

CVS commit: src/external/gpl3/gcc

2019-02-06 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Wed Feb  6 11:54:02 UTC 2019

Modified Files:
src/external/gpl3/gcc: README.gcc7

Log Message:
- sanitizers are updated
- add 'switched' column to port list
- update many working ports
- add a second list of cpus vs. ports that have been tested to build

remaining issues:

- eabi arm vs libgcc
- vax-gcc ICE
- ppc64-gcc ICE
- sun2 build
- ia64 libgcc
- sh3 vs. compiler_rt: udivmoddi4.c:190: undefined reference to `abort'
- x68k memswitch triggers new warnings
- sun3 bloated
- mips64* has ./usr/lib/64/libgomp.so.2 as a missing file in sets


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/external/gpl3/gcc/README.gcc7

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

Modified files:

Index: src/external/gpl3/gcc/README.gcc7
diff -u src/external/gpl3/gcc/README.gcc7:1.8 src/external/gpl3/gcc/README.gcc7:1.9
--- src/external/gpl3/gcc/README.gcc7:1.8	Tue Feb  5 14:07:24 2019
+++ src/external/gpl3/gcc/README.gcc7	Wed Feb  6 11:54:02 2019
@@ -1,4 +1,4 @@
-$NetBSD: README.gcc7,v 1.8 2019/02/05 14:07:24 mrg Exp $
+$NetBSD: README.gcc7,v 1.9 2019/02/06 11:54:02 mrg Exp $
 
 new stuff (from gcc 5):
 	cc1objcplus
@@ -8,59 +8,55 @@ new stuff (from gcc 5):
 	libvtv
 	libitm
 
-known todo for gcc7:
-	- sanitizer file lists are not updated properly
-		- pull out more stuff via mknative-gcc vs hand coded in Makefile??
-
-
-arch/feature list.  anything not here has been switched already:
+arch/feature list.
 
 tools:		does build.sh tools work?
 kernels:	does a kernel run?
 libgcc:		does libgcc build?
 native-gcc:	does a full mknative-gcc complete?
-make release:	does build.sh release complete? 
+make release:	does build.sh release complete?
 runs:		does the system boot with a full world?
 atf:		does atf run / compare well
+switched:	has port switched?  y (yes), n (no/ready), ? (not ready)
 
 
-architecture	tools	kernels	libgcc	native-gcc	make release	runs	atf
-	-	---	--	--			---
-aarch64		y	y	y	y		y		y	?
-alpha		y	y	y	y		y		y	?
-arm		y	y	y	y		y		y	?
-armeb		y	?	y	y		y		?	?
-earm		?	?	?	?		?		?	?
-earmeb		?	?	?	?		?		?	?
-earmhf		?	?	?	?		?		?	?
-earmhfeb	?	?	?	?		?		?	?
-earmv4		y	y	n[5]	y		?		?	?
-earmv4eb	?	?	?	?		?		?	?
-earmv6		?	?	?	?		?		?	?
-earmv6eb	?	?	?	?		?		?	?
-earmv6hf	?	?	?	?		?		?	?
-earmv6hfeb	?	?	?	?		?		?	?
-earmv7		?	?	?	?		?		?	?
-earmv7eb	?	?	?	?		?		?	?
-earmv7hf	?	?	?	?		?		?	?
-earmv7hfeb	?	?	?	?		?		?	?
-hppa		y	n[6]	y	y		n[7]		?	?
-i386		y	y	y	y		y		y	?
-ia64		y	?	?	y		?		?	?
-m68000		n[4]	?	?	?		?		?	?
-m68k		y	?	y	y		?		?	?
-mipseb		y	?	?	y		?		?	?
-mipsel		y	?	?	y		?		?	?
-mips64eb	y	y	y	y		y		y	?
-mips64el	y	?	?	y		?		?	?
-powerpc		y	y	y	y		y		y	?
-powerpc64	y	?	y	y		n[9]		?	?
-sh3eb		y	?	y	y		?		?	?
-sh3el		y	?	y	y		?		?	?
-sparc		y	y	y	y		y		y	?
-sparc64		y	y	y	y[1]		n[8]		y	?
-vax		y	?	?	y		y/n[3]		?	?
-x86_64		y	y	y	y		y		y	y
+architecture	tools	kernels	libgcc	native-gcc	make release	runs	atf	switched
+	-	---	--	--			---	
+aarch64		y	y	y	y		y		y	?	n
+alpha		y	y	y	y		y		y	?	n
+arm		y	y	y	y		y		y	?	n
+armeb		y	y	y	y		y		?	?	n
+earm		y	?	?	y		?		?	?	?
+earmeb		y	?	?	y		?		?	?	?
+earmhf		y	?	?	y		?		?	?	?
+earmhfeb	y	?	?	y		?		?	?	?
+earmv4		y	y	n[5]	y		?		?	?	?
+earmv4eb	y	?	?	y		?		?	?	?
+earmv6		y	?	?	y		?		?	?	?
+earmv6eb	y	?	?	y		?		?	?	?
+earmv6hf	y	?	?	y		?		?	?	?
+earmv6hfeb	y	?	?	y		?		?	?	?
+earmv7		y	?	?	y		?		?	?	?
+earmv7eb	y	?	?	y		?		?	?	?
+earmv7hf	y	?	?	y		?		?	?	?
+earmv7hfeb	y	?	?	y		?		?	?	?
+hppa		y	y	y	y		y		?	?	n
+i386		y	y	y	y		y		y	?	n
+ia64		y	?	?	y		n[2]		?	?	?
+m68000		n[4]	?	?	?		?		?	?	?
+m68k		y	?	y	y		?		?	?	?
+mipseb		y	?	?	y		?		?	?	?
+mipsel		y	?	?	y		?		?	?	?
+mips64eb	y	y	y	y		y		y	?	n
+mips64el	y	?	?	y		?		?	?	?
+powerpc		y	y	y	y		y		y	?	n
+powerpc64	y	?	y	y		n[9]		?	?	?
+sh3eb		y	n[6]	y	y		?		?	?	?
+sh3el		y	n[6]	y	y		?		?	?	?
+sparc		y	y	y	y		y		y	?	n
+sparc64		y	y	y	y[1]		y		y	?	?
+vax		y	?	?	y		y/n[3]		?	?	?
+x86_64		y	y	y	y		y		y	y	n
 --
 or1k		
 riscv32		
@@ -70,23 +66,58 @@ coldfire	?	N/A	?	?		?		N/A	N/A
 architecture	tools	kernels	libgcc	native-gcc	make release	runs	atf
 
 [1] - sparc64-gcc gets ICE at startup.  because sizeof(ufast8/16/32) != sizeof(sfast8/16/32)
-	-- uncommited hack to workaround it seems to work fine.
-[2]
-[3] - gcc can't be built: 
+	-- commited hack to workaround it seems to work fine.
+[2] - libgcc_s.so: undefined reference to `__netf2'
+[3] - gcc can't be built:
 	/usr/src6/external/gpl3/gcc/dist/gcc/calls.c:1361:1: error: unrecognizable insn:
-	 }
-	 ^
-	(insn 444 443 445 19 (set (reg:SI 389)
-		(subreg:SI (mem:DI (plus:SI (plus:SI (mult:SI (reg:SI 387)
-(const_int 8 [0x8]))
-(reg/f:SI 17 virtual-stack-vars))
-			(const_int -224 [0xff20])) [18 *_176+0 S8 A32]) 4)) "/usr/src6/external/gpl3/gcc/dist/gcc/wide-int.h":1817 -1
-	 (nil))
+	[ .. ]
 	

CVS commit: src/share/mk

2019-02-06 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Wed Feb  6 11:05:30 UTC 2019

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

Log Message:
move OBJECT_FMTS setting after MKCOMPAT default, so it works.

should fix mips64 builds.


To generate a diff of this commit:
cvs rdiff -u -r1.1100 -r1.1101 src/share/mk/bsd.own.mk

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

Modified files:

Index: src/share/mk/bsd.own.mk
diff -u src/share/mk/bsd.own.mk:1.1100 src/share/mk/bsd.own.mk:1.1101
--- src/share/mk/bsd.own.mk:1.1100	Tue Feb  5 04:47:59 2019
+++ src/share/mk/bsd.own.mk	Wed Feb  6 11:05:30 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.own.mk,v 1.1100 2019/02/05 04:47:59 mrg Exp $
+#	$NetBSD: bsd.own.mk,v 1.1101 2019/02/06 11:05:30 mrg Exp $
 
 # This needs to be before bsd.init.mk
 .if defined(BSD_MK_COMPAT_FILE)
@@ -620,18 +620,6 @@ MACHINES.sparc64=	sparc64
 MACHINES.vax=		vax
 MACHINES.x86_64=	amd64
 
-# for crunchide & ldd, define the OBJECT_FMTS used by a MACHINE_ARCH
-#
-OBJECT_FMTS=
-.if	${MACHINE_ARCH} != "alpha" && ${MACHINE_ARCH} != "ia64"
-OBJECT_FMTS+=	elf32
-.endif
-.if	${MACHINE_ARCH} == "alpha" || ${MACHINE_ARCH:M*64*} != ""
-. if !(${MKCOMPAT:Uno} == "no" && ${MACHINE_CPU} == "mips")
-OBJECT_FMTS+=	elf64
-. endif
-.endif
-
 # OBJCOPY flags to create a.out binaries for old firmware
 # shared among src/distrib and ${MACHINE}/conf/Makefile.${MACHINE}.inc
 .if ${MACHINE_CPU} == "arm"
@@ -1319,6 +1307,18 @@ INSTALL_LINK?=		${INSTALL} ${INSTPRIV} $
 INSTALL_SYMLINK?=	${INSTALL} ${INSTPRIV} ${SYMLINK} ${RENAME}
 .endif
 
+# for crunchide & ldd, define the OBJECT_FMTS used by a MACHINE_ARCH
+#
+OBJECT_FMTS=
+.if	${MACHINE_ARCH} != "alpha" && ${MACHINE_ARCH} != "ia64"
+OBJECT_FMTS+=	elf32
+.endif
+.if	${MACHINE_ARCH} == "alpha" || ${MACHINE_ARCH:M*64*} != ""
+. if !(${MKCOMPAT:Uyes} == "no" && ${MACHINE_CPU} == "mips")
+OBJECT_FMTS+=	elf64
+. endif
+.endif
+
 #
 # Set defaults for the USE_xxx variables.
 #



CVS commit: src/distrib/utils/zcat

2019-02-06 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Wed Feb  6 09:17:18 UTC 2019

Modified Files:
src/distrib/utils/zcat: Makefile

Log Message:
pply zlib hack for gcc 7 here too (4th occurance!)


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/distrib/utils/zcat/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/utils/zcat/Makefile
diff -u src/distrib/utils/zcat/Makefile:1.17 src/distrib/utils/zcat/Makefile:1.18
--- src/distrib/utils/zcat/Makefile:1.17	Thu Jan 12 01:58:03 2017
+++ src/distrib/utils/zcat/Makefile	Wed Feb  6 09:17:18 2019
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.17 2017/01/12 01:58:03 christos Exp $
+# $NetBSD: Makefile,v 1.18 2019/02/06 09:17:18 mrg Exp $
 # Small zcat (i.e. for install media)
 #
 
@@ -26,6 +26,10 @@ CPPFLAGS+=	-I${LIBC}/include
 CPPFLAGS+=	-Dsnprintf=snprintf_ss -Dsprintf=sprintf_ss
 CPPFLAGS+=	-Dstrerror=strerror_ss
 
+.if defined(HAVE_GCC) && ${HAVE_GCC} == 7 && ${ACTIVE_CC} == "gcc"
+COPTS.inflate.c+=	-Wno-error=implicit-fallthrough
+.endif
+
 .include 
 
 test: zcat



CVS commit: src/tests/dev/scsipi/libscsitest

2019-02-06 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Wed Feb  6 09:16:49 UTC 2019

Modified Files:
src/tests/dev/scsipi/libscsitest: scsitest.c

Log Message:
use strncpy() into a buffer that may not be nul terminated.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/dev/scsipi/libscsitest/scsitest.c

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

Modified files:

Index: src/tests/dev/scsipi/libscsitest/scsitest.c
diff -u src/tests/dev/scsipi/libscsitest/scsitest.c:1.2 src/tests/dev/scsipi/libscsitest/scsitest.c:1.3
--- src/tests/dev/scsipi/libscsitest/scsitest.c:1.2	Fri Apr 25 00:24:39 2014
+++ src/tests/dev/scsipi/libscsitest/scsitest.c	Wed Feb  6 09:16:49 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: scsitest.c,v 1.2 2014/04/25 00:24:39 pooka Exp $	*/
+/*	$NetBSD: scsitest.c,v 1.3 2019/02/06 09:16:49 mrg Exp $	*/
 
 /*
  * Copyright (c) 2010 Antti Kantee.  All Rights Reserved.
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: scsitest.c,v 1.2 2014/04/25 00:24:39 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: scsitest.c,v 1.3 2019/02/06 09:16:49 mrg Exp $");
 
 #include 
 #include 
@@ -123,9 +123,9 @@ scsitest_request(struct scsipi_channel *
 		memset(inqbuf, 0, sizeof(*inqbuf));
 		inqbuf->device = T_CDROM;
 		inqbuf->dev_qual2 = SID_REMOVABLE;
-		strcpy(inqbuf->vendor, "RUMPHOBO");
-		strcpy(inqbuf->product, "It's a LIE");
-		strcpy(inqbuf->revision, "0.00");
+		strncpy(inqbuf->vendor, "RUMPHOBO", sizeof inqbuf->vendor);
+		strncpy(inqbuf->product, "It's a LIE", sizeof inqbuf->product);
+		strncpy(inqbuf->revision, "0.00", sizeof inqbuf->revision);
 		break;
 	}
 	case READ_CD_CAPACITY: {



CVS commit: src/sys/dev/usb

2019-02-06 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Wed Feb  6 09:15:01 UTC 2019

Modified Files:
src/sys/dev/usb: if_mue.c

Log Message:
Fix sign compare.


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/sys/dev/usb/if_mue.c

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

Modified files:

Index: src/sys/dev/usb/if_mue.c
diff -u src/sys/dev/usb/if_mue.c:1.38 src/sys/dev/usb/if_mue.c:1.39
--- src/sys/dev/usb/if_mue.c:1.38	Wed Feb  6 08:38:41 2019
+++ src/sys/dev/usb/if_mue.c	Wed Feb  6 09:15:01 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_mue.c,v 1.38 2019/02/06 08:38:41 rin Exp $	*/
+/*	$NetBSD: if_mue.c,v 1.39 2019/02/06 09:15:01 rin Exp $	*/
 /*	$OpenBSD: if_mue.c,v 1.3 2018/08/04 16:42:46 jsg Exp $	*/
 
 /*
@@ -20,7 +20,7 @@
 /* Driver for Microchip LAN7500/LAN7800 chipsets. */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_mue.c,v 1.38 2019/02/06 08:38:41 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_mue.c,v 1.39 2019/02/06 09:15:01 rin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -1306,7 +1306,7 @@ mue_prepare_tso(struct mue_softc *sc, st
 	uint16_t type, len = 0;
 	int off;
 
-	if (__predict_true(m->m_len >= sizeof(*eh))) {
+	if (__predict_true((unsigned)m->m_len >= sizeof(*eh))) {
 		eh = mtod(m, struct ether_header *);
 		type = eh->ether_type;
 	} else
@@ -1329,14 +1329,14 @@ mue_prepare_tso(struct mue_softc *sc, st
 	}
 
 	if (m->m_pkthdr.csum_flags & M_CSUM_TSOv4) {
-		if (__predict_true(m->m_len >= off + sizeof(*ip))) {
+		if (__predict_true((unsigned)m->m_len >= off + sizeof(*ip))) {
 			ip = (void *)(mtod(m, char *) + off);
 			ip->ip_len = 0;
 		} else
 			m_copyback(m, off + offsetof(struct ip, ip_len),
 			sizeof(len), );
 	} else {
-		if (__predict_true(m->m_len >= off + sizeof(*ip6))) {
+		if (__predict_true((unsigned)m->m_len >= off + sizeof(*ip6))) {
 			ip6 = (void *)(mtod(m, char *) + off);
 			ip6->ip6_plen = 0;
 		} else



CVS commit: src/sys/dev/usb

2019-02-06 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Wed Feb  6 08:38:41 UTC 2019

Modified Files:
src/sys/dev/usb: if_axen.c if_axenreg.h if_mue.c

Log Message:
Add ratecheck for TX errors for axen(4) and mue(4).


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sys/dev/usb/if_axen.c
cvs rdiff -u -r1.9 -r1.10 src/sys/dev/usb/if_axenreg.h
cvs rdiff -u -r1.37 -r1.38 src/sys/dev/usb/if_mue.c

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

Modified files:

Index: src/sys/dev/usb/if_axen.c
diff -u src/sys/dev/usb/if_axen.c:1.34 src/sys/dev/usb/if_axen.c:1.35
--- src/sys/dev/usb/if_axen.c:1.34	Wed Feb  6 08:16:49 2019
+++ src/sys/dev/usb/if_axen.c	Wed Feb  6 08:38:41 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_axen.c,v 1.34 2019/02/06 08:16:49 rin Exp $	*/
+/*	$NetBSD: if_axen.c,v 1.35 2019/02/06 08:38:41 rin Exp $	*/
 /*	$OpenBSD: if_axen.c,v 1.3 2013/10/21 10:10:22 yuo Exp $	*/
 
 /*
@@ -23,7 +23,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_axen.c,v 1.34 2019/02/06 08:16:49 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_axen.c,v 1.35 2019/02/06 08:38:41 rin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -1025,10 +1025,9 @@ axen_rxeof(struct usbd_xfer *xfer, void 
 			return;	/* XXX plugged out or down */
 		if (status == USBD_NOT_STARTED || status == USBD_CANCELLED)
 			return;
-		if (usbd_ratecheck(>axen_rx_notice)) {
+		if (usbd_ratecheck(>axen_rx_notice))
 			aprint_error_dev(sc->axen_dev, "usb errors on rx: %s\n",
 			usbd_errstr(status));
-		}
 		if (status == USBD_STALLED)
 			usbd_clear_endpoint_stall_async(sc->axen_ep[AXEN_ENDPT_RX]);
 		goto done;
@@ -1217,8 +1216,9 @@ axen_txeof(struct usbd_xfer *xfer, void 
 			return;
 		}
 		ifp->if_oerrors++;
-		aprint_error_dev(sc->axen_dev, "usb error on tx: %s\n",
-		usbd_errstr(status));
+		if (usbd_ratecheck(>axen_tx_notice))
+			aprint_error_dev(sc->axen_dev, "usb error on tx: %s\n",
+			usbd_errstr(status));
 		if (status == USBD_STALLED)
 			usbd_clear_endpoint_stall_async(sc->axen_ep[AXEN_ENDPT_TX]);
 		splx(s);

Index: src/sys/dev/usb/if_axenreg.h
diff -u src/sys/dev/usb/if_axenreg.h:1.9 src/sys/dev/usb/if_axenreg.h:1.10
--- src/sys/dev/usb/if_axenreg.h:1.9	Wed Feb  6 08:06:59 2019
+++ src/sys/dev/usb/if_axenreg.h	Wed Feb  6 08:38:41 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_axenreg.h,v 1.9 2019/02/06 08:06:59 rin Exp $	*/
+/*	$NetBSD: if_axenreg.h,v 1.10 2019/02/06 08:38:41 rin Exp $	*/
 /*	$OpenBSD: if_axenreg.h,v 1.1 2013/10/07 05:37:41 yuo Exp $	*/
 
 /*
@@ -299,6 +299,7 @@ struct axen_softc {
 
 	int			axen_phyno;
 	struct timeval		axen_rx_notice;
+	struct timeval		axen_tx_notice;
 	u_int			axen_rx_bufsz;
 	u_int			axen_tx_bufsz;
 	int			axen_rev;

Index: src/sys/dev/usb/if_mue.c
diff -u src/sys/dev/usb/if_mue.c:1.37 src/sys/dev/usb/if_mue.c:1.38
--- src/sys/dev/usb/if_mue.c:1.37	Wed Feb  6 08:31:38 2019
+++ src/sys/dev/usb/if_mue.c	Wed Feb  6 08:38:41 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_mue.c,v 1.37 2019/02/06 08:31:38 rin Exp $	*/
+/*	$NetBSD: if_mue.c,v 1.38 2019/02/06 08:38:41 rin Exp $	*/
 /*	$OpenBSD: if_mue.c,v 1.3 2018/08/04 16:42:46 jsg Exp $	*/
 
 /*
@@ -20,7 +20,7 @@
 /* Driver for Microchip LAN7500/LAN7800 chipsets. */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_mue.c,v 1.37 2019/02/06 08:31:38 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_mue.c,v 1.38 2019/02/06 08:38:41 rin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -1634,7 +1634,8 @@ mue_txeof(struct usbd_xfer *xfer, void *
 			return;
 		}
 		ifp->if_oerrors++;
-		MUE_PRINTF(sc, "%s\n", usbd_errstr(status));
+		if (usbd_ratecheck(>mue_tx_notice))
+			MUE_PRINTF(sc, "%s\n", usbd_errstr(status));
 		if (status == USBD_STALLED)
 			usbd_clear_endpoint_stall_async(
 			sc->mue_ep[MUE_ENDPT_TX]);



CVS commit: src/sys/dev/i2c

2019-02-06 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Feb  6 08:37:12 UTC 2019

Modified Files:
src/sys/dev/i2c: dbcool.c

Log Message:
Change a aprint_verbose into aprint_debug - the message does not add
real value to the dmesg(8) output.


To generate a diff of this commit:
cvs rdiff -u -r1.53 -r1.54 src/sys/dev/i2c/dbcool.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/i2c/dbcool.c
diff -u src/sys/dev/i2c/dbcool.c:1.53 src/sys/dev/i2c/dbcool.c:1.54
--- src/sys/dev/i2c/dbcool.c:1.53	Sun Feb  3 11:58:02 2019
+++ src/sys/dev/i2c/dbcool.c	Wed Feb  6 08:37:12 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: dbcool.c,v 1.53 2019/02/03 11:58:02 mrg Exp $ */
+/*	$NetBSD: dbcool.c,v 1.54 2019/02/06 08:37:12 martin Exp $ */
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -50,7 +50,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: dbcool.c,v 1.53 2019/02/03 11:58:02 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dbcool.c,v 1.54 2019/02/06 08:37:12 martin Exp $");
 
 #include 
 #include 
@@ -1884,7 +1884,7 @@ dbcool_chip_ident(struct dbcool_chipset 
 			return i;
 		}
 
-	aprint_verbose("dbcool_chip_ident: addr 0x%02x c_id 0x%02x d_id 0x%02x"
+	aprint_debug("dbcool_chip_ident: addr 0x%02x c_id 0x%02x d_id 0x%02x"
 			" r_id 0x%02x: No match.\n", dc->dc_addr, c_id, d_id,
 			r_id);
 



CVS commit: src/sys/dev/usb

2019-02-06 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Wed Feb  6 08:31:38 UTC 2019

Modified Files:
src/sys/dev/usb: if_mue.c

Log Message:
Fix TSO support:
- Rename mue_tx_offload() to mue_tso_prepare().
- Take care of short mbuf's (paranoia).


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/sys/dev/usb/if_mue.c

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

Modified files:

Index: src/sys/dev/usb/if_mue.c
diff -u src/sys/dev/usb/if_mue.c:1.36 src/sys/dev/usb/if_mue.c:1.37
--- src/sys/dev/usb/if_mue.c:1.36	Wed Feb  6 08:28:11 2019
+++ src/sys/dev/usb/if_mue.c	Wed Feb  6 08:31:38 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_mue.c,v 1.36 2019/02/06 08:28:11 rin Exp $	*/
+/*	$NetBSD: if_mue.c,v 1.37 2019/02/06 08:31:38 rin Exp $	*/
 /*	$OpenBSD: if_mue.c,v 1.3 2018/08/04 16:42:46 jsg Exp $	*/
 
 /*
@@ -20,7 +20,7 @@
 /* Driver for Microchip LAN7500/LAN7800 chipsets. */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_mue.c,v 1.36 2019/02/06 08:28:11 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_mue.c,v 1.37 2019/02/06 08:31:38 rin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -146,7 +146,7 @@ static int	mue_open_pipes(struct mue_sof
 static void	mue_startup_rx_pipes(struct mue_softc *);
 
 static int	mue_encap(struct mue_softc *, struct mbuf *, int);
-static void	mue_tx_offload(struct mue_softc *, struct mbuf *);
+static int	mue_prepare_tso(struct mue_softc *, struct mbuf *);
 
 static void	mue_setmulti(struct mue_softc *);
 static void	mue_sethwcsum(struct mue_softc *);
@@ -1230,7 +1230,7 @@ mue_encap(struct mue_softc *sc, struct m
 	usbd_status err;
 	struct mue_txbuf_hdr hdr;
 	uint32_t tx_cmd_a, tx_cmd_b;
-	int csum, len;
+	int csum, len, rv;
 	bool tso, ipe, tpe;
 
 	csum = m->m_pkthdr.csum_flags;
@@ -1260,7 +1260,9 @@ mue_encap(struct mue_softc *sc, struct m
 			tx_cmd_b = MUE_TX_MSS_MIN;
 		tx_cmd_b <<= MUE_TX_CMD_B_MSS_SHIFT;
 		KASSERT((tx_cmd_b & ~MUE_TX_CMD_B_MSS_MASK) == 0);
-		mue_tx_offload(sc, m);
+		rv = mue_prepare_tso(sc, m);
+		if (__predict_false(rv))
+			return rv;
 	} else {
 		if (ipe)
 			tx_cmd_a |= MUE_TX_CMD_A_IPE;
@@ -1292,38 +1294,56 @@ mue_encap(struct mue_softc *sc, struct m
 	return 0;
 }
 
-static void
-mue_tx_offload(struct mue_softc *sc, struct mbuf *m)
+/*
+ * L3 length field should be cleared.
+ */
+static int
+mue_prepare_tso(struct mue_softc *sc, struct mbuf *m)
 {
 	struct ether_header *eh;
 	struct ip *ip;
 	struct ip6_hdr *ip6;
+	uint16_t type, len = 0;
 	int off;
 
-	eh = mtod(m, struct ether_header *);
-	switch (htons(eh->ether_type)) {
+	if (__predict_true(m->m_len >= sizeof(*eh))) {
+		eh = mtod(m, struct ether_header *);
+		type = eh->ether_type;
+	} else
+		m_copydata(m, offsetof(struct ether_header, ether_type),
+		sizeof(type), );
+	switch (type = htons(type)) {
 	case ETHERTYPE_IP:
 	case ETHERTYPE_IPV6:
 		off = ETHER_HDR_LEN;
 		break;
 	case ETHERTYPE_VLAN:
-		/* XXX not yet supported */
 		off = ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN;
 		break;
 	default:
-		/* XXX */
-		panic("%s: unsupported ethertype\n", __func__);
-		/* NOTREACHED */
+		if (usbd_ratecheck(>mue_tx_notice))
+			MUE_PRINTF(sc, "dropping invalid frame "
+			"type 0x%04hx csum_flags 0x%08x\n", 
+			type, m->m_pkthdr.csum_flags);
+		return EINVAL;
 	}
 
-	/* Packet length should be cleared. */
 	if (m->m_pkthdr.csum_flags & M_CSUM_TSOv4) {
-		ip = (void *)(mtod(m, char *) + off);
-		ip->ip_len = 0;
+		if (__predict_true(m->m_len >= off + sizeof(*ip))) {
+			ip = (void *)(mtod(m, char *) + off);
+			ip->ip_len = 0;
+		} else
+			m_copyback(m, off + offsetof(struct ip, ip_len),
+			sizeof(len), );
 	} else {
-		ip6 = (void *)(mtod(m, char *) + off);
-		ip6->ip6_plen = 0;
+		if (__predict_true(m->m_len >= off + sizeof(*ip6))) {
+			ip6 = (void *)(mtod(m, char *) + off);
+			ip6->ip6_plen = 0;
+		} else
+			m_copyback(m, off + offsetof(struct ip6_hdr, ip6_plen),
+			sizeof(len), );
 	}
+	return 0;
 }
 
 static void



CVS commit: src/sys/dev/usb

2019-02-06 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Wed Feb  6 08:28:11 UTC 2019

Modified Files:
src/sys/dev/usb: if_mue.c if_muevar.h

Log Message:
Remove unused.


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/sys/dev/usb/if_mue.c
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/usb/if_muevar.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_mue.c
diff -u src/sys/dev/usb/if_mue.c:1.35 src/sys/dev/usb/if_mue.c:1.36
--- src/sys/dev/usb/if_mue.c:1.35	Wed Feb  6 08:26:30 2019
+++ src/sys/dev/usb/if_mue.c	Wed Feb  6 08:28:11 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_mue.c,v 1.35 2019/02/06 08:26:30 rin Exp $	*/
+/*	$NetBSD: if_mue.c,v 1.36 2019/02/06 08:28:11 rin Exp $	*/
 /*	$OpenBSD: if_mue.c,v 1.3 2018/08/04 16:42:46 jsg Exp $	*/
 
 /*
@@ -20,7 +20,7 @@
 /* Driver for Microchip LAN7500/LAN7800 chipsets. */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_mue.c,v 1.35 2019/02/06 08:26:30 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_mue.c,v 1.36 2019/02/06 08:28:11 rin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -933,7 +933,6 @@ mue_attach(device_t parent, device_t sel
 	}
 
 	usb_init_task(>mue_tick_task, mue_tick_task, sc, 0);
-	usb_init_task(>mue_stop_task, (void (*)(void *))mue_stop, sc, 0);
 
 #define MUE_IFACE_IDX	0
 	err = usbd_device2interface_handle(dev, MUE_IFACE_IDX, >mue_iface);
@@ -1090,8 +1089,6 @@ mue_detach(device_t self, int flags)
 	 */
 	usb_rem_task_wait(sc->mue_udev, >mue_tick_task, USB_TASKQ_DRIVER,
 	NULL);
-	usb_rem_task_wait(sc->mue_udev, >mue_stop_task, USB_TASKQ_DRIVER,
-	NULL);
 
 	s = splusb();
 
@@ -1149,7 +1146,6 @@ mue_rx_list_init(struct mue_softc *sc)
 	for (i = 0; i < sc->mue_rx_list_cnt; i++) {
 		c = >mue_rx_chain[i];
 		c->mue_sc = sc;
-		c->mue_idx = i;
 		if (c->mue_xfer == NULL) {
 			err = usbd_create_xfer(sc->mue_ep[MUE_ENDPT_RX],
 			sc->mue_rxbufsz, 0, 0, >mue_xfer);
@@ -1174,7 +1170,6 @@ mue_tx_list_init(struct mue_softc *sc)
 	for (i = 0; i < sc->mue_tx_list_cnt; i++) {
 		c = >mue_tx_chain[i];
 		c->mue_sc = sc;
-		c->mue_idx = i;
 		if (c->mue_xfer == NULL) {
 			err = usbd_create_xfer(sc->mue_ep[MUE_ENDPT_TX],
 			sc->mue_txbufsz, USBD_FORCE_SHORT_XFER, 0,

Index: src/sys/dev/usb/if_muevar.h
diff -u src/sys/dev/usb/if_muevar.h:1.6 src/sys/dev/usb/if_muevar.h:1.7
--- src/sys/dev/usb/if_muevar.h:1.6	Sun Feb  3 13:11:07 2019
+++ src/sys/dev/usb/if_muevar.h	Wed Feb  6 08:28:11 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_muevar.h,v 1.6 2019/02/03 13:11:07 mlelstv Exp $	*/
+/*	$NetBSD: if_muevar.h,v 1.7 2019/02/06 08:28:11 rin Exp $	*/
 /*	$OpenBSD: if_muereg.h,v 1.1 2018/08/03 01:50:15 kevlo Exp $	*/
 
 /*
@@ -26,8 +26,6 @@ struct mue_chain {
 	struct mue_softc	*mue_sc;
 	struct usbd_xfer	*mue_xfer;
 	char			*mue_buf;
-	int			mue_accum;
-	int			mue_idx;
 };
 
 struct mue_cdata {
@@ -40,9 +38,7 @@ struct mue_cdata {
 #endif
 	struct mue_chain	mue_rx_chain[MUE_RX_LIST_CNT];
 	int			mue_tx_prod;
-	int			mue_tx_cons;
 	int			mue_tx_cnt;
-	int			mue_rx_prod;
 };
 
 struct mue_rxbuf_hdr {
@@ -103,11 +99,11 @@ struct mue_softc {
 	struct usbd_interface	*mue_iface;
 
 	struct usb_task		mue_tick_task;
-	struct usb_task		mue_stop_task;
 
 	kmutex_t		mue_mii_lock;
 
 	struct timeval		mue_rx_notice;
+	struct timeval		mue_tx_notice;
 
 	uint16_t		mue_product;
 	uint16_t		mue_flags;



CVS commit: src/sys/dev/usb

2019-02-06 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Wed Feb  6 08:26:31 UTC 2019

Modified Files:
src/sys/dev/usb: if_mue.c

Log Message:
SIOC[GS]IFMEDIA are processed in ether_ioctl().


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sys/dev/usb/if_mue.c

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

Modified files:

Index: src/sys/dev/usb/if_mue.c
diff -u src/sys/dev/usb/if_mue.c:1.34 src/sys/dev/usb/if_mue.c:1.35
--- src/sys/dev/usb/if_mue.c:1.34	Wed Feb  6 08:23:08 2019
+++ src/sys/dev/usb/if_mue.c	Wed Feb  6 08:26:30 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_mue.c,v 1.34 2019/02/06 08:23:08 rin Exp $	*/
+/*	$NetBSD: if_mue.c,v 1.35 2019/02/06 08:26:30 rin Exp $	*/
 /*	$OpenBSD: if_mue.c,v 1.3 2018/08/04 16:42:46 jsg Exp $	*/
 
 /*
@@ -20,7 +20,7 @@
 /* Driver for Microchip LAN7500/LAN7800 chipsets. */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_mue.c,v 1.34 2019/02/06 08:23:08 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_mue.c,v 1.35 2019/02/06 08:26:30 rin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -1703,7 +1703,6 @@ static int
 mue_ioctl(struct ifnet *ifp, u_long cmd, void *data)
 {
 	struct mue_softc *sc = ifp->if_softc;
-	struct ifreq /*const*/ *ifr = data;
 	int s, error = 0;
 
 	s = splnet();
@@ -1729,10 +1728,6 @@ mue_ioctl(struct ifnet *ifp, u_long cmd,
 		}
 		sc->mue_if_flags = ifp->if_flags;
 		break;
-	case SIOCGIFMEDIA:
-	case SIOCSIFMEDIA:
-		error = ifmedia_ioctl(ifp, ifr, >mue_mii.mii_media, cmd);
-		break;
 	default:
 		if ((error = ether_ioctl(ifp, cmd, data)) != ENETRESET)
 			break;



CVS commit: src/sys/dev/usb

2019-02-06 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Wed Feb  6 08:23:08 UTC 2019

Modified Files:
src/sys/dev/usb: if_mue.c

Log Message:
Fix NULL checks after dereference.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/dev/usb/if_mue.c

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

Modified files:

Index: src/sys/dev/usb/if_mue.c
diff -u src/sys/dev/usb/if_mue.c:1.33 src/sys/dev/usb/if_mue.c:1.34
--- src/sys/dev/usb/if_mue.c:1.33	Wed Feb  6 08:20:23 2019
+++ src/sys/dev/usb/if_mue.c	Wed Feb  6 08:23:08 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_mue.c,v 1.33 2019/02/06 08:20:23 rin Exp $	*/
+/*	$NetBSD: if_mue.c,v 1.34 2019/02/06 08:23:08 rin Exp $	*/
 /*	$OpenBSD: if_mue.c,v 1.3 2018/08/04 16:42:46 jsg Exp $	*/
 
 /*
@@ -20,7 +20,7 @@
 /* Driver for Microchip LAN7500/LAN7800 chipsets. */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_mue.c,v 1.33 2019/02/06 08:20:23 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_mue.c,v 1.34 2019/02/06 08:23:08 rin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -359,12 +359,25 @@ out:
 static void
 mue_miibus_statchg(struct ifnet *ifp)
 {
-	struct mue_softc *sc = ifp->if_softc;
-	struct mii_data *mii = GET_MII(sc);
+	struct mue_softc *sc;
+	struct mii_data *mii;
 	uint32_t flow, threshold;
 
-	if (mii == NULL || ifp == NULL || (ifp->if_flags & IFF_RUNNING) == 0) {
-		DPRINTF(sc, "not ready\n");
+	if (ifp == NULL) {
+		DPRINTF(sc, "ifp not ready\n");
+		return;
+	}
+
+	if ((ifp->if_flags & IFF_RUNNING) == 0) {
+		DPRINTF(sc, "not running\n");
+		return;
+	}
+
+	sc = ifp->if_softc;
+	mii = GET_MII(sc);
+
+	if (mii == NULL) {
+		DPRINTF(sc, "mii not ready\n");
 		return;
 	}
 
@@ -1900,8 +1913,8 @@ static void
 mue_tick_task(void *xsc)
 {
 	struct mue_softc *sc = xsc;
-	struct ifnet *ifp = GET_IFP(sc);
-	struct mii_data *mii = GET_MII(sc);
+	struct ifnet *ifp;
+	struct mii_data *mii;
 	int s;
 
 	if (sc == NULL)
@@ -1910,6 +1923,9 @@ mue_tick_task(void *xsc)
 	if (sc->mue_dying)
 		return;
 
+	ifp = GET_IFP(sc);
+	mii = GET_MII(sc);
+
 	s = splnet();
 	mii_tick(mii);
 	if (sc->mue_link == 0)



CVS commit: src/sys/dev/usb

2019-02-06 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Wed Feb  6 08:20:23 UTC 2019

Modified Files:
src/sys/dev/usb: if_mue.c

Log Message:
Cosmetic changes; no functional changes.


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/sys/dev/usb/if_mue.c

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

Modified files:

Index: src/sys/dev/usb/if_mue.c
diff -u src/sys/dev/usb/if_mue.c:1.32 src/sys/dev/usb/if_mue.c:1.33
--- src/sys/dev/usb/if_mue.c:1.32	Wed Feb  6 08:16:49 2019
+++ src/sys/dev/usb/if_mue.c	Wed Feb  6 08:20:23 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_mue.c,v 1.32 2019/02/06 08:16:49 rin Exp $	*/
+/*	$NetBSD: if_mue.c,v 1.33 2019/02/06 08:20:23 rin Exp $	*/
 /*	$OpenBSD: if_mue.c,v 1.3 2018/08/04 16:42:46 jsg Exp $	*/
 
 /*
@@ -20,7 +20,7 @@
 /* Driver for Microchip LAN7500/LAN7800 chipsets. */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_mue.c,v 1.32 2019/02/06 08:16:49 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_mue.c,v 1.33 2019/02/06 08:20:23 rin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -1829,6 +1829,7 @@ static void
 mue_stop(struct ifnet *ifp, int disable __unused)
 {
 	struct mue_softc *sc = ifp->if_softc;
+	struct mue_chain *c;
 	usbd_status err;
 	size_t i;
 
@@ -1850,20 +1851,22 @@ mue_stop(struct ifnet *ifp, int disable 
 		}
 
 	/* Free RX resources. */
-	for (i = 0; i < sc->mue_rx_list_cnt; i++)
-		if (sc->mue_cdata.mue_rx_chain[i].mue_xfer != NULL) {
-			usbd_destroy_xfer(
-			sc->mue_cdata.mue_rx_chain[i].mue_xfer);
-			sc->mue_cdata.mue_rx_chain[i].mue_xfer = NULL;
+	for (i = 0; i < sc->mue_rx_list_cnt; i++) {
+		c = >mue_cdata.mue_rx_chain[i];
+		if (c->mue_xfer != NULL) {
+			usbd_destroy_xfer(c->mue_xfer);
+			c->mue_xfer = NULL;
 		}
+	}
 
 	/* Free TX resources. */
-	for (i = 0; i < sc->mue_tx_list_cnt; i++)
-		if (sc->mue_cdata.mue_tx_chain[i].mue_xfer != NULL) {
-			usbd_destroy_xfer(
-			sc->mue_cdata.mue_tx_chain[i].mue_xfer);
-			sc->mue_cdata.mue_tx_chain[i].mue_xfer = NULL;
+	for (i = 0; i < sc->mue_tx_list_cnt; i++) {
+		c = >mue_cdata.mue_tx_chain[i];
+		if (c->mue_xfer != NULL) {
+			usbd_destroy_xfer(c->mue_xfer);
+			c->mue_xfer = NULL;
 		}
+	}
 
 	/* Close pipes */
 	for (i = 0; i < __arraycount(sc->mue_ep); i++)



CVS commit: src/sys/dev/usb

2019-02-06 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Wed Feb  6 08:16:49 UTC 2019

Modified Files:
src/sys/dev/usb: if_axen.c if_mue.c

Log Message:
Fix panic when detach or "ifconfig down" for axen(4) and mue(4).
- Mitigate race conditions, that become critical when multiple outstanding
  transfers are enabled.
- Drop link flags earlier in foo_stop() to make sure (paranoia).


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/dev/usb/if_axen.c
cvs rdiff -u -r1.31 -r1.32 src/sys/dev/usb/if_mue.c

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

Modified files:

Index: src/sys/dev/usb/if_axen.c
diff -u src/sys/dev/usb/if_axen.c:1.33 src/sys/dev/usb/if_axen.c:1.34
--- src/sys/dev/usb/if_axen.c:1.33	Wed Feb  6 08:06:59 2019
+++ src/sys/dev/usb/if_axen.c	Wed Feb  6 08:16:49 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_axen.c,v 1.33 2019/02/06 08:06:59 rin Exp $	*/
+/*	$NetBSD: if_axen.c,v 1.34 2019/02/06 08:16:49 rin Exp $	*/
 /*	$OpenBSD: if_axen.c,v 1.3 2013/10/21 10:10:22 yuo Exp $	*/
 
 /*
@@ -23,7 +23,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_axen.c,v 1.33 2019/02/06 08:06:59 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_axen.c,v 1.34 2019/02/06 08:16:49 rin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -1021,6 +1021,8 @@ axen_rxeof(struct usbd_xfer *xfer, void 
 		return;
 
 	if (status != USBD_NORMAL_COMPLETION) {
+		if (status == USBD_INVAL)
+			return;	/* XXX plugged out or down */
 		if (status == USBD_NOT_STARTED || status == USBD_CANCELLED)
 			return;
 		if (usbd_ratecheck(>axen_rx_notice)) {
@@ -1322,6 +1324,9 @@ axen_encap(struct axen_softc *sc, struct
 	memcpy(c->axen_buf, , sizeof(hdr));
 	m_copydata(m, 0, m->m_pkthdr.len, c->axen_buf + sizeof(hdr));
 
+	if (__predict_false(c->axen_xfer == NULL))
+		return EIO;	/* XXX plugged out or down */
+
 	usbd_setup_xfer(c->axen_xfer, c, c->axen_buf, length,
 	USBD_FORCE_SHORT_XFER, 1, axen_txeof);
 
@@ -1581,6 +1586,7 @@ axen_stop(struct ifnet *ifp, int disable
 	ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE);
 
 	callout_stop(>axen_stat_ch);
+	sc->axen_link = 0;
 
 	/* Stop transfers. */
 	if (sc->axen_ep[AXEN_ENDPT_RX] != NULL) {
@@ -1653,8 +1659,6 @@ axen_stop(struct ifnet *ifp, int disable
 		}
 		sc->axen_ep[AXEN_ENDPT_INTR] = NULL;
 	}
-
-	sc->axen_link = 0;
 }
 
 MODULE(MODULE_CLASS_DRIVER, if_axen, NULL);

Index: src/sys/dev/usb/if_mue.c
diff -u src/sys/dev/usb/if_mue.c:1.31 src/sys/dev/usb/if_mue.c:1.32
--- src/sys/dev/usb/if_mue.c:1.31	Sun Feb  3 13:11:07 2019
+++ src/sys/dev/usb/if_mue.c	Wed Feb  6 08:16:49 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_mue.c,v 1.31 2019/02/03 13:11:07 mlelstv Exp $	*/
+/*	$NetBSD: if_mue.c,v 1.32 2019/02/06 08:16:49 rin Exp $	*/
 /*	$OpenBSD: if_mue.c,v 1.3 2018/08/04 16:42:46 jsg Exp $	*/
 
 /*
@@ -20,7 +20,7 @@
 /* Driver for Microchip LAN7500/LAN7800 chipsets. */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_mue.c,v 1.31 2019/02/03 13:11:07 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_mue.c,v 1.32 2019/02/06 08:16:49 rin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -1267,6 +1267,9 @@ mue_encap(struct mue_softc *sc, struct m
 	memcpy(c->mue_buf, , sizeof(hdr)); 
 	m_copydata(m, 0, len, c->mue_buf + sizeof(hdr));
 
+	if (__predict_false(c->mue_xfer == NULL))
+		return EIO;	/* XXX plugged out or down */
+
 	usbd_setup_xfer(c->mue_xfer, c, c->mue_buf, len + sizeof(hdr),
 	USBD_FORCE_SHORT_XFER, 1, mue_txeof);
 
@@ -1471,6 +1474,8 @@ mue_rxeof(struct usbd_xfer *xfer, void *
 
 	if (__predict_false(status != USBD_NORMAL_COMPLETION)) {
 		DPRINTF(sc, "%s\n", usbd_errstr(status));
+		if (status == USBD_INVAL)
+			return;	/* XXX plugged out or down */
 		if (status == USBD_NOT_STARTED || status == USBD_CANCELLED)
 			return;
 		if (usbd_ratecheck(>mue_rx_notice))
@@ -1833,6 +1838,7 @@ mue_stop(struct ifnet *ifp, int disable 
 	ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE);
 
 	callout_stop(>mue_stat_ch);
+	sc->mue_link = 0;
 
 /* Stop transfers. */
 	for (i = 0; i < __arraycount(sc->mue_ep); i++)
@@ -1869,8 +1875,6 @@ mue_stop(struct ifnet *ifp, int disable 
 			sc->mue_ep[i] = NULL;
 		}
 
-	sc->mue_link = 0; /* XXX */
-
 	DPRINTF(sc, "done\n");
 }
 



CVS commit: src/sys/dev/usb

2019-02-06 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Wed Feb  6 08:06:59 UTC 2019

Modified Files:
src/sys/dev/usb: if_axen.c if_axenreg.h

Log Message:
Enable multiple outstanding transfers.
XXX Linux driver uses much larger numbers of transfers.


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/sys/dev/usb/if_axen.c
cvs rdiff -u -r1.8 -r1.9 src/sys/dev/usb/if_axenreg.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_axen.c
diff -u src/sys/dev/usb/if_axen.c:1.32 src/sys/dev/usb/if_axen.c:1.33
--- src/sys/dev/usb/if_axen.c:1.32	Wed Feb  6 08:04:08 2019
+++ src/sys/dev/usb/if_axen.c	Wed Feb  6 08:06:59 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_axen.c,v 1.32 2019/02/06 08:04:08 rin Exp $	*/
+/*	$NetBSD: if_axen.c,v 1.33 2019/02/06 08:06:59 rin Exp $	*/
 /*	$OpenBSD: if_axen.c,v 1.3 2013/10/21 10:10:22 yuo Exp $	*/
 
 /*
@@ -23,7 +23,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_axen.c,v 1.32 2019/02/06 08:04:08 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_axen.c,v 1.33 2019/02/06 08:06:59 rin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -987,6 +987,8 @@ axen_tx_list_init(struct axen_softc *sc)
 		}
 	}
 
+	cd->axen_tx_prod = cd->axen_tx_cnt = 0;
+
 	return 0;
 }
 
@@ -1197,6 +1199,7 @@ axen_txeof(struct usbd_xfer *xfer, void 
 {
 	struct axen_chain *c = (struct axen_chain *)priv;
 	struct axen_softc *sc = c->axen_sc;
+	struct axen_cdata *cd = >axen_cdata;
 	struct ifnet *ifp = GET_IFP(sc);
 	int s;
 
@@ -1204,7 +1207,8 @@ axen_txeof(struct usbd_xfer *xfer, void 
 		return;
 
 	s = splnet();
-
+	KASSERT(cd->axen_tx_cnt > 0);
+	cd->axen_tx_cnt--;
 	if (status != USBD_NORMAL_COMPLETION) {
 		if (status == USBD_NOT_STARTED || status == USBD_CANCELLED) {
 			splx(s);
@@ -1328,18 +1332,16 @@ axen_encap(struct axen_softc *sc, struct
 		return EIO;
 	}
 
-	sc->axen_cdata.axen_tx_cnt++;
-
 	return 0;
 }
 
 static void
 axen_start(struct ifnet *ifp)
 {
-	struct axen_softc *sc;
+	struct axen_softc *sc = ifp->if_softc;
 	struct mbuf *m;
-
-	sc = ifp->if_softc;
+	struct axen_cdata *cd = >axen_cdata;
+	int idx;
 
 	if (sc->axen_link == 0)
 		return;
@@ -1347,24 +1349,33 @@ axen_start(struct ifnet *ifp)
 	if ((ifp->if_flags & (IFF_OACTIVE|IFF_RUNNING)) != IFF_RUNNING)
 		return;
 
-	IFQ_POLL(>if_snd, m);
-	if (m == NULL)
-		return;
+	idx = cd->axen_tx_prod;
+	while (cd->axen_tx_cnt < AXEN_TX_LIST_CNT) {
+		IFQ_POLL(>if_snd, m);
+		if (m == NULL)
+			break;
 
-	if (axen_encap(sc, m, 0)) {
-		ifp->if_flags |= IFF_OACTIVE;
-		return;
-	}
-	IFQ_DEQUEUE(>if_snd, m);
+		if (axen_encap(sc, m, idx)) {
+			ifp->if_flags |= IFF_OACTIVE; /* XXX */
+			ifp->if_oerrors++;
+			break;
+		}
+		IFQ_DEQUEUE(>if_snd, m);
 
-	/*
-	 * If there's a BPF listener, bounce a copy of this frame
-	 * to him.
-	 */
-	bpf_mtap(ifp, m, BPF_D_OUT);
-	m_freem(m);
+		/*
+		 * If there's a BPF listener, bounce a copy of this frame
+		 * to him.
+		 */
+		bpf_mtap(ifp, m, BPF_D_OUT);
+		m_freem(m);
 
-	ifp->if_flags |= IFF_OACTIVE;
+		idx = (idx + 1) % AXEN_TX_LIST_CNT;
+		cd->axen_tx_cnt++;
+	}
+	cd->axen_tx_prod = idx;
+
+	if (cd->axen_tx_cnt >= AXEN_TX_LIST_CNT)
+		ifp->if_flags |= IFF_OACTIVE;
 
 	/*
 	 * Set a timeout in case the chip goes out to lunch.

Index: src/sys/dev/usb/if_axenreg.h
diff -u src/sys/dev/usb/if_axenreg.h:1.8 src/sys/dev/usb/if_axenreg.h:1.9
--- src/sys/dev/usb/if_axenreg.h:1.8	Wed Feb  6 07:56:14 2019
+++ src/sys/dev/usb/if_axenreg.h	Wed Feb  6 08:06:59 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_axenreg.h,v 1.8 2019/02/06 07:56:14 rin Exp $	*/
+/*	$NetBSD: if_axenreg.h,v 1.9 2019/02/06 08:06:59 rin Exp $	*/
 /*	$OpenBSD: if_axenreg.h,v 1.1 2013/10/07 05:37:41 yuo Exp $	*/
 
 /*
@@ -210,8 +210,12 @@
 
 #define AXEN_TIMEOUT		1000
 
-#define AXEN_RX_LIST_CNT	1
-#define AXEN_TX_LIST_CNT	1
+#ifndef AXEN_RX_LIST_CNT
+#define AXEN_RX_LIST_CNT	4	/* 22 for SS mode in Linux driver */
+#endif
+#ifndef AXEN_TX_LIST_CNT
+#define AXEN_TX_LIST_CNT	4	/* 60 */
+#endif
 
 
 #define AXEN_CONFIG_NO		1



CVS commit: src/sys/dev/usb

2019-02-06 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Wed Feb  6 08:04:08 UTC 2019

Modified Files:
src/sys/dev/usb: if_axen.c

Log Message:
Add couple of error printf.

XXX We should not to use aprint_xxx() for non-autoconf staffs.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/dev/usb/if_axen.c

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

Modified files:

Index: src/sys/dev/usb/if_axen.c
diff -u src/sys/dev/usb/if_axen.c:1.31 src/sys/dev/usb/if_axen.c:1.32
--- src/sys/dev/usb/if_axen.c:1.31	Wed Feb  6 08:01:24 2019
+++ src/sys/dev/usb/if_axen.c	Wed Feb  6 08:04:08 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_axen.c,v 1.31 2019/02/06 08:01:24 rin Exp $	*/
+/*	$NetBSD: if_axen.c,v 1.32 2019/02/06 08:04:08 rin Exp $	*/
 /*	$OpenBSD: if_axen.c,v 1.3 2013/10/21 10:10:22 yuo Exp $	*/
 
 /*
@@ -23,7 +23,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_axen.c,v 1.31 2019/02/06 08:01:24 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_axen.c,v 1.32 2019/02/06 08:04:08 rin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -1033,6 +1033,7 @@ axen_rxeof(struct usbd_xfer *xfer, void 
 	usbd_get_xfer_status(xfer, NULL, NULL, _len, NULL);
 
 	if (total_len < sizeof(pkt_hdr)) {
+		aprint_error_dev(sc->axen_dev, "rxeof: too short transfer\n");
 		ifp->if_ierrors++;
 		goto done;
 	}
@@ -1054,6 +1055,7 @@ axen_rxeof(struct usbd_xfer *xfer, void 
 
 	/* sanity check */
 	if (hdr_offset > total_len) {
+		aprint_error_dev(sc->axen_dev, "rxeof: invalid hdr offset\n");
 		ifp->if_ierrors++;
 		usbd_delay_ms(sc->axen_udev, 100);
 		goto done;



CVS commit: src/sys/dev/usb

2019-02-06 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Wed Feb  6 08:01:24 UTC 2019

Modified Files:
src/sys/dev/usb: if_axen.c

Log Message:
Oops, fix previous again. Really support TSOv4.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/sys/dev/usb/if_axen.c

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

Modified files:

Index: src/sys/dev/usb/if_axen.c
diff -u src/sys/dev/usb/if_axen.c:1.30 src/sys/dev/usb/if_axen.c:1.31
--- src/sys/dev/usb/if_axen.c:1.30	Wed Feb  6 07:59:24 2019
+++ src/sys/dev/usb/if_axen.c	Wed Feb  6 08:01:24 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_axen.c,v 1.30 2019/02/06 07:59:24 rin Exp $	*/
+/*	$NetBSD: if_axen.c,v 1.31 2019/02/06 08:01:24 rin Exp $	*/
 /*	$OpenBSD: if_axen.c,v 1.3 2013/10/21 10:10:22 yuo Exp $	*/
 
 /*
@@ -23,7 +23,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_axen.c,v 1.30 2019/02/06 07:59:24 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_axen.c,v 1.31 2019/02/06 08:01:24 rin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -1305,7 +1305,8 @@ axen_encap(struct axen_softc *sc, struct
 
 	hdr.plen = htole32(m->m_pkthdr.len);
 
-	hdr.gso = 0; /* disable segmentation offloading */
+	hdr.gso = (m->m_pkthdr.csum_flags & M_CSUM_TSOv4) ?
+	m->m_pkthdr.segsz : 0;
 	if ((length % boundary) == 0) {
 		DPRINTF(("%s: boundary hit\n", device_xname(sc->axen_dev)));
 		hdr.gso |= 0x80008000;	/* XXX enable padding */