CVS commit: src/usr.bin/make

2020-09-29 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Wed Sep 30 05:58:22 UTC 2020

Modified Files:
src/usr.bin/make: var.c
src/usr.bin/make/unit-tests: vardebug.exp varmod-l-name-to-value.exp

Log Message:
make(1): fix bug in evaluation of indirect variable modifiers

Since 2020-09-22, when indirect variable modifiers were applied to a
variable expression based on an undefined variable, these modifiers did
not change the state of a variable expression from undefined to defined.
The modifiers that do this are :D, :U, :L, :P.  Minimal example:

${VARNAME:${:UL}}

The :L modifier from the inner expression sets the value of the outer
expression to its variable name, in this case "VARNAME".  The outer
expression was not marked as being defined though, which resulted in a
"Malformed conditional" error.

In the commit from 2020-09-22, vardebug.exp had changed a lot, and I had
not inspected the change closely.  The important detail was in lines 56
and 60, where VAR_JUNK|VAR_KEEP changed into VEF_UNDEF, thereby losing
the VEF_DEF bit.


To generate a diff of this commit:
cvs rdiff -u -r1.553 -r1.554 src/usr.bin/make/var.c
cvs rdiff -u -r1.8 -r1.9 src/usr.bin/make/unit-tests/vardebug.exp
cvs rdiff -u -r1.2 -r1.3 \
src/usr.bin/make/unit-tests/varmod-l-name-to-value.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.553 src/usr.bin/make/var.c:1.554
--- src/usr.bin/make/var.c:1.553	Tue Sep 29 19:20:08 2020
+++ src/usr.bin/make/var.c	Wed Sep 30 05:58:22 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: var.c,v 1.553 2020/09/29 19:20:08 rillig Exp $	*/
+/*	$NetBSD: var.c,v 1.554 2020/09/30 05:58:22 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -121,7 +121,7 @@
 #include"metachar.h"
 
 /*	"@(#)var.c	8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: var.c,v 1.553 2020/09/29 19:20:08 rillig Exp $");
+MAKE_RCSID("$NetBSD: var.c,v 1.554 2020/09/30 05:58:22 rillig Exp $");
 
 #define VAR_DEBUG1(fmt, arg1) DEBUG1(VAR, fmt, arg1)
 #define VAR_DEBUG2(fmt, arg1, arg2) DEBUG2(VAR, fmt, arg1, arg2)
@@ -3170,7 +3170,7 @@ ApplyModifiers(
 	if (rval[0] != '\0') {
 		const char *rval_pp = rval;
 		st.val = ApplyModifiers(_pp, st.val, '\0', '\0', v,
-	exprFlags, ctxt, eflags, freePtr);
+	, ctxt, eflags, freePtr);
 		if (st.val == var_Error
 		|| (st.val == varUndefined && !(st.eflags & VARE_UNDEFERR))
 		|| *rval_pp != '\0') {

Index: src/usr.bin/make/unit-tests/vardebug.exp
diff -u src/usr.bin/make/unit-tests/vardebug.exp:1.8 src/usr.bin/make/unit-tests/vardebug.exp:1.9
--- src/usr.bin/make/unit-tests/vardebug.exp:1.8	Tue Sep 22 06:13:39 2020
+++ src/usr.bin/make/unit-tests/vardebug.exp	Wed Sep 30 05:58:22 2020
@@ -53,11 +53,11 @@ Var_Parse: ${:UM*e}:Mvalu[e]} with VARE_
 Applying ${:U...} to "" (VARE_UNDEFERR|VARE_WANTRES, none, VEF_UNDEF)
 Result of ${:UM*e} is "M*e" (VARE_UNDEFERR|VARE_WANTRES, none, VEF_UNDEF|VEF_DEF)
 Indirect modifier "M*e" from "${:UM*e}"
-Applying ${:M...} to "value" (VARE_UNDEFERR|VARE_WANTRES, none, VEF_UNDEF)
+Applying ${:M...} to "value" (VARE_UNDEFERR|VARE_WANTRES, none, VEF_UNDEF|VEF_DEF)
 Pattern[] for [value] is [*e]
 ModifyWords: split "value" into 1 words
 VarMatch [value] [*e]
-Result of ${:M*e} is "value" (VARE_UNDEFERR|VARE_WANTRES, none, VEF_UNDEF)
+Result of ${:M*e} is "value" (VARE_UNDEFERR|VARE_WANTRES, none, VEF_UNDEF|VEF_DEF)
 Applying ${:M...} to "value" (VARE_UNDEFERR|VARE_WANTRES, none, VEF_UNDEF|VEF_DEF)
 Pattern[] for [value] is [valu[e]]
 ModifyWords: split "value" into 1 words

Index: src/usr.bin/make/unit-tests/varmod-l-name-to-value.exp
diff -u src/usr.bin/make/unit-tests/varmod-l-name-to-value.exp:1.2 src/usr.bin/make/unit-tests/varmod-l-name-to-value.exp:1.3
--- src/usr.bin/make/unit-tests/varmod-l-name-to-value.exp:1.2	Wed Sep 30 05:42:06 2020
+++ src/usr.bin/make/unit-tests/varmod-l-name-to-value.exp	Wed Sep 30 05:58:22 2020
@@ -1,4 +1 @@
-make: "varmod-l-name-to-value.mk" line 34: Malformed conditional (${value:${:UL}} == "")
-make: Fatal errors encountered -- cannot continue
-make: stopped in unit-tests
-exit status 1
+exit status 0



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

2020-09-29 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Wed Sep 30 05:42:06 UTC 2020

Modified Files:
src/usr.bin/make/unit-tests: varmod-l-name-to-value.exp
varmod-l-name-to-value.mk

Log Message:
make(1): demonstrate bug in evaluation of indirect variable modifiers

Reported by sjg.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 \
src/usr.bin/make/unit-tests/varmod-l-name-to-value.exp
cvs rdiff -u -r1.3 -r1.4 \
src/usr.bin/make/unit-tests/varmod-l-name-to-value.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/varmod-l-name-to-value.exp
diff -u src/usr.bin/make/unit-tests/varmod-l-name-to-value.exp:1.1 src/usr.bin/make/unit-tests/varmod-l-name-to-value.exp:1.2
--- src/usr.bin/make/unit-tests/varmod-l-name-to-value.exp:1.1	Sun Aug 16 12:07:51 2020
+++ src/usr.bin/make/unit-tests/varmod-l-name-to-value.exp	Wed Sep 30 05:42:06 2020
@@ -1 +1,4 @@
-exit status 0
+make: "varmod-l-name-to-value.mk" line 34: Malformed conditional (${value:${:UL}} == "")
+make: Fatal errors encountered -- cannot continue
+make: stopped in unit-tests
+exit status 1

Index: src/usr.bin/make/unit-tests/varmod-l-name-to-value.mk
diff -u src/usr.bin/make/unit-tests/varmod-l-name-to-value.mk:1.3 src/usr.bin/make/unit-tests/varmod-l-name-to-value.mk:1.4
--- src/usr.bin/make/unit-tests/varmod-l-name-to-value.mk:1.3	Tue Aug 25 22:25:05 2020
+++ src/usr.bin/make/unit-tests/varmod-l-name-to-value.mk	Wed Sep 30 05:42:06 2020
@@ -1,4 +1,4 @@
-# $NetBSD: varmod-l-name-to-value.mk,v 1.3 2020/08/25 22:25:05 rillig Exp $
+# $NetBSD: varmod-l-name-to-value.mk,v 1.4 2020/09/30 05:42:06 rillig Exp $
 #
 # Tests for the :L modifier, which returns the variable name as the new value.
 
@@ -27,5 +27,12 @@
 .error
 .endif
 
+# Between 2020-09-22 (var.c 1.527) and 2020-09-30 (var.c 1.554), there was
+# a bug in the evaluation of variable expression.  Indirect modifiers like
+# this :L did not update the definedness of the enclosing expression.
+# This resulted in a wrong "Malformed variable".
+.if ${value:${:UL}} == ""
+.endif
+
 all:
 	@:;



CVS commit: src/sys/dev/ic

2020-09-29 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Wed Sep 30 05:04:55 UTC 2020

Modified Files:
src/sys/dev/ic: sl811hs.c

Log Message:
Add some KNF whitespace.


To generate a diff of this commit:
cvs rdiff -u -r1.103 -r1.104 src/sys/dev/ic/sl811hs.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/ic/sl811hs.c
diff -u src/sys/dev/ic/sl811hs.c:1.103 src/sys/dev/ic/sl811hs.c:1.104
--- src/sys/dev/ic/sl811hs.c:1.103	Sat Feb 15 01:21:56 2020
+++ src/sys/dev/ic/sl811hs.c	Wed Sep 30 05:04:54 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: sl811hs.c,v 1.103 2020/02/15 01:21:56 riastradh Exp $	*/
+/*	$NetBSD: sl811hs.c,v 1.104 2020/09/30 05:04:54 simonb Exp $	*/
 
 /*
  * Not (c) 2007 Matthew Orgass
@@ -68,7 +68,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sl811hs.c,v 1.103 2020/02/15 01:21:56 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sl811hs.c,v 1.104 2020/09/30 05:04:54 simonb Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_slhci.h"
@@ -584,28 +584,28 @@ DDOLOGBUF(uint8_t *buf, unsigned int len
 	SLHCIHIST_FUNC(); SLHCIHIST_CALLED();
 	int i;
 
-	for(i=0; i+8 <= length; i+=8)
+	for(i = 0; i + 8 <= length; i += 8)
 		DDOLOG("%.4x %.4x %.4x %.4x", (buf[i] << 8) | buf[i+1],
 		(buf[i+2] << 8) | buf[i+3], (buf[i+4] << 8) | buf[i+5],
 		(buf[i+6] << 8) | buf[i+7]);
-	if (length == i+7)
+	if (length == i + 7)
 		DDOLOG("%.4x %.4x %.4x %.2x", (buf[i] << 8) | buf[i+1],
 		(buf[i+2] << 8) | buf[i+3], (buf[i+4] << 8) | buf[i+5],
 		buf[i+6]);
-	else if (length == i+6)
+	else if (length == i + 6)
 		DDOLOG("%.4x %.4x %.4x", (buf[i] << 8) | buf[i+1],
 		(buf[i+2] << 8) | buf[i+3], (buf[i+4] << 8) | buf[i+5], 0);
-	else if (length == i+5)
+	else if (length == i + 5)
 		DDOLOG("%.4x %.4x %.2x", (buf[i] << 8) | buf[i+1],
 		(buf[i+2] << 8) | buf[i+3], buf[i+4], 0);
-	else if (length == i+4)
+	else if (length == i + 4)
 		DDOLOG("%.4x %.4x", (buf[i] << 8) | buf[i+1],
 		(buf[i+2] << 8) | buf[i+3], 0,0);
-	else if (length == i+3)
+	else if (length == i + 3)
 		DDOLOG("%.4x %.2x", (buf[i] << 8) | buf[i+1], buf[i+2], 0,0);
-	else if (length == i+2)
+	else if (length == i + 2)
 		DDOLOG("%.4x", (buf[i] << 8) | buf[i+1], 0,0,0);
-	else if (length == i+1)
+	else if (length == i + 1)
 		DDOLOG("%.2x", buf[i], 0,0,0);
 }
 #define DLOGBUF(x, b, l) SLHCI_DEXEC(x, DDOLOGBUF(b, l))
@@ -702,7 +702,7 @@ DDOLOGBUF(uint8_t *buf, unsigned int len
 
 const struct usbd_bus_methods slhci_bus_methods = {
 	.ubm_open = slhci_open,
-	.ubm_softint= slhci_void,
+	.ubm_softint = slhci_void,
 	.ubm_dopoll = slhci_poll,
 	.ubm_allocx = slhci_allocx,
 	.ubm_freex = slhci_freex,
@@ -2742,7 +2742,7 @@ slhci_drain(struct slhci_softc *sc)
 
 	t->pend = INT_MAX;
 
-	for (i=0; i<=1; i++) {
+	for (i = 0; i <= 1; i++) {
 		t->len[i] = -1;
 		if (t->spipe[i] != NULL) {
 			enter_callback(t, t->spipe[i]);
@@ -3518,7 +3518,7 @@ slhci_log_sc(void)
 	DDOLOG("a = %p Alen=%d b = %p Blen=%d", t->spipe[0], t->len[0],
 	t->spipe[1], t->len[1]);
 
-	for (i=0; i<=Q_MAX; i++)
+	for (i = 0; i <= Q_MAX; i++)
 		DDOLOG("Q %d: %p", i, gcq_hq(>q[i]), 0,0);
 
 	DDOLOG("TIMED: %p", GCQ_ITEM(gcq_hq(>to),



CVS commit: src/sys/arch

2020-09-29 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Tue Sep 29 19:58:50 UTC 2020

Modified Files:
src/sys/arch/aarch64/conf: files.aarch64
src/sys/arch/arm/arm32: arm32_tlb.c db_machdep.c
src/sys/arch/arm/conf: files.arm
src/sys/arch/arm/cortex: armperiph.c files.cortex
src/sys/arch/arm/imx: imx6_board.c
src/sys/arch/arm/include: cpuconf.h
src/sys/arch/arm/samsung: files.exynos
src/sys/arch/evbarm/beagle: beagle_machdep.c
src/sys/arch/evbarm/conf: BCM5301X BCM56340 DUOVERO GENERIC GENERIC64
KOBO N900 NETWALKER OMAP5EVM PANDABOARD PARALLELLA PEPPER RPI2
VTC100 ZEDBOARD
src/sys/arch/evbarm/gumstix: gumstix_machdep.c

Log Message:
Collapse all CPU_CORTEXA options into CPU_CORTEX and do runtime
detection instead of ifdefs where required.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/sys/arch/aarch64/conf/files.aarch64
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/arm/arm32/arm32_tlb.c
cvs rdiff -u -r1.35 -r1.36 src/sys/arch/arm/arm32/db_machdep.c
cvs rdiff -u -r1.161 -r1.162 src/sys/arch/arm/conf/files.arm
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/arm/cortex/armperiph.c
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/arm/cortex/files.cortex
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/arm/imx/imx6_board.c
cvs rdiff -u -r1.27 -r1.28 src/sys/arch/arm/include/cpuconf.h
cvs rdiff -u -r1.36 -r1.37 src/sys/arch/arm/samsung/files.exynos
cvs rdiff -u -r1.83 -r1.84 src/sys/arch/evbarm/beagle/beagle_machdep.c
cvs rdiff -u -r1.37 -r1.38 src/sys/arch/evbarm/conf/BCM5301X
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/evbarm/conf/BCM56340
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/evbarm/conf/DUOVERO
cvs rdiff -u -r1.82 -r1.83 src/sys/arch/evbarm/conf/GENERIC
cvs rdiff -u -r1.161 -r1.162 src/sys/arch/evbarm/conf/GENERIC64
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/evbarm/conf/KOBO \
src/sys/arch/evbarm/conf/RPI2
cvs rdiff -u -r1.35 -r1.36 src/sys/arch/evbarm/conf/N900
cvs rdiff -u -r1.40 -r1.41 src/sys/arch/evbarm/conf/NETWALKER
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/evbarm/conf/OMAP5EVM \
src/sys/arch/evbarm/conf/PEPPER
cvs rdiff -u -r1.32 -r1.33 src/sys/arch/evbarm/conf/PANDABOARD
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/evbarm/conf/PARALLELLA
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/evbarm/conf/VTC100
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/evbarm/conf/ZEDBOARD
cvs rdiff -u -r1.66 -r1.67 src/sys/arch/evbarm/gumstix/gumstix_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/aarch64/conf/files.aarch64
diff -u src/sys/arch/aarch64/conf/files.aarch64:1.27 src/sys/arch/aarch64/conf/files.aarch64:1.28
--- src/sys/arch/aarch64/conf/files.aarch64:1.27	Wed Aug 12 13:28:46 2020
+++ src/sys/arch/aarch64/conf/files.aarch64	Tue Sep 29 19:58:49 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: files.aarch64,v 1.27 2020/08/12 13:28:46 skrll Exp $
+#	$NetBSD: files.aarch64,v 1.28 2020/09/29 19:58:49 jmcneill Exp $
 
 defflag opt_cpuoptions.h	AARCH64_ALIGNMENT_CHECK
 defflag opt_cpuoptions.h	AARCH64_EL0_STACK_ALIGNMENT_CHECK
@@ -8,9 +8,6 @@ defflag opt_cpuoptions.h	AARCH64_DEVICE_
 
 defflag	opt_cputypes.h		CPU_ARMV8
 defflag	opt_cputypes.h		CPU_CORTEX: CPU_ARMV8
-defflag	opt_cputypes.h		CPU_CORTEXA35: CPU_CORTEX
-defflag	opt_cputypes.h		CPU_CORTEXA53: CPU_CORTEX
-defflag	opt_cputypes.h		CPU_CORTEXA57: CPU_CORTEX
 defflag	opt_cputypes.h		CPU_THUNDERX: CPU_ARMV8
 
 # Interrupt implementation header definition

Index: src/sys/arch/arm/arm32/arm32_tlb.c
diff -u src/sys/arch/arm/arm32/arm32_tlb.c:1.12 src/sys/arch/arm/arm32/arm32_tlb.c:1.13
--- src/sys/arch/arm/arm32/arm32_tlb.c:1.12	Wed Aug 15 06:00:02 2018
+++ src/sys/arch/arm/arm32/arm32_tlb.c	Tue Sep 29 19:58:49 2020
@@ -31,7 +31,7 @@
 #include "opt_multiprocessor.h"
 
 #include 
-__KERNEL_RCSID(1, "$NetBSD: arm32_tlb.c,v 1.12 2018/08/15 06:00:02 skrll Exp $");
+__KERNEL_RCSID(1, "$NetBSD: arm32_tlb.c,v 1.13 2020/09/29 19:58:49 jmcneill Exp $");
 
 #include 
 #include 
@@ -143,7 +143,7 @@ tlb_update_addr(vaddr_t va, tlb_asid_t a
 	return true;
 }
 
-#if !defined(MULTIPROCESSOR) && defined(CPU_CORTEXA5)
+#if !defined(MULTIPROCESSOR)
 static u_int
 tlb_cortex_a5_record_asids(u_long *mapp, tlb_asid_t asid_max)
 {
@@ -175,7 +175,7 @@ tlb_cortex_a5_record_asids(u_long *mapp,
 }
 #endif
 
-#if !defined(MULTIPROCESSOR) && defined(CPU_CORTEXA7)
+#if !defined(MULTIPROCESSOR)
 static u_int
 tlb_cortex_a7_record_asids(u_long *mapp, tlb_asid_t asid_max)
 {
@@ -212,14 +212,10 @@ u_int
 tlb_record_asids(u_long *mapp, tlb_asid_t asid_max)
 {
 #ifndef MULTIPROCESSOR
-#ifdef CPU_CORTEXA5
 	if (CPU_ID_CORTEX_A5_P(curcpu()->ci_arm_cpuid))
 		return tlb_cortex_a5_record_asids(mapp, asid_max);
-#endif
-#ifdef CPU_CORTEXA7
 	if (CPU_ID_CORTEX_A7_P(curcpu()->ci_arm_cpuid))
 		return tlb_cortex_a7_record_asids(mapp, asid_max);
-#endif
 #endif /* MULTIPROCESSOR */
 #ifdef DIAGNOSTIC
 	mapp[0] = 0xfffe;

