CVS commit: src/sys/dev/i2c

2019-07-23 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Wed Jul 24 05:47:40 UTC 2019

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

Log Message:
I was a little over-zealous with the includes.  Tone it down just
a wee bit.


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

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

Modified files:

Index: src/sys/dev/i2c/pca9685.c
diff -u src/sys/dev/i2c/pca9685.c:1.1 src/sys/dev/i2c/pca9685.c:1.2
--- src/sys/dev/i2c/pca9685.c:1.1	Wed Jul 24 05:25:32 2019
+++ src/sys/dev/i2c/pca9685.c	Wed Jul 24 05:47:39 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: pca9685.c,v 1.1 2019/07/24 05:25:32 thorpej Exp $ */
+/* $NetBSD: pca9685.c,v 1.2 2019/07/24 05:47:39 thorpej Exp $ */
 
 /*-
  * Copyright (c) 2018, 2019 Jason R. Thorpe
@@ -27,18 +27,13 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pca9685.c,v 1.1 2019/07/24 05:25:32 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pca9685.c,v 1.2 2019/07/24 05:47:39 thorpej Exp $");
 
 #include 
 #include 
 #include 
-#include 
-#include 
 #include 
-#include 
 #include 
-#include 
-#include 
 
 #include 
 #include 



CVS commit: src/sys/dev/i2c

2019-07-23 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Wed Jul 24 05:47:40 UTC 2019

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

Log Message:
I was a little over-zealous with the includes.  Tone it down just
a wee bit.


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

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



CVS commit: src/sys/dev/sdmmc

2019-07-23 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Jul 24 05:45:42 UTC 2019

Modified Files:
src/sys/dev/sdmmc: sdmmc_ioreg.h

Log Message:
 Define SD_ARG_CMD52_WRITE macro correctly. Found by KUBSan. This macro is
used in sdmmc_io_write_1() and sdmmc_io_reset.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/sdmmc/sdmmc_ioreg.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/sdmmc/sdmmc_ioreg.h
diff -u src/sys/dev/sdmmc/sdmmc_ioreg.h:1.2 src/sys/dev/sdmmc/sdmmc_ioreg.h:1.3
--- src/sys/dev/sdmmc/sdmmc_ioreg.h:1.2	Thu Oct  7 12:40:34 2010
+++ src/sys/dev/sdmmc/sdmmc_ioreg.h	Wed Jul 24 05:45:42 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: sdmmc_ioreg.h,v 1.2 2010/10/07 12:40:34 kiyohara Exp $	*/
+/*	$NetBSD: sdmmc_ioreg.h,v 1.3 2019/07/24 05:45:42 msaitoh Exp $	*/
 /*	$OpenBSD: sdmmc_ioreg.h,v 1.4 2007/06/02 01:48:37 uwe Exp $	*/
 
 /*
@@ -27,7 +27,7 @@
 
 /* CMD52 arguments */
 #define SD_ARG_CMD52_READ		(0<<31)
-#define SD_ARG_CMD52_WRITE		(1<<31)
+#define SD_ARG_CMD52_WRITE		(1UL<<31)
 #define SD_ARG_CMD52_FUNC_SHIFT		28
 #define SD_ARG_CMD52_FUNC_MASK		0x7
 #define SD_ARG_CMD52_EXCHANGE		(1<<27)



CVS commit: src/sys/dev/sdmmc

2019-07-23 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Jul 24 05:45:42 UTC 2019

Modified Files:
src/sys/dev/sdmmc: sdmmc_ioreg.h

Log Message:
 Define SD_ARG_CMD52_WRITE macro correctly. Found by KUBSan. This macro is
used in sdmmc_io_write_1() and sdmmc_io_reset.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/sdmmc/sdmmc_ioreg.h

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



CVS commit: src/sys/dev/i2c

2019-07-23 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Wed Jul 24 05:25:32 UTC 2019

Modified Files:
src/sys/dev/i2c: files.i2c
Added Files:
src/sys/dev/i2c: pca9685.c pca9685reg.h

Log Message:
Add a driver for the NXP PCA9685 16-channel, 12-bit PWM Fm+ LED controller.


To generate a diff of this commit:
cvs rdiff -u -r1.99 -r1.100 src/sys/dev/i2c/files.i2c
cvs rdiff -u -r0 -r1.1 src/sys/dev/i2c/pca9685.c src/sys/dev/i2c/pca9685reg.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/i2c/files.i2c
diff -u src/sys/dev/i2c/files.i2c:1.99 src/sys/dev/i2c/files.i2c:1.100
--- src/sys/dev/i2c/files.i2c:1.99	Sun Mar 17 01:03:47 2019
+++ src/sys/dev/i2c/files.i2c	Wed Jul 24 05:25:32 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: files.i2c,v 1.99 2019/03/17 01:03:47 tnn Exp $
+#	$NetBSD: files.i2c,v 1.100 2019/07/24 05:25:32 thorpej Exp $
 
 obsolete defflag	opt_i2cbus.h		I2C_SCAN
 define	i2cbus { }
@@ -366,3 +366,8 @@ file	dev/i2c/ssdfb_i2c.c			ssdfb_iic
 device	anxedp: edid, videomode, drmkms, drmkms_i2c
 attach	anxedp at iic
 file	dev/i2c/anxedp.c			anxedp
+
+# NXP PCA9685 16-channel, 12-bit PWM Fm+ LED controller
+device	pcapwm: pwm
+attach	pcapwm at iic
+file	dev/i2c/pca9685.c			pcapwm

Added files:

Index: src/sys/dev/i2c/pca9685.c
diff -u /dev/null src/sys/dev/i2c/pca9685.c:1.1
--- /dev/null	Wed Jul 24 05:25:32 2019
+++ src/sys/dev/i2c/pca9685.c	Wed Jul 24 05:25:32 2019
@@ -0,0 +1,565 @@
+/* $NetBSD: pca9685.c,v 1.1 2019/07/24 05:25:32 thorpej Exp $ */
+
+/*-
+ * Copyright (c) 2018, 2019 Jason R. Thorpe
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include 
+__KERNEL_RCSID(0, "$NetBSD: pca9685.c,v 1.1 2019/07/24 05:25:32 thorpej Exp $");
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+#include 
+
+#include 
+
+/*
+ * Special channel number used to indicate that we want to set the
+ * pulse mode for all channels on this controller.
+ */
+#define	PCA9685_ALL_CHANNELS	PCA9685_NCHANNELS
+
+struct pcapwm_channel {
+	struct pwm_controller	ch_controller;
+	struct pwm_config	ch_conf;
+	u_int			ch_number;
+};
+
+struct pcapwm_softc {
+	device_t	sc_dev;
+	i2c_tag_t	sc_i2c;
+	i2c_addr_t	sc_addr;
+	int		sc_i2c_flags;
+
+	/*
+	 * Locking order is:
+	 *	pcapwm mutex -> i2c bus
+	 */
+	kmutex_t	sc_lock;
+
+	/*
+	 * The PCA9685 only has a single pre-scaler, so the configured
+	 * PWM frequency / period is shared by all channels.
+	 */
+	u_int		sc_period;	/* nanoseconds */
+	u_int		sc_clk_freq;
+	bool		sc_ext_clk;
+	bool		sc_invert;	/* "invert" property specified */
+	bool		sc_open_drain;	/* "open-drain" property specified */
+
+	/*
+	 * +1 because we treat channel "16" as the all-channels
+	 * pseudo-channel.
+	 */
+	struct pcapwm_channel sc_channels[PCA9685_NCHANNELS+1];
+};
+
+static int	pcapwm_pwm_enable(struct pwm_controller *, bool);
+static int	pcapwm_pwm_get_config(struct pwm_controller *,
+		struct pwm_config *);
+static int	pcapwm_pwm_set_config(struct pwm_controller *,
+		const struct pwm_config *);
+
+static const struct device_compatible_entry compat_data[] = {
+	{ "nxp,pca9685-pwm",	0 },
+	{ NULL }
+};
+
+static int
+pcapwm_read1(struct pcapwm_softc * const sc, uint8_t reg, uint8_t *valp)
+{
+
+	return iic_exec(sc->sc_i2c, I2C_OP_READ_WITH_STOP,
+			sc->sc_addr, , sizeof(reg),
+			valp, sizeof(*valp), cold ? I2C_F_POLL : 0);
+}
+
+static int
+pcapwm_write1(struct pcapwm_softc * const sc, uint8_t reg, uint8_t val)
+{
+
+	return iic_exec(sc->sc_i2c, I2C_OP_WRITE_WITH_STOP,
+			sc->sc_addr, , sizeof(reg),
+			, 

CVS commit: src/sys/dev/i2c

2019-07-23 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Wed Jul 24 05:25:32 UTC 2019

Modified Files:
src/sys/dev/i2c: files.i2c
Added Files:
src/sys/dev/i2c: pca9685.c pca9685reg.h

Log Message:
Add a driver for the NXP PCA9685 16-channel, 12-bit PWM Fm+ LED controller.


To generate a diff of this commit:
cvs rdiff -u -r1.99 -r1.100 src/sys/dev/i2c/files.i2c
cvs rdiff -u -r0 -r1.1 src/sys/dev/i2c/pca9685.c src/sys/dev/i2c/pca9685reg.h

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



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

2019-07-23 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Jul 24 04:58:26 UTC 2019

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

Log Message:
Add avx512ifma, cqm_mbm_total, cqm_mbm_local and waitpkg


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/sys/arch/x86/x86/procfs_machdep.c

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

Modified files:

Index: src/sys/arch/x86/x86/procfs_machdep.c
diff -u src/sys/arch/x86/x86/procfs_machdep.c:1.32 src/sys/arch/x86/x86/procfs_machdep.c:1.33
--- src/sys/arch/x86/x86/procfs_machdep.c:1.32	Tue May 28 16:43:24 2019
+++ src/sys/arch/x86/x86/procfs_machdep.c	Wed Jul 24 04:58:26 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: procfs_machdep.c,v 1.32 2019/05/28 16:43:24 kamil Exp $ */
+/*	$NetBSD: procfs_machdep.c,v 1.33 2019/07/24 04:58:26 msaitoh Exp $ */
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -42,7 +42,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: procfs_machdep.c,v 1.32 2019/05/28 16:43:24 kamil Exp $");
+__KERNEL_RCSID(0, "$NetBSD: procfs_machdep.c,v 1.33 2019/07/24 04:58:26 msaitoh Exp $");
 
 #include 
 #include 
@@ -129,7 +129,7 @@ static const char * const x86_features[]
 	"fsgsbase", "tsc_adjust", NULL, "bmi1", "hle", "avx2", NULL, "smep",
 	"bmi2", "erms", "invpcid", "rtm", "cqm", NULL, "mpx", "rdt_a",
 	"avx512f", "avx512dq", "rdseed", "adx",
-	"smap", NULL, NULL, "clflushopt",
+	"smap", "avx512ifma", NULL, "clflushopt",
 	"clwb", "intel_pt", "avx512pf", "avx512er",
 	"avx512cd", "sha_ni", "avx512bw", "avx512vl"},
 
@@ -146,7 +146,8 @@ static const char * const x86_features[]
 	NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL},
 
 	{ /* (12) 0x000f:1 edx */
-	"cqm_occup_llc", NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+	"cqm_occup_llc", "cqm_mbm_total", "cqm_mbm_local", NULL,
+	NULL, NULL, NULL, NULL,
 	NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 	NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 	NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL},
@@ -174,7 +175,7 @@ static const char * const x86_features[]
 
 	{ /* (16) 0x0007:0 ecx */
 	NULL, "avx512vbmi", "umip", "pku",
-	"ospke", NULL, "avx512_vbmi2", NULL,
+	"ospke", "waitpkg", "avx512_vbmi2", NULL,
 	"gfni", "vaes", "vpclmulqdq", "avx512_vnni",
 	"avx512_bitalg", "tme", "avx512_vpopcntdq", NULL,
 	"la57", NULL, NULL, NULL, NULL, NULL, "rdpid", NULL,



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

2019-07-23 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Jul 24 04:58:26 UTC 2019

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

Log Message:
Add avx512ifma, cqm_mbm_total, cqm_mbm_local and waitpkg


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/sys/arch/x86/x86/procfs_machdep.c

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



CVS commit: src

2019-07-23 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Jul 24 02:38:29 UTC 2019

Modified Files:
src/sys/netinet6: ip6_mroute.c
src/usr.sbin/sysinst: disks.c

Log Message:
 Fix typo in comment (s/alreay/already/).


To generate a diff of this commit:
cvs rdiff -u -r1.129 -r1.130 src/sys/netinet6/ip6_mroute.c
cvs rdiff -u -r1.41 -r1.42 src/usr.sbin/sysinst/disks.c

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



CVS commit: src

2019-07-23 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Jul 24 02:37:17 UTC 2019

Modified Files:
src/etc/defaults: rc.conf
src/usr.sbin/sysinst: disks.c partitions.h

Log Message:
Fix typo in comment (s/partion/partition/).


To generate a diff of this commit:
cvs rdiff -u -r1.150 -r1.151 src/etc/defaults/rc.conf
cvs rdiff -u -r1.40 -r1.41 src/usr.sbin/sysinst/disks.c
cvs rdiff -u -r1.2 -r1.3 src/usr.sbin/sysinst/partitions.h

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.150 src/etc/defaults/rc.conf:1.151
--- src/etc/defaults/rc.conf:1.150	Sun May 12 01:45:25 2019
+++ src/etc/defaults/rc.conf	Wed Jul 24 02:37:17 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: rc.conf,v 1.150 2019/05/12 01:45:25 kre Exp $
+#	$NetBSD: rc.conf,v 1.151 2019/07/24 02:37:17 msaitoh Exp $
 #
 # /etc/defaults/rc.conf --
 #	default configuration of /etc/rc.conf
@@ -126,7 +126,7 @@ lvm=NO
 #
 savecore=YES		savecore_flags="-z"
 			savecore_dir="/var/crash"
-resize_disklabel=NO# resize partion to fill disk
+resize_disklabel=NO# resize partition to fill disk
 resize_root=NO	# resize root to fill partition
 per_user_tmp=NO	# per-user /tmp directories
 per_user_tmp_dir="/private/tmp"			# real storage for /tmp

Index: src/usr.sbin/sysinst/disks.c
diff -u src/usr.sbin/sysinst/disks.c:1.40 src/usr.sbin/sysinst/disks.c:1.41
--- src/usr.sbin/sysinst/disks.c:1.40	Tue Jul 23 18:13:40 2019
+++ src/usr.sbin/sysinst/disks.c	Wed Jul 24 02:37:17 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: disks.c,v 1.40 2019/07/23 18:13:40 martin Exp $ */
+/*	$NetBSD: disks.c,v 1.41 2019/07/24 02:37:17 msaitoh Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -518,7 +518,7 @@ bool
 is_partitionable_device(const char *dev)
 {
 	static const char *non_partitionable_devs[] = {
-		"dk",	/* this is alreay a partioned slice */
+		"dk",	/* this is alreay a partitioned slice */
 		NULL
 	};
 

Index: src/usr.sbin/sysinst/partitions.h
diff -u src/usr.sbin/sysinst/partitions.h:1.2 src/usr.sbin/sysinst/partitions.h:1.3
--- src/usr.sbin/sysinst/partitions.h:1.2	Sat Jun 15 08:20:33 2019
+++ src/usr.sbin/sysinst/partitions.h	Wed Jul 24 02:37:17 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: partitions.h,v 1.2 2019/06/15 08:20:33 martin Exp $	*/
+/*	$NetBSD: partitions.h,v 1.3 2019/07/24 02:37:17 msaitoh Exp $	*/
 
 /*
  * Copyright 2018 The NetBSD Foundation, Inc.
@@ -52,7 +52,7 @@
 #define	FS_MFS		257	/* another random (out of range) value */
 #endif
 
