CVS commit: src/sys/dev/pci

2022-09-21 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Thu Sep 22 05:50:52 UTC 2022

Modified Files:
src/sys/dev/pci: if_aq.c

Log Message:
aq(4): Don't schedule tick callout on interrupt if stopping.

Make sure to take the lock around access to sc_detect_linkstat too.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/dev/pci/if_aq.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_aq.c
diff -u src/sys/dev/pci/if_aq.c:1.33 src/sys/dev/pci/if_aq.c:1.34
--- src/sys/dev/pci/if_aq.c:1.33	Fri Sep 16 03:55:53 2022
+++ src/sys/dev/pci/if_aq.c	Thu Sep 22 05:50:52 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_aq.c,v 1.33 2022/09/16 03:55:53 skrll Exp $	*/
+/*	$NetBSD: if_aq.c,v 1.34 2022/09/22 05:50:52 riastradh Exp $	*/
 
 /**
  * aQuantia Corporation Network Driver
@@ -62,7 +62,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_aq.c,v 1.33 2022/09/16 03:55:53 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_aq.c,v 1.34 2022/09/22 05:50:52 riastradh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_if_aq.h"
@@ -3976,8 +3976,11 @@ aq_legacy_intr(void *arg)
 	AQ_WRITE_REG(sc, AQ_INTR_STATUS_CLR_REG, 0x);
 
 	if (status & __BIT(sc->sc_linkstat_irq)) {
+		AQ_LOCK(sc);
 		sc->sc_detect_linkstat = true;
-		callout_schedule(>sc_tick_ch, 0);
+		if (!sc->sc_stopping)
+			callout_schedule(>sc_tick_ch, 0);
+		AQ_UNLOCK(sc);
 		nintr++;
 	}
 
@@ -4029,8 +4032,11 @@ aq_link_intr(void *arg)
 
 	status = AQ_READ_REG(sc, AQ_INTR_STATUS_REG);
 	if (status & __BIT(sc->sc_linkstat_irq)) {
+		AQ_LOCK(sc);
 		sc->sc_detect_linkstat = true;
-		callout_schedule(>sc_tick_ch, 0);
+		if (!sc->sc_stopping)
+			callout_schedule(>sc_tick_ch, 0);
+		AQ_UNLOCK(sc);
 		AQ_WRITE_REG(sc, AQ_INTR_STATUS_CLR_REG,
 		__BIT(sc->sc_linkstat_irq));
 		nintr++;



CVS commit: src/sys/dev/pci

2022-09-21 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Thu Sep 22 05:50:52 UTC 2022

Modified Files:
src/sys/dev/pci: if_aq.c

Log Message:
aq(4): Don't schedule tick callout on interrupt if stopping.

Make sure to take the lock around access to sc_detect_linkstat too.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/dev/pci/if_aq.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/ftp

2022-09-21 Thread Luke Mewburn
Module Name:src
Committed By:   lukem
Date:   Thu Sep 22 03:31:04 UTC 2022

Modified Files:
src/usr.bin/ftp: version.h

Log Message:
update ftp version to 20220911

PR/57003: Handle relative URLs (patch by kim@)


To generate a diff of this commit:
cvs rdiff -u -r1.94 -r1.95 src/usr.bin/ftp/version.h

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

Modified files:

Index: src/usr.bin/ftp/version.h
diff -u src/usr.bin/ftp/version.h:1.94 src/usr.bin/ftp/version.h:1.95
--- src/usr.bin/ftp/version.h:1.94	Thu Aug 26 06:25:59 2021
+++ src/usr.bin/ftp/version.h	Thu Sep 22 03:31:04 2022
@@ -1,7 +1,7 @@
-/*	$NetBSD: version.h,v 1.94 2021/08/26 06:25:59 lukem Exp $	*/
+/*	$NetBSD: version.h,v 1.95 2022/09/22 03:31:04 lukem Exp $	*/
 
 /*-
- * Copyright (c) 1999-2021 The NetBSD Foundation, Inc.
+ * Copyright (c) 1999-2022 The NetBSD Foundation, Inc.
  * All rights reserved.
  *
  * This code is derived from software contributed to The NetBSD Foundation
@@ -34,5 +34,5 @@
 #endif
 
 #ifndef FTP_VERSION
-#define	FTP_VERSION	"20210826"
+#define	FTP_VERSION	"20220911"
 #endif



CVS commit: src/usr.bin/ftp

2022-09-21 Thread Luke Mewburn
Module Name:src
Committed By:   lukem
Date:   Thu Sep 22 03:31:04 UTC 2022

Modified Files:
src/usr.bin/ftp: version.h

Log Message:
update ftp version to 20220911

PR/57003: Handle relative URLs (patch by kim@)


To generate a diff of this commit:
cvs rdiff -u -r1.94 -r1.95 src/usr.bin/ftp/version.h

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



CVS commit: src

2022-09-21 Thread David H. Gutteridge
Module Name:src
Committed By:   gutteridge
Date:   Wed Sep 21 22:01:56 UTC 2022

Modified Files:
src: UPDATING

Log Message:
UPDATING: a couple of pedantic edits


To generate a diff of this commit:
cvs rdiff -u -r1.331 -r1.332 src/UPDATING

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



CVS commit: src

2022-09-21 Thread David H. Gutteridge
Module Name:src
Committed By:   gutteridge
Date:   Wed Sep 21 22:01:56 UTC 2022

Modified Files:
src: UPDATING

Log Message:
UPDATING: a couple of pedantic edits


To generate a diff of this commit:
cvs rdiff -u -r1.331 -r1.332 src/UPDATING

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

Modified files:

Index: src/UPDATING
diff -u src/UPDATING:1.331 src/UPDATING:1.332
--- src/UPDATING:1.331	Wed Sep 21 14:32:26 2022
+++ src/UPDATING	Wed Sep 21 22:01:56 2022
@@ -1,4 +1,4 @@
-$NetBSD: UPDATING,v 1.331 2022/09/21 14:32:26 riastradh Exp $
+$NetBSD: UPDATING,v 1.332 2022/09/21 22:01:56 gutteridge Exp $
 
 This file (UPDATING) is intended to be a brief reference to recent
 changes that might cause problems in the build process, and a guide for
@@ -26,7 +26,7 @@ Recent changes:
 
 	The kernel can still load modules at runtime with no bootloader
 	update.  This will not affect release branches because it only
-	applies to patch numbers >100.
+	applies to patch numbers >=100.
 
 20220821:
 	Support for building extsrc/ has been deprecated.
@@ -92,7 +92,7 @@ Recent changes:
 
 20200614:
 	blacklist* has been renamed to blocklist*. postinstall(8)
-	should handle the migration
+	should handle the migration.
 
 20200601:
 	Due to a mistake in LIBISPRIVATE handling, .so libraries were



CVS commit: src/sys/dev/pci

2022-09-21 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Wed Sep 21 20:24:43 UTC 2022

Modified Files:
src/sys/dev/pci: if_ste.c

Log Message:
No need to include 


To generate a diff of this commit:
cvs rdiff -u -r1.63 -r1.64 src/sys/dev/pci/if_ste.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_ste.c
diff -u src/sys/dev/pci/if_ste.c:1.63 src/sys/dev/pci/if_ste.c:1.64
--- src/sys/dev/pci/if_ste.c:1.63	Wed Sep 21 20:23:56 2022
+++ src/sys/dev/pci/if_ste.c	Wed Sep 21 20:24:42 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_ste.c,v 1.63 2022/09/21 20:23:56 thorpej Exp $	*/
+/*	$NetBSD: if_ste.c,v 1.64 2022/09/21 20:24:42 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -35,14 +35,13 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_ste.c,v 1.63 2022/09/21 20:23:56 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ste.c,v 1.64 2022/09/21 20:24:42 thorpej Exp $");
 
 
 #include 
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 



CVS commit: src/sys/dev/pci

2022-09-21 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Wed Sep 21 20:24:43 UTC 2022

Modified Files:
src/sys/dev/pci: if_ste.c

Log Message:
No need to include 


To generate a diff of this commit:
cvs rdiff -u -r1.63 -r1.64 src/sys/dev/pci/if_ste.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

2022-09-21 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Wed Sep 21 20:23:57 UTC 2022

Modified Files:
src/sys/dev/pci: if_ste.c

Log Message:
Fix a memory leak in an extremely uncommon error path in ste_start().


To generate a diff of this commit:
cvs rdiff -u -r1.62 -r1.63 src/sys/dev/pci/if_ste.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

2022-09-21 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Wed Sep 21 20:23:57 UTC 2022

Modified Files:
src/sys/dev/pci: if_ste.c

Log Message:
Fix a memory leak in an extremely uncommon error path in ste_start().


To generate a diff of this commit:
cvs rdiff -u -r1.62 -r1.63 src/sys/dev/pci/if_ste.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_ste.c
diff -u src/sys/dev/pci/if_ste.c:1.62 src/sys/dev/pci/if_ste.c:1.63
--- src/sys/dev/pci/if_ste.c:1.62	Sun Mar 15 22:20:31 2020
+++ src/sys/dev/pci/if_ste.c	Wed Sep 21 20:23:56 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_ste.c,v 1.62 2020/03/15 22:20:31 thorpej Exp $	*/
+/*	$NetBSD: if_ste.c,v 1.63 2022/09/21 20:23:56 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_ste.c,v 1.62 2020/03/15 22:20:31 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ste.c,v 1.63 2022/09/21 20:23:56 thorpej Exp $");
 
 
 #include 
@@ -722,6 +722,7 @@ ste_start(struct ifnet *ifp)
 printf("%s: unable to load Tx buffer, "
 "error = %d\n", device_xname(sc->sc_dev),
 error);
+m_freem(m);
 break;
 			}
 		}



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

2022-09-21 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Wed Sep 21 20:21:16 UTC 2022

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

Log Message:
Just skipping sunxi_can_rx_intr() if the DATA_OR flag is set isn't enough
to properly recover from overrrun in all case. So go the linux way and reset
the hardware.

Don't write SUNXI_CAN_INT_RX_FLAG to SUNXI_CAN_INT_REG, this could race
with hardware and clear the interrupt while there are new packets received.
SUNXI_CAN_INT_RX_FLAG clears automatically when all pending packets have been
read, so when no more packets are pending just read SUNXI_CAN_INT_REG again
and process other interrupts, if any (or RX if there are new packets pending).
With this change it seems I get overruns less often in my use case.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/arm/sunxi/sunxi_can.c

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

Modified files:

Index: src/sys/arch/arm/sunxi/sunxi_can.c
diff -u src/sys/arch/arm/sunxi/sunxi_can.c:1.10 src/sys/arch/arm/sunxi/sunxi_can.c:1.11
--- src/sys/arch/arm/sunxi/sunxi_can.c:1.10	Mon Sep 19 11:21:36 2022
+++ src/sys/arch/arm/sunxi/sunxi_can.c	Wed Sep 21 20:21:16 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: sunxi_can.c,v 1.10 2022/09/19 11:21:36 bouyer Exp $	*/
+/*	$NetBSD: sunxi_can.c,v 1.11 2022/09/21 20:21:16 bouyer Exp $	*/
 
 /*-
  * Copyright (c) 2017,2018 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
 
 #include 
 
-__KERNEL_RCSID(1, "$NetBSD: sunxi_can.c,v 1.10 2022/09/19 11:21:36 bouyer Exp $");
+__KERNEL_RCSID(1, "$NetBSD: sunxi_can.c,v 1.11 2022/09/21 20:21:16 bouyer Exp $");
 
 #include 
 #include 
@@ -101,6 +101,8 @@ static void sunxi_can_ifwatchdog(struct 
 
 static void sunxi_can_enter_reset(struct sunxi_can_softc *);
 static void sunxi_can_exit_reset(struct sunxi_can_softc *);
+static void sunxi_can_ifdown(struct sunxi_can_softc * const);
+static int sunxi_can_ifup(struct sunxi_can_softc * const);
 
 CFATTACH_DECL_NEW(sunxi_can, sizeof(struct sunxi_can_softc),
 	sunxi_can_match, sunxi_can_attach, NULL, NULL);
@@ -344,7 +346,9 @@ sunxi_can_err_intr(struct sunxi_can_soft
 
 	if (irq & SUNXI_CAN_INT_DATA_OR) {
 		if_statinc(ifp, if_ierrors);
+		sunxi_can_ifdown(sc);
 		sunxi_can_write(sc, SUNXI_CAN_CMD_REG, SUNXI_CAN_CMD_CLR_OR);
+		sunxi_can_ifup(sc);
 	}
 	if (irq & SUNXI_CAN_INT_ERR) {
 		reg = sunxi_can_read(sc, SUNXI_CAN_REC_REG);
@@ -383,23 +387,31 @@ sunxi_can_intr(void *arg)
 	while ((irq = sunxi_can_read(sc, SUNXI_CAN_INT_REG)) != 0) {
 		uint32_t sts = sunxi_can_read(sc, SUNXI_CAN_STA_REG);
 		rv = 1;
+rnd_add_uint32(>sc_rnd_source, irq);
 
-		if (irq & SUNXI_CAN_INT_TX_FLAG) {
-			sunxi_can_tx_intr(sc);
-		}
 		if ((irq & (SUNXI_CAN_INT_RX_FLAG | SUNXI_CAN_INT_DATA_OR)) ==
 		SUNXI_CAN_INT_RX_FLAG) {
 			while (sts & SUNXI_CAN_STA_RX_RDY) {
 sunxi_can_rx_intr(sc);
 sts = sunxi_can_read(sc, SUNXI_CAN_STA_REG);
 			}
+			/*
+			 * Don't write SUNXI_CAN_INT_RX_FLAG to the interrupt
+			 * register, this may clear the RX pending flag
+			 * while there is indeed a packet pending.
+			 * Reading packets should have cleared the RX interrupt,
+			 * so just restart the loop and re-read the interrupt
+			 * register. In the common case irq will now be 0.
+			 */
+			continue;
+		}
+		if (irq & SUNXI_CAN_INT_TX_FLAG) {
+			sunxi_can_tx_intr(sc);
 		}
 		if (irq & SUNXI_CAN_INT_ALLERRS) {
 			sunxi_can_err_intr(sc, irq, sts);
 		}
 		sunxi_can_write(sc, SUNXI_CAN_INT_REG, irq);
