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

2022-08-14 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Mon Aug 15 04:58:52 UTC 2022

Modified Files:
src/sys/arch/atari/conf: MILAN-ISAIDE MILAN-PCIIDE

Log Message:
Regen from MILAN.in rev 1.30.

> Specify options FONT_VT220L8x16 to get similar glyphs as past font_8x16.c.


To generate a diff of this commit:
cvs rdiff -u -r1.98 -r1.99 src/sys/arch/atari/conf/MILAN-ISAIDE
cvs rdiff -u -r1.102 -r1.103 src/sys/arch/atari/conf/MILAN-PCIIDE

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/atari/conf/MILAN-ISAIDE
diff -u src/sys/arch/atari/conf/MILAN-ISAIDE:1.98 src/sys/arch/atari/conf/MILAN-ISAIDE:1.99
--- src/sys/arch/atari/conf/MILAN-ISAIDE:1.98	Sun Aug  7 02:55:46 2022
+++ src/sys/arch/atari/conf/MILAN-ISAIDE	Mon Aug 15 04:58:52 2022
@@ -1,11 +1,11 @@
 #
-# $NetBSD: MILAN-ISAIDE,v 1.98 2022/08/07 02:55:46 simonb Exp $
+# $NetBSD: MILAN-ISAIDE,v 1.99 2022/08/15 04:58:52 tsutsui Exp $
 #
 # This file was automatically created. Changes will be
 # lost when running makeconf in this directory.
 #
 # Created from:
-#		NetBSD: MILAN.in,v 1.29 2019/05/04 13:12:03 tsutsui Exp $
+#		NetBSD: MILAN.in,v 1.30 2022/08/15 04:40:20 tsutsui Exp $
 #		NetBSD: GENERIC.in,v 1.124 2022/08/07 02:52:24 simonb Exp $
 include "arch/atari/conf/std.milan"
 options INCLUDE_CONFIG_FILE # embed config file in kernel binary
@@ -83,6 +83,7 @@ options WS_KERNEL_BG=WSCOL_BLACK
 options WSDISPLAY_COMPAT_USL # wsconscfg VT handling
 options WSDISPLAY_DEFAULTSCREENS=4
 options PCDISPLAY_SOFTCURSOR
+options FONT_VT220L8x16
 isab0 at mainbus0 # ISA-bus
 isa0 at isab0
 pcib0 at mainbus0 # PCI-bus

Index: src/sys/arch/atari/conf/MILAN-PCIIDE
diff -u src/sys/arch/atari/conf/MILAN-PCIIDE:1.102 src/sys/arch/atari/conf/MILAN-PCIIDE:1.103
--- src/sys/arch/atari/conf/MILAN-PCIIDE:1.102	Sun Aug  7 02:55:46 2022
+++ src/sys/arch/atari/conf/MILAN-PCIIDE	Mon Aug 15 04:58:52 2022
@@ -1,11 +1,11 @@
 #
-# $NetBSD: MILAN-PCIIDE,v 1.102 2022/08/07 02:55:46 simonb Exp $
+# $NetBSD: MILAN-PCIIDE,v 1.103 2022/08/15 04:58:52 tsutsui Exp $
 #
 # This file was automatically created. Changes will be
 # lost when running makeconf in this directory.
 #
 # Created from:
-#		NetBSD: MILAN.in,v 1.29 2019/05/04 13:12:03 tsutsui Exp $
+#		NetBSD: MILAN.in,v 1.30 2022/08/15 04:40:20 tsutsui Exp $
 #		NetBSD: GENERIC.in,v 1.124 2022/08/07 02:52:24 simonb Exp $
 include "arch/atari/conf/std.milan"
 options INCLUDE_CONFIG_FILE # embed config file in kernel binary
@@ -83,6 +83,7 @@ options WS_KERNEL_BG=WSCOL_BLACK
 options WSDISPLAY_COMPAT_USL # wsconscfg VT handling
 options WSDISPLAY_DEFAULTSCREENS=4
 options PCDISPLAY_SOFTCURSOR
+options FONT_VT220L8x16
 isab0 at mainbus0 # ISA-bus
 isa0 at isab0
 pcib0 at mainbus0 # PCI-bus



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

2022-08-14 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Mon Aug 15 04:58:52 UTC 2022

Modified Files:
src/sys/arch/atari/conf: MILAN-ISAIDE MILAN-PCIIDE

Log Message:
Regen from MILAN.in rev 1.30.

> Specify options FONT_VT220L8x16 to get similar glyphs as past font_8x16.c.


To generate a diff of this commit:
cvs rdiff -u -r1.98 -r1.99 src/sys/arch/atari/conf/MILAN-ISAIDE
cvs rdiff -u -r1.102 -r1.103 src/sys/arch/atari/conf/MILAN-PCIIDE

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



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

2022-08-14 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Mon Aug 15 04:40:20 UTC 2022

Modified Files:
src/sys/arch/atari/conf: MILAN.in

Log Message:
Specify options FONT_VT220L8x16 to get similar glyphs as past font_8x16.c.


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/sys/arch/atari/conf/MILAN.in

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/atari/conf/MILAN.in
diff -u src/sys/arch/atari/conf/MILAN.in:1.29 src/sys/arch/atari/conf/MILAN.in:1.30
--- src/sys/arch/atari/conf/MILAN.in:1.29	Sat May  4 13:12:03 2019
+++ src/sys/arch/atari/conf/MILAN.in	Mon Aug 15 04:40:20 2022
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: MILAN.in,v 1.29 2019/05/04 13:12:03 tsutsui Exp $
+#	$NetBSD: MILAN.in,v 1.30 2022/08/15 04:40:20 tsutsui Exp $
 #
 # Milan
 #
@@ -34,6 +34,8 @@ options 	WSDISPLAY_DEFAULTSCREENS=4
 options 	PCDISPLAY_SOFTCURSOR
 # modify the screen type of the console; defaults to "80x25"
 #options 	VGA_CONSOLE_SCREENTYPE="\"80x25\""
+# use explicit WSDISPLAY_FONTENC_IBM font that MI vga(4) assumes
+options 	FONT_VT220L8x16
 
 #
 # The following sections describe various hardware options.



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

2022-08-14 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Mon Aug 15 04:40:20 UTC 2022

Modified Files:
src/sys/arch/atari/conf: MILAN.in

Log Message:
Specify options FONT_VT220L8x16 to get similar glyphs as past font_8x16.c.


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/sys/arch/atari/conf/MILAN.in

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



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

2022-08-14 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Mon Aug 15 04:37:47 UTC 2022

Modified Files:
src/sys/arch/atari/pci: pci_vga.c

Log Message:
Improve VGA console settings for Milan, especially for sysinst.

- use explicit WSDISPLAY_FONTENC_IBM font that MI vga(4) assumes
  (so that box drawing characters are rendered properly)
