CVS commit: src/sbin/ifconfig

2023-12-05 Thread Shoichi YAMAGUCHI
Module Name:src
Committed By:   yamaguchi
Date:   Wed Dec  6 05:57:39 UTC 2023

Modified Files:
src/sbin/ifconfig: lagg.c

Log Message:
Fix "ifconfig lagg* lagglacp -maxports" command

This command clears the setting of the maximum number of
lacp active ports. The command was accepted but it did not
work until this change.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sbin/ifconfig/lagg.c

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

Modified files:

Index: src/sbin/ifconfig/lagg.c
diff -u src/sbin/ifconfig/lagg.c:1.3 src/sbin/ifconfig/lagg.c:1.4
--- src/sbin/ifconfig/lagg.c:1.3	Thu Mar 31 01:53:22 2022
+++ src/sbin/ifconfig/lagg.c	Wed Dec  6 05:57:39 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: lagg.c,v 1.3 2022/03/31 01:53:22 yamaguchi Exp $	*/
+/*	$NetBSD: lagg.c,v 1.4 2023/12/06 05:57:39 yamaguchi Exp $	*/
 
 /*
  * Copyright (c) 2021 Internet Initiative Japan Inc.
@@ -28,7 +28,7 @@
 
 #include 
 #if !defined(lint)
-__RCSID("$NetBSD: lagg.c,v 1.3 2022/03/31 01:53:22 yamaguchi Exp $");
+__RCSID("$NetBSD: lagg.c,v 1.4 2023/12/06 05:57:39 yamaguchi Exp $");
 #endif /* !defined(lint) */
 
 #include 