-rnd_add_uint32(>sc_rnd_source, irq);
-
 	}
 	mutex_exit(>sc_intr_lock);
 



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

2022-09-21 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Wed Sep 21 20:21:16 UTC 2022

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

Log Message:
Just skipping sunxi_can_rx_intr() if the DATA_OR flag is set isn't enough
to properly recover from overrrun in all case. So go the linux way and reset
the hardware.

Don't write SUNXI_CAN_INT_RX_FLAG to SUNXI_CAN_INT_REG, this could race
with hardware and clear the interrupt while there are new packets received.
SUNXI_CAN_INT_RX_FLAG clears automatically when all pending packets have been
read, so when no more packets are pending just read SUNXI_CAN_INT_REG again
and process other interrupts, if any (or RX if there are new packets pending).
With this change it seems I get overruns less often in my use case.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/arm/sunxi/sunxi_can.c

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



CVS commit: src/etc

2022-09-21 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Wed Sep 21 18:55:21 UTC 2022

Modified Files:
src/etc: MAKEDEV.tmpl

Log Message:
MAKEDEV: make nvmm node group-writable (was readable only; group nvmm)

Needed by qemu


To generate a diff of this commit:
cvs rdiff -u -r1.231 -r1.232 src/etc/MAKEDEV.tmpl

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



CVS commit: src/etc

2022-09-21 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Wed Sep 21 18:55:21 UTC 2022

Modified Files:
src/etc: MAKEDEV.tmpl

Log Message:
MAKEDEV: make nvmm node group-writable (was readable only; group nvmm)

Needed by qemu


