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

2021-02-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Thu Feb  4 07:39:39 UTC 2021

Modified Files:
src/tests/usr.bin/xlint/lint1: msg_259.c

Log Message:
lint: update message text for 259 in test

That's the one place that is not checked for matching the actual message
by my usual pre-commit checks.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/tests/usr.bin/xlint/lint1/msg_259.c

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

Modified files:

Index: src/tests/usr.bin/xlint/lint1/msg_259.c
diff -u src/tests/usr.bin/xlint/lint1/msg_259.c:1.5 src/tests/usr.bin/xlint/lint1/msg_259.c:1.6
--- src/tests/usr.bin/xlint/lint1/msg_259.c:1.5	Thu Feb  4 06:55:00 2021
+++ src/tests/usr.bin/xlint/lint1/msg_259.c	Thu Feb  4 07:39:39 2021
@@ -1,7 +1,7 @@
-/*	$NetBSD: msg_259.c,v 1.5 2021/02/04 06:55:00 rillig Exp $	*/
+/*	$NetBSD: msg_259.c,v 1.6 2021/02/04 07:39:39 rillig Exp $	*/
 # 3 "msg_259.c"
 
-// Test for message: argument #%d is converted from '%s' to '%s' [259]
+// Test for message: argument #%d is converted from '%s' to '%s' due to prototype [259]
 
 /* lint1-extra-flags: -h */
 



CVS commit: src

2021-02-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Thu Feb  4 06:55:00 UTC 2021

Modified Files:
src/tests/usr.bin/xlint/lint1: d_constant_conv2.exp d_gcc_extension.exp
d_type_conv1.exp d_type_conv2.exp d_type_conv3.exp msg_259.c
msg_259.exp
src/usr.bin/xlint/lint1: err.c tree.c

Log Message:
lint: add back "due to prototype" to message 259

That message is only supposed to warn about compatibility to traditional
C, in case the function should ever be compiled without its prototype
being in effect.  All other type checks are supposed to be in another
function, as documented, but that type check misses to report a few
error-prone type combinations (long to char, long to int).

30 years after the introduction of prototypes with C90, almost all
existing code uses prototypes.  The warning has thus lost most of its
usefulness and can rather be confusing since a conversion from 'char' to
'long' is not problematic with prototypes in action, and the probability
of the code being backported to a pre-C90 compiler is diminishingly
small.

The words "due to prototype" now serve as a hint again.  The proper fix
could be to suppress this warning in C99 mode since that's far enough
from traditional C.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/tests/usr.bin/xlint/lint1/d_constant_conv2.exp \
src/tests/usr.bin/xlint/lint1/d_type_conv1.exp \
src/tests/usr.bin/xlint/lint1/d_type_conv2.exp \
src/tests/usr.bin/xlint/lint1/d_type_conv3.exp \
src/tests/usr.bin/xlint/lint1/msg_259.c \
src/tests/usr.bin/xlint/lint1/msg_259.exp
cvs rdiff -u -r1.5 -r1.6 src/tests/usr.bin/xlint/lint1/d_gcc_extension.exp
cvs rdiff -u -r1.77 -r1.78 src/usr.bin/xlint/lint1/err.c
cvs rdiff -u -r1.204 -r1.205 src/usr.bin/xlint/lint1/tree.c

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

Modified files:

Index: src/tests/usr.bin/xlint/lint1/d_constant_conv2.exp
diff -u src/tests/usr.bin/xlint/lint1/d_constant_conv2.exp:1.4 src/tests/usr.bin/xlint/lint1/d_constant_conv2.exp:1.5
--- src/tests/usr.bin/xlint/lint1/d_constant_conv2.exp:1.4	Sun Jan 31 14:39:31 2021
+++ src/tests/usr.bin/xlint/lint1/d_constant_conv2.exp	Thu Feb  4 06:55:00 2021
@@ -1 +1 @@
-d_constant_conv2.c(11): warning: argument #1 is converted from 'double' to 'unsigned int' [259]
+d_constant_conv2.c(11): warning: argument #1 is converted from 'double' to 'unsigned int' due to prototype [259]
Index: src/tests/usr.bin/xlint/lint1/d_type_conv1.exp
diff -u src/tests/usr.bin/xlint/lint1/d_type_conv1.exp:1.4 src/tests/usr.bin/xlint/lint1/d_type_conv1.exp:1.5
--- src/tests/usr.bin/xlint/lint1/d_type_conv1.exp:1.4	Sun Jan 31 14:39:31 2021
+++ src/tests/usr.bin/xlint/lint1/d_type_conv1.exp	Thu Feb  4 06:55:00 2021
@@ -1 +1 @@
-d_type_conv1.c(13): warning: argument #1 is converted from 'long long' to 'unsigned int' [259]
+d_type_conv1.c(13): warning: argument #1 is converted from 'long long' to 'unsigned int' due to prototype [259]
Index: src/tests/usr.bin/xlint/lint1/d_type_conv2.exp
diff -u src/tests/usr.bin/xlint/lint1/d_type_conv2.exp:1.4 src/tests/usr.bin/xlint/lint1/d_type_conv2.exp:1.5
--- src/tests/usr.bin/xlint/lint1/d_type_conv2.exp:1.4	Sun Jan 31 14:39:31 2021
+++ src/tests/usr.bin/xlint/lint1/d_type_conv2.exp	Thu Feb  4 06:55:00 2021
@@ -1 +1 @@
-d_type_conv2.c(13): warning: argument #1 is converted from 'double' to 'float' [259]
+d_type_conv2.c(13): warning: argument #1 is converted from 'double' to 'float' due to prototype [259]
Index: src/tests/usr.bin/xlint/lint1/d_type_conv3.exp
diff -u src/tests/usr.bin/xlint/lint1/d_type_conv3.exp:1.4 src/tests/usr.bin/xlint/lint1/d_type_conv3.exp:1.5
--- src/tests/usr.bin/xlint/lint1/d_type_conv3.exp:1.4	Sun Jan 31 14:39:31 2021
+++ src/tests/usr.bin/xlint/lint1/d_type_conv3.exp	Thu Feb  4 06:55:00 2021
@@ -1,2 +1,2 @@
-d_type_conv3.c(12): warning: argument #1 is converted from 'long long' to 'unsigned int' [259]
+d_type_conv3.c(12): warning: argument #1 is converted from 'long long' to 'unsigned int' due to prototype [259]
 d_type_conv3.c(12): warning: conversion of 'long long' to 'unsigned int' is out of range, arg #1 [295]
Index: src/tests/usr.bin/xlint/lint1/msg_259.c
diff -u src/tests/usr.bin/xlint/lint1/msg_259.c:1.4 src/tests/usr.bin/xlint/lint1/msg_259.c:1.5
--- src/tests/usr.bin/xlint/lint1/msg_259.c:1.4	Sun Jan 31 14:05:00 2021
+++ src/tests/usr.bin/xlint/lint1/msg_259.c	Thu Feb  4 06:55:00 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg_259.c,v 1.4 2021/01/31 14:05:00 rillig Exp $	*/
+/*	$NetBSD: msg_259.c,v 1.5 2021/02/04 06:55:00 rillig Exp $	*/
 # 3 "msg_259.c"
 
 // Test for message: argument #%d is converted from '%s' to '%s' [259]
@@ -14,10 +14,10 @@ example(char c, int i, long l)
 {
 	farg_char(c);
 	farg_int(c);
-	farg_long(c);
+	farg_long(c);		/* XXX: 259 on ILP32 but not LP64 */
 	farg_char(i);		/* XXX: why no warning? */
 	farg_int(i);
-	farg_long(i);
+	farg_long(i);		/* XXX: 259 on

CVS commit: src/usr.bin/make/unit-tests

2021-02-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Thu Feb  4 00:16:03 UTC 2021

Modified Files:
src/usr.bin/make/unit-tests: Makefile varname-empty.exp

Log Message:
make: remove .PARSEDIR from test output of varname-empty

The .PARSEDIR has nothing to do with .CURDIR.  This wrong assumption
made the NetBSD test suite fail since the actual .PARSEDIR was not
replaced with "".


To generate a diff of this commit:
cvs rdiff -u -r1.267 -r1.268 src/usr.bin/make/unit-tests/Makefile
cvs rdiff -u -r1.7 -r1.8 src/usr.bin/make/unit-tests/varname-empty.exp

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/unit-tests/Makefile
diff -u src/usr.bin/make/unit-tests/Makefile:1.267 src/usr.bin/make/unit-tests/Makefile:1.268
--- src/usr.bin/make/unit-tests/Makefile:1.267	Wed Feb  3 08:34:15 2021
+++ src/usr.bin/make/unit-tests/Makefile	Thu Feb  4 00:16:03 2021
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.267 2021/02/03 08:34:15 rillig Exp $
+# $NetBSD: Makefile,v 1.268 2021/02/04 00:16:03 rillig Exp $
 #
 # Unit tests for make(1)
 #
@@ -520,6 +520,7 @@ SED_CMDS.varname-dot-shell=	-e 's, = /[^
 SED_CMDS.varname-dot-shell+=	-e 's,"/[^" ]*","(details omitted)",g'
 SED_CMDS.varname-dot-shell+=	-e 's,\[/[^] ]*\],[(details omitted)],g'
 SED_CMDS.varname-empty=		-e 's,${.CURDIR},,g'
+SED_CMDS.varname-empty+=	-e '/\.PARSEDIR/d'
 SED_CMDS.varname-empty+=	-e '/\.SHELL/d'
 
 # Some tests need an additional round of postprocessing.

Index: src/usr.bin/make/unit-tests/varname-empty.exp
diff -u src/usr.bin/make/unit-tests/varname-empty.exp:1.7 src/usr.bin/make/unit-tests/varname-empty.exp:1.8
--- src/usr.bin/make/unit-tests/varname-empty.exp:1.7	Wed Feb  3 08:40:47 2021
+++ src/usr.bin/make/unit-tests/varname-empty.exp	Thu Feb  4 00:16:03 2021
@@ -14,7 +14,6 @@ Global:.PATH = . 
 Global:.TARGETS = 
 Internal:MAKEFILE = varname-empty.mk
 Global:.MAKE.MAKEFILES = varname-empty.mk
-Global:.PARSEDIR = 
 Global:.PARSEFILE = varname-empty.mk
 Global:delete .INCLUDEDFROMDIR (not found)
 Global:delete .INCLUDEDFROMFILE (not found)



CVS commit: src/sys/dev/usb

2021-02-03 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Wed Feb  3 23:26:08 UTC 2021

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

Log Message:
I have a cheap USB optical mouse (CHICONY product 0x0939, also known
as "PixArt USB Optical Mouse") that likes to disconnect after 60 seconds
and then reattach 2 seconds later (ad nauseum) unless it's kept open,
so use the "always open" quirk on that device as well.


To generate a diff of this commit:
cvs rdiff -u -r1.99 -r1.100 src/sys/dev/usb/ums.c

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

Modified files:

Index: src/sys/dev/usb/ums.c
diff -u src/sys/dev/usb/ums.c:1.99 src/sys/dev/usb/ums.c:1.100
--- src/sys/dev/usb/ums.c:1.99	Sat Oct 10 21:47:42 2020
+++ src/sys/dev/usb/ums.c	Wed Feb  3 23:26:08 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: ums.c,v 1.99 2020/10/10 21:47:42 jmcneill Exp $	*/
+/*	$NetBSD: ums.c,v 1.100 2021/02/03 23:26:08 thorpej Exp $	*/
 
 /*
  * Copyright (c) 1998, 2017 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ums.c,v 1.99 2020/10/10 21:47:42 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ums.c,v 1.100 2021/02/03 23:26:08 thorpej Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -210,6 +210,16 @@ ums_attach(device_t parent, device_t sel
 		sc->sc_alwayson = true;
 	}
 
+	if (uha->uiaa->uiaa_vendor == USB_VENDOR_CHICONY &&
+	uha->uiaa->uiaa_product == USB_PRODUCT_CHICONY_OPTMOUSE0939) {
+		/*
+		 * This cheap mouse will disconnect after 60 seconds,
+		 * reconnect, and then disconnect again (ad nauseum)
+		 * unless it's kept open.
+		 */
+		sc->sc_alwayson = true;
+	}
+
 	tpcalib_init(&sc->sc_ms.sc_tpcalib);
 
 	/* calibrate the pointer if it reports absolute events */



CVS commit: src/sys/dev/usb

2021-02-03 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Wed Feb  3 23:24:08 UTC 2021

Modified Files:
src/sys/dev/usb: usbdevs.h usbdevs_data.h

Log Message:
Regen for addition of CHICONY optical mouse.


To generate a diff of this commit:
cvs rdiff -u -r1.779 -r1.780 src/sys/dev/usb/usbdevs.h \
src/sys/dev/usb/usbdevs_data.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/usb/usbdevs.h
diff -u src/sys/dev/usb/usbdevs.h:1.779 src/sys/dev/usb/usbdevs.h:1.780
--- src/sys/dev/usb/usbdevs.h:1.779	Mon Feb  1 04:49:02 2021
+++ src/sys/dev/usb/usbdevs.h	Wed Feb  3 23:24:07 2021
@@ -1,10 +1,10 @@
-/*	$NetBSD: usbdevs.h,v 1.779 2021/02/01 04:49:02 nia Exp $	*/
+/*	$NetBSD: usbdevs.h,v 1.780 2021/02/03 23:24:07 thorpej Exp $	*/
 
 /*
  * THIS FILE IS AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: usbdevs,v 1.789 2021/02/01 04:46:33 nia Exp
+ *	NetBSD: usbdevs,v 1.790 2021/02/03 23:23:42 thorpej Exp
  */
 
 /*-
@@ -1180,6 +1180,7 @@
 
 /* Chicony products */
 #define	USB_PRODUCT_CHICONY_KB8933	0x0001		/* KB-8933 keyboard */
