CVS commit: src/sys/dev/fdt

2022-01-23 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Jan 23 08:01:33 UTC 2022

Modified Files:
src/sys/dev/fdt: arasan_sdhc_fdt.c

Log Message:
Use __MASK(4) in bus_dmatag_subregion.  NFCI.


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

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

Modified files:

Index: src/sys/dev/fdt/arasan_sdhc_fdt.c
diff -u src/sys/dev/fdt/arasan_sdhc_fdt.c:1.7 src/sys/dev/fdt/arasan_sdhc_fdt.c:1.8
--- src/sys/dev/fdt/arasan_sdhc_fdt.c:1.7	Mon Jan 17 14:00:47 2022
+++ src/sys/dev/fdt/arasan_sdhc_fdt.c	Sun Jan 23 08:01:33 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: arasan_sdhc_fdt.c,v 1.7 2022/01/17 14:00:47 skrll Exp $ */
+/* $NetBSD: arasan_sdhc_fdt.c,v 1.8 2022/01/23 08:01:33 skrll Exp $ */
 
 /*-
  * Copyright (c) 2019 Jared McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: arasan_sdhc_fdt.c,v 1.7 2022/01/17 14:00:47 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: arasan_sdhc_fdt.c,v 1.8 2022/01/23 08:01:33 skrll Exp $");
 
 #include 
 #include 
@@ -272,7 +272,7 @@ arasan_sdhc_attach(device_t parent, devi
 
 	const uint32_t caps = bus_space_read_4(sc->sc_bst, sc->sc_bsh, SDHC_CAPABILITIES);
 	if ((caps & (SDHC_ADMA2_SUPP|SDHC_64BIT_SYS_BUS)) == SDHC_ADMA2_SUPP) {
-		error = bus_dmatag_subregion(faa->faa_dmat, 0, UINT32_MAX,
+		error = bus_dmatag_subregion(faa->faa_dmat, 0, __MASK(32),
 		>sc_base.sc_dmat, BUS_DMA_WAITOK);
 		if (error != 0) {
 			aprint_error(": couldn't create DMA tag: %d\n", error);



CVS commit: src/sys/dev/fdt

2022-01-23 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Jan 23 08:01:33 UTC 2022

Modified Files:
src/sys/dev/fdt: arasan_sdhc_fdt.c

Log Message:
Use __MASK(4) in bus_dmatag_subregion.  NFCI.


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

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



CVS commit: src/share/man/man9

2022-01-22 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Jan 22 15:16:37 UTC 2022

Modified Files:
src/share/man/man9: bus_dma.9

Log Message:
Add a note about bus_dmatag_subregion [min_addr, max_addr]


To generate a diff of this commit:
cvs rdiff -u -r1.66 -r1.67 src/share/man/man9/bus_dma.9

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

Modified files:

Index: src/share/man/man9/bus_dma.9
diff -u src/share/man/man9/bus_dma.9:1.66 src/share/man/man9/bus_dma.9:1.67
--- src/share/man/man9/bus_dma.9:1.66	Mon Aug 20 14:23:27 2018
+++ src/share/man/man9/bus_dma.9	Sat Jan 22 15:16:37 2022
@@ -1,4 +1,4 @@
-.\" $NetBSD: bus_dma.9,v 1.66 2018/08/20 14:23:27 riastradh Exp $
+.\" $NetBSD: bus_dma.9,v 1.67 2022/01/22 15:16:37 skrll Exp $
 .\"
 .\" Copyright (c) 1996, 1997, 1998, 2001, 2005, 2006 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -28,7 +28,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd January 2, 2017
+.Dd January 22, 2022
 .Dt BUS_DMA 9
 .Os
 .Sh NAME
@@ -822,6 +822,11 @@ It is safe to wait (sleep) for resources
 It is not safe to wait (sleep) for resources during this call.
 .El
 .El
+The address range
+.Fa min_addr
+to
+.Fa max_addr
+is inclusive of both addresses.
 .It Fn bus_dmatag_destroy "tag"
 Free a tag created by
 .Fn bus_dmatag_subregion .



CVS commit: src/share/man/man9

2022-01-22 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Jan 22 15:16:37 UTC 2022

Modified Files:
src/share/man/man9: bus_dma.9

Log Message:
Add a note about bus_dmatag_subregion [min_addr, max_addr]


To generate a diff of this commit:
cvs rdiff -u -r1.66 -r1.67 src/share/man/man9/bus_dma.9

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



CVS commit: src/sys

2022-01-22 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Jan 22 15:10:32 UTC 2022

Modified Files:
src/sys/arch/alpha/isa: isadma_bounce.c
src/sys/arch/arc/isa: isadma_bounce.c
src/sys/arch/arm/include: bus_defs.h
src/sys/arch/arm/nvidia: tegra_sdhc.c
src/sys/arch/atari/isa: isa_dma.c
src/sys/arch/emips/emips: bus_dma.c
src/sys/arch/evbmips/isa: isadma_bounce.c
src/sys/arch/evbmips/malta/pci: pcib.c
src/sys/arch/mips/include: bus_dma_defs.h
src/sys/arch/mips/mips: bus_dma.c
src/sys/arch/mips/rmi: rmixl_obio.c rmixl_pcix.c
src/sys/arch/mips/sibyte/pci: sbbrz.c
src/sys/arch/newsmips/newsmips: bus.c
src/sys/arch/playstation2/playstation2: bus_dma.c
src/sys/arch/pmax/pmax: bus_dma.c
src/sys/arch/powerpc/isa: isadma_machdep.c
src/sys/arch/x86/include: bus_private.h
src/sys/arch/x86/x86: bus_dma.c
src/sys/dev/pci: if_bce.c if_bge.c if_nfe.c if_stge.c if_vge.c

Log Message:
Ensure bus_dmatag_subregion is called with an inclusive max_addr
everywhere.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/alpha/isa/isadma_bounce.c
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/arc/isa/isadma_bounce.c
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/arm/include/bus_defs.h
cvs rdiff -u -r1.29 -r1.30 src/sys/arch/arm/nvidia/tegra_sdhc.c
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/atari/isa/isa_dma.c
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/emips/emips/bus_dma.c
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/evbmips/isa/isadma_bounce.c
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/evbmips/malta/pci/pcib.c
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/mips/include/bus_dma_defs.h
cvs rdiff -u -r1.45 -r1.46 src/sys/arch/mips/mips/bus_dma.c
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/mips/rmi/rmixl_obio.c
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/mips/rmi/rmixl_pcix.c
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/mips/sibyte/pci/sbbrz.c
cvs rdiff -u -r1.36 -r1.37 src/sys/arch/newsmips/newsmips/bus.c
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/playstation2/playstation2/bus_dma.c
cvs rdiff -u -r1.62 -r1.63 src/sys/arch/pmax/pmax/bus_dma.c
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/powerpc/isa/isadma_machdep.c
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/x86/include/bus_private.h
cvs rdiff -u -r1.83 -r1.84 src/sys/arch/x86/x86/bus_dma.c
cvs rdiff -u -r1.59 -r1.60 src/sys/dev/pci/if_bce.c
cvs rdiff -u -r1.349 -r1.350 src/sys/dev/pci/if_bge.c
cvs rdiff -u -r1.78 -r1.79 src/sys/dev/pci/if_nfe.c
cvs rdiff -u -r1.87 -r1.88 src/sys/dev/pci/if_stge.c
cvs rdiff -u -r1.81 -r1.82 src/sys/dev/pci/if_vge.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/isa/isadma_bounce.c
diff -u src/sys/arch/alpha/isa/isadma_bounce.c:1.16 src/sys/arch/alpha/isa/isadma_bounce.c:1.17
--- src/sys/arch/alpha/isa/isadma_bounce.c:1.16	Fri Dec 17 06:28:20 2021
+++ src/sys/arch/alpha/isa/isadma_bounce.c	Sat Jan 22 15:10:30 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: isadma_bounce.c,v 1.16 2021/12/17 06:28:20 skrll Exp $ */
+/* $NetBSD: isadma_bounce.c,v 1.17 2022/01/22 15:10:30 skrll Exp $ */
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2000 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
 
 #include 			/* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: isadma_bounce.c,v 1.16 2021/12/17 06:28:20 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: isadma_bounce.c,v 1.17 2022/01/22 15:10:30 skrll Exp $");
 
 #include 
 #include 