To generate a diff of this commit:
cvs rdiff -u -r1.231 -r1.232 src/etc/MAKEDEV.tmpl

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

Modified files:

Index: src/etc/MAKEDEV.tmpl
diff -u src/etc/MAKEDEV.tmpl:1.231 src/etc/MAKEDEV.tmpl:1.232
--- src/etc/MAKEDEV.tmpl:1.231	Fri Aug 12 11:15:40 2022
+++ src/etc/MAKEDEV.tmpl	Wed Sep 21 18:55:21 2022
@@ -1,5 +1,5 @@
 #!/bin/sh -
-#	$NetBSD: MAKEDEV.tmpl,v 1.231 2022/08/12 11:15:40 riastradh Exp $
+#	$NetBSD: MAKEDEV.tmpl,v 1.232 2022/09/21 18:55:21 wiz Exp $
 #
 # Copyright (c) 2003,2007,2008 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -2227,7 +2227,7 @@ nvme[0-9]*)
 	;;
 
 nvmm)
-	mkdev nvmm c %nvmm_chr% 0 640 $g_nvmm
+	mkdev nvmm c %nvmm_chr% 0 660 $g_nvmm
 	;;
 
 autofs)



CVS commit: src

2022-09-21 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Sep 21 14:32:27 UTC 2022

Modified Files:
src: UPDATING

Log Message:
Note bootloader changes needed for 9.99.100.


To generate a diff of this commit:
cvs rdiff -u -r1.330 -r1.331 src/UPDATING

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



CVS commit: src

2022-09-21 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Sep 21 14:32:27 UTC 2022

Modified Files:
src: UPDATING

Log Message:
Note bootloader changes needed for 9.99.100.


To generate a diff of this commit:
cvs rdiff -u -r1.330 -r1.331 src/UPDATING

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

Modified files:

Index: src/UPDATING
diff -u src/UPDATING:1.330 src/UPDATING:1.331
--- src/UPDATING:1.330	Sun Aug 21 07:15:28 2022
+++ src/UPDATING	Wed Sep 21 14:32:26 2022
@@ -1,4 +1,4 @@
-$NetBSD: UPDATING,v 1.330 2022/08/21 07:15:28 lukem Exp $
+$NetBSD: UPDATING,v 1.331 2022/09/21 14:32:26 riastradh Exp $
 
 This file (UPDATING) is intended to be a brief reference to recent
 changes that might cause problems in the build process, and a guide for
@@ -19,6 +19,15 @@ See also: BUILDING, build.sh, Makefile.
 Recent changes:
 ^^^
 
+20220921:
+	Since the kernel version was bumped to 9.99.100, the bootloader
+	must be updated on x86 and efiboot platforms in order to load
+	modules.
+
+	The kernel can still load modules at runtime with no bootloader
+	update.  This will not affect release branches because it only
+	applies to patch numbers >100.
+
 20220821:
 	Support for building extsrc/ has been deprecated.
 	EXTSRCSRCDIR and MKEXTSRC have been deprecated.



CVS commit: src/sys/stand/efiboot

2022-09-21 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Sep 21 14:30:01 UTC 2022

Modified Files:
src/sys/stand/efiboot: module.c

Log Message:
efiboot: Handle 9.99.100 by taking four, not two, digits.

We haven't used the revision part of __NetBSD_Version__ = MMmmrrpp00
in almos two decades so we're apparently reclaiming it as MMmm00.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/stand/efiboot/module.c

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



CVS commit: src/sys/stand/efiboot

2022-09-21 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Sep 21 14:30:01 UTC 2022

Modified Files:
src/sys/stand/efiboot: module.c

Log Message:
efiboot: Handle 9.99.100 by taking four, not two, digits.