Index: 

CVS commit: src

2020-09-29 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Tue Sep 29 19:41:48 UTC 2020

Modified Files:
src/distrib/sets/lists/tests: mi
src/tests/net: Makefile
Added Files:
src/tests/net/if_vether: Makefile t_vether.sh

Log Message:
vether(4): Add ATF tests based on the tap(4) tests.


To generate a diff of this commit:
cvs rdiff -u -r1.931 -r1.932 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.36 -r1.37 src/tests/net/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/net/if_vether/Makefile \
src/tests/net/if_vether/t_vether.sh

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

Modified files:

Index: src/distrib/sets/lists/tests/mi
diff -u src/distrib/sets/lists/tests/mi:1.931 src/distrib/sets/lists/tests/mi:1.932
--- src/distrib/sets/lists/tests/mi:1.931	Sun Sep 27 20:11:33 2020
+++ src/distrib/sets/lists/tests/mi	Tue Sep 29 19:41:48 2020
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.931 2020/09/27 20:11:33 rillig Exp $
+# $NetBSD: mi,v 1.932 2020/09/29 19:41:48 roy Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -3862,6 +3862,10 @@
 ./usr/tests/net/if_tun/Atffiletests-net-tests		atf,rump
 ./usr/tests/net/if_tun/Kyuafiletests-net-tests		atf,rump,kyua
 ./usr/tests/net/if_tun/t_tuntests-net-tests		atf,rump