+#define	USB_PRODUCT_CHICONY_OPTMOUSE0939	0x0939		/* USB Optical Mouse */
 #define	USB_PRODUCT_CHICONY_RTL8188CUS_1	0xaff7		/* RTL8188CUS */
 #define	USB_PRODUCT_CHICONY_RTL8188CUS_2	0xaff8		/* RTL8188CUS */
 #define	USB_PRODUCT_CHICONY_RTL8188CUS_3	0xaff9		/* RTL8188CUS */
Index: src/sys/dev/usb/usbdevs_data.h
diff -u src/sys/dev/usb/usbdevs_data.h:1.779 src/sys/dev/usb/usbdevs_data.h:1.780
--- src/sys/dev/usb/usbdevs_data.h:1.779	Mon Feb  1 04:49:02 2021
+++ src/sys/dev/usb/usbdevs_data.h	Wed Feb  3 23:24:07 2021
@@ -1,10 +1,10 @@
-/*	$NetBSD: usbdevs_data.h,v 1.779 2021/02/01 04:49:02 nia Exp $	*/
+/*	$NetBSD: usbdevs_data.h,v 1.780 2021/02/03 23:24:07 thorpej Exp $	*/
 
 /*
  * THIS FILE IS AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: usbdevs,v 1.789 2021/02/01 04:46:33 nia Exp
+ *	NetBSD: usbdevs,v 1.790 2021/02/03 23:23:42 thorpej Exp
  */
 
 /*-
@@ -1400,6 +1400,8 @@ static const uint16_t usb_products[] = {
 	771, 4922, 6459, 0,
 	USB_VENDOR_CHICONY, USB_PRODUCT_CHICONY_KB8933, 
 	8033, 8009, 0,
+	USB_VENDOR_CHICONY, USB_PRODUCT_CHICONY_OPTMOUSE0939, 
+	4922, 3363, 6459, 0,
 	USB_VENDOR_CHICONY, USB_PRODUCT_CHICONY_RTL8188CUS_1, 
 	7469, 0,
 	USB_VENDOR_CHICONY, USB_PRODUCT_CHICONY_RTL8188CUS_2, 
@@ -5465,7 +5467,7 @@ static const char usb_words[] = { "." 
 	"Cambridge\0" /* 1 refs @ 3342 */
 	"Radio\0" /* 8 refs @ 3352 */
 	"Trek\0" /* 1 refs @ 3358 */
-	"Optical\0" /* 6 refs @ 3363 */
+	"Optical\0" /* 7 refs @ 3363 */
 	"ShanTou\0" /* 1 refs @ 3371 */
 	"MediaGear\0" /* 1 refs @ 3379 */
 	"Broadcom\0" /* 2 refs @ 3389 */
@@ -5674,7 +5676,7 @@ static const char usb_words[] = { "." 
 	"GNU\0" /* 1 refs @ 4901 */
 	"USRP\0" /* 2 refs @ 4905 */
 	"HomeConnect\0" /* 4 refs @ 4910 */
-	"USB\0" /* 211 refs @ 4922 */
+	"USB\0" /* 212 refs @ 4922 */
 	"Bluetooth\0" /* 26 refs @ 4926 */
 	"Adapter\0" /* 79 refs @ 4936 */
 	"3C19250\0" /* 1 refs @ 4944 */
@@ -5868,7 +5870,7 @@ static const char usb_words[] = { "." 
 	"(Wellspring2/JIS)\0" /* 1 refs @ 6428 */
 	"mouse\0" /* 16 refs @ 6446 */
 	"Mighty\0" /* 2 refs @ 6452 */
-	"Mouse\0" /* 14 refs @ 6459 */
+	"Mouse\0" /* 15 refs @ 6459 */
 	"Trackpad\0" /* 3 refs @ 6465 */
 	"(Fountain)\0" /* 1 refs @ 6474 */
 	"(Geyser)\0" /* 1 refs @ 6485 */



CVS commit: src/sys/dev/usb

2021-02-03 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Wed Feb  3 23:23:42 UTC 2021

Modified Files:
src/sys/dev/usb: usbdevs

Log Message:
Add a CHICONY optical mouse product ID.


To generate a diff of this commit:
cvs rdiff -u -r1.789 -r1.790 src/sys/dev/usb/usbdevs

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

Modified files:

Index: src/sys/dev/usb/usbdevs
diff -u src/sys/dev/usb/usbdevs:1.789 src/sys/dev/usb/usbdevs:1.790
--- src/sys/dev/usb/usbdevs:1.789	Mon Feb  1 04:46:33 2021
+++ src/sys/dev/usb/usbdevs	Wed Feb  3 23:23:42 2021
@@ -1,4 +1,4 @@
-$NetBSD: usbdevs,v 1.789 2021/02/01 04:46:33 nia Exp $
+$NetBSD: usbdevs,v 1.790 2021/02/03 23:23:42 thorpej Exp $
 
 /*-
  * Copyright (c) 1998-2004 The NetBSD Foundation, Inc.
@@ -1173,6 +1173,7 @@ product CHIC CYPRESS		0x0003	Cypress USB
 
 /* Chicony products */
 product CHICONY KB8933		0x0001	KB-8933 keyboard
+product CHICONY OPTMOUSE0939	0x0939	USB Optical Mouse
 product CHICONY RTL8188CUS_1	0xaff7	RTL8188CUS
 product CHICONY RTL8188CUS_2	0xaff8	RTL8188CUS
 product CHICONY RTL8188CUS_3	0xaff9	RTL8188CUS



CVS commit: src/sys/dev/pci

2021-02-03 Thread Reinoud Zandijk
Module Name:src
Committed By:   reinoud
Date:   Wed Feb  3 21:04:41 UTC 2021

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

Log Message:
Oops, made a mistake in my last commit


To generate a diff of this commit:
cvs rdiff -u -r1.68 -r1.69 src/sys/dev/pci/if_vioif.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_vioif.c
diff -u src/sys/dev/pci/if_vioif.c:1.68 src/sys/dev/pci/if_vioif.c:1.69
--- src/sys/dev/pci/if_vioif.c:1.68	Wed Feb  3 20:27:59 2021
+++ src/sys/dev/pci/if_vioif.c	Wed Feb  3 21:04:41 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_vioif.c,v 1.68 2021/02/03 20:27:59 reinoud Exp $	*/
+/*	$NetBSD: if_vioif.c,v 1.69 2021/02/03 21:04:41 reinoud Exp $	*/
 
 /*
  * Copyright (c) 2020 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_vioif.c,v 1.68 2021/02/03 20:27:59 reinoud Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_vioif.c,v 1.69 2021/02/03 21:04:41 reinoud Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -574,7 +574,7 @@ vioif_alloc_mems(struct vioif_softc *sc)
 		rxq = &sc->sc_rxq[qid];
 		txq = &sc->sc_txq[qid];
 
-		allocsize += sizeof(struct virtio_net_hdr *) *
+		allocsize += sizeof(struct virtio_net_hdr) *
 			(rxq->rxq_vq->vq_num + txq->txq_vq->vq_num);
 	}
 	if (sc->sc_has_ctrl) {



CVS commit: src/sys/dev/pci

2021-02-03 Thread Reinoud Zandijk
Module Name:src
Committed By:   reinoud
Date:   Wed Feb  3 20:28:00 UTC 2021

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

Log Message:
Allocate enough space for the bus_dmamap_t arrays for rxq_hdr_dmamaps[] and
txq_hdr_maps[]


To generate a diff of this commit:
cvs rdiff -u -r1.67 -r1.68 src/sys/dev/pci/if_vioif.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_vioif.c
diff -u src/sys/dev/pci/if_vioif.c:1.67 src/sys/dev/pci/if_vioif.c:1.68
--- src/sys/dev/pci/if_vioif.c:1.67	Sun Jan 31 14:17:48 2021
+++ src/sys/dev/pci/if_vioif.c	Wed Feb  3 20:27:59 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_vioif.c,v 1.67 2021/01/31 14:17:48 reinoud Exp $	*/
+/*	$NetBSD: if_vioif.c,v 1.68 2021/02/03 20:27:59 reinoud Exp $	*/
 
 /*
  * Copyright (c) 2020 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_vioif.c,v 1.67 2021/01/31 14:17:48 reinoud Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_vioif.c,v 1.68 2021/02/03 20:27:59 reinoud Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -574,8 +574,8 @@ vioif_alloc_mems(struct vioif_softc *sc)
 		rxq = &sc->sc_rxq[qid];
 		txq = &sc->sc_txq[qid];
 
-		allocsize += sc->sc_hdr_size * rxq->rxq_vq->vq_num;
-		allocsize += sc->sc_hdr_size * txq->txq_vq->vq_num;
+		allocsize += sizeof(struct virtio_net_hdr *) *
+			(rxq->rxq_vq->vq_num + txq->txq_vq->vq_num);
 	}
 	if (sc->sc_has_ctrl) {
 		allocsize += sizeof(struct virtio_net_ctrl_cmd) * 1;



CVS commit: src/sys

2021-02-03 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Wed Feb  3 18:13:14 UTC 2021

Modified Files:
src/sys/net: if_arp.h if_ether.h if_gre.h if_llc.h
src/sys/netinet: igmp.h in.h ip.h ip6.h ip_carp.h ip_icmp.h ip_mroute.h
ip_var.h tcp.h tcp_debug.h udp.h

Log Message:
CTASSERT -> __CTASSERT to unbreak userland build.

While here move __packed in tcp_debug.h back to where it was and
note removal warrants more investigation.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/sys/net/if_arp.h
cvs rdiff -u -r1.83 -r1.84 src/sys/net/if_ether.h
cvs rdiff -u -r1.46 -r1.47 src/sys/net/if_gre.h
cvs rdiff -u -r1.22 -r1.23 src/sys/net/if_llc.h
cvs rdiff -u -r1.14 -r1.15 src/sys/netinet/igmp.h
cvs rdiff -u -r1.113 -r1.114 src/sys/netinet/in.h
cvs rdiff -u -r1.37 -r1.38 src/sys/netinet/ip.h
cvs rdiff -u -r1.28 -r1.29 src/sys/netinet/ip6.h
cvs rdiff -u -r1.13 -r1.14 src/sys/netinet/ip_carp.h
cvs rdiff -u -r1.42 -r1.43 src/sys/netinet/ip_icmp.h
cvs rdiff -u -r1.34 -r1.35 src/sys/netinet/ip_mroute.h
cvs rdiff -u -r1.132 -r1.133 src/sys/netinet/ip_var.h
cvs rdiff -u -r1.36 -r1.37 src/sys/netinet/tcp.h
cvs rdiff -u -r1.20 -r1.21 src/sys/netinet/tcp_debug.h
cvs rdiff -u -r1.18 -r1.19 src/sys/netinet/udp.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/net/if_arp.h
diff -u src/sys/net/if_arp.h:1.36 src/sys/net/if_arp.h:1.37
--- src/sys/net/if_arp.h:1.36	Wed Feb  3 11:53:43 2021
+++ src/sys/net/if_arp.h	Wed Feb  3 18:13:13 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_arp.h,v 1.36 2021/02/03 11:53:43 roy Exp $	*/
+/*	$NetBSD: if_arp.h,v 1.37 2021/02/03 18:13:13 roy Exp $	*/
 
 /*
  * Copyright (c) 1986, 1993
@@ -72,8 +72,8 @@ struct	arphdr {
 	uint8_t  ar_tpa[];	/* target protocol address */
 #endif
 };
-#ifdef CTASSERT
-CTASSERT(sizeof(struct arphdr) == 8);
+#ifdef __CTASSERT
+__CTASSERT(sizeof(struct arphdr) == 8);
 #endif
 
 static __inline uint8_t *

Index: src/sys/net/if_ether.h
diff -u src/sys/net/if_ether.h:1.83 src/sys/net/if_ether.h:1.84
--- src/sys/net/if_ether.h:1.83	Wed Feb  3 11:53:43 2021
+++ src/sys/net/if_ether.h	Wed Feb  3 18:13:13 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_ether.h,v 1.83 2021/02/03 11:53:43 roy Exp $	*/
+/*	$NetBSD: if_ether.h,v 1.84 2021/02/03 18:13:13 roy Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1993
@@ -90,9 +90,9 @@ struct ether_header {
 	uint16_t ether_type;
 };
 
-#ifdef CTASSERT
-CTASSERT(sizeof(struct ether_addr) == 6);
-CTASSERT(sizeof(struct ether_header) == 14);
+#ifdef __CTASSERT
+__CTASSERT(sizeof(struct ether_addr) == 6);
+__CTASSERT(sizeof(struct ether_header) == 14);
 #endif
 
 #include 

Index: src/sys/net/if_gre.h
diff -u src/sys/net/if_gre.h:1.46 src/sys/net/if_gre.h:1.47
--- src/sys/net/if_gre.h:1.46	Wed Feb  3 11:53:43 2021
+++ src/sys/net/if_gre.h	Wed Feb  3 18:13:13 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_gre.h,v 1.46 2021/02/03 11:53:43 roy Exp $ */
+/*	$NetBSD: if_gre.h,v 1.47 2021/02/03 18:13:13 roy Exp $ */
 
 /*
  * Copyright (c) 1998, 2008 The NetBSD Foundation, Inc.
@@ -131,8 +131,8 @@ struct gre_h {
 Present if (rt_pres == 1)
  */
 };
-#ifdef CTASSERT
-CTASSERT(sizeof(struct gre_h) == 4);
+#ifdef __CTASSERT
+__CTASSERT(sizeof(struct gre_h) == 4);
 #endif
 
 #define GRE_CP		0x8000  /* Checksum Present */

