CVS commit: src/sys/arch/mips/mips
Module Name:src Committed By: skrll Date: Sat Aug 1 05:45:30 UTC 2020 Modified Files: src/sys/arch/mips/mips: spl.S Log Message: Trailing whitespace To generate a diff of this commit: cvs rdiff -u -r1.17 -r1.18 src/sys/arch/mips/mips/spl.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/mips/mips/spl.S diff -u src/sys/arch/mips/mips/spl.S:1.17 src/sys/arch/mips/mips/spl.S:1.18 --- src/sys/arch/mips/mips/spl.S:1.17 Fri Apr 12 21:12:21 2019 +++ src/sys/arch/mips/mips/spl.S Sat Aug 1 05:45:30 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: spl.S,v 1.17 2019/04/12 21:12:21 skrll Exp $ */ +/* $NetBSD: spl.S,v 1.18 2020/08/01 05:45:30 skrll Exp $ */ /*- * Copyright (c) 2009, 2010 The NetBSD Foundation, Inc. @@ -38,7 +38,7 @@ #include #include -RCSID("$NetBSD: spl.S,v 1.17 2019/04/12 21:12:21 skrll Exp $") +RCSID("$NetBSD: spl.S,v 1.18 2020/08/01 05:45:30 skrll Exp $") #include "assym.h" @@ -252,7 +252,7 @@ STATIC_XLEAF(_splsw_splhigh_noprof) PTR_L a3, L_CPU(MIPS_CURLWP) NOP_L # load delay INT_L v0, CPU_INFO_CPL(a3) # get current IPL from cpu_info - li a1, IPL_HIGH # + li a1, IPL_HIGH # beq v0, a1, 1f # don't do anything if IPL_HIGH nop # branch delay mfc0 v1, MIPS_COP_0_STATUS # fetch status register
CVS commit: src/sys/arch/mips/mips
Module Name:src Committed By: skrll Date: Sat Aug 1 05:45:30 UTC 2020 Modified Files: src/sys/arch/mips/mips: spl.S Log Message: Trailing whitespace To generate a diff of this commit: cvs rdiff -u -r1.17 -r1.18 src/sys/arch/mips/mips/spl.S 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/unit-tests
Module Name:src Committed By: rillig Date: Fri Jul 31 13:49:25 UTC 2020 Modified Files: src/usr.bin/make/unit-tests: moderrs.exp moderrs.mk Log Message: make(1): add test for parsing an incomplete :t modifier This looks a lot like undefined behavior, just like in :S and :C before. To generate a diff of this commit: cvs rdiff -u -r1.11 -r1.12 src/usr.bin/make/unit-tests/moderrs.exp cvs rdiff -u -r1.9 -r1.10 src/usr.bin/make/unit-tests/moderrs.mk 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
Module Name:src Committed By: rillig Date: Fri Jul 31 14:59:53 UTC 2020 Modified Files: src/usr.bin/make: var.c Log Message: make(1): mark unmodified part of ApplyModifiersState as constant To generate a diff of this commit: cvs rdiff -u -r1.367 -r1.368 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.367 src/usr.bin/make/var.c:1.368 --- src/usr.bin/make/var.c:1.367 Fri Jul 31 14:54:03 2020 +++ src/usr.bin/make/var.c Fri Jul 31 14:59:53 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: var.c,v 1.367 2020/07/31 14:54:03 rillig Exp $ */ +/* $NetBSD: var.c,v 1.368 2020/07/31 14:59:53 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -69,14 +69,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: var.c,v 1.367 2020/07/31 14:54:03 rillig Exp $"; +static char rcsid[] = "$NetBSD: var.c,v 1.368 2020/07/31 14:59:53 rillig Exp $"; #else #include #ifndef lint #if 0 static char sccsid[] = "@(#)var.c 8.3 (Berkeley) 3/19/94"; #else -__RCSID("$NetBSD: var.c,v 1.367 2020/07/31 14:54:03 rillig Exp $"); +__RCSID("$NetBSD: var.c,v 1.368 2020/07/31 14:59:53 rillig Exp $"); #endif #endif /* not lint */ #endif @@ -2045,11 +2045,11 @@ VarStrftime(const char *fmt, int zulu, t * On failure, many of them update st->missing_delim. */ typedef struct { -int startc; /* '\0' or '{' or '(' */ -int endc; -Var *v; -GNode *ctxt; -VarEvalFlags eflags; +const int startc; /* '\0' or '{' or '(' */ +const int endc; +Var * const v; +GNode * const ctxt; +const VarEvalFlags eflags; char *val; /* The value of the expression before the * modifier is applied */
CVS commit: src/usr.bin/make
Module Name:src Committed By: rillig Date: Fri Jul 31 14:59:53 UTC 2020 Modified Files: src/usr.bin/make: var.c Log Message: make(1): mark unmodified part of ApplyModifiersState as constant To generate a diff of this commit: cvs rdiff -u -r1.367 -r1.368 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
Module Name:src Committed By: rillig Date: Fri Jul 31 13:30:09 UTC 2020 Modified Files: src/usr.bin/make: var.c src/usr.bin/make/unit-tests: moderrs.exp moderrs.mk Log Message: make(1): fix undefined behavior when parsing malformed :C modifier Same as in the :S modifier. To generate a diff of this commit: cvs rdiff -u -r1.359 -r1.360 src/usr.bin/make/var.c cvs rdiff -u -r1.10 -r1.11 src/usr.bin/make/unit-tests/moderrs.exp cvs rdiff -u -r1.8 -r1.9 src/usr.bin/make/unit-tests/moderrs.mk Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/make/var.c diff -u src/usr.bin/make/var.c:1.359 src/usr.bin/make/var.c:1.360 --- src/usr.bin/make/var.c:1.359 Fri Jul 31 07:29:21 2020 +++ src/usr.bin/make/var.c Fri Jul 31 13:30:09 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: var.c,v 1.359 2020/07/31 07:29:21 rillig Exp $ */ +/* $NetBSD: var.c,v 1.360 2020/07/31 13:30:09 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -69,14 +69,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: var.c,v 1.359 2020/07/31 07:29:21 rillig Exp $"; +static char rcsid[] = "$NetBSD: var.c,v 1.360 2020/07/31 13:30:09 rillig Exp $"; #else #include #ifndef lint #if 0 static char sccsid[] = "@(#)var.c 8.3 (Berkeley) 3/19/94"; #else -__RCSID("$NetBSD: var.c,v 1.359 2020/07/31 07:29:21 rillig Exp $"); +__RCSID("$NetBSD: var.c,v 1.360 2020/07/31 13:30:09 rillig Exp $"); #endif #endif /* not lint */ #endif @@ -2468,6 +2468,11 @@ ApplyModifier_Regex(const char *mod, App args.pflags = 0; Boolean oneBigWord = st->oneBigWord; char delim = mod[1]; +if (delim == '\0') { + Error("Missing delimiter for :C modifier"); + st->next = mod + 1; + return AMR_CLEANUP; +} st->next = mod + 2; Index: src/usr.bin/make/unit-tests/moderrs.exp diff -u src/usr.bin/make/unit-tests/moderrs.exp:1.10 src/usr.bin/make/unit-tests/moderrs.exp:1.11 --- src/usr.bin/make/unit-tests/moderrs.exp:1.10 Fri Jul 31 07:29:21 2020 +++ src/usr.bin/make/unit-tests/moderrs.exp Fri Jul 31 13:30:09 2020 @@ -63,9 +63,8 @@ make: Unclosed variable specification (e TheVariable TheVariable mod-regex-delimiter: -make: RE substitution error: (details omitted) -make: Unclosed substitution for VAR (, missing) -echo +make: Missing delimiter for :C modifier + make: Unclosed substitution for VAR (, missing) make: Unclosed substitution for VAR (, missing) @@ -77,7 +76,7 @@ make: Unclosed substitution for VAR (, m make: Unclosed variable specification (expecting '}') for "VAR" (value "TheVariable") modifier C TheVariable TheVariable -make: RE substitution error: (details omitted) +make: Missing delimiter for :C modifier 1: make: Unclosed substitution for VAR (, missing) 2: Index: src/usr.bin/make/unit-tests/moderrs.mk diff -u src/usr.bin/make/unit-tests/moderrs.mk:1.8 src/usr.bin/make/unit-tests/moderrs.mk:1.9 --- src/usr.bin/make/unit-tests/moderrs.mk:1.8 Wed Jul 29 20:33:38 2020 +++ src/usr.bin/make/unit-tests/moderrs.mk Fri Jul 31 13:30:09 2020 @@ -1,4 +1,4 @@ -# $Id: moderrs.mk,v 1.8 2020/07/29 20:33:38 rillig Exp $ +# $Id: moderrs.mk,v 1.9 2020/07/31 13:30:09 rillig Exp $ # # various modifier error tests @@ -109,7 +109,6 @@ mod-subst-delimiter: @echo ${VAR:S,from,to, @echo ${VAR:S,from,to,} -# XXX: Where does the "echo" in the output of "${VAR:C" come from? mod-regex-delimiter: @echo $@: @echo ${VAR:C
CVS commit: src/usr.bin/make
Module Name:src Committed By: rillig Date: Fri Jul 31 13:30:09 UTC 2020 Modified Files: src/usr.bin/make: var.c src/usr.bin/make/unit-tests: moderrs.exp moderrs.mk Log Message: make(1): fix undefined behavior when parsing malformed :C modifier Same as in the :S modifier. To generate a diff of this commit: cvs rdiff -u -r1.359 -r1.360 src/usr.bin/make/var.c cvs rdiff -u -r1.10 -r1.11 src/usr.bin/make/unit-tests/moderrs.exp cvs rdiff -u -r1.8 -r1.9 src/usr.bin/make/unit-tests/moderrs.mk 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
Module Name:src Committed By: rillig Date: Fri Jul 31 13:39:15 UTC 2020 Modified Files: src/usr.bin/make: var.c Log Message: make(1): reduce scope of local variables in ApplyModifier_Regex To generate a diff of this commit: cvs rdiff -u -r1.360 -r1.361 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.360 src/usr.bin/make/var.c:1.361 --- src/usr.bin/make/var.c:1.360 Fri Jul 31 13:30:09 2020 +++ src/usr.bin/make/var.c Fri Jul 31 13:39:15 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: var.c,v 1.360 2020/07/31 13:30:09 rillig Exp $ */ +/* $NetBSD: var.c,v 1.361 2020/07/31 13:39:15 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -69,14 +69,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: var.c,v 1.360 2020/07/31 13:30:09 rillig Exp $"; +static char rcsid[] = "$NetBSD: var.c,v 1.361 2020/07/31 13:39:15 rillig Exp $"; #else #include #ifndef lint #if 0 static char sccsid[] = "@(#)var.c 8.3 (Berkeley) 3/19/94"; #else -__RCSID("$NetBSD: var.c,v 1.360 2020/07/31 13:30:09 rillig Exp $"); +__RCSID("$NetBSD: var.c,v 1.361 2020/07/31 13:39:15 rillig Exp $"); #endif #endif /* not lint */ #endif @@ -2463,10 +2463,6 @@ ApplyModifier_Subst(const char * const m static ApplyModifierResult ApplyModifier_Regex(const char *mod, ApplyModifiersState *st) { -ModifyWord_SubstRegexArgs args; - -args.pflags = 0; -Boolean oneBigWord = st->oneBigWord; char delim = mod[1]; if (delim == '\0') { Error("Missing delimiter for :C modifier"); @@ -2483,6 +2479,7 @@ ApplyModifier_Regex(const char *mod, App return AMR_CLEANUP; } +ModifyWord_SubstRegexArgs args; args.replace = ParseModifierPart(>next, delim, st->eflags, st->ctxt, NULL, NULL, NULL); if (args.replace == NULL) { @@ -2491,6 +2488,8 @@ ApplyModifier_Regex(const char *mod, App return AMR_CLEANUP; } +args.pflags = 0; +Boolean oneBigWord = st->oneBigWord; for (;; st->next++) { switch (*st->next) { case 'g':
CVS commit: src/usr.bin/make
Module Name:src Committed By: rillig Date: Fri Jul 31 13:39:15 UTC 2020 Modified Files: src/usr.bin/make: var.c Log Message: make(1): reduce scope of local variables in ApplyModifier_Regex To generate a diff of this commit: cvs rdiff -u -r1.360 -r1.361 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
Module Name:src Committed By: rillig Date: Fri Jul 31 13:56:19 UTC 2020 Modified Files: src/usr.bin/make: var.c Log Message: make(1): fix undefined behavior when parsing incomplete :t modifier mod[2] must only ever be accessed if mod[1] != '\0'. To generate a diff of this commit: cvs rdiff -u -r1.362 -r1.363 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
Module Name:src Committed By: rillig Date: Fri Jul 31 13:56:19 UTC 2020 Modified Files: src/usr.bin/make: var.c Log Message: make(1): fix undefined behavior when parsing incomplete :t modifier mod[2] must only ever be accessed if mod[1] != '\0'. To generate a diff of this commit: cvs rdiff -u -r1.362 -r1.363 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.362 src/usr.bin/make/var.c:1.363 --- src/usr.bin/make/var.c:1.362 Fri Jul 31 13:43:44 2020 +++ src/usr.bin/make/var.c Fri Jul 31 13:56:19 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: var.c,v 1.362 2020/07/31 13:43:44 rillig Exp $ */ +/* $NetBSD: var.c,v 1.363 2020/07/31 13:56:19 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -69,14 +69,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: var.c,v 1.362 2020/07/31 13:43:44 rillig Exp $"; +static char rcsid[] = "$NetBSD: var.c,v 1.363 2020/07/31 13:56:19 rillig Exp $"; #else #include #ifndef lint #if 0 static char sccsid[] = "@(#)var.c 8.3 (Berkeley) 3/19/94"; #else -__RCSID("$NetBSD: var.c,v 1.362 2020/07/31 13:43:44 rillig Exp $"); +__RCSID("$NetBSD: var.c,v 1.363 2020/07/31 13:56:19 rillig Exp $"); #endif #endif /* not lint */ #endif @@ -2585,8 +2585,10 @@ ApplyModifier_ToSep(const char *sep, App static ApplyModifierResult ApplyModifier_To(const char *mod, ApplyModifiersState *st) { +assert(mod[0] == 't'); + st->next = mod + 1; /* make sure it is set */ -if (mod[1] == st->endc || mod[1] == ':') +if (mod[1] == st->endc || mod[1] == ':' || mod[1] == '\0') return AMR_BAD; /* Found ":t" or ":t:". */ if (mod[1] == 's')
CVS commit: src/usr.bin/make
Module Name:src Committed By: rillig Date: Fri Jul 31 14:11:21 UTC 2020 Modified Files: src/usr.bin/make: var.c Log Message: make(1): remove some redundant parentheses To generate a diff of this commit: cvs rdiff -u -r1.364 -r1.365 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.364 src/usr.bin/make/var.c:1.365 --- src/usr.bin/make/var.c:1.364 Fri Jul 31 14:07:21 2020 +++ src/usr.bin/make/var.c Fri Jul 31 14:11:21 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: var.c,v 1.364 2020/07/31 14:07:21 rillig Exp $ */ +/* $NetBSD: var.c,v 1.365 2020/07/31 14:11:21 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -69,14 +69,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: var.c,v 1.364 2020/07/31 14:07:21 rillig Exp $"; +static char rcsid[] = "$NetBSD: var.c,v 1.365 2020/07/31 14:11:21 rillig Exp $"; #else #include #ifndef lint #if 0 static char sccsid[] = "@(#)var.c 8.3 (Berkeley) 3/19/94"; #else -__RCSID("$NetBSD: var.c,v 1.364 2020/07/31 14:07:21 rillig Exp $"); +__RCSID("$NetBSD: var.c,v 1.365 2020/07/31 14:11:21 rillig Exp $"); #endif #endif /* not lint */ #endif @@ -536,7 +536,7 @@ Var_Export1(const char *name, VarExportF * No point actually exporting it now though, * the child can do it at the last minute. */ - v->flags |= (VAR_EXPORTED | VAR_REEXPORT); + v->flags |= VAR_EXPORTED | VAR_REEXPORT; return 1; } if (v->flags & VAR_IN_USE) { @@ -706,7 +706,7 @@ Var_UnExport(char *str) vlist = NULL; str += strlen("unexport"); -unexport_env = (strncmp(str, "-env", 4) == 0); +unexport_env = strncmp(str, "-env", 4) == 0; if (unexport_env) { char **newenv; @@ -1868,7 +1868,7 @@ ParseModifierPart(const char **tstr, int * It will be interpreted later. */ int have = *cp2; - int want = (*cp2 == PROPEN) ? PRCLOSE : BRCLOSE; + int want = *cp2 == PROPEN ? PRCLOSE : BRCLOSE; int depth = 1; for (++cp2; *cp2 != '\0' && depth > 0; ++cp2) { @@ -2137,9 +2137,9 @@ ApplyModifier_Defined(const char *mod, A if (st->eflags & VARE_WANTRES) { Boolean wantres; if (*mod == 'U') - wantres = ((st->v->flags & VAR_JUNK) != 0); + wantres = (st->v->flags & VAR_JUNK) != 0; else - wantres = ((st->v->flags & VAR_JUNK) == 0); + wantres = (st->v->flags & VAR_JUNK) == 0; neflags = st->eflags & ~VARE_WANTRES; if (wantres) neflags |= VARE_WANTRES;
CVS commit: src/usr.bin/make
Module Name:src Committed By: rillig Date: Fri Jul 31 14:11:21 UTC 2020 Modified Files: src/usr.bin/make: var.c Log Message: make(1): remove some redundant parentheses To generate a diff of this commit: cvs rdiff -u -r1.364 -r1.365 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
Module Name:src Committed By: rillig Date: Fri Jul 31 14:26:22 UTC 2020 Modified Files: src/usr.bin/make: var.c Log Message: make(1): clean up Var_Parse If *freePtr is not NULL, it only makes sense to free that pointer and not a semmingly unrelated variable. To generate a diff of this commit: cvs rdiff -u -r1.365 -r1.366 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.365 src/usr.bin/make/var.c:1.366 --- src/usr.bin/make/var.c:1.365 Fri Jul 31 14:11:21 2020 +++ src/usr.bin/make/var.c Fri Jul 31 14:26:22 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: var.c,v 1.365 2020/07/31 14:11:21 rillig Exp $ */ +/* $NetBSD: var.c,v 1.366 2020/07/31 14:26:22 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -69,14 +69,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: var.c,v 1.365 2020/07/31 14:11:21 rillig Exp $"; +static char rcsid[] = "$NetBSD: var.c,v 1.366 2020/07/31 14:26:22 rillig Exp $"; #else #include #ifndef lint #if 0 static char sccsid[] = "@(#)var.c 8.3 (Berkeley) 3/19/94"; #else -__RCSID("$NetBSD: var.c,v 1.365 2020/07/31 14:11:21 rillig Exp $"); +__RCSID("$NetBSD: var.c,v 1.366 2020/07/31 14:26:22 rillig Exp $"); #endif #endif /* not lint */ #endif @@ -3642,18 +3642,15 @@ Var_Parse(const char * const str, GNode *lengthPtr = tstr - str + (*tstr ? 1 : 0); if (v->flags & VAR_FROM_ENV) { - Boolean destroy = FALSE; - - if (nstr != Buf_GetAll(>val, NULL)) { - destroy = TRUE; - } else { + Boolean destroy = nstr != Buf_GetAll(>val, NULL); + if (!destroy) { /* * Returning the value unmodified, so tell the caller to free * the thing. */ *freePtr = nstr; } - VarFreeEnv(v, destroy); + (void)VarFreeEnv(v, destroy); } else if (v->flags & VAR_JUNK) { /* * Perform any free'ing needed and set *freePtr to NULL so the caller @@ -3661,8 +3658,8 @@ Var_Parse(const char * const str, GNode * If VAR_KEEP is also set then we want to keep str(?) as is. */ if (!(v->flags & VAR_KEEP)) { - if (*freePtr) { - free(nstr); + if (*freePtr != NULL) { + free(*freePtr); *freePtr = NULL; } if (dynamic) {
CVS commit: src/usr.bin/make
Module Name:src Committed By: rillig Date: Fri Jul 31 14:26:22 UTC 2020 Modified Files: src/usr.bin/make: var.c Log Message: make(1): clean up Var_Parse If *freePtr is not NULL, it only makes sense to free that pointer and not a semmingly unrelated variable. To generate a diff of this commit: cvs rdiff -u -r1.365 -r1.366 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/unit-tests
Module Name:src Committed By: rillig Date: Fri Jul 31 15:16:05 UTC 2020 Modified Files: src/usr.bin/make/unit-tests: moderrs.mk Log Message: make(1): remove outdated comment from unit test It had indeed been undefined behavior and was fixed in var.c r1.359 today in the morning. To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/usr.bin/make/unit-tests/moderrs.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/moderrs.mk diff -u src/usr.bin/make/unit-tests/moderrs.mk:1.10 src/usr.bin/make/unit-tests/moderrs.mk:1.11 --- src/usr.bin/make/unit-tests/moderrs.mk:1.10 Fri Jul 31 13:49:25 2020 +++ src/usr.bin/make/unit-tests/moderrs.mk Fri Jul 31 15:16:05 2020 @@ -1,4 +1,4 @@ -# $Id: moderrs.mk,v 1.10 2020/07/31 13:49:25 rillig Exp $ +# $Id: moderrs.mk,v 1.11 2020/07/31 15:16:05 rillig Exp $ # # various modifier error tests @@ -90,8 +90,6 @@ modexclam: # and the above would have produced an "Unknown modifier '!'". @echo ${!:L:!=exclam} -# XXX: For "${VAR:S", I wonder where the "(@ missing)" comes from. -# This could be undefined behavior, but it's reproducible. mod-subst-delimiter: @echo $@: @echo ${VAR:S
CVS commit: src/usr.bin/make/unit-tests
Module Name:src Committed By: rillig Date: Fri Jul 31 15:16:05 UTC 2020 Modified Files: src/usr.bin/make/unit-tests: moderrs.mk Log Message: make(1): remove outdated comment from unit test It had indeed been undefined behavior and was fixed in var.c r1.359 today in the morning. To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/usr.bin/make/unit-tests/moderrs.mk 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
Module Name:src Committed By: rillig Date: Fri Jul 31 13:43:44 UTC 2020 Modified Files: src/usr.bin/make: var.c Log Message: make(1): reduce scope of local variables in ApplyModifier_Subst To generate a diff of this commit: cvs rdiff -u -r1.361 -r1.362 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.361 src/usr.bin/make/var.c:1.362 --- src/usr.bin/make/var.c:1.361 Fri Jul 31 13:39:15 2020 +++ src/usr.bin/make/var.c Fri Jul 31 13:43:44 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: var.c,v 1.361 2020/07/31 13:39:15 rillig Exp $ */ +/* $NetBSD: var.c,v 1.362 2020/07/31 13:43:44 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -69,14 +69,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: var.c,v 1.361 2020/07/31 13:39:15 rillig Exp $"; +static char rcsid[] = "$NetBSD: var.c,v 1.362 2020/07/31 13:43:44 rillig Exp $"; #else #include #ifndef lint #if 0 static char sccsid[] = "@(#)var.c 8.3 (Berkeley) 3/19/94"; #else -__RCSID("$NetBSD: var.c,v 1.361 2020/07/31 13:39:15 rillig Exp $"); +__RCSID("$NetBSD: var.c,v 1.362 2020/07/31 13:43:44 rillig Exp $"); #endif #endif /* not lint */ #endif @@ -2392,8 +2392,6 @@ ApplyModifier_Match(const char *mod, App static ApplyModifierResult ApplyModifier_Subst(const char * const mod, ApplyModifiersState *st) { -ModifyWord_SubstArgs args; -Boolean oneBigWord = st->oneBigWord; char delim = mod[1]; if (delim == '\0') { Error("Missing delimiter for :S modifier"); @@ -2403,11 +2401,13 @@ ApplyModifier_Subst(const char * const m st->next = mod + 2; +ModifyWord_SubstArgs args; +args.pflags = 0; + /* * If pattern begins with '^', it is anchored to the * start of the word -- skip over it and flag pattern. */ -args.pflags = 0; if (*st->next == '^') { args.pflags |= VARP_ANCHOR_START; st->next++; @@ -2429,11 +2429,7 @@ ApplyModifier_Subst(const char * const m } args.rhs = rhs; -/* - * Check for global substitution. If 'g' after the final - * delimiter, substitution is global and is marked that - * way. - */ +Boolean oneBigWord = st->oneBigWord; for (;; st->next++) { switch (*st->next) { case 'g':
CVS commit: src/usr.bin/make
Module Name:src Committed By: rillig Date: Fri Jul 31 13:43:44 UTC 2020 Modified Files: src/usr.bin/make: var.c Log Message: make(1): reduce scope of local variables in ApplyModifier_Subst To generate a diff of this commit: cvs rdiff -u -r1.361 -r1.362 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/unit-tests
Module Name:src Committed By: rillig Date: Fri Jul 31 14:36:58 UTC 2020 Modified Files: src/usr.bin/make/unit-tests: modmisc.exp modmisc.mk Log Message: make(1): add test for chaining the :S modifier without colon To generate a diff of this commit: cvs rdiff -u -r1.32 -r1.33 src/usr.bin/make/unit-tests/modmisc.exp cvs rdiff -u -r1.29 -r1.30 src/usr.bin/make/unit-tests/modmisc.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/modmisc.exp diff -u src/usr.bin/make/unit-tests/modmisc.exp:1.32 src/usr.bin/make/unit-tests/modmisc.exp:1.33 --- src/usr.bin/make/unit-tests/modmisc.exp:1.32 Wed Jul 29 21:35:35 2020 +++ src/usr.bin/make/unit-tests/modmisc.exp Fri Jul 31 14:36:58 2020 @@ -24,6 +24,8 @@ mod-subst: :a c: :x__ 3 x__ 3: 12345 +mod-subst-chain: +A B c. mod-regex: :a b b c: :a b b c: Index: src/usr.bin/make/unit-tests/modmisc.mk diff -u src/usr.bin/make/unit-tests/modmisc.mk:1.29 src/usr.bin/make/unit-tests/modmisc.mk:1.30 --- src/usr.bin/make/unit-tests/modmisc.mk:1.29 Wed Jul 29 21:35:35 2020 +++ src/usr.bin/make/unit-tests/modmisc.mk Fri Jul 31 14:36:58 2020 @@ -1,4 +1,4 @@ -# $Id: modmisc.mk,v 1.29 2020/07/29 21:35:35 rillig Exp $ +# $Id: modmisc.mk,v 1.30 2020/07/31 14:36:58 rillig Exp $ # # miscellaneous modifier tests @@ -17,6 +17,7 @@ MOD_SEP=S,:, ,g all: modvar modvarloop modsysv mod-HTE emptyvar undefvar all: mod-subst +all: mod-subst-chain all: mod-regex all: mod-loop-varname mod-loop-resolve mod-loop-varname-dollar all: mod-subst-dollar mod-loop-dollar @@ -136,6 +137,18 @@ mod-subst: @echo :${:U1 2 3 1 2 3:S,1 2,___,Wg:S,_,x,:Q}: @echo ${:U12345:S,,sep,g:Q} +# The :S and :C modifiers can be chained without a separating ':'. +# This is not documented in the manual page. +# It works because ApplyModifier_Subst scans for the known modifiers g1W +# and then just returns to ApplyModifiers. There, the colon is optionally +# skipped (see the *st.next == ':' at the end of the loop). +# +# Most other modifiers cannot be chained since their parsers skip until +# the next ':' or '}' or ')'. +mod-subst-chain: + @echo $@: + @echo ${:Ua b c:S,a,A,S,b,B,}. + mod-regex: @echo $@: @echo :${:Ua b b c:C,a b,,:Q}:
CVS commit: src/usr.bin/make/unit-tests
Module Name:src Committed By: rillig Date: Fri Jul 31 14:36:58 UTC 2020 Modified Files: src/usr.bin/make/unit-tests: modmisc.exp modmisc.mk Log Message: make(1): add test for chaining the :S modifier without colon To generate a diff of this commit: cvs rdiff -u -r1.32 -r1.33 src/usr.bin/make/unit-tests/modmisc.exp cvs rdiff -u -r1.29 -r1.30 src/usr.bin/make/unit-tests/modmisc.mk 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/unit-tests
Module Name:src Committed By: rillig Date: Fri Jul 31 13:49:25 UTC 2020 Modified Files: src/usr.bin/make/unit-tests: moderrs.exp moderrs.mk Log Message: make(1): add test for parsing an incomplete :t modifier This looks a lot like undefined behavior, just like in :S and :C before. To generate a diff of this commit: cvs rdiff -u -r1.11 -r1.12 src/usr.bin/make/unit-tests/moderrs.exp cvs rdiff -u -r1.9 -r1.10 src/usr.bin/make/unit-tests/moderrs.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/moderrs.exp diff -u src/usr.bin/make/unit-tests/moderrs.exp:1.11 src/usr.bin/make/unit-tests/moderrs.exp:1.12 --- src/usr.bin/make/unit-tests/moderrs.exp:1.11 Fri Jul 31 13:30:09 2020 +++ src/usr.bin/make/unit-tests/moderrs.exp Fri Jul 31 13:49:25 2020 @@ -97,6 +97,8 @@ make: Bad modifier `:ts\65oct' for FIB make: Bad modifier `:tsxy' for FIB xy} mod-t-parse: +make: Bad modifier `:t' for FIB + make: Bad modifier `:txy' for FIB y} make: Bad modifier `:t' for FIB Index: src/usr.bin/make/unit-tests/moderrs.mk diff -u src/usr.bin/make/unit-tests/moderrs.mk:1.9 src/usr.bin/make/unit-tests/moderrs.mk:1.10 --- src/usr.bin/make/unit-tests/moderrs.mk:1.9 Fri Jul 31 13:30:09 2020 +++ src/usr.bin/make/unit-tests/moderrs.mk Fri Jul 31 13:49:25 2020 @@ -1,4 +1,4 @@ -# $Id: moderrs.mk,v 1.9 2020/07/31 13:30:09 rillig Exp $ +# $Id: moderrs.mk,v 1.10 2020/07/31 13:49:25 rillig Exp $ # # various modifier error tests @@ -135,6 +135,7 @@ mod-ts-parse: mod-t-parse: @echo $@: + @echo ${FIB:t @echo ${FIB:txy} @echo ${FIB:t} @echo ${FIB:t:M*}
CVS commit: src/usr.bin/make
Module Name:src Committed By: rillig Date: Fri Jul 31 14:07:21 UTC 2020 Modified Files: src/usr.bin/make: var.c Log Message: make(1): omit unnecessary memory writes in :tu and :tl modifiers To generate a diff of this commit: cvs rdiff -u -r1.363 -r1.364 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.363 src/usr.bin/make/var.c:1.364 --- src/usr.bin/make/var.c:1.363 Fri Jul 31 13:56:19 2020 +++ src/usr.bin/make/var.c Fri Jul 31 14:07:21 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: var.c,v 1.363 2020/07/31 13:56:19 rillig Exp $ */ +/* $NetBSD: var.c,v 1.364 2020/07/31 14:07:21 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -69,14 +69,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: var.c,v 1.363 2020/07/31 13:56:19 rillig Exp $"; +static char rcsid[] = "$NetBSD: var.c,v 1.364 2020/07/31 14:07:21 rillig Exp $"; #else #include #ifndef lint #if 0 static char sccsid[] = "@(#)var.c 8.3 (Berkeley) 3/19/94"; #else -__RCSID("$NetBSD: var.c,v 1.363 2020/07/31 13:56:19 rillig Exp $"); +__RCSID("$NetBSD: var.c,v 1.364 2020/07/31 14:07:21 rillig Exp $"); #endif #endif /* not lint */ #endif @@ -2603,14 +2603,18 @@ ApplyModifier_To(const char *mod, ApplyM ModifyWord_Realpath, NULL); st->next = mod + 2; } else if (mod[1] == 'u') { - char *dp = bmake_strdup(st->val); - for (st->newVal = dp; *dp; dp++) - *dp = toupper((unsigned char)*dp); + size_t len = strlen(st->val); + st->newVal = bmake_malloc(len + 1); + size_t i; + for (i = 0; i < len + 1; i++) + st->newVal[i] = toupper((unsigned char)st->val[i]); st->next = mod + 2; } else if (mod[1] == 'l') { - char *dp = bmake_strdup(st->val); - for (st->newVal = dp; *dp; dp++) - *dp = tolower((unsigned char)*dp); + size_t len = strlen(st->val); + st->newVal = bmake_malloc(len + 1); + size_t i; + for (i = 0; i < len + 1; i++) + st->newVal[i] = tolower((unsigned char)st->val[i]); st->next = mod + 2; } else if (mod[1] == 'W' || mod[1] == 'w') { st->oneBigWord = mod[1] == 'W';
CVS commit: src/usr.bin/make
Module Name:src Committed By: rillig Date: Fri Jul 31 14:07:21 UTC 2020 Modified Files: src/usr.bin/make: var.c Log Message: make(1): omit unnecessary memory writes in :tu and :tl modifiers To generate a diff of this commit: cvs rdiff -u -r1.363 -r1.364 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
Module Name:src Committed By: rillig Date: Fri Jul 31 14:54:03 UTC 2020 Modified Files: src/usr.bin/make: var.c Log Message: make(1): reduce number of parameters to ApplyModifiers This saves a call to strlen and some arithmetic operations. To generate a diff of this commit: cvs rdiff -u -r1.366 -r1.367 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
Module Name:src Committed By: rillig Date: Fri Jul 31 14:54:03 UTC 2020 Modified Files: src/usr.bin/make: var.c Log Message: make(1): reduce number of parameters to ApplyModifiers This saves a call to strlen and some arithmetic operations. To generate a diff of this commit: cvs rdiff -u -r1.366 -r1.367 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.366 src/usr.bin/make/var.c:1.367 --- src/usr.bin/make/var.c:1.366 Fri Jul 31 14:26:22 2020 +++ src/usr.bin/make/var.c Fri Jul 31 14:54:03 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: var.c,v 1.366 2020/07/31 14:26:22 rillig Exp $ */ +/* $NetBSD: var.c,v 1.367 2020/07/31 14:54:03 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -69,14 +69,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: var.c,v 1.366 2020/07/31 14:26:22 rillig Exp $"; +static char rcsid[] = "$NetBSD: var.c,v 1.367 2020/07/31 14:54:03 rillig Exp $"; #else #include #ifndef lint #if 0 static char sccsid[] = "@(#)var.c 8.3 (Berkeley) 3/19/94"; #else -__RCSID("$NetBSD: var.c,v 1.366 2020/07/31 14:26:22 rillig Exp $"); +__RCSID("$NetBSD: var.c,v 1.367 2020/07/31 14:54:03 rillig Exp $"); #endif #endif /* not lint */ #endif @@ -3062,14 +3062,13 @@ ApplyModifier_SysV(const char *mod, Appl */ static char * ApplyModifiers( +const char **pp, /* the parsing position, updated upon return */ char *val, /* the current value of the variable */ -const char * const tstr, /* the string to be parsed */ int const startc, /* '(' or '{' or '\0' */ int const endc, /* ')' or '}' or '\0' */ Var * const v, /* the variable may have its flags changed */ GNode * const ctxt, /* for looking up and modifying variables */ VarEvalFlags const eflags, -int * const lengthPtr, /* returns the number of skipped bytes */ void ** const freePtr /* free this after using the return value */ ) { assert(startc == '(' || startc == '{' || startc == '\0'); @@ -3080,7 +3079,7 @@ ApplyModifiers( val, NULL, NULL, '\0', ' ', FALSE }; -const char *p = tstr; +const char *p = *pp; while (*p != '\0' && *p != endc) { if (*p == '$') { @@ -3112,13 +3111,12 @@ ApplyModifiers( p += rlen; if (rval != NULL && *rval) { - int used; - - st.val = ApplyModifiers(st.val, rval, 0, 0, st.v, - st.ctxt, st.eflags, , freePtr); + const char *rval_pp = rval; + st.val = ApplyModifiers(_pp, st.val, 0, 0, v, + ctxt, eflags, freePtr); if (st.val == var_Error || (st.val == varNoError && (st.eflags & VARE_UNDEFERR) == 0) - || strlen(rval) != (size_t) used) { + || *rval_pp != '\0') { free(freeIt); goto out; /* error already reported */ } @@ -3320,7 +3318,7 @@ ApplyModifiers( p = st.next; } out: -*lengthPtr = p - tstr; +*pp = p; return st.val; bad_modifier: @@ -3328,7 +3326,7 @@ bad_modifier: (int)strcspn(p, ":)}"), p, st.v->name); cleanup: -*lengthPtr = st.next - tstr; +*pp = st.next; if (st.missing_delim != '\0') Error("Unclosed substitution for %s (%c missing)", st.v->name, st.missing_delim); @@ -3619,21 +3617,20 @@ Var_Parse(const char * const str, GNode if (nstr != NULL && (haveModifier || extramodifiers != NULL)) { void *extraFree; - int used; extraFree = NULL; if (extramodifiers != NULL) { - nstr = ApplyModifiers(nstr, extramodifiers, '(', ')', - v, ctxt, eflags, , ); + const char *em = extramodifiers; + nstr = ApplyModifiers(, nstr, '(', ')', + v, ctxt, eflags, ); } if (haveModifier) { /* Skip initial colon. */ tstr++; - nstr = ApplyModifiers(nstr, tstr, startc, endc, - v, ctxt, eflags, , freePtr); - tstr += used; + nstr = ApplyModifiers(, nstr, startc, endc, + v, ctxt, eflags, freePtr); free(extraFree); } else { *freePtr = extraFree;
CVS commit: src/usr.bin/make
Module Name:src Committed By: rillig Date: Fri Jul 31 16:26:16 UTC 2020 Modified Files: src/usr.bin/make: arch.c Log Message: make(1): use snprintf instead of strncpy strncpy is not suited for string processing, despite its name. Even though the previous code used the correct code pattern for strncpy, it still wasted cycles since strncpy always fills the whole target buffer. That's not needed. To generate a diff of this commit: cvs rdiff -u -r1.77 -r1.78 src/usr.bin/make/arch.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.77 src/usr.bin/make/arch.c:1.78 --- src/usr.bin/make/arch.c:1.77 Tue Jul 28 16:42:22 2020 +++ src/usr.bin/make/arch.c Fri Jul 31 16:26:16 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: arch.c,v 1.77 2020/07/28 16:42:22 rillig Exp $ */ +/* $NetBSD: arch.c,v 1.78 2020/07/31 16:26:16 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -69,14 +69,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: arch.c,v 1.77 2020/07/28 16:42:22 rillig Exp $"; +static char rcsid[] = "$NetBSD: arch.c,v 1.78 2020/07/31 16:26:16 rillig Exp $"; #else #include #ifndef lint #if 0 static char sccsid[] = "@(#)arch.c 8.2 (Berkeley) 1/2/94"; #else -__RCSID("$NetBSD: arch.c,v 1.77 2020/07/28 16:42:22 rillig Exp $"); +__RCSID("$NetBSD: arch.c,v 1.78 2020/07/31 16:26:16 rillig Exp $"); #endif #endif /* not lint */ #endif @@ -562,8 +562,7 @@ ArchStatMember(const char *archive, cons if (len > AR_MAX_NAME_LEN) { len = AR_MAX_NAME_LEN; - strncpy(copy, member, AR_MAX_NAME_LEN); - copy[AR_MAX_NAME_LEN] = '\0'; + snprintf(copy, sizeof copy, "%s", member); } if ((he = Hash_FindEntry(>members, copy)) != NULL) return (struct ar_hdr *)Hash_GetValue(he); @@ -814,8 +813,7 @@ ArchSVR4Entry(Arch *ar, char *name, size fprintf(debug_file, "Replaced %s with %s\n", name, >fnametab[entry]); } -(void)strncpy(name, >fnametab[entry], MAXPATHLEN); -name[MAXPATHLEN] = '\0'; +snprintf(name, MAXPATHLEN + 1, "%s", >fnametab[entry]); return 1; } #endif
CVS commit: src/usr.bin/make
Module Name:src Committed By: rillig Date: Fri Jul 31 16:26:16 UTC 2020 Modified Files: src/usr.bin/make: arch.c Log Message: make(1): use snprintf instead of strncpy strncpy is not suited for string processing, despite its name. Even though the previous code used the correct code pattern for strncpy, it still wasted cycles since strncpy always fills the whole target buffer. That's not needed. To generate a diff of this commit: cvs rdiff -u -r1.77 -r1.78 src/usr.bin/make/arch.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src
Module Name:src Committed By: rillig Date: Fri Jul 31 16:42:51 UTC 2020 Modified Files: src/distrib/sets/lists/tests: mi src/usr.bin/make/unit-tests: Makefile Added Files: src/usr.bin/make/unit-tests: dir.exp dir.mk Log Message: make(1): add test for braces in dependency lines The comment at DirExpandCurly says something about "recursively", but the nested braces don't work. The manual page only mentions that "{} may be used", but it keeps quiet about the exact meaning and also doesn't mention any nesting. To generate a diff of this commit: cvs rdiff -u -r1.881 -r1.882 src/distrib/sets/lists/tests/mi cvs rdiff -u -r1.76 -r1.77 src/usr.bin/make/unit-tests/Makefile cvs rdiff -u -r0 -r1.1 src/usr.bin/make/unit-tests/dir.exp \ src/usr.bin/make/unit-tests/dir.mk Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src
Module Name:src Committed By: rillig Date: Fri Jul 31 16:42:51 UTC 2020 Modified Files: src/distrib/sets/lists/tests: mi src/usr.bin/make/unit-tests: Makefile Added Files: src/usr.bin/make/unit-tests: dir.exp dir.mk Log Message: make(1): add test for braces in dependency lines The comment at DirExpandCurly says something about "recursively", but the nested braces don't work. The manual page only mentions that "{} may be used", but it keeps quiet about the exact meaning and also doesn't mention any nesting. To generate a diff of this commit: cvs rdiff -u -r1.881 -r1.882 src/distrib/sets/lists/tests/mi cvs rdiff -u -r1.76 -r1.77 src/usr.bin/make/unit-tests/Makefile cvs rdiff -u -r0 -r1.1 src/usr.bin/make/unit-tests/dir.exp \ src/usr.bin/make/unit-tests/dir.mk Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/distrib/sets/lists/tests/mi diff -u src/distrib/sets/lists/tests/mi:1.881 src/distrib/sets/lists/tests/mi:1.882 --- src/distrib/sets/lists/tests/mi:1.881 Tue Jul 28 22:44:44 2020 +++ src/distrib/sets/lists/tests/mi Fri Jul 31 16:42:51 2020 @@ -1,4 +1,4 @@ -# $NetBSD: mi,v 1.881 2020/07/28 22:44:44 rillig Exp $ +# $NetBSD: mi,v 1.882 2020/07/31 16:42:51 rillig Exp $ # # Note: don't delete entries from here - mark them as "obsolete" instead. # @@ -4536,6 +4536,8 @@ ./usr/tests/usr.bin/make/unit-tests/cond1.mk tests-usr.bin-tests compattestfile,atf ./usr/tests/usr.bin/make/unit-tests/cond2.exp tests-usr.bin-tests compattestfile,atf ./usr/tests/usr.bin/make/unit-tests/cond2.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/dir.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/dir.mk tests-usr.bin-tests compattestfile,atf ./usr/tests/usr.bin/make/unit-tests/directives.exp tests-usr.bin-tests compattestfile,atf ./usr/tests/usr.bin/make/unit-tests/directives.mk tests-usr.bin-tests compattestfile,atf ./usr/tests/usr.bin/make/unit-tests/dollar.exp tests-usr.bin-tests compattestfile,atf Index: src/usr.bin/make/unit-tests/Makefile diff -u src/usr.bin/make/unit-tests/Makefile:1.76 src/usr.bin/make/unit-tests/Makefile:1.77 --- src/usr.bin/make/unit-tests/Makefile:1.76 Wed Jul 29 19:48:33 2020 +++ src/usr.bin/make/unit-tests/Makefile Fri Jul 31 16:42:51 2020 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.76 2020/07/29 19:48:33 rillig Exp $ +# $NetBSD: Makefile,v 1.77 2020/07/31 16:42:51 rillig Exp $ # # Unit tests for make(1) # @@ -37,6 +37,7 @@ TESTS+= cond-late TESTS+= cond-short TESTS+= cond1 TESTS+= cond2 +TESTS+= dir TESTS+= directives TESTS+= dollar TESTS+= doterror Added files: Index: src/usr.bin/make/unit-tests/dir.exp diff -u /dev/null src/usr.bin/make/unit-tests/dir.exp:1.1 --- /dev/null Fri Jul 31 16:42:51 2020 +++ src/usr.bin/make/unit-tests/dir.exp Fri Jul 31 16:42:51 2020 @@ -0,0 +1,11 @@ +make: Unterminated {} clause "thiteen" +1 +2 +3 +4 +5 +make: don't know how to make fouteen (continuing) +make: don't know how to make rteen (continuing) +15 +`all' not remade because of errors. +exit status 0 Index: src/usr.bin/make/unit-tests/dir.mk diff -u /dev/null src/usr.bin/make/unit-tests/dir.mk:1.1 --- /dev/null Fri Jul 31 16:42:51 2020 +++ src/usr.bin/make/unit-tests/dir.mk Fri Jul 31 16:42:51 2020 @@ -0,0 +1,33 @@ +# $NetBSD: dir.mk,v 1.1 2020/07/31 16:42:51 rillig Exp $ +# +# Tests for dir.c. + +# Dependency lines may use braces for expansion. +all: {one,two,three} + +one: + @echo 1 +two: + @echo 2 +three: + @echo 3 + +# The braces may start in the middle of a word. +all: f{our,ive} + +four: + @echo 4 +five: + @echo 5 +six: + @echo 6 + +# But nested braces don't work. +all: {{thi,fou}r,fif}teen + +thirteen: + @echo 13 +fourteen: + @echo 14 +fifteen: + @echo 15
CVS commit: src/doc
Module Name:src Committed By: maxv Date: Fri Jul 31 16:59:04 UTC 2020 Modified Files: src/doc: TODO.smpnet Log Message: BRIDGE_IPF is MP-safe, discussed with ozaki-r@ To generate a diff of this commit: cvs rdiff -u -r1.37 -r1.38 src/doc/TODO.smpnet Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/doc
Module Name:src Committed By: maxv Date: Fri Jul 31 16:59:04 UTC 2020 Modified Files: src/doc: TODO.smpnet Log Message: BRIDGE_IPF is MP-safe, discussed with ozaki-r@ To generate a diff of this commit: cvs rdiff -u -r1.37 -r1.38 src/doc/TODO.smpnet Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/doc/TODO.smpnet diff -u src/doc/TODO.smpnet:1.37 src/doc/TODO.smpnet:1.38 --- src/doc/TODO.smpnet:1.37 Sat May 23 18:42:17 2020 +++ src/doc/TODO.smpnet Fri Jul 31 16:59:04 2020 @@ -1,4 +1,4 @@ -$NetBSD: TODO.smpnet,v 1.37 2020/05/23 18:42:17 nia Exp $ +$NetBSD: TODO.smpnet,v 1.38 2020/07/31 16:59:04 maxv Exp $ MP-safe components == @@ -18,6 +18,7 @@ kernel option. Some components scale up - Ethernet (if_ethersubr.c) - bridge(4) - STP + - BRIDGE_IPF - Fast forward (ipflow) - Layer 3 - All except for items in the below section @@ -61,7 +62,6 @@ Unprotected ones - Layer 2 - ARCNET (if_arcsubr.c) - - BRIDGE_IPF - IEEE 1394 (if_ieee1394subr.c) - IEEE 802.11 (ieee80211(4)) - Layer 3
CVS commit: src/usr.bin/make
Module Name:src Committed By: rillig Date: Fri Jul 31 19:06:33 UTC 2020 Modified Files: src/usr.bin/make: dir.c src/usr.bin/make/unit-tests: dir.exp Log Message: make(1): fix parsing of nested braces in dependency lines Before, make could not parse {{thi,fou}r,fif}teen properly. It did correctly split up the outer brace into "" + "{thi,fou}r,fif" + "teen", but then, when expanding the inner braces, it interpreted the first comma already as a separator, even though this comma was enclosed in another set of braces. This resulted in the wrong expansion "{thiteen", which produced the error message. The next word "fouteen" was produced since the parser stopped at the next closing brace. After this, parsing continued after the closing brace, producing "rteen". Finally, the last expansion was the correct "fifteen". To generate a diff of this commit: cvs rdiff -u -r1.78 -r1.79 src/usr.bin/make/dir.c cvs rdiff -u -r1.1 -r1.2 src/usr.bin/make/unit-tests/dir.exp 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
Module Name:src Committed By: rillig Date: Fri Jul 31 16:59:35 UTC 2020 Modified Files: src/usr.bin/make: dir.c Log Message: make(1): prefer memcpy over strncpy in DirExpandCurly strncpy has unnecessary overhead when the source memory is already guaranteed to contain no '\0'. To generate a diff of this commit: cvs rdiff -u -r1.76 -r1.77 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
Module Name:src Committed By: rillig Date: Fri Jul 31 16:59:35 UTC 2020 Modified Files: src/usr.bin/make: dir.c Log Message: make(1): prefer memcpy over strncpy in DirExpandCurly strncpy has unnecessary overhead when the source memory is already guaranteed to contain no '\0'. To generate a diff of this commit: cvs rdiff -u -r1.76 -r1.77 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.76 src/usr.bin/make/dir.c:1.77 --- src/usr.bin/make/dir.c:1.76 Fri Jul 3 08:13:23 2020 +++ src/usr.bin/make/dir.c Fri Jul 31 16:59:34 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: dir.c,v 1.76 2020/07/03 08:13:23 rillig Exp $ */ +/* $NetBSD: dir.c,v 1.77 2020/07/31 16:59:34 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -70,14 +70,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: dir.c,v 1.76 2020/07/03 08:13:23 rillig Exp $"; +static char rcsid[] = "$NetBSD: dir.c,v 1.77 2020/07/31 16:59:34 rillig Exp $"; #else #include #ifndef lint #if 0 static char sccsid[] = "@(#)dir.c 8.2 (Berkeley) 1/2/94"; #else -__RCSID("$NetBSD: dir.c,v 1.76 2020/07/03 08:13:23 rillig Exp $"); +__RCSID("$NetBSD: dir.c,v 1.77 2020/07/31 16:59:34 rillig Exp $"); #endif #endif /* not lint */ #endif @@ -723,13 +723,16 @@ DirExpandCurly(const char *word, const c * Allocate room for the combination and install the three pieces. */ file = bmake_malloc(otherLen + cp - start + 1); + char *fileend = file; if (brace != word) { - strncpy(file, word, brace-word); + memcpy(file, word, brace - word); + fileend += brace - word; } if (cp != start) { - strncpy([brace-word], start, cp-start); + memcpy(fileend, start, cp - start); + fileend += cp - start; } - strcpy([(brace-word)+(cp-start)], end); + strcpy(fileend, end); /* * See if the result has any wildcards in it. If we find one, call
CVS commit: src/usr.bin/make
Module Name:src Committed By: rillig Date: Fri Jul 31 17:41:35 UTC 2020 Modified Files: src/usr.bin/make: dir.c Log Message: make(1): trying to understand how DirExpandCurly works To generate a diff of this commit: cvs rdiff -u -r1.77 -r1.78 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.77 src/usr.bin/make/dir.c:1.78 --- src/usr.bin/make/dir.c:1.77 Fri Jul 31 16:59:34 2020 +++ src/usr.bin/make/dir.c Fri Jul 31 17:41:35 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: dir.c,v 1.77 2020/07/31 16:59:34 rillig Exp $ */ +/* $NetBSD: dir.c,v 1.78 2020/07/31 17:41:35 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -70,14 +70,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: dir.c,v 1.77 2020/07/31 16:59:34 rillig Exp $"; +static char rcsid[] = "$NetBSD: dir.c,v 1.78 2020/07/31 17:41:35 rillig Exp $"; #else #include #ifndef lint #if 0 static char sccsid[] = "@(#)dir.c 8.2 (Berkeley) 1/2/94"; #else -__RCSID("$NetBSD: dir.c,v 1.77 2020/07/31 16:59:34 rillig Exp $"); +__RCSID("$NetBSD: dir.c,v 1.78 2020/07/31 17:41:35 rillig Exp $"); #endif #endif /* not lint */ #endif @@ -694,16 +694,20 @@ DirExpandCurly(const char *word, const c for (end = start, bracelevel = 0; *end != '\0'; end++) { if (*end == '{') { bracelevel++; - } else if ((*end == '}') && (bracelevel-- == 0)) { + } else if (*end == '}' && bracelevel-- == 0) { break; } } +if (DEBUG(DIR)) + fprintf(debug_file, "%s: word=\"%s\" start=\"%s\" end=\"%s\"\n", + __func__, word, start, end); + if (*end == '\0') { Error("Unterminated {} clause \"%s\"", start); return; -} else { - end++; } + +end++; otherLen = brace - word + strlen(end); for (cp = start; cp < end; cp++) { @@ -733,6 +737,10 @@ DirExpandCurly(const char *word, const c fileend += cp - start; } strcpy(fileend, end); + if (DEBUG(DIR)) + fprintf(debug_file, "%s: \"%.*s\" + \"%.*s\" + \"%s\" = \"%s\"\n", + __func__, (int)(brace - word), word, (int)(cp - start), start, + end, file); /* * See if the result has any wildcards in it. If we find one, call
CVS commit: src/usr.bin/make
Module Name:src Committed By: rillig Date: Fri Jul 31 17:41:35 UTC 2020 Modified Files: src/usr.bin/make: dir.c Log Message: make(1): trying to understand how DirExpandCurly works To generate a diff of this commit: cvs rdiff -u -r1.77 -r1.78 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
Module Name:src Committed By: rillig Date: Fri Jul 31 19:06:33 UTC 2020 Modified Files: src/usr.bin/make: dir.c src/usr.bin/make/unit-tests: dir.exp Log Message: make(1): fix parsing of nested braces in dependency lines Before, make could not parse {{thi,fou}r,fif}teen properly. It did correctly split up the outer brace into "" + "{thi,fou}r,fif" + "teen", but then, when expanding the inner braces, it interpreted the first comma already as a separator, even though this comma was enclosed in another set of braces. This resulted in the wrong expansion "{thiteen", which produced the error message. The next word "fouteen" was produced since the parser stopped at the next closing brace. After this, parsing continued after the closing brace, producing "rteen". Finally, the last expansion was the correct "fifteen". To generate a diff of this commit: cvs rdiff -u -r1.78 -r1.79 src/usr.bin/make/dir.c cvs rdiff -u -r1.1 -r1.2 src/usr.bin/make/unit-tests/dir.exp Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/make/dir.c diff -u src/usr.bin/make/dir.c:1.78 src/usr.bin/make/dir.c:1.79 --- src/usr.bin/make/dir.c:1.78 Fri Jul 31 17:41:35 2020 +++ src/usr.bin/make/dir.c Fri Jul 31 19:06:33 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: dir.c,v 1.78 2020/07/31 17:41:35 rillig Exp $ */ +/* $NetBSD: dir.c,v 1.79 2020/07/31 19:06:33 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -70,14 +70,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: dir.c,v 1.78 2020/07/31 17:41:35 rillig Exp $"; +static char rcsid[] = "$NetBSD: dir.c,v 1.79 2020/07/31 19:06:33 rillig Exp $"; #else #include #ifndef lint #if 0 static char sccsid[] = "@(#)dir.c 8.2 (Berkeley) 1/2/94"; #else -__RCSID("$NetBSD: dir.c,v 1.78 2020/07/31 17:41:35 rillig Exp $"); +__RCSID("$NetBSD: dir.c,v 1.79 2020/07/31 19:06:33 rillig Exp $"); #endif #endif /* not lint */ #endif @@ -715,12 +715,13 @@ DirExpandCurly(const char *word, const c * Find the end of this piece of the clause. */ bracelevel = 0; - while (*cp != ',') { - if (*cp == '{') { - bracelevel++; - } else if ((*cp == '}') && (bracelevel-- <= 0)) { + while (*cp != '\0') { + if ((*cp == ',' || *cp == '}') && bracelevel == 0) break; - } + if (*cp == '{') + bracelevel++; + if (*cp == '}') + bracelevel--; cp++; } /* Index: src/usr.bin/make/unit-tests/dir.exp diff -u src/usr.bin/make/unit-tests/dir.exp:1.1 src/usr.bin/make/unit-tests/dir.exp:1.2 --- src/usr.bin/make/unit-tests/dir.exp:1.1 Fri Jul 31 16:42:51 2020 +++ src/usr.bin/make/unit-tests/dir.exp Fri Jul 31 19:06:33 2020 @@ -1,11 +1,9 @@ -make: Unterminated {} clause "thiteen" 1 2 3 4 5 -make: don't know how to make fouteen (continuing) -make: don't know how to make rteen (continuing) +13 +14 15 -`all' not remade because of errors. exit status 0
CVS import: xsrc/external/mit/libX11/dist
Module Name:xsrc Committed By: maya Date: Fri Jul 31 19:20:23 UTC 2020 Update of /cvsroot/xsrc/external/mit/libX11/dist In directory ivanova.netbsd.org:/tmp/cvs-serv5152 Log Message: initial import of libX11-1.6.10 Status: Vendor Tag: xorg Release Tags: libX11-1-6-10 U xsrc/external/mit/libX11/dist/Makefile.am U xsrc/external/mit/libX11/dist/configure U xsrc/external/mit/libX11/dist/configure.ac U xsrc/external/mit/libX11/dist/aclocal.m4 U xsrc/external/mit/libX11/dist/Makefile.in U xsrc/external/mit/libX11/dist/x11-xcb.pc.in U xsrc/external/mit/libX11/dist/x11.pc.in U xsrc/external/mit/libX11/dist/AUTHORS U xsrc/external/mit/libX11/dist/COPYING U xsrc/external/mit/libX11/dist/ChangeLog U xsrc/external/mit/libX11/dist/INSTALL U xsrc/external/mit/libX11/dist/NEWS U xsrc/external/mit/libX11/dist/compile U xsrc/external/mit/libX11/dist/config.guess U xsrc/external/mit/libX11/dist/config.sub U xsrc/external/mit/libX11/dist/install-sh U xsrc/external/mit/libX11/dist/ltmain.sh U xsrc/external/mit/libX11/dist/missing U xsrc/external/mit/libX11/dist/README.md U xsrc/external/mit/libX11/dist/depcomp U xsrc/external/mit/libX11/dist/cpprules.in U xsrc/external/mit/libX11/dist/test-driver U xsrc/external/mit/libX11/dist/docbook.am U xsrc/external/mit/libX11/dist/include/Makefile.am U xsrc/external/mit/libX11/dist/include/Makefile.in U xsrc/external/mit/libX11/dist/include/X11/XlibConf.h.in U xsrc/external/mit/libX11/dist/include/X11/XKBlib.h U xsrc/external/mit/libX11/dist/include/X11/Xcms.h U xsrc/external/mit/libX11/dist/include/X11/Xlib.h U xsrc/external/mit/libX11/dist/include/X11/Xlibint.h U xsrc/external/mit/libX11/dist/include/X11/Xlocale.h U xsrc/external/mit/libX11/dist/include/X11/Xresource.h U xsrc/external/mit/libX11/dist/include/X11/Xutil.h U xsrc/external/mit/libX11/dist/include/X11/cursorfont.h U xsrc/external/mit/libX11/dist/include/X11/Xregion.h U xsrc/external/mit/libX11/dist/include/X11/ImUtil.h U xsrc/external/mit/libX11/dist/include/X11/Xlib-xcb.h U xsrc/external/mit/libX11/dist/include/X11/extensions/XKBgeom.h U xsrc/external/mit/libX11/dist/m4/ax_define_dir.m4 C xsrc/external/mit/libX11/dist/m4/libtool.m4 U xsrc/external/mit/libX11/dist/m4/ltoptions.m4 U xsrc/external/mit/libX11/dist/m4/ltsugar.m4 U xsrc/external/mit/libX11/dist/m4/ltversion.m4 U xsrc/external/mit/libX11/dist/m4/lt~obsolete.m4 U xsrc/external/mit/libX11/dist/modules/Makefile.am U xsrc/external/mit/libX11/dist/modules/Makefile.in U xsrc/external/mit/libX11/dist/modules/im/Makefile.am U xsrc/external/mit/libX11/dist/modules/im/Makefile.in U xsrc/external/mit/libX11/dist/modules/im/ximcp/Makefile.am U xsrc/external/mit/libX11/dist/modules/im/ximcp/Makefile.in U xsrc/external/mit/libX11/dist/modules/im/ximcp/imCallbk.c U xsrc/external/mit/libX11/dist/modules/im/ximcp/imDefFlt.c U xsrc/external/mit/libX11/dist/modules/im/ximcp/imDefIc.c U xsrc/external/mit/libX11/dist/modules/im/ximcp/imDefIm.c U xsrc/external/mit/libX11/dist/modules/im/ximcp/imDefLkup.c U xsrc/external/mit/libX11/dist/modules/im/ximcp/imDispch.c U xsrc/external/mit/libX11/dist/modules/im/ximcp/imEvToWire.c U xsrc/external/mit/libX11/dist/modules/im/ximcp/imExten.c U xsrc/external/mit/libX11/dist/modules/im/ximcp/imImSw.c U xsrc/external/mit/libX11/dist/modules/im/ximcp/imInsClbk.c U xsrc/external/mit/libX11/dist/modules/im/ximcp/imInt.c U xsrc/external/mit/libX11/dist/modules/im/ximcp/imLcFlt.c U xsrc/external/mit/libX11/dist/modules/im/ximcp/imLcGIc.c U xsrc/external/mit/libX11/dist/modules/im/ximcp/imLcIc.c U xsrc/external/mit/libX11/dist/modules/im/ximcp/imLcIm.c U xsrc/external/mit/libX11/dist/modules/im/ximcp/imLcLkup.c U xsrc/external/mit/libX11/dist/modules/im/ximcp/imLcPrs.c U xsrc/external/mit/libX11/dist/modules/im/ximcp/imLcSIc.c U xsrc/external/mit/libX11/dist/modules/im/ximcp/imRmAttr.c U xsrc/external/mit/libX11/dist/modules/im/ximcp/imRm.c U xsrc/external/mit/libX11/dist/modules/im/ximcp/imThaiFlt.c U xsrc/external/mit/libX11/dist/modules/im/ximcp/imThaiIc.c U xsrc/external/mit/libX11/dist/modules/im/ximcp/imThaiIm.c U xsrc/external/mit/libX11/dist/modules/im/ximcp/imTrans.c U xsrc/external/mit/libX11/dist/modules/im/ximcp/imTransR.c U xsrc/external/mit/libX11/dist/modules/im/ximcp/imTrX.c U xsrc/external/mit/libX11/dist/modules/lc/Makefile.am U xsrc/external/mit/libX11/dist/modules/lc/Makefile.in U xsrc/external/mit/libX11/dist/modules/lc/Utf8/Makefile.am U xsrc/external/mit/libX11/dist/modules/lc/Utf8/Makefile.in U xsrc/external/mit/libX11/dist/modules/lc/Utf8/lcUTF8Load.c U xsrc/external/mit/libX11/dist/modules/lc/def/Makefile.am U xsrc/external/mit/libX11/dist/modules/lc/def/Makefile.in U xsrc/external/mit/libX11/dist/modules/lc/def/lcDefConv.c U xsrc/external/mit/libX11/dist/modules/lc/gen/Makefile.am U xsrc/external/mit/libX11/dist/modules/lc/gen/Makefile.in U xsrc/external/mit/libX11/dist/modules/lc/gen/lcGenConv.c U xsrc/external/mit/libX11/dist/modules/om/Makefile.am U
CVS import: xsrc/external/mit/libX11/dist
Module Name:xsrc Committed By: maya Date: Fri Jul 31 19:20:23 UTC 2020 Update of /cvsroot/xsrc/external/mit/libX11/dist In directory ivanova.netbsd.org:/tmp/cvs-serv5152 Log Message: initial import of libX11-1.6.10 Status: Vendor Tag: xorg Release Tags: libX11-1-6-10 U xsrc/external/mit/libX11/dist/Makefile.am U xsrc/external/mit/libX11/dist/configure U xsrc/external/mit/libX11/dist/configure.ac U xsrc/external/mit/libX11/dist/aclocal.m4 U xsrc/external/mit/libX11/dist/Makefile.in U xsrc/external/mit/libX11/dist/x11-xcb.pc.in U xsrc/external/mit/libX11/dist/x11.pc.in U xsrc/external/mit/libX11/dist/AUTHORS U xsrc/external/mit/libX11/dist/COPYING U xsrc/external/mit/libX11/dist/ChangeLog U xsrc/external/mit/libX11/dist/INSTALL U xsrc/external/mit/libX11/dist/NEWS U xsrc/external/mit/libX11/dist/compile U xsrc/external/mit/libX11/dist/config.guess U xsrc/external/mit/libX11/dist/config.sub U xsrc/external/mit/libX11/dist/install-sh U xsrc/external/mit/libX11/dist/ltmain.sh U xsrc/external/mit/libX11/dist/missing U xsrc/external/mit/libX11/dist/README.md U xsrc/external/mit/libX11/dist/depcomp U xsrc/external/mit/libX11/dist/cpprules.in U xsrc/external/mit/libX11/dist/test-driver U xsrc/external/mit/libX11/dist/docbook.am U xsrc/external/mit/libX11/dist/include/Makefile.am U xsrc/external/mit/libX11/dist/include/Makefile.in U xsrc/external/mit/libX11/dist/include/X11/XlibConf.h.in U xsrc/external/mit/libX11/dist/include/X11/XKBlib.h U xsrc/external/mit/libX11/dist/include/X11/Xcms.h U xsrc/external/mit/libX11/dist/include/X11/Xlib.h U xsrc/external/mit/libX11/dist/include/X11/Xlibint.h U xsrc/external/mit/libX11/dist/include/X11/Xlocale.h U xsrc/external/mit/libX11/dist/include/X11/Xresource.h U xsrc/external/mit/libX11/dist/include/X11/Xutil.h U xsrc/external/mit/libX11/dist/include/X11/cursorfont.h U xsrc/external/mit/libX11/dist/include/X11/Xregion.h U xsrc/external/mit/libX11/dist/include/X11/ImUtil.h U xsrc/external/mit/libX11/dist/include/X11/Xlib-xcb.h U xsrc/external/mit/libX11/dist/include/X11/extensions/XKBgeom.h U xsrc/external/mit/libX11/dist/m4/ax_define_dir.m4 C xsrc/external/mit/libX11/dist/m4/libtool.m4 U xsrc/external/mit/libX11/dist/m4/ltoptions.m4 U xsrc/external/mit/libX11/dist/m4/ltsugar.m4 U xsrc/external/mit/libX11/dist/m4/ltversion.m4 U xsrc/external/mit/libX11/dist/m4/lt~obsolete.m4 U xsrc/external/mit/libX11/dist/modules/Makefile.am U xsrc/external/mit/libX11/dist/modules/Makefile.in U xsrc/external/mit/libX11/dist/modules/im/Makefile.am U xsrc/external/mit/libX11/dist/modules/im/Makefile.in U xsrc/external/mit/libX11/dist/modules/im/ximcp/Makefile.am U xsrc/external/mit/libX11/dist/modules/im/ximcp/Makefile.in U xsrc/external/mit/libX11/dist/modules/im/ximcp/imCallbk.c U xsrc/external/mit/libX11/dist/modules/im/ximcp/imDefFlt.c U xsrc/external/mit/libX11/dist/modules/im/ximcp/imDefIc.c U xsrc/external/mit/libX11/dist/modules/im/ximcp/imDefIm.c U xsrc/external/mit/libX11/dist/modules/im/ximcp/imDefLkup.c U xsrc/external/mit/libX11/dist/modules/im/ximcp/imDispch.c U xsrc/external/mit/libX11/dist/modules/im/ximcp/imEvToWire.c U xsrc/external/mit/libX11/dist/modules/im/ximcp/imExten.c U xsrc/external/mit/libX11/dist/modules/im/ximcp/imImSw.c U xsrc/external/mit/libX11/dist/modules/im/ximcp/imInsClbk.c U xsrc/external/mit/libX11/dist/modules/im/ximcp/imInt.c U xsrc/external/mit/libX11/dist/modules/im/ximcp/imLcFlt.c U xsrc/external/mit/libX11/dist/modules/im/ximcp/imLcGIc.c U xsrc/external/mit/libX11/dist/modules/im/ximcp/imLcIc.c U xsrc/external/mit/libX11/dist/modules/im/ximcp/imLcIm.c U xsrc/external/mit/libX11/dist/modules/im/ximcp/imLcLkup.c U xsrc/external/mit/libX11/dist/modules/im/ximcp/imLcPrs.c U xsrc/external/mit/libX11/dist/modules/im/ximcp/imLcSIc.c U xsrc/external/mit/libX11/dist/modules/im/ximcp/imRmAttr.c U xsrc/external/mit/libX11/dist/modules/im/ximcp/imRm.c U xsrc/external/mit/libX11/dist/modules/im/ximcp/imThaiFlt.c U xsrc/external/mit/libX11/dist/modules/im/ximcp/imThaiIc.c U xsrc/external/mit/libX11/dist/modules/im/ximcp/imThaiIm.c U xsrc/external/mit/libX11/dist/modules/im/ximcp/imTrans.c U xsrc/external/mit/libX11/dist/modules/im/ximcp/imTransR.c U xsrc/external/mit/libX11/dist/modules/im/ximcp/imTrX.c U xsrc/external/mit/libX11/dist/modules/lc/Makefile.am U xsrc/external/mit/libX11/dist/modules/lc/Makefile.in U xsrc/external/mit/libX11/dist/modules/lc/Utf8/Makefile.am U xsrc/external/mit/libX11/dist/modules/lc/Utf8/Makefile.in U xsrc/external/mit/libX11/dist/modules/lc/Utf8/lcUTF8Load.c U xsrc/external/mit/libX11/dist/modules/lc/def/Makefile.am U xsrc/external/mit/libX11/dist/modules/lc/def/Makefile.in U xsrc/external/mit/libX11/dist/modules/lc/def/lcDefConv.c U xsrc/external/mit/libX11/dist/modules/lc/gen/Makefile.am U xsrc/external/mit/libX11/dist/modules/lc/gen/Makefile.in U xsrc/external/mit/libX11/dist/modules/lc/gen/lcGenConv.c U xsrc/external/mit/libX11/dist/modules/om/Makefile.am U
CVS commit: xsrc/external/mit/libX11/dist
Module Name:xsrc Committed By: maya Date: Fri Jul 31 19:29:52 UTC 2020 Modified Files: xsrc/external/mit/libX11/dist/m4: libtool.m4 xsrc/external/mit/libX11/dist/nls/en_US.UTF-8: Compose.pre xsrc/external/mit/libX11/dist/src: Font.c FontNames.c XlibInt.c Log Message: Merge libX11 1.6.10 To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 xsrc/external/mit/libX11/dist/m4/libtool.m4 cvs rdiff -u -r1.5 -r1.6 \ xsrc/external/mit/libX11/dist/nls/en_US.UTF-8/Compose.pre cvs rdiff -u -r1.6 -r1.7 xsrc/external/mit/libX11/dist/src/Font.c cvs rdiff -u -r1.8 -r1.9 xsrc/external/mit/libX11/dist/src/FontNames.c cvs rdiff -u -r1.12 -r1.13 xsrc/external/mit/libX11/dist/src/XlibInt.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: xsrc/external/mit/libX11/dist/m4/libtool.m4 diff -u xsrc/external/mit/libX11/dist/m4/libtool.m4:1.8 xsrc/external/mit/libX11/dist/m4/libtool.m4:1.9 --- xsrc/external/mit/libX11/dist/m4/libtool.m4:1.8 Sun Feb 23 09:05:16 2020 +++ xsrc/external/mit/libX11/dist/m4/libtool.m4 Fri Jul 31 19:29:52 2020 @@ -728,7 +728,6 @@ _LT_CONFIG_SAVE_COMMANDS([ cat <<_LT_EOF >> "$cfgfile" #! $SHELL # Generated automatically by $as_me ($PACKAGE) $VERSION -# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # Provide generalized library-building support services. @@ -2867,9 +2866,6 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu # before this can be enabled. hardcode_into_libs=yes - # Add ABI-specific directories to the system library path. - sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib" - # Ideally, we could use ldconfig to report *all* directores which are # searched for libraries, however this is still not possible. Aside from not # being certain /sbin/ldconfig is available, command @@ -2878,7 +2874,7 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu # appending ld.so.conf contents (and includes) to the search path. if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` -sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra" +sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on @@ -2890,6 +2886,18 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu dynamic_linker='GNU/Linux ld.so' ;; +netbsdelf*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='NetBSD ld.elf_so' + ;; + netbsd*) version_type=sunos need_lib_prefix=no @@ -3549,7 +3557,7 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu lt_cv_deplibs_check_method=pass_all ;; -netbsd*) +netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' else @@ -4427,7 +4435,7 @@ m4_if([$1], [CXX], [ ;; esac ;; - netbsd*) + netbsd* | netbsdelf*-gnu) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise @@ -4939,6 +4947,9 @@ m4_if([$1], [CXX], [ ;; esac ;; + linux* | k*bsd*-gnu | gnu*) +_LT_TAGVAR(link_all_deplibs, $1)=no +;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; @@ -5001,6 +5012,9 @@ dnl Note also adjust exclude_expsyms for openbsd* | bitrig*) with_gnu_ld=no ;; + linux* | k*bsd*-gnu | gnu*) +_LT_TAGVAR(link_all_deplibs, $1)=no +;; esac _LT_TAGVAR(ld_shlibs, $1)=yes @@ -5255,7 +5269,7 @@ _LT_EOF fi ;; -netbsd*) +netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= @@ -5776,6 +5790,7 @@ _LT_EOF if test yes = "$lt_cv_irix_exported_symbol"; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib' fi + _LT_TAGVAR(link_all_deplibs, $1)=no else
CVS commit: src/sys/dev/raidframe
Module Name:src Committed By: christos Date: Fri Jul 31 19:30:09 UTC 2020 Modified Files: src/sys/dev/raidframe: rf_netbsdkintf.c Log Message: Factor out the component cache flushing code; add retries. To generate a diff of this commit: cvs rdiff -u -r1.385 -r1.386 src/sys/dev/raidframe/rf_netbsdkintf.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/raidframe/rf_netbsdkintf.c diff -u src/sys/dev/raidframe/rf_netbsdkintf.c:1.385 src/sys/dev/raidframe/rf_netbsdkintf.c:1.386 --- src/sys/dev/raidframe/rf_netbsdkintf.c:1.385 Sat Jun 20 14:36:27 2020 +++ src/sys/dev/raidframe/rf_netbsdkintf.c Fri Jul 31 15:30:09 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: rf_netbsdkintf.c,v 1.385 2020/06/20 18:36:27 riastradh Exp $ */ +/* $NetBSD: rf_netbsdkintf.c,v 1.386 2020/07/31 19:30:09 christos Exp $ */ /*- * Copyright (c) 1996, 1997, 1998, 2008-2011 The NetBSD Foundation, Inc. @@ -101,7 +101,7 @@ ***/ #include -__KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.385 2020/06/20 18:36:27 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.386 2020/07/31 19:30:09 christos Exp $"); #ifdef _KERNEL_OPT #include "opt_raid_autoconfig.h" @@ -3660,43 +3660,44 @@ rf_get_component_caches(RF_Raid_t *raidP * that fails. */ +static int +rf_sync_component_cache(RF_Raid_t *raidPtr, int c) +{ + int force = 1; + int e = 0; + for (int i = 0; i < 5; i++) { + e = VOP_IOCTL(raidPtr->raid_cinfo[c].ci_vp, DIOCCACHESYNC, + , FWRITE, NOCRED); + if (!e || e == ENODEV) + return e; + printf("raid%d: cache flush[%d] to component %s failed (%d)\n", + raidPtr->raidid, i, raidPtr->Disks[c].devname, e); + } + return 0; +} + int rf_sync_component_caches(RF_Raid_t *raidPtr) { - int c, sparecol; - int e,error; - int force = 1; + int c, error; error = 0; for (c = 0; c < raidPtr->numCol; c++) { if (raidPtr->Disks[c].status == rf_ds_optimal) { - e = VOP_IOCTL(raidPtr->raid_cinfo[c].ci_vp, DIOCCACHESYNC, - , FWRITE, NOCRED); - if (e) { -if (e != ENODEV) - printf("raid%d: cache flush to component %s failed.\n", - raidPtr->raidid, raidPtr->Disks[c].devname); -if (error == 0) { - error = e; -} - } + int e = rf_sync_component_cache(raidPtr, c); + if (error == 0) +error = e; } } - for( c = 0; c < raidPtr->numSpare ; c++) { - sparecol = raidPtr->numCol + c; + for (c = 0; c < raidPtr->numSpare ; c++) { + int sparecol = raidPtr->numCol + c; /* Need to ensure that the reconstruct actually completed! */ if (raidPtr->Disks[sparecol].status == rf_ds_used_spare) { - e = VOP_IOCTL(raidPtr->raid_cinfo[sparecol].ci_vp, - DIOCCACHESYNC, , FWRITE, NOCRED); - if (e) { -if (e != ENODEV) - printf("raid%d: cache flush to component %s failed.\n", - raidPtr->raidid, raidPtr->Disks[sparecol].devname); -if (error == 0) { - error = e; -} - } + int e = rf_sync_component_cache(raidPtr, sparecol); + if (error == 0) +error = e; + continue; } } return error;
CVS commit: src/sys/dev/raidframe
Module Name:src Committed By: christos Date: Fri Jul 31 19:30:09 UTC 2020 Modified Files: src/sys/dev/raidframe: rf_netbsdkintf.c Log Message: Factor out the component cache flushing code; add retries. To generate a diff of this commit: cvs rdiff -u -r1.385 -r1.386 src/sys/dev/raidframe/rf_netbsdkintf.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: xsrc/external/mit/libX11/dist
Module Name:xsrc Committed By: maya Date: Fri Jul 31 19:29:52 UTC 2020 Modified Files: xsrc/external/mit/libX11/dist/m4: libtool.m4 xsrc/external/mit/libX11/dist/nls/en_US.UTF-8: Compose.pre xsrc/external/mit/libX11/dist/src: Font.c FontNames.c XlibInt.c Log Message: Merge libX11 1.6.10 To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 xsrc/external/mit/libX11/dist/m4/libtool.m4 cvs rdiff -u -r1.5 -r1.6 \ xsrc/external/mit/libX11/dist/nls/en_US.UTF-8/Compose.pre cvs rdiff -u -r1.6 -r1.7 xsrc/external/mit/libX11/dist/src/Font.c cvs rdiff -u -r1.8 -r1.9 xsrc/external/mit/libX11/dist/src/FontNames.c cvs rdiff -u -r1.12 -r1.13 xsrc/external/mit/libX11/dist/src/XlibInt.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: xsrc/external/mit
Module Name:xsrc Committed By: maya Date: Fri Jul 31 19:35:22 UTC 2020 Modified Files: xsrc/external/mit/xorg-server.old/dist/dix: pixmap.c xsrc/external/mit/xorg-server/dist/dix: pixmap.c Log Message: Backport the only patch from xorg-server 1.20.9 as I can't find a tarball. >From aac28e162e5108510065ad4c323affd6deffd816 Mon Sep 17 00:00:00 2001 From: Matthieu Herrb Date: Sat, 25 Jul 2020 19:33:50 +0200 Subject: [PATCH] fix for ZDI-11426 Avoid leaking un-initalized memory to clients by zeroing the whole pixmap on initial allocation. This vulnerability was discovered by: Jan-Niklas Sohn working with Trend Micro Zero Day Initiative Signed-off-by: Matthieu Herrb Reviewed-by: Alan Coopersmith To generate a diff of this commit: cvs rdiff -u -r1.1.1.1 -r1.2 \ xsrc/external/mit/xorg-server.old/dist/dix/pixmap.c cvs rdiff -u -r1.1.1.6 -r1.2 xsrc/external/mit/xorg-server/dist/dix/pixmap.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: xsrc/external/mit/xorg-server.old/dist/dix/pixmap.c diff -u xsrc/external/mit/xorg-server.old/dist/dix/pixmap.c:1.1.1.1 xsrc/external/mit/xorg-server.old/dist/dix/pixmap.c:1.2 --- xsrc/external/mit/xorg-server.old/dist/dix/pixmap.c:1.1.1.1 Thu Jun 9 09:07:56 2016 +++ xsrc/external/mit/xorg-server.old/dist/dix/pixmap.c Fri Jul 31 19:35:22 2020 @@ -120,7 +120,7 @@ AllocatePixmap(ScreenPtr pScreen, int pi if (pScreen->totalPixmapSize > ((size_t)-1) - pixDataSize) return NullPixmap; -pPixmap = malloc(pScreen->totalPixmapSize + pixDataSize); +pPixmap = calloc(1, pScreen->totalPixmapSize + pixDataSize); if (!pPixmap) return NullPixmap; Index: xsrc/external/mit/xorg-server/dist/dix/pixmap.c diff -u xsrc/external/mit/xorg-server/dist/dix/pixmap.c:1.1.1.6 xsrc/external/mit/xorg-server/dist/dix/pixmap.c:1.2 --- xsrc/external/mit/xorg-server/dist/dix/pixmap.c:1.1.1.6 Sun Feb 23 10:17:39 2020 +++ xsrc/external/mit/xorg-server/dist/dix/pixmap.c Fri Jul 31 19:35:22 2020 @@ -117,7 +117,7 @@ AllocatePixmap(ScreenPtr pScreen, int pi if (pScreen->totalPixmapSize > ((size_t) - 1) - pixDataSize) return NullPixmap; -pPixmap = malloc(pScreen->totalPixmapSize + pixDataSize); +pPixmap = calloc(1, pScreen->totalPixmapSize + pixDataSize); if (!pPixmap) return NullPixmap;
CVS commit: xsrc/external/mit
Module Name:xsrc Committed By: maya Date: Fri Jul 31 19:35:22 UTC 2020 Modified Files: xsrc/external/mit/xorg-server.old/dist/dix: pixmap.c xsrc/external/mit/xorg-server/dist/dix: pixmap.c Log Message: Backport the only patch from xorg-server 1.20.9 as I can't find a tarball. >From aac28e162e5108510065ad4c323affd6deffd816 Mon Sep 17 00:00:00 2001 From: Matthieu Herrb Date: Sat, 25 Jul 2020 19:33:50 +0200 Subject: [PATCH] fix for ZDI-11426 Avoid leaking un-initalized memory to clients by zeroing the whole pixmap on initial allocation. This vulnerability was discovered by: Jan-Niklas Sohn working with Trend Micro Zero Day Initiative Signed-off-by: Matthieu Herrb Reviewed-by: Alan Coopersmith To generate a diff of this commit: cvs rdiff -u -r1.1.1.1 -r1.2 \ xsrc/external/mit/xorg-server.old/dist/dix/pixmap.c cvs rdiff -u -r1.1.1.6 -r1.2 xsrc/external/mit/xorg-server/dist/dix/pixmap.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/mips/mips
Module Name:src Committed By: skrll Date: Fri Jul 31 20:03:20 UTC 2020 Modified Files: src/sys/arch/mips/mips: locore.S Log Message: Trailing whitespace To generate a diff of this commit: cvs rdiff -u -r1.223 -r1.224 src/sys/arch/mips/mips/locore.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/mips/mips/locore.S diff -u src/sys/arch/mips/mips/locore.S:1.223 src/sys/arch/mips/mips/locore.S:1.224 --- src/sys/arch/mips/mips/locore.S:1.223 Mon Jul 20 03:23:42 2020 +++ src/sys/arch/mips/mips/locore.S Fri Jul 31 20:03:20 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: locore.S,v 1.223 2020/07/20 03:23:42 simonb Exp $ */ +/* $NetBSD: locore.S,v 1.224 2020/07/31 20:03:20 skrll Exp $ */ /* * Copyright (c) 1992, 1993 @@ -63,7 +63,7 @@ #include #include -RCSID("$NetBSD: locore.S,v 1.223 2020/07/20 03:23:42 simonb Exp $") +RCSID("$NetBSD: locore.S,v 1.224 2020/07/31 20:03:20 skrll Exp $") #include "assym.h" @@ -88,7 +88,7 @@ _C_LABEL(kernel_text): mtc0 zero, MIPS_COP_0_CAUSE COP0_SYNC -#if defined(_LP64) +#if defined(_LP64) /* Enable 64-bit addressing */ mfc0 k0, MIPS_COP_0_STATUS MFC0_HAZARD
CVS commit: src/usr.bin/config
Module Name:src Committed By: uwe Date: Fri Jul 31 20:01:42 UTC 2020 Modified Files: src/usr.bin/config: config.5 Log Message: Formatting improvements. Only comb through the first few pages (OBJECTS AND NAMES) for now. Use .Em for emphasis, not .Ar (both look the same in text output, but .Ar is very confusing in PostScript). Reduce emphasis - don't highlight every usage of a term. Where everything is emphasized nothing is. Fix PS formatting of locator syntax examples so that square brackets are literal and don't look meta-syntactic. Explicitly show optional locator syntax (in literal square brackets). To generate a diff of this commit: cvs rdiff -u -r1.38 -r1.39 src/usr.bin/config/config.5 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/config/config.5 diff -u src/usr.bin/config/config.5:1.38 src/usr.bin/config/config.5:1.39 --- src/usr.bin/config/config.5:1.38 Mon Jul 3 21:34:18 2017 +++ src/usr.bin/config/config.5 Fri Jul 31 20:01:42 2020 @@ -1,4 +1,4 @@ -.\" $NetBSD: config.5,v 1.38 2017/07/03 21:34:18 wiz Exp $ +.\" $NetBSD: config.5,v 1.39 2020/07/31 20:01:42 uwe Exp $ .\" .\" Copyright (c) 2006, 2007 The NetBSD Foundation. .\" All rights reserved. @@ -76,20 +76,25 @@ from the kernel source tree. Statements are separated by new-line characters. However, new-line characters can appear in the middle of a given statement, with the value of a space character. +.\" +.\" .Ss OBJECTS AND NAMES +.\" .Xr config 1 is a rather complicated piece of software that tries to comply with any configuration the user might think of. Quite a few different objects are manipulated through the kernel configuration file, therefore some definitions are needed. +.\" +.\" .Ss Options and attributes +.\" The basic objects driving the kernel compilation are .Em options , and are called -.Ar attributes +.Em attributes in some contexts. -An -.Ar attribute +An attribute usually refers to a feature a given piece of hardware might have. However, the scope of an attribute is rather wide and can just be a place holder to group some source files together. @@ -98,104 +103,118 @@ There is a special class of attribute, n .Em interface attribute , which represents a hook that allows a device to attach to (i.e., be a child of) another device. -An -.Em interface attribute +An interface attribute has a (possibly empty) list of -.Ar locators +.Em locators to match the actual location of a device. -For example, on a PCI bus, devices are located by a -.Em device number +For example, on a PCI bus, devices are located by a device number that is fixed by the wiring of the motherboard. Additionally, each of those devices can appear through several interfaces named -.Em functions . +functions. A single PCI device entity is a unique function number of a given device from the considered PCI bus. Therefore, the locators for a .Xr pci 4 device are -.Ar dev +.Ql dev (for device), and -.Ar function . +.Ql function . .Pp A -.Ar locator +.Em locator can either be a single integer value, or an array of integer values. It can have a default value, in which case it can be wildcarded with a -.Dq \&? +.Ql \&? in the options selection section of the configuration file. -A single -.Ar locator +A single locator definition can take one of the following forms: -.Bl -enum -offset indent -compact +.Pp +.Bl -bullet -offset indent -compact .It .Ar locator .It -.Ar locator -= -.Ar value +.Ar locator\| Ns Li =\| Ns Ar value +.It +.Li "\&[" Ns Ar locator\| Ns Li =\| Ns Ar value\| Ns Li "\&]" .It -.Ar locator Ns Oo Ar length Oc +.Ar locator Ns Li "\&[" Ns Ar length Ns Li "\&]" .It -.Ar locator Ns Oo Ar length Oc = Brq Ar value , ... +.Ar locator Ns Li "\&[" Ns Ar length Ns Li "\&]={" \ +Ns Ar value\| Ns Li \&, Ar ... Ns Li "\&}" +.It +.Li "\&[" Ns Ar locator Ns Li "\&[" Ns Ar length Ns Li "\&]={" \ +Ns Ar value\| Ns Li \&, Ar ... Ns Li "\&}]" .El +.Pp The variants that specify a default value can be enclosed into square brackets, in which case the locator will not have to be specified later in the options selection section of the configuration file. .Pp In the options selection section, the locators are specified when declaring an instance as a space-separated list of -.Dq Ao Ar locator Ac Ao Ar value Ac +.Dq Ao Ar locator\| Ac \~ Ao Ar value\| Ac where value can be the -.Dq \&? +.Ql \&? wildcard if the locator allows it. +.\" +.\" .Ss Devices, instances and attachments +.\" The main benefit of the kernel configuration file is to allow the user to avoid compiling some drivers, and wire down the configuration of some others. We have already seen that devices attach to each other through -.Em interface attributes , +interface attributes, but not everything can attach to anything. Furthermore, the user has the ability to define precise instances for the devices. -An -.Ar
CVS commit: src/usr.bin/make
Module Name:src Committed By: rillig Date: Fri Jul 31 20:02:44 UTC 2020 Modified Files: src/usr.bin/make: dir.c src/usr.bin/make/unit-tests: dir.exp dir.mk Log Message: make(1): fix regression and add test for empty brace expansion This had been broken in r1.80 of dir.c, a few minutes ago. To generate a diff of this commit: cvs rdiff -u -r1.80 -r1.81 src/usr.bin/make/dir.c cvs rdiff -u -r1.2 -r1.3 src/usr.bin/make/unit-tests/dir.exp cvs rdiff -u -r1.1 -r1.2 src/usr.bin/make/unit-tests/dir.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/dir.c diff -u src/usr.bin/make/dir.c:1.80 src/usr.bin/make/dir.c:1.81 --- src/usr.bin/make/dir.c:1.80 Fri Jul 31 19:50:44 2020 +++ src/usr.bin/make/dir.c Fri Jul 31 20:02:44 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: dir.c,v 1.80 2020/07/31 19:50:44 rillig Exp $ */ +/* $NetBSD: dir.c,v 1.81 2020/07/31 20:02:44 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -70,14 +70,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: dir.c,v 1.80 2020/07/31 19:50:44 rillig Exp $"; +static char rcsid[] = "$NetBSD: dir.c,v 1.81 2020/07/31 20:02:44 rillig Exp $"; #else #include #ifndef lint #if 0 static char sccsid[] = "@(#)dir.c 8.2 (Berkeley) 1/2/94"; #else -__RCSID("$NetBSD: dir.c,v 1.80 2020/07/31 19:50:44 rillig Exp $"); +__RCSID("$NetBSD: dir.c,v 1.81 2020/07/31 20:02:44 rillig Exp $"); #endif #endif /* not lint */ #endif @@ -752,7 +752,7 @@ DirExpandCurly(const char *word, const c /* Split the middle into pieces, separated by commas. */ const char *piece = middle; -while (piece < middle_end) { +while (piece < middle_end + 1) { const char *piece_end = separator_comma(piece); size_t piece_len = (size_t)(piece_end - piece); Index: src/usr.bin/make/unit-tests/dir.exp diff -u src/usr.bin/make/unit-tests/dir.exp:1.2 src/usr.bin/make/unit-tests/dir.exp:1.3 --- src/usr.bin/make/unit-tests/dir.exp:1.2 Fri Jul 31 19:06:33 2020 +++ src/usr.bin/make/unit-tests/dir.exp Fri Jul 31 20:02:44 2020 @@ -6,4 +6,8 @@ 13 14 15 +pre-patch +pre-configure +patch +configure exit status 0 Index: src/usr.bin/make/unit-tests/dir.mk diff -u src/usr.bin/make/unit-tests/dir.mk:1.1 src/usr.bin/make/unit-tests/dir.mk:1.2 --- src/usr.bin/make/unit-tests/dir.mk:1.1 Fri Jul 31 16:42:51 2020 +++ src/usr.bin/make/unit-tests/dir.mk Fri Jul 31 20:02:44 2020 @@ -1,4 +1,4 @@ -# $NetBSD: dir.mk,v 1.1 2020/07/31 16:42:51 rillig Exp $ +# $NetBSD: dir.mk,v 1.2 2020/07/31 20:02:44 rillig Exp $ # # Tests for dir.c. @@ -31,3 +31,8 @@ fourteen: @echo 14 fifteen: @echo 15 + +all: {pre-,}{patch,configure} + +pre-patch patch pre-configure configure: + @echo $@
CVS commit: src/sys/arch/mips/mips
Module Name:src Committed By: skrll Date: Fri Jul 31 20:03:20 UTC 2020 Modified Files: src/sys/arch/mips/mips: locore.S Log Message: Trailing whitespace To generate a diff of this commit: cvs rdiff -u -r1.223 -r1.224 src/sys/arch/mips/mips/locore.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/usr.bin/config
Module Name:src Committed By: uwe Date: Fri Jul 31 20:01:42 UTC 2020 Modified Files: src/usr.bin/config: config.5 Log Message: Formatting improvements. Only comb through the first few pages (OBJECTS AND NAMES) for now. Use .Em for emphasis, not .Ar (both look the same in text output, but .Ar is very confusing in PostScript). Reduce emphasis - don't highlight every usage of a term. Where everything is emphasized nothing is. Fix PS formatting of locator syntax examples so that square brackets are literal and don't look meta-syntactic. Explicitly show optional locator syntax (in literal square brackets). To generate a diff of this commit: cvs rdiff -u -r1.38 -r1.39 src/usr.bin/config/config.5 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
Module Name:src Committed By: rillig Date: Fri Jul 31 20:02:44 UTC 2020 Modified Files: src/usr.bin/make: dir.c src/usr.bin/make/unit-tests: dir.exp dir.mk Log Message: make(1): fix regression and add test for empty brace expansion This had been broken in r1.80 of dir.c, a few minutes ago. To generate a diff of this commit: cvs rdiff -u -r1.80 -r1.81 src/usr.bin/make/dir.c cvs rdiff -u -r1.2 -r1.3 src/usr.bin/make/unit-tests/dir.exp cvs rdiff -u -r1.1 -r1.2 src/usr.bin/make/unit-tests/dir.mk Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/wsfont
Module Name:src Committed By: fcambus Date: Fri Jul 31 20:39:50 UTC 2020 Modified Files: src/sys/dev/wsfont: spleen16x32.h spleen32x64.h spleen8x16.h Log Message: Update Spleen kernel fonts to version 1.8.2, bringing the following improvements: - Fix size of the lower case 'ae' character in the 16x32 and 32x64 versions - Shorten parentheses, square brackets, braces, slash, backslash in the 8x16 version, fixing alignment issues - Shift vertical line and double vertical line characters one pixel up in the 8x16 version To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/sys/dev/wsfont/spleen16x32.h cvs rdiff -u -r1.7 -r1.8 src/sys/dev/wsfont/spleen32x64.h cvs rdiff -u -r1.5 -r1.6 src/sys/dev/wsfont/spleen8x16.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/wsfont/spleen16x32.h diff -u src/sys/dev/wsfont/spleen16x32.h:1.6 src/sys/dev/wsfont/spleen16x32.h:1.7 --- src/sys/dev/wsfont/spleen16x32.h:1.6 Mon Jul 20 13:41:16 2020 +++ src/sys/dev/wsfont/spleen16x32.h Fri Jul 31 20:39:50 2020 @@ -1,8 +1,8 @@ -/* $NetBSD: spleen16x32.h,v 1.6 2020/07/20 13:41:16 fcambus Exp $ */ +/* $NetBSD: spleen16x32.h,v 1.7 2020/07/31 20:39:50 fcambus Exp $ */ /* $OpenBSD: spleen16x32.h,v 1.2 2019/03/08 10:53:59 fcambus Exp $ */ /* - * Copyright (c) 2018-2019 Frederic Cambus + * Copyright (c) 2018-2020 Frederic Cambus * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -6589,20 +6589,20 @@ static u_char spleen16x32_data[] = { 0x00, 0x00, /* */ 0x00, 0x00, /* */ 0x00, 0x00, /* */ - 0x1f, 0x3f, /* ...*..** */ - 0x1f, 0xff, /* ...* */ - 0x01, 0xe3, /* ......** */ - 0x00, 0xc3, /* **** */ - 0x00, 0xc3, /* **** */ - 0x0f, 0xc3, /* **** */ - 0x1f, 0xff, /* ...* */ - 0x38, 0xff, /* ..***... */ - 0x30, 0xc0, /* ..****.. */ - 0x30, 0xc0, /* ..****.. */ - 0x30, 0xc0, /* ..****.. */ - 0x39, 0xe0, /* ..***... */ - 0x1f, 0xff, /* ...* */ - 0x0f, 0x3f, /* ..** */ + 0x1e, 0x7c, /* .....*.. */ + 0x1f, 0xfc, /* ...***.. */ + 0x03, 0xcc, /* ....**.. */ + 0x01, 0x8c, /* ...**...**.. */ + 0x01, 0x8c, /* ...**...**.. */ + 0x0f, 0x8c, /* *...**.. */ + 0x1f, 0xfc, /* ...***.. */ + 0x39, 0xfc, /* ..***..***.. */ + 0x31, 0x80, /* ..**...**... */ + 0x31, 0x80, /* ..**...**... */ + 0x31, 0x80, /* ..**...**... */ + 0x39, 0xc0, /* ..***..***.. */ + 0x1f, 0xfc, /* ...***.. */ + 0x0f, 0x7c, /* .*.. */ 0x00, 0x00, /* */ 0x00, 0x00, /* */ 0x00, 0x00, /* */ Index: src/sys/dev/wsfont/spleen32x64.h diff -u src/sys/dev/wsfont/spleen32x64.h:1.7 src/sys/dev/wsfont/spleen32x64.h:1.8 --- src/sys/dev/wsfont/spleen32x64.h:1.7 Mon Jul 20 13:41:16 2020 +++ src/sys/dev/wsfont/spleen32x64.h Fri Jul 31 20:39:50 2020 @@ -1,8 +1,8 @@ -/* $NetBSD: spleen32x64.h,v 1.7 2020/07/20 13:41:16 fcambus Exp $ */ +/* $NetBSD: spleen32x64.h,v 1.8 2020/07/31 20:39:50 fcambus Exp $ */ /* $OpenBSD: spleen32x64.h,v 1.2 2019/03/08 10:53:59 fcambus Exp $ */ /* - * Copyright (c) 2018-2019 Frederic Cambus + * Copyright (c) 2018-2020 Frederic Cambus * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -12937,34 +12937,34 @@ static u_char spleen32x64_data[] = { 0x00, 0x00, 0x00, 0x00, /* */ 0x00, 0x00, 0x00, 0x00, /* */ 0x00, 0x00, 0x00, 0x00, /* */ - 0x03, 0xff, 0x0f, 0xff, /* ..** */ - 0x03, 0xff, 0x9f, 0xff, /* ..***..* */ - 0x03, 0xff, 0xff, 0xff, /* ..** */ - 0x03, 0xff, 0xff, 0xff, /* ..** */ - 0x00, 0x03, 0xfc, 0x0f, /* .... */ - 0x00, 0x01, 0xf8, 0x0f, /* ...**... */ - 0x00, 0x00, 0xf0, 0x0f, /* */ - 0x00, 0x00, 0xf0, 0x0f, /* */ - 0x00, 0x00, 0xf0, 0x0f, /* */ - 0x00, 0x00, 0xf0, 0x0f, /* */ - 0x00, 0x7f, 0xf0, 0x0f, /* .*** */ - 0x01, 0xff, 0xf0, 0x0f, /* ...* */ - 0x03, 0xff, 0xff, 0xff, /* ..** */ - 0x07, 0xff, 0xff, 0xff, /* .*** */ - 0x07, 0xc0, 0xff, 0xff, /* .*.. */ - 0x0f, 0x80, 0xff, 0xff, /* *... */ - 0x0f, 0x00, 0xf0, 0x00, /* */ - 0x0f, 0x00, 0xf0,
CVS commit: src/usr.bin/config
Module Name:src Committed By: uwe Date: Fri Jul 31 21:25:34 UTC 2020 Modified Files: src/usr.bin/config: config.5 Log Message: Minor tweak to list formatting. Where necessary, use .Bl -ohang -compact and explicit .Pp to be able to group multiple config directives (separate .It) by omitting .Pp between them. While here, add a .|" comment before .It to make them more visible when editing. To generate a diff of this commit: cvs rdiff -u -r1.39 -r1.40 src/usr.bin/config/config.5 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/usr.bin/config
Module Name:src Committed By: uwe Date: Fri Jul 31 21:25:34 UTC 2020 Modified Files: src/usr.bin/config: config.5 Log Message: Minor tweak to list formatting. Where necessary, use .Bl -ohang -compact and explicit .Pp to be able to group multiple config directives (separate .It) by omitting .Pp between them. While here, add a .|" comment before .It to make them more visible when editing. To generate a diff of this commit: cvs rdiff -u -r1.39 -r1.40 src/usr.bin/config/config.5 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/config/config.5 diff -u src/usr.bin/config/config.5:1.39 src/usr.bin/config/config.5:1.40 --- src/usr.bin/config/config.5:1.39 Fri Jul 31 20:01:42 2020 +++ src/usr.bin/config/config.5 Fri Jul 31 21:25:34 2020 @@ -1,4 +1,4 @@ -.\" $NetBSD: config.5,v 1.39 2020/07/31 20:01:42 uwe Exp $ +.\" $NetBSD: config.5,v 1.40 2020/07/31 21:25:34 uwe Exp $ .\" .\" Copyright (c) 2006, 2007 The NetBSD Foundation. .\" All rights reserved. @@ -249,7 +249,9 @@ to combine options and attributes . .\" .Ss CONTEXT NEUTRAL STATEMENTS .\" -.Bl -ohang +.Bl -ohang -compact +.\" +.Pp .It Ic version Ar mmdd Indicates the syntax version used by the rest of the file, or until the next .Ic version @@ -258,11 +260,15 @@ The argument is an ISO date. A given .Xr config 1 binary might only be compatible with a limited range of version numbers. +.\" +.Pp .It Ic include Ar path Includes a file. The path is relative to the top of the kernel source tree, or the inner-most defined .Ic prefix . +.\" +.Pp .It Ic cinclude Ar path Conditionally includes a file. Contrary to @@ -270,6 +276,8 @@ Contrary to it will not produce an error if the file does not exist. The argument obeys the same rules as for .Ic include . +.\" +.Pp .It Ic prefix Op Ar path If .Ar path @@ -286,6 +294,8 @@ The .Ar path argument is either absolute or relative to the current defined prefix, which defaults to the top of the kernel source tree. +.\" +.Pp .It Ic buildprefix Op Ar path If .Ar path @@ -299,8 +309,11 @@ The .Ar path argument is relative to the current defined buildprefix, which defaults to the top of the kernel build directory. -When prefix is either absolute or relative out of the kernel source tree (../), +When prefix is either absolute or relative out of the kernel source tree +.Pq Pa \&../ , buildprefix must be defined. +.\" +.Pp .It Ic ifdef Ar attribute .It Ic ifndef Ar attribute .It Ic elifdef Ar attribute @@ -325,6 +338,7 @@ and .Ic prefix , the preamble may contain the following optional statements: .Bl -ohang +.\" .It Ic build Ar path Defines the build directory for the compilation of the kernel. It replaces the default of @@ -333,6 +347,7 @@ and is superseded by the .Fl b parameter of .Xr config 1 . +.\" .It Ic source Ar path Defines the directory in which the source of the kernel lives. It replaces the default of @@ -352,7 +367,10 @@ However, third parties may provide sourc and the logic that binds them to the .Nx kernel will have to be added to the user-edited configuration file. -.Bl -ohang +.Pp +.Bl -ohang -compact +.\" +.Pp .It Ic devclass Ar class Defines a special attribute, named .Em device class . @@ -361,6 +379,8 @@ A given device cannot belong to more tha translates that property by the rule that a device cannot depend on more than one device class, and will properly fill the configuration information file it generates according to that value. +.\" +.Pp .It Ic defflag Oo Ar file Oc Ar option Oo Ar option Oo Ar ... Oc Oc \ Op : Ar dependencies Defines a boolean option, that can either be selected or be un-selected by the @@ -379,6 +399,8 @@ option, it will be empty. Several options can be combined in one header file, for convenience. The header file is created in the compilation directory, making them directly accessible by source files. +.\" +.Pp .It Ic defparam Oo Ar file Oc Ar option Oo = Ar value Oc \ Oo := Ar lint-value Oc Oo Ar option Oo Ar ... Oc Oc Op : Ar dependencies Behaves like @@ -397,6 +419,8 @@ is specified, will use it as a value when generating a lint configuration with .Fl L , and ignore it in all other cases. +.\" +.Pp .It Ic deffs Ar name Op Ar name Op Ar ... Defines a file-system name. It is no more than a regular option, as defined by @@ -407,6 +431,8 @@ file-systems to be compiled in the kerne statement instead of the .Ic options statement. +.\" +.Pp .It Ic obsolete defflag Oo Ar file Oc Ar option Op Ar option Op Ar ... .It Ic obsolete defparam Oo Ar file Oc Ar option Op Ar option Op Ar ... Those two statements are identical and mark the listed option names as @@ -418,6 +444,8 @@ will emit a warning and ignore the optio The optional .Ar file argument should match the original definition of the option. +.\" +.Pp .It Ic define Ar attribute Oo Bro Ar locators Brc Oc Oo : Ar
CVS commit: src/usr.bin/make/unit-tests
Module Name:src Committed By: rillig Date: Fri Jul 31 22:07:28 UTC 2020 Modified Files: src/usr.bin/make/unit-tests: Makefile Log Message: make(1): automate adding or removing test files To generate a diff of this commit: cvs rdiff -u -r1.77 -r1.78 src/usr.bin/make/unit-tests/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/make/unit-tests/Makefile diff -u src/usr.bin/make/unit-tests/Makefile:1.77 src/usr.bin/make/unit-tests/Makefile:1.78 --- src/usr.bin/make/unit-tests/Makefile:1.77 Fri Jul 31 16:42:51 2020 +++ src/usr.bin/make/unit-tests/Makefile Fri Jul 31 22:07:28 2020 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.77 2020/07/31 16:42:51 rillig Exp $ +# $NetBSD: Makefile,v 1.78 2020/07/31 22:07:28 rillig Exp $ # # Unit tests for make(1) # @@ -24,8 +24,11 @@ # and it should be added to the TESTS list. # # Any added files must also be added to src/distrib/sets/lists/tests/mi. -# Makefiles that are not added to TESTS must be ignored in -# src/tests/usr.bin/make/t_make.sh (example: include-sub). +# To do that, just run "make sync-mi" in this directory. +# +# A few *.mk files are helper files for other tests (such as include-sub.mk) +# and are thus not added to TESTS. Such files must be ignored in +# src/tests/usr.bin/make/t_make.sh. # # Each test is in a sub-makefile. @@ -186,6 +189,28 @@ accept: cp $${test}.out ${UNIT_TESTS}/$${test}.exp ; } \ done +SYNC_MI_AWK= \ + BEGIN {\ + testsdir = "usr.bin/make/unit-tests";\ + linestart = "./usr/tests/" testsdir;\ + fmt = linestart "/%s\ttests-usr.bin-tests\tcompattestfile,atf\\n"; \ + cmd = "cd " testsdir " && ls *.exp *.mk | xargs printf '" fmt "'" \ + }\ + function startswith(s, prefix) {\ + return substr(s, 1, length(prefix)) == prefix; \ + }\ + startswith($$1, linestart) && $$1 ~ /\.(exp|mk)$$/ { next } \ + { print $$0 } \ + $$1 == linestart "/Makefile" { system(cmd) } + +sync-mi: + @set -eu; \ + cd "${MAKEFILE:tA:H}/../../.."; \ + mi="distrib/sets/lists/tests/mi";\ + awk ${SYNC_MI_AWK:Q} < "$$mi" > "$$mi.$@"; \ + mv -f "$$mi.$@" "$$mi"; \ + cvs diff "$$mi" || true + .if exists(${TEST_MAKE}) ${TESTS:=.rawout}: ${TEST_MAKE} .endif
CVS commit: src/usr.bin/make/unit-tests
Module Name:src Committed By: rillig Date: Fri Jul 31 22:07:28 UTC 2020 Modified Files: src/usr.bin/make/unit-tests: Makefile Log Message: make(1): automate adding or removing test files To generate a diff of this commit: cvs rdiff -u -r1.77 -r1.78 src/usr.bin/make/unit-tests/Makefile 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
Module Name:src Committed By: rillig Date: Fri Jul 31 19:50:44 UTC 2020 Modified Files: src/usr.bin/make: dir.c Log Message: make(1): refactor DirExpandCurly Separating the low-level parts into small functions reduces the need for summarizing comments between the code lines. Using a consistent naming scheme for the variables and expressive names makes the code easier to understand. The number of variables has increased from 7 to 11, their clearer names compensate for that, plus the fact that they come in triples (x, x_end, x_len). Placing the variables into appropriate registers and eliminating memory access is left as an exercise to the compiler. To generate a diff of this commit: cvs rdiff -u -r1.79 -r1.80 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.79 src/usr.bin/make/dir.c:1.80 --- src/usr.bin/make/dir.c:1.79 Fri Jul 31 19:06:33 2020 +++ src/usr.bin/make/dir.c Fri Jul 31 19:50:44 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: dir.c,v 1.79 2020/07/31 19:06:33 rillig Exp $ */ +/* $NetBSD: dir.c,v 1.80 2020/07/31 19:50:44 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -70,14 +70,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: dir.c,v 1.79 2020/07/31 19:06:33 rillig Exp $"; +static char rcsid[] = "$NetBSD: dir.c,v 1.80 2020/07/31 19:50:44 rillig Exp $"; #else #include #ifndef lint #if 0 static char sccsid[] = "@(#)dir.c 8.2 (Berkeley) 1/2/94"; #else -__RCSID("$NetBSD: dir.c,v 1.79 2020/07/31 19:06:33 rillig Exp $"); +__RCSID("$NetBSD: dir.c,v 1.80 2020/07/31 19:50:44 rillig Exp $"); #endif #endif /* not lint */ #endif @@ -647,6 +647,62 @@ DirMatchFiles(const char *pattern, Path return 0; } +static const char * +closing_brace(const char *p) +{ +int nest = 0; +while (*p != '\0' && !(*p == '}' && nest == 0)) { + if (*p == '{') + nest++; + if (*p == '}') + nest--; + p++; +} +return p; +} + +static const char * +separator_comma(const char *p) +{ +int nest = 0; +while (*p != '\0' && !((*p == '}' || *p == ',') && nest == 0)) { + if (*p == '{') + nest++; + if (*p == '}') + nest--; + p++; +} +return p; +} + +static Boolean +contains_wildcard(const char *p) +{ +for (; *p != '\0'; p++) { + switch(*p) { + case '*': + case '?': + case '{': + case '[': + return TRUE; + } +} +return FALSE; +} + +static char * +concat3(const char *a, size_t a_len, const char *b, size_t b_len, + const char *c, size_t c_len) +{ +size_t s_len = a_len + b_len + c_len; +char *s = bmake_malloc(s_len + 1); +memcpy(s, a, a_len); +memcpy(s + a_len, b, b_len); +memcpy(s + a_len + b_len, c, c_len); +s[s_len] = '\0'; +return s; +} + /*- *--- * DirExpandCurly -- @@ -672,103 +728,51 @@ DirMatchFiles(const char *pattern, Path static void DirExpandCurly(const char *word, const char *brace, Lst path, Lst expansions) { -const char *end; /* Character after the closing brace */ -const char *cp; /* Current position in brace clause */ -const char *start; /* Start of current piece of brace clause */ -int bracelevel; /* Number of braces we've seen. If we see a - * right brace when this is 0, we've hit the - * end of the clause. */ -char *file; /* Current expansion */ -int otherLen; /* The length of the other pieces of the - * expansion (chars before and after the - * clause in 'word') */ -char *cp2; /* Pointer for checking for wildcards in - * expansion before calling Dir_Expand */ +/* Split the word into prefix '{' middle '}' suffix. */ -start = brace+1; +const char *middle = brace + 1; +const char *middle_end = closing_brace(middle); +size_t middle_len = (size_t)(middle_end - middle); -/* - * Find the end of the brace clause first, being wary of nested brace - * clauses. - */ -for (end = start, bracelevel = 0; *end != '\0'; end++) { - if (*end == '{') { - bracelevel++; - } else if (*end == '}' && bracelevel-- == 0) { - break; - } +if (DEBUG(DIR)) { + fprintf(debug_file, "%s: word=\"%s\" middle=\"%.*s\"\n", + __func__, word, (int)middle_len, middle); } -if (DEBUG(DIR)) - fprintf(debug_file, "%s: word=\"%s\" start=\"%s\" end=\"%s\"\n", - __func__, word, start, end); -if (*end == '\0') { - Error("Unterminated {} clause \"%s\"", start); +if (*middle_end == '\0') { + Error("Unterminated {} clause \"%s\"", middle); return; } -end++; -otherLen = brace - word + strlen(end); +const char *prefix = word; +size_t prefix_len = (size_t)(brace - prefix); +const char *suffix = middle_end + 1; +size_t suffix_len =
CVS commit: src/usr.bin/make
Module Name:src Committed By: rillig Date: Fri Jul 31 19:50:44 UTC 2020 Modified Files: src/usr.bin/make: dir.c Log Message: make(1): refactor DirExpandCurly Separating the low-level parts into small functions reduces the need for summarizing comments between the code lines. Using a consistent naming scheme for the variables and expressive names makes the code easier to understand. The number of variables has increased from 7 to 11, their clearer names compensate for that, plus the fact that they come in triples (x, x_end, x_len). Placing the variables into appropriate registers and eliminating memory access is left as an exercise to the compiler. To generate a diff of this commit: cvs rdiff -u -r1.79 -r1.80 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/sys/arch/mips/mips
Module Name:src Committed By: skrll Date: Fri Jul 31 20:04:18 UTC 2020 Modified Files: src/sys/arch/mips/mips: locore.S Log Message: Whitespace / comment alignment To generate a diff of this commit: cvs rdiff -u -r1.224 -r1.225 src/sys/arch/mips/mips/locore.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/mips/mips/locore.S diff -u src/sys/arch/mips/mips/locore.S:1.224 src/sys/arch/mips/mips/locore.S:1.225 --- src/sys/arch/mips/mips/locore.S:1.224 Fri Jul 31 20:03:20 2020 +++ src/sys/arch/mips/mips/locore.S Fri Jul 31 20:04:18 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: locore.S,v 1.224 2020/07/31 20:03:20 skrll Exp $ */ +/* $NetBSD: locore.S,v 1.225 2020/07/31 20:04:18 skrll Exp $ */ /* * Copyright (c) 1992, 1993 @@ -63,7 +63,7 @@ #include #include -RCSID("$NetBSD: locore.S,v 1.224 2020/07/31 20:03:20 skrll Exp $") +RCSID("$NetBSD: locore.S,v 1.225 2020/07/31 20:04:18 skrll Exp $") #include "assym.h" @@ -313,7 +313,7 @@ NESTED(cpu_switchto, CALLFRAME_SIZ, ra) teqi t1, 0 #elif defined(PARANOID_LOOP) and t1, t0, MIPS_SR_INT_IE -2: beqz t1, 2b # status reg should not differ +2: beqz t1, 2b# status reg should not differ nop #endif /* PARANOID_LOOP */ DYNAMIC_STATUS_MASK(t0,ra)
CVS commit: src/sys/arch/mips/mips
Module Name:src Committed By: skrll Date: Fri Jul 31 20:04:18 UTC 2020 Modified Files: src/sys/arch/mips/mips: locore.S Log Message: Whitespace / comment alignment To generate a diff of this commit: cvs rdiff -u -r1.224 -r1.225 src/sys/arch/mips/mips/locore.S 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/unit-tests
Module Name:src Committed By: rillig Date: Fri Jul 31 20:08:08 UTC 2020 Modified Files: src/usr.bin/make/unit-tests: dir.exp dir.mk Log Message: make(1): add more tests for expanding curly braces in dependencies To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/usr.bin/make/unit-tests/dir.exp cvs rdiff -u -r1.2 -r1.3 src/usr.bin/make/unit-tests/dir.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/dir.exp diff -u src/usr.bin/make/unit-tests/dir.exp:1.3 src/usr.bin/make/unit-tests/dir.exp:1.4 --- src/usr.bin/make/unit-tests/dir.exp:1.3 Fri Jul 31 20:02:44 2020 +++ src/usr.bin/make/unit-tests/dir.exp Fri Jul 31 20:08:08 2020 @@ -10,4 +10,9 @@ pre-patch pre-configure patch configure +fetch +fetch-post +extract +extract-post +dup-1 exit status 0 Index: src/usr.bin/make/unit-tests/dir.mk diff -u src/usr.bin/make/unit-tests/dir.mk:1.2 src/usr.bin/make/unit-tests/dir.mk:1.3 --- src/usr.bin/make/unit-tests/dir.mk:1.2 Fri Jul 31 20:02:44 2020 +++ src/usr.bin/make/unit-tests/dir.mk Fri Jul 31 20:08:08 2020 @@ -1,4 +1,4 @@ -# $NetBSD: dir.mk,v 1.2 2020/07/31 20:02:44 rillig Exp $ +# $NetBSD: dir.mk,v 1.3 2020/07/31 20:08:08 rillig Exp $ # # Tests for dir.c. @@ -32,7 +32,21 @@ fourteen: fifteen: @echo 15 +# There may be multiple brace groups side by side. all: {pre-,}{patch,configure} pre-patch patch pre-configure configure: @echo $@ + +# Empty pieces are allowed in the braces. +all: {fetch,extract}{,-post} + +fetch fetch-post extract extract-post: + @echo $@ + +# The expansions may have duplicates. +# These are merged together because of the dependency line. +all: dup-{1,1,1,1,1,1,1} + +dup-1: + @echo $@
CVS commit: src/usr.bin/make/unit-tests
Module Name:src Committed By: rillig Date: Fri Jul 31 20:08:08 UTC 2020 Modified Files: src/usr.bin/make/unit-tests: dir.exp dir.mk Log Message: make(1): add more tests for expanding curly braces in dependencies To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/usr.bin/make/unit-tests/dir.exp cvs rdiff -u -r1.2 -r1.3 src/usr.bin/make/unit-tests/dir.mk Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/raidframe
Module Name:src Committed By: christos Date: Fri Jul 31 20:34:38 UTC 2020 Modified Files: src/sys/dev/raidframe: rf_netbsdkintf.c Log Message: - don't overwrite existing error. - return the error not 0 if failing. To generate a diff of this commit: cvs rdiff -u -r1.386 -r1.387 src/sys/dev/raidframe/rf_netbsdkintf.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/raidframe/rf_netbsdkintf.c diff -u src/sys/dev/raidframe/rf_netbsdkintf.c:1.386 src/sys/dev/raidframe/rf_netbsdkintf.c:1.387 --- src/sys/dev/raidframe/rf_netbsdkintf.c:1.386 Fri Jul 31 15:30:09 2020 +++ src/sys/dev/raidframe/rf_netbsdkintf.c Fri Jul 31 16:34:38 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: rf_netbsdkintf.c,v 1.386 2020/07/31 19:30:09 christos Exp $ */ +/* $NetBSD: rf_netbsdkintf.c,v 1.387 2020/07/31 20:34:38 christos Exp $ */ /*- * Copyright (c) 1996, 1997, 1998, 2008-2011 The NetBSD Foundation, Inc. @@ -101,7 +101,7 @@ ***/ #include -__KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.386 2020/07/31 19:30:09 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.387 2020/07/31 20:34:38 christos Exp $"); #ifdef _KERNEL_OPT #include "opt_raid_autoconfig.h" @@ -3673,7 +3673,7 @@ rf_sync_component_cache(RF_Raid_t *raidP printf("raid%d: cache flush[%d] to component %s failed (%d)\n", raidPtr->raidid, i, raidPtr->Disks[c].devname, e); } - return 0; + return e; } int @@ -3685,7 +3685,7 @@ rf_sync_component_caches(RF_Raid_t *raid for (c = 0; c < raidPtr->numCol; c++) { if (raidPtr->Disks[c].status == rf_ds_optimal) { int e = rf_sync_component_cache(raidPtr, c); - if (error == 0) + if (e && !error) error = e; } } @@ -3695,7 +3695,7 @@ rf_sync_component_caches(RF_Raid_t *raid /* Need to ensure that the reconstruct actually completed! */ if (raidPtr->Disks[sparecol].status == rf_ds_used_spare) { int e = rf_sync_component_cache(raidPtr, sparecol); - if (error == 0) + if (e && !error) error = e; continue; }
CVS commit: src/sys/dev/raidframe
Module Name:src Committed By: christos Date: Fri Jul 31 20:34:38 UTC 2020 Modified Files: src/sys/dev/raidframe: rf_netbsdkintf.c Log Message: - don't overwrite existing error. - return the error not 0 if failing. To generate a diff of this commit: cvs rdiff -u -r1.386 -r1.387 src/sys/dev/raidframe/rf_netbsdkintf.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
Module Name:src Committed By: rillig Date: Fri Jul 31 20:57:39 UTC 2020 Modified Files: src/usr.bin/make: dir.c Log Message: make(1): document another instance of undefined behavior The UNCONST macro is really terrible. This segmentation fault can be forced by setting _PATH_DEFSYSMK in pathnames.h to "./sys*.mk" or any other string that has a slash and a wildcard to the right of the slash. To generate a diff of this commit: cvs rdiff -u -r1.81 -r1.82 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.81 src/usr.bin/make/dir.c:1.82 --- src/usr.bin/make/dir.c:1.81 Fri Jul 31 20:02:44 2020 +++ src/usr.bin/make/dir.c Fri Jul 31 20:57:38 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: dir.c,v 1.81 2020/07/31 20:02:44 rillig Exp $ */ +/* $NetBSD: dir.c,v 1.82 2020/07/31 20:57:38 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -70,14 +70,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: dir.c,v 1.81 2020/07/31 20:02:44 rillig Exp $"; +static char rcsid[] = "$NetBSD: dir.c,v 1.82 2020/07/31 20:57:38 rillig Exp $"; #else #include #ifndef lint #if 0 static char sccsid[] = "@(#)dir.c 8.2 (Berkeley) 1/2/94"; #else -__RCSID("$NetBSD: dir.c,v 1.81 2020/07/31 20:02:44 rillig Exp $"); +__RCSID("$NetBSD: dir.c,v 1.82 2020/07/31 20:57:38 rillig Exp $"); #endif #endif /* not lint */ #endif @@ -852,6 +852,7 @@ DirPrintWord(void *word, void *dummy MAK * * Side Effects: * Directories may be opened. Who knows? + * Undefined behavior if the word is really in read-only memory. *--- */ void
CVS commit: src/usr.bin/make
Module Name:src Committed By: rillig Date: Fri Jul 31 20:57:39 UTC 2020 Modified Files: src/usr.bin/make: dir.c Log Message: make(1): document another instance of undefined behavior The UNCONST macro is really terrible. This segmentation fault can be forced by setting _PATH_DEFSYSMK in pathnames.h to "./sys*.mk" or any other string that has a slash and a wildcard to the right of the slash. To generate a diff of this commit: cvs rdiff -u -r1.81 -r1.82 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/unit-tests
Module Name:src Committed By: rillig Date: Fri Jul 31 20:16:21 UTC 2020 Modified Files: src/usr.bin/make/unit-tests: dir.exp dir.mk Log Message: make(1): add a test for deeply nested brace dependency To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/usr.bin/make/unit-tests/dir.exp cvs rdiff -u -r1.3 -r1.4 src/usr.bin/make/unit-tests/dir.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/dir.exp diff -u src/usr.bin/make/unit-tests/dir.exp:1.4 src/usr.bin/make/unit-tests/dir.exp:1.5 --- src/usr.bin/make/unit-tests/dir.exp:1.4 Fri Jul 31 20:08:08 2020 +++ src/usr.bin/make/unit-tests/dir.exp Fri Jul 31 20:16:21 2020 @@ -15,4 +15,5 @@ fetch-post extract extract-post dup-1 +single-word exit status 0 Index: src/usr.bin/make/unit-tests/dir.mk diff -u src/usr.bin/make/unit-tests/dir.mk:1.3 src/usr.bin/make/unit-tests/dir.mk:1.4 --- src/usr.bin/make/unit-tests/dir.mk:1.3 Fri Jul 31 20:08:08 2020 +++ src/usr.bin/make/unit-tests/dir.mk Fri Jul 31 20:16:21 2020 @@ -1,4 +1,4 @@ -# $NetBSD: dir.mk,v 1.3 2020/07/31 20:08:08 rillig Exp $ +# $NetBSD: dir.mk,v 1.4 2020/07/31 20:16:21 rillig Exp $ # # Tests for dir.c. @@ -50,3 +50,9 @@ all: dup-{1,1,1,1,1,1,1} dup-1: @echo $@ + +# Other than in Bash, the braces are also expanded if there is no comma. +all: {{single-word}} + +single-word: + @echo $@
CVS commit: src/usr.bin/make/unit-tests
Module Name:src Committed By: rillig Date: Fri Jul 31 20:16:21 UTC 2020 Modified Files: src/usr.bin/make/unit-tests: dir.exp dir.mk Log Message: make(1): add a test for deeply nested brace dependency To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/usr.bin/make/unit-tests/dir.exp cvs rdiff -u -r1.3 -r1.4 src/usr.bin/make/unit-tests/dir.mk 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
Module Name:src Committed By: sjg Date: Fri Jul 31 20:22:10 UTC 2020 Modified Files: src/usr.bin/make: main.c make.1 make.h parse.c Log Message: Add -dL for LINT When parsing variable assignments other than := and if value contains '$' attempt Var_Subst the same as for :=, if the value does not parse correctly, we get a fatal error including file an line number. This can greatly help with finding the cause of problems. Reviewed by: christos To generate a diff of this commit: cvs rdiff -u -r1.284 -r1.285 src/usr.bin/make/main.c cvs rdiff -u -r1.283 -r1.284 src/usr.bin/make/make.1 cvs rdiff -u -r1.111 -r1.112 src/usr.bin/make/make.h cvs rdiff -u -r1.242 -r1.243 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
Module Name:src Committed By: sjg Date: Fri Jul 31 20:22:10 UTC 2020 Modified Files: src/usr.bin/make: main.c make.1 make.h parse.c Log Message: Add -dL for LINT When parsing variable assignments other than := and if value contains '$' attempt Var_Subst the same as for :=, if the value does not parse correctly, we get a fatal error including file an line number. This can greatly help with finding the cause of problems. Reviewed by: christos To generate a diff of this commit: cvs rdiff -u -r1.284 -r1.285 src/usr.bin/make/main.c cvs rdiff -u -r1.283 -r1.284 src/usr.bin/make/make.1 cvs rdiff -u -r1.111 -r1.112 src/usr.bin/make/make.h cvs rdiff -u -r1.242 -r1.243 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/main.c diff -u src/usr.bin/make/main.c:1.284 src/usr.bin/make/main.c:1.285 --- src/usr.bin/make/main.c:1.284 Tue Jul 28 16:42:22 2020 +++ src/usr.bin/make/main.c Fri Jul 31 20:22:10 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.284 2020/07/28 16:42:22 rillig Exp $ */ +/* $NetBSD: main.c,v 1.285 2020/07/31 20:22:10 sjg Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -69,7 +69,7 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: main.c,v 1.284 2020/07/28 16:42:22 rillig Exp $"; +static char rcsid[] = "$NetBSD: main.c,v 1.285 2020/07/31 20:22:10 sjg Exp $"; #else #include #ifndef lint @@ -81,7 +81,7 @@ __COPYRIGHT("@(#) Copyright (c) 1988, 19 #if 0 static char sccsid[] = "@(#)main.c 8.3 (Berkeley) 3/19/94"; #else -__RCSID("$NetBSD: main.c,v 1.284 2020/07/28 16:42:22 rillig Exp $"); +__RCSID("$NetBSD: main.c,v 1.285 2020/07/31 20:22:10 sjg Exp $"); #endif #endif /* not lint */ #endif @@ -244,7 +244,7 @@ parse_debug_options(const char *argvalue for (modules = argvalue; *modules; ++modules) { switch (*modules) { case 'A': - debug = ~0; + debug = ~(0|DEBUG_LINT); break; case 'a': debug |= DEBUG_ARCH; @@ -284,6 +284,9 @@ parse_debug_options(const char *argvalue case 'j': debug |= DEBUG_JOB; break; + case 'L': + debug |= DEBUG_LINT; + break; case 'l': debug |= DEBUG_LOUD; break; Index: src/usr.bin/make/make.1 diff -u src/usr.bin/make/make.1:1.283 src/usr.bin/make/make.1:1.284 --- src/usr.bin/make/make.1:1.283 Sat Jul 18 21:37:38 2020 +++ src/usr.bin/make/make.1 Fri Jul 31 20:22:10 2020 @@ -1,4 +1,4 @@ -.\" $NetBSD: make.1,v 1.283 2020/07/18 21:37:38 sjg Exp $ +.\" $NetBSD: make.1,v 1.284 2020/07/31 20:22:10 sjg Exp $ .\" .\" Copyright (c) 1990, 1993 .\" The Regents of the University of California. All rights reserved. @@ -29,7 +29,7 @@ .\" .\" from: @(#)make.1 8.4 (Berkeley) 3/19/94 .\" -.Dd July 18, 2020 +.Dd July 31, 2020 .Dt MAKE 1 .Os .Sh NAME @@ -170,6 +170,11 @@ Print the input graph before exiting on Print debugging information about hash table operations. .It Ar j Print debugging information about running multiple shells. +.It Ar L +Turn on lint checks. +This will throw errors for variable assignments that do not parse +correctly, at the time of assignment so the file and line number +are available. .It Ar l Print commands in Makefiles regardless of whether or not they are prefixed by .Ql @ Index: src/usr.bin/make/make.h diff -u src/usr.bin/make/make.h:1.111 src/usr.bin/make/make.h:1.112 --- src/usr.bin/make/make.h:1.111 Tue Jul 21 21:13:24 2020 +++ src/usr.bin/make/make.h Fri Jul 31 20:22:10 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: make.h,v 1.111 2020/07/21 21:13:24 rillig Exp $ */ +/* $NetBSD: make.h,v 1.112 2020/07/31 20:22:10 sjg Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -474,6 +474,8 @@ extern int debug; #define DEBUG_PARSE 0x4 #define DEBUG_CWD 0x8 +#define DEBUG_LINT 0x10 + #define CONCAT(a,b) a##b #define DEBUG(module) (debug & CONCAT(DEBUG_,module)) Index: src/usr.bin/make/parse.c diff -u src/usr.bin/make/parse.c:1.242 src/usr.bin/make/parse.c:1.243 --- src/usr.bin/make/parse.c:1.242 Tue Jul 28 19:13:49 2020 +++ src/usr.bin/make/parse.c Fri Jul 31 20:22:10 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: parse.c,v 1.242 2020/07/28 19:13:49 rillig Exp $ */ +/* $NetBSD: parse.c,v 1.243 2020/07/31 20:22:10 sjg Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -69,14 +69,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: parse.c,v 1.242 2020/07/28 19:13:49 rillig Exp $"; +static char rcsid[] = "$NetBSD: parse.c,v 1.243 2020/07/31 20:22:10 sjg Exp $"; #else #include #ifndef lint #if 0 static char sccsid[] = "@(#)parse.c 8.3 (Berkeley) 3/19/94"; #else -__RCSID("$NetBSD: parse.c,v 1.242 2020/07/28 19:13:49 rillig Exp $"); +__RCSID("$NetBSD: parse.c,v 1.243 2020/07/31 20:22:10 sjg Exp $"); #endif #endif /* not lint */ #endif @@ -1948,6 +1948,16 @@ Parse_DoVar(char *line, GNode *ctxt) while (isspace((unsigned char)*cp)) cp++; +if (DEBUG(LINT)) { + if (type != VAR_SUBST && strchr(cp,
CVS commit: src/sys/dev/raidframe
Module Name:src Committed By: christos Date: Fri Jul 31 20:35:34 UTC 2020 Modified Files: src/sys/dev/raidframe: rf_netbsdkintf.c Log Message: no need for continue To generate a diff of this commit: cvs rdiff -u -r1.387 -r1.388 src/sys/dev/raidframe/rf_netbsdkintf.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/raidframe/rf_netbsdkintf.c diff -u src/sys/dev/raidframe/rf_netbsdkintf.c:1.387 src/sys/dev/raidframe/rf_netbsdkintf.c:1.388 --- src/sys/dev/raidframe/rf_netbsdkintf.c:1.387 Fri Jul 31 16:34:38 2020 +++ src/sys/dev/raidframe/rf_netbsdkintf.c Fri Jul 31 16:35:33 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: rf_netbsdkintf.c,v 1.387 2020/07/31 20:34:38 christos Exp $ */ +/* $NetBSD: rf_netbsdkintf.c,v 1.388 2020/07/31 20:35:33 christos Exp $ */ /*- * Copyright (c) 1996, 1997, 1998, 2008-2011 The NetBSD Foundation, Inc. @@ -101,7 +101,7 @@ ***/ #include -__KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.387 2020/07/31 20:34:38 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.388 2020/07/31 20:35:33 christos Exp $"); #ifdef _KERNEL_OPT #include "opt_raid_autoconfig.h" @@ -3697,7 +3697,6 @@ rf_sync_component_caches(RF_Raid_t *raid int e = rf_sync_component_cache(raidPtr, sparecol); if (e && !error) error = e; - continue; } } return error;
CVS commit: src/sys/dev/raidframe
Module Name:src Committed By: christos Date: Fri Jul 31 20:35:34 UTC 2020 Modified Files: src/sys/dev/raidframe: rf_netbsdkintf.c Log Message: no need for continue To generate a diff of this commit: cvs rdiff -u -r1.387 -r1.388 src/sys/dev/raidframe/rf_netbsdkintf.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/wsfont
Module Name:src Committed By: fcambus Date: Fri Jul 31 20:39:50 UTC 2020 Modified Files: src/sys/dev/wsfont: spleen16x32.h spleen32x64.h spleen8x16.h Log Message: Update Spleen kernel fonts to version 1.8.2, bringing the following improvements: - Fix size of the lower case 'ae' character in the 16x32 and 32x64 versions - Shorten parentheses, square brackets, braces, slash, backslash in the 8x16 version, fixing alignment issues - Shift vertical line and double vertical line characters one pixel up in the 8x16 version To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/sys/dev/wsfont/spleen16x32.h cvs rdiff -u -r1.7 -r1.8 src/sys/dev/wsfont/spleen32x64.h cvs rdiff -u -r1.5 -r1.6 src/sys/dev/wsfont/spleen8x16.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/share/wscons/fonts
Module Name:src Committed By: fcambus Date: Fri Jul 31 20:46:53 UTC 2020 Modified Files: src/share/wscons/fonts: spleen-16x32.fnt.uue spleen-32x64.fnt.uue spleen-8x16.fnt.uue Log Message: Update Spleen wscons fonts to version 1.8.2, bringing the following improvements: - Fix size of the lower case 'ae' character in the 16x32 and 32x64 versions - Shorten parentheses, square brackets, braces, slash, backslash in the 8x16 version, fixing alignment issues - Shift vertical line and double vertical line characters one pixel up in the 8x16 version To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/share/wscons/fonts/spleen-16x32.fnt.uue \ src/share/wscons/fonts/spleen-32x64.fnt.uue \ src/share/wscons/fonts/spleen-8x16.fnt.uue Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/share/wscons/fonts/spleen-16x32.fnt.uue diff -u src/share/wscons/fonts/spleen-16x32.fnt.uue:1.2 src/share/wscons/fonts/spleen-16x32.fnt.uue:1.3 --- src/share/wscons/fonts/spleen-16x32.fnt.uue:1.2 Mon Jul 20 13:58:52 2020 +++ src/share/wscons/fonts/spleen-16x32.fnt.uue Fri Jul 31 20:46:53 2020 @@ -326,8 +326,8 @@ M``X,'PP[G#'X,/`?\!_X`!P`#``,#_P M##`,,`PP'_`?^``<``P` M#`_\'_PX##`,,`PP##@,'_P/_`'``^`&,`8P M!C`#X`'``!_P'_@`'``,``P/_!_\.`PP##`,,`PX#!_\#_P` -M```?/Q__`>,`PP###\,?_SC_ -M,,`PP##`.>`?_P\_ +M```>?!_\`\P!C`&,#XP?_#G\ +M,8`Q@#&`.<`?_`]\ M#_P?_#@`,``P`#``,``P`#``,``P`#@`'_P/_`#``,``P`'``X`# M!@`'``.``<``X`!@``_\'_PX##`,,`PP##_\/_PP`#``,``X M`!_\#_PP`'``X`'``X`#```/_!_\ Index: src/share/wscons/fonts/spleen-32x64.fnt.uue diff -u src/share/wscons/fonts/spleen-32x64.fnt.uue:1.2 src/share/wscons/fonts/spleen-32x64.fnt.uue:1.3 --- src/share/wscons/fonts/spleen-32x64.fnt.uue:1.2 Mon Jul 20 13:58:52 2020 +++ src/share/wscons/fonts/spleen-32x64.fnt.uue Fri Jul 31 20:46:53 2020 @@ -1309,10 +1309,10 @@ M__`'___P!\``\`^``/`/``#P#P``\`\``/`/``# M\`?___`#___P`?__\`!___`` M M -M```#_P__`_^?_P/___\#``/\ -M#P`!^`\``/`/``#P#P``\`\``/`/`'_P#P'_\`\#!P?`__\/@/__ -M#P#P``\`\``/`/``#P#P``\`\``/`/``#X'X``?#_``'`P'_G_\` -M?P__ +M```#_#_P`_Y_\`/___`#___P``_P +M\``'X/```\#P``/`\``#P/```\#P`'_`\`'_P/`#___P!___\`?#__`/@__P +M#P/```\#P``/`\``#P/```\#P``/`\``#X/@``?'\``'___P`___\`'^?_`` +M?#_P M M M`'__\`'___`#___P!___\`?/@```#P\/ Index: src/share/wscons/fonts/spleen-8x16.fnt.uue diff -u src/share/wscons/fonts/spleen-8x16.fnt.uue:1.2 src/share/wscons/fonts/spleen-8x16.fnt.uue:1.3 --- src/share/wscons/fonts/spleen-8x16.fnt.uue:1.2 Mon Jul 20 13:58:52 2020 +++ src/share/wscons/fonts/spleen-8x16.fnt.uue Fri Jul 31 20:46:53 2020 @@ -13,10 +13,10 @@ M``` M```8&!@8&!@8`!@8 M``!F9F9F`_FQL;^;``!!^T-#0?!86 M%A;\$```!F9L#!@8,#9F8#AL;<-K,S'H``!@8&!@`
CVS commit: src/share/wscons/fonts
Module Name:src Committed By: fcambus Date: Fri Jul 31 20:46:53 UTC 2020 Modified Files: src/share/wscons/fonts: spleen-16x32.fnt.uue spleen-32x64.fnt.uue spleen-8x16.fnt.uue Log Message: Update Spleen wscons fonts to version 1.8.2, bringing the following improvements: - Fix size of the lower case 'ae' character in the 16x32 and 32x64 versions - Shorten parentheses, square brackets, braces, slash, backslash in the 8x16 version, fixing alignment issues - Shift vertical line and double vertical line characters one pixel up in the 8x16 version To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/share/wscons/fonts/spleen-16x32.fnt.uue \ src/share/wscons/fonts/spleen-32x64.fnt.uue \ src/share/wscons/fonts/spleen-8x16.fnt.uue Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/usr.bin/config
Module Name:src Committed By: uwe Date: Fri Jul 31 23:42:21 UTC 2020 Modified Files: src/usr.bin/config: config.5 Log Message: The tale of two makeoptions. There are two forms that were both documented in the selections section, but the form with the condition (and only that form) can be used only in the descriptions section. Move it to the appropriate .Ss and add prominent notice to both. To generate a diff of this commit: cvs rdiff -u -r1.41 -r1.42 src/usr.bin/config/config.5 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/config/config.5 diff -u src/usr.bin/config/config.5:1.41 src/usr.bin/config/config.5:1.42 --- src/usr.bin/config/config.5:1.41 Fri Jul 31 23:30:23 2020 +++ src/usr.bin/config/config.5 Fri Jul 31 23:42:21 2020 @@ -1,4 +1,4 @@ -.\" $NetBSD: config.5,v 1.41 2020/07/31 23:30:23 uwe Exp $ +.\" $NetBSD: config.5,v 1.42 2020/07/31 23:42:21 uwe Exp $ .\" .\" Copyright (c) 2006, 2007 The NetBSD Foundation. .\" All rights reserved. @@ -666,6 +666,26 @@ indicates when the relevant line should and works just like the .Ic file statement. +.\" +.Pp +.It Ic makeoptions \ +Ar condition name Ns Ic += Ns Ar value \ +Ns Op Ic \&, Ar condition name Ns Ic += Ns Ar value \ +Ns Op Ic \&, Ar ... +Appends to a definition in the generated +.Pa Makefile . +.Pp +This variant of +.Ic makeoptions +belongs to the options description section. +The +.Ar condition +is mandatory and only +.Ic += +can be used. +Not to be confused with the the confusingly similar variant of +.Ic makeoptions +used in the selections section. .El .\" .\" @@ -868,14 +888,18 @@ is defined with the .Ar value is defined as an option too. -.\" -.\" XXX: This variant of makeoptions can only be specified in the descriptions. -.It Ic makeoptions \ -Ar condition name Ns Ic += Ns Ar value \ -Ns Op Ic \&, Ar condition name Ns Ic += Ns Ar value \ -Ns Op Ic \&, Ar ... -Appends to a definition in the generated -.Pa Makefile . +.Pp +This variant of +.Ic makeoptions +belongs to the options selection section. +Both +.Ic = +and +.Ic += +can be used. +Not to be confused with the confusingly similar variant of +.Ic makeoptions +used in the descriptions section. .\" .It Ic no makeoptions Ar name Op , Ar name Op , Ar ... Removes one or more definitions from the generated
CVS commit: src/usr.bin/config
Module Name:src Committed By: uwe Date: Fri Jul 31 23:42:21 UTC 2020 Modified Files: src/usr.bin/config: config.5 Log Message: The tale of two makeoptions. There are two forms that were both documented in the selections section, but the form with the condition (and only that form) can be used only in the descriptions section. Move it to the appropriate .Ss and add prominent notice to both. To generate a diff of this commit: cvs rdiff -u -r1.41 -r1.42 src/usr.bin/config/config.5 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/usr.bin/config
Module Name:src Committed By: uwe Date: Fri Jul 31 23:44:04 UTC 2020 Modified Files: src/usr.bin/config: config.5 Log Message: Missed formatting fixes for "no makeoptions". To generate a diff of this commit: cvs rdiff -u -r1.42 -r1.43 src/usr.bin/config/config.5 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/config/config.5 diff -u src/usr.bin/config/config.5:1.42 src/usr.bin/config/config.5:1.43 --- src/usr.bin/config/config.5:1.42 Fri Jul 31 23:42:21 2020 +++ src/usr.bin/config/config.5 Fri Jul 31 23:44:04 2020 @@ -1,4 +1,4 @@ -.\" $NetBSD: config.5,v 1.42 2020/07/31 23:42:21 uwe Exp $ +.\" $NetBSD: config.5,v 1.43 2020/07/31 23:44:04 uwe Exp $ .\" .\" Copyright (c) 2006, 2007 The NetBSD Foundation. .\" All rights reserved. @@ -901,7 +901,10 @@ Not to be confused with the confusingly .Ic makeoptions used in the descriptions section. .\" -.It Ic no makeoptions Ar name Op , Ar name Op , Ar ... +.It Ic no makeoptions \ +Ar name \ +Ns Op Ic \&, Ar name \ +Ns Op Ic \&, Ar ... Removes one or more definitions from the generated .Pa Makefile . .\"
CVS commit: src/usr.bin/config
Module Name:src Committed By: uwe Date: Fri Jul 31 23:44:04 UTC 2020 Modified Files: src/usr.bin/config: config.5 Log Message: Missed formatting fixes for "no makeoptions". To generate a diff of this commit: cvs rdiff -u -r1.42 -r1.43 src/usr.bin/config/config.5 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/usr.bin/config
Module Name:src Committed By: uwe Date: Fri Jul 31 23:30:23 UTC 2020 Modified Files: src/usr.bin/config: config.5 Log Message: Formatting improvements. To generate a diff of this commit: cvs rdiff -u -r1.40 -r1.41 src/usr.bin/config/config.5 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/config/config.5 diff -u src/usr.bin/config/config.5:1.40 src/usr.bin/config/config.5:1.41 --- src/usr.bin/config/config.5:1.40 Fri Jul 31 21:25:34 2020 +++ src/usr.bin/config/config.5 Fri Jul 31 23:30:23 2020 @@ -1,4 +1,4 @@ -.\" $NetBSD: config.5,v 1.40 2020/07/31 21:25:34 uwe Exp $ +.\" $NetBSD: config.5,v 1.41 2020/07/31 23:30:23 uwe Exp $ .\" .\" Copyright (c) 2006, 2007 The NetBSD Foundation. .\" All rights reserved. @@ -342,7 +342,7 @@ the preamble may contain the following o .It Ic build Ar path Defines the build directory for the compilation of the kernel. It replaces the default of -.Pa ../compile/ +.Pa ../compile/ Ns Aq Ar config-file and is superseded by the .Fl b parameter of @@ -381,10 +381,14 @@ one device class, and will properly fill generates according to that value. .\" .Pp -.It Ic defflag Oo Ar file Oc Ar option Oo Ar option Oo Ar ... Oc Oc \ -Op : Ar dependencies -Defines a boolean option, that can either be selected or be un-selected by the -user with the +.It Ic defflag \ +Oo Ar file Oc \ +Ar option \ +Oo Ar option Oo Ar ... Oc Oc \ +Op Ic \&: Ar dependencies +Defines a boolean +.Ar option , +that can either be selected or be un-selected by the user with the .Ic options statement. The optional @@ -392,7 +396,7 @@ The optional argument names a header file that will contain the C pre-processor definition for the option. If no file name is given, it will default to -.Ar opt_.h . +.Li opt_ Ns Ao Ar option Ac Ns Li \&.h . .Xr config 1 will always create the header file, but if the user choose not to select the option, it will be empty. @@ -401,8 +405,12 @@ The header file is created in the compil accessible by source files. .\" .Pp -.It Ic defparam Oo Ar file Oc Ar option Oo = Ar value Oc \ -Oo := Ar lint-value Oc Oo Ar option Oo Ar ... Oc Oc Op : Ar dependencies +.It Ic defparam \ +Oo Ar file Oc \ +Ar option Ns Oo Ns Ic = Ns Ar value\^ Oc \ +Oo Ns Ic \&:= Ns Ar lint-value Oc \ +Oo Ar option Oo Ar ... Oc Oc \ +Op Ic \&:\~ Ns Ar dependencies Behaves like .Ic defflag , except the defined option must have a value. @@ -421,8 +429,9 @@ will use it as a value when generating a and ignore it in all other cases. .\" .Pp -.It Ic deffs Ar name Op Ar name Op Ar ... -Defines a file-system name. +.It Ic deffs Ar name ... +Defines a file-system +.Ar name . It is no more than a regular option, as defined by .Ic defflag , but it allows the user to select the @@ -433,8 +442,12 @@ statement instead of the statement. .\" .Pp -.It Ic obsolete defflag Oo Ar file Oc Ar option Op Ar option Op Ar ... -.It Ic obsolete defparam Oo Ar file Oc Ar option Op Ar option Op Ar ... +.It Ic obsolete defflag \ +Oo Ar file Oc \ +Ar option ... +.It Ic obsolete defparam \ +Oo Ar file Oc \ +Ar option ... Those two statements are identical and mark the listed option names as obsolete. If the user selects one of the listed options in the kernel configuration @@ -446,13 +459,16 @@ The optional argument should match the original definition of the option. .\" .Pp -.It Ic define Ar attribute Oo Bro Ar locators Brc Oc Oo : Ar dependencies Oc +.It Ic define \ +Ar attribute \ +Oo Ic \&{ Ar locators Ic \&} Oc \ +Op Ic \&: Ar dependencies Defines an .Ar attribute . The .Ar locators list is optional, and can be empty. -If the pair of brackets are present, the locator list is defined and the +If the pair of braces are present, the locator list is defined and the declared attribute becomes an .Em interface attribute , on which devices can attach. @@ -462,7 +478,7 @@ on which devices can attach. Defines the maximum number of partitions the disklabels for the considered architecture can hold. This statement cannot be repeated and should only appear in the -.Pa std\&.$\&{ARCH\&} +.Pa "std.${ARCH}" file. .\" .Pp @@ -479,7 +495,10 @@ statement in the configuration file, the is used instead. .\" .Pp -.It Ic device Ar base Oo Bro Ar locators Brc Oc Oo : dependencies Oc +.It Ic device \ +Ar base \ +Oo Ic \&{ Ar locators Ic \&} Oc \ +Op Ic \&: Ar dependencies Declares a device of name .Ar base . The optional list of @@ -489,7 +508,7 @@ directly to it. Internally, that means .Ar base becomes an -.Ar interface attribute . +.Em interface attribute . For every device the user selects, .Xr config 1 will add the matching @@ -501,17 +520,20 @@ However, it is the responsibility of the line to the source of the device's driver. .\" .Pp -.It Ic attach Ar base Ic at Ar attr Oo , Ar attr Oo , Ar
CVS commit: src/usr.bin/config
Module Name:src Committed By: uwe Date: Fri Jul 31 23:30:23 UTC 2020 Modified Files: src/usr.bin/config: config.5 Log Message: Formatting improvements. To generate a diff of this commit: cvs rdiff -u -r1.40 -r1.41 src/usr.bin/config/config.5 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/usr.bin/config
Module Name:src Committed By: uwe Date: Fri Jul 31 23:55:57 UTC 2020 Modified Files: src/usr.bin/config: config.5 Log Message: Swtich from -ohang to -tag lists. -ohang lists are hard to read b/c long config directives are almost impossible to tell from the following text. Occasional multi-paragraph descriptions were quite confusing too. To generate a diff of this commit: cvs rdiff -u -r1.43 -r1.44 src/usr.bin/config/config.5 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/config/config.5 diff -u src/usr.bin/config/config.5:1.43 src/usr.bin/config/config.5:1.44 --- src/usr.bin/config/config.5:1.43 Fri Jul 31 23:44:04 2020 +++ src/usr.bin/config/config.5 Fri Jul 31 23:55:57 2020 @@ -1,4 +1,4 @@ -.\" $NetBSD: config.5,v 1.43 2020/07/31 23:44:04 uwe Exp $ +.\" $NetBSD: config.5,v 1.44 2020/07/31 23:55:57 uwe Exp $ .\" .\" Copyright (c) 2006, 2007 The NetBSD Foundation. .\" All rights reserved. @@ -249,7 +249,7 @@ to combine options and attributes . .\" .Ss CONTEXT NEUTRAL STATEMENTS .\" -.Bl -ohang -compact +.Bl -tag -width Ic -compact .\" .Pp .It Ic version Ar mmdd @@ -337,7 +337,7 @@ In addition to and .Ic prefix , the preamble may contain the following optional statements: -.Bl -ohang +.Bl -tag -width Ic .\" .It Ic build Ar path Defines the build directory for the compilation of the kernel. @@ -368,7 +368,7 @@ and the logic that binds them to the .Nx kernel will have to be added to the user-edited configuration file. .Pp -.Bl -ohang -compact +.Bl -tag -width Ic -compact .\" .Pp .It Ic devclass Ar class @@ -691,7 +691,7 @@ used in the selections section. .\" .Ss OPTIONS SELECTION .\" -.Bl -ohang +.Bl -tag -width Ic .\" .It Ic machine Ar machine Op Ar arch Op Ar subarch Op Ar ... The @@ -701,7 +701,7 @@ exception of context-neutral statements. It makes .Xr config 1 include, in that order, the following files: -.Bl -enum -offset indent -compact +.Bl -enum .It .Pa conf/files .It @@ -713,6 +713,7 @@ for each defined sub-architecture .It .Pa arch/${MACHINE}/conf/files.${MACHINE} .El +.Pp It also defines an attribute for the .Ar machine , the
CVS commit: src/usr.bin/config
Module Name:src Committed By: uwe Date: Fri Jul 31 23:55:57 UTC 2020 Modified Files: src/usr.bin/config: config.5 Log Message: Swtich from -ohang to -tag lists. -ohang lists are hard to read b/c long config directives are almost impossible to tell from the following text. Occasional multi-paragraph descriptions were quite confusing too. To generate a diff of this commit: cvs rdiff -u -r1.43 -r1.44 src/usr.bin/config/config.5 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/usr.bin/config
Module Name:src Committed By: uwe Date: Sat Aug 1 00:35:36 UTC 2020 Modified Files: src/usr.bin/config: config.samples.5 Log Message: Minor formatting tweaks. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/usr.bin/config/config.samples.5 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/config/config.samples.5 diff -u src/usr.bin/config/config.samples.5:1.6 src/usr.bin/config/config.samples.5:1.7 --- src/usr.bin/config/config.samples.5:1.6 Thu Mar 6 15:00:21 2014 +++ src/usr.bin/config/config.samples.5 Sat Aug 1 00:35:36 2020 @@ -1,4 +1,4 @@ -.\" $NetBSD: config.samples.5,v 1.6 2014/03/06 15:00:21 riastradh Exp $ +.\" $NetBSD: config.samples.5,v 1.7 2020/08/01 00:35:36 uwe Exp $ .\" .\" Copyright (c) 2006 The NetBSD Foundation. .\" All rights reserved. @@ -40,23 +40,27 @@ The following lines from the kernel configuration file of .Nx Ns / Ns i386 are examples of instances of drivers: -.Bd -literal -pchb* at pci? dev ? function ? # PCI-Host bridges -pcib* at pci? dev ? function ? # PCI-ISA bridges -ppb* at pci? dev ? function ? # PCI-PCI bridges +.Bd -literal -offset indent +pchb* at pci? dev ? function ?# PCI-Host bridges +pcib* at pci? dev ? function ?# PCI-ISA bridges +ppb* at pci? dev ? function ?# PCI-PCI bridges -siop* at pci? dev ? function ? # Symbios 53c8xx SCSI -esiop* at pci? dev ? function ? # Symbios 53c875 SCSI and newer +siop* at pci? dev ? function ?# Symbios 53c8xx SCSI +esiop* at pci? dev ? function ?# Symbios 53c875 SCSI and newer -ix0 at isa? port 0x300 irq 10 # EtherExpress/16 +ix0 at isa? port 0x300 irq 10 # EtherExpress/16 .Ed .Pp The first three instances allow three different drivers to attach to all the -matching devices found on any PCI bus. +matching devices found on any +.Tn PCI +bus. This is the most generic case. .Pp The next two lines allow two distinct drivers to attach to any matching device -found on any PCI bus, but those two drivers are special because they both +found on any +.Tn PCI +bus, but those two drivers are special because they both support some of the same devices. Each of the driver has a matching function that returns their score for the device that is being considered. @@ -66,12 +70,19 @@ Of course, it is deterministic so if the attaches to the device, the instance of the other driver will have to be removed, e.g. by commenting it out. .Pp -The last line configures an instance of an ISA device. -Unlike the PCI bus, the ISA bus cannot discover the devices that are present on -the bus. +The last line configures an instance of an +.Tn ISA +device. +Unlike the +.Tn PCI +bus, the +.Tn ISA +bus cannot discover the devices that are present on the bus. The driver has to try accessing the device in order to discover it. That implies locators must be specified to some extent: a driver would -usually need the base address of the device, some need the IRQ line that the +usually need the base address of the device, some need the +.Tn IRQ +line that the device is configured to use, though some others would just try a set of known values, at the risk of badly interacting with other devices on the bus. .Ss Hard-wiring kernel configuration @@ -84,7 +95,7 @@ changes, even slightly. Let's consider the following excerpt of .Xr dmesg 8 output: -.Bd -literal +.Bd -literal -offset indent auich0 at pci0 dev 31 function 5: i82801DB/DBM (ICH4/ICH4M) AC-97 Audio .Ed .Pp @@ -93,17 +104,17 @@ The driver (which controls Intel's AC-97 audio chips) attached there because of the following instance of .Pa GENERIC : -.Bd -literal +.Bd -literal -offset indent auich* at pci? dev ? function ? .Ed .Pp Hard-wiring that instance means re-writing it to the following: -.Bd -literal +.Bd -literal -offset indent auich0 at pci0 dev 31 function 5 .Ed .Pp and that way, -.Ar auich0 +.Li auich0 will attach to that specific location, or will not attach. .Ss Removing options and drivers When two kernel configurations differ by a very small number of changes, it is @@ -121,14 +132,16 @@ Additions to .Pa GENERIC will then automatically be followed and used in case they are relevant. .Pp -While negating an options (with -.Ic no options ) +While negating an +.Ic options +with +.Ic no options is unambiguous, it is not as clear for devices instances. .Pp The -.Ic no Ar instance definition +.Ic no Ar instance-definition statements of -.Xr config 1 +.Xr config 5 syntax only apply on the current state of the configuration file, not on the resulting kernel binary. .Xr autoconf 9 @@ -142,7 +155,7 @@ attaching at but I do not want any instance of .Xr ath 4 attaching at -.Ar pci3 . +.Li pci3 . .Dc .Ed .Pp @@ -162,11 +175,11 @@ no device at isa0 .Ed .Pp One could actually live without the -.Ar isa0 +.Li isa0 instance, as all the legacy devices are attached at -.Ar acpi0 . +.Li acpi0 . But
CVS commit: src/usr.bin/config
Module Name:src Committed By: uwe Date: Sat Aug 1 00:35:36 UTC 2020 Modified Files: src/usr.bin/config: config.samples.5 Log Message: Minor formatting tweaks. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/usr.bin/config/config.samples.5 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: xsrc/external/mit/xorg-server/dist/hw/sun
Module Name:xsrc Committed By: tsutsui Date: Sat Aug 1 01:49:58 UTC 2020 Modified Files: xsrc/external/mit/xorg-server/dist/hw/sun: sunKbd.c Log Message: Use "empty" for rmlvo model and layout to avoid lingering default settings. Now all modifier keys (CTRL, SHIFT, and NumLock) work as expected. It seems XkbApplyMappingChange() doesn't update some XKB modifier settings even if new modmap data is specified. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 xsrc/external/mit/xorg-server/dist/hw/sun/sunKbd.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: xsrc/external/mit/xorg-server/dist/hw/sun
Module Name:xsrc Committed By: tsutsui Date: Sat Aug 1 01:49:58 UTC 2020 Modified Files: xsrc/external/mit/xorg-server/dist/hw/sun: sunKbd.c Log Message: Use "empty" for rmlvo model and layout to avoid lingering default settings. Now all modifier keys (CTRL, SHIFT, and NumLock) work as expected. It seems XkbApplyMappingChange() doesn't update some XKB modifier settings even if new modmap data is specified. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 xsrc/external/mit/xorg-server/dist/hw/sun/sunKbd.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: xsrc/external/mit/xorg-server/dist/hw/sun/sunKbd.c diff -u xsrc/external/mit/xorg-server/dist/hw/sun/sunKbd.c:1.4 xsrc/external/mit/xorg-server/dist/hw/sun/sunKbd.c:1.5 --- xsrc/external/mit/xorg-server/dist/hw/sun/sunKbd.c:1.4 Thu Jul 30 14:15:49 2020 +++ xsrc/external/mit/xorg-server/dist/hw/sun/sunKbd.c Sat Aug 1 01:49:58 2020 @@ -592,8 +592,8 @@ sunInitKbdNames(XkbRMLVOSet *rmlvo, sunK } #else rmlvo->rules = "base"; -rmlvo->model = NULL; -rmlvo->layout = NULL; +rmlvo->model = "empty"; +rmlvo->layout = "empty"; rmlvo->variant = NULL; rmlvo->options = NULL; #endif @@ -649,9 +649,10 @@ sunKbdProc(DeviceIntPtr device, int what sunInitKbdNames(, pKeyboard->devicePrivate); #if 0 /* XXX needs more work for Xorg xkb */ - InitKeyboardDeviceStruct(device, rmlvo, + InitKeyboardDeviceStruct(device, , sunBell, sunKbdCtrl); #else + XkbSetRulesDflts(); InitKeyboardDeviceStruct(device, NULL, sunBell, sunKbdCtrl); XkbApplyMappingChange(device, workingKeySyms,
CVS commit: src
Module Name:src Committed By: riastradh Date: Sat Aug 1 02:04:55 UTC 2020 Modified Files: src/share/man/man9: kthread.9 src/sys/kern: kern_kthread.c kern_stub.c src/sys/sys: kthread.h lwp.h Log Message: New functions kthread_fpu_enter/exit. The MI definitions don't do anything but maintain a flag, but MD code can define kthread_fpu_enter/exit_md to actually enable/disable the FPU. (These are almost pcu_load/discard on systems that use pcu(9), except they apply to all PCUs.) Discussed on tech-kern: https://mail-index.netbsd.org/tech-kern/2020/06/20/msg026524.html The proposed kthread flag KTHREAD_FPU is not included because I couldn't find any particular need for it that would not be covered by just calling kthread_fpu_enter/exit in the kthread function. To generate a diff of this commit: cvs rdiff -u -r1.28 -r1.29 src/share/man/man9/kthread.9 cvs rdiff -u -r1.45 -r1.46 src/sys/kern/kern_kthread.c cvs rdiff -u -r1.49 -r1.50 src/sys/kern/kern_stub.c cvs rdiff -u -r1.13 -r1.14 src/sys/sys/kthread.h cvs rdiff -u -r1.210 -r1.211 src/sys/sys/lwp.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/share/man/man9/kthread.9 diff -u src/share/man/man9/kthread.9:1.28 src/share/man/man9/kthread.9:1.29 --- src/share/man/man9/kthread.9:1.28 Tue Apr 21 11:10:29 2015 +++ src/share/man/man9/kthread.9 Sat Aug 1 02:04:55 2020 @@ -1,4 +1,4 @@ -.\" $NetBSD: kthread.9,v 1.28 2015/04/21 11:10:29 pooka Exp $ +.\" $NetBSD: kthread.9,v 1.29 2020/08/01 02:04:55 riastradh Exp $ .\" .\" Copyright (c) 2000, 2007, 2008 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -33,7 +33,9 @@ .Sh NAME .Nm kthread_create , .Nm kthread_exit , -.Nm kthread_join +.Nm kthread_join , +.Nm kthread_fpu_enter , +.Nm kthread_fpu_exit .Nd kernel threads .Sh SYNOPSIS .In sys/kthread.h @@ -44,6 +46,10 @@ .Fn kthread_exit "int ecode" .Ft int .Fn kthread_join "lwp_t *l" +.Ft int +.Fn kthread_fpu_enter +.Ft void +.Fn kthread_fpu_exit "int s" .Sh DESCRIPTION Kernel threads are light-weight processes which execute entirely within the kernel. @@ -51,6 +57,13 @@ within the kernel. Any process can request the creation of a new kernel thread. Kernel threads are not swapped out during memory congestion. The VM space and limits are shared with proc0 (usually swapper). +.Pp +If the machine has any per-CPU floating-point units or SIMD vector +units that are normally available to user threads, they can be used by +kthreads between +.Fn kthread_fpu_enter +and +.fn kthread_fpu_exit . .Sh FUNCTIONS .Bl -tag -width compact .It Fn kthread_create "pri" "flags" "ci" "func" "arg" "newlp" "fmt" "..." @@ -155,6 +168,31 @@ created using the .Dv KTHREAD_MUSTJOIN flag and would wait on .Fa kthread_exit . +.It Fn kthread_fpu_enter +Allow the current kthread to use any machine-dependent per-CPU +floating-point units or SIMD vector units normally available to user +threads. +Returns a cookie that must be passed to +.Fn kthread_fpu_exit +when done. +.Pp +Matching pairs of +.Fn kthread_fpu_enter +and +.Fn kthread_fpu_exit +may be nested. +.It Fn kthread_fpu_exit "s" +Restore the current kthread's access to machine-dependent per-CPU +floating-point units or SIMD vector units to what it was before the +call to +.Fn kthread_fpu_enter +that returned +.Fa s . +.Pp +On the last +.Fn kthread_fpu_exit , +zero all the units' registers to avoid leaking secrets \(em such units +are often used for cryptography. .El .Sh RETURN VALUES Upon successful completion, Index: src/sys/kern/kern_kthread.c diff -u src/sys/kern/kern_kthread.c:1.45 src/sys/kern/kern_kthread.c:1.46 --- src/sys/kern/kern_kthread.c:1.45 Wed Jan 8 17:38:42 2020 +++ src/sys/kern/kern_kthread.c Sat Aug 1 02:04:55 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: kern_kthread.c,v 1.45 2020/01/08 17:38:42 ad Exp $ */ +/* $NetBSD: kern_kthread.c,v 1.46 2020/08/01 02:04:55 riastradh Exp $ */ /*- * Copyright (c) 1998, 1999, 2007, 2009, 2019 The NetBSD Foundation, Inc. @@ -31,9 +31,10 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: kern_kthread.c,v 1.45 2020/01/08 17:38:42 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_kthread.c,v 1.46 2020/08/01 02:04:55 riastradh Exp $"); #include +#include #include #include #include @@ -216,3 +217,71 @@ kthread_join(lwp_t *l) return 0; } + +/* + * kthread_fpu_enter() + * + * Allow the current lwp, which must be a kthread, to use the FPU. + * Return a cookie that must be passed to kthread_fpu_exit when + * done. Must be used only in thread context. Recursive -- you + * can call kthread_fpu_enter several times in a row as long as + * you pass the cookies in reverse order to kthread_fpu_exit. + */ +int +kthread_fpu_enter(void) +{ + struct lwp *l = curlwp; + int s; + + KASSERTMSG(!cpu_intr_p(), + "%s is not allowed in interrupt context", __func__); + KASSERTMSG(!cpu_softintr_p(), + "%s is not allowed in interrupt
CVS commit: src
Module Name:src Committed By: riastradh Date: Sat Aug 1 02:04:55 UTC 2020 Modified Files: src/share/man/man9: kthread.9 src/sys/kern: kern_kthread.c kern_stub.c src/sys/sys: kthread.h lwp.h Log Message: New functions kthread_fpu_enter/exit. The MI definitions don't do anything but maintain a flag, but MD code can define kthread_fpu_enter/exit_md to actually enable/disable the FPU. (These are almost pcu_load/discard on systems that use pcu(9), except they apply to all PCUs.) Discussed on tech-kern: https://mail-index.netbsd.org/tech-kern/2020/06/20/msg026524.html The proposed kthread flag KTHREAD_FPU is not included because I couldn't find any particular need for it that would not be covered by just calling kthread_fpu_enter/exit in the kthread function. To generate a diff of this commit: cvs rdiff -u -r1.28 -r1.29 src/share/man/man9/kthread.9 cvs rdiff -u -r1.45 -r1.46 src/sys/kern/kern_kthread.c cvs rdiff -u -r1.49 -r1.50 src/sys/kern/kern_stub.c cvs rdiff -u -r1.13 -r1.14 src/sys/sys/kthread.h cvs rdiff -u -r1.210 -r1.211 src/sys/sys/lwp.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/kern
Module Name:src Committed By: riastradh Date: Sat Aug 1 02:05:45 UTC 2020 Modified Files: src/sys/kern: subr_pcu.c Log Message: Teach pcu(9) about LW_SYSTEM_FPU -- kthreads with fpu enabled. To generate a diff of this commit: cvs rdiff -u -r1.22 -r1.23 src/sys/kern/subr_pcu.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/kern/subr_pcu.c diff -u src/sys/kern/subr_pcu.c:1.22 src/sys/kern/subr_pcu.c:1.23 --- src/sys/kern/subr_pcu.c:1.22 Sat Jun 6 18:13:01 2020 +++ src/sys/kern/subr_pcu.c Sat Aug 1 02:05:45 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: subr_pcu.c,v 1.22 2020/06/06 18:13:01 thorpej Exp $ */ +/* $NetBSD: subr_pcu.c,v 1.23 2020/08/01 02:05:45 riastradh Exp $ */ /*- * Copyright (c) 2011, 2014 The NetBSD Foundation, Inc. @@ -52,7 +52,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: subr_pcu.c,v 1.22 2020/06/06 18:13:01 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: subr_pcu.c,v 1.23 2020/08/01 02:05:45 riastradh Exp $"); #include #include @@ -89,6 +89,17 @@ typedef struct { extern const pcu_ops_t * const pcu_ops_md_defs[]; /* + * pcu_available_p: true if lwp is allowed to use PCU state. + */ +static inline bool +pcu_available_p(struct lwp *l) +{ + + /* XXX Not sure this is safe unless l is locked! */ + return (l->l_flag & (LW_SYSTEM|LW_SYSTEM_FPU)) != LW_SYSTEM; +} + +/* * pcu_switchpoint: release PCU state if the LWP is being run on another CPU. * This routine is called on each context switch by by mi_switch(). */ @@ -135,7 +146,7 @@ pcu_discard_all(lwp_t *l) * due to an error in the LWP creation path before it ever runs. */ KASSERT(l == curlwp || l->l_stat == LSIDL || - ((l->l_flag & LW_SYSTEM) && pcu_valid == 0)); + (!pcu_available_p(l) && pcu_valid == 0)); if (__predict_true(pcu_valid == 0)) { /* PCUs are not in use. */ @@ -174,7 +185,7 @@ pcu_save_all(lwp_t *l) * with a different LWP (forking a system LWP or doing a coredump of * a process with multiple threads) and we need to deal with that. */ - KASSERT(l == curlwp || (((l->l_flag & LW_SYSTEM) || + KASSERT(l == curlwp || ((!pcu_available_p(l) || (curlwp->l_proc == l->l_proc && l->l_stat == LSSUSPENDED)) && pcu_valid == 0));
CVS commit: src/sys/kern
Module Name:src Committed By: riastradh Date: Sat Aug 1 02:05:45 UTC 2020 Modified Files: src/sys/kern: subr_pcu.c Log Message: Teach pcu(9) about LW_SYSTEM_FPU -- kthreads with fpu enabled. To generate a diff of this commit: cvs rdiff -u -r1.22 -r1.23 src/sys/kern/subr_pcu.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/aarch64/aarch64
Module Name:src Committed By: riastradh Date: Sat Aug 1 02:06:59 UTC 2020 Modified Files: src/sys/arch/aarch64/aarch64: fpu.c trap.c Log Message: Add kthread_fpu_enter/exit support to aarch64. To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/sys/arch/aarch64/aarch64/fpu.c cvs rdiff -u -r1.34 -r1.35 src/sys/arch/aarch64/aarch64/trap.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/aarch64/aarch64/fpu.c diff -u src/sys/arch/aarch64/aarch64/fpu.c:1.7 src/sys/arch/aarch64/aarch64/fpu.c:1.8 --- src/sys/arch/aarch64/aarch64/fpu.c:1.7 Mon Jul 13 16:54:03 2020 +++ src/sys/arch/aarch64/aarch64/fpu.c Sat Aug 1 02:06:59 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: fpu.c,v 1.7 2020/07/13 16:54:03 riastradh Exp $ */ +/* $NetBSD: fpu.c,v 1.8 2020/08/01 02:06:59 riastradh Exp $ */ /*- * Copyright (c) 2014 The NetBSD Foundation, Inc. @@ -31,10 +31,12 @@ #include -__KERNEL_RCSID(1, "$NetBSD: fpu.c,v 1.7 2020/07/13 16:54:03 riastradh Exp $"); +__KERNEL_RCSID(1, "$NetBSD: fpu.c,v 1.8 2020/08/01 02:06:59 riastradh Exp $"); #include #include +#include +#include #include #include @@ -176,12 +178,30 @@ fpu_state_release(lwp_t *l) __asm __volatile ("isb"); } +static const struct fpreg zero_fpreg; + +/* + * True if this is a system thread with its own private FPU state. + */ +static inline bool +lwp_system_fpu_p(struct lwp *l) +{ + + return (l->l_flag & (LW_SYSTEM|LW_SYSTEM_FPU)) == + (LW_SYSTEM|LW_SYSTEM_FPU); +} + void fpu_kern_enter(void) { struct cpu_info *ci; int s; + if (lwp_system_fpu_p(curlwp) && !cpu_intr_p()) { + KASSERT(!cpu_softintr_p()); + return; + } + /* * Block interrupts up to IPL_VM. We must block preemption * since -- if this is a user thread -- there is nowhere to @@ -209,10 +229,16 @@ fpu_kern_enter(void) void fpu_kern_leave(void) { - static const struct fpreg zero_fpreg; - struct cpu_info *ci = curcpu(); + struct cpu_info *ci; int s; + if (lwp_system_fpu_p(curlwp) && !cpu_intr_p()) { + KASSERT(!cpu_softintr_p()); + return; + } + + ci = curcpu(); + KASSERT(ci->ci_cpl == IPL_VM); KASSERT(ci->ci_kfpu_spl != -1); @@ -234,3 +260,19 @@ fpu_kern_leave(void) ci->ci_kfpu_spl = -1; splx(s); } + +void +kthread_fpu_enter_md(void) +{ + + fpu_load(curlwp); +} + +void +kthread_fpu_exit_md(void) +{ + + /* XXX Should fpu_state_release zero the registers itself? */ + load_fpregs(_fpreg); + fpu_discard(curlwp, 0); +} Index: src/sys/arch/aarch64/aarch64/trap.c diff -u src/sys/arch/aarch64/aarch64/trap.c:1.34 src/sys/arch/aarch64/aarch64/trap.c:1.35 --- src/sys/arch/aarch64/aarch64/trap.c:1.34 Mon Jul 27 07:32:48 2020 +++ src/sys/arch/aarch64/aarch64/trap.c Sat Aug 1 02:06:59 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: trap.c,v 1.34 2020/07/27 07:32:48 ryo Exp $ */ +/* $NetBSD: trap.c,v 1.35 2020/08/01 02:06:59 riastradh Exp $ */ /*- * Copyright (c) 2014 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ #include -__KERNEL_RCSID(1, "$NetBSD: trap.c,v 1.34 2020/07/27 07:32:48 ryo Exp $"); +__KERNEL_RCSID(1, "$NetBSD: trap.c,v 1.35 2020/08/01 02:06:59 riastradh Exp $"); #include "opt_arm_intr_impl.h" #include "opt_compat_netbsd32.h" @@ -242,6 +242,12 @@ trap_el1h_sync(struct trapframe *tf) break; case ESR_EC_FP_ACCESS: + if ((curlwp->l_flag & (LW_SYSTEM|LW_SYSTEM_FPU)) == + (LW_SYSTEM|LW_SYSTEM_FPU)) { + fpu_load(curlwp); + break; + } + /*FALLTHROUGH*/ case ESR_EC_FP_TRAP_A64: case ESR_EC_PC_ALIGNMENT: case ESR_EC_SP_ALIGNMENT:
CVS commit: src/sys/arch/aarch64/aarch64
Module Name:src Committed By: riastradh Date: Sat Aug 1 02:06:59 UTC 2020 Modified Files: src/sys/arch/aarch64/aarch64: fpu.c trap.c Log Message: Add kthread_fpu_enter/exit support to aarch64. To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/sys/arch/aarch64/aarch64/fpu.c cvs rdiff -u -r1.34 -r1.35 src/sys/arch/aarch64/aarch64/trap.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/arm/vfp
Module Name:src Committed By: riastradh Date: Sat Aug 1 02:13:04 UTC 2020 Modified Files: src/sys/arch/arm/vfp: vfp_init.c Log Message: Add kthread_fpu_enter/exit support to arm. To generate a diff of this commit: cvs rdiff -u -r1.70 -r1.71 src/sys/arch/arm/vfp/vfp_init.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/vfp/vfp_init.c diff -u src/sys/arch/arm/vfp/vfp_init.c:1.70 src/sys/arch/arm/vfp/vfp_init.c:1.71 --- src/sys/arch/arm/vfp/vfp_init.c:1.70 Mon Jul 27 20:51:29 2020 +++ src/sys/arch/arm/vfp/vfp_init.c Sat Aug 1 02:13:04 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: vfp_init.c,v 1.70 2020/07/27 20:51:29 riastradh Exp $ */ +/* $NetBSD: vfp_init.c,v 1.71 2020/08/01 02:13:04 riastradh Exp $ */ /* * Copyright (c) 2008 ARM Ltd @@ -32,12 +32,13 @@ #include "opt_cputypes.h" #include -__KERNEL_RCSID(0, "$NetBSD: vfp_init.c,v 1.70 2020/07/27 20:51:29 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: vfp_init.c,v 1.71 2020/08/01 02:13:04 riastradh Exp $"); #include #include #include #include +#include #include #include @@ -424,7 +425,8 @@ vfp_handler(u_int address, u_int insn, t struct cpu_info * const ci = curcpu(); /* This shouldn't ever happen. */ - if (fault_code != FAULT_USER) + if (fault_code != FAULT_USER && + (curlwp->l_flag & (LW_SYSTEM|LW_SYSTEM_FPU)) == LW_SYSTEM) panic("VFP fault at %#x in non-user mode", frame->tf_pc); if (ci->ci_vfp_id == 0) { @@ -504,7 +506,8 @@ neon_handler(u_int address, u_int insn, return 1; /* This shouldn't ever happen. */ - if (fault_code != FAULT_USER) + if (fault_code != FAULT_USER && + (curlwp->l_flag & (LW_SYSTEM|LW_SYSTEM_FPU)) == LW_SYSTEM) panic("NEON fault in non-user mode"); /* if we already own the FPU and it's enabled, raise SIGILL */ @@ -668,6 +671,19 @@ vfp_setcontext(struct lwp *l, const mcon sizeof(mcp->__fpu.__vfpregs.__vfp_fstmx)); } +/* + * True if this is a system thread with its own private FPU state. + */ +static inline bool +lwp_system_fpu_p(struct lwp *l) +{ + + return (l->l_flag & (LW_SYSTEM|LW_SYSTEM_FPU)) == + (LW_SYSTEM|LW_SYSTEM_FPU); +} + +static const struct vfpreg zero_vfpreg; + void fpu_kern_enter(void) { @@ -675,6 +691,11 @@ fpu_kern_enter(void) uint32_t fpexc; int s; + if (lwp_system_fpu_p(curlwp) && !cpu_intr_p()) { + KASSERT(!cpu_softintr_p()); + return; + } + /* * Block interrupts up to IPL_VM. We must block preemption * since -- if this is a user thread -- there is nowhere to @@ -701,11 +722,15 @@ fpu_kern_enter(void) void fpu_kern_leave(void) { - static const struct vfpreg zero_vfpreg; struct cpu_info *ci = curcpu(); int s; uint32_t fpexc; + if (lwp_system_fpu_p(curlwp) && !cpu_intr_p()) { + KASSERT(!cpu_softintr_p()); + return; + } + KASSERT(ci->ci_cpl == IPL_VM); KASSERT(ci->ci_kfpu_spl != -1); @@ -730,4 +755,20 @@ fpu_kern_leave(void) splx(s); } +void +kthread_fpu_enter_md(void) +{ + + pcu_load(_vfp_ops); +} + +void +kthread_fpu_exit_md(void) +{ + + /* XXX Should vfp_state_release zero the registers itself? */ + load_vfpregs(_vfpreg); + vfp_discardcontext(curlwp, 0); +} + #endif /* FPU_VFP */
CVS commit: src/sys/arch/arm/vfp
Module Name:src Committed By: riastradh Date: Sat Aug 1 02:13:04 UTC 2020 Modified Files: src/sys/arch/arm/vfp: vfp_init.c Log Message: Add kthread_fpu_enter/exit support to arm. To generate a diff of this commit: cvs rdiff -u -r1.70 -r1.71 src/sys/arch/arm/vfp/vfp_init.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src
Module Name:src Committed By: riastradh Date: Sat Aug 1 02:14:43 UTC 2020 Modified Files: src/share/man/man9: workqueue.9 src/sys/kern: subr_workqueue.c src/sys/sys: workqueue.h Log Message: New workqueue flag WQ_FPU. Arranges kthread_fpu_enter/exit around calls to the worker. Saves cost over explicit calls to kthread_fpu_enter/exit in the worker by only doing it once, since there's often a high cost to flushing the icache and zeroing the fpu registers. As proposed on tech-kern: https://mail-index.netbsd.org/tech-kern/2020/06/20/msg026524.html To generate a diff of this commit: cvs rdiff -u -r1.12 -r1.13 src/share/man/man9/workqueue.9 cvs rdiff -u -r1.37 -r1.38 src/sys/kern/subr_workqueue.c cvs rdiff -u -r1.10 -r1.11 src/sys/sys/workqueue.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/share/man/man9/workqueue.9 diff -u src/share/man/man9/workqueue.9:1.12 src/share/man/man9/workqueue.9:1.13 --- src/share/man/man9/workqueue.9:1.12 Thu Dec 28 07:00:52 2017 +++ src/share/man/man9/workqueue.9 Sat Aug 1 02:14:43 2020 @@ -1,4 +1,4 @@ -.\" $NetBSD: workqueue.9,v 1.12 2017/12/28 07:00:52 ozaki-r Exp $ +.\" $NetBSD: workqueue.9,v 1.13 2020/08/01 02:14:43 riastradh Exp $ .\" .\" Copyright (c)2005 YAMAMOTO Takashi, .\" All rights reserved. @@ -83,6 +83,11 @@ The highest IPL at which this workqueue The value of 0 indicates a standard create operation, however the following flags may be bitwise ORed together: .Bl -tag -width WQ_MPSAFE +.It Dv WQ_FPU +Specifies that the kthread must be allowed to use any machine-dependent +per-CPU floating-point units or SIMD vector units, as in +.Xr kthread_fpu_enter 9 / Xr kthread_fpu_exit 9 , +when it executes the worker function.u .It Dv WQ_MPSAFE Specifies that the workqueue is multiprocessor safe and does its own locking; otherwise the kernel lock will be held while processing work. Index: src/sys/kern/subr_workqueue.c diff -u src/sys/kern/subr_workqueue.c:1.37 src/sys/kern/subr_workqueue.c:1.38 --- src/sys/kern/subr_workqueue.c:1.37 Wed Jun 13 05:26:12 2018 +++ src/sys/kern/subr_workqueue.c Sat Aug 1 02:14:43 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: subr_workqueue.c,v 1.37 2018/06/13 05:26:12 ozaki-r Exp $ */ +/* $NetBSD: subr_workqueue.c,v 1.38 2020/08/01 02:14:43 riastradh Exp $ */ /*- * Copyright (c)2002, 2005, 2006, 2007 YAMAMOTO Takashi, @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: subr_workqueue.c,v 1.37 2018/06/13 05:26:12 ozaki-r Exp $"); +__KERNEL_RCSID(0, "$NetBSD: subr_workqueue.c,v 1.38 2020/08/01 02:14:43 riastradh Exp $"); #include #include @@ -112,10 +112,13 @@ workqueue_worker(void *cookie) { struct workqueue *wq = cookie; struct workqueue_queue *q; + int s; /* find the workqueue of this kthread */ q = workqueue_queue_lookup(wq, curlwp->l_cpu); + if (wq->wq_flags & WQ_FPU) + s = kthread_fpu_enter(); for (;;) { /* * we violate abstraction of SIMPLEQ. @@ -141,6 +144,8 @@ workqueue_worker(void *cookie) } mutex_exit(>q_mutex); } + if (wq->wq_flags & WQ_FPU) + kthread_fpu_exit(s); } static void Index: src/sys/sys/workqueue.h diff -u src/sys/sys/workqueue.h:1.10 src/sys/sys/workqueue.h:1.11 --- src/sys/sys/workqueue.h:1.10 Thu Dec 28 07:00:52 2017 +++ src/sys/sys/workqueue.h Sat Aug 1 02:14:43 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: workqueue.h,v 1.10 2017/12/28 07:00:52 ozaki-r Exp $ */ +/* $NetBSD: workqueue.h,v 1.11 2020/08/01 02:14:43 riastradh Exp $ */ /*- * Copyright (c)2002, 2005 YAMAMOTO Takashi, @@ -47,6 +47,7 @@ struct workqueue; #define WQ_MPSAFE 0x01 #define WQ_PERCPU 0x02 +#define WQ_FPU 0x04 int workqueue_create(struct workqueue **, const char *, void (*)(struct work *, void *), void *, pri_t, int, int);
CVS commit: src/sys/dev
Module Name:src Committed By: riastradh Date: Sat Aug 1 02:15:17 UTC 2020 Modified Files: src/sys/dev: cgd.c Log Message: Run cgd(4) crypto threads with the FPU/SIMD units pre-enabled. Improves cgd throughput on systems with vectorized crypto by ~20%. To generate a diff of this commit: cvs rdiff -u -r1.137 -r1.138 src/sys/dev/cgd.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/cgd.c diff -u src/sys/dev/cgd.c:1.137 src/sys/dev/cgd.c:1.138 --- src/sys/dev/cgd.c:1.137 Mon Jun 29 23:36:06 2020 +++ src/sys/dev/cgd.c Sat Aug 1 02:15:17 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: cgd.c,v 1.137 2020/06/29 23:36:06 riastradh Exp $ */ +/* $NetBSD: cgd.c,v 1.138 2020/08/01 02:15:17 riastradh Exp $ */ /*- * Copyright (c) 2002 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: cgd.c,v 1.137 2020/06/29 23:36:06 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: cgd.c,v 1.138 2020/08/01 02:15:17 riastradh Exp $"); #include #include @@ -673,7 +673,7 @@ cgd_create_worker(void) cp = kmem_alloc(sizeof(struct pool), KM_SLEEP); error = workqueue_create(, "cgd", cgd_process, NULL, - PRI_BIO, IPL_BIO, WQ_MPSAFE | WQ_PERCPU); + PRI_BIO, IPL_BIO, WQ_FPU|WQ_MPSAFE|WQ_PERCPU); if (error) { kmem_free(cp, sizeof(struct pool)); kmem_free(cw, sizeof(struct cgd_worker));
CVS commit: src/sys/arch/x86/x86
Module Name:src Committed By: riastradh Date: Sat Aug 1 02:13:34 UTC 2020 Modified Files: src/sys/arch/x86/x86: fpu.c Log Message: Add kthread_fpu_enter/exit support to x86. To generate a diff of this commit: cvs rdiff -u -r1.72 -r1.73 src/sys/arch/x86/x86/fpu.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/x86/x86/fpu.c diff -u src/sys/arch/x86/x86/fpu.c:1.72 src/sys/arch/x86/x86/fpu.c:1.73 --- src/sys/arch/x86/x86/fpu.c:1.72 Mon Jul 20 16:43:03 2020 +++ src/sys/arch/x86/x86/fpu.c Sat Aug 1 02:13:34 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: fpu.c,v 1.72 2020/07/20 16:43:03 riastradh Exp $ */ +/* $NetBSD: fpu.c,v 1.73 2020/08/01 02:13:34 riastradh Exp $ */ /* * Copyright (c) 2008, 2019 The NetBSD Foundation, Inc. All @@ -96,7 +96,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: fpu.c,v 1.72 2020/07/20 16:43:03 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: fpu.c,v 1.73 2020/08/01 02:13:34 riastradh Exp $"); #include "opt_multiprocessor.h" @@ -107,6 +107,7 @@ __KERNEL_RCSID(0, "$NetBSD: fpu.c,v 1.72 #include #include #include +#include #include #include @@ -131,13 +132,35 @@ void fpu_switch(struct lwp *, struct lwp uint32_t x86_fpu_mxcsr_mask __read_mostly = 0; +/* + * True if this a thread that is allowed to use the FPU -- either a + * user thread, or a system thread with LW_SYSTEM_FPU enabled. + */ +static inline bool +lwp_can_haz_fpu(struct lwp *l) +{ + + return (l->l_flag & (LW_SYSTEM|LW_SYSTEM_FPU)) != LW_SYSTEM; +} + +/* + * True if this is a system thread with its own private FPU state. + */ +static inline bool +lwp_system_fpu_p(struct lwp *l) +{ + + return (l->l_flag & (LW_SYSTEM|LW_SYSTEM_FPU)) == + (LW_SYSTEM|LW_SYSTEM_FPU); +} + static inline union savefpu * fpu_lwp_area(struct lwp *l) { struct pcb *pcb = lwp_getpcb(l); union savefpu *area = >pcb_savefpu; - KASSERT((l->l_flag & LW_SYSTEM) == 0); + KASSERT(lwp_can_haz_fpu(l)); if (l == curlwp) { fpu_save(); } @@ -155,7 +178,7 @@ fpu_save_lwp(struct lwp *l) s = splvm(); if (l->l_md.md_flags & MDL_FPU_IN_CPU) { - KASSERT((l->l_flag & LW_SYSTEM) == 0); + KASSERT(lwp_can_haz_fpu(l)); fpu_area_save(area, x86_xsave_features); l->l_md.md_flags &= ~MDL_FPU_IN_CPU; } @@ -307,7 +330,7 @@ fpu_switch(struct lwp *oldlwp, struct lw cpu_index(ci), ci->ci_ilevel); if (oldlwp->l_md.md_flags & MDL_FPU_IN_CPU) { - KASSERT(!(oldlwp->l_flag & LW_SYSTEM)); + KASSERT(lwp_can_haz_fpu(oldlwp)); pcb = lwp_getpcb(oldlwp); fpu_area_save(>pcb_savefpu, x86_xsave_features); oldlwp->l_md.md_flags &= ~MDL_FPU_IN_CPU; @@ -322,11 +345,11 @@ fpu_lwp_fork(struct lwp *l1, struct lwp union savefpu *fpu_save; /* Kernel threads have no FPU. */ - if (__predict_false(l2->l_flag & LW_SYSTEM)) { + if (__predict_false(!lwp_can_haz_fpu(l2))) { return; } /* For init(8). */ - if (__predict_false(l1->l_flag & LW_SYSTEM)) { + if (__predict_false(!lwp_can_haz_fpu(l1))) { memset(>pcb_savefpu, 0, x86_fpu_save_size); return; } @@ -350,6 +373,8 @@ fpu_lwp_abandon(struct lwp *l) /* -- */ +static const union savefpu zero_fpu __aligned(64); + /* * fpu_kern_enter() * @@ -369,6 +394,11 @@ fpu_kern_enter(void) struct cpu_info *ci; int s; + if (lwp_system_fpu_p(l) && !cpu_intr_p()) { + KASSERT(!cpu_softintr_p()); + return; + } + s = splvm(); ci = curcpu(); @@ -401,10 +431,16 @@ fpu_kern_enter(void) void fpu_kern_leave(void) { - static const union savefpu zero_fpu __aligned(64); - struct cpu_info *ci = curcpu(); + struct cpu_info *ci; int s; + if (lwp_system_fpu_p(curlwp) && !cpu_intr_p()) { + KASSERT(!cpu_softintr_p()); + return; + } + + ci = curcpu(); + KASSERT(ci->ci_ilevel == IPL_VM); KASSERT(ci->ci_kfpu_spl != -1); @@ -426,6 +462,23 @@ fpu_kern_leave(void) splx(s); } +void +kthread_fpu_enter_md(void) +{ + + /* Enable the FPU by clearing CR0_TS. */ + clts(); +} + +void +kthread_fpu_exit_md(void) +{ + + /* Zero the FPU state and disable the FPU by setting CR0_TS. */ + fpu_area_restore(_fpu, x86_xsave_features); + stts(); +} + /* -- */ /*
CVS commit: src/sys/arch/x86/x86
Module Name:src Committed By: riastradh Date: Sat Aug 1 02:13:34 UTC 2020 Modified Files: src/sys/arch/x86/x86: fpu.c Log Message: Add kthread_fpu_enter/exit support to x86. To generate a diff of this commit: cvs rdiff -u -r1.72 -r1.73 src/sys/arch/x86/x86/fpu.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.