+./usr/tests/net/if_vethertests-net-tests		compattestfile,atf
+./usr/tests/net/if_vether/Atffile			tests-net-tests		atf,rump
+./usr/tests/net/if_vether/Kyuafile			tests-net-tests		atf,rump,kyua
+./usr/tests/net/if_vether/t_vether			tests-net-tests		atf,rump
 ./usr/tests/net/if_vlan	tests-net-tests		compattestfile,atf
 ./usr/tests/net/if_vlan/Atffiletests-net-tests		atf,rump
 ./usr/tests/net/if_vlan/Kyuafile			tests-net-tests		atf,rump,kyua

Index: src/tests/net/Makefile
diff -u src/tests/net/Makefile:1.36 src/tests/net/Makefile:1.37
--- src/tests/net/Makefile:1.36	Wed Aug 26 16:03:42 2020
+++ src/tests/net/Makefile	Tue Sep 29 19:41:48 2020
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.36 2020/08/26 16:03:42 riastradh Exp $
+# $NetBSD: Makefile,v 1.37 2020/09/29 19:41:48 roy Exp $
 
 .include 
 
@@ -8,7 +8,7 @@ TESTS_SUBDIRS=		fdpass in_cksum net sys
 .if (${MKRUMP} != "no") && !defined(BSD_MK_COMPAT_FILE)
 TESTS_SUBDIRS+=		arp bpf bpfilter can carp icmp if if_bridge if_gif
 TESTS_SUBDIRS+=		if_ipsec if_l2tp if_loop if_pppoe if_tap if_tun ipsec
-TESTS_SUBDIRS+=		mcast mpls ndp npf route if_vlan if_wg
+TESTS_SUBDIRS+=		mcast mpls ndp npf route if_vether if_vlan if_wg
 .if (${MKSLJIT} != "no")
 TESTS_SUBDIRS+=		bpfjit
 .endif

Added files:

Index: src/tests/net/if_vether/Makefile
diff -u /dev/null src/tests/net/if_vether/Makefile:1.1
--- /dev/null	Tue Sep 29 19:41:48 2020
+++ src/tests/net/if_vether/Makefile	Tue Sep 29 19:41:48 2020
@@ -0,0 +1,13 @@
+# $NetBSD: Makefile,v 1.1 2020/09/29 19:41:48 roy Exp $
+#
+
+.include 
+
+TESTSDIR=	${TESTSBASE}/net/if_vether
+
+.for name in vether
+TESTS_SH+=		t_${name}
+TESTS_SH_SRC_t_${name}=	../net_common.sh t_${name}.sh
+.endfor
+
+.include 
Index: src/tests/net/if_vether/t_vether.sh
diff -u /dev/null src/tests/net/if_vether/t_vether.sh:1.1
--- /dev/null	Tue Sep 29 19:41:48 2020
+++ src/tests/net/if_vether/t_vether.sh	Tue Sep 29 19:41:48 2020
@@ -0,0 +1,185 @@
+#	$NetBSD: t_vether.sh,v 1.1 2020/09/29 19:41:48 roy Exp $
+#
+# Copyright (c) 2016 Internet Initiative Japan Inc.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#notice, this list of conditions and the following disclaimer in the
+#documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+
+SOCK_LOCAL=unix://commsock1
+SOCK_REMOTE=unix://commsock2
+BUS=bus1
+IP4_LOCAL=10.0.0.1
+IP4_VETHER=10.0.0.2
+IP4_REMOTE=10.0.0.3
+IP6_LOCAL=fc00::1
+IP6_VETHER=fc00::2
+IP6_REMOTE=fc00::3
+
+DEBUG=${DEBUG:-false}
+TIMEOUT=1
+
+atf_test_case 

CVS commit: src/sys

2020-09-29 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Tue Sep 29 19:33:36 UTC 2020

Modified Files:
src/sys/netinet: in.c
src/sys/netinet6: in6.c

Log Message:
inet: Treat LINK_STATE_UNKNOWN as LINK_STATE_UP when changing

It's something we have always done.
it's really rare for anything to transition to UNKNOWN from either
UP or DOWN, but technically it is possible.


To generate a diff of this commit:
cvs rdiff -u -r1.240 -r1.241 src/sys/netinet/in.c
cvs rdiff -u -r1.281 -r1.282 src/sys/netinet6/in6.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/netinet/in.c
diff -u src/sys/netinet/in.c:1.240 src/sys/netinet/in.c:1.241
--- src/sys/netinet/in.c:1.240	Fri Sep 11 15:22:12 2020
+++ src/sys/netinet/in.c	Tue Sep 29 19:33:36 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: in.c,v 1.240 2020/09/11 15:22:12 roy Exp $	*/
+/*	$NetBSD: in.c,v 1.241 2020/09/29 19:33:36 roy Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -91,7 +91,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: in.c,v 1.240 2020/09/11 15:22:12 roy Exp $");
+__KERNEL_RCSID(0, "$NetBSD: in.c,v 1.241 2020/09/29 19:33:36 roy Exp $");
 
 #include "arp.h"
 
@@ -1579,14 +1579,15 @@ void
 in_if_link_state_change(struct ifnet *ifp, int link_state)
 {
 
-	switch (link_state) {
-	case LINK_STATE_DOWN:
+	/*
+	 * Treat LINK_STATE_UNKNOWN as UP.
+	 * LINK_STATE_UNKNOWN transitions to LINK_STATE_DOWN when
+	 * if_link_state_change() transitions to LINK_STATE_UP.
+	 */
+	if (link_state == LINK_STATE_DOWN)
 		in_if_link_down(ifp);
-		break;
-	case LINK_STATE_UP:
+	else
 		in_if_link_up(ifp);
-		break;
-	}
 }
 
 /*

Index: src/sys/netinet6/in6.c
diff -u src/sys/netinet6/in6.c:1.281 src/sys/netinet6/in6.c:1.282
--- src/sys/netinet6/in6.c:1.281	Tue Jun 16 17:12:18 2020
+++ src/sys/netinet6/in6.c	Tue Sep 29 19:33:36 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: in6.c,v 1.281 2020/06/16 17:12:18 maxv Exp $	*/
+/*	$NetBSD: in6.c,v 1.282 2020/09/29 19:33:36 roy Exp $	*/
 /*	$KAME: in6.c,v 1.198 2001/07/18 09:12:38 itojun Exp $	*/
 
 /*
@@ -62,7 +62,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: in6.c,v 1.281 2020/06/16 17:12:18 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: in6.c,v 1.282 2020/09/29 19:33:36 roy Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -2250,14 +2250,15 @@ void
 in6_if_link_state_change(struct ifnet *ifp, int link_state)
 {
 
-	switch (link_state) {
-	case LINK_STATE_DOWN:
+	/*
+	 * Treat LINK_STATE_UNKNOWN as UP.
+	 * LINK_STATE_UNKNOWN transitions to LINK_STATE_DOWN when
+	 * if_link_state_change() transitions to LINK_STATE_UP.
+	 */
+	if (link_state == LINK_STATE_DOWN)
 		in6_if_link_down(ifp);
-		break;
-	case LINK_STATE_UP:
+	else
 		in6_if_link_up(ifp);
-		break;
-	}
 }
 
 int



CVS commit: src/usr.bin/make

2020-09-29 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Tue Sep 29 19:20:08 UTC 2020

Modified Files:
src/usr.bin/make: var.c

Log Message:
make(1): rename ShortVarValue to UndefinedShortVarValue


