CVS commit: src/usr.sbin/fstyp
Module Name:src Committed By: tkusumi Date: Fri Jan 3 08:19:14 UTC 2020 Modified Files: src/usr.sbin/fstyp: hammer.c Log Message: fstyp: Cleanup hammer.c (sync with recent DragonFly commit) taken-from DragonFlyBSD 8ca6d8ec5f97032765692d368db80159c97adea0 To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/usr.sbin/fstyp/hammer.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.sbin/fstyp/hammer.c diff -u src/usr.sbin/fstyp/hammer.c:1.1 src/usr.sbin/fstyp/hammer.c:1.2 --- src/usr.sbin/fstyp/hammer.c:1.1 Wed Jan 1 08:56:41 2020 +++ src/usr.sbin/fstyp/hammer.c Fri Jan 3 08:19:14 2020 @@ -1,4 +1,4 @@ -/*$NetBSD: hammer.c,v 1.1 2020/01/01 08:56:41 tkusumi Exp $ */ +/*$NetBSD: hammer.c,v 1.2 2020/01/03 08:19:14 tkusumi Exp $ */ /*- * Copyright (c) 2016-2019 The DragonFly Project @@ -27,7 +27,7 @@ * SUCH DAMAGE. */ #include -__KERNEL_RCSID(0, "$NetBSD: hammer.c,v 1.1 2020/01/01 08:56:41 tkusumi Exp $"); +__KERNEL_RCSID(0, "$NetBSD: hammer.c,v 1.2 2020/01/03 08:19:14 tkusumi Exp $"); #include #include @@ -97,11 +97,11 @@ fstyp_hammer(FILE *fp, char *label, size #endif ondisk = read_ondisk(fp); if (ondisk->vol_no != HAMMER_ROOT_VOLNO) - goto done; + goto fail; if (ondisk->vol_count != 1) - goto done; + goto fail; if (test_ondisk(ondisk)) - goto done; + goto fail; /* * fstyp_function in DragonFly takes an additional devpath argument @@ -122,7 +122,7 @@ fstyp_hammer(FILE *fp, char *label, size strlcpy(label, ondisk->vol_label, size); #endif error = 0; -done: +fail: free(ondisk); return (error); } @@ -140,10 +140,10 @@ test_volume(const char *volpath) ondisk = read_ondisk(fp); fclose(fp); if (test_ondisk(ondisk)) - goto done; + goto fail; volno = ondisk->vol_no; -done: +fail: free(ondisk); return (volno); } @@ -151,22 +151,28 @@ done: static int __fsvtyp_hammer(const char *blkdevs, char *label, size_t size, int partial) { - hammer_volume_ondisk_t ondisk; + hammer_volume_ondisk_t ondisk = NULL; FILE *fp; char *dup, *p, *volpath, x[HAMMER_MAX_VOLUMES]; int i, volno, error = 1; + if (!blkdevs) + goto fail; + memset(x, 0, sizeof(x)); dup = strdup(blkdevs); p = dup; volpath = NULL; + volno = -1; while (p) { volpath = p; if ((p = strchr(p, ':')) != NULL) *p++ = '\0'; if ((volno = test_volume(volpath)) == -1) break; + assert(volno >= 0); + assert(volno < HAMMER_MAX_VOLUMES); x[volno]++; } @@ -180,26 +186,26 @@ __fsvtyp_hammer(const char *blkdevs, cha free(dup); if (volno == -1) - goto done; + goto fail; if (partial) goto success; for (i = 0; i < HAMMER_MAX_VOLUMES; i++) if (x[i] > 1) - goto done; + goto fail; for (i = 0; i < HAMMER_MAX_VOLUMES; i++) if (x[i] == 0) break; if (ondisk->vol_count != i) - goto done; + goto fail; for (; i < HAMMER_MAX_VOLUMES; i++) if (x[i] != 0) - goto done; + goto fail; success: /* XXX autofs -media mount can't handle multiple mounts */ strlcpy(label, ondisk->vol_label, size); error = 0; -done: +fail: free(ondisk); return (error); }
CVS commit: src/sys/netinet6
Module Name:src Committed By: maxv Date: Fri Jan 3 08:53:14 UTC 2020 Modified Files: src/sys/netinet6: ip6_mroute.c Log Message: Don't forget to initialize 'sin6_len'. With kASan, from time to time the value will be bigger than the size of the source, and we get a read overflow. With kMSan the uninitialized access is detected immediately. Reported-by: syzbot+841ca14baccec37b4...@syzkaller.appspotmail.com To generate a diff of this commit: cvs rdiff -u -r1.130 -r1.131 src/sys/netinet6/ip6_mroute.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/netinet6/ip6_mroute.c diff -u src/sys/netinet6/ip6_mroute.c:1.130 src/sys/netinet6/ip6_mroute.c:1.131 --- src/sys/netinet6/ip6_mroute.c:1.130 Wed Jul 24 02:38:29 2019 +++ src/sys/netinet6/ip6_mroute.c Fri Jan 3 08:53:14 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: ip6_mroute.c,v 1.130 2019/07/24 02:38:29 msaitoh Exp $ */ +/* $NetBSD: ip6_mroute.c,v 1.131 2020/01/03 08:53:14 maxv Exp $ */ /* $KAME: ip6_mroute.c,v 1.49 2001/07/25 09:21:18 jinmei Exp $ */ /* @@ -117,7 +117,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ip6_mroute.c,v 1.130 2019/07/24 02:38:29 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ip6_mroute.c,v 1.131 2020/01/03 08:53:14 maxv Exp $"); #ifdef _KERNEL_OPT #include "opt_inet.h" @@ -540,9 +540,8 @@ ip6_mrouter_done(void) for (mifi = 0; mifi < nummifs; mifi++) { if (mif6table[mifi].m6_ifp && !(mif6table[mifi].m6_flags & MIFF_REGISTER)) { -sin6.sin6_family = AF_INET6; -sin6.sin6_addr = in6addr_any; ifp = mif6table[mifi].m6_ifp; +sockaddr_in6_init(&sin6, &in6addr_any, 0, 0, 0); if_mcast_op(ifp, SIOCDELMULTI, sin6tocsa(&sin6)); } @@ -674,8 +673,7 @@ add_m6if(struct mif6ctl *mifcp) * Enable promiscuous reception of all IPv6 multicasts * from the interface. */ - sin6.sin6_family = AF_INET6; - sin6.sin6_addr = in6addr_any; + sockaddr_in6_init(&sin6, &in6addr_any, 0, 0, 0); error = if_mcast_op(ifp, SIOCADDMULTI, sin6tosa(&sin6)); splx(s); if (error) @@ -732,8 +730,7 @@ del_m6if(mifi_t *mifip) */ ifp = mifp->m6_ifp; - sin6.sin6_family = AF_INET6; - sin6.sin6_addr = in6addr_any; + sockaddr_in6_init(&sin6, &in6addr_any, 0, 0, 0); if_mcast_op(ifp, SIOCDELMULTI, sin6tosa(&sin6)); } else { if (reg_mif_num != (mifi_t)-1) {
CVS commit: src/sys/arch/zaurus/conf
Module Name:src Committed By: martin Date: Fri Jan 3 10:01:07 UTC 2020 Modified Files: src/sys/arch/zaurus/conf: Makefile.zaurus.inc ldscript.zaurus Log Message: Drop CTF sections from this size restricted kernel (especially as the size check is on the total size of the binary, not any content/sections - is this a bug?) Compile with -O2 by default (to shrink the kernel to a usable size again and unbreak the build) To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/sys/arch/zaurus/conf/Makefile.zaurus.inc cvs rdiff -u -r1.11 -r1.12 src/sys/arch/zaurus/conf/ldscript.zaurus 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/zaurus/conf/Makefile.zaurus.inc diff -u src/sys/arch/zaurus/conf/Makefile.zaurus.inc:1.10 src/sys/arch/zaurus/conf/Makefile.zaurus.inc:1.11 --- src/sys/arch/zaurus/conf/Makefile.zaurus.inc:1.10 Sat Oct 26 09:49:13 2019 +++ src/sys/arch/zaurus/conf/Makefile.zaurus.inc Fri Jan 3 10:01:07 2020 @@ -1,7 +1,8 @@ -# $NetBSD: Makefile.zaurus.inc,v 1.10 2019/10/26 09:49:13 tsutsui Exp $ +# $NetBSD: Makefile.zaurus.inc,v 1.11 2020/01/03 10:01:07 martin Exp $ MACHINE_ARCH?= arm CPPFLAGS+= -D${MACHINE} +COPTS?= -O2 SYSTEM_FIRST_OBJ= zaurus_start.o SYSTEM_FIRST_SFILE= ${THISARM}/zaurus/zaurus_start.S Index: src/sys/arch/zaurus/conf/ldscript.zaurus diff -u src/sys/arch/zaurus/conf/ldscript.zaurus:1.11 src/sys/arch/zaurus/conf/ldscript.zaurus:1.12 --- src/sys/arch/zaurus/conf/ldscript.zaurus:1.11 Sun Aug 23 08:57:25 2015 +++ src/sys/arch/zaurus/conf/ldscript.zaurus Fri Jan 3 10:01:07 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: ldscript.zaurus,v 1.11 2015/08/23 08:57:25 uebayasi Exp $ */ +/* $NetBSD: ldscript.zaurus,v 1.12 2020/01/03 10:01:07 martin Exp $ */ ENTRY(KERNEL_BASE_phys) SECTIONS @@ -72,6 +72,7 @@ SECTIONS /DISCARD/ : { *(.eh_frame_hdr) *(.eh_frame) +*(.SUNW_ctf) } } SECTIONS
CVS commit: src/sys/stand/efiboot/bootarm
Module Name:src Committed By: skrll Date: Fri Jan 3 11:44:33 UTC 2020 Modified Files: src/sys/stand/efiboot/bootarm: Makefile Log Message: Add -mfloat-abi=soft so that gcc 8 doesn't emit FP instructions. This fixes bootarm.efi compiled by gcc 8. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/stand/efiboot/bootarm/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/stand/efiboot/bootarm/Makefile diff -u src/sys/stand/efiboot/bootarm/Makefile:1.2 src/sys/stand/efiboot/bootarm/Makefile:1.3 --- src/sys/stand/efiboot/bootarm/Makefile:1.2 Mon Sep 23 13:42:37 2019 +++ src/sys/stand/efiboot/bootarm/Makefile Fri Jan 3 11:44:33 2020 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.2 2019/09/23 13:42:37 christos Exp $ +# $NetBSD: Makefile,v 1.3 2020/01/03 11:44:33 skrll Exp $ PROG= bootarm.efi OBJFMT= binary @@ -9,7 +9,7 @@ LIBGNUEFI_ARCH= arm EXTRA_SOURCES= efibootarm.c EXTRA_SOURCES+= cache.S -COPTS+= -mno-unaligned-access -ffreestanding -fno-unwind-tables +COPTS+= -mfloat-abi=soft -mno-unaligned-access -ffreestanding -fno-unwind-tables CFLAGS+= -DEFIBOOT_ALIGN=0x100 LDFLAGS+= -N
CVS commit: src/sys/dev/usb
Module Name:src Committed By: jmcneill Date: Fri Jan 3 12:35:33 UTC 2020 Modified Files: src/sys/dev/usb: usbdevs Log Message: Add HAILUCK keyboard (product 1e) To generate a diff of this commit: cvs rdiff -u -r1.774 -r1.775 src/sys/dev/usb/usbdevs Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/usb/usbdevs diff -u src/sys/dev/usb/usbdevs:1.774 src/sys/dev/usb/usbdevs:1.775 --- src/sys/dev/usb/usbdevs:1.774 Sun Oct 6 17:22:29 2019 +++ src/sys/dev/usb/usbdevs Fri Jan 3 12:35:33 2020 @@ -1,4 +1,4 @@ -$NetBSD: usbdevs,v 1.774 2019/10/06 17:22:29 martin Exp $ +$NetBSD: usbdevs,v 1.775 2020/01/03 12:35:33 jmcneill Exp $ /*- * Copyright (c) 1998-2004 The NetBSD Foundation, Inc. @@ -577,6 +577,7 @@ vendor ARDUINO 0x2341 Arduino SA vendor TPLINK 0x2357 TP-Link vendor WMR 0x2405 West Mountain Radio vendor TRIPPLITE 0x2478 Tripp-Lite +vendor HAILUCK 0x258a HAILUCK Co., Ltd vendor HIROSE 0x2631 Hirose Electric vendor NHJ 0x2770 NHJ vendor PLANEX 0x2c02 Planex Communications @@ -1732,6 +1733,9 @@ product HAGIWARA FGSM 0x0002 FlashGate product HAGIWARA FGCF 0x0003 FlashGate CompactFlash Card Reader product HAGIWARA FG 0x0005 FlashGate +/* HAILUCK Co., Ltd products */ +product HAILUCK KEYBOARD 0x001e Keyboard + /* HAL Corporation products */ product HAL IMR001 0x0011 Crossam2+USB IR commander
CVS import: src/external/bsd/dhcpcd/dist
Module Name:src Committed By: roy Date: Fri Jan 3 12:38:16 UTC 2020 Update of /cvsroot/src/external/bsd/dhcpcd/dist In directory ivanova.netbsd.org:/tmp/cvs-serv2335 Log Message: Update to dhcpcd-8.1.5 with the following changes: * inet: Allow forcing a host route from an interface without a lease * dhcpcd: Don't wait for an address family to complete if not using it Status: Vendor Tag: ROY Release Tags: dhcpcd-8_1_5 U src/external/bsd/dhcpcd/dist/LICENSE U src/external/bsd/dhcpcd/dist/README.md U src/external/bsd/dhcpcd/dist/src/defs.h U src/external/bsd/dhcpcd/dist/src/common.c U src/external/bsd/dhcpcd/dist/src/control.c C src/external/bsd/dhcpcd/dist/src/dhcpcd.c U src/external/bsd/dhcpcd/dist/src/duid.c U src/external/bsd/dhcpcd/dist/src/eloop.c U src/external/bsd/dhcpcd/dist/src/logerr.c U src/external/bsd/dhcpcd/dist/src/if.c C src/external/bsd/dhcpcd/dist/src/if-options.c U src/external/bsd/dhcpcd/dist/src/sa.c U src/external/bsd/dhcpcd/dist/src/route.c U src/external/bsd/dhcpcd/dist/src/dhcp-common.c U src/external/bsd/dhcpcd/dist/src/script.c U src/external/bsd/dhcpcd/dist/src/auth.c U src/external/bsd/dhcpcd/dist/src/if-bsd.c U src/external/bsd/dhcpcd/dist/src/dhcp.c U src/external/bsd/dhcpcd/dist/src/ipv4.c U src/external/bsd/dhcpcd/dist/src/bpf.c U src/external/bsd/dhcpcd/dist/src/arp.c U src/external/bsd/dhcpcd/dist/src/ipv4ll.c U src/external/bsd/dhcpcd/dist/src/ipv6.c C src/external/bsd/dhcpcd/dist/src/ipv6nd.c U src/external/bsd/dhcpcd/dist/src/dhcp6.c U src/external/bsd/dhcpcd/dist/src/dhcpcd-embedded.c U src/external/bsd/dhcpcd/dist/src/common.h U src/external/bsd/dhcpcd/dist/src/control.h U src/external/bsd/dhcpcd/dist/src/dhcpcd.h U src/external/bsd/dhcpcd/dist/src/duid.h U src/external/bsd/dhcpcd/dist/src/eloop.h U src/external/bsd/dhcpcd/dist/src/logerr.h U src/external/bsd/dhcpcd/dist/src/if.h U src/external/bsd/dhcpcd/dist/src/if-options.h U src/external/bsd/dhcpcd/dist/src/sa.h U src/external/bsd/dhcpcd/dist/src/route.h U src/external/bsd/dhcpcd/dist/src/dhcp-common.h U src/external/bsd/dhcpcd/dist/src/script.h U src/external/bsd/dhcpcd/dist/src/auth.h U src/external/bsd/dhcpcd/dist/src/dhcp.h U src/external/bsd/dhcpcd/dist/src/ipv4.h U src/external/bsd/dhcpcd/dist/src/bpf.h U src/external/bsd/dhcpcd/dist/src/arp.h U src/external/bsd/dhcpcd/dist/src/ipv4ll.h U src/external/bsd/dhcpcd/dist/src/ipv6.h U src/external/bsd/dhcpcd/dist/src/ipv6nd.h U src/external/bsd/dhcpcd/dist/src/dhcp6.h U src/external/bsd/dhcpcd/dist/src/dhcpcd-embedded.h U src/external/bsd/dhcpcd/dist/src/dev.h U src/external/bsd/dhcpcd/dist/src/dhcpcd.conf.5.in U src/external/bsd/dhcpcd/dist/src/dhcpcd.8.in U src/external/bsd/dhcpcd/dist/src/dhcpcd.conf U src/external/bsd/dhcpcd/dist/hooks/dhcpcd-run-hooks.in U src/external/bsd/dhcpcd/dist/hooks/dhcpcd-run-hooks.8.in U src/external/bsd/dhcpcd/dist/hooks/01-test U src/external/bsd/dhcpcd/dist/hooks/02-dump U src/external/bsd/dhcpcd/dist/hooks/10-wpa_supplicant U src/external/bsd/dhcpcd/dist/hooks/15-timezone U src/external/bsd/dhcpcd/dist/hooks/20-resolv.conf U src/external/bsd/dhcpcd/dist/hooks/29-lookup-hostname U src/external/bsd/dhcpcd/dist/hooks/30-hostname U src/external/bsd/dhcpcd/dist/hooks/50-ntp.conf U src/external/bsd/dhcpcd/dist/hooks/50-ypbind.in 3 conflicts created by this import. Use the following command to help the merge: cvs checkout -jROY:yesterday -jROY src/external/bsd/dhcpcd/dist
CVS commit: src/external/bsd/dhcpcd/dist/src
Module Name:src Committed By: roy Date: Fri Jan 3 12:39:19 UTC 2020 Modified Files: src/external/bsd/dhcpcd/dist/src: dhcpcd.c if-options.c ipv6nd.c Log Message: Sync To generate a diff of this commit: cvs rdiff -u -r1.30 -r1.31 src/external/bsd/dhcpcd/dist/src/dhcpcd.c cvs rdiff -u -r1.19 -r1.20 src/external/bsd/dhcpcd/dist/src/if-options.c cvs rdiff -u -r1.14 -r1.15 src/external/bsd/dhcpcd/dist/src/ipv6nd.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/bsd/dhcpcd/dist/src/dhcpcd.c diff -u src/external/bsd/dhcpcd/dist/src/dhcpcd.c:1.30 src/external/bsd/dhcpcd/dist/src/dhcpcd.c:1.31 --- src/external/bsd/dhcpcd/dist/src/dhcpcd.c:1.30 Fri Dec 20 12:01:35 2019 +++ src/external/bsd/dhcpcd/dist/src/dhcpcd.c Fri Jan 3 12:39:18 2020 @@ -467,25 +467,11 @@ configure_interface1(struct interface *i if (!(ifo->options & (DHCPCD_INFORM | DHCPCD_WANTDHCP))) ifo->options |= DHCPCD_STATIC; } - if (!(ifo->options & DHCPCD_ARP) || - ifo->options & (DHCPCD_INFORM | DHCPCD_STATIC)) - ifo->options &= ~DHCPCD_IPV4LL; if (ifo->metric != -1) ifp->metric = (unsigned int)ifo->metric; - if (!(ifo->options & DHCPCD_IPV4)) - ifo->options &= ~(DHCPCD_DHCP | DHCPCD_IPV4LL | DHCPCD_WAITIP4); - #ifdef INET6 - if (!(ifo->options & DHCPCD_IPV6)) - ifo->options &= - ~(DHCPCD_IPV6RS | DHCPCD_DHCP6 | DHCPCD_WAITIP6); - - if (!(ifo->options & DHCPCD_IPV6RS)) - ifo->options &= - ~(DHCPCD_IPV6RA_AUTOCONF | DHCPCD_IPV6RA_REQRDNSS); - /* We want to setup INET6 on the interface as soon as possible. */ if (ifp->active == IF_ACTIVE_USER && ifo->options & DHCPCD_IPV6 && Index: src/external/bsd/dhcpcd/dist/src/if-options.c diff -u src/external/bsd/dhcpcd/dist/src/if-options.c:1.19 src/external/bsd/dhcpcd/dist/src/if-options.c:1.20 --- src/external/bsd/dhcpcd/dist/src/if-options.c:1.19 Fri Dec 20 22:24:59 2019 +++ src/external/bsd/dhcpcd/dist/src/if-options.c Fri Jan 3 12:39:18 2020 @@ -2231,6 +2231,21 @@ finish_config(struct if_options *ifo) * guard should suffice */ ifo->options |= DHCPCD_VENDORRAW; } + + if (!(ifo->options & DHCPCD_ARP) || + ifo->options & (DHCPCD_INFORM | DHCPCD_STATIC)) + ifo->options &= ~DHCPCD_IPV4LL; + + if (!(ifo->options & DHCPCD_IPV4)) + ifo->options &= ~(DHCPCD_DHCP | DHCPCD_IPV4LL | DHCPCD_WAITIP4); + + if (!(ifo->options & DHCPCD_IPV6)) + ifo->options &= + ~(DHCPCD_IPV6RS | DHCPCD_DHCP6 | DHCPCD_WAITIP6); + + if (!(ifo->options & DHCPCD_IPV6RS)) + ifo->options &= + ~(DHCPCD_IPV6RA_AUTOCONF | DHCPCD_IPV6RA_REQRDNSS); } /* Handy routine to read very long lines in text files. Index: src/external/bsd/dhcpcd/dist/src/ipv6nd.c diff -u src/external/bsd/dhcpcd/dist/src/ipv6nd.c:1.14 src/external/bsd/dhcpcd/dist/src/ipv6nd.c:1.15 --- src/external/bsd/dhcpcd/dist/src/ipv6nd.c:1.14 Fri Dec 20 12:01:36 2019 +++ src/external/bsd/dhcpcd/dist/src/ipv6nd.c Fri Jan 3 12:39:18 2020 @@ -622,7 +622,7 @@ ipv6nd_applyra(struct dhcpcd_ctx *ctx, s return; state->retrans = rap->retrans; - if (if_applyra(rap) == -1) + if (if_applyra(rap) == -1 && errno != ENOENT) logerr(__func__); }
CVS commit: src/sys/dev/usb
Module Name:src Committed By: jmcneill Date: Fri Jan 3 12:39:39 UTC 2020 Modified Files: src/sys/dev/usb: ums.c Log Message: Add a quirk for the HAILUCK USB keyboard / touchpad device with product 1e. The keyboard does not function properly unless the touchpad's intr endpoint is active. To generate a diff of this commit: cvs rdiff -u -r1.95 -r1.96 src/sys/dev/usb/ums.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/usb/ums.c diff -u src/sys/dev/usb/ums.c:1.95 src/sys/dev/usb/ums.c:1.96 --- src/sys/dev/usb/ums.c:1.95 Sun Dec 1 08:27:54 2019 +++ src/sys/dev/usb/ums.c Fri Jan 3 12:39:39 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: ums.c,v 1.95 2019/12/01 08:27:54 maxv Exp $ */ +/* $NetBSD: ums.c,v 1.96 2020/01/03 12:39:39 jmcneill Exp $ */ /* * Copyright (c) 1998, 2017 The NetBSD Foundation, Inc. @@ -35,7 +35,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ums.c,v 1.95 2019/12/01 08:27:54 maxv Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ums.c,v 1.96 2020/01/03 12:39:39 jmcneill Exp $"); #ifdef _KERNEL_OPT #include "opt_usb.h" @@ -78,6 +78,8 @@ struct ums_softc { struct uhidev sc_hdev; struct hidms sc_ms; + bool sc_alwayson; + int sc_enabled; char sc_dying; }; @@ -135,7 +137,7 @@ ums_attach(device_t parent, device_t sel { struct ums_softc *sc = device_private(self); struct uhidev_attach_arg *uha = aux; - int size; + int size, error; void *desc; uint32_t quirks; @@ -192,8 +194,26 @@ ums_attach(device_t parent, device_t sel } } + if (uha->uiaa->uiaa_vendor == USB_VENDOR_HAILUCK && + uha->uiaa->uiaa_product == USB_PRODUCT_HAILUCK_KEYBOARD) { + /* + * The HAILUCK USB Keyboard has a built-in touchpad, which + * needs to be active for the keyboard to function properly. + */ + sc->sc_alwayson = true; + } + tpcalib_init(&sc->sc_ms.sc_tpcalib); hidms_attach(self, &sc->sc_ms, &ums_accessops); + + if (sc->sc_alwayson) { + error = uhidev_open(&sc->sc_hdev); + if (error != 0) { + aprint_error_dev(self, + "WARNING: couldn't open always-on device\n"); + sc->sc_alwayson = false; + } + } } static int @@ -227,6 +247,9 @@ ums_detach(device_t self, int flags) DPRINTF(("ums_detach: sc=%p flags=%d\n", sc, flags)); + if (sc->sc_alwayson) + uhidev_close(&sc->sc_hdev); + /* No need to do reference counting of ums, wsmouse has all the goo. */ if (sc->sc_ms.hidms_wsmousedev != NULL) rv = config_detach(sc->sc_ms.hidms_wsmousedev, flags); @@ -240,14 +263,16 @@ Static void ums_intr(struct uhidev *addr, void *ibuf, u_int len) { struct ums_softc *sc = (struct ums_softc *)addr; - hidms_intr(&sc->sc_ms, ibuf, len); + + if (sc->sc_enabled) + hidms_intr(&sc->sc_ms, ibuf, len); } Static int ums_enable(void *v) { struct ums_softc *sc = v; - int error; + int error = 0; DPRINTFN(1,("ums_enable: sc=%p\n", sc)); @@ -260,9 +285,11 @@ ums_enable(void *v) sc->sc_enabled = 1; sc->sc_ms.hidms_buttons = 0; - error = uhidev_open(&sc->sc_hdev); - if (error) - sc->sc_enabled = 0; + if (!sc->sc_alwayson) { + error = uhidev_open(&sc->sc_hdev); + if (error) + sc->sc_enabled = 0; + } return error; } @@ -282,7 +309,8 @@ ums_disable(void *v) if (sc->sc_enabled) { sc->sc_enabled = 0; - uhidev_close(&sc->sc_hdev); + if (!sc->sc_alwayson) + uhidev_close(&sc->sc_hdev); } }
CVS commit: src/doc
Module Name:src Committed By: roy Date: Fri Jan 3 12:41:26 UTC 2020 Modified Files: src/doc: 3RDPARTY CHANGES Log Message: Note import of dhcpcd-8.1.5 To generate a diff of this commit: cvs rdiff -u -r1.1683 -r1.1684 src/doc/3RDPARTY cvs rdiff -u -r1.2630 -r1.2631 src/doc/CHANGES Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/doc/3RDPARTY diff -u src/doc/3RDPARTY:1.1683 src/doc/3RDPARTY:1.1684 --- src/doc/3RDPARTY:1.1683 Wed Jan 1 18:40:12 2020 +++ src/doc/3RDPARTY Fri Jan 3 12:41:26 2020 @@ -1,4 +1,4 @@ -# $NetBSD: 3RDPARTY,v 1.1683 2020/01/01 18:40:12 wiz Exp $ +# $NetBSD: 3RDPARTY,v 1.1684 2020/01/03 12:41:26 roy Exp $ # # This file contains a list of the software that has been integrated into # NetBSD where we are not the primary maintainer. @@ -327,12 +327,12 @@ Notes: Use the dhcp2netbsd script. Package: dhcpcd -Version: 8.1.4 -Current Vers: 8.1.4 +Version: 8.1.5 +Current Vers: 8.1.5 Maintainer: roy Archive Site: ftp://roy.marples.name/pub/dhcpcd/ Home Page: http://roy.marples.name/projects/dhcpcd/ -Date: 2019-12-20 +Date: 2020-01-03 Mailing List: dhcpcd-disc...@marples.name License: BSD (2-clause) Location: external/bsd/dhcpcd/dist Index: src/doc/CHANGES diff -u src/doc/CHANGES:1.2630 src/doc/CHANGES:1.2631 --- src/doc/CHANGES:1.2630 Thu Jan 2 19:05:03 2020 +++ src/doc/CHANGES Fri Jan 3 12:41:26 2020 @@ -1,4 +1,4 @@ -# LIST OF CHANGES FROM LAST RELEASE: <$Revision: 1.2630 $> +# LIST OF CHANGES FROM LAST RELEASE: <$Revision: 1.2631 $> # # # [Note: This file does not mention every change made to the NetBSD source tree. @@ -92,3 +92,5 @@ Changes from NetBSD 9.0 to NetBSD 10.0: command line, and removed all command like flags that are not needed anymore [christos 20191229] aq(4): Add Aquantia 10G network adapter driver [ryo 20200101] + dhcpcd(8): Import dhcpcd-8.1.5 [roy 20200103] +
CVS commit: src/sys/dev/pci/ixgbe
Module Name:src Committed By: pgoyette Date: Fri Jan 3 12:59:46 UTC 2020 Modified Files: src/sys/dev/pci/ixgbe: ixgbe.c ixgbe_82598.c ixgbe_api.c Log Message: Fix some typos in comments. >From vezhlys on freenode IRC. To generate a diff of this commit: cvs rdiff -u -r1.219 -r1.220 src/sys/dev/pci/ixgbe/ixgbe.c cvs rdiff -u -r1.13 -r1.14 src/sys/dev/pci/ixgbe/ixgbe_82598.c cvs rdiff -u -r1.23 -r1.24 src/sys/dev/pci/ixgbe/ixgbe_api.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/pci/ixgbe/ixgbe.c diff -u src/sys/dev/pci/ixgbe/ixgbe.c:1.219 src/sys/dev/pci/ixgbe/ixgbe.c:1.220 --- src/sys/dev/pci/ixgbe/ixgbe.c:1.219 Mon Dec 23 09:36:17 2019 +++ src/sys/dev/pci/ixgbe/ixgbe.c Fri Jan 3 12:59:46 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: ixgbe.c,v 1.219 2019/12/23 09:36:17 msaitoh Exp $ */ +/* $NetBSD: ixgbe.c,v 1.220 2020/01/03 12:59:46 pgoyette Exp $ */ /** @@ -353,7 +353,7 @@ SYSCTL_INT(_hw_ix, OID_AUTO, enable_msix * Number of Queues, can be set to 0, * it then autoconfigures based on the * number of cpus with a max of 8. This - * can be overriden manually here. + * can be overridden manually here. */ static int ixgbe_num_queues = 0; SYSCTL_INT(_hw_ix, OID_AUTO, num_queues, CTLFLAG_RDTUN, &ixgbe_num_queues, 0, Index: src/sys/dev/pci/ixgbe/ixgbe_82598.c diff -u src/sys/dev/pci/ixgbe/ixgbe_82598.c:1.13 src/sys/dev/pci/ixgbe/ixgbe_82598.c:1.14 --- src/sys/dev/pci/ixgbe/ixgbe_82598.c:1.13 Mon Dec 23 09:36:17 2019 +++ src/sys/dev/pci/ixgbe/ixgbe_82598.c Fri Jan 3 12:59:46 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: ixgbe_82598.c,v 1.13 2019/12/23 09:36:17 msaitoh Exp $ */ +/* $NetBSD: ixgbe_82598.c,v 1.14 2020/01/03 12:59:46 pgoyette Exp $ */ /** SPDX-License-Identifier: BSD-3-Clause @@ -90,7 +90,7 @@ void ixgbe_set_pcie_completion_timeout(s goto out; /* - * if capababilities version is type 1 we can write the + * if capabilities version is type 1 we can write the * timeout of 10ms to 250ms through the GCR register */ if (!(gcr & IXGBE_GCR_CAP_VER2)) { @@ -913,7 +913,7 @@ mac_reset_top: /* * Store the original AUTOC value if it has not been * stored off yet. Otherwise restore the stored original - * AUTOC value since the reset operation sets back to deaults. + * AUTOC value since the reset operation sets back to defaults. */ autoc = IXGBE_READ_REG(hw, IXGBE_AUTOC); if (hw->mac.orig_link_settings_stored == FALSE) { Index: src/sys/dev/pci/ixgbe/ixgbe_api.c diff -u src/sys/dev/pci/ixgbe/ixgbe_api.c:1.23 src/sys/dev/pci/ixgbe/ixgbe_api.c:1.24 --- src/sys/dev/pci/ixgbe/ixgbe_api.c:1.23 Thu Jun 27 05:55:40 2019 +++ src/sys/dev/pci/ixgbe/ixgbe_api.c Fri Jan 3 12:59:46 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: ixgbe_api.c,v 1.23 2019/06/27 05:55:40 msaitoh Exp $ */ +/* $NetBSD: ixgbe_api.c,v 1.24 2020/01/03 12:59:46 pgoyette Exp $ */ /** SPDX-License-Identifier: BSD-3-Clause @@ -1381,8 +1381,8 @@ s32 ixgbe_bypass_rw(struct ixgbe_hw *hw, * ixgbe_bypass_valid_rd - Verify valid return from bit-bang. * * If we send a write we can't be sure it took until we can read back - * that same register. It can be a problem as some of the feilds may - * for valid reasons change inbetween the time wrote the register and + * that same register. It can be a problem as some of the fields may + * for valid reasons change in-between the time wrote the register and * we read it again to verify. So this function check everything we * can check and then assumes it worked. * @@ -1396,7 +1396,7 @@ bool ixgbe_bypass_valid_rd(struct ixgbe_ } /** - * ixgbe_bypass_set - Set a bypass field in the FW CTRL Regiter. + * ixgbe_bypass_set - Set a bypass field in the FW CTRL Register. * @hw: pointer to hardware structure * @cmd: The control word we are setting. * @event: The event we are setting in the FW. This also happens to
CVS commit: src/sys/stand/efiboot
Module Name:src Committed By: skrll Date: Fri Jan 3 14:14:56 UTC 2020 Modified Files: src/sys/stand/efiboot: efifdt.c Log Message: Fix EFIBOOT_DEBUG build on arm To generate a diff of this commit: cvs rdiff -u -r1.20 -r1.21 src/sys/stand/efiboot/efifdt.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/stand/efiboot/efifdt.c diff -u src/sys/stand/efiboot/efifdt.c:1.20 src/sys/stand/efiboot/efifdt.c:1.21 --- src/sys/stand/efiboot/efifdt.c:1.20 Wed Dec 18 21:46:03 2019 +++ src/sys/stand/efiboot/efifdt.c Fri Jan 3 14:14:56 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: efifdt.c,v 1.20 2019/12/18 21:46:03 riastradh Exp $ */ +/* $NetBSD: efifdt.c,v 1.21 2020/01/03 14:14:56 skrll Exp $ */ /*- * Copyright (c) 2019 Jason R. Thorpe @@ -47,6 +47,13 @@ static EFI_GUID FdtTableGuid = FDT_TABLE (_md)->Type == EfiBootServicesCode || (_md)->Type == EfiBootServicesData || \ (_md)->Type == EfiConventionalMemory) +#ifdef _LP64 +#define PRIdUINTN "ld" +#define PRIxUINTN "lx" +#else +#define PRIdUINTN "d" +#define PRIxUINTN "x" +#endif static void *fdt_data = NULL; int @@ -275,7 +282,7 @@ efi_fdt_gop(void) continue; #ifdef EFIBOOT_DEBUG - printf("GOP: FB @ 0x%lx size 0x%lx\n", mode->FrameBufferBase, mode->FrameBufferSize); + printf("GOP: FB @ 0x%" PRIx64 " size 0x%" PRIxUINTN "\n", mode->FrameBufferBase, mode->FrameBufferSize); printf("GOP: Version %d\n", mode->Info->Version); printf("GOP: HRes %d VRes %d\n", mode->Info->HorizontalResolution, mode->Info->VerticalResolution); printf("GOP: PixelFormat %d\n", mode->Info->PixelFormat);
CVS commit: src/sys/external/gpl2/dts/dist
Module Name:src Committed By: skrll Date: Fri Jan 3 15:04:34 UTC 2020 Modified Files: src/sys/external/gpl2/dts/dist/arch/arm/boot/dts: bcm2835-common.dtsi bcm2835-rpi.dtsi bcm283x.dtsi sun8i-a23-ippo-q8h-v1.2.dts sun8i-a23-ippo-q8h-v5.dts sun8i-a33-et-q8-v1.6.dts sun8i-a33-ippo-q8h-v1.2.dts src/sys/external/gpl2/dts/dist/arch/arm64/boot/dts/allwinner: sun50i-h5-nanopi-neo-plus2.dts sun50i-h6-pine-h64.dts sun50i-h6.dtsi src/sys/external/gpl2/dts/dist/arch/arm64/boot/dts/amlogic: meson-gx.dtsi meson-gxbb.dtsi meson-gxl.dtsi src/sys/external/gpl2/dts/dist/arch/arm64/boot/dts/arm: vexpress-v2m-rs1.dtsi src/sys/external/gpl2/dts/dist/arch/arm64/boot/dts/rockchip: rk3328-rock64.dts src/sys/external/gpl2/dts/dist/include/dt-bindings/input: linux-event-codes.h src/sys/external/gpl2/dts/dist/include/dt-bindings/pinctrl: stm32-pinfunc.h Removed Files: src/sys/external/gpl2/dts/dist/arch/arm/boot/dts: at91-kizbox2.dts imx6ul-phytec-pcl063.dtsi imx6ul-phytec-peb-eval-01.dtsi imx6ul-phytec-phyboard-segin-full.dts imx6ul-phytec-phyboard-segin.dtsi rk3288-fennec.dts src/sys/external/gpl2/dts/dist/include/dt-bindings/clock: xlnx,zynqmp-clk.h Log Message: Merge conflicts To generate a diff of this commit: cvs rdiff -u -r1.1.1.4 -r0 \ src/sys/external/gpl2/dts/dist/arch/arm/boot/dts/at91-kizbox2.dts \ src/sys/external/gpl2/dts/dist/arch/arm/boot/dts/rk3288-fennec.dts cvs rdiff -u -r1.1.1.1 -r1.2 \ src/sys/external/gpl2/dts/dist/arch/arm/boot/dts/bcm2835-common.dtsi cvs rdiff -u -r1.6 -r1.7 \ src/sys/external/gpl2/dts/dist/arch/arm/boot/dts/bcm2835-rpi.dtsi cvs rdiff -u -r1.8 -r1.9 \ src/sys/external/gpl2/dts/dist/arch/arm/boot/dts/bcm283x.dtsi cvs rdiff -u -r1.1.1.1 -r0 \ src/sys/external/gpl2/dts/dist/arch/arm/boot/dts/imx6ul-phytec-pcl063.dtsi \ src/sys/external/gpl2/dts/dist/arch/arm/boot/dts/imx6ul-phytec-peb-eval-01.dtsi \ src/sys/external/gpl2/dts/dist/arch/arm/boot/dts/imx6ul-phytec-phyboard-segin-full.dts \ src/sys/external/gpl2/dts/dist/arch/arm/boot/dts/imx6ul-phytec-phyboard-segin.dtsi cvs rdiff -u -r1.4 -r1.5 \ src/sys/external/gpl2/dts/dist/arch/arm/boot/dts/sun8i-a23-ippo-q8h-v1.2.dts \ src/sys/external/gpl2/dts/dist/arch/arm/boot/dts/sun8i-a23-ippo-q8h-v5.dts cvs rdiff -u -r1.3 -r1.4 \ src/sys/external/gpl2/dts/dist/arch/arm/boot/dts/sun8i-a33-et-q8-v1.6.dts \ src/sys/external/gpl2/dts/dist/arch/arm/boot/dts/sun8i-a33-ippo-q8h-v1.2.dts cvs rdiff -u -r1.2 -r1.3 \ src/sys/external/gpl2/dts/dist/arch/arm64/boot/dts/allwinner/sun50i-h5-nanopi-neo-plus2.dts cvs rdiff -u -r1.5 -r1.6 \ src/sys/external/gpl2/dts/dist/arch/arm64/boot/dts/allwinner/sun50i-h6-pine-h64.dts cvs rdiff -u -r1.6 -r1.7 \ src/sys/external/gpl2/dts/dist/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi cvs rdiff -u -r1.3 -r1.4 \ src/sys/external/gpl2/dts/dist/arch/arm64/boot/dts/amlogic/meson-gx.dtsi \ src/sys/external/gpl2/dts/dist/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi \ src/sys/external/gpl2/dts/dist/arch/arm64/boot/dts/amlogic/meson-gxl.dtsi cvs rdiff -u -r1.5 -r1.6 \ src/sys/external/gpl2/dts/dist/arch/arm64/boot/dts/arm/vexpress-v2m-rs1.dtsi cvs rdiff -u -r1.3 -r1.4 \ src/sys/external/gpl2/dts/dist/arch/arm64/boot/dts/rockchip/rk3328-rock64.dts cvs rdiff -u -r1.1.1.1 -r0 \ src/sys/external/gpl2/dts/dist/include/dt-bindings/clock/xlnx,zynqmp-clk.h cvs rdiff -u -r1.8 -r1.9 \ src/sys/external/gpl2/dts/dist/include/dt-bindings/input/linux-event-codes.h cvs rdiff -u -r1.3 -r1.4 \ src/sys/external/gpl2/dts/dist/include/dt-bindings/pinctrl/stm32-pinfunc.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/external/gpl2/dts/dist/arch/arm/boot/dts/bcm2835-common.dtsi diff -u src/sys/external/gpl2/dts/dist/arch/arm/boot/dts/bcm2835-common.dtsi:1.1.1.1 src/sys/external/gpl2/dts/dist/arch/arm/boot/dts/bcm2835-common.dtsi:1.2 --- src/sys/external/gpl2/dts/dist/arch/arm/boot/dts/bcm2835-common.dtsi:1.1.1.1 Fri Jan 3 14:33:15 2020 +++ src/sys/external/gpl2/dts/dist/arch/arm/boot/dts/bcm2835-common.dtsi Fri Jan 3 15:04:33 2020 @@ -74,12 +74,14 @@ compatible = "brcm,bcm2835-pixelvalve0"; reg = <0x7e206000 0x100>; interrupts = <2 13>; /* pwa0 */ + status = "disabled" }; pixelvalve@7e207000 { compatible = "brcm,bcm2835-pixelvalve1"; reg = <0x7e207000 0x100>; interrupts = <2 14>; /* pwa1 */ + status = "disabled" }; thermal: thermal@7e212000 { @@ -104,6 +106,7 @@ compatible = "brcm,bcm2835-pixelvalve2"; reg = <0x7e807000 0x100>; interrupts = <2 10>; /* pixelvalve */ + status = "disabled" }; hdmi: hdmi@7e902000 { @@ -125,11 +128,17 @@ re
CVS commit: src/sys/external/gpl2/dts/dist/arch/arm/boot/dts
Module Name:src Committed By: skrll Date: Fri Jan 3 15:40:38 UTC 2020 Modified Files: src/sys/external/gpl2/dts/dist/arch/arm/boot/dts: bcm2835-common.dtsi Log Message: Fix merge botch To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 \ src/sys/external/gpl2/dts/dist/arch/arm/boot/dts/bcm2835-common.dtsi 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-common.dtsi diff -u src/sys/external/gpl2/dts/dist/arch/arm/boot/dts/bcm2835-common.dtsi:1.2 src/sys/external/gpl2/dts/dist/arch/arm/boot/dts/bcm2835-common.dtsi:1.3 --- src/sys/external/gpl2/dts/dist/arch/arm/boot/dts/bcm2835-common.dtsi:1.2 Fri Jan 3 15:04:33 2020 +++ src/sys/external/gpl2/dts/dist/arch/arm/boot/dts/bcm2835-common.dtsi Fri Jan 3 15:40:38 2020 @@ -74,14 +74,14 @@ compatible = "brcm,bcm2835-pixelvalve0"; reg = <0x7e206000 0x100>; interrupts = <2 13>; /* pwa0 */ - status = "disabled" + status = "disabled"; }; pixelvalve@7e207000 { compatible = "brcm,bcm2835-pixelvalve1"; reg = <0x7e207000 0x100>; interrupts = <2 14>; /* pwa1 */ - status = "disabled" + status = "disabled"; }; thermal: thermal@7e212000 { @@ -106,7 +106,7 @@ compatible = "brcm,bcm2835-pixelvalve2"; reg = <0x7e807000 0x100>; interrupts = <2 10>; /* pixelvalve */ - status = "disabled" + status = "disabled"; }; hdmi: hdmi@7e902000 {
CVS commit: src/sys/arch/arm/dts
Module Name:src Committed By: skrll Date: Fri Jan 3 15:50:13 UTC 2020 Modified Files: src/sys/arch/arm/dts: sun50i-a64-pinebook.dts Log Message: lcd_rgb666_pins is in sun50i-a64.dtsi now so we don't need it here. To generate a diff of this commit: cvs rdiff -u -r1.17 -r1.18 src/sys/arch/arm/dts/sun50i-a64-pinebook.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/arch/arm/dts/sun50i-a64-pinebook.dts diff -u src/sys/arch/arm/dts/sun50i-a64-pinebook.dts:1.17 src/sys/arch/arm/dts/sun50i-a64-pinebook.dts:1.18 --- src/sys/arch/arm/dts/sun50i-a64-pinebook.dts:1.17 Sun Nov 24 02:06:16 2019 +++ src/sys/arch/arm/dts/sun50i-a64-pinebook.dts Fri Jan 3 15:50:13 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: sun50i-a64-pinebook.dts,v 1.17 2019/11/24 02:06:16 jmcneill Exp $ */ +/* $NetBSD: sun50i-a64-pinebook.dts,v 1.18 2020/01/03 15:50:13 skrll Exp $ */ /*- * Copyright (c) 2017-2019 Jared McNeill @@ -110,17 +110,6 @@ status = "okay"; }; -&pio { - lcd_rgb666_pins: lcd-rgb666 { - pins = "PD0", "PD1", "PD2", "PD3", "PD4", - "PD5", "PD6", "PD7", "PD8", "PD9", - "PD10", "PD11", "PD12", "PD13", - "PD14", "PD15", "PD16", "PD17", - "PD18", "PD19", "PD20", "PD21"; - function = "lcd0"; - }; -}; - &tcon0 { pinctrl-names = "default"; pinctrl-0 = <&lcd_rgb666_pins>;
CVS commit: src/sys/arch/arm/dts
Module Name:src Committed By: skrll Date: Fri Jan 3 16:01:04 UTC 2020 Modified Files: src/sys/arch/arm/dts: sun8i-h3-nanopi-r1.dts Log Message: To quote the upstream change "Remove useless pinctrl nodes" To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/arch/arm/dts/sun8i-h3-nanopi-r1.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/arch/arm/dts/sun8i-h3-nanopi-r1.dts diff -u src/sys/arch/arm/dts/sun8i-h3-nanopi-r1.dts:1.2 src/sys/arch/arm/dts/sun8i-h3-nanopi-r1.dts:1.3 --- src/sys/arch/arm/dts/sun8i-h3-nanopi-r1.dts:1.2 Tue Oct 8 23:00:36 2019 +++ src/sys/arch/arm/dts/sun8i-h3-nanopi-r1.dts Fri Jan 3 16:01:04 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: sun8i-h3-nanopi-r1.dts,v 1.2 2019/10/08 23:00:36 bad Exp $ */ +/* $NetBSD: sun8i-h3-nanopi-r1.dts,v 1.3 2020/01/03 16:01:04 skrll Exp $ */ /* * Copyright (C) 2019 Igor Pecovnik @@ -110,8 +110,6 @@ r_gpio_keys { compatible = "gpio-keys"; input-name = "k1"; - pinctrl-names = "default"; - pinctrl-0 = <&sw_r_npi>; /delete-node/ k1; reset {
CVS commit: src/sys/external/gpl2/dts/dist/arch/arm64/boot/dts/allwinner
Module Name:src Committed By: skrll Date: Fri Jan 3 16:29:42 UTC 2020 Modified Files: src/sys/external/gpl2/dts/dist/arch/arm64/boot/dts/allwinner: sun50i-h6-pine-h64.dts Log Message: Fix merge botch (uwb3 is no more. it is now dwc3) To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 \ src/sys/external/gpl2/dts/dist/arch/arm64/boot/dts/allwinner/sun50i-h6-pine-h64.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/arm64/boot/dts/allwinner/sun50i-h6-pine-h64.dts diff -u src/sys/external/gpl2/dts/dist/arch/arm64/boot/dts/allwinner/sun50i-h6-pine-h64.dts:1.6 src/sys/external/gpl2/dts/dist/arch/arm64/boot/dts/allwinner/sun50i-h6-pine-h64.dts:1.7 --- src/sys/external/gpl2/dts/dist/arch/arm64/boot/dts/allwinner/sun50i-h6-pine-h64.dts:1.6 Fri Jan 3 15:04:33 2020 +++ src/sys/external/gpl2/dts/dist/arch/arm64/boot/dts/allwinner/sun50i-h6-pine-h64.dts Fri Jan 3 16:29:42 2020 @@ -280,10 +280,6 @@ status = "okay"; }; -&usb3 { - status = "okay"; -}; - &usb3phy { phy-supply = <®_usb_vbus>; status = "okay";
CVS commit: src/sys/dev/i2c
Module Name:src Committed By: jmcneill Date: Fri Jan 3 18:00:05 UTC 2020 Modified Files: src/sys/dev/i2c: files.i2c Added Files: src/sys/dev/i2c: cwfg.c Log Message: Add driver for CellWise CW2015 Fuel Gauge IC. To generate a diff of this commit: cvs rdiff -u -r0 -r1.1 src/sys/dev/i2c/cwfg.c cvs rdiff -u -r1.106 -r1.107 src/sys/dev/i2c/files.i2c 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/i2c/files.i2c diff -u src/sys/dev/i2c/files.i2c:1.106 src/sys/dev/i2c/files.i2c:1.107 --- src/sys/dev/i2c/files.i2c:1.106 Fri Jan 3 03:44:42 2020 +++ src/sys/dev/i2c/files.i2c Fri Jan 3 18:00:05 2020 @@ -1,4 +1,4 @@ -# $NetBSD: files.i2c,v 1.106 2020/01/03 03:44:42 thorpej Exp $ +# $NetBSD: files.i2c,v 1.107 2020/01/03 18:00:05 jmcneill Exp $ obsolete defflag opt_i2cbus.h I2C_SCAN define i2cbus { } @@ -381,3 +381,8 @@ file dev/i2c/tda19988.c tdahdmi device es8316ac attach es8316ac at iic file dev/i2c/es8316ac.c es8316ac + +# CellWise CW2015 Fuel Gauge IC +device cwfg: sysmon_envsys +attach cwfg at iic +file dev/i2c/cwfg.ccwfg Added files: Index: src/sys/dev/i2c/cwfg.c diff -u /dev/null src/sys/dev/i2c/cwfg.c:1.1 --- /dev/null Fri Jan 3 18:00:05 2020 +++ src/sys/dev/i2c/cwfg.c Fri Jan 3 18:00:05 2020 @@ -0,0 +1,449 @@ +/* $NetBSD: cwfg.c,v 1.1 2020/01/03 18:00:05 jmcneill Exp $ */ + +/*- + * Copyright (c) 2020 Jared McNeill + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + *notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditions and the following disclaimer in the + *documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__KERNEL_RCSID(0, "$NetBSD: cwfg.c,v 1.1 2020/01/03 18:00:05 jmcneill Exp $"); + +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include + +#include + +#define VERSION_REG 0x00 +#define VCELL_HI_REG 0x02 +#define VCELL_HI __BITS(5,0) +#define VCELL_LO_REG 0x03 +#define VCELL_LO __BITS(7,0) +#define SOC_HI_REG 0x04 +#define SOC_LO_REG 0x05 +#define RTT_ALRT_HI_REG 0x06 +#define RTT_ALRT __BIT(7) +#define RTT_HI __BITS(4,0) +#define RTT_ALRT_LO_REG 0x07 +#define RTT_LO __BITS(7,0) +#define CONFIG_REG 0x08 +#define CONFIG_ATHD __BITS(7,3) +#define CONFIG_UFG __BIT(1) +#define MODE_REG 0x0a +#define MODE_SLEEP __BITS(7,6) +#define MODE_SLEEP_WAKE 0x0 +#define MODE_SLEEP_SLEEP 0x3 +#define MODE_QSTRT __BITS(5,4) +#define MODE_POR __BITS(3,0) +#define BATINFO_REG(n) (0x10 + (n)) + +#define VCELL_STEP 312 +#define VCELL_DIV 1024 +#define BATINFO_SIZE 64 +#define RESET_COUNT 30 +#define RESET_DELAY 10 + +enum cwfg_sensor { + CWFG_SENSOR_VCELL, + CWFG_SENSOR_SOC, + CWFG_SENSOR_RTT, + CWFG_NSENSORS +}; + +struct cwfg_softc { + device_t sc_dev; + i2c_tag_t sc_i2c; + i2c_addr_t sc_addr; + int sc_phandle; + + uint8_t sc_batinfo[BATINFO_SIZE]; + + u_int sc_alert_level; + u_int sc_monitor_interval; + u_int sc_design_capacity; + + struct sysmon_envsys *sc_sme; + + envsys_data_t sc_sensor[CWFG_NSENSORS]; +}; + +#define CWFG_MONITOR_INTERVAL_DEFAULT 8 +#define CWFG_DESIGN_CAPACITY_DEFAULT 2000 +#define CWFG_ALERT_LEVEL_DEFAULT 0 + +static const struct device_compatible_entry compat_data[] = { + { "cellwise,cw201x", 1 }, + { NULL,0 } +}; + +static int +cwfg_lock(struct cwfg_softc *sc) +{ + return iic_acquire_bus(sc->sc_i2c, 0); +} + +static void +cwfg_unlock(struct cwfg_softc *sc) +{ + iic_release_bus(sc->sc_i2c, 0); +} + +static int +cwfg_read(struct cwfg_softc *sc, uint8_t reg, uint8_t *val) +{ + return iic_smbus_read_byte(sc->sc_i2c, sc->sc_addr, reg, val, 0); +} + +static int +cwfg_write(struct cwfg_softc *sc, uint8_t reg, uint8_t val) +{ + return iic_smbus_write_byte(sc->sc_i2c, sc->sc_addr, reg, val, 0); +} + +static voi
CVS commit: src/sys/arch/evbarm/conf
Module Name:src Committed By: jmcneill Date: Fri Jan 3 18:00:20 UTC 2020 Modified Files: src/sys/arch/evbarm/conf: GENERIC64 Log Message: add cwfg To generate a diff of this commit: cvs rdiff -u -r1.125 -r1.126 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.125 src/sys/arch/evbarm/conf/GENERIC64:1.126 --- src/sys/arch/evbarm/conf/GENERIC64:1.125 Thu Jan 2 23:01:54 2020 +++ src/sys/arch/evbarm/conf/GENERIC64 Fri Jan 3 18:00:20 2020 @@ -1,5 +1,5 @@ # -# $NetBSD: GENERIC64,v 1.125 2020/01/02 23:01:54 ryo Exp $ +# $NetBSD: GENERIC64,v 1.126 2020/01/03 18:00:20 jmcneill Exp $ # # GENERIC ARM (aarch64) kernel # @@ -362,6 +362,7 @@ as3722pmic* at iic? as3722reg* at as3722pmic? axppmic* at iic? # X-Powers AXP Power Management IC axpreg* at axppmic? +cwfg* at iic? # CellWise CW2015 Fuel Gauge IC es8316ac* at iic? # Everest Semi ES8316 Audio CODEC fan53555reg* at iic? # FAN53555 / SY82x regulator max77620pmic* at iic?
CVS commit: src/usr.bin/vmstat
Module Name:src Committed By: thorpej Date: Fri Jan 3 19:13:54 UTC 2020 Modified Files: src/usr.bin/vmstat: vmstat.c Log Message: boottime in the kernel is no more. Instead, read timebasebin and convert from bintime to timespec. To generate a diff of this commit: cvs rdiff -u -r1.230 -r1.231 src/usr.bin/vmstat/vmstat.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/vmstat/vmstat.c diff -u src/usr.bin/vmstat/vmstat.c:1.230 src/usr.bin/vmstat/vmstat.c:1.231 --- src/usr.bin/vmstat/vmstat.c:1.230 Fri Dec 27 09:45:27 2019 +++ src/usr.bin/vmstat/vmstat.c Fri Jan 3 19:13:54 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: vmstat.c,v 1.230 2019/12/27 09:45:27 msaitoh Exp $ */ +/* $NetBSD: vmstat.c,v 1.231 2020/01/03 19:13:54 thorpej Exp $ */ /*- * Copyright (c) 1998, 2000, 2001, 2007, 2019 The NetBSD Foundation, Inc. @@ -70,7 +70,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 19 #if 0 static char sccsid[] = "@(#)vmstat.c 8.2 (Berkeley) 3/1/95"; #else -__RCSID("$NetBSD: vmstat.c,v 1.230 2019/12/27 09:45:27 msaitoh Exp $"); +__RCSID("$NetBSD: vmstat.c,v 1.231 2020/01/03 19:13:54 thorpej Exp $"); #endif #endif /* not lint */ @@ -150,8 +150,8 @@ struct cpu_info { */ struct nlist namelist[] = { -#define X_BOOTTIME 0 - { .n_name = "_boottime" }, +#define X_TIMEBASEBIN 0 + { .n_name = "_timebasebin" }, #define X_HZ 1 { .n_name = "_hz" }, #define X_STATHZ 2 @@ -642,9 +642,13 @@ getuptime(void) } clock_gettime(CLOCK_REALTIME, &now); } else { - if (boottime.tv_sec == 0) - kread(namelist, X_BOOTTIME, &boottime, - sizeof(boottime)); + if (boottime.tv_sec == 0) { + struct bintime bt; + + kread(namelist, X_TIMEBASEBIN, &bt, + sizeof(bt)); + bintime2timespec(&bt, &boottime); + } if (kreadc(namelist, X_TIME_SECOND, &nowsec, sizeof(nowsec))) { /* * XXX this assignment dance can be removed once
CVS commit: src/sys/external/bsd/drm2
Module Name:src Committed By: jmcneill Date: Fri Jan 3 21:01:17 UTC 2020 Modified Files: src/sys/external/bsd/drm2/dist/drm: drm_bridge.c drm_panel.c src/sys/external/bsd/drm2/dist/include/drm: drm_crtc.h drm_panel.h src/sys/external/bsd/drm2/drm: drm_module.c Log Message: Initialize drm_bridge and drm_panel locks. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/sys/external/bsd/drm2/dist/drm/drm_bridge.c \ src/sys/external/bsd/drm2/dist/drm/drm_panel.c cvs rdiff -u -r1.7 -r1.8 \ src/sys/external/bsd/drm2/dist/include/drm/drm_crtc.h cvs rdiff -u -r1.2 -r1.3 \ src/sys/external/bsd/drm2/dist/include/drm/drm_panel.h cvs rdiff -u -r1.16 -r1.17 src/sys/external/bsd/drm2/drm/drm_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/external/bsd/drm2/dist/drm/drm_bridge.c diff -u src/sys/external/bsd/drm2/dist/drm/drm_bridge.c:1.3 src/sys/external/bsd/drm2/dist/drm/drm_bridge.c:1.4 --- src/sys/external/bsd/drm2/dist/drm/drm_bridge.c:1.3 Mon Aug 27 06:43:47 2018 +++ src/sys/external/bsd/drm2/dist/drm/drm_bridge.c Fri Jan 3 21:01:16 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: drm_bridge.c,v 1.3 2018/08/27 06:43:47 riastradh Exp $ */ +/* $NetBSD: drm_bridge.c,v 1.4 2020/01/03 21:01:16 jmcneill Exp $ */ /* * Copyright (c) 2014 Samsung Electronics Co., Ltd @@ -24,7 +24,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: drm_bridge.c,v 1.3 2018/08/27 06:43:47 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: drm_bridge.c,v 1.4 2020/01/03 21:01:16 jmcneill Exp $"); #include #include @@ -66,6 +66,17 @@ static DEFINE_MUTEX(bridge_lock); static LIST_HEAD(bridge_list); #endif +#ifdef __NetBSD__ +void drm_bridge_init_lock(void) +{ + linux_mutex_init(&bridge_lock); +} +void drm_bridge_fini_lock(void) +{ + linux_mutex_destroy(&bridge_lock); +} +#endif + /** * drm_bridge_add - add the given bridge to the global bridge list * Index: src/sys/external/bsd/drm2/dist/drm/drm_panel.c diff -u src/sys/external/bsd/drm2/dist/drm/drm_panel.c:1.3 src/sys/external/bsd/drm2/dist/drm/drm_panel.c:1.4 --- src/sys/external/bsd/drm2/dist/drm/drm_panel.c:1.3 Mon Dec 9 15:36:16 2019 +++ src/sys/external/bsd/drm2/dist/drm/drm_panel.c Fri Jan 3 21:01:16 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: drm_panel.c,v 1.3 2019/12/09 15:36:16 jakllsch Exp $ */ +/* $NetBSD: drm_panel.c,v 1.4 2020/01/03 21:01:16 jmcneill Exp $ */ /* * Copyright (C) 2013, NVIDIA Corporation. All rights reserved. @@ -24,7 +24,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: drm_panel.c,v 1.3 2019/12/09 15:36:16 jakllsch Exp $"); +__KERNEL_RCSID(0, "$NetBSD: drm_panel.c,v 1.4 2020/01/03 21:01:16 jmcneill Exp $"); #include #include @@ -40,6 +40,17 @@ static DEFINE_MUTEX(panel_lock); static LIST_HEAD(panel_list); #endif +#ifdef __NetBSD__ +void drm_panel_init_lock(void) +{ + linux_mutex_init(&panel_lock); +} +void drm_panel_fini_lock(void) +{ + linux_mutex_destroy(&panel_lock); +} +#endif + void drm_panel_init(struct drm_panel *panel) { INIT_LIST_HEAD(&panel->list); Index: src/sys/external/bsd/drm2/dist/include/drm/drm_crtc.h diff -u src/sys/external/bsd/drm2/dist/include/drm/drm_crtc.h:1.7 src/sys/external/bsd/drm2/dist/include/drm/drm_crtc.h:1.8 --- src/sys/external/bsd/drm2/dist/include/drm/drm_crtc.h:1.7 Mon Aug 27 06:46:02 2018 +++ src/sys/external/bsd/drm2/dist/include/drm/drm_crtc.h Fri Jan 3 21:01:16 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: drm_crtc.h,v 1.7 2018/08/27 06:46:02 riastradh Exp $ */ +/* $NetBSD: drm_crtc.h,v 1.8 2020/01/03 21:01:16 jmcneill Exp $ */ /* * Copyright © 2006 Keith Packard @@ -1224,6 +1224,11 @@ extern unsigned int drm_connector_index( /* helper to unplug all connectors from sysfs for device */ extern void drm_connector_unplug_all(struct drm_device *dev); +#ifdef __NetBSD__ +extern void drm_bridge_init_lock(void); +extern void drm_bridge_fini_lock(void); +#endif + extern int drm_bridge_add(struct drm_bridge *bridge); extern void drm_bridge_remove(struct drm_bridge *bridge); extern struct drm_bridge *of_drm_find_bridge(struct device_node *np); Index: src/sys/external/bsd/drm2/dist/include/drm/drm_panel.h diff -u src/sys/external/bsd/drm2/dist/include/drm/drm_panel.h:1.2 src/sys/external/bsd/drm2/dist/include/drm/drm_panel.h:1.3 --- src/sys/external/bsd/drm2/dist/include/drm/drm_panel.h:1.2 Mon Aug 27 04:58:38 2018 +++ src/sys/external/bsd/drm2/dist/include/drm/drm_panel.h Fri Jan 3 21:01:16 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: drm_panel.h,v 1.2 2018/08/27 04:58:38 riastradh Exp $ */ +/* $NetBSD: drm_panel.h,v 1.3 2020/01/03 21:01:16 jmcneill Exp $ */ /* * Copyright (C) 2013, NVIDIA Corporation. All rights reserved. @@ -127,6 +127,11 @@ static inline int drm_panel_get_modes(st return panel ? -ENOSYS : -EINVAL; } +#ifdef __NetBSD__ +void drm_panel_init_lock(void); +void drm_panel_fini_lock(void); +#endif + void drm_panel_init(struct drm_pane
CVS commit: src/sys/dev/i2c
Module Name:src Committed By: thorpej Date: Sat Jan 4 02:21:15 UTC 2020 Modified Files: src/sys/dev/i2c: as3722.c Log Message: No need to use I2C_F_POLL here. To generate a diff of this commit: cvs rdiff -u -r1.18 -r1.19 src/sys/dev/i2c/as3722.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/i2c/as3722.c diff -u src/sys/dev/i2c/as3722.c:1.18 src/sys/dev/i2c/as3722.c:1.19 --- src/sys/dev/i2c/as3722.c:1.18 Mon Dec 23 15:48:51 2019 +++ src/sys/dev/i2c/as3722.c Sat Jan 4 02:21:15 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: as3722.c,v 1.18 2019/12/23 15:48:51 thorpej Exp $ */ +/* $NetBSD: as3722.c,v 1.19 2020/01/04 02:21:15 thorpej Exp $ */ /*- * Copyright (c) 2015 Jared D. McNeill @@ -29,7 +29,7 @@ #include "opt_fdt.h" #include -__KERNEL_RCSID(0, "$NetBSD: as3722.c,v 1.18 2019/12/23 15:48:51 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: as3722.c,v 1.19 2020/01/04 02:21:15 thorpej Exp $"); #include #include @@ -850,13 +850,11 @@ as3722_poweroff(device_t dev) struct as3722_softc * const sc = device_private(dev); int error; - const int flags = I2C_F_POLL; - - error = iic_acquire_bus(sc->sc_i2c, flags); + error = iic_acquire_bus(sc->sc_i2c, 0); if (error == 0) { error = as3722_write(sc, AS3722_RESET_CTRL_REG, - AS3722_RESET_CTRL_POWER_OFF, flags); - iic_release_bus(sc->sc_i2c, flags); + AS3722_RESET_CTRL_POWER_OFF, 0); + iic_release_bus(sc->sc_i2c, 0); } if (error) { device_printf(dev, "WARNING: unable to power off, error %d\n", @@ -872,13 +870,11 @@ as3722_reboot(device_t dev) struct as3722_softc * const sc = device_private(dev); int error; - const int flags = I2C_F_POLL; - - error = iic_acquire_bus(sc->sc_i2c, flags); + error = iic_acquire_bus(sc->sc_i2c, 0); if (error == 0) { error = as3722_write(sc, AS3722_RESET_CTRL_REG, - AS3722_RESET_CTRL_FORCE_RESET, flags); - iic_release_bus(sc->sc_i2c, flags); + AS3722_RESET_CTRL_FORCE_RESET, 0); + iic_release_bus(sc->sc_i2c, 0); } if (error) { device_printf(dev, "WARNING: unable to reboot, error %d\n",
CVS commit: src/sys/compat/common
Module Name:src Committed By: pgoyette Date: Sat Jan 4 02:40:22 UTC 2020 Modified Files: src/sys/compat/common: compat_90_mod.c Log Message: Resurrect boottime, but only in the compat_90 module (whether built-in or separately loaded). This will enable running of old vmstat(1) images on newer kernels. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/compat/common/compat_90_mod.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/compat_90_mod.c diff -u src/sys/compat/common/compat_90_mod.c:1.2 src/sys/compat/common/compat_90_mod.c:1.3 --- src/sys/compat/common/compat_90_mod.c:1.2 Mon Oct 28 23:32:15 2019 +++ src/sys/compat/common/compat_90_mod.c Sat Jan 4 02:40:22 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: compat_90_mod.c,v 1.2 2019/10/28 23:32:15 christos Exp $ */ +/* $NetBSD: compat_90_mod.c,v 1.3 2020/01/04 02:40:22 pgoyette Exp $ */ /*- * Copyright (c) 2019 The NetBSD Foundation, Inc. @@ -38,7 +38,7 @@ #endif #include -__KERNEL_RCSID(0, "$NetBSD: compat_90_mod.c,v 1.2 2019/10/28 23:32:15 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: compat_90_mod.c,v 1.3 2020/01/04 02:40:22 pgoyette Exp $"); #include #include @@ -77,3 +77,5 @@ compat_90_modcmd(modcmd_t cmd, void *arg return ENOTTY; } } + +struct timespec boottime; /* For access by older vmstat */
CVS commit: src/usr.bin/vmstat
Module Name:src Committed By: mrg Date: Sat Jan 4 03:09:55 UTC 2020 Modified Files: src/usr.bin/vmstat: vmstat.c Log Message: move the time nlist fetches into their own namelist and only fetch them when necessary. allow for fallback uses of older time sources if others are not present. this stops vmstat from exiting if it can't get the addresses of these time values it often doesn't need (eg, running kernels use the sysctl method), which has cropped up recently wit the removal of boottime variable. a slighly modified version of this patch (modified to handle the old boottime variable over the new one) works against a netbsd-9 vmstat in -current too. XXX: pullup To generate a diff of this commit: cvs rdiff -u -r1.231 -r1.232 src/usr.bin/vmstat/vmstat.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/vmstat/vmstat.c diff -u src/usr.bin/vmstat/vmstat.c:1.231 src/usr.bin/vmstat/vmstat.c:1.232 --- src/usr.bin/vmstat/vmstat.c:1.231 Fri Jan 3 19:13:54 2020 +++ src/usr.bin/vmstat/vmstat.c Sat Jan 4 03:09:55 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: vmstat.c,v 1.231 2020/01/03 19:13:54 thorpej Exp $ */ +/* $NetBSD: vmstat.c,v 1.232 2020/01/04 03:09:55 mrg Exp $ */ /*- * Copyright (c) 1998, 2000, 2001, 2007, 2019 The NetBSD Foundation, Inc. @@ -70,7 +70,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 19 #if 0 static char sccsid[] = "@(#)vmstat.c 8.2 (Berkeley) 3/1/95"; #else -__RCSID("$NetBSD: vmstat.c,v 1.231 2020/01/03 19:13:54 thorpej Exp $"); +__RCSID("$NetBSD: vmstat.c,v 1.232 2020/01/04 03:09:55 mrg Exp $"); #endif #endif /* not lint */ @@ -150,27 +150,36 @@ struct cpu_info { */ struct nlist namelist[] = { -#define X_TIMEBASEBIN 0 - { .n_name = "_timebasebin" }, -#define X_HZ 1 +#define X_HZ 0 { .n_name = "_hz" }, -#define X_STATHZ 2 +#define X_STATHZ 1 { .n_name = "_stathz" }, -#define X_NCHSTATS 3 +#define X_NCHSTATS 2 { .n_name = "_nchstats" }, -#define X_ALLEVENTS 4 +#define X_ALLEVENTS 3 { .n_name = "_allevents" }, -#define X_POOLHEAD 5 +#define X_POOLHEAD 4 { .n_name = "_pool_head" }, -#define X_UVMEXP 6 +#define X_UVMEXP 5 { .n_name = "_uvmexp" }, -#define X_TIME_SECOND 7 +#define X_CPU_INFOS 6 + { .n_name = "_cpu_infos" }, +#define X_NL_SIZE 7 + { .n_name = NULL }, +}; + +/* + * Namelist for time data. + */ +struct nlist timenl[] = +{ +#define X_TIMEBASEBIN 0 + { .n_name = "_timebasebin" }, +#define X_TIME_SECOND 1 { .n_name = "_time_second" }, -#define X_TIME 8 +#define X_TIME 2 { .n_name = "_time" }, -#define X_CPU_INFOS 9 - { .n_name = "_cpu_infos" }, -#define X_NL_SIZE 10 +#define X_TIMENL_SIZE 3 { .n_name = NULL }, }; @@ -559,9 +568,7 @@ getnlist(int todo) errx(1, "kvm_nlist: %s %s", "namelist", kvm_geterr(kd)); for (i = 0; i < __arraycount(namelist)-1; i++) -if (namelist[i].n_type == 0 && -i != X_TIME_SECOND && -i != X_TIME) { +if (namelist[i].n_type == 0) { if (doexit++ == 0) (void)fprintf(stderr, "%s: undefined symbols:", @@ -575,6 +582,11 @@ getnlist(int todo) } } } + if ((todo & (VMSTAT|INTRSTAT)) && !(done & (VMSTAT))) { + done |= VMSTAT; + if ((c = kvm_nlist(kd, timenl)) == -1 || c == X_TIMENL_SIZE) + errx(1, "kvm_nlist: %s %s", "timenl", kvm_geterr(kd)); + } if ((todo & (SUMSTAT|INTRSTAT)) && !(done & (SUMSTAT|INTRSTAT))) { done |= SUMSTAT|INTRSTAT; (void) kvm_nlist(kd, intrnl); @@ -645,11 +657,10 @@ getuptime(void) if (boottime.tv_sec == 0) { struct bintime bt; - kread(namelist, X_TIMEBASEBIN, &bt, - sizeof(bt)); + kread(timenl, X_TIMEBASEBIN, &bt, sizeof(bt)); bintime2timespec(&bt, &boottime); } - if (kreadc(namelist, X_TIME_SECOND, &nowsec, sizeof(nowsec))) { + if (kreadc(timenl, X_TIME_SECOND, &nowsec, sizeof(nowsec))) { /* * XXX this assignment dance can be removed once * timeval tv_sec is SUS mandated time_t @@ -657,7 +668,7 @@ getuptime(void) now.tv_sec = nowsec; now.tv_nsec = 0; } else { - kread(namelist, X_TIME, &now, sizeof(now)); + kread(timenl, X_TIME, &now, sizeof(now)); } } uptime = now.tv_sec - boottime.tv_sec;
CVS commit: src/usr.sbin/fstyp
Module Name:src Committed By: tkusumi Date: Sat Jan 4 03:43:18 UTC 2020 Modified Files: src/usr.sbin/fstyp: hammer2.c Log Message: fstyp: Cleanup hammer2.c (sync with recent DragonFly commit) taken-from DragonFlyBSD 841ef9e93aea61adab688e9476604e7a03291ef0 To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/usr.sbin/fstyp/hammer2.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.sbin/fstyp/hammer2.c diff -u src/usr.sbin/fstyp/hammer2.c:1.2 src/usr.sbin/fstyp/hammer2.c:1.3 --- src/usr.sbin/fstyp/hammer2.c:1.2 Wed Jan 1 11:46:43 2020 +++ src/usr.sbin/fstyp/hammer2.c Sat Jan 4 03:43:18 2020 @@ -1,4 +1,4 @@ -/*$NetBSD: hammer2.c,v 1.2 2020/01/01 11:46:43 tkusumi Exp $ */ +/*$NetBSD: hammer2.c,v 1.3 2020/01/04 03:43:18 tkusumi Exp $ */ /*- * Copyright (c) 2017-2019 The DragonFly Project @@ -27,7 +27,7 @@ * SUCH DAMAGE. */ #include -__KERNEL_RCSID(0, "$NetBSD: hammer2.c,v 1.2 2020/01/01 11:46:43 tkusumi Exp $"); +__KERNEL_RCSID(0, "$NetBSD: hammer2.c,v 1.3 2020/01/04 03:43:18 tkusumi Exp $"); #include #include @@ -74,7 +74,7 @@ read_media(FILE *fp, const hammer2_block *media_bytes = bytes; if (!bytes) { - warnx("Blockref has no data"); + warnx("blockref has no data"); return (NULL); } @@ -87,17 +87,17 @@ read_media(FILE *fp, const hammer2_block io_bytes <<= 1; if (io_bytes > sizeof(hammer2_media_data_t)) { - warnx("Invalid I/O bytes"); + warnx("invalid I/O bytes"); return (NULL); } if (fseek(fp, (long int)io_base, SEEK_SET) == -1) { - warnx("Failed to seek media"); + warnx("failed to seek media"); return (NULL); } media = read_buf(fp, (off_t)io_base, io_bytes); if (media == NULL) { - warnx("Failed to read media"); + warnx("failed to read media"); return (NULL); } if (boff) @@ -204,7 +204,7 @@ read_label(FILE *fp, char *label, size_t hammer2_media_data_t *vols[HAMMER2_NUM_VOLHDRS], *media; size_t bytes; bool res = false; - int i, best_i, error = 0; + int i, best_i, error = 1; const char *pfs; char *devname; @@ -226,22 +226,19 @@ read_label(FILE *fp, char *label, size_t } } if (best_i == -1) { - warnx("Failed to find best zone"); - error = 1; - goto done; + warnx("failed to find best zone"); + goto fail; } bref = &vols[best_i]->voldata.sroot_blockset.blockref[0]; if (bref->type != HAMMER2_BREF_TYPE_INODE) { - warnx("Blockref type is not inode"); - error = 1; - goto done; + warnx("blockref type is not inode"); + goto fail; } media = read_media(fp, bref, &bytes); if (media == NULL) { - error = 1; - goto done; + goto fail; } /* @@ -267,8 +264,7 @@ read_label(FILE *fp, char *label, size_t pfs++; if (strlen(pfs) > HAMMER2_INODE_MAXNAME) { - error = 1; - goto done; + goto fail; } devname = extract_device_name(devpath); #else @@ -295,7 +291,8 @@ read_label(FILE *fp, char *label, size_t if (devname) free(devname); free(media); -done: + error = 0; +fail: for (i = 0; i < HAMMER2_NUM_VOLHDRS; i++) free(vols[i]); @@ -310,10 +307,10 @@ fstyp_hammer2(FILE *fp, char *label, siz voldata = read_voldata(fp); if (test_voldata(voldata)) - goto done; + goto fail; error = read_label(fp, label, size); -done: +fail: free(voldata); return (error); }
CVS commit: src/sys/kern
Module Name:src Committed By: kamil Date: Sat Jan 4 03:46:19 UTC 2020 Modified Files: src/sys/kern: files.kern Added Files: src/sys/kern: sys_process_lwpstatus.c Removed Files: src/sys/kern: sys_ptrace_lwpstatus.c Log Message: Rename sys_ptrace_lwpstatus.c to sys_process_lwpstatus.c Keep the names of functions internally as ptrace intact as this code is shared with core_elf32.c that already reaches ptrace(2) specifc symbols. No functional change intended. To generate a diff of this commit: cvs rdiff -u -r1.41 -r1.42 src/sys/kern/files.kern cvs rdiff -u -r0 -r1.1 src/sys/kern/sys_process_lwpstatus.c cvs rdiff -u -r1.1 -r0 src/sys/kern/sys_ptrace_lwpstatus.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/files.kern diff -u src/sys/kern/files.kern:1.41 src/sys/kern/files.kern:1.42 --- src/sys/kern/files.kern:1.41 Thu Dec 26 08:52:38 2019 +++ src/sys/kern/files.kern Sat Jan 4 03:46:19 2020 @@ -1,4 +1,4 @@ -# $NetBSD: files.kern,v 1.41 2019/12/26 08:52:38 kamil Exp $ +# $NetBSD: files.kern,v 1.42 2020/01/04 03:46:19 kamil Exp $ # # kernel sources @@ -161,9 +161,9 @@ file kern/sys_mqueue.c mqueue file kern/sys_lwp.c kern file kern/sys_pipe.c !pipe_socketpair file kern/sys_process.c ptrace_hooks | ktrace +file kern/sys_process_lwpstatus.c kern file kern/sys_ptrace.c ptrace file kern/sys_ptrace_common.c ptrace -file kern/sys_ptrace_lwpstatus.c kern file kern/sys_pset.c kern file kern/sys_select.c kern file kern/sys_sig.c kern Added files: Index: src/sys/kern/sys_process_lwpstatus.c diff -u /dev/null src/sys/kern/sys_process_lwpstatus.c:1.1 --- /dev/null Sat Jan 4 03:46:19 2020 +++ src/sys/kern/sys_process_lwpstatus.c Sat Jan 4 03:46:19 2020 @@ -0,0 +1,69 @@ +/* $NetBSD: sys_process_lwpstatus.c,v 1.1 2020/01/04 03:46:19 kamil Exp $ */ + +/*- + * Copyright (c) 2019 The NetBSD Foundation, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + *notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditions and the following disclaimer in the + *documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__KERNEL_RCSID(0, "$NetBSD: sys_process_lwpstatus.c,v 1.1 2020/01/04 03:46:19 kamil Exp $"); + +#include +#include +#include +#include +#include + + +void +ptrace_read_lwpstatus(struct lwp *l, struct ptrace_lwpstatus *pls) +{ + + KASSERT(l->l_lid == pls->pl_lwpid); + + memcpy(&pls->pl_sigmask, &l->l_sigmask, sizeof(pls->pl_sigmask)); + memcpy(&pls->pl_sigpend, &l->l_sigpend.sp_set, sizeof(pls->pl_sigpend)); + + if (l->l_name == NULL) + memset(&pls->pl_name, 0, PL_LNAMELEN); + else { + KASSERT(strlen(l->l_name) < PL_LNAMELEN); + strncpy(pls->pl_name, l->l_name, PL_LNAMELEN); + } + +#ifdef PTRACE_LWP_GETPRIVATE + pls->pl_private = (void *)(intptr_t)PTRACE_LWP_GETPRIVATE(l); +#else + pls->pl_private = l->l_private; +#endif +} + +void +process_read_lwpstatus(struct lwp *l, struct ptrace_lwpstatus *pls) +{ + + pls->pl_lwpid = l->l_lid; + + ptrace_read_lwpstatus(l, pls); +}
CVS commit: src/lib/libc/sys
Module Name:src Committed By: kamil Date: Sat Jan 4 04:40:17 UTC 2020 Modified Files: src/lib/libc/sys: ptrace.2 Log Message: /tmp/cvsbigmGa To generate a diff of this commit: cvs rdiff -u -r1.82 -r1.83 src/lib/libc/sys/ptrace.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/ptrace.2 diff -u src/lib/libc/sys/ptrace.2:1.82 src/lib/libc/sys/ptrace.2:1.83 --- src/lib/libc/sys/ptrace.2:1.82 Wed Oct 9 14:20:47 2019 +++ src/lib/libc/sys/ptrace.2 Sat Jan 4 04:40:17 2020 @@ -1,7 +1,7 @@ -.\" $NetBSD: ptrace.2,v 1.82 2019/10/09 14:20:47 wiz Exp $ +.\" $NetBSD: ptrace.2,v 1.83 2020/01/04 04:40:17 kamil Exp $ .\" .\" This file is in the public domain. -.Dd October 9, 2019 +.Dd January 4, 2019 .Dt PTRACE 2 .Os .Sh NAME @@ -399,7 +399,7 @@ argument should contain the name of the and the .Fa data argument should contain the length of the core filename. -.It Dv PT_LWPINFO +.It Dv PT_LWPSTATUS Returns information about a thread from the list of threads for the process specified in the .Fa pid @@ -407,41 +407,50 @@ argument. The .Fa addr argument should contain a -.Vt struct ptrace_lwpinfo +.Vt struct ptrace_lwpstatus defined as: .Bd -literal -offset indent -struct ptrace_lwpinfo { +struct ptrace_lwpstatus { lwpid_t pl_lwpid; - int pl_event; + sigset_t pl_sigpend; + sigset_t pl_sigmask; + char pl_name[20]; + void *pl_private; }; .Ed .Pp where .Fa pl_lwpid contains a thread LWP ID. -Information is returned for the thread following the one with the +Information is returned for the thread specified in +.Fa pl_lwpid . +.Fa pl_sigpend +contains the signals pending on that LWP. +.Fa pl_sigmask +contains the signals masked on that LWP. +.Fa pl_name +contains printable name of the LWP. +The string is always NUL terminated. +.Fa pl_private +contains the pointer to TLS base. +.Pp +The +.Fa data +argument should contain +.Dq Li sizeof(struct ptrace_lwpinfo) . +.It Dv PT_LWPNEXT +Is the same as +.Dv PT_LWPSTATUS , +except that information is returned for the thread following the one with the specified ID in the process thread list, or for the first thread if .Fa pl_lwpid is 0. +.Pp Upon return .Fa pl_lwpid contains the LWP ID of the thread that was found, or 0 if there is no thread after the one whose LWP ID was supplied in the call. -.Fa pl_event -contains the event that stopped the thread. -Possible values are: -.Pp -.Bl -tag -width 30n -offset indent -compact -.It Dv PL_EVENT_NONE -.It Dv PL_EVENT_SIGNAL -.It Dv PL_EVENT_SUSPENDED -.El -.Pp -The -.Fa data -argument should contain -.Dq Li sizeof(struct ptrace_lwpinfo) . .It Dv PT_SYSCALL Stops a process before and after executing each system call. Otherwise this operation is the same as @@ -987,10 +996,3 @@ to .Fn ptrace .Ec , should be able to sidestep this. -.Pp -.Dv PT_SET_SIGINFO , -.Dv PT_RESUME -and -.Dv PT_SUSPEND -can change the image of process returned by -.Dv PT_LWPINFO .