CVS commit: src/external/bsd/mdocml/dist

2019-03-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Mar 29 22:00:31 UTC 2019

Modified Files:
src/external/bsd/mdocml/dist: out.c

Log Message:
Set the maximum column index in a tbl(7) to the maximum *right* edge
of any cell span, not to the maximum *left* edge, which may be smaller
if the last column of the table is only reached by horizontal spans,
but not by any regular cell in any row of the table.
Otherwise, the algorithm calculating column widths accessed memomy
after the end of the colwidth[] array, while it was trying to handle
the rightmost column(s).

Crash reported by Jason Thorpe 
via https://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=54069
and via Thomas Klausner (wiz@).
Christos@ Zoulas sent a (correct, but slightly confusing) patch.
The patch i'm committing here is easier to understand.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/bsd/mdocml/dist/out.c

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



CVS commit: src/external/bsd/mdocml/dist

2019-03-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Mar 29 22:00:31 UTC 2019

Modified Files:
src/external/bsd/mdocml/dist: out.c

Log Message:
Set the maximum column index in a tbl(7) to the maximum *right* edge
of any cell span, not to the maximum *left* edge, which may be smaller
if the last column of the table is only reached by horizontal spans,
but not by any regular cell in any row of the table.
Otherwise, the algorithm calculating column widths accessed memomy
after the end of the colwidth[] array, while it was trying to handle
the rightmost column(s).

Crash reported by Jason Thorpe 
via https://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=54069
and via Thomas Klausner (wiz@).
Christos@ Zoulas sent a (correct, but slightly confusing) patch.
The patch i'm committing here is easier to understand.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/bsd/mdocml/dist/out.c

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

Modified files:

Index: src/external/bsd/mdocml/dist/out.c
diff -u src/external/bsd/mdocml/dist/out.c:1.4 src/external/bsd/mdocml/dist/out.c:1.5
--- src/external/bsd/mdocml/dist/out.c:1.4	Thu Mar 28 16:26:49 2019
+++ src/external/bsd/mdocml/dist/out.c	Fri Mar 29 18:00:31 2019
@@ -149,7 +149,7 @@ tblcalc(struct rofftbl *tbl, const struc
 		gp = _group;
 		for (dp = sp->first; dp != NULL; dp = dp->next) {
 			icol = dp->layout->col;
-			while (icol > maxcol)
+			while (maxcol < icol + dp->hspans)
 tbl->cols[++maxcol].spacing = SIZE_MAX;
 			col = tbl->cols + icol;
 			col->flags |= dp->layout->flags;
@@ -235,9 +235,6 @@ tblcalc(struct rofftbl *tbl, const struc
 			} else
 (*gp)->wanted -= width;
 		}
-		if (g->endcol > maxcol) {
-			maxcol = g->endcol;
-		}
 		if (done) {
 			*gp = g->next;
 			free(g);



CVS commit: src/usr.sbin/rtadvd

2019-03-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Mar 29 21:51:52 UTC 2019

Modified Files:
src/usr.sbin/rtadvd: rtadvd.c

Log Message:
- die sooner (if we got interrupted)
- when we finish resending exit.


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

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

Modified files:

Index: src/usr.sbin/rtadvd/rtadvd.c
diff -u src/usr.sbin/rtadvd/rtadvd.c:1.68 src/usr.sbin/rtadvd/rtadvd.c:1.69
--- src/usr.sbin/rtadvd/rtadvd.c:1.68	Sat Jan 12 14:09:25 2019
+++ src/usr.sbin/rtadvd/rtadvd.c	Fri Mar 29 17:51:52 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: rtadvd.c,v 1.68 2019/01/12 19:09:25 christos Exp $	*/
+/*	$NetBSD: rtadvd.c,v 1.69 2019/03/29 21:51:52 christos Exp $	*/
 /*	$KAME: rtadvd.c,v 1.92 2005/10/17 14:40:02 suz Exp $	*/
 
 /*
@@ -351,8 +351,11 @@ main(int argc, char *argv[])
 		(timeout->tv_nsec + 99) / 100) : INFTIM)) == -1)
 		{
 			/* EINTR would occur upon SIGUSR1 for status dump */
-			if (errno == EINTR)
+			if (errno == EINTR) {
+if (do_die)
+	die();
 continue;
+			}
 
 			logit(LOG_ERR, "%s: poll: %m", __func__);
 			if (Dflag)
@@ -445,6 +448,7 @@ die(void)
 		ra_timer_update(rai, >timer->tm);
 		rtadvd_set_timer(>timer->tm, rai->timer);
 	}
+	exit(EXIT_SUCCESS);
 }
 
 static void



CVS commit: src/usr.sbin/rtadvd

2019-03-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Mar 29 21:51:52 UTC 2019

Modified Files:
src/usr.sbin/rtadvd: rtadvd.c

Log Message:
- die sooner (if we got interrupted)
- when we finish resending exit.


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

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



CVS commit: src/etc/mtree

2019-03-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Mar 29 21:44:22 UTC 2019

Modified Files:
src/etc/mtree: NetBSD.dist.base special

Log Message:
For consistency use the user and group names for directory ownership.
Also do this for rtadvd, so that it can dump core.


To generate a diff of this commit:
cvs rdiff -u -r1.194 -r1.195 src/etc/mtree/NetBSD.dist.base
cvs rdiff -u -r1.164 -r1.165 src/etc/mtree/special

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

Modified files:

Index: src/etc/mtree/NetBSD.dist.base
diff -u src/etc/mtree/NetBSD.dist.base:1.194 src/etc/mtree/NetBSD.dist.base:1.195
--- src/etc/mtree/NetBSD.dist.base:1.194	Sat Feb 23 21:29:09 2019
+++ src/etc/mtree/NetBSD.dist.base	Fri Mar 29 17:44:22 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: NetBSD.dist.base,v 1.194 2019/02/24 02:29:09 rin Exp $
+#	$NetBSD: NetBSD.dist.base,v 1.195 2019/03/29 21:44:22 christos Exp $
 #	@(#)4.4BSD.dist	8.1 (Berkeley) 6/13/93
 
 # Do not customize this file as it may be overwritten on upgrades.
@@ -1273,9 +1273,9 @@
 ./var/chroot/named/usr
 ./var/chroot/named/usr/libexec
 ./var/chroot/named/var
-./var/chroot/named/var/run	mode=0775 gname=named
-./var/chroot/named/var/run/named	mode=0775 gname=named
-./var/chroot/named/var/tmp	mode=01775 gname=named
+./var/chroot/named/var/run	mode=0775 uname=named gname=named
+./var/chroot/named/var/run/named	mode=0775 uname=named gname=named
+./var/chroot/named/var/tmp	mode=01775 uname=named gname=named
 ./var/chroot/nsd		mode=0755 uname=_nsd gname=_nsd
 ./var/chroot/nsd/etc		mode=0755 uname=_nsd gname=_nsd
 ./var/chroot/nsd/etc/nsd	mode=0755 uname=_nsd gname=_nsd
@@ -1287,13 +1287,13 @@
 ./var/chroot/ntpd/dev
 ./var/chroot/ntpd/etc
 ./var/chroot/ntpd/var
-./var/chroot/ntpd/var/db	mode=0775 gname=ntpd
-./var/chroot/ntpd/var/run	mode=0775 gname=ntpd
+./var/chroot/ntpd/var/db	mode=0775 uname=ntpd gname=ntpd
+./var/chroot/ntpd/var/run	mode=0775 uname=ntpd gname=ntpd
 ./var/chroot/pflogd		mode=0755
-./var/chroot/rtadvd		type=dir  mode=0755
-./var/chroot/rtadvd/etc		type=dir  mode=0755
-./var/chroot/rtadvd/var		type=dir  mode=0755
-./var/chroot/rtadvd/var/run	type=dir  mode=0775 gname=_rtadvd
+./var/chroot/rtadvd		type=dir mode=0755 uname=_rtadvd gname=_rtadvd
+./var/chroot/rtadvd/etc		type=dir mode=0755 uname=_rtadvd gname=_rtadvd
+./var/chroot/rtadvd/var		type=dir mode=0755 uname=_rtadvd gname=_rtadvd
+./var/chroot/rtadvd/var/run	type=dir mode=0775 uname=_rtadvd gname=_rtadvd
 ./var/chroot/sshd		mode=0755
 ./var/chroot/tcpdump		mode=0755
 ./var/chroot/tftp-proxy		mode=0755
@@ -1301,7 +1301,7 @@
 ./var/chroot/unbound/etc	mode=0755 uname=_unbound gname=_unbound
 ./var/chroot/unbound/etc/unbound	mode=0755 uname=_unbound gname=_unbound
 ./var/chroot/unbound/var
-./var/chroot/unbound/var/run	mode=0775 gname=_unbound
+./var/chroot/unbound/var/run	mode=0775 uname=_unbound gname=_unbound
 ./var/crash			mode=0770
 ./var/cron
 ./var/cron/tabs			mode=0700
@@ -1325,7 +1325,7 @@
 ./var/preserve
 ./var/quotas			gname=operator mode=0750
 ./var/run
-./var/run/named			mode=0775 gname=named
+./var/run/named			mode=0775 uname=named gname=named
 ./var/rwho			uname=_rwhod gname=_rwhod
 ./var/shm			mode=01777
 ./var/spool

Index: src/etc/mtree/special
diff -u src/etc/mtree/special:1.164 src/etc/mtree/special:1.165
--- src/etc/mtree/special:1.164	Sun Sep 23 03:24:19 2018
+++ src/etc/mtree/special	Fri Mar 29 17:44:22 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: special,v 1.164 2018/09/23 07:24:19 maxv Exp $
+#	$NetBSD: special,v 1.165 2019/03/29 21:44:22 christos Exp $
 #	@(#)special	8.2 (Berkeley) 1/23/94
 #
 # This file may be overwritten on upgrades.
@@ -400,25 +400,25 @@
 ./var/chroot/named		type=dir  mode=0755
 ./var/chroot/named/dev		type=dir  mode=0755
 ./var/chroot/named/etc		type=dir  mode=0755
-./var/chroot/named/etc/namedb	type=dir  mode=0755
+./var/chroot/named/etc/namedb	type=dir  mode=0755 uname=named gname=named
 ./var/chroot/named/etc/namedb/cache	type=dir mode=0775 uname=named gname=named
 ./var/chroot/named/etc/namedb/keys	type=dir mode=0775 uname=named gname=named
 ./var/chroot/named/usr		type=dir  mode=0755
 ./var/chroot/named/usr/libexec	type=dir  mode=0755
 ./var/chroot/named/var		type=dir  mode=0755