To generate a diff of this commit:
cvs rdiff -u -r1.552 -r1.553 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/var.c
diff -u src/usr.bin/make/var.c:1.552 src/usr.bin/make/var.c:1.553
--- src/usr.bin/make/var.c:1.552	Tue Sep 29 18:44:30 2020
+++ src/usr.bin/make/var.c	Tue Sep 29 19:20:08 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: var.c,v 1.552 2020/09/29 18:44:30 rillig Exp $	*/
+/*	$NetBSD: var.c,v 1.553 2020/09/29 19:20:08 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -121,7 +121,7 @@
 #include"metachar.h"
 
 /*	"@(#)var.c	8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: var.c,v 1.552 2020/09/29 18:44:30 rillig Exp $");
+MAKE_RCSID("$NetBSD: var.c,v 1.553 2020/09/29 19:20:08 rillig Exp $");
 
 #define VAR_DEBUG1(fmt, arg1) DEBUG1(VAR, fmt, arg1)
 #define VAR_DEBUG2(fmt, arg1, arg2) DEBUG2(VAR, fmt, arg1, arg2)
@@ -3294,7 +3294,7 @@ VarIsDynamic(GNode *ctxt, const char *va
 }
 
 static const char *
-ShortVarValue(char varname, const GNode *ctxt, VarEvalFlags eflags)
+UndefinedShortVarValue(char varname, const GNode *ctxt, VarEvalFlags eflags)
 {
 if (ctxt == VAR_CMD || ctxt == VAR_GLOBAL) {
 	/*
@@ -3489,7 +3489,7 @@ Var_Parse(const char **pp, GNode *ctxt, 
 	if (v == NULL) {
 	*pp += 2;
 
-	*out_val = ShortVarValue(startc, ctxt, eflags);
+	*out_val = UndefinedShortVarValue(startc, ctxt, eflags);
 	if (DEBUG(LINT) && *out_val == var_Error) {
 		Parse_Error(PARSE_FATAL, "Variable \"%s\" is undefined", name);
 		return VPR_UNDEF_MSG;



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

2020-09-29 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Tue Sep 29 18:48:43 UTC 2020

Modified Files:
src/usr.bin/make/unit-tests: varmod-defined.mk

Log Message:
make(1): add test for using the :D variable modifier as comment


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/usr.bin/make/unit-tests/varmod-defined.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/varmod-defined.mk
diff -u src/usr.bin/make/unit-tests/varmod-defined.mk:1.5 src/usr.bin/make/unit-tests/varmod-defined.mk:1.6
--- src/usr.bin/make/unit-tests/varmod-defined.mk:1.5	Sat Sep 12 07:04:51 2020
+++ src/usr.bin/make/unit-tests/varmod-defined.mk	Tue Sep 29 18:48:43 2020
@@ -1,4 +1,4 @@
-# $NetBSD: varmod-defined.mk,v 1.5 2020/09/12 07:04:51 rillig Exp $
+# $NetBSD: varmod-defined.mk,v 1.6 2020/09/29 18:48:43 rillig Exp $
 #
 # Tests for the :D variable modifier, which returns the given string
 # if the variable is defined.  It is closely related to the :U modifier.
@@ -75,6 +75,13 @@ DEF=	defined
 .  error
 .endif
 
+# Since the variable with the empty name is never defined, the :D modifier
+# can be used to add comments in the middle of an expression.  That
+# expression always evaluates to an empty string.
+.if ${:D This is a comment. } != ""
+.  error
+.endif
+
 # TODO: Add more tests for parsing the plain text part, to cover each branch
 # of ApplyModifier_Defined.
 



CVS commit: src/usr.bin/make

2020-09-29 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Tue Sep 29 18:44:30 UTC 2020

Modified Files:
src/usr.bin/make: var.c

Log Message:
make(1): remove unused assignments to local variables

These only became obvious once ApplyModifier had been extracted, which
shrank the source code of ApplyModifiers by about 100 lines.

Even GCC 5 had seen that they are redundant and had not generated any
code for them.


To generate a diff of this commit:
cvs rdiff -u -r1.551 -r1.552 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/var.c
diff -u src/usr.bin/make/var.c:1.551 src/usr.bin/make/var.c:1.552
--- src/usr.bin/make/var.c:1.551	Tue Sep 29 18:31:39 2020
+++ src/usr.bin/make/var.c	Tue Sep 29 18:44:30 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: var.c,v 1.551 2020/09/29 18:31:39 rillig Exp $	*/
+/*	$NetBSD: var.c,v 1.552 2020/09/29 18:44:30 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -121,7 +121,7 @@
 #include"metachar.h"
 
 /*	"@(#)var.c	8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: var.c,v 1.551 2020/09/29 18:31:39 rillig Exp $");
+MAKE_RCSID("$NetBSD: var.c,v 1.552 2020/09/29 18:44:30 rillig Exp $");
 
 #define VAR_DEBUG1(fmt, arg1) DEBUG1(VAR, fmt, arg1)
 #define VAR_DEBUG2(fmt, arg1, arg2) DEBUG2(VAR, fmt, arg1, arg2)
@@ -3190,7 +3190,6 @@ ApplyModifiers(
 	}
 apply_mods:
 	st.newVal = var_Error;	/* default value, in case of errors */
-	res = AMR_BAD;		/* just a safe fallback */
 	mod = p;
 
 	if (DEBUG(VAR))
@@ -3237,7 +3236,6 @@ ApplyModifiers(
 	} else if (*p == ':') {
 	p++;
 	}
-	mod = p;
 }
 out:
 *pp = p;



CVS commit: src

2020-09-29 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Tue Sep 29 18:33:23 UTC 2020

Modified Files:
src/distrib/sets/lists/base: shl.mi
src/distrib/sets/lists/comp: mi shl.mi
src/distrib/sets/lists/debug: mi shl.mi
src/sys/rump/net: Makefile.rumpnetcomp
Added Files:
src/sys/rump/net/lib/libvether: Makefile VETHER.ioconf
vether_component.c

Log Message:
rumpify vether(4)


To generate a diff of this commit:
cvs rdiff -u -r1.906 -r1.907 src/distrib/sets/lists/base/shl.mi
cvs rdiff -u -r1.2359 -r1.2360 src/distrib/sets/lists/comp/mi
cvs rdiff -u -r1.343 -r1.344 src/distrib/sets/lists/comp/shl.mi
cvs rdiff -u -r1.339 -r1.340 src/distrib/sets/lists/debug/mi
cvs rdiff -u -r1.265 -r1.266 src/distrib/sets/lists/debug/shl.mi
cvs rdiff -u -r1.22 -r1.23 src/sys/rump/net/Makefile.rumpnetcomp
cvs rdiff -u -r0 -r1.1 src/sys/rump/net/lib/libvether/Makefile \
src/sys/rump/net/lib/libvether/VETHER.ioconf \
src/sys/rump/net/lib/libvether/vether_component.c

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

Modified files:

Index: src/distrib/sets/lists/base/shl.mi
diff -u src/distrib/sets/lists/base/shl.mi:1.906 src/distrib/sets/lists/base/shl.mi:1.907
--- src/distrib/sets/lists/base/shl.mi:1.906	Sat Sep 26 17:49:49 2020
+++ src/distrib/sets/lists/base/shl.mi	Tue Sep 29 18:33:22 2020
@@ -1,4 +1,4 @@
-# $NetBSD: shl.mi,v 1.906 2020/09/26 17:49:49 jmcneill Exp $
+# $NetBSD: shl.mi,v 1.907 2020/09/29 18:33:22 roy Exp $
 #
 # Note:	Don't delete entries from here - mark them as "obsolete" instead,
 #	unless otherwise stated below.
@@ -825,6 +825,9 @@
 ./usr/lib/librumpnet_tun.so			base-rump-shlib		rump
 ./usr/lib/librumpnet_tun.so.0			base-rump-shlib		rump
 ./usr/lib/librumpnet_tun.so.0.0			base-rump-shlib		rump
+./usr/lib/librumpnet_vether.so			base-rump-shlib		rump
+./usr/lib/librumpnet_vether.so.0		base-rump-shlib		rump
+./usr/lib/librumpnet_vether.so.0.0		base-rump-shlib		rump
 ./usr/lib/librumpnet_virtif.so			base-rump-shlib		rump
 ./usr/lib/librumpnet_virtif.so.0		base-rump-shlib		rump
 ./usr/lib/librumpnet_virtif.so.0.0		base-rump-shlib		rump

Index: src/distrib/sets/lists/comp/mi
diff -u src/distrib/sets/lists/comp/mi:1.2359 src/distrib/sets/lists/comp/mi:1.2360
--- src/distrib/sets/lists/comp/mi:1.2359	Sat Sep 26 17:49:49 2020
+++ src/distrib/sets/lists/comp/mi	Tue Sep 29 18:33:22 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: mi,v 1.2359 2020/09/26 17:49:49 jmcneill Exp $
+#	$NetBSD: mi,v 1.2360 2020/09/29 18:33:22 roy Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 ./etc/mtree/set.compcomp-sys-root
@@ -3896,6 +3896,8 @@
 ./usr/lib/librumpnet_tap_p.a			comp-c-proflib		rump,profile
 ./usr/lib/librumpnet_tun.a			comp-c-lib		rump
 ./usr/lib/librumpnet_tun_p.a			comp-c-proflib		rump,profile
+./usr/lib/librumpnet_vether.a			comp-c-lib		rump
+./usr/lib/librumpnet_vether_p.a			comp-c-proflib		rump,profile
 ./usr/lib/librumpnet_virtif.a			comp-c-lib		rump
 ./usr/lib/librumpnet_virtif_p.a			comp-c-proflib		rump,profile
 ./usr/lib/librumpnet_vlan.a			comp-c-lib		rump

Index: src/distrib/sets/lists/comp/shl.mi
diff -u src/distrib/sets/lists/comp/shl.mi:1.343 src/distrib/sets/lists/comp/shl.mi:1.344
--- src/distrib/sets/lists/comp/shl.mi:1.343	Tue Sep 15 07:00:03 2020
+++ src/distrib/sets/lists/comp/shl.mi	Tue Sep 29 18:33:22 2020
@@ -1,4 +1,4 @@
-# $NetBSD: shl.mi,v 1.343 2020/09/15 07:00:03 mrg Exp $
+# $NetBSD: shl.mi,v 1.344 2020/09/29 18:33:22 roy Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -246,6 +246,7 @@
 ./usr/lib/librumpnet_sockin_pic.a		comp-c-piclib		picinstall,rump
 ./usr/lib/librumpnet_tap_pic.a			comp-c-piclib		picinstall,rump
 ./usr/lib/librumpnet_tun_pic.a			comp-c-piclib		picinstall,rump