We haven't used the revision part of __NetBSD_Version__ = MMmmrrpp00
in almos two decades so we're apparently reclaiming it as MMmm00.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/stand/efiboot/module.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/stand/efiboot/module.c
diff -u src/sys/stand/efiboot/module.c:1.1 src/sys/stand/efiboot/module.c:1.2
--- src/sys/stand/efiboot/module.c:1.1	Sun Jun 21 17:24:26 2020
+++ src/sys/stand/efiboot/module.c	Wed Sep 21 14:30:01 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: module.c,v 1.1 2020/06/21 17:24:26 jmcneill Exp $ */
+/* $NetBSD: module.c,v 1.2 2022/09/21 14:30:01 riastradh Exp $ */
 
 /*-
  * Copyright (c) 2020 The NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@ module_set_prefix(const char *kernel_pat
 #else
 	const u_int vmajor = netbsd_version / 1;
 	const u_int vminor = netbsd_version / 100 % 100;
-	const u_int vpatch = netbsd_version / 100 % 100;
+	const u_int vpatch = netbsd_version / 100 % 1;
 
 	if (vminor == 99) {
 		snprintf(module_prefix, sizeof(module_prefix),



CVS commit: src/sys/arch/i386/stand/lib

2022-09-21 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Sep 21 14:29:45 UTC 2022

Modified Files:
src/sys/arch/i386/stand/lib: exec.c

Log Message:
i386/stand: Handle 9.99.100 by taking four, not two, digits.

We haven't used the revision part of __NetBSD_Version__ = MMmmrrpp00
in almos two decades so we're apparently reclaiming it as MMmm00.


To generate a diff of this commit:
cvs rdiff -u -r1.77 -r1.78 src/sys/arch/i386/stand/lib/exec.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/i386/stand/lib/exec.c
diff -u src/sys/arch/i386/stand/lib/exec.c:1.77 src/sys/arch/i386/stand/lib/exec.c:1.78
--- src/sys/arch/i386/stand/lib/exec.c:1.77	Sun May 30 05:59:23 2021
+++ src/sys/arch/i386/stand/lib/exec.c	Wed Sep 21 14:29:45 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: exec.c,v 1.77 2021/05/30 05:59:23 mlelstv Exp $	 */
+/*	$NetBSD: exec.c,v 1.78 2022/09/21 14:29:45 riastradh Exp $	 */
 
 /*
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -684,7 +684,7 @@ module_base_path(char *buf, size_t bufsi
 		"/stand/%s/%d.%d.%d/modules", machine,
 		netbsd_version / 1,
 		netbsd_version / 100 % 100,
-		netbsd_version / 100 % 100);
+		netbsd_version / 100 % 1);
 	} else if (netbsd_version != 0) {
 		/* release */
 		snprintf(buf, bufsize,



CVS commit: src/sys/arch/i386/stand/lib

2022-09-21 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Sep 21 14:29:45 UTC 2022

Modified Files:
src/sys/arch/i386/stand/lib: exec.c

Log Message:
i386/stand: Handle 9.99.100 by taking four, not two, digits.

We haven't used the revision part of __NetBSD_Version__ = MMmmrrpp00
in almos two decades so we're apparently reclaiming it as MMmm00.


To generate a diff of this commit:
cvs rdiff -u -r1.77 -r1.78 src/sys/arch/i386/stand/lib/exec.c

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



CVS commit: src/sys/miscfs/specfs

2022-09-21 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Sep 21 10:59:10 UTC 2022

Modified Files:
src/sys/miscfs/specfs: spec_vnops.c

Log Message:
specfs(9): XXX comment: what if read downgrades lock?


To generate a diff of this commit:
cvs rdiff -u -r1.214 -r1.215 src/sys/miscfs/specfs/spec_vnops.c

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



CVS commit: src/sys/miscfs/specfs

2022-09-21 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Sep 21 10:59:10 UTC 2022

Modified Files:
src/sys/miscfs/specfs: spec_vnops.c

Log Message:
specfs(9): XXX comment: what if read downgrades lock?


To generate a diff of this commit:
cvs rdiff -u -r1.214 -r1.215 src/sys/miscfs/specfs/spec_vnops.c

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

Modified files:

Index: src/sys/miscfs/specfs/spec_vnops.c
diff -u src/sys/miscfs/specfs/spec_vnops.c:1.214 src/sys/miscfs/specfs/spec_vnops.c:1.215
--- src/sys/miscfs/specfs/spec_vnops.c:1.214	Fri Aug 12 21:25:39 2022
+++ src/sys/miscfs/specfs/spec_vnops.c	Wed Sep 21 10:59:10 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: spec_vnops.c,v 1.214 2022/08/12 21:25:39 riastradh Exp $	*/
+/*	$NetBSD: spec_vnops.c,v 1.215 2022/09/21 10:59:10 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -58,7 +58,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: spec_vnops.c,v 1.214 2022/08/12 21:25:39 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: spec_vnops.c,v 1.215 2022/09/21 10:59:10 riastradh Exp $");
 
 #include 
 #include 
@@ -1100,7 +1100,8 @@ spec_read(void *v)
 			goto out;
 		error = cdev_read(dev, uio, ap->a_ioflag);
 		spec_io_exit(vp, sn);
-out:		vn_lock(vp, LK_SHARED | LK_RETRY);
+out:		/* XXX What if the caller held an exclusive lock?  */
+		vn_lock(vp, LK_SHARED | LK_RETRY);
 		return (error);
 
 	case VBLK:



CVS commit: src/doc

2022-09-21 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Wed Sep 21 10:51:14 UTC 2022

Modified Files:
src/doc: 3RDPARTY

Log Message:
expat-2.4.9 out, fixing a CVE


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

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



CVS commit: src/doc

2022-09-21 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Wed Sep 21 10:51:14 UTC 2022

Modified Files:
src/doc: 3RDPARTY

Log Message:
expat-2.4.9 out, fixing a CVE


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

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

Modified files:

Index: src/doc/3RDPARTY
diff -u src/doc/3RDPARTY:1.1874 src/doc/3RDPARTY:1.1875
--- src/doc/3RDPARTY:1.1874	Sat Sep 10 11:40:08 2022
+++ src/doc/3RDPARTY	Wed Sep 21 10:51:14 2022
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.1874 2022/09/10 11:40:08 wiz Exp $
+#	$NetBSD: 3RDPARTY,v 1.1875 2022/09/21 10:51:14 wiz Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -409,11 +409,11 @@ Notes:
 
 Package:	expat
 Version:	2.4.6
-Current Vers:	2.4.7
+Current Vers:	2.4.9
 Maintainer:	Expat Project
 Archive Site:	https://github.com/libexpat/libexpat/releases
 Home Page:	http://www.libexpat.org/
-Date:		2022-03-05
+Date:		2022-09-21
 Mailing List:	expat-disc...@libexpat.org
 Responsible:	mrg
 License:	MIT



CVS commit: src/sys/kern

2022-09-21 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Sep 21 10:50:29 UTC 2022

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

Log Message:
crashme(9): Fix crashme_add return value to match comment.

XXX Why do this and crashme_remove return -1 instead of an error code
like essentially everything else in the kernel?


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/kern/kern_crashme.c

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

Modified files:

Index: src/sys/kern/kern_crashme.c
diff -u src/sys/kern/kern_crashme.c:1.8 src/sys/kern/kern_crashme.c:1.9
--- src/sys/kern/kern_crashme.c:1.8	Wed Sep 21 10:50:11 2022
+++ src/sys/kern/kern_crashme.c	Wed Sep 21 10:50:29 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_crashme.c,v 1.8 2022/09/21 10:50:11 riastradh Exp $	*/
+/*	$NetBSD: kern_crashme.c,v 1.9 2022/09/21 10:50:29 riastradh Exp $	*/
 
 /*
  * Copyright (c) 2018, 2019 Matthew R. Green
@@ -134,7 +134,7 @@ crashme_add(crashme_node *ncn)
 	}
 	mutex_exit(_lock);
 
-	return rv;
+	return rv == 0 ? 0 : -1;
 }
 
 /*



CVS commit: src/sys/kern

2022-09-21 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Sep 21 10:50:29 UTC 2022

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

Log Message:
crashme(9): Fix crashme_add return value to match comment.

XXX Why do this and crashme_remove return -1 instead of an error code
like essentially everything else in the kernel?


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/kern/kern_crashme.c

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



CVS commit: src/sys

2022-09-21 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Sep 21 10:50:11 UTC 2022

Modified Files:
src/sys/kern: kern_crashme.c
src/sys/sys: crashme.h

Log Message:
crashme(9): Use sysctl mib numbers, not node pointers.

The node pointers are not stable across insertions of siblings,
because they are pointers into arrays that may be reallocated and
moved elsewhere.

XXX Need to audit the tree for other bugs of this class, or change
sysctl(9) so it returns stable node pointers.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/kern/kern_crashme.c
cvs rdiff -u -r1.1 -r1.2 src/sys/sys/crashme.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/kern/kern_crashme.c
diff -u src/sys/kern/kern_crashme.c:1.7 src/sys/kern/kern_crashme.c:1.8
--- src/sys/kern/kern_crashme.c:1.7	Tue Aug 30 22:38:26 2022
+++ src/sys/kern/kern_crashme.c	Wed Sep 21 10:50:11 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_crashme.c,v 1.7 2022/08/30 22:38:26 riastradh Exp $	*/
+/*	$NetBSD: kern_crashme.c,v 1.8 2022/09/21 10:50:11 riastradh Exp $	*/
 
 /*
  * Copyright (c) 2018, 2019 Matthew R. Green
@@ -91,7 +91,7 @@ static crashme_node nodes[] = {
 };
 static crashme_node *first_node;
 static kmutex_t crashme_lock;
-static const struct sysctlnode *crashme_root = NULL;
+static int crashme_root = -1;
 static bool crashme_enable = 0;
 
 /*
@@ -103,8 +103,9 @@ crashme_add(crashme_node *ncn)
 	int rv = -1;
 	crashme_node *cn;
 	crashme_node *last = NULL;
+	const struct sysctlnode *cnode;
 
-	if (crashme_root == NULL)
+	if (crashme_root == -1)
 		return -1;
 
 	mutex_enter(_lock);
@@ -115,17 +116,16 @@ crashme_add(crashme_node *ncn)
 	if (!cn) {
 		ncn->cn_next = NULL;
 
-		rv = sysctl_createv(NULL, 0,
-_root, >cn_sysctl,
-CTLFLAG_PERMANENT | CTLFLAG_READWRITE,
-CTLTYPE_INT, ncn->cn_name,
-SYSCTL_DESCR(ncn->cn_longname),
-crashme_sysctl_forwarder, 0,
-NULL, 0,
-CTL_CREATE, CTL_EOL);
+		rv = sysctl_createv(NULL, 0, NULL, ,
+		CTLFLAG_PERMANENT | CTLFLAG_READWRITE,
+		CTLTYPE_INT, ncn->cn_name,
+		SYSCTL_DESCR(ncn->cn_longname),
+		crashme_sysctl_forwarder, 0, NULL, 0,
+		CTL_DEBUG, crashme_root, CTL_CREATE, CTL_EOL);
 
 		/* don't insert upon failure */
 		if (rv == 0) {
+			ncn->cn_sysctl = cnode->sysctl_num;
 			if (last)
 last->cn_next = ncn;
 			if (first_node == NULL)
@@ -158,9 +158,9 @@ crashme_remove(crashme_node *rcn)
 			prev->cn_next = cn->cn_next;
 
 		if ((rv = sysctl_destroyv(NULL, CTL_DEBUG, crashme_root,
-	  cn->cn_name, CTL_EOL)) == 0)
+			cn->cn_sysctl, CTL_EOL)) == 0)
 			printf("%s: unable to remove %s from sysctl\n",
-			   __func__, cn->cn_name);
+			__func__, cn->cn_name);
 		break;
 	}
 	mutex_exit(_lock);