Index: src/sys/net/if_llc.h
diff -u src/sys/net/if_llc.h:1.22 src/sys/net/if_llc.h:1.23
--- src/sys/net/if_llc.h:1.22	Wed Feb  3 12:11:34 2021
+++ src/sys/net/if_llc.h	Wed Feb  3 18:13:13 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_llc.h,v 1.22 2021/02/03 12:11:34 roy Exp $	*/
+/*	$NetBSD: if_llc.h,v 1.23 2021/02/03 18:13:13 roy Exp $	*/
 
 /*
  * Copyright (c) 1988, 1993
@@ -92,9 +92,9 @@ struct frmrinfo {
 	uint8_t frmr_cause;
 };
 
-#ifdef CTASSERT
-CTASSERT(sizeof(struct llc) == 8);
-CTASSERT(sizeof(struct frmrinfo) == 5);
+#ifdef __CTASSERT
+__CTASSERT(sizeof(struct llc) == 8);
+__CTASSERT(sizeof(struct frmrinfo) == 5);
 #endif
 
 #define	llc_control		llc_un.type_u.control

Index: src/sys/netinet/igmp.h
diff -u src/sys/netinet/igmp.h:1.14 src/sys/netinet/igmp.h:1.15
--- src/sys/netinet/igmp.h:1.14	Wed Feb  3 11:53:43 2021
+++ src/sys/netinet/igmp.h	Wed Feb  3 18:13:13 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: igmp.h,v 1.14 2021/02/03 11:53:43 roy Exp $	*/
+/*	$NetBSD: igmp.h,v 1.15 2021/02/03 18:13:13 roy Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -89,8 +89,8 @@ struct igmp {
 	uint16_t	igmp_cksum;	/* IP-style checksum   */
 	struct in_addr	igmp_group;	/* group address being reported*/
 };			/*  (zero for queries) */
-#ifdef CTASSERT
-CTASSERT(sizeof(struct igmp) == 8);
+#ifdef __CTASSERT
+__CTASSERT(sizeof(struct igmp) == 8);
 #endif
 
 #define	IGMP_MINLEN			8

Index: src/sys/netinet/in.h
diff -u src/sys/netinet/in.h:1.113 src/sys/netinet/in.h:1.114
--- src/sys/netinet/in.h:1.113	Wed Feb  3 11:53:43 2021
+++ src/sys/netinet/in.h	Wed Feb  3 18:13:13 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: in.h,v 1.113 2021/02/03

CVS commit: src/sys/netinet

2021-02-03 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Wed Feb  3 17:10:13 UTC 2021

Modified Files:
src/sys/netinet: if_ether.h

Log Message:
Guard CTASSERT


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/sys/netinet/if_ether.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/netinet/if_ether.h
diff -u src/sys/netinet/if_ether.h:1.36 src/sys/netinet/if_ether.h:1.37
--- src/sys/netinet/if_ether.h:1.36	Wed Feb  3 11:53:43 2021
+++ src/sys/netinet/if_ether.h	Wed Feb  3 17:10:13 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_ether.h,v 1.36 2021/02/03 11:53:43 roy Exp $	*/
+/*	$NetBSD: if_ether.h,v 1.37 2021/02/03 17:10:13 roy Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1993
@@ -76,7 +76,9 @@ struct	ether_arp {
 	u_int8_t arp_tha[ETHER_ADDR_LEN];	/* target hardware address */
 	u_int8_t arp_tpa[4];			/* target protocol address */
 };
+#ifdef CTASSERT
 CTASSERT(sizeof(struct ether_arp) == 28);
+#endif
 #define	arp_hrd	ea_hdr.ar_hrd
 #define	arp_pro	ea_hdr.ar_pro
 #define	arp_hln	ea_hdr.ar_hln



CVS commit: src/external/gpl2/send-pr/dist/send-pr

2021-02-03 Thread Ryo ONODERA
Module Name:src
Committed By:   ryoon
Date:   Wed Feb  3 15:42:53 UTC 2021

Modified Files:
src/external/gpl2/send-pr/dist/send-pr: send-pr-el.in

Log Message:
Do not use old-style backquotes and other old-style expressions.

Fix PR misc/55918.
Tested with pkgsrc/editors/emacs26 and emacs27.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/gpl2/send-pr/dist/send-pr/send-pr-el.in

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

Modified files:

