CVS commit: src/sys

2019-10-05 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Sun Oct  6 05:48:00 UTC 2019

Modified Files:
src/sys/miscfs/genfs: genfs_io.c
src/sys/uvm: uvm_swap.c

Log Message:
Defer to synchronous I/O before the aiodone work queue exists.


To generate a diff of this commit:
cvs rdiff -u -r1.75 -r1.76 src/sys/miscfs/genfs/genfs_io.c
cvs rdiff -u -r1.180 -r1.181 src/sys/uvm/uvm_swap.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/miscfs/genfs/genfs_io.c
diff -u src/sys/miscfs/genfs/genfs_io.c:1.75 src/sys/miscfs/genfs/genfs_io.c:1.76
--- src/sys/miscfs/genfs/genfs_io.c:1.75	Thu Jul 11 16:59:14 2019
+++ src/sys/miscfs/genfs/genfs_io.c	Sun Oct  6 05:48:00 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: genfs_io.c,v 1.75 2019/07/11 16:59:14 maxv Exp $	*/
+/*	$NetBSD: genfs_io.c,v 1.76 2019/10/06 05:48:00 mlelstv Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: genfs_io.c,v 1.75 2019/07/11 16:59:14 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: genfs_io.c,v 1.76 2019/10/06 05:48:00 mlelstv Exp $");
 
 #include 
 #include 
@@ -561,6 +561,9 @@ genfs_getpages_read(struct vnode *vp, st
 	if (kva == 0)
 		return EBUSY;
 
+	if (uvm.aiodone_queue == NULL)
+		async = 0;
+
 	mbp = getiobuf(vp, true);
 	mbp->b_bufsize = totalbytes;
 	mbp->b_data = (void *)kva;
@@ -1377,6 +1380,7 @@ genfs_gop_write(struct vnode *vp, struct
 	UVMPAGER_MAPIN_WRITE | UVMPAGER_MAPIN_WAITOK);
 	len = npages << PAGE_SHIFT;
 
+	KASSERT(uvm.aiodone_queue != NULL);
 	error = genfs_do_io(vp, off, kva, len, flags, UIO_WRITE,
 			uvm_aio_biodone);
 
@@ -1400,6 +1404,7 @@ genfs_gop_write_rwmap(struct vnode *vp, 
 	UVMPAGER_MAPIN_READ | UVMPAGER_MAPIN_WAITOK);
 	len = npages << PAGE_SHIFT;
 
+	KASSERT(uvm.aiodone_queue != NULL);
 	error = genfs_do_io(vp, off, kva, len, flags, UIO_WRITE,
 			uvm_aio_biodone);
 

Index: src/sys/uvm/uvm_swap.c
diff -u src/sys/uvm/uvm_swap.c:1.180 src/sys/uvm/uvm_swap.c:1.181
--- src/sys/uvm/uvm_swap.c:1.180	Sun Jan 27 05:22:19 2019
+++ src/sys/uvm/uvm_swap.c	Sun Oct  6 05:48:00 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_swap.c,v 1.180 2019/01/27 05:22:19 kre Exp $	*/
+/*	$NetBSD: uvm_swap.c,v 1.181 2019/10/06 05:48:00 mlelstv Exp $	*/
 
 /*
  * Copyright (c) 1995, 1996, 1997, 2009 Matthew R. Green
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uvm_swap.c,v 1.180 2019/01/27 05:22:19 kre Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_swap.c,v 1.181 2019/10/06 05:48:00 mlelstv Exp $");
 
 #include "opt_uvmhist.h"
 #include "opt_compat_netbsd.h"
@@ -1778,6 +1778,10 @@ uvm_swap_io(struct vm_page **pps, int st
 	write = (flags & B_READ) == 0;
 	async = (flags & B_ASYNC) != 0;
 
+	/* XXX swap io make take place before the aiodone queue exists */
+	if (uvm.aiodone_queue == NULL)
+		async = 0;
+
 	/*
 	 * allocate a buf for the i/o.
 	 */
