CVS commit: src/usr.bin/make

2020-11-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Nov 29 01:40:26 UTC 2020

Modified Files:
src/usr.bin/make: arch.c cond.c dir.c main.c make.h parse.c suff.c

Log Message:
make(1): reduce memory allocation for dirSearchPath


To generate a diff of this commit:
cvs rdiff -u -r1.181 -r1.182 src/usr.bin/make/arch.c
cvs rdiff -u -r1.219 -r1.220 src/usr.bin/make/cond.c
cvs rdiff -u -r1.227 -r1.228 src/usr.bin/make/dir.c
cvs rdiff -u -r1.489 -r1.490 src/usr.bin/make/main.c
cvs rdiff -u -r1.228 -r1.229 src/usr.bin/make/make.h
cvs rdiff -u -r1.462 -r1.463 src/usr.bin/make/parse.c
cvs rdiff -u -r1.322 -r1.323 src/usr.bin/make/suff.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.181 src/usr.bin/make/arch.c:1.182
--- src/usr.bin/make/arch.c:1.181	Sat Nov 28 23:13:28 2020
+++ src/usr.bin/make/arch.c	Sun Nov 29 01:40:26 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: arch.c,v 1.181 2020/11/28 23:13:28 rillig Exp $	*/
+/*	$NetBSD: arch.c,v 1.182 2020/11/29 01:40:26 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -125,7 +125,7 @@
 #include "config.h"
 
 /*	"@(#)arch.c	8.2 (Berkeley) 1/2/94"	*/
-MAKE_RCSID("$NetBSD: arch.c,v 1.181 2020/11/28 23:13:28 rillig Exp $");
+MAKE_RCSID("$NetBSD: arch.c,v 1.182 2020/11/29 01:40:26 rillig Exp $");
 
 typedef struct List ArchList;
 typedef struct ListNode ArchListNode;