Index: src/external/gpl2/send-pr/dist/send-pr/send-pr-el.in
diff -u src/external/gpl2/send-pr/dist/send-pr/send-pr-el.in:1.2 src/external/gpl2/send-pr/dist/send-pr/send-pr-el.in:1.3
--- src/external/gpl2/send-pr/dist/send-pr/send-pr-el.in:1.2	Thu Jan 14 21:13:20 2016
+++ src/external/gpl2/send-pr/dist/send-pr/send-pr-el.in	Wed Feb  3 15:42:53 2021
@@ -151,23 +151,23 @@ at runtime.")
 ;;; during runtime instead of having them here in the code.
 ;;;
 (defconst send-pr::fields
-  (` (("Category" send-pr::set-categories
-   (, (or (gnats::get-config "DEFAULT_CATEGORY") nil)) enum)
+`(("Category" send-pr::set-categories
+   ,(or (gnats::get-config "DEFAULT_CATEGORY") nil) enum)
   ("Class" (("sw-bug") ("doc-bug") ("change-request") ("support"))
-   (, (or (gnats::get-config "DEFAULT_CLASS") 0)) enum)
+   ,(or (gnats::get-config "DEFAULT_CLASS") 0) enum)
   ("Confidential" (("yes") ("no"))
-   (, (or (gnats::get-config "DEFAULT_CONFIDENTIAL") 1)) enum)
+   ,(or (gnats::get-config "DEFAULT_CONFIDENTIAL") 1) enum)
   ("Severity" (("non-critical") ("serious") ("critical"))
-   (, (or (gnats::get-config "DEFAULT_SEVERITY") 1)) enum)
+   ,(or (gnats::get-config "DEFAULT_SEVERITY") 1) enum)
   ("Priority" (("low") ("medium") ("high"))
-   (, (or (gnats::get-config "DEFAULT_PRIORITY") 1)) enum)
+   ,(or (gnats::get-config "DEFAULT_PRIORITY") 1) enum)
   ("Release" nil
-   (, (or (gnats::get-config "DEFAULT_RELEASE") "xDEFAULT_RELEASEx"))
+   ,(or (gnats::get-config "DEFAULT_RELEASE") "`uname -s` `uname -r`")
text)
   ("Submitter-Id" nil
-   (, (or (gnats::get-config "SUBMITTER") "xSUBMITTERx")) text)
+   ,(or (gnats::get-config "SUBMITTER") "net") text)
   ("Synopsis" nil nil text
-   (lambda (a b c) (gnats::set-mail-field "Subject" c)
+   (lambda (a b c) (gnats::set-mail-field "Subject" c
   "AList, keyed on the name of the field, of:
 1) The field name.
 2) The list of completions.  This can be a list, a function to call, or nil.
@@ -178,7 +178,7 @@ at runtime.")
 (defvar gnats::fields nil)
 
 (defmacro gnats::push (i l)
-  (` (setq (, l) (cons (,@ (list i l))
+  `(setq ,l (cons ,@ (list i l
 
 (defun send-pr::set-categories (&optional arg)
   "Get the list of categories for the current site out of



CVS commit: src/sys/arch/hppa/gsc

2021-02-03 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Wed Feb  3 15:13:49 UTC 2021

Modified Files:
src/sys/arch/hppa/gsc: harmony.c

Log Message:
Fix locking against myself.
trigger_output will be called with sc_intr_lock held.
>From source code review, not tested.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/hppa/gsc/harmony.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/hppa/gsc/harmony.c
diff -u src/sys/arch/hppa/gsc/harmony.c:1.7 src/sys/arch/hppa/gsc/harmony.c:1.8
--- src/sys/arch/hppa/gsc/harmony.c:1.7	Sat Jun  8 08:02:37 2019
+++ src/sys/arch/hppa/gsc/harmony.c	Wed Feb  3 15:13:49 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: harmony.c,v 1.7 2019/06/08 08:02:37 isaki Exp $	*/
+/*	$NetBSD: harmony.c,v 1.8 2021/02/03 15:13:49 isaki Exp $	*/
 
 /*	$OpenBSD: harmony.c,v 1.23 2004/02/13 21:28:19 mickey Exp $	*/
 
@@ -1004,8 +1004,6 @@ harmony_trigger_output(void *vsc, void *
 		return EINVAL;
 	}
 
-	mutex_spin_enter(&sc->sc_intr_lock);
-
 	c->c_intr = intr;
 	c->c_intrarg = intrarg;
 	c->c_blksz = blksize;
@@ -1020,8 +1018,6 @@ harmony_trigger_output(void *vsc, void *
 	harmony_start_cp(sc, 0);
 	harmony_intr_enable(sc);
 
-	mutex_spin_exit(&sc->sc_intr_lock);
-
 	return 0;
 }
 



CVS commit: src/usr.bin/make

2021-02-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Wed Feb  3 15:08:17 UTC 2021

Modified Files:
src/usr.bin/make: meta.c nonints.h var.c

Log Message:
make: rename Var_Delete to Var_DeleteExpand, Var_DeleteVar to Var_Delete

The function names now follow the naming scheme from the other functions
that handle variables.

There are several calls that remain syntactically unchanged but that
omit the call to strchr('$') now.  Since all these calls use constant
variable names, there is no functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.173 -r1.174 src/usr.bin/make/meta.c
cvs rdiff -u -r1.195 -r1.196 src/usr.bin/make/nonints.h
cvs rdiff -u -r1.796 -r1.797 src/usr.bin/make/var.c

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

Modified files:

Index: src/usr.bin/make/meta.c
diff -u src/usr.bin/make/meta.c:1.173 src/usr.bin/make/meta.c:1.174
--- src/usr.bin/make/meta.c:1.173	Wed Feb  3 13:53:12 2021
+++ src/usr.bin/make/meta.c	Wed Feb  3 15:08:17 2021
@@ -1,4 +1,4 @@
-/*  $NetBSD: meta.c,v 1.173 2021/02/03 13:53:12 rillig Exp $ */
+/*  $NetBSD: meta.c,v 1.174 2021/02/03 15:08:17 rillig Exp $ */
 
 /*
  * Implement 'meta' mode.
@@ -1251,8 +1251,8 @@ meta_oodate(GNode *gn, Boolean oodate)
 		/* Process according to record type. */
 		switch (buf[0]) {
 		case 'X':		/* eXit */
-		Var_Delete(lcwd_vname, VAR_GLOBAL);
-		Var_Delete(ldir_vname, VAR_GLOBAL);
+		Var_DeleteExpand(lcwd_vname, VAR_GLOBAL);
+		Var_DeleteExpand(ldir_vname, VAR_GLOBAL);
 		lastpid = 0;	/* no need to save ldir_vname */
 		break;
 

Index: src/usr.bin/make/nonints.h
diff -u src/usr.bin/make/nonints.h:1.195 src/usr.bin/make/nonints.h:1.196
--- src/usr.bin/make/nonints.h:1.195	Wed Feb  3 14:33:09 2021
+++ src/usr.bin/make/nonints.h	Wed Feb  3 15:08:17 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: nonints.h,v 1.195 2021/02/03 14:33:09 rillig Exp $	*/
+/*	$NetBSD: nonints.h,v 1.196 2021/02/03 15:08:17 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -368,8 +368,8 @@ typedef enum VarExportMode {
 	VEM_LITERAL
 } VarExportMode;
 
-void Var_DeleteVar(const char *, GNode *);
 void Var_Delete(const char *, GNode *);
+void Var_DeleteExpand(const char *, GNode *);
 void Var_Undef(const char *);
 void Global_Set(const char *, const char *);
 void Global_SetExpand(const char *, const char *);

Index: src/usr.bin/make/var.c
diff -u src/usr.bin/make/var.c:1.796 src/usr.bin/make/var.c:1.797
--- src/usr.bin/make/var.c:1.796	Wed Feb  3 14:33:09 2021
+++ src/usr.bin/make/var.c	Wed Feb  3 15:08:17 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: var.c,v 1.796 2021/02/03 14:33:09 rillig Exp $	*/
+/*	$NetBSD: var.c,v 1.797 2021/02/03 15:08:17 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -100,7 +100,9 @@
  *
  *	Var_Parse	Parse a variable expression such as ${VAR:Mpattern}.
  *
- *	Var_Delete	Delete a variable.
+ *	Var_Delete
+ *	Var_DeleteExpand
+ *			Delete a variable.
  *
  *	Var_ReexportVars
  *			Export some or even all variables to the environment
@@ -135,7 +137,7 @@
 #include "metachar.h"
 
 /*	"@(#)var.c	8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: var.c,v 1.796 2021/02/03 14:33:09 rillig Exp $");
+MAKE_RCSID("$NetBSD: var.c,v 1.797 2021/02/03 15:08:17 rillig Exp $");
 
 typedef enum VarFlags {
 	VAR_NONE	= 0,
@@ -487,7 +489,7 @@ VarAdd(const char *name, const char *val
  * The variable name is kept as-is, it is not expanded.
  */
 void
-Var_DeleteVar(const char *varname, GNode *ctxt)
+Var_Delete(const char *varname, GNode *ctxt)
 {
 	HashEntry *he = HashTable_FindEntry(&ctxt->vars, varname);
 	Var *v;
@@ -514,7 +516,7 @@ Var_DeleteVar(const char *varname, GNode
  * The variable name is expanded once.
  */
 void
-Var_Delete(const char *name, GNode *ctxt)
+Var_DeleteExpand(const char *name, GNode *ctxt)
 {
 	FStr varname = FStr_InitRefer(name);
 
@@ -526,7 +528,7 @@ Var_Delete(const char *name, GNode *ctxt
 		varname = FStr_InitOwn(expanded);
 	}
 
-	Var_DeleteVar(varname.str, ctxt);
+	Var_Delete(varname.str, ctxt);
 	FStr_Done(&varname);
 }
 
@@ -561,7 +563,7 @@ Var_Undef(const char *arg)
 
 	for (i = 0; i < varnames.len; i++) {
 		const char *varname = varnames.words[i];
-		Var_DeleteVar(varname, VAR_GLOBAL);
+		Var_Delete(varname, VAR_GLOBAL);
 	}
 
 	Words_Free(varnames);
@@ -952,7 +954,7 @@ SetVar(const char *name, const char *val
 			 * needed. Otherwise -V name may show the wrong value.
 			 */
 			/* XXX: name is expanded for the second time */
-			Var_Delete(name, VAR_GLOBAL);
+			Var_DeleteExpand(name, VAR_GLOBAL);
 		}
 		VarAdd(name, val, ctxt, flags);
 	} else {
@@ -2361,7 +2363,7 @@ ApplyModifier_Loop(const char **pp, cons
 	ModifyWords(val, ModifyWord_Loop, &args, st->oneBigWord, st->sep));
 	st->sep = prev_sep;
 	/* XXX: Consider restoring the previous variable instead of deleting. */
-	Var_Delete(args.tvar, st->ctxt);
+	Var_DeleteExpand(args.tvar, st->ctxt);
 	free(args.tvar);
 	free(args.str

CVS commit: src/sys/dev/pci

2021-02-03 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Wed Feb  3 14:44:32 UTC 2021

Modified Files:
src/sys/dev/pci: cs4280.c cs4281.c cs428x.h

Log Message:
Remove code no longer used.
The code that used sc->{halt_input,halt_output} function pointer
was removed in 2004. (see cs428x.c rev 1.7)


To generate a diff of this commit:
cvs rdiff -u -r1.72 -r1.73 src/sys/dev/pci/cs4280.c
cvs rdiff -u -r1.56 -r1.57 src/sys/dev/pci/cs4281.c
cvs rdiff -u -r1.17 -r1.18 src/sys/dev/pci/cs428x.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/cs4280.c
diff -u src/sys/dev/pci/cs4280.c:1.72 src/sys/dev/pci/cs4280.c:1.73
--- src/sys/dev/pci/cs4280.c:1.72	Wed May  8 13:40:18 2019
+++ src/sys/dev/pci/cs4280.c	Wed Feb  3 14:44:32 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: cs4280.c,v 1.72 2019/05/08 13:40:18 isaki Exp $	*/
+/*	$NetBSD: cs4280.c,v 1.73 2021/02/03 14:44:32 isaki Exp $	*/
 
 /*
  * Copyright (c) 1999, 2000 Tatoku Ogaito.  All rights reserved.
@@ -52,7 +52,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cs4280.c,v 1.72 2019/05/08 13:40:18 isaki Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cs4280.c,v 1.73 2021/02/03 14:44:32 isaki Exp $");
 
 #include "midi.h"
 
@@ -346,8 +346,6 @@ cs4280_attach(device_t parent, device_t 
 	}
 
 	sc->type = TYPE_CS4280;
-	sc->halt_input  = cs4280_halt_input;
-	sc->halt_output = cs4280_halt_output;
 
 	/* setup buffer related parameters */
 	sc->dma_size = CS4280_DCHUNK;

Index: src/sys/dev/pci/cs4281.c
diff -u src/sys/dev/pci/cs4281.c:1.56 src/sys/dev/pci/cs4281.c:1.57
--- src/sys/dev/pci/cs4281.c:1.56	Fri May  8 13:52:40 2020
+++ src/sys/dev/pci/cs4281.c	Wed Feb  3 14:44:32 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: cs4281.c,v 1.56 2020/05/08 13:52:40 simonb Exp $	*/
+/*	$NetBSD: cs4281.c,v 1.57 2021/02/03 14:44:32 isaki Exp $	*/
 
 /*
  * Copyright (c) 2000 Tatoku Ogaito.  All rights reserved.
@@ -43,7 +43,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cs4281.c,v 1.56 2020/05/08 13:52:40 simonb Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cs4281.c,v 1.57 2021/02/03 14:44:32 isaki Exp $");
 
 #include 
 #include 
@@ -272,8 +272,6 @@ cs4281_attach(device_t parent, device_t 
 	}
 
 	sc->type = TYPE_CS4281;
-	sc->halt_input  = cs4281_halt_input;
-	sc->halt_output = cs4281_halt_output;
 
 	sc->dma_size = CS4281_BUFFER_SIZE / MAX_CHANNELS;
 	sc->dma_align= 0x10;

Index: src/sys/dev/pci/cs428x.h
diff -u src/sys/dev/pci/cs428x.h:1.17 src/sys/dev/pci/cs428x.h:1.18
--- src/sys/dev/pci/cs428x.h:1.17	Wed May  8 13:40:18 2019
+++ src/sys/dev/pci/cs428x.h	Wed Feb  3 14:44:32 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: cs428x.h,v 1.17 2019/05/08 13:40:18 isaki Exp $	*/
+/*	$NetBSD: cs428x.h,v 1.18 2021/02/03 14:44:32 isaki Exp $	*/
 
 /*
  * Copyright (c) 2000 Tatoku Ogaito.  All rights reserved.
@@ -106,7 +106,6 @@ struct cs428x_softc {
 	int	sc_pi;
 	struct	cs428x_dma *sc_pdma;
 	char	*sc_pbuf;
-	int	(*halt_output)(void *);
 	char	sc_prun;		/* playback status */
 	int	sc_prate;		/* playback sample rate */
 
@@ -118,7 +117,6 @@ struct cs428x_softc {
 	int	sc_ri;
 	struct	cs428x_dma *sc_rdma;
 	char	*sc_rbuf;
-	int	(*halt_input)(void *);
 	char	sc_rrun;		/* recording status */
 	int	sc_rrate;		/* recording sample rate */
 



CVS commit: src/usr.bin/make

2021-02-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Wed Feb  3 14:33:09 UTC 2021

Modified Files:
src/usr.bin/make: nonints.h parse.c var.c

Log Message:
make: split Var_Exists into plain Var_Exists and Var_ExistsExpand

Most previous calls to Var_Exists use constant variable names.  Only the
two calls in parse.c need to expand the variable name.

It may be a good idea to expand the variable name once in VarAssign_Eval
instead of repeating the expansion in each of its special cases.

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.194 -r1.195 src/usr.bin/make/nonints.h
cvs rdiff -u -r1.542 -r1.543 src/usr.bin/make/parse.c
cvs rdiff -u -r1.795 -r1.796 src/usr.bin/make/var.c

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

Modified files:

Index: src/usr.bin/make/nonints.h
diff -u src/usr.bin/make/nonints.h:1.194 src/usr.bin/make/nonints.h:1.195
--- src/usr.bin/make/nonints.h:1.194	Wed Feb  3 13:53:12 2021
+++ src/usr.bin/make/nonints.h	Wed Feb  3 14:33:09 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: nonints.h,v 1.194 2021/02/03 13:53:12 rillig Exp $	*/
+/*	$NetBSD: nonints.h,v 1.195 2021/02/03 14:33:09 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -379,6 +379,7 @@ void Var_Append(const char *, const char
 void Var_AppendExpand(const char *, const char *, GNode *);
 void Global_Append(const char *, const char *);
 Boolean Var_Exists(const char *, GNode *);
+Boolean Var_ExistsExpand(const char *, GNode *);
 FStr Var_Value(const char *, GNode *);
 const char *Var_ValueDirect(const char *, GNode *);
 VarParseResult Var_Parse(const char **, GNode *, VarEvalFlags, FStr *);

Index: src/usr.bin/make/parse.c
diff -u src/usr.bin/make/parse.c:1.542 src/usr.bin/make/parse.c:1.543
--- src/usr.bin/make/parse.c:1.542	Wed Feb  3 13:53:12 2021
+++ src/usr.bin/make/parse.c	Wed Feb  3 14:33:09 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: parse.c,v 1.542 2021/02/03 13:53:12 rillig Exp $	*/
+/*	$NetBSD: parse.c,v 1.543 2021/02/03 14:33:09 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -109,7 +109,7 @@
 #include "pathnames.h"
 
 /*	"@(#)parse.c	8.3 (Berkeley) 3/19/94"	*/
-MAKE_RCSID("$NetBSD: parse.c,v 1.542 2021/02/03 13:53:12 rillig Exp $");
+MAKE_RCSID("$NetBSD: parse.c,v 1.543 2021/02/03 14:33:09 rillig Exp $");
 
 /* types and constants */
 
@@ -1897,7 +1897,7 @@ VarAssign_EvalSubst(const char *name, co
 	 * TODO: Add a test that demonstrates why this code is needed,
 	 *  apart from making the debug log longer.
 	 */
-	if (!Var_Exists(name, ctxt))
+	if (!Var_ExistsExpand(name, ctxt))
 		Var_Set(name, "", ctxt);
 
 	(void)Var_Subst(uvalue, ctxt,
@@ -1960,7 +1960,7 @@ VarAssign_Eval(const char *name, VarAssi
 	else if (op == VAR_SHELL)
 		VarAssign_EvalShell(name, uvalue, ctxt, &avalue);
 	else {
-		if (op == VAR_DEFAULT && Var_Exists(name, ctxt))
+		if (op == VAR_DEFAULT && Var_ExistsExpand(name, ctxt))
 			return FALSE;
 
 		/* Normal assignment -- just do it. */

Index: src/usr.bin/make/var.c
diff -u src/usr.bin/make/var.c:1.795 src/usr.bin/make/var.c:1.796
--- src/usr.bin/make/var.c:1.795	Wed Feb  3 13:53:12 2021
+++ src/usr.bin/make/var.c	Wed Feb  3 14:33:09 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: var.c,v 1.795 2021/02/03 13:53:12 rillig Exp $	*/
+/*	$NetBSD: var.c,v 1.796 2021/02/03 14:33:09 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -89,7 +89,9 @@
  *			necessary. A space is placed between the old value and
  *			the new one.
  *
- *	Var_Exists	See if a variable exists.
+ *	Var_Exists
+ *	Var_ExistsExpand
+ *			See if a variable exists.
  *
  *	Var_Value	Return the unexpanded value of a variable, or NULL if
  *			the variable is undefined.
@@ -133,7 +135,7 @@
 #include "metachar.h"
 
 /*	"@(#)var.c	8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: var.c,v 1.795 2021/02/03 13:53:12 rillig Exp $");
+MAKE_RCSID("$NetBSD: var.c,v 1.796 2021/02/03 14:33:09 rillig Exp $");
 
 typedef enum VarFlags {
 	VAR_NONE	= 0,
@@ -1146,6 +1148,17 @@ Global_Append(const char *name, const ch
 	Var_Append(name, value, VAR_GLOBAL);
 }
 
+Boolean
+Var_Exists(const char *name, GNode *ctxt)
+{
+	Var *v = VarFind(name, ctxt, TRUE);
+	if (v == NULL)
+		return FALSE;
+
+	(void)VarFreeEnv(v, TRUE);
+	return TRUE;
+}
+
 /*
  * See if the given variable exists, in the given context or in other
  * fallback contexts.
@@ -1155,10 +1168,10 @@ Global_Append(const char *name, const ch
  *	ctxt		Context in which to start search
  */
 Boolean
-Var_Exists(const char *name, GNode *ctxt)
+Var_ExistsExpand(const char *name, GNode *ctxt)
 {
 	FStr varname = FStr_InitRefer(name);
-	Var *v;
+	Boolean exists;
 
 	if (strchr(varname.str, '$') != NULL) {
 		char *expanded;
@@ -1167,13 +1180,9 @@ Var_Exists(const char *name, GNode *ctxt
 		varname = FStr_InitOwn(expanded);
 	}
 
-	v = VarFind(varname.str, ctxt, TRUE);
+	exists = Var_Exists(varname.str, ctxt);
 	FStr_Done(&varname);
-	if (v == NULL)
-		return FALSE;
-
-	(void)Var

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

2021-02-03 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Wed Feb  3 14:22:21 UTC 2021

Modified Files:
src/sys/arch/arm/iomd: vidcaudio.c

Log Message:
Remove a comment no longer correct.
Because halt_output is no longer called from an interrupt context,
but that does not mean it's better to put this back to halt_output.


To generate a diff of this commit:
cvs rdiff -u -r1.60 -r1.61 src/sys/arch/arm/iomd/vidcaudio.c

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

Modified files:

Index: src/sys/arch/arm/iomd/vidcaudio.c
diff -u src/sys/arch/arm/iomd/vidcaudio.c:1.60 src/sys/arch/arm/iomd/vidcaudio.c:1.61
--- src/sys/arch/arm/iomd/vidcaudio.c:1.60	Sun Feb 23 04:02:45 2020
+++ src/sys/arch/arm/iomd/vidcaudio.c	Wed Feb  3 14:22:21 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: vidcaudio.c,v 1.60 2020/02/23 04:02:45 isaki Exp $	*/
+/*	$NetBSD: vidcaudio.c,v 1.61 2021/02/03 14:22:21 isaki Exp $	*/
 
 /*
  * Copyright (c) 1995 Melvin Tang-Richardson
@@ -65,7 +65,7 @@
 
 #include 	/* proc.h */
 
-__KERNEL_RCSID(0, "$NetBSD: vidcaudio.c,v 1.60 2020/02/23 04:02:45 isaki Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vidcaudio.c,v 1.61 2021/02/03 14:22:21 isaki Exp $");
 
 #include 
 #include/* autoconfig functions */
@@ -293,11 +293,6 @@ vidcaudio_close(void *addr)
 
 	DPRINTF(("DEBUG: vidcaudio_close called\n"));
 	sc = addr;
-	/*
-	 * We do this here rather than in vidcaudio_halt_output()
-	 * because the latter can be called from interrupt context
-	 * (audio_pint()->audio_clear()->vidcaudio_halt_output()).
-	 */
 	if (sc->sc_ppages != NULL) {
 		free(sc->sc_ppages, M_DEVBUF);
 		sc->sc_ppages = NULL;



CVS commit: src/usr.bin/make

2021-02-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Wed Feb  3 13:53:12 UTC 2021

Modified Files:
src/usr.bin/make: dir.c job.c main.c meta.c nonints.h parse.c targ.c
var.c

Log Message:
make: replace Global_AppendExpand with Global_Append

All callers with a variable name that is guaranteed to not contain a
dollar sign have been converted to call Global_Append instead of the
previous Global_AppendExpand.  After that, Global_AppendExpand was
unused, therefore it was effectively just renamed.


To generate a diff of this commit:
cvs rdiff -u -r1.266 -r1.267 src/usr.bin/make/dir.c
cvs rdiff -u -r1.414 -r1.415 src/usr.bin/make/job.c
cvs rdiff -u -r1.528 -r1.529 src/usr.bin/make/main.c
cvs rdiff -u -r1.172 -r1.173 src/usr.bin/make/meta.c
cvs rdiff -u -r1.193 -r1.194 src/usr.bin/make/nonints.h
cvs rdiff -u -r1.541 -r1.542 src/usr.bin/make/parse.c
cvs rdiff -u -r1.162 -r1.163 src/usr.bin/make/targ.c
cvs rdiff -u -r1.794 -r1.795 src/usr.bin/make/var.c

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

Modified files:

Index: src/usr.bin/make/dir.c
diff -u src/usr.bin/make/dir.c:1.266 src/usr.bin/make/dir.c:1.267
--- src/usr.bin/make/dir.c:1.266	Wed Feb  3 08:00:36 2021
+++ src/usr.bin/make/dir.c	Wed Feb  3 13:53:12 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: dir.c,v 1.266 2021/02/03 08:00:36 rillig Exp $	*/
+/*	$NetBSD: dir.c,v 1.267 2021/02/03 13:53:12 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -138,7 +138,7 @@
 #include "job.h"
 
 /*	"@(#)dir.c	8.2 (Berkeley) 1/2/94"	*/
-MAKE_RCSID("$NetBSD: dir.c,v 1.266 2021/02/03 08:00:36 rillig Exp $");
+MAKE_RCSID("$NetBSD: dir.c,v 1.267 2021/02/03 13:53:12 rillig Exp $");
 
 /*
  * A search path is a list of CachedDir structures. A CachedDir has in it the
@@ -555,15 +555,15 @@ Dir_SetPATH(void)
 		CachedDir *dir = ln->datum;
 		if (dir == dotLast) {
 			seenDotLast = TRUE;
-			Global_AppendExpand(".PATH", dotLast->name);
+			Global_Append(".PATH", dotLast->name);
 		}
 	}
 
 	if (!seenDotLast) {
 		if (dot != NULL)
-			Global_AppendExpand(".PATH", dot->name);
+			Global_Append(".PATH", dot->name);
 		if (cur != NULL)
-			Global_AppendExpand(".PATH", cur->name);
+			Global_Append(".PATH", cur->name);
 	}
 
 	for (ln = dirSearchPath.dirs.first; ln != NULL; ln = ln->next) {
@@ -572,14 +572,14 @@ Dir_SetPATH(void)
 			continue;
 		if (dir == dot && seenDotLast)
 			continue;
-		Global_AppendExpand(".PATH", dir->name);
+		Global_Append(".PATH", dir->name);
 	}
 
 	if (seenDotLast) {
 		if (dot != NULL)
-			Global_AppendExpand(".PATH", dot->name);
+			Global_Append(".PATH", dot->name);
 		if (cur != NULL)
-			Global_AppendExpand(".PATH", cur->name);
+			Global_Append(".PATH", cur->name);
 	}
 }
 

Index: src/usr.bin/make/job.c
diff -u src/usr.bin/make/job.c:1.414 src/usr.bin/make/job.c:1.415
--- src/usr.bin/make/job.c:1.414	Wed Feb  3 08:08:18 2021
+++ src/usr.bin/make/job.c	Wed Feb  3 13:53:12 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: job.c,v 1.414 2021/02/03 08:08:18 rillig Exp $	*/
+/*	$NetBSD: job.c,v 1.415 2021/02/03 13:53:12 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -142,7 +142,7 @@
 #include "trace.h"
 
 /*	"@(#)job.c	8.2 (Berkeley) 3/19/94"	*/
-MAKE_RCSID("$NetBSD: job.c,v 1.414 2021/02/03 08:08:18 rillig Exp $");
+MAKE_RCSID("$NetBSD: job.c,v 1.415 2021/02/03 13:53:12 rillig Exp $");
 
 /*
  * A shell defines how the commands are run.  All commands for a target are
@@ -2791,8 +2791,8 @@ Job_ServerStart(int max_tokens, int jp_0
 	snprintf(jobarg, sizeof jobarg, "%d,%d",
 	tokenWaitJob.inPipe, tokenWaitJob.outPipe);
 
-	Global_AppendExpand(MAKEFLAGS, "-J");
-	Global_AppendExpand(MAKEFLAGS, jobarg);
+	Global_Append(MAKEFLAGS, "-J");
+	Global_Append(MAKEFLAGS, jobarg);
 
 	/*
 	 * Preload the job pipe with one token per job, save the one

Index: src/usr.bin/make/main.c
diff -u src/usr.bin/make/main.c:1.528 src/usr.bin/make/main.c:1.529
--- src/usr.bin/make/main.c:1.528	Wed Feb  3 08:08:18 2021
+++ src/usr.bin/make/main.c	Wed Feb  3 13:53:12 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.528 2021/02/03 08:08:18 rillig Exp $	*/
+/*	$NetBSD: main.c,v 1.529 2021/02/03 13:53:12 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -111,7 +111,7 @@
 #include "trace.h"
 
 /*	"@(#)main.c	8.3 (Berkeley) 3/19/94"	*/
-MAKE_RCSID("$NetBSD: main.c,v 1.528 2021/02/03 08:08:18 rillig Exp $");
+MAKE_RCSID("$NetBSD: main.c,v 1.529 2021/02/03 13:53:12 rillig Exp $");
 #if defined(MAKE_NATIVE) && !defined(lint)
 __COPYRIGHT("@(#) Copyright (c) 1988, 1989, 1990, 1993 "
 	"The Regents of the University of California.  "
@@ -409,8 +409,8 @@ MainParseArgJobsInternal(const char *arg
 		jp_1 = -1;
 		opts.compatMake = TRUE;
 	} else {
-		Global_AppendExpand(MAKEFLAGS, "-J");
-		Global_AppendExpand(MAKEFLAGS, argvalue);
+		Global_Append(MAKEFLAGS, "-J");
+		Global_Append(MAKEFLAGS, argval

CVS commit: src/usr.bin/make

2021-02-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Wed Feb  3 13:44:39 UTC 2021

Modified Files:
src/usr.bin/make: nonints.h parse.c var.c

Log Message:
make: split Var_Append into Var_Append and Var_AppendExpand

The plain Var_Append now does not expand the variable name anymore.  It
is used in situations where the variable name is known to not contain a
dollar sign.

This is a preparation for adding Global_Append, corresponding to
Global_AppendExpand.


To generate a diff of this commit:
cvs rdiff -u -r1.192 -r1.193 src/usr.bin/make/nonints.h
cvs rdiff -u -r1.540 -r1.541 src/usr.bin/make/parse.c
cvs rdiff -u -r1.793 -r1.794 src/usr.bin/make/var.c

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

Modified files:

Index: src/usr.bin/make/nonints.h
diff -u src/usr.bin/make/nonints.h:1.192 src/usr.bin/make/nonints.h:1.193
--- src/usr.bin/make/nonints.h:1.192	Wed Feb  3 08:08:18 2021
+++ src/usr.bin/make/nonints.h	Wed Feb  3 13:44:39 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: nonints.h,v 1.192 2021/02/03 08:08:18 rillig Exp $	*/
+/*	$NetBSD: nonints.h,v 1.193 2021/02/03 13:44:39 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -376,6 +376,7 @@ void Global_SetExpand(const char *, cons
 void Var_Set(const char *, const char *, GNode *);
 void Var_SetWithFlags(const char *, const char *, GNode *, VarSetFlags);
 void Var_Append(const char *, const char *, GNode *);
+void Var_AppendExpand(const char *, const char *, GNode *);
 void Global_AppendExpand(const char *, const char *);
 Boolean Var_Exists(const char *, GNode *);
 FStr Var_Value(const char *, GNode *);

Index: src/usr.bin/make/parse.c
diff -u src/usr.bin/make/parse.c:1.540 src/usr.bin/make/parse.c:1.541
--- src/usr.bin/make/parse.c:1.540	Wed Feb  3 08:08:18 2021
+++ src/usr.bin/make/parse.c	Wed Feb  3 13:44:39 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: parse.c,v 1.540 2021/02/03 08:08:18 rillig Exp $	*/
+/*	$NetBSD: parse.c,v 1.541 2021/02/03 13:44:39 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -109,7 +109,7 @@
 #include "pathnames.h"
 
 /*	"@(#)parse.c	8.3 (Berkeley) 3/19/94"	*/
-MAKE_RCSID("$NetBSD: parse.c,v 1.540 2021/02/03 08:08:18 rillig Exp $");
+MAKE_RCSID("$NetBSD: parse.c,v 1.541 2021/02/03 13:44:39 rillig Exp $");
 
 /* types and constants */
 
@@ -1954,7 +1954,7 @@ VarAssign_Eval(const char *name, VarAssi
 	FStr avalue = FStr_InitRefer(uvalue);
 
 	if (op == VAR_APPEND)
-		Var_Append(name, uvalue, ctxt);
+		Var_AppendExpand(name, uvalue, ctxt);
 	else if (op == VAR_SUBST)
 		VarAssign_EvalSubst(name, uvalue, ctxt, &avalue);
 	else if (op == VAR_SHELL)

Index: src/usr.bin/make/var.c
diff -u src/usr.bin/make/var.c:1.793 src/usr.bin/make/var.c:1.794
--- src/usr.bin/make/var.c:1.793	Wed Feb  3 08:40:47 2021
+++ src/usr.bin/make/var.c	Wed Feb  3 13:44:39 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: var.c,v 1.793 2021/02/03 08:40:47 rillig Exp $	*/
+/*	$NetBSD: var.c,v 1.794 2021/02/03 13:44:39 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -83,7 +83,9 @@
  *	Var_Set		Set the value of the variable, creating it if
  *			necessary.
  *
- *	Var_Append	Append more characters to the variable, creating it if
+ *	Var_Append
+ *	Var_AppendExpand
+ *			Append more characters to the variable, creating it if
  *			necessary. A space is placed between the old value and
  *			the new one.
  *
@@ -131,7 +133,7 @@
 #include "metachar.h"
 
 /*	"@(#)var.c	8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: var.c,v 1.793 2021/02/03 08:40:47 rillig Exp $");
+MAKE_RCSID("$NetBSD: var.c,v 1.794 2021/02/03 13:44:39 rillig Exp $");
 
 typedef enum VarFlags {
 	VAR_NONE	= 0,
@@ -1050,6 +1052,48 @@ Global_SetExpand(const char *name, const
 }
 
 /*
+ * Append the value to the named variable.
+ *
+ * If the variable doesn't exist, it is created.  Otherwise a single space
+ * and the given value are appended.
+ */
+void
+Var_Append(const char *name, const char *val, GNode *ctxt)
+{
+	Var *v;
+
+	v = VarFind(name, ctxt, ctxt == VAR_GLOBAL);
+
+	if (v == NULL) {
+		SetVar(name, val, ctxt, VAR_SET_NONE);
+	} else if (v->flags & VAR_READONLY) {
+		DEBUG1(VAR, "Ignoring append to %s since it is read-only\n",
+		name);
+	} else if (ctxt == VAR_CMDLINE || !(v->flags & VAR_FROM_CMD)) {
+		Buf_AddByte(&v->val, ' ');
+		Buf_AddStr(&v->val, val);
+
+		DEBUG3(VAR, "%s:%s = %s\n", ctxt->name, name, v->val.data);
+
+		if (v->flags & VAR_FROM_ENV) {
+			/*
+			 * If the original variable came from the environment,
+			 * we have to install it in the global context (we
+			 * could place it in the environment, but then we
+			 * should provide a way to export other variables...)
+			 */
+			v->flags &= ~(unsigned)VAR_FROM_ENV;
+			/*
+			 * This is the only place where a variable is
+			 * created whose v->name is not the same as
+			 * ctxt->context->key.
+			 */
+			HashTable_Set(&ctxt->vars, name, v);
+		}
+	}
+}
+
+/*
  * The variable of the given name has the given value appended

CVS commit: src/sys/net

2021-02-03 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Wed Feb  3 12:11:34 UTC 2021

Modified Files:
src/sys/net: if_llc.h

Log Message:
if_llc.h: Replace __packed with CTASSERT


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/net/if_llc.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/net/if_llc.h
diff -u src/sys/net/if_llc.h:1.21 src/sys/net/if_llc.h:1.22
--- src/sys/net/if_llc.h:1.21	Fri Sep  5 05:32:07 2014
+++ src/sys/net/if_llc.h	Wed Feb  3 12:11:34 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_llc.h,v 1.21 2014/09/05 05:32:07 matt Exp $	*/
+/*	$NetBSD: if_llc.h,v 1.22 2021/02/03 12:11:34 roy Exp $	*/
 
 /*
  * Copyright (c) 1988, 1993
@@ -82,7 +82,7 @@ struct llc {
 		uint8_t control_ext;
 	} type_raw /* XXX __packed ??? */;
 	} llc_un /* XXX __packed ??? */;
-} __packed;
+};
 
 struct frmrinfo {
 	uint8_t frmr_rej_pdu0;
@@ -90,7 +90,12 @@ struct frmrinfo {
 	uint8_t frmr_control;
 	uint8_t frmr_control_ext;
 	uint8_t frmr_cause;
-} __packed;
+};
+
+#ifdef CTASSERT
+CTASSERT(sizeof(struct llc) == 8);
+CTASSERT(sizeof(struct frmrinfo) == 5);
+#endif
 
 #define	llc_control		llc_un.type_u.control
 #define	llc_control_ext		llc_un.type_raw.control_ext



CVS commit: src/sys

2021-02-03 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Wed Feb  3 11:53:43 UTC 2021

Modified Files:
src/sys/net: if_arp.h if_ether.h if_gre.h
src/sys/netinet: if_ether.h igmp.h in.h ip.h ip6.h ip_icmp.h
ip_mroute.h ip_var.h tcp.h tcp_var.h udp.h udp_var.h

Log Message:
Sprinkle CTASSERT to enforce on-wire layout without __packed


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/sys/net/if_arp.h
cvs rdiff -u -r1.82 -r1.83 src/sys/net/if_ether.h
cvs rdiff -u -r1.45 -r1.46 src/sys/net/if_gre.h
cvs rdiff -u -r1.35 -r1.36 src/sys/netinet/if_ether.h src/sys/netinet/tcp.h
cvs rdiff -u -r1.13 -r1.14 src/sys/netinet/igmp.h
cvs rdiff -u -r1.112 -r1.113 src/sys/netinet/in.h
cvs rdiff -u -r1.36 -r1.37 src/sys/netinet/ip.h
cvs rdiff -u -r1.27 -r1.28 src/sys/netinet/ip6.h
cvs rdiff -u -r1.41 -r1.42 src/sys/netinet/ip_icmp.h
cvs rdiff -u -r1.33 -r1.34 src/sys/netinet/ip_mroute.h
cvs rdiff -u -r1.131 -r1.132 src/sys/netinet/ip_var.h
cvs rdiff -u -r1.193 -r1.194 src/sys/netinet/tcp_var.h
cvs rdiff -u -r1.17 -r1.18 src/sys/netinet/udp.h
cvs rdiff -u -r1.47 -r1.48 src/sys/netinet/udp_var.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/net/if_arp.h
diff -u src/sys/net/if_arp.h:1.35 src/sys/net/if_arp.h:1.36
--- src/sys/net/if_arp.h:1.35	Wed Feb  3 10:31:10 2021
+++ src/sys/net/if_arp.h	Wed Feb  3 11:53:43 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_arp.h,v 1.35 2021/02/03 10:31:10 roy Exp $	*/
+/*	$NetBSD: if_arp.h,v 1.36 2021/02/03 11:53:43 roy Exp $	*/
 
 /*
  * Copyright (c) 1986, 1993
@@ -72,6 +72,9 @@ struct	arphdr {
 	uint8_t  ar_tpa[];	/* target protocol address */
 #endif
 };
+#ifdef CTASSERT
+CTASSERT(sizeof(struct arphdr) == 8);
+#endif
 
 static __inline uint8_t *
 ar_data(struct arphdr *ap)

Index: src/sys/net/if_ether.h
diff -u src/sys/net/if_ether.h:1.82 src/sys/net/if_ether.h:1.83
--- src/sys/net/if_ether.h:1.82	Wed Feb  3 05:51:40 2021
+++ src/sys/net/if_ether.h	Wed Feb  3 11:53:43 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_ether.h,v 1.82 2021/02/03 05:51:40 roy Exp $	*/
+/*	$NetBSD: if_ether.h,v 1.83 2021/02/03 11:53:43 roy Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1993
@@ -90,6 +90,11 @@ struct ether_header {
 	uint16_t ether_type;
 };
 
+#ifdef CTASSERT
+CTASSERT(sizeof(struct ether_addr) == 6);
+CTASSERT(sizeof(struct ether_header) == 14);
+#endif
+
 #include 
 
 #define	ETHER_IS_MULTICAST(addr) (*(addr) & 0x01) /* is address mcast/bcast? */

Index: src/sys/net/if_gre.h
diff -u src/sys/net/if_gre.h:1.45 src/sys/net/if_gre.h:1.46
--- src/sys/net/if_gre.h:1.45	Wed Feb  3 05:51:40 2021
+++ src/sys/net/if_gre.h	Wed Feb  3 11:53:43 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_gre.h,v 1.45 2021/02/03 05:51:40 roy Exp $ */
+/*	$NetBSD: if_gre.h,v 1.46 2021/02/03 11:53:43 roy Exp $ */
 
 /*
  * Copyright (c) 1998, 2008 The NetBSD Foundation, Inc.
@@ -131,6 +131,9 @@ struct gre_h {
 Present if (rt_pres == 1)
  */
 };
+#ifdef CTASSERT
+CTASSERT(sizeof(struct gre_h) == 4);
+#endif
 
 #define GRE_CP		0x8000  /* Checksum Present */
 #define GRE_RP		0x4000  /* Routing Present */

Index: src/sys/netinet/if_ether.h
diff -u src/sys/netinet/if_ether.h:1.35 src/sys/netinet/if_ether.h:1.36
--- src/sys/netinet/if_ether.h:1.35	Wed Feb  3 05:51:40 2021
+++ src/sys/netinet/if_ether.h	Wed Feb  3 11:53:43 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_ether.h,v 1.35 2021/02/03 05:51:40 roy Exp $	*/
+/*	$NetBSD: if_ether.h,v 1.36 2021/02/03 11:53:43 roy Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1993
@@ -76,6 +76,7 @@ struct	ether_arp {
 	u_int8_t arp_tha[ETHER_ADDR_LEN];	/* target hardware address */
 	u_int8_t arp_tpa[4];			/* target protocol address */
 };
+CTASSERT(sizeof(struct ether_arp) == 28);
 #define	arp_hrd	ea_hdr.ar_hrd
 #define	arp_pro	ea_hdr.ar_pro
 #define	arp_hln	ea_hdr.ar_hln
Index: src/sys/netinet/tcp.h
diff -u src/sys/netinet/tcp.h:1.35 src/sys/netinet/tcp.h:1.36
--- src/sys/netinet/tcp.h:1.35	Wed Feb  3 05:51:40 2021
+++ src/sys/netinet/tcp.h	Wed Feb  3 11:53:43 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: tcp.h,v 1.35 2021/02/03 05:51:40 roy Exp $	*/
+/*	$NetBSD: tcp.h,v 1.36 2021/02/03 11:53:43 roy Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1993
@@ -73,6 +73,9 @@ struct tcphdr {
 	uint16_t th_sum;			/* checksum */
 	uint16_t th_urp;			/* urgent pointer */
 };
+#ifdef CTASSERT
+CTASSERT(sizeof(struct tcphdr) == 20);
+#endif
 
 #define	TCPOPT_EOL		0
 #define	   TCPOLEN_EOL			1

Index: src/sys/netinet/igmp.h
diff -u src/sys/netinet/igmp.h:1.13 src/sys/netinet/igmp.h:1.14
--- src/sys/netinet/igmp.h:1.13	Wed Feb  3 05:51:40 2021
+++ src/sys/netinet/igmp.h	Wed Feb  3 11:53:43 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: igmp.h,v 1.13 2021/02/03 05:51:40 roy Exp $	*/
+/*	$NetBSD: igmp.h,v 1.14 2021/02/03 11:53:43 roy Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -89,6 +89,9 @@ struct igmp {
 	uint16_t	igmp_cksum;	/* IP-style checksum   */
 	struct in_addr	igmp_group;	/* group address being reported

CVS commit: src/sys/netinet

2021-02-03 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Wed Feb  3 11:52:23 UTC 2021

Modified Files:
src/sys/netinet: tcp_debug.h

Log Message:
tcp_debug: restore __packed


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/netinet/tcp_debug.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/netinet/tcp_debug.h
diff -u src/sys/netinet/tcp_debug.h:1.19 src/sys/netinet/tcp_debug.h:1.20
--- src/sys/netinet/tcp_debug.h:1.19	Wed Feb  3 05:51:40 2021
+++ src/sys/netinet/tcp_debug.h	Wed Feb  3 11:52:23 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: tcp_debug.h,v 1.19 2021/02/03 05:51:40 roy Exp $	*/
+/*	$NetBSD: tcp_debug.h,v 1.20 2021/02/03 11:52:23 roy Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1993
@@ -58,7 +58,7 @@ struct	tcp_debug {
 	} td_ti6;
 	short	td_req;
 	struct	tcpcb td_cb;
-};
+} __packed;
 
 #define	TA_INPUT	0
 #define	TA_OUTPUT	1



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

2021-02-03 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Wed Feb  3 10:37:05 UTC 2021

Modified Files:
src/sys/arch/powerpc/include: cpu.h

Log Message:
Pull out constant definitions inside struct declaration.

Enable CTASSERT(9) for CPUSAVE_SIZE.


To generate a diff of this commit:
cvs rdiff -u -r1.115 -r1.116 src/sys/arch/powerpc/include/cpu.h

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

Modified files:

Index: src/sys/arch/powerpc/include/cpu.h
diff -u src/sys/arch/powerpc/include/cpu.h:1.115 src/sys/arch/powerpc/include/cpu.h:1.116
--- src/sys/arch/powerpc/include/cpu.h:1.115	Wed Jul 15 08:58:51 2020
+++ src/sys/arch/powerpc/include/cpu.h	Wed Feb  3 10:37:05 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.h,v 1.115 2020/07/15 08:58:51 rin Exp $	*/
+/*	$NetBSD: cpu.h,v 1.116 2021/02/03 10:37:05 rin Exp $	*/
 
 /*
  * Copyright (C) 1999 Wolfgang Solfrank.
@@ -60,6 +60,31 @@ struct cache_info {
 
 #include 
 
+#ifdef _KERNEL
+#define	CI_SAVETEMP	(0*CPUSAVE_LEN)
+#define	CI_SAVEDDB	(1*CPUSAVE_LEN)
+#define	CI_SAVEIPKDB	(2*CPUSAVE_LEN)	/* obsolete */
+#define	CI_SAVEMMU	(3*CPUSAVE_LEN)
+#define	CI_SAVEMAX	(4*CPUSAVE_LEN)
+#define	CPUSAVE_LEN	8
+#if defined(PPC_BOOKE) && !defined(MODULAR) && !defined(_MODULE)
+#define	CPUSAVE_SIZE	128
+#else
+#define	CPUSAVE_SIZE	(CI_SAVEMAX*CPUSAVE_LEN)
+CTASSERT(CPUSAVE_SIZE >= 128);
+#endif
+#define	CPUSAVE_R28	0		/* where r28 gets saved */
+#define	CPUSAVE_R29	1		/* where r29 gets saved */
+#define	CPUSAVE_R30	2		/* where r30 gets saved */
+#define	CPUSAVE_R31	3		/* where r31 gets saved */
+#define	CPUSAVE_DEAR	4		/* where IBM4XX SPR_DEAR gets saved */
+#define	CPUSAVE_DAR	4		/* where OEA SPR_DAR gets saved */
+#define	CPUSAVE_ESR	5		/* where IBM4XX SPR_ESR gets saved */
+#define	CPUSAVE_DSISR	5		/* where OEA SPR_DSISR gets saved */
+#define	CPUSAVE_SRR0	6		/* where SRR0 gets saved */
+#define	CPUSAVE_SRR1	7		/* where SRR1 gets saved */
+#endif /* _KERNEL */
+
 struct cpu_info {
 	struct cpu_data ci_data;	/* MI per-cpu data */
 #ifdef _KERNEL
@@ -92,28 +117,7 @@ struct cpu_info {
 #if defined(PPC_IBM4XX) || defined(MODULAR) || defined(_MODULE)
 	char *ci_intstk;
 #endif
-#define	CI_SAVETEMP	(0*CPUSAVE_LEN)
-#define	CI_SAVEDDB	(1*CPUSAVE_LEN)
-#define	CI_SAVEIPKDB	(2*CPUSAVE_LEN)	/* obsolete */
-#define	CI_SAVEMMU	(3*CPUSAVE_LEN)
-#define	CI_SAVEMAX	(4*CPUSAVE_LEN)
-#define	CPUSAVE_LEN	8
-#if defined(PPC_BOOKE) && !defined(MODULAR) && !defined(_MODULE)
-#define	CPUSAVE_SIZE	128
-#else
-#define	CPUSAVE_SIZE	(CI_SAVEMAX*CPUSAVE_LEN)
-// XXX CTASSERT(CPUSAVE_SIZE >= 128);
-#endif
-#define	CPUSAVE_R28	0		/* where r28 gets saved */
-#define	CPUSAVE_R29	1		/* where r29 gets saved */
-#define	CPUSAVE_R30	2		/* where r30 gets saved */
-#define	CPUSAVE_R31	3		/* where r31 gets saved */
-#define	CPUSAVE_DEAR	4		/* where IBM4XX SPR_DEAR gets saved */
-#define	CPUSAVE_DAR	4		/* where OEA SPR_DAR gets saved */
-#define	CPUSAVE_ESR	5		/* where IBM4XX SPR_ESR gets saved */
-#define	CPUSAVE_DSISR	5		/* where OEA SPR_DSISR gets saved */
-#define	CPUSAVE_SRR0	6		/* where SRR0 gets saved */
-#define	CPUSAVE_SRR1	7		/* where SRR1 gets saved */
+
 	register_t ci_savearea[CPUSAVE_SIZE];
 #if defined(PPC_BOOKE) || defined(MODULAR) || defined(_MODULE)
 	uint32_t ci_pmap_asid_cur;



CVS commit: src/sys/net

2021-02-03 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Wed Feb  3 10:31:10 UTC 2021

Modified Files:
src/sys/net: if_arp.h

Log Message:
Whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sys/net/if_arp.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/net/if_arp.h
diff -u src/sys/net/if_arp.h:1.34 src/sys/net/if_arp.h:1.35
--- src/sys/net/if_arp.h:1.34	Wed Feb  3 05:51:40 2021
+++ src/sys/net/if_arp.h	Wed Feb  3 10:31:10 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_arp.h,v 1.34 2021/02/03 05:51:40 roy Exp $	*/
+/*	$NetBSD: if_arp.h,v 1.35 2021/02/03 10:31:10 roy Exp $	*/
 
 /*
  * Copyright (c) 1986, 1993
@@ -45,22 +45,22 @@
  */
 struct	arphdr {
 	uint16_t ar_hrd;	/* format of hardware address */
-#define ARPHRD_ETHER 	1	/* ethernet hardware format */
-#define ARPHRD_IEEE802 	6	/* IEEE 802 hardware format */
-#define ARPHRD_ARCNET 	7	/* ethernet hardware format */
-#define ARPHRD_FRELAY 	15	/* frame relay hardware format */
-#define ARPHRD_STRIP 	23	/* Ricochet Starmode Radio hardware format */
-#define	ARPHRD_IEEE1394	24	/* IEEE 1394 (FireWire) hardware format */
-	uint16_t ar_pro;	/* format of protocol address */
-	uint8_t  ar_hln;	/* length of hardware address */
-	uint8_t  ar_pln;	/* length of protocol address */
-	uint16_t ar_op;		/* one of: */
-#define	ARPOP_REQUEST	1	/* request to resolve address */
-#define	ARPOP_REPLY	2	/* response to previous request */
-#define	ARPOP_REVREQUEST 3	/* request protocol address given hardware */
-#define	ARPOP_REVREPLY	4	/* response giving protocol address */
-#define	ARPOP_INVREQUEST 8 	/* request to identify peer */
-#define	ARPOP_INVREPLY	9	/* response identifying peer */
+#define ARPHRD_ETHER		1  /* ethernet hardware format */
+#define ARPHRD_IEEE802		6  /* IEEE 802 hardware format */
+#define ARPHRD_ARCNET		7  /* ethernet hardware format */
+#define ARPHRD_FRELAY		15 /* frame relay hardware format */
+#define ARPHRD_STRIP		23 /* Ricochet Starmode Radio hardware format */
+#define	ARPHRD_IEEE1394		24 /* IEEE 1394 (FireWire) hardware format */
+	uint16_t ar_pro;	   /* format of protocol address */
+	uint8_t  ar_hln;	   /* length of hardware address */
+	uint8_t  ar_pln;	   /* length of protocol address */
+	uint16_t ar_op;		   /* one of: */
+#define	ARPOP_REQUEST		1  /* request to resolve address */
+#define	ARPOP_REPLY		2  /* response to previous request */
+#define	ARPOP_REVREQUEST	3  /* request protocol address given hardware */
+#define	ARPOP_REVREPLY		4  /* response giving protocol address */
+#define	ARPOP_INVREQUEST	8  /* request to identify peer */
+#define	ARPOP_INVREPLY		9  /* response identifying peer */
 /*
  * The remaining fields are variable in size,
  * according to the sizes above.



CVS commit: src/usr.bin/make

2021-02-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Wed Feb  3 08:40:47 UTC 2021

Modified Files:
src/usr.bin/make: var.c
src/usr.bin/make/unit-tests: var-op-append.exp var-op-append.mk
varname-empty.exp

Log Message:
make: fix double expansion when appending to a new variable


To generate a diff of this commit:
cvs rdiff -u -r1.792 -r1.793 src/usr.bin/make/var.c
cvs rdiff -u -r1.3 -r1.4 src/usr.bin/make/unit-tests/var-op-append.exp
cvs rdiff -u -r1.7 -r1.8 src/usr.bin/make/unit-tests/var-op-append.mk
cvs rdiff -u -r1.6 -r1.7 src/usr.bin/make/unit-tests/varname-empty.exp

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/var.c
diff -u src/usr.bin/make/var.c:1.792 src/usr.bin/make/var.c:1.793
--- src/usr.bin/make/var.c:1.792	Wed Feb  3 08:08:18 2021
+++ src/usr.bin/make/var.c	Wed Feb  3 08:40:47 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: var.c,v 1.792 2021/02/03 08:08:18 rillig Exp $	*/
+/*	$NetBSD: var.c,v 1.793 2021/02/03 08:40:47 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -131,7 +131,7 @@
 #include "metachar.h"
 
 /*	"@(#)var.c	8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: var.c,v 1.792 2021/02/03 08:08:18 rillig Exp $");
+MAKE_RCSID("$NetBSD: var.c,v 1.793 2021/02/03 08:40:47 rillig Exp $");
 
 typedef enum VarFlags {
 	VAR_NONE	= 0,
@@ -916,6 +916,12 @@ SetVar(const char *name, const char *val
 {
 	Var *v;
 
+	assert(val != NULL);
+	if (name[0] == '\0') {
+		DEBUG0(VAR, "SetVar: variable name is empty - ignored\n");
+		return;
+	}
+
 	if (ctxt == VAR_GLOBAL) {
 		v = VarFind(name, VAR_CMDLINE, FALSE);
 		if (v != NULL) {
@@ -1034,12 +1040,7 @@ Var_Set(const char *name, const char *va
 void
 Global_Set(const char *name, const char *value)
 {
-	assert(value != NULL);
-
-	if (name[0] == '\0')
-		DEBUG0(VAR, "Variable name empty - ignored\n");
-	else
-		SetVar(name, value, VAR_GLOBAL, VAR_SET_NONE);
+	SetVar(name, value, VAR_GLOBAL, VAR_SET_NONE);
 }
 
 void
@@ -1093,8 +1094,7 @@ Var_Append(const char *name, const char 
 	v = VarFind(name, ctxt, ctxt == VAR_GLOBAL);
 
 	if (v == NULL) {
-		/* XXX: name is expanded for the second time */
-		Var_Set(name, val, ctxt);
+		SetVar(name, val, ctxt, VAR_SET_NONE);
 	} else if (v->flags & VAR_READONLY) {
 		DEBUG1(VAR, "Ignoring append to %s since it is read-only\n",
 		name);

Index: src/usr.bin/make/unit-tests/var-op-append.exp
diff -u src/usr.bin/make/unit-tests/var-op-append.exp:1.3 src/usr.bin/make/unit-tests/var-op-append.exp:1.4
--- src/usr.bin/make/unit-tests/var-op-append.exp:1.3	Tue Feb  2 16:18:16 2021
+++ src/usr.bin/make/unit-tests/var-op-append.exp	Wed Feb  3 08:40:47 2021
@@ -1,7 +1,7 @@
 Var_Parse: ${:U\$\$\$\$\$\$\$\$} with VARE_WANTRES
 Applying ${:U...} to "" (VARE_WANTRES, none, VES_UNDEF)
 Result of ${:U\$\$\$\$\$\$\$\$} is "" (VARE_WANTRES, none, VES_DEF)
-Global:VAR. = dollars
+Global:VAR. = dollars
 Global:.MAKEFLAGS =  -r -k -d v -d
 Global:.MAKEFLAGS =  -r -k -d v -d 0
 exit status 0

Index: src/usr.bin/make/unit-tests/var-op-append.mk
diff -u src/usr.bin/make/unit-tests/var-op-append.mk:1.7 src/usr.bin/make/unit-tests/var-op-append.mk:1.8
--- src/usr.bin/make/unit-tests/var-op-append.mk:1.7	Fri Oct 30 20:36:33 2020
+++ src/usr.bin/make/unit-tests/var-op-append.mk	Wed Feb  3 08:40:47 2021
@@ -1,4 +1,4 @@
-# $NetBSD: var-op-append.mk,v 1.7 2020/10/30 20:36:33 rillig Exp $
+# $NetBSD: var-op-append.mk,v 1.8 2021/02/03 08:40:47 rillig Exp $
 #
 # Tests for the += variable assignment operator, which appends to a variable,
 # creating it if necessary.
@@ -32,17 +32,15 @@ C++=	value
 .  error
 .endif
 
-# Try out how often the variable name is expanded when appending to a
-# nonexistent variable.
-# As of 2020-10-30, that's two times.
-# XXX: That's one time too often.
-# See Var_Append, the call to Var_Set.
+# Before var.c 1.793 from 2021-02-03, the variable name of a newly created
+# variable was expanded two times in a row, which was unexpected but
+# irrelevant in practice since variable names containing dollars lead to
+# strange side effects in several other places as well.
 .MAKEFLAGS: -dv
 VAR.${:U\$\$\$\$\$\$\$\$}+=	dollars
 .MAKEFLAGS: -d0
-.if ${VAR.${:U\$\$\$\$}} != "dollars"
+.if ${VAR.${:U\$\$\$\$\$\$\$\$}} != "dollars"
 .  error
 .endif
 
 all:
-	@:;

Index: src/usr.bin/make/unit-tests/varname-empty.exp
diff -u src/usr.bin/make/unit-tests/varname-empty.exp:1.6 src/usr.bin/make/unit-tests/varname-empty.exp:1.7
--- src/usr.bin/make/unit-tests/varname-empty.exp:1.6	Wed Feb  3 08:34:15 2021
+++ src/usr.bin/make/unit-tests/varname-empty.exp	Wed Feb  3 08:40:47 2021
@@ -20,7 +20,7 @@ Global:delete .INCLUDEDFROMDIR (not foun
 Global:delete .INCLUDEDFROMFILE (not found)
 Var_Set("", "default", ...) name expands to empty string - ignored
 Var_Set("", "assigned", ...) name expands to empty string - ignored
-Var_Set("", "appended", ...) name expands to empty string

CVS commit: src/usr.bin/make/unit-tests

2021-02-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Wed Feb  3 08:34:15 UTC 2021

Modified Files:
src/usr.bin/make/unit-tests: Makefile varname-empty.exp
varname-empty.mk

Log Message:
make: in the test varname-empty, keep more debug output

Filtering out the interesting lines based on the very specific pattern
"Var_Set" was surprising.


To generate a diff of this commit:
cvs rdiff -u -r1.266 -r1.267 src/usr.bin/make/unit-tests/Makefile
cvs rdiff -u -r1.5 -r1.6 src/usr.bin/make/unit-tests/varname-empty.exp
cvs rdiff -u -r1.7 -r1.8 src/usr.bin/make/unit-tests/varname-empty.mk

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/unit-tests/Makefile
diff -u src/usr.bin/make/unit-tests/Makefile:1.266 src/usr.bin/make/unit-tests/Makefile:1.267
--- src/usr.bin/make/unit-tests/Makefile:1.266	Tue Feb  2 17:27:35 2021
+++ src/usr.bin/make/unit-tests/Makefile	Wed Feb  3 08:34:15 2021
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.266 2021/02/02 17:27:35 rillig Exp $
+# $NetBSD: Makefile,v 1.267 2021/02/03 08:34:15 rillig Exp $
 #
 # Unit tests for make(1)
 #
@@ -519,11 +519,12 @@ SED_CMDS.varname-dot-parsefile=	-e '/in 
 SED_CMDS.varname-dot-shell=	-e 's, = /[^ ]*, = (details omitted),g'
 SED_CMDS.varname-dot-shell+=	-e 's,"/[^" ]*","(details omitted)",g'
 SED_CMDS.varname-dot-shell+=	-e 's,\[/[^] ]*\],[(details omitted)],g'
+SED_CMDS.varname-empty=		-e 's,${.CURDIR},,g'
+SED_CMDS.varname-empty+=	-e '/\.SHELL/d'
 
 # Some tests need an additional round of postprocessing.
 POSTPROC.deptgt-suffixes=	awk '/^\#\*\*\* Suffixes/,/^never-stop/'
 POSTPROC.gnode-submake=		awk '/Input graph/, /^$$/'
-POSTPROC.varname-empty=		${TOOL_SED} -n -e '/^Var_Set/p' -e '/^out:/p'
 
 # Some tests reuse other tests, which makes them unnecessarily fragile.
 export-all.rawout: export.mk

Index: src/usr.bin/make/unit-tests/varname-empty.exp
diff -u src/usr.bin/make/unit-tests/varname-empty.exp:1.5 src/usr.bin/make/unit-tests/varname-empty.exp:1.6
--- src/usr.bin/make/unit-tests/varname-empty.exp:1.5	Sun Nov 15 20:50:46 2020
+++ src/usr.bin/make/unit-tests/varname-empty.exp	Wed Feb  3 08:34:15 2021
@@ -1,13 +1,48 @@
+Var_Parse: ${:U} with VARE_WANTRES
+Applying ${:U} to "" (VARE_WANTRES, none, VES_UNDEF)
+Result of ${:U} is "" (VARE_WANTRES, none, VES_DEF)
 Var_Set("${:U}", "cmdline-u", ...) name expands to empty string - ignored
 Var_Set("", "cmdline-plain", ...) name expands to empty string - ignored
+Global:.CURDIR = 
+Var_Parse: ${MAKE_OBJDIR_CHECK_WRITABLE:U} with VARE_WANTRES
+Applying ${MAKE_OBJDIR_CHECK_WRITABLE:U} to "" (VARE_WANTRES, none, VES_UNDEF)
+Result of ${MAKE_OBJDIR_CHECK_WRITABLE:U} is "" (VARE_WANTRES, none, VES_DEF)
+Global:.OBJDIR = 
+Global:delete .PATH (not found)
+Global:.PATH = .
+Global:.PATH = . 
+Global:.TARGETS = 
+Internal:MAKEFILE = varname-empty.mk
+Global:.MAKE.MAKEFILES = varname-empty.mk
+Global:.PARSEDIR = 
+Global:.PARSEFILE = varname-empty.mk
+Global:delete .INCLUDEDFROMDIR (not found)
+Global:delete .INCLUDEDFROMFILE (not found)
 Var_Set("", "default", ...) name expands to empty string - ignored
 Var_Set("", "assigned", ...) name expands to empty string - ignored
 Var_Set("", "appended", ...) name expands to empty string - ignored
 Var_Set("", "", ...) name expands to empty string - ignored
 Var_Set("", "subst", ...) name expands to empty string - ignored
 Var_Set("", "shell-output", ...) name expands to empty string - ignored
+Var_Parse: ${:Ufallback} != "fallback" with VARE_UNDEFERR|VARE_WANTRES
+Applying ${:U...} to "" (VARE_UNDEFERR|VARE_WANTRES, none, VES_UNDEF)
+Result of ${:Ufallback} is "fallback" (VARE_UNDEFERR|VARE_WANTRES, none, VES_DEF)
+Var_Parse: ${:U} with VARE_WANTRES
+Applying ${:U} to "" (VARE_WANTRES, none, VES_UNDEF)
+Result of ${:U} is "" (VARE_WANTRES, none, VES_DEF)
 Var_Set("${:U}", "assigned indirectly", ...) name expands to empty string - ignored
-Var_Set("", "assigned", ...) name expands to empty string - ignored
+Var_Parse: ${:Ufallback} != "fallback" with VARE_UNDEFERR|VARE_WANTRES
+Applying ${:U...} to "" (VARE_UNDEFERR|VARE_WANTRES, none, VES_UNDEF)
+Result of ${:Ufallback} is "fallback" (VARE_UNDEFERR|VARE_WANTRES, none, VES_DEF)
+Var_Parse: ${:U} with VARE_WANTRES
+Applying ${:U} to "" (VARE_WANTRES, none, VES_UNDEF)
+Result of ${:U} is "" (VARE_WANTRES, none, VES_DEF)
+Var_Append("${:U}", "appended indirectly", ...) name expands to empty string - ignored
+Var_Parse: ${:Ufallback} != "fallback" with VARE_UNDEFERR|VARE_WANTRES
+Applying ${:U...} to "" (VARE_UNDEFERR|VARE_WANTRES, none, VES_UNDEF)
+Result of ${:Ufallback} is "fallback" (VARE_UNDEFERR|VARE_WANTRES, none, VES_DEF)
+Global:.MAKEFLAGS =  -r -d v -d
+Global:.MAKEFLAGS =  -r -d v -d 0
 out: fallback
 out: 1 2 3
 exit status 0

Index: src/usr.bin/make/unit-tests/varname-empty.mk
diff -u src/usr.bin/make/unit-tests/varname-empty.mk:1.7 src/usr.bin/make/unit-tests/varname-empty.mk:1.8
--- src

CVS commit: src/usr.bin/make

2021-02-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Wed Feb  3 08:08:18 UTC 2021

Modified Files:
src/usr.bin/make: job.c main.c meta.c nonints.h parse.c suff.c var.c

Log Message:
make: replace Global_SetExpand with Global_Set for constant names


To generate a diff of this commit:
cvs rdiff -u -r1.413 -r1.414 src/usr.bin/make/job.c
cvs rdiff -u -r1.527 -r1.528 src/usr.bin/make/main.c
cvs rdiff -u -r1.171 -r1.172 src/usr.bin/make/meta.c
cvs rdiff -u -r1.191 -r1.192 src/usr.bin/make/nonints.h
cvs rdiff -u -r1.539 -r1.540 src/usr.bin/make/parse.c
cvs rdiff -u -r1.342 -r1.343 src/usr.bin/make/suff.c
cvs rdiff -u -r1.791 -r1.792 src/usr.bin/make/var.c

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

Modified files:

Index: src/usr.bin/make/job.c
diff -u src/usr.bin/make/job.c:1.413 src/usr.bin/make/job.c:1.414
--- src/usr.bin/make/job.c:1.413	Wed Feb  3 08:00:36 2021
+++ src/usr.bin/make/job.c	Wed Feb  3 08:08:18 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: job.c,v 1.413 2021/02/03 08:00:36 rillig Exp $	*/
+/*	$NetBSD: job.c,v 1.414 2021/02/03 08:08:18 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -142,7 +142,7 @@
 #include "trace.h"
 
 /*	"@(#)job.c	8.2 (Berkeley) 3/19/94"	*/
-MAKE_RCSID("$NetBSD: job.c,v 1.413 2021/02/03 08:00:36 rillig Exp $");
+MAKE_RCSID("$NetBSD: job.c,v 1.414 2021/02/03 08:08:18 rillig Exp $");
 
 /*
  * A shell defines how the commands are run.  All commands for a target are
@@ -2177,7 +2177,7 @@ Job_SetPrefix(void)
 	if (targPrefix != NULL) {
 		free(targPrefix);
 	} else if (!Var_Exists(MAKE_JOB_PREFIX, VAR_GLOBAL)) {
-		Global_SetExpand(MAKE_JOB_PREFIX, "---");
+		Global_Set(MAKE_JOB_PREFIX, "---");
 	}
 
 	(void)Var_Subst("${" MAKE_JOB_PREFIX "}",

Index: src/usr.bin/make/main.c
diff -u src/usr.bin/make/main.c:1.527 src/usr.bin/make/main.c:1.528
--- src/usr.bin/make/main.c:1.527	Wed Feb  3 08:00:36 2021
+++ src/usr.bin/make/main.c	Wed Feb  3 08:08:18 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.527 2021/02/03 08:00:36 rillig Exp $	*/
+/*	$NetBSD: main.c,v 1.528 2021/02/03 08:08:18 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -111,7 +111,7 @@
 #include "trace.h"
 
 /*	"@(#)main.c	8.3 (Berkeley) 3/19/94"	*/
-MAKE_RCSID("$NetBSD: main.c,v 1.527 2021/02/03 08:00:36 rillig Exp $");
+MAKE_RCSID("$NetBSD: main.c,v 1.528 2021/02/03 08:08:18 rillig Exp $");
 #if defined(MAKE_NATIVE) && !defined(lint)
 __COPYRIGHT("@(#) Copyright (c) 1988, 1989, 1990, 1993 "
 	"The Regents of the University of California.  "
@@ -429,7 +429,7 @@ MainParseArgJobs(const char *argvalue)
 	}
 	Global_AppendExpand(MAKEFLAGS, "-j");
 	Global_AppendExpand(MAKEFLAGS, argvalue);
-	Global_SetExpand(".MAKE.JOBS", argvalue);
+	Global_Set(".MAKE.JOBS", argvalue);
 	maxJobTokens = opts.maxJobs;
 }
 
@@ -459,7 +459,7 @@ MainParseArg(char c, const char *argvalu
 	case 'B':
 		opts.compatMake = TRUE;
 		Global_AppendExpand(MAKEFLAGS, "-B");
-		Global_SetExpand(MAKE_MODE, "compat");
+		Global_Set(MAKE_MODE, "compat");
 		break;
 	case 'C':
 		MainParseArgChdir(argvalue);
@@ -737,7 +737,7 @@ Main_SetObjdir(Boolean writable, const c
 			progname, path, strerror(errno));
 		} else {
 			snprintf(objdir, sizeof objdir, "%s", path);
-			Global_SetExpand(".OBJDIR", objdir);
+			Global_Set(".OBJDIR", objdir);
 			setenv("PWD", objdir, 1);
 			Dir_InitDot();
 			purge_relative_cached_realpaths();
@@ -957,7 +957,7 @@ InitVarTargets(void)
 	StringListNode *ln;
 
 	if (Lst_IsEmpty(&opts.create)) {
-		Global_SetExpand(".TARGETS", "");
+		Global_Set(".TARGETS", "");
 		return;
 	}
 
@@ -1159,8 +1159,8 @@ InitVarMake(const char *argv0)
 			make = abspath;
 	}
 
-	Global_SetExpand("MAKE", make);
-	Global_SetExpand(".MAKE", make);
+	Global_Set("MAKE", make);
+	Global_Set(".MAKE", make);
 }
 
 /*
@@ -1383,21 +1383,21 @@ main_Init(int argc, char **argv)
 	 */
 	Targ_Init();
 	Var_Init();
-	Global_SetExpand(".MAKE.OS", utsname.sysname);
-	Global_SetExpand("MACHINE", machine);
-	Global_SetExpand("MACHINE_ARCH", machine_arch);
+	Global_Set(".MAKE.OS", utsname.sysname);
+	Global_Set("MACHINE", machine);
+	Global_Set("MACHINE_ARCH", machine_arch);
 #ifdef MAKE_VERSION
-	Global_SetExpand("MAKE_VERSION", MAKE_VERSION);
+	Global_Set("MAKE_VERSION", MAKE_VERSION);
 #endif
-	Global_SetExpand(".newline", "\n"); /* handy for :@ loops */
+	Global_Set(".newline", "\n"); /* handy for :@ loops */
 	/*
 	 * This is the traditional preference for makefiles.
 	 */
 #ifndef MAKEFILE_PREFERENCE_LIST
 # define MAKEFILE_PREFERENCE_LIST "makefile Makefile"
 #endif
-	Global_SetExpand(MAKE_MAKEFILE_PREFERENCE, MAKEFILE_PREFERENCE_LIST);
-	Global_SetExpand(MAKE_DEPENDFILE, ".depend");
+	Global_Set(MAKE_MAKEFILE_PREFERENCE, MAKEFILE_PREFERENCE_LIST);
+	Global_Set(MAKE_DEPENDFILE, ".depend");
 
 	CmdOpts_Init();
 	allPrecious = FALSE;	/* Remove targets when interrupted */
@@ -1421,10 +1421,10 @@ main_Init(int argc, cha

CVS commit: src/usr.bin/make

2021-02-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Wed Feb  3 08:00:36 UTC 2021

Modified Files:
src/usr.bin/make: dir.c job.c main.c meta.c nonints.h parse.c suff.c
targ.c util.c var.c

Log Message:
make: use shortcut functions Global_SetExpand and Global_AppendExpand

There are many places where global variables are set or appended to.  To
reduce clutter and code size, encode the VAR_GLOBAL in the function
name.

The word Expand in the function names says that the variable name is
expanded.  In most of the cases, this is not necessary, but there are no
corresponding functions Global_Set or Global_Append yet.

Encoding the information whether the name is expanded or not in the
function name will make inconsistencies obvious in future manual code
reviews. Letting the compiler check this by using different types for
unexpanded and expanded variable names is probably not worth the effort.
There are still a few bugs to be fixed, such as in SetVar, which expands
the variable name twice in a row.


To generate a diff of this commit:
cvs rdiff -u -r1.265 -r1.266 src/usr.bin/make/dir.c
cvs rdiff -u -r1.412 -r1.413 src/usr.bin/make/job.c
cvs rdiff -u -r1.526 -r1.527 src/usr.bin/make/main.c
cvs rdiff -u -r1.170 -r1.171 src/usr.bin/make/meta.c
cvs rdiff -u -r1.190 -r1.191 src/usr.bin/make/nonints.h
cvs rdiff -u -r1.538 -r1.539 src/usr.bin/make/parse.c
cvs rdiff -u -r1.341 -r1.342 src/usr.bin/make/suff.c
cvs rdiff -u -r1.161 -r1.162 src/usr.bin/make/targ.c
cvs rdiff -u -r1.75 -r1.76 src/usr.bin/make/util.c
cvs rdiff -u -r1.790 -r1.791 src/usr.bin/make/var.c

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

Modified files:

Index: src/usr.bin/make/dir.c
diff -u src/usr.bin/make/dir.c:1.265 src/usr.bin/make/dir.c:1.266
--- src/usr.bin/make/dir.c:1.265	Sat Jan 30 20:53:29 2021
+++ src/usr.bin/make/dir.c	Wed Feb  3 08:00:36 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: dir.c,v 1.265 2021/01/30 20:53:29 rillig Exp $	*/
+/*	$NetBSD: dir.c,v 1.266 2021/02/03 08:00:36 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -138,7 +138,7 @@
 #include "job.h"
 
 /*	"@(#)dir.c	8.2 (Berkeley) 1/2/94"	*/
-MAKE_RCSID("$NetBSD: dir.c,v 1.265 2021/01/30 20:53:29 rillig Exp $");
+MAKE_RCSID("$NetBSD: dir.c,v 1.266 2021/02/03 08:00:36 rillig Exp $");
 
 /*
  * A search path is a list of CachedDir structures. A CachedDir has in it the
@@ -555,15 +555,15 @@ Dir_SetPATH(void)
 		CachedDir *dir = ln->datum;
 		if (dir == dotLast) {
 			seenDotLast = TRUE;
-			Var_Append(".PATH", dotLast->name, VAR_GLOBAL);
+			Global_AppendExpand(".PATH", dotLast->name);
 		}
 	}
 
 	if (!seenDotLast) {
 		if (dot != NULL)
-			Var_Append(".PATH", dot->name, VAR_GLOBAL);
+			Global_AppendExpand(".PATH", dot->name);
 		if (cur != NULL)
-			Var_Append(".PATH", cur->name, VAR_GLOBAL);
+			Global_AppendExpand(".PATH", cur->name);
 	}
 
 	for (ln = dirSearchPath.dirs.first; ln != NULL; ln = ln->next) {
@@ -572,14 +572,14 @@ Dir_SetPATH(void)
 			continue;
 		if (dir == dot && seenDotLast)
 			continue;
-		Var_Append(".PATH", dir->name, VAR_GLOBAL);
+		Global_AppendExpand(".PATH", dir->name);
 	}
 
 	if (seenDotLast) {
 		if (dot != NULL)
-			Var_Append(".PATH", dot->name, VAR_GLOBAL);
+			Global_AppendExpand(".PATH", dot->name);
 		if (cur != NULL)
-			Var_Append(".PATH", cur->name, VAR_GLOBAL);
+			Global_AppendExpand(".PATH", cur->name);
 	}
 }
 

Index: src/usr.bin/make/job.c
diff -u src/usr.bin/make/job.c:1.412 src/usr.bin/make/job.c:1.413
--- src/usr.bin/make/job.c:1.412	Mon Feb  1 21:09:25 2021
+++ src/usr.bin/make/job.c	Wed Feb  3 08:00:36 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: job.c,v 1.412 2021/02/01 21:09:25 rillig Exp $	*/
+/*	$NetBSD: job.c,v 1.413 2021/02/03 08:00:36 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -142,7 +142,7 @@
 #include "trace.h"
 
 /*	"@(#)job.c	8.2 (Berkeley) 3/19/94"	*/
-MAKE_RCSID("$NetBSD: job.c,v 1.412 2021/02/01 21:09:25 rillig Exp $");
+MAKE_RCSID("$NetBSD: job.c,v 1.413 2021/02/03 08:00:36 rillig Exp $");
 
 /*
  * A shell defines how the commands are run.  All commands for a target are
@@ -2177,7 +2177,7 @@ Job_SetPrefix(void)
 	if (targPrefix != NULL) {
 		free(targPrefix);
 	} else if (!Var_Exists(MAKE_JOB_PREFIX, VAR_GLOBAL)) {
-		Var_Set(MAKE_JOB_PREFIX, "---", VAR_GLOBAL);
+		Global_SetExpand(MAKE_JOB_PREFIX, "---");
 	}
 
 	(void)Var_Subst("${" MAKE_JOB_PREFIX "}",
@@ -2791,8 +2791,8 @@ Job_ServerStart(int max_tokens, int jp_0
 	snprintf(jobarg, sizeof jobarg, "%d,%d",
 	tokenWaitJob.inPipe, tokenWaitJob.outPipe);
 
-	Var_Append(MAKEFLAGS, "-J", VAR_GLOBAL);
-	Var_Append(MAKEFLAGS, jobarg, VAR_GLOBAL);
+	Global_AppendExpand(MAKEFLAGS, "-J");
+	Global_AppendExpand(MAKEFLAGS, jobarg);
 
 	/*
 	 * Preload the job pipe with one token per job, save the one

Index: src/usr.bin/make/main.c
diff -u src/usr.bin/make/main.c:1.526 src/usr.bin