CVS commit: src/sys/dev/pci/ixgbe

2021-09-03 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Sep  3 08:43:23 UTC 2021

Modified Files:
src/sys/dev/pci/ixgbe: ix_txrx.c

Log Message:
 Rename variable. No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.88 -r1.89 src/sys/dev/pci/ixgbe/ix_txrx.c

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

Modified files:

Index: src/sys/dev/pci/ixgbe/ix_txrx.c
diff -u src/sys/dev/pci/ixgbe/ix_txrx.c:1.88 src/sys/dev/pci/ixgbe/ix_txrx.c:1.89
--- src/sys/dev/pci/ixgbe/ix_txrx.c:1.88	Thu Aug 26 09:03:47 2021
+++ src/sys/dev/pci/ixgbe/ix_txrx.c	Fri Sep  3 08:43:23 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: ix_txrx.c,v 1.88 2021/08/26 09:03:47 msaitoh Exp $ */
+/* $NetBSD: ix_txrx.c,v 1.89 2021/09/03 08:43:23 msaitoh Exp $ */
 
 /**
 
@@ -64,7 +64,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ix_txrx.c,v 1.88 2021/08/26 09:03:47 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ix_txrx.c,v 1.89 2021/09/03 08:43:23 msaitoh Exp $");
 
 #include "opt_inet.h"
 #include "opt_inet6.h"
@@ -1803,7 +1803,7 @@ ixgbe_rxeof(struct ix_queue *que)
 	struct ixgbe_rx_buf	*rbuf, *nbuf;
 	int			i, nextp, processed = 0;
 	u32			staterr = 0;
-	u32			count = 0;
+	u32			loopcount = 0;
 	u32			limit = adapter->rx_process_limit;
 	bool			discard_multidesc = false;
 #ifdef RSS
@@ -1828,7 +1828,7 @@ ixgbe_rxeof(struct ix_queue *que)
 	 * layer.
 	 */
 	for (i = rxr->next_to_check;
-	 (count < limit) || (discard_multidesc == true);) {
+	 (loopcount < limit) || (discard_multidesc == true);) {
 
 		struct mbuf *sendmp, *mp;
 		struct mbuf *newmp;
@@ -1850,7 +1850,7 @@ ixgbe_rxeof(struct ix_queue *que)
 		if ((staterr & IXGBE_RXD_STAT_DD) == 0)
 			break;
 
-		count++;
+		loopcount++;
 		sendmp = NULL;
 		nbuf = NULL;
 		rsc = 0;



CVS commit: src/sys/dev/pci/ixgbe

2021-09-03 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Sep  3 08:43:23 UTC 2021

Modified Files:
src/sys/dev/pci/ixgbe: ix_txrx.c

Log Message:
 Rename variable. No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.88 -r1.89 src/sys/dev/pci/ixgbe/ix_txrx.c

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



CVS commit: src/sys/dev/pci/ixgbe

2021-09-03 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Sep  3 08:57:58 UTC 2021

Modified Files:
src/sys/dev/pci/ixgbe: ix_txrx.c ixgbe.h

Log Message:
Save the discard_multidesc state to not to forget the state by exiting rxeof().


To generate a diff of this commit:
cvs rdiff -u -r1.89 -r1.90 src/sys/dev/pci/ixgbe/ix_txrx.c
cvs rdiff -u -r1.79 -r1.80 src/sys/dev/pci/ixgbe/ixgbe.h

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



CVS commit: src/sys/dev/pci/ixgbe

2021-09-03 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Sep  3 08:57:58 UTC 2021

Modified Files:
src/sys/dev/pci/ixgbe: ix_txrx.c ixgbe.h

Log Message:
Save the discard_multidesc state to not to forget the state by exiting rxeof().


To generate a diff of this commit:
cvs rdiff -u -r1.89 -r1.90 src/sys/dev/pci/ixgbe/ix_txrx.c
cvs rdiff -u -r1.79 -r1.80 src/sys/dev/pci/ixgbe/ixgbe.h

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

Modified files:

Index: src/sys/dev/pci/ixgbe/ix_txrx.c
diff -u src/sys/dev/pci/ixgbe/ix_txrx.c:1.89 src/sys/dev/pci/ixgbe/ix_txrx.c:1.90
--- src/sys/dev/pci/ixgbe/ix_txrx.c:1.89	Fri Sep  3 08:43:23 2021
+++ src/sys/dev/pci/ixgbe/ix_txrx.c	Fri Sep  3 08:57:58 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: ix_txrx.c,v 1.89 2021/09/03 08:43:23 msaitoh Exp $ */
+/* $NetBSD: ix_txrx.c,v 1.90 2021/09/03 08:57:58 msaitoh Exp $ */
 
 /**
 
@@ -64,7 +64,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ix_txrx.c,v 1.89 2021/09/03 08:43:23 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ix_txrx.c,v 1.90 2021/09/03 08:57:58 msaitoh Exp $");
 
 #include "opt_inet.h"
 #include "opt_inet6.h"
@@ -1568,6 +1568,7 @@ ixgbe_setup_receive_ring(struct rx_ring 
 	rxr->next_to_check = 0;
 	rxr->next_to_refresh = adapter->num_rx_desc - 1; /* Fully allocated */
 	rxr->lro_enabled = FALSE;
+	rxr->discard_multidesc = false;
 	rxr->rx_copies.ev_count = 0;
 #if 0 /* NetBSD */
 	rxr->rx_bytes.ev_count = 0;
@@ -1805,7 +1806,7 @@ ixgbe_rxeof(struct ix_queue *que)
 	u32			staterr = 0;
 	u32			loopcount = 0;
 	u32			limit = adapter->rx_process_limit;
-	bool			discard_multidesc = false;
+	bool			discard_multidesc = rxr->discard_multidesc;
 #ifdef RSS
 	u16			pkt_info;
 #endif
@@ -2114,6 +2115,9 @@ next_desc:
 		}
 	}
 
+	/* Save the current status */
+	rxr->discard_multidesc = discard_multidesc;
+
 	/* Refresh any remaining buf structs */
 	if (ixgbe_rx_unrefreshed(rxr))
 		ixgbe_refresh_mbufs(rxr, i);

Index: src/sys/dev/pci/ixgbe/ixgbe.h
diff -u src/sys/dev/pci/ixgbe/ixgbe.h:1.79 src/sys/dev/pci/ixgbe/ixgbe.h:1.80
--- src/sys/dev/pci/ixgbe/ixgbe.h:1.79	Thu Aug 26 09:03:47 2021
+++ src/sys/dev/pci/ixgbe/ixgbe.h	Fri Sep  3 08:57:58 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.h,v 1.79 2021/08/26 09:03:47 msaitoh Exp $ */
+/* $NetBSD: ixgbe.h,v 1.80 2021/09/03 08:57:58 msaitoh Exp $ */
 
 /**
   SPDX-License-Identifier: BSD-3-Clause
@@ -407,6 +407,7 @@ struct rx_ring {
 	bool			lro_enabled;
 	bool			hw_rsc;
 	bool			vtag_strip;
+	bool			discard_multidesc;
 	u16			next_to_refresh;
 	u16			next_to_check;
 	u16			num_desc;



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

2021-09-03 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Sep  3 10:20:22 UTC 2021

Modified Files:
src/sys/dev/pci [netbsd-9]: if_vte.c

Log Message:
Pull up following revision(s) (requested by andvar in ticket #1339):

sys/dev/pci/if_vte.c: revision 1.32

Restore original MDC speed control register value after MAC reset, if
it wasn't default. Fixes PR port-i386/53494.

ok riastradh


To generate a diff of this commit:
cvs rdiff -u -r1.26.2.1 -r1.26.2.2 src/sys/dev/pci/if_vte.c

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



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

2021-09-03 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Sep  3 10:20:22 UTC 2021

Modified Files:
src/sys/dev/pci [netbsd-9]: if_vte.c

Log Message:
Pull up following revision(s) (requested by andvar in ticket #1339):

sys/dev/pci/if_vte.c: revision 1.32

Restore original MDC speed control register value after MAC reset, if
it wasn't default. Fixes PR port-i386/53494.

ok riastradh


To generate a diff of this commit:
cvs rdiff -u -r1.26.2.1 -r1.26.2.2 src/sys/dev/pci/if_vte.c

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

Modified files:

Index: src/sys/dev/pci/if_vte.c
diff -u src/sys/dev/pci/if_vte.c:1.26.2.1 src/sys/dev/pci/if_vte.c:1.26.2.2
--- src/sys/dev/pci/if_vte.c:1.26.2.1	Wed Nov  6 09:59:39 2019
+++ src/sys/dev/pci/if_vte.c	Fri Sep  3 10:20:22 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_vte.c,v 1.26.2.1 2019/11/06 09:59:39 martin Exp $	*/
+/*	$NetBSD: if_vte.c,v 1.26.2.2 2021/09/03 10:20:22 martin Exp $	*/
 
 /*
  * Copyright (c) 2011 Manuel Bouyer.  All rights reserved.
@@ -55,7 +55,7 @@
 /* Driver for DM&P Electronics, Inc, Vortex86 RDC R6040 FastEthernet. */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_vte.c,v 1.26.2.1 2019/11/06 09:59:39 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_vte.c,v 1.26.2.2 2021/09/03 10:20:22 martin Exp $");
 
 #include 
 #include 