@@ -345,7 +345,7 @@ Arch_ParseArchive(char **pp, GNodeList *
 
 		} else if (Dir_HasWildcards(memName)) {
 			StringList members = LST_INIT;
-			Dir_Expand(memName, dirSearchPath, );
+			Dir_Expand(memName, , );
 
 			while (!Lst_IsEmpty()) {
 char *member = Lst_Dequeue();

Index: src/usr.bin/make/cond.c
diff -u src/usr.bin/make/cond.c:1.219 src/usr.bin/make/cond.c:1.220
--- src/usr.bin/make/cond.c:1.219	Sat Nov 28 23:39:58 2020
+++ src/usr.bin/make/cond.c	Sun Nov 29 01:40:26 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: cond.c,v 1.219 2020/11/28 23:39:58 rillig Exp $	*/
+/*	$NetBSD: cond.c,v 1.220 2020/11/29 01:40:26 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -94,7 +94,7 @@
 #include "dir.h"
 
 /*	"@(#)cond.c	8.2 (Berkeley) 1/2/94"	*/
-MAKE_RCSID("$NetBSD: cond.c,v 1.219 2020/11/28 23:39:58 rillig Exp $");
+MAKE_RCSID("$NetBSD: cond.c,v 1.220 2020/11/29 01:40:26 rillig Exp $");
 
 /*
  * The parsing of conditional expressions is based on this grammar:
@@ -313,7 +313,7 @@ FuncExists(size_t argLen MAKE_ATTR_UNUSE
 	Boolean result;
 	char *path;
 
-	path = Dir_FindFile(arg, dirSearchPath);
+	path = Dir_FindFile(arg, );
 	DEBUG2(COND, "exists(%s) result is \"%s\"\n",
 	   arg, path != NULL ? path : "");
 	result = path != NULL;

Index: src/usr.bin/make/dir.c
diff -u src/usr.bin/make/dir.c:1.227 src/usr.bin/make/dir.c:1.228
--- src/usr.bin/make/dir.c:1.227	Sat Nov 28 23:22:14 2020
+++ src/usr.bin/make/dir.c	Sun Nov 29 01:40:26 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: dir.c,v 1.227 2020/11/28 23:22:14 rillig Exp $	*/
+/*	$NetBSD: dir.c,v 1.228 2020/11/29 01:40:26 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -136,7 +136,7 @@
 #include "job.h"
 
 /*	"@(#)dir.c	8.2 (Berkeley) 1/2/94"	*/
-MAKE_RCSID("$NetBSD: dir.c,v 1.227 2020/11/28 23:22:14 rillig Exp $");
+MAKE_RCSID("$NetBSD: dir.c,v 1.228 2020/11/29 01:40:26 rillig Exp $");
 
 #define DIR_DEBUG0(text) DEBUG0(DIR, text)
 #define DIR_DEBUG1(fmt, arg1) DEBUG1(DIR, fmt, arg1)
@@ -214,7 +214,7 @@ typedef ListNode CachedDirListNode;
 
 typedef ListNode SearchPathNode;
 
-SearchPath *dirSearchPath;	/* main search path */
+SearchPath dirSearchPath = LST_INIT;	/* main search path */
 
 /* A list of cached directories, with fast lookup by directory name. */
 typedef struct OpenDirs {
@@ -368,7 +368,6 @@ cached_lstat(const char *pathname, struc
 void
 Dir_Init(void)
 {
-	dirSearchPath = SearchPath_New();
 	OpenDirs_Init();
 	HashTable_Init();
 	HashTable_Init();
@@ -459,8 +458,7 @@ Dir_End(void)
 	dotLast->refCount--;
 	Dir_Destroy(dotLast);
 	Dir_Destroy(dot);
-	SearchPath_Clear(dirSearchPath);
-	Lst_Free(dirSearchPath);
+	SearchPath_Clear();
 	OpenDirs_Done();
 	HashTable_Done();
 #endif
@@ -479,7 +477,7 @@ Dir_SetPATH(void)
 
 	Var_Delete(".PATH", VAR_GLOBAL);
 
-	if ((ln = dirSearchPath->first) != NULL) {
+	if ((ln = dirSearchPath.first) != NULL) {
 		CachedDir *dir = ln->datum;
 		if (dir == dotLast) {
 			hasLastDot = TRUE;
@@ -494,7 +492,7 @@ Dir_SetPATH(void)
 			Var_Append(".PATH", cur->name, VAR_GLOBAL);
 	}
 
-	for (ln = dirSearchPath->first; ln != NULL; ln = ln->next) {
+	for (ln = dirSearchPath.first; ln != NULL; ln = ln->next) {
 		CachedDir *dir = ln->datum;
 		if (dir == dotLast)
 			continue;
@@ -1481,7 +1479,7 @@ Dir_CopyDirSearchPath(void)
 {
 	SearchPath *path = SearchPath_New();
 	SearchPathNode *ln;
-	for (ln = dirSearchPath->first; ln != NULL; ln = ln->next) {
+	for (ln = 

CVS commit: src/usr.bin/make

2020-11-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Nov 29 01:40:26 UTC 2020

Modified Files:
src/usr.bin/make: arch.c cond.c dir.c main.c make.h parse.c suff.c

Log Message:
make(1): reduce memory allocation for dirSearchPath


To generate a diff of this commit:
cvs rdiff -u -r1.181 -r1.182 src/usr.bin/make/arch.c
cvs rdiff -u -r1.219 -r1.220 src/usr.bin/make/cond.c
cvs rdiff -u -r1.227 -r1.228 src/usr.bin/make/dir.c
cvs rdiff -u -r1.489 -r1.490 src/usr.bin/make/main.c
cvs rdiff -u -r1.228 -r1.229 src/usr.bin/make/make.h
cvs rdiff -u -r1.462 -r1.463 src/usr.bin/make/parse.c
cvs rdiff -u -r1.322 -r1.323 src/usr.bin/make/suff.c

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



CVS commit: src/usr.bin/make

2020-11-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Nov 29 01:35:33 UTC 2020

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

Log Message:
make(1): reduce memory allocations for parsing dependencies


To generate a diff of this commit:
cvs rdiff -u -r1.461 -r1.462 src/usr.bin/make/parse.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/parse.c
diff -u src/usr.bin/make/parse.c:1.461 src/usr.bin/make/parse.c:1.462
--- src/usr.bin/make/parse.c:1.461	Sun Nov 29 00:04:22 2020
+++ src/usr.bin/make/parse.c	Sun Nov 29 01:35:33 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: parse.c,v 1.461 2020/11/29 00:04:22 rillig Exp $	*/
+/*	$NetBSD: parse.c,v 1.462 2020/11/29 01:35:33 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -117,7 +117,7 @@
 #include "pathnames.h"
 
 /*	"@(#)parse.c	8.3 (Berkeley) 3/19/94"	*/
-MAKE_RCSID("$NetBSD: parse.c,v 1.461 2020/11/29 00:04:22 rillig Exp $");
+MAKE_RCSID("$NetBSD: parse.c,v 1.462 2020/11/29 01:35:33 rillig Exp $");
 
 /* types and constants */
 
@@ -1553,18 +1553,18 @@ ParseDoDependencySourcesMundane(char *st
 	}
 
 	if (*end == '(') {
-	GNodeList *sources = Lst_New();
-	if (!Arch_ParseArchive(, sources, VAR_CMDLINE)) {
+	GNodeList sources = LST_INIT;
+	if (!Arch_ParseArchive(, , VAR_CMDLINE)) {
 		Parse_Error(PARSE_FATAL,
 			"Error in source archive spec \"%s\"", start);
 		return FALSE;
 	}
 
-	while (!Lst_IsEmpty(sources)) {
-		GNode *gn = Lst_Dequeue(sources);
+	while (!Lst_IsEmpty()) {
+		GNode *gn = Lst_Dequeue();
 		ParseDoSrc(tOp, gn->name, specType);
 	}
-	Lst_Free(sources);
+	Lst_Done();
 	end = start;
 	} else {
 	if (*end != '\0') {
@@ -1614,8 +1614,8 @@ ParseDoDependency(char *line)
 SearchPathList *paths;	/* search paths to alter when parsing
  * a list of .PATH targets */
 GNodeType tOp;		/* operator from special target */
-StringList *curTargs;	/* target names to be found and added
- * to the targets list */
+/* target names to be found and added to the targets list */
+StringList curTargs = LST_INIT;
 char *lstart = line;
 
 /*
@@ -1630,19 +1630,17 @@ ParseDoDependency(char *line)
 
 paths = NULL;
 
-curTargs = Lst_New();
-
 /*
  * First, grind through the targets.
  */
 if (!ParseDoDependencyTargets(, , lstart, , , ,
-  curTargs))
+  ))
 	goto out;
 
 /* Don't need the list of target names anymore.
  * The targets themselves are now in the global variable 'targets'. */
-Lst_Free(curTargs);
-curTargs = NULL;
+Lst_Done();
+Lst_Init();
 
 if (!Lst_IsEmpty(targets))
 	ParseDoDependencyCheckSpec(specType);
@@ -1722,8 +1720,7 @@ ParseDoDependency(char *line)
 out:
 if (paths != NULL)
 	Lst_Free(paths);
-if (curTargs != NULL)
-	Lst_Free(curTargs);
+Lst_Done();
 }
 
 typedef struct VarAssignParsed {



CVS commit: src/usr.bin/make

2020-11-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Nov 29 01:35:33 UTC 2020

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

Log Message:
make(1): reduce memory allocations for parsing dependencies


To generate a diff of this commit:
cvs rdiff -u -r1.461 -r1.462 src/usr.bin/make/parse.c

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



CVS commit: src/usr.bin/make

2020-11-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Nov 29 01:30:38 UTC 2020

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

Log Message:
make(1): reduce memory allocations in suffix storage


To generate a diff of this commit:
cvs rdiff -u -r1.321 -r1.322 src/usr.bin/make/suff.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/suff.c
diff -u src/usr.bin/make/suff.c:1.321 src/usr.bin/make/suff.c:1.322
--- src/usr.bin/make/suff.c:1.321	Sun Nov 29 01:24:18 2020
+++ src/usr.bin/make/suff.c	Sun Nov 29 01:30:38 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: suff.c,v 1.321 2020/11/29 01:24:18 rillig Exp $	*/
+/*	$NetBSD: suff.c,v 1.322 2020/11/29 01:30:38 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -114,7 +114,7 @@
 #include "dir.h"
 
 /*	"@(#)suff.c	8.4 (Berkeley) 3/21/94"	*/
-MAKE_RCSID("$NetBSD: suff.c,v 1.321 2020/11/29 01:24:18 rillig Exp $");
+MAKE_RCSID("$NetBSD: suff.c,v 1.322 2020/11/29 01:30:38 rillig Exp $");
 
 #define SUFF_DEBUG0(text) DEBUG0(SUFF, text)
 #define SUFF_DEBUG1(fmt, arg1) DEBUG1(SUFF, fmt, arg1)
@@ -166,15 +166,15 @@ typedef struct Suffix {
 /* Reference count of list membership and several other places */
 int refCount;
 /* Suffixes we have a transformation to */
-SuffixList *parents;
+SuffixList parents;
 /* Suffixes we have a transformation from */
-SuffixList *children;
+SuffixList children;
 
 /* Lists in which this suffix is referenced.
  * XXX: These lists are used nowhere, they are just appended to, for no
  * apparent reason.  They do have the side effect of increasing refCount
  * though. */
-SuffixListList *ref;
+SuffixListList ref;
 } Suffix;
 
 /*
@@ -365,9 +365,9 @@ Suffix_Free(Suffix *suff)
 	 suff->name, suff->refCount);
 #endif
 
-Lst_Free(suff->ref);
-Lst_Free(suff->children);
-Lst_Free(suff->parents);
+Lst_Done(>ref);
+Lst_Done(>children);
+Lst_Done(>parents);
 SearchPath_Free(suff->searchPath);
 
 free(suff->name);
@@ -411,12 +411,12 @@ SuffixList_Insert(SuffixList *list, Suff
 	SUFF_DEBUG2("inserting \"%s\" (%d) at end of list\n",
 		suff->name, suff->sNum);
 	Lst_Append(list, Suffix_Ref(suff));
-	Lst_Append(suff->ref, list);
+	Lst_Append(>ref, list);
 } else if (listSuff->sNum != suff->sNum) {
 	DEBUG4(SUFF, "inserting \"%s\" (%d) before \"%s\" (%d)\n",
 	   suff->name, suff->sNum, listSuff->name, listSuff->sNum);
 	Lst_InsertBefore(list, ln, Suffix_Ref(suff));
-	Lst_Append(suff->ref, list);
+	Lst_Append(>ref, list);
 } else {
 	SUFF_DEBUG2("\"%s\" (%d) is already there\n", suff->name, suff->sNum);
 }
@@ -425,8 +425,8 @@ SuffixList_Insert(SuffixList *list, Suff
 static void
 Relate(Suffix *srcSuff, Suffix *targSuff)
 {
-SuffixList_Insert(targSuff->children, srcSuff);
-SuffixList_Insert(srcSuff->parents, targSuff);
+SuffixList_Insert(>children, srcSuff);
+SuffixList_Insert(>parents, targSuff);
 }
 
 static Suffix *
@@ -437,9 +437,9 @@ Suffix_New(const char *name)
 suff->name = bmake_strdup(name);
 suff->nameLen = strlen(suff->name);
 suff->searchPath = SearchPath_New();
-suff->children = Lst_New();
-suff->parents = Lst_New();
-suff->ref = Lst_New();
+Lst_Init(>children);
+Lst_Init(>parents);
+Lst_Init(>ref);
 suff->sNum = sNum++;
 suff->flags = 0;
 suff->refCount = 1; /* XXX: why 1? It's not assigned anywhere yet. */
@@ -629,8 +629,8 @@ Suff_EndTransform(GNode *gn)
 		srcSuff->name, targSuff->name);
 
 /* Remember parents since srcSuff could be deleted in SuffixList_Remove. */
-srcSuffParents = srcSuff->parents;
-SuffixList_Remove(targSuff->children, srcSuff);
+srcSuffParents = >parents;
+SuffixList_Remove(>children, srcSuff);
 SuffixList_Remove(srcSuffParents, targSuff);
 }
 
@@ -989,7 +989,7 @@ static void
 CandidateList_AddCandidatesFor(CandidateList *list, Candidate *cand)
 {
 SuffixListNode *ln;
-for (ln = cand->suff->children->first; ln != NULL; ln = ln->next) {
+for (ln = cand->suff->children.first; ln != NULL; ln = ln->next) {
 	Suffix *suff = ln->datum;
 
 	if ((suff->flags & SUFF_NULL) && suff->name[0] != '\0') {
@@ -1159,7 +1159,7 @@ FindCmds(Candidate *targ, CandidateSearc
 	 * XXX: Handle multi-stage transformations here, too.
 	 */
 
-	if (Lst_FindDatum(suff->parents, targ->suff) != NULL)
+	if (Lst_FindDatum(>parents, targ->suff) != NULL)
 	break;
 }
 
@@ -1503,7 +1503,7 @@ ExpandMember(GNode *gn, const char *eoar
 size_t nameLen = (size_t)(eoarch - gn->name);
 
 /* Use first matching suffix... */
-for (ln = memSuff->parents->first; ln != NULL; ln = ln->next)
+for (ln = memSuff->parents.first; ln != NULL; ln = ln->next)
 	if (Suffix_IsSuffix(ln->datum, nameLen, eoarch))
 	break;
 
@@ -2105,8 +2105,8 @@ Suffix_Print(Suffix *suff)
 }
 debug_printf("\n");
 
-PrintSuffNames("To", 

CVS commit: src/usr.bin/make

2020-11-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Nov 29 01:30:38 UTC 2020

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

Log Message:
make(1): reduce memory allocations in suffix storage


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

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



CVS commit: src/usr.bin/make

2020-11-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Nov 29 01:24:18 UTC 2020

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

Log Message:
make(1): reduce memory allocations in suffix handling


To generate a diff of this commit:
cvs rdiff -u -r1.320 -r1.321 src/usr.bin/make/suff.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/suff.c
diff -u src/usr.bin/make/suff.c:1.320 src/usr.bin/make/suff.c:1.321
--- src/usr.bin/make/suff.c:1.320	Sun Nov 29 01:19:11 2020
+++ src/usr.bin/make/suff.c	Sun Nov 29 01:24:18 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: suff.c,v 1.320 2020/11/29 01:19:11 rillig Exp $	*/
+/*	$NetBSD: suff.c,v 1.321 2020/11/29 01:24:18 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -114,7 +114,7 @@
 #include "dir.h"
 
 /*	"@(#)suff.c	8.4 (Berkeley) 3/21/94"	*/
-MAKE_RCSID("$NetBSD: suff.c,v 1.320 2020/11/29 01:19:11 rillig Exp $");
+MAKE_RCSID("$NetBSD: suff.c,v 1.321 2020/11/29 01:24:18 rillig Exp $");
 
 #define SUFF_DEBUG0(text) DEBUG0(SUFF, text)
 #define SUFF_DEBUG1(fmt, arg1) DEBUG1(SUFF, fmt, arg1)
@@ -128,11 +128,11 @@ typedef ListNode CandidateListNode;
 
 static SuffixList sufflist = LST_INIT;	/* List of suffixes */
 #ifdef CLEANUP
-static SuffixList *suffClean;	/* List of suffixes to be cleaned */
+static SuffixList suffClean = LST_INIT;	/* List of suffixes to be cleaned */
 #endif
 
 /* List of transformation rules, such as ".c.o" */
-static GNodeList *transforms;
+static GNodeList transforms = LST_INIT;
 
 static int sNum = 0;		/* Counter for assigning suffix numbers */
 
@@ -329,7 +329,7 @@ static GNode *
 FindTransformByName(const char *name)
 {
 GNodeListNode *ln;
-for (ln = transforms->first; ln != NULL; ln = ln->next) {
+for (ln = transforms.first; ln != NULL; ln = ln->next) {
 	GNode *gn = ln->datum;
 	if (strcmp(gn->name, name) == 0)
 	return gn;
@@ -458,7 +458,7 @@ void
 Suff_ClearSuffixes(void)
 {
 #ifdef CLEANUP
-Lst_MoveAll(suffClean, );
+Lst_MoveAll(, );
 #endif
 DEBUG0(SUFF, "Clearing all suffixes\n");
 Lst_Init();
@@ -560,7 +560,7 @@ Suff_AddTransform(const char *name)
 	 * by the Parse module.
 	 */
 	gn = GNode_New(name);
-	Lst_Append(transforms, gn);
+	Lst_Append(, gn);
 } else {
 	/*
 	 * New specification for transformation rule. Just nuke the old list
@@ -805,7 +805,7 @@ Suff_AddSuffix(const char *name, GNode *
  * Look for any existing transformations from or to this suffix.
  * XXX: Only do this after a Suff_ClearSuffixes?
  */
-for (ln = transforms->first; ln != NULL; ln = ln->next)
+for (ln = transforms.first; ln != NULL; ln = ln->next)
 	RebuildGraph(ln->datum, suff);
 }
 
@@ -2054,11 +2054,6 @@ Suff_SetNull(const char *name)
 void
 Suff_Init(void)
 {
-#ifdef CLEANUP
-suffClean = Lst_New();
-#endif
-transforms = Lst_New();
-
 /*
  * Create null suffix for single-suffix rules (POSIX). The thing doesn't
  * actually go on the suffix list or everyone will think that's its
@@ -2074,10 +2069,10 @@ Suff_End(void)
 {
 #ifdef CLEANUP
 Lst_DoneCall(, SuffFree);
-Lst_Destroy(suffClean, SuffFree);
+Lst_DoneCall(, SuffFree);
 if (nullSuff != NULL)
 	SuffFree(nullSuff);
-Lst_Free(transforms);
+Lst_Done();
 #endif
 }
 
@@ -2141,7 +2136,7 @@ Suff_PrintAll(void)
 debug_printf("#*** Transformations:\n");
 {
 	GNodeListNode *ln;
-	for (ln = transforms->first; ln != NULL; ln = ln->next)
+	for (ln = transforms.first; ln != NULL; ln = ln->next)
 	PrintTransformation(ln->datum);
 }
 }



CVS commit: src/usr.bin/make

2020-11-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Nov 29 01:24:18 UTC 2020

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

Log Message:
make(1): reduce memory allocations in suffix handling


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

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



CVS commit: src/usr.bin/make

2020-11-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Nov 29 01:19:11 UTC 2020

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

Log Message:
make(1): reduce memory allocation in ExpandWildcards for suffixes


To generate a diff of this commit:
cvs rdiff -u -r1.319 -r1.320 src/usr.bin/make/suff.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/suff.c
diff -u src/usr.bin/make/suff.c:1.319 src/usr.bin/make/suff.c:1.320
--- src/usr.bin/make/suff.c:1.319	Sun Nov 29 01:16:37 2020
+++ src/usr.bin/make/suff.c	Sun Nov 29 01:19:11 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: suff.c,v 1.319 2020/11/29 01:16:37 rillig Exp $	*/
+/*	$NetBSD: suff.c,v 1.320 2020/11/29 01:19:11 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -114,7 +114,7 @@
 #include "dir.h"
 
 /*	"@(#)suff.c	8.4 (Berkeley) 3/21/94"	*/
-MAKE_RCSID("$NetBSD: suff.c,v 1.319 2020/11/29 01:16:37 rillig Exp $");
+MAKE_RCSID("$NetBSD: suff.c,v 1.320 2020/11/29 01:19:11 rillig Exp $");
 
 #define SUFF_DEBUG0(text) DEBUG0(SUFF, text)
 #define SUFF_DEBUG1(fmt, arg1) DEBUG1(SUFF, fmt, arg1)
@@ -1182,7 +1182,7 @@ static void
 ExpandWildcards(GNodeListNode *cln, GNode *pgn)
 {
 GNode *cgn = cln->datum;
-StringList *expansions;
+StringList expansions;
 
 if (!Dir_HasWildcards(cgn->name))
 	return;
@@ -1190,15 +1190,15 @@ ExpandWildcards(GNodeListNode *cln, GNod
 /*
  * Expand the word along the chosen path
  */
-expansions = Lst_New();
-Dir_Expand(cgn->name, Suff_FindPath(cgn), expansions);
+Lst_Init();
+Dir_Expand(cgn->name, Suff_FindPath(cgn), );
 
-while (!Lst_IsEmpty(expansions)) {
+while (!Lst_IsEmpty()) {
 	GNode	*gn;
 	/*
 	 * Fetch next expansion off the list and find its GNode
 	 */
-	char *cp = Lst_Dequeue(expansions);
+	char *cp = Lst_Dequeue();
 
 	SUFF_DEBUG1("%s...", cp);
 	gn = Targ_GetNode(cp);
@@ -1209,7 +1209,7 @@ ExpandWildcards(GNodeListNode *cln, GNod
 	pgn->unmade++;
 }
 
-Lst_Free(expansions);
+Lst_Done();
 
 SUFF_DEBUG0("\n");
 



CVS commit: src/usr.bin/make

2020-11-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Nov 29 01:19:11 UTC 2020

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

Log Message:
make(1): reduce memory allocation in ExpandWildcards for suffixes


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

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



CVS commit: src/usr.bin/make

2020-11-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Nov 29 01:16:38 UTC 2020

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

Log Message:
make(1): reduce memory allocation in ExpandChildren for suffixes


To generate a diff of this commit:
cvs rdiff -u -r1.318 -r1.319 src/usr.bin/make/suff.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/suff.c
diff -u src/usr.bin/make/suff.c:1.318 src/usr.bin/make/suff.c:1.319
--- src/usr.bin/make/suff.c:1.318	Sun Nov 29 01:12:45 2020
+++ src/usr.bin/make/suff.c	Sun Nov 29 01:16:37 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: suff.c,v 1.318 2020/11/29 01:12:45 rillig Exp $	*/
+/*	$NetBSD: suff.c,v 1.319 2020/11/29 01:16:37 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -114,7 +114,7 @@
 #include "dir.h"
 
 /*	"@(#)suff.c	8.4 (Berkeley) 3/21/94"	*/
-MAKE_RCSID("$NetBSD: suff.c,v 1.318 2020/11/29 01:12:45 rillig Exp $");
+MAKE_RCSID("$NetBSD: suff.c,v 1.319 2020/11/29 01:16:37 rillig Exp $");
 
 #define SUFF_DEBUG0(text) DEBUG0(SUFF, text)
 #define SUFF_DEBUG1(fmt, arg1) DEBUG1(SUFF, fmt, arg1)
@@ -1263,7 +1263,7 @@ ExpandChildren(GNodeListNode *cln, GNode
 /* TODO: handle errors */
 
 {
-	GNodeList *members = Lst_New();
+	GNodeList members = LST_INIT;
 
 	if (cgn->type & OP_ARCHV) {
 	/*
@@ -1273,7 +1273,7 @@ ExpandChildren(GNodeListNode *cln, GNode
 	 */
 	char *sacrifice = cp;
 
-	(void)Arch_ParseArchive(, members, pgn);
+	(void)Arch_ParseArchive(, , pgn);
 	} else {
 	/*
 	 * Break the result into a vector of strings whose nodes
@@ -1296,7 +1296,7 @@ ExpandChildren(GNodeListNode *cln, GNode
 		 */
 		*cp++ = '\0';
 		gn = Targ_GetNode(start);
-		Lst_Append(members, gn);
+		Lst_Append(, gn);
 		pp_skip_hspace();
 		start = cp;		/* Continue at the next non-space. */
 		} else if (*cp == '$') {
@@ -1335,7 +1335,7 @@ ExpandChildren(GNodeListNode *cln, GNode
 		 * Stuff left over -- add it to the list too
 		 */
 		gn = Targ_GetNode(start);
-		Lst_Append(members, gn);
+		Lst_Append(, gn);
 	}
 	/*
 	 * Point cp back at the beginning again so the variable value
@@ -1347,8 +1347,8 @@ ExpandChildren(GNodeListNode *cln, GNode
 	/*
 	 * Add all elements of the members list to the parent node.
 	 */
-	while(!Lst_IsEmpty(members)) {
-	gn = Lst_Dequeue(members);
+	while(!Lst_IsEmpty()) {
+	gn = Lst_Dequeue();
 
 	SUFF_DEBUG1("%s...", gn->name);
 	/* Add gn to the parents child list before the original child */
@@ -1358,7 +1358,7 @@ ExpandChildren(GNodeListNode *cln, GNode
 	/* Expand wildcards on new node */
 	ExpandWildcards(cln->prev, pgn);
 	}
-	Lst_Free(members);
+	Lst_Done();
 
 	/*
 	 * Free the result



CVS commit: src/usr.bin/make

2020-11-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Nov 29 01:16:38 UTC 2020

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

Log Message:
make(1): reduce memory allocation in ExpandChildren for suffixes


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

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



CVS commit: src/usr.bin/make

2020-11-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Nov 29 01:12:45 UTC 2020

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

Log Message:
make(1): reduce memory allocation in suffix candidate search


To generate a diff of this commit:
cvs rdiff -u -r1.317 -r1.318 src/usr.bin/make/suff.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/suff.c
diff -u src/usr.bin/make/suff.c:1.317 src/usr.bin/make/suff.c:1.318
--- src/usr.bin/make/suff.c:1.317	Sun Nov 29 01:10:08 2020
+++ src/usr.bin/make/suff.c	Sun Nov 29 01:12:45 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: suff.c,v 1.317 2020/11/29 01:10:08 rillig Exp $	*/
+/*	$NetBSD: suff.c,v 1.318 2020/11/29 01:12:45 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -114,7 +114,7 @@
 #include "dir.h"
 
 /*	"@(#)suff.c	8.4 (Berkeley) 3/21/94"	*/
-MAKE_RCSID("$NetBSD: suff.c,v 1.317 2020/11/29 01:10:08 rillig Exp $");
+MAKE_RCSID("$NetBSD: suff.c,v 1.318 2020/11/29 01:12:45 rillig Exp $");
 
 #define SUFF_DEBUG0(text) DEBUG0(SUFF, text)
 #define SUFF_DEBUG1(fmt, arg1) DEBUG1(SUFF, fmt, arg1)
@@ -211,7 +211,7 @@ typedef struct Candidate {
 
 typedef struct CandidateSearcher {
 
-CandidateList *list;
+CandidateList list;
 
 /*
  * TODO: Add HashSet for seen entries, to avoid endless loops such as
@@ -901,35 +901,35 @@ Suff_AddLib(const char *suffName)
 static void
 CandidateSearcher_Init(CandidateSearcher *cs)
 {
-cs->list = Lst_New();
+Lst_Init(>list);
 }
 
 static void
 CandidateSearcher_Done(CandidateSearcher *cs)
 {
-Lst_Free(cs->list);
+Lst_Done(>list);
 }
 
 static void
 CandidateSearcher_Add(CandidateSearcher *cs, Candidate *cand)
 {
 /* TODO: filter duplicates */
-Lst_Append(cs->list, cand);
+Lst_Append(>list, cand);
 }
 
 static void
 CandidateSearcher_AddIfNew(CandidateSearcher *cs, Candidate *cand)
 {
 /* TODO: filter duplicates */
-if (Lst_FindDatum(cs->list, cand) == NULL)
-	Lst_Append(cs->list, cand);
+if (Lst_FindDatum(>list, cand) == NULL)
+	Lst_Append(>list, cand);
 }
 
 static void
 CandidateSearcher_MoveAll(CandidateSearcher *cs, CandidateList *list)
 {
 /* TODO: filter duplicates */
-Lst_MoveAll(cs->list, list);
+Lst_MoveAll(>list, list);
 }
 
 
@@ -1967,9 +1967,9 @@ sfnd_return:
 static void
 CandidateSearcher_CleanUp(CandidateSearcher *cs)
 {
-while (RemoveCandidate(cs->list))
+while (RemoveCandidate(>list))
 	continue;
-assert(Lst_IsEmpty(cs->list));
+assert(Lst_IsEmpty(>list));
 }
 
 



CVS commit: src/usr.bin/make

2020-11-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Nov 29 01:12:45 UTC 2020

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

Log Message:
make(1): reduce memory allocation in suffix candidate search


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

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



CVS commit: src/usr.bin/make

2020-11-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Nov 29 01:10:08 UTC 2020

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

Log Message:
make(1): reduce memory allocation in suffix rule handling


To generate a diff of this commit:
cvs rdiff -u -r1.316 -r1.317 src/usr.bin/make/suff.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/suff.c
diff -u src/usr.bin/make/suff.c:1.316 src/usr.bin/make/suff.c:1.317
--- src/usr.bin/make/suff.c:1.316	Sun Nov 29 00:54:43 2020
+++ src/usr.bin/make/suff.c	Sun Nov 29 01:10:08 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: suff.c,v 1.316 2020/11/29 00:54:43 rillig Exp $	*/
+/*	$NetBSD: suff.c,v 1.317 2020/11/29 01:10:08 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -114,7 +114,7 @@
 #include "dir.h"
 
 /*	"@(#)suff.c	8.4 (Berkeley) 3/21/94"	*/
-MAKE_RCSID("$NetBSD: suff.c,v 1.316 2020/11/29 00:54:43 rillig Exp $");
+MAKE_RCSID("$NetBSD: suff.c,v 1.317 2020/11/29 01:10:08 rillig Exp $");
 
 #define SUFF_DEBUG0(text) DEBUG0(SUFF, text)
 #define SUFF_DEBUG1(fmt, arg1) DEBUG1(SUFF, fmt, arg1)
@@ -205,7 +205,7 @@ typedef struct Candidate {
  * don't free this candidate too early or too late. */
 int numChildren;
 #ifdef DEBUG_SRC
-CandidateList *childrenList;
+CandidateList childrenList;
 #endif
 } Candidate;
 
@@ -960,7 +960,7 @@ Candidate_New(char *name, char *prefix, 
 cand->node = gn;
 cand->numChildren = 0;
 #ifdef DEBUG_SRC
-cand->childrenList = Lst_New();
+Lst_Init(>childrenList);
 #endif
 
 return cand;
@@ -976,7 +976,7 @@ CandidateList_Add(CandidateList *list, c
 Lst_Append(list, cand);
 
 #ifdef DEBUG_SRC
-Lst_Append(targ->childrenList, cand);
+Lst_Append(>childrenList, cand);
 debug_printf("%s add suff %p:%s candidate %p:%s to list %p:",
 		 debug_tag, targ, targ->file, cand, cand->file, list);
 CandidateList_PrintAddrs(list);
@@ -1029,16 +1029,16 @@ RemoveCandidate(CandidateList *srcs)
 #ifdef DEBUG_SRC
 	/* XXX: Lst_RemoveDatum */
 		CandidateListNode *ln2;
-		ln2 = Lst_FindDatum(src->parent->childrenList, src);
+		ln2 = Lst_FindDatum(>parent->childrenList, src);
 		if (ln2 != NULL)
-		Lst_Remove(src->parent->childrenList, ln2);
+		Lst_Remove(>parent->childrenList, ln2);
 #endif
 		src->parent->numChildren--;
 	}
 #ifdef DEBUG_SRC
 	debug_printf("free: list %p src %p:%s children %d\n",
 			 srcs, src, src->file, src->numChildren);
-	Lst_Free(src->childrenList);
+	Lst_Done(>childrenList);
 #endif
 	Lst_Remove(srcs, ln);
 	free(src);
@@ -1048,7 +1048,7 @@ RemoveCandidate(CandidateList *srcs)
 	else {
 	debug_printf("keep: list %p src %p:%s children %d:",
 			 srcs, src, src->file, src->numChildren);
-	CandidateList_PrintAddrs(src->childrenList);
+	CandidateList_PrintAddrs(>childrenList);
 	}
 #endif
 }
@@ -1171,7 +1171,7 @@ FindCmds(Candidate *targ, CandidateSearc
 #ifdef DEBUG_SRC
 debug_printf("3 add targ %p:%s ret %p:%s\n",
 		 targ, targ->file, ret, ret->file);
-Lst_Append(targ->childrenList, ret);
+Lst_Append(>childrenList, ret);
 #endif
 CandidateSearcher_Add(cs, ret);
 SUFF_DEBUG1("\tusing existing source %s\n", sgn->name);



CVS commit: src/usr.bin/make

2020-11-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Nov 29 01:10:08 UTC 2020

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

Log Message:
make(1): reduce memory allocation in suffix rule handling


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

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



CVS commit: src/usr.bin/make

2020-11-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Nov 29 01:05:08 UTC 2020

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

Log Message:
make(1): reduce memory allocation for target handling


To generate a diff of this commit:
cvs rdiff -u -r1.147 -r1.148 src/usr.bin/make/targ.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/targ.c
diff -u src/usr.bin/make/targ.c:1.147 src/usr.bin/make/targ.c:1.148
--- src/usr.bin/make/targ.c:1.147	Sun Nov 29 00:04:22 2020
+++ src/usr.bin/make/targ.c	Sun Nov 29 01:05:08 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: targ.c,v 1.147 2020/11/29 00:04:22 rillig Exp $	*/
+/*	$NetBSD: targ.c,v 1.148 2020/11/29 01:05:08 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -108,7 +108,7 @@
  *
  * Debugging:
  *	Targ_PrintGraph
- *			Print out the entire graphm all variables and
+ *			Print out the entire graph, all variables and
  *			statistics for the directory cache. Should print
  *			something for suffixes, too, but...
  */
@@ -119,17 +119,17 @@
 #include "dir.h"
 
 /*	"@(#)targ.c	8.2 (Berkeley) 3/19/94"	*/
-MAKE_RCSID("$NetBSD: targ.c,v 1.147 2020/11/29 00:04:22 rillig Exp $");
+MAKE_RCSID("$NetBSD: targ.c,v 1.148 2020/11/29 01:05:08 rillig Exp $");
 
 /*
  * All target nodes that appeared on the left-hand side of one of the
  * dependency operators ':', '::', '!'.
  */
-static GNodeList *allTargets;
+static GNodeList allTargets = LST_INIT;
 static HashTable allTargetsByName;
 
 #ifdef CLEANUP
-static GNodeList *allNodes;
+static GNodeList allNodes = LST_INIT;
 
 static void GNode_Free(void *);
 #endif
@@ -137,11 +137,7 @@ static void GNode_Free(void *);
 void
 Targ_Init(void)
 {
-allTargets = Lst_New();
 HashTable_Init();
-#ifdef CLEANUP
-allNodes = Lst_New();
-#endif
 }
 
 void
@@ -149,9 +145,9 @@ Targ_End(void)
 {
 Targ_Stats();
 #ifdef CLEANUP
-Lst_Free(allTargets);
+Lst_Done();
 HashTable_Done();
-Lst_Destroy(allNodes, GNode_Free);
+Lst_DoneCall(, GNode_Free);
 #endif
 }
 
@@ -169,7 +165,7 @@ Targ_Stats(void)
 GNodeList *
 Targ_List(void)
 {
-return allTargets;
+return 
 }
 
 /* Create a new graph node, but don't register it anywhere.
@@ -218,7 +214,7 @@ GNode_New(const char *name)
 gn->lineno = 0;
 
 #ifdef CLEANUP
-Lst_Append(allNodes, gn);
+Lst_Append(, gn);
 #endif
 
 return gn;
@@ -288,7 +284,7 @@ Targ_NewInternalNode(const char *name)
 {
 GNode *gn = GNode_New(name);
 Var_Append(".ALLTARGETS", name, VAR_GLOBAL);
-Lst_Append(allTargets, gn);
+Lst_Append(, gn);
 DEBUG1(TARG, "Adding \"%s\" to all targets.\n", gn->name);
 if (doing_depend)
 	gn->flags |= FROM_DEPEND;
@@ -536,7 +532,7 @@ PrintOnlySources(void)
 {
 GNodeListNode *ln;
 
-for (ln = allTargets->first; ln != NULL; ln = ln->next) {
+for (ln = allTargets.first; ln != NULL; ln = ln->next) {
 	GNode *gn = ln->datum;
 	if (GNode_IsTarget(gn))
 	continue;
@@ -556,7 +552,7 @@ void
 Targ_PrintGraph(int pass)
 {
 debug_printf("#*** Input graph:\n");
-Targ_PrintNodes(allTargets, pass);
+Targ_PrintNodes(, pass);
 debug_printf("\n");
 debug_printf("\n");
 
@@ -587,7 +583,7 @@ Targ_Propagate(void)
 {
 GNodeListNode *ln, *cln;
 
-for (ln = allTargets->first; ln != NULL; ln = ln->next) {
+for (ln = allTargets.first; ln != NULL; ln = ln->next) {
 	GNode *gn = ln->datum;
 	GNodeType type = gn->type;
 



CVS commit: src/usr.bin/make

2020-11-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Nov 29 01:05:08 UTC 2020

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

Log Message:
make(1): reduce memory allocation for target handling


To generate a diff of this commit:
cvs rdiff -u -r1.147 -r1.148 src/usr.bin/make/targ.c

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



CVS commit: src/usr.bin/make

2020-11-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Nov 29 00:54:43 UTC 2020

Modified Files:
src/usr.bin/make: lst.c suff.c

Log Message:
make(1): reduce memory allocation in suffix handling

The function Lst_MoveAll previously freed the source list.  This
function was only used in a few places, and none of them really needed
the allocation.


To generate a diff of this commit:
cvs rdiff -u -r1.96 -r1.97 src/usr.bin/make/lst.c
cvs rdiff -u -r1.315 -r1.316 src/usr.bin/make/suff.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/lst.c
diff -u src/usr.bin/make/lst.c:1.96 src/usr.bin/make/lst.c:1.97
--- src/usr.bin/make/lst.c:1.96	Sat Nov 28 19:26:10 2020
+++ src/usr.bin/make/lst.c	Sun Nov 29 00:54:43 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: lst.c,v 1.96 2020/11/28 19:26:10 rillig Exp $ */
+/* $NetBSD: lst.c,v 1.97 2020/11/29 00:54:43 rillig Exp $ */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -34,7 +34,7 @@
 
 #include "make.h"
 
-MAKE_RCSID("$NetBSD: lst.c,v 1.96 2020/11/28 19:26:10 rillig Exp $");
+MAKE_RCSID("$NetBSD: lst.c,v 1.97 2020/11/29 00:54:43 rillig Exp $");
 
 static ListNode *
 LstNodeNew(ListNode *prev, ListNode *next, void *datum)
@@ -207,7 +207,7 @@ Lst_FindDatum(List *list, const void *da
 }
 
 /* Move all nodes from src to the end of dst.
- * The source list is destroyed and freed. */
+ * The source list becomes empty but is not freed. */
 void
 Lst_MoveAll(List *dst, List *src)
 {
@@ -220,7 +220,6 @@ Lst_MoveAll(List *dst, List *src)
 
 		dst->last = src->last;
 	}
-	free(src);
 }
 
 /* Copy the element data from src to the start of dst. */

Index: src/usr.bin/make/suff.c
diff -u src/usr.bin/make/suff.c:1.315 src/usr.bin/make/suff.c:1.316
--- src/usr.bin/make/suff.c:1.315	Sat Nov 28 22:56:01 2020
+++ src/usr.bin/make/suff.c	Sun Nov 29 00:54:43 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: suff.c,v 1.315 2020/11/28 22:56:01 rillig Exp $	*/
+/*	$NetBSD: suff.c,v 1.316 2020/11/29 00:54:43 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -114,7 +114,7 @@
 #include "dir.h"
 
 /*	"@(#)suff.c	8.4 (Berkeley) 3/21/94"	*/
-MAKE_RCSID("$NetBSD: suff.c,v 1.315 2020/11/28 22:56:01 rillig Exp $");
+MAKE_RCSID("$NetBSD: suff.c,v 1.316 2020/11/29 00:54:43 rillig Exp $");
 
 #define SUFF_DEBUG0(text) DEBUG0(SUFF, text)
 #define SUFF_DEBUG1(fmt, arg1) DEBUG1(SUFF, fmt, arg1)
@@ -126,7 +126,7 @@ typedef ListNode SuffixListNode;
 typedef List CandidateList;
 typedef ListNode CandidateListNode;
 
-static SuffixList *sufflist;	/* List of suffixes */
+static SuffixList sufflist = LST_INIT;	/* List of suffixes */
 #ifdef CLEANUP
 static SuffixList *suffClean;	/* List of suffixes to be cleaned */
 #endif
@@ -311,7 +311,7 @@ FindSuffixByNameLen(const char *name, si
 {
 SuffixListNode *ln;
 
-for (ln = sufflist->first; ln != NULL; ln = ln->next) {
+for (ln = sufflist.first; ln != NULL; ln = ln->next) {
 	Suffix *suff = ln->datum;
 	if (suff->nameLen == nameLen && memcmp(suff->name, name, nameLen) == 0)
 	return suff;
@@ -387,7 +387,7 @@ SuffixList_Remove(SuffixList *list, Suff
 SuffixList_Unref(list, suff);
 if (suff->refCount == 0) {
 	/* XXX: can lead to suff->refCount == -1 */
-	SuffixList_Unref(sufflist, suff);
+	SuffixList_Unref(, suff);
 	DEBUG1(SUFF, "Removing suffix \"%s\"\n", suff->name);
 	SuffFree(suff);
 }
@@ -458,10 +458,10 @@ void
 Suff_ClearSuffixes(void)
 {
 #ifdef CLEANUP
-Lst_MoveAll(suffClean, sufflist);
+Lst_MoveAll(suffClean, );
 #endif
 DEBUG0(SUFF, "Clearing all suffixes\n");
-sufflist = Lst_New();
+Lst_Init();
 sNum = 0;
 if (nullSuff != NULL)
 	SuffFree(nullSuff);
@@ -489,7 +489,7 @@ ParseTransform(const char *str, Suffix *
  * we can find two that meet these criteria, we've successfully
  * parsed the string.
  */
-for (ln = sufflist->first; ln != NULL; ln = ln->next) {
+for (ln = sufflist.first; ln != NULL; ln = ln->next) {
 	Suffix *src = ln->datum;
 
 	if (StrTrimPrefix(src->name, str) == NULL)
@@ -796,7 +796,7 @@ Suff_AddSuffix(const char *name, GNode *
 	return;
 
 suff = Suffix_New(name);
-Lst_Append(sufflist, suff);
+Lst_Append(, suff);
 DEBUG1(SUFF, "Adding suffix \"%s\"\n", suff->name);
 
 UpdateTargets(inout_main, suff);
@@ -838,7 +838,7 @@ Suff_DoPaths(void)
 SearchPath *inIncludes = SearchPath_New();	/* Cumulative .INCLUDES path */
 SearchPath *inLibs = SearchPath_New();	/* Cumulative .LIBS path */
 
-for (ln = sufflist->first; ln != NULL; ln = ln->next) {
+for (ln = sufflist.first; ln != NULL; ln = ln->next) {
 	Suffix *suff = ln->datum;
 	if (!Lst_IsEmpty(suff->searchPath)) {
 #ifdef INCLUDES
@@ -1408,7 +1408,7 @@ Suff_FindPath(GNode* gn)
 	char *name = gn->name;
 	size_t nameLen = strlen(gn->name);
 	SuffixListNode *ln;
-	for (ln = sufflist->first; ln != NULL; ln = ln->next)
+	for (ln = sufflist.first; ln != NULL; ln = ln->next)
 	if 

CVS commit: src/usr.bin/make

2020-11-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Nov 29 00:54:43 UTC 2020

Modified Files:
src/usr.bin/make: lst.c suff.c

Log Message:
make(1): reduce memory allocation in suffix handling

The function Lst_MoveAll previously freed the source list.  This
function was only used in a few places, and none of them really needed
the allocation.


To generate a diff of this commit:
cvs rdiff -u -r1.96 -r1.97 src/usr.bin/make/lst.c
cvs rdiff -u -r1.315 -r1.316 src/usr.bin/make/suff.c

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



CVS commit: src/usr.bin/make

2020-11-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Nov 29 00:42:01 UTC 2020

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

Log Message:
make(1): fix main_CleanUp in -DCLEANUP mode (broken since 1 hour)

Broken since main.c 1.486 from 2020-11-28, about 1 hour ago.


To generate a diff of this commit:
cvs rdiff -u -r1.488 -r1.489 src/usr.bin/make/main.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/main.c
diff -u src/usr.bin/make/main.c:1.488 src/usr.bin/make/main.c:1.489
--- src/usr.bin/make/main.c:1.488	Sun Nov 29 00:04:22 2020
+++ src/usr.bin/make/main.c	Sun Nov 29 00:42:01 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.488 2020/11/29 00:04:22 rillig Exp $	*/
+/*	$NetBSD: main.c,v 1.489 2020/11/29 00:42:01 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -109,7 +109,7 @@
 #include "trace.h"
 
 /*	"@(#)main.c	8.3 (Berkeley) 3/19/94"	*/
-MAKE_RCSID("$NetBSD: main.c,v 1.488 2020/11/29 00:04:22 rillig Exp $");
+MAKE_RCSID("$NetBSD: main.c,v 1.489 2020/11/29 00:42:01 rillig Exp $");
 #if defined(MAKE_NATIVE) && !defined(lint)
 __COPYRIGHT("@(#) Copyright (c) 1988, 1989, 1990, 1993 "
 	"The Regents of the University of California.  "
@@ -1627,7 +1627,7 @@ main_CleanUp(void)
 	 * used in GNodes.
 	 */
 	Lst_Done();
-	Lst_Destroy(, free);
+	Lst_DoneCall(, free);
 #endif
 
 	/* print the graph now it's been processed if the user requested it */



CVS commit: src/usr.bin/make

2020-11-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Nov 29 00:42:01 UTC 2020

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

Log Message:
make(1): fix main_CleanUp in -DCLEANUP mode (broken since 1 hour)

Broken since main.c 1.486 from 2020-11-28, about 1 hour ago.


To generate a diff of this commit:
cvs rdiff -u -r1.488 -r1.489 src/usr.bin/make/main.c

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



CVS commit: src/usr.bin/make

2020-11-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Nov 29 00:04:23 UTC 2020

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

Log Message:
make(1): reduce memory allocation for targets

This change moves the initialization and finalization of the list of
targets to the same function.  They had been split before.


To generate a diff of this commit:
cvs rdiff -u -r1.487 -r1.488 src/usr.bin/make/main.c
cvs rdiff -u -r1.163 -r1.164 src/usr.bin/make/nonints.h
cvs rdiff -u -r1.460 -r1.461 src/usr.bin/make/parse.c
cvs rdiff -u -r1.146 -r1.147 src/usr.bin/make/targ.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/main.c
diff -u src/usr.bin/make/main.c:1.487 src/usr.bin/make/main.c:1.488
--- src/usr.bin/make/main.c:1.487	Sat Nov 28 23:43:14 2020
+++ src/usr.bin/make/main.c	Sun Nov 29 00:04:22 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.487 2020/11/28 23:43:14 rillig Exp $	*/
+/*	$NetBSD: main.c,v 1.488 2020/11/29 00:04:22 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -109,7 +109,7 @@
 #include "trace.h"
 
 /*	"@(#)main.c	8.3 (Berkeley) 3/19/94"	*/
-MAKE_RCSID("$NetBSD: main.c,v 1.487 2020/11/28 23:43:14 rillig Exp $");
+MAKE_RCSID("$NetBSD: main.c,v 1.488 2020/11/29 00:04:22 rillig Exp $");
 #if defined(MAKE_NATIVE) && !defined(lint)
 __COPYRIGHT("@(#) Copyright (c) 1988, 1989, 1990, 1993 "
 	"The Regents of the University of California.  "
@@ -913,7 +913,7 @@ doPrintVars(void)
 static Boolean
 runTargets(void)
 {
-	GNodeList *targs;	/* target nodes to create */
+	GNodeList targs = LST_INIT;	/* target nodes to create */
 	Boolean outOfDate;	/* FALSE if all targets up to date */
 
 	/*
@@ -923,9 +923,9 @@ runTargets(void)
 	 * to create.
 	 */
 	if (Lst_IsEmpty())
-		targs = Parse_MainName();
+		Parse_MainName();
 	else
-		targs = Targ_FindList();
+		Targ_FindList(, );
 
 	if (!opts.compatMake) {
 		/*
@@ -941,16 +941,16 @@ runTargets(void)
 		}
 
 		/* Traverse the graph, checking on all the targets */
-		outOfDate = Make_Run(targs);
+		outOfDate = Make_Run();
 	} else {
 		/*
 		 * Compat_Init will take care of creating all the
 		 * targets as well as initializing the module.
 		 */
-		Compat_Run(targs);
+		Compat_Run();
 		outOfDate = FALSE;
 	}
-	Lst_Free(targs);
+	Lst_Done();	/* Don't free the nodes. */
 	return outOfDate;
 }
 

Index: src/usr.bin/make/nonints.h
diff -u src/usr.bin/make/nonints.h:1.163 src/usr.bin/make/nonints.h:1.164
--- src/usr.bin/make/nonints.h:1.163	Sat Nov 28 22:56:01 2020
+++ src/usr.bin/make/nonints.h	Sun Nov 29 00:04:22 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: nonints.h,v 1.163 2020/11/28 22:56:01 rillig Exp $	*/
+/*	$NetBSD: nonints.h,v 1.164 2020/11/29 00:04:22 rillig Exp $	*/
 
 /*-
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -153,7 +153,7 @@ void Parse_DoVar(VarAssign *, GNode *);
 void Parse_AddIncludeDir(const char *);
 void Parse_File(const char *, int);
 void Parse_SetInput(const char *, int, int, NextBufProc, void *);
-GNodeList *Parse_MainName(void);
+void Parse_MainName(GNodeList *);
 int Parse_GetFatals(void);
 
 /* str.c */
@@ -204,7 +204,7 @@ GNode *Targ_FindNode(const char *);
 GNode *Targ_GetNode(const char *);
 GNode *Targ_NewInternalNode(const char *);
 GNode *Targ_GetEndNode(void);
-GNodeList *Targ_FindList(StringList *);
+void Targ_FindList(GNodeList *, StringList *);
 Boolean Targ_Ignore(const GNode *);
 Boolean Targ_Silent(const GNode *);
 Boolean Targ_Precious(const GNode *);

Index: src/usr.bin/make/parse.c
diff -u src/usr.bin/make/parse.c:1.460 src/usr.bin/make/parse.c:1.461
--- src/usr.bin/make/parse.c:1.460	Sat Nov 28 23:39:58 2020
+++ src/usr.bin/make/parse.c	Sun Nov 29 00:04:22 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: parse.c,v 1.460 2020/11/28 23:39:58 rillig Exp $	*/
+/*	$NetBSD: parse.c,v 1.461 2020/11/29 00:04:22 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -117,7 +117,7 @@
 #include "pathnames.h"
 
 /*	"@(#)parse.c	8.3 (Berkeley) 3/19/94"	*/
-MAKE_RCSID("$NetBSD: parse.c,v 1.460 2020/11/28 23:39:58 rillig Exp $");
+MAKE_RCSID("$NetBSD: parse.c,v 1.461 2020/11/29 00:04:22 rillig Exp $");
 
 /* types and constants */
 
@@ -208,7 +208,7 @@ static GNodeList *targets;
  * with duplicates.  Kept in a separate list since the commands from .USE or
  * .USEBEFORE nodes are shared with other GNodes, thereby giving up the
  * easily understandable ownership over the allocated strings. */
-static StringList *targCmds;
+static StringList targCmds = LST_INIT;
 #endif
 
 /*
@@ -2862,7 +2862,7 @@ ParseLine_ShellCommand(const char *p)
 	ParseAddCmd(gn, cmd);
 	}
 #ifdef CLEANUP
-	Lst_Append(targCmds, cmd);
+	Lst_Append(, cmd);
 #endif
 }
 }
@@ -3115,9 +3115,6 @@ Parse_Init(void)
 sysIncPath = SearchPath_New();
 defSysIncPath = SearchPath_New();
 Vector_Init(, sizeof(IFile));
-#ifdef CLEANUP
-targCmds = Lst_New();
-#endif
 }
 
 /* Clean up the parsing module. */
@@ 

CVS commit: src/usr.bin/make

2020-11-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Nov 29 00:04:23 UTC 2020

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

Log Message:
make(1): reduce memory allocation for targets

This change moves the initialization and finalization of the list of
targets to the same function.  They had been split before.


To generate a diff of this commit:
cvs rdiff -u -r1.487 -r1.488 src/usr.bin/make/main.c
cvs rdiff -u -r1.163 -r1.164 src/usr.bin/make/nonints.h
cvs rdiff -u -r1.460 -r1.461 src/usr.bin/make/parse.c
cvs rdiff -u -r1.146 -r1.147 src/usr.bin/make/targ.c

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



CVS commit: src/usr.bin/make

2020-11-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Nov 28 23:50:58 UTC 2020

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

Log Message:
make(1): reduce memory allocation for toBeMade


To generate a diff of this commit:
cvs rdiff -u -r1.225 -r1.226 src/usr.bin/make/make.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.c
diff -u src/usr.bin/make/make.c:1.225 src/usr.bin/make/make.c:1.226
--- src/usr.bin/make/make.c:1.225	Sat Nov 28 23:48:36 2020
+++ src/usr.bin/make/make.c	Sat Nov 28 23:50:58 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: make.c,v 1.225 2020/11/28 23:48:36 rillig Exp $	*/
+/*	$NetBSD: make.c,v 1.226 2020/11/28 23:50:58 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -102,7 +102,7 @@
 #include "job.h"
 
 /*	"@(#)make.c	8.1 (Berkeley) 6/6/93"	*/
-MAKE_RCSID("$NetBSD: make.c,v 1.225 2020/11/28 23:48:36 rillig Exp $");
+MAKE_RCSID("$NetBSD: make.c,v 1.226 2020/11/28 23:50:58 rillig Exp $");
 
 /* Sequence # to detect recursion. */
 static unsigned int checked_seqno = 1;
@@ -110,7 +110,7 @@ static unsigned int checked_seqno = 1;
 /* The current fringe of the graph.
  * These are nodes which await examination by MakeOODate.
  * It is added to by Make_Update and subtracted from by MakeStartJobs */
-static GNodeList *toBeMade;
+static GNodeList toBeMade = LST_INIT;
 
 
 void
@@ -129,7 +129,7 @@ make_abort(GNode *gn, int line)
 
 	debug_printf("make_abort from line %d\n", line);
 	Targ_PrintNode(gn, 2);
-	Targ_PrintNodes(toBeMade, 2);
+	Targ_PrintNodes(, 2);
 	Targ_PrintGraph(3);
 	abort();
 }
@@ -585,7 +585,7 @@ static int MakeBuildParent(GNode *, GNod
 static void
 ScheduleOrderSuccessors(GNode *gn)
 {
-	GNodeListNode *toBeMadeNext = toBeMade->first;
+	GNodeListNode *toBeMadeNext = toBeMade.first;
 	GNodeListNode *ln;
 
 	for (ln = gn->order_succ.first; ln != NULL; ln = ln->next)
@@ -740,7 +740,7 @@ Make_Update(GNode *cgn)
 	}
 	/* Ok, we can schedule the parent again */
 	pgn->made = REQUESTED;
-	Lst_Enqueue(toBeMade, pgn);
+	Lst_Enqueue(, pgn);
 }
 
 UpdateImplicitParentsVars(cgn, cname);
@@ -883,9 +883,9 @@ MakeBuildChild(GNode *cn, GNodeListNode 
 
 	cn->made = REQUESTED;
 	if (toBeMadeNext == NULL)
-		Lst_Append(toBeMade, cn);
+		Lst_Append(, cn);
 	else
-		Lst_InsertBefore(toBeMade, toBeMadeNext, cn);
+		Lst_InsertBefore(, toBeMadeNext, cn);
 
 	if (cn->unmade_cohorts != 0) {
 		ListNode *ln;
@@ -929,13 +929,13 @@ MakeStartJobs(void)
 GNode *gn;
 Boolean have_token = FALSE;
 
-while (!Lst_IsEmpty(toBeMade)) {
+while (!Lst_IsEmpty()) {
 	/* Get token now to avoid cycling job-list when we only have 1 token */
 	if (!have_token && !Job_TokenWithdraw())
 	break;
 	have_token = TRUE;
 
-	gn = Lst_Dequeue(toBeMade);
+	gn = Lst_Dequeue();
 	DEBUG2(MAKE, "Examining %s%s...\n", gn->name, gn->cohort_num);
 
 	if (gn->made != REQUESTED) {
@@ -961,7 +961,7 @@ MakeStartJobs(void)
 	gn->made = DEFERRED;
 
 	{
-		GNodeListNode *toBeMadeNext = toBeMade->first;
+		GNodeListNode *toBeMadeNext = toBeMade.first;
 		GNodeListNode *ln;
 
 		for (ln = gn->children.first; ln != NULL; ln = ln->next)
@@ -1319,7 +1319,7 @@ Make_Run(GNodeList *targs)
 int errors;			/* Number of errors the Job module reports */
 
 /* Start trying to make the current targets... */
-toBeMade = Lst_New();
+Lst_Init();
 
 Make_ExpandUse(targs);
 Make_ProcessWait(targs);
@@ -1356,7 +1356,7 @@ Make_Run(GNodeList *targs)
  * Note that the Job module will exit if there were any errors unless the
  * keepgoing flag was given.
  */
-while (!Lst_IsEmpty(toBeMade) || jobTokensRunning > 0) {
+while (!Lst_IsEmpty() || jobTokensRunning > 0) {
 	Job_CatchOutput();
 	(void)MakeStartJobs();
 }



CVS commit: src/usr.bin/make

2020-11-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Nov 28 23:50:58 UTC 2020

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

Log Message:
make(1): reduce memory allocation for toBeMade


To generate a diff of this commit:
cvs rdiff -u -r1.225 -r1.226 src/usr.bin/make/make.c

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



CVS commit: src/usr.bin/make

2020-11-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Nov 28 23:48:36 UTC 2020

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

Log Message:
make(1): reduce memory allocation in Make_ProcessWait


To generate a diff of this commit:
cvs rdiff -u -r1.224 -r1.225 src/usr.bin/make/make.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.c
diff -u src/usr.bin/make/make.c:1.224 src/usr.bin/make/make.c:1.225
--- src/usr.bin/make/make.c:1.224	Sat Nov 28 23:45:25 2020
+++ src/usr.bin/make/make.c	Sat Nov 28 23:48:36 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: make.c,v 1.224 2020/11/28 23:45:25 rillig Exp $	*/
+/*	$NetBSD: make.c,v 1.225 2020/11/28 23:48:36 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -102,7 +102,7 @@
 #include "job.h"
 
 /*	"@(#)make.c	8.1 (Berkeley) 6/6/93"	*/
-MAKE_RCSID("$NetBSD: make.c,v 1.224 2020/11/28 23:45:25 rillig Exp $");
+MAKE_RCSID("$NetBSD: make.c,v 1.225 2020/11/28 23:48:36 rillig Exp $");
 
 /* Sequence # to detect recursion. */
 static unsigned int checked_seqno = 1;
@@ -1229,7 +1229,7 @@ Make_ProcessWait(GNodeList *targs)
 {
 GNode  *pgn;		/* 'parent' node we are examining */
 GNodeListNode *owln;	/* Previous .WAIT node */
-GNodeList *examine;		/* List of targets to examine */
+GNodeList examine;		/* List of targets to examine */
 
 /*
  * We need all the nodes to have a common parent in order for the
@@ -1257,13 +1257,13 @@ Make_ProcessWait(GNodeList *targs)
 /* Start building with the 'dummy' .MAIN' node */
 MakeBuildChild(pgn, NULL);
 
-examine = Lst_New();
-Lst_Append(examine, pgn);
+Lst_Init();
+Lst_Append(, pgn);
 
-while (!Lst_IsEmpty(examine)) {
+while (!Lst_IsEmpty()) {
 	GNodeListNode *ln;
 
-	pgn = Lst_Dequeue(examine);
+	pgn = Lst_Dequeue();
 
 	/* We only want to process each child-list once */
 	if (pgn->flags & DONE_WAIT)
@@ -1272,7 +1272,7 @@ Make_ProcessWait(GNodeList *targs)
 	DEBUG1(MAKE, "Make_ProcessWait: examine %s\n", pgn->name);
 
 	if (pgn->type & OP_DOUBLEDEP)
-	Lst_PrependAll(examine, >cohorts);
+	Lst_PrependAll(, >cohorts);
 
 	owln = pgn->children.first;
 	for (ln = pgn->children.first; ln != NULL; ln = ln->next) {
@@ -1281,12 +1281,12 @@ Make_ProcessWait(GNodeList *targs)
 		add_wait_dependency(owln, cgn);
 		owln = ln;
 	} else {
-		Lst_Append(examine, cgn);
+		Lst_Append(, cgn);
 	}
 	}
 }
 
-Lst_Free(examine);
+Lst_Done();
 }
 
 /*-



CVS commit: src/usr.bin/make

2020-11-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Nov 28 23:48:36 UTC 2020

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

Log Message:
make(1): reduce memory allocation in Make_ProcessWait


To generate a diff of this commit:
cvs rdiff -u -r1.224 -r1.225 src/usr.bin/make/make.c

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



CVS commit: src/usr.bin/make

2020-11-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Nov 28 23:45:25 UTC 2020

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

Log Message:
make(1): reduce memory allocation in Make_ExpandUse


To generate a diff of this commit:
cvs rdiff -u -r1.223 -r1.224 src/usr.bin/make/make.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.c
diff -u src/usr.bin/make/make.c:1.223 src/usr.bin/make/make.c:1.224
--- src/usr.bin/make/make.c:1.223	Sat Nov 28 19:22:32 2020
+++ src/usr.bin/make/make.c	Sat Nov 28 23:45:25 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: make.c,v 1.223 2020/11/28 19:22:32 rillig Exp $	*/
+/*	$NetBSD: make.c,v 1.224 2020/11/28 23:45:25 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -102,7 +102,7 @@
 #include "job.h"
 
 /*	"@(#)make.c	8.1 (Berkeley) 6/6/93"	*/
-MAKE_RCSID("$NetBSD: make.c,v 1.223 2020/11/28 19:22:32 rillig Exp $");
+MAKE_RCSID("$NetBSD: make.c,v 1.224 2020/11/28 23:45:25 rillig Exp $");
 
 /* Sequence # to detect recursion. */
 static unsigned int checked_seqno = 1;
@@ -1141,8 +1141,8 @@ ExamineLater(GNodeList *examine, GNodeLi
 void
 Make_ExpandUse(GNodeList *targs)
 {
-GNodeList *examine = Lst_New();	/* Queue of targets to examine */
-Lst_AppendAll(examine, targs);
+GNodeList examine = LST_INIT;	/* Queue of targets to examine */
+Lst_AppendAll(, targs);
 
 /*
  * Make an initial downward pass over the graph, marking nodes to be made
@@ -1152,8 +1152,8 @@ Make_ExpandUse(GNodeList *targs)
  * be looked at in a minute, otherwise we add its children to our queue
  * and go on about our business.
  */
-while (!Lst_IsEmpty(examine)) {
-	GNode *gn = Lst_Dequeue(examine);
+while (!Lst_IsEmpty()) {
+	GNode *gn = Lst_Dequeue();
 
 	if (gn->flags & REMAKE)
 	/* We've looked at this one already */
@@ -1163,7 +1163,7 @@ Make_ExpandUse(GNodeList *targs)
 	   gn->name, gn->cohort_num);
 
 	if (gn->type & OP_DOUBLEDEP)
-	Lst_PrependAll(examine, >cohorts);
+	Lst_PrependAll(, >cohorts);
 
 	/*
 	 * Apply any .USE rules before looking for implicit dependencies
@@ -1199,10 +1199,10 @@ Make_ExpandUse(GNodeList *targs)
 	}
 
 	if (gn->unmade != 0)
-	ExamineLater(examine, >children);
+	ExamineLater(, >children);
 }
 
-Lst_Free(examine);
+Lst_Done();
 }
 
 /* Make the .WAIT node depend on the previous children */



CVS commit: src/usr.bin/make

2020-11-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Nov 28 23:45:25 UTC 2020

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

Log Message:
make(1): reduce memory allocation in Make_ExpandUse


To generate a diff of this commit:
cvs rdiff -u -r1.223 -r1.224 src/usr.bin/make/make.c

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



CVS commit: src/usr.bin/make

2020-11-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Nov 28 23:43:14 UTC 2020

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

Log Message:
make(1): reduce memory allocation in ReadBuiltinRules


To generate a diff of this commit:
cvs rdiff -u -r1.486 -r1.487 src/usr.bin/make/main.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/main.c
diff -u src/usr.bin/make/main.c:1.486 src/usr.bin/make/main.c:1.487
--- src/usr.bin/make/main.c:1.486	Sat Nov 28 23:39:58 2020
+++ src/usr.bin/make/main.c	Sat Nov 28 23:43:14 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.486 2020/11/28 23:39:58 rillig Exp $	*/
+/*	$NetBSD: main.c,v 1.487 2020/11/28 23:43:14 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -109,7 +109,7 @@
 #include "trace.h"
 
 /*	"@(#)main.c	8.3 (Berkeley) 3/19/94"	*/
-MAKE_RCSID("$NetBSD: main.c,v 1.486 2020/11/28 23:39:58 rillig Exp $");
+MAKE_RCSID("$NetBSD: main.c,v 1.487 2020/11/28 23:43:14 rillig Exp $");
 #if defined(MAKE_NATIVE) && !defined(lint)
 __COPYRIGHT("@(#) Copyright (c) 1988, 1989, 1990, 1993 "
 	"The Regents of the University of California.  "
@@ -1210,25 +1210,25 @@ static void
 ReadBuiltinRules(void)
 {
 	StringListNode *ln;
-	StringList *sysMkPath = Lst_New();
+	StringList sysMkPath = LST_INIT;
 
 	Dir_Expand(_PATH_DEFSYSMK,
 	Lst_IsEmpty(sysIncPath) ? defSysIncPath : sysIncPath,
-	sysMkPath);
-	if (Lst_IsEmpty(sysMkPath))
+	);
+	if (Lst_IsEmpty())
 		Fatal("%s: no system rules (%s).", progname, _PATH_DEFSYSMK);
 
-	for (ln = sysMkPath->first; ln != NULL; ln = ln->next)
+	for (ln = sysMkPath.first; ln != NULL; ln = ln->next)
 		if (ReadMakefile(ln->datum) == 0)
 			break;
 
 	if (ln == NULL)
 		Fatal("%s: cannot open %s.",
-		progname, (const char *)sysMkPath->first->datum);
+		progname, (const char *)sysMkPath.first->datum);
 
 	/* Free the list but not the actual filenames since these may still
 	 * be used in GNodes. */
-	Lst_Free(sysMkPath);
+	Lst_Done();
 }
 
 static void



CVS commit: src/usr.bin/make

2020-11-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Nov 28 23:43:14 UTC 2020

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

Log Message:
make(1): reduce memory allocation in ReadBuiltinRules


To generate a diff of this commit:
cvs rdiff -u -r1.486 -r1.487 src/usr.bin/make/main.c

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



CVS commit: src/usr.bin/make

2020-11-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Nov 28 23:39:58 UTC 2020

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

Log Message:
make(1): reduce memory allocation for CmdOpts.create


To generate a diff of this commit:
cvs rdiff -u -r1.218 -r1.219 src/usr.bin/make/cond.c
cvs rdiff -u -r1.485 -r1.486 src/usr.bin/make/main.c
cvs rdiff -u -r1.227 -r1.228 src/usr.bin/make/make.h
cvs rdiff -u -r1.459 -r1.460 src/usr.bin/make/parse.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.218 src/usr.bin/make/cond.c:1.219
--- src/usr.bin/make/cond.c:1.218	Sat Nov 28 18:55:52 2020
+++ src/usr.bin/make/cond.c	Sat Nov 28 23:39:58 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: cond.c,v 1.218 2020/11/28 18:55:52 rillig Exp $	*/
+/*	$NetBSD: cond.c,v 1.219 2020/11/28 23:39:58 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -94,7 +94,7 @@
 #include "dir.h"
 
 /*	"@(#)cond.c	8.2 (Berkeley) 1/2/94"	*/
-MAKE_RCSID("$NetBSD: cond.c,v 1.218 2020/11/28 18:55:52 rillig Exp $");
+MAKE_RCSID("$NetBSD: cond.c,v 1.219 2020/11/28 23:39:58 rillig Exp $");
 
 /*
  * The parsing of conditional expressions is based on this grammar:
@@ -300,7 +300,7 @@ FuncMake(size_t argLen MAKE_ATTR_UNUSED,
 {
 	StringListNode *ln;
 
-	for (ln = opts.create->first; ln != NULL; ln = ln->next)
+	for (ln = opts.create.first; ln != NULL; ln = ln->next)
 		if (Str_Match(ln->datum, arg))
 			return TRUE;
 	return FALSE;

Index: src/usr.bin/make/main.c
diff -u src/usr.bin/make/main.c:1.485 src/usr.bin/make/main.c:1.486
--- src/usr.bin/make/main.c:1.485	Sat Nov 28 23:35:44 2020
+++ src/usr.bin/make/main.c	Sat Nov 28 23:39:58 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.485 2020/11/28 23:35:44 rillig Exp $	*/
+/*	$NetBSD: main.c,v 1.486 2020/11/28 23:39:58 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -109,7 +109,7 @@
 #include "trace.h"
 
 /*	"@(#)main.c	8.3 (Berkeley) 3/19/94"	*/
-MAKE_RCSID("$NetBSD: main.c,v 1.485 2020/11/28 23:35:44 rillig Exp $");
+MAKE_RCSID("$NetBSD: main.c,v 1.486 2020/11/28 23:39:58 rillig Exp $");
 #if defined(MAKE_NATIVE) && !defined(lint)
 __COPYRIGHT("@(#) Copyright (c) 1988, 1989, 1990, 1993 "
 	"The Regents of the University of California.  "
@@ -664,7 +664,7 @@ rearg:
 Punt("illegal (null) argument.");
 			if (argv[1][0] == '-' && !dashDash)
 goto rearg;
-			Lst_Append(opts.create, bmake_strdup(argv[1]));
+			Lst_Append(, bmake_strdup(argv[1]));
 		}
 	}
 
@@ -922,10 +922,10 @@ runTargets(void)
 	 * we consult the parsing module to find the main target(s)
 	 * to create.
 	 */
-	if (Lst_IsEmpty(opts.create))
+	if (Lst_IsEmpty())
 		targs = Parse_MainName();
 	else
-		targs = Targ_FindList(opts.create);
+		targs = Targ_FindList();
 
 	if (!opts.compatMake) {
 		/*
@@ -964,12 +964,12 @@ InitVarTargets(void)
 {
 	StringListNode *ln;
 
-	if (Lst_IsEmpty(opts.create)) {
+	if (Lst_IsEmpty()) {
 		Var_Set(".TARGETS", "", VAR_GLOBAL);
 		return;
 	}
 
-	for (ln = opts.create->first; ln != NULL; ln = ln->next) {
+	for (ln = opts.create.first; ln != NULL; ln = ln->next) {
 		char *name = ln->datum;
 		Var_Append(".TARGETS", name, VAR_GLOBAL);
 	}
@@ -1141,7 +1141,7 @@ CmdOpts_Init(void)
 	opts.parseWarnFatal = FALSE;
 	opts.enterFlag = FALSE;
 	opts.varNoExportEnv = FALSE;
-	opts.create = Lst_New();
+	Lst_Init();
 }
 
 /* Initialize MAKE and .MAKE to the path of the executable, so that it can be
@@ -1627,7 +1627,7 @@ main_CleanUp(void)
 	 * used in GNodes.
 	 */
 	Lst_Done();
-	Lst_Destroy(opts.create, free);
+	Lst_Destroy(, free);
 #endif
 
 	/* print the graph now it's been processed if the user requested it */

Index: src/usr.bin/make/make.h
diff -u src/usr.bin/make/make.h:1.227 src/usr.bin/make/make.h:1.228
--- src/usr.bin/make/make.h:1.227	Sat Nov 28 23:35:44 2020
+++ src/usr.bin/make/make.h	Sat Nov 28 23:39:58 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: make.h,v 1.227 2020/11/28 23:35:44 rillig Exp $	*/
+/*	$NetBSD: make.h,v 1.228 2020/11/28 23:39:58 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -685,7 +685,7 @@ typedef struct CmdOpts {
 
 	/* The target names specified on the command line.
 	 * Used to resolve .if make(...) statements. */
-	StringList *create;
+	StringList create;
 
 } CmdOpts;
 

Index: src/usr.bin/make/parse.c
diff -u src/usr.bin/make/parse.c:1.459 src/usr.bin/make/parse.c:1.460
--- src/usr.bin/make/parse.c:1.459	Sat Nov 28 22:56:01 2020
+++ src/usr.bin/make/parse.c	Sat Nov 28 23:39:58 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: parse.c,v 1.459 2020/11/28 22:56:01 rillig Exp $	*/
+/*	$NetBSD: parse.c,v 1.460 2020/11/28 23:39:58 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -117,7 +117,7 @@
 #include "pathnames.h"
 
 /*	"@(#)parse.c	8.3 (Berkeley) 3/19/94"	*/
-MAKE_RCSID("$NetBSD: parse.c,v 1.459 2020/11/28 22:56:01 rillig Exp $");

CVS commit: src/usr.bin/make

2020-11-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Nov 28 23:39:58 UTC 2020

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

Log Message:
make(1): reduce memory allocation for CmdOpts.create


To generate a diff of this commit:
cvs rdiff -u -r1.218 -r1.219 src/usr.bin/make/cond.c
cvs rdiff -u -r1.485 -r1.486 src/usr.bin/make/main.c
cvs rdiff -u -r1.227 -r1.228 src/usr.bin/make/make.h
cvs rdiff -u -r1.459 -r1.460 src/usr.bin/make/parse.c

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



CVS commit: src/usr.bin/make

2020-11-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Nov 28 23:35:44 UTC 2020

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

Log Message:
make(1): reduce memory allocation in CmdOpts.variables


To generate a diff of this commit:
cvs rdiff -u -r1.484 -r1.485 src/usr.bin/make/main.c
cvs rdiff -u -r1.226 -r1.227 src/usr.bin/make/make.h

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

Modified files:

Index: src/usr.bin/make/main.c
diff -u src/usr.bin/make/main.c:1.484 src/usr.bin/make/main.c:1.485
--- src/usr.bin/make/main.c:1.484	Sat Nov 28 23:32:22 2020
+++ src/usr.bin/make/main.c	Sat Nov 28 23:35:44 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.484 2020/11/28 23:32:22 rillig Exp $	*/
+/*	$NetBSD: main.c,v 1.485 2020/11/28 23:35:44 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -109,7 +109,7 @@
 #include "trace.h"
 
 /*	"@(#)main.c	8.3 (Berkeley) 3/19/94"	*/
-MAKE_RCSID("$NetBSD: main.c,v 1.484 2020/11/28 23:32:22 rillig Exp $");
+MAKE_RCSID("$NetBSD: main.c,v 1.485 2020/11/28 23:35:44 rillig Exp $");
 #if defined(MAKE_NATIVE) && !defined(lint)
 __COPYRIGHT("@(#) Copyright (c) 1988, 1989, 1990, 1993 "
 	"The Regents of the University of California.  "
@@ -500,7 +500,7 @@ MainParseArg(char c, const char *argvalu
 	case 'V':
 	case 'v':
 		opts.printVars = c == 'v' ? PVM_EXPANDED : PVM_UNEXPANDED;
-		Lst_Append(opts.variables, bmake_strdup(argvalue));
+		Lst_Append(, bmake_strdup(argvalue));
 		/* XXX: Why always -V? */
 		Var_Append(MAKEFLAGS, "-V", VAR_GLOBAL);
 		Var_Append(MAKEFLAGS, argvalue, VAR_GLOBAL);
@@ -904,7 +904,7 @@ doPrintVars(void)
 	else
 		expandVars = GetBooleanVar(".MAKE.EXPAND_VARIABLES", FALSE);
 
-	for (ln = opts.variables->first; ln != NULL; ln = ln->next) {
+	for (ln = opts.variables.first; ln != NULL; ln = ln->next) {
 		const char *varname = ln->datum;
 		PrintVar(varname, expandVars);
 	}
@@ -1137,7 +1137,7 @@ CmdOpts_Init(void)
 	opts.beSilent = FALSE;		/* Print commands as executed */
 	opts.touchFlag = FALSE;		/* Actually update targets */
 	opts.printVars = PVM_NONE;
-	opts.variables = Lst_New();
+	Lst_Init();
 	opts.parseWarnFatal = FALSE;
 	opts.enterFlag = FALSE;
 	opts.varNoExportEnv = FALSE;
@@ -1621,7 +1621,7 @@ static void
 main_CleanUp(void)
 {
 #ifdef CLEANUP
-	Lst_Destroy(opts.variables, free);
+	Lst_DoneCall(, free);
 	/*
 	 * Don't free the actual strings from opts.makefiles, they may be
 	 * used in GNodes.

Index: src/usr.bin/make/make.h
diff -u src/usr.bin/make/make.h:1.226 src/usr.bin/make/make.h:1.227
--- src/usr.bin/make/make.h:1.226	Sat Nov 28 23:32:22 2020
+++ src/usr.bin/make/make.h	Sat Nov 28 23:35:44 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: make.h,v 1.226 2020/11/28 23:32:22 rillig Exp $	*/
+/*	$NetBSD: make.h,v 1.227 2020/11/28 23:35:44 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -671,7 +671,7 @@ typedef struct CmdOpts {
 	/* -[Vv]: print expanded or unexpanded selected variables */
 	PrintVarsMode printVars;
 	/* -[Vv]: the variables to print */
-	StringList *variables;
+	StringList variables;
 
 	/* -W: if true, makefile parsing warnings are treated as errors */
 	Boolean parseWarnFatal;



CVS commit: src/usr.bin/make

2020-11-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Nov 28 23:35:44 UTC 2020

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

Log Message:
make(1): reduce memory allocation in CmdOpts.variables


To generate a diff of this commit:
cvs rdiff -u -r1.484 -r1.485 src/usr.bin/make/main.c
cvs rdiff -u -r1.226 -r1.227 src/usr.bin/make/make.h

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



CVS commit: src/usr.bin/make

2020-11-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Nov 28 23:32:22 UTC 2020

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

Log Message:
make(1): reduce memory allocation in CmdOpts.makefiles


To generate a diff of this commit:
cvs rdiff -u -r1.483 -r1.484 src/usr.bin/make/main.c
cvs rdiff -u -r1.225 -r1.226 src/usr.bin/make/make.h

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

Modified files:

Index: src/usr.bin/make/main.c
diff -u src/usr.bin/make/main.c:1.483 src/usr.bin/make/main.c:1.484
--- src/usr.bin/make/main.c:1.483	Sat Nov 28 18:55:52 2020
+++ src/usr.bin/make/main.c	Sat Nov 28 23:32:22 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.483 2020/11/28 18:55:52 rillig Exp $	*/
+/*	$NetBSD: main.c,v 1.484 2020/11/28 23:32:22 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -109,7 +109,7 @@
 #include "trace.h"
 
 /*	"@(#)main.c	8.3 (Berkeley) 3/19/94"	*/
-MAKE_RCSID("$NetBSD: main.c,v 1.483 2020/11/28 18:55:52 rillig Exp $");
+MAKE_RCSID("$NetBSD: main.c,v 1.484 2020/11/28 23:32:22 rillig Exp $");
 #if defined(MAKE_NATIVE) && !defined(lint)
 __COPYRIGHT("@(#) Copyright (c) 1988, 1989, 1990, 1993 "
 	"The Regents of the University of California.  "
@@ -528,7 +528,7 @@ MainParseArg(char c, const char *argvalu
 		Var_Append(MAKEFLAGS, "-e", VAR_GLOBAL);
 		break;
 	case 'f':
-		Lst_Append(opts.makefiles, bmake_strdup(argvalue));
+		Lst_Append(, bmake_strdup(argvalue));
 		break;
 	case 'i':
 		opts.ignoreErrors = TRUE;
@@ -1126,7 +1126,7 @@ CmdOpts_Init(void)
 	opts.lint = FALSE;
 	opts.debugVflag = FALSE;
 	opts.checkEnvFirst = FALSE;
-	opts.makefiles = Lst_New();
+	Lst_Init();
 	opts.ignoreErrors = FALSE;	/* Pay attention to non-zero returns */
 	opts.maxJobs = DEFMAXLOCAL;	/* Set default local max concurrency */
 	opts.keepgoing = FALSE;		/* Stop on error */
@@ -1321,9 +1321,9 @@ ReadFirstDefaultMakefile(void)
 	 * since these makefiles do not come from the command line.  They
 	 * also have different semantics in that only the first file that
 	 * is found is processed.  See ReadAllMakefiles. */
-	(void)str2Lst_Append(opts.makefiles, prefs);
+	(void)str2Lst_Append(, prefs);
 
-	for (ln = opts.makefiles->first; ln != NULL; ln = ln->next)
+	for (ln = opts.makefiles.first; ln != NULL; ln = ln->next)
 		if (ReadMakefile(ln->datum) == 0)
 			break;
 
@@ -1531,8 +1531,8 @@ main_ReadFiles(void)
 	if (!opts.noBuiltins)
 		ReadBuiltinRules();
 
-	if (!Lst_IsEmpty(opts.makefiles))
-		ReadAllMakefiles(opts.makefiles);
+	if (!Lst_IsEmpty())
+		ReadAllMakefiles();
 	else
 		ReadFirstDefaultMakefile();
 }
@@ -1622,7 +1622,11 @@ main_CleanUp(void)
 {
 #ifdef CLEANUP
 	Lst_Destroy(opts.variables, free);
-	Lst_Free(opts.makefiles);	/* don't free, may be used in GNodes */
+	/*
+	 * Don't free the actual strings from opts.makefiles, they may be
+	 * used in GNodes.
+	 */
+	Lst_Done();
 	Lst_Destroy(opts.create, free);
 #endif
 

Index: src/usr.bin/make/make.h
diff -u src/usr.bin/make/make.h:1.225 src/usr.bin/make/make.h:1.226
--- src/usr.bin/make/make.h:1.225	Sat Nov 28 19:22:32 2020
+++ src/usr.bin/make/make.h	Sat Nov 28 23:32:22 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: make.h,v 1.225 2020/11/28 19:22:32 rillig Exp $	*/
+/*	$NetBSD: make.h,v 1.226 2020/11/28 23:32:22 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -635,7 +635,7 @@ typedef struct CmdOpts {
 	Boolean checkEnvFirst;
 
 	/* -f: the makefiles to read */
-	StringList *makefiles;
+	StringList makefiles;
 
 	/* -i: if true, ignore all errors from shell commands */
 	Boolean ignoreErrors;



CVS commit: src/usr.bin/make

2020-11-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Nov 28 23:32:22 UTC 2020

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

Log Message:
make(1): reduce memory allocation in CmdOpts.makefiles


To generate a diff of this commit:
cvs rdiff -u -r1.483 -r1.484 src/usr.bin/make/main.c
cvs rdiff -u -r1.225 -r1.226 src/usr.bin/make/make.h

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



CVS commit: src/usr.bin/make

2020-11-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Nov 28 23:22:15 UTC 2020

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

Log Message:
make(1): reduce memory allocation in OpenDirs


To generate a diff of this commit:
cvs rdiff -u -r1.226 -r1.227 src/usr.bin/make/dir.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.226 src/usr.bin/make/dir.c:1.227
--- src/usr.bin/make/dir.c:1.226	Sat Nov 28 22:59:53 2020
+++ src/usr.bin/make/dir.c	Sat Nov 28 23:22:14 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: dir.c,v 1.226 2020/11/28 22:59:53 rillig Exp $	*/
+/*	$NetBSD: dir.c,v 1.227 2020/11/28 23:22:14 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -136,7 +136,7 @@
 #include "job.h"
 
 /*	"@(#)dir.c	8.2 (Berkeley) 1/2/94"	*/
-MAKE_RCSID("$NetBSD: dir.c,v 1.226 2020/11/28 22:59:53 rillig Exp $");
+MAKE_RCSID("$NetBSD: dir.c,v 1.227 2020/11/28 23:22:14 rillig Exp $");
 
 #define DIR_DEBUG0(text) DEBUG0(DIR, text)
 #define DIR_DEBUG1(fmt, arg1) DEBUG1(DIR, fmt, arg1)
@@ -218,14 +218,14 @@ SearchPath *dirSearchPath;	/* main searc
 
 /* A list of cached directories, with fast lookup by directory name. */
 typedef struct OpenDirs {
-	CachedDirList *list;
+	CachedDirList list;
 	HashTable /* of CachedDirListNode */ table;
 } OpenDirs;
 
 static void
 OpenDirs_Init(OpenDirs *odirs)
 {
-	odirs->list = Lst_New();
+	Lst_Init(>list);
 	HashTable_Init(>table);
 }
 
@@ -235,14 +235,14 @@ static void Dir_Destroy(CachedDir *);
 static void
 OpenDirs_Done(OpenDirs *odirs)
 {
-	CachedDirListNode *ln = odirs->list->first;
+	CachedDirListNode *ln = odirs->list.first;
 	while (ln != NULL) {
 		CachedDirListNode *next = ln->next;
 		CachedDir *dir = ln->datum;
 		Dir_Destroy(dir);	/* removes the dir from odirs->list */
 		ln = next;
 	}
-	Lst_Free(odirs->list);
+	Lst_Done(>list);
 	HashTable_Done(>table);
 }
 #endif
@@ -259,8 +259,8 @@ OpenDirs_Add(OpenDirs *odirs, CachedDir 
 {
 	if (HashTable_FindEntry(>table, cdir->name) != NULL)
 		return;
-	Lst_Append(odirs->list, cdir);
-	HashTable_Set(>table, cdir->name, odirs->list->last);
+	Lst_Append(>list, cdir);
+	HashTable_Set(>table, cdir->name, odirs->list.last);
 }
 
 static void
@@ -272,7 +272,7 @@ OpenDirs_Remove(OpenDirs *odirs, const c
 		return;
 	ln = HashEntry_Get(he);
 	HashTable_DeleteEntry(>table, he);
-	Lst_Remove(odirs->list, ln);
+	Lst_Remove(>list, ln);
 }
 
 static OpenDirs openDirs;	/* all cached directories */
@@ -1610,7 +1610,7 @@ Dir_PrintDirectories(void)
 	percentage(hits, hits + bigmisses + nearmisses));
 	debug_printf("# %-20s referenced\thits\n", "directory");
 
-	for (ln = openDirs.list->first; ln != NULL; ln = ln->next) {
+	for (ln = openDirs.list.first; ln != NULL; ln = ln->next) {
 		CachedDir *dir = ln->datum;
 		debug_printf("# %-20s %10d\t%4d\n",
 			 dir->name, dir->refCount, dir->hits);



CVS commit: src/usr.bin/make

2020-11-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Nov 28 23:22:15 UTC 2020

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

Log Message:
make(1): reduce memory allocation in OpenDirs


To generate a diff of this commit:
cvs rdiff -u -r1.226 -r1.227 src/usr.bin/make/dir.c

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



CVS commit: src/usr.bin/make

2020-11-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Nov 28 23:13:28 UTC 2020

Modified Files:
src/usr.bin/make: arch.c lst.h

Log Message:
make(1): reduce memory allocation in Arch_ParseArchive


To generate a diff of this commit:
cvs rdiff -u -r1.180 -r1.181 src/usr.bin/make/arch.c
cvs rdiff -u -r1.89 -r1.90 src/usr.bin/make/lst.h

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

Modified files:

Index: src/usr.bin/make/arch.c
diff -u src/usr.bin/make/arch.c:1.180 src/usr.bin/make/arch.c:1.181
--- src/usr.bin/make/arch.c:1.180	Sat Nov 28 19:26:10 2020
+++ src/usr.bin/make/arch.c	Sat Nov 28 23:13:28 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: arch.c,v 1.180 2020/11/28 19:26:10 rillig Exp $	*/
+/*	$NetBSD: arch.c,v 1.181 2020/11/28 23:13:28 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -125,7 +125,7 @@
 #include "config.h"
 
 /*	"@(#)arch.c	8.2 (Berkeley) 1/2/94"	*/
-MAKE_RCSID("$NetBSD: arch.c,v 1.180 2020/11/28 19:26:10 rillig Exp $");
+MAKE_RCSID("$NetBSD: arch.c,v 1.181 2020/11/28 23:13:28 rillig Exp $");
 
 typedef struct List ArchList;
 typedef struct ListNode ArchListNode;
@@ -344,11 +344,11 @@ Arch_ParseArchive(char **pp, GNodeList *
 			free(buf);
 
 		} else if (Dir_HasWildcards(memName)) {
-			StringList *members = Lst_New();
-			Dir_Expand(memName, dirSearchPath, members);
+			StringList members = LST_INIT;
+			Dir_Expand(memName, dirSearchPath, );
 
-			while (!Lst_IsEmpty(members)) {
-char *member = Lst_Dequeue(members);
+			while (!Lst_IsEmpty()) {
+char *member = Lst_Dequeue();
 char *fullname = str_concat4(libName, "(",
 			 member, ")");
 free(member);
@@ -359,7 +359,7 @@ Arch_ParseArchive(char **pp, GNodeList *
 gn->type |= OP_ARCHV;
 Lst_Append(nodeLst, gn);
 			}
-			Lst_Free(members);
+			Lst_Done();
 
 		} else {
 			char *fullname = str_concat4(libName, "(", memName,

Index: src/usr.bin/make/lst.h
diff -u src/usr.bin/make/lst.h:1.89 src/usr.bin/make/lst.h:1.90
--- src/usr.bin/make/lst.h:1.89	Sat Nov 28 19:26:10 2020
+++ src/usr.bin/make/lst.h	Sat Nov 28 23:13:28 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: lst.h,v 1.89 2020/11/28 19:26:10 rillig Exp $	*/
+/*	$NetBSD: lst.h,v 1.90 2020/11/28 23:13:28 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -118,6 +118,8 @@ void Lst_Free(List *);
 /* Free the list, freeing the node data using the given function. */
 void Lst_Destroy(List *, LstFreeProc);
 
+#define LST_INIT { NULL, NULL }
+
 /* Initialize a list, without memory allocation. */
 MAKE_INLINE void
 Lst_Init(List *list)



CVS commit: src/usr.bin/make

2020-11-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Nov 28 23:13:28 UTC 2020

Modified Files:
src/usr.bin/make: arch.c lst.h

Log Message:
make(1): reduce memory allocation in Arch_ParseArchive


To generate a diff of this commit:
cvs rdiff -u -r1.180 -r1.181 src/usr.bin/make/arch.c
cvs rdiff -u -r1.89 -r1.90 src/usr.bin/make/lst.h

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



CVS commit: src/usr.bin/make

2020-11-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Nov 28 22:59:53 UTC 2020

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

Log Message:
make(1): replace void pointer in Dir_Destroy with proper pointer


To generate a diff of this commit:
cvs rdiff -u -r1.225 -r1.226 src/usr.bin/make/dir.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.225 src/usr.bin/make/dir.c:1.226
--- src/usr.bin/make/dir.c:1.225	Sat Nov 28 22:56:01 2020
+++ src/usr.bin/make/dir.c	Sat Nov 28 22:59:53 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: dir.c,v 1.225 2020/11/28 22:56:01 rillig Exp $	*/
+/*	$NetBSD: dir.c,v 1.226 2020/11/28 22:59:53 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -136,7 +136,7 @@
 #include "job.h"
 
 /*	"@(#)dir.c	8.2 (Berkeley) 1/2/94"	*/
-MAKE_RCSID("$NetBSD: dir.c,v 1.225 2020/11/28 22:56:01 rillig Exp $");
+MAKE_RCSID("$NetBSD: dir.c,v 1.226 2020/11/28 22:59:53 rillig Exp $");
 
 #define DIR_DEBUG0(text) DEBUG0(DIR, text)
 #define DIR_DEBUG1(fmt, arg1) DEBUG1(DIR, fmt, arg1)
@@ -229,7 +229,7 @@ OpenDirs_Init(OpenDirs *odirs)
 	HashTable_Init(>table);
 }
 
-static void Dir_Destroy(void *);
+static void Dir_Destroy(CachedDir *);
 
 #ifdef CLEANUP
 static void
@@ -1537,9 +1537,8 @@ SearchPath_ToFlags(const char *flag, Sea
  *	dirp		The directory descriptor to nuke
  */
 static void
-Dir_Destroy(void *dirp)
+Dir_Destroy(CachedDir *dir)
 {
-	CachedDir *dir = dirp;
 	dir->refCount--;
 
 	if (dir->refCount == 0) {



CVS commit: src/usr.bin/make

2020-11-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Nov 28 22:59:53 UTC 2020

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

Log Message:
make(1): replace void pointer in Dir_Destroy with proper pointer


To generate a diff of this commit:
cvs rdiff -u -r1.225 -r1.226 src/usr.bin/make/dir.c

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



CVS commit: src/usr.bin/make

2020-11-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Nov 28 22:56:01 UTC 2020

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

Log Message:
make(1): replace Dir_Destroy with SearchPath_Free

The function Dir_Destroy is an implementation detail of the cached
directories, and it should not be exported to the other modules.  The
search paths, on the other hand, are the high-level API that may be used
by the other modules, as the concept of search paths is documented in
the manual page.


To generate a diff of this commit:
cvs rdiff -u -r1.224 -r1.225 src/usr.bin/make/dir.c
cvs rdiff -u -r1.36 -r1.37 src/usr.bin/make/dir.h
cvs rdiff -u -r1.162 -r1.163 src/usr.bin/make/nonints.h
cvs rdiff -u -r1.458 -r1.459 src/usr.bin/make/parse.c
cvs rdiff -u -r1.314 -r1.315 src/usr.bin/make/suff.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.224 src/usr.bin/make/dir.c:1.225
--- src/usr.bin/make/dir.c:1.224	Sat Nov 28 22:13:56 2020
+++ src/usr.bin/make/dir.c	Sat Nov 28 22:56:01 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: dir.c,v 1.224 2020/11/28 22:13:56 rillig Exp $	*/
+/*	$NetBSD: dir.c,v 1.225 2020/11/28 22:56:01 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -136,7 +136,7 @@
 #include "job.h"
 
 /*	"@(#)dir.c	8.2 (Berkeley) 1/2/94"	*/
-MAKE_RCSID("$NetBSD: dir.c,v 1.224 2020/11/28 22:13:56 rillig Exp $");
+MAKE_RCSID("$NetBSD: dir.c,v 1.225 2020/11/28 22:56:01 rillig Exp $");
 
 #define DIR_DEBUG0(text) DEBUG0(DIR, text)
 #define DIR_DEBUG1(fmt, arg1) DEBUG1(DIR, fmt, arg1)
@@ -229,6 +229,8 @@ OpenDirs_Init(OpenDirs *odirs)
 	HashTable_Init(>table);
 }
 
+static void Dir_Destroy(void *);
+
 #ifdef CLEANUP
 static void
 OpenDirs_Done(OpenDirs *odirs)
@@ -366,7 +368,7 @@ cached_lstat(const char *pathname, struc
 void
 Dir_Init(void)
 {
-	dirSearchPath = Lst_New();
+	dirSearchPath = SearchPath_New();
 	OpenDirs_Init();
 	HashTable_Init();
 	HashTable_Init();
@@ -854,10 +856,12 @@ Dir_Expand(const char *word, SearchPath 
 			if (*end == '/')
 *end = '\0';
 
-			partPath = Lst_New();
+			partPath = SearchPath_New();
 			(void)Dir_AddDir(partPath, dirpath);
 			DirExpandPath(cp + 1, partPath, expansions);
 			Lst_Free(partPath);
+			/* XXX: Should the dirs in partPath be freed here?
+			 * It's not obvious whether to free them or not. */
 		}
 	}
 
@@ -1475,7 +1479,7 @@ Dir_AddDir(SearchPath *path, const char 
 SearchPath *
 Dir_CopyDirSearchPath(void)
 {
-	SearchPath *path = Lst_New();
+	SearchPath *path = SearchPath_New();
 	SearchPathNode *ln;
 	for (ln = dirSearchPath->first; ln != NULL; ln = ln->next) {
 		CachedDir *dir = ln->datum;
@@ -1532,7 +1536,7 @@ SearchPath_ToFlags(const char *flag, Sea
  * Input:
  *	dirp		The directory descriptor to nuke
  */
-void
+static void
 Dir_Destroy(void *dirp)
 {
 	CachedDir *dir = dirp;
@@ -1547,6 +1551,19 @@ Dir_Destroy(void *dirp)
 	}
 }
 
+/* Free the search path and all directories mentioned in it. */
+void
+SearchPath_Free(SearchPath *path)
+{
+	SearchPathNode *ln;
+
+	for (ln = path->first; ln != NULL; ln = ln->next) {
+		CachedDir *dir = ln->datum;
+		Dir_Destroy(dir);
+	}
+	Lst_Free(path);
+}
+
 /* Clear out all elements from the given search path.
  * The path is set to the empty list but is not destroyed. */
 void

Index: src/usr.bin/make/dir.h
diff -u src/usr.bin/make/dir.h:1.36 src/usr.bin/make/dir.h:1.37
--- src/usr.bin/make/dir.h:1.36	Sat Nov 28 22:13:56 2020
+++ src/usr.bin/make/dir.h	Sat Nov 28 22:56:01 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: dir.h,v 1.36 2020/11/28 22:13:56 rillig Exp $	*/
+/*	$NetBSD: dir.h,v 1.37 2020/11/28 22:56:01 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -85,6 +85,7 @@ typedef struct CachedDir {
  * Not sure what happens when .CURDIR is
  * assigned a new value; see Parse_DoVar. */
 int refCount;		/* Number of SearchPaths with this directory */
+/* TODO: Log the reference counting; see Dir_Expand, partPath. */
 int hits;			/* The number of times a file in this
  * directory has been found */
 HashSet files;		/* The files in the directory. */
@@ -107,7 +108,6 @@ void SearchPath_Clear(SearchPath *);
 void SearchPath_AddAll(SearchPath *, SearchPath *);
 void Dir_PrintDirectories(void);
 void SearchPath_Print(SearchPath *);
-void Dir_Destroy(void *);
 SearchPath *Dir_CopyDirSearchPath(void);
 
 /* Stripped-down variant of struct stat. */

Index: src/usr.bin/make/nonints.h
diff -u src/usr.bin/make/nonints.h:1.162 src/usr.bin/make/nonints.h:1.163
--- src/usr.bin/make/nonints.h:1.162	Mon Nov 16 21:48:18 2020
+++ src/usr.bin/make/nonints.h	Sat Nov 28 22:56:01 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: nonints.h,v 1.162 2020/11/16 21:48:18 rillig Exp $	*/
+/*	$NetBSD: nonints.h,v 1.163 2020/11/28 22:56:01 rillig Exp $	*/
 
 /*-
  * Copyright 

CVS commit: src/usr.bin/make

2020-11-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Nov 28 22:56:01 UTC 2020

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

Log Message:
make(1): replace Dir_Destroy with SearchPath_Free

The function Dir_Destroy is an implementation detail of the cached
directories, and it should not be exported to the other modules.  The
search paths, on the other hand, are the high-level API that may be used
by the other modules, as the concept of search paths is documented in
the manual page.


To generate a diff of this commit:
cvs rdiff -u -r1.224 -r1.225 src/usr.bin/make/dir.c
cvs rdiff -u -r1.36 -r1.37 src/usr.bin/make/dir.h
cvs rdiff -u -r1.162 -r1.163 src/usr.bin/make/nonints.h
cvs rdiff -u -r1.458 -r1.459 src/usr.bin/make/parse.c
cvs rdiff -u -r1.314 -r1.315 src/usr.bin/make/suff.c

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



CVS commit: src/external/cddl/osnet/dist/uts/common/fs/zfs

2020-11-28 Thread Yorick Hardy
Module Name:src
Committed By:   yhardy
Date:   Sat Nov 28 22:53:06 UTC 2020

Modified Files:
src/external/cddl/osnet/dist/uts/common/fs/zfs: vdev_disk.c

Log Message:
Use vn_close to release the vnodes in the error handling blocks, since
the vnodes were opened for writing. Fix proposed on current-users
and improved by hannken@.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 \
src/external/cddl/osnet/dist/uts/common/fs/zfs/vdev_disk.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/cddl/osnet/dist/uts/common/fs/zfs/vdev_disk.c
diff -u src/external/cddl/osnet/dist/uts/common/fs/zfs/vdev_disk.c:1.18 src/external/cddl/osnet/dist/uts/common/fs/zfs/vdev_disk.c:1.19
--- src/external/cddl/osnet/dist/uts/common/fs/zfs/vdev_disk.c:1.18	Thu Jun 25 09:39:15 2020
+++ src/external/cddl/osnet/dist/uts/common/fs/zfs/vdev_disk.c	Sat Nov 28 22:53:06 2020
@@ -215,7 +215,11 @@ vdev_disk_open(vdev_t *vd, uint64_t *psi
 		return (SET_ERROR(error));
 	}
 	if (vp->v_type != VBLK) {
+#ifdef __NetBSD__
+		vn_close(vp, FREAD|FWRITE, kcred);
+#else
 		vrele(vp);
+#endif
 		vd->vdev_stat.vs_aux = VDEV_AUX_OPEN_FAILED;
 		return (SET_ERROR(EINVAL));
 	}
@@ -247,7 +251,11 @@ vdev_disk_open(vdev_t *vd, uint64_t *psi
 	error = workqueue_create(>vd_wq, "vdevsync",
 	vdev_disk_flush, dvd, PRI_NONE, IPL_NONE, WQ_MPSAFE);
 	if (error != 0) {
+#ifdef __NetBSD__
+		vn_close(vp, FREAD|FWRITE, kcred);
+#else
 		vrele(vp);
+#endif
 		return (SET_ERROR(error));
 	}
 



CVS commit: src/external/cddl/osnet/dist/uts/common/fs/zfs

2020-11-28 Thread Yorick Hardy
Module Name:src
Committed By:   yhardy
Date:   Sat Nov 28 22:53:06 UTC 2020

Modified Files:
src/external/cddl/osnet/dist/uts/common/fs/zfs: vdev_disk.c

Log Message:
Use vn_close to release the vnodes in the error handling blocks, since
the vnodes were opened for writing. Fix proposed on current-users
and improved by hannken@.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 \
src/external/cddl/osnet/dist/uts/common/fs/zfs/vdev_disk.c

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



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

2020-11-28 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Nov 28 22:16:23 UTC 2020

Modified Files:
src/sys/arch/evbarm/fdt: fdt_machdep.c

Log Message:
evbarm: Bump efirng entropy estimate.

I'm not really happy with this, but my lack of confidence in the
remaining question marks about this (no real documentation about the
underlying physical processes, and a slightly self-inconsistent uefi
spec) is outweighed by the value of not distracting people with
entropy warnings on systems that are almost certainly fine.


To generate a diff of this commit:
cvs rdiff -u -r1.81 -r1.82 src/sys/arch/evbarm/fdt/fdt_machdep.c

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

Modified files:

Index: src/sys/arch/evbarm/fdt/fdt_machdep.c
diff -u src/sys/arch/evbarm/fdt/fdt_machdep.c:1.81 src/sys/arch/evbarm/fdt/fdt_machdep.c:1.82
--- src/sys/arch/evbarm/fdt/fdt_machdep.c:1.81	Thu Nov 26 08:37:54 2020
+++ src/sys/arch/evbarm/fdt/fdt_machdep.c	Sat Nov 28 22:16:23 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: fdt_machdep.c,v 1.81 2020/11/26 08:37:54 skrll Exp $ */
+/* $NetBSD: fdt_machdep.c,v 1.82 2020/11/28 22:16:23 riastradh Exp $ */
 
 /*-
  * Copyright (c) 2015-2017 Jared McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: fdt_machdep.c,v 1.81 2020/11/26 08:37:54 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fdt_machdep.c,v 1.82 2020/11/28 22:16:23 riastradh Exp $");
 
 #include "opt_machdep.h"
 #include "opt_bootconfig.h"
@@ -492,7 +492,43 @@ fdt_setup_efirng(void)
 
 	rnd_attach_source(_source, "efirng", RND_TYPE_RNG,
 	RND_FLAG_DEFAULT);
-	rnd_add_data(_source, efirng, efirng_size, 0);
+
+	/*
+	 * We don't really have specific information about the physical
+	 * process underlying the data provided by the firmware via the
+	 * EFI RNG API, so the entropy estimate here is heuristic.
+	 * What efiboot provides us is up to 4096 bytes of data from
+	 * the EFI RNG API, although in principle it may return short.
+	 *
+	 * The UEFI Specification (2.8 Errata A, February 2020[1]) says
+	 *
+	 *	When a Deterministic Random Bit Generator (DRBG) is
+	 *	used on the output of a (raw) entropy source, its
+	 *	security level must be at least 256 bits.
+	 *
+	 * It's not entirely clear whether `it' refers to the DRBG or
+	 * the entropy source; if it refers to the DRBG, it's not
+	 * entirely clear how ANSI X9.31 3DES, one of the options for
+	 * DRBG in the UEFI spec, can provide a `256-bit security
+	 * level' because it has only 232 bits of inputs (three 56-bit
+	 * keys and one 64-bit block).  That said, even if it provides
+	 * only 232 bits of entropy, that's enough to prevent all
+	 * attacks and we probably get a few more bits from sampling
+	 * the clock anyway.
+	 *
+	 * In the event we get raw samples, e.g. the bits sampled by a
+	 * ring oscillator, we hope that the samples have at least half
+	 * a bit of entropy per bit of data -- and efiboot tries to
+	 * draw 4096 bytes to provide plenty of slop.  Hence we divide
+	 * the total number of bits by two and clamp at 256.  There are
+	 * ways this could go wrong, but on most machines it should
+	 * behave reasonably.
+	 *
+	 * [1] https://uefi.org/sites/default/files/resources/UEFI_Spec_2_8_A_Feb14.pdf
+	 */
+	rnd_add_data(_source, efirng, efirng_size,
+	MIN(256, efirng_size*NBBY/2));
+
 	explicit_memset(efirng, 0, efirng_size);
 	fdt_unmap_range(efirng, efirng_size);
 }



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

2020-11-28 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Nov 28 22:16:23 UTC 2020

Modified Files:
src/sys/arch/evbarm/fdt: fdt_machdep.c

Log Message:
evbarm: Bump efirng entropy estimate.

I'm not really happy with this, but my lack of confidence in the
remaining question marks about this (no real documentation about the
underlying physical processes, and a slightly self-inconsistent uefi
spec) is outweighed by the value of not distracting people with
entropy warnings on systems that are almost certainly fine.


To generate a diff of this commit:
cvs rdiff -u -r1.81 -r1.82 src/sys/arch/evbarm/fdt/fdt_machdep.c

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



CVS commit: src/usr.bin/make

2020-11-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Nov 28 22:13:56 UTC 2020

Modified Files:
src/usr.bin/make: dir.c dir.h parse.c suff.c

Log Message:
make(1): rename some Dir functions to SearchPath

These functions have the search path as their main subject.


To generate a diff of this commit:
cvs rdiff -u -r1.223 -r1.224 src/usr.bin/make/dir.c
cvs rdiff -u -r1.35 -r1.36 src/usr.bin/make/dir.h
cvs rdiff -u -r1.457 -r1.458 src/usr.bin/make/parse.c
cvs rdiff -u -r1.313 -r1.314 src/usr.bin/make/suff.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.223 src/usr.bin/make/dir.c:1.224
--- src/usr.bin/make/dir.c:1.223	Sat Nov 28 19:22:32 2020
+++ src/usr.bin/make/dir.c	Sat Nov 28 22:13:56 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: dir.c,v 1.223 2020/11/28 19:22:32 rillig Exp $	*/
+/*	$NetBSD: dir.c,v 1.224 2020/11/28 22:13:56 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -106,7 +106,8 @@
  *
  *	Dir_AddDir	Add a directory to a search path.
  *
- *	Dir_MakeFlags	Given a search path and a command flag, create
+ *	SearchPath_ToFlags
+ *			Given a search path and a command flag, create
  *			a string with each of the directories in the path
  *			preceded by the command flag and all of them
  *			separated by a space.
@@ -116,7 +117,8 @@
  *			as the element is no longer referenced by any other
  *			search path.
  *
- *	Dir_ClearPath	Resets a search path to the empty list.
+ *	SearchPath_Clear
+ *			Resets a search path to the empty list.
  *
  * For debugging:
  *	Dir_PrintDirectories
@@ -134,7 +136,7 @@
 #include "job.h"
 
 /*	"@(#)dir.c	8.2 (Berkeley) 1/2/94"	*/
-MAKE_RCSID("$NetBSD: dir.c,v 1.223 2020/11/28 19:22:32 rillig Exp $");
+MAKE_RCSID("$NetBSD: dir.c,v 1.224 2020/11/28 22:13:56 rillig Exp $");
 
 #define DIR_DEBUG0(text) DEBUG0(DIR, text)
 #define DIR_DEBUG1(fmt, arg1) DEBUG1(DIR, fmt, arg1)
@@ -455,7 +457,7 @@ Dir_End(void)
 	dotLast->refCount--;
 	Dir_Destroy(dotLast);
 	Dir_Destroy(dot);
-	Dir_ClearPath(dirSearchPath);
+	SearchPath_Clear(dirSearchPath);
 	Lst_Free(dirSearchPath);
 	OpenDirs_Done();
 	HashTable_Done();
@@ -1485,7 +1487,7 @@ Dir_CopyDirSearchPath(void)
 
 /*-
  *---
- * Dir_MakeFlags --
+ * SearchPath_ToFlags --
  *	Make a string by taking all the directories in the given search
  *	path and preceding them by the given flag. Used by the suffix
  *	module to create variables for compilers based on suffix search
@@ -1505,7 +1507,7 @@ Dir_CopyDirSearchPath(void)
  *---
  */
 char *
-Dir_MakeFlags(const char *flag, SearchPath *path)
+SearchPath_ToFlags(const char *flag, SearchPath *path)
 {
 	Buffer buf;
 	SearchPathNode *ln;
@@ -1548,7 +1550,7 @@ Dir_Destroy(void *dirp)
 /* Clear out all elements from the given search path.
  * The path is set to the empty list but is not destroyed. */
 void
-Dir_ClearPath(SearchPath *path)
+SearchPath_Clear(SearchPath *path)
 {
 	while (!Lst_IsEmpty(path)) {
 		CachedDir *dir = Lst_Dequeue(path);
@@ -1560,7 +1562,7 @@ Dir_ClearPath(SearchPath *path)
 /* Concatenate two paths, adding the second to the end of the first,
  * skipping duplicates. */
 void
-Dir_Concat(SearchPath *dst, SearchPath *src)
+SearchPath_AddAll(SearchPath *dst, SearchPath *src)
 {
 	SearchPathNode *ln;
 
@@ -1600,7 +1602,7 @@ Dir_PrintDirectories(void)
 }
 
 void
-Dir_PrintPath(SearchPath *path)
+SearchPath_Print(SearchPath *path)
 {
 	SearchPathNode *node;
 	for (node = path->first; node != NULL; node = node->next) {

Index: src/usr.bin/make/dir.h
diff -u src/usr.bin/make/dir.h:1.35 src/usr.bin/make/dir.h:1.36
--- src/usr.bin/make/dir.h:1.35	Mon Nov 23 18:24:05 2020
+++ src/usr.bin/make/dir.h	Sat Nov 28 22:13:56 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: dir.h,v 1.35 2020/11/23 18:24:05 rillig Exp $	*/
+/*	$NetBSD: dir.h,v 1.36 2020/11/28 22:13:56 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -102,11 +102,11 @@ char *Dir_FindFile(const char *, SearchP
 char *Dir_FindHereOrAbove(const char *, const char *);
 void Dir_UpdateMTime(GNode *, Boolean);
 CachedDir *Dir_AddDir(SearchPath *, const char *);
-char *Dir_MakeFlags(const char *, SearchPath *);
-void Dir_ClearPath(SearchPath *);
-void Dir_Concat(SearchPath *, SearchPath *);
+char *SearchPath_ToFlags(const char *, SearchPath *);
+void SearchPath_Clear(SearchPath *);
+void SearchPath_AddAll(SearchPath *, SearchPath *);
 void Dir_PrintDirectories(void);
-void Dir_PrintPath(SearchPath *);
+void SearchPath_Print(SearchPath *);
 void Dir_Destroy(void *);
 SearchPath *Dir_CopyDirSearchPath(void);
 

Index: src/usr.bin/make/parse.c
diff -u src/usr.bin/make/parse.c:1.457 src/usr.bin/make/parse.c:1.458
--- src/usr.bin/make/parse.c:1.457	Sat 

CVS commit: src/usr.bin/make

2020-11-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Nov 28 22:13:56 UTC 2020

Modified Files:
src/usr.bin/make: dir.c dir.h parse.c suff.c

Log Message:
make(1): rename some Dir functions to SearchPath

These functions have the search path as their main subject.


To generate a diff of this commit:
cvs rdiff -u -r1.223 -r1.224 src/usr.bin/make/dir.c
cvs rdiff -u -r1.35 -r1.36 src/usr.bin/make/dir.h
cvs rdiff -u -r1.457 -r1.458 src/usr.bin/make/parse.c
cvs rdiff -u -r1.313 -r1.314 src/usr.bin/make/suff.c

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



CVS commit: src/usr.bin/make

2020-11-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Nov 28 19:26:10 UTC 2020

Modified Files:
src/usr.bin/make: arch.c lst.c lst.h

Log Message:
make(1): reduce pointer indirection for archives


To generate a diff of this commit:
cvs rdiff -u -r1.179 -r1.180 src/usr.bin/make/arch.c
cvs rdiff -u -r1.95 -r1.96 src/usr.bin/make/lst.c
cvs rdiff -u -r1.88 -r1.89 src/usr.bin/make/lst.h

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

Modified files:

Index: src/usr.bin/make/arch.c
diff -u src/usr.bin/make/arch.c:1.179 src/usr.bin/make/arch.c:1.180
--- src/usr.bin/make/arch.c:1.179	Sat Nov 28 19:12:28 2020
+++ src/usr.bin/make/arch.c	Sat Nov 28 19:26:10 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: arch.c,v 1.179 2020/11/28 19:12:28 rillig Exp $	*/
+/*	$NetBSD: arch.c,v 1.180 2020/11/28 19:26:10 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -125,12 +125,12 @@
 #include "config.h"
 
 /*	"@(#)arch.c	8.2 (Berkeley) 1/2/94"	*/
-MAKE_RCSID("$NetBSD: arch.c,v 1.179 2020/11/28 19:12:28 rillig Exp $");
+MAKE_RCSID("$NetBSD: arch.c,v 1.180 2020/11/28 19:26:10 rillig Exp $");
 
 typedef struct List ArchList;
 typedef struct ListNode ArchListNode;
 
-static ArchList *archives;	/* The archives we've already examined */
+static ArchList archives;	/* The archives we've already examined */
 
 typedef struct Arch {
 	char *name;		/* Name of archive */
@@ -426,7 +426,7 @@ ArchStatMember(const char *archive, cons
 	if (lastSlash != NULL)
 		member = lastSlash + 1;
 
-	for (ln = archives->first; ln != NULL; ln = ln->next) {
+	for (ln = archives.first; ln != NULL; ln = ln->next) {
 		const Arch *a = ln->datum;
 		if (strcmp(a->name, archive) == 0)
 			break;
@@ -579,7 +579,7 @@ ArchStatMember(const char *archive, cons
 
 	fclose(arch);
 
-	Lst_Append(archives, ar);
+	Lst_Append(, ar);
 
 	/*
 	 * Now that the archive has been read and cached, we can look into
@@ -1063,7 +1063,7 @@ Arch_LibOODate(GNode *gn)
 void
 Arch_Init(void)
 {
-	archives = Lst_New();
+	Lst_Init();
 }
 
 /* Clean up the archives module. */
@@ -1071,7 +1071,7 @@ void
 Arch_End(void)
 {
 #ifdef CLEANUP
-	Lst_Destroy(archives, ArchFree);
+	Lst_DoneCall(, ArchFree);
 #endif
 }
 

Index: src/usr.bin/make/lst.c
diff -u src/usr.bin/make/lst.c:1.95 src/usr.bin/make/lst.c:1.96
--- src/usr.bin/make/lst.c:1.95	Sat Nov 28 18:55:52 2020
+++ src/usr.bin/make/lst.c	Sat Nov 28 19:26:10 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: lst.c,v 1.95 2020/11/28 18:55:52 rillig Exp $ */
+/* $NetBSD: lst.c,v 1.96 2020/11/28 19:26:10 rillig Exp $ */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -34,7 +34,7 @@
 
 #include "make.h"
 
-MAKE_RCSID("$NetBSD: lst.c,v 1.95 2020/11/28 18:55:52 rillig Exp $");
+MAKE_RCSID("$NetBSD: lst.c,v 1.96 2020/11/28 19:26:10 rillig Exp $");
 
 static ListNode *
 LstNodeNew(ListNode *prev, ListNode *next, void *datum)
@@ -68,6 +68,18 @@ Lst_Done(List *list)
 	}
 }
 
+void
+Lst_DoneCall(List *list, LstFreeProc freeProc)
+{
+	ListNode *ln, *next;
+
+	for (ln = list->first; ln != NULL; ln = next) {
+		next = ln->next;
+		freeProc(ln->datum);
+		free(ln);
+	}
+}
+
 /* Free a list and all its nodes. The node data are not freed though. */
 void
 Lst_Free(List *list)
@@ -82,14 +94,7 @@ Lst_Free(List *list)
 void
 Lst_Destroy(List *list, LstFreeProc freeProc)
 {
-	ListNode *ln, *next;
-
-	for (ln = list->first; ln != NULL; ln = next) {
-		next = ln->next;
-		freeProc(ln->datum);
-		free(ln);
-	}
-
+	Lst_DoneCall(list, freeProc);
 	free(list);
 }
 

Index: src/usr.bin/make/lst.h
diff -u src/usr.bin/make/lst.h:1.88 src/usr.bin/make/lst.h:1.89
--- src/usr.bin/make/lst.h:1.88	Sat Nov 28 18:55:52 2020
+++ src/usr.bin/make/lst.h	Sat Nov 28 19:26:10 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: lst.h,v 1.88 2020/11/28 18:55:52 rillig Exp $	*/
+/*	$NetBSD: lst.h,v 1.89 2020/11/28 19:26:10 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -111,6 +111,8 @@ typedef void LstFreeProc(void *);
 List *Lst_New(void);
 /* Free the list nodes, but not the list itself. */
 void Lst_Done(List *);
+/* Free the list nodes, freeing the node data using the given function. */
+void Lst_DoneCall(List *, LstFreeProc);
 /* Free the list, leaving the node data unmodified. */
 void Lst_Free(List *);
 /* Free the list, freeing the node data using the given function. */



CVS commit: src/usr.bin/make

2020-11-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Nov 28 19:26:10 UTC 2020

Modified Files:
src/usr.bin/make: arch.c lst.c lst.h

Log Message:
make(1): reduce pointer indirection for archives


To generate a diff of this commit:
cvs rdiff -u -r1.179 -r1.180 src/usr.bin/make/arch.c
cvs rdiff -u -r1.95 -r1.96 src/usr.bin/make/lst.c
cvs rdiff -u -r1.88 -r1.89 src/usr.bin/make/lst.h

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



CVS commit: src/usr.bin/make

2020-11-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Nov 28 19:22:32 UTC 2020

Modified Files:
src/usr.bin/make: compat.c dir.c make.c make.h suff.c targ.c

Log Message:
make(1): reduce pointer indirection for GNode.implicitParents


To generate a diff of this commit:
cvs rdiff -u -r1.195 -r1.196 src/usr.bin/make/compat.c
cvs rdiff -u -r1.222 -r1.223 src/usr.bin/make/dir.c src/usr.bin/make/make.c
cvs rdiff -u -r1.224 -r1.225 src/usr.bin/make/make.h
cvs rdiff -u -r1.312 -r1.313 src/usr.bin/make/suff.c
cvs rdiff -u -r1.145 -r1.146 src/usr.bin/make/targ.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/compat.c
diff -u src/usr.bin/make/compat.c:1.195 src/usr.bin/make/compat.c:1.196
--- src/usr.bin/make/compat.c:1.195	Sat Nov 28 19:20:03 2020
+++ src/usr.bin/make/compat.c	Sat Nov 28 19:22:32 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: compat.c,v 1.195 2020/11/28 19:20:03 rillig Exp $	*/
+/*	$NetBSD: compat.c,v 1.196 2020/11/28 19:22:32 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.195 2020/11/28 19:20:03 rillig Exp $");
+MAKE_RCSID("$NetBSD: compat.c,v 1.196 2020/11/28 19:22:32 rillig Exp $");
 
 static GNode *curTarg = NULL;
 static pid_t compatChild;
@@ -495,7 +495,7 @@ MakeUnmade(GNode *const gn, GNode *const
 		return FALSE;
 	}
 
-	if (Lst_FindDatum(gn->implicitParents, pgn) != NULL)
+	if (Lst_FindDatum(>implicitParents, pgn) != NULL)
 		Var_Set(IMPSRC, GNode_VarTarget(gn), pgn);
 
 	/*
@@ -587,7 +587,7 @@ static void
 MakeOther(GNode *gn, GNode *pgn)
 {
 
-	if (Lst_FindDatum(gn->implicitParents, pgn) != NULL) {
+	if (Lst_FindDatum(>implicitParents, pgn) != NULL) {
 		const char *target = GNode_VarTarget(gn);
 		Var_Set(IMPSRC, target != NULL ? target : "", pgn);
 	}

Index: src/usr.bin/make/dir.c
diff -u src/usr.bin/make/dir.c:1.222 src/usr.bin/make/dir.c:1.223
--- src/usr.bin/make/dir.c:1.222	Mon Nov 23 23:41:11 2020
+++ src/usr.bin/make/dir.c	Sat Nov 28 19:22:32 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: dir.c,v 1.222 2020/11/23 23:41:11 rillig Exp $	*/
+/*	$NetBSD: dir.c,v 1.223 2020/11/28 19:22:32 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.222 2020/11/23 23:41:11 rillig Exp $");
+MAKE_RCSID("$NetBSD: dir.c,v 1.223 2020/11/28 19:22:32 rillig Exp $");
 
 #define DIR_DEBUG0(text) DEBUG0(DIR, text)
 #define DIR_DEBUG1(fmt, arg1) DEBUG1(DIR, fmt, arg1)
@@ -1337,7 +1337,7 @@ ResolveFullName(GNode *gn)
 		fullName = Dir_FindFile(gn->name, Suff_FindPath(gn));
 
 		if (fullName == NULL && gn->flags & FROM_DEPEND &&
-		!Lst_IsEmpty(gn->implicitParents))
+		!Lst_IsEmpty(>implicitParents))
 			fullName = ResolveMovedDepends(gn);
 
 		DIR_DEBUG2("Found '%s' as '%s'\n",
Index: src/usr.bin/make/make.c
diff -u src/usr.bin/make/make.c:1.222 src/usr.bin/make/make.c:1.223
--- src/usr.bin/make/make.c:1.222	Sat Nov 28 19:20:03 2020
+++ src/usr.bin/make/make.c	Sat Nov 28 19:22:32 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: make.c,v 1.222 2020/11/28 19:20:03 rillig Exp $	*/
+/*	$NetBSD: make.c,v 1.223 2020/11/28 19:22:32 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -102,7 +102,7 @@
 #include "job.h"
 
 /*	"@(#)make.c	8.1 (Berkeley) 6/6/93"	*/
-MAKE_RCSID("$NetBSD: make.c,v 1.222 2020/11/28 19:20:03 rillig Exp $");
+MAKE_RCSID("$NetBSD: make.c,v 1.223 2020/11/28 19:22:32 rillig Exp $");
 
 /* Sequence # to detect recursion. */
 static unsigned int checked_seqno = 1;
@@ -550,7 +550,7 @@ UpdateImplicitParentsVars(GNode *cgn, co
 	GNodeListNode *ln;
 	const char *cpref = GNode_VarPrefix(cgn);
 
-	for (ln = cgn->implicitParents->first; ln != NULL; ln = ln->next) {
+	for (ln = cgn->implicitParents.first; ln != NULL; ln = ln->next) {
 		GNode *pgn = ln->datum;
 		if (pgn->flags & REMAKE) {
 			Var_Set(IMPSRC, cname, pgn);

Index: src/usr.bin/make/make.h
diff -u src/usr.bin/make/make.h:1.224 src/usr.bin/make/make.h:1.225
--- src/usr.bin/make/make.h:1.224	Sat Nov 28 19:20:03 2020
+++ src/usr.bin/make/make.h	Sat Nov 28 19:22:32 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: make.h,v 1.224 2020/11/28 19:20:03 rillig Exp $	*/
+/*	$NetBSD: make.h,v 1.225 2020/11/28 19:22:32 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -383,7 +383,7 @@ typedef struct GNode {
 	/* The GNodes for which this node is an implied source. May be empty.
 	 * For example, when there is an inference rule for .c.o, the node for
 	 * file.c has the node for file.o in this list. */
-	GNodeList *implicitParents;
+	GNodeList implicitParents;
 
 	/* The nodes that depend on this one, or in other words, the nodes for
 	 * which this is a source. */

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

CVS commit: src/usr.bin/make

2020-11-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Nov 28 19:22:32 UTC 2020

Modified Files:
src/usr.bin/make: compat.c dir.c make.c make.h suff.c targ.c

Log Message:
make(1): reduce pointer indirection for GNode.implicitParents


To generate a diff of this commit:
cvs rdiff -u -r1.195 -r1.196 src/usr.bin/make/compat.c
cvs rdiff -u -r1.222 -r1.223 src/usr.bin/make/dir.c src/usr.bin/make/make.c
cvs rdiff -u -r1.224 -r1.225 src/usr.bin/make/make.h
cvs rdiff -u -r1.312 -r1.313 src/usr.bin/make/suff.c
cvs rdiff -u -r1.145 -r1.146 src/usr.bin/make/targ.c

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



CVS commit: src/usr.bin/make

2020-11-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Nov 28 19:20:04 UTC 2020

Modified Files:
src/usr.bin/make: compat.c make.c make.h parse.c suff.c targ.c

Log Message:
make(1): reduce pointer indirection for GNode.cohorts


To generate a diff of this commit:
cvs rdiff -u -r1.194 -r1.195 src/usr.bin/make/compat.c
cvs rdiff -u -r1.221 -r1.222 src/usr.bin/make/make.c
cvs rdiff -u -r1.223 -r1.224 src/usr.bin/make/make.h
cvs rdiff -u -r1.456 -r1.457 src/usr.bin/make/parse.c
cvs rdiff -u -r1.311 -r1.312 src/usr.bin/make/suff.c
cvs rdiff -u -r1.144 -r1.145 src/usr.bin/make/targ.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/compat.c
diff -u src/usr.bin/make/compat.c:1.194 src/usr.bin/make/compat.c:1.195
--- src/usr.bin/make/compat.c:1.194	Sat Nov 28 19:12:28 2020
+++ src/usr.bin/make/compat.c	Sat Nov 28 19:20:03 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: compat.c,v 1.194 2020/11/28 19:12:28 rillig Exp $	*/
+/*	$NetBSD: compat.c,v 1.195 2020/11/28 19:20:03 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.194 2020/11/28 19:12:28 rillig Exp $");
+MAKE_RCSID("$NetBSD: compat.c,v 1.195 2020/11/28 19:20:03 rillig Exp $");
 
 static GNode *curTarg = NULL;
 static pid_t compatChild;
@@ -652,7 +652,7 @@ Compat_Make(GNode *gn, GNode *pgn)
 	}
 
 cohorts:
-	MakeNodes(gn->cohorts, pgn);
+	MakeNodes(>cohorts, pgn);
 }
 
 /* Initialize this module and start making.

Index: src/usr.bin/make/make.c
diff -u src/usr.bin/make/make.c:1.221 src/usr.bin/make/make.c:1.222
--- src/usr.bin/make/make.c:1.221	Sat Nov 28 19:16:53 2020
+++ src/usr.bin/make/make.c	Sat Nov 28 19:20:03 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: make.c,v 1.221 2020/11/28 19:16:53 rillig Exp $	*/
+/*	$NetBSD: make.c,v 1.222 2020/11/28 19:20:03 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -102,7 +102,7 @@
 #include "job.h"
 
 /*	"@(#)make.c	8.1 (Berkeley) 6/6/93"	*/
-MAKE_RCSID("$NetBSD: make.c,v 1.221 2020/11/28 19:16:53 rillig Exp $");
+MAKE_RCSID("$NetBSD: make.c,v 1.222 2020/11/28 19:20:03 rillig Exp $");
 
 /* Sequence # to detect recursion. */
 static unsigned int checked_seqno = 1;
@@ -890,7 +890,7 @@ MakeBuildChild(GNode *cn, GNodeListNode 
 	if (cn->unmade_cohorts != 0) {
 		ListNode *ln;
 
-		for (ln = cn->cohorts->first; ln != NULL; ln = ln->next)
+		for (ln = cn->cohorts.first; ln != NULL; ln = ln->next)
 			if (MakeBuildChild(ln->datum, toBeMadeNext) != 0)
 break;
 	}
@@ -1163,7 +1163,7 @@ Make_ExpandUse(GNodeList *targs)
 	   gn->name, gn->cohort_num);
 
 	if (gn->type & OP_DOUBLEDEP)
-	Lst_PrependAll(examine, gn->cohorts);
+	Lst_PrependAll(examine, >cohorts);
 
 	/*
 	 * Apply any .USE rules before looking for implicit dependencies
@@ -1272,7 +1272,7 @@ Make_ProcessWait(GNodeList *targs)
 	DEBUG1(MAKE, "Make_ProcessWait: examine %s\n", pgn->name);
 
 	if (pgn->type & OP_DOUBLEDEP)
-	Lst_PrependAll(examine, pgn->cohorts);
+	Lst_PrependAll(examine, >cohorts);
 
 	owln = pgn->children.first;
 	for (ln = pgn->children.first; ln != NULL; ln = ln->next) {

Index: src/usr.bin/make/make.h
diff -u src/usr.bin/make/make.h:1.223 src/usr.bin/make/make.h:1.224
--- src/usr.bin/make/make.h:1.223	Sat Nov 28 19:16:53 2020
+++ src/usr.bin/make/make.h	Sat Nov 28 19:20:03 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: make.h,v 1.223 2020/11/28 19:16:53 rillig Exp $	*/
+/*	$NetBSD: make.h,v 1.224 2020/11/28 19:20:03 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -401,7 +401,7 @@ typedef struct GNode {
 	GNodeList order_succ;
 
 	/* Other nodes of the same name, for the '::' dependency operator. */
-	GNodeList *cohorts;
+	GNodeList cohorts;
 	/* The "#n" suffix for this cohort, or "" for other nodes */
 	char cohort_num[8];
 	/* The number of unmade instances on the cohorts list */

Index: src/usr.bin/make/parse.c
diff -u src/usr.bin/make/parse.c:1.456 src/usr.bin/make/parse.c:1.457
--- src/usr.bin/make/parse.c:1.456	Sat Nov 28 19:16:53 2020
+++ src/usr.bin/make/parse.c	Sat Nov 28 19:20:03 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: parse.c,v 1.456 2020/11/28 19:16:53 rillig Exp $	*/
+/*	$NetBSD: parse.c,v 1.457 2020/11/28 19:20:03 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -117,7 +117,7 @@
 #include "pathnames.h"
 
 /*	"@(#)parse.c	8.3 (Berkeley) 3/19/94"	*/
-MAKE_RCSID("$NetBSD: parse.c,v 1.456 2020/11/28 19:16:53 rillig Exp $");
+MAKE_RCSID("$NetBSD: parse.c,v 1.457 2020/11/28 19:20:03 rillig Exp $");
 
 /* types and constants */
 
@@ -758,8 +758,8 @@ ParseMessage(const char *directive)
 static void
 LinkSource(GNode *pgn, GNode *cgn, Boolean isSpecial)
 {
-if ((pgn->type & OP_DOUBLEDEP) && !Lst_IsEmpty(pgn->cohorts))
-	pgn = pgn->cohorts->last->datum;
+if ((pgn->type & OP_DOUBLEDEP) && !Lst_IsEmpty(>cohorts))
+	

CVS commit: src/usr.bin/make

2020-11-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Nov 28 19:20:04 UTC 2020

Modified Files:
src/usr.bin/make: compat.c make.c make.h parse.c suff.c targ.c

Log Message:
make(1): reduce pointer indirection for GNode.cohorts


To generate a diff of this commit:
cvs rdiff -u -r1.194 -r1.195 src/usr.bin/make/compat.c
cvs rdiff -u -r1.221 -r1.222 src/usr.bin/make/make.c
cvs rdiff -u -r1.223 -r1.224 src/usr.bin/make/make.h
cvs rdiff -u -r1.456 -r1.457 src/usr.bin/make/parse.c
cvs rdiff -u -r1.311 -r1.312 src/usr.bin/make/suff.c
cvs rdiff -u -r1.144 -r1.145 src/usr.bin/make/targ.c

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



CVS commit: src/usr.bin/make

2020-11-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Nov 28 19:16:53 UTC 2020

Modified Files:
src/usr.bin/make: make.c make.h parse.c suff.c targ.c

Log Message:
make(1): reduce pointer indirection for GNode.order_pred and order_succ


To generate a diff of this commit:
cvs rdiff -u -r1.220 -r1.221 src/usr.bin/make/make.c
cvs rdiff -u -r1.222 -r1.223 src/usr.bin/make/make.h
cvs rdiff -u -r1.455 -r1.456 src/usr.bin/make/parse.c
cvs rdiff -u -r1.310 -r1.311 src/usr.bin/make/suff.c
cvs rdiff -u -r1.143 -r1.144 src/usr.bin/make/targ.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.c
diff -u src/usr.bin/make/make.c:1.220 src/usr.bin/make/make.c:1.221
--- src/usr.bin/make/make.c:1.220	Sat Nov 28 19:12:28 2020
+++ src/usr.bin/make/make.c	Sat Nov 28 19:16:53 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: make.c,v 1.220 2020/11/28 19:12:28 rillig Exp $	*/
+/*	$NetBSD: make.c,v 1.221 2020/11/28 19:16:53 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -102,7 +102,7 @@
 #include "job.h"
 
 /*	"@(#)make.c	8.1 (Berkeley) 6/6/93"	*/
-MAKE_RCSID("$NetBSD: make.c,v 1.220 2020/11/28 19:12:28 rillig Exp $");
+MAKE_RCSID("$NetBSD: make.c,v 1.221 2020/11/28 19:16:53 rillig Exp $");
 
 /* Sequence # to detect recursion. */
 static unsigned int checked_seqno = 1;
@@ -566,7 +566,7 @@ IsWaitingForOrder(GNode *gn)
 {
 	GNodeListNode *ln;
 
-	for (ln = gn->order_pred->first; ln != NULL; ln = ln->next) {
+	for (ln = gn->order_pred.first; ln != NULL; ln = ln->next) {
 		GNode *ogn = ln->datum;
 
 		if (GNode_IsDone(ogn) || !(ogn->flags & REMAKE))
@@ -588,7 +588,7 @@ ScheduleOrderSuccessors(GNode *gn)
 	GNodeListNode *toBeMadeNext = toBeMade->first;
 	GNodeListNode *ln;
 
-	for (ln = gn->order_succ->first; ln != NULL; ln = ln->next)
+	for (ln = gn->order_succ.first; ln != NULL; ln = ln->next)
 		if (MakeBuildParent(ln->datum, toBeMadeNext) != 0)
 			break;
 }
@@ -1026,7 +1026,7 @@ static void
 MakePrintStatusOrder(GNode *gn)
 {
 	GNodeListNode *ln;
-	for (ln = gn->order_pred->first; ln != NULL; ln = ln->next)
+	for (ln = gn->order_pred.first; ln != NULL; ln = ln->next)
 		MakePrintStatusOrderNode(ln->datum, gn);
 }
 

Index: src/usr.bin/make/make.h
diff -u src/usr.bin/make/make.h:1.222 src/usr.bin/make/make.h:1.223
--- src/usr.bin/make/make.h:1.222	Sat Nov 28 19:12:28 2020
+++ src/usr.bin/make/make.h	Sat Nov 28 19:16:53 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: make.h,v 1.222 2020/11/28 19:12:28 rillig Exp $	*/
+/*	$NetBSD: make.h,v 1.223 2020/11/28 19:16:53 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -394,11 +394,11 @@ typedef struct GNode {
 	/* .ORDER nodes we need made. The nodes that must be made (if they're
 	 * made) before this node can be made, but that do not enter into the
 	 * datedness of this node. */
-	GNodeList *order_pred;
+	GNodeList order_pred;
 	/* .ORDER nodes who need us. The nodes that must be made (if they're
 	 * made at all) after this node is made, but that do not depend on
 	 * this node, in the normal sense. */
-	GNodeList *order_succ;
+	GNodeList order_succ;
 
 	/* Other nodes of the same name, for the '::' dependency operator. */
 	GNodeList *cohorts;

Index: src/usr.bin/make/parse.c
diff -u src/usr.bin/make/parse.c:1.455 src/usr.bin/make/parse.c:1.456
--- src/usr.bin/make/parse.c:1.455	Sat Nov 28 19:12:28 2020
+++ src/usr.bin/make/parse.c	Sat Nov 28 19:16:53 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: parse.c,v 1.455 2020/11/28 19:12:28 rillig Exp $	*/
+/*	$NetBSD: parse.c,v 1.456 2020/11/28 19:16:53 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -117,7 +117,7 @@
 #include "pathnames.h"
 
 /*	"@(#)parse.c	8.3 (Berkeley) 3/19/94"	*/
-MAKE_RCSID("$NetBSD: parse.c,v 1.455 2020/11/28 19:12:28 rillig Exp $");
+MAKE_RCSID("$NetBSD: parse.c,v 1.456 2020/11/28 19:16:53 rillig Exp $");
 
 /* types and constants */
 
@@ -927,8 +927,8 @@ ParseDoSrcOrder(const char *src)
 if (doing_depend)
 	ParseMark(gn);
 if (order_pred != NULL) {
-	Lst_Append(order_pred->order_succ, gn);
-	Lst_Append(gn->order_pred, order_pred);
+	Lst_Append(_pred->order_succ, gn);
+	Lst_Append(>order_pred, order_pred);
 	if (DEBUG(PARSE)) {
 	debug_printf("# %s: added Order dependency %s - %s\n",
 			 __func__, order_pred->name, gn->name);

Index: src/usr.bin/make/suff.c
diff -u src/usr.bin/make/suff.c:1.310 src/usr.bin/make/suff.c:1.311
--- src/usr.bin/make/suff.c:1.310	Sat Nov 28 19:12:28 2020
+++ src/usr.bin/make/suff.c	Sat Nov 28 19:16:53 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: suff.c,v 1.310 2020/11/28 19:12:28 rillig Exp $	*/
+/*	$NetBSD: suff.c,v 1.311 2020/11/28 19:16:53 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -114,7 +114,7 @@
 #include "dir.h"
 
 /*	"@(#)suff.c	8.4 (Berkeley) 3/21/94"	*/
-MAKE_RCSID("$NetBSD: suff.c,v 1.310 2020/11/28 19:12:28 rillig Exp $");
+MAKE_RCSID("$NetBSD: suff.c,v 1.311 2020/11/28 19:16:53 rillig Exp $");
 
 #define 

CVS commit: src/usr.bin/make

2020-11-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Nov 28 19:16:53 UTC 2020

Modified Files:
src/usr.bin/make: make.c make.h parse.c suff.c targ.c

Log Message:
make(1): reduce pointer indirection for GNode.order_pred and order_succ


To generate a diff of this commit:
cvs rdiff -u -r1.220 -r1.221 src/usr.bin/make/make.c
cvs rdiff -u -r1.222 -r1.223 src/usr.bin/make/make.h
cvs rdiff -u -r1.455 -r1.456 src/usr.bin/make/parse.c
cvs rdiff -u -r1.310 -r1.311 src/usr.bin/make/suff.c
cvs rdiff -u -r1.143 -r1.144 src/usr.bin/make/targ.c

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



CVS commit: src/usr.bin/make

2020-11-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Nov 28 19:12:28 UTC 2020

Modified Files:
src/usr.bin/make: arch.c compat.c job.c make.c make.h parse.c suff.c
targ.c

Log Message:
make(1): reduce memory allocation for GNode.parents and GNode.children


To generate a diff of this commit:
cvs rdiff -u -r1.178 -r1.179 src/usr.bin/make/arch.c
cvs rdiff -u -r1.193 -r1.194 src/usr.bin/make/compat.c
cvs rdiff -u -r1.332 -r1.333 src/usr.bin/make/job.c
cvs rdiff -u -r1.219 -r1.220 src/usr.bin/make/make.c
cvs rdiff -u -r1.221 -r1.222 src/usr.bin/make/make.h
cvs rdiff -u -r1.454 -r1.455 src/usr.bin/make/parse.c
cvs rdiff -u -r1.309 -r1.310 src/usr.bin/make/suff.c
cvs rdiff -u -r1.142 -r1.143 src/usr.bin/make/targ.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.178 src/usr.bin/make/arch.c:1.179
--- src/usr.bin/make/arch.c:1.178	Mon Nov 23 19:02:54 2020
+++ src/usr.bin/make/arch.c	Sat Nov 28 19:12:28 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: arch.c,v 1.178 2020/11/23 19:02:54 rillig Exp $	*/
+/*	$NetBSD: arch.c,v 1.179 2020/11/28 19:12:28 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -125,7 +125,7 @@
 #include "config.h"
 
 /*	"@(#)arch.c	8.2 (Berkeley) 1/2/94"	*/
-MAKE_RCSID("$NetBSD: arch.c,v 1.178 2020/11/23 19:02:54 rillig Exp $");
+MAKE_RCSID("$NetBSD: arch.c,v 1.179 2020/11/28 19:12:28 rillig Exp $");
 
 typedef struct List ArchList;
 typedef struct ListNode ArchListNode;
@@ -925,7 +925,7 @@ Arch_UpdateMemberMTime(GNode *gn)
 {
 	GNodeListNode *ln;
 
-	for (ln = gn->parents->first; ln != NULL; ln = ln->next) {
+	for (ln = gn->parents.first; ln != NULL; ln = ln->next) {
 		GNode *pgn = ln->datum;
 
 		if (pgn->type & OP_ARCHV) {
@@ -1021,9 +1021,9 @@ Arch_LibOODate(GNode *gn)
 
 	if (gn->type & OP_PHONY) {
 		oodate = TRUE;
-	} else if (!GNode_IsTarget(gn) && Lst_IsEmpty(gn->children)) {
+	} else if (!GNode_IsTarget(gn) && Lst_IsEmpty(>children)) {
 		oodate = FALSE;
-	} else if ((!Lst_IsEmpty(gn->children) && gn->youngestChild == NULL) ||
+	} else if ((!Lst_IsEmpty(>children) && gn->youngestChild == NULL) ||
 		   (gn->mtime > now) ||
 		   (gn->youngestChild != NULL &&
 		gn->mtime < gn->youngestChild->mtime)) {

Index: src/usr.bin/make/compat.c
diff -u src/usr.bin/make/compat.c:1.193 src/usr.bin/make/compat.c:1.194
--- src/usr.bin/make/compat.c:1.193	Sat Nov 28 18:55:52 2020
+++ src/usr.bin/make/compat.c	Sat Nov 28 19:12:28 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: compat.c,v 1.193 2020/11/28 18:55:52 rillig Exp $	*/
+/*	$NetBSD: compat.c,v 1.194 2020/11/28 19:12:28 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.193 2020/11/28 18:55:52 rillig Exp $");
+MAKE_RCSID("$NetBSD: compat.c,v 1.194 2020/11/28 19:12:28 rillig Exp $");
 
 static GNode *curTarg = NULL;
 static pid_t compatChild;
@@ -487,7 +487,7 @@ MakeUnmade(GNode *const gn, GNode *const
 	if (!(gn->type & OP_MADE))
 		Suff_FindDeps(gn);
 
-	MakeNodes(gn->children, gn);
+	MakeNodes(>children, gn);
 
 	if (!(gn->flags & REMAKE)) {
 		gn->made = ABORTED;

Index: src/usr.bin/make/job.c
diff -u src/usr.bin/make/job.c:1.332 src/usr.bin/make/job.c:1.333
--- src/usr.bin/make/job.c:1.332	Sat Nov 28 18:55:52 2020
+++ src/usr.bin/make/job.c	Sat Nov 28 19:12:28 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: job.c,v 1.332 2020/11/28 18:55:52 rillig Exp $	*/
+/*	$NetBSD: job.c,v 1.333 2020/11/28 19:12:28 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.332 2020/11/28 18:55:52 rillig Exp $");
+MAKE_RCSID("$NetBSD: job.c,v 1.333 2020/11/28 19:12:28 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
@@ -1177,7 +1177,7 @@ Job_CheckCommands(GNode *gn, void (*abor
 	return TRUE;
 if (!Lst_IsEmpty(>commands))
 	return TRUE;
-if ((gn->type & OP_LIB) && !Lst_IsEmpty(gn->children))
+if ((gn->type & OP_LIB) && !Lst_IsEmpty(>children))
 	return TRUE;
 
 /*
@@ -2451,7 +2451,7 @@ int
 Job_Finish(void)
 {
 GNode *endNode = Targ_GetEndNode();
-if (!Lst_IsEmpty(>commands) || !Lst_IsEmpty(endNode->children)) {
+if (!Lst_IsEmpty(>commands) || !Lst_IsEmpty(>children)) {
 	if (job_errors != 0) {
 	Error("Errors reported so .END ignored");
 	} else {

Index: src/usr.bin/make/make.c
diff -u src/usr.bin/make/make.c:1.219 src/usr.bin/make/make.c:1.220
--- src/usr.bin/make/make.c:1.219	Sat Nov 28 18:55:52 2020
+++ src/usr.bin/make/make.c	Sat Nov 28 19:12:28 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: make.c,v 1.219 2020/11/28 18:55:52 

CVS commit: src/usr.bin/make

2020-11-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Nov 28 19:12:28 UTC 2020

Modified Files:
src/usr.bin/make: arch.c compat.c job.c make.c make.h parse.c suff.c
targ.c

Log Message:
make(1): reduce memory allocation for GNode.parents and GNode.children


To generate a diff of this commit:
cvs rdiff -u -r1.178 -r1.179 src/usr.bin/make/arch.c
cvs rdiff -u -r1.193 -r1.194 src/usr.bin/make/compat.c
cvs rdiff -u -r1.332 -r1.333 src/usr.bin/make/job.c
cvs rdiff -u -r1.219 -r1.220 src/usr.bin/make/make.c
cvs rdiff -u -r1.221 -r1.222 src/usr.bin/make/make.h
cvs rdiff -u -r1.454 -r1.455 src/usr.bin/make/parse.c
cvs rdiff -u -r1.309 -r1.310 src/usr.bin/make/suff.c
cvs rdiff -u -r1.142 -r1.143 src/usr.bin/make/targ.c

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



CVS commit: src/usr.bin/make

2020-11-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Nov 28 18:55:52 UTC 2020

Modified Files:
src/usr.bin/make: compat.c cond.c job.c lst.c lst.h main.c make.c
make.h meta.c parse.c suff.c targ.c

Log Message:
make(1): remove pointer indirection from GNode.commands

Just to save a few memory allocations.  No noticeable effect on the
performance though.


To generate a diff of this commit:
cvs rdiff -u -r1.192 -r1.193 src/usr.bin/make/compat.c
cvs rdiff -u -r1.217 -r1.218 src/usr.bin/make/cond.c
cvs rdiff -u -r1.331 -r1.332 src/usr.bin/make/job.c
cvs rdiff -u -r1.94 -r1.95 src/usr.bin/make/lst.c
cvs rdiff -u -r1.87 -r1.88 src/usr.bin/make/lst.h
cvs rdiff -u -r1.482 -r1.483 src/usr.bin/make/main.c
cvs rdiff -u -r1.218 -r1.219 src/usr.bin/make/make.c
cvs rdiff -u -r1.220 -r1.221 src/usr.bin/make/make.h
cvs rdiff -u -r1.152 -r1.153 src/usr.bin/make/meta.c
cvs rdiff -u -r1.453 -r1.454 src/usr.bin/make/parse.c
cvs rdiff -u -r1.308 -r1.309 src/usr.bin/make/suff.c
cvs rdiff -u -r1.141 -r1.142 src/usr.bin/make/targ.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/compat.c
diff -u src/usr.bin/make/compat.c:1.192 src/usr.bin/make/compat.c:1.193
--- src/usr.bin/make/compat.c:1.192	Tue Nov 24 19:04:42 2020
+++ src/usr.bin/make/compat.c	Sat Nov 28 18:55:52 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: compat.c,v 1.192 2020/11/24 19:04:42 rillig Exp $	*/
+/*	$NetBSD: compat.c,v 1.193 2020/11/28 18:55:52 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.192 2020/11/24 19:04:42 rillig Exp $");
+MAKE_RCSID("$NetBSD: compat.c,v 1.193 2020/11/28 18:55:52 rillig Exp $");
 
 static GNode *curTarg = NULL;
 static pid_t compatChild;
@@ -218,7 +218,7 @@ Compat_RunCommand(const char *cmdp, GNod
 	 * for delayed commands, run in parallel mode, using the same shell
 	 * command line more than once; see JobPrintCommand.
 	 * TODO: write a unit-test to protect against this potential bug. */
-	cmdNode = Lst_FindDatum(gn->commands, cmd);
+	cmdNode = Lst_FindDatum(>commands, cmd);
 	(void)Var_Subst(cmd, gn, VARE_WANTRES, );
 	/* TODO: handle errors */
 
@@ -232,7 +232,7 @@ Compat_RunCommand(const char *cmdp, GNod
 	if (gn->type & OP_SAVE_CMDS) {
 		GNode *endNode = Targ_GetEndNode();
 		if (gn != endNode) {
-			Lst_Append(endNode->commands, cmdStart);
+			Lst_Append(>commands, cmdStart);
 			return 0;
 		}
 	}
@@ -449,7 +449,7 @@ RunCommands(GNode *gn)
 {
 	StringListNode *ln;
 
-	for (ln = gn->commands->first; ln != NULL; ln = ln->next) {
+	for (ln = gn->commands.first; ln != NULL; ln = ln->next) {
 		const char *cmd = ln->datum;
 		if (Compat_RunCommand(cmd, gn) != 0)
 			break;

Index: src/usr.bin/make/cond.c
diff -u src/usr.bin/make/cond.c:1.217 src/usr.bin/make/cond.c:1.218
--- src/usr.bin/make/cond.c:1.217	Mon Nov 23 20:52:59 2020
+++ src/usr.bin/make/cond.c	Sat Nov 28 18:55:52 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: cond.c,v 1.217 2020/11/23 20:52:59 rillig Exp $	*/
+/*	$NetBSD: cond.c,v 1.218 2020/11/28 18:55:52 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -94,7 +94,7 @@
 #include "dir.h"
 
 /*	"@(#)cond.c	8.2 (Berkeley) 1/2/94"	*/
-MAKE_RCSID("$NetBSD: cond.c,v 1.217 2020/11/23 20:52:59 rillig Exp $");
+MAKE_RCSID("$NetBSD: cond.c,v 1.218 2020/11/28 18:55:52 rillig Exp $");
 
 /*
  * The parsing of conditional expressions is based on this grammar:
@@ -335,7 +335,7 @@ static Boolean
 FuncCommands(size_t argLen MAKE_ATTR_UNUSED, const char *arg)
 {
 	GNode *gn = Targ_FindNode(arg);
-	return gn != NULL && GNode_IsTarget(gn) && !Lst_IsEmpty(gn->commands);
+	return gn != NULL && GNode_IsTarget(gn) && !Lst_IsEmpty(>commands);
 }
 
 /*

Index: src/usr.bin/make/job.c
diff -u src/usr.bin/make/job.c:1.331 src/usr.bin/make/job.c:1.332
--- src/usr.bin/make/job.c:1.331	Sat Nov 28 08:40:05 2020
+++ src/usr.bin/make/job.c	Sat Nov 28 18:55:52 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: job.c,v 1.331 2020/11/28 08:40:05 rillig Exp $	*/
+/*	$NetBSD: job.c,v 1.332 2020/11/28 18:55:52 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.331 2020/11/28 08:40:05 rillig Exp $");
+MAKE_RCSID("$NetBSD: job.c,v 1.332 2020/11/28 18:55:52 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
@@ -902,7 +902,7 @@ JobPrintCommands(Job *job)
 {
 StringListNode *ln;
 
-for (ln = job->node->commands->first; ln != NULL; ln = ln->next) {
+for (ln = job->node->commands.first; ln != NULL; ln = ln->next) {
 	const char *cmd = ln->datum;
 
 

CVS commit: src/usr.bin/make

2020-11-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Nov 28 18:55:52 UTC 2020

Modified Files:
src/usr.bin/make: compat.c cond.c job.c lst.c lst.h main.c make.c
make.h meta.c parse.c suff.c targ.c

Log Message:
make(1): remove pointer indirection from GNode.commands

Just to save a few memory allocations.  No noticeable effect on the
performance though.


To generate a diff of this commit:
cvs rdiff -u -r1.192 -r1.193 src/usr.bin/make/compat.c
cvs rdiff -u -r1.217 -r1.218 src/usr.bin/make/cond.c
cvs rdiff -u -r1.331 -r1.332 src/usr.bin/make/job.c
cvs rdiff -u -r1.94 -r1.95 src/usr.bin/make/lst.c
cvs rdiff -u -r1.87 -r1.88 src/usr.bin/make/lst.h
cvs rdiff -u -r1.482 -r1.483 src/usr.bin/make/main.c
cvs rdiff -u -r1.218 -r1.219 src/usr.bin/make/make.c
cvs rdiff -u -r1.220 -r1.221 src/usr.bin/make/make.h
cvs rdiff -u -r1.152 -r1.153 src/usr.bin/make/meta.c
cvs rdiff -u -r1.453 -r1.454 src/usr.bin/make/parse.c
cvs rdiff -u -r1.308 -r1.309 src/usr.bin/make/suff.c
cvs rdiff -u -r1.141 -r1.142 src/usr.bin/make/targ.c

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



CVS commit: src/usr.bin/make

2020-11-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Nov 28 16:36:19 UTC 2020

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

Log Message:
make(1): improve type of local variable in Var_Export1


To generate a diff of this commit:
cvs rdiff -u -r1.698 -r1.699 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.



CVS commit: src/usr.bin/make

2020-11-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Nov 28 16:36:19 UTC 2020

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

Log Message:
make(1): improve type of local variable in Var_Export1


To generate a diff of this commit:
cvs rdiff -u -r1.698 -r1.699 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.698 src/usr.bin/make/var.c:1.699
--- src/usr.bin/make/var.c:1.698	Sat Nov 28 10:09:28 2020
+++ src/usr.bin/make/var.c	Sat Nov 28 16:36:19 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: var.c,v 1.698 2020/11/28 10:09:28 rillig Exp $	*/
+/*	$NetBSD: var.c,v 1.699 2020/11/28 16:36:19 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -130,7 +130,7 @@
 #include "metachar.h"
 
 /*	"@(#)var.c	8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: var.c,v 1.698 2020/11/28 10:09:28 rillig Exp $");
+MAKE_RCSID("$NetBSD: var.c,v 1.699 2020/11/28 16:36:19 rillig Exp $");
 
 #define VAR_DEBUG1(fmt, arg1) DEBUG1(VAR, fmt, arg1)
 #define VAR_DEBUG2(fmt, arg1, arg2) DEBUG2(VAR, fmt, arg1, arg2)
@@ -512,7 +512,7 @@ MayExport(const char *name)
 static Boolean
 Var_Export1(const char *name, VarExportFlags flags)
 {
-VarExportFlags parent = flags & VAR_EXPORT_PARENT;
+Boolean parent = (flags & VAR_EXPORT_PARENT) != 0;
 Var *v;
 char *val;
 



CVS commit: src/usr.bin/make

2020-11-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Nov 28 16:34:13 UTC 2020

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

Log Message:
make(1): fix type of local variable in ParseMessage


To generate a diff of this commit:
cvs rdiff -u -r1.452 -r1.453 src/usr.bin/make/parse.c

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



CVS commit: src/usr.bin/make

2020-11-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Nov 28 16:34:13 UTC 2020

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

Log Message:
make(1): fix type of local variable in ParseMessage


To generate a diff of this commit:
cvs rdiff -u -r1.452 -r1.453 src/usr.bin/make/parse.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/parse.c
diff -u src/usr.bin/make/parse.c:1.452 src/usr.bin/make/parse.c:1.453
--- src/usr.bin/make/parse.c:1.452	Sat Nov 28 10:05:49 2020
+++ src/usr.bin/make/parse.c	Sat Nov 28 16:34:13 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: parse.c,v 1.452 2020/11/28 10:05:49 rillig Exp $	*/
+/*	$NetBSD: parse.c,v 1.453 2020/11/28 16:34:13 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -117,7 +117,7 @@
 #include "pathnames.h"
 
 /*	"@(#)parse.c	8.3 (Berkeley) 3/19/94"	*/
-MAKE_RCSID("$NetBSD: parse.c,v 1.452 2020/11/28 10:05:49 rillig Exp $");
+MAKE_RCSID("$NetBSD: parse.c,v 1.453 2020/11/28 16:34:13 rillig Exp $");
 
 /* types and constants */
 
@@ -727,8 +727,8 @@ static Boolean
 ParseMessage(const char *directive)
 {
 const char *p = directive;
-int mtype = *p == 'i' ? PARSE_INFO :
-		*p == 'w' ? PARSE_WARNING : PARSE_FATAL;
+ParseErrorLevel mtype = *p == 'i' ? PARSE_INFO :
+			*p == 'w' ? PARSE_WARNING : PARSE_FATAL;
 char *arg;
 
 while (ch_isalpha(*p))



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

2020-11-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Nov 28 16:31:34 UTC 2020

Modified Files:
src/usr.bin/make/filemon: filemon_ktrace.c

Log Message:
make(1): remove unused label


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/usr.bin/make/filemon/filemon_ktrace.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/filemon/filemon_ktrace.c
diff -u src/usr.bin/make/filemon/filemon_ktrace.c:1.6 src/usr.bin/make/filemon/filemon_ktrace.c:1.7
--- src/usr.bin/make/filemon/filemon_ktrace.c:1.6	Mon Nov 23 23:41:11 2020
+++ src/usr.bin/make/filemon/filemon_ktrace.c	Sat Nov 28 16:31:34 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: filemon_ktrace.c,v 1.6 2020/11/23 23:41:11 rillig Exp $	*/
+/*	$NetBSD: filemon_ktrace.c,v 1.7 2020/11/28 16:31:34 rillig Exp $	*/
 
 /*-
  * Copyright (c) 2019 The NetBSD Foundation, Inc.
@@ -225,7 +225,6 @@ filemon_open(void)
 	/* Success!  */
 	return F;
 
-fail2: __unused
 	(void)fclose(F->in);
 fail1:	(void)close(ktrpipe[0]);
 	(void)close(ktrpipe[1]);



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

2020-11-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Nov 28 16:31:34 UTC 2020

Modified Files:
src/usr.bin/make/filemon: filemon_ktrace.c

Log Message:
make(1): remove unused label


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/usr.bin/make/filemon/filemon_ktrace.c

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



CVS commit: src/sys/stand/efiboot

2020-11-28 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Nov 28 15:24:05 UTC 2020

Modified Files:
src/sys/stand/efiboot: efiblock.c

Log Message:
Deal with devices that report either 512 or 2048 as logical block size
for CD9660 file-systems.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/stand/efiboot/efiblock.c

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

Modified files:

Index: src/sys/stand/efiboot/efiblock.c
diff -u src/sys/stand/efiboot/efiblock.c:1.9 src/sys/stand/efiboot/efiblock.c:1.10
--- src/sys/stand/efiboot/efiblock.c:1.9	Sun Oct 18 18:05:48 2020
+++ src/sys/stand/efiboot/efiblock.c	Sat Nov 28 15:24:05 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: efiblock.c,v 1.9 2020/10/18 18:05:48 tnn Exp $ */
+/* $NetBSD: efiblock.c,v 1.10 2020/11/28 15:24:05 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2016 Kimihiro Nonaka 
@@ -127,28 +127,43 @@ efi_block_find_partitions_cd9660(struct 
 	EFI_LBA lba;
 	UINT32 sz;
 
+	if (bdev->bio->Media->BlockSize != DEV_BSIZE &&
+	bdev->bio->Media->BlockSize != ISO_DEFAULT_BLOCK_SIZE) {
+		return ENXIO;
+	}
+
 	sz = __MAX(sizeof(*vd), bdev->bio->Media->BlockSize);
 	sz = roundup(sz, bdev->bio->Media->BlockSize);
-	if ((buf = efi_block_allocate_device_buffer(bdev, sz, _start)) == NULL)
+	if ((buf = efi_block_allocate_device_buffer(bdev, sz, _start)) == NULL) {
 		return ENOMEM;
+	}
 
 	for (lba = 16;; lba++) {
-		status = uefi_call_wrapper(bdev->bio->ReadBlocks, 5, bdev->bio, bdev->media_id,
-		lba, sz, buf_start);
-		if (EFI_ERROR(status))
+		status = uefi_call_wrapper(bdev->bio->ReadBlocks, 5,
+		bdev->bio,
+		bdev->media_id,
+		lba * ISO_DEFAULT_BLOCK_SIZE / bdev->bio->Media->BlockSize,
+		sz,
+		buf_start);
+		if (EFI_ERROR(status)) {
 			goto io_error;
+		}
 
 		vd = (struct iso_primary_descriptor *)buf_start;
-		if (memcmp(vd->id, ISO_STANDARD_ID, sizeof vd->id) != 0)
+		if (memcmp(vd->id, ISO_STANDARD_ID, sizeof vd->id) != 0) {
 			goto io_error;
-		if (isonum_711(vd->type) == ISO_VD_END)
+		}
+		if (isonum_711(vd->type) == ISO_VD_END) {
 			goto io_error;
-		if (isonum_711(vd->type) == ISO_VD_PRIMARY)
+		}
+		if (isonum_711(vd->type) == ISO_VD_PRIMARY) {
 			break;
+		}
 	}
 
-	if (isonum_723(vd->logical_block_size) != ISO_DEFAULT_BLOCK_SIZE)
+	if (isonum_723(vd->logical_block_size) != ISO_DEFAULT_BLOCK_SIZE) {
 		goto io_error;
+	}
 
 	bpart = alloc(sizeof(*bpart));
 	bpart->index = 0;
@@ -593,6 +608,7 @@ efi_block_strategy(void *devdata, int rw
 		dblk += le64toh(bpart->gpt.ent.ent_lba_start);
 		break;
 	case EFI_BLOCK_PART_CD9660:
+		dblk *= ISO_DEFAULT_BLOCK_SIZE / bpart->bdev->bio->Media->BlockSize;
 		break;
 	default:
 		return EINVAL;
@@ -603,8 +619,9 @@ efi_block_strategy(void *devdata, int rw
 		allocated_buf = NULL;
 		aligned_buf = buf;
 	} else if ((allocated_buf = efi_block_allocate_device_buffer(bpart->bdev,
-		size, _buf)) == NULL)
+		size, _buf)) == NULL) {
 		return ENOMEM;
+	}
 
 	status = uefi_call_wrapper(bpart->bdev->bio->ReadBlocks, 5,
 		bpart->bdev->bio, bpart->bdev->media_id, dblk, size, aligned_buf);



CVS commit: src/sys/stand/efiboot

2020-11-28 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Nov 28 15:24:05 UTC 2020

Modified Files:
src/sys/stand/efiboot: efiblock.c

Log Message:
Deal with devices that report either 512 or 2048 as logical block size
for CD9660 file-systems.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/stand/efiboot/efiblock.c

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



CVS commit: src/sys/arch

2020-11-28 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Nov 28 14:38:50 UTC 2020

Modified Files:
src/sys/arch/arm/imx: files.imx23 imx23_pinctrl.c imx23_pinctrlvar.h
imx23_usb.c
src/sys/arch/evbarm/conf: IMX23_OLINUXINO

Log Message:
Fix build by renaming the pinctrl driver


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/arm/imx/files.imx23
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/imx/imx23_pinctrl.c
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/imx/imx23_pinctrlvar.h
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/arm/imx/imx23_usb.c
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/evbarm/conf/IMX23_OLINUXINO

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/imx/files.imx23
diff -u src/sys/arch/arm/imx/files.imx23:1.5 src/sys/arch/arm/imx/files.imx23:1.6
--- src/sys/arch/arm/imx/files.imx23:1.5	Thu Nov 26 12:56:34 2020
+++ src/sys/arch/arm/imx/files.imx23	Sat Nov 28 14:38:50 2020
@@ -1,4 +1,4 @@
-# $Id: files.imx23,v 1.5 2020/11/26 12:56:34 skrll Exp $
+# $Id: files.imx23,v 1.6 2020/11/28 14:38:50 skrll Exp $
 #
 # Freescale i.MX23 applications processor configuration info.
 #
@@ -67,9 +67,9 @@ attach	digctl at apbh
 file	arch/arm/imx/imx23_digctl.c	digctl
 
 # PIN Control
-device	pinctrl: gpiobus
-attach	pinctrl at apbh
-file	arch/arm/imx/imx23_pinctrl.c	pinctrl
+device	imxpctl: gpiobus
+attach	imxpctl at apbh with imx23_pinctrl
+file	arch/arm/imx/imx23_pinctrl.c	imx23_pinctrl
 
 # Clock Control
 device	clkctrl

Index: src/sys/arch/arm/imx/imx23_pinctrl.c
diff -u src/sys/arch/arm/imx/imx23_pinctrl.c:1.3 src/sys/arch/arm/imx/imx23_pinctrl.c:1.4
--- src/sys/arch/arm/imx/imx23_pinctrl.c:1.3	Thu Nov 26 12:56:34 2020
+++ src/sys/arch/arm/imx/imx23_pinctrl.c	Sat Nov 28 14:38:50 2020
@@ -1,4 +1,4 @@
-/* $Id: imx23_pinctrl.c,v 1.3 2020/11/26 12:56:34 skrll Exp $ */
+/* $Id: imx23_pinctrl.c,v 1.4 2020/11/28 14:38:50 skrll Exp $ */
 
 /*
 * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -45,37 +45,37 @@
 
 #define GPIO_PINS 96
 
-typedef struct pinctrl_softc {
+typedef struct imx23_pinctrl_softc {
 	device_t sc_dev;
 	bus_space_tag_t sc_iot;
 	bus_space_handle_t sc_hdl;
 	struct gpio_chipset_tag gc;
 	gpio_pin_t pins[GPIO_PINS];
-} *pinctrl_softc_t;
+} *imx23_pinctrl_softc_t;
 
-static int	pinctrl_match(device_t, cfdata_t, void *);
-static void	pinctrl_attach(device_t, device_t, void *);
-static int	pinctrl_activate(device_t, enum devact);
+static int	imx23_pinctrl_match(device_t, cfdata_t, void *);
+static void	imx23_pinctrl_attach(device_t, device_t, void *);
+static int	imx23_pinctrl_activate(device_t, enum devact);
 
 #if notyet
-static void pinctrl_reset(struct pinctrl_softc *);
+static void imx23_pinctrl_reset(struct imx23_pinctrl_softc *);
 #endif
-static void pinctrl_init(struct pinctrl_softc *);
+static void imx23_pinctrl_init(struct imx23_pinctrl_softc *);
 
-static	int	pinctrl_gp_gc_open(void *, device_t);
-static	void	pinctrl_gp_gc_close(void *, device_t);
-static	int	pinctrl_gp_pin_read(void *, int);
-static	void	pinctrl_gp_pin_write(void *, int, int);
-static	void	pinctrl_gp_pin_ctl(void *, int, int);
-
-static pinctrl_softc_t _sc = NULL;
-
-CFATTACH_DECL3_NEW(pinctrl,
-sizeof(struct pinctrl_softc),
-pinctrl_match,
-pinctrl_attach,
+static	int	imx23_pinctrl_gp_gc_open(void *, device_t);
+static	void	imx23_pinctrl_gp_gc_close(void *, device_t);
+static	int	imx23_pinctrl_gp_pin_read(void *, int);
+static	void	imx23_pinctrl_gp_pin_write(void *, int, int);
+static	void	imx23_pinctrl_gp_pin_ctl(void *, int, int);
+
+static imx23_pinctrl_softc_t _sc = NULL;
+
+CFATTACH_DECL3_NEW(imx23_pinctrl,
+sizeof(struct imx23_pinctrl_softc),
+imx23_pinctrl_match,
+imx23_pinctrl_attach,
 NULL,
-pinctrl_activate,
+imx23_pinctrl_activate,
 NULL,
 NULL,
 0
@@ -366,7 +366,7 @@ const static int pin_caps[GPIO_PINS] = {
 #define PINCTRL_SOFT_RST_LOOP 455 /* At least 1 us ... */
 
 static int
-pinctrl_match(device_t parent, cfdata_t match, void *aux)
+imx23_pinctrl_match(device_t parent, cfdata_t match, void *aux)
 {
 	struct apb_attach_args *aa = aux;
 
@@ -378,32 +378,31 @@ pinctrl_match(device_t parent, cfdata_t 
 }
 
 static void
-pinctrl_attach(device_t parent, device_t self, void *aux)
+imx23_pinctrl_attach(device_t parent, device_t self, void *aux)
 {
-	struct pinctrl_softc *sc = device_private(self);
+	struct imx23_pinctrl_softc *sc = device_private(self);
 	struct apb_attach_args *aa = aux;
-	static int pinctrl_attached = 0;
+	static int imx23_pinctrl_attached = 0;
 
 	sc->sc_dev = self;
 	sc->sc_iot = aa->aa_iot;
 
-	if (pinctrl_attached) {
+	if (imx23_pinctrl_attached) {
 		aprint_error_dev(sc->sc_dev, "already attached\n");
 		return;
 	}
 
 	if (bus_space_map(sc->sc_iot, aa->aa_addr, aa->aa_size, 0,
-	>sc_hdl))
-	{
+	>sc_hdl)) {
 		

CVS commit: src/sys/arch

2020-11-28 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Nov 28 14:38:50 UTC 2020

Modified Files:
src/sys/arch/arm/imx: files.imx23 imx23_pinctrl.c imx23_pinctrlvar.h
imx23_usb.c
src/sys/arch/evbarm/conf: IMX23_OLINUXINO

Log Message:
Fix build by renaming the pinctrl driver


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/arm/imx/files.imx23
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/imx/imx23_pinctrl.c
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/imx/imx23_pinctrlvar.h
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/arm/imx/imx23_usb.c
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/evbarm/conf/IMX23_OLINUXINO

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



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

2020-11-28 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Nov 28 14:35:53 UTC 2020

Modified Files:
src/sys/arch/evbarm/osk5912: osk5912_machdep.c

Log Message:
Build fix.

Don't use own version of KERN_{VTOPHYS,PHYSTOV)


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/evbarm/osk5912/osk5912_machdep.c

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

Modified files:

Index: src/sys/arch/evbarm/osk5912/osk5912_machdep.c
diff -u src/sys/arch/evbarm/osk5912/osk5912_machdep.c:1.22 src/sys/arch/evbarm/osk5912/osk5912_machdep.c:1.23
--- src/sys/arch/evbarm/osk5912/osk5912_machdep.c:1.22	Tue Jul 16 14:41:48 2019
+++ src/sys/arch/evbarm/osk5912/osk5912_machdep.c	Sat Nov 28 14:35:53 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: osk5912_machdep.c,v 1.22 2019/07/16 14:41:48 skrll Exp $ */
+/*	$NetBSD: osk5912_machdep.c,v 1.23 2020/11/28 14:35:53 skrll Exp $ */
 
 /*
  * Machine dependent functions for kernel setup for TI OSK5912 board.
@@ -99,7 +99,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: osk5912_machdep.c,v 1.22 2019/07/16 14:41:48 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: osk5912_machdep.c,v 1.23 2020/11/28 14:35:53 skrll Exp $");
 
 #include "opt_arm_debug.h"
 #include "opt_console.h"
@@ -182,15 +182,8 @@ extern char _end[];
 
 pv_addr_t kernel_pt_table[NUM_KERNEL_PTS];
 
-/*
- * Macros to translate between physical and virtual for a subset of the
- * kernel address space.  *Not* for general use.
- */
 #define KERNEL_BASE_PHYS ((paddr_t)_BASE_phys)
-#define KERN_VTOPHYS(va) \
-	((paddr_t)((vaddr_t)va - KERNEL_BASE + KERNEL_BASE_PHYS))
-#define KERN_PHYSTOV(pa) \
-	((vaddr_t)((paddr_t)pa - KERNEL_BASE_PHYS + KERNEL_BASE))
+u_long kern_vtopdiff = 0;
 
 /* Prototypes */
 
@@ -362,6 +355,8 @@ initarm(void *arg)
 	printf("initarm: Configuring system ...\n");
 #endif
 
+	kern_vtopdiff = KERNEL_BASE - KERNEL_BASE_PHYS;
+
 	/*
 	 * Set up the variables that define the availability of physical
 	 * memory.
@@ -800,16 +795,16 @@ setup_real_page_tables(void)
 	KERN_PHYSTOV(physical_start), KERN_PHYSTOV(physical_end-1),
 	(int)physmem);
 	printf(mem_fmt, "text section",
-	   KERN_VTOPHYS(KERNEL_BASE), KERN_VTOPHYS(etext-1),
+	   KERN_VTOPHYS(KERNEL_BASE), KERN_VTOPHYS((vaddr_t)etext-1),
 	   (vaddr_t)KERNEL_BASE, (vaddr_t)etext-1,
 	   (int)(textsize / PAGE_SIZE));
 	printf(mem_fmt, "data section",
-	   KERN_VTOPHYS(__data_start), KERN_VTOPHYS(_edata),
+	   KERN_VTOPHYS((vaddr_t)__data_start), KERN_VTOPHYS((vaddr_t)_edata),
 	   (vaddr_t)__data_start, (vaddr_t)_edata,
 	   (int)((round_page((vaddr_t)_edata)
 		  - trunc_page((vaddr_t)__data_start)) / PAGE_SIZE));
 	printf(mem_fmt, "bss section",
-	   KERN_VTOPHYS(__bss_start), KERN_VTOPHYS(__bss_end__),
+	   KERN_VTOPHYS((vaddr_t)__bss_start), KERN_VTOPHYS((vaddr_t)__bss_end__),
 	   (vaddr_t)__bss_start, (vaddr_t)__bss_end__,
 	   (int)((round_page((vaddr_t)__bss_end__)
 		  - trunc_page((vaddr_t)__bss_start)) / PAGE_SIZE));



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

2020-11-28 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Nov 28 14:35:53 UTC 2020

Modified Files:
src/sys/arch/evbarm/osk5912: osk5912_machdep.c

Log Message:
Build fix.

Don't use own version of KERN_{VTOPHYS,PHYSTOV)


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/evbarm/osk5912/osk5912_machdep.c

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



CVS commit: src/sys/arch/evbarm

2020-11-28 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Nov 28 14:33:57 UTC 2020

Modified Files:
src/sys/arch/evbarm/bcm53xx: bcm53xx_machdep.c
src/sys/arch/evbarm/gumstix: gumstix_machdep.c
src/sys/arch/evbarm/zynq: zynq_machdep.c

Log Message:
Build fixes and make BP startup detection consistent


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/evbarm/bcm53xx/bcm53xx_machdep.c
cvs rdiff -u -r1.69 -r1.70 src/sys/arch/evbarm/gumstix/gumstix_machdep.c
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/evbarm/zynq/zynq_machdep.c

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

Modified files:

Index: src/sys/arch/evbarm/bcm53xx/bcm53xx_machdep.c
diff -u src/sys/arch/evbarm/bcm53xx/bcm53xx_machdep.c:1.24 src/sys/arch/evbarm/bcm53xx/bcm53xx_machdep.c:1.25
--- src/sys/arch/evbarm/bcm53xx/bcm53xx_machdep.c:1.24	Fri Oct 30 18:54:37 2020
+++ src/sys/arch/evbarm/bcm53xx/bcm53xx_machdep.c	Sat Nov 28 14:33:56 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: bcm53xx_machdep.c,v 1.24 2020/10/30 18:54:37 skrll Exp $	*/
+/*	$NetBSD: bcm53xx_machdep.c,v 1.25 2020/11/28 14:33:56 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -33,7 +33,7 @@
 #define IDM_PRIVATE
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: bcm53xx_machdep.c,v 1.24 2020/10/30 18:54:37 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bcm53xx_machdep.c,v 1.25 2020/11/28 14:33:56 skrll Exp $");
 
 #include "opt_arm_debug.h"
 #include "opt_console.h"
@@ -245,25 +245,20 @@ bcm53xx_mpstart(void)
 	dsb(sy);
 	__asm __volatile("sev" ::: "memory");
 
-	for (int loop = 0; loop < 16; loop++) {
-		VPRINTF("%u hatched %#x\n", loop, arm_cpu_hatched);
-		if (arm_cpu_hatched == __BITS(arm_cpu_max - 1, 1))
-			break;
-		int timo = 150;
-		while (arm_cpu_hatched != __BITS(arm_cpu_max - 1, 1))
-			if (--timo == 0)
-break;
-	}
-	for (size_t i = 1; i < arm_cpu_max; i++) {
-		if (cpu_hatched_p(i)) {)
-			printf("%s: warning: cpu%zu failed to hatch\n",
-			__func__, i);
-		}
-	}
-
-	VPRINTF(" (%u cpu%s, hatched %#x)",
-	arm_cpu_max, arm_cpu_max ? "s" : "",
-	arm_cpu_hatched);
+	/* Bitmask of CPUs (non-BP) to start */
+	for (u_int cpuindex = 1; cpuindex < arm_cpu_max; cpuindex++) {
+		u_int i ;
+		for (i = 150; i > 0; i--) {
+if (cpu_hatched_p(cpuindex))
+break;
+}
+
+if (i == 0) {
+ret++;
+aprint_error("cpu%d: WARNING: AP failed to start\n",
+cpuindex);
+}
+}
 #endif /* MULTIPROCESSOR */
 }
 

Index: src/sys/arch/evbarm/gumstix/gumstix_machdep.c
diff -u src/sys/arch/evbarm/gumstix/gumstix_machdep.c:1.69 src/sys/arch/evbarm/gumstix/gumstix_machdep.c:1.70
--- src/sys/arch/evbarm/gumstix/gumstix_machdep.c:1.69	Fri Oct 30 18:54:37 2020
+++ src/sys/arch/evbarm/gumstix/gumstix_machdep.c	Sat Nov 28 14:33:56 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: gumstix_machdep.c,v 1.69 2020/10/30 18:54:37 skrll Exp $ */
+/*	$NetBSD: gumstix_machdep.c,v 1.70 2020/11/28 14:33:56 skrll Exp $ */
 /*
  * Copyright (C) 2005, 2006, 2007  WIDE Project and SOUM Corporation.
  * All rights reserved.
@@ -540,25 +540,16 @@ gumstix_mpstart(void)
 	dsb(sy);
 	__asm __volatile("sev" ::: "memory");
 
-	for (int loop = 0; loop < 16; loop++) {
-		VPRINTF("%u hatched %#x\n", loop, arm_cpu_hatched);
-		if (arm_cpu_hatched == __BITS(arm_cpu_max - 1, 1))
+	u_int i;
+	for (i = 0x1000; i > 0; i--) {
+		if (cpu_hatched_p(cpuindex))
 			break;
-		int timo = 150;
-		while (arm_cpu_hatched != __BITS(arm_cpu_max - 1, 1))
-			if (--timo == 0)
-break;
-	}
-	for (size_t i = 1; i < arm_cpu_max; i++) {
-		if (cpu_hatched_p(i)) {
-			printf("%s: warning: cpu%zu failed to hatch\n",
-			__func__, i);
-		}
 	}
 
-	VPRINTF(" (%u cpu%s, hatched %#x)",
-	arm_cpu_max, arm_cpu_max ? "s" : "",
-	arm_cpu_hatched);
+	if (i == 0) {
+		aprint_error("cpu%d: WARNING: AP failed to start\n",
+		cpuindex);
+	}
 #endif
 }
 

Index: src/sys/arch/evbarm/zynq/zynq_machdep.c
diff -u src/sys/arch/evbarm/zynq/zynq_machdep.c:1.14 src/sys/arch/evbarm/zynq/zynq_machdep.c:1.15
--- src/sys/arch/evbarm/zynq/zynq_machdep.c:1.14	Fri Oct 30 18:54:37 2020
+++ src/sys/arch/evbarm/zynq/zynq_machdep.c	Sat Nov 28 14:33:57 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: zynq_machdep.c,v 1.14 2020/10/30 18:54:37 skrll Exp $	*/
+/*	$NetBSD: zynq_machdep.c,v 1.15 2020/11/28 14:33:57 skrll Exp $	*/
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: zynq_machdep.c,v 1.14 2020/10/30 18:54:37 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: zynq_machdep.c,v 1.15 2020/11/28 14:33:57 skrll Exp $");
 
 #include "opt_evbarm_boardtype.h"
 #include "opt_arm_debug.h"
@@ -223,27 +223,19 @@ zynq_mpstart(void)
 	dsb(sy);
 	__asm __volatile("sev" ::: "memory");
 
-
-	for 

CVS commit: src/sys/arch/evbarm

2020-11-28 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Nov 28 14:33:57 UTC 2020

Modified Files:
src/sys/arch/evbarm/bcm53xx: bcm53xx_machdep.c
src/sys/arch/evbarm/gumstix: gumstix_machdep.c
src/sys/arch/evbarm/zynq: zynq_machdep.c

Log Message:
Build fixes and make BP startup detection consistent


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/evbarm/bcm53xx/bcm53xx_machdep.c
cvs rdiff -u -r1.69 -r1.70 src/sys/arch/evbarm/gumstix/gumstix_machdep.c
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/evbarm/zynq/zynq_machdep.c

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



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

2020-11-28 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Nov 28 14:29:31 UTC 2020

Modified Files:
src/sys/arch/evbarm/imx31: imx31lk_start.S

Log Message:
Build fix


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/evbarm/imx31/imx31lk_start.S

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/imx31/imx31lk_start.S
diff -u src/sys/arch/evbarm/imx31/imx31lk_start.S:1.6 src/sys/arch/evbarm/imx31/imx31lk_start.S:1.7
--- src/sys/arch/evbarm/imx31/imx31lk_start.S:1.6	Mon Oct 15 16:54:54 2018
+++ src/sys/arch/evbarm/imx31/imx31lk_start.S	Sat Nov 28 14:29:31 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: imx31lk_start.S,v 1.6 2018/10/15 16:54:54 skrll Exp $	*/
+/*	$NetBSD: imx31lk_start.S,v 1.7 2020/11/28 14:29:31 skrll Exp $	*/
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -32,7 +32,7 @@
 #include 
 #include "assym.h"
 
-RCSID("$NetBSD: imx31lk_start.S,v 1.6 2018/10/15 16:54:54 skrll Exp $")
+RCSID("$NetBSD: imx31lk_start.S,v 1.7 2020/11/28 14:29:31 skrll Exp $")
 
 #ifndef SDRAM_START
 #define SDRAM_START 0x8000
@@ -46,7 +46,8 @@ RCSID("$NetBSD: imx31lk_start.S,v 1.6 20
 	.text
 
 	.global _C_LABEL(imx31lk_start)
-_C_LABEL(imx31lk_start):
+
+ENTRY_NP(imx31lk_start)
 	cpsid	if, #PSR_SVC32_MODE
 
 	/*
@@ -60,7 +61,8 @@ _C_LABEL(imx31lk_start):
 	mcr	p15, 0, r3, c2, c0, 2		/* set TTBCR to enable TTBR1 */
 #endif
 
-	mov	r1, #(KERNEL_BASE >> L1_S_SHIFT)
+	ldr	r1, =KERNEL_BASE
+	lsr	r1, r1, L1_S_SHIFT
 	add	r2, r1, #0x80			/* 128 1MB entries */
 	ldr	r3, .Lsdram_pde
 1:



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

2020-11-28 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Nov 28 14:29:31 UTC 2020

Modified Files:
src/sys/arch/evbarm/imx31: imx31lk_start.S

Log Message:
Build fix


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/evbarm/imx31/imx31lk_start.S

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



CVS commit: src/doc

2020-11-28 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Sat Nov 28 14:29:25 UTC 2020

Modified Files:
src/doc: 3RDPARTY CHANGES

Log Message:
Note update to dhcpcd-9.3.4


To generate a diff of this commit:
cvs rdiff -u -r1.1762 -r1.1763 src/doc/3RDPARTY
cvs rdiff -u -r1.2755 -r1.2756 src/doc/CHANGES

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

Modified files:

Index: src/doc/3RDPARTY
diff -u src/doc/3RDPARTY:1.1762 src/doc/3RDPARTY:1.1763
--- src/doc/3RDPARTY:1.1762	Fri Nov 27 17:01:18 2020
+++ src/doc/3RDPARTY	Sat Nov 28 14:29:25 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.1762 2020/11/27 17:01:18 christos Exp $
+#	$NetBSD: 3RDPARTY,v 1.1763 2020/11/28 14:29:25 roy Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -352,12 +352,12 @@ Notes:
 Use the dhcp2netbsd script.
 
 Package:	dhcpcd
-Version:	9.3.3
-Current Vers:	9.3.3
+Version:	9.3.4
+Current Vers:	9.3.4
 Maintainer:	roy
 Archive Site:	ftp://roy.marples.name/pub/dhcpcd/
 Home Page:	http://roy.marples.name/projects/dhcpcd/
-Date:		2020-11-20
+Date:		2020-11-28
 Mailing List: 	dhcpcd-disc...@marples.name
 License:	BSD (2-clause)
 Location:	external/bsd/dhcpcd/dist

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.2755 src/doc/CHANGES:1.2756
--- src/doc/CHANGES:1.2755	Fri Nov 27 17:01:18 2020
+++ src/doc/CHANGES	Sat Nov 28 14:29:25 2020
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2755 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2756 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -301,5 +301,5 @@ Changes from NetBSD 9.0 to NetBSD 10.0:
 	tmux(1): Imported 3.1c. [christos 20201101]
 	kernel: Better default for kern.maxfiles for systems with
 		larger RAM [simonb 20201112]
-	dhcpcd: Update to version 9.3.3 [roy 20201120]
 	acpi(4): Updated ACPICA to 20201113. [christos 20201127]
+	dhcpcd: Update to version 9.3.4 [roy 20201128]



CVS commit: src/doc

2020-11-28 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Sat Nov 28 14:29:25 UTC 2020

Modified Files:
src/doc: 3RDPARTY CHANGES

Log Message:
Note update to dhcpcd-9.3.4


To generate a diff of this commit:
cvs rdiff -u -r1.1762 -r1.1763 src/doc/3RDPARTY
cvs rdiff -u -r1.2755 -r1.2756 src/doc/CHANGES

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



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

2020-11-28 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Nov 28 14:29:02 UTC 2020

Modified Files:
src/sys/arch/arm/cortex: armperiph.c

Log Message:
Fix build


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/arm/cortex/armperiph.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/cortex/armperiph.c
diff -u src/sys/arch/arm/cortex/armperiph.c:1.16 src/sys/arch/arm/cortex/armperiph.c:1.17
--- src/sys/arch/arm/cortex/armperiph.c:1.16	Tue Sep 29 19:58:50 2020
+++ src/sys/arch/arm/cortex/armperiph.c	Sat Nov 28 14:29:02 2020
@@ -32,7 +32,7 @@
 
 #include 
 
-__KERNEL_RCSID(1, "$NetBSD: armperiph.c,v 1.16 2020/09/29 19:58:50 jmcneill Exp $");
+__KERNEL_RCSID(1, "$NetBSD: armperiph.c,v 1.17 2020/11/28 14:29:02 skrll Exp $");
 
 #include 
 #include 
@@ -43,6 +43,7 @@ __KERNEL_RCSID(1, "$NetBSD: armperiph.c,
 #include 
 #include 
 #include 
+#include 
 
 static int armperiph_match(device_t, cfdata_t, void *);
 static void armperiph_attach(device_t, device_t, void *);



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

2020-11-28 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Nov 28 14:29:02 UTC 2020

Modified Files:
src/sys/arch/arm/cortex: armperiph.c

Log Message:
Fix build


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/arm/cortex/armperiph.c

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



CVS commit: src/external/bsd/dhcpcd/dist/src

2020-11-28 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Sat Nov 28 14:27:20 UTC 2020

Modified Files:
src/external/bsd/dhcpcd/dist/src: dhcp.c dhcp6.c dhcpcd.8.in dhcpcd.c
if-options.c

Log Message:
Sync with dhcpcd-9.3.4


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 src/external/bsd/dhcpcd/dist/src/dhcp.c
cvs rdiff -u -r1.25 -r1.26 src/external/bsd/dhcpcd/dist/src/dhcp6.c
cvs rdiff -u -r1.10 -r1.11 src/external/bsd/dhcpcd/dist/src/dhcpcd.8.in
cvs rdiff -u -r1.46 -r1.47 src/external/bsd/dhcpcd/dist/src/dhcpcd.c
cvs rdiff -u -r1.29 -r1.30 src/external/bsd/dhcpcd/dist/src/if-options.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/bsd/dhcpcd/dist/src/dhcp.c
diff -u src/external/bsd/dhcpcd/dist/src/dhcp.c:1.43 src/external/bsd/dhcpcd/dist/src/dhcp.c:1.44
--- src/external/bsd/dhcpcd/dist/src/dhcp.c:1.43	Fri Nov 20 13:24:58 2020
+++ src/external/bsd/dhcpcd/dist/src/dhcp.c	Sat Nov 28 14:27:20 2020
@@ -2364,13 +2364,21 @@ dhcp_bind(struct interface *ifp)
 		return;
 	}
 
+	/* Add the address */
+	if (ipv4_applyaddr(ifp) == NULL) {
+		/* There was an error adding the address.
+		 * If we are in oneshot, exit with a failure. */
+		if (ctx->options & DHCPCD_ONESHOT) {
+			loginfox("exiting due to oneshot");
+			eloop_exit(ctx->eloop, EXIT_FAILURE);
+		}
+		return;
+	}
+
 	/* Close the BPF filter as we can now receive DHCP messages
 	 * on a UDP socket. */
 	dhcp_closebpf(ifp);
 
-	/* Add the address */
-	ipv4_applyaddr(ifp);
-
 openudp:
 	/* If not in master mode, open an address specific socket. */
 	if (ctx->options & DHCPCD_MASTER ||

Index: src/external/bsd/dhcpcd/dist/src/dhcp6.c
diff -u src/external/bsd/dhcpcd/dist/src/dhcp6.c:1.25 src/external/bsd/dhcpcd/dist/src/dhcp6.c:1.26
--- src/external/bsd/dhcpcd/dist/src/dhcp6.c:1.25	Fri Nov 20 13:24:58 2020
+++ src/external/bsd/dhcpcd/dist/src/dhcp6.c	Sat Nov 28 14:27:20 2020
@@ -2064,6 +2064,10 @@ dhcp6_checkstatusok(const struct interfa
 	free(sbuf);
 	state->lerror = code;
 	errno = 0;
+
+	if (code != 0 && ifp->ctx->options & DHCPCD_TEST)
+		eloop_exit(ifp->ctx->eloop, EXIT_FAILURE);
+
 	return (int)code;
 }
 

Index: src/external/bsd/dhcpcd/dist/src/dhcpcd.8.in
diff -u src/external/bsd/dhcpcd/dist/src/dhcpcd.8.in:1.10 src/external/bsd/dhcpcd/dist/src/dhcpcd.8.in:1.11
--- src/external/bsd/dhcpcd/dist/src/dhcpcd.8.in:1.10	Fri Nov 20 13:24:58 2020
+++ src/external/bsd/dhcpcd/dist/src/dhcpcd.8.in	Sat Nov 28 14:27:20 2020
@@ -24,7 +24,7 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.Dd November 3, 2020
+.Dd November 25, 2020
 .Dt DHCPCD 8
 .Os
 .Sh NAME
@@ -264,18 +264,29 @@ Use this
 .Ar script
 instead of the default
 .Pa @SCRIPT@ .
-.It Fl D , Fl Fl duid
+.It Fl D , Fl Fl duid Op Ar ll | lt | uuid | value
 Use a DHCP Unique Identifier.
 If a system UUID is available, that will be used to create a DUID-UUID,
 otheriwse if persistent storage is available then a DUID-LLT
 (link local address + time) is generated,
 otherwise DUID-LL is generated (link local address).
+The DUID type can be hinted as an optional parameter if the file
+.Pa @DBDIR@/duid
+does not exist.
+If not
+.Va ll ,
+.Va lt
+or
+.Va uuid
+then
+.Va value
+will be converted from 00:11:22:33 format.
 This, plus the IAID will be used as the
 .Fl I , Fl Fl clientid .
 The DUID generated will be held in
 .Pa @DBDIR@/duid
 and should not be copied to other hosts.
-This file also takes precedence over the above rules.
+This file also takes precedence over the above rules except for setting a value.
 .It Fl d , Fl Fl debug
 Echo debug messages to the stderr and syslog.
 .It Fl E , Fl Fl lastlease
@@ -747,7 +758,7 @@ This is the default behaviour and sets
 .Ev if_configured=true .
 .It Fl Fl noconfigure
 .Nm
-will not configure the system add all.
+will not configure the system at all.
 This is only of use if the
 .Fl Fl script
 that

Index: src/external/bsd/dhcpcd/dist/src/dhcpcd.c
diff -u src/external/bsd/dhcpcd/dist/src/dhcpcd.c:1.46 src/external/bsd/dhcpcd/dist/src/dhcpcd.c:1.47
--- src/external/bsd/dhcpcd/dist/src/dhcpcd.c:1.46	Fri Nov 20 13:24:58 2020
+++ src/external/bsd/dhcpcd/dist/src/dhcpcd.c	Sat Nov 28 14:27:20 2020
@@ -841,13 +841,17 @@ dhcpcd_initduid(struct dhcpcd_ctx *ctx, 
 {
 	char buf[DUID_LEN * 3];
 
-	if (ctx->duid != NULL)
+	if (ctx->duid != NULL) {
+		if (ifp == NULL)
+			goto log;
 		return;
+	}
 
 	duid_init(ctx, ifp);
 	if (ctx->duid == NULL)
 		return;
 
+log:
 	loginfox("DUID %s",
 	hwaddr_ntoa(ctx->duid, ctx->duid_len, buf, sizeof(buf)));
 }
@@ -991,17 +995,20 @@ void
 dhcpcd_activateinterface(struct interface *ifp, unsigned long long options)
 {
 
-	if (!ifp->active) {
-		ifp->active = IF_ACTIVE;
-		dhcpcd_initstate2(ifp, options);
-		/* It's possible we might not have been able to load
-		 * a config. */
-		if (ifp->active) {
-			configure_interface1(ifp);
-			run_preinit(ifp);
-			

CVS commit: src/external/bsd/dhcpcd/dist/src

2020-11-28 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Sat Nov 28 14:27:20 UTC 2020

Modified Files:
src/external/bsd/dhcpcd/dist/src: dhcp.c dhcp6.c dhcpcd.8.in dhcpcd.c
if-options.c

Log Message:
Sync with dhcpcd-9.3.4


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 src/external/bsd/dhcpcd/dist/src/dhcp.c
cvs rdiff -u -r1.25 -r1.26 src/external/bsd/dhcpcd/dist/src/dhcp6.c
cvs rdiff -u -r1.10 -r1.11 src/external/bsd/dhcpcd/dist/src/dhcpcd.8.in
cvs rdiff -u -r1.46 -r1.47 src/external/bsd/dhcpcd/dist/src/dhcpcd.c
cvs rdiff -u -r1.29 -r1.30 src/external/bsd/dhcpcd/dist/src/if-options.c

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



CVS import: src/external/bsd/dhcpcd/dist

2020-11-28 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Sat Nov 28 14:26:17 UTC 2020

Update of /cvsroot/src/external/bsd/dhcpcd/dist
In directory ivanova.netbsd.org:/tmp/cvs-serv1431

Log Message:
Upate to dhcpcd-9.3.4 with the following changes:

With the following changes:
 * DHCP: If error adding the address in oneshot, exit with failure
 * DHCP: Only listen to the address if we successfully added it
 * DHCP6: Fix segfault introduced in dhcpcd-9.3.3
 * DHCP6: Abort in test mode when an error is returned by server
 * options: allow --ia_na=1 and --ia_pd=2 on the command line
 * options: Allow duid to take a value

Status:

Vendor Tag: ROY
Release Tags:   dhcpcd-9_3_4

U src/external/bsd/dhcpcd/dist/LICENSE
U src/external/bsd/dhcpcd/dist/README.md
U src/external/bsd/dhcpcd/dist/src/defs.h
U src/external/bsd/dhcpcd/dist/src/common.c
U src/external/bsd/dhcpcd/dist/src/control.c
C src/external/bsd/dhcpcd/dist/src/dhcpcd.c
U src/external/bsd/dhcpcd/dist/src/duid.c
U src/external/bsd/dhcpcd/dist/src/eloop.c
U src/external/bsd/dhcpcd/dist/src/logerr.c
U src/external/bsd/dhcpcd/dist/src/if.c
C src/external/bsd/dhcpcd/dist/src/if-options.c
U src/external/bsd/dhcpcd/dist/src/sa.c
U src/external/bsd/dhcpcd/dist/src/route.c
U src/external/bsd/dhcpcd/dist/src/dhcp-common.c
U src/external/bsd/dhcpcd/dist/src/script.c
U src/external/bsd/dhcpcd/dist/src/auth.c
U src/external/bsd/dhcpcd/dist/src/if-bsd.c
C src/external/bsd/dhcpcd/dist/src/dhcp.c
U src/external/bsd/dhcpcd/dist/src/ipv4.c
U src/external/bsd/dhcpcd/dist/src/bpf.c
U src/external/bsd/dhcpcd/dist/src/arp.c
U src/external/bsd/dhcpcd/dist/src/ipv4ll.c
U src/external/bsd/dhcpcd/dist/src/ipv6.c
U src/external/bsd/dhcpcd/dist/src/ipv6nd.c
C src/external/bsd/dhcpcd/dist/src/dhcp6.c
U src/external/bsd/dhcpcd/dist/src/dhcpcd-embedded.c
U src/external/bsd/dhcpcd/dist/src/privsep.c
U src/external/bsd/dhcpcd/dist/src/privsep-root.c
U src/external/bsd/dhcpcd/dist/src/privsep-control.c
U src/external/bsd/dhcpcd/dist/src/privsep-inet.c
U src/external/bsd/dhcpcd/dist/src/privsep-bpf.c
U src/external/bsd/dhcpcd/dist/src/privsep-bsd.c
U src/external/bsd/dhcpcd/dist/src/common.h
U src/external/bsd/dhcpcd/dist/src/control.h
U src/external/bsd/dhcpcd/dist/src/dhcpcd.h
U src/external/bsd/dhcpcd/dist/src/duid.h
U src/external/bsd/dhcpcd/dist/src/eloop.h
U src/external/bsd/dhcpcd/dist/src/logerr.h
U src/external/bsd/dhcpcd/dist/src/if.h
U src/external/bsd/dhcpcd/dist/src/if-options.h
U src/external/bsd/dhcpcd/dist/src/sa.h
U src/external/bsd/dhcpcd/dist/src/route.h
U src/external/bsd/dhcpcd/dist/src/dhcp-common.h
U src/external/bsd/dhcpcd/dist/src/script.h
U src/external/bsd/dhcpcd/dist/src/auth.h
U src/external/bsd/dhcpcd/dist/src/dhcp.h
U src/external/bsd/dhcpcd/dist/src/ipv4.h
U src/external/bsd/dhcpcd/dist/src/bpf.h
U src/external/bsd/dhcpcd/dist/src/arp.h
U src/external/bsd/dhcpcd/dist/src/ipv4ll.h
U src/external/bsd/dhcpcd/dist/src/ipv6.h
U src/external/bsd/dhcpcd/dist/src/ipv6nd.h
U src/external/bsd/dhcpcd/dist/src/dhcp6.h
U src/external/bsd/dhcpcd/dist/src/dhcpcd-embedded.h
U src/external/bsd/dhcpcd/dist/src/privsep.h
U src/external/bsd/dhcpcd/dist/src/privsep-root.h
U src/external/bsd/dhcpcd/dist/src/privsep-control.h
U src/external/bsd/dhcpcd/dist/src/privsep-inet.h
U src/external/bsd/dhcpcd/dist/src/privsep-bpf.h
U src/external/bsd/dhcpcd/dist/src/dev.h
U src/external/bsd/dhcpcd/dist/src/dhcpcd.conf.5.in
C src/external/bsd/dhcpcd/dist/src/dhcpcd.8.in
U src/external/bsd/dhcpcd/dist/src/dhcpcd.conf
U src/external/bsd/dhcpcd/dist/hooks/dhcpcd-run-hooks.in
U src/external/bsd/dhcpcd/dist/hooks/dhcpcd-run-hooks.8.in
U src/external/bsd/dhcpcd/dist/hooks/01-test
U src/external/bsd/dhcpcd/dist/hooks/10-wpa_supplicant
U src/external/bsd/dhcpcd/dist/hooks/15-timezone
U src/external/bsd/dhcpcd/dist/hooks/20-resolv.conf
U src/external/bsd/dhcpcd/dist/hooks/29-lookup-hostname
U src/external/bsd/dhcpcd/dist/hooks/30-hostname.in
U src/external/bsd/dhcpcd/dist/hooks/50-ntp.conf
U src/external/bsd/dhcpcd/dist/hooks/50-ypbind.in

5 conflicts created by this import.
Use the following command to help the merge:

cvs checkout -jROY:yesterday -jROY src/external/bsd/dhcpcd/dist



CVS import: src/external/bsd/dhcpcd/dist

2020-11-28 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Sat Nov 28 14:26:17 UTC 2020

Update of /cvsroot/src/external/bsd/dhcpcd/dist
In directory ivanova.netbsd.org:/tmp/cvs-serv1431

Log Message:
Upate to dhcpcd-9.3.4 with the following changes:

With the following changes:
 * DHCP: If error adding the address in oneshot, exit with failure
 * DHCP: Only listen to the address if we successfully added it
 * DHCP6: Fix segfault introduced in dhcpcd-9.3.3
 * DHCP6: Abort in test mode when an error is returned by server
 * options: allow --ia_na=1 and --ia_pd=2 on the command line
 * options: Allow duid to take a value

Status:

Vendor Tag: ROY
Release Tags:   dhcpcd-9_3_4

U src/external/bsd/dhcpcd/dist/LICENSE
U src/external/bsd/dhcpcd/dist/README.md
U src/external/bsd/dhcpcd/dist/src/defs.h
U src/external/bsd/dhcpcd/dist/src/common.c
U src/external/bsd/dhcpcd/dist/src/control.c
C src/external/bsd/dhcpcd/dist/src/dhcpcd.c
U src/external/bsd/dhcpcd/dist/src/duid.c
U src/external/bsd/dhcpcd/dist/src/eloop.c
U src/external/bsd/dhcpcd/dist/src/logerr.c
U src/external/bsd/dhcpcd/dist/src/if.c
C src/external/bsd/dhcpcd/dist/src/if-options.c
U src/external/bsd/dhcpcd/dist/src/sa.c
U src/external/bsd/dhcpcd/dist/src/route.c
U src/external/bsd/dhcpcd/dist/src/dhcp-common.c
U src/external/bsd/dhcpcd/dist/src/script.c
U src/external/bsd/dhcpcd/dist/src/auth.c
U src/external/bsd/dhcpcd/dist/src/if-bsd.c
C src/external/bsd/dhcpcd/dist/src/dhcp.c
U src/external/bsd/dhcpcd/dist/src/ipv4.c
U src/external/bsd/dhcpcd/dist/src/bpf.c
U src/external/bsd/dhcpcd/dist/src/arp.c
U src/external/bsd/dhcpcd/dist/src/ipv4ll.c
U src/external/bsd/dhcpcd/dist/src/ipv6.c
U src/external/bsd/dhcpcd/dist/src/ipv6nd.c
C src/external/bsd/dhcpcd/dist/src/dhcp6.c
U src/external/bsd/dhcpcd/dist/src/dhcpcd-embedded.c
U src/external/bsd/dhcpcd/dist/src/privsep.c
U src/external/bsd/dhcpcd/dist/src/privsep-root.c
U src/external/bsd/dhcpcd/dist/src/privsep-control.c
U src/external/bsd/dhcpcd/dist/src/privsep-inet.c
U src/external/bsd/dhcpcd/dist/src/privsep-bpf.c
U src/external/bsd/dhcpcd/dist/src/privsep-bsd.c
U src/external/bsd/dhcpcd/dist/src/common.h
U src/external/bsd/dhcpcd/dist/src/control.h
U src/external/bsd/dhcpcd/dist/src/dhcpcd.h
U src/external/bsd/dhcpcd/dist/src/duid.h
U src/external/bsd/dhcpcd/dist/src/eloop.h
U src/external/bsd/dhcpcd/dist/src/logerr.h
U src/external/bsd/dhcpcd/dist/src/if.h
U src/external/bsd/dhcpcd/dist/src/if-options.h
U src/external/bsd/dhcpcd/dist/src/sa.h
U src/external/bsd/dhcpcd/dist/src/route.h
U src/external/bsd/dhcpcd/dist/src/dhcp-common.h
U src/external/bsd/dhcpcd/dist/src/script.h
U src/external/bsd/dhcpcd/dist/src/auth.h
U src/external/bsd/dhcpcd/dist/src/dhcp.h
U src/external/bsd/dhcpcd/dist/src/ipv4.h
U src/external/bsd/dhcpcd/dist/src/bpf.h
U src/external/bsd/dhcpcd/dist/src/arp.h
U src/external/bsd/dhcpcd/dist/src/ipv4ll.h
U src/external/bsd/dhcpcd/dist/src/ipv6.h
U src/external/bsd/dhcpcd/dist/src/ipv6nd.h
U src/external/bsd/dhcpcd/dist/src/dhcp6.h
U src/external/bsd/dhcpcd/dist/src/dhcpcd-embedded.h
U src/external/bsd/dhcpcd/dist/src/privsep.h
U src/external/bsd/dhcpcd/dist/src/privsep-root.h
U src/external/bsd/dhcpcd/dist/src/privsep-control.h
U src/external/bsd/dhcpcd/dist/src/privsep-inet.h
U src/external/bsd/dhcpcd/dist/src/privsep-bpf.h
U src/external/bsd/dhcpcd/dist/src/dev.h
U src/external/bsd/dhcpcd/dist/src/dhcpcd.conf.5.in
C src/external/bsd/dhcpcd/dist/src/dhcpcd.8.in
U src/external/bsd/dhcpcd/dist/src/dhcpcd.conf
U src/external/bsd/dhcpcd/dist/hooks/dhcpcd-run-hooks.in
U src/external/bsd/dhcpcd/dist/hooks/dhcpcd-run-hooks.8.in
U src/external/bsd/dhcpcd/dist/hooks/01-test
U src/external/bsd/dhcpcd/dist/hooks/10-wpa_supplicant
U src/external/bsd/dhcpcd/dist/hooks/15-timezone
U src/external/bsd/dhcpcd/dist/hooks/20-resolv.conf
U src/external/bsd/dhcpcd/dist/hooks/29-lookup-hostname
U src/external/bsd/dhcpcd/dist/hooks/30-hostname.in
U src/external/bsd/dhcpcd/dist/hooks/50-ntp.conf
U src/external/bsd/dhcpcd/dist/hooks/50-ypbind.in

5 conflicts created by this import.
Use the following command to help the merge:

cvs checkout -jROY:yesterday -jROY src/external/bsd/dhcpcd/dist



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

2020-11-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Nov 28 14:08:38 UTC 2020

Modified Files:
src/usr.bin/make/unit-tests: cond-func-empty.mk varmisc.mk

Log Message:
make(1): move test for recursive variable to cond-func-empty

Previously, the documentation of that test was much too short to explain
all the effects that happened in the bug situation from 2020-06-28 until
2020-07-02.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/usr.bin/make/unit-tests/cond-func-empty.mk
cvs rdiff -u -r1.28 -r1.29 src/usr.bin/make/unit-tests/varmisc.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-func-empty.mk
diff -u src/usr.bin/make/unit-tests/cond-func-empty.mk:1.10 src/usr.bin/make/unit-tests/cond-func-empty.mk:1.11
--- src/usr.bin/make/unit-tests/cond-func-empty.mk:1.10	Sun Nov 15 14:07:53 2020
+++ src/usr.bin/make/unit-tests/cond-func-empty.mk	Sat Nov 28 14:08:37 2020
@@ -1,4 +1,4 @@
-# $NetBSD: cond-func-empty.mk,v 1.10 2020/11/15 14:07:53 rillig Exp $
+# $NetBSD: cond-func-empty.mk,v 1.11 2020/11/28 14:08:37 rillig Exp $
 #
 # Tests for the empty() function in .if conditions, which tests a variable
 # expression for emptiness.
@@ -155,5 +155,30 @@ ${:U WORD }=	variable name with spaces
 .  error
 .endif
 
+# Between 2020-06-28 and var.c 1.226 from 2020-07-02, this paragraph generated
+# a wrong error message "Variable VARNAME is recursive".
+#
+# The bug was that the !empty() condition was evaluated, even though this was
+# not necessary since the defined() condition already evaluated to false.
+#
+# When evaluating the !empty condition, the variable name was parsed as
+# "VARNAME${:U2}", but without expanding any nested variable expression, in
+# this case the ${:U2}.  Therefore, the variable name came out as simply
+# "VARNAME".  Since this variable name should have been discarded quickly after
+# parsing it, this unrealistic variable name should have done no harm.
+#
+# The variable expression was expanded though, and this was wrong.  The
+# expansion was done without the VARE_WANTRES flag (called VARF_WANTRES back
+# then) though.  This had the effect that the ${:U1} from the value of VARNAME
+# expanded to an empty string.  This in turn created the seemingly recursive
+# definition VARNAME=${VARNAME}, and that definition was never meant to be
+# expanded.
+#
+# This was fixed by expanding nested variable expressions in the variable name
+# only if the flag VARE_WANTRES is given.
+VARNAME=	${VARNAME${:U1}}
+.if defined(VARNAME${:U2}) && !empty(VARNAME${:U2})
+.endif
+
 all:
 	@:;

Index: src/usr.bin/make/unit-tests/varmisc.mk
diff -u src/usr.bin/make/unit-tests/varmisc.mk:1.28 src/usr.bin/make/unit-tests/varmisc.mk:1.29
--- src/usr.bin/make/unit-tests/varmisc.mk:1.28	Sat Nov  7 00:07:02 2020
+++ src/usr.bin/make/unit-tests/varmisc.mk	Sat Nov 28 14:08:37 2020
@@ -1,4 +1,4 @@
-# $NetBSD: varmisc.mk,v 1.28 2020/11/07 00:07:02 rillig Exp $
+# $NetBSD: varmisc.mk,v 1.29 2020/11/28 14:08:37 rillig Exp $
 #
 # Miscellaneous variable tests.
 
@@ -77,16 +77,6 @@ MAN+=	${MAN$s}
 manok:
 	@echo MAN=${MAN}
 
-# This is an expanded variant of the above .for loop.
-# Between 2020-06-28 and 2020-07-02 this paragraph generated a wrong
-# error message "Variable VARNAME is recursive".
-# When evaluating the !empty expression, the ${:U1} was not expanded and
-# thus resulted in the seeming definition VARNAME=${VARNAME}, which is
-# obviously recursive.
-VARNAME=	${VARNAME${:U1}}
-.if defined(VARNAME${:U2}) && !empty(VARNAME${:U2})
-.endif
-
 # begin .MAKE.SAVE_DOLLARS; see Var_SetWithFlags and ParseBoolean.
 SD_VALUES=	0 1 2 False True false true Yes No yes no On Off ON OFF on off
 SD_4_DOLLARS=	



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

2020-11-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Nov 28 14:08:38 UTC 2020

Modified Files:
src/usr.bin/make/unit-tests: cond-func-empty.mk varmisc.mk

Log Message:
make(1): move test for recursive variable to cond-func-empty

Previously, the documentation of that test was much too short to explain
all the effects that happened in the bug situation from 2020-06-28 until
2020-07-02.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/usr.bin/make/unit-tests/cond-func-empty.mk
cvs rdiff -u -r1.28 -r1.29 src/usr.bin/make/unit-tests/varmisc.mk

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



CVS commit: src/sys/arch/evbarm

2020-11-28 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Nov 28 14:02:30 UTC 2020

Modified Files:
src/sys/arch/evbarm/gemini: gemini_machdep.c
src/sys/arch/evbarm/imx23_olinuxino: imx23_olinuxino_machdep.c
src/sys/arch/evbarm/tisdp24xx: sdp24xx_machdep.c

Log Message:
Fix thinko in kern_vtopdiff calculation


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/sys/arch/evbarm/gemini/gemini_machdep.c
cvs rdiff -u -r1.10 -r1.11 \
src/sys/arch/evbarm/imx23_olinuxino/imx23_olinuxino_machdep.c
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/evbarm/tisdp24xx/sdp24xx_machdep.c

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

Modified files:

Index: src/sys/arch/evbarm/gemini/gemini_machdep.c
diff -u src/sys/arch/evbarm/gemini/gemini_machdep.c:1.32 src/sys/arch/evbarm/gemini/gemini_machdep.c:1.33
--- src/sys/arch/evbarm/gemini/gemini_machdep.c:1.32	Thu Nov 26 12:56:34 2020
+++ src/sys/arch/evbarm/gemini/gemini_machdep.c	Sat Nov 28 14:02:30 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: gemini_machdep.c,v 1.32 2020/11/26 12:56:34 skrll Exp $	*/
+/*	$NetBSD: gemini_machdep.c,v 1.33 2020/11/28 14:02:30 skrll Exp $	*/
 
 /* adapted from:
  *	NetBSD: sdp24xx_machdep.c,v 1.4 2008/08/27 11:03:10 matt Exp
@@ -129,7 +129,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: gemini_machdep.c,v 1.32 2020/11/26 12:56:34 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gemini_machdep.c,v 1.33 2020/11/28 14:02:30 skrll Exp $");
 
 #include "opt_arm_debug.h"
 #include "opt_console.h"
@@ -630,7 +630,7 @@ initarm(void *arg)
 	bootconfig.dram[0].address = physical_start;
 	bootconfig.dram[0].pages = physmem;
 
-	kern_vtopdiff = KERNEL_BASE + GEMINI_DRAM_BASE;
+	kern_vtopdiff = KERNEL_BASE - GEMINI_DRAM_BASE;
 
 	/*
 	 * Our kernel is at the beginning of memory, so set our free space to

Index: src/sys/arch/evbarm/imx23_olinuxino/imx23_olinuxino_machdep.c
diff -u src/sys/arch/evbarm/imx23_olinuxino/imx23_olinuxino_machdep.c:1.10 src/sys/arch/evbarm/imx23_olinuxino/imx23_olinuxino_machdep.c:1.11
--- src/sys/arch/evbarm/imx23_olinuxino/imx23_olinuxino_machdep.c:1.10	Thu Nov 26 12:56:34 2020
+++ src/sys/arch/evbarm/imx23_olinuxino/imx23_olinuxino_machdep.c	Sat Nov 28 14:02:30 2020
@@ -1,4 +1,4 @@
-/* $Id: imx23_olinuxino_machdep.c,v 1.10 2020/11/26 12:56:34 skrll Exp $ */
+/* $Id: imx23_olinuxino_machdep.c,v 1.11 2020/11/28 14:02:30 skrll Exp $ */
 
 /*
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -138,7 +138,7 @@ initarm(void *arg)
 	if (set_cpufuncs())
 		panic("set_cpufuncs failed");
 
-	kern_vtopdiff = KERNEL_BASE + KERNEL_BASE_PHYS;
+	kern_vtopdiff = KERNEL_BASE - KERNEL_BASE_PHYS;
 
 	pmap_devmap_register(devmap);
 	consinit();

Index: src/sys/arch/evbarm/tisdp24xx/sdp24xx_machdep.c
diff -u src/sys/arch/evbarm/tisdp24xx/sdp24xx_machdep.c:1.25 src/sys/arch/evbarm/tisdp24xx/sdp24xx_machdep.c:1.26
--- src/sys/arch/evbarm/tisdp24xx/sdp24xx_machdep.c:1.25	Tue Jul 16 14:41:48 2019
+++ src/sys/arch/evbarm/tisdp24xx/sdp24xx_machdep.c	Sat Nov 28 14:02:30 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: sdp24xx_machdep.c,v 1.25 2019/07/16 14:41:48 skrll Exp $ */
+/*	$NetBSD: sdp24xx_machdep.c,v 1.26 2020/11/28 14:02:30 skrll Exp $ */
 
 /*
  * Machine dependent functions for kernel setup for TI OSK5912 board.
@@ -125,7 +125,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sdp24xx_machdep.c,v 1.25 2019/07/16 14:41:48 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sdp24xx_machdep.c,v 1.26 2020/11/28 14:02:30 skrll Exp $");
 
 #include "opt_arm_debug.h"
 #include "opt_console.h"
@@ -213,7 +213,7 @@ pv_addr_t kernel_pt_table[NUM_KERNEL_PTS
 #define KERNEL_BASE_PHYS ((paddr_t)_BASE_phys)
 
 #if 0
-u_long kern_vtopdiff = KERNEL_BASE + KERNEL_BASE_PHYS;
+u_long kern_vtopdiff = KERNEL_BASE - KERNEL_BASE_PHYS;
 #else
 u_long kern_vtopdiff = 0;
 #endif



CVS commit: src/sys/arch/evbarm

2020-11-28 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Nov 28 14:02:30 UTC 2020

Modified Files:
src/sys/arch/evbarm/gemini: gemini_machdep.c
src/sys/arch/evbarm/imx23_olinuxino: imx23_olinuxino_machdep.c
src/sys/arch/evbarm/tisdp24xx: sdp24xx_machdep.c

Log Message:
Fix thinko in kern_vtopdiff calculation


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/sys/arch/evbarm/gemini/gemini_machdep.c
cvs rdiff -u -r1.10 -r1.11 \
src/sys/arch/evbarm/imx23_olinuxino/imx23_olinuxino_machdep.c
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/evbarm/tisdp24xx/sdp24xx_machdep.c

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



CVS commit: src/sys/stand/efiboot

2020-11-28 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Nov 28 14:02:09 UTC 2020

Modified Files:
src/sys/stand/efiboot: boot.c efiboot_machdep.h
src/sys/stand/efiboot/bootaa64: efibootaa64.c
src/sys/stand/efiboot/bootarm: efibootarm.c

Log Message:
Add a hook for MD specific info to print in the "ver" command. Use this
to print the value of the current execution level in bootaa64.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/sys/stand/efiboot/boot.c
cvs rdiff -u -r1.2 -r1.3 src/sys/stand/efiboot/efiboot_machdep.h
cvs rdiff -u -r1.2 -r1.3 src/sys/stand/efiboot/bootaa64/efibootaa64.c
cvs rdiff -u -r1.2 -r1.3 src/sys/stand/efiboot/bootarm/efibootarm.c

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

Modified files:

Index: src/sys/stand/efiboot/boot.c
diff -u src/sys/stand/efiboot/boot.c:1.28 src/sys/stand/efiboot/boot.c:1.29
--- src/sys/stand/efiboot/boot.c:1.28	Sun Oct 11 14:03:33 2020
+++ src/sys/stand/efiboot/boot.c	Sat Nov 28 14:02:09 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: boot.c,v 1.28 2020/10/11 14:03:33 jmcneill Exp $	*/
+/*	$NetBSD: boot.c,v 1.29 2020/11/28 14:02:09 jmcneill Exp $	*/
 
 /*-
  * Copyright (c) 2016 Kimihiro Nonaka 
@@ -347,6 +347,7 @@ command_version(char *arg)
 	efi_fdt_show();
 	efi_acpi_show();
 	efi_rng_show();
+	efi_md_show();
 }
 
 void

Index: src/sys/stand/efiboot/efiboot_machdep.h
diff -u src/sys/stand/efiboot/efiboot_machdep.h:1.2 src/sys/stand/efiboot/efiboot_machdep.h:1.3
--- src/sys/stand/efiboot/efiboot_machdep.h:1.2	Fri Sep  7 17:30:32 2018
+++ src/sys/stand/efiboot/efiboot_machdep.h	Sat Nov 28 14:02:09 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: efiboot_machdep.h,v 1.2 2018/09/07 17:30:32 jmcneill Exp $ */
+/* $NetBSD: efiboot_machdep.h,v 1.3 2020/11/28 14:02:09 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2018 Jared McNeill 
@@ -32,3 +32,4 @@
 
 void efi_dcache_flush(u_long, u_long);
 void efi_boot_kernel(u_long[]);
+void efi_md_show(void);

Index: src/sys/stand/efiboot/bootaa64/efibootaa64.c
diff -u src/sys/stand/efiboot/bootaa64/efibootaa64.c:1.2 src/sys/stand/efiboot/bootaa64/efibootaa64.c:1.3
--- src/sys/stand/efiboot/bootaa64/efibootaa64.c:1.2	Fri Sep  7 17:30:32 2018
+++ src/sys/stand/efiboot/bootaa64/efibootaa64.c	Sat Nov 28 14:02:09 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: efibootaa64.c,v 1.2 2018/09/07 17:30:32 jmcneill Exp $	*/
+/*	$NetBSD: efibootaa64.c,v 1.3 2020/11/28 14:02:09 jmcneill Exp $	*/
 
 /*-
  * Copyright (c) 2016 Kimihiro Nonaka 
@@ -60,3 +60,20 @@ efi_boot_kernel(u_long marks[MARK_MAX])
 
 	aarch64_exec_kernel((paddr_t)marks[MARK_ENTRY], (paddr_t)efi_fdt_data());
 }
+
+/*
+ * Returns the current exception level.
+ */
+static u_int
+efi_aarch64_current_el(void)
+{
+	uint64_t el;
+	__asm __volatile ("mrs %0, CurrentEL" : "=r" (el));
+	return (el >> 2) & 0x3;
+}
+
+void
+efi_md_show(void)
+{
+	printf("Current Exception Level: EL%u\n", efi_aarch64_current_el());
+}

Index: src/sys/stand/efiboot/bootarm/efibootarm.c
diff -u src/sys/stand/efiboot/bootarm/efibootarm.c:1.2 src/sys/stand/efiboot/bootarm/efibootarm.c:1.3
--- src/sys/stand/efiboot/bootarm/efibootarm.c:1.2	Sat Mar 30 17:41:13 2019
+++ src/sys/stand/efiboot/bootarm/efibootarm.c	Sat Nov 28 14:02:09 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: efibootarm.c,v 1.2 2019/03/30 17:41:13 jmcneill Exp $ */
+/* $NetBSD: efibootarm.c,v 1.3 2020/11/28 14:02:09 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2019 Jared McNeill 
@@ -58,3 +58,8 @@ efi_boot_kernel(u_long marks[MARK_MAX])
 
 	armv7_exec_kernel((register_t)marks[MARK_ENTRY], (register_t)efi_fdt_data());
 }
+
+void
+efi_md_show(void)
+{
+}



CVS commit: src/sys/stand/efiboot

2020-11-28 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Nov 28 14:02:09 UTC 2020

Modified Files:
src/sys/stand/efiboot: boot.c efiboot_machdep.h
src/sys/stand/efiboot/bootaa64: efibootaa64.c
src/sys/stand/efiboot/bootarm: efibootarm.c

Log Message:
Add a hook for MD specific info to print in the "ver" command. Use this
to print the value of the current execution level in bootaa64.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/sys/stand/efiboot/boot.c
cvs rdiff -u -r1.2 -r1.3 src/sys/stand/efiboot/efiboot_machdep.h
cvs rdiff -u -r1.2 -r1.3 src/sys/stand/efiboot/bootaa64/efibootaa64.c
cvs rdiff -u -r1.2 -r1.3 src/sys/stand/efiboot/bootarm/efibootarm.c

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



CVS commit: src/usr.sbin/sysinst/arch/evbarm

2020-11-28 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Nov 28 13:05:58 UTC 2020

Modified Files:
src/usr.sbin/sysinst/arch/evbarm: md.c

Log Message:
Make sure the kernel set is selected, even if extracting parts of it
manually.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/usr.sbin/sysinst/arch/evbarm/md.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/arch/evbarm/md.c
diff -u src/usr.sbin/sysinst/arch/evbarm/md.c:1.19 src/usr.sbin/sysinst/arch/evbarm/md.c:1.20
--- src/usr.sbin/sysinst/arch/evbarm/md.c:1.19	Wed Oct 14 15:09:10 2020
+++ src/usr.sbin/sysinst/arch/evbarm/md.c	Sat Nov 28 13:05:58 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: md.c,v 1.19 2020/10/14 15:09:10 martin Exp $ */
+/*	$NetBSD: md.c,v 1.20 2020/11/28 13:05:58 jmcneill Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -86,6 +86,7 @@ md_init_set_status(int flags)
 	 * we will extract kernel variants piecewise manually
 	 * later, just fetch the kernel set, do not unpack it.
 	 */
+	set_kernel_set(SET_KERNEL_1);
 	set_noextract_set(SET_KERNEL_1);
 }
 



CVS commit: src/usr.sbin/sysinst/arch/evbarm

2020-11-28 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Nov 28 13:05:58 UTC 2020

Modified Files:
src/usr.sbin/sysinst/arch/evbarm: md.c

Log Message:
Make sure the kernel set is selected, even if extracting parts of it
manually.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/usr.sbin/sysinst/arch/evbarm/md.c

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



CVS commit: src/usr.bin/make

2020-11-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Nov 28 10:28:53 UTC 2020

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

Log Message:
make(1): rename parameter in meta_needed and meta_create

It conflicts with the global variable in dir.c when make is built in
all-in-one mode.


To generate a diff of this commit:
cvs rdiff -u -r1.151 -r1.152 src/usr.bin/make/meta.c

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

Modified files:

Index: src/usr.bin/make/meta.c
diff -u src/usr.bin/make/meta.c:1.151 src/usr.bin/make/meta.c:1.152
--- src/usr.bin/make/meta.c:1.151	Sat Nov 28 10:25:45 2020
+++ src/usr.bin/make/meta.c	Sat Nov 28 10:28:53 2020
@@ -1,4 +1,4 @@
-/*  $NetBSD: meta.c,v 1.151 2020/11/28 10:25:45 rillig Exp $ */
+/*  $NetBSD: meta.c,v 1.152 2020/11/28 10:28:53 rillig Exp $ */
 
 /*
  * Implement 'meta' mode.
@@ -412,7 +412,7 @@ printCMDs(GNode *gn, FILE *fp)
  */
 static Boolean
 meta_needed(GNode *gn, const char *dname, const char *tname,
-	 char *objdir, Boolean verbose)
+	char *objdir_realpath, Boolean verbose)
 {
 struct cached_stat cst;
 
@@ -452,8 +452,8 @@ meta_needed(GNode *gn, const char *dname
 }
 
 /* make sure these are canonical */
-if (cached_realpath(dname, objdir))
-	dname = objdir;
+if (cached_realpath(dname, objdir_realpath))
+	dname = objdir_realpath;
 
 /* If we aren't in the object directory, don't create a meta file. */
 if (!metaCurdirOk && strcmp(curdir, dname) == 0) {
@@ -471,7 +471,7 @@ meta_create(BuildMon *pbm, GNode *gn)
 {
 FILE *fp;
 char buf[MAXPATHLEN];
-char objdir[MAXPATHLEN];
+char objdir_realpath[MAXPATHLEN];
 char **ptr;
 const char *dname;
 const char *tname;
@@ -484,10 +484,10 @@ meta_create(BuildMon *pbm, GNode *gn)
 dname = Var_Value(".OBJDIR", gn, _freeIt);
 tname = GNode_VarTarget(gn);
 
-/* if this succeeds objdir is realpath of dname */
-if (!meta_needed(gn, dname, tname, objdir, TRUE))
+/* if this succeeds objdir_realpath is realpath of dname */
+if (!meta_needed(gn, dname, tname, objdir_realpath, TRUE))
 	goto out;
-dname = objdir;
+dname = objdir_realpath;
 
 if (metaVerbose) {
 	char *mp;
@@ -513,7 +513,7 @@ meta_create(BuildMon *pbm, GNode *gn)
 	goto out;
 
 fname = meta_name(pbm->meta_fname, sizeof pbm->meta_fname,
-		  dname, tname, objdir);
+		  dname, tname, objdir_realpath);
 
 #ifdef DEBUG_META_MODE
 DEBUG1(META, "meta_create: %s\n", fname);



CVS commit: src/usr.bin/make

2020-11-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Nov 28 10:28:53 UTC 2020

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

Log Message:
make(1): rename parameter in meta_needed and meta_create

It conflicts with the global variable in dir.c when make is built in
all-in-one mode.


To generate a diff of this commit:
cvs rdiff -u -r1.151 -r1.152 src/usr.bin/make/meta.c

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



CVS commit: src/usr.bin/make

2020-11-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Nov 28 10:25:45 UTC 2020

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

Log Message:
make(1): fix local variable name in meta_create


To generate a diff of this commit:
cvs rdiff -u -r1.150 -r1.151 src/usr.bin/make/meta.c

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

Modified files:

Index: src/usr.bin/make/meta.c
diff -u src/usr.bin/make/meta.c:1.150 src/usr.bin/make/meta.c:1.151
--- src/usr.bin/make/meta.c:1.150	Fri Nov 27 08:18:14 2020
+++ src/usr.bin/make/meta.c	Sat Nov 28 10:25:45 2020
@@ -1,4 +1,4 @@
-/*  $NetBSD: meta.c,v 1.150 2020/11/27 08:18:14 rillig Exp $ */
+/*  $NetBSD: meta.c,v 1.151 2020/11/28 10:25:45 rillig Exp $ */
 
 /*
  * Implement 'meta' mode.
@@ -477,11 +477,11 @@ meta_create(BuildMon *pbm, GNode *gn)
 const char *tname;
 char *fname;
 const char *cp;
-void *objdir_freeIt;
+void *dname_freeIt;
 
 fp = NULL;
 
-dname = Var_Value(".OBJDIR", gn, _freeIt);
+dname = Var_Value(".OBJDIR", gn, _freeIt);
 tname = GNode_VarTarget(gn);
 
 /* if this succeeds objdir is realpath of dname */
@@ -548,7 +548,7 @@ meta_create(BuildMon *pbm, GNode *gn)
 	gn->type |= OP_SILENT;
 }
  out:
-bmake_free(objdir_freeIt);
+bmake_free(dname_freeIt);
 
 return fp;
 }



CVS commit: src/usr.bin/make

2020-11-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Nov 28 10:25:45 UTC 2020

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

Log Message:
make(1): fix local variable name in meta_create


To generate a diff of this commit:
cvs rdiff -u -r1.150 -r1.151 src/usr.bin/make/meta.c

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



  1   2   >