@@ -132,27 +132,35 @@ struct piface	 laggportpri_if = PIFACE_I
 
 static const struct kwinst	 lagglacpkw[] = {
 	  {.k_word = "dumpdu", .k_key = "lacpdumpdu",
-	   .k_type = KW_T_INT, .k_int = LAGGLACPOPT_DUMPDU}
+	   .k_type = KW_T_INT, .k_int = LAGGLACPOPT_DUMPDU,
+	   .k_exec = setlagglacp}
 	, {.k_word = "-dumpdu", .k_key = "lacpdumpdu",
-	   .k_type = KW_T_INT, .k_int = -LAGGLACPOPT_DUMPDU}
+	   .k_type = KW_T_INT, .k_int = -LAGGLACPOPT_DUMPDU,
+	   .k_exec = setlagglacp}
 	, {.k_word = "stopdu", .k_key = "lacpstopdu",
-	   .k_type = KW_T_INT, .k_int = LAGGLACPOPT_STOPDU}
+	   .k_type = KW_T_INT, .k_int = LAGGLACPOPT_STOPDU,
+	   .k_exec = setlagglacp}
 	, {.k_word = "-stopdu", .k_key = "lacpstopdu",
-	   .k_type = KW_T_INT, .k_int = -LAGGLACPOPT_STOPDU}
+	   .k_type = KW_T_INT, .k_int = -LAGGLACPOPT_STOPDU,
+	   .k_exec = setlagglacp}
 	, {.k_word = "optimistic", .k_key = "lacpoptimistic",
-	   .k_type = KW_T_INT, .k_int = LAGGLACPOPT_OPTIMISTIC}
+	   .k_type = KW_T_INT, .k_int = LAGGLACPOPT_OPTIMISTIC,
+	   .k_exec = setlagglacp}
 	, {.k_word = "-optimistic", .k_key = "lacpoptimistic",
-	   .k_type = KW_T_INT, .k_int = -LAGGLACPOPT_OPTIMISTIC}
+	   .k_type = KW_T_INT, .k_int = -LAGGLACPOPT_OPTIMISTIC,
+	   .k_exec = setlagglacp}
 	, {.k_word = "maxports", .k_nextparser = _parser}
 	, {.k_word = "-maxports", .k_key = "lacpmaxports",
-	   .k_type = KW_T_INT, .k_int = 0}
+	   .k_type = KW_T_INT, .k_int = 0, .k_exec = setlagglacpmaxports}
 	, {.k_word = "multi-linkspeed", .k_key = "lacpmultils",
-	   .k_type = KW_T_INT, .k_int = LAGGLACPOPT_MULTILS}
+	   .k_type = KW_T_INT, .k_int = LAGGLACPOPT_MULTILS,
+	   .k_exec = setlagglacp}
 	, {.k_word = "-multi-linkspeed", .k_key = "lacpmultils",
-	   .k_type = KW_T_INT, .k_int = -LAGGLACPOPT_MULTILS}
+	   .k_type = KW_T_INT, .k_int = -LAGGLACPOPT_MULTILS,
+	   .k_exec = setlagglacp}
 };
 struct pkw	 lagglacp = PKW_INITIALIZER(, "lagg-lacp-option",
-		setlagglacp, NULL, lagglacpkw, __arraycount(lagglacpkw),
+		NULL, NULL, lagglacpkw, __arraycount(lagglacpkw),
 		_root.pb_parser);
 
 static const struct kwinst	 laggfailkw[] = {



CVS commit: src/sbin/ifconfig

2023-12-05 Thread Shoichi YAMAGUCHI
Module Name:src
Committed By:   yamaguchi
Date:   Wed Dec  6 05:57:39 UTC 2023

Modified Files:
src/sbin/ifconfig: lagg.c

Log Message:
Fix "ifconfig lagg* lagglacp -maxports" command

This command clears the setting of the maximum number of
lacp active ports. The command was accepted but it did not
work until this change.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sbin/ifconfig/lagg.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/alpha/pci

2023-12-05 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Wed Dec  6 01:46:34 UTC 2023

Modified Files:
src/sys/arch/alpha/pci: pci_bwx_bus_io_chipdep.c
pci_bwx_bus_mem_chipdep.c pci_swiz_bus_io_chipdep.c

Log Message:
bus_space_alloc() -- vmem(9) requires an allocation stragegy flag, so
make sure to pass one.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/alpha/pci/pci_bwx_bus_io_chipdep.c
cvs rdiff -u -r1.29 -r1.30 src/sys/arch/alpha/pci/pci_bwx_bus_mem_chipdep.c
cvs rdiff -u -r1.44 -r1.45 src/sys/arch/alpha/pci/pci_swiz_bus_io_chipdep.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/alpha/pci/pci_bwx_bus_io_chipdep.c
diff -u src/sys/arch/alpha/pci/pci_bwx_bus_io_chipdep.c:1.23 src/sys/arch/alpha/pci/pci_bwx_bus_io_chipdep.c:1.24
--- src/sys/arch/alpha/pci/pci_bwx_bus_io_chipdep.c:1.23	Mon Dec  4 00:32:10 2023
+++ src/sys/arch/alpha/pci/pci_bwx_bus_io_chipdep.c	Wed Dec  6 01:46:34 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: pci_bwx_bus_io_chipdep.c,v 1.23 2023/12/04 00:32:10 thorpej Exp $ */
+/* $NetBSD: pci_bwx_bus_io_chipdep.c,v 1.24 2023/12/06 01:46:34 thorpej Exp $ */
 
 /*-
  * Copyright (c) 1997, 1998, 2000 The NetBSD Foundation, Inc.
@@ -81,7 +81,7 @@
  */
 
 #include 
-__KERNEL_RCSID(1, "$NetBSD: pci_bwx_bus_io_chipdep.c,v 1.23 2023/12/04 00:32:10 thorpej Exp $");
+__KERNEL_RCSID(1, "$NetBSD: pci_bwx_bus_io_chipdep.c,v 1.24 2023/12/06 01:46:34 thorpej Exp $");
 
 #include 
 
@@ -486,7 +486,7 @@ __C(CHIP,_io_alloc)(
 			boundary,		/* nocross */
 			rstart,		/* minaddr */
 			rend,		/* maxaddr */
-			VM_NOSLEEP,
+			VM_BESTFIT | VM_NOSLEEP,
 			);
 	if (error) {
 #ifdef EXTENT_DEBUG

Index: src/sys/arch/alpha/pci/pci_bwx_bus_mem_chipdep.c
diff -u src/sys/arch/alpha/pci/pci_bwx_bus_mem_chipdep.c:1.29 src/sys/arch/alpha/pci/pci_bwx_bus_mem_chipdep.c:1.30
--- src/sys/arch/alpha/pci/pci_bwx_bus_mem_chipdep.c:1.29	Mon Dec  4 00:32:10 2023
+++ src/sys/arch/alpha/pci/pci_bwx_bus_mem_chipdep.c	Wed Dec  6 01:46:34 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: pci_bwx_bus_mem_chipdep.c,v 1.29 2023/12/04 00:32:10 thorpej Exp $ */
+/* $NetBSD: pci_bwx_bus_mem_chipdep.c,v 1.30 2023/12/06 01:46:34 thorpej Exp $ */
 
 /*-
  * Copyright (c) 1997, 1998, 2000 The NetBSD Foundation, Inc.
@@ -81,7 +81,7 @@
  */
 
 #include 
-__KERNEL_RCSID(1, "$NetBSD: pci_bwx_bus_mem_chipdep.c,v 1.29 2023/12/04 00:32:10 thorpej Exp $");
+__KERNEL_RCSID(1, "$NetBSD: pci_bwx_bus_mem_chipdep.c,v 1.30 2023/12/06 01:46:34 thorpej Exp $");
 
 #include 
 
@@ -467,7 +467,7 @@ __C(CHIP,_mem_alloc)(
 			boundary,		/* nocross */
 			rstart,		/* minaddr */
 			rend,		/* maxaddr */
-			VM_NOSLEEP,
+			VM_BESTFIT | VM_NOSLEEP,
 			);
 	if (error) {
 #ifdef EXTENT_DEBUG

Index: src/sys/arch/alpha/pci/pci_swiz_bus_io_chipdep.c
diff -u src/sys/arch/alpha/pci/pci_swiz_bus_io_chipdep.c:1.44 src/sys/arch/alpha/pci/pci_swiz_bus_io_chipdep.c:1.45
--- src/sys/arch/alpha/pci/pci_swiz_bus_io_chipdep.c:1.44	Mon Dec  4 00:32:10 2023
+++ src/sys/arch/alpha/pci/pci_swiz_bus_io_chipdep.c	Wed Dec  6 01:46:34 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: pci_swiz_bus_io_chipdep.c,v 1.44 2023/12/04 00:32:10 thorpej Exp $ */
+/* $NetBSD: pci_swiz_bus_io_chipdep.c,v 1.45 2023/12/06 01:46:34 thorpej Exp $ */
 
 /*-
  * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@@ -81,7 +81,7 @@
  */
 
 #include 
-__KERNEL_RCSID(1, "$NetBSD: pci_swiz_bus_io_chipdep.c,v 1.44 2023/12/04 00:32:10 thorpej Exp $");
+__KERNEL_RCSID(1, "$NetBSD: pci_swiz_bus_io_chipdep.c,v 1.45 2023/12/06 01:46:34 thorpej Exp $");
 
 #include 
 
@@ -573,7 +573,7 @@ __C(CHIP,_io_alloc)(void *v, bus_addr_t 
 			boundary,		/* nocross */
 			rstart,		/* minaddr */
 			rend,		/* maxaddr */
-			VM_NOSLEEP,
+			VM_BESTFIT | VM_NOSLEEP,
 			);
 	if (error) {
 #ifdef EXTENT_DEBUG



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

2023-12-05 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Wed Dec  6 01:46:34 UTC 2023

Modified Files:
src/sys/arch/alpha/pci: pci_bwx_bus_io_chipdep.c
pci_bwx_bus_mem_chipdep.c pci_swiz_bus_io_chipdep.c

Log Message:
bus_space_alloc() -- vmem(9) requires an allocation stragegy flag, so
make sure to pass one.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/alpha/pci/pci_bwx_bus_io_chipdep.c
cvs rdiff -u -r1.29 -r1.30 src/sys/arch/alpha/pci/pci_bwx_bus_mem_chipdep.c
cvs rdiff -u -r1.44 -r1.45 src/sys/arch/alpha/pci/pci_swiz_bus_io_chipdep.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/x68k/dev

2023-12-05 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Tue Dec  5 22:24:40 UTC 2023

Modified Files:
src/sys/arch/x68k/dev: mha.c

Log Message:
s/pregress/progress/ in panic message.


To generate a diff of this commit:
cvs rdiff -u -r1.58 -r1.59 src/sys/arch/x68k/dev/mha.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/x68k/dev/mha.c
diff -u src/sys/arch/x68k/dev/mha.c:1.58 src/sys/arch/x68k/dev/mha.c:1.59
--- src/sys/arch/x68k/dev/mha.c:1.58	Thu May 26 14:33:29 2022
+++ src/sys/arch/x68k/dev/mha.c	Tue Dec  5 22:24:40 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: mha.c,v 1.58 2022/05/26 14:33:29 tsutsui Exp $	*/
+/*	$NetBSD: mha.c,v 1.59 2023/12/05 22:24:40 andvar Exp $	*/
 
 /*-
  * Copyright (c) 1996-1999 The NetBSD Foundation, Inc.
@@ -59,7 +59,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: mha.c,v 1.58 2022/05/26 14:33:29 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mha.c,v 1.59 2023/12/05 22:24:40 andvar Exp $");
 
 #include "opt_ddb.h"
 
@@ -1566,7 +1566,7 @@ mha_dataio_dma(int dw, int cw, struct mh
 	if (n > MAXBSIZE)
 		panic("transfer size exceeds MAXBSIZE");
 	if (sc->sc_dmasize > 0)
-		panic("DMA request while another DMA transfer is in pregress");
+		panic("DMA request while another DMA transfer is in progress");
 
 	if (cw == CMD_SEND_FROM_DMA) {
 		memcpy(sc->sc_dmabuf, p, n);



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

2023-12-05 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Tue Dec  5 22:24:40 UTC 2023

Modified Files:
src/sys/arch/x68k/dev: mha.c

Log Message:
s/pregress/progress/ in panic message.


To generate a diff of this commit:
cvs rdiff -u -r1.58 -r1.59 src/sys/arch/x68k/dev/mha.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/sgimips/hpc

2023-12-05 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Tue Dec  5 21:54:53 UTC 2023

Modified Files:
src/sys/arch/sgimips/hpc: if_sq.c

Log Message:
add explicit braces around SQ_DPRINTF() to fix dangling else compiler error.

fixes build with SQ_DEBUG option enabled for sgimips.


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 src/sys/arch/sgimips/hpc/if_sq.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/sgimips/hpc/if_sq.c
diff -u src/sys/arch/sgimips/hpc/if_sq.c:1.55 src/sys/arch/sgimips/hpc/if_sq.c:1.56
--- src/sys/arch/sgimips/hpc/if_sq.c:1.55	Sun Sep 18 13:23:53 2022
+++ src/sys/arch/sgimips/hpc/if_sq.c	Tue Dec  5 21:54:53 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_sq.c,v 1.55 2022/09/18 13:23:53 thorpej Exp $	*/
+/*	$NetBSD: if_sq.c,v 1.56 2023/12/05 21:54:53 andvar Exp $	*/
 
 /*
  * Copyright (c) 2001 Rafal K. Boni
@@ -33,7 +33,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_sq.c,v 1.55 2022/09/18 13:23:53 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_sq.c,v 1.56 2023/12/05 21:54:53 andvar Exp $");
 
 
 #include 
@@ -896,10 +896,10 @@ sq_intr(void *arg)
 
 	stat = sq_hpc_read(sc, sc->hpc_regs->enetr_reset);
 
-	if ((stat & 2) == 0)
+	if ((stat & 2) == 0) {
 		SQ_DPRINTF(("%s: Unexpected interrupt!\n",
 		device_xname(sc->sc_dev)));
-	else
+	} else
 		sq_hpc_write(sc, sc->hpc_regs->enetr_reset, (stat | 2));
 
 	/*



CVS commit: src/sys/arch/sgimips/hpc

2023-12-05 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Tue Dec  5 21:54:53 UTC 2023

Modified Files:
src/sys/arch/sgimips/hpc: if_sq.c

Log Message:
add explicit braces around SQ_DPRINTF() to fix dangling else compiler error.

fixes build with SQ_DEBUG option enabled for sgimips.


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 src/sys/arch/sgimips/hpc/if_sq.c

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



CVS commit: src/share/misc

2023-12-05 Thread Jan Schaumann
Module Name:src
Committed By:   jschauma
Date:   Tue Dec  5 19:28:40 UTC 2023

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

Log Message:
add some virtual networking terms

+FRRFree Range Routing
+VNIvirtual network identifier
+VTEP   VXLAN tunnel endpoint
+VXLAN  virtual extensible LAN


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

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

Modified files:

Index: src/share/misc/acronyms.comp
diff -u src/share/misc/acronyms.comp:1.381 src/share/misc/acronyms.comp:1.382
--- src/share/misc/acronyms.comp:1.381	Fri Nov 24 21:17:49 2023
+++ src/share/misc/acronyms.comp	Tue Dec  5 19:28:40 2023
@@ -1,4 +1,4 @@
-$NetBSD: acronyms.comp,v 1.381 2023/11/24 21:17:49 alnsn Exp $
+$NetBSD: acronyms.comp,v 1.382 2023/12/05 19:28:40 jschauma Exp $
 3WHS	three-way handshake
 8VSB	8-state vestigial side band modulation
 AA	anti-aliasing
@@ -637,6 +637,7 @@ FPR	floating point register
 FPU	floating point unit
 FQDN	fully qualified domain name
 FRR	false rejection rate
+FRR	Free Range Routing
 FRU	field replaceable unit
 FS	file system
 FSB	front side bus
@@ -1851,6 +1852,7 @@ VME	virtual mode extension
 VMX	vector multimedia extensions
 VMX	virtual machine extensions
 VNC	virtual network computing
+VNI	virtual network identifier
 VOD	video on demand
 VPD	vital product data
 VPN	virtual private network
@@ -1862,8 +1864,10 @@ VRM	voltage regulator module
 VROC	Virtual RAID On CPU
 VRRP	Virtual Router Redundancy Protocol
 VSTP	VLAN Spanning Tree Protocol
+VTEP	VXLAN tunnel endpoint
 VTP	VLAN Trunking Protocol
 VXFS	Veritas file system
+VXLAN	virtual extensible LAN
 VXVM	Veritas volume manager
 W	watt
 W3C	World Wide Web Consortium



CVS commit: src/share/misc

2023-12-05 Thread Jan Schaumann
Module Name:src
Committed By:   jschauma
Date:   Tue Dec  5 19:28:40 UTC 2023

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

Log Message:
add some virtual networking terms

+FRRFree Range Routing
+VNIvirtual network identifier
+VTEP   VXLAN tunnel endpoint
+VXLAN  virtual extensible LAN


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

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



CVS commit: src/sys/arch/sbmips/sbmips

2023-12-05 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Tue Dec  5 19:19:26 UTC 2023

Modified Files:
src/sys/arch/sbmips/sbmips: cpu.c machdep.c sb1250_icu.c

Log Message:
use kcpuset_isset() and pass second (NULL) argument to mips_fixup_exceptions()
to fix build for GENERIC(64).MP kernel configs.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/sbmips/sbmips/cpu.c
cvs rdiff -u -r1.55 -r1.56 src/sys/arch/sbmips/sbmips/machdep.c
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/sbmips/sbmips/sb1250_icu.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/sbmips/sbmips/cpu.c
diff -u src/sys/arch/sbmips/sbmips/cpu.c:1.23 src/sys/arch/sbmips/sbmips/cpu.c:1.24
--- src/sys/arch/sbmips/sbmips/cpu.c:1.23	Thu Jul 21 17:02:15 2016
+++ src/sys/arch/sbmips/sbmips/cpu.c	Tue Dec  5 19:19:26 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu.c,v 1.23 2016/07/21 17:02:15 christos Exp $ */
+/* $NetBSD: cpu.c,v 1.24 2023/12/05 19:19:26 andvar Exp $ */
 
 /*
  * Copyright 2000, 2001
@@ -33,7 +33,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.23 2016/07/21 17:02:15 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.24 2023/12/05 19:19:26 andvar Exp $");
 
 #include "opt_multiprocessor.h"
 
@@ -150,13 +150,12 @@ cpu_attach(device_t parent, device_t sel
 			aprint_error(": CFE call to start failed: %d\n",
 			status);
 		}
-		const u_long cpu_mask = 1L << cpu_index(ci);
 		for (size_t i = 0; i < 1; i++) {
-			if (cpus_hatched & cpu_mask)
+			if (kcpuset_isset(cpus_hatched, cpu_index(ci)))
  break;
 			DELAY(100);
 		}
-		if ((cpus_hatched & cpu_mask) == 0) {
+		if (!kcpuset_isset(cpus_hatched, cpu_index(ci))) {
 			aprint_error(": failed to hatch!\n");
 			return;
 		}

Index: src/sys/arch/sbmips/sbmips/machdep.c
diff -u src/sys/arch/sbmips/sbmips/machdep.c:1.55 src/sys/arch/sbmips/sbmips/machdep.c:1.56
--- src/sys/arch/sbmips/sbmips/machdep.c:1.55	Mon Nov  6 03:47:48 2017
+++ src/sys/arch/sbmips/sbmips/machdep.c	Tue Dec  5 19:19:26 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.55 2017/11/06 03:47:48 christos Exp $ */
+/* $NetBSD: machdep.c,v 1.56 2023/12/05 19:19:26 andvar Exp $ */
 
 /*
  * Copyright 2000, 2001
@@ -58,7 +58,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.55 2017/11/06 03:47:48 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.56 2023/12/05 19:19:26 andvar Exp $");
 
 #include "opt_ddb.h"
 #include "opt_execfmt.h"
@@ -319,7 +319,7 @@ mach_init(long fwhandle, long magic, lon
 	}
 
 #ifdef MULTIPROCESSOR
-	mips_fixup_exceptions(mips_fixup_zero_relative);
+	mips_fixup_exceptions(mips_fixup_zero_relative, NULL);
 #endif
 }
 

Index: src/sys/arch/sbmips/sbmips/sb1250_icu.c
diff -u src/sys/arch/sbmips/sbmips/sb1250_icu.c:1.14 src/sys/arch/sbmips/sbmips/sb1250_icu.c:1.15
--- src/sys/arch/sbmips/sbmips/sb1250_icu.c:1.14	Thu Jul 21 17:02:15 2016
+++ src/sys/arch/sbmips/sbmips/sb1250_icu.c	Tue Dec  5 19:19:26 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: sb1250_icu.c,v 1.14 2016/07/21 17:02:15 christos Exp $ */
+/* $NetBSD: sb1250_icu.c,v 1.15 2023/12/05 19:19:26 andvar Exp $ */
 
 /*
  * Copyright 2000, 2001
@@ -33,7 +33,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sb1250_icu.c,v 1.14 2016/07/21 17:02:15 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sb1250_icu.c,v 1.15 2023/12/05 19:19:26 andvar Exp $");
 
 #define	__INTR_PRIVATE
 
@@ -179,7 +179,7 @@ sb1250_lsw_send_ipi(struct cpu_info *ci,
 	struct cpu_softc * const cpu = ci->ci_softc;
 	const uint64_t mbox_mask = 1LLU << tag;
 
-	if (cpus_running & (1 << cpu_index(ci)))
+	if (kcpuset_isset(cpus_running, cpu_index(ci)))
 		WRITE_REG(cpu->sb1cpu_imr_base + R_IMR_MAILBOX_SET_CPU, mbox_mask);
 
 	return 0;



CVS commit: src/sys/arch/sbmips/sbmips

2023-12-05 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Tue Dec  5 19:19:26 UTC 2023

Modified Files:
src/sys/arch/sbmips/sbmips: cpu.c machdep.c sb1250_icu.c

Log Message:
use kcpuset_isset() and pass second (NULL) argument to mips_fixup_exceptions()
to fix build for GENERIC(64).MP kernel configs.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/sbmips/sbmips/cpu.c
cvs rdiff -u -r1.55 -r1.56 src/sys/arch/sbmips/sbmips/machdep.c
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/sbmips/sbmips/sb1250_icu.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/evbmips/sbmips

2023-12-05 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Tue Dec  5 19:16:49 UTC 2023

Modified Files:
src/sys/arch/evbmips/sbmips: cpu.c machdep.c sb1250_icu.c

Log Message:
use kcpuset_isset() and pass second (NULL) argument to mips_fixup_exceptions()
to fix build for SBMIPS(64).MP kernel configs.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/evbmips/sbmips/cpu.c \
src/sys/arch/evbmips/sbmips/sb1250_icu.c
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/evbmips/sbmips/machdep.c

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

Modified files:

Index: src/sys/arch/evbmips/sbmips/cpu.c
diff -u src/sys/arch/evbmips/sbmips/cpu.c:1.3 src/sys/arch/evbmips/sbmips/cpu.c:1.4
--- src/sys/arch/evbmips/sbmips/cpu.c:1.3	Wed Aug  2 12:23:43 2017
+++ src/sys/arch/evbmips/sbmips/cpu.c	Tue Dec  5 19:16:48 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu.c,v 1.3 2017/08/02 12:23:43 simonb Exp $ */
+/* $NetBSD: cpu.c,v 1.4 2023/12/05 19:16:48 andvar Exp $ */
 
 /*
  * Copyright 2000, 2001
@@ -33,7 +33,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.3 2017/08/02 12:23:43 simonb Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.4 2023/12/05 19:16:48 andvar Exp $");
 
 #include "opt_multiprocessor.h"
 
@@ -151,13 +151,12 @@ cpu_attach(device_t parent, device_t sel
 			aprint_error(": CFE call to start failed: %d\n",
 			status);
 		}
-		const u_long cpu_mask = 1L << cpu_index(ci);
 		for (size_t i = 0; i < 1; i++) {
-			if (cpus_hatched & cpu_mask)
+			if (kcpuset_isset(cpus_hatched, cpu_index(ci)))
  break;
 			DELAY(100);
 		}
-		if ((cpus_hatched & cpu_mask) == 0) {
+		if (!kcpuset_isset(cpus_hatched, cpu_index(ci))) {
 			aprint_error(": failed to hatch!\n");
 			return;
 		}
Index: src/sys/arch/evbmips/sbmips/sb1250_icu.c
diff -u src/sys/arch/evbmips/sbmips/sb1250_icu.c:1.3 src/sys/arch/evbmips/sbmips/sb1250_icu.c:1.4
--- src/sys/arch/evbmips/sbmips/sb1250_icu.c:1.3	Thu Apr 11 01:53:41 2019
+++ src/sys/arch/evbmips/sbmips/sb1250_icu.c	Tue Dec  5 19:16:48 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: sb1250_icu.c,v 1.3 2019/04/11 01:53:41 simonb Exp $ */
+/* $NetBSD: sb1250_icu.c,v 1.4 2023/12/05 19:16:48 andvar Exp $ */
 
 /*
  * Copyright 2000, 2001
@@ -33,7 +33,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sb1250_icu.c,v 1.3 2019/04/11 01:53:41 simonb Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sb1250_icu.c,v 1.4 2023/12/05 19:16:48 andvar Exp $");
 
 #define	__INTR_PRIVATE
 
@@ -179,7 +179,7 @@ sb1250_lsw_send_ipi(struct cpu_info *ci,
 	struct cpu_softc * const cpu = ci->ci_softc;
 	const uint64_t mbox_mask = 1LLU << tag;
 
-	if (cpus_running & (1 << cpu_index(ci)))
+	if (kcpuset_isset(cpus_running, cpu_index(ci)))
 		WRITE_REG(cpu->sb1cpu_imr_base + R_IMR_MAILBOX_SET_CPU, mbox_mask);
 
 	return 0;

Index: src/sys/arch/evbmips/sbmips/machdep.c
diff -u src/sys/arch/evbmips/sbmips/machdep.c:1.5 src/sys/arch/evbmips/sbmips/machdep.c:1.6
--- src/sys/arch/evbmips/sbmips/machdep.c:1.5	Mon Apr  1 06:33:57 2019
+++ src/sys/arch/evbmips/sbmips/machdep.c	Tue Dec  5 19:16:48 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.5 2019/04/01 06:33:57 simonb Exp $ */
+/* $NetBSD: machdep.c,v 1.6 2023/12/05 19:16:48 andvar Exp $ */
 
 /*
  * Copyright 2000, 2001
@@ -58,7 +58,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.5 2019/04/01 06:33:57 simonb Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.6 2023/12/05 19:16:48 andvar Exp $");
 
 #include "opt_ddb.h"
 #include "opt_execfmt.h"
@@ -334,7 +334,7 @@ mach_init(long fwhandle, long magic, lon
 	}
 
 #ifdef MULTIPROCESSOR
-	mips_fixup_exceptions(mips_fixup_zero_relative);
+	mips_fixup_exceptions(mips_fixup_zero_relative, NULL);
 #endif
 }
 



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

2023-12-05 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Tue Dec  5 19:16:49 UTC 2023

Modified Files:
src/sys/arch/evbmips/sbmips: cpu.c machdep.c sb1250_icu.c

Log Message:
use kcpuset_isset() and pass second (NULL) argument to mips_fixup_exceptions()
to fix build for SBMIPS(64).MP kernel configs.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/evbmips/sbmips/cpu.c \
src/sys/arch/evbmips/sbmips/sb1250_icu.c
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/evbmips/sbmips/machdep.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/mips/mips

2023-12-05 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Tue Dec  5 17:38:40 UTC 2023

Modified Files:
src/sys/arch/mips/mips: lock_stubs_llsc.S

Log Message:
Add missing PTR_WORD command in front of 0.

Likely accidentally missed in the commit, since rev 1.9.

In theory needs pull-ups for netbsd-9, -10, but nobody noticed for 4 years...


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/mips/mips/lock_stubs_llsc.S

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

Modified files:

Index: src/sys/arch/mips/mips/lock_stubs_llsc.S
diff -u src/sys/arch/mips/mips/lock_stubs_llsc.S:1.17 src/sys/arch/mips/mips/lock_stubs_llsc.S:1.18
--- src/sys/arch/mips/mips/lock_stubs_llsc.S:1.17	Sun Feb 27 19:22:29 2022
+++ src/sys/arch/mips/mips/lock_stubs_llsc.S	Tue Dec  5 17:38:40 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: lock_stubs_llsc.S,v 1.17 2022/02/27 19:22:29 riastradh Exp $	*/
+/*	$NetBSD: lock_stubs_llsc.S,v 1.18 2023/12/05 17:38:40 andvar Exp $	*/
 
 /*-
  * Copyright (c) 2007 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
 
 #include 
 
-RCSID("$NetBSD: lock_stubs_llsc.S,v 1.17 2022/02/27 19:22:29 riastradh Exp $")
+RCSID("$NetBSD: lock_stubs_llsc.S,v 1.18 2023/12/05 17:38:40 andvar Exp $")
 
 #include "assym.h"
 
@@ -362,7 +362,7 @@ EXPORT_OBJECT(mips_llsc_locore_atomicvec
 #ifdef _LP64
 	PTR_WORD	llsc_ucas_64
 #else
-			0
+	PTR_WORD	0
 #endif /* _LP64 */
 #ifdef LOCKDEBUG
 	PTR_WORD	mutex_vector_enter



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

2023-12-05 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Tue Dec  5 17:38:40 UTC 2023

Modified Files:
src/sys/arch/mips/mips: lock_stubs_llsc.S

Log Message:
Add missing PTR_WORD command in front of 0.

Likely accidentally missed in the commit, since rev 1.9.

In theory needs pull-ups for netbsd-9, -10, but nobody noticed for 4 years...


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/mips/mips/lock_stubs_llsc.S

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



CVS commit: src/sbin/gpt

2023-12-05 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Tue Dec  5 17:23:20 UTC 2023

Modified Files:
src/sbin/gpt: map.c

Log Message:
Fix an incorrect comment.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sbin/gpt/map.c

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

Modified files:

Index: src/sbin/gpt/map.c
diff -u src/sbin/gpt/map.c:1.15 src/sbin/gpt/map.c:1.16
--- src/sbin/gpt/map.c:1.15	Sun May 24 14:42:44 2020
+++ src/sbin/gpt/map.c	Tue Dec  5 17:23:19 2023
@@ -33,7 +33,7 @@
 __FBSDID("$FreeBSD: src/sbin/gpt/map.c,v 1.6 2005/08/31 01:47:19 marcel Exp $");
 #endif
 #ifdef __RCSID
-__RCSID("$NetBSD: map.c,v 1.15 2020/05/24 14:42:44 jmcneill Exp $");
+__RCSID("$NetBSD: map.c,v 1.16 2023/12/05 17:23:19 tsutsui Exp $");
 #endif
 
 #include 
@@ -257,7 +257,7 @@ map_resize(gpt_t gpt, map_t m, off_t siz
 		gpt_warnx(gpt, "negative size or alignment");
 		return -1;
 	}
-	/* Size == 0 means delete, if the next map is unused */
+	/* Size == 0 means to use whole region of the following unused map */
 	if (size == 0) { 
 		if (n == NULL) {
 			// XXX: we could just turn the map to UNUSED!



CVS commit: src/sbin/gpt

2023-12-05 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Tue Dec  5 17:23:20 UTC 2023

Modified Files:
src/sbin/gpt: map.c

Log Message:
Fix an incorrect comment.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sbin/gpt/map.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

2023-12-05 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Tue Dec  5 16:32:38 UTC 2023

Modified Files:
src/sys/arch/amd64/conf: ALL files.amd64
src/sys/arch/i386/conf: ALL

Log Message:
Add btvmei + btvmeii and vme to ALL.


To generate a diff of this commit:
cvs rdiff -u -r1.181 -r1.182 src/sys/arch/amd64/conf/ALL
cvs rdiff -u -r1.121 -r1.122 src/sys/arch/amd64/conf/files.amd64
cvs rdiff -u -r1.512 -r1.513 src/sys/arch/i386/conf/ALL

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

Modified files:

Index: src/sys/arch/amd64/conf/ALL
diff -u src/sys/arch/amd64/conf/ALL:1.181 src/sys/arch/amd64/conf/ALL:1.182
--- src/sys/arch/amd64/conf/ALL:1.181	Wed Oct  4 07:48:55 2023
+++ src/sys/arch/amd64/conf/ALL	Tue Dec  5 16:32:38 2023
@@ -1,4 +1,4 @@
-# $NetBSD: ALL,v 1.181 2023/10/04 07:48:55 rin Exp $
+# $NetBSD: ALL,v 1.182 2023/12/05 16:32:38 thorpej Exp $
 # From NetBSD: GENERIC,v 1.787 2006/10/01 18:37:54 bouyer Exp
 #
 # ALL machine description file
@@ -17,7 +17,7 @@ include 	"arch/amd64/conf/std.amd64"
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident		"ALL-$Revision: 1.181 $"
+#ident		"ALL-$Revision: 1.182 $"
 
 maxusers	64		# estimated number of users
 
@@ -489,6 +489,13 @@ cardslot*	at cbb?
 cardbus*	at cardslot?
 pcmcia* 	at cardslot?
 
+# VME bridge support
+btvmei*		at pci? dev ? function ?
+btvmeii*	at pci? dev ? function ?
+
+# VME bus support
+vme*		at vmebus?
+
 # Coprocessor Support
 
 # Console Devices

Index: src/sys/arch/amd64/conf/files.amd64
diff -u src/sys/arch/amd64/conf/files.amd64:1.121 src/sys/arch/amd64/conf/files.amd64:1.122
--- src/sys/arch/amd64/conf/files.amd64:1.121	Fri May  5 00:34:41 2023
+++ src/sys/arch/amd64/conf/files.amd64	Tue Dec  5 16:32:38 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: files.amd64,v 1.121 2023/05/05 00:34:41 manu Exp $
+#	$NetBSD: files.amd64,v 1.122 2023/12/05 16:32:38 thorpej Exp $
 #
 # new style config file for amd64 architecture
 #
@@ -197,4 +197,7 @@ include "dev/hyperv/files.hyperv"
 attach	vmbus at acpinodebus with vmbus_acpi
 file	dev/acpi/vmbus_acpi.c			vmbus_acpi
 
+# VMEbus support
+include "dev/vme/files.vme"
+
 include	"arch/amd64/conf/majors.amd64"

Index: src/sys/arch/i386/conf/ALL
diff -u src/sys/arch/i386/conf/ALL:1.512 src/sys/arch/i386/conf/ALL:1.513
--- src/sys/arch/i386/conf/ALL:1.512	Sat Sep  2 07:15:30 2023
+++ src/sys/arch/i386/conf/ALL	Tue Dec  5 16:32:38 2023
@@ -1,4 +1,4 @@
-# $NetBSD: ALL,v 1.512 2023/09/02 07:15:30 andvar Exp $
+# $NetBSD: ALL,v 1.513 2023/12/05 16:32:38 thorpej Exp $
 # From NetBSD: GENERIC,v 1.787 2006/10/01 18:37:54 bouyer Exp
 #
 # ALL machine description file
@@ -17,7 +17,7 @@ include 	"arch/i386/conf/std.i386"
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident		"ALL-$Revision: 1.512 $"
+#ident		"ALL-$Revision: 1.513 $"
 
 maxusers	64		# estimated number of users
 
@@ -568,6 +568,13 @@ cardslot*	at cbb?
 cardbus*	at cardslot?
 pcmcia* 	at cardslot?
 
+# VME bridge support
+btvmei*		at pci? dev ? function ?
+btvmeii*	at pci? dev ? function ?
+
+# VME bus support
+vme*		at vmebus?
+
 # Console Devices
 
 # wscons



CVS commit: src/sys/arch

2023-12-05 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Tue Dec  5 16:32:38 UTC 2023

Modified Files:
src/sys/arch/amd64/conf: ALL files.amd64
src/sys/arch/i386/conf: ALL

Log Message:
Add btvmei + btvmeii and vme to ALL.


To generate a diff of this commit:
cvs rdiff -u -r1.181 -r1.182 src/sys/arch/amd64/conf/ALL
cvs rdiff -u -r1.121 -r1.122 src/sys/arch/amd64/conf/files.amd64
cvs rdiff -u -r1.512 -r1.513 src/sys/arch/i386/conf/ALL

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

2023-12-05 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Tue Dec  5 15:58:32 UTC 2023

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

Log Message:
Use vmem(9) rather than extent(9) to manage VME<->PCI address
translations.

While here, malloc(9) -> kmem(9), and fix a couple of things that
the newer compiler gripes about.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/sys/dev/pci/btvmeii.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/btvmeii.c
diff -u src/sys/dev/pci/btvmeii.c:1.26 src/sys/dev/pci/btvmeii.c:1.27
--- src/sys/dev/pci/btvmeii.c:1.26	Sat Aug  7 16:19:14 2021
+++ src/sys/dev/pci/btvmeii.c	Tue Dec  5 15:58:32 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: btvmeii.c,v 1.26 2021/08/07 16:19:14 thorpej Exp $ */
+/* $NetBSD: btvmeii.c,v 1.27 2023/12/05 15:58:32 thorpej Exp $ */
 
 /*
  * Copyright (c) 1999
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: btvmeii.c,v 1.26 2021/08/07 16:19:14 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: btvmeii.c,v 1.27 2023/12/05 15:58:32 thorpej Exp $");
 
 #include 
 #include 
@@ -44,8 +44,8 @@ __KERNEL_RCSID(0, "$NetBSD: btvmeii.c,v 
 #include 
 
 #include 
-#include 
-#include 
+#include 
+#include 
 
 #include 
 
@@ -110,8 +110,7 @@ struct b3_2706_softc {
 
 	int windowused[8];
 	struct b3_2706_vmemaprescs vmemaprescs[8];
-	struct extent *vmeext;
-	char vmemap[EXTENT_FIXED_STORAGE_SIZE(8)];
+	vmem_t *vme_arena;
 
 	struct vme_chipset_tag sc_vct;
 
@@ -255,10 +254,16 @@ b3_2706_attach(device_t parent, device_t
 	for (i = 0; i < 8; i++) {
 		sc->windowused[i] = 0;
 	}
-	sc->vmeext = extent_create("pcivme", sc->vmepbase,
-   sc->vmepbase + 32*1024*1024 - 1, M_DEVBUF,
-   sc->vmemap, sizeof(sc->vmemap),
-   EX_NOCOALESCE);
+	sc->vme_arena = vmem_create("pcivme",
+sc->vmepbase,	/* base */
+32*1024*1024,	/* size */
+1,			/* quantum */
+NULL,		/* allocfn */
+NULL,		/* releasefn */
+NULL,		/* source */
+0,			/* qcache_max */
+VM_SLEEP,
+IPL_NONE);
 
 	sc->sc_vct.cookie = self;
 	sc->sc_vct.vct_probe = b3_2706_vme_probe;
@@ -285,8 +290,9 @@ int
 b3_2706_map_vme(void *vsc, vme_addr_t vmeaddr, vme_size_t len, vme_am_t am, vme_datasize_t datasizes, vme_swap_t swap, bus_space_tag_t *tag, bus_space_handle_t *handle, vme_mapresc_t *resc)
 {
 	int idx, i, wnd, res;
-	unsigned long boundary, maplen, pcibase;
+	unsigned long boundary, maplen;
 	vme_addr_t vmebase, vmeend;
+	vmem_addr_t pcibase;
 	static int windoworder[8] = {1, 2, 3, 5, 6, 7, 0, 4};
 
 	/* prefer windows with fine granularity for small mappings */
@@ -315,7 +321,15 @@ b3_2706_map_vme(void *vsc, vme_addr_t vm
 	/* bytes in outgoing window required */
 	maplen = vmeend - vmebase + boundary;
 
-	if (extent_alloc(sc->vmeext, maplen, boundary, 0, EX_FAST, )) {
+	if (vmem_xalloc(sc->vme_arena,
+			maplen,			/* size */
+			boundary,		/* align */
+			0,			/* phase */
+			0,			/* boundary */
+			VMEM_ADDR_MIN,		/* minaddr */
+			VMEM_ADDR_MAX,		/* maxaddr */
+			VM_NOSLEEP,
+			)) {
 		sc->windowused[wnd] = 0;
 		return (ENOMEM);
 	}
@@ -323,7 +337,7 @@ b3_2706_map_vme(void *vsc, vme_addr_t vm
 	res = univ_pci_mapvme(>univdata, wnd, vmebase, maplen,
 			  am, datasizes, pcibase);
 	if (res) {
-		extent_free(sc->vmeext, pcibase, maplen, 0);
+		vmem_xfree(sc->vme_arena, pcibase, maplen);
 		sc->windowused[wnd] = 0;
 		return (res);
 	}
@@ -332,7 +346,7 @@ b3_2706_map_vme(void *vsc, vme_addr_t vm
 			0, handle);
 	if (res) {
 		univ_pci_unmapvme(>univdata, wnd);
-		extent_free(sc->vmeext, pcibase, maplen, 0);
+		vmem_xfree(sc->vme_arena, pcibase, maplen);
 		sc->windowused[wnd] = 0;
 		return (res);
 	}
@@ -357,7 +371,7 @@ b3_2706_unmap_vme(void *vsc, vme_mapresc
 	struct b3_2706_vmemaprescs *r = resc;
 
 	bus_space_unmap(sc->vmet, r->handle, r->len);
-	extent_free(sc->vmeext, r->pcibase, r->maplen, 0);
+	vmem_xfree(sc->vme_arena, r->pcibase, r->maplen);
 
 	if (!sc->windowused[r->wnd])
 		panic("b3_2706_unmap_vme: bad window");
@@ -389,14 +403,17 @@ b3_2706_vme_probe(void *vsc, vme_addr_t 
 			switch (datasize) {
 			case VME_D8:
 dummy = bus_space_read_1(tag, handle, i);
+(void)dummy;
 i++;
 break;
 			case VME_D16:
 dummy = bus_space_read_2(tag, handle, i);
+(void)dummy;
 i += 2;
 break;
 			case VME_D32:
 dummy = bus_space_read_4(tag, handle, i);
+(void)dummy;
 i += 4;
 break;
 			default:
@@ -433,7 +450,7 @@ b3_2706_establish_vmeint(void *vsc, vme_
 	long lv;
 	int s;
 
-	ih = malloc(sizeof *ih, M_DEVBUF, M_WAITOK);
+	ih = kmem_alloc(sizeof *ih, KM_SLEEP);
 
 	lv = (long)handle; /* XXX */
 
@@ -466,7 +483,7 @@ b3_2706_disestablish_vmeint(void *vsc, v
 	TAILQ_REMOVE(&(sc->intrhdls), ih, ih_next);
 	splx(s);
 
-	free(ih, M_DEVBUF);
+	kmem_free(ih, sizeof(*ih));
 }
 
 void
@@ -506,19 +523,9 @@ b3_2706_vmeint(void *vsc, int level, 

CVS commit: src/sys/dev/pci

2023-12-05 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Tue Dec  5 15:58:32 UTC 2023

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

Log Message:
Use vmem(9) rather than extent(9) to manage VME<->PCI address
translations.

While here, malloc(9) -> kmem(9), and fix a couple of things that
the newer compiler gripes about.


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

2023-12-05 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Tue Dec  5 15:41:34 UTC 2023

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

Log Message:
b3_617_map_vme(): use VM_NOSLEEP.  EX_NOWAIT is 0, to lack of EX_WAITOK
is the same as EX_NOWAIT.


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

2023-12-05 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Tue Dec  5 15:41:34 UTC 2023

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

Log Message:
b3_617_map_vme(): use VM_NOSLEEP.  EX_NOWAIT is 0, to lack of EX_WAITOK
is the same as EX_NOWAIT.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/sys/dev/pci/btvmei.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/btvmei.c
diff -u src/sys/dev/pci/btvmei.c:1.36 src/sys/dev/pci/btvmei.c:1.37
--- src/sys/dev/pci/btvmei.c:1.36	Tue Dec  5 14:58:01 2023
+++ src/sys/dev/pci/btvmei.c	Tue Dec  5 15:41:34 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: btvmei.c,v 1.36 2023/12/05 14:58:01 thorpej Exp $ */
+/* $NetBSD: btvmei.c,v 1.37 2023/12/05 15:41:34 thorpej Exp $ */
 
 /*
  * Copyright (c) 1999
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: btvmei.c,v 1.36 2023/12/05 14:58:01 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: btvmei.c,v 1.37 2023/12/05 15:41:34 thorpej Exp $");
 
 #include 
 #include 
@@ -428,7 +428,7 @@ b3_617_map_vme(void *vsc, vme_addr_t vme
 	/* bytes in scatter table required */
 	maplen = ((vmeend - vmebase) / VME_PAGESIZE + 1) * 4;
 
-	if (vmem_alloc(sc->vme_arena, maplen, VM_BESTFIT | VM_SLEEP, ))
+	if (vmem_alloc(sc->vme_arena, maplen, VM_BESTFIT | VM_NOSLEEP, ))
 		return (ENOMEM);
 
 	/*



CVS commit: src/sys/dev/pci

2023-12-05 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Tue Dec  5 14:58:01 UTC 2023

Modified Files:
src/sys/dev/pci: btvmei.c btvmeivar.h

Log Message:
Use vmem(9) rather than extent(9) to manage VME<->PCI address
translations.

While here, malloc(9) -> kmem(9), and fix a couple of things that
the newer compiler gripes about.


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/sys/dev/pci/btvmei.c
cvs rdiff -u -r1.5 -r1.6 src/sys/dev/pci/btvmeivar.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

2023-12-05 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Tue Dec  5 14:58:01 UTC 2023

Modified Files:
src/sys/dev/pci: btvmei.c btvmeivar.h

Log Message:
Use vmem(9) rather than extent(9) to manage VME<->PCI address
translations.

While here, malloc(9) -> kmem(9), and fix a couple of things that
the newer compiler gripes about.


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/sys/dev/pci/btvmei.c
cvs rdiff -u -r1.5 -r1.6 src/sys/dev/pci/btvmeivar.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/btvmei.c
diff -u src/sys/dev/pci/btvmei.c:1.35 src/sys/dev/pci/btvmei.c:1.36
--- src/sys/dev/pci/btvmei.c:1.35	Sat Aug  7 16:19:14 2021
+++ src/sys/dev/pci/btvmei.c	Tue Dec  5 14:58:01 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: btvmei.c,v 1.35 2021/08/07 16:19:14 thorpej Exp $ */
+/* $NetBSD: btvmei.c,v 1.36 2023/12/05 14:58:01 thorpej Exp $ */
 
 /*
  * Copyright (c) 1999
@@ -29,17 +29,17 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: btvmei.c,v 1.35 2021/08/07 16:19:14 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: btvmei.c,v 1.36 2023/12/05 14:58:01 thorpej Exp $");
 
 #include 
 #include 
 #include 
 #include 
 #include 
-#include 
+#include 
+#include 
 
 #include 
-#include 
 
 #include 
 #include 
@@ -300,19 +300,38 @@ b3_617_init(struct b3_617_softc *sc)
 	/*
 	 * set up scatter page allocation control
 	 */
-	sc->vmeext = extent_create("pcivme", MR_PCI_VME,
-   MR_PCI_VME + MR_PCI_VME_SIZE - 1,
-   sc->vmemap, sizeof(sc->vmemap),
-   EX_NOCOALESCE);
+	sc->vme_arena = vmem_create("pcivme",
+MR_PCI_VME,		/* base */
+MR_PCI_VME_SIZE,	/* size */
+4,			/* quantum */
+NULL,		/* allocfn */
+NULL,		/* releasefn */
+NULL,		/* source */
+0,			/* qcache_max */
+VM_SLEEP,
+IPL_NONE);
 #if 0
-	sc->pciext = extent_create("vmepci", MR_VME_PCI,
-   MR_VME_PCI + MR_VME_PCI_SIZE - 1,
-   sc->pcimap, sizeof(sc->pcimap),
-   EX_NOCOALESCE);
-	sc->dmaext = extent_create("dmapci", MR_DMA_PCI,
-   MR_DMA_PCI + MR_DMA_PCI_SIZE - 1,
-   sc->dmamap, sizeof(sc->dmamap),
-   EX_NOCOALESCE);
+	sc->vme_arena = vmem_create("vmepci",
+MR_VME_PCI,		/* base */
+MR_VME_PCI_SIZE,	/* size */
+4,			/* quantum */
+NULL,		/* allocfn */
+NULL,		/* releasefn */
+NULL,		/* source */
+0,			/* qcache_max */
+VM_SLEEP,
+IPL_NONE);
+
+	sc->dma_arena = vmem_create("dmapci",
+MR_DMA_PCI,		/* base */
+MR_DMA_PCI_SIZE,	/* size */
+XXX,		/* quantum */
+NULL,		/* allocfn */
+NULL,		/* releasefn */
+NULL,		/* source */
+0,			/* qcache_max */
+VM_SLEEP,
+IPL_VM);
 #endif
 
 	/*
@@ -395,7 +414,8 @@ int
 b3_617_map_vme(void *vsc, vme_addr_t vmeaddr, vme_size_t len, vme_am_t am, vme_datasize_t datasizes, vme_swap_t swap, bus_space_tag_t *tag, bus_space_handle_t *handle, vme_mapresc_t *resc)
 {
 	vme_addr_t vmebase, vmeend, va;
-	unsigned long maplen, first, i;
+	unsigned long maplen, i;
+	vmem_addr_t first;
 	u_int32_t mapreg;
 	bus_addr_t pcibase;
 	int res;
@@ -408,7 +428,7 @@ b3_617_map_vme(void *vsc, vme_addr_t vme
 	/* bytes in scatter table required */
 	maplen = ((vmeend - vmebase) / VME_PAGESIZE + 1) * 4;
 
-	if (extent_alloc(sc->vmeext, maplen, 4, 0, EX_FAST, ))
+	if (vmem_alloc(sc->vme_arena, maplen, VM_BESTFIT | VM_SLEEP, ))
 		return (ENOMEM);
 
 	/*
@@ -438,7 +458,7 @@ b3_617_map_vme(void *vsc, vme_addr_t vme
 	if ((res = bus_space_map(sc->sc_vmet, pcibase, len, 0, handle))) {
 		for (i = first; i < first + maplen; i += 4)
 			write_mapmem(sc, i, MR_RAM_INVALID);
-		extent_free(sc->vmeext, first, maplen, 0);
+		vmem_free(sc->vme_arena, first, maplen);
 		return (res);
 	}
 
@@ -447,7 +467,7 @@ b3_617_map_vme(void *vsc, vme_addr_t vme
 	/*
 	 * save all data needed for later unmapping
 	 */
-	r = malloc(sizeof(*r), M_DEVBUF, M_WAITOK);
+	r = kmem_alloc(sizeof(*r), KM_SLEEP);
 	r->handle = *handle;
 	r->len = len;
 	r->firstpage = first;
@@ -468,9 +488,8 @@ b3_617_unmap_vme(void *vsc, vme_mapresc_
 	for (i = r->firstpage; i < r->firstpage + r->maplen; i += 4)
 		write_mapmem(sc, i, MR_RAM_INVALID);
 
-	extent_free(sc->vmeext, r->firstpage, r->maplen, 0);
-
-	free(r, M_DEVBUF);
+	vmem_free(sc->vme_arena, r->firstpage, r->maplen);
+	kmem_free(r, sizeof(*r));
 }
 
 int
@@ -500,14 +519,17 @@ b3_617_vme_probe(void *vsc, vme_addr_t a
 			switch (datasize) {
 			case VME_D8:
 dummy = bus_space_read_1(tag, handle, i);
+(void)dummy;
 i++;
 break;
 			case VME_D16:
 dummy = bus_space_read_2(tag, handle, i);
+(void)dummy;
 i += 2;
 break;
 			case VME_D32:
 dummy = bus_space_read_4(tag, handle, i);
+(void)dummy;
 i += 4;
 break;
 			default:
@@ -552,7 +574,7 @@ b3_617_establish_vmeint(void *vsc, vme_i
 	long lv;
 	int s;
 
-