@@ -565,9 +565,9 @@ isadma_bounce_dmamem_alloc(bus_dma_tag_t
 	paddr_t high;
 
 	if (avail_end > ISA_DMA_BOUNCE_THRESHOLD)
-		high = trunc_page(ISA_DMA_BOUNCE_THRESHOLD);
+		high = ISA_DMA_BOUNCE_THRESHOLD - 1;
 	else
-		high = trunc_page(avail_end);
+		high = avail_end - 1;
 
 	return (_bus_dmamem_alloc_range(t, size, alignment, boundary,
 	segs, nsegs, rsegs, flags, 0, high));

Index: src/sys/arch/arc/isa/isadma_bounce.c
diff -u src/sys/arch/arc/isa/isadma_bounce.c:1.18 src/sys/arch/arc/isa/isadma_bounce.c:1.19
--- src/sys/arch/arc/isa/isadma_bounce.c:1.18	Fri Dec 17 06:28:20 2021
+++ src/sys/arch/arc/isa/isadma_bounce.c	Sat Jan 22 15:10:30 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: isadma_bounce.c,v 1.18 2021/12/17 06:28:20 skrll Exp $ */
+/* $NetBSD: isadma_bounce.c,v 1.19 2022/01/22 15:10:30 skrll Exp $ */
 /* NetBSD: isadma_bounce.c,v 1.2 2000/06/01 05:49:36 thorpej Exp  */
 
 /*-
@@ -33,7 +33,7 @@
 
 #include 			/* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: isadma_bounce.c,v 1.18 2021/12/17 06:28:20 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: isadma_bounce.c,v 1.19 2022/01/22 15:10:30 skrll Exp $");
 
 #include 
 #include 
@@ -613,9 +613,9 @@ isadma_bounce_dmamem_alloc(bus_dma_tag_t
 	paddr_t high;
 
 	if (pmap_limits.avail_end > ISA_DMA_BOUNCE_THRESHOLD)
-		high = trunc_page(ISA_DMA_BOUNCE_THRESHOLD);
+		high = ISA_DMA_BOUNCE_THRESHOLD - 1;
 	else
-		high = trunc_page(pmap_limits.avail_end);
+		high = 

CVS commit: src/sys

2022-01-22 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Jan 22 15:10:32 UTC 2022

Modified Files:
src/sys/arch/alpha/isa: isadma_bounce.c
src/sys/arch/arc/isa: isadma_bounce.c
src/sys/arch/arm/include: bus_defs.h
src/sys/arch/arm/nvidia: tegra_sdhc.c
src/sys/arch/atari/isa: isa_dma.c
src/sys/arch/emips/emips: bus_dma.c
src/sys/arch/evbmips/isa: isadma_bounce.c
src/sys/arch/evbmips/malta/pci: pcib.c
src/sys/arch/mips/include: bus_dma_defs.h
src/sys/arch/mips/mips: bus_dma.c
src/sys/arch/mips/rmi: rmixl_obio.c rmixl_pcix.c
src/sys/arch/mips/sibyte/pci: sbbrz.c
src/sys/arch/newsmips/newsmips: bus.c
src/sys/arch/playstation2/playstation2: bus_dma.c
src/sys/arch/pmax/pmax: bus_dma.c
src/sys/arch/powerpc/isa: isadma_machdep.c
src/sys/arch/x86/include: bus_private.h
src/sys/arch/x86/x86: bus_dma.c
src/sys/dev/pci: if_bce.c if_bge.c if_nfe.c if_stge.c if_vge.c

Log Message:
Ensure bus_dmatag_subregion is called with an inclusive max_addr
everywhere.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/alpha/isa/isadma_bounce.c
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/arc/isa/isadma_bounce.c
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/arm/include/bus_defs.h
cvs rdiff -u -r1.29 -r1.30 src/sys/arch/arm/nvidia/tegra_sdhc.c
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/atari/isa/isa_dma.c
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/emips/emips/bus_dma.c
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/evbmips/isa/isadma_bounce.c
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/evbmips/malta/pci/pcib.c
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/mips/include/bus_dma_defs.h
cvs rdiff -u -r1.45 -r1.46 src/sys/arch/mips/mips/bus_dma.c
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/mips/rmi/rmixl_obio.c
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/mips/rmi/rmixl_pcix.c
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/mips/sibyte/pci/sbbrz.c
cvs rdiff -u -r1.36 -r1.37 src/sys/arch/newsmips/newsmips/bus.c
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/playstation2/playstation2/bus_dma.c
cvs rdiff -u -r1.62 -r1.63 src/sys/arch/pmax/pmax/bus_dma.c
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/powerpc/isa/isadma_machdep.c
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/x86/include/bus_private.h
cvs rdiff -u -r1.83 -r1.84 src/sys/arch/x86/x86/bus_dma.c
cvs rdiff -u -r1.59 -r1.60 src/sys/dev/pci/if_bce.c
cvs rdiff -u -r1.349 -r1.350 src/sys/dev/pci/if_bge.c
cvs rdiff -u -r1.78 -r1.79 src/sys/dev/pci/if_nfe.c
cvs rdiff -u -r1.87 -r1.88 src/sys/dev/pci/if_stge.c
cvs rdiff -u -r1.81 -r1.82 src/sys/dev/pci/if_vge.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

2022-01-22 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Jan 22 15:08:11 UTC 2022

Modified Files:
src/sys/arch/emips/emips: bus_dma.c
src/sys/arch/evbmips/malta/pci: pcib.c
src/sys/arch/mips/mips: bus_dma.c
src/sys/arch/mips/rmi: rmixl_obio.c rmixl_pcix.c
src/sys/arch/mips/sibyte/pci: sbbrz.c
src/sys/arch/newsmips/newsmips: bus.c
src/sys/arch/playstation2/playstation2: bus_dma.c
src/sys/arch/pmax/pmax: bus_dma.c

Log Message:
Trailing whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/emips/emips/bus_dma.c
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/evbmips/malta/pci/pcib.c
cvs rdiff -u -r1.44 -r1.45 src/sys/arch/mips/mips/bus_dma.c
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/mips/rmi/rmixl_obio.c
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/mips/rmi/rmixl_pcix.c
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/mips/sibyte/pci/sbbrz.c
cvs rdiff -u -r1.35 -r1.36 src/sys/arch/newsmips/newsmips/bus.c
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/playstation2/playstation2/bus_dma.c
cvs rdiff -u -r1.61 -r1.62 src/sys/arch/pmax/pmax/bus_dma.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

2022-01-22 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Jan 22 15:08:11 UTC 2022

Modified Files:
src/sys/arch/emips/emips: bus_dma.c
src/sys/arch/evbmips/malta/pci: pcib.c
src/sys/arch/mips/mips: bus_dma.c
src/sys/arch/mips/rmi: rmixl_obio.c rmixl_pcix.c
src/sys/arch/mips/sibyte/pci: sbbrz.c
src/sys/arch/newsmips/newsmips: bus.c
src/sys/arch/playstation2/playstation2: bus_dma.c
src/sys/arch/pmax/pmax: bus_dma.c

Log Message:
Trailing whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/emips/emips/bus_dma.c
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/evbmips/malta/pci/pcib.c
cvs rdiff -u -r1.44 -r1.45 src/sys/arch/mips/mips/bus_dma.c
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/mips/rmi/rmixl_obio.c
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/mips/rmi/rmixl_pcix.c
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/mips/sibyte/pci/sbbrz.c
cvs rdiff -u -r1.35 -r1.36 src/sys/arch/newsmips/newsmips/bus.c
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/playstation2/playstation2/bus_dma.c
cvs rdiff -u -r1.61 -r1.62 src/sys/arch/pmax/pmax/bus_dma.c

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

Modified files:

Index: src/sys/arch/emips/emips/bus_dma.c
diff -u src/sys/arch/emips/emips/bus_dma.c:1.6 src/sys/arch/emips/emips/bus_dma.c:1.7
--- src/sys/arch/emips/emips/bus_dma.c:1.6	Sun Dec  5 03:07:15 2021
+++ src/sys/arch/emips/emips/bus_dma.c	Sat Jan 22 15:08:10 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus_dma.c,v 1.6 2021/12/05 03:07:15 msaitoh Exp $	*/
+/*	$NetBSD: bus_dma.c,v 1.7 2022/01/22 15:08:10 skrll Exp $	*/
 
 /*-
  * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.6 2021/12/05 03:07:15 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.7 2022/01/22 15:08:10 skrll Exp $");
 
 #include "opt_cputype.h"
 
@@ -88,9 +88,9 @@ emips_bus_dma_init(void)
 #endif
 }
 
-static size_t 
+static size_t
 _bus_dmamap_mapsize(int const nsegments)
-{   
+{
 	KASSERT(nsegments > 0);
 	return sizeof(struct emips_bus_dmamap) +
 	(sizeof(bus_dma_segment_t) * (nsegments - 1));
@@ -488,11 +488,11 @@ _bus_dmamap_sync_r3k(bus_dma_tag_t t, bu
 		}
 
 		/*
-		 * Now at the first segment to sync; nail 
+		 * Now at the first segment to sync; nail
 		 * each segment until we have exhausted the
 		 * length.
 		 */
-		minlen = len < map->dm_segs[i].ds_len - offset ?  
+		minlen = len < map->dm_segs[i].ds_len - offset ?
 		len : map->dm_segs[i].ds_len - offset;
 
 		addr = map->dm_segs[i].ds_addr;
@@ -736,6 +736,6 @@ _bus_dmamem_mmap(bus_dma_tag_t t, bus_dm
 	rv = _bus_dmamem_mmap_common(t, segs, nsegs, off, prot, flags);
 	if (rv == (bus_addr_t)-1)
 		return (-1);
-	
+
 	return (mips_btop((char *)rv));
 }

Index: src/sys/arch/evbmips/malta/pci/pcib.c
diff -u src/sys/arch/evbmips/malta/pci/pcib.c:1.22 src/sys/arch/evbmips/malta/pci/pcib.c:1.23
--- src/sys/arch/evbmips/malta/pci/pcib.c:1.22	Sat Aug  7 16:18:51 2021
+++ src/sys/arch/evbmips/malta/pci/pcib.c	Sat Jan 22 15:08:10 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: pcib.c,v 1.22 2021/08/07 16:18:51 thorpej Exp $	*/
+/*	$NetBSD: pcib.c,v 1.23 2022/01/22 15:08:10 skrll Exp $	*/
 
 /*
  * Copyright 2002 Wasabi Systems, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pcib.c,v 1.22 2021/08/07 16:18:51 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pcib.c,v 1.23 2022/01/22 15:08:10 skrll Exp $");
 
 #include 
 #include 
@@ -426,7 +426,7 @@ pcib_intr(void *v)
 		 * From YAMON source code:
 		 *
 		 * IRQ7 is used to detect spurious interrupts.
-		 * The interrupt acknowledge cycle returns IRQ7, if no 
+		 * The interrupt acknowledge cycle returns IRQ7, if no
 		 * interrupts is requested.
 		 * We can differentiate between this situation and a
 		 * "Normal" IRQ7 by reading the ISR.

Index: src/sys/arch/mips/mips/bus_dma.c
diff -u src/sys/arch/mips/mips/bus_dma.c:1.44 src/sys/arch/mips/mips/bus_dma.c:1.45
--- src/sys/arch/mips/mips/bus_dma.c:1.44	Thu Jan  7 17:28:20 2021
+++ src/sys/arch/mips/mips/bus_dma.c	Sat Jan 22 15:08:10 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus_dma.c,v 1.44 2021/01/07 17:28:20 skrll Exp $	*/
+/*	$NetBSD: bus_dma.c,v 1.45 2022/01/22 15:08:10 skrll Exp $	*/
 
 /*-
  * Copyright (c) 1997, 1998, 2001, 2020 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
 
 #include 			/* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.44 2021/01/07 17:28:20 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.45 2022/01/22 15:08:10 skrll Exp $");
 
 #define _MIPS_BUS_DMA_PRIVATE
 
@@ -285,9 +285,9 @@ _bus_dma_load_bouncebuf(bus_dma_tag_t t,
 }
 #endif /* _MIPS_NEED_BUS_DMA_BOUNCE */
 
-static size_t 
+static size_t
 _bus_dmamap_mapsize(int const nsegments)
-{ 
+{
 	KASSERT(nsegments > 0);
 	return sizeof(struct mips_bus_dmamap) +
 	(sizeof(bus_dma_segment_t) * (nsegments - 1));
@@ -862,7 +862,7 @@ 

CVS commit: src

2022-01-22 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Jan 22 08:58:48 UTC 2022

Modified Files:
src/distrib/sets/lists/comp: mi
src/share/man/man3: Makefile bits.3
src/sys/sys: cdefs.h

Log Message:
Add __MASK(3)

__MASK(n): first n bits all set, where __MASK(4) == 0b.


To generate a diff of this commit:
cvs rdiff -u -r1.2409 -r1.2410 src/distrib/sets/lists/comp/mi
cvs rdiff -u -r1.90 -r1.91 src/share/man/man3/Makefile
cvs rdiff -u -r1.20 -r1.21 src/share/man/man3/bits.3
cvs rdiff -u -r1.158 -r1.159 src/sys/sys/cdefs.h

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

Modified files:

Index: src/distrib/sets/lists/comp/mi
diff -u src/distrib/sets/lists/comp/mi:1.2409 src/distrib/sets/lists/comp/mi:1.2410
--- src/distrib/sets/lists/comp/mi:1.2409	Sat Jan 22 08:09:39 2022
+++ src/distrib/sets/lists/comp/mi	Sat Jan 22 08:58:48 2022
@@ -1,4 +1,4 @@
-#	$NetBSD: mi,v 1.2409 2022/01/22 08:09:39 pho Exp $
+#	$NetBSD: mi,v 1.2410 2022/01/22 08:58:48 skrll Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 ./etc/mtree/set.compcomp-sys-root
@@ -5851,6 +5851,7 @@
 ./usr/share/man/cat3/__CONCAT.0			comp-c-catman		.cat
 ./usr/share/man/cat3/__FPTRCAST.0		comp-c-catman		.cat
 ./usr/share/man/cat3/__KERNEL_RCSID.0		comp-c-catman		.cat
+./usr/share/man/cat3/__MASK.0			comp-c-catman		.cat
 ./usr/share/man/cat3/__RCSID.0			comp-c-catman		.cat
 ./usr/share/man/cat3/__SHIFTIN.0		comp-c-catman		.cat
 ./usr/share/man/cat3/__SHIFTOUT.0		comp-c-catman		.cat
@@ -14198,6 +14199,7 @@
 ./usr/share/man/html3/__CONCAT.html		comp-c-htmlman		html
 ./usr/share/man/html3/__FPTRCAST.html		comp-c-htmlman		html
 ./usr/share/man/html3/__KERNEL_RCSID.html	comp-c-htmlman		html
+./usr/share/man/html3/__MASK.html		comp-c-htmlman		html
 ./usr/share/man/html3/__RCSID.html		comp-c-htmlman		html
 ./usr/share/man/html3/__SHIFTIN.html		comp-c-htmlman		html
 ./usr/share/man/html3/__SHIFTOUT.html		comp-c-htmlman		html
@@ -22382,6 +22384,7 @@
 ./usr/share/man/man3/__CONCAT.3			comp-c-man		.man
 ./usr/share/man/man3/__FPTRCAST.3		comp-c-man		.man
 ./usr/share/man/man3/__KERNEL_RCSID.3		comp-c-man		.man
+./usr/share/man/man3/__MASK.3			comp-c-man		.man
 ./usr/share/man/man3/__RCSID.3			comp-c-man		.man
 ./usr/share/man/man3/__SHIFTIN.3		comp-c-man		.man
 ./usr/share/man/man3/__SHIFTOUT.3		comp-c-man		.man

Index: src/share/man/man3/Makefile
diff -u src/share/man/man3/Makefile:1.90 src/share/man/man3/Makefile:1.91
--- src/share/man/man3/Makefile:1.90	Mon Jan 13 08:25:02 2020
+++ src/share/man/man3/Makefile	Sat Jan 22 08:58:48 2022
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.90 2020/01/13 08:25:02 kamil Exp $
+#	$NetBSD: Makefile,v 1.91 2022/01/22 08:58:48 skrll Exp $
 #	@(#)Makefile	8.2 (Berkeley) 12/13/93
 
 MAN=	_DIAGASSERT.3 __CONCAT.3 __FPTRCAST.3 __UNCONST.3 __USE.3 CMSG_DATA.3 \
@@ -47,6 +47,7 @@ MLINKS+=bitstring.3 bit_alloc.3 \
 	bitstring.3 bit_test.3
 MLINKS+=bits.3 __BIT.3 \
 	bits.3 __BITS.3 \
+	bits.3 __MASK.3 \
 	bits.3 __SHIFTIN.3 \
 	bits.3 __SHIFTOUT.3 \
 	bits.3 __SHIFTOUT_MASK.3

Index: src/share/man/man3/bits.3
diff -u src/share/man/man3/bits.3:1.20 src/share/man/man3/bits.3:1.21
--- src/share/man/man3/bits.3:1.20	Thu Jan 20 07:30:25 2022
+++ src/share/man/man3/bits.3	Sat Jan 22 08:58:48 2022
@@ -1,4 +1,4 @@
-.\"	$NetBSD: bits.3,v 1.20 2022/01/20 07:30:25 skrll Exp $
+.\"	$NetBSD: bits.3,v 1.21 2022/01/22 08:58:48 skrll Exp $
 .\"
 .\" Copyright (c) 2006, 2010 David Young.  All rights reserved.
 .\"
@@ -25,12 +25,13 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd January 20, 2022
+.Dd January 22, 2022
 .Dt BITS 3
 .Os
 .Sh NAME
 .Nm __BIT ,
 .Nm __BITS ,
+.Nm __MASK ,
 .Nm __SHIFTIN ,
 .Nm __SHIFTOUT ,
 .Nm __SHIFTOUT_MASK
@@ -43,6 +44,8 @@
 .Ft uintmax_t
 .Fn __BITS "m" "n"
 .Ft uintmax_t
+.Fn __MASK "n"
+.Ft uintmax_t
 .Fn __SHIFTIN "v" "mask"
 .Ft uintmax_t
 .Fn __SHIFTOUT "v" "mask"
@@ -57,9 +60,10 @@ is a span of consecutive bits defined by
 the bits in the bitfield.
 .Pp
 Use
-.Fn __BIT
+.Fn __BIT ,
+.Fn __BITS ,
 and
-.Fn __BITS
+.Fn __MASK
 to define bitmasks:
 .Bl -tag -width __BITS -offset indent
 .It Fn __BIT "n"
@@ -77,6 +81,12 @@ It does not matter whether
 or
 .Fa m No <= Fa n .
 The least significant bit is bit 0.
+.It Fn __MASK "n"
+Return a bitmask with the first
+.Fa n
+bits set. That is, bits 0 through
+.Fa n
+- 1, inclusive, set.
 .El
 .Pp
 .Fn __SHIFTIN ,

Index: src/sys/sys/cdefs.h
diff -u src/sys/sys/cdefs.h:1.158 src/sys/sys/cdefs.h:1.159
--- src/sys/sys/cdefs.h:1.158	Tue Dec 14 20:12:48 2021
+++ src/sys/sys/cdefs.h	Sat Jan 22 08:58:48 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: cdefs.h,v 1.158 2021/12/14 20:12:48 christos Exp $	*/
+/*	$NetBSD: cdefs.h,v 1.159 2022/01/22 08:58:48 skrll Exp $	*/
 
 /* * Copyright (c) 1991, 1993
  *	The Regents of the University of California.  All rights reserved.
@@ -649,6 +649,9 @@
 

CVS commit: src

2022-01-22 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Jan 22 08:58:48 UTC 2022

Modified Files:
src/distrib/sets/lists/comp: mi
src/share/man/man3: Makefile bits.3
src/sys/sys: cdefs.h

Log Message:
Add __MASK(3)

__MASK(n): first n bits all set, where __MASK(4) == 0b.


To generate a diff of this commit:
cvs rdiff -u -r1.2409 -r1.2410 src/distrib/sets/lists/comp/mi
cvs rdiff -u -r1.90 -r1.91 src/share/man/man3/Makefile
cvs rdiff -u -r1.20 -r1.21 src/share/man/man3/bits.3
cvs rdiff -u -r1.158 -r1.159 src/sys/sys/cdefs.h

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



CVS commit: src/share/man/man3

2022-01-19 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu Jan 20 07:30:25 UTC 2022

Modified Files:
src/share/man/man3: bits.3

Log Message:
Add return type of the __SHIFT* macros.  Bump date.

"looks right to me" from mrg@


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/share/man/man3/bits.3

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

Modified files:

Index: src/share/man/man3/bits.3
diff -u src/share/man/man3/bits.3:1.19 src/share/man/man3/bits.3:1.20
--- src/share/man/man3/bits.3:1.19	Mon Jun  8 17:28:10 2020
+++ src/share/man/man3/bits.3	Thu Jan 20 07:30:25 2022
@@ -1,4 +1,4 @@
-.\"	$NetBSD: bits.3,v 1.19 2020/06/08 17:28:10 sevan Exp $
+.\"	$NetBSD: bits.3,v 1.20 2022/01/20 07:30:25 skrll Exp $
 .\"
 .\" Copyright (c) 2006, 2010 David Young.  All rights reserved.
 .\"
@@ -25,7 +25,7 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd November 6, 2016
+.Dd January 20, 2022
 .Dt BITS 3
 .Os
 .Sh NAME
@@ -42,8 +42,11 @@
 .Fn __BIT "n"
 .Ft uintmax_t
 .Fn __BITS "m" "n"
+.Ft uintmax_t
 .Fn __SHIFTIN "v" "mask"
+.Ft uintmax_t
 .Fn __SHIFTOUT "v" "mask"
+.Ft uintmax_t
 .Fn __SHIFTOUT_MASK "mask"
 .Sh DESCRIPTION
 These macros prepare bitmasks, extract bitfields from words, and



CVS commit: src/share/man/man3

2022-01-19 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu Jan 20 07:30:25 UTC 2022

Modified Files:
src/share/man/man3: bits.3

Log Message:
Add return type of the __SHIFT* macros.  Bump date.

"looks right to me" from mrg@


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/share/man/man3/bits.3

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



CVS commit: src/sys/dev/fdt

2022-01-17 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon Jan 17 14:00:47 UTC 2022

Modified Files:
src/sys/dev/fdt: arasan_sdhc_fdt.c

Log Message:
s/0x/UINT32_MAX/ in bus_dmatag_subregion call


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

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

Modified files:

Index: src/sys/dev/fdt/arasan_sdhc_fdt.c
diff -u src/sys/dev/fdt/arasan_sdhc_fdt.c:1.6 src/sys/dev/fdt/arasan_sdhc_fdt.c:1.7
--- src/sys/dev/fdt/arasan_sdhc_fdt.c:1.6	Wed Jan 27 03:10:21 2021
+++ src/sys/dev/fdt/arasan_sdhc_fdt.c	Mon Jan 17 14:00:47 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: arasan_sdhc_fdt.c,v 1.6 2021/01/27 03:10:21 thorpej Exp $ */
+/* $NetBSD: arasan_sdhc_fdt.c,v 1.7 2022/01/17 14:00:47 skrll Exp $ */
 
 /*-
  * Copyright (c) 2019 Jared McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: arasan_sdhc_fdt.c,v 1.6 2021/01/27 03:10:21 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: arasan_sdhc_fdt.c,v 1.7 2022/01/17 14:00:47 skrll Exp $");
 
 #include 
 #include 
@@ -272,7 +272,7 @@ arasan_sdhc_attach(device_t parent, devi
 
 	const uint32_t caps = bus_space_read_4(sc->sc_bst, sc->sc_bsh, SDHC_CAPABILITIES);
 	if ((caps & (SDHC_ADMA2_SUPP|SDHC_64BIT_SYS_BUS)) == SDHC_ADMA2_SUPP) {
-		error = bus_dmatag_subregion(faa->faa_dmat, 0, 0x,
+		error = bus_dmatag_subregion(faa->faa_dmat, 0, UINT32_MAX,
 		>sc_base.sc_dmat, BUS_DMA_WAITOK);
 		if (error != 0) {
 			aprint_error(": couldn't create DMA tag: %d\n", error);



CVS commit: src/sys/dev/fdt

2022-01-17 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon Jan 17 14:00:47 UTC 2022

Modified Files:
src/sys/dev/fdt: arasan_sdhc_fdt.c

Log Message:
s/0x/UINT32_MAX/ in bus_dmatag_subregion call


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

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



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

2022-01-15 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Jan 15 10:32:32 UTC 2022

Modified Files:
src/sys/arch/mips/mips: db_interface.c

Log Message:
Add 'mach cpuinfo' support


To generate a diff of this commit:
cvs rdiff -u -r1.95 -r1.96 src/sys/arch/mips/mips/db_interface.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/mips/mips/db_interface.c
diff -u src/sys/arch/mips/mips/db_interface.c:1.95 src/sys/arch/mips/mips/db_interface.c:1.96
--- src/sys/arch/mips/mips/db_interface.c:1.95	Sat Jan 15 08:56:41 2022
+++ src/sys/arch/mips/mips/db_interface.c	Sat Jan 15 10:32:32 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: db_interface.c,v 1.95 2022/01/15 08:56:41 skrll Exp $	*/
+/*	$NetBSD: db_interface.c,v 1.96 2022/01/15 10:32:32 skrll Exp $	*/
 
 /*
  * Mach Operating System
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: db_interface.c,v 1.95 2022/01/15 08:56:41 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_interface.c,v 1.96 2022/01/15 10:32:32 skrll Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_multiprocessor.h"
@@ -88,8 +88,10 @@ static void db_mach_cpu_cmd(db_expr_t, b
 #endif
 
 void db_cp0dump_cmd(db_expr_t, bool, db_expr_t, const char *);
+void db_cpuinfo_cmd(db_expr_t, bool, db_expr_t, const char *);
 void db_kvtophys_cmd(db_expr_t, bool, db_expr_t, const char *);
 void db_tlbdump_cmd(db_expr_t, bool, db_expr_t, const char *);
+
 #ifdef MIPS64_XLS
 void db_mfcr_cmd(db_expr_t, bool, db_expr_t, const char *);
 void db_mtcr_cmd(db_expr_t, bool, db_expr_t, const char *);
@@ -570,6 +572,66 @@ db_cp0dump_cmd(db_expr_t addr, bool have
 	}
 }
 
+
+static void
+show_cpuinfo(struct cpu_info *kci)
+{
+	struct cpu_info cpuinfobuf;
+	cpuid_t cpuid;
+	int i;
+
+	db_read_bytes((db_addr_t)kci, sizeof(cpuinfobuf), (char *));
+
+	struct cpu_info *ci = 
+	cpuid = ci->ci_cpuid;
+	db_printf("cpu_info=%p, cpu_name=%s\n", kci, ci->ci_cpuname);
+	db_printf("%p cpu[%lu].ci_cpuid = %lu\n",
+	>ci_cpuid, cpuid, ci->ci_cpuid);
+	db_printf("%p cpu[%lu].ci_curlwp= %p\n",
+	>ci_curlwp, cpuid, ci->ci_curlwp);
+	for (i = 0; i < SOFTINT_COUNT; i++) {
+		db_printf("%p cpu[%lu].ci_softlwps[%d]   = %p\n",
+		>ci_softlwps[i], cpuid, i, ci->ci_softlwps[i]);
+	}
+	db_printf("%p cpu[%lu].ci_want_resched  = %d\n",
+	>ci_want_resched, cpuid, ci->ci_want_resched);
+	db_printf("%p cpu[%lu].ci_cpl   = %d\n",
+	>ci_cpl, cpuid, ci->ci_cpl);
+	db_printf("%p cpu[%lu].ci_softints  = 0x%08x\n",
+	>ci_softints, cpuid, ci->ci_softints);
+	db_printf("%p cpu[%lu].ci_idepth= %u\n",
+	>ci_idepth, cpuid, ci->ci_idepth);
+}
+
+void
+db_cpuinfo_cmd(db_expr_t addr, bool have_addr, db_expr_t count,
+const char *modif)
+{
+#ifdef MULTIPROCESSOR
+	CPU_INFO_ITERATOR cii;
+	struct cpu_info *ci;
+	bool showall = false;
+
+	if (modif != NULL) {
+		for (; *modif != '\0'; modif++) {
+			switch (*modif) {
+			case 'a':
+showall = true;
+break;
+			}
+		}
+	}
+
+	if (showall) {
+		for (CPU_INFO_FOREACH(cii, ci)) {
+			show_cpuinfo(ci);
+		}
+	} else
+#endif /* MULTIPROCESSOR */
+		show_cpuinfo(curcpu());
+}
+
+
 #if (MIPS32 + MIPS32R2 + MIPS64 + MIPS64R2) > 0
 static void
 db_watch_cmd(db_expr_t address, bool have_addr, db_expr_t count,
@@ -827,6 +889,10 @@ const struct db_command db_machine_comma
 	{ DDB_ADD_CMD("cp0",	db_cp0dump_cmd,	0,
 		"Dump CP0 registers.",
 		NULL, NULL) },
+	{ DDB_ADD_CMD("cpuinfo", db_cpuinfo_cmd,	0,
+			"Displays the cpuinfo",
+		NULL, NULL)
+	},
 	{ DDB_ADD_CMD("kvtop",	db_kvtophys_cmd,	0,
 		"Print the physical address for a given kernel virtual address",
 		"address",



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

2022-01-15 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Jan 15 10:32:32 UTC 2022

Modified Files:
src/sys/arch/mips/mips: db_interface.c

Log Message:
Add 'mach cpuinfo' support


To generate a diff of this commit:
cvs rdiff -u -r1.95 -r1.96 src/sys/arch/mips/mips/db_interface.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

2022-01-15 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Jan 15 08:56:41 UTC 2022

Modified Files:
src/sys/arch/mips/mips: db_interface.c

Log Message:
sort


To generate a diff of this commit:
cvs rdiff -u -r1.94 -r1.95 src/sys/arch/mips/mips/db_interface.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/mips/mips/db_interface.c
diff -u src/sys/arch/mips/mips/db_interface.c:1.94 src/sys/arch/mips/mips/db_interface.c:1.95
--- src/sys/arch/mips/mips/db_interface.c:1.94	Sun May 23 23:22:55 2021
+++ src/sys/arch/mips/mips/db_interface.c	Sat Jan 15 08:56:41 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: db_interface.c,v 1.94 2021/05/23 23:22:55 dholland Exp $	*/
+/*	$NetBSD: db_interface.c,v 1.95 2022/01/15 08:56:41 skrll Exp $	*/
 
 /*
  * Mach Operating System
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: db_interface.c,v 1.94 2021/05/23 23:22:55 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_interface.c,v 1.95 2022/01/15 08:56:41 skrll Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_multiprocessor.h"
@@ -87,9 +87,9 @@ static void db_unwatch_cmd(db_expr_t, bo
 static void db_mach_cpu_cmd(db_expr_t, bool, db_expr_t, const char *);
 #endif
 
-void db_tlbdump_cmd(db_expr_t, bool, db_expr_t, const char *);
-void db_kvtophys_cmd(db_expr_t, bool, db_expr_t, const char *);
 void db_cp0dump_cmd(db_expr_t, bool, db_expr_t, const char *);
+void db_kvtophys_cmd(db_expr_t, bool, db_expr_t, const char *);
+void db_tlbdump_cmd(db_expr_t, bool, db_expr_t, const char *);
 #ifdef MIPS64_XLS
 void db_mfcr_cmd(db_expr_t, bool, db_expr_t, const char *);
 void db_mtcr_cmd(db_expr_t, bool, db_expr_t, const char *);



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

2022-01-15 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Jan 15 08:56:41 UTC 2022

Modified Files:
src/sys/arch/mips/mips: db_interface.c

Log Message:
sort


To generate a diff of this commit:
cvs rdiff -u -r1.94 -r1.95 src/sys/arch/mips/mips/db_interface.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

2022-01-15 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Jan 15 08:14:37 UTC 2022

Modified Files:
src/sys/arch/aarch64/include: pmap.h
src/sys/arch/arm/include/arm32: pmap.h

Log Message:
Remove unnecessary brackets


To generate a diff of this commit:
cvs rdiff -u -r1.50 -r1.51 src/sys/arch/aarch64/include/pmap.h
cvs rdiff -u -r1.171 -r1.172 src/sys/arch/arm/include/arm32/pmap.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/aarch64/include/pmap.h
diff -u src/sys/arch/aarch64/include/pmap.h:1.50 src/sys/arch/aarch64/include/pmap.h:1.51
--- src/sys/arch/aarch64/include/pmap.h:1.50	Fri Jan 14 07:21:53 2022
+++ src/sys/arch/aarch64/include/pmap.h	Sat Jan 15 08:14:37 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.h,v 1.50 2022/01/14 07:21:53 skrll Exp $ */
+/* $NetBSD: pmap.h,v 1.51 2022/01/15 08:14:37 skrll Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@
 #define	PMAP_TLB_NEED_SHOOTDOWN		1
 #endif
 
-#define	PMAP_TLB_FLUSH_ASID_ON_RESET	(true)
+#define	PMAP_TLB_FLUSH_ASID_ON_RESET	true
 
 /* Maximum number of ASIDs. Some CPUs have less.*/
 #define	PMAP_TLB_NUM_PIDS		65536

Index: src/sys/arch/arm/include/arm32/pmap.h
diff -u src/sys/arch/arm/include/arm32/pmap.h:1.171 src/sys/arch/arm/include/arm32/pmap.h:1.172
--- src/sys/arch/arm/include/arm32/pmap.h:1.171	Sat Oct 16 07:04:36 2021
+++ src/sys/arch/arm/include/arm32/pmap.h	Sat Jan 15 08:14:37 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.h,v 1.171 2021/10/16 07:04:36 skrll Exp $	*/
+/*	$NetBSD: pmap.h,v 1.172 2022/01/15 08:14:37 skrll Exp $	*/
 
 /*
  * Copyright (c) 2002, 2003 Wasabi Systems, Inc.
@@ -89,7 +89,7 @@
 #if PMAP_TLB_MAX > 1
 #define	PMAP_TLB_NEED_SHOOTDOWN		1
 #endif
-#define	PMAP_TLB_FLUSH_ASID_ON_RESET	(arm_has_tlbiasid_p)
+#define	PMAP_TLB_FLUSH_ASID_ON_RESET	arm_has_tlbiasid_p
 #define	PMAP_TLB_NUM_PIDS		256
 #define	cpu_set_tlb_info(ci, ti)((void)((ci)->ci_tlb_info = (ti)))
 #if PMAP_TLB_MAX > 1



CVS commit: src/sys/arch

2022-01-15 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Jan 15 08:14:37 UTC 2022

Modified Files:
src/sys/arch/aarch64/include: pmap.h
src/sys/arch/arm/include/arm32: pmap.h

Log Message:
Remove unnecessary brackets


To generate a diff of this commit:
cvs rdiff -u -r1.50 -r1.51 src/sys/arch/aarch64/include/pmap.h
cvs rdiff -u -r1.171 -r1.172 src/sys/arch/arm/include/arm32/pmap.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/aarch64/aarch64

2022-01-14 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Jan 15 07:39:04 UTC 2022

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

Log Message:
The translations that need invalidation are always last level so remove
the (dubious) logic around tracking the level.  The "any level" TLB
invalidation maintenance operation are used, but this may change after
further testing.

before
==
1661.0u 420.2s 2:53.82 1197.3% 231+29k 10+33918io 102pf+0w
1646.8u 425.2s 2:52.96 1198.0% 232+29k 1+33937io 49pf+0w
1647.9u 425.7s 2:52.58 1201.6% 232+29k 0+33940io 32pf+0w

After
=
1602.5u 420.8s 2:49.09 1196.6% 238+30k 24+33893io 54pf+0w
1600.7u 421.3s 2:51.53 1178.8% 238+30k 1+33914io 33pf+0w
1597.5u 424.3s 2:50.46 1186.1% 238+30k 0+33915io 17pf+0w

LGTM from ryo@


To generate a diff of this commit:
cvs rdiff -u -r1.123 -r1.124 src/sys/arch/aarch64/aarch64/pmap.c

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

Modified files:

Index: src/sys/arch/aarch64/aarch64/pmap.c
diff -u src/sys/arch/aarch64/aarch64/pmap.c:1.123 src/sys/arch/aarch64/aarch64/pmap.c:1.124
--- src/sys/arch/aarch64/aarch64/pmap.c:1.123	Fri Jan 14 07:21:53 2022
+++ src/sys/arch/aarch64/aarch64/pmap.c	Sat Jan 15 07:39:04 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.123 2022/01/14 07:21:53 skrll Exp $	*/
+/*	$NetBSD: pmap.c,v 1.124 2022/01/15 07:39:04 skrll Exp $	*/
 
 /*
  * Copyright (c) 2017 Ryo Shimizu 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.123 2022/01/14 07:21:53 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.124 2022/01/15 07:39:04 skrll Exp $");
 
 #include "opt_arm_debug.h"
 #include "opt_ddb.h"
@@ -160,21 +160,13 @@ PMAP_COUNTER(unwire_failure, "pmap_unwir
 
 /*
  * invalidate TLB entry for ASID and VA.
- * `ll' invalidates only the Last Level (usually L3) of TLB entry
  */
-#define AARCH64_TLBI_BY_ASID_VA(asid, va, ll)\
-	do {\
-		if ((ll)) {		\
-			if ((asid) == 0)\
-aarch64_tlbi_by_va_ll((va));		\
-			else		\
-aarch64_tlbi_by_asid_va_ll((asid), (va)); \
-		} else {		\
-			if ((asid) == 0)\
-aarch64_tlbi_by_va((va));		\
-			else		\
-aarch64_tlbi_by_asid_va((asid), (va));	\
-		}			\
+#define AARCH64_TLBI_BY_ASID_VA(asid, va)			\
+	do {			\
+		if ((asid) == 0)\
+			aarch64_tlbi_by_va((va));		\
+		else		\
+			aarch64_tlbi_by_asid_va((asid), (va));	\
 	} while (0/*CONSTCOND*/)
 
 /*
@@ -182,10 +174,10 @@ PMAP_COUNTER(unwire_failure, "pmap_unwir
  * change the pte to be accessible temporarily before cpu_icache_sync_range().
  * this macro modifies PTE (*ptep). need to update PTE after this.
  */
-#define PTE_ICACHE_SYNC_PAGE(pte, ptep, asid, va, ll)			\
+#define PTE_ICACHE_SYNC_PAGE(pte, ptep, asid, va)			\
 	do {\
 		atomic_swap_64((ptep), (pte) | LX_BLKPAG_AF);		\
-		AARCH64_TLBI_BY_ASID_VA((asid), (va), (ll));		\
+		AARCH64_TLBI_BY_ASID_VA((asid), (va));			\
 		cpu_icache_sync_range((va), PAGE_SIZE);			\
 	} while (0/*CONSTCOND*/)
 
@@ -202,7 +194,7 @@ static void _pmap_remove(struct pmap *, 
 struct pv_entry **);
 static int _pmap_enter(struct pmap *, vaddr_t, paddr_t, vm_prot_t, u_int, bool);
 static int _pmap_get_pdp(struct pmap *, vaddr_t, bool, int, paddr_t *,
-struct vm_page **, bool *);
+struct vm_page **);
 
 static struct pmap kernel_pmap __cacheline_aligned;
 
@@ -753,7 +745,6 @@ pmap_growkernel(vaddr_t maxkvaddr)
 {
 	struct pmap *pm = pmap_kernel();
 	struct vm_page *pg;
-	bool l3only = true;
 	int error;
 	vaddr_t va;
 	paddr_t pa;
@@ -764,7 +755,7 @@ pmap_growkernel(vaddr_t maxkvaddr)
 
 	mutex_enter(>pm_lock);
 	for (va = pmap_maxkvaddr & L2_FRAME; va <= maxkvaddr; va += L2_SIZE) {
-		error = _pmap_get_pdp(pm, va, false, 0, , , );
+		error = _pmap_get_pdp(pm, va, false, 0, , );
 		if (error != 0) {
 			panic("%s: cannot allocate L3 table error=%d",
 			__func__, error);
@@ -986,10 +977,10 @@ pmap_icache_sync_range(pmap_t pm, vaddr_
 			cpu_tlb_info(ci));
 
 			atomic_swap_64(ptep, pte | LX_BLKPAG_AF);
-			AARCH64_TLBI_BY_ASID_VA(pai->pai_asid, va, true);
+			AARCH64_TLBI_BY_ASID_VA(pai->pai_asid, va);
 			cpu_icache_sync_range(va, len);
 			atomic_swap_64(ptep, pte);
-			AARCH64_TLBI_BY_ASID_VA(pai->pai_asid, va, true);
+			AARCH64_TLBI_BY_ASID_VA(pai->pai_asid, va);
 		}
 	}
 
@@ -1311,8 +1302,7 @@ _pmap_protect_pv(struct pmap_page *pp, s
 	struct pmap * const pm = pv->pv_pmap;
 	struct pmap_asid_info * const pai = PMAP_PAI(pm, cpu_tlb_info(ci));
 
-	AARCH64_TLBI_BY_ASID_VA(pai->pai_asid, trunc_page(pv->pv_va),
-	true);
+	AARCH64_TLBI_BY_ASID_VA(pai->pai_asid, trunc_page(pv->pv_va));
 }
 
 void
@@ -1415,17 +1405,17 @@ pmap_protect(struct pmap *pm, vaddr_t sv
 
 			if (!l3pte_readable(pte)) {
 PTE_ICACHE_SYNC_PAGE(pte, ptep, pai->pai_asid,
-va, true);
+va);
 atomic_swap_64(ptep, pte);
-AARCH64_TLBI_BY_ASID_VA(pai->pai_asid, va, true);
+

CVS commit: src/sys/arch/aarch64/aarch64

2022-01-14 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Jan 15 07:39:04 UTC 2022

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

Log Message:
The translations that need invalidation are always last level so remove
the (dubious) logic around tracking the level.  The "any level" TLB
invalidation maintenance operation are used, but this may change after
further testing.

before
==
1661.0u 420.2s 2:53.82 1197.3% 231+29k 10+33918io 102pf+0w
1646.8u 425.2s 2:52.96 1198.0% 232+29k 1+33937io 49pf+0w
1647.9u 425.7s 2:52.58 1201.6% 232+29k 0+33940io 32pf+0w

After
=
1602.5u 420.8s 2:49.09 1196.6% 238+30k 24+33893io 54pf+0w
1600.7u 421.3s 2:51.53 1178.8% 238+30k 1+33914io 33pf+0w
1597.5u 424.3s 2:50.46 1186.1% 238+30k 0+33915io 17pf+0w

LGTM from ryo@


To generate a diff of this commit:
cvs rdiff -u -r1.123 -r1.124 src/sys/arch/aarch64/aarch64/pmap.c

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



CVS commit: src/sys/sys

2022-01-14 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Jan 15 07:11:26 UTC 2022

Modified Files:
src/sys/sys: bus_proto.h

Log Message:
Whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/sys/bus_proto.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/sys/bus_proto.h
diff -u src/sys/sys/bus_proto.h:1.13 src/sys/sys/bus_proto.h:1.14
--- src/sys/sys/bus_proto.h:1.13	Sun Jan 24 13:33:56 2021
+++ src/sys/sys/bus_proto.h	Sat Jan 15 07:11:26 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus_proto.h,v 1.13 2021/01/24 13:33:56 martin Exp $	*/
+/*	$NetBSD: bus_proto.h,v 1.14 2022/01/15 07:11:26 skrll Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2001, 2007 The NetBSD Foundation, Inc.
@@ -86,8 +86,8 @@ struct uio;
 #define	BUS_SPACE_MAP_PREFETCHABLE	0x04
 
 /* Bus read/write barrier methods. */
-#define	BUS_SPACE_BARRIER_READ	0x01		/* force read barrier */
-#define	BUS_SPACE_BARRIER_WRITE	0x02		/* force write barrier */
+#define	BUS_SPACE_BARRIER_READ		0x01	/* force read barrier */
+#define	BUS_SPACE_BARRIER_WRITE		0x02	/* force write barrier */
 
 int	bus_space_map(bus_space_tag_t, bus_addr_t, bus_size_t, int,
 		  bus_space_handle_t *);



CVS commit: src/sys/sys

2022-01-14 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Jan 15 07:11:26 UTC 2022

Modified Files:
src/sys/sys: bus_proto.h

Log Message:
Whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/sys/bus_proto.h

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



CVS commit: src/sys/dev/i2c

2022-01-14 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Jan 15 06:22:30 UTC 2022

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

Log Message:
Trailing whitespace


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

2022-01-14 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Jan 15 06:22:30 UTC 2022

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

Log Message:
Trailing whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/sys/dev/i2c/ihidev.c

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

Modified files:

Index: src/sys/dev/i2c/ihidev.c
diff -u src/sys/dev/i2c/ihidev.c:1.26 src/sys/dev/i2c/ihidev.c:1.27
--- src/sys/dev/i2c/ihidev.c:1.26	Fri Jan 14 22:28:59 2022
+++ src/sys/dev/i2c/ihidev.c	Sat Jan 15 06:22:30 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: ihidev.c,v 1.26 2022/01/14 22:28:59 riastradh Exp $ */
+/* $NetBSD: ihidev.c,v 1.27 2022/01/15 06:22:30 skrll Exp $ */
 /* $OpenBSD ihidev.c,v 1.13 2017/04/08 02:57:23 deraadt Exp $ */
 
 /*-
@@ -54,7 +54,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ihidev.c,v 1.26 2022/01/14 22:28:59 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ihidev.c,v 1.27 2022/01/15 06:22:30 skrll Exp $");
 
 #include 
 #include 
@@ -1025,7 +1025,7 @@ ihidev_acpi_get_info(struct ihidev_softc
 	if (ACPI_FAILURE(status)) {
 		aprint_error_dev(sc->sc_dev,
 		"failed to get HidDescriptorAddress: %s\n",
-		AcpiFormatException(status)); 
+		AcpiFormatException(status));
 		return false;
 	}
 



CVS commit: src/sys/dev/fdt

2022-01-13 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Jan 14 07:40:52 UTC 2022

Modified Files:
src/sys/dev/fdt: fdtvar.h

Log Message:
Formatting. NFCI.


To generate a diff of this commit:
cvs rdiff -u -r1.73 -r1.74 src/sys/dev/fdt/fdtvar.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/fdt/fdtvar.h
diff -u src/sys/dev/fdt/fdtvar.h:1.73 src/sys/dev/fdt/fdtvar.h:1.74
--- src/sys/dev/fdt/fdtvar.h:1.73	Sun Nov  7 17:13:53 2021
+++ src/sys/dev/fdt/fdtvar.h	Fri Jan 14 07:40:52 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: fdtvar.h,v 1.73 2021/11/07 17:13:53 jmcneill Exp $ */
+/* $NetBSD: fdtvar.h,v 1.74 2022/01/14 07:40:52 skrll Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill 
@@ -60,7 +60,7 @@ struct fdt_attach_args {
 };
 
 /* flags for fdtbus_intr_establish */
-#define FDT_INTR_MPSAFE	__BIT(0)
+#define FDT_INTR_MPSAFE			__BIT(0)
 
 /* Interrupt trigger types defined by the FDT "interrupts" bindings. */
 #define	FDT_INTR_TYPE_POS_EDGE		__BIT(0)
@@ -321,8 +321,10 @@ int		fdtbus_get_phandle(int, const char 
 int		fdtbus_get_phandle_with_data(int, const char *, const char *,
 		int, struct fdt_phandle_data *);
 int		fdtbus_get_phandle_from_native(int);
+
 i2c_tag_t	fdtbus_get_i2c_tag(int);
 i2c_tag_t	fdtbus_i2c_acquire(int, const char *);
+
 void *		fdtbus_intr_establish(int, u_int, int, int,
 		int (*func)(void *), void *arg);
 void *		fdtbus_intr_establish_xname(int, u_int, int, int,
@@ -337,18 +339,24 @@ void		fdtbus_intr_disestablish(int, void
 bool		fdtbus_intr_str(int, u_int, char *, size_t);
 bool		fdtbus_intr_str_raw(int, const u_int *, char *, size_t);
 int		fdtbus_intr_parent(int);
+
 int		fdtbus_gpio_count(int, const char *);
-struct fdtbus_gpio_pin *fdtbus_gpio_acquire(int, const char *, int);
-struct fdtbus_gpio_pin *fdtbus_gpio_acquire_index(int, const char *, int, int);
+struct fdtbus_gpio_pin *
+		fdtbus_gpio_acquire(int, const char *, int);
+struct fdtbus_gpio_pin *
+		fdtbus_gpio_acquire_index(int, const char *, int, int);
 void		fdtbus_gpio_release(struct fdtbus_gpio_pin *);
 int		fdtbus_gpio_read(struct fdtbus_gpio_pin *);
 void		fdtbus_gpio_write(struct fdtbus_gpio_pin *, int);
 int		fdtbus_gpio_read_raw(struct fdtbus_gpio_pin *);
 void		fdtbus_gpio_write_raw(struct fdtbus_gpio_pin *, int);
+
 audio_dai_tag_t	fdtbus_dai_acquire(int, const char *);
 audio_dai_tag_t	fdtbus_dai_acquire_index(int, const char *, int);
+
 pwm_tag_t	fdtbus_pwm_acquire(int, const char *);
 pwm_tag_t	fdtbus_pwm_acquire_index(int, const char *, int);
+
 int		fdtbus_pinctrl_set_config_index(int, u_int);
 int		fdtbus_pinctrl_set_config(int, const char *);
 bool		fdtbus_pinctrl_has_config(int, const char *);
@@ -360,7 +368,9 @@ int		fdtbus_pinctrl_parse_bias(int, int 
 int		fdtbus_pinctrl_parse_drive(int);
 int		fdtbus_pinctrl_parse_drive_strength(int);
 int		fdtbus_pinctrl_parse_input_output(int, int *);
-struct fdtbus_regulator *fdtbus_regulator_acquire(int, const char *);
+
+struct fdtbus_regulator *
+		fdtbus_regulator_acquire(int, const char *);
 void		fdtbus_regulator_release(struct fdtbus_regulator *);
 int		fdtbus_regulator_enable(struct fdtbus_regulator *);
 int		fdtbus_regulator_disable(struct fdtbus_regulator *);
@@ -370,13 +380,17 @@ int		fdtbus_regulator_get_voltage(struct
 		u_int *);
 int		fdtbus_regulator_supports_voltage(struct fdtbus_regulator *,
 		u_int, u_int);
+
 struct syscon *	fdtbus_syscon_acquire(int, const char *);
 struct syscon *	fdtbus_syscon_lookup(int);
+
 bus_dma_tag_t	fdtbus_iommu_map(int, u_int, bus_dma_tag_t);
 bus_dma_tag_t	fdtbus_iommu_map_pci(int, uint32_t, bus_dma_tag_t);
 
-struct fdtbus_dma *fdtbus_dma_get(int, const char *, void (*)(void *), void *);
-struct fdtbus_dma *fdtbus_dma_get_index(int, u_int, void (*)(void *),
+struct fdtbus_dma *
+		fdtbus_dma_get(int, const char *, void (*)(void *), void *);
+struct fdtbus_dma *
+		fdtbus_dma_get_index(int, u_int, void (*)(void *),
 		void *);
 void		fdtbus_dma_put(struct fdtbus_dma *);
 int		fdtbus_dma_transfer(struct fdtbus_dma *,
@@ -391,19 +405,24 @@ u_int		fdtbus_clock_count(int, const cha
 int		fdtbus_clock_enable(int, const char *, bool);
 int		fdtbus_clock_enable_index(int, u_int, bool);
 
-struct fdtbus_reset *fdtbus_reset_get(int, const char *);
-struct fdtbus_reset *fdtbus_reset_get_index(int, u_int);
+struct fdtbus_reset *
+		fdtbus_reset_get(int, const char *);
+struct fdtbus_reset *
+		fdtbus_reset_get_index(int, u_int);
 void		fdtbus_reset_put(struct fdtbus_reset *);
 int		fdtbus_reset_assert(struct fdtbus_reset *);
 int		fdtbus_reset_deassert(struct fdtbus_reset *);
 
-struct fdtbus_phy *fdtbus_phy_get(int, const char *);
-struct fdtbus_phy *fdtbus_phy_get_index(int, u_int);
+struct fdtbus_phy *
+		fdtbus_phy_get(int, const char *);
+struct fdtbus_phy *
+		fdtbus_phy_get_index(int, u_int);
 void		fdtbus_phy_put(struct fdtbus_phy *);
 device_t	fdtbus_phy_device(struct fdtbus_phy *);
 

CVS commit: src/sys/dev/fdt

2022-01-13 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Jan 14 07:40:52 UTC 2022

Modified Files:
src/sys/dev/fdt: fdtvar.h

Log Message:
Formatting. NFCI.


To generate a diff of this commit:
cvs rdiff -u -r1.73 -r1.74 src/sys/dev/fdt/fdtvar.h

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



CVS commit: src/tests/libexec/ld.elf_so

2022-01-13 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Jan 14 07:34:07 UTC 2022

Modified Files:
src/tests/libexec/ld.elf_so: t_dlerror-false.c

Log Message:
Trailing whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/libexec/ld.elf_so/t_dlerror-false.c

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

Modified files:

Index: src/tests/libexec/ld.elf_so/t_dlerror-false.c
diff -u src/tests/libexec/ld.elf_so/t_dlerror-false.c:1.2 src/tests/libexec/ld.elf_so/t_dlerror-false.c:1.3
--- src/tests/libexec/ld.elf_so/t_dlerror-false.c:1.2	Fri Jan 13 21:30:42 2017
+++ src/tests/libexec/ld.elf_so/t_dlerror-false.c	Fri Jan 14 07:34:07 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_dlerror-false.c,v 1.2 2017/01/13 21:30:42 christos Exp $	*/
+/*	$NetBSD: t_dlerror-false.c,v 1.3 2022/01/14 07:34:07 skrll Exp $	*/
 
 /*
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -46,9 +46,9 @@ ATF_TC_BODY(rtld_dlerror_false, tc)
 {
 	void *handle, *sym;
 	char *error;
-	
+
 	/*
-	 * 
+	 *
 	 * Test for dlerror() being set by a successful library open.
 	 * Requires that the rpath be set to something that does not
 	 * include libm.so.
@@ -58,7 +58,7 @@ ATF_TC_BODY(rtld_dlerror_false, tc)
 	error = dlerror();
 	ATF_CHECK(error == NULL);
 	ATF_CHECK(handle != NULL);
-	
+
 	sym = dlsym(handle, "sin");
 	error = dlerror();
 	ATF_CHECK(sym != NULL);
@@ -68,7 +68,7 @@ ATF_TC_BODY(rtld_dlerror_false, tc)
 	error = dlerror();
 
 	ATF_CHECK(error == NULL);
-	
+
 }
 
 ATF_TP_ADD_TCS(tp)



CVS commit: src/tests/libexec/ld.elf_so

2022-01-13 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Jan 14 07:34:07 UTC 2022

Modified Files:
src/tests/libexec/ld.elf_so: t_dlerror-false.c

Log Message:
Trailing whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/libexec/ld.elf_so/t_dlerror-false.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/aarch64

2022-01-13 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Jan 14 07:21:53 UTC 2022

Modified Files:
src/sys/arch/aarch64/aarch64: pmap.c
src/sys/arch/aarch64/include: pmap.h

Log Message:
Restore the previous pmap_remove_all behaviour as the new method meant
the n1sdp couldn't complete a build.

No noticeable change in kernel build performance.


To generate a diff of this commit:
cvs rdiff -u -r1.122 -r1.123 src/sys/arch/aarch64/aarch64/pmap.c
cvs rdiff -u -r1.49 -r1.50 src/sys/arch/aarch64/include/pmap.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/aarch64/aarch64/pmap.c
diff -u src/sys/arch/aarch64/aarch64/pmap.c:1.122 src/sys/arch/aarch64/aarch64/pmap.c:1.123
--- src/sys/arch/aarch64/aarch64/pmap.c:1.122	Tue Jan  4 05:55:45 2022
+++ src/sys/arch/aarch64/aarch64/pmap.c	Fri Jan 14 07:21:53 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.122 2022/01/04 05:55:45 skrll Exp $	*/
+/*	$NetBSD: pmap.c,v 1.123 2022/01/14 07:21:53 skrll Exp $	*/
 
 /*
  * Copyright (c) 2017 Ryo Shimizu 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.122 2022/01/04 05:55:45 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.123 2022/01/14 07:21:53 skrll Exp $");
 
 #include "opt_arm_debug.h"
 #include "opt_ddb.h"
@@ -1511,7 +1511,6 @@ pmap_create(void)
 
 	kcpuset_create(>pm_active, true);
 	kcpuset_create(>pm_onproc, true);
-	pm->pm_remove_all = false;
 
 	pm->pm_l0table_pa = pmap_alloc_pdp(pm, NULL, 0, true);
 	KASSERT(pm->pm_l0table_pa != POOL_PADDR_INVALID);
@@ -1531,9 +1530,8 @@ pmap_destroy(struct pmap *pm)
 	unsigned int refcnt;
 
 	UVMHIST_FUNC(__func__);
-	UVMHIST_CALLARGS(pmaphist,
-	"pm=%p, pm_l0table=%016lx, pm_remove_all=%jd, refcnt=%jd",
-	pm, pm->pm_l0table, pm->pm_remove_all, pm->pm_refcnt);
+	UVMHIST_CALLARGS(pmaphist, "pm=%p, pm_l0table=%016lx, refcnt=%jd",
+	pm, pm->pm_l0table, pm->pm_refcnt, 0);
 
 	if (pm == NULL)
 		return;
@@ -1541,16 +1539,12 @@ pmap_destroy(struct pmap *pm)
 	if (pm == pmap_kernel())
 		panic("cannot destroy kernel pmap");
 
-	if (pm->pm_remove_all) {
-		pmap_tlb_asid_release_all(pm);
-		pm->pm_remove_all = false;
-	}
-
 	refcnt = atomic_dec_uint_nv(>pm_refcnt);
 	if (refcnt > 0)
 		return;
 
 	KASSERT(LIST_EMPTY(>pm_pvlist));
+	pmap_tlb_asid_release_all(pm);
 
 	_pmap_free_pdp_all(pm, true);
 	mutex_destroy(>pm_lock);
@@ -2054,41 +2048,6 @@ pmap_enter(struct pmap *pm, vaddr_t va, 
 }
 
 
-
-void
-pmap_update(pmap_t pm)
-{
-
-	UVMHIST_FUNC(__func__);
-	UVMHIST_CALLARGS(maphist, "pm=%#jx remove_all %jd", (uintptr_t)pm,
-	pm->pm_remove_all, 0, 0);
-
-	kpreempt_disable();
-	/*
-	 * If pmap_remove_all was called, we deactivated ourselves and released
-	 * our ASID.  Now we have to reactivate ourselves.
-	 */
-	if (__predict_false(pm->pm_remove_all)) {
-		pm->pm_remove_all = false;
-
-		KASSERT(pm != pmap_kernel());
-
-		/* this calls tlb_set_asid which calls cpu_set_ttbr0 */
-		pmap_tlb_asid_acquire(pm, curlwp);
-
-		/* Enable translation table walks using TTBR0 */
-		uint64_t tcr = reg_tcr_el1_read();
-		reg_tcr_el1_write(tcr & ~TCR_EPD0);
-		isb();
-
-		pm->pm_activated = true;
-	}
-
-	kpreempt_enable();
-
-	UVMHIST_LOG(maphist, "  <-- done", 0, 0, 0, 0);
-}
-
 bool
 pmap_remove_all(struct pmap *pm)
 {
@@ -2102,23 +2061,6 @@ pmap_remove_all(struct pmap *pm)
 
 	KASSERT(pm != pmap_kernel());
 
-	struct cpu_info * const ci = curcpu();
-	// This should be the last CPU with this pmap onproc
-	KASSERT(!kcpuset_isotherset(pm->pm_onproc, cpu_index(ci)));
-	if (kcpuset_isset(pm->pm_onproc, cpu_index(ci))) {
-		/* Disable translation table walks using TTBR0 */
-		uint64_t tcr = reg_tcr_el1_read();
-		reg_tcr_el1_write(tcr | TCR_EPD0);
-		isb();
-
-		pmap_tlb_asid_deactivate(pm);
-	}
-
-	KASSERT(kcpuset_iszero(pm->pm_onproc));
-
-	pmap_tlb_asid_release_all(pm);
-	pm->pm_remove_all = true;
-
 	UVMHIST_LOG(pmaphist, "pm=%p, asid=%d", pm,
 	PMAP_PAI(pm, cpu_tlb_info(ci))->pai_asid, 0, 0);
 
@@ -2155,6 +2097,8 @@ pmap_remove_all(struct pmap *pm)
 	/* clear L0 page table page */
 	pmap_zero_page(pm->pm_l0table_pa);
 
+	aarch64_tlbi_by_asid(PMAP_PAI(pm, cpu_tlb_info(ci))->pai_asid);
+
 	/* free L1-L3 page table pages, but not L0 */
 	_pmap_free_pdp_all(pm, false);
 

Index: src/sys/arch/aarch64/include/pmap.h
diff -u src/sys/arch/aarch64/include/pmap.h:1.49 src/sys/arch/aarch64/include/pmap.h:1.50
--- src/sys/arch/aarch64/include/pmap.h:1.49	Sun Oct 10 07:15:25 2021
+++ src/sys/arch/aarch64/include/pmap.h	Fri Jan 14 07:21:53 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.h,v 1.49 2021/10/10 07:15:25 skrll Exp $ */
+/* $NetBSD: pmap.h,v 1.50 2022/01/14 07:21:53 skrll Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -125,7 +125,6 @@ struct pmap {
 
 	struct pmap_asid_info pm_pai[PMAP_TLB_MAX];
 	bool pm_activated;
-	bool pm_remove_all;
 };
 
 static inline paddr_t
@@ -384,6 +383,7 @@ aarch64_mmap_flags(paddr_t mdpgno)
 

CVS commit: src/sys/arch/aarch64

2022-01-13 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Jan 14 07:21:53 UTC 2022

Modified Files:
src/sys/arch/aarch64/aarch64: pmap.c
src/sys/arch/aarch64/include: pmap.h

Log Message:
Restore the previous pmap_remove_all behaviour as the new method meant
the n1sdp couldn't complete a build.

No noticeable change in kernel build performance.


To generate a diff of this commit:
cvs rdiff -u -r1.122 -r1.123 src/sys/arch/aarch64/aarch64/pmap.c
cvs rdiff -u -r1.49 -r1.50 src/sys/arch/aarch64/include/pmap.h

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



CVS commit: src

2022-01-13 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu Jan 13 08:25:24 UTC 2022

Modified Files:
src/distrib/hppa/ramdisk: Makefile
src/sys/arch/hppa/conf: RAMDISK

Log Message:
bump


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/distrib/hppa/ramdisk/Makefile
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/hppa/conf/RAMDISK

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

Modified files:

Index: src/distrib/hppa/ramdisk/Makefile
diff -u src/distrib/hppa/ramdisk/Makefile:1.7 src/distrib/hppa/ramdisk/Makefile:1.8
--- src/distrib/hppa/ramdisk/Makefile:1.7	Sun Dec 29 18:26:17 2019
+++ src/distrib/hppa/ramdisk/Makefile	Thu Jan 13 08:25:24 2022
@@ -1,10 +1,10 @@
-#	$NetBSD: Makefile,v 1.7 2019/12/29 18:26:17 christos Exp $
+#	$NetBSD: Makefile,v 1.8 2022/01/13 08:25:24 skrll Exp $
 
 .include 
 .include "${NETBSDSRCDIR}/distrib/common/Makefile.distrib"
 
 IMAGE=		ramdisk.fs
-IMAGESIZE=	3060k
+IMAGESIZE=	3300k
 MAKEFS_FLAGS+=	-f 15
 
 WARNS=		1

Index: src/sys/arch/hppa/conf/RAMDISK
diff -u src/sys/arch/hppa/conf/RAMDISK:1.3 src/sys/arch/hppa/conf/RAMDISK:1.4
--- src/sys/arch/hppa/conf/RAMDISK:1.3	Mon Nov  4 00:59:31 2019
+++ src/sys/arch/hppa/conf/RAMDISK	Thu Jan 13 08:25:24 2022
@@ -1,4 +1,4 @@
-# $NetBSD: RAMDISK,v 1.3 2019/11/04 00:59:31 christos Exp $
+# $NetBSD: RAMDISK,v 1.4 2022/01/13 08:25:24 skrll Exp $
 #
 # RAMDISK machine description file
 #
@@ -9,6 +9,6 @@ include 	"arch/hppa/conf/GENERIC"
 options 	MEMORY_DISK_HOOKS
 options 	MEMORY_DISK_IS_ROOT	# force root on memory disk
 options 	MEMORY_DISK_SERVER=0	# no userspace memory disk support
-options 	MEMORY_DISK_ROOT_SIZE=6120	# size of memory disk, in blocks
+options 	MEMORY_DISK_ROOT_SIZE=6600	# size of memory disk, in blocks
 options 	MEMORY_DISK_RBFLAGS=RB_SINGLE	# boot in single-user mode
 



CVS commit: src

2022-01-13 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu Jan 13 08:25:24 UTC 2022

Modified Files:
src/distrib/hppa/ramdisk: Makefile
src/sys/arch/hppa/conf: RAMDISK

Log Message:
bump


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/distrib/hppa/ramdisk/Makefile
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/hppa/conf/RAMDISK

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



CVS commit: src/distrib/sets/lists/base

2022-01-09 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon Jan 10 06:00:00 UTC 2022

Modified Files:
src/distrib/sets/lists/base: md.alpha

Log Message:
Fix alpha build


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 src/distrib/sets/lists/base/md.alpha

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

Modified files:

Index: src/distrib/sets/lists/base/md.alpha
diff -u src/distrib/sets/lists/base/md.alpha:1.43 src/distrib/sets/lists/base/md.alpha:1.44
--- src/distrib/sets/lists/base/md.alpha:1.43	Sun Jan  9 18:11:09 2022
+++ src/distrib/sets/lists/base/md.alpha	Mon Jan 10 06:00:00 2022
@@ -1,4 +1,4 @@
-# $NetBSD: md.alpha,v 1.43 2022/01/09 18:11:09 martin Exp $
+# $NetBSD: md.alpha,v 1.44 2022/01/10 06:00:00 skrll Exp $
 ./usr/bin/fdformatbase-util-bin
 ./usr/lib/libalpha.sobase-sys-shlib
 ./usr/lib/libalpha.so.0base-sys-shlib
@@ -19,7 +19,7 @@
 ./usr/mdec/setnetbootinfo			base-sysutil-bin
 ./usr/mdec/ustarbootbase-sysutil-bin
 ./usr/sbin/bad144base-sysutil-bin
-./usr/share/sysinst/catalog/sysinstmsgs.de	base-util-share		share
-./usr/share/sysinst/catalog/sysinstmsgs.es	base-util-share		share
-./usr/share/sysinst/catalog/sysinstmsgs.fr	base-util-share		share
-./usr/share/sysinst/catalog/sysinstmsgs.pl	base-util-share		share
+./usr/share/sysinst/catalog/sysinstmsgs.de	base-util-share
+./usr/share/sysinst/catalog/sysinstmsgs.es	base-util-share
+./usr/share/sysinst/catalog/sysinstmsgs.fr	base-util-share
+./usr/share/sysinst/catalog/sysinstmsgs.pl	base-util-share



CVS commit: src/distrib/sets/lists/base

2022-01-09 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon Jan 10 06:00:00 UTC 2022

Modified Files:
src/distrib/sets/lists/base: md.alpha

Log Message:
Fix alpha build


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 src/distrib/sets/lists/base/md.alpha

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



CVS commit: src/distrib/sets/lists/debug

2022-01-08 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Jan  9 07:45:05 UTC 2022

Modified Files:
src/distrib/sets/lists/debug: ad.arm ad.mipseb ad.mipsel

Log Message:
Use comp-sysutil-debug (not sysutils)


To generate a diff of this commit:
cvs rdiff -u -r1.79 -r1.80 src/distrib/sets/lists/debug/ad.arm
cvs rdiff -u -r1.4 -r1.5 src/distrib/sets/lists/debug/ad.mipseb \
src/distrib/sets/lists/debug/ad.mipsel

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

Modified files:

Index: src/distrib/sets/lists/debug/ad.arm
diff -u src/distrib/sets/lists/debug/ad.arm:1.79 src/distrib/sets/lists/debug/ad.arm:1.80
--- src/distrib/sets/lists/debug/ad.arm:1.79	Mon Jan  3 16:43:32 2022
+++ src/distrib/sets/lists/debug/ad.arm	Sun Jan  9 07:45:05 2022
@@ -1,4 +1,4 @@
-# $NetBSD: ad.arm,v 1.79 2022/01/03 16:43:32 christos Exp $
+# $NetBSD: ad.arm,v 1.80 2022/01/09 07:45:05 skrll Exp $
 ./usr/lib/libarm_g.acomp-c-debuglib		debuglib,compatfile
 ./usr/lib/libc_vfp_g.acomp-c-debuglib		debuglib,softfloat
 ./usr/lib/libpmc_g.acomp-obsolete		obsolete
@@ -27,30 +27,30 @@
 ./usr/libdata/debug/usr/sbin/sbkeygen.debug	comp-util-debug		debug,endian=1234
 ./usr/libdata/debug/usr/sbin/sbtool.debug	comp-util-debug		debug,endian=1234
 ./usr/libdata/debug/usr/sbin/tpctl.debug	comp-sysutil-debug	debug
-./usr/libdata/debug/netbsd-fxp0-ADI_BRH.debug	comp-sysutils-debug	debug,machine_arch=earmv5
-./usr/libdata/debug/netbsd-fxp0-IQ80310.debug	comp-sysutils-debug	debug,machine_arch=earmv5
-./usr/libdata/debug/netbsd-mvgbe0-MV2120.debug	comp-sysutils-debug	debug,machine_arch=earmv5
-./usr/libdata/debug/netbsd-ne0-TWINTAIL.debug	comp-sysutils-debug	debug,machine_arch=earmv5
-./usr/libdata/debug/netbsd-sd0-ADI_BRH.debug	comp-sysutils-debug	debug,machine_arch=earmv5
-./usr/libdata/debug/netbsd-sd0-CP3100.debug	comp-sysutils-debug	debug,machine_arch=earmv5
-./usr/libdata/debug/netbsd-sd0-IQ80310.debug	comp-sysutils-debug	debug,machine_arch=earmv5
-./usr/libdata/debug/netbsd-sd0-IQ80321.debug	comp-sysutils-debug	debug,machine_arch=earmv5
-./usr/libdata/debug/netbsd-sd0-TEAMASA_NPWR.debug	comp-sysutils-debug	debug,machine_arch=earmv5
-./usr/libdata/debug/netbsd-sm0-GUMSTIX.debug	comp-sysutils-debug	debug,machine_arch=earmv5
-./usr/libdata/debug/netbsd-smsh0-GUMSTIX.debug	comp-sysutils-debug	debug,machine_arch=earmv5
-./usr/libdata/debug/netbsd-wd0-ADI_BRH.debug	comp-sysutils-debug	debug,machine_arch=earmv5
-./usr/libdata/debug/netbsd-wd0-CP3100.debug	comp-sysutils-debug	debug,machine_arch=earmv5
-./usr/libdata/debug/netbsd-wd0-IQ80310.debug	comp-sysutils-debug	debug,machine_arch=earmv5
-./usr/libdata/debug/netbsd-wd0-IQ80321.debug	comp-sysutils-debug	debug,machine_arch=earmv5
-./usr/libdata/debug/netbsd-wd0-KUROBOX_PRO.debug	comp-sysutils-debug	debug,machine_arch=earmv5
-./usr/libdata/debug/netbsd-wd0e-MV2120.debug	comp-sysutils-debug	debug,machine_arch=earmv5
-./usr/libdata/debug/netbsd-wd0f-MV2120.debug	comp-sysutils-debug	debug,machine_arch=earmv5
-./usr/libdata/debug/netbsd-wd0g-MV2120.debug	comp-sysutils-debug	debug,machine_arch=earmv5
-./usr/libdata/debug/netbsd-wd0h-MV2120.debug	comp-sysutils-debug	debug,machine_arch=earmv5
-./usr/libdata/debug/netbsd-wm0-CP3100.debug	comp-sysutils-debug	debug,machine_arch=earmv5
-./usr/libdata/debug/netbsd-wm0-IQ80321.debug	comp-sysutils-debug	debug,machine_arch=earmv5
-./usr/libdata/debug/netbsd-wm0-TEAMASA_NPWR.debug	comp-sysutils-debug	debug,machine_arch=earmv5
-./usr/libdata/debug/netbsd-fxp0-ADI_BRH.debug	comp-sysutils-debug	debug,machine_arch=earmv5eb
-./usr/libdata/debug/netbsd-sd0-ADI_BRH.debug	comp-sysutils-debug	debug,machine_arch=earmv5eb
-./usr/libdata/debug/netbsd-wd0-ADI_BRH.debug	comp-sysutils-debug	debug,machine_arch=earmv5eb
-./usr/libdata/debug/netbsd-wd0-KUROBOX_PRO.debug	comp-sysutils-debug	debug,machine_arch=earmv5eb
+./usr/libdata/debug/netbsd-fxp0-ADI_BRH.debug	comp-sysutil-debug	debug,machine_arch=earmv5
+./usr/libdata/debug/netbsd-fxp0-IQ80310.debug	comp-sysutil-debug	debug,machine_arch=earmv5
+./usr/libdata/debug/netbsd-mvgbe0-MV2120.debug	comp-sysutil-debug	debug,machine_arch=earmv5
+./usr/libdata/debug/netbsd-ne0-TWINTAIL.debug	comp-sysutil-debug	debug,machine_arch=earmv5
+./usr/libdata/debug/netbsd-sd0-ADI_BRH.debug	comp-sysutil-debug	debug,machine_arch=earmv5
+./usr/libdata/debug/netbsd-sd0-CP3100.debug	comp-sysutil-debug	debug,machine_arch=earmv5
+./usr/libdata/debug/netbsd-sd0-IQ80310.debug	comp-sysutil-debug	debug,machine_arch=earmv5
+./usr/libdata/debug/netbsd-sd0-IQ80321.debug	comp-sysutil-debug	debug,machine_arch=earmv5
+./usr/libdata/debug/netbsd-sd0-TEAMASA_NPWR.debug	comp-sysutil-debug	debug,machine_arch=earmv5
+./usr/libdata/debug/netbsd-sm0-GUMSTIX.debug	comp-sysutil-debug	debug,machine_arch=earmv5
+./usr/libdata/debug/netbsd-smsh0-GUMSTIX.debug	comp-sysutil-debug	debug,machine_arch=earmv5
+./usr/libdata/debug/netbsd-wd0-ADI_BRH.debug	comp-sysutil-debug	

CVS commit: src/distrib/sets/lists/debug

2022-01-08 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Jan  9 07:45:05 UTC 2022

Modified Files:
src/distrib/sets/lists/debug: ad.arm ad.mipseb ad.mipsel

Log Message:
Use comp-sysutil-debug (not sysutils)


To generate a diff of this commit:
cvs rdiff -u -r1.79 -r1.80 src/distrib/sets/lists/debug/ad.arm
cvs rdiff -u -r1.4 -r1.5 src/distrib/sets/lists/debug/ad.mipseb \
src/distrib/sets/lists/debug/ad.mipsel

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



CVS commit: src/distrib/sets/lists/debug

2022-01-08 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Jan  9 07:38:33 UTC 2022

Modified Files:
src/distrib/sets/lists/debug: ad.mipseb

Log Message:
Remove unnecessary machine=emips item - it was added to
distrib/sets/lists/debug/md.emips


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/distrib/sets/lists/debug/ad.mipseb

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

Modified files:

Index: src/distrib/sets/lists/debug/ad.mipseb
diff -u src/distrib/sets/lists/debug/ad.mipseb:1.3 src/distrib/sets/lists/debug/ad.mipseb:1.4
--- src/distrib/sets/lists/debug/ad.mipseb:1.3	Sat Jan  8 14:28:14 2022
+++ src/distrib/sets/lists/debug/ad.mipseb	Sun Jan  9 07:38:33 2022
@@ -1,6 +1,5 @@
-# $NetBSD: ad.mipseb,v 1.3 2022/01/08 14:28:14 christos Exp $
+# $NetBSD: ad.mipseb,v 1.4 2022/01/09 07:38:33 skrll Exp $
 ./usr/libdata/debug/usr/bin/elf2ecoff.debug	comp-sysutils-debug	debug
 ./usr/libdata/debug/netbsd-aumac0-ALCHEMY.debug	comp-sysutils-debug	debug
 ./usr/libdata/debug/netbsd-aumac0-DBAU1500.debug	comp-sysutils-debug	debug
 ./usr/libdata/debug/netbsd-aumac0-DBAU1550.debug	comp-sysutils-debug	debug
-./usr/libdata/debug/nfsnetbsd-RAMDISK.debug	comp-sysutils-debug	debug,machine=emips



CVS commit: src/distrib/sets/lists/debug

2022-01-08 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Jan  9 07:38:33 UTC 2022

Modified Files:
src/distrib/sets/lists/debug: ad.mipseb

Log Message:
Remove unnecessary machine=emips item - it was added to
distrib/sets/lists/debug/md.emips


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/distrib/sets/lists/debug/ad.mipseb

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



CVS commit: src/sys/arch/cats

2022-01-08 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Jan  8 09:02:47 UTC 2022

Modified Files:
src/sys/arch/cats/cats: cats_machdep.c
src/sys/arch/cats/conf: files.cats

Log Message:
defflag FCOM_INIT_ARM


To generate a diff of this commit:
cvs rdiff -u -r1.92 -r1.93 src/sys/arch/cats/cats/cats_machdep.c
cvs rdiff -u -r1.38 -r1.39 src/sys/arch/cats/conf/files.cats

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



CVS commit: src/sys/arch/cats

2022-01-08 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Jan  8 09:02:47 UTC 2022

Modified Files:
src/sys/arch/cats/cats: cats_machdep.c
src/sys/arch/cats/conf: files.cats

Log Message:
defflag FCOM_INIT_ARM


To generate a diff of this commit:
cvs rdiff -u -r1.92 -r1.93 src/sys/arch/cats/cats/cats_machdep.c
cvs rdiff -u -r1.38 -r1.39 src/sys/arch/cats/conf/files.cats

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/cats/cats/cats_machdep.c
diff -u src/sys/arch/cats/cats/cats_machdep.c:1.92 src/sys/arch/cats/cats/cats_machdep.c:1.93
--- src/sys/arch/cats/cats/cats_machdep.c:1.92	Fri Aug 27 09:29:05 2021
+++ src/sys/arch/cats/cats/cats_machdep.c	Sat Jan  8 09:02:47 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: cats_machdep.c,v 1.92 2021/08/27 09:29:05 skrll Exp $	*/
+/*	$NetBSD: cats_machdep.c,v 1.93 2022/01/08 09:02:47 skrll Exp $	*/
 
 /*
  * Copyright (c) 1997,1998 Mark Brinicombe.
@@ -40,9 +40,10 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cats_machdep.c,v 1.92 2021/08/27 09:29:05 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cats_machdep.c,v 1.93 2022/01/08 09:02:47 skrll Exp $");
 
 #include "opt_arm_debug.h"
+#include "opt_cats.h"
 #include "opt_ddb.h"
 #include "opt_modular.h"
 

Index: src/sys/arch/cats/conf/files.cats
diff -u src/sys/arch/cats/conf/files.cats:1.38 src/sys/arch/cats/conf/files.cats:1.39
--- src/sys/arch/cats/conf/files.cats:1.38	Fri Apr  4 07:33:53 2014
+++ src/sys/arch/cats/conf/files.cats	Sat Jan  8 09:02:47 2022
@@ -1,4 +1,4 @@
-#	$NetBSD: files.cats,v 1.38 2014/04/04 07:33:53 skrll Exp $
+#	$NetBSD: files.cats,v 1.39 2022/01/08 09:02:47 skrll Exp $
 #
 # CATS-specific configuration info
 #
@@ -19,6 +19,7 @@ defflag	XSERVER
 # ABLE booting ELF kernels
 defflag ABLEELF
 
+defflag opt_cats.h	FCOM_INIT_ARM
 #
 # ISA and mixed ISA+EISA or ISA+PCI drivers
 #



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

2022-01-08 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Jan  8 09:01:00 UTC 2022

Modified Files:
src/sys/arch/arm/arm: undefined.c

Log Message:
KNF


To generate a diff of this commit:
cvs rdiff -u -r1.73 -r1.74 src/sys/arch/arm/arm/undefined.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/arm/undefined.c
diff -u src/sys/arch/arm/arm/undefined.c:1.73 src/sys/arch/arm/arm/undefined.c:1.74
--- src/sys/arch/arm/arm/undefined.c:1.73	Sat Jan  8 09:00:23 2022
+++ src/sys/arch/arm/arm/undefined.c	Sat Jan  8 09:01:00 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: undefined.c,v 1.73 2022/01/08 09:00:23 skrll Exp $	*/
+/*	$NetBSD: undefined.c,v 1.74 2022/01/08 09:01:00 skrll Exp $	*/
 
 /*
  * Copyright (c) 2001 Ben Harris.
@@ -50,14 +50,14 @@
 #include "opt_kgdb.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: undefined.c,v 1.73 2022/01/08 09:00:23 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: undefined.c,v 1.74 2022/01/08 09:01:00 skrll Exp $");
 
 #include 
 #include 
-#include 
 #ifdef KGDB
 #include 
 #endif
+#include 
 #include 
 #include 
 #include 



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

2022-01-08 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Jan  8 09:01:00 UTC 2022

Modified Files:
src/sys/arch/arm/arm: undefined.c

Log Message:
KNF


To generate a diff of this commit:
cvs rdiff -u -r1.73 -r1.74 src/sys/arch/arm/arm/undefined.c

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



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

2022-01-08 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Jan  8 09:00:23 UTC 2022

Modified Files:
src/sys/arch/arm/arm: undefined.c

Log Message:
Make VERBOSE_ARM32 compile again and reduce #ifdefs while I'm here


To generate a diff of this commit:
cvs rdiff -u -r1.72 -r1.73 src/sys/arch/arm/arm/undefined.c

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



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

2022-01-08 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Jan  8 09:00:23 UTC 2022

Modified Files:
src/sys/arch/arm/arm: undefined.c

Log Message:
Make VERBOSE_ARM32 compile again and reduce #ifdefs while I'm here


To generate a diff of this commit:
cvs rdiff -u -r1.72 -r1.73 src/sys/arch/arm/arm/undefined.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/arm/undefined.c
diff -u src/sys/arch/arm/arm/undefined.c:1.72 src/sys/arch/arm/arm/undefined.c:1.73
--- src/sys/arch/arm/arm/undefined.c:1.72	Sun Oct 31 16:23:47 2021
+++ src/sys/arch/arm/arm/undefined.c	Sat Jan  8 09:00:23 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: undefined.c,v 1.72 2021/10/31 16:23:47 skrll Exp $	*/
+/*	$NetBSD: undefined.c,v 1.73 2022/01/08 09:00:23 skrll Exp $	*/
 
 /*
  * Copyright (c) 2001 Ben Harris.
@@ -50,7 +50,7 @@
 #include "opt_kgdb.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: undefined.c,v 1.72 2021/10/31 16:23:47 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: undefined.c,v 1.73 2022/01/08 09:00:23 skrll Exp $");
 
 #include 
 #include 
@@ -71,7 +71,9 @@ __KERNEL_RCSID(0, "$NetBSD: undefined.c,
 #include 
 #include 
 
+#ifdef VERBOSE_ARM32
 #include 
+#endif
 
 #ifdef DDB
 #include 
@@ -307,9 +309,6 @@ undefinedinstruction(trapframe_t *tf)
 	int coprocessor;
 	int user;
 	struct undefined_handler *uh;
-#ifdef VERBOSE_ARM32
-	int s;
-#endif
 
 	curcpu()->ci_und_ev.ev_count++;
 
@@ -441,7 +440,7 @@ undefinedinstruction(trapframe_t *tf)
 		ksiginfo_t ksi;
 
 #ifdef VERBOSE_ARM32
-		s = spltty();
+		int s = spltty();
 
 		if ((fault_instruction & 0x0f10) == 0x0e00) {
 			printf("CDP\n");



CVS commit: src/distrib/sets/lists/debug

2022-01-08 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Jan  8 08:40:20 UTC 2022

Modified Files:
src/distrib/sets/lists/debug: md.emips

Log Message:
Attempt to fix emips build


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/distrib/sets/lists/debug/md.emips

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

Modified files:

Index: src/distrib/sets/lists/debug/md.emips
diff -u src/distrib/sets/lists/debug/md.emips:1.1 src/distrib/sets/lists/debug/md.emips:1.2
--- src/distrib/sets/lists/debug/md.emips:1.1	Fri Dec 31 16:15:58 2021
+++ src/distrib/sets/lists/debug/md.emips	Sat Jan  8 08:40:19 2022
@@ -1,3 +1,4 @@
-# $NetBSD: md.emips,v 1.1 2021/12/31 16:15:58 christos Exp $
+# $NetBSD: md.emips,v 1.2 2022/01/08 08:40:19 skrll Exp $
 ./usr/libdata/debug/nfsnetbsd-GENERIC.debug	comp-sysutil-debug	debug
 ./usr/libdata/debug/nfsnetbsd-INSTALL.debug	comp-sysutil-debug	debug
+./usr/libdata/debug/nfsnetbsd-RAMDISK.debug	comp-sysutil-debug	debug



CVS commit: src/distrib/sets/lists/debug

2022-01-08 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Jan  8 08:40:20 UTC 2022

Modified Files:
src/distrib/sets/lists/debug: md.emips

Log Message:
Attempt to fix emips build


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/distrib/sets/lists/debug/md.emips

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



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

2022-01-04 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Jan  4 10:38:05 UTC 2022

Modified Files:
src/sys/arch/evbarm/hdl_g: hdlg_machdep.c

Log Message:
Fix DIAGNOSTIC fallout


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/sys/arch/evbarm/hdl_g/hdlg_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/evbarm/hdl_g/hdlg_machdep.c
diff -u src/sys/arch/evbarm/hdl_g/hdlg_machdep.c:1.32 src/sys/arch/evbarm/hdl_g/hdlg_machdep.c:1.33
--- src/sys/arch/evbarm/hdl_g/hdlg_machdep.c:1.32	Sat Nov 20 08:48:55 2021
+++ src/sys/arch/evbarm/hdl_g/hdlg_machdep.c	Tue Jan  4 10:38:04 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: hdlg_machdep.c,v 1.32 2021/11/20 08:48:55 rin Exp $	*/
+/*	$NetBSD: hdlg_machdep.c,v 1.33 2022/01/04 10:38:04 skrll Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002, 2003 Wasabi Systems, Inc.
@@ -73,7 +73,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: hdlg_machdep.c,v 1.32 2021/11/20 08:48:55 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hdlg_machdep.c,v 1.33 2022/01/04 10:38:04 skrll Exp $");
 
 #include "opt_arm_debug.h"
 #include "opt_console.h"
@@ -228,9 +228,7 @@ vaddr_t
 initarm(void *arg)
 {
 	extern vaddr_t xscale_cache_clean_addr;
-#ifdef DIAGNOSTIC
 	extern vsize_t xscale_minidata_clean_size;
-#endif
 	int loop;
 	int loop1;
 	u_int l1pagetable;



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

2022-01-04 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Jan  4 10:38:05 UTC 2022

Modified Files:
src/sys/arch/evbarm/hdl_g: hdlg_machdep.c

Log Message:
Fix DIAGNOSTIC fallout


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/sys/arch/evbarm/hdl_g/hdlg_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/aarch64/aarch64

2022-01-03 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Jan  4 05:55:45 UTC 2022

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

Log Message:
KNF


To generate a diff of this commit:
cvs rdiff -u -r1.121 -r1.122 src/sys/arch/aarch64/aarch64/pmap.c

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

Modified files:

Index: src/sys/arch/aarch64/aarch64/pmap.c
diff -u src/sys/arch/aarch64/aarch64/pmap.c:1.121 src/sys/arch/aarch64/aarch64/pmap.c:1.122
--- src/sys/arch/aarch64/aarch64/pmap.c:1.121	Fri Dec 10 20:36:02 2021
+++ src/sys/arch/aarch64/aarch64/pmap.c	Tue Jan  4 05:55:45 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.121 2021/12/10 20:36:02 andvar Exp $	*/
+/*	$NetBSD: pmap.c,v 1.122 2022/01/04 05:55:45 skrll Exp $	*/
 
 /*
  * Copyright (c) 2017 Ryo Shimizu 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.121 2021/12/10 20:36:02 andvar Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.122 2022/01/04 05:55:45 skrll Exp $");
 
 #include "opt_arm_debug.h"
 #include "opt_ddb.h"
@@ -2011,7 +2011,7 @@ _pmap_enter(struct pmap *pm, vaddr_t va,
 		if (!l3pte_readable(pte)) {
 			PTE_ICACHE_SYNC_PAGE(pte, ptep, asid, va, l3only);
 			atomic_swap_64(ptep, pte);
-			AARCH64_TLBI_BY_ASID_VA(asid, va ,true);
+			AARCH64_TLBI_BY_ASID_VA(asid, va, true);
 		} else {
 			atomic_swap_64(ptep, pte);
 			AARCH64_TLBI_BY_ASID_VA(asid, va, l3only);



CVS commit: src/sys/arch/aarch64/aarch64

2022-01-03 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Jan  4 05:55:45 UTC 2022

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

Log Message:
KNF


To generate a diff of this commit:
cvs rdiff -u -r1.121 -r1.122 src/sys/arch/aarch64/aarch64/pmap.c

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



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

2022-01-03 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Jan  4 05:39:12 UTC 2022

Modified Files:
src/sys/arch/mips/include: pmap.h

Log Message:
consistency. NFCI.


To generate a diff of this commit:
cvs rdiff -u -r1.75 -r1.76 src/sys/arch/mips/include/pmap.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/mips/include/pmap.h
diff -u src/sys/arch/mips/include/pmap.h:1.75 src/sys/arch/mips/include/pmap.h:1.76
--- src/sys/arch/mips/include/pmap.h:1.75	Sun Dec 20 16:38:25 2020
+++ src/sys/arch/mips/include/pmap.h	Tue Jan  4 05:39:12 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.h,v 1.75 2020/12/20 16:38:25 skrll Exp $	*/
+/*	$NetBSD: pmap.h,v 1.76 2022/01/04 05:39:12 skrll Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -100,7 +100,7 @@ struct vm_page_md;
 
 #define	PMAP_VIRTUAL_CACHE_ALIASES
 #define	PMAP_INVALID_SEGTAB_ADDRESS	((pmap_segtab_t *)NULL)
-#define	PMAP_TLB_NEED_SHOOTDOWN
+#define	PMAP_TLB_NEED_SHOOTDOWN		1
 #define	PMAP_TLB_FLUSH_ASID_ON_RESET	false
 #if UPAGES > 1
 #define	PMAP_TLB_WIRED_UPAGES		MIPS3_TLB_WIRED_UPAGES



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

2022-01-03 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Jan  4 05:39:12 UTC 2022

Modified Files:
src/sys/arch/mips/include: pmap.h

Log Message:
consistency. NFCI.


To generate a diff of this commit:
cvs rdiff -u -r1.75 -r1.76 src/sys/arch/mips/include/pmap.h

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



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

2022-01-03 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon Jan  3 08:44:11 UTC 2022

Modified Files:
src/sys/arch/arm/apple: files.apple

Log Message:
sort


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/apple/files.apple

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/apple/files.apple
diff -u src/sys/arch/arm/apple/files.apple:1.1 src/sys/arch/arm/apple/files.apple:1.2
--- src/sys/arch/arm/apple/files.apple:1.1	Mon Aug 30 23:26:26 2021
+++ src/sys/arch/arm/apple/files.apple	Mon Jan  3 08:44:10 2022
@@ -1,4 +1,4 @@
-#	$NetBSD: files.apple,v 1.1 2021/08/30 23:26:26 jmcneill Exp $
+#	$NetBSD: files.apple,v 1.2 2022/01/03 08:44:10 skrll Exp $
 #
 # Configuration info for Apple Silicon SoCs
 #
@@ -6,25 +6,25 @@
 
 file	arch/arm/apple/apple_platform.c		soc_apple
 
+# IOMMU
+device	appledart
+attach	appledart at fdt with apple_dart
+file	arch/arm/apple/apple_dart.c		apple_dart
+
 # Interrupt controller
 device	appleintc: pic, pic_splfuncs
 attach	appleintc at fdt with apple_intc
 file	arch/arm/apple/apple_intc.c		apple_intc
 
-# Watchdog timer
-device	applewdog: sysmon_wdog
-attach	applewdog at fdt with apple_wdog
-file	arch/arm/apple/apple_wdog.c		apple_wdog
-
 # PCIe controller
 device	applepcie: pcibus, pcihost_fdt
 attach	applepcie at fdt with apple_pcie
 file	arch/arm/apple/apple_pcie.c		apple_pcie
 
-# IOMMU
-device	appledart
-attach	appledart at fdt with apple_dart
-file	arch/arm/apple/apple_dart.c		apple_dart
+# Watchdog timer
+device	applewdog: sysmon_wdog
+attach	applewdog at fdt with apple_wdog
+file	arch/arm/apple/apple_wdog.c		apple_wdog
 
 # SOC parameters
 defflag	opt_soc.hSOC_APPLE



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

2022-01-03 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon Jan  3 08:44:11 UTC 2022

Modified Files:
src/sys/arch/arm/apple: files.apple

Log Message:
sort


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/apple/files.apple

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



CVS commit: src/sys/dev/usb

2021-12-31 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Dec 31 12:00:18 UTC 2021

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

Log Message:
usbd_do_request_len (and friends) return usbd_status so return one in
the usbd_create_xfer failure case.  Spotted by Riastradh.


To generate a diff of this commit:
cvs rdiff -u -r1.220 -r1.221 src/sys/dev/usb/usbdi.c

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

Modified files:

Index: src/sys/dev/usb/usbdi.c
diff -u src/sys/dev/usb/usbdi.c:1.220 src/sys/dev/usb/usbdi.c:1.221
--- src/sys/dev/usb/usbdi.c:1.220	Tue Dec 21 09:51:22 2021
+++ src/sys/dev/usb/usbdi.c	Fri Dec 31 12:00:18 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: usbdi.c,v 1.220 2021/12/21 09:51:22 skrll Exp $	*/
+/*	$NetBSD: usbdi.c,v 1.221 2021/12/31 12:00:18 skrll Exp $	*/
 
 /*
  * Copyright (c) 1998, 2012, 2015 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: usbdi.c,v 1.220 2021/12/21 09:51:22 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: usbdi.c,v 1.221 2021/12/31 12:00:18 skrll Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -1243,7 +1243,7 @@ usbd_do_request_len(struct usbd_device *
 
 	int error = usbd_create_xfer(dev->ud_pipe0, len, 0, 0, );
 	if (error)
-		return error;
+		return USBD_NOMEM;
 
 	usbd_setup_default_xfer(xfer, dev, 0, timeout, req, data,
 	UGETW(req->wLength), flags, NULL);



CVS commit: src/sys/dev/usb

2021-12-31 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Dec 31 12:00:18 UTC 2021

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

Log Message:
usbd_do_request_len (and friends) return usbd_status so return one in
the usbd_create_xfer failure case.  Spotted by Riastradh.


To generate a diff of this commit:
cvs rdiff -u -r1.220 -r1.221 src/sys/dev/usb/usbdi.c

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



CVS commit: src/sys/uvm/pmap

2021-12-29 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Dec 29 12:53:38 UTC 2021

Modified Files:
src/sys/uvm/pmap: pmap_tlb.c

Log Message:
Remove duplicate KASSERT


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/sys/uvm/pmap/pmap_tlb.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/uvm/pmap/pmap_tlb.c
diff -u src/sys/uvm/pmap/pmap_tlb.c:1.49 src/sys/uvm/pmap/pmap_tlb.c:1.50
--- src/sys/uvm/pmap/pmap_tlb.c:1.49	Wed Oct 27 06:54:15 2021
+++ src/sys/uvm/pmap/pmap_tlb.c	Wed Dec 29 12:53:38 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap_tlb.c,v 1.49 2021/10/27 06:54:15 simonb Exp $	*/
+/*	$NetBSD: pmap_tlb.c,v 1.50 2021/12/29 12:53:38 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include 
 
-__KERNEL_RCSID(0, "$NetBSD: pmap_tlb.c,v 1.49 2021/10/27 06:54:15 simonb Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap_tlb.c,v 1.50 2021/12/29 12:53:38 skrll Exp $");
 
 /*
  * Manages address spaces in a TLB.
@@ -866,7 +866,6 @@ pmap_tlb_asid_alloc(struct pmap_tlb_info
 	 * Mark it as used and insert the pai into the list of active asids.
 	 * There is also one less asid free in this TLB.
 	 */
-	KASSERT(ti->ti_asid_hint > KERNEL_PID);
 	pai->pai_asid = ti->ti_asid_hint++;
 #ifdef MULTIPROCESSOR
 	if (PMAP_TLB_FLUSH_ASID_ON_RESET) {



CVS commit: src/sys/uvm/pmap

2021-12-29 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Dec 29 12:53:38 UTC 2021

Modified Files:
src/sys/uvm/pmap: pmap_tlb.c

Log Message:
Remove duplicate KASSERT


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/sys/uvm/pmap/pmap_tlb.c

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



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

2021-12-26 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Dec 26 08:41:29 UTC 2021

Modified Files:
src/sys/arch/arm/include: mutex.h

Log Message:
port-arm/50563: pool allocator corruption due to __MUTEX_PRIVATE

This file has moved on somewhat since the PR was raised, but nevertheless
let's add the CTASSERT "just in case".


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/arm/include/mutex.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/arm/include/mutex.h
diff -u src/sys/arch/arm/include/mutex.h:1.26 src/sys/arch/arm/include/mutex.h:1.27
--- src/sys/arch/arm/include/mutex.h:1.26	Wed Aug 25 04:13:41 2021
+++ src/sys/arch/arm/include/mutex.h	Sun Dec 26 08:41:29 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: mutex.h,v 1.26 2021/08/25 04:13:41 thorpej Exp $	*/
+/*	$NetBSD: mutex.h,v 1.27 2021/12/26 08:41:29 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2002, 2007 The NetBSD Foundation, Inc.
@@ -82,4 +82,6 @@ struct kmutex {
 
 #endif	/* __MUTEX_PRIVATE */
 
+__CTASSERT(sizeof(struct kmutex) == sizeof(uintptr_t));
+
 #endif /* _ARM_MUTEX_H_ */



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

2021-12-26 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Dec 26 08:41:29 UTC 2021

Modified Files:
src/sys/arch/arm/include: mutex.h

Log Message:
port-arm/50563: pool allocator corruption due to __MUTEX_PRIVATE

This file has moved on somewhat since the PR was raised, but nevertheless
let's add the CTASSERT "just in case".


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/arm/include/mutex.h

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

2021-12-23 Thread Nick Hudson

On 23/12/2021 17:05, Juergen Hannken-Illjes wrote:

Module Name:src
Committed By:   hannken
Date:   Thu Dec 23 17:05:49 UTC 2021

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

Log Message:
Keep constants 32 bit, why does __BIT() return uintmax_t?


PRIxBIT is available

Nick



CVS commit: src/sys/dev/usb

2021-12-23 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu Dec 23 11:03:48 UTC 2021

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

Log Message:
Use the correct dmatag for all control structures. Also, don't KASSERT that
we're using the low 4GB for them and simply error out.

kern/56570: ehci panic on boot


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

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

Modified files:

Index: src/sys/dev/usb/ehci.c
diff -u src/sys/dev/usb/ehci.c:1.297 src/sys/dev/usb/ehci.c:1.298
--- src/sys/dev/usb/ehci.c:1.297	Wed Dec 22 21:45:02 2021
+++ src/sys/dev/usb/ehci.c	Thu Dec 23 11:03:48 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: ehci.c,v 1.297 2021/12/22 21:45:02 skrll Exp $ */
+/*	$NetBSD: ehci.c,v 1.298 2021/12/23 11:03:48 skrll Exp $ */
 
 /*
  * Copyright (c) 2004-2012,2016,2020 The NetBSD Foundation, Inc.
@@ -54,7 +54,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.297 2021/12/22 21:45:02 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.298 2021/12/23 11:03:48 skrll Exp $");
 
 #include "ohci.h"
 #include "uhci.h"
@@ -539,7 +539,7 @@ ehci_init(ehci_softc_t *sc)
 		err = EIO;
 		goto fail1;
 	}
-	err = usb_allocmem(sc->sc_bus.ub_dmatag,
+	err = usb_allocmem(sc->sc_dmatag,
 	sc->sc_flsize * sizeof(ehci_link_t),
 	EHCI_FLALIGN_ALIGN, USBMALLOC_COHERENT, >sc_fldma);
 	if (err) {
@@ -553,9 +553,15 @@ ehci_init(ehci_softc_t *sc)
 		sc->sc_flist[i] = EHCI_NULL;
 	}
 
-	KASSERT(BUS_ADDR_HI32(DMAADDR(>sc_fldma, 0)) == 0);
-	uint32_t lo32 = BUS_ADDR_LO32(DMAADDR(>sc_fldma, 0));
+	const bus_addr_t flba = DMAADDR(>sc_fldma, 0);
+	const uint32_t hi32 = BUS_ADDR_HI32(flba);
+	if (hi32 != 0) {
+		aprint_error_dev(sc->sc_dev, "DMA memory segment error (%08x)\n",
+		hi32);
+		goto fail2;
+	}
 
+	const uint32_t lo32 = BUS_ADDR_LO32(flba);
 	EOWRITE4(sc, EHCI_PERIODICLISTBASE, lo32);
 
 	sc->sc_softitds = kmem_zalloc(sc->sc_flsize * sizeof(ehci_soft_itd_t *),
@@ -579,7 +585,7 @@ ehci_init(ehci_softc_t *sc)
 		sqh = ehci_alloc_sqh(sc);
 		if (sqh == NULL) {
 			err = ENOMEM;
-			goto fail2;
+			goto fail3;
 		}
 		sc->sc_islots[i].sqh = sqh;
 	}
@@ -622,7 +628,7 @@ ehci_init(ehci_softc_t *sc)
 	sqh = ehci_alloc_sqh(sc);
 	if (sqh == NULL) {
 		err = ENOMEM;
-		goto fail2;
+		goto fail3;
 	}
 	/* Fill the QH */
 	sqh->qh.qh_endp =
@@ -670,7 +676,7 @@ ehci_init(ehci_softc_t *sc)
 	if (hcr) {
 		aprint_error("%s: run timeout\n", device_xname(sc->sc_dev));
 		err = EIO;
-		goto fail3;
+		goto fail4;
 	}
 
 	/* Enable interrupts */
@@ -679,10 +685,10 @@ ehci_init(ehci_softc_t *sc)
 
 	return 0;
 
-fail3:
+fail4:
 	ehci_free_sqh(sc, sc->sc_async_head);
 
-fail2:
+fail3:
 	for (i = 0; i < EHCI_INTRQHS; i++) {
 		sqh = sc->sc_islots[i].sqh;
 		if (sqh)
@@ -690,6 +696,8 @@ fail2:
 	}
 
 	kmem_free(sc->sc_softitds, sc->sc_flsize * sizeof(ehci_soft_itd_t *));
+
+fail2:
 	usb_freemem(>sc_fldma);
 
 fail1:
@@ -3210,7 +3218,7 @@ ehci_alloc_sitd(ehci_softc_t *sc)
 		mutex_exit(>sc_lock);
 
 		usb_dma_t dma;
-		int err = usb_allocmem(sc->sc_bus.ub_dmatag,
+		int err = usb_allocmem(sc->sc_dmatag,
 		EHCI_SITD_SIZE * EHCI_SITD_CHUNK,
 		EHCI_PAGE_SIZE, USBMALLOC_COHERENT, );
 



CVS commit: src/sys/dev/usb

2021-12-23 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu Dec 23 11:03:48 UTC 2021

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

Log Message:
Use the correct dmatag for all control structures. Also, don't KASSERT that
we're using the low 4GB for them and simply error out.

kern/56570: ehci panic on boot


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

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



CVS commit: src/sys/dev

2021-12-22 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Dec 22 21:45:02 UTC 2021

Modified Files:
src/sys/dev/acpi: ehci_acpi.c
src/sys/dev/pci: ehci_pci.c
src/sys/dev/usb: ehci.c ehcivar.h

Log Message:
Three fixes

- pass the 64bit DMA tag if the HCCPARAMS says ehci supports it and the
  64bit DMA tag is available/valid.  This should help with the
  "cannot create xfer" error on 64bit systems.

- restrict the control structure memory allocation to the low 4GB
  (CTRLDSSEGMENT was always set to zero anyway)

- if ehci_init fails then tidyup before returning the error.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/dev/acpi/ehci_acpi.c
cvs rdiff -u -r1.72 -r1.73 src/sys/dev/pci/ehci_pci.c
cvs rdiff -u -r1.296 -r1.297 src/sys/dev/usb/ehci.c
cvs rdiff -u -r1.48 -r1.49 src/sys/dev/usb/ehcivar.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/acpi/ehci_acpi.c
diff -u src/sys/dev/acpi/ehci_acpi.c:1.7 src/sys/dev/acpi/ehci_acpi.c:1.8
--- src/sys/dev/acpi/ehci_acpi.c:1.7	Sat Aug  7 16:19:09 2021
+++ src/sys/dev/acpi/ehci_acpi.c	Wed Dec 22 21:45:02 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: ehci_acpi.c,v 1.7 2021/08/07 16:19:09 thorpej Exp $ */
+/* $NetBSD: ehci_acpi.c,v 1.8 2021/12/22 21:45:02 skrll Exp $ */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ehci_acpi.c,v 1.7 2021/08/07 16:19:09 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ehci_acpi.c,v 1.8 2021/12/22 21:45:02 skrll Exp $");
 
 #include 
 #include 
@@ -98,7 +98,6 @@ ehci_acpi_attach(device_t parent, device
 
 	sc->sc_dev = self;
 	sc->sc_bus.ub_hcpriv = sc;
-	sc->sc_bus.ub_dmatag = aa->aa_dmat;
 	sc->sc_bus.ub_revision = USBREV_2_0;
 	sc->sc_flags = EHCIF_ETTF;
 	sc->sc_vendor_init = ehci_acpi_init;
@@ -125,25 +124,41 @@ ehci_acpi_attach(device_t parent, device
 	error = bus_space_map(sc->iot, mem->ar_base, mem->ar_length, 0, >ioh);
 	if (error) {
 		aprint_error_dev(self, "couldn't map registers\n");
-		return;
+		goto done;
 	}
 
 	/* Disable interrupts */
 	sc->sc_offs = EREAD1(sc, EHCI_CAPLENGTH);
 	EOWRITE4(sc, EHCI_USBINTR, 0);
 
+	const uint32_t hccparams = EREAD4(sc, EHCI_HCCPARAMS);
+	if (EHCI_HCC_64BIT(hccparams)) {
+		aprint_verbose_dev(self, "64-bit DMA");
+		if (BUS_DMA_TAG_VALID(aa->aa_dmat64)) {
+			aprint_verbose("\n");
+			sc->sc_bus.ub_dmatag = aa->aa_dmat64;
+		} else {
+			aprint_verbose(" - limited\n");
+			sc->sc_bus.ub_dmatag = aa->aa_dmat;
+		}
+	} else {
+		aprint_verbose_dev(self, "32-bit DMA\n");
+		sc->sc_bus.ub_dmatag = aa->aa_dmat;
+	}
+
 	ih = acpi_intr_establish(self,
 	(uint64_t)(uintptr_t)aa->aa_node->ad_handle,
 	IPL_USB, true, ehci_intr, sc, device_xname(self));
 	if (ih == NULL) {
 		aprint_error_dev(self, "couldn't establish interrupt\n");
-		return;
+		goto done;
 	}
 
 	error = ehci_init(sc);
 	if (error) {
 		aprint_error_dev(self, "init failed, error = %d\n", error);
-		return;
+		acpi_intr_disestablish(ih);
+		goto done;
 	}
 
 	sc->sc_child = config_found(self, >sc_bus, usbctlprint, CFARGS_NONE);

Index: src/sys/dev/pci/ehci_pci.c
diff -u src/sys/dev/pci/ehci_pci.c:1.72 src/sys/dev/pci/ehci_pci.c:1.73
--- src/sys/dev/pci/ehci_pci.c:1.72	Sat Aug  7 16:19:14 2021
+++ src/sys/dev/pci/ehci_pci.c	Wed Dec 22 21:45:02 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: ehci_pci.c,v 1.72 2021/08/07 16:19:14 thorpej Exp $	*/
+/*	$NetBSD: ehci_pci.c,v 1.73 2021/12/22 21:45:02 skrll Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ehci_pci.c,v 1.72 2021/08/07 16:19:14 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ehci_pci.c,v 1.73 2021/12/22 21:45:02 skrll Exp $");
 
 #include 
 #include 
@@ -144,7 +144,22 @@ ehci_pci_attach(device_t parent, device_
 
 	sc->sc_pc = pc;
 	sc->sc_tag = tag;
-	sc->sc.sc_bus.ub_dmatag = pa->pa_dmat;
+
+	const uint32_t hccparams = EREAD4(>sc, EHCI_HCCPARAMS);
+
+	if (EHCI_HCC_64BIT(hccparams)) {
+		aprint_verbose_dev(self, "64-bit DMA");
+		if (pci_dma64_available(pa)) {
+			sc->sc.sc_bus.ub_dmatag = pa->pa_dmat64;
+			aprint_verbose("\n");
+		} else {
+			aprint_verbose(" - limited\n");
+			sc->sc.sc_bus.ub_dmatag = pa->pa_dmat;
+		}
+	} else {
+		aprint_verbose_dev(self, "32-bit DMA\n");
+		sc->sc.sc_bus.ub_dmatag = pa->pa_dmat;
+	}
 
 	/* Disable interrupts, so we don't get any spurious ones. */
 	sc->sc.sc_offs = EREAD1(>sc, EHCI_CAPLENGTH);

Index: src/sys/dev/usb/ehci.c
diff -u src/sys/dev/usb/ehci.c:1.296 src/sys/dev/usb/ehci.c:1.297
--- src/sys/dev/usb/ehci.c:1.296	Wed Dec 22 21:36:40 2021
+++ src/sys/dev/usb/ehci.c	Wed Dec 22 21:45:02 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: ehci.c,v 1.296 2021/12/22 21:36:40 skrll Exp $ */
+/*	$NetBSD: ehci.c,v 1.297 2021/12/22 21:45:02 skrll Exp $ */
 
 /*
  * Copyright (c) 2004-2012,2016,2020 The NetBSD Foundation, Inc.
@@ -54,7 +54,7 @@
  */
 
 #include 

CVS commit: src/sys/dev

2021-12-22 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Dec 22 21:45:02 UTC 2021

Modified Files:
src/sys/dev/acpi: ehci_acpi.c
src/sys/dev/pci: ehci_pci.c
src/sys/dev/usb: ehci.c ehcivar.h

Log Message:
Three fixes

- pass the 64bit DMA tag if the HCCPARAMS says ehci supports it and the
  64bit DMA tag is available/valid.  This should help with the
  "cannot create xfer" error on 64bit systems.

- restrict the control structure memory allocation to the low 4GB
  (CTRLDSSEGMENT was always set to zero anyway)

- if ehci_init fails then tidyup before returning the error.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/dev/acpi/ehci_acpi.c
cvs rdiff -u -r1.72 -r1.73 src/sys/dev/pci/ehci_pci.c
cvs rdiff -u -r1.296 -r1.297 src/sys/dev/usb/ehci.c
cvs rdiff -u -r1.48 -r1.49 src/sys/dev/usb/ehcivar.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/usb

2021-12-22 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Dec 22 21:36:40 UTC 2021

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

Log Message:
Whitespace


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

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

Modified files:

Index: src/sys/dev/usb/ehci.c
diff -u src/sys/dev/usb/ehci.c:1.295 src/sys/dev/usb/ehci.c:1.296
--- src/sys/dev/usb/ehci.c:1.295	Tue Dec 21 10:16:05 2021
+++ src/sys/dev/usb/ehci.c	Wed Dec 22 21:36:40 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: ehci.c,v 1.295 2021/12/21 10:16:05 skrll Exp $ */
+/*	$NetBSD: ehci.c,v 1.296 2021/12/22 21:36:40 skrll Exp $ */
 
 /*
  * Copyright (c) 2004-2012,2016,2020 The NetBSD Foundation, Inc.
@@ -54,7 +54,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.295 2021/12/21 10:16:05 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.296 2021/12/22 21:36:40 skrll Exp $");
 
 #include "ohci.h"
 #include "uhci.h"
@@ -2001,8 +2001,8 @@ ehci_open(struct usbd_pipe *pipe)
 	switch (xfertype) {
 	case UE_CONTROL:
 		err = usb_allocmem(sc->sc_bus.ub_dmatag,
-		 sizeof(usb_device_request_t), 0, USBMALLOC_COHERENT,
-		 >ctrl.reqdma);
+		sizeof(usb_device_request_t), 0, USBMALLOC_COHERENT,
+		>ctrl.reqdma);
 #ifdef EHCI_DEBUG
 		if (err)
 			printf("ehci_open: usb_allocmem()=%d\n", err);



CVS commit: src/sys/dev/usb

2021-12-22 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Dec 22 21:36:40 UTC 2021

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

Log Message:
Whitespace


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

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



CVS commit: src/sys/dev/pci

2021-12-21 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Dec 22 07:28:34 UTC 2021

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

Log Message:
Fixup NQTXC_CMD_{TCP,UDP} after previous


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

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

Modified files:

Index: src/sys/dev/pci/if_wmreg.h
diff -u src/sys/dev/pci/if_wmreg.h:1.124 src/sys/dev/pci/if_wmreg.h:1.125
--- src/sys/dev/pci/if_wmreg.h:1.124	Wed Dec 22 07:19:34 2021
+++ src/sys/dev/pci/if_wmreg.h	Wed Dec 22 07:28:34 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wmreg.h,v 1.124 2021/12/22 07:19:34 skrll Exp $	*/
+/*	$NetBSD: if_wmreg.h,v 1.125 2021/12/22 07:28:34 skrll Exp $	*/
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -1686,8 +1686,9 @@ typedef union nq_txdesc {
 #define	NQTXC_CMD_IPV_MASK		__BIT(10)
 #define	NQTXC_CMD_IP4			__SHIFTIN(1, NQTXC_CMD_IPV_MASK)
 #define	NQTXC_CMD_IP6			__SHIFTIN(0, NQTXC_CMD_IPV_MASK)
-#define	NQTXC_CMD_TCP			__BIT(11)
-#define	NQTXC_CMD_UDP			(0U << 11)
+#define	NQTXC_CMD_TP_MASK		__BIT(11)
+#define	NQTXC_CMD_TCP			__SHIFTIN(1, NQTXC_CMD_TP_MASK)
+#define	NQTXC_CMD_UDP			__SHIFTIN(0, NQTXC_CMD_TP_MASK)
 #define	NQTXC_MSSIDX_IDX_SHIFT		4	/* context index shift */
 #define	NQTXC_MSSIDX_IDX_MASK		0xf
 #define	NQTXC_MSSIDX_L4LEN_SHIFT	8	/* L4 header len shift */



CVS commit: src/sys/dev/pci

2021-12-21 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Dec 22 07:28:34 UTC 2021

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

Log Message:
Fixup NQTXC_CMD_{TCP,UDP} after previous


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

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



CVS commit: src/sys/dev/pci

2021-12-21 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Dec 22 07:19:34 UTC 2021

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

Log Message:
In a close run thing use #define everywhere for consistency


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

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

Modified files:

Index: src/sys/dev/pci/if_wmreg.h
diff -u src/sys/dev/pci/if_wmreg.h:1.123 src/sys/dev/pci/if_wmreg.h:1.124
--- src/sys/dev/pci/if_wmreg.h:1.123	Wed Dec 22 07:16:44 2021
+++ src/sys/dev/pci/if_wmreg.h	Wed Dec 22 07:19:34 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wmreg.h,v 1.123 2021/12/22 07:16:44 skrll Exp $	*/
+/*	$NetBSD: if_wmreg.h,v 1.124 2021/12/22 07:19:34 skrll Exp $	*/
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -144,7 +144,7 @@ typedef union ext_rxdesc {
 	} erx_ctx;
 } __packed ext_rxdesc_t;
 
-#define EXTRXD_DD_MASK		__BIT(0)
+#define	EXTRXD_DD_MASK		__BIT(0)
 
 /*
  * erxc_rsshash is used for below 2 patterns
@@ -156,57 +156,57 @@ typedef union ext_rxdesc {
  * (2) RSS Hash
  * when RXCSUM.PCSD bit is set
  */
-#define EXTRXC_IP_ID_MASK	__BITS(15,0)
-#define EXTRXC_FRAG_CSUM_MASK	__BITS(31,16)
-#define EXTRXC_IP_ID(rsshash)	__SHIFTOUT(rsshash,ERXC_IP_ID_MASK)
-#define EXTRXC_FRAG_CSUM(rsshash) __SHIFTOUT(rsshash,ERXC_FRAG_CSUM_MASK)
+#define	EXTRXC_IP_ID_MASK	__BITS(15,0)
+#define	EXTRXC_FRAG_CSUM_MASK	__BITS(31,16)
+#define	EXTRXC_IP_ID(rsshash)	__SHIFTOUT(rsshash,ERXC_IP_ID_MASK)
+#define	EXTRXC_FRAG_CSUM(rsshash) __SHIFTOUT(rsshash,ERXC_FRAG_CSUM_MASK)
 
 /* macros for nrxc_mrq */
-#define EXTRXC_RSS_TYPE_MASK		__BITS(3,0)
+#define	EXTRXC_RSS_TYPE_MASK		__BITS(3,0)
 /* __BITS(7,4) is reserved */
-#define EXTRXC_QUEUE_MASK		__BITS(12,8)
+#define	EXTRXC_QUEUE_MASK		__BITS(12,8)
 /* __BITS(31,13) is reserved */
-#define EXTRXC_RSS_TYPE(mrq)	__SHIFTOUT(mrq,EXTRXC_RSS_TYPE_MASK)
-#define EXTRXC_QUEUE(mrq)	__SHIFTOUT(mrq,EXTRXC_QUEUE_MASK)
+#define	EXTRXC_RSS_TYPE(mrq)	__SHIFTOUT(mrq,EXTRXC_RSS_TYPE_MASK)
+#define	EXTRXC_QUEUE(mrq)	__SHIFTOUT(mrq,EXTRXC_QUEUE_MASK)
 
-#define EXTRXC_RSS_TYPE_NONE		0x0 /* No hash computation done. */
-#define EXTRXC_RSS_TYPE_TCP_IPV4	0x1
-#define EXTRXC_RSS_TYPE_IPV4		0x2
-#define EXTRXC_RSS_TYPE_TCP_IPV6	0x3
-#define EXTRXC_RSS_TYPE_IPV6_EX		0x4
-#define EXTRXC_RSS_TYPE_IPV6		0x5
+#define	EXTRXC_RSS_TYPE_NONE		0x0 /* No hash computation done. */
+#define	EXTRXC_RSS_TYPE_TCP_IPV4	0x1
+#define	EXTRXC_RSS_TYPE_IPV4		0x2
+#define	EXTRXC_RSS_TYPE_TCP_IPV6	0x3
+#define	EXTRXC_RSS_TYPE_IPV6_EX		0x4
+#define	EXTRXC_RSS_TYPE_IPV6		0x5
 /*0x6:0xF is reserved. */
 
-#define EXTRXC_STATUS_MASK	__BITS(19,0)
-#define EXTRXC_ERROR_MASK	__BITS(31,20)
-#define EXTRXC_STATUS(err_stat)	__SHIFTOUT(err_stat,EXTRXC_STATUS_MASK)
-#define EXTRXC_ERROR(err_stat)	__SHIFTOUT(err_stat,EXTRXC_ERROR_MASK)
+#define	EXTRXC_STATUS_MASK	__BITS(19,0)
+#define	EXTRXC_ERROR_MASK	__BITS(31,20)
+#define	EXTRXC_STATUS(err_stat)	__SHIFTOUT(err_stat,EXTRXC_STATUS_MASK)
+#define	EXTRXC_ERROR(err_stat)	__SHIFTOUT(err_stat,EXTRXC_ERROR_MASK)
 
 /* 3:0 is reserved. */
-#define EXTRXC_ERROR_CE		__BIT(4) /* The same as WRX_ER_CE. */
-#define EXTRXC_ERROR_SE		__BIT(5) /* The same as WRX_ER_SE. */
-#define EXTRXC_ERROR_SEQ	__BIT(6) /* The same as WRX_ER_SEQ. */
+#define	EXTRXC_ERROR_CE		__BIT(4) /* The same as WRX_ER_CE. */
+#define	EXTRXC_ERROR_SE		__BIT(5) /* The same as WRX_ER_SE. */
+#define	EXTRXC_ERROR_SEQ	__BIT(6) /* The same as WRX_ER_SEQ. */
 /* 7 is reserved. */
-#define EXTRXC_ERROR_CXE	__BIT(8) /* The same as WRX_ER_CXE. */
-#define EXTRXC_ERROR_TCPE	__BIT(9) /* The same as WRX_ER_TCPE. */
-#define EXTRXC_ERROR_IPE	__BIT(10) /* The same as WRX_ER_IPE. */
-#define EXTRXC_ERROR_RXE	__BIT(11) /* The same as WRX_ER_RXE. */
+#define	EXTRXC_ERROR_CXE	__BIT(8) /* The same as WRX_ER_CXE. */
+#define	EXTRXC_ERROR_TCPE	__BIT(9) /* The same as WRX_ER_TCPE. */
+#define	EXTRXC_ERROR_IPE	__BIT(10) /* The same as WRX_ER_IPE. */
+#define	EXTRXC_ERROR_RXE	__BIT(11) /* The same as WRX_ER_RXE. */
 
-#define EXTRXC_STATUS_DD		__BIT(0) /* The same as WRX_ST_DD. */
-#define EXTRXC_STATUS_EOP		__BIT(1) /* The same as WRX_ST_EOP. */
+#define	EXTRXC_STATUS_DD		__BIT(0) /* The same as WRX_ST_DD. */
+#define	EXTRXC_STATUS_EOP		__BIT(1) /* The same as WRX_ST_EOP. */
 /* 2 is reserved. */
-#define EXTRXC_STATUS_VP		__BIT(3) /* The same as WRX_ST_VP. */
-#define EXTRXC_STATUS_UDPCS		__BIT(4) /* UDP checksum calculated on packet. */
-#define EXTRXC_STATUS_TCPCS		__BIT(5) /* The same as WRX_ST_TCPCS. */
-#define EXTRXC_STATUS_IPCS		__BIT(6) /* The same as WRX_ST_IPCS. */
+#define	EXTRXC_STATUS_VP		__BIT(3) /* The same as WRX_ST_VP. */
+#define	EXTRXC_STATUS_UDPCS		__BIT(4) /* UDP checksum calculated on packet. */
+#define	EXTRXC_STATUS_TCPCS		__BIT(5) /* The same as WRX_ST_TCPCS. */
+#define	EXTRXC_STATUS_IPCS		__BIT(6) /* The same as WRX_ST_IPCS. */
 /* 7 is reserved. */
-#define 

CVS commit: src/sys/dev/pci

2021-12-21 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Dec 22 07:19:34 UTC 2021

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

Log Message:
In a close run thing use #define everywhere for consistency


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

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



CVS commit: src/sys/dev/pci

2021-12-21 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Dec 22 07:16:44 UTC 2021

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

Log Message:
Use __BIT() some more. Same code before and after.


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

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

Modified files:

Index: src/sys/dev/pci/if_wmreg.h
diff -u src/sys/dev/pci/if_wmreg.h:1.122 src/sys/dev/pci/if_wmreg.h:1.123
--- src/sys/dev/pci/if_wmreg.h:1.122	Mon Dec 20 12:50:35 2021
+++ src/sys/dev/pci/if_wmreg.h	Wed Dec 22 07:16:44 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wmreg.h,v 1.122 2021/12/20 12:50:35 skrll Exp $	*/
+/*	$NetBSD: if_wmreg.h,v 1.123 2021/12/22 07:16:44 skrll Exp $	*/
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -101,28 +101,28 @@ typedef struct wiseman_rxdesc {
 } __packed wiseman_rxdesc_t;
 
 /* wrx_status bits */
-#define	WRX_ST_DD	(1U << 0)	/* descriptor done */
-#define	WRX_ST_EOP	(1U << 1)	/* end of packet */
-#define	WRX_ST_IXSM	(1U << 2)	/* ignore checksum indication */
-#define	WRX_ST_VP	(1U << 3)	/* VLAN packet */
-#define	WRX_ST_BPDU	(1U << 4)	/* ??? */
-#define	WRX_ST_TCPCS	(1U << 5)	/* TCP checksum performed */
-#define	WRX_ST_IPCS	(1U << 6)	/* IP checksum performed */
-#define	WRX_ST_PIF	(1U << 7)	/* passed in-exact filter */
+#define	WRX_ST_DD	__BIT(0)	/* descriptor done */
+#define	WRX_ST_EOP	__BIT(1)	/* end of packet */
+#define	WRX_ST_IXSM	__BIT(2)	/* ignore checksum indication */
+#define	WRX_ST_VP	__BIT(3)	/* VLAN packet */
+#define	WRX_ST_BPDU	__BIT(4)	/* ??? */
+#define	WRX_ST_TCPCS	__BIT(5)	/* TCP checksum performed */
+#define	WRX_ST_IPCS	__BIT(6)	/* IP checksum performed */
+#define	WRX_ST_PIF	__BIT(7)	/* passed in-exact filter */
 
 /* wrx_error bits */
-#define	WRX_ER_CE	(1U << 0)	/* CRC error */
-#define	WRX_ER_SE	(1U << 1)	/* symbol error */
-#define	WRX_ER_SEQ	(1U << 2)	/* sequence error */
-#define	WRX_ER_ICE	(1U << 3)	/* ??? */
-#define	WRX_ER_CXE	(1U << 4)	/* carrier extension error */
-#define	WRX_ER_TCPE	(1U << 5)	/* TCP checksum error */
-#define	WRX_ER_IPE	(1U << 6)	/* IP checksum error */
-#define	WRX_ER_RXE	(1U << 7)	/* Rx data error */
+#define	WRX_ER_CE	__BIT(0)	/* CRC error */
+#define	WRX_ER_SE	__BIT(1)	/* symbol error */
+#define	WRX_ER_SEQ	__BIT(2)	/* sequence error */
+#define	WRX_ER_ICE	__BIT(3)	/* ??? */
+#define	WRX_ER_CXE	__BIT(4)	/* carrier extension error */
+#define	WRX_ER_TCPE	__BIT(5)	/* TCP checksum error */
+#define	WRX_ER_IPE	__BIT(6)	/* IP checksum error */
+#define	WRX_ER_RXE	__BIT(7)	/* Rx data error */
 
 /* wrx_special field for VLAN packets */
 #define	WRX_VLAN_ID(x)	((x) & 0x0fff)	/* VLAN identifier */
-#define	WRX_VLAN_CFI	(1U << 12)	/* Canonical Form Indicator */
+#define	WRX_VLAN_CFI	__BIT(12)	/* Canonical Form Indicator */
 #define	WRX_VLAN_PRI(x)	(((x) >> 13) & 7)/* VLAN priority field */
 
 /* extended RX descriptor for 82574 */
@@ -348,27 +348,28 @@ typedef struct wiseman_txdesc {
 } __packed wiseman_txdesc_t;
 
 /* Commands for wtx_cmdlen */
-#define	WTX_CMD_EOP	(1U << 24)	/* end of packet */
-#define	WTX_CMD_IFCS	(1U << 25)	/* insert FCS */
-#define	WTX_CMD_RS	(1U << 27)	/* report status */
-#define	WTX_CMD_RPS	(1U << 28)	/* report packet sent */
-#define	WTX_CMD_DEXT	(1U << 29)	/* descriptor extension */
-#define	WTX_CMD_VLE	(1U << 30)	/* VLAN enable */
-#define	WTX_CMD_IDE	(1U << 31)	/* interrupt delay enable */
+#define	WTX_CMD_EOP	__BIT(24)	/* end of packet */
+#define	WTX_CMD_IFCS	__BIT(25)	/* insert FCS */
+#define	WTX_CMD_RS	__BIT(27)	/* report status */
+#define	WTX_CMD_RPS	__BIT(28)	/* report packet sent */
+#define	WTX_CMD_DEXT	__BIT(29)	/* descriptor extension */
+#define	WTX_CMD_VLE	__BIT(30)	/* VLAN enable */
+#define	WTX_CMD_IDE	__BIT(31)	/* interrupt delay enable */
 
 /* Descriptor types (if DEXT is set) */
-#define	WTX_DTYP_C	(0U << 20)	/* context */
-#define	WTX_DTYP_D	(1U << 20)	/* data */
+#define	WTX_DTYP_MASK	__BIT(20)
+#define	WTX_DTYP_C	__SHIFTIN(0, WTX_DTYP_MASK)	/* context */
+#define	WTX_DTYP_D	__SHIFTIN(1, WTX_DTYP_MASK)	/* data */
 
 /* wtx_fields status bits */
-#define	WTX_ST_DD	(1U << 0)	/* descriptor done */
-#define	WTX_ST_EC	(1U << 1)	/* excessive collisions */
-#define	WTX_ST_LC	(1U << 2)	/* late collision */
-#define	WTX_ST_TU	(1U << 3)	/* transmit underrun */
+#define	WTX_ST_DD	__BIT(0)	/* descriptor done */
+#define	WTX_ST_EC	__BIT(1)	/* excessive collisions */
+#define	WTX_ST_LC	__BIT(2)	/* late collision */
+#define	WTX_ST_TU	__BIT(3)	/* transmit underrun */
 
 /* wtx_fields option bits for IP/TCP/UDP checksum offload */
-#define	WTX_IXSM	(1U << 0)	/* IP checksum offload */
-#define	WTX_TXSM	(1U << 1)	/* TCP/UDP checksum offload */
+#define	WTX_IXSM	__BIT(0)	/* IP checksum offload */
+#define	WTX_TXSM	__BIT(1)	/* TCP/UDP checksum offload */
 
 /* Maximum payload per Tx descriptor */
 #define	WTX_MAX_LEN	4096
@@ -384,9 +385,9 @@ struct livengood_tcpip_ctxdesc {

CVS commit: src/sys/dev/pci

2021-12-21 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Dec 22 07:16:44 UTC 2021

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

Log Message:
Use __BIT() some more. Same code before and after.


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

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



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

2021-12-21 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Dec 21 11:02:39 UTC 2021

Modified Files:
src/sys/arch/arm/acpi: acpi_pci_machdep.c

Log Message:
Remove unneeded struct acpi_pci_intr forward declaration.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/arm/acpi/acpi_pci_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/arm/acpi/acpi_pci_machdep.c
diff -u src/sys/arch/arm/acpi/acpi_pci_machdep.c:1.20 src/sys/arch/arm/acpi/acpi_pci_machdep.c:1.21
--- src/sys/arch/arm/acpi/acpi_pci_machdep.c:1.20	Sun Aug  8 12:09:52 2021
+++ src/sys/arch/arm/acpi/acpi_pci_machdep.c	Tue Dec 21 11:02:38 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_pci_machdep.c,v 1.20 2021/08/08 12:09:52 jmcneill Exp $ */
+/* $NetBSD: acpi_pci_machdep.c,v 1.21 2021/12/21 11:02:38 skrll Exp $ */
 
 /*-
  * Copyright (c) 2018, 2020 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
 #define	_INTR_PRIVATE
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: acpi_pci_machdep.c,v 1.20 2021/08/08 12:09:52 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_pci_machdep.c,v 1.21 2021/12/21 11:02:38 skrll Exp $");
 
 #include 
 #include 
@@ -86,8 +86,6 @@ struct acpi_pci_pct {
 static TAILQ_HEAD(, acpi_pci_pct) acpi_pci_chipset_tags =
 TAILQ_HEAD_INITIALIZER(acpi_pci_chipset_tags);
 
-struct acpi_pci_intr;
-
 struct acpi_pci_intr {
 	struct pic_softc		pi_pic;
 	intpi_irqbase;



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

2021-12-21 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Dec 21 11:02:39 UTC 2021

Modified Files:
src/sys/arch/arm/acpi: acpi_pci_machdep.c

Log Message:
Remove unneeded struct acpi_pci_intr forward declaration.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/arm/acpi/acpi_pci_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/dev/usb

2021-12-21 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Dec 21 10:16:05 UTC 2021

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

Log Message:
Remove an empty line


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

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

Modified files:

Index: src/sys/dev/usb/ehci.c
diff -u src/sys/dev/usb/ehci.c:1.294 src/sys/dev/usb/ehci.c:1.295
--- src/sys/dev/usb/ehci.c:1.294	Tue Dec 21 10:14:43 2021
+++ src/sys/dev/usb/ehci.c	Tue Dec 21 10:16:05 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: ehci.c,v 1.294 2021/12/21 10:14:43 skrll Exp $ */
+/*	$NetBSD: ehci.c,v 1.295 2021/12/21 10:16:05 skrll Exp $ */
 
 /*
  * Copyright (c) 2004-2012,2016,2020 The NetBSD Foundation, Inc.
@@ -54,7 +54,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.294 2021/12/21 10:14:43 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.295 2021/12/21 10:16:05 skrll Exp $");
 
 #include "ohci.h"
 #include "uhci.h"
@@ -3163,7 +3163,6 @@ ehci_alloc_sitd(ehci_softc_t *sc)
 	mutex_enter(>sc_lock);
 	freesitd = LIST_FIRST(>sc_freesitds);
 	if (freesitd == NULL) {
-
 		DPRINTF("allocating chunk", 0, 0, 0, 0);
 		mutex_exit(>sc_lock);
 



CVS commit: src/sys/dev/usb

2021-12-21 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Dec 21 10:16:05 UTC 2021

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

Log Message:
Remove an empty line


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

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



CVS commit: src/sys/dev/usb

2021-12-21 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Dec 21 10:14:43 UTC 2021

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

Log Message:
Wrap a long line


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

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

Modified files:

Index: src/sys/dev/usb/ehci.c
diff -u src/sys/dev/usb/ehci.c:1.293 src/sys/dev/usb/ehci.c:1.294
--- src/sys/dev/usb/ehci.c:1.293	Tue Dec 21 09:51:22 2021
+++ src/sys/dev/usb/ehci.c	Tue Dec 21 10:14:43 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: ehci.c,v 1.293 2021/12/21 09:51:22 skrll Exp $ */
+/*	$NetBSD: ehci.c,v 1.294 2021/12/21 10:14:43 skrll Exp $ */
 
 /*
  * Copyright (c) 2004-2012,2016,2020 The NetBSD Foundation, Inc.
@@ -54,7 +54,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.293 2021/12/21 09:51:22 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.294 2021/12/21 10:14:43 skrll Exp $");
 
 #include "ohci.h"
 #include "uhci.h"
@@ -2000,8 +2000,9 @@ ehci_open(struct usbd_pipe *pipe)
 
 	switch (xfertype) {
 	case UE_CONTROL:
-		err = usb_allocmem(sc->sc_bus.ub_dmatag, sizeof(usb_device_request_t),
-		0, USBMALLOC_COHERENT, >ctrl.reqdma);
+		err = usb_allocmem(sc->sc_bus.ub_dmatag,
+		 sizeof(usb_device_request_t), 0, USBMALLOC_COHERENT,
+		 >ctrl.reqdma);
 #ifdef EHCI_DEBUG
 		if (err)
 			printf("ehci_open: usb_allocmem()=%d\n", err);



CVS commit: src/sys/dev/usb

2021-12-21 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Dec 21 10:14:43 UTC 2021

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

Log Message:
Wrap a long line


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

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



CVS commit: src/sys

2021-12-21 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Dec 21 09:51:22 UTC 2021

Modified Files:
src/sys/arch/mips/adm5120/dev: ahci.c
src/sys/dev/usb: ehci.c ohci.c uhci.c usb_mem.c usb_mem.h usbdi.c
xhci.c
src/sys/external/bsd/dwc2: dwc2.c
src/sys/external/bsd/dwc2/dist: dwc2_hcd.c dwc2_hcdddma.c
dwc2_hcdqueue.c

Log Message:
Change the usb_mem API to take a bus_dma_tag_t in usb_allocmem instead of
a struct usbd_bus *.

This allows an HCD to use more than one tag.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/sys/arch/mips/adm5120/dev/ahci.c
cvs rdiff -u -r1.292 -r1.293 src/sys/dev/usb/ehci.c
cvs rdiff -u -r1.317 -r1.318 src/sys/dev/usb/ohci.c
cvs rdiff -u -r1.307 -r1.308 src/sys/dev/usb/uhci.c
cvs rdiff -u -r1.83 -r1.84 src/sys/dev/usb/usb_mem.c
cvs rdiff -u -r1.34 -r1.35 src/sys/dev/usb/usb_mem.h
cvs rdiff -u -r1.219 -r1.220 src/sys/dev/usb/usbdi.c
cvs rdiff -u -r1.150 -r1.151 src/sys/dev/usb/xhci.c
cvs rdiff -u -r1.76 -r1.77 src/sys/external/bsd/dwc2/dwc2.c
cvs rdiff -u -r1.25 -r1.26 src/sys/external/bsd/dwc2/dist/dwc2_hcd.c
cvs rdiff -u -r1.9 -r1.10 src/sys/external/bsd/dwc2/dist/dwc2_hcdddma.c
cvs rdiff -u -r1.15 -r1.16 src/sys/external/bsd/dwc2/dist/dwc2_hcdqueue.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/mips/adm5120/dev/ahci.c
diff -u src/sys/arch/mips/adm5120/dev/ahci.c:1.27 src/sys/arch/mips/adm5120/dev/ahci.c:1.28
--- src/sys/arch/mips/adm5120/dev/ahci.c:1.27	Tue Dec  7 06:49:15 2021
+++ src/sys/arch/mips/adm5120/dev/ahci.c	Tue Dec 21 09:51:22 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: ahci.c,v 1.27 2021/12/07 06:49:15 skrll Exp $	*/
+/*	$NetBSD: ahci.c,v 1.28 2021/12/21 09:51:22 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2007 Ruslan Ermilov and Vsevolod Lobko.
@@ -64,7 +64,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ahci.c,v 1.27 2021/12/07 06:49:15 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ahci.c,v 1.28 2021/12/21 09:51:22 skrll Exp $");
 
 #include 
 #include 
@@ -877,7 +877,7 @@ ahci_device_ctrl_start(struct usbd_xfer 
 		td1 = (struct admhcd_td *)KSEG1ADDR(_v[1]);
 		td2 = (struct admhcd_td *)KSEG1ADDR(_v[2]);
 		td3 = (struct admhcd_td *)KSEG1ADDR(_v[3]);
-		err = usb_allocmem(>sc_bus,
+		err = usb_allocmem(sc->sc_bus.ub_dmatag,
 			sizeof(usb_device_request_t),
 			0, USBMALLOC_COHERENT, );
 		if (err)
@@ -990,7 +990,7 @@ ahci_device_ctrl_start(struct usbd_xfer 
 	usb_transfer_complete(xfer);
 	mutex_exit(>sc_lock);
 
-	usb_freemem(>sc_bus, );
+	usb_freemem();
 
 	return USBD_NORMAL_COMPLETION;
 }

Index: src/sys/dev/usb/ehci.c
diff -u src/sys/dev/usb/ehci.c:1.292 src/sys/dev/usb/ehci.c:1.293
--- src/sys/dev/usb/ehci.c:1.292	Tue Dec 21 08:49:03 2021
+++ src/sys/dev/usb/ehci.c	Tue Dec 21 09:51:22 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: ehci.c,v 1.292 2021/12/21 08:49:03 skrll Exp $ */
+/*	$NetBSD: ehci.c,v 1.293 2021/12/21 09:51:22 skrll Exp $ */
 
 /*
  * Copyright (c) 2004-2012,2016,2020 The NetBSD Foundation, Inc.
@@ -54,7 +54,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.292 2021/12/21 08:49:03 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.293 2021/12/21 09:51:22 skrll Exp $");
 
 #include "ohci.h"
 #include "uhci.h"
@@ -517,7 +517,8 @@ ehci_init(ehci_softc_t *sc)
 	case 2: sc->sc_flsize = 256; break;
 	case 3: return EIO;
 	}
-	err = usb_allocmem(>sc_bus, sc->sc_flsize * sizeof(ehci_link_t),
+	err = usb_allocmem(sc->sc_bus.ub_dmatag,
+	sc->sc_flsize * sizeof(ehci_link_t),
 	EHCI_FLALIGN_ALIGN, USBMALLOC_COHERENT, >sc_fldma);
 	if (err)
 		return err;
@@ -654,7 +655,7 @@ ehci_init(ehci_softc_t *sc)
 	ehci_free_sqh(sc, sc->sc_async_head);
 #endif
  bad1:
-	usb_freemem(>sc_bus, >sc_fldma);
+	usb_freemem(>sc_fldma);
 	return err;
 }
 
@@ -1999,7 +2000,7 @@ ehci_open(struct usbd_pipe *pipe)
 
 	switch (xfertype) {
 	case UE_CONTROL:
-		err = usb_allocmem(>sc_bus, sizeof(usb_device_request_t),
+		err = usb_allocmem(sc->sc_bus.ub_dmatag, sizeof(usb_device_request_t),
 		0, USBMALLOC_COHERENT, >ctrl.reqdma);
 #ifdef EHCI_DEBUG
 		if (err)
@@ -2796,7 +2797,7 @@ ehci_alloc_sqh(ehci_softc_t *sc)
 		mutex_exit(>sc_lock);
 
 		usb_dma_t dma;
-		int err = usb_allocmem(>sc_bus,
+		int err = usb_allocmem(sc->sc_bus.ub_dmatag,
 		EHCI_SQH_SIZE * EHCI_SQH_CHUNK,
 		EHCI_PAGE_SIZE, USBMALLOC_COHERENT, );
 
@@ -2852,7 +2853,7 @@ ehci_alloc_sqtd(ehci_softc_t *sc)
 		mutex_exit(>sc_lock);
 
 		usb_dma_t dma;
-		int err = usb_allocmem(>sc_bus,
+		int err = usb_allocmem(sc->sc_bus.ub_dmatag,
 		EHCI_SQTD_SIZE * EHCI_SQTD_CHUNK,
 		EHCI_PAGE_SIZE, USBMALLOC_COHERENT, );
 
@@ -3112,7 +3113,7 @@ ehci_alloc_itd(ehci_softc_t *sc)
 		mutex_exit(>sc_lock);
 
 		usb_dma_t dma;
-		int err = usb_allocmem(>sc_bus,
+		int err = usb_allocmem(sc->sc_bus.ub_dmatag,
 		EHCI_ITD_SIZE * EHCI_ITD_CHUNK,
 		EHCI_PAGE_SIZE, USBMALLOC_COHERENT, );
 
@@ -3166,7 +3167,7 @@ 

CVS commit: src/sys

2021-12-21 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Dec 21 09:51:22 UTC 2021

Modified Files:
src/sys/arch/mips/adm5120/dev: ahci.c
src/sys/dev/usb: ehci.c ohci.c uhci.c usb_mem.c usb_mem.h usbdi.c
xhci.c
src/sys/external/bsd/dwc2: dwc2.c
src/sys/external/bsd/dwc2/dist: dwc2_hcd.c dwc2_hcdddma.c
dwc2_hcdqueue.c

Log Message:
Change the usb_mem API to take a bus_dma_tag_t in usb_allocmem instead of
a struct usbd_bus *.

This allows an HCD to use more than one tag.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/sys/arch/mips/adm5120/dev/ahci.c
cvs rdiff -u -r1.292 -r1.293 src/sys/dev/usb/ehci.c
cvs rdiff -u -r1.317 -r1.318 src/sys/dev/usb/ohci.c
cvs rdiff -u -r1.307 -r1.308 src/sys/dev/usb/uhci.c
cvs rdiff -u -r1.83 -r1.84 src/sys/dev/usb/usb_mem.c
cvs rdiff -u -r1.34 -r1.35 src/sys/dev/usb/usb_mem.h
cvs rdiff -u -r1.219 -r1.220 src/sys/dev/usb/usbdi.c
cvs rdiff -u -r1.150 -r1.151 src/sys/dev/usb/xhci.c
cvs rdiff -u -r1.76 -r1.77 src/sys/external/bsd/dwc2/dwc2.c
cvs rdiff -u -r1.25 -r1.26 src/sys/external/bsd/dwc2/dist/dwc2_hcd.c
cvs rdiff -u -r1.9 -r1.10 src/sys/external/bsd/dwc2/dist/dwc2_hcdddma.c
cvs rdiff -u -r1.15 -r1.16 src/sys/external/bsd/dwc2/dist/dwc2_hcdqueue.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/usb

2021-12-21 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Dec 21 09:25:17 UTC 2021

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

Log Message:
Pass up bus_dma error from usb_block_allocmem rather than always returning
USBD_NOMEM on error.


To generate a diff of this commit:
cvs rdiff -u -r1.82 -r1.83 src/sys/dev/usb/usb_mem.c

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

Modified files:

Index: src/sys/dev/usb/usb_mem.c
diff -u src/sys/dev/usb/usb_mem.c:1.82 src/sys/dev/usb/usb_mem.c:1.83
--- src/sys/dev/usb/usb_mem.c:1.82	Tue Dec 21 09:23:41 2021
+++ src/sys/dev/usb/usb_mem.c	Tue Dec 21 09:25:17 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: usb_mem.c,v 1.82 2021/12/21 09:23:41 skrll Exp $	*/
+/*	$NetBSD: usb_mem.c,v 1.83 2021/12/21 09:25:17 skrll Exp $	*/
 
 /*
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: usb_mem.c,v 1.82 2021/12/21 09:23:41 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: usb_mem.c,v 1.83 2021/12/21 09:25:17 skrll Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -210,7 +210,7 @@ usb_block_allocmem(bus_dma_tag_t tag, si
 	kmem_free(b, sizeof(*b));
 	mutex_enter(_blk_lock);
 
-	return USBD_NOMEM;
+	return error;
 }
 
 #if 0



CVS commit: src/sys/dev/usb

2021-12-21 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Dec 21 09:25:17 UTC 2021

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

Log Message:
Pass up bus_dma error from usb_block_allocmem rather than always returning
USBD_NOMEM on error.


To generate a diff of this commit:
cvs rdiff -u -r1.82 -r1.83 src/sys/dev/usb/usb_mem.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/usb

2021-12-21 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Dec 21 09:23:41 UTC 2021

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

Log Message:
Style.


To generate a diff of this commit:
cvs rdiff -u -r1.81 -r1.82 src/sys/dev/usb/usb_mem.c

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

Modified files:

Index: src/sys/dev/usb/usb_mem.c
diff -u src/sys/dev/usb/usb_mem.c:1.81 src/sys/dev/usb/usb_mem.c:1.82
--- src/sys/dev/usb/usb_mem.c:1.81	Thu May 27 10:44:29 2021
+++ src/sys/dev/usb/usb_mem.c	Tue Dec 21 09:23:41 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: usb_mem.c,v 1.81 2021/05/27 10:44:29 jmcneill Exp $	*/
+/*	$NetBSD: usb_mem.c,v 1.82 2021/12/21 09:23:41 skrll Exp $	*/
 
 /*
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: usb_mem.c,v 1.81 2021/05/27 10:44:29 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: usb_mem.c,v 1.82 2021/12/21 09:23:41 skrll Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -167,9 +167,8 @@ usb_block_allocmem(bus_dma_tag_t tag, si
 	b->segs = kmem_alloc(b->nsegs * sizeof(*b->segs), KM_SLEEP);
 	b->nsegs_alloc = b->nsegs;
 
-	error = bus_dmamem_alloc(tag, b->size, align, 0,
- b->segs, b->nsegs,
- >nsegs, BUS_DMA_WAITOK);
+	error = bus_dmamem_alloc(tag, b->size, align, 0, b->segs, b->nsegs,
+	>nsegs, BUS_DMA_WAITOK);
 	if (error)
 		goto free0;
 
@@ -178,13 +177,13 @@ usb_block_allocmem(bus_dma_tag_t tag, si
 	if (error)
 		goto free1;
 
-	error = bus_dmamap_create(tag, b->size, b->nsegs, b->size,
-  0, BUS_DMA_WAITOK, >map);
+	error = bus_dmamap_create(tag, b->size, b->nsegs, b->size, 0,
+	BUS_DMA_WAITOK, >map);
 	if (error)
 		goto unmap;
 
 	error = bus_dmamap_load(tag, b->map, b->kaddr, b->size, NULL,
-BUS_DMA_WAITOK);
+	BUS_DMA_WAITOK);
 	if (error)
 		goto destroy;
 



CVS commit: src/sys/dev/usb

2021-12-21 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Dec 21 09:23:41 UTC 2021

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

Log Message:
Style.


To generate a diff of this commit:
cvs rdiff -u -r1.81 -r1.82 src/sys/dev/usb/usb_mem.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/usb

2021-12-21 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Dec 21 08:49:03 UTC 2021

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

Log Message:
KASSERT(BUS_ADDR_HI32(baddr) == 0) in, and apply some consistent code
style to all of ehci_alloc_{sqh,sqtd,itd,sitd}.

While ehci can address memory >4GB for control structures
EHCI_CTRLDSSEGMENT is always set to zero so ehci assumes it's using the
low 4GB.


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

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

Modified files:

Index: src/sys/dev/usb/ehci.c
diff -u src/sys/dev/usb/ehci.c:1.291 src/sys/dev/usb/ehci.c:1.292
--- src/sys/dev/usb/ehci.c:1.291	Sat Dec 18 14:48:14 2021
+++ src/sys/dev/usb/ehci.c	Tue Dec 21 08:49:03 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: ehci.c,v 1.291 2021/12/18 14:48:14 skrll Exp $ */
+/*	$NetBSD: ehci.c,v 1.292 2021/12/21 08:49:03 skrll Exp $ */
 
 /*
  * Copyright (c) 2004-2012,2016,2020 The NetBSD Foundation, Inc.
@@ -54,7 +54,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.291 2021/12/18 14:48:14 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.292 2021/12/21 08:49:03 skrll Exp $");
 
 #include "ohci.h"
 #include "uhci.h"
@@ -2787,8 +2787,6 @@ Static ehci_soft_qh_t *
 ehci_alloc_sqh(ehci_softc_t *sc)
 {
 	ehci_soft_qh_t *sqh;
-	int i, offs;
-	usb_dma_t dma;
 
 	EHCIHIST_FUNC(); EHCIHIST_CALLED();
 
@@ -2797,6 +2795,7 @@ ehci_alloc_sqh(ehci_softc_t *sc)
 		DPRINTF("allocating chunk", 0, 0, 0, 0);
 		mutex_exit(>sc_lock);
 
+		usb_dma_t dma;
 		int err = usb_allocmem(>sc_bus,
 		EHCI_SQH_SIZE * EHCI_SQH_CHUNK,
 		EHCI_PAGE_SIZE, USBMALLOC_COHERENT, );
@@ -2807,12 +2806,17 @@ ehci_alloc_sqh(ehci_softc_t *sc)
 		}
 
 		mutex_enter(>sc_lock);
-		for (i = 0; i < EHCI_SQH_CHUNK; i++) {
-			offs = i * EHCI_SQH_SIZE;
+		for (size_t i = 0; i < EHCI_SQH_CHUNK; i++) {
+			const int offs = i * EHCI_SQH_SIZE;
+			const bus_addr_t baddr = DMAADDR(, offs);
+
+			KASSERT(BUS_ADDR_HI32(baddr) == 0);
+
 			sqh = KERNADDR(, offs);
-			sqh->physaddr = DMAADDR(, offs);
+			sqh->physaddr = BUS_ADDR_LO32(baddr);
 			sqh->dma = dma;
 			sqh->offs = offs;
+
 			sqh->next = sc->sc_freeqhs;
 			sc->sc_freeqhs = sqh;
 		}
@@ -2839,8 +2843,6 @@ Static ehci_soft_qtd_t *
 ehci_alloc_sqtd(ehci_softc_t *sc)
 {
 	ehci_soft_qtd_t *sqtd = NULL;
-	int i, offs;
-	usb_dma_t dma;
 
 	EHCIHIST_FUNC(); EHCIHIST_CALLED();
 
@@ -2849,6 +2851,7 @@ ehci_alloc_sqtd(ehci_softc_t *sc)
 		DPRINTF("allocating chunk", 0, 0, 0, 0);
 		mutex_exit(>sc_lock);
 
+		usb_dma_t dma;
 		int err = usb_allocmem(>sc_bus,
 		EHCI_SQTD_SIZE * EHCI_SQTD_CHUNK,
 		EHCI_PAGE_SIZE, USBMALLOC_COHERENT, );
@@ -2859,10 +2862,14 @@ ehci_alloc_sqtd(ehci_softc_t *sc)
 		}
 
 		mutex_enter(>sc_lock);
-		for (i = 0; i < EHCI_SQTD_CHUNK; i++) {
-			offs = i * EHCI_SQTD_SIZE;
+		for (size_t i = 0; i < EHCI_SQTD_CHUNK; i++) {
+			const int offs = i * EHCI_SQTD_SIZE;
+			const bus_addr_t baddr = DMAADDR(, offs);
+
+			KASSERT(BUS_ADDR_HI32(baddr) == 0);
+
 			sqtd = KERNADDR(, offs);
-			sqtd->physaddr = DMAADDR(, offs);
+			sqtd->physaddr = BUS_ADDR_LO32(baddr);
 			sqtd->dma = dma;
 			sqtd->offs = offs;
 
@@ -3094,7 +3101,6 @@ Static ehci_soft_itd_t *
 ehci_alloc_itd(ehci_softc_t *sc)
 {
 	struct ehci_soft_itd *itd, *freeitd;
-	usb_dma_t dma;
 
 	EHCIHIST_FUNC(); EHCIHIST_CALLED();
 
@@ -3105,6 +3111,7 @@ ehci_alloc_itd(ehci_softc_t *sc)
 		DPRINTF("allocating chunk", 0, 0, 0, 0);
 		mutex_exit(>sc_lock);
 
+		usb_dma_t dma;
 		int err = usb_allocmem(>sc_bus,
 		EHCI_ITD_SIZE * EHCI_ITD_CHUNK,
 		EHCI_PAGE_SIZE, USBMALLOC_COHERENT, );
@@ -3115,12 +3122,17 @@ ehci_alloc_itd(ehci_softc_t *sc)
 		}
 
 		mutex_enter(>sc_lock);
-		for (int i = 0; i < EHCI_ITD_CHUNK; i++) {
-			int offs = i * EHCI_ITD_SIZE;
+		for (size_t i = 0; i < EHCI_ITD_CHUNK; i++) {
+			const int offs = i * EHCI_ITD_SIZE;
+			const bus_addr_t baddr = DMAADDR(, offs);
+
+			KASSERT(BUS_ADDR_HI32(baddr) == 0);
+
 			itd = KERNADDR(, offs);
-			itd->physaddr = DMAADDR(, offs);
+			itd->physaddr = BUS_ADDR_LO32(baddr);
 	 		itd->dma = dma;
 			itd->offs = offs;
+
 			LIST_INSERT_HEAD(>sc_freeitds, itd, free_list);
 		}
 		freeitd = LIST_FIRST(>sc_freeitds);
@@ -3143,17 +3155,17 @@ Static ehci_soft_sitd_t *
 ehci_alloc_sitd(ehci_softc_t *sc)
 {
 	struct ehci_soft_sitd *sitd, *freesitd;
-	int i, offs;
-	usb_dma_t dma;
 
 	EHCIHIST_FUNC(); EHCIHIST_CALLED();
 
 	mutex_enter(>sc_lock);
 	freesitd = LIST_FIRST(>sc_freesitds);
 	if (freesitd == NULL) {
+
 		DPRINTF("allocating chunk", 0, 0, 0, 0);
 		mutex_exit(>sc_lock);
 
+		usb_dma_t dma;
 		int err = usb_allocmem(>sc_bus,
 		EHCI_SITD_SIZE * EHCI_SITD_CHUNK,
 		EHCI_PAGE_SIZE, USBMALLOC_COHERENT, );
@@ -3164,12 +3176,17 @@ ehci_alloc_sitd(ehci_softc_t *sc)
 		}
 
 		mutex_enter(>sc_lock);
-		for (i = 0; i < EHCI_SITD_CHUNK; i++) {
-			offs = i * EHCI_SITD_SIZE;
+		for (size_t i = 0; i < EHCI_SITD_CHUNK; 

CVS commit: src/sys/dev/usb

2021-12-21 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Dec 21 08:49:03 UTC 2021

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

Log Message:
KASSERT(BUS_ADDR_HI32(baddr) == 0) in, and apply some consistent code
style to all of ehci_alloc_{sqh,sqtd,itd,sitd}.

While ehci can address memory >4GB for control structures
EHCI_CTRLDSSEGMENT is always set to zero so ehci assumes it's using the
low 4GB.


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

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



CVS commit: src/sys/uvm

2021-12-21 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Dec 21 08:27:49 UTC 2021

Modified Files:
src/sys/uvm: uvm_pglist.c

Log Message:
Update uvm_pglistalloc_[cs]_ps to return EINVAL if [low, high] doesn't
match any memory.

Useful for bus_dmamem_alloc where a tag might not cover any memory.
This will be used in an update to ehci.

"looks good" from chuq@


To generate a diff of this commit:
cvs rdiff -u -r1.89 -r1.90 src/sys/uvm/uvm_pglist.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/uvm/uvm_pglist.c
diff -u src/sys/uvm/uvm_pglist.c:1.89 src/sys/uvm/uvm_pglist.c:1.90
--- src/sys/uvm/uvm_pglist.c:1.89	Mon Dec 20 22:40:46 2021
+++ src/sys/uvm/uvm_pglist.c	Tue Dec 21 08:27:49 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_pglist.c,v 1.89 2021/12/20 22:40:46 skrll Exp $	*/
+/*	$NetBSD: uvm_pglist.c,v 1.90 2021/12/21 08:27:49 skrll Exp $	*/
 
 /*-
  * Copyright (c) 1997, 2019 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uvm_pglist.c,v 1.89 2021/12/20 22:40:46 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_pglist.c,v 1.90 2021/12/21 08:27:49 skrll Exp $");
 
 #include 
 #include 
@@ -131,7 +131,7 @@ uvm_pglistalloc_c_ps(uvm_physseg_t psi, 
 	 */
 	if (high <= uvm_physseg_get_avail_start(psi) ||
 	low >= uvm_physseg_get_avail_end(psi))
-		return 0;
+		return -1;
 
 	/*
 	 * We start our search at the just after where the last allocation
@@ -456,6 +456,7 @@ uvm_pglistalloc_contig(int num, paddr_t 
 
 	/* Default to "lose". */
 	error = ENOMEM;
+	bool valid = false;
 
 	/*
 	 * Block all memory allocation and lock the free list.
@@ -477,8 +478,12 @@ uvm_pglistalloc_contig(int num, paddr_t 
 			if (uvm_physseg_get_free_list(psi) != fl)
 continue;
 
-			num -= uvm_pglistalloc_c_ps(psi, num, low, high,
-		alignment, boundary, rlist);
+			int done = uvm_pglistalloc_c_ps(psi, num, low, high,
+			alignment, boundary, rlist);
+			if (done >= 0) {
+valid = true;
+num -= done;
+			}
 			if (num == 0) {
 #ifdef PGALLOC_VERBOSE
 printf("pgalloc: %"PRIxMAX"-%"PRIxMAX"\n",
@@ -490,6 +495,10 @@ uvm_pglistalloc_contig(int num, paddr_t 
 			}
 		}
 	}
+	if (!valid) {
+		uvm_pgfl_unlock();
+		return EINVAL;
+	}
 
 out:
 	uvm_pgfl_unlock();
@@ -534,7 +543,7 @@ uvm_pglistalloc_s_ps(uvm_physseg_t psi, 
 	 */
 	if (high <= uvm_physseg_get_avail_start(psi) ||
 	low >= uvm_physseg_get_avail_end(psi))
-		return 0;
+		return -1;
 
 	todo = num;
 	candidate = uimax(low, uvm_physseg_get_avail_start(psi) +
@@ -609,6 +618,7 @@ uvm_pglistalloc_simple(int num, paddr_t 
 
 	/* Default to "lose". */
 	error = ENOMEM;
+	bool valid = false;
 
 again:
 	/*
@@ -632,7 +642,12 @@ again:
 			if (uvm_physseg_get_free_list(psi) != fl)
 continue;
 
-			num -= uvm_pglistalloc_s_ps(psi, num, low, high, rlist);
+			int done = uvm_pglistalloc_s_ps(psi, num, low, high,
+rlist);
+			if (done >= 0) {
+valid = true;
+num -= done;
+			}
 			if (num == 0) {
 error = 0;
 goto out;
@@ -640,6 +655,10 @@ again:
 		}
 
 	}
+	if (!valid) {
+		uvm_pgfl_unlock();
+		return EINVAL;
+	}
 
 out:
 	/*



CVS commit: src/sys/uvm

2021-12-21 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Dec 21 08:27:49 UTC 2021

Modified Files:
src/sys/uvm: uvm_pglist.c

Log Message:
Update uvm_pglistalloc_[cs]_ps to return EINVAL if [low, high] doesn't
match any memory.

Useful for bus_dmamem_alloc where a tag might not cover any memory.
This will be used in an update to ehci.

"looks good" from chuq@


To generate a diff of this commit:
cvs rdiff -u -r1.89 -r1.90 src/sys/uvm/uvm_pglist.c

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



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

2021-12-20 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Dec 21 07:11:02 UTC 2021

Modified Files:
src/sys/arch/arm/pic: pic.c

Log Message:
Fix a bug where pic_establish_intr would fail to call pic_establish_irq
if a free pic__iplsources slot was found, i.e. an interrupt handler at
the same ipl had been disestablished previously.


To generate a diff of this commit:
cvs rdiff -u -r1.77 -r1.78 src/sys/arch/arm/pic/pic.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/pic/pic.c
diff -u src/sys/arch/arm/pic/pic.c:1.77 src/sys/arch/arm/pic/pic.c:1.78
--- src/sys/arch/arm/pic/pic.c:1.77	Tue Dec 21 07:07:32 2021
+++ src/sys/arch/arm/pic/pic.c	Tue Dec 21 07:11:02 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: pic.c,v 1.77 2021/12/21 07:07:32 skrll Exp $	*/
+/*	$NetBSD: pic.c,v 1.78 2021/12/21 07:11:02 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
 #include "opt_multiprocessor.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pic.c,v 1.77 2021/12/21 07:07:32 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pic.c,v 1.78 2021/12/21 07:11:02 skrll Exp $");
 
 #include 
 #include 
@@ -754,42 +754,44 @@ pic_establish_intr(struct pic_softc *pic
 	/*
 	 * First try to use an existing slot which is empty.
 	 */
+	bool found = false;
 	for (off = pic_ipl_offset[ipl]; off < pic_ipl_offset[ipl + 1]; off++) {
 		if (pic__iplsources[off] == NULL) {
-			is->is_iplidx = off - pic_ipl_offset[ipl];
-			pic__iplsources[off] = is;
-			goto unblock;
+			found = true;
+			break;
 		}
 	}
 
-	/*
-	 * Move up all the sources by one.
- 	 */
-	if (ipl < NIPL) {
-		off = pic_ipl_offset[ipl + 1];
-		memmove(__iplsources[off + 1], __iplsources[off],
-		sizeof(pic__iplsources[0]) * (pic_ipl_offset[NIPL] - off));
-	}
+	if (!found) {
+		/*
+		* Move up all the sources by one.
+		*/
+		if (ipl < NIPL) {
+			off = pic_ipl_offset[ipl + 1];
+			memmove(__iplsources[off + 1], __iplsources[off],
+			sizeof(pic__iplsources[0]) * (pic_ipl_offset[NIPL] - off));
+		}
 
-	/*
-	 * Advance the offset of all IPLs higher than this.  Include an
-	 * extra one as well.  Thus the number of sources per ipl is
-	 * pic_ipl_offset[ipl + 1] - pic_ipl_offset[ipl].
-	 */
-	for (nipl = ipl + 1; nipl <= NIPL; nipl++)
-		pic_ipl_offset[nipl]++;
+		/*
+		* Advance the offset of all IPLs higher than this.  Include an
+		* extra one as well.  Thus the number of sources per ipl is
+		* pic_ipl_offset[ipl + 1] - pic_ipl_offset[ipl].
+		*/
+		for (nipl = ipl + 1; nipl <= NIPL; nipl++)
+			pic_ipl_offset[nipl]++;
+
+		off = pic_ipl_offset[ipl + 1] - 1;
+	}
 
 	/*
-	 * Insert into the previously made position at the end of this IPL's
-	 * sources.
+	 * Insert into the 'found' or the just made slot position at the end
+	 * of this IPL's sources.
 	 */
-	off = pic_ipl_offset[ipl + 1] - 1;
 	is->is_iplidx = off - pic_ipl_offset[ipl];
 	pic__iplsources[off] = is;
 
 	(*pic->pic_ops->pic_establish_irq)(pic, is);
 
-unblock:
 	if (!mp_online || !is->is_mpsafe || !is->is_percpu) {
 		(*pic->pic_ops->pic_unblock_irqs)(pic, is->is_irq & ~0x1f,
 		__BIT(is->is_irq & 0x1f));



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

2021-12-20 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Dec 21 07:11:02 UTC 2021

Modified Files:
src/sys/arch/arm/pic: pic.c

Log Message:
Fix a bug where pic_establish_intr would fail to call pic_establish_irq
if a free pic__iplsources slot was found, i.e. an interrupt handler at
the same ipl had been disestablished previously.


To generate a diff of this commit:
cvs rdiff -u -r1.77 -r1.78 src/sys/arch/arm/pic/pic.c

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



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

2021-12-20 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Dec 21 07:07:32 UTC 2021

Modified Files:
src/sys/arch/arm/pic: pic.c

Log Message:
G/C pic_iplsource


To generate a diff of this commit:
cvs rdiff -u -r1.76 -r1.77 src/sys/arch/arm/pic/pic.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/pic/pic.c
diff -u src/sys/arch/arm/pic/pic.c:1.76 src/sys/arch/arm/pic/pic.c:1.77
--- src/sys/arch/arm/pic/pic.c:1.76	Tue Dec 21 06:51:16 2021
+++ src/sys/arch/arm/pic/pic.c	Tue Dec 21 07:07:32 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: pic.c,v 1.76 2021/12/21 06:51:16 skrll Exp $	*/
+/*	$NetBSD: pic.c,v 1.77 2021/12/21 07:07:32 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
 #include "opt_multiprocessor.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pic.c,v 1.76 2021/12/21 06:51:16 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pic.c,v 1.77 2021/12/21 07:07:32 skrll Exp $");
 
 #include 
 #include 
@@ -83,9 +83,6 @@ struct pic_softc *pic_list[PIC_MAXPICS];
 #endif
 struct intrsource *pic_sources[PIC_MAXMAXSOURCES];
 struct intrsource *pic__iplsources[PIC_MAXMAXSOURCES];
-struct intrsource **pic_iplsource[NIPL] = {
-	[0 ... NIPL - 1] = pic__iplsources,
-};
 size_t pic_ipl_offset[NIPL + 1];
 
 static kmutex_t pic_lock;



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

2021-12-20 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Dec 21 07:07:32 UTC 2021

Modified Files:
src/sys/arch/arm/pic: pic.c

Log Message:
G/C pic_iplsource


To generate a diff of this commit:
cvs rdiff -u -r1.76 -r1.77 src/sys/arch/arm/pic/pic.c

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



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

2021-12-20 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Dec 21 06:51:17 UTC 2021

Modified Files:
src/sys/arch/arm/pic: pic.c

Log Message:
KNF


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

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



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

2021-12-20 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Dec 21 06:51:17 UTC 2021

Modified Files:
src/sys/arch/arm/pic: pic.c

Log Message:
KNF


To generate a diff of this commit:
cvs rdiff -u -r1.75 -r1.76 src/sys/arch/arm/pic/pic.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/pic/pic.c
diff -u src/sys/arch/arm/pic/pic.c:1.75 src/sys/arch/arm/pic/pic.c:1.76
--- src/sys/arch/arm/pic/pic.c:1.75	Sun Oct 31 16:29:18 2021
+++ src/sys/arch/arm/pic/pic.c	Tue Dec 21 06:51:16 2021
@@ -1,4 +1,5 @@
-/*	$NetBSD: pic.c,v 1.75 2021/10/31 16:29:18 skrll Exp $	*/
+/*	$NetBSD: pic.c,v 1.76 2021/12/21 06:51:16 skrll Exp $	*/
+
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -33,7 +34,7 @@
 #include "opt_multiprocessor.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pic.c,v 1.75 2021/10/31 16:29:18 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pic.c,v 1.76 2021/12/21 06:51:16 skrll Exp $");
 
 #include 
 #include 
@@ -83,9 +84,9 @@ struct pic_softc *pic_list[PIC_MAXPICS];
 struct intrsource *pic_sources[PIC_MAXMAXSOURCES];
 struct intrsource *pic__iplsources[PIC_MAXMAXSOURCES];
 struct intrsource **pic_iplsource[NIPL] = {
-	[0 ... NIPL-1] = pic__iplsources,
+	[0 ... NIPL - 1] = pic__iplsources,
 };
-size_t pic_ipl_offset[NIPL+1];
+size_t pic_ipl_offset[NIPL + 1];
 
 static kmutex_t pic_lock;
 static size_t pic_sourcebase;
@@ -756,7 +757,7 @@ pic_establish_intr(struct pic_softc *pic
 	/*
 	 * First try to use an existing slot which is empty.
 	 */
-	for (off = pic_ipl_offset[ipl]; off < pic_ipl_offset[ipl+1]; off++) {
+	for (off = pic_ipl_offset[ipl]; off < pic_ipl_offset[ipl + 1]; off++) {
 		if (pic__iplsources[off] == NULL) {
 			is->is_iplidx = off - pic_ipl_offset[ipl];
 			pic__iplsources[off] = is;
@@ -768,15 +769,15 @@ pic_establish_intr(struct pic_softc *pic
 	 * Move up all the sources by one.
  	 */
 	if (ipl < NIPL) {
-		off = pic_ipl_offset[ipl+1];
-		memmove(__iplsources[off+1], __iplsources[off],
+		off = pic_ipl_offset[ipl + 1];
+		memmove(__iplsources[off + 1], __iplsources[off],
 		sizeof(pic__iplsources[0]) * (pic_ipl_offset[NIPL] - off));
 	}
 
 	/*
 	 * Advance the offset of all IPLs higher than this.  Include an
 	 * extra one as well.  Thus the number of sources per ipl is
-	 * pic_ipl_offset[ipl+1] - pic_ipl_offset[ipl].
+	 * pic_ipl_offset[ipl + 1] - pic_ipl_offset[ipl].
 	 */
 	for (nipl = ipl + 1; nipl <= NIPL; nipl++)
 		pic_ipl_offset[nipl]++;



CVS commit: src/sys/uvm

2021-12-20 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon Dec 20 22:40:47 UTC 2021

Modified Files:
src/sys/uvm: uvm_pglist.c

Log Message:
Slight code re-structure and wrap a long line.  Interestingly this gives
the same binary before and after.


To generate a diff of this commit:
cvs rdiff -u -r1.88 -r1.89 src/sys/uvm/uvm_pglist.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/uvm/uvm_pglist.c
diff -u src/sys/uvm/uvm_pglist.c:1.88 src/sys/uvm/uvm_pglist.c:1.89
--- src/sys/uvm/uvm_pglist.c:1.88	Fri Mar 26 09:35:18 2021
+++ src/sys/uvm/uvm_pglist.c	Mon Dec 20 22:40:46 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_pglist.c,v 1.88 2021/03/26 09:35:18 chs Exp $	*/
+/*	$NetBSD: uvm_pglist.c,v 1.89 2021/12/20 22:40:46 skrll Exp $	*/
 
 /*-
  * Copyright (c) 1997, 2019 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uvm_pglist.c,v 1.88 2021/03/26 09:35:18 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_pglist.c,v 1.89 2021/12/20 22:40:46 skrll Exp $");
 
 #include 
 #include 
@@ -125,18 +125,19 @@ uvm_pglistalloc_c_ps(uvm_physseg_t psi, 
 
 	low = atop(low);
 	high = atop(high);
-	alignment = atop(alignment);
 
 	/*
 	 * Make sure that physseg falls within with range to be allocated from.
 	 */
-	if (high <= uvm_physseg_get_avail_start(psi) || low >= uvm_physseg_get_avail_end(psi))
+	if (high <= uvm_physseg_get_avail_start(psi) ||
+	low >= uvm_physseg_get_avail_end(psi))
 		return 0;
 
 	/*
 	 * We start our search at the just after where the last allocation
 	 * succeeded.
 	 */
+	alignment = atop(alignment);
 	candidate = roundup2(uimax(low, uvm_physseg_get_avail_start(psi) +
 		uvm_physseg_get_start_hint(psi)), alignment);
 	limit = uimin(high, uvm_physseg_get_avail_end(psi));
@@ -527,12 +528,6 @@ uvm_pglistalloc_s_ps(uvm_physseg_t psi, 
 
 	low = atop(low);
 	high = atop(high);
-	todo = num;
-	candidate = uimax(low, uvm_physseg_get_avail_start(psi) +
-	uvm_physseg_get_start_hint(psi));
-	limit = uimin(high, uvm_physseg_get_avail_end(psi));
-	pg = uvm_physseg_get_pg(psi, candidate - uvm_physseg_get_start(psi));
-	second_pass = false;
 
 	/*
 	 * Make sure that physseg falls within with range to be allocated from.
@@ -541,6 +536,13 @@ uvm_pglistalloc_s_ps(uvm_physseg_t psi, 
 	low >= uvm_physseg_get_avail_end(psi))
 		return 0;
 
+	todo = num;
+	candidate = uimax(low, uvm_physseg_get_avail_start(psi) +
+	uvm_physseg_get_start_hint(psi));
+	limit = uimin(high, uvm_physseg_get_avail_end(psi));
+	pg = uvm_physseg_get_pg(psi, candidate - uvm_physseg_get_start(psi));
+	second_pass = false;
+
 again:
 	for (;; candidate++, pg++) {
 		if (candidate >= limit) {



CVS commit: src/sys/uvm

2021-12-20 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon Dec 20 22:40:47 UTC 2021

Modified Files:
src/sys/uvm: uvm_pglist.c

Log Message:
Slight code re-structure and wrap a long line.  Interestingly this gives
the same binary before and after.


To generate a diff of this commit:
cvs rdiff -u -r1.88 -r1.89 src/sys/uvm/uvm_pglist.c

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



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

2021-12-20 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon Dec 20 13:58:58 UTC 2021

Modified Files:
src/sys/arch/arm/arm32: bus_dma.c

Log Message:
_bus_dmatag_subregion is always EOPNOTSUPP for !_ARM32_NEED_BUS_DMA_BOUNCE
No need to check {min,max}_addr. Compiler did the right thing, but...


To generate a diff of this commit:
cvs rdiff -u -r1.133 -r1.134 src/sys/arch/arm/arm32/bus_dma.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/arm32/bus_dma.c
diff -u src/sys/arch/arm/arm32/bus_dma.c:1.133 src/sys/arch/arm/arm32/bus_dma.c:1.134
--- src/sys/arch/arm/arm32/bus_dma.c:1.133	Mon Aug 30 22:56:26 2021
+++ src/sys/arch/arm/arm32/bus_dma.c	Mon Dec 20 13:58:58 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus_dma.c,v 1.133 2021/08/30 22:56:26 jmcneill Exp $	*/
+/*	$NetBSD: bus_dma.c,v 1.134 2021/12/20 13:58:58 skrll Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2020 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
 #include "opt_cputypes.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.133 2021/08/30 22:56:26 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.134 2021/12/20 13:58:58 skrll Exp $");
 
 #include 
 
@@ -1889,10 +1889,10 @@ int
 _bus_dmatag_subregion(bus_dma_tag_t tag, bus_addr_t min_addr,
 bus_addr_t max_addr, bus_dma_tag_t *newtag, int flags)
 {
+#ifdef _ARM32_NEED_BUS_DMA_BOUNCE
 	if (min_addr >= max_addr)
 		return EOPNOTSUPP;
 
-#ifdef _ARM32_NEED_BUS_DMA_BOUNCE
 	struct arm32_dma_range *dr;
 	bool psubset = true;
 	size_t nranges = 0;



  1   2   3   4   5   6   7   8   9   10   >