@@ -1200,9 +1200,10 @@ vte_tick(void *arg)
 static void
 vte_reset(struct vte_softc *sc)
 {
-	uint16_t mcr;
+	uint16_t mcr, mdcsc;
 	int i;
 
+	mdcsc = CSR_READ_2(sc, VTE_MDCSC);
 	mcr = CSR_READ_2(sc, VTE_MCR1);
 	CSR_WRITE_2(sc, VTE_MCR1, mcr | MCR1_MAC_RESET);
 	for (i = VTE_RESET_TIMEOUT; i > 0; i--) {
@@ -1220,6 +1221,14 @@ vte_reset(struct vte_softc *sc)
 	CSR_WRITE_2(sc, VTE_MACSM, 0x0002);
 	CSR_WRITE_2(sc, VTE_MACSM, 0);
 	DELAY(5000);
+
+	/*
+	 * On some SoCs (like Vortex86DX3) MDC speed control register value
+	 * needs to be restored to original value instead of default one,
+	 * otherwise some PHY registers may fail to be read.
+	 */
+	if (mdcsc != MDCSC_DEFAULT)
+		CSR_WRITE_2(sc, VTE_MDCSC, mdcsc);
 }
 
 



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

2021-09-03 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Sep  3 10:23:18 UTC 2021

Modified Files:
src/sys/dev/pci [netbsd-8]: if_vte.c

Log Message:
Pull up following revision(s) (requested by andvar in ticket #1693):

sys/dev/pci/if_vte.c: revision 1.32

Restore original MDC speed control register value after MAC reset, if
it wasn't default. Fixes PR port-i386/53494.

ok riastradh


To generate a diff of this commit:
cvs rdiff -u -r1.17.2.2 -r1.17.2.3 src/sys/dev/pci/if_vte.c

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



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

2021-09-03 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Sep  3 10:23:18 UTC 2021

Modified Files:
src/sys/dev/pci [netbsd-8]: if_vte.c

Log Message:
Pull up following revision(s) (requested by andvar in ticket #1693):

sys/dev/pci/if_vte.c: revision 1.32

Restore original MDC speed control register value after MAC reset, if
it wasn't default. Fixes PR port-i386/53494.

ok riastradh


To generate a diff of this commit:
cvs rdiff -u -r1.17.2.2 -r1.17.2.3 src/sys/dev/pci/if_vte.c

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

Modified files:

Index: src/sys/dev/pci/if_vte.c
diff -u src/sys/dev/pci/if_vte.c:1.17.2.2 src/sys/dev/pci/if_vte.c:1.17.2.3
--- src/sys/dev/pci/if_vte.c:1.17.2.2	Wed Nov  6 10:04:47 2019
+++ src/sys/dev/pci/if_vte.c	Fri Sep  3 10:23:17 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_vte.c,v 1.17.2.2 2019/11/06 10:04:47 martin Exp $	*/
+/*	$NetBSD: if_vte.c,v 1.17.2.3 2021/09/03 10:23:17 martin Exp $	*/
 
 /*
  * Copyright (c) 2011 Manuel Bouyer.  All rights reserved.
@@ -55,7 +55,7 @@
 /* Driver for DM&P Electronics, Inc, Vortex86 RDC R6040 FastEthernet. */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_vte.c,v 1.17.2.2 2019/11/06 10:04:47 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_vte.c,v 1.17.2.3 2021/09/03 10:23:17 martin Exp $");
 
 #include 
 #include 
@@ -1194,9 +1194,10 @@ vte_tick(void *arg)
 static void
 vte_reset(struct vte_softc *sc)
 {
-	uint16_t mcr;
+	uint16_t mcr, mdcsc;
 	int i;
 
+	mdcsc = CSR_READ_2(sc, VTE_MDCSC);
 	mcr = CSR_READ_2(sc, VTE_MCR1);
 	CSR_WRITE_2(sc, VTE_MCR1, mcr | MCR1_MAC_RESET);
 	for (i = VTE_RESET_TIMEOUT; i > 0; i--) {
@@ -1214,6 +1215,14 @@ vte_reset(struct vte_softc *sc)
 	CSR_WRITE_2(sc, VTE_MACSM, 0x0002);
 	CSR_WRITE_2(sc, VTE_MACSM, 0);
 	DELAY(5000);
+
+	/*
+	 * On some SoCs (like Vortex86DX3) MDC speed control register value
+	 * needs to be restored to original value instead of default one,
+	 * otherwise some PHY registers may fail to be read.
+	 */
+	if (mdcsc != MDCSC_DEFAULT)
+		CSR_WRITE_2(sc, VTE_MDCSC, mdcsc);
 }
 
 



CVS commit: [netbsd-8] src/doc

2021-09-03 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Sep  3 10:24:10 UTC 2021

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

Log Message:
Ticket #1693


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

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



CVS commit: [netbsd-8] src/doc

2021-09-03 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Sep  3 10:24:10 UTC 2021

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

Log Message:
Ticket #1693


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

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

Modified files:

Index: src/doc/CHANGES-8.3
diff -u src/doc/CHANGES-8.3:1.1.2.97 src/doc/CHANGES-8.3:1.1.2.98
--- src/doc/CHANGES-8.3:1.1.2.97	Fri Aug 20 19:35:59 2021
+++ src/doc/CHANGES-8.3	Fri Sep  3 10:24:09 2021
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-8.3,v 1.1.2.97 2021/08/20 19:35:59 martin Exp $
+# $NetBSD: CHANGES-8.3,v 1.1.2.98 2021/09/03 10:24:09 martin Exp $
 
 A complete list of changes from the NetBSD 8.2 release to the NetBSD 8.3
 release:
@@ -2006,3 +2006,9 @@ sys/netinet6/nd6.c1.277
 	nd6: avoid use-after-free in ND L2 cache.
 	[ozaki-r, ticket #1692]
 
+sys/dev/pci/if_vte.c1.32
+
+	vte(4): PR 53494: restore original MDC speed control register value
+	after MAC reset.
+	[andvar, ticket #1693]
+



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

2021-09-03 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Sep  3 10:25:36 UTC 2021

Modified Files:
src/sys/dev/usb [netbsd-9]: ehci.c

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

sys/dev/usb/ehci.c: revision 1.286

add missing newline and fix conditional for askroot/single user
hand over delay message.  PR#56366.


To generate a diff of this commit:
cvs rdiff -u -r1.267.2.4 -r1.267.2.5 src/sys/dev/usb/ehci.c

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



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

2021-09-03 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Sep  3 10:25:36 UTC 2021

Modified Files:
src/sys/dev/usb [netbsd-9]: ehci.c

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

sys/dev/usb/ehci.c: revision 1.286

add missing newline and fix conditional for askroot/single user
hand over delay message.  PR#56366.


To generate a diff of this commit:
cvs rdiff -u -r1.267.2.4 -r1.267.2.5 src/sys/dev/usb/ehci.c

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

Modified files:

Index: src/sys/dev/usb/ehci.c
diff -u src/sys/dev/usb/ehci.c:1.267.2.4 src/sys/dev/usb/ehci.c:1.267.2.5
--- src/sys/dev/usb/ehci.c:1.267.2.4	Wed Dec 23 12:34:38 2020
+++ src/sys/dev/usb/ehci.c	Fri Sep  3 10:25:36 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: ehci.c,v 1.267.2.4 2020/12/23 12:34:38 martin Exp $ */
+/*	$NetBSD: ehci.c,v 1.267.2.5 2021/09/03 10:25:36 martin Exp $ */
 
 /*
  * Copyright (c) 2004-2012 The NetBSD Foundation, Inc.
@@ -53,7 +53,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.267.2.4 2020/12/23 12:34:38 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.267.2.5 2021/09/03 10:25:36 martin Exp $");
 
 #include "ohci.h"
 #include "uhci.h"
@@ -2654,8 +2654,8 @@ ehci_disown_sched_callback(ehci_softc_t 
 	mutex_exit(&sc->sc_complock);
 
 	config_pending_incr(sc->sc_dev);
-	aprint_normal("delaying %s by %u seconds due to USB owner change.",
-	(boothowto & RB_ASKNAME) == 0 ? "ask root" : "single user",
+	aprint_normal("delaying %s by %u seconds due to USB owner change.\n",
+	(boothowto & RB_ASKNAME) != 0 ? "ask root" : "single user",
 	ehci_disown_delay_seconds);
 }
 



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

2021-09-03 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Sep  3 10:27:33 UTC 2021

Modified Files:
src/sys/arch/x86/x86 [netbsd-9]: pmap.c

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

sys/arch/x86/x86/pmap.c: revision 1.410

Make pat_init() a NOOP on XENPV; it causes a trap with Xen 4.15


To generate a diff of this commit:
cvs rdiff -u -r1.334.2.5 -r1.334.2.6 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: [netbsd-9] src/sys/arch/x86/x86

2021-09-03 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Sep  3 10:27:33 UTC 2021

Modified Files:
src/sys/arch/x86/x86 [netbsd-9]: pmap.c

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

sys/arch/x86/x86/pmap.c: revision 1.410

Make pat_init() a NOOP on XENPV; it causes a trap with Xen 4.15


To generate a diff of this commit:
cvs rdiff -u -r1.334.2.5 -r1.334.2.6 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.334.2.5 src/sys/arch/x86/x86/pmap.c:1.334.2.6
--- src/sys/arch/x86/x86/pmap.c:1.334.2.5	Thu Sep  3 13:45:24 2020
+++ src/sys/arch/x86/x86/pmap.c	Fri Sep  3 10:27:33 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.334.2.5 2020/09/03 13:45:24 martin Exp $	*/
+/*	$NetBSD: pmap.c,v 1.334.2.6 2021/09/03 10:27:33 martin Exp $	*/
 
 /*
  * Copyright (c) 2008, 2010, 2016, 2017 The NetBSD Foundation, Inc.
@@ -130,7 +130,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.334.2.5 2020/09/03 13:45:24 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.334.2.6 2021/09/03 10:27:33 martin Exp $");
 
 #include "opt_user_ldt.h"
 #include "opt_lockdebug.h"
@@ -806,6 +806,7 @@ pmap_exec_fixup(struct vm_map *map, stru
 void
 pat_init(struct cpu_info *ci)
 {
+#ifndef XENPV
 	uint64_t pat;
 
 	if (!(ci->ci_feat_val[0] & CPUID_PAT))
@@ -819,6 +820,7 @@ pat_init(struct cpu_info *ci)
 
 	wrmsr(MSR_CR_PAT, pat);
 	cpu_pat_enabled = true;
+#endif
 }
 
 static pt_entry_t



CVS commit: [netbsd-9] src/doc

2021-09-03 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Sep  3 10:28:29 UTC 2021

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

Log Message:
Tickets #1339 - #1341


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

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



CVS commit: [netbsd-9] src/doc

2021-09-03 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Sep  3 10:28:29 UTC 2021

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

Log Message:
Tickets #1339 - #1341


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

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

Modified files:

Index: src/doc/CHANGES-9.3
diff -u src/doc/CHANGES-9.3:1.1.2.24 src/doc/CHANGES-9.3:1.1.2.25
--- src/doc/CHANGES-9.3:1.1.2.24	Fri Aug 20 19:33:44 2021
+++ src/doc/CHANGES-9.3	Fri Sep  3 10:28:29 2021
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-9.3,v 1.1.2.24 2021/08/20 19:33:44 martin Exp $
+# $NetBSD: CHANGES-9.3,v 1.1.2.25 2021/09/03 10:28:29 martin Exp $
 
 A complete list of changes from the NetBSD 9.2 release to the NetBSD 9.3
 release:
@@ -605,4 +605,20 @@ sys/netinet6/nd6.c1.277
 	nd6: avoid use-after-free in ND L2 cache.
 	[ozaki-r, ticket #1338]
 
+sys/dev/pci/if_vte.c1.32
+
+	vte(4): PR 53494: restore original MDC speed control register value
+	after MAC reset.
+	[andvar, ticket #1339]
+
+sys/dev/usb/ehci.c1.286
+
+	PR 56366: add missing newline and fix conditional for askroot/single
+	user hand over delay message.
+	[mrg, ticket #1340]
+
+sys/arch/x86/x86/pmap.c1.410
+
+	xen: Make pat_init() a NOOP on XENPV; it causes a trap with Xen 4.15.
+	[manu, ticket #1341]
 



CVS commit: src/crypto/external/bsd/openssh/dist

2021-09-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Sep  3 10:30:33 UTC 2021

Modified Files:
src/crypto/external/bsd/openssh/dist: cipher-chachapoly-libcrypto.c
includes.h kexsntrup761x25519.c namespace.h sntrup761.c

Log Message:
add some more functions to namespace.h; add missing RCSIDs


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 \
src/crypto/external/bsd/openssh/dist/cipher-chachapoly-libcrypto.c \
src/crypto/external/bsd/openssh/dist/kexsntrup761x25519.c \
src/crypto/external/bsd/openssh/dist/sntrup761.c
cvs rdiff -u -r1.8 -r1.9 src/crypto/external/bsd/openssh/dist/includes.h
cvs rdiff -u -r1.9 -r1.10 src/crypto/external/bsd/openssh/dist/namespace.h

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



CVS commit: src/crypto/external/bsd/openssh/dist

2021-09-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Sep  3 10:30:33 UTC 2021

Modified Files:
src/crypto/external/bsd/openssh/dist: cipher-chachapoly-libcrypto.c
includes.h kexsntrup761x25519.c namespace.h sntrup761.c

Log Message:
add some more functions to namespace.h; add missing RCSIDs


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 \
src/crypto/external/bsd/openssh/dist/cipher-chachapoly-libcrypto.c \
src/crypto/external/bsd/openssh/dist/kexsntrup761x25519.c \
src/crypto/external/bsd/openssh/dist/sntrup761.c
cvs rdiff -u -r1.8 -r1.9 src/crypto/external/bsd/openssh/dist/includes.h
cvs rdiff -u -r1.9 -r1.10 src/crypto/external/bsd/openssh/dist/namespace.h

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

Modified files:

Index: src/crypto/external/bsd/openssh/dist/cipher-chachapoly-libcrypto.c
diff -u src/crypto/external/bsd/openssh/dist/cipher-chachapoly-libcrypto.c:1.1.1.1 src/crypto/external/bsd/openssh/dist/cipher-chachapoly-libcrypto.c:1.2
--- src/crypto/external/bsd/openssh/dist/cipher-chachapoly-libcrypto.c:1.1.1.1	Thu May 28 13:02:59 2020
+++ src/crypto/external/bsd/openssh/dist/cipher-chachapoly-libcrypto.c	Fri Sep  3 06:30:33 2021
@@ -1,3 +1,4 @@
+/*	$NetBSD: cipher-chachapoly-libcrypto.c,v 1.2 2021/09/03 10:30:33 christos Exp $	*/
 /*
  * Copyright (c) 2013 Damien Miller 
  *
@@ -15,6 +16,8 @@
  */
 
 /* $OpenBSD: cipher-chachapoly-libcrypto.c,v 1.1 2020/04/03 04:32:21 djm Exp $ */
+#include "includes.h"
+__RCSID("$NetBSD: cipher-chachapoly-libcrypto.c,v 1.2 2021/09/03 10:30:33 christos Exp $");
 
 #include 
 #include  /* needed for log.h */
Index: src/crypto/external/bsd/openssh/dist/kexsntrup761x25519.c
diff -u src/crypto/external/bsd/openssh/dist/kexsntrup761x25519.c:1.1.1.1 src/crypto/external/bsd/openssh/dist/kexsntrup761x25519.c:1.2
--- src/crypto/external/bsd/openssh/dist/kexsntrup761x25519.c:1.1.1.1	Fri Mar  5 12:45:25 2021
+++ src/crypto/external/bsd/openssh/dist/kexsntrup761x25519.c	Fri Sep  3 06:30:33 2021
@@ -1,3 +1,4 @@
+/*	$NetBSD: kexsntrup761x25519.c,v 1.2 2021/09/03 10:30:33 christos Exp $	*/
 /* $OpenBSD: kexsntrup761x25519.c,v 1.1 2020/12/29 00:59:15 djm Exp $ */
 /*
  * Copyright (c) 2019 Markus Friedl.  All rights reserved.
@@ -23,6 +24,9 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+#include "includes.h"
+__RCSID("$NetBSD: kexsntrup761x25519.c,v 1.2 2021/09/03 10:30:33 christos Exp $");
+
 #include 
 
 #include 
Index: src/crypto/external/bsd/openssh/dist/sntrup761.c
diff -u src/crypto/external/bsd/openssh/dist/sntrup761.c:1.1.1.1 src/crypto/external/bsd/openssh/dist/sntrup761.c:1.2
--- src/crypto/external/bsd/openssh/dist/sntrup761.c:1.1.1.1	Fri Mar  5 12:45:26 2021
+++ src/crypto/external/bsd/openssh/dist/sntrup761.c	Fri Sep  3 06:30:33 2021
@@ -1,3 +1,4 @@
+/*	$NetBSD: sntrup761.c,v 1.2 2021/09/03 10:30:33 christos Exp $	*/
 /*  $OpenBSD: sntrup761.c,v 1.5 2021/01/08 02:33:13 dtucker Exp $ */
 
 /*
@@ -7,6 +8,8 @@
  * - Tanja Lange
  * - Christine van Vredendaal
  */
+#include "includes.h"
+__RCSID("$NetBSD: sntrup761.c,v 1.2 2021/09/03 10:30:33 christos Exp $");
 
 #include 
 #include "crypto_api.h"

Index: src/crypto/external/bsd/openssh/dist/includes.h
diff -u src/crypto/external/bsd/openssh/dist/includes.h:1.8 src/crypto/external/bsd/openssh/dist/includes.h:1.9
--- src/crypto/external/bsd/openssh/dist/includes.h:1.8	Fri Apr  6 14:59:00 2018
+++ src/crypto/external/bsd/openssh/dist/includes.h	Fri Sep  3 06:30:33 2021
@@ -1,13 +1,14 @@
-/*	$NetBSD: includes.h,v 1.8 2018/04/06 18:59:00 christos Exp $	*/
+/*	$NetBSD: includes.h,v 1.9 2021/09/03 10:30:33 christos Exp $	*/
 #include 
 #ifndef __OpenBSD__
 #define __bounded__(a, b, c)
 #include 
+
+#include "namespace.h"
+
 void freezero(void *, size_t);
 #define explicit_bzero(a, b) explicit_memset((a), 0, (b))
 #define timingsafe_bcmp(a, b, c) (!consttime_memequal((a), (b), (c)))
-#include 
 void	*recallocarray(void *, size_t, size_t, size_t);
 #endif
 
-#include "namespace.h"

Index: src/crypto/external/bsd/openssh/dist/namespace.h
diff -u src/crypto/external/bsd/openssh/dist/namespace.h:1.9 src/crypto/external/bsd/openssh/dist/namespace.h:1.10
--- src/crypto/external/bsd/openssh/dist/namespace.h:1.9	Fri Mar  5 12:47:16 2021
+++ src/crypto/external/bsd/openssh/dist/namespace.h	Fri Sep  3 06:30:33 2021
@@ -1,27 +1,98 @@
-/*	$NetBSD: namespace.h,v 1.9 2021/03/05 17:47:16 christos Exp $	*/
+/*	$NetBSD: namespace.h,v 1.10 2021/09/03 10:30:33 christos Exp $	*/
 #ifndef _SSH_NAMESPACE_H_
-#define _SSH_NAMESPACE_H_
-#define addargs		ssh_addargs
-#define atomicio	ssh_atomicio
-#define chop		ssh_chop
-#define colon		ssh_colon
-#define convtime	ssh_convtime
-#define do_log		ssh_do_log
-#define freeargs	ssh_freeargs
-#define freerrset	ssh_freerrset
-#define hpdelim		ssh_hpdelim
-#define getpass		ssh_getpass
-#define getpeereid	ssh_getpeereid
-#define getrrsetbyname	ssh_g

CVS commit: src/sys/external/bsd/acpica/dist

2021-09-03 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Fri Sep  3 11:59:29 UTC 2021

Modified Files:
src/sys/external/bsd/acpica/dist/include/platform: acnetbsd.h
src/sys/external/bsd/acpica/dist/utilities: utxferror.c

Log Message:
Suppress table loading messages if AB_QUIET or AB_SILENT flags are set.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 \
src/sys/external/bsd/acpica/dist/include/platform/acnetbsd.h
cvs rdiff -u -r1.1.1.14 -r1.2 \
src/sys/external/bsd/acpica/dist/utilities/utxferror.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/acpica/dist

2021-09-03 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Fri Sep  3 11:59:29 UTC 2021

Modified Files:
src/sys/external/bsd/acpica/dist/include/platform: acnetbsd.h
src/sys/external/bsd/acpica/dist/utilities: utxferror.c

Log Message:
Suppress table loading messages if AB_QUIET or AB_SILENT flags are set.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 \
src/sys/external/bsd/acpica/dist/include/platform/acnetbsd.h
cvs rdiff -u -r1.1.1.14 -r1.2 \
src/sys/external/bsd/acpica/dist/utilities/utxferror.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/acpica/dist/include/platform/acnetbsd.h
diff -u src/sys/external/bsd/acpica/dist/include/platform/acnetbsd.h:1.22 src/sys/external/bsd/acpica/dist/include/platform/acnetbsd.h:1.23
--- src/sys/external/bsd/acpica/dist/include/platform/acnetbsd.h:1.22	Sat Apr  3 17:45:03 2021
+++ src/sys/external/bsd/acpica/dist/include/platform/acnetbsd.h	Fri Sep  3 11:59:28 2021
@@ -1,7 +1,7 @@
 /**
  *
  * Name: acnetbsd.h - OS specific defines, etc.
- *   $Revision: 1.22 $
+ *   $Revision: 1.23 $
  *
  */
 
@@ -65,6 +65,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -144,4 +145,8 @@
 #define ACPI_USE_NATIVE_DIVIDE
 #define ACPI_USE_NATIVE_MATH64
 
+/* Suppress ACPI_INFO level log messages when this is true */
+#define	ACPI_QUIET_BOOT	\
+	((boothowto & (AB_QUIET|AB_SILENT)) != 0)
+
 #endif /* __ACNETBSD_H__ */

Index: src/sys/external/bsd/acpica/dist/utilities/utxferror.c
diff -u src/sys/external/bsd/acpica/dist/utilities/utxferror.c:1.1.1.14 src/sys/external/bsd/acpica/dist/utilities/utxferror.c:1.2
--- src/sys/external/bsd/acpica/dist/utilities/utxferror.c:1.1.1.14	Sat Apr  3 17:43:37 2021
+++ src/sys/external/bsd/acpica/dist/utilities/utxferror.c	Fri Sep  3 11:59:29 2021
@@ -206,6 +206,11 @@ AcpiInfo (
 {
 va_list ArgList;
 
+#if defined(ACPI_QUIET_BOOT)
+if (ACPI_QUIET_BOOT) {
+return;
+}
+#endif
 
 ACPI_MSG_REDIRECT_BEGIN;
 AcpiOsPrintf (ACPI_MSG_INFO);



CVS commit: src/lib/libedit

2021-09-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Sep  3 12:20:38 UTC 2021

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

Log Message:
Try to refactor this in order to correct some of the memory issues
reported by Christian Holler.


To generate a diff of this commit:
cvs rdiff -u -r1.164 -r1.165 src/lib/libedit/readline.c

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



CVS commit: src/lib/libedit

2021-09-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Sep  3 12:20:38 UTC 2021

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

Log Message:
Try to refactor this in order to correct some of the memory issues
reported by Christian Holler.


To generate a diff of this commit:
cvs rdiff -u -r1.164 -r1.165 src/lib/libedit/readline.c

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

Modified files:

Index: src/lib/libedit/readline.c
diff -u src/lib/libedit/readline.c:1.164 src/lib/libedit/readline.c:1.165
--- src/lib/libedit/readline.c:1.164	Sat Aug 21 08:38:56 2021
+++ src/lib/libedit/readline.c	Fri Sep  3 08:20:38 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: readline.c,v 1.164 2021/08/21 12:38:56 christos Exp $	*/
+/*	$NetBSD: readline.c,v 1.165 2021/09/03 12:20:38 christos Exp $	*/
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include "config.h"
 #if !defined(lint) && !defined(SCCSID)
-__RCSID("$NetBSD: readline.c,v 1.164 2021/08/21 12:38:56 christos Exp $");
+__RCSID("$NetBSD: readline.c,v 1.165 2021/09/03 12:20:38 christos Exp $");
 #endif /* not lint && not SCCSID */
 
 #include 
@@ -460,14 +460,10 @@ readline(const char *p)
 	ret = el_gets(e, &count);
 
 	if (ret && count > 0) {
-		int lastidx;
-
 		buf = strdup(ret);
 		if (buf == NULL)
 			goto out;
-		lastidx = count - 1;
-		if (buf[lastidx] == '\n')
-			buf[lastidx] = '\0';
+		buf[strcspn(buf, "\n")] = '\0';
 	} else
 		buf = NULL;
 
@@ -665,6 +661,120 @@ get_history_event(const char *cmd, int *
 	return rptr;
 }
 
+static int
+getfrom(const char **cmdp, char **fromp, const char *search, int delim)
+{
+	size_t size = 16;
+	size_t len = 0;
+	const char *cmd = *cmdp;
+	char *what = el_realloc(*fromp, size * sizeof(*what));
+	if (what == NULL){
+		el_free(*fromp);
+		*fromp = NULL;
+		return 0;
+	}
+	for (; *cmd && *cmd != delim; cmd++) {
+		if (*cmd == '\\' && cmd[1] == delim)
+			cmd++;
+		if (len >= size) {
+			char *nwhat;
+			nwhat = el_realloc(what, (size <<= 1) * sizeof(*nwhat));
+			if (nwhat == NULL) {
+el_free(what);
+el_free(*fromp);
+*cmdp = cmd;
+*fromp = NULL;
+return 0;
+			}
+			what = nwhat;
+		}
+		what[len++] = *cmd;
+	}
+	what[len] = '\0';
+	*fromp = what;
+	*cmdp = cmd;
+	if (*what == '\0') {
+		el_free(what);
+		if (search) {
+			*fromp = strdup(search);
+			if (*fromp == NULL) {
+return 0;
+			}
+		} else {
+			*fromp = NULL;
+			return -1;
+		}
+	}
+	if (!*cmd) {
+		el_free(what);
+		return -1;
+	}
+
+	cmd++;	/* shift after delim */
+	*cmdp = cmd;
+
+	if (!*cmd) {
+		el_free(what);
+		return -1;
+	}
+	return 1;
+}
+
+static int
+getto(const char **cmdp, char **top, const char *from, int delim)
+{
+	size_t size = 16;
+	size_t len = 0;
+	size_t from_len = strlen(from);
+	const char *cmd = *cmdp;
+	char *with = el_realloc(*top, size * sizeof(*with));
+	if (with == NULL)
+		goto out;
+
+	for (; *cmd && *cmd != delim; cmd++) {
+		if (len + from_len + 1 >= size) {
+			char *nwith;
+			size += from_len + 1;
+			nwith = el_realloc(with, size * sizeof(*nwith));
+			if (nwith == NULL)
+goto out;
+			with = nwith;
+		}
+		if (*cmd == '&') {
+			/* safe */
+			strcpy(&with[len], from);
+			len += from_len;
+			continue;
+		}
+		if (*cmd == '\\' && (*(cmd + 1) == delim || *(cmd + 1) == '&'))
+			cmd++;
+		with[len++] = *cmd;
+	}
+	if (!*cmd)
+		goto out;
+	with[len] = '\0';
+	*top = with;
+	*cmdp = cmd;
+	return 1;
+out:
+	el_free(with);
+	el_free(*top);
+	*top = NULL;
+	*cmdp = cmd;
+	return -1;
+}
+
+static void
+replace(char **tmp, int c)
+{
+	char *aptr;
+	if ((aptr = strrchr(*tmp, c)) == NULL)
+		return;
+	aptr = strdup(aptr + 1); // XXX: check
+	el_free(*tmp);
+	*tmp = aptr;
+}
+
 /*
  * the real function doing history expansion - takes as argument command
  * to do and data upon which the command should be executed
@@ -679,11 +789,11 @@ static int
 _history_expand_command(const char *command, size_t offs, size_t cmdlen,
 char **result)
 {
-	char *tmp, *search = NULL, *aptr;
+	char *tmp, *search = NULL, *aptr, delim;
 	const char *ptr, *cmd;
 	static char *from = NULL, *to = NULL;
 	int start, end, idx, has_mods = 0;
-	int p_on = 0, g_on = 0;
+	int p_on = 0, g_on = 0, ev;
 
 	*result = NULL;
 	aptr = NULL;
@@ -747,7 +857,7 @@ _history_expand_command(const char *comm
 			start = -1, cmd++;
 		else if (*cmd == '*')
 			start = 1, cmd++;
-	   else if (*cmd == '-' || isdigit((unsigned char) *cmd)) {
+		else if (*cmd == '-' || isdigit((unsigned char) *cmd)) {
 			start = 0;
 			while (*cmd && '0' <= *cmd && *cmd <= '9')
 start = start * 10 + *cmd++ - '0';
@@ -790,132 +900,54 @@ _history_expand_command(const char *comm
 	}
 
 	for (; *cmd; cmd++) {
-		if (*cmd == ':')
+		switch (*cmd) {
+		case ':':
 			continue;
-		else if (*cmd == 'h') {		/* remove trailing path */
+		case 'h': 	/* remove trailing path */
 			if ((aptr = strrchr(tmp, '/')) != NULL)
 *aptr = '\0';
-		} else if (*cmd == 't') {	/* re

CVS commit: src/sys/arch/luna68k/stand/boot

2021-09-03 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Fri Sep  3 16:21:15 UTC 2021

Modified Files:
src/sys/arch/luna68k/stand/boot: kbd.c

Log Message:
Ignore mouse packets to avoid unexpected data handled as keyboard input.

Patch from moveccr.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/luna68k/stand/boot/kbd.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/luna68k/stand/boot

2021-09-03 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Fri Sep  3 16:21:15 UTC 2021

Modified Files:
src/sys/arch/luna68k/stand/boot: kbd.c

Log Message:
Ignore mouse packets to avoid unexpected data handled as keyboard input.

Patch from moveccr.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/luna68k/stand/boot/kbd.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/luna68k/stand/boot/kbd.c
diff -u src/sys/arch/luna68k/stand/boot/kbd.c:1.4 src/sys/arch/luna68k/stand/boot/kbd.c:1.5
--- src/sys/arch/luna68k/stand/boot/kbd.c:1.4	Sat Feb 14 13:06:28 2015
+++ src/sys/arch/luna68k/stand/boot/kbd.c	Fri Sep  3 16:21:15 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: kbd.c,v 1.4 2015/02/14 13:06:28 tsutsui Exp $	*/
+/*	$NetBSD: kbd.c,v 1.5 2021/09/03 16:21:15 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1992 OMRON Corporation.
@@ -213,12 +213,23 @@ static const struct kbd_keymap kbd_keyma
 int	shift_flag = 0;
 int	ctrl_flag  = 0;
 int	meta_flag  = 0;
+int	mouse_flag  = 0;
 
 int
 kbd_decode(uint8_t code)
 {
 	unsigned int c, updown = 0;
 
+	/* ignore mouse data */
+	if (mouse_flag != 0) {
+		mouse_flag--;
+		return KC_IGNORE;
+	}
+	if ((code & 0xf8) == 0x80) {
+		mouse_flag = 2;
+		return KC_IGNORE;
+	}
+
 	if (code & 0x80)
 		updown = 1;
 



CVS commit: src/sys/arch/macppc

2021-09-03 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Fri Sep  3 17:18:40 UTC 2021

Modified Files:
src/sys/arch/macppc/conf: files.macppc
src/sys/arch/macppc/dev: smu.c

Log Message:
switch smu to common fan control code


To generate a diff of this commit:
cvs rdiff -u -r1.121 -r1.122 src/sys/arch/macppc/conf/files.macppc
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/macppc/dev/smu.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/macppc

2021-09-03 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Fri Sep  3 17:18:40 UTC 2021

Modified Files:
src/sys/arch/macppc/conf: files.macppc
src/sys/arch/macppc/dev: smu.c

Log Message:
switch smu to common fan control code


To generate a diff of this commit:
cvs rdiff -u -r1.121 -r1.122 src/sys/arch/macppc/conf/files.macppc
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/macppc/dev/smu.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/macppc/conf/files.macppc
diff -u src/sys/arch/macppc/conf/files.macppc:1.121 src/sys/arch/macppc/conf/files.macppc:1.122
--- src/sys/arch/macppc/conf/files.macppc:1.121	Tue Jul 27 23:38:42 2021
+++ src/sys/arch/macppc/conf/files.macppc	Fri Sep  3 17:18:39 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: files.macppc,v 1.121 2021/07/27 23:38:42 macallan Exp $
+#	$NetBSD: files.macppc,v 1.122 2021/09/03 17:18:39 macallan Exp $
 #
 # macppc-specific configuration info
 
@@ -180,7 +180,7 @@ define fancontrol
 file arch/macppc/dev/fancontrol.c		fancontrol
 defflag	opt_fancontrol.h	FANCONTROL_DEBUG
 
-device smu { } : fancontrol
+device smu { } : sysmon_envsys, fancontrol
 attach smu at mainbus
 file arch/macppc/dev/smu.c			smu needs-flag
 defflag	opt_smu.h	SMU_DEBUG

Index: src/sys/arch/macppc/dev/smu.c
diff -u src/sys/arch/macppc/dev/smu.c:1.14 src/sys/arch/macppc/dev/smu.c:1.15
--- src/sys/arch/macppc/dev/smu.c:1.14	Sat Aug  7 16:18:58 2021
+++ src/sys/arch/macppc/dev/smu.c	Fri Sep  3 17:18:40 2021
@@ -46,6 +46,7 @@
 
 #include 
 #include 
+#include 
 
 #include "opt_smu.h"
 
@@ -67,7 +68,9 @@ struct smu_fan {
 	int min_rpm;
 	int max_rpm;
 	int default_rpm;
+	int wanted_rpm;
 	int current_rpm;
+	int fault;
 	time_t last_update;
 };
 
@@ -82,19 +85,11 @@ struct smu_iicbus {
 #define SMU_MAX_IICBUS		3
 #define SMU_MAX_SME_SENSORS	(SMU_MAX_FANS + 8)
 
-struct smu_zone {
-	bool (*filter)(const envsys_data_t *);
-	int nfans;
-	int fans[SMU_MAX_FANS];
-	int threshold, step;
-	int duty;
-};
-
 
-#define SMU_ZONE_CPUS	0
-#define SMU_ZONE_DRIVES	1
-#define SMU_ZONE_SLOTS	2
-#define SMU_ZONES	3
+#define SMU_ZONE_CPU		0
+#define SMU_ZONE_CASE		1
+#define SMU_ZONE_DRIVEBAY	2
+#define SMU_ZONES		3
 
 #define C_TO_uK(n) (n * 100 + 27315)
 
@@ -123,7 +118,7 @@ struct smu_softc {
 	uint32_t cpu_m;
 	int32_t  cpu_b;
 
-	struct smu_zone sc_zones[SMU_ZONES];
+	fancontrol_zone_t sc_zones[SMU_ZONES];
 	lwp_t *sc_thread;
 	bool sc_dying;
 };
@@ -165,20 +160,19 @@ static int smu_dbell_gpio_intr(void *);
 static int smu_todr_gettime_ymdhms(todr_chip_handle_t, struct clock_ymdhms *);
 static int smu_todr_settime_ymdhms(todr_chip_handle_t, struct clock_ymdhms *);
 static int smu_fan_update_rpm(struct smu_fan *);
-static int smu_fan_get_rpm(struct smu_fan *, int *);
-static int smu_fan_set_rpm(struct smu_fan *, int);
 static int smu_read_adc(struct smu_softc *, int);
 
 static int smu_iicbus_exec(void *, i2c_op_t, i2c_addr_t, const void *,
 size_t, void *, size_t, int);
-static int smu_sysctl_fan_rpm(SYSCTLFN_ARGS);
 
 static void smu_setup_zones(struct smu_softc *);
-static void smu_adjust_zone(struct smu_softc *, int);
 static void smu_adjust(void *);
+
 static bool is_cpu_sensor(const envsys_data_t *);
 static bool is_drive_sensor(const envsys_data_t *);
 static bool is_slots_sensor(const envsys_data_t *);
+static int smu_fan_get_rpm(void *, int);
+static int smu_fan_set_rpm(void *, int, int);
 
 int smu_get_datablock(int, uint8_t *, size_t);
 
@@ -299,9 +293,8 @@ static void
 smu_setup_fans(struct smu_softc *sc)
 {
 	struct smu_fan *fan;
-	struct sysctlnode *sysctl_fans, *sysctl_fan, *sysctl_node;
-	char type[32], sysctl_fan_name[32];
-	int node, i, j;
+	char type[32];
+	int node, i;
 	const char *fans[] = { "fans", "rpm-fans", 0 };
 	int n = 0;
 	
@@ -349,6 +342,8 @@ smu_setup_fans(struct smu_softc *sc)
 			fan->location, fan->reg, fan->zone, fan->rpm_ctl,
 			fan->min_rpm, fan->max_rpm, fan->default_rpm);
 
+			fan->wanted_rpm = fan->default_rpm;
+			fan->fault = 0; 
 			sc->sc_num_fans++;
 		}
 		n++;
@@ -356,88 +351,8 @@ smu_setup_fans(struct smu_softc *sc)
 
 	for (i = 0; i < sc->sc_num_fans; i++) {
 		fan = &sc->sc_fans[i];
-		smu_fan_set_rpm(fan, fan->default_rpm);
-		smu_fan_get_rpm(fan, &fan->current_rpm);
-	}
-
-	/* Create sysctl nodes for each fan */
-
-	sysctl_createv(NULL, 0, NULL, (void *) &sysctl_fans,
-	CTLFLAG_READWRITE | CTLFLAG_OWNDESC,
-	CTLTYPE_NODE, "fans", NULL,
-	NULL, 0, NULL, 0,
-	CTL_MACHDEP,
-	sc->sc_sysctl_me->sysctl_num,
-	CTL_CREATE, CTL_EOL);
-
-	for (i = 0; i < sc->sc_num_fans; i++) {
-		fan = &sc->sc_fans[i];
-
-		for (j = 0; j < strlen(fan->location); j++) {
-			sysctl_fan_name[j] = tolower(fan->location[j]);
-			if (sysctl_fan_name[j] == ' ')
-sysctl_fan_name[j] = '_';
-		}
-		sysctl_fan_name[j] = '\0';
-
-		sysctl_createv(NULL, 0, NULL, (void *) &sysctl_fan,
-		CTLFLAG_READWRITE | CTLFLAG_OWNDESC,
-		CTLTYPE_N

CVS commit: src/usr.sbin/inetd

2021-09-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Sep  3 19:33:51 UTC 2021

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

Log Message:
inetd: normalize indentation and alignment in comments


To generate a diff of this commit:
cvs rdiff -u -r1.132 -r1.133 src/usr.sbin/inetd/inetd.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/inetd

2021-09-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Sep  3 19:33:51 UTC 2021

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

Log Message:
inetd: normalize indentation and alignment in comments


To generate a diff of this commit:
cvs rdiff -u -r1.132 -r1.133 src/usr.sbin/inetd/inetd.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/inetd/inetd.c
diff -u src/usr.sbin/inetd/inetd.c:1.132 src/usr.sbin/inetd/inetd.c:1.133
--- src/usr.sbin/inetd/inetd.c:1.132	Tue Aug 31 19:34:42 2021
+++ src/usr.sbin/inetd/inetd.c	Fri Sep  3 19:33:51 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: inetd.c,v 1.132 2021/08/31 19:34:42 rillig Exp $	*/
+/*	$NetBSD: inetd.c,v 1.133 2021/09/03 19:33:51 rillig Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2003 The NetBSD Foundation, Inc.
@@ -66,7 +66,7 @@ __COPYRIGHT("@(#) Copyright (c) 1983, 19
 #if 0
 static char sccsid[] = "@(#)inetd.c	8.4 (Berkeley) 4/13/94";
 #else
-__RCSID("$NetBSD: inetd.c,v 1.132 2021/08/31 19:34:42 rillig Exp $");
+__RCSID("$NetBSD: inetd.c,v 1.133 2021/09/03 19:33:51 rillig Exp $");
 #endif
 #endif /* not lint */
 
@@ -104,7 +104,7 @@ __RCSID("$NetBSD: inetd.c,v 1.132 2021/0
  *	server program arguments	maximum of MAXARGV (64)
  *
  * For RPC services
- *  service name/versionmust be in /etc/rpc
+ *	service name/version		must be in /etc/rpc
  *	socket type			stream/dgram/raw/rdm/seqpacket
  *	protocol			must be in /etc/protocols
  *	wait/nowait[:max]		single-threaded/multi-threaded
@@ -2715,11 +2715,11 @@ rl_process(struct servtab *sep, int ctrl
 			rl_reset(sep, now);
 		} else {
 			syslog(LOG_ERR,
-SERV_FMT ": max spawn rate (%zu in %ji seconds) "
-"already met, closing until end of timeout in "
+			SERV_FMT ": max spawn rate (%zu in %ji seconds) "
+			"already met, closing until end of timeout in "
 			"%ju seconds",
-SERV_PARAMS(sep),
-sep->se_service_max,
+			SERV_PARAMS(sep),
+			sep->se_service_max,
 			(intmax_t)CNT_INTVL,
 			(uintmax_t)RETRYTIME);
 



CVS commit: src/usr.sbin/inetd

2021-09-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Sep  3 20:24:28 UTC 2021

Modified Files:
src/usr.sbin/inetd: Makefile inetd.c inetd.h ipsec.c parse_v2.c

Log Message:
inetd: prepare for lint's strict bool mode

Lint's strict bool mode considers bool incompatible with the other
scalar types.  This makes the type of expressions more visible in the
code.  In particular, conditions of the form '!strcmp(...)' are no
longer allowed, they have to be written as 'strcmp(...) == 0'.

The operator '!' cannot be used with sep->se_wait since that has type
pid_t, not bool.

No change to the resulting binary.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/usr.sbin/inetd/Makefile
cvs rdiff -u -r1.133 -r1.134 src/usr.sbin/inetd/inetd.c
cvs rdiff -u -r1.2 -r1.3 src/usr.sbin/inetd/inetd.h
cvs rdiff -u -r1.6 -r1.7 src/usr.sbin/inetd/ipsec.c
cvs rdiff -u -r1.4 -r1.5 src/usr.sbin/inetd/parse_v2.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/inetd/Makefile
diff -u src/usr.sbin/inetd/Makefile:1.28 src/usr.sbin/inetd/Makefile:1.29
--- src/usr.sbin/inetd/Makefile:1.28	Mon Aug 30 18:21:11 2021
+++ src/usr.sbin/inetd/Makefile	Fri Sep  3 20:24:28 2021
@@ -1,5 +1,5 @@
 #	from: @(#)Makefile	8.1 (Berkeley) 6/6/93
-#	$NetBSD: Makefile,v 1.28 2021/08/30 18:21:11 rillig Exp $
+#	$NetBSD: Makefile,v 1.29 2021/09/03 20:24:28 rillig Exp $
 
 .include 
 
@@ -10,6 +10,7 @@ SRCS=	inetd.c parse_v2.c
 MAN=	inetd.8
 MLINKS=	inetd.8 inetd.conf.5
 WARNS=	6
+#LINTFLAGS+=	-T
 
 # Enables debug printouts when in debug mode
 CPPFLAGS+=-DDEBUG_ENABLE

Index: src/usr.sbin/inetd/inetd.c
diff -u src/usr.sbin/inetd/inetd.c:1.133 src/usr.sbin/inetd/inetd.c:1.134
--- src/usr.sbin/inetd/inetd.c:1.133	Fri Sep  3 19:33:51 2021
+++ src/usr.sbin/inetd/inetd.c	Fri Sep  3 20:24:28 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: inetd.c,v 1.133 2021/09/03 19:33:51 rillig Exp $	*/
+/*	$NetBSD: inetd.c,v 1.134 2021/09/03 20:24:28 rillig Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2003 The NetBSD Foundation, Inc.
@@ -66,7 +66,7 @@ __COPYRIGHT("@(#) Copyright (c) 1983, 19
 #if 0
 static char sccsid[] = "@(#)inetd.c	8.4 (Berkeley) 4/13/94";
 #else
-__RCSID("$NetBSD: inetd.c,v 1.133 2021/09/03 19:33:51 rillig Exp $");
+__RCSID("$NetBSD: inetd.c,v 1.134 2021/09/03 20:24:28 rillig Exp $");
 #endif
 #endif /* not lint */
 
@@ -337,28 +337,28 @@ struct biltin {
 	/* function which performs it */
 } biltins[] = {
 	/* Echo received data */
-	{ "echo",	SOCK_STREAM,	1, 0,	echo_stream },
-	{ "echo",	SOCK_DGRAM,	0, 0,	echo_dg },
+	{ "echo",	SOCK_STREAM,	true, false,	echo_stream },
+	{ "echo",	SOCK_DGRAM,	false, false,	echo_dg },
 
 	/* Internet /dev/null */
-	{ "discard",	SOCK_STREAM,	1, 0,	discard_stream },
-	{ "discard",	SOCK_DGRAM,	0, 0,	discard_dg },
+	{ "discard",	SOCK_STREAM,	true, false,	discard_stream },
+	{ "discard",	SOCK_DGRAM,	false, false,	discard_dg },
 
 	/* Return 32 bit time since 1970 */
-	{ "time",	SOCK_STREAM,	0, 0,	machtime_stream },
-	{ "time",	SOCK_DGRAM,	0, 0,	machtime_dg },
+	{ "time",	SOCK_STREAM,	false, false,	machtime_stream },
+	{ "time",	SOCK_DGRAM,	false, false,	machtime_dg },
 
 	/* Return human-readable time */
-	{ "daytime",	SOCK_STREAM,	0, 0,	daytime_stream },
-	{ "daytime",	SOCK_DGRAM,	0, 0,	daytime_dg },
+	{ "daytime",	SOCK_STREAM,	false, false,	daytime_stream },
+	{ "daytime",	SOCK_DGRAM,	false, false,	daytime_dg },
 
 	/* Familiar character generator */
-	{ "chargen",	SOCK_STREAM,	1, 0,	chargen_stream },
-	{ "chargen",	SOCK_DGRAM,	0, 0,	chargen_dg },
+	{ "chargen",	SOCK_STREAM,	true, false,	chargen_stream },
+	{ "chargen",	SOCK_DGRAM,	false, false,	chargen_dg },
 
-	{ "tcpmux",	SOCK_STREAM,	1, 0,	tcpmux },
+	{ "tcpmux",	SOCK_STREAM,	true, false,	tcpmux },
 
-	{ NULL, 0, 0, 0, NULL }
+	{ NULL, 0, false, false, NULL }
 };
 
 /* list of "bad" ports. I.e. ports that are most obviously used for
@@ -389,12 +389,12 @@ main(int argc, char *argv[])
 	   )) != -1)
 		switch(ch) {
 		case 'd':
-			debug = 1;
+			debug = true;
 			options |= SO_DEBUG;
 			break;
 #ifdef LIBWRAP
 		case 'l':
-			lflag = 1;
+			lflag = true;
 			break;
 #endif
 		case '?':
@@ -448,7 +448,7 @@ main(int argc, char *argv[])
 		struct servtab	*sep;
 
 		if (reload) {
-			reload = 0;
+			reload = false;
 			config_root();
 		}
 
@@ -469,7 +469,7 @@ main(int argc, char *argv[])
 	goaway();
 	break;
 case SIGHUP:
-	reload = 1;
+	reload = true;
 	break;
 }
 continue;
@@ -481,7 +481,7 @@ main(int argc, char *argv[])
 			if ((int)ev->ident != sep->se_fd)
 continue;
 			DPRINTF(SERV_FMT ": service requested" , SERV_PARAMS(sep));
-			if (!sep->se_wait && sep->se_socktype == SOCK_STREAM) {
+			if (sep->se_wait == 0 && sep->se_socktype == SOCK_STREAM) {
 /* XXX here do the libwrap check-before-accept*/
 ctrl = accept(sep->se_fd, NULL, NULL);
 DPRINTF(SERV_FMT ": accept, ctrl fd %d",
@@ -508,9 +508,9 @@ spa

CVS commit: src/usr.sbin/inetd

2021-09-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Sep  3 20:24:28 UTC 2021

Modified Files:
src/usr.sbin/inetd: Makefile inetd.c inetd.h ipsec.c parse_v2.c

Log Message:
inetd: prepare for lint's strict bool mode

Lint's strict bool mode considers bool incompatible with the other
scalar types.  This makes the type of expressions more visible in the
code.  In particular, conditions of the form '!strcmp(...)' are no
longer allowed, they have to be written as 'strcmp(...) == 0'.

The operator '!' cannot be used with sep->se_wait since that has type
pid_t, not bool.

No change to the resulting binary.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/usr.sbin/inetd/Makefile
cvs rdiff -u -r1.133 -r1.134 src/usr.sbin/inetd/inetd.c
cvs rdiff -u -r1.2 -r1.3 src/usr.sbin/inetd/inetd.h
cvs rdiff -u -r1.6 -r1.7 src/usr.sbin/inetd/ipsec.c
cvs rdiff -u -r1.4 -r1.5 src/usr.sbin/inetd/parse_v2.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/inetd

2021-09-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Sep  3 20:41:19 UTC 2021

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

Log Message:
inetd: remove redundant null check before free

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.134 -r1.135 src/usr.sbin/inetd/inetd.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/inetd

2021-09-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Sep  3 20:41:19 UTC 2021

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

Log Message:
inetd: remove redundant null check before free

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.134 -r1.135 src/usr.sbin/inetd/inetd.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/inetd/inetd.c
diff -u src/usr.sbin/inetd/inetd.c:1.134 src/usr.sbin/inetd/inetd.c:1.135
--- src/usr.sbin/inetd/inetd.c:1.134	Fri Sep  3 20:24:28 2021
+++ src/usr.sbin/inetd/inetd.c	Fri Sep  3 20:41:19 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: inetd.c,v 1.134 2021/09/03 20:24:28 rillig Exp $	*/
+/*	$NetBSD: inetd.c,v 1.135 2021/09/03 20:41:19 rillig Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2003 The NetBSD Foundation, Inc.
@@ -66,7 +66,7 @@ __COPYRIGHT("@(#) Copyright (c) 1983, 19
 #if 0
 static char sccsid[] = "@(#)inetd.c	8.4 (Berkeley) 4/13/94";
 #else
-__RCSID("$NetBSD: inetd.c,v 1.134 2021/09/03 20:24:28 rillig Exp $");
+__RCSID("$NetBSD: inetd.c,v 1.135 2021/09/03 20:41:19 rillig Exp $");
 #endif
 #endif /* not lint */
 
@@ -1600,24 +1600,16 @@ freeconfig(struct servtab *cp)
 {
 	int i;
 
-	if (cp->se_hostaddr)
-		free(cp->se_hostaddr);
-	if (cp->se_service)
-		free(cp->se_service);
-	if (cp->se_proto)
-		free(cp->se_proto);
-	if (cp->se_user)
-		free(cp->se_user);
-	if(cp->se_group)
-		free(cp->se_group);
-	if (cp->se_server)
-		free(cp->se_server);
+	free(cp->se_hostaddr);
+	free(cp->se_service);
+	free(cp->se_proto);
+	free(cp->se_user);
+	free(cp->se_group);
+	free(cp->se_server);
 	for (i = 0; i < MAXARGV; i++)
-		if (cp->se_argv[i])
-			free(cp->se_argv[i]);
+		free(cp->se_argv[i]);
 #ifdef IPSEC
-	if (cp->se_policy)
-		free(cp->se_policy);
+	free(cp->se_policy);
 #endif
 }
 
@@ -2505,7 +2497,7 @@ include_configs(char *pattern)
 	/* Put new_file at the top of the config stack */
 	file_list_head = &new_file;
 	read_glob_configs(pattern);
-	free((void *)new_file.abs);
+	free(new_file.abs);
 	/* Pop new_file off the stack */
 	file_list_head = new_file.next;
 



CVS commit: src/sys/external/bsd/acpica/dist/include/platform

2021-09-03 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Fri Sep  3 20:44:23 UTC 2021

Modified Files:
src/sys/external/bsd/acpica/dist/include/platform: acnetbsd.h

Log Message:
Only define ACPI_QUIET_BOOT for kernel builds


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 \
src/sys/external/bsd/acpica/dist/include/platform/acnetbsd.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/acpica/dist/include/platform

2021-09-03 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Fri Sep  3 20:44:23 UTC 2021

Modified Files:
src/sys/external/bsd/acpica/dist/include/platform: acnetbsd.h

Log Message:
Only define ACPI_QUIET_BOOT for kernel builds


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 \
src/sys/external/bsd/acpica/dist/include/platform/acnetbsd.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/external/bsd/acpica/dist/include/platform/acnetbsd.h
diff -u src/sys/external/bsd/acpica/dist/include/platform/acnetbsd.h:1.23 src/sys/external/bsd/acpica/dist/include/platform/acnetbsd.h:1.24
--- src/sys/external/bsd/acpica/dist/include/platform/acnetbsd.h:1.23	Fri Sep  3 11:59:28 2021
+++ src/sys/external/bsd/acpica/dist/include/platform/acnetbsd.h	Fri Sep  3 20:44:23 2021
@@ -1,7 +1,7 @@
 /**
  *
  * Name: acnetbsd.h - OS specific defines, etc.
- *   $Revision: 1.23 $
+ *   $Revision: 1.24 $
  *
  */
 
@@ -85,6 +85,12 @@
 #define ACPI_INTERNAL_XFACE
 #define ACPI_INTERNAL_VAR_XFACE
 
+#if defined(_KERNEL)
+/* Suppress ACPI_INFO level log messages in the kernel when this is true */
+#define ACPI_QUIET_BOOT	\
+	((boothowto & (AB_QUIET|AB_SILENT)) != 0)
+#endif
+
 /*
  * XXX: The internal memory tracking of ACPICA, available when
  *  ACPI_DBG_TRACK_ALLOCATIONS is defined, has been removed
@@ -145,8 +151,4 @@
 #define ACPI_USE_NATIVE_DIVIDE
 #define ACPI_USE_NATIVE_MATH64
 
-/* Suppress ACPI_INFO level log messages when this is true */
-#define	ACPI_QUIET_BOOT	\
-	((boothowto & (AB_QUIET|AB_SILENT)) != 0)
-
 #endif /* __ACNETBSD_H__ */



CVS commit: src/usr.sbin/inetd

2021-09-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Sep  3 21:02:04 UTC 2021

Modified Files:
src/usr.sbin/inetd: inetd.c ipsec.c

Log Message:
inetd: remove redundant tests before calling isspace


To generate a diff of this commit:
cvs rdiff -u -r1.135 -r1.136 src/usr.sbin/inetd/inetd.c
cvs rdiff -u -r1.7 -r1.8 src/usr.sbin/inetd/ipsec.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/inetd

2021-09-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Sep  3 21:02:04 UTC 2021

Modified Files:
src/usr.sbin/inetd: inetd.c ipsec.c

Log Message:
inetd: remove redundant tests before calling isspace


To generate a diff of this commit:
cvs rdiff -u -r1.135 -r1.136 src/usr.sbin/inetd/inetd.c
cvs rdiff -u -r1.7 -r1.8 src/usr.sbin/inetd/ipsec.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/inetd/inetd.c
diff -u src/usr.sbin/inetd/inetd.c:1.135 src/usr.sbin/inetd/inetd.c:1.136
--- src/usr.sbin/inetd/inetd.c:1.135	Fri Sep  3 20:41:19 2021
+++ src/usr.sbin/inetd/inetd.c	Fri Sep  3 21:02:04 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: inetd.c,v 1.135 2021/09/03 20:41:19 rillig Exp $	*/
+/*	$NetBSD: inetd.c,v 1.136 2021/09/03 21:02:04 rillig Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2003 The NetBSD Foundation, Inc.
@@ -66,7 +66,7 @@ __COPYRIGHT("@(#) Copyright (c) 1983, 19
 #if 0
 static char sccsid[] = "@(#)inetd.c	8.4 (Berkeley) 4/13/94";
 #else
-__RCSID("$NetBSD: inetd.c,v 1.135 2021/09/03 20:41:19 rillig Exp $");
+__RCSID("$NetBSD: inetd.c,v 1.136 2021/09/03 21:02:04 rillig Exp $");
 #endif
 #endif /* not lint */
 
@@ -1234,7 +1234,7 @@ more:
 		/* lines starting with #@ is not a comment, but the policy */
 		if (cp[1] == '@') {
 			char *p;
-			for (p = cp + 2; p && *p && isspace((unsigned char)*p); p++)
+			for (p = cp + 2; isspace((unsigned char)*p); p++)
 ;
 			if (*p == '\0') {
 if (policy)

Index: src/usr.sbin/inetd/ipsec.c
diff -u src/usr.sbin/inetd/ipsec.c:1.7 src/usr.sbin/inetd/ipsec.c:1.8
--- src/usr.sbin/inetd/ipsec.c:1.7	Fri Sep  3 20:24:28 2021
+++ src/usr.sbin/inetd/ipsec.c	Fri Sep  3 21:02:04 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: ipsec.c,v 1.7 2021/09/03 20:24:28 rillig Exp $	*/
+/*	$NetBSD: ipsec.c,v 1.8 2021/09/03 21:02:04 rillig Exp $	*/
 
 /*
  * Copyright (C) 1999 WIDE Project.
@@ -69,7 +69,7 @@ ipsecsetup(int af, int fd, const char *p
 		p = strtok(p, ";");
 		if (p == NULL)
 			break;
-		while (*p && isspace((unsigned char)*p))
+		while (isspace((unsigned char)*p))
 			p++;
 		if (*p == '\0') {
 			p = NULL;
@@ -103,7 +103,7 @@ ipsecsetup_test(const char *policy)
 		p = strtok(p, ";");
 		if (p == NULL)
 			break;
-		while (*p && isspace((unsigned char)*p))
+		while (isspace((unsigned char)*p))
 			p++;
 		if (*p == '\0') {
 			p = NULL;



CVS commit: src

2021-09-03 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Fri Sep  3 21:55:01 UTC 2021

Modified Files:
src/include: resolv.h
src/lib/libm/arch/hppa: fenv.c
src/lib/libm/arch/i387: fenv.c
src/lib/libm/arch/riscv: fenv.c
src/lib/libm/arch/sparc: fenv.c
src/lib/libm/arch/sparc64: fenv.c
src/lib/libm/arch/x86_64: fenv.c
src/libexec/httpd: CHANGES
src/sys/altq: altq_red.c
src/sys/arch/arm/include: armreg.h
src/sys/arch/sandpoint/stand/altboot: wm.c
src/sys/dev/acpi: acpica.h
src/sys/dev/pci: if_bge.c nfsmb.c pdcsata.c
src/sys/dev/usb: uvideo.c
src/sys/fs/udf: udf_allocation.c udf_subr.c
src/sys/net: ether_sw_offload.c
src/sys/net80211: CHANGES
src/sys/netinet: sctp_output.c
src/sys/ufs/ffs: ffs_alloc.c
src/usr.sbin/puffs/mount_9p: nineproto.c

Log Message:
fix typos in comments, mainly s/extention/extension/ and s/sufficent/sufficient/


To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.42 src/include/resolv.h
cvs rdiff -u -r1.4 -r1.5 src/lib/libm/arch/hppa/fenv.c
cvs rdiff -u -r1.9 -r1.10 src/lib/libm/arch/i387/fenv.c
cvs rdiff -u -r1.2 -r1.3 src/lib/libm/arch/riscv/fenv.c
cvs rdiff -u -r1.2 -r1.3 src/lib/libm/arch/sparc/fenv.c
cvs rdiff -u -r1.3 -r1.4 src/lib/libm/arch/sparc64/fenv.c
cvs rdiff -u -r1.9 -r1.10 src/lib/libm/arch/x86_64/fenv.c
cvs rdiff -u -r1.51 -r1.52 src/libexec/httpd/CHANGES
cvs rdiff -u -r1.32 -r1.33 src/sys/altq/altq_red.c
cvs rdiff -u -r1.130 -r1.131 src/sys/arch/arm/include/armreg.h
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/sandpoint/stand/altboot/wm.c
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/acpi/acpica.h
cvs rdiff -u -r1.347 -r1.348 src/sys/dev/pci/if_bge.c
cvs rdiff -u -r1.27 -r1.28 src/sys/dev/pci/nfsmb.c
cvs rdiff -u -r1.31 -r1.32 src/sys/dev/pci/pdcsata.c
cvs rdiff -u -r1.60 -r1.61 src/sys/dev/usb/uvideo.c
cvs rdiff -u -r1.43 -r1.44 src/sys/fs/udf/udf_allocation.c
cvs rdiff -u -r1.156 -r1.157 src/sys/fs/udf/udf_subr.c
cvs rdiff -u -r1.7 -r1.8 src/sys/net/ether_sw_offload.c
cvs rdiff -u -r1.2 -r1.3 src/sys/net80211/CHANGES
cvs rdiff -u -r1.23 -r1.24 src/sys/netinet/sctp_output.c
cvs rdiff -u -r1.169 -r1.170 src/sys/ufs/ffs/ffs_alloc.c
cvs rdiff -u -r1.13 -r1.14 src/usr.sbin/puffs/mount_9p/nineproto.c

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



CVS commit: src

2021-09-03 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Fri Sep  3 21:55:01 UTC 2021

Modified Files:
src/include: resolv.h
src/lib/libm/arch/hppa: fenv.c
src/lib/libm/arch/i387: fenv.c
src/lib/libm/arch/riscv: fenv.c
src/lib/libm/arch/sparc: fenv.c
src/lib/libm/arch/sparc64: fenv.c
src/lib/libm/arch/x86_64: fenv.c
src/libexec/httpd: CHANGES
src/sys/altq: altq_red.c
src/sys/arch/arm/include: armreg.h
src/sys/arch/sandpoint/stand/altboot: wm.c
src/sys/dev/acpi: acpica.h
src/sys/dev/pci: if_bge.c nfsmb.c pdcsata.c
src/sys/dev/usb: uvideo.c
src/sys/fs/udf: udf_allocation.c udf_subr.c
src/sys/net: ether_sw_offload.c
src/sys/net80211: CHANGES
src/sys/netinet: sctp_output.c
src/sys/ufs/ffs: ffs_alloc.c
src/usr.sbin/puffs/mount_9p: nineproto.c

Log Message:
fix typos in comments, mainly s/extention/extension/ and s/sufficent/sufficient/


To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.42 src/include/resolv.h
cvs rdiff -u -r1.4 -r1.5 src/lib/libm/arch/hppa/fenv.c
cvs rdiff -u -r1.9 -r1.10 src/lib/libm/arch/i387/fenv.c
cvs rdiff -u -r1.2 -r1.3 src/lib/libm/arch/riscv/fenv.c
cvs rdiff -u -r1.2 -r1.3 src/lib/libm/arch/sparc/fenv.c
cvs rdiff -u -r1.3 -r1.4 src/lib/libm/arch/sparc64/fenv.c
cvs rdiff -u -r1.9 -r1.10 src/lib/libm/arch/x86_64/fenv.c
cvs rdiff -u -r1.51 -r1.52 src/libexec/httpd/CHANGES
cvs rdiff -u -r1.32 -r1.33 src/sys/altq/altq_red.c
cvs rdiff -u -r1.130 -r1.131 src/sys/arch/arm/include/armreg.h
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/sandpoint/stand/altboot/wm.c
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/acpi/acpica.h
cvs rdiff -u -r1.347 -r1.348 src/sys/dev/pci/if_bge.c
cvs rdiff -u -r1.27 -r1.28 src/sys/dev/pci/nfsmb.c
cvs rdiff -u -r1.31 -r1.32 src/sys/dev/pci/pdcsata.c
cvs rdiff -u -r1.60 -r1.61 src/sys/dev/usb/uvideo.c
cvs rdiff -u -r1.43 -r1.44 src/sys/fs/udf/udf_allocation.c
cvs rdiff -u -r1.156 -r1.157 src/sys/fs/udf/udf_subr.c
cvs rdiff -u -r1.7 -r1.8 src/sys/net/ether_sw_offload.c
cvs rdiff -u -r1.2 -r1.3 src/sys/net80211/CHANGES
cvs rdiff -u -r1.23 -r1.24 src/sys/netinet/sctp_output.c
cvs rdiff -u -r1.169 -r1.170 src/sys/ufs/ffs/ffs_alloc.c
cvs rdiff -u -r1.13 -r1.14 src/usr.sbin/puffs/mount_9p/nineproto.c

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

Modified files:

Index: src/include/resolv.h
diff -u src/include/resolv.h:1.41 src/include/resolv.h:1.42
--- src/include/resolv.h:1.41	Fri Apr 30 16:07:49 2021
+++ src/include/resolv.h	Fri Sep  3 21:54:58 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: resolv.h,v 1.41 2021/04/30 16:07:49 christos Exp $	*/
+/*	$NetBSD: resolv.h,v 1.42 2021/09/03 21:54:58 andvar Exp $	*/
 
 /*
  * Portions Copyright (C) 2004, 2005, 2008, 2009  Internet Systems Consortium, Inc. ("ISC")
@@ -188,7 +188,7 @@ struct __res_state {
 			uint16_t		nscount;
 			uint16_t		nstimes[MAXNS];	/*%< ms. */
 			int			nssocks[MAXNS];
-			struct __res_state_ext *ext;	/*%< extention for IPv6 */
+			struct __res_state_ext *ext;	/*%< extension for IPv6 */
 		} _ext;
 	} _u;
 	u_char	*_rnd;			/*%< PRIVATE: random state */

Index: src/lib/libm/arch/hppa/fenv.c
diff -u src/lib/libm/arch/hppa/fenv.c:1.4 src/lib/libm/arch/hppa/fenv.c:1.5
--- src/lib/libm/arch/hppa/fenv.c:1.4	Wed Mar 22 23:11:08 2017
+++ src/lib/libm/arch/hppa/fenv.c	Fri Sep  3 21:54:59 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: fenv.c,v 1.4 2017/03/22 23:11:08 chs Exp $	*/
+/*	$NetBSD: fenv.c,v 1.5 2021/09/03 21:54:59 andvar Exp $	*/
 
 /*-
  * Copyright (c) 2004-2005 David Schultz 
@@ -24,7 +24,7 @@
  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  */
 #include 
-__RCSID("$NetBSD: fenv.c,v 1.4 2017/03/22 23:11:08 chs Exp $");
+__RCSID("$NetBSD: fenv.c,v 1.5 2021/09/03 21:54:59 andvar Exp $");
 
 #include "namespace.h"
 
@@ -333,7 +333,7 @@ feupdateenv(const fenv_t *envp)
 }
 
 /*
- * The following functions are extentions to the standard
+ * The following functions are extensions to the standard
  */
 int
 feenableexcept(int mask)

Index: src/lib/libm/arch/i387/fenv.c
diff -u src/lib/libm/arch/i387/fenv.c:1.9 src/lib/libm/arch/i387/fenv.c:1.10
--- src/lib/libm/arch/i387/fenv.c:1.9	Thu Jan 25 03:54:21 2018
+++ src/lib/libm/arch/i387/fenv.c	Fri Sep  3 21:54:59 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: fenv.c,v 1.9 2018/01/25 03:54:21 christos Exp $ */
+/* $NetBSD: fenv.c,v 1.10 2021/09/03 21:54:59 andvar Exp $ */
 
 /*-
  * Copyright (c) 2004-2005 David Schultz 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: fenv.c,v 1.9 2018/01/25 03:54:21 christos Exp $");
+__RCSID("$NetBSD: fenv.c,v 1.10 2021/09/03 21:54:59 andvar Exp $");
 
 #include "namespace.h"
 
@@ -469,7 +469,7 @@ feupdateenv(const fenv_t *envp)
 }
 
 /*
- * The following functions are extentions to the standard
+ * The following functions are extensions to the standard
  */
 int
 feenableexcept(int mask)

Index: src/lib/libm/arch/

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

2021-09-03 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Fri Sep  3 21:58:36 UTC 2021

Modified Files:
src/sys/arch/evbarm/conf: std.beagle std.generic std.rpi std.zynq

Log Message:
s/opions/options/


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/evbarm/conf/std.beagle
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/evbarm/conf/std.generic
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/evbarm/conf/std.rpi
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/evbarm/conf/std.zynq

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



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

2021-09-03 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Fri Sep  3 21:58:36 UTC 2021

Modified Files:
src/sys/arch/evbarm/conf: std.beagle std.generic std.rpi std.zynq

Log Message:
s/opions/options/


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/evbarm/conf/std.beagle
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/evbarm/conf/std.generic
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/evbarm/conf/std.rpi
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/evbarm/conf/std.zynq

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

Modified files:

Index: src/sys/arch/evbarm/conf/std.beagle
diff -u src/sys/arch/evbarm/conf/std.beagle:1.18 src/sys/arch/evbarm/conf/std.beagle:1.19
--- src/sys/arch/evbarm/conf/std.beagle:1.18	Sat May 18 08:49:23 2019
+++ src/sys/arch/evbarm/conf/std.beagle	Fri Sep  3 21:58:36 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: std.beagle,v 1.18 2019/05/18 08:49:23 skrll Exp $
+#	$NetBSD: std.beagle,v 1.19 2021/09/03 21:58:36 andvar Exp $
 #
 # standard NetBSD/evbarm for BEAGLEBOARD options
 
@@ -8,7 +8,7 @@ include		"arch/evbarm/conf/std.evbarm"
 # Pull in BEAGLEBOARD config definitions.
 include		"arch/evbarm/conf/files.beagle"
 
-# Architecture opions
+# Architecture options
 options 	ARM_GENERIC_TODR
 options 	ARM_HAS_VBAR
 options 	ARM_INTR_IMPL=""

Index: src/sys/arch/evbarm/conf/std.generic
diff -u src/sys/arch/evbarm/conf/std.generic:1.9 src/sys/arch/evbarm/conf/std.generic:1.10
--- src/sys/arch/evbarm/conf/std.generic:1.9	Sun Mar 21 09:00:55 2021
+++ src/sys/arch/evbarm/conf/std.generic	Fri Sep  3 21:58:36 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: std.generic,v 1.9 2021/03/21 09:00:55 skrll Exp $
+#	$NetBSD: std.generic,v 1.10 2021/09/03 21:58:36 andvar Exp $
 #
 # 	generic NetBSD/evbarm with FDT support
 
@@ -9,7 +9,7 @@ include		"arch/arm/conf/std.arm"		# arch
 options 	EXEC_ELF32
 options 	EXEC_SCRIPT
 
-# Architecture opions
+# Architecture options
 options 	ARM32
 
 options 	ARM_GENERIC_TODR

Index: src/sys/arch/evbarm/conf/std.rpi
diff -u src/sys/arch/evbarm/conf/std.rpi:1.25 src/sys/arch/evbarm/conf/std.rpi:1.26
--- src/sys/arch/evbarm/conf/std.rpi:1.25	Sun Mar 21 09:00:55 2021
+++ src/sys/arch/evbarm/conf/std.rpi	Fri Sep  3 21:58:36 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: std.rpi,v 1.25 2021/03/21 09:00:55 skrll Exp $
+#	$NetBSD: std.rpi,v 1.26 2021/09/03 21:58:36 andvar Exp $
 #
 # standard NetBSD/evbarm for Raspberry Pi options
 
@@ -8,7 +8,7 @@ include		"arch/evbarm/conf/std.evbarm"
 # Pull in Raspberry Pi config definitions.
 include		"arch/evbarm/conf/files.rpi"
 
-# Architecture opions
+# Architecture options
 options 	ARM_GENERIC_TODR
 options 	ARM_HAS_VBAR
 options 	ARM_INTR_IMPL=""

Index: src/sys/arch/evbarm/conf/std.zynq
diff -u src/sys/arch/evbarm/conf/std.zynq:1.6 src/sys/arch/evbarm/conf/std.zynq:1.7
--- src/sys/arch/evbarm/conf/std.zynq:1.6	Thu Oct 18 09:01:54 2018
+++ src/sys/arch/evbarm/conf/std.zynq	Fri Sep  3 21:58:36 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: std.zynq,v 1.6 2018/10/18 09:01:54 skrll Exp $
+#	$NetBSD: std.zynq,v 1.7 2021/09/03 21:58:36 andvar Exp $
 #
 # standard NetBSD/evbarm for ZYNQ options
 
@@ -8,7 +8,7 @@ include		"arch/evbarm/conf/std.evbarm"
 # Pull in Zynq config definitions.
 include		"arch/evbarm/conf/files.zynq"
 
-# Architecture opions
+# Architecture options
 options 	ARM_GENERIC_TODR
 options 	ARM_HAS_VBAR
 options 	ARM_INTR_IMPL=""



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

2021-09-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Sep  3 22:27:32 UTC 2021

Modified Files:
src/usr.bin/xlint/lint1: tree.c

Log Message:
lint: extract build_name_call from build_name

This reduces the indentation, providing enough space to write out the
full diagnostic in the code.  It also prepares for supporting GCC
builtins like __builtin_add_overflow, which return _Bool instead of int.

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.370 -r1.371 src/usr.bin/xlint/lint1/tree.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/xlint/lint1

2021-09-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Sep  3 22:27:32 UTC 2021

Modified Files:
src/usr.bin/xlint/lint1: tree.c

Log Message:
lint: extract build_name_call from build_name

This reduces the indentation, providing enough space to write out the
full diagnostic in the code.  It also prepares for supporting GCC
builtins like __builtin_add_overflow, which return _Bool instead of int.

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.370 -r1.371 src/usr.bin/xlint/lint1/tree.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/xlint/lint1/tree.c
diff -u src/usr.bin/xlint/lint1/tree.c:1.370 src/usr.bin/xlint/lint1/tree.c:1.371
--- src/usr.bin/xlint/lint1/tree.c:1.370	Thu Sep  2 20:10:17 2021
+++ src/usr.bin/xlint/lint1/tree.c	Fri Sep  3 22:27:32 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: tree.c,v 1.370 2021/09/02 20:10:17 rillig Exp $	*/
+/*	$NetBSD: tree.c,v 1.371 2021/09/03 22:27:32 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: tree.c,v 1.370 2021/09/02 20:10:17 rillig Exp $");
+__RCSID("$NetBSD: tree.c,v 1.371 2021/09/03 22:27:32 rillig Exp $");
 #endif
 
 #include 
@@ -215,6 +215,28 @@ is_compiler_builtin(const char *name)
 	return false;
 }
 
+static void
+build_name_call(sym_t *sym)
+{
+
+	if (is_compiler_builtin(sym->s_name)) {
+		/*
+		 * Do not warn about these, just assume that
+		 * they are regular functions compatible with
+		 * non-prototype calling conventions.
+		 */
+	} else if (Sflag) {
+		/* function '%s' implicitly declared to return int */
+		error(215, sym->s_name);
+	} else if (sflag) {
+		/* function '%s' implicitly declared to return int */
+		warning(215, sym->s_name);
+	}
+
+	/* XXX if tflag is set, the symbol should be exported to level 0 */
+	sym->s_type = derive_type(sym->s_type, FUNC);
+}
+
 /*
  * Create a node for a name (symbol table entry).
  * follow_token is the token which follows the name.
@@ -228,24 +250,7 @@ build_name(sym_t *sym, int follow_token)
 		sym->s_scl = EXTERN;
 		sym->s_def = DECL;
 		if (follow_token == T_LPAREN) {
-			if (is_compiler_builtin(sym->s_name)) {
-/*
- * Do not warn about these, just assume that
- * they are regular functions compatible with
- * non-prototype calling conventions.
- */
-			} else if (Sflag) {
-/* function '%s' implicitly declared to ... */
-error(215, sym->s_name);
-			} else if (sflag) {
-/* function '%s' implicitly declared to ... */
-warning(215, sym->s_name);
-			}
-			/*
-			 * XXX if tflag is set the symbol should be
-			 * exported to level 0
-			 */
-			sym->s_type = derive_type(sym->s_type, FUNC);
+			build_name_call(sym);
 		} else {
 			fallback_symbol(sym);
 		}



CVS commit: src

2021-09-03 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Fri Sep  3 22:33:19 UTC 2021

Modified Files:
src/sys/arch/emips/ebus: ace_ebus.c
src/sys/arch/mips/ralink: ralink_gpio.c
src/sys/dev/microcode/aic7xxx: aic79xx.seq aic7xxx.seq
src/sys/dev/pci: mly.c
src/tests/lib/libc/gen/posix_spawn: t_spawn.c
src/tests/sys/uvm: t_uvm_physseg.c
src/usr.sbin/acpitools/aml: aml_store.c

Log Message:
s/existant/existent/ in comments and messages, plus few more similar fixes.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/emips/ebus/ace_ebus.c
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/mips/ralink/ralink_gpio.c
cvs rdiff -u -r1.12 -r1.13 src/sys/dev/microcode/aic7xxx/aic79xx.seq
cvs rdiff -u -r1.20 -r1.21 src/sys/dev/microcode/aic7xxx/aic7xxx.seq
cvs rdiff -u -r1.55 -r1.56 src/sys/dev/pci/mly.c
cvs rdiff -u -r1.2 -r1.3 src/tests/lib/libc/gen/posix_spawn/t_spawn.c
cvs rdiff -u -r1.9 -r1.10 src/tests/sys/uvm/t_uvm_physseg.c
cvs rdiff -u -r1.2 -r1.3 src/usr.sbin/acpitools/aml/aml_store.c

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



CVS commit: src

2021-09-03 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Fri Sep  3 22:33:19 UTC 2021

Modified Files:
src/sys/arch/emips/ebus: ace_ebus.c
src/sys/arch/mips/ralink: ralink_gpio.c
src/sys/dev/microcode/aic7xxx: aic79xx.seq aic7xxx.seq
src/sys/dev/pci: mly.c
src/tests/lib/libc/gen/posix_spawn: t_spawn.c
src/tests/sys/uvm: t_uvm_physseg.c
src/usr.sbin/acpitools/aml: aml_store.c

Log Message:
s/existant/existent/ in comments and messages, plus few more similar fixes.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/emips/ebus/ace_ebus.c
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/mips/ralink/ralink_gpio.c
cvs rdiff -u -r1.12 -r1.13 src/sys/dev/microcode/aic7xxx/aic79xx.seq
cvs rdiff -u -r1.20 -r1.21 src/sys/dev/microcode/aic7xxx/aic7xxx.seq
cvs rdiff -u -r1.55 -r1.56 src/sys/dev/pci/mly.c
cvs rdiff -u -r1.2 -r1.3 src/tests/lib/libc/gen/posix_spawn/t_spawn.c
cvs rdiff -u -r1.9 -r1.10 src/tests/sys/uvm/t_uvm_physseg.c
cvs rdiff -u -r1.2 -r1.3 src/usr.sbin/acpitools/aml/aml_store.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/emips/ebus/ace_ebus.c
diff -u src/sys/arch/emips/ebus/ace_ebus.c:1.24 src/sys/arch/emips/ebus/ace_ebus.c:1.25
--- src/sys/arch/emips/ebus/ace_ebus.c:1.24	Sat Jul 24 21:31:32 2021
+++ src/sys/arch/emips/ebus/ace_ebus.c	Fri Sep  3 22:33:17 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: ace_ebus.c,v 1.24 2021/07/24 21:31:32 andvar Exp $	*/
+/*	$NetBSD: ace_ebus.c,v 1.25 2021/09/03 22:33:17 andvar Exp $	*/
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ace_ebus.c,v 1.24 2021/07/24 21:31:32 andvar Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ace_ebus.c,v 1.25 2021/09/03 22:33:17 andvar Exp $");
 
 #include 
 #include 
@@ -1313,7 +1313,7 @@ sysace_write_at(struct ace_softc *sc, da
 SysaceDumpRegisters(sc->sc_dr);
 /*
  * Ignore, we'll handle it the next time around
- * BUGBUG To be revised along with non-existant
+ * BUGBUG To be revised along with non-existent
  * error handling
  */
 			}

Index: src/sys/arch/mips/ralink/ralink_gpio.c
diff -u src/sys/arch/mips/ralink/ralink_gpio.c:1.11 src/sys/arch/mips/ralink/ralink_gpio.c:1.12
--- src/sys/arch/mips/ralink/ralink_gpio.c:1.11	Sat Aug  7 16:18:59 2021
+++ src/sys/arch/mips/ralink/ralink_gpio.c	Fri Sep  3 22:33:17 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: ralink_gpio.c,v 1.11 2021/08/07 16:18:59 thorpej Exp $	*/
+/*	$NetBSD: ralink_gpio.c,v 1.12 2021/09/03 22:33:17 andvar Exp $	*/
 /*-
  * Copyright (c) 2011 CradlePoint Technology, Inc.
  * All rights reserved.
@@ -29,7 +29,7 @@
 /* ra_gpio.c -- Ralink 3052 gpio driver */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ralink_gpio.c,v 1.11 2021/08/07 16:18:59 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ralink_gpio.c,v 1.12 2021/09/03 22:33:17 andvar Exp $");
 
 #include 
 #include 
@@ -900,7 +900,7 @@ ra_gpio_pin_read(void *arg, int pin)
 		 * then warn and return 0
 		 */
 		const int index = pin_tab_index[pin];
-		KASSERTMSG(index != -1, "%s: non-existant pin=%d\n",
+		KASSERTMSG(index != -1, "%s: non-existent pin=%d\n",
 			__func__, pin);
 		if (index == -1) {
 			rv = 0;
@@ -1001,7 +1001,7 @@ ra_gpio_pin_write(void *arg, int pin, in
 	 * then warn and return
 	 */
 	const int index = pin_tab_index[pin];
-	KASSERTMSG(index != -1, "%s: non-existant pin=%d\n", __func__, pin);
+	KASSERTMSG(index != -1, "%s: non-existent pin=%d\n", __func__, pin);
 	if (index == -1)
 		return;
 
@@ -1432,7 +1432,7 @@ disable_gpio_interrupt(ra_gpio_softc_t *
 {
 	RALINK_DEBUG_FUNC_ENTRY();
 	const int index = pin_tab_index[pin];
-	KASSERTMSG(index != -1, "%s: non-existant pin=%d\n", __func__, pin);
+	KASSERTMSG(index != -1, "%s: non-existent pin=%d\n", __func__, pin);
 	if (index == -1)
 		return;
 
@@ -1456,7 +1456,7 @@ static void
 enable_gpio_interrupt(ra_gpio_softc_t *sc, int pin)
 {
 	const int index = pin_tab_index[pin];
-	KASSERTMSG(index != -1, "%s: non-existant pin=%d\n", __func__, pin);
+	KASSERTMSG(index != -1, "%s: non-existent pin=%d\n", __func__, pin);
 	if (index == -1)
 		return;
 

Index: src/sys/dev/microcode/aic7xxx/aic79xx.seq
diff -u src/sys/dev/microcode/aic7xxx/aic79xx.seq:1.12 src/sys/dev/microcode/aic7xxx/aic79xx.seq:1.13
--- src/sys/dev/microcode/aic7xxx/aic79xx.seq:1.12	Tue Jun  4 10:15:22 2019
+++ src/sys/dev/microcode/aic7xxx/aic79xx.seq	Fri Sep  3 22:33:17 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: aic79xx.seq,v 1.12 2019/06/04 10:15:22 msaitoh Exp $	*/
+/*	$NetBSD: aic79xx.seq,v 1.13 2021/09/03 22:33:17 andvar Exp $	*/
 
 /*
  * Adaptec U320 device driver firmware for Linux and FreeBSD.
@@ -1274,7 +1274,7 @@ service_fifo:
 
 	/*
 	 * We fetch a "cacheline aligned" and sized amount of data
-	 * so we don't end up referencing a non-existant page.
+	 * so we don't end up referencing a non-existent page.
 	 * Cacheline aligned is in quotes bec

CVS commit: src

2021-09-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Sep  3 22:44:09 UTC 2021

Modified Files:
src/distrib/sets/lists/tests: mi
src/tests/usr.bin/xlint/lint1: Makefile
Added Files:
src/tests/usr.bin/xlint/lint1: gcc_builtin_overflow.c
gcc_builtin_overflow.exp

Log Message:
tests/lint: test GCC builtins for overflow in strict bool mode

Seen in inetd.c.


To generate a diff of this commit:
cvs rdiff -u -r1.1121 -r1.1122 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.108 -r1.109 src/tests/usr.bin/xlint/lint1/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/usr.bin/xlint/lint1/gcc_builtin_overflow.c \
src/tests/usr.bin/xlint/lint1/gcc_builtin_overflow.exp

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



CVS commit: src

2021-09-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Sep  3 22:44:09 UTC 2021

Modified Files:
src/distrib/sets/lists/tests: mi
src/tests/usr.bin/xlint/lint1: Makefile
Added Files:
src/tests/usr.bin/xlint/lint1: gcc_builtin_overflow.c
gcc_builtin_overflow.exp

Log Message:
tests/lint: test GCC builtins for overflow in strict bool mode

Seen in inetd.c.


To generate a diff of this commit:
cvs rdiff -u -r1.1121 -r1.1122 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.108 -r1.109 src/tests/usr.bin/xlint/lint1/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/usr.bin/xlint/lint1/gcc_builtin_overflow.c \
src/tests/usr.bin/xlint/lint1/gcc_builtin_overflow.exp

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.1121 src/distrib/sets/lists/tests/mi:1.1122
--- src/distrib/sets/lists/tests/mi:1.1121	Tue Aug 31 18:59:26 2021
+++ src/distrib/sets/lists/tests/mi	Fri Sep  3 22:44:08 2021
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1121 2021/08/31 18:59:26 rillig Exp $
+# $NetBSD: mi,v 1.1122 2021/09/03 22:44:08 rillig Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -6282,6 +6282,8 @@
 ./usr/tests/usr.bin/xlint/lint1/gcc_attribute_var.exp		tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/xlint/lint1/gcc_bit_field_types.c		tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/xlint/lint1/gcc_bit_field_types.exp		tests-usr.bin-tests	compattestfile,atf
+./usr/tests/usr.bin/xlint/lint1/gcc_builtin_overflow.c		tests-usr.bin-tests	compattestfile,atf
+./usr/tests/usr.bin/xlint/lint1/gcc_builtin_overflow.exp	tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/xlint/lint1/gcc_cast_union.c		tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/xlint/lint1/gcc_cast_union.exp		tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/xlint/lint1/gcc_init_compound_literal.c	tests-usr.bin-tests	compattestfile,atf

Index: src/tests/usr.bin/xlint/lint1/Makefile
diff -u src/tests/usr.bin/xlint/lint1/Makefile:1.108 src/tests/usr.bin/xlint/lint1/Makefile:1.109
--- src/tests/usr.bin/xlint/lint1/Makefile:1.108	Tue Aug 31 18:59:26 2021
+++ src/tests/usr.bin/xlint/lint1/Makefile	Fri Sep  3 22:44:09 2021
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.108 2021/08/31 18:59:26 rillig Exp $
+# $NetBSD: Makefile,v 1.109 2021/09/03 22:44:09 rillig Exp $
 
 NOMAN=		# defined
 MAX_MESSAGE=	346		# see lint1/err.c
@@ -172,6 +172,8 @@ FILES+=		gcc_attribute_var.c
 FILES+=		gcc_attribute_var.exp
 FILES+=		gcc_bit_field_types.c
 FILES+=		gcc_bit_field_types.exp
+FILES+=		gcc_builtin_overflow.c
+FILES+=		gcc_builtin_overflow.exp
 FILES+=		gcc_cast_union.c
 FILES+=		gcc_cast_union.exp
 FILES+=		gcc_init_compound_literal.c

Added files:

Index: src/tests/usr.bin/xlint/lint1/gcc_builtin_overflow.c
diff -u /dev/null src/tests/usr.bin/xlint/lint1/gcc_builtin_overflow.c:1.1
--- /dev/null	Fri Sep  3 22:44:09 2021
+++ src/tests/usr.bin/xlint/lint1/gcc_builtin_overflow.c	Fri Sep  3 22:44:09 2021
@@ -0,0 +1,25 @@
+/*	$NetBSD: gcc_builtin_overflow.c,v 1.1 2021/09/03 22:44:09 rillig Exp $	*/
+# 3 "gcc_builtin_overflow.c"
+
+/*
+ * Some GCC builtin functions return bool, and in lint's strict bool mode,
+ * that makes a difference.
+ *
+ * https://gcc.gnu.org/onlinedocs/gcc/Integer-Overflow-Builtins.html
+ */
+
+/* lint1-extra-flags: -T */
+
+void
+is_overflow(void)
+{
+	int sum;
+
+	/* expect+1: error: controlling expression must be bool, not 'int' [333] */
+	if (__builtin_add_overflow(1, 2, &sum))
+		return;
+
+	/* expect+1: error: controlling expression must be bool, not 'int' [333] */
+	if (__builtin_add_overflow_p(1, 2, 12345))
+		return;
+}
Index: src/tests/usr.bin/xlint/lint1/gcc_builtin_overflow.exp
diff -u /dev/null src/tests/usr.bin/xlint/lint1/gcc_builtin_overflow.exp:1.1
--- /dev/null	Fri Sep  3 22:44:09 2021
+++ src/tests/usr.bin/xlint/lint1/gcc_builtin_overflow.exp	Fri Sep  3 22:44:09 2021
@@ -0,0 +1,2 @@
+gcc_builtin_overflow.c(19): error: controlling expression must be bool, not 'int' [333]
+gcc_builtin_overflow.c(23): error: controlling expression must be bool, not 'int' [333]



CVS commit: src

2021-09-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Sep  3 22:48:49 UTC 2021

Modified Files:
src/tests/usr.bin/xlint/lint1: gcc_builtin_overflow.c
gcc_builtin_overflow.exp
src/usr.bin/xlint/lint1: tree.c

Log Message:
lint: set the return type of __builtin_*_overflow to bool, not int

Needed for inetd.c in strict bool mode.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/usr.bin/xlint/lint1/gcc_builtin_overflow.c \
src/tests/usr.bin/xlint/lint1/gcc_builtin_overflow.exp
cvs rdiff -u -r1.371 -r1.372 src/usr.bin/xlint/lint1/tree.c

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



CVS commit: src

2021-09-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Sep  3 22:48:49 UTC 2021

Modified Files:
src/tests/usr.bin/xlint/lint1: gcc_builtin_overflow.c
gcc_builtin_overflow.exp
src/usr.bin/xlint/lint1: tree.c

Log Message:
lint: set the return type of __builtin_*_overflow to bool, not int

Needed for inetd.c in strict bool mode.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/usr.bin/xlint/lint1/gcc_builtin_overflow.c \
src/tests/usr.bin/xlint/lint1/gcc_builtin_overflow.exp
cvs rdiff -u -r1.371 -r1.372 src/usr.bin/xlint/lint1/tree.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/usr.bin/xlint/lint1/gcc_builtin_overflow.c
diff -u src/tests/usr.bin/xlint/lint1/gcc_builtin_overflow.c:1.1 src/tests/usr.bin/xlint/lint1/gcc_builtin_overflow.c:1.2
--- src/tests/usr.bin/xlint/lint1/gcc_builtin_overflow.c:1.1	Fri Sep  3 22:44:09 2021
+++ src/tests/usr.bin/xlint/lint1/gcc_builtin_overflow.c	Fri Sep  3 22:48:49 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: gcc_builtin_overflow.c,v 1.1 2021/09/03 22:44:09 rillig Exp $	*/
+/*	$NetBSD: gcc_builtin_overflow.c,v 1.2 2021/09/03 22:48:49 rillig Exp $	*/
 # 3 "gcc_builtin_overflow.c"
 
 /*
@@ -15,11 +15,13 @@ is_overflow(void)
 {
 	int sum;
 
-	/* expect+1: error: controlling expression must be bool, not 'int' [333] */
 	if (__builtin_add_overflow(1, 2, &sum))
 		return;
 
-	/* expect+1: error: controlling expression must be bool, not 'int' [333] */
 	if (__builtin_add_overflow_p(1, 2, 12345))
 		return;
+
+	/* expect+1: error: controlling expression must be bool, not 'int' [333] */
+	if (__builtin_other(1, 2, 12345))
+		return;
 }
Index: src/tests/usr.bin/xlint/lint1/gcc_builtin_overflow.exp
diff -u src/tests/usr.bin/xlint/lint1/gcc_builtin_overflow.exp:1.1 src/tests/usr.bin/xlint/lint1/gcc_builtin_overflow.exp:1.2
--- src/tests/usr.bin/xlint/lint1/gcc_builtin_overflow.exp:1.1	Fri Sep  3 22:44:09 2021
+++ src/tests/usr.bin/xlint/lint1/gcc_builtin_overflow.exp	Fri Sep  3 22:48:49 2021
@@ -1,2 +1 @@
-gcc_builtin_overflow.c(19): error: controlling expression must be bool, not 'int' [333]
-gcc_builtin_overflow.c(23): error: controlling expression must be bool, not 'int' [333]
+gcc_builtin_overflow.c(25): error: controlling expression must be bool, not 'int' [333]

Index: src/usr.bin/xlint/lint1/tree.c
diff -u src/usr.bin/xlint/lint1/tree.c:1.371 src/usr.bin/xlint/lint1/tree.c:1.372
--- src/usr.bin/xlint/lint1/tree.c:1.371	Fri Sep  3 22:27:32 2021
+++ src/usr.bin/xlint/lint1/tree.c	Fri Sep  3 22:48:49 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: tree.c,v 1.371 2021/09/03 22:27:32 rillig Exp $	*/
+/*	$NetBSD: tree.c,v 1.372 2021/09/03 22:48:49 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: tree.c,v 1.371 2021/09/03 22:27:32 rillig Exp $");
+__RCSID("$NetBSD: tree.c,v 1.372 2021/09/03 22:48:49 rillig Exp $");
 #endif
 
 #include 
@@ -215,6 +215,25 @@ is_compiler_builtin(const char *name)
 	return false;
 }
 
+static bool
+str_endswith(const char *haystack, const char *needle)
+{
+	size_t hlen = strlen(haystack);
+	size_t nlen = strlen(needle);
+
+	return nlen <= hlen &&
+	   memcmp(haystack + hlen - nlen, needle, nlen) == 0;
+}
+
+/* https://gcc.gnu.org/onlinedocs/gcc/Integer-Overflow-Builtins.html */
+static bool
+is_gcc_bool_builtin(const char *name)
+{
+	return strncmp(name, "__builtin_", 10) == 0 &&
+	   (str_endswith(name, "_overflow") ||
+		str_endswith(name, "_overflow_p"));
+}
+
 static void
 build_name_call(sym_t *sym)
 {
@@ -225,6 +244,10 @@ build_name_call(sym_t *sym)
 		 * they are regular functions compatible with
 		 * non-prototype calling conventions.
 		 */
+
+		if (is_gcc_bool_builtin(sym->s_name))
+			sym->s_type = gettyp(BOOL);
+
 	} else if (Sflag) {
 		/* function '%s' implicitly declared to return int */
 		error(215, sym->s_name);



CVS commit: src/sys/crypto/camellia

2021-09-03 Thread David H. Gutteridge
Module Name:src
Committed By:   gutteridge
Date:   Sat Sep  4 00:33:10 UTC 2021

Modified Files:
src/sys/crypto/camellia: camellia-api.c camellia.c

Log Message:
Fix typos in comments and add missing KERNEL_RCSID


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/crypto/camellia/camellia-api.c
cvs rdiff -u -r1.2 -r1.3 src/sys/crypto/camellia/camellia.c

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



CVS commit: src/sys/crypto/camellia

2021-09-03 Thread David H. Gutteridge
Module Name:src
Committed By:   gutteridge
Date:   Sat Sep  4 00:33:10 UTC 2021

Modified Files:
src/sys/crypto/camellia: camellia-api.c camellia.c

Log Message:
Fix typos in comments and add missing KERNEL_RCSID


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/crypto/camellia/camellia-api.c
cvs rdiff -u -r1.2 -r1.3 src/sys/crypto/camellia/camellia.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/crypto/camellia/camellia-api.c
diff -u src/sys/crypto/camellia/camellia-api.c:1.1 src/sys/crypto/camellia/camellia-api.c:1.2
--- src/sys/crypto/camellia/camellia-api.c:1.1	Thu May  5 17:38:36 2011
+++ src/sys/crypto/camellia/camellia-api.c	Sat Sep  4 00:33:09 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: camellia-api.c,v 1.1 2011/05/05 17:38:36 drochner Exp $ */
+/* $NetBSD: camellia-api.c,v 1.2 2021/09/04 00:33:09 gutteridge Exp $ */
 
 /*
  *
@@ -28,6 +28,7 @@
  */
 
 #include 
+__KERNEL_RCSID(0, "$NetBSD: camellia-api.c,v 1.2 2021/09/04 00:33:09 gutteridge Exp $");
 
 #include 
 #include 

Index: src/sys/crypto/camellia/camellia.c
diff -u src/sys/crypto/camellia/camellia.c:1.2 src/sys/crypto/camellia/camellia.c:1.3
--- src/sys/crypto/camellia/camellia.c:1.2	Wed Jan  1 15:18:57 2014
+++ src/sys/crypto/camellia/camellia.c	Sat Sep  4 00:33:09 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: camellia.c,v 1.2 2014/01/01 15:18:57 pgoyette Exp $ */
+/* $NetBSD: camellia.c,v 1.3 2021/09/04 00:33:09 gutteridge Exp $ */
 
 /* camellia.h ver 1.1.0
  *
@@ -33,6 +33,8 @@
  */
 
 #include 
+__KERNEL_RCSID(0, "$NetBSD: camellia.c,v 1.3 2021/09/04 00:33:09 gutteridge Exp $");
+
 #include 
 #include 
 #include 
@@ -1007,7 +1009,7 @@ camellia_encrypt128(const uint32_t *subk
 void
 camellia_decrypt128(const uint32_t *subkey, uint32_t *io)
 {
-uint32_t il,ir,t0,t1;   /* temporary valiables */
+uint32_t il,ir,t0,t1;   /* temporary variables */
 
 /* pre whitening but absorb kw2*/
 io[0] ^= SUBL(24);
@@ -1077,7 +1079,7 @@ camellia_decrypt128(const uint32_t *subk
 void
 camellia_encrypt256(const uint32_t *subkey, uint32_t *io)
 {
-uint32_t il,ir,t0,t1;   /* temporary valiables */
+uint32_t il,ir,t0,t1;   /* temporary variables */
 
 /* pre whitening but absorb kw2*/
 io[0] ^= SUBL(0);
@@ -1160,7 +1162,7 @@ camellia_encrypt256(const uint32_t *subk
 void
 camellia_decrypt256(const uint32_t *subkey, uint32_t *io)
 {
-uint32_t il,ir,t0,t1;   /* temporary valiables */
+uint32_t il,ir,t0,t1;   /* temporary variables */
 
 /* pre whitening but absorb kw2*/
 io[0] ^= SUBL(32);



CVS commit: src/tests/lib/libcurses/slave

2021-09-03 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Sep  4 01:34:32 UTC 2021

Modified Files:
src/tests/lib/libcurses/slave: commands.c

Log Message:
Cosmetic fixes. No functional changes intended.
- Reorganize logic to reduce indent levels significantly.
- Use ``for'' rather than ``while''.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/tests/lib/libcurses/slave/commands.c

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



CVS commit: src/tests/lib/libcurses/slave

2021-09-03 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Sep  4 01:34:32 UTC 2021

Modified Files:
src/tests/lib/libcurses/slave: commands.c

Log Message:
Cosmetic fixes. No functional changes intended.
- Reorganize logic to reduce indent levels significantly.
- Use ``for'' rather than ``while''.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/tests/lib/libcurses/slave/commands.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/lib/libcurses/slave/commands.c
diff -u src/tests/lib/libcurses/slave/commands.c:1.15 src/tests/lib/libcurses/slave/commands.c:1.16
--- src/tests/lib/libcurses/slave/commands.c:1.15	Sun Jun 13 12:46:01 2021
+++ src/tests/lib/libcurses/slave/commands.c	Sat Sep  4 01:34:32 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: commands.c,v 1.15 2021/06/13 12:46:01 rillig Exp $	*/
+/*	$NetBSD: commands.c,v 1.16 2021/09/04 01:34:32 rin Exp $	*/
 
 /*-
  * Copyright 2009 Brett Lymn 
@@ -53,32 +53,32 @@ command_execute(char *func, int nargs, c
 {
 	size_t i, j;
 
-	i = 0;
-	while (i < ncmds) {
-		if (strcmp(func, commands[i].name) == 0) {
-			/* Check only restricted set of functions is called before
-			 * initscr/newterm */
-			if (!initdone) {
-j = 0;
-while (j < nrcmds) {
-	if (strcmp(func, restricted_commands[j]) == 0) {
-		if (strcmp(func, "initscr") == 0  ||
-			strcmp(func, "newterm") == 0)
-			initdone = 1;
-		/* matched function */
-		commands[i].func(nargs, args);
-		return;
-	}
-	j++;
-}
-report_status("YOU NEED TO CALL INITSCR/NEWTERM FIRST");
-return;
-			}
+	for (i = 0; i < ncmds; i++) {
+		if (strcmp(func, commands[i].name) != 0)
+			continue;
+
+		/* Check only restricted set of functions is called before
+		 * initscr/newterm */
+		if (initdone) {
 			/* matched function */
 			commands[i].func(nargs, args);
 			return;
 		}
-		i++;
+
+		for (j = 0; j < nrcmds; j++) {
+			if (strcmp(func, restricted_commands[j]) != 0)
+continue;
+
+			if (strcmp(func, "initscr") == 0  ||
+			strcmp(func, "newterm") == 0)
+initdone = 1;
+
+			/* matched function */
+			commands[i].func(nargs, args);
+			return;
+		}
+		report_status("YOU NEED TO CALL INITSCR/NEWTERM FIRST");
+		return;
 	}
 
 	report_status("UNKNOWN_FUNCTION");



CVS commit: src/crypto/external/bsd/openssh/dist

2021-09-03 Thread Ryo ONODERA
Module Name:src
Committed By:   ryoon
Date:   Sat Sep  4 01:47:47 UTC 2021

Modified Files:
src/crypto/external/bsd/openssh/dist: dns.c

Log Message:
Fix inverted logic in OpenSSH SSHFP DNS record verification


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/crypto/external/bsd/openssh/dist/dns.c

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



CVS commit: src/crypto/external/bsd/openssh/dist

2021-09-03 Thread Ryo ONODERA
Module Name:src
Committed By:   ryoon
Date:   Sat Sep  4 01:47:47 UTC 2021

Modified Files:
src/crypto/external/bsd/openssh/dist: dns.c

Log Message:
Fix inverted logic in OpenSSH SSHFP DNS record verification


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/crypto/external/bsd/openssh/dist/dns.c

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

Modified files:

Index: src/crypto/external/bsd/openssh/dist/dns.c
diff -u src/crypto/external/bsd/openssh/dist/dns.c:1.19 src/crypto/external/bsd/openssh/dist/dns.c:1.20
--- src/crypto/external/bsd/openssh/dist/dns.c:1.19	Thu Sep  2 11:26:17 2021
+++ src/crypto/external/bsd/openssh/dist/dns.c	Sat Sep  4 01:47:47 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: dns.c,v 1.19 2021/09/02 11:26:17 christos Exp $	*/
+/*	$NetBSD: dns.c,v 1.20 2021/09/04 01:47:47 ryoon Exp $	*/
 /* $OpenBSD: dns.c,v 1.41 2021/07/19 03:13:28 dtucker Exp $ */
 
 /*
@@ -27,7 +27,7 @@
  */
 
 #include "includes.h"
-__RCSID("$NetBSD: dns.c,v 1.19 2021/09/02 11:26:17 christos Exp $");
+__RCSID("$NetBSD: dns.c,v 1.20 2021/09/04 01:47:47 ryoon Exp $");
 #include 
 #include 
 
@@ -267,7 +267,7 @@ verify_host_key_dns(const char *hostname
 		/* Check if the current key is the same as the given key */
 		if (hostkey_algorithm == dnskey_algorithm &&
 		hostkey_digest_len == dnskey_digest_len) {
-			if (consttime_memequal(hostkey_digest, dnskey_digest,
+			if (!consttime_memequal(hostkey_digest, dnskey_digest,
 			hostkey_digest_len) == 0) {
 debug_f("matched SSHFP type %d fptype %d",
 dnskey_algorithm, dnskey_digest_type);



CVS commit: src/sys/arch/cobalt/cobalt

2021-09-03 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Sep  4 02:19:56 UTC 2021

Modified Files:
src/sys/arch/cobalt/cobalt: console.c

Log Message:
Use C99 designated initializer.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/cobalt/cobalt/console.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/cobalt/cobalt/console.c
diff -u src/sys/arch/cobalt/cobalt/console.c:1.12 src/sys/arch/cobalt/cobalt/console.c:1.13
--- src/sys/arch/cobalt/cobalt/console.c:1.12	Fri Jul  1 20:36:42 2011
+++ src/sys/arch/cobalt/cobalt/console.c	Sat Sep  4 02:19:56 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: console.c,v 1.12 2011/07/01 20:36:42 dyoung Exp $	*/
+/*	$NetBSD: console.c,v 1.13 2021/09/04 02:19:56 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 2000 Soren S. Jorvang.  All rights reserved.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: console.c,v 1.12 2011/07/01 20:36:42 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: console.c,v 1.13 2021/09/04 02:19:56 tsutsui Exp $");
 
 #include 
 #include 
@@ -50,18 +50,59 @@ int	console_present = 0;	/* Do we have a
 
 struct	consdev	constab[] = {
 #if NCOM_MAINBUS > 0
-	{ com_mainbus_cnprobe, com_mainbus_cninit,
-	NULL, NULL, NULL, NULL, NULL, NULL, 0, CN_DEAD },
+	{
+		.cn_probe = com_mainbus_cnprobe,
+		.cn_init  = com_mainbus_cninit,
+		.cn_getc  = NULL,
+		.cn_putc  = NULL,
+		.cn_pollc = NULL,
+		.cn_bell  = NULL,
+		.cn_halt  = NULL,
+		.cn_flush = NULL,
+		.cn_dev   = 0,
+		.cn_pri   = CN_DEAD
+	},
 #endif
 #if NZSC > 0
-	{ zscnprobe, zscninit, zscngetc, zscnputc, nullcnpollc,
-	NULL, NULL, NULL, NODEV, CN_DEAD },
+	{
+		.cn_probe = zscnprobe,
+		.cn_init  = zscninit,
+		.cn_getc  = zscngetc,
+		.cn_putc  = zscnputc,
+		.cn_pollc = nullcnpollc,
+		.cn_bell  = NULL,
+		.cn_halt  = NULL,
+		.cn_flush = NULL,
+		.cn_dev   = NODEV,
+		.cn_pri   = CN_DEAD
+	},
 #endif
 #if NNULLCONS > 0
-	{ nullcnprobe, nullcninit,
-	NULL, NULL, NULL, NULL, NULL, NULL, 0, CN_DEAD },
+	{
+		.cn_probe = nullcnprobe,
+		.cn_init  = nullcninit,
+		.cn_getc  = NULL,
+		.cn_putc  = NULL,
+		.cn_pollc = NULL,
+		.cn_bell  = NULL,
+		.cn_halt  = NULL,
+		.cn_flush = NULL,
+		.cn_dev   = 0,
+		.cn_pri   = CN_DEAD
+	},
 #endif
-	{ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, CN_DEAD }
+	{
+		.cn_probe = NULL,
+		.cn_init  = NULL,
+		.cn_getc  = NULL,
+		.cn_putc  = NULL,
+		.cn_pollc = NULL,
+		.cn_bell  = NULL,
+		.cn_halt  = NULL,
+		.cn_flush = NULL,
+		.cn_dev   = 0,
+		.cn_pri   = CN_DEAD
+	}
 };
 
 #define CONSOLE_PROBE	0x0020001c	/* console flag passed by firmware */



CVS commit: src/sys/arch/cobalt/cobalt

2021-09-03 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Sep  4 02:19:56 UTC 2021

Modified Files:
src/sys/arch/cobalt/cobalt: console.c

Log Message:
Use C99 designated initializer.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/cobalt/cobalt/console.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/cobalt

2021-09-03 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Sep  4 02:24:27 UTC 2021

Modified Files:
src/sys/arch/cobalt/conf: files.cobalt
Removed Files:
src/sys/arch/cobalt/cobalt: disksubr.c

Log Message:
Use MI subr_disk_mbr.c for proper MBR and bi-endian supprot.

No special MD handling in previous.  Briefly tested on gxemul 0.6.3.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r0 src/sys/arch/cobalt/cobalt/disksubr.c
cvs rdiff -u -r1.42 -r1.43 src/sys/arch/cobalt/conf/files.cobalt

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/cobalt/conf/files.cobalt
diff -u src/sys/arch/cobalt/conf/files.cobalt:1.42 src/sys/arch/cobalt/conf/files.cobalt:1.43
--- src/sys/arch/cobalt/conf/files.cobalt:1.42	Sat Apr 24 23:36:31 2021
+++ src/sys/arch/cobalt/conf/files.cobalt	Sat Sep  4 02:24:27 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: files.cobalt,v 1.42 2021/04/24 23:36:31 thorpej Exp $
+#	$NetBSD: files.cobalt,v 1.43 2021/09/04 02:24:27 tsutsui Exp $
 
 maxpartitions 16
 
@@ -41,10 +41,11 @@ file arch/cobalt/dev/gt.c		gt
 file arch/cobalt/dev/gt_io_space.c	gt
 file arch/cobalt/dev/gt_mem_space.c	gt
 
+file kern/subr_disk_mbr.c
+
 file arch/cobalt/cobalt/autoconf.c
 file arch/cobalt/cobalt/bus.c
 file arch/cobalt/cobalt/console.c
-file arch/cobalt/cobalt/disksubr.c
 file arch/cobalt/cobalt/interrupt.c
 file arch/cobalt/cobalt/machdep.c
 



CVS commit: src/sys/arch/cobalt

2021-09-03 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Sep  4 02:24:27 UTC 2021

Modified Files:
src/sys/arch/cobalt/conf: files.cobalt
Removed Files:
src/sys/arch/cobalt/cobalt: disksubr.c

Log Message:
Use MI subr_disk_mbr.c for proper MBR and bi-endian supprot.

No special MD handling in previous.  Briefly tested on gxemul 0.6.3.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r0 src/sys/arch/cobalt/cobalt/disksubr.c
cvs rdiff -u -r1.42 -r1.43 src/sys/arch/cobalt/conf/files.cobalt

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



CVS commit: src/tests/usr.bin/c++

2021-09-03 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Sep  4 05:47:31 UTC 2021

Modified Files:
src/tests/usr.bin/c++: t_call_once2.sh

Log Message:
Fix typo to correctly initialize call_once2_pic_profile.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/usr.bin/c++/t_call_once2.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/c++/t_call_once2.sh
diff -u src/tests/usr.bin/c++/t_call_once2.sh:1.2 src/tests/usr.bin/c++/t_call_once2.sh:1.3
--- src/tests/usr.bin/c++/t_call_once2.sh:1.2	Wed May 15 13:43:45 2019
+++ src/tests/usr.bin/c++/t_call_once2.sh	Sat Sep  4 05:47:31 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: t_call_once2.sh,v 1.2 2019/05/15 13:43:45 christos Exp $
+#	$NetBSD: t_call_once2.sh,v 1.3 2021/09/04 05:47:31 rin Exp $
 #
 # Copyright (c) 2018 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -50,7 +50,7 @@ call_once2_pic_32_head() {
 }
 
 atf_test_case call_once2_pic_profile
-call_once2_pic_head() {
+call_once2_pic_profile_head() {
 	atf_set "descr" "compile and run PIC std::call_once with profiling flag"
 	atf_set "require.progs" "c++"
 }



CVS commit: src/tests/usr.bin/c++

2021-09-03 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Sep  4 05:47:31 UTC 2021

Modified Files:
src/tests/usr.bin/c++: t_call_once2.sh

Log Message:
Fix typo to correctly initialize call_once2_pic_profile.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/usr.bin/c++/t_call_once2.sh

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