CVS commit: src/sys/dev/scsipi
Module Name:src Committed By: msaitoh Date: Tue Sep 29 03:04:03 UTC 2020 Modified Files: src/sys/dev/scsipi: cd.c Log Message: s/settng/setting/ To generate a diff of this commit: cvs rdiff -u -r1.347 -r1.348 src/sys/dev/scsipi/cd.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/scsipi/cd.c diff -u src/sys/dev/scsipi/cd.c:1.347 src/sys/dev/scsipi/cd.c:1.348 --- src/sys/dev/scsipi/cd.c:1.347 Tue Sep 29 03:02:19 2020 +++ src/sys/dev/scsipi/cd.c Tue Sep 29 03:04:03 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: cd.c,v 1.347 2020/09/29 03:02:19 msaitoh Exp $ */ +/* $NetBSD: cd.c,v 1.348 2020/09/29 03:04:03 msaitoh Exp $ */ /*- * Copyright (c) 1998, 2001, 2003, 2004, 2005, 2008 The NetBSD Foundation, @@ -50,7 +50,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: cd.c,v 1.347 2020/09/29 03:02:19 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: cd.c,v 1.348 2020/09/29 03:04:03 msaitoh Exp $"); #include #include @@ -1030,7 +1030,7 @@ cdminphys(struct buf *bp) * * XXX Note that the SCSI-I spec says that 256-block transfers * are allowed in a 6-byte read/write, and are specified - * by settng the "length" to 0. However, we're conservative + * by setting the "length" to 0. However, we're conservative * here, allowing only 255-block transfers in case an * ancient device gets confused by length == 0. A length of 0 * in a 10-byte read/write actually means 0 blocks.
CVS commit: src
Module Name:src Committed By: msaitoh Date: Tue Sep 29 03:02:19 UTC 2020 Modified Files: src/sys/arch/atari/dev: ncr5380.c src/sys/arch/mac68k/dev: ncr5380.c src/sys/dev/scsipi: cd.c src/sys/fs/nfs/client: nfs_clbio.c src/usr.bin/config: config.5 Log Message: s/implicitely/implicitly/ To generate a diff of this commit: cvs rdiff -u -r1.73 -r1.74 src/sys/arch/atari/dev/ncr5380.c cvs rdiff -u -r1.67 -r1.68 src/sys/arch/mac68k/dev/ncr5380.c cvs rdiff -u -r1.346 -r1.347 src/sys/dev/scsipi/cd.c cvs rdiff -u -r1.5 -r1.6 src/sys/fs/nfs/client/nfs_clbio.c cvs rdiff -u -r1.44 -r1.45 src/usr.bin/config/config.5 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/atari/dev/ncr5380.c diff -u src/sys/arch/atari/dev/ncr5380.c:1.73 src/sys/arch/atari/dev/ncr5380.c:1.74 --- src/sys/arch/atari/dev/ncr5380.c:1.73 Sat Jun 29 16:41:19 2019 +++ src/sys/arch/atari/dev/ncr5380.c Tue Sep 29 03:02:18 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: ncr5380.c,v 1.73 2019/06/29 16:41:19 tsutsui Exp $ */ +/* $NetBSD: ncr5380.c,v 1.74 2020/09/29 03:02:18 msaitoh Exp $ */ /* * Copyright (c) 1995 Leo Weppelman. @@ -26,7 +26,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ncr5380.c,v 1.73 2019/06/29 16:41:19 tsutsui Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ncr5380.c,v 1.74 2020/09/29 03:02:18 msaitoh Exp $"); /* * Bit mask of targets you want debugging to be shown @@ -1218,7 +1218,7 @@ handle_message(SC_REQ *reqp, u_int msg) case MSG_SAVEDATAPOINTER: case MSG_RESTOREPOINTERS: /* - * We save pointers implicitely at disconnect. + * We save pointers implicitly at disconnect. * So we can ignore these messages. */ ack_message(); Index: src/sys/arch/mac68k/dev/ncr5380.c diff -u src/sys/arch/mac68k/dev/ncr5380.c:1.67 src/sys/arch/mac68k/dev/ncr5380.c:1.68 --- src/sys/arch/mac68k/dev/ncr5380.c:1.67 Sat Oct 18 08:33:25 2014 +++ src/sys/arch/mac68k/dev/ncr5380.c Tue Sep 29 03:02:18 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: ncr5380.c,v 1.67 2014/10/18 08:33:25 snj Exp $ */ +/* $NetBSD: ncr5380.c,v 1.68 2020/09/29 03:02:18 msaitoh Exp $ */ /* * Copyright (c) 1995 Leo Weppelman. @@ -26,7 +26,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ncr5380.c,v 1.67 2014/10/18 08:33:25 snj Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ncr5380.c,v 1.68 2020/09/29 03:02:18 msaitoh Exp $"); /* * Bit mask of targets you want debugging to be shown @@ -1194,7 +1194,7 @@ handle_message(SC_REQ *reqp, u_int msg) case MSG_SAVEDATAPOINTER: case MSG_RESTOREPOINTERS: /* - * We save pointers implicitely at disconnect. + * We save pointers implicitly at disconnect. * So we can ignore these messages. */ ack_message(); Index: src/sys/dev/scsipi/cd.c diff -u src/sys/dev/scsipi/cd.c:1.346 src/sys/dev/scsipi/cd.c:1.347 --- src/sys/dev/scsipi/cd.c:1.346 Tue Sep 29 02:58:52 2020 +++ src/sys/dev/scsipi/cd.c Tue Sep 29 03:02:19 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: cd.c,v 1.346 2020/09/29 02:58:52 msaitoh Exp $ */ +/* $NetBSD: cd.c,v 1.347 2020/09/29 03:02:19 msaitoh Exp $ */ /*- * Copyright (c) 1998, 2001, 2003, 2004, 2005, 2008 The NetBSD Foundation, @@ -50,7 +50,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: cd.c,v 1.346 2020/09/29 02:58:52 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: cd.c,v 1.347 2020/09/29 03:02:19 msaitoh Exp $"); #include #include @@ -758,7 +758,7 @@ bad: /* * Issue single I/O command * - * Called from dk_start and implicitely from dk_strategy + * Called from dk_start and implicitly from dk_strategy */ static int cd_diskstart(device_t dev, struct buf *bp) Index: src/sys/fs/nfs/client/nfs_clbio.c diff -u src/sys/fs/nfs/client/nfs_clbio.c:1.5 src/sys/fs/nfs/client/nfs_clbio.c:1.6 --- src/sys/fs/nfs/client/nfs_clbio.c:1.5 Mon Sep 3 16:29:34 2018 +++ src/sys/fs/nfs/client/nfs_clbio.c Tue Sep 29 03:02:19 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: nfs_clbio.c,v 1.5 2018/09/03 16:29:34 riastradh Exp $ */ +/* $NetBSD: nfs_clbio.c,v 1.6 2020/09/29 03:02:19 msaitoh Exp $ */ /*- * Copyright (c) 1989, 1993 * The Regents of the University of California. All rights reserved. @@ -35,7 +35,7 @@ #include /* __FBSDID("FreeBSD: head/sys/fs/nfsclient/nfs_clbio.c 304026 2016-08-12 22:44:59Z rmacklem "); */ -__RCSID("$NetBSD: nfs_clbio.c,v 1.5 2018/09/03 16:29:34 riastradh Exp $"); +__RCSID("$NetBSD: nfs_clbio.c,v 1.6 2020/09/29 03:02:19 msaitoh Exp $"); #include #include @@ -1231,7 +1231,7 @@ again: if (ioflag & IO_UNIT) { VATTR_NULL(); vattr.va_size = orig_size; - /* IO_SYNC is handled implicitely */ + /* IO_SYNC is handled implicitly */ (void)VOP_SETATTR(vp, , cred); uio->uio_offset -= orig_resid - uio->uio_resid; uio->uio_resid = orig_resid; Index: src/usr.bin/config/config.5 diff -u src/usr.bin/config/config.5:1.44 src/usr.bin/config/config.5:1.45 --- src/usr.bin/config/config.5:1.44 Fri Jul 31 23:55:57 2020 +++
CVS commit: src
Module Name:src Committed By: msaitoh Date: Tue Sep 29 02:58:53 UTC 2020 Modified Files: src/bin/csh: file.c src/distrib/utils/more: more.help prim.c src/lib/libc/arch/vax/string: index.S src/sbin/disklabel: main.c src/sys/arch/acorn32/stand/lib: riscospart.c src/sys/arch/arm/arm: disksubr_acorn.c src/sys/arch/hp300/dev: fhpib.c src/sys/arch/mips/alchemy/dev: if_aumac.c src/sys/dev/pci/cxgb: cxgb_t3_hw.c src/sys/dev/ppbus: ppbus_base.c src/sys/dev/scsipi: cd.c if_se.c ss.c src/sys/fs/filecorefs: filecore_utils.c src/sys/kern: makesyscalls.sh src/sys/netinet: tcp_input.c src/usr.sbin/sysinst/arch/acorn32: md.c Log Message: s/occurence/occurrence/ To generate a diff of this commit: cvs rdiff -u -r1.32 -r1.33 src/bin/csh/file.c cvs rdiff -u -r1.2 -r1.3 src/distrib/utils/more/more.help cvs rdiff -u -r1.10 -r1.11 src/distrib/utils/more/prim.c cvs rdiff -u -r1.5 -r1.6 src/lib/libc/arch/vax/string/index.S cvs rdiff -u -r1.54 -r1.55 src/sbin/disklabel/main.c cvs rdiff -u -r1.5 -r1.6 src/sys/arch/acorn32/stand/lib/riscospart.c cvs rdiff -u -r1.12 -r1.13 src/sys/arch/arm/arm/disksubr_acorn.c cvs rdiff -u -r1.40 -r1.41 src/sys/arch/hp300/dev/fhpib.c cvs rdiff -u -r1.48 -r1.49 src/sys/arch/mips/alchemy/dev/if_aumac.c cvs rdiff -u -r1.3 -r1.4 src/sys/dev/pci/cxgb/cxgb_t3_hw.c cvs rdiff -u -r1.20 -r1.21 src/sys/dev/ppbus/ppbus_base.c cvs rdiff -u -r1.345 -r1.346 src/sys/dev/scsipi/cd.c cvs rdiff -u -r1.111 -r1.112 src/sys/dev/scsipi/if_se.c cvs rdiff -u -r1.89 -r1.90 src/sys/dev/scsipi/ss.c cvs rdiff -u -r1.11 -r1.12 src/sys/fs/filecorefs/filecore_utils.c cvs rdiff -u -r1.181 -r1.182 src/sys/kern/makesyscalls.sh cvs rdiff -u -r1.423 -r1.424 src/sys/netinet/tcp_input.c cvs rdiff -u -r1.5 -r1.6 src/usr.sbin/sysinst/arch/acorn32/md.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/bin/csh/file.c diff -u src/bin/csh/file.c:1.32 src/bin/csh/file.c:1.33 --- src/bin/csh/file.c:1.32 Sat Jan 5 16:54:00 2019 +++ src/bin/csh/file.c Tue Sep 29 02:58:51 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: file.c,v 1.32 2019/01/05 16:54:00 christos Exp $ */ +/* $NetBSD: file.c,v 1.33 2020/09/29 02:58:51 msaitoh Exp $ */ /*- * Copyright (c) 1980, 1991, 1993 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)file.c 8.2 (Berkeley) 3/19/94"; #else -__RCSID("$NetBSD: file.c,v 1.32 2019/01/05 16:54:00 christos Exp $"); +__RCSID("$NetBSD: file.c,v 1.33 2020/09/29 02:58:51 msaitoh Exp $"); #endif #endif /* not lint */ @@ -670,7 +670,7 @@ tenex(Char *inputline, size_t inputline_ --str_end; /* wipeout trailing cmd Char */ *str_end = '\0'; /* - * Find LAST occurence of a delimiter in the inputline. The word start + * Find LAST occurrence of a delimiter in the inputline. The word start * is one Character past it. */ for (word_start = str_end; word_start > inputline; --word_start) Index: src/distrib/utils/more/more.help diff -u src/distrib/utils/more/more.help:1.2 src/distrib/utils/more/more.help:1.3 --- src/distrib/utils/more/more.help:1.2 Mon Aug 20 12:00:47 2001 +++ src/distrib/utils/more/more.help Tue Sep 29 02:58:51 2020 @@ -24,7 +24,7 @@ /!pattern* Search forward for N-th line NOT containing the pattern. ?pattern * Search backward for N-th line containing the pattern. ?!pattern* Search backward for N-th line NOT containing the pattern. - n* Repeat previous search (for N-th occurence). + n* Repeat previous search (for N-th occurrence). :a Display the list of files. E [file]Examine a new file. Index: src/distrib/utils/more/prim.c diff -u src/distrib/utils/more/prim.c:1.10 src/distrib/utils/more/prim.c:1.11 --- src/distrib/utils/more/prim.c:1.10 Sat Jan 24 13:58:21 2009 +++ src/distrib/utils/more/prim.c Tue Sep 29 02:58:51 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: prim.c,v 1.10 2009/01/24 13:58:21 tsutsui Exp $ */ +/* $NetBSD: prim.c,v 1.11 2020/09/29 02:58:51 msaitoh Exp $ */ /* * Copyright (c) 1988 Mark Nudelman @@ -35,7 +35,7 @@ #if 0 static char sccsid[] = "@(#)prim.c 8.1 (Berkeley) 6/6/93"; #else -__RCSID("$NetBSD: prim.c,v 1.10 2009/01/24 13:58:21 tsutsui Exp $"); +__RCSID("$NetBSD: prim.c,v 1.11 2020/09/29 02:58:51 msaitoh Exp $"); #endif #endif /* not lint */ @@ -604,7 +604,7 @@ get_back_scroll() } /* - * Search for the n-th occurence of a specified pattern, + * Search for the n-th occurrence of a specified pattern, * either forward or backward. */ int Index: src/lib/libc/arch/vax/string/index.S diff -u src/lib/libc/arch/vax/string/index.S:1.5 src/lib/libc/arch/vax/string/index.S:1.6 --- src/lib/libc/arch/vax/string/index.S:1.5 Thu Jan 23 16:34:12 2020 +++ src/lib/libc/arch/vax/string/index.S Tue Sep 29 02:58:51 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: index.S,v 1.5 2020/01/23 16:34:12 pgoyette Exp $ */
CVS commit: src
Module Name:src Committed By: msaitoh Date: Tue Sep 29 02:49:56 UTC 2020 Modified Files: src/distrib/alpha/instkernel/ramdisk: install.sh src/doc: CHANGES.prev src/etc/defaults: rc.conf src/sbin/disklabel: main.c src/sys/arch/atari/stand/ahdilabel: privahdi.h src/sys/arch/hp300/dev: rd.c src/sys/compat/ultrix: ultrix_fs.c src/sys/dev/gpib: rd.c src/sys/dev/scsipi: cd.c src/sys/uvm: uvm_swap.c src/usr.sbin/sysinst/arch/ews4800mips: md.c src/usr.sbin/timed: CHANGES src/usr.sbin/timed/timed: CHANGES Log Message: s/parition/partition/ To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/distrib/alpha/instkernel/ramdisk/install.sh cvs rdiff -u -r1.156 -r1.157 src/doc/CHANGES.prev cvs rdiff -u -r1.159 -r1.160 src/etc/defaults/rc.conf cvs rdiff -u -r1.53 -r1.54 src/sbin/disklabel/main.c cvs rdiff -u -r1.3 -r1.4 src/sys/arch/atari/stand/ahdilabel/privahdi.h cvs rdiff -u -r1.101 -r1.102 src/sys/arch/hp300/dev/rd.c cvs rdiff -u -r1.58 -r1.59 src/sys/compat/ultrix/ultrix_fs.c cvs rdiff -u -r1.42 -r1.43 src/sys/dev/gpib/rd.c cvs rdiff -u -r1.344 -r1.345 src/sys/dev/scsipi/cd.c cvs rdiff -u -r1.198 -r1.199 src/sys/uvm/uvm_swap.c cvs rdiff -u -r1.5 -r1.6 src/usr.sbin/sysinst/arch/ews4800mips/md.c cvs rdiff -u -r1.3 -r1.4 src/usr.sbin/timed/CHANGES cvs rdiff -u -r1.3 -r1.4 src/usr.sbin/timed/timed/CHANGES Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/distrib/alpha/instkernel/ramdisk/install.sh diff -u src/distrib/alpha/instkernel/ramdisk/install.sh:1.6 src/distrib/alpha/instkernel/ramdisk/install.sh:1.7 --- src/distrib/alpha/instkernel/ramdisk/install.sh:1.6 Sun Sep 20 22:44:06 2009 +++ src/distrib/alpha/instkernel/ramdisk/install.sh Tue Sep 29 02:49:55 2020 @@ -1,5 +1,5 @@ #!/bin/sh -# $NetBSD: install.sh,v 1.6 2009/09/20 22:44:06 abs Exp $ +# $NetBSD: install.sh,v 1.7 2020/09/29 02:49:55 msaitoh Exp $ # # Copyright (c) 1997 Perry E. Metzger # Copyright (c) 1994 Christopher G. Demetriou @@ -339,7 +339,7 @@ while [ $part_used -lt $partition ]; do [1-9]*) total=$(( $part_used + $resp )) if [ $total -gt $partition ]; then - echo -n "That would make the parition" + echo -n "That would make the partition" echo "too large to fit!" else part_size=$resp Index: src/doc/CHANGES.prev diff -u src/doc/CHANGES.prev:1.156 src/doc/CHANGES.prev:1.157 --- src/doc/CHANGES.prev:1.156 Sat Jun 27 14:03:39 2020 +++ src/doc/CHANGES.prev Tue Sep 29 02:49:55 2020 @@ -1,4 +1,4 @@ -LIST OF CHANGES FROM PREVIOUS RELEASES: <$Revision: 1.156 $> +LIST OF CHANGES FROM PREVIOUS RELEASES: <$Revision: 1.157 $> Changes from 386bsd 0.1 + patchkit 0.2.2 to NetBSD 0.8: @@ -1759,7 +1759,7 @@ Changes from NetBSD 1.0 to NetBSD 1.1: scsi: Made the SCSI disk drivers wait for the disc to spin up on open. [mycroft 19950126] add sysctl() variable kern.maxpartitions, so one can easily get - the value of MAXPARITIONS w/o compiling it in. (cgd) + the value of MAXPARTITIONS w/o compiling it in. (cgd) remove ability to export null and umap file systems, by having their fhtovp and vptofh functions return EOPNOTSUPP. (cgd) config(8): fix config.new to handle differing values of MAXPARTITIONS. @@ -2684,7 +2684,7 @@ Changes from NetBSD 1.1 to NetBSD 1.2: scripts have been rewritten to deal with this. Also added an option to install from a 'normal' (== hd/mo/...) disk partition to allow people to gather the sets using the - native OS and mount that parition from the installer. + native OS and mount that partition from the installer. XXX: All of the above changes can (and should) be merged XXX: into the MI-miniroot. [leo 19960519] Index: src/etc/defaults/rc.conf diff -u src/etc/defaults/rc.conf:1.159 src/etc/defaults/rc.conf:1.160 --- src/etc/defaults/rc.conf:1.159 Fri Sep 11 09:59:35 2020 +++ src/etc/defaults/rc.conf Tue Sep 29 02:49:55 2020 @@ -1,4 +1,4 @@ -# $NetBSD: rc.conf,v 1.159 2020/09/11 09:59:35 kim Exp $ +# $NetBSD: rc.conf,v 1.160 2020/09/29 02:49:55 msaitoh Exp $ # # /etc/defaults/rc.conf -- # default configuration of /etc/rc.conf @@ -101,7 +101,7 @@ swapoff=YES # Remove block-type swap pa # This defaults to yes, so that raids shutdown cleanly swapoff_umount=auto # Set to 'manual' to umount the tmpfs partitions listed # in swapoff_umount_fs before removing swap. Set to - # 'auto' to umount all tmpfs paritions that contain + # 'auto' to umount all tmpfs partitions that contain # no device nodes. swapoff_umount_fs= # space-separated list of tmpfs mount points to umount # before removing swap if swapoff_umount=manual Index: src/sbin/disklabel/main.c diff -u src/sbin/disklabel/main.c:1.53 src/sbin/disklabel/main.c:1.54 --- src/sbin/disklabel/main.c:1.53 Sat Aug 3 04:21:37 2019 +++ src/sbin/disklabel/main.c Tue Sep 29 02:49:55
CVS commit: src/sys/arch/alpha
Module Name:src Committed By: thorpej Date: Tue Sep 29 01:33:01 UTC 2020 Modified Files: src/sys/arch/alpha/alpha: clock.c cpu.c qemu.c src/sys/arch/alpha/include: cpu.h Log Message: Improve time keeping and host CPU usage when running in Qemu: - clockattach(): Allow multiple calls when running in Qemu. Anything after this first one is ignored, but this gives us a change to use a clock source provided by the VM directly, rather than relying on a more expensive hardware emulation. - Add cpu_initclocks_secondary(), to handle clock setup on secondary CPUs, if needed. - Allow us to use the WTINT PALcode call in cpu_idle() to idle in a lower power state (Qemu's PALcode supports this). - Use the Qemu per-cpu set-alarm-rel call as the hardclock interrupt source. In Qemu environments, reduce hz to 50 (rather than the default 1024) to give the clock a snowball's chance when running on a host system with hz=100. XXX We have to manually re-calculate tick and tickadj. There should be MI code to do this for us. Also in Qemu environments, let hardclock() drive the sched clock by setting schedhz=0. To generate a diff of this commit: cvs rdiff -u -r1.44 -r1.45 src/sys/arch/alpha/alpha/clock.c cvs rdiff -u -r1.100 -r1.101 src/sys/arch/alpha/alpha/cpu.c cvs rdiff -u -r1.1 -r1.2 src/sys/arch/alpha/alpha/qemu.c cvs rdiff -u -r1.97 -r1.98 src/sys/arch/alpha/include/cpu.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/arch/alpha/alpha/clock.c diff -u src/sys/arch/alpha/alpha/clock.c:1.44 src/sys/arch/alpha/alpha/clock.c:1.45 --- src/sys/arch/alpha/alpha/clock.c:1.44 Sun Sep 27 23:17:36 2020 +++ src/sys/arch/alpha/alpha/clock.c Tue Sep 29 01:33:00 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: clock.c,v 1.44 2020/09/27 23:17:36 thorpej Exp $ */ +/* $NetBSD: clock.c,v 1.45 2020/09/29 01:33:00 thorpej Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -39,7 +39,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.44 2020/09/27 23:17:36 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.45 2020/09/29 01:33:00 thorpej Exp $"); #include #include @@ -64,10 +64,16 @@ clockattach(void (*fns)(void *), void *d { /* - * Just bookkeeping. + * Just bookkeeping. We only allow one system clock. If + * we're running on real hardware, enforce this. If we're + * running under Qemu, anything after the first one. */ - if (clock_init != NULL) + if (clock_init != NULL) { + if (alpha_is_qemu) { + return; + } panic("clockattach: multiple clocks"); + } clock_init = fns; clockdev = dev; } @@ -114,6 +120,16 @@ cpu_initclocks(void) } /* + * Some platforms might have other per-cpu clock initialization. This + * is handled here. + */ +void +cpu_initclocks_secondary(void) +{ + (*clock_init)(clockdev); +} + +/* * We assume newhz is either stathz or profhz, and that neither will * change after being set up above. Could recalculate intervals here * but that would be a drag. Index: src/sys/arch/alpha/alpha/cpu.c diff -u src/sys/arch/alpha/alpha/cpu.c:1.100 src/sys/arch/alpha/alpha/cpu.c:1.101 --- src/sys/arch/alpha/alpha/cpu.c:1.100 Fri Sep 4 01:56:29 2020 +++ src/sys/arch/alpha/alpha/cpu.c Tue Sep 29 01:33:00 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: cpu.c,v 1.100 2020/09/04 01:56:29 thorpej Exp $ */ +/* $NetBSD: cpu.c,v 1.101 2020/09/29 01:33:00 thorpej Exp $ */ /*- * Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc. @@ -59,7 +59,7 @@ #include /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.100 2020/09/04 01:56:29 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.101 2020/09/29 01:33:00 thorpej Exp $"); #include "opt_ddb.h" #include "opt_multiprocessor.h" @@ -100,6 +100,27 @@ volatile u_long cpus_paused __read_mostl void cpu_boot_secondary(struct cpu_info *); #endif /* MULTIPROCESSOR */ +static void +cpu_idle_default(void) +{ + /* + * Default is to do nothing. Platform code can overwrite + * as needed. + */ +} + +void +cpu_idle_wtint(void) +{ + /* + * Some PALcode versions implement the WTINT call to idle + * in a low power mode. + */ + alpha_pal_wtint(0); +} + +void (*cpu_idle_fn)(void) __read_mostly = cpu_idle_default; + /* * The Implementation Version and the Architecture Mask must be * consistent across all CPUs in the system, so we set it for the @@ -582,6 +603,8 @@ cpu_hatch(struct cpu_info *ci) alpha_pal_imb(); cc_calibrate_cpu(ci); + + cpu_initclocks_secondary(); } int Index: src/sys/arch/alpha/alpha/qemu.c diff -u src/sys/arch/alpha/alpha/qemu.c:1.1 src/sys/arch/alpha/alpha/qemu.c:1.2 --- src/sys/arch/alpha/alpha/qemu.c:1.1 Sun Sep 27 23:59:37 2020 +++ src/sys/arch/alpha/alpha/qemu.c Tue Sep 29 01:33:00 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: qemu.c,v 1.1 2020/09/27 23:59:37 thorpej Exp $ */ +/* $NetBSD: qemu.c,v 1.2 2020/09/29 01:33:00 thorpej Exp $ */
CVS commit: src/sys/arch/alpha/alpha
Module Name:src Committed By: thorpej Date: Tue Sep 29 01:20:59 UTC 2020 Modified Files: src/sys/arch/alpha/alpha: mcclock.c Log Message: mcclock_init(): Only do our work if called on the primary CPU. To generate a diff of this commit: cvs rdiff -u -r1.18 -r1.19 src/sys/arch/alpha/alpha/mcclock.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/mcclock.c diff -u src/sys/arch/alpha/alpha/mcclock.c:1.18 src/sys/arch/alpha/alpha/mcclock.c:1.19 --- src/sys/arch/alpha/alpha/mcclock.c:1.18 Mon Nov 21 19:50:37 2011 +++ src/sys/arch/alpha/alpha/mcclock.c Tue Sep 29 01:20:59 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: mcclock.c,v 1.18 2011/11/21 19:50:37 christos Exp $ */ +/* $NetBSD: mcclock.c,v 1.19 2020/09/29 01:20:59 thorpej Exp $ */ /* * Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University. @@ -29,7 +29,7 @@ #include /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: mcclock.c,v 1.18 2011/11/21 19:50:37 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: mcclock.c,v 1.19 2020/09/29 01:20:59 thorpej Exp $"); #include "opt_clock_compat_osf1.h" @@ -37,6 +37,7 @@ __KERNEL_RCSID(0, "$NetBSD: mcclock.c,v #include #include #include +#include #include #include @@ -136,6 +137,11 @@ mcclock_init(void *dev) { struct mc146818_softc *sc = dev; + /* Only do this on the primary CPU. */ + if (! CPU_IS_PRIMARY(curcpu())) { + return; + } + /* enable interval clock interrupt */ (*sc->sc_mcwrite)(sc, MC_REGA, MC_BASE_32_KHz | MC_RATE_1024_Hz); (*sc->sc_mcwrite)(sc, MC_REGB,
CVS commit: src/sys/arch/alpha/pci
Module Name:src Committed By: thorpej Date: Tue Sep 29 01:19:52 UTC 2020 Modified Files: src/sys/arch/alpha/pci: sio_pic.c Log Message: If running in Qemu, don't report stray edge-triggered ISA interrupts. Works around an issue I obvserved with serial console in Qemu. To generate a diff of this commit: cvs rdiff -u -r1.45 -r1.46 src/sys/arch/alpha/pci/sio_pic.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/pci/sio_pic.c diff -u src/sys/arch/alpha/pci/sio_pic.c:1.45 src/sys/arch/alpha/pci/sio_pic.c:1.46 --- src/sys/arch/alpha/pci/sio_pic.c:1.45 Fri Sep 25 03:40:11 2020 +++ src/sys/arch/alpha/pci/sio_pic.c Tue Sep 29 01:19:52 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: sio_pic.c,v 1.45 2020/09/25 03:40:11 thorpej Exp $ */ +/* $NetBSD: sio_pic.c,v 1.46 2020/09/29 01:19:52 thorpej Exp $ */ /*- * Copyright (c) 1998, 2000, 2020 The NetBSD Foundation, Inc. @@ -59,7 +59,7 @@ #include /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: sio_pic.c,v 1.45 2020/09/25 03:40:11 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sio_pic.c,v 1.46 2020/09/29 01:19:52 thorpej Exp $"); #include #include @@ -68,6 +68,7 @@ __KERNEL_RCSID(0, "$NetBSD: sio_pic.c,v #include #include +#include #include #include @@ -463,6 +464,16 @@ sio_intr_establish(void *v, int irq, int scb_set(0x800 + SCB_IDXTOVEC(irq), sio_iointr, NULL); sio_setirqstat(irq, 1, alpha_shared_intr_get_sharetype(sio_intr, irq)); + + /* + * I've obsesrved stray ISA interrupts when interacting + * with the serial console under Qemu. Work around that + * for now by suppressing stray interrupt reporting for + * edge-triggered interrupts. + */ + if (alpha_is_qemu && type == IST_EDGE) { + alpha_shared_intr_set_maxstrays(sio_intr, irq, 0); + } } mutex_exit(_lock); @@ -508,6 +519,7 @@ sio_intr_disestablish(void *v, void *coo } sio_setirqstat(irq, 0, ist); alpha_shared_intr_set_dfltsharetype(sio_intr, irq, ist); + alpha_shared_intr_set_maxstrays(sio_intr, irq, STRAY_MAX); /* Release our SCB vector. */ scb_free(0x800 + SCB_IDXTOVEC(irq));
CVS commit: src/sys/arch/alpha
Module Name:src Committed By: thorpej Date: Tue Sep 29 01:17:22 UTC 2020 Modified Files: src/sys/arch/alpha/alpha: pal.s src/sys/arch/alpha/include: alpha_cpu.h Log Message: Add alpha_pal_wtint(), which invokes the WTINT PALcode call. To generate a diff of this commit: cvs rdiff -u -r1.15 -r1.16 src/sys/arch/alpha/alpha/pal.s cvs rdiff -u -r1.51 -r1.52 src/sys/arch/alpha/include/alpha_cpu.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/arch/alpha/alpha/pal.s diff -u src/sys/arch/alpha/alpha/pal.s:1.15 src/sys/arch/alpha/alpha/pal.s:1.16 --- src/sys/arch/alpha/alpha/pal.s:1.15 Mon May 13 21:38:30 2002 +++ src/sys/arch/alpha/alpha/pal.s Tue Sep 29 01:17:22 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: pal.s,v 1.15 2002/05/13 21:38:30 thorpej Exp $ */ +/* $NetBSD: pal.s,v 1.16 2020/09/29 01:17:22 thorpej Exp $ */ /* * Copyright (c) 1994, 1995 Carnegie-Mellon University. @@ -39,7 +39,7 @@ * and Richard T. Witek. */ -__KERNEL_RCSID(1, "$NetBSD: pal.s,v 1.15 2002/05/13 21:38:30 thorpej Exp $"); +__KERNEL_RCSID(1, "$NetBSD: pal.s,v 1.16 2020/09/29 01:17:22 thorpej Exp $"); inc2: .stabs __FILE__,132,0,0,inc2; .loc 1 __LINE__ /* @@ -155,3 +155,26 @@ LEAF_NOPROFILE(alpha_pal_wrvptptr,1) call_pal PAL_OSF1_wrvptptr RET END(alpha_pal_wrvptptr) + +/* + * alpha_pal_wtint: Wait for interrupt. [PRIVILEGED] + * + * Arguments: + * a0 maximum number of clock interrupts to skip + * + * Return value: + * v0 actual number of clock interrupts skipped + * + * WTINT waits, in a low power mode, for either any device interrupt or + * for the next clock interrupt (a0 == 0) or up to the specified number + * of clock interrupts to pass. Note that the PCC may slow or stop + * while waiting. + * + * Not all PALcode versions support WTINT. If it is not supported, + * an OPDEC fault will occur. + */ + .text +LEAF_NOPROFILE(alpha_pal_wtint,1) + call_pal PAL_wtint + RET + END(alpha_pal_wtint) Index: src/sys/arch/alpha/include/alpha_cpu.h diff -u src/sys/arch/alpha/include/alpha_cpu.h:1.51 src/sys/arch/alpha/include/alpha_cpu.h:1.52 --- src/sys/arch/alpha/include/alpha_cpu.h:1.51 Sat Sep 5 16:29:08 2020 +++ src/sys/arch/alpha/include/alpha_cpu.h Tue Sep 29 01:17:22 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: alpha_cpu.h,v 1.51 2020/09/05 16:29:08 thorpej Exp $ */ +/* $NetBSD: alpha_cpu.h,v 1.52 2020/09/29 01:17:22 thorpej Exp $ */ /* * Copyright (c) 1996 Carnegie-Mellon University. @@ -378,6 +378,7 @@ void alpha_pal_halt(void) __attribute__ unsigned long _alpha_pal_swpipl(unsigned long); /* for profiling */ void alpha_pal_wrent(void *, unsigned long); void alpha_pal_wrvptptr(unsigned long); +unsigned long alpha_pal_wtint(unsigned long); #define alpha_pal_draina() __asm volatile("call_pal %0 # PAL_draina" \ : : "i" (PAL_draina) : "memory")
CVS commit: src/sys/lib/libsa
Module Name:src Committed By: simonb Date: Tue Sep 29 00:13:13 UTC 2020 Modified Files: src/sys/lib/libsa: twiddle.c Log Message: Add a slow twiddle option. This speeds up a pmax netboot by 15% and is only 1% slower than no twiddle. To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/sys/lib/libsa/twiddle.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/lib/libsa/twiddle.c diff -u src/sys/lib/libsa/twiddle.c:1.8 src/sys/lib/libsa/twiddle.c:1.9 --- src/sys/lib/libsa/twiddle.c:1.8 Wed Apr 30 16:18:09 2008 +++ src/sys/lib/libsa/twiddle.c Tue Sep 29 00:13:12 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: twiddle.c,v 1.8 2008/04/30 16:18:09 ad Exp $ */ +/* $NetBSD: twiddle.c,v 1.9 2020/09/29 00:13:12 simonb Exp $ */ /*- * Copyright (c) 1993 @@ -40,13 +40,24 @@ char twiddle_toggle; +#ifdef LIBSA_SLOW_TWIDDLE +#define TWIDDLE_DELAY 4 +#else +#define TWIDDLE_DELAY 0 +#endif + +#define TWIDDLE_MASK ((1 << TWIDDLE_DELAY) - 1) + void twiddle(void) { - static int pos; + static unsigned int pos; if (!twiddle_toggle) { - putchar(TWIDDLE_CHARS[pos++ & 3]); - putchar('\b'); + if ((pos & TWIDDLE_MASK) == 0) { + putchar(TWIDDLE_CHARS[(pos >> TWIDDLE_DELAY) & 3]); + putchar('\b'); + } + pos++; } }
CVS commit: src/usr.bin/make
Module Name:src Committed By: rillig Date: Mon Sep 28 23:31:18 UTC 2020 Modified Files: src/usr.bin/make: job.c targ.c Log Message: make(1): replace Lst_Open with direct iteration To generate a diff of this commit: cvs rdiff -u -r1.252 -r1.253 src/usr.bin/make/job.c cvs rdiff -u -r1.107 -r1.108 src/usr.bin/make/targ.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/make/job.c diff -u src/usr.bin/make/job.c:1.252 src/usr.bin/make/job.c:1.253 --- src/usr.bin/make/job.c:1.252 Mon Sep 28 23:13:57 2020 +++ src/usr.bin/make/job.c Mon Sep 28 23:31:18 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: job.c,v 1.252 2020/09/28 23:13:57 rillig Exp $ */ +/* $NetBSD: job.c,v 1.253 2020/09/28 23:31:18 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -143,7 +143,7 @@ #include "trace.h" /* "@(#)job.c 8.2 (Berkeley) 3/19/94" */ -MAKE_RCSID("$NetBSD: job.c,v 1.252 2020/09/28 23:13:57 rillig Exp $"); +MAKE_RCSID("$NetBSD: job.c,v 1.253 2020/09/28 23:31:18 rillig Exp $"); # define STATIC static @@ -871,7 +871,7 @@ JobFinish(Job *job, int status) { Boolean done, return_job_token; -DEBUG3(JOB, "Jobfinish: %d [%s], status %d\n", +DEBUG3(JOB, "JobFinish: %d [%s], status %d\n", job->pid, job->node->name, status); if ((WIFEXITED(status) && Index: src/usr.bin/make/targ.c diff -u src/usr.bin/make/targ.c:1.107 src/usr.bin/make/targ.c:1.108 --- src/usr.bin/make/targ.c:1.107 Mon Sep 28 22:23:35 2020 +++ src/usr.bin/make/targ.c Mon Sep 28 23:31:18 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: targ.c,v 1.107 2020/09/28 22:23:35 rillig Exp $ */ +/* $NetBSD: targ.c,v 1.108 2020/09/28 23:31:18 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -122,7 +122,7 @@ #include "dir.h" /* "@(#)targ.c 8.2 (Berkeley) 3/19/94" */ -MAKE_RCSID("$NetBSD: targ.c,v 1.107 2020/09/28 22:23:35 rillig Exp $"); +MAKE_RCSID("$NetBSD: targ.c,v 1.108 2020/09/28 23:31:18 rillig Exp $"); static GNodeList *allTargets; /* the list of all targets found so far */ #ifdef CLEANUP @@ -292,18 +292,13 @@ GNode *Targ_GetEndNode(void) GNodeList * Targ_FindList(StringList *names) { -GNodeList *nodes; StringListNode *ln; - -nodes = Lst_Init(); - -Lst_Open(names); -while ((ln = Lst_Next(names)) != NULL) { - char *name = LstNode_Datum(ln); +GNodeList *nodes = Lst_Init(); +for (ln = names->first; ln != NULL; ln = ln->next) { + const char *name = ln->datum; GNode *gn = Targ_GetNode(name); Lst_Append(nodes, gn); } -Lst_Close(names); return nodes; }
CVS commit: src/usr.bin/make
Module Name:src Committed By: rillig Date: Mon Sep 28 23:13:57 UTC 2020 Modified Files: src/usr.bin/make: compat.c cond.c dir.c job.c make.c parse.c suff.c Log Message: make(1): replace += 1 with ++ and -= 1 with -- Just for visual consistency. The generated code stays exactly the same. To generate a diff of this commit: cvs rdiff -u -r1.158 -r1.159 src/usr.bin/make/compat.c cvs rdiff -u -r1.154 -r1.155 src/usr.bin/make/cond.c cvs rdiff -u -r1.152 -r1.153 src/usr.bin/make/dir.c cvs rdiff -u -r1.251 -r1.252 src/usr.bin/make/job.c cvs rdiff -u -r1.155 -r1.156 src/usr.bin/make/make.c cvs rdiff -u -r1.342 -r1.343 src/usr.bin/make/parse.c cvs rdiff -u -r1.172 -r1.173 src/usr.bin/make/suff.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/make/compat.c diff -u src/usr.bin/make/compat.c:1.158 src/usr.bin/make/compat.c:1.159 --- src/usr.bin/make/compat.c:1.158 Mon Sep 28 22:23:35 2020 +++ src/usr.bin/make/compat.c Mon Sep 28 23:13:57 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: compat.c,v 1.158 2020/09/28 22:23:35 rillig Exp $ */ +/* $NetBSD: compat.c,v 1.159 2020/09/28 23:13:57 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -99,7 +99,7 @@ #include"pathnames.h" /* "@(#)compat.c 8.2 (Berkeley) 3/19/94" */ -MAKE_RCSID("$NetBSD: compat.c,v 1.158 2020/09/28 22:23:35 rillig Exp $"); +MAKE_RCSID("$NetBSD: compat.c,v 1.159 2020/09/28 23:13:57 rillig Exp $"); static GNode *curTarg = NULL; static void CompatInterrupt(int); @@ -721,7 +721,7 @@ Compat_Run(GNodeList *targs) printf("`%s' is up to date.\n", gn->name); } else if (gn->made == ABORTED) { printf("`%s' not remade because of errors.\n", gn->name); - errors += 1; + errors++; } } Index: src/usr.bin/make/cond.c diff -u src/usr.bin/make/cond.c:1.154 src/usr.bin/make/cond.c:1.155 --- src/usr.bin/make/cond.c:1.154 Mon Sep 28 20:46:11 2020 +++ src/usr.bin/make/cond.c Mon Sep 28 23:13:57 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: cond.c,v 1.154 2020/09/28 20:46:11 rillig Exp $ */ +/* $NetBSD: cond.c,v 1.155 2020/09/28 23:13:57 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -93,7 +93,7 @@ #include "dir.h" /* "@(#)cond.c 8.2 (Berkeley) 1/2/94" */ -MAKE_RCSID("$NetBSD: cond.c,v 1.154 2020/09/28 20:46:11 rillig Exp $"); +MAKE_RCSID("$NetBSD: cond.c,v 1.155 2020/09/28 23:13:57 rillig Exp $"); /* * The parsing of conditional expressions is based on this grammar: @@ -642,7 +642,7 @@ CondParser_Comparison(CondParser *par, B if (par->p[1] == '=') { par->p += 2; } else { - par->p += 1; + par->p++; } break; default: Index: src/usr.bin/make/dir.c diff -u src/usr.bin/make/dir.c:1.152 src/usr.bin/make/dir.c:1.153 --- src/usr.bin/make/dir.c:1.152 Mon Sep 28 22:23:35 2020 +++ src/usr.bin/make/dir.c Mon Sep 28 23:13:57 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: dir.c,v 1.152 2020/09/28 22:23:35 rillig Exp $ */ +/* $NetBSD: dir.c,v 1.153 2020/09/28 23:13:57 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -136,7 +136,7 @@ #include "job.h" /* "@(#)dir.c 8.2 (Berkeley) 1/2/94" */ -MAKE_RCSID("$NetBSD: dir.c,v 1.152 2020/09/28 22:23:35 rillig Exp $"); +MAKE_RCSID("$NetBSD: dir.c,v 1.153 2020/09/28 23:13:57 rillig Exp $"); #define DIR_DEBUG0(text) DEBUG0(DIR, text) #define DIR_DEBUG1(fmt, arg1) DEBUG1(DIR, fmt, arg1) @@ -375,12 +375,12 @@ Dir_InitCur(const char *cdname) * Keep this one around too. */ if ((dir = Dir_AddDir(NULL, cdname))) { - dir->refCount += 1; + dir->refCount++; if (cur && cur != dir) { /* * We've been here before, cleanup. */ - cur->refCount -= 1; + cur->refCount--; Dir_Destroy(cur); } cur = dir; @@ -412,7 +412,7 @@ Dir_InitDot(void) * We always need to have dot around, so we increment its reference count * to make sure it's not destroyed. */ -dot->refCount += 1; +dot->refCount++; Dir_SetPATH(); /* initialize */ } @@ -422,11 +422,11 @@ Dir_End(void) { #ifdef CLEANUP if (cur) { - cur->refCount -= 1; + cur->refCount--; Dir_Destroy(cur); } -dot->refCount -= 1; -dotLast->refCount -= 1; +dot->refCount--; +dotLast->refCount--; Dir_Destroy(dotLast); Dir_Destroy(dot); Dir_ClearPath(dirSearchPath); @@ -900,8 +900,8 @@ DirLookup(CachedDir *dir, const char *na file = str_concat3(dir->name, "/", cp); DIR_DEBUG1(" returning %s\n", file); -dir->hits += 1; -hits += 1; +dir->hits++; +hits++; return file; } @@ -938,7 +938,7 @@ DirLookupSubdir(CachedDir *dir, const ch DIR_DEBUG1("checking %s ...\n", file); if (cached_stat(file, ) == 0) { - nearmisses += 1; + nearmisses++; return file; } free(file); @@ -987,8 +987,8 @@ DirLookupAbs(CachedDir *dir,
CVS commit: src/usr.bin/make
Module Name:src Committed By: rillig Date: Mon Sep 28 23:02:02 UTC 2020 Modified Files: src/usr.bin/make: make.c Log Message: make(1): migrate Make_ProcessWait from Lst_ForEachUntil to Lst_ForEach To generate a diff of this commit: cvs rdiff -u -r1.154 -r1.155 src/usr.bin/make/make.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/make/make.c diff -u src/usr.bin/make/make.c:1.154 src/usr.bin/make/make.c:1.155 --- src/usr.bin/make/make.c:1.154 Mon Sep 28 22:38:32 2020 +++ src/usr.bin/make/make.c Mon Sep 28 23:02:02 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: make.c,v 1.154 2020/09/28 22:38:32 rillig Exp $ */ +/* $NetBSD: make.c,v 1.155 2020/09/28 23:02:02 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -107,7 +107,7 @@ #include"job.h" /* "@(#)make.c 8.1 (Berkeley) 6/6/93" */ -MAKE_RCSID("$NetBSD: make.c,v 1.154 2020/09/28 22:38:32 rillig Exp $"); +MAKE_RCSID("$NetBSD: make.c,v 1.155 2020/09/28 23:02:02 rillig Exp $"); /* Sequence # to detect recursion. */ static unsigned int checked = 1; @@ -1175,7 +1175,7 @@ Make_ExpandUse(GNodeList *targs) Lst_Free(examine); } -static int +static void link_parent(void *cnp, void *pnp) { GNode *cn = cnp; @@ -1184,7 +1184,6 @@ link_parent(void *cnp, void *pnp) Lst_Append(pn->children, cn); Lst_Append(cn->parents, pn); pn->unmade++; -return 0; } /* Make the .WAIT node depend on the previous children */ @@ -1227,7 +1226,7 @@ Make_ProcessWait(GNodeList *targs) /* Get it displayed in the diag dumps */ Lst_Prepend(Targ_List(), pgn); -Lst_ForEachUntil(targs, link_parent, pgn); +Lst_ForEach(targs, link_parent, pgn); /* Start building with the 'dummy' .MAIN' node */ MakeBuildChild(pgn, NULL);
CVS commit: src/usr.bin/make
Module Name:src Committed By: rillig Date: Mon Sep 28 22:38:32 UTC 2020 Modified Files: src/usr.bin/make: make.c make.h Log Message: make(1): remove the inline attribute from debug_printf The code size overhead of a varargs function is much more than I had expected. Since GCC 5 didn't inline the function anyway and it is only used in debug mode, there is no point keeping multiple copies of that code around. To generate a diff of this commit: cvs rdiff -u -r1.153 -r1.154 src/usr.bin/make/make.c cvs rdiff -u -r1.150 -r1.151 src/usr.bin/make/make.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/make/make.c diff -u src/usr.bin/make/make.c:1.153 src/usr.bin/make/make.c:1.154 --- src/usr.bin/make/make.c:1.153 Mon Sep 28 22:23:35 2020 +++ src/usr.bin/make/make.c Mon Sep 28 22:38:32 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: make.c,v 1.153 2020/09/28 22:23:35 rillig Exp $ */ +/* $NetBSD: make.c,v 1.154 2020/09/28 22:38:32 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -107,7 +107,7 @@ #include"job.h" /* "@(#)make.c 8.1 (Berkeley) 6/6/93" */ -MAKE_RCSID("$NetBSD: make.c,v 1.153 2020/09/28 22:23:35 rillig Exp $"); +MAKE_RCSID("$NetBSD: make.c,v 1.154 2020/09/28 22:38:32 rillig Exp $"); /* Sequence # to detect recursion. */ static unsigned int checked = 1; @@ -125,6 +125,16 @@ static int MakeCheckOrder(void *, void * static int MakeBuildChild(void *, void *); static int MakeBuildParent(void *, void *); +void +debug_printf(const char *fmt, ...) +{ +va_list args; + +va_start(args, fmt); +vfprintf(debug_file, fmt, args); +va_end(args); +} + MAKE_ATTR_DEAD static void make_abort(GNode *gn, int line) { Index: src/usr.bin/make/make.h diff -u src/usr.bin/make/make.h:1.150 src/usr.bin/make/make.h:1.151 --- src/usr.bin/make/make.h:1.150 Mon Sep 28 22:23:35 2020 +++ src/usr.bin/make/make.h Mon Sep 28 22:38:32 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: make.h,v 1.150 2020/09/28 22:23:35 rillig Exp $ */ +/* $NetBSD: make.h,v 1.151 2020/09/28 22:38:32 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -524,15 +524,7 @@ extern int debug; #define DEBUG(module) (debug & CONCAT(DEBUG_,module)) -static inline MAKE_ATTR_UNUSED void MAKE_ATTR_PRINTFLIKE(1, 2) -debug_printf(const char *fmt, ...) -{ -va_list args; - -va_start(args, fmt); -vfprintf(debug_file, fmt, args); -va_end(args); -} +void debug_printf(const char *, ...) MAKE_ATTR_PRINTFLIKE(1, 2); #define DEBUG0(module, text) \ if (!DEBUG(module)) (void)0; \
CVS commit: src/usr.bin/make
Module Name:src Committed By: rillig Date: Mon Sep 28 22:23:35 UTC 2020 Modified Files: src/usr.bin/make: arch.c compat.c dir.c job.c make.c make.h meta.c parse.c suff.c targ.c var.c Log Message: make(1): make debug logging simpler This avoids referring to the debug_file variable in many places where this implementation detail is not necessary. To generate a diff of this commit: cvs rdiff -u -r1.125 -r1.126 src/usr.bin/make/arch.c cvs rdiff -u -r1.157 -r1.158 src/usr.bin/make/compat.c cvs rdiff -u -r1.151 -r1.152 src/usr.bin/make/dir.c cvs rdiff -u -r1.250 -r1.251 src/usr.bin/make/job.c cvs rdiff -u -r1.152 -r1.153 src/usr.bin/make/make.c cvs rdiff -u -r1.149 -r1.150 src/usr.bin/make/make.h cvs rdiff -u -r1.121 -r1.122 src/usr.bin/make/meta.c cvs rdiff -u -r1.341 -r1.342 src/usr.bin/make/parse.c cvs rdiff -u -r1.171 -r1.172 src/usr.bin/make/suff.c cvs rdiff -u -r1.106 -r1.107 src/usr.bin/make/targ.c cvs rdiff -u -r1.549 -r1.550 src/usr.bin/make/var.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/make/arch.c diff -u src/usr.bin/make/arch.c:1.125 src/usr.bin/make/arch.c:1.126 --- src/usr.bin/make/arch.c:1.125 Mon Sep 28 20:46:11 2020 +++ src/usr.bin/make/arch.c Mon Sep 28 22:23:35 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: arch.c,v 1.125 2020/09/28 20:46:11 rillig Exp $ */ +/* $NetBSD: arch.c,v 1.126 2020/09/28 22:23:35 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -134,7 +134,7 @@ #include"config.h" /* "@(#)arch.c 8.2 (Berkeley) 1/2/94" */ -MAKE_RCSID("$NetBSD: arch.c,v 1.125 2020/09/28 20:46:11 rillig Exp $"); +MAKE_RCSID("$NetBSD: arch.c,v 1.126 2020/09/28 22:23:35 rillig Exp $"); #ifdef TARGET_MACHINE #undef MAKE_MACHINE @@ -612,7 +612,7 @@ ArchStatMember(const char *archive, cons if (fseek(arch, -elen, SEEK_CUR) != 0) goto badarch; if (DEBUG(ARCH) || DEBUG(MAKE)) { - fprintf(debug_file, "ArchStat: Extended format entry for %s\n", memName); + debug_printf("ArchStat: Extended format entry for %s\n", memName); } } #endif @@ -840,7 +840,7 @@ ArchFindMember(const char *archive, cons } ename[elen] = '\0'; if (DEBUG(ARCH) || DEBUG(MAKE)) { - fprintf(debug_file, "ArchFind: Extended format entry for %s\n", ename); + debug_printf("ArchFind: Extended format entry for %s\n", ename); } if (strncmp(ename, member, len) == 0) { /* Found as extended name */ @@ -1114,7 +1114,7 @@ Arch_LibOODate(GNode *gn) modTimeTOC = (int)strtol(arhPtr->ar_date, NULL, 10); if (DEBUG(ARCH) || DEBUG(MAKE)) { - fprintf(debug_file, "%s modified %s...", RANLIBMAG, Targ_FmtTime(modTimeTOC)); + debug_printf("%s modified %s...", RANLIBMAG, Targ_FmtTime(modTimeTOC)); } oodate = (gn->cmgn == NULL || gn->cmgn->mtime > modTimeTOC); } else { @@ -1122,7 +1122,7 @@ Arch_LibOODate(GNode *gn) * A library w/o a table of contents is out-of-date */ if (DEBUG(ARCH) || DEBUG(MAKE)) { - fprintf(debug_file, "No t.o.c"); + debug_printf("No t.o.c"); } oodate = TRUE; } Index: src/usr.bin/make/compat.c diff -u src/usr.bin/make/compat.c:1.157 src/usr.bin/make/compat.c:1.158 --- src/usr.bin/make/compat.c:1.157 Mon Sep 28 20:46:11 2020 +++ src/usr.bin/make/compat.c Mon Sep 28 22:23:35 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: compat.c,v 1.157 2020/09/28 20:46:11 rillig Exp $ */ +/* $NetBSD: compat.c,v 1.158 2020/09/28 22:23:35 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -99,7 +99,7 @@ #include"pathnames.h" /* "@(#)compat.c 8.2 (Berkeley) 3/19/94" */ -MAKE_RCSID("$NetBSD: compat.c,v 1.157 2020/09/28 20:46:11 rillig Exp $"); +MAKE_RCSID("$NetBSD: compat.c,v 1.158 2020/09/28 22:23:35 rillig Exp $"); static GNode *curTarg = NULL; static void CompatInterrupt(int); @@ -403,19 +403,19 @@ Compat_RunCommand(const char *cmdp, stru if (status != 0) { if (DEBUG(ERROR)) { const char *cp; - fprintf(debug_file, "\n*** Failed target: %s\n*** Failed command: ", - gn->name); + debug_printf("\n*** Failed target: %s\n*** Failed command: ", + gn->name); for (cp = cmd; *cp; ) { if (ch_isspace(*cp)) { - fprintf(debug_file, " "); + debug_printf(" "); while (ch_isspace(*cp)) cp++; } else { - fprintf(debug_file, "%c", *cp); + debug_printf("%c", *cp); cp++; } } - fprintf(debug_file, "\n"); + debug_printf("\n"); } printf("*** Error code %d", status); } Index: src/usr.bin/make/dir.c diff -u src/usr.bin/make/dir.c:1.151 src/usr.bin/make/dir.c:1.152 --- src/usr.bin/make/dir.c:1.151 Mon Sep 28 20:46:11 2020 +++ src/usr.bin/make/dir.c Mon Sep 28 22:23:35 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: dir.c,v 1.151 2020/09/28 20:46:11 rillig Exp $ */ +/* $NetBSD: dir.c,v 1.152 2020/09/28 22:23:35 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The
CVS commit: src/usr.bin/make
Module Name:src Committed By: rillig Date: Mon Sep 28 21:11:05 UTC 2020 Modified Files: src/usr.bin/make: var.c Log Message: make(1): extract logging from ApplyModifiers into separate functions These two logging blocks are massive enough to disturb the reading flow of the remaining code. Even without these two blocks, ApplyModifiers is still 250 lines long, which is quite much. To generate a diff of this commit: cvs rdiff -u -r1.548 -r1.549 src/usr.bin/make/var.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/make/var.c diff -u src/usr.bin/make/var.c:1.548 src/usr.bin/make/var.c:1.549 --- src/usr.bin/make/var.c:1.548 Mon Sep 28 21:01:53 2020 +++ src/usr.bin/make/var.c Mon Sep 28 21:11:05 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: var.c,v 1.548 2020/09/28 21:01:53 rillig Exp $ */ +/* $NetBSD: var.c,v 1.549 2020/09/28 21:11:05 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -121,7 +121,7 @@ #include"metachar.h" /* "@(#)var.c 8.3 (Berkeley) 3/19/94" */ -MAKE_RCSID("$NetBSD: var.c,v 1.548 2020/09/28 21:01:53 rillig Exp $"); +MAKE_RCSID("$NetBSD: var.c,v 1.549 2020/09/28 21:11:05 rillig Exp $"); #define VAR_DEBUG1(fmt, arg1) DEBUG1(VAR, fmt, arg1) #define VAR_DEBUG2(fmt, arg1, arg2) DEBUG2(VAR, fmt, arg1, arg2) @@ -2987,6 +2987,50 @@ ApplyModifier_SunShell(const char **pp, } #endif +static void +LogBeforeApply(const ApplyModifiersState *st, const char *mod, const char endc) +{ +char eflags_str[VarEvalFlags_ToStringSize]; +char vflags_str[VarFlags_ToStringSize]; +char exprflags_str[VarExprFlags_ToStringSize]; +Boolean is_single_char = mod[0] != '\0' && + (mod[1] == endc || mod[1] == ':'); + +/* At this point, only the first character of the modifier can + * be used since the end of the modifier is not yet known. */ +fprintf(debug_file, + "Applying ${%s:%c%s} to \"%s\" (%s, %s, %s)\n", + st->v->name, mod[0], is_single_char ? "" : "...", st->val, + Enum_FlagsToString(eflags_str, sizeof eflags_str, + st->eflags, VarEvalFlags_ToStringSpecs), + Enum_FlagsToString(vflags_str, sizeof vflags_str, + st->v->flags, VarFlags_ToStringSpecs), + Enum_FlagsToString(exprflags_str, sizeof exprflags_str, + st->exprFlags, + VarExprFlags_ToStringSpecs)); +} + +static void +LogAfterApply(ApplyModifiersState *st, const char *p, const char *mod) +{ +char eflags_str[VarEvalFlags_ToStringSize]; +char vflags_str[VarFlags_ToStringSize]; +char exprflags_str[VarExprFlags_ToStringSize]; +const char *quot = st->newVal == var_Error ? "" : "\""; +const char *newVal = st->newVal == var_Error ? "error" : st->newVal; + +fprintf(debug_file, + "Result of ${%s:%.*s} is %s%s%s (%s, %s, %s)\n", + st->v->name, (int)(p - mod), mod, quot, newVal, quot, + Enum_FlagsToString(eflags_str, sizeof eflags_str, + st->eflags, VarEvalFlags_ToStringSpecs), + Enum_FlagsToString(vflags_str, sizeof vflags_str, + st->v->flags, VarFlags_ToStringSpecs), + Enum_FlagsToString(exprflags_str, sizeof exprflags_str, + st->exprFlags, + VarExprFlags_ToStringSpecs)); +} + /* Apply any modifiers (such as :Mpattern or :@var@loop@ or :Q or ::=value). */ static char * ApplyModifiers( @@ -3072,26 +3116,8 @@ ApplyModifiers( res = AMR_BAD; /* just a safe fallback */ mod = p; - if (DEBUG(VAR)) { - char eflags_str[VarEvalFlags_ToStringSize]; - char vflags_str[VarFlags_ToStringSize]; - char exprflags_str[VarExprFlags_ToStringSize]; - Boolean is_single_char = mod[0] != '\0' && - (mod[1] == endc || mod[1] == ':'); - - /* At this point, only the first character of the modifier can - * be used since the end of the modifier is not yet known. */ - fprintf(debug_file, - "Applying ${%s:%c%s} to \"%s\" (%s, %s, %s)\n", - st.v->name, mod[0], is_single_char ? "" : "...", st.val, - Enum_FlagsToString(eflags_str, sizeof eflags_str, - st.eflags, VarEvalFlags_ToStringSpecs), - Enum_FlagsToString(vflags_str, sizeof vflags_str, - st.v->flags, VarFlags_ToStringSpecs), - Enum_FlagsToString(exprflags_str, sizeof exprflags_str, - st.exprFlags, - VarExprFlags_ToStringSpecs)); - } + if (DEBUG(VAR)) + LogBeforeApply(, mod, endc); switch (*mod) { case ':': @@ -3211,24 +3237,8 @@ ApplyModifiers( if (res == AMR_BAD) goto bad_modifier; - if (DEBUG(VAR)) { - char eflags_str[VarEvalFlags_ToStringSize]; - char vflags_str[VarFlags_ToStringSize]; - char exprflags_str[VarExprFlags_ToStringSize]; - const char *quot = st.newVal == var_Error ? "" : "\""; - const char *newVal = st.newVal == var_Error ? "error" : st.newVal; - - fprintf(debug_file, - "Result of ${%s:%.*s} is %s%s%s (%s, %s, %s)\n", - st.v->name, (int)(p - mod), mod, quot,
CVS commit: src/usr.bin/make
Module Name:src Committed By: rillig Date: Mon Sep 28 21:01:53 UTC 2020 Modified Files: src/usr.bin/make: var.c Log Message: make(1): move variable modifier :sh into separate function To generate a diff of this commit: cvs rdiff -u -r1.547 -r1.548 src/usr.bin/make/var.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/make/var.c diff -u src/usr.bin/make/var.c:1.547 src/usr.bin/make/var.c:1.548 --- src/usr.bin/make/var.c:1.547 Mon Sep 28 20:55:20 2020 +++ src/usr.bin/make/var.c Mon Sep 28 21:01:53 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: var.c,v 1.547 2020/09/28 20:55:20 rillig Exp $ */ +/* $NetBSD: var.c,v 1.548 2020/09/28 21:01:53 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -121,7 +121,7 @@ #include"metachar.h" /* "@(#)var.c 8.3 (Berkeley) 3/19/94" */ -MAKE_RCSID("$NetBSD: var.c,v 1.547 2020/09/28 20:55:20 rillig Exp $"); +MAKE_RCSID("$NetBSD: var.c,v 1.548 2020/09/28 21:01:53 rillig Exp $"); #define VAR_DEBUG1(fmt, arg1) DEBUG1(VAR, fmt, arg1) #define VAR_DEBUG2(fmt, arg1, arg2) DEBUG2(VAR, fmt, arg1, arg2) @@ -2966,6 +2966,27 @@ ApplyModifier_SysV(const char **pp, Appl } #endif +#ifdef SUNSHCMD +/* :sh */ +static ApplyModifierResult +ApplyModifier_SunShell(const char **pp, ApplyModifiersState *st) +{ +const char *p = *pp; +if (p[1] == 'h' && (p[2] == st->endc || p[2] == ':')) { + if (st->eflags & VARE_WANTRES) { + const char *errfmt; + st->newVal = Cmd_Exec(st->val, ); + if (errfmt) + Error(errfmt, st->val); + } else + st->newVal = emptyString; + *pp = p + 2; + return AMR_OK; +} else + return AMR_UNKNOWN; +} +#endif + /* Apply any modifiers (such as :Mpattern or :@var@loop@ or :Q or ::=value). */ static char * ApplyModifiers( @@ -3165,18 +3186,7 @@ ApplyModifiers( break; #ifdef SUNSHCMD case 's': - if (p[1] == 'h' && (p[2] == st.endc || p[2] == ':')) { - if (st.eflags & VARE_WANTRES) { - const char *errfmt; - st.newVal = Cmd_Exec(st.val, ); - if (errfmt) - Error(errfmt, st.val); - } else - st.newVal = emptyString; - p += 2; - res = AMR_OK; - } else - res = AMR_UNKNOWN; + res = ApplyModifier_SunShell(, ); break; #endif default:
CVS commit: src/usr.bin/make
Module Name:src Committed By: rillig Date: Mon Sep 28 20:55:20 UTC 2020 Modified Files: src/usr.bin/make: var.c Log Message: make(1): make debug logging in var.c compatible to C90 The ... ellipsis for macros is only available since C99. To generate a diff of this commit: cvs rdiff -u -r1.546 -r1.547 src/usr.bin/make/var.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/make/var.c diff -u src/usr.bin/make/var.c:1.546 src/usr.bin/make/var.c:1.547 --- src/usr.bin/make/var.c:1.546 Sun Sep 27 21:35:16 2020 +++ src/usr.bin/make/var.c Mon Sep 28 20:55:20 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: var.c,v 1.546 2020/09/27 21:35:16 rillig Exp $ */ +/* $NetBSD: var.c,v 1.547 2020/09/28 20:55:20 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -121,15 +121,12 @@ #include"metachar.h" /* "@(#)var.c 8.3 (Berkeley) 3/19/94" */ -MAKE_RCSID("$NetBSD: var.c,v 1.546 2020/09/27 21:35:16 rillig Exp $"); +MAKE_RCSID("$NetBSD: var.c,v 1.547 2020/09/28 20:55:20 rillig Exp $"); -#define VAR_DEBUG_IF(cond, fmt, ...) \ -if (!(DEBUG(VAR) && (cond))) \ - (void) 0; \ -else\ - fprintf(debug_file, fmt, __VA_ARGS__) - -#define VAR_DEBUG(fmt, ...) VAR_DEBUG_IF(TRUE, fmt, __VA_ARGS__) +#define VAR_DEBUG1(fmt, arg1) DEBUG1(VAR, fmt, arg1) +#define VAR_DEBUG2(fmt, arg1, arg2) DEBUG2(VAR, fmt, arg1, arg2) +#define VAR_DEBUG3(fmt, arg1, arg2, arg3) DEBUG3(VAR, fmt, arg1, arg2, arg3) +#define VAR_DEBUG4(fmt, arg1, arg2, arg3, arg4) DEBUG4(VAR, fmt, arg1, arg2, arg3, arg4) ENUM_FLAGS_RTTI_3(VarEvalFlags, VARE_UNDEFERR, VARE_WANTRES, VARE_ASSIGN); @@ -420,8 +417,9 @@ VarAdd(const char *name, const char *val he = Hash_CreateEntry(>context, name, NULL); Hash_SetValue(he, v); v->name = he->name; -VAR_DEBUG_IF(!(ctxt->flags & INTERNAL), - "%s:%s = %s\n", ctxt->name, name, val); +if (!(ctxt->flags & INTERNAL)) { + VAR_DEBUG3("%s:%s = %s\n", ctxt->name, name, val); +} } /* Remove a variable from a context, freeing the Var structure as well. */ @@ -437,8 +435,8 @@ Var_Delete(const char *name, GNode *ctxt name = name_freeIt; } he = Hash_FindEntry(>context, name); -VAR_DEBUG("%s:delete %s%s\n", - ctxt->name, name, he != NULL ? "" : " (not found)"); +VAR_DEBUG3("%s:delete %s%s\n", + ctxt->name, name, he != NULL ? "" : " (not found)"); free(name_freeIt); if (he != NULL) { @@ -700,11 +698,11 @@ Var_UnExport(const char *str) const char *varname = words.words[i]; v = VarFind(varname, VAR_GLOBAL, 0); if (v == NULL) { - VAR_DEBUG("Not unexporting \"%s\" (not found)\n", varname); + VAR_DEBUG1("Not unexporting \"%s\" (not found)\n", varname); continue; } - VAR_DEBUG("Unexporting \"%s\"\n", varname); + VAR_DEBUG1("Unexporting \"%s\"\n", varname); if (!unexport_env && (v->flags & VAR_EXPORTED) && !(v->flags & VAR_REEXPORT)) unsetenv(v->name); @@ -757,9 +755,9 @@ Var_Set_with_flags(const char *name, con } if (name[0] == '\0') { - VAR_DEBUG("Var_Set(\"%s\", \"%s\", ...) " - "name expands to empty string - ignored\n", - unexpanded_name, val); + VAR_DEBUG2("Var_Set(\"%s\", \"%s\", ...) " + "name expands to empty string - ignored\n", + unexpanded_name, val); free(name_freeIt); return; } @@ -768,7 +766,7 @@ Var_Set_with_flags(const char *name, con v = VarFind(name, VAR_CMD, 0); if (v != NULL) { if (v->flags & VAR_FROM_CMD) { - VAR_DEBUG("%s:%s = %s ignored!\n", ctxt->name, name, val); + VAR_DEBUG3("%s:%s = %s ignored!\n", ctxt->name, name, val); goto out; } VarFreeEnv(v, TRUE); @@ -788,15 +786,15 @@ Var_Set_with_flags(const char *name, con VarAdd(name, val, ctxt, flags); } else { if ((v->flags & VAR_READONLY) && !(flags & VAR_SET_READONLY)) { - VAR_DEBUG("%s:%s = %s ignored (read-only)\n", - ctxt->name, name, val); + VAR_DEBUG3("%s:%s = %s ignored (read-only)\n", + ctxt->name, name, val); goto out; } Buf_Empty(>val); if (val) Buf_AddStr(>val, val); - VAR_DEBUG("%s:%s = %s\n", ctxt->name, name, val); + VAR_DEBUG3("%s:%s = %s\n", ctxt->name, name, val); if (v->flags & VAR_EXPORTED) { Var_Export1(name, VAR_EXPORT_PARENT); } @@ -900,7 +898,7 @@ Var_Append(const char *name, const char /* TODO: handle errors */ name = name_freeIt; if (name[0] == '\0') { - VAR_DEBUG("Var_Append(\"%s\", \"%s\", ...) " + VAR_DEBUG2("Var_Append(\"%s\", \"%s\", ...) " "name expands to empty string - ignored\n", unexpanded_name, val); free(name_freeIt); @@ -916,8 +914,8 @@ Var_Append(const char *name, const char Buf_AddByte(>val, ' '); Buf_AddStr(>val, val); - VAR_DEBUG("%s:%s = %s\n", ctxt->name, name, - Buf_GetAll(>val, NULL)); + VAR_DEBUG3("%s:%s = %s\n", + ctxt->name, name, Buf_GetAll(>val, NULL)); if (v->flags &
CVS commit: src/usr.bin/make
Module Name:src Committed By: rillig Date: Mon Sep 28 20:46:12 UTC 2020 Modified Files: src/usr.bin/make: arch.c compat.c cond.c dir.c for.c hash.c job.c main.c make.c make.h meta.c parse.c suff.c Log Message: make(1): make debugging code shorter To generate a diff of this commit: cvs rdiff -u -r1.124 -r1.125 src/usr.bin/make/arch.c cvs rdiff -u -r1.156 -r1.157 src/usr.bin/make/compat.c cvs rdiff -u -r1.153 -r1.154 src/usr.bin/make/cond.c cvs rdiff -u -r1.150 -r1.151 src/usr.bin/make/dir.c cvs rdiff -u -r1.88 -r1.89 src/usr.bin/make/for.c cvs rdiff -u -r1.34 -r1.35 src/usr.bin/make/hash.c cvs rdiff -u -r1.249 -r1.250 src/usr.bin/make/job.c cvs rdiff -u -r1.351 -r1.352 src/usr.bin/make/main.c cvs rdiff -u -r1.151 -r1.152 src/usr.bin/make/make.c cvs rdiff -u -r1.148 -r1.149 src/usr.bin/make/make.h cvs rdiff -u -r1.120 -r1.121 src/usr.bin/make/meta.c cvs rdiff -u -r1.340 -r1.341 src/usr.bin/make/parse.c cvs rdiff -u -r1.170 -r1.171 src/usr.bin/make/suff.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/make/arch.c diff -u src/usr.bin/make/arch.c:1.124 src/usr.bin/make/arch.c:1.125 --- src/usr.bin/make/arch.c:1.124 Sun Sep 27 21:35:16 2020 +++ src/usr.bin/make/arch.c Mon Sep 28 20:46:11 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: arch.c,v 1.124 2020/09/27 21:35:16 rillig Exp $ */ +/* $NetBSD: arch.c,v 1.125 2020/09/28 20:46:11 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -134,7 +134,7 @@ #include"config.h" /* "@(#)arch.c 8.2 (Berkeley) 1/2/94" */ -MAKE_RCSID("$NetBSD: arch.c,v 1.124 2020/09/27 21:35:16 rillig Exp $"); +MAKE_RCSID("$NetBSD: arch.c,v 1.125 2020/09/28 20:46:11 rillig Exp $"); #ifdef TARGET_MACHINE #undef MAKE_MACHINE @@ -676,9 +676,7 @@ ArchSVR4Entry(Arch *ar, char *name, size strncmp(name, ARLONGNAMES2, sizeof(ARLONGNAMES2) - 1) == 0) { if (ar->fnametab != NULL) { - if (DEBUG(ARCH)) { - fprintf(debug_file, "Attempted to redefine an SVR4 name table\n"); - } + DEBUG0(ARCH, "Attempted to redefine an SVR4 name table\n"); return -1; } @@ -690,9 +688,7 @@ ArchSVR4Entry(Arch *ar, char *name, size ar->fnamesize = size; if (fread(ar->fnametab, size, 1, arch) != 1) { - if (DEBUG(ARCH)) { - fprintf(debug_file, "Reading an SVR4 name table failed\n"); - } + DEBUG0(ARCH, "Reading an SVR4 name table failed\n"); return -1; } eptr = ar->fnametab + size; @@ -701,10 +697,8 @@ ArchSVR4Entry(Arch *ar, char *name, size entry++; *ptr = '\0'; } - if (DEBUG(ARCH)) { - fprintf(debug_file, "Found svr4 archive name table with %lu entries\n", - (unsigned long)entry); - } + DEBUG1(ARCH, "Found svr4 archive name table with %lu entries\n", + (unsigned long)entry); return 0; } @@ -713,22 +707,16 @@ ArchSVR4Entry(Arch *ar, char *name, size entry = (size_t)strtol([1], , 0); if ((*eptr != ' ' && *eptr != '\0') || eptr == [1]) { - if (DEBUG(ARCH)) { - fprintf(debug_file, "Could not parse SVR4 name %s\n", name); - } +DEBUG1(ARCH, "Could not parse SVR4 name %s\n", name); return 2; } if (entry >= ar->fnamesize) { - if (DEBUG(ARCH)) { - fprintf(debug_file, "SVR4 entry offset %s is greater than %lu\n", + DEBUG2(ARCH, "SVR4 entry offset %s is greater than %lu\n", name, (unsigned long)ar->fnamesize); - } return 2; } -if (DEBUG(ARCH)) { - fprintf(debug_file, "Replaced %s with %s\n", name, >fnametab[entry]); -} +DEBUG2(ARCH, "Replaced %s with %s\n", name, >fnametab[entry]); snprintf(name, MAXPATHLEN + 1, "%s", >fnametab[entry]); return 1; Index: src/usr.bin/make/compat.c diff -u src/usr.bin/make/compat.c:1.156 src/usr.bin/make/compat.c:1.157 --- src/usr.bin/make/compat.c:1.156 Sun Sep 27 21:35:16 2020 +++ src/usr.bin/make/compat.c Mon Sep 28 20:46:11 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: compat.c,v 1.156 2020/09/27 21:35:16 rillig Exp $ */ +/* $NetBSD: compat.c,v 1.157 2020/09/28 20:46:11 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -99,7 +99,7 @@ #include"pathnames.h" /* "@(#)compat.c 8.2 (Berkeley) 3/19/94" */ -MAKE_RCSID("$NetBSD: compat.c,v 1.156 2020/09/27 21:35:16 rillig Exp $"); +MAKE_RCSID("$NetBSD: compat.c,v 1.157 2020/09/28 20:46:11 rillig Exp $"); static GNode *curTarg = NULL; static void CompatInterrupt(int); @@ -301,8 +301,7 @@ Compat_RunCommand(const char *cmdp, stru if (!doIt && NoExecute(gn)) { return 0; } -if (DEBUG(JOB)) - fprintf(debug_file, "Execute: '%s'\n", cmd); +DEBUG1(JOB, "Execute: '%s'\n", cmd); if (useShell) { /* @@ -532,18 +531,13 @@ Compat_Make(GNode *gn, GNode *pgn) * exist and when we were modified last. The criteria for datedness * are defined by the Make_OODate function. */ - if (DEBUG(MAKE)) { - fprintf(debug_file, "Examining %s...", gn->name); - } +
CVS commit: src/usr.sbin/sysinst
Module Name:src Committed By: martin Date: Mon Sep 28 18:51:34 UTC 2020 Modified Files: src/usr.sbin/sysinst: disks.c Log Message: PR 55379: avoid creating bogus /etc/fstab lines for /dev/cd* if no cdrom is available. To generate a diff of this commit: cvs rdiff -u -r1.68 -r1.69 src/usr.sbin/sysinst/disks.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/sysinst/disks.c diff -u src/usr.sbin/sysinst/disks.c:1.68 src/usr.sbin/sysinst/disks.c:1.69 --- src/usr.sbin/sysinst/disks.c:1.68 Tue Sep 22 15:16:49 2020 +++ src/usr.sbin/sysinst/disks.c Mon Sep 28 18:51:34 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: disks.c,v 1.68 2020/09/22 15:16:49 martin Exp $ */ +/* $NetBSD: disks.c,v 1.69 2020/09/28 18:51:34 martin Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -1414,14 +1414,16 @@ done_with_disks: scripting_fprintf(f, "kernfs\t\t/kern\tkernfs\trw\n"); scripting_fprintf(f, "ptyfs\t\t/dev/pts\tptyfs\trw\n"); scripting_fprintf(f, "procfs\t\t/proc\tprocfs\trw\n"); - scripting_fprintf(f, "/dev/%s\t\t/cdrom\tcd9660\tro,noauto\n", - cdrom_dev); + if (cdrom_dev[0] != 0) + scripting_fprintf(f, "/dev/%s\t\t/cdrom\tcd9660\tro,noauto\n", + cdrom_dev); scripting_fprintf(f, "%stmpfs\t\t/var/shm\ttmpfs\trw,-m1777,-sram%%25\n", tmpfs_on_var_shm() ? "" : "#"); make_target_dir("/kern"); make_target_dir("/proc"); make_target_dir("/dev/pts"); - make_target_dir("/cdrom"); + if (cdrom_dev[0] != 0) + make_target_dir("/cdrom"); make_target_dir("/var/shm"); scripting_fprintf(NULL, "EOF\n");
CVS commit: src/usr.sbin/sysinst
Module Name:src Committed By: martin Date: Mon Sep 28 18:40:24 UTC 2020 Modified Files: src/usr.sbin/sysinst: README.md_defs disklabel.c partitions.c Log Message: PR 55378: do not assume RAW_PART to be either 2 or 3 To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/usr.sbin/sysinst/README.md_defs cvs rdiff -u -r1.37 -r1.38 src/usr.sbin/sysinst/disklabel.c cvs rdiff -u -r1.10 -r1.11 src/usr.sbin/sysinst/partitions.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/sysinst/README.md_defs diff -u src/usr.sbin/sysinst/README.md_defs:1.4 src/usr.sbin/sysinst/README.md_defs:1.5 --- src/usr.sbin/sysinst/README.md_defs:1.4 Mon Jan 20 21:26:35 2020 +++ src/usr.sbin/sysinst/README.md_defs Mon Sep 28 18:40:23 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: README.md_defs,v 1.4 2020/01/20 21:26:35 martin Exp $ */ +/* $NetBSD: README.md_defs,v 1.5 2020/09/28 18:40:23 martin Exp $ */ The following is trying to document the most important machine dependent defines used in the sysinst code. @@ -92,7 +92,7 @@ if something fails. HAVE_PLAIN_DISKLABEL_BOOT may be undefined, only used on architectures that have MBR as primary with disklabel as -secondary partitioning scheme (RAW_PART != 2) +secondary partitioning scheme (RAW_PART == 3) used like: Index: src/usr.sbin/sysinst/disklabel.c diff -u src/usr.sbin/sysinst/disklabel.c:1.37 src/usr.sbin/sysinst/disklabel.c:1.38 --- src/usr.sbin/sysinst/disklabel.c:1.37 Wed Feb 19 21:45:09 2020 +++ src/usr.sbin/sysinst/disklabel.c Mon Sep 28 18:40:23 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: disklabel.c,v 1.37 2020/02/19 21:45:09 martin Exp $ */ +/* $NetBSD: disklabel.c,v 1.38 2020/09/28 18:40:23 martin Exp $ */ /* * Copyright 2018 The NetBSD Foundation, Inc. @@ -172,7 +172,7 @@ disklabel_parts_new(const char *dev, dad strncpy(parts->l.d_packname, "fictious", sizeof parts->l.d_packname); -#if RAW_PART > 2 +#if RAW_PART == 3 if (parts->dp.parent != NULL) { parts->l.d_partitions[RAW_PART-1].p_fstype = FS_UNUSED; parts->l.d_partitions[RAW_PART-1].p_offset = start; @@ -231,7 +231,7 @@ disklabel_parts_read(const char *disk, d close(fd); return NULL; } -#if RAW_PART > 2 +#if RAW_PART == 3 if (parts->l.d_partitions[RAW_PART-1].p_fstype == FS_UNUSED) { daddr_t dlstart = parts->l.d_partitions[RAW_PART-1].p_offset; daddr_t dlend = start + @@ -467,7 +467,7 @@ disklabel_delete_all(struct disk_partiti memset(>l.d_partitions, 0, sizeof(parts->l.d_partitions)); parts->dp.num_part = 0; -#if RAW_PART > 2 +#if RAW_PART == 3 if (parts->dp.parent != NULL) { parts->l.d_partitions[RAW_PART-1].p_fstype = FS_UNUSED; parts->l.d_partitions[RAW_PART-1].p_offset = @@ -501,7 +501,7 @@ disklabel_delete(struct disk_partitions if (ndx == id) { if (part == RAW_PART -#if RAW_PART > 2 +#if RAW_PART == 3 || (part == RAW_PART-1 && parts->dp.parent != NULL) #endif @@ -543,7 +543,7 @@ disklabel_delete_range(struct disk_parti daddr_t start = parts->l.d_partitions[part].p_offset; daddr_t end = start + parts->l.d_partitions[part].p_size; -#if RAW_PART > 2 +#if RAW_PART == 3 if (parts->dp.parent != NULL && part == RAW_PART - 1 && start == r_start && r_start + r_size == end) @@ -759,7 +759,7 @@ disklabel_get_part_info(const struct dis parts->l.d_partitions[part].p_fstype == FS_UNUSED) info->flags |= PTI_PSCHEME_INTERNAL|PTI_RAW_PART; -#if RAW_PART > 2 +#if RAW_PART == 3 if (part == (RAW_PART-1) && parts->dp.parent != NULL && parts->l.d_partitions[part].p_fstype == FS_UNUSED) info->flags |= @@ -906,7 +906,7 @@ disklabel_can_add_partition(const struct for (i = 0; i < parts->l.d_npartitions; i++) { if (i == RAW_PART) continue; -#if RAW_PART > 2 +#if RAW_PART == 3 if (i == RAW_PART-1 && parts->dp.parent != NULL) continue; #endif @@ -1061,7 +1061,7 @@ disklabel_add_partition(struct disk_part continue; if (i == RAW_PART) continue; -#if RAW_PART > 2 +#if RAW_PART == 3 if (i == RAW_PART-1 && parts->dp.parent != NULL) continue; #endif @@ -1124,7 +1124,7 @@ disklabel_add_outer_partition(struct dis continue; if (i == RAW_PART) continue; -#if RAW_PART > 2 +#if RAW_PART == 3 if (i == RAW_PART-1 && parts->dp.parent != NULL) continue; #endif Index: src/usr.sbin/sysinst/partitions.c diff -u src/usr.sbin/sysinst/partitions.c:1.10 src/usr.sbin/sysinst/partitions.c:1.11 --- src/usr.sbin/sysinst/partitions.c:1.10 Tue Jan 28 07:43:42 2020 +++ src/usr.sbin/sysinst/partitions.c Mon Sep 28 18:40:23 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: partitions.c,v 1.10 2020/01/28 07:43:42 martin Exp $ */ +/* $NetBSD: partitions.c,v 1.11 2020/09/28 18:40:23 martin Exp $ */ /* * Copyright 2018 The NetBSD Foundation, Inc. @@ -133,7 +133,7 @@ extern const struct disk_partitioning_sc extern const struct disk_partitioning_scheme
CVS commit: src/usr.sbin/sysinst
Module Name:src Committed By: martin Date: Mon Sep 28 18:13:25 UTC 2020 Modified Files: src/usr.sbin/sysinst: bsddisklabel.c Log Message: PR 55377: mark boot partitions in the partition size display, as suggested by Izumi Tsutsui (minor modifications + all bugs by me) To generate a diff of this commit: cvs rdiff -u -r1.43 -r1.44 src/usr.sbin/sysinst/bsddisklabel.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/sysinst/bsddisklabel.c diff -u src/usr.sbin/sysinst/bsddisklabel.c:1.43 src/usr.sbin/sysinst/bsddisklabel.c:1.44 --- src/usr.sbin/sysinst/bsddisklabel.c:1.43 Tue Sep 22 16:18:54 2020 +++ src/usr.sbin/sysinst/bsddisklabel.c Mon Sep 28 18:13:25 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: bsddisklabel.c,v 1.43 2020/09/22 16:18:54 martin Exp $ */ +/* $NetBSD: bsddisklabel.c,v 1.44 2020/09/28 18:13:25 martin Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -260,7 +260,13 @@ draw_size_menu_line(menudesc *m, int opt pset->infos[opt].fs_version)); mount = swap; } else if (pset->infos[opt].mount[0]) { - mount = pset->infos[opt].mount; + if (pset->infos[opt].instflags & PUIINST_BOOT) { + snprintf(swap, sizeof swap, "%s <%s>", + pset->infos[opt].mount, msg_string(MSG_ptn_boot)); + mount = swap; + } else { + mount = pset->infos[opt].mount; + } #ifndef NO_CLONES } else if (pset->infos[opt].flags & PUIFLG_CLONE_PARTS) { snprintf(swap, sizeof swap, "%zu %s", @@ -278,6 +284,11 @@ draw_size_menu_line(menudesc *m, int opt if (mount == NULL) mount = getfslabelname(pset->infos[opt].fs_type, pset->infos[opt].fs_version); + if (pset->infos[opt].instflags & PUIINST_BOOT) { + snprintf(swap, sizeof swap, "%s <%s>", + mount, msg_string(MSG_ptn_boot)); + mount = swap; + } mount = str_arg_subst(msg_string(MSG_size_ptn_not_mounted), 1, ); free_mount = true;
CVS commit: src/sys/arch/alpha/include
Module Name:src Committed By: thorpej Date: Mon Sep 28 16:27:47 UTC 2020 Modified Files: src/sys/arch/alpha/include: cpuconf.h Log Message: Remove a no-longer-accurate comment. To generate a diff of this commit: cvs rdiff -u -r1.15 -r1.16 src/sys/arch/alpha/include/cpuconf.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/arch/alpha/include/cpuconf.h diff -u src/sys/arch/alpha/include/cpuconf.h:1.15 src/sys/arch/alpha/include/cpuconf.h:1.16 --- src/sys/arch/alpha/include/cpuconf.h:1.15 Mon Feb 6 02:14:13 2012 +++ src/sys/arch/alpha/include/cpuconf.h Mon Sep 28 16:27:47 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: cpuconf.h,v 1.15 2012/02/06 02:14:13 matt Exp $ */ +/* $NetBSD: cpuconf.h,v 1.16 2020/09/28 16:27:47 thorpej Exp $ */ /* * Copyright (c) 1996 Christopher G. Demetriou. All rights reserved. @@ -79,7 +79,6 @@ struct platform { * tags. It may optionally fill in the cons_init, device_register and * mcheck_handler tags. * - * The iointr tag is filled in by set_iointr (in interrupt.c). * The clockintr tag is filled in by cpu_initclocks (in clock.c). * * nocpu is function to call when you can't figure what platform you're on.
CVS commit: src/sbin/ifconfig
Module Name:src Committed By: roy Date: Mon Sep 28 13:50:22 UTC 2020 Modified Files: src/sbin/ifconfig: ifconfig.c Log Message: ifconfig: Just look at if_data->ifi_link_state for carrier It should be the sole source of truth. if_data is also carried in ifa_data from getifaddrs(3) which saves more ioctl calls. To generate a diff of this commit: cvs rdiff -u -r1.246 -r1.247 src/sbin/ifconfig/ifconfig.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/ifconfig/ifconfig.c diff -u src/sbin/ifconfig/ifconfig.c:1.246 src/sbin/ifconfig/ifconfig.c:1.247 --- src/sbin/ifconfig/ifconfig.c:1.246 Sat Sep 26 23:43:26 2020 +++ src/sbin/ifconfig/ifconfig.c Mon Sep 28 13:50:22 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: ifconfig.c,v 1.246 2020/09/26 23:43:26 roy Exp $ */ +/* $NetBSD: ifconfig.c,v 1.247 2020/09/28 13:50:22 roy Exp $ */ /*- * Copyright (c) 1997, 1998, 2000 The NetBSD Foundation, Inc. @@ -63,7 +63,7 @@ #ifndef lint __COPYRIGHT("@(#) Copyright (c) 1983, 1993\ The Regents of the University of California. All rights reserved."); -__RCSID("$NetBSD: ifconfig.c,v 1.246 2020/09/26 23:43:26 roy Exp $"); +__RCSID("$NetBSD: ifconfig.c,v 1.247 2020/09/28 13:50:22 roy Exp $"); #endif /* not lint */ #include @@ -852,6 +852,7 @@ printall(const char *ifname, prop_dictio struct ifaddrs *ifap, *ifa; struct ifreq ifr; const struct sockaddr_dl *sdl = NULL; + const struct if_data *ifi = NULL; prop_dictionary_t env, oenv; int idx; char *p; @@ -880,8 +881,10 @@ printall(const char *ifname, prop_dictio if (ifname != NULL && strcmp(ifname, ifa->ifa_name) != 0) continue; - if (ifa->ifa_addr->sa_family == AF_LINK) + if (ifa->ifa_addr->sa_family == AF_LINK) { sdl = (const struct sockaddr_dl *)ifa->ifa_addr; + ifi = (const struct if_data *)ifa->ifa_data; + } if (p && strcmp(p, ifa->ifa_name) == 0) continue; if (!prop_dictionary_set_string(env, "if", ifa->ifa_name)) @@ -895,7 +898,8 @@ printall(const char *ifname, prop_dictio if (uflag && (ifa->ifa_flags & IFF_UP) == 0) continue; - if (sflag && carrier(env)) + if (sflag && (ifi == NULL || + ifi->ifi_link_state == LINK_STATE_DOWN)) continue; idx++; /* @@ -910,6 +914,7 @@ printall(const char *ifname, prop_dictio status(sdl, ifa->ifa_data, env, oenv); sdl = NULL; + ifi = NULL; } if (lflag) printf("\n"); @@ -1213,34 +1218,15 @@ setifmtu(prop_dictionary_t env, prop_dic static int carrier(prop_dictionary_t env) { - struct ifmediareq ifmr = { .ifm_status = 0 }; + struct ifdatareq ifdr = { .ifdr_data.ifi_link_state = 0 }; - if (direct_ioctl(env, SIOCGIFMEDIA, ) == -1) { - /* - * Interface doesn't support SIOC{G,S}IFMEDIA; - * check link state. - */ - struct ifdatareq ifdr = { .ifdr_data.ifi_link_state = 0 }; + if (direct_ioctl(env, SIOCGIFDATA, ) == -1) + return EXIT_FAILURE; - if (direct_ioctl(env, SIOCGIFDATA, ) == -1) - return EXIT_FAILURE; - if (ifdr.ifdr_data.ifi_link_state == LINK_STATE_DOWN) - return EXIT_FAILURE; - else - return EXIT_SUCCESS; - } - if ((ifmr.ifm_status & IFM_AVALID) == 0) { - /* - * Interface doesn't report media-valid status. - * assume ok. - */ - return EXIT_SUCCESS; - } - /* otherwise, return ok for active, not-ok if not active. */ - if (ifmr.ifm_status & IFM_ACTIVE) - return EXIT_SUCCESS; - else + if (ifdr.ifdr_data.ifi_link_state == LINK_STATE_DOWN) return EXIT_FAILURE; + else /* Assume UP if UNKNOWN */ + return EXIT_SUCCESS; } static void
CVS commit: src/sys/dev/ata
Module Name:src Committed By: jakllsch Date: Mon Sep 28 12:47:49 UTC 2020 Modified Files: src/sys/dev/ata: wd.c Log Message: fix typo that prevented bytes/physsect reporting from working To generate a diff of this commit: cvs rdiff -u -r1.464 -r1.465 src/sys/dev/ata/wd.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/ata/wd.c diff -u src/sys/dev/ata/wd.c:1.464 src/sys/dev/ata/wd.c:1.465 --- src/sys/dev/ata/wd.c:1.464 Sun Sep 27 16:58:11 2020 +++ src/sys/dev/ata/wd.c Mon Sep 28 12:47:49 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: wd.c,v 1.464 2020/09/27 16:58:11 christos Exp $ */ +/* $NetBSD: wd.c,v 1.465 2020/09/28 12:47:49 jakllsch Exp $ */ /* * Copyright (c) 1998, 2001 Manuel Bouyer. All rights reserved. @@ -54,7 +54,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: wd.c,v 1.464 2020/09/27 16:58:11 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: wd.c,v 1.465 2020/09/28 12:47:49 jakllsch Exp $"); #include "opt_ata.h" #include "opt_wd.h" @@ -453,7 +453,7 @@ wdattach(device_t parent, device_t self, wd->sc_blksize, (unsigned long long)wd->sc_capacity); if (wd->sc_sectoralign.dsa_alignment != 1) { aprint_normal(" (%d bytes/physsect", - wd->sc_sectoralign.dsa_alignment & wd->sc_blksize); + wd->sc_sectoralign.dsa_alignment * wd->sc_blksize); if (wd->sc_sectoralign.dsa_firstaligned != 0) { aprint_normal("; first aligned sector: %jd", (intmax_t)wd->sc_sectoralign.dsa_firstaligned);
CVS commit: src/sys/arch/mips/cavium
Module Name:src Committed By: jmcneill Date: Mon Sep 28 12:14:47 UTC 2020 Modified Files: src/sys/arch/mips/cavium: mainbus.c Log Message: faa_a4x_bst is gone To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/sys/arch/mips/cavium/mainbus.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/mips/cavium/mainbus.c diff -u src/sys/arch/mips/cavium/mainbus.c:1.5 src/sys/arch/mips/cavium/mainbus.c:1.6 --- src/sys/arch/mips/cavium/mainbus.c:1.5 Tue Aug 18 10:35:51 2020 +++ src/sys/arch/mips/cavium/mainbus.c Mon Sep 28 12:14:47 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: mainbus.c,v 1.5 2020/08/18 10:35:51 simonb Exp $ */ +/* $NetBSD: mainbus.c,v 1.6 2020/09/28 12:14:47 jmcneill Exp $ */ /* * Copyright (c) 2007 @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.5 2020/08/18 10:35:51 simonb Exp $"); +__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.6 2020/09/28 12:14:47 jmcneill Exp $"); #define _MIPS_BUS_DMA_PRIVATE @@ -125,7 +125,6 @@ mainbus_attach_devicetree(device_t self) simplebus_bus_io_init(_bus_tag, NULL); faa.faa_bst = _bus_tag; - faa.faa_a4x_bst = NULL; /* XXX */ faa.faa_dmat = _dma_tag; faa.faa_name = "";
CVS commit: src/sys/arch/arm/imx/fdt
Module Name:src Committed By: jmcneill Date: Mon Sep 28 12:15:23 UTC 2020 Modified Files: src/sys/arch/arm/imx/fdt: imx6_platform.c Log Message: faa_a4x_bst is no more To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/sys/arch/arm/imx/fdt/imx6_platform.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/imx/fdt/imx6_platform.c diff -u src/sys/arch/arm/imx/fdt/imx6_platform.c:1.10 src/sys/arch/arm/imx/fdt/imx6_platform.c:1.11 --- src/sys/arch/arm/imx/fdt/imx6_platform.c:1.10 Fri Jul 10 12:25:09 2020 +++ src/sys/arch/arm/imx/fdt/imx6_platform.c Mon Sep 28 12:15:23 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: imx6_platform.c,v 1.10 2020/07/10 12:25:09 skrll Exp $ */ +/* $NetBSD: imx6_platform.c,v 1.11 2020/09/28 12:15:23 jmcneill Exp $ */ /*- * Copyright (c) 2019 Genetec Corporation. All rights reserved. * Written by Hashimoto Kenichi for Genetec Corporation. @@ -25,7 +25,7 @@ * SUCH DAMAGE. */ #include -__KERNEL_RCSID(0, "$NetBSD: imx6_platform.c,v 1.10 2020/07/10 12:25:09 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: imx6_platform.c,v 1.11 2020/09/28 12:15:23 jmcneill Exp $"); #include "arml2cc.h" #include "opt_console.h" @@ -72,7 +72,6 @@ __KERNEL_RCSID(0, "$NetBSD: imx6_platfor #endif extern struct bus_space armv7_generic_bs_tag; -extern struct bus_space armv7_generic_a4x_bs_tag; extern struct arm32_bus_dma_tag arm_generic_dma_tag; static const struct pmap_devmap * @@ -91,7 +90,6 @@ static void imx_platform_init_attach_args(struct fdt_attach_args *faa) { faa->faa_bst = _generic_bs_tag; - faa->faa_a4x_bst = _generic_a4x_bs_tag; faa->faa_dmat = _generic_dma_tag; }
CVS commit: src/sys/arch/aarch64/aarch64
Module Name:src Committed By: skrll Date: Mon Sep 28 12:04:19 UTC 2020 Modified Files: src/sys/arch/aarch64/aarch64: pmap.c Log Message: Only set pmap_devmap_bootstrap_done if something gets mapped. Think acpi_platform_devmap To generate a diff of this commit: cvs rdiff -u -r1.90 -r1.91 src/sys/arch/aarch64/aarch64/pmap.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/aarch64/aarch64/pmap.c diff -u src/sys/arch/aarch64/aarch64/pmap.c:1.90 src/sys/arch/aarch64/aarch64/pmap.c:1.91 --- src/sys/arch/aarch64/aarch64/pmap.c:1.90 Sat Sep 19 13:33:08 2020 +++ src/sys/arch/aarch64/aarch64/pmap.c Mon Sep 28 12:04:19 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: pmap.c,v 1.90 2020/09/19 13:33:08 skrll Exp $ */ +/* $NetBSD: pmap.c,v 1.91 2020/09/28 12:04:19 skrll Exp $ */ /* * Copyright (c) 2017 Ryo Shimizu @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.90 2020/09/19 13:33:08 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.91 2020/09/28 12:04:19 skrll Exp $"); #include "opt_arm_debug.h" #include "opt_ddb.h" @@ -373,9 +373,8 @@ pmap_devmap_bootstrap(vaddr_t l0pt, cons table[i].pd_size, table[i].pd_prot, table[i].pd_flags); + pmap_devmap_bootstrap_done = true; } - - pmap_devmap_bootstrap_done = true; } const struct pmap_devmap *
CVS commit: src/sys
Module Name:src Committed By: jmcneill Date: Mon Sep 28 11:54:24 UTC 2020 Modified Files: src/sys/arch/arm/acpi: acpi_platform.c src/sys/arch/arm/altera: cycv_platform.c src/sys/arch/arm/amlogic: meson_platform.c src/sys/arch/arm/broadcom: bcm2835_com.c bcm283x_platform.c src/sys/arch/arm/fdt: arm_platform.c src/sys/arch/arm/nvidia: tegra_com.c tegra_platform.c src/sys/arch/arm/rockchip: rk_platform.c src/sys/arch/arm/samsung: exynos_platform.c src/sys/arch/arm/sunxi: sunxi_platform.c src/sys/arch/arm/ti: am3_platform.c omap3_platform.c ti_com.c src/sys/arch/arm/vexpress: vexpress_platform.c src/sys/arch/arm/virt: virt_platform.c src/sys/arch/arm/xilinx: zynq_platform.c src/sys/dev/fdt: fdtvar.h Log Message: Get rid of a4x bus_space tag from fdtbus_attach_args. The only consumer of this was various com(4) glue so modify all of that to use the new com_init_regs_stride instead. To generate a diff of this commit: cvs rdiff -u -r1.19 -r1.20 src/sys/arch/arm/acpi/acpi_platform.c cvs rdiff -u -r1.13 -r1.14 src/sys/arch/arm/altera/cycv_platform.c cvs rdiff -u -r1.15 -r1.16 src/sys/arch/arm/amlogic/meson_platform.c cvs rdiff -u -r1.5 -r1.6 src/sys/arch/arm/broadcom/bcm2835_com.c cvs rdiff -u -r1.40 -r1.41 src/sys/arch/arm/broadcom/bcm283x_platform.c cvs rdiff -u -r1.2 -r1.3 src/sys/arch/arm/fdt/arm_platform.c cvs rdiff -u -r1.12 -r1.13 src/sys/arch/arm/nvidia/tegra_com.c cvs rdiff -u -r1.23 -r1.24 src/sys/arch/arm/nvidia/tegra_platform.c cvs rdiff -u -r1.9 -r1.10 src/sys/arch/arm/rockchip/rk_platform.c cvs rdiff -u -r1.29 -r1.30 src/sys/arch/arm/samsung/exynos_platform.c cvs rdiff -u -r1.39 -r1.40 src/sys/arch/arm/sunxi/sunxi_platform.c cvs rdiff -u -r1.2 -r1.3 src/sys/arch/arm/ti/am3_platform.c cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/ti/omap3_platform.c cvs rdiff -u -r1.8 -r1.9 src/sys/arch/arm/ti/ti_com.c cvs rdiff -u -r1.17 -r1.18 src/sys/arch/arm/vexpress/vexpress_platform.c cvs rdiff -u -r1.10 -r1.11 src/sys/arch/arm/virt/virt_platform.c cvs rdiff -u -r1.2 -r1.3 src/sys/arch/arm/xilinx/zynq_platform.c cvs rdiff -u -r1.60 -r1.61 src/sys/dev/fdt/fdtvar.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/arch/arm/acpi/acpi_platform.c diff -u src/sys/arch/arm/acpi/acpi_platform.c:1.19 src/sys/arch/arm/acpi/acpi_platform.c:1.20 --- src/sys/arch/arm/acpi/acpi_platform.c:1.19 Sun Sep 13 21:41:17 2020 +++ src/sys/arch/arm/acpi/acpi_platform.c Mon Sep 28 11:54:22 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: acpi_platform.c,v 1.19 2020/09/13 21:41:17 jmcneill Exp $ */ +/* $NetBSD: acpi_platform.c,v 1.20 2020/09/28 11:54:22 jmcneill Exp $ */ /*- * Copyright (c) 2018 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ #include "opt_multiprocessor.h" #include -__KERNEL_RCSID(0, "$NetBSD: acpi_platform.c,v 1.19 2020/09/13 21:41:17 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: acpi_platform.c,v 1.20 2020/09/28 11:54:22 jmcneill Exp $"); #include #include @@ -239,10 +239,8 @@ static void acpi_platform_init_attach_args(struct fdt_attach_args *faa) { extern struct bus_space arm_generic_bs_tag; - extern struct bus_space arm_generic_a4x_bs_tag; faa->faa_bst = _generic_bs_tag; - faa->faa_a4x_bst = _generic_a4x_bs_tag; faa->faa_dmat = _coherent_dma_tag; } Index: src/sys/arch/arm/altera/cycv_platform.c diff -u src/sys/arch/arm/altera/cycv_platform.c:1.13 src/sys/arch/arm/altera/cycv_platform.c:1.14 --- src/sys/arch/arm/altera/cycv_platform.c:1.13 Fri Jul 10 12:25:08 2020 +++ src/sys/arch/arm/altera/cycv_platform.c Mon Sep 28 11:54:22 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: cycv_platform.c,v 1.13 2020/07/10 12:25:08 skrll Exp $ */ +/* $NetBSD: cycv_platform.c,v 1.14 2020/09/28 11:54:22 jmcneill Exp $ */ /* This file is in the public domain. */ @@ -7,7 +7,7 @@ #include "opt_multiprocessor.h" #include -__KERNEL_RCSID(0, "$NetBSD: cycv_platform.c,v 1.13 2020/07/10 12:25:08 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: cycv_platform.c,v 1.14 2020/09/28 11:54:22 jmcneill Exp $"); #define _ARM32_BUS_DMA_PRIVATE #include @@ -131,7 +131,6 @@ cycv_mpstart(void) static void cycv_platform_init_attach_args(struct fdt_attach_args *faa) { faa->faa_bst = _generic_bs_tag; - faa->faa_a4x_bst = _generic_a4x_bs_tag; faa->faa_dmat = _generic_dma_tag; } Index: src/sys/arch/arm/amlogic/meson_platform.c diff -u src/sys/arch/arm/amlogic/meson_platform.c:1.15 src/sys/arch/arm/amlogic/meson_platform.c:1.16 --- src/sys/arch/arm/amlogic/meson_platform.c:1.15 Fri Jul 10 12:25:08 2020 +++ src/sys/arch/arm/amlogic/meson_platform.c Mon Sep 28 11:54:22 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: meson_platform.c,v 1.15 2020/07/10 12:25:08 skrll Exp $ */ +/* $NetBSD: meson_platform.c,v 1.16 2020/09/28 11:54:22 jmcneill Exp $ */ /*- * Copyright (c) 2019 Jared McNeill @@ -33,7 +33,7 @@ #include "arml2cc.h"
CVS commit: src/sys/dev/fdt
Module Name:src Committed By: jmcneill Date: Mon Sep 28 11:34:47 UTC 2020 Modified Files: src/sys/dev/fdt: dw_apb_uart.c Log Message: Default reg-shift is 2, not 0, for DW APB UART To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/sys/dev/fdt/dw_apb_uart.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/fdt/dw_apb_uart.c diff -u src/sys/dev/fdt/dw_apb_uart.c:1.6 src/sys/dev/fdt/dw_apb_uart.c:1.7 --- src/sys/dev/fdt/dw_apb_uart.c:1.6 Mon Sep 28 11:32:19 2020 +++ src/sys/dev/fdt/dw_apb_uart.c Mon Sep 28 11:34:47 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: dw_apb_uart.c,v 1.6 2020/09/28 11:32:19 jmcneill Exp $ */ +/* $NetBSD: dw_apb_uart.c,v 1.7 2020/09/28 11:34:47 jmcneill Exp $ */ /*- * Copyright (c) 2017 Jared McNeill @@ -28,7 +28,7 @@ #include -__KERNEL_RCSID(1, "$NetBSD: dw_apb_uart.c,v 1.6 2020/09/28 11:32:19 jmcneill Exp $"); +__KERNEL_RCSID(1, "$NetBSD: dw_apb_uart.c,v 1.7 2020/09/28 11:34:47 jmcneill Exp $"); #include #include @@ -174,8 +174,8 @@ dw_apb_uart_console_consinit(struct fdt_ flags = fdtbus_get_stdout_flags(); if (of_getprop_uint32(phandle, "reg-shift", _shift)) { - /* missing or bad reg-shift property, assume 0 */ - reg_shift = 0; + /* missing or bad reg-shift property, assume 2 */ + reg_shift = 2; } memset(_bsh, 0, sizeof(dummy_bsh));
CVS commit: src/sys/dev/ic
Module Name:src Committed By: jmcneill Date: Mon Sep 28 11:33:15 UTC 2020 Modified Files: src/sys/dev/ic: com.c comreg.h Log Message: Auto-detect DW APB UART FIFO length and print the FIFO length when enabled instead of just "working fifo". To generate a diff of this commit: cvs rdiff -u -r1.359 -r1.360 src/sys/dev/ic/com.c cvs rdiff -u -r1.26 -r1.27 src/sys/dev/ic/comreg.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/com.c diff -u src/sys/dev/ic/com.c:1.359 src/sys/dev/ic/com.c:1.360 --- src/sys/dev/ic/com.c:1.359 Tue May 26 13:24:52 2020 +++ src/sys/dev/ic/com.c Mon Sep 28 11:33:15 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: com.c,v 1.359 2020/05/26 13:24:52 martin Exp $ */ +/* $NetBSD: com.c,v 1.360 2020/09/28 11:33:15 jmcneill Exp $ */ /*- * Copyright (c) 1998, 1999, 2004, 2008 The NetBSD Foundation, Inc. @@ -66,7 +66,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: com.c,v 1.359 2020/05/26 13:24:52 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: com.c,v 1.360 2020/09/28 11:33:15 jmcneill Exp $"); #include "opt_com.h" #include "opt_ddb.h" @@ -428,9 +428,10 @@ com_attach_subr(struct com_softc *sc) { struct com_regs *regsp = >sc_regs; struct tty *tp; - u_int8_t lcr; + uint32_t cpr; + uint8_t lcr; const char *fifo_msg = NULL; - prop_dictionary_t dict; + prop_dictionary_t dict; bool is_console = true; bool force_console = false; @@ -498,32 +499,32 @@ com_attach_subr(struct com_softc *sc) case COM_TYPE_AU1x00: sc->sc_fifolen = 16; - fifo_msg = "Au1X00 UART, working fifo"; + fifo_msg = "Au1X00 UART"; SET(sc->sc_hwflags, COM_HW_FIFO); goto fifodelay; case COM_TYPE_16550_NOERS: sc->sc_fifolen = 16; - fifo_msg = "ns16650, no ERS, working fifo"; + fifo_msg = "ns16650, no ERS"; SET(sc->sc_hwflags, COM_HW_FIFO); goto fifodelay; case COM_TYPE_OMAP: sc->sc_fifolen = 64; - fifo_msg = "OMAP UART, working fifo"; + fifo_msg = "OMAP UART"; SET(sc->sc_hwflags, COM_HW_FIFO); goto fifodelay; case COM_TYPE_INGENIC: sc->sc_fifolen = 16; - fifo_msg = "Ingenic UART, working fifo"; + fifo_msg = "Ingenic UART"; SET(sc->sc_hwflags, COM_HW_FIFO); SET(sc->sc_hwflags, COM_HW_NOIEN); goto fifodelay; case COM_TYPE_TEGRA: sc->sc_fifolen = 8; - fifo_msg = "Tegra UART, working fifo"; + fifo_msg = "Tegra UART"; SET(sc->sc_hwflags, COM_HW_FIFO); CSR_WRITE_1(regsp, COM_REG_FIFO, FIFO_ENABLE | FIFO_RCV_RST | FIFO_XMT_RST | FIFO_TRIGGER_1); @@ -531,11 +532,26 @@ com_attach_subr(struct com_softc *sc) case COM_TYPE_BCMAUXUART: sc->sc_fifolen = 1; - fifo_msg = "BCM AUX UART, working fifo"; + fifo_msg = "BCM AUX UART"; SET(sc->sc_hwflags, COM_HW_FIFO); CSR_WRITE_1(regsp, COM_REG_FIFO, FIFO_ENABLE | FIFO_RCV_RST | FIFO_XMT_RST | FIFO_TRIGGER_1); goto fifodelay; + + case COM_TYPE_DW_APB: + cpr = bus_space_read_4(sc->sc_regs.cr_iot, sc->sc_regs.cr_ioh, + DW_APB_UART_CPR); + sc->sc_fifolen = __SHIFTOUT(cpr, UART_CPR_FIFO_MODE) * 16; + if (sc->sc_fifolen == 0) { + fifo_msg = "DesignWare APB UART, no fifo"; + CSR_WRITE_1(regsp, COM_REG_FIFO, 0); + } else { + fifo_msg = "DesignWare APB UART"; + SET(sc->sc_hwflags, COM_HW_FIFO); + CSR_WRITE_1(regsp, COM_REG_FIFO, + FIFO_ENABLE | FIFO_RCV_RST | FIFO_XMT_RST | FIFO_TRIGGER_1); + } + goto fifodelay; } sc->sc_fifolen = 1; @@ -554,7 +570,7 @@ com_attach_subr(struct com_softc *sc) == FIFO_TRIGGER_14) { SET(sc->sc_hwflags, COM_HW_FIFO); - fifo_msg = "ns16550a, working fifo"; + fifo_msg = "ns16550a"; /* * IIR changes into the EFR if LCR is set to LCR_EERS @@ -588,9 +604,9 @@ com_attach_subr(struct com_softc *sc) if (sc->sc_fifolen == 0) fifo_msg = "st16650, broken fifo"; else if (sc->sc_fifolen == 32) - fifo_msg = "st16650a, working fifo"; + fifo_msg = "st16650a"; else - fifo_msg = "ns16550a, working fifo"; + fifo_msg = "ns16550a"; } /* @@ -629,9 +645,9 @@ com_attach_subr(struct com_softc *sc) CSR_WRITE_1(regsp, COM_REG_FIFO, fcr); if (sc->sc_fifolen == 64) - fifo_msg = "tl16c750, working fifo"; + fifo_msg = "tl16c750"; else - fifo_msg = "ns16750, working fifo"; + fifo_msg = "ns16750"; } } else fifo_msg = "ns16550, broken fifo"; @@ -647,7 +663,11 @@ fifodelay: * printing it until now. */ delay(10); - aprint_normal(": %s\n", fifo_msg); + if (ISSET(sc->sc_hwflags, COM_HW_FIFO)) { + aprint_normal(": %s, %d-byte FIFO\n", fifo_msg, sc->sc_fifolen); + } else { + aprint_normal(": %s\n", fifo_msg); + } if (ISSET(sc->sc_hwflags, COM_HW_TXFIFO_DISABLE)) { sc->sc_fifolen = 1; aprint_normal_dev(sc->sc_dev, "txfifo disabled\n"); Index: src/sys/dev/ic/comreg.h diff -u src/sys/dev/ic/comreg.h:1.26 src/sys/dev/ic/comreg.h:1.27 --- src/sys/dev/ic/comreg.h:1.26 Sun Oct 29 14:06:08 2017 +++
CVS commit: src/sys/dev/fdt
Module Name:src Committed By: jmcneill Date: Mon Sep 28 11:32:19 UTC 2020 Modified Files: src/sys/dev/fdt: dw_apb_uart.c Log Message: Use com_init_regs_stride instead of a4x tag To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/sys/dev/fdt/dw_apb_uart.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/fdt/dw_apb_uart.c diff -u src/sys/dev/fdt/dw_apb_uart.c:1.5 src/sys/dev/fdt/dw_apb_uart.c:1.6 --- src/sys/dev/fdt/dw_apb_uart.c:1.5 Sun Jul 21 15:57:23 2019 +++ src/sys/dev/fdt/dw_apb_uart.c Mon Sep 28 11:32:19 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: dw_apb_uart.c,v 1.5 2019/07/21 15:57:23 rin Exp $ */ +/* $NetBSD: dw_apb_uart.c,v 1.6 2020/09/28 11:32:19 jmcneill Exp $ */ /*- * Copyright (c) 2017 Jared McNeill @@ -28,7 +28,7 @@ #include -__KERNEL_RCSID(1, "$NetBSD: dw_apb_uart.c,v 1.5 2019/07/21 15:57:23 rin Exp $"); +__KERNEL_RCSID(1, "$NetBSD: dw_apb_uart.c,v 1.6 2020/09/28 11:32:19 jmcneill Exp $"); #include #include @@ -76,8 +76,8 @@ dw_apb_uart_attach(device_t parent, devi struct dw_apb_uart_softc * const ssc = device_private(self); struct com_softc * const sc = >ssc_sc; struct fdt_attach_args * const faa = aux; + bus_space_tag_t bst = faa->faa_bst; bus_space_handle_t bsh; - bus_space_tag_t bst; char intrstr[128]; bus_addr_t addr; bus_size_t size; @@ -91,17 +91,7 @@ dw_apb_uart_attach(device_t parent, devi if (of_getprop_uint32(faa->faa_phandle, "reg-shift", _shift)) { /* missing or bad reg-shift property, assume 2 */ - bst = faa->faa_a4x_bst; - } else { - if (reg_shift == 2) { - bst = faa->faa_a4x_bst; - } else if (reg_shift == 0) { - bst = faa->faa_bst; - } else { - aprint_error(": unsupported reg-shift value %d\n", - reg_shift); - return; - } + reg_shift = 2; } sc->sc_dev = self; @@ -137,7 +127,7 @@ dw_apb_uart_attach(device_t parent, devi return; } - com_init_regs(>sc_regs, bst, bsh, addr); + com_init_regs_stride(>sc_regs, bst, bsh, addr, reg_shift); com_attach_subr(sc); @@ -169,9 +159,12 @@ static void dw_apb_uart_console_consinit(struct fdt_attach_args *faa, u_int uart_freq) { const int phandle = faa->faa_phandle; - bus_space_tag_t bst = faa->faa_a4x_bst; + bus_space_tag_t bst = faa->faa_bst; + bus_space_handle_t dummy_bsh; + struct com_regs regs; bus_addr_t addr; tcflag_t flags; + u_int reg_shift; int speed; fdtbus_get_reg(phandle, 0, , NULL); @@ -180,7 +173,15 @@ dw_apb_uart_console_consinit(struct fdt_ speed = 115200; /* default */ flags = fdtbus_get_stdout_flags(); - if (comcnattach(bst, addr, speed, uart_freq, COM_TYPE_DW_APB, flags)) + if (of_getprop_uint32(phandle, "reg-shift", _shift)) { + /* missing or bad reg-shift property, assume 0 */ + reg_shift = 0; + } + + memset(_bsh, 0, sizeof(dummy_bsh)); + com_init_regs_stride(, bst, dummy_bsh, addr, reg_shift); + + if (comcnattach1(, speed, uart_freq, COM_TYPE_DW_APB, flags)) panic("Cannot initialize dw-apb-uart console"); cn_set_magic("+");
CVS commit: src/external/mit/ctwm
Module Name:src Committed By: nia Date: Mon Sep 28 06:04:08 UTC 2020 Modified Files: src/external/mit/ctwm: Makefile src/external/mit/ctwm/bin/ctwm: Makefile src/external/mit/ctwm/etc: Makefile Log Message: unbreak. bsd.files.mk needs to have an includes target, see also share/wscons/fonts/Makefile To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/external/mit/ctwm/Makefile cvs rdiff -u -r1.7 -r1.8 src/external/mit/ctwm/bin/ctwm/Makefile cvs rdiff -u -r1.1 -r1.2 src/external/mit/ctwm/etc/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/mit/ctwm/Makefile diff -u src/external/mit/ctwm/Makefile:1.4 src/external/mit/ctwm/Makefile:1.5 --- src/external/mit/ctwm/Makefile:1.4 Thu Sep 24 06:52:48 2020 +++ src/external/mit/ctwm/Makefile Mon Sep 28 06:04:08 2020 @@ -1,10 +1,10 @@ -# $NetBSD: Makefile,v 1.4 2020/09/24 06:52:48 nia Exp $ +# $NetBSD: Makefile,v 1.5 2020/09/28 06:04:08 nia Exp $ # Top level Makefile to cross build xorg inside the NetBSD tree. .include -SUBDIR= bin libexec +SUBDIR= bin etc libexec .if ${MKUPDATE} == "no" && !defined(NOCLEANDIR) BUILDTARGETS+= cleandir Index: src/external/mit/ctwm/bin/ctwm/Makefile diff -u src/external/mit/ctwm/bin/ctwm/Makefile:1.7 src/external/mit/ctwm/bin/ctwm/Makefile:1.8 --- src/external/mit/ctwm/bin/ctwm/Makefile:1.7 Thu Sep 24 06:52:48 2020 +++ src/external/mit/ctwm/bin/ctwm/Makefile Mon Sep 28 06:04:08 2020 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.7 2020/09/24 06:52:48 nia Exp $ +# $NetBSD: Makefile,v 1.8 2020/09/28 06:04:08 nia Exp $ .include @@ -44,9 +44,7 @@ FILES= 3D_Expand15.xpm 3D_Iconify15.xp xedit.xpm xftp.xpm xgopher.xpm xgrab.xpm xhpcalc.xpm \ xirc.xpm xmail.xpm xman.xpm xmosaic.xpm xnomail.xpm \ xrn-compose.xpm xrn.goodnews.xpm xrn.nonews.xpm xrn.xpm \ - xterm.xpm system.ctwmrc - -FILESDIR_system.ctwmrc = ${CTWMCONFIGDIR} + xterm.xpm LDADD+= -lXpm -lXmu -lXt -lSM -lICE -lXext -lX11 DPADD+= ${LIBXPM} ${LIBXMU} ${LIBXT} ${LIBSM} ${LIBICE} ${LIBXEXT} ${LIBX11} Index: src/external/mit/ctwm/etc/Makefile diff -u src/external/mit/ctwm/etc/Makefile:1.1 src/external/mit/ctwm/etc/Makefile:1.2 --- src/external/mit/ctwm/etc/Makefile:1.1 Thu Sep 24 05:43:30 2020 +++ src/external/mit/ctwm/etc/Makefile Mon Sep 28 06:04:08 2020 @@ -1,7 +1,10 @@ -# $NetBSD: Makefile,v 1.1 2020/09/24 05:43:30 nia Exp $ +# $NetBSD: Makefile,v 1.2 2020/09/28 06:04:08 nia Exp $ FILESDIR= ${X11ETCDIR}/ctwm FILESMODE= 644 FILES= system.ctwmrc +realall: ${FILES} + +.include .include