@@ -182,7 +182,7 @@ crashme_sysctl_forwarder(SYSCTLFN_ARGS)
 	int error, arg = 0;
 
 	for (cn = first_node; cn; cn = cn->cn_next) {
-		if (cn->cn_sysctl == rnode)
+		if (cn->cn_sysctl == rnode->sysctl_num)
 			break;
 	}
 	if (!cn) {
@@ -209,20 +209,27 @@ crashme_sysctl_forwarder(SYSCTLFN_ARGS)
  */
 SYSCTL_SETUP(selfdebug_crashme, "sysctl crashme setup")
 {
+	const struct sysctlnode *rnode;
 	int rv;
 	size_t n;
 
 	mutex_init(_lock, MUTEX_DEFAULT, IPL_NONE);
 
-	rv = sysctl_createv(NULL, 0, NULL, _root,
+	KASSERT(crashme_root == -1);
+
+	rv = sysctl_createv(NULL, 0, NULL, ,
 	CTLFLAG_PERMANENT,
 	CTLTYPE_NODE, "crashme",
 	SYSCTL_DESCR("Crashme options"),
 	NULL, 0, NULL, 0,
 	CTL_DEBUG, CTL_CREATE, CTL_EOL);
 
-	if (rv != 0 || crashme_root == NULL)
+	if (rv != 0) {
+		printf("%s: failed to create sysctl debug.crashme: %d\n",
+		__func__, rv);
 		return;
+	}
+	crashme_root = rnode->sysctl_num;
 
 	rv = sysctl_createv(NULL, 0, NULL, NULL,
 	CTLFLAG_PERMANENT|CTLFLAG_READWRITE,
@@ -230,15 +237,14 @@ SYSCTL_SETUP(selfdebug_crashme, "sysctl 
 	SYSCTL_DESCR("Enable crashme"),
 	NULL, 0, _enable, 0,
 	CTL_DEBUG, CTL_CREATE, CTL_EOL);
+	if (rv != 0)
+		printf("%s: failed to create sysctl debug.crashme_enable:"
+		" %d\n", __func__, rv);
 
 	for (n = 0; n < __arraycount(nodes); n++) {
-		crashme_node *cn = [n];
-
-		rv = crashme_add(cn);
-
-		/* don't insert */
-		if (rv != 0)
-			continue;
+		if (crashme_add([n]))
+			printf("%s: failed to create sysctl"
+			" debug.crashme.%s\n", __func__, nodes[n].cn_name);
 	}
 }
 

Index: src/sys/sys/crashme.h
diff -u src/sys/sys/crashme.h:1.1 src/sys/sys/crashme.h:1.2
--- src/sys/sys/crashme.h:1.1	Wed Jan  9 04:01:20 2019
+++ src/sys/sys/crashme.h	Wed Sep 21 10:50:11 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: crashme.h,v 1.1 2019/01/09 04:01:20 mrg Exp $	*/
+/*	$NetBSD: crashme.h,v 1.2 2022/09/21 10:50:11 riastradh Exp $	*/
 
 /*
  * Copyright (c) 2018, 2019 Matthew R. Green
@@ -47,7 +47,7 @@ typedef struct crashme_node {
 	const char		*cn_name;
 	const char		*cn_longname;
 	crashme_fn		 cn_fn;
-	const struct sysctlnode	

CVS commit: src/sys

2022-09-21 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Sep 21 10:50:11 UTC 2022

Modified Files:
src/sys/kern: kern_crashme.c
src/sys/sys: crashme.h

Log Message:
crashme(9): Use sysctl mib numbers, not node pointers.

The node pointers are not stable across insertions of siblings,
because they are pointers into arrays that may be reallocated and
moved elsewhere.

XXX Need to audit the tree for other bugs of this class, or change
sysctl(9) so it returns stable node pointers.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/kern/kern_crashme.c
cvs rdiff -u -r1.1 -r1.2 src/sys/sys/crashme.h

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



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

2022-09-21 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Sep 21 10:36:14 UTC 2022

Modified Files:
src/sys/arch/x86/pci: tco.c

Log Message:
tco(4): Fix whitespace.  No functional change intended.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/x86/pci/tco.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/pci/tco.c
diff -u src/sys/arch/x86/pci/tco.c:1.2 src/sys/arch/x86/pci/tco.c:1.3
--- src/sys/arch/x86/pci/tco.c:1.2	Sun Aug 30 07:50:34 2015
+++ src/sys/arch/x86/pci/tco.c	Wed Sep 21 10:36:14 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: tco.c,v 1.2 2015/08/30 07:50:34 christos Exp $	*/
+/*	$NetBSD: tco.c,v 1.3 2022/09/21 10:36:14 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2015 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: tco.c,v 1.2 2015/08/30 07:50:34 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tco.c,v 1.3 2022/09/21 10:36:14 riastradh Exp $");
 
 #include 
 #include 
@@ -53,7 +53,7 @@ __KERNEL_RCSID(0, "$NetBSD: tco.c,v 1.2 
 
 #include "pcibvar.h"
 
-struct tco_softc{
+struct tco_softc {
 	struct sysmon_wdog	sc_smw;
 	bus_space_tag_t		sc_iot;
 	bus_space_handle_t	sc_ioh;
@@ -125,7 +125,7 @@ tco_attach(device_t parent, device_t sel
 	ioreg = bus_space_read_4(sc->sc_iot, sc->sc_ioh, LPCIB_SMI_EN);
 	ioreg &= ~LPCIB_SMI_EN_TCO_EN;
 
-	/* 
+	/*
 	 * Clear the No Reboot (NR) bit. If this fails, enabling the TCO_EN bit
 	 * in the SMI_EN register is the last chance.
 	 */
@@ -139,7 +139,7 @@ tco_attach(device_t parent, device_t sel
 	/* Reset the watchdog status registers. */
 	tcotimer_status_reset(sc);
 
-	/* 
+	/*
 	 * Register the driver with the sysmon watchdog framework.
 	 */
 	sc->sc_smw.smw_name = device_xname(self);
@@ -147,7 +147,7 @@ tco_attach(device_t parent, device_t sel
 	sc->sc_smw.smw_setmode = tcotimer_setmode;
 	sc->sc_smw.smw_tickle = tcotimer_tickle;
 
-	/* 
+	/*
 	 * ICH6 or newer are limited to 2ticks min and 613ticks max.
 	 *  1sec   367secs
 	 *
@@ -225,7 +225,7 @@ tcotimer_setmode(struct sysmon_wdog *smw
 		period = lpcib_tcotimer_second_to_tick(smw->smw_period);
 		if (period < sc->sc_min_t || period > sc->sc_max_t)
 			return EINVAL;
-		
+
 		/* Stop the TCO timer, */
 		tcotimer_stop(sc);
 
@@ -233,17 +233,17 @@ tcotimer_setmode(struct sysmon_wdog *smw
 		if (sc->sc_has_rcba) {
 			/* ICH6 or newer */
 			ich6period = bus_space_read_2(sc->sc_iot, sc->sc_ioh,
-		  LPCIB_TCO_TMR2);
+			LPCIB_TCO_TMR2);
 			ich6period &= 0xfc00;
 			bus_space_write_2(sc->sc_iot, sc->sc_ioh,
-	  LPCIB_TCO_TMR2, ich6period | period);
+			LPCIB_TCO_TMR2, ich6period | period);
 		} else {
 			/* ICH5 or older */
 			ich5period = bus_space_read_1(sc->sc_iot, sc->sc_ioh,
-		   LPCIB_TCO_TMR);
+			LPCIB_TCO_TMR);
 			ich5period &= 0xc0;
 			bus_space_write_1(sc->sc_iot, sc->sc_ioh,
-	  LPCIB_TCO_TMR, ich5period | period);
+			LPCIB_TCO_TMR, ich5period | period);
 		}
 
 		/* and start/reload the timer. */
@@ -292,11 +292,11 @@ static void
 tcotimer_status_reset(struct tco_softc *sc)
 {
 	bus_space_write_2(sc->sc_iot, sc->sc_ioh, LPCIB_TCO1_STS,
-			  LPCIB_TCO1_STS_TIMEOUT);
+	LPCIB_TCO1_STS_TIMEOUT);
 	bus_space_write_2(sc->sc_iot, sc->sc_ioh, LPCIB_TCO2_STS,
-			  LPCIB_TCO2_STS_BOOT_STS);
+	LPCIB_TCO2_STS_BOOT_STS);
 	bus_space_write_2(sc->sc_iot, sc->sc_ioh, LPCIB_TCO2_STS,
-			  LPCIB_TCO2_STS_SECONDS_TO_STS);
+	LPCIB_TCO2_STS_SECONDS_TO_STS);
 }
 
 /*
@@ -324,12 +324,12 @@ tcotimer_disable_noreboot(device_t self)
 		pcireg_t pcireg;
 
 		pcireg = pci_conf_read(sc->sc_pcib->sc_pc, sc->sc_pcib->sc_tag,
-   LPCIB_PCI_GEN_STA);
+		LPCIB_PCI_GEN_STA);
 		if (pcireg & LPCIB_PCI_GEN_STA_NO_REBOOT) {
 			/* TCO timeout reset is disabled; try to enable it */
 			pcireg &= ~LPCIB_PCI_GEN_STA_NO_REBOOT;
 			pci_conf_write(sc->sc_pcib->sc_pc, sc->sc_pcib->sc_tag,
-   LPCIB_PCI_GEN_STA, pcireg);
+			LPCIB_PCI_GEN_STA, pcireg);
 			if (pcireg & LPCIB_PCI_GEN_STA_NO_REBOOT)
 goto error;
 		}