@@ -1832,6 +1836,7 @@ uvm_swap_io(struct vm_page **pps, int st
 	 */
 
 	if (async) {
+		KASSERT(uvm.aiodone_queue != NULL);
 		bp->b_iodone = uvm_aio_biodone;
 		UVMHIST_LOG(pdhist, "doing async!", 0, 0, 0, 0);
 		if (curlwp == uvm.pagedaemon_lwp)



CVS commit: src/sys

2019-10-05 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Sun Oct  6 05:48:00 UTC 2019

Modified Files:
src/sys/miscfs/genfs: genfs_io.c
src/sys/uvm: uvm_swap.c

Log Message:
Defer to synchronous I/O before the aiodone work queue exists.


To generate a diff of this commit:
cvs rdiff -u -r1.75 -r1.76 src/sys/miscfs/genfs/genfs_io.c
cvs rdiff -u -r1.180 -r1.181 src/sys/uvm/uvm_swap.c

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



CVS commit: src/sys/netinet6

2019-10-05 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Sun Oct  6 02:30:58 UTC 2019

Modified Files:
src/sys/netinet6: icmp6.c

Log Message:
icmp6_notify_error - fix ctlfunc typedef to match pr_ctlinput,
drop the cast that is no longer necessary.


To generate a diff of this commit:
cvs rdiff -u -r1.242 -r1.243 src/sys/netinet6/icmp6.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/netinet6/icmp6.c
diff -u src/sys/netinet6/icmp6.c:1.242 src/sys/netinet6/icmp6.c:1.243
--- src/sys/netinet6/icmp6.c:1.242	Sat Dec 22 14:07:54 2018
+++ src/sys/netinet6/icmp6.c	Sun Oct  6 02:30:58 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: icmp6.c,v 1.242 2018/12/22 14:07:54 maxv Exp $	*/
+/*	$NetBSD: icmp6.c,v 1.243 2019/10/06 02:30:58 uwe Exp $	*/
 /*	$KAME: icmp6.c,v 1.217 2001/06/20 15:03:29 jinmei Exp $	*/
 
 /*
@@ -62,7 +62,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: icmp6.c,v 1.242 2018/12/22 14:07:54 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: icmp6.c,v 1.243 2019/10/06 02:30:58 uwe Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -950,7 +950,7 @@ icmp6_notify_error(struct mbuf *m, int o
 
 	/* Detect the upper level protocol */
 	{
-		void (*ctlfunc)(int, struct sockaddr *, void *);
+		void *(*ctlfunc)(int, const struct sockaddr *, void *);
 		u_int8_t nxt = eip6->ip6_nxt;
 		int eoff = off + sizeof(struct icmp6_hdr) +
 			sizeof(struct ip6_hdr);
@@ -1077,8 +1077,7 @@ icmp6_notify_error(struct mbuf *m, int o
 			ip6cp.ip6c_cmdarg = (void *)
 		}
 
-		ctlfunc = (void (*)(int, struct sockaddr *, void *))
-		(inet6sw[ip6_protox[nxt]].pr_ctlinput);
+		ctlfunc = inet6sw[ip6_protox[nxt]].pr_ctlinput;
 		if (ctlfunc) {
 			(void)(*ctlfunc)(code, sin6tosa(), );
 		}



CVS commit: src/sys/netinet6

2019-10-05 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Sun Oct  6 02:30:58 UTC 2019

Modified Files:
src/sys/netinet6: icmp6.c

Log Message:
icmp6_notify_error - fix ctlfunc typedef to match pr_ctlinput,
drop the cast that is no longer necessary.


To generate a diff of this commit:
cvs rdiff -u -r1.242 -r1.243 src/sys/netinet6/icmp6.c

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



CVS commit: src/sys/kern

2019-10-05 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Sun Oct  6 02:04:26 UTC 2019

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

Log Message:
Define cpu_xc_* functions with unused second argument to make them
conform to xcfunc_t callback typedef (-Wcast-function-type).
Same object code is generated.


To generate a diff of this commit:
cvs rdiff -u -r1.75 -r1.76 src/sys/kern/kern_cpu.c

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



CVS commit: src/sys/kern

2019-10-05 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Sun Oct  6 02:04:26 UTC 2019

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

Log Message:
Define cpu_xc_* functions with unused second argument to make them
conform to xcfunc_t callback typedef (-Wcast-function-type).
Same object code is generated.


To generate a diff of this commit:
cvs rdiff -u -r1.75 -r1.76 src/sys/kern/kern_cpu.c

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

Modified files:

Index: src/sys/kern/kern_cpu.c
diff -u src/sys/kern/kern_cpu.c:1.75 src/sys/kern/kern_cpu.c:1.76
--- src/sys/kern/kern_cpu.c:1.75	Tue Nov 13 11:06:19 2018
+++ src/sys/kern/kern_cpu.c	Sun Oct  6 02:04:26 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_cpu.c,v 1.75 2018/11/13 11:06:19 skrll Exp $	*/
+/*	$NetBSD: kern_cpu.c,v 1.76 2019/10/06 02:04:26 uwe Exp $	*/
 
 /*-
  * Copyright (c) 2007, 2008, 2009, 2010, 2012 The NetBSD Foundation, Inc.
@@ -56,7 +56,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_cpu.c,v 1.75 2018/11/13 11:06:19 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_cpu.c,v 1.76 2019/10/06 02:04:26 uwe Exp $");
 
 #include "opt_cpu_ucode.h"
 
@@ -95,8 +95,8 @@ CTASSERT(offsetof(struct cpu_info, ci_da
 CTASSERT(offsetof(struct cpu_info, ci_data) != 0);
 #endif
 
-static void	cpu_xc_online(struct cpu_info *);
-static void	cpu_xc_offline(struct cpu_info *);
+static void	cpu_xc_online(struct cpu_info *, void *);
+static void	cpu_xc_offline(struct cpu_info *, void *);
 
 dev_type_ioctl(cpuctl_ioctl);
 
@@ -328,7 +328,7 @@ cpu_lookup(u_int idx)
 }
 
 static void
-cpu_xc_offline(struct cpu_info *ci)
+cpu_xc_offline(struct cpu_info *ci, void *unused)
 {
 	struct schedstate_percpu *spc, *mspc = NULL;
 	struct cpu_info *target_ci;
@@ -403,7 +403,7 @@ fail:
 }
 
 static void
-cpu_xc_online(struct cpu_info *ci)
+cpu_xc_online(struct cpu_info *ci, void *unused)
 {
 	struct schedstate_percpu *spc;
 	int s;
@@ -489,7 +489,7 @@ cpu_getmodel(void)
 
 #ifdef __HAVE_INTR_CONTROL
 static void
-cpu_xc_intr(struct cpu_info *ci)
+cpu_xc_intr(struct cpu_info *ci, void *unused)
 {
 	struct schedstate_percpu *spc;
 	int s;
@@ -501,7 +501,7 @@ cpu_xc_intr(struct cpu_info *ci)
 }
 
 static void
-cpu_xc_nointr(struct cpu_info *ci)
+cpu_xc_nointr(struct cpu_info *ci, void *unused)
 {
 	struct schedstate_percpu *spc;
 	int s;



CVS commit: src/tests/include/sys

2019-10-05 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Oct  6 01:05:36 UTC 2019

Modified Files:
src/tests/include/sys: t_socket.c

Log Message:
use memcpy() for non C-strings.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/tests/include/sys/t_socket.c

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



CVS commit: src/tests/include/sys

2019-10-05 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Oct  6 01:05:36 UTC 2019

Modified Files:
src/tests/include/sys: t_socket.c

Log Message:
use memcpy() for non C-strings.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/tests/include/sys/t_socket.c

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

Modified files:

Index: src/tests/include/sys/t_socket.c
diff -u src/tests/include/sys/t_socket.c:1.5 src/tests/include/sys/t_socket.c:1.6
--- src/tests/include/sys/t_socket.c:1.5	Fri Jan 13 21:30:41 2017
+++ src/tests/include/sys/t_socket.c	Sun Oct  6 01:05:36 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_socket.c,v 1.5 2017/01/13 21:30:41 christos Exp $	*/
+/*	$NetBSD: t_socket.c,v 1.6 2019/10/06 01:05:36 mrg Exp $	*/
 
 #include 
 #include 
@@ -98,7 +98,7 @@ ATF_TC_BODY(cmsg_sendfd, tc)
 	memset(, 0, sizeof(sun));
 	sun.sun_family = AF_LOCAL;
 #define SOCKPATH "/com"
-	strncpy(sun.sun_path, SOCKPATH, sizeof(SOCKPATH));
+	memcpy(sun.sun_path, SOCKPATH, sizeof(SOCKPATH) - 1);
 	s1 = rump_sys_socket(AF_LOCAL, SOCK_STREAM, 0);
 	if (s1 == -1)
 		atf_tc_fail_errno("socket 1");
@@ -114,7 +114,7 @@ ATF_TC_BODY(cmsg_sendfd, tc)
 	/* connect to unix domain socket */
 	memset(, 0, sizeof(sun));
 	sun.sun_family = AF_LOCAL;
-	strncpy(sun.sun_path, SOCKPATH, sizeof(SOCKPATH));
+	memcpy(sun.sun_path, SOCKPATH, sizeof(SOCKPATH) - 1);
 	s2 = rump_sys_socket(AF_LOCAL, SOCK_STREAM, 0);
 	if (s2 == -1)
 		atf_tc_fail_errno("socket 2");



CVS commit: src/sys/dev/ic

2019-10-05 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Sun Oct  6 01:04:49 UTC 2019

Modified Files:
src/sys/dev/ic: adw.c adwlib.c adwlib.h

Log Message:
Get rid of bogus ADW_CALLBACK typedef.  Use the real callback types
directly.  Since we no longer need the casting dance we can get rid of
ADW_ISR_CALLBACK and ADW_ASYNC_CALLBACK typedefs too.  The diff for
adwlib.h looks larger than it is b/c we need to reorder structure
definitions for the proper callback declaration.  Found by gcc8
-Wcast-function-type.


To generate a diff of this commit:
cvs rdiff -u -r1.54 -r1.55 src/sys/dev/ic/adw.c
cvs rdiff -u -r1.42 -r1.43 src/sys/dev/ic/adwlib.c
cvs rdiff -u -r1.21 -r1.22 src/sys/dev/ic/adwlib.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/ic/adw.c
diff -u src/sys/dev/ic/adw.c:1.54 src/sys/dev/ic/adw.c:1.55
--- src/sys/dev/ic/adw.c:1.54	Thu Jul 14 04:19:26 2016
+++ src/sys/dev/ic/adw.c	Sun Oct  6 01:04:49 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: adw.c,v 1.54 2016/07/14 04:19:26 msaitoh Exp $	 */
+/* $NetBSD: adw.c,v 1.55 2019/10/06 01:04:49 uwe Exp $	 */
 
 /*
  * Generic driver for the Advanced Systems Inc. SCSI controllers
@@ -38,7 +38,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: adw.c,v 1.54 2016/07/14 04:19:26 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: adw.c,v 1.55 2019/10/06 01:04:49 uwe Exp $");
 
 #include 
 #include 
@@ -398,8 +398,8 @@ adw_init(ADW_SOFTC *sc)
 			"setting. Using automatic termination.\n");
 	}
 
-	sc->isr_callback = (ADW_CALLBACK) adw_isr_callback;
-	sc->async_callback = (ADW_CALLBACK) adw_async_callback;
+	sc->isr_callback = adw_isr_callback;
+	sc->async_callback = adw_async_callback;
 
 	return 0;
 }

Index: src/sys/dev/ic/adwlib.c
diff -u src/sys/dev/ic/adwlib.c:1.42 src/sys/dev/ic/adwlib.c:1.43
--- src/sys/dev/ic/adwlib.c:1.42	Sun Feb  3 03:19:27 2019
+++ src/sys/dev/ic/adwlib.c	Sun Oct  6 01:04:49 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: adwlib.c,v 1.42 2019/02/03 03:19:27 mrg Exp $*/
+/* $NetBSD: adwlib.c,v 1.43 2019/10/06 01:04:49 uwe Exp $*/
 
 /*
  * Low level routines for the Advanced Systems Inc. SCSI controllers chips
@@ -52,7 +52,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: adwlib.c,v 1.42 2019/02/03 03:19:27 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: adwlib.c,v 1.43 2019/10/06 01:04:49 uwe Exp $");
 
 #include 
 #include 
@@ -2021,7 +2021,7 @@ AdwISR(ADW_SOFTC *sc)
 		}
 
 		if (sc->async_callback != 0) {
-		(*(ADW_ASYNC_CALLBACK)sc->async_callback)(sc, intrb_code);
+			(*sc->async_callback)(sc, intrb_code);
 		}
 	}
 
@@ -2098,7 +2098,7 @@ AdwISR(ADW_SOFTC *sc)
 		 * Notify the driver of the completed request by passing
 		 * the ADW_SCSI_REQ_Q pointer to its callback function.
 		 */
-		(*(ADW_ISR_CALLBACK)sc->isr_callback)(sc, scsiq);
+		(*sc->isr_callback)(sc, scsiq);
 		/*
 		 * Note: After the driver callback function is called, 'scsiq'
 		 * can no longer be referenced.

Index: src/sys/dev/ic/adwlib.h
diff -u src/sys/dev/ic/adwlib.h:1.21 src/sys/dev/ic/adwlib.h:1.22
--- src/sys/dev/ic/adwlib.h:1.21	Sat Oct 27 17:18:18 2012
+++ src/sys/dev/ic/adwlib.h	Sun Oct  6 01:04:49 2019
@@ -1,4 +1,4 @@
-/*  $NetBSD: adwlib.h,v 1.21 2012/10/27 17:18:18 chs Exp $*/
+/*  $NetBSD: adwlib.h,v 1.22 2019/10/06 01:04:49 uwe Exp $*/
 
 /*
  * Definitions for low level routines and data structures
@@ -717,80 +717,6 @@ typedef struct adw_sg_block {
 
 
 /*
- * Adapter operation variable structure.
- *
- * One structure is required per host adapter.
- *
- * Field naming convention:
- *
- *  *_able indicates both whether a feature should be enabled or disabled
- *  and whether a device is capable of the feature. At initialization
- *  this field may be set, but later if a device is found to be incapable
- *  of the feature, the field is cleared.
- */
-#define	CCB_HASH_SIZE	32	/* hash table size for phystokv */
-#define	CCB_HASH_SHIFT	9
-#define CCB_HASH(x)	x)) >> CCB_HASH_SHIFT) & (CCB_HASH_SIZE - 1))
-
-typedef int (* ADW_CALLBACK) (int);
-
-typedef struct adw_softc {
-
-	device_t		sc_dev;
-
-	bus_space_tag_t		sc_iot;
-	bus_space_handle_t	sc_ioh;
-	bus_dma_tag_t		sc_dmat;
-	bus_dmamap_t		sc_dmamap_control; /* maps the control structures */
-	bus_dmamap_t		sc_dmamap_carrier; /* maps the carrier structures */
-	void			*sc_ih;
-
-	struct adw_control	*sc_control; /* control structures */
-
-	struct adw_ccb		*sc_ccbhash[CCB_HASH_SIZE];
-	TAILQ_HEAD(, adw_ccb)	sc_free_ccb, sc_waiting_ccb;
-	TAILQ_HEAD(adw_pending_ccb, adw_ccb)	sc_pending_ccb;
-	struct scsipi_adapter   sc_adapter;
-	struct scsipi_channel   sc_channel;
-
-	int			sc_freeze_dev[ADW_MAX_TID+1];
-
-	ADW_CALLBACK	isr_callback;	/* pointer to function, called in AdwISR() */
-	ADW_CALLBACK	async_callback;	/* pointer to function, called in AdwISR() */
-	u_int16_t	bios_ctrl;	/* BIOS control word, EEPROM word 12 */
-	u_int16_t	wdtr_able;	/* try WDTR for a device */
-	

CVS commit: src/sys/dev/ic

2019-10-05 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Sun Oct  6 01:04:49 UTC 2019

Modified Files:
src/sys/dev/ic: adw.c adwlib.c adwlib.h

Log Message:
Get rid of bogus ADW_CALLBACK typedef.  Use the real callback types
directly.  Since we no longer need the casting dance we can get rid of
ADW_ISR_CALLBACK and ADW_ASYNC_CALLBACK typedefs too.  The diff for
adwlib.h looks larger than it is b/c we need to reorder structure
definitions for the proper callback declaration.  Found by gcc8
-Wcast-function-type.


To generate a diff of this commit:
cvs rdiff -u -r1.54 -r1.55 src/sys/dev/ic/adw.c
cvs rdiff -u -r1.42 -r1.43 src/sys/dev/ic/adwlib.c
cvs rdiff -u -r1.21 -r1.22 src/sys/dev/ic/adwlib.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/ic

2019-10-05 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Sun Oct  6 00:48:19 UTC 2019

Modified Files:
src/sys/dev/ic: adv.c adv.h advlib.c advlib.h

Log Message:
Get rid of bogus ASC_CALLBACK typedef.  Use the real callback type
(which is almost ASC_ISR_CALLBACK).  Since we no longer need the
casting dance we can get rid of the temporary variables, and since we
don't need the temporary variables we don't need the ASC_ISR_CALLBACK
typedef either.  Found by gcc8 -Wcast-function-type.


To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 src/sys/dev/ic/adv.c
cvs rdiff -u -r1.13 -r1.14 src/sys/dev/ic/adv.h
cvs rdiff -u -r1.27 -r1.28 src/sys/dev/ic/advlib.c
cvs rdiff -u -r1.19 -r1.20 src/sys/dev/ic/advlib.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/ic/adv.c
diff -u src/sys/dev/ic/adv.c:1.48 src/sys/dev/ic/adv.c:1.49
--- src/sys/dev/ic/adv.c:1.48	Wed Aug 29 16:51:51 2018
+++ src/sys/dev/ic/adv.c	Sun Oct  6 00:48:19 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: adv.c,v 1.48 2018/08/29 16:51:51 rin Exp $	*/
+/*	$NetBSD: adv.c,v 1.49 2019/10/06 00:48:19 uwe Exp $	*/
 
 /*
  * Generic driver for the Advanced Systems Inc. Narrow SCSI controllers
@@ -38,7 +38,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: adv.c,v 1.48 2018/08/29 16:51:51 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: adv.c,v 1.49 2019/10/06 00:48:19 uwe Exp $");
 
 #include 
 #include 
@@ -405,7 +405,7 @@ adv_init(ASC_SOFTC *sc)
 			aprint_normal("unknown warning %d\n", warn);
 		}
 	}
-	sc->isr_callback = (ASC_CALLBACK) adv_narrow_isr_callback;
+	sc->isr_callback = adv_narrow_isr_callback;
 
 	return (0);
 }

Index: src/sys/dev/ic/adv.h
diff -u src/sys/dev/ic/adv.h:1.13 src/sys/dev/ic/adv.h:1.14
--- src/sys/dev/ic/adv.h:1.13	Sun Dec 11 12:21:25 2005
+++ src/sys/dev/ic/adv.h	Sun Oct  6 00:48:19 2019
@@ -1,4 +1,4 @@
-/*  $NetBSD: adv.h,v 1.13 2005/12/11 12:21:25 christos Exp $*/
+/*  $NetBSD: adv.h,v 1.14 2019/10/06 00:48:19 uwe Exp $*/
 
 /*
  * Generic driver definitions and exported functions for the Advanced
@@ -43,9 +43,6 @@
 
 /**/
 
-/* second level interrupt callback type definition */
-typedef int (* ASC_ISR_CALLBACK) (ASC_SOFTC *, ASC_QDONE_INFO *);
-
 struct adv_ccb
 {
 	ASC_SG_HEAD	sghead;

Index: src/sys/dev/ic/advlib.c
diff -u src/sys/dev/ic/advlib.c:1.27 src/sys/dev/ic/advlib.c:1.28
--- src/sys/dev/ic/advlib.c:1.27	Sat Nov 13 13:52:00 2010
+++ src/sys/dev/ic/advlib.c	Sun Oct  6 00:48:19 2019
@@ -1,4 +1,4 @@
-/*  $NetBSD: advlib.c,v 1.27 2010/11/13 13:52:00 uebayasi Exp $*/
+/*  $NetBSD: advlib.c,v 1.28 2019/10/06 00:48:19 uwe Exp $*/
 
 /*
  * Low level routines for the Advanced Systems Inc. SCSI controllers chips
@@ -53,7 +53,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: advlib.c,v 1.27 2010/11/13 13:52:00 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: advlib.c,v 1.28 2019/10/06 00:48:19 uwe Exp $");
 
 #include 
 #include 
@@ -1549,10 +1549,7 @@ AscIsrQDone(ASC_SOFTC *sc)
 	u_int8_tcur_target_qng;
 	ASC_QDONE_INFO  scsiq_buf;
 	ASC_QDONE_INFO *scsiq;
-	ASC_ISR_CALLBACK asc_isr_callback;
 
-
-	asc_isr_callback = (ASC_ISR_CALLBACK) sc->isr_callback;
 	n_q_used = 1;
 	scsiq = (ASC_QDONE_INFO *) & scsiq_buf;
 	done_q_tail = ASC_GET_VAR_DONE_QTAIL(iot, ioh);
@@ -1631,7 +1628,7 @@ AscIsrQDone(ASC_SOFTC *sc)
 	ASC_SET_CHIP_CONTROL(iot, ioh, 0);
 }
 			}
-			(*asc_isr_callback) (sc, scsiq);
+			(*sc->isr_callback)(sc, scsiq);
 
 			return (1);
 		} else {
@@ -2818,11 +2815,8 @@ AscRiscHaltedAbortCCB(ASC_SOFTC *sc, ADV
 	u_int8_tq_no;
 	ASC_QDONE_INFO  scsiq_buf;
 	ASC_QDONE_INFO *scsiq;
-	ASC_ISR_CALLBACK asc_isr_callback;
 	int last_int_level;
 
-
-	asc_isr_callback = (ASC_ISR_CALLBACK) sc->isr_callback;
 	last_int_level = DvcEnterCritical();
 	scsiq = (ASC_QDONE_INFO *) & scsiq_buf;
 
@@ -2840,7 +2834,7 @@ AscRiscHaltedAbortCCB(ASC_SOFTC *sc, ADV
 AscWriteLramDWord(iot, ioh, q_addr + ASC_SCSIQ_D_CCBPTR, 0L);
 AscWriteLramByte(iot, ioh, q_addr + ASC_SCSIQ_B_STATUS,
 		 scsiq->q_status);
-(*asc_isr_callback) (sc, scsiq);
+(*sc->isr_callback)(sc, scsiq);
 return (1);
 			}
 		}
@@ -2860,11 +2854,8 @@ AscRiscHaltedAbortTIX(ASC_SOFTC *sc, u_i
 	u_int8_tq_no;
 	ASC_QDONE_INFO  scsiq_buf;
 	ASC_QDONE_INFO *scsiq;
-	ASC_ISR_CALLBACK asc_isr_callback;
 	int last_int_level;
 
-
-	asc_isr_callback = (ASC_ISR_CALLBACK) sc->isr_callback;
 	last_int_level = DvcEnterCritical();
 	scsiq = (ASC_QDONE_INFO *) & scsiq_buf;
 	for (q_no = ASC_MIN_ACTIVE_QNO; q_no <= sc->max_total_qng; q_no++) {
@@ -2879,7 +2870,7 @@ AscRiscHaltedAbortTIX(ASC_SOFTC *sc, u_i
 AscWriteLramDWord(iot, ioh, q_addr + ASC_SCSIQ_D_CCBPTR, 0L);
 AscWriteLramByte(iot, ioh, q_addr + ASC_SCSIQ_B_STATUS,
 		 scsiq->q_status);
-(*asc_isr_callback) (sc, scsiq);

CVS commit: src/sys/dev/ic

2019-10-05 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Sun Oct  6 00:48:19 UTC 2019

Modified Files:
src/sys/dev/ic: adv.c adv.h advlib.c advlib.h

Log Message:
Get rid of bogus ASC_CALLBACK typedef.  Use the real callback type
(which is almost ASC_ISR_CALLBACK).  Since we no longer need the
casting dance we can get rid of the temporary variables, and since we
don't need the temporary variables we don't need the ASC_ISR_CALLBACK
typedef either.  Found by gcc8 -Wcast-function-type.


To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 src/sys/dev/ic/adv.c
cvs rdiff -u -r1.13 -r1.14 src/sys/dev/ic/adv.h
cvs rdiff -u -r1.27 -r1.28 src/sys/dev/ic/advlib.c
cvs rdiff -u -r1.19 -r1.20 src/sys/dev/ic/advlib.h

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



CVS commit: src/usr.bin/netstat

2019-10-05 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Oct  6 00:27:50 UTC 2019

Modified Files:
src/usr.bin/netstat: mroute.c

Log Message:
sprintf() -> snprintf(), and adjust a buffer size to avoid any
potential for overflow.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/usr.bin/netstat/mroute.c

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



CVS commit: src/usr.bin/netstat

2019-10-05 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Oct  6 00:27:50 UTC 2019

Modified Files:
src/usr.bin/netstat: mroute.c

Log Message:
sprintf() -> snprintf(), and adjust a buffer size to avoid any
potential for overflow.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/usr.bin/netstat/mroute.c

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

Modified files:

Index: src/usr.bin/netstat/mroute.c
diff -u src/usr.bin/netstat/mroute.c:1.25 src/usr.bin/netstat/mroute.c:1.26
--- src/usr.bin/netstat/mroute.c:1.25	Thu Nov  6 21:30:09 2014
+++ src/usr.bin/netstat/mroute.c	Sun Oct  6 00:27:50 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: mroute.c,v 1.25 2014/11/06 21:30:09 christos Exp $	*/
+/*	$NetBSD: mroute.c,v 1.26 2019/10/06 00:27:50 mrg Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -76,7 +76,7 @@
 #if 0
 static char sccsid[] = "from: @(#)mroute.c	8.1 (Berkeley) 6/6/93";
 #else
-__RCSID("$NetBSD: mroute.c,v 1.25 2014/11/06 21:30:09 christos Exp $");
+__RCSID("$NetBSD: mroute.c,v 1.26 2019/10/06 00:27:50 mrg Exp $");
 #endif
 #endif /* not lint */
 
@@ -269,7 +269,7 @@ mroutepr(u_long mrpaddr, u_long mfchasht
 static void
 print_bw_meter(struct bw_meter *bw_meter, int *banner_printed)
 {
-	char s0[256], s1[256], s2[256], s3[256];
+	char s0[256*3], s1[256], s2[256], s3[256];
 	struct timeval now, end, delta;
 
 	gettimeofday(, NULL);
@@ -286,37 +286,37 @@ print_bw_meter(struct bw_meter *bw_meter
 
 	/* The measured values */
 	if (bw_meter->bm_flags & BW_METER_UNIT_PACKETS)
-		sprintf(s1, "%llu", (unsigned long long)bw_meter->bm_measured.b_packets);
+		snprintf(s1, sizeof s1, "%llu", (unsigned long long)bw_meter->bm_measured.b_packets);
 	else
-		sprintf(s1, "?");
+		snprintf(s1, sizeof s1, "?");
 	if (bw_meter->bm_flags & BW_METER_UNIT_BYTES)
-		sprintf(s2, "%llu", (unsigned long long)bw_meter->bm_measured.b_bytes);
+		snprintf(s2, sizeof s2, "%llu", (unsigned long long)bw_meter->bm_measured.b_bytes);
 	else
-		sprintf(s2, "?");
-	sprintf(s0, "%lld.%ld|%s|%s",
+		snprintf(s2, sizeof s2, "?");
+	snprintf(s0, sizeof s0, "%lld.%ld|%s|%s",
 		(long long)bw_meter->bm_start_time.tv_sec,
 		(long)bw_meter->bm_start_time.tv_usec,
 		s1, s2);
 	printf("  %-30s", s0);
 
 	/* The type of entry */
-	sprintf(s0, "%s", "?");
+	snprintf(s0, sizeof s0, "%s", "?");
 	if (bw_meter->bm_flags & BW_METER_GEQ)
-		sprintf(s0, "%s", ">=");
+		snprintf(s0, sizeof s0, "%s", ">=");
 	else if (bw_meter->bm_flags & BW_METER_LEQ)
-		sprintf(s0, "%s", "<=");
+		snprintf(s0, sizeof s0, "%s", "<=");
 	printf("  %-3s", s0);
 
 	/* The threshold values */
 	if (bw_meter->bm_flags & BW_METER_UNIT_PACKETS)
-		sprintf(s1, "%llu", (unsigned long long)bw_meter->bm_threshold.b_packets);
+		snprintf(s1, sizeof s1, "%llu", (unsigned long long)bw_meter->bm_threshold.b_packets);
 	else
-		sprintf(s1, "?");
+		snprintf(s1, sizeof s1, "?");
 	if (bw_meter->bm_flags & BW_METER_UNIT_BYTES)
-		sprintf(s2, "%llu", (unsigned long long)bw_meter->bm_threshold.b_bytes);
+		snprintf(s2, sizeof s2, "%llu", (unsigned long long)bw_meter->bm_threshold.b_bytes);
 	else
-		sprintf(s2, "?");
-	sprintf(s0, "%lld.%ld|%s|%s",
+		snprintf(s2, sizeof s2, "?");
+	snprintf(s0, sizeof s0, "%lld.%ld|%s|%s",
 		(long long)bw_meter->bm_threshold.b_time.tv_sec,
 		(long)bw_meter->bm_threshold.b_time.tv_usec,
 		s1, s2);
@@ -327,12 +327,12 @@ print_bw_meter(struct bw_meter *bw_meter
 		 _meter->bm_threshold.b_time, );
 	if (timercmp(, , <=)) {
 		timersub(, , );
-		sprintf(s3, "%lld.%ld",
+		snprintf(s3, sizeof s3, "%lld.%ld",
 		(long long)delta.tv_sec, (long)delta.tv_usec);
 	} else {
 		/* Negative time */
 		timersub(, , );
-		sprintf(s3, "-%lld.%ld",
+		snprintf(s3, sizeof s3, "-%lld.%ld",
 		(long long)delta.tv_sec, (long)delta.tv_usec);
 	}
 	printf(" %s", s3);



CVS commit: src/external/gpl3/gcc/lib/libubsan

2019-10-05 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Oct  6 00:15:22 UTC 2019

Modified Files:
src/external/gpl3/gcc/lib/libubsan: Makefile

Log Message:
remove ubsan_handlers_cxx.cc from sources.  shouldn't be used with gcc.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/external/gpl3/gcc/lib/libubsan/Makefile

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



CVS commit: src/external/gpl3/gcc/lib/libubsan

2019-10-05 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Oct  6 00:15:22 UTC 2019

Modified Files:
src/external/gpl3/gcc/lib/libubsan: Makefile

Log Message:
remove ubsan_handlers_cxx.cc from sources.  shouldn't be used with gcc.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/external/gpl3/gcc/lib/libubsan/Makefile

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

Modified files:

Index: src/external/gpl3/gcc/lib/libubsan/Makefile
diff -u src/external/gpl3/gcc/lib/libubsan/Makefile:1.14 src/external/gpl3/gcc/lib/libubsan/Makefile:1.15
--- src/external/gpl3/gcc/lib/libubsan/Makefile:1.14	Fri Oct  4 08:51:33 2019
+++ src/external/gpl3/gcc/lib/libubsan/Makefile	Sun Oct  6 00:15:22 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.14 2019/10/04 08:51:33 mrg Exp $
+#	$NetBSD: Makefile,v 1.15 2019/10/06 00:15:22 mrg Exp $
 
 UNSUPPORTED_COMPILER.clang=	# defined
 LIBISCXX = yes
@@ -15,7 +15,6 @@ UBSAN_SRCS= \
 	ubsan_diag.cc \
 	ubsan_flags.cc \
 	ubsan_handlers.cc \
-	ubsan_handlers_cxx.cc \
 	ubsan_init.cc \
 	ubsan_type_hash.cc \
 	ubsan_type_hash_itanium.cc \
@@ -26,8 +25,6 @@ UBSAN_SRCS= \
 COPTS.${_s}.cc+=-frtti
 .endfor
 
-COPTS.ubsan_handlers_cxx.cc+= -Wno-error=maybe-uninitialized
-
 LIB=	ubsan
 SRCS+=	${UBSAN_SRCS}
 LIBDPLIBS+= rt ${NETBSDSRCDIR}/lib/librt



CVS commit: src/usr.sbin/sysinst

2019-10-05 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Oct  6 00:07:11 UTC 2019

Modified Files:
src/usr.sbin/sysinst: Makefile.inc

Log Message:
remove, not comment, the partman.c option


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/usr.sbin/sysinst/Makefile.inc

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

Modified files:

Index: src/usr.sbin/sysinst/Makefile.inc
diff -u src/usr.sbin/sysinst/Makefile.inc:1.25 src/usr.sbin/sysinst/Makefile.inc:1.26
--- src/usr.sbin/sysinst/Makefile.inc:1.25	Sun Oct  6 00:05:10 2019
+++ src/usr.sbin/sysinst/Makefile.inc	Sun Oct  6 00:07:11 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.25 2019/10/06 00:05:10 mrg Exp $
+#	$NetBSD: Makefile.inc,v 1.26 2019/10/06 00:07:11 mrg Exp $
 #
 # Makefile for sysinst
 
@@ -126,9 +126,6 @@ CPPFLAGS+=-DINET6
 COPTS+=-Wno-format-truncation
 .endif
 
-# XXX overlapping strncpy/snprintf buffers!
-#COPTS.partman.c+=	${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} == 8:? -Wno-error :}
-
 # Host to ftp from.  Default:
 #	"ftp.NetBSD.org"
 #



CVS commit: src/usr.sbin/sysinst

2019-10-05 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Oct  6 00:07:11 UTC 2019

Modified Files:
src/usr.sbin/sysinst: Makefile.inc

Log Message:
remove, not comment, the partman.c option


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/usr.sbin/sysinst/Makefile.inc

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-10-05 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Oct  6 00:05:10 UTC 2019

Modified Files:
src/usr.sbin/sysinst: Makefile.inc partman.c

Log Message:
avoid calling snprintf/strlcat with an input parameter the same
as the output.  from martin@.  fixes gcc 8 restrict warnings.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/usr.sbin/sysinst/Makefile.inc
cvs rdiff -u -r1.42 -r1.43 src/usr.sbin/sysinst/partman.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-10-05 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Oct  6 00:05:10 UTC 2019

Modified Files:
src/usr.sbin/sysinst: Makefile.inc partman.c

Log Message:
avoid calling snprintf/strlcat with an input parameter the same
as the output.  from martin@.  fixes gcc 8 restrict warnings.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/usr.sbin/sysinst/Makefile.inc
cvs rdiff -u -r1.42 -r1.43 src/usr.sbin/sysinst/partman.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/Makefile.inc
diff -u src/usr.sbin/sysinst/Makefile.inc:1.24 src/usr.sbin/sysinst/Makefile.inc:1.25
--- src/usr.sbin/sysinst/Makefile.inc:1.24	Fri Oct  4 09:47:28 2019
+++ src/usr.sbin/sysinst/Makefile.inc	Sun Oct  6 00:05:10 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.24 2019/10/04 09:47:28 mrg Exp $
+#	$NetBSD: Makefile.inc,v 1.25 2019/10/06 00:05:10 mrg Exp $
 #
 # Makefile for sysinst
 
@@ -127,7 +127,7 @@ COPTS+=-Wno-format-truncation
 .endif
 
 # XXX overlapping strncpy/snprintf buffers!
-COPTS.partman.c+=	${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} == 8:? -Wno-error :}
+#COPTS.partman.c+=	${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} == 8:? -Wno-error :}
 
 # Host to ftp from.  Default:
 #	"ftp.NetBSD.org"

Index: src/usr.sbin/sysinst/partman.c
diff -u src/usr.sbin/sysinst/partman.c:1.42 src/usr.sbin/sysinst/partman.c:1.43
--- src/usr.sbin/sysinst/partman.c:1.42	Tue Aug 13 17:57:49 2019
+++ src/usr.sbin/sysinst/partman.c	Sun Oct  6 00:05:10 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: partman.c,v 1.42 2019/08/13 17:57:49 martin Exp $ */
+/*	$NetBSD: partman.c,v 1.43 2019/10/06 00:05:10 mrg Exp $ */
 
 /*
  * Copyright 2012 Eugene Lozovoy
@@ -950,7 +950,8 @@ pm_vnd_edit_menufmt(menudesc *m, int opt
 			break;
 		case PMV_MENU_NSECTORS:
 			if (dev_ptr->manual_geom && !dev_ptr->is_exist)
-snprintf(buf, SSTRSIZE, "%d", dev_ptr->nsectors);
+snprintf(buf, SSTRSIZE, "%d",
+dev_ptr->nsectors);
 			wprintw(m->mw, "%*s %s", -lcol_width,
 			msg_string(MSG_vnd_spt_fmt), buf);
 			break;
@@ -962,7 +963,8 @@ pm_vnd_edit_menufmt(menudesc *m, int opt
 			break;
 		case PMV_MENU_NCYLINDERS:
 			if (dev_ptr->manual_geom && !dev_ptr->is_exist)
-snprintf(buf, SSTRSIZE, "%d", dev_ptr->ncylinders);
+snprintf(buf, SSTRSIZE, "%d",
+dev_ptr->ncylinders);
 			wprintw(m->mw, "%*s %s", -lcol_width,
 			msg_string(MSG_vnd_cyl_fmt), buf);
 			break;
@@ -983,10 +985,13 @@ pm_vnd_set_value(menudesc *m, void *arg)
 			dev_ptr->filepath, dev_ptr->filepath, STRSIZE);
 			if (dev_ptr->filepath[0] != '/') {
 strlcpy(buf, dev_ptr->filepath, MOUNTLEN);
-snprintf(dev_ptr->filepath, MOUNTLEN, "/%s", buf);
+snprintf(dev_ptr->filepath, MOUNTLEN, "/%s",
+buf);
 			}
-			if (dev_ptr->filepath[strlen(dev_ptr->filepath) - 1] == '/')
-dev_ptr->filepath[strlen(dev_ptr->filepath) - 1] = '\0';
+			if (dev_ptr->filepath[strlen(dev_ptr->filepath) - 1]
+			== '/')
+dev_ptr->filepath[strlen(dev_ptr->filepath)
+ - 1] = '\0';
 			return 0;
 		case PMV_MENU_EXIST:
 			dev_ptr->is_exist = !dev_ptr->is_exist;
@@ -1540,15 +1545,18 @@ pm_lvm_edit_menufmt(menudesc *m, int opt
 	int i;
 	char buf[STRSIZE];
 	lvms_t *dev_ptr = arg;
-	strlcpy(buf, msg_string(MSG_auto), STRSIZE);
+	strlcpy(buf, msg_string(MSG_auto), sizeof buf);
 
 	switch (opt) {
 		case PML_MENU_PV:
 			buf[0] = '\0';
-			for (i = 0; i < MAX_LVM_PV; i++)
-if (dev_ptr->pv[i].pm != NULL)
-	snprintf(buf, STRSIZE, "%s %s",
-	buf, dev_ptr->pv[i].pm_name);
+			for (i = 0; i < MAX_LVM_PV; i++) {
+if (dev_ptr->pv[i].pm != NULL) {
+	strlcat(buf, " ", sizeof buf);
+	strlcat(buf, dev_ptr->pv[i].pm_name,
+	sizeof buf);
+}
+			}
 			wprintw(m->mw, "%-20s: %s",
 			 msg_string(MSG_lvm_disks_fmt), buf);
 			break;
@@ -1565,13 +1573,15 @@ pm_lvm_edit_menufmt(menudesc *m, int opt
 			break;
 		case PML_MENU_MAXPHYSICALVOLUMES:
 			if (dev_ptr->maxphysicalvolumes > 0)
-snprintf(buf, STRSIZE, "%d", dev_ptr->maxphysicalvolumes);
+snprintf(buf, STRSIZE, "%d",
+dev_ptr->maxphysicalvolumes);
 			wprintw(m->mw, "%-20s: %s",
 			msg_string(MSG_lvm_maxpv_fmt), buf);
 			break;
 		case PML_MENU_PHYSICALEXTENTSIZE:
 			if (dev_ptr->physicalextentsize > 0)
-snprintf(buf, STRSIZE, "%dM", dev_ptr->physicalextentsize);
+snprintf(buf, STRSIZE, "%dM",
+dev_ptr->physicalextentsize);
 			wprintw(m->mw, "%-20s: %s",
 			msg_string(MSG_lvm_extsiz_fmt), buf);
 			break;
@@ -1872,8 +1882,7 @@ pm_lvm_commit(void)
 {
 	int i, ii, error;
 	uint used_size = 0;
-	char params[STRSIZE*3];
-	char devs[STRSIZE*3];
+	char params[STRSIZE*3], devs[STRSIZE*3], arg[STRSIZE];
 
 	for (i = 0; i < MAX_LVM_VG; i++) {
 		/* Stage 0: checks */
@@ -1891,26 +1900,37 @@ pm_lvm_commit(void)
 		for (ii = 0; ii < MAX_LVM_PV && ! error; ii++)
 			if (lvms[i].pv[ii].pm != NULL) {
 run_program(RUN_SILENT | 

CVS commit: src/usr.bin

2019-10-05 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sat Oct  5 23:35:57 UTC 2019

Modified Files:
src/usr.bin/make: arch.c
src/usr.bin/who: utmpentry.c

Log Message:
use memcpy() for strings that are not C strings.
destinations are already sufficiently sized and nul terminated.


To generate a diff of this commit:
cvs rdiff -u -r1.70 -r1.71 src/usr.bin/make/arch.c
cvs rdiff -u -r1.20 -r1.21 src/usr.bin/who/utmpentry.c

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

Modified files:

Index: src/usr.bin/make/arch.c
diff -u src/usr.bin/make/arch.c:1.70 src/usr.bin/make/arch.c:1.71
--- src/usr.bin/make/arch.c:1.70	Sun Apr 16 20:49:09 2017
+++ src/usr.bin/make/arch.c	Sat Oct  5 23:35:57 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: arch.c,v 1.70 2017/04/16 20:49:09 riastradh Exp $	*/
+/*	$NetBSD: arch.c,v 1.71 2019/10/05 23:35:57 mrg Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: arch.c,v 1.70 2017/04/16 20:49:09 riastradh Exp $";
+static char rcsid[] = "$NetBSD: arch.c,v 1.71 2019/10/05 23:35:57 mrg Exp $";
 #else
 #include 
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)arch.c	8.2 (Berkeley) 1/2/94";
 #else
-__RCSID("$NetBSD: arch.c,v 1.70 2017/04/16 20:49:09 riastradh Exp $");
+__RCSID("$NetBSD: arch.c,v 1.71 2019/10/05 23:35:57 mrg Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -635,7 +635,7 @@ ArchStatMember(char *archive, char *memb
 	arh.ar_size[sizeof(arh.ar_size)-1] = '\0';
 	size = (int)strtol(arh.ar_size, NULL, 10);
 
-	(void)strncpy(memName, arh.ar_name, sizeof(arh.ar_name));
+	memcpy(memName, arh.ar_name, sizeof(arh.ar_name));
 	for (cp = [AR_MAX_NAME_LEN]; *cp == ' '; cp--) {
 		continue;
 	}

Index: src/usr.bin/who/utmpentry.c
diff -u src/usr.bin/who/utmpentry.c:1.20 src/usr.bin/who/utmpentry.c:1.21
--- src/usr.bin/who/utmpentry.c:1.20	Fri Oct  4 11:43:07 2019
+++ src/usr.bin/who/utmpentry.c	Sat Oct  5 23:35:57 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: utmpentry.c,v 1.20 2019/10/04 11:43:07 mrg Exp $	*/
+/*	$NetBSD: utmpentry.c,v 1.21 2019/10/05 23:35:57 mrg Exp $	*/
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: utmpentry.c,v 1.20 2019/10/04 11:43:07 mrg Exp $");
+__RCSID("$NetBSD: utmpentry.c,v 1.21 2019/10/05 23:35:57 mrg Exp $");
 #endif
 
 #include 
@@ -278,14 +278,14 @@ getentry(struct utmpentry *e, struct utm
 	/*
 	 * e has just been calloc'd. We don't need to clear it or
 	 * append null-terminators, because its length is strictly
-	 * greater than the source string. Use strncpy to _read_
+	 * greater than the source string. Use memcpy to _read_
 	 * up->ut_* because they may not be terminated. For this
 	 * reason we use the size of the _source_ as the length
 	 * argument.
 	 */
-	(void)strncpy(e->name, up->ut_name, sizeof(up->ut_name));
-	(void)strncpy(e->line, up->ut_line, sizeof(up->ut_line));
-	(void)strncpy(e->host, up->ut_host, sizeof(up->ut_host));
+	memcpy(e->name, up->ut_name, sizeof(up->ut_name));
+	memcpy(e->line, up->ut_line, sizeof(up->ut_line));
+	memcpy(e->host, up->ut_host, sizeof(up->ut_host));
 
 	e->tv.tv_sec = up->ut_time;
 	e->tv.tv_usec = 0;
@@ -309,14 +309,14 @@ getentryx(struct utmpentry *e, struct ut
 	/*
 	 * e has just been calloc'd. We don't need to clear it or
 	 * append null-terminators, because its length is strictly
-	 * greater than the source string. Use strncpy to _read_
+	 * greater than the source string. Use memcpy to _read_
 	 * up->ut_* because they may not be terminated. For this
 	 * reason we use the size of the _source_ as the length
 	 * argument.
 	 */
-	(void)strncpy(e->name, up->ut_name, sizeof(up->ut_name));
-	(void)strncpy(e->line, up->ut_line, sizeof(up->ut_line));
-	(void)strncpy(e->host, up->ut_host, sizeof(up->ut_host));
+	memcpy(e->name, up->ut_name, sizeof(up->ut_name));
+	memcpy(e->line, up->ut_line, sizeof(up->ut_line));
+	memcpy(e->host, up->ut_host, sizeof(up->ut_host));
 
 	e->tv = up->ut_tv;
 	e->pid = up->ut_pid;



CVS commit: src/usr.bin

2019-10-05 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sat Oct  5 23:35:57 UTC 2019

Modified Files:
src/usr.bin/make: arch.c
src/usr.bin/who: utmpentry.c

Log Message:
use memcpy() for strings that are not C strings.
destinations are already sufficiently sized and nul terminated.


To generate a diff of this commit:
cvs rdiff -u -r1.70 -r1.71 src/usr.bin/make/arch.c
cvs rdiff -u -r1.20 -r1.21 src/usr.bin/who/utmpentry.c

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



CVS commit: src/games/battlestar

2019-10-05 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sat Oct  5 23:34:15 UTC 2019

Modified Files:
src/games/battlestar: room.c

Log Message:
expand the internal consistency checks in truedirec() to avoid
fallthrough cases.  now if direction turns up wrong (it should
not, but this code can't tell that, and convert it to an enum
that would also fix this, is more effort than this is worth.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/games/battlestar/room.c

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

Modified files:

Index: src/games/battlestar/room.c
diff -u src/games/battlestar/room.c:1.13 src/games/battlestar/room.c:1.14
--- src/games/battlestar/room.c:1.13	Mon May 23 22:44:18 2011
+++ src/games/battlestar/room.c	Sat Oct  5 23:34:14 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: room.c,v 1.13 2011/05/23 22:44:18 joerg Exp $	*/
+/*	$NetBSD: room.c,v 1.14 2019/10/05 23:34:14 mrg Exp $	*/
 
 /*
  * Copyright (c) 1983, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)room.c	8.2 (Berkeley) 4/28/95";
 #else
-__RCSID("$NetBSD: room.c,v 1.13 2011/05/23 22:44:18 joerg Exp $");
+__RCSID("$NetBSD: room.c,v 1.14 2019/10/05 23:34:14 mrg Exp $");
 #endif
 #endif/* not lint */
 
@@ -129,6 +129,7 @@ truedirec(int way, int option)
 		case WEST:
 			return ("right");
 		}
+		break;
 
 	case SOUTH:
 		switch (direction) {
@@ -142,6 +143,7 @@ truedirec(int way, int option)
 		case WEST:
 			return ("left");
 		}
+		break;
 
 	case EAST:
 		switch (direction) {
@@ -155,6 +157,7 @@ truedirec(int way, int option)
 			return (option == '+' ? "behind you" :
 			"back");
 		}
+		break;
 
 	case WEST:
 		switch (direction) {
@@ -168,12 +171,12 @@ truedirec(int way, int option)
 		case WEST:
 			return ("ahead");
 		}
-
-	default:
-		printf("Error: room %d.  More than four directions wanted.", 
-		position);
-		return ("!!");
+		break;
 	}
+
+	printf("Error: room %d.  More than four directions wanted.", 
+	position);
+	return ("!!");
 }
 
 void



CVS commit: src/games/battlestar

2019-10-05 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sat Oct  5 23:34:15 UTC 2019

Modified Files:
src/games/battlestar: room.c

Log Message:
expand the internal consistency checks in truedirec() to avoid
fallthrough cases.  now if direction turns up wrong (it should
not, but this code can't tell that, and convert it to an enum
that would also fix this, is more effort than this is worth.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/games/battlestar/room.c

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



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

2019-10-05 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sat Oct  5 23:32:20 UTC 2019

Modified Files:
src/external/bsd/ipf/dist/lib: load_hash.c
src/external/bsd/ipf/dist/tools: ipmon.c

Log Message:
use target size in a couple of strncpy() calls:
- load_hash() has already zeroed the structure so final nul is there.
- print_ipflog() copied final byte that was then nul'd.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/ipf/dist/lib/load_hash.c
cvs rdiff -u -r1.8 -r1.9 src/external/bsd/ipf/dist/tools/ipmon.c

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



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

2019-10-05 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sat Oct  5 23:32:20 UTC 2019

Modified Files:
src/external/bsd/ipf/dist/lib: load_hash.c
src/external/bsd/ipf/dist/tools: ipmon.c

Log Message:
use target size in a couple of strncpy() calls:
- load_hash() has already zeroed the structure so final nul is there.
- print_ipflog() copied final byte that was then nul'd.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/ipf/dist/lib/load_hash.c
cvs rdiff -u -r1.8 -r1.9 src/external/bsd/ipf/dist/tools/ipmon.c

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

Modified files:

Index: src/external/bsd/ipf/dist/lib/load_hash.c
diff -u src/external/bsd/ipf/dist/lib/load_hash.c:1.2 src/external/bsd/ipf/dist/lib/load_hash.c:1.3
--- src/external/bsd/ipf/dist/lib/load_hash.c:1.2	Sun Jul 22 14:27:36 2012
+++ src/external/bsd/ipf/dist/lib/load_hash.c	Sat Oct  5 23:32:20 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: load_hash.c,v 1.2 2012/07/22 14:27:36 darrenr Exp $	*/
+/*	$NetBSD: load_hash.c,v 1.3 2019/10/05 23:32:20 mrg Exp $	*/
 
 /*
  * Copyright (C) 2012 by Darren Reed.
@@ -67,8 +67,8 @@ load_hash(iphp, list, iocfunc)
 			}
 	}
 
-	strncpy(iph.iph_name, op.iplo_name, sizeof(op.iplo_name));
-	strncpy(iphp->iph_name, op.iplo_name, sizeof(op.iplo_name));
+	strncpy(iph.iph_name, op.iplo_name, sizeof(iph.iph_name) - 1);
+	strncpy(iphp->iph_name, op.iplo_name, sizeof(iphp->iph_name) - 1);
 
 	if (opts & OPT_VERBOSE) {
 		iph.iph_table = calloc(size, sizeof(*iph.iph_table));

Index: src/external/bsd/ipf/dist/tools/ipmon.c
diff -u src/external/bsd/ipf/dist/tools/ipmon.c:1.8 src/external/bsd/ipf/dist/tools/ipmon.c:1.9
--- src/external/bsd/ipf/dist/tools/ipmon.c:1.8	Sun Feb  4 08:19:42 2018
+++ src/external/bsd/ipf/dist/tools/ipmon.c	Sat Oct  5 23:32:20 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: ipmon.c,v 1.8 2018/02/04 08:19:42 mrg Exp $	*/
+/*	$NetBSD: ipmon.c,v 1.9 2019/10/05 23:32:20 mrg Exp $	*/
 
 /*
  * Copyright (C) 2012 by Darren Reed.
@@ -1097,7 +1097,7 @@ print_ipflog(config_t *conf, const iplog
 	{
 	char	ifname[sizeof(ipf.fl_ifname) + 1];
 
-	strncpy(ifname, ipf.fl_ifname, sizeof(ipf.fl_ifname));
+	strncpy(ifname, ipf.fl_ifname, sizeof(ifname)-1);
 	ifname[sizeof(ipf.fl_ifname)] = '\0';
 	sprintf(t, "%s", ifname);
 	t += strlen(t);



CVS commit: src/usr.sbin/eeprom

2019-10-05 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sat Oct  5 23:30:22 UTC 2019

Modified Files:
src/usr.sbin/eeprom: eehandlers.c

Log Message:
memcpy->strncpy, and avoid copying beyond the static string length
into potentially unmapped regions.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/usr.sbin/eeprom/eehandlers.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/eeprom/eehandlers.c
diff -u src/usr.sbin/eeprom/eehandlers.c:1.18 src/usr.sbin/eeprom/eehandlers.c:1.19
--- src/usr.sbin/eeprom/eehandlers.c:1.18	Tue Jul  2 11:59:46 2013
+++ src/usr.sbin/eeprom/eehandlers.c	Sat Oct  5 23:30:22 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: eehandlers.c,v 1.18 2013/07/02 11:59:46 joerg Exp $	*/
+/*	$NetBSD: eehandlers.c,v 1.19 2019/10/05 23:30:22 mrg Exp $	*/
 
 /*-
  * Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -530,7 +530,7 @@ doio(const struct keytabent *ktent, u_ch
 
 	buf2 = (u_char *)calloc(1, len);
 	if (buf2 == NULL) {
-		memcpy(err_str, "memory allocation failed", sizeof err_str);
+		strncpy(err_str, "memory allocation failed", sizeof err_str);
 		return (1);
 	}
 



CVS commit: src/usr.sbin/eeprom

2019-10-05 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sat Oct  5 23:30:22 UTC 2019

Modified Files:
src/usr.sbin/eeprom: eehandlers.c

Log Message:
memcpy->strncpy, and avoid copying beyond the static string length
into potentially unmapped regions.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/usr.sbin/eeprom/eehandlers.c

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



Re: CVS commit: src/lib/libc/db/db

2019-10-05 Thread Valery Ushakov
On Sat, Oct 05, 2019 at 18:07:58 +, Valeriy E. Ushakov wrote:

> Module Name:  src
> Committed By: uwe
> Date: Sat Oct  5 18:07:58 UTC 2019
> 
> Modified Files:
>   src/lib/libc/db/db: db.c
> 
> Log Message:
> __dberr: tweak signature to make gcc8 -Wbad-function-cast happy about
> casts in __dbpanic.  Admittedly this is a bit too "cute".
> 
> 
> To generate a diff of this commit:
> cvs rdiff -u -r1.19 -r1.20 src/lib/libc/db/db/db.c

Oops, I meant -Wcast-function-type

-uwe


CVS commit: src/sys

2019-10-05 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sat Oct  5 23:27:21 UTC 2019

Modified Files:
src/sys/dev/ic: anvar.h athnvar.h atwvar.h malovar.h mfireg.h nvmereg.h
rt2560var.h rt2661var.h rt2860var.h rtwvar.h wivar.h
src/sys/dev/pci: if_ipwvar.h if_iwmvar.h if_iwnvar.h if_rtwnreg.h
src/sys/dev/usb: if_otusvar.h if_rumvar.h if_runvar.h if_upgtvar.h
if_uralvar.h if_urtwnvar.h if_urtwreg.h if_zydreg.h
src/sys/net80211: ieee80211_radiotap.h

Log Message:
remove __packed attribute from struct ieee80211_radiotap_header
and all the structures that include it.

this should not change anything while avoiding packed vs alignment
warnings from GCC 8, and potentially pessimised code generation
due to the packed marker (there are no misaligned members, just
that the per-device parts may end unaligned.)

all consumers of these members are done from the properly aligned
packet members directly, or, as a union with a 64 byte member,
also properly aligned.  codegen didn't appear to change, except
for the definition of sizeof(struct driver_[rt]x_radiotap_header)
in debug info, which is not directly used anywhere.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/dev/ic/anvar.h
cvs rdiff -u -r1.7 -r1.8 src/sys/dev/ic/athnvar.h
cvs rdiff -u -r1.39 -r1.40 src/sys/dev/ic/atwvar.h
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/ic/malovar.h
cvs rdiff -u -r1.9 -r1.10 src/sys/dev/ic/mfireg.h
cvs rdiff -u -r1.13 -r1.14 src/sys/dev/ic/nvmereg.h
cvs rdiff -u -r1.10 -r1.11 src/sys/dev/ic/rt2560var.h
cvs rdiff -u -r1.12 -r1.13 src/sys/dev/ic/rt2661var.h
cvs rdiff -u -r1.5 -r1.6 src/sys/dev/ic/rt2860var.h
cvs rdiff -u -r1.47 -r1.48 src/sys/dev/ic/rtwvar.h
cvs rdiff -u -r1.66 -r1.67 src/sys/dev/ic/wivar.h
cvs rdiff -u -r1.18 -r1.19 src/sys/dev/pci/if_ipwvar.h \
src/sys/dev/pci/if_iwmvar.h
cvs rdiff -u -r1.20 -r1.21 src/sys/dev/pci/if_iwnvar.h
cvs rdiff -u -r1.5 -r1.6 src/sys/dev/pci/if_rtwnreg.h
cvs rdiff -u -r1.9 -r1.10 src/sys/dev/usb/if_otusvar.h \
src/sys/dev/usb/if_zydreg.h
cvs rdiff -u -r1.10 -r1.11 src/sys/dev/usb/if_rumvar.h
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/usb/if_runvar.h
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/usb/if_upgtvar.h \
src/sys/dev/usb/if_urtwreg.h
cvs rdiff -u -r1.13 -r1.14 src/sys/dev/usb/if_uralvar.h \
src/sys/dev/usb/if_urtwnvar.h
cvs rdiff -u -r1.24 -r1.25 src/sys/net80211/ieee80211_radiotap.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/ic/anvar.h
diff -u src/sys/dev/ic/anvar.h:1.21 src/sys/dev/ic/anvar.h:1.22
--- src/sys/dev/ic/anvar.h:1.21	Thu Feb  2 10:05:35 2017
+++ src/sys/dev/ic/anvar.h	Sat Oct  5 23:27:20 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: anvar.h,v 1.21 2017/02/02 10:05:35 nonaka Exp $	*/
+/*	$NetBSD: anvar.h,v 1.22 2019/10/05 23:27:20 mrg Exp $	*/
 /*
  * Copyright (c) 1997, 1998, 1999
  *	Bill Paul .  All rights reserved.
@@ -86,7 +86,7 @@ struct an_rx_radiotap_header {
 u_int16_t   ar_chan_freq;
 u_int16_t   ar_chan_flags;
 int8_t  ar_antsignal;
-} __packed;
+};
 
 #define AN_TX_RADIOTAP_PRESENT  ((1 << IEEE80211_RADIOTAP_FLAGS) | \
  (1 << IEEE80211_RADIOTAP_RATE) | \
@@ -98,7 +98,7 @@ struct an_tx_radiotap_header {
 u_int8_tat_rate;
 u_int16_t   at_chan_freq;
 u_int16_t   at_chan_flags;
-} __packed;
+};
 
 #define	AN_GAPLEN_MAX	8
 

Index: src/sys/dev/ic/athnvar.h
diff -u src/sys/dev/ic/athnvar.h:1.7 src/sys/dev/ic/athnvar.h:1.8
--- src/sys/dev/ic/athnvar.h:1.7	Fri Sep 13 07:55:06 2019
+++ src/sys/dev/ic/athnvar.h	Sat Oct  5 23:27:20 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: athnvar.h,v 1.7 2019/09/13 07:55:06 msaitoh Exp $	*/
+/*	$NetBSD: athnvar.h,v 1.8 2019/10/05 23:27:20 mrg Exp $	*/
 /*	$OpenBSD: athnvar.h,v 1.34 2013/10/21 16:13:49 stsp Exp $	*/
 
 /*-
@@ -75,7 +75,7 @@ struct athn_rx_radiotap_header {
 	uint16_t	wr_chan_flags;
 	int8_t		wr_dbm_antsignal;
 	uint8_t		wr_antenna;
-} __packed;
+};
 
 #define ATHN_RX_RADIOTAP_PRESENT	\
 	(1 << IEEE80211_RADIOTAP_TSFT |	\
@@ -91,7 +91,7 @@ struct athn_tx_radiotap_header {
 	uint8_t		wt_rate;
 	uint16_t	wt_chan_freq;
 	uint16_t	wt_chan_flags;
-} __packed;
+};
 
 #define ATHN_TX_RADIOTAP_PRESENT	\
 	(1 << IEEE80211_RADIOTAP_FLAGS |\

Index: src/sys/dev/ic/atwvar.h
diff -u src/sys/dev/ic/atwvar.h:1.39 src/sys/dev/ic/atwvar.h:1.40
--- src/sys/dev/ic/atwvar.h:1.39	Thu Apr 19 21:50:08 2018
+++ src/sys/dev/ic/atwvar.h	Sat Oct  5 23:27:20 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: atwvar.h,v 1.39 2018/04/19 21:50:08 christos Exp $	*/
+/*	$NetBSD: atwvar.h,v 1.40 2019/10/05 23:27:20 mrg Exp $	*/
 
 /*
  * Copyright (c) 2003, 2004 The NetBSD Foundation, Inc.  All rights reserved.
@@ -146,7 +146,7 @@ struct 

CVS commit: src/sys

2019-10-05 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sat Oct  5 23:27:21 UTC 2019

Modified Files:
src/sys/dev/ic: anvar.h athnvar.h atwvar.h malovar.h mfireg.h nvmereg.h
rt2560var.h rt2661var.h rt2860var.h rtwvar.h wivar.h
src/sys/dev/pci: if_ipwvar.h if_iwmvar.h if_iwnvar.h if_rtwnreg.h
src/sys/dev/usb: if_otusvar.h if_rumvar.h if_runvar.h if_upgtvar.h
if_uralvar.h if_urtwnvar.h if_urtwreg.h if_zydreg.h
src/sys/net80211: ieee80211_radiotap.h

Log Message:
remove __packed attribute from struct ieee80211_radiotap_header
and all the structures that include it.

this should not change anything while avoiding packed vs alignment
warnings from GCC 8, and potentially pessimised code generation
due to the packed marker (there are no misaligned members, just
that the per-device parts may end unaligned.)

all consumers of these members are done from the properly aligned
packet members directly, or, as a union with a 64 byte member,
also properly aligned.  codegen didn't appear to change, except
for the definition of sizeof(struct driver_[rt]x_radiotap_header)
in debug info, which is not directly used anywhere.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/dev/ic/anvar.h
cvs rdiff -u -r1.7 -r1.8 src/sys/dev/ic/athnvar.h
cvs rdiff -u -r1.39 -r1.40 src/sys/dev/ic/atwvar.h
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/ic/malovar.h
cvs rdiff -u -r1.9 -r1.10 src/sys/dev/ic/mfireg.h
cvs rdiff -u -r1.13 -r1.14 src/sys/dev/ic/nvmereg.h
cvs rdiff -u -r1.10 -r1.11 src/sys/dev/ic/rt2560var.h
cvs rdiff -u -r1.12 -r1.13 src/sys/dev/ic/rt2661var.h
cvs rdiff -u -r1.5 -r1.6 src/sys/dev/ic/rt2860var.h
cvs rdiff -u -r1.47 -r1.48 src/sys/dev/ic/rtwvar.h
cvs rdiff -u -r1.66 -r1.67 src/sys/dev/ic/wivar.h
cvs rdiff -u -r1.18 -r1.19 src/sys/dev/pci/if_ipwvar.h \
src/sys/dev/pci/if_iwmvar.h
cvs rdiff -u -r1.20 -r1.21 src/sys/dev/pci/if_iwnvar.h
cvs rdiff -u -r1.5 -r1.6 src/sys/dev/pci/if_rtwnreg.h
cvs rdiff -u -r1.9 -r1.10 src/sys/dev/usb/if_otusvar.h \
src/sys/dev/usb/if_zydreg.h
cvs rdiff -u -r1.10 -r1.11 src/sys/dev/usb/if_rumvar.h
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/usb/if_runvar.h
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/usb/if_upgtvar.h \
src/sys/dev/usb/if_urtwreg.h
cvs rdiff -u -r1.13 -r1.14 src/sys/dev/usb/if_uralvar.h \
src/sys/dev/usb/if_urtwnvar.h
cvs rdiff -u -r1.24 -r1.25 src/sys/net80211/ieee80211_radiotap.h

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



CVS commit: src/sys/external/bsd/drm2/nouveau

2019-10-05 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sat Oct  5 22:37:50 UTC 2019

Modified Files:
src/sys/external/bsd/drm2/nouveau: nouveau_pci.c

Log Message:
list the PCI ID range for new nvidia TU117 and TU116.
adjust the check to simply be >= 0x1580, which is the
first pciid not support.

should fix PR#54600.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/external/bsd/drm2/nouveau/nouveau_pci.c

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



CVS commit: src/sys/external/bsd/drm2/nouveau

2019-10-05 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sat Oct  5 22:37:50 UTC 2019

Modified Files:
src/sys/external/bsd/drm2/nouveau: nouveau_pci.c

Log Message:
list the PCI ID range for new nvidia TU117 and TU116.
adjust the check to simply be >= 0x1580, which is the
first pciid not support.

should fix PR#54600.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/external/bsd/drm2/nouveau/nouveau_pci.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/external/bsd/drm2/nouveau/nouveau_pci.c
diff -u src/sys/external/bsd/drm2/nouveau/nouveau_pci.c:1.24 src/sys/external/bsd/drm2/nouveau/nouveau_pci.c:1.25
--- src/sys/external/bsd/drm2/nouveau/nouveau_pci.c:1.24	Wed Jul  3 20:47:22 2019
+++ src/sys/external/bsd/drm2/nouveau/nouveau_pci.c	Sat Oct  5 22:37:49 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: nouveau_pci.c,v 1.24 2019/07/03 20:47:22 wiz Exp $	*/
+/*	$NetBSD: nouveau_pci.c,v 1.25 2019/10/05 22:37:49 mrg Exp $	*/
 
 /*-
  * Copyright (c) 2015 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: nouveau_pci.c,v 1.24 2019/07/03 20:47:22 wiz Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nouveau_pci.c,v 1.25 2019/10/05 22:37:49 mrg Exp $");
 
 #include 
 #include 
@@ -97,8 +97,6 @@ nouveau_pci_match(device_t parent, cfdat
 	if (PCI_CLASS(pa->pa_class) != PCI_CLASS_DISPLAY)
 		return 0;
 
-#define IS_BETWEEN(x,y) \
-	(PCI_PRODUCT(pa->pa_id) >= (x) && PCI_PRODUCT(pa->pa_id) <= (y))
 	/*
 	 * NetBSD drm2 doesn't support Pascal, Volta or Turing based cards:
 	 *   0x1580-0x15ff 	GP100
@@ -111,20 +109,16 @@ nouveau_pci_match(device_t parent, cfdat
 	 *   0x1e00-0x1e7f 	TU102
 	 *   0x1e80-0x1eff 	TU104
 	 *   0x1f00-0x1f7f 	TU106
+	 *   0x1f80-0x1fff 	TU117
+	 *   0x2180-0x21ff 	TU116
+	 *
+	 * reduce this to >= 1580, so that new chipsets not explictly
+	 * listed above will be picked up.
+	 *
+	 * XXX perhaps switch this to explicitly match known list.
 	 */
-
-	if (IS_BETWEEN(0x1580, 0x15ff) ||
-	IS_BETWEEN(0x1b00, 0x1b7f) ||
-	IS_BETWEEN(0x1b80, 0x1bff) ||
-	IS_BETWEEN(0x1c00, 0x1c7f) ||
-	IS_BETWEEN(0x1c80, 0x1cff) ||
-	IS_BETWEEN(0x1d00, 0x1d7f) ||
-	IS_BETWEEN(0x1d80, 0x1dff) ||
-	IS_BETWEEN(0x1e00, 0x1e7f) ||
-	IS_BETWEEN(0x1e80, 0x1eff) ||
-	IS_BETWEEN(0x1f00, 0x1f7f))
+	if (PCI_PRODUCT(pa->pa_id) >= 0x1580)
 		return 0;
-#undef IS_BETWEEN
 
 	linux_pci_dev_init(, parent /* XXX bogus */, parent, pa, 0);
 	ret = nvkm_device_pci_new(, NULL, "error",



CVS commit: src/etc/rc.d

2019-10-05 Thread Sevan Janiyan
Module Name:src
Committed By:   sevan
Date:   Sat Oct  5 22:21:29 UTC 2019

Modified Files:
src/etc/rc.d: npf_boot pf_boot

Log Message:
No need to empose the script to be runnable during boot time, it prevents the
script from wroking if the system is booted into single user mode & then
moved onto multi-user mode.

Reported by  for NPF but the issue is there in PF too.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/etc/rc.d/npf_boot
cvs rdiff -u -r1.4 -r1.5 src/etc/rc.d/pf_boot

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

Modified files:

Index: src/etc/rc.d/npf_boot
diff -u src/etc/rc.d/npf_boot:1.1 src/etc/rc.d/npf_boot:1.2
--- src/etc/rc.d/npf_boot:1.1	Tue Apr  2 01:50:32 2019
+++ src/etc/rc.d/npf_boot	Sat Oct  5 22:21:29 2019
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: npf_boot,v 1.1 2019/04/02 01:50:32 sevan Exp $
+# $NetBSD: npf_boot,v 1.2 2019/10/05 22:21:29 sevan Exp $
 #
 
 # PROVIDE: npf_boot
@@ -16,10 +16,6 @@ stop_cmd=":"
 
 npf_boot_start()
 {
-	if [ "$autoboot" != "yes" ]; then
-		err 1 "This script should only be executed at boot time."
-	fi
-
 	if [ -f /etc/npf.boot.conf ]; then
 		/sbin/npfctl reload /etc/npf.boot.conf
 	elif [ -f /etc/defaults/npf.boot.conf ]; then

Index: src/etc/rc.d/pf_boot
diff -u src/etc/rc.d/pf_boot:1.4 src/etc/rc.d/pf_boot:1.5
--- src/etc/rc.d/pf_boot:1.4	Sat Nov 22 20:23:33 2008
+++ src/etc/rc.d/pf_boot	Sat Oct  5 22:21:29 2019
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: pf_boot,v 1.4 2008/11/22 20:23:33 tsutsui Exp $
+# $NetBSD: pf_boot,v 1.5 2019/10/05 22:21:29 sevan Exp $
 #
 
 # PROVIDE: pf_boot
@@ -16,10 +16,6 @@ stop_cmd=":"
 
 pf_boot_start()
 {
-	if [ "$autoboot" != "yes" ]; then
-		err 1 "This script should only be executed at boot time."
-	fi
-
 	if [ -f /etc/pf.boot.conf ]; then
 		/sbin/pfctl -q -f /etc/pf.boot.conf
 	elif [ -f /etc/defaults/pf.boot.conf ]; then



CVS commit: src/etc/rc.d

2019-10-05 Thread Sevan Janiyan
Module Name:src
Committed By:   sevan
Date:   Sat Oct  5 22:21:29 UTC 2019

Modified Files:
src/etc/rc.d: npf_boot pf_boot

Log Message:
No need to empose the script to be runnable during boot time, it prevents the
script from wroking if the system is booted into single user mode & then
moved onto multi-user mode.

Reported by  for NPF but the issue is there in PF too.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/etc/rc.d/npf_boot
cvs rdiff -u -r1.4 -r1.5 src/etc/rc.d/pf_boot

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



CVS commit: src/tests/fs/common

2019-10-05 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sat Oct  5 22:06:29 UTC 2019

Modified Files:
src/tests/fs/common: fstest_nfs.c

Log Message:
sprintf->snprintf


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/tests/fs/common/fstest_nfs.c

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



CVS commit: src/tests/fs/common

2019-10-05 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sat Oct  5 22:06:29 UTC 2019

Modified Files:
src/tests/fs/common: fstest_nfs.c

Log Message:
sprintf->snprintf


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/tests/fs/common/fstest_nfs.c

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

Modified files:

Index: src/tests/fs/common/fstest_nfs.c
diff -u src/tests/fs/common/fstest_nfs.c:1.10 src/tests/fs/common/fstest_nfs.c:1.11
--- src/tests/fs/common/fstest_nfs.c:1.10	Fri Feb  1 09:06:07 2019
+++ src/tests/fs/common/fstest_nfs.c	Sat Oct  5 22:06:29 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: fstest_nfs.c,v 1.10 2019/02/01 09:06:07 mrg Exp $	*/
+/*	$NetBSD: fstest_nfs.c,v 1.11 2019/10/05 22:06:29 mrg Exp $	*/
 
 /*
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -87,10 +87,12 @@ donewfs(const atf_tc_t *tc, void **argp,
 	 * First, we start the nfs service.
 	 */
 	srcdir = atf_tc_get_config_var(tc, "srcdir");
-	sprintf(nfsdpath, "%s/../nfs/nfsservice/rumpnfsd", srcdir);
-	sprintf(ethername, "/%s/%s.etherbus", getcwd(cwd, sizeof(cwd)), image);
-	sprintf(ethername_ro, "%s_ro", ethername);
-	sprintf(imagepath, "/%s/%s", cwd, image);
+	snprintf(nfsdpath, sizeof nfsdpath,
+	"%s/../nfs/nfsservice/rumpnfsd", srcdir);
+	snprintf(ethername, sizeof ethername,
+	"/%s/%s.etherbus", getcwd(cwd, sizeof(cwd)), image);
+	snprintf(ethername_ro, sizeof ethername_ro, "%s_ro", ethername);
+	snprintf(imagepath, sizeof imagepath, "/%s/%s", cwd, image);
 
 	nfsdargv[0] = nfsdpath;
 	nfsdargv[1] = ethername;



CVS commit: src/tests/usr.bin/sed

2019-10-05 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Oct  5 20:24:16 UTC 2019

Modified Files:
src/tests/usr.bin/sed: t_sed.sh

Log Message:
Add tests for escape sequences.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/tests/usr.bin/sed/t_sed.sh

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

Modified files:

Index: src/tests/usr.bin/sed/t_sed.sh
diff -u src/tests/usr.bin/sed/t_sed.sh:1.6 src/tests/usr.bin/sed/t_sed.sh:1.7
--- src/tests/usr.bin/sed/t_sed.sh:1.6	Mon Apr  4 20:48:53 2016
+++ src/tests/usr.bin/sed/t_sed.sh	Sat Oct  5 16:24:16 2019
@@ -1,4 +1,4 @@
-# $NetBSD: t_sed.sh,v 1.6 2016/04/05 00:48:53 christos Exp $
+# $NetBSD: t_sed.sh,v 1.7 2019/10/05 20:24:16 christos Exp $
 #
 # Copyright (c) 2012 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -133,10 +133,57 @@ preserve_leading_ws_ia_body() {
 7 8 9"'
 }
 
+atf_test_case escapes_in_subst
+escapes_in_subst_head() {
+	atf_set "descr" "Test that sed(1) expands \x \d \o escapes " \
+		"in substition strings"
+}
+
+escapes_in_subst_body() {
+	atf_check -o inline:"fooXbar\n" \
+		-x 'echo "foo bar" | sed -e "s/ /\x58/"'
+	atf_check -o inline:"fooXbar\n" \
+		-x 'echo "foo bar" | sed -e "s/ /\o130/"'
+	atf_check -o inline:"fooXbar\n" \
+		-x 'echo "foo bar" | sed -e "s/ /\d88/"'
+}
+
+atf_test_case escapes_in_re
+escapes_in_re_head() {
+	atf_set "descr" "Test that sed(1) expands \x \d \o escapes " \
+		"in regex strings"
+}
+
+escapes_in_re_body() {
+	atf_check -o inline:"foo bar\n" \
+		-x 'echo "fooXbar" | sed -e "s/\x58/ /"'
+	atf_check -o inline:"foo bar\n" \
+		-x 'echo "fooXbar" | sed -e "s/\o130/ /"'
+	atf_check -o inline:"foo bar\n" \
+		-x 'echo "fooXbar" | sed -e "s/\d88/ /"'
+}
+
+atf_test_case escapes_in_re_bracket
+escapes_in_re_bracket_head() {
+	atf_set "descr" "Test that sed(1) does not expand \x \d \o escapes " \
+		"in regex strings inside braces"
+}
+
+escapes_in_re_bracket_body() {
+	atf_check -o inline:"foobar\n" \
+		-x 'echo "foo\\x58bar" | sed -e "s/[\x58]/ /g"'
+	atf_check -o inline:"f   bar\n" \
+		-x 'echo "fooo\\130bar" | sed -e "s/[\o130]/ /g"'
+	atf_check -o inline:"foobar\n" \
+		-x 'echo "foo\\d88bar" | sed -e "s/[\d88]/ /g"'
+}
 atf_init_test_cases() {
 	atf_add_test_case c2048
 	atf_add_test_case emptybackref
 	atf_add_test_case longlines
 	atf_add_test_case rangeselection
 	atf_add_test_case preserve_leading_ws_ia
+	atf_add_test_case escapes_in_subst
+	atf_add_test_case escapes_in_re
+	atf_add_test_case escapes_in_re_bracket
 }



CVS commit: src/tests/usr.bin/sed

2019-10-05 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Oct  5 20:24:16 UTC 2019

Modified Files:
src/tests/usr.bin/sed: t_sed.sh

Log Message:
Add tests for escape sequences.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/tests/usr.bin/sed/t_sed.sh

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



CVS commit: src/usr.bin/sed

2019-10-05 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Oct  5 20:23:55 UTC 2019

Modified Files:
src/usr.bin/sed: compile.c

Log Message:
Recognize \oOOO \dDD \xXX plus the other regular 'C' backslash escapes like
gnu sed does, except when inside regex []. (Gnu sed translates those too,
unless --posix is specified).


To generate a diff of this commit:
cvs rdiff -u -r1.47 -r1.48 src/usr.bin/sed/compile.c

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



CVS commit: src/usr.bin/sed

2019-10-05 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Oct  5 20:23:55 UTC 2019

Modified Files:
src/usr.bin/sed: compile.c

Log Message:
Recognize \oOOO \dDD \xXX plus the other regular 'C' backslash escapes like
gnu sed does, except when inside regex []. (Gnu sed translates those too,
unless --posix is specified).


To generate a diff of this commit:
cvs rdiff -u -r1.47 -r1.48 src/usr.bin/sed/compile.c

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

Modified files:

Index: src/usr.bin/sed/compile.c
diff -u src/usr.bin/sed/compile.c:1.47 src/usr.bin/sed/compile.c:1.48
--- src/usr.bin/sed/compile.c:1.47	Mon Apr  4 20:13:03 2016
+++ src/usr.bin/sed/compile.c	Sat Oct  5 16:23:55 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: compile.c,v 1.47 2016/04/05 00:13:03 christos Exp $	*/
+/*	$NetBSD: compile.c,v 1.48 2019/10/05 20:23:55 christos Exp $	*/
 
 /*-
  * Copyright (c) 1992 Diomidis Spinellis.
@@ -38,7 +38,7 @@
 #endif
 
 #include 
-__RCSID("$NetBSD: compile.c,v 1.47 2016/04/05 00:13:03 christos Exp $");
+__RCSID("$NetBSD: compile.c,v 1.48 2019/10/05 20:23:55 christos Exp $");
 #ifdef __FBSDID
 __FBSDID("$FreeBSD: head/usr.bin/sed/compile.c 259132 2013-12-09 18:57:20Z eadler $");
 #endif
@@ -89,6 +89,7 @@ static struct s_command
 		 *findlabel(char *);
 static void	  fixuplabel(struct s_command *, struct s_command *);
 static void	  uselabel(void);
+static void	  parse_escapes(char *);
 
 /*
  * Command specification.  This is used to drive the command parser.
@@ -463,6 +464,7 @@ compile_re(char *re, int case_insensitiv
 	if (case_insensitive)
 		flags |= REG_ICASE;
 	rep = xmalloc(sizeof(regex_t));
+	parse_escapes(re);
 	if ((eval = regcomp(rep, re, flags)) != 0)
 		errx(1, "%lu: %s: RE error: %s",
 linenum, fname, strregerror(eval, rep));
@@ -471,6 +473,134 @@ compile_re(char *re, int case_insensitiv
 	return (rep);
 }
 
+static char
+cton(char c, int base)
+{
+	switch (c) {
+	case '0': case '1': case '2': case '3': case '4':
+	case '5': case '6': case '7':
+		return (char)(c - '0');
+	case '8': case '9':
+		return base == 8 ? '?' : (char)(c - '0');
+	case 'a': case 'b': case 'c': case 'd': case 'e': case 'f':
+		return base == 16 ? (char)(c - 'a' + 10) : '?'; 
+	case 'A': case 'B': case 'C': case 'D': case 'E': case 'F':
+		return base == 16 ? (char)(c - 'A' + 10) : '?'; 
+	default:
+		return '?';
+	}
+}
+
+static int
+ston(char **pp, char *sp, int base)
+{
+	char *p = *pp, n;
+	int r = cton(p[1], base);
+
+	if (r == '?')
+		return 0;
+
+	p++;
+	while ((n = cton(p[1], base)) != '?' && r < 255) {
+		r = r * base + n;
+		p++;
+	}
+	*sp = (char)r;
+	*pp = p;
+	return 1;
+}
+		
+static int
+unescape(char **pp, char **spp)
+{
+	char *p = *pp;
+	char *sp = *spp;
+
+	switch (*p) {
+	case 'o':
+		if (!ston(, sp, 8))
+			return 0;
+		break;
+	case 'd':
+		if (!ston(, sp, 10))
+			return 0;
+		break;
+	case 'x':
+		if (!ston(, sp, 16))
+			return 0;
+		break;
+	case 'a':
+		*sp = '\a';
+		p++;
+		break;
+#if 0
+	// No, \b RE
+	case 'b':
+		*sp = '\b';
+		break;
+#endif
+	case 'f':
+		*sp = '\f';
+		break;
+	case 'n':
+		*sp = '\n';
+		break;
+	case 'r':
+		*sp = '\r';
+		break;
+	case 'v':
+		*sp = '\v';
+		break;
+	default:
+		return 0;
+	}
+	*spp = sp + 1;
+	*pp = p;
+	return 1;
+}
+
+static void
+parse_escapes(char *buf)
+{
+	char bracket = '\0';
+	char *p, *q;
+
+	p = q = buf;
+
+	for (p = q = buf; *p; p++) {
+		if (*p == '\\' && p[1] && !bracket) {
+			p++;
+			if (unescape(, ))
+continue;
+			*q++ = '\\';
+		}
+		switch (*p) {
+		case '[':
+			if (!bracket)
+bracket = *p;
+			break;
+		case '.':
+		case ':':
+		case '=':
+			if (bracket == '[' && p[-1] == '[')
+bracket = *p;
+			break;
+		case ']':
+			if (!bracket)
+			break;
+			if (bracket == '[')
+bracket = '\0';
+			else if (p[-2] != bracket && p[-1] == bracket)
+bracket = '[';
+			break;
+		default:
+			break;
+		}
+		*q++ = *p;
+	}
+	*q = '\0';
+}
+
 /*
  * Compile the substitution string of a regular expression and set res to
  * point to a saved copy of it.  Nsub is the number of parenthesized regular
@@ -508,7 +638,8 @@ compile_subst(char *p, struct s_subst *s
 else
 	p++;
 
-if (*p == '\0') {
+switch (*p) {
+case '\0':
 	/*
 	 * This escaped character is continued
 	 * in the next part of the line.  Note
@@ -519,7 +650,9 @@ compile_subst(char *p, struct s_subst *s
 	sawesc = 1;
 	p--;
 	continue;
-} else if (strchr("123456789", *p) != NULL) {
+case '0': case '1': case '2': case '3':
+case '4': case '5': case '6': case '7':
+case '8': case '9':
 	*sp++ = '\\';
 	ref = (u_char)(*p - '0');
 	if (s->re != NULL &&
@@ -528,8 +661,16 @@ compile_subst(char *p, struct s_subst *s
 linenum, fname, *p);
 	if (s->maxbref < ref)
 		s->maxbref = ref;
-} else if (*p == '&' || *p == '\\')
+	break;
+case '&':
+case '\\':
 	*sp++ = '\\';
+	break;
+

CVS commit: src/usr.bin/sed

2019-10-05 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Oct  5 20:22:36 UTC 2019

Modified Files:
src/usr.bin/sed: main.c

Log Message:
add an abort for a case that can't happen


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/usr.bin/sed/main.c

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

Modified files:

Index: src/usr.bin/sed/main.c
diff -u src/usr.bin/sed/main.c:1.34 src/usr.bin/sed/main.c:1.35
--- src/usr.bin/sed/main.c:1.34	Thu Mar 12 08:40:41 2015
+++ src/usr.bin/sed/main.c	Sat Oct  5 16:22:36 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.34 2015/03/12 12:40:41 christos Exp $	*/
+/*	$NetBSD: main.c,v 1.35 2019/10/05 20:22:36 christos Exp $	*/
 
 /*-
  * Copyright (c) 2013 Johann 'Myrkraverk' Oskarsson.
@@ -39,7 +39,7 @@
 #endif
 
 #include 
-__RCSID("$NetBSD: main.c,v 1.34 2015/03/12 12:40:41 christos Exp $");
+__RCSID("$NetBSD: main.c,v 1.35 2019/10/05 20:22:36 christos Exp $");
 #ifdef __FBSDID
 __FBSDID("$FreeBSD: head/usr.bin/sed/main.c 252231 2013-06-26 04:14:19Z pfg $");
 #endif
@@ -268,6 +268,8 @@ again:
 			s = script->s;
 			state = ST_STRING;
 			goto again;
+		default:
+			abort();
 		}
 	case ST_FILE:
 		if ((p = fgets(buf, n, f)) != NULL) {



CVS commit: src/usr.bin/sed

2019-10-05 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Oct  5 20:22:36 UTC 2019

Modified Files:
src/usr.bin/sed: main.c

Log Message:
add an abort for a case that can't happen


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/usr.bin/sed/main.c

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



CVS commit: src/lib/libc/gen

2019-10-05 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Sat Oct  5 19:19:52 UTC 2019

Modified Files:
src/lib/libc/gen: getlogin.c

Log Message:
getlogin_r: use strcpy().  We check namelen before copying the result.
gcc 8 -Wstringop-overflow is uhappy when the specified bounds depend
on the length of the source and is not smart enough to see the check
we do.  Besides we don't want the padding effect of strncpy() here.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/lib/libc/gen/getlogin.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/libc/gen/getlogin.c
diff -u src/lib/libc/gen/getlogin.c:1.15 src/lib/libc/gen/getlogin.c:1.16
--- src/lib/libc/gen/getlogin.c:1.15	Sun Jan 11 02:46:27 2009
+++ src/lib/libc/gen/getlogin.c	Sat Oct  5 19:19:51 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: getlogin.c,v 1.15 2009/01/11 02:46:27 christos Exp $	*/
+/*	$NetBSD: getlogin.c,v 1.16 2019/10/05 19:19:51 uwe Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -60,7 +60,7 @@
 #if 0
 static char sccsid[] = "@(#)getlogin.c	8.1 (Berkeley) 6/4/93";
 #else
-__RCSID("$NetBSD: getlogin.c,v 1.15 2009/01/11 02:46:27 christos Exp $");
+__RCSID("$NetBSD: getlogin.c,v 1.16 2019/10/05 19:19:51 uwe Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -126,7 +126,7 @@ getlogin_r(char *name, size_t namelen)
 	if (len > namelen) {
 		rv = ERANGE;
 	} else {
-		strncpy(name, logname, len);
+		strcpy(name, logname);
 		rv = 0;
 	}
 	mutex_unlock(_mutex);



CVS commit: src/lib/libc/gen

2019-10-05 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Sat Oct  5 19:19:52 UTC 2019

Modified Files:
src/lib/libc/gen: getlogin.c

Log Message:
getlogin_r: use strcpy().  We check namelen before copying the result.
gcc 8 -Wstringop-overflow is uhappy when the specified bounds depend
on the length of the source and is not smart enough to see the check
we do.  Besides we don't want the padding effect of strncpy() here.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/lib/libc/gen/getlogin.c

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



CVS commit: src/share/mk

2019-10-05 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Sat Oct  5 18:37:40 UTC 2019

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

Log Message:
Don't add -Wabi to CXXFLAGS for gcc 8.  It warns about differences
from the most up-to-date ABI, which in gcc 8 is used by default.
XXX: This needs a better condition.


To generate a diff of this commit:
cvs rdiff -u -r1.292 -r1.293 src/share/mk/bsd.sys.mk

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

Modified files:

Index: src/share/mk/bsd.sys.mk
diff -u src/share/mk/bsd.sys.mk:1.292 src/share/mk/bsd.sys.mk:1.293
--- src/share/mk/bsd.sys.mk:1.292	Wed May 22 08:31:25 2019
+++ src/share/mk/bsd.sys.mk	Sat Oct  5 18:37:39 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.sys.mk,v 1.292 2019/05/22 08:31:25 kamil Exp $
+#	$NetBSD: bsd.sys.mk,v 1.293 2019/10/05 18:37:39 uwe Exp $
 #
 # Build definitions used for NetBSD source tree builds.
 
@@ -103,7 +103,11 @@ CFLAGS+=	-Wcast-qual -Wwrite-strings
 CFLAGS+=	-Wextra -Wno-unused-parameter
 # Readd -Wno-sign-compare to override -Wextra with clang
 CFLAGS+=	-Wno-sign-compare
+.if "${ACTIVE_CC}" == "gcc" && ${HAVE_GCC} != "8"
+#  XXX: Won't warn about anything.  -Wabi warns about differences from
+#  the most up-to-date ABI, which in g++ 8 is used by default.
 CXXFLAGS+=	-Wabi
+.endif
 CXXFLAGS+=	-Wold-style-cast
 CXXFLAGS+=	-Wctor-dtor-privacy -Wnon-virtual-dtor -Wreorder \
 		-Wno-deprecated -Woverloaded-virtual -Wsign-promo -Wsynth



CVS commit: src/share/mk

2019-10-05 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Sat Oct  5 18:37:40 UTC 2019

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

Log Message:
Don't add -Wabi to CXXFLAGS for gcc 8.  It warns about differences
from the most up-to-date ABI, which in gcc 8 is used by default.
XXX: This needs a better condition.


To generate a diff of this commit:
cvs rdiff -u -r1.292 -r1.293 src/share/mk/bsd.sys.mk

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



CVS commit: src/lib/libc/db/db

2019-10-05 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Sat Oct  5 18:07:58 UTC 2019

Modified Files:
src/lib/libc/db/db: db.c

Log Message:
__dberr: tweak signature to make gcc8 -Wbad-function-cast happy about
casts in __dbpanic.  Admittedly this is a bit too "cute".


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/lib/libc/db/db/db.c

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



CVS commit: src/lib/libc/db/db

2019-10-05 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Sat Oct  5 18:07:58 UTC 2019

Modified Files:
src/lib/libc/db/db: db.c

Log Message:
__dberr: tweak signature to make gcc8 -Wbad-function-cast happy about
casts in __dbpanic.  Admittedly this is a bit too "cute".


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/lib/libc/db/db/db.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/libc/db/db/db.c
diff -u src/lib/libc/db/db/db.c:1.19 src/lib/libc/db/db/db.c:1.20
--- src/lib/libc/db/db/db.c:1.19	Sat Oct  5 18:01:52 2019
+++ src/lib/libc/db/db/db.c	Sat Oct  5 18:07:58 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: db.c,v 1.19 2019/10/05 18:01:52 uwe Exp $	*/
+/*	$NetBSD: db.c,v 1.20 2019/10/05 18:07:58 uwe Exp $	*/
 
 /*-
  * Copyright (c) 1991, 1993
@@ -34,7 +34,7 @@
 #endif
 
 #include 
-__RCSID("$NetBSD: db.c,v 1.19 2019/10/05 18:01:52 uwe Exp $");
+__RCSID("$NetBSD: db.c,v 1.20 2019/10/05 18:07:58 uwe Exp $");
 
 #include "namespace.h"
 #include 
@@ -45,7 +45,7 @@ __RCSID("$NetBSD: db.c,v 1.19 2019/10/05
 #include 
 
 #include 
-static int __dberr(void);
+static int __dberr(const DB *, ...);
 
 #ifdef __weak_alias
 __weak_alias(dbopen,_dbopen)
@@ -82,7 +82,7 @@ dbopen(const char *fname, int flags, mod
 }
 
 static int
-__dberr(void)
+__dberr(const DB *dbp, ...)
 {
 	return (RET_ERROR);
 }



CVS commit: src

2019-10-05 Thread Jason High
Module Name:src
Committed By:   jhigh
Date:   Sat Oct  5 18:06:17 UTC 2019

Modified Files:
src/distrib/sets/lists/tests: mi
src/etc/mtree: NetBSD.dist.tests
src/lib/libcrypt: crypt.c
src/tests/usr.bin: Makefile
Added Files:
src/tests/usr.bin/pwhash: Makefile t_pwhash.sh

Log Message:
adding full scheme comparison to libcrypt:crypt and pwhash tests


To generate a diff of this commit:
cvs rdiff -u -r1.821 -r1.822 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.158 -r1.159 src/etc/mtree/NetBSD.dist.tests
cvs rdiff -u -r1.34 -r1.35 src/lib/libcrypt/crypt.c
cvs rdiff -u -r1.27 -r1.28 src/tests/usr.bin/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/usr.bin/pwhash/Makefile \
src/tests/usr.bin/pwhash/t_pwhash.sh

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



CVS commit: src

2019-10-05 Thread Jason High
Module Name:src
Committed By:   jhigh
Date:   Sat Oct  5 18:06:17 UTC 2019

Modified Files:
src/distrib/sets/lists/tests: mi
src/etc/mtree: NetBSD.dist.tests
src/lib/libcrypt: crypt.c
src/tests/usr.bin: Makefile
Added Files:
src/tests/usr.bin/pwhash: Makefile t_pwhash.sh

Log Message:
adding full scheme comparison to libcrypt:crypt and pwhash tests


To generate a diff of this commit:
cvs rdiff -u -r1.821 -r1.822 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.158 -r1.159 src/etc/mtree/NetBSD.dist.tests
cvs rdiff -u -r1.34 -r1.35 src/lib/libcrypt/crypt.c
cvs rdiff -u -r1.27 -r1.28 src/tests/usr.bin/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/usr.bin/pwhash/Makefile \
src/tests/usr.bin/pwhash/t_pwhash.sh

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

Modified files:

Index: src/distrib/sets/lists/tests/mi
diff -u src/distrib/sets/lists/tests/mi:1.821 src/distrib/sets/lists/tests/mi:1.822
--- src/distrib/sets/lists/tests/mi:1.821	Sun Sep 15 16:58:11 2019
+++ src/distrib/sets/lists/tests/mi	Sat Oct  5 18:06:16 2019
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.821 2019/09/15 16:58:11 christos Exp $
+# $NetBSD: mi,v 1.822 2019/10/05 18:06:16 jhigh Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -4208,6 +4208,10 @@
 ./usr/tests/usr.bin/pr/d_basic.in		tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/pr/d_basic.out		tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/pr/t_basic			tests-usr.bin-tests	compattestfile,atf
+./usr/tests/usr.bin/pwhash			tests-usr.bin-tests	compattestfile,atf
+./usr/tests/usr.bin/pwhash/Atffile		tests-usr.bin-tests	compattestfile,atf
+./usr/tests/usr.bin/pwhash/Kyuafile		tests-usr.bin-tests	compattestfile,atf,kyua
+./usr/tests/usr.bin/pwhash/t_pwhash		tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/printf			tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/printf/Atffile		tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/printf/Kyuafile		tests-usr.bin-tests	compattestfile,atf,kyua

Index: src/etc/mtree/NetBSD.dist.tests
diff -u src/etc/mtree/NetBSD.dist.tests:1.158 src/etc/mtree/NetBSD.dist.tests:1.159
--- src/etc/mtree/NetBSD.dist.tests:1.158	Thu Apr  4 19:50:47 2019
+++ src/etc/mtree/NetBSD.dist.tests	Sat Oct  5 18:06:16 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: NetBSD.dist.tests,v 1.158 2019/04/04 19:50:47 kamil Exp $
+#	$NetBSD: NetBSD.dist.tests,v 1.159 2019/10/05 18:06:16 jhigh Exp $
 
 ./usr/libdata/debug/usr/tests
 ./usr/libdata/debug/usr/tests/atf
@@ -416,6 +416,7 @@
 ./usr/tests/usr.bin/pkill
 ./usr/tests/usr.bin/pr
 ./usr/tests/usr.bin/printf
+./usr/tests/usr.bin/pwhash
 ./usr/tests/usr.bin/rump_server
 ./usr/tests/usr.bin/sdiff
 ./usr/tests/usr.bin/sed

Index: src/lib/libcrypt/crypt.c
diff -u src/lib/libcrypt/crypt.c:1.34 src/lib/libcrypt/crypt.c:1.35
--- src/lib/libcrypt/crypt.c:1.34	Wed Jun 17 00:15:26 2015
+++ src/lib/libcrypt/crypt.c	Sat Oct  5 18:06:16 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: crypt.c,v 1.34 2015/06/17 00:15:26 christos Exp $	*/
+/*	$NetBSD: crypt.c,v 1.35 2019/10/05 18:06:16 jhigh Exp $	*/
 
 /*
  * Copyright (c) 1989, 1993
@@ -37,13 +37,14 @@
 #if 0
 static char sccsid[] = "@(#)crypt.c	8.1.1.1 (Berkeley) 8/18/93";
 #else
-__RCSID("$NetBSD: crypt.c,v 1.34 2015/06/17 00:15:26 christos Exp $");
+__RCSID("$NetBSD: crypt.c,v 1.35 2019/10/05 18:06:16 jhigh Exp $");
 #endif
 #endif /* not lint */
 
 #include 
 #include 
 #include 
+#include  /* for strcmp */
 #include 
 #if defined(DEBUG) || defined(MAIN) || defined(UNIT_TEST)
 #include 
@@ -498,6 +499,48 @@ ascii_is_unsafe(char ch)
 }
 
 /*
+ * We extract the scheme from setting str to allow for 
+ * full scheme name comparison
+ * Updated to reflect alc suggestion(s) 
+ *
+ * retuns boolean 0 on failure, 1 on success, 
+ */
+static int 
+nondes_scheme_substr(const char * setting,char * scheme, unsigned int len)
+{
+	const char * start;
+	const char * sep;
+
+	/* initialize head pointer */
+	start = setting;
+
+	/* clear out scheme buffer regardless of result */
+	memset(scheme, 0, len);
+
+	/* make sure we are working on non-des scheme string */
+	if (*start != _PASSWORD_NONDES) {
+		return 0;
+	}
+
+	/* increment passed initial _PASSWORD_NONDES */
+	start++;
+
+	if ((sep = memchr(start, _PASSWORD_NONDES,len-1)) == NULL) {
+		return 0;
+	}
+
+	/* if empty string, we are done */
+	if (sep == start) {
+		return 1;
+	}
+
+	/* copy scheme substr to buffer */
+	memcpy(scheme, start, (size_t)(sep - start));
+
+	return 1;
+}
+
+/*
  * Return a pointer to static data consisting of the "setting"
  * followed by an encryption produced by the "key" and "setting".
  */
@@ -505,24 +548,39 @@ static char *
 __crypt(const char *key, const char *setting)
 {
 	char *encp;
+	char scheme[12]; 
 	int32_t i;
 	int t;
+	int r;
 	int32_t salt;
 	int num_iter, salt_size;
 	C_block keyblock, rsltblock;
 
 	/* Non-DES encryption schemes hook in 

CVS commit: src/lib/libc/db/db

2019-10-05 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Sat Oct  5 18:01:52 UTC 2019

Modified Files:
src/lib/libc/db/db: db.c

Log Message:
__dbpanic: use the official DB typedef name in the casts.  They were
copied from the declaration point where it's not yet available.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/lib/libc/db/db/db.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/libc/db/db/db.c
diff -u src/lib/libc/db/db/db.c:1.18 src/lib/libc/db/db/db.c:1.19
--- src/lib/libc/db/db/db.c:1.18	Tue May 19 13:20:52 2015
+++ src/lib/libc/db/db/db.c	Sat Oct  5 18:01:52 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: db.c,v 1.18 2015/05/19 13:20:52 christos Exp $	*/
+/*	$NetBSD: db.c,v 1.19 2019/10/05 18:01:52 uwe Exp $	*/
 
 /*-
  * Copyright (c) 1991, 1993
@@ -34,7 +34,7 @@
 #endif
 
 #include 
-__RCSID("$NetBSD: db.c,v 1.18 2015/05/19 13:20:52 christos Exp $");
+__RCSID("$NetBSD: db.c,v 1.19 2019/10/05 18:01:52 uwe Exp $");
 
 #include "namespace.h"
 #include 
@@ -97,10 +97,10 @@ void
 __dbpanic(DB *dbp)
 {
 	/* The only thing that can succeed is a close. */
-	dbp->del = (int (*)(const struct __db *, const DBT*, u_int))__dberr;
-	dbp->fd = (int (*)(const struct __db *))__dberr;
-	dbp->get = (int (*)(const struct __db *, const DBT*, DBT *, u_int))__dberr;
-	dbp->put = (int (*)(const struct __db *, DBT *, const DBT *, u_int))__dberr;
-	dbp->seq = (int (*)(const struct __db *, DBT *, DBT *, u_int))__dberr;
-	dbp->sync = (int (*)(const struct __db *, u_int))__dberr;
+	dbp->del = (int (*)(const DB *, const DBT *, u_int))__dberr;
+	dbp->fd = (int (*)(const DB *))__dberr;
+	dbp->get = (int (*)(const DB *, const DBT *, DBT *, u_int))__dberr;
+	dbp->put = (int (*)(const DB *, DBT *, const DBT *, u_int))__dberr;
+	dbp->seq = (int (*)(const DB *, DBT *, DBT *, u_int))__dberr;
+	dbp->sync = (int (*)(const DB *, u_int))__dberr;
 }



CVS commit: src/lib/libc/db/db

2019-10-05 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Sat Oct  5 18:01:52 UTC 2019

Modified Files:
src/lib/libc/db/db: db.c

Log Message:
__dbpanic: use the official DB typedef name in the casts.  They were
copied from the declaration point where it's not yet available.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/lib/libc/db/db/db.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/amd64/conf

2019-10-05 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Sat Oct  5 17:36:47 UTC 2019

Modified Files:
src/sys/arch/amd64/conf: NOCOMPAT

Log Message:
Add a commented-out entry for COMPAT_90 for completeness

NFCI


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/amd64/conf/NOCOMPAT

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

Modified files:

Index: src/sys/arch/amd64/conf/NOCOMPAT
diff -u src/sys/arch/amd64/conf/NOCOMPAT:1.3 src/sys/arch/amd64/conf/NOCOMPAT:1.4
--- src/sys/arch/amd64/conf/NOCOMPAT:1.3	Wed Jun 12 23:17:40 2019
+++ src/sys/arch/amd64/conf/NOCOMPAT	Sat Oct  5 17:36:47 2019
@@ -1,6 +1,6 @@
 include "arch/amd64/conf/GENERIC"
 
-#ident		"NOCOMPAT-$Revision: 1.3 $"
+#ident		"NOCOMPAT-$Revision: 1.4 $"
 
 no options 	SYSVMSG		# System V-like message queues
 no options 	SYSVSEM		# System V-like semaphores
@@ -29,6 +29,7 @@ no options	COMPAT_15
 #no options	COMPAT_60
 #no options	COMPAT_70
 #no options	COMPAT_80
+#no options	COMPAT_90
  
 no options 	COMPAT_OSSAUDIO
 no options 	COMPAT_NETBSD32



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

2019-10-05 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Sat Oct  5 17:36:47 UTC 2019

Modified Files:
src/sys/arch/amd64/conf: NOCOMPAT

Log Message:
Add a commented-out entry for COMPAT_90 for completeness

NFCI


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/amd64/conf/NOCOMPAT

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



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

2019-10-05 Thread Kamil Rytarowski
On 04.10.2019 10:51, matthew green wrote:
> Module Name:  src
> Committed By: mrg
> Date: Fri Oct  4 08:51:33 UTC 2019
> 
> Modified Files:
>   src/external/gpl3/gcc: README.gcc8
>   src/external/gpl3/gcc/dist/gcc/config/aarch64: aarch64-netbsd.h
>   src/external/gpl3/gcc/dist/libsanitizer/lsan: lsan_allocator.cc
>   lsan_allocator.h
>   src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
>   sanitizer_platform_limits_netbsd.h
>   sanitizer_stoptheworld_linux_libcdep.cc
>   src/external/gpl3/gcc/dist/libsanitizer/ubsan: ubsan_handlers_cxx.cc
>   src/external/gpl3/gcc/lib/libsupc++: Makefile.common
>   src/external/gpl3/gcc/lib/libubsan: Makefile
>   src/external/gpl3/gcc/usr.bin/gcc/arch/aarch64: configargs.h
> 
> Log Message:
> - update README.gcc8 to include current status
> - netbsd/arm64 uses 64 byte malloc alignment
> - make lsan compile on sparc*, mips*, ppc and arm64 again
> - add missing sparc, alpha and i386 abi compat for struct __sanitizer_addrinfo
> - avoid linux includes on arm64
> - avoid multiply defined __ubsan_handle_cfi_bad_type when UBSAN_CAN_USE_CXXABI
>   isn't defined, and, undefine it
> - bad_array_length.cc and bad_array_new.cc lose special build rules
> - regen arm64 mknative
> 
> 


ubsan_handlers_cxx.cc should be detached from the build (unless we will
adapt llvm libc++ abi).



signature.asc
Description: OpenPGP digital signature


CVS commit: src/sys/compat/netbsd32

2019-10-05 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Sat Oct  5 14:19:53 UTC 2019

Modified Files:
src/sys/compat/netbsd32: netbsd32_compat_50.c netbsd32_time.c

Log Message:
Validate input before converting timeval::tv_usec in compat/netbsd32


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 src/sys/compat/netbsd32/netbsd32_compat_50.c
cvs rdiff -u -r1.52 -r1.53 src/sys/compat/netbsd32/netbsd32_time.c

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



CVS commit: src/sys/compat/netbsd32

2019-10-05 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Sat Oct  5 14:19:53 UTC 2019

Modified Files:
src/sys/compat/netbsd32: netbsd32_compat_50.c netbsd32_time.c

Log Message:
Validate input before converting timeval::tv_usec in compat/netbsd32


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 src/sys/compat/netbsd32/netbsd32_compat_50.c
cvs rdiff -u -r1.52 -r1.53 src/sys/compat/netbsd32/netbsd32_time.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/compat/netbsd32/netbsd32_compat_50.c
diff -u src/sys/compat/netbsd32/netbsd32_compat_50.c:1.40 src/sys/compat/netbsd32/netbsd32_compat_50.c:1.41
--- src/sys/compat/netbsd32/netbsd32_compat_50.c:1.40	Fri Sep 20 15:09:07 2019
+++ src/sys/compat/netbsd32/netbsd32_compat_50.c	Sat Oct  5 14:19:53 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_compat_50.c,v 1.40 2019/09/20 15:09:07 kamil Exp $	*/
+/*	$NetBSD: netbsd32_compat_50.c,v 1.41 2019/10/05 14:19:53 kamil Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_50.c,v 1.40 2019/09/20 15:09:07 kamil Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_50.c,v 1.41 2019/10/05 14:19:53 kamil Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_netbsd.h"
@@ -216,6 +216,10 @@ compat_50_netbsd32_settimeofday(struct l
 		return error;
 
 	netbsd32_to_timeval50(, );
+
+	if (atv.tv_usec < 0 || atv.tv_usec >= 100)
+		return EINVAL;
+
 	TIMEVAL_TO_TIMESPEC(, );
 	return settime(p, );
 }

Index: src/sys/compat/netbsd32/netbsd32_time.c
diff -u src/sys/compat/netbsd32/netbsd32_time.c:1.52 src/sys/compat/netbsd32/netbsd32_time.c:1.53
--- src/sys/compat/netbsd32/netbsd32_time.c:1.52	Thu Sep 26 01:30:00 2019
+++ src/sys/compat/netbsd32/netbsd32_time.c	Sat Oct  5 14:19:53 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_time.c,v 1.52 2019/09/26 01:30:00 christos Exp $	*/
+/*	$NetBSD: netbsd32_time.c,v 1.53 2019/10/05 14:19:53 kamil Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Matthew R. Green
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_time.c,v 1.52 2019/09/26 01:30:00 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_time.c,v 1.53 2019/10/05 14:19:53 kamil Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_ntp.h"
@@ -243,6 +243,10 @@ netbsd32___settimeofday50(struct lwp *l,
 		return error;
 
 	netbsd32_to_timeval(, );
+
+	if (atv.tv_usec < 0 || atv.tv_usec >= 100)
+		return EINVAL;
+
 	TIMEVAL_TO_TIMESPEC(, );
 	return settime(p, );
 }
@@ -546,4 +550,3 @@ netbsd32_clock_getcpuclockid2(struct lwp
 	}
 	return copyout(_id, SCARG_P32(uap, clock_id), sizeof(clock_id));
 }
-



CVS commit: src/sys/kern

2019-10-05 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Sat Oct  5 12:57:40 UTC 2019

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

Log Message:
Check for valid timespec in clock_settime1()

An alternative approach would be to check the valie in settime1(), but
it would result in multiple checks for valid tv_nsec, as there are
settime1() users that need to check the ranges earlier.

Reported-by: syzbot+96e5ce2c2c704d96c...@syzkaller.appspotmail.com


To generate a diff of this commit:
cvs rdiff -u -r1.200 -r1.201 src/sys/kern/kern_time.c

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



CVS commit: src/sys/kern

2019-10-05 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Sat Oct  5 12:57:40 UTC 2019

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

Log Message:
Check for valid timespec in clock_settime1()

An alternative approach would be to check the valie in settime1(), but
it would result in multiple checks for valid tv_nsec, as there are
settime1() users that need to check the ranges earlier.

Reported-by: syzbot+96e5ce2c2c704d96c...@syzkaller.appspotmail.com


To generate a diff of this commit:
cvs rdiff -u -r1.200 -r1.201 src/sys/kern/kern_time.c

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

Modified files:

Index: src/sys/kern/kern_time.c
diff -u src/sys/kern/kern_time.c:1.200 src/sys/kern/kern_time.c:1.201
--- src/sys/kern/kern_time.c:1.200	Fri Sep 20 14:12:57 2019
+++ src/sys/kern/kern_time.c	Sat Oct  5 12:57:40 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_time.c,v 1.200 2019/09/20 14:12:57 kamil Exp $	*/
+/*	$NetBSD: kern_time.c,v 1.201 2019/10/05 12:57:40 kamil Exp $	*/
 
 /*-
  * Copyright (c) 2000, 2004, 2005, 2007, 2008, 2009 The NetBSD Foundation, Inc.
@@ -61,7 +61,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_time.c,v 1.200 2019/09/20 14:12:57 kamil Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_time.c,v 1.201 2019/10/05 12:57:40 kamil Exp $");
 
 #include 
 #include 
@@ -217,6 +217,9 @@ clock_settime1(struct proc *p, clockid_t
 {
 	int error;
 
+	if (tp->tv_nsec < 0 || tp->tv_nsec >= 10L)
+		return EINVAL;
+
 	switch (clock_id) {
 	case CLOCK_REALTIME:
 		if ((error = settime1(p, tp, check_kauth)) != 0)



CVS commit: src/sys/dev/ic

2019-10-05 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Oct  5 12:27:14 UTC 2019

Modified Files:
src/sys/dev/ic: dwc_mmc.c dwc_mmc_var.h

Log Message:
Add support for SDIO interrupts.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/dev/ic/dwc_mmc.c
cvs rdiff -u -r1.8 -r1.9 src/sys/dev/ic/dwc_mmc_var.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/ic/dwc_mmc.c
diff -u src/sys/dev/ic/dwc_mmc.c:1.17 src/sys/dev/ic/dwc_mmc.c:1.18
--- src/sys/dev/ic/dwc_mmc.c:1.17	Sun Jul 28 10:30:44 2019
+++ src/sys/dev/ic/dwc_mmc.c	Sat Oct  5 12:27:14 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: dwc_mmc.c,v 1.17 2019/07/28 10:30:44 jmcneill Exp $ */
+/* $NetBSD: dwc_mmc.c,v 1.18 2019/10/05 12:27:14 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2014-2017 Jared McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: dwc_mmc.c,v 1.17 2019/07/28 10:30:44 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dwc_mmc.c,v 1.18 2019/10/05 12:27:14 jmcneill Exp $");
 
 #include 
 #include 
@@ -79,16 +79,40 @@ static struct sdmmc_chip_functions dwc_m
 #define MMC_READ(sc, reg) \
 	bus_space_read_4((sc)->sc_bst, (sc)->sc_bsh, (reg))
 
-static void
-dwc_mmc_dump_regs(struct dwc_mmc_softc *sc)
+static int
+dwc_mmc_dmabounce_setup(struct dwc_mmc_softc *sc)
 {
-	device_printf(sc->sc_dev, "device registers:\n");
-	for (u_int off = 0x00; off < 0x100; off += 16) {
-		device_printf(sc->sc_dev, "xx%02x: %08x %08x %08x %08x\n",
-		off,
-		MMC_READ(sc, off + 0), MMC_READ(sc, off + 4),
-		MMC_READ(sc, off + 8), MMC_READ(sc, off + 12));
-	}
+	bus_dma_segment_t ds[1];
+	int error, rseg;
+
+	sc->sc_dmabounce_buflen = dwc_mmc_host_maxblklen(sc);
+	error = bus_dmamem_alloc(sc->sc_dmat, sc->sc_dmabounce_buflen, 0,
+	sc->sc_dmabounce_buflen, ds, 1, , BUS_DMA_WAITOK);
+	if (error)
+		return error;
+	error = bus_dmamem_map(sc->sc_dmat, ds, 1, sc->sc_dmabounce_buflen,
+	>sc_dmabounce_buf, BUS_DMA_WAITOK);
+	if (error)
+		goto free;
+	error = bus_dmamap_create(sc->sc_dmat, sc->sc_dmabounce_buflen, 1,
+	sc->sc_dmabounce_buflen, 0, BUS_DMA_WAITOK, >sc_dmabounce_map);
+	if (error)
+		goto unmap;
+	error = bus_dmamap_load(sc->sc_dmat, sc->sc_dmabounce_map,
+	sc->sc_dmabounce_buf, sc->sc_dmabounce_buflen, NULL,
+	BUS_DMA_WAITOK);
+	if (error)
+		goto destroy;
+	return 0;
+
+destroy:
+	bus_dmamap_destroy(sc->sc_dmat, sc->sc_dmabounce_map);
+unmap:
+	bus_dmamem_unmap(sc->sc_dmat, sc->sc_dmabounce_buf,
+	sc->sc_dmabounce_buflen);
+free:
+	bus_dmamem_free(sc->sc_dmat, ds, rseg);
+	return error;
 }
 
 static int
@@ -145,55 +169,20 @@ dwc_mmc_attach_i(device_t self)
 	saa.saa_sch = sc;
 	saa.saa_clkmin = 400;
 	saa.saa_clkmax = sc->sc_clock_freq / 1000;
+	saa.saa_dmat = sc->sc_dmat;
 	saa.saa_caps = SMC_CAPS_4BIT_MODE|
 		   SMC_CAPS_8BIT_MODE|
 		   SMC_CAPS_SD_HIGHSPEED|
 		   SMC_CAPS_MMC_HIGHSPEED|
-		   SMC_CAPS_AUTO_STOP;
-	if (ISSET(sc->sc_flags, DWC_MMC_F_DMA)) {
-		saa.saa_dmat = sc->sc_dmat;
-		saa.saa_caps |= SMC_CAPS_DMA |
-SMC_CAPS_MULTI_SEG_DMA;
-	}
+		   SMC_CAPS_AUTO_STOP |
+		   SMC_CAPS_DMA |
+		   SMC_CAPS_MULTI_SEG_DMA;
 	if (sc->sc_card_detect)
 		saa.saa_caps |= SMC_CAPS_POLL_CARD_DET;
 
 	sc->sc_sdmmc_dev = config_found(self, , NULL);
 }
 
-static int
-dwc_mmc_wait_rint(struct dwc_mmc_softc *sc, uint32_t mask, int timeout)
-{
-	const bool use_dma = ISSET(sc->sc_flags, DWC_MMC_F_DMA);
-	int retry, error;
-
-	KASSERT(mutex_owned(>sc_intr_lock));
-
-	if (sc->sc_intr_rint & mask)
-		return 0;
-
-	retry = timeout / hz;
-
-	while (retry > 0) {
-		if (use_dma) {
-			error = cv_timedwait(>sc_intr_cv,
-			>sc_intr_lock, hz);
-			if (error && error != EWOULDBLOCK)
-return error;
-			if (sc->sc_intr_rint & mask)
-return 0;
-		} else {
-			sc->sc_intr_rint |= MMC_READ(sc, DWC_MMC_RINT);
-			if (sc->sc_intr_rint & mask)
-return 0;
-			delay(1000);
-		}
-		--retry;
-	}
-
-	return ETIMEDOUT;
-}
-
 static void
 dwc_mmc_led(struct dwc_mmc_softc *sc, int on)
 {
@@ -226,9 +215,9 @@ dwc_mmc_host_reset(sdmmc_chipset_handle_
 
 	MMC_WRITE(sc, DWC_MMC_TIMEOUT, 0x);
 
-	MMC_WRITE(sc, DWC_MMC_IMASK,
-	DWC_MMC_INT_CMD_DONE | DWC_MMC_INT_ERROR |
-	DWC_MMC_INT_DATA_OVER | DWC_MMC_INT_AUTO_CMD_DONE);
+	MMC_WRITE(sc, DWC_MMC_IMASK, 0);
+
+	MMC_WRITE(sc, DWC_MMC_RINT, 0x);
 
 	const uint32_t rx_wmark = (sc->sc_fifo_depth / 2) - 1;
 	const uint32_t tx_wmark = sc->sc_fifo_depth / 2;
@@ -421,56 +410,43 @@ dwc_mmc_bus_rod(sdmmc_chipset_handle_t s
 	return -1;
 }
 
-
-static int
-dwc_mmc_pio_wait(struct dwc_mmc_softc *sc, struct sdmmc_command *cmd)
-{
-	int retry = 0xf;
-	uint32_t bit = (cmd->c_flags & SCF_CMD_READ) ?
-	DWC_MMC_STATUS_FIFO_EMPTY : DWC_MMC_STATUS_FIFO_FULL;
-
-	while (--retry > 0) {
-		uint32_t status = MMC_READ(sc, DWC_MMC_STATUS);
-		if (!(status & bit))
-			return 0;
-		delay(10);
-	}
-
-	return ETIMEDOUT;

CVS commit: src/sys/dev/ic

2019-10-05 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Oct  5 12:27:14 UTC 2019

Modified Files:
src/sys/dev/ic: dwc_mmc.c dwc_mmc_var.h

Log Message:
Add support for SDIO interrupts.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/dev/ic/dwc_mmc.c
cvs rdiff -u -r1.8 -r1.9 src/sys/dev/ic/dwc_mmc_var.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/arm/sunxi

2019-10-05 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Oct  5 12:09:01 UTC 2019

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

Log Message:
Remove SMC_CAPS_POLLING cap


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

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

Modified files:

Index: src/sys/arch/arm/sunxi/sunxi_mmc.c
diff -u src/sys/arch/arm/sunxi/sunxi_mmc.c:1.39 src/sys/arch/arm/sunxi/sunxi_mmc.c:1.40
--- src/sys/arch/arm/sunxi/sunxi_mmc.c:1.39	Thu Oct  3 15:10:32 2019
+++ src/sys/arch/arm/sunxi/sunxi_mmc.c	Sat Oct  5 12:09:01 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: sunxi_mmc.c,v 1.39 2019/10/03 15:10:32 jmcneill Exp $ */
+/* $NetBSD: sunxi_mmc.c,v 1.40 2019/10/05 12:09:01 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2014-2017 Jared McNeill 
@@ -29,7 +29,7 @@
 #include "opt_sunximmc.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sunxi_mmc.c,v 1.39 2019/10/03 15:10:32 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sunxi_mmc.c,v 1.40 2019/10/05 12:09:01 jmcneill Exp $");
 
 #include 
 #include 
@@ -575,8 +575,7 @@ sunxi_mmc_attach_i(device_t self)
 		   SMC_CAPS_MULTI_SEG_DMA |
 		   SMC_CAPS_AUTO_STOP |
 		   SMC_CAPS_SD_HIGHSPEED |
-		   SMC_CAPS_MMC_HIGHSPEED |
-		   SMC_CAPS_POLLING;
+		   SMC_CAPS_MMC_HIGHSPEED;
 
 	if (sc->sc_config->delays || (flags & SUNXI_MMC_FLAG_NEW_TIMINGS))
 		saa.saa_caps |= SMC_CAPS_MMC_DDR52;



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

2019-10-05 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Oct  5 12:09:01 UTC 2019

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

Log Message:
Remove SMC_CAPS_POLLING cap


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

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



CVS commit: src/distrib/utils/embedded/files

2019-10-05 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Sat Oct  5 09:25:11 UTC 2019

Modified Files:
src/distrib/utils/embedded/files: creds_msdos

Log Message:
Fix typo


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/distrib/utils/embedded/files/creds_msdos

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

Modified files:

Index: src/distrib/utils/embedded/files/creds_msdos
diff -u src/distrib/utils/embedded/files/creds_msdos:1.3 src/distrib/utils/embedded/files/creds_msdos:1.4
--- src/distrib/utils/embedded/files/creds_msdos:1.3	Wed Jun 12 03:06:48 2019
+++ src/distrib/utils/embedded/files/creds_msdos	Sat Oct  5 09:25:11 2019
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: creds_msdos,v 1.3 2019/06/12 03:06:48 mrg Exp $
+# $NetBSD: creds_msdos,v 1.4 2019/10/05 09:25:11 mlelstv Exp $
 #
 # Copyright (c) 2019 Matthew R. Green
 # All rights reserved.
@@ -135,7 +135,7 @@ creds_msdos_start()
 	local fstab_file=/etc/fstab
 
 	if [ -z "${creds_msdos_partition}" ]; then
-		echo "Not looking for credientials on msdos"
+		echo "Not looking for credentials on msdos"
 		return
 	fi
 	while read junk1 mp fstype junk2; do



CVS commit: src/distrib/utils/embedded/files

2019-10-05 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Sat Oct  5 09:25:11 UTC 2019

Modified Files:
src/distrib/utils/embedded/files: creds_msdos

Log Message:
Fix typo


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/distrib/utils/embedded/files/creds_msdos

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/include

2019-10-05 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sat Oct  5 07:30:03 UTC 2019

Modified Files:
src/sys/arch/x86/include: pmap.h pte.h

Log Message:
Switch to the new PTE naming. No binary diff (tested with MKREPRO).


To generate a diff of this commit:
cvs rdiff -u -r1.102 -r1.103 src/sys/arch/x86/include/pmap.h
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/x86/include/pte.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/include

2019-10-05 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sat Oct  5 07:30:03 UTC 2019

Modified Files:
src/sys/arch/x86/include: pmap.h pte.h

Log Message:
Switch to the new PTE naming. No binary diff (tested with MKREPRO).


To generate a diff of this commit:
cvs rdiff -u -r1.102 -r1.103 src/sys/arch/x86/include/pmap.h
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/x86/include/pte.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/x86/include/pmap.h
diff -u src/sys/arch/x86/include/pmap.h:1.102 src/sys/arch/x86/include/pmap.h:1.103
--- src/sys/arch/x86/include/pmap.h:1.102	Wed Aug  7 06:23:48 2019
+++ src/sys/arch/x86/include/pmap.h	Sat Oct  5 07:30:03 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.h,v 1.102 2019/08/07 06:23:48 maxv Exp $	*/
+/*	$NetBSD: pmap.h,v 1.103 2019/10/05 07:30:03 maxv Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -315,8 +315,8 @@ struct pmap {
  */
 extern u_long PDPpaddr;
 
-extern pd_entry_t pmap_pg_g;			/* do we support PG_G? */
-extern pd_entry_t pmap_pg_nx;			/* do we support PG_NX? */
+extern pd_entry_t pmap_pg_g;			/* do we support PTE_G? */
+extern pd_entry_t pmap_pg_nx;			/* do we support PTE_NX? */
 extern int pmap_largepages;
 extern long nkptp[PTP_LEVELS];
 
@@ -526,7 +526,7 @@ kvtopte(vaddr_t va)
 	KASSERT(va >= VM_MIN_KERNEL_ADDRESS);
 
 	pde = L2_BASE + pl2_i(va);
-	if (*pde & PG_PS)
+	if (*pde & PTE_PS)
 		return ((pt_entry_t *)pde);
 
 	return (PTE_BASE + pl1_i(va));
@@ -560,7 +560,7 @@ xpmap_ptetomach(pt_entry_t *pte)
 	va = ((va & XPTE_MASK) >> XPTE_SHIFT) | (vaddr_t) PTE_BASE;
 	up_pte = (pt_entry_t *) va;
 
-	return (paddr_t) (((*up_pte) & PG_FRAME) + (((vaddr_t) pte) & (~PG_FRAME & ~VA_SIGN_MASK)));
+	return (paddr_t) (((*up_pte) & PTE_FRAME) + (((vaddr_t) pte) & (~PTE_FRAME & ~VA_SIGN_MASK)));
 }
 
 /* Xen helpers to change bits of a pte */

Index: src/sys/arch/x86/include/pte.h
diff -u src/sys/arch/x86/include/pte.h:1.1 src/sys/arch/x86/include/pte.h:1.2
--- src/sys/arch/x86/include/pte.h:1.1	Tue Jul  6 20:50:35 2010
+++ src/sys/arch/x86/include/pte.h	Sat Oct  5 07:30:03 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: pte.h,v 1.1 2010/07/06 20:50:35 cegger Exp $	*/
+/*	$NetBSD: pte.h,v 1.2 2019/10/05 07:30:03 maxv Exp $	*/
 
 /*
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -33,10 +33,10 @@
 #define _X86_PTE_H
 
 /* Cacheability bits when we are using PAT */
-#define PGC_WB  0   /* The default */
-#define PGC_WC  PG_WT   /* WT and CD is WC */
-#define PGC_UCMINUS PG_N/* UC but mtrr can override */
-#define PGC_UC  (PG_WT | PG_N)  /* hard UC */
+#define PGC_WB		0			/* The default */
+#define PGC_WC		PTE_PWT			/* WT and CD is WC */
+#define PGC_UCMINUS	PTE_PCD			/* UC but mtrr can override */
+#define PGC_UC		(PTE_PWT | PTE_PCD)	/* hard UC */
 
 /*
  * page protection exception bits



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

2019-10-05 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sat Oct  5 07:19:49 UTC 2019

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

Log Message:
Switch to the new PTE naming:

PG_PVLIST -> PTE_PVLIST
PG_W  -> PTE_WIRED
PG_FRAME  -> PTE_FRAME

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.335 -r1.336 src/sys/arch/x86/x86/pmap.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/x86/x86

2019-10-05 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sat Oct  5 07:19:49 UTC 2019

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

Log Message:
Switch to the new PTE naming:

PG_PVLIST -> PTE_PVLIST
PG_W  -> PTE_WIRED
PG_FRAME  -> PTE_FRAME

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.335 -r1.336 src/sys/arch/x86/x86/pmap.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/pmap.c
diff -u src/sys/arch/x86/x86/pmap.c:1.335 src/sys/arch/x86/x86/pmap.c:1.336
--- src/sys/arch/x86/x86/pmap.c:1.335	Wed Aug  7 06:23:48 2019
+++ src/sys/arch/x86/x86/pmap.c	Sat Oct  5 07:19:49 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.335 2019/08/07 06:23:48 maxv Exp $	*/
+/*	$NetBSD: pmap.c,v 1.336 2019/10/05 07:19:49 maxv Exp $	*/
 
 /*
  * Copyright (c) 2008, 2010, 2016, 2017 The NetBSD Foundation, Inc.
@@ -130,7 +130,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.335 2019/08/07 06:23:48 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.336 2019/10/05 07:19:49 maxv Exp $");
 
 #include "opt_user_ldt.h"
 #include "opt_lockdebug.h"
@@ -299,10 +299,10 @@ struct pmap *const kernel_pmap_ptr = 
 struct bootspace bootspace __read_mostly;
 struct slotspace slotspace __read_mostly;
 
-/* Set to PG_NX if supported. */
+/* Set to PTE_NX if supported. */
 pd_entry_t pmap_pg_nx __read_mostly = 0;
 
-/* Set to PG_G if supported. */
+/* Set to PTE_G if supported. */
 pd_entry_t pmap_pg_g __read_mostly = 0;
 
 /* Set to true if large pages are supported. */
@@ -512,10 +512,10 @@ static inline void
 pmap_stats_update_bypte(struct pmap *pmap, pt_entry_t npte, pt_entry_t opte)
 {
 	int resid_diff = ((npte & PTE_P) ? 1 : 0) - ((opte & PTE_P) ? 1 : 0);
-	int wired_diff = ((npte & PG_W) ? 1 : 0) - ((opte & PG_W) ? 1 : 0);
+	int wired_diff = ((npte & PTE_WIRED) ? 1 : 0) - ((opte & PTE_WIRED) ? 1 : 0);
 
-	KASSERT((npte & (PTE_P | PG_W)) != PG_W);
-	KASSERT((opte & (PTE_P | PG_W)) != PG_W);
+	KASSERT((npte & (PTE_P | PTE_WIRED)) != PTE_WIRED);
+	KASSERT((opte & (PTE_P | PTE_WIRED)) != PTE_WIRED);
 
 	pmap_stats_update(pmap, resid_diff, wired_diff);
 }
@@ -973,7 +973,7 @@ pmap_kremove1(vaddr_t sva, vsize_t len, 
 		}
 		KASSERTMSG((opte & PTE_PS) == 0,
 		"va %#" PRIxVADDR " is a large page", va);
-		KASSERTMSG((opte & PG_PVLIST) == 0,
+		KASSERTMSG((opte & PTE_PVLIST) == 0,
 		"va %#" PRIxVADDR " is a pv tracked page", va);
 	}
 	if (localonly) {
@@ -3507,12 +3507,12 @@ pmap_remove_pte(struct pmap *pmap, struc
 	/*
 	 * If we are not on a pv_head list - we are done.
 	 */
-	if ((opte & PG_PVLIST) == 0) {
+	if ((opte & PTE_PVLIST) == 0) {
 #ifndef DOM0OPS
 		KASSERTMSG((PHYS_TO_VM_PAGE(pmap_pte2pa(opte)) == NULL),
-		"managed page without PG_PVLIST for %#"PRIxVADDR, va);
+		"managed page without PTE_PVLIST for %#"PRIxVADDR, va);
 		KASSERTMSG((pmap_pv_tracked(pmap_pte2pa(opte)) == NULL),
-		"pv-tracked page without PG_PVLIST for %#"PRIxVADDR, va);
+		"pv-tracked page without PTE_PVLIST for %#"PRIxVADDR, va);
 #endif
 		return true;
 	}
@@ -3522,7 +3522,7 @@ pmap_remove_pte(struct pmap *pmap, struc
 		pp = VM_PAGE_TO_PP(pg);
 	} else if ((pp = pmap_pv_tracked(pmap_pte2pa(opte))) == NULL) {
 		paddr_t pa = pmap_pte2pa(opte);
-		panic("%s: PG_PVLIST with pv-untracked page"
+		panic("%s: PTE_PVLIST with pv-untracked page"
 		" va = %#"PRIxVADDR"pa = %#"PRIxPADDR" (%#"PRIxPADDR")",
 		__func__, va, pa, atop(pa));
 	}
@@ -4124,8 +4124,8 @@ pmap_unwire(struct pmap *pmap, vaddr_t v
 	opte = *ptep;
 	KASSERT(pmap_valid_entry(opte));
 
-	if (opte & PG_W) {
-		pt_entry_t npte = opte & ~PG_W;
+	if (opte & PTE_WIRED) {
+		pt_entry_t npte = opte & ~PTE_WIRED;
 
 		opte = pmap_pte_testset(ptep, npte);
 		pmap_stats_update_bypte(pmap, npte, opte);
@@ -4202,7 +4202,7 @@ pmap_enter_ma(struct pmap *pmap, vaddr_t
 	npte = ma | protection_codes[prot] | PTE_P;
 	npte |= pmap_pat_flags(flags);
 	if (wired)
-	npte |= PG_W;
+	npte |= PTE_WIRED;
 	if (va < VM_MAXUSER_ADDRESS)
 		npte |= PTE_U;
 
@@ -4224,11 +4224,11 @@ pmap_enter_ma(struct pmap *pmap, vaddr_t
 		new_pg = PHYS_TO_VM_PAGE(pa);
 	if (new_pg != NULL) {
 		/* This is a managed page */
-		npte |= PG_PVLIST;
+		npte |= PTE_PVLIST;
 		new_pp = VM_PAGE_TO_PP(new_pg);
 	} else if ((new_pp = pmap_pv_tracked(pa)) != NULL) {
 		/* This is an unmanaged pv-tracked page */
-		npte |= PG_PVLIST;
+		npte |= PTE_PVLIST;
 	} else {
 		new_pp = NULL;
 	}
@@ -4334,19 +4334,19 @@ pmap_enter_ma(struct pmap *pmap, vaddr_t
 	 * If the same page, we can skip pv_entry handling.
 	 */
 	if (((opte ^ npte) & (PTE_FRAME | PTE_P)) == 0) {
-		KASSERT(((opte ^ npte) & PG_PVLIST) == 0);
+		KASSERT(((opte ^ npte) & PTE_PVLIST) == 0);
 		goto same_pa;
 	}
 
 	/*
 	 * If old page is pv-tracked, remove pv_entry from its list.
 	 */
-	if ((~opte & (PTE_P | PG_PVLIST)) == 0) {
+	if ((~opte & (PTE_P | 

CVS commit: src/share/man/man4

2019-10-05 Thread Ryo ONODERA
Module Name:src
Committed By:   ryoon
Date:   Sat Oct  5 06:28:50 UTC 2019

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

Log Message:
Fix a pasto, uhdiev, bump date


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/share/man/man4/ihidev.4

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

Modified files:

Index: src/share/man/man4/ihidev.4
diff -u src/share/man/man4/ihidev.4:1.2 src/share/man/man4/ihidev.4:1.3
--- src/share/man/man4/ihidev.4:1.2	Mon Dec 11 23:06:35 2017
+++ src/share/man/man4/ihidev.4	Sat Oct  5 06:28:50 2019
@@ -1,4 +1,4 @@
-.\" $NetBSD: ihidev.4,v 1.2 2017/12/11 23:06:35 wiz Exp $
+.\" $NetBSD: ihidev.4,v 1.3 2019/10/05 06:28:50 ryoon Exp $
 .\"
 .\" Copyright (c) 2001,2017 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -27,7 +27,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd December 10, 2017
+.Dd October 5, 2019
 .Dt IHIDEV 4
 .Os
 .Sh NAME
@@ -35,7 +35,7 @@
 .Nd I2C Human Interface Device support
 .Sh SYNOPSIS
 .Cd "ihidev* at iic?"
-.Cd "ims*at uhidev? reportid ?"
+.Cd "ims*at ihidev? reportid ?"
 .Sh DESCRIPTION
 The
 .Nm



CVS commit: src/share/man/man4

2019-10-05 Thread Ryo ONODERA
Module Name:src
Committed By:   ryoon
Date:   Sat Oct  5 06:28:50 UTC 2019

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

Log Message:
Fix a pasto, uhdiev, bump date


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/share/man/man4/ihidev.4

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