+./usr/lib/librumpnet_vether_pic.a		comp-c-piclib		picinstall,rump
 ./usr/lib/librumpnet_virtif_pic.a		comp-c-piclib		picinstall,rump
 ./usr/lib/librumpnet_vlan_pic.a			comp-c-piclib		picinstall,rump
 ./usr/lib/librumpnet_wg_pic.a			comp-c-piclib		picinstall,rump

Index: src/distrib/sets/lists/debug/mi
diff -u src/distrib/sets/lists/debug/mi:1.339 src/distrib/sets/lists/debug/mi:1.340
--- src/distrib/sets/lists/debug/mi:1.339	Sat Sep 26 17:49:50 2020
+++ src/distrib/sets/lists/debug/mi	Tue Sep 29 18:33:23 2020
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.339 2020/09/26 17:49:50 jmcneill Exp $
+# $NetBSD: mi,v 1.340 2020/09/29 18:33:23 roy Exp $
 ./etc/mtree/set.debug   comp-sys-root
 ./usr/lib	comp-sys-usr		compatdir
 ./usr/lib/i18n/libBIG5_g.a			comp-c-debuglib		debuglib,compatfile
@@ -236,6 +236,7 @@
 ./usr/lib/librumpnet_sockin_g.a			comp-c-debuglib		debuglib,rump
 ./usr/lib/librumpnet_tap_g.a			comp-c-debuglib		debuglib,rump
 ./usr/lib/librumpnet_tun_g.a			comp-c-debuglib		debuglib,rump
+./usr/lib/librumpnet_vether_g.a			comp-c-debuglib		debuglib,rump
 ./usr/lib/librumpnet_virtif_g.a			comp-c-debuglib		

CVS commit: src/usr.bin/make

2020-09-29 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Tue Sep 29 18:31:39 UTC 2020

Modified Files:
src/usr.bin/make: var.c

Log Message:
make(1): extract ApplyModifier from ApplyModifiers

This allows a return, instead of a variable assignment followed by a
break, saving a few lines of source code.

The size of the resulting binary shrinks as well, even though the code
is essentially the same as before.