- set ATC and DAC palette settings for proper colors
  (copied from MI vga_subr.c for now because HADES doesn't use mi vga(4))

Tested on Milan with S3 Trio64.  (XXX: needs working HADES with ET4000)


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/atari/pci/pci_vga.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/atari/pci/pci_vga.c
diff -u src/sys/arch/atari/pci/pci_vga.c:1.18 src/sys/arch/atari/pci/pci_vga.c:1.19
--- src/sys/arch/atari/pci/pci_vga.c:1.18	Sat Jul 31 20:51:32 2021
+++ src/sys/arch/atari/pci/pci_vga.c	Mon Aug 15 04:37:46 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: pci_vga.c,v 1.18 2021/07/31 20:51:32 andvar Exp $	*/
+/*	$NetBSD: pci_vga.c,v 1.19 2022/08/15 04:37:46 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1999 Leo Weppelman.  All rights reserved.
@@ -25,7 +25,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pci_vga.c,v 1.18 2021/07/31 20:51:32 andvar Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pci_vga.c,v 1.19 2022/08/15 04:37:46 tsutsui Exp $");
 
 #include 
 #include 
@@ -55,11 +55,51 @@ extern font_info	font_info_8x8;
 extern font_info	font_info_8x16;
 
 /* Console colors */
-static const uint8_t conscolors[3][3] = {
-	/* background, foreground, hilite */
-	{ 0x00, 0x00, 0x00 },
-	{ 0x30, 0x30, 0x30 },
-	{ 0x3f, 0x3f, 0x3f }
+/* attribute controller registers */
+static const uint8_t vga_atc[] = {
+	0x00,	/* 00: internal palette  0 */
+	0x01,	/* 01: internal palette  1 */
+	0x02,	/* 02: internal palette  2 */
+	0x03,	/* 03: internal palette  3 */
+	0x04,	/* 04: internal palette  4 */
+	0x05,	/* 05: internal palette  5 */
+	0x14,	/* 06: internal palette  6 */
+	0x07,	/* 07: internal palette  7 */
+	0x38,	/* 08: internal palette  8 */
+	0x39,	/* 09: internal palette  9 */
+	0x3a,	/* 0A: internal palette 10 */
+	0x3b,	/* 0B: internal palette 11 */
+	0x3c,	/* 0C: internal palette 12 */
+	0x3d,	/* 0D: internal palette 13 */
+	0x3e,	/* 0E: internal palette 14 */
+	0x3f,	/* 0F: internal palette 15 */
+	0x0c,	/* 10: attribute mode control */
+	0x00,	/* 11: overscan color */
+	0x0f,	/* 12: color plane enable */
+	0x08,	/* 13: horizontal PEL panning */
+	0x00	/* 14: color select */
+};
+
+/* video DAC palette registers */
+/* XXX only set up 16 colors used by internal palette in ATC regsters */
+static const uint8_t vga_dacpal[] = {
+	/* R G B */
+	0x00, 0x00, 0x00,	/* BLACK*/
+	0x00, 0x00, 0x2a,	/* BLUE	*/
+	0x00, 0x2a, 0x00,	/* GREEN*/
+	0x00, 0x2a, 0x2a,	/* CYAN */
+	0x2a, 0x00, 0x00,	/* RED  */
+	0x2a, 0x00, 0x2a,	/* MAGENTA  */
+	0x2a, 0x15, 0x00,	/* BROWN*/
+	0x2a, 0x2a, 0x2a,	/* LIGHTGREY*/
+	0x15, 0x15, 0x15,	/* DARKGREY */
+	0x15, 0x15, 0x3f,	/* LIGHTBLUE*/
+	0x15, 0x3f, 0x15,	/* LIGHTGREEN   */
+	0x15, 0x3f, 0x3f,	/* LIGHTCYAN*/
+	0x3f, 0x15, 0x15,	/* LIGHTRED */
+	0x3f, 0x15, 0x3f,	/* LIGHTMAGENTA */
+	0x3f, 0x3f, 0x15,	/* YELLOW   */
+	0x3f, 0x3f, 0x3f	/* WHITE*/
 };
 
 static bus_space_tag_t	vga_iot, vga_memt;
@@ -79,7 +119,7 @@ check_for_vga(bus_space_tag_t iot, bus_s
 	pci_chipset_tag_t	pc = NULL; /* XXX */
 	bus_space_handle_t	ioh_regs, memh_fb;
 	pcitag_t		tag;
-	int			device, found, maxndevs, i, j;
+	int			device, found, maxndevs, i;
 	int			got_ioh, got_memh, rv;
 	uint32_t		id, class;
 	volatile uint8_t	*regs;
@@ -176,16 +216,23 @@ check_for_vga(bus_space_tag_t iot, bus_s
 	 * Generic parts of the initialization...
 	 */
 	
-	/* B&W colors */
-	vgaw(regs, VDAC_ADDRESS_W, 0);
-	for (i = 0; i < 256; i++) {
-		j = (i & 1) ? ((i > 7) ? 2 : 1) : 0;
-		vgaw(regs, VDAC_DATA, conscolors[j][0]);
-		vgaw(regs, VDAC_DATA, conscolors[j][1]);
-		vgaw(regs, VDAC_DATA, conscolors[j][2]);
+	/* set ATC registers */
+	for (i = 0; i < 21; i++)
+		WAttr(regs, i, vga_atc[i]);
+
+	/* set DAC palette */
+	for (i = 0; i < 16; i++) {
+		vgaw(regs, VDAC_ADDRESS_W, vga_atc[i]);
+		vgaw(regs, VDAC_DATA, vga_dacpal[i * 3 + 0]);
+		vgaw(regs, VDAC_DATA, vga_dacpal[i * 3 + 1]);
+		vgaw(regs, VDAC_DATA, vga_dacpal[i * 3 + 2]);
 	}
 
 	loadfont(regs, fb);
+#if NVGA_PCI > 0
+	/* use explicit WSDISPLAY_FONTENC_IBM font that MI vga(4) assumes */
+	vga_no_builtinfont = 1;
+#endif
 
 	/*
 	 * Clear the screen and print a message. The latter



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

2022-08-14 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Mon Aug 15 04:37:47 UTC 2022

Modified Files:
src/sys/arch/atari/pci: pci_vga.c

Log Message:
Improve VGA console settings for Milan, especially for sysinst.

- use explicit WSDISPLAY_FONTENC_IBM font that MI vga(4) assumes
  (so that box drawing characters are rendered properly)
- set ATC and DAC palette settings for proper colors
  (copied from MI vga_subr.c for now because HADES doesn't use mi vga(4))

Tested on Milan with S3 Trio64.  (XXX: needs working HADES with ET4000)


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/atari/pci/pci_vga.c

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



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

2022-08-14 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Aug 14 23:09:30 UTC 2022

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

Log Message:
x86/genfb: Disable shadowfb by default.

The motivation for this was obviated by mapping the framebuffer
write-combining instead of uncacheable.

If this still appears to be needed, most likely the mapping is still
wrong and that should be fixed directly, or this should be enabled
only in the circumstances where the mapping can't be made right.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/x86/x86/genfb_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/x86/x86/genfb_machdep.c
diff -u src/sys/arch/x86/x86/genfb_machdep.c:1.17 src/sys/arch/x86/x86/genfb_machdep.c:1.18
--- src/sys/arch/x86/x86/genfb_machdep.c:1.17	Sat Jul 16 06:27:24 2022
+++ src/sys/arch/x86/x86/genfb_machdep.c	Sun Aug 14 23:09:30 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: genfb_machdep.c,v 1.17 2022/07/16 06:27:24 mlelstv Exp $ */
+/* $NetBSD: genfb_machdep.c,v 1.18 2022/08/14 23:09:30 riastradh Exp $ */
 
 /*-
  * Copyright (c) 2009 Jared D. McNeill 
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: genfb_machdep.c,v 1.17 2022/07/16 06:27:24 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: genfb_machdep.c,v 1.18 2022/08/14 23:09:30 riastradh Exp $");
 
 #include 
 #include 
@@ -59,7 +59,7 @@ __KERNEL_RCSID(0, "$NetBSD: genfb_machde
 
 #if NWSDISPLAY > 0 && NGENFB > 0
 struct vcons_screen x86_genfb_console_screen;
-bool x86_genfb_use_shadowfb = true;
+bool x86_genfb_use_shadowfb = false;
 
 #if NACPICA > 0
 extern int acpi_md_vesa_modenum;



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

2022-08-14 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Aug 14 23:09:30 UTC 2022

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

Log Message:
x86/genfb: Disable shadowfb by default.

The motivation for this was obviated by mapping the framebuffer
write-combining instead of uncacheable.

If this still appears to be needed, most likely the mapping is still
wrong and that should be fixed directly, or this should be enabled
only in the circumstances where the mapping can't be made right.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/x86/x86/genfb_machdep.c

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



CVS commit: src/usr.bin/make

2022-08-14 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Sun Aug 14 22:11:20 UTC 2022

Modified Files:
src/usr.bin/make: make.1

Log Message:
make(1): mark up the variable expansion example


To generate a diff of this commit:
cvs rdiff -u -r1.329 -r1.330 src/usr.bin/make/make.1

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

Modified files:

Index: src/usr.bin/make/make.1
diff -u src/usr.bin/make/make.1:1.329 src/usr.bin/make/make.1:1.330
--- src/usr.bin/make/make.1:1.329	Sun Aug 14 21:57:26 2022
+++ src/usr.bin/make/make.1	Sun Aug 14 22:11:20 2022
@@ -1,4 +1,4 @@
-.\"	$NetBSD: make.1,v 1.329 2022/08/14 21:57:26 uwe Exp $
+.\"	$NetBSD: make.1,v 1.330 2022/08/14 22:11:20 uwe Exp $
 .\"
 .\" Copyright (c) 1990, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -1282,7 +1282,9 @@ variable (where a
 is white-space delimited sequence of characters).
 The general format of a variable expansion is as follows:
 .Pp
-.Dl ${variable[:modifier[:...]]}
+.Sm off
+.D1 Ic \&${ Ar variable\| Oo Ic \&: Ar modifier\| Oo Ic \&: Ar ... Oc Oc Ic \&}
+.Sm on
 .Pp
 Each modifier begins with a colon,
 which may be escaped with a backslash
@@ -1290,13 +1292,21 @@ which may be escaped with a backslash
 .Pp
 A set of modifiers can be specified via a variable, as follows:
 .Pp
-.Dl modifier_variable=modifier[:...]
-.Dl ${variable:${modifier_variable}[:...]}
+.Bd -literal -offset indent
+.Ar modifier_variable\^ Li \&= Ar modifier Ns Oo Ic \&: Ns Ar ... Oc
+.Sm off
+.Ic \&${ Ar variable Ic \&:${ Ar modifier_variable Ic \&} Oo Ic \&: Ar ... Oc Ic \&}
+.Sm on
+.Ed
 .Pp
-In this case the first modifier in the modifier_variable does not
+In this case the first modifier in the
+.Ar modifier_variable
+does not
 start with a colon, since that must appear in the referencing
 variable.
-If any of the modifiers in the modifier_variable contain a dollar sign
+If any of the modifiers in the
+.Ar modifier_variable
+contain a dollar sign
 .Pq Ql $ ,
 these must be doubled to avoid early expansion.
 .Pp



CVS commit: src/usr.bin/make

2022-08-14 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Sun Aug 14 22:11:20 UTC 2022

Modified Files:
src/usr.bin/make: make.1

Log Message:
make(1): mark up the variable expansion example


To generate a diff of this commit:
cvs rdiff -u -r1.329 -r1.330 src/usr.bin/make/make.1

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



CVS commit: src/usr.bin/make

2022-08-14 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Sun Aug 14 21:57:27 UTC 2022

Modified Files:
src/usr.bin/make: make.1

Log Message:
make(1): use .Dl for .MAKE.JOB.PREFIX examples


To generate a diff of this commit:
cvs rdiff -u -r1.328 -r1.329 src/usr.bin/make/make.1

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

Modified files:

Index: src/usr.bin/make/make.1
diff -u src/usr.bin/make/make.1:1.328 src/usr.bin/make/make.1:1.329
--- src/usr.bin/make/make.1:1.328	Sun Aug 14 21:53:58 2022
+++ src/usr.bin/make/make.1	Sun Aug 14 21:57:26 2022
@@ -1,4 +1,4 @@
-.\"	$NetBSD: make.1,v 1.328 2022/08/14 21:53:58 uwe Exp $
+.\"	$NetBSD: make.1,v 1.329 2022/08/14 21:57:26 uwe Exp $
 .\"
 .\" Copyright (c) 1990, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -895,7 +895,7 @@ If
 is run with
 .Fl j ,
 the output for each target is prefixed with a token
-.Ql --- target ---
+.Dl --- Ar target Li ---
 the first part of which can be controlled via
 .Va .MAKE.JOB.PREFIX .
 If
@@ -904,9 +904,9 @@ is empty, no token is printed.
 For example, setting
 .Va .MAKE.JOB.PREFIX
 to
-.Li ${.newline}---${.MAKE:T}[${.MAKE.PID}]
+.Ql ${.newline}---${.MAKE:T}[${.MAKE.PID}]
 would produce tokens like
-.Ql ---make[1234] target ---
+.Dl ---make[1234] Ar target Li ---
 making it easier to track the degree of parallelism being achieved.
 .It Va .MAKE.TARGET_LOCAL_VARIABLES
 If set to



CVS commit: src/usr.bin/make

2022-08-14 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Sun Aug 14 21:57:27 UTC 2022

Modified Files:
src/usr.bin/make: make.1

Log Message:
make(1): use .Dl for .MAKE.JOB.PREFIX examples


To generate a diff of this commit:
cvs rdiff -u -r1.328 -r1.329 src/usr.bin/make/make.1

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



CVS commit: src/usr.bin/make

2022-08-14 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Sun Aug 14 21:53:58 UTC 2022

Modified Files:
src/usr.bin/make: make.1

Log Message:
make(1): prettify .for index variable example


To generate a diff of this commit:
cvs rdiff -u -r1.327 -r1.328 src/usr.bin/make/make.1

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

Modified files:

Index: src/usr.bin/make/make.1
diff -u src/usr.bin/make/make.1:1.327 src/usr.bin/make/make.1:1.328
--- src/usr.bin/make/make.1:1.327	Sun Aug 14 21:48:05 2022
+++ src/usr.bin/make/make.1	Sun Aug 14 21:53:58 2022
@@ -1,4 +1,4 @@
-.\"	$NetBSD: make.1,v 1.327 2022/08/14 21:48:05 uwe Exp $
+.\"	$NetBSD: make.1,v 1.328 2022/08/14 21:53:58 uwe Exp $
 .\"
 .\" Copyright (c) 1990, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -674,38 +674,42 @@ but only as far as necessary to determin
 Variables in shell commands are expanded when the shell command is
 executed.
 .It
-.Dq .for
+.Ic .for
 loop index variables are expanded on each loop iteration.
 Note that other variables are not expanded when composing the body of a loop,
 so the following example code:
 .Bd -literal -offset indent
-
-.Dv .for i in 1 2 3
+\&.for i in 1 2 3
 a+= ${i}
 j=  ${i}
 b+= ${j}
-.Dv .endfor
+\&.endfor
 
 all:
 	@echo ${a}
 	@echo ${b}
-
 .Ed
+.Pp
 will print:
 .Bd -literal -offset indent
 1 2 3
 3 3 3
-
 .Ed
-Because while ${a} contains
-.Dq 1 2 3
-after the loop is executed, ${b}
+.Pp
+Because while
+.Va a
+contains
+.Ql 1 2 3
+after the loop is executed,
+.Va b
 contains
-.Dq ${j} ${j} ${j}
+.Ql ${j} ${j} ${j}
 which expands to
-.Dq 3 3 3
-since after the loop completes ${j} contains
-.Dq 3 .
+.Ql 3 3 3
+since after the loop completes
+.Va j
+contains
+.Ql 3 .
 .El
 .Ss Variable classes
 The four different classes of variables (in order of increasing precedence)



CVS commit: src/usr.bin/make

2022-08-14 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Sun Aug 14 21:53:58 UTC 2022

Modified Files:
src/usr.bin/make: make.1

Log Message:
make(1): prettify .for index variable example


To generate a diff of this commit:
cvs rdiff -u -r1.327 -r1.328 src/usr.bin/make/make.1

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



CVS commit: src/usr.bin/make

2022-08-14 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Sun Aug 14 21:48:05 UTC 2022

Modified Files:
src/usr.bin/make: make.1

Log Message:
make(1): more .Va fixes


To generate a diff of this commit:
cvs rdiff -u -r1.326 -r1.327 src/usr.bin/make/make.1

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

Modified files:

Index: src/usr.bin/make/make.1
diff -u src/usr.bin/make/make.1:1.326 src/usr.bin/make/make.1:1.327
--- src/usr.bin/make/make.1:1.326	Sun Aug 14 20:19:27 2022
+++ src/usr.bin/make/make.1	Sun Aug 14 21:48:05 2022
@@ -1,4 +1,4 @@
-.\"	$NetBSD: make.1,v 1.326 2022/08/14 20:19:27 uwe Exp $
+.\"	$NetBSD: make.1,v 1.327 2022/08/14 21:48:05 uwe Exp $
 .\"
 .\" Copyright (c) 1990, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -757,7 +757,7 @@ which have already been expanded.
 .El
 .Pp
 The seven built-in local variables are as follows:
-.Bl -tag -width ".ARCHIVE" -offset indent
+.Bl -tag -width ".Va .ARCHIVE" -offset indent
 .It Va .ALLSRC
 The list of all sources for this target; also known as
 .Sq Va \&> .
@@ -789,19 +789,21 @@ or it will not be recognized.
 The name of the target; also known as
 .Sq Va @ .
 For compatibility with other makes this is an alias for
-.Ic .ARCHIVE
+.Va .ARCHIVE
 in archive member rules.
 .El
 .Pp
 The shorter forms
-.Ql ( Va > ,
+.Po
+.Sq Va \&> ,
 .Sq Va \&! ,
-.Sq Va < ,
-.Sq Va % ,
+.Sq Va \&< ,
+.Sq Va \&% ,
 .Sq Va \&? ,
-.Sq Va * ,
+.Sq Va \&* ,
 and
-.Sq Va @ )
+.Sq Va \&@
+.Pc
 are permitted for backward
 compatibility with historical makefiles and legacy POSIX make and are
 not recommended.
@@ -811,7 +813,7 @@ Variants of these variables with the pun
 or
 .Ql F ,
 e.g.\&
-.Sq Va $(@D) ,
+.Ql $(@D) ,
 are legacy forms equivalent to using the
 .Ql :H
 and
@@ -1096,7 +1098,7 @@ The process-id of
 The parent process-id of
 .Nm .
 .It Va .MAKE.SAVE_DOLLARS
-value should be a boolean that controls whether
+Value should be a boolean that controls whether
 .Ql $$
 are preserved when doing
 .Ql :=



CVS commit: src/usr.bin/make

2022-08-14 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Sun Aug 14 21:48:05 UTC 2022

Modified Files:
src/usr.bin/make: make.1

Log Message:
make(1): more .Va fixes


To generate a diff of this commit:
cvs rdiff -u -r1.326 -r1.327 src/usr.bin/make/make.1

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



CVS commit: src/sys/dev/mii

2022-08-14 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Aug 14 20:34:26 UTC 2022

Modified Files:
src/sys/dev/mii: mii.c mii_physubr.c miivar.h

Log Message:
mii(4): Wait for MIIF_DOINGAUTO to clear with MIIF_AUTOTSLEEP too.

Otherwise mii_phy_detach may return while mii_phy_auto_timeout_locked
is still in progress in another thread.

Reuse the storage for mii_nway_ch, which is unused if MIIF_AUTOTSLEEP
is set, for a new condvar in a union.  This doesn't change the kernel
ABI because sizeof(struct kcondvar) <= sizeof(struct callout) and
both have the same alignment, for an array of void *.


To generate a diff of this commit:
cvs rdiff -u -r1.57 -r1.58 src/sys/dev/mii/mii.c
cvs rdiff -u -r1.98 -r1.99 src/sys/dev/mii/mii_physubr.c
cvs rdiff -u -r1.74 -r1.75 src/sys/dev/mii/miivar.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/mii/mii.c
diff -u src/sys/dev/mii/mii.c:1.57 src/sys/dev/mii/mii.c:1.58
--- src/sys/dev/mii/mii.c:1.57	Sat Aug  7 16:19:13 2021
+++ src/sys/dev/mii/mii.c	Sun Aug 14 20:34:26 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: mii.c,v 1.57 2021/08/07 16:19:13 thorpej Exp $	*/
+/*	$NetBSD: mii.c,v 1.58 2022/08/14 20:34:26 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2000, 2020 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: mii.c,v 1.57 2021/08/07 16:19:13 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mii.c,v 1.58 2022/08/14 20:34:26 riastradh Exp $");
 
 #define	__IFMEDIA_PRIVATE
 
@@ -179,7 +179,10 @@ mii_attach(device_t parent, struct mii_d
 	.locators = locs)));
 		if (child) {
 			/* Link it up in the parent's MII data. */
-			callout_init(&child->mii_nway_ch, 0);
+			if (child->mii_flags & MIIF_AUTOTSLEEP)
+cv_init(&child->mii_nway_cv, "miiauto");
+			else
+callout_init(&child->mii_nway_ch, 0);
 			mii_lock(mii);
 			LIST_INSERT_HEAD(&mii->mii_phys, child, mii_list);
 			child->mii_offset = offset;

Index: src/sys/dev/mii/mii_physubr.c
diff -u src/sys/dev/mii/mii_physubr.c:1.98 src/sys/dev/mii/mii_physubr.c:1.99
--- src/sys/dev/mii/mii_physubr.c:1.98	Sun Aug 14 20:33:57 2022
+++ src/sys/dev/mii/mii_physubr.c	Sun Aug 14 20:34:26 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: mii_physubr.c,v 1.98 2022/08/14 20:33:57 riastradh Exp $	*/
+/*	$NetBSD: mii_physubr.c,v 1.99 2022/08/14 20:34:26 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: mii_physubr.c,v 1.98 2022/08/14 20:33:57 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mii_physubr.c,v 1.99 2022/08/14 20:34:26 riastradh Exp $");
 
 #include 
 #include 
@@ -282,6 +282,8 @@ mii_phy_auto(struct mii_softc *sc)
 		sc->mii_flags |= MIIF_DOINGAUTO;
 		kpause("miiaut", false, hz >> 1, mii->mii_media.ifm_lock);
 		mii_phy_auto_timeout_locked(sc);
+		KASSERT((sc->mii_flags & MIIF_DOINGAUTO) == 0);
+		cv_broadcast(&sc->mii_nway_cv);
 	} else if ((sc->mii_flags & MIIF_DOINGAUTO) == 0) {
 		sc->mii_flags |= MIIF_DOINGAUTO;
 		callout_reset(&sc->mii_nway_ch, hz >> 1,
@@ -309,6 +311,7 @@ mii_phy_auto_timeout_locked(struct mii_s
 {
 
 	KASSERT(mii_locked(sc->mii_pdata));
+	KASSERT(sc->mii_flags & MIIF_DOINGAUTO);
 
 	if (!device_is_active(sc->mii_dev))
 		return;
@@ -432,7 +435,8 @@ mii_phy_down(struct mii_softc *sc)
 
 	KASSERT(mii_locked(sc->mii_pdata));
 
-	if (sc->mii_flags & MIIF_DOINGAUTO) {
+	if ((sc->mii_flags & (MIIF_DOINGAUTO|MIIF_AUTOTSLEEP)) ==
+	(MIIF_DOINGAUTO|MIIF_AUTOTSLEEP)) {
 		/*
 		 * Try to stop it.
 		 *
@@ -688,13 +692,23 @@ mii_phy_detach(device_t self, int flags)
 	struct mii_softc *sc = device_private(self);
 
 	mii_lock(sc->mii_pdata);
-	if (sc->mii_flags & MIIF_DOINGAUTO) {
-		callout_halt(&sc->mii_nway_ch,
-		sc->mii_pdata->mii_media.ifm_lock);
+	if (sc->mii_flags & MIIF_AUTOTSLEEP) {
+		while (sc->mii_flags & MIIF_DOINGAUTO) {
+			cv_wait(&sc->mii_nway_cv,
+			sc->mii_pdata->mii_media.ifm_lock);
+		}
+	} else {
+		if (sc->mii_flags & MIIF_DOINGAUTO) {
+			callout_halt(&sc->mii_nway_ch,
+			sc->mii_pdata->mii_media.ifm_lock);
+		}
 	}
 	mii_unlock(sc->mii_pdata);
 
-	callout_destroy(&sc->mii_nway_ch);
+	if (sc->mii_flags & MIIF_AUTOTSLEEP)
+		cv_destroy(&sc->mii_nway_cv);
+	else
+		callout_destroy(&sc->mii_nway_ch);
 
 	mii_phy_delete_media(sc);
 

Index: src/sys/dev/mii/miivar.h
diff -u src/sys/dev/mii/miivar.h:1.74 src/sys/dev/mii/miivar.h:1.75
--- src/sys/dev/mii/miivar.h:1.74	Tue Jun 29 21:03:36 2021
+++ src/sys/dev/mii/miivar.h	Sun Aug 14 20:34:26 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: miivar.h,v 1.74 2021/06/29 21:03:36 pgoyette Exp $	*/
+/*	$NetBSD: miivar.h,v 1.75 2022/08/14 20:34:26 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 1998, 1999, 2000, 2001, 2020 The NetBSD Foundation, Inc.
@@ -150,7 +150,10 @@ struct mii_softc {
 	int mii_ticks;			/* m: MII_TICK counter */
 	int mii_anegticks;		/* m: ticks before retrying aneg */
 
-	struct callo

CVS commit: src/sys/dev/mii

2022-08-14 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Aug 14 20:34:26 UTC 2022

Modified Files:
src/sys/dev/mii: mii.c mii_physubr.c miivar.h

Log Message:
mii(4): Wait for MIIF_DOINGAUTO to clear with MIIF_AUTOTSLEEP too.

Otherwise mii_phy_detach may return while mii_phy_auto_timeout_locked
is still in progress in another thread.

Reuse the storage for mii_nway_ch, which is unused if MIIF_AUTOTSLEEP
is set, for a new condvar in a union.  This doesn't change the kernel
ABI because sizeof(struct kcondvar) <= sizeof(struct callout) and
both have the same alignment, for an array of void *.


To generate a diff of this commit:
cvs rdiff -u -r1.57 -r1.58 src/sys/dev/mii/mii.c
cvs rdiff -u -r1.98 -r1.99 src/sys/dev/mii/mii_physubr.c
cvs rdiff -u -r1.74 -r1.75 src/sys/dev/mii/miivar.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/mii

2022-08-14 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Aug 14 20:33:57 UTC 2022

Modified Files:
src/sys/dev/mii: mii_physubr.c

Log Message:
mii(4): Sprinkle assertions in mii phy auto timeout.


To generate a diff of this commit:
cvs rdiff -u -r1.97 -r1.98 src/sys/dev/mii/mii_physubr.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/mii

2022-08-14 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Aug 14 20:33:57 UTC 2022

Modified Files:
src/sys/dev/mii: mii_physubr.c

Log Message:
mii(4): Sprinkle assertions in mii phy auto timeout.


To generate a diff of this commit:
cvs rdiff -u -r1.97 -r1.98 src/sys/dev/mii/mii_physubr.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/mii/mii_physubr.c
diff -u src/sys/dev/mii/mii_physubr.c:1.97 src/sys/dev/mii/mii_physubr.c:1.98
--- src/sys/dev/mii/mii_physubr.c:1.97	Tue Dec 28 12:00:48 2021
+++ src/sys/dev/mii/mii_physubr.c	Sun Aug 14 20:33:57 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: mii_physubr.c,v 1.97 2021/12/28 12:00:48 riastradh Exp $	*/
+/*	$NetBSD: mii_physubr.c,v 1.98 2022/08/14 20:33:57 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: mii_physubr.c,v 1.97 2021/12/28 12:00:48 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mii_physubr.c,v 1.98 2022/08/14 20:33:57 riastradh Exp $");
 
 #include 
 #include 
@@ -308,6 +308,8 @@ static void
 mii_phy_auto_timeout_locked(struct mii_softc *sc)
 {
 
+	KASSERT(mii_locked(sc->mii_pdata));
+
 	if (!device_is_active(sc->mii_dev))
 		return;
 
@@ -322,6 +324,8 @@ mii_phy_auto_timeout(void *arg)
 {
 	struct mii_softc *sc = arg;
 
+	KASSERT((sc->mii_flags & MIIF_AUTOTSLEEP) == 0);
+
 	if (!device_is_active(sc->mii_dev))
 		return;
 



CVS commit: src/usr.bin/make

2022-08-14 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Sun Aug 14 20:19:28 UTC 2022

Modified Files:
src/usr.bin/make: make.1

Log Message:
make(1): mark up FRC in BUGS


To generate a diff of this commit:
cvs rdiff -u -r1.325 -r1.326 src/usr.bin/make/make.1

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

Modified files:

Index: src/usr.bin/make/make.1
diff -u src/usr.bin/make/make.1:1.325 src/usr.bin/make/make.1:1.326
--- src/usr.bin/make/make.1:1.325	Sun Aug 14 20:07:18 2022
+++ src/usr.bin/make/make.1	Sun Aug 14 20:19:27 2022
@@ -1,4 +1,4 @@
-.\"	$NetBSD: make.1,v 1.325 2022/08/14 20:07:18 uwe Exp $
+.\"	$NetBSD: make.1,v 1.326 2022/08/14 20:19:27 uwe Exp $
 .\"
 .\" Copyright (c) 1990, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -2573,10 +2573,10 @@ machines using a daemon called
 .Dq customs .
 .Pp
 Historically the target/dependency
-.Dq FRC
+.Ic FRC
 has been used to FoRCe rebuilding (since the target/dependency
 does not exist... unless someone creates an
-.Dq FRC
+.Pa FRC
 file).
 .Sh BUGS
 The



CVS commit: src/usr.bin/make

2022-08-14 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Sun Aug 14 20:19:28 UTC 2022

Modified Files:
src/usr.bin/make: make.1

Log Message:
make(1): mark up FRC in BUGS


To generate a diff of this commit:
cvs rdiff -u -r1.325 -r1.326 src/usr.bin/make/make.1

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



CVS commit: src/usr.bin/make

2022-08-14 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Sun Aug 14 20:07:18 UTC 2022

Modified Files:
src/usr.bin/make: make.1

Log Message:
make(1): Use .Dq instead of literal ASCII quotes


To generate a diff of this commit:
cvs rdiff -u -r1.324 -r1.325 src/usr.bin/make/make.1

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

Modified files:

Index: src/usr.bin/make/make.1
diff -u src/usr.bin/make/make.1:1.324 src/usr.bin/make/make.1:1.325
--- src/usr.bin/make/make.1:1.324	Sun Aug 14 20:04:07 2022
+++ src/usr.bin/make/make.1	Sun Aug 14 20:07:18 2022
@@ -1,4 +1,4 @@
-.\"	$NetBSD: make.1,v 1.324 2022/08/14 20:04:07 uwe Exp $
+.\"	$NetBSD: make.1,v 1.325 2022/08/14 20:07:18 uwe Exp $
 .\"
 .\" Copyright (c) 1990, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -739,7 +739,9 @@ ${OBJS}: .MAKE.META.CMP_FILTER=${COMPILE
 .Pp
 Only the targets
 .Ql ${OBJS}
-will be impacted by that filter (in "meta" mode) and
+will be impacted by that filter (in
+.Dq meta
+mode) and
 simply enabling/disabling any of the compiler wrappers will not render all
 of those targets out-of-date.
 .Pp
@@ -956,11 +958,15 @@ Like
 .Fl B ,
 puts
 .Nm
-into "compat" mode.
+into
+.Dq compat
+mode.
 .It Pa meta
 Puts
 .Nm
-into "meta" mode, where meta files are created for each target
+into
+.Dq meta
+mode, where meta files are created for each target
 to capture the command run, the output generated and if
 .Xr filemon 4
 is available, the system calls which are of interest to
@@ -989,14 +995,18 @@ Do not use
 For debugging, it can be useful to include the environment
 in the .meta file.
 .It Pa verbose
-If in "meta" mode, print a clue about the target being built.
+If in
+.Dq meta
+mode, print a clue about the target being built.
 This is useful if the build is otherwise running silently.
 The message printed the value of:
 .Va .MAKE.META.PREFIX .
 .It Pa ignore-cmd
 Some makefiles have commands which are simply not stable.
 This keyword causes them to be ignored for
-determining whether a target is out of date in "meta" mode.
+determining whether a target is out of date in
+.Dq meta
+mode.
 See also
 .Ic .NOMETA_CMP .
 .It Pa silent= Ar bf
@@ -1010,7 +1020,9 @@ but instead randomize their order.
 This mode can be used to detect undeclared dependencies between files.
 .El
 .It Va .MAKE.META.BAILIWICK
-In "meta" mode, provides a list of prefixes which
+In
+.Dq meta
+mode, provides a list of prefixes which
 match the directories controlled by
 .Nm .
 If a file that was generated outside of
@@ -1018,18 +1030,24 @@ If a file that was generated outside of
 but within said bailiwick is missing,
 the current target is considered out-of-date.
 .It Va .MAKE.META.CMP_FILTER
-In "meta" mode, it can (very rarely!) be useful to filter command
+In
+.Dq meta
+mode, it can (very rarely!) be useful to filter command
 lines before comparison.
 This variable can be set to a set of modifiers that will be applied to
 each line of the old and new command that differ, if the filtered
 commands still differ, the target is considered out-of-date.
 .It Va .MAKE.META.CREATED
-In "meta" mode, this variable contains a list of all the meta files
+In
+.Dq meta
+mode, this variable contains a list of all the meta files
 updated.
 If not empty, it can be used to trigger processing of
 .Va .MAKE.META.FILES .
 .It Va .MAKE.META.FILES
-In "meta" mode, this variable contains a list of all the meta files
+In
+.Dq meta
+mode, this variable contains a list of all the meta files
 used (updated or not).
 This list can be used to process the meta files to extract dependency
 information.
@@ -1045,7 +1063,9 @@ Ignore any that match.
 Provides a list of variable modifiers to apply to each pathname.
 Ignore if the expansion is an empty string.
 .It Va .MAKE.META.PREFIX
-Defines the message printed for each meta file updated in "meta verbose" mode.
+Defines the message printed for each meta file updated in
+.Dq meta verbose
+mode.
 The default value is:
 .Dl Building ${.TARGET:H:tA}/${.TARGET:T}
 .It Va .MAKEOVERRIDES
@@ -1101,7 +1121,9 @@ stops due to an error, it sets
 to the name of the target that failed,
 .Sq Va .ERROR_CMD
 to the commands of the failed target,
-and in "meta" mode, it also sets
+and in
+.Dq meta
+mode, it also sets
 .Sq Va .ERROR_CWD
 to the
 .Xr getcwd 3 ,
@@ -2082,7 +2104,9 @@ or
 Usage in conjunction with
 .Ic .MAKE
 is the most likely case.
-In "meta" mode, the target is out-of-date if the meta file is missing.
+In
+.Dq meta
+mode, the target is out-of-date if the meta file is missing.
 .It Ic .NOMETA
 Do not create a meta file for the target.
 Meta files are also not created for



CVS commit: src/usr.bin/make

2022-08-14 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Sun Aug 14 20:07:18 UTC 2022

Modified Files:
src/usr.bin/make: make.1

Log Message:
make(1): Use .Dq instead of literal ASCII quotes


To generate a diff of this commit:
cvs rdiff -u -r1.324 -r1.325 src/usr.bin/make/make.1

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



CVS commit: src/usr.bin/make

2022-08-14 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Sun Aug 14 20:04:07 UTC 2022

Modified Files:
src/usr.bin/make: make.1

Log Message:
make(1): Be consistent about using .Va for make variables


To generate a diff of this commit:
cvs rdiff -u -r1.323 -r1.324 src/usr.bin/make/make.1

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

Modified files:

Index: src/usr.bin/make/make.1
diff -u src/usr.bin/make/make.1:1.323 src/usr.bin/make/make.1:1.324
--- src/usr.bin/make/make.1:1.323	Sun Aug 14 19:26:39 2022
+++ src/usr.bin/make/make.1	Sun Aug 14 20:04:07 2022
@@ -1,4 +1,4 @@
-.\"	$NetBSD: make.1,v 1.323 2022/08/14 19:26:39 rillig Exp $
+.\"	$NetBSD: make.1,v 1.324 2022/08/14 20:04:07 uwe Exp $
 .\"
 .\" Copyright (c) 1990, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -841,13 +841,13 @@ A path to the directory where
 .Nm
 was executed.
 Refer to the description of
-.Sq Ev PWD
+.Sq Va PWD
 for more details.
 .It Va .INCLUDEDFROMDIR
 The directory of the file this Makefile was included from.
 .It Va .INCLUDEDFROMFILE
 The filename of the file this Makefile was included from.
-.It Ev MAKE
+.It Va MAKE
 The name that
 .Nm
 was executed with
@@ -900,12 +900,12 @@ to
 would produce tokens like
 .Ql ---make[1234] target ---
 making it easier to track the degree of parallelism being achieved.
-.It .MAKE.TARGET_LOCAL_VARIABLES
+.It Va .MAKE.TARGET_LOCAL_VARIABLES
 If set to
 .Ql false ,
 apparent variable assignments in dependency lines are
 treated as normal sources.
-.It Ev MAKEFLAGS
+.It Va MAKEFLAGS
 The environment variable
 .Sq Ev MAKEFLAGS
 may contain anything that
@@ -915,7 +915,7 @@ command line.
 Anything specified on
 .Nm Ns 's
 command line is appended to the
-.Sq Ev MAKEFLAGS
+.Va MAKEFLAGS
 variable which is then
 entered into the environment for all programs which
 .Nm
@@ -1166,7 +1166,7 @@ will
 to the specified directory if it exists, and set
 .Sq Va .OBJDIR
 and
-.Sq Ev PWD
+.Sq Va PWD
 to that directory before executing any targets.
 .Pp
 Except in the case of an explicit
@@ -1199,9 +1199,9 @@ A variable that represents the list of d
 .Nm
 will search for files.
 The search list should be updated using the target
-.Sq Va .PATH
+.Sq Ic .PATH
 rather than the variable.
-.It Ev PWD
+.It Va PWD
 Alternate path to the current directory.
 .Nm
 normally sets
@@ -1222,21 +1222,21 @@ This behavior is disabled if
 is set or
 .Sq Ev MAKEOBJDIR
 contains a variable transform.
-.Sq Ev PWD
+.Sq Va PWD
 is set to the value of
 .Sq Va .OBJDIR
 for all programs which
 .Nm
 executes.
-.It Ev .SHELL
+.It Va .SHELL
 The pathname of the shell used to run target scripts.
 It is read-only.
-.It Ev .SUFFIXES
+.It Va .SUFFIXES
 The list of known suffixes.
 It is read-only.
-.It Ev .TARGETS
+.It Va .TARGETS
 The list of targets explicitly specified on the command line, if any.
-.It Ev VPATH
+.It Va VPATH
 Colon-separated
 .Pq Dq \&:
 lists of directories that
@@ -1869,7 +1869,7 @@ Would result in an environment containin
 .Sq Ev PATH ,
 which is the minimal useful environment.
 Actually
-.Sq Ev .MAKE.LEVEL
+.Sq Va .MAKE.LEVEL
 will also be pushed into the new environment.
 .It Ic .warning Ar message
 The message prefixed by
@@ -2111,7 +2111,7 @@ The
 pattern suppresses any expansion of the unwanted variable.
 .It Ic .NOPATH
 Do not search for the target in the directories specified by
-.Ic .PATH .
+.Va .PATH .
 .It Ic .NOTMAIN
 Normally
 .Nm
@@ -2209,7 +2209,7 @@ source) that
 can't figure out any other way to create.
 Only the shell script is used.
 The
-.Ic .IMPSRC
+.Va .IMPSRC
 variable of a target that inherits
 .Ic .DEFAULT Ns 's
 commands is set
@@ -2228,10 +2228,10 @@ else is done.
 .It Ic .ERROR
 Any command lines attached to this target are executed when another target fails.
 The
-.Ic .ERROR_TARGET
+.Va .ERROR_TARGET
 variable is set to the target that failed.
 See also
-.Ic MAKE_PRINT_VAR_ON_ERROR .
+.Va MAKE_PRINT_VAR_ON_ERROR .
 .It Ic .IGNORE
 Mark each of the sources with the
 .Ic .IGNORE
@@ -2516,7 +2516,7 @@ Some features are somewhat more portable
 and
 .Ic != .
 The
-.Ic .PATH
+.Va .PATH
 functionality is based on an older feature
 .Ic VPATH
 found in GNU make and many versions of SVR4 make; however,



CVS commit: src/usr.bin/make

2022-08-14 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Sun Aug 14 20:04:07 UTC 2022

Modified Files:
src/usr.bin/make: make.1

Log Message:
make(1): Be consistent about using .Va for make variables


To generate a diff of this commit:
cvs rdiff -u -r1.323 -r1.324 src/usr.bin/make/make.1

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



Re: CVS commit: src/usr.bin/make

2022-08-14 Thread Roland Illig

Am 14.08.2022 um 12:14 schrieb Valeriy E. Ushakov:

Module Name:src
Committed By:   uwe
Date:   Sun Aug 14 10:14:58 UTC 2022

Modified Files:
src/usr.bin/make: make.1


Thanks for your corrections and improvements, now that I see them they
are obvious. :)

Roland


CVS commit: src/usr.bin/make

2022-08-14 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Aug 14 19:26:39 UTC 2022

Modified Files:
src/usr.bin/make: make.1

Log Message:
make.1: fix accidental removal of the directive 'export'


To generate a diff of this commit:
cvs rdiff -u -r1.322 -r1.323 src/usr.bin/make/make.1

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



CVS commit: src/usr.bin/make

2022-08-14 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Aug 14 19:26:39 UTC 2022

Modified Files:
src/usr.bin/make: make.1

Log Message:
make.1: fix accidental removal of the directive 'export'


To generate a diff of this commit:
cvs rdiff -u -r1.322 -r1.323 src/usr.bin/make/make.1

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

Modified files:

Index: src/usr.bin/make/make.1
diff -u src/usr.bin/make/make.1:1.322 src/usr.bin/make/make.1:1.323
--- src/usr.bin/make/make.1:1.322	Sun Aug 14 10:14:58 2022
+++ src/usr.bin/make/make.1	Sun Aug 14 19:26:39 2022
@@ -1,4 +1,4 @@
-.\"	$NetBSD: make.1,v 1.322 2022/08/14 10:14:58 uwe Exp $
+.\"	$NetBSD: make.1,v 1.323 2022/08/14 19:26:39 rillig Exp $
 .\"
 .\" Copyright (c) 1990, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -1810,9 +1810,9 @@ This is not affected by the
 flag, so should be used with caution.
 For compatibility with other
 .Nm
-programs
-.Ar variable\| Ns Cm \&= Ns Ar value
-is also accepted.
+programs,
+.Cm export Ar variable\| Ns Cm \&= Ns Ar value
+(without leading dot) is also accepted.
 .Pp
 Appending a variable name to
 .Va .MAKE.EXPORTED



CVS commit: src/share/man/man9

2022-08-14 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Aug 14 19:12:23 UTC 2022

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

Log Message:
usbd_do_request_async got deleted back in 2013 so remove the commented out
reference to it here.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/share/man/man9/usbdi.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/usbdi.9
diff -u src/share/man/man9/usbdi.9:1.36 src/share/man/man9/usbdi.9:1.37
--- src/share/man/man9/usbdi.9:1.36	Sat Dec 11 19:24:19 2021
+++ src/share/man/man9/usbdi.9	Sun Aug 14 19:12:23 2022
@@ -1,4 +1,4 @@
-.\"	$NetBSD: usbdi.9,v 1.36 2021/12/11 19:24:19 mrg Exp $
+.\"	$NetBSD: usbdi.9,v 1.37 2022/08/14 19:12:23 skrll Exp $
 .\"
 .\" Copyright (c) 2012 Matthew R. Green
 .\" All rights reserved.
@@ -133,7 +133,6 @@
 .Fn usbd_do_request_flags "struct usbd_device *dev" \
  "usb_device_request_t *req" "void *data" "uint16_t flags" "int *actlen" \
  "uint32_t timo"
-.\" usbd_do_request_async() not used outside of usbdi*
 .Ft usb_interface_descriptor_t *
 .Fn usbd_get_interface_descriptor "struct usbd_interface *iface"
 .Ft usb_config_descriptor_t *



CVS commit: src/share/man/man9

2022-08-14 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Aug 14 19:12:23 UTC 2022

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

Log Message:
usbd_do_request_async got deleted back in 2013 so remove the commented out
reference to it here.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/share/man/man9/usbdi.9

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



CVS commit: src/sys/dev/ic

2022-08-14 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Aug 14 12:08:57 UTC 2022

Modified Files:
src/sys/dev/ic: nvme.c nvmevar.h

Log Message:
nvme: Make sure that q_ccb_list is always accessed with the q lock held.


To generate a diff of this commit:
cvs rdiff -u -r1.61 -r1.62 src/sys/dev/ic/nvme.c
cvs rdiff -u -r1.27 -r1.28 src/sys/dev/ic/nvmevar.h

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

Modified files:

Index: src/sys/dev/ic/nvme.c
diff -u src/sys/dev/ic/nvme.c:1.61 src/sys/dev/ic/nvme.c:1.62
--- src/sys/dev/ic/nvme.c:1.61	Sun Jul 31 12:02:28 2022
+++ src/sys/dev/ic/nvme.c	Sun Aug 14 12:08:57 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: nvme.c,v 1.61 2022/07/31 12:02:28 mlelstv Exp $	*/
+/*	$NetBSD: nvme.c,v 1.62 2022/08/14 12:08:57 jmcneill Exp $	*/
 /*	$OpenBSD: nvme.c,v 1.49 2016/04/18 05:59:50 dlg Exp $ */
 
 /*
@@ -18,7 +18,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: nvme.c,v 1.61 2022/07/31 12:02:28 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nvme.c,v 1.62 2022/08/14 12:08:57 jmcneill Exp $");
 
 #include 
 #include 
@@ -88,6 +88,9 @@ static void	nvme_ccbs_free(struct nvme_q
 
 static struct nvme_ccb *
 		nvme_ccb_get(struct nvme_queue *, bool);
+static struct nvme_ccb *
+		nvme_ccb_get_bio(struct nvme_softc *, struct buf *,
+		struct nvme_queue **);
 static void	nvme_ccb_put(struct nvme_queue *, struct nvme_ccb *);
 
 static int	nvme_poll(struct nvme_softc *, struct nvme_queue *,
@@ -768,12 +771,12 @@ nvme_ns_dobio(struct nvme_softc *sc, uin
 struct buf *bp, void *data, size_t datasize,
 int secsize, daddr_t blkno, int flags, nvme_nnc_done nnc_done)
 {
-	struct nvme_queue *q = nvme_get_q(sc, bp, false);
+	struct nvme_queue *q;
 	struct nvme_ccb *ccb;
 	bus_dmamap_t dmap;
 	int i, error;
 
-	ccb = nvme_ccb_get(q, false);
+	ccb = nvme_ccb_get_bio(sc, bp, &q);
 	if (ccb == NULL)
 		return EAGAIN;
 
@@ -910,7 +913,7 @@ nvme_ns_sync_finished(void *cookie)
 int
 nvme_ns_sync(struct nvme_softc *sc, uint16_t nsid, int flags)
 {
-	struct nvme_queue *q = nvme_get_q(sc, NULL, true);
+	struct nvme_queue *q = nvme_get_q(sc);
 	struct nvme_ccb *ccb;
 	int result = 0;
 
@@ -1277,7 +1280,7 @@ nvme_command_passthrough(struct nvme_sof
 	(pt->buf != NULL && (pt->len == 0 || pt->len > sc->sc_mdts)))
 		return EINVAL;
 
-	q = is_adminq ? sc->sc_admin_q : nvme_get_q(sc, NULL, true);
+	q = is_adminq ? sc->sc_admin_q : nvme_get_q(sc);
 	ccb = nvme_ccb_get(q, true);
 	KASSERT(ccb != NULL);
 
@@ -1852,6 +1855,40 @@ again:
 	return ccb;
 }
 
+static struct nvme_ccb *
+nvme_ccb_get_bio(struct nvme_softc *sc, struct buf *bp,
+struct nvme_queue **selq)
+{
+	u_int cpuindex = cpu_index(bp->b_ci);
+
+	/*
+	 * Find a queue with available ccbs, preferring the originating
+	 * CPU's queue.
+	 */
+
+	for (u_int qoff = 0; qoff < sc->sc_nq; qoff++) {
+		struct nvme_queue *q = sc->sc_q[(cpuindex + qoff) % sc->sc_nq];
+		struct nvme_ccb *ccb;
+
+		mutex_enter(&q->q_ccb_mtx);
+		ccb = SIMPLEQ_FIRST(&q->q_ccb_list);
+		if (ccb != NULL) {
+			SIMPLEQ_REMOVE_HEAD(&q->q_ccb_list, ccb_entry);
+#ifdef DEBUG
+			ccb->ccb_cookie = NULL;
+#endif
+		}
+		mutex_exit(&q->q_ccb_mtx);
+
+		if (ccb != NULL) {
+			*selq = q;
+			return ccb;
+		}
+	}
+
+	return NULL;
+}
+
 static void
 nvme_ccb_put(struct nvme_queue *q, struct nvme_ccb *ccb)
 {

Index: src/sys/dev/ic/nvmevar.h
diff -u src/sys/dev/ic/nvmevar.h:1.27 src/sys/dev/ic/nvmevar.h:1.28
--- src/sys/dev/ic/nvmevar.h:1.27	Mon Aug  1 08:09:30 2022
+++ src/sys/dev/ic/nvmevar.h	Sun Aug 14 12:08:57 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: nvmevar.h,v 1.27 2022/08/01 08:09:30 mlelstv Exp $	*/
+/*	$NetBSD: nvmevar.h,v 1.28 2022/08/14 12:08:57 jmcneill Exp $	*/
 /*	$OpenBSD: nvmevar.h,v 1.8 2016/04/14 11:18:32 dlg Exp $ */
 
 /*
@@ -197,20 +197,9 @@ int	nvme_intr_msi(void *);
 void	nvme_softintr_msi(void *);
 
 static __inline struct nvme_queue *
-nvme_get_q(struct nvme_softc *sc, struct buf *bp, bool waitok)
+nvme_get_q(struct nvme_softc *sc)
 {
-	struct cpu_info *ci = (bp && bp->b_ci) ? bp->b_ci : curcpu();
-
-	/*
-	 * Find a queue with available ccbs, preferring the originating CPU's queue.
-	 */
-
-	for (u_int qoff = 0; qoff < sc->sc_nq; qoff++) {
-		struct nvme_queue *q = sc->sc_q[(cpu_index(ci) + qoff) % sc->sc_nq];
-		if (!SIMPLEQ_EMPTY(&q->q_ccb_list) || waitok)
-			return q;
-	}
-	return NULL;
+	return sc->sc_q[cpu_index(curcpu()) % sc->sc_nq];
 }
 
 /*



CVS commit: src/sys/dev/ic

2022-08-14 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Aug 14 12:08:57 UTC 2022

Modified Files:
src/sys/dev/ic: nvme.c nvmevar.h

Log Message:
nvme: Make sure that q_ccb_list is always accessed with the q lock held.


To generate a diff of this commit:
cvs rdiff -u -r1.61 -r1.62 src/sys/dev/ic/nvme.c
cvs rdiff -u -r1.27 -r1.28 src/sys/dev/ic/nvmevar.h

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



CVS commit: src/sys/stand/efiboot

2022-08-14 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Aug 14 11:26:41 UTC 2022

Modified Files:
src/sys/stand/efiboot: boot.c efiacpi.c efiboot.h efifdt.c efigop.c
efirng.c
src/sys/stand/efiboot/bootaa64: efibootaa64.c

Log Message:
Align output of "version" command.


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 src/sys/stand/efiboot/boot.c
cvs rdiff -u -r1.12 -r1.13 src/sys/stand/efiboot/efiacpi.c
cvs rdiff -u -r1.19 -r1.20 src/sys/stand/efiboot/efiboot.h
cvs rdiff -u -r1.34 -r1.35 src/sys/stand/efiboot/efifdt.c
cvs rdiff -u -r1.2 -r1.3 src/sys/stand/efiboot/efigop.c
cvs rdiff -u -r1.3 -r1.4 src/sys/stand/efiboot/efirng.c
cvs rdiff -u -r1.5 -r1.6 src/sys/stand/efiboot/bootaa64/efibootaa64.c

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

Modified files:

Index: src/sys/stand/efiboot/boot.c
diff -u src/sys/stand/efiboot/boot.c:1.43 src/sys/stand/efiboot/boot.c:1.44
--- src/sys/stand/efiboot/boot.c:1.43	Fri Mar 25 21:23:00 2022
+++ src/sys/stand/efiboot/boot.c	Sun Aug 14 11:26:41 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: boot.c,v 1.43 2022/03/25 21:23:00 jmcneill Exp $	*/
+/*	$NetBSD: boot.c,v 1.44 2022/08/14 11:26:41 jmcneill Exp $	*/
 
 /*-
  * Copyright (c) 2016 Kimihiro Nonaka 
@@ -380,6 +380,18 @@ command_menu(char *arg)
 }
 
 void
+command_printtab(const char *key, const char *fmt, ...)
+{
+	va_list ap;
+
+	printf("%-16s: ", key);
+
+	va_start(ap, fmt);
+	vprintf(fmt, ap);
+	va_end(ap);
+}
+
+void
 command_version(char *arg)
 {
 	char pathbuf[80];
@@ -387,23 +399,26 @@ command_version(char *arg)
 	const UINT64 *osindsup;
 	int rv;
 
-	printf("Version: %s (%s)\n", bootprog_rev, bootprog_kernrev);
-	printf("EFI: %d.%02d\n",
+	command_printtab("Version", "%s (%s)\n",
+	bootprog_rev, bootprog_kernrev);
+	command_printtab("EFI", "%d.%02d\n",
 	ST->Hdr.Revision >> 16, ST->Hdr.Revision & 0x);
+
 	ufirmware = NULL;
 	rv = ucs2_to_utf8(ST->FirmwareVendor, &ufirmware);
 	if (rv == 0) {
-		printf("Firmware: %s (rev 0x%x)\n", ufirmware,
+		command_printtab("Firmware", "%s (rev 0x%x)\n", ufirmware,
 		ST->FirmwareRevision);
 		FreePool(ufirmware);
 	}
 	if (bootcfg_path(pathbuf, sizeof(pathbuf)) == 0) {
-		printf("Config path: %s\n", pathbuf);
+		command_printtab("Config path", "%s\n", pathbuf);
 	}
 
 	osindsup = LibGetVariable(L"OsIndicationsSupported", &EfiGlobalVariable);
 	if (osindsup != NULL) {
-		printf("UEFI OS indications supported: 0x%" PRIx64 "\n", *osindsup);
+		command_printtab("OS Indications", "0x%" PRIx64 "\n",
+		*osindsup);
 	}
 
 #ifdef EFIBOOT_FDT

Index: src/sys/stand/efiboot/efiacpi.c
diff -u src/sys/stand/efiboot/efiacpi.c:1.12 src/sys/stand/efiboot/efiacpi.c:1.13
--- src/sys/stand/efiboot/efiacpi.c:1.12	Wed Nov  3 22:02:36 2021
+++ src/sys/stand/efiboot/efiacpi.c	Sun Aug 14 11:26:41 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: efiacpi.c,v 1.12 2021/11/03 22:02:36 skrll Exp $ */
+/* $NetBSD: efiacpi.c,v 1.13 2022/08/14 11:26:41 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -145,13 +145,15 @@ efi_acpi_show(void)
 {
 	struct acpi_rdsp *rsdp = acpi_root;
 
-	if (!efi_acpi_available())
+	if (!efi_acpi_available()) {
 		return;
+	}
 
-	printf("ACPI: v%02d %c%c%c%c%c%c\n", rsdp->revision,
+	command_printtab("ACPI", "v%02d %c%c%c%c%c%c\n", rsdp->revision,
 	rsdp->oemid[0], rsdp->oemid[1], rsdp->oemid[2],
 	rsdp->oemid[3], rsdp->oemid[4], rsdp->oemid[5]);
 
-	if (smbios_table)
-		printf("SMBIOS: %s\n", efi_acpi_get_model());
+	if (smbios_table) {
+		command_printtab("SMBIOS", "%s\n", efi_acpi_get_model());
+	}
 }

Index: src/sys/stand/efiboot/efiboot.h
diff -u src/sys/stand/efiboot/efiboot.h:1.19 src/sys/stand/efiboot/efiboot.h:1.20
--- src/sys/stand/efiboot/efiboot.h:1.19	Fri Mar 25 21:23:00 2022
+++ src/sys/stand/efiboot/efiboot.h	Sun Aug 14 11:26:41 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: efiboot.h,v 1.19 2022/03/25 21:23:00 jmcneill Exp $	*/
+/*	$NetBSD: efiboot.h,v 1.20 2022/08/14 11:26:41 jmcneill Exp $	*/
 
 /*-
  * Copyright (c) 2016 Kimihiro Nonaka 
@@ -58,6 +58,7 @@ void boot(void);
 void clearit(void);
 extern const struct boot_command commands[];
 void command_help(char *);
+void command_printtab(const char *, const char *, ...);
 int set_default_device(const char *);
 char *get_default_device(void);
 void set_default_fstype(int);

Index: src/sys/stand/efiboot/efifdt.c
diff -u src/sys/stand/efiboot/efifdt.c:1.34 src/sys/stand/efiboot/efifdt.c:1.35
--- src/sys/stand/efiboot/efifdt.c:1.34	Fri Mar 25 21:23:00 2022
+++ src/sys/stand/efiboot/efifdt.c	Sun Aug 14 11:26:41 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: efifdt.c,v 1.34 2022/03/25 21:23:00 jmcneill Exp $ */
+/* $NetBSD: efifdt.c,v 1.35 2022/08/14 11:26:41 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2019 Jason R. Thorpe
@@ -205,12 +205,14 @@ efi_fdt_show(void)
 	const char *model, *compat;
 	int n, ncompat;
 
-	if (fdt_data == NULL)
+	if (fdt_data == NULL) {
 		return;
+	}
 
 	model = fdt_

CVS commit: src/sys/stand/efiboot

2022-08-14 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Aug 14 11:26:41 UTC 2022

Modified Files:
src/sys/stand/efiboot: boot.c efiacpi.c efiboot.h efifdt.c efigop.c
efirng.c
src/sys/stand/efiboot/bootaa64: efibootaa64.c

Log Message:
Align output of "version" command.


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 src/sys/stand/efiboot/boot.c
cvs rdiff -u -r1.12 -r1.13 src/sys/stand/efiboot/efiacpi.c
cvs rdiff -u -r1.19 -r1.20 src/sys/stand/efiboot/efiboot.h
cvs rdiff -u -r1.34 -r1.35 src/sys/stand/efiboot/efifdt.c
cvs rdiff -u -r1.2 -r1.3 src/sys/stand/efiboot/efigop.c
cvs rdiff -u -r1.3 -r1.4 src/sys/stand/efiboot/efirng.c
cvs rdiff -u -r1.5 -r1.6 src/sys/stand/efiboot/bootaa64/efibootaa64.c

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



CVS commit: src/usr.bin/make

2022-08-14 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Sun Aug 14 10:14:58 UTC 2022

Modified Files:
src/usr.bin/make: make.1

Log Message:
make(1): more .Ar fixes


To generate a diff of this commit:
cvs rdiff -u -r1.321 -r1.322 src/usr.bin/make/make.1

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

Modified files:

Index: src/usr.bin/make/make.1
diff -u src/usr.bin/make/make.1:1.321 src/usr.bin/make/make.1:1.322
--- src/usr.bin/make/make.1:1.321	Sun Aug 14 09:47:29 2022
+++ src/usr.bin/make/make.1	Sun Aug 14 10:14:58 2022
@@ -1,4 +1,4 @@
-.\"	$NetBSD: make.1,v 1.321 2022/08/14 09:47:29 uwe Exp $
+.\"	$NetBSD: make.1,v 1.322 2022/08/14 10:14:58 uwe Exp $
 .\"
 .\" Copyright (c) 1990, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -49,7 +49,7 @@
 .Op Fl T Ar file
 .Op Fl V Ar variable
 .Op Fl v Ar variable
-.Op Ar variable=value
+.Op Ar variable\| Ns Cm \&= Ns Ar value
 .Op Ar target ...
 .Sh DESCRIPTION
 .Nm
@@ -410,7 +410,7 @@ Variables passed on the command line are
 environment variable.
 This option may be useful on systems which have a small limit on the
 size of command arguments.
-.It Ar variable=value
+.It Ar variable\| Ns Cm \&= Ns Ar value
 Set the value of the variable
 .Ar variable
 to
@@ -1356,11 +1356,11 @@ This is equivalent to:
 .Sq \&:S/\e\&$/&&/g:Q .
 .It Cm \&:R
 Replaces each word in the variable with everything but its suffix.
-.It Cm \&:range Ns Oo = Ns Ar count Oc
+.It Cm \&:range Ns Oo Cm = Ns Ar count Oc
 The value is an integer sequence representing the words of the original
 value, or the supplied
-.Va count .
-.It Cm \&:gmtime Ns Oo = Ns Ar utc Oc
+.Ar count .
+.It Cm \&:gmtime Ns Oo Cm = Ns Ar utc Oc
 The value is a format string for
 .Xr strftime 3 ,
 using
@@ -1370,7 +1370,7 @@ If a
 value is not provided or is 0, the current time is used.
 .It Cm \&:hash
 Computes a 32-bit hash of the value and encode it as hex digits.
-.It Cm \&:localtime Ns Oo = Ns Ar utc Oc
+.It Cm \&:localtime Ns Oo Cm = Ns Ar utc Oc
 The value is a format string for
 .Xr strftime 3 ,
 using
@@ -1530,12 +1530,12 @@ If
 or
 .Ar new_string
 do not contain the pattern matching character
-.Ar %
+.Ql %
 then it is assumed that they are
 anchored at the end of each word, so only suffixes or entire
 words may be replaced.
 Otherwise
-.Ar %
+.Ql %
 is the substring of
 .Ar old_string
 to be replaced in
@@ -1543,7 +1543,7 @@ to be replaced in
 If only
 .Ar old_string
 contains the pattern matching character
-.Ar % ,
+.Ql % ,
 and
 .Ar old_string
 matches, then the result is the
@@ -1551,12 +1551,12 @@ matches, then the result is the
 If only the
 .Ar new_string
 contains the pattern matching character
-.Ar % ,
+.Ql % ,
 then it is not treated specially and it is printed as a literal
-.Ar %
+.Ql %
 on match.
 If there is more than one pattern matching character
-.Ar ( % )
+.Ql %
 in either the
 .Ar new_string
 or
@@ -1811,7 +1811,7 @@ flag, so should be used with caution.
 For compatibility with other
 .Nm
 programs
-.Ql export variable=value
+.Ar variable\| Ns Cm \&= Ns Ar value
 is also accepted.
 .Pp
 Appending a variable name to
@@ -2307,7 +2307,7 @@ If the source is the special
 .Ic .DOTLAST
 target, then the current working
 directory is searched last.
-.It Ic .PATH. Ns Va suffix
+.It Ic .PATH. Ns Ar suffix
 Like
 .Ic .PATH
 but applies only to files with a particular suffix.
@@ -2347,39 +2347,39 @@ Sets the shell that
 .Nm
 will use to execute commands.
 The sources are a set of
-.Ar field=value
+.Ar field\| Ns Cm \&= Ns Ar value
 pairs.
-.Bl -tag -width hasErrCtls
-.It Ar name
+.Bl -tag -width ".Li hasErrCtls"
+.It Li name
 This is the minimal specification, used to select one of the built-in
 shell specs;
-.Ar sh ,
-.Ar ksh ,
+.Li sh ,
+.Li ksh ,
 and
-.Ar csh .
-.It Ar path
+.Li csh .
+.It Li path
 Specifies the path to the shell.
-.It Ar hasErrCtl
+.It Li hasErrCtl
 Indicates whether the shell supports exit on error.
-.It Ar check
+.It Li check
 The command to turn on error checking.
-.It Ar ignore
+.It Li ignore
 The command to disable error checking.
-.It Ar echo
+.It Li echo
 The command to turn on echoing of commands executed.
-.It Ar quiet
+.It Li quiet
 The command to turn off echoing of commands executed.
-.It Ar filter
+.It Li filter
 The output to filter after issuing the
-.Ar quiet
+.Li quiet
 command.
 It is typically identical to
-.Ar quiet .
-.It Ar errFlag
+.Li quiet .
+.It Li errFlag
 The flag to pass the shell to enable error checking.
-.It Ar echoFlag
+.It Li echoFlag
 The flag to pass the shell to enable command echoing.
-.It Ar newline
+.It Li newline
 The string literal to pass the shell that results in a single newline
 character when used outside of any quoting characters.
 .El



CVS commit: src/usr.bin/make

2022-08-14 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Sun Aug 14 10:14:58 UTC 2022

Modified Files:
src/usr.bin/make: make.1

Log Message:
make(1): more .Ar fixes


To generate a diff of this commit:
cvs rdiff -u -r1.321 -r1.322 src/usr.bin/make/make.1

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



CVS commit: src/doc

2022-08-14 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Sun Aug 14 10:13:06 UTC 2022

Modified Files:
src/doc: TODO.smpnet

Log Message:
Add bge(4) to the list of drivers that take advantage of NET_MPSAFE


To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.47 src/doc/TODO.smpnet

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

Modified files:

Index: src/doc/TODO.smpnet
diff -u src/doc/TODO.smpnet:1.46 src/doc/TODO.smpnet:1.47
--- src/doc/TODO.smpnet:1.46	Tue May  3 20:52:30 2022
+++ src/doc/TODO.smpnet	Sun Aug 14 10:13:06 2022
@@ -1,4 +1,4 @@
-$NetBSD: TODO.smpnet,v 1.46 2022/05/03 20:52:30 andvar Exp $
+$NetBSD: TODO.smpnet,v 1.47 2022/08/14 10:13:06 nia Exp $
 
 MP-safe components
 ==
@@ -9,6 +9,7 @@ kernel option.  Some components scale up
  - Device drivers
- aq(4)
- bcmgenet(4)
+   - bge(4)
- iavf(4)
- ixg(4)
- ixl(4)



CVS commit: src/doc

2022-08-14 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Sun Aug 14 10:13:06 UTC 2022

Modified Files:
src/doc: TODO.smpnet

Log Message:
Add bge(4) to the list of drivers that take advantage of NET_MPSAFE


To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.47 src/doc/TODO.smpnet

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



CVS commit: src/doc

2022-08-14 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Sun Aug 14 10:07:58 UTC 2022

Modified Files:
src/doc: CHANGES

Log Message:
doc: Recent changes from various


To generate a diff of this commit:
cvs rdiff -u -r1.2896 -r1.2897 src/doc/CHANGES

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

Modified files:

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.2896 src/doc/CHANGES:1.2897
--- src/doc/CHANGES:1.2896	Tue Aug  9 07:39:21 2022
+++ src/doc/CHANGES	Sun Aug 14 10:07:58 2022
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2896 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2897 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -638,3 +638,19 @@ Changes from NetBSD 9.0 to NetBSD 10.0:
 	df(1): Add -b (output unit: blocks; 512), -H (-h using SI units),
 		-N (suppress the header line), and -f (show only free space)
 		options.  [kre 20220808]
+	ipsec(4): Add net.key.allow_different_idtype sysctl(7) variable
+		to improve interconnectivity to some VPN appliances.
+		[knakahara 20220809]
+	kernel: Don't autounload modules by default unless they opt-in.
+		[riastradh 20220812]
+	cgdconfig(8): New -T operation prints all generated keys in cgd.conf.
+		[riastradh 20220812]
+	cgdconfig(8): Add support for shared keys.  [riastradh 20220812]
+	viocon(4): New virtio tty driver imported from OpenBSD.
+		[riastradh 20220812]
+	arm: Add "nopcimsi" boot option to force acpipchb to use
+		legacy INTx only mode.  [jmcneill 20220813]
+	arm: Add "nopciconf" boot option to force acpipchb to skip PCI
+		resource assignment.  [jmcneill 20220813]
+	bge(4): Allow the driver to work without the big kernel lock
+		(support for NET_MPSAFE).  [skrll 20220814]



CVS commit: src/doc

2022-08-14 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Sun Aug 14 10:07:58 UTC 2022

Modified Files:
src/doc: CHANGES

Log Message:
doc: Recent changes from various


To generate a diff of this commit:
cvs rdiff -u -r1.2896 -r1.2897 src/doc/CHANGES

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



CVS commit: src/sys/dev/pci

2022-08-14 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Aug 14 10:06:54 UTC 2022

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

Log Message:
virtio(4): Print numeric device type, even if unrecognized.


To generate a diff of this commit:
cvs rdiff -u -r1.57 -r1.58 src/sys/dev/pci/virtio.c

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



CVS commit: src/sys/dev/pci

2022-08-14 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Aug 14 10:06:54 UTC 2022

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

Log Message:
virtio(4): Print numeric device type, even if unrecognized.


To generate a diff of this commit:
cvs rdiff -u -r1.57 -r1.58 src/sys/dev/pci/virtio.c

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

Modified files:

Index: src/sys/dev/pci/virtio.c
diff -u src/sys/dev/pci/virtio.c:1.57 src/sys/dev/pci/virtio.c:1.58
--- src/sys/dev/pci/virtio.c:1.57	Fri Aug 12 10:49:57 2022
+++ src/sys/dev/pci/virtio.c	Sun Aug 14 10:06:54 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: virtio.c,v 1.57 2022/08/12 10:49:57 riastradh Exp $	*/
+/*	$NetBSD: virtio.c,v 1.58 2022/08/14 10:06:54 riastradh Exp $	*/
 
 /*
  * Copyright (c) 2020 The NetBSD Foundation, Inc.
@@ -28,7 +28,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: virtio.c,v 1.57 2022/08/12 10:49:57 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: virtio.c,v 1.58 2022/08/14 10:06:54 riastradh Exp $");
 
 #include 
 #include 
@@ -1418,9 +1418,10 @@ virtio_attach_failed(struct virtio_softc
 void
 virtio_print_device_type(device_t self, int id, int revision)
 {
-	aprint_normal_dev(self, "%s device (rev. 0x%02x)\n",
-		  (id < NDEVNAMES ? virtio_device_name[id] : "Unknown"),
-		  revision);
+	aprint_normal_dev(self, "%s device (id %d, rev. 0x%02x)\n",
+	(id < NDEVNAMES ? virtio_device_name[id] : "Unknown"),
+	id,
+	revision);
 }
 
 



CVS commit: src/usr.bin/make

2022-08-14 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Sun Aug 14 09:47:29 UTC 2022

Modified Files:
src/usr.bin/make: make.1

Log Message:
make(1): ".../" in -m option description is literal ".../"


To generate a diff of this commit:
cvs rdiff -u -r1.320 -r1.321 src/usr.bin/make/make.1

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



CVS commit: src/usr.bin/make

2022-08-14 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Sun Aug 14 09:47:29 UTC 2022

Modified Files:
src/usr.bin/make: make.1

Log Message:
make(1): ".../" in -m option description is literal ".../"


To generate a diff of this commit:
cvs rdiff -u -r1.320 -r1.321 src/usr.bin/make/make.1

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

Modified files:

Index: src/usr.bin/make/make.1
diff -u src/usr.bin/make/make.1:1.320 src/usr.bin/make/make.1:1.321
--- src/usr.bin/make/make.1:1.320	Sun Aug 14 09:11:33 2022
+++ src/usr.bin/make/make.1	Sun Aug 14 09:47:29 2022
@@ -1,4 +1,4 @@
-.\"	$NetBSD: make.1,v 1.320 2022/08/14 09:11:33 uwe Exp $
+.\"	$NetBSD: make.1,v 1.321 2022/08/14 09:47:29 uwe Exp $
 .\"
 .\" Copyright (c) 1990, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -307,7 +307,7 @@ If a file or directory name in the
 argument (or the
 .Ev MAKESYSPATH
 environment variable) starts with the string
-.Qq \&.../
+.Ql \&.../
 then
 .Nm
 will search for the specified file or directory named in the remaining part
@@ -315,7 +315,7 @@ of the argument string.
 The search starts with the current directory of
 the Makefile and then works upward towards the root of the file system.
 If the search is successful, then the resulting directory replaces the
-.Qq \&.../
+.Ql \&.../
 specification in the
 .Fl m
 argument.
@@ -324,7 +324,7 @@ If used, this feature allows
 to easily search in the current source tree for customized
 .Pa sys.mk
 files (e.g., by using
-.Qq \&.../mk/sys.mk
+.Ql \&.../mk/sys.mk
 as an argument).
 .It Fl n
 Display the commands that would have been executed, but do not



CVS commit: src/usr.bin/make

2022-08-14 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Sun Aug 14 09:11:33 UTC 2022

Modified Files:
src/usr.bin/make: make.1

Log Message:
make(1): Consistent formatting for -i and -s descriptions.


To generate a diff of this commit:
cvs rdiff -u -r1.319 -r1.320 src/usr.bin/make/make.1

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



CVS commit: src/usr.bin/make

2022-08-14 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Sun Aug 14 09:11:33 UTC 2022

Modified Files:
src/usr.bin/make: make.1

Log Message:
make(1): Consistent formatting for -i and -s descriptions.


To generate a diff of this commit:
cvs rdiff -u -r1.319 -r1.320 src/usr.bin/make/make.1

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

Modified files:

Index: src/usr.bin/make/make.1
diff -u src/usr.bin/make/make.1:1.319 src/usr.bin/make/make.1:1.320
--- src/usr.bin/make/make.1:1.319	Sun Aug 14 09:08:29 2022
+++ src/usr.bin/make/make.1	Sun Aug 14 09:11:33 2022
@@ -1,4 +1,4 @@
-.\"	$NetBSD: make.1,v 1.319 2022/08/14 09:08:29 uwe Exp $
+.\"	$NetBSD: make.1,v 1.320 2022/08/14 09:11:33 uwe Exp $
 .\"
 .\" Copyright (c) 1990, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -252,7 +252,7 @@ option) is automatically included as par
 .It Fl i
 Ignore non-zero exit of shell commands in the makefile.
 Equivalent to specifying
-.Ql \&-
+.Sq Ic \&-
 before each command line in the makefile.
 .It Fl J Ar private
 This option should



CVS commit: src/usr.bin/make

2022-08-14 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Sun Aug 14 09:08:29 UTC 2022

Modified Files:
src/usr.bin/make: make.1

Log Message:
make(1): Fix markup of the -d[flags] section.

The debug flags are literals, not syntactic variables (.Ar).
While here use .Dq for quoted words in the text.


To generate a diff of this commit:
cvs rdiff -u -r1.318 -r1.319 src/usr.bin/make/make.1

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

Modified files:

Index: src/usr.bin/make/make.1
diff -u src/usr.bin/make/make.1:1.318 src/usr.bin/make/make.1:1.319
--- src/usr.bin/make/make.1:1.318	Sun Aug 14 08:49:00 2022
+++ src/usr.bin/make/make.1	Sun Aug 14 09:08:29 2022
@@ -1,4 +1,4 @@
-.\"	$NetBSD: make.1,v 1.318 2022/08/14 08:49:00 uwe Exp $
+.\"	$NetBSD: make.1,v 1.319 2022/08/14 09:08:29 uwe Exp $
 .\"
 .\" Copyright (c) 1990, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -101,7 +101,7 @@ is equivalent to
 Define
 .Ar variable
 to be 1, in the global scope.
-.It Fl d Ar [-]flags
+.It Fl d Oo Cm \- Oc Ns Ar flags
 Turn on debugging, and specify which portions of
 .Nm
 are to print debugging information.
@@ -112,7 +112,7 @@ they are added to the
 environment variable and will be processed by any child make processes.
 By default, debugging information is printed to standard error,
 but this can be changed using the
-.Ar F
+.Cm F
 debugging flag.
 The debugging output is always unbuffered; in addition, if debugging
 is enabled but debugging output is not directed to standard output,
@@ -121,25 +121,25 @@ The available
 .Ar flags
 are:
 .Bl -tag -width Ds
-.It Ar A
+.It Cm A
 Print all possible debugging information;
 equivalent to specifying all of the debugging flags.
-.It Ar a
+.It Cm a
 Print debugging information about archive searching and caching.
-.It Ar C
+.It Cm C
 Print debugging information about current working directory.
-.It Ar c
+.It Cm c
 Print debugging information about conditional evaluation.
-.It Ar d
+.It Cm d
 Print debugging information about directory searching and caching.
-.It Ar e
+.It Cm e
 Print debugging information about failed commands and targets.
-.It Ar F Ns Oo Sy \&+ Oc Ns Ar filename
+.It Cm F Ns Oo \&+ Oc Ns Ar filename
 Specify where debugging output is written.
 This must be the last flag, because it consumes the remainder of
 the argument.
 If the character immediately after the
-.Ql F
+.Cm F
 flag is
 .Ql \&+ ,
 then the file will be opened in append mode;
@@ -159,35 +159,41 @@ If the file name ends with
 then the
 .Ql %d
 is replaced by the pid.
-.It Ar f
+.It Cm f
 Print debugging information about loop evaluation.
-.It Ar "g1"
+.It Cm g1
 Print the input graph before making anything.
-.It Ar "g2"
+.It Cm g2
 Print the input graph after making everything, or before exiting
 on error.
-.It Ar "g3"
+.It Cm g3
 Print the input graph before exiting on error.
-.It Ar h
+.It Cm h
 Print debugging information about hash table operations.
-.It Ar j
+.It Cm j
 Print debugging information about running multiple shells.
-.It Ar L
+.It Cm L
 Turn on lint checks.
 This will throw errors for variable assignments that do not parse
 correctly, at the time of assignment so the file and line number
 are available.
-.It Ar l
+.It Cm l
 Print commands in Makefiles regardless of whether or not they are prefixed by
 .Ql @
-or other "quiet" flags.
-Also known as "loud" behavior.
-.It Ar M
-Print debugging information about "meta" mode decisions about targets.
-.It Ar m
+or other
+.Dq quiet
+flags.
+Also known as
+.Dq loud
+behavior.
+.It Cm M
+Print debugging information about
+.Dq meta
+mode decisions about targets.
+.It Cm m
 Print debugging information about making targets, including modification
 dates.
-.It Ar n
+.It Cm n
 Don't delete the temporary command scripts created when running commands.
 These temporary scripts are created in the directory
 referred to by the
@@ -207,21 +213,21 @@ This can create many files in
 or
 .Pa /tmp ,
 so use with care.
-.It Ar p
+.It Cm p
 Print debugging information about makefile parsing.
-.It Ar s
+.It Cm s
 Print debugging information about suffix-transformation rules.
-.It Ar t
+.It Cm t
 Print debugging information about target list maintenance.
-.It Ar V
+.It Cm V
 Force the
 .Fl V
 option to print raw values of variables, overriding the default behavior
 set via
 .Va .MAKE.EXPAND_VARIABLES .
-.It Ar v
+.It Cm v
 Print debugging information about variable assignment and expansion.
-.It Ar x
+.It Cm x
 Run shell commands with
 .Fl x
 so the actual commands are printed as they are executed.



CVS commit: src/usr.bin/make

2022-08-14 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Sun Aug 14 09:08:29 UTC 2022

Modified Files:
src/usr.bin/make: make.1

Log Message:
make(1): Fix markup of the -d[flags] section.

The debug flags are literals, not syntactic variables (.Ar).
While here use .Dq for quoted words in the text.


To generate a diff of this commit:
cvs rdiff -u -r1.318 -r1.319 src/usr.bin/make/make.1

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



CVS commit: src/sys/dev/pci

2022-08-14 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Aug 14 09:04:17 UTC 2022

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

Log Message:
bge: Use BUS_DMA_WAITOK in attach routines.


To generate a diff of this commit:
cvs rdiff -u -r1.376 -r1.377 src/sys/dev/pci/if_bge.c

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

Modified files:

Index: src/sys/dev/pci/if_bge.c
diff -u src/sys/dev/pci/if_bge.c:1.376 src/sys/dev/pci/if_bge.c:1.377
--- src/sys/dev/pci/if_bge.c:1.376	Sun Aug 14 09:03:05 2022
+++ src/sys/dev/pci/if_bge.c	Sun Aug 14 09:04:17 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_bge.c,v 1.376 2022/08/14 09:03:05 skrll Exp $	*/
+/*	$NetBSD: if_bge.c,v 1.377 2022/08/14 09:04:17 skrll Exp $	*/
 
 /*
  * Copyright (c) 2001 Wind River Systems
@@ -79,7 +79,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_bge.c,v 1.376 2022/08/14 09:03:05 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_bge.c,v 1.377 2022/08/14 09:04:17 skrll Exp $");
 
 #include 
 #include 
@@ -1329,14 +1329,14 @@ bge_alloc_jumbo_mem(struct bge_softc *sc
 
 	/* Grab a big chunk o' storage. */
 	if (bus_dmamem_alloc(sc->bge_dmatag, BGE_JMEM, PAGE_SIZE, 0,
-	&sc->bge_cdata.bge_rx_jumbo_seg, 1, &rseg, BUS_DMA_NOWAIT)) {
+	&sc->bge_cdata.bge_rx_jumbo_seg, 1, &rseg, BUS_DMA_WAITOK)) {
 		aprint_error_dev(sc->bge_dev, "can't alloc rx buffers\n");
 		return ENOBUFS;
 	}
 
 	state = 1;
 	if (bus_dmamem_map(sc->bge_dmatag, &sc->bge_cdata.bge_rx_jumbo_seg,
-	rseg, BGE_JMEM, (void **)&kva, BUS_DMA_NOWAIT)) {
+	rseg, BGE_JMEM, (void **)&kva, BUS_DMA_WAITOK)) {
 		aprint_error_dev(sc->bge_dev,
 		"can't map DMA buffers (%d bytes)\n", (int)BGE_JMEM);
 		error = ENOBUFS;
@@ -1345,7 +1345,7 @@ bge_alloc_jumbo_mem(struct bge_softc *sc
 
 	state = 2;
 	if (bus_dmamap_create(sc->bge_dmatag, BGE_JMEM, 1, BGE_JMEM, 0,
-	BUS_DMA_NOWAIT, &sc->bge_cdata.bge_rx_jumbo_map)) {
+	BUS_DMA_WAITOK, &sc->bge_cdata.bge_rx_jumbo_map)) {
 		aprint_error_dev(sc->bge_dev, "can't create DMA map\n");
 		error = ENOBUFS;
 		goto out;
@@ -1353,7 +1353,7 @@ bge_alloc_jumbo_mem(struct bge_softc *sc
 
 	state = 3;
 	if (bus_dmamap_load(sc->bge_dmatag, sc->bge_cdata.bge_rx_jumbo_map,
-	kva, BGE_JMEM, NULL, BUS_DMA_NOWAIT)) {
+	kva, BGE_JMEM, NULL, BUS_DMA_WAITOK)) {
 		aprint_error_dev(sc->bge_dev, "can't load DMA map\n");
 		error = ENOBUFS;
 		goto out;
@@ -3791,7 +3791,7 @@ bge_attach(device_t parent, device_t sel
 
 			if (bus_dmatag_subregion(olddmatag, 0,
 			(bus_addr_t)__MASK(40),
-			&(sc->bge_dmatag), BUS_DMA_NOWAIT) != 0) {
+			&(sc->bge_dmatag), BUS_DMA_WAITOK) != 0) {
 aprint_error_dev(self,
 "WARNING: failed to restrict dma range,"
 " falling back to parent bus dma range\n");
@@ -3803,14 +3803,14 @@ bge_attach(device_t parent, device_t sel
 	DPRINTFN(5, ("bus_dmamem_alloc\n"));
 	if (bus_dmamem_alloc(sc->bge_dmatag, sizeof(struct bge_ring_data),
 			 PAGE_SIZE, 0, &sc->bge_ring_seg, 1,
-		&sc->bge_ring_rseg, BUS_DMA_NOWAIT)) {
+		&sc->bge_ring_rseg, BUS_DMA_WAITOK)) {
 		aprint_error_dev(sc->bge_dev, "can't alloc rx buffers\n");
 		return;
 	}
 	DPRINTFN(5, ("bus_dmamem_map\n"));
 	if (bus_dmamem_map(sc->bge_dmatag, &sc->bge_ring_seg,
 		sc->bge_ring_rseg, sizeof(struct bge_ring_data), &kva,
-			   BUS_DMA_NOWAIT)) {
+			   BUS_DMA_WAITOK)) {
 		aprint_error_dev(sc->bge_dev,
 		"can't map DMA buffers (%zu bytes)\n",
 		sizeof(struct bge_ring_data));
@@ -3821,7 +3821,7 @@ bge_attach(device_t parent, device_t sel
 	DPRINTFN(5, ("bus_dmamem_create\n"));
 	if (bus_dmamap_create(sc->bge_dmatag, sizeof(struct bge_ring_data), 1,
 	sizeof(struct bge_ring_data), 0,
-	BUS_DMA_NOWAIT, &sc->bge_ring_map)) {
+	BUS_DMA_WAITOK, &sc->bge_ring_map)) {
 		aprint_error_dev(sc->bge_dev, "can't create DMA map\n");
 		bus_dmamem_unmap(sc->bge_dmatag, kva,
  sizeof(struct bge_ring_data));
@@ -3832,7 +3832,7 @@ bge_attach(device_t parent, device_t sel
 	DPRINTFN(5, ("bus_dmamem_load\n"));
 	if (bus_dmamap_load(sc->bge_dmatag, sc->bge_ring_map, kva,
 			sizeof(struct bge_ring_data), NULL,
-			BUS_DMA_NOWAIT)) {
+			BUS_DMA_WAITOK)) {
 		bus_dmamap_destroy(sc->bge_dmatag, sc->bge_ring_map);
 		bus_dmamem_unmap(sc->bge_dmatag, kva,
  sizeof(struct bge_ring_data));



CVS commit: src/sys/dev/pci

2022-08-14 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Aug 14 09:04:17 UTC 2022

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

Log Message:
bge: Use BUS_DMA_WAITOK in attach routines.


To generate a diff of this commit:
cvs rdiff -u -r1.376 -r1.377 src/sys/dev/pci/if_bge.c

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



CVS commit: src/sys/dev/pci

2022-08-14 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Aug 14 09:03:05 UTC 2022

Modified Files:
src/sys/dev/pci: if_bge.c if_bgevar.h

Log Message:
bge: Mirror the bus_dma RX buffer changes in the OpenBSD driver

This change reduces the amount of work done in the interrupt handler.


To generate a diff of this commit:
cvs rdiff -u -r1.375 -r1.376 src/sys/dev/pci/if_bge.c
cvs rdiff -u -r1.33 -r1.34 src/sys/dev/pci/if_bgevar.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_bge.c
diff -u src/sys/dev/pci/if_bge.c:1.375 src/sys/dev/pci/if_bge.c:1.376
--- src/sys/dev/pci/if_bge.c:1.375	Sun Aug 14 09:01:25 2022
+++ src/sys/dev/pci/if_bge.c	Sun Aug 14 09:03:05 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_bge.c,v 1.375 2022/08/14 09:01:25 skrll Exp $	*/
+/*	$NetBSD: if_bge.c,v 1.376 2022/08/14 09:03:05 skrll Exp $	*/
 
 /*
  * Copyright (c) 2001 Wind River Systems
@@ -79,7 +79,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_bge.c,v 1.375 2022/08/14 09:01:25 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_bge.c,v 1.376 2022/08/14 09:03:05 skrll Exp $");
 
 #include 
 #include 
@@ -230,13 +230,15 @@ static int bge_alloc_jumbo_mem(struct bg
 static void bge_free_jumbo_mem(struct bge_softc *);
 static void *bge_jalloc(struct bge_softc *);
 static void bge_jfree(struct mbuf *, void *, size_t, void *);
-static int bge_newbuf_std(struct bge_softc *, int, struct mbuf *,
-			   bus_dmamap_t);
 static int bge_newbuf_jumbo(struct bge_softc *, int, struct mbuf *);
-static int bge_init_rx_ring_std(struct bge_softc *);
-static void bge_free_rx_ring_std(struct bge_softc *m, bool);
 static int bge_init_rx_ring_jumbo(struct bge_softc *);
 static void bge_free_rx_ring_jumbo(struct bge_softc *);
+
+static int bge_newbuf_std(struct bge_softc *, int);
+static int bge_init_rx_ring_std(struct bge_softc *);
+static void bge_fill_rx_ring_std(struct bge_softc *);
+static void bge_free_rx_ring_std(struct bge_softc *m);
+
 static void bge_free_tx_ring(struct bge_softc *m, bool);
 static int bge_init_tx_ring(struct bge_softc *);
 
@@ -1479,64 +1481,52 @@ bge_jfree(struct mbuf *m, void *buf, siz
  * Initialize a standard receive ring descriptor.
  */
 static int
-bge_newbuf_std(struct bge_softc *sc, int i, struct mbuf *m,
-bus_dmamap_t dmamap)
+bge_newbuf_std(struct bge_softc *sc, int i)
 {
-	struct mbuf		*m_new = NULL;
-	struct bge_rx_bd	*r;
-	int			error;
+	const bus_dmamap_t dmamap = sc->bge_cdata.bge_rx_std_map[i];
+	struct mbuf *m;
 
-	if (dmamap == NULL)
-		dmamap = sc->bge_cdata.bge_rx_std_map[i];
+	MGETHDR(m, M_DONTWAIT, MT_DATA);
+	if (m == NULL)
+		return ENOBUFS;
 
-	if (dmamap == NULL) {
-		error = bus_dmamap_create(sc->bge_dmatag, MCLBYTES, 1,
-		MCLBYTES, 0, BUS_DMA_NOWAIT, &dmamap);
-		if (error != 0)
-			return error;
+	MCLGET(m, M_DONTWAIT);
+	if (!(m->m_flags & M_EXT)) {
+		m_freem(m);
+		return ENOBUFS;
 	}
+	m->m_len = m->m_pkthdr.len = MCLBYTES;
 
-	sc->bge_cdata.bge_rx_std_map[i] = dmamap;
-
-	if (m == NULL) {
-		MGETHDR(m_new, M_DONTWAIT, MT_DATA);
-		if (m_new == NULL)
-			return ENOBUFS;
-
-		MCLGET(m_new, M_DONTWAIT);
-		if (!(m_new->m_flags & M_EXT)) {
-			m_freem(m_new);
-			return ENOBUFS;
-		}
-		m_new->m_len = m_new->m_pkthdr.len = MCLBYTES;
-
-	} else {
-		m_new = m;
-		m_new->m_len = m_new->m_pkthdr.len = MCLBYTES;
-		m_new->m_data = m_new->m_ext.ext_buf;
-	}
 	if (!(sc->bge_flags & BGEF_RX_ALIGNBUG))
-	m_adj(m_new, ETHER_ALIGN);
-	if (bus_dmamap_load_mbuf(sc->bge_dmatag, dmamap, m_new,
+	m_adj(m, ETHER_ALIGN);
+	if (bus_dmamap_load_mbuf(sc->bge_dmatag, dmamap, m,
 	BUS_DMA_READ | BUS_DMA_NOWAIT)) {
-		m_freem(m_new);
+		m_freem(m);
 		return ENOBUFS;
 	}
 	bus_dmamap_sync(sc->bge_dmatag, dmamap, 0, dmamap->dm_mapsize,
 	BUS_DMASYNC_PREREAD);
+	sc->bge_cdata.bge_rx_std_chain[i] = m;
 
-	sc->bge_cdata.bge_rx_std_chain[i] = m_new;
-	r = &sc->bge_rdata->bge_rx_std_ring[i];
+	bus_dmamap_sync(sc->bge_dmatag, sc->bge_ring_map,
+	offsetof(struct bge_ring_data, bge_rx_std_ring) +
+		i * sizeof(struct bge_rx_bd),
+	sizeof(struct bge_rx_bd),
+	BUS_DMASYNC_POSTWRITE);
+
+	struct bge_rx_bd * const r = &sc->bge_rdata->bge_rx_std_ring[i];
 	BGE_HOSTADDR(r->bge_addr, dmamap->dm_segs[0].ds_addr);
 	r->bge_flags = BGE_RXBDFLAG_END;
-	r->bge_len = m_new->m_len;
+	r->bge_len = m->m_len;
 	r->bge_idx = i;
 
 	bus_dmamap_sync(sc->bge_dmatag, sc->bge_ring_map,
 	offsetof(struct bge_ring_data, bge_rx_std_ring) +
 		i * sizeof(struct bge_rx_bd),
 	sizeof(struct bge_rx_bd),
-	BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD);
+	BUS_DMASYNC_PREWRITE);
+
+	sc->bge_std_cnt++;
 
 	return 0;
 }
@@ -1601,51 +1591,84 @@ bge_newbuf_jumbo(struct bge_softc *sc, i
 	return 0;
 }
 
-/*
- * The standard receive ring has 512 entries in it. At 2K per mbuf cluster,
- * that's 1MB or memory, which is a lot. For now, we fill only the first
- * 256 ring entries and hope that our CPU is

CVS commit: src/sys/dev/pci

2022-08-14 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Aug 14 09:03:05 UTC 2022

Modified Files:
src/sys/dev/pci: if_bge.c if_bgevar.h

Log Message:
bge: Mirror the bus_dma RX buffer changes in the OpenBSD driver

This change reduces the amount of work done in the interrupt handler.


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

2022-08-14 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Aug 14 09:01:25 UTC 2022

Modified Files:
src/sys/dev/pci: if_bge.c if_bgevar.h

Log Message:
Make bge(4) MP safe

This started out as a fix so that LOCKDEBUG wouldn't explode with kernel
lock spinout.  LOCKDEBUG is too aggressive now and really should be
relaxed.


To generate a diff of this commit:
cvs rdiff -u -r1.374 -r1.375 src/sys/dev/pci/if_bge.c
cvs rdiff -u -r1.32 -r1.33 src/sys/dev/pci/if_bgevar.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_bge.c
diff -u src/sys/dev/pci/if_bge.c:1.374 src/sys/dev/pci/if_bge.c:1.375
--- src/sys/dev/pci/if_bge.c:1.374	Sun Aug 14 08:42:33 2022
+++ src/sys/dev/pci/if_bge.c	Sun Aug 14 09:01:25 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_bge.c,v 1.374 2022/08/14 08:42:33 skrll Exp $	*/
+/*	$NetBSD: if_bge.c,v 1.375 2022/08/14 09:01:25 skrll Exp $	*/
 
 /*
  * Copyright (c) 2001 Wind River Systems
@@ -79,7 +79,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_bge.c,v 1.374 2022/08/14 08:42:33 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_bge.c,v 1.375 2022/08/14 09:01:25 skrll Exp $");
 
 #include 
 #include 
@@ -206,13 +206,17 @@ static int bge_encap(struct bge_softc *,
 
 static int bge_intr(void *);
 static void bge_start(struct ifnet *);
+static void bge_start_locked(struct ifnet *);
 static int bge_ifflags_cb(struct ethercom *);
 static int bge_ioctl(struct ifnet *, u_long, void *);
 static int bge_init(struct ifnet *);
+static int bge_init_locked(struct ifnet *);
 static void bge_stop(struct ifnet *, int);
-static void bge_watchdog(struct ifnet *);
+static void bge_stop_locked(struct ifnet *, int);
+static bool bge_watchdog(struct ifnet *);
 static int bge_ifmedia_upd(struct ifnet *);
 static void bge_ifmedia_sts(struct ifnet *, struct ifmediareq *);
+static void bge_handle_reset_work(struct work *, void *);
 
 static uint8_t bge_nvram_getbyte(struct bge_softc *, int, uint8_t *);
 static int bge_read_nvram(struct bge_softc *, uint8_t *, int, int);
@@ -529,6 +533,12 @@ static const struct bge_revision bge_maj
 
 static int bge_allow_asf = 1;
 
+#ifndef BGE_WATCHDOG_TIMEOUT
+#define BGE_WATCHDOG_TIMEOUT 5
+#endif
+static int bge_watchdog_timeout = BGE_WATCHDOG_TIMEOUT;
+
+
 CFATTACH_DECL3_NEW(bge, sizeof(struct bge_softc),
 bge_probe, bge_attach, bge_detach, NULL, NULL, NULL, DVF_DETACH_SHUTDOWN);
 
@@ -1247,7 +1257,6 @@ static void
 bge_set_thresh(struct ifnet *ifp, int lvl)
 {
 	struct bge_softc * const sc = ifp->if_softc;
-	int s;
 
 	/*
 	 * For now, just save the new Rx-intr thresholds and record
@@ -1256,11 +1265,11 @@ bge_set_thresh(struct ifnet *ifp, int lv
 	 * occasionally cause glitches where Rx-interrupts are not
 	 * honoured for up to 10 seconds. jonat...@netbsd.org, 2003-04-05
 	 */
-	s = splnet();
+	mutex_enter(sc->sc_core_lock);
 	sc->bge_rx_coal_ticks = bge_rx_threshes[lvl].rx_ticks;
 	sc->bge_rx_max_coal_bds = bge_rx_threshes[lvl].rx_max_bds;
 	sc->bge_pending_rxintr_change = 1;
-	splx(s);
+	mutex_exit(sc->sc_core_lock);
 }
 
 
@@ -1311,8 +1320,8 @@ static int
 bge_alloc_jumbo_mem(struct bge_softc *sc)
 {
 	char *ptr, *kva;
-	int		i, rseg, state, error;
-	struct bge_jpool_entry	 *entry;
+	int i, rseg, state, error;
+	struct bge_jpool_entry *entry;
 
 	state = error = 0;
 
@@ -1325,8 +1334,7 @@ bge_alloc_jumbo_mem(struct bge_softc *sc
 
 	state = 1;
 	if (bus_dmamem_map(sc->bge_dmatag, &sc->bge_cdata.bge_rx_jumbo_seg,
-	rseg, BGE_JMEM, (void **)&kva,
-	BUS_DMA_NOWAIT)) {
+	rseg, BGE_JMEM, (void **)&kva, BUS_DMA_NOWAIT)) {
 		aprint_error_dev(sc->bge_dev,
 		"can't map DMA buffers (%d bytes)\n", (int)BGE_JMEM);
 		error = ENOBUFS;
@@ -1443,7 +1451,6 @@ bge_jfree(struct mbuf *m, void *buf, siz
 {
 	struct bge_jpool_entry *entry;
 	struct bge_softc * const sc = arg;
-	int s;
 
 	if (sc == NULL)
 		panic("bge_jfree: can't find softc pointer!");
@@ -1454,17 +1461,17 @@ bge_jfree(struct mbuf *m, void *buf, siz
 	if (i < 0 || i >= BGE_JSLOTS)
 		panic("bge_jfree: asked to free buffer that we don't manage!");
 
-	s = splvm();
+	mutex_enter(sc->sc_core_lock);
 	entry = SLIST_FIRST(&sc->bge_jinuse_listhead);
 	if (entry == NULL)
 		panic("bge_jfree: buffer not in use!");
 	entry->slot = i;
 	SLIST_REMOVE_HEAD(&sc->bge_jinuse_listhead, jpool_entries);
 	SLIST_INSERT_HEAD(&sc->bge_jfree_listhead, entry, jpool_entries);
+	mutex_exit(sc->sc_core_lock);
 
 	if (__predict_true(m != NULL))
 		pool_cache_put(mb_cache, m);
-	splx(s);
 }
 
 
@@ -1576,6 +1583,7 @@ bge_newbuf_jumbo(struct bge_softc *sc, i
 	bus_dmamap_sync(sc->bge_dmatag, sc->bge_cdata.bge_rx_jumbo_map,
 	mtod(m_new, char *) - (char *)sc->bge_cdata.bge_jumbo_buf,
 	BGE_JLEN, BUS_DMASYNC_PREREAD);
+
 	/* Set up the descriptor. */
 	r = &sc->bge_rdata->bge_rx_jumbo_ring[i];
 	sc->bge_cdata.bge_rx_jumbo_chain[i] = m_new;
@@ -1810,14 +1818,14 @@ static void
 bge_setmulti(struct bge_softc *sc)
 {
 	stru

CVS commit: src/sys/dev/pci

2022-08-14 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Aug 14 09:01:25 UTC 2022

Modified Files:
src/sys/dev/pci: if_bge.c if_bgevar.h

Log Message:
Make bge(4) MP safe

This started out as a fix so that LOCKDEBUG wouldn't explode with kernel
lock spinout.  LOCKDEBUG is too aggressive now and really should be
relaxed.


To generate a diff of this commit:
cvs rdiff -u -r1.374 -r1.375 src/sys/dev/pci/if_bge.c
cvs rdiff -u -r1.32 -r1.33 src/sys/dev/pci/if_bgevar.h

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



CVS commit: src

2022-08-14 Thread Luke Mewburn
Module Name:src
Committed By:   lukem
Date:   Sun Aug 14 08:51:41 UTC 2022

Modified Files:
src: build.sh

Log Message:
build.sh: improve help versus usage

Rework help / usage semantics:
- send help to stdout, exit 0.
- send usage to stderr, exit 1.


To generate a diff of this commit:
cvs rdiff -u -r1.361 -r1.362 src/build.sh

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



CVS commit: src

2022-08-14 Thread Luke Mewburn
Module Name:src
Committed By:   lukem
Date:   Sun Aug 14 08:51:41 UTC 2022

Modified Files:
src: build.sh

Log Message:
build.sh: improve help versus usage

Rework help / usage semantics:
- send help to stdout, exit 0.
- send usage to stderr, exit 1.


To generate a diff of this commit:
cvs rdiff -u -r1.361 -r1.362 src/build.sh

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

Modified files:

Index: src/build.sh
diff -u src/build.sh:1.361 src/build.sh:1.362
--- src/build.sh:1.361	Fri Dec 31 15:43:35 2021
+++ src/build.sh	Sun Aug 14 08:51:41 2022
@@ -1,7 +1,7 @@
 #! /usr/bin/env sh
-#	$NetBSD: build.sh,v 1.361 2021/12/31 15:43:35 christos Exp $
+#	$NetBSD: build.sh,v 1.362 2022/08/14 08:51:41 lukem Exp $
 #
-# Copyright (c) 2001-2011 The NetBSD Foundation, Inc.
+# Copyright (c) 2001-2022 The NetBSD Foundation, Inc.
 # All rights reserved.
 #
 # This code is derived from software contributed to The NetBSD Foundation
@@ -360,6 +360,7 @@ warning()
 # Find a program in the PATH, and print the result.  If not found,
 # print a default.  If $2 is defined (even if it is an empty string),
 # then that is the default; otherwise, $1 is used as the default.
+#
 find_in_PATH()
 {
 	local prog="$1"
@@ -379,6 +380,7 @@ find_in_PATH()
 
 # Try to find a working POSIX shell, and set HOST_SH to refer to it.
 # Assumes that uname_s, uname_m, and PWD have been set.
+#
 set_HOST_SH()
 {
 	# Even if ${HOST_SH} is already defined, we still do the
@@ -948,6 +950,7 @@ setmakeenv()
 	eval "$1='$2'; export $1"
 	makeenv="${makeenv} $1"
 }
+
 safe_setmakeenv()
 {
 	case "$1" in
@@ -966,6 +969,7 @@ unsetmakeenv()
 	eval "unset $1"
 	makeenv="${makeenv} $1"
 }
+
 safe_unsetmakeenv()
 {
 	case "$1" in
@@ -980,6 +984,7 @@ safe_unsetmakeenv()
 
 # Given a variable name in $1, modify the variable in place as follows:
 # For each space-separated word in the variable, call resolvepath.
+#
 resolvepaths()
 {
 	local var="$1"
@@ -997,6 +1002,7 @@ resolvepaths()
 # Given a variable name in $1, modify the variable in place as follows:
 # Convert possibly-relative path to absolute path by prepending
 # ${TOP} if necessary.  Also delete trailing "/", if any.
+#
 resolvepath()
 {
 	local var="$1"
@@ -1015,12 +1021,10 @@ resolvepath()
 	eval ${var}=\"\${val}\"
 }
 
-usage()
+# Display help to stdout.
+#
+help()
 {
-	if [ -n "$*" ]; then
-		echo ""
-		echo "${progname}: $*"
-	fi
 	cat <<_usage_
 
 Usage: ${progname} [-EhnoPRrUuxy] [-a arch] [-B buildid] [-C cdextras]
@@ -1130,6 +1134,17 @@ Usage: ${progname} [-EhnoPRrUuxy] [-a ar
 -Z var Unset ("zap") variable \`var'.
 
 _usage_
+}
+
+# Display optional error message, help to stderr, and exit 1.
+#
+usage()
+{
+	if [ -n "$*" ]; then
+		echo ""
+		echo "${progname}: $*"
+	fi
+	help 1>&2
 	exit 1
 }
 
@@ -1349,7 +1364,8 @@ parseoptions()
 			;;
 
 		-'?'|-h)
-			usage
+			help
+			exit 0
 			;;
 
 		esac
@@ -1365,7 +1381,8 @@ parseoptions()
 		case "${op}" in
 
 		help)
-			usage
+			help
+			exit 0
 			;;
 
 		list-arch)
@@ -1974,7 +1991,7 @@ createmakewrapper()
 	eval cat <

CVS commit: src/usr.bin/make

2022-08-14 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Sun Aug 14 08:49:00 UTC 2022

Modified Files:
src/usr.bin/make: make.1

Log Message:
make(1): Fix some obviously wrong uses of .Va


To generate a diff of this commit:
cvs rdiff -u -r1.317 -r1.318 src/usr.bin/make/make.1

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

Modified files:

Index: src/usr.bin/make/make.1
diff -u src/usr.bin/make/make.1:1.317 src/usr.bin/make/make.1:1.318
--- src/usr.bin/make/make.1:1.317	Sun Aug 14 04:17:09 2022
+++ src/usr.bin/make/make.1	Sun Aug 14 08:49:00 2022
@@ -1,4 +1,4 @@
-.\"	$NetBSD: make.1,v 1.317 2022/08/14 04:17:09 rillig Exp $
+.\"	$NetBSD: make.1,v 1.318 2022/08/14 08:49:00 uwe Exp $
 .\"
 .\" Copyright (c) 1990, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -79,7 +79,7 @@ and makefiles, please refer to
 .Pp
 .Nm
 prepends the contents of the
-.Va MAKEFLAGS
+.Ev MAKEFLAGS
 environment variable to the command line arguments before parsing them.
 .Pp
 The options are as follows:
@@ -108,7 +108,7 @@ are to print debugging information.
 Unless the flags are preceded by
 .Ql \-
 they are added to the
-.Va MAKEFLAGS
+.Ev MAKEFLAGS
 environment variable and will be processed by any child make processes.
 By default, debugging information is printed to standard error,
 but this can be changed using the
@@ -400,7 +400,7 @@ Print entering and leaving directory mes
 Don't export variables passed on the command line to the environment
 individually.
 Variables passed on the command line are still exported via the
-.Va MAKEFLAGS
+.Ev MAKEFLAGS
 environment variable.
 This option may be useful on systems which have a small limit on the
 size of command arguments.
@@ -1360,7 +1360,7 @@ The value is a format string for
 using
 .Xr gmtime 3 .
 If a
-.Va utc
+.Ar utc
 value is not provided or is 0, the current time is used.
 .It Cm \&:hash
 Computes a 32-bit hash of the value and encode it as hex digits.
@@ -1370,7 +1370,7 @@ The value is a format string for
 using
 .Xr localtime 3 .
 If a
-.Va utc
+.Ar utc
 value is not provided or is 0, the current time is used.
 .It Cm \&:tA
 Attempts to convert variable to an absolute path using
@@ -1590,7 +1590,7 @@ However a single character variable is o
 Saves the current variable value in
 .Ql $_
 or the named
-.Va var
+.Ar var
 for later reference.
 Example usage:
 .Bd -literal -offset indent
@@ -1833,7 +1833,7 @@ Only global variables can be un-defined.
 The opposite of
 .Ql .export .
 The specified global
-.Va variable
+.Ar variable
 will be removed from
 .Va .MAKE.EXPORTED .
 If no variable list is provided, all globals are unexported,



CVS commit: src/usr.bin/make

2022-08-14 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Sun Aug 14 08:49:00 UTC 2022

Modified Files:
src/usr.bin/make: make.1

Log Message:
make(1): Fix some obviously wrong uses of .Va


To generate a diff of this commit:
cvs rdiff -u -r1.317 -r1.318 src/usr.bin/make/make.1

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



CVS commit: src/sys/dev/pci

2022-08-14 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Aug 14 08:45:56 UTC 2022

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

Log Message:
Whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/dev/pci/if_bgevar.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_bgevar.h
diff -u src/sys/dev/pci/if_bgevar.h:1.31 src/sys/dev/pci/if_bgevar.h:1.32
--- src/sys/dev/pci/if_bgevar.h:1.31	Sun Aug  7 08:37:48 2022
+++ src/sys/dev/pci/if_bgevar.h	Sun Aug 14 08:45:56 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_bgevar.h,v 1.31 2022/08/07 08:37:48 skrll Exp $	*/
+/*	$NetBSD: if_bgevar.h,v 1.32 2022/08/14 08:45:56 skrll Exp $	*/
 /*
  * Copyright (c) 2001 Wind River Systems
  * Copyright (c) 1997, 1998, 1999, 2001
@@ -68,20 +68,22 @@
 
 #include 
 #include 
+
 #include 
+
 #include 
 
-#define BGE_HOSTADDR(x, y)		\
-	do {\
-		(x).bge_addr_lo = BUS_ADDR_LO32(y);			\
-		if (sizeof (bus_addr_t) == 8)\
-			(x).bge_addr_hi = BUS_ADDR_HI32(y);		\
-		else			\
-			(x).bge_addr_hi = 0;\
+#define BGE_HOSTADDR(x, y)		  \
+	do {  \
+		(x).bge_addr_lo = BUS_ADDR_LO32(y);			  \
+		if (sizeof (bus_addr_t) == 8)  \
+			(x).bge_addr_hi = BUS_ADDR_HI32(y);		  \
+		else			  \
+			(x).bge_addr_hi = 0;  \
 	} while(0)
 
-#define RCB_WRITE_4(sc, rcb, offset, val) \
-	bus_space_write_4(sc->bge_btag, sc->bge_bhandle, \
+#define RCB_WRITE_4(sc, rcb, offset, val)  \
+	bus_space_write_4(sc->bge_btag, sc->bge_bhandle,		  \
 			  rcb + offsetof(struct bge_rcb, offset), val)
 
 /*
@@ -178,8 +180,8 @@ struct bge_ring_data {
 	struct bge_gib		bge_info;
 };
 
-#define BGE_RING_DMA_ADDR(sc, offset) \
-	((sc)->bge_ring_map->dm_segs[0].ds_addr + \
+#define BGE_RING_DMA_ADDR(sc, offset)	  \
+	((sc)->bge_ring_map->dm_segs[0].ds_addr +			  \
 	offsetof(struct bge_ring_data, offset))
 
 /*



CVS commit: src/sys/dev/pci

2022-08-14 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Aug 14 08:45:56 UTC 2022

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

Log Message:
Whitespace


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

2022-08-14 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Aug 14 08:42:33 UTC 2022

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

Log Message:
bge: Fix bge_ring_map bus_dmamap_sync POST{READ,WRITE} operations.

When the range of ring entries wraps around sync from the start of the
ring to the last entry.


To generate a diff of this commit:
cvs rdiff -u -r1.373 -r1.374 src/sys/dev/pci/if_bge.c

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

Modified files:

Index: src/sys/dev/pci/if_bge.c
diff -u src/sys/dev/pci/if_bge.c:1.373 src/sys/dev/pci/if_bge.c:1.374
--- src/sys/dev/pci/if_bge.c:1.373	Sun Aug  7 08:37:48 2022
+++ src/sys/dev/pci/if_bge.c	Sun Aug 14 08:42:33 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_bge.c,v 1.373 2022/08/07 08:37:48 skrll Exp $	*/
+/*	$NetBSD: if_bge.c,v 1.374 2022/08/14 08:42:33 skrll Exp $	*/
 
 /*
  * Copyright (c) 2001 Wind River Systems
@@ -79,7 +79,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_bge.c,v 1.373 2022/08/07 08:37:48 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_bge.c,v 1.374 2022/08/14 08:42:33 skrll Exp $");
 
 #include 
 #include 
@@ -4437,12 +4437,13 @@ bge_rxeof(struct bge_softc *sc)
 		sizeof(struct bge_rx_bd);
 		bus_dmamap_sync(sc->bge_dmatag, sc->bge_ring_map,
 		toff, tlen, BUS_DMASYNC_POSTREAD);
-		tosync = -tosync;
+		tosync = rx_prod;
+		toff = offset;
 	}
 
 	if (tosync != 0) {
 		bus_dmamap_sync(sc->bge_dmatag, sc->bge_ring_map,
-		offset, tosync * sizeof(struct bge_rx_bd),
+		toff, tosync * sizeof(struct bge_rx_bd),
 		BUS_DMASYNC_POSTREAD);
 	}
 
@@ -4596,9 +4597,10 @@ bge_txeof(struct bge_softc *sc)
 	sizeof(struct bge_status_block),
 	BUS_DMASYNC_POSTREAD);
 
+	const uint16_t hw_cons_idx =
+	sc->bge_rdata->bge_status_block.bge_idx[0].bge_tx_cons_idx;
 	offset = offsetof(struct bge_ring_data, bge_tx_ring);
-	tosync = sc->bge_rdata->bge_status_block.bge_idx[0].bge_tx_cons_idx -
-	sc->bge_tx_saved_considx;
+	tosync = hw_cons_idx - sc->bge_tx_saved_considx;
 
 	if (tosync != 0)
 		rnd_add_uint32(&sc->rnd_source, tosync);
@@ -4610,12 +4612,13 @@ bge_txeof(struct bge_softc *sc)
 		sizeof(struct bge_tx_bd);
 		bus_dmamap_sync(sc->bge_dmatag, sc->bge_ring_map,
 		toff, tlen, BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE);
-		tosync = -tosync;
+		tosync = hw_cons_idx;
+		toff = offset;
 	}
 
 	if (tosync != 0) {
 		bus_dmamap_sync(sc->bge_dmatag, sc->bge_ring_map,
-		offset, tosync * sizeof(struct bge_tx_bd),
+		toff, tosync * sizeof(struct bge_tx_bd),
 		BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE);
 	}
 
@@ -4623,8 +4626,7 @@ bge_txeof(struct bge_softc *sc)
 	 * Go through our tx ring and free mbufs for those
 	 * frames that have been sent.
 	 */
-	while (sc->bge_tx_saved_considx !=
-	sc->bge_rdata->bge_status_block.bge_idx[0].bge_tx_cons_idx) {
+	while (sc->bge_tx_saved_considx != hw_cons_idx) {
 		uint32_t idx = sc->bge_tx_saved_considx;
 		cur_tx = &sc->bge_rdata->bge_tx_ring[idx];
 		if (cur_tx->bge_flags & BGE_TXBDFLAG_END)



CVS commit: src/sys/dev/pci

2022-08-14 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Aug 14 08:42:33 UTC 2022

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

Log Message:
bge: Fix bge_ring_map bus_dmamap_sync POST{READ,WRITE} operations.

When the range of ring entries wraps around sync from the start of the
ring to the last entry.


To generate a diff of this commit:
cvs rdiff -u -r1.373 -r1.374 src/sys/dev/pci/if_bge.c

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



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

2022-08-14 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Sun Aug 14 07:49:33 UTC 2022

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

Log Message:
Split TSC calibtration into many small steps and disable interrupts
for each step. Also add debug messages.


To generate a diff of this commit:
cvs rdiff -u -r1.203 -r1.204 src/sys/arch/x86/x86/cpu.c

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

Modified files:

Index: src/sys/arch/x86/x86/cpu.c
diff -u src/sys/arch/x86/x86/cpu.c:1.203 src/sys/arch/x86/x86/cpu.c:1.204
--- src/sys/arch/x86/x86/cpu.c:1.203	Fri Apr  1 19:57:22 2022
+++ src/sys/arch/x86/x86/cpu.c	Sun Aug 14 07:49:33 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.c,v 1.203 2022/04/01 19:57:22 riastradh Exp $	*/
+/*	$NetBSD: cpu.c,v 1.204 2022/08/14 07:49:33 mlelstv Exp $	*/
 
 /*
  * Copyright (c) 2000-2020 NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.203 2022/04/01 19:57:22 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.204 2022/08/14 07:49:33 mlelstv Exp $");
 
 #include "opt_ddb.h"
 #include "opt_mpbios.h"		/* for MPDEBUG */
@@ -1336,9 +1336,16 @@ cpu_get_tsc_freq(struct cpu_info *ci)
 		 */
 		if (ci->ci_data.cpu_cc_freq == 0)
 			freq = freq_from_cpuid = cpu_tsc_freq_cpuid(ci);
+		if (freq != 0)
+			aprint_debug_dev(ci->ci_dev, "TSC freq "
+			"from CPUID %" PRIu64 " Hz\n", freq);
 #if NHPET > 0
-		if (freq == 0)
+		if (freq == 0) {
 			freq = hpet_tsc_freq();
+			if (freq != 0)
+aprint_debug_dev(ci->ci_dev, "TSC freq "
+"from HPET %" PRIu64 " Hz\n", freq);
+		}
 #endif
 		if (freq == 0) {
 			/*
@@ -1348,20 +1355,33 @@ cpu_get_tsc_freq(struct cpu_info *ci)
 			 */
 			overhead = 0;
 			for (int i = 0; i <= 8; i++) {
+const int s = splhigh();
 t0 = cpu_counter();
 delay_func(0);
 t1 = cpu_counter();
+splx(s);
 if (i > 0) {
 	overhead += (t1 - t0);
 }
 			}
 			overhead >>= 3;
 
-			/* Now do the calibration. */
-			t0 = cpu_counter();
-			delay_func(10);
-			t1 = cpu_counter();
-			freq = (t1 - t0 - overhead) * 10;
+			/*
+			 * Now do the calibration.
+			 */
+			freq = 0;
+			for (int i = 0; i < 1000; i++) {
+const int s = splhigh();
+t0 = cpu_counter();
+delay_func(100);
+t1 = cpu_counter();
+splx(s);
+freq += t1 - t0 - overhead;
+			}
+			freq = freq * 10;
+
+			aprint_debug_dev(ci->ci_dev, "TSC freq "
+			"from delay %" PRIu64 " Hz\n", freq);
 		}
 		if (ci->ci_data.cpu_cc_freq != 0) {
 			freq_from_cpuid = cpu_tsc_freq_cpuid(ci);



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

2022-08-14 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Sun Aug 14 07:49:33 UTC 2022

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

Log Message:
Split TSC calibtration into many small steps and disable interrupts
for each step. Also add debug messages.


To generate a diff of this commit:
cvs rdiff -u -r1.203 -r1.204 src/sys/arch/x86/x86/cpu.c

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