CVS commit: src/sys/external/bsd/drm2/dist/drm/i915

2020-10-30 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Sat Oct 31 04:05:42 UTC 2020

Modified Files:
src/sys/external/bsd/drm2/dist/drm/i915: intel_sprite.c

Log Message:
Match linux here and wait without interrupts.

>From David H. Gutteridge in PR port-amd64/5
There's a second part to the patch, but "make our code behave the way
the upstream code does" is very welcome.
Also PR kern/54515 and possibly others.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 \
src/sys/external/bsd/drm2/dist/drm/i915/intel_sprite.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/external/bsd/drm2/dist/drm/i915/intel_sprite.c
diff -u src/sys/external/bsd/drm2/dist/drm/i915/intel_sprite.c:1.10 src/sys/external/bsd/drm2/dist/drm/i915/intel_sprite.c:1.11
--- src/sys/external/bsd/drm2/dist/drm/i915/intel_sprite.c:1.10	Fri Feb 14 04:36:12 2020
+++ src/sys/external/bsd/drm2/dist/drm/i915/intel_sprite.c	Sat Oct 31 04:05:42 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: intel_sprite.c,v 1.10 2020/02/14 04:36:12 riastradh Exp $	*/
+/*	$NetBSD: intel_sprite.c,v 1.11 2020/10/31 04:05:42 maya Exp $	*/
 
 /*
  * Copyright © 2011 Intel Corporation
@@ -32,7 +32,7 @@
  * support.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: intel_sprite.c,v 1.10 2020/02/14 04:36:12 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: intel_sprite.c,v 1.11 2020/10/31 04:05:42 maya Exp $");
 
 #include 
 #include 
@@ -124,7 +124,7 @@ void intel_pipe_update_start(struct inte
 	trace_i915_pipe_update_start(crtc);
 
 #ifdef __NetBSD__
-	DRM_SPIN_TIMED_WAIT_UNTIL(ret, wq, >vbl_lock, timeout,
+	DRM_SPIN_TIMED_WAIT_NOINTR_UNTIL(ret, wq, >vbl_lock, timeout,
 	(scanline = intel_get_crtc_scanline(crtc),
 		scanline < min || scanline > max));
 	if (ret <= 0)



CVS commit: src

2020-10-30 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Oct 31 01:08:32 UTC 2020

Modified Files:
src/lib/libc/sys: kqueue.2
src/sys/kern: kern_event.c
src/sys/sys: event.h
src/tests/lib/libc/sys: t_kevent.c

Log Message:
PR/55663: Ruslan Nikolaev: Add support for EVFILT_USER in kqueue(2)


To generate a diff of this commit:
cvs rdiff -u -r1.50 -r1.51 src/lib/libc/sys/kqueue.2
cvs rdiff -u -r1.107 -r1.108 src/sys/kern/kern_event.c
cvs rdiff -u -r1.38 -r1.39 src/sys/sys/event.h
cvs rdiff -u -r1.8 -r1.9 src/tests/lib/libc/sys/t_kevent.c

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

Modified files:

Index: src/lib/libc/sys/kqueue.2
diff -u src/lib/libc/sys/kqueue.2:1.50 src/lib/libc/sys/kqueue.2:1.51
--- src/lib/libc/sys/kqueue.2:1.50	Sun Dec 22 20:46:09 2019
+++ src/lib/libc/sys/kqueue.2	Fri Oct 30 21:08:31 2020
@@ -1,4 +1,4 @@
-.\"	$NetBSD: kqueue.2,v 1.50 2019/12/23 01:46:09 kamil Exp $
+.\"	$NetBSD: kqueue.2,v 1.51 2020/10/31 01:08:31 christos Exp $
 .\"
 .\" Copyright (c) 2000 Jonathan Lemon
 .\" All rights reserved.
@@ -32,7 +32,7 @@
 .\"
 .\" $FreeBSD: src/lib/libc/sys/kqueue.2,v 1.22 2001/06/27 19:55:57 dd Exp $
 .\"
-.Dd December 22, 2019
+.Dd October 30, 2020
 .Dt KQUEUE 2
 .Os
 .Sh NAME
@@ -54,7 +54,9 @@
 .Fn kevent "int kq" "const struct kevent *changelist" "size_t nchanges" "struct kevent *eventlist" "size_t nevents" "const struct timespec *timeout"
 .Fn EV_SET "" ident filter flags fflags data udata
 .Sh DESCRIPTION
+The
 .Fn kqueue
+system call
 provides a generic method of notifying the user when an event
 happens or a condition holds, based on the results of small
 pieces of kernel code termed filters.
@@ -80,12 +82,14 @@ Calling
 .Xr close 2
 on a file descriptor will remove any kevents that reference the descriptor.
 .Pp
+The
 .Fn kqueue
+system call
 creates a new kernel event queue and returns a descriptor.
 .Pp
 The
 .Fn kqueue1
-function also allows to set the following
+system call also allows to set the following
 .Fa flags
 on the returned file descriptor:
 .Bl -column O_NONBLOCK -offset indent
@@ -109,10 +113,14 @@ The queue is not inherited by a child cr
 .\" flag, then the descriptor table is shared,
 .\" which will allow sharing of the kqueue between two processes.
 .Pp
+The
 .Fn kevent
+system call
 is used to register events with the queue, and return any pending
 events to the user.
+The
 .Fa changelist
+argument
 is a pointer to an array of
 .Va kevent
 structures, as defined in
@@ -120,14 +128,28 @@ structures, as defined in
 All changes contained in the
 .Fa changelist
 are applied before any pending events are read from the queue.
+The
 .Fa nchanges
+argument
 gives the size of
 .Fa changelist .
+The
 .Fa eventlist
+argument
 is a pointer to an array of kevent structures.
+The 
 .Fa nevents
+argument
 determines the size of
 .Fa eventlist .
+When
+.Fa nevents
+is zero,
+.Fn kevent
+will return immediately even if there is a
+.Fa timeout
+specified unlike
+.Xr select 2 .
 If
 .Fa timeout
 is a
@@ -154,8 +176,9 @@ The same array may be used for the
 and
 .Fa eventlist .
 .Pp
+The
 .Fn EV_SET
-is a macro which is provided for ease of initializing a kevent structure.
+macro is provided for ease of initializing a kevent structure.
 This macro does not evaluate its parameters multiple times.
 .Pp
 The
@@ -175,22 +198,22 @@ struct kevent {
 The fields of
 .Fa struct kevent
 are:
-.Bl -tag -width XXXfilter -offset indent
+.Bl -tag -width "Fa filter" -offset indent
 .It ident
 Value used to identify this event.
 The exact interpretation is determined by the attached filter,
 but often is a file descriptor.
-.It filter
+.It Fa filter
 Identifies the kernel filter used to process this event.
 There are pre-defined system filters (which are described below), and
 other filters may be added by kernel subsystems as necessary.
-.It flags
+.It Fa flags
 Actions to perform on the event.
-.It fflags
+.It Fa fflags
 Filter-specific flags.
-.It data
+.It Fa data
 Filter-specific data value.
-.It udata
+.It Fa udata
 Opaque user-defined value passed through the kernel unchanged.
 .El
 .Pp
@@ -231,6 +254,11 @@ to always be returned.
 When a filter is successfully added the
 .Va data
 field will be zero.
+Note that if this flag is encountered and there is no remaining space in
+.Fa eventlist
+to hold the
+.Dv EV_ERROR
+event, then subsequent changes will not get processed.
 .It Dv EV_ONESHOT
 Causes the event to return only the first occurrence of the filter
 being triggered.
@@ -289,6 +317,7 @@ struct kfilter_mapping {
 };
 .Ed
 .Pp
+The predefined system filters are listed below.
 Arguments may be passed to and from the filter via the
 .Va fflags
 and
@@ -339,6 +368,14 @@ Returns when the file pointer is not at 
 .Va data
 contains the offset from current position to end of file,
 and may be negative.
+.\" .Pp
+.\" This behavior is different from
+.\" .Xr poll 2 ,
+.\" where read events 

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

2020-10-30 Thread Simon J. Gerraty
Module Name:src
Committed By:   sjg
Date:   Fri Oct 30 23:54:42 UTC 2020

Modified Files:
src/usr.bin/make/unit-tests: directive-unexport.exp
directive-unexport.mk

Log Message:
Fix directive-unexport to focus only on the variables we care about


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/usr.bin/make/unit-tests/directive-unexport.exp
cvs rdiff -u -r1.3 -r1.4 src/usr.bin/make/unit-tests/directive-unexport.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/directive-unexport.exp
diff -u src/usr.bin/make/unit-tests/directive-unexport.exp:1.2 src/usr.bin/make/unit-tests/directive-unexport.exp:1.3
--- src/usr.bin/make/unit-tests/directive-unexport.exp:1.2	Fri Oct 30 17:55:10 2020
+++ src/usr.bin/make/unit-tests/directive-unexport.exp	Fri Oct 30 23:54:42 2020
@@ -1,5 +1,5 @@
-make: "directive-unexport.mk" line 14: A=a B=b C=c
-make: "directive-unexport.mk" line 15: A B C
-make: "directive-unexport.mk" line 23: A=a B=b C=c
+make: "directive-unexport.mk" line 14: UT_A=a UT_B=b UT_C=c
+make: "directive-unexport.mk" line 15: UT_A UT_B UT_C
+make: "directive-unexport.mk" line 23: UT_A=a UT_B=b UT_C=c
 make: "directive-unexport.mk" line 24: 
 exit status 0

Index: src/usr.bin/make/unit-tests/directive-unexport.mk
diff -u src/usr.bin/make/unit-tests/directive-unexport.mk:1.3 src/usr.bin/make/unit-tests/directive-unexport.mk:1.4
--- src/usr.bin/make/unit-tests/directive-unexport.mk:1.3	Fri Oct 30 17:55:10 2020
+++ src/usr.bin/make/unit-tests/directive-unexport.mk	Fri Oct 30 23:54:42 2020
@@ -1,17 +1,17 @@
-# $NetBSD: directive-unexport.mk,v 1.3 2020/10/30 17:55:10 rillig Exp $
+# $NetBSD: directive-unexport.mk,v 1.4 2020/10/30 23:54:42 sjg Exp $
 #
 # Tests for the .unexport directive.
 
 # TODO: Implementation
 
 # First, export 3 variables.
-A=	a
-B=	b
-C=	c
-.export A B C
+UT_A=	a
+UT_B=	b
+UT_C=	c
+.export UT_A UT_B UT_C
 
 # Show the exported variables and their values.
-.info ${:!env|sort|grep -v -E '^(MAKELEVEL|MALLOC_OPTIONS|PATH|PWD)'!}
+.info ${:!env|sort|grep '^UT_'!}
 .info ${.MAKE.EXPORTED}
 
 # XXX: Now try to unexport all of them.  The variables are still exported
@@ -20,7 +20,7 @@ C=	c
 *=	asterisk
 .unexport *
 
-.info ${:!env|sort|grep -v -E '^(MAKELEVEL|MALLOC_OPTIONS|PATH|PWD)'!}
+.info ${:!env|sort|grep '^UT_'!}
 .info ${.MAKE.EXPORTED}
 
 all:



CVS commit: src/usr.bin/make

2020-10-30 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Oct 30 22:55:34 UTC 2020

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

Log Message:
make(1): rename Str_SYSVMatch and its parameters


To generate a diff of this commit:
cvs rdiff -u -r1.609 -r1.610 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.609 src/usr.bin/make/var.c:1.610
--- src/usr.bin/make/var.c:1.609	Fri Oct 30 22:49:07 2020
+++ src/usr.bin/make/var.c	Fri Oct 30 22:55:34 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: var.c,v 1.609 2020/10/30 22:49:07 rillig Exp $	*/
+/*	$NetBSD: var.c,v 1.610 2020/10/30 22:55:34 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -129,7 +129,7 @@
 #include"metachar.h"
 
 /*	"@(#)var.c	8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: var.c,v 1.609 2020/10/30 22:49:07 rillig Exp $");
+MAKE_RCSID("$NetBSD: var.c,v 1.610 2020/10/30 22:55:34 rillig Exp $");
 
 #define VAR_DEBUG1(fmt, arg1) DEBUG1(VAR, fmt, arg1)
 #define VAR_DEBUG2(fmt, arg1, arg2) DEBUG2(VAR, fmt, arg1, arg2)
@@ -1033,7 +1033,7 @@ Var_Value(const char *name, GNode *ctxt,
 }
 
 
-/* SepBuf is a string being built from "words", interleaved with separators. */
+/* SepBuf is a string being built from words, interleaved with separators. */
 typedef struct SepBuf {
 Buffer buf;
 Boolean needSep;
@@ -1158,10 +1158,7 @@ ModifyWord_NoMatch(const char *word, Sep
 }
 
 #ifdef SYSVVARSUB
-/*-
- *---
- * Str_SYSVMatch --
- *	Check word against pattern for a match (% is wild),
+/* Check word against pattern for a match (% is a wildcard).
  *
  * Input:
  *	word		Word to examine
@@ -1169,13 +1166,12 @@ ModifyWord_NoMatch(const char *word, Sep
  *
  * Results:
  *	Returns the start of the match, or NULL.
- *	*match_len returns the length of the match, if any.
- *	*hasPercent returns whether the pattern contains a percent.
- *---
+ *	out_match_len returns the length of the match, if any.
+ *	out_hasPercent returns whether the pattern contains a percent.
  */
 static const char *
-Str_SYSVMatch(const char *word, const char *pattern, size_t *match_len,
-	  Boolean *hasPercent)
+SysVMatch(const char *word, const char *pattern,
+	  size_t *out_match_len, Boolean *out_hasPercent)
 {
 const char *p = pattern;
 const char *w = word;
@@ -1184,15 +1180,15 @@ Str_SYSVMatch(const char *word, const ch
 size_t p_len;
 const char *w_tail;
 
-*hasPercent = FALSE;
+*out_hasPercent = FALSE;
 if (*p == '\0') {		/* ${VAR:=suffix} */
-	*match_len = strlen(w);	/* Null pattern is the whole string */
+	*out_match_len = strlen(w);	/* Null pattern is the whole string */
 	return w;
 }
 
 percent = strchr(p, '%');
 if (percent != NULL) {	/* ${VAR:...%...=...} */
-	*hasPercent = TRUE;
+	*out_hasPercent = TRUE;
 	if (*w == '\0')
 	return NULL;	/* empty word does not match pattern */
 
@@ -1205,7 +1201,7 @@ Str_SYSVMatch(const char *word, const ch
 	p++;			/* Skip the percent */
 	if (*p == '\0') {
 	/* No more pattern, return the rest of the string */
-	*match_len = strlen(w);
+	*out_match_len = strlen(w);
 	return w;
 	}
 }
@@ -1220,7 +1216,7 @@ Str_SYSVMatch(const char *word, const ch
 if (memcmp(p, w_tail, p_len) != 0)
 	return NULL;
 
-*match_len = (size_t)(w_tail - w);
+*out_match_len = (size_t)(w_tail - w);
 return w;
 }
 
@@ -1241,7 +1237,7 @@ ModifyWord_SYSVSubst(const char *word, S
 
 size_t match_len;
 Boolean lhsPercent;
-const char *match = Str_SYSVMatch(word, args->lhs, _len, );
+const char *match = SysVMatch(word, args->lhs, _len, );
 if (match == NULL) {
 	SepBuf_AddStr(buf, word);
 	return;



CVS commit: src/sys/net

2020-10-30 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Oct 30 22:51:08 UTC 2020

Modified Files:
src/sys/net: if_tap.c

Log Message:
use c99 initializers


To generate a diff of this commit:
cvs rdiff -u -r1.119 -r1.120 src/sys/net/if_tap.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/net/if_tap.c
diff -u src/sys/net/if_tap.c:1.119 src/sys/net/if_tap.c:1.120
--- src/sys/net/if_tap.c:1.119	Sun Sep 27 09:44:47 2020
+++ src/sys/net/if_tap.c	Fri Oct 30 18:51:08 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_tap.c,v 1.119 2020/09/27 13:44:47 roy Exp $	*/
+/*	$NetBSD: if_tap.c,v 1.120 2020/10/30 22:51:08 christos Exp $	*/
 
 /*
  *  Copyright (c) 2003, 2004, 2008, 2009 The NetBSD Foundation.
@@ -33,7 +33,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_tap.c,v 1.119 2020/09/27 13:44:47 roy Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_tap.c,v 1.120 2020/10/30 22:51:08 christos Exp $");
 
 #if defined(_KERNEL_OPT)
 
@@ -1176,10 +1176,19 @@ tap_dev_poll(int unit, int events, struc
 	return revents;
 }
 
-static struct filterops tap_read_filterops = { 1, NULL, tap_kqdetach,
-	tap_kqread };
-static struct filterops tap_seltrue_filterops = { 1, NULL, tap_kqdetach,
-	filt_seltrue };
+static struct filterops tap_read_filterops = {
+	.f_isfd = 1,
+	.f_attach = NULL,
+	.f_detach = tap_kqdetach,
+	.f_event = tap_kqread,
+};
+
+static struct filterops tap_seltrue_filterops = {
+	.f_isfd = 1,
+	.f_attach = NULL,
+	.f_detach = tap_kqdetach,
+	.f_event = filt_seltrue,
+};
 
 static int
 tap_cdev_kqfilter(dev_t dev, struct knote *kn)



CVS commit: src/usr.bin/make

2020-10-30 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Oct 30 22:49:07 UTC 2020

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

Log Message:
make(1): improve variable name in Var_Value, document callback


To generate a diff of this commit:
cvs rdiff -u -r1.608 -r1.609 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.608 src/usr.bin/make/var.c:1.609
--- src/usr.bin/make/var.c:1.608	Fri Oct 30 22:43:39 2020
+++ src/usr.bin/make/var.c	Fri Oct 30 22:49:07 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: var.c,v 1.608 2020/10/30 22:43:39 rillig Exp $	*/
+/*	$NetBSD: var.c,v 1.609 2020/10/30 22:49:07 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -129,7 +129,7 @@
 #include"metachar.h"
 
 /*	"@(#)var.c	8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: var.c,v 1.608 2020/10/30 22:43:39 rillig Exp $");
+MAKE_RCSID("$NetBSD: var.c,v 1.609 2020/10/30 22:49:07 rillig Exp $");
 
 #define VAR_DEBUG1(fmt, arg1) DEBUG1(VAR, fmt, arg1)
 #define VAR_DEBUG2(fmt, arg1, arg2) DEBUG2(VAR, fmt, arg1, arg2)
@@ -1020,16 +1020,16 @@ const char *
 Var_Value(const char *name, GNode *ctxt, void **freeIt)
 {
 Var *v = VarFind(name, ctxt, TRUE);
-char *p;
+char *value;
 
 *freeIt = NULL;
 if (v == NULL)
 	return NULL;
 
-p = Buf_GetAll(>val, NULL);
+value = Buf_GetAll(>val, NULL);
 if (VarFreeEnv(v, FALSE))
-	*freeIt = p;
-return p;
+	*freeIt = value;
+return value;
 }
 
 
@@ -1085,9 +1085,12 @@ SepBuf_Destroy(SepBuf *buf, Boolean free
 }
 
 
-/* This callback for ModifyWords gets a single word from an expression and
- * typically adds a modification of this word to the buffer. It may also do
- * nothing or add several words. */
+/* This callback for ModifyWords gets a single word from a variable expression
+ * and typically adds a modification of this word to the buffer. It may also
+ * do nothing or add several words.
+ *
+ * For example, in ${:Ua b c:M*2}, the callback is called 3 times, once for
+ * each word of "a b c". */
 typedef void (*ModifyWordsCallback)(const char *word, SepBuf *buf, void *data);
 
 



CVS commit: src/usr.bin/make

2020-10-30 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Oct 30 22:43:39 UTC 2020

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

Log Message:
make(1): remove unsatisfiable conditions in Var_Set_with_flags


To generate a diff of this commit:
cvs rdiff -u -r1.607 -r1.608 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.607 src/usr.bin/make/var.c:1.608
--- src/usr.bin/make/var.c:1.607	Fri Oct 30 22:30:42 2020
+++ src/usr.bin/make/var.c	Fri Oct 30 22:43:39 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: var.c,v 1.607 2020/10/30 22:30:42 rillig Exp $	*/
+/*	$NetBSD: var.c,v 1.608 2020/10/30 22:43:39 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -129,7 +129,7 @@
 #include"metachar.h"
 
 /*	"@(#)var.c	8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: var.c,v 1.607 2020/10/30 22:30:42 rillig Exp $");
+MAKE_RCSID("$NetBSD: var.c,v 1.608 2020/10/30 22:43:39 rillig Exp $");
 
 #define VAR_DEBUG1(fmt, arg1) DEBUG1(VAR, fmt, arg1)
 #define VAR_DEBUG2(fmt, arg1, arg2) DEBUG2(VAR, fmt, arg1, arg2)
@@ -829,8 +829,7 @@ Var_Set_with_flags(const char *name, con
 	goto out;
 	}
 	Buf_Empty(>val);
-	if (val)
-	Buf_AddStr(>val, val);
+	Buf_AddStr(>val, val);
 
 	VAR_DEBUG3("%s:%s = %s\n", ctxt->name, name, val);
 	if (v->flags & VAR_EXPORTED) {
@@ -843,12 +842,10 @@ Var_Set_with_flags(const char *name, con
  * Other than internals.
  */
 if (ctxt == VAR_CMDLINE && !(flags & VAR_NO_EXPORT) && name[0] != '.') {
-	if (v == NULL) {
-	/* we just added it */
-	v = VarFind(name, ctxt, 0);
-	}
-	if (v != NULL)
-	v->flags |= VAR_FROM_CMD;
+	if (v == NULL)
+	v = VarFind(name, ctxt, 0);	/* we just added it */
+	v->flags |= VAR_FROM_CMD;
+
 	/*
 	 * If requested, don't export these in the environment
 	 * individually.  We still put them in MAKEOVERRIDES so



CVS commit: src/usr.bin/make

2020-10-30 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Oct 30 22:30:42 UTC 2020

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

Log Message:
make(1): document where the variable name is expanded


To generate a diff of this commit:
cvs rdiff -u -r1.606 -r1.607 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.606 src/usr.bin/make/var.c:1.607
--- src/usr.bin/make/var.c:1.606	Fri Oct 30 20:30:44 2020
+++ src/usr.bin/make/var.c	Fri Oct 30 22:30:42 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: var.c,v 1.606 2020/10/30 20:30:44 rillig Exp $	*/
+/*	$NetBSD: var.c,v 1.607 2020/10/30 22:30:42 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -129,7 +129,7 @@
 #include"metachar.h"
 
 /*	"@(#)var.c	8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: var.c,v 1.606 2020/10/30 20:30:44 rillig Exp $");
+MAKE_RCSID("$NetBSD: var.c,v 1.607 2020/10/30 22:30:42 rillig Exp $");
 
 #define VAR_DEBUG1(fmt, arg1) DEBUG1(VAR, fmt, arg1)
 #define VAR_DEBUG2(fmt, arg1, arg2) DEBUG2(VAR, fmt, arg1, arg2)
@@ -351,7 +351,7 @@ GNode_FindVar(GNode *ctxt, const char *v
 /* Find the variable in the context, and maybe in other contexts as well.
  *
  * Input:
- *	name		name to find
+ *	name		name to find, is not expanded any further
  *	ctxt		context in which to look first
  *	elsewhere	TRUE to look in other contexts as well
  *
@@ -449,7 +449,8 @@ VarAdd(const char *name, const char *val
 }
 }
 
-/* Remove a variable from a context, freeing all related memory as well. */
+/* Remove a variable from a context, freeing all related memory as well.
+ * The variable name is expanded once. */
 void
 Var_Delete(const char *name, GNode *ctxt)
 {
@@ -549,6 +550,7 @@ Var_Export1(const char *name, VarExportF
 	return FALSE;
 	}
 
+	/* XXX: name is injected without escaping it */
 	expr = str_concat3("${", name, "}");
 	(void)Var_Subst(expr, VAR_GLOBAL, VARE_WANTRES, );
 	/* TODO: handle errors */
@@ -749,6 +751,7 @@ Var_UnExport(const char *str)
 	 * just delete .MAKE.EXPORTED below.
 	 */
 	if (varnames == str) {
+	/* XXX: v->name is injected without escaping it */
 		char *expr = str_concat3("${" MAKE_EXPORTED ":N", v->name, "}");
 		char *cp;
 		(void)Var_Subst(expr, VAR_GLOBAL, VARE_WANTRES, );
@@ -815,6 +818,7 @@ Var_Set_with_flags(const char *name, con
 	 * to VAR_GLOBAL, so delete it from there if needed.
 	 * Otherwise -V name may show the wrong value.
 	 */
+	/* XXX: name is expanded for the second time */
 	Var_Delete(name, VAR_GLOBAL);
 	}
 	VarAdd(name, val, ctxt, flags);
@@ -874,7 +878,7 @@ out:
  *	Otherwise the new value overwrites and replaces the old value.
  *
  * Input:
- *	name		name of variable to set
+ *	name		name of the variable to set, is expanded once
  *	val		value to give to the variable
  *	ctxt		context in which to set it
  *
@@ -905,7 +909,7 @@ Var_Set(const char *name, const char *va
  *	are concatenated, with a space in between.
  *
  * Input:
- *	name		name of variable to modify
+ *	name		name of the variable to modify, is expanded once
  *	val		string to append to it
  *	ctxt		context in which this should occur
  *
@@ -943,6 +947,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);
 } else if (v->flags & VAR_READONLY) {
 VAR_DEBUG1("Ignoring append to %s since it is read-only\n", name);
@@ -974,7 +979,7 @@ Var_Append(const char *name, const char 
  * fallback contexts.
  *
  * Input:
- *	name		Variable to find
+ *	name		Variable to find, is expanded once
  *	ctxt		Context in which to start search
  */
 Boolean
@@ -1005,7 +1010,7 @@ Var_Exists(const char *name, GNode *ctxt
  *	context, or the usual contexts.
  *
  * Input:
- *	name		name to find
+ *	name		name to find, is not expanded any further
  *	ctxt		context in which to search for it
  *
  * Results:



CVS commit: src/share/man/man9

2020-10-30 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Fri Oct 30 22:29:30 UTC 2020

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

Log Message:
Add a few missing articles.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/share/man/man9/ddb.9

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

Modified files:

Index: src/share/man/man9/ddb.9
diff -u src/share/man/man9/ddb.9:1.1 src/share/man/man9/ddb.9:1.2
--- src/share/man/man9/ddb.9:1.1	Fri Oct 30 22:14:03 2020
+++ src/share/man/man9/ddb.9	Fri Oct 30 22:29:30 2020
@@ -1,4 +1,4 @@
-.\"	$NetBSD: ddb.9,v 1.1 2020/10/30 22:14:03 uwe Exp $
+.\"	$NetBSD: ddb.9,v 1.2 2020/10/30 22:29:30 uwe Exp $
 .\"
 .\" Copyright (c) 2020 Valery Ushakov
 .\" All rights reserved.
@@ -132,7 +132,7 @@ remainder of its command line.
 .It Dv CS_NOREPEAT
 The command should not be automatically repeated by the
 .Tn REPL
-when user enters an empty command after it.
+when the user enters an empty command after it.
 .\"
 .It Dv CS_OWN
 The command doesn't follow the normal
@@ -152,9 +152,9 @@ The command sets the
 .Pp
 The remaining parameters are strings that provide documentation for
 the command and its arguments.
-That documentation is available to the user via
+That documentation is available to the user via the
 .Ic help
-command if the kernel was compiled with
+command if the kernel was compiled with the
 .Dv DDB_VERBOSE_HELP
 option.
 .\"



CVS commit: src/sys/arch

2020-10-30 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Oct 30 22:20:38 UTC 2020

Modified Files:
src/sys/arch/arm/xscale: pxa2x0_apm.c
src/sys/arch/macppc/dev: apm.c
src/sys/arch/mips/ralink: ralink_gpio.c

Log Message:
c99 struct initializers


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/arm/xscale/pxa2x0_apm.c
cvs rdiff -u -r1.27 -r1.28 src/sys/arch/macppc/dev/apm.c
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/mips/ralink/ralink_gpio.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/xscale/pxa2x0_apm.c
diff -u src/sys/arch/arm/xscale/pxa2x0_apm.c:1.4 src/sys/arch/arm/xscale/pxa2x0_apm.c:1.5
--- src/sys/arch/arm/xscale/pxa2x0_apm.c:1.4	Mon Nov 12 13:00:38 2012
+++ src/sys/arch/arm/xscale/pxa2x0_apm.c	Fri Oct 30 18:20:38 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: pxa2x0_apm.c,v 1.4 2012/11/12 18:00:38 skrll Exp $	*/
+/*	$NetBSD: pxa2x0_apm.c,v 1.5 2020/10/30 22:20:38 christos Exp $	*/
 /*	$OpenBSD: pxa2x0_apm.c,v 1.28 2007/03/29 18:42:38 uwe Exp $	*/
 
 /*-
@@ -104,8 +104,12 @@ void	filt_apmrdetach(struct knote *kn);
 int	filt_apmread(struct knote *kn, long hint);
 int	apmkqfilter(dev_t dev, struct knote *kn);
 
-struct filterops apmread_filtops =
-	{ 1, NULL, filt_apmrdetach, filt_apmread};
+static const struct filterops apmread_filtops = {
+	.f_isfd = 1,
+	.f_attach = NULL,
+	.f_detach = filt_apmrdetach,
+	.f_event = filt_apmread,
+};
 #endif
 
 /*

Index: src/sys/arch/macppc/dev/apm.c
diff -u src/sys/arch/macppc/dev/apm.c:1.27 src/sys/arch/macppc/dev/apm.c:1.28
--- src/sys/arch/macppc/dev/apm.c:1.27	Fri Jul 25 04:10:34 2014
+++ src/sys/arch/macppc/dev/apm.c	Fri Oct 30 18:20:38 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: apm.c,v 1.27 2014/07/25 08:10:34 dholland Exp $	*/
+/*	$NetBSD: apm.c,v 1.28 2020/10/30 22:20:38 christos Exp $	*/
 /*	$OpenBSD: apm.c,v 1.5 2002/06/07 07:13:59 miod Exp $	*/
 
 /*-
@@ -33,7 +33,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: apm.c,v 1.27 2014/07/25 08:10:34 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: apm.c,v 1.28 2020/10/30 22:20:38 christos Exp $");
 
 #include "apm.h"
 
@@ -431,8 +431,12 @@ filt_apmread(struct knote *kn, long hint
 	return (kn->kn_data > 0);
 }
 
-static struct filterops apmread_filtops =
-	{ 1, NULL, filt_apmrdetach, filt_apmread};
+static struct filterops apmread_filtops = {
+	.f_isfd = 1,
+	.f_attach = NULL,
+	.f_detach = filt_apmrdetach,
+	.f_event = filt_apmread,
+};
 
 int
 apmkqfilter(dev_t dev, struct knote *kn)

Index: src/sys/arch/mips/ralink/ralink_gpio.c
diff -u src/sys/arch/mips/ralink/ralink_gpio.c:1.8 src/sys/arch/mips/ralink/ralink_gpio.c:1.9
--- src/sys/arch/mips/ralink/ralink_gpio.c:1.8	Tue Mar 10 07:07:39 2020
+++ src/sys/arch/mips/ralink/ralink_gpio.c	Fri Oct 30 18:20:38 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: ralink_gpio.c,v 1.8 2020/03/10 11:07:39 martin Exp $	*/
+/*	$NetBSD: ralink_gpio.c,v 1.9 2020/10/30 22:20:38 christos Exp $	*/
 /*-
  * Copyright (c) 2011 CradlePoint Technology, Inc.
  * All rights reserved.
@@ -29,7 +29,7 @@
 /* ra_gpio.c -- Ralink 3052 gpio driver */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ralink_gpio.c,v 1.8 2020/03/10 11:07:39 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ralink_gpio.c,v 1.9 2020/10/30 22:20:38 christos Exp $");
 
 #include 
 #include 
@@ -495,10 +495,10 @@ static int  gpio_event_app_user_event(st
 static struct klist knotes;
 static int app_filter_id;
 static struct filterops app_fops = {
-	0,
-	gpio_event_app_user_attach,
-	gpio_event_app_user_detach,
-	gpio_event_app_user_event
+	.f_isfd = 0,
+	.f_attach = gpio_event_app_user_attach,
+	.f_detach = gpio_event_app_user_detach,
+	.f_event = gpio_event_app_user_event,
 };
 static struct callout led_tick_callout;
 static int gpio_driver_blink_leds = 1;



CVS commit: src/sys/kern

2020-10-30 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Oct 30 22:19:00 UTC 2020

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

Log Message:
fix indentation


To generate a diff of this commit:
cvs rdiff -u -r1.393 -r1.394 src/sys/kern/kern_sig.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_sig.c
diff -u src/sys/kern/kern_sig.c:1.393 src/sys/kern/kern_sig.c:1.394
--- src/sys/kern/kern_sig.c:1.393	Mon Oct 26 13:35:39 2020
+++ src/sys/kern/kern_sig.c	Fri Oct 30 18:19:00 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_sig.c,v 1.393 2020/10/26 17:35:39 christos Exp $	*/
+/*	$NetBSD: kern_sig.c,v 1.394 2020/10/30 22:19:00 christos Exp $	*/
 
 /*-
  * Copyright (c) 2006, 2007, 2008, 2019 The NetBSD Foundation, Inc.
@@ -70,7 +70,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_sig.c,v 1.393 2020/10/26 17:35:39 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_sig.c,v 1.394 2020/10/30 22:19:00 christos Exp $");
 
 #include "opt_execfmt.h"
 #include "opt_ptrace.h"
@@ -2682,8 +2682,8 @@ filt_signal(struct knote *kn, long hint)
 }
 
 const struct filterops sig_filtops = {
-		.f_isfd = 0,
-		.f_attach = filt_sigattach,
-		.f_detach = filt_sigdetach,
-		.f_event = filt_signal,
+	.f_isfd = 0,
+	.f_attach = filt_sigattach,
+	.f_detach = filt_sigdetach,
+	.f_event = filt_signal,
 };



CVS commit: src/sys/dev/sysmon

2020-10-30 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Oct 30 22:19:19 UTC 2020

Modified Files:
src/sys/dev/sysmon: sysmon_power.c

Log Message:
fix indentation


To generate a diff of this commit:
cvs rdiff -u -r1.64 -r1.65 src/sys/dev/sysmon/sysmon_power.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/sysmon/sysmon_power.c
diff -u src/sys/dev/sysmon/sysmon_power.c:1.64 src/sys/dev/sysmon/sysmon_power.c:1.65
--- src/sys/dev/sysmon/sysmon_power.c:1.64	Wed Jun 10 22:39:31 2020
+++ src/sys/dev/sysmon/sysmon_power.c	Fri Oct 30 18:19:18 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: sysmon_power.c,v 1.64 2020/06/11 02:39:31 thorpej Exp $	*/
+/*	$NetBSD: sysmon_power.c,v 1.65 2020/10/30 22:19:18 christos Exp $	*/
 
 /*-
  * Copyright (c) 2007 Juan Romero Pardines.
@@ -69,7 +69,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sysmon_power.c,v 1.64 2020/06/11 02:39:31 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sysmon_power.c,v 1.65 2020/10/30 22:19:18 christos Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -555,17 +555,17 @@ filt_sysmon_power_read(struct knote *kn,
 }
 
 static const struct filterops sysmon_power_read_filtops = {
-.f_isfd = 1,
-.f_attach = NULL,
-.f_detach = filt_sysmon_power_rdetach,
-.f_event = filt_sysmon_power_read,
+	.f_isfd = 1,
+	.f_attach = NULL,
+	.f_detach = filt_sysmon_power_rdetach,
+	.f_event = filt_sysmon_power_read,
 };
 
 static const struct filterops sysmon_power_write_filtops = {
-.f_isfd = 1,
-.f_attach = NULL,
-.f_detach = filt_sysmon_power_rdetach,
-.f_event = filt_seltrue,
+	.f_isfd = 1,
+	.f_attach = NULL,
+	.f_detach = filt_sysmon_power_rdetach,
+	.f_event = filt_seltrue,
 };
 
 /*



CVS commit: src/share/man/man9

2020-10-30 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Fri Oct 30 22:14:03 UTC 2020

Added Files:
src/share/man/man9: ddb.9

Log Message:
ddb(9) - first cut at the documentation for writing and adding new DDB
commands.  Not yet complete and not hooked into the build.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/share/man/man9/ddb.9

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

Added files:

Index: src/share/man/man9/ddb.9
diff -u /dev/null src/share/man/man9/ddb.9:1.1
--- /dev/null	Fri Oct 30 22:14:03 2020
+++ src/share/man/man9/ddb.9	Fri Oct 30 22:14:03 2020
@@ -0,0 +1,162 @@
+.\"	$NetBSD: ddb.9,v 1.1 2020/10/30 22:14:03 uwe Exp $
+.\"
+.\" Copyright (c) 2020 Valery Ushakov
+.\" 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 AUTHOR ``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 AUTHOR 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.
+.\"
+.Dd October 30, 2020
+.Dt DDB 9
+.Os
+.\"
+.\"
+.Sh NAME
+.Nm ddb
+.Nd in-kernel debugger
+.\"
+.\"
+.Sh SYNOPSIS
+.\"
+.In ddb/ddb.h
+.\"
+.Ft int
+.Fn db_register_tbl "uint8_t type" "const struct db_command *commands"
+.\"
+.Ft int
+.Fn db_unregister_tbl "uint8_t type" "const struct db_command *commands"
+.\"
+.\" XXX: there's no typedef defined for this
+.Ft void
+.Fo "(*pf)" \" it seems there's no way to format this differently
+.Fa "db_expr_t addr"
+.Fa "bool have_addr"
+.Fa "db_expr_t count"
+.Fa "const char *modif"
+.Fc
+.\"
+.\" - a macro, but document the types here
+.Fo DDB_ADD_CMD
+.Fa "const char *name"
+.Fa "void (*pf)(db_expr_t, bool, db_expr_t, const char *)"
+.Fa "uint16_t flags"
+.Fa "const char *cmd_descr"
+.Fa "const char *cmd_arg"
+.Fa "const char *arg_desc"
+.Fc
+.\"
+.Sh DESCRIPTION
+Devices and kernel modules can add new commands to the
+.Xr ddb 4
+in-kernel debugger with
+.Fn db_register_tbl
+and remove previously added commands with
+.Fn db_unregister_tbl
+respectively.
+.Pp
+The
+.Fa type
+argument is one of:
+.Bl -tag -offset indent -width Dv
+.\"
+.It Dv DDB_BASE_CMD
+top-level commands;
+.\"
+.It Dv DDB_MACH_CMD
+sub-commands of the top-level
+.Ic mach
+command;
+.\"
+.It Dv DDB_SHOW_CMD
+sub-commands of the top-level
+.Ic show
+command.
+.\"
+.El
+.\"
+.Pp
+The
+.Fa commands
+is an array of
+.Vt struct db_command\|
+entries.
+The initializer list for the array should use the
+.Fn DDB_ADD_CMD
+macro for its entries.
+The
+.Fa name
+is the name of the debugger command.
+An entry with
+.Dv NULL
+.Fa name
+terminates the array.
+.Pp
+The
+.Fa pf
+argument is the function that implements the command.
+The debugger's
+.Tn REPL
+parses the usual command format documented in
+.Xr ddb 4
+and invokes the implementation with the values obtained.
+.Pp
+The
+.Fa flags
+argument is a bitwise
+.Tn OR
+of the following values:
+.Bl -tag -offset indent -width Dv
+.\"
+.It Dv CS_MORE
+The command takes the usual arguments but may additionally parse the
+remainder of its command line.
+.\"
+.It Dv CS_NOREPEAT
+The command should not be automatically repeated by the
+.Tn REPL
+when user enters an empty command after it.
+.\"
+.It Dv CS_OWN
+The command doesn't follow the normal
+.Xr ddb 4
+conventions and parses its command line itself.
+The
+.Tn REPL
+doesn't try to parse the command line.
+The values passed to its implementation are dummies.
+.\"
+.It Dv CS_SET_DOT
+The command sets the
+.Va dot .
+.\"
+.El
+.\"
+.Pp
+The remaining parameters are strings that provide documentation for
+the command and its arguments.
+That documentation is available to the user via
+.Ic help
+command if the kernel was compiled with
+.Dv DDB_VERBOSE_HELP
+option.
+.\"
+.Sh SEE ALSO
+.Xr ddb 4



CVS commit: src/tests/bin/date

2020-10-30 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Fri Oct 30 22:03:36 UTC 2020

Modified Files:
src/tests/bin/date: t_date.sh

Log Message:
Update the test a little so that is possible to pass
(if date fails, because of bad or out of range input
to parsedate, it cannot be expected to output the
expected result).

Remove the atf-expect-fail now that parsedate() should
detect overflows, and fail, causing date to fail, rather
than simply producing bogus results.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/bin/date/t_date.sh

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

Modified files:

Index: src/tests/bin/date/t_date.sh
diff -u src/tests/bin/date/t_date.sh:1.1 src/tests/bin/date/t_date.sh:1.2
--- src/tests/bin/date/t_date.sh:1.1	Fri Jul  3 03:59:18 2020
+++ src/tests/bin/date/t_date.sh	Fri Oct 30 22:03:35 2020
@@ -1,4 +1,4 @@
-# $NetBSD: t_date.sh,v 1.1 2020/07/03 03:59:18 jruoho Exp $
+# $NetBSD: t_date.sh,v 1.2 2020/10/30 22:03:35 kre Exp $
 #
 # Copyright (c) 2020 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -34,7 +34,7 @@ overflow_head() {
 
 overflow_body() {
 
-	atf_expect_fail "PR lib/46542"
+	## atf_expect_fail "PR lib/46542"	# no longer true
 
 	years="1 10 100 1000 1 10 100 1000 \
 	  1 10 100 1000"
@@ -42,10 +42,10 @@ overflow_body() {
 	for year in $years; do
 
 		y=$(date +%Y)
-		yy=$(expr $y + $year)
-		yyy=$(date -d "$year years" +%Y)
+		yy=$((y + year))
+		yyy=$(date -d "$year years" +%Y) || continue
 
-		if [ ! $yy -eq $yyy ]; then
+		if [ "$yy" -ne "$yyy" ]; then
 			atf_fail "$yy vs. $yyy"
 		fi
 	done



CVS commit: src/lib/libutil

2020-10-30 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Fri Oct 30 22:03:11 UTC 2020

Modified Files:
src/lib/libutil: parsedate.y

Log Message:
PR lib/46542

Add checks to detect overflow, and also detect other invalid
(out of range) inputs for parsedate().

There could be more, and some of what is being added is not
perfect, but many calculation overflows will be detected now
(and cause an error return) and some of the most bizarre
inputs that were previously accepted no longer will be.


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/lib/libutil/parsedate.y

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

Modified files:

Index: src/lib/libutil/parsedate.y
diff -u src/lib/libutil/parsedate.y:1.35 src/lib/libutil/parsedate.y:1.36
--- src/lib/libutil/parsedate.y:1.35	Mon Oct 19 17:47:45 2020
+++ src/lib/libutil/parsedate.y	Fri Oct 30 22:03:11 2020
@@ -14,12 +14,13 @@
 
 #include 
 #ifdef __RCSID
-__RCSID("$NetBSD: parsedate.y,v 1.35 2020/10/19 17:47:45 kre Exp $");
+__RCSID("$NetBSD: parsedate.y,v 1.36 2020/10/30 22:03:11 kre Exp $");
 #endif
 
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -95,6 +96,15 @@ struct dateinfo {
 		int	yyRelMonth;
 	} yyRel[MAXREL];
 };
+
+static int RelVal(struct dateinfo *, time_t, time_t, int, int);
+
+#define CheckRelVal(a, b, c, d, e) do {\
+		if (!RelVal((a), (b), (c), (d), (e))) {		\
+			YYREJECT;\
+		}		\
+	} while (0)
+
 %}
 
 %union {
@@ -191,6 +201,8 @@ at_number:
 
 time:
 	  tUNUMBER tMERIDIAN {
+		if ($1 > 24)
+			YYREJECT;
 		param->yyMinutes = 0;
 		param->yySeconds = 0;
 		if ($2 == MER_NOON || $2 == MER_MN) {
@@ -209,6 +221,8 @@ time:
 		}
 	  }
 	| tUNUMBER ':' tUNUMBER o_merid {
+		if ($1 > 24 || $3 >= 60)
+			YYREJECT;
 		param->yyMinutes = $3;
 		param->yySeconds = 0;
 		if ($4 == MER_NOON || $4 == MER_MN) {
@@ -227,6 +241,8 @@ time:
 		}
 	  }
 	| tUNUMBER ':' tUNUMBER ':' tUNUMBER o_merid {
+		if ($1 > 24 || $3 >= 60 || $5 > 60)
+			YYREJECT;
 		param->yyMinutes = $3;
 		param->yySeconds = $5;
 		if ($6 == MER_NOON || $6 == MER_MN) {
@@ -245,6 +261,8 @@ time:
 		}
 	  }
 	| tUNUMBER ':' tUNUMBER ':' tUNUMBER '.' tUNUMBER {
+		if ($1 > 24 || $3 >= 60 || $5 > 60)
+			YYREJECT;
 		param->yyHour = $1;
 		param->yyMinutes = $3;
 		param->yySeconds = $5;
@@ -252,6 +270,8 @@ time:
 		/* XXX: Do nothing with fractional secs ($7) */
 	  }
 	| tUNUMBER ':' tUNUMBER ':' tUNUMBER ',' tUNUMBER {
+		if ($1 > 24 || $3 >= 60 || $5 > 60)
+			YYREJECT;
 		param->yyHour = $1;
 		param->yyMinutes = $3;
 		param->yySeconds = $5;
@@ -280,6 +300,10 @@ time:
 
 time_numericzone:
 	  tUNUMBER ':' tUNUMBER tSNUMBER {
+		if ($4 < -(47 * 100 + 59) || $4 > (47 * 100 + 59))
+			YYREJECT;
+		if ($1 > 24 || $3 > 59)
+			YYREJECT;
 		param->yyHour = $1;
 		param->yyMinutes = $3;
 		param->yyMeridian = MER24;
@@ -287,6 +311,10 @@ time_numericzone:
 		param->yyTimezone = - ($4 % 100 + ($4 / 100) * 60);
 	  }
 	| tUNUMBER ':' tUNUMBER ':' tUNUMBER tSNUMBER {
+		if ($6 < -(47 * 100 + 59) || $6 > (47 * 100 + 59))
+			YYREJECT;
+		if ($1 > 24 || $3 > 59 || $5 > 60)
+			YYREJECT;
 		param->yyHour = $1;
 		param->yyMinutes = $3;
 		param->yySeconds = $5;
@@ -303,6 +331,8 @@ zone:
 	| tSNUMBER	{
 			  if (param->yyHaveDate == 0 && param->yyHaveTime == 0)
 YYREJECT;
+			  if ($1 < -(47 * 100 + 59) || $1 > (47 * 100 + 59))
+YYREJECT;
 			  param->yyTimezone = - ($1 % 100 + ($1 / 100) * 60);
 			  param->yyDSTmode = DSTmaybe;
 			}
@@ -316,15 +346,21 @@ day:
 
 date:
 	  tUNUMBER '/' tUNUMBER {
+		if ($1 > 12 || $3 > 31 || $1 == 0 || $3 == 0)
+			YYREJECT;
 		param->yyMonth = $1;
 		param->yyDay = $3;
 	  }
 	| tUNUMBER '/' tUNUMBER '/' tUNUMBER {
 		if ($1 >= 100) {
+			if ($3 > 12 || $5 > 31 || $3 == 0 || $5 == 0)
+YYREJECT;
 			param->yyYear = $1;
 			param->yyMonth = $3;
 			param->yyDay = $5;
 		} else {
+			if ($1 >= 12 || $3 > 31 || $1 == 0 || $3 == 0)
+YYREJECT;
 			param->yyMonth = $1;
 			param->yyDay = $3;
 			param->yyYear = $5;
@@ -332,39 +368,55 @@ date:
 	  }
 	| tUNUMBER tSNUMBER tSNUMBER {
 		/* ISO 8601 format.  -mm-dd.  */
+		if ($2 >= 0 || $2 < -12 || $3 >= 0 || $3 < -31)
+			YYREJECT;
 		param->yyYear = $1;
 		param->yyHaveFullYear = 1;
 		param->yyMonth = -$2;
 		param->yyDay = -$3;
 	  }
 	| tUNUMBER tMONTH tSNUMBER {
+		if ($3 > 0 || $1 == 0 || $1 > 31)
+			YYREJECT;
 		/* e.g. 17-JUN-1992.  */
 		param->yyDay = $1;
 		param->yyMonth = $2;
 		param->yyYear = -$3;
 	  }
 	| tMONTH tUNUMBER {
+		if ($2 == 0 || $2 > 31)
+			YYREJECT;
 		param->yyMonth = $1;
 		param->yyDay = $2;
 	  }
 	| tMONTH tUNUMBER ',' tUNUMBER {
+		if ($2 == 0 || $2 > 31)
+			YYREJECT;
 		param->yyMonth = $1;
 		param->yyDay = $2;
 		param->yyYear = $4;
 	  }
 	| tUNUMBER tMONTH {
+		if ($1 == 0 || $1 > 31)
+			YYREJECT;
 		param->yyMonth = $2;
 		param->yyDay = $1;
 	  }
 	| tUNUMBER tMONTH tUNUMBER {
-		param->yyMonth = $2;
+		if ($1 > 31 && $3 > 

CVS commit: src/lib/libossaudio

2020-10-30 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Fri Oct 30 21:44:49 UTC 2020

Modified Files:
src/lib/libossaudio: ossaudio.c

Log Message:
ossaudio(3): Simplify setting rate (try to supply the nearest one possible)


To generate a diff of this commit:
cvs rdiff -u -r1.58 -r1.59 src/lib/libossaudio/ossaudio.c

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

Modified files:

Index: src/lib/libossaudio/ossaudio.c
diff -u src/lib/libossaudio/ossaudio.c:1.58 src/lib/libossaudio/ossaudio.c:1.59
--- src/lib/libossaudio/ossaudio.c:1.58	Sat Oct 24 14:43:53 2020
+++ src/lib/libossaudio/ossaudio.c	Fri Oct 30 21:44:49 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: ossaudio.c,v 1.58 2020/10/24 14:43:53 roy Exp $	*/
+/*	$NetBSD: ossaudio.c,v 1.59 2020/10/30 21:44:49 nia Exp $	*/
 
 /*-
  * Copyright (c) 1997, 2020 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: ossaudio.c,v 1.58 2020/10/24 14:43:53 roy Exp $");
+__RCSID("$NetBSD: ossaudio.c,v 1.59 2020/10/30 21:44:49 nia Exp $");
 
 /*
  * This is an Open Sound System compatibility layer, which provides
@@ -180,36 +180,15 @@ audio_ioctl(int fd, unsigned long com, v
 		break;
 	case SNDCTL_DSP_SPEED:
 		AUDIO_INITINFO();
+		/* Conform to kernel limits. */
+		if (INTARG < 1000)
+			INTARG = 1000;
+		if (INTARG > 192000)
+			INTARG = 192000;
 		tmpinfo.play.sample_rate =
 		tmpinfo.record.sample_rate = INTARG;
-		/*
-		 * The default NetBSD behavior if an unsupported sample rate
-		 * is set is to return an error code and keep the rate at the
-		 * default of 8000 Hz.
-		 * 
-		 * However, OSS specifies that a sample rate supported by the
-		 * hardware is returned if the exact rate could not be set.
-		 * 
-		 * So, if the chosen sample rate is invalid, set and return
-		 * the current hardware rate.
-		 */
 		if (ioctl(fd, AUDIO_SETINFO, ) < 0) {
-			/* Don't care that SETINFO failed the first time... */
-			errno = 0;
-			retval = ioctl(fd, AUDIO_GETFORMAT, );
-			if (retval < 0)
-return retval;
-			retval = ioctl(fd, AUDIO_GETINFO, );
-			if (retval < 0)
-return retval;
-			tmpinfo.play.sample_rate =
-			tmpinfo.record.sample_rate =
-			(tmpinfo.mode == AUMODE_RECORD) ?
-			hwfmt.record.sample_rate :
-			hwfmt.play.sample_rate;
-			retval = ioctl(fd, AUDIO_SETINFO, );
-			if (retval < 0)
-return retval;
+			return retval;
 		}
 		/* FALLTHRU */
 	case SOUND_PCM_READ_RATE:



CVS commit: src/lib/libnvmm

2020-10-30 Thread Reinoud Zandijk
Module Name:src
Committed By:   reinoud
Date:   Fri Oct 30 21:06:13 UTC 2020

Modified Files:
src/lib/libnvmm: libnvmm_x86.c

Log Message:
Implement missing (REPE) CMPS instruction support in NVMMs x86_decode().

In apparently rare cases the (REPE) CMPS instruction can trigger an memory
assist. NVMM wouldn't recognize the instruction and thus couldn't assist and
Qemu would abort.


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 src/lib/libnvmm/libnvmm_x86.c

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

Modified files:

Index: src/lib/libnvmm/libnvmm_x86.c
diff -u src/lib/libnvmm/libnvmm_x86.c:1.40 src/lib/libnvmm/libnvmm_x86.c:1.41
--- src/lib/libnvmm/libnvmm_x86.c:1.40	Sat Sep  5 07:22:25 2020
+++ src/lib/libnvmm/libnvmm_x86.c	Fri Oct 30 21:06:13 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: libnvmm_x86.c,v 1.40 2020/09/05 07:22:25 maxv Exp $	*/
+/*	$NetBSD: libnvmm_x86.c,v 1.41 2020/10/30 21:06:13 reinoud Exp $	*/
 
 /*
  * Copyright (c) 2018-2020 Maxime Villard, m00nbsd.net
@@ -1051,6 +1051,7 @@ struct x86_opcode {
 	bool movs:1;
 	bool stos:1;
 	bool lods:1;
+	bool cmps:1;
 	bool szoverride:1;
 	bool group1:1;
 	bool group3:1;
@@ -1463,6 +1464,26 @@ static const struct x86_opcode primary_o
 	},
 
 	/*
+	 * CMPS
+	 */
+	[0xA6] = {
+		/* Yb, Xb */
+		.valid = true,
+		.cmps = true,
+		.szoverride = false,
+		.defsize = OPSIZE_BYTE,
+		.emul = _emul_cmp
+	},
+	[0xA7] = {
+		/* Yv, Xv */
+		.valid = true,
+		.cmps = true,
+		.szoverride = true,
+		.defsize = -1,
+		.emul = _emul_cmp
+	},
+
+	/*
 	 * STOS
 	 */
 	[0xAA] = {
@@ -1871,6 +1892,35 @@ node_movs(struct x86_decode_fsm *fsm, st
 }
 
 /*
+ * Special node, for CMPS. Fake two displacements of zero on the source and
+ * destination registers.
+ * XXX coded as clone of movs as its similar in register usage
+ * XXX might be merged with node_movs()
+ */
+static int
+node_cmps(struct x86_decode_fsm *fsm, struct x86_instr *instr)
+{
+	size_t adrsize;
+
+	adrsize = instr->address_size;
+
+	/* DS:RSI */
+	instr->src.type = STORE_REG;
+	instr->src.u.reg = _map__special[1][2][adrsize-1];
+	instr->src.disp.type = DISP_0;
+
+	/* ES:RDI, force ES */
+	instr->dst.type = STORE_REG;
+	instr->dst.u.reg = _map__special[1][3][adrsize-1];
+	instr->dst.disp.type = DISP_0;
+	instr->dst.hardseg = NVMM_X64_SEG_ES;
+
+	fsm_advance(fsm, 0, NULL);
+
+	return 0;
+}
+
+/*
  * Special node, for STOS and LODS. Fake a displacement of zero on the
  * destination register.
  */
@@ -2470,6 +2520,8 @@ node_primary_opcode(struct x86_decode_fs
 		fsm_advance(fsm, 1, node_stlo);
 	} else if (opcode->movs) {
 		fsm_advance(fsm, 1, node_movs);
+	} else if (opcode->cmps) {
+		fsm_advance(fsm, 1, node_cmps);
 	} else {
 		return -1;
 	}
@@ -2646,8 +2698,16 @@ x86_decode(uint8_t *inst_bytes, size_t i
 
 	while (fsm.fn != NULL) {
 		ret = (*fsm.fn)(, instr);
-		if (ret == -1)
+		if (ret == -1) {
+			printf("\nNVMM: %s missing support for instruction " \
+			   "with max length %ld : [ ", __func__,
+			   inst_len);
+			for (uint i = 0; i < inst_len; i++)
+printf("%02x ", inst_bytes[i]);
+			printf("], please report to NetBSD!\n\n");
+			fflush(stdout);
 			return -1;
+		}
 	}
 
 	instr->len = fsm.buf - inst_bytes;



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

2020-10-30 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Oct 30 20:36:33 UTC 2020

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

Log Message:
make(1): demonstrate double expansion when appending to a variable


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/usr.bin/make/unit-tests/var-op-append.exp
cvs rdiff -u -r1.6 -r1.7 src/usr.bin/make/unit-tests/var-op-append.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/var-op-append.exp
diff -u src/usr.bin/make/unit-tests/var-op-append.exp:1.1 src/usr.bin/make/unit-tests/var-op-append.exp:1.2
--- src/usr.bin/make/unit-tests/var-op-append.exp:1.1	Sun Aug 16 12:07:51 2020
+++ src/usr.bin/make/unit-tests/var-op-append.exp	Fri Oct 30 20:36:33 2020
@@ -1 +1,7 @@
+Var_Parse: ${:U\$\$\$\$\$\$\$\$} with VARE_WANTRES
+Applying ${:U...} to "" (VARE_WANTRES, none, VEF_UNDEF)
+Result of ${:U\$\$\$\$\$\$\$\$} is "" (VARE_WANTRES, none, VEF_UNDEF|VEF_DEF)
+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.6 src/usr.bin/make/unit-tests/var-op-append.mk:1.7
--- src/usr.bin/make/unit-tests/var-op-append.mk:1.6	Sat Oct 24 08:50:17 2020
+++ src/usr.bin/make/unit-tests/var-op-append.mk	Fri Oct 30 20:36:33 2020
@@ -1,4 +1,4 @@
-# $NetBSD: var-op-append.mk,v 1.6 2020/10/24 08:50:17 rillig Exp $
+# $NetBSD: var-op-append.mk,v 1.7 2020/10/30 20:36:33 rillig Exp $
 #
 # Tests for the += variable assignment operator, which appends to a variable,
 # creating it if necessary.
@@ -32,5 +32,17 @@ 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.
+.MAKEFLAGS: -dv
+VAR.${:U\$\$\$\$\$\$\$\$}+=	dollars
+.MAKEFLAGS: -d0
+.if ${VAR.${:U\$\$\$\$}} != "dollars"
+.  error
+.endif
+
 all:
 	@:;



CVS commit: src/usr.bin/make

2020-10-30 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Oct 30 20:30:44 UTC 2020

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

Log Message:
make(1): change char * to void * in Var_Value

The only purpose of the parameter freeIt is to free the memory
associated with the return value.  To do this, no pointer arithmetic is
needed.  Therefore, change to a void pointer, to catch accidental use of
that pointer.


To generate a diff of this commit:
cvs rdiff -u -r1.148 -r1.149 src/usr.bin/make/arch.c
cvs rdiff -u -r1.169 -r1.170 src/usr.bin/make/compat.c
cvs rdiff -u -r1.172 -r1.173 src/usr.bin/make/cond.c
cvs rdiff -u -r1.295 -r1.296 src/usr.bin/make/job.c
cvs rdiff -u -r1.411 -r1.412 src/usr.bin/make/main.c
cvs rdiff -u -r1.182 -r1.183 src/usr.bin/make/make.c
cvs rdiff -u -r1.132 -r1.133 src/usr.bin/make/meta.c
cvs rdiff -u -r1.146 -r1.147 src/usr.bin/make/nonints.h
cvs rdiff -u -r1.412 -r1.413 src/usr.bin/make/parse.c
cvs rdiff -u -r1.228 -r1.229 src/usr.bin/make/suff.c
cvs rdiff -u -r1.19 -r1.20 src/usr.bin/make/trace.c
cvs rdiff -u -r1.605 -r1.606 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/arch.c
diff -u src/usr.bin/make/arch.c:1.148 src/usr.bin/make/arch.c:1.149
--- src/usr.bin/make/arch.c:1.148	Fri Oct 30 16:48:58 2020
+++ src/usr.bin/make/arch.c	Fri Oct 30 20:30:44 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: arch.c,v 1.148 2020/10/30 16:48:58 rillig Exp $	*/
+/*	$NetBSD: arch.c,v 1.149 2020/10/30 20:30:44 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -130,7 +130,7 @@
 #include"config.h"
 
 /*	"@(#)arch.c	8.2 (Berkeley) 1/2/94"	*/
-MAKE_RCSID("$NetBSD: arch.c,v 1.148 2020/10/30 16:48:58 rillig Exp $");
+MAKE_RCSID("$NetBSD: arch.c,v 1.149 2020/10/30 20:30:44 rillig Exp $");
 
 #ifdef TARGET_MACHINE
 #undef MAKE_MACHINE
@@ -861,7 +861,7 @@ Arch_Touch(GNode *gn)
 {
 FILE *arch;		/* Stream open to archive, positioned properly */
 struct ar_hdr arh;	/* Current header describing member */
-char *p1, *p2;
+void *p1, *p2;
 
 arch = ArchFindMember(Var_Value(ARCHIVE, gn, ),
 			  Var_Value(MEMBER, gn, ),
@@ -921,7 +921,7 @@ Arch_MTime(GNode *gn)
 {
 struct ar_hdr *arhPtr;	/* Header of desired member */
 time_t modTime;		/* Modification time as an integer */
-char *p1, *p2;
+void *p1, *p2;
 
 arhPtr = ArchStatMember(Var_Value(ARCHIVE, gn, ),
 			Var_Value(MEMBER, gn, ),

Index: src/usr.bin/make/compat.c
diff -u src/usr.bin/make/compat.c:1.169 src/usr.bin/make/compat.c:1.170
--- src/usr.bin/make/compat.c:1.169	Mon Oct 26 21:34:10 2020
+++ src/usr.bin/make/compat.c	Fri Oct 30 20:30:44 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: compat.c,v 1.169 2020/10/26 21:34:10 rillig Exp $	*/
+/*	$NetBSD: compat.c,v 1.170 2020/10/30 20:30:44 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -96,7 +96,7 @@
 #include "pathnames.h"
 
 /*	"@(#)compat.c	8.2 (Berkeley) 3/19/94"	*/
-MAKE_RCSID("$NetBSD: compat.c,v 1.169 2020/10/26 21:34:10 rillig Exp $");
+MAKE_RCSID("$NetBSD: compat.c,v 1.170 2020/10/30 20:30:44 rillig Exp $");
 
 static GNode *curTarg = NULL;
 static pid_t compatChild;
@@ -110,7 +110,7 @@ static void
 CompatDeleteTarget(GNode *gn)
 {
 if (gn != NULL && !Targ_Precious(gn)) {
-	char *file_freeIt;
+	void *file_freeIt;
 	const char *file = Var_Value(TARGET, gn, _freeIt);
 
 	if (!opts.noExecute && eunlink(file) != -1) {
@@ -503,7 +503,7 @@ Compat_Make(GNode *gn, GNode *pgn)
 	}
 
 	if (Lst_FindDatum(gn->implicitParents, pgn) != NULL) {
-	char *target_freeIt;
+	void *target_freeIt;
 	Var_Set(IMPSRC, Var_Value(TARGET, gn, _freeIt), pgn);
 	bmake_free(target_freeIt);
 	}
@@ -597,7 +597,7 @@ Compat_Make(GNode *gn, GNode *pgn)
 	pgn->flags &= ~(unsigned)REMAKE;
 } else {
 	if (Lst_FindDatum(gn->implicitParents, pgn) != NULL) {
-	char *target_freeIt;
+	void *target_freeIt;
 	const char *target = Var_Value(TARGET, gn, _freeIt);
 	Var_Set(IMPSRC, target != NULL ? target : "", pgn);
 	bmake_free(target_freeIt);

Index: src/usr.bin/make/cond.c
diff -u src/usr.bin/make/cond.c:1.172 src/usr.bin/make/cond.c:1.173
--- src/usr.bin/make/cond.c:1.172	Fri Oct 30 14:56:23 2020
+++ src/usr.bin/make/cond.c	Fri Oct 30 20:30:44 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: cond.c,v 1.172 2020/10/30 14:56:23 rillig Exp $	*/
+/*	$NetBSD: cond.c,v 1.173 2020/10/30 20:30:44 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -93,7 +93,7 @@
 #include "dir.h"
 
 /*	"@(#)cond.c	8.2 (Berkeley) 1/2/94"	*/
-MAKE_RCSID("$NetBSD: cond.c,v 1.172 2020/10/30 14:56:23 rillig Exp $");
+MAKE_RCSID("$NetBSD: cond.c,v 1.173 2020/10/30 20:30:44 rillig Exp $");
 
 /*
  * The parsing of conditional expressions is based on this grammar:
@@ -283,7 

CVS commit: src/usr.bin/xinstall

2020-10-30 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Oct 30 20:05:00 UTC 2020

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

Log Message:
install(1): copy metachar table from usr.bin/make

It is not worth having a dependency on usr.bin/make just for including
this small table.  The header file usr.bin/make/make.h, which is
included for consistency with the rest of the usr.bin/make code, is
using inline functions a lot and refers to several parts of make that
are completely irrelevant to usr.bin/install.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/usr.bin/xinstall/Makefile
cvs rdiff -u -r1.125 -r1.126 src/usr.bin/xinstall/xinstall.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/xinstall/Makefile
diff -u src/usr.bin/xinstall/Makefile:1.28 src/usr.bin/xinstall/Makefile:1.29
--- src/usr.bin/xinstall/Makefile:1.28	Tue Sep 29 12:04:48 2020
+++ src/usr.bin/xinstall/Makefile	Fri Oct 30 20:05:00 2020
@@ -1,16 +1,12 @@
-#	$NetBSD: Makefile,v 1.28 2020/09/29 12:04:48 roy Exp $
+#	$NetBSD: Makefile,v 1.29 2020/10/30 20:05:00 rillig Exp $
 #	@(#)Makefile	8.1 (Berkeley) 6/6/93
 
 .include 
 
 PROG=	xinstall
-SRCS=	xinstall.c getid.c metachar.c
+SRCS=	xinstall.c getid.c
 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
 

Index: src/usr.bin/xinstall/xinstall.c
diff -u src/usr.bin/xinstall/xinstall.c:1.125 src/usr.bin/xinstall/xinstall.c:1.126
--- src/usr.bin/xinstall/xinstall.c:1.125	Tue May 31 06:55:02 2016
+++ src/usr.bin/xinstall/xinstall.c	Fri Oct 30 20:05:00 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: xinstall.c,v 1.125 2016/05/31 06:55:02 pgoyette Exp $	*/
+/*	$NetBSD: xinstall.c,v 1.126 2020/10/30 20:05:00 rillig Exp $	*/
 
 /*
  * Copyright (c) 1987, 1993
@@ -29,6 +29,35 @@
  * SUCH DAMAGE.
  */
 
+/*-
+ * Copyright (c) 2015 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Christos Zoulas.
+ *
+ * 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.
+ */
+
 #define __MKTEMP_OK__	/* All uses of mktemp have been checked */
 
 #if HAVE_NBTOOL_CONFIG_H
@@ -48,7 +77,7 @@ __COPYRIGHT("@(#) Copyright (c) 1987, 19
 #if 0
 static char sccsid[] = "@(#)xinstall.c	8.1 (Berkeley) 7/21/93";
 #else
-__RCSID("$NetBSD: xinstall.c,v 1.125 2016/05/31 06:55:02 pgoyette Exp $");
+__RCSID("$NetBSD: xinstall.c,v 1.126 2020/10/30 20:05:00 rillig Exp $");
 #endif
 #endif /* not lint */
 
@@ -84,7 +113,6 @@ __RCSID("$NetBSD: xinstall.c,v 1.125 201
 
 #include "pathnames.h"
 #include "mtree.h"
-#include "metachar.h"
 
 #define BACKUP_SUFFIX ".old"
 
@@ -143,6 +171,7 @@ static void	strip(const char *);
 __dead static void	usage(void);
 static char   *xbasename(char *);
 static char   *xdirname(char *);
+static int	needshell(const char *, int);
 
 int
 main(int argc, char *argv[])
@@ -1286,3 +1315,58 @@ usage(void)
 	prog, prog, prog);
 	exit(1);
 }
+
+/*
+ * The following array is used to make a fast determination of which
+ * characters are interpreted specially by the shell.  If a command
+ * contains any of these characters, it is executed by the shell, not
+ * directly by us.
+ */
+static unsigned char _metachar[128] = {
+/*nul   soh   stx   etx   eot   enq   ack   bel */
+	1,0,0,0,0,0,0,0,
+/* bshtnlvtnpcrsosi */
+	0,0,1,0,	0,0,0,0,
+/*dle   dc1   dc2   dc3   dc4   nak   syn   etb */
+	0,0,0,

CVS commit: src/usr.bin/make

2020-10-30 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Oct 30 19:14:20 UTC 2020

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

Log Message:
make(1): remove comment about adding is_shell_metachar to ctype.h

This function is so specialized that it would be wrong to have it in a
general-purpose C header.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/usr.bin/make/metachar.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/metachar.c
diff -u src/usr.bin/make/metachar.c:1.7 src/usr.bin/make/metachar.c:1.8
--- src/usr.bin/make/metachar.c:1.7	Sun Sep 13 15:15:51 2020
+++ src/usr.bin/make/metachar.c	Fri Oct 30 19:14:20 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: metachar.c,v 1.7 2020/09/13 15:15:51 rillig Exp $	*/
+/*	$NetBSD: metachar.c,v 1.8 2020/10/30 19:14:20 rillig Exp $	*/
 
 /*-
  * Copyright (c) 2015 The NetBSD Foundation, Inc.
@@ -39,15 +39,13 @@
 
 #include "metachar.h"
 
-MAKE_RCSID("$NetBSD: metachar.c,v 1.7 2020/09/13 15:15:51 rillig Exp $");
+MAKE_RCSID("$NetBSD: metachar.c,v 1.8 2020/10/30 19:14:20 rillig Exp $");
 
 /*
  * The following array is used to make a fast determination of which
  * characters are interpreted specially by the shell.  If a command
  * contains any of these characters, it is executed by the shell, not
  * directly by us.
- *
- * perhaps move it to ctype?
  */
 
 unsigned char _metachar[128] = {



CVS commit: src/sys

2020-10-30 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Oct 30 18:54:37 UTC 2020

Modified Files:
src/sys/arch/aarch64/include: locore.h
src/sys/arch/arm/arm: cpufunc.c
src/sys/arch/arm/arm32: arm32_kvminit.c arm32_machdep.c arm32_tlb.c
armv7_generic_space.c db_machdep.c pmap.c
src/sys/arch/arm/broadcom: bcm53xx_pax.c bcmgen_space.c
src/sys/arch/arm/cortex: gicv3.c gtmr.c
src/sys/arch/arm/include: locore.h
src/sys/arch/arm/include/arm32: pmap.h
src/sys/arch/arm/marvell: armadaxp.c
src/sys/arch/arm/samsung: exynos_platform.c
src/sys/arch/arm/vexpress: vexpress_platform.c
src/sys/arch/arm/vfp: vfp_init.c
src/sys/arch/arm/virt: virt_platform.c
src/sys/arch/arm/zynq: zynq_space.c
src/sys/arch/evbarm/bcm53xx: bcm53xx_machdep.c
src/sys/arch/evbarm/beagle: beagle_machdep.c
src/sys/arch/evbarm/gumstix: gumstix_machdep.c
src/sys/arch/evbarm/zynq: zynq_machdep.c
src/sys/dev/tprof: tprof_armv7.c tprof_armv8.c

Log Message:
Retire arm_[di]sb in favour of the isb() and dsb(sy) macro invocations.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/aarch64/include/locore.h
cvs rdiff -u -r1.177 -r1.178 src/sys/arch/arm/arm/cpufunc.c
cvs rdiff -u -r1.65 -r1.66 src/sys/arch/arm/arm32/arm32_kvminit.c
cvs rdiff -u -r1.137 -r1.138 src/sys/arch/arm/arm32/arm32_machdep.c
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/arm/arm32/arm32_tlb.c
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/arm/arm32/armv7_generic_space.c
cvs rdiff -u -r1.36 -r1.37 src/sys/arch/arm/arm32/db_machdep.c
cvs rdiff -u -r1.421 -r1.422 src/sys/arch/arm/arm32/pmap.c
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/arm/broadcom/bcm53xx_pax.c
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/arm/broadcom/bcmgen_space.c
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/arm/cortex/gicv3.c
cvs rdiff -u -r1.41 -r1.42 src/sys/arch/arm/cortex/gtmr.c
cvs rdiff -u -r1.33 -r1.34 src/sys/arch/arm/include/locore.h
cvs rdiff -u -r1.168 -r1.169 src/sys/arch/arm/include/arm32/pmap.h
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/arm/marvell/armadaxp.c
cvs rdiff -u -r1.30 -r1.31 src/sys/arch/arm/samsung/exynos_platform.c
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/arm/vexpress/vexpress_platform.c
cvs rdiff -u -r1.71 -r1.72 src/sys/arch/arm/vfp/vfp_init.c
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/arm/virt/virt_platform.c
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/zynq/zynq_space.c
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/evbarm/bcm53xx/bcm53xx_machdep.c
cvs rdiff -u -r1.84 -r1.85 src/sys/arch/evbarm/beagle/beagle_machdep.c
cvs rdiff -u -r1.68 -r1.69 src/sys/arch/evbarm/gumstix/gumstix_machdep.c
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/evbarm/zynq/zynq_machdep.c
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/tprof/tprof_armv7.c
cvs rdiff -u -r1.5 -r1.6 src/sys/dev/tprof/tprof_armv8.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/include/locore.h
diff -u src/sys/arch/aarch64/include/locore.h:1.5 src/sys/arch/aarch64/include/locore.h:1.6
--- src/sys/arch/aarch64/include/locore.h:1.5	Mon Jul  9 09:09:47 2018
+++ src/sys/arch/aarch64/include/locore.h	Fri Oct 30 18:54:35 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: locore.h,v 1.5 2018/07/09 09:09:47 jmcneill Exp $ */
+/* $NetBSD: locore.h,v 1.6 2020/10/30 18:54:35 skrll Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -86,18 +86,6 @@ daif_disable(register_t psw)
 	return oldpsw;
 }
 
-static inline void
-arm_dsb(void)
-{
-	__asm __volatile("dsb sy" ::: "memory");
-}
-
-static inline void
-arm_isb(void)
-{
-	__asm __volatile("isb" ::: "memory");
-}
-
 #endif /* _LOCORE */
 
 #elif defined(__arm__)

Index: src/sys/arch/arm/arm/cpufunc.c
diff -u src/sys/arch/arm/arm/cpufunc.c:1.177 src/sys/arch/arm/arm/cpufunc.c:1.178
--- src/sys/arch/arm/arm/cpufunc.c:1.177	Fri Jul 10 12:25:08 2020
+++ src/sys/arch/arm/arm/cpufunc.c	Fri Oct 30 18:54:36 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpufunc.c,v 1.177 2020/07/10 12:25:08 skrll Exp $	*/
+/*	$NetBSD: cpufunc.c,v 1.178 2020/10/30 18:54:36 skrll Exp $	*/
 
 /*
  * arm7tdmi support code Copyright (c) 2001 John Fremlin
@@ -49,7 +49,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cpufunc.c,v 1.177 2020/07/10 12:25:08 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpufunc.c,v 1.178 2020/10/30 18:54:36 skrll Exp $");
 
 #include "opt_arm_start.h"
 #include "opt_compat_netbsd.h"
@@ -1330,7 +1330,7 @@ get_cachesize_cp15(int cssr)
 	__asm volatile(".arch\tarmv7a");
 
 	armreg_csselr_write(cssr);
-	arm_isb();			 /* sync to the new cssr */
+	isb();			 /* sync to the new cssr */
 
 #else
 	__asm volatile("mcr p15, 1, %0, c0, c0, 2" :: "r" (cssr) : "memory");

Index: src/sys/arch/arm/arm32/arm32_kvminit.c
diff -u src/sys/arch/arm/arm32/arm32_kvminit.c:1.65 src/sys/arch/arm/arm32/arm32_kvminit.c:1.66
--- src/sys/arch/arm/arm32/arm32_kvminit.c:1.65	Fri Aug 28 13:36:52 2020
+++ 

CVS commit: src/usr.sbin/sysinst

2020-10-30 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Oct 30 18:47:38 UTC 2020

Modified Files:
src/usr.sbin/sysinst: Makefile.inc defs.h util.c

Log Message:
PR 55769: avoid the module set if we do not build any


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/usr.sbin/sysinst/Makefile.inc
cvs rdiff -u -r1.67 -r1.68 src/usr.sbin/sysinst/defs.h
cvs rdiff -u -r1.52 -r1.53 src/usr.sbin/sysinst/util.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/Makefile.inc
diff -u src/usr.sbin/sysinst/Makefile.inc:1.35 src/usr.sbin/sysinst/Makefile.inc:1.36
--- src/usr.sbin/sysinst/Makefile.inc:1.35	Mon May 18 21:19:36 2020
+++ src/usr.sbin/sysinst/Makefile.inc	Fri Oct 30 18:47:38 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.35 2020/05/18 21:19:36 jmcneill Exp $
+#	$NetBSD: Makefile.inc,v 1.36 2020/10/30 18:47:38 martin Exp $
 #
 # Makefile for sysinst
 
@@ -76,6 +76,10 @@ CPPFLAGS+=	-DUSING_PAXASTAR
 CPPFLAGS+=	-DHAVE_DTB
 .endif
 
+.if ${MKKMOD:Uno} != "no"
+CPPFLAGS+=	-DHAVE_MODULES
+.endif
+
 CATALOGDIR=	/usr/share/sysinst/catalog
 CPPFLAGS+=	-I. -I${.CURDIR}/../.. -I${.CURDIR} \
 		-I${.CURDIR}/../../../../sbin/fsck \

Index: src/usr.sbin/sysinst/defs.h
diff -u src/usr.sbin/sysinst/defs.h:1.67 src/usr.sbin/sysinst/defs.h:1.68
--- src/usr.sbin/sysinst/defs.h:1.67	Tue Oct 13 17:26:28 2020
+++ src/usr.sbin/sysinst/defs.h	Fri Oct 30 18:47:38 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: defs.h,v 1.67 2020/10/13 17:26:28 martin Exp $	*/
+/*	$NetBSD: defs.h,v 1.68 2020/10/30 18:47:38 martin Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -178,11 +178,16 @@ enum {
 /* All kernels */
 #define SET_KERNEL SET_KERNEL_1, SET_KERNEL_2, SET_KERNEL_3, SET_KERNEL_4, \
 		SET_KERNEL_5, SET_KERNEL_6, SET_KERNEL_7, SET_KERNEL_8
+#ifdef HAVE_MODULES
+#define	WITH_MODULES	SET_MODULES,
+#else
+#define	WITH_MODULES
+#endif
 /* Core system sets */
 #ifdef HAVE_DTB
-#define SET_CORE SET_MODULES, SET_BASE, SET_DTB, SET_ETC
+#define SET_CORE WITH_MODULES SET_BASE, SET_DTB, SET_ETC
 #else
-#define SET_CORE SET_MODULES, SET_BASE, SET_ETC
+#define SET_CORE WITH_MODULES SET_BASE, SET_ETC
 #endif
 /* All system sets */
 #define SET_SYSTEM SET_CORE, SET_COMPILER, SET_GAMES, \

Index: src/usr.sbin/sysinst/util.c
diff -u src/usr.sbin/sysinst/util.c:1.52 src/usr.sbin/sysinst/util.c:1.53
--- src/usr.sbin/sysinst/util.c:1.52	Tue Oct 27 15:28:01 2020
+++ src/usr.sbin/sysinst/util.c	Fri Oct 30 18:47:38 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: util.c,v 1.52 2020/10/27 15:28:01 martin Exp $	*/
+/*	$NetBSD: util.c,v 1.53 2020/10/30 18:47:38 martin Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -114,7 +114,9 @@ distinfo dist_list[] = {
 	{SET_KERNEL_9_NAME,	SET_KERNEL_9,		false, MSG_set_kernel_9, NULL},
 #endif
 
+#ifdef HAVE_MODULES
 	{"modules",		SET_MODULES,		false, MSG_set_modules, NULL},
+#endif
 	{"base",		SET_BASE,		false, MSG_set_base, NULL},
 #ifdef HAVE_DTB
 	{"dtb",			SET_DTB,		false, MSG_set_dtb, NULL},



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

2020-10-30 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Oct 30 17:55:11 UTC 2020

Modified Files:
src/usr.bin/make/unit-tests: directive-unexport.exp
directive-unexport.mk

Log Message:
make(1): add test for an edge case of .unexport


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/usr.bin/make/unit-tests/directive-unexport.exp
cvs rdiff -u -r1.2 -r1.3 src/usr.bin/make/unit-tests/directive-unexport.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/directive-unexport.exp
diff -u src/usr.bin/make/unit-tests/directive-unexport.exp:1.1 src/usr.bin/make/unit-tests/directive-unexport.exp:1.2
--- src/usr.bin/make/unit-tests/directive-unexport.exp:1.1	Sun Aug 16 12:07:51 2020
+++ src/usr.bin/make/unit-tests/directive-unexport.exp	Fri Oct 30 17:55:10 2020
@@ -1 +1,5 @@
+make: "directive-unexport.mk" line 14: A=a B=b C=c
+make: "directive-unexport.mk" line 15: A B C
+make: "directive-unexport.mk" line 23: A=a B=b C=c
+make: "directive-unexport.mk" line 24: 
 exit status 0

Index: src/usr.bin/make/unit-tests/directive-unexport.mk
diff -u src/usr.bin/make/unit-tests/directive-unexport.mk:1.2 src/usr.bin/make/unit-tests/directive-unexport.mk:1.3
--- src/usr.bin/make/unit-tests/directive-unexport.mk:1.2	Sun Aug 16 14:25:16 2020
+++ src/usr.bin/make/unit-tests/directive-unexport.mk	Fri Oct 30 17:55:10 2020
@@ -1,8 +1,27 @@
-# $NetBSD: directive-unexport.mk,v 1.2 2020/08/16 14:25:16 rillig Exp $
+# $NetBSD: directive-unexport.mk,v 1.3 2020/10/30 17:55:10 rillig Exp $
 #
 # Tests for the .unexport directive.
 
 # TODO: Implementation
 
+# First, export 3 variables.
+A=	a
+B=	b
+C=	c
+.export A B C
+
+# Show the exported variables and their values.
+.info ${:!env|sort|grep -v -E '^(MAKELEVEL|MALLOC_OPTIONS|PATH|PWD)'!}
+.info ${.MAKE.EXPORTED}
+
+# XXX: Now try to unexport all of them.  The variables are still exported
+# but not mentioned in .MAKE.EXPORTED anymore.
+# See the ":N" in Var_UnExport for the implementation.
+*=	asterisk
+.unexport *
+
+.info ${:!env|sort|grep -v -E '^(MAKELEVEL|MALLOC_OPTIONS|PATH|PWD)'!}
+.info ${.MAKE.EXPORTED}
+
 all:
 	@:;



CVS commit: src/usr.bin/make

2020-10-30 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Oct 30 17:10:48 UTC 2020

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

Log Message:
make(1): clean up comments and local variables in var.c


To generate a diff of this commit:
cvs rdiff -u -r1.176 -r1.177 src/usr.bin/make/make.h
cvs rdiff -u -r1.604 -r1.605 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/make.h
diff -u src/usr.bin/make/make.h:1.176 src/usr.bin/make/make.h:1.177
--- src/usr.bin/make/make.h:1.176	Fri Oct 30 07:19:30 2020
+++ src/usr.bin/make/make.h	Fri Oct 30 17:10:48 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: make.h,v 1.176 2020/10/30 07:19:30 rillig Exp $	*/
+/*	$NetBSD: make.h,v 1.177 2020/10/30 17:10:48 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -364,7 +364,7 @@ typedef struct GNode {
  *
  * Also used for the global variable scopes VAR_GLOBAL, VAR_CMDLINE,
  * VAR_INTERNAL, which contain variables with arbitrary names. */
-HashTable context;
+HashTable /* of Var pointer */ context;
 
 /* The commands to be given to a shell to create this target. */
 StringList *commands;

Index: src/usr.bin/make/var.c
diff -u src/usr.bin/make/var.c:1.604 src/usr.bin/make/var.c:1.605
--- src/usr.bin/make/var.c:1.604	Fri Oct 30 16:54:38 2020
+++ src/usr.bin/make/var.c	Fri Oct 30 17:10:48 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: var.c,v 1.604 2020/10/30 16:54:38 rillig Exp $	*/
+/*	$NetBSD: var.c,v 1.605 2020/10/30 17:10:48 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -129,7 +129,7 @@
 #include"metachar.h"
 
 /*	"@(#)var.c	8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: var.c,v 1.604 2020/10/30 16:54:38 rillig Exp $");
+MAKE_RCSID("$NetBSD: var.c,v 1.605 2020/10/30 17:10:48 rillig Exp $");
 
 #define VAR_DEBUG1(fmt, arg1) DEBUG1(VAR, fmt, arg1)
 #define VAR_DEBUG2(fmt, arg1, arg2) DEBUG2(VAR, fmt, arg1, arg2)
@@ -348,21 +348,17 @@ GNode_FindVar(GNode *ctxt, const char *v
 return HashTable_FindValueHash(>context, varname, hash);
 }
 
-/*-
- *---
- * VarFind --
- *	Find the given variable in the given context and any other contexts
- *	indicated.
+/* Find the variable in the context, and maybe in other contexts as well.
  *
  * Input:
  *	name		name to find
- *	ctxt		context in which to find it
- *	elsewhere	to look in other contexts as well
+ *	ctxt		context in which to look first
+ *	elsewhere	TRUE to look in other contexts as well
  *
  * Results:
- *	A pointer to the structure describing the desired variable or
- *	NULL if the variable does not exist.
- *---
+ *	The found variable, or NULL if the variable does not exist.
+ *	If the variable is an environment variable, it must be freed using
+ *	VarFreeEnv after use.
  */
 static Var *
 VarFind(const char *name, GNode *ctxt, Boolean elsewhere)
@@ -379,15 +375,13 @@ VarFind(const char *name, GNode *ctxt, B
 name = CanonicalVarname(name);
 nameHash = Hash_Hash(name);
 
-/*
- * First look for the variable in the given context. If it's not there,
- * look for it in VAR_CMDLINE, VAR_GLOBAL and the environment, in that order,
- * depending on the FIND_* flags in 'flags'
- */
+/* First look for the variable in the given context. */
 var = GNode_FindVar(ctxt, name, nameHash);
 if (!elsewhere)
 	return var;
 
+/* The variable was not found in the given context.  Now look for it in
+ * the other contexts as well. */
 if (var == NULL && ctxt != VAR_CMDLINE)
 	var = GNode_FindVar(VAR_CMDLINE, name, nameHash);
 
@@ -420,26 +414,23 @@ VarFind(const char *name, GNode *ctxt, B
 return var;
 }
 
-/*-
- *---
- * VarFreeEnv  --
- *	If the variable is an environment variable, free it
+/* If the variable is an environment variable, free it.
  *
  * Input:
  *	v		the variable
- *	destroy		true if the value buffer should be destroyed.
+ *	freeValue	true if the variable value should be freed as well
  *
  * Results:
  *	TRUE if it is an environment variable, FALSE otherwise.
- *---
  */
 static Boolean
-VarFreeEnv(Var *v, Boolean destroy)
+VarFreeEnv(Var *v, Boolean freeValue)
 {
 if (!(v->flags & VAR_FROM_ENV))
 	return FALSE;
+
 free(v->name_freeIt);
-Buf_Destroy(>val, destroy);
+Buf_Destroy(>val, freeValue);
 free(v);
 return TRUE;
 }
@@ -450,7 +441,7 @@ static void
 VarAdd(const char *name, const char *val, GNode *ctxt, VarSet_Flags flags)
 {
 HashEntry *he = HashTable_CreateEntry(>context, name, NULL);
-Var *v = VarNew(he->key, NULL, val,
+Var *v = VarNew(he->key /* aliased */, NULL, val,
 		flags & VAR_SET_READONLY ? VAR_READONLY : 0);
 

CVS commit: src/usr.bin/make

2020-10-30 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Oct 30 16:54:38 UTC 2020

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

Log Message:
make(1): fix documentation for VARP_SUB_ONE

The pattern is only replaced a single time, not everywhere in the first
matching word.


To generate a diff of this commit:
cvs rdiff -u -r1.603 -r1.604 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.603 src/usr.bin/make/var.c:1.604
--- src/usr.bin/make/var.c:1.603	Fri Oct 30 16:48:58 2020
+++ src/usr.bin/make/var.c	Fri Oct 30 16:54:38 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: var.c,v 1.603 2020/10/30 16:48:58 rillig Exp $	*/
+/*	$NetBSD: var.c,v 1.604 2020/10/30 16:54:38 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -129,7 +129,7 @@
 #include"metachar.h"
 
 /*	"@(#)var.c	8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: var.c,v 1.603 2020/10/30 16:48:58 rillig Exp $");
+MAKE_RCSID("$NetBSD: var.c,v 1.604 2020/10/30 16:54:38 rillig Exp $");
 
 #define VAR_DEBUG1(fmt, arg1) DEBUG1(VAR, fmt, arg1)
 #define VAR_DEBUG2(fmt, arg1, arg2) DEBUG2(VAR, fmt, arg1, arg2)
@@ -278,10 +278,10 @@ typedef enum VarExportFlags {
 
 /* Flags for pattern matching in the :S and :C modifiers */
 typedef enum VarPatternFlags {
-VARP_SUB_GLOBAL	= 0x01,	/* Apply substitution globally */
-VARP_SUB_ONE	= 0x02,	/* Apply substitution to one word */
-VARP_ANCHOR_START	= 0x04,	/* Match at start of word */
-VARP_ANCHOR_END	= 0x08	/* Match at end of word */
+VARP_SUB_GLOBAL	= 0x01,	/* Replace as often as possible ('g') */
+VARP_SUB_ONE	= 0x02,	/* Replace only once ('1') */
+VARP_ANCHOR_START	= 0x04,	/* Match at start of word ('^') */
+VARP_ANCHOR_END	= 0x08	/* Match at end of word ('$') */
 } VarPatternFlags;
 
 static Var *



CVS commit: src/usr.bin/make

2020-10-30 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Oct 30 16:48:58 UTC 2020

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

Log Message:
make(1): make iterating over HashTable simpler


To generate a diff of this commit:
cvs rdiff -u -r1.147 -r1.148 src/usr.bin/make/arch.c
cvs rdiff -u -r1.602 -r1.603 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/arch.c
diff -u src/usr.bin/make/arch.c:1.147 src/usr.bin/make/arch.c:1.148
--- src/usr.bin/make/arch.c:1.147	Sun Oct 25 19:19:07 2020
+++ src/usr.bin/make/arch.c	Fri Oct 30 16:48:58 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: arch.c,v 1.147 2020/10/25 19:19:07 rillig Exp $	*/
+/*	$NetBSD: arch.c,v 1.148 2020/10/30 16:48:58 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -130,7 +130,7 @@
 #include"config.h"
 
 /*	"@(#)arch.c	8.2 (Berkeley) 1/2/94"	*/
-MAKE_RCSID("$NetBSD: arch.c,v 1.147 2020/10/25 19:19:07 rillig Exp $");
+MAKE_RCSID("$NetBSD: arch.c,v 1.148 2020/10/30 16:48:58 rillig Exp $");
 
 #ifdef TARGET_MACHINE
 #undef MAKE_MACHINE
@@ -167,12 +167,11 @@ ArchFree(void *ap)
 {
 Arch *a = ap;
 HashIter hi;
-HashEntry *he;
 
 /* Free memory from hash entries */
 HashIter_Init(, >members);
-while ((he = HashIter_Next()) != NULL)
-	free(HashEntry_Get(he));
+while (HashIter_Next() != NULL)
+	free(hi.entry->value);
 
 free(a->name);
 free(a->fnametab);

Index: src/usr.bin/make/var.c
diff -u src/usr.bin/make/var.c:1.602 src/usr.bin/make/var.c:1.603
--- src/usr.bin/make/var.c:1.602	Fri Oct 30 16:45:37 2020
+++ src/usr.bin/make/var.c	Fri Oct 30 16:48:58 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: var.c,v 1.602 2020/10/30 16:45:37 rillig Exp $	*/
+/*	$NetBSD: var.c,v 1.603 2020/10/30 16:48:58 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -129,7 +129,7 @@
 #include"metachar.h"
 
 /*	"@(#)var.c	8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: var.c,v 1.602 2020/10/30 16:45:37 rillig Exp $");
+MAKE_RCSID("$NetBSD: var.c,v 1.603 2020/10/30 16:48:58 rillig Exp $");
 
 #define VAR_DEBUG1(fmt, arg1) DEBUG1(VAR, fmt, arg1)
 #define VAR_DEBUG2(fmt, arg1, arg2) DEBUG2(VAR, fmt, arg1, arg2)
@@ -602,12 +602,11 @@ Var_ExportVars(void)
 
 if (var_exportedVars == VAR_EXPORTED_ALL) {
 	HashIter hi;
-	HashEntry *he;
 
 	/* Ouch! Exporting all variables at once is crazy... */
 	HashIter_Init(, _GLOBAL->context);
-	while ((he = HashIter_Next()) != NULL) {
-	Var *var = HashEntry_Get(he);
+	while (HashIter_Next() != NULL) {
+	Var *var = hi.entry->value;
 	Var_Export1(var->name, 0);
 	}
 	return;
@@ -3893,15 +3892,14 @@ Var_Dump(GNode *ctxt)
 {
 Vector /* of const char * */ vec;
 HashIter hi;
-HashEntry *he;
 size_t i;
 const char **varnames;
 
 Vector_Init(, sizeof(const char *));
 
 HashIter_Init(, >context);
-while ((he = HashIter_Next()) != NULL)
-	*(const char **)Vector_Push() = he->key;
+while (HashIter_Next() != NULL)
+	*(const char **)Vector_Push() = hi.entry->key;
 varnames = vec.items;
 
 qsort(varnames, vec.len, sizeof varnames[0], str_cmp_asc);



CVS commit: src/usr.bin/make

2020-10-30 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Oct 30 16:45:37 UTC 2020

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

Log Message:
make(1): rename VAR_EXPORTED_YES to VAR_EXPORTED_SOME

The "yes" sounded too much like "all".


To generate a diff of this commit:
cvs rdiff -u -r1.601 -r1.602 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.601 src/usr.bin/make/var.c:1.602
--- src/usr.bin/make/var.c:1.601	Fri Oct 30 16:16:16 2020
+++ src/usr.bin/make/var.c	Fri Oct 30 16:45:37 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: var.c,v 1.601 2020/10/30 16:16:16 rillig Exp $	*/
+/*	$NetBSD: var.c,v 1.602 2020/10/30 16:45:37 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -129,7 +129,7 @@
 #include"metachar.h"
 
 /*	"@(#)var.c	8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: var.c,v 1.601 2020/10/30 16:16:16 rillig Exp $");
+MAKE_RCSID("$NetBSD: var.c,v 1.602 2020/10/30 16:45:37 rillig Exp $");
 
 #define VAR_DEBUG1(fmt, arg1) DEBUG1(VAR, fmt, arg1)
 #define VAR_DEBUG2(fmt, arg1, arg2) DEBUG2(VAR, fmt, arg1, arg2)
@@ -258,7 +258,7 @@ typedef struct Var {
  */
 typedef enum VarExportedMode {
 VAR_EXPORTED_NONE,
-VAR_EXPORTED_YES,
+VAR_EXPORTED_SOME,
 VAR_EXPORTED_ALL
 } VarExportedMode;
 
@@ -664,8 +664,8 @@ Var_Export(const char *str, Boolean isEx
 	for (i = 0; i < words.len; i++) {
 	const char *name = words.words[i];
 	if (Var_Export1(name, flags)) {
-		if (var_exportedVars != VAR_EXPORTED_ALL)
-		var_exportedVars = VAR_EXPORTED_YES;
+		if (var_exportedVars == VAR_EXPORTED_NONE)
+		var_exportedVars = VAR_EXPORTED_SOME;
 		if (isExport && (flags & VAR_EXPORT_PARENT)) {
 		Var_Append(MAKE_EXPORTED, name, VAR_GLOBAL);
 		}



CVS commit: src/sys/ddb

2020-10-30 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Oct 30 16:29:49 UTC 2020

Modified Files:
src/sys/ddb: db_command.c

Log Message:
Remove "also;"


To generate a diff of this commit:
cvs rdiff -u -r1.174 -r1.175 src/sys/ddb/db_command.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/ddb/db_command.c
diff -u src/sys/ddb/db_command.c:1.174 src/sys/ddb/db_command.c:1.175
--- src/sys/ddb/db_command.c:1.174	Fri Oct 30 16:08:44 2020
+++ src/sys/ddb/db_command.c	Fri Oct 30 16:29:49 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: db_command.c,v 1.174 2020/10/30 16:08:44 skrll Exp $	*/
+/*	$NetBSD: db_command.c,v 1.175 2020/10/30 16:29:49 skrll Exp $	*/
 
 /*
  * Copyright (c) 1996, 1997, 1998, 1999, 2002, 2009, 2019
@@ -61,7 +61,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: db_command.c,v 1.174 2020/10/30 16:08:44 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_command.c,v 1.175 2020/10/30 16:29:49 skrll Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_aio.h"
@@ -1374,7 +1374,6 @@ db_fdt_print_cmd(db_expr_t addr, bool ha
 	fdt_print(have_addr ? (void *)(uintptr_t)addr : fdtbus_get_data(),
 	full, db_printf);
 #else
-	also;
 	db_kernelonly();
 #endif
 }



CVS commit: src/usr.bin/make

2020-10-30 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Oct 30 16:16:16 UTC 2020

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

Log Message:
make(1): document VAR_READONLY, now that it is really read-only


To generate a diff of this commit:
cvs rdiff -u -r1.600 -r1.601 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.600 src/usr.bin/make/var.c:1.601
--- src/usr.bin/make/var.c:1.600	Fri Oct 30 16:09:56 2020
+++ src/usr.bin/make/var.c	Fri Oct 30 16:16:16 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: var.c,v 1.600 2020/10/30 16:09:56 rillig Exp $	*/
+/*	$NetBSD: var.c,v 1.601 2020/10/30 16:16:16 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -129,7 +129,7 @@
 #include"metachar.h"
 
 /*	"@(#)var.c	8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: var.c,v 1.600 2020/10/30 16:09:56 rillig Exp $");
+MAKE_RCSID("$NetBSD: var.c,v 1.601 2020/10/30 16:16:16 rillig Exp $");
 
 #define VAR_DEBUG1(fmt, arg1) DEBUG1(VAR, fmt, arg1)
 #define VAR_DEBUG2(fmt, arg1, arg2) DEBUG2(VAR, fmt, arg1, arg2)
@@ -192,23 +192,31 @@ GNode  *VAR_GLOBAL;	/* variables
 GNode  *VAR_CMDLINE;	/* variables defined on the command-line */
 
 typedef enum VarFlags {
+
 /* The variable's value is currently being used by Var_Parse or Var_Subst.
  * This marker is used to avoid endless recursion. */
 VAR_IN_USE = 0x01,
+
 /* The variable comes from the environment.
  * These variables are not registered in any GNode, therefore they must
  * be freed as soon as they are not used anymore. */
 VAR_FROM_ENV = 0x02,
+
 /* The variable is exported to the environment, to be used by child
  * processes. */
 VAR_EXPORTED = 0x10,
+
 /* At the point where this variable was exported, it contained an
  * unresolved reference to another variable.  Before any child process is
  * started, it needs to be exported again, in the hope that the referenced
  * variable can then be resolved. */
 VAR_REEXPORT = 0x20,
-/* The variable came from command line. */
+
+/* The variable came from the command line. */
 VAR_FROM_CMD = 0x40,
+
+/* The variable value cannot be changed anymore, and the variable cannot
+ * be deleted.  Any attempts to do so are ignored. */
 VAR_READONLY = 0x80
 } VarFlags;
 



CVS commit: src/usr.bin/make

2020-10-30 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Oct 30 16:09:56 UTC 2020

Modified Files:
src/usr.bin/make: var.c
src/usr.bin/make/unit-tests: varname-dot-shell.exp varname-dot-shell.mk

Log Message:
make(1): prevent appending to read-only variables


To generate a diff of this commit:
cvs rdiff -u -r1.599 -r1.600 src/usr.bin/make/var.c
cvs rdiff -u -r1.6 -r1.7 src/usr.bin/make/unit-tests/varname-dot-shell.exp
cvs rdiff -u -r1.5 -r1.6 src/usr.bin/make/unit-tests/varname-dot-shell.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/var.c
diff -u src/usr.bin/make/var.c:1.599 src/usr.bin/make/var.c:1.600
--- src/usr.bin/make/var.c:1.599	Fri Oct 30 15:39:17 2020
+++ src/usr.bin/make/var.c	Fri Oct 30 16:09:56 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: var.c,v 1.599 2020/10/30 15:39:17 rillig Exp $	*/
+/*	$NetBSD: var.c,v 1.600 2020/10/30 16:09:56 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -129,7 +129,7 @@
 #include"metachar.h"
 
 /*	"@(#)var.c	8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: var.c,v 1.599 2020/10/30 15:39:17 rillig Exp $");
+MAKE_RCSID("$NetBSD: var.c,v 1.600 2020/10/30 16:09:56 rillig Exp $");
 
 #define VAR_DEBUG1(fmt, arg1) DEBUG1(VAR, fmt, arg1)
 #define VAR_DEBUG2(fmt, arg1, arg2) DEBUG2(VAR, fmt, arg1, arg2)
@@ -945,6 +945,8 @@ Var_Append(const char *name, const char 
 
 if (v == NULL) {
 	Var_Set(name, val, ctxt);
+} else if (v->flags & VAR_READONLY) {
+VAR_DEBUG1("Ignoring append to %s since it is read-only\n", name);
 } else if (ctxt == VAR_CMDLINE || !(v->flags & VAR_FROM_CMD)) {
 	Buf_AddByte(>val, ' ');
 	Buf_AddStr(>val, val);

Index: src/usr.bin/make/unit-tests/varname-dot-shell.exp
diff -u src/usr.bin/make/unit-tests/varname-dot-shell.exp:1.6 src/usr.bin/make/unit-tests/varname-dot-shell.exp:1.7
--- src/usr.bin/make/unit-tests/varname-dot-shell.exp:1.6	Fri Oct 30 15:09:13 2020
+++ src/usr.bin/make/unit-tests/varname-dot-shell.exp	Fri Oct 30 16:09:56 2020
@@ -12,19 +12,19 @@ Var_Parse: ${ORIG_SHELL} with VARE_UNDEF
 lhs = "(details omitted)", rhs = "(details omitted)", op = !=
 ParseReadLine (19): '.MAKEFLAGS: .SHELL+=appended'
 ParseDoDependency(.MAKEFLAGS: .SHELL+=appended)
-Command:.SHELL = (details omitted) appended
-CondParser_Eval: ${.SHELL} != "${ORIG_SHELL} appended"
-Var_Parse: ${.SHELL} != "${ORIG_SHELL} appended" with VARE_UNDEFERR|VARE_WANTRES
-Var_Parse: ${ORIG_SHELL} appended" with VARE_WANTRES
-lhs = "/bin/sh appended", rhs = "/bin/sh appended", op = !=
+Ignoring append to .SHELL since it is read-only
+CondParser_Eval: ${.SHELL} != ${ORIG_SHELL}
+Var_Parse: ${.SHELL} != ${ORIG_SHELL} with VARE_UNDEFERR|VARE_WANTRES
+Var_Parse: ${ORIG_SHELL} with VARE_UNDEFERR|VARE_WANTRES
+lhs = "(details omitted)", rhs = "(details omitted)", op = !=
 ParseReadLine (27): '.undef .SHELL'
 Global:delete .SHELL
 ParseReadLine (28): '.SHELL=		newly overwritten'
 Global:.SHELL = newly overwritten
-CondParser_Eval: ${.SHELL} != "${ORIG_SHELL} appended"
-Var_Parse: ${.SHELL} != "${ORIG_SHELL} appended" with VARE_UNDEFERR|VARE_WANTRES
-Var_Parse: ${ORIG_SHELL} appended" with VARE_WANTRES
-lhs = "/bin/sh appended", rhs = "/bin/sh appended", op = !=
+CondParser_Eval: ${.SHELL} != ${ORIG_SHELL}
+Var_Parse: ${.SHELL} != ${ORIG_SHELL} with VARE_UNDEFERR|VARE_WANTRES
+Var_Parse: ${ORIG_SHELL} with VARE_UNDEFERR|VARE_WANTRES
+lhs = "(details omitted)", rhs = "(details omitted)", op = !=
 ParseReadLine (33): '.MAKEFLAGS: -d0'
 ParseDoDependency(.MAKEFLAGS: -d0)
 Global:.MAKEFLAGS =  -r -k -d cpv -d

Index: src/usr.bin/make/unit-tests/varname-dot-shell.mk
diff -u src/usr.bin/make/unit-tests/varname-dot-shell.mk:1.5 src/usr.bin/make/unit-tests/varname-dot-shell.mk:1.6
--- src/usr.bin/make/unit-tests/varname-dot-shell.mk:1.5	Fri Oct 30 15:09:13 2020
+++ src/usr.bin/make/unit-tests/varname-dot-shell.mk	Fri Oct 30 16:09:56 2020
@@ -1,4 +1,4 @@
-# $NetBSD: varname-dot-shell.mk,v 1.5 2020/10/30 15:09:13 rillig Exp $
+# $NetBSD: varname-dot-shell.mk,v 1.6 2020/10/30 16:09:56 rillig Exp $
 #
 # Tests for the special .SHELL variable, which contains the shell used for
 # running the commands.
@@ -15,9 +15,9 @@ ORIG_SHELL:=	${.SHELL}
 .endif
 
 # Trying to append to the variable.
-# Until 2020-10-30 this was possible.
+# Since 2020-10-30 this is prevented.
 .MAKEFLAGS: .SHELL+=appended
-.if ${.SHELL} != "${ORIG_SHELL} appended"
+.if ${.SHELL} != ${ORIG_SHELL}
 .  error
 .endif
 
@@ -26,7 +26,7 @@ ORIG_SHELL:=	${.SHELL}
 # but in the command-line context.
 .undef .SHELL
 .SHELL=		newly overwritten
-.if ${.SHELL} != "${ORIG_SHELL} appended"
+.if ${.SHELL} != ${ORIG_SHELL}
 .  error
 .endif
 



CVS commit: src/sys

2020-10-30 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Oct 30 16:08:45 UTC 2020

Modified Files:
src/sys/ddb: db_command.c
src/sys/dev/fdt: files.fdt
Added Files:
src/sys/dev/fdt: fdt_ddb.c fdt_ddb.h

Log Message:
Add a "show fdt" ddb command


To generate a diff of this commit:
cvs rdiff -u -r1.173 -r1.174 src/sys/ddb/db_command.c
cvs rdiff -u -r0 -r1.1 src/sys/dev/fdt/fdt_ddb.c src/sys/dev/fdt/fdt_ddb.h
cvs rdiff -u -r1.55 -r1.56 src/sys/dev/fdt/files.fdt

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

Modified files:

Index: src/sys/ddb/db_command.c
diff -u src/sys/ddb/db_command.c:1.173 src/sys/ddb/db_command.c:1.174
--- src/sys/ddb/db_command.c:1.173	Fri Oct 30 07:17:29 2020
+++ src/sys/ddb/db_command.c	Fri Oct 30 16:08:44 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: db_command.c,v 1.173 2020/10/30 07:17:29 skrll Exp $	*/
+/*	$NetBSD: db_command.c,v 1.174 2020/10/30 16:08:44 skrll Exp $	*/
 
 /*
  * Copyright (c) 1996, 1997, 1998, 1999, 2002, 2009, 2019
@@ -61,11 +61,12 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: db_command.c,v 1.173 2020/10/30 07:17:29 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_command.c,v 1.174 2020/10/30 16:08:44 skrll Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_aio.h"
 #include "opt_ddb.h"
+#include "opt_fdt.h"
 #include "opt_kgdb.h"
 #include "opt_mqueue.h"
 #include "opt_inet.h"
@@ -102,6 +103,11 @@ __KERNEL_RCSID(0, "$NetBSD: db_command.c
 
 #include 
 
+#ifdef FDT
+#include 
+#include 
+#endif
+
 /*
  * Results of command search.
  */
@@ -219,6 +225,9 @@ static void	db_vnode_print_cmd(db_expr_t
 static void	db_vnode_lock_print_cmd(db_expr_t, bool, db_expr_t,
 		const char *);
 static void	db_vmem_print_cmd(db_expr_t, bool, db_expr_t, const char *);
+#ifdef FDT
+static void	db_fdt_print_cmd(db_expr_t, bool, db_expr_t, const char *);
+#endif
 
 static const struct db_command db_show_cmds[] = {
 	{ DDB_ADD_CMD("all",	NULL,
@@ -239,6 +248,10 @@ static const struct db_command db_show_c
 	{ DDB_ADD_CMD("devices", db_show_all_devices,	0,NULL,NULL,NULL) },
 	{ DDB_ADD_CMD("event",	db_event_print_cmd,	0,
 	"Print all the non-zero evcnt(9) event counters.", "[/fitm]",NULL) },
+#ifdef FDT
+	{ DDB_ADD_CMD("fdt", db_fdt_print_cmd, 0,
+	"Show FDT information", NULL, NULL) },
+#endif
 	{ DDB_ADD_CMD("files", db_show_files_cmd,	0,
 	"Print the files open by process at address",
 	"[/f] address", NULL) },
@@ -1346,6 +1359,27 @@ db_show_lockstats(db_expr_t addr, bool h
 #endif
 }
 
+#ifdef FDT
+/*ARGSUSED*/
+static void
+db_fdt_print_cmd(db_expr_t addr, bool have_addr,
+db_expr_t count, const char *modif)
+{
+#ifdef _KERNEL /* XXX CRASH(8) */
+	bool full = false;
+
+	if (modif[0] == 'f')
+		full = true;
+
+	fdt_print(have_addr ? (void *)(uintptr_t)addr : fdtbus_get_data(),
+	full, db_printf);
+#else
+	also;
+	db_kernelonly();
+#endif
+}
+#endif
+
 /*
  * Call random function:
  * !expr(arg,arg,arg)

Index: src/sys/dev/fdt/files.fdt
diff -u src/sys/dev/fdt/files.fdt:1.55 src/sys/dev/fdt/files.fdt:1.56
--- src/sys/dev/fdt/files.fdt:1.55	Tue Oct 27 08:57:11 2020
+++ src/sys/dev/fdt/files.fdt	Fri Oct 30 16:08:45 2020
@@ -1,4 +1,4 @@
-# $NetBSD: files.fdt,v 1.55 2020/10/27 08:57:11 ryo Exp $
+# $NetBSD: files.fdt,v 1.56 2020/10/30 16:08:45 skrll Exp $
 
 include	"external/bsd/libfdt/conf/files.libfdt"
 
@@ -58,6 +58,7 @@ file	dev/fdt/fdt_subr.c			fdtbase
 file	dev/fdt/fdt_clock.c			fdt
 file	dev/fdt/fdt_dai.c			fdt
 file	dev/fdt/fdt_dma.c			fdt
+file	dev/fdt/fdt_ddb.c			fdt & ddb
 file	dev/fdt/fdt_gpio.c			fdt
 file	dev/fdt/fdt_i2c.c			fdt
 file	dev/fdt/fdt_intr.c			fdt

Added files:

Index: src/sys/dev/fdt/fdt_ddb.c
diff -u /dev/null src/sys/dev/fdt/fdt_ddb.c:1.1
--- /dev/null	Fri Oct 30 16:08:45 2020
+++ src/sys/dev/fdt/fdt_ddb.c	Fri Oct 30 16:08:45 2020
@@ -0,0 +1,154 @@
+/*	$NetBSD: fdt_ddb.c,v 1.1 2020/10/30 16:08:45 skrll Exp $	*/
+
+/*-
+ * Copyright (c) 2020 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Nick Hudson
+ *
+ * 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, 

CVS commit: src/usr.bin/make

2020-10-30 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Oct 30 15:39:17 UTC 2020

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

Log Message:
make(1): fix indentation in source code


To generate a diff of this commit:
cvs rdiff -u -r1.191 -r1.192 src/usr.bin/make/dir.c
cvs rdiff -u -r1.294 -r1.295 src/usr.bin/make/job.c
cvs rdiff -u -r1.410 -r1.411 src/usr.bin/make/main.c
cvs rdiff -u -r1.181 -r1.182 src/usr.bin/make/make.c
cvs rdiff -u -r1.131 -r1.132 src/usr.bin/make/meta.c
cvs rdiff -u -r1.411 -r1.412 src/usr.bin/make/parse.c
cvs rdiff -u -r1.227 -r1.228 src/usr.bin/make/suff.c
cvs rdiff -u -r1.598 -r1.599 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.191 src/usr.bin/make/dir.c:1.192
--- src/usr.bin/make/dir.c:1.191	Tue Oct 27 06:55:18 2020
+++ src/usr.bin/make/dir.c	Fri Oct 30 15:39:17 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: dir.c,v 1.191 2020/10/27 06:55:18 rillig Exp $	*/
+/*	$NetBSD: dir.c,v 1.192 2020/10/30 15:39:17 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -134,7 +134,7 @@
 #include "job.h"
 
 /*	"@(#)dir.c	8.2 (Berkeley) 1/2/94"	*/
-MAKE_RCSID("$NetBSD: dir.c,v 1.191 2020/10/27 06:55:18 rillig Exp $");
+MAKE_RCSID("$NetBSD: dir.c,v 1.192 2020/10/30 15:39:17 rillig Exp $");
 
 #define DIR_DEBUG0(text) DEBUG0(DIR, text)
 #define DIR_DEBUG1(fmt, arg1) DEBUG1(DIR, fmt, arg1)
@@ -1453,7 +1453,7 @@ Dir_CopyDirSearchPath(void)
 for (ln = dirSearchPath->first; ln != NULL; ln = ln->next) {
 	CachedDir *dir = ln->datum;
 	dir->refCount++;
-Lst_Append(path, dir);
+	Lst_Append(path, dir);
 }
 return path;
 }

Index: src/usr.bin/make/job.c
diff -u src/usr.bin/make/job.c:1.294 src/usr.bin/make/job.c:1.295
--- src/usr.bin/make/job.c:1.294	Fri Oct 30 07:19:30 2020
+++ src/usr.bin/make/job.c	Fri Oct 30 15:39:17 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: job.c,v 1.294 2020/10/30 07:19:30 rillig Exp $	*/
+/*	$NetBSD: job.c,v 1.295 2020/10/30 15:39:17 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -143,7 +143,7 @@
 #include "trace.h"
 
 /*	"@(#)job.c	8.2 (Berkeley) 3/19/94"	*/
-MAKE_RCSID("$NetBSD: job.c,v 1.294 2020/10/30 07:19:30 rillig Exp $");
+MAKE_RCSID("$NetBSD: job.c,v 1.295 2020/10/30 15:39:17 rillig Exp $");
 
 /* A shell defines how the commands are run.  All commands for a target are
  * written into a single file, which is then given to the shell to execute
@@ -877,7 +877,7 @@ JobPrintCommands(Job *job)
 StringListNode *ln;
 
 for (ln = job->node->commands->first; ln != NULL; ln = ln->next) {
-const char *cmd = ln->datum;
+	const char *cmd = ln->datum;
 
 	if (strcmp(cmd, "...") == 0) {
 	job->node->type |= OP_SAVE_CMDS;

Index: src/usr.bin/make/main.c
diff -u src/usr.bin/make/main.c:1.410 src/usr.bin/make/main.c:1.411
--- src/usr.bin/make/main.c:1.410	Fri Oct 30 07:19:30 2020
+++ src/usr.bin/make/main.c	Fri Oct 30 15:39:17 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.410 2020/10/30 07:19:30 rillig Exp $	*/
+/*	$NetBSD: main.c,v 1.411 2020/10/30 15:39:17 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -118,7 +118,7 @@
 #include "trace.h"
 
 /*	"@(#)main.c	8.3 (Berkeley) 3/19/94"	*/
-MAKE_RCSID("$NetBSD: main.c,v 1.410 2020/10/30 07:19:30 rillig Exp $");
+MAKE_RCSID("$NetBSD: main.c,v 1.411 2020/10/30 15:39:17 rillig Exp $");
 #if defined(MAKE_NATIVE) && !defined(lint)
 __COPYRIGHT("@(#) Copyright (c) 1988, 1989, 1990, 1993 "
 	"The Regents of the University of California.  "
@@ -2097,7 +2097,7 @@ PrintOnError(GNode *gn, const char *s)
 if (en)
 	return;/* we've been here! */
 if (gn)
-SetErrorVars(gn);
+	SetErrorVars(gn);
 expr = "${MAKE_PRINT_VAR_ON_ERROR:@v@$v='${$v}'\n@}";
 (void)Var_Subst(expr, VAR_GLOBAL, VARE_WANTRES, );
 /* TODO: handle errors */

Index: src/usr.bin/make/make.c
diff -u src/usr.bin/make/make.c:1.181 src/usr.bin/make/make.c:1.182
--- src/usr.bin/make/make.c:1.181	Mon Oct 26 21:34:10 2020
+++ src/usr.bin/make/make.c	Fri Oct 30 15:39:17 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: make.c,v 1.181 2020/10/26 21:34:10 rillig Exp $	*/
+/*	$NetBSD: make.c,v 1.182 2020/10/30 15:39:17 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -107,7 +107,7 @@
 #include"job.h"
 
 /*	"@(#)make.c	8.1 (Berkeley) 6/6/93"	*/
-MAKE_RCSID("$NetBSD: make.c,v 1.181 2020/10/26 21:34:10 rillig Exp $");
+MAKE_RCSID("$NetBSD: make.c,v 1.182 2020/10/30 15:39:17 rillig Exp $");
 
 /* Sequence # to detect recursion. */
 static unsigned int checked = 1;
@@ -615,7 +615,7 @@ Make_Update(GNode *cgn)
 checked++;
 
 {
-char *cname_freeIt;
+	char *cname_freeIt;
 	cname = Var_Value(TARGET, cgn, _freeIt);
 	assert(cname_freeIt == NULL);
 }
@@ -845,7 +845,7 @@ 

CVS commit: src/sys/dev/pci

2020-10-30 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Fri Oct 30 15:30:44 UTC 2020

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

Log Message:
support screen blanking of r5xx
somewhat crude but works


To generate a diff of this commit:
cvs rdiff -u -r1.111 -r1.112 src/sys/dev/pci/radeonfb.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/radeonfb.c
diff -u src/sys/dev/pci/radeonfb.c:1.111 src/sys/dev/pci/radeonfb.c:1.112
--- src/sys/dev/pci/radeonfb.c:1.111	Sun Oct 11 21:41:57 2020
+++ src/sys/dev/pci/radeonfb.c	Fri Oct 30 15:30:43 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: radeonfb.c,v 1.111 2020/10/11 21:41:57 jdc Exp $ */
+/*	$NetBSD: radeonfb.c,v 1.112 2020/10/30 15:30:43 macallan Exp $ */
 
 /*-
  * Copyright (c) 2006 Itronix Inc.
@@ -70,7 +70,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: radeonfb.c,v 1.111 2020/10/11 21:41:57 jdc Exp $");
+__KERNEL_RCSID(0, "$NetBSD: radeonfb.c,v 1.112 2020/10/30 15:30:43 macallan Exp $");
 
 #include 
 #include 
@@ -2558,11 +2558,14 @@ radeonfb_isblank(struct radeonfb_display
 	struct radeonfb_softc	*sc = dp->rd_softc;
 	uint32_t	reg, mask;
 
-	if (IS_AVIVO(sc)) return 0;
-
 	if(!dp->rd_softc->sc_mapped)
 		return 1;
 
+	if (IS_AVIVO(sc)) {
+		reg = GET32(sc, AVIVO_D1CRTC_CONTROL);
+		return ((reg & AVIVO_CRTC_EN) == 0);
+	}
+
 	if (dp->rd_crtcs[0].rc_number) {
 		reg = RADEON_CRTC2_GEN_CNTL;
 		mask = RADEON_CRTC2_DISP_DIS;
@@ -2581,11 +2584,27 @@ radeonfb_blank(struct radeonfb_display *
 	uint32_t		fpreg, fpval;
 	int			i;
 
-	if(IS_AVIVO(sc)) return;
 
 	if (!sc->sc_mapped)
 		return;
 
+	if(IS_AVIVO(sc)) {
+
+		/*
+		 * XXX
+		 * I don't know how to turn the sunc outputs off for DPMS
+		 * power control, so for now just turn the entire CRTC off
+		 */
+		if (blank) {
+			CLR32(sc, AVIVO_D1CRTC_CONTROL, AVIVO_CRTC_EN);
+			CLR32(sc, AVIVO_D2CRTC_CONTROL, AVIVO_CRTC_EN);
+		} else {
+			SET32(sc, AVIVO_D1CRTC_CONTROL, AVIVO_CRTC_EN);
+			SET32(sc, AVIVO_D2CRTC_CONTROL, AVIVO_CRTC_EN);
+		}
+		return;
+	}
+	/* non-AVIVO case */
 	for (i = 0; i < dp->rd_ncrtcs; i++) {
 
 		if (dp->rd_crtcs[i].rc_number) {



CVS commit: src/usr.bin/make

2020-10-30 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Oct 30 15:28:38 UTC 2020

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

Log Message:
make(1): extract MayExport from Var_Export1


To generate a diff of this commit:
cvs rdiff -u -r1.597 -r1.598 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.597 src/usr.bin/make/var.c:1.598
--- src/usr.bin/make/var.c:1.597	Fri Oct 30 07:47:11 2020
+++ src/usr.bin/make/var.c	Fri Oct 30 15:28:38 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: var.c,v 1.597 2020/10/30 07:47:11 rillig Exp $	*/
+/*	$NetBSD: var.c,v 1.598 2020/10/30 15:28:38 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -129,7 +129,7 @@
 #include"metachar.h"
 
 /*	"@(#)var.c	8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: var.c,v 1.597 2020/10/30 07:47:11 rillig Exp $");
+MAKE_RCSID("$NetBSD: var.c,v 1.598 2020/10/30 15:28:38 rillig Exp $");
 
 #define VAR_DEBUG1(fmt, arg1) DEBUG1(VAR, fmt, arg1)
 #define VAR_DEBUG2(fmt, arg1, arg2) DEBUG2(VAR, fmt, arg1, arg2)
@@ -480,21 +480,9 @@ Var_Delete(const char *name, GNode *ctxt
 }
 }
 
-
-/*
- * Export a single variable.
- * We ignore make internal variables (those which start with '.').
- * Also we jump through some hoops to avoid calling setenv
- * more than necessary since it can leak.
- * We only manipulate flags of vars if 'parent' is set.
- */
 static Boolean
-Var_Export1(const char *name, VarExportFlags flags)
+MayExport(const char *name)
 {
-VarExportFlags parent = flags & VAR_EXPORT_PARENT;
-Var *v;
-char *val;
-
 if (name[0] == '.')
 	return FALSE;		/* skip internals */
 if (name[0] == '-')
@@ -514,6 +502,25 @@ Var_Export1(const char *name, VarExportF
 	return FALSE;
 	}
 }
+return TRUE;
+}
+
+/*
+ * Export a single variable.
+ * We ignore make internal variables (those which start with '.').
+ * Also we jump through some hoops to avoid calling setenv
+ * more than necessary since it can leak.
+ * We only manipulate flags of vars if 'parent' is set.
+ */
+static Boolean
+Var_Export1(const char *name, VarExportFlags flags)
+{
+VarExportFlags parent = flags & VAR_EXPORT_PARENT;
+Var *v;
+char *val;
+
+if (!MayExport(name))
+	return FALSE;
 
 v = VarFind(name, VAR_GLOBAL, 0);
 if (v == NULL)



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

2020-10-30 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Oct 30 15:09:14 UTC 2020

Modified Files:
src/usr.bin/make/unit-tests: varname-dot-shell.exp varname-dot-shell.mk

Log Message:
make(1): demonstrate how to append to a read-only variable


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/usr.bin/make/unit-tests/varname-dot-shell.exp
cvs rdiff -u -r1.4 -r1.5 src/usr.bin/make/unit-tests/varname-dot-shell.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/varname-dot-shell.exp
diff -u src/usr.bin/make/unit-tests/varname-dot-shell.exp:1.5 src/usr.bin/make/unit-tests/varname-dot-shell.exp:1.6
--- src/usr.bin/make/unit-tests/varname-dot-shell.exp:1.5	Fri Oct 30 15:03:58 2020
+++ src/usr.bin/make/unit-tests/varname-dot-shell.exp	Fri Oct 30 15:09:13 2020
@@ -10,15 +10,22 @@ CondParser_Eval: ${.SHELL} != ${ORIG_SHE
 Var_Parse: ${.SHELL} != ${ORIG_SHELL} with VARE_UNDEFERR|VARE_WANTRES
 Var_Parse: ${ORIG_SHELL} with VARE_UNDEFERR|VARE_WANTRES
 lhs = "(details omitted)", rhs = "(details omitted)", op = !=
-ParseReadLine (20): '.undef .SHELL'
+ParseReadLine (19): '.MAKEFLAGS: .SHELL+=appended'
+ParseDoDependency(.MAKEFLAGS: .SHELL+=appended)
+Command:.SHELL = (details omitted) appended
+CondParser_Eval: ${.SHELL} != "${ORIG_SHELL} appended"
+Var_Parse: ${.SHELL} != "${ORIG_SHELL} appended" with VARE_UNDEFERR|VARE_WANTRES
+Var_Parse: ${ORIG_SHELL} appended" with VARE_WANTRES
+lhs = "/bin/sh appended", rhs = "/bin/sh appended", op = !=
+ParseReadLine (27): '.undef .SHELL'
 Global:delete .SHELL
-ParseReadLine (21): '.SHELL=		newly overwritten'
+ParseReadLine (28): '.SHELL=		newly overwritten'
 Global:.SHELL = newly overwritten
-CondParser_Eval: ${.SHELL} != ${ORIG_SHELL}
-Var_Parse: ${.SHELL} != ${ORIG_SHELL} with VARE_UNDEFERR|VARE_WANTRES
-Var_Parse: ${ORIG_SHELL} with VARE_UNDEFERR|VARE_WANTRES
-lhs = "(details omitted)", rhs = "(details omitted)", op = !=
-ParseReadLine (26): '.MAKEFLAGS: -d0'
+CondParser_Eval: ${.SHELL} != "${ORIG_SHELL} appended"
+Var_Parse: ${.SHELL} != "${ORIG_SHELL} appended" with VARE_UNDEFERR|VARE_WANTRES
+Var_Parse: ${ORIG_SHELL} appended" with VARE_WANTRES
+lhs = "/bin/sh appended", rhs = "/bin/sh appended", op = !=
+ParseReadLine (33): '.MAKEFLAGS: -d0'
 ParseDoDependency(.MAKEFLAGS: -d0)
 Global:.MAKEFLAGS =  -r -k -d cpv -d
 Global:.MAKEFLAGS =  -r -k -d cpv -d 0

Index: src/usr.bin/make/unit-tests/varname-dot-shell.mk
diff -u src/usr.bin/make/unit-tests/varname-dot-shell.mk:1.4 src/usr.bin/make/unit-tests/varname-dot-shell.mk:1.5
--- src/usr.bin/make/unit-tests/varname-dot-shell.mk:1.4	Fri Oct 30 15:03:58 2020
+++ src/usr.bin/make/unit-tests/varname-dot-shell.mk	Fri Oct 30 15:09:13 2020
@@ -1,4 +1,4 @@
-# $NetBSD: varname-dot-shell.mk,v 1.4 2020/10/30 15:03:58 rillig Exp $
+# $NetBSD: varname-dot-shell.mk,v 1.5 2020/10/30 15:09:13 rillig Exp $
 #
 # Tests for the special .SHELL variable, which contains the shell used for
 # running the commands.
@@ -14,12 +14,19 @@ ORIG_SHELL:=	${.SHELL}
 .  error
 .endif
 
+# Trying to append to the variable.
+# Until 2020-10-30 this was possible.
+.MAKEFLAGS: .SHELL+=appended
+.if ${.SHELL} != "${ORIG_SHELL} appended"
+.  error
+.endif
+
 # Trying to delete the variable.
 # This has no effect since the variable is not defined in the global context,
 # but in the command-line context.
 .undef .SHELL
 .SHELL=		newly overwritten
-.if ${.SHELL} != ${ORIG_SHELL}
+.if ${.SHELL} != "${ORIG_SHELL} appended"
 .  error
 .endif
 



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

2020-10-30 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Oct 30 15:03:58 UTC 2020

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

Log Message:
make(1): move test flags for varname-dot-shell to the test itself


To generate a diff of this commit:
cvs rdiff -u -r1.176 -r1.177 src/usr.bin/make/unit-tests/Makefile
cvs rdiff -u -r1.4 -r1.5 src/usr.bin/make/unit-tests/varname-dot-shell.exp
cvs rdiff -u -r1.3 -r1.4 src/usr.bin/make/unit-tests/varname-dot-shell.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.176 src/usr.bin/make/unit-tests/Makefile:1.177
--- src/usr.bin/make/unit-tests/Makefile:1.176	Thu Oct 29 18:19:41 2020
+++ src/usr.bin/make/unit-tests/Makefile	Fri Oct 30 15:03:58 2020
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.176 2020/10/29 18:19:41 rillig Exp $
+# $NetBSD: Makefile,v 1.177 2020/10/30 15:03:58 rillig Exp $
 #
 # Unit tests for make(1)
 #
@@ -398,7 +398,6 @@ FLAGS.order=		-j1
 FLAGS.recursive=	-dL
 FLAGS.sh-leading-plus=	-n
 FLAGS.varmod-match-escape= -dv
-FLAGS.varname-dot-shell= -dpv
 FLAGS.varname-empty=	-dv '$${:U}=cmdline-u' '=cmline-plain'
 
 # Some tests need extra postprocessing.
@@ -431,17 +430,15 @@ SED_CMDS.varshell+=	-e 's,^${.SHELL:T}: 
 SED_CMDS.varshell+=	-e '/command/s,No such.*,not found,'
 SED_CMDS.varname-dot-parsedir=	-e '/in some cases/ s,^make: "[^"]*,make: ",'
 SED_CMDS.varname-dot-parsefile=	-e '/in some cases/ s,^make: "[^"]*,make: ",'
-SED_CMDS.varname-dot-shell=	-e 's, = /.*, = (details omitted),'
-SED_CMDS.varname-dot-shell+=	-e 's,"/[^"]*","(details omitted)",'
-SED_CMDS.varname-dot-shell+=	-e 's,\[/[^]]*\],[(details omitted)],'
+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'
 
 # Some tests need an additional round of postprocessing.
 POSTPROC.deptgt-suffixes= \
 			${TOOL_SED} -n -e '/^\#\*\*\* Suffixes/,/^\#\*/p'
 POSTPROC.varmod-match-escape= ${TOOL_SED} -n -e '/^Pattern/p'
 POSTPROC.varname=	${TOOL_SED} -n -e '/^MAGIC/p' -e '/^ORDER_/p'
-POSTPROC.varname-dot-shell= \
-			awk '/\.SHELL/ || /^ParseReadLine/'
 POSTPROC.varname-empty=	${TOOL_SED} -n -e '/^Var_Set/p' -e '/^out:/p'
 
 # Some tests reuse other tests, which makes them unnecessarily fragile.

Index: src/usr.bin/make/unit-tests/varname-dot-shell.exp
diff -u src/usr.bin/make/unit-tests/varname-dot-shell.exp:1.4 src/usr.bin/make/unit-tests/varname-dot-shell.exp:1.5
--- src/usr.bin/make/unit-tests/varname-dot-shell.exp:1.4	Tue Sep 22 06:13:39 2020
+++ src/usr.bin/make/unit-tests/varname-dot-shell.exp	Fri Oct 30 15:03:58 2020
@@ -1,19 +1,25 @@
-ParseReadLine (8): 'ORIG_SHELL:=	${.SHELL}'
+ParseReadLine (10): 'ORIG_SHELL:=	${.SHELL}'
+Global:ORIG_SHELL = 
 Var_Parse: ${.SHELL} with VARE_WANTRES|VARE_ASSIGN
 Global:delete .SHELL (not found)
 Command:.SHELL = (details omitted)
-ParseReadLine (10): '.SHELL=		overwritten'
+Global:ORIG_SHELL = (details omitted)
+ParseReadLine (12): '.SHELL=		overwritten'
 Global:.SHELL = overwritten
+CondParser_Eval: ${.SHELL} != ${ORIG_SHELL}
 Var_Parse: ${.SHELL} != ${ORIG_SHELL} with VARE_UNDEFERR|VARE_WANTRES
-ParseReadLine (18): '.undef .SHELL'
+Var_Parse: ${ORIG_SHELL} with VARE_UNDEFERR|VARE_WANTRES
+lhs = "(details omitted)", rhs = "(details omitted)", op = !=
+ParseReadLine (20): '.undef .SHELL'
 Global:delete .SHELL
-ParseReadLine (19): '.SHELL=		newly overwritten'
+ParseReadLine (21): '.SHELL=		newly overwritten'
 Global:.SHELL = newly overwritten
+CondParser_Eval: ${.SHELL} != ${ORIG_SHELL}
 Var_Parse: ${.SHELL} != ${ORIG_SHELL} with VARE_UNDEFERR|VARE_WANTRES
-ParseReadLine (24): 'all:'
-ParseReadLine (25): '	@echo ${.SHELL:M*}'
-Var_Parse: ${.SHELL:M*} with VARE_WANTRES
-Applying ${.SHELL:M...} to "(details omitted)" (VARE_WANTRES, VAR_READONLY, none)
-Pattern[.SHELL] for [(details omitted)] is [*]
-Result of ${.SHELL:M*} is "(details omitted)" (VARE_WANTRES, VAR_READONLY, none)
+Var_Parse: ${ORIG_SHELL} with VARE_UNDEFERR|VARE_WANTRES
+lhs = "(details omitted)", rhs = "(details omitted)", op = !=
+ParseReadLine (26): '.MAKEFLAGS: -d0'
+ParseDoDependency(.MAKEFLAGS: -d0)
+Global:.MAKEFLAGS =  -r -k -d cpv -d
+Global:.MAKEFLAGS =  -r -k -d cpv -d 0
 exit status 0

Index: src/usr.bin/make/unit-tests/varname-dot-shell.mk
diff -u src/usr.bin/make/unit-tests/varname-dot-shell.mk:1.3 src/usr.bin/make/unit-tests/varname-dot-shell.mk:1.4
--- src/usr.bin/make/unit-tests/varname-dot-shell.mk:1.3	Sat Oct 24 08:46:08 2020
+++ src/usr.bin/make/unit-tests/varname-dot-shell.mk	Fri Oct 30 15:03:58 2020
@@ -1,10 +1,12 @@
-# $NetBSD: varname-dot-shell.mk,v 1.3 2020/10/24 08:46:08 rillig Exp $
+# $NetBSD: varname-dot-shell.mk,v 1.4 2020/10/30 15:03:58 rillig Exp $
 #
 # Tests 

CVS commit: src/usr.bin/make

2020-10-30 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Oct 30 14:56:23 UTC 2020

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

Log Message:
make(1): clean up is_separator


To generate a diff of this commit:
cvs rdiff -u -r1.171 -r1.172 src/usr.bin/make/cond.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/cond.c
diff -u src/usr.bin/make/cond.c:1.171 src/usr.bin/make/cond.c:1.172
--- src/usr.bin/make/cond.c:1.171	Fri Oct 30 14:51:47 2020
+++ src/usr.bin/make/cond.c	Fri Oct 30 14:56:23 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: cond.c,v 1.171 2020/10/30 14:51:47 rillig Exp $	*/
+/*	$NetBSD: cond.c,v 1.172 2020/10/30 14:56:23 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -93,7 +93,7 @@
 #include "dir.h"
 
 /*	"@(#)cond.c	8.2 (Berkeley) 1/2/94"	*/
-MAKE_RCSID("$NetBSD: cond.c,v 1.171 2020/10/30 14:51:47 rillig Exp $");
+MAKE_RCSID("$NetBSD: cond.c,v 1.172 2020/10/30 14:56:23 rillig Exp $");
 
 /*
  * The parsing of conditional expressions is based on this grammar:
@@ -376,7 +376,7 @@ TryParseNumber(const char *str, double *
 static Boolean
 is_separator(char ch)
 {
-return ch == '\0' || ch_isspace(ch) || strchr("!=><)", ch);
+return ch == '\0' || ch_isspace(ch) || strchr("!=><)", ch) != NULL;
 }
 
 /*-



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

2020-10-30 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Oct 30 14:53:31 UTC 2020

Modified Files:
src/usr.bin/make/unit-tests: cond-cmp-string.mk

Log Message:
make(1): fix comments in test for string literals in conditions


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/usr.bin/make/unit-tests/cond-cmp-string.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/cond-cmp-string.mk
diff -u src/usr.bin/make/unit-tests/cond-cmp-string.mk:1.10 src/usr.bin/make/unit-tests/cond-cmp-string.mk:1.11
--- src/usr.bin/make/unit-tests/cond-cmp-string.mk:1.10	Fri Oct 30 14:51:47 2020
+++ src/usr.bin/make/unit-tests/cond-cmp-string.mk	Fri Oct 30 14:53:31 2020
@@ -1,4 +1,4 @@
-# $NetBSD: cond-cmp-string.mk,v 1.10 2020/10/30 14:51:47 rillig Exp $
+# $NetBSD: cond-cmp-string.mk,v 1.11 2020/10/30 14:53:31 rillig Exp $
 #
 # Tests for string comparisons in .if conditions.
 
@@ -63,9 +63,8 @@
 .if ${:Uword } != "${:Uword} "
 .  error
 .endif
-
-# Some other characters work though, and some don't.
-# Those that are mentioned in is_separator don't work.
+# Some other characters worked though, and some didn't.
+# Those that are mentioned in is_separator didn't work.
 .if ${:Uword0} != "${:Uword}0"
 .  error
 .endif



CVS commit: src/usr.bin/make

2020-10-30 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Oct 30 14:51:47 UTC 2020

Modified Files:
src/usr.bin/make: cond.c
src/usr.bin/make/unit-tests: cond-cmp-string.exp cond-cmp-string.mk

Log Message:
make(1): fix parse error in string literal in conditional

The string literal "${VAR} " had produced a "Malformed conditional", at
least since 2003.  (That's the oldest make I have available for testing.)
Strange that nobody else noticed that in the last 17 years.


To generate a diff of this commit:
cvs rdiff -u -r1.170 -r1.171 src/usr.bin/make/cond.c
cvs rdiff -u -r1.6 -r1.7 src/usr.bin/make/unit-tests/cond-cmp-string.exp
cvs rdiff -u -r1.9 -r1.10 src/usr.bin/make/unit-tests/cond-cmp-string.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/cond.c
diff -u src/usr.bin/make/cond.c:1.170 src/usr.bin/make/cond.c:1.171
--- src/usr.bin/make/cond.c:1.170	Fri Oct 30 07:19:30 2020
+++ src/usr.bin/make/cond.c	Fri Oct 30 14:51:47 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: cond.c,v 1.170 2020/10/30 07:19:30 rillig Exp $	*/
+/*	$NetBSD: cond.c,v 1.171 2020/10/30 14:51:47 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -93,7 +93,7 @@
 #include "dir.h"
 
 /*	"@(#)cond.c	8.2 (Berkeley) 1/2/94"	*/
-MAKE_RCSID("$NetBSD: cond.c,v 1.170 2020/10/30 07:19:30 rillig Exp $");
+MAKE_RCSID("$NetBSD: cond.c,v 1.171 2020/10/30 14:51:47 rillig Exp $");
 
 /*
  * The parsing of conditional expressions is based on this grammar:
@@ -406,9 +406,9 @@ CondParser_String(CondParser *par, Boole
 str = NULL;
 *freeIt = NULL;
 *quoted = qt = par->p[0] == '"' ? 1 : 0;
+start = par->p;
 if (qt)
 	par->p++;
-start = par->p;
 while (par->p[0] && str == NULL) {
 	switch (par->p[0]) {
 	case '\\':

Index: src/usr.bin/make/unit-tests/cond-cmp-string.exp
diff -u src/usr.bin/make/unit-tests/cond-cmp-string.exp:1.6 src/usr.bin/make/unit-tests/cond-cmp-string.exp:1.7
--- src/usr.bin/make/unit-tests/cond-cmp-string.exp:1.6	Fri Oct 30 14:46:01 2020
+++ src/usr.bin/make/unit-tests/cond-cmp-string.exp	Fri Oct 30 14:51:47 2020
@@ -3,9 +3,6 @@ make: "cond-cmp-string.mk" line 37: Malf
 make: "cond-cmp-string.mk" line 42: warning: String comparison operator must be either == or !=
 make: "cond-cmp-string.mk" line 42: Malformed conditional (!("value" = "value"))
 make: "cond-cmp-string.mk" line 49: Malformed conditional (!("value" === "value"))
-make: "cond-cmp-string.mk" line 63: Malformed conditional (${:Uword} != "${:Uword} ")
-make: "cond-cmp-string.mk" line 77: Malformed conditional (${:Uword!} != "${:Uword}!")
-make: "cond-cmp-string.mk" line 80: Malformed conditional (${:Uword<} != "${:Uword}<")
 make: Fatal errors encountered -- cannot continue
 make: stopped in unit-tests
 exit status 1

Index: src/usr.bin/make/unit-tests/cond-cmp-string.mk
diff -u src/usr.bin/make/unit-tests/cond-cmp-string.mk:1.9 src/usr.bin/make/unit-tests/cond-cmp-string.mk:1.10
--- src/usr.bin/make/unit-tests/cond-cmp-string.mk:1.9	Fri Oct 30 14:46:01 2020
+++ src/usr.bin/make/unit-tests/cond-cmp-string.mk	Fri Oct 30 14:51:47 2020
@@ -1,4 +1,4 @@
-# $NetBSD: cond-cmp-string.mk,v 1.9 2020/10/30 14:46:01 rillig Exp $
+# $NetBSD: cond-cmp-string.mk,v 1.10 2020/10/30 14:51:47 rillig Exp $
 #
 # Tests for string comparisons in .if conditions.
 
@@ -57,12 +57,10 @@
 .  error
 .endif
 
-# XXX: As of 2020-10-30, adding literal characters to the string results
-# in a parse error.  This is a bug and should have been caught much earlier.
-# I wonder since when it exists.
-.if ${:Uword} != "${:Uword} "
-.  error
-.else
+# Between 2003-01-01 (maybe even earlier) and 2020-10-30, adding one of the
+# characters " \t!=><" directly after a variable expression resulted in a
+# "Malformed conditional", even though the string was well-formed.
+.if ${:Uword } != "${:Uword} "
 .  error
 .endif
 



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

2020-10-30 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Oct 30 14:46:01 UTC 2020

Modified Files:
src/usr.bin/make/unit-tests: cond-cmp-string.exp cond-cmp-string.mk

Log Message:
make(1): add more test cases that fail in condition string literals


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/usr.bin/make/unit-tests/cond-cmp-string.exp
cvs rdiff -u -r1.8 -r1.9 src/usr.bin/make/unit-tests/cond-cmp-string.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/cond-cmp-string.exp
diff -u src/usr.bin/make/unit-tests/cond-cmp-string.exp:1.5 src/usr.bin/make/unit-tests/cond-cmp-string.exp:1.6
--- src/usr.bin/make/unit-tests/cond-cmp-string.exp:1.5	Fri Oct 30 08:13:17 2020
+++ src/usr.bin/make/unit-tests/cond-cmp-string.exp	Fri Oct 30 14:46:01 2020
@@ -4,6 +4,8 @@ make: "cond-cmp-string.mk" line 42: warn
 make: "cond-cmp-string.mk" line 42: Malformed conditional (!("value" = "value"))
 make: "cond-cmp-string.mk" line 49: Malformed conditional (!("value" === "value"))
 make: "cond-cmp-string.mk" line 63: Malformed conditional (${:Uword} != "${:Uword} ")
+make: "cond-cmp-string.mk" line 77: Malformed conditional (${:Uword!} != "${:Uword}!")
+make: "cond-cmp-string.mk" line 80: Malformed conditional (${:Uword<} != "${:Uword}<")
 make: Fatal errors encountered -- cannot continue
 make: stopped in unit-tests
 exit status 1

Index: src/usr.bin/make/unit-tests/cond-cmp-string.mk
diff -u src/usr.bin/make/unit-tests/cond-cmp-string.mk:1.8 src/usr.bin/make/unit-tests/cond-cmp-string.mk:1.9
--- src/usr.bin/make/unit-tests/cond-cmp-string.mk:1.8	Fri Oct 30 13:41:14 2020
+++ src/usr.bin/make/unit-tests/cond-cmp-string.mk	Fri Oct 30 14:46:01 2020
@@ -1,4 +1,4 @@
-# $NetBSD: cond-cmp-string.mk,v 1.8 2020/10/30 13:41:14 rillig Exp $
+# $NetBSD: cond-cmp-string.mk,v 1.9 2020/10/30 14:46:01 rillig Exp $
 #
 # Tests for string comparisons in .if conditions.
 
@@ -66,6 +66,21 @@
 .  error
 .endif
 
+# Some other characters work though, and some don't.
+# Those that are mentioned in is_separator don't work.
+.if ${:Uword0} != "${:Uword}0"
+.  error
+.endif
+.if ${:Uword&} != "${:Uword}&"
+.  error
+.endif
+.if ${:Uword!} != "${:Uword}!"
+.  error
+.endif
+.if ${:Uword<} != "${:Uword}<"
+.  error
+.endif
+
 # Adding another variable expression to the string literal works though.
 .if ${:Uword} != "${:Uwo}${:Urd}"
 .  error



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

2020-10-30 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Oct 30 13:41:14 UTC 2020

Modified Files:
src/usr.bin/make/unit-tests: cond-cmp-string.mk

Log Message:
make(1): add test for two variable expressions in a string literal


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/usr.bin/make/unit-tests/cond-cmp-string.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/cond-cmp-string.mk
diff -u src/usr.bin/make/unit-tests/cond-cmp-string.mk:1.7 src/usr.bin/make/unit-tests/cond-cmp-string.mk:1.8
--- src/usr.bin/make/unit-tests/cond-cmp-string.mk:1.7	Fri Oct 30 08:13:17 2020
+++ src/usr.bin/make/unit-tests/cond-cmp-string.mk	Fri Oct 30 13:41:14 2020
@@ -1,4 +1,4 @@
-# $NetBSD: cond-cmp-string.mk,v 1.7 2020/10/30 08:13:17 rillig Exp $
+# $NetBSD: cond-cmp-string.mk,v 1.8 2020/10/30 13:41:14 rillig Exp $
 #
 # Tests for string comparisons in .if conditions.
 
@@ -57,8 +57,8 @@
 .  error
 .endif
 
-# XXX: As of 2020-10-30, adding a space to the string results in a parse
-# error.  This is a bug and should have been caught much earlier.
+# XXX: As of 2020-10-30, adding literal characters to the string results
+# in a parse error.  This is a bug and should have been caught much earlier.
 # I wonder since when it exists.
 .if ${:Uword} != "${:Uword} "
 .  error
@@ -66,6 +66,11 @@
 .  error
 .endif
 
+# Adding another variable expression to the string literal works though.
+.if ${:Uword} != "${:Uwo}${:Urd}"
+.  error
+.endif
+
 # Adding a space at the beginning of the quoted variable expression works
 # though.
 .if ${:U word } != " ${:Uword} "



CVS commit: src/external/public-domain/sqlite/dist

2020-10-30 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Fri Oct 30 12:32:04 UTC 2020

Modified Files:
src/external/public-domain/sqlite/dist: sqlite3.c

Log Message:
Use the same macro used before for avoiding too large floats on vax.

This has the advantage of not changing the number for non-vax, so is a
safer change for those architectures.
(Might not actually matter).


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/external/public-domain/sqlite/dist/sqlite3.c

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

Modified files:

Index: src/external/public-domain/sqlite/dist/sqlite3.c
diff -u src/external/public-domain/sqlite/dist/sqlite3.c:1.19 src/external/public-domain/sqlite/dist/sqlite3.c:1.20
--- src/external/public-domain/sqlite/dist/sqlite3.c:1.19	Fri Oct 30 06:02:05 2020
+++ src/external/public-domain/sqlite/dist/sqlite3.c	Fri Oct 30 12:32:04 2020
@@ -185409,7 +185409,7 @@ SQLITE_API int sqlite3_rtree_init(
 **May you share freely, never taking more than you give.
 **
 *
-** $Id: sqlite3.c,v 1.19 2020/10/30 06:02:05 martin Exp $
+** $Id: sqlite3.c,v 1.20 2020/10/30 12:32:04 maya Exp $
 **
 ** This file implements an integration between the ICU library 
 ** ("International Components for Unicode", an open-source library 
@@ -213756,7 +213756,7 @@ static int fts5BestIndexMethod(sqlite3_v
   }else{
 /* As there exists an unusable MATCH constraint this is an 
 ** unusable plan. Set a prohibitively high cost. */
-pInfo->estimatedCost = DBL_MAX;
+pInfo->estimatedCost = SQLITE_HUGE_COST;
 return SQLITE_OK;
   }
 }else if( p->op<=SQLITE_INDEX_CONSTRAINT_MATCH ){



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

2020-10-30 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Fri Oct 30 11:02:50 UTC 2020

Modified Files:
src/sys/arch/evbarm/conf: RPI

Log Message:
Add bigger console font for modern displays.


To generate a diff of this commit:
cvs rdiff -u -r1.92 -r1.93 src/sys/arch/evbarm/conf/RPI

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

Modified files:

Index: src/sys/arch/evbarm/conf/RPI
diff -u src/sys/arch/evbarm/conf/RPI:1.92 src/sys/arch/evbarm/conf/RPI:1.93
--- src/sys/arch/evbarm/conf/RPI:1.92	Fri Oct 30 11:02:09 2020
+++ src/sys/arch/evbarm/conf/RPI	Fri Oct 30 11:02:50 2020
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: RPI,v 1.92 2020/10/30 11:02:09 rin Exp $
+#	$NetBSD: RPI,v 1.93 2020/10/30 11:02:50 rin Exp $
 #
 #	RPi -- Raspberry Pi
 #
@@ -198,6 +198,9 @@ options 	WSDISPLAY_COMPAT_USL		# wsconsc
 options 	WSDISPLAY_COMPAT_RAWKBD		# can get raw scancodes
 options 	WSDISPLAY_DEFAULTSCREENS=4
 
+options 	FONT_BOLD8x16
+options 	FONT_BOLD16x32
+
 #options 	FONT_QVSS8x15
 #options 	FONT_GALLANT12x22	# the console font
 



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

2020-10-30 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Fri Oct 30 11:02:09 UTC 2020

Modified Files:
src/sys/arch/evbarm/conf: RPI

Log Message:
Add smscphy(4).


To generate a diff of this commit:
cvs rdiff -u -r1.91 -r1.92 src/sys/arch/evbarm/conf/RPI

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

Modified files:

Index: src/sys/arch/evbarm/conf/RPI
diff -u src/sys/arch/evbarm/conf/RPI:1.91 src/sys/arch/evbarm/conf/RPI:1.92
--- src/sys/arch/evbarm/conf/RPI:1.91	Mon May 18 21:19:35 2020
+++ src/sys/arch/evbarm/conf/RPI	Fri Oct 30 11:02:09 2020
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: RPI,v 1.91 2020/05/18 21:19:35 jmcneill Exp $
+#	$NetBSD: RPI,v 1.92 2020/10/30 11:02:09 rin Exp $
 #
 #	RPi -- Raspberry Pi
 #
@@ -150,6 +150,7 @@ qsphy*		at mii? phy ?		# Quality Semicon
 rdcphy*		at mii? phy ?		# RDC R6040 10/100 PHY
 rgephy*		at mii? phy ?		# Realtek 8169S/8110S internal PHYs
 rlphy*		at mii? phy ?		# Realtek 8139/8201L PHYs
+smscphy*	at mii? phy ?		# SMSC LAN87xx PHYs
 sqphy*		at mii? phy ?		# Seeq 80220/80221/80223 PHYs
 tlphy*		at mii? phy ?		# ThunderLAN PHYs
 tqphy*		at mii? phy ?		# TDK Semiconductor PHYs



CVS commit: src/usr.sbin/npf/npfd

2020-10-30 Thread David Brownlee
Module Name:src
Committed By:   abs
Date:   Fri Oct 30 09:23:36 UTC 2020

Modified Files:
src/usr.sbin/npf/npfd: npfd.8

Log Message:
Fix tcpdump example from "‐i npflog0.pcap" to "‐i npflog0"


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/usr.sbin/npf/npfd/npfd.8

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/npf/npfd/npfd.8
diff -u src/usr.sbin/npf/npfd/npfd.8:1.6 src/usr.sbin/npf/npfd/npfd.8:1.7
--- src/usr.sbin/npf/npfd/npfd.8:1.6	Fri Aug 31 10:38:17 2018
+++ src/usr.sbin/npf/npfd/npfd.8	Fri Oct 30 09:23:36 2020
@@ -1,4 +1,4 @@
-.\"	$NetBSD: npfd.8,v 1.6 2018/08/31 10:38:17 maxv Exp $
+.\"	$NetBSD: npfd.8,v 1.7 2020/10/30 09:23:36 abs Exp $
 .\"	$OpenBSD: pflogd.8,v 1.35 2007/05/31 19:19:47 jmc Exp $
 .\"
 .\" Copyright (c) 2001 Can Erkin Acar.  All rights reserved.
@@ -171,7 +171,7 @@ Display the logs in real time (this does
 operation of
 .Nm ) :
 .Bd -literal -offset indent
-# tcpdump -n -e -ttt -i npflog0.pcap
+# tcpdump -n -e -ttt -i npflog0
 .Ed
 .Pp
 Tcpdump has been extended to be able to filter on the



CVS commit: src

2020-10-30 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Oct 30 08:41:58 UTC 2020

Modified Files:
src/external/bsd/kyua-cli: Makefile.inc
src/external/ibm-public/postfix: Makefile.inc
src/external/public-domain/sqlite/bin: Makefile
src/share/mk: bsd.prog.mk

Log Message:
libsqlite3 now requires -lm


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/external/bsd/kyua-cli/Makefile.inc
cvs rdiff -u -r1.23 -r1.24 src/external/ibm-public/postfix/Makefile.inc
cvs rdiff -u -r1.5 -r1.6 src/external/public-domain/sqlite/bin/Makefile
cvs rdiff -u -r1.332 -r1.333 src/share/mk/bsd.prog.mk

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

Modified files:

Index: src/external/bsd/kyua-cli/Makefile.inc
diff -u src/external/bsd/kyua-cli/Makefile.inc:1.6 src/external/bsd/kyua-cli/Makefile.inc:1.7
--- src/external/bsd/kyua-cli/Makefile.inc:1.6	Thu Jul  2 14:04:00 2020
+++ src/external/bsd/kyua-cli/Makefile.inc	Fri Oct 30 08:41:58 2020
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.inc,v 1.6 2020/07/02 14:04:00 lukem Exp $
+# $NetBSD: Makefile.inc,v 1.7 2020/10/30 08:41:58 martin Exp $
 
 .include 
 
@@ -58,8 +58,8 @@ DPADD+=			${LIBOBJDIR_${lib}}/lib${lib}.
 .endfor
 
 .if !empty(KYUA_LIBS:Mutils)
-LDADD+=		-llutok -lsqlite3
-DPADD+=		${LIBLUTOK} ${LIBSQLITE}
+LDADD+=		-llutok -lsqlite3 -lm
+DPADD+=		${LIBLUTOK} ${LIBSQLITE} ${LIBM}
 .endif
 
 MANPAGE_DEPS = cookie-tarname cookie-version

Index: src/external/ibm-public/postfix/Makefile.inc
diff -u src/external/ibm-public/postfix/Makefile.inc:1.23 src/external/ibm-public/postfix/Makefile.inc:1.24
--- src/external/ibm-public/postfix/Makefile.inc:1.23	Mon Apr 20 13:04:10 2020
+++ src/external/ibm-public/postfix/Makefile.inc	Fri Oct 30 08:41:58 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.23 2020/04/20 13:04:10 joerg Exp $
+#	$NetBSD: Makefile.inc,v 1.24 2020/10/30 08:41:58 martin Exp $
 
 .include 
 
@@ -45,8 +45,8 @@ CPPFLAGS+=	-DNO_IPV6
 # SQLite support.
 CPPFLAGS+=	-DHAS_SQLITE
 . if defined(PROG)
-DPADD+=		${LIBSQLITE3}
-LDADD+=		-lsqlite3
+DPADD+=		${LIBSQLITE3} ${LIBM}
+LDADD+=		-lsqlite3 -lm
 .endif
 
 # LDAP support.

Index: src/external/public-domain/sqlite/bin/Makefile
diff -u src/external/public-domain/sqlite/bin/Makefile:1.5 src/external/public-domain/sqlite/bin/Makefile:1.6
--- src/external/public-domain/sqlite/bin/Makefile:1.5	Thu Feb 14 21:07:25 2013
+++ src/external/public-domain/sqlite/bin/Makefile	Fri Oct 30 08:41:58 2020
@@ -1,11 +1,11 @@
-# $NetBSD: Makefile,v 1.5 2013/02/14 21:07:25 martin Exp $
+# $NetBSD: Makefile,v 1.6 2020/10/30 08:41:58 martin Exp $
 
 PROG=		sqlite3
 
 SRCS=		shell.c
 
-DPADD+=		${LIBSQLITE3} ${LIBEDIT} ${LIBTERIMINFO}
-LDADD+=		-lsqlite3 -ledit -lterminfo
+DPADD+=		${LIBSQLITE3} ${LIBEDIT} ${LIBTERIMINFO} ${LIBM}
+LDADD+=		-lsqlite3 -ledit -lterminfo -lm
 
 BINDIR=		/usr/bin
 

Index: src/share/mk/bsd.prog.mk
diff -u src/share/mk/bsd.prog.mk:1.332 src/share/mk/bsd.prog.mk:1.333
--- src/share/mk/bsd.prog.mk:1.332	Fri Oct 16 06:55:36 2020
+++ src/share/mk/bsd.prog.mk	Fri Oct 30 08:41:58 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.prog.mk,v 1.332 2020/10/16 06:55:36 nia Exp $
+#	$NetBSD: bsd.prog.mk,v 1.333 2020/10/30 08:41:58 martin Exp $
 #	@(#)bsd.prog.mk	8.2 (Berkeley) 4/2/94
 
 .ifndef HOSTPROG
@@ -226,11 +226,11 @@ LIB${_lib:tu}=	${DESTDIR}/usr/lib/lib${_
 LIBKRB5_LDADD+= -lkrb5 -lcom_err \
 	-lhx509 -lcrypto -lasn1 \
 	-lwind -lheimbase -lcom_err -lroken \
-	-lsqlite3 -lcrypt -lutil
+	-lsqlite3 -lm -lcrypt -lutil
 LIBKRB5_DPADD+= ${LIBKRB5} ${LIBCOM_ERR} \
 	${LIBHX509} ${LIBCRYPTO} ${LIBASN1} \
 	${LIBWIND} ${LIBHEIMBASE} ${LIBCOM_ERR} ${LIBROKEN} \
-	${LIBSQLITE3} ${LIBCRYPT}  ${LIBUTIL}
+	${LIBSQLITE3} ${LIBM} ${LIBCRYPT}  ${LIBUTIL}
 .endif
 
 # PAM applications, if linked statically, need more libraries
@@ -239,9 +239,10 @@ PAM_STATIC_LDADD+= -lssh
 PAM_STATIC_DPADD+= ${LIBSSH}
 .if (${MKKERBEROS} != "no")
 PAM_STATIC_LDADD+= -lkafs -lkrb5 -lhx509 -lwind -lasn1 \
-	-lroken -lcom_err -lheimbase -lcrypto -lsqlite3
+	-lroken -lcom_err -lheimbase -lcrypto -lsqlite3 -lm
 PAM_STATIC_DPADD+= ${LIBKAFS} ${LIBKRB5} ${LIBHX509} ${LIBWIND} ${LIBASN1} \
-	${LIBROKEN} ${LIBCOM_ERR} ${LIBHEIMBASE} ${LIBCRYPTO} ${LIBSQLITE3}
+	${LIBROKEN} ${LIBCOM_ERR} ${LIBHEIMBASE} ${LIBCRYPTO} ${LIBSQLITE3} \
+	${LIBM}
 .endif
 .if (${MKSKEY} != "no")
 PAM_STATIC_LDADD+= -lskey



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

2020-10-30 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Oct 30 08:13:17 UTC 2020

Modified Files:
src/usr.bin/make/unit-tests: cond-cmp-string.exp cond-cmp-string.mk

Log Message:
make(1): demonstrate parse error in string interpolation in condition


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/usr.bin/make/unit-tests/cond-cmp-string.exp
cvs rdiff -u -r1.6 -r1.7 src/usr.bin/make/unit-tests/cond-cmp-string.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/cond-cmp-string.exp
diff -u src/usr.bin/make/unit-tests/cond-cmp-string.exp:1.4 src/usr.bin/make/unit-tests/cond-cmp-string.exp:1.5
--- src/usr.bin/make/unit-tests/cond-cmp-string.exp:1.4	Sat Sep 12 10:39:34 2020
+++ src/usr.bin/make/unit-tests/cond-cmp-string.exp	Fri Oct 30 08:13:17 2020
@@ -3,6 +3,7 @@ make: "cond-cmp-string.mk" line 37: Malf
 make: "cond-cmp-string.mk" line 42: warning: String comparison operator must be either == or !=
 make: "cond-cmp-string.mk" line 42: Malformed conditional (!("value" = "value"))
 make: "cond-cmp-string.mk" line 49: Malformed conditional (!("value" === "value"))
+make: "cond-cmp-string.mk" line 63: Malformed conditional (${:Uword} != "${:Uword} ")
 make: Fatal errors encountered -- cannot continue
 make: stopped in unit-tests
 exit status 1

Index: src/usr.bin/make/unit-tests/cond-cmp-string.mk
diff -u src/usr.bin/make/unit-tests/cond-cmp-string.mk:1.6 src/usr.bin/make/unit-tests/cond-cmp-string.mk:1.7
--- src/usr.bin/make/unit-tests/cond-cmp-string.mk:1.6	Sat Oct 24 08:46:08 2020
+++ src/usr.bin/make/unit-tests/cond-cmp-string.mk	Fri Oct 30 08:13:17 2020
@@ -1,4 +1,4 @@
-# $NetBSD: cond-cmp-string.mk,v 1.6 2020/10/24 08:46:08 rillig Exp $
+# $NetBSD: cond-cmp-string.mk,v 1.7 2020/10/30 08:13:17 rillig Exp $
 #
 # Tests for string comparisons in .if conditions.
 
@@ -52,3 +52,22 @@
 .  error
 .endif
 
+# A variable expression can be enclosed in double quotes.
+.if ${:Uword} != "${:Uword}"
+.  error
+.endif
+
+# XXX: As of 2020-10-30, adding a space to the string results in a parse
+# error.  This is a bug and should have been caught much earlier.
+# I wonder since when it exists.
+.if ${:Uword} != "${:Uword} "
+.  error
+.else
+.  error
+.endif
+
+# Adding a space at the beginning of the quoted variable expression works
+# though.
+.if ${:U word } != " ${:Uword} "
+.  error
+.endif



CVS commit: src/usr.bin/make

2020-10-30 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Oct 30 07:47:11 UTC 2020

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

Log Message:
make(1): remove redundant evaluations in VarFind


To generate a diff of this commit:
cvs rdiff -u -r1.596 -r1.597 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.596 src/usr.bin/make/var.c:1.597
--- src/usr.bin/make/var.c:1.596	Fri Oct 30 07:37:30 2020
+++ src/usr.bin/make/var.c	Fri Oct 30 07:47:11 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: var.c,v 1.596 2020/10/30 07:37:30 rillig Exp $	*/
+/*	$NetBSD: var.c,v 1.597 2020/10/30 07:47:11 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -129,7 +129,7 @@
 #include"metachar.h"
 
 /*	"@(#)var.c	8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: var.c,v 1.596 2020/10/30 07:37:30 rillig Exp $");
+MAKE_RCSID("$NetBSD: var.c,v 1.597 2020/10/30 07:47:11 rillig Exp $");
 
 #define VAR_DEBUG1(fmt, arg1) DEBUG1(VAR, fmt, arg1)
 #define VAR_DEBUG2(fmt, arg1, arg2) DEBUG2(VAR, fmt, arg1, arg2)
@@ -377,11 +377,13 @@ VarFind(const char *name, GNode *ctxt, B
  * depending on the FIND_* flags in 'flags'
  */
 var = GNode_FindVar(ctxt, name, nameHash);
+if (!elsewhere)
+return var;
 
-if (var == NULL && elsewhere && ctxt != VAR_CMDLINE)
+if (var == NULL && ctxt != VAR_CMDLINE)
 	var = GNode_FindVar(VAR_CMDLINE, name, nameHash);
 
-if (!opts.checkEnvFirst && var == NULL && elsewhere && ctxt != VAR_GLOBAL) {
+if (!opts.checkEnvFirst && var == NULL && ctxt != VAR_GLOBAL) {
 	var = GNode_FindVar(VAR_GLOBAL, name, nameHash);
 	if (var == NULL && ctxt != VAR_INTERNAL) {
 	/* VAR_INTERNAL is subordinate to VAR_GLOBAL */
@@ -389,7 +391,7 @@ VarFind(const char *name, GNode *ctxt, B
 	}
 }
 
-if (var == NULL && elsewhere) {
+if (var == NULL) {
 	char *env;
 
 	if ((env = getenv(name)) != NULL) {
@@ -397,7 +399,7 @@ VarFind(const char *name, GNode *ctxt, B
 	return VarNew(varname, varname, env, VAR_FROM_ENV);
 	}
 
-	if (opts.checkEnvFirst && elsewhere && ctxt != VAR_GLOBAL) {
+	if (opts.checkEnvFirst && ctxt != VAR_GLOBAL) {
 	var = GNode_FindVar(VAR_GLOBAL, name, nameHash);
 	if (var == NULL && ctxt != VAR_INTERNAL)
 		var = GNode_FindVar(VAR_INTERNAL, name, nameHash);



CVS commit: src/usr.bin/make

2020-10-30 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Oct 30 07:37:30 UTC 2020

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

Log Message:
make(1): replace VarFindFlags with a simple Boolean

Either all flags had been given or none.  Except in Var_Append, but
since the ctxt was VAR_GLOBAL anyway, adding FIND_GLOBAL there did not
make a difference.


To generate a diff of this commit:
cvs rdiff -u -r1.595 -r1.596 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.595 src/usr.bin/make/var.c:1.596
--- src/usr.bin/make/var.c:1.595	Fri Oct 30 07:30:29 2020
+++ src/usr.bin/make/var.c	Fri Oct 30 07:37:30 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: var.c,v 1.595 2020/10/30 07:30:29 rillig Exp $	*/
+/*	$NetBSD: var.c,v 1.596 2020/10/30 07:37:30 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -129,7 +129,7 @@
 #include"metachar.h"
 
 /*	"@(#)var.c	8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: var.c,v 1.595 2020/10/30 07:30:29 rillig Exp $");
+MAKE_RCSID("$NetBSD: var.c,v 1.596 2020/10/30 07:37:30 rillig Exp $");
 
 #define VAR_DEBUG1(fmt, arg1) DEBUG1(VAR, fmt, arg1)
 #define VAR_DEBUG2(fmt, arg1, arg2) DEBUG2(VAR, fmt, arg1, arg2)
@@ -191,12 +191,6 @@ GNode  *VAR_INTERNAL;	/* variabl
 GNode  *VAR_GLOBAL;	/* variables from the makefile */
 GNode  *VAR_CMDLINE;	/* variables defined on the command-line */
 
-typedef enum VarFindFlags {
-FIND_CMDLINE	= 0x01,	/* look in VAR_CMDLINE when searching */
-FIND_GLOBAL		= 0x02,	/* look in VAR_GLOBAL as well */
-FIND_ENV		= 0x04	/* look in the environment also */
-} VarFindFlags;
-
 typedef enum VarFlags {
 /* The variable's value is currently being used by Var_Parse or Var_Subst.
  * This marker is used to avoid endless recursion. */
@@ -355,7 +349,7 @@ GNode_FindVar(GNode *ctxt, const char *v
  * Input:
  *	name		name to find
  *	ctxt		context in which to find it
- *	flags		to look on other contexts as well
+ *	elsewhere	to look in other contexts as well
  *
  * Results:
  *	A pointer to the structure describing the desired variable or
@@ -363,7 +357,7 @@ GNode_FindVar(GNode *ctxt, const char *v
  *---
  */
 static Var *
-VarFind(const char *name, GNode *ctxt, VarFindFlags flags)
+VarFind(const char *name, GNode *ctxt, Boolean elsewhere)
 {
 Var *var;
 unsigned int nameHash;
@@ -384,12 +378,10 @@ VarFind(const char *name, GNode *ctxt, V
  */
 var = GNode_FindVar(ctxt, name, nameHash);
 
-if (var == NULL && (flags & FIND_CMDLINE) && ctxt != VAR_CMDLINE)
+if (var == NULL && elsewhere && ctxt != VAR_CMDLINE)
 	var = GNode_FindVar(VAR_CMDLINE, name, nameHash);
 
-if (!opts.checkEnvFirst && var == NULL && (flags & FIND_GLOBAL) &&
-	ctxt != VAR_GLOBAL)
-{
+if (!opts.checkEnvFirst && var == NULL && elsewhere && ctxt != VAR_GLOBAL) {
 	var = GNode_FindVar(VAR_GLOBAL, name, nameHash);
 	if (var == NULL && ctxt != VAR_INTERNAL) {
 	/* VAR_INTERNAL is subordinate to VAR_GLOBAL */
@@ -397,7 +389,7 @@ VarFind(const char *name, GNode *ctxt, V
 	}
 }
 
-if (var == NULL && (flags & FIND_ENV)) {
+if (var == NULL && elsewhere) {
 	char *env;
 
 	if ((env = getenv(name)) != NULL) {
@@ -405,7 +397,7 @@ VarFind(const char *name, GNode *ctxt, V
 	return VarNew(varname, varname, env, VAR_FROM_ENV);
 	}
 
-	if (opts.checkEnvFirst && (flags & FIND_GLOBAL) && ctxt != VAR_GLOBAL) {
+	if (opts.checkEnvFirst && elsewhere && ctxt != VAR_GLOBAL) {
 	var = GNode_FindVar(VAR_GLOBAL, name, nameHash);
 	if (var == NULL && ctxt != VAR_INTERNAL)
 		var = GNode_FindVar(VAR_INTERNAL, name, nameHash);
@@ -940,7 +932,7 @@ Var_Append(const char *name, const char 
 	}
 }
 
-v = VarFind(name, ctxt, ctxt == VAR_GLOBAL ? (FIND_CMDLINE | FIND_ENV) : 0);
+v = VarFind(name, ctxt, ctxt == VAR_GLOBAL);
 
 if (v == NULL) {
 	Var_Set(name, val, ctxt);
@@ -987,7 +979,7 @@ Var_Exists(const char *name, GNode *ctxt
 	name = name_freeIt;
 }
 
-v = VarFind(name, ctxt, FIND_CMDLINE | FIND_GLOBAL | FIND_ENV);
+v = VarFind(name, ctxt, TRUE);
 free(name_freeIt);
 if (v == NULL)
 	return FALSE;
@@ -1015,7 +1007,7 @@ Var_Exists(const char *name, GNode *ctxt
 const char *
 Var_Value(const char *name, GNode *ctxt, char **freeIt)
 {
-Var *v = VarFind(name, ctxt, FIND_CMDLINE | FIND_GLOBAL | FIND_ENV);
+Var *v = VarFind(name, ctxt, TRUE);
 char *p;
 
 *freeIt = NULL;
@@ -3555,7 +3547,7 @@ Var_Parse(const char **pp, GNode *ctxt, 
 
 	name[0] = startc;
 	name[1] = '\0';
-	v = VarFind(name, ctxt, FIND_CMDLINE | FIND_GLOBAL | FIND_ENV);
+	v = VarFind(name, ctxt, TRUE);
 	if (v == NULL) {
 	*pp += 2;
 
@@ -3590,7 +3582,7 @@ Var_Parse(const char **pp, GNode *ctxt, 
 	return VPR_PARSE_MSG;
 	}
 
-	v = VarFind(varname, ctxt, 

CVS commit: src/usr.bin/make

2020-10-30 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Oct 30 07:30:29 UTC 2020

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

Log Message:
make(1): rename FIND_CMD to FIND_CMDLINE, to match VAR_CMDLINE

While here, use a consistent order for the enum constants.  This is both
the declaration order and at the same time the usual lookup order,
unless the -e option is given.


To generate a diff of this commit:
cvs rdiff -u -r1.594 -r1.595 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.594 src/usr.bin/make/var.c:1.595
--- src/usr.bin/make/var.c:1.594	Fri Oct 30 07:19:30 2020
+++ src/usr.bin/make/var.c	Fri Oct 30 07:30:29 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: var.c,v 1.594 2020/10/30 07:19:30 rillig Exp $	*/
+/*	$NetBSD: var.c,v 1.595 2020/10/30 07:30:29 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -129,7 +129,7 @@
 #include"metachar.h"
 
 /*	"@(#)var.c	8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: var.c,v 1.594 2020/10/30 07:19:30 rillig Exp $");
+MAKE_RCSID("$NetBSD: var.c,v 1.595 2020/10/30 07:30:29 rillig Exp $");
 
 #define VAR_DEBUG1(fmt, arg1) DEBUG1(VAR, fmt, arg1)
 #define VAR_DEBUG2(fmt, arg1, arg2) DEBUG2(VAR, fmt, arg1, arg2)
@@ -192,7 +192,7 @@ GNode  *VAR_GLOBAL;	/* variables
 GNode  *VAR_CMDLINE;	/* variables defined on the command-line */
 
 typedef enum VarFindFlags {
-FIND_CMD		= 0x01,	/* look in VAR_CMDLINE when searching */
+FIND_CMDLINE	= 0x01,	/* look in VAR_CMDLINE when searching */
 FIND_GLOBAL		= 0x02,	/* look in VAR_GLOBAL as well */
 FIND_ENV		= 0x04	/* look in the environment also */
 } VarFindFlags;
@@ -355,9 +355,7 @@ GNode_FindVar(GNode *ctxt, const char *v
  * Input:
  *	name		name to find
  *	ctxt		context in which to find it
- *	flags		FIND_GLOBAL	look in VAR_GLOBAL as well
- *			FIND_CMD	look in VAR_CMDLINE as well
- *			FIND_ENV	look in the environment as well
+ *	flags		to look on other contexts as well
  *
  * Results:
  *	A pointer to the structure describing the desired variable or
@@ -386,7 +384,7 @@ VarFind(const char *name, GNode *ctxt, V
  */
 var = GNode_FindVar(ctxt, name, nameHash);
 
-if (var == NULL && (flags & FIND_CMD) && ctxt != VAR_CMDLINE)
+if (var == NULL && (flags & FIND_CMDLINE) && ctxt != VAR_CMDLINE)
 	var = GNode_FindVar(VAR_CMDLINE, name, nameHash);
 
 if (!opts.checkEnvFirst && var == NULL && (flags & FIND_GLOBAL) &&
@@ -942,7 +940,7 @@ Var_Append(const char *name, const char 
 	}
 }
 
-v = VarFind(name, ctxt, ctxt == VAR_GLOBAL ? (FIND_CMD | FIND_ENV) : 0);
+v = VarFind(name, ctxt, ctxt == VAR_GLOBAL ? (FIND_CMDLINE | FIND_ENV) : 0);
 
 if (v == NULL) {
 	Var_Set(name, val, ctxt);
@@ -989,7 +987,7 @@ Var_Exists(const char *name, GNode *ctxt
 	name = name_freeIt;
 }
 
-v = VarFind(name, ctxt, FIND_CMD | FIND_GLOBAL | FIND_ENV);
+v = VarFind(name, ctxt, FIND_CMDLINE | FIND_GLOBAL | FIND_ENV);
 free(name_freeIt);
 if (v == NULL)
 	return FALSE;
@@ -1017,7 +1015,7 @@ Var_Exists(const char *name, GNode *ctxt
 const char *
 Var_Value(const char *name, GNode *ctxt, char **freeIt)
 {
-Var *v = VarFind(name, ctxt, FIND_ENV | FIND_GLOBAL | FIND_CMD);
+Var *v = VarFind(name, ctxt, FIND_CMDLINE | FIND_GLOBAL | FIND_ENV);
 char *p;
 
 *freeIt = NULL;
@@ -3557,7 +3555,7 @@ Var_Parse(const char **pp, GNode *ctxt, 
 
 	name[0] = startc;
 	name[1] = '\0';
-	v = VarFind(name, ctxt, FIND_ENV | FIND_GLOBAL | FIND_CMD);
+	v = VarFind(name, ctxt, FIND_CMDLINE | FIND_GLOBAL | FIND_ENV);
 	if (v == NULL) {
 	*pp += 2;
 
@@ -3592,7 +3590,7 @@ Var_Parse(const char **pp, GNode *ctxt, 
 	return VPR_PARSE_MSG;
 	}
 
-	v = VarFind(varname, ctxt, FIND_ENV | FIND_GLOBAL | FIND_CMD);
+	v = VarFind(varname, ctxt, FIND_CMDLINE | FIND_GLOBAL | FIND_ENV);
 
 	/* At this point, p points just after the variable name,
 	 * either at ':' or at endc. */



CVS commit: src/usr.bin/make

2020-10-30 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Oct 30 07:19:30 UTC 2020

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

Log Message:
make(1): rename VAR_CMD to VAR_CMDLINE

Since make has to do with both the command line and child commands, the
former name was confusing.


To generate a diff of this commit:
cvs rdiff -u -r1.169 -r1.170 src/usr.bin/make/cond.c
cvs rdiff -u -r1.293 -r1.294 src/usr.bin/make/job.c
cvs rdiff -u -r1.409 -r1.410 src/usr.bin/make/main.c
cvs rdiff -u -r1.175 -r1.176 src/usr.bin/make/make.h
cvs rdiff -u -r1.410 -r1.411 src/usr.bin/make/parse.c
cvs rdiff -u -r1.125 -r1.126 src/usr.bin/make/targ.c
cvs rdiff -u -r1.593 -r1.594 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/cond.c
diff -u src/usr.bin/make/cond.c:1.169 src/usr.bin/make/cond.c:1.170
--- src/usr.bin/make/cond.c:1.169	Mon Oct 26 21:34:10 2020
+++ src/usr.bin/make/cond.c	Fri Oct 30 07:19:30 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: cond.c,v 1.169 2020/10/26 21:34:10 rillig Exp $	*/
+/*	$NetBSD: cond.c,v 1.170 2020/10/30 07:19:30 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -93,7 +93,7 @@
 #include "dir.h"
 
 /*	"@(#)cond.c	8.2 (Berkeley) 1/2/94"	*/
-MAKE_RCSID("$NetBSD: cond.c,v 1.169 2020/10/26 21:34:10 rillig Exp $");
+MAKE_RCSID("$NetBSD: cond.c,v 1.170 2020/10/30 07:19:30 rillig Exp $");
 
 /*
  * The parsing of conditional expressions is based on this grammar:
@@ -246,7 +246,8 @@ ParseFuncArg(const char **pp, Boolean do
 	void *nestedVal_freeIt;
 	VarEvalFlags eflags = VARE_UNDEFERR | (doEval ? VARE_WANTRES : 0);
 	const char *nestedVal;
-	(void)Var_Parse(, VAR_CMD, eflags, , _freeIt);
+	(void)Var_Parse(, VAR_CMDLINE, eflags, ,
+			_freeIt);
 	/* TODO: handle errors */
 	Buf_AddStr(, nestedVal);
 	free(nestedVal_freeIt);
@@ -283,7 +284,7 @@ static Boolean
 FuncDefined(size_t argLen MAKE_ATTR_UNUSED, const char *arg)
 {
 char *freeIt;
-Boolean result = Var_Value(arg, VAR_CMD, ) != NULL;
+Boolean result = Var_Value(arg, VAR_CMDLINE, ) != NULL;
 bmake_free(freeIt);
 return result;
 }
@@ -443,7 +444,8 @@ CondParser_String(CondParser *par, Boole
 		 (doEval ? VARE_WANTRES : 0);
 	nested_p = par->p;
 	atStart = nested_p == start;
-	parseResult = Var_Parse(_p, VAR_CMD, eflags, , freeIt);
+	parseResult = Var_Parse(_p, VAR_CMDLINE, eflags, ,
+freeIt);
 	/* TODO: handle errors */
 	if (str == var_Error) {
 		if (parseResult & VPR_ANY_MSG)
@@ -683,7 +685,7 @@ ParseEmptyArg(const char **linePtr, Bool
 *argPtr = NULL;
 
 (*linePtr)--;		/* Make (*linePtr)[1] point to the '('. */
-(void)Var_Parse(linePtr, VAR_CMD, doEval ? VARE_WANTRES : 0,
+(void)Var_Parse(linePtr, VAR_CMDLINE, doEval ? VARE_WANTRES : 0,
 		, _freeIt);
 /* TODO: handle errors */
 /* If successful, *linePtr points beyond the closing ')' now. */

Index: src/usr.bin/make/job.c
diff -u src/usr.bin/make/job.c:1.293 src/usr.bin/make/job.c:1.294
--- src/usr.bin/make/job.c:1.293	Mon Oct 26 23:28:52 2020
+++ src/usr.bin/make/job.c	Fri Oct 30 07:19:30 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: job.c,v 1.293 2020/10/26 23:28:52 rillig Exp $	*/
+/*	$NetBSD: job.c,v 1.294 2020/10/30 07:19:30 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -143,7 +143,7 @@
 #include "trace.h"
 
 /*	"@(#)job.c	8.2 (Berkeley) 3/19/94"	*/
-MAKE_RCSID("$NetBSD: job.c,v 1.293 2020/10/26 23:28:52 rillig Exp $");
+MAKE_RCSID("$NetBSD: job.c,v 1.294 2020/10/30 07:19:30 rillig Exp $");
 
 /* A shell defines how the commands are run.  All commands for a target are
  * written into a single file, which is then given to the shell to execute
@@ -2059,7 +2059,7 @@ Shell_Init(void)
 #endif
 	shellPath = str_concat3(_PATH_DEFSHELLDIR, "/", shellName);
 }
-Var_Set_with_flags(".SHELL", shellPath, VAR_CMD, VAR_SET_READONLY);
+Var_Set_with_flags(".SHELL", shellPath, VAR_CMDLINE, VAR_SET_READONLY);
 if (commandShell->exit == NULL) {
 	commandShell->exit = "";
 }

Index: src/usr.bin/make/main.c
diff -u src/usr.bin/make/main.c:1.409 src/usr.bin/make/main.c:1.410
--- src/usr.bin/make/main.c:1.409	Wed Oct 28 03:21:25 2020
+++ src/usr.bin/make/main.c	Fri Oct 30 07:19:30 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.409 2020/10/28 03:21:25 rillig Exp $	*/
+/*	$NetBSD: main.c,v 1.410 2020/10/30 07:19:30 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -118,7 +118,7 @@
 #include "trace.h"
 
 /*	"@(#)main.c	8.3 (Berkeley) 3/19/94"	*/
-MAKE_RCSID("$NetBSD: main.c,v 1.409 2020/10/28 03:21:25 rillig Exp $");
+MAKE_RCSID("$NetBSD: main.c,v 1.410 2020/10/30 07:19:30 rillig Exp $");
 #if defined(MAKE_NATIVE) && !defined(lint)
 __COPYRIGHT("@(#) Copyright (c) 1988, 1989, 1990, 1993 "
 	"The 

CVS commit: src/sys/ddb

2020-10-30 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Oct 30 07:17:29 UTC 2020

Modified Files:
src/sys/ddb: db_command.c

Log Message:
Sort the db_show_cmd entries


To generate a diff of this commit:
cvs rdiff -u -r1.172 -r1.173 src/sys/ddb/db_command.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/ddb/db_command.c
diff -u src/sys/ddb/db_command.c:1.172 src/sys/ddb/db_command.c:1.173
--- src/sys/ddb/db_command.c:1.172	Fri Oct 30 07:03:50 2020
+++ src/sys/ddb/db_command.c	Fri Oct 30 07:17:29 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: db_command.c,v 1.172 2020/10/30 07:03:50 skrll Exp $	*/
+/*	$NetBSD: db_command.c,v 1.173 2020/10/30 07:17:29 skrll Exp $	*/
 
 /*
  * Copyright (c) 1996, 1997, 1998, 1999, 2002, 2009, 2019
@@ -61,7 +61,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: db_command.c,v 1.172 2020/10/30 07:03:50 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_command.c,v 1.173 2020/10/30 07:17:29 skrll Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_aio.h"
@@ -221,96 +221,96 @@ static void	db_vnode_lock_print_cmd(db_e
 static void	db_vmem_print_cmd(db_expr_t, bool, db_expr_t, const char *);
 
 static const struct db_command db_show_cmds[] = {
-	/* added from all sub cmds */
-	{ DDB_ADD_CMD("callout",  db_show_callout,
-	0 ,"List all used callout functions.",NULL,NULL) },
-	/* added from all sub cmds */
-	{ DDB_ADD_CMD("pages",	db_show_all_pages,
-	0 ,"List all used memory pages.",NULL,NULL) },
-	{ DDB_ADD_CMD("proc",	db_show_proc,
-	0 ,"Print process information.",NULL,NULL) },
-	/* added from all sub cmds */
-	{ DDB_ADD_CMD("procs",	db_show_all_procs,
-	0 ,"List all processes.",NULL,NULL) },
-	/* added from all sub cmds */
-	{ DDB_ADD_CMD("pools",	db_show_all_pools,
-	0 ,"Show all pools",NULL,NULL) },
-	{ DDB_ADD_CMD("locks",	db_show_all_locks,
-	0 ,"Show all held locks", "[/t]", NULL) },
-	{ DDB_ADD_CMD("mount",	db_show_all_mount,	0,
-	"Print all mount structures.", "[/f]", NULL) },
-	{ DDB_ADD_CMD("freelists",	db_show_all_freelists,
-	0 ,"Show all freelists", NULL, NULL) },
+	{ DDB_ADD_CMD("all",	NULL,
+	CS_COMPAT, NULL,NULL,NULL) },
 #ifdef AIO
 	{ DDB_ADD_CMD("aio_jobs",	db_show_aio_jobs,	0,
 	"Show aio jobs",NULL,NULL) },
 #endif
-	{ DDB_ADD_CMD("all",	NULL,
-	CS_COMPAT, NULL,NULL,NULL) },
-#if defined(INET)
-	{ DDB_ADD_CMD("routes",	db_show_routes,		0,NULL,NULL,NULL) },
-#endif
 #ifdef _KERNEL
 	{ DDB_ADD_CMD("breaks",	db_listbreak_cmd, 	0,
 	"Display all breaks.",NULL,NULL) },
 #endif
 	{ DDB_ADD_CMD("buf",	db_buf_print_cmd,	0,
 	"Print the struct buf at address.", "[/f] address",NULL) },
+	/* added from all sub cmds */
+	{ DDB_ADD_CMD("callout",  db_show_callout,
+	0 ,"List all used callout functions.",NULL,NULL) },
 	{ DDB_ADD_CMD("devices", db_show_all_devices,	0,NULL,NULL,NULL) },
 	{ DDB_ADD_CMD("event",	db_event_print_cmd,	0,
 	"Print all the non-zero evcnt(9) event counters.", "[/fitm]",NULL) },
 	{ DDB_ADD_CMD("files", db_show_files_cmd,	0,
 	"Print the files open by process at address",
 	"[/f] address", NULL) },
+	{ DDB_ADD_CMD("freelists",	db_show_all_freelists,
+	0 ,"Show all freelists", NULL, NULL) },
+#ifdef KERNHIST
+	{ DDB_ADD_CMD("kernhist", db_kernhist_print_cmd, 0,
+	"Print the UVM history logs.",
+	NULL,NULL) },
+#endif
+	/* added from all sub cmds */
+	{ DDB_ADD_CMD("locks",	db_show_all_locks,
+	0 ,"Show all held locks", "[/t]", NULL) },
 	{ DDB_ADD_CMD("lock",	db_lock_print_cmd,	0,NULL,NULL,NULL) },
 	{ DDB_ADD_CMD("lockstats",
 db_show_lockstats,	0,
 	"Print statistics of locks", NULL, NULL) },
 	{ DDB_ADD_CMD("map",	db_map_print_cmd,	0,
 	"Print the vm_map at address.", "[/f] address",NULL) },
-	{ DDB_ADD_CMD("socket",	db_socket_print_cmd,	0,NULL,NULL,NULL) },
+	{ DDB_ADD_CMD("mbuf",	db_mbuf_print_cmd,	0,NULL,NULL,
+	"-c prints all mbuf chains") },
 	{ DDB_ADD_CMD("module", db_show_module_cmd,	0,
 	"Print kernel modules", NULL, NULL) },
+	{ DDB_ADD_CMD("mount",	db_show_all_mount,	0,
+	"Print all mount structures.", "[/f]", NULL) },
 	{ DDB_ADD_CMD("mount",	db_mount_print_cmd,	0,
 	"Print the mount structure at address.", "[/f] address",NULL) },
 #ifdef MQUEUE
 	{ DDB_ADD_CMD("mqueue", db_show_mqueue_cmd,	0,
 	"Print the message queues", NULL, NULL) },
 #endif
-	{ DDB_ADD_CMD("mbuf",	db_mbuf_print_cmd,	0,NULL,NULL,
-	"-c prints all mbuf chains") },
 	{ DDB_ADD_CMD("ncache",	db_namecache_print_cmd,	0,
 	"Dump the namecache list.", "address",NULL) },
 	{ DDB_ADD_CMD("object",	db_object_print_cmd,	0,
 	"Print the vm_object at address.", "[/f] address",NULL) },
 	{ DDB_ADD_CMD("page",	db_page_print_cmd,	0,
 	"Print the vm_page at address.", "[/f] address",NULL) },
+	{ DDB_ADD_CMD("pages",	db_show_all_pages,
+	0 ,"List all used memory pages.",NULL,NULL) },
 	{ DDB_ADD_CMD("panic",	db_show_panic,	0,
 	"Print the current panic 

CVS commit: src/sys/ddb

2020-10-30 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Oct 30 07:03:50 UTC 2020

Modified Files:
src/sys/ddb: db_command.c

Log Message:
Put the 'added from all sub cmds' comment above the four commands that
were added as part of the work in r1.98


To generate a diff of this commit:
cvs rdiff -u -r1.171 -r1.172 src/sys/ddb/db_command.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/ddb/db_command.c
diff -u src/sys/ddb/db_command.c:1.171 src/sys/ddb/db_command.c:1.172
--- src/sys/ddb/db_command.c:1.171	Fri Oct 30 06:57:08 2020
+++ src/sys/ddb/db_command.c	Fri Oct 30 07:03:50 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: db_command.c,v 1.171 2020/10/30 06:57:08 skrll Exp $	*/
+/*	$NetBSD: db_command.c,v 1.172 2020/10/30 07:03:50 skrll Exp $	*/
 
 /*
  * Copyright (c) 1996, 1997, 1998, 1999, 2002, 2009, 2019
@@ -61,7 +61,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: db_command.c,v 1.171 2020/10/30 06:57:08 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_command.c,v 1.172 2020/10/30 07:03:50 skrll Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_aio.h"
@@ -221,15 +221,18 @@ static void	db_vnode_lock_print_cmd(db_e
 static void	db_vmem_print_cmd(db_expr_t, bool, db_expr_t, const char *);
 
 static const struct db_command db_show_cmds[] = {
-	/*added from all sub cmds*/
+	/* added from all sub cmds */
 	{ DDB_ADD_CMD("callout",  db_show_callout,
 	0 ,"List all used callout functions.",NULL,NULL) },
+	/* added from all sub cmds */
 	{ DDB_ADD_CMD("pages",	db_show_all_pages,
 	0 ,"List all used memory pages.",NULL,NULL) },
 	{ DDB_ADD_CMD("proc",	db_show_proc,
 	0 ,"Print process information.",NULL,NULL) },
+	/* added from all sub cmds */
 	{ DDB_ADD_CMD("procs",	db_show_all_procs,
 	0 ,"List all processes.",NULL,NULL) },
+	/* added from all sub cmds */
 	{ DDB_ADD_CMD("pools",	db_show_all_pools,
 	0 ,"Show all pools",NULL,NULL) },
 	{ DDB_ADD_CMD("locks",	db_show_all_locks,
@@ -239,7 +242,6 @@ static const struct db_command db_show_c
 	{ DDB_ADD_CMD("freelists",	db_show_all_freelists,
 	0 ,"Show all freelists", NULL, NULL) },
 #ifdef AIO
-	/*added from all sub cmds*/
 	{ DDB_ADD_CMD("aio_jobs",	db_show_aio_jobs,	0,
 	"Show aio jobs",NULL,NULL) },
 #endif



CVS commit: src/sys/ddb

2020-10-30 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Oct 30 06:59:43 UTC 2020

Modified Files:
src/sys/ddb: db_command.h

Log Message:
Whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/sys/ddb/db_command.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/ddb/db_command.h
diff -u src/sys/ddb/db_command.h:1.39 src/sys/ddb/db_command.h:1.40
--- src/sys/ddb/db_command.h:1.39	Fri Oct 30 06:57:08 2020
+++ src/sys/ddb/db_command.h	Fri Oct 30 06:59:43 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: db_command.h,v 1.39 2020/10/30 06:57:08 skrll Exp $	*/
+/*	$NetBSD: db_command.h,v 1.40 2020/10/30 06:59:43 skrll Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 1999, 2002 The NetBSD Foundation, Inc.
@@ -126,20 +126,20 @@ struct db_command {
 	 * CS_SET_DOT specify if this command is put to last added command memory.
 	 * CS_NOREPEAT this command does not repeat
 	 */
-	uint16_t		flag;		/* extra info: */
-#define	CS_OWN		0x1			/* non-standard syntax */
-#define	CS_MORE		0x2			/* standard syntax, but may have other
-	   words at end */
-#define CS_COMPAT	0x4			/* is set for compatibilty with old
-	ddb versions*/
-#define CS_SHOW		0x8			/* select show list */
+	uint16_t	flag;		/* extra info: */
+#define	CS_OWN		0x1		/* non-standard syntax */
+#define	CS_MORE		0x2		/* standard syntax, but may have other
+words at end */
+#define CS_COMPAT	0x4		/* is set for compatibilty with old
+ddb versions */
+#define CS_SHOW		0x8		/* select show list */
 #define CS_MACH		0x10		/* select machine dependent list */
 
 #define	CS_SET_DOT	0x100		/* set dot after command */
 #define	CS_NOREPEAT	0x200		/* don't set last_command */
 #ifdef DDB_VERBOSE_HELP
-	const char *cmd_descr; /* description of command */
-	const char *cmd_arg;   /* command arguments */
+	const char *cmd_descr;		/* description of command */
+	const char *cmd_arg;		/* command arguments */
 	const char *cmd_arg_help;	/* arguments description */
 #endif
 };



CVS commit: src/usr.bin/make

2020-10-30 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Oct 30 06:59:12 UTC 2020

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

Log Message:
make(1): rename SAVE_DOLLARS to follow the naming conventions


To generate a diff of this commit:
cvs rdiff -u -r1.592 -r1.593 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.592 src/usr.bin/make/var.c:1.593
--- src/usr.bin/make/var.c:1.592	Fri Oct 30 06:44:57 2020
+++ src/usr.bin/make/var.c	Fri Oct 30 06:59:12 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: var.c,v 1.592 2020/10/30 06:44:57 rillig Exp $	*/
+/*	$NetBSD: var.c,v 1.593 2020/10/30 06:59:12 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -129,7 +129,7 @@
 #include"metachar.h"
 
 /*	"@(#)var.c	8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: var.c,v 1.592 2020/10/30 06:44:57 rillig Exp $");
+MAKE_RCSID("$NetBSD: var.c,v 1.593 2020/10/30 06:59:12 rillig Exp $");
 
 #define VAR_DEBUG1(fmt, arg1) DEBUG1(VAR, fmt, arg1)
 #define VAR_DEBUG2(fmt, arg1, arg2) DEBUG2(VAR, fmt, arg1, arg2)
@@ -162,13 +162,14 @@ static char varUndefined[] = "";
 static char emptyString[] = "";
 
 /*
- * Traditionally we consume $$ during := like any other expansion.
- * Other make's do not.
+ * Traditionally this make consumed $$ during := like any other expansion.
+ * Other make's do not, and this make follows straight since 2016-01-09.
+ *
  * This knob allows controlling the behavior.
  * FALSE to consume $$ during := assignment.
  * TRUE to preserve $$ during := assignment.
  */
-#define SAVE_DOLLARS ".MAKE.SAVE_DOLLARS"
+#define MAKE_SAVE_DOLLARS ".MAKE.SAVE_DOLLARS"
 static Boolean save_dollars = TRUE;
 
 /*
@@ -857,7 +858,7 @@ Var_Set_with_flags(const char *name, con
 
 	Var_Append(MAKEOVERRIDES, name, VAR_GLOBAL);
 }
-if (name[0] == '.' && strcmp(name, SAVE_DOLLARS) == 0)
+if (name[0] == '.' && strcmp(name, MAKE_SAVE_DOLLARS) == 0)
 	save_dollars = s2Boolean(val, save_dollars);
 
 out:



CVS commit: src/sys/ddb

2020-10-30 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Oct 30 06:57:09 UTC 2020

Modified Files:
src/sys/ddb: db_command.c db_command.h db_input.c db_proc.c

Log Message:
Trailing whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.170 -r1.171 src/sys/ddb/db_command.c
cvs rdiff -u -r1.38 -r1.39 src/sys/ddb/db_command.h
cvs rdiff -u -r1.27 -r1.28 src/sys/ddb/db_input.c
cvs rdiff -u -r1.12 -r1.13 src/sys/ddb/db_proc.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/ddb/db_command.c
diff -u src/sys/ddb/db_command.c:1.170 src/sys/ddb/db_command.c:1.171
--- src/sys/ddb/db_command.c:1.170	Mon Apr 13 11:43:27 2020
+++ src/sys/ddb/db_command.c	Fri Oct 30 06:57:08 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: db_command.c,v 1.170 2020/04/13 11:43:27 skrll Exp $	*/
+/*	$NetBSD: db_command.c,v 1.171 2020/10/30 06:57:08 skrll Exp $	*/
 
 /*
  * Copyright (c) 1996, 1997, 1998, 1999, 2002, 2009, 2019
@@ -61,7 +61,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: db_command.c,v 1.170 2020/04/13 11:43:27 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_command.c,v 1.171 2020/10/30 06:57:08 skrll Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_aio.h"
@@ -472,7 +472,7 @@ int
 db_register_tbl(uint8_t type, const struct db_command *cmd_tbl)
 {
 	struct db_cmd_tbl_en *list_ent;
-	
+
 	/* empty list - ignore */
 	if (cmd_tbl->name == 0)
 		return 0;

Index: src/sys/ddb/db_command.h
diff -u src/sys/ddb/db_command.h:1.38 src/sys/ddb/db_command.h:1.39
--- src/sys/ddb/db_command.h:1.38	Sun May 31 09:51:55 2020
+++ src/sys/ddb/db_command.h	Fri Oct 30 06:57:08 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: db_command.h,v 1.38 2020/05/31 09:51:55 rin Exp $	*/
+/*	$NetBSD: db_command.h,v 1.39 2020/10/30 06:57:08 skrll Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 1999, 2002 The NetBSD Foundation, Inc.
@@ -88,7 +88,7 @@ struct db_command;
 #define DDB_ADD_CMD(name,funct,type,cmd_descr,cmd_arg,arg_desc)\
  name,funct,type
 #endif
-   
+
 
 
 /*
@@ -109,7 +109,7 @@ int db_unregister_tbl(uint8_t, const str
  */
 struct db_command {
 	const char	*name;		/* command name */
-  
+
 	/* function to call */
 	void		(*fcn)(db_expr_t, bool, db_expr_t, const char *);
 	/*
@@ -130,7 +130,7 @@ struct db_command {
 #define	CS_OWN		0x1			/* non-standard syntax */
 #define	CS_MORE		0x2			/* standard syntax, but may have other
 	   words at end */
-#define CS_COMPAT	0x4			/* is set for compatibilty with old 
+#define CS_COMPAT	0x4			/* is set for compatibilty with old
 	ddb versions*/
 #define CS_SHOW		0x8			/* select show list */
 #define CS_MACH		0x10		/* select machine dependent list */

Index: src/sys/ddb/db_input.c
diff -u src/sys/ddb/db_input.c:1.27 src/sys/ddb/db_input.c:1.28
--- src/sys/ddb/db_input.c:1.27	Sun Sep 29 02:00:22 2019
+++ src/sys/ddb/db_input.c	Fri Oct 30 06:57:08 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: db_input.c,v 1.27 2019/09/29 02:00:22 uwe Exp $	*/
+/*	$NetBSD: db_input.c,v 1.28 2020/10/30 06:57:08 skrll Exp $	*/
 
 /*
  * Mach Operating System
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: db_input.c,v 1.27 2019/09/29 02:00:22 uwe Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_input.c,v 1.28 2020/10/30 06:57:08 skrll Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ddbparam.h"
@@ -153,7 +153,7 @@ db_hist_put(int c)
 	db_history_last = db_history;
 }
 #endif
-	
+
 
 /* returns true at end-of-line */
 static int

Index: src/sys/ddb/db_proc.c
diff -u src/sys/ddb/db_proc.c:1.12 src/sys/ddb/db_proc.c:1.13
--- src/sys/ddb/db_proc.c:1.12	Sat Apr  4 13:59:16 2020
+++ src/sys/ddb/db_proc.c	Fri Oct 30 06:57:08 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: db_proc.c,v 1.12 2020/04/04 13:59:16 mlelstv Exp $	*/
+/*	$NetBSD: db_proc.c,v 1.13 2020/10/30 06:57:08 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2009, 2020 The NetBSD Foundation, Inc.
@@ -61,7 +61,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: db_proc.c,v 1.12 2020/04/04 13:59:16 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_proc.c,v 1.13 2020/10/30 06:57:08 skrll Exp $");
 
 #ifndef _KERNEL
 #include 
@@ -238,7 +238,7 @@ db_show_all_procs(db_expr_t addr, bool h
 			kauth_cred_getuid(p.p_cred),
 #else
 			/* XXX CRASH(8) */ 666,
-#endif			
+#endif
 			p.p_stat, p.p_flag,
 			p.p_nlwps, p.p_comm,
 			(p.p_nlwps != 1) ? "*" : wbuf);



CVS commit: src/usr.bin/make

2020-10-30 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Oct 30 06:44:57 UTC 2020

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

Log Message:
make(1): clean up and update module comment in var.c


To generate a diff of this commit:
cvs rdiff -u -r1.591 -r1.592 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.591 src/usr.bin/make/var.c:1.592
--- src/usr.bin/make/var.c:1.591	Tue Oct 27 07:16:27 2020
+++ src/usr.bin/make/var.c	Fri Oct 30 06:44:57 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: var.c,v 1.591 2020/10/27 07:16:27 rillig Exp $	*/
+/*	$NetBSD: var.c,v 1.592 2020/10/30 06:44:57 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -68,40 +68,48 @@
  * SUCH DAMAGE.
  */
 
-/*-
- * var.c --
- *	Variable-handling functions
+/*
+ * Handling of variables and the expressions formed from them.
+ *
+ * Variables are set using lines of the form VAR=value.  Both the variable
+ * name and the value can contain references to other variables, by using
+ * expressions like ${VAR}, ${VAR:Modifiers}, ${${VARNAME}} or ${VAR:${MODS}}.
  *
  * Interface:
- *	Var_Set		Set the value of a variable in the given
- *			context. The variable is created if it doesn't
- *			yet exist.
- *
- *	Var_Append	Append more characters to an existing variable
- *			in the given context. The variable needn't
- *			exist already -- it will be created if it doesn't.
- *			A space is placed between the old value and the
- *			new one.
+ *	Var_Init	Initialize this module.
+ *
+ *	Var_End		Clean up the module.
+ *
+ *	Var_Set		Set the value of the variable, creating it if
+ *			necessary.
+ *
+ *	Var_Append	Append more characters to the variable, creating it if
+ *			necessary. A space is placed between the old value and
+ *			the new one.
  *
  *	Var_Exists	See if a variable exists.
  *
- *	Var_Value	Return the unexpanded value of a variable in a
- *			context or NULL if the variable is undefined.
+ *	Var_Value	Return the unexpanded value of a variable, or NULL if
+ *			the variable is undefined.
  *
- *	Var_Subst	Substitute either a single variable or all
- *			variables in a string, using the given context.
+ *	Var_Subst	Substitute all variable expressions in a string.
  *
- *	Var_Parse	Parse a variable expansion from a string and
- *			return the result and the number of characters
- *			consumed.
+ *	Var_Parse	Parse a variable expression such as ${VAR:Mpattern}.
  *
- *	Var_Delete	Delete a variable in a context.
+ *	Var_Delete	Delete a variable.
  *
- *	Var_Init	Initialize this module.
+ *	Var_ExportVars	Export some or even all variables to the environment
+ *			of this process and its child processes.
+ *
+ *	Var_Export	Export the variable to the environment of this process
+ *			and its child processes.
+ *
+ *	Var_UnExport	Don't export the variable anymore.
  *
  * Debugging:
- *	Var_Dump	Print out all variables defined in the given
- *			context.
+ *	Var_Stats	Print out hashing statistics if in -dh mode.
+ *
+ *	Var_Dump	Print out all variables defined in the given context.
  *
  * XXX: There's a lot of duplication in these functions.
  */
@@ -121,7 +129,7 @@
 #include"metachar.h"
 
 /*	"@(#)var.c	8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: var.c,v 1.591 2020/10/27 07:16:27 rillig Exp $");
+MAKE_RCSID("$NetBSD: var.c,v 1.592 2020/10/30 06:44:57 rillig Exp $");
 
 #define VAR_DEBUG1(fmt, arg1) DEBUG1(VAR, fmt, arg1)
 #define VAR_DEBUG2(fmt, arg1, arg2) DEBUG2(VAR, fmt, arg1, arg2)



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

2020-10-30 Thread Julian Coleman
Module Name:src
Committed By:   jdc
Date:   Fri Oct 30 06:44:38 UTC 2020

Modified Files:
src/sys/arch/sparc64/conf: GENERIC

Log Message:
Add pcagpio and pcf8574io - hardware status monitors on V210/V240 and E250.


To generate a diff of this commit:
cvs rdiff -u -r1.232 -r1.233 src/sys/arch/sparc64/conf/GENERIC

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/sparc64/conf/GENERIC
diff -u src/sys/arch/sparc64/conf/GENERIC:1.232 src/sys/arch/sparc64/conf/GENERIC:1.233
--- src/sys/arch/sparc64/conf/GENERIC:1.232	Mon Oct 26 11:49:45 2020
+++ src/sys/arch/sparc64/conf/GENERIC	Fri Oct 30 06:44:37 2020
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.232 2020/10/26 11:49:45 martin Exp $
+# $NetBSD: GENERIC,v 1.233 2020/10/30 06:44:37 jdc Exp $
 #
 # GENERIC machine description file
 #
@@ -22,7 +22,7 @@ include 	"arch/sparc64/conf/std.sparc64"
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident		"GENERIC-$Revision: 1.232 $"
+#ident		"GENERIC-$Revision: 1.233 $"
 
 maxusers	64
 
@@ -826,6 +826,8 @@ lmtemp* 	at iic? addr?
 tda*		at iic? addr?	# fan control on SB1000/2000
 dbcool* 	at iic? addr?	# SB25000
 seeprom*	at iic? addr?	# i2c-at24c64 fru's
+pcagpio* 	at iic? addr?	# V210/V240 GPIO's
+pcf8574io* 	at iic? addr?	# E250 GPIO's
 
 ### Other pseudo-devices
 



CVS commit: src/sys/dev/pci

2020-10-30 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Oct 30 06:29:47 UTC 2020

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

Log Message:
Add WMPHY_I350. Not used yet.


To generate a diff of this commit:
cvs rdiff -u -r1.693 -r1.694 src/sys/dev/pci/if_wm.c
cvs rdiff -u -r1.46 -r1.47 src/sys/dev/pci/if_wmvar.h

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

Modified files:

Index: src/sys/dev/pci/if_wm.c
diff -u src/sys/dev/pci/if_wm.c:1.693 src/sys/dev/pci/if_wm.c:1.694
--- src/sys/dev/pci/if_wm.c:1.693	Fri Oct 30 06:23:39 2020
+++ src/sys/dev/pci/if_wm.c	Fri Oct 30 06:29:47 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wm.c,v 1.693 2020/10/30 06:23:39 msaitoh Exp $	*/
+/*	$NetBSD: if_wm.c,v 1.694 2020/10/30 06:29:47 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -82,7 +82,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.693 2020/10/30 06:23:39 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.694 2020/10/30 06:29:47 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -10267,9 +10267,12 @@ wm_gmii_setup_phytype(struct wm_softc *s
 new_phytype = WMPHY_I217;
 break;
 			case MII_MODEL_INTEL_I82580:
-			case MII_MODEL_INTEL_I350:
 new_phytype = WMPHY_82580;
 break;
+			case MII_MODEL_INTEL_I350:
+new_phytype = WMPHY_I350;
+break;
+break;
 			default:
 break;
 			}

Index: src/sys/dev/pci/if_wmvar.h
diff -u src/sys/dev/pci/if_wmvar.h:1.46 src/sys/dev/pci/if_wmvar.h:1.47
--- src/sys/dev/pci/if_wmvar.h:1.46	Tue Sep 15 08:39:04 2020
+++ src/sys/dev/pci/if_wmvar.h	Fri Oct 30 06:29:47 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wmvar.h,v 1.46 2020/09/15 08:39:04 msaitoh Exp $	*/
+/*	$NetBSD: if_wmvar.h,v 1.47 2020/10/30 06:29:47 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -198,9 +198,10 @@ typedef enum {
 	WMPHY_BM,	/* 82567: ICH8 ICH9 ICH10 */
 	WMPHY_82578,	/* 82578: PCH */
 	WMPHY_82577,	/* 82577: PCH (NOTE: functionality newer than 82578) */
-	WMPHY_82579,	/* 82579 : PCH2 */
+	WMPHY_82579,	/* 82579: PCH2 */
 	WMPHY_I217,	/* I217:  _LPT, I218: _LPT, I219: _SPT _CNP */
-	WMPHY_82580,	/* 82580: 82580 or I350 */
+	WMPHY_82580,	/* 82580 */
+	WMPHY_I350,	/* I350 */
 	WMPHY_VF,
 	WMPHY_I210	/* I210: I210 I211 */
 } wm_phy_type;



CVS commit: src/sys/dev/pci

2020-10-30 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Oct 30 06:23:39 UTC 2020

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

Log Message:
 Add new sysctl hw.wmN.debug_flags. This sysctl can be used if WM_DEBUG is set.
OK'd by knakahara.

% sysctl -d hw.wm0.debug_flags
hw.wm0.debug_flags: Debug flags:
0x01 LINK
0x02 TX
0x04 RX
0x08 GMII
0x10 MANAGE
0x20 NVM
0x40 INIT
0x80 LOCK


To generate a diff of this commit:
cvs rdiff -u -r1.692 -r1.693 src/sys/dev/pci/if_wm.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_wm.c
diff -u src/sys/dev/pci/if_wm.c:1.692 src/sys/dev/pci/if_wm.c:1.693
--- src/sys/dev/pci/if_wm.c:1.692	Wed Oct 28 07:08:08 2020
+++ src/sys/dev/pci/if_wm.c	Fri Oct 30 06:23:39 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wm.c,v 1.692 2020/10/28 07:08:08 msaitoh Exp $	*/
+/*	$NetBSD: if_wm.c,v 1.693 2020/10/30 06:23:39 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -82,7 +82,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.692 2020/10/28 07:08:08 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.693 2020/10/30 06:23:39 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -157,11 +157,20 @@ __KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.
 #define	WM_DEBUG_NVM		__BIT(5)
 #define	WM_DEBUG_INIT		__BIT(6)
 #define	WM_DEBUG_LOCK		__BIT(7)
-int	wm_debug = WM_DEBUG_TX | WM_DEBUG_RX | WM_DEBUG_LINK | WM_DEBUG_GMII
-| WM_DEBUG_MANAGE | WM_DEBUG_NVM | WM_DEBUG_INIT | WM_DEBUG_LOCK;
-#define	DPRINTF(x, y)	do { if (wm_debug & (x)) printf y; } while (0)
+
+#if 0
+#define WM_DEBUG_DEFAULT	WM_DEBUG_TX | WM_DEBUG_RX | WM_DEBUG_LINK | \
+	WM_DEBUG_GMII | WM_DEBUG_MANAGE | WM_DEBUG_NVM | WM_DEBUG_INIT |\
+	WM_DEBUG_LOCK
+#endif
+
+#define	DPRINTF(sc, x, y)			  \
+	do {	  \
+		if ((sc)->sc_debug & (x))	  \
+			printf y;		  \
+	} while (0)
 #else
-#define	DPRINTF(x, y)	__nothing
+#define	DPRINTF(sc, x, y)	__nothing
 #endif /* WM_DEBUG */
 
 #ifdef NET_MPSAFE
@@ -624,6 +633,9 @@ struct wm_softc {
 
 	struct wm_phyop phy;
 	struct wm_nvmop nvm;
+#ifdef WM_DEBUG
+	uint32_t sc_debug;
+#endif
 };
 
 #define WM_CORE_LOCK(_sc)		\
@@ -1033,6 +1045,10 @@ static int	wm_platform_pm_pch_lpt(struct
 static int	wm_pll_workaround_i210(struct wm_softc *);
 static void	wm_legacy_irq_quirk_spt(struct wm_softc *);
 
+#ifdef WM_DEBUG
+static int	wm_sysctl_debug(SYSCTLFN_PROTO);
+#endif
+
 CFATTACH_DECL3_NEW(wm, sizeof(struct wm_softc),
 wm_match, wm_attach, wm_detach, NULL, NULL, NULL, DVF_DETACH_SHUTDOWN);
 
@@ -1844,6 +1860,9 @@ wm_attach(device_t parent, device_t self
 	uint32_t link_mode;
 	uint32_t reg;
 
+#if defined(WM_DEBUG) && defined(WM_DEBUG_DEFAULT)
+	sc->sc_debug = WM_DEBUG_DEFAULT;
+#endif
 	sc->sc_dev = self;
 	callout_init(>sc_tick_ch, WM_CALLOUT_FLAGS);
 	callout_setfunc(>sc_tick_ch, wm_tick, sc);
@@ -3422,7 +3441,7 @@ wm_ifflags_cb(struct ethercom *ec)
 	bool needreset = false;
 	int rc = 0;
 
-	DPRINTF(WM_DEBUG_INIT, ("%s: %s called\n",
+	DPRINTF(sc, WM_DEBUG_INIT, ("%s: %s called\n",
 		device_xname(sc->sc_dev), __func__));
 
 	WM_CORE_LOCK(sc);
@@ -3478,7 +3497,7 @@ wm_ioctl(struct ifnet *ifp, u_long cmd, 
 	struct sockaddr_dl *sdl;
 	int s, error;
 
-	DPRINTF(WM_DEBUG_INIT, ("%s: %s called\n",
+	DPRINTF(sc, WM_DEBUG_INIT, ("%s: %s called\n",
 		device_xname(sc->sc_dev), __func__));
 
 #ifndef WM_MPSAFE
@@ -3807,7 +3826,7 @@ wm_set_filter(struct wm_softc *sc)
 	uint32_t hash, reg, bit;
 	int i, size, ralmax, rv;
 
-	DPRINTF(WM_DEBUG_INIT, ("%s: %s called\n",
+	DPRINTF(sc, WM_DEBUG_INIT, ("%s: %s called\n",
 		device_xname(sc->sc_dev), __func__));
 
 	if (sc->sc_type >= WM_T_82544)
@@ -3951,7 +3970,7 @@ static void
 wm_set_vlan(struct wm_softc *sc)
 {
 
-	DPRINTF(WM_DEBUG_INIT, ("%s: %s called\n",
+	DPRINTF(sc, WM_DEBUG_INIT, ("%s: %s called\n",
 		device_xname(sc->sc_dev), __func__));
 
 	/* Deal with VLAN enables. */
@@ -4037,7 +4056,7 @@ wm_lan_init_done(struct wm_softc *sc)
 	uint32_t reg = 0;
 	int i;
 
-	DPRINTF(WM_DEBUG_INIT, ("%s: %s called\n",
+	DPRINTF(sc, WM_DEBUG_INIT, ("%s: %s called\n",
 		device_xname(sc->sc_dev), __func__));
 
 	/* Wait for eeprom to reload */
@@ -4076,7 +4095,7 @@ wm_get_cfg_done(struct wm_softc *sc)
 	uint32_t reg;
 	int i;
 
-	DPRINTF(WM_DEBUG_INIT, ("%s: %s called\n",
+	DPRINTF(sc, WM_DEBUG_INIT, ("%s: %s called\n",
 		device_xname(sc->sc_dev), __func__));
 
 	/* Wait for eeprom to reload */
@@ -4123,7 +4142,7 @@ wm_get_cfg_done(struct wm_softc *sc)
 			delay(1000);
 		}
 		if (i >= WM_PHY_CFG_TIMEOUT)
-			DPRINTF(WM_DEBUG_GMII, ("%s: %s failed\n",
+			DPRINTF(sc, WM_DEBUG_GMII, ("%s: %s failed\n",
 device_xname(sc->sc_dev), __func__));
 		break;
 	case WM_T_ICH8:
@@ -4220,7 +4239,7 @@ wm_write_smbus_addr(struct wm_softc *sc)
 	uint16_t phy_data;
 	int rv;
 
-	DPRINTF(WM_DEBUG_INIT, ("%s: %s called\n",
+	

CVS commit: src/external/public-domain/sqlite/dist

2020-10-30 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Oct 30 06:02:06 UTC 2020

Modified Files:
src/external/public-domain/sqlite/dist: sqlite3.c

Log Message:
Instead of a random 'prohibitively high' value, use DBL_MAX so it builds on VAX


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/external/public-domain/sqlite/dist/sqlite3.c

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

Modified files:

Index: src/external/public-domain/sqlite/dist/sqlite3.c
diff -u src/external/public-domain/sqlite/dist/sqlite3.c:1.18 src/external/public-domain/sqlite/dist/sqlite3.c:1.19
--- src/external/public-domain/sqlite/dist/sqlite3.c:1.18	Sat Dec 22 03:22:19 2018
+++ src/external/public-domain/sqlite/dist/sqlite3.c	Fri Oct 30 06:02:05 2020
@@ -185409,7 +185409,7 @@ SQLITE_API int sqlite3_rtree_init(
 **May you share freely, never taking more than you give.
 **
 *
-** $Id: sqlite3.c,v 1.18 2018/12/22 03:22:19 christos Exp $
+** $Id: sqlite3.c,v 1.19 2020/10/30 06:02:05 martin Exp $
 **
 ** This file implements an integration between the ICU library 
 ** ("International Components for Unicode", an open-source library 
@@ -213756,7 +213756,7 @@ static int fts5BestIndexMethod(sqlite3_v
   }else{
 /* As there exists an unusable MATCH constraint this is an 
 ** unusable plan. Set a prohibitively high cost. */
-pInfo->estimatedCost = 1e50;
+pInfo->estimatedCost = DBL_MAX;
 return SQLITE_OK;
   }
 }else if( p->op<=SQLITE_INDEX_CONSTRAINT_MATCH ){