CVS commit: src/distrib

2021-06-25 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Jun 26 00:38:16 UTC 2021

Modified Files:
src/distrib/sun2/miniroot: install.md
src/distrib/sun3/miniroot: install.md

Log Message:
Check if /tmp is writable to see whether the rootdev is already mounted.

Creating a dummy /tmp/root_writable file and after mountroot and
checking it on the second installation could be problematic if
users retry to installation after reboot without reinstalling miniroot.
Taken from amiga.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/distrib/sun2/miniroot/install.md
cvs rdiff -u -r1.8 -r1.9 src/distrib/sun3/miniroot/install.md

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

Modified files:

Index: src/distrib/sun2/miniroot/install.md
diff -u src/distrib/sun2/miniroot/install.md:1.8 src/distrib/sun2/miniroot/install.md:1.9
--- src/distrib/sun2/miniroot/install.md:1.8	Sat Jun 26 00:25:41 2021
+++ src/distrib/sun2/miniroot/install.md	Sat Jun 26 00:38:16 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: install.md,v 1.8 2021/06/26 00:25:41 tsutsui Exp $
+#	$NetBSD: install.md,v 1.9 2021/06/26 00:38:16 tsutsui Exp $
 #
 #
 # Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -49,11 +49,10 @@ md_set_term() {
 
 md_makerootwritable() {
 	# Just remount the root device read-write.
-	if [ ! -e /tmp/root_writable ]; then
+	if ! cp /dev/null /tmp/.root_writable >/dev/null 2>&1; then
 		echo "Remounting root read-write..."
 		mi_mount_kernfs
 		mount -u -t ffs /kern/rootdev /
-		cp /dev/null /tmp/root_writable
 	fi
 }
 

Index: src/distrib/sun3/miniroot/install.md
diff -u src/distrib/sun3/miniroot/install.md:1.8 src/distrib/sun3/miniroot/install.md:1.9
--- src/distrib/sun3/miniroot/install.md:1.8	Sat Jun 26 00:25:41 2021
+++ src/distrib/sun3/miniroot/install.md	Sat Jun 26 00:38:16 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: install.md,v 1.8 2021/06/26 00:25:41 tsutsui Exp $
+#	$NetBSD: install.md,v 1.9 2021/06/26 00:38:16 tsutsui Exp $
 #
 #
 # Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -49,11 +49,10 @@ md_set_term() {
 
 md_makerootwritable() {
 	# Just remount the root device read-write.
-	if [ ! -e /tmp/root_writable ]; then
+	if ! cp /dev/null /tmp/.root_writable >/dev/null 2>&1; then
 		echo "Remounting root read-write..."
 		mi_mount_kernfs
 		mount -u /kern/rootdev /
-		cp /dev/null /tmp/root_writable
 	fi
 }
 



CVS commit: src/distrib/amiga/miniroot

2021-06-25 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Jun 26 00:28:19 UTC 2021

Modified Files:
src/distrib/amiga/miniroot: install.md

Log Message:
Remove an obsolete comment.


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/distrib/amiga/miniroot/install.md

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

Modified files:

Index: src/distrib/amiga/miniroot/install.md
diff -u src/distrib/amiga/miniroot/install.md:1.32 src/distrib/amiga/miniroot/install.md:1.33
--- src/distrib/amiga/miniroot/install.md:1.32	Thu Feb 25 21:46:55 2021
+++ src/distrib/amiga/miniroot/install.md	Sat Jun 26 00:28:19 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: install.md,v 1.32 2021/02/25 21:46:55 rin Exp $
+#	$NetBSD: install.md,v 1.33 2021/06/26 00:28:19 tsutsui Exp $
 #
 #
 # Copyright (c) 1996,2006 The NetBSD Foundation, Inc.
@@ -50,7 +50,6 @@ md_makerootwritable() {
 	# Mount root rw for convenience of the tester ;-)
 	if ! cp /dev/null /tmp/.root_writable >/dev/null 2>&1; then
 		mi_mount_kernfs
-		# XXX: Use /kern/rootdev instead?
 		mount -t ffs -u /kern/rootdev / > /dev/null 2>&1
 	fi
 }



CVS commit: src/distrib

2021-06-25 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Jun 26 00:25:41 UTC 2021

Modified Files:
src/distrib/sun2/miniroot: install.md
src/distrib/sun3/miniroot: install.md

Log Message:
Don't try to add swap on miniroot.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/distrib/sun2/miniroot/install.md
cvs rdiff -u -r1.7 -r1.8 src/distrib/sun3/miniroot/install.md

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

Modified files:

Index: src/distrib/sun2/miniroot/install.md
diff -u src/distrib/sun2/miniroot/install.md:1.7 src/distrib/sun2/miniroot/install.md:1.8
--- src/distrib/sun2/miniroot/install.md:1.7	Sat Dec  5 18:52:06 2020
+++ src/distrib/sun2/miniroot/install.md	Sat Jun 26 00:25:41 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: install.md,v 1.7 2020/12/05 18:52:06 tsutsui Exp $
+#	$NetBSD: install.md,v 1.8 2021/06/26 00:25:41 tsutsui Exp $
 #
 #
 # Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -53,7 +53,6 @@ md_makerootwritable() {
 		echo "Remounting root read-write..."
 		mi_mount_kernfs
 		mount -u -t ffs /kern/rootdev /
-		swapctl -a /kern/rootdev
 		cp /dev/null /tmp/root_writable
 	fi
 }

Index: src/distrib/sun3/miniroot/install.md
diff -u src/distrib/sun3/miniroot/install.md:1.7 src/distrib/sun3/miniroot/install.md:1.8
--- src/distrib/sun3/miniroot/install.md:1.7	Sat Dec  5 18:52:06 2020
+++ src/distrib/sun3/miniroot/install.md	Sat Jun 26 00:25:41 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: install.md,v 1.7 2020/12/05 18:52:06 tsutsui Exp $
+#	$NetBSD: install.md,v 1.8 2021/06/26 00:25:41 tsutsui Exp $
 #
 #
 # Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -53,7 +53,6 @@ md_makerootwritable() {
 		echo "Remounting root read-write..."
 		mi_mount_kernfs
 		mount -u /kern/rootdev /
-		swapctl -a /kern/rootdev
 		cp /dev/null /tmp/root_writable
 	fi
 }



CVS commit: src/usr.bin/xlint/lint1

2021-06-25 Thread Tobias Nygren
Module Name:src
Committed By:   tnn
Date:   Fri Jun 25 20:17:56 UTC 2021

Modified Files:
src/usr.bin/xlint/lint1: Makefile

Log Message:
ensure defined(HAVE_GCC) before use of ${HAVE_GCC}


To generate a diff of this commit:
cvs rdiff -u -r1.72 -r1.73 src/usr.bin/xlint/lint1/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.bin/xlint/lint1/Makefile
diff -u src/usr.bin/xlint/lint1/Makefile:1.72 src/usr.bin/xlint/lint1/Makefile:1.73
--- src/usr.bin/xlint/lint1/Makefile:1.72	Wed Jun 23 07:11:41 2021
+++ src/usr.bin/xlint/lint1/Makefile	Fri Jun 25 20:17:56 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.72 2021/06/23 07:11:41 rillig Exp $
+#	$NetBSD: Makefile,v 1.73 2021/06/25 20:17:56 tnn Exp $
 
 .include 
 
@@ -28,7 +28,7 @@ CPPFLAGS+=	${DEBUG:D-DDEBUG}
 COPTS.err.c+=	${${ACTIVE_CC} == "clang":? -Wno-format-nonliteral :}
 
 # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101177
-.if ${HAVE_GCC} == 9 &&	\
+.if defined(HAVE_GCC) && ${HAVE_GCC} == 9 &&	\
 	(${MACHINE_ARCH} == "sh3el" || ${MACHINE_ARCH} == "sh3eb")
 COPTS.lex.c+=	-O0
 .endif



CVS commit: [netbsd-8] src/doc

2021-06-25 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Jun 25 19:14:30 UTC 2021

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

Log Message:
Ticket #1686


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.92 -r1.1.2.93 src/doc/CHANGES-8.3

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.3
diff -u src/doc/CHANGES-8.3:1.1.2.92 src/doc/CHANGES-8.3:1.1.2.93
--- src/doc/CHANGES-8.3:1.1.2.92	Mon Jun 21 17:46:13 2021
+++ src/doc/CHANGES-8.3	Fri Jun 25 19:14:29 2021
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-8.3,v 1.1.2.92 2021/06/21 17:46:13 martin Exp $
+# $NetBSD: CHANGES-8.3,v 1.1.2.93 2021/06/25 19:14:29 martin Exp $
 
 A complete list of changes from the NetBSD 8.2 release to the NetBSD 8.3
 release:
@@ -1972,3 +1972,14 @@ compat/arm/oabi/bsd.oabi.mk		(apply patc
 	Fix PR 50192.
 	[mrg, ticket #1684]
 
+distrib/miniroot/install.sub			1.61,1.62 (patch)
+distrib/sun2/miniroot/Makefile			1.40
+distrib/sun3/miniroot/Makefile			1.50
+
+	Fixes to sun2 and sun3 miniroot upgrade scripts:
+	- Replace RELEASE and VERSION strings proplery.
+	- Remove netstat(1) calls to print resolver info on upgrade using
+	  miniroot, the binary is not available.
+	- The modules and rescue sets are also required on upgrade.
+	[tsutsui, ticket #1686]
+



CVS commit: [netbsd-8] src/distrib

2021-06-25 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Jun 25 19:13:20 UTC 2021

Modified Files:
src/distrib/miniroot [netbsd-8]: install.sub
src/distrib/sun2/miniroot [netbsd-8]: Makefile
src/distrib/sun3/miniroot [netbsd-8]: Makefile

Log Message:
Pull up following revision(s) (requested by tsutsui in ticket #1686):

distrib/sun3/miniroot/Makefile: revision 1.50
distrib/miniroot/install.sub: revision 1.61
distrib/miniroot/install.sub: revision 1.62 (patch)
distrib/sun2/miniroot/Makefile: revision 1.40

Replace RELEASE and VERSION strings proplery.
sun2 and sun3 don't use MI src/distrib/miniroot/list so this should
have been sync'ed with it.

http://cvsweb.netbsd.org/bsdweb.cgi/src/distrib/miniroot/list#rev1.36
> Use proper release version strings ("9.1" rather than "91") in banners.
>
> Also define and use "MACHINE" variable to describe port names
> (no uname(1) or sysctl(8) in miniroot binary list by default).

Should be pulled up to netbsd-9.

Remove netstat(1) calls to print resolver info on upgrade using miniroot.
netstat(1) was removed from miniroot 25 years ago.
 http://cvsweb.netbsd.org/bsdweb.cgi/src/distrib/miniroot/list#rev1.5

The modules and rescue sets are also required on upgrade.
Should be pulled up to netbsd-9 and netbsd-8.


To generate a diff of this commit:
cvs rdiff -u -r1.45.56.3 -r1.45.56.4 src/distrib/miniroot/install.sub
cvs rdiff -u -r1.36 -r1.36.4.1 src/distrib/sun2/miniroot/Makefile
cvs rdiff -u -r1.46 -r1.46.4.1 src/distrib/sun3/miniroot/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/miniroot/install.sub
diff -u src/distrib/miniroot/install.sub:1.45.56.3 src/distrib/miniroot/install.sub:1.45.56.4
--- src/distrib/miniroot/install.sub:1.45.56.3	Sat Jun  5 10:41:20 2021
+++ src/distrib/miniroot/install.sub	Fri Jun 25 19:13:20 2021
@@ -1,5 +1,5 @@
 #!/bin/sh
-#	$NetBSD: install.sub,v 1.45.56.3 2021/06/05 10:41:20 martin Exp $
+#	$NetBSD: install.sub,v 1.45.56.4 2021/06/25 19:13:20 martin Exp $
 #
 # Copyright (c) 1996 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -40,7 +40,7 @@ RELEASE=# filled in automatically (s
 export RELEASE
 
 ALLSETS="base comp etc games man misc modules text"	# default install sets
-UPGRSETS="base comp games man misc text"	# default upgrade sets
+UPGRSETS="base comp games man misc modules text"	# default upgrade sets
 THESETS=	# one of the above
 
 local_sets_dir=""			# Path searched for sets by install_sets
@@ -606,12 +606,8 @@ fi
 	echo	""
 
 	if [ "${_resolver_enabled:-FALSE}" = "TRUE" ]; then
-		netstat -r
-		echo	""
 		echo	"Resolver enabled."
 	else
-		netstat -rn
-		echo	""
 		echo	"Resolver not enabled."
 	fi
 

Index: src/distrib/sun2/miniroot/Makefile
diff -u src/distrib/sun2/miniroot/Makefile:1.36 src/distrib/sun2/miniroot/Makefile:1.36.4.1
--- src/distrib/sun2/miniroot/Makefile:1.36	Tue Jan 24 18:04:05 2017
+++ src/distrib/sun2/miniroot/Makefile	Fri Jun 25 19:13:20 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.36 2017/01/24 18:04:05 christos Exp $
+#	$NetBSD: Makefile,v 1.36.4.1 2021/06/25 19:13:20 martin Exp $
 
 .include 
 .include "${NETBSDSRCDIR}/distrib/common/Makefile.distrib"
@@ -50,7 +50,9 @@ HACKSRC=	${DISTRIBDIR}/utils/libhack
 ${CRUNCHBIN}:	libhack.o
 
 install.sub: ${DISTRIBDIR}/miniroot/install.sub
-	${TOOL_SED} -e "/^VERSION=/s/=.*/=${DISTRIBREV}/" < $? > $@
+	${TOOL_SED} -e "/^VERSION=/s/=.*/=${DISTRIBREV}/" \
+		-e "/^RELEASE=/s/=.*/=${DISTRIBVER}/" \
+		-e "/^MACHINE=/s/=.*/=${MACHINE}/" < $? > $@
 
 CLEANFILES+= install.sub
 

Index: src/distrib/sun3/miniroot/Makefile
diff -u src/distrib/sun3/miniroot/Makefile:1.46 src/distrib/sun3/miniroot/Makefile:1.46.4.1
--- src/distrib/sun3/miniroot/Makefile:1.46	Tue Jan 24 18:04:05 2017
+++ src/distrib/sun3/miniroot/Makefile	Fri Jun 25 19:13:20 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.46 2017/01/24 18:04:05 christos Exp $
+#	$NetBSD: Makefile,v 1.46.4.1 2021/06/25 19:13:20 martin Exp $
 
 .include 
 .include "${NETBSDSRCDIR}/distrib/common/Makefile.distrib"
@@ -50,7 +50,9 @@ HACKSRC=	${DISTRIBDIR}/utils/libhack
 ${CRUNCHBIN}:	libhack.o
 
 install.sub: ${DISTRIBDIR}/miniroot/install.sub
-	${TOOL_SED} -e "/^VERSION=/s/=.*/=${DISTRIBREV}/" < $? > $@
+	${TOOL_SED} -e "/^VERSION=/s/=.*/=${DISTRIBREV}/" \
+		-e "/^RELEASE=/s/=.*/=${DISTRIBVER}/" \
+		-e "/^MACHINE=/s/=.*/=${MACHINE}/" < $? > $@
 
 CLEANFILES+= install.sub
 



CVS commit: src/sys/arch/sparc64/doc

2021-06-25 Thread Palle Lyckegaard
Module Name:src
Committed By:   palle
Date:   Fri Jun 25 19:13:12 UTC 2021

Modified Files:
src/sys/arch/sparc64/doc: TODO

Log Message:
sun4v: update TODO file with current sun4v progress


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.43 src/sys/arch/sparc64/doc/TODO

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

Modified files:

Index: src/sys/arch/sparc64/doc/TODO
diff -u src/sys/arch/sparc64/doc/TODO:1.42 src/sys/arch/sparc64/doc/TODO:1.43
--- src/sys/arch/sparc64/doc/TODO:1.42	Sun Jun 13 17:02:14 2021
+++ src/sys/arch/sparc64/doc/TODO	Fri Jun 25 19:13:12 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: TODO,v 1.42 2021/06/13 17:02:14 palle Exp $ */
+/* $NetBSD: TODO,v 1.43 2021/06/25 19:13:12 palle Exp $ */
 
 Things to be done:
 
@@ -20,9 +20,8 @@ sun4v:
 	 but the process crashes when selecting network installation method.
 		 The %i,%l and %o registers are corrupted, after a call to the libcurses
 		 wrefresh() function.
-		 If the sysinst insallation source is local directory, an error in the
-		 ldsk device driver is triggered when a DATA/NACK/DRING_DATA event is received.
-		 The current implementation does not hande this exception properly.
+		 If the sysinst insallation source is local directory, the sets are properly
+		 unpacked, but the system hangs afterwards when running the makedev script.
 	 T2000 ldom with 8 VCPU and 4GB:
 	   - crashes in /sbin/init doing an access() call where %o0 is corrupted (zero)
 	 S7 ldom with 8 VCPU and 16GB (primary ldom is Solaris 11.4 SRU30):



CVS commit: src/sys/arch/sparc64/dev

2021-06-25 Thread Palle Lyckegaard
Module Name:src
Committed By:   palle
Date:   Fri Jun 25 19:10:50 UTC 2021

Modified Files:
src/sys/arch/sparc64/dev: vdsk.c

Log Message:
sun4v: vdsk - restart the ldc state machine when the ldc endpoint resets the 
link or a DATA/NACK/DRING_DATA message is received. These changes make the 
driver more robust. In a ldom with Solaris 11.4 SRU30 as primary domain (T5 
host system) frequent resets and NACK messages are observed.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/sparc64/dev/vdsk.c

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

Modified files:

Index: src/sys/arch/sparc64/dev/vdsk.c
diff -u src/sys/arch/sparc64/dev/vdsk.c:1.6 src/sys/arch/sparc64/dev/vdsk.c:1.7
--- src/sys/arch/sparc64/dev/vdsk.c:1.6	Sat Apr 24 23:36:49 2021
+++ src/sys/arch/sparc64/dev/vdsk.c	Fri Jun 25 19:10:50 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: vdsk.c,v 1.6 2021/04/24 23:36:49 thorpej Exp $	*/
+/*	$NetBSD: vdsk.c,v 1.7 2021/06/25 19:10:50 palle Exp $	*/
 /*	$OpenBSD: vdsk.c,v 1.46 2015/01/25 21:42:13 kettenis Exp $	*/
 /*
  * Copyright (c) 2009, 2011 Mark Kettenis
@@ -492,6 +492,7 @@ vdsk_rx_intr(void *arg)
 			break;
 		case LDC_CHANNEL_RESET:
 			DPRINTF(("Rx link reset\n"));
+			ldc_send_vers(lc);
 			break;
 		}
 		lc->lc_rx_state = rx_state;
@@ -773,6 +774,8 @@ vdsk_rx_vio_dring_data(struct vdsk_softc
 
 		case VIO_SUBTYPE_NACK:
 			DPRINTF(("DATA/NACK/DRING_DATA\n"));
+			struct ldc_conn *lc = &sc->sc_lc;
+			ldc_send_vers(lc);
 			break;
 
 		default:



CVS commit: [netbsd-9] src/doc

2021-06-25 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Jun 25 19:09:53 UTC 2021

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

Log Message:
Ticket #1310


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.10 -r1.1.2.11 src/doc/CHANGES-9.3

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

Modified files:

Index: src/doc/CHANGES-9.3
diff -u src/doc/CHANGES-9.3:1.1.2.10 src/doc/CHANGES-9.3:1.1.2.11
--- src/doc/CHANGES-9.3:1.1.2.10	Tue Jun 22 05:12:27 2021
+++ src/doc/CHANGES-9.3	Fri Jun 25 19:09:53 2021
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-9.3,v 1.1.2.10 2021/06/22 05:12:27 martin Exp $
+# $NetBSD: CHANGES-9.3,v 1.1.2.11 2021/06/25 19:09:53 martin Exp $
 
 A complete list of changes from the NetBSD 9.2 release to the NetBSD 9.3
 release:
@@ -263,3 +263,15 @@ compat/arm/oabi/bsd.oabi.mk		(apply patc
 
 	Fix PR 50192.
 	[mrg, ticket #1309]
+
+distrib/miniroot/install.sub			1.61,1.62
+distrib/sun2/miniroot/Makefile			1.40
+distrib/sun3/miniroot/Makefile			1.50
+
+	Fixes to sun2 and sun3 miniroot upgrade scripts:
+	- Replace RELEASE and VERSION strings proplery.
+	- Remove netstat(1) calls to print resolver info on upgrade using
+	  miniroot, the binary is not available.
+	- The modules and rescue sets are also required on upgrade.
+	[tsutsui, ticket #1310]
+



CVS commit: [netbsd-9] src/distrib

2021-06-25 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Jun 25 19:08:46 UTC 2021

Modified Files:
src/distrib/miniroot [netbsd-9]: install.sub
src/distrib/sun2/miniroot [netbsd-9]: Makefile
src/distrib/sun3/miniroot [netbsd-9]: Makefile

Log Message:
Pull up following revision(s) (requested by tsutsui in ticket #1310):

distrib/sun3/miniroot/Makefile: revision 1.50
distrib/miniroot/install.sub: revision 1.61
distrib/miniroot/install.sub: revision 1.62
distrib/sun2/miniroot/Makefile: revision 1.40

Replace RELEASE and VERSION strings proplery.
sun2 and sun3 don't use MI src/distrib/miniroot/list so this should
have been sync'ed with it.

http://cvsweb.netbsd.org/bsdweb.cgi/src/distrib/miniroot/list#rev1.36
> Use proper release version strings ("9.1" rather than "91") in banners.
>
> Also define and use "MACHINE" variable to describe port names
> (no uname(1) or sysctl(8) in miniroot binary list by default).

Should be pulled up to netbsd-9.

Remove netstat(1) calls to print resolver info on upgrade using miniroot.
netstat(1) was removed from miniroot 25 years ago.
 http://cvsweb.netbsd.org/bsdweb.cgi/src/distrib/miniroot/list#rev1.5

The modules and rescue sets are also required on upgrade.
Should be pulled up to netbsd-9 and netbsd-8.


To generate a diff of this commit:
cvs rdiff -u -r1.48.2.5 -r1.48.2.6 src/distrib/miniroot/install.sub
cvs rdiff -u -r1.36 -r1.36.14.1 src/distrib/sun2/miniroot/Makefile
cvs rdiff -u -r1.47 -r1.47.2.1 src/distrib/sun3/miniroot/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/miniroot/install.sub
diff -u src/distrib/miniroot/install.sub:1.48.2.5 src/distrib/miniroot/install.sub:1.48.2.6
--- src/distrib/miniroot/install.sub:1.48.2.5	Sat Jun  5 10:40:08 2021
+++ src/distrib/miniroot/install.sub	Fri Jun 25 19:08:46 2021
@@ -1,5 +1,5 @@
 #!/bin/sh
-#	$NetBSD: install.sub,v 1.48.2.5 2021/06/05 10:40:08 martin Exp $
+#	$NetBSD: install.sub,v 1.48.2.6 2021/06/25 19:08:46 martin Exp $
 #
 # Copyright (c) 1996 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -40,7 +40,7 @@ RELEASE=10.0# updated by distrib/min
 export RELEASE
 
 ALLSETS="base comp etc games man misc modules rescue text"	# default install sets
-UPGRSETS="base comp games man misc text"		# default upgrade sets
+UPGRSETS="base comp games man misc modules rescue text"		# default upgrade sets
 THESETS=		# one of the above
 
 local_sets_dir=""			# Path searched for sets by install_sets
@@ -606,12 +606,8 @@ fi
 	echo	""
 
 	if [ "${_resolver_enabled:-FALSE}" = "TRUE" ]; then
-		netstat -r
-		echo	""
 		echo	"Resolver enabled."
 	else
-		netstat -rn
-		echo	""
 		echo	"Resolver not enabled."
 	fi
 

Index: src/distrib/sun2/miniroot/Makefile
diff -u src/distrib/sun2/miniroot/Makefile:1.36 src/distrib/sun2/miniroot/Makefile:1.36.14.1
--- src/distrib/sun2/miniroot/Makefile:1.36	Tue Jan 24 18:04:05 2017
+++ src/distrib/sun2/miniroot/Makefile	Fri Jun 25 19:08:46 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.36 2017/01/24 18:04:05 christos Exp $
+#	$NetBSD: Makefile,v 1.36.14.1 2021/06/25 19:08:46 martin Exp $
 
 .include 
 .include "${NETBSDSRCDIR}/distrib/common/Makefile.distrib"
@@ -50,7 +50,9 @@ HACKSRC=	${DISTRIBDIR}/utils/libhack
 ${CRUNCHBIN}:	libhack.o
 
 install.sub: ${DISTRIBDIR}/miniroot/install.sub
-	${TOOL_SED} -e "/^VERSION=/s/=.*/=${DISTRIBREV}/" < $? > $@
+	${TOOL_SED} -e "/^VERSION=/s/=.*/=${DISTRIBREV}/" \
+		-e "/^RELEASE=/s/=.*/=${DISTRIBVER}/" \
+		-e "/^MACHINE=/s/=.*/=${MACHINE}/" < $? > $@
 
 CLEANFILES+= install.sub
 

Index: src/distrib/sun3/miniroot/Makefile
diff -u src/distrib/sun3/miniroot/Makefile:1.47 src/distrib/sun3/miniroot/Makefile:1.47.2.1
--- src/distrib/sun3/miniroot/Makefile:1.47	Sun Jul 28 10:29:49 2019
+++ src/distrib/sun3/miniroot/Makefile	Fri Jun 25 19:08:46 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.47 2019/07/28 10:29:49 martin Exp $
+#	$NetBSD: Makefile,v 1.47.2.1 2021/06/25 19:08:46 martin Exp $
 
 .include 
 .include "${NETBSDSRCDIR}/distrib/common/Makefile.distrib"
@@ -53,7 +53,9 @@ HACK_CURSES=yes
 ${CRUNCHBIN}:	libhack.o
 
 install.sub: ${DISTRIBDIR}/miniroot/install.sub
-	${TOOL_SED} -e "/^VERSION=/s/=.*/=${DISTRIBREV}/" < $? > $@
+	${TOOL_SED} -e "/^VERSION=/s/=.*/=${DISTRIBREV}/" \
+		-e "/^RELEASE=/s/=.*/=${DISTRIBVER}/" \
+		-e "/^MACHINE=/s/=.*/=${MACHINE}/" < $? > $@
 
 CLEANFILES+= install.sub
 



CVS commit: src/sys/arch/alpha

2021-06-25 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Fri Jun 25 18:08:34 UTC 2021

Modified Files:
src/sys/arch/alpha/common: shared_intr.c
src/sys/arch/alpha/jensenio: jensenio_intr.c
src/sys/arch/alpha/pci: pci_1000.c pci_1000a.c pci_2100_a500.c
pci_550.c pci_6600.c pci_eb164.c pci_eb64plus.c pci_eb66.c
pci_kn20aa.c pci_kn300.c pci_machdep.c sio_pic.c

Log Message:
Tweak how the IRQ description strings are generated to enable additional
duplicated code re-factoring.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/sys/arch/alpha/common/shared_intr.c
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/alpha/jensenio/jensenio_intr.c
cvs rdiff -u -r1.28 -r1.29 src/sys/arch/alpha/pci/pci_1000.c
cvs rdiff -u -r1.30 -r1.31 src/sys/arch/alpha/pci/pci_1000a.c \
src/sys/arch/alpha/pci/pci_6600.c src/sys/arch/alpha/pci/pci_machdep.c
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/alpha/pci/pci_2100_a500.c
cvs rdiff -u -r1.39 -r1.40 src/sys/arch/alpha/pci/pci_550.c
cvs rdiff -u -r1.47 -r1.48 src/sys/arch/alpha/pci/pci_eb164.c
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/alpha/pci/pci_eb64plus.c \
src/sys/arch/alpha/pci/pci_eb66.c
cvs rdiff -u -r1.56 -r1.57 src/sys/arch/alpha/pci/pci_kn20aa.c
cvs rdiff -u -r1.40 -r1.41 src/sys/arch/alpha/pci/pci_kn300.c
cvs rdiff -u -r1.49 -r1.50 src/sys/arch/alpha/pci/sio_pic.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/alpha/common/shared_intr.c
diff -u src/sys/arch/alpha/common/shared_intr.c:1.27 src/sys/arch/alpha/common/shared_intr.c:1.28
--- src/sys/arch/alpha/common/shared_intr.c:1.27	Fri May  7 16:58:33 2021
+++ src/sys/arch/alpha/common/shared_intr.c	Fri Jun 25 18:08:34 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: shared_intr.c,v 1.27 2021/05/07 16:58:33 thorpej Exp $ */
+/* $NetBSD: shared_intr.c,v 1.28 2021/06/25 18:08:34 thorpej Exp $ */
 
 /*
  * Copyright (c) 2020 The NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@
 
 #include 			/* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: shared_intr.c,v 1.27 2021/05/07 16:58:33 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: shared_intr.c,v 1.28 2021/06/25 18:08:34 thorpej Exp $");
 
 #include 
 #include 
@@ -170,7 +170,7 @@ alpha_shared_intr_alloc_intrhand(struct 
 	struct alpha_shared_intrhand *ih;
 
 	if (intr[num].intr_sharetype == IST_UNUSABLE) {
-		printf("%s: %s %d: unusable\n", __func__,
+		printf("%s: %s irq %d: unusable\n", __func__,
 		basename, num);
 		return NULL;
 	}
@@ -249,12 +249,12 @@ alpha_shared_intr_link(struct alpha_shar
 	case IST_PULSE:
 		if (type != IST_NONE) {
 			if (intr[num].intr_q.tqh_first == NULL) {
-printf("alpha_shared_intr_establish: %s %d: warning: using %s on %s\n",
+printf("alpha_shared_intr_establish: %s irq %d: warning: using %s on %s\n",
 basename, num, intr_typename(type),
 intr_typename(intr[num].intr_sharetype));
 type = intr[num].intr_sharetype;
 			} else {
-printf("alpha_shared_intr_establish: %s %d: can't share %s with %s\n",
+printf("alpha_shared_intr_establish: %s irq %d: can't share %s with %s\n",
 basename, num, intr_typename(type),
 intr_typename(intr[num].intr_sharetype));
 return (false);
@@ -381,7 +381,7 @@ alpha_shared_intr_stray(struct alpha_sha
 		return;
 
 	if (intr[num].intr_nstrays <= intr[num].intr_maxstrays)
-		log(LOG_ERR, "stray %s %d%s\n", basename, num,
+		log(LOG_ERR, "stray %s irq %d%s\n", basename, num,
 		intr[num].intr_nstrays >= intr[num].intr_maxstrays ?
 		  "; stopped logging" : "");
 }

Index: src/sys/arch/alpha/jensenio/jensenio_intr.c
diff -u src/sys/arch/alpha/jensenio/jensenio_intr.c:1.14 src/sys/arch/alpha/jensenio/jensenio_intr.c:1.15
--- src/sys/arch/alpha/jensenio/jensenio_intr.c:1.14	Fri May  7 16:58:34 2021
+++ src/sys/arch/alpha/jensenio/jensenio_intr.c	Fri Jun 25 18:08:34 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: jensenio_intr.c,v 1.14 2021/05/07 16:58:34 thorpej Exp $ */
+/* $NetBSD: jensenio_intr.c,v 1.15 2021/06/25 18:08:34 thorpej Exp $ */
 
 /*-
  * Copyright (c) 1999, 2000 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include 			/* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: jensenio_intr.c,v 1.14 2021/05/07 16:58:34 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: jensenio_intr.c,v 1.15 2021/06/25 18:08:34 thorpej Exp $");
 
 #include 
 #include 
@@ -269,14 +269,14 @@ jensenio_eisa_intr_establish(void *v, in
 	}
 
 	cookie = alpha_shared_intr_alloc_intrhand(jensenio_eisa_intr, irq,
-	type, level, 0, fn, arg, "eisa irq");
+	type, level, 0, fn, arg, "eisa");
 
 	if (cookie == NULL)
 		return NULL;
 
 	mutex_enter(&cpu_lock);
 
-	if (! alpha_shared_intr_link(jensenio_eisa_intr, cookie, "eisa irq")) {
+	if (! alpha_shared_intr_link(jensenio_eisa_intr, cookie, "eisa")) {
 		mutex_exit(&cpu_lock);
 		alpha_shared_intr_free_intrhand(cookie);
 		return NULL;
@@ -310,7 +310,7 @@ jensenio_ei

CVS commit: src/usr.bin/make

2021-06-25 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Jun 25 16:10:07 UTC 2021

Modified Files:
src/usr.bin/make: for.c
src/usr.bin/make/unit-tests: directive-for-escape.exp
directive-for-escape.mk

Log Message:
make: prevent newline injection in .for loops

When a value of a .for loop contained a literal newline, such as from
the expression ${.newline}, that newline was passed verbatim to the
"expanded current body" of the .for loop.  There it was interpreted as a
literal newline, which ended the current line and started a new one.
This resulted in several syntax errors.

In cases like these, print a more precise error message.


To generate a diff of this commit:
cvs rdiff -u -r1.143 -r1.144 src/usr.bin/make/for.c
cvs rdiff -u -r1.10 -r1.11 \
src/usr.bin/make/unit-tests/directive-for-escape.exp
cvs rdiff -u -r1.9 -r1.10 src/usr.bin/make/unit-tests/directive-for-escape.mk

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/make/for.c
diff -u src/usr.bin/make/for.c:1.143 src/usr.bin/make/for.c:1.144
--- src/usr.bin/make/for.c:1.143	Thu Jun 24 23:19:52 2021
+++ src/usr.bin/make/for.c	Fri Jun 25 16:10:07 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: for.c,v 1.143 2021/06/24 23:19:52 rillig Exp $	*/
+/*	$NetBSD: for.c,v 1.144 2021/06/25 16:10:07 rillig Exp $	*/
 
 /*
  * Copyright (c) 1992, The Regents of the University of California.
@@ -58,7 +58,7 @@
 #include "make.h"
 
 /*	"@(#)for.c	8.1 (Berkeley) 6/6/93"	*/
-MAKE_RCSID("$NetBSD: for.c,v 1.143 2021/06/24 23:19:52 rillig Exp $");
+MAKE_RCSID("$NetBSD: for.c,v 1.144 2021/06/25 16:10:07 rillig Exp $");
 
 
 /* One of the variables to the left of the "in" in a .for loop. */
@@ -325,7 +325,8 @@ NeedsEscapes(const char *value, char end
 	const char *p;
 
 	for (p = value; *p != '\0'; p++) {
-		if (*p == ':' || *p == '$' || *p == '\\' || *p == endc)
+		if (*p == ':' || *p == '$' || *p == '\\' || *p == endc ||
+		*p == '\n')
 			return true;
 	}
 	return false;
@@ -360,6 +361,10 @@ Buf_AddEscaped(Buffer *cmds, const char 
 			Buf_AddByte(cmds, '\\');
 		} else if (ch == ':' || ch == '\\' || ch == endc)
 			Buf_AddByte(cmds, '\\');
+		else if (ch == '\n') {
+			Parse_Error(PARSE_FATAL, "newline in .for value");
+			ch = ' ';	/* prevent newline injection */
+		}
 		Buf_AddByte(cmds, ch);
 	}
 }

Index: src/usr.bin/make/unit-tests/directive-for-escape.exp
diff -u src/usr.bin/make/unit-tests/directive-for-escape.exp:1.10 src/usr.bin/make/unit-tests/directive-for-escape.exp:1.11
--- src/usr.bin/make/unit-tests/directive-for-escape.exp:1.10	Fri Jun 25 15:56:02 2021
+++ src/usr.bin/make/unit-tests/directive-for-escape.exp	Fri Jun 25 16:10:07 2021
@@ -80,17 +80,13 @@ make: "directive-for-escape.mk" line 118
 make: "directive-for-escape.mk" line 119: eight dollardollardollardollar and no cents.
 make: "directive-for-escape.mk" line 128: eight  and no cents.
 For: end for 1
+make: "directive-for-escape.mk" line 135: newline in .for value
+make: "directive-for-escape.mk" line 135: newline in .for value
 For: loop body:
-.  info short: ${:U"
-"}
-.  info long: ${:U"
-"}
-make: Unclosed variable expression, expecting '}' for modifier "U"" of variable "" with value """
-make: "directive-for-escape.mk" line 134: short: "
-make: "directive-for-escape.mk" line 135: Invalid line type
-make: Unclosed variable expression, expecting '}' for modifier "U"" of variable "" with value """
-make: "directive-for-escape.mk" line 136: long: "
-make: "directive-for-escape.mk" line 137: Invalid line type
+.  info short: ${:U" "}
+.  info long: ${:U" "}
+make: "directive-for-escape.mk" line 136: short: " "
+make: "directive-for-escape.mk" line 137: long: " "
 make: Fatal errors encountered -- cannot continue
 make: stopped in unit-tests
 exit status 1

Index: src/usr.bin/make/unit-tests/directive-for-escape.mk
diff -u src/usr.bin/make/unit-tests/directive-for-escape.mk:1.9 src/usr.bin/make/unit-tests/directive-for-escape.mk:1.10
--- src/usr.bin/make/unit-tests/directive-for-escape.mk:1.9	Fri Jun 25 15:56:02 2021
+++ src/usr.bin/make/unit-tests/directive-for-escape.mk	Fri Jun 25 16:10:07 2021
@@ -1,4 +1,4 @@
-# $NetBSD: directive-for-escape.mk,v 1.9 2021/06/25 15:56:02 rillig Exp $
+# $NetBSD: directive-for-escape.mk,v 1.10 2021/06/25 16:10:07 rillig Exp $
 #
 # Test escaping of special characters in the iteration values of a .for loop.
 # These values get expanded later using the :U variable modifier, and this
@@ -128,8 +128,10 @@ ${closing-brace}=		# alte
 .info eight ${$}${$}${$}${$} and no cents.
 
 # What happens if the values from the .for loop contain a literal newline?
-# Oops, the newline is added verbatim to the loop body, where it is later
-# interpreted as an ordinary newline.
+# Before for.c 1.144 from 2021-06-25, the newline was passed verbatim to the
+# body of the .for loop, where it was then interpreted as a literal newline,
+# leading to syntax error

CVS commit: src/usr.bin/make/unit-tests

2021-06-25 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Jun 25 15:56:02 UTC 2021

Modified Files:
src/usr.bin/make/unit-tests: directive-for-escape.exp
directive-for-escape.mk

Log Message:
tests/make: demonstrate newline injection in .for loop


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 \
src/usr.bin/make/unit-tests/directive-for-escape.exp
cvs rdiff -u -r1.8 -r1.9 src/usr.bin/make/unit-tests/directive-for-escape.mk

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/make/unit-tests/directive-for-escape.exp
diff -u src/usr.bin/make/unit-tests/directive-for-escape.exp:1.9 src/usr.bin/make/unit-tests/directive-for-escape.exp:1.10
--- src/usr.bin/make/unit-tests/directive-for-escape.exp:1.9	Thu Jun 24 23:22:17 2021
+++ src/usr.bin/make/unit-tests/directive-for-escape.exp	Fri Jun 25 15:56:02 2021
@@ -79,4 +79,18 @@ For: loop body:
 make: "directive-for-escape.mk" line 118: eight  and no cents.
 make: "directive-for-escape.mk" line 119: eight dollardollardollardollar and no cents.
 make: "directive-for-escape.mk" line 128: eight  and no cents.
-exit status 0
+For: end for 1
+For: loop body:
+.  info short: ${:U"
+"}
+.  info long: ${:U"
+"}
+make: Unclosed variable expression, expecting '}' for modifier "U"" of variable "" with value """
+make: "directive-for-escape.mk" line 134: short: "
+make: "directive-for-escape.mk" line 135: Invalid line type
+make: Unclosed variable expression, expecting '}' for modifier "U"" of variable "" with value """
+make: "directive-for-escape.mk" line 136: long: "
+make: "directive-for-escape.mk" line 137: Invalid line type
+make: Fatal errors encountered -- cannot continue
+make: stopped in unit-tests
+exit status 1

Index: src/usr.bin/make/unit-tests/directive-for-escape.mk
diff -u src/usr.bin/make/unit-tests/directive-for-escape.mk:1.8 src/usr.bin/make/unit-tests/directive-for-escape.mk:1.9
--- src/usr.bin/make/unit-tests/directive-for-escape.mk:1.8	Thu Jun 24 23:22:17 2021
+++ src/usr.bin/make/unit-tests/directive-for-escape.mk	Fri Jun 25 15:56:02 2021
@@ -1,4 +1,4 @@
-# $NetBSD: directive-for-escape.mk,v 1.8 2021/06/24 23:22:17 rillig Exp $
+# $NetBSD: directive-for-escape.mk,v 1.9 2021/06/25 15:56:02 rillig Exp $
 #
 # Test escaping of special characters in the iteration values of a .for loop.
 # These values get expanded later using the :U variable modifier, and this
@@ -127,4 +127,12 @@ closing-brace=		}		# guard against an
 ${closing-brace}=		# alternative interpretation
 .info eight ${$}${$}${$}${$} and no cents.
 
+# What happens if the values from the .for loop contain a literal newline?
+# Oops, the newline is added verbatim to the loop body, where it is later
+# interpreted as an ordinary newline.
+.for i in "${.newline}"
+.  info short: $i
+.  info long: ${i}
+.endfor
+
 all:



CVS commit: src/sys/arch/alpha/pci

2021-06-25 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Fri Jun 25 13:41:34 UTC 2021

Modified Files:
src/sys/arch/alpha/pci: pci_2100_a50.c pci_axppci_33.c sio_pic.c
siovar.h

Log Message:
Reduce code duplication among platforms that use the i82378 SIO to
route PCI interrupts to the ISA PIC by refactoring it into a new
sio_pirq_intr_map() function.


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 src/sys/arch/alpha/pci/pci_2100_a50.c
cvs rdiff -u -r1.40 -r1.41 src/sys/arch/alpha/pci/pci_axppci_33.c
cvs rdiff -u -r1.48 -r1.49 src/sys/arch/alpha/pci/sio_pic.c
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/alpha/pci/siovar.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/alpha/pci/pci_2100_a50.c
diff -u src/sys/arch/alpha/pci/pci_2100_a50.c:1.43 src/sys/arch/alpha/pci/pci_2100_a50.c:1.44
--- src/sys/arch/alpha/pci/pci_2100_a50.c:1.43	Sat Jun 19 16:59:07 2021
+++ src/sys/arch/alpha/pci/pci_2100_a50.c	Fri Jun 25 13:41:33 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: pci_2100_a50.c,v 1.43 2021/06/19 16:59:07 thorpej Exp $ */
+/* $NetBSD: pci_2100_a50.c,v 1.44 2021/06/25 13:41:33 thorpej Exp $ */
 
 /*
  * Copyright (c) 1995, 1996 Carnegie-Mellon University.
@@ -29,7 +29,7 @@
 
 #include 			/* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: pci_2100_a50.c,v 1.43 2021/06/19 16:59:07 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pci_2100_a50.c,v 1.44 2021/06/25 13:41:33 thorpej Exp $");
 
 #include 
 #include 
@@ -57,21 +57,10 @@ __KERNEL_RCSID(0, "$NetBSD: pci_2100_a50
 static int	dec_2100_a50_intr_map(const struct pci_attach_args *,
 		pci_intr_handle_t *);
 
-#define	APECS_SIO_DEVICE	7	/* XXX */
-
 static void
 pci_2100_a50_pickintr(void *core, bus_space_tag_t iot, bus_space_tag_t memt,
 pci_chipset_tag_t pc)
 {
-	pcireg_t sioclass;
-	int sioII;
-
-	/* XXX MAGIC NUMBER */
-	sioclass = pci_conf_read(pc, pci_make_tag(pc, 0, 7, 0), PCI_CLASS_REG);
-	sioII = (sioclass & 0xff) >= 3;
-
-	if (!sioII)
-		printf("WARNING: SIO NOT SIO II... NO BETS...\n");
 
 	pc->pc_intr_v = core;
 	pc->pc_intr_map = dec_2100_a50_intr_map;
@@ -98,8 +87,6 @@ dec_2100_a50_intr_map(const struct pci_a
 	int buspin = pa->pa_intrpin;
 	pci_chipset_tag_t pc = pa->pa_pc;
 	int device, pirq;
-	pcireg_t pirqreg;
-	uint8_t pirqline;
 
 #ifndef DIAGNOSTIC
 	pirq = 0;/* XXX gcc -Wuninitialized */
@@ -189,22 +176,10 @@ dec_2100_a50_intr_map(const struct pci_a
 	return 1;
 	}
 
-	pirqreg = pci_conf_read(pc, pci_make_tag(pc, 0, APECS_SIO_DEVICE, 0),
-	SIO_PCIREG_PIRQ_RTCTRL);
-#if 0
-	printf("pci_2100_a50_intr_map: device %d pin %c: pirq %d, reg = %x\n",
-		device, '@' + buspin, pirq, pirqreg);
-#endif
-	pirqline = (pirqreg >> (pirq * 8)) & 0xff;
-	if ((pirqline & 0x80) != 0)
-		return 1;
-	pirqline &= 0xf;
-
 #if 0
-	printf("pci_2100_a50_intr_map: device %d pin %c: mapped to line %d\n",
-	device, '@' + buspin, pirqline);
+	printf("pci_2100_a50_intr_map: device %d pin %c: pirq %d\n",
+		device, '@' + buspin, pirq);
 #endif
 
-	alpha_pci_intr_handle_init(ihp, pirqline, 0);
-	return (0);
+	return sio_pirq_intr_map(pc, pirq, ihp);
 }

Index: src/sys/arch/alpha/pci/pci_axppci_33.c
diff -u src/sys/arch/alpha/pci/pci_axppci_33.c:1.40 src/sys/arch/alpha/pci/pci_axppci_33.c:1.41
--- src/sys/arch/alpha/pci/pci_axppci_33.c:1.40	Sat Jun 19 16:59:07 2021
+++ src/sys/arch/alpha/pci/pci_axppci_33.c	Fri Jun 25 13:41:33 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: pci_axppci_33.c,v 1.40 2021/06/19 16:59:07 thorpej Exp $ */
+/* $NetBSD: pci_axppci_33.c,v 1.41 2021/06/25 13:41:33 thorpej Exp $ */
 
 /*
  * Copyright (c) 1995, 1996 Carnegie-Mellon University.
@@ -29,7 +29,7 @@
 
 #include 			/* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: pci_axppci_33.c,v 1.40 2021/06/19 16:59:07 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pci_axppci_33.c,v 1.41 2021/06/25 13:41:33 thorpej Exp $");
 
 #include 
 #include 
@@ -57,22 +57,10 @@ __KERNEL_RCSID(0, "$NetBSD: pci_axppci_3
 static int	dec_axppci_33_intr_map(const struct pci_attach_args *,
 		pci_intr_handle_t *);
 
-#define	LCA_SIO_DEVICE	7	/* XXX */
-
 static void
 pci_axppci_33_pickintr(void *core, bus_space_tag_t iot, bus_space_tag_t memt,
 pci_chipset_tag_t pc)
 {
-	pcireg_t sioclass;
-	int sioII;
-
-	/* XXX MAGIC NUMBER */
-	sioclass = pci_conf_read(pc, pci_make_tag(pc, 0, LCA_SIO_DEVICE, 0),
-	PCI_CLASS_REG);
-	sioII = (sioclass & 0xff) >= 3;
-
-	if (!sioII)
-		printf("WARNING: SIO NOT SIO II... NO BETS...\n");
 
 	pc->pc_intr_v = core;
 	pc->pc_intr_map = dec_axppci_33_intr_map;
@@ -99,8 +87,6 @@ dec_axppci_33_intr_map(const struct pci_
 	int buspin = pa->pa_intrpin;
 	pci_chipset_tag_t pc = pa->pa_pc;
 	int device, pirq;
-	pcireg_t pirqreg;
-	uint8_t pirqline;
 
 #ifndef DIAGNOSTIC
 	pirq = 0;/* XXX gcc -Wuninitialized */
@@ -189,22 +175,10 @@ dec_axppci_33_intr_map(const struct pci_
 	return 1;
 	}
 
-	pirqreg = pci_con

CVS commit: src/sys/arch/alpha/pci

2021-06-25 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Fri Jun 25 13:38:21 UTC 2021

Modified Files:
src/sys/arch/alpha/pci: pci_alphabook1.c

Log Message:
Remove pointless warning.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/alpha/pci/pci_alphabook1.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/alpha/pci/pci_alphabook1.c
diff -u src/sys/arch/alpha/pci/pci_alphabook1.c:1.19 src/sys/arch/alpha/pci/pci_alphabook1.c:1.20
--- src/sys/arch/alpha/pci/pci_alphabook1.c:1.19	Sat Jun 19 16:59:07 2021
+++ src/sys/arch/alpha/pci/pci_alphabook1.c	Fri Jun 25 13:38:21 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: pci_alphabook1.c,v 1.19 2021/06/19 16:59:07 thorpej Exp $ */
+/* $NetBSD: pci_alphabook1.c,v 1.20 2021/06/25 13:38:21 thorpej Exp $ */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -59,7 +59,7 @@
 
 #include 			/* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: pci_alphabook1.c,v 1.19 2021/06/19 16:59:07 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pci_alphabook1.c,v 1.20 2021/06/25 13:38:21 thorpej Exp $");
 
 #include 
 #include 
@@ -85,22 +85,10 @@ __KERNEL_RCSID(0, "$NetBSD: pci_alphaboo
 static int	dec_alphabook1_intr_map(const struct pci_attach_args *,
 		pci_intr_handle_t *);
 
-#define	LCA_SIO_DEVICE	7	/* XXX */
-
 static void
 pci_alphabook1_pickintr(void *core, bus_space_tag_t iot, bus_space_tag_t memt,
 pci_chipset_tag_t pc)
 {
-	pcireg_t sioclass;
-	int sioII;
-
-	/* XXX MAGIC NUMBER */
-	sioclass = pci_conf_read(pc, pci_make_tag(pc, 0, LCA_SIO_DEVICE, 0),
-	PCI_CLASS_REG);
-	sioII = (sioclass & 0xff) >= 3;
-
-	if (!sioII)
-		printf("WARNING: SIO NOT SIO II... NO BETS...\n");
 
 	pc->pc_intr_v = core;
 	pc->pc_intr_map = dec_alphabook1_intr_map;



CVS commit: src/sys/arch/alpha/pci

2021-06-25 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Fri Jun 25 13:32:39 UTC 2021

Modified Files:
src/sys/arch/alpha/pci: sioreg.h

Log Message:
Define macros to desribe the PIRQ_RTCTRL register(s).


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/alpha/pci/sioreg.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/alpha/pci/sioreg.h
diff -u src/sys/arch/alpha/pci/sioreg.h:1.2 src/sys/arch/alpha/pci/sioreg.h:1.3
--- src/sys/arch/alpha/pci/sioreg.h:1.2	Mon Apr  7 02:00:07 1997
+++ src/sys/arch/alpha/pci/sioreg.h	Fri Jun 25 13:32:39 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: sioreg.h,v 1.2 1997/04/07 02:00:07 cgd Exp $ */
+/* $NetBSD: sioreg.h,v 1.3 2021/06/25 13:32:39 thorpej Exp $ */
 
 /*
  * Copyright (c) 1996 BBN Corporation.
@@ -83,6 +83,13 @@
 #define	SIO_PCIREG_PIRQ3	0x63	/* PIRQ3 Route Control */
 #define	SIO_PCIREG_PIRQ_RTCTRL	SIO_PCIREG_PIRQ0
 
+	/* extract the PIRQx field from 32-bit reg */
+#define	PIRQ_RTCTRL_PIRQx(r, p)	(((r) >> ((p) * 8)) & 0xff)
+
+	/* bits within each PIRQx field */
+#define	PIRQ_RTCTRL_NOT_ROUTED	__BIT(7)/* 0 == interrupt routed */
+#define	PIRQ_RTCTRL_IRQ		__BITS(0,3) /* PIRQ routed to this ISA IRQ */
+
 /*
  * System Management Interrupt (SMI)
  */



CVS commit: src/sys/dev/fdt

2021-06-25 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Fri Jun 25 08:41:09 UTC 2021

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

Log Message:
fdt "/reserved-memory" node should be handled


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

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

Modified files:

Index: src/sys/dev/fdt/fdt_memory.c
diff -u src/sys/dev/fdt/fdt_memory.c:1.1 src/sys/dev/fdt/fdt_memory.c:1.2
--- src/sys/dev/fdt/fdt_memory.c:1.1	Sat Dec 12 09:27:31 2020
+++ src/sys/dev/fdt/fdt_memory.c	Fri Jun 25 08:41:09 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: fdt_memory.c,v 1.1 2020/12/12 09:27:31 skrll Exp $ */
+/* $NetBSD: fdt_memory.c,v 1.2 2021/06/25 08:41:09 ryo Exp $ */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
 #include "opt_fdt.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: fdt_memory.c,v 1.1 2020/12/12 09:27:31 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fdt_memory.c,v 1.2 2021/06/25 08:41:09 ryo Exp $");
 
 #include 
 #include 
@@ -111,7 +111,7 @@ fdt_memory_remove_reserved(uint64_t min_
 {
 	uint64_t lstart = 0, lend = 0;
 	uint64_t addr, size;
-	int index, error;
+	int index, error, phandle, child;
 
 	const int num = fdt_num_mem_rsv(fdtbus_get_data());
 	for (index = 0; index <= num; index++) {
@@ -139,6 +139,24 @@ fdt_memory_remove_reserved(uint64_t min_
 		lstart = addr;
 		lend = addr + size;
 	}
+
+	/*
+	 * "no-map" ranges defined in the /reserved-memory node
+	 * must also be excluded.
+	 */
+	phandle = OF_finddevice("/reserved-memory");
+	if (phandle != -1) {
+		for (child = OF_child(phandle); child; child = OF_peer(child)) {
+			if (!of_hasprop(child, "no-map"))
+continue;
+
+			if (fdtbus_get_reg(child, 0, &addr, &size) != 0)
+continue;
+			if (size == 0)
+continue;
+			fdt_memory_remove_range(addr, size);
+		}
+	}
 }
 
 void



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

2021-06-25 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Jun 25 07:03:28 UTC 2021

Modified Files:
src/sys/arch/arm/dts: sun50i-a64-sopine-baseboard.dts

Log Message:
PR/56095 SOPINE Clusterboard unable to transmit network data

Add allwinner,tx-delay-ps = <500> using the diff supplied by tnn@


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/arm/dts/sun50i-a64-sopine-baseboard.dts

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

Modified files:

Index: src/sys/arch/arm/dts/sun50i-a64-sopine-baseboard.dts
diff -u src/sys/arch/arm/dts/sun50i-a64-sopine-baseboard.dts:1.2 src/sys/arch/arm/dts/sun50i-a64-sopine-baseboard.dts:1.3
--- src/sys/arch/arm/dts/sun50i-a64-sopine-baseboard.dts:1.2	Sun Nov 17 17:35:10 2019
+++ src/sys/arch/arm/dts/sun50i-a64-sopine-baseboard.dts	Fri Jun 25 07:03:28 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: sun50i-a64-sopine-baseboard.dts,v 1.2 2019/11/17 17:35:10 jmcneill Exp $ */
+/* $NetBSD: sun50i-a64-sopine-baseboard.dts,v 1.3 2021/06/25 07:03:28 skrll Exp $ */
 
 /*-
  * Copyright (c) 2018 Jared McNeill 
@@ -36,3 +36,8 @@
 &sound_hdmi {
 	status = "okay";
 };
+
+&emac {
+	allwinner,tx-delay-ps = <500>;
+};
+