CVS commit: src/usr.bin/make/unit-tests
Module Name:src Committed By: rillig Date: Tue Dec 22 07:22:39 UTC 2020 Modified Files: src/usr.bin/make/unit-tests: varmod-gmtime.mk varmod-localtime.mk Log Message: make(1): fix commit number in tests for :gmtime and :localtime To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/usr.bin/make/unit-tests/varmod-gmtime.mk cvs rdiff -u -r1.6 -r1.7 src/usr.bin/make/unit-tests/varmod-localtime.mk Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/make/unit-tests/varmod-gmtime.mk diff -u src/usr.bin/make/unit-tests/varmod-gmtime.mk:1.8 src/usr.bin/make/unit-tests/varmod-gmtime.mk:1.9 --- src/usr.bin/make/unit-tests/varmod-gmtime.mk:1.8 Mon Dec 21 20:47:29 2020 +++ src/usr.bin/make/unit-tests/varmod-gmtime.mk Tue Dec 22 07:22:39 2020 @@ -1,4 +1,4 @@ -# $NetBSD: varmod-gmtime.mk,v 1.8 2020/12/21 20:47:29 rillig Exp $ +# $NetBSD: varmod-gmtime.mk,v 1.9 2020/12/22 07:22:39 rillig Exp $ # # Tests for the :gmtime variable modifier, which formats a timestamp # using strftime(3) in UTC. @@ -114,14 +114,14 @@ # ULONG_MAX, which got converted to -1. This resulted in a time stamp of # the second before 1970. # -# Since var.c 1.613, the overflow is detected and produces a parse error. +# Since var.c 1.631, the overflow is detected and produces a parse error. .if ${:L:gmtime=1000} != "" . error .else . error .endif -# Before var.c 1.613 from 2020-10-31, there was no error handling while +# Before var.c 1.631 from 2020-10-31, there was no error handling while # parsing the :gmtime modifier, thus no error message is printed. Parsing # stopped after the '=', and the remaining string was parsed for more variable # modifiers. Because of the unknown modifier 'e' from the 'error', the whole Index: src/usr.bin/make/unit-tests/varmod-localtime.mk diff -u src/usr.bin/make/unit-tests/varmod-localtime.mk:1.6 src/usr.bin/make/unit-tests/varmod-localtime.mk:1.7 --- src/usr.bin/make/unit-tests/varmod-localtime.mk:1.6 Mon Dec 21 20:47:29 2020 +++ src/usr.bin/make/unit-tests/varmod-localtime.mk Tue Dec 22 07:22:39 2020 @@ -1,4 +1,4 @@ -# $NetBSD: varmod-localtime.mk,v 1.6 2020/12/21 20:47:29 rillig Exp $ +# $NetBSD: varmod-localtime.mk,v 1.7 2020/12/22 07:22:39 rillig Exp $ # # Tests for the :localtime variable modifier, which formats a timestamp # using strftime(3) in local time. @@ -114,14 +114,14 @@ # ULONG_MAX, which got converted to -1. This resulted in a time stamp of # the second before 1970. # -# Since var.c 1.613, the overflow is detected and produces a parse error. +# Since var.c 1.631, the overflow is detected and produces a parse error. .if ${:L:localtime=1000} != "" . error .else . error .endif -# Before var.c 1.613 from 2020-10-31, there was no error handling while +# Before var.c 1.631 from 2020-10-31, there was no error handling while # parsing the :localtime modifier, thus no error message is printed. Parsing # stopped after the '=', and the remaining string was parsed for more variable # modifiers. Because of the unknown modifier 'e' from the 'error', the whole
CVS commit: src/sys/dev/pci/ixgbe
Module Name:src Committed By: msaitoh Date: Tue Dec 22 07:16:23 UTC 2020 Modified Files: src/sys/dev/pci/ixgbe: ixgbe.c Log Message: Correctly ACK the fan failure interrupt in ixgbe_legacy_irq(). To generate a diff of this commit: cvs rdiff -u -r1.262 -r1.263 src/sys/dev/pci/ixgbe/ixgbe.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/pci/ixgbe/ixgbe.c diff -u src/sys/dev/pci/ixgbe/ixgbe.c:1.262 src/sys/dev/pci/ixgbe/ixgbe.c:1.263 --- src/sys/dev/pci/ixgbe/ixgbe.c:1.262 Fri Dec 11 05:01:19 2020 +++ src/sys/dev/pci/ixgbe/ixgbe.c Tue Dec 22 07:16:23 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: ixgbe.c,v 1.262 2020/12/11 05:01:19 msaitoh Exp $ */ +/* $NetBSD: ixgbe.c,v 1.263 2020/12/22 07:16:23 msaitoh Exp $ */ /** @@ -5211,7 +5211,7 @@ ixgbe_legacy_irq(void *arg) /* Check for fan failure */ if (adapter->feat_en & IXGBE_FEATURE_FAN_FAIL) { ixgbe_check_fan_failure(adapter, eicr, true); - IXGBE_WRITE_REG(hw, IXGBE_EIMS, IXGBE_EICR_GPI_SDP1_BY_MAC(hw)); + IXGBE_WRITE_REG(hw, IXGBE_EICR, IXGBE_EICR_GPI_SDP1_BY_MAC(hw)); } if (ixgbe_is_sfp(hw)) {
CVS commit: src/usr.bin/make
Module Name:src Committed By: rillig Date: Tue Dec 22 06:48:33 UTC 2020 Modified Files: src/usr.bin/make: parse.c Log Message: make(1): prevent undefined behavior in loadfile_mmap Reading a file without a trailing newline had resulted in an out-of-bounds write, in the common case where the file is loaded via mmap. To generate a diff of this commit: cvs rdiff -u -r1.509 -r1.510 src/usr.bin/make/parse.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/make/parse.c diff -u src/usr.bin/make/parse.c:1.509 src/usr.bin/make/parse.c:1.510 --- src/usr.bin/make/parse.c:1.509 Mon Dec 21 02:09:34 2020 +++ src/usr.bin/make/parse.c Tue Dec 22 06:48:33 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: parse.c,v 1.509 2020/12/21 02:09:34 rillig Exp $ */ +/* $NetBSD: parse.c,v 1.510 2020/12/22 06:48:33 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -117,7 +117,7 @@ #include "pathnames.h" /* "@(#)parse.c 8.3 (Berkeley) 3/19/94" */ -MAKE_RCSID("$NetBSD: parse.c,v 1.509 2020/12/21 02:09:34 rillig Exp $"); +MAKE_RCSID("$NetBSD: parse.c,v 1.510 2020/12/22 06:48:33 rillig Exp $"); /* types and constants */ @@ -2687,10 +2687,22 @@ ParseRawLine(IFile *curFile, char **out_ if (ch == '\\') { if (firstBackslash == NULL) firstBackslash = p; + /* + * FIXME: In opt-file.mk, this command succeeds: + * printf '%s' 'V=v\' | make -r -f - + * Using an intermediate file fails though: + * printf '%s' 'V=v\' > backslash + * make -r -f backslash + * + * In loadedfile_mmap, the trailing newline is not + * added in every case, only if the file ends at a + * page boundary. + */ if (p[1] == '\n') curFile->lineno++; p += 2; line_end = p; + assert(p <= curFile->buf_end); continue; } @@ -2831,6 +2843,12 @@ ParseGetLine(GetLineMode mode) } /* We now have a line of data */ + /* + * FIXME: undefined behavior since line_end points right + * after the allocated buffer. This becomes apparent when + * using a strict malloc implementation that adds canaries + * before and after the allocated space. + */ *line_end = '\0'; if (mode == GLM_FOR_BODY)
CVS commit: src/sys/sys
Module Name:src Committed By: ad Date: Tue Dec 22 01:58:58 UTC 2020 Modified Files: src/sys/sys: lock.h Log Message: Nothing here came from UCB, it's all NetBSD. To generate a diff of this commit: cvs rdiff -u -r1.90 -r1.91 src/sys/sys/lock.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/lock.h diff -u src/sys/sys/lock.h:1.90 src/sys/sys/lock.h:1.91 --- src/sys/sys/lock.h:1.90 Mon Jul 6 22:32:22 2020 +++ src/sys/sys/lock.h Tue Dec 22 01:58:58 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: lock.h,v 1.90 2020/07/06 22:32:22 rin Exp $ */ +/* $NetBSD: lock.h,v 1.91 2020/12/22 01:58:58 ad Exp $ */ /*- * Copyright (c) 1999, 2000, 2006, 2007 The NetBSD Foundation, Inc. @@ -30,41 +30,6 @@ * POSSIBILITY OF SUCH DAMAGE. */ -/* - * Copyright (c) 1995 - * The Regents of the University of California. All rights reserved. - * - * This code contains ideas from software contributed to Berkeley by - * Avadis Tevanian, Jr., Michael Wayne Young, and the Mach Operating - * System project at Carnegie-Mellon University. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - *notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - *notice, this list of conditions and the following disclaimer in the - *documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - *may be used to endorse or promote products derived from this software - *without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * @(#)lock.h 8.12 (Berkeley) 5/19/95 - */ - #ifndef _SYS_LOCK_H_ #define _SYS_LOCK_H_
CVS commit: src/sys/kern
Module Name:src Committed By: ad Date: Tue Dec 22 01:57:29 UTC 2020 Modified Files: src/sys/kern: kern_lock.c subr_xcall.c Log Message: Comments. To generate a diff of this commit: cvs rdiff -u -r1.171 -r1.172 src/sys/kern/kern_lock.c cvs rdiff -u -r1.33 -r1.34 src/sys/kern/subr_xcall.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_lock.c diff -u src/sys/kern/kern_lock.c:1.171 src/sys/kern/kern_lock.c:1.172 --- src/sys/kern/kern_lock.c:1.171 Sat May 2 09:13:40 2020 +++ src/sys/kern/kern_lock.c Tue Dec 22 01:57:29 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: kern_lock.c,v 1.171 2020/05/02 09:13:40 martin Exp $ */ +/* $NetBSD: kern_lock.c,v 1.172 2020/12/22 01:57:29 ad Exp $ */ /*- * Copyright (c) 2002, 2006, 2007, 2008, 2009, 2020 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: kern_lock.c,v 1.171 2020/05/02 09:13:40 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_lock.c,v 1.172 2020/12/22 01:57:29 ad Exp $"); #ifdef _KERNEL_OPT #include "opt_lockdebug.h" @@ -215,10 +215,6 @@ _kernel_lock(int nlocks) * is required to ensure that the result of any mutex_exit() * by the current LWP becomes visible on the bus before the set * of ci->ci_biglock_wanted becomes visible. - * - * However, we won't set ci_biglock_wanted until we've spun for - * a bit, as we don't want to make any lock waiters in rw_oncpu() - * or mutex_oncpu() block prematurely. */ membar_producer(); owant = ci->ci_biglock_wanted; Index: src/sys/kern/subr_xcall.c diff -u src/sys/kern/subr_xcall.c:1.33 src/sys/kern/subr_xcall.c:1.34 --- src/sys/kern/subr_xcall.c:1.33 Thu Dec 19 10:51:54 2019 +++ src/sys/kern/subr_xcall.c Tue Dec 22 01:57:29 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: subr_xcall.c,v 1.33 2019/12/19 10:51:54 thorpej Exp $ */ +/* $NetBSD: subr_xcall.c,v 1.34 2020/12/22 01:57:29 ad Exp $ */ /*- * Copyright (c) 2007-2010, 2019 The NetBSD Foundation, Inc. @@ -48,12 +48,12 @@ * prohibitive, another way must be found. * * Cross calls help to solve these types of problem by allowing - * any CPU in the system to request that an arbitrary function be - * executed on any other CPU. + * any LWP in the system to request that an arbitrary function be + * executed on a specific CPU. * * Implementation * - * A slow mechanism for making 'low priority' cross calls is + * A slow mechanism for making low priority cross calls is * provided. The function to be executed runs on the remote CPU * within a bound kthread. No queueing is provided, and the * implementation uses global state. The function being called may @@ -64,17 +64,17 @@ * CPU, and so has exclusive access to the CPU. Since this facility * is heavyweight, it's expected that it will not be used often. * - * Cross calls must not allocate memory, as the pagedaemon uses - * them (and memory allocation may need to wait on the pagedaemon). + * Cross calls must not allocate memory, as the pagedaemon uses cross + * calls (and memory allocation may need to wait on the pagedaemon). * * A low-overhead mechanism for high priority calls (XC_HIGHPRI) is - * also provided. The function to be executed runs on a software - * interrupt context, at IPL_SOFTSERIAL level, and is expected to + * also provided. The function to be executed runs in software + * interrupt context at IPL_SOFTSERIAL level, and is expected to * be very lightweight, e.g. avoid blocking. */ #include -__KERNEL_RCSID(0, "$NetBSD: subr_xcall.c,v 1.33 2019/12/19 10:51:54 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: subr_xcall.c,v 1.34 2020/12/22 01:57:29 ad Exp $"); #include #include
CVS commit: src/sys
Module Name:src Committed By: riastradh Date: Tue Dec 22 01:07:23 UTC 2020 Modified Files: src/sys/dev/usb: ehci.c ohci.c uhci.c xhci.c src/sys/external/bsd/dwc2: dwc2.c Log Message: usb: Omit bogus assertions about struct usbd_pipe::up_intrxfer. These assertions were only valid for pipes at UE_IN_DIR, UE_INTERRUPT endpoints created with usbd_open_pipe_intr, which uses up_intrxfer to pass the struct usbd_xfer object to usbd_close_pipe to free later. In contrast, for pipes at UE_OUT_DIR, UE_INTERRUPT endpoints, up_intrxfer is never initialized, so the assertion cannot be right. In principle we might even have more than one outstanding interrupt transfer at a time, rendering the point of the assertion moot anyway. Found by interrupting a uhidev write to a u2f device. ok nick To generate a diff of this commit: cvs rdiff -u -r1.283 -r1.284 src/sys/dev/usb/ehci.c cvs rdiff -u -r1.313 -r1.314 src/sys/dev/usb/ohci.c cvs rdiff -u -r1.304 -r1.305 src/sys/dev/usb/uhci.c cvs rdiff -u -r1.135 -r1.136 src/sys/dev/usb/xhci.c cvs rdiff -u -r1.74 -r1.75 src/sys/external/bsd/dwc2/dwc2.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/usb/ehci.c diff -u src/sys/dev/usb/ehci.c:1.283 src/sys/dev/usb/ehci.c:1.284 --- src/sys/dev/usb/ehci.c:1.283 Mon Nov 30 05:33:32 2020 +++ src/sys/dev/usb/ehci.c Tue Dec 22 01:07:23 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: ehci.c,v 1.283 2020/11/30 05:33:32 msaitoh Exp $ */ +/* $NetBSD: ehci.c,v 1.284 2020/12/22 01:07:23 riastradh Exp $ */ /* * Copyright (c) 2004-2012,2016,2020 The NetBSD Foundation, Inc. @@ -54,7 +54,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.283 2020/11/30 05:33:32 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.284 2020/12/22 01:07:23 riastradh Exp $"); #include "ohci.h" #include "uhci.h" @@ -4138,7 +4138,6 @@ ehci_device_intr_abort(struct usbd_xfer EHCIHIST_FUNC(); EHCIHIST_CALLED(); DPRINTF("xfer=%#jx", (uintptr_t)xfer, 0, 0, 0); - KASSERT(xfer->ux_pipe->up_intrxfer == xfer); /* * XXX - abort_xfer uses ehci_sync_hc, which syncs via the advance Index: src/sys/dev/usb/ohci.c diff -u src/sys/dev/usb/ohci.c:1.313 src/sys/dev/usb/ohci.c:1.314 --- src/sys/dev/usb/ohci.c:1.313 Thu Dec 10 20:50:24 2020 +++ src/sys/dev/usb/ohci.c Tue Dec 22 01:07:23 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: ohci.c,v 1.313 2020/12/10 20:50:24 skrll Exp $ */ +/* $NetBSD: ohci.c,v 1.314 2020/12/22 01:07:23 riastradh Exp $ */ /* * Copyright (c) 1998, 2004, 2005, 2012, 2016, 2020 The NetBSD Foundation, Inc. @@ -42,7 +42,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ohci.c,v 1.313 2020/12/10 20:50:24 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ohci.c,v 1.314 2020/12/22 01:07:23 riastradh Exp $"); #ifdef _KERNEL_OPT #include "opt_usb.h" @@ -3384,7 +3384,6 @@ ohci_device_intr_abort(struct usbd_xfer ohci_softc_t *sc __diagused = OHCI_XFER2SC(xfer); KASSERT(mutex_owned(>sc_lock)); - KASSERT(xfer->ux_pipe->up_intrxfer == xfer); usbd_xfer_abort(xfer); } Index: src/sys/dev/usb/uhci.c diff -u src/sys/dev/usb/uhci.c:1.304 src/sys/dev/usb/uhci.c:1.305 --- src/sys/dev/usb/uhci.c:1.304 Tue Jul 7 10:02:17 2020 +++ src/sys/dev/usb/uhci.c Tue Dec 22 01:07:23 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: uhci.c,v 1.304 2020/07/07 10:02:17 skrll Exp $ */ +/* $NetBSD: uhci.c,v 1.305 2020/12/22 01:07:23 riastradh Exp $ */ /* * Copyright (c) 1998, 2004, 2011, 2012, 2016, 2020 The NetBSD Foundation, Inc. @@ -42,7 +42,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: uhci.c,v 1.304 2020/07/07 10:02:17 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: uhci.c,v 1.305 2020/12/22 01:07:23 riastradh Exp $"); #ifdef _KERNEL_OPT #include "opt_usb.h" @@ -2836,7 +2836,6 @@ uhci_device_intr_abort(struct usbd_xfer uhci_softc_t *sc __diagused = UHCI_XFER2SC(xfer); KASSERT(mutex_owned(>sc_lock)); - KASSERT(xfer->ux_pipe->up_intrxfer == xfer); UHCIHIST_FUNC(); UHCIHIST_CALLED(); DPRINTF("xfer=%#jx", (uintptr_t)xfer, 0, 0, 0); Index: src/sys/dev/usb/xhci.c diff -u src/sys/dev/usb/xhci.c:1.135 src/sys/dev/usb/xhci.c:1.136 --- src/sys/dev/usb/xhci.c:1.135 Thu Oct 15 09:37:40 2020 +++ src/sys/dev/usb/xhci.c Tue Dec 22 01:07:23 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: xhci.c,v 1.135 2020/10/15 09:37:40 jmcneill Exp $ */ +/* $NetBSD: xhci.c,v 1.136 2020/12/22 01:07:23 riastradh Exp $ */ /* * Copyright (c) 2013 Jonathan A. Kollasch @@ -34,7 +34,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: xhci.c,v 1.135 2020/10/15 09:37:40 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: xhci.c,v 1.136 2020/12/22 01:07:23 riastradh Exp $"); #ifdef _KERNEL_OPT #include "opt_usb.h" @@ -4412,7 +4412,6 @@ xhci_device_intr_abort(struct usbd_xfer XHCIHIST_CALLARGS("%#jx", (uintptr_t)xfer, 0, 0, 0); KASSERT(mutex_owned(>sc_lock)); - KASSERT(xfer->ux_pipe->up_intrxfer == xfer); usbd_xfer_abort(xfer); } Index:
CVS commit: src/usr.bin/make
Module Name:src Committed By: rillig Date: Mon Dec 21 21:04:18 UTC 2020 Modified Files: src/usr.bin/make: var.c src/usr.bin/make/unit-tests: varmod-gmtime.exp varmod-localtime.exp varmod-range.exp varmod-to-separator.exp Log Message: make(1): remove excess newline from parse errors (since 2020-11-01) For the modifiers :gmtime and :localtime, the excess newline had been added in var.c 1.631 from 2020-10-31 21:40:20. For the modifiers :range and :ts, the excess newline had been added in var.c 1.635 from 2020-11-01 14:36:25. To generate a diff of this commit: cvs rdiff -u -r1.760 -r1.761 src/usr.bin/make/var.c cvs rdiff -u -r1.9 -r1.10 src/usr.bin/make/unit-tests/varmod-gmtime.exp cvs rdiff -u -r1.6 -r1.7 src/usr.bin/make/unit-tests/varmod-localtime.exp \ src/usr.bin/make/unit-tests/varmod-range.exp cvs rdiff -u -r1.5 -r1.6 src/usr.bin/make/unit-tests/varmod-to-separator.exp Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/make/var.c diff -u src/usr.bin/make/var.c:1.760 src/usr.bin/make/var.c:1.761 --- src/usr.bin/make/var.c:1.760 Mon Dec 21 02:38:57 2020 +++ src/usr.bin/make/var.c Mon Dec 21 21:04:18 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: var.c,v 1.760 2020/12/21 02:38:57 rillig Exp $ */ +/* $NetBSD: var.c,v 1.761 2020/12/21 21:04:18 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -131,7 +131,7 @@ #include "metachar.h" /* "@(#)var.c 8.3 (Berkeley) 3/19/94" */ -MAKE_RCSID("$NetBSD: var.c,v 1.760 2020/12/21 02:38:57 rillig Exp $"); +MAKE_RCSID("$NetBSD: var.c,v 1.761 2020/12/21 21:04:18 rillig Exp $"); typedef enum VarFlags { VAR_NONE = 0, @@ -2349,7 +2349,7 @@ ApplyModifier_Gmtime(const char **pp, co const char *arg = mod + 7; if (!TryParseTime(, )) { Parse_Error(PARSE_FATAL, - "Invalid time value: %s\n", mod + 7); + "Invalid time value: %s", mod + 7); return AMR_CLEANUP; } *pp = arg; @@ -2376,7 +2376,7 @@ ApplyModifier_Localtime(const char **pp, const char *arg = mod + 10; if (!TryParseTime(, )) { Parse_Error(PARSE_FATAL, - "Invalid time value: %s\n", mod + 10); + "Invalid time value: %s", mod + 10); return AMR_CLEANUP; } *pp = arg; @@ -2469,7 +2469,7 @@ ApplyModifier_Range(const char **pp, con const char *p = mod + 6; if (!TryParseSize(, )) { Parse_Error(PARSE_FATAL, - "Invalid number: %s\n", mod + 6); + "Invalid number: %s", mod + 6); return AMR_CLEANUP; } *pp = p; @@ -2786,7 +2786,7 @@ ApplyModifier_ToSep(const char **pp, con if (!TryParseChar(, base, >sep)) { Parse_Error(PARSE_FATAL, - "Invalid character number: %s\n", p); + "Invalid character number: %s", p); return AMR_CLEANUP; } if (*p != ':' && *p != st->endc) { Index: src/usr.bin/make/unit-tests/varmod-gmtime.exp diff -u src/usr.bin/make/unit-tests/varmod-gmtime.exp:1.9 src/usr.bin/make/unit-tests/varmod-gmtime.exp:1.10 --- src/usr.bin/make/unit-tests/varmod-gmtime.exp:1.9 Mon Dec 21 20:47:29 2020 +++ src/usr.bin/make/unit-tests/varmod-gmtime.exp Mon Dec 21 21:04:18 2020 @@ -1,17 +1,12 @@ make: "varmod-gmtime.mk" line 60: Invalid time value: ${:U1593536400}} != "mtime=11593536400}" - make: "varmod-gmtime.mk" line 60: Malformed conditional (${%Y:L:gmtime=${:U1593536400}} != "mtime=11593536400}") make: "varmod-gmtime.mk" line 70: Invalid time value: -1} != "" - make: "varmod-gmtime.mk" line 70: Malformed conditional (${:L:gmtime=-1} != "") make: "varmod-gmtime.mk" line 79: Invalid time value: 1} != "" - make: "varmod-gmtime.mk" line 79: Malformed conditional (${:L:gmtime= 1} != "") make: "varmod-gmtime.mk" line 118: Invalid time value: 1000} != "" - make: "varmod-gmtime.mk" line 118: Malformed conditional (${:L:gmtime=1000} != "") make: "varmod-gmtime.mk" line 129: Invalid time value: error} != "" - make: "varmod-gmtime.mk" line 129: Malformed conditional (${:L:gmtime=error} != "") make: Fatal errors encountered -- cannot continue make: stopped in unit-tests Index: src/usr.bin/make/unit-tests/varmod-localtime.exp diff -u src/usr.bin/make/unit-tests/varmod-localtime.exp:1.6 src/usr.bin/make/unit-tests/varmod-localtime.exp:1.7 --- src/usr.bin/make/unit-tests/varmod-localtime.exp:1.6 Mon Dec 21 20:47:29 2020 +++ src/usr.bin/make/unit-tests/varmod-localtime.exp Mon Dec 21 21:04:18 2020 @@ -1,17 +1,12 @@ make: "varmod-localtime.mk" line 60: Invalid time value: ${:U1593536400}} != "mtime=11593536400}" - make: "varmod-localtime.mk" line 60: Malformed conditional (${%Y:L:localtime=${:U1593536400}} != "mtime=11593536400}") make: "varmod-localtime.mk" line 70: Invalid time value: -1} != "" - make: "varmod-localtime.mk" line 70: Malformed conditional (${:L:localtime=-1} != "") make: "varmod-localtime.mk" line 79: Invalid time value: 1} != "" - make: "varmod-localtime.mk" line 79:
CVS commit: src/usr.bin/make/unit-tests
Module Name:src Committed By: rillig Date: Mon Dec 21 20:47:29 UTC 2020 Modified Files: src/usr.bin/make/unit-tests: Makefile varmod-gmtime.exp varmod-gmtime.mk varmod-localtime.exp varmod-localtime.mk Log Message: make(1): align tests for :localtime with those for :gmtime These tests had been almost the same before, now they are as similar as possible again. To generate a diff of this commit: cvs rdiff -u -r1.255 -r1.256 src/usr.bin/make/unit-tests/Makefile cvs rdiff -u -r1.8 -r1.9 src/usr.bin/make/unit-tests/varmod-gmtime.exp cvs rdiff -u -r1.7 -r1.8 src/usr.bin/make/unit-tests/varmod-gmtime.mk cvs rdiff -u -r1.5 -r1.6 src/usr.bin/make/unit-tests/varmod-localtime.exp \ src/usr.bin/make/unit-tests/varmod-localtime.mk Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/make/unit-tests/Makefile diff -u src/usr.bin/make/unit-tests/Makefile:1.255 src/usr.bin/make/unit-tests/Makefile:1.256 --- src/usr.bin/make/unit-tests/Makefile:1.255 Mon Dec 21 20:35:17 2020 +++ src/usr.bin/make/unit-tests/Makefile Mon Dec 21 20:47:29 2020 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.255 2020/12/21 20:35:17 rillig Exp $ +# $NetBSD: Makefile,v 1.256 2020/12/21 20:47:29 rillig Exp $ # # Unit tests for make(1) # @@ -503,9 +503,6 @@ SED_CMDS.var-op-shell+= \ -e 's,^${.SHELL:T}: [ 0-9:]*,,' \ -e '/command/s,No such.*,not found,' SED_CMDS.vardebug+= -e 's,${.SHELL},,' -SED_CMDS.varmod-localtime+= -e 's,Tue Jan 19 04:14:08 2038,,' -SED_CMDS.varmod-localtime+= ${:D FreeBSD i386 still has 32-bit time_t. } -SED_CMDS.varmod-localtime+= -e 's,Fri Dec 13 21:45:52 1901,,' SED_CMDS.varmod-subst-regex+= \ -e 's,\(Regex compilation error:\).*,\1 (details omitted),' SED_CMDS.varname-dot-parsedir= -e '/in some cases/ s,^make: "[^"]*,make: ",' Index: src/usr.bin/make/unit-tests/varmod-gmtime.exp diff -u src/usr.bin/make/unit-tests/varmod-gmtime.exp:1.8 src/usr.bin/make/unit-tests/varmod-gmtime.exp:1.9 --- src/usr.bin/make/unit-tests/varmod-gmtime.exp:1.8 Mon Dec 21 20:35:17 2020 +++ src/usr.bin/make/unit-tests/varmod-gmtime.exp Mon Dec 21 20:47:29 2020 @@ -1,18 +1,18 @@ -make: "varmod-gmtime.mk" line 57: Invalid time value: ${:U1593536400}} != "mtime=11593536400}" +make: "varmod-gmtime.mk" line 60: Invalid time value: ${:U1593536400}} != "mtime=11593536400}" -make: "varmod-gmtime.mk" line 57: Malformed conditional (${%Y:L:gmtime=${:U1593536400}} != "mtime=11593536400}") -make: "varmod-gmtime.mk" line 67: Invalid time value: -1} != "" +make: "varmod-gmtime.mk" line 60: Malformed conditional (${%Y:L:gmtime=${:U1593536400}} != "mtime=11593536400}") +make: "varmod-gmtime.mk" line 70: Invalid time value: -1} != "" -make: "varmod-gmtime.mk" line 67: Malformed conditional (${:L:gmtime=-1} != "") -make: "varmod-gmtime.mk" line 76: Invalid time value: 1} != "" +make: "varmod-gmtime.mk" line 70: Malformed conditional (${:L:gmtime=-1} != "") +make: "varmod-gmtime.mk" line 79: Invalid time value: 1} != "" -make: "varmod-gmtime.mk" line 76: Malformed conditional (${:L:gmtime= 1} != "") -make: "varmod-gmtime.mk" line 115: Invalid time value: 1000} != "" +make: "varmod-gmtime.mk" line 79: Malformed conditional (${:L:gmtime= 1} != "") +make: "varmod-gmtime.mk" line 118: Invalid time value: 1000} != "" -make: "varmod-gmtime.mk" line 115: Malformed conditional (${:L:gmtime=1000} != "") -make: "varmod-gmtime.mk" line 126: Invalid time value: error} != "" +make: "varmod-gmtime.mk" line 118: Malformed conditional (${:L:gmtime=1000} != "") +make: "varmod-gmtime.mk" line 129: Invalid time value: error} != "" -make: "varmod-gmtime.mk" line 126: Malformed conditional (${:L:gmtime=error} != "") +make: "varmod-gmtime.mk" line 129: Malformed conditional (${:L:gmtime=error} != "") make: Fatal errors encountered -- cannot continue make: stopped in unit-tests exit status 1 Index: src/usr.bin/make/unit-tests/varmod-gmtime.mk diff -u src/usr.bin/make/unit-tests/varmod-gmtime.mk:1.7 src/usr.bin/make/unit-tests/varmod-gmtime.mk:1.8 --- src/usr.bin/make/unit-tests/varmod-gmtime.mk:1.7 Mon Dec 21 20:35:17 2020 +++ src/usr.bin/make/unit-tests/varmod-gmtime.mk Mon Dec 21 20:47:29 2020 @@ -1,8 +1,11 @@ -# $NetBSD: varmod-gmtime.mk,v 1.7 2020/12/21 20:35:17 rillig Exp $ +# $NetBSD: varmod-gmtime.mk,v 1.8 2020/12/21 20:47:29 rillig Exp $ # # Tests for the :gmtime variable modifier, which formats a timestamp # using strftime(3) in UTC. +.if ${TZ:Uundefined} != "undefined" # see unit-tests/Makefile +. error +.endif # Test for the default time format, %c. Since the time always varies, it's # only possible to check for the general format here. The names of the Index: src/usr.bin/make/unit-tests/varmod-localtime.exp diff -u src/usr.bin/make/unit-tests/varmod-localtime.exp:1.5
CVS commit: src/usr.bin/make/unit-tests
Module Name:src Committed By: rillig Date: Mon Dec 21 20:35:17 UTC 2020 Modified Files: src/usr.bin/make/unit-tests: Makefile varmod-gmtime.exp varmod-gmtime.mk Log Message: make(1): move tests for :gmtime to parse time It's easier to have both the expressions and the expected values in a single file. This also allows for flexible handling of multiple acceptable outputs, in this case for 32-bit time_t. To generate a diff of this commit: cvs rdiff -u -r1.254 -r1.255 src/usr.bin/make/unit-tests/Makefile cvs rdiff -u -r1.7 -r1.8 src/usr.bin/make/unit-tests/varmod-gmtime.exp cvs rdiff -u -r1.6 -r1.7 src/usr.bin/make/unit-tests/varmod-gmtime.mk Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/make/unit-tests/Makefile diff -u src/usr.bin/make/unit-tests/Makefile:1.254 src/usr.bin/make/unit-tests/Makefile:1.255 --- src/usr.bin/make/unit-tests/Makefile:1.254 Mon Dec 21 18:22:31 2020 +++ src/usr.bin/make/unit-tests/Makefile Mon Dec 21 20:35:17 2020 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.254 2020/12/21 18:22:31 sjg Exp $ +# $NetBSD: Makefile,v 1.255 2020/12/21 20:35:17 rillig Exp $ # # Unit tests for make(1) # @@ -503,9 +503,6 @@ SED_CMDS.var-op-shell+= \ -e 's,^${.SHELL:T}: [ 0-9:]*,,' \ -e '/command/s,No such.*,not found,' SED_CMDS.vardebug+= -e 's,${.SHELL},,' -SED_CMDS.varmod-gmtime+= -e 's,Tue Jan 19 03:14:08 2038,,' -SED_CMDS.varmod-gmtime+= ${:D FreeBSD i386 still has 32-bit time_t. } -SED_CMDS.varmod-gmtime+= -e 's,Fri Dec 13 20:45:52 1901,,' SED_CMDS.varmod-localtime+= -e 's,Tue Jan 19 04:14:08 2038,,' SED_CMDS.varmod-localtime+= ${:D FreeBSD i386 still has 32-bit time_t. } SED_CMDS.varmod-localtime+= -e 's,Fri Dec 13 21:45:52 1901,,' Index: src/usr.bin/make/unit-tests/varmod-gmtime.exp diff -u src/usr.bin/make/unit-tests/varmod-gmtime.exp:1.7 src/usr.bin/make/unit-tests/varmod-gmtime.exp:1.8 --- src/usr.bin/make/unit-tests/varmod-gmtime.exp:1.7 Mon Nov 30 21:10:15 2020 +++ src/usr.bin/make/unit-tests/varmod-gmtime.exp Mon Dec 21 20:35:17 2020 @@ -1,27 +1,18 @@ -mod-gmtime: -%Y -2020 -%Y -localtime == localtime -mod-gmtime-indirect: -make: Invalid time value: ${:U1593536400}} +make: "varmod-gmtime.mk" line 57: Invalid time value: ${:U1593536400}} != "mtime=11593536400}" -mtime=1593536400} -parse-errors: -make: Invalid time value: -1}. +make: "varmod-gmtime.mk" line 57: Malformed conditional (${%Y:L:gmtime=${:U1593536400}} != "mtime=11593536400}") +make: "varmod-gmtime.mk" line 67: Invalid time value: -1} != "" -: -1 becomes mtime=-1}. -make: Invalid time value: 1}. +make: "varmod-gmtime.mk" line 67: Malformed conditional (${:L:gmtime=-1} != "") +make: "varmod-gmtime.mk" line 76: Invalid time value: 1} != "" -: space 1 becomes mtime= 1}. -: 0 becomes ok. -: 1 becomes Thu Jan 1 00:00:01 1970. -: INT32_MAX becomes Tue Jan 19 03:14:07 2038. -: INT32_MAX + 1 becomes . -make: Invalid time value: 1000}. +make: "varmod-gmtime.mk" line 76: Malformed conditional (${:L:gmtime= 1} != "") +make: "varmod-gmtime.mk" line 115: Invalid time value: 1000} != "" -: overflow becomes mtime=1000}. -make: Invalid time value: error}. +make: "varmod-gmtime.mk" line 115: Malformed conditional (${:L:gmtime=1000} != "") +make: "varmod-gmtime.mk" line 126: Invalid time value: error} != "" -: letter becomes mtime=error}. -exit status 0 +make: "varmod-gmtime.mk" line 126: Malformed conditional (${:L:gmtime=error} != "") +make: Fatal errors encountered -- cannot continue +make: stopped in unit-tests +exit status 1 Index: src/usr.bin/make/unit-tests/varmod-gmtime.mk diff -u src/usr.bin/make/unit-tests/varmod-gmtime.mk:1.6 src/usr.bin/make/unit-tests/varmod-gmtime.mk:1.7 --- src/usr.bin/make/unit-tests/varmod-gmtime.mk:1.6 Sat Oct 31 20:30:06 2020 +++ src/usr.bin/make/unit-tests/varmod-gmtime.mk Mon Dec 21 20:35:17 2020 @@ -1,11 +1,8 @@ -# $NetBSD: varmod-gmtime.mk,v 1.6 2020/10/31 20:30:06 rillig Exp $ +# $NetBSD: varmod-gmtime.mk,v 1.7 2020/12/21 20:35:17 rillig Exp $ # # Tests for the :gmtime variable modifier, which formats a timestamp # using strftime(3) in UTC. -all: mod-gmtime -all: mod-gmtime-indirect -all: parse-errors # Test for the default time format, %c. Since the time always varies, it's # only possible to check for the general format here. The names of the @@ -15,73 +12,122 @@ all: parse-errors . error .endif -mod-gmtime: - @echo $@: - # modifier name too short - @echo ${%Y:L:gmtim=1593536400} +# modifier name too short, falling back to the SysV modifier. +.if ${%Y:L:gmtim=1593536400} != "%Y" +. error +.endif + + +# 2020-07-01T00:00:00Z +.if ${%Y:L:gmtime=1593536400} != "2020" +. error +.endif + + +# modifier name too long, falling back to the SysV modifier. +.if ${%Y:L:gmtimer=1593536400} != "%Y" +. error +.endif + + +# If the
CVS commit: src/usr.bin/make/unit-tests
Module Name:src Committed By: sjg Date: Mon Dec 21 18:22:31 UTC 2020 Modified Files: src/usr.bin/make/unit-tests: Makefile Log Message: Set default for .MAKE.OS once To generate a diff of this commit: cvs rdiff -u -r1.253 -r1.254 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.253 src/usr.bin/make/unit-tests/Makefile:1.254 --- src/usr.bin/make/unit-tests/Makefile:1.253 Sun Dec 20 19:37:23 2020 +++ src/usr.bin/make/unit-tests/Makefile Mon Dec 21 18:22:31 2020 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.253 2020/12/20 19:37:23 rillig Exp $ +# $NetBSD: Makefile,v 1.254 2020/12/21 18:22:31 sjg Exp $ # # Unit tests for make(1) # @@ -31,7 +31,8 @@ # src/tests/usr.bin/make/t_make.sh. # -# we use this below but we might be an older make +# we use these below but we might be an older make +.MAKE.OS?= ${uname -s:L:sh} .MAKE.UID?= ${id -u:L:sh} # Each test is in a sub-makefile. @@ -587,7 +588,7 @@ LANG= C MAKE_TEST_ENV?= MALLOC_OPTIONS="JA" # for jemalloc -.if ${.MAKE.OS:U${uname -s:L:sh}} == "NetBSD" +.if ${.MAKE.OS} == "NetBSD" LIMIT_RESOURCES?= ulimit -v 20 .endif LIMIT_RESOURCES?= :
CVS commit: src/distrib/utils/embedded
Module Name:src Committed By: riastradh Date: Mon Dec 21 16:38:02 UTC 2020 Modified Files: src/distrib/utils/embedded: mkimage Log Message: embedded/mkimage: Pad image with zeros to multiple of 4 MB plus 1 MB. Otherwise, there may not be enough space after the ffs partition for a gpt, leading to very confusing results. To generate a diff of this commit: cvs rdiff -u -r1.75 -r1.76 src/distrib/utils/embedded/mkimage Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/distrib/utils/embedded/mkimage diff -u src/distrib/utils/embedded/mkimage:1.75 src/distrib/utils/embedded/mkimage:1.76 --- src/distrib/utils/embedded/mkimage:1.75 Fri Jul 17 15:16:34 2020 +++ src/distrib/utils/embedded/mkimage Mon Dec 21 16:38:02 2020 @@ -1,5 +1,5 @@ #!/bin/sh -# $NetBSD: mkimage,v 1.75 2020/07/17 15:16:34 jmcneill Exp $ +# $NetBSD: mkimage,v 1.76 2020/12/21 16:38:02 riastradh Exp $ # # Copyright (c) 2013, 2014 The NetBSD Foundation, Inc. # All rights reserved. @@ -259,17 +259,17 @@ if [ -z "${bootonly}" ]; then -F "$tmp/selected_sets" ${image} "${release}" "${mnt}" fi +cursize="$(getsize "${image}")" if [ "${size}" = 0 ]; then - size="$(getsize "${image}")" + size="${cursize}" + # Round up to a multiple of 4m and add 1m of slop. + alignunit=$((4*1024*1024)) + alignsize=$((alignunit*((cursize + alignunit - 1)/alignunit))) + alignsize=$((alignsize + 1024*1024)) + if [ $cursize -lt $alignsize ]; then + head -c "$((alignsize - cursize))" < /dev/zero >> "${image}" + fi fi -newsize=$((${size} / 2 / 1024)) -compare=$((${newsize} * 2 * 1024)) -while [ "${compare}" != "${size}" ] -do - size="$((size + size - compare))" - newsize="$((${size} / 2 / 1024))" - compare="$((${newsize} * 2 * 1024))" -done if $gpt; then if $gpt_hybrid; then
CVS commit: src/share/man/man4
Module Name:src Committed By: nia Date: Mon Dec 21 11:30:59 UTC 2020 Modified Files: src/share/man/man4: nct.4 Log Message: seemingly did not appear in netbsd 9 To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/share/man/man4/nct.4 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/man4/nct.4 diff -u src/share/man/man4/nct.4:1.2 src/share/man/man4/nct.4:1.3 --- src/share/man/man4/nct.4:1.2 Mon Oct 28 13:38:03 2019 +++ src/share/man/man4/nct.4 Mon Dec 21 11:30:59 2020 @@ -1,4 +1,4 @@ -.\" $NetBSD: nct.4,v 1.2 2019/10/28 13:38:03 wiz Exp $ +.\" $NetBSD: nct.4,v 1.3 2020/12/21 11:30:59 nia Exp $ .\" .\" Copyright (c) 2019 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -27,7 +27,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd October 14, 2019 +.Dd December 21, 2020 .Dt NCT 4 .Os .Sh NAME @@ -66,7 +66,7 @@ At attach time, the driver logs which of The .Nm driver first appeared in -.Nx 9 . +.Nx 10 . .Sh CAVEATS If the chip has not been configured in a complete and accurate manner by the BIOS, GPIO lines may be needlessly disabled.
CVS commit: src/sys/uvm/pmap
Module Name:src Committed By: skrll Date: Mon Dec 21 08:41:38 UTC 2020 Modified Files: src/sys/uvm/pmap: pmap.h Log Message: Remove variable in function declaration argument To generate a diff of this commit: cvs rdiff -u -r1.18 -r1.19 src/sys/uvm/pmap/pmap.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/uvm/pmap/pmap.h diff -u src/sys/uvm/pmap/pmap.h:1.18 src/sys/uvm/pmap/pmap.h:1.19 --- src/sys/uvm/pmap/pmap.h:1.18 Sun Dec 20 16:38:26 2020 +++ src/sys/uvm/pmap/pmap.h Mon Dec 21 08:41:38 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: pmap.h,v 1.18 2020/12/20 16:38:26 skrll Exp $ */ +/* $NetBSD: pmap.h,v 1.19 2020/12/21 08:41:38 skrll Exp $ */ /* * Copyright (c) 1992, 1993 @@ -195,7 +195,7 @@ bool pmap_page_clear_attributes(struct v void pmap_page_set_attributes(struct vm_page_md *, u_int); void pmap_pvlist_lock_init(size_t); #ifdef PMAP_VIRTUAL_CACHE_ALIASES -void pmap_page_cache(struct vm_page_md *, bool cached); +void pmap_page_cache(struct vm_page_md *, bool); #endif #ifdef __HAVE_PMAP_PV_TRACK