@@ -345,7 +345,7 @@ error:
 MODULE(MODULE_CLASS_DRIVER, tco, "sysmon_wdog");
 
 #ifdef _MODULE
-#include "ioconf.c" 
+#include "ioconf.c"
 #endif
 
 static int
@@ -357,15 +357,15 @@ tco_modcmd(modcmd_t cmd, void *arg)
 	case MODULE_CMD_INIT:
 #ifdef _MODULE
 		ret = config_init_component(cfdriver_ioconf_tco,
-	cfattach_ioconf_tco,
-	cfdata_ioconf_tco);
+		cfattach_ioconf_tco,
+		cfdata_ioconf_tco);
 #endif
 		break;
 	case MODULE_CMD_FINI:
 #ifdef _MODULE
 		ret = config_fini_component(cfdriver_ioconf_tco,
-	cfattach_ioconf_tco,
-	cfdata_ioconf_tco);
+		cfattach_ioconf_tco,
+		cfdata_ioconf_tco);
 #endif
 		break;
 	default:



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

2022-09-21 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Sep 21 10:36:14 UTC 2022

Modified Files:
src/sys/arch/x86/pci: tco.c

Log Message:
tco(4): Fix whitespace.  No functional change intended.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/x86/pci/tco.c

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



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

2022-09-21 Thread Nick Hudson

Hi,


On 21/09/2022 08:56, matthew green wrote:

this asserts for me.  perhaps ryo@ didn't have LOCKDEBUG?


I had LOCKDEBUG on, but not DEBUG. 
https://nxr.netbsd.org/xref/src/sys/sys/systm.h#760
I see that adding options DEBUG does indeed cause a panic with 
ASSERT_SLEEPABLE()...


ah!  that would explain it.  nick asked me to test switching
sc_mutex to IPL_SOFTCLOCK mutex, and this works, though it
exposed another bug in reboot that i also needed a fix for
(ifnet locked), see patch below with both fixes.

there's another with the rev 1.32 and rev 1.33+patch driver
when doing "ifconfig aq0 down up", i get this shortly after
and packets no longer flow:

aq0: watchdog timeout -- resetting
aq0: aq_handle_reset_work: INTR_MASK/STATUS = 0001/
aq0: aq_handle_reset_work: TXring[0] HEAD/TAIL=26/51
aq0: aq_handle_reset_work: TXring[1] HEAD/TAIL=153/170
aq0: aq_handle_reset_work: TXring[2] HEAD/TAIL=0/0
aq0: aq_handle_reset_work: TXring[3] HEAD/TAIL=0/0
aq0: aq_handle_reset_work: TXring[4] HEAD/TAIL=0/0
aq0: aq_handle_reset_work: TXring[5] HEAD/TAIL=0/0
aq0: aq_handle_reset_work: TXring[6] HEAD/TAIL=0/0
aq0: aq_handle_reset_work: TXring[7] HEAD/TAIL=0/0



I think this diff is slightly better and might even fix the problem
you're seeing with "ifconfig aq0 down up"

