CVS commit: src/sys/dev/audio
Module Name:src Committed By: isaki Date: Sat Feb 22 08:03:19 UTC 2020 Modified Files: src/sys/dev/audio: audio.c Log Message: On audio_[pr]mixer_halt(), it's better to reset parameters in intr_lock. To generate a diff of this commit: cvs rdiff -u -r1.50 -r1.51 src/sys/dev/audio/audio.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/audio
Module Name:src Committed By: isaki Date: Sat Feb 22 08:03:19 UTC 2020 Modified Files: src/sys/dev/audio: audio.c Log Message: On audio_[pr]mixer_halt(), it's better to reset parameters in intr_lock. To generate a diff of this commit: cvs rdiff -u -r1.50 -r1.51 src/sys/dev/audio/audio.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/audio/audio.c diff -u src/sys/dev/audio/audio.c:1.50 src/sys/dev/audio/audio.c:1.51 --- src/sys/dev/audio/audio.c:1.50 Sat Feb 22 08:01:59 2020 +++ src/sys/dev/audio/audio.c Sat Feb 22 08:03:19 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: audio.c,v 1.50 2020/02/22 08:01:59 isaki Exp $ */ +/* $NetBSD: audio.c,v 1.51 2020/02/22 08:03:19 isaki Exp $ */ /*- * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -142,7 +142,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.50 2020/02/22 08:01:59 isaki Exp $"); +__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.51 2020/02/22 08:03:19 isaki Exp $"); #ifdef _KERNEL_OPT #include "audio.h" @@ -5546,7 +5546,6 @@ audio_pmixer_halt(struct audio_softc *sc mutex_enter(sc->sc_intr_lock); error = sc->hw_if->halt_output(sc->hw_hdl); - mutex_exit(sc->sc_intr_lock); /* Halts anyway even if some error has occurred. */ sc->sc_pbusy = false; @@ -5554,6 +5553,7 @@ audio_pmixer_halt(struct audio_softc *sc sc->sc_pmixer->hwbuf.used = 0; sc->sc_pmixer->mixseq = 0; sc->sc_pmixer->hwseq = 0; + mutex_exit(sc->sc_intr_lock); return error; } @@ -5576,7 +5576,6 @@ audio_rmixer_halt(struct audio_softc *sc mutex_enter(sc->sc_intr_lock); error = sc->hw_if->halt_input(sc->hw_hdl); - mutex_exit(sc->sc_intr_lock); /* Halts anyway even if some error has occurred. */ sc->sc_rbusy = false; @@ -5584,6 +5583,7 @@ audio_rmixer_halt(struct audio_softc *sc sc->sc_rmixer->hwbuf.used = 0; sc->sc_rmixer->mixseq = 0; sc->sc_rmixer->hwseq = 0; + mutex_exit(sc->sc_intr_lock); return error; }
CVS commit: src/sys/dev
Module Name:src Committed By: isaki Date: Sat Feb 22 08:15:09 UTC 2020 Modified Files: src/sys/dev/audio: audio.c src/sys/dev/pad: pad.c Log Message: Make calling get_props() lockless. get_props() of all MD drivers now can be called without sc_lock. To generate a diff of this commit: cvs rdiff -u -r1.51 -r1.52 src/sys/dev/audio/audio.c cvs rdiff -u -r1.63 -r1.64 src/sys/dev/pad/pad.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/audio/audio.c diff -u src/sys/dev/audio/audio.c:1.51 src/sys/dev/audio/audio.c:1.52 --- src/sys/dev/audio/audio.c:1.51 Sat Feb 22 08:03:19 2020 +++ src/sys/dev/audio/audio.c Sat Feb 22 08:15:09 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: audio.c,v 1.51 2020/02/22 08:03:19 isaki Exp $ */ +/* $NetBSD: audio.c,v 1.52 2020/02/22 08:15:09 isaki Exp $ */ /*- * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -121,7 +121,7 @@ * allocm - - + (*1) * freem - - + (*1) * round_buffersize - x - * get_props - x Called at attach time + * get_props - - Called at attach time * trigger_output x x + * trigger_input x x + * dev_ioctl - x @@ -142,7 +142,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.51 2020/02/22 08:03:19 isaki Exp $"); +__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.52 2020/02/22 08:15:09 isaki Exp $"); #ifdef _KERNEL_OPT #include "audio.h" @@ -886,9 +886,7 @@ audioattach(device_t parent, device_t se sc->sc_am_used = 0; sc->sc_am = NULL; - mutex_enter(sc->sc_lock); sc->sc_props = hw_if->get_props(sc->hw_hdl); - mutex_exit(sc->sc_lock); /* MMAP is now supported by upper layer. */ sc->sc_props |= AUDIO_PROP_MMAP; Index: src/sys/dev/pad/pad.c diff -u src/sys/dev/pad/pad.c:1.63 src/sys/dev/pad/pad.c:1.64 --- src/sys/dev/pad/pad.c:1.63 Wed Jun 26 12:21:40 2019 +++ src/sys/dev/pad/pad.c Sat Feb 22 08:15:09 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: pad.c,v 1.63 2019/06/26 12:21:40 isaki Exp $ */ +/* $NetBSD: pad.c,v 1.64 2020/02/22 08:15:09 isaki Exp $ */ /*- * Copyright (c) 2007 Jared D. McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: pad.c,v 1.63 2019/06/26 12:21:40 isaki Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pad.c,v 1.64 2020/02/22 08:15:09 isaki Exp $"); #include #include @@ -795,11 +795,6 @@ pad_query_devinfo(void *opaque, mixer_de static int pad_get_props(void *opaque) { - struct pad_softc *sc __diagused; - - sc = (struct pad_softc *)opaque; - - KASSERT(mutex_owned(>sc_lock)); return AUDIO_PROP_PLAYBACK; }
CVS commit: src/sys/dev
Module Name:src Committed By: isaki Date: Sat Feb 22 08:15:09 UTC 2020 Modified Files: src/sys/dev/audio: audio.c src/sys/dev/pad: pad.c Log Message: Make calling get_props() lockless. get_props() of all MD drivers now can be called without sc_lock. To generate a diff of this commit: cvs rdiff -u -r1.51 -r1.52 src/sys/dev/audio/audio.c cvs rdiff -u -r1.63 -r1.64 src/sys/dev/pad/pad.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Re: CVS commit: src/sys/arch/arm/arm32
On 21/02/2020 23:27, Maya Rashish wrote: [...] Index: src/sys/arch/arm/arm32/bus_dma.c diff -u src/sys/arch/arm/arm32/bus_dma.c:1.118 src/sys/arch/arm/arm32/bus_dma.c:1.119 --- src/sys/arch/arm/arm32/bus_dma.c:1.118 Tue Nov 5 10:21:31 2019 +++ src/sys/arch/arm/arm32/bus_dma.cFri Feb 21 23:27:06 2020 [...] @@ -404,7 +404,7 @@ _bus_dmamap_create(bus_dma_tag_t t, bus_ #ifdef DEBUG_DMA printf("dmamap_create:map=%p\n", map); #endif/* DEBUG_DMA */ - return 0; + return error; } /* This isn't correct for the case where _ARM32_NEED_BUS_DMA_BOUNCE isn't defined. I'll fix it. Nick
CVS commit: src/sys/dev/audio
Module Name:src Committed By: isaki Date: Sat Feb 22 08:01:59 UTC 2020 Modified Files: src/sys/dev/audio: audio.c Log Message: Add KASSERTs. audio_[pr]mixer_start() need exlock. To generate a diff of this commit: cvs rdiff -u -r1.49 -r1.50 src/sys/dev/audio/audio.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/audio/audio.c diff -u src/sys/dev/audio/audio.c:1.49 src/sys/dev/audio/audio.c:1.50 --- src/sys/dev/audio/audio.c:1.49 Sat Feb 22 07:59:47 2020 +++ src/sys/dev/audio/audio.c Sat Feb 22 08:01:59 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: audio.c,v 1.49 2020/02/22 07:59:47 isaki Exp $ */ +/* $NetBSD: audio.c,v 1.50 2020/02/22 08:01:59 isaki Exp $ */ /*- * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -142,7 +142,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.49 2020/02/22 07:59:47 isaki Exp $"); +__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.50 2020/02/22 08:01:59 isaki Exp $"); #ifdef _KERNEL_OPT #include "audio.h" @@ -4788,7 +4788,7 @@ audio_mixer_destroy(struct audio_softc * /* * Starts playback mixer. * Must be called only if sc_pbusy is false. - * Must be called with sc_lock held. + * Must be called with sc_lock && sc_exlock held. * Must not be called from the interrupt context. */ static void @@ -4798,6 +4798,7 @@ audio_pmixer_start(struct audio_softc *s int minimum; KASSERT(mutex_owned(sc->sc_lock)); + KASSERT(sc->sc_exlock); KASSERT(sc->sc_pbusy == false); mutex_enter(sc->sc_intr_lock); @@ -5290,7 +5291,7 @@ audio_pintr(void *arg) /* * Starts record mixer. * Must be called only if sc_rbusy is false. - * Must be called with sc_lock held. + * Must be called with sc_lock && sc_exlock held. * Must not be called from the interrupt context. */ static void @@ -5298,6 +5299,7 @@ audio_rmixer_start(struct audio_softc *s { KASSERT(mutex_owned(sc->sc_lock)); + KASSERT(sc->sc_exlock); KASSERT(sc->sc_rbusy == false); mutex_enter(sc->sc_intr_lock);
CVS commit: src/sys/dev/audio
Module Name:src Committed By: isaki Date: Sat Feb 22 08:01:59 UTC 2020 Modified Files: src/sys/dev/audio: audio.c Log Message: Add KASSERTs. audio_[pr]mixer_start() need exlock. To generate a diff of this commit: cvs rdiff -u -r1.49 -r1.50 src/sys/dev/audio/audio.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/audio
Module Name:src Committed By: isaki Date: Sat Feb 22 07:59:47 UTC 2020 Modified Files: src/sys/dev/audio: audio.c Log Message: Move #if DIAGNOSTIC..#endif to correct place. It should ignore stray interrupts regardless of DIAGNOSTIC. To generate a diff of this commit: cvs rdiff -u -r1.48 -r1.49 src/sys/dev/audio/audio.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/audio/audio.c diff -u src/sys/dev/audio/audio.c:1.48 src/sys/dev/audio/audio.c:1.49 --- src/sys/dev/audio/audio.c:1.48 Sat Feb 22 07:09:18 2020 +++ src/sys/dev/audio/audio.c Sat Feb 22 07:59:47 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: audio.c,v 1.48 2020/02/22 07:09:18 isaki Exp $ */ +/* $NetBSD: audio.c,v 1.49 2020/02/22 07:59:47 isaki Exp $ */ /*- * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -142,7 +142,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.48 2020/02/22 07:09:18 isaki Exp $"); +__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.49 2020/02/22 07:59:47 isaki Exp $"); #ifdef _KERNEL_OPT #include "audio.h" @@ -5224,12 +5224,12 @@ audio_pintr(void *arg) if (sc->sc_dying) return; -#if defined(DIAGNOSTIC) if (sc->sc_pbusy == false) { +#if defined(DIAGNOSTIC) device_printf(sc->sc_dev, "stray interrupt\n"); +#endif return; } -#endif mixer = sc->sc_pmixer; mixer->hw_complete_counter += mixer->frames_per_block; @@ -5492,12 +5492,12 @@ audio_rintr(void *arg) if (sc->sc_dying) return; -#if defined(DIAGNOSTIC) if (sc->sc_rbusy == false) { +#if defined(DIAGNOSTIC) device_printf(sc->sc_dev, "stray interrupt\n"); +#endif return; } -#endif mixer = sc->sc_rmixer; mixer->hw_complete_counter += mixer->frames_per_block;
CVS commit: src/sys/dev/audio
Module Name:src Committed By: isaki Date: Sat Feb 22 07:59:47 UTC 2020 Modified Files: src/sys/dev/audio: audio.c Log Message: Move #if DIAGNOSTIC..#endif to correct place. It should ignore stray interrupts regardless of DIAGNOSTIC. To generate a diff of this commit: cvs rdiff -u -r1.48 -r1.49 src/sys/dev/audio/audio.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/net
Module Name:src Committed By: maxv Date: Sat Feb 22 09:30:42 UTC 2020 Modified Files: src/sys/net: rtsock_shared.c Log Message: pass the address of the field, instead of relying on it being the first field of the structure, no functional change To generate a diff of this commit: cvs rdiff -u -r1.14 -r1.15 src/sys/net/rtsock_shared.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/net/rtsock_shared.c diff -u src/sys/net/rtsock_shared.c:1.14 src/sys/net/rtsock_shared.c:1.15 --- src/sys/net/rtsock_shared.c:1.14 Sun Feb 9 21:15:03 2020 +++ src/sys/net/rtsock_shared.c Sat Feb 22 09:30:42 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: rtsock_shared.c,v 1.14 2020/02/09 21:15:03 roy Exp $ */ +/* $NetBSD: rtsock_shared.c,v 1.15 2020/02/22 09:30:42 maxv Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -61,7 +61,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: rtsock_shared.c,v 1.14 2020/02/09 21:15:03 roy Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rtsock_shared.c,v 1.15 2020/02/22 09:30:42 maxv Exp $"); #ifdef _KERNEL_OPT #include "opt_inet.h" @@ -248,7 +248,7 @@ COMPATNAME(route_filter)(struct mbuf *m, offsetof(struct sockaddr, sa_len) + sizeof(ss.ss_len)) return EINVAL; m_copydata(m, sizeof(*rtm) + offsetof(struct sockaddr, sa_len), - sizeof(ss.ss_len), ); + sizeof(ss.ss_len), _len); if (m->m_pkthdr.len < sizeof(*rtm) + ss.ss_len) return EINVAL; /* Copy out the destination sockaddr */
CVS commit: src/lib/libcrypt
Module Name:src Committed By: kamil Date: Sat Feb 22 10:29:17 UTC 2020 Modified Files: src/lib/libcrypt: crypt.c Log Message: Avoid undefined behavior in left shift crypt.c:772:11, left shift of 1363235140 by 1 places cannot be represented in type 'int32_t' (aka 'int') To generate a diff of this commit: cvs rdiff -u -r1.37 -r1.38 src/lib/libcrypt/crypt.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libcrypt/crypt.c diff -u src/lib/libcrypt/crypt.c:1.37 src/lib/libcrypt/crypt.c:1.38 --- src/lib/libcrypt/crypt.c:1.37 Sat Feb 22 10:22:32 2020 +++ src/lib/libcrypt/crypt.c Sat Feb 22 10:29:17 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: crypt.c,v 1.37 2020/02/22 10:22:32 kamil Exp $ */ +/* $NetBSD: crypt.c,v 1.38 2020/02/22 10:29:17 kamil Exp $ */ /* * Copyright (c) 1989, 1993 @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)crypt.c 8.1.1.1 (Berkeley) 8/18/93"; #else -__RCSID("$NetBSD: crypt.c,v 1.37 2020/02/22 10:22:32 kamil Exp $"); +__RCSID("$NetBSD: crypt.c,v 1.38 2020/02/22 10:29:17 kamil Exp $"); #endif #endif /* not lint */ @@ -769,9 +769,9 @@ des_cipher(const char *in, char *out, lo LOADREG(R,R0,R1,L,L0,L1); L0 &= 0xL; L1 &= 0xL; - L0 = (L0 << 1) | L1; /* L0 is the even-numbered input bits */ + L0 = ((uint32_t)L0 << 1) | L1; /* L0 is the even-numbered input bits */ R0 &= 0xL; - R1 = (R1 >> 1) & 0xL; + R1 = ((uint32_t)R1 >> 1) & 0xL; L1 = R0 | R1; /* L1 is the odd-numbered input bits */ STORE(L,L0,L1,B); PERM3264(L,L0,L1,B.b, (C_block *)IE3264); /* even bits */
CVS commit: src/lib/libcrypt
Module Name:src Committed By: kamil Date: Sat Feb 22 10:29:17 UTC 2020 Modified Files: src/lib/libcrypt: crypt.c Log Message: Avoid undefined behavior in left shift crypt.c:772:11, left shift of 1363235140 by 1 places cannot be represented in type 'int32_t' (aka 'int') To generate a diff of this commit: cvs rdiff -u -r1.37 -r1.38 src/lib/libcrypt/crypt.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/lib/libc/stdlib
Module Name:src Committed By: kamil Date: Sat Feb 22 11:24:47 UTC 2020 Modified Files: src/lib/libc/stdlib: _rand48.c Log Message: Improve readability of __dorand48() Break long lines into shorter instructions per line. No Functional Change. To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/lib/libc/stdlib/_rand48.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/stdlib/_rand48.c diff -u src/lib/libc/stdlib/_rand48.c:1.7 src/lib/libc/stdlib/_rand48.c:1.8 --- src/lib/libc/stdlib/_rand48.c:1.7 Sun Jun 12 05:21:27 2005 +++ src/lib/libc/stdlib/_rand48.c Sat Feb 22 11:24:47 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: _rand48.c,v 1.7 2005/06/12 05:21:27 lukem Exp $ */ +/* $NetBSD: _rand48.c,v 1.8 2020/02/22 11:24:47 kamil Exp $ */ /* * Copyright (c) 1993 Martin Birgmeier @@ -15,7 +15,7 @@ #include #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: _rand48.c,v 1.7 2005/06/12 05:21:27 lukem Exp $"); +__RCSID("$NetBSD: _rand48.c,v 1.8 2020/02/22 11:24:47 kamil Exp $"); #endif /* LIBC_SCCS and not lint */ #include @@ -42,12 +42,12 @@ __dorand48(unsigned short xseed[3]) _DIAGASSERT(xseed != NULL); - accu = (unsigned long) __rand48_mult[0] * (unsigned long) xseed[0] + - (unsigned long) __rand48_add; + accu = (unsigned long) __rand48_mult[0] * (unsigned long) xseed[0]; + accu += (unsigned long) __rand48_add; temp[0] = (unsigned short) accu; /* lower 16 bits */ accu >>= sizeof(unsigned short) * 8; - accu += (unsigned long) __rand48_mult[0] * (unsigned long) xseed[1] + - (unsigned long) __rand48_mult[1] * (unsigned long) xseed[0]; + accu += (unsigned long) __rand48_mult[0] * (unsigned long) xseed[1]; + accu += (unsigned long) __rand48_mult[1] * (unsigned long) xseed[0]; temp[1] = (unsigned short) accu; /* middle 16 bits */ accu >>= sizeof(unsigned short) * 8; accu += __rand48_mult[0] * xseed[2] + __rand48_mult[1] * xseed[1] + __rand48_mult[2] * xseed[0];
CVS commit: src/lib/libc/stdlib
Module Name:src Committed By: kamil Date: Sat Feb 22 11:24:47 UTC 2020 Modified Files: src/lib/libc/stdlib: _rand48.c Log Message: Improve readability of __dorand48() Break long lines into shorter instructions per line. No Functional Change. To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/lib/libc/stdlib/_rand48.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/etc/rc.d
Module Name:src Committed By: roy Date: Sat Feb 22 11:52:45 UTC 2020 Modified Files: src/etc/rc.d: amd dhcpcd network Log Message: rc.d/network: improve wording of waiting for DAD to finish To generate a diff of this commit: cvs rdiff -u -r1.15 -r1.16 src/etc/rc.d/amd cvs rdiff -u -r1.5 -r1.6 src/etc/rc.d/dhcpcd cvs rdiff -u -r1.76 -r1.77 src/etc/rc.d/network Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/etc/rc.d/amd diff -u src/etc/rc.d/amd:1.15 src/etc/rc.d/amd:1.16 --- src/etc/rc.d/amd:1.15 Mon Feb 25 22:12:42 2008 +++ src/etc/rc.d/amd Sat Feb 22 11:52:45 2020 @@ -1,11 +1,12 @@ #!/bin/sh # -# $NetBSD: amd,v 1.15 2008/02/25 22:12:42 tron Exp $ +# $NetBSD: amd,v 1.16 2020/02/22 11:52:45 roy Exp $ # # PROVIDE: amd -# REQUIRE: rpcbind mountall ypbind +# REQUIRE: rpcbind mountall # BEFORE: DAEMON +# AFTER: ypbind $_rc_subr_loaded . /etc/rc.subr Index: src/etc/rc.d/dhcpcd diff -u src/etc/rc.d/dhcpcd:1.5 src/etc/rc.d/dhcpcd:1.6 --- src/etc/rc.d/dhcpcd:1.5 Thu Jan 7 22:03:00 2016 +++ src/etc/rc.d/dhcpcd Sat Feb 22 11:52:45 2020 @@ -1,10 +1,11 @@ #!/bin/sh -# $NetBSD: dhcpcd,v 1.5 2016/01/07 22:03:00 roy Exp $ +# $NetBSD: dhcpcd,v 1.6 2020/02/22 11:52:45 roy Exp $ # PROVIDE: dhcpcd # REQUIRE: network mountcritlocal # BEFORE: NETWORKING +# KEYWORD: chrootdir $_rc_subr_loaded . /etc/rc.subr Index: src/etc/rc.d/network diff -u src/etc/rc.d/network:1.76 src/etc/rc.d/network:1.77 --- src/etc/rc.d/network:1.76 Tue Oct 23 09:25:33 2018 +++ src/etc/rc.d/network Sat Feb 22 11:52:45 2020 @@ -1,6 +1,6 @@ #!/bin/sh # -# $NetBSD: network,v 1.76 2018/10/23 09:25:33 mrg Exp $ +# $NetBSD: network,v 1.77 2020/02/22 11:52:45 roy Exp $ # # PROVIDE: network @@ -447,10 +447,9 @@ network_start_ipv6_autoconf() network_wait_dad() { - # Wait for the DAD flags to clear form all addresses. + # Wait for the DAD flags to clear from all addresses. if [ -n "$ifconfig_wait_dad_flags" ]; then - echo 'Waiting for DAD to complete for' \ - 'statically configured addresses...' + echo "Waiting for duplicate address detection to finish..." ifconfig $ifconfig_wait_dad_flags fi }
CVS commit: src/etc/rc.d
Module Name:src Committed By: roy Date: Sat Feb 22 11:52:45 UTC 2020 Modified Files: src/etc/rc.d: amd dhcpcd network Log Message: rc.d/network: improve wording of waiting for DAD to finish To generate a diff of this commit: cvs rdiff -u -r1.15 -r1.16 src/etc/rc.d/amd cvs rdiff -u -r1.5 -r1.6 src/etc/rc.d/dhcpcd cvs rdiff -u -r1.76 -r1.77 src/etc/rc.d/network Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Re: CVS commit: src/tests/modules
I have got no opinion. Please rearrange the directories as needed. While there, it would be good to implement modctl(MODCTL_MODSTAT, ) to check whether a specific module is loaded into the kernel and retrieve modstat_t describing it. modstat_t m; strlcpy(_name, "haxm", MAXMODNAME); if (modctl(MODCTL_MODSTAT, ) == -1) err(EXIT_FAILURE, "modctl: haxm"); I have got use-cases for these checks and I envision their wider usage in future. We already have 3 use-cases in ATF tests. On 22.02.2020 04:41, Paul Goyette wrote: > OK, I over-reacted and didn't completely read the original commit > message. > > The t_builtin.c stuff is indeed a test-of-module-functionality > so it does belong here. > > But some of the other stuff here does not belong, such as the > threadpool, fetchstore, and kcov stuff. As far as I can see, > those all belong somewhere else, probably in the tests/sys/... > hierarchy. > > Anyway, my apologies for over-reacting to this commit. And > thanks to riastradh@ for pointing this out (on IRC). > > > > On Fri, 21 Feb 2020, Paul Goyette wrote: > >> Really, the tests/modules directory should be only used for tests-that- >> relate-to-module-functionality. It should NOT be used for modules- >> that-support-tests-of-other-functionality. >> >> In the future, please do not put support modules here; put them in the >> samae place as the tests that they support. >> >> >> On Sat, 22 Feb 2020, Kamil Rytarowski wrote: >> >>> Module Name: src >>> Committed By: kamil >>> Date: Sat Feb 22 00:18:55 UTC 2020 >>> >>> Modified Files: >>> src/tests/modules: t_builtin.c >>> >>> Log Message: >>> Avoid undefined behavior in disabledstat >>> >>> t_builtin.c:174:16, member access within misaligned address >>> 0x741271c25004 >>> for type 'struct modstat_t' >>> >>> t_builtin.c:175:4, member access within misaligned address >>> 0x741271c251c4 >>> for type 'struct modstat_t' >>> >>> >>> To generate a diff of this commit: >>> cvs rdiff -u -r1.4 -r1.5 src/tests/modules/t_builtin.c >>> >>> Please note that diffs are not public domain; they are subject to the >>> copyright notices on the relevant files. >>> >>> >>> !DSPAM:5e5073af66043393299806! >>> >>> >> >> ++--+---+ >> | Paul Goyette | PGP Key fingerprint: | E-mail addresses: | >> | (Retired) | FA29 0E3B 35AF E8AE 6651 | p...@whooppee.com | >> | Software Developer | 0786 F758 55DE 53BA 7731 | pgoye...@netbsd.org | >> ++--+---+ >> > > ++--+---+ > | Paul Goyette | PGP Key fingerprint: | E-mail addresses: | > | (Retired) | FA29 0E3B 35AF E8AE 6651 | p...@whooppee.com | > | Software Developer | 0786 F758 55DE 53BA 7731 | pgoye...@netbsd.org | > ++--+---+ signature.asc Description: OpenPGP digital signature
CVS commit: src/lib/libc/sys
Module Name:src Committed By: pgoyette Date: Sat Feb 22 14:06:05 UTC 2020 Modified Files: src/lib/libc/sys: modctl.2 Log Message: Remove vestigial remnant of an earlier modification to the module implementation. There currently is no such thing as a module's "alias". To generate a diff of this commit: cvs rdiff -u -r1.17 -r1.18 src/lib/libc/sys/modctl.2 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/sys/modctl.2 diff -u src/lib/libc/sys/modctl.2:1.17 src/lib/libc/sys/modctl.2:1.18 --- src/lib/libc/sys/modctl.2:1.17 Fri Dec 6 21:45:14 2019 +++ src/lib/libc/sys/modctl.2 Sat Feb 22 14:06:05 2020 @@ -1,4 +1,4 @@ -.\" $NetBSD: modctl.2,v 1.17 2019/12/06 21:45:14 pgoyette Exp $ +.\" $NetBSD: modctl.2,v 1.18 2020/02/22 14:06:05 pgoyette Exp $ .\" .\" Copyright (c) 2009 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -24,7 +24,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd December 5, 2019 +.Dd February 22, 2020 .Dt MODCTL 2 .Os .Sh NAME @@ -77,7 +77,7 @@ pointing to a suitable block of memory. The kernel will fill this block with .Bl -bullet .It -a count of the number of modules loaded (including aliases), +a count of the number of modules loaded, .It an array of .Em modstat_t
CVS commit: src/lib/libc/sys
Module Name:src Committed By: pgoyette Date: Sat Feb 22 14:06:05 UTC 2020 Modified Files: src/lib/libc/sys: modctl.2 Log Message: Remove vestigial remnant of an earlier modification to the module implementation. There currently is no such thing as a module's "alias". To generate a diff of this commit: cvs rdiff -u -r1.17 -r1.18 src/lib/libc/sys/modctl.2 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch/i386/stand/efiboot
Module Name:src Committed By: jmcneill Date: Sat Feb 22 09:34:26 UTC 2020 Modified Files: src/sys/arch/i386/stand/efiboot: eficons.c Log Message: If the default GOP mode is unavailable, fallback to the first mode defined. PR# port-amd64/55000 To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/sys/arch/i386/stand/efiboot/eficons.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/i386/stand/efiboot/eficons.c diff -u src/sys/arch/i386/stand/efiboot/eficons.c:1.9 src/sys/arch/i386/stand/efiboot/eficons.c:1.10 --- src/sys/arch/i386/stand/efiboot/eficons.c:1.9 Tue Feb 11 11:01:10 2020 +++ src/sys/arch/i386/stand/efiboot/eficons.c Sat Feb 22 09:34:26 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: eficons.c,v 1.9 2020/02/11 11:01:10 jmcneill Exp $ */ +/* $NetBSD: eficons.c,v 1.10 2020/02/22 09:34:26 jmcneill Exp $ */ /*- * Copyright (c) 2016 Kimihiro Nonaka @@ -37,6 +37,7 @@ #ifndef DEFAULT_GOP_MODE #define DEFAULT_GOP_MODE "1024x768" #endif +#define FALLBACK_GOP_MODE 0 extern struct x86_boot_params boot_params; @@ -431,6 +432,8 @@ bi_framebuffer(void) } else { /* If a mode has not been selected, choose a default */ bestmode = efi_find_gop_mode(DEFAULT_GOP_MODE); + if (bestmode == -1) + bestmode = FALLBACK_GOP_MODE; } if (bestmode == -1) goto nofb;
CVS commit: src/sys/arch/i386/stand/efiboot
Module Name:src Committed By: jmcneill Date: Sat Feb 22 09:34:26 UTC 2020 Modified Files: src/sys/arch/i386/stand/efiboot: eficons.c Log Message: If the default GOP mode is unavailable, fallback to the first mode defined. PR# port-amd64/55000 To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/sys/arch/i386/stand/efiboot/eficons.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sbin/fsck_msdos
Module Name:src Committed By: kamil Date: Sat Feb 22 09:59:22 UTC 2020 Modified Files: src/sbin/fsck_msdos: boot.c Log Message: Avoid unportable shift construct boot.c:150:29, left shift of 255 by 24 places cannot be represented in type 'int' boot.c:153:29, left shift of 255 by 24 places cannot be represented in type 'int' To generate a diff of this commit: cvs rdiff -u -r1.22 -r1.23 src/sbin/fsck_msdos/boot.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/fsck_msdos/boot.c diff -u src/sbin/fsck_msdos/boot.c:1.22 src/sbin/fsck_msdos/boot.c:1.23 --- src/sbin/fsck_msdos/boot.c:1.22 Sat Jan 11 16:29:07 2020 +++ src/sbin/fsck_msdos/boot.c Sat Feb 22 09:59:22 2020 @@ -27,7 +27,7 @@ #include #ifndef lint -__RCSID("$NetBSD: boot.c,v 1.22 2020/01/11 16:29:07 christos Exp $"); +__RCSID("$NetBSD: boot.c,v 1.23 2020/02/22 09:59:22 kamil Exp $"); #endif /* not lint */ #include @@ -81,8 +81,8 @@ readboot(int dosfs, struct bootblock *bo boot->FATsmall = block[22] + (block[23] << 8); boot->SecPerTrack = block[24] + (block[25] << 8); boot->Heads = block[26] + (block[27] << 8); - boot->HiddenSecs = block[28] + (block[29] << 8) + (block[30] << 16) + (block[31] << 24); - boot->HugeSectors = block[32] + (block[33] << 8) + (block[34] << 16) + (block[35] << 24); + boot->HiddenSecs = block[28] + (block[29] << 8) + (block[30] << 16) + ((uint32_t)block[31] << 24); + boot->HugeSectors = block[32] + (block[33] << 8) + (block[34] << 16) + ((uint32_t)block[35] << 24); boot->FATsecs = boot->FATsmall; @@ -90,7 +90,7 @@ readboot(int dosfs, struct bootblock *bo boot->flags |= FAT32; if (boot->flags & FAT32) { boot->FATsecs = block[36] + (block[37] << 8) -+ (block[38] << 16) + (block[39] << 24); ++ (block[38] << 16) + ((uint32_t)block[39] << 24); if (block[40] & 0x80) boot->ValidFat = block[40] & 0x0f; @@ -102,7 +102,7 @@ readboot(int dosfs, struct bootblock *bo return FSFATAL; } boot->RootCl = block[44] + (block[45] << 8) - + (block[46] << 16) + (block[47] << 24); + + (block[46] << 16) + ((uint32_t)block[47] << 24); boot->FSInfo = block[48] + (block[49] << 8); boot->Backup = block[50] + (block[51] << 8); @@ -147,10 +147,10 @@ readboot(int dosfs, struct bootblock *bo if (boot->FSInfo) { boot->FSFree = fsinfo[0x1e8] + (fsinfo[0x1e9] << 8) + (fsinfo[0x1ea] << 16) - + (fsinfo[0x1eb] << 24); + + ((uint32_t)fsinfo[0x1eb] << 24); boot->FSNext = fsinfo[0x1ec] + (fsinfo[0x1ed] << 8) + (fsinfo[0x1ee] << 16) - + (fsinfo[0x1ef] << 24); + + ((uint32_t)fsinfo[0x1ef] << 24); } if (lseek(dosfs, boot->Backup * boot->BytesPerSec, SEEK_SET)
CVS commit: src/sbin/fsck_msdos
Module Name:src Committed By: kamil Date: Sat Feb 22 09:59:22 UTC 2020 Modified Files: src/sbin/fsck_msdos: boot.c Log Message: Avoid unportable shift construct boot.c:150:29, left shift of 255 by 24 places cannot be represented in type 'int' boot.c:153:29, left shift of 255 by 24 places cannot be represented in type 'int' To generate a diff of this commit: cvs rdiff -u -r1.22 -r1.23 src/sbin/fsck_msdos/boot.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/lib/libcrypt
Module Name:src Committed By: kamil Date: Sat Feb 22 10:22:32 UTC 2020 Modified Files: src/lib/libcrypt: crypt.c Log Message: Avoid undefined behavior in bit shift operations crypt.c:839:40, left shift of negative value -1197182952 crypt.c:840:40, left shift of negative value -264997776 To generate a diff of this commit: cvs rdiff -u -r1.36 -r1.37 src/lib/libcrypt/crypt.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libcrypt/crypt.c diff -u src/lib/libcrypt/crypt.c:1.36 src/lib/libcrypt/crypt.c:1.37 --- src/lib/libcrypt/crypt.c:1.36 Mon Oct 21 02:36:48 2019 +++ src/lib/libcrypt/crypt.c Sat Feb 22 10:22:32 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: crypt.c,v 1.36 2019/10/21 02:36:48 jhigh Exp $ */ +/* $NetBSD: crypt.c,v 1.37 2020/02/22 10:22:32 kamil Exp $ */ /* * Copyright (c) 1989, 1993 @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)crypt.c 8.1.1.1 (Berkeley) 8/18/93"; #else -__RCSID("$NetBSD: crypt.c,v 1.36 2019/10/21 02:36:48 jhigh Exp $"); +__RCSID("$NetBSD: crypt.c,v 1.37 2020/02/22 10:22:32 kamil Exp $"); #endif #endif /* not lint */ @@ -836,8 +836,8 @@ des_cipher(const char *in, char *out, lo } /* store the encrypted (or decrypted) result */ - L0 = ((L0 >> 3) & 0x0f0f0f0fL) | ((L1 << 1) & 0xf0f0f0f0L); - L1 = ((R0 >> 3) & 0x0f0f0f0fL) | ((R1 << 1) & 0xf0f0f0f0L); + L0 = (((uint32_t)L0 >> 3) & 0x0f0f0f0fL) | (((uint32_t)L1 << 1) & 0xf0f0f0f0L); + L1 = (((uint32_t)R0 >> 3) & 0x0f0f0f0fL) | (((uint32_t)R1 << 1) & 0xf0f0f0f0L); STORE(L,L0,L1,B); PERM6464(L,L0,L1,B.b, (C_block *)CF6464); #if defined(MUST_ALIGN)
CVS commit: src/lib/libc/stdlib
Module Name:src Committed By: kamil Date: Sat Feb 22 11:56:14 UTC 2020 Modified Files: src/lib/libc/stdlib: rand48.3 Log Message: rand48: Document that short integers are unsigned To generate a diff of this commit: cvs rdiff -u -r1.11 -r1.12 src/lib/libc/stdlib/rand48.3 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/etc/rc.d
Module Name:src Committed By: roy Date: Sat Feb 22 11:55:43 UTC 2020 Modified Files: src/etc/rc.d: amd dhcpcd Log Message: Revert unrelated changes to prior To generate a diff of this commit: cvs rdiff -u -r1.16 -r1.17 src/etc/rc.d/amd cvs rdiff -u -r1.6 -r1.7 src/etc/rc.d/dhcpcd Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/etc/rc.d/amd diff -u src/etc/rc.d/amd:1.16 src/etc/rc.d/amd:1.17 --- src/etc/rc.d/amd:1.16 Sat Feb 22 11:52:45 2020 +++ src/etc/rc.d/amd Sat Feb 22 11:55:43 2020 @@ -1,12 +1,11 @@ #!/bin/sh # -# $NetBSD: amd,v 1.16 2020/02/22 11:52:45 roy Exp $ +# $NetBSD: amd,v 1.17 2020/02/22 11:55:43 roy Exp $ # # PROVIDE: amd -# REQUIRE: rpcbind mountall +# REQUIRE: rpcbind mountall ypbind # BEFORE: DAEMON -# AFTER: ypbind $_rc_subr_loaded . /etc/rc.subr Index: src/etc/rc.d/dhcpcd diff -u src/etc/rc.d/dhcpcd:1.6 src/etc/rc.d/dhcpcd:1.7 --- src/etc/rc.d/dhcpcd:1.6 Sat Feb 22 11:52:45 2020 +++ src/etc/rc.d/dhcpcd Sat Feb 22 11:55:43 2020 @@ -1,11 +1,10 @@ #!/bin/sh -# $NetBSD: dhcpcd,v 1.6 2020/02/22 11:52:45 roy Exp $ +# $NetBSD: dhcpcd,v 1.7 2020/02/22 11:55:43 roy Exp $ # PROVIDE: dhcpcd # REQUIRE: network mountcritlocal # BEFORE: NETWORKING -# KEYWORD: chrootdir $_rc_subr_loaded . /etc/rc.subr
CVS commit: src/etc/rc.d
Module Name:src Committed By: roy Date: Sat Feb 22 11:55:43 UTC 2020 Modified Files: src/etc/rc.d: amd dhcpcd Log Message: Revert unrelated changes to prior To generate a diff of this commit: cvs rdiff -u -r1.16 -r1.17 src/etc/rc.d/amd cvs rdiff -u -r1.6 -r1.7 src/etc/rc.d/dhcpcd Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/lib/libc/stdlib
Module Name:src Committed By: kamil Date: Sat Feb 22 13:20:21 UTC 2020 Modified Files: src/lib/libc/stdlib: rand48.3 Log Message: Reorder words to fix grammar Noted by To generate a diff of this commit: cvs rdiff -u -r1.12 -r1.13 src/lib/libc/stdlib/rand48.3 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/stdlib/rand48.3 diff -u src/lib/libc/stdlib/rand48.3:1.12 src/lib/libc/stdlib/rand48.3:1.13 --- src/lib/libc/stdlib/rand48.3:1.12 Sat Feb 22 11:56:13 2020 +++ src/lib/libc/stdlib/rand48.3 Sat Feb 22 13:20:21 2020 @@ -1,4 +1,4 @@ -.\" $NetBSD: rand48.3,v 1.12 2020/02/22 11:56:13 kamil Exp $ +.\" $NetBSD: rand48.3,v 1.13 2020/02/22 13:20:21 kamil Exp $ .\" .\" Copyright (c) 1993 Martin Birgmeier .\" All rights reserved. @@ -98,7 +98,7 @@ On the other hand, and .Fn jrand48 use a user-supplied buffer to store the seed r(n), which consists -of an array of unsigned 3 shorts, where the zeroth member holds the least +of an array of 3 unsigned shorts, where the zeroth member holds the least significant bits. .Pp All functions share the same multiplicand and addend.
CVS commit: src/lib/libc/stdlib
Module Name:src Committed By: kamil Date: Sat Feb 22 13:20:21 UTC 2020 Modified Files: src/lib/libc/stdlib: rand48.3 Log Message: Reorder words to fix grammar Noted by To generate a diff of this commit: cvs rdiff -u -r1.12 -r1.13 src/lib/libc/stdlib/rand48.3 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: maxv Date: Sat Feb 22 09:24:05 UTC 2020 Modified Files: src/sys/kern: sys_ptrace_common.c Log Message: pass the address of the field, instead of relying on it being the first field of the structure, no functional change, ok kamil To generate a diff of this commit: cvs rdiff -u -r1.77 -r1.78 src/sys/kern/sys_ptrace_common.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/sys_ptrace_common.c diff -u src/sys/kern/sys_ptrace_common.c:1.77 src/sys/kern/sys_ptrace_common.c:1.78 --- src/sys/kern/sys_ptrace_common.c:1.77 Fri Jan 3 00:37:29 2020 +++ src/sys/kern/sys_ptrace_common.c Sat Feb 22 09:24:05 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: sys_ptrace_common.c,v 1.77 2020/01/03 00:37:29 kamil Exp $ */ +/* $NetBSD: sys_ptrace_common.c,v 1.78 2020/02/22 09:24:05 maxv Exp $ */ /*- * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc. @@ -118,7 +118,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: sys_ptrace_common.c,v 1.77 2020/01/03 00:37:29 kamil Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sys_ptrace_common.c,v 1.78 2020/02/22 09:24:05 maxv Exp $"); #ifdef _KERNEL_OPT #include "opt_ptrace.h" @@ -804,7 +804,7 @@ ptrace_lwpstatus(struct proc *t, struct __func__, sizeof(lwpid_t), data, sizeof(pls))); return EINVAL; } - error = copyin(addr, , sizeof(lwpid_t)); + error = copyin(addr, _lwpid, sizeof(lwpid_t)); if (error) return error;
CVS commit: src/sys/kern
Module Name:src Committed By: maxv Date: Sat Feb 22 09:24:05 UTC 2020 Modified Files: src/sys/kern: sys_ptrace_common.c Log Message: pass the address of the field, instead of relying on it being the first field of the structure, no functional change, ok kamil To generate a diff of this commit: cvs rdiff -u -r1.77 -r1.78 src/sys/kern/sys_ptrace_common.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/lib/libc/stdlib
Module Name:src Committed By: kamil Date: Sat Feb 22 10:05:12 UTC 2020 Modified Files: src/lib/libc/stdlib: _env.c Log Message: Avoid NULL pointer arithmetics on environ _env.c:260:9, pointer expression with base 0 overflowed to 0 _env.c:260:9, load of null pointer of type 'char *' To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/lib/libc/stdlib/_env.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/stdlib/_env.c diff -u src/lib/libc/stdlib/_env.c:1.9 src/lib/libc/stdlib/_env.c:1.10 --- src/lib/libc/stdlib/_env.c:1.9 Tue Jan 20 18:31:25 2015 +++ src/lib/libc/stdlib/_env.c Sat Feb 22 10:05:12 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: _env.c,v 1.9 2015/01/20 18:31:25 christos Exp $ */ +/* $NetBSD: _env.c,v 1.10 2020/02/22 10:05:12 kamil Exp $ */ /*- * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ #include #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: _env.c,v 1.9 2015/01/20 18:31:25 christos Exp $"); +__RCSID("$NetBSD: _env.c,v 1.10 2020/02/22 10:05:12 kamil Exp $"); #endif /* LIBC_SCCS and not lint */ #include "namespace.h" @@ -257,13 +257,15 @@ __getenvslot(const char *name, size_t l_ /* Search for an existing environment variable of the given name. */ num_entries = 0; - while (environ[num_entries] != NULL) { - if (strncmp(environ[num_entries], name, l_name) == 0 && - environ[num_entries][l_name] == '=') { - /* We found a match. */ - return num_entries; + if (environ != NULL) { + while (environ[num_entries] != NULL) { + if (strncmp(environ[num_entries], name, l_name) == 0 && + environ[num_entries][l_name] == '=') { +/* We found a match. */ +return num_entries; + } + num_entries ++; } - num_entries ++; } /* No match found, return if we don't want to allocate a new slot. */
CVS commit: src/lib/libc/stdlib
Module Name:src Committed By: kamil Date: Sat Feb 22 10:05:12 UTC 2020 Modified Files: src/lib/libc/stdlib: _env.c Log Message: Avoid NULL pointer arithmetics on environ _env.c:260:9, pointer expression with base 0 overflowed to 0 _env.c:260:9, load of null pointer of type 'char *' To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/lib/libc/stdlib/_env.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/i386/stand/efiboot
Module Name:src Committed By: jmcneill Date: Sat Feb 22 10:30:37 UTC 2020 Modified Files: src/sys/arch/i386/stand/efiboot: eficons.c Log Message: Remove check for bestmode==-1 (shouldn't happen) To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/sys/arch/i386/stand/efiboot/eficons.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/i386/stand/efiboot/eficons.c diff -u src/sys/arch/i386/stand/efiboot/eficons.c:1.10 src/sys/arch/i386/stand/efiboot/eficons.c:1.11 --- src/sys/arch/i386/stand/efiboot/eficons.c:1.10 Sat Feb 22 09:34:26 2020 +++ src/sys/arch/i386/stand/efiboot/eficons.c Sat Feb 22 10:30:37 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: eficons.c,v 1.10 2020/02/22 09:34:26 jmcneill Exp $ */ +/* $NetBSD: eficons.c,v 1.11 2020/02/22 10:30:37 jmcneill Exp $ */ /*- * Copyright (c) 2016 Kimihiro Nonaka @@ -421,7 +421,7 @@ bi_framebuffer(void) EFI_STATUS status; EFI_GRAPHICS_OUTPUT_MODE_INFORMATION *info; struct btinfo_framebuffer fb; - INT32 bestmode = -1; + INT32 bestmode; UINTN sz; if (efi_gop == NULL) @@ -435,8 +435,6 @@ bi_framebuffer(void) if (bestmode == -1) bestmode = FALLBACK_GOP_MODE; } - if (bestmode == -1) - goto nofb; status = uefi_call_wrapper(efi_gop->SetMode, 2, efi_gop, bestmode);
CVS commit: src/sys/arch/i386/stand/efiboot
Module Name:src Committed By: jmcneill Date: Sat Feb 22 10:30:37 UTC 2020 Modified Files: src/sys/arch/i386/stand/efiboot: eficons.c Log Message: Remove check for bestmode==-1 (shouldn't happen) To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/sys/arch/i386/stand/efiboot/eficons.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/lib/libc/stdlib
Module Name:src Committed By: kamil Date: Sat Feb 22 11:56:14 UTC 2020 Modified Files: src/lib/libc/stdlib: rand48.3 Log Message: rand48: Document that short integers are unsigned To generate a diff of this commit: cvs rdiff -u -r1.11 -r1.12 src/lib/libc/stdlib/rand48.3 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/stdlib/rand48.3 diff -u src/lib/libc/stdlib/rand48.3:1.11 src/lib/libc/stdlib/rand48.3:1.12 --- src/lib/libc/stdlib/rand48.3:1.11 Fri Mar 31 11:43:54 2006 +++ src/lib/libc/stdlib/rand48.3 Sat Feb 22 11:56:13 2020 @@ -1,4 +1,4 @@ -.\" $NetBSD: rand48.3,v 1.11 2006/03/31 11:43:54 drochner Exp $ +.\" $NetBSD: rand48.3,v 1.12 2020/02/22 11:56:13 kamil Exp $ .\" .\" Copyright (c) 1993 Martin Birgmeier .\" All rights reserved. @@ -11,7 +11,7 @@ .\" of any kind. I shall in no event be liable for anything that happens .\" to anyone/anything when using this software. .\" -.Dd October 8, 1993 +.Dd February 22, 2020 .Dt RAND48 3 .Os .Sh NAME @@ -98,7 +98,7 @@ On the other hand, and .Fn jrand48 use a user-supplied buffer to store the seed r(n), which consists -of an array of 3 shorts, where the zeroth member holds the least +of an array of unsigned 3 shorts, where the zeroth member holds the least significant bits. .Pp All functions share the same multiplicand and addend. @@ -120,12 +120,12 @@ also initializes the internal buffer r(n .Fn lrand48 , and .Fn mrand48 , -but here all 48 bits of the seed can be specified in an array of 3 shorts, +but here all 48 bits of the seed can be specified in an array of 3 unsigned shorts, where the zeroth member specifies the lowest bits. Again, the constant multiplicand and addend of the algorithm are reset to the default values given above. .Fn seed48 -returns a pointer to an array of 3 shorts which contains the old seed. +returns a pointer to an array of 3 unsigned shorts which contains the old seed. This array is statically allocated, thus its contents are lost after each new call to .Fn seed48 . @@ -145,7 +145,7 @@ and the seed used in .Fn lrand48 , and .Fn mrand48 . -An array of 7 shorts is passed as parameter; the first three shorts are +An array of 7 unsigned shorts is passed as parameter; the first three shorts are used to initialize the seed; the second three are used to initialize the multiplicand; and the last short is used to initialize the addend. It is thus not possible to use values greater than 0x as the addend.
Re: CVS commit: src/tests/modules
On Sat, 22 Feb 2020, Kamil Rytarowski wrote: I have got no opinion. Please rearrange the directories as needed. It's too much bother for now to move things around. But for future changes it would be good to put new "helper" modules in the same area as the tests being helped. While there, it would be good to implement modctl(MODCTL_MODSTAT, ) to check whether a specific module is loaded into the kernel and retrieve modstat_t describing it. modstat_t m; strlcpy(_name, "haxm", MAXMODNAME); if (modctl(MODCTL_MODSTAT, ) == -1) err(EXIT_FAILURE, "modctl: haxm"); I have got use-cases for these checks and I envision their wider usage in future. We already have 3 use-cases in ATF tests. I can probably do this fairly quickly. But I'll have to look closer at the argument/result passing, especially WRT the module's list of "required" modules. ++--+---+ | Paul Goyette | PGP Key fingerprint: | E-mail addresses: | | (Retired) | FA29 0E3B 35AF E8AE 6651 | p...@whooppee.com | | Software Developer | 0786 F758 55DE 53BA 7731 | pgoye...@netbsd.org | ++--+---+
Re: CVS commit: src/tests/modules
On Sat, 22 Feb 2020, Paul Goyette wrote: While there, it would be good to implement modctl(MODCTL_MODSTAT, ) to check whether a specific module is loaded into the kernel and retrieve modstat_t describing it. modstat_t m; strlcpy(_name, "haxm", MAXMODNAME); if (modctl(MODCTL_MODSTAT, ) == -1) err(EXIT_FAILURE, "modctl: haxm"); I have got use-cases for these checks and I envision their wider usage in future. We already have 3 use-cases in ATF tests. I can probably do this fairly quickly. But I'll have to look closer at the argument/result passing, especially WRT the module's list of "required" modules. Thinking a bit more, it's probably easiest just to retrieve the entire list of modules with modctl(MODCTL_STAT, ...) and then scan the returned list and compare against ms_name, as is done in modstat(8). Before I invest much time in this, I'd appreciate other opinions on whether a new option is necessary/desirable. ++--+---+ | Paul Goyette | PGP Key fingerprint: | E-mail addresses: | | (Retired) | FA29 0E3B 35AF E8AE 6651 | p...@whooppee.com | | Software Developer | 0786 F758 55DE 53BA 7731 | pgoye...@netbsd.org | ++--+---+
Re: CVS commit: src/tests/modules
On Sat, 22 Feb 2020, Kamil Rytarowski wrote: While there, it would be good to implement modctl(MODCTL_MODSTAT, ) to check whether a specific module is loaded into the kernel and retrieve modstat_t describing it. modstat_t m; strlcpy(_name, "haxm", MAXMODNAME); if (modctl(MODCTL_MODSTAT, ) == -1) err(EXIT_FAILURE, "modctl: haxm"); I have got use-cases for these checks and I envision their wider usage in future. We already have 3 use-cases in ATF tests. I can probably do this fairly quickly.?? But I'll have to look closer at the argument/result passing, especially WRT the module's list of "required" modules. Thinking a bit more, it's probably easiest just to retrieve the entire list of modules with modctl(MODCTL_STAT, ...) and then scan the returned list and compare against ms_name, as is done in modstat(8). Before I invest much time in this, I'd appreciate other opinions on whether a new option is necessary/desirable. Performance is probably not critical so it sounds fine. I would like to have at least get_modstat_info() from t_modctl.c in libutil. Sure that seems reasonable to me. Assuming that noone else objects, please feel free to move it. I think we should also update the test program to use the new libutil version (rather than duplicating the code). Also update the libutil man page? I guess that the return type of get_modstat_info() should be changed to int rather than bool? And that it shouldn't directly print error messages? :) ++--+---+ | Paul Goyette | PGP Key fingerprint: | E-mail addresses: | | (Retired) | FA29 0E3B 35AF E8AE 6651 | p...@whooppee.com | | Software Developer | 0786 F758 55DE 53BA 7731 | pgoye...@netbsd.org | ++--+---+
CVS commit: src/sys/arch/arm/arm32
Module Name:src Committed By: skrll Date: Sat Feb 22 08:22:10 UTC 2020 Modified Files: src/sys/arch/arm/arm32: bus_dma.c Log Message: Fix previous for _ARM32_NEED_BUS_DMA_BOUNCE To generate a diff of this commit: cvs rdiff -u -r1.119 -r1.120 src/sys/arch/arm/arm32/bus_dma.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/arm/arm32/bus_dma.c diff -u src/sys/arch/arm/arm32/bus_dma.c:1.119 src/sys/arch/arm/arm32/bus_dma.c:1.120 --- src/sys/arch/arm/arm32/bus_dma.c:1.119 Fri Feb 21 23:27:06 2020 +++ src/sys/arch/arm/arm32/bus_dma.c Sat Feb 22 08:22:09 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: bus_dma.c,v 1.119 2020/02/21 23:27:06 maya Exp $ */ +/* $NetBSD: bus_dma.c,v 1.120 2020/02/22 08:22:09 skrll Exp $ */ /*- * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc. @@ -36,7 +36,7 @@ #include "opt_cputypes.h" #include -__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.119 2020/02/21 23:27:06 maya Exp $"); +__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.120 2020/02/22 08:22:09 skrll Exp $"); #include #include @@ -315,6 +315,7 @@ _bus_dmamap_create(bus_dma_tag_t t, bus_ { struct arm32_bus_dmamap *map; void *mapstore; + int error = 0; #ifdef DEBUG_DMA printf("dmamap_create: t=%p size=%lx nseg=%x msegsz=%lx boundary=%lx" @@ -357,7 +358,6 @@ _bus_dmamap_create(bus_dma_tag_t t, bus_ struct arm32_bus_dma_cookie *cookie; int cookieflags; void *cookiestore; - int error; cookieflags = 0;
CVS commit: src/sys/arch/arm/arm32
Module Name:src Committed By: skrll Date: Sat Feb 22 08:22:10 UTC 2020 Modified Files: src/sys/arch/arm/arm32: bus_dma.c Log Message: Fix previous for _ARM32_NEED_BUS_DMA_BOUNCE To generate a diff of this commit: cvs rdiff -u -r1.119 -r1.120 src/sys/arch/arm/arm32/bus_dma.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: maxv Date: Sat Feb 22 08:39:33 UTC 2020 Modified Files: src/sys/kern: uipc_socket.c Log Message: Zero out 'tv', to prevent uninitialized bytes in its padding from leaking to userland. Found by kMSan. Reported-by: syzbot+8134380511a82c8f5...@syzkaller.appspotmail.com To generate a diff of this commit: cvs rdiff -u -r1.287 -r1.288 src/sys/kern/uipc_socket.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/uipc_socket.c diff -u src/sys/kern/uipc_socket.c:1.287 src/sys/kern/uipc_socket.c:1.288 --- src/sys/kern/uipc_socket.c:1.287 Fri Feb 21 00:26:22 2020 +++ src/sys/kern/uipc_socket.c Sat Feb 22 08:39:33 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: uipc_socket.c,v 1.287 2020/02/21 00:26:22 joerg Exp $ */ +/* $NetBSD: uipc_socket.c,v 1.288 2020/02/22 08:39:33 maxv Exp $ */ /* * Copyright (c) 2002, 2007, 2008, 2009 The NetBSD Foundation, Inc. @@ -71,7 +71,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: uipc_socket.c,v 1.287 2020/02/21 00:26:22 joerg Exp $"); +__KERNEL_RCSID(0, "$NetBSD: uipc_socket.c,v 1.288 2020/02/22 08:39:33 maxv Exp $"); #ifdef _KERNEL_OPT #include "opt_compat_netbsd.h" @@ -1992,6 +1992,7 @@ sogetopt1(struct socket *so, struct sock optval = (opt == SO_SNDTIMEO ? so->so_snd.sb_timeo : so->so_rcv.sb_timeo); + memset(, 0, sizeof(tv)); tv.tv_sec = optval / hz; tv.tv_usec = (optval % hz) * tick;
CVS commit: src/sys/net
Module Name:src Committed By: maxv Date: Sat Feb 22 09:30:42 UTC 2020 Modified Files: src/sys/net: rtsock_shared.c Log Message: pass the address of the field, instead of relying on it being the first field of the structure, no functional change To generate a diff of this commit: cvs rdiff -u -r1.14 -r1.15 src/sys/net/rtsock_shared.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: xsrc/external/mit/MesaLib/dist/src/mapi
Module Name:xsrc Committed By: tnn Date: Sat Feb 22 09:42:27 UTC 2020 Modified Files: xsrc/external/mit/MesaLib/dist/src/mapi: entry_x86-64_tls.h entry_x86_tls.h Log Message: mesa: sync w/ pkgsrc: don't assume the current gl dispatch table points to noop if NULL, instead call the ENTRY_CURRENT_TABLE_GET function. Additionally the previous i386 implementation probably never worked because it looks like it used the wrong asm label when computing GOT ptr. Likely relevant to PR port-i386/54782. XXX pullup -9 To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 \ xsrc/external/mit/MesaLib/dist/src/mapi/entry_x86-64_tls.h cvs rdiff -u -r1.5 -r1.6 \ xsrc/external/mit/MesaLib/dist/src/mapi/entry_x86_tls.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Re: CVS commit: src/tests/modules
On 22.02.2020 15:32, Paul Goyette wrote: > On Sat, 22 Feb 2020, Paul Goyette wrote: > >>> While there, it would be good to implement modctl(MODCTL_MODSTAT, >>> ) to check whether a specific module is loaded into the kernel >>> and retrieve modstat_t describing it. >>> >>> modstat_t m; >>> strlcpy(_name, "haxm", MAXMODNAME); >>> if (modctl(MODCTL_MODSTAT, ) == -1) >>> err(EXIT_FAILURE, "modctl: haxm"); >>> >>> I have got use-cases for these checks and I envision their wider usage >>> in future. We already have 3 use-cases in ATF tests. >> >> I can probably do this fairly quickly. But I'll have to look closer >> at the argument/result passing, especially WRT the module's list of >> "required" modules. > > Thinking a bit more, it's probably easiest just to retrieve the entire > list of modules with modctl(MODCTL_STAT, ...) and then scan the returned > list and compare against ms_name, as is done in modstat(8). > > Before I invest much time in this, I'd appreciate other opinions on > whether a new option is necessary/desirable. > > Performance is probably not critical so it sounds fine. I would like to have at least get_modstat_info() from t_modctl.c in libutil. signature.asc Description: OpenPGP digital signature
Re: CVS commit: src/tests/modules
On 22.02.2020 15:54, Paul Goyette wrote: > On Sat, 22 Feb 2020, Kamil Rytarowski wrote: > > While there, it would be good to implement modctl(MODCTL_MODSTAT, > ) to check whether a specific module is loaded into the kernel > and retrieve modstat_t describing it. > > modstat_t m; > strlcpy(_name, "haxm", MAXMODNAME); > if (modctl(MODCTL_MODSTAT, ) == -1) > err(EXIT_FAILURE, "modctl: haxm"); > > I have got use-cases for these checks and I envision their wider usage > in future. We already have 3 use-cases in ATF tests. I can probably do this fairly quickly. But I'll have to look closer at the argument/result passing, especially WRT the module's list of "required" modules. >>> >>> Thinking a bit more, it's probably easiest just to retrieve the entire >>> list of modules with modctl(MODCTL_STAT, ...) and then scan the returned >>> list and compare against ms_name, as is done in modstat(8). >>> >>> Before I invest much time in this, I'd appreciate other opinions on >>> whether a new option is necessary/desirable. >>> >>> >> >> Performance is probably not critical so it sounds fine. >> >> I would like to have at least get_modstat_info() from t_modctl.c in >> libutil. > > Sure that seems reasonable to me. > > Assuming that noone else objects, please feel free to move it. I > think we should also update the test program to use the new libutil > version (rather than duplicating the code). Also update the libutil > man page? > > I guess that the return type of get_modstat_info() should be changed > to int rather than bool? And that it shouldn't directly print error > messages? :) > > I will do it and share a patch. signature.asc Description: OpenPGP digital signature
CVS commit: src/sys/kern
Module Name:src Committed By: maxv Date: Sat Feb 22 08:39:33 UTC 2020 Modified Files: src/sys/kern: uipc_socket.c Log Message: Zero out 'tv', to prevent uninitialized bytes in its padding from leaking to userland. Found by kMSan. Reported-by: syzbot+8134380511a82c8f5...@syzkaller.appspotmail.com To generate a diff of this commit: cvs rdiff -u -r1.287 -r1.288 src/sys/kern/uipc_socket.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: xsrc/external/mit/MesaLib/dist/src/mapi
Module Name:xsrc Committed By: tnn Date: Sat Feb 22 09:42:27 UTC 2020 Modified Files: xsrc/external/mit/MesaLib/dist/src/mapi: entry_x86-64_tls.h entry_x86_tls.h Log Message: mesa: sync w/ pkgsrc: don't assume the current gl dispatch table points to noop if NULL, instead call the ENTRY_CURRENT_TABLE_GET function. Additionally the previous i386 implementation probably never worked because it looks like it used the wrong asm label when computing GOT ptr. Likely relevant to PR port-i386/54782. XXX pullup -9 To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 \ xsrc/external/mit/MesaLib/dist/src/mapi/entry_x86-64_tls.h cvs rdiff -u -r1.5 -r1.6 \ xsrc/external/mit/MesaLib/dist/src/mapi/entry_x86_tls.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: xsrc/external/mit/MesaLib/dist/src/mapi/entry_x86-64_tls.h diff -u xsrc/external/mit/MesaLib/dist/src/mapi/entry_x86-64_tls.h:1.4 xsrc/external/mit/MesaLib/dist/src/mapi/entry_x86-64_tls.h:1.5 --- xsrc/external/mit/MesaLib/dist/src/mapi/entry_x86-64_tls.h:1.4 Tue Apr 9 14:14:59 2019 +++ xsrc/external/mit/MesaLib/dist/src/mapi/entry_x86-64_tls.h Sat Feb 22 09:42:27 2020 @@ -32,24 +32,27 @@ #endif __asm__(".text\n" -".balign 32\n" +".balign 64\n" "x86_64_entry_start:"); #define STUB_ASM_ENTRY(func) \ ".globl " func "\n" \ ".type " func ", @function\n" \ - ".balign 32\n"\ + ".balign 64\n"\ func ":" #ifndef __ILP32__ -#if defined(__NetBSD__) && defined(MAPI_MODE_GLAPI) +#if defined(__NetBSD__) #define STUB_ASM_CODE(slot) \ "movq " ENTRY_CURRENT_TABLE "@GOTTPOFF(%rip), %rax\n\t" \ "movq %fs:(%rax), %r11\n\t" \ "testq %r11, %r11\n\t"\ - "cmoveq table_noop_array@GOTPCREL(%rip), %r11\n\t"\ - "jmp *(8 * " slot ")(%r11)" + "je 1f\n\t" \ + "jmp *(8 * " slot ")(%r11)\n\t" \ + "1:\n\t" \ + "callq " ENTRY_CURRENT_TABLE_GET "@PLT\n\t" \ + "jmp *(8 * " slot ")(%rax)" #else #define STUB_ASM_CODE(slot) \ "movq " ENTRY_CURRENT_TABLE "@GOTTPOFF(%rip), %rax\n\t" \ @@ -86,7 +89,7 @@ x86_64_entry_start[] HIDDEN; mapi_func entry_get_public(int slot) { - return (mapi_func) (x86_64_entry_start + slot * 32); + return (mapi_func) (x86_64_entry_start + slot * 64); } void Index: xsrc/external/mit/MesaLib/dist/src/mapi/entry_x86_tls.h diff -u xsrc/external/mit/MesaLib/dist/src/mapi/entry_x86_tls.h:1.5 xsrc/external/mit/MesaLib/dist/src/mapi/entry_x86_tls.h:1.6 --- xsrc/external/mit/MesaLib/dist/src/mapi/entry_x86_tls.h:1.5 Tue Apr 9 14:14:59 2019 +++ xsrc/external/mit/MesaLib/dist/src/mapi/entry_x86_tls.h Sat Feb 22 09:42:27 2020 @@ -43,6 +43,20 @@ __asm__("x86_current_tls:\n\t" "movl " ENTRY_CURRENT_TABLE "@GOTNTPOFF(%eax), %eax\n\t" "ret"); +#if defined(__NetBSD__) +__asm__("x86_current_table_helper:\n\t" + "movl %gs:(%eax), %eax\n\t" \ + "testl %eax, %eax\n\t"\ + "je 1f\n\t" \ + "ret\n\t" \ + "1:\n\t" \ + "call 2f\n\t" \ + "2:\n\t" \ + "popl %eax\n\t" \ + "addl $_GLOBAL_OFFSET_TABLE_+[.-2b], %eax\n\t" \ + "jmp *" ENTRY_CURRENT_TABLE_GET "@GOT(%eax)"); +#endif + #ifndef GLX_X86_READONLY_TEXT __asm__(".section wtext, \"awx\", @progbits"); #endif /* GLX_X86_READONLY_TEXT */ @@ -56,20 +70,10 @@ __asm__(".balign 16\n" ".balign 16\n"\ func ":" -#if defined(__NetBSD__) && defined(MAPI_MODE_GLAPI) -extern const mapi_func table_noop_array[]; +#if defined(__NetBSD__) #define STUB_ASM_CODE(slot) \ "call x86_current_tls\n\t"\ - "movl %gs:(%eax), %eax\n\t" \ - "testl %eax, %eax\n\t"\ - "je 1f\n\t" \ - "jmp *(4 * " slot ")(%eax)\n\t" \ - "1:\n\t" \ - "call 2f\n" \ - "2:\n\t" \ - "popl %eax\n\t" \ - "addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %eax\n\t" \ - "movl table_noop_array@GOT(%eax), %eax\n\t" \ + "call x86_current_table_helper\n\t"\ "jmp *(4 * " slot ")(%eax)" #else #define STUB_ASM_CODE(slot) \
CVS commit: src/sys/compat/common
Module Name:src Committed By: maxv Date: Sat Feb 22 09:42:20 UTC 2020 Modified Files: src/sys/compat/common: uipc_syscalls_40.c Log Message: pass the address of the field, instead of relying on it being the first field of the structure, no functional change To generate a diff of this commit: cvs rdiff -u -r1.21 -r1.22 src/sys/compat/common/uipc_syscalls_40.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/compat/common/uipc_syscalls_40.c diff -u src/sys/compat/common/uipc_syscalls_40.c:1.21 src/sys/compat/common/uipc_syscalls_40.c:1.22 --- src/sys/compat/common/uipc_syscalls_40.c:1.21 Thu Dec 12 02:15:42 2019 +++ src/sys/compat/common/uipc_syscalls_40.c Sat Feb 22 09:42:20 2020 @@ -1,9 +1,9 @@ -/* $NetBSD: uipc_syscalls_40.c,v 1.21 2019/12/12 02:15:42 pgoyette Exp $ */ +/* $NetBSD: uipc_syscalls_40.c,v 1.22 2020/02/22 09:42:20 maxv Exp $ */ /* written by Pavel Cahyna, 2006. Public domain. */ #include -__KERNEL_RCSID(0, "$NetBSD: uipc_syscalls_40.c,v 1.21 2019/12/12 02:15:42 pgoyette Exp $"); +__KERNEL_RCSID(0, "$NetBSD: uipc_syscalls_40.c,v 1.22 2020/02/22 09:42:20 maxv Exp $"); #if defined(_KERNEL_OPT) #include "opt_compat_netbsd.h" @@ -119,7 +119,7 @@ compat_ifconf(u_long cmd, void *data) } else { space -= sa->sa_len - sizeof(*sa); if (space >= sz) { - error = copyout(, ifrp, + error = copyout(_name, ifrp, sizeof(ifr.ifr_name)); if (error == 0) { error = copyout(sa,
CVS commit: src/sys/compat/common
Module Name:src Committed By: maxv Date: Sat Feb 22 09:42:20 UTC 2020 Modified Files: src/sys/compat/common: uipc_syscalls_40.c Log Message: pass the address of the field, instead of relying on it being the first field of the structure, no functional change To generate a diff of this commit: cvs rdiff -u -r1.21 -r1.22 src/sys/compat/common/uipc_syscalls_40.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: maxv Date: Sat Feb 22 08:58:39 UTC 2020 Modified Files: src/sys/kern: vfs_syscalls.c Log Message: Inline the block in the parent block, for clarity, and also to prevent a false positive with kMSan. Here, LLVM reorders the conditions and checks 'vattr' before 'error'. But if 'error' is non-zero then 'vattr' is not initialized, and kMSan notices the uninitialized memory read. To generate a diff of this commit: cvs rdiff -u -r1.540 -r1.541 src/sys/kern/vfs_syscalls.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: maxv Date: Sat Feb 22 08:58:39 UTC 2020 Modified Files: src/sys/kern: vfs_syscalls.c Log Message: Inline the block in the parent block, for clarity, and also to prevent a false positive with kMSan. Here, LLVM reorders the conditions and checks 'vattr' before 'error'. But if 'error' is non-zero then 'vattr' is not initialized, and kMSan notices the uninitialized memory read. To generate a diff of this commit: cvs rdiff -u -r1.540 -r1.541 src/sys/kern/vfs_syscalls.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/vfs_syscalls.c diff -u src/sys/kern/vfs_syscalls.c:1.540 src/sys/kern/vfs_syscalls.c:1.541 --- src/sys/kern/vfs_syscalls.c:1.540 Fri Jan 17 20:08:09 2020 +++ src/sys/kern/vfs_syscalls.c Sat Feb 22 08:58:39 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: vfs_syscalls.c,v 1.540 2020/01/17 20:08:09 ad Exp $ */ +/* $NetBSD: vfs_syscalls.c,v 1.541 2020/02/22 08:58:39 maxv Exp $ */ /*- * Copyright (c) 2008, 2009, 2019 The NetBSD Foundation, Inc. @@ -70,7 +70,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls.c,v 1.540 2020/01/17 20:08:09 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls.c,v 1.541 2020/02/22 08:58:39 maxv Exp $"); #ifdef _KERNEL_OPT #include "opt_fileassoc.h" @@ -2286,10 +2286,12 @@ do_sys_mknodat(struct lwp *l, int fdat, error = EINVAL; break; } + + if (error == 0 && optype == VOP_MKNOD_DESCOFFSET && + vattr.va_rdev == VNOVAL) + error = EINVAL; } - if (error == 0 && optype == VOP_MKNOD_DESCOFFSET - && vattr.va_rdev == VNOVAL) - error = EINVAL; + if (!error) { switch (optype) { case VOP_WHITEOUT_DESCOFFSET:
CVS commit: src/sys/external/gpl2/dts/dist/arch/arm/boot/dts
Module Name:src Committed By: skrll Date: Sat Feb 22 09:54:27 UTC 2020 Modified Files: src/sys/external/gpl2/dts/dist/arch/arm/boot/dts: bcm2835-rpi-zero-w.dts Log Message: Define pinctrl-names for sdhci to fix it. From Harold Gutch and discussed on port-arm. http://mail-index.netbsd.org/port-arm/2020/02/13/msg006497.html To generate a diff of this commit: cvs rdiff -u -r1.1.1.4 -r1.2 \ src/sys/external/gpl2/dts/dist/arch/arm/boot/dts/bcm2835-rpi-zero-w.dts Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/distrib
Module Name:src Committed By: roy Date: Sat Feb 22 09:53:48 UTC 2020 Added Files: src/distrib/amd64/ramdisks/ramdisk-zfsroot: Makefile list src/distrib/common: list.zfsroot mtree.zfsroot zfsroot.rc Log Message: zfs: build a ramdisk on amd64 with enough to mount rpool/ROOT on / Until we get ZFS integrated into our boot loader, this is the next best thing. The idea is simple - have a small FFS partition with a kernel, modules and this ramdisk. Once the ramdisk boots it will mount the FFS partition read only, copy the needed ZFS modules to the ramdisk and then unmount the partition. Then we import the ZFS root pool, mount the ZFS root filesystem and then pivot to it. Because the initial FFS partition is not mounted at this point, we can mount it in /altroot so we can replace the kernel and modules with newer ones so it's easily maintainable. This ZFS boot strapper currently makes the following assumptions: * The device NAME=boot is the FFS with kernel, modules and this ramdisk. * The ZFS root pool and root filesystem are called rpool/ROOT. A boot.cfg menu entry can then be added like so: menu=Boot ZFS root:fs /ramdisk-zfsroot.fs;boot To generate a diff of this commit: cvs rdiff -u -r0 -r1.1 src/distrib/amd64/ramdisks/ramdisk-zfsroot/Makefile \ src/distrib/amd64/ramdisks/ramdisk-zfsroot/list cvs rdiff -u -r0 -r1.1 src/distrib/common/list.zfsroot \ src/distrib/common/mtree.zfsroot src/distrib/common/zfsroot.rc Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Added files: Index: src/distrib/amd64/ramdisks/ramdisk-zfsroot/Makefile diff -u /dev/null src/distrib/amd64/ramdisks/ramdisk-zfsroot/Makefile:1.1 --- /dev/null Sat Feb 22 09:53:48 2020 +++ src/distrib/amd64/ramdisks/ramdisk-zfsroot/Makefile Sat Feb 22 09:53:47 2020 @@ -0,0 +1,17 @@ +# $NetBSD: Makefile,v 1.1 2020/02/22 09:53:47 roy Exp $ + +IMAGE= ramdisk-zfsroot.fs +IMAGESIZE= 5000k +IMAGEDEPENDS= +MAKEDEVTARGETS= all +CRUNCHENV= INIT_CHROOT=1 +SMALLPROG_INET6= 1 + +LISTS+= ${DISTRIBDIR}/common/list.zfsroot + +.include "${.CURDIR}/../common/Makefile.ramdisk" +.include "${DISTRIBDIR}/common/Makefile.makedev" + +LISTS+= ${.CURDIR}/list + +MTREECONF+= ${DISTRIBDIR}/common/mtree.zfsroot Index: src/distrib/amd64/ramdisks/ramdisk-zfsroot/list diff -u /dev/null src/distrib/amd64/ramdisks/ramdisk-zfsroot/list:1.1 --- /dev/null Sat Feb 22 09:53:48 2020 +++ src/distrib/amd64/ramdisks/ramdisk-zfsroot/list Sat Feb 22 09:53:47 2020 @@ -0,0 +1,12 @@ +# $NetBSD: list,v 1.1 2020/02/22 09:53:47 roy Exp $ + +PROG bin/sync + +PROG sbin/fdisk +PROG sbin/gpt +PROG sbin/mbrlabel +PROG sbin/shutdown + +PROG usr/bin/less usr/bin/more + +PROG usr/sbin/installboot Index: src/distrib/common/list.zfsroot diff -u /dev/null src/distrib/common/list.zfsroot:1.1 --- /dev/null Sat Feb 22 09:53:48 2020 +++ src/distrib/common/list.zfsroot Sat Feb 22 09:53:47 2020 @@ -0,0 +1,29 @@ +# $NetBSD: list.zfsroot,v 1.1 2020/02/22 09:53:47 roy Exp $ +# +# list file (c.f. parselist.awk) for ZFS on root. +# + +SRCDIRS external/cddl/osnet/sbin +PROG sbin/zfs +PROG sbin/zpool +LINK sbin/zfs sbin/mount_zfs +ARGVLN zfs mount_zfs + +# We need sysctl to set init.root=/altroot +PROG sbin/sysctl + +LIBS -lnvpair +LIBS -luutil +LIBS -lzfs +LIBS -lavl +LIBS -lm +LIBS -lpthread +LIBS -lumem +#LIBS -lutil # replaced by libhack +LIBS -lz +LIBS -lzfs_core + +COPY ${NETBSDSRCDIR}/distrib/common/zfsroot.rc etc/rc + +# Make firmware images available. +SYMLINK altroot/libdata libdata Index: src/distrib/common/mtree.zfsroot diff -u /dev/null src/distrib/common/mtree.zfsroot:1.1 --- /dev/null Sat Feb 22 09:53:48 2020 +++ src/distrib/common/mtree.zfsroot Sat Feb 22 09:53:47 2020 @@ -0,0 +1,8 @@ +# $NetBSD: mtree.zfsroot,v 1.1 2020/02/22 09:53:47 roy Exp $ + +. +./altroot +./etc +./etc/zfs +./rpool +./stand Index: src/distrib/common/zfsroot.rc diff -u /dev/null src/distrib/common/zfsroot.rc:1.1 --- /dev/null Sat Feb 22 09:53:48 2020 +++ src/distrib/common/zfsroot.rc Sat Feb 22 09:53:47 2020 @@ -0,0 +1,64 @@ +#/bin/sh +# +# $NetBSD: zfsroot.rc,v 1.1 2020/02/22 09:53:47 roy Exp $ +# ZFS on Root boot strapper + +# Configurable - define the ZFS root pool and ROOT. +# XXX Can these be set in boot.cfg? +# Assumption - the root pool is set to legacy mount. +rpool=rpool +rroot=ROOT + +# Assumption - the boot device is named boot. +# Could use dk0, wd0a, etc instead. +# XXX Can be exposed by sysctl kern.boot_device? +bootdev="NAME=boot" + +# Setup some stuff incase things go south and we drop to the shell +export HOME=/ +export PATH=/sbin:/bin:/usr/sbin:/usr/bin +umask 022 + +echo +echo "Starting ZFS on root boot strapper" + +# Avoid having the solaris and zfs modules in ramdisk directly. +# Means we don't need to update the ramdisk with the kernel modules +# or load them from boot.cfg so it's less pain for the user. +#bootdev="$(/sbin/sysctl -n kern.boot_device)" +modpath="$(/sbin/sysctl -n
CVS commit: src/distrib
Module Name:src Committed By: roy Date: Sat Feb 22 09:53:48 UTC 2020 Added Files: src/distrib/amd64/ramdisks/ramdisk-zfsroot: Makefile list src/distrib/common: list.zfsroot mtree.zfsroot zfsroot.rc Log Message: zfs: build a ramdisk on amd64 with enough to mount rpool/ROOT on / Until we get ZFS integrated into our boot loader, this is the next best thing. The idea is simple - have a small FFS partition with a kernel, modules and this ramdisk. Once the ramdisk boots it will mount the FFS partition read only, copy the needed ZFS modules to the ramdisk and then unmount the partition. Then we import the ZFS root pool, mount the ZFS root filesystem and then pivot to it. Because the initial FFS partition is not mounted at this point, we can mount it in /altroot so we can replace the kernel and modules with newer ones so it's easily maintainable. This ZFS boot strapper currently makes the following assumptions: * The device NAME=boot is the FFS with kernel, modules and this ramdisk. * The ZFS root pool and root filesystem are called rpool/ROOT. A boot.cfg menu entry can then be added like so: menu=Boot ZFS root:fs /ramdisk-zfsroot.fs;boot To generate a diff of this commit: cvs rdiff -u -r0 -r1.1 src/distrib/amd64/ramdisks/ramdisk-zfsroot/Makefile \ src/distrib/amd64/ramdisks/ramdisk-zfsroot/list cvs rdiff -u -r0 -r1.1 src/distrib/common/list.zfsroot \ src/distrib/common/mtree.zfsroot src/distrib/common/zfsroot.rc Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/external/gpl2/dts/dist/arch/arm/boot/dts
Module Name:src Committed By: skrll Date: Sat Feb 22 09:54:27 UTC 2020 Modified Files: src/sys/external/gpl2/dts/dist/arch/arm/boot/dts: bcm2835-rpi-zero-w.dts Log Message: Define pinctrl-names for sdhci to fix it. From Harold Gutch and discussed on port-arm. http://mail-index.netbsd.org/port-arm/2020/02/13/msg006497.html To generate a diff of this commit: cvs rdiff -u -r1.1.1.4 -r1.2 \ src/sys/external/gpl2/dts/dist/arch/arm/boot/dts/bcm2835-rpi-zero-w.dts Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/external/gpl2/dts/dist/arch/arm/boot/dts/bcm2835-rpi-zero-w.dts diff -u src/sys/external/gpl2/dts/dist/arch/arm/boot/dts/bcm2835-rpi-zero-w.dts:1.1.1.4 src/sys/external/gpl2/dts/dist/arch/arm/boot/dts/bcm2835-rpi-zero-w.dts:1.2 --- src/sys/external/gpl2/dts/dist/arch/arm/boot/dts/bcm2835-rpi-zero-w.dts:1.1.1.4 Fri Jan 3 14:33:09 2020 +++ src/sys/external/gpl2/dts/dist/arch/arm/boot/dts/bcm2835-rpi-zero-w.dts Sat Feb 22 09:54:27 2020 @@ -112,6 +112,7 @@ { #address-cells = <1>; #size-cells = <0>; + pinctrl-names = "default"; pinctrl-0 = <_gpio34 _gpio43>; bus-width = <4>; mmc-pwrseq = <_pwrseq>;
CVS commit: src/lib/libcrypt
Module Name:src Committed By: kamil Date: Sat Feb 22 10:22:32 UTC 2020 Modified Files: src/lib/libcrypt: crypt.c Log Message: Avoid undefined behavior in bit shift operations crypt.c:839:40, left shift of negative value -1197182952 crypt.c:840:40, left shift of negative value -264997776 To generate a diff of this commit: cvs rdiff -u -r1.36 -r1.37 src/lib/libcrypt/crypt.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/ic
Module Name:src Committed By: jmcneill Date: Sat Feb 22 13:41:41 UTC 2020 Modified Files: src/sys/dev/ic: bcmgenet.c bcmgenetreg.h Log Message: Add support for hardware rx filters. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/dev/ic/bcmgenet.c \ src/sys/dev/ic/bcmgenetreg.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/ic/bcmgenet.c diff -u src/sys/dev/ic/bcmgenet.c:1.1 src/sys/dev/ic/bcmgenet.c:1.2 --- src/sys/dev/ic/bcmgenet.c:1.1 Sat Feb 22 00:28:35 2020 +++ src/sys/dev/ic/bcmgenet.c Sat Feb 22 13:41:40 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: bcmgenet.c,v 1.1 2020/02/22 00:28:35 jmcneill Exp $ */ +/* $NetBSD: bcmgenet.c,v 1.2 2020/02/22 13:41:40 jmcneill Exp $ */ /*- * Copyright (c) 2020 Jared McNeill @@ -34,7 +34,7 @@ #include "opt_ddb.h" #include -__KERNEL_RCSID(0, "$NetBSD: bcmgenet.c,v 1.1 2020/02/22 00:28:35 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: bcmgenet.c,v 1.2 2020/02/22 13:41:40 jmcneill Exp $"); #include #include @@ -80,6 +80,7 @@ CTASSERT(MCLBYTES == 2048); #define TX_DESC_COUNT GENET_DMA_DESC_COUNT #define RX_DESC_COUNT GENET_DMA_DESC_COUNT #define MII_BUSY_RETRY 1000 +#define GENET_MAX_MDF_FILTER 17 #define GENET_LOCK(sc) mutex_enter(&(sc)->sc_lock) #define GENET_UNLOCK(sc) mutex_exit(&(sc)->sc_lock) @@ -323,19 +324,65 @@ genet_tick(void *softc) } static void +genet_setup_rxfilter_mdf(struct genet_softc *sc, u_int n, const uint8_t *ea) +{ + uint32_t addr0 = (ea[0] << 8) | ea[1]; + uint32_t addr1 = (ea[2] << 24) | (ea[3] << 16) | (ea[4] << 8) | ea[5]; + + WR4(sc, GENET_UMAC_MDF_ADDR0(n), addr0); + WR4(sc, GENET_UMAC_MDF_ADDR1(n), addr1); +} + +static void genet_setup_rxfilter(struct genet_softc *sc) { - uint32_t val; + struct ethercom *ec = >sc_ec; + struct ifnet *ifp = >ec_if; + struct ether_multistep step; + struct ether_multi *enm; + uint32_t cmd, mdf_ctrl; + u_int n; GENET_ASSERT_LOCKED(sc); - /* Enable promiscuous mode */ - val = RD4(sc, GENET_UMAC_CMD); - val |= GENET_UMAC_CMD_PROMISC; - WR4(sc, GENET_UMAC_CMD, val); + ETHER_LOCK(ec); + + cmd = RD4(sc, GENET_UMAC_CMD); + + /* + * Count the required number of hardware filters. We need one + * for each multicast address, plus one for our own address and + * the broadcast address. + */ + ETHER_FIRST_MULTI(step, ec, enm); + for (n = 2; enm != NULL; n++) + ETHER_NEXT_MULTI(step, enm); + + if (n > GENET_MAX_MDF_FILTER) + ifp->if_flags |= IFF_ALLMULTI; + else + ifp->if_flags &= ~IFF_ALLMULTI; + + if ((ifp->if_flags & (IFF_PROMISC|IFF_ALLMULTI)) != 0) { + cmd |= GENET_UMAC_CMD_PROMISC; + mdf_ctrl = 0; + } else { + cmd &= ~GENET_UMAC_CMD_PROMISC; + genet_setup_rxfilter_mdf(sc, 0, ifp->if_broadcastaddr); + genet_setup_rxfilter_mdf(sc, 1, CLLADDR(ifp->if_sadl)); + ETHER_FIRST_MULTI(step, ec, enm); + for (n = 2; enm != NULL; n++) { + genet_setup_rxfilter_mdf(sc, n, enm->enm_addrlo); + ETHER_NEXT_MULTI(step, enm); + } + mdf_ctrl = __BITS(GENET_MAX_MDF_FILTER - 1, + GENET_MAX_MDF_FILTER - n); + } + + WR4(sc, GENET_UMAC_CMD, cmd); + WR4(sc, GENET_UMAC_MDF_CTRL, mdf_ctrl); - /* Disable filters */ - WR4(sc, GENET_UMAC_MDF_CTRL, 0); + ETHER_UNLOCK(ec); } static int @@ -465,10 +512,10 @@ genet_init_locked(struct genet_softc *sc GENET_SYS_PORT_MODE_EXT_GPHY); /* Write hardware address */ - val = enaddr[0] | (enaddr[1] << 8) | (enaddr[2] << 16) | - (enaddr[3] << 24); + val = enaddr[3] | (enaddr[2] << 8) | (enaddr[1] << 16) | + (enaddr[0] << 24); WR4(sc, GENET_UMAC_MAC0, val); - val = enaddr[4] | (enaddr[5] << 8); + val = enaddr[5] | (enaddr[4] << 8); WR4(sc, GENET_UMAC_MAC1, val); /* Setup RX filter */ Index: src/sys/dev/ic/bcmgenetreg.h diff -u src/sys/dev/ic/bcmgenetreg.h:1.1 src/sys/dev/ic/bcmgenetreg.h:1.2 --- src/sys/dev/ic/bcmgenetreg.h:1.1 Sat Feb 22 00:28:35 2020 +++ src/sys/dev/ic/bcmgenetreg.h Sat Feb 22 13:41:41 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: bcmgenetreg.h,v 1.1 2020/02/22 00:28:35 jmcneill Exp $ */ +/* $NetBSD: bcmgenetreg.h,v 1.2 2020/02/22 13:41:41 jmcneill Exp $ */ /*- * Copyright (c) 2020 Jared McNeill @@ -85,6 +85,8 @@ #define GENET_MDIO_PMD __BITS(25,21) #define GENET_MDIO_REG __BITS(20,16) #define GENET_UMAC_MDF_CTRL 0xe50 +#define GENET_UMAC_MDF_ADDR0(n) (0xe54 + (n) * 0x8) +#define GENET_UMAC_MDF_ADDR1(n) (0xe58 + (n) * 0x8) #define GENET_DMA_DESC_COUNT 256 #define GENET_DMA_DESC_SIZE 12
CVS commit: src/sys/dev/ic
Module Name:src Committed By: jmcneill Date: Sat Feb 22 13:41:41 UTC 2020 Modified Files: src/sys/dev/ic: bcmgenet.c bcmgenetreg.h Log Message: Add support for hardware rx filters. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/dev/ic/bcmgenet.c \ src/sys/dev/ic/bcmgenetreg.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/lib/libc/stdlib
Module Name:src Committed By: kamil Date: Sat Feb 22 14:07:57 UTC 2020 Modified Files: src/lib/libc/stdlib: _rand48.c Log Message: Avoid undefined behavior in the rand48(3) implementation Instead of implicid promotion to signed int, explicitly cast the arguments to unsigned int. _rand48.c:53:27, signed integer overflow: 58989 * 58970 cannot be represented in type 'int' _rand48.c:53:38, signed integer overflow: -2093025904 + -1496809120 cannot be represented in type 'int' _rand48.c:53:57, signed integer overflow: 57068 * 42787 cannot be represented in type 'int' New and old code produce the same code as tested with: #include #include #define COUNT 1000 * 1000 int main(void) { FILE *fp; int i; fp = fopen("numbers.txt", "w+"); if (!fp) abort(); for(i = 0; i < COUNT; i++) { fprintf(fp, "%f\n", drand48()); fprintf(fp, "%ld\n", lrand48()); fprintf(fp, "%ld\n", mrand48()); } fclose(fp); return 0; } To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/lib/libc/stdlib/_rand48.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/lib/libc/stdlib
Module Name:src Committed By: kamil Date: Sat Feb 22 14:07:57 UTC 2020 Modified Files: src/lib/libc/stdlib: _rand48.c Log Message: Avoid undefined behavior in the rand48(3) implementation Instead of implicid promotion to signed int, explicitly cast the arguments to unsigned int. _rand48.c:53:27, signed integer overflow: 58989 * 58970 cannot be represented in type 'int' _rand48.c:53:38, signed integer overflow: -2093025904 + -1496809120 cannot be represented in type 'int' _rand48.c:53:57, signed integer overflow: 57068 * 42787 cannot be represented in type 'int' New and old code produce the same code as tested with: #include #include #define COUNT 1000 * 1000 int main(void) { FILE *fp; int i; fp = fopen("numbers.txt", "w+"); if (!fp) abort(); for(i = 0; i < COUNT; i++) { fprintf(fp, "%f\n", drand48()); fprintf(fp, "%ld\n", lrand48()); fprintf(fp, "%ld\n", mrand48()); } fclose(fp); return 0; } To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/lib/libc/stdlib/_rand48.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/stdlib/_rand48.c diff -u src/lib/libc/stdlib/_rand48.c:1.8 src/lib/libc/stdlib/_rand48.c:1.9 --- src/lib/libc/stdlib/_rand48.c:1.8 Sat Feb 22 11:24:47 2020 +++ src/lib/libc/stdlib/_rand48.c Sat Feb 22 14:07:57 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: _rand48.c,v 1.8 2020/02/22 11:24:47 kamil Exp $ */ +/* $NetBSD: _rand48.c,v 1.9 2020/02/22 14:07:57 kamil Exp $ */ /* * Copyright (c) 1993 Martin Birgmeier @@ -15,7 +15,7 @@ #include #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: _rand48.c,v 1.8 2020/02/22 11:24:47 kamil Exp $"); +__RCSID("$NetBSD: _rand48.c,v 1.9 2020/02/22 14:07:57 kamil Exp $"); #endif /* LIBC_SCCS and not lint */ #include @@ -50,7 +50,9 @@ __dorand48(unsigned short xseed[3]) accu += (unsigned long) __rand48_mult[1] * (unsigned long) xseed[0]; temp[1] = (unsigned short) accu; /* middle 16 bits */ accu >>= sizeof(unsigned short) * 8; - accu += __rand48_mult[0] * xseed[2] + __rand48_mult[1] * xseed[1] + __rand48_mult[2] * xseed[0]; + accu += (unsigned int) __rand48_mult[0] * (unsigned int) xseed[2]; + accu += (unsigned int) __rand48_mult[1] * (unsigned int) xseed[1]; + accu += (unsigned int) __rand48_mult[2] * (unsigned int) xseed[0]; xseed[0] = temp[0]; xseed[1] = temp[1]; xseed[2] = (unsigned short) accu;
CVS commit: src/sbin/modstat
Module Name:src Committed By: pgoyette Date: Sat Feb 22 14:26:18 UTC 2020 Modified Files: src/sbin/modstat: modstat.8 Log Message: Clarify that the -k option only provides the address of the module's text segment. The addresses of any other segments are not available. To generate a diff of this commit: cvs rdiff -u -r1.26 -r1.27 src/sbin/modstat/modstat.8 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/modstat/modstat.8 diff -u src/sbin/modstat/modstat.8:1.26 src/sbin/modstat/modstat.8:1.27 --- src/sbin/modstat/modstat.8:1.26 Sat Dec 7 12:35:27 2019 +++ src/sbin/modstat/modstat.8 Sat Feb 22 14:26:18 2020 @@ -1,4 +1,4 @@ -.\" $NetBSD: modstat.8,v 1.26 2019/12/07 12:35:27 wiz Exp $ +.\" $NetBSD: modstat.8,v 1.27 2020/02/22 14:26:18 pgoyette Exp $ .\" .\" Copyright (c) 1993 Christopher G. Demetriou .\" All rights reserved. @@ -32,7 +32,7 @@ .\" .\" <> .\" -.Dd December 5, 2019 +.Dd Februaru 22, 2020 .Dt MODSTAT 8 .Os .Sh NAME @@ -64,7 +64,7 @@ take into consideration the sysctl .It Fl e Tells you whether or not you may load a module at the moment. .It Fl k -Display the module's kernel address (disabled by default). +Display the kernel address of the module's text segment (disabled by default). .It Fl n Ar name Display the status of only the module with this name. Please note that
CVS commit: src/sbin/modstat
Module Name:src Committed By: pgoyette Date: Sat Feb 22 14:26:18 UTC 2020 Modified Files: src/sbin/modstat: modstat.8 Log Message: Clarify that the -k option only provides the address of the module's text segment. The addresses of any other segments are not available. To generate a diff of this commit: cvs rdiff -u -r1.26 -r1.27 src/sbin/modstat/modstat.8 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/common/lib/libc/stdlib
Module Name:src Committed By: fox Date: Sat Feb 22 14:47:29 UTC 2020 Modified Files: src/common/lib/libc/stdlib: random.c Log Message: common/lib/libc/stdlib: Fix possible signed integer overflow. common/lib/libc/stdlib/random.c:482:6 can result in signed integer overflow. This bug was reported by UBSan runs. The change has been tested using the following program to generate random numbers in both the old and the new library and can be used to verify the correctness of the library after the change. #include #include #define COUNT 1000 * 1000 int main(void) { int i; FILE *fp = fopen("numbers.txt", "w"); srandom(0xdeadbeef); for(i = 0; i < COUNT; i++) { fprintf(fp, "%ld\n", random()); } fclose(fp); return 0; } Reviewed by: riastradh@ , kamil@ To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/common/lib/libc/stdlib/random.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/stdlib/random.c diff -u src/common/lib/libc/stdlib/random.c:1.5 src/common/lib/libc/stdlib/random.c:1.6 --- src/common/lib/libc/stdlib/random.c:1.5 Mon Feb 8 05:27:24 2016 +++ src/common/lib/libc/stdlib/random.c Sat Feb 22 14:47:29 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: random.c,v 1.5 2016/02/08 05:27:24 dholland Exp $ */ +/* $NetBSD: random.c,v 1.6 2020/02/22 14:47:29 fox Exp $ */ /* * Copyright (c) 1983, 1993 @@ -35,7 +35,7 @@ #if 0 static char sccsid[] = "@(#)random.c 8.2 (Berkeley) 5/19/95"; #else -__RCSID("$NetBSD: random.c,v 1.5 2016/02/08 05:27:24 dholland Exp $"); +__RCSID("$NetBSD: random.c,v 1.6 2020/02/22 14:47:29 fox Exp $"); #endif #endif /* LIBC_SCCS and not lint */ @@ -189,7 +189,7 @@ static const int seps[MAX_TYPES] = { SEP */ /* LINTED */ -static int randtbl[DEG_3 + 1] = { +static uint32_t randtbl[DEG_3 + 1] = { TYPE_3, #ifdef USE_BETTER_RANDOM 0x991539b1, 0x16a5bce3, 0x6774a4cd, @@ -232,8 +232,8 @@ static int randtbl[DEG_3 + 1] = { * in the initialization of randtbl) because the state table pointer is set * to point to randtbl[1] (as explained below). */ -static int *fptr = [SEP_3 + 1]; -static int *rptr = [1]; +static uint32_t *fptr = [SEP_3 + 1]; +static uint32_t *rptr = [1]; /* * The following things are the pointer to the state information table, the @@ -245,11 +245,11 @@ static int *rptr = [1]; * this is more efficient than indexing every time to find the address of * the last element to see if the front and rear pointers have wrapped. */ -static int *state = [1]; +static uint32_t *state = [1]; static int rand_type = TYPE_3; static int rand_deg = DEG_3; static int rand_sep = SEP_3; -static int *end_ptr = [DEG_3 + 1]; +static uint32_t *end_ptr = [DEG_3 + 1]; /* * srandom: @@ -340,17 +340,17 @@ initstate( size_t n) /* # bytes of state info */ { void *ostate = (void *)([-1]); - int *int_arg_state; + uint32_t *int_arg_state; _DIAGASSERT(arg_state != NULL); - int_arg_state = (int *)(void *)arg_state; + int_arg_state = (uint32_t *)(void *)arg_state; mutex_lock(_mutex); if (rand_type == TYPE_0) state[-1] = rand_type; else - state[-1] = MAX_TYPES * (int)(rptr - state) + rand_type; + state[-1] = MAX_TYPES * (uint32_t)(rptr - state) + rand_type; if (n < BREAK_0) { mutex_unlock(_mutex); return (NULL); @@ -375,13 +375,13 @@ initstate( rand_deg = DEG_4; rand_sep = SEP_4; } - state = (int *) (int_arg_state + 1); /* first location */ + state = (uint32_t *) (int_arg_state + 1); /* first location */ end_ptr = [rand_deg]; /* must set end_ptr before srandom */ srandom_unlocked(seed); if (rand_type == TYPE_0) int_arg_state[0] = rand_type; else - int_arg_state[0] = MAX_TYPES * (int)(rptr - state) + rand_type; + int_arg_state[0] = MAX_TYPES * (uint32_t)(rptr - state) + rand_type; mutex_unlock(_mutex); return((char *)ostate); } @@ -408,22 +408,22 @@ initstate( char * setstate(char *arg_state) /* pointer to state array */ { - int *new_state; - int type; - int rear; + uint32_t *new_state; + uint32_t type; + uint32_t rear; void *ostate = (void *)([-1]); _DIAGASSERT(arg_state != NULL); - new_state = (int *)(void *)arg_state; - type = (int)(new_state[0] % MAX_TYPES); - rear = (int)(new_state[0] / MAX_TYPES); + new_state = (uint32_t *)(void *)arg_state; + type = (uint32_t)(new_state[0] % MAX_TYPES); + rear = (uint32_t)(new_state[0] / MAX_TYPES); mutex_lock(_mutex); if (rand_type == TYPE_0) state[-1] = rand_type; else - state[-1] = MAX_TYPES * (int)(rptr - state) + rand_type; + state[-1] = MAX_TYPES * (uint32_t)(rptr - state) + rand_type; switch(type) { case TYPE_0: case TYPE_1: @@ -438,7 +438,7 @@ setstate(char *arg_state) /* pointer to mutex_unlock(_mutex); return (NULL); } - state = (int *) (new_state + 1); + state = (uint32_t *) (new_state + 1); if (rand_type !=
CVS commit: src/common/lib/libc/stdlib
Module Name:src Committed By: fox Date: Sat Feb 22 14:47:29 UTC 2020 Modified Files: src/common/lib/libc/stdlib: random.c Log Message: common/lib/libc/stdlib: Fix possible signed integer overflow. common/lib/libc/stdlib/random.c:482:6 can result in signed integer overflow. This bug was reported by UBSan runs. The change has been tested using the following program to generate random numbers in both the old and the new library and can be used to verify the correctness of the library after the change. #include #include #define COUNT 1000 * 1000 int main(void) { int i; FILE *fp = fopen("numbers.txt", "w"); srandom(0xdeadbeef); for(i = 0; i < COUNT; i++) { fprintf(fp, "%ld\n", random()); } fclose(fp); return 0; } Reviewed by: riastradh@ , kamil@ To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/common/lib/libc/stdlib/random.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/mii
Module Name:src Committed By: jmcneill Date: Sat Feb 22 18:57:09 UTC 2020 Modified Files: src/sys/dev/mii: miidevs.h miidevs_data.h Log Message: regen To generate a diff of this commit: cvs rdiff -u -r1.160 -r1.161 src/sys/dev/mii/miidevs.h cvs rdiff -u -r1.148 -r1.149 src/sys/dev/mii/miidevs_data.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/mii
Module Name:src Committed By: jmcneill Date: Sat Feb 22 18:56:57 UTC 2020 Modified Files: src/sys/dev/mii: miidevs Log Message: Add BCM54213PE To generate a diff of this commit: cvs rdiff -u -r1.162 -r1.163 src/sys/dev/mii/miidevs Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/mii
Module Name:src Committed By: jmcneill Date: Sat Feb 22 18:57:09 UTC 2020 Modified Files: src/sys/dev/mii: miidevs.h miidevs_data.h Log Message: regen To generate a diff of this commit: cvs rdiff -u -r1.160 -r1.161 src/sys/dev/mii/miidevs.h cvs rdiff -u -r1.148 -r1.149 src/sys/dev/mii/miidevs_data.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/mii/miidevs.h diff -u src/sys/dev/mii/miidevs.h:1.160 src/sys/dev/mii/miidevs.h:1.161 --- src/sys/dev/mii/miidevs.h:1.160 Wed Feb 5 06:38:36 2020 +++ src/sys/dev/mii/miidevs.h Sat Feb 22 18:57:09 2020 @@ -1,10 +1,10 @@ -/* $NetBSD: miidevs.h,v 1.160 2020/02/05 06:38:36 msaitoh Exp $ */ +/* $NetBSD: miidevs.h,v 1.161 2020/02/22 18:57:09 jmcneill Exp $ */ /* * THIS FILE AUTOMATICALLY GENERATED. DO NOT EDIT. * * generated from: - * NetBSD: miidevs,v 1.162 2020/02/05 06:38:20 msaitoh Exp + * NetBSD: miidevs,v 1.163 2020/02/22 18:56:57 jmcneill Exp */ /*- @@ -302,6 +302,8 @@ #define MII_STR_BROADCOM3_BCM53125 "BCM53125 1000BASE-T switch" #define MII_MODEL_BROADCOM3_BCM5720C 0x0036 #define MII_STR_BROADCOM3_BCM5720C "BCM5720C 1000BASE-T media interface" +#define MII_MODEL_BROADCOM4_BCM54213PE 0x000a +#define MII_STR_BROADCOM4_BCM54213PE "BCM54213PE 1000BASE-T media interface" #define MII_MODEL_BROADCOM4_BCM5725C 0x0038 #define MII_STR_BROADCOM4_BCM5725C "BCM5725C 1000BASE-T media interface" #define MII_MODEL_xxBROADCOM_ALT1_BCM5906 0x0004 Index: src/sys/dev/mii/miidevs_data.h diff -u src/sys/dev/mii/miidevs_data.h:1.148 src/sys/dev/mii/miidevs_data.h:1.149 --- src/sys/dev/mii/miidevs_data.h:1.148 Wed Feb 5 06:38:36 2020 +++ src/sys/dev/mii/miidevs_data.h Sat Feb 22 18:57:09 2020 @@ -1,10 +1,10 @@ -/* $NetBSD: miidevs_data.h,v 1.148 2020/02/05 06:38:36 msaitoh Exp $ */ +/* $NetBSD: miidevs_data.h,v 1.149 2020/02/22 18:57:09 jmcneill Exp $ */ /* * THIS FILE AUTOMATICALLY GENERATED. DO NOT EDIT. * * generated from: - * NetBSD: miidevs,v 1.162 2020/02/05 06:38:20 msaitoh Exp + * NetBSD: miidevs,v 1.163 2020/02/22 18:56:57 jmcneill Exp */ /*- @@ -118,6 +118,7 @@ struct mii_knowndev mii_knowndevs[] = { { MII_OUI_BROADCOM3, MII_MODEL_BROADCOM3_BCM57765, MII_STR_BROADCOM3_BCM57765 }, { MII_OUI_BROADCOM3, MII_MODEL_BROADCOM3_BCM53125, MII_STR_BROADCOM3_BCM53125 }, { MII_OUI_BROADCOM3, MII_MODEL_BROADCOM3_BCM5720C, MII_STR_BROADCOM3_BCM5720C }, + { MII_OUI_BROADCOM4, MII_MODEL_BROADCOM4_BCM54213PE, MII_STR_BROADCOM4_BCM54213PE }, { MII_OUI_BROADCOM4, MII_MODEL_BROADCOM4_BCM5725C, MII_STR_BROADCOM4_BCM5725C }, { MII_OUI_xxBROADCOM_ALT1, MII_MODEL_xxBROADCOM_ALT1_BCM5906, MII_STR_xxBROADCOM_ALT1_BCM5906 }, { MII_OUI_xxCICADA, MII_MODEL_xxCICADA_CIS8201, MII_STR_xxCICADA_CIS8201 },
CVS commit: src/sys/dev/mii
Module Name:src Committed By: jmcneill Date: Sat Feb 22 18:57:31 UTC 2020 Modified Files: src/sys/dev/mii: brgphy.c Log Message: Match BCM54213PE To generate a diff of this commit: cvs rdiff -u -r1.86 -r1.87 src/sys/dev/mii/brgphy.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/mii
Module Name:src Committed By: jmcneill Date: Sat Feb 22 18:56:57 UTC 2020 Modified Files: src/sys/dev/mii: miidevs Log Message: Add BCM54213PE To generate a diff of this commit: cvs rdiff -u -r1.162 -r1.163 src/sys/dev/mii/miidevs 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/mii/miidevs diff -u src/sys/dev/mii/miidevs:1.162 src/sys/dev/mii/miidevs:1.163 --- src/sys/dev/mii/miidevs:1.162 Wed Feb 5 06:38:20 2020 +++ src/sys/dev/mii/miidevs Sat Feb 22 18:56:57 2020 @@ -1,4 +1,4 @@ -$NetBSD: miidevs,v 1.162 2020/02/05 06:38:20 msaitoh Exp $ +$NetBSD: miidevs,v 1.163 2020/02/22 18:56:57 jmcneill Exp $ /*- * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc. @@ -219,6 +219,7 @@ model BROADCOM3 BCM5719C 0x0022 BCM5719C model BROADCOM3 BCM57765 0x0024 BCM57765 1000BASE-T media interface model BROADCOM3 BCM53125 0x0032 BCM53125 1000BASE-T switch model BROADCOM3 BCM5720C 0x0036 BCM5720C 1000BASE-T media interface +model BROADCOM4 BCM54213PE 0x000a BCM54213PE 1000BASE-T media interface model BROADCOM4 BCM5725C 0x0038 BCM5725C 1000BASE-T media interface model xxBROADCOM_ALT1 BCM5906 0x0004 BCM5906 10/100baseTX media interface
CVS commit: src/sys/dev/mii
Module Name:src Committed By: jmcneill Date: Sat Feb 22 18:57:31 UTC 2020 Modified Files: src/sys/dev/mii: brgphy.c Log Message: Match BCM54213PE To generate a diff of this commit: cvs rdiff -u -r1.86 -r1.87 src/sys/dev/mii/brgphy.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/mii/brgphy.c diff -u src/sys/dev/mii/brgphy.c:1.86 src/sys/dev/mii/brgphy.c:1.87 --- src/sys/dev/mii/brgphy.c:1.86 Wed Nov 27 10:19:20 2019 +++ src/sys/dev/mii/brgphy.c Sat Feb 22 18:57:31 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: brgphy.c,v 1.86 2019/11/27 10:19:20 msaitoh Exp $ */ +/* $NetBSD: brgphy.c,v 1.87 2020/02/22 18:57:31 jmcneill Exp $ */ /*- * Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc. @@ -62,7 +62,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: brgphy.c,v 1.86 2019/11/27 10:19:20 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: brgphy.c,v 1.87 2020/02/22 18:57:31 jmcneill Exp $"); #include #include @@ -178,6 +178,7 @@ static const struct mii_phydesc brgphys[ MII_PHY_DESC(BROADCOM3, BCM5720C), MII_PHY_DESC(BROADCOM3, BCM57765), MII_PHY_DESC(BROADCOM3, BCM57780), + MII_PHY_DESC(BROADCOM4, BCM54213PE), MII_PHY_DESC(BROADCOM4, BCM5725C), MII_PHY_DESC(xxBROADCOM_ALT1, BCM5906), MII_PHY_END,
CVS commit: src/usr.bin/calendar/calendars
Module Name:src Committed By: sevan Date: Sat Feb 22 19:25:25 UTC 2020 Modified Files: src/usr.bin/calendar/calendars: calendar.birthday Log Message: Add Ivan Sutherland's birthday To generate a diff of this commit: cvs rdiff -u -r1.39 -r1.40 src/usr.bin/calendar/calendars/calendar.birthday Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/usr.bin/calendar/calendars
Module Name:src Committed By: sevan Date: Sat Feb 22 19:25:25 UTC 2020 Modified Files: src/usr.bin/calendar/calendars: calendar.birthday Log Message: Add Ivan Sutherland's birthday To generate a diff of this commit: cvs rdiff -u -r1.39 -r1.40 src/usr.bin/calendar/calendars/calendar.birthday 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/calendar/calendars/calendar.birthday diff -u src/usr.bin/calendar/calendars/calendar.birthday:1.39 src/usr.bin/calendar/calendars/calendar.birthday:1.40 --- src/usr.bin/calendar/calendars/calendar.birthday:1.39 Sat Feb 22 19:23:09 2020 +++ src/usr.bin/calendar/calendars/calendar.birthday Sat Feb 22 19:25:25 2020 @@ -142,6 +142,7 @@ 05/12 Florence Nightingale born in Florence, Italy, 1820 05/13 Arthur S. Sullivan born, 1842 05/15 Mike Oldfield born in Essex, England, 1953 +05/16 Ivan Edward Sutherland was born in Hastings, Nebraska, 1938 05/19 Ho Chi Minh born, 1890 05/21 Plato (Aristocles) born in Athens(?), 427 BC 05/27 Hubert H. Humphrey born, 1911
CVS commit: src/sys/external/bsd/vchiq/dist/interface/vchiq_arm
Module Name:src Committed By: jmcneill Date: Sat Feb 22 19:37:31 UTC 2020 Modified Files: src/sys/external/bsd/vchiq/dist/interface/vchiq_arm: vchiq_netbsd_acpi.c Log Message: build fix To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 \ src/sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_netbsd_acpi.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/external/bsd/vchiq/dist/interface/vchiq_arm
Module Name:src Committed By: jmcneill Date: Sat Feb 22 19:37:31 UTC 2020 Modified Files: src/sys/external/bsd/vchiq/dist/interface/vchiq_arm: vchiq_netbsd_acpi.c Log Message: build fix To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 \ src/sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_netbsd_acpi.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_netbsd_acpi.c diff -u src/sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_netbsd_acpi.c:1.1 src/sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_netbsd_acpi.c:1.2 --- src/sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_netbsd_acpi.c:1.1 Tue Dec 31 01:00:23 2019 +++ src/sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_netbsd_acpi.c Sat Feb 22 19:37:31 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: vchiq_netbsd_acpi.c,v 1.1 2019/12/31 01:00:23 jmcneill Exp $ */ +/* $NetBSD: vchiq_netbsd_acpi.c,v 1.2 2020/02/22 19:37:31 jmcneill Exp $ */ /*- * Copyright (c) 2013 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: vchiq_netbsd_acpi.c,v 1.1 2019/12/31 01:00:23 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: vchiq_netbsd_acpi.c,v 1.2 2020/02/22 19:37:31 jmcneill Exp $"); #include #include @@ -105,7 +105,7 @@ vchiq_acpi_attach(device_t parent, devic return; } - if (bus_space_map(sc->sc_iot, mem->ar_base, mem->ar_size, 0, + if (bus_space_map(sc->sc_iot, mem->ar_base, mem->ar_length, 0, >sc_ioh) != 0) { aprint_error_dev(sc->sc_dev, "unable to map device\n"); return;
CVS commit: src/sys
Module Name:src Committed By: chs Date: Sat Feb 22 19:46:49 UTC 2020 Modified Files: src/sys/arch/xen/xen: privcmd.c src/sys/external/bsd/drm2/dist/drm/i915: i915_gem.c src/sys/external/bsd/drm2/drm: drm_gem_cma_helper.c src/sys/uvm: uvm_device.c Log Message: do not wait for memory in pgo_fault methods, just return ENOMEM and let the uvm_fault code wait if it is appropriate. To generate a diff of this commit: cvs rdiff -u -r1.51 -r1.52 src/sys/arch/xen/xen/privcmd.c cvs rdiff -u -r1.59 -r1.60 src/sys/external/bsd/drm2/dist/drm/i915/i915_gem.c cvs rdiff -u -r1.9 -r1.10 src/sys/external/bsd/drm2/drm/drm_gem_cma_helper.c cvs rdiff -u -r1.67 -r1.68 src/sys/uvm/uvm_device.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/privcmd.c diff -u src/sys/arch/xen/xen/privcmd.c:1.51 src/sys/arch/xen/xen/privcmd.c:1.52 --- src/sys/arch/xen/xen/privcmd.c:1.51 Thu Jun 22 22:36:50 2017 +++ src/sys/arch/xen/xen/privcmd.c Sat Feb 22 19:46:48 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: privcmd.c,v 1.51 2017/06/22 22:36:50 chs Exp $ */ +/* $NetBSD: privcmd.c,v 1.52 2020/02/22 19:46:48 chs Exp $ */ /*- * Copyright (c) 2004 Christian Limpach. @@ -27,7 +27,7 @@ #include -__KERNEL_RCSID(0, "$NetBSD: privcmd.c,v 1.51 2017/06/22 22:36:50 chs Exp $"); +__KERNEL_RCSID(0, "$NetBSD: privcmd.c,v 1.52 2020/02/22 19:46:48 chs Exp $"); #include #include @@ -502,7 +502,6 @@ privpgop_fault(struct uvm_faultinfo *ufi PMAP_CANFAIL | ufi->entry->protection, pobj->domid); if (error == ENOMEM) { - error = ERESTART; break; } if (error) { @@ -513,10 +512,6 @@ privpgop_fault(struct uvm_faultinfo *ufi } pmap_update(ufi->orig_map->pmap); uvmfault_unlockall(ufi, ufi->entry->aref.ar_amap, uobj); - - if (error == ERESTART) { - uvm_wait("privpgop_fault"); - } return error; } Index: src/sys/external/bsd/drm2/dist/drm/i915/i915_gem.c diff -u src/sys/external/bsd/drm2/dist/drm/i915/i915_gem.c:1.59 src/sys/external/bsd/drm2/dist/drm/i915/i915_gem.c:1.60 --- src/sys/external/bsd/drm2/dist/drm/i915/i915_gem.c:1.59 Fri Feb 14 14:34:58 2020 +++ src/sys/external/bsd/drm2/dist/drm/i915/i915_gem.c Sat Feb 22 19:46:48 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: i915_gem.c,v 1.59 2020/02/14 14:34:58 maya Exp $ */ +/* $NetBSD: i915_gem.c,v 1.60 2020/02/22 19:46:48 chs Exp $ */ /* * Copyright © 2008-2015 Intel Corporation @@ -28,7 +28,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: i915_gem.c,v 1.59 2020/02/14 14:34:58 maya Exp $"); +__KERNEL_RCSID(0, "$NetBSD: i915_gem.c,v 1.60 2020/02/22 19:46:48 chs Exp $"); #ifdef __NetBSD__ #if 0/* XXX uvmhist option? */ @@ -2052,8 +2052,6 @@ unlock: out: mutex_enter(uobj->vmobjlock); uvmfault_unlockall(ufi, ufi->entry->aref.ar_amap, uobj); - if (ret == -ERESTART) - uvm_wait("i915flt"); /* * Remap EINTR to success, so that we return to userland. @@ -2087,7 +2085,7 @@ i915_udv_fault(struct uvm_faultinfo *ufi off_t curr_offset; paddr_t paddr; u_int mmapflags; - int lcv, retval; + int lcv; vm_prot_t mapprot; UVMHIST_FUNC("i915_udv_fault"); UVMHIST_CALLED(maphist); UVMHIST_LOG(maphist," flags=%jd", flags,0,0,0); @@ -2119,7 +2117,6 @@ i915_udv_fault(struct uvm_faultinfo *ufi * loop over the page range entering in as needed */ - retval = 0; for (lcv = 0 ; lcv < npages ; lcv++, curr_offset += PAGE_SIZE, curr_va += PAGE_SIZE) { if ((flags & PGO_ALLPAGES) == 0 && lcv != centeridx) @@ -2147,12 +2144,12 @@ i915_udv_fault(struct uvm_faultinfo *ufi * XXX case. */ pmap_update(ufi->orig_map->pmap); /* sync what we have so far */ - return (ERESTART); + return ENOMEM; } } pmap_update(ufi->orig_map->pmap); - return (retval); + return 0; } #else /** Index: src/sys/external/bsd/drm2/drm/drm_gem_cma_helper.c diff -u src/sys/external/bsd/drm2/drm/drm_gem_cma_helper.c:1.9 src/sys/external/bsd/drm2/drm/drm_gem_cma_helper.c:1.10 --- src/sys/external/bsd/drm2/drm/drm_gem_cma_helper.c:1.9 Tue Nov 5 23:29:28 2019 +++ src/sys/external/bsd/drm2/drm/drm_gem_cma_helper.c Sat Feb 22 19:46:48 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: drm_gem_cma_helper.c,v 1.9 2019/11/05 23:29:28 jmcneill Exp $ */ +/* $NetBSD: drm_gem_cma_helper.c,v 1.10 2020/02/22 19:46:48 chs Exp $ */ /*- * Copyright (c) 2015-2017 Jared McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: drm_gem_cma_helper.c,v 1.9 2019/11/05 23:29:28 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: drm_gem_cma_helper.c,v 1.10 2020/02/22 19:46:48 chs Exp $"); #include #include @@ -246,8 +246,7 @@ drm_gem_cma_fault(struct uvm_faultinfo * PMAP_CANFAIL | mapprot | mmapflags) != 0) { pmap_update(ufi->orig_map->pmap); uvmfault_unlockall(ufi, ufi->entry->aref.ar_amap, uobj); - uvm_wait("drm_gem_cma_fault"); - return ERESTART; + return ENOMEM; } } Index: src/sys/uvm/uvm_device.c
CVS commit: src/sys
Module Name:src Committed By: chs Date: Sat Feb 22 19:46:49 UTC 2020 Modified Files: src/sys/arch/xen/xen: privcmd.c src/sys/external/bsd/drm2/dist/drm/i915: i915_gem.c src/sys/external/bsd/drm2/drm: drm_gem_cma_helper.c src/sys/uvm: uvm_device.c Log Message: do not wait for memory in pgo_fault methods, just return ENOMEM and let the uvm_fault code wait if it is appropriate. To generate a diff of this commit: cvs rdiff -u -r1.51 -r1.52 src/sys/arch/xen/xen/privcmd.c cvs rdiff -u -r1.59 -r1.60 src/sys/external/bsd/drm2/dist/drm/i915/i915_gem.c cvs rdiff -u -r1.9 -r1.10 src/sys/external/bsd/drm2/drm/drm_gem_cma_helper.c cvs rdiff -u -r1.67 -r1.68 src/sys/uvm/uvm_device.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: chs Date: Sat Feb 22 19:49:11 UTC 2020 Modified Files: src/sys/arch/arm/arm: fiq.c src/sys/arch/x86/acpi: acpi_wakeup.c src/sys/arch/x86/include: bus_private.h src/sys/dev/audio: audio.c Log Message: remove some unnecessary includes of internal UVM headers. To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/sys/arch/arm/arm/fiq.c cvs rdiff -u -r1.51 -r1.52 src/sys/arch/x86/acpi/acpi_wakeup.c cvs rdiff -u -r1.14 -r1.15 src/sys/arch/x86/include/bus_private.h cvs rdiff -u -r1.52 -r1.53 src/sys/dev/audio/audio.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/arm/arm/fiq.c diff -u src/sys/arch/arm/arm/fiq.c:1.8 src/sys/arch/arm/arm/fiq.c:1.9 --- src/sys/arch/arm/arm/fiq.c:1.8 Wed Jan 24 09:04:44 2018 +++ src/sys/arch/arm/arm/fiq.c Sat Feb 22 19:49:11 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: fiq.c,v 1.8 2018/01/24 09:04:44 skrll Exp $ */ +/* $NetBSD: fiq.c,v 1.9 2020/02/22 19:49:11 chs Exp $ */ /* * Copyright (c) 2001, 2002 Wasabi Systems, Inc. @@ -36,7 +36,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: fiq.c,v 1.8 2018/01/24 09:04:44 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: fiq.c,v 1.9 2020/02/22 19:49:11 chs Exp $"); #include #include @@ -44,8 +44,6 @@ __KERNEL_RCSID(0, "$NetBSD: fiq.c,v 1.8 #include #include -#include - TAILQ_HEAD(, fiqhandler) fiqhandler_stack = TAILQ_HEAD_INITIALIZER(fiqhandler_stack); Index: src/sys/arch/x86/acpi/acpi_wakeup.c diff -u src/sys/arch/x86/acpi/acpi_wakeup.c:1.51 src/sys/arch/x86/acpi/acpi_wakeup.c:1.52 --- src/sys/arch/x86/acpi/acpi_wakeup.c:1.51 Sat Oct 12 06:31:03 2019 +++ src/sys/arch/x86/acpi/acpi_wakeup.c Sat Feb 22 19:49:11 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: acpi_wakeup.c,v 1.51 2019/10/12 06:31:03 maxv Exp $ */ +/* $NetBSD: acpi_wakeup.c,v 1.52 2020/02/22 19:49:11 chs Exp $ */ /*- * Copyright (c) 2002, 2011 The NetBSD Foundation, Inc. @@ -59,7 +59,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: acpi_wakeup.c,v 1.51 2019/10/12 06:31:03 maxv Exp $"); +__KERNEL_RCSID(0, "$NetBSD: acpi_wakeup.c,v 1.52 2020/02/22 19:49:11 chs Exp $"); #include #include @@ -70,7 +70,6 @@ __KERNEL_RCSID(0, "$NetBSD: acpi_wakeup. #include #include -#include #ifdef __i386__ #include "opt_mtrr.h" Index: src/sys/arch/x86/include/bus_private.h diff -u src/sys/arch/x86/include/bus_private.h:1.14 src/sys/arch/x86/include/bus_private.h:1.15 --- src/sys/arch/x86/include/bus_private.h:1.14 Thu Sep 1 15:10:31 2011 +++ src/sys/arch/x86/include/bus_private.h Sat Feb 22 19:49:11 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: bus_private.h,v 1.14 2011/09/01 15:10:31 christos Exp $ */ +/* $NetBSD: bus_private.h,v 1.15 2020/02/22 19:49:11 chs Exp $ */ /* NetBSD: bus.h,v 1.8 2005/03/09 19:04:46 matt Exp */ /*- @@ -128,7 +128,7 @@ struct x86_bus_dma_cookie { #endif /* _BUS_PMAP_ENTER */ #if !defined(_BUS_VIRT_TO_BUS) -#include +#include static __inline bus_addr_t _bus_virt_to_bus(struct pmap *, vaddr_t); #define _BUS_VIRT_TO_BUS(pm, va) _bus_virt_to_bus((pm), (va)) Index: src/sys/dev/audio/audio.c diff -u src/sys/dev/audio/audio.c:1.52 src/sys/dev/audio/audio.c:1.53 --- src/sys/dev/audio/audio.c:1.52 Sat Feb 22 08:15:09 2020 +++ src/sys/dev/audio/audio.c Sat Feb 22 19:49:11 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: audio.c,v 1.52 2020/02/22 08:15:09 isaki Exp $ */ +/* $NetBSD: audio.c,v 1.53 2020/02/22 19:49:11 chs Exp $ */ /*- * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -142,7 +142,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.52 2020/02/22 08:15:09 isaki Exp $"); +__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.53 2020/02/22 19:49:11 chs Exp $"); #ifdef _KERNEL_OPT #include "audio.h" @@ -188,7 +188,7 @@ __KERNEL_RCSID(0, "$NetBSD: audio.c,v 1. #include -#include +#include #include "ioconf.h"
CVS commit: src/sys
Module Name:src Committed By: chs Date: Sat Feb 22 19:49:11 UTC 2020 Modified Files: src/sys/arch/arm/arm: fiq.c src/sys/arch/x86/acpi: acpi_wakeup.c src/sys/arch/x86/include: bus_private.h src/sys/dev/audio: audio.c Log Message: remove some unnecessary includes of internal UVM headers. To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/sys/arch/arm/arm/fiq.c cvs rdiff -u -r1.51 -r1.52 src/sys/arch/x86/acpi/acpi_wakeup.c cvs rdiff -u -r1.14 -r1.15 src/sys/arch/x86/include/bus_private.h cvs rdiff -u -r1.52 -r1.53 src/sys/dev/audio/audio.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/tests/lib/libc/gen
Module Name:src Committed By: kamil Date: Sat Feb 22 19:14:57 UTC 2020 Modified Files: src/tests/lib/libc/gen: Makefile Log Message: Update t_siginfo.c build rules Add logic for MKSANITIZER/MKLIBCSANITIZER checks. To generate a diff of this commit: cvs rdiff -u -r1.53 -r1.54 src/tests/lib/libc/gen/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tests/lib/libc/gen/Makefile diff -u src/tests/lib/libc/gen/Makefile:1.53 src/tests/lib/libc/gen/Makefile:1.54 --- src/tests/lib/libc/gen/Makefile:1.53 Fri Apr 26 19:17:05 2019 +++ src/tests/lib/libc/gen/Makefile Sat Feb 22 19:14:57 2020 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.53 2019/04/26 19:17:05 maya Exp $ +# $NetBSD: Makefile,v 1.54 2020/02/22 19:14:57 kamil Exp $ .include @@ -39,6 +39,10 @@ TESTS_C+= t_time TESTS_C+= t_ttyname TESTS_C+= t_vis +.if ${MKSANITIZER:Uno} != "yes" && ${MKLIBCSANITIZER:Uno} != "yes" +COPTS.t_siginfo.c+= -DENABLE_TESTS +.endif + CPPFLAGS.t_siginfo.c+=-D__TEST_FENV COPTS.t_fpsetround.c+=${${ACTIVE_CC} == "gcc":? -frounding-math :}
CVS commit: src/tests/lib/libc/gen
Module Name:src Committed By: kamil Date: Sat Feb 22 19:14:57 UTC 2020 Modified Files: src/tests/lib/libc/gen: Makefile Log Message: Update t_siginfo.c build rules Add logic for MKSANITIZER/MKLIBCSANITIZER checks. To generate a diff of this commit: cvs rdiff -u -r1.53 -r1.54 src/tests/lib/libc/gen/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/tests/modules
Module Name:src Committed By: pgoyette Date: Sat Feb 22 19:54:35 UTC 2020 Modified Files: src/tests/modules: t_modctl.c src/tests/modules/k_helper: k_helper.c Log Message: Update the t_modctl test to ensure that static evcnts are added. While here, remove the explicit call to sysctl_setup() routine, since the module infrastructure already invokes such routines automatically. To generate a diff of this commit: cvs rdiff -u -r1.15 -r1.16 src/tests/modules/t_modctl.c cvs rdiff -u -r1.6 -r1.7 src/tests/modules/k_helper/k_helper.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tests/modules/t_modctl.c diff -u src/tests/modules/t_modctl.c:1.15 src/tests/modules/t_modctl.c:1.16 --- src/tests/modules/t_modctl.c:1.15 Sat Feb 22 00:24:15 2020 +++ src/tests/modules/t_modctl.c Sat Feb 22 19:54:34 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: t_modctl.c,v 1.15 2020/02/22 00:24:15 kamil Exp $ */ +/* $NetBSD: t_modctl.c,v 1.16 2020/02/22 19:54:34 pgoyette Exp $ */ /* * Copyright (c) 2008 The NetBSD Foundation, Inc. * All rights reserved. @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: t_modctl.c,v 1.15 2020/02/22 00:24:15 kamil Exp $"); +__KERNEL_RCSID(0, "$NetBSD: t_modctl.c,v 1.16 2020/02/22 19:54:34 pgoyette Exp $"); #include #include @@ -39,18 +39,20 @@ __KERNEL_RCSID(0, "$NetBSD: t_modctl.c,v #include #include #include +#include #include #include -enum presence_check { both_checks, stat_check, sysctl_check }; +enum presence_check { all_checks, stat_check, sysctl_check, evcnt_check }; static void check_permission(void); static bool get_modstat_info(const char *, modstat_t *); static bool get_sysctl(const char *, void *buf, const size_t); static bool k_helper_is_present_stat(void); static bool k_helper_is_present_sysctl(void); +static bool k_helper_is_present_evcnt(void); static bool k_helper_is_present(enum presence_check); static int load(prop_dictionary_t, bool, const char *, ...); static int unload(const char *, bool); @@ -173,6 +175,56 @@ k_helper_is_present_sysctl(void) /* * Returns a boolean indicating if the k_helper module was loaded + * successfully. This implementation uses the module's evcnt + * to do the check. + */ +static bool +k_helper_is_present_evcnt(void) +{ + const int mib[4] = {CTL_KERN, KERN_EVCNT, EVCNT_TYPE_ANY, + KERN_EVCNT_COUNT_ANY }; + int error; + size_t newlen, buflen = 0; + void *buf0, *buf = NULL; + const struct evcnt_sysctl *evs, *last_evs; + + for (;;) { + if (buflen) + buf = malloc(buflen); + error = sysctl(mib, __arraycount(mib), buf, , NULL, 0); + if (error) { + if (buf) +free(buf); + return false; + } + if (newlen <= buflen) { + buflen = newlen; + break; + } + if (buf) + free(buf); + buflen = newlen; + } + evs = buf0 = buf; + last_evs = (void *)((char *)buf + buflen); + buflen /= sizeof(uint64_t); + while (evs < last_evs + && buflen >= sizeof(*evs)/sizeof(uint64_t) + && buflen >= evs->ev_len) { + if ( strncmp(evs->ev_strings, "k_helper", evs->ev_grouplen) + == 0) { + free(buf); + return true; + } + buflen -= evs->ev_len; + evs = (const void *)((const uint64_t *)evs + evs->ev_len); + } + free(buf); + return false; +} + +/* + * Returns a boolean indicating if the k_helper module was loaded * successfully. The 'how' parameter specifies the implementation to * use to do the check. */ @@ -182,9 +234,10 @@ k_helper_is_present(enum presence_check bool found; switch (how) { - case both_checks: + case all_checks: found = k_helper_is_present_stat(); ATF_CHECK(k_helper_is_present_sysctl() == found); + ATF_CHECK(k_helper_is_present_evcnt() == found); break; case stat_check: @@ -195,6 +248,10 @@ k_helper_is_present(enum presence_check found = k_helper_is_present_sysctl(); break; + case evcnt_check: + found = k_helper_is_present_evcnt(); + break; + default: found = false; assert(found); @@ -435,11 +492,11 @@ ATF_TC_HEAD(cmd_stat, tc) } ATF_TC_BODY(cmd_stat, tc) { - ATF_CHECK(!k_helper_is_present(both_checks)); + ATF_CHECK(!k_helper_is_present(all_checks)); load(NULL, true, "%s/k_helper/k_helper.kmod", atf_tc_get_config_var(tc, "srcdir")); - ATF_CHECK(k_helper_is_present(both_checks)); + ATF_CHECK(k_helper_is_present(all_checks)); { modstat_t ms; ATF_CHECK(get_modstat_info("k_helper", )); @@ -450,7 +507,7 @@ ATF_TC_BODY(cmd_stat, tc) } unload("k_helper", true); - ATF_CHECK(!k_helper_is_present(both_checks)); + ATF_CHECK(!k_helper_is_present(all_checks)); } ATF_TC_CLEANUP(cmd_stat, tc) { Index: src/tests/modules/k_helper/k_helper.c diff -u src/tests/modules/k_helper/k_helper.c:1.6 src/tests/modules/k_helper/k_helper.c:1.7 --- src/tests/modules/k_helper/k_helper.c:1.6 Sun Jun 3 10:59:44 2012 +++ src/tests/modules/k_helper/k_helper.c Sat Feb 22 19:54:35 2020 @@ -1,4 +1,4 @@ -/* $NetBSD:
CVS commit: src/tests/modules
Module Name:src Committed By: pgoyette Date: Sat Feb 22 19:54:35 UTC 2020 Modified Files: src/tests/modules: t_modctl.c src/tests/modules/k_helper: k_helper.c Log Message: Update the t_modctl test to ensure that static evcnts are added. While here, remove the explicit call to sysctl_setup() routine, since the module infrastructure already invokes such routines automatically. To generate a diff of this commit: cvs rdiff -u -r1.15 -r1.16 src/tests/modules/t_modctl.c cvs rdiff -u -r1.6 -r1.7 src/tests/modules/k_helper/k_helper.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/alpha/alpha
Module Name:src Committed By: thorpej Date: Sat Feb 22 17:33:42 UTC 2020 Modified Files: src/sys/arch/alpha/alpha: machdep.c Log Message: Make it clear that the pfn argument to alpha_init() is no longer used. To generate a diff of this commit: cvs rdiff -u -r1.357 -r1.358 src/sys/arch/alpha/alpha/machdep.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/alpha/alpha/machdep.c diff -u src/sys/arch/alpha/alpha/machdep.c:1.357 src/sys/arch/alpha/alpha/machdep.c:1.358 --- src/sys/arch/alpha/alpha/machdep.c:1.357 Tue Dec 31 13:07:09 2019 +++ src/sys/arch/alpha/alpha/machdep.c Sat Feb 22 17:33:42 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.357 2019/12/31 13:07:09 ad Exp $ */ +/* $NetBSD: machdep.c,v 1.358 2020/02/22 17:33:42 thorpej Exp $ */ /*- * Copyright (c) 1998, 1999, 2000, 2019 The NetBSD Foundation, Inc. @@ -67,7 +67,7 @@ #include /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.357 2019/12/31 13:07:09 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.358 2020/02/22 17:33:42 thorpej Exp $"); #include #include @@ -216,8 +216,9 @@ const pcu_ops_t * const pcu_ops_md_defs[ }; void -alpha_init(u_long pfn, u_long ptb, u_long bim, u_long bip, u_long biv) - /* pfn: first free PFN number */ +alpha_init(u_long xxx_pfn __unused, u_long ptb, u_long bim, u_long bip, +u_long biv) + /* pfn: first free PFN number (no longer used) */ /* ptb: PFN of current level 1 page table */ /* bim: bootinfo magic */ /* bip: bootinfo pointer */
CVS commit: src/sys/arch/alpha/alpha
Module Name:src Committed By: thorpej Date: Sat Feb 22 17:33:42 UTC 2020 Modified Files: src/sys/arch/alpha/alpha: machdep.c Log Message: Make it clear that the pfn argument to alpha_init() is no longer used. To generate a diff of this commit: cvs rdiff -u -r1.357 -r1.358 src/sys/arch/alpha/alpha/machdep.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch/evbarm/conf
Module Name:src Committed By: jmcneill Date: Sat Feb 22 18:57:50 UTC 2020 Modified Files: src/sys/arch/evbarm/conf: GENERIC64 Log Message: Add brgphy To generate a diff of this commit: cvs rdiff -u -r1.139 -r1.140 src/sys/arch/evbarm/conf/GENERIC64 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/evbarm/conf/GENERIC64 diff -u src/sys/arch/evbarm/conf/GENERIC64:1.139 src/sys/arch/evbarm/conf/GENERIC64:1.140 --- src/sys/arch/evbarm/conf/GENERIC64:1.139 Sat Feb 22 02:28:06 2020 +++ src/sys/arch/evbarm/conf/GENERIC64 Sat Feb 22 18:57:50 2020 @@ -1,5 +1,5 @@ # -# $NetBSD: GENERIC64,v 1.139 2020/02/22 02:28:06 jmcneill Exp $ +# $NetBSD: GENERIC64,v 1.140 2020/02/22 18:57:50 jmcneill Exp $ # # GENERIC ARM (aarch64) kernel # @@ -337,6 +337,7 @@ wm* at pci? dev ? function ? # Intel Gi # MII/PHY support atphy* at mii? phy ? # Attansic/Atheros PHYs +brgphy* at mii? phy ? # Broadcom BCM5400-family PHYs exphy* at mii? phy ? # 3Com internal PHYs gentbi* at mii? phy ? # Generic Ten-Bit 1000BASE-[CLS]X PHYs glxtphy* at mii? phy ? # Level One LXT-1000 PHYs
CVS commit: src/sys/arch/evbarm/conf
Module Name:src Committed By: jmcneill Date: Sat Feb 22 18:57:50 UTC 2020 Modified Files: src/sys/arch/evbarm/conf: GENERIC64 Log Message: Add brgphy To generate a diff of this commit: cvs rdiff -u -r1.139 -r1.140 src/sys/arch/evbarm/conf/GENERIC64 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/tests/lib/libc/gen
Module Name:src Committed By: kamil Date: Sat Feb 22 19:09:51 UTC 2020 Modified Files: src/tests/lib/libc/gen: t_siginfo.c Log Message: Disable the t_siginfo test under MKSANITIZER / MKLIBCSANITIZER Signal crash events are incompatible with sanitizers. To generate a diff of this commit: cvs rdiff -u -r1.38 -r1.39 src/tests/lib/libc/gen/t_siginfo.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tests/lib/libc/gen/t_siginfo.c diff -u src/tests/lib/libc/gen/t_siginfo.c:1.38 src/tests/lib/libc/gen/t_siginfo.c:1.39 --- src/tests/lib/libc/gen/t_siginfo.c:1.38 Fri Feb 21 22:25:50 2020 +++ src/tests/lib/libc/gen/t_siginfo.c Sat Feb 22 19:09:51 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: t_siginfo.c,v 1.38 2020/02/21 22:25:50 kamil Exp $ */ +/* $NetBSD: t_siginfo.c,v 1.39 2020/02/22 19:09:51 kamil Exp $ */ /*- * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -53,6 +53,7 @@ #include "isqemu.h" +#ifdef ENABLE_TESTS /* for sigbus */ volatile char *addr; @@ -361,18 +362,6 @@ ATF_TC_HEAD(sigfpe_int, tc) "for integer div-by-zero (PR port-i386/43655)"); } -#if defined(__clang__) -__attribute__((no_sanitize("undefined"))) -#else -__attribute__((no_sanitize_undefined)) -#endif -static long int -sigfpe_int_division(long int a, long int b) -{ - - return a / b; -} - ATF_TC_BODY(sigfpe_int, tc) { struct sigaction sa; @@ -391,7 +380,7 @@ ATF_TC_BODY(sigfpe_int, tc) #elif defined(_FLOAT_IEEE754) fpsetmask(FP_X_INV|FP_X_DZ|FP_X_OFL|FP_X_UFL|FP_X_IMP); #endif - printf("%ld\n", sigfpe_int_division(1, l)); + printf("%ld\n", 1 / l); } if (intdiv_signalled == 0) atf_tc_fail("FPE signal handler was not invoked"); @@ -508,9 +497,25 @@ ATF_TC_BODY(sigbus_adraln, tc) atf_tc_fail("Test did not fault as expected"); } +#else +ATF_TC(dummy); +ATF_TC_HEAD(dummy, tc) +{ + atf_tc_set_md_var(tc, "descr", "A dummy test"); +} + +ATF_TC_BODY(dummy, tc) +{ + + // Dummy, skipped + // The ATF framework requires at least a single defined test. +} +#endif + ATF_TP_ADD_TCS(tp) { +#ifdef ENABLE_TESTS ATF_TP_ADD_TC(tp, sigalarm); ATF_TP_ADD_TC(tp, sigchild_normal); ATF_TP_ADD_TC(tp, sigchild_dump); @@ -519,6 +524,9 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, sigfpe_int); ATF_TP_ADD_TC(tp, sigsegv); ATF_TP_ADD_TC(tp, sigbus_adraln); +#else + ATF_TP_ADD_TC(tp, dummy); +#endif return atf_no_error(); }
CVS commit: src/tests/lib/libc/gen
Module Name:src Committed By: kamil Date: Sat Feb 22 19:09:51 UTC 2020 Modified Files: src/tests/lib/libc/gen: t_siginfo.c Log Message: Disable the t_siginfo test under MKSANITIZER / MKLIBCSANITIZER Signal crash events are incompatible with sanitizers. To generate a diff of this commit: cvs rdiff -u -r1.38 -r1.39 src/tests/lib/libc/gen/t_siginfo.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: pgoyette Date: Sat Feb 22 19:51:57 UTC 2020 Modified Files: src/sys/kern: kern_module.c Log Message: Teach module infrastructure to attach any static evcnts that might be defined in a module, similar to the automatic invocation of sysctl(9) setup functions. As requested by riastradh@ To generate a diff of this commit: cvs rdiff -u -r1.146 -r1.147 src/sys/kern/kern_module.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_module.c diff -u src/sys/kern/kern_module.c:1.146 src/sys/kern/kern_module.c:1.147 --- src/sys/kern/kern_module.c:1.146 Wed Jan 22 22:39:27 2020 +++ src/sys/kern/kern_module.c Sat Feb 22 19:51:57 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: kern_module.c,v 1.146 2020/01/22 22:39:27 pgoyette Exp $ */ +/* $NetBSD: kern_module.c,v 1.147 2020/02/22 19:51:57 pgoyette Exp $ */ /*- * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -34,7 +34,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: kern_module.c,v 1.146 2020/01/22 22:39:27 pgoyette Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_module.c,v 1.147 2020/02/22 19:51:57 pgoyette Exp $"); #define _MODULE_INTERNAL @@ -56,6 +56,7 @@ __KERNEL_RCSID(0, "$NetBSD: kern_module. #include #include #include +#include #include @@ -983,8 +984,72 @@ module_load_sysctl(module_t *mod) ls_funcp++; } } - else - error = 0; /* no setup funcs registered */ +} + +/* + * module_load_evcnt + * + * Check to see if a non-builtin module has any static evcnt's defined; + * if so, attach them. + */ + +static void +module_load_evcnt(module_t *mod) +{ + struct evcnt * const *ls_evp; + void *ls_start; + size_t ls_size, count; + int error; + + /* + * Built-in modules' static evcnt stuff will be handled + * automatically as part of general kernel initialization + */ + if (mod->mod_source == MODULE_SOURCE_KERNEL) + return; + + error = kobj_find_section(mod->mod_kobj, "link_set_evcnts", + _start, _size); + if (error == 0) { + count = ls_size / sizeof(*ls_evp); + ls_evp = ls_start; + while (count--) { + evcnt_attach_static(*ls_evp++); + } + } +} + +/* + * module_unload_evcnt + * + * Check to see if a non-builtin module has any static evcnt's defined; + * if so, detach them. + */ + +static void +module_unload_evcnt(module_t *mod) +{ + struct evcnt * const *ls_evp; + void *ls_start; + size_t ls_size, count; + int error; + + /* + * Built-in modules' static evcnt stuff will be handled + * automatically as part of general kernel initialization + */ + if (mod->mod_source == MODULE_SOURCE_KERNEL) + return; + + error = kobj_find_section(mod->mod_kobj, "link_set_evcnts", + _start, _size); + if (error == 0) { + count = ls_size / sizeof(*ls_evp); + ls_evp = (void *)((char *)ls_start + ls_size); + while (count--) { + evcnt_detach(*--ls_evp); + } + } } /* @@ -1307,6 +1372,7 @@ module_do_load(const char *name, bool is } module_load_sysctl(mod); /* Set-up module's sysctl if any */ + module_load_evcnt(mod); /* Attach any static evcnt needed */ /* * Good, the module loaded successfully. Put it onto the @@ -1395,10 +1461,12 @@ module_do_unload(const char *name, bool if (mod->mod_sysctllog) { sysctl_teardown(>mod_sysctllog); } + module_unload_evcnt(mod); error = (*mod->mod_info->mi_modcmd)(MODULE_CMD_FINI, NULL); module_active = prev_active; if (error != 0) { module_load_sysctl(mod); /* re-enable sysctl stuff */ + module_load_evcnt(mod); /* and reenable evcnts */ module_print("cannot unload module `%s' error=%d", name, error); return error;
CVS commit: src/sys/kern
Module Name:src Committed By: pgoyette Date: Sat Feb 22 19:51:57 UTC 2020 Modified Files: src/sys/kern: kern_module.c Log Message: Teach module infrastructure to attach any static evcnts that might be defined in a module, similar to the automatic invocation of sysctl(9) setup functions. As requested by riastradh@ To generate a diff of this commit: cvs rdiff -u -r1.146 -r1.147 src/sys/kern/kern_module.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/games/fortune/datfiles
Module Name:src Committed By: sevan Date: Sat Feb 22 19:03:04 UTC 2020 Modified Files: src/games/fortune/datfiles: fortunes Log Message: Andrew Weatherall's tattoo and a track on A Pox On The Pioneers album. https://pbs.twimg.com/media/ERAuddhU4AAFv3w?format=jpg=orig Story: https://www.dummymag.com/features/andrew-weatherall-interview-it-s-bollocks-it-s-discos-tell-me-tales-of-the/ To generate a diff of this commit: cvs rdiff -u -r1.87 -r1.88 src/games/fortune/datfiles/fortunes Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/games/fortune/datfiles/fortunes diff -u src/games/fortune/datfiles/fortunes:1.87 src/games/fortune/datfiles/fortunes:1.88 --- src/games/fortune/datfiles/fortunes:1.87 Sun Feb 16 23:14:19 2020 +++ src/games/fortune/datfiles/fortunes Sat Feb 22 19:03:04 2020 @@ -16292,3 +16292,5 @@ I wonder why I wonder! % Fanfare, n.: The food available for consumption at a con. +% +Fail we may, sail we must
CVS commit: src/games/fortune/datfiles
Module Name:src Committed By: sevan Date: Sat Feb 22 19:03:04 UTC 2020 Modified Files: src/games/fortune/datfiles: fortunes Log Message: Andrew Weatherall's tattoo and a track on A Pox On The Pioneers album. https://pbs.twimg.com/media/ERAuddhU4AAFv3w?format=jpg=orig Story: https://www.dummymag.com/features/andrew-weatherall-interview-it-s-bollocks-it-s-discos-tell-me-tales-of-the/ To generate a diff of this commit: cvs rdiff -u -r1.87 -r1.88 src/games/fortune/datfiles/fortunes Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/usr.bin/calendar/calendars
Module Name:src Committed By: sevan Date: Sat Feb 22 19:23:09 UTC 2020 Modified Files: src/usr.bin/calendar/calendars: calendar.birthday Log Message: Add Bert Sutherland https://twitter.com/ComputerHistory/status/1230200277141250050 To generate a diff of this commit: cvs rdiff -u -r1.38 -r1.39 src/usr.bin/calendar/calendars/calendar.birthday 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/calendar/calendars/calendar.birthday diff -u src/usr.bin/calendar/calendars/calendar.birthday:1.38 src/usr.bin/calendar/calendars/calendar.birthday:1.39 --- src/usr.bin/calendar/calendars/calendar.birthday:1.38 Sat Feb 22 19:21:40 2020 +++ src/usr.bin/calendar/calendars/calendar.birthday Sat Feb 22 19:23:09 2020 @@ -63,6 +63,7 @@ 02/17 Marion Anderson born, 1902 02/17 T. J. Watson, Sr. born, 1874 02/18 Ernst Mach born, 1838, philosopher & optics pioneer +02/18 William Robert "Bert" Sutherland died in Mountain View, California, 2020 02/19 Nicolas Copernicus born in Thorn, Poland, 1473 02/20 Ludwig Boltzmann born, 1838, atomic physics pioneer 02/21 Alexis De Rochon born, 1838, developed the spyglass @@ -134,6 +135,7 @@ 05/02 Dr. Benjamin Spock born, 1903 05/09 Pinza died, 1957 05/10 Fred Astaire (Frederick Austerlitz) born in Omaha, Nebraska, 1899 +05/10 William Robert "Bert" Sutherland was born in Hastings, Nebraska, 1936 05/11 Douglas Adams died, 2001 05/11 Johnny Appleseed born, 1768 05/11 Richard Philips Feynman was born is Queens, New York, 1918
CVS commit: src/usr.bin/calendar/calendars
Module Name:src Committed By: sevan Date: Sat Feb 22 19:23:09 UTC 2020 Modified Files: src/usr.bin/calendar/calendars: calendar.birthday Log Message: Add Bert Sutherland https://twitter.com/ComputerHistory/status/1230200277141250050 To generate a diff of this commit: cvs rdiff -u -r1.38 -r1.39 src/usr.bin/calendar/calendars/calendar.birthday Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/usr.bin/calendar/calendars
Module Name:src Committed By: sevan Date: Sat Feb 22 19:21:41 UTC 2020 Modified Files: src/usr.bin/calendar/calendars: calendar.birthday Log Message: Add Larry Tesler https://www.nytimes.com/2020/02/20/technology/lawrence-tesler-dead.html To generate a diff of this commit: cvs rdiff -u -r1.37 -r1.38 src/usr.bin/calendar/calendars/calendar.birthday Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/usr.bin/calendar/calendars
Module Name:src Committed By: sevan Date: Sat Feb 22 19:21:41 UTC 2020 Modified Files: src/usr.bin/calendar/calendars: calendar.birthday Log Message: Add Larry Tesler https://www.nytimes.com/2020/02/20/technology/lawrence-tesler-dead.html To generate a diff of this commit: cvs rdiff -u -r1.37 -r1.38 src/usr.bin/calendar/calendars/calendar.birthday 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/calendar/calendars/calendar.birthday diff -u src/usr.bin/calendar/calendars/calendar.birthday:1.37 src/usr.bin/calendar/calendars/calendar.birthday:1.38 --- src/usr.bin/calendar/calendars/calendar.birthday:1.37 Thu Jan 30 23:46:21 2020 +++ src/usr.bin/calendar/calendars/calendar.birthday Sat Feb 22 19:21:40 2020 @@ -57,6 +57,7 @@ 02/15 Galileo Galilei born in Pisa, Italy, 1564 02/15 Richard Philips Feynman died in Los Angeles, California, 1988 02/15 Susan B. Anthony born, 1820 +02/16 Lawrence Gordon Tesler died in Portola Valley, California, 2020 02/16 Pierre Bouguer born, 1698, founder of photometry 02/17 Frederick Eugene Ives born, 1856, pioneer of halftone 02/17 Marion Anderson born, 1902 @@ -122,6 +123,7 @@ 04/15 Leonardo da Vinci born, 1452 04/16 Charles (Charlie) Chaplin (Sir) born in London, 1889 04/22 Immanuel Kant born, 1724 +04/24 Lawrence Gordon Tesler was born in The Bronx, New York City, 1945 04/27 Louis Victor de Broglie born, 1774, physicist 04/28 James Monroe born, 1758 04/29 Jules Henri Poincare born, 1854, founder of topology
CVS commit: src/tests/lib/libc/sys
Module Name:src Committed By: kamil Date: Sat Feb 22 19:44:07 UTC 2020 Modified Files: src/tests/lib/libc/sys: Makefile t_ptrace_wait.c t_ptrace_wait.h Log Message: Disable t_ptrace_wait* tests for MKSANITIZER/MKLIBCSANITIZER A subset of tests is not compatible with the sanitizers. To generate a diff of this commit: cvs rdiff -u -r1.57 -r1.58 src/tests/lib/libc/sys/Makefile cvs rdiff -u -r1.164 -r1.165 src/tests/lib/libc/sys/t_ptrace_wait.c cvs rdiff -u -r1.21 -r1.22 src/tests/lib/libc/sys/t_ptrace_wait.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/tests/lib/libc/sys
Module Name:src Committed By: kamil Date: Sat Feb 22 19:44:07 UTC 2020 Modified Files: src/tests/lib/libc/sys: Makefile t_ptrace_wait.c t_ptrace_wait.h Log Message: Disable t_ptrace_wait* tests for MKSANITIZER/MKLIBCSANITIZER A subset of tests is not compatible with the sanitizers. To generate a diff of this commit: cvs rdiff -u -r1.57 -r1.58 src/tests/lib/libc/sys/Makefile cvs rdiff -u -r1.164 -r1.165 src/tests/lib/libc/sys/t_ptrace_wait.c cvs rdiff -u -r1.21 -r1.22 src/tests/lib/libc/sys/t_ptrace_wait.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tests/lib/libc/sys/Makefile diff -u src/tests/lib/libc/sys/Makefile:1.57 src/tests/lib/libc/sys/Makefile:1.58 --- src/tests/lib/libc/sys/Makefile:1.57 Sun Jun 30 21:20:04 2019 +++ src/tests/lib/libc/sys/Makefile Sat Feb 22 19:44:07 2020 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.57 2019/06/30 21:20:04 mgorny Exp $ +# $NetBSD: Makefile,v 1.58 2020/02/22 19:44:07 kamil Exp $ MKMAN= no @@ -110,6 +110,15 @@ CPPFLAGS.t_ptrace_waitid.c += -D_KERNTYP CPPFLAGS.t_ptrace_waitpid.c += -D_KERNTYPES -D__TEST_FENV CPPFLAGS.t_ucontext.c += -D_KERNTYPES +.if ${MKSANITIZER:Uno} != "yes" && ${MKLIBCSANITIZER:Uno} != "yes" +CPPFLAGS.t_ptrace_wait.c += -DENABLE_TESTS +CPPFLAGS.t_ptrace_wait3.c += -DENABLE_TESTS +CPPFLAGS.t_ptrace_wait4.c += -DENABLE_TESTS +CPPFLAGS.t_ptrace_wait6.c += -DENABLE_TESTS +CPPFLAGS.t_ptrace_waitid.c += -DENABLE_TESTS +CPPFLAGS.t_ptrace_waitpid.c += -DENABLE_TESTS +.endif + FILES= truncate_test.root_owned FILESBUILD= yes FILESDIR_truncate_test.root_owned= ${TESTSDIR} Index: src/tests/lib/libc/sys/t_ptrace_wait.c diff -u src/tests/lib/libc/sys/t_ptrace_wait.c:1.164 src/tests/lib/libc/sys/t_ptrace_wait.c:1.165 --- src/tests/lib/libc/sys/t_ptrace_wait.c:1.164 Thu Feb 20 22:38:54 2020 +++ src/tests/lib/libc/sys/t_ptrace_wait.c Sat Feb 22 19:44:07 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: t_ptrace_wait.c,v 1.164 2020/02/20 22:38:54 kamil Exp $ */ +/* $NetBSD: t_ptrace_wait.c,v 1.165 2020/02/22 19:44:07 kamil Exp $ */ /*- * Copyright (c) 2016, 2017, 2018, 2019 The NetBSD Foundation, Inc. @@ -27,7 +27,7 @@ */ #include -__RCSID("$NetBSD: t_ptrace_wait.c,v 1.164 2020/02/20 22:38:54 kamil Exp $"); +__RCSID("$NetBSD: t_ptrace_wait.c,v 1.165 2020/02/22 19:44:07 kamil Exp $"); #define __LEGACY_PT_LWPINFO @@ -76,6 +76,8 @@ __RCSID("$NetBSD: t_ptrace_wait.c,v 1.16 #include +#ifdef ENABLE_TESTS + /* Assumptions in the kernel code that must be kept. */ static_assert(sizeof(((struct ptrace_state *)0)->pe_report_event) == sizeof(((siginfo_t *)0)->si_pe_report_event), @@ -9016,11 +9018,29 @@ THREAD_CONCURRENT_TEST(thread_concurrent #include "t_ptrace_i386_wait.h" #include "t_ptrace_x86_wait.h" +/// + +#else +ATF_TC(dummy); +ATF_TC_HEAD(dummy, tc) +{ + atf_tc_set_md_var(tc, "descr", "A dummy test"); +} + +ATF_TC_BODY(dummy, tc) +{ + + // Dummy, skipped + // The ATF framework requires at least a single defined test. +} +#endif + ATF_TP_ADD_TCS(tp) { setvbuf(stdout, NULL, _IONBF, 0); setvbuf(stderr, NULL, _IONBF, 0); +#ifdef ENABLE_TESTS ATF_TP_ADD_TC(tp, traceme_raise1); ATF_TP_ADD_TC(tp, traceme_raise2); ATF_TP_ADD_TC(tp, traceme_raise3); @@ -9620,5 +9640,9 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TCS_PTRACE_WAIT_I386(); ATF_TP_ADD_TCS_PTRACE_WAIT_X86(); +#else + ATF_TP_ADD_TC(tp, dummy); +#endif + return atf_no_error(); } Index: src/tests/lib/libc/sys/t_ptrace_wait.h diff -u src/tests/lib/libc/sys/t_ptrace_wait.h:1.21 src/tests/lib/libc/sys/t_ptrace_wait.h:1.22 --- src/tests/lib/libc/sys/t_ptrace_wait.h:1.21 Thu Feb 13 13:38:44 2020 +++ src/tests/lib/libc/sys/t_ptrace_wait.h Sat Feb 22 19:44:07 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: t_ptrace_wait.h,v 1.21 2020/02/13 13:38:44 kamil Exp $ */ +/* $NetBSD: t_ptrace_wait.h,v 1.22 2020/02/22 19:44:07 kamil Exp $ */ /*- * Copyright (c) 2016, 2017, 2018, 2019 The NetBSD Foundation, Inc. @@ -606,11 +606,6 @@ trigger_trap(void) #endif } -#if defined(__clang__) -__attribute__((no_sanitize("undefined"))) -#else -__attribute__((no_sanitize_undefined)) -#endif static void __used trigger_segv(void) { @@ -647,11 +642,6 @@ are_fpu_exceptions_supported(void) return true; } -#if defined(__clang__) -__attribute__((no_sanitize("undefined"))) -#else -__attribute__((no_sanitize_undefined)) -#endif static void __used trigger_fpe(void) {
CVS commit: src/sys/arch/alpha/alpha
Module Name:src Committed By: thorpej Date: Sat Feb 22 20:29:16 UTC 2020 Modified Files: src/sys/arch/alpha/alpha: machdep.c Log Message: Fix a couple of printf formats in debug messages. To generate a diff of this commit: cvs rdiff -u -r1.358 -r1.359 src/sys/arch/alpha/alpha/machdep.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/alpha/alpha/machdep.c diff -u src/sys/arch/alpha/alpha/machdep.c:1.358 src/sys/arch/alpha/alpha/machdep.c:1.359 --- src/sys/arch/alpha/alpha/machdep.c:1.358 Sat Feb 22 17:33:42 2020 +++ src/sys/arch/alpha/alpha/machdep.c Sat Feb 22 20:29:15 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.358 2020/02/22 17:33:42 thorpej Exp $ */ +/* $NetBSD: machdep.c,v 1.359 2020/02/22 20:29:15 thorpej Exp $ */ /*- * Copyright (c) 1998, 1999, 2000, 2019 The NetBSD Foundation, Inc. @@ -67,7 +67,7 @@ #include /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.358 2020/02/22 17:33:42 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.359 2020/02/22 20:29:15 thorpej Exp $"); #include #include @@ -457,7 +457,7 @@ nobootinfo: } #if 0 - printf("Memory cluster count: %d\n", mddtp->mddt_cluster_cnt); + printf("Memory cluster count: %" PRIu64 "\n", mddtp->mddt_cluster_cnt); #endif for (i = 0; i < mddtp->mddt_cluster_cnt; i++) { @@ -601,7 +601,7 @@ nobootinfo: maxmem = physmem; #if 0 printf("totalphysmem = %d\n", totalphysmem); - printf("physmem = %d\n", physmem); + printf("physmem = %lu\n", physmem); printf("resvmem = %d\n", resvmem); printf("unusedmem = %d\n", unusedmem); printf("unknownmem = %d\n", unknownmem);