To generate a diff of this commit:
cvs rdiff -u -r1.550 -r1.551 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/var.c
diff -u src/usr.bin/make/var.c:1.550 src/usr.bin/make/var.c:1.551
--- src/usr.bin/make/var.c:1.550	Mon Sep 28 22:23:35 2020
+++ src/usr.bin/make/var.c	Tue Sep 29 18:31:39 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: var.c,v 1.550 2020/09/28 22:23:35 rillig Exp $	*/
+/*	$NetBSD: var.c,v 1.551 2020/09/29 18:31:39 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -121,7 +121,7 @@
 #include"metachar.h"
 
 /*	"@(#)var.c	8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: var.c,v 1.550 2020/09/28 22:23:35 rillig Exp $");
+MAKE_RCSID("$NetBSD: var.c,v 1.551 2020/09/29 18:31:39 rillig Exp $");
 
 #define VAR_DEBUG1(fmt, arg1) DEBUG1(VAR, fmt, arg1)
 #define VAR_DEBUG2(fmt, arg1, arg2) DEBUG2(VAR, fmt, arg1, arg2)
@@ -3029,6 +3029,85 @@ LogAfterApply(ApplyModifiersState *st, c
 VarExprFlags_ToStringSpecs));
 }
 
+static ApplyModifierResult
+ApplyModifier(const char **pp, ApplyModifiersState *st)
+{
+switch (**pp) {
+case ':':
+	return ApplyModifier_Assign(pp, st);
+case '@':
+	return ApplyModifier_Loop(pp, st);
+case '_':
+	return ApplyModifier_Remember(pp, st);
+case 'D':
+case 'U':
+	return ApplyModifier_Defined(pp, st);
+case 'L':
+	ApplyModifiersState_Define(st);
+	st->newVal = bmake_strdup(st->v->name);
+	(*pp)++;
+	return AMR_OK;
+case 'P':
+	return ApplyModifier_Path(pp, st);
+case '!':
+	return ApplyModifier_ShellCommand(pp, st);
+case '[':
+	return ApplyModifier_Words(pp, st);
+case 'g':
+	return ApplyModifier_Gmtime(pp, st);
+case 'h':
+	return ApplyModifier_Hash(pp, st);
+case 'l':
+	return ApplyModifier_Localtime(pp, st);
+case 't':
+	return ApplyModifier_To(pp, st);
+case 'N':
+case 'M':
+	return ApplyModifier_Match(pp, st);
+case 'S':
+	return ApplyModifier_Subst(pp, st);
+case '?':
+	return ApplyModifier_IfElse(pp, st);
+#ifndef NO_REGEX
+case 'C':
+	return ApplyModifier_Regex(pp, st);
+#endif
+case 'q':
+case 'Q':
+	if ((*pp)[1] == st->endc || (*pp)[1] == ':') {
+	st->newVal = VarQuote(st->val, **pp == 'q');
+	(*pp)++;
+	return AMR_OK;
+	} else
+	return AMR_UNKNOWN;
+case 'T':
+	return ApplyModifier_WordFunc(pp, st, ModifyWord_Tail);
+case 'H':
+	return ApplyModifier_WordFunc(pp, st, ModifyWord_Head);
+case 'E':
+	return ApplyModifier_WordFunc(pp, st, ModifyWord_Suffix);
+case 'R':
+	return ApplyModifier_WordFunc(pp, st, ModifyWord_Root);
+case 'r':
+	return ApplyModifier_Range(pp, st);
+case 'O':
+	return ApplyModifier_Order(pp, st);
+case 'u':
+	if ((*pp)[1] == st->endc || (*pp)[1] == ':') {
+	st->newVal = VarUniq(st->val);
+	(*pp)++;
+	return AMR_OK;
+	} else
+	return AMR_UNKNOWN;
+#ifdef SUNSHCMD
+case 's':
+	return ApplyModifier_SunShell(pp, st);
+#endif
+default:
+	return AMR_UNKNOWN;
+}
+}
+
 /* Apply any modifiers (such as :Mpattern or :@var@loop@ or :Q or ::=value). */
 static char *
 ApplyModifiers(
@@ -3117,105 +3196,7 @@ ApplyModifiers(
 	if (DEBUG(VAR))
 	LogBeforeApply(, mod, endc);
 
-	switch (*mod) {
-	case ':':
-	res = ApplyModifier_Assign(, );
-	break;
-	case '@':
-	res = ApplyModifier_Loop(, );
-	break;
-	case '_':
-	res = ApplyModifier_Remember(, );
-	break;
-	case 'D':
-	case 'U':
-	res = ApplyModifier_Defined(, );
-	break;
-	case 'L':
-	ApplyModifiersState_Define();
-	st.newVal = bmake_strdup(st.v->name);
-	p++;
-	res = AMR_OK;
-	break;
-	case 'P':
-	res = ApplyModifier_Path(, );
-	break;
-	case '!':
-	res = ApplyModifier_ShellCommand(, );
-	break;
-	case '[':
-	res = ApplyModifier_Words(, );
-	break;
-	case 'g':
-	res = ApplyModifier_Gmtime(, );
-	break;
-	case 'h':
-	res = ApplyModifier_Hash(, );
-	break;
-	case 'l':
-	res = ApplyModifier_Localtime(, );
-	break;
-	case 't':
-	res = ApplyModifier_To(, );
-	break;
-	case 'N':
-	case 'M':
-	res = ApplyModifier_Match(, );
-	break;
-	case 'S':
-	res = ApplyModifier_Subst(, );
-	break;
-	case '?':
-	res = ApplyModifier_IfElse(, );
-	break;
-#ifndef NO_REGEX
-	case 'C':
-	res = ApplyModifier_Regex(, );
-	break;
-#endif
-	case 'q':
-	case 'Q':
-	if (p[1] == st.endc || p[1] == ':') {
-		st.newVal = VarQuote(st.val, *mod == 'q');
-		p++;
-		res = AMR_OK;
-	} 

CVS commit: src/sys/rump/net/lib/libtap

2020-09-29 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Tue Sep 29 18:31:31 UTC 2020

Modified Files:
src/sys/rump/net/lib/libtap: Makefile

Log Message:
libtap: Improve comment


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/rump/net/lib/libtap/Makefile

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

Modified files:

Index: src/sys/rump/net/lib/libtap/Makefile
diff -u src/sys/rump/net/lib/libtap/Makefile:1.5 src/sys/rump/net/lib/libtap/Makefile:1.6
--- src/sys/rump/net/lib/libtap/Makefile:1.5	Tue Jan 26 23:12:19 2016
+++ src/sys/rump/net/lib/libtap/Makefile	Tue Sep 29 18:31:31 2020
@@ -1,10 +1,10 @@
-#	$NetBSD: Makefile,v 1.5 2016/01/26 23:12:19 pooka Exp $
+#	$NetBSD: Makefile,v 1.6 2020/09/29 18:31:31 roy Exp $
 #
 
 .PATH:	${.CURDIR}/../../../../net
 
 LIB=	rumpnet_tap
-COMMENT=/dev/tap virtual Ethernet interface
+COMMENT=/dev/tap Ethernet tunnel software network interface
 
 IOCONF=	TAP.ioconf
 SRCS=	if_tap.c



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

2020-09-29 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Tue Sep 29 18:16:24 UTC 2020

Modified Files:
src/usr.bin/make/unit-tests: Makefile job-output-long-lines.exp
job-output-long-lines.mk

Log Message:
make(1): fix test job-output-long-lines

The test failed on Linux since the test relied on the two child
processes interleaving each other.  This is not guaranteed to happen
though.


To generate a diff of this commit:
cvs rdiff -u -r1.154 -r1.155 src/usr.bin/make/unit-tests/Makefile
cvs rdiff -u -r1.1 -r1.2 \
src/usr.bin/make/unit-tests/job-output-long-lines.exp \
src/usr.bin/make/unit-tests/job-output-long-lines.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.154 src/usr.bin/make/unit-tests/Makefile:1.155
--- src/usr.bin/make/unit-tests/Makefile:1.154	Sun Sep 27 20:11:34 2020
+++ src/usr.bin/make/unit-tests/Makefile	Tue Sep 29 18:16:24 2020
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.154 2020/09/27 20:11:34 rillig Exp $
+# $NetBSD: Makefile,v 1.155 2020/09/29 18:16:24 rillig Exp $
 #
 # Unit tests for make(1)
 #
@@ -385,6 +385,17 @@ FLAGS.varname-dot-shell= -dpv
 FLAGS.varname-empty=	-dv '$${:U}=cmdline-u' '=cmline-plain'
 
 # Some tests need extra postprocessing.
+SED_CMDS.job-output-long-lines= \
+	${:D Job separators on their own line are ok. } \
+	-e '/^--- job-[ab] ---$$/d' \
+	${:D Plain output lines are ok as well. } \
+	${:D They may come in multiples of 1024 or as 1. } \
+	-e '/^aa*$$/d' \
+	-e '/^bb*$$/d' \
+	${:D The following lines should rather not occur since the job } \
+	${:D marker should always be at the beginning of the line. } \
+	-e '/^aa*--- job-b ---$$/d' \
+	-e '/^bb*--- job-a ---$$/d'
 SED_CMDS.opt-debug-graph1= \
 			-e 's,${.CURDIR},CURDIR,'
 SED_CMDS.opt-debug-graph1+= \
@@ -404,8 +415,6 @@ SED_CMDS.varname-dot-shell+=	-e 's,\[/[^
 # Some tests need an additional round of postprocessing.
 POSTPROC.deptgt-suffixes= \
 			${TOOL_SED} -n -e '/^\#\*\*\* Suffixes/,/^\#\*/p'
-POSTPROC.job-output-long-lines= \
-			awk '/^[ab]+--- job-[ab] ---/ { print "bad"; exit }'
 POSTPROC.vardebug=	${TOOL_SED} -n -e '/:RELEVANT = yes/,/:RELEVANT = no/p'
 POSTPROC.varmod-match-escape= ${TOOL_SED} -n -e '/^Pattern/p'
 POSTPROC.varname=	${TOOL_SED} -n -e '/^MAGIC/p' -e '/^ORDER_/p'

Index: src/usr.bin/make/unit-tests/job-output-long-lines.exp
diff -u src/usr.bin/make/unit-tests/job-output-long-lines.exp:1.1 src/usr.bin/make/unit-tests/job-output-long-lines.exp:1.2
--- src/usr.bin/make/unit-tests/job-output-long-lines.exp:1.1	Sun Sep 27 20:11:34 2020
+++ src/usr.bin/make/unit-tests/job-output-long-lines.exp	Tue Sep 29 18:16:24 2020
@@ -1,2 +1 @@
-bad
 exit status 0
Index: src/usr.bin/make/unit-tests/job-output-long-lines.mk
diff -u src/usr.bin/make/unit-tests/job-output-long-lines.mk:1.1 src/usr.bin/make/unit-tests/job-output-long-lines.mk:1.2
--- src/usr.bin/make/unit-tests/job-output-long-lines.mk:1.1	Sun Sep 27 20:11:34 2020
+++ src/usr.bin/make/unit-tests/job-output-long-lines.mk	Tue Sep 29 18:16:24 2020
@@ -1,4 +1,4 @@
-# $NetBSD: job-output-long-lines.mk,v 1.1 2020/09/27 20:11:34 rillig Exp $
+# $NetBSD: job-output-long-lines.mk,v 1.2 2020/09/29 18:16:24 rillig Exp $
 #
 # The jobs may produce long lines of output.  A practical case are the echoed
 # command lines from compiler invocations, with their many -D options.
@@ -13,10 +13,6 @@
 # markers "--- job-a ---" and "--- job-b ---" are not always written at the
 # beginning of a line, even though this is expected by anyone reading the log
 # files.
-#
-# See Makefile, POSTPROC.job-output-long-lines for the output postprocessing.
-#
-# Tags: probabilistic
 
 .MAKEFLAGS: -j2
 



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

2020-09-29 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Sep 29 18:13:29 UTC 2020

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

Log Message:
Fix RPI (armv6) build


To generate a diff of this commit:
cvs rdiff -u -r1.83 -r1.84 src/sys/arch/arm/include/cpufunc.h

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

Modified files:

Index: src/sys/arch/arm/include/cpufunc.h
diff -u src/sys/arch/arm/include/cpufunc.h:1.83 src/sys/arch/arm/include/cpufunc.h:1.84
--- src/sys/arch/arm/include/cpufunc.h:1.83	Sat Sep 26 12:58:22 2020
+++ src/sys/arch/arm/include/cpufunc.h	Tue Sep 29 18:13:29 2020
@@ -44,6 +44,7 @@
 
 #define	isb()		__asm __volatile("isb" : : : "memory")
 
+#ifdef _ARM_ARCH_7
 /*
  * Options for DMB and DSB:
  *	oshld	Outer Shareable, load
@@ -61,6 +62,14 @@
  */
 #define	dsb(opt)	__asm __volatile("dsb " __STRING(opt) : : : "memory")
 #define	dmb(opt)	__asm __volatile("dmb " __STRING(opt) : : : "memory")
+#else
+
+#define dsb(opt)	\
+	__asm __volatile("mcr p15, 0, %0, c7, c10, 4" :: "r" (0) : "memory")
+#define dmb(opt)	\
+	__asm __volatile("mcr p15, 0, %0, c7, c10, 5" :: "r" (0) : "memory")
+
+#endif
 
 #ifdef __arm__
 



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

2020-09-29 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Tue Sep 29 16:35:42 UTC 2020

Modified Files:
src/tests/libexec/ld.elf_so: t_rtld_r_debug.c

Log Message:
Whitespace


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

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

Modified files:

Index: src/tests/libexec/ld.elf_so/t_rtld_r_debug.c
diff -u src/tests/libexec/ld.elf_so/t_rtld_r_debug.c:1.2 src/tests/libexec/ld.elf_so/t_rtld_r_debug.c:1.3
--- src/tests/libexec/ld.elf_so/t_rtld_r_debug.c:1.2	Tue Sep 29 16:34:07 2020
+++ src/tests/libexec/ld.elf_so/t_rtld_r_debug.c	Tue Sep 29 16:35:42 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_rtld_r_debug.c,v 1.2 2020/09/29 16:34:07 roy Exp $	*/
+/*	$NetBSD: t_rtld_r_debug.c,v 1.3 2020/09/29 16:35:42 roy Exp $	*/
 
 /*
  * Copyright (c) 2020 The NetBSD Foundation, Inc.
@@ -42,7 +42,7 @@ getauxval(unsigned int type)
 	const AuxInfo *aux;
 
 	for (aux = _dlauxinfo(); aux->a_type != AT_NULL; ++aux) {
-		if (type == aux->a_type)  
+		if (type == aux->a_type)
 			return aux->a_v;
 	}
 
@@ -67,11 +67,11 @@ get_dynamic_section(void)
 	dynphdr = NULL;
 
 	for (; phdr < phlimit; ++phdr) {
-if (phdr->p_type == PT_DYNAMIC)
-dynphdr = phdr;   
-if (phdr->p_type == PT_PHDR)
-relocbase = (uintptr_t)phdr - phdr->p_vaddr;
-}
+		if (phdr->p_type == PT_DYNAMIC)
+			dynphdr = phdr;
+		if (phdr->p_type == PT_PHDR)
+			relocbase = (uintptr_t)phdr - phdr->p_vaddr;
+	}
 
 	return (Elf_Dyn *)((uint8_t *)dynphdr->p_vaddr + relocbase);
 }



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

2020-09-29 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Tue Sep 29 16:34:08 UTC 2020

Modified Files:
src/tests/libexec/ld.elf_so: t_rtld_r_debug.c

Log Message:
Fix build with clang.


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

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

Modified files:

Index: src/tests/libexec/ld.elf_so/t_rtld_r_debug.c
diff -u src/tests/libexec/ld.elf_so/t_rtld_r_debug.c:1.1 src/tests/libexec/ld.elf_so/t_rtld_r_debug.c:1.2
--- src/tests/libexec/ld.elf_so/t_rtld_r_debug.c:1.1	Tue Sep 22 01:09:32 2020
+++ src/tests/libexec/ld.elf_so/t_rtld_r_debug.c	Tue Sep 29 16:34:07 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_rtld_r_debug.c,v 1.1 2020/09/22 01:09:32 kamil Exp $	*/
+/*	$NetBSD: t_rtld_r_debug.c,v 1.2 2020/09/29 16:34:07 roy Exp $	*/
 
 /*
  * Copyright (c) 2020 The NetBSD Foundation, Inc.
@@ -79,7 +79,7 @@ get_dynamic_section(void)
 static struct r_debug *
 get_rtld_r_debug(void)
 {
-	struct r_debug *debug;
+	struct r_debug *debug = NULL;
 	Elf_Dyn *dynp;
 
 	for (dynp = get_dynamic_section(); dynp->d_tag != DT_NULL; dynp++) {



CVS commit: src/usr.sbin/sysinst

2020-09-29 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Sep 29 15:29:17 UTC 2020

Modified Files:
src/usr.sbin/sysinst: bsddisklabel.c disklabel.c mbr.c partitions.h

Log Message:
Apply patch provided by Izumi Tsutsui in PR 55382: make ext2 partitions
show up in the outer (MBR) partition table, needed for example on Cobalt
where firmware boots from that partition.


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.45 src/usr.sbin/sysinst/bsddisklabel.c
cvs rdiff -u -r1.38 -r1.39 src/usr.sbin/sysinst/disklabel.c
cvs rdiff -u -r1.32 -r1.33 src/usr.sbin/sysinst/mbr.c
cvs rdiff -u -r1.15 -r1.16 src/usr.sbin/sysinst/partitions.h

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

Modified files:

Index: src/usr.sbin/sysinst/bsddisklabel.c
diff -u src/usr.sbin/sysinst/bsddisklabel.c:1.44 src/usr.sbin/sysinst/bsddisklabel.c:1.45
--- src/usr.sbin/sysinst/bsddisklabel.c:1.44	Mon Sep 28 18:13:25 2020
+++ src/usr.sbin/sysinst/bsddisklabel.c	Tue Sep 29 15:29:17 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: bsddisklabel.c,v 1.44 2020/09/28 18:13:25 martin Exp $	*/
+/*	$NetBSD: bsddisklabel.c,v 1.45 2020/09/29 15:29:17 martin Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -76,7 +76,7 @@ default_parts_init[] =
 #endif
 #ifdef PART_BOOT_TYPE
 	  .fs_type = PART_BOOT_TYPE,
-#if PART_BOOT_TYPE == FS_MSDOS
+#if (PART_BOOT_TYPE == FS_MSDOS) || (PART_BOOT_TYPE == FS_EX2FS)
 	  .flags = PUIFLAG_ADD_OUTER,
 #endif
 #endif
@@ -100,7 +100,7 @@ default_parts_init[] =
 #endif
 #ifdef PART_BOOT1_TYPE
 	  .fs_type = PART_BOOT1_TYPE,
-#if PART_BOOT1_TYPE == FS_MSDOS
+#if (PART_BOOT1_TYPE == FS_MSDOS) || (PART_BOOT1_TYPE == FS_EX2FS)
 	  .flags = PUIFLAG_ADD_OUTER,
 #endif
 #endif
@@ -119,7 +119,7 @@ default_parts_init[] =
 #endif
 #ifdef PART_BOOT2_TYPE
 	  .fs_type = PART_BOOT2_TYPE,
-#if PART_BOOT2_TYPE == FS_MSDOS
+#if (PART_BOOT2_TYPE == FS_MSDOS) || (PART_BOOT2_TYPE == FS_EX2FS)
 	  .flags = PUIFLAG_ADD_OUTER,
 #endif
 #endif
@@ -974,7 +974,8 @@ fill_defaults(struct partition_usage_set
 wanted->infos[i].type = pt->generic_ptype;
 		}
 		if (wanted->parts->parent != NULL &&
-		wanted->infos[i].fs_type == FS_MSDOS)
+		(wanted->infos[i].fs_type == FS_MSDOS ||
+		 wanted->infos[i].fs_type == FS_EX2FS))
 			wanted->infos[i].flags |=
 			PUIFLG_ADD_INNER|PUIFLAG_ADD_OUTER;
 
@@ -1021,8 +1022,8 @@ fill_defaults(struct partition_usage_set
 	 * empty disk. Merge the partitions in target range that are already
 	 * there (match with wanted) or are there additionaly.
 	 * The only thing outside of target range that we care for
-	 * are FAT partitions and a potential swap partition - we assume one
-	 * is enough.
+	 * are FAT partitions, EXT2FS partitions, and a potential
+	 * swap partition - we assume one is enough.
 	 */
 	size_t num = wanted->num;
 	if (parts->parent) {
@@ -1033,7 +1034,8 @@ fill_defaults(struct partition_usage_set
 			parts->parent, pno, ))
 continue;
 			if (info.nat_type->generic_ptype != PT_swap &&
-			info.fs_type != FS_MSDOS)
+			info.fs_type != FS_MSDOS &&
+			info.fs_type != FS_EX2FS)
 continue;
 			merge_part_with_wanted(parts->parent, pno, ,
 			wanted, num, true);

Index: src/usr.sbin/sysinst/disklabel.c
diff -u src/usr.sbin/sysinst/disklabel.c:1.38 src/usr.sbin/sysinst/disklabel.c:1.39
--- src/usr.sbin/sysinst/disklabel.c:1.38	Mon Sep 28 18:40:23 2020
+++ src/usr.sbin/sysinst/disklabel.c	Tue Sep 29 15:29:17 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: disklabel.c,v 1.38 2020/09/28 18:40:23 martin Exp $	*/
+/*	$NetBSD: disklabel.c,v 1.39 2020/09/29 15:29:17 martin Exp $	*/
 
 /*
  * Copyright 2018 The NetBSD Foundation, Inc.
@@ -582,6 +582,9 @@ dl_init_types(void)
 pt = PT_root; break;
 		case FS_SWAP:	pt = PT_swap; break;
 		case FS_MSDOS:	pt = PT_FAT; break;
+		case FS_EX2FS:	pt = PT_EXT2; break;
+		case FS_SYSVBFS:
+pt = PT_SYSVBFS; break;
 		default:	pt = PT_unknown; break;
 		}
 		dl_types[i].generic_ptype = pt;
@@ -707,6 +710,9 @@ disklabel_get_generic_type(enum part_typ
 	case PT_FAT:
 	case PT_EFI_SYSTEM:
 			nt = FS_MSDOS; break;
+	case PT_EXT2:	nt = FS_EX2FS; break;
+	case PT_SYSVBFS:
+			nt = FS_SYSVBFS; break;
 	default:	nt = FS_UNUSED; break;
 	}
 

Index: src/usr.sbin/sysinst/mbr.c
diff -u src/usr.sbin/sysinst/mbr.c:1.32 src/usr.sbin/sysinst/mbr.c:1.33
--- src/usr.sbin/sysinst/mbr.c:1.32	Wed Apr 22 23:43:12 2020
+++ src/usr.sbin/sysinst/mbr.c	Tue Sep 29 15:29:17 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: mbr.c,v 1.32 2020/04/22 23:43:12 joerg Exp $ */
+/*	$NetBSD: mbr.c,v 1.33 2020/09/29 15:29:17 martin Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -1117,6 +1117,8 @@ mbr_map_part_type(unsigned int t)
 		return PT_FAT;
 	case MBR_PTYPE_EFI:
 		return PT_EFI_SYSTEM;
+	case MBR_PTYPE_LNXEXT2:
+		return PT_EXT2;
 	case MBR_PTYPE_NETBSD:
 		return PT_root;
 	}
@@ -1279,6 +1281,8 @@ mbr_get_generic_part_type(enum part_type
 		return 

CVS commit: src/usr.sbin/sysinst

2020-09-29 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Sep 29 14:29:56 UTC 2020

Modified Files:
src/usr.sbin/sysinst: defs.h label.c part_edit.c

Log Message:
PR 55381: try to deal with moved (but not yet saved) partitions when
calculating free space


To generate a diff of this commit:
cvs rdiff -u -r1.63 -r1.64 src/usr.sbin/sysinst/defs.h
cvs rdiff -u -r1.24 -r1.25 src/usr.sbin/sysinst/label.c
cvs rdiff -u -r1.16 -r1.17 src/usr.sbin/sysinst/part_edit.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.sbin/sysinst/defs.h
diff -u src/usr.sbin/sysinst/defs.h:1.63 src/usr.sbin/sysinst/defs.h:1.64
--- src/usr.sbin/sysinst/defs.h:1.63	Tue Sep 22 16:18:54 2020
+++ src/usr.sbin/sysinst/defs.h	Tue Sep 29 14:29:56 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: defs.h,v 1.63 2020/09/22 16:18:54 martin Exp $	*/
+/*	$NetBSD: defs.h,v 1.64 2020/09/29 14:29:56 martin Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -737,8 +737,8 @@ void	canonicalize_last_mounted(char*);
 int	edit_and_check_label(struct pm_devs *p, struct partition_usage_set *pset, bool install);
 int edit_ptn(menudesc *, void *);
 int checkoverlap(struct disk_partitions *parts);
-daddr_t getpartsize(struct disk_partitions *parts, daddr_t partstart,
-daddr_t defpartsize);
+daddr_t getpartsize(struct disk_partitions *parts, daddr_t orig_start,
+daddr_t partstart, daddr_t defpartsize);
 daddr_t getpartoff(struct disk_partitions *parts, daddr_t defpartstart);
 
 /* from install.c */

Index: src/usr.sbin/sysinst/label.c
diff -u src/usr.sbin/sysinst/label.c:1.24 src/usr.sbin/sysinst/label.c:1.25
--- src/usr.sbin/sysinst/label.c:1.24	Tue Sep 22 16:18:54 2020
+++ src/usr.sbin/sysinst/label.c	Tue Sep 29 14:29:56 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: label.c,v 1.24 2020/09/22 16:18:54 martin Exp $	*/
+/*	$NetBSD: label.c,v 1.25 2020/09/29 14:29:56 martin Exp $	*/
 
 /*
  * Copyright 1997 Jonathan Stone
@@ -36,7 +36,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: label.c,v 1.24 2020/09/22 16:18:54 martin Exp $");
+__RCSID("$NetBSD: label.c,v 1.25 2020/09/29 14:29:56 martin Exp $");
 #endif
 
 #include 
@@ -291,10 +291,15 @@ static int
 edit_fs_size(menudesc *m, void *arg)
 {
 	struct single_part_fs_edit *edit = arg;
+	struct disk_part_info pinfo;
 	daddr_t size;
 
-	size = getpartsize(edit->pset->parts, edit->info.start,
-	edit->info.size);
+	/* get original partition data, in case start moved already */
+	edit->pset->parts->pscheme->get_part_info(edit->pset->parts,
+	edit->id, );
+	/* ask for new size with old start and current values */
+	size = getpartsize(edit->pset->parts, pinfo.start,
+	edit->info.start, edit->info.size);
 	if (size < 0)
 		return 0;
 	if (size > edit->pset->parts->disk_size)
@@ -2040,7 +2045,8 @@ getpartoff(struct disk_partitions *parts
 
 /* Ask for a partition size, check bounds and do the needed roundups */
 daddr_t
-getpartsize(struct disk_partitions *parts, daddr_t partstart, daddr_t dflt)
+getpartsize(struct disk_partitions *parts, daddr_t orig_start,
+daddr_t partstart, daddr_t dflt)
 {
 	char dsize[24], isize[24], max_size[24], maxpartc, valid_parts[4],
 	*label_msg, *prompt, *head, *hint, *tail;
@@ -2050,7 +2056,10 @@ getpartsize(struct disk_partitions *part
 	part_id partn;
 
 	diskend = parts->disk_start + parts->disk_size;
-	max = parts->pscheme->max_free_space_at(parts, partstart);
+	max = parts->pscheme->max_free_space_at(parts, orig_start);
+	max += orig_start - partstart;
+	if (sizemult == 1)
+		max--;	/* with hugher scale proper rounding later will be ok */
 
 	/* We need to keep both the unrounded and rounded (_r) max and dflt */
 	dflt_r = (partstart + dflt) / sizemult - partstart / sizemult;

Index: src/usr.sbin/sysinst/part_edit.c
diff -u src/usr.sbin/sysinst/part_edit.c:1.16 src/usr.sbin/sysinst/part_edit.c:1.17
--- src/usr.sbin/sysinst/part_edit.c:1.16	Mon Jan 27 21:21:22 2020
+++ src/usr.sbin/sysinst/part_edit.c	Tue Sep 29 14:29:56 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: part_edit.c,v 1.16 2020/01/27 21:21:22 martin Exp $ */
+/*	$NetBSD: part_edit.c,v 1.17 2020/09/29 14:29:56 martin Exp $ */
 
 /*
  * Copyright (c) 2019 The NetBSD Foundation, Inc.
@@ -211,11 +211,14 @@ static int
 edit_part_start(menudesc *m, void *arg)
 {
 	struct part_edit_info *marg = arg;
+	struct disk_part_info pinfo;
 	daddr_t max_size;
 
+	marg->parts->pscheme->get_part_info(marg->parts, marg->cur_id, );
 	marg->cur.start = getpartoff(marg->parts, marg->cur.start);
 	max_size = marg->parts->pscheme->max_free_space_at(marg->parts,
-	marg->cur.start);
+	pinfo.start);
+	max_size += pinfo.start - marg->cur.start;
 	if (marg->cur.size > max_size)
 		marg->cur.size = max_size;
 
@@ -226,9 +229,11 @@ static int
 edit_part_size(menudesc *m, void *arg)
 {
 	struct part_edit_info *marg = arg;
+	struct disk_part_info pinfo;
 
-	marg->cur.size = getpartsize(marg->parts, 

CVS commit: src/usr.sbin/syslogd

2020-09-29 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Tue Sep 29 14:08:43 UTC 2020

Modified Files:
src/usr.sbin/syslogd: syslogd.c

Log Message:
When reporting an error before daemonizing, prefix the error message
with the program name.


To generate a diff of this commit:
cvs rdiff -u -r1.132 -r1.133 src/usr.sbin/syslogd/syslogd.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.sbin/syslogd/syslogd.c
diff -u src/usr.sbin/syslogd/syslogd.c:1.132 src/usr.sbin/syslogd/syslogd.c:1.133
--- src/usr.sbin/syslogd/syslogd.c:1.132	Thu Dec 26 04:53:12 2019
+++ src/usr.sbin/syslogd/syslogd.c	Tue Sep 29 14:08:43 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: syslogd.c,v 1.132 2019/12/26 04:53:12 msaitoh Exp $	*/
+/*	$NetBSD: syslogd.c,v 1.133 2020/09/29 14:08:43 gson Exp $	*/
 
 /*
  * Copyright (c) 1983, 1988, 1993, 1994
@@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1983, 19
 #if 0
 static char sccsid[] = "@(#)syslogd.c	8.3 (Berkeley) 4/4/94";
 #else
-__RCSID("$NetBSD: syslogd.c,v 1.132 2019/12/26 04:53:12 msaitoh Exp $");
+__RCSID("$NetBSD: syslogd.c,v 1.133 2020/09/29 14:08:43 gson Exp $");
 #endif
 #endif /* not lint */
 
@@ -2881,7 +2881,7 @@ logerror(const char *fmt, ...)
 	if (!daemonized && Debug)
 		DPRINTF(D_MISC, "%s\n", outbuf);
 	if (!daemonized && !Debug)
-		printf("%s\n", outbuf);
+		printf("%s: %s\n", getprogname(), outbuf);
 
 	logerror_running = 0;
 }



CVS commit: src/usr.bin/xinstall

2020-09-29 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Tue Sep 29 12:04:48 UTC 2020

Modified Files:
src/usr.bin/xinstall: Makefile

Log Message:
xinstall: define MAKE_NATIVE so our make parts compile


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/usr.bin/xinstall/Makefile

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/xinstall/Makefile
diff -u src/usr.bin/xinstall/Makefile:1.27 src/usr.bin/xinstall/Makefile:1.28
--- src/usr.bin/xinstall/Makefile:1.27	Mon Sep  7 00:26:24 2020
+++ src/usr.bin/xinstall/Makefile	Tue Sep 29 12:04:48 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.27 2020/09/07 00:26:24 mrg Exp $
+#	$NetBSD: Makefile,v 1.28 2020/09/29 12:04:48 roy Exp $
 #	@(#)Makefile	8.1 (Berkeley) 6/6/93
 
 .include 
@@ -9,6 +9,7 @@ MAN=	install.1
 
 .PATH:		${NETBSDSRCDIR}/usr.bin/make
 CPPFLAGS+=	-I${NETBSDSRCDIR}/usr.bin/make
+CPPFLAGS+=	-DMAKE_NATIVE
 
 .PATH:		${NETBSDSRCDIR}/usr.sbin/mtree
 CPPFLAGS+=	-I${NETBSDSRCDIR}/usr.sbin/mtree



CVS commit: src/sbin/ifconfig

2020-09-29 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Sep 29 08:52:11 UTC 2020

Modified Files:
src/sbin/ifconfig: ifconfig.8

Log Message:
Add [-]eee and [-]vlan-hwfilter.


To generate a diff of this commit:
cvs rdiff -u -r1.120 -r1.121 src/sbin/ifconfig/ifconfig.8

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

Modified files:

Index: src/sbin/ifconfig/ifconfig.8
diff -u src/sbin/ifconfig/ifconfig.8:1.120 src/sbin/ifconfig/ifconfig.8:1.121
--- src/sbin/ifconfig/ifconfig.8:1.120	Wed Sep 23 02:09:18 2020
+++ src/sbin/ifconfig/ifconfig.8	Tue Sep 29 08:52:11 2020
@@ -1,4 +1,4 @@
-.\"	$NetBSD: ifconfig.8,v 1.120 2020/09/23 02:09:18 roy Exp $
+.\"	$NetBSD: ifconfig.8,v 1.121 2020/09/29 08:52:11 msaitoh Exp $
 .\"
 .\" Copyright (c) 1983, 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -29,7 +29,7 @@
 .\"
 .\" @(#)ifconfig.8	8.4 (Berkeley) 6/1/94
 .\"
-.Dd September 23, 2020
+.Dd September 29, 2020
 .Dt IFCONFIG 8
 .Os
 .Sh NAME
@@ -614,6 +614,10 @@ Remove
 from the
 .Xr agr 4
 interface.
+.It Cm eee
+Enable IEEE 802.3az Energy Efficiency Ethernet function.
+.It Cm -eee
+Disable IEEE 802.3az Energy Efficiency Ethernet function.
 .It Cm vltime Ar n
 .Pq inet6 only
 Set valid lifetime for the address.
@@ -699,6 +703,10 @@ support it.
 .It Cm -tso6
 Disable hardware-assisted TCP/IPv6 segmentation on interfaces that
 support it.
+.It Cm vlan-hwfilter
+Enable hardware-assisted VLAN frame filter on interfaces that support it.
+.It Cm -vlan-hwfilter
+Disable hardware-assisted VLAN frame filter on interfaces that support it.
 .It Cm vlan-hwtagging
 Enable hardware-assisted VLAN tag insertion/removal on interfaces that
 support it.



CVS commit: src/sys/kern

2020-09-29 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Tue Sep 29 07:51:01 UTC 2020

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

Log Message:
Log a message when a process blocks due to a lack of entropy.
Discussed on tech-kern.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/kern/kern_entropy.c

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

Modified files:

Index: src/sys/kern/kern_entropy.c
diff -u src/sys/kern/kern_entropy.c:1.23 src/sys/kern/kern_entropy.c:1.24
--- src/sys/kern/kern_entropy.c:1.23	Fri Aug 14 00:53:16 2020
+++ src/sys/kern/kern_entropy.c	Tue Sep 29 07:51:01 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_entropy.c,v 1.23 2020/08/14 00:53:16 riastradh Exp $	*/
+/*	$NetBSD: kern_entropy.c,v 1.24 2020/09/29 07:51:01 gson Exp $	*/
 
 /*-
  * Copyright (c) 2019 The NetBSD Foundation, Inc.
@@ -75,7 +75,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_entropy.c,v 1.23 2020/08/14 00:53:16 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_entropy.c,v 1.24 2020/09/29 07:51:01 gson Exp $");
 
 #include 
 #include 
@@ -1297,6 +1297,9 @@ entropy_extract(void *buf, size_t len, i
 
 		/* Wait for some entropy to come in and try again.  */
 		KASSERT(E->stage >= ENTROPY_WARM);
+		printf("entropy: pid %d (%s) blocking due to lack of entropy\n",
+		   curproc->p_pid, curproc->p_comm);
+
 		if (ISSET(flags, ENTROPY_SIG)) {
 			error = cv_wait_sig(>cv, >lock);
 			if (error)