Nick
Index: sys/dev/pci/if_aq.c
===
RCS file: /cvsroot/src/sys/dev/pci/if_aq.c,v
retrieving revision 1.33
diff -u -p -r1.33 if_aq.c
--- sys/dev/pci/if_aq.c	16 Sep 2022 03:55:53 -	1.33
+++ sys/dev/pci/if_aq.c	21 Sep 2022 08:15:26 -
@@ -1278,7 +1278,7 @@ aq_attach(device_t parent, device_t self
 	int error;
 
 	sc->sc_dev = self;
-	mutex_init(>sc_mutex, MUTEX_DEFAULT, IPL_NET);
+	mutex_init(>sc_mutex, MUTEX_DEFAULT, IPL_SOFTCLOCK);
 	mutex_init(>sc_mpi_mutex, MUTEX_DEFAULT, IPL_NET);
 
 	sc->sc_pc = pc = pa->pa_pc;
@@ -1588,7 +1588,9 @@ aq_detach(device_t self, int flags __unu
 
 	if (sc->sc_iosize != 0) {
 		if (ifp->if_softc != NULL) {
-			aq_stop(ifp, 0);
+			IFNET_LOCK(ifp);
+			aq_stop(ifp, 1);
+			IFNET_UNLOCK(ifp);
 		}
 
 		for (i = 0; i < AQ_NINTR_MAX; i++) {
@@ -1616,8 +1618,6 @@ aq_detach(device_t self, int flags __unu
 		sc->sc_iosize = 0;
 	}
 
-	callout_stop(>sc_tick_ch);
-
 #if NSYSMON_ENVSYS > 0
 	if (sc->sc_sme != NULL) {
 		/* all sensors associated with this will also be detached */


CVS commit: src/usr.bin/netstat

2022-09-21 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Sep 21 07:59:19 UTC 2022

Modified Files:
src/usr.bin/netstat: if.c inet.c inet6.c

Log Message:
s/u_quad_t/uint64_t/. No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.104 -r1.105 src/usr.bin/netstat/if.c
cvs rdiff -u -r1.116 -r1.117 src/usr.bin/netstat/inet.c
cvs rdiff -u -r1.81 -r1.82 src/usr.bin/netstat/inet6.c

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

Modified files:

Index: src/usr.bin/netstat/if.c
diff -u src/usr.bin/netstat/if.c:1.104 src/usr.bin/netstat/if.c:1.105
--- src/usr.bin/netstat/if.c:1.104	Mon Sep 12 02:25:44 2022
+++ src/usr.bin/netstat/if.c	Wed Sep 21 07:59:19 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: if.c,v 1.104 2022/09/12 02:25:44 msaitoh Exp $	*/
+/*	$NetBSD: if.c,v 1.105 2022/09/21 07:59:19 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 1983, 1988, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "from: @(#)if.c	8.2 (Berkeley) 2/21/94";
 #else
-__RCSID("$NetBSD: if.c,v 1.104 2022/09/12 02:25:44 msaitoh Exp $");
+__RCSID("$NetBSD: if.c,v 1.105 2022/09/21 07:59:19 msaitoh Exp $");
 #endif
 #endif /* not lint */
 
@@ -73,15 +73,15 @@ __RCSID("$NetBSD: if.c,v 1.104 2022/09/1
 
 struct	iftot {
 	char ift_name[IFNAMSIZ];	/* interface name */
-	u_quad_t ift_ip;		/* input packets */
-	u_quad_t ift_ib;		/* input bytes */
-	u_quad_t ift_ie;		/* input errors */
-	u_quad_t ift_iq;		/* input drops */
-	u_quad_t ift_op;		/* output packets */
-	u_quad_t ift_ob;		/* output bytes */
-	u_quad_t ift_oe;		/* output errors */
-	u_quad_t ift_oq;		/* output drops */
-	u_quad_t ift_co;		/* collisions */
+	uint64_t ift_ip;		/* input packets */
+	uint64_t ift_ib;		/* input bytes */
+	uint64_t ift_ie;		/* input errors */
+	uint64_t ift_iq;		/* input drops */
+	uint64_t ift_op;		/* output packets */
+	uint64_t ift_ob;		/* output bytes */
+	uint64_t ift_oe;		/* output errors */
+	uint64_t ift_oq;		/* output drops */
+	uint64_t ift_co;		/* collisions */
 };
 
 struct if_data_ext {

Index: src/usr.bin/netstat/inet.c
diff -u src/usr.bin/netstat/inet.c:1.116 src/usr.bin/netstat/inet.c:1.117
--- src/usr.bin/netstat/inet.c:1.116	Fri Sep  2 06:25:43 2022
+++ src/usr.bin/netstat/inet.c	Wed Sep 21 07:59:19 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: inet.c,v 1.116 2022/09/02 06:25:43 msaitoh Exp $	*/
+/*	$NetBSD: inet.c,v 1.117 2022/09/21 07:59:19 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 1983, 1988, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "from: @(#)inet.c	8.4 (Berkeley) 4/20/94";
 #else
-__RCSID("$NetBSD: inet.c,v 1.116 2022/09/02 06:25:43 msaitoh Exp $");
+__RCSID("$NetBSD: inet.c,v 1.117 2022/09/21 07:59:19 msaitoh Exp $");
 #endif
 #endif /* not lint */
 
@@ -539,7 +539,7 @@ void
 udp_stats(u_long off, const char *name)
 {
 	uint64_t udpstat[UDP_NSTATS];
-	u_quad_t delivered;
+	uint64_t delivered;
 
 	if (use_sysctl) {
 		size_t size = sizeof(udpstat);

Index: src/usr.bin/netstat/inet6.c
diff -u src/usr.bin/netstat/inet6.c:1.81 src/usr.bin/netstat/inet6.c:1.82
--- src/usr.bin/netstat/inet6.c:1.81	Fri Sep  2 06:25:43 2022
+++ src/usr.bin/netstat/inet6.c	Wed Sep 21 07:59:19 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: inet6.c,v 1.81 2022/09/02 06:25:43 msaitoh Exp $	*/
+/*	$NetBSD: inet6.c,v 1.82 2022/09/21 07:59:19 msaitoh Exp $	*/
 /*	BSDI inet.c,v 2.3 1995/10/24 02:19:29 prb Exp	*/
 
 /*
@@ -64,7 +64,7 @@
 #if 0
 static char sccsid[] = "@(#)inet.c	8.4 (Berkeley) 4/20/94";
 #else
-__RCSID("$NetBSD: inet6.c,v 1.81 2022/09/02 06:25:43 msaitoh Exp $");
+__RCSID("$NetBSD: inet6.c,v 1.82 2022/09/21 07:59:19 msaitoh Exp $");
 #endif
 #endif /* not lint */
 
@@ -501,7 +501,7 @@ void
 udp6_stats(u_long off, const char *name)
 {
 	uint64_t udp6stat[UDP6_NSTATS];
-	u_quad_t delivered;
+	uint64_t delivered;
 
 	if (use_sysctl) {
 		size_t size = sizeof(udp6stat);
@@ -1349,7 +1349,7 @@ void
 rip6_stats(u_long off, const char *name)
 {
 	uint64_t rip6stat[RIP6_NSTATS];
-	u_quad_t delivered;
+	uint64_t delivered;
 
 	if (use_sysctl) {
 		size_t size = sizeof(rip6stat);



CVS commit: src/usr.bin/netstat

2022-09-21 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Sep 21 07:59:19 UTC 2022

Modified Files:
src/usr.bin/netstat: if.c inet.c inet6.c

Log Message:
s/u_quad_t/uint64_t/. No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.104 -r1.105 src/usr.bin/netstat/if.c
cvs rdiff -u -r1.116 -r1.117 src/usr.bin/netstat/inet.c
cvs rdiff -u -r1.81 -r1.82 src/usr.bin/netstat/inet6.c

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



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

2022-09-21 Thread matthew green
> >this asserts for me.  perhaps ryo@ didn't have LOCKDEBUG?
>
> I had LOCKDEBUG on, but not DEBUG. 
> https://nxr.netbsd.org/xref/src/sys/sys/systm.h#760
> I see that adding options DEBUG does indeed cause a panic with 
> ASSERT_SLEEPABLE()...

ah!  that would explain it.  nick asked me to test switching
sc_mutex to IPL_SOFTCLOCK mutex, and this works, though it
exposed another bug in reboot that i also needed a fix for
(ifnet locked), see patch below with both fixes.

there's another with the rev 1.32 and rev 1.33+patch driver
when doing "ifconfig aq0 down up", i get this shortly after
and packets no longer flow:

aq0: watchdog timeout -- resetting
aq0: aq_handle_reset_work: INTR_MASK/STATUS = 0001/
aq0: aq_handle_reset_work: TXring[0] HEAD/TAIL=26/51
aq0: aq_handle_reset_work: TXring[1] HEAD/TAIL=153/170
aq0: aq_handle_reset_work: TXring[2] HEAD/TAIL=0/0
aq0: aq_handle_reset_work: TXring[3] HEAD/TAIL=0/0
aq0: aq_handle_reset_work: TXring[4] HEAD/TAIL=0/0
aq0: aq_handle_reset_work: TXring[5] HEAD/TAIL=0/0
aq0: aq_handle_reset_work: TXring[6] HEAD/TAIL=0/0
aq0: aq_handle_reset_work: TXring[7] HEAD/TAIL=0/0


.mrg.


Index: if_aq.c
===
RCS file: /cvsroot/src/sys/dev/pci/if_aq.c,v
retrieving revision 1.33
diff -p -u -r1.33 if_aq.c
--- if_aq.c 16 Sep 2022 03:55:53 -  1.33
+++ if_aq.c 21 Sep 2022 07:52:59 -
@@ -1278,7 +1278,7 @@ aq_attach(device_t parent, device_t self
int error;
 
sc->sc_dev = self;
-   mutex_init(>sc_mutex, MUTEX_DEFAULT, IPL_NET);
+   mutex_init(>sc_mutex, MUTEX_DEFAULT, IPL_SOFTCLOCK);
mutex_init(>sc_mpi_mutex, MUTEX_DEFAULT, IPL_NET);
 
sc->sc_pc = pc = pa->pa_pc;
@@ -1588,7 +1588,9 @@ aq_detach(device_t self, int flags __unu
 
if (sc->sc_iosize != 0) {
if (ifp->if_softc != NULL) {
+   IFNET_LOCK(ifp);
aq_stop(ifp, 0);
+   IFNET_UNLOCK(ifp);
}
 
for (i = 0; i < AQ_NINTR_MAX; i++) {


CVS commit: src/sys/compat/common

2022-09-21 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Wed Sep 21 07:15:24 UTC 2022

Modified Files:
src/sys/compat/common: compat_50_quota.c

Log Message:
compat_50_quota: reject invalid quota id types.

Reported-by: syzbot+ce8391eb74a16e196...@syzkaller.appspotmail.com


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/compat/common/compat_50_quota.c

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

Modified files:

Index: src/sys/compat/common/compat_50_quota.c
diff -u src/sys/compat/common/compat_50_quota.c:1.3 src/sys/compat/common/compat_50_quota.c:1.4
--- src/sys/compat/common/compat_50_quota.c:1.3	Mon Mar  9 00:42:36 2020
+++ src/sys/compat/common/compat_50_quota.c	Wed Sep 21 07:15:24 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: compat_50_quota.c,v 1.3 2020/03/09 00:42:36 pgoyette Exp $ */
+/*	$NetBSD: compat_50_quota.c,v 1.4 2022/09/21 07:15:24 dholland Exp $ */
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: compat_50_quota.c,v 1.3 2020/03/09 00:42:36 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: compat_50_quota.c,v 1.4 2022/09/21 07:15:24 dholland Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_netbsd.h"
@@ -83,6 +83,9 @@ compat_50_sys_quotactl(struct lwp *l, co
 	mp = vp->v_mount;
 	q1cmd = SCARG(uap, cmd);
 	idtype = quota_idtype_from_ufs(q1cmd & SUBCMDMASK);
+	if (idtype == -1) {
+		return EINVAL;
+	}
 
 	switch ((q1cmd & ~SUBCMDMASK) >> SUBCMDSHIFT) {
 	case Q_QUOTAON:



CVS commit: src/sys/compat/common

2022-09-21 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Wed Sep 21 07:15:24 UTC 2022

Modified Files:
src/sys/compat/common: compat_50_quota.c

Log Message:
compat_50_quota: reject invalid quota id types.

Reported-by: syzbot+ce8391eb74a16e196...@syzkaller.appspotmail.com


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/compat/common/compat_50_quota.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/riscv/riscv

2022-09-21 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Sep 21 07:07:34 UTC 2022

Modified Files:
src/sys/arch/riscv/riscv: trap.c

Log Message:
Add some causes and convenience macros


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/riscv/riscv/trap.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/riscv/riscv/trap.c
diff -u src/sys/arch/riscv/riscv/trap.c:1.16 src/sys/arch/riscv/riscv/trap.c:1.17
--- src/sys/arch/riscv/riscv/trap.c:1.16	Thu Oct  7 07:13:35 2021
+++ src/sys/arch/riscv/riscv/trap.c	Wed Sep 21 07:07:34 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: trap.c,v 1.16 2021/10/07 07:13:35 skrll Exp $	*/
+/*	$NetBSD: trap.c,v 1.17 2022/09/21 07:07:34 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
 #define __PMAP_PRIVATE
 #define __UFETCHSTORE_PRIVATE
 
-__RCSID("$NetBSD: trap.c,v 1.16 2021/10/07 07:13:35 skrll Exp $");
+__RCSID("$NetBSD: trap.c,v 1.17 2022/09/21 07:07:34 skrll Exp $");
 
 #include 
 #include 
@@ -48,14 +48,28 @@ __RCSID("$NetBSD: trap.c,v 1.16 2021/10/
 
 #include 
 
+#define	MACHINE_ECALL_TRAP_MASK	(__BIT(CAUSE_MACHINE_ECALL))
+
+#define	SUPERVISOR_ECALL_TRAP_MASK	\
+(__BIT(CAUSE_SUPERVISOR_ECALL))
+
+#define	USER_ECALL_TRAP_MASK	(__BIT(CAUSE_USER_ECALL))
+
+#define	SYSCALL_TRAP_MASK	(__BIT(CAUSE_SYSCALL))
+
+#define	BREAKPOINT_TRAP_MASK	(__BIT(CAUSE_BREAKPOINT))
+
 #define	INSTRUCTION_TRAP_MASK	(__BIT(CAUSE_ILLEGAL_INSTRUCTION))
 
-#define	FAULT_TRAP_MASK		(__BIT(CAUSE_FETCH_ACCESS) \
-|__BIT(CAUSE_LOAD_ACCESS) \
-|__BIT(CAUSE_STORE_ACCESS))
+#define	FAULT_TRAP_MASK		(__BIT(CAUSE_FETCH_ACCESS) 		\
+|__BIT(CAUSE_LOAD_ACCESS) 		\
+|__BIT(CAUSE_STORE_ACCESS)		\
+|__BIT(CAUSE_FETCH_PAGE_FAULT) 		\
+|__BIT(CAUSE_LOAD_PAGE_FAULT) 		\
+|__BIT(CAUSE_STORE_PAGE_FAULT))
 
-#define	MISALIGNED_TRAP_MASK	(__BIT(CAUSE_FETCH_MISALIGNED) \
-|__BIT(CAUSE_LOAD_MISALIGNED) \
+#define	MISALIGNED_TRAP_MASK	(__BIT(CAUSE_FETCH_MISALIGNED)		\
+|__BIT(CAUSE_LOAD_MISALIGNED)		\
 |__BIT(CAUSE_STORE_MISALIGNED))
 
 static const char * const causenames[] = {
@@ -67,6 +81,10 @@ static const char * const causenames[] =
 	[CAUSE_STORE_ACCESS] = "store",
 	[CAUSE_ILLEGAL_INSTRUCTION] = "illegal instruction",
 	[CAUSE_BREAKPOINT] = "breakpoint",
+	[CAUSE_SYSCALL] = "syscall",
+	[CAUSE_FETCH_PAGE_FAULT] = "instruction page fault",
+	[CAUSE_LOAD_PAGE_FAULT] = "load page fault",
+	[CAUSE_STORE_PAGE_FAULT] = "store page fault",
 };
 
 void
@@ -219,11 +237,11 @@ cpu_trapsignal(struct trapframe *tf, ksi
 static inline vm_prot_t
 get_faulttype(register_t cause)
 {
-	if (cause == CAUSE_LOAD_ACCESS)
+	if (cause == CAUSE_LOAD_ACCESS || cause == CAUSE_LOAD_PAGE_FAULT)
 		return VM_PROT_READ;
-	if (cause == CAUSE_STORE_ACCESS)
+	if (cause == CAUSE_STORE_ACCESS || cause == CAUSE_STORE_PAGE_FAULT)
 		return VM_PROT_READ | VM_PROT_WRITE;
-	KASSERT(cause == CAUSE_FETCH_ACCESS);
+	KASSERT(cause == CAUSE_FETCH_ACCESS || cause == CAUSE_FETCH_PAGE_FAULT);
 	return VM_PROT_READ | VM_PROT_EXECUTE;
 }
 



CVS commit: src/sys/arch/riscv/riscv

2022-09-21 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Sep 21 07:07:34 UTC 2022

Modified Files:
src/sys/arch/riscv/riscv: trap.c

Log Message:
Add some causes and convenience macros


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/riscv/riscv/trap.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/riscv/include

2022-09-21 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Sep 21 06:34:30 UTC 2022

Modified Files:
src/sys/arch/riscv/include: pte.h

Log Message:
Use c99 types. NFC.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/riscv/include/pte.h

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

Modified files:

Index: src/sys/arch/riscv/include/pte.h
diff -u src/sys/arch/riscv/include/pte.h:1.6 src/sys/arch/riscv/include/pte.h:1.7
--- src/sys/arch/riscv/include/pte.h:1.6	Sat May  1 07:41:24 2021
+++ src/sys/arch/riscv/include/pte.h	Wed Sep 21 06:34:30 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: pte.h,v 1.6 2021/05/01 07:41:24 skrll Exp $ */
+/* $NetBSD: pte.h,v 1.7 2022/09/21 06:34:30 skrll Exp $ */
 
 /*
  * Copyright (c) 2014, 2019, 2021 The NetBSD Foundation, Inc.
@@ -38,15 +38,15 @@
 #define	PTE_PPN0	__BITS(18, 10)
 #define	PTE_PPN1	__BITS(27, 19)
 #define	PTE_PPN2	__BITS(53, 28)
-typedef __uint64_t pt_entry_t;
-typedef __uint64_t pd_entry_t;
+typedef uint64_t pt_entry_t;
+typedef uint64_t pd_entry_t;
 #define atomic_cas_pte	atomic_cas_64
 #else		/* Sv32 */
 #define PTE_PPN		__BITS(31, 10)
 #define	PTE_PPN0	__BITS(19, 10)
 #define	PTE_PPN1	__BITS(31, 20)
-typedef __uint32_t pt_entry_t;
-typedef __uint32_t pd_entry_t;
+typedef uint32_t pt_entry_t;
+typedef uint32_t pd_entry_t;
 #define atomic_cas_pte	atomic_cas_32
 #endif
 



CVS commit: src/sys/arch/riscv/include

2022-09-21 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Sep 21 06:34:30 UTC 2022

Modified Files:
src/sys/arch/riscv/include: pte.h

Log Message:
Use c99 types. NFC.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/riscv/include/pte.h

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