CVS commit: src/usr.bin/make

2020-04-02 Thread Simon J. Gerraty
Module Name:src
Committed By:   sjg
Date:   Fri Apr  3 03:35:16 UTC 2020

Modified Files:
src/usr.bin/make: make.h

Log Message:
Revert arraycount


To generate a diff of this commit:
cvs rdiff -u -r1.106 -r1.107 src/usr.bin/make/make.h

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

Modified files:

Index: src/usr.bin/make/make.h
diff -u src/usr.bin/make/make.h:1.106 src/usr.bin/make/make.h:1.107
--- src/usr.bin/make/make.h:1.106	Fri Apr  3 03:32:28 2020
+++ src/usr.bin/make/make.h	Fri Apr  3 03:35:16 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: make.h,v 1.106 2020/04/03 03:32:28 sjg Exp $	*/
+/*	$NetBSD: make.h,v 1.107 2020/04/03 03:35:16 sjg Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -532,8 +532,4 @@ int cached_stat(const char *, void *);
 #define KILLPG(pid, sig)	killpg((pid), (sig))
 #endif
 
-#ifndef __arraycount
-#define __arraycount(__x)	(sizeof(__x) / sizeof(__x[0]))
-#endif
-
 #endif /* _MAKE_H_ */



CVS commit: src/usr.bin/make

2020-04-02 Thread Simon J. Gerraty
Module Name:src
Committed By:   sjg
Date:   Fri Apr  3 03:32:28 UTC 2020

Modified Files:
src/usr.bin/make: make.h meta.c

Log Message:
CHECK_VALID_META is too agressive for CMD check.

An empty CMD is perfectly valid.
So using CHECK_VALID_META results in too much rebuilding.


To generate a diff of this commit:
cvs rdiff -u -r1.105 -r1.106 src/usr.bin/make/make.h
cvs rdiff -u -r1.80 -r1.81 src/usr.bin/make/meta.c

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

Modified files:

Index: src/usr.bin/make/make.h
diff -u src/usr.bin/make/make.h:1.105 src/usr.bin/make/make.h:1.106
--- src/usr.bin/make/make.h:1.105	Mon Mar 30 02:41:06 2020
+++ src/usr.bin/make/make.h	Fri Apr  3 03:32:28 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: make.h,v 1.105 2020/03/30 02:41:06 sjg Exp $	*/
+/*	$NetBSD: make.h,v 1.106 2020/04/03 03:32:28 sjg Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -532,4 +532,8 @@ int cached_stat(const char *, void *);
 #define KILLPG(pid, sig)	killpg((pid), (sig))
 #endif
 
+#ifndef __arraycount
+#define __arraycount(__x)	(sizeof(__x) / sizeof(__x[0]))
+#endif
+
 #endif /* _MAKE_H_ */

Index: src/usr.bin/make/meta.c
diff -u src/usr.bin/make/meta.c:1.80 src/usr.bin/make/meta.c:1.81
--- src/usr.bin/make/meta.c:1.80	Wed Mar 18 23:53:02 2020
+++ src/usr.bin/make/meta.c	Fri Apr  3 03:32:28 2020
@@ -1,4 +1,4 @@
-/*  $NetBSD: meta.c,v 1.80 2020/03/18 23:53:02 sjg Exp $ */
+/*  $NetBSD: meta.c,v 1.81 2020/04/03 03:32:28 sjg Exp $ */
 
 /*
  * Implement 'meta' mode.
@@ -1558,8 +1558,8 @@ meta_oodate(GNode *gn, Boolean oodate)
 			if (buf[x - 1] == '\n')
 			buf[x - 1] = '\0';
 		}
-		CHECK_VALID_META(p);
-		if (!hasOODATE &&
+		if (p &&
+			!hasOODATE &&
 			!(gn->type & OP_NOMETA_CMP) &&
 			strcmp(p, cmd) != 0) {
 			if (DEBUG(META))



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

2020-04-02 Thread Kengo NAKAHARA
Module Name:src
Committed By:   knakahara
Date:   Fri Apr  3 03:05:39 UTC 2020

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

Log Message:
Fix TSC drift is observed almost every time wrongly.

Ths "TSC drift" in tsc_tc_init() means the cpu_cc_skew delta between
first measurement (in cpu_start_secondary) and second measurement
(in cpu_boot_secondary), that is, the TSC drift is expected to be
almost zero.  However, the second measument in current implementation
is added extra cpu_cc_skew accidentally, so current delta value means
almost cpu_cc_skew wrongly.

tsc_sync_bp and tsc_sync_ap should use rdtsc() to get raw values.

Advised by nonaka@n.o, thanks.


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/sys/arch/x86/x86/tsc.c

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

Modified files:

Index: src/sys/arch/x86/x86/tsc.c
diff -u src/sys/arch/x86/x86/tsc.c:1.38 src/sys/arch/x86/x86/tsc.c:1.39
--- src/sys/arch/x86/x86/tsc.c:1.38	Fri Feb 21 00:26:22 2020
+++ src/sys/arch/x86/x86/tsc.c	Fri Apr  3 03:05:39 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: tsc.c,v 1.38 2020/02/21 00:26:22 joerg Exp $	*/
+/*	$NetBSD: tsc.c,v 1.39 2020/04/03 03:05:39 knakahara Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: tsc.c,v 1.38 2020/02/21 00:26:22 joerg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tsc.c,v 1.39 2020/04/03 03:05:39 knakahara Exp $");
 
 #include 
 #include 
@@ -201,13 +201,13 @@ tsc_read_bp(struct cpu_info *ci, uint64_
 
 	/* Flag it and read our TSC. */
 	atomic_or_uint(>ci_flags, CPUF_SYNCTSC);
-	bptsc = cpu_counter_serializing() >> 1;
+	bptsc = (rdtsc() >> 1);
 
 	/* Wait for remote to complete, and read ours again. */
 	while ((ci->ci_flags & CPUF_SYNCTSC) != 0) {
 		__insn_barrier();
 	}
-	bptsc += (cpu_counter_serializing() >> 1);
+	bptsc += (rdtsc() >> 1);
 
 	/* Wait for the results to come in. */
 	while (tsc_sync_cpu == ci) {
@@ -246,11 +246,11 @@ tsc_post_ap(struct cpu_info *ci)
 	while ((ci->ci_flags & CPUF_SYNCTSC) == 0) {
 		__insn_barrier();
 	}
-	tsc = (cpu_counter_serializing() >> 1);
+	tsc = (rdtsc() >> 1);
 
 	/* Instruct primary to read its counter. */
 	atomic_and_uint(>ci_flags, ~CPUF_SYNCTSC);
-	tsc += (cpu_counter_serializing() >> 1);
+	tsc += (rdtsc() >> 1);
 
 	/* Post result.  Ensure the whole value goes out atomically. */
 	(void)atomic_swap_64(_sync_val, tsc);



CVS commit: src/usr.bin/kdump

2020-04-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Apr  2 21:36:04 UTC 2020

Modified Files:
src/usr.bin/kdump: mkioctls

Log Message:
remove debugging


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 src/usr.bin/kdump/mkioctls

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/kdump/mkioctls
diff -u src/usr.bin/kdump/mkioctls:1.55 src/usr.bin/kdump/mkioctls:1.56
--- src/usr.bin/kdump/mkioctls:1.55	Thu Apr  2 13:41:34 2020
+++ src/usr.bin/kdump/mkioctls	Thu Apr  2 17:36:03 2020
@@ -1,5 +1,5 @@
 #!/bin/sh
-#	$NetBSD: mkioctls,v 1.55 2020/04/02 17:41:34 christos Exp $
+#	$NetBSD: mkioctls,v 1.56 2020/04/02 21:36:03 christos Exp $
 #
 # Copyright (c) 1994
 #	The Regents of the University of California.  All rights reserved.
@@ -39,9 +39,6 @@
 : ${CC:=cc}
 : ${SED:=sed}
 
-set -x
-AWK=gawk
-
 echo "/* Automatically generated file, do not edit! */"
 #echo "#define const" 	# XXX: timepps lossage
 echo "#define COMPAT_43"



CVS commit: src/share/man/man7

2020-04-02 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Thu Apr  2 20:57:20 UTC 2020

Modified Files:
src/share/man/man7: groups.7 users.7

Log Message:
Add _dhcpcd entries.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/share/man/man7/groups.7
cvs rdiff -u -r1.4 -r1.5 src/share/man/man7/users.7

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

Modified files:

Index: src/share/man/man7/groups.7
diff -u src/share/man/man7/groups.7:1.7 src/share/man/man7/groups.7:1.8
--- src/share/man/man7/groups.7:1.7	Fri Feb 28 07:31:38 2020
+++ src/share/man/man7/groups.7	Thu Apr  2 20:57:20 2020
@@ -1,4 +1,4 @@
-.\"	$NetBSD: groups.7,v 1.7 2020/02/28 07:31:38 kim Exp $
+.\"	$NetBSD: groups.7,v 1.8 2020/04/02 20:57:20 roy Exp $
 .\"
 .\" Copyright (c) 2020 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -24,7 +24,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd February 25, 2020
+.Dd April 2, 2020
 .Dt GROUPS 7
 .Os
 .\"
@@ -251,6 +251,12 @@ Users authorized to read and write GPIO 
 .Xr gpio 4
 and
 .Xr gpioctl 8 .
+.It Em _dhcpcd
+Primary group for the
+.Em _dhcpcd
+pseudo-user used by the
+.Xr dhcpcd 8
+DHCP Client Daemon.
 .It Em _rtadvd
 Primary group for the
 .Em _rtadvd

Index: src/share/man/man7/users.7
diff -u src/share/man/man7/users.7:1.4 src/share/man/man7/users.7:1.5
--- src/share/man/man7/users.7:1.4	Fri Feb 28 07:30:51 2020
+++ src/share/man/man7/users.7	Thu Apr  2 20:57:20 2020
@@ -1,4 +1,4 @@
-.\"	$NetBSD: users.7,v 1.4 2020/02/28 07:30:51 kim Exp $
+.\"	$NetBSD: users.7,v 1.5 2020/04/02 20:57:20 roy Exp $
 .\"
 .\" Copyright (c) 2020 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -24,7 +24,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd February 25, 2020
+.Dd April 2, 2020
 .Dt USERS 7
 .Os
 .\"
@@ -168,6 +168,10 @@ Pseudo-user for use by the
 .Xr tcsd 8
 .Sq Trusted Computing
 daemon TPM to manage a TPM.
+.It Em _dhcpcd
+Pseudo-user for use by the
+.Xr dhcpcd 8
+DHCP Client Daemon.
 .It Em _rtadvd
 Pseudo-user for use by the
 .Xr rtadvd 8



CVS commit: [netbsd-9] src/doc

2020-04-02 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Apr  2 19:24:39 UTC 2020

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

Log Message:
Ticket #818


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.28 -r1.1.2.29 src/doc/CHANGES-9.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-9.1
diff -u src/doc/CHANGES-9.1:1.1.2.28 src/doc/CHANGES-9.1:1.1.2.29
--- src/doc/CHANGES-9.1:1.1.2.28	Thu Apr  2 19:22:05 2020
+++ src/doc/CHANGES-9.1	Thu Apr  2 19:24:39 2020
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-9.1,v 1.1.2.28 2020/04/02 19:22:05 martin Exp $
+# $NetBSD: CHANGES-9.1,v 1.1.2.29 2020/04/02 19:24:39 martin Exp $
 
 A complete list of changes from the NetBSD 9.0 release to the NetBSD 9.1
 release:
@@ -783,3 +783,9 @@ sys/arch/evbarm/conf/GENERIC64			1.136
 	Add MIDI sequencer device. Now midiplay works on usb midi devices.
 	[mrg, ticket #817]
 
+sys/dev/pckbport/synaptics.c			1.64
+
+	pms(4): synaptics: maintain the left/right buttons when
+	up/down are remapped.
+	[nia, ticket #818]
+



CVS commit: [netbsd-9] src/sys/dev/pckbport

2020-04-02 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Apr  2 19:23:42 UTC 2020

Modified Files:
src/sys/dev/pckbport [netbsd-9]: synaptics.c

Log Message:
Pull up following revision(s) (requested by nia in ticket #818):

sys/dev/pckbport/synaptics.c: revision 1.64

synaptics: Maintain the left/right buttons when up/down are remapped
Reported on current-users by Mandacar� Cascavel


To generate a diff of this commit:
cvs rdiff -u -r1.50.2.2 -r1.50.2.3 src/sys/dev/pckbport/synaptics.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/pckbport/synaptics.c
diff -u src/sys/dev/pckbport/synaptics.c:1.50.2.2 src/sys/dev/pckbport/synaptics.c:1.50.2.3
--- src/sys/dev/pckbport/synaptics.c:1.50.2.2	Mon Mar 30 18:47:33 2020
+++ src/sys/dev/pckbport/synaptics.c	Thu Apr  2 19:23:41 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: synaptics.c,v 1.50.2.2 2020/03/30 18:47:33 martin Exp $	*/
+/*	$NetBSD: synaptics.c,v 1.50.2.3 2020/04/02 19:23:41 martin Exp $	*/
 
 /*
  * Copyright (c) 2005, Steve C. Woodford
@@ -48,7 +48,7 @@
 #include "opt_pms.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: synaptics.c,v 1.50.2.2 2020/03/30 18:47:33 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: synaptics.c,v 1.50.2.3 2020/04/02 19:23:41 martin Exp $");
 
 #include 
 #include 
@@ -1109,8 +1109,8 @@ pms_synaptics_parse(struct pms_softc *ps
 			break;
 		case 3:
 			/* Do left/right button emulation using up/down buttons */
-			sp.sp_left = sp.sp_up;
-			sp.sp_right = sp.sp_down;
+			sp.sp_left = sp.sp_left | sp.sp_up;
+			sp.sp_right = sp.sp_right | sp.sp_down;
 			sp.sp_up = sp.sp_down = 0;
 			break;
 		default:



CVS commit: [netbsd-9] src/doc

2020-04-02 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Apr  2 19:22:05 UTC 2020

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

Log Message:
Tickets #812, #814, #816, #817


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.27 -r1.1.2.28 src/doc/CHANGES-9.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-9.1
diff -u src/doc/CHANGES-9.1:1.1.2.27 src/doc/CHANGES-9.1:1.1.2.28
--- src/doc/CHANGES-9.1:1.1.2.27	Mon Mar 30 18:58:35 2020
+++ src/doc/CHANGES-9.1	Thu Apr  2 19:22:05 2020
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-9.1,v 1.1.2.27 2020/03/30 18:58:35 martin Exp $
+# $NetBSD: CHANGES-9.1,v 1.1.2.28 2020/04/02 19:22:05 martin Exp $
 
 A complete list of changes from the NetBSD 9.0 release to the NetBSD 9.1
 release:
@@ -758,3 +758,28 @@ include/stdio.h	1.98
 	Move P_tmpdir from "/var/tmp/" to "/tmp/".
 	[mrg, ticket #811]
 
+etc/crontab	1.16
+
+	Fix skipped daily in Eastern Europe:
+	- Move /etc/daily from 03:15 -> 04:15
+	- Move /etc/weekly from 04:30 -> 05:30
+	[kim, ticket #812]
+
+sys/dev/scsipi/cd.c1.343
+sys/kern/subr_disk.c1.130
+
+	Avoid division by zero if label isn't valid.
+	Allow open of RAWPART even when no medium is loaded.
+	[mlelstv, ticket #814]
+
+sys/sys/stdarg.h1.5
+
+	Use __builtin_va_start for clang as well.
+	[joerg, ticket #816]
+
+sys/arch/evbarm/conf/GENERIC			1.73
+sys/arch/evbarm/conf/GENERIC64			1.136
+
+	Add MIDI sequencer device. Now midiplay works on usb midi devices.
+	[mrg, ticket #817]
+



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

2020-04-02 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Apr  2 19:20:07 UTC 2020

Modified Files:
src/sys/arch/evbarm/conf [netbsd-9]: GENERIC GENERIC64

Log Message:
Pull up following revision(s) (requested by mrg in ticket #817):

sys/arch/evbarm/conf/GENERIC: revision 1.73
sys/arch/evbarm/conf/GENERIC64: revision 1.136

add MIDI sequencer device.  now midiplay works on usb midi devices.


To generate a diff of this commit:
cvs rdiff -u -r1.48.2.6 -r1.48.2.7 src/sys/arch/evbarm/conf/GENERIC
cvs rdiff -u -r1.103.2.8 -r1.103.2.9 src/sys/arch/evbarm/conf/GENERIC64

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

Modified files:

Index: src/sys/arch/evbarm/conf/GENERIC
diff -u src/sys/arch/evbarm/conf/GENERIC:1.48.2.6 src/sys/arch/evbarm/conf/GENERIC:1.48.2.7
--- src/sys/arch/evbarm/conf/GENERIC:1.48.2.6	Mon Jan 27 07:06:02 2020
+++ src/sys/arch/evbarm/conf/GENERIC	Thu Apr  2 19:20:07 2020
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: GENERIC,v 1.48.2.6 2020/01/27 07:06:02 martin Exp $
+#	$NetBSD: GENERIC,v 1.48.2.7 2020/04/02 19:20:07 martin Exp $
 #
 #	GENERIC ARM (aarch32) kernel
 #
@@ -754,5 +754,6 @@ uk* 		at scsibus? target ? lun ?	# unkno
 
 include "dev/usb/usbdevices.config"
 midi* 		at midibus?
+pseudo-device	sequencer			# MIDI sequencer
 
 cinclude "arch/evbarm/conf/GENERIC.local"

Index: src/sys/arch/evbarm/conf/GENERIC64
diff -u src/sys/arch/evbarm/conf/GENERIC64:1.103.2.8 src/sys/arch/evbarm/conf/GENERIC64:1.103.2.9
--- src/sys/arch/evbarm/conf/GENERIC64:1.103.2.8	Mon Jan 27 07:06:02 2020
+++ src/sys/arch/evbarm/conf/GENERIC64	Thu Apr  2 19:20:07 2020
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: GENERIC64,v 1.103.2.8 2020/01/27 07:06:02 martin Exp $
+#	$NetBSD: GENERIC64,v 1.103.2.9 2020/04/02 19:20:07 martin Exp $
 #
 #	GENERIC ARM (aarch64) kernel
 #
@@ -508,6 +508,7 @@ usb*		at usbus?
 
 include "dev/usb/usbdevices.config"
 midi*		at midibus?
+pseudo-device	sequencer			# MIDI sequencer
 
 # Virtio devices
 virtio*		at fdt?			# Virtio MMIO device



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

2020-04-02 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Apr  2 19:17:04 UTC 2020

Modified Files:
src/sys/sys [netbsd-9]: stdarg.h

Log Message:
Pull up following revision(s) (requested by joerg in ticket #816):

sys/sys/stdarg.h: revision 1.5

Use __builtin_va_start for clang as well. This avoids a bug in the
warning engine for the compatibility alias.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.4.24.1 src/sys/sys/stdarg.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/sys/stdarg.h
diff -u src/sys/sys/stdarg.h:1.4 src/sys/sys/stdarg.h:1.4.24.1
--- src/sys/sys/stdarg.h:1.4	Fri Aug 15 11:58:13 2014
+++ src/sys/sys/stdarg.h	Thu Apr  2 19:17:04 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: stdarg.h,v 1.4 2014/08/15 11:58:13 matt Exp $	*/
+/*	$NetBSD: stdarg.h,v 1.4.24.1 2020/04/02 19:17:04 martin Exp $	*/
 
 /*-
  * Copyright (c) 1991, 1993
@@ -45,7 +45,7 @@
 #define	__builtin_va_end(a)		/* nothing */
 #define	__builtin_va_copy(d, s)		((d) = (s))
 #elif !(__GNUC_PREREQ__(4, 5) || \
-(__GNUC_PREREQ__(4, 4) && __GNUC_PATCHLEVEL__ > 2))
+(__GNUC_PREREQ__(4, 4) && __GNUC_PATCHLEVEL__ > 2) || defined(__clang__))
 #define __builtin_va_start(ap, last)__builtin_stdarg_start((ap), (last))
 #endif
 



CVS commit: [netbsd-9] src/sys

2020-04-02 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Apr  2 19:15:35 UTC 2020

Modified Files:
src/sys/dev/scsipi [netbsd-9]: cd.c
src/sys/kern [netbsd-9]: subr_disk.c

Log Message:
Pull up following revision(s) (requested by mlelstv in ticket #814):

sys/dev/scsipi/cd.c: revision 1.343
sys/kern/subr_disk.c: revision 1.130

Avoid division by zero if label isn't valid.

Allow open of RAWPART even when no medium is loaded.
Keep errors silent if no medium is loaded.

Fixes PR kern/55104


To generate a diff of this commit:
cvs rdiff -u -r1.342 -r1.342.4.1 src/sys/dev/scsipi/cd.c
cvs rdiff -u -r1.128 -r1.128.2.1 src/sys/kern/subr_disk.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/scsipi/cd.c
diff -u src/sys/dev/scsipi/cd.c:1.342 src/sys/dev/scsipi/cd.c:1.342.4.1
--- src/sys/dev/scsipi/cd.c:1.342	Mon Sep  3 16:29:33 2018
+++ src/sys/dev/scsipi/cd.c	Thu Apr  2 19:15:35 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: cd.c,v 1.342 2018/09/03 16:29:33 riastradh Exp $	*/
+/*	$NetBSD: cd.c,v 1.342.4.1 2020/04/02 19:15:35 martin Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2001, 2003, 2004, 2005, 2008 The NetBSD Foundation,
@@ -50,7 +50,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cd.c,v 1.342 2018/09/03 16:29:33 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cd.c,v 1.342.4.1 2020/04/02 19:15:35 martin Exp $");
 
 #include 
 #include 
@@ -401,8 +401,8 @@ cd_firstopen(device_t self, dev_t dev, i
 else
 silent = 0;
 
-	/* make cdclose() loud again */
-	cd->flags &= ~CDF_EJECTED;
+	/* make cdclose() silent */
+	cd->flags |= CDF_EJECTED;
 
 	/* Check that it is still responding and ok. */
 	error = scsipi_test_unit_ready(periph,
@@ -419,8 +419,11 @@ cd_firstopen(device_t self, dev_t dev, i
 		if (error == EINVAL)
 			error = EIO;
 	}
-	if (error)
+	if (error) {
+		if (part == RAW_PART)
+			goto out;
 		goto bad;
+	}
 
 	/* Lock the pack in. */
 	error = scsipi_prevent(periph, SPAMR_PREVENT_DT,
@@ -448,6 +451,9 @@ cd_firstopen(device_t self, dev_t dev, i
 		SC_DEBUG(periph, SCSIPI_DB3, ("Params loaded "));
 
 		cd_set_geometry(cd);
+
+		/* make cdclose() loud again */
+		cd->flags &= ~CDF_EJECTED;
 	}
 
 	periph->periph_flags |= PERIPH_OPEN;
@@ -519,7 +525,8 @@ cd_lastclose(device_t self)
 	struct scsipi_adapter *adapt = periph->periph_channel->chan_adapter;
 	int silent;
 
-	if (cd->flags & CDF_EJECTED)
+	if ((cd->flags & CDF_EJECTED) != 0 ||
+	(periph->periph_flags & PERIPH_MEDIA_LOADED) == 0)
 		silent = XS_CTL_SILENT;
 	else
 		silent = 0;
@@ -1213,6 +1220,14 @@ cdioctl(dev_t dev, u_long cmd, void *add
 		return (EIO);
 
 	switch (cmd) {
+	case DIOCTUR: {
+		/* test unit ready */
+		error = scsipi_test_unit_ready(cd->sc_periph, XS_CTL_SILENT);
+		*((int*)addr) = (error == 0);
+		if (error == ENODEV || error == EIO || error == 0)
+			return 0;   
+		return error;
+	}
 	case CDIOCPLAYTRACKS: {
 		/* PLAY_MSF command */
 		struct ioc_play_track *args = addr;
@@ -1447,15 +1462,18 @@ static void
 cd_label(device_t self, struct disklabel *lp)
 {
 	struct cd_softc *cd = device_private(self);
+	struct scsipi_periph *periph = cd->sc_periph;
 	struct cd_formatted_toc toc;
-	int lastsession;
+	int lastsession = 0;
 
 	strncpy(lp->d_typename, "optical media", 16);
 	lp->d_rpm = 300;
-	lp->d_flags |= D_REMOVABLE | D_SCSI_MMC;
+	lp->d_flags |= D_REMOVABLE;
 
-	if (cdreadmsaddr(cd, , ) != 0)
-		lastsession = 0;
+	if ((periph->periph_flags & PERIPH_MEDIA_LOADED) != 0) {
+		lp->d_flags |= D_SCSI_MMC;
+		(void) cdreadmsaddr(cd, , );
+	}
 
 	lp->d_partitions[0].p_offset = 0;
 	lp->d_partitions[0].p_size = lp->d_secperunit;

Index: src/sys/kern/subr_disk.c
diff -u src/sys/kern/subr_disk.c:1.128 src/sys/kern/subr_disk.c:1.128.2.1
--- src/sys/kern/subr_disk.c:1.128	Wed May 22 08:47:02 2019
+++ src/sys/kern/subr_disk.c	Thu Apr  2 19:15:35 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: subr_disk.c,v 1.128 2019/05/22 08:47:02 hannken Exp $	*/
+/*	$NetBSD: subr_disk.c,v 1.128.2.1 2020/04/02 19:15:35 martin Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1999, 2000, 2009 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: subr_disk.c,v 1.128 2019/05/22 08:47:02 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_disk.c,v 1.128.2.1 2020/04/02 19:15:35 martin Exp $");
 
 #include 
 #include 
@@ -440,6 +440,10 @@ int
 disk_read_sectors(void (*strat)(struct buf *), const struct disklabel *lp,
 struct buf *bp, unsigned int sector, int count)
 {
+
+	if ((lp->d_secsize / DEV_BSIZE) == 0 || lp->d_secpercyl == 0)
+		return EINVAL;
+
 	bp->b_blkno = btodb((off_t)sector * lp->d_secsize);
 	bp->b_bcount = count * lp->d_secsize;
 	bp->b_flags = (bp->b_flags & ~B_WRITE) | B_READ;



CVS commit: [netbsd-9] src/etc

2020-04-02 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Apr  2 19:11:36 UTC 2020

Modified Files:
src/etc [netbsd-9]: crontab

Log Message:
Pull up following revision(s) (requested by kim in ticket #812):

etc/crontab: revision 1.16

Fix skipped daily in Eastern Europe
- Move /etc/daily from 03:15 -> 04:15
- Move /etc/weekly from 04:30 -> 05:30 (to keep the spacing)

This should prevent problems during daylight savings changeover (which
is usually between 01:00 -> 04:00, depending upon the region) where the
cronjobs may be executed twice, or never at all...

This expands on the previous fix in revision 1.13 from 1997.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.15.102.1 src/etc/crontab

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

Modified files:

Index: src/etc/crontab
diff -u src/etc/crontab:1.15 src/etc/crontab:1.15.102.1
--- src/etc/crontab:1.15	Wed Nov 27 15:09:17 2002
+++ src/etc/crontab	Thu Apr  2 19:11:36 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: crontab,v 1.15 2002/11/27 15:09:17 perry Exp $
+#	$NetBSD: crontab,v 1.15.102.1 2020/04/02 19:11:36 martin Exp $
 #
 # /var/cron/tabs/root - root's crontab for NetBSD
 #
@@ -15,6 +15,6 @@ CRON_WITHIN=7200
 0	*	*	*	*	/usr/bin/newsyslog
 #
 # do daily/weekly/monthly maintenance
-15	3	*	*	*	/bin/sh /etc/daily 2>&1 | tee /var/log/daily.out | sendmail -t
-30	4	*	*	6	/bin/sh /etc/weekly 2>&1 | tee /var/log/weekly.out | sendmail -t
+15	4	*	*	*	/bin/sh /etc/daily 2>&1 | tee /var/log/daily.out | sendmail -t
+30	5	*	*	6	/bin/sh /etc/weekly 2>&1 | tee /var/log/weekly.out | sendmail -t
 #30	5	1	*	*	/bin/sh /etc/monthly 2>&1 | tee /var/log/monthly.out | sendmail -t



CVS commit: src/sbin/route

2020-04-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Apr  2 18:32:32 UTC 2020

Modified Files:
src/sbin/route: prog_ops.h route.c route_hostops.c route_rumpops.c

Log Message:
Add a prog_setsockopt (thanks kre@)


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sbin/route/prog_ops.h
cvs rdiff -u -r1.167 -r1.168 src/sbin/route/route.c
cvs rdiff -u -r1.1 -r1.2 src/sbin/route/route_hostops.c \
src/sbin/route/route_rumpops.c

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

Modified files:

Index: src/sbin/route/prog_ops.h
diff -u src/sbin/route/prog_ops.h:1.3 src/sbin/route/prog_ops.h:1.4
--- src/sbin/route/prog_ops.h:1.3	Thu Nov  6 16:29:32 2014
+++ src/sbin/route/prog_ops.h	Thu Apr  2 14:32:31 2020
@@ -1,4 +1,4 @@
-/*  $NetBSD: prog_ops.h,v 1.3 2014/11/06 21:29:32 christos Exp $	*/
+/*  $NetBSD: prog_ops.h,v 1.4 2020/04/02 18:32:31 christos Exp $	*/
 
 /*
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -36,36 +36,50 @@
 struct prog_ops {
 	int (*op_init)(void);
 
-	int (*op_sysctl)(const int *, u_int, void *, size_t *,
-			 const void *, size_t);
-
 	int (*op_socket)(int, int, int);
+	int (*op_setsockopt)(int, int, int, const void *, socklen_t);
+
+
 	int (*op_open)(const char *, int, ...);
 	pid_t (*op_getpid)(void);
 
 	ssize_t (*op_read)(int, void *, size_t);
 	ssize_t (*op_write)(int, const void *, size_t);
 
+	int (*op_sysctl)(const int *, u_int, void *, size_t *,
+			 const void *, size_t);
 
 	int (*op_shutdown)(int, int);
 };
 extern const struct prog_ops prog_ops;
 
 #define prog_init prog_ops.op_init
+
 #define prog_socket prog_ops.op_socket
+#define prog_setsockopt prog_ops.op_setsockopt
+
 #define prog_open prog_ops.op_open
 #define prog_getpid prog_ops.op_getpid
+
 #define prog_read prog_ops.op_read
 #define prog_write prog_ops.op_write
+
 #define prog_sysctl prog_ops.op_sysctl
+
 #define prog_shutdown prog_ops.op_shutdown
+
 #else
 #define prog_init ((int (*)(void))NULL)
+
 #define prog_socket socket
+#define prog_setsockopt setsockopt
+
 #define prog_open open
 #define prog_getpid getpid
+
 #define prog_read read
 #define prog_write write
+
 #define prog_sysctl sysctl
 #define prog_shutdown shutdown
 #endif

Index: src/sbin/route/route.c
diff -u src/sbin/route/route.c:1.167 src/sbin/route/route.c:1.168
--- src/sbin/route/route.c:1.167	Sat Mar 14 18:26:39 2020
+++ src/sbin/route/route.c	Thu Apr  2 14:32:31 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: route.c,v 1.167 2020/03/14 22:26:39 roy Exp $	*/
+/*	$NetBSD: route.c,v 1.168 2020/04/02 18:32:31 christos Exp $	*/
 
 /*
  * Copyright (c) 1983, 1989, 1991, 1993
@@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1983, 19
 #if 0
 static char sccsid[] = "@(#)route.c	8.6 (Berkeley) 4/28/95";
 #else
-__RCSID("$NetBSD: route.c,v 1.167 2020/03/14 22:26:39 roy Exp $");
+__RCSID("$NetBSD: route.c,v 1.168 2020/04/02 18:32:31 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -212,7 +212,7 @@ main(int argc, char * const *argv)
 		int on = 1;
 
 		sock = prog_socket(PF_ROUTE, SOCK_RAW, 0);
-		if (setsockopt(sock, SOL_SOCKET, SO_RERROR,
+		if (prog_setsockopt(sock, SOL_SOCKET, SO_RERROR,
 		, sizeof(on)) == -1)
 			warn("SO_RERROR");
 	}

Index: src/sbin/route/route_hostops.c
diff -u src/sbin/route/route_hostops.c:1.1 src/sbin/route/route_hostops.c:1.2
--- src/sbin/route/route_hostops.c:1.1	Mon Dec 13 12:39:47 2010
+++ src/sbin/route/route_hostops.c	Thu Apr  2 14:32:31 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: route_hostops.c,v 1.1 2010/12/13 17:39:47 pooka Exp $	*/
+/*	$NetBSD: route_hostops.c,v 1.2 2020/04/02 18:32:31 christos Exp $	*/
 
 /*
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -28,7 +28,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: route_hostops.c,v 1.1 2010/12/13 17:39:47 pooka Exp $");
+__RCSID("$NetBSD: route_hostops.c,v 1.2 2020/04/02 18:32:31 christos Exp $");
 #endif /* !lint */
 
 #include 
@@ -41,14 +41,17 @@ __RCSID("$NetBSD: route_hostops.c,v 1.1 
 #include "prog_ops.h"
 
 const struct prog_ops prog_ops = {
-	.op_socket = socket,
-	.op_open = open,
-	.op_getpid = getpid,
 
-	.op_read = read,
-	.op_write = write,
+	.op_socket =		socket,
+	.op_setsockopt =	setsockopt,
 
-	.op_sysctl = sysctl,
+	.op_open =		open,
+	.op_getpid =		getpid,
 
-	.op_shutdown = shutdown,
+	.op_read =		read,
+	.op_write =		write,
+
+	.op_sysctl =		sysctl,
+
+	.op_shutdown =		shutdown,
 };
Index: src/sbin/route/route_rumpops.c
diff -u src/sbin/route/route_rumpops.c:1.1 src/sbin/route/route_rumpops.c:1.2
--- src/sbin/route/route_rumpops.c:1.1	Mon Dec 13 12:39:47 2010
+++ src/sbin/route/route_rumpops.c	Thu Apr  2 14:32:31 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: route_rumpops.c,v 1.1 2010/12/13 17:39:47 pooka Exp $	*/
+/*	$NetBSD: route_rumpops.c,v 1.2 2020/04/02 18:32:31 christos Exp $	*/
 
 /*
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -28,7 +28,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: route_rumpops.c,v 1.1 2010/12/13 17:39:47 pooka 

CVS commit: src/usr.bin

2020-04-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Apr  2 17:41:34 UTC 2020

Modified Files:
src/usr.bin/kdump: ioctlprint.1 kdump.c mkioctls
src/usr.bin/ktrace: ktrace.h

Log Message:
Add the ability to:
1. list all ioctls (-l)
2. print the internal definition symbolically
3. search by name

$ ioctlprint -f "%n %E %e\n" TIOCGETA
TIOCGETA _IOR('t', 19, struct termios) _IOR('t',0x13,0x2c)


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/usr.bin/kdump/ioctlprint.1
cvs rdiff -u -r1.134 -r1.135 src/usr.bin/kdump/kdump.c
cvs rdiff -u -r1.54 -r1.55 src/usr.bin/kdump/mkioctls
cvs rdiff -u -r1.20 -r1.21 src/usr.bin/ktrace/ktrace.h

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

Modified files:

Index: src/usr.bin/kdump/ioctlprint.1
diff -u src/usr.bin/kdump/ioctlprint.1:1.3 src/usr.bin/kdump/ioctlprint.1:1.4
--- src/usr.bin/kdump/ioctlprint.1:1.3	Thu Apr  2 13:40:33 2020
+++ src/usr.bin/kdump/ioctlprint.1	Thu Apr  2 13:41:34 2020
@@ -1,4 +1,4 @@
-.\" $NetBSD: ioctlprint.1,v 1.3 2020/04/02 17:40:33 christos Exp $
+.\" $NetBSD: ioctlprint.1,v 1.4 2020/04/02 17:41:34 christos Exp $
 .\"
 .\" Copyright (c) 2020 The NetBSD Foundation, Inc.
 .\" All rights reserved.

Index: src/usr.bin/kdump/kdump.c
diff -u src/usr.bin/kdump/kdump.c:1.134 src/usr.bin/kdump/kdump.c:1.135
--- src/usr.bin/kdump/kdump.c:1.134	Thu Apr  2 13:40:33 2020
+++ src/usr.bin/kdump/kdump.c	Thu Apr  2 13:41:34 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: kdump.c,v 1.134 2020/04/02 17:40:33 christos Exp $	*/
+/*	$NetBSD: kdump.c,v 1.135 2020/04/02 17:41:34 christos Exp $	*/
 
 /*-
  * Copyright (c) 1988, 1993
@@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1988, 19
 #if 0
 static char sccsid[] = "@(#)kdump.c	8.4 (Berkeley) 4/28/95";
 #else
-__RCSID("$NetBSD: kdump.c,v 1.134 2020/04/02 17:40:33 christos Exp $");
+__RCSID("$NetBSD: kdump.c,v 1.135 2020/04/02 17:41:34 christos Exp $");
 #endif
 #endif /* not lint */
 

Index: src/usr.bin/kdump/mkioctls
diff -u src/usr.bin/kdump/mkioctls:1.54 src/usr.bin/kdump/mkioctls:1.55
--- src/usr.bin/kdump/mkioctls:1.54	Thu Apr  2 13:40:33 2020
+++ src/usr.bin/kdump/mkioctls	Thu Apr  2 13:41:34 2020
@@ -1,5 +1,5 @@
 #!/bin/sh
-#	$NetBSD: mkioctls,v 1.54 2020/04/02 17:40:33 christos Exp $
+#	$NetBSD: mkioctls,v 1.55 2020/04/02 17:41:34 christos Exp $
 #
 # Copyright (c) 1994
 #	The Regents of the University of California.  All rights reserved.

Index: src/usr.bin/ktrace/ktrace.h
diff -u src/usr.bin/ktrace/ktrace.h:1.20 src/usr.bin/ktrace/ktrace.h:1.21
--- src/usr.bin/ktrace/ktrace.h:1.20	Tue Apr 26 20:00:47 2011
+++ src/usr.bin/ktrace/ktrace.h	Thu Apr  2 13:41:33 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: ktrace.h,v 1.20 2011/04/27 00:00:47 joerg Exp $	*/
+/*	$NetBSD: ktrace.h,v 1.21 2020/04/02 17:41:33 christos Exp $	*/
 
 /*-
  * Copyright (c) 1988, 1993
@@ -44,3 +44,11 @@ int	getpoints(int, char *);
 const char	*ioctlname(u_long);
 const char	*siginfocodename(int, int);
 void	dumpfile(const char *, int, int);
+
+struct ioctlinfo {
+	const char *name;
+	const char *expr;
+	unsigned long value;
+};
+
+extern const struct ioctlinfo ioctlinfo[];



CVS commit: src/usr.bin/kdump

2020-04-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Apr  2 17:40:33 UTC 2020

Modified Files:
src/usr.bin/kdump: ioctlprint.1 kdump.c mkioctls


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/usr.bin/kdump/ioctlprint.1
cvs rdiff -u -r1.133 -r1.134 src/usr.bin/kdump/kdump.c
cvs rdiff -u -r1.53 -r1.54 src/usr.bin/kdump/mkioctls

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/kdump/ioctlprint.1
diff -u src/usr.bin/kdump/ioctlprint.1:1.2 src/usr.bin/kdump/ioctlprint.1:1.3
--- src/usr.bin/kdump/ioctlprint.1:1.2	Thu Apr  2 04:38:22 2020
+++ src/usr.bin/kdump/ioctlprint.1	Thu Apr  2 13:40:33 2020
@@ -1,4 +1,4 @@
-.\" $NetBSD: ioctlprint.1,v 1.2 2020/04/02 08:38:22 wiz Exp $
+.\" $NetBSD: ioctlprint.1,v 1.3 2020/04/02 17:40:33 christos Exp $
 .\"
 .\" Copyright (c) 2020 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -35,6 +35,7 @@
 .Nd display descriptive ioctl value
 .Sh SYNOPSIS
 .Nm
+.Op Fl l
 .Op Fl e Ar emulation
 .Op Fl f Ar format
 .Op Ar arg ...
@@ -45,6 +46,10 @@ utility displays information about the f
 to by one or more
 .Ar arg
 arguments.
+The argument can either be an
+.Xr ioctl
+symbolic name or the
+ioctl value.
 .Pp
 The options are as follows:
 .Bl -tag -width Fl
@@ -61,8 +66,10 @@ output.
 .Pp
 The following conversion characters can be used:
 .Bl -tag -width 
+.It \&%E
+Symbolic decoded ioctl string.
 .It \&%e
-Decoded ioctl string.
+Decoded ioctl string with hex values.
 .It \&%n
 Descriptive ioctl operation name.
 .It \&%x
@@ -77,6 +84,10 @@ The default format is:
 .Bd -literal -offset indent
 "%n %e %x\\n"
 .Ed
+.It Fl l
+List all 
+.Xr ioctl 2
+known.
 .El
 .Sh SEE ALSO
 .Xr kdump 1 ,

Index: src/usr.bin/kdump/kdump.c
diff -u src/usr.bin/kdump/kdump.c:1.133 src/usr.bin/kdump/kdump.c:1.134
--- src/usr.bin/kdump/kdump.c:1.133	Wed Apr  1 23:32:46 2020
+++ src/usr.bin/kdump/kdump.c	Thu Apr  2 13:40:33 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: kdump.c,v 1.133 2020/04/02 03:32:46 kamil Exp $	*/
+/*	$NetBSD: kdump.c,v 1.134 2020/04/02 17:40:33 christos Exp $	*/
 
 /*-
  * Copyright (c) 1988, 1993
@@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1988, 19
 #if 0
 static char sccsid[] = "@(#)kdump.c	8.4 (Berkeley) 4/28/95";
 #else
-__RCSID("$NetBSD: kdump.c,v 1.133 2020/04/02 03:32:46 kamil Exp $");
+__RCSID("$NetBSD: kdump.c,v 1.134 2020/04/02 17:40:33 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -108,9 +108,9 @@ static const char * const linux_ptrace_o
 	"PTRACE_SYSCALL",
 };
 
-static const char default_format[] = { "%n %e %x\n" };
+static const char default_format[] = { "%n\t%E\t%x\n" };
 
-static void	fmtprint(const char *, unsigned long int);
+static void	fmtprint(const char *, const struct ioctlinfo *ii);
 static int	fread_tail(void *, size_t, size_t);
 static int	dumpheader(struct ktr_header *);
 static int	output_ts(const struct timespec *);
@@ -132,11 +132,11 @@ static void	rprint(register_t);
 static const char *signame(long, int);
 static void hexdump_buf(const void *, int, int);
 static void visdump_buf(const void *, int, int);
+static const struct ioctlinfo *find_ioctl(const char *);
 
 int
 main(int argc, char **argv)
 {
-	unsigned long int u;
 	unsigned int ktrlen, size;
 	int ch;
 	void *m;
@@ -145,15 +145,16 @@ main(int argc, char **argv)
 	const char *emul_name = "netbsd";
 	const char *format = default_format;
 	int col;
-	int e;
 	char *cp;
 
 	setprogname(argv[0]);
 
 	if (strcmp(getprogname(), "ioctlprint") == 0) {
+		const struct ioctlinfo *ii;
+		int list = 0;
 		int i;
 
-		while ((ch = getopt(argc, argv, "e:f:")) != -1)
+		while ((ch = getopt(argc, argv, "e:f:l")) != -1)
 			switch (ch) {
 			case 'e':
 emul_name = optarg;
@@ -163,22 +164,34 @@ main(int argc, char **argv)
 	errx(1, "Too many formats");
 format = optarg;
 break;
+			case 'l':
+list = 1;
+break;
 			default:
 usage();
 break;
 			}
+
 		setemul(emul_name, 0, 0);
 		argv += optind;
 		argc -= optind;
 
-		if (argc < 1)
+		if (argc < 1 && !list)
 			usage();
 
+		if (list) {
+			for (i = 0; ioctlinfo[i].name != NULL; i++) {
+fmtprint(format, [i]);
+			}
+			return 0;
+		}
+
 		for (i = 0; i < argc; i++) {
-			u = strtou(argv[i], NULL, 0, 0, ULONG_MAX, );
-			if (e)
-errc(1, e, "invalid argument: `%s'", argv[i]);
-			fmtprint(format, u);
+			if ((ii = find_ioctl(argv[i])) == NULL) {
+warnx("Can't find ioctl `%s'", argv[i]);
+continue;
+			}
+			fmtprint(format, ii);
 		}
 		return 0;
 	}
@@ -338,11 +351,11 @@ main(int argc, char **argv)
 }
 
 static void
-fmtprint(const char *fmt, unsigned long int u)
+fmtprint(const char *fmt, const struct ioctlinfo *ii)
 {
-	const char *name;
 	int c;
 
+
 	while ((c = *fmt++) != '\0') {
 		switch (c) {
 		default:
@@ -368,21 +381,23 @@ fmtprint(const char *fmt, unsigned long 
 			default:
 putchar(c);
 break;
+			case 'E':
+printf("%s", ii->expr);
+break;
 			

CVS commit: src/sys/kern

2020-04-02 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Thu Apr  2 16:31:37 UTC 2020

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

Log Message:
Add a comment.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/kern/subr_csan.c

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

Modified files:

Index: src/sys/kern/subr_csan.c
diff -u src/sys/kern/subr_csan.c:1.6 src/sys/kern/subr_csan.c:1.7
--- src/sys/kern/subr_csan.c:1.6	Sun Dec  1 08:15:58 2019
+++ src/sys/kern/subr_csan.c	Thu Apr  2 16:31:37 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: subr_csan.c,v 1.6 2019/12/01 08:15:58 maxv Exp $	*/
+/*	$NetBSD: subr_csan.c,v 1.7 2020/04/02 16:31:37 maxv Exp $	*/
 
 /*
  * Copyright (c) 2019 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: subr_csan.c,v 1.6 2019/12/01 08:15:58 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_csan.c,v 1.7 2020/04/02 16:31:37 maxv Exp $");
 
 #include 
 #include 
@@ -606,6 +606,11 @@ CSAN_ATOMIC_FUNC_INC(uint, unsigned int,
 CSAN_ATOMIC_FUNC_INC(ulong, unsigned long, unsigned long);
 CSAN_ATOMIC_FUNC_INC(ptr, void *, void);
 
+/*
+ * TODO: these two functions should qualify as atomic accesses. However
+ * for now we just whitelist them, to reduce the output.
+ */
+
 void
 kcsan_atomic_load(const volatile void *p, void *v, int size)
 {



CVS commit: src/sys

2020-04-02 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Thu Apr  2 16:29:30 UTC 2020

Modified Files:
src/sys/kern: kern_clock.c
src/sys/sys: kernel.h
src/sys/uvm: uvm_pdpolicy_clock.c

Log Message:
Hide 'hardclock_ticks' behind a new getticks() function, and use relaxed
atomics internally. Only one caller is converted for now.

Discussed with riastradh@ and ad@.


To generate a diff of this commit:
cvs rdiff -u -r1.139 -r1.140 src/sys/kern/kern_clock.c
cvs rdiff -u -r1.32 -r1.33 src/sys/sys/kernel.h
cvs rdiff -u -r1.35 -r1.36 src/sys/uvm/uvm_pdpolicy_clock.c

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

Modified files:

Index: src/sys/kern/kern_clock.c
diff -u src/sys/kern/kern_clock.c:1.139 src/sys/kern/kern_clock.c:1.140
--- src/sys/kern/kern_clock.c:1.139	Sun Dec  1 15:34:46 2019
+++ src/sys/kern/kern_clock.c	Thu Apr  2 16:29:30 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_clock.c,v 1.139 2019/12/01 15:34:46 ad Exp $	*/
+/*	$NetBSD: kern_clock.c,v 1.140 2020/04/02 16:29:30 maxv Exp $	*/
 
 /*-
  * Copyright (c) 2000, 2004, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -69,7 +69,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_clock.c,v 1.139 2019/12/01 15:34:46 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_clock.c,v 1.140 2020/04/02 16:29:30 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_dtrace.h"
@@ -155,7 +155,13 @@ static u_int
 get_intr_timecount(struct timecounter *tc)
 {
 
-	return (u_int)hardclock_ticks;
+	return (u_int)getticks();
+}
+
+int
+getticks(void)
+{
+	return atomic_load_relaxed(_ticks);
 }
 
 /*
@@ -242,7 +248,8 @@ hardclock(struct clockframe *frame)
 		sched_tick(ci);
 
 	if (CPU_IS_PRIMARY(ci)) {
-		hardclock_ticks++;
+		atomic_store_relaxed(_ticks,
+		atomic_load_relaxed(_ticks) + 1);
 		tc_ticktock();
 	}
 

Index: src/sys/sys/kernel.h
diff -u src/sys/sys/kernel.h:1.32 src/sys/sys/kernel.h:1.33
--- src/sys/sys/kernel.h:1.32	Thu Jan  2 15:42:27 2020
+++ src/sys/sys/kernel.h	Thu Apr  2 16:29:30 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: kernel.h,v 1.32 2020/01/02 15:42:27 thorpej Exp $	*/
+/*	$NetBSD: kernel.h,v 1.33 2020/04/02 16:29:30 maxv Exp $	*/
 
 /*-
  * Copyright (c) 1990, 1993
@@ -56,7 +56,7 @@ extern int cold;		/* still working on st
 extern int shutting_down;	/* system is shutting down */
 extern int tick;		/* usec per tick (100 / hz) */
 extern int tickadj;		/* "standard" clock skew, us./tick */
-extern int hardclock_ticks;	/* # of hardclock ticks */
+extern int hardclock_ticks;	/* # of hardclock ticks; XXX use getticks()! */
 extern int hz;			/* system clock's frequency */
 extern int stathz;		/* statistics clock's frequency */
 extern int profhz;		/* profiling clock's frequency */
@@ -64,6 +64,10 @@ extern int profhz;		/* profiling clock's
 extern int profsrc;		/* profiling source */
 extern int psratio;		/* ratio: prof / stat */
 
+/* Accessors. */
+
+int getticks(void);
+
 #define PROFSRC_CLOCK	0
 
 #endif

Index: src/sys/uvm/uvm_pdpolicy_clock.c
diff -u src/sys/uvm/uvm_pdpolicy_clock.c:1.35 src/sys/uvm/uvm_pdpolicy_clock.c:1.36
--- src/sys/uvm/uvm_pdpolicy_clock.c:1.35	Sat Mar 14 13:53:26 2020
+++ src/sys/uvm/uvm_pdpolicy_clock.c	Thu Apr  2 16:29:30 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_pdpolicy_clock.c,v 1.35 2020/03/14 13:53:26 ad Exp $	*/
+/*	$NetBSD: uvm_pdpolicy_clock.c,v 1.36 2020/04/02 16:29:30 maxv Exp $	*/
 /*	NetBSD: uvm_pdaemon.c,v 1.72 2006/01/05 10:47:33 yamt Exp $	*/
 
 /*-
@@ -98,7 +98,7 @@
 #else /* defined(PDSIM) */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uvm_pdpolicy_clock.c,v 1.35 2020/03/14 13:53:26 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_pdpolicy_clock.c,v 1.36 2020/04/02 16:29:30 maxv Exp $");
 
 #include 
 #include 
@@ -771,7 +771,7 @@ uvmpdpol_idle(struct uvm_cpu *ucpu)
 	 * if no pages in the queue, we have nothing to do.
 	 */
 	if (ucpu->pdqhead == ucpu->pdqtail) {
-		ucpu->pdqtime = hardclock_ticks;
+		ucpu->pdqtime = getticks();
 		return;
 	}
 
@@ -779,7 +779,7 @@ uvmpdpol_idle(struct uvm_cpu *ucpu)
 	 * don't do this more than ~8 times a second as it would needlessly
 	 * exert pressure.
 	 */
-	if (hardclock_ticks - ucpu->pdqtime < (hz >> 3)) {
+	if (getticks() - ucpu->pdqtime < (hz >> 3)) {
 		return;
 	}
 
@@ -803,7 +803,7 @@ uvmpdpol_idle(struct uvm_cpu *ucpu)
 			}
 		}
 		if (ucpu->pdqhead == ucpu->pdqtail) {
-			ucpu->pdqtime = hardclock_ticks;
+			ucpu->pdqtime = getticks();
 		}
 		mutex_exit(>lock);
 	}



CVS commit: src/sys/dev/pci

2020-04-02 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Apr  2 16:18:51 UTC 2020

Modified Files:
src/sys/dev/pci: if_tireg.h

Log Message:
No functional change:
 - s/u_int64_t/uint64_t/
 - s/alignes/aligns/
 - indent, tabify


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/sys/dev/pci/if_tireg.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_tireg.h
diff -u src/sys/dev/pci/if_tireg.h:1.29 src/sys/dev/pci/if_tireg.h:1.30
--- src/sys/dev/pci/if_tireg.h:1.29	Thu Apr  2 15:30:27 2020
+++ src/sys/dev/pci/if_tireg.h	Thu Apr  2 16:18:51 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: if_tireg.h,v 1.29 2020/04/02 15:30:27 msaitoh Exp $ */
+/* $NetBSD: if_tireg.h,v 1.30 2020/04/02 16:18:51 msaitoh Exp $ */
 
 /*
  * Copyright (c) 1997, 1998, 1999
@@ -455,14 +455,14 @@ struct ti_stats {
 #define IF_ADMIN_STATUS_UP  1
 #define IF_ADMIN_STATUS_DOWN2
 #define IF_ADMIN_STATUS_TESTING 3
-	volatile uint32_t ifOperStatus;			/* 17 */
+	volatile uint32_t ifOperStatus;/* 17 */
 #define IF_OPER_STATUS_UP   1
 #define IF_OPER_STATUS_DOWN 2
 #define IF_OPER_STATUS_TESTING  3
 #define IF_OPER_STATUS_UNKNOWN  4
 #define IF_OPER_STATUS_DORMANT  5
-	volatile uint32_t ifLastChange;			/* 18 */
-	volatile uint32_t ifInDiscards;			/* 19 */
+	volatile uint32_t ifLastChange;/* 18 */
+	volatile uint32_t ifInDiscards;/* 19 */
 	volatile uint32_t ifInErrors;/* 20 */
 	volatile uint32_t ifInUnknownProtos;			/* 21 */
 	volatile uint32_t ifOutDiscards;			/* 22 */
@@ -470,22 +470,22 @@ struct ti_stats {
 	volatile uint32_t ifOutQLen; /* deprecated */	/* 24 */
 	volatile uint8_t  ifPhysAddress[8]; /* 8 bytes */	/* 25 - 26 */
 	volatile uint8_t  ifDescr[32];/* 27 - 34 */
-	uint32_t alignIt;  /* align to 64 bit for u_int64_ts following */
+	uint32_t alignIt;  /* align to 64 bit for uint64_ts following */
 	/*
 	 * more interface stats, taken from RFC 1573, MIB-IIupdate,
 	 * interfaces group
 	 */
-	volatile u_int64_t ifHCInOctets;			/* 36 - 37 */
-	volatile u_int64_t ifHCInUcastPkts;			/* 38 - 39 */
-	volatile u_int64_t ifHCInMulticastPkts;			/* 40 - 41 */
-	volatile u_int64_t ifHCInBroadcastPkts;			/* 42 - 43 */
-	volatile u_int64_t ifHCOutOctets;			/* 44 - 45 */
-	volatile u_int64_t ifHCOutUcastPkts;			/* 46 - 47 */
-	volatile u_int64_t ifHCOutMulticastPkts;		/* 48 - 49 */
-	volatile u_int64_t ifHCOutBroadcastPkts;		/* 50 - 51 */
+	volatile uint64_t ifHCInOctets;/* 36 - 37 */
+	volatile uint64_t ifHCInUcastPkts;			/* 38 - 39 */
+	volatile uint64_t ifHCInMulticastPkts;			/* 40 - 41 */
+	volatile uint64_t ifHCInBroadcastPkts;			/* 42 - 43 */
+	volatile uint64_t ifHCOutOctets;			/* 44 - 45 */
+	volatile uint64_t ifHCOutUcastPkts;			/* 46 - 47 */
+	volatile uint64_t ifHCOutMulticastPkts;			/* 48 - 49 */
+	volatile uint64_t ifHCOutBroadcastPkts;			/* 50 - 51 */
 	volatile uint32_t ifLinkUpDownTrapEnable;		/* 52 */
 	volatile uint32_t ifHighSpeed;/* 53 */
-	volatile uint32_t ifPromiscuousMode; 			/* 54 */
+	volatile uint32_t ifPromiscuousMode;			/* 54 */
 	volatile uint32_t ifConnectorPresent; /* follow link state 55 */
 	/*
 	 * Host Commands
@@ -498,12 +498,12 @@ struct ti_stats {
 	volatile uint32_t nicCmdsAddMCastAddr;			/* 61 */
 	volatile uint32_t nicCmdsDelMCastAddr;			/* 62 */
 	volatile uint32_t nicCmdsSetPromiscMode;		/* 63 */
-	volatile uint32_t nicCmdsLinkNegotiate;		/* 64 */
+	volatile uint32_t nicCmdsLinkNegotiate;			/* 64 */
 	volatile uint32_t nicCmdsSetMACAddr;			/* 65 */
 	volatile uint32_t nicCmdsClearProfile;			/* 66 */
 	volatile uint32_t nicCmdsSetMulticastMode;		/* 67 */
 	volatile uint32_t nicCmdsClearStats;			/* 68 */
-	volatile uint32_t nicCmdsSetRecvJumboProdIndex;	/* 69 */
+	volatile uint32_t nicCmdsSetRecvJumboProdIndex;		/* 69 */
 	volatile uint32_t nicCmdsSetRecvMiniProdIndex;		/* 70 */
 	volatile uint32_t nicCmdsRefreshStats;			/* 71 */
 	volatile uint32_t nicCmdsUnknown;			/* 72 */
@@ -526,11 +526,11 @@ struct ti_stats {
 	 * Interrupts
 	 */
 	volatile uint32_t nicInterrupts;			/* 82 */
-	volatile uint32_t nicAvoidedInterrupts;		/* 83 */
+	volatile uint32_t nicAvoidedInterrupts;			/* 83 */
 	/*
 	 * BD Coalescing Thresholds
 	 */
-	volatile uint32_t nicEventThresholdHit;		/* 84 */
+	volatile uint32_t nicEventThresholdHit;			/* 84 */
 	volatile uint32_t nicSendThresholdHit;			/* 85 */
 	volatile uint32_t nicRecvThresholdHit;			/* 86 */
 	/*
@@ -540,8 +540,8 @@ struct ti_stats {
 	volatile uint32_t nicDmaRdUnderrun;			/* 88 */
 	volatile uint32_t nicDmaWrOverrun;			/* 89 */
 	volatile uint32_t nicDmaWrUnderrun;			/* 90 */
-	volatile uint32_t nicDmaWrMasterAborts;		/* 91 */
-	volatile uint32_t nicDmaRdMasterAborts;		/* 92 */
+	volatile uint32_t nicDmaWrMasterAborts;			/* 91 */
+	volatile uint32_t nicDmaRdMasterAborts;			/* 92 */
 	/*
 	 * NIC Resources
 	 */
@@ -550,7 +550,7 @@ struct ti_stats {
 	volatile uint32_t nicEventRingFull;			

CVS commit: src

2020-04-02 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Apr  2 15:30:27 UTC 2020

Modified Files:
src/doc: CHANGES.prev
src/include/rpcsvc: yp_prot.h
src/sys/arch/emips/include: bus.h
src/sys/arch/evbcf/include: bus_space.h
src/sys/arch/hp300/include: bus.h
src/sys/arch/luna68k/include: bus.h
src/sys/arch/mac68k/include: bus.h
src/sys/arch/mvme68k/include: bus_space.h
src/sys/arch/news68k/include: bus.h
src/sys/arch/newsmips/include: bus.h
src/sys/arch/next68k/include: bus_space.h
src/sys/dev/pci: if_tireg.h

Log Message:
 s/impliment/implement/ in comment.


To generate a diff of this commit:
cvs rdiff -u -r1.153 -r1.154 src/doc/CHANGES.prev
cvs rdiff -u -r1.19 -r1.20 src/include/rpcsvc/yp_prot.h
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/emips/include/bus.h
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/evbcf/include/bus_space.h
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/hp300/include/bus.h
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/luna68k/include/bus.h
cvs rdiff -u -r1.28 -r1.29 src/sys/arch/mac68k/include/bus.h
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/mvme68k/include/bus_space.h
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/news68k/include/bus.h
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/newsmips/include/bus.h
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/next68k/include/bus_space.h
cvs rdiff -u -r1.28 -r1.29 src/sys/dev/pci/if_tireg.h

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.prev
diff -u src/doc/CHANGES.prev:1.153 src/doc/CHANGES.prev:1.154
--- src/doc/CHANGES.prev:1.153	Fri Dec 27 09:22:19 2019
+++ src/doc/CHANGES.prev	Thu Apr  2 15:30:25 2020
@@ -1,4 +1,4 @@
-LIST OF CHANGES FROM PREVIOUS RELEASES:			<$Revision: 1.153 $>
+LIST OF CHANGES FROM PREVIOUS RELEASES:			<$Revision: 1.154 $>
 
 
 Changes from 386bsd 0.1 + patchkit 0.2.2 to NetBSD 0.8:
@@ -1062,7 +1062,7 @@ Changes from NetBSD 0.9 to NetBSD 1.0:
 	compat/sunos, m68k, sparc: move sunos emulation code code to
 		/sys/compat/sunos, for use by all m68k and sparc ports.
 		significantly cleaned and extended up from Torek's base, with
-		help at implimenting various system calls and ioctl's from mw
+		help at implementing various system calls and ioctl's from mw
 		& pk. (deraadt)
 	don't permit TIOCSCTTY on /dev/tty, or kernel recursion happens.
 		from Lars Fredriksen  (deraadt)
@@ -1092,7 +1092,7 @@ Changes from NetBSD 0.9 to NetBSD 1.0:
 	tunnel driver cleanup done by Brad Parker 
 		and myself (deraadt)
 	upgraded lex to version 2.4.5. (jtc)
-	tty subsystem VMIN/VTIME implimentation from Marc Teitelbaum
+	tty subsystem VMIN/VTIME implementation from Marc Teitelbaum
 		 (deraadt)
 	multicast patches added.
 		Original code by Steve Mccanne and LBL. NetBSD patches

Index: src/include/rpcsvc/yp_prot.h
diff -u src/include/rpcsvc/yp_prot.h:1.19 src/include/rpcsvc/yp_prot.h:1.20
--- src/include/rpcsvc/yp_prot.h:1.19	Fri Jan 22 23:22:56 2016
+++ src/include/rpcsvc/yp_prot.h	Thu Apr  2 15:30:25 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: yp_prot.h,v 1.19 2016/01/22 23:22:56 dholland Exp $	*/
+/*	$NetBSD: yp_prot.h,v 1.20 2020/04/02 15:30:25 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993 Theo de Raadt 
@@ -269,8 +269,8 @@ struct ypbind_setdom {
  *  is supplied to ypxfr as a command-line parameter when it
  *  is activated by ypserv."
  * 
- * This protocol is not implimented, naturally, because this YP
- * implimentation only does the client side.
+ * This protocol is not implemented, naturally, because this YP
+ * implementation only does the client side.
  */
 #define YPPUSHVERS		((unsigned long)1)
 #define YPPUSHVERS_ORIG		((unsigned long)1)

Index: src/sys/arch/emips/include/bus.h
diff -u src/sys/arch/emips/include/bus.h:1.3 src/sys/arch/emips/include/bus.h:1.4
--- src/sys/arch/emips/include/bus.h:1.3	Mon Sep 23 16:17:55 2019
+++ src/sys/arch/emips/include/bus.h	Thu Apr  2 15:30:26 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus.h,v 1.3 2019/09/23 16:17:55 skrll Exp $	*/
+/*	$NetBSD: bus.h,v 1.4 2020/04/02 15:30:26 msaitoh Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2001 The NetBSD Foundation, Inc.
@@ -291,7 +291,7 @@ __EMIPS_bus_space_write_multi(4,32)
 
 #if 0	/* Cause a link error for bus_space_write_8 */
 #define	bus_space_write_multi_8(t, h, o, a, c)\
-			!!! bus_space_write_multi_8 unimplimented !!!
+			!!! bus_space_write_multi_8 unimplemented !!!
 #endif
 
 #undef __EMIPS_bus_space_write_multi

Index: src/sys/arch/evbcf/include/bus_space.h
diff -u src/sys/arch/evbcf/include/bus_space.h:1.3 src/sys/arch/evbcf/include/bus_space.h:1.4
--- src/sys/arch/evbcf/include/bus_space.h:1.3	Mon Sep 23 16:17:55 2019
+++ src/sys/arch/evbcf/include/bus_space.h	Thu Apr  2 15:30:26 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus_space.h,v 1.3 2019/09/23 16:17:55 skrll Exp $ */
+/*	$NetBSD: bus_space.h,v 1.4 2020/04/02 15:30:26 msaitoh Exp $ */
 
 /*-
  * Copyright (c) 1996, 1997, 1998 The 

CVS commit: src/doc

2020-04-02 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Thu Apr  2 14:12:00 UTC 2020

Modified Files:
src/doc: 3RDPARTY CHANGES

Log Message:
Note import of dhcpcd-9.0.0


To generate a diff of this commit:
cvs rdiff -u -r1.1706 -r1.1707 src/doc/3RDPARTY
cvs rdiff -u -r1.2663 -r1.2664 src/doc/CHANGES

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

Modified files:

Index: src/doc/3RDPARTY
diff -u src/doc/3RDPARTY:1.1706 src/doc/3RDPARTY:1.1707
--- src/doc/3RDPARTY:1.1706	Thu Apr  2 11:11:25 2020
+++ src/doc/3RDPARTY	Thu Apr  2 14:11:59 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.1706 2020/04/02 11:11:25 sevan Exp $
+#	$NetBSD: 3RDPARTY,v 1.1707 2020/04/02 14:11:59 roy Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -327,12 +327,12 @@ Notes:
 Use the dhcp2netbsd script.
 
 Package:	dhcpcd
-Version:	8.1.6
-Current Vers:	8.1.6
+Version:	9.0.0
+Current Vers:	9.0.0
 Maintainer:	roy
 Archive Site:	ftp://roy.marples.name/pub/dhcpcd/
 Home Page:	http://roy.marples.name/projects/dhcpcd/
-Date:		2020-01-27
+Date:		2020-04-02
 Mailing List: 	dhcpcd-disc...@marples.name
 License:	BSD (2-clause)
 Location:	external/bsd/dhcpcd/dist

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.2663 src/doc/CHANGES:1.2664
--- src/doc/CHANGES:1.2663	Thu Apr  2 03:34:49 2020
+++ src/doc/CHANGES	Thu Apr  2 14:11:59 2020
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2663 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2664 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -162,3 +162,4 @@ Changes from NetBSD 9.0 to NetBSD 10.0:
 	bwfm: Update firmware to linux-firmware-20200316. [thorpej 20200322]
 	acpi(4): Updated ACPICA to 20200326. [christos 20200328]
 	ioctlprint(1): Add ioctl descriptive printer. [kamil 20200402]
+	dhcpcd(8): Import version 9.0.0 [roy 20200402]



CVS commit: src/external/bsd/dhcpcd/libexec/dhcpcd-hooks

2020-04-02 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Thu Apr  2 14:05:28 UTC 2020

Modified Files:
src/external/bsd/dhcpcd/libexec/dhcpcd-hooks: Makefile

Log Message:
Fix the build by building 30-hostname


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 \
src/external/bsd/dhcpcd/libexec/dhcpcd-hooks/Makefile

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

Modified files:

Index: src/external/bsd/dhcpcd/libexec/dhcpcd-hooks/Makefile
diff -u src/external/bsd/dhcpcd/libexec/dhcpcd-hooks/Makefile:1.3 src/external/bsd/dhcpcd/libexec/dhcpcd-hooks/Makefile:1.4
--- src/external/bsd/dhcpcd/libexec/dhcpcd-hooks/Makefile:1.3	Sun Apr  2 20:18:38 2017
+++ src/external/bsd/dhcpcd/libexec/dhcpcd-hooks/Makefile	Thu Apr  2 14:05:28 2020
@@ -1,15 +1,24 @@
-# $NetBSD: Makefile,v 1.3 2017/04/02 20:18:38 roy Exp $
+# $NetBSD: Makefile,v 1.4 2020/04/02 14:05:28 roy Exp $
 #
 
 .include 
 
 .include "../../Makefile.inc"
+HOOKSRC=	${DIST}/hooks
+.PATH:		${HOOKSRC}
 
-.PATH:			${DIST}/hooks
+FILES=		01-test 02-dump 20-resolv.conf 30-hostname
+FILES+=		50-ntp.conf
 
-FILES=			01-test 02-dump 20-resolv.conf 30-hostname
-FILES+=			50-ntp.conf
+FILESBUILD_30-hostname=   YES
 
-FILESDIR=		/libexec/dhcpcd-hooks
+FILESDIR=	/libexec/dhcpcd-hooks
+
+CLEANFILES=	30-hostname
+
+.for f in ${FILES}
+${f}:	../../Makefile.inc ${f}.in
+	${TOOL_SED} ${SED_SYS} ${HOOKSRC}/${f}.in > $@
+.endfor
 
 .include 



CVS commit: src/usr.sbin/postinstall

2020-04-02 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Thu Apr  2 13:44:46 UTC 2020

Modified Files:
src/usr.sbin/postinstall: postinstall.in

Log Message:
postinstall: add checks for _dhcpcd to do_uid and do_gid

Thanks to jmcneill@


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/usr.sbin/postinstall/postinstall.in

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/postinstall/postinstall.in
diff -u src/usr.sbin/postinstall/postinstall.in:1.16 src/usr.sbin/postinstall/postinstall.in:1.17
--- src/usr.sbin/postinstall/postinstall.in:1.16	Thu Apr  2 13:04:09 2020
+++ src/usr.sbin/postinstall/postinstall.in	Thu Apr  2 13:44:46 2020
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: postinstall.in,v 1.16 2020/04/02 13:04:09 roy Exp $
+# $NetBSD: postinstall.in,v 1.17 2020/04/02 13:44:46 roy Exp $
 #
 # Copyright (c) 2002-2015 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -1199,7 +1199,7 @@ do_gid()
 	"${SRC_DIR}/etc/group" 14 \
 	named ntpd sshd SKIP _pflogd _rwhod staff _proxy _timedc \
 	_sdpd _httpd _mdnsd _tests _tcpdump _tss _gpio _rtadvd SKIP \
-	_unbound _nsd nvmm
+	_unbound _nsd nvmm _dhcpcd
 }
 
 #
@@ -1975,7 +1975,7 @@ do_uid()
 	"${SRC_DIR}/etc/master.passwd" 12 \
 	postfix SKIP named ntpd sshd SKIP _pflogd _rwhod SKIP _proxy \
 	_timedc _sdpd _httpd _mdnsd _tests _tcpdump _tss SKIP _rtadvd \
-	SKIP _unbound _nsd
+	SKIP _unbound _nsd SKIP _dhcpcd
 }
 
 



CVS commit: src/sys/dev/ic

2020-04-02 Thread Tohru Nishimura
Module Name:src
Committed By:   nisimura
Date:   Thu Apr  2 13:38:50 UTC 2020

Modified Files:
src/sys/dev/ic: dm9000.c

Log Message:
add aprint_debug_dev() call for CI20


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/sys/dev/ic/dm9000.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/ic/dm9000.c
diff -u src/sys/dev/ic/dm9000.c:1.27 src/sys/dev/ic/dm9000.c:1.28
--- src/sys/dev/ic/dm9000.c:1.27	Thu Apr  2 07:26:45 2020
+++ src/sys/dev/ic/dm9000.c	Thu Apr  2 13:38:50 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: dm9000.c,v 1.27 2020/04/02 07:26:45 skrll Exp $	*/
+/*	$NetBSD: dm9000.c,v 1.28 2020/04/02 13:38:50 nisimura Exp $	*/
 
 /*
  * Copyright (c) 2009 Paul Fleischer
@@ -225,6 +225,7 @@ dme_attach(struct dme_softc *sc, const u
 		KASSERT(prop_object_type(ea) == PROP_TYPE_DATA);
 		KASSERT(prop_data_size(ea) == ETHER_ADDR_LEN);
 		memcpy(enaddr, prop_data_data_nocopy(ea), ETHER_ADDR_LEN);
+		aprint_debug_dev(sc->sc_dev, "got MAC address!\n");
 	} else {
 		/*
 		 * If we did not get an externaly configure address,



CVS commit: src/usr.sbin/postinstall

2020-04-02 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Thu Apr  2 13:04:09 UTC 2020

Modified Files:
src/usr.sbin/postinstall: postinstall.in

Log Message:
postinstall: move dhcpcd files to the chroot


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/usr.sbin/postinstall/postinstall.in

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/postinstall/postinstall.in
diff -u src/usr.sbin/postinstall/postinstall.in:1.15 src/usr.sbin/postinstall/postinstall.in:1.16
--- src/usr.sbin/postinstall/postinstall.in:1.15	Tue Feb 25 10:27:01 2020
+++ src/usr.sbin/postinstall/postinstall.in	Thu Apr  2 13:04:09 2020
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: postinstall.in,v 1.15 2020/02/25 10:27:01 nakayama Exp $
+# $NetBSD: postinstall.in,v 1.16 2020/04/02 13:04:09 roy Exp $
 #
 # Copyright (c) 2002-2015 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -943,32 +943,59 @@ do_dhcpcd()
 	populate_dir "$op" true "${dir}" "${DEST_DIR}/etc" 644 dhcpcd.conf
 	failed=$(( ${failed} + $? ))
 
-	check_dir "${op}" "${DEST_DIR}/var/db/dhcpcd" 755
+	dstdir="${DESTDIR}/var/chroot/dhcpcd"
+
+	check_dir "${op}" "${dstdir}/var/db/dhcpcd" 755
 	failed=$(( ${failed} + $? ))
 
 	move_file "${op}" \
 		"${DEST_DIR}/etc/dhcpcd.duid" \
-		"${DEST_DIR}/var/db/dhcpcd/duid"
+		"${dstdir}/var/db/dhcpcd/duid"
 	failed=$(( ${failed} + $? ))
 
 	move_file "${op}" \
 		"${DEST_DIR}/etc/dhcpcd.secret" \
-		"${DEST_DIR}/var/db/dhcpcd/secret"
+		"${dstdir}/var/db/dhcpcd/secret"
 	failed=$(( ${failed} + $? ))
 
 	move_file "${op}" \
 		"${DEST_DIR}/var/db/dhcpcd-rdm.monotonic" \
-		"${DEST_DIR}/var/db/dhcpcd/rdm_monotonic"
+		"${dstdir}/var/db/dhcpcd/rdm_monotonic"
 	failed=$(( ${failed} + $? ))
 
 	for lease in "${DEST_DIR}/var/db/dhcpcd-"*.lease*; do
 		[ -f "${lease}" ] || continue
 		new_lease=$(basename "${lease}" | ${SED} -e 's/dhcpcd-//')
-		new_lease="${DEST_DIR}/var/db/dhcpcd/${new_lease}"
+		new_lease="${dstdir}/var/db/dhcpcd/${new_lease}"
 		move_file "${op}" "${lease}" "${new_lease}"
 		failed=$(( ${failed} + $? ))
 	done
 
+	move_file "${op}" \
+		"${DEST_DIR}/var/db/dhcpcd/duid" \
+		"${dstdir}/var/db/dhcpcd/duid"
+	failed=$(( ${failed} + $? ))
+
+	move_file "${op}" \
+		"${DEST_DIR}/var/db/dhcpcd/secret" \
+		"${dstdir}/var/db/dhcpcd/secret"
+	failed=$(( ${failed} + $? ))
+
+	move_file "${op}" \
+		"${DEST_DIR}/var/db/dhcpcd/rdm_monotonic" \
+		"${dstdir}/var/db/dhcpcd/rdm_monotonic"
+	failed=$(( ${failed} + $? ))
+
+	for lease in "${DEST_DIR}/var/db/dhcpcd/"*.lease*; do
+		[ -f "${lease}" ] || continue
+		new_lease="${dstdir}/var/db/dhcpcd/$(basename ${lease})"
+		move_file "${op}" "${lease}" "${new_lease}"
+		failed=$(( ${failed} + $? ))
+	done
+
+	contents_owner "${op}" "${dstdir}/var/db/dhcpcd" _dhcpcd _dhcpcd
+	failed=$(( ${failed} + $? ))
+
 	return ${failed}
 }
 



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

2020-04-02 Thread Tohru Nishimura
Module Name:src
Committed By:   nisimura
Date:   Thu Apr  2 13:03:54 UTC 2020

Modified Files:
src/sys/arch/evbmips/conf: CI20

Log Message:
add ukphy as the last resort. enable dmphy for dme


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/sys/arch/evbmips/conf/CI20

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/evbmips/conf/CI20
diff -u src/sys/arch/evbmips/conf/CI20:1.29 src/sys/arch/evbmips/conf/CI20:1.30
--- src/sys/arch/evbmips/conf/CI20:1.29	Sun Jan 19 01:25:05 2020
+++ src/sys/arch/evbmips/conf/CI20	Thu Apr  2 13:03:53 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: CI20,v 1.29 2020/01/19 01:25:05 thorpej Exp $
+#	$NetBSD: CI20,v 1.30 2020/04/02 13:03:53 nisimura Exp $
 #
 # MIPS Creator CI20
 #
@@ -7,7 +7,7 @@ include 	"arch/evbmips/conf/std.ingenic"
 
 #options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		"CI20-$Revision: 1.29 $"
+#ident 		"CI20-$Revision: 1.30 $"
 
 maxusers	32
 
@@ -219,7 +219,7 @@ jzrng0	at apbus0
 # MII/PHY support
 #acphy*		at mii? phy ?		# DAltima AC101 and AMD Am79c874 PHYs
 #amhphy* 	at mii? phy ?		# AMD 79c901 Ethernet PHYs
-#dmphy*		at mii? phy ?		# Davicom DM9101 PHYs
+dmphy*		at mii? phy ?		# Davicom DM9101 PHYs
 #glxtphy*	at mii? phy ?		# Level One LXT-1000 PHYs
 #gphyter*	at mii? phy ?		# NS83861 Gig-E PHY
 #icsphy* 	at mii? phy ?		# Integrated Circuit Systems ICS1890
@@ -233,7 +233,7 @@ jzrng0	at apbus0
 #tlphy*		at mii? phy ?		# ThunderLAN PHYs
 #tqphy*		at mii? phy ?		# TDK Semiconductor PHYs
 #rlphy*		at mii? phy ?		# RealTek PHYs
-#ukphy*		at mii? phy ?		# generic unknown PHYs
+ukphy*		at mii? phy ?		# generic unknown PHYs
 
 
 # Pseudo-devices



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

2020-04-02 Thread Tohru Nishimura
Module Name:src
Committed By:   nisimura
Date:   Thu Apr  2 13:03:03 UTC 2020

Modified Files:
src/sys/arch/mips/ingenic: ingenic_dme.c

Log Message:
add miivar.h and put a stop gap to compile.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/mips/ingenic/ingenic_dme.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/mips/ingenic/ingenic_dme.c
diff -u src/sys/arch/mips/ingenic/ingenic_dme.c:1.3 src/sys/arch/mips/ingenic/ingenic_dme.c:1.4
--- src/sys/arch/mips/ingenic/ingenic_dme.c:1.3	Fri May 19 07:43:31 2017
+++ src/sys/arch/mips/ingenic/ingenic_dme.c	Thu Apr  2 13:03:03 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: ingenic_dme.c,v 1.3 2017/05/19 07:43:31 skrll Exp $ */
+/*	$NetBSD: ingenic_dme.c,v 1.4 2020/04/02 13:03:03 nisimura Exp $ */
 
 /*-
  * Copyright (c) 2015 Michael Lorenz
@@ -27,14 +27,13 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ingenic_dme.c,v 1.3 2017/05/19 07:43:31 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ingenic_dme.c,v 1.4 2020/04/02 13:03:03 nisimura Exp $");
 
 #include 
-#include 
-#include 
-#include 
+#include 
 #include 
-#include 
+#include 
+#include 
 
 #include 
 #include 
@@ -42,6 +41,7 @@ __KERNEL_RCSID(0, "$NetBSD: ingenic_dme.
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -132,7 +132,7 @@ ingenic_dme_attach(device_t parent, devi
 		 13);
 		goto fail;
 	}
-
+#if 0
 	eaddrprop = prop_dictionary_get(device_properties(self), "mac-address");
 
 	if (eaddrprop != NULL && prop_data_size(eaddrprop) == ETHER_ADDR_LEN) {
@@ -148,6 +148,13 @@ ingenic_dme_attach(device_t parent, devi
 		aprint_error_dev(self, "reading MAC address from chip\n");
 		dme_read_c(sc, DM9000_PAB0, enaddr, 6);
 	}
+#else
+	(void)eaddrprop;
+	/*
+	 * dme_attach checks dictionary, then previous setting, then roll
+	 * a dice to make random MAC address
+	 */
+#endif
 	dme_attach(sc, enaddr);
 	return;
 fail:



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

2020-04-02 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Thu Apr  2 13:03:22 UTC 2020

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

Log Message:
Adjust set lists for dhcpcd chroot


To generate a diff of this commit:
cvs rdiff -u -r1.1236 -r1.1237 src/distrib/sets/lists/base/mi

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

Modified files:

Index: src/distrib/sets/lists/base/mi
diff -u src/distrib/sets/lists/base/mi:1.1236 src/distrib/sets/lists/base/mi:1.1237
--- src/distrib/sets/lists/base/mi:1.1236	Thu Apr  2 03:32:46 2020
+++ src/distrib/sets/lists/base/mi	Thu Apr  2 13:03:22 2020
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1236 2020/04/02 03:32:46 kamil Exp $
+# $NetBSD: mi,v 1.1237 2020/04/02 13:03:22 roy Exp $
 #
 # Note:	Don't delete entries from here - mark them as "obsolete" instead,
 #	unless otherwise stated below.
@@ -6040,6 +6040,12 @@
 ./var/at/spool	base-cron-root
 ./var/backups	base-sys-root
 ./var/chroot	base-sys-root
+./var/chroot/dhcpcdbase-dhcpcd-root
+./var/chroot/dhcpcd/etcbase-dhcpcd-root
+./var/chroot/dhcpcd/varbase-dhcpcd-root
+./var/chroot/dhcpcd/var/run			base-dhcpcd-root
+./var/chroot/dhcpcd/var/db			base-dhcpcd-root
+./var/chroot/dhcpcd/var/db/dhcpcd		base-dhcpcd-root
 ./var/chroot/ftp-proxybase-sys-root
 ./var/chroot/namedbase-bind-root
 ./var/chroot/named/devbase-bind-root
@@ -6089,7 +6095,6 @@
 ./var/cron	base-cron-root
 ./var/cron/tabs	base-cron-root
 ./var/db	base-sys-root
-./var/db/dhcpcd	base-dhcpcd-root
 ./var/db/ns	base-sys-root
 ./var/db/obsoletebase-sys-root
 ./var/db/obsolete/basebase-sys-root



CVS commit: src/etc/defaults

2020-04-02 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Thu Apr  2 13:02:05 UTC 2020

Modified Files:
src/etc/defaults: rc.conf

Log Message:
Add a default dhcpcd_chrootdir


To generate a diff of this commit:
cvs rdiff -u -r1.153 -r1.154 src/etc/defaults/rc.conf

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

Modified files:

Index: src/etc/defaults/rc.conf
diff -u src/etc/defaults/rc.conf:1.153 src/etc/defaults/rc.conf:1.154
--- src/etc/defaults/rc.conf:1.153	Mon Feb  3 09:12:53 2020
+++ src/etc/defaults/rc.conf	Thu Apr  2 13:02:05 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: rc.conf,v 1.153 2020/02/03 09:12:53 roy Exp $
+#	$NetBSD: rc.conf,v 1.154 2020/04/02 13:02:05 roy Exp $
 #
 # /etc/defaults/rc.conf --
 #	default configuration of /etc/rc.conf
@@ -192,6 +192,7 @@ auto_ifconfig=YES# config all avail.
 net_interfaces=""# used only if above is NO
 flushroutes=YES	# flush routes in netstart
 dhcpcd=NO		dhcpcd_flags="-qM"	# For ifconfig_XXX=dhcp.
+dhcpcd_chrootdir="/var/chroot/dhcpcd"
 ntpdate=NO  		ntpdate_flags="-b -s"	# May need '-u' thru firewall
 ppp=YES			ppp_peers=""		# /etc/ppp/peers to call
 ip6mode=host	# host, autohost or router



CVS commit: src/etc

2020-04-02 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Thu Apr  2 12:58:49 UTC 2020

Modified Files:
src/etc/mtree: NetBSD.dist.base
src/etc/rc.d: dhcpcd

Log Message:
Add chroot support for dhcpcd


To generate a diff of this commit:
cvs rdiff -u -r1.212 -r1.213 src/etc/mtree/NetBSD.dist.base
cvs rdiff -u -r1.7 -r1.8 src/etc/rc.d/dhcpcd

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.212 src/etc/mtree/NetBSD.dist.base:1.213
--- src/etc/mtree/NetBSD.dist.base:1.212	Sun Mar 29 17:14:13 2020
+++ src/etc/mtree/NetBSD.dist.base	Thu Apr  2 12:58:49 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: NetBSD.dist.base,v 1.212 2020/03/29 17:14:13 christos Exp $
+#	$NetBSD: NetBSD.dist.base,v 1.213 2020/04/02 12:58:49 roy Exp $
 #	@(#)4.4BSD.dist	8.1 (Berkeley) 6/13/93
 
 # Do not customize this file as it may be overwritten on upgrades.
@@ -1277,6 +1277,12 @@
 ./var/at/spool			mode=0700
 ./var/backups
 ./var/chroot
+./var/chroot/dhcpcd
+./var/chroot/dhcpcd/etc
+./var/chroot/dhcpcd/var
+./var/chroot/dhcpcd/var/run
+./var/chroot/dhcpcd/var/db
+./var/chroot/dhcpcd/var/db/dhcpcd	mode=0775 uname=_dhcpcd gname=_dhcpcd
 ./var/chroot/ftp-proxy		mode=0755
 ./var/chroot/named
 ./var/chroot/named/dev
@@ -1321,7 +1327,6 @@
 ./var/cron
 ./var/cron/tabs			mode=0700
 ./var/db
-./var/db/dhcpcd
 ./var/db/ns
 ./var/db/obsolete
 ./var/db/postfix		uname=postfix gname=postfix mode=0755

Index: src/etc/rc.d/dhcpcd
diff -u src/etc/rc.d/dhcpcd:1.7 src/etc/rc.d/dhcpcd:1.8
--- src/etc/rc.d/dhcpcd:1.7	Sat Feb 22 11:55:43 2020
+++ src/etc/rc.d/dhcpcd	Thu Apr  2 12:58:49 2020
@@ -1,10 +1,11 @@
 #!/bin/sh
 
-# $NetBSD: dhcpcd,v 1.7 2020/02/22 11:55:43 roy Exp $
+# $NetBSD: dhcpcd,v 1.8 2020/04/02 12:58:49 roy Exp $
 
 # PROVIDE: dhcpcd
 # REQUIRE: network mountcritlocal
 # BEFORE:  NETWORKING
+# KEYWORD: chrootdir
 
 $_rc_subr_loaded . /etc/rc.subr
 



CVS commit: src/external/bsd/dhcpcd

2020-04-02 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Thu Apr  2 12:56:01 UTC 2020

Modified Files:
src/external/bsd/dhcpcd: Makefile.inc
src/external/bsd/dhcpcd/include: config.h
src/external/bsd/dhcpcd/sbin/dhcpcd: Makefile

Log Message:
Build dhcpcd with privsep support.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/dhcpcd/Makefile.inc
cvs rdiff -u -r1.4 -r1.5 src/external/bsd/dhcpcd/include/config.h
cvs rdiff -u -r1.50 -r1.51 src/external/bsd/dhcpcd/sbin/dhcpcd/Makefile

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

Modified files:

Index: src/external/bsd/dhcpcd/Makefile.inc
diff -u src/external/bsd/dhcpcd/Makefile.inc:1.3 src/external/bsd/dhcpcd/Makefile.inc:1.4
--- src/external/bsd/dhcpcd/Makefile.inc:1.3	Thu Jul  5 05:41:17 2018
+++ src/external/bsd/dhcpcd/Makefile.inc	Thu Apr  2 12:56:01 2020
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.inc,v 1.3 2018/07/05 05:41:17 triaxx Exp $
+# $NetBSD: Makefile.inc,v 1.4 2020/04/02 12:56:01 roy Exp $
 
 SRCDIR=		${NETBSDSRCDIR}/external/bsd/dhcpcd
 DIST=		${SRCDIR}/dist
@@ -7,10 +7,11 @@ SED_SYS=	-e 's:@SYSCONFDIR@:/etc:g' \
 		-e 's:@DATADIR@:/usr/share/examples:g' \
 		-e 's:@DBDIR@:/var/db/dhcpcd:g' \
 		-e 's:@LIBDIR@:/lib:g' \
-		-e 's:@RUNDIR@:/var/run:g' \
+		-e 's:@RUNDIR@:/var/run/dhcpcd:g' \
 		-e 's:@HOOKDIR@:/libexec/dhcpcd-hooks:g' \
 		-e 's:@SCRIPT@:/libexec/dhcpcd-run-hooks:g' \
 		-e 's:@SERVICEEXISTS@::g' \
 		-e 's:@SERVICECMD@::g' \
 		-e 's:@SERVICESTATUS@::g' \
-		-e 's:@STATUSARG@::g'
+		-e 's:@STATUSARG@::g' \
+		-e 's:@DEFAULT_HOSTNAME@::g'

Index: src/external/bsd/dhcpcd/include/config.h
diff -u src/external/bsd/dhcpcd/include/config.h:1.4 src/external/bsd/dhcpcd/include/config.h:1.5
--- src/external/bsd/dhcpcd/include/config.h:1.4	Wed Jul 24 09:59:28 2019
+++ src/external/bsd/dhcpcd/include/config.h	Thu Apr  2 12:56:01 2020
@@ -1,16 +1,20 @@
 /* netbsd */
+#ifndef	SYSCONFDIR
 #define	SYSCONFDIR		"/etc"
 #define	SBINDIR			"/sbin"
 #define	LIBDIR			"/lib"
 #define	LIBEXECDIR		"/libexec"
 #define	DBDIR			"/var/db/dhcpcd"
-#define	RUNDIR			"/var/run"
+#define	RUNDIR			"/var/run/dhcpcd"
+#endif
+#ifndef PRIVSEP_USER
+#define PRIVSEP_USER		 "_dhcpcd"
+#endif
 #define	HAVE_IFAM_PID
 #define	HAVE_IFAM_ADDRFLAGS
 #define	HAVE_IFADDRS_ADDRFLAGS
 #define	HAVE_OPEN_MEMSTREAM
 #define	HAVE_UTIL_H
-#define	HAVE_SETPROCTITLE
 #define	HAVE_SYS_QUEUE_H
 #define	HAVE_SYS_RBTREE_H
 #define	HAVE_REALLOCARRAY

Index: src/external/bsd/dhcpcd/sbin/dhcpcd/Makefile
diff -u src/external/bsd/dhcpcd/sbin/dhcpcd/Makefile:1.50 src/external/bsd/dhcpcd/sbin/dhcpcd/Makefile:1.51
--- src/external/bsd/dhcpcd/sbin/dhcpcd/Makefile:1.50	Wed Jan 29 23:42:57 2020
+++ src/external/bsd/dhcpcd/sbin/dhcpcd/Makefile	Thu Apr  2 12:56:01 2020
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.50 2020/01/29 23:42:57 christos Exp $
+# $NetBSD: Makefile,v 1.51 2020/04/02 12:56:01 roy Exp $
 #
 
 WARNS?=		6
@@ -13,6 +13,10 @@ SRCS+=		if.c if-options.c route.c sa.c s
 SRCS+=		dhcp-common.c dhcpcd-embedded.c
 SRCS+=		if-bsd.c
 
+CPPFLAGS+=	-DPRIVSEP -DPRIVSEP_USER=\"_dhcpcd\"
+SRCS+=		privsep.c privsep-root.c privsep-inet.c
+SRCS+=		privsep-bsd.c
+
 CPPFLAGS+=	-DHAVE_CONFIG_H -D_OPENBSD_SOURCE
 
 USE_INET?=	yes
@@ -27,6 +31,7 @@ SRCS+=		auth.c
 .if (${USE_INET} != "no")
 CPPFLAGS+=	-DINET
 SRCS+=		bpf.c dhcp.c ipv4.c
+SRCS+=		privsep-bpf.c
 .if !defined(SMALLPROG)
 CPPFLAGS+=	-DARP
 SRCS+=		arp.c



CVS import: src/external/bsd/dhcpcd/dist

2020-04-02 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Thu Apr  2 12:38:56 UTC 2020

Update of /cvsroot/src/external/bsd/dhcpcd/dist
In directory ivanova.netbsd.org:/tmp/cvs-serv17673

Log Message:
Update to dhcpcd-9.0.0 with the following changes:

 * Decode interface complex interface names eth0.100:2 eth0i100:2.
   This allows us to ignore some virtual interfaces by default
 * ARP: Report L2 header address on conflict for more clarity
 * DHCP: Support jumbo frames (untested)
 * DHCP6: Clean up old lease on failure to confirm/rebind, etc
 * RA: Prefer older routers
 * INET6: Obscure prefixes are now calculated correctly 

 * Privilege Separation
 * default hostname is now a blank string rather than localhost
 * Leases are now dumped over the control socket - you get RA's now as well.
 * Better support for many IPv6 routers
 * RTM_MISS filtering
 * RA: Deprecate stale addresses by setting pltime 0
 * DHCP6: Deprecate stale addresses by setting pltime 0 

Status:

Vendor Tag: ROY
Release Tags:   dhcpcd-9_0_0

U src/external/bsd/dhcpcd/dist/LICENSE
U src/external/bsd/dhcpcd/dist/README.md
U src/external/bsd/dhcpcd/dist/src/defs.h
U src/external/bsd/dhcpcd/dist/src/common.c
U src/external/bsd/dhcpcd/dist/src/control.c
C src/external/bsd/dhcpcd/dist/src/dhcpcd.c
U src/external/bsd/dhcpcd/dist/src/duid.c
U src/external/bsd/dhcpcd/dist/src/eloop.c
C src/external/bsd/dhcpcd/dist/src/logerr.c
U src/external/bsd/dhcpcd/dist/src/if.c
C src/external/bsd/dhcpcd/dist/src/if-options.c
U src/external/bsd/dhcpcd/dist/src/sa.c
U src/external/bsd/dhcpcd/dist/src/route.c
U src/external/bsd/dhcpcd/dist/src/dhcp-common.c
C src/external/bsd/dhcpcd/dist/src/script.c
U src/external/bsd/dhcpcd/dist/src/auth.c
C src/external/bsd/dhcpcd/dist/src/if-bsd.c
C src/external/bsd/dhcpcd/dist/src/dhcp.c
U src/external/bsd/dhcpcd/dist/src/ipv4.c
C src/external/bsd/dhcpcd/dist/src/bpf.c
U src/external/bsd/dhcpcd/dist/src/arp.c
U src/external/bsd/dhcpcd/dist/src/ipv4ll.c
C src/external/bsd/dhcpcd/dist/src/ipv6.c
C src/external/bsd/dhcpcd/dist/src/ipv6nd.c
C src/external/bsd/dhcpcd/dist/src/dhcp6.c
N src/external/bsd/dhcpcd/dist/src/privsep.c
N src/external/bsd/dhcpcd/dist/src/privsep-root.c
N src/external/bsd/dhcpcd/dist/src/privsep-inet.c
N src/external/bsd/dhcpcd/dist/src/privsep-bpf.c
N src/external/bsd/dhcpcd/dist/src/privsep-bsd.c
U src/external/bsd/dhcpcd/dist/src/dhcpcd-embedded.c
U src/external/bsd/dhcpcd/dist/src/common.h
U src/external/bsd/dhcpcd/dist/src/control.h
U src/external/bsd/dhcpcd/dist/src/dhcpcd.h
U src/external/bsd/dhcpcd/dist/src/duid.h
U src/external/bsd/dhcpcd/dist/src/eloop.h
U src/external/bsd/dhcpcd/dist/src/logerr.h
U src/external/bsd/dhcpcd/dist/src/if.h
U src/external/bsd/dhcpcd/dist/src/if-options.h
U src/external/bsd/dhcpcd/dist/src/sa.h
U src/external/bsd/dhcpcd/dist/src/route.h
U src/external/bsd/dhcpcd/dist/src/dhcp-common.h
U src/external/bsd/dhcpcd/dist/src/script.h
U src/external/bsd/dhcpcd/dist/src/auth.h
U src/external/bsd/dhcpcd/dist/src/dhcp.h
U src/external/bsd/dhcpcd/dist/src/ipv4.h
U src/external/bsd/dhcpcd/dist/src/bpf.h
U src/external/bsd/dhcpcd/dist/src/arp.h
U src/external/bsd/dhcpcd/dist/src/ipv4ll.h
C src/external/bsd/dhcpcd/dist/src/ipv6.h
U src/external/bsd/dhcpcd/dist/src/ipv6nd.h
U src/external/bsd/dhcpcd/dist/src/dhcp6.h
N src/external/bsd/dhcpcd/dist/src/privsep.h
N src/external/bsd/dhcpcd/dist/src/privsep-root.h
N src/external/bsd/dhcpcd/dist/src/privsep-inet.h
N src/external/bsd/dhcpcd/dist/src/privsep-bpf.h
U src/external/bsd/dhcpcd/dist/src/dhcpcd-embedded.h
U src/external/bsd/dhcpcd/dist/src/dev.h
U src/external/bsd/dhcpcd/dist/src/dhcpcd.conf.5.in
C src/external/bsd/dhcpcd/dist/src/dhcpcd.8.in
U src/external/bsd/dhcpcd/dist/src/dhcpcd.conf
C src/external/bsd/dhcpcd/dist/hooks/dhcpcd-run-hooks.in
U src/external/bsd/dhcpcd/dist/hooks/dhcpcd-run-hooks.8.in
N src/external/bsd/dhcpcd/dist/hooks/00-linux
U src/external/bsd/dhcpcd/dist/hooks/01-test
U src/external/bsd/dhcpcd/dist/hooks/02-dump
U src/external/bsd/dhcpcd/dist/hooks/10-wpa_supplicant
U src/external/bsd/dhcpcd/dist/hooks/15-timezone
C src/external/bsd/dhcpcd/dist/hooks/20-resolv.conf
U src/external/bsd/dhcpcd/dist/hooks/29-lookup-hostname
N src/external/bsd/dhcpcd/dist/hooks/30-hostname.in
C src/external/bsd/dhcpcd/dist/hooks/50-ntp.conf
U src/external/bsd/dhcpcd/dist/hooks/50-ypbind.in

15 conflicts created by this import.
Use the following command to help the merge:

cvs checkout -jROY:yesterday -jROY src/external/bsd/dhcpcd/dist



CVS commit: src/etc

2020-04-02 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Thu Apr  2 12:35:13 UTC 2020

Modified Files:
src/etc: group master.passwd

Log Message:
Add _dhcpcd user and group


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/etc/group
cvs rdiff -u -r1.50 -r1.51 src/etc/master.passwd

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

Modified files:

Index: src/etc/group
diff -u src/etc/group:1.35 src/etc/group:1.36
--- src/etc/group:1.35	Sun Oct 27 07:08:15 2019
+++ src/etc/group	Thu Apr  2 12:35:13 2020
@@ -30,6 +30,7 @@ guest:*:31:root
 _unbound:*:32:
 _nsd:*:33:
 nvmm:*:34:root
+_dhcpcd:*:35:
 nobody:*:39:
 utmp:*:45:
 authpf:*:72:

Index: src/etc/master.passwd
diff -u src/etc/master.passwd:1.50 src/etc/master.passwd:1.51
--- src/etc/master.passwd:1.50	Mon Jan  9 14:26:58 2017
+++ src/etc/master.passwd	Thu Apr  2 12:35:13 2020
@@ -21,5 +21,6 @@ _tss:*:28:28::0:0:& pseudo-user:/var/tpm
 _rtadvd:*:30:30::0:0:& pseudo-user:/var/chroot/rtadvd:/sbin/nologin
 _unbound:*:32:32::0:0:& pseudo-user:/var/chroot/unbound:/sbin/nologin
 _nsd:*:33:33::0:0:& pseudo-user:/var/chroot/nsd:/sbin/nologin
+_dhcpcd:*:35:35::0:0:& pseudo-user:/var/chroot/dhcpcd:/sbin/nologin
 uucp:*:66:1::0:0:UNIX-to-UNIX Copy:/nonexistent:/sbin/nologin
 nobody:*:32767:39::0:0:Unprivileged user:/nonexistent:/sbin/nologin



CVS commit: src/sys/dev/usb

2020-04-02 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu Apr  2 11:52:41 UTC 2020

Modified Files:
src/sys/dev/usb: xhcivar.h

Log Message:
Tweak a comment in previous


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/dev/usb/xhcivar.h

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

Modified files:

Index: src/sys/dev/usb/xhcivar.h
diff -u src/sys/dev/usb/xhcivar.h:1.12 src/sys/dev/usb/xhcivar.h:1.13
--- src/sys/dev/usb/xhcivar.h:1.12	Thu Apr  2 11:37:23 2020
+++ src/sys/dev/usb/xhcivar.h	Thu Apr  2 11:52:41 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: xhcivar.h,v 1.12 2020/04/02 11:37:23 skrll Exp $	*/
+/*	$NetBSD: xhcivar.h,v 1.13 2020/04/02 11:52:41 skrll Exp $	*/
 
 /*
  * Copyright (c) 2013 Jonathan A. Kollasch
@@ -72,7 +72,7 @@ struct xhci_slot {
 	usb_dma_t xs_dc_dma;		/* device context page */
 	usb_dma_t xs_ic_dma;		/* input context page */
 	struct xhci_ring *xs_xr[XHCI_MAX_DCI + 1];
-	/* transfer ring */
+	/* transfer rings */
 	u_int xs_idx;			/* slot index */
 };
 



CVS commit: src/sys/dev/usb

2020-04-02 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu Apr  2 11:37:23 UTC 2020

Modified Files:
src/sys/dev/usb: xhci.c xhcivar.h

Log Message:
Reduce the memory footprint by allocating a ring per endpoint/pipe on
pipe open.

>From sc.dying on tech-kern


To generate a diff of this commit:
cvs rdiff -u -r1.122 -r1.123 src/sys/dev/usb/xhci.c
cvs rdiff -u -r1.11 -r1.12 src/sys/dev/usb/xhcivar.h

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

Modified files:

Index: src/sys/dev/usb/xhci.c
diff -u src/sys/dev/usb/xhci.c:1.122 src/sys/dev/usb/xhci.c:1.123
--- src/sys/dev/usb/xhci.c:1.122	Sat Mar 14 03:01:36 2020
+++ src/sys/dev/usb/xhci.c	Thu Apr  2 11:37:23 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: xhci.c,v 1.122 2020/03/14 03:01:36 christos Exp $	*/
+/*	$NetBSD: xhci.c,v 1.123 2020/04/02 11:37:23 skrll Exp $	*/
 
 /*
  * Copyright (c) 2013 Jonathan A. Kollasch
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: xhci.c,v 1.122 2020/03/14 03:01:36 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xhci.c,v 1.123 2020/04/02 11:37:23 skrll Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -164,7 +164,7 @@ static usbd_status xhci_do_command(struc
 static usbd_status xhci_do_command_locked(struct xhci_softc * const,
 struct xhci_soft_trb * const, int);
 static usbd_status xhci_init_slot(struct usbd_device *, uint32_t);
-static void xhci_free_slot(struct xhci_softc *, struct xhci_slot *, int, int);
+static void xhci_free_slot(struct xhci_softc *, struct xhci_slot *);
 static usbd_status xhci_set_address(struct usbd_device *, uint32_t, bool);
 static usbd_status xhci_enable_slot(struct xhci_softc * const,
 uint8_t * const);
@@ -175,8 +175,9 @@ static void xhci_set_dcba(struct xhci_so
 static usbd_status xhci_update_ep0_mps(struct xhci_softc * const,
 struct xhci_slot * const, u_int);
 static usbd_status xhci_ring_init(struct xhci_softc * const,
-struct xhci_ring * const, size_t, size_t);
-static void xhci_ring_free(struct xhci_softc * const, struct xhci_ring * const);
+struct xhci_ring **, size_t, size_t);
+static void xhci_ring_free(struct xhci_softc * const,
+struct xhci_ring ** const);
 
 static void xhci_setup_ctx(struct usbd_pipe *);
 static void xhci_setup_route(struct usbd_pipe *, uint32_t *);
@@ -1194,20 +1195,20 @@ xhci_init(struct xhci_softc *sc)
 
 	struct xhci_erste *erst;
 	erst = KERNADDR(>sc_eventst_dma, 0);
-	erst[0].erste_0 = htole64(xhci_ring_trbp(>sc_er, 0));
-	erst[0].erste_2 = htole32(sc->sc_er.xr_ntrb);
+	erst[0].erste_0 = htole64(xhci_ring_trbp(sc->sc_er, 0));
+	erst[0].erste_2 = htole32(sc->sc_er->xr_ntrb);
 	erst[0].erste_3 = htole32(0);
 	usb_syncmem(>sc_eventst_dma, 0,
 	XHCI_ERSTE_SIZE * XHCI_EVENT_RING_SEGMENTS, BUS_DMASYNC_PREWRITE);
 
 	xhci_rt_write_4(sc, XHCI_ERSTSZ(0), XHCI_EVENT_RING_SEGMENTS);
 	xhci_rt_write_8(sc, XHCI_ERSTBA(0), DMAADDR(>sc_eventst_dma, 0));
-	xhci_rt_write_8(sc, XHCI_ERDP(0), xhci_ring_trbp(>sc_er, 0) |
+	xhci_rt_write_8(sc, XHCI_ERDP(0), xhci_ring_trbp(sc->sc_er, 0) |
 	XHCI_ERDP_LO_BUSY);
 
 	xhci_op_write_8(sc, XHCI_DCBAAP, DMAADDR(>sc_dcbaa_dma, 0));
-	xhci_op_write_8(sc, XHCI_CRCR, xhci_ring_trbp(>sc_cr, 0) |
-	sc->sc_cr.xr_cs);
+	xhci_op_write_8(sc, XHCI_CRCR, xhci_ring_trbp(sc->sc_cr, 0) |
+	sc->sc_cr->xr_cs);
 
 	xhci_op_barrier(sc, 0, 4, BUS_SPACE_BARRIER_WRITE);
 
@@ -1543,7 +1544,7 @@ xhci_set_dequeue_locked(struct usbd_pipe
 	struct xhci_softc * const sc = XHCI_PIPE2SC(pipe);
 	struct xhci_slot * const xs = pipe->up_dev->ud_hcpriv;
 	const u_int dci = xhci_ep_get_dci(pipe->up_endpoint->ue_edesc);
-	struct xhci_ring * const xr = >xs_ep[dci].xe_tr;
+	struct xhci_ring * const xr = xs->xs_xr[dci];
 	struct xhci_soft_trb trb;
 	usbd_status err;
 
@@ -1551,6 +1552,7 @@ xhci_set_dequeue_locked(struct usbd_pipe
 	XHCIHIST_CALLARGS("slot %ju dci %ju", xs->xs_idx, dci, 0, 0);
 
 	KASSERT(mutex_owned(>sc_lock));
+	KASSERT(xr != NULL);
 
 	xhci_host_dequeue(xr);
 
@@ -1588,8 +1590,11 @@ xhci_open(struct usbd_pipe *pipe)
 {
 	struct usbd_device * const dev = pipe->up_dev;
 	struct xhci_softc * const sc = XHCI_BUS2SC(dev->ud_bus);
+	struct xhci_slot * const xs = pipe->up_dev->ud_hcpriv;
 	usb_endpoint_descriptor_t * const ed = pipe->up_endpoint->ue_edesc;
+	const u_int dci = xhci_ep_get_dci(ed);
 	const uint8_t xfertype = UE_GET_XFERTYPE(ed->bmAttributes);
+	usbd_status err;
 
 	XHCIHIST_FUNC();
 	XHCIHIST_CALLARGS("addr %jd depth %jd port %jd speed %jd", dev->ud_addr,
@@ -1640,6 +1645,17 @@ xhci_open(struct usbd_pipe *pipe)
 		break;
 	}
 
+	KASSERT(xs != NULL);
+	KASSERT(xs->xs_xr[dci] == NULL);
+
+	/* allocate transfer ring */
+	err = xhci_ring_init(sc, >xs_xr[dci], XHCI_TRANSFER_RING_TRBS,
+	XHCI_TRB_ALIGN);
+	if (err) {
+		DPRINTFN(1, "ring alloc failed %jd", err, 0, 0, 0);
+		return err;
+	}
+
 	if (ed->bEndpointAddress != USB_CONTROL_ENDPOINT)
 		return xhci_configure_endpoint(pipe);
 
@@ -1681,6 +1697,7 @@ 

CVS commit: src/usr.bin/calendar/calendars

2020-04-02 Thread Sevan Janiyan
Module Name:src
Committed By:   sevan
Date:   Thu Apr  2 11:34:33 UTC 2020

Modified Files:
src/usr.bin/calendar/calendars: calendar.netbsd

Log Message:
just spaces


To generate a diff of this commit:
cvs rdiff -u -r1.45 -r1.46 src/usr.bin/calendar/calendars/calendar.netbsd

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/calendar/calendars/calendar.netbsd
diff -u src/usr.bin/calendar/calendars/calendar.netbsd:1.45 src/usr.bin/calendar/calendars/calendar.netbsd:1.46
--- src/usr.bin/calendar/calendars/calendar.netbsd:1.45	Thu Apr  2 11:32:31 2020
+++ src/usr.bin/calendar/calendars/calendar.netbsd	Thu Apr  2 11:34:33 2020
@@ -13,7 +13,7 @@
 02/11   NetBSD/sandpoint port started, 2001
 02/12   NetBSD 5.0.2 released, 2010
 02/13   NetBSD/alpha port started, 1995
-02/14 	NetBSD 9.0 released, 2020
+02/14   NetBSD 9.0 released, 2020
 02/18   NetBSD/newsmips port started, 1998
 02/20   NetBSD/hpcarm port started, 2001
 02/24   NetBSD/hp700 port renamed NetBSD/hppa, 2014
@@ -33,7 +33,7 @@
 03/21   NetBSD/i386 port started, 1993
 03/26   NetBSD/atari port started, 1995
 03/28   NetBSD/sun2 port started, 2001
-03/31 	NetBSD 8.2 released, 2020
+03/31   NetBSD 8.2 released, 2020
 04/12   NetBSD 6.0.5 released, 2014
 04/12   NetBSD 6.1.4 released, 2014
 04/14   NetBSD 2.0.2 released, 2005



CVS commit: src/usr.bin/calendar/calendars

2020-04-02 Thread Sevan Janiyan
Module Name:src
Committed By:   sevan
Date:   Thu Apr  2 11:32:31 UTC 2020

Modified Files:
src/usr.bin/calendar/calendars: calendar.netbsd

Log Message:
align


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.45 src/usr.bin/calendar/calendars/calendar.netbsd

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/calendar/calendars/calendar.netbsd
diff -u src/usr.bin/calendar/calendars/calendar.netbsd:1.44 src/usr.bin/calendar/calendars/calendar.netbsd:1.45
--- src/usr.bin/calendar/calendars/calendar.netbsd:1.44	Thu Apr  2 11:27:55 2020
+++ src/usr.bin/calendar/calendars/calendar.netbsd	Thu Apr  2 11:32:31 2020
@@ -13,7 +13,7 @@
 02/11   NetBSD/sandpoint port started, 2001
 02/12   NetBSD 5.0.2 released, 2010
 02/13   NetBSD/alpha port started, 1995
-02/14	NetBSD 9.0 released, 2020
+02/14 	NetBSD 9.0 released, 2020
 02/18   NetBSD/newsmips port started, 1998
 02/20   NetBSD/hpcarm port started, 2001
 02/24   NetBSD/hp700 port renamed NetBSD/hppa, 2014
@@ -33,7 +33,7 @@
 03/21   NetBSD/i386 port started, 1993
 03/26   NetBSD/atari port started, 1995
 03/28   NetBSD/sun2 port started, 2001
-03/31	NetBSD 8.2 released, 2020
+03/31 	NetBSD 8.2 released, 2020
 04/12   NetBSD 6.0.5 released, 2014
 04/12   NetBSD 6.1.4 released, 2014
 04/14   NetBSD 2.0.2 released, 2005



CVS commit: src/usr.bin/calendar/calendars

2020-04-02 Thread Sevan Janiyan
Module Name:src
Committed By:   sevan
Date:   Thu Apr  2 11:27:55 UTC 2020

Modified Files:
src/usr.bin/calendar/calendars: calendar.netbsd

Log Message:
Add NetBSD 9.0 & 8.2

Heads up by Harold Gutch


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 src/usr.bin/calendar/calendars/calendar.netbsd

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/calendar/calendars/calendar.netbsd
diff -u src/usr.bin/calendar/calendars/calendar.netbsd:1.43 src/usr.bin/calendar/calendars/calendar.netbsd:1.44
--- src/usr.bin/calendar/calendars/calendar.netbsd:1.43	Sat Sep 21 09:23:11 2019
+++ src/usr.bin/calendar/calendars/calendar.netbsd	Thu Apr  2 11:27:55 2020
@@ -13,6 +13,7 @@
 02/11   NetBSD/sandpoint port started, 2001
 02/12   NetBSD 5.0.2 released, 2010
 02/13   NetBSD/alpha port started, 1995
+02/14	NetBSD 9.0 released, 2020
 02/18   NetBSD/newsmips port started, 1998
 02/20   NetBSD/hpcarm port started, 2001
 02/24   NetBSD/hp700 port renamed NetBSD/hppa, 2014
@@ -32,6 +33,7 @@
 03/21   NetBSD/i386 port started, 1993
 03/26   NetBSD/atari port started, 1995
 03/28   NetBSD/sun2 port started, 2001
+03/31	NetBSD 8.2 released, 2020
 04/12   NetBSD 6.0.5 released, 2014
 04/12   NetBSD 6.1.4 released, 2014
 04/14   NetBSD 2.0.2 released, 2005



CVS commit: src/doc

2020-04-02 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Thu Apr  2 11:19:09 UTC 2020

Modified Files:
src/doc: TODO.ptrace

Log Message:
Update with reality

Drop finished or not important tasks.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/doc/TODO.ptrace

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

Modified files:

Index: src/doc/TODO.ptrace
diff -u src/doc/TODO.ptrace:1.31 src/doc/TODO.ptrace:1.32
--- src/doc/TODO.ptrace:1.31	Fri Jun 14 16:11:11 2019
+++ src/doc/TODO.ptrace	Thu Apr  2 11:19:09 2020
@@ -1,19 +1,10 @@
-$NetBSD: TODO.ptrace,v 1.31 2019/06/14 16:11:11 kamil Exp $
+$NetBSD: TODO.ptrace,v 1.32 2020/04/02 11:19:09 kamil Exp $
 
 Items we (currently) plan to finish in the ptrace(2) field:
 
  - verify ppid of core dump generated with PT_DUMPCORE
it must point to the real parent, not tracer
- - adapt OpenBSD regress test (regress/sys/ptrace/ptrace.c) for the ATF context
- - reiterate over FreeBSD tests and add missing ones if applicable
  - add PT_DUMPCORE tests in the ATF framework
- - research kevent support for tracing a process over a file descriptor,
-   this means alternative to wait(2)-based events with passing events over the
-   kqueue API - signal handlers are global per application and they clash with
-   GUI toolkits (and perhaps other libraries) - this is long term wishlist in
-   GDB for Linux - the current approach is to fork and debug through GDB remote
-   protocol (this is how it is done in LLDB)
- - add ATF tests for SIGCHLD
  - research kgdb(4)
 
 and of course: fix as many bugs as possible.



CVS commit: src/doc

2020-04-02 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Thu Apr  2 11:18:24 UTC 2020

Modified Files:
src/doc: TODO.sanitizers

Log Message:
Update with reality

Drop tasks not important or not relevant here.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/doc/TODO.sanitizers

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

Modified files:

Index: src/doc/TODO.sanitizers
diff -u src/doc/TODO.sanitizers:1.12 src/doc/TODO.sanitizers:1.13
--- src/doc/TODO.sanitizers:1.12	Sat Dec 28 04:23:26 2019
+++ src/doc/TODO.sanitizers	Thu Apr  2 11:18:23 2020
@@ -10,26 +10,17 @@ Long term:
  - improve the framework for ioctl(2) database and handle special cases when a
part of a struct can be uninitialized and passed to the kernel (MSan)
  - port or finish the port of:
-   * shadowcallstack,
* cfi,
* scudo,
* DFSan.
  - port HWASan -- aarch64 specific, needs hardware or emulator
- - make MKSANITIZER usable with any supported by a compiler combination of
-   sanitizers
  - pkgsrc integration with sanitizers and MKSANITIZER (PKGSANITIZER?)
  - port what possible to !amd64
  - fixes with the signal code
  - make compiler-rt buildable with GCC
- - finish the support of float128 for Clang/LLVM/libstdc++/libgcc
  - merge of the libFuzzer integration with the basesystem
  - oom-killer ATF tests and fixes
  - utime(3) allow changing actime regardless of noatime mount property
  - NetBSD tar: handle character escaping in file names (\\ \), needed in
check-lld (lld::reproduce-backslash.s)
-
-
-Unspecified:
- - kernel-tsan? upstream development is stalled with patches for Linux 4.2
-   https://github.com/google/ktsan
  - kernel-safestack? implemented in Fuchsia/Magenta



CVS commit: src/doc

2020-04-02 Thread Sevan Janiyan
Module Name:src
Committed By:   sevan
Date:   Thu Apr  2 11:11:25 UTC 2020

Modified Files:
src/doc: 3RDPARTY

Log Message:
bsd-family-tree


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

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

Modified files:

Index: src/doc/3RDPARTY
diff -u src/doc/3RDPARTY:1.1705 src/doc/3RDPARTY:1.1706
--- src/doc/3RDPARTY:1.1705	Tue Mar 31 13:53:44 2020
+++ src/doc/3RDPARTY	Thu Apr  2 11:11:25 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.1705 2020/03/31 13:53:44 sevan Exp $
+#	$NetBSD: 3RDPARTY,v 1.1706 2020/04/02 11:11:25 sevan Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -195,12 +195,12 @@ Todo[4]: Re-entrant functions of net/*
 Todo[5]: Reconcile the doc directory.
 
 Package:	bsd-family-tree
-Version:	359157
-Current Vers:	359157
+Version:	359561
+Current Vers:	359561
 Maintainer:	The FreeBSD Project
 Archive Site:	https://svnweb.freebsd.org/base/head/share/misc/bsd-family-tree
 Home Page:	https://svnweb.freebsd.org/base/head/share/misc/bsd-family-tree
-Date:		2020-03-20
+Date:		2020-04-02
 Mailing List:
 Responsible:
 License:	BSD (2-clause) (see http://www.freebsd.org/cgi/cvsweb.cgi/src/COPYRIGHT)



CVS commit: src/share/misc

2020-04-02 Thread Sevan Janiyan
Module Name:src
Committed By:   sevan
Date:   Thu Apr  2 11:09:24 UTC 2020

Modified Files:
src/share/misc: bsd-family-tree

Log Message:
Sync with FreeBSD r359561


To generate a diff of this commit:
cvs rdiff -u -r1.80 -r1.81 src/share/misc/bsd-family-tree

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

Modified files:

Index: src/share/misc/bsd-family-tree
diff -u src/share/misc/bsd-family-tree:1.80 src/share/misc/bsd-family-tree:1.81
--- src/share/misc/bsd-family-tree:1.80	Fri Mar 20 03:19:43 2020
+++ src/share/misc/bsd-family-tree	Thu Apr  2 11:09:24 2020
@@ -398,19 +398,21 @@ FreeBSD 5.2   |  |  
  | |  |   |  |   |||
  | |  |   |  |  NetBSD||
  | |  |   |  |   8.1  |DragonFly 5.6
- | |  |   |  |||
- | |  |   |  ||DragonFly 5.6.1
- | |   FreeBSD  macOS|||
- | | 11.3   10.15|||
- |  FreeBSD   |  |OpenBSD 6.6  |
- |   12.1   macOS|||
- | |   10.15.1   ||DragonFly 5.6.2
- | |  |  *--NetBSD||
- | v  |  |   9.0  ||
- ||  |||
- ||  ||DragonFly 5.8
- ||  |||
- ||  ||DragonFly 5.6.3
+ | |  |   |  |   |||
+ | |  |   |  |   ||DragonFly 5.6.1
+ | |   FreeBSD  macOS|   |||
+ | | 11.3   10.15|   |||
+ |  FreeBSD   |  |   |OpenBSD 6.6  |
+ |   12.1   macOS|   `---.||
+ | |   10.15.1   |   ||DragonFly 5.6.2
+ | |  |  *--NetBSD   |||
+ | v  |  |   9.0 |||
+ ||  |   |||
+ ||  |   ||DragonFly 5.8
+ ||  |   |||
+ ||  |   ||DragonFly 5.6.3
+ ||  |NetBSD  ||
+ ||  | 8.2||
  ||  |||
 FreeBSD 13 -current   |  NetBSD -current   OpenBSD -currentDragonFly -current
  ||  |||
@@ -806,6 +808,7 @@ FreeBSD 12.1		2019-11-04 [FBD]
 NetBSD 9.0 		2020-02-14 [NBD]
 DragonFly 5.8 		2020-03-03 [DFB]
 DragonFly 5.6.3 	2020-03-11 [DFB]
+NetBSD 8.2 		2020-03-31 [NBD]
 
 Bibliography
 
@@ -870,5 +873,5 @@ Steven M. Schultz for providing 2.8BSD, 
 Copyright (c) 1997-2012 Wolfram Schneider 
 URL: https://svnweb.freebsd.org/base/head/share/misc/bsd-family-tree
 
-$FreeBSD: head/share/misc/bsd-family-tree 359157 2020-03-20 03:15:23Z sevan $
-$NetBSD: bsd-family-tree,v 1.80 2020/03/20 03:19:43 sevan Exp $
+$FreeBSD: head/share/misc/bsd-family-tree 359561 2020-04-02 11:08:19Z sevan $
+$NetBSD: bsd-family-tree,v 1.81 2020/04/02 11:09:24 sevan Exp $



CVS commit: src/usr.bin/kdump

2020-04-02 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Thu Apr  2 08:38:22 UTC 2020

Modified Files:
src/usr.bin/kdump: ioctlprint.1

Log Message:
Remove superfluous Pp. Add comma in enumeration. Add RCS Id.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/usr.bin/kdump/ioctlprint.1

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/kdump/ioctlprint.1
diff -u src/usr.bin/kdump/ioctlprint.1:1.1 src/usr.bin/kdump/ioctlprint.1:1.2
--- src/usr.bin/kdump/ioctlprint.1:1.1	Thu Apr  2 03:32:46 2020
+++ src/usr.bin/kdump/ioctlprint.1	Thu Apr  2 08:38:22 2020
@@ -1,3 +1,4 @@
+.\" $NetBSD: ioctlprint.1,v 1.2 2020/04/02 08:38:22 wiz Exp $
 .\"
 .\" Copyright (c) 2020 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -40,7 +41,8 @@
 .Sh DESCRIPTION
 The
 .Nm
-utility displays information about the file ioctl operation pointed to by one or more
+utility displays information about the file ioctl operation pointed
+to by one or more
 .Ar arg
 arguments.
 .Pp
@@ -54,7 +56,7 @@ default "netbsd".
 The argument is a
 .Xr printf 3
 style format string that allows customization of
-.Nm ioctlprint Ns 's
+.Nm ioctlprint Ap s
 output.
 .Pp
 The following conversion characters can be used:
@@ -76,9 +78,8 @@ The default format is:
 "%n %e %x\\n"
 .Ed
 .El
-.Pp
 .Sh SEE ALSO
-.Xr kdump 1
+.Xr kdump 1 ,
 .Xr ktrace 1
 .Sh HISTORY
 The



CVS commit: src/usr.bin/kdump

2020-04-02 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Thu Apr  2 08:35:12 UTC 2020

Modified Files:
src/usr.bin/kdump: kdump.1

Log Message:
Add comma in enumeration.


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/usr.bin/kdump/kdump.1

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/kdump/kdump.1
diff -u src/usr.bin/kdump/kdump.1:1.29 src/usr.bin/kdump/kdump.1:1.30
--- src/usr.bin/kdump/kdump.1:1.29	Thu Apr  2 03:35:48 2020
+++ src/usr.bin/kdump/kdump.1	Thu Apr  2 08:35:12 2020
@@ -1,4 +1,4 @@
-.\"	$NetBSD: kdump.1,v 1.29 2020/04/02 03:35:48 kamil Exp $
+.\"	$NetBSD: kdump.1,v 1.30 2020/04/02 08:35:12 wiz Exp $
 .\"
 .\" Copyright (c) 1990, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -118,7 +118,7 @@ bytes.
 Supported values are 1, 2, 4, 8, and 16.
 .El
 .Sh SEE ALSO
-.Xr ioctlprint 1
+.Xr ioctlprint 1 ,
 .Xr ktrace 1
 .Sh HISTORY
 The



CVS commit: src/sys/dev/ic

2020-04-02 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu Apr  2 07:26:45 UTC 2020

Modified Files:
src/sys/dev/ic: dm9000.c

Log Message:
Fix evmips CI20 build


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/sys/dev/ic/dm9000.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/ic/dm9000.c
diff -u src/sys/dev/ic/dm9000.c:1.26 src/sys/dev/ic/dm9000.c:1.27
--- src/sys/dev/ic/dm9000.c:1.26	Tue Mar 31 07:50:42 2020
+++ src/sys/dev/ic/dm9000.c	Thu Apr  2 07:26:45 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: dm9000.c,v 1.26 2020/03/31 07:50:42 nisimura Exp $	*/
+/*	$NetBSD: dm9000.c,v 1.27 2020/04/02 07:26:45 skrll Exp $	*/
 
 /*
  * Copyright (c) 2009 Paul Fleischer
@@ -477,14 +477,13 @@ mii_statchg(struct ifnet *ifp)
 {
 	struct dme_softc *sc = ifp->if_softc;
 	struct mii_data *mii = >sc_mii;
-	uint8_t nsr, fcr, ncr;
-	const uint8_t Mbps[2] = { 10, 100 };
-	int spd;
+	uint8_t fcr, ncr;
 
-	nsr = dme_read(sc, DM9000_NSR);
-	spd = Mbps[!!(nsr & DM9000_NSR_SPEED)];
-	/* speed/duplexity available also in reg 0x11 of internal PHY */
 #if 0
+	const uint8_t Mbps[2] = { 10, 100 };
+	uint8_t nsr = dme_read(sc, DM9000_NSR);
+	int spd = Mbps[!!(nsr & DM9000_NSR_SPEED)];
+	/* speed/duplexity available also in reg 0x11 of internal PHY */
 	if (nsr & DM9000_NSR_LINKST)
 		printf("link up,spd%d", spd);
 	else