Re: CVS commit: src/external/gpl3/binutils/dist/ld/emultempl
On 2023/09/11 11:27, matthew green wrote: "Rin Okuyama" writes: Module Name:src Committed By: rin Date: Mon Sep 11 01:54:18 UTC 2023 Modified Files: src/external/gpl3/binutils/dist/ld/emultempl: aarch64elf.em armelf.em elf.em Log Message: ld: Enable --copy-dt-needed-entries by default again thanks for fixing -lcurses. can we put this into bsd.*.mk instead? ie, if we want this, declare it explicitly, rather than reply upon patched binutils? (this is eg, unfriendly to EXTERNAL_TOOLCHAIN etc.) if it works, of course Thanks for your comment. Yeah, I feel this fix is too much also... I've found that FreeBSD uses ldscript to handle curses vs terminfo problem. I think we can resolve the problem in a similar manner. I've sent PR lib/57615 for this: http://gnats.netbsd.org/57615 Thanks, rin
re: CVS commit: src/external/gpl3/binutils/dist/ld/emultempl
"Rin Okuyama" writes: > Module Name: src > Committed By: rin > Date: Mon Sep 11 01:54:18 UTC 2023 > > Modified Files: > src/external/gpl3/binutils/dist/ld/emultempl: aarch64elf.em armelf.em > elf.em > > Log Message: > ld: Enable --copy-dt-needed-entries by default again thanks for fixing -lcurses. can we put this into bsd.*.mk instead? ie, if we want this, declare it explicitly, rather than reply upon patched binutils? (this is eg, unfriendly to EXTERNAL_TOOLCHAIN etc.) if it works, of course .mrg.
CVS commit: src/external/gpl3/binutils/dist/ld/emultempl
Module Name:src Committed By: rin Date: Mon Sep 11 01:54:18 UTC 2023 Modified Files: src/external/gpl3/binutils/dist/ld/emultempl: aarch64elf.em armelf.em elf.em Log Message: ld: Enable --copy-dt-needed-entries by default again Otherwise, terminfo(3) symbols referenced from curses(3)-based applications are not resolved, unless -lterminfo is explicitly specified. See, e.g., PR lib/57592 We had locally enabled this by default: http://cvsweb.netbsd.org/bsdweb.cgi/src/external/gpl3/binutils/dist/ld/emultempl/elf.em#rev1.2 But this was lost during 2.39 merge. Thanks uwe@ for hints! To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 \ src/external/gpl3/binutils/dist/ld/emultempl/aarch64elf.em \ src/external/gpl3/binutils/dist/ld/emultempl/armelf.em cvs rdiff -u -r1.3 -r1.4 src/external/gpl3/binutils/dist/ld/emultempl/elf.em Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/gpl3/binutils/dist/ld/emultempl/aarch64elf.em diff -u src/external/gpl3/binutils/dist/ld/emultempl/aarch64elf.em:1.8 src/external/gpl3/binutils/dist/ld/emultempl/aarch64elf.em:1.9 --- src/external/gpl3/binutils/dist/ld/emultempl/aarch64elf.em:1.8 Sat Dec 24 20:17:07 2022 +++ src/external/gpl3/binutils/dist/ld/emultempl/aarch64elf.em Mon Sep 11 01:54:18 2023 @@ -44,6 +44,8 @@ gld${EMULATION_NAME}_before_parse (void) ldfile_set_output_arch ("`echo ${ARCH}`", bfd_arch_unknown); #endif /* not TARGET_ */ input_flags.dynamic = ${DYNAMIC_LINK-true}; + /* XXX For NetBSD, copy-dt-needed-entries by default. */ + input_flags.add_DT_NEEDED_for_dynamic = true; config.has_shared = `if test -n "$GENERATE_SHLIB_SCRIPT" ; then echo true ; else echo false ; fi`; config.separate_code = `if test "x${SEPARATE_CODE}" = xyes ; then echo true ; else echo false ; fi`; link_info.check_relocs_after_open_input = true; Index: src/external/gpl3/binutils/dist/ld/emultempl/armelf.em diff -u src/external/gpl3/binutils/dist/ld/emultempl/armelf.em:1.8 src/external/gpl3/binutils/dist/ld/emultempl/armelf.em:1.9 --- src/external/gpl3/binutils/dist/ld/emultempl/armelf.em:1.8 Sat Dec 24 20:17:07 2022 +++ src/external/gpl3/binutils/dist/ld/emultempl/armelf.em Mon Sep 11 01:54:18 2023 @@ -57,6 +57,8 @@ gld${EMULATION_NAME}_before_parse (void) ldfile_set_output_arch ("`echo ${ARCH}`", bfd_arch_unknown); #endif /* not TARGET_ */ input_flags.dynamic = ${DYNAMIC_LINK-true}; + /* XXX For NetBSD, copy-dt-needed-entries by default. */ + input_flags.add_DT_NEEDED_for_dynamic = true; config.has_shared = `if test -n "$GENERATE_SHLIB_SCRIPT" ; then echo true ; else echo false ; fi`; config.separate_code = `if test "x${SEPARATE_CODE}" = xyes ; then echo true ; else echo false ; fi`; link_info.check_relocs_after_open_input = true; Index: src/external/gpl3/binutils/dist/ld/emultempl/elf.em diff -u src/external/gpl3/binutils/dist/ld/emultempl/elf.em:1.3 src/external/gpl3/binutils/dist/ld/emultempl/elf.em:1.4 --- src/external/gpl3/binutils/dist/ld/emultempl/elf.em:1.3 Sat Dec 24 20:17:07 2022 +++ src/external/gpl3/binutils/dist/ld/emultempl/elf.em Mon Sep 11 01:54:18 2023 @@ -81,6 +81,8 @@ gld${EMULATION_NAME}_before_parse (void) { ldfile_set_output_arch ("${OUTPUT_ARCH}", bfd_arch_`echo ${ARCH} | sed -e 's/:.*//'`); input_flags.dynamic = ${DYNAMIC_LINK-true}; + /* XXX For NetBSD, copy-dt-needed-entries by default. */ + input_flags.add_DT_NEEDED_for_dynamic = true; config.has_shared = `if test -n "$GENERATE_SHLIB_SCRIPT" ; then echo true ; else echo false ; fi`; config.separate_code = `if test "x${SEPARATE_CODE}" = xyes ; then echo true ; else echo false ; fi`; link_info.check_relocs_after_open_input = true;
CVS commit: src/external/gpl3/binutils/dist/ld/emultempl
Module Name:src Committed By: rin Date: Mon Sep 11 01:54:18 UTC 2023 Modified Files: src/external/gpl3/binutils/dist/ld/emultempl: aarch64elf.em armelf.em elf.em Log Message: ld: Enable --copy-dt-needed-entries by default again Otherwise, terminfo(3) symbols referenced from curses(3)-based applications are not resolved, unless -lterminfo is explicitly specified. See, e.g., PR lib/57592 We had locally enabled this by default: http://cvsweb.netbsd.org/bsdweb.cgi/src/external/gpl3/binutils/dist/ld/emultempl/elf.em#rev1.2 But this was lost during 2.39 merge. Thanks uwe@ for hints! To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 \ src/external/gpl3/binutils/dist/ld/emultempl/aarch64elf.em \ src/external/gpl3/binutils/dist/ld/emultempl/armelf.em cvs rdiff -u -r1.3 -r1.4 src/external/gpl3/binutils/dist/ld/emultempl/elf.em 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: Sun Sep 10 21:52:37 UTC 2023 Modified Files: src/usr.bin/make: main.c make.1 Log Message: make: fix typo To generate a diff of this commit: cvs rdiff -u -r1.598 -r1.599 src/usr.bin/make/main.c cvs rdiff -u -r1.370 -r1.371 src/usr.bin/make/make.1 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.598 src/usr.bin/make/main.c:1.599 --- src/usr.bin/make/main.c:1.598 Sun Sep 10 11:41:32 2023 +++ src/usr.bin/make/main.c Sun Sep 10 21:52:36 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.598 2023/09/10 11:41:32 rillig Exp $ */ +/* $NetBSD: main.c,v 1.599 2023/09/10 21:52:36 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -111,7 +111,7 @@ #include "trace.h" /* "@(#)main.c 8.3 (Berkeley) 3/19/94" */ -MAKE_RCSID("$NetBSD: main.c,v 1.598 2023/09/10 11:41:32 rillig Exp $"); +MAKE_RCSID("$NetBSD: main.c,v 1.599 2023/09/10 21:52:36 rillig Exp $"); #if defined(MAKE_NATIVE) && !defined(lint) __COPYRIGHT("@(#) Copyright (c) 1988, 1989, 1990, 1993 " "The Regents of the University of California. " @@ -1377,7 +1377,7 @@ main_Init(int argc, char **argv) #endif Global_Set(".MAKE.MAKEFILE_PREFERENCE", MAKEFILE_PREFERENCE_LIST); Global_Set(".MAKE.DEPENDFILE", ".depend"); - /* Tell makefiles like jobs.mk wether we support -jC */ + /* Tell makefiles like jobs.mk whether we support -jC */ #ifdef _SC_NPROCESSORS_ONLN Global_Set_ReadOnly(".MAKE.JOBS.C", "yes"); #else Index: src/usr.bin/make/make.1 diff -u src/usr.bin/make/make.1:1.370 src/usr.bin/make/make.1:1.371 --- src/usr.bin/make/make.1:1.370 Sat Sep 9 16:41:04 2023 +++ src/usr.bin/make/make.1 Sun Sep 10 21:52:36 2023 @@ -1,4 +1,4 @@ -.\" $NetBSD: make.1,v 1.370 2023/09/09 16:41:04 sjg Exp $ +.\" $NetBSD: make.1,v 1.371 2023/09/10 21:52:36 rillig Exp $ .\" .\" Copyright (c) 1990, 1993 .\" The Regents of the University of California. All rights reserved. @@ -978,7 +978,7 @@ The argument to the .Fl j option. .It Va .MAKE.JOBS.C -A read-only boolean that indicates wether the +A read-only boolean that indicates whether the .Fl j option supports use of .Ql C .
CVS commit: src/usr.bin/make
Module Name:src Committed By: rillig Date: Sun Sep 10 21:52:37 UTC 2023 Modified Files: src/usr.bin/make: main.c make.1 Log Message: make: fix typo To generate a diff of this commit: cvs rdiff -u -r1.598 -r1.599 src/usr.bin/make/main.c cvs rdiff -u -r1.370 -r1.371 src/usr.bin/make/make.1 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch/hpcmips/dev
Module Name:src Committed By: andvar Date: Sun Sep 10 21:13:20 UTC 2023 Modified Files: src/sys/arch/hpcmips/dev: plumpcmcia.c Log Message: return %#x specifier for pcihp->ioh and add (unsigned) cast instead, as it is done everywhere in this code. To generate a diff of this commit: cvs rdiff -u -r1.31 -r1.32 src/sys/arch/hpcmips/dev/plumpcmcia.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/hpcmips/dev/plumpcmcia.c diff -u src/sys/arch/hpcmips/dev/plumpcmcia.c:1.31 src/sys/arch/hpcmips/dev/plumpcmcia.c:1.32 --- src/sys/arch/hpcmips/dev/plumpcmcia.c:1.31 Sun Sep 10 14:28:57 2023 +++ src/sys/arch/hpcmips/dev/plumpcmcia.c Sun Sep 10 21:13:20 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: plumpcmcia.c,v 1.31 2023/09/10 14:28:57 andvar Exp $ */ +/* $NetBSD: plumpcmcia.c,v 1.32 2023/09/10 21:13:20 andvar Exp $ */ /* * Copyright (c) 1999, 2000 UCHIYAMA Yasushi. All rights reserved. @@ -31,7 +31,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: plumpcmcia.c,v 1.31 2023/09/10 14:28:57 andvar Exp $"); +__KERNEL_RCSID(0, "$NetBSD: plumpcmcia.c,v 1.32 2023/09/10 21:13:20 andvar Exp $"); #include #include @@ -646,7 +646,7 @@ plumpcmcia_chip_io_free(pcmcia_chipset_h bus_space_unmap(pcihp->iot, pcihp->ioh, pcihp->size); } - DPRINTF("plumpcmcia_chip_io_free %#lx+%#x\n", pcihp->ioh, + DPRINTF("plumpcmcia_chip_io_free %#x+%#x\n", (unsigned)pcihp->ioh, (unsigned)pcihp->size); }
CVS commit: src/sys/arch/hpcmips/dev
Module Name:src Committed By: andvar Date: Sun Sep 10 21:13:20 UTC 2023 Modified Files: src/sys/arch/hpcmips/dev: plumpcmcia.c Log Message: return %#x specifier for pcihp->ioh and add (unsigned) cast instead, as it is done everywhere in this code. To generate a diff of this commit: cvs rdiff -u -r1.31 -r1.32 src/sys/arch/hpcmips/dev/plumpcmcia.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/hpcmips/tx
Module Name:src Committed By: andvar Date: Sun Sep 10 20:55:30 UTC 2023 Modified Files: src/sys/arch/hpcmips/tx: tx39sib.c Log Message: rewrite tx39sib debug code to use debug.h DPRINTF definition. also debug code uses dbg_bitmask_print(), thus build fails without the header. fixes TX39SIBDEBUG enabled build. To generate a diff of this commit: cvs rdiff -u -r1.23 -r1.24 src/sys/arch/hpcmips/tx/tx39sib.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/hpcmips/tx/tx39sib.c diff -u src/sys/arch/hpcmips/tx/tx39sib.c:1.23 src/sys/arch/hpcmips/tx/tx39sib.c:1.24 --- src/sys/arch/hpcmips/tx/tx39sib.c:1.23 Sat Aug 7 16:18:54 2021 +++ src/sys/arch/hpcmips/tx/tx39sib.c Sun Sep 10 20:55:30 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: tx39sib.c,v 1.23 2021/08/07 16:18:54 thorpej Exp $ */ +/* $NetBSD: tx39sib.c,v 1.24 2023/09/10 20:55:30 andvar Exp $ */ /*- * Copyright (c) 2000 The NetBSD Foundation, Inc. @@ -34,9 +34,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: tx39sib.c,v 1.23 2021/08/07 16:18:54 thorpej Exp $"); - -#undef TX39SIBDEBUG +__KERNEL_RCSID(0, "$NetBSD: tx39sib.c,v 1.24 2023/09/10 20:55:30 andvar Exp $"); #include #include @@ -53,11 +51,10 @@ __KERNEL_RCSID(0, "$NetBSD: tx39sib.c,v #include "locators.h" #ifdef TX39SIBDEBUG -int tx39sibdebug = 0; -#define DPRINTF(arg) if (tx39sibdebug) printf arg; -#else -#define DPRINTF(arg) +#define DPRINTF_ENABLE +#define DPRINTF_DEBUG tx39sibdebug #endif +#include int tx39sib_match(device_t, cfdata_t, void *); void tx39sib_attach(device_t, device_t, void *);
CVS commit: src/sys/arch/hpcmips/tx
Module Name:src Committed By: andvar Date: Sun Sep 10 20:55:30 UTC 2023 Modified Files: src/sys/arch/hpcmips/tx: tx39sib.c Log Message: rewrite tx39sib debug code to use debug.h DPRINTF definition. also debug code uses dbg_bitmask_print(), thus build fails without the header. fixes TX39SIBDEBUG enabled build. To generate a diff of this commit: cvs rdiff -u -r1.23 -r1.24 src/sys/arch/hpcmips/tx/tx39sib.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/hpcmips/tx
Module Name:src Committed By: andvar Date: Sun Sep 10 20:41:57 UTC 2023 Modified Files: src/sys/arch/hpcmips/tx: tx39biu.c Log Message: rewrite old style tx39biu_dump function declaration and constify char *rowsel[], char *colsel[]. fixes TX39BIU_DEBUG enabled build. To generate a diff of this commit: cvs rdiff -u -r1.17 -r1.18 src/sys/arch/hpcmips/tx/tx39biu.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/hpcmips/tx/tx39biu.c diff -u src/sys/arch/hpcmips/tx/tx39biu.c:1.17 src/sys/arch/hpcmips/tx/tx39biu.c:1.18 --- src/sys/arch/hpcmips/tx/tx39biu.c:1.17 Sat Aug 7 16:18:54 2021 +++ src/sys/arch/hpcmips/tx/tx39biu.c Sun Sep 10 20:41:57 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: tx39biu.c,v 1.17 2021/08/07 16:18:54 thorpej Exp $ */ +/* $NetBSD: tx39biu.c,v 1.18 2023/09/10 20:41:57 andvar Exp $ */ /*- * Copyright (c) 1999-2002 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: tx39biu.c,v 1.17 2021/08/07 16:18:54 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: tx39biu.c,v 1.18 2023/09/10 20:41:57 andvar Exp $"); #include "opt_tx39_watchdogtimer.h" #include "opt_tx39biu_debug.h" @@ -163,12 +163,11 @@ tx39biu_intr(void *arg) #ifdef TX39BIU_DEBUG void -tx39biu_dump(tc) - tx_chipset_tag_t tc; +tx39biu_dump(tx_chipset_tag_t tc) { - char *rowsel[] = {"18,17:9", "22,18,20,19,17:9", "20,22,21,19,17:9", + const char *rowsel[] = {"18,17:9", "22,18,20,19,17:9", "20,22,21,19,17:9", "22,23,21,19,17:9"}; - char *colsel[] = {"22,20,18,8:1", "19,18,8:2", "21,20,18,8:2", + const char *colsel[] = {"22,20,18,8:1", "19,18,8:2", "21,20,18,8:2", "23,22,20,18,8:2", "24,22,20,18,8:2", "18,p,X,8:0","22,p,X,21,8:0", "18,p,X,21,8:1", "22,p,X,23,21,8:1", "24,23,21,8:2"};
CVS commit: src/sys/arch/hpcmips/tx
Module Name:src Committed By: andvar Date: Sun Sep 10 20:41:57 UTC 2023 Modified Files: src/sys/arch/hpcmips/tx: tx39biu.c Log Message: rewrite old style tx39biu_dump function declaration and constify char *rowsel[], char *colsel[]. fixes TX39BIU_DEBUG enabled build. To generate a diff of this commit: cvs rdiff -u -r1.17 -r1.18 src/sys/arch/hpcmips/tx/tx39biu.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/hpcmips/tx
Module Name:src Committed By: andvar Date: Sun Sep 10 20:28:25 UTC 2023 Modified Files: src/sys/arch/hpcmips/tx: tx39ir.c Log Message: tx39ir(4): rewrite code to use DPRINTF definition from debug.h. custom one had wrong vrpiu_debug variable in if block (likely copy pasta) debug code also calls dbg_bitmask_print(), thus was failing to build. remove unneeded #undef TX39IRDEBUG. Fixes TX39IRDEBUG build (tested with hpcmips TX3912 kernel config). To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/sys/arch/hpcmips/tx/tx39ir.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/hpcmips/tx/tx39ir.c diff -u src/sys/arch/hpcmips/tx/tx39ir.c:1.10 src/sys/arch/hpcmips/tx/tx39ir.c:1.11 --- src/sys/arch/hpcmips/tx/tx39ir.c:1.10 Sat Oct 27 17:17:54 2012 +++ src/sys/arch/hpcmips/tx/tx39ir.c Sun Sep 10 20:28:25 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: tx39ir.c,v 1.10 2012/10/27 17:17:54 chs Exp $ */ +/* $NetBSD: tx39ir.c,v 1.11 2023/09/10 20:28:25 andvar Exp $ */ /*- * Copyright (c) 2000 The NetBSD Foundation, Inc. @@ -34,9 +34,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: tx39ir.c,v 1.10 2012/10/27 17:17:54 chs Exp $"); - -#undef TX39IRDEBUG +__KERNEL_RCSID(0, "$NetBSD: tx39ir.c,v 1.11 2023/09/10 20:28:25 andvar Exp $"); #include #include @@ -53,11 +51,10 @@ __KERNEL_RCSID(0, "$NetBSD: tx39ir.c,v 1 #include /* XXX */ #ifdef TX39IRDEBUG -int tx39ir_debug = 1; -#define DPRINTF(arg) if (vrpiu_debug) printf arg; -#else -#define DPRINTF(arg) +#define DPRINTF_ENABLE +#define DPRINTF_DEBUG tx39ir_debug #endif +#include int tx39ir_match(device_t, cfdata_t, void *); void tx39ir_attach(device_t, device_t, void *);
CVS commit: src/sys/arch/hpcmips/tx
Module Name:src Committed By: andvar Date: Sun Sep 10 20:28:25 UTC 2023 Modified Files: src/sys/arch/hpcmips/tx: tx39ir.c Log Message: tx39ir(4): rewrite code to use DPRINTF definition from debug.h. custom one had wrong vrpiu_debug variable in if block (likely copy pasta) debug code also calls dbg_bitmask_print(), thus was failing to build. remove unneeded #undef TX39IRDEBUG. Fixes TX39IRDEBUG build (tested with hpcmips TX3912 kernel config). To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/sys/arch/hpcmips/tx/tx39ir.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: sjg Date: Sun Sep 10 16:25:32 UTC 2023 Modified Files: src/usr.bin/make/unit-tests: opt-jobs.mk varname-dot-make-jobs.mk Log Message: make: skip -jC tests unless .MAKE.JOBS.C is yes To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/usr.bin/make/unit-tests/opt-jobs.mk \ src/usr.bin/make/unit-tests/varname-dot-make-jobs.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/opt-jobs.mk diff -u src/usr.bin/make/unit-tests/opt-jobs.mk:1.4 src/usr.bin/make/unit-tests/opt-jobs.mk:1.5 --- src/usr.bin/make/unit-tests/opt-jobs.mk:1.4 Sun Sep 10 11:41:33 2023 +++ src/usr.bin/make/unit-tests/opt-jobs.mk Sun Sep 10 16:25:32 2023 @@ -1,4 +1,4 @@ -# $NetBSD: opt-jobs.mk,v 1.4 2023/09/10 11:41:33 rillig Exp $ +# $NetBSD: opt-jobs.mk,v 1.5 2023/09/10 16:25:32 sjg Exp $ # # Tests for the -j command line option, which creates the targets in parallel. @@ -39,7 +39,7 @@ EXPECT..5e1C= # unlikely to o EXPECT.07.5C= EXPECT.08.5C= argument '08.5C' to option '-j' must be a positive number (exit 2) -.if ${.MAKE.JOBS.C} +.if ${.MAKE.JOBS.C} == "yes" . for arg in ${ARGS} OUTPUT!= ${MAKE} -r -f /dev/null -j ${arg} -v .MAKE.JOBS 2>&1 || echo "(exit $$?)" .if ${OUTPUT:C,^[0-9]+$,numeric,W} == numeric Index: src/usr.bin/make/unit-tests/varname-dot-make-jobs.mk diff -u src/usr.bin/make/unit-tests/varname-dot-make-jobs.mk:1.4 src/usr.bin/make/unit-tests/varname-dot-make-jobs.mk:1.5 --- src/usr.bin/make/unit-tests/varname-dot-make-jobs.mk:1.4 Sat Sep 9 01:30:59 2023 +++ src/usr.bin/make/unit-tests/varname-dot-make-jobs.mk Sun Sep 10 16:25:32 2023 @@ -1,4 +1,4 @@ -# $NetBSD: varname-dot-make-jobs.mk,v 1.4 2023/09/09 01:30:59 sjg Exp $ +# $NetBSD: varname-dot-make-jobs.mk,v 1.5 2023/09/10 16:25:32 sjg Exp $ # # Tests for the special .MAKE.JOBS variable, which is defined in jobs mode # only. There it contains the number of jobs that may run in parallel. @@ -15,16 +15,13 @@ all: @${MAKE} -r -f ${MAKEFILE} echo -j20 @${MAKE} -r -f ${MAKEFILE} echo -j0001 -.if !make(echo) +.if !make(echo) && ${.MAKE.JOBS.C} == "yes" # These results will not be static, we need NCPU # to compute expected results. -# We only support -jC if _SC_NPROCESSORS_ONLN is defined, -# otherwise we will get NCPU=0 -NCPU!= ${MAKE} -r -f /dev/null -jC -V .MAKE.JOBS 2> /dev/null || echo 0 - -.if ${NCPU} > 0 all: jC +NCPU!= ${MAKE} -r -f /dev/null -jC -V .MAKE.JOBS + # If -j arg is floating point or ends in C; # .MAKE.JOBS is a multiple of _SC_NPROCESSORS_ONLN # No news is good news here. @@ -38,7 +35,6 @@ jC: done .endif -.endif # expect: undefined # expect: 1
CVS commit: src/usr.bin/make/unit-tests
Module Name:src Committed By: sjg Date: Sun Sep 10 16:25:32 UTC 2023 Modified Files: src/usr.bin/make/unit-tests: opt-jobs.mk varname-dot-make-jobs.mk Log Message: make: skip -jC tests unless .MAKE.JOBS.C is yes To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/usr.bin/make/unit-tests/opt-jobs.mk \ src/usr.bin/make/unit-tests/varname-dot-make-jobs.mk Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch/xen/xen
Module Name:src Committed By: bouyer Date: Sun Sep 10 15:23:01 UTC 2023 Modified Files: src/sys/arch/xen/xen: xen_clock.c Log Message: If Xen system time went backward, instead of ignoring the event assume one tick passed and reinitialise the local state. If we need to call the hardclock timer several time to catch up missed events, don't do more than one second in a single event; and schedule the next event faster. Hopefully fixes occasionnal panic: cpu1: time has not advanced in 1501 heartbeats or panic: cpu0: softints stuck for 16 seconds seen in daily Xen atf runs. To generate a diff of this commit: cvs rdiff -u -r1.17 -r1.18 src/sys/arch/xen/xen/xen_clock.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/xen/xen/xen_clock.c diff -u src/sys/arch/xen/xen/xen_clock.c:1.17 src/sys/arch/xen/xen/xen_clock.c:1.18 --- src/sys/arch/xen/xen/xen_clock.c:1.17 Tue Aug 1 20:11:13 2023 +++ src/sys/arch/xen/xen/xen_clock.c Sun Sep 10 15:23:01 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: xen_clock.c,v 1.17 2023/08/01 20:11:13 riastradh Exp $ */ +/* $NetBSD: xen_clock.c,v 1.18 2023/09/10 15:23:01 bouyer Exp $ */ /*- * Copyright (c) 2017, 2018 The NetBSD Foundation, Inc. @@ -36,7 +36,7 @@ #endif #include -__KERNEL_RCSID(0, "$NetBSD: xen_clock.c,v 1.17 2023/08/01 20:11:13 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: xen_clock.c,v 1.18 2023/09/10 15:23:01 bouyer Exp $"); #include #include @@ -800,7 +800,6 @@ xen_timer_handler(void *cookie, struct c #if defined(XENPV) frame = NULL; /* We use values cached in curcpu() */ #endif -again: /* * Find how many nanoseconds of Xen system time has elapsed * since the last hardclock tick. @@ -817,7 +816,11 @@ again: last - now); #endif ci->ci_xen_systime_backwards_hardclock_evcnt.ev_count++; - now = last; + /* + * we've lost track of time. Just pretends that one + * tick elapsed, and reset our idea of last tick. + */ + ci->ci_xen_hardclock_systime_ns = last = now - ns_per_tick; } delta = now - last; @@ -845,6 +848,9 @@ again: xen_timecounter.tc_counter_mask); ci->ci_xen_timecounter_jump_evcnt.ev_count++; } + /* don't try to catch up more than one second at once */ + if (delta > 10UL) + delta = 10UL; } while (delta >= ns_per_tick) { ci->ci_xen_hardclock_systime_ns += ns_per_tick; @@ -859,13 +865,19 @@ again: /* * Re-arm the timer. If it fails, it's probably because the - * time is in the past, so update our idea of what the Xen - * system time is and try again. + * time is in the past, possibly because we're in the + * process of catching up missed hardclock calls. + * In this case schedule a tick in the nead future. */ next = ci->ci_xen_hardclock_systime_ns + ns_per_tick; error = HYPERVISOR_set_timer_op(next); - if (error) - goto again; + if (error) { + next = xen_vcputime_systime_ns() + ns_per_tick / 2; + error = HYPERVISOR_set_timer_op(next); + if (error) { + panic("failed to re-arm Xen timer %d", error); + } + } /* Success! */ return 0;
CVS commit: src/sys/arch/xen/xen
Module Name:src Committed By: bouyer Date: Sun Sep 10 15:23:01 UTC 2023 Modified Files: src/sys/arch/xen/xen: xen_clock.c Log Message: If Xen system time went backward, instead of ignoring the event assume one tick passed and reinitialise the local state. If we need to call the hardclock timer several time to catch up missed events, don't do more than one second in a single event; and schedule the next event faster. Hopefully fixes occasionnal panic: cpu1: time has not advanced in 1501 heartbeats or panic: cpu0: softints stuck for 16 seconds seen in daily Xen atf runs. To generate a diff of this commit: cvs rdiff -u -r1.17 -r1.18 src/sys/arch/xen/xen/xen_clock.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/hpcmips/dev
Module Name:src Committed By: andvar Date: Sun Sep 10 15:18:51 UTC 2023 Modified Files: src/sys/arch/hpcmips/dev: ucbtp.c Log Message: rewrite UCBTPDEBUG to use DPRINTF/DPRINTFN definitions from debug.h. No functional changes intended. To generate a diff of this commit: cvs rdiff -u -r1.23 -r1.24 src/sys/arch/hpcmips/dev/ucbtp.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/hpcmips/dev/ucbtp.c diff -u src/sys/arch/hpcmips/dev/ucbtp.c:1.23 src/sys/arch/hpcmips/dev/ucbtp.c:1.24 --- src/sys/arch/hpcmips/dev/ucbtp.c:1.23 Sat Aug 7 16:18:54 2021 +++ src/sys/arch/hpcmips/dev/ucbtp.c Sun Sep 10 15:18:51 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: ucbtp.c,v 1.23 2021/08/07 16:18:54 thorpej Exp $ */ +/* $NetBSD: ucbtp.c,v 1.24 2023/09/10 15:18:51 andvar Exp $ */ /*- * Copyright (c) 2000, 2001 The NetBSD Foundation, Inc. @@ -35,7 +35,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ucbtp.c,v 1.23 2021/08/07 16:18:54 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ucbtp.c,v 1.24 2023/09/10 15:18:51 andvar Exp $"); #include "opt_use_poll.h" @@ -64,13 +64,10 @@ __KERNEL_RCSID(0, "$NetBSD: ucbtp.c,v 1. #include /* debug */ #ifdef UCBTPDEBUG -int ucbtp_debug = 0; -#define DPRINTF(arg) if (ucbtp_debug) printf arg; -#define DPRINTFN(n, arg) if (ucbtp_debug > (n)) printf arg; -#else -#define DPRINTF(arg) -#define DPRINTFN(n, arg) +#define DPRINTF_ENABLE +#define DPRINTF_DEBUG ucbtp_debug #endif +#include enum ucbts_stat { UCBTS_STAT_DISABLE, @@ -259,7 +256,7 @@ ucbtp_calibration(struct ucbtp_softc *sc tpcalib_init(>sc_tpcalib); if (!(cs = calibration_sample_lookup())) { - DPRINTF(("no calibration data")); + DPRINTF("no calibration data"); return (1); } @@ -389,7 +386,7 @@ ucbtp_adc_async(void *arg) txreg_t reg; u_int16_t reg16; - DPRINTFN(9, ("state: %d\n", sc->sm_state)); + DPRINTFN(9, "state: %d\n", sc->sm_state); switch (sc->sm_state) { default: @@ -514,15 +511,15 @@ ucbtp_adc_async(void *arg) switch (sc->sm_measurement) { case UCBADC_MEASUREMENT_X: sc->sc_x = UCB1200_ADCDATA(reg16); -DPRINTFN(9, ("x=%d\n", sc->sc_x)); +DPRINTFN(9, "x=%d\n", sc->sc_x); break; case UCBADC_MEASUREMENT_Y: sc->sc_y = UCB1200_ADCDATA(reg16); -DPRINTFN(9, ("y=%d\n", sc->sc_y)); +DPRINTFN(9, "y=%d\n", sc->sc_y); break; case UCBADC_MEASUREMENT_PRESSURE: sc->sc_p = UCB1200_ADCDATA(reg16); -DPRINTFN(9, ("p=%d\n", sc->sc_p)); +DPRINTFN(9, "p=%d\n", sc->sc_p); break; } @@ -590,7 +587,7 @@ ucbtp_adc_async(void *arg) } else { sc->sm_reg = reg; sc->sm_read_state = TXSIB_REGREAD_INIT; -DPRINTFN(9, ("%08x\n", reg)); +DPRINTFN(9, "%08x\n", reg); if (sc->sm_writing) sc->sm_state = UCBADC_REGWRITE; else @@ -642,15 +639,15 @@ ucbtp_input(struct ucbtp_softc *sc) p = sc->sc_p; if (!sc->sc_calibrated) { - DPRINTFN(2, ("x=%4d y=%4d p=%4d\n", rx, ry, p)); - DPRINTF(("ucbtp_input: no calibration data\n")); + DPRINTFN(2, "x=%4d y=%4d p=%4d\n", rx, ry, p); + DPRINTF("ucbtp_input: no calibration data\n"); } if (p < UCBTS_PRESS_THRESHOLD || rx == 0x3ff || ry == 0x3ff || rx == 0 || ry == 0) { sc->sc_stat = UCBTS_STAT_RELEASE; if (sc->sc_polling < UCBTS_TAP_THRESHOLD) { - DPRINTFN(2, ("TAP!\n")); + DPRINTFN(2, "TAP!\n"); /* button 0 DOWN */ wsmouse_input(sc->sc_wsmousedev, 1, 0, 0, 0, 0, 0); /* button 0 UP */ @@ -661,7 +658,7 @@ ucbtp_input(struct ucbtp_softc *sc) WSMOUSE_INPUT_ABSOLUTE_X | WSMOUSE_INPUT_ABSOLUTE_Y); - DPRINTFN(2, ("RELEASE\n")); + DPRINTFN(2, "RELEASE\n"); } sc->sc_polling = 0; @@ -673,8 +670,8 @@ ucbtp_input(struct ucbtp_softc *sc) else tpcalib_trans(>sc_tpcalib, rx, ry, , ); - DPRINTFN(2, ("x: %4d->%4d y: %4d->%4d pressure=%4d\n", - rx, x, ry, y, p)); + DPRINTFN(2, "x: %4d->%4d y: %4d->%4d pressure=%4d\n", + rx, x, ry, y, p); /* debug draw */ if (sc->sc_tc->tc_videot) { @@ -715,7 +712,7 @@ ucbtp_ioctl(void *v, u_long cmd, void *d { struct ucbtp_softc *sc = v; - DPRINTF(("%s(%d): ucbtp_ioctl(%08lx)\n", __FILE__, __LINE__, cmd)); + DPRINTF("%s(%d): ucbtp_ioctl(%08lx)\n", __FILE__, __LINE__, cmd); switch (cmd) { case WSMOUSEIO_SRES:
CVS commit: src/sys/arch/hpcmips/dev
Module Name:src Committed By: andvar Date: Sun Sep 10 15:18:51 UTC 2023 Modified Files: src/sys/arch/hpcmips/dev: ucbtp.c Log Message: rewrite UCBTPDEBUG to use DPRINTF/DPRINTFN definitions from debug.h. No functional changes intended. To generate a diff of this commit: cvs rdiff -u -r1.23 -r1.24 src/sys/arch/hpcmips/dev/ucbtp.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/modules/amdgpu
Module Name:src Committed By: mrg Date: Sun Sep 10 15:12:39 UTC 2023 Modified Files: src/sys/modules/amdgpu: Makefile Log Message: use CC_WNO_MAYBE_UNINITIALIZED and fix the clang build. To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/sys/modules/amdgpu/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/modules/amdgpu
Module Name:src Committed By: mrg Date: Sun Sep 10 15:12:39 UTC 2023 Modified Files: src/sys/modules/amdgpu: Makefile Log Message: use CC_WNO_MAYBE_UNINITIALIZED and fix the clang build. To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/sys/modules/amdgpu/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/modules/amdgpu/Makefile diff -u src/sys/modules/amdgpu/Makefile:1.7 src/sys/modules/amdgpu/Makefile:1.8 --- src/sys/modules/amdgpu/Makefile:1.7 Mon Sep 4 21:45:35 2023 +++ src/sys/modules/amdgpu/Makefile Sun Sep 10 15:12:39 2023 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.7 2023/09/04 21:45:35 mrg Exp $ +# $NetBSD: Makefile,v 1.8 2023/09/10 15:12:39 mrg Exp $ .include "../Makefile.inc" .include "../drmkms/Makefile.inc" @@ -55,7 +55,7 @@ CWARNFLAGS.amdgpu_hw_hpd.c+= -Wno-type-l CWARNFLAGS.amdgpu_navi10_ppt.c+= -Wno-type-limits CWARNFLAGS.amdgpu_polaris10_smumgr.c+= -Wno-cast-qual CWARNFLAGS.amdgpu_process_pptables_v1_0.c+= -Wno-cast-qual -CWARNFLAGS.amdgpu_rlc.c+= -Wno-maybe-uninitialized +CWARNFLAGS.amdgpu_rlc.c+= ${CC_WNO_MAYBE_UNINITIALIZED} CWARNFLAGS.amdgpu_rn_clk_mgr.c+= -Wno-type-limits CWARNFLAGS.amdgpu_vega10_reg_init.c+= -Wno-cast-qual CWARNFLAGS.amdgpu_vega20_reg_init.c+= -Wno-cast-qual
CVS commit: src/sys/arch/hpcmips/dev
Module Name:src Committed By: andvar Date: Sun Sep 10 15:03:56 UTC 2023 Modified Files: src/sys/arch/hpcmips/dev: plumvideo.c Log Message: Remove custom DPRINTF/DPRINTFN definitions and reuse one defined in debug.h. Remove "#undef PLUMVIDEODEBUG", it is not defined by default. fixes PLUMVIDEODEBUG enabled build. To generate a diff of this commit: cvs rdiff -u -r1.44 -r1.45 src/sys/arch/hpcmips/dev/plumvideo.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/hpcmips/dev/plumvideo.c diff -u src/sys/arch/hpcmips/dev/plumvideo.c:1.44 src/sys/arch/hpcmips/dev/plumvideo.c:1.45 --- src/sys/arch/hpcmips/dev/plumvideo.c:1.44 Sat Apr 16 17:35:57 2022 +++ src/sys/arch/hpcmips/dev/plumvideo.c Sun Sep 10 15:03:56 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: plumvideo.c,v 1.44 2022/04/16 17:35:57 andvar Exp $ */ +/* $NetBSD: plumvideo.c,v 1.45 2023/09/10 15:03:56 andvar Exp $ */ /*- * Copyright (c) 1999-2002 The NetBSD Foundation, Inc. @@ -30,9 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: plumvideo.c,v 1.44 2022/04/16 17:35:57 andvar Exp $"); - -#undef PLUMVIDEODEBUG +__KERNEL_RCSID(0, "$NetBSD: plumvideo.c,v 1.45 2023/09/10 15:03:56 andvar Exp $"); #include "plumohci.h" /* Plum2 OHCI shared memory allocated on V-RAM */ #include "bivideo.h" @@ -73,13 +71,10 @@ __KERNEL_RCSID(0, "$NetBSD: plumvideo.c, #endif #ifdef PLUMVIDEODEBUG -int plumvideo_debug = 1; -#define DPRINTF(arg) if (plumvideo_debug) printf arg; -#define DPRINTFN(n, arg) if (plumvideo_debug > (n)) printf arg; -#else -#define DPRINTF(arg) -#define DPRINTFN(n, arg) +#define DPRINTF_ENABLE +#define DPRINTF_DEBUG plumvideo_debug #endif +#include struct plumvideo_softc { device_t sc_dev; @@ -766,14 +761,14 @@ plumvideo_power(void *ctx, int type, lon if (!sc->sc_console) return (0); /* serial console */ - DPRINTF(("%s: ON\n", device_xname(sc->sc_dev))); + DPRINTF("%s: ON\n", device_xname(sc->sc_dev)); /* power on */ plumvideo_backlight(sc, 1); break; case PWR_SUSPEND: /* FALLTHROUGH */ case PWR_STANDBY: - DPRINTF(("%s: OFF\n", device_xname(sc->sc_dev))); + DPRINTF("%s: OFF\n", device_xname(sc->sc_dev)); /* power off */ plumvideo_backlight(sc, 0); break;
CVS commit: src/sys/arch/hpcmips/dev
Module Name:src Committed By: andvar Date: Sun Sep 10 15:03:56 UTC 2023 Modified Files: src/sys/arch/hpcmips/dev: plumvideo.c Log Message: Remove custom DPRINTF/DPRINTFN definitions and reuse one defined in debug.h. Remove "#undef PLUMVIDEODEBUG", it is not defined by default. fixes PLUMVIDEODEBUG enabled build. To generate a diff of this commit: cvs rdiff -u -r1.44 -r1.45 src/sys/arch/hpcmips/dev/plumvideo.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/uvm
Module Name:src Committed By: ad Date: Sun Sep 10 15:01:11 UTC 2023 Modified Files: src/sys/uvm: uvm_pdaemon.c Log Message: uvmpd_trylockowner(): release pg->interlock before calling rw_obj_free() since it can call back into the VM system. To generate a diff of this commit: cvs rdiff -u -r1.133 -r1.134 src/sys/uvm/uvm_pdaemon.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/uvm
Module Name:src Committed By: ad Date: Sun Sep 10 15:01:11 UTC 2023 Modified Files: src/sys/uvm: uvm_pdaemon.c Log Message: uvmpd_trylockowner(): release pg->interlock before calling rw_obj_free() since it can call back into the VM system. To generate a diff of this commit: cvs rdiff -u -r1.133 -r1.134 src/sys/uvm/uvm_pdaemon.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/uvm/uvm_pdaemon.c diff -u src/sys/uvm/uvm_pdaemon.c:1.133 src/sys/uvm/uvm_pdaemon.c:1.134 --- src/sys/uvm/uvm_pdaemon.c:1.133 Sat Apr 17 21:37:21 2021 +++ src/sys/uvm/uvm_pdaemon.c Sun Sep 10 15:01:11 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: uvm_pdaemon.c,v 1.133 2021/04/17 21:37:21 mrg Exp $ */ +/* $NetBSD: uvm_pdaemon.c,v 1.134 2023/09/10 15:01:11 ad Exp $ */ /* * Copyright (c) 1997 Charles D. Cranor and Washington University. @@ -66,7 +66,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: uvm_pdaemon.c,v 1.133 2021/04/17 21:37:21 mrg Exp $"); +__KERNEL_RCSID(0, "$NetBSD: uvm_pdaemon.c,v 1.134 2023/09/10 15:01:11 ad Exp $"); #include "opt_uvmhist.h" #include "opt_readahead.h" @@ -416,7 +416,7 @@ uvmpd_page_owner_lock(struct vm_page *pg krwlock_t * uvmpd_trylockowner(struct vm_page *pg) { - krwlock_t *slock, *heldslock; + krwlock_t *slock, *heldslock = NULL; KASSERT(mutex_owned(>interlock)); @@ -453,9 +453,7 @@ uvmpd_trylockowner(struct vm_page *pg) if (heldslock != slock) { rw_exit(heldslock); slock = NULL; - } - rw_obj_free(heldslock); - if (slock != NULL) { + } else { success: /* * Set PG_ANON if it isn't set already. @@ -468,6 +466,9 @@ success: } } mutex_exit(>interlock); + if (heldslock != NULL) { + rw_obj_free(heldslock); + } return slock; }
CVS commit: src/sys/uvm
Module Name:src Committed By: ad Date: Sun Sep 10 14:54:34 UTC 2023 Modified Files: src/sys/uvm: uvm_amap.c Log Message: Align uvm_amap to COHERENCY_UNIT. To generate a diff of this commit: cvs rdiff -u -r1.128 -r1.129 src/sys/uvm/uvm_amap.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/uvm
Module Name:src Committed By: ad Date: Sun Sep 10 14:54:34 UTC 2023 Modified Files: src/sys/uvm: uvm_amap.c Log Message: Align uvm_amap to COHERENCY_UNIT. To generate a diff of this commit: cvs rdiff -u -r1.128 -r1.129 src/sys/uvm/uvm_amap.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/uvm/uvm_amap.c diff -u src/sys/uvm/uvm_amap.c:1.128 src/sys/uvm/uvm_amap.c:1.129 --- src/sys/uvm/uvm_amap.c:1.128 Mon Jun 19 08:23:35 2023 +++ src/sys/uvm/uvm_amap.c Sun Sep 10 14:54:34 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: uvm_amap.c,v 1.128 2023/06/19 08:23:35 msaitoh Exp $ */ +/* $NetBSD: uvm_amap.c,v 1.129 2023/09/10 14:54:34 ad Exp $ */ /* * Copyright (c) 1997 Charles D. Cranor and Washington University. @@ -35,7 +35,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: uvm_amap.c,v 1.128 2023/06/19 08:23:35 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: uvm_amap.c,v 1.129 2023/09/10 14:54:34 ad Exp $"); #include "opt_uvmhist.h" @@ -305,9 +305,9 @@ uvm_amap_init(void) mutex_init(_list_lock, MUTEX_DEFAULT, IPL_NONE); - pool_cache_bootstrap(_amap_cache, sizeof(struct vm_amap), 0, 0, - PR_LARGECACHE, "amappl", NULL, IPL_NONE, amap_ctor, amap_dtor, - NULL); + pool_cache_bootstrap(_amap_cache, sizeof(struct vm_amap), + COHERENCY_UNIT, 0, 0, "amappl", NULL, IPL_NONE, + amap_ctor, amap_dtor, NULL); } /*
CVS commit: src/sys
Module Name:src Committed By: ad Date: Sun Sep 10 14:46:19 UTC 2023 Modified Files: src/sys/rump/include/rump: rump_namei.h src/sys/sys: namei.h Log Message: Regen. To generate a diff of this commit: cvs rdiff -u -r1.49 -r1.50 src/sys/rump/include/rump/rump_namei.h cvs rdiff -u -r1.116 -r1.117 src/sys/sys/namei.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/rump/include/rump/rump_namei.h diff -u src/sys/rump/include/rump/rump_namei.h:1.49 src/sys/rump/include/rump/rump_namei.h:1.50 --- src/sys/rump/include/rump/rump_namei.h:1.49 Sat Sep 9 18:28:48 2023 +++ src/sys/rump/include/rump/rump_namei.h Sun Sep 10 14:46:19 2023 @@ -1,11 +1,11 @@ -/* $NetBSD: rump_namei.h,v 1.49 2023/09/09 18:28:48 ad Exp $ */ +/* $NetBSD: rump_namei.h,v 1.50 2023/09/10 14:46:19 ad Exp $ */ /* * WARNING: GENERATED FILE. DO NOT EDIT * (edit namei.src and run make namei in src/sys/sys) * by: NetBSD: gennameih.awk,v 1.5 2009/12/23 14:17:19 pooka Exp - * from: NetBSD: namei.src,v 1.61 2023/09/09 18:27:59 ad Exp + * from: NetBSD: namei.src,v 1.62 2023/09/10 14:45:53 ad Exp */ #ifndef _RUMP_RUMP_NAMEI_H_ Index: src/sys/sys/namei.h diff -u src/sys/sys/namei.h:1.116 src/sys/sys/namei.h:1.117 --- src/sys/sys/namei.h:1.116 Sat Sep 9 18:28:48 2023 +++ src/sys/sys/namei.h Sun Sep 10 14:46:18 2023 @@ -1,11 +1,11 @@ -/* $NetBSD: namei.h,v 1.116 2023/09/09 18:28:48 ad Exp $ */ +/* $NetBSD: namei.h,v 1.117 2023/09/10 14:46:18 ad Exp $ */ /* * WARNING: GENERATED FILE. DO NOT EDIT * (edit namei.src and run make namei in src/sys/sys) * by: NetBSD: gennameih.awk,v 1.5 2009/12/23 14:17:19 pooka Exp - * from: NetBSD: namei.src,v 1.61 2023/09/09 18:27:59 ad Exp + * from: NetBSD: namei.src,v 1.62 2023/09/10 14:45:53 ad Exp */ /* @@ -252,15 +252,13 @@ struct namecache { #endif /* __NAMECACHE_PRIVATE */ #ifdef _KERNEL -#include +#include struct mount; struct cpu_info; -extern pool_cache_t pnbuf_cache; /* pathname buffer cache */ - -#define PNBUF_GET() ((char *)pool_cache_get(pnbuf_cache, PR_WAITOK)) -#define PNBUF_PUT(pnb) pool_cache_put(pnbuf_cache, (void *)(pnb)) +#define PNBUF_GET() ((char *)kmem_alloc(MAXPATHLEN, KM_SLEEP)) +#define PNBUF_PUT(pnb) kmem_free((pnb), MAXPATHLEN) /* * Typesafe flags for namei_simple/nameiat_simple.
CVS commit: src/sys
Module Name:src Committed By: ad Date: Sun Sep 10 14:46:19 UTC 2023 Modified Files: src/sys/rump/include/rump: rump_namei.h src/sys/sys: namei.h Log Message: Regen. To generate a diff of this commit: cvs rdiff -u -r1.49 -r1.50 src/sys/rump/include/rump/rump_namei.h cvs rdiff -u -r1.116 -r1.117 src/sys/sys/namei.h 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: ad Date: Sun Sep 10 14:45:53 UTC 2023 Modified Files: src/common/lib/libc/gen: radixtree.c src/sys/kern: init_main.c kern_descrip.c kern_lwp.c kern_mutex_obj.c kern_resource.c kern_rwlock_obj.c kern_turnstile.c subr_kcpuset.c vfs_cwd.c vfs_init.c vfs_lockf.c src/sys/rump/librump/rumpkern: rump.c src/sys/rump/librump/rumpvfs: rump_vfs.c src/sys/sys: namei.src src/sys/uvm: uvm_init.c uvm_map.c uvm_readahead.c Log Message: - Do away with separate pool_cache for some kernel objects that have no special requirements and use the general purpose allocator instead. On one of my test systems this makes for a small (~1%) but repeatable reduction in system time during builds presumably because it decreases the kernel's cache / memory bandwidth footprint a little. - vfs_lockf: cache a pointer to the uidinfo and put mutex in the data segment. To generate a diff of this commit: cvs rdiff -u -r1.29 -r1.30 src/common/lib/libc/gen/radixtree.c cvs rdiff -u -r1.543 -r1.544 src/sys/kern/init_main.c cvs rdiff -u -r1.258 -r1.259 src/sys/kern/kern_descrip.c cvs rdiff -u -r1.252 -r1.253 src/sys/kern/kern_lwp.c cvs rdiff -u -r1.11 -r1.12 src/sys/kern/kern_mutex_obj.c cvs rdiff -u -r1.191 -r1.192 src/sys/kern/kern_resource.c cvs rdiff -u -r1.9 -r1.10 src/sys/kern/kern_rwlock_obj.c cvs rdiff -u -r1.46 -r1.47 src/sys/kern/kern_turnstile.c cvs rdiff -u -r1.16 -r1.17 src/sys/kern/subr_kcpuset.c cvs rdiff -u -r1.8 -r1.9 src/sys/kern/vfs_cwd.c cvs rdiff -u -r1.61 -r1.62 src/sys/kern/vfs_init.c cvs rdiff -u -r1.78 -r1.79 src/sys/kern/vfs_lockf.c cvs rdiff -u -r1.357 -r1.358 src/sys/rump/librump/rumpkern/rump.c cvs rdiff -u -r1.94 -r1.95 src/sys/rump/librump/rumpvfs/rump_vfs.c cvs rdiff -u -r1.61 -r1.62 src/sys/sys/namei.src cvs rdiff -u -r1.56 -r1.57 src/sys/uvm/uvm_init.c cvs rdiff -u -r1.407 -r1.408 src/sys/uvm/uvm_map.c cvs rdiff -u -r1.13 -r1.14 src/sys/uvm/uvm_readahead.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/common/lib/libc/gen/radixtree.c diff -u src/common/lib/libc/gen/radixtree.c:1.29 src/common/lib/libc/gen/radixtree.c:1.30 --- src/common/lib/libc/gen/radixtree.c:1.29 Mon Mar 6 21:39:06 2023 +++ src/common/lib/libc/gen/radixtree.c Sun Sep 10 14:45:52 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: radixtree.c,v 1.29 2023/03/06 21:39:06 andvar Exp $ */ +/* $NetBSD: radixtree.c,v 1.30 2023/09/10 14:45:52 ad Exp $ */ /*- * Copyright (c)2011,2012,2013 YAMAMOTO Takashi, @@ -43,7 +43,7 @@ * * Intermediate nodes are automatically allocated and freed internally and * basically users don't need to care about them. The allocation is done via - * pool_cache_get(9) for _KERNEL, malloc(3) for userland, and alloc() for + * kmem_zalloc(9) for _KERNEL, malloc(3) for userland, and alloc() for * _STANDALONE environment. Only radix_tree_insert_node function can allocate * memory for intermediate nodes and thus can fail for ENOMEM. * @@ -112,17 +112,17 @@ #include #if defined(_KERNEL) || defined(_STANDALONE) -__KERNEL_RCSID(0, "$NetBSD: radixtree.c,v 1.29 2023/03/06 21:39:06 andvar Exp $"); +__KERNEL_RCSID(0, "$NetBSD: radixtree.c,v 1.30 2023/09/10 14:45:52 ad Exp $"); #include #include -#include +#include #include #include #if defined(_STANDALONE) #include #endif /* defined(_STANDALONE) */ #else /* defined(_KERNEL) || defined(_STANDALONE) */ -__RCSID("$NetBSD: radixtree.c,v 1.29 2023/03/06 21:39:06 andvar Exp $"); +__RCSID("$NetBSD: radixtree.c,v 1.30 2023/09/10 14:45:52 ad Exp $"); #include #include #include @@ -303,18 +303,6 @@ radix_tree_node_init(struct radix_tree_n } #if defined(_KERNEL) -pool_cache_t radix_tree_node_cache __read_mostly; - -static int -radix_tree_node_ctor(void *dummy, void *item, int flags) -{ - struct radix_tree_node *n = item; - - KASSERT(dummy == NULL); - radix_tree_node_init(n); - return 0; -} - /* * radix_tree_init: * @@ -325,10 +313,7 @@ void radix_tree_init(void) { - radix_tree_node_cache = pool_cache_init(sizeof(struct radix_tree_node), - coherency_unit, 0, PR_LARGECACHE, "radixnode", NULL, IPL_NONE, - radix_tree_node_ctor, NULL, NULL); - KASSERT(radix_tree_node_cache != NULL); + /* nothing right now */ } /* @@ -346,10 +331,10 @@ radix_tree_await_memory(void) int i; for (i = 0; i < __arraycount(nodes); i++) { - nodes[i] = pool_cache_get(radix_tree_node_cache, PR_WAITOK); + nodes[i] = kmem_alloc(sizeof(struct radix_tree_node), KM_SLEEP); } while (--i >= 0) { - pool_cache_put(radix_tree_node_cache, nodes[i]); + kmem_free(nodes[i], sizeof(struct radix_tree_node)); } } @@ -424,11 +409,10 @@ radix_tree_alloc_node(void) #if defined(_KERNEL) /* - * note that pool_cache_get can block. + * note that kmem_alloc can block. */ - n = pool_cache_get(radix_tree_node_cache, PR_NOWAIT); -#else /* defined(_KERNEL) */
CVS commit: src
Module Name:src Committed By: ad Date: Sun Sep 10 14:45:53 UTC 2023 Modified Files: src/common/lib/libc/gen: radixtree.c src/sys/kern: init_main.c kern_descrip.c kern_lwp.c kern_mutex_obj.c kern_resource.c kern_rwlock_obj.c kern_turnstile.c subr_kcpuset.c vfs_cwd.c vfs_init.c vfs_lockf.c src/sys/rump/librump/rumpkern: rump.c src/sys/rump/librump/rumpvfs: rump_vfs.c src/sys/sys: namei.src src/sys/uvm: uvm_init.c uvm_map.c uvm_readahead.c Log Message: - Do away with separate pool_cache for some kernel objects that have no special requirements and use the general purpose allocator instead. On one of my test systems this makes for a small (~1%) but repeatable reduction in system time during builds presumably because it decreases the kernel's cache / memory bandwidth footprint a little. - vfs_lockf: cache a pointer to the uidinfo and put mutex in the data segment. To generate a diff of this commit: cvs rdiff -u -r1.29 -r1.30 src/common/lib/libc/gen/radixtree.c cvs rdiff -u -r1.543 -r1.544 src/sys/kern/init_main.c cvs rdiff -u -r1.258 -r1.259 src/sys/kern/kern_descrip.c cvs rdiff -u -r1.252 -r1.253 src/sys/kern/kern_lwp.c cvs rdiff -u -r1.11 -r1.12 src/sys/kern/kern_mutex_obj.c cvs rdiff -u -r1.191 -r1.192 src/sys/kern/kern_resource.c cvs rdiff -u -r1.9 -r1.10 src/sys/kern/kern_rwlock_obj.c cvs rdiff -u -r1.46 -r1.47 src/sys/kern/kern_turnstile.c cvs rdiff -u -r1.16 -r1.17 src/sys/kern/subr_kcpuset.c cvs rdiff -u -r1.8 -r1.9 src/sys/kern/vfs_cwd.c cvs rdiff -u -r1.61 -r1.62 src/sys/kern/vfs_init.c cvs rdiff -u -r1.78 -r1.79 src/sys/kern/vfs_lockf.c cvs rdiff -u -r1.357 -r1.358 src/sys/rump/librump/rumpkern/rump.c cvs rdiff -u -r1.94 -r1.95 src/sys/rump/librump/rumpvfs/rump_vfs.c cvs rdiff -u -r1.61 -r1.62 src/sys/sys/namei.src cvs rdiff -u -r1.56 -r1.57 src/sys/uvm/uvm_init.c cvs rdiff -u -r1.407 -r1.408 src/sys/uvm/uvm_map.c cvs rdiff -u -r1.13 -r1.14 src/sys/uvm/uvm_readahead.c 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: ad Date: Sun Sep 10 14:44:08 UTC 2023 Modified Files: src/sys/kern: kern_descrip.c Log Message: It's easy to exhaust the open file limit on a system with many CPUs due to caching. Allow a bit of leeway to reduce the element of surprise. To generate a diff of this commit: cvs rdiff -u -r1.257 -r1.258 src/sys/kern/kern_descrip.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/kern/kern_descrip.c diff -u src/sys/kern/kern_descrip.c:1.257 src/sys/kern/kern_descrip.c:1.258 --- src/sys/kern/kern_descrip.c:1.257 Sat Apr 22 14:23:59 2023 +++ src/sys/kern/kern_descrip.c Sun Sep 10 14:44:08 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: kern_descrip.c,v 1.257 2023/04/22 14:23:59 riastradh Exp $ */ +/* $NetBSD: kern_descrip.c,v 1.258 2023/09/10 14:44:08 ad Exp $ */ /*- * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc. @@ -70,7 +70,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: kern_descrip.c,v 1.257 2023/04/22 14:23:59 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_descrip.c,v 1.258 2023/09/10 14:44:08 ad Exp $"); #include #include @@ -1226,12 +1226,18 @@ fd_abort(proc_t *p, file_t *fp, unsigned static int file_ctor(void *arg, void *obj, int flags) { + /* + * It's easy to exhaust the open file limit on a system with many + * CPUs due to caching. Allow a bit of leeway to reduce the element + * of surprise. + */ + u_int slop = PCG_NOBJECTS_NORMAL * (ncpu - 1); file_t *fp = obj; memset(fp, 0, sizeof(*fp)); mutex_enter(_lock); - if (__predict_false(nfiles >= maxfiles)) { + if (__predict_false(nfiles >= slop + maxfiles)) { mutex_exit(_lock); tablefull("file", "increase kern.maxfiles or MAXFILES"); return ENFILE;
CVS commit: src/sys/kern
Module Name:src Committed By: ad Date: Sun Sep 10 14:44:08 UTC 2023 Modified Files: src/sys/kern: kern_descrip.c Log Message: It's easy to exhaust the open file limit on a system with many CPUs due to caching. Allow a bit of leeway to reduce the element of surprise. To generate a diff of this commit: cvs rdiff -u -r1.257 -r1.258 src/sys/kern/kern_descrip.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/sys
Module Name:src Committed By: ad Date: Sun Sep 10 14:31:24 UTC 2023 Modified Files: src/sys/sys: lwp.h Log Message: KPREEMPT_ENABLE(): optimise away one of the conditionals; the same test is repeated in kpreempt() which is rarely called. To generate a diff of this commit: cvs rdiff -u -r1.219 -r1.220 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/sys/sys/lwp.h diff -u src/sys/sys/lwp.h:1.219 src/sys/sys/lwp.h:1.220 --- src/sys/sys/lwp.h:1.219 Mon Aug 7 10:31:42 2023 +++ src/sys/sys/lwp.h Sun Sep 10 14:31:24 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: lwp.h,v 1.219 2023/08/07 10:31:42 riastradh Exp $ */ +/* $NetBSD: lwp.h,v 1.220 2023/09/10 14:31:24 ad Exp $ */ /* * Copyright (c) 2001, 2006, 2007, 2008, 2009, 2010, 2019, 2020 @@ -554,12 +554,10 @@ KPREEMPT_ENABLE(lwp_t *l) KASSERTMSG(l == (l1 = curlwp), "l=%p curlwp=%p", l, l1); KASSERT(l->l_nopreempt > 0); __insn_barrier(); - if (--l->l_nopreempt != 0) - return; + l->l_nopreempt--; __insn_barrier(); if (__predict_false(l->l_dopreempt)) kpreempt(0); - __insn_barrier(); } /* For lwp::l_dopreempt */
CVS commit: src/sys/sys
Module Name:src Committed By: ad Date: Sun Sep 10 14:31:24 UTC 2023 Modified Files: src/sys/sys: lwp.h Log Message: KPREEMPT_ENABLE(): optimise away one of the conditionals; the same test is repeated in kpreempt() which is rarely called. To generate a diff of this commit: cvs rdiff -u -r1.219 -r1.220 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: ad Date: Sun Sep 10 14:29:13 UTC 2023 Modified Files: src/sys/kern: subr_kmem.c Log Message: Assert that kmem_alloc() provides the expected alignment. To generate a diff of this commit: cvs rdiff -u -r1.88 -r1.89 src/sys/kern/subr_kmem.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_kmem.c diff -u src/sys/kern/subr_kmem.c:1.88 src/sys/kern/subr_kmem.c:1.89 --- src/sys/kern/subr_kmem.c:1.88 Sun Apr 9 08:50:20 2023 +++ src/sys/kern/subr_kmem.c Sun Sep 10 14:29:13 2023 @@ -1,7 +1,7 @@ -/* $NetBSD: subr_kmem.c,v 1.88 2023/04/09 08:50:20 riastradh Exp $ */ +/* $NetBSD: subr_kmem.c,v 1.89 2023/09/10 14:29:13 ad Exp $ */ /* - * Copyright (c) 2009-2020 The NetBSD Foundation, Inc. + * Copyright (c) 2009-2023 The NetBSD Foundation, Inc. * All rights reserved. * * This code is derived from software contributed to The NetBSD Foundation @@ -78,7 +78,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: subr_kmem.c,v 1.88 2023/04/09 08:50:20 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: subr_kmem.c,v 1.89 2023/09/10 14:29:13 ad Exp $"); #ifdef _KERNEL_OPT #include "opt_kmem.h" @@ -325,6 +325,8 @@ kmem_intr_alloc(size_t requested_size, k return NULL; } FREECHECK_OUT(_freecheck, p); + KASSERT(size < coherency_unit || + ALIGNED_POINTER(p, coherency_unit)); return p; } @@ -334,6 +336,8 @@ kmem_intr_alloc(size_t requested_size, k kasan_mark(p, origsize, size, KASAN_KMEM_REDZONE); return p; } + + KASSERT(size < coherency_unit || ALIGNED_POINTER(p, coherency_unit)); return p; }
CVS commit: src/sys/kern
Module Name:src Committed By: ad Date: Sun Sep 10 14:29:13 UTC 2023 Modified Files: src/sys/kern: subr_kmem.c Log Message: Assert that kmem_alloc() provides the expected alignment. To generate a diff of this commit: cvs rdiff -u -r1.88 -r1.89 src/sys/kern/subr_kmem.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/hpcmips/dev
Module Name:src Committed By: andvar Date: Sun Sep 10 14:28:57 UTC 2023 Modified Files: src/sys/arch/hpcmips/dev: plumpcmcia.c Log Message: Various fixes to (re)enable PLUMPCMCIA_DEBUG build: remove brackets around DPRINTF params (that's leftover from custom definition). pcihp->ioh expects %lx specifier, not %x. constify char *width_names. rename cardtype to type in one of DPRINTF argument's condition. To generate a diff of this commit: cvs rdiff -u -r1.30 -r1.31 src/sys/arch/hpcmips/dev/plumpcmcia.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/hpcmips/dev/plumpcmcia.c diff -u src/sys/arch/hpcmips/dev/plumpcmcia.c:1.30 src/sys/arch/hpcmips/dev/plumpcmcia.c:1.31 --- src/sys/arch/hpcmips/dev/plumpcmcia.c:1.30 Sat Aug 7 16:18:54 2021 +++ src/sys/arch/hpcmips/dev/plumpcmcia.c Sun Sep 10 14:28:57 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: plumpcmcia.c,v 1.30 2021/08/07 16:18:54 thorpej Exp $ */ +/* $NetBSD: plumpcmcia.c,v 1.31 2023/09/10 14:28:57 andvar Exp $ */ /* * Copyright (c) 1999, 2000 UCHIYAMA Yasushi. All rights reserved. @@ -31,7 +31,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: plumpcmcia.c,v 1.30 2021/08/07 16:18:54 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: plumpcmcia.c,v 1.31 2023/09/10 14:28:57 andvar Exp $"); #include #include @@ -375,9 +375,9 @@ plumpcmcia_chip_mem_alloc(pcmcia_chipset pcmhp->size = size; pcmhp->realsize = realsize; - DPRINTF(("plumpcmcia_chip_mem_alloc: size %#x->%#x addr %#x->%#x\n", + DPRINTF("plumpcmcia_chip_mem_alloc: size %#x->%#x addr %#x->%#x\n", (unsigned)size, (unsigned)realsize, (unsigned)pcmhp->addr, - (unsigned)pcmhp->memh)); + (unsigned)pcmhp->memh); return (0); } @@ -409,7 +409,7 @@ plumpcmcia_chip_mem_map(pcmcia_chipset_h } } if (win == -1) { - DPRINTF(("plumpcmcia_chip_mem_map: no window\n")); + DPRINTF("plumpcmcia_chip_mem_map: no window\n"); return (1); } @@ -421,10 +421,10 @@ plumpcmcia_chip_mem_map(pcmcia_chipset_h *windowp = win; card_offset = (((int32_t)card_addr) - ((int32_t)busaddr)); - DPRINTF(("plumpcmcia_chip_mem_map window %d bus %#x(kv:%#x)+%#x" + DPRINTF("plumpcmcia_chip_mem_map window %d bus %#x(kv:%#x)+%#x" " size %#x at card addr %#x offset %#x\n", win, (unsigned)busaddr, (unsigned)pcmhp->memh, (unsigned)*offsetp, - (unsigned)size, (unsigned)card_addr, (unsigned)card_offset)); + (unsigned)size, (unsigned)card_addr, (unsigned)card_offset); ph->ph_mem[win].pm_addr = busaddr; ph->ph_mem[win].pm_size = size; @@ -480,8 +480,8 @@ plumpcmcia_chip_do_mem_map(struct plumpc reg |= PLUM_PCMCIA_WINEN_MEM(win); plum_conf_write(regt, regh, PLUM_PCMCIA_WINEN, reg); - DPRINTF(("plumpcmcia_chip_do_mem_map: window:%d %#x(%#x)+%#x\n", - win, offset, addr, size)); + DPRINTF("plumpcmcia_chip_do_mem_map: window:%d %#x(%#x)+%#x\n", + win, offset, addr, size); delay(100); } @@ -508,31 +508,31 @@ plumpcmcia_chip_io_alloc(pcmcia_chipset_ { struct plumpcmcia_handle *ph = (void*)pch; - DPRINTF(("plumpcmcia_chip_io_alloc: start=%#x size=%#x ", - (unsigned)start, (unsigned)size)); + DPRINTF("plumpcmcia_chip_io_alloc: start=%#x size=%#x ", + (unsigned)start, (unsigned)size); if (start) { if (bus_space_map(ph->ph_iot, ph->ph_iobase + start, size, 0, >ioh)) { - DPRINTF(("bus_space_map failed\n")); + DPRINTF("bus_space_map failed\n"); return (1); } pcihp->flags = 0; pcihp->addr = start; - DPRINTF(("(mapped) %#x+%#x\n", (unsigned)start, - (unsigned)size)); + DPRINTF("(mapped) %#x+%#x\n", (unsigned)start, + (unsigned)size); } else { if (bus_space_alloc(ph->ph_iot, ph->ph_iobase, ph->ph_iobase + ph->ph_iosize, size, align, 0, 0, 0, >ioh)) { - DPRINTF(("bus_space_alloc failed\n")); + DPRINTF("bus_space_alloc failed\n"); return 1; } /* Address offset from IO area base */ pcihp->addr = pcihp->ioh - ph->ph_iobase - ((struct bus_space_tag_hpcmips*)ph->ph_iot)->base; pcihp->flags = PCMCIA_IO_ALLOCATED; - DPRINTF(("(allocated) %#x+%#x\n", (unsigned)pcihp->addr, - (unsigned)size)); + DPRINTF("(allocated) %#x+%#x\n", (unsigned)pcihp->addr, + (unsigned)size); } pcihp->iot = ph->ph_iot; @@ -547,7 +547,7 @@ plumpcmcia_chip_io_map(pcmcia_chipset_ha struct pcmcia_io_handle *pcihp, int *windowp) { #ifdef PLUMPCMCIA_DEBUG - static char *width_names[] = { "auto", "io8", "io16" }; + static const char *width_names[] = { "auto", "io8", "io16" }; #endif /* PLUMPCMCIA_DEBUG */ struct plumpcmcia_handle *ph = (void*)pch; bus_addr_t winofs; @@ -568,7 +568,7 @@ plumpcmcia_chip_io_map(pcmcia_chipset_ha } } if (win == -1) { - DPRINTF(("plumpcmcia_chip_io_map: no window\n")); + DPRINTF("plumpcmcia_chip_io_map: no window\n"); return (1); } *windowp = win; @@ -579,9 +579,9 @@ plumpcmcia_chip_io_map(pcmcia_chipset_ha
CVS commit: src/sys/arch/hpcmips/dev
Module Name:src Committed By: andvar Date: Sun Sep 10 14:28:57 UTC 2023 Modified Files: src/sys/arch/hpcmips/dev: plumpcmcia.c Log Message: Various fixes to (re)enable PLUMPCMCIA_DEBUG build: remove brackets around DPRINTF params (that's leftover from custom definition). pcihp->ioh expects %lx specifier, not %x. constify char *width_names. rename cardtype to type in one of DPRINTF argument's condition. To generate a diff of this commit: cvs rdiff -u -r1.30 -r1.31 src/sys/arch/hpcmips/dev/plumpcmcia.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/hpcmips/tx
Module Name:src Committed By: andvar Date: Sun Sep 10 14:11:34 UTC 2023 Modified Files: src/sys/arch/hpcmips/tx: tx39io.c Log Message: nix whitespace before semicolon. To generate a diff of this commit: cvs rdiff -u -r1.23 -r1.24 src/sys/arch/hpcmips/tx/tx39io.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/hpcmips/tx/tx39io.c diff -u src/sys/arch/hpcmips/tx/tx39io.c:1.23 src/sys/arch/hpcmips/tx/tx39io.c:1.24 --- src/sys/arch/hpcmips/tx/tx39io.c:1.23 Sat Oct 27 17:17:54 2012 +++ src/sys/arch/hpcmips/tx/tx39io.c Sun Sep 10 14:11:33 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: tx39io.c,v 1.23 2012/10/27 17:17:54 chs Exp $ */ +/* $NetBSD: tx39io.c,v 1.24 2023/09/10 14:11:33 andvar Exp $ */ /*- * Copyright (c) 1999-2001 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: tx39io.c,v 1.23 2012/10/27 17:17:54 chs Exp $"); +__KERNEL_RCSID(0, "$NetBSD: tx39io.c,v 1.24 2023/09/10 14:11:33 andvar Exp $"); #include #include @@ -238,7 +238,7 @@ mfio_out(hpcio_chip_t arg, int port, int static int mfio_in(hpcio_chip_t arg, int port) { - struct tx39io_softc *sc __attribute__((__unused__)) = arg->hc_sc ; + struct tx39io_softc *sc __attribute__((__unused__)) = arg->hc_sc; DPRINTF("port #%d\n", port); return (tx_conf_read(sc->sc_tc, TX39_IOMFIODATAIN_REG) & (1 << port));
CVS commit: src/sys/arch/hpcmips/tx
Module Name:src Committed By: andvar Date: Sun Sep 10 14:11:34 UTC 2023 Modified Files: src/sys/arch/hpcmips/tx: tx39io.c Log Message: nix whitespace before semicolon. To generate a diff of this commit: cvs rdiff -u -r1.23 -r1.24 src/sys/arch/hpcmips/tx/tx39io.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys
Module Name:src Committed By: abs Date: Sun Sep 10 14:04:28 UTC 2023 Modified Files: src/sys/conf: files src/sys/dev/ic: ahcisata_core.c ahcisatavar.h src/sys/dev/pci: ahcisata_pci.c Log Message: Rework AHCISATA_EXTRA_DELAY for kern/56737 - Remove AHCI_QUIRK_EXTRA_DELAY as issue appears to be drive and not controller related - Replace AHCISATA_EXTRA_DELAY with AHCISATA_REMOVE_EXTRA_DELAY, so defaulting to enabling the extra delay, as the downside of slower probing on systems which do not need it is less than having other systems intermittently fail to probe and attach drives - Also allow disabling extra delay with AHCISATA_EXTRA_DELAY_MS = 0 We should return to this code to work out which of the extra delays are needed, and how long they need to be. It may be that faster systems are more likely to trigger the issue (I've only seen it on a 13th gen i7-13700, though only tested on a limited set) XXX pullup -10 To generate a diff of this commit: cvs rdiff -u -r1.1308 -r1.1309 src/sys/conf/files cvs rdiff -u -r1.107 -r1.108 src/sys/dev/ic/ahcisata_core.c cvs rdiff -u -r1.27 -r1.28 src/sys/dev/ic/ahcisatavar.h cvs rdiff -u -r1.69 -r1.70 src/sys/dev/pci/ahcisata_pci.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys
Module Name:src Committed By: abs Date: Sun Sep 10 14:04:28 UTC 2023 Modified Files: src/sys/conf: files src/sys/dev/ic: ahcisata_core.c ahcisatavar.h src/sys/dev/pci: ahcisata_pci.c Log Message: Rework AHCISATA_EXTRA_DELAY for kern/56737 - Remove AHCI_QUIRK_EXTRA_DELAY as issue appears to be drive and not controller related - Replace AHCISATA_EXTRA_DELAY with AHCISATA_REMOVE_EXTRA_DELAY, so defaulting to enabling the extra delay, as the downside of slower probing on systems which do not need it is less than having other systems intermittently fail to probe and attach drives - Also allow disabling extra delay with AHCISATA_EXTRA_DELAY_MS = 0 We should return to this code to work out which of the extra delays are needed, and how long they need to be. It may be that faster systems are more likely to trigger the issue (I've only seen it on a 13th gen i7-13700, though only tested on a limited set) XXX pullup -10 To generate a diff of this commit: cvs rdiff -u -r1.1308 -r1.1309 src/sys/conf/files cvs rdiff -u -r1.107 -r1.108 src/sys/dev/ic/ahcisata_core.c cvs rdiff -u -r1.27 -r1.28 src/sys/dev/ic/ahcisatavar.h cvs rdiff -u -r1.69 -r1.70 src/sys/dev/pci/ahcisata_pci.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/conf/files diff -u src/sys/conf/files:1.1308 src/sys/conf/files:1.1309 --- src/sys/conf/files:1.1308 Sun Sep 3 19:38:58 2023 +++ src/sys/conf/files Sun Sep 10 14:04:28 2023 @@ -1,4 +1,4 @@ -# $NetBSD: files,v 1.1308 2023/09/03 19:38:58 andvar Exp $ +# $NetBSD: files,v 1.1309 2023/09/10 14:04:28 abs Exp $ # @(#)files.newconf 7.5 (Berkeley) 5/10/93 version 20171118 @@ -1062,7 +1062,7 @@ device njata: ata, ata_piobm, wdc_common file dev/ic/ninjaata32.c njata # AHCI-compatible SATA controllers -defflag opt_ahcisata.h AHCISATA_EXTRA_DELAY +defflag opt_ahcisata.h AHCISATA_REMOVE_EXTRA_DELAY defparam opt_ahcisata.h AHCISATA_EXTRA_DELAY_MS define ahcisata_core file dev/ic/ahcisata_core.c ahcisata_core Index: src/sys/dev/ic/ahcisata_core.c diff -u src/sys/dev/ic/ahcisata_core.c:1.107 src/sys/dev/ic/ahcisata_core.c:1.108 --- src/sys/dev/ic/ahcisata_core.c:1.107 Mon Aug 1 07:37:18 2022 +++ src/sys/dev/ic/ahcisata_core.c Sun Sep 10 14:04:28 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: ahcisata_core.c,v 1.107 2022/08/01 07:37:18 mlelstv Exp $ */ +/* $NetBSD: ahcisata_core.c,v 1.108 2023/09/10 14:04:28 abs Exp $ */ /* * Copyright (c) 2006 Manuel Bouyer. @@ -26,7 +26,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ahcisata_core.c,v 1.107 2022/08/01 07:37:18 mlelstv Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ahcisata_core.c,v 1.108 2023/09/10 14:04:28 abs Exp $"); #include #include @@ -119,15 +119,11 @@ static const struct scsipi_bustype ahci_ #define AHCISATA_EXTRA_DELAY_MS 500 /* XXX need to adjust */ #endif -#ifdef AHCISATA_EXTRA_DELAY +#if !defined(AHCISATA_REMOVE_EXTRA_DELAY) && AHCISATA_EXTRA_DELAY_MS > 0 #define AHCISATA_DO_EXTRA_DELAY(sc, chp, msg, flags) \ ata_delay(chp, AHCISATA_EXTRA_DELAY_MS, msg, flags) #else -#define AHCISATA_DO_EXTRA_DELAY(sc, chp, msg, flags) \ -do {\ - if ((sc)->sc_ahci_quirks & AHCI_QUIRK_EXTRA_DELAY) \ - ata_delay(chp, AHCISATA_EXTRA_DELAY_MS, msg, flags); \ -} while (0) +#define AHCISATA_DO_EXTRA_DELAY(sc, chp, msg, flags) do { } while (0) #endif const struct ata_bustype ahci_ata_bustype = { Index: src/sys/dev/ic/ahcisatavar.h diff -u src/sys/dev/ic/ahcisatavar.h:1.27 src/sys/dev/ic/ahcisatavar.h:1.28 --- src/sys/dev/ic/ahcisatavar.h:1.27 Fri Nov 19 23:46:55 2021 +++ src/sys/dev/ic/ahcisatavar.h Sun Sep 10 14:04:28 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: ahcisatavar.h,v 1.27 2021/11/19 23:46:55 rin Exp $ */ +/* $NetBSD: ahcisatavar.h,v 1.28 2023/09/10 14:04:28 abs Exp $ */ /* * Copyright (c) 2006 Manuel Bouyer. @@ -59,7 +59,6 @@ struct ahci_softc { #define AHCI_PCI_QUIRK_BAD64 __BIT(1) /* broken 64-bit DMA */ #define AHCI_QUIRK_BADPMP __BIT(2) /* broken PMP support, ignore */ #define AHCI_QUIRK_BADNCQ __BIT(3) /* possibly broken NCQ support, ignore */ -#define AHCI_QUIRK_EXTRA_DELAY __BIT(4) /* needs extra delay */ uint32_t sc_ahci_cap; /* copy of AHCI_CAP */ int sc_ncmds; /* number of command slots */ Index: src/sys/dev/pci/ahcisata_pci.c diff -u src/sys/dev/pci/ahcisata_pci.c:1.69 src/sys/dev/pci/ahcisata_pci.c:1.70 --- src/sys/dev/pci/ahcisata_pci.c:1.69 Mon Jul 31 11:24:32 2023 +++ src/sys/dev/pci/ahcisata_pci.c Sun Sep 10 14:04:28 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: ahcisata_pci.c,v 1.69 2023/07/31 11:24:32 tnn Exp $ */ +/* $NetBSD: ahcisata_pci.c,v 1.70 2023/09/10 14:04:28 abs Exp $ */ /* * Copyright (c) 2006 Manuel Bouyer. @@ -26,7 +26,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ahcisata_pci.c,v 1.69 2023/07/31 11:24:32 tnn Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ahcisata_pci.c,v 1.70 2023/09/10 14:04:28 abs Exp $"); #ifdef _KERNEL_OPT #include
CVS commit: src/external/cddl/osnet/dist/uts/common/fs/zfs
Module Name:src Committed By: riastradh Date: Sun Sep 10 12:50:38 UTC 2023 Modified Files: src/external/cddl/osnet/dist/uts/common/fs/zfs: zfs_ioctl.c Log Message: Revert "Teach zfs bdevsw to do b_psize." This is used only by dump and swap, which won't work safely on zvols anyway. We should make swap work eventually, but right now it's leading unwary ussers into deadlock scenarios, so let's make it fail early instead. To generate a diff of this commit: cvs rdiff -u -r1.25 -r1.26 \ src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_ioctl.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_ioctl.c diff -u src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_ioctl.c:1.25 src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_ioctl.c:1.26 --- src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_ioctl.c:1.25 Mon Oct 31 10:32:28 2022 +++ src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_ioctl.c Sun Sep 10 12:50:38 2023 @@ -7062,29 +7062,6 @@ nb_zvol_strategy(struct buf *bp) (void) zvol_strategy(bp); } -static int -nb_zvol_psize(dev_t dev) -{ - minor_t minor = getminor(dev); - off_t nbytes; - unsigned bytespersector; - - if (minor == 0) /* /dev/zfs */ - return -1; - - if (zvol_ioctl(dev, DIOCGMEDIASIZE, (intptr_t), 0, - NOCRED, NULL)) - return -1; - if (zvol_ioctl(dev, DIOCGSECTORSIZE, (intptr_t), 0, - NOCRED, NULL)) - return -1; - if (bytespersector == 0) /* paranoia */ - return -1; - if (nbytes/bytespersector > INT_MAX) /* paranoia */ - return -1; - return nbytes/bytespersector; -} - static const struct fileops zfs_fileops = { .fo_name = "zfs", .fo_read = fbadop_read, @@ -7104,7 +7081,7 @@ const struct bdevsw zfs_bdevsw = { .d_strategy = nb_zvol_strategy, .d_ioctl = nb_zfsdev_ioctl, .d_dump = nodump, - .d_psize = nb_zvol_psize, + .d_psize = nosize, .d_flag = D_DISK | D_MPSAFE };
CVS commit: src/external/cddl/osnet/dist/uts/common/fs/zfs
Module Name:src Committed By: riastradh Date: Sun Sep 10 12:50:38 UTC 2023 Modified Files: src/external/cddl/osnet/dist/uts/common/fs/zfs: zfs_ioctl.c Log Message: Revert "Teach zfs bdevsw to do b_psize." This is used only by dump and swap, which won't work safely on zvols anyway. We should make swap work eventually, but right now it's leading unwary ussers into deadlock scenarios, so let's make it fail early instead. To generate a diff of this commit: cvs rdiff -u -r1.25 -r1.26 \ src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_ioctl.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: Sun Sep 10 11:52:30 UTC 2023 Modified Files: src/usr.bin/make: make.h Log Message: make: remove redundant 'extern' from function declaration To generate a diff of this commit: cvs rdiff -u -r1.324 -r1.325 src/usr.bin/make/make.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/usr.bin/make
Module Name:src Committed By: rillig Date: Sun Sep 10 11:52:30 UTC 2023 Modified Files: src/usr.bin/make: make.h Log Message: make: remove redundant 'extern' from function declaration To generate a diff of this commit: cvs rdiff -u -r1.324 -r1.325 src/usr.bin/make/make.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/make/make.h diff -u src/usr.bin/make/make.h:1.324 src/usr.bin/make/make.h:1.325 --- src/usr.bin/make/make.h:1.324 Sat Jun 24 07:02:24 2023 +++ src/usr.bin/make/make.h Sun Sep 10 11:52:29 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: make.h,v 1.324 2023/06/24 07:02:24 rillig Exp $ */ +/* $NetBSD: make.h,v 1.325 2023/09/10 11:52:29 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -1193,7 +1193,7 @@ pp_skip_hspace(char **pp) #if defined(lint) void do_not_define_rcsid(void); /* for lint */ -# define MAKE_RCSID(id) extern void do_not_define_rcsid(void) +# define MAKE_RCSID(id) void do_not_define_rcsid(void) #elif defined(MAKE_NATIVE) # include # define MAKE_RCSID(id) __RCSID(id) @@ -1202,7 +1202,7 @@ void do_not_define_rcsid(void); /* for l # define MAKE_RCSID(id) static volatile char \ MAKE_RCSID_CONCAT(rcsid_, __COUNTER__)[] = id #elif defined(MAKE_ALL_IN_ONE) -# define MAKE_RCSID(id) extern void do_not_define_rcsid(void) +# define MAKE_RCSID(id) void do_not_define_rcsid(void) #else # define MAKE_RCSID(id) static volatile char rcsid[] = id #endif
CVS commit: src/usr.bin/make
Module Name:src Committed By: rillig Date: Sun Sep 10 11:41:33 UTC 2023 Modified Files: src/usr.bin/make: main.c src/usr.bin/make/unit-tests: opt-jobs.mk Log Message: make: add more details to usage message of -j option To generate a diff of this commit: cvs rdiff -u -r1.597 -r1.598 src/usr.bin/make/main.c cvs rdiff -u -r1.3 -r1.4 src/usr.bin/make/unit-tests/opt-jobs.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: Sun Sep 10 11:41:33 UTC 2023 Modified Files: src/usr.bin/make: main.c src/usr.bin/make/unit-tests: opt-jobs.mk Log Message: make: add more details to usage message of -j option To generate a diff of this commit: cvs rdiff -u -r1.597 -r1.598 src/usr.bin/make/main.c cvs rdiff -u -r1.3 -r1.4 src/usr.bin/make/unit-tests/opt-jobs.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/main.c diff -u src/usr.bin/make/main.c:1.597 src/usr.bin/make/main.c:1.598 --- src/usr.bin/make/main.c:1.597 Sun Sep 10 10:18:05 2023 +++ src/usr.bin/make/main.c Sun Sep 10 11:41:32 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.597 2023/09/10 10:18:05 rillig Exp $ */ +/* $NetBSD: main.c,v 1.598 2023/09/10 11:41:32 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -111,7 +111,7 @@ #include "trace.h" /* "@(#)main.c 8.3 (Berkeley) 3/19/94" */ -MAKE_RCSID("$NetBSD: main.c,v 1.597 2023/09/10 10:18:05 rillig Exp $"); +MAKE_RCSID("$NetBSD: main.c,v 1.598 2023/09/10 11:41:32 rillig Exp $"); #if defined(MAKE_NATIVE) && !defined(lint) __COPYRIGHT("@(#) Copyright (c) 1988, 1989, 1990, 1993 " "The Regents of the University of California. " @@ -424,8 +424,9 @@ MainParseArgJobs(const char *arg) #endif if (*p != '\0' || opts.maxJobs < 1) { (void)fprintf(stderr, - "%s: illegal argument to -j -- must be positive integer!\n", - progname); + "%s: argument '%s' to option '-j' " + "must be a positive number\n", + progname, arg); exit(2); /* Not 1 so -q can distinguish error */ } snprintf(v, sizeof(v), "%d", opts.maxJobs); Index: src/usr.bin/make/unit-tests/opt-jobs.mk diff -u src/usr.bin/make/unit-tests/opt-jobs.mk:1.3 src/usr.bin/make/unit-tests/opt-jobs.mk:1.4 --- src/usr.bin/make/unit-tests/opt-jobs.mk:1.3 Sun Sep 10 11:00:55 2023 +++ src/usr.bin/make/unit-tests/opt-jobs.mk Sun Sep 10 11:41:33 2023 @@ -1,22 +1,23 @@ -# $NetBSD: opt-jobs.mk,v 1.3 2023/09/10 11:00:55 rillig Exp $ +# $NetBSD: opt-jobs.mk,v 1.4 2023/09/10 11:41:33 rillig Exp $ # # Tests for the -j command line option, which creates the targets in parallel. # The option '-j ' specifies the number of targets that can be made # in parallel. -ARGS= 0 1 2 8 08 0x10 -5 1000 -EXPECT.0= illegal argument to -j -- must be positive integer! exit 2 +ARGS= 0 1 2 8 08 017 0x10 -5 1000 +EXPECT.0= argument '0' to option '-j' must be a positive number (exit 2) EXPECT.1= 1 EXPECT.2= 2 EXPECT.8= 8 -EXPECT.08= illegal argument to -j -- must be positive integer! exit 2 +EXPECT.08= argument '08' to option '-j' must be a positive number (exit 2) +EXPECT.017= 15 EXPECT.0x10= 16 -EXPECT.-5= illegal argument to -j -- must be positive integer! exit 2 +EXPECT.-5= argument '-5' to option '-j' must be a positive number (exit 2) EXPECT.1000= 1000 .for arg in ${ARGS} -OUTPUT!= ${MAKE} -r -f /dev/null -j ${arg} -v .MAKE.JOBS 2>&1 || echo exit $$? +OUTPUT!= ${MAKE} -r -f /dev/null -j ${arg} -v .MAKE.JOBS 2>&1 || echo "(exit $$?)" . if ${OUTPUT:[2..-1]} != ${EXPECT.${arg}} . warning ${arg}:${.newline}have: ${OUTPUT:[2..-1]}${.newline}want: ${EXPECT.${arg}} . endif @@ -25,20 +26,22 @@ OUTPUT!= ${MAKE} -r -f /dev/null -j ${ar # The options '-j ' and '-j C' multiply the given number with # the number of available CPUs. -ARGS= 0.0 .5 .5C 1C 1CPUs 1.2 .5e1C 07.5C 08.5C -EXPECT.0.0= illegal argument to -j -- must be positive integer! exit 2 -EXPECT..5= # rounded up to 1 if necessary -EXPECT..5C= # rounded up to 1 if necessary +ARGS= 0.0 0C 0.0C .1 .1C 1C 1CPUs 1.2 .5e1C 07.5C 08.5C +EXPECT.0.0= argument '0.0' to option '-j' must be a positive number (exit 2) +EXPECT.0C= # rounded up to 1C +EXPECT.0.0C= argument '0.0C' to option '-j' must be a positive number (exit 2) +EXPECT..1= argument '.1' to option '-j' must be a positive number (exit 2) +EXPECT..1C= argument '.1C' to option '-j' must be a positive number (exit 2) EXPECT.1C= EXPECT.1CPUs= EXPECT.1.2= EXPECT..5e1C= # unlikely to occur in practice EXPECT.07.5C= -EXPECT.08.5C= illegal argument to -j -- must be positive integer! exit 2 +EXPECT.08.5C= argument '08.5C' to option '-j' must be a positive number (exit 2) .if ${.MAKE.JOBS.C} . for arg in ${ARGS} -OUTPUT!= ${MAKE} -r -f /dev/null -j ${arg} -v .MAKE.JOBS 2>&1 || echo exit $$? +OUTPUT!= ${MAKE} -r -f /dev/null -j ${arg} -v .MAKE.JOBS 2>&1 || echo "(exit $$?)" .if ${OUTPUT:C,^[0-9]+$,numeric,W} == numeric OUTPUT= .endif
CVS commit: src/sys/arch/hpcmips/dev
Module Name:src Committed By: andvar Date: Sun Sep 10 11:30:13 UTC 2023 Modified Files: src/sys/arch/hpcmips/dev: plumicu.c Log Message: PLUM2 icu debug code uses dbg_bit_print, defined in hpcmips debug.h header file. Thus rewrote code to use DPRINTF definition from it and include the header. Fixes PLUMICUDEBUG enabled build. To generate a diff of this commit: cvs rdiff -u -r1.12 -r1.13 src/sys/arch/hpcmips/dev/plumicu.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/hpcmips/dev/plumicu.c diff -u src/sys/arch/hpcmips/dev/plumicu.c:1.12 src/sys/arch/hpcmips/dev/plumicu.c:1.13 --- src/sys/arch/hpcmips/dev/plumicu.c:1.12 Sat Oct 27 17:17:52 2012 +++ src/sys/arch/hpcmips/dev/plumicu.c Sun Sep 10 11:30:13 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: plumicu.c,v 1.12 2012/10/27 17:17:52 chs Exp $ */ +/* $NetBSD: plumicu.c,v 1.13 2023/09/10 11:30:13 andvar Exp $ */ /*- * Copyright (c) 1999, 2000 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: plumicu.c,v 1.12 2012/10/27 17:17:52 chs Exp $"); +__KERNEL_RCSID(0, "$NetBSD: plumicu.c,v 1.13 2023/09/10 11:30:13 andvar Exp $"); #include #include @@ -45,10 +45,10 @@ __KERNEL_RCSID(0, "$NetBSD: plumicu.c,v #include #ifdef PLUMICUDEBUG -#define DPRINTF(arg) printf arg -#else -#define DPRINTF(arg) +#define DPRINTF_ENABLE +#define DPRINTF_DEBUG plumicu_debug #endif +#include int plumicu_match(device_t, cfdata_t, void *); void plumicu_attach(device_t, device_t, void *); @@ -271,8 +271,8 @@ plum_intr_establish(plum_chipset_tag_t p } /* Enable redirect to TX39 core */ - DPRINTF(("plum_intr_establish: %d (count=%d)\n", line, - sc->sc_enable_count)); + DPRINTF("plum_intr_establish: %d (count=%d)\n", line, + sc->sc_enable_count); if (sc->sc_enable_count++ == 0) plum_ei(pc); @@ -298,8 +298,8 @@ plum_intr_disestablish(plum_chipset_tag_ pi = >sc_intr[i]; if (pi->pi_fun != arg) continue; - DPRINTF(("plum_intr_disestablish: %d (count=%d)\n", - pi->pi_line, sc->sc_enable_count - 1)); + DPRINTF("plum_intr_disestablish: %d (count=%d)\n", + pi->pi_line, sc->sc_enable_count - 1); goto found; } panic("plum_intr_disestablish: can't find entry.");
CVS commit: src/sys/arch/hpcmips/dev
Module Name:src Committed By: andvar Date: Sun Sep 10 11:30:13 UTC 2023 Modified Files: src/sys/arch/hpcmips/dev: plumicu.c Log Message: PLUM2 icu debug code uses dbg_bit_print, defined in hpcmips debug.h header file. Thus rewrote code to use DPRINTF definition from it and include the header. Fixes PLUMICUDEBUG enabled build. To generate a diff of this commit: cvs rdiff -u -r1.12 -r1.13 src/sys/arch/hpcmips/dev/plumicu.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: Sun Sep 10 11:00:55 UTC 2023 Modified Files: src/usr.bin/make/unit-tests: opt-jobs.mk Log Message: tests/make: add tests for parsing the -j option To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/usr.bin/make/unit-tests/opt-jobs.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/opt-jobs.mk diff -u src/usr.bin/make/unit-tests/opt-jobs.mk:1.2 src/usr.bin/make/unit-tests/opt-jobs.mk:1.3 --- src/usr.bin/make/unit-tests/opt-jobs.mk:1.2 Sun Aug 16 14:25:16 2020 +++ src/usr.bin/make/unit-tests/opt-jobs.mk Sun Sep 10 11:00:55 2023 @@ -1,8 +1,51 @@ -# $NetBSD: opt-jobs.mk,v 1.2 2020/08/16 14:25:16 rillig Exp $ +# $NetBSD: opt-jobs.mk,v 1.3 2023/09/10 11:00:55 rillig Exp $ # -# Tests for the -j command line option. +# Tests for the -j command line option, which creates the targets in parallel. -# TODO: Implementation -all: - @:; +# The option '-j ' specifies the number of targets that can be made +# in parallel. +ARGS= 0 1 2 8 08 0x10 -5 1000 +EXPECT.0= illegal argument to -j -- must be positive integer! exit 2 +EXPECT.1= 1 +EXPECT.2= 2 +EXPECT.8= 8 +EXPECT.08= illegal argument to -j -- must be positive integer! exit 2 +EXPECT.0x10= 16 +EXPECT.-5= illegal argument to -j -- must be positive integer! exit 2 +EXPECT.1000= 1000 + +.for arg in ${ARGS} +OUTPUT!= ${MAKE} -r -f /dev/null -j ${arg} -v .MAKE.JOBS 2>&1 || echo exit $$? +. if ${OUTPUT:[2..-1]} != ${EXPECT.${arg}} +. warning ${arg}:${.newline}have: ${OUTPUT:[2..-1]}${.newline}want: ${EXPECT.${arg}} +. endif +.endfor + + +# The options '-j ' and '-j C' multiply the given number with +# the number of available CPUs. +ARGS= 0.0 .5 .5C 1C 1CPUs 1.2 .5e1C 07.5C 08.5C +EXPECT.0.0= illegal argument to -j -- must be positive integer! exit 2 +EXPECT..5= # rounded up to 1 if necessary +EXPECT..5C= # rounded up to 1 if necessary +EXPECT.1C= +EXPECT.1CPUs= +EXPECT.1.2= +EXPECT..5e1C= # unlikely to occur in practice +EXPECT.07.5C= +EXPECT.08.5C= illegal argument to -j -- must be positive integer! exit 2 + +.if ${.MAKE.JOBS.C} +. for arg in ${ARGS} +OUTPUT!= ${MAKE} -r -f /dev/null -j ${arg} -v .MAKE.JOBS 2>&1 || echo exit $$? +.if ${OUTPUT:C,^[0-9]+$,numeric,W} == numeric +OUTPUT= +.endif +.if ${OUTPUT:[2..-1]} != ${EXPECT.${arg}} +. warning ${arg}:${.newline}have: ${OUTPUT:[2..-1]}${.newline}want: ${EXPECT.${arg}} +.endif +. endfor +.endif + +all: .PHONY
CVS commit: src/usr.bin/make/unit-tests
Module Name:src Committed By: rillig Date: Sun Sep 10 11:00:55 UTC 2023 Modified Files: src/usr.bin/make/unit-tests: opt-jobs.mk Log Message: tests/make: add tests for parsing the -j option To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/usr.bin/make/unit-tests/opt-jobs.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: Sun Sep 10 10:18:05 UTC 2023 Modified Files: src/usr.bin/make: main.c Log Message: make: fix lint warning about strchr main.c(416): warning: call to 'strchr' effectively discards 'const' from argument [346] Even though C23 turns strchr into a const-generic function, it doesn't do the same for strtol, so use separate pointers for the current parsing position and the end of a number, as their constness differs. To generate a diff of this commit: cvs rdiff -u -r1.596 -r1.597 src/usr.bin/make/main.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/make/main.c diff -u src/usr.bin/make/main.c:1.596 src/usr.bin/make/main.c:1.597 --- src/usr.bin/make/main.c:1.596 Sat Sep 9 16:41:04 2023 +++ src/usr.bin/make/main.c Sun Sep 10 10:18:05 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.596 2023/09/09 16:41:04 sjg Exp $ */ +/* $NetBSD: main.c,v 1.597 2023/09/10 10:18:05 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -111,7 +111,7 @@ #include "trace.h" /* "@(#)main.c 8.3 (Berkeley) 3/19/94" */ -MAKE_RCSID("$NetBSD: main.c,v 1.596 2023/09/09 16:41:04 sjg Exp $"); +MAKE_RCSID("$NetBSD: main.c,v 1.597 2023/09/10 10:18:05 rillig Exp $"); #if defined(MAKE_NATIVE) && !defined(lint) __COPYRIGHT("@(#) Copyright (c) 1988, 1989, 1990, 1993 " "The Regents of the University of California. " @@ -395,13 +395,15 @@ MainParseArgJobsInternal(const char *arg } static void -MainParseArgJobs(const char *argvalue) +MainParseArgJobs(const char *arg) { - char *p; + const char *p; + char *end; char v[12]; forceJobs = true; - opts.maxJobs = (int)strtol(argvalue, , 0); + opts.maxJobs = (int)strtol(arg, , 0); + p = arg + (end - arg); #ifdef _SC_NPROCESSORS_ONLN if (*p != '\0') { double d; @@ -409,11 +411,12 @@ MainParseArgJobs(const char *argvalue) if (*p == 'C') { d = (opts.maxJobs > 0) ? opts.maxJobs : 1; } else if (*p == '.') { - d = strtod(argvalue, ); + d = strtod(arg, ); + p = arg + (end - arg); } else d = 0; if (d > 0) { - p = strchr(argvalue, 0); + p = ""; opts.maxJobs = (int)sysconf(_SC_NPROCESSORS_ONLN); opts.maxJobs = (int)(d * (double)opts.maxJobs); }
CVS commit: src/usr.bin/make
Module Name:src Committed By: rillig Date: Sun Sep 10 10:18:05 UTC 2023 Modified Files: src/usr.bin/make: main.c Log Message: make: fix lint warning about strchr main.c(416): warning: call to 'strchr' effectively discards 'const' from argument [346] Even though C23 turns strchr into a const-generic function, it doesn't do the same for strtol, so use separate pointers for the current parsing position and the end of a number, as their constness differs. To generate a diff of this commit: cvs rdiff -u -r1.596 -r1.597 src/usr.bin/make/main.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Re: CVS commit: src/usr.bin/make
On Fri, Sep 8, 2023 at 21:38 matthew green wrote: > Module Name:src > Committed By: mrg > Date: Sat Sep 9 04:38:49 UTC 2023 > > Modified Files: > src/usr.bin/make: main.c > > Log Message: > add explicit cast for long -> int truncation warning-as-error. > > as this is number of CPUs, i don't think we have to care about > it for a long, long, *long* time... Pun intended? > > > To generate a diff of this commit: > cvs rdiff -u -r1.594 -r1.595 src/usr.bin/make/main.c > > Please note that diffs are not public domain; they are subject to the > copyright notices on the relevant files. > >