-./var/chroot/named/var/run	type=dir  mode=0775 gname=named
-./var/chroot/named/var/tmp	type=dir  mode=01775 gname=named
+./var/chroot/named/var/run	type=dir  mode=0775 uname=named gname=named
+./var/chroot/named/var/tmp	type=dir  mode=01775 uname=named gname=named
 ./var/chroot/ntpd		type=dir  mode=0755
 ./var/chroot/ntpd/dev		type=dir  mode=0755
 ./var/chroot/ntpd/etc		type=dir  mode=0755
 ./var/chroot/ntpd/var		type=dir  mode=0755
-./var/chroot/ntpd/var/db	type=dir  mode=0775 gname=ntpd
-./var/chroot/ntpd/var/run	type=dir  mode=0775 gname=ntpd
+./var/chroot/ntpd/var/db	type=dir  mode=0775 uname=ntpd gname=ntpd
+./var/chroot/ntpd/var/run	type=dir  mode=0775 uname=ntpd gname=ntpd
 ./var/chroot/pflogd		type=dir  mode=0755

CVS commit: src/etc/mtree

2019-03-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Mar 29 21:44:22 UTC 2019

Modified Files:
src/etc/mtree: NetBSD.dist.base special

Log Message:
For consistency use the user and group names for directory ownership.
Also do this for rtadvd, so that it can dump core.


To generate a diff of this commit:
cvs rdiff -u -r1.194 -r1.195 src/etc/mtree/NetBSD.dist.base
cvs rdiff -u -r1.164 -r1.165 src/etc/mtree/special

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



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

2019-03-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Mar 29 21:06:51 UTC 2019

Modified Files:
src/sys/arch/zaurus/conf: GENERIC

Log Message:
bye ddb and we fit again.


To generate a diff of this commit:
cvs rdiff -u -r1.84 -r1.85 src/sys/arch/zaurus/conf/GENERIC

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



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

2019-03-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Mar 29 21:06:51 UTC 2019

Modified Files:
src/sys/arch/zaurus/conf: GENERIC

Log Message:
bye ddb and we fit again.


To generate a diff of this commit:
cvs rdiff -u -r1.84 -r1.85 src/sys/arch/zaurus/conf/GENERIC

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

Modified files:

Index: src/sys/arch/zaurus/conf/GENERIC
diff -u src/sys/arch/zaurus/conf/GENERIC:1.84 src/sys/arch/zaurus/conf/GENERIC:1.85
--- src/sys/arch/zaurus/conf/GENERIC:1.84	Thu Feb  7 16:53:50 2019
+++ src/sys/arch/zaurus/conf/GENERIC	Fri Mar 29 17:06:51 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: GENERIC,v 1.84 2019/02/07 21:53:50 rin Exp $
+#	$NetBSD: GENERIC,v 1.85 2019/03/29 21:06:51 christos Exp $
 #
 # GENERIC machine description file
 #
@@ -150,8 +150,8 @@ options 	WSDISPLAY_COMPAT_RAWKBD		# can 
 options 	DIAGNOSTIC		# internal consistency checks
 #options 	DEBUG
 #options 	VERBOSE_INIT_ARM	# verbose bootstraping messages
-options 	DDB			# in-kernel debugger
-options 	DDB_HISTORY_SIZE=100	# Enable history editing in DDB
+#options 	DDB			# in-kernel debugger
+#options 	DDB_HISTORY_SIZE=100	# Enable history editing in DDB
 #options 	KGDB
 #makeoptions 	DEBUG="-g"		# compile full symbol table
 makeoptions	COPY_SYMTAB=1



CVS commit: src/sys/arch/zaurus/zaurus

2019-03-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Mar 29 20:27:45 UTC 2019

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

Log Message:
Yes, we need to load symbols, but we don't need the whole DDB infrastructure
for that.


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

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



CVS commit: src/sys/arch/zaurus/zaurus

2019-03-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Mar 29 20:27:45 UTC 2019

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

Log Message:
Yes, we need to load symbols, but we don't need the whole DDB infrastructure
for that.


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/sys/arch/zaurus/zaurus/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/zaurus/zaurus/machdep.c
diff -u src/sys/arch/zaurus/zaurus/machdep.c:1.39 src/sys/arch/zaurus/zaurus/machdep.c:1.40
--- src/sys/arch/zaurus/zaurus/machdep.c:1.39	Sun Oct 28 10:30:33 2018
+++ src/sys/arch/zaurus/zaurus/machdep.c	Fri Mar 29 16:27:45 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.39 2018/10/28 14:30:33 skrll Exp $	*/
+/*	$NetBSD: machdep.c,v 1.40 2019/03/29 20:27:45 christos Exp $	*/
 /*	$OpenBSD: zaurus_machdep.c,v 1.25 2006/06/20 18:24:04 todd Exp $	*/
 
 /*
@@ -107,7 +107,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.39 2018/10/28 14:30:33 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.40 2019/03/29 20:27:45 christos Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -1109,9 +1109,13 @@ initarm(void *arg)
 	md_root_setconf(memory_disk, sizeof memory_disk);
 #endif
 
-#if NKSYMS || defined(DDB) || defined(MODULAR)
-	/* Firmware doesn't load symbols. */
+#if NKSYMS || defined(MODULAR)
+# ifdef DDB
 	ddb_init(0, NULL, NULL);
+# else
+	/* Firmware doesn't load symbols. */
+	ksyms_addsyms_elf(0, NULL, NULL);
+# endif
 #endif
 
 #ifdef KGDB



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

2019-03-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Mar 29 20:18:09 UTC 2019

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

Log Message:
remove extra token


To generate a diff of this commit:
cvs rdiff -u -r1.47 -r1.48 src/sys/arch/sparc/include/vmparam.h

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

Modified files:

Index: src/sys/arch/sparc/include/vmparam.h
diff -u src/sys/arch/sparc/include/vmparam.h:1.47 src/sys/arch/sparc/include/vmparam.h:1.48
--- src/sys/arch/sparc/include/vmparam.h:1.47	Fri Mar 29 08:51:15 2019
+++ src/sys/arch/sparc/include/vmparam.h	Fri Mar 29 16:18:09 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: vmparam.h,v 1.47 2019/03/29 12:51:15 christos Exp $ */
+/*	$NetBSD: vmparam.h,v 1.48 2019/03/29 20:18:09 christos Exp $ */
 
 /*
  * Copyright (c) 1992, 1993
@@ -74,7 +74,7 @@
 #define	PAGE_SHIFT		PAGE_SHIFT_SUN4
 #endif
 
-#ifdef	PAGE_SHIFT		PAGE_SHIFT_SUN4
+#ifdef	PAGE_SHIFT
 #define	PAGE_SIZE		(1 << PAGE_SHIFT)
 #define	PAGE_MASK		(PAGE_SIZE - 1)
 #endif



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

2019-03-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Mar 29 20:18:09 UTC 2019

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

Log Message:
remove extra token


To generate a diff of this commit:
cvs rdiff -u -r1.47 -r1.48 src/sys/arch/sparc/include/vmparam.h

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



CVS commit: [netbsd-8] src/doc

2019-03-29 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Mar 29 19:59:40 UTC 2019

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

Log Message:
Tickets #1220, #1221, #1224


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.120 -r1.1.2.121 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.120 src/doc/CHANGES-8.1:1.1.2.121
--- src/doc/CHANGES-8.1:1.1.2.120	Thu Mar 21 14:27:47 2019
+++ src/doc/CHANGES-8.1	Fri Mar 29 19:59:40 2019
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-8.1,v 1.1.2.120 2019/03/21 14:27:47 martin Exp $
+# $NetBSD: CHANGES-8.1,v 1.1.2.121 2019/03/29 19:59:40 martin Exp $
 
 A complete list of changes from the NetBSD 8.0 release to the NetBSD 8.1
 release:
@@ -2745,3 +2745,34 @@ sys/arch/x86/pci/if_vmx.c			1.27
 	is not a power of two.
 	[nonaka, ticket #1219]
 
+sys/arch/amd64/include/param.h			1.30
+
+	Bump STACK_ALIGNBYTES to (16 - 1) to satisfy requirement by AMD64
+	System V ABI at kernel level.
+	[rin, ticket #1220]
+
+sbin/dump/dump.81.69,1.71
+sbin/dump/dump.h1.56,1.57
+sbin/dump/ffs_inode.c1.23
+sbin/dump/itime.c1.21,1.22
+sbin/dump/main.c1.74,1.75
+sbin/dump/optr.c1.43
+sbin/dump/tape.c1.55
+sbin/dump/traverse.c1.52
+sbin/dump_lfs/dump_lfs.8			1.18
+
+	Improve dump(8) and dump_lfs(8) selection of entries in /etc/dumpdates
+	- detect devices specified as NAME= in /etc/fstab
+	- add -U flag to manually specify the /etc/dumpdates entry
+	Miscelaneous documentation updates.
+	[manu, ticket #1221]
+
+sys/dev/mii/tlphy.c1.65
+sys/dev/usb/if_aue.c1.148
+sys/dev/usb/if_url.c1.62
+
+	mii_phy_add_media() automatically install power handler,
+	but if_media_add() doesn't. When mii_phy_add_media() isn't used,
+	call pmf_device_register().
+	[msaitoh, ticket #1224]
+



CVS commit: [netbsd-8] src/doc

2019-03-29 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Mar 29 19:59:40 UTC 2019

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

Log Message:
Tickets #1220, #1221, #1224


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

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



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

2019-03-29 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Mar 29 19:48:36 UTC 2019

Modified Files:
src/sys/dev/mii [netbsd-8]: tlphy.c
src/sys/dev/usb [netbsd-8]: if_aue.c if_url.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1224):

sys/dev/mii/tlphy.c: revision 1.65
sys/dev/usb/if_url.c: revision 1.62
sys/dev/usb/if_aue.c: revision 1.148

  mii_phy_add_media() automatically install power handler, but if_media_add()
doesn't. When mii_phy_add_media() isn't used, call pmf_device_register().

 -

  Use pmf(9).

 -

  Use pmf(9).


To generate a diff of this commit:
cvs rdiff -u -r1.62 -r1.62.20.1 src/sys/dev/mii/tlphy.c
cvs rdiff -u -r1.141.8.2 -r1.141.8.3 src/sys/dev/usb/if_aue.c
cvs rdiff -u -r1.56.8.2 -r1.56.8.3 src/sys/dev/usb/if_url.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/mii/tlphy.c
diff -u src/sys/dev/mii/tlphy.c:1.62 src/sys/dev/mii/tlphy.c:1.62.20.1
--- src/sys/dev/mii/tlphy.c:1.62	Mon Jun 16 16:48:16 2014
+++ src/sys/dev/mii/tlphy.c	Fri Mar 29 19:48:35 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: tlphy.c,v 1.62 2014/06/16 16:48:16 msaitoh Exp $	*/
+/*	$NetBSD: tlphy.c,v 1.62.20.1 2019/03/29 19:48:35 martin Exp $	*/
 
 /*-
  * Copyright (c) 1998, 1999, 2000 The NetBSD Foundation, Inc.
@@ -59,7 +59,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: tlphy.c,v 1.62 2014/06/16 16:48:16 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tlphy.c,v 1.62.20.1 2019/03/29 19:48:35 martin Exp $");
 
 #include 
 #include 
@@ -183,12 +183,19 @@ tlphyattach(device_t parent, device_t se
 	if (sc->mii_capabilities & BMSR_MEDIAMASK) {
 		aprint_normal("%s", sep);
 		mii_phy_add_media(sc);
-	} else if ((tsc->sc_tlphycap &
+	} else {
+		if ((tsc->sc_tlphycap &
 		(TLPHY_MEDIA_10_2 | TLPHY_MEDIA_10_5)) == 0)
-		aprint_error("no media present");
-	else if (!pmf_device_register(self, NULL, mii_phy_resume)) {
-		aprint_normal("\n");
-		aprint_error_dev(self, "couldn't establish power handler");
+			aprint_error("no media present");
+		/*
+		 * mii_phy_add_media() automatically install power handler,
+		 * but if_media_add() doesn't. Do it now.
+		 */
+		if (!pmf_device_register(self, NULL, mii_phy_resume)) {
+			aprint_normal("\n");
+			aprint_error_dev(self,
+			"couldn't establish power handler");
+		}
 	}
 	aprint_normal("\n");
 #undef ADD

Index: src/sys/dev/usb/if_aue.c
diff -u src/sys/dev/usb/if_aue.c:1.141.8.2 src/sys/dev/usb/if_aue.c:1.141.8.3
--- src/sys/dev/usb/if_aue.c:1.141.8.2	Wed Aug  8 10:28:35 2018
+++ src/sys/dev/usb/if_aue.c	Fri Mar 29 19:48:36 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_aue.c,v 1.141.8.2 2018/08/08 10:28:35 martin Exp $	*/
+/*	$NetBSD: if_aue.c,v 1.141.8.3 2019/03/29 19:48:36 martin Exp $	*/
 
 /*
  * Copyright (c) 1997, 1998, 1999, 2000
@@ -78,7 +78,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_aue.c,v 1.141.8.2 2018/08/08 10:28:35 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_aue.c,v 1.141.8.3 2019/03/29 19:48:36 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -869,6 +869,9 @@ aue_attach(device_t parent, device_t sel
 
 	usbd_add_drv_event(USB_EVENT_DRIVER_ATTACH, sc->aue_udev, sc->aue_dev);
 
+	if (!pmf_device_register(self, NULL, NULL))
+		aprint_error_dev(self, "couldn't establish power handler\n");
+
 	return;
 }
 
@@ -886,6 +889,8 @@ aue_detach(device_t self, int flags)
 		return 0;
 	}
 
+	pmf_device_deregister(self);
+
 	/*
 	 * XXX Halting callout guarantees no more tick tasks.  What
 	 * guarantees no more stop tasks?  What guarantees no more

Index: src/sys/dev/usb/if_url.c
diff -u src/sys/dev/usb/if_url.c:1.56.8.2 src/sys/dev/usb/if_url.c:1.56.8.3
--- src/sys/dev/usb/if_url.c:1.56.8.2	Wed Aug  8 10:28:35 2018
+++ src/sys/dev/usb/if_url.c	Fri Mar 29 19:48:35 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_url.c,v 1.56.8.2 2018/08/08 10:28:35 martin Exp $	*/
+/*	$NetBSD: if_url.c,v 1.56.8.3 2019/03/29 19:48:35 martin Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002
@@ -44,7 +44,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_url.c,v 1.56.8.2 2018/08/08 10:28:35 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_url.c,v 1.56.8.3 2019/03/29 19:48:35 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -325,6 +325,9 @@ url_attach(device_t parent, device_t sel
 
 	usbd_add_drv_event(USB_EVENT_DRIVER_ATTACH, dev, sc->sc_dev);
 
+	if (!pmf_device_register(self, NULL, NULL))
+		aprint_error_dev(self, "couldn't establish power handler\n");
+
 	return;
 
  bad:
@@ -346,6 +349,8 @@ url_detach(device_t self, int flags)
 	if (!sc->sc_attached)
 		return 0;
 
+	pmf_device_deregister(self);
+
 	/*
 	 * XXX Halting callout guarantees no more tick tasks.  What
 	 * guarantees no more stop tasks?  What guarantees no more



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

2019-03-29 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Mar 29 19:48:36 UTC 2019

Modified Files:
src/sys/dev/mii [netbsd-8]: tlphy.c
src/sys/dev/usb [netbsd-8]: if_aue.c if_url.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1224):

sys/dev/mii/tlphy.c: revision 1.65
sys/dev/usb/if_url.c: revision 1.62
sys/dev/usb/if_aue.c: revision 1.148

  mii_phy_add_media() automatically install power handler, but if_media_add()
doesn't. When mii_phy_add_media() isn't used, call pmf_device_register().

 -

  Use pmf(9).

 -

  Use pmf(9).


To generate a diff of this commit:
cvs rdiff -u -r1.62 -r1.62.20.1 src/sys/dev/mii/tlphy.c
cvs rdiff -u -r1.141.8.2 -r1.141.8.3 src/sys/dev/usb/if_aue.c
cvs rdiff -u -r1.56.8.2 -r1.56.8.3 src/sys/dev/usb/if_url.c

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



CVS commit: [netbsd-8] src/sbin

2019-03-29 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Mar 29 19:43:28 UTC 2019

Modified Files:
src/sbin/dump [netbsd-8]: dump.8 dump.h ffs_inode.c itime.c main.c
optr.c tape.c traverse.c
src/sbin/dump_lfs [netbsd-8]: dump_lfs.8

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

sbin/dump/tape.c: revision 1.55
sbin/dump_lfs/dump_lfs.8: revision 1.18
sbin/dump/dump.h: revision 1.56
sbin/dump/dump.8: revision 1.69
sbin/dump/dump.h: revision 1.57
sbin/dump/ffs_inode.c: revision 1.23
sbin/dump/optr.c: revision 1.43
sbin/dump/itime.c: revision 1.21
sbin/dump/main.c: revision 1.74
sbin/dump/itime.c: revision 1.22
sbin/dump/main.c: revision 1.75
sbin/dump/dump.8: revision 1.70
sbin/dump/traverse.c: revision 1.52
sbin/dump/dump.8: revision 1.71

Document what rdump is (was once) for. PR 53442.

Use getfsspecname() to fill the filesystem argument in dumpdates.
While here, make sure that the error strings terminate with newline
consistently, and add a function that adds the system error string.

Add -U flag to dump(8) and dump_lfs(8) to specify dumpdates entry
This address situations where dump(8) cannot figure out the device being
dumped. It also allows tracking of subvolume dumps by using virtual
device as dumpdates entry.

Bump date for previous.


To generate a diff of this commit:
cvs rdiff -u -r1.68 -r1.68.6.1 src/sbin/dump/dump.8
cvs rdiff -u -r1.54 -r1.54.8.1 src/sbin/dump/dump.h src/sbin/dump/tape.c
cvs rdiff -u -r1.22 -r1.22.20.1 src/sbin/dump/ffs_inode.c
cvs rdiff -u -r1.20 -r1.20.20.1 src/sbin/dump/itime.c
cvs rdiff -u -r1.73 -r1.73.8.1 src/sbin/dump/main.c
cvs rdiff -u -r1.42 -r1.42.18.1 src/sbin/dump/optr.c
cvs rdiff -u -r1.50 -r1.50.20.1 src/sbin/dump/traverse.c
cvs rdiff -u -r1.16 -r1.16.24.1 src/sbin/dump_lfs/dump_lfs.8

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



CVS commit: [netbsd-8] src/sbin

2019-03-29 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Mar 29 19:43:28 UTC 2019

Modified Files:
src/sbin/dump [netbsd-8]: dump.8 dump.h ffs_inode.c itime.c main.c
optr.c tape.c traverse.c
src/sbin/dump_lfs [netbsd-8]: dump_lfs.8

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

sbin/dump/tape.c: revision 1.55
sbin/dump_lfs/dump_lfs.8: revision 1.18
sbin/dump/dump.h: revision 1.56
sbin/dump/dump.8: revision 1.69
sbin/dump/dump.h: revision 1.57
sbin/dump/ffs_inode.c: revision 1.23
sbin/dump/optr.c: revision 1.43
sbin/dump/itime.c: revision 1.21
sbin/dump/main.c: revision 1.74
sbin/dump/itime.c: revision 1.22
sbin/dump/main.c: revision 1.75
sbin/dump/dump.8: revision 1.70
sbin/dump/traverse.c: revision 1.52
sbin/dump/dump.8: revision 1.71

Document what rdump is (was once) for. PR 53442.

Use getfsspecname() to fill the filesystem argument in dumpdates.
While here, make sure that the error strings terminate with newline
consistently, and add a function that adds the system error string.

Add -U flag to dump(8) and dump_lfs(8) to specify dumpdates entry
This address situations where dump(8) cannot figure out the device being
dumped. It also allows tracking of subvolume dumps by using virtual
device as dumpdates entry.

Bump date for previous.


To generate a diff of this commit:
cvs rdiff -u -r1.68 -r1.68.6.1 src/sbin/dump/dump.8
cvs rdiff -u -r1.54 -r1.54.8.1 src/sbin/dump/dump.h src/sbin/dump/tape.c
cvs rdiff -u -r1.22 -r1.22.20.1 src/sbin/dump/ffs_inode.c
cvs rdiff -u -r1.20 -r1.20.20.1 src/sbin/dump/itime.c
cvs rdiff -u -r1.73 -r1.73.8.1 src/sbin/dump/main.c
cvs rdiff -u -r1.42 -r1.42.18.1 src/sbin/dump/optr.c
cvs rdiff -u -r1.50 -r1.50.20.1 src/sbin/dump/traverse.c
cvs rdiff -u -r1.16 -r1.16.24.1 src/sbin/dump_lfs/dump_lfs.8

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

Modified files:

Index: src/sbin/dump/dump.8
diff -u src/sbin/dump/dump.8:1.68 src/sbin/dump/dump.8:1.68.6.1
--- src/sbin/dump/dump.8:1.68	Mon Aug 15 00:03:14 2016
+++ src/sbin/dump/dump.8	Fri Mar 29 19:43:28 2019
@@ -1,4 +1,4 @@
-.\"	$NetBSD: dump.8,v 1.68 2016/08/15 00:03:14 sevan Exp $
+.\"	$NetBSD: dump.8,v 1.68.6.1 2019/03/29 19:43:28 martin Exp $
 .\"
 .\" Copyright (c) 1980, 1991, 1993
 .\"	 Regents of the University of California.
@@ -30,7 +30,7 @@
 .\"
 .\" @(#)dump.8	8.3 (Berkeley) 5/1/95
 .\"
-.Dd August 15, 2016
+.Dd March 25, 2019
 .Dt DUMP 8
 .Os
 .Sh NAME
@@ -51,6 +51,7 @@
 .Op Fl r Ar cachesize
 .Op Fl s Ar feet
 .Op Fl T Ar date
+.Op Fl U Ar dumpdev
 .Op Fl x Ar snap-backup
 .Ar files-to-dump
 .Nm
@@ -299,10 +300,22 @@ The file
 .Pa /etc/dumpdates
 may be edited to change any of the fields,
 if necessary.
-If a list of files or subdirectories is being dumped
+If the
+.Fl T
+option is used or if a list of files or subdirectories is being dumped
 (as opposed to an entire file system), then
 .Fl u
 is ignored.
+.It Fl U Ar dumpdev
+Same as
+.Fl u
+but specifies the device in
+.Pa /etc/dumpdates
+as
+.Ar dumpdev .
+This option can be used with subdir dumps and with the
+.Fl T
+option.
 .It Fl W
 .Nm
 tells the operator what file systems need to be dumped.
@@ -449,6 +462,13 @@ argument of
 whilst a backup is in progress, statistics on the amount completed,
 current transfer rate, and estimated finished time, will be written
 to the standard error output.
+.Pp
+The historic alternate name
+.Nm rdump
+was once required when dumping to a remote host.
+This functionality is now built into
+.Nm
+itself.
 .Sh ENVIRONMENT
 If the following environment variables exist, they are used by
 .Nm .

Index: src/sbin/dump/dump.h
diff -u src/sbin/dump/dump.h:1.54 src/sbin/dump/dump.h:1.54.8.1
--- src/sbin/dump/dump.h:1.54	Mon Nov 16 17:06:47 2015
+++ src/sbin/dump/dump.h	Fri Mar 29 19:43:28 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: dump.h,v 1.54 2015/11/16 17:06:47 christos Exp $	*/
+/*	$NetBSD: dump.h,v 1.54.8.1 2019/03/29 19:43:28 martin Exp $	*/
 
 /*-
  * Copyright (c) 1980, 1993
@@ -115,6 +115,7 @@ const char *temp;	/* name of the file fo
 char	lastlevel;	/* dump level of previous dump */
 char	level;		/* dump level of this dump */
 int	uflag;		/* update flag */
+const char *dumpdev;	/* device name in dumpdates */
 int	eflag;		/* eject flag */
 int	lflag;		/* autoload flag */
 int	diskfd;		/* disk file descriptor */
@@ -185,10 +186,11 @@ void	fs_mapinodes(ino_t, u_int64_t *, in
 /* operator interface functions */
 void	broadcast(const char *);
 void	lastdump(char);
-void	msg(const char *fmt, ...) __printflike(1, 2);
-void	msgtail(const char *fmt, ...) __printflike(1, 2);
+void	msg(const char *, ...) __printflike(1, 2);
+void	msgtail(const char *, ...) __printflike(1, 2);
 int	query(const char *);
-void	quit(const char *fmt, ...) __printflike(1, 2);
+void	quit(const char *, ...) __printflike(1, 2);

CVS commit: [netbsd-8] src/sys/arch/amd64/include

2019-03-29 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Mar 29 19:39:06 UTC 2019

Modified Files:
src/sys/arch/amd64/include [netbsd-8]: param.h

Log Message:
Pull up following revision(s) (requested by rin in ticket #1220):

sys/arch/amd64/include/param.h: revision 1.30

Bump STACK_ALIGNBYTES to (16 - 1) to satisfy requirement by AMD64
System V ABI in kernel level. This is because

(1) for LLDB, we want to bypass libc/csu (and therefore manual stack
 alignment in _start), and
(2) rtld in glibc >= 2.23 for Linux/x86_64 requires it.

Fix SEGV for Linux/x86_64 binaries with glibc >= 2.23, reported as

PR port-amd64/54052.


To generate a diff of this commit:
cvs rdiff -u -r1.21.6.3 -r1.21.6.4 src/sys/arch/amd64/include/param.h

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



CVS commit: [netbsd-8] src/sys/arch/amd64/include

2019-03-29 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Mar 29 19:39:06 UTC 2019

Modified Files:
src/sys/arch/amd64/include [netbsd-8]: param.h

Log Message:
Pull up following revision(s) (requested by rin in ticket #1220):

sys/arch/amd64/include/param.h: revision 1.30

Bump STACK_ALIGNBYTES to (16 - 1) to satisfy requirement by AMD64
System V ABI in kernel level. This is because

(1) for LLDB, we want to bypass libc/csu (and therefore manual stack
 alignment in _start), and
(2) rtld in glibc >= 2.23 for Linux/x86_64 requires it.

Fix SEGV for Linux/x86_64 binaries with glibc >= 2.23, reported as

PR port-amd64/54052.


To generate a diff of this commit:
cvs rdiff -u -r1.21.6.3 -r1.21.6.4 src/sys/arch/amd64/include/param.h

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

Modified files:

Index: src/sys/arch/amd64/include/param.h
diff -u src/sys/arch/amd64/include/param.h:1.21.6.3 src/sys/arch/amd64/include/param.h:1.21.6.4
--- src/sys/arch/amd64/include/param.h:1.21.6.3	Wed Apr 11 14:43:23 2018
+++ src/sys/arch/amd64/include/param.h	Fri Mar 29 19:39:06 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: param.h,v 1.21.6.3 2018/04/11 14:43:23 martin Exp $	*/
+/*	$NetBSD: param.h,v 1.21.6.4 2019/03/29 19:39:06 martin Exp $	*/
 
 #ifdef __x86_64__
 
@@ -19,6 +19,13 @@
 
 #define ALIGNED_POINTER(p,t)	1
 
+/*
+ * Align stack as required by AMD64 System V ABI. This is because
+ * (1) we want to bypass libc/csu in LLDB, and
+ * (2) rtld in glibc >= 2.23 for Linux/x86_64 requires it.
+ */
+#define STACK_ALIGNBYTES	(16 - 1)
+
 #define ALIGNBYTES32		(sizeof(int) - 1)
 #define ALIGN32(p)		(((u_long)(p) + ALIGNBYTES32) &~ALIGNBYTES32)
 



CVS commit: src/lib/libcurses

2019-03-29 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Fri Mar 29 18:32:45 UTC 2019

Modified Files:
src/lib/libcurses: refresh.c

Log Message:
Minor adjustment to prior to match putch


To generate a diff of this commit:
cvs rdiff -u -r1.106 -r1.107 src/lib/libcurses/refresh.c

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

Modified files:

Index: src/lib/libcurses/refresh.c
diff -u src/lib/libcurses/refresh.c:1.106 src/lib/libcurses/refresh.c:1.107
--- src/lib/libcurses/refresh.c:1.106	Fri Mar 29 16:56:58 2019
+++ src/lib/libcurses/refresh.c	Fri Mar 29 18:32:45 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: refresh.c,v 1.106 2019/03/29 16:56:58 roy Exp $	*/
+/*	$NetBSD: refresh.c,v 1.107 2019/03/29 18:32:45 roy Exp $	*/
 
 /*
  * Copyright (c) 1981, 1993, 1994
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)refresh.c	8.7 (Berkeley) 8/13/94";
 #else
-__RCSID("$NetBSD: refresh.c,v 1.106 2019/03/29 16:56:58 roy Exp $");
+__RCSID("$NetBSD: refresh.c,v 1.107 2019/03/29 18:32:45 roy Exp $");
 #endif
 #endif/* not lint */
 
@@ -1317,7 +1317,7 @@ makech(int wy)
 #ifdef HAVE_WCHAR
 			chw = WCOL(*nsp);
 			if (chw < 0)
-chw = 1;
+chw = 0; /* match putch() */
 #else
 			chw = 1;
 #endif /* HAVE_WCHAR */



CVS commit: src/lib/libcurses

2019-03-29 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Fri Mar 29 18:32:45 UTC 2019

Modified Files:
src/lib/libcurses: refresh.c

Log Message:
Minor adjustment to prior to match putch


To generate a diff of this commit:
cvs rdiff -u -r1.106 -r1.107 src/lib/libcurses/refresh.c

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



CVS commit: src/lib/libcurses

2019-03-29 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Fri Mar 29 16:56:58 UTC 2019

Modified Files:
src/lib/libcurses: refresh.c

Log Message:
Use WCOL rather than wcwidth(3) as we should already know the width
during refresh.
Ensure the character width is not negative when advancing during refresh
(unlikely) and we actually have something to insert in the lower right
corner depending on terminal caps.

Fixes PR lib/54085


To generate a diff of this commit:
cvs rdiff -u -r1.105 -r1.106 src/lib/libcurses/refresh.c

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

Modified files:

Index: src/lib/libcurses/refresh.c
diff -u src/lib/libcurses/refresh.c:1.105 src/lib/libcurses/refresh.c:1.106
--- src/lib/libcurses/refresh.c:1.105	Sun Jan  6 04:27:53 2019
+++ src/lib/libcurses/refresh.c	Fri Mar 29 16:56:58 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: refresh.c,v 1.105 2019/01/06 04:27:53 uwe Exp $	*/
+/*	$NetBSD: refresh.c,v 1.106 2019/03/29 16:56:58 roy Exp $	*/
 
 /*
  * Copyright (c) 1981, 1993, 1994
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)refresh.c	8.7 (Berkeley) 8/13/94";
 #else
-__RCSID("$NetBSD: refresh.c,v 1.105 2019/01/06 04:27:53 uwe Exp $");
+__RCSID("$NetBSD: refresh.c,v 1.106 2019/03/29 16:56:58 roy Exp $");
 #endif
 #endif/* not lint */
 
@@ -1042,16 +1042,14 @@ putchbr(__LDATA *nsp, __LDATA *csp, __LD
 		return error;
 	}
 
-	/* We need to insert characters.
-	 * To do this, work out their widths.
-	 * XXX This does not work when the bottom right corner is an ACS. */
+	/* We need to insert characters. */
 #ifdef HAVE_WCHAR
-	cw = wcwidth(nsp->ch);
-	pcw = psp == NULL ? 0 : wcwidth(psp->ch);
-	if (pcw < 1)
+	cw = WCOL(*nsp);
+	pcw = WCOL(*psp);
+	if (cw < 1 || pcw < 1)
 		return ERR; /* Nothing to insert */
 
-	/* When wide characters we need something other than
+	/* When inserting a wide character, we need something other than
 	 * insert_character. */
 	if (pcw > 1 &&
 	!(parm_ich != NULL ||
@@ -1317,7 +1315,9 @@ makech(int wy)
 			}
 
 #ifdef HAVE_WCHAR
-			chw = wcwidth(nsp->ch);
+			chw = WCOL(*nsp);
+			if (chw < 0)
+chw = 1;
 #else
 			chw = 1;
 #endif /* HAVE_WCHAR */



CVS commit: src/lib/libcurses

2019-03-29 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Fri Mar 29 16:56:58 UTC 2019

Modified Files:
src/lib/libcurses: refresh.c

Log Message:
Use WCOL rather than wcwidth(3) as we should already know the width
during refresh.
Ensure the character width is not negative when advancing during refresh
(unlikely) and we actually have something to insert in the lower right
corner depending on terminal caps.

Fixes PR lib/54085


To generate a diff of this commit:
cvs rdiff -u -r1.105 -r1.106 src/lib/libcurses/refresh.c

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



CVS commit: src/distrib/acorn32/ramdisk

2019-03-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Mar 29 16:08:06 UTC 2019

Modified Files:
src/distrib/acorn32/ramdisk: Makefile

Log Message:
Bumpity bump bump


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/distrib/acorn32/ramdisk/Makefile

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



CVS commit: src/distrib/acorn32/ramdisk

2019-03-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Mar 29 16:08:06 UTC 2019

Modified Files:
src/distrib/acorn32/ramdisk: Makefile

Log Message:
Bumpity bump bump


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/distrib/acorn32/ramdisk/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/acorn32/ramdisk/Makefile
diff -u src/distrib/acorn32/ramdisk/Makefile:1.26 src/distrib/acorn32/ramdisk/Makefile:1.27
--- src/distrib/acorn32/ramdisk/Makefile:1.26	Thu Feb  7 18:11:10 2019
+++ src/distrib/acorn32/ramdisk/Makefile	Fri Mar 29 12:08:06 2019
@@ -1,10 +1,10 @@
-#	$NetBSD: Makefile,v 1.26 2019/02/07 23:11:10 mrg Exp $
+#	$NetBSD: Makefile,v 1.27 2019/03/29 16:08:06 christos Exp $
 
 .include 
 .include "${NETBSDSRCDIR}/distrib/common/Makefile.distrib"
 
 IMAGE=		ramdisk.fs
-IMAGESIZE=	2400k
+IMAGESIZE=	2900k
 MAKEFS_FLAGS+=	-f 15
 
 WARNS=		1



CVS commit: src/external/mit/xorg/bin/xdm/config

2019-03-29 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Mar 29 16:07:01 UTC 2019

Modified Files:
src/external/mit/xorg/bin/xdm/config: Xresources.in

Log Message:
Fix edit accident in previous


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/mit/xorg/bin/xdm/config/Xresources.in

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



CVS commit: src/external/mit/xorg/bin/xdm/config

2019-03-29 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Mar 29 16:07:01 UTC 2019

Modified Files:
src/external/mit/xorg/bin/xdm/config: Xresources.in

Log Message:
Fix edit accident in previous


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/mit/xorg/bin/xdm/config/Xresources.in

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

Modified files:

Index: src/external/mit/xorg/bin/xdm/config/Xresources.in
diff -u src/external/mit/xorg/bin/xdm/config/Xresources.in:1.3 src/external/mit/xorg/bin/xdm/config/Xresources.in:1.4
--- src/external/mit/xorg/bin/xdm/config/Xresources.in:1.3	Fri Mar 29 15:56:43 2019
+++ src/external/mit/xorg/bin/xdm/config/Xresources.in	Fri Mar 29 16:07:01 2019
@@ -44,7 +44,7 @@ xlogin*innerFramesWidth: 2
 xlogin*shdColor: grey30
 xlogin*hiColor: grey90
 xlogin*background: grey
-xlogin*inpCollor: grey
+xlogin*inpColor: grey
 !xlogin*foreground: darkgreen
 xlogin*greetColor: Blue3
 xlogin*failColor: red



CVS commit: src/distrib/pmax/ramdisk

2019-03-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Mar 29 16:06:28 UTC 2019

Modified Files:
src/distrib/pmax/ramdisk: Makefile

Log Message:
Bumpity bump bump


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/distrib/pmax/ramdisk/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/pmax/ramdisk/Makefile
diff -u src/distrib/pmax/ramdisk/Makefile:1.49 src/distrib/pmax/ramdisk/Makefile:1.50
--- src/distrib/pmax/ramdisk/Makefile:1.49	Wed Feb 13 02:55:33 2019
+++ src/distrib/pmax/ramdisk/Makefile	Fri Mar 29 12:06:28 2019
@@ -1,11 +1,11 @@
-#	$NetBSD: Makefile,v 1.49 2019/02/13 07:55:33 gson Exp $
+#	$NetBSD: Makefile,v 1.50 2019/03/29 16:06:28 christos Exp $
 
 .include 
 .include "${NETBSDSRCDIR}/distrib/common/Makefile.distrib"
 
 IMAGE=		ramdisk.fs
 IMAGETAR=	diskimage.tgz
-IMAGESIZE=	3600k
+IMAGESIZE=	4000k
 MAKEFS_FLAGS+=	-f 15
 
 WARNS=		1



CVS commit: src/distrib/pmax/ramdisk

2019-03-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Mar 29 16:06:28 UTC 2019

Modified Files:
src/distrib/pmax/ramdisk: Makefile

Log Message:
Bumpity bump bump


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/distrib/pmax/ramdisk/Makefile

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



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

2019-03-29 Thread Sean Cole
Module Name:src
Committed By:   scole
Date:   Fri Mar 29 16:04:54 UTC 2019

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

Log Message:
Remove SGROWSIZ parameter which looks like it was imported from FreeBSD and not 
use with NetBSD


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/ia64/include/vmparam.h

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



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

2019-03-29 Thread Sean Cole
Module Name:src
Committed By:   scole
Date:   Fri Mar 29 16:04:54 UTC 2019

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

Log Message:
Remove SGROWSIZ parameter which looks like it was imported from FreeBSD and not 
use with NetBSD


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/ia64/include/vmparam.h

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

Modified files:

Index: src/sys/arch/ia64/include/vmparam.h
diff -u src/sys/arch/ia64/include/vmparam.h:1.10 src/sys/arch/ia64/include/vmparam.h:1.11
--- src/sys/arch/ia64/include/vmparam.h:1.10	Sat Apr  8 18:05:36 2017
+++ src/sys/arch/ia64/include/vmparam.h	Fri Mar 29 16:04:54 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: vmparam.h,v 1.10 2017/04/08 18:05:36 scole Exp $	*/
+/*	$NetBSD: vmparam.h,v 1.11 2019/03/29 16:04:54 scole Exp $	*/
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -57,9 +57,6 @@
 #ifndef	MAXSSIZ
 #define	MAXSSIZ		(1<<28)			/* max stack size (256M) */
 #endif
-#ifndef SGROWSIZ
-#define SGROWSIZ	(128UL*1024)		/* amount to grow stack */
-#endif
 
 #define	IA64_VM_MINKERN_REGION	4
 



CVS commit: src/distrib/emips/ramdisk

2019-03-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Mar 29 16:03:20 UTC 2019

Modified Files:
src/distrib/emips/ramdisk: Makefile

Log Message:
bumpity bump bump


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/distrib/emips/ramdisk/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/emips/ramdisk/Makefile
diff -u src/distrib/emips/ramdisk/Makefile:1.3 src/distrib/emips/ramdisk/Makefile:1.4
--- src/distrib/emips/ramdisk/Makefile:1.3	Tue Jan 24 13:04:01 2017
+++ src/distrib/emips/ramdisk/Makefile	Fri Mar 29 12:03:20 2019
@@ -1,11 +1,11 @@
-#	$NetBSD: Makefile,v 1.3 2017/01/24 18:04:01 christos Exp $
+#	$NetBSD: Makefile,v 1.4 2019/03/29 16:03:20 christos Exp $
 
 .include 
 .include "${NETBSDSRCDIR}/distrib/common/Makefile.distrib"
 
 IMAGE=		ramdisk.fs
 IMAGETAR=	diskimage.tgz
-IMAGESIZE=	3500k
+IMAGESIZE=	3600k
 MAKEFS_FLAGS+=	-f 15
 
 WARNS=		1



CVS commit: src/distrib/emips/ramdisk

2019-03-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Mar 29 16:03:20 UTC 2019

Modified Files:
src/distrib/emips/ramdisk: Makefile

Log Message:
bumpity bump bump


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/distrib/emips/ramdisk/Makefile

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



CVS commit: src/external/mit/xorg/bin/xdm/config

2019-03-29 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Mar 29 15:56:43 UTC 2019

Modified Files:
src/external/mit/xorg/bin/xdm/config: Xresources.in

Log Message:
Minor adjustment to the input background color (to better match the flag
logo)


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/mit/xorg/bin/xdm/config/Xresources.in

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

Modified files:

Index: src/external/mit/xorg/bin/xdm/config/Xresources.in
diff -u src/external/mit/xorg/bin/xdm/config/Xresources.in:1.2 src/external/mit/xorg/bin/xdm/config/Xresources.in:1.3
--- src/external/mit/xorg/bin/xdm/config/Xresources.in:1.2	Wed Mar  6 05:08:21 2019
+++ src/external/mit/xorg/bin/xdm/config/Xresources.in	Fri Mar 29 15:56:43 2019
@@ -44,7 +44,7 @@ xlogin*innerFramesWidth: 2
 xlogin*shdColor: grey30
 xlogin*hiColor: grey90
 xlogin*background: grey
-xlogin*inpColor: grey80
+xlogin*inpCollor: grey
 !xlogin*foreground: darkgreen
 xlogin*greetColor: Blue3
 xlogin*failColor: red



CVS commit: src/external/mit/xorg/bin/xdm/config

2019-03-29 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Mar 29 15:56:43 UTC 2019

Modified Files:
src/external/mit/xorg/bin/xdm/config: Xresources.in

Log Message:
Minor adjustment to the input background color (to better match the flag
logo)


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/mit/xorg/bin/xdm/config/Xresources.in

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



CVS commit: src/external/bsd/jemalloc/lib

2019-03-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Mar 29 15:13:44 UTC 2019

Modified Files:
src/external/bsd/jemalloc/lib: Makefile.inc

Log Message:
Move all jemalloc symbols to the private namespace. We can't use visibility
because sun2 links statically.


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

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

Modified files:

Index: src/external/bsd/jemalloc/lib/Makefile.inc
diff -u src/external/bsd/jemalloc/lib/Makefile.inc:1.7 src/external/bsd/jemalloc/lib/Makefile.inc:1.8
--- src/external/bsd/jemalloc/lib/Makefile.inc:1.7	Wed Mar 27 11:30:19 2019
+++ src/external/bsd/jemalloc/lib/Makefile.inc	Fri Mar 29 11:13:44 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.7 2019/03/27 15:30:19 christos Exp $
+#	$NetBSD: Makefile.inc,v 1.8 2019/03/29 15:13:44 christos Exp $
 
 JEMALLOC:=${.PARSEDIR}/..
 
@@ -38,8 +38,7 @@ witness.c
 .SUFFIXES: .3
 .PATH.3: ${JEMALLOC}/dist/doc
 .for i in ${JEMALLOC_SRCS}
-CPPFLAGS.${i}+=-I${JEMALLOC}/include -DJEMALLOC_NO_PRIVATE_NAMESPACE \
--DJEMALLOC_PROTECT_NOSTD -DJEMALLOC_DEBUG
+CPPFLAGS.${i}+=-I${JEMALLOC}/include -DJEMALLOC_PROTECT_NOSTD -DJEMALLOC_DEBUG
 COPTS.${i}+= -fvisibility=hidden -funroll-loops 
 .endfor
 



CVS commit: src/external/bsd/jemalloc/lib

2019-03-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Mar 29 15:13:44 UTC 2019

Modified Files:
src/external/bsd/jemalloc/lib: Makefile.inc

Log Message:
Move all jemalloc symbols to the private namespace. We can't use visibility
because sun2 links statically.


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

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



CVS commit: src/libexec/httpd

2019-03-29 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Mar 29 14:46:44 UTC 2019

Modified Files:
src/libexec/httpd: cgi-bozo.c

Log Message:
Account for cgihandler being set when counting the number of CGI environment
headers we are about to set. Avoids an assertion failure (and overruninng
the array) later.


To generate a diff of this commit:
cvs rdiff -u -r1.47 -r1.48 src/libexec/httpd/cgi-bozo.c

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



CVS commit: src/libexec/httpd

2019-03-29 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Mar 29 14:46:44 UTC 2019

Modified Files:
src/libexec/httpd: cgi-bozo.c

Log Message:
Account for cgihandler being set when counting the number of CGI environment
headers we are about to set. Avoids an assertion failure (and overruninng
the array) later.


To generate a diff of this commit:
cvs rdiff -u -r1.47 -r1.48 src/libexec/httpd/cgi-bozo.c

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

Modified files:

Index: src/libexec/httpd/cgi-bozo.c
diff -u src/libexec/httpd/cgi-bozo.c:1.47 src/libexec/httpd/cgi-bozo.c:1.48
--- src/libexec/httpd/cgi-bozo.c:1.47	Thu Jan 17 07:46:16 2019
+++ src/libexec/httpd/cgi-bozo.c	Fri Mar 29 14:46:44 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: cgi-bozo.c,v 1.47 2019/01/17 07:46:16 mrg Exp $	*/
+/*	$NetBSD: cgi-bozo.c,v 1.48 2019/03/29 14:46:44 martin Exp $	*/
 
 /*	$eterna: cgi-bozo.c,v 1.40 2011/11/18 09:21:15 mrg Exp $	*/
 
@@ -493,6 +493,7 @@ bozo_process_cgi(bozo_httpreq_t *request
 	(clen && *clen ? 1 : 0) +
 	(request->hr_remotehost && *request->hr_remotehost ? 1 : 0) +
 	(request->hr_remoteaddr && *request->hr_remoteaddr ? 1 : 0) +
+	(cgihandler ? 1 : 0) +
 	bozo_auth_cgi_count(request) +
 	(request->hr_serverport && *request->hr_serverport ? 1 : 0);
 



CVS commit: src/external/bsd/nsd/sbin

2019-03-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Mar 29 14:38:31 UTC 2019

Modified Files:
src/external/bsd/nsd/sbin: Makefile.inc

Log Message:
Append DPLIBS to PROGDPLIBS so that we can resolve dependencies for static
linking where order is important.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/external/bsd/nsd/sbin/Makefile.inc

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

Modified files:

Index: src/external/bsd/nsd/sbin/Makefile.inc
diff -u src/external/bsd/nsd/sbin/Makefile.inc:1.1 src/external/bsd/nsd/sbin/Makefile.inc:1.2
--- src/external/bsd/nsd/sbin/Makefile.inc:1.1	Sat Jan  7 14:51:21 2017
+++ src/external/bsd/nsd/sbin/Makefile.inc	Fri Mar 29 10:38:30 2019
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.inc,v 1.1 2017/01/07 19:51:21 christos Exp $
+# $NetBSD: Makefile.inc,v 1.2 2019/03/29 14:38:30 christos Exp $
 
 .include "../Makefile.inc"
 
@@ -11,6 +11,7 @@ PROGDPLIBS+= ${DPLIBS}
 
 .if ${PROG} == "nsd" || ${PROG} == "nsd-checkzone"
 PROGDPLIBS+= xfrd ${NSD}/../lib/libxfrd
+PROGDPLIBS+= ${DPLIBS}
 .endif
 
 CLEANFILES+=${PROG}.8
@@ -19,6 +20,7 @@ ${PROG}.8: ${PROG}.8.in __subst
 
 .endif
 
+
 .if defined(SCRIPTS)
 CLEANFILES+=${SCRIPTS}.sh
 ${SCRIPTS}.sh: ${SCRIPTS}.sh.in __subst



CVS commit: src/external/bsd/nsd/sbin

2019-03-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Mar 29 14:38:31 UTC 2019

Modified Files:
src/external/bsd/nsd/sbin: Makefile.inc

Log Message:
Append DPLIBS to PROGDPLIBS so that we can resolve dependencies for static
linking where order is important.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/external/bsd/nsd/sbin/Makefile.inc

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



CVS commit: src/external/bsd/jemalloc/include/jemalloc/internal

2019-03-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Mar 29 13:04:01 UTC 2019

Modified Files:
src/external/bsd/jemalloc/include/jemalloc/internal:
jemalloc_internal_defs.h

Log Message:
there is no elifdef


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 \
src/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_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/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.h
diff -u src/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.h:1.3 src/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.h:1.4
--- src/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.h:1.3	Fri Mar 29 08:50:30 2019
+++ src/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.h	Fri Mar 29 09:04:00 2019
@@ -200,9 +200,9 @@
 
 /* One page is 2^LG_PAGE bytes. */
 #include 
-#ifdef PAGE_SHIFT
+#if defined(PAGE_SHIFT)
 #define LG_PAGE PAGE_SHIFT
-#elifdef MAX_PAGE_SHIFT
+#elif defined(MAX_PAGE_SHIFT)
 #define LG_PAGE MAX_PAGE_SHIFT
 #else
 #error "PAGE_SHIFT is not defined"



CVS commit: src/external/bsd/jemalloc/include/jemalloc/internal

2019-03-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Mar 29 13:04:01 UTC 2019

Modified Files:
src/external/bsd/jemalloc/include/jemalloc/internal:
jemalloc_internal_defs.h

Log Message:
there is no elifdef


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 \
src/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.h

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



CVS commit: src/sys/arch

2019-03-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Mar 29 12:51:15 UTC 2019

Modified Files:
src/sys/arch/powerpc/include: vmparam.h
src/sys/arch/sparc/include: vmparam.h

Log Message:
Go back to not always defining PAGE_{SIZE,SHIFT,MASK}


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/powerpc/include/vmparam.h
cvs rdiff -u -r1.46 -r1.47 src/sys/arch/sparc/include/vmparam.h

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



CVS commit: src/sys/arch

2019-03-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Mar 29 12:51:15 UTC 2019

Modified Files:
src/sys/arch/powerpc/include: vmparam.h
src/sys/arch/sparc/include: vmparam.h

Log Message:
Go back to not always defining PAGE_{SIZE,SHIFT,MASK}


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/powerpc/include/vmparam.h
cvs rdiff -u -r1.46 -r1.47 src/sys/arch/sparc/include/vmparam.h

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

Modified files:

Index: src/sys/arch/powerpc/include/vmparam.h
diff -u src/sys/arch/powerpc/include/vmparam.h:1.21 src/sys/arch/powerpc/include/vmparam.h:1.22
--- src/sys/arch/powerpc/include/vmparam.h:1.21	Wed Mar 27 12:16:43 2019
+++ src/sys/arch/powerpc/include/vmparam.h	Fri Mar 29 08:51:15 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: vmparam.h,v 1.21 2019/03/27 16:16:43 christos Exp $	*/
+/*	$NetBSD: vmparam.h,v 1.22 2019/03/29 12:51:15 christos Exp $	*/
 
 #ifndef _POWERPC_VMPARAM_H_
 #define _POWERPC_VMPARAM_H_
@@ -70,10 +70,6 @@ extern const char __USRSTACK;		/* let th
 #include 
 #elif defined(_KERNEL)
 #error unknown PPC variant
-#else
-#define PAGE_SHIFT  MAX_PAGE_SHIFT
-#define PAGE_SIZE   (1 << PAGE_SHIFT)
-#define PAGE_MASK   (PAGE_SIZE - 1)
 #endif
 
 #endif /* !_MODULE */

Index: src/sys/arch/sparc/include/vmparam.h
diff -u src/sys/arch/sparc/include/vmparam.h:1.46 src/sys/arch/sparc/include/vmparam.h:1.47
--- src/sys/arch/sparc/include/vmparam.h:1.46	Thu Mar 28 20:08:13 2019
+++ src/sys/arch/sparc/include/vmparam.h	Fri Mar 29 08:51:15 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: vmparam.h,v 1.46 2019/03/29 00:08:13 christos Exp $ */
+/*	$NetBSD: vmparam.h,v 1.47 2019/03/29 12:51:15 christos Exp $ */
 
 /*
  * Copyright (c) 1992, 1993
@@ -72,16 +72,12 @@
 #define	PAGE_SHIFT		PAGE_SHIFT_SUN4CM
 #elif CPU_NTYPES == 1 && defined(SUN4)
 #define	PAGE_SHIFT		PAGE_SHIFT_SUN4
-#elif defined(_KERNEL) && !defined(_RUMPKERNEL) \
-&& !defined(STANDALONE) && !defined(_MODULE)
-#error "Cannot determine page size"
-#else
-/* Default to max for userland */
-#define	PAGE_SHIFT		MAX_PAGE_SHIFT
 #endif
 
+#ifdef	PAGE_SHIFT		PAGE_SHIFT_SUN4
 #define	PAGE_SIZE		(1 << PAGE_SHIFT)
 #define	PAGE_MASK		(PAGE_SIZE - 1)
+#endif
 
 /*
  * USRSTACK is the top (end) of the user stack.



CVS commit: src/external/bsd/jemalloc/include/jemalloc/internal

2019-03-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Mar 29 12:50:30 UTC 2019

Modified Files:
src/external/bsd/jemalloc/include/jemalloc/internal:
jemalloc_internal_defs.h

Log Message:
Change strategy: instead of always defining PAGE_SHIFT in vmparam.h, fail
back to using MAX_PAGE_SHIFT.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 \
src/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_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/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.h
diff -u src/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.h:1.2 src/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.h:1.3
--- src/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.h:1.2	Tue Mar  5 17:39:21 2019
+++ src/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.h	Fri Mar 29 08:50:30 2019
@@ -200,7 +200,13 @@
 
 /* One page is 2^LG_PAGE bytes. */
 #include 
+#ifdef PAGE_SHIFT
 #define LG_PAGE PAGE_SHIFT
+#elifdef MAX_PAGE_SHIFT
+#define LG_PAGE MAX_PAGE_SHIFT
+#else
+#error "PAGE_SHIFT is not defined"
+#endif
 
 /*
  * One huge page is 2^LG_HUGEPAGE bytes.  Note that this is defined even if the



CVS commit: src/external/bsd/jemalloc/include/jemalloc/internal

2019-03-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Mar 29 12:50:30 UTC 2019

Modified Files:
src/external/bsd/jemalloc/include/jemalloc/internal:
jemalloc_internal_defs.h

Log Message:
Change strategy: instead of always defining PAGE_SHIFT in vmparam.h, fail
back to using MAX_PAGE_SHIFT.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 \
src/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.h

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



CVS commit: src/sys/dev/pci

2019-03-29 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Mar 29 08:54:35 UTC 2019

Modified Files:
src/sys/dev/pci: if_bnx.c if_bnxreg.h

Log Message:
- Use m_defrag() when bus_dmamap_load_mbuf() returned with EFBIG.
- Style change to reduce diff against {Free,Open}BSD.
- Make it compilable with BNX_DEBUG.
- Use __nothing for null macro.


To generate a diff of this commit:
cvs rdiff -u -r1.73 -r1.74 src/sys/dev/pci/if_bnx.c
cvs rdiff -u -r1.21 -r1.22 src/sys/dev/pci/if_bnxreg.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/pci/if_bnx.c
diff -u src/sys/dev/pci/if_bnx.c:1.73 src/sys/dev/pci/if_bnx.c:1.74
--- src/sys/dev/pci/if_bnx.c:1.73	Fri Mar 29 06:31:54 2019
+++ src/sys/dev/pci/if_bnx.c	Fri Mar 29 08:54:35 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_bnx.c,v 1.73 2019/03/29 06:31:54 msaitoh Exp $	*/
+/*	$NetBSD: if_bnx.c,v 1.74 2019/03/29 08:54:35 msaitoh Exp $	*/
 /*	$OpenBSD: if_bnx.c,v 1.101 2013/03/28 17:21:44 brad Exp $	*/
 
 /*-
@@ -35,7 +35,7 @@
 #if 0
 __FBSDID("$FreeBSD: src/sys/dev/bce/if_bce.c,v 1.3 2006/04/13 14:12:26 ru Exp $");
 #endif
-__KERNEL_RCSID(0, "$NetBSD: if_bnx.c,v 1.73 2019/03/29 06:31:54 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_bnx.c,v 1.74 2019/03/29 08:54:35 msaitoh Exp $");
 
 /*
  * The following controllers are supported by this driver:
@@ -176,6 +176,7 @@ static const struct bnx_product {
 	},
 };
 
+
 //
 /* Supported Flash NVRAM device data.   */
 //
@@ -183,6 +184,7 @@ static struct flash_spec flash_table[] =
 {
 #define BUFFERED_FLAGS		(BNX_NV_BUFFERED | BNX_NV_TRANSLATE)
 #define NONBUFFERED_FLAGS	(BNX_NV_WREN)
+
 	/* Slow EEPROM */
 	{0x, 0x40830380, 0x009f0081, 0xa184a053, 0xaf000400,
 	 BUFFERED_FLAGS, SEEPROM_PAGE_BITS, SEEPROM_PAGE_SIZE,
@@ -1231,9 +1233,8 @@ bnx_miibus_statchg(struct ifnet *ifp)
 	if ((mii->mii_media_active & IFM_GMASK) == IFM_HDX) {
 		DBPRINT(sc, BNX_INFO, "Setting Half-Duplex interface.\n");
 		val |= BNX_EMAC_MODE_HALF_DUPLEX;
-	} else {
+	} else
 		DBPRINT(sc, BNX_INFO, "Setting Full-Duplex interface.\n");
-	}
 
 	REG_WR(sc, BNX_EMAC_MODE, val);
 
@@ -2192,7 +2193,7 @@ bnx_get_media(struct bnx_softc *sc)
 		sc->bnx_phy_flags |= BNX_PHY_CRC_FIX_FLAG;
 
 bnx_get_media_exit:
-	DBPRINT(sc, (BNX_INFO_LOAD),
+	DBPRINT(sc, (BNX_INFO_LOAD | BNX_INFO_PHY),
 		"Using PHY address %d.\n", sc->bnx_phy_addr);
 }
 
@@ -5000,7 +5001,7 @@ void
 bnx_mgmt_init(struct bnx_softc *sc)
 {
 	struct ifnet	*ifp = >bnx_ec.ec_if;
-	u_int32_t	val;
+	uint32_t	val;
 
 	/* Check if the driver is still running and bail out if it is. */
 	if (ifp->if_flags & IFF_RUNNING)
@@ -5023,7 +5024,7 @@ bnx_mgmt_init(struct bnx_softc *sc)
 	bnx_ifmedia_upd(ifp);
 
 bnx_mgmt_init_exit:
- 	DBPRINT(sc, BNX_VERBOSE_RESET, "Exiting %s()\n", __FUNCTION__);
+ 	DBPRINT(sc, BNX_VERBOSE_RESET, "Exiting %s()\n", __func__);
 }
 
 //
@@ -5047,6 +5048,7 @@ bnx_tx_encap(struct bnx_softc *sc, struc
 	uint32_t		addr, prod_bseq;
 	int			i, error;
 	static struct work	bnx_wk; /* Dummy work. Statically allocated. */
+	bool			remap = true;
 
 	mutex_enter(>tx_pkt_mtx);
 	pkt = TAILQ_FIRST(>tx_free_pkts);
@@ -5089,10 +5091,21 @@ bnx_tx_encap(struct bnx_softc *sc, struc
 	map = pkt->pkt_dmamap;
 
 	/* Map the mbuf into our DMA address space. */
+retry:
 	error = bus_dmamap_load_mbuf(sc->bnx_dmatag, map, m, BUS_DMA_NOWAIT);
-	if (error != 0) {
-		aprint_error_dev(sc->bnx_dev,
-		"Error mapping mbuf into TX chain!\n");
+	if (__predict_false(error)) {
+		if (error == EFBIG) {
+			if (remap == true) {
+struct mbuf *newm;
+
+remap = false;
+newm = m_defrag(m, M_NOWAIT);
+if (newm != NULL) {
+	m = newm;
+	goto retry;
+}
+			}
+		}
 		sc->tx_dma_map_failures++;
 		goto maperr;
 	}
@@ -5134,6 +5147,7 @@ bnx_tx_encap(struct bnx_softc *sc, struc
 			txbd->tx_bd_flags |= TX_BD_FLAGS_START;
 		prod = NEXT_TX_BD(prod);
 	}
+
 	/* Set the END flag on the last TX buffer descriptor. */
 	txbd->tx_bd_flags |= TX_BD_FLAGS_END;
 
@@ -5433,13 +5447,12 @@ bnx_intr(void *xsc)
 		if (((status_attn_bits & ~STATUS_ATTN_BITS_LINK_STATE) !=
 		(sblk->status_attn_bits_ack &
 		~STATUS_ATTN_BITS_LINK_STATE))) {
-			DBRUN(1, sc->unexpected_attentions++);
+			DBRUN(sc->unexpected_attentions++);
 
 			BNX_PRINTF(sc, "Fatal attention detected: 0x%08X\n",
 			sblk->status_attn_bits);
 
-			DBRUN(BNX_FATAL,
-			if (bnx_debug_unexpected_attention == 0)
+			DBRUNIF((bnx_debug_unexpected_attention == 0),
 bnx_breakpoint(sc));
 
 			bnx_init(ifp);
@@ -5989,7 +6002,7 @@ bnx_dump_tx_chain(struct bnx_softc *sc, 
 	"tx_bd per page = 0x%08X, usable tx_bd per page = 0x%08X\n",
 	

CVS commit: src/sys/dev/pci

2019-03-29 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Mar 29 08:54:35 UTC 2019

Modified Files:
src/sys/dev/pci: if_bnx.c if_bnxreg.h

Log Message:
- Use m_defrag() when bus_dmamap_load_mbuf() returned with EFBIG.
- Style change to reduce diff against {Free,Open}BSD.
- Make it compilable with BNX_DEBUG.
- Use __nothing for null macro.


To generate a diff of this commit:
cvs rdiff -u -r1.73 -r1.74 src/sys/dev/pci/if_bnx.c
cvs rdiff -u -r1.21 -r1.22 src/sys/dev/pci/if_bnxreg.h

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



CVS commit: src/usr.sbin/wsmuxctl

2019-03-29 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Fri Mar 29 07:49:38 UTC 2019

Modified Files:
src/usr.sbin/wsmuxctl: wsmuxctl.c

Log Message:
expand error message to also list wsbell as valid name.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/usr.sbin/wsmuxctl/wsmuxctl.c

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

Modified files:

Index: src/usr.sbin/wsmuxctl/wsmuxctl.c
diff -u src/usr.sbin/wsmuxctl/wsmuxctl.c:1.13 src/usr.sbin/wsmuxctl/wsmuxctl.c:1.14
--- src/usr.sbin/wsmuxctl/wsmuxctl.c:1.13	Fri Mar 29 07:47:33 2019
+++ src/usr.sbin/wsmuxctl/wsmuxctl.c	Fri Mar 29 07:49:38 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: wsmuxctl.c,v 1.13 2019/03/29 07:47:33 mlelstv Exp $ */
+/* $NetBSD: wsmuxctl.c,v 1.14 2019/03/29 07:49:38 mlelstv Exp $ */
 
 /*
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -73,7 +73,7 @@ parsedev(const char *dev, struct wsmux_d
 		mdev->type = WSMUX_BELL;
 		return;
 	}
-	errx(1, "bad device: `%s', use wsmouse, wskdb, or wsmux", dev);
+	errx(1, "bad device: `%s', use wsmouse, wskdb, wsmux or wsbell", dev);
 }
 
 static void



CVS commit: src/usr.sbin/wsmuxctl

2019-03-29 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Fri Mar 29 07:49:38 UTC 2019

Modified Files:
src/usr.sbin/wsmuxctl: wsmuxctl.c

Log Message:
expand error message to also list wsbell as valid name.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/usr.sbin/wsmuxctl/wsmuxctl.c

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



CVS commit: src/usr.sbin/wsmuxctl

2019-03-29 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Fri Mar 29 07:47:33 UTC 2019

Modified Files:
src/usr.sbin/wsmuxctl: wsmuxctl.c

Log Message:
Add support for WSMUX_BELL, also avoid crashes when the kernel returns
unknown device types.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/usr.sbin/wsmuxctl/wsmuxctl.c

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

Modified files:

Index: src/usr.sbin/wsmuxctl/wsmuxctl.c
diff -u src/usr.sbin/wsmuxctl/wsmuxctl.c:1.12 src/usr.sbin/wsmuxctl/wsmuxctl.c:1.13
--- src/usr.sbin/wsmuxctl/wsmuxctl.c:1.12	Sun Feb  3 03:19:31 2019
+++ src/usr.sbin/wsmuxctl/wsmuxctl.c	Fri Mar 29 07:47:33 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: wsmuxctl.c,v 1.12 2019/02/03 03:19:31 mrg Exp $ */
+/* $NetBSD: wsmuxctl.c,v 1.13 2019/03/29 07:47:33 mlelstv Exp $ */
 
 /*
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -45,8 +45,6 @@ __dead static void usage(void);
 
 static const char *ctlpath = "/dev/wsmuxctl";
 
-static const char *devnames[] = { "?", "wsmouse", "wskbd", "wsmux" };
-
 static void
 usage(void)
 {
@@ -71,6 +69,10 @@ parsedev(const char *dev, struct wsmux_d
 		mdev->type = WSMUX_MUX;
 		return;
 	}
+	if (sscanf(dev, "wsbell%d", >idx) == 1) {
+		mdev->type = WSMUX_BELL;
+		return;
+	}
 	errx(1, "bad device: `%s', use wsmouse, wskdb, or wsmux", dev);
 }
 
@@ -80,12 +82,19 @@ listdevs(int fd, int rec, int ind)
 	int i, rfd;
 	char buf[100];
 	struct wsmux_device_list devs;
+	const char *name;
 
 	if (ioctl(fd, WSMUXIO_LIST_DEVICES, ) < 0)
 		err(1, "WSMUXIO_LIST_DEVICES");
 	for (i = 0; i < devs.ndevices; i++) {
-		printf("%*s%s%d\n", ind, "", devnames[devs.devices[i].type],
-		   devs.devices[i].idx);
+		switch (devs.devices[i].type) {
+		case WSMUX_MOUSE:   name = "wsmouse"; break;
+		case WSMUX_KBD: name = "wskbd"; break;
+		case WSMUX_MUX: name = "wsmux"; break;
+		case WSMUX_BELL:name = "wsbell"; break;
+		default:name = "?"; break;
+		}
+		printf("%*s%s%d\n", ind, "", name, devs.devices[i].idx);
 		if (rec && devs.devices[i].type == WSMUX_MUX) {
 			snprintf(buf, sizeof(buf), "%s%d", ctlpath,
 			devs.devices[i].idx);



CVS commit: src/usr.sbin/wsmuxctl

2019-03-29 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Fri Mar 29 07:47:33 UTC 2019

Modified Files:
src/usr.sbin/wsmuxctl: wsmuxctl.c

Log Message:
Add support for WSMUX_BELL, also avoid crashes when the kernel returns
unknown device types.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/usr.sbin/wsmuxctl/wsmuxctl.c

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



CVS commit: src/sys/dev/pci

2019-03-29 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Mar 29 06:31:54 UTC 2019

Modified Files:
src/sys/dev/pci: if_bnx.c if_bnxvar.h

Log Message:
Sync with OpenBSD:
- Don't need to clear if_timer during attach. (OpenBSD rev. 1.23)
- Do the minimal initialization of the firmware so that ASF always works.
  From ambrisko@FreeBSD (OpenBSD rev. 1.32)
- Move the interrupt establishment till after everything in the softc is set up
  (OpenBSD rev. 1.40)
- Let mii_attach() know where the PHY is located instead of scanning for it
  since we know where it will be anyway and remove the code from the MII bus
  read/write functions to force reading/writing from the predetermined
  location. Copied from bge(4) and this is what the upstream FreeBSD bce(4)
  driver has done once FreBSD gained a mii_attach().


To generate a diff of this commit:
cvs rdiff -u -r1.72 -r1.73 src/sys/dev/pci/if_bnx.c
cvs rdiff -u -r1.8 -r1.9 src/sys/dev/pci/if_bnxvar.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/pci/if_bnx.c
diff -u src/sys/dev/pci/if_bnx.c:1.72 src/sys/dev/pci/if_bnx.c:1.73
--- src/sys/dev/pci/if_bnx.c:1.72	Thu Mar 28 02:50:27 2019
+++ src/sys/dev/pci/if_bnx.c	Fri Mar 29 06:31:54 2019
@@ -1,5 +1,5 @@
-/*	$NetBSD: if_bnx.c,v 1.72 2019/03/28 02:50:27 msaitoh Exp $	*/
-/*	$OpenBSD: if_bnx.c,v 1.100 2013/01/13 05:45:10 brad Exp $ */
+/*	$NetBSD: if_bnx.c,v 1.73 2019/03/29 06:31:54 msaitoh Exp $	*/
+/*	$OpenBSD: if_bnx.c,v 1.101 2013/03/28 17:21:44 brad Exp $	*/
 
 /*-
  * Copyright (c) 2006-2010 Broadcom Corporation
@@ -35,7 +35,7 @@
 #if 0
 __FBSDID("$FreeBSD: src/sys/dev/bce/if_bce.c,v 1.3 2006/04/13 14:12:26 ru Exp $");
 #endif
-__KERNEL_RCSID(0, "$NetBSD: if_bnx.c,v 1.72 2019/03/28 02:50:27 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_bnx.c,v 1.73 2019/03/29 06:31:54 msaitoh Exp $");
 
 /*
  * The following controllers are supported by this driver:
@@ -380,8 +380,10 @@ int	bnx_tx_encap(struct bnx_softc *, str
 void	bnx_start(struct ifnet *);
 int	bnx_ioctl(struct ifnet *, u_long, void *);
 void	bnx_watchdog(struct ifnet *);
+int	bnx_ifmedia_upd(struct ifnet *);
 void	bnx_ifmedia_sts(struct ifnet *, struct ifmediareq *);
 int	bnx_init(struct ifnet *);
+static void bnx_mgmt_init(struct bnx_softc *);
 
 void	bnx_init_context(struct bnx_softc *);
 void	bnx_get_mac_addr(struct bnx_softc *);
@@ -613,7 +615,6 @@ bnx_attach(device_t parent, device_t sel
 		aprint_error_dev(sc->bnx_dev, "couldn't map interrupt\n");
 		goto bnx_attach_fail;
 	}
-
 	intrstr = pci_intr_string(pc, ih, intrbuf, sizeof(intrbuf));
 
 	/*
@@ -777,7 +778,6 @@ bnx_attach(device_t parent, device_t sel
 	ifp->if_stop = bnx_stop;
 	ifp->if_start = bnx_start;
 	ifp->if_init = bnx_init;
-	ifp->if_timer = 0;
 	ifp->if_watchdog = bnx_watchdog;
 	IFQ_SET_MAXLEN(>if_snd, USABLE_TX_BD - 1);
 	IFQ_SET_READY(>if_snd);
@@ -791,18 +791,6 @@ bnx_attach(device_t parent, device_t sel
 	IFCAP_CSUM_TCPv4_Tx | IFCAP_CSUM_TCPv4_Rx |
 	IFCAP_CSUM_UDPv4_Tx | IFCAP_CSUM_UDPv4_Rx;
 
-	/* Hookup IRQ last. */
-	sc->bnx_intrhand = pci_intr_establish_xname(pc, ih, IPL_NET, bnx_intr,
-	sc, device_xname(self));
-	if (sc->bnx_intrhand == NULL) {
-		aprint_error_dev(self, "couldn't establish interrupt");
-		if (intrstr != NULL)
-			aprint_error(" at %s", intrstr);
-		aprint_error("\n");
-		goto bnx_attach_fail;
-	}
-	aprint_normal_dev(sc->bnx_dev, "interrupting at %s\n", intrstr);
-
 	/* create workqueue to handle packet allocations */
 	if (workqueue_create(>bnx_wq, device_xname(self),
 	bnx_alloc_pkts, sc, PRI_NONE, IPL_NET, 0) != 0) {
@@ -819,7 +807,7 @@ bnx_attach(device_t parent, device_t sel
 	bnx_init_media(sc);
 
 	sc->bnx_ec.ec_mii = >bnx_mii;
-	ifmedia_init(>bnx_mii.mii_media, 0, ether_mediachange,
+	ifmedia_init(>bnx_mii.mii_media, 0, bnx_ifmedia_upd,
 	bnx_ifmedia_sts);
 
 	/* set phyflags and chipid before mii_attach() */
@@ -836,7 +824,7 @@ bnx_attach(device_t parent, device_t sel
 	if (sc->bnx_phy_flags & BNX_PHY_SERDES_FLAG)
 		mii_flags |= MIIF_HAVEFIBER;
 	mii_attach(self, >bnx_mii, 0x,
-	MII_PHY_ANY, MII_OFFSET_ANY, mii_flags);
+	sc->bnx_phy_addr, MII_OFFSET_ANY, mii_flags);
 
 	if (LIST_EMPTY(>bnx_mii.mii_phys)) {
 		aprint_error_dev(self, "no PHY found!\n");
@@ -853,6 +841,18 @@ bnx_attach(device_t parent, device_t sel
 
 	callout_init(>bnx_timeout, 0);
 
+	/* Hookup IRQ last. */
+	sc->bnx_intrhand = pci_intr_establish_xname(pc, ih, IPL_NET, bnx_intr,
+	sc, device_xname(self));
+	if (sc->bnx_intrhand == NULL) {
+		aprint_error_dev(self, "couldn't establish interrupt");
+		if (intrstr != NULL)
+			aprint_error(" at %s", intrstr);
+		aprint_error("\n");
+		goto bnx_attach_fail;
+	}
+	aprint_normal_dev(sc->bnx_dev, "interrupting at %s\n", intrstr);
+
 	if (pmf_device_register(self, NULL, NULL))
 		pmf_class_network_register(self, ifp);
 	else
@@ -861,6 +861,9 @@ bnx_attach(device_t parent, device_t sel
 	/* 

CVS commit: src/sys/dev/pci

2019-03-29 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Mar 29 06:31:54 UTC 2019

Modified Files:
src/sys/dev/pci: if_bnx.c if_bnxvar.h

Log Message:
Sync with OpenBSD:
- Don't need to clear if_timer during attach. (OpenBSD rev. 1.23)
- Do the minimal initialization of the firmware so that ASF always works.
  From ambrisko@FreeBSD (OpenBSD rev. 1.32)
- Move the interrupt establishment till after everything in the softc is set up
  (OpenBSD rev. 1.40)
- Let mii_attach() know where the PHY is located instead of scanning for it
  since we know where it will be anyway and remove the code from the MII bus
  read/write functions to force reading/writing from the predetermined
  location. Copied from bge(4) and this is what the upstream FreeBSD bce(4)
  driver has done once FreBSD gained a mii_attach().


To generate a diff of this commit:
cvs rdiff -u -r1.72 -r1.73 src/sys/dev/pci/if_bnx.c
cvs rdiff -u -r1.8 -r1.9 src/sys/dev/pci/if_bnxvar.h

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