-#define	MAX_LABEL_LEN		128	/* max. length of a partion label */
+#define	MAX_LABEL_LEN		128	/* max. length of a partition label */
 #define	MAX_SHORTCUT_LEN	8	/* max. lenght of a shortcut ("a:") */
 
 /*



CVS commit: src

2019-07-23 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Jul 24 02:37:17 UTC 2019

Modified Files:
src/etc/defaults: rc.conf
src/usr.sbin/sysinst: disks.c partitions.h

Log Message:
Fix typo in comment (s/partion/partition/).


To generate a diff of this commit:
cvs rdiff -u -r1.150 -r1.151 src/etc/defaults/rc.conf
cvs rdiff -u -r1.40 -r1.41 src/usr.sbin/sysinst/disks.c
cvs rdiff -u -r1.2 -r1.3 src/usr.sbin/sysinst/partitions.h

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



CVS commit: src/sys/dev/pci

2019-07-23 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Jul 24 02:24:52 UTC 2019

Modified Files:
src/sys/dev/pci: pcidevs.h pcidevs_data.h

Log Message:
Regen.


To generate a diff of this commit:
cvs rdiff -u -r1.1369 -r1.1370 src/sys/dev/pci/pcidevs.h
cvs rdiff -u -r1.1368 -r1.1369 src/sys/dev/pci/pcidevs_data.h

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



CVS commit: src/sys/dev/pci

2019-07-23 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Jul 24 02:24:52 UTC 2019

Modified Files:
src/sys/dev/pci: pcidevs.h pcidevs_data.h

Log Message:
Regen.


To generate a diff of this commit:
cvs rdiff -u -r1.1369 -r1.1370 src/sys/dev/pci/pcidevs.h
cvs rdiff -u -r1.1368 -r1.1369 src/sys/dev/pci/pcidevs_data.h

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

diffs are larger than 1MB and have been omitted


CVS commit: src/sys/dev/pci

2019-07-23 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Jul 24 02:23:32 UTC 2019

Modified Files:
src/sys/dev/pci: pcidevs

Log Message:
- Add some AMD devices mainly taken from OpenBSD.
- Rename some device names for consistency.
- Use _HDA for HD Audio.


To generate a diff of this commit:
cvs rdiff -u -r1.1381 -r1.1382 src/sys/dev/pci/pcidevs

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/pcidevs
diff -u src/sys/dev/pci/pcidevs:1.1381 src/sys/dev/pci/pcidevs:1.1382
--- src/sys/dev/pci/pcidevs:1.1381	Thu Jul 18 08:50:50 2019
+++ src/sys/dev/pci/pcidevs	Wed Jul 24 02:23:31 2019
@@ -1,4 +1,4 @@
-$NetBSD: pcidevs,v 1.1381 2019/07/18 08:50:50 msaitoh Exp $
+$NetBSD: pcidevs,v 1.1382 2019/07/24 02:23:31 msaitoh Exp $
 
 /*
  * Copyright (c) 1995, 1996 Christopher G. Demetriou
@@ -1009,6 +1009,7 @@ product AMD F17_IOMMU	0x1451	Family17h I
 product AMD F17_PCIE_1	0x1452	Family17h PCIE
 product AMD F17_PCIE_2	0x1453	Family17h PCIE
 product AMD F17_PCIE_3	0x1454	Family17h PCIE
+product AMD F17_CCP_1	0x1456	Family17h Crypto
 product AMD F17_HDA	0x1457	Family17h HD Audio
 product AMD F17_XHCI	0x145c	Family17h xHCI
 product AMD F17_XHCI_2	0x145f	Family17h xHCI
@@ -1032,7 +1033,7 @@ product AMD F16_NB	0x1533	Family16h Nort
 product AMD F16_CSTATE	0x1534	Family16h CPU C-state Configuration
 product AMD F16_MISC	0x1535	Family16h Miscellaneous Configuration
 product AMD F16_RC	0x1536	Family16h Root Complex
-product AMD CRYPTO_COP	0x1537	Cryptographic Coprocessor
+product AMD F16_CCP	0x1537	Family16h Cryptographic Coprocessor
 product AMD F16_30_RC	0x1566	Family16h Root Complex
 product AMD F16_30_IOMMU	0x1567	Family16h IOMMU
 product AMD F16_HB	0x1568	Family16h Host Bridge
@@ -1110,6 +,13 @@ product AMD HUDSON_PCIE_0	0x43a0	Hudson 
 product AMD HUDSON_PCIE_1	0x43a1	Hudson PCIE Root Port 1
 product AMD HUDSON_PCIE_2	0x43a2	Hudson PCIE Root Port 2
 product AMD HUDSON_PCIE_3	0x43a3	Hudson PCIE Root Port 3
+product AMD 300SERIES_PCIE	0x43b4	300 Series PCIe
+product AMD 300SERIES_SATA	0x43b7	300 Series SATA
+product AMD 300SERIES_XHCI	0x43bb	300 Series xHCI
+product AMD 400SERIES_PCIE_1	0x43c6	400 Series PCIe
+product AMD 400SERIES_PCIE_2	0x43c7	400 Series PCIe
+product AMD 400SERIES_AHCI	0x43c8	400 Series AHCI
+product AMD 400SERIES_XHCI	0x43d0	400 Series xHCI
 product AMD SC751_SC	0x7006	AMD751 System Controller
 product AMD SC751_PPB	0x7007	AMD751 PCI-PCI Bridge
 product AMD IGR4_AGP	0x700a	AMD IGR4 AGP Bridge
@@ -1154,21 +1162,33 @@ product AMD PBC8111_ACPI	0x746b	AMD8111 
 product AMD PBC8111_AC		0x746d	AMD8111 AC97 Audio
 product AMD PBC8111_MC97	0x746e	AMD8111 MC97 Modem
 product AMD PBC8111_AC_756b	0x756b	AMD8111 756b ACPI Controller
-product AMD HUDSON_SATA		0x7800	Hudson SATA Controller
-product AMD HUDSON_SATA_AHCI	0x7801	Hudson AHCI SATA Controller
+product AMD HUDSON_SATA		0x7800	Hudson SATA (IDE) Controller
+product AMD HUDSON_SATA_AHCI	0x7801	Hudson SATA (AHCI) Controller
+product AMD HUDSON_SATA_RAID	0x7802	Hudson SATA (RAID) Controller
+product AMD HUDSON_SATA_RAID5	0x7803	Hudson SATA (RAID5) Controller
+product AMD HUDSON_SATA_AHCI_2	0x7804	Hudson SATA (AMD AHCI) Controller
+product AMD HUDSON_SATA_RAID_2	0x7805	Hudson SATA (RAID) Controller
 product AMD HUDSON_SDHC		0x7806	Hudson SD Flash Controller
 product AMD HUDSON_OHCI		0x7807	Hudson USB OHCI Controller
 product AMD HUDSON_EHCI		0x7808	Hudson USB EHCI Controller
 product AMD HUDSON_OHCI_2	0x7809	Hudson USB OHCI Controller
 product AMD HUDSON_SMB		0x780b	Hudson SMBus Controller
 product AMD HUDSON_IDE		0x780c	Hudson IDE Controller
-product AMD HUDSON_HDAUDIO	0x780d	Hudson HD Audio Controller
+product AMD HUDSON_HDA		0x780d	Hudson HD Audio Controller
 product AMD HUDSON_LPC		0x780e	Hudson LPC Bridge
 product AMD HUDSON_PCI		0x780f	Hudson PCI Bridge
 product AMD HUDSON_XHCI		0x7812	Hudson USB xHCI Controller
 product AMD FCH_SDHC		0x7813	FCH SD Flash Controller
 product AMD FCH_XHCI		0x7814	FCH USB xHCI Controller
+product AMD KERNCZ_SATA_1	0x7900	FCH SATA
+product AMD KERNCZ_AHCI_1	0x7901	FCH AHCI
+product AMD KERNCZ_RAID_1	0x7902	FCH RAID
+product AMD KERNCZ_RAID_2	0x7903	FCH RAID
+product AMD KERNCZ_AHCI_2	0x7904	FCH AHCI
+product AMD KERNCZ_EHCI		0x7908	FCH USB2
 product AMD KERNCZ_SMB		0x790b	X370/X399 SMBus Controller
+product AMD KERNCZ_LPC		0x790e	FCH LPC
+product AMD KERNCZ_XHCI		0x7914	FCH xHCI
 product AMD RS780_HB		0x9600	RS780 Host Bridge
 product AMD RS880_HB		0x9601	RS785/RS880 Host Bridge
 product AMD RS780_PPB_GFX	0x9602	RS780/RS880 PCI-PCI Bridge (int gfx)
@@ -1757,7 +1777,7 @@ product ATI RADEON_R9_285_HDA	0xaad8	Rad
 product ATI RADEON_RX_460_HDA	0xaae0	Radeon RX 460/550/640SP, RX 560/560X HD Audio Controller
 product ATI RADEON_RX_550_HDA	0xaae8	Radeon R9 Nano, FURY HD Audio Controller
 product ATI RADEON_RX_470_HDA	0xaaf0	Radeon RX 470/480/570/580/590 HD Audio Controller
-product ATI RADEON_VEGA56_HDA	0xaaf8	

CVS commit: src/sys/dev/pci

2019-07-23 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Jul 24 02:23:32 UTC 2019

Modified Files:
src/sys/dev/pci: pcidevs

Log Message:
- Add some AMD devices mainly taken from OpenBSD.
- Rename some device names for consistency.
- Use _HDA for HD Audio.


To generate a diff of this commit:
cvs rdiff -u -r1.1381 -r1.1382 src/sys/dev/pci/pcidevs

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



Re: CVS commit: src

2019-07-23 Thread Roy Marples

On 23/07/2019 21:29, Greg Troxel wrote:

Thomas Klausner  writes:


P.S.: The file is 44k, so I'm not convinced by the "/ is small"
argument. ;)


100 * 44k is 4400k :-)   The / and /usr distinction is longstanding, I
don't think we should give up on it easily.


I concur with Greg.
We should strive to keep / as small as possible.

Roy


Re: CVS commit: src

2019-07-23 Thread Greg Troxel
Thomas Klausner  writes:

> P.S.: The file is 44k, so I'm not convinced by the "/ is small"
> argument. ;)

100 * 44k is 4400k :-)   The / and /usr distinction is longstanding, I
don't think we should give up on it easily.


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

2019-07-23 Thread Sevan Janiyan
Module Name:src
Committed By:   sevan
Date:   Tue Jul 23 18:28:59 UTC 2019

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

Log Message:
Add bicycle day


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/usr.bin/calendar/calendars/calendar.history

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.history
diff -u src/usr.bin/calendar/calendars/calendar.history:1.35 src/usr.bin/calendar/calendars/calendar.history:1.36
--- src/usr.bin/calendar/calendars/calendar.history:1.35	Sat Dec  2 18:07:34 2017
+++ src/usr.bin/calendar/calendars/calendar.history	Tue Jul 23 18:28:59 2019
@@ -236,6 +236,8 @@
 04/15	Ray Kroc opens first McDonalds in Des Plaines, IL, 1955
 04/18	First Laundromat opens, Fort Worth Texas, 1934
 04/18	San Francisco earthquake, 1906
+04/19	Bicycle day, Albert Hofmann rides home after ingesting 0.25 milligrams
+	of LSD, 1943
 04/19	Warsaw Ghetto uprising, 1943
 04/23	Hank Aaron hits his first home run, 1954
 04/26	William Shakespeare baptised in Stratford-on-Avon, England, 1564,



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

2019-07-23 Thread Sevan Janiyan
Module Name:src
Committed By:   sevan
Date:   Tue Jul 23 18:28:59 UTC 2019

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

Log Message:
Add bicycle day


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/usr.bin/calendar/calendars/calendar.history

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



CVS commit: src/usr.sbin/sysinst

2019-07-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Jul 23 18:13:40 UTC 2019

Modified Files:
src/usr.sbin/sysinst: configmenu.c defs.h disks.c install.c msg.mi.de
msg.mi.en msg.mi.es msg.mi.fr msg.mi.pl partman.c target.c
upgrade.c

Log Message:
For upgrade / re-install allow the currently running system as a target
in the "disk" selection.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/usr.sbin/sysinst/configmenu.c
cvs rdiff -u -r1.40 -r1.41 src/usr.sbin/sysinst/defs.h
cvs rdiff -u -r1.39 -r1.40 src/usr.sbin/sysinst/disks.c \
src/usr.sbin/sysinst/partman.c
cvs rdiff -u -r1.8 -r1.9 src/usr.sbin/sysinst/install.c
cvs rdiff -u -r1.12 -r1.13 src/usr.sbin/sysinst/msg.mi.de
cvs rdiff -u -r1.18 -r1.19 src/usr.sbin/sysinst/msg.mi.en
cvs rdiff -u -r1.13 -r1.14 src/usr.sbin/sysinst/msg.mi.es
cvs rdiff -u -r1.16 -r1.17 src/usr.sbin/sysinst/msg.mi.fr
cvs rdiff -u -r1.19 -r1.20 src/usr.sbin/sysinst/msg.mi.pl
cvs rdiff -u -r1.7 -r1.8 src/usr.sbin/sysinst/target.c
cvs rdiff -u -r1.11 -r1.12 src/usr.sbin/sysinst/upgrade.c

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

Modified files:

Index: src/usr.sbin/sysinst/configmenu.c
diff -u src/usr.sbin/sysinst/configmenu.c:1.9 src/usr.sbin/sysinst/configmenu.c:1.10
--- src/usr.sbin/sysinst/configmenu.c:1.9	Sat Jun 22 20:46:07 2019
+++ src/usr.sbin/sysinst/configmenu.c	Tue Jul 23 18:13:40 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: configmenu.c,v 1.9 2019/06/22 20:46:07 christos Exp $ */
+/* $NetBSD: configmenu.c,v 1.10 2019/07/23 18:13:40 martin Exp $ */
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -446,7 +446,7 @@ do_configmenu(struct install_partition_d
 	/* if the target isn't mounted already, figure it out. */
 	if (install != NULL && target_mounted() == 0) {
 		partman_go = 0;
-		if (find_disks(msg_string(MSG_configure_prior)) < 0)
+		if (find_disks(msg_string(MSG_configure_prior), true) < 0)
 			return;
 
 		if (mount_disks(install) != 0)

Index: src/usr.sbin/sysinst/defs.h
diff -u src/usr.sbin/sysinst/defs.h:1.40 src/usr.sbin/sysinst/defs.h:1.41
--- src/usr.sbin/sysinst/defs.h:1.40	Tue Jul 23 16:02:32 2019
+++ src/usr.sbin/sysinst/defs.h	Tue Jul 23 18:13:40 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: defs.h,v 1.40 2019/07/23 16:02:32 martin Exp $	*/
+/*	$NetBSD: defs.h,v 1.41 2019/07/23 18:13:40 martin Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -324,6 +324,7 @@ struct single_part_fs_edit {
 struct install_partition_desc {
 	size_t num;/* how many entries in infos */
 	struct part_usage_info *infos;		/* individual partitions */
+	bool cur_system;			/* target is the life system */
 };
 
 /* variables */
@@ -384,6 +385,12 @@ struct pm_devs {
 	 */
 	bool no_part;
 
+	/*
+	 * This is a pseudo-device representing the currently running
+	 * system (i.e. all mounted file systems).
+	 */
+	bool cur_system;
+
 	/* Actual values for current disk - set by find_disks() or
 	   md_get_info() */
 	int sectorsize, dlcyl, dlhead, dlsec, dlcylsize, current_cylsize;
@@ -592,7 +599,7 @@ void	toplevel(void);
 
 /* from disks.c */
 bool	get_default_cdrom(char *, size_t);
-int	find_disks(const char *);
+int	find_disks(const char *, bool);
 bool enumerate_disks(void *state,bool (*func)(void *state, const char *dev));
 bool is_cdrom_device(const char *dev, bool as_target);
 bool is_bootable_device(const char *dev);

Index: src/usr.sbin/sysinst/disks.c
diff -u src/usr.sbin/sysinst/disks.c:1.39 src/usr.sbin/sysinst/disks.c:1.40
--- src/usr.sbin/sysinst/disks.c:1.39	Tue Jul 23 15:23:14 2019
+++ src/usr.sbin/sysinst/disks.c	Tue Jul 23 18:13:40 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: disks.c,v 1.39 2019/07/23 15:23:14 martin Exp $ */
+/*	$NetBSD: disks.c,v 1.40 2019/07/23 18:13:40 martin Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -761,11 +761,32 @@ convert_scheme(struct pm_devs *p, bool i
 	return true;
 }
 
+static struct pm_devs *
+dummy_whole_system_pm(void)
+{
+	static struct pm_devs whole_system = {
+		.diskdev = "/",
+		.no_mbr = true,
+		.no_part = true,
+		.cur_system = true,
+	};
+	static bool init = false;
+
+	if (!init) {
+		strlcpy(whole_system.diskdev_descr,
+		msg_string(MSG_running_system),
+		sizeof whole_system.diskdev_descr);
+	}
+
+	return _system;
+}
+
 int
-find_disks(const char *doingwhat)
+find_disks(const char *doingwhat, bool allow_cur_system)
 {
 	struct disk_desc disks[MAX_DISKS];
-	menu_ent dsk_menu[__arraycount(disks) + 1]; // + 1 for extended partitioning entry
+	/* need two more menu entries: current system + extended partitioning */
+	menu_ent dsk_menu[__arraycount(disks) + 2];
 	struct disk_desc *disk;
 	int i = 0, skipped = 0;
 	int already_found, numdisks, selected_disk = -1;
@@ -790,16 +811,23 @@ find_disks(const char *doingwhat)
 	 *  all disks
 	 */
 	if (partman_go <= 0) {
-		if (numdisks == 0) {
+		if (numdisks == 0 && !allow_cur_system) {
 			/* No disks 

CVS commit: src/share/misc

2019-07-23 Thread Sevan Janiyan
Module Name:src
Committed By:   sevan
Date:   Tue Jul 23 18:13:47 UTC 2019

Modified Files:
src/share/misc: acronyms.comp

Log Message:
REPL


To generate a diff of this commit:
cvs rdiff -u -r1.281 -r1.282 src/share/misc/acronyms.comp

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/acronyms.comp
diff -u src/share/misc/acronyms.comp:1.281 src/share/misc/acronyms.comp:1.282
--- src/share/misc/acronyms.comp:1.281	Sat Jul 20 13:29:36 2019
+++ src/share/misc/acronyms.comp	Tue Jul 23 18:13:47 2019
@@ -1,4 +1,4 @@
-$NetBSD: acronyms.comp,v 1.281 2019/07/20 13:29:36 sevan Exp $
+$NetBSD: acronyms.comp,v 1.282 2019/07/23 18:13:47 sevan Exp $
 3WHS	three-way handshake
 8VSB	8-state vestigial side band modulation
 AA	anti-aliasing
@@ -1283,6 +1283,7 @@ RDM	relational data model
 RDMA	remote direct memory access
 RDRAM	Rambus DRAM
 RE	regular expression
+REPL	read, evaluate, print, loop
 REST	representational state transfer
 RF	radio frequency
 RFI	radio frequency interference



CVS commit: src/share/misc

2019-07-23 Thread Sevan Janiyan
Module Name:src
Committed By:   sevan
Date:   Tue Jul 23 18:13:47 UTC 2019

Modified Files:
src/share/misc: acronyms.comp

Log Message:
REPL


To generate a diff of this commit:
cvs rdiff -u -r1.281 -r1.282 src/share/misc/acronyms.comp

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



CVS commit: src/usr.sbin/sysinst

2019-07-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Jul 23 18:13:40 UTC 2019

Modified Files:
src/usr.sbin/sysinst: configmenu.c defs.h disks.c install.c msg.mi.de
msg.mi.en msg.mi.es msg.mi.fr msg.mi.pl partman.c target.c
upgrade.c

Log Message:
For upgrade / re-install allow the currently running system as a target
in the "disk" selection.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/usr.sbin/sysinst/configmenu.c
cvs rdiff -u -r1.40 -r1.41 src/usr.sbin/sysinst/defs.h
cvs rdiff -u -r1.39 -r1.40 src/usr.sbin/sysinst/disks.c \
src/usr.sbin/sysinst/partman.c
cvs rdiff -u -r1.8 -r1.9 src/usr.sbin/sysinst/install.c
cvs rdiff -u -r1.12 -r1.13 src/usr.sbin/sysinst/msg.mi.de
cvs rdiff -u -r1.18 -r1.19 src/usr.sbin/sysinst/msg.mi.en
cvs rdiff -u -r1.13 -r1.14 src/usr.sbin/sysinst/msg.mi.es
cvs rdiff -u -r1.16 -r1.17 src/usr.sbin/sysinst/msg.mi.fr
cvs rdiff -u -r1.19 -r1.20 src/usr.sbin/sysinst/msg.mi.pl
cvs rdiff -u -r1.7 -r1.8 src/usr.sbin/sysinst/target.c
cvs rdiff -u -r1.11 -r1.12 src/usr.sbin/sysinst/upgrade.c

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



CVS commit: src/sys/dev/clk

2019-07-23 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Tue Jul 23 17:44:03 UTC 2019

Modified Files:
src/sys/dev/clk: clk.c

Log Message:
Normalize clk name to prevent sysctl_createv from failing


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/clk/clk.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/clk/clk.c
diff -u src/sys/dev/clk/clk.c:1.6 src/sys/dev/clk/clk.c:1.7
--- src/sys/dev/clk/clk.c:1.6	Wed Jan 30 01:20:47 2019
+++ src/sys/dev/clk/clk.c	Tue Jul 23 17:44:03 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: clk.c,v 1.6 2019/01/30 01:20:47 jmcneill Exp $ */
+/* $NetBSD: clk.c,v 1.7 2019/07/23 17:44:03 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill 
@@ -27,10 +27,11 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: clk.c,v 1.6 2019/01/30 01:20:47 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: clk.c,v 1.7 2019/07/23 17:44:03 jmcneill Exp $");
 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -135,11 +136,23 @@ clk_sysctl_parent_domain_helper(SYSCTLFN
 	return sysctl_lookup(SYSCTLFN_CALL());
 }
 
+static void
+clk_normalize_name(char *name)
+{
+	unsigned char *p;
+
+	for (p = (unsigned char *)name; *p; p++)
+		if (!isalpha(*p) && !isdigit(*p) && *p != '-' && *p != '_')
+			*p = '_';
+}
+
 int
 clk_attach(struct clk *clk)
 {
 	const struct sysctlnode *node;
 	struct clk_domain *domain = clk->domain;
+	char *name;
+	size_t namelen;
 	int error;
 
 	KASSERT(domain != NULL);
@@ -149,12 +162,17 @@ clk_attach(struct clk *clk)
 		return 0;
 	}
 
+	namelen = strlen(clk->name) + 1;
+	name = kmem_zalloc(namelen, KM_SLEEP);
+	memcpy(name, clk->name, namelen);
+	clk_normalize_name(name);
+
 	error = create_domain_node(domain);
 	if (error != 0)
 		goto sysctl_failed;
 
 	error = sysctl_createv(_log, 0, >node, ,
-	CTLFLAG_PRIVATE, CTLTYPE_NODE, clk->name, NULL,
+	CTLFLAG_PRIVATE, CTLTYPE_NODE, name, NULL,
 	NULL, 0, NULL, 0, CTL_CREATE, CTL_EOL);
 	if (error)
 		goto sysctl_failed;
@@ -182,8 +200,10 @@ clk_attach(struct clk *clk)
 
 sysctl_failed:
 	if (error)
-		aprint_error("%s: failed to create sysctl node for %s: %d\n",
-		domain->name, clk->name, error);
+		aprint_error("%s: failed to create sysctl node for %s (%s): %d\n",
+		domain->name, clk->name, name, error);
+
+	kmem_free(name, namelen);
 	return error;
 }
 



CVS commit: src/sys/dev/clk

2019-07-23 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Tue Jul 23 17:44:03 UTC 2019

Modified Files:
src/sys/dev/clk: clk.c

Log Message:
Normalize clk name to prevent sysctl_createv from failing


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

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



CVS commit: src/sys

2019-07-23 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Tue Jul 23 17:39:36 UTC 2019

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

Log Message:
Enable us to enter DDB from serial console when WSDISPLAY_MULTICONS
is enabled. This is necessary for machines on which framebuffer
console cannot be disabled at run time.

opt_wsdisplay_compat.h is generated for all ports including those
that do not support wscons.

OK Jared


To generate a diff of this commit:
cvs rdiff -u -r1.155 -r1.156 src/sys/dev/wscons/wsdisplay.c
cvs rdiff -u -r1.285 -r1.286 src/sys/sys/systm.h

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



CVS commit: src/sys

2019-07-23 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Tue Jul 23 17:39:36 UTC 2019

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

Log Message:
Enable us to enter DDB from serial console when WSDISPLAY_MULTICONS
is enabled. This is necessary for machines on which framebuffer
console cannot be disabled at run time.

opt_wsdisplay_compat.h is generated for all ports including those
that do not support wscons.

OK Jared


To generate a diff of this commit:
cvs rdiff -u -r1.155 -r1.156 src/sys/dev/wscons/wsdisplay.c
cvs rdiff -u -r1.285 -r1.286 src/sys/sys/systm.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/wscons/wsdisplay.c
diff -u src/sys/dev/wscons/wsdisplay.c:1.155 src/sys/dev/wscons/wsdisplay.c:1.156
--- src/sys/dev/wscons/wsdisplay.c:1.155	Tue Jul 23 15:55:49 2019
+++ src/sys/dev/wscons/wsdisplay.c	Tue Jul 23 17:39:36 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: wsdisplay.c,v 1.155 2019/07/23 15:55:49 jmcneill Exp $ */
+/* $NetBSD: wsdisplay.c,v 1.156 2019/07/23 17:39:36 rin Exp $ */
 
 /*
  * Copyright (c) 1996, 1997 Christopher G. Demetriou.  All rights reserved.
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: wsdisplay.c,v 1.155 2019/07/23 15:55:49 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wsdisplay.c,v 1.156 2019/07/23 17:39:36 rin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_wsdisplay_compat.h"
@@ -277,6 +277,19 @@ static int wsdisplay_dosync(struct wsdis
 int wsdisplay_clearonclose;
 
 #ifdef WSDISPLAY_MULTICONS
+/*
+ * Replace cn_isconsole() so that we can enter DDB from old console.
+ */
+bool
+wsdisplay_cn_isconsole(dev_t dev)
+{
+
+	return (cn_tab != NULL && cn_tab->cn_dev == dev) ||
+	(cn_tab == _cons && !wsdisplay_multicons_suspended &&
+	wsdisplay_multicons_enable && wsdisplay_ocn != NULL &&
+	wsdisplay_ocn->cn_dev == dev);
+}
+
 static void
 wsscreen_getc_poll(void *priv)
 {

Index: src/sys/sys/systm.h
diff -u src/sys/sys/systm.h:1.285 src/sys/sys/systm.h:1.286
--- src/sys/sys/systm.h:1.285	Mon May 20 20:35:45 2019
+++ src/sys/sys/systm.h	Tue Jul 23 17:39:36 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: systm.h,v 1.285 2019/05/20 20:35:45 christos Exp $	*/
+/*	$NetBSD: systm.h,v 1.286 2019/07/23 17:39:36 rin Exp $	*/
 
 /*-
  * Copyright (c) 1982, 1988, 1991, 1993
@@ -44,6 +44,7 @@
 #include "opt_multiprocessor.h"
 #include "opt_gprof.h"
 #include "opt_kleak.h"
+#include "opt_wsdisplay_compat.h"
 #endif
 #if !defined(_KERNEL) && !defined(_STANDALONE)
 #include 
@@ -541,7 +542,12 @@ typedef struct cnm_state {
 #define cn_trap()	console_debugger()
 #endif
 #ifndef cn_isconsole
+#ifndef WSDISPLAY_MULTICONS
 #define cn_isconsole(d)	(cn_tab != NULL && (d) == cn_tab->cn_dev)
+#else
+bool wsdisplay_cn_isconsole(dev_t);
+#define cn_isconsole(d)	wsdisplay_cn_isconsole(d)
+#endif
 #endif
 
 void cn_init_magic(cnm_state_t *);



Re: CVS commit: src

2019-07-23 Thread Jared McNeill
It is not using firmload(9) though, it is a userland implementation of a 
similar API that I wrote specifically for this purpose:


https://nxr.netbsd.org/xref/src/usr.sbin/btattach/firmload.c

Cheers,
Jared


On Tue, 23 Jul 2019, Thomas Klausner wrote:


Hi Jared!

Yes, I saw that. But it's using firmload() as well to load it.

I moved this firmware because it was the only one remaining in that
directory.

I can put it back, if people think that's preferable, or someone else
can revert, I don't mind.

Cheers,
Thomas

P.S.: The file is 44k, so I'm not convinced by the "/ is small"
argument. ;)

On Tue, Jul 23, 2019 at 12:25:16PM -0300, Jared McNeill wrote:

Hi Thomas --

The bcm43xx firmware is different from other firmware images because it is
not loaded by the kernel directly. The tool that loads this image lives in
/usr/sbin, so /usr/libdata/firmware seemed more appropriate. The path
already existed in the list of firmware search paths (sysctl
hw.firmware.path) long before these files were added.

Cheers,
Jared


On Mon, 22 Jul 2019, Thomas Klausner wrote:


Module Name:src
Committed By:   wiz
Date:   Mon Jul 22 14:47:51 UTC 2019

Modified Files:
src/distrib/sets/lists/base: mi
src/etc/mtree: NetBSD.dist.base
src/external/broadcom/bcm43xx: Makefile

Log Message:
Move bcm43xx to /libdata/firmware, where all the other firmwares live.

Deprecate /usr/libdata/firmware.


To generate a diff of this commit:
cvs rdiff -u -r1.1207 -r1.1208 src/distrib/sets/lists/base/mi
cvs rdiff -u -r1.198 -r1.199 src/etc/mtree/NetBSD.dist.base
cvs rdiff -u -r1.3 -r1.4 src/external/broadcom/bcm43xx/Makefile

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








CVS commit: src/sys/dev/usb

2019-07-23 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Tue Jul 23 17:21:33 UTC 2019

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

Log Message:
 1) If the descriptor length is bigger than the USB string descriptor
itself, error out. Otherwise there is a small overflow (seen on KASAN,
with bLength=255).
 2) Make sure we have a config descriptor header, otherwise there are small
overflows (seen on KASAN, with wTotalLength=1).
 3) Once we have the complete config descriptor, make sure its size didn't
change in the meantime. Otherwise there could be severe overflows.
 4) Make sure we have a bos descriptor header, otherwise overflow, same
as 2).

ok mrg@ skrll@


To generate a diff of this commit:
cvs rdiff -u -r1.234 -r1.235 src/sys/dev/usb/usb_subr.c

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

Modified files:

Index: src/sys/dev/usb/usb_subr.c
diff -u src/sys/dev/usb/usb_subr.c:1.234 src/sys/dev/usb/usb_subr.c:1.235
--- src/sys/dev/usb/usb_subr.c:1.234	Fri Jul 19 04:18:49 2019
+++ src/sys/dev/usb/usb_subr.c	Tue Jul 23 17:21:33 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: usb_subr.c,v 1.234 2019/07/19 04:18:49 mrg Exp $	*/
+/*	$NetBSD: usb_subr.c,v 1.235 2019/07/23 17:21:33 maxv Exp $	*/
 /*	$FreeBSD: src/sys/dev/usb/usb_subr.c,v 1.18 1999/11/17 22:33:47 n_hibma Exp $	*/
 
 /*
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: usb_subr.c,v 1.234 2019/07/19 04:18:49 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: usb_subr.c,v 1.235 2019/07/23 17:21:33 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -135,6 +135,8 @@ usbd_get_string_desc(struct usbd_device 
 	if (actlen < 2)
 		return USBD_SHORT_XFER;
 
+	if (sdesc->bLength > sizeof(*sdesc))
+		return USBD_INVAL;
 	USETW(req.wLength, sdesc->bLength);	/* the whole string */
 	err = usbd_do_request_flags(dev, , sdesc, USBD_SHORT_XFER_OK,
 		, USBD_DEFAULT_TIMEOUT);
@@ -607,7 +609,7 @@ usbd_set_config_index(struct usbd_device
 		return err;
 	}
 	len = UGETW(cd.wTotalLength);
-	if (len == 0) {
+	if (len < USB_CONFIG_DESCRIPTOR_SIZE) {
 		DPRINTF("empty short descriptor", 0, 0, 0, 0);
 		return USBD_INVAL;
 	}
@@ -629,6 +631,11 @@ usbd_set_config_index(struct usbd_device
 		err = USBD_INVAL;
 		goto bad;
 	}
+	if (UGETW(cdp->wTotalLength) != UGETW(cd.wTotalLength)) {
+		DPRINTF("bad len %jd", UGETW(cdp->wTotalLength), 0, 0, 0);
+		err = USBD_INVAL;
+		goto bad;
+	}
 
 	if (USB_IS_SS(dev->ud_speed)) {
 		usb_bos_descriptor_t bd;
@@ -637,7 +644,7 @@ usbd_set_config_index(struct usbd_device
 		err = usbd_get_bos_desc(dev, index, );
 		if (!err) {
 			int blen = UGETW(bd.wTotalLength);
-			if (blen == 0) {
+			if (blen < USB_BOS_DESCRIPTOR_SIZE) {
 DPRINTF("empty bos descriptor", 0, 0, 0, 0);
 err = USBD_INVAL;
 goto bad;



CVS commit: src/sys/dev/usb

2019-07-23 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Tue Jul 23 17:21:33 UTC 2019

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

Log Message:
 1) If the descriptor length is bigger than the USB string descriptor
itself, error out. Otherwise there is a small overflow (seen on KASAN,
with bLength=255).
 2) Make sure we have a config descriptor header, otherwise there are small
overflows (seen on KASAN, with wTotalLength=1).
 3) Once we have the complete config descriptor, make sure its size didn't
change in the meantime. Otherwise there could be severe overflows.
 4) Make sure we have a bos descriptor header, otherwise overflow, same
as 2).

ok mrg@ skrll@


To generate a diff of this commit:
cvs rdiff -u -r1.234 -r1.235 src/sys/dev/usb/usb_subr.c

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



Re: CVS commit: src/sys

2019-07-23 Thread maya
On Tue, Jul 23, 2019 at 10:13:38AM -0700, Jason Thorpe wrote:
> > On Jul 23, 2019, at 10:07 AM, Jason Thorpe  wrote:
> > 
> > 
> > 
> >> On Jul 23, 2019, at 9:14 AM, Rin Okuyama  wrote:
> >> 
> >> Ah, you are right. We leaks uninitialized memory via mmap.
> >> 
> >> However, I'm not sure that it is safe to write DMA buffer
> >> above sc->sc_vramsize after bus_dmamap_load?
> >> 
> >> Thoughts, ARM experts?
> 
> Also, didn't Jared make a change to the Allwinner u-boot configs that ensure 
> the frame buffer is page-aligned?  Should we make that change everywhere?

I might be mis-quoting Jared, but he said something like:
For u-boot, a page is 4K.
For us, a page is 8K.


Re: CVS commit: src

2019-07-23 Thread Thomas Klausner
Hi Jared!

Yes, I saw that. But it's using firmload() as well to load it.

I moved this firmware because it was the only one remaining in that
directory.

I can put it back, if people think that's preferable, or someone else
can revert, I don't mind.

Cheers,
 Thomas

P.S.: The file is 44k, so I'm not convinced by the "/ is small"
argument. ;)

On Tue, Jul 23, 2019 at 12:25:16PM -0300, Jared McNeill wrote:
> Hi Thomas --
> 
> The bcm43xx firmware is different from other firmware images because it is
> not loaded by the kernel directly. The tool that loads this image lives in
> /usr/sbin, so /usr/libdata/firmware seemed more appropriate. The path
> already existed in the list of firmware search paths (sysctl
> hw.firmware.path) long before these files were added.
> 
> Cheers,
> Jared
> 
> 
> On Mon, 22 Jul 2019, Thomas Klausner wrote:
> 
> > Module Name:src
> > Committed By:   wiz
> > Date:   Mon Jul 22 14:47:51 UTC 2019
> > 
> > Modified Files:
> > src/distrib/sets/lists/base: mi
> > src/etc/mtree: NetBSD.dist.base
> > src/external/broadcom/bcm43xx: Makefile
> > 
> > Log Message:
> > Move bcm43xx to /libdata/firmware, where all the other firmwares live.
> > 
> > Deprecate /usr/libdata/firmware.
> > 
> > 
> > To generate a diff of this commit:
> > cvs rdiff -u -r1.1207 -r1.1208 src/distrib/sets/lists/base/mi
> > cvs rdiff -u -r1.198 -r1.199 src/etc/mtree/NetBSD.dist.base
> > cvs rdiff -u -r1.3 -r1.4 src/external/broadcom/bcm43xx/Makefile
> > 
> > Please note that diffs are not public domain; they are subject to the
> > copyright notices on the relevant files.
> > 
> > 
> 


Re: CVS commit: src/sys

2019-07-23 Thread Jason Thorpe
> On Jul 23, 2019, at 10:07 AM, Jason Thorpe  wrote:
> 
> 
> 
>> On Jul 23, 2019, at 9:14 AM, Rin Okuyama  wrote:
>> 
>> Ah, you are right. We leaks uninitialized memory via mmap.
>> 
>> However, I'm not sure that it is safe to write DMA buffer
>> above sc->sc_vramsize after bus_dmamap_load?
>> 
>> Thoughts, ARM experts?

Also, didn't Jared make a change to the Allwinner u-boot configs that ensure 
the frame buffer is page-aligned?  Should we make that change everywhere?

> 
> Since fundamental memory allocation is done on page boundaries, would it 
> suffice to simply ensure that the "leaked" memory is zero'd out first?  I 
> mean, nothing else can use it for anything meaninful...
> 
> -- thorpej
> 

-- thorpej



Re: CVS commit: src/sys

2019-07-23 Thread Jason Thorpe



> On Jul 23, 2019, at 9:14 AM, Rin Okuyama  wrote:
> 
> Ah, you are right. We leaks uninitialized memory via mmap.
> 
> However, I'm not sure that it is safe to write DMA buffer
> above sc->sc_vramsize after bus_dmamap_load?
> 
> Thoughts, ARM experts?

Since fundamental memory allocation is done on page boundaries, would it 
suffice to simply ensure that the "leaked" memory is zero'd out first?  I mean, 
nothing else can use it for anything meaninful...

-- thorpej



Re: CVS commit: src/sys

2019-07-23 Thread Rin Okuyama

Ah, you are right. We leaks uninitialized memory via mmap.

However, I'm not sure that it is safe to write DMA buffer
above sc->sc_vramsize after bus_dmamap_load?

Thoughts, ARM experts?

Thanks,
rin

On 2019/07/24 0:22, m...@netbsd.org wrote:

I think we might be leaking uninitialized kernel memory.

in tifb,

 if (bus_dmamem_alloc(sc->sc_dmat, sc->sc_vramsize, 0, 0,
 sc->sc_dmamem, 1, , BUS_DMA_NOWAIT) != 0) {

bus_dma* rounds up to PAGE_SIZE chunks.

 memset((void *)sc->sc_vramaddr, 0, sc->sc_vramsize);

We zero the not-rounded-up size.

What do you think?

On Tue, Jul 23, 2019 at 02:34:12PM +, Rin Okuyama wrote:

Module Name:src
Committed By:   rin
Date:   Tue Jul 23 14:34:12 UTC 2019

Modified Files:
src/sys/arch/arm/omap: tifb.c
src/sys/arch/luna68k/dev: lunafb.c
src/sys/dev/fdt: simplefb.c

Log Message:
For drivers whose framebuffer is located not page-aligned, permit
offset of mmap up to (length of framebuffer) + (page offset of base
address of framebuffer). This is necessary in order to map the
highest page of framebuffer correctly, see,
http://cvsweb.netbsd.org/bsdweb.cgi/xsrc/external/mit/xf86-video-wsfb/dist/src/wsfb_driver.c#rev1.35




CVS commit: src/usr.sbin/sysinst

2019-07-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Jul 23 16:02:32 UTC 2019

Modified Files:
src/usr.sbin/sysinst: defs.h menus.mi upgrade.c

Log Message:
Fix the "reinstall sets" action.


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/usr.sbin/sysinst/defs.h
cvs rdiff -u -r1.18 -r1.19 src/usr.sbin/sysinst/menus.mi
cvs rdiff -u -r1.10 -r1.11 src/usr.sbin/sysinst/upgrade.c

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

Modified files:

Index: src/usr.sbin/sysinst/defs.h
diff -u src/usr.sbin/sysinst/defs.h:1.39 src/usr.sbin/sysinst/defs.h:1.40
--- src/usr.sbin/sysinst/defs.h:1.39	Tue Jul 23 15:23:14 2019
+++ src/usr.sbin/sysinst/defs.h	Tue Jul 23 16:02:32 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: defs.h,v 1.39 2019/07/23 15:23:14 martin Exp $	*/
+/*	$NetBSD: defs.h,v 1.40 2019/07/23 16:02:32 martin Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -684,7 +684,7 @@ int	do_system(const char *);
 
 /* from upgrade.c */
 void	do_upgrade(void);
-void	do_reinstall_sets(struct install_partition_desc*);
+void	do_reinstall_sets(void);
 void	restore_etc(void);
 
 /* from part_edit.c */

Index: src/usr.sbin/sysinst/menus.mi
diff -u src/usr.sbin/sysinst/menus.mi:1.18 src/usr.sbin/sysinst/menus.mi:1.19
--- src/usr.sbin/sysinst/menus.mi:1.18	Thu Jun 20 00:43:55 2019
+++ src/usr.sbin/sysinst/menus.mi	Tue Jul 23 16:02:32 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: menus.mi,v 1.18 2019/06/20 00:43:55 christos Exp $	*/
+/*	$NetBSD: menus.mi,v 1.19 2019/07/23 16:02:32 martin Exp $	*/
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -270,7 +270,7 @@ menu netbsd, title MSG_NetBSD_VERSION_In
 	option MSG_Upgrade_NetBSD_on_a_hard_disk,
 		action { do_upgrade(); };
 	option MSG_Re_install_sets_or_install_additional_sets,
-		action { do_reinstall_sets(NULL); };
+		action { do_reinstall_sets(); };
 	option MSG_Reboot_the_computer, exit,
 		action (endwin) { system("/sbin/reboot -q"); };
 	option MSG_Utility_menu, sub menu utility;

Index: src/usr.sbin/sysinst/upgrade.c
diff -u src/usr.sbin/sysinst/upgrade.c:1.10 src/usr.sbin/sysinst/upgrade.c:1.11
--- src/usr.sbin/sysinst/upgrade.c:1.10	Tue Jul 23 15:23:14 2019
+++ src/usr.sbin/sysinst/upgrade.c	Tue Jul 23 16:02:32 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: upgrade.c,v 1.10 2019/07/23 15:23:14 martin Exp $	*/
+/*	$NetBSD: upgrade.c,v 1.11 2019/07/23 16:02:32 martin Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -193,9 +193,11 @@ merge_X(const char *xroot)
  * Unpacks sets,  clobbering existing contents.
  */
 void
-do_reinstall_sets(struct install_partition_desc *install)
+do_reinstall_sets()
 {
+	struct install_partition_desc install;
 	int retcode = 0;
+	partman_go = 0;
 
 	unwind_mounts();
 	msg_display(MSG_reinstallusure);
@@ -205,17 +207,25 @@ do_reinstall_sets(struct install_partiti
 	if (find_disks(msg_string(MSG_reinstall)) < 0)
 		return;
 
-	/* XXX find proper pm pointer and pass it here, make sure we have
-	 * read partitions and provide "infos" in there */
-	if (mount_disks(install) != 0)
+	if (pm->parts == NULL) {
+		hit_enter_to_continue(MSG_noroot, NULL);
 		return;
+	}
+
+	install_desc_from_parts(, pm->parts);
+
+	if (mount_disks() != 0)
+		goto free_install;
 
 	/* Unpack the distribution. */
 	process_menu(MENU_distset, );
 	if (retcode == 0)
-		return;
+		goto free_install;
 	if (get_and_unpack_sets(0, NULL, MSG_unpackcomplete, MSG_abortunpack) != 0)
-		return;
+		goto free_install;
 
 	sanity_check();
+
+free_install:
+	free_install_desc();
 }



CVS commit: src/usr.sbin/sysinst

2019-07-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Jul 23 16:02:32 UTC 2019

Modified Files:
src/usr.sbin/sysinst: defs.h menus.mi upgrade.c

Log Message:
Fix the "reinstall sets" action.


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/usr.sbin/sysinst/defs.h
cvs rdiff -u -r1.18 -r1.19 src/usr.sbin/sysinst/menus.mi
cvs rdiff -u -r1.10 -r1.11 src/usr.sbin/sysinst/upgrade.c

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



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

2019-07-23 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Tue Jul 23 15:56:14 UTC 2019

Modified Files:
src/sys/arch/evbarm/dev: plcom.c

Log Message:
Add cn_halt function, disable interrupts when halting


To generate a diff of this commit:
cvs rdiff -u -r1.58 -r1.59 src/sys/arch/evbarm/dev/plcom.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/evbarm/dev/plcom.c
diff -u src/sys/arch/evbarm/dev/plcom.c:1.58 src/sys/arch/evbarm/dev/plcom.c:1.59
--- src/sys/arch/evbarm/dev/plcom.c:1.58	Tue Jul 23 12:13:47 2019
+++ src/sys/arch/evbarm/dev/plcom.c	Tue Jul 23 15:56:14 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: plcom.c,v 1.58 2019/07/23 12:13:47 skrll Exp $	*/
+/*	$NetBSD: plcom.c,v 1.59 2019/07/23 15:56:14 jmcneill Exp $	*/
 
 /*-
  * Copyright (c) 2001 ARM Ltd
@@ -94,7 +94,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: plcom.c,v 1.58 2019/07/23 12:13:47 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: plcom.c,v 1.59 2019/07/23 15:56:14 jmcneill Exp $");
 
 #include "opt_plcom.h"
 #include "opt_ddb.h"
@@ -178,6 +178,7 @@ dev_type_poll(plcompoll);
 int	plcomcngetc	(dev_t);
 void	plcomcnputc	(dev_t, int);
 void	plcomcnpollc	(dev_t, int);
+void	plcomcnhalt	(dev_t);
 
 #define	integrate	static inline
 void 	plcomsoft	(void *);
@@ -2407,7 +2408,7 @@ plcominit(struct plcom_instance *pi, int
  */
 struct consdev plcomcons = {
 	NULL, NULL, plcomcngetc, plcomcnputc, plcomcnpollc, NULL,
-	NULL, NULL, NODEV, CN_NORMAL
+	plcomcnhalt, NULL, NODEV, CN_NORMAL
 };
 
 int
@@ -2466,6 +2467,23 @@ plcomcnpollc(dev_t dev, int on)
 	plcom_readaheadcount = 0;
 }
 
+void
+plcomcnhalt(dev_t dev)
+{
+	struct plcom_instance *pi = _info;
+
+	switch (pi->pi_type) {
+	case PLCOM_TYPE_PL010:
+		PWRITE1(pi, PL010COM_CR, PL01X_CR_UARTEN);
+		break;
+	case PLCOM_TYPE_PL011:
+		PWRITE4(pi, PL011COM_CR,
+		PL01X_CR_UARTEN | PL011_CR_RXE | PL011_CR_TXE);
+		PWRITE4(pi, PL011COM_IMSC, 0);
+		break;
+	}
+}
+
 #ifdef KGDB
 int
 plcom_kgdb_attach(struct plcom_instance *pi, int rate, int frequency,



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

2019-07-23 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Tue Jul 23 15:56:14 UTC 2019

Modified Files:
src/sys/arch/evbarm/dev: plcom.c

Log Message:
Add cn_halt function, disable interrupts when halting


To generate a diff of this commit:
cvs rdiff -u -r1.58 -r1.59 src/sys/arch/evbarm/dev/plcom.c

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



CVS commit: src/sys/dev/wscons

2019-07-23 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Tue Jul 23 15:55:49 UTC 2019

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

Log Message:
Call cn_halt on the old console device


To generate a diff of this commit:
cvs rdiff -u -r1.154 -r1.155 src/sys/dev/wscons/wsdisplay.c

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



CVS commit: src/sys/dev/wscons

2019-07-23 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Tue Jul 23 15:55:49 UTC 2019

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

Log Message:
Call cn_halt on the old console device


To generate a diff of this commit:
cvs rdiff -u -r1.154 -r1.155 src/sys/dev/wscons/wsdisplay.c

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

Modified files:

Index: src/sys/dev/wscons/wsdisplay.c
diff -u src/sys/dev/wscons/wsdisplay.c:1.154 src/sys/dev/wscons/wsdisplay.c:1.155
--- src/sys/dev/wscons/wsdisplay.c:1.154	Thu Feb  7 06:10:29 2019
+++ src/sys/dev/wscons/wsdisplay.c	Tue Jul 23 15:55:49 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: wsdisplay.c,v 1.154 2019/02/07 06:10:29 mlelstv Exp $ */
+/* $NetBSD: wsdisplay.c,v 1.155 2019/07/23 15:55:49 jmcneill Exp $ */
 
 /*
  * Copyright (c) 1996, 1997 Christopher G. Demetriou.  All rights reserved.
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: wsdisplay.c,v 1.154 2019/02/07 06:10:29 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wsdisplay.c,v 1.155 2019/07/23 15:55:49 jmcneill Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_wsdisplay_compat.h"
@@ -930,8 +930,11 @@ wsdisplay_cnattach(const struct wsscreen
   ccol, crow,
   defattr);
 
-	if (cn_tab != _cons)
+	if (cn_tab != _cons) {
+		if (cn_tab != NULL && cn_tab->cn_halt != NULL)
+			cn_tab->cn_halt(cn_tab->cn_dev);
 		wsdisplay_ocn = cn_tab;
+	}
 	cn_tab = _cons;
 	wsdisplay_console_initted = 2;
 }



Re: CVS commit: src

2019-07-23 Thread Jared McNeill

Hi Thomas --

The bcm43xx firmware is different from other firmware images because it is 
not loaded by the kernel directly. The tool that loads this image lives in 
/usr/sbin, so /usr/libdata/firmware seemed more appropriate. The path 
already existed in the list of firmware search paths (sysctl 
hw.firmware.path) long before these files were added.


Cheers,
Jared


On Mon, 22 Jul 2019, Thomas Klausner wrote:


Module Name:src
Committed By:   wiz
Date:   Mon Jul 22 14:47:51 UTC 2019

Modified Files:
src/distrib/sets/lists/base: mi
src/etc/mtree: NetBSD.dist.base
src/external/broadcom/bcm43xx: Makefile

Log Message:
Move bcm43xx to /libdata/firmware, where all the other firmwares live.

Deprecate /usr/libdata/firmware.


To generate a diff of this commit:
cvs rdiff -u -r1.1207 -r1.1208 src/distrib/sets/lists/base/mi
cvs rdiff -u -r1.198 -r1.199 src/etc/mtree/NetBSD.dist.base
cvs rdiff -u -r1.3 -r1.4 src/external/broadcom/bcm43xx/Makefile

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




CVS commit: src/doc

2019-07-23 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Tue Jul 23 15:29:24 UTC 2019

Modified Files:
src/doc: CHANGES

Log Message:
Note DMA support for SCSI adapters found on 660/840AV.


To generate a diff of this commit:
cvs rdiff -u -r1.2554 -r1.2555 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/CHANGES
diff -u src/doc/CHANGES:1.2554 src/doc/CHANGES:1.2555
--- src/doc/CHANGES:1.2554	Thu Jul 18 09:07:59 2019
+++ src/doc/CHANGES	Tue Jul 23 15:29:24 2019
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2554 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2555 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -403,3 +403,6 @@ Changes from NetBSD 8.0 to NetBSD 9.0:
 	resolvconf(8): Import openresolv-3.9.1. [roy 20190717]
 	amdsmn(4),amdzentemp(4): Add suppor for Ryzen 2xxx and 3xxx.
 		[msaitoh 20190718]
+	mac68k: Enable DMA transfer for SCSI adapters found on 660/840AV.
+		Submitted by Michael Zucca via PR port-mac68k/24883.
+		[rin 20190723]



CVS commit: src/doc

2019-07-23 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Tue Jul 23 15:29:24 UTC 2019

Modified Files:
src/doc: CHANGES

Log Message:
Note DMA support for SCSI adapters found on 660/840AV.


To generate a diff of this commit:
cvs rdiff -u -r1.2554 -r1.2555 src/doc/CHANGES

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



Re: CVS commit: src/sys

2019-07-23 Thread maya
I think we might be leaking uninitialized kernel memory.

in tifb,

if (bus_dmamem_alloc(sc->sc_dmat, sc->sc_vramsize, 0, 0,
sc->sc_dmamem, 1, , BUS_DMA_NOWAIT) != 0) {

bus_dma* rounds up to PAGE_SIZE chunks.

memset((void *)sc->sc_vramaddr, 0, sc->sc_vramsize);

We zero the not-rounded-up size.

What do you think?

On Tue, Jul 23, 2019 at 02:34:12PM +, Rin Okuyama wrote:
> Module Name:  src
> Committed By: rin
> Date: Tue Jul 23 14:34:12 UTC 2019
> 
> Modified Files:
>   src/sys/arch/arm/omap: tifb.c
>   src/sys/arch/luna68k/dev: lunafb.c
>   src/sys/dev/fdt: simplefb.c
> 
> Log Message:
> For drivers whose framebuffer is located not page-aligned, permit
> offset of mmap up to (length of framebuffer) + (page offset of base
> address of framebuffer). This is necessary in order to map the
> highest page of framebuffer correctly, see,
> http://cvsweb.netbsd.org/bsdweb.cgi/xsrc/external/mit/xf86-video-wsfb/dist/src/wsfb_driver.c#rev1.35


CVS commit: src/usr.sbin/sysinst

2019-07-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Jul 23 15:23:14 UTC 2019

Modified Files:
src/usr.sbin/sysinst: defs.h disks.c target.c upgrade.c

Log Message:
When searching for a partition that may be the root partition for upgrading,
allow "/", "/targetroot" and "/altroot" as potential last mount points.


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/usr.sbin/sysinst/defs.h \
src/usr.sbin/sysinst/disks.c
cvs rdiff -u -r1.6 -r1.7 src/usr.sbin/sysinst/target.c
cvs rdiff -u -r1.9 -r1.10 src/usr.sbin/sysinst/upgrade.c

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



CVS commit: src/usr.sbin/sysinst

2019-07-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Jul 23 15:23:14 UTC 2019

Modified Files:
src/usr.sbin/sysinst: defs.h disks.c target.c upgrade.c

Log Message:
When searching for a partition that may be the root partition for upgrading,
allow "/", "/targetroot" and "/altroot" as potential last mount points.


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/usr.sbin/sysinst/defs.h \
src/usr.sbin/sysinst/disks.c
cvs rdiff -u -r1.6 -r1.7 src/usr.sbin/sysinst/target.c
cvs rdiff -u -r1.9 -r1.10 src/usr.sbin/sysinst/upgrade.c

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

Modified files:

Index: src/usr.sbin/sysinst/defs.h
diff -u src/usr.sbin/sysinst/defs.h:1.38 src/usr.sbin/sysinst/defs.h:1.39
--- src/usr.sbin/sysinst/defs.h:1.38	Sat Jul 13 17:13:36 2019
+++ src/usr.sbin/sysinst/defs.h	Tue Jul 23 15:23:14 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: defs.h,v 1.38 2019/07/13 17:13:36 martin Exp $	*/
+/*	$NetBSD: defs.h,v 1.39 2019/07/23 15:23:14 martin Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -771,6 +771,7 @@ void	free_install_desc(struct install_pa
 #if defined(DEBUG)  ||	defined(DEBUG_ROOT)
 void	backtowin(void);
 #endif
+bool	is_root_part_mount(const char *);
 const	char *concat_paths(const char *, const char *);
 const	char *target_expand(const char *);
 bool	needs_expanding(const char *, size_t);
Index: src/usr.sbin/sysinst/disks.c
diff -u src/usr.sbin/sysinst/disks.c:1.38 src/usr.sbin/sysinst/disks.c:1.39
--- src/usr.sbin/sysinst/disks.c:1.38	Sun Jul 14 11:25:10 2019
+++ src/usr.sbin/sysinst/disks.c	Tue Jul 23 15:23:14 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: disks.c,v 1.38 2019/07/14 11:25:10 martin Exp $ */
+/*	$NetBSD: disks.c,v 1.39 2019/07/23 15:23:14 martin Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -1514,6 +1514,7 @@ mount_disks(struct install_partition_des
 	int   fstabsize;
 	int   error;
 	char devdev[PATH_MAX];
+	size_t i;
 
 	static struct lookfor fstabbuf[] = {
 		{"/dev/", "/dev/%s %s ffs %s", "c", NULL, 0, 0, foundffs},
@@ -1530,10 +1531,18 @@ mount_disks(struct install_partition_des
 		/* avoid needing to call target_already_root() again */
 		targetroot_mnt[0] = 0;
 	else {
-		assert(install != NULL && install->num > 0);
-		assert(strcmp(install->infos[0].mount, "/") == 0);
-		if (!install->infos[0].parts->pscheme->get_part_device(
-		install->infos[0].parts, install->infos[0].cur_part_id,
+		for (i = 0; i < install->num; i++) {
+			if (is_root_part_mount(install->infos[i].mount))
+break;
+		}
+
+		if (i >= install->num) {
+			hit_enter_to_continue(MSG_noroot, NULL);
+			return -1;
+		}
+
+		if (!install->infos[i].parts->pscheme->get_part_device(
+		install->infos[i].parts, install->infos[i].cur_part_id,
 		devdev, sizeof devdev, NULL, plain_name, true))
 			return -1;
 		error = mount_root(devdev, install);

Index: src/usr.sbin/sysinst/target.c
diff -u src/usr.sbin/sysinst/target.c:1.6 src/usr.sbin/sysinst/target.c:1.7
--- src/usr.sbin/sysinst/target.c:1.6	Sat Jun 15 08:20:33 2019
+++ src/usr.sbin/sysinst/target.c	Tue Jul 23 15:23:14 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: target.c,v 1.6 2019/06/15 08:20:33 martin Exp $	*/
+/*	$NetBSD: target.c,v 1.7 2019/07/23 15:23:14 martin Exp $	*/
 
 /*
  * Copyright 1997 Jonathan Stone
@@ -71,7 +71,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: target.c,v 1.6 2019/06/15 08:20:33 martin Exp $");
+__RCSID("$NetBSD: target.c,v 1.7 2019/07/23 15:23:14 martin Exp $");
 #endif
 
 /*
@@ -164,13 +164,19 @@ target_already_root(void)
 		return last_res;
 
 	last_pm = pm;
-	last_res = 1;
+	last_res = 0;
 
 	parts = pm->parts;
-	if (pm->no_part || parts == NULL) {
+	if (parts == NULL) {
 		last_res = 0;
 		return 0;
 	}
+
+	if (pm->no_part) {
+		last_res = is_active_rootpart(pm->diskdev, -1);
+		return last_res;
+	}
+
 	if (pm->parts->pscheme->secondary_partitions != NULL)
 		parts = pm->parts->pscheme->secondary_partitions(parts,
 		pm->ptstart, false);
@@ -180,20 +186,30 @@ target_already_root(void)
 			continue;
 		if (info.nat_type->generic_ptype != PT_root)
 			continue;
-		if (strcmp(info.last_mounted, "/") != 0)
+		if (!is_root_part_mount(info.last_mounted))
 			continue;
-
 		if (!parts->pscheme->get_part_device(parts, ptn,
 		dev, sizeof dev, , plain_name, false))
 			continue;
 
 		last_res = is_active_rootpart(dev, rootpart);
-		return last_res;
-	}
+		break;
+ 	}
 
-	return 1;
+	return last_res;
 }
 
+/*
+ * Could something with this "last mounted on" information be a potential
+ * root partition?
+ */
+bool
+is_root_part_mount(const char *last_mounted)
+{
+	return strcmp(last_mounted, "/") == 0 ||
+	strcmp(last_mounted, "/targetroot") == 0 ||
+	strcmp(last_mounted, "/altroot") == 0;
+}
 
 /*
  * Is this device partition (e.g., "sd0a") mounted as root? 

Index: src/usr.sbin/sysinst/upgrade.c
diff -u src/usr.sbin/sysinst/upgrade.c:1.9 

CVS commit: src/sys/arch/mac68k

2019-07-23 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Tue Jul 23 15:19:07 UTC 2019

Modified Files:
src/sys/arch/mac68k/include: psc.h
src/sys/arch/mac68k/mac68k: psc.c
src/sys/arch/mac68k/obio: esp.c espvar.h

Log Message:
PR port-mac68k/24883

Support DMA xfer for SCSI adapter of AV Mac (660/840AV), written by
Michael Zucca.

This improves disk I/O performance by nearly one order of magnitude.
In addition, interrupt storm due to heavy disk PIO is resolved.

I'm deeply grateful to Michael Zucca for his analysis of DMA engine
and submission of PR. I also thank Izumi Tsutsui (useful comments on
port-mac68k@) and Martin Husemann (test on 660AV).


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/mac68k/include/psc.h
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/mac68k/mac68k/psc.c
cvs rdiff -u -r1.57 -r1.58 src/sys/arch/mac68k/obio/esp.c
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/mac68k/obio/espvar.h

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

Modified files:

Index: src/sys/arch/mac68k/include/psc.h
diff -u src/sys/arch/mac68k/include/psc.h:1.7 src/sys/arch/mac68k/include/psc.h:1.8
--- src/sys/arch/mac68k/include/psc.h:1.7	Sun Dec 11 12:18:03 2005
+++ src/sys/arch/mac68k/include/psc.h	Tue Jul 23 15:19:07 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: psc.h,v 1.7 2005/12/11 12:18:03 christos Exp $	*/
+/*	$NetBSD: psc.h,v 1.8 2019/07/23 15:19:07 rin Exp $	*/
 
 /*-
  * Copyright (c) 1997 David Huang 
@@ -25,6 +25,8 @@
  *
  */
 
+#include 	/* XXX for bus_addr_t */
+
 /*
  * Some register definitions for the PSC, present only on the
  * Centris/Quadra 660av and the Quadra 840av.
@@ -48,6 +50,11 @@ int	remove_psc_lev4_intr(int);
 int	remove_psc_lev5_intr(int);
 int	remove_psc_lev6_intr(int);
 
+int	start_psc_dma(int, int *, bus_addr_t, uint32_t, int);
+int	pause_psc_dma(int);
+int	wait_psc_dma(int, int, uint32_t *);
+int	stop_psc_dma(int, int, uint32_t *, int);
+
 /*
  * Reading an interrupt status register returns a mask of the
  * currently interrupting devices (one bit per device). Reading an
@@ -123,3 +130,14 @@ int	remove_psc_lev6_intr(int);
  */
 #define	PSC_SET0	0x00
 #define	PSC_SET1	0x10
+
+/*
+ * Pseudo channels for the dma control functions
+ */
+#define	PSC_DMA_CHANNEL_SCSI	0
+#define	PSC_DMA_CHANNEL_ENETRD	1
+#define	PSC_DMA_CHANNEL_ENETWR	2
+#define	PSC_DMA_CHANNEL_FDC	3
+#define	PSC_DMA_CHANNEL_SCCA	4
+#define	PSC_DMA_CHANNEL_SCCB	5
+#define	PSC_DMA_CHANNEL_SCCATX	6

Index: src/sys/arch/mac68k/mac68k/psc.c
diff -u src/sys/arch/mac68k/mac68k/psc.c:1.10 src/sys/arch/mac68k/mac68k/psc.c:1.11
--- src/sys/arch/mac68k/mac68k/psc.c:1.10	Sun Dec 11 12:18:03 2005
+++ src/sys/arch/mac68k/mac68k/psc.c	Tue Jul 23 15:19:07 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: psc.c,v 1.10 2005/12/11 12:18:03 christos Exp $	*/
+/*	$NetBSD: psc.c,v 1.11 2019/07/23 15:19:07 rin Exp $	*/
 
 /*-
  * Copyright (c) 1997 David Huang 
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: psc.c,v 1.10 2005/12/11 12:18:03 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: psc.c,v 1.11 2019/07/23 15:19:07 rin Exp $");
 
 #include 
 #include 
@@ -51,6 +51,9 @@ static void	psc_lev5_noint(void *);
 int		psc_lev6_intr(void *);
 static void	psc_lev6_noint(void *);
 
+static int	stop_read_psc_dma(int, int, uint32_t *);
+static int	stop_write_psc_dma(int, int, uint32_t *);
+
 void	(*psc3_ihandler)(void *) = psc_lev3_noint;
 void	*psc3_iarg;
 
@@ -324,3 +327,164 @@ psc_lev6_noint(void *arg)
 {
 	printf("psc_lev6_noint: device %d\n", (int)arg);
 }
+
+/*
+ * DMA Control routines for esp(4).
+ * XXX Need to be merged with DMA engine of mc(4).
+ */
+
+int
+start_psc_dma(int channel, int *rset, bus_addr_t addr, uint32_t len, int datain)
+{
+	int chan_ctrl, rset_addr, rset_len, rset_cmd, s;
+
+	s = splhigh(); 
+
+	chan_ctrl = PSC_CTLBASE + (channel << 4);
+
+	pause_psc_dma(channel);
+
+	*rset = (psc_reg2(chan_ctrl) & 1) << 4;
+
+	rset_addr = PSC_ADDRBASE + (0x20 * channel) + *rset;
+	rset_len = rset_addr + 4;
+	rset_cmd = rset_addr + 8;
+
+	(void)psc_reg2(rset_cmd);
+	psc_reg4(rset_len) = len;
+	psc_reg4(rset_addr) = addr;
+
+	if (datain)
+		psc_reg2(rset_cmd) = 0x8200;
+	else
+		psc_reg2(rset_cmd) = 0x200;
+
+	psc_reg2(rset_cmd) = 0x100;
+	psc_reg2(rset_cmd) = 0x8800;
+	psc_reg2(chan_ctrl) = 0x400;
+
+	splx(s);
+
+	return 0;
+}
+
+int
+pause_psc_dma(int channel)
+{
+	int chan_ctrl, s;
+
+	s = splhigh();
+
+	chan_ctrl = PSC_CTLBASE + (channel << 4);
+
+	psc_reg2(chan_ctrl) = 0x8400;
+
+	while (!(psc_reg2(chan_ctrl) & 0x4000))
+		continue;
+
+	splx(s);
+
+	return 0;
+}
+
+int
+wait_psc_dma(int channel, int rset, uint32_t *residual)
+{
+	int rset_addr, rset_len, rset_cmd, s;
+
+	s = splhigh();
+
+	rset_addr = PSC_ADDRBASE + (0x20 * channel) + rset;
+	rset_len = rset_addr + 4;
+	rset_cmd = rset_addr + 8;
+
+	while (!(psc_reg2(rset_cmd) & 0x100))
+		continue;
+
+	while (psc_reg2(rset_cmd) & 0x800)
+		continue;
+
+	*residual = psc_reg4(rset_len);
+
+	

CVS commit: src/sys/arch/mac68k

2019-07-23 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Tue Jul 23 15:19:07 UTC 2019

Modified Files:
src/sys/arch/mac68k/include: psc.h
src/sys/arch/mac68k/mac68k: psc.c
src/sys/arch/mac68k/obio: esp.c espvar.h

Log Message:
PR port-mac68k/24883

Support DMA xfer for SCSI adapter of AV Mac (660/840AV), written by
Michael Zucca.

This improves disk I/O performance by nearly one order of magnitude.
In addition, interrupt storm due to heavy disk PIO is resolved.

I'm deeply grateful to Michael Zucca for his analysis of DMA engine
and submission of PR. I also thank Izumi Tsutsui (useful comments on
port-mac68k@) and Martin Husemann (test on 660AV).


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/mac68k/include/psc.h
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/mac68k/mac68k/psc.c
cvs rdiff -u -r1.57 -r1.58 src/sys/arch/mac68k/obio/esp.c
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/mac68k/obio/espvar.h

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



CVS commit: src/sys

2019-07-23 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Tue Jul 23 14:34:12 UTC 2019

Modified Files:
src/sys/arch/arm/omap: tifb.c
src/sys/arch/luna68k/dev: lunafb.c
src/sys/dev/fdt: simplefb.c

Log Message:
For drivers whose framebuffer is located not page-aligned, permit
offset of mmap up to (length of framebuffer) + (page offset of base
address of framebuffer). This is necessary in order to map the
highest page of framebuffer correctly, see,
http://cvsweb.netbsd.org/bsdweb.cgi/xsrc/external/mit/xf86-video-wsfb/dist/src/wsfb_driver.c#rev1.35


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/arm/omap/tifb.c
cvs rdiff -u -r1.39 -r1.40 src/sys/arch/luna68k/dev/lunafb.c
cvs rdiff -u -r1.7 -r1.8 src/sys/dev/fdt/simplefb.c

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



CVS commit: src/sys

2019-07-23 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Tue Jul 23 14:34:12 UTC 2019

Modified Files:
src/sys/arch/arm/omap: tifb.c
src/sys/arch/luna68k/dev: lunafb.c
src/sys/dev/fdt: simplefb.c

Log Message:
For drivers whose framebuffer is located not page-aligned, permit
offset of mmap up to (length of framebuffer) + (page offset of base
address of framebuffer). This is necessary in order to map the
highest page of framebuffer correctly, see,
http://cvsweb.netbsd.org/bsdweb.cgi/xsrc/external/mit/xf86-video-wsfb/dist/src/wsfb_driver.c#rev1.35


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/arm/omap/tifb.c
cvs rdiff -u -r1.39 -r1.40 src/sys/arch/luna68k/dev/lunafb.c
cvs rdiff -u -r1.7 -r1.8 src/sys/dev/fdt/simplefb.c

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

Modified files:

Index: src/sys/arch/arm/omap/tifb.c
diff -u src/sys/arch/arm/omap/tifb.c:1.7 src/sys/arch/arm/omap/tifb.c:1.8
--- src/sys/arch/arm/omap/tifb.c:1.7	Wed Mar  1 16:27:25 2017
+++ src/sys/arch/arm/omap/tifb.c	Tue Jul 23 14:34:11 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: tifb.c,v 1.7 2017/03/01 16:27:25 skrll Exp $	*/
+/*	$NetBSD: tifb.c,v 1.8 2019/07/23 14:34:11 rin Exp $	*/
 
 /*
  * Copyright (c) 2010 Michael Lorenz
@@ -57,7 +57,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: tifb.c,v 1.7 2017/03/01 16:27:25 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tifb.c,v 1.8 2019/07/23 14:34:11 rin Exp $");
 
 #include "opt_omap.h"
 
@@ -816,7 +816,8 @@ tifb_mmap(void *v, void *vs, off_t offse
 	struct tifb_softc *sc = vd->cookie;
 
 	/* 'regular' framebuffer mmap()ing */
-	if (offset < sc->sc_stride * sc->sc_pi->panel_height) {
+	if (offset >= 0 && offset < sc->sc_palettesize +
+	sc->sc_stride * sc->sc_pi->panel_height) {
 		pa = bus_dmamem_mmap(sc->sc_dmat, sc->sc_dmamem, 1,
 		offset, prot, BUS_DMA_PREFETCHABLE);
 		return pa;

Index: src/sys/arch/luna68k/dev/lunafb.c
diff -u src/sys/arch/luna68k/dev/lunafb.c:1.39 src/sys/arch/luna68k/dev/lunafb.c:1.40
--- src/sys/arch/luna68k/dev/lunafb.c:1.39	Sun Jun 30 05:04:48 2019
+++ src/sys/arch/luna68k/dev/lunafb.c	Tue Jul 23 14:34:11 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: lunafb.c,v 1.39 2019/06/30 05:04:48 tsutsui Exp $ */
+/* $NetBSD: lunafb.c,v 1.40 2019/07/23 14:34:11 rin Exp $ */
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include 			/* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: lunafb.c,v 1.39 2019/06/30 05:04:48 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lunafb.c,v 1.40 2019/07/23 14:34:11 rin Exp $");
 
 #include 
 #include 
@@ -308,7 +308,8 @@ omfbmmap(void *v, void *vs, off_t offset
 #endif
 	case WSDISPLAYIO_MODE_DUMBFB:
 		if (offset >= 0 &&
-		offset < dc->dc_rowbytes * dc->dc_ht * dc->dc_depth)
+		offset < (m68k_page_offset(OMFB_FB_RADDR) +
+		dc->dc_rowbytes * dc->dc_ht) * dc->dc_depth)
 			cookie = m68k_btop(m68k_trunc_page(OMFB_FB_RADDR) +
 			offset);
 		break;

Index: src/sys/dev/fdt/simplefb.c
diff -u src/sys/dev/fdt/simplefb.c:1.7 src/sys/dev/fdt/simplefb.c:1.8
--- src/sys/dev/fdt/simplefb.c:1.7	Wed Jan 30 00:55:04 2019
+++ src/sys/dev/fdt/simplefb.c	Tue Jul 23 14:34:12 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: simplefb.c,v 1.7 2019/01/30 00:55:04 jmcneill Exp $ */
+/* $NetBSD: simplefb.c,v 1.8 2019/07/23 14:34:12 rin Exp $ */
 
 /*-
  * Copyright (c) 2017 Jared McNeill 
@@ -29,7 +29,7 @@
 #include "opt_wsdisplay_compat.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: simplefb.c,v 1.7 2019/01/30 00:55:04 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: simplefb.c,v 1.8 2019/07/23 14:34:12 rin Exp $");
 
 #include 
 #include 
@@ -114,10 +114,11 @@ simplefb_mmap(void *v, void *vs, off_t o
 {
 	struct simplefb_softc * const sc = v;
 
-	if (off < 0 || off >= sc->sc_gen.sc_fbsize)
+	if (off < 0 || off >= (sc->sc_paddr & PAGE_MASK) +
+	sc->sc_gen.sc_fbsize)
 		return -1;
 
-	return bus_space_mmap(sc->sc_bst, sc->sc_paddr, off, prot,
+	return bus_space_mmap(sc->sc_bst, trunc_page(sc->sc_paddr), off, prot,
 	BUS_SPACE_MAP_LINEAR | BUS_SPACE_MAP_PREFETCHABLE);
 }
 



CVS commit: src/crypto/dist/ipsec-tools/src/setkey

2019-07-23 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Tue Jul 23 14:28:24 UTC 2019

Modified Files:
src/crypto/dist/ipsec-tools/src/setkey: setkey.8

Log Message:
Remove superfluous Li; rename section to match standards.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/crypto/dist/ipsec-tools/src/setkey/setkey.8

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



CVS commit: src/usr.sbin/npf

2019-07-23 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Tue Jul 23 14:24:02 UTC 2019

Modified Files:
src/usr.sbin/npf: npf-params.7

Log Message:
Add RCS Id.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/usr.sbin/npf/npf-params.7

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



CVS commit: src/usr.sbin/npf

2019-07-23 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Tue Jul 23 14:24:02 UTC 2019

Modified Files:
src/usr.sbin/npf: npf-params.7

Log Message:
Add RCS Id.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/usr.sbin/npf/npf-params.7

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/npf/npf-params.7
diff -u src/usr.sbin/npf/npf-params.7:1.1 src/usr.sbin/npf/npf-params.7:1.2
--- src/usr.sbin/npf/npf-params.7:1.1	Tue Jul 23 00:52:02 2019
+++ src/usr.sbin/npf/npf-params.7	Tue Jul 23 14:24:02 2019
@@ -1,3 +1,4 @@
+.\" $NetBSD: npf-params.7,v 1.2 2019/07/23 14:24:02 wiz Exp $
 .\"
 .\" Copyright (c) 2019 Mindaugas Rasiukevicius 
 .\" All rights reserved.



CVS commit: src/usr.sbin/npf/npfctl

2019-07-23 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Tue Jul 23 14:20:22 UTC 2019

Modified Files:
src/usr.sbin/npf/npfctl: npf.conf.5

Log Message:
New sentence, new line. Avoid formatting punctuation. Remove superfluous Pp.


To generate a diff of this commit:
cvs rdiff -u -r1.87 -r1.88 src/usr.sbin/npf/npfctl/npf.conf.5

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/npf/npfctl/npf.conf.5
diff -u src/usr.sbin/npf/npfctl/npf.conf.5:1.87 src/usr.sbin/npf/npfctl/npf.conf.5:1.88
--- src/usr.sbin/npf/npfctl/npf.conf.5:1.87	Tue Jul 23 00:52:02 2019
+++ src/usr.sbin/npf/npfctl/npf.conf.5	Tue Jul 23 14:20:22 2019
@@ -1,4 +1,4 @@
-.\"$NetBSD: npf.conf.5,v 1.87 2019/07/23 00:52:02 rmind Exp $
+.\"$NetBSD: npf.conf.5,v 1.88 2019/07/23 14:20:22 wiz Exp $
 .\"
 .\" Copyright (c) 2009-2019 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -304,7 +304,7 @@ keywords.
 The former creates a state which is uniquely identified by a 5-tuple (source
 and destination IP addresses, port numbers and an interface identifier).
 The latter excludes the interface identifier, i.e. making the state global,
-and must be used with precaution.
+and must be used with caution.
 In both cases, a full TCP state tracking is performed for TCP connections
 and a limited tracking for message-based protocols (UDP and ICMP).
 .Pp
@@ -374,7 +374,6 @@ hash of the original source and destinat
 This algorithms attempts to keep all connections of particular client
 associated with the same translation address.
 This is the default algorithm.
-.Pp
 .It Cm round-robin
 The translation address for each new connection is selected on a
 round-robin basis.
@@ -440,7 +439,7 @@ Depending on the call, the key might rep
 might be optional.
 Available options:
 .Bl -tag -width "Cm log: Ar interface" -offset indent
-.It Cm log: Ar interface
+.It Cm log : Ar interface
 Log events.
 This requires the
 .Pa npf_ext_log
@@ -451,7 +450,7 @@ configuration is loaded.
 The log packets can be written to a file using the
 .Xr npfd 8
 daemon.
-.It Cm normalize: Ar option1 Ns Op Li \&, Ar option2 ...
+.It Cm normalize : Ar option1 Ns Op Li \&, Ar option2 ...
 Modify packets according to the specified normalization options.
 This requires the
 .Pa npf_ext_normalize kernel
@@ -482,7 +481,8 @@ procedure "someproc" {
 .Pp
 In this case, the procedure calls the logging and normalization modules.
 .Ss Parameter settings
-NPF supports a set of dynamically tunable parameters. See
+NPF supports a set of dynamically tunable parameters.
+See
 .Xr npf-params 7
 for specific details.
 .Ss Misc



CVS commit: src/usr.sbin/npf/npfctl

2019-07-23 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Tue Jul 23 14:20:22 UTC 2019

Modified Files:
src/usr.sbin/npf/npfctl: npf.conf.5

Log Message:
New sentence, new line. Avoid formatting punctuation. Remove superfluous Pp.


To generate a diff of this commit:
cvs rdiff -u -r1.87 -r1.88 src/usr.sbin/npf/npfctl/npf.conf.5

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



CVS commit: src/lib/libnpf

2019-07-23 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Tue Jul 23 14:18:20 UTC 2019

Modified Files:
src/lib/libnpf: libnpf.3

Log Message:
Try improving a description.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/lib/libnpf/libnpf.3

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



CVS commit: src/lib/libnpf

2019-07-23 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Tue Jul 23 14:18:20 UTC 2019

Modified Files:
src/lib/libnpf: libnpf.3

Log Message:
Try improving a description.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/lib/libnpf/libnpf.3

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

Modified files:

Index: src/lib/libnpf/libnpf.3
diff -u src/lib/libnpf/libnpf.3:1.8 src/lib/libnpf/libnpf.3:1.9
--- src/lib/libnpf/libnpf.3:1.8	Tue Jul 23 00:52:01 2019
+++ src/lib/libnpf/libnpf.3	Tue Jul 23 14:18:20 2019
@@ -1,4 +1,4 @@
-.\"	$NetBSD: libnpf.3,v 1.8 2019/07/23 00:52:01 rmind Exp $
+.\"	$NetBSD: libnpf.3,v 1.9 2019/07/23 14:18:20 wiz Exp $
 .\"
 .\" Copyright (c) 2011-2019 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -180,8 +180,8 @@ The state is uniquely identified by a 5-
 IP addresses, port numbers and an interface identifier).
 .It Dv NPF_RULE_GSTATEFUL
 Exclude the interface identifier from the state key i.e. use a 4-tuple.
-This makes the state global with the respect network interfaces.
-The state is also picked on packet travelling different direction that
+This makes the state global with respect to the network interfaces.
+The state is also picked for packets travelling different direction than
 originally.
 .It Dv NPF_RULE_RETRST
 Return TCP RST packet in a case of packet block.



CVS commit: src/lib/libedit

2019-07-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Jul 23 13:10:12 UTC 2019

Modified Files:
src/lib/libedit: literal.c

Log Message:
remove stray brace


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/lib/libedit/literal.c

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

Modified files:

Index: src/lib/libedit/literal.c
diff -u src/lib/libedit/literal.c:1.4 src/lib/libedit/literal.c:1.5
--- src/lib/libedit/literal.c:1.4	Tue Jul 23 06:18:52 2019
+++ src/lib/libedit/literal.c	Tue Jul 23 09:10:11 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: literal.c,v 1.4 2019/07/23 10:18:52 christos Exp $	*/
+/*	$NetBSD: literal.c,v 1.5 2019/07/23 13:10:11 christos Exp $	*/
 
 /*-
  * Copyright (c) 2017 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include "config.h"
 #if !defined(lint) && !defined(SCCSID)
-__RCSID("$NetBSD: literal.c,v 1.4 2019/07/23 10:18:52 christos Exp $");
+__RCSID("$NetBSD: literal.c,v 1.5 2019/07/23 13:10:11 christos Exp $");
 #endif /* not lint && not SCCSID */
 
 /*
@@ -97,7 +97,7 @@ literal_add(EditLine *el, const wchar_t 
 	if (b == NULL)
 		return 0;
 
-	for (n = 0, i = 0; i < len; i++) {
+	for (n = 0, i = 0; i < len; i++)
 		n += ct_encode_char(b + n, (size_t)(w - n), buf[i]);
 	n += ct_encode_char(b + n, (size_t)(w - n), end[1]);
 	b[n] = '\0';



CVS commit: src/lib/libedit

2019-07-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Jul 23 13:10:12 UTC 2019

Modified Files:
src/lib/libedit: literal.c

Log Message:
remove stray brace


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/lib/libedit/literal.c

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



CVS commit: src/usr.sbin/sysinst

2019-07-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Jul 23 12:37:23 UTC 2019

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

Log Message:
Avoid a buffer overrun with too many interfaces.


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/usr.sbin/sysinst/net.c

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



CVS commit: src/usr.sbin/sysinst

2019-07-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Jul 23 12:37:23 UTC 2019

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

Log Message:
Avoid a buffer overrun with too many interfaces.


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/usr.sbin/sysinst/net.c

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

Modified files:

Index: src/usr.sbin/sysinst/net.c
diff -u src/usr.sbin/sysinst/net.c:1.32 src/usr.sbin/sysinst/net.c:1.33
--- src/usr.sbin/sysinst/net.c:1.32	Mon Jul  8 19:46:57 2019
+++ src/usr.sbin/sysinst/net.c	Tue Jul 23 12:37:23 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: net.c,v 1.32 2019/07/08 19:46:57 martin Exp $	*/
+/*	$NetBSD: net.c,v 1.33 2019/07/23 12:37:23 martin Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -260,7 +260,8 @@ get_ifconfig_info(struct net_desc *devs)
 		strlcpy (devs[i].if_dev, buf, STRSIZE);
 		i++;
 	}
-	strcpy(devs[i].if_dev, "\0");
+	if (i < MAX_NETS)
+		devs[i].if_dev[0] = 0;	/* XXX ? */
 
 	free(buf);
 	free(buf_in);



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

2019-07-23 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Tue Jul 23 12:34:48 UTC 2019

Modified Files:
src/sys/arch/arm/vexpress: vexpress_platform.c

Log Message:
No need for console=fb handling with WSDISPLAY_MULTICONS


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/arm/vexpress/vexpress_platform.c

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

Modified files:

Index: src/sys/arch/arm/vexpress/vexpress_platform.c
diff -u src/sys/arch/arm/vexpress/vexpress_platform.c:1.14 src/sys/arch/arm/vexpress/vexpress_platform.c:1.15
--- src/sys/arch/arm/vexpress/vexpress_platform.c:1.14	Thu Jan 31 13:16:31 2019
+++ src/sys/arch/arm/vexpress/vexpress_platform.c	Tue Jul 23 12:34:47 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: vexpress_platform.c,v 1.14 2019/01/31 13:16:31 skrll Exp $ */
+/* $NetBSD: vexpress_platform.c,v 1.15 2019/07/23 12:34:47 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2017 Jared McNeill 
@@ -30,7 +30,7 @@
 #include "opt_console.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vexpress_platform.c,v 1.14 2019/01/31 13:16:31 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vexpress_platform.c,v 1.15 2019/07/23 12:34:47 jmcneill Exp $");
 
 #include 
 #include 
@@ -58,8 +58,6 @@ __KERNEL_RCSID(0, "$NetBSD: vexpress_pla
 
 #include 
 
-#define	VEXPRESS_CLCD_NODE_PATH	\
-	"/smb@800/motherboard/iofpga@3,/clcd@1f"
 #define	VEXPRESS_REF_FREQ	2400
 
 extern struct bus_space armv7_generic_bs_tag;
@@ -188,14 +186,6 @@ vexpress_platform_bootstrap(void)
 #ifdef MULTIPROCESSOR
 	arm_cpu_max = 1 + __SHIFTOUT(armreg_l2ctrl_read(), L2CTRL_NUMCPU);
 #endif
-
-	if (match_bootconf_option(boot_args, "console", "fb")) {
-		void *fdt_data = __UNCONST(fdtbus_get_data());
-		const int chosen_off = fdt_path_offset(fdt_data, "/chosen");
-		if (chosen_off >= 0)
-			fdt_setprop_string(fdt_data, chosen_off, "stdout-path",
-			VEXPRESS_CLCD_NODE_PATH);
-	}
 }
 
 static void



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

2019-07-23 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Tue Jul 23 12:34:48 UTC 2019

Modified Files:
src/sys/arch/arm/vexpress: vexpress_platform.c

Log Message:
No need for console=fb handling with WSDISPLAY_MULTICONS


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/arm/vexpress/vexpress_platform.c

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



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

2019-07-23 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Tue Jul 23 12:34:05 UTC 2019

Modified Files:
src/sys/arch/arm/fdt: plfb_fdt.c

Log Message:
Add support for WSDISPLAY_MULTICONS


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/fdt/plfb_fdt.c

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

Modified files:

Index: src/sys/arch/arm/fdt/plfb_fdt.c
diff -u src/sys/arch/arm/fdt/plfb_fdt.c:1.3 src/sys/arch/arm/fdt/plfb_fdt.c:1.4
--- src/sys/arch/arm/fdt/plfb_fdt.c:1.3	Sat Jul  6 15:53:38 2019
+++ src/sys/arch/arm/fdt/plfb_fdt.c	Tue Jul 23 12:34:05 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: plfb_fdt.c,v 1.3 2019/07/06 15:53:38 jmcneill Exp $ */
+/* $NetBSD: plfb_fdt.c,v 1.4 2019/07/23 12:34:05 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2017 Jared McNeill 
@@ -30,8 +30,10 @@
  * ARM PrimeCell PL111 framebuffer console driver
  */
 
+#include "opt_wsdisplay_compat.h"
+
 #include 
-__KERNEL_RCSID(0, "$NetBSD: plfb_fdt.c,v 1.3 2019/07/06 15:53:38 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: plfb_fdt.c,v 1.4 2019/07/23 12:34:05 jmcneill Exp $");
 
 #include 
 #include 
@@ -171,15 +173,27 @@ plfb_attach(device_t parent, device_t se
 
 	plfb_init(sc);
 
+	aprint_naive("\n");
+	aprint_normal("\n");
+
 	sc->sc_wstype = WSDISPLAY_TYPE_PLFB;
-	prop_dictionary_set_bool(dict, "is_console",
-	phandle == plfb_console_phandle);
+
+#ifdef WSDISPLAY_MULTICONS
+	const bool is_console = true;
+	genfb_cnattach();
+#else
+	const bool is_console = phandle == plfb_console_phandle;
+	if (is_console)
+		aprint_normal_dev(self, "switching to framebuffer console\n");
+#endif
+
+	prop_dictionary_set_bool(dict, "is_console", is_console);
 
 	genfb_init(>sc_gen);
 
 	if (sc->sc_gen.sc_width == 0 ||
 	sc->sc_gen.sc_fbsize == 0) {
-		aprint_normal(": disabled\n");
+		aprint_normal_dev(self, "disabled\n");
 		return;
 	}
 
@@ -189,9 +203,6 @@ plfb_attach(device_t parent, device_t se
 	ops.genfb_ioctl = plfb_ioctl;
 	ops.genfb_mmap = plfb_mmap;
 
-	aprint_naive("\n");
-	aprint_normal("\n");
-
 	genfb_attach(>sc_gen, );
 }
 



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

2019-07-23 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Tue Jul 23 12:34:05 UTC 2019

Modified Files:
src/sys/arch/arm/fdt: plfb_fdt.c

Log Message:
Add support for WSDISPLAY_MULTICONS


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/fdt/plfb_fdt.c

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



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

2019-07-23 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Tue Jul 23 12:32:40 UTC 2019

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

Log Message:
Attach uarts on pass 4, matching GENERIC64


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 src/sys/arch/evbarm/conf/GENERIC

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

Modified files:

Index: src/sys/arch/evbarm/conf/GENERIC
diff -u src/sys/arch/evbarm/conf/GENERIC:1.43 src/sys/arch/evbarm/conf/GENERIC:1.44
--- src/sys/arch/evbarm/conf/GENERIC:1.43	Sun Jul  7 11:58:44 2019
+++ src/sys/arch/evbarm/conf/GENERIC	Tue Jul 23 12:32:40 2019
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: GENERIC,v 1.43 2019/07/07 11:58:44 skrll Exp $
+#	$NetBSD: GENERIC,v 1.44 2019/07/23 12:32:40 jmcneill Exp $
 #
 #	GENERIC ARM (aarch32) kernel
 #
@@ -433,11 +433,11 @@ ukphy*		at mii? phy ?		# generic unknown
 #athn*		at pci? dev ? function ?	# Atheros IEEE 802.11
 
 # UART
-com*		at fdt?			# UART
-exuart*		at fdt?			# SSCOM UART
-plcom*		at fdt?			# ARM PL011 UART
-mesonuart*	at fdt?			# Amlogic Meson UART
-zynquart*	at fdt?			# Cadence UART
+com*		at fdt?	pass 4		# UART
+exuart*		at fdt?	pass 4		# SSCOM UART
+plcom*		at fdt?	pass 4		# ARM PL011 UART
+mesonuart*	at fdt?	pass 4		# Amlogic Meson UART
+zynquart*	at fdt?	pass 4		# Cadence UART
 
 # I2C controllers
 options 	I2C_MAX_ADDR=0xfff



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

2019-07-23 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Tue Jul 23 12:32:40 UTC 2019

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

Log Message:
Attach uarts on pass 4, matching GENERIC64


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 src/sys/arch/evbarm/conf/GENERIC

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



CVS commit: src/sys/dev/pckbport

2019-07-23 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Tue Jul 23 12:28:52 UTC 2019

Modified Files:
src/sys/dev/pckbport: pckbd.c

Log Message:
pckbd_cngetc: Set type=0 and return if no data is available


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/dev/pckbport/pckbd.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/pckbd.c
diff -u src/sys/dev/pckbport/pckbd.c:1.33 src/sys/dev/pckbport/pckbd.c:1.34
--- src/sys/dev/pckbport/pckbd.c:1.33	Sun Jun 11 03:55:56 2017
+++ src/sys/dev/pckbport/pckbd.c	Tue Jul 23 12:28:52 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: pckbd.c,v 1.33 2017/06/11 03:55:56 nat Exp $ */
+/* $NetBSD: pckbd.c,v 1.34 2019/07/23 12:28:52 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 1998, 2009 The NetBSD Foundation, Inc.
@@ -68,7 +68,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pckbd.c,v 1.33 2017/06/11 03:55:56 nat Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pckbd.c,v 1.34 2019/07/23 12:28:52 jmcneill Exp $");
 
 #include 
 #include 
@@ -1094,8 +1094,11 @@ pckbd_cngetc(void *v, u_int *type, int *
 
 	for (;;) {
 		val = pckbport_poll_data(t->t_kbctag, t->t_kbcslot);
-		if (val == -1)
-			continue;
+		if (val == -1) {
+			*type = 0;
+			*data = 0;
+			return;
+		}
 
 		val = pckbd_scancode_translate(t, val);
 		if (val == 0)



CVS commit: src/sys/dev/pckbport

2019-07-23 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Tue Jul 23 12:28:52 UTC 2019

Modified Files:
src/sys/dev/pckbport: pckbd.c

Log Message:
pckbd_cngetc: Set type=0 and return if no data is available


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

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



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

2019-07-23 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Jul 23 12:13:47 UTC 2019

Modified Files:
src/sys/arch/evbarm/dev: plcom.c

Log Message:
Don't busy wait for a character in plcom_common_getc, but instead
return -1 if there are no characters available.

Fixes WSDISPLAY_MULTICONS for RaspberryPI and GENERIC.

Thanks to jmcneill@ for the hint


To generate a diff of this commit:
cvs rdiff -u -r1.57 -r1.58 src/sys/arch/evbarm/dev/plcom.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/evbarm/dev/plcom.c
diff -u src/sys/arch/evbarm/dev/plcom.c:1.57 src/sys/arch/evbarm/dev/plcom.c:1.58
--- src/sys/arch/evbarm/dev/plcom.c:1.57	Tue Jul 23 12:10:38 2019
+++ src/sys/arch/evbarm/dev/plcom.c	Tue Jul 23 12:13:47 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: plcom.c,v 1.57 2019/07/23 12:10:38 skrll Exp $	*/
+/*	$NetBSD: plcom.c,v 1.58 2019/07/23 12:13:47 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2001 ARM Ltd
@@ -94,7 +94,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: plcom.c,v 1.57 2019/07/23 12:10:38 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: plcom.c,v 1.58 2019/07/23 12:13:47 skrll Exp $");
 
 #include "opt_plcom.h"
 #include "opt_ddb.h"
@@ -2275,7 +2275,7 @@ int
 plcom_common_getc(dev_t dev, struct plcom_instance *pi)
 {
 	int s = splserial();
-	u_char stat, c;
+	u_char c;
 
 	/* got a character from reading things earlier */
 	if (plcom_readaheadcount > 0) {
@@ -2290,9 +2290,10 @@ plcom_common_getc(dev_t dev, struct plco
 		return c;
 	}
 
-	/* block until a character becomes available */
-	while (ISSET(stat = PREAD1(pi, PL01XCOM_FR), PL01X_FR_RXFE))
-		;
+	if (ISSET(PREAD1(pi, PL01XCOM_FR), PL01X_FR_RXFE)) {
+		splx(s);
+		return -1;
+	}
 
 	c = PREAD1(pi, PL01XCOM_DR);
 	{



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

2019-07-23 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Jul 23 12:13:47 UTC 2019

Modified Files:
src/sys/arch/evbarm/dev: plcom.c

Log Message:
Don't busy wait for a character in plcom_common_getc, but instead
return -1 if there are no characters available.

Fixes WSDISPLAY_MULTICONS for RaspberryPI and GENERIC.

Thanks to jmcneill@ for the hint


To generate a diff of this commit:
cvs rdiff -u -r1.57 -r1.58 src/sys/arch/evbarm/dev/plcom.c

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



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

2019-07-23 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Jul 23 12:10:38 UTC 2019

Modified Files:
src/sys/arch/evbarm/dev: plcom.c

Log Message:
Trailing whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.56 -r1.57 src/sys/arch/evbarm/dev/plcom.c

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



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

2019-07-23 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Jul 23 12:10:38 UTC 2019

Modified Files:
src/sys/arch/evbarm/dev: plcom.c

Log Message:
Trailing whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.56 -r1.57 src/sys/arch/evbarm/dev/plcom.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/evbarm/dev/plcom.c
diff -u src/sys/arch/evbarm/dev/plcom.c:1.56 src/sys/arch/evbarm/dev/plcom.c:1.57
--- src/sys/arch/evbarm/dev/plcom.c:1.56	Tue Oct 23 09:15:36 2018
+++ src/sys/arch/evbarm/dev/plcom.c	Tue Jul 23 12:10:38 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: plcom.c,v 1.56 2018/10/23 09:15:36 jmcneill Exp $	*/
+/*	$NetBSD: plcom.c,v 1.57 2019/07/23 12:10:38 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2001 ARM Ltd
@@ -94,7 +94,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: plcom.c,v 1.56 2018/10/23 09:15:36 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: plcom.c,v 1.57 2019/07/23 12:10:38 skrll Exp $");
 
 #include "opt_plcom.h"
 #include "opt_ddb.h"
@@ -2520,7 +2520,7 @@ plcom_is_console(bus_space_tag_t iot, bu
 #ifdef KGDB
 	else if (!plcom_kgdb_attached &&
 	bus_space_is_equal(iot, plcomkgdb_info.pi_iot) &&
-	iobase == plcomkgdb_info.pi_iobase) 
+	iobase == plcomkgdb_info.pi_iobase)
 		help = plcomkgdb_info.pi_ioh;
 #endif
 	else



CVS commit: xsrc/external/mit/xf86-video-wsfb/dist/src

2019-07-23 Thread Rin Okuyama
Module Name:xsrc
Committed By:   rin
Date:   Tue Jul 23 12:01:53 UTC 2019

Modified Files:
xsrc/external/mit/xf86-video-wsfb/dist/src: wsfb_driver.c

Log Message:
Correctly support the case of fbi->fbi_fboffset != 0, which means base
address of framebuffer is not page-aligned:

- When mmap framebuffer, fbi->fbi_fboffset is added to the length of
  framebuffer. Otherwise, the last page of framebuffer is not mapped
  properly if (size of framebuffer) <= (page boundary) < (size of
  framebuffer + fbi->fbi_fboffset), since length of mapped area is
  counted from page-truncated address. This results in memory
  corruption in the upper adjacent page, or SEGV.

- Use fPtr->fbstart (real base address of framebuffer) instead of
  fPtr->fbmem (return value of mmap, i.e., page-aligned base address)
  where appropriate.

Tested on genfb(4) on Cubietruck, where fbi->fbi_fboffset = 4096.

No functional changes for majority of framebuffer drivers, whose base
address is page-aligned.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 \
xsrc/external/mit/xf86-video-wsfb/dist/src/wsfb_driver.c

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

Modified files:

Index: xsrc/external/mit/xf86-video-wsfb/dist/src/wsfb_driver.c
diff -u xsrc/external/mit/xf86-video-wsfb/dist/src/wsfb_driver.c:1.34 xsrc/external/mit/xf86-video-wsfb/dist/src/wsfb_driver.c:1.35
--- xsrc/external/mit/xf86-video-wsfb/dist/src/wsfb_driver.c:1.34	Tue Jul 23 11:40:29 2019
+++ xsrc/external/mit/xf86-video-wsfb/dist/src/wsfb_driver.c	Tue Jul 23 12:01:53 2019
@@ -505,10 +505,21 @@ WsfbPreInit(ScrnInfoPtr pScrn, int flags
 		}
 		fbi->fbi_flags = 0;
 		fbi->fbi_fbsize = lb * info.height;
-		fbi->fbi_fboffset = 0;
-
+#ifdef	WSDISPLAY_TYPE_LUNA
+		if (wstype == WSDISPLAY_TYPE_LUNA) {
+			/*
+			 * XXX
+			 * LUNA's FB seems to have 64 dot (8 byte) offset.
+			 * This might be able to be changed in kernel
+			 * lunafb driver, but current setting was pulled
+			 * from 4.4BSD-Lite2/luna68k.
+			 */
+			fbi->fbi_fboffset = 8;
+		} else
+#endif
+			fbi->fbi_fboffset = 0;
 	}
-	xf86Msg(X_INFO, "fboffset %x\n", fPtr->fbi.fbi_fboffset);
+	xf86Msg(X_INFO, "fboffset %x\n", (int)fPtr->fbi.fbi_fboffset);
 	/*
 	 * Allocate room for saving the colormap.
 	 */
@@ -927,7 +938,7 @@ WsfbScreenInit(SCREEN_INIT_ARGS_DECL)
 		return FALSE;
 	}
 	len = max(len, fPtr->fbi.fbi_fbsize);
-	fPtr->fbmem = wsfb_mmap(len, 0, fPtr->fd);
+	fPtr->fbmem = wsfb_mmap(len + fPtr->fbi.fbi_fboffset, 0, fPtr->fd);
 
 	if (fPtr->fbmem == NULL) {
 		xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
@@ -966,17 +977,6 @@ WsfbScreenInit(SCREEN_INIT_ARGS_DECL)
 	}
 
 	fPtr->fbstart = fPtr->fbmem + fPtr->fbi.fbi_fboffset;
-#ifdef	WSDISPLAY_TYPE_LUNA
-	if (wstype == WSDISPLAY_TYPE_LUNA) {
-		/*
-		 * XXX
-		 * LUNA's FB seems to have 64 dot (8 byte) offset.
-		 * This might be able to be changed in kernel lunafb driver,
-		 * but current setting was pulled from 4.4BSD-Lite2/luna68k.
-		 */
-		fPtr->fbstart += 8;
-	}
-#endif
 
 	if (fPtr->shadowFB) {
 		fPtr->shadow = calloc(1, fPtr->fbi.fbi_stride * pScrn->virtualY);
@@ -1163,7 +1163,7 @@ WsfbCloseScreen(CLOSE_SCREEN_ARGS_DECL)
 
 	if (pScrn->vtSema) {
 		WsfbRestore(pScrn);
-		if (munmap(fPtr->fbmem, fPtr->fbmem_len) == -1) {
+		if (munmap(fPtr->fbmem, fPtr->fbmem_len + fPtr->fbi.fbi_fboffset) == -1) {
 			xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
    "munmap: %s\n", strerror(errno));
 		}
@@ -1203,7 +1203,7 @@ WsfbWindowLinear(ScreenPtr pScreen, CARD
 			return NULL;
 		fPtr->fbi.fbi_stride = *size;
 	}
-	return ((CARD8 *)fPtr->fbmem + row * fPtr->fbi.fbi_stride + offset);
+	return ((CARD8 *)fPtr->fbstart + row * fPtr->fbi.fbi_stride + offset);
 }
 
 static void
@@ -1448,7 +1448,7 @@ WsfbRestore(ScrnInfoPtr pScrn)
 	}
 
 	/* Clear the screen. */
-	memset(fPtr->fbmem, 0, fPtr->fbmem_len);
+	memset(fPtr->fbstart, 0, fPtr->fbmem_len);
 
 	/* Restore the text mode. */
 	mode = WSDISPLAYIO_MODE_EMUL;



CVS commit: xsrc/external/mit/xf86-video-wsfb/dist/src

2019-07-23 Thread Rin Okuyama
Module Name:xsrc
Committed By:   rin
Date:   Tue Jul 23 12:01:53 UTC 2019

Modified Files:
xsrc/external/mit/xf86-video-wsfb/dist/src: wsfb_driver.c

Log Message:
Correctly support the case of fbi->fbi_fboffset != 0, which means base
address of framebuffer is not page-aligned:

- When mmap framebuffer, fbi->fbi_fboffset is added to the length of
  framebuffer. Otherwise, the last page of framebuffer is not mapped
  properly if (size of framebuffer) <= (page boundary) < (size of
  framebuffer + fbi->fbi_fboffset), since length of mapped area is
  counted from page-truncated address. This results in memory
  corruption in the upper adjacent page, or SEGV.

- Use fPtr->fbstart (real base address of framebuffer) instead of
  fPtr->fbmem (return value of mmap, i.e., page-aligned base address)
  where appropriate.

Tested on genfb(4) on Cubietruck, where fbi->fbi_fboffset = 4096.

No functional changes for majority of framebuffer drivers, whose base
address is page-aligned.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 \
xsrc/external/mit/xf86-video-wsfb/dist/src/wsfb_driver.c

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



CVS commit: xsrc/external/mit/xf86-video-wsfb/dist/src

2019-07-23 Thread Rin Okuyama
Module Name:xsrc
Committed By:   rin
Date:   Tue Jul 23 11:40:29 UTC 2019

Modified Files:
xsrc/external/mit/xf86-video-wsfb/dist/src: wsfb_driver.c

Log Message:
Add support for 15-bpp framebuffer.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 \
xsrc/external/mit/xf86-video-wsfb/dist/src/wsfb_driver.c

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

Modified files:

Index: xsrc/external/mit/xf86-video-wsfb/dist/src/wsfb_driver.c
diff -u xsrc/external/mit/xf86-video-wsfb/dist/src/wsfb_driver.c:1.33 xsrc/external/mit/xf86-video-wsfb/dist/src/wsfb_driver.c:1.34
--- xsrc/external/mit/xf86-video-wsfb/dist/src/wsfb_driver.c:1.33	Sun Feb  3 17:11:49 2019
+++ xsrc/external/mit/xf86-video-wsfb/dist/src/wsfb_driver.c	Tue Jul 23 11:40:29 2019
@@ -545,7 +545,7 @@ WsfbPreInit(ScrnInfoPtr pScrn, int flags
 
 	/* Handle depth */
 	default_depth = fPtr->fbi.fbi_bitsperpixel <= 24 ? fPtr->fbi.fbi_bitsperpixel : 24;
-	bitsperpixel = fPtr->fbi.fbi_bitsperpixel;
+	bitsperpixel = fPtr->fbi.fbi_bitsperpixel == 15 ? 16 : fPtr->fbi.fbi_bitsperpixel;
 #if defined(__NetBSD__) && defined(WSDISPLAY_TYPE_LUNA)
 	if (wstype == WSDISPLAY_TYPE_LUNA) {
 		/*
@@ -882,6 +882,7 @@ WsfbScreenInit(SCREEN_INIT_ARGS_DECL)
 	case 8:
 		len = fPtr->fbi.fbi_stride * fPtr->fbi.fbi_height;
 		break;
+	case 15:
 	case 16:
 		if (fPtr->fbi.fbi_stride == fPtr->fbi.fbi_width) {
 			xf86Msg(X_ERROR, "Bogus stride == width in 16bit colour\n");



CVS commit: xsrc/external/mit/xf86-video-wsfb/dist/src

2019-07-23 Thread Rin Okuyama
Module Name:xsrc
Committed By:   rin
Date:   Tue Jul 23 11:40:29 UTC 2019

Modified Files:
xsrc/external/mit/xf86-video-wsfb/dist/src: wsfb_driver.c

Log Message:
Add support for 15-bpp framebuffer.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 \
xsrc/external/mit/xf86-video-wsfb/dist/src/wsfb_driver.c

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



CVS commit: src/games/fortune/fortune

2019-07-23 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Tue Jul 23 11:02:29 UTC 2019

Modified Files:
src/games/fortune/fortune: fortune.6

Log Message:
Use .Dl for displays with single command.  Specify .Bl -width with the
same formatting as the actual tags.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/games/fortune/fortune/fortune.6

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

Modified files:

Index: src/games/fortune/fortune/fortune.6
diff -u src/games/fortune/fortune/fortune.6:1.16 src/games/fortune/fortune/fortune.6:1.17
--- src/games/fortune/fortune/fortune.6:1.16	Tue Jul 23 10:40:55 2019
+++ src/games/fortune/fortune/fortune.6	Tue Jul 23 11:02:29 2019
@@ -1,4 +1,4 @@
-.\"	$NetBSD: fortune.6,v 1.16 2019/07/23 10:40:55 uwe Exp $
+.\"	$NetBSD: fortune.6,v 1.17 2019/07/23 11:02:29 uwe Exp $
 .\"
 .\" Copyright (c) 1985, 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -54,7 +54,7 @@ Epigrams are divided into several catego
 is subdivided into those which are potentially offensive and those
 which are not.
 The options are as follows:
-.Bl -tag -width flag
+.Bl -tag -width ".Fl XXX"
 .It Fl a
 Choose from all lists of maxims, both offensive and not.
 (See the
@@ -133,17 +133,15 @@ and
 with
 .Ar funny
 twice as big, saying
-.Bd -literal -offset indent
-$ fortune funny not-funny
-.Ed
+.Pp
+.Dl $ fortune funny not-funny
 .Pp
 will get you fortunes out of
 .Ar funny
 two-thirds of the time.
 The command
-.Bd -literal -offset indent
-$ fortune 90% funny 10% not-funny
-.Ed
+.Pp
+.Dl $ fortune 90% funny 10% not-funny
 .Pp
 will pick out 90% of its fortunes from
 .Ar funny
@@ -153,14 +151,12 @@ is unnecessary, since 10% is all that's 
 The
 .Fl e
 option says to consider all files equal; thus
-.Bd -literal -offset indent
-$ fortune -e
-.Ed
+.Pp
+.Dl $ fortune -e
 .Pp
 is equivalent to
-.Bd -literal -offset indent
-$ fortune 50% funny 50% not-funny
-.Ed
+.Pp
+.Dl $ fortune 50% funny 50% not-funny
 .Pp
 Datafiles for
 .Nm
@@ -168,7 +164,7 @@ are created by the
 .Xr strfile 8
 utility.
 .Sh FILES
-.Bl -tag -width XX/usr/share/games/fortune/*XX -compact
+.Bl -tag -width ".Pa /usr/share/games/fortune/" -compact
 .It Pa /usr/share/games/fortune/*
 Fortune files.
 .El



CVS commit: src/games/fortune/fortune

2019-07-23 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Tue Jul 23 11:02:29 UTC 2019

Modified Files:
src/games/fortune/fortune: fortune.6

Log Message:
Use .Dl for displays with single command.  Specify .Bl -width with the
same formatting as the actual tags.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/games/fortune/fortune/fortune.6

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



CVS commit: src/games/fortune/fortune

2019-07-23 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Tue Jul 23 10:40:56 UTC 2019

Modified Files:
src/games/fortune/fortune: fortune.6

Log Message:
strfile is installed, don't claim it isn't.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/games/fortune/fortune/fortune.6

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



CVS commit: src/games/fortune/fortune

2019-07-23 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Tue Jul 23 10:40:56 UTC 2019

Modified Files:
src/games/fortune/fortune: fortune.6

Log Message:
strfile is installed, don't claim it isn't.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/games/fortune/fortune/fortune.6

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

Modified files:

Index: src/games/fortune/fortune/fortune.6
diff -u src/games/fortune/fortune/fortune.6:1.15 src/games/fortune/fortune/fortune.6:1.16
--- src/games/fortune/fortune/fortune.6:1.15	Tue Jul 23 09:50:27 2019
+++ src/games/fortune/fortune/fortune.6	Tue Jul 23 10:40:55 2019
@@ -1,4 +1,4 @@
-.\"	$NetBSD: fortune.6,v 1.15 2019/07/23 09:50:27 uwe Exp $
+.\"	$NetBSD: fortune.6,v 1.16 2019/07/23 10:40:55 uwe Exp $
 .\"
 .\" Copyright (c) 1985, 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -166,11 +166,7 @@ Datafiles for
 .Nm
 are created by the
 .Xr strfile 8
-utility, which is not installed by default,
-The source code for this utility
-can be found in
-.Pa /usr/src/games/fortune/strfile ,
-if it exists.
+utility.
 .Sh FILES
 .Bl -tag -width XX/usr/share/games/fortune/*XX -compact
 .It Pa /usr/share/games/fortune/*



CVS commit: src/lib/libedit

2019-07-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Jul 23 10:19:35 UTC 2019

Modified Files:
src/lib/libedit: hist.c

Log Message:
put the NULL check immediately after the allocation


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/lib/libedit/hist.c

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

Modified files:

Index: src/lib/libedit/hist.c
diff -u src/lib/libedit/hist.c:1.33 src/lib/libedit/hist.c:1.34
--- src/lib/libedit/hist.c:1.33	Tue Jul 23 06:18:52 2019
+++ src/lib/libedit/hist.c	Tue Jul 23 06:19:35 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: hist.c,v 1.33 2019/07/23 10:18:52 christos Exp $	*/
+/*	$NetBSD: hist.c,v 1.34 2019/07/23 10:19:35 christos Exp $	*/
 
 /*-
  * Copyright (c) 1992, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)hist.c	8.1 (Berkeley) 6/4/93";
 #else
-__RCSID("$NetBSD: hist.c,v 1.33 2019/07/23 10:18:52 christos Exp $");
+__RCSID("$NetBSD: hist.c,v 1.34 2019/07/23 10:19:35 christos Exp $");
 #endif
 #endif /* not lint && not SCCSID */
 
@@ -60,9 +60,9 @@ hist_init(EditLine *el)
 	el->el_history.fun = NULL;
 	el->el_history.ref = NULL;
 	el->el_history.buf = el_calloc(EL_BUFSIZ, sizeof(*el->el_history.buf));
-	el->el_history.sz  = EL_BUFSIZ;
 	if (el->el_history.buf == NULL)
 		return -1;
+	el->el_history.sz  = EL_BUFSIZ;
 	el->el_history.last = el->el_history.buf;
 	return 0;
 }



CVS commit: src/lib/libedit

2019-07-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Jul 23 10:19:35 UTC 2019

Modified Files:
src/lib/libedit: hist.c

Log Message:
put the NULL check immediately after the allocation


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/lib/libedit/hist.c

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



CVS commit: src/lib/libedit

2019-07-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Jul 23 10:18:52 UTC 2019

Modified Files:
src/lib/libedit: chared.c chartype.c el.c el.h filecomplete.c hist.c
keymacro.c literal.c map.c parse.c read.c readline.c search.c
terminal.c vi.c

Log Message:
PR/54399: S�ren Tempel: Uninitialized memory access in libedit history.
Initialize the buffer using calloc. While here change all malloc(a * sizeof(b))
to calloc(a, sizeof(b)). XXX: should fix realloc similarly.


To generate a diff of this commit:
cvs rdiff -u -r1.58 -r1.59 src/lib/libedit/chared.c
cvs rdiff -u -r1.34 -r1.35 src/lib/libedit/chartype.c
cvs rdiff -u -r1.98 -r1.99 src/lib/libedit/el.c
cvs rdiff -u -r1.44 -r1.45 src/lib/libedit/el.h
cvs rdiff -u -r1.55 -r1.56 src/lib/libedit/filecomplete.c
cvs rdiff -u -r1.32 -r1.33 src/lib/libedit/hist.c
cvs rdiff -u -r1.23 -r1.24 src/lib/libedit/keymacro.c
cvs rdiff -u -r1.3 -r1.4 src/lib/libedit/literal.c
cvs rdiff -u -r1.51 -r1.52 src/lib/libedit/map.c
cvs rdiff -u -r1.41 -r1.42 src/lib/libedit/parse.c
cvs rdiff -u -r1.105 -r1.106 src/lib/libedit/read.c
cvs rdiff -u -r1.155 -r1.156 src/lib/libedit/readline.c
cvs rdiff -u -r1.48 -r1.49 src/lib/libedit/search.c
cvs rdiff -u -r1.38 -r1.39 src/lib/libedit/terminal.c
cvs rdiff -u -r1.62 -r1.63 src/lib/libedit/vi.c

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

Modified files:

Index: src/lib/libedit/chared.c
diff -u src/lib/libedit/chared.c:1.58 src/lib/libedit/chared.c:1.59
--- src/lib/libedit/chared.c:1.58	Tue Jul 23 05:47:16 2019
+++ src/lib/libedit/chared.c	Tue Jul 23 06:18:52 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: chared.c,v 1.58 2019/07/23 09:47:16 christos Exp $	*/
+/*	$NetBSD: chared.c,v 1.59 2019/07/23 10:18:52 christos Exp $	*/
 
 /*-
  * Copyright (c) 1992, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)chared.c	8.1 (Berkeley) 6/4/93";
 #else
-__RCSID("$NetBSD: chared.c,v 1.58 2019/07/23 09:47:16 christos Exp $");
+__RCSID("$NetBSD: chared.c,v 1.59 2019/07/23 10:18:52 christos Exp $");
 #endif
 #endif /* not lint && not SCCSID */
 
@@ -396,26 +396,22 @@ cv__endword(wchar_t *p, wchar_t *high, i
 libedit_private int
 ch_init(EditLine *el)
 {
-	el->el_line.buffer		= el_malloc(EL_BUFSIZ *
+	el->el_line.buffer		= el_calloc(EL_BUFSIZ,
 	sizeof(*el->el_line.buffer));
 	if (el->el_line.buffer == NULL)
 		return -1;
 
-	(void) memset(el->el_line.buffer, 0, EL_BUFSIZ *
-	sizeof(*el->el_line.buffer));
 	el->el_line.cursor		= el->el_line.buffer;
 	el->el_line.lastchar		= el->el_line.buffer;
 	el->el_line.limit		= >el_line.buffer[EL_BUFSIZ - EL_LEAVE];
 
-	el->el_chared.c_undo.buf	= el_malloc(EL_BUFSIZ *
+	el->el_chared.c_undo.buf	= el_calloc(EL_BUFSIZ,
 	sizeof(*el->el_chared.c_undo.buf));
 	if (el->el_chared.c_undo.buf == NULL)
 		return -1;
-	(void) memset(el->el_chared.c_undo.buf, 0, EL_BUFSIZ *
-	sizeof(*el->el_chared.c_undo.buf));
 	el->el_chared.c_undo.len	= -1;
 	el->el_chared.c_undo.cursor	= 0;
-	el->el_chared.c_redo.buf	= el_malloc(EL_BUFSIZ *
+	el->el_chared.c_redo.buf	= el_calloc(EL_BUFSIZ,
 	sizeof(*el->el_chared.c_redo.buf));
 	if (el->el_chared.c_redo.buf == NULL)
 		return -1;
@@ -426,12 +422,10 @@ ch_init(EditLine *el)
 	el->el_chared.c_vcmd.action	= NOP;
 	el->el_chared.c_vcmd.pos	= el->el_line.buffer;
 
-	el->el_chared.c_kill.buf	= el_malloc(EL_BUFSIZ *
+	el->el_chared.c_kill.buf	= el_calloc(EL_BUFSIZ,
 	sizeof(*el->el_chared.c_kill.buf));
 	if (el->el_chared.c_kill.buf == NULL)
 		return -1;
-	(void) memset(el->el_chared.c_kill.buf, 0, EL_BUFSIZ *
-	sizeof(*el->el_chared.c_kill.buf));
 	el->el_chared.c_kill.mark	= el->el_line.buffer;
 	el->el_chared.c_kill.last	= el->el_chared.c_kill.buf;
 	el->el_chared.c_resizefun	= NULL;

Index: src/lib/libedit/chartype.c
diff -u src/lib/libedit/chartype.c:1.34 src/lib/libedit/chartype.c:1.35
--- src/lib/libedit/chartype.c:1.34	Sun Nov 25 11:20:28 2018
+++ src/lib/libedit/chartype.c	Tue Jul 23 06:18:52 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: chartype.c,v 1.34 2018/11/25 16:20:28 christos Exp $	*/
+/*	$NetBSD: chartype.c,v 1.35 2019/07/23 10:18:52 christos Exp $	*/
 
 /*-
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 #include "config.h"
 #if !defined(lint) && !defined(SCCSID)
-__RCSID("$NetBSD: chartype.c,v 1.34 2018/11/25 16:20:28 christos Exp $");
+__RCSID("$NetBSD: chartype.c,v 1.35 2019/07/23 10:18:52 christos Exp $");
 #endif /* not lint && not SCCSID */
 
 #include 
@@ -157,7 +157,7 @@ ct_decode_argv(int argc, const char *arg
 		if (ct_conv_wbuff_resize(conv, bufspace + CT_BUFSIZ) == -1)
 			return NULL;
 
-	wargv = el_malloc((size_t)(argc + 1) * sizeof(*wargv));
+	wargv = el_calloc((size_t)(argc + 1), sizeof(*wargv));
 
 	for (i = 0, p = conv->wbuff; i < argc; ++i) {
 		if (!argv[i]) {   /* don't pass null pointers to mbstowcs */

Index: src/lib/libedit/el.c
diff -u src/lib/libedit/el.c:1.98 src/lib/libedit/el.c:1.99
--- 

CVS commit: src/lib/libedit

2019-07-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Jul 23 10:18:52 UTC 2019

Modified Files:
src/lib/libedit: chared.c chartype.c el.c el.h filecomplete.c hist.c
keymacro.c literal.c map.c parse.c read.c readline.c search.c
terminal.c vi.c

Log Message:
PR/54399: S�ren Tempel: Uninitialized memory access in libedit history.
Initialize the buffer using calloc. While here change all malloc(a * sizeof(b))
to calloc(a, sizeof(b)). XXX: should fix realloc similarly.


To generate a diff of this commit:
cvs rdiff -u -r1.58 -r1.59 src/lib/libedit/chared.c
cvs rdiff -u -r1.34 -r1.35 src/lib/libedit/chartype.c
cvs rdiff -u -r1.98 -r1.99 src/lib/libedit/el.c
cvs rdiff -u -r1.44 -r1.45 src/lib/libedit/el.h
cvs rdiff -u -r1.55 -r1.56 src/lib/libedit/filecomplete.c
cvs rdiff -u -r1.32 -r1.33 src/lib/libedit/hist.c
cvs rdiff -u -r1.23 -r1.24 src/lib/libedit/keymacro.c
cvs rdiff -u -r1.3 -r1.4 src/lib/libedit/literal.c
cvs rdiff -u -r1.51 -r1.52 src/lib/libedit/map.c
cvs rdiff -u -r1.41 -r1.42 src/lib/libedit/parse.c
cvs rdiff -u -r1.105 -r1.106 src/lib/libedit/read.c
cvs rdiff -u -r1.155 -r1.156 src/lib/libedit/readline.c
cvs rdiff -u -r1.48 -r1.49 src/lib/libedit/search.c
cvs rdiff -u -r1.38 -r1.39 src/lib/libedit/terminal.c
cvs rdiff -u -r1.62 -r1.63 src/lib/libedit/vi.c

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



CVS commit: src/games/fortune/fortune

2019-07-23 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Tue Jul 23 09:50:27 UTC 2019

Modified Files:
src/games/fortune/fortune: fortune.6

Log Message:
Prettify formatting.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/games/fortune/fortune/fortune.6

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

Modified files:

Index: src/games/fortune/fortune/fortune.6
diff -u src/games/fortune/fortune/fortune.6:1.14 src/games/fortune/fortune/fortune.6:1.15
--- src/games/fortune/fortune/fortune.6:1.14	Mon Jul 22 13:37:37 2019
+++ src/games/fortune/fortune/fortune.6	Tue Jul 23 09:50:27 2019
@@ -1,4 +1,4 @@
-.\"	$NetBSD: fortune.6,v 1.14 2019/07/22 13:37:37 sevan Exp $
+.\"	$NetBSD: fortune.6,v 1.15 2019/07/23 09:50:27 uwe Exp $
 .\"
 .\" Copyright (c) 1985, 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -43,8 +43,8 @@
 .Op Fl aefilosw
 .Op Fl m Ar pattern
 .Oo
-.Op Ar N%
-.Ar file/dir/all
+.Op Ar N\^ Ns Cm \&%
+.Ar file\| Ns / Ns Ar dir\| Ns / Ns Cm \^all
 .Oc
 .Sh DESCRIPTION
 When
@@ -110,12 +110,12 @@ to guarantee that the message can be rea
 The user may specify alternative sayings.
 You can specify a specific file, a directory which contains one or
 more files, or the special word
-.Em all ,
+.Cm all ,
 which says to use all the standard databases.
 Any of these may be preceded by a percentage, which is a number
 .Ar N
 between 0 and 100 inclusive, followed by a
-.Sq %
+.Ql %
 character.
 If it is, there will be an
 .Ar N
@@ -127,18 +127,18 @@ and/or directories, in which case the pr
 one of them will be based on their relative sizes.
 .Pp
 As an example, given two databases
-.Em funny
+.Ar funny
 and
-.Em not-funny ,
+.Ar not-funny ,
 with
-.Em funny
+.Ar funny
 twice as big, saying
 .Bd -literal -offset indent
 $ fortune funny not-funny
 .Ed
 .Pp
 will get you fortunes out of
-.Em funny
+.Ar funny
 two-thirds of the time.
 The command
 .Bd -literal -offset indent
@@ -146,9 +146,9 @@ $ fortune 90% funny 10% not-funny
 .Ed
 .Pp
 will pick out 90% of its fortunes from
-.Em funny
+.Ar funny
 (the
-.Dq 10%
+.Ql 10%
 is unnecessary, since 10% is all that's left).
 The
 .Fl e



CVS commit: src/games/fortune/fortune

2019-07-23 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Tue Jul 23 09:50:27 UTC 2019

Modified Files:
src/games/fortune/fortune: fortune.6

Log Message:
Prettify formatting.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/games/fortune/fortune/fortune.6

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



CVS commit: src/sys/dev/pci

2019-07-23 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Jul 23 09:37:09 UTC 2019

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

Log Message:
 Define RETA_ENTRY_MASK_Q(used in RSS redirection table) correctly.
Found by UBSan.


To generate a diff of this commit:
cvs rdiff -u -r1.114 -r1.115 src/sys/dev/pci/if_wmreg.h

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



CVS commit: src/sys/dev/pci

2019-07-23 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Jul 23 09:37:09 UTC 2019

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

Log Message:
 Define RETA_ENTRY_MASK_Q(used in RSS redirection table) correctly.
Found by UBSan.


To generate a diff of this commit:
cvs rdiff -u -r1.114 -r1.115 src/sys/dev/pci/if_wmreg.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_wmreg.h
diff -u src/sys/dev/pci/if_wmreg.h:1.114 src/sys/dev/pci/if_wmreg.h:1.115
--- src/sys/dev/pci/if_wmreg.h:1.114	Fri Jun  7 04:39:15 2019
+++ src/sys/dev/pci/if_wmreg.h	Tue Jul 23 09:37:08 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wmreg.h,v 1.114 2019/06/07 04:39:15 msaitoh Exp $	*/
+/*	$NetBSD: if_wmreg.h,v 1.115 2019/07/23 09:37:08 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -1270,7 +1270,7 @@ struct livengood_tcpip_ctxdesc {
 
 #define WMREG_RETA_Q(x)		(0x5c00 + ((x) >> 2) * 4) /* Redirection Table */
 #define RETA_NUM_ENTRIES	128
-#define RETA_ENTRY_MASK_Q(x)	(0x00ff << (((x) % 4) * 8)) /* Redirection Table */
+#define RETA_ENTRY_MASK_Q(x)	(0x00ffUL << (((x) % 4) * 8)) /* Redirection Table */
 #define RETA_ENT_QINDEX_MASK		__BITS(3,0) /*queue index for 82580 and newer */
 #define RETA_ENT_QINDEX0_MASK_82575	__BITS(3,2) /*queue index for pool0 */
 #define RETA_ENT_QINDEX1_MASK_82575	__BITS(7,6) /*queue index for pool1 and regular RSS */



CVS commit: src/external/cddl/osnet/dev/dtrace

2019-07-23 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Tue Jul 23 09:06:12 UTC 2019

Modified Files:
src/external/cddl/osnet/dev/dtrace: dtrace_load.c

Log Message:
Create "dtrace_taskq" here like FreeBSD does.

PR kern/54397: Panic when loading a DTrace module whilst DTrace is running


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/cddl/osnet/dev/dtrace/dtrace_load.c

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

Modified files:

Index: src/external/cddl/osnet/dev/dtrace/dtrace_load.c
diff -u src/external/cddl/osnet/dev/dtrace/dtrace_load.c:1.4 src/external/cddl/osnet/dev/dtrace/dtrace_load.c:1.5
--- src/external/cddl/osnet/dev/dtrace/dtrace_load.c:1.4	Mon May 28 21:05:03 2018
+++ src/external/cddl/osnet/dev/dtrace/dtrace_load.c	Tue Jul 23 09:06:12 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: dtrace_load.c,v 1.4 2018/05/28 21:05:03 chs Exp $	*/
+/*	$NetBSD: dtrace_load.c,v 1.5 2019/07/23 09:06:12 hannken Exp $	*/
 
 /*
  * CDDL HEADER START
@@ -88,9 +88,9 @@ dtrace_load(void *dummy)
 	/* Hang our hook for exceptions. */
 	dtrace_invop_init();
 
-#ifdef __FreeBSD__
 	dtrace_taskq = taskq_create("dtrace_taskq", 1, maxclsyspri, 0, 0, 0);
 
+#ifdef __FreeBSD__
 	dtrace_arena = new_unrhdr(1, INT_MAX, _unr_mtx);
 
 	/* Register callbacks for linker file load and unload events. */



CVS commit: src/external/cddl/osnet/dev/dtrace

2019-07-23 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Tue Jul 23 09:06:12 UTC 2019

Modified Files:
src/external/cddl/osnet/dev/dtrace: dtrace_load.c

Log Message:
Create "dtrace_taskq" here like FreeBSD does.

PR kern/54397: Panic when loading a DTrace module whilst DTrace is running


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/cddl/osnet/dev/dtrace/dtrace_load.c

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



CVS commit: [netbsd-8] src/doc

2019-07-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Jul 23 08:47:43 UTC 2019

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

Log Message:
Ticket #1305


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

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

Modified files:

Index: src/doc/CHANGES-8.2
diff -u src/doc/CHANGES-8.2:1.1.2.11 src/doc/CHANGES-8.2:1.1.2.12
--- src/doc/CHANGES-8.2:1.1.2.11	Mon Jul 22 18:13:23 2019
+++ src/doc/CHANGES-8.2	Tue Jul 23 08:47:43 2019
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-8.2,v 1.1.2.11 2019/07/22 18:13:23 martin Exp $
+# $NetBSD: CHANGES-8.2,v 1.1.2.12 2019/07/23 08:47:43 martin Exp $
 
 A complete list of changes from the NetBSD 8.1 release to the NetBSD 8.2
 release:
@@ -323,3 +323,8 @@ usr.bin/vmstat/vmstat.c1.226
 	Fix "vmstat -m" numbers running into each other.
 	[mrg, ticket #1304]
 
+sys/dev/pckbport/files.pckbport			1.10
+
+	hvkbd requires pckbd_keydesctab in wskbdmap_mfii.c.
+	[nakayama, ticket #1305]
+



CVS commit: [netbsd-8] src/doc

2019-07-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Jul 23 08:47:43 UTC 2019

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

Log Message:
Ticket #1305


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

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



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

2019-07-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Jul 23 08:46:43 UTC 2019

Modified Files:
src/sys/dev/pckbport [netbsd-8]: files.pckbport

Log Message:
Pull up following revision(s) (requested by nakayama in ticket #1305):

sys/dev/pckbport/files.pckbport: revision 1.10

hvkbd requires pckbd_keydesctab in wskbdmap_mfii.c.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.8.46.1 src/sys/dev/pckbport/files.pckbport

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/files.pckbport
diff -u src/sys/dev/pckbport/files.pckbport:1.8 src/sys/dev/pckbport/files.pckbport:1.8.46.1
--- src/sys/dev/pckbport/files.pckbport:1.8	Wed Sep  7 19:05:13 2011
+++ src/sys/dev/pckbport/files.pckbport	Tue Jul 23 08:46:43 2019
@@ -1,4 +1,4 @@
-# $NetBSD: files.pckbport,v 1.8 2011/09/07 19:05:13 jakllsch Exp $
+# $NetBSD: files.pckbport,v 1.8.46.1 2019/07/23 08:46:43 martin Exp $
 # devices attached at pckbport, for use with wscons
 
 defflag	opt_wskbdmap.h			WSKBD_USONLY
@@ -9,7 +9,7 @@ file	dev/pckbport/pckbport.c		pckbport |
 device	pckbd: wskbddev
 attach	pckbd at pckbport
 file	dev/pckbport/pckbd.c		pckbd			needs-flag
-file	dev/pckbport/wskbdmap_mfii.c	pckbd
+file	dev/pckbport/wskbdmap_mfii.c	pckbd | hvkbd
 defparam PCKBD_LAYOUT
 defflag	PCKBD_CNATTACH_MAY_FAIL
 



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

2019-07-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Jul 23 08:46:43 UTC 2019

Modified Files:
src/sys/dev/pckbport [netbsd-8]: files.pckbport

Log Message:
Pull up following revision(s) (requested by nakayama in ticket #1305):

sys/dev/pckbport/files.pckbport: revision 1.10

hvkbd requires pckbd_keydesctab in wskbdmap_mfii.c.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.8.46.1 src/sys/dev/pckbport/files.pckbport

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



CVS commit: src/sys/net/npf

2019-07-23 Thread Mindaugas Rasiukevicius
Module Name:src
Committed By:   rmind
Date:   Tue Jul 23 08:25:52 UTC 2019

Modified Files:
src/sys/net/npf: npf_portmap.c

Log Message:
NPF portmap: add a workaround for archs without 64-bit CAS.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/net/npf/npf_portmap.c

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



CVS commit: src/sys/net/npf

2019-07-23 Thread Mindaugas Rasiukevicius
Module Name:src
Committed By:   rmind
Date:   Tue Jul 23 08:25:52 UTC 2019

Modified Files:
src/sys/net/npf: npf_portmap.c

Log Message:
NPF portmap: add a workaround for archs without 64-bit CAS.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/net/npf/npf_portmap.c

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

Modified files:

Index: src/sys/net/npf/npf_portmap.c
diff -u src/sys/net/npf/npf_portmap.c:1.1 src/sys/net/npf/npf_portmap.c:1.2
--- src/sys/net/npf/npf_portmap.c:1.1	Tue Jul 23 00:52:01 2019
+++ src/sys/net/npf/npf_portmap.c	Tue Jul 23 08:25:52 2019
@@ -35,7 +35,7 @@
 
 #ifdef _KERNEL
 #include 
-__KERNEL_RCSID(0, "$NetBSD: npf_portmap.c,v 1.1 2019/07/23 00:52:01 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: npf_portmap.c,v 1.2 2019/07/23 08:25:52 rmind Exp $");
 
 #include 
 #include 
@@ -106,6 +106,8 @@ typedef struct {
 	int		max_port;
 } npf_portmap_params_t;
 
+static kmutex_t			portmap_lock;
+
 void
 npf_portmap_init(npf_t *npf)
 {
@@ -130,6 +132,8 @@ npf_portmap_init(npf_t *npf)
 	npf->portmap = kmem_zalloc(sizeof(npf_portmap_t), KM_SLEEP);
 	mutex_init(>portmap->list_lock, MUTEX_DEFAULT, IPL_SOFTNET);
 	npf->portmap->addr_map = thmap_create(0, NULL, THMAP_NOCOPY);
+
+	mutex_init(_lock, MUTEX_DEFAULT, IPL_SOFTNET);
 }
 
 void
@@ -146,10 +150,31 @@ npf_portmap_fini(npf_t *npf)
 	thmap_destroy(pm->addr_map);
 	mutex_destroy(>list_lock);
 	kmem_free(pm, sizeof(npf_portmap_t));
+
+	mutex_destroy(_lock);
 }
 
 /
 
+#if defined(_LP64)
+#define	__npf_atomic_cas_64	atomic_cas_64
+#else
+static uint64_t
+__npf_atomic_cas_64(volatile uint64_t *ptr, uint64_t old, uint64_t new)
+{
+	uint64_t prev;
+
+	mutex_enter(_lock);
+	prev = *ptr;
+	if (prev == old) {
+		*ptr = new;
+	}
+	mutex_exit(_lock);
+
+	return prev;
+}
+#endif
+
 /*
  * bitmap_word_isset: test whether the bit value is in the packed array.
  *
@@ -283,7 +308,7 @@ again:
 		 */
 		if ((nval = bitmap_word_cax(bval, -1, chunk_bit)) != 0) {
 			KASSERT((nval & PORTMAP_L1_TAG) == 0);
-			if (atomic_cas_64(>bits0[i], bval, nval) != bval) {
+			if (__npf_atomic_cas_64(>bits0[i], bval, nval) != bval) {
 goto again;
 			}
 			return true;
@@ -315,7 +340,7 @@ again:
 		bm1p = (uintptr_t)bm1;
 		KASSERT((bm1p & PORTMAP_L1_TAG) == 0);
 		bm1p |= PORTMAP_L1_TAG;
-		if (atomic_cas_64(>bits0[i], bval, bm1p) != bval) {
+		if (__npf_atomic_cas_64(>bits0[i], bval, bm1p) != bval) {
 			kmem_intr_free(bm1, sizeof(bitmap_l1_t));
 			goto again;
 		}
@@ -332,7 +357,7 @@ again:
 		return false;
 	}
 	nval = oval | b;
-	if (atomic_cas_64(>bits1[i], oval, nval) != oval) {
+	if (__npf_atomic_cas_64(>bits1[i], oval, nval) != oval) {
 		goto again;
 	}
 	return true;
@@ -356,7 +381,7 @@ again:
 		}
 		nval = bitmap_word_cax(bval, chunk_bit, chunk_bit);
 		KASSERT((nval & PORTMAP_L1_TAG) == 0);
-		if (atomic_cas_64(>bits0[i], bval, nval) != bval) {
+		if (__npf_atomic_cas_64(>bits0[i], bval, nval) != bval) {
 			goto again;
 		}
 		return true;
@@ -372,7 +397,7 @@ again:
 		return false;
 	}
 	nval = oval & ~b;
-	if (atomic_cas_64(>bits1[i], oval, nval) != oval) {
+	if (__npf_atomic_cas_64(>bits1[i], oval, nval) != oval) {
 		goto again;
 	}
 	return true;



CVS commit: src/sys/arch/mac68k

2019-07-23 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Tue Jul 23 07:52:53 UTC 2019

Modified Files:
src/sys/arch/mac68k/include: bus.h
src/sys/arch/mac68k/obio: esp.c espvar.h

Log Message:
PR port-mac68k/24883

Style-only changes in preparation to import AV DMA code:

- G/C unused from esp_softc
- clean up headers:
- prefer  over 
- G/C unused
- sort
- staticify private functions and variables
- stop using inline qualifier for functions called via function pointers
- use C99 initializer
- provide bus_space_vaddr(9) and use it, instead of using member of
  bus_handle_t directly
- use uint*_t:
- u_char --> uint8_t
- u_int*_t --> uint*_t
- use proper names from ncr53c9xreg.h instead of magic numbers
- and some KNF, and etc.

No functional changes intended.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/mac68k/include/bus.h
cvs rdiff -u -r1.56 -r1.57 src/sys/arch/mac68k/obio/esp.c
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/mac68k/obio/espvar.h

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

Modified files:

Index: src/sys/arch/mac68k/include/bus.h
diff -u src/sys/arch/mac68k/include/bus.h:1.26 src/sys/arch/mac68k/include/bus.h:1.27
--- src/sys/arch/mac68k/include/bus.h:1.26	Mon Apr 28 20:23:27 2008
+++ src/sys/arch/mac68k/include/bus.h	Tue Jul 23 07:52:53 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus.h,v 1.26 2008/04/28 20:23:27 martin Exp $	*/
+/*	$NetBSD: bus.h,v 1.27 2019/07/23 07:52:53 rin Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -786,6 +786,13 @@ __MAC68K_copy_region_N(4)
 #define	BUS_SPACE_BARRIER_READ	0x01		/* force read barrier */
 #define	BUS_SPACE_BARRIER_WRITE	0x02		/* force write barrier */
 
+/*
+ *	void *bus_space_vaddr(bus_space_tag_t, bus_space_handle_t);
+ *
+ * Get the kernel virtual address for the mapped bus space.
+ */
+#define	bus_space_vaddr(t, h)	((void)(t), (void *)(h.base))
+
 #define BUS_SPACE_ALIGNED_POINTER(p, t) ALIGNED_POINTER(p, t)
 
 #include 

Index: src/sys/arch/mac68k/obio/esp.c
diff -u src/sys/arch/mac68k/obio/esp.c:1.56 src/sys/arch/mac68k/obio/esp.c:1.57
--- src/sys/arch/mac68k/obio/esp.c:1.56	Tue Jan  8 19:41:09 2019
+++ src/sys/arch/mac68k/obio/esp.c	Tue Jul 23 07:52:53 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: esp.c,v 1.56 2019/01/08 19:41:09 jdolecek Exp $	*/
+/*	$NetBSD: esp.c,v 1.57 2019/07/23 07:52:53 rin Exp $	*/
 
 /*
  * Copyright (c) 1997 Jason R. Thorpe.
@@ -77,38 +77,27 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: esp.c,v 1.56 2019/01/08 19:41:09 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: esp.c,v 1.57 2019/07/23 07:52:53 rin Exp $");
 
 #include 
 #include 
-#include 
-#include 
-#include 
-#include 
-#include 
 #include 
-#include 
-#include 
-#include 
+#include 
+#include 
 
-#include 
-#include 
 #include 
-#include 
-
-#include 
-#include 
 
 #include 
 #include 
 
+#include 
 #include 
 
 #include 
 #include 
 
-int	espmatch(device_t, cfdata_t, void *);
-void	espattach(device_t, device_t, void *);
+static int	espmatch(device_t, cfdata_t, void *);
+static void	espattach(device_t, device_t, void *);
 
 /* Linkup to the rest of the kernel */
 CFATTACH_DECL_NEW(esp, sizeof(struct esp_softc),
@@ -117,74 +106,74 @@ CFATTACH_DECL_NEW(esp, sizeof(struct esp
 /*
  * Functions and the switch for the MI code.
  */
-uint8_t	esp_read_reg(struct ncr53c9x_softc *, int);
-void	esp_write_reg(struct ncr53c9x_softc *, int, uint8_t);
-int	esp_dma_isintr(struct ncr53c9x_softc *);
-void	esp_dma_reset(struct ncr53c9x_softc *);
-int	esp_dma_intr(struct ncr53c9x_softc *);
-int	esp_dma_setup(struct ncr53c9x_softc *, uint8_t **, size_t *, int,
-	size_t *);
-void	esp_dma_go(struct ncr53c9x_softc *);
-void	esp_dma_stop(struct ncr53c9x_softc *);
-int	esp_dma_isactive(struct ncr53c9x_softc *);
-void	esp_quick_write_reg(struct ncr53c9x_softc *, int, u_char);
-int	esp_quick_dma_intr(struct ncr53c9x_softc *);
-int	esp_quick_dma_setup(struct ncr53c9x_softc *, uint8_t **, size_t *, int,
-	 size_t *);
-void	esp_quick_dma_go(struct ncr53c9x_softc *);
-
-void	esp_intr(void *);
-void	esp_dualbus_intr(void *);
-static struct esp_softc		*esp0, *esp1;
+static uint8_t	esp_read_reg(struct ncr53c9x_softc *, int);
+static void	esp_write_reg(struct ncr53c9x_softc *, int, uint8_t);
+static int	esp_dma_isintr(struct ncr53c9x_softc *);
+static void	esp_dma_reset(struct ncr53c9x_softc *);
+static int	esp_dma_intr(struct ncr53c9x_softc *);
+static int	esp_dma_setup(struct ncr53c9x_softc *, uint8_t **, size_t *,
+			int, size_t *);
+static void	esp_dma_go(struct ncr53c9x_softc *);
+static void	esp_dma_stop(struct ncr53c9x_softc *);
+static int	esp_dma_isactive(struct ncr53c9x_softc *);
+static void	esp_quick_write_reg(struct ncr53c9x_softc *, int, uint8_t);
+static int	esp_quick_dma_intr(struct ncr53c9x_softc *);
+static int	esp_quick_dma_setup(struct ncr53c9x_softc *, uint8_t **,
+			size_t *, int, size_t *);
+static void	

CVS commit: src/sys/arch/mac68k

2019-07-23 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Tue Jul 23 07:52:53 UTC 2019

Modified Files:
src/sys/arch/mac68k/include: bus.h
src/sys/arch/mac68k/obio: esp.c espvar.h

Log Message:
PR port-mac68k/24883

Style-only changes in preparation to import AV DMA code:

- G/C unused from esp_softc
- clean up headers:
- prefer  over 
- G/C unused
- sort
- staticify private functions and variables
- stop using inline qualifier for functions called via function pointers
- use C99 initializer
- provide bus_space_vaddr(9) and use it, instead of using member of
  bus_handle_t directly
- use uint*_t:
- u_char --> uint8_t
- u_int*_t --> uint*_t
- use proper names from ncr53c9xreg.h instead of magic numbers
- and some KNF, and etc.

No functional changes intended.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/mac68k/include/bus.h
cvs rdiff -u -r1.56 -r1.57 src/sys/arch/mac68k/obio/esp.c
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/mac68k/obio/espvar.h

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



  1   2   >