CVS commit: src/sys/lib/libsa

2022-08-06 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sun Aug  7 05:51:55 UTC 2022

Modified Files:
src/sys/lib/libsa: tftp.c

Log Message:
Consistently use ntohs() instead of htons() when converting from
network to host byte order.

No binary changes both for big and little endian.


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/sys/lib/libsa/tftp.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/tftp.c
diff -u src/sys/lib/libsa/tftp.c:1.37 src/sys/lib/libsa/tftp.c:1.38
--- src/sys/lib/libsa/tftp.c:1.37	Fri Mar 26 10:35:08 2021
+++ src/sys/lib/libsa/tftp.c	Sun Aug  7 05:51:55 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: tftp.c,v 1.37 2021/03/26 10:35:08 rin Exp $	 */
+/*	$NetBSD: tftp.c,v 1.38 2022/08/07 05:51:55 rin Exp $	 */
 
 /*
  * Copyright (c) 1996
@@ -114,7 +114,7 @@ recvtftp(struct iodesc *d, void *pkt, si
 	t = (struct tftphdr *)pkt;
 	switch (ntohs(t->th_opcode)) {
 	case DATA:
-		if (htons(t->th_block) != d->xid) {
+		if (ntohs(t->th_block) != d->xid) {
 			/*
 			 * Expected block?
 			 */



CVS commit: src/sys/lib/libsa

2022-08-06 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sun Aug  7 05:51:55 UTC 2022

Modified Files:
src/sys/lib/libsa: tftp.c

Log Message:
Consistently use ntohs() instead of htons() when converting from
network to host byte order.

No binary changes both for big and little endian.


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/sys/lib/libsa/tftp.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/evbppc/conf

2022-08-06 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sun Aug  7 03:08:40 UTC 2022

Modified Files:
src/sys/arch/evbppc/conf: RB800

Log Message:
Enable UFS_DIRHASH; this machine has 256MB RAM :)


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/sys/arch/evbppc/conf/RB800

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/evbppc/conf/RB800
diff -u src/sys/arch/evbppc/conf/RB800:1.39 src/sys/arch/evbppc/conf/RB800:1.40
--- src/sys/arch/evbppc/conf/RB800:1.39	Sun Aug  7 02:52:25 2022
+++ src/sys/arch/evbppc/conf/RB800	Sun Aug  7 03:08:40 2022
@@ -1,4 +1,4 @@
-#	$NetBSD: RB800,v 1.39 2022/08/07 02:52:25 simonb Exp $
+#	$NetBSD: RB800,v 1.40 2022/08/07 03:08:40 rin Exp $
 #
 #	RB800 -- everything that's currently supported
 #
@@ -7,7 +7,7 @@ include 	"arch/evbppc/conf/std.mpc85xx"
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-ident 		"RB800-$Revision: 1.39 $"
+ident 		"RB800-$Revision: 1.40 $"
 
 maxusers	32
 
@@ -86,7 +86,7 @@ options 	FFS_EI		# FFS Endian Independen
 #options 	FFS_NO_SNAPSHOT	# No FFS snapshot support
 options 	QUOTA		# legacy UFS quotas
 options 	QUOTA2		# new, in-filesystem UFS quotas
-#options 	UFS_DIRHASH	# UFS Large Directory Hashing
+options 	UFS_DIRHASH	# UFS Large Directory Hashing
 #options 	UFS_EXTATTR	# Extended attribute support for UFS1
 options 	WAPBL		# File system journaling support
 #options 	LFS_DIRHASH	# LFS version of UFS_DIRHASH - experimental



CVS commit: src/sys/arch/evbppc/conf

2022-08-06 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sun Aug  7 03:08:40 UTC 2022

Modified Files:
src/sys/arch/evbppc/conf: RB800

Log Message:
Enable UFS_DIRHASH; this machine has 256MB RAM :)


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/sys/arch/evbppc/conf/RB800

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/atari/conf

2022-08-06 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Sun Aug  7 02:55:46 UTC 2022

Modified Files:
src/sys/arch/atari/conf: ATARITT FALCON HADES MILAN-ISAIDE MILAN-PCIIDE
SMALL030

Log Message:
Regen.


To generate a diff of this commit:
cvs rdiff -u -r1.124 -r1.125 src/sys/arch/atari/conf/ATARITT
cvs rdiff -u -r1.121 -r1.122 src/sys/arch/atari/conf/FALCON
cvs rdiff -u -r1.119 -r1.120 src/sys/arch/atari/conf/HADES
cvs rdiff -u -r1.97 -r1.98 src/sys/arch/atari/conf/MILAN-ISAIDE
cvs rdiff -u -r1.101 -r1.102 src/sys/arch/atari/conf/MILAN-PCIIDE
cvs rdiff -u -r1.27 -r1.28 src/sys/arch/atari/conf/SMALL030

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/conf/ATARITT
diff -u src/sys/arch/atari/conf/ATARITT:1.124 src/sys/arch/atari/conf/ATARITT:1.125
--- src/sys/arch/atari/conf/ATARITT:1.124	Sat Jun 25 13:20:30 2022
+++ src/sys/arch/atari/conf/ATARITT	Sun Aug  7 02:55:46 2022
@@ -1,11 +1,11 @@
 #
-# $NetBSD: ATARITT,v 1.124 2022/06/25 13:20:30 tsutsui Exp $
+# $NetBSD: ATARITT,v 1.125 2022/08/07 02:55:46 simonb Exp $
 #
 # This file was automatically created. Changes will be
 # lost when running makeconf in this directory.
 #
 # Created from:
-#		NetBSD: GENERIC.in,v 1.123 2022/06/25 13:17:04 tsutsui Exp $
+#		NetBSD: GENERIC.in,v 1.124 2022/08/07 02:52:24 simonb Exp $
 include "arch/atari/conf/std.atari"
 options INCLUDE_CONFIG_FILE # embed config file in kernel binary
 makeoptions COPTS="-O2 -fno-reorder-blocks -fno-unwind-tables -fno-omit-frame-pointer" # See share/mk/sys.mk. -fno-omit-frame-pointer is necessary for backtraces in DDB.
@@ -30,7 +30,7 @@ file-system PTYFS # /dev/pts/N support
 file-system TMPFS # Efficient memory file-system
 options WAPBL # File system journaling support
 options FFS_NO_SNAPSHOT # No FFS snapshot support
-options NFSSERVER # Network File System server side code
+options NFSSERVER # Network File System server
 options PANICWAIT # Require keystroke to dump/reboot
 options DDB # Kernel debugger
 options DDB_HISTORY_SIZE=100 # Enable history editing in DDB

Index: src/sys/arch/atari/conf/FALCON
diff -u src/sys/arch/atari/conf/FALCON:1.121 src/sys/arch/atari/conf/FALCON:1.122
--- src/sys/arch/atari/conf/FALCON:1.121	Sat Jun 25 13:20:30 2022
+++ src/sys/arch/atari/conf/FALCON	Sun Aug  7 02:55:46 2022
@@ -1,11 +1,11 @@
 #
-# $NetBSD: FALCON,v 1.121 2022/06/25 13:20:30 tsutsui Exp $
+# $NetBSD: FALCON,v 1.122 2022/08/07 02:55:46 simonb Exp $
 #
 # This file was automatically created. Changes will be
 # lost when running makeconf in this directory.
 #
 # Created from:
-#		NetBSD: GENERIC.in,v 1.123 2022/06/25 13:17:04 tsutsui Exp $
+#		NetBSD: GENERIC.in,v 1.124 2022/08/07 02:52:24 simonb Exp $
 include "arch/atari/conf/std.atari"
 options INCLUDE_CONFIG_FILE # embed config file in kernel binary
 makeoptions COPTS="-O2 -fno-reorder-blocks -fno-unwind-tables -fno-omit-frame-pointer" # See share/mk/sys.mk. -fno-omit-frame-pointer is necessary for backtraces in DDB.
@@ -35,7 +35,7 @@ file-system PTYFS # /dev/pts/N support
 file-system TMPFS # Efficient memory file-system
 options WAPBL # File system journaling support
 options FFS_NO_SNAPSHOT # No FFS snapshot support
-options NFSSERVER # Network File System server side code
+options NFSSERVER # Network File System server
 options PANICWAIT # Require keystroke to dump/reboot
 options DDB # Kernel debugger
 options DDB_HISTORY_SIZE=100 # Enable history editing in DDB

Index: src/sys/arch/atari/conf/HADES
diff -u src/sys/arch/atari/conf/HADES:1.119 src/sys/arch/atari/conf/HADES:1.120
--- src/sys/arch/atari/conf/HADES:1.119	Sat Jun 25 13:20:30 2022
+++ src/sys/arch/atari/conf/HADES	Sun Aug  7 02:55:46 2022
@@ -1,12 +1,12 @@
 #
-# $NetBSD: HADES,v 1.119 2022/06/25 13:20:30 tsutsui Exp $
+# $NetBSD: HADES,v 1.120 2022/08/07 02:55:46 simonb Exp $
 #
 # This file was automatically created. Changes will be
 # lost when running makeconf in this directory.
 #
 # Created from:
 #		NetBSD: HADES.in,v 1.16 2018/03/31 04:19:41 tsutsui Exp $
-#		NetBSD: GENERIC.in,v 1.123 2022/06/25 13:17:04 tsutsui Exp $
+#		NetBSD: GENERIC.in,v 1.124 2022/08/07 02:52:24 simonb Exp $
 include "arch/atari/conf/std.hades"
 options INCLUDE_CONFIG_FILE # embed config file in kernel binary
 makeoptions COPTS="-O2 -fno-reorder-blocks -fno-unwind-tables -fno-omit-frame-pointer" # See share/mk/sys.mk. -fno-omit-frame-pointer is necessary for backtraces in DDB.
@@ -34,7 +34,7 @@ file-system PTYFS # /dev/pts/N support
 file-system TMPFS # Efficient memory file-system
 options WAPBL # File system journaling support
 options FFS_NO_SNAPSHOT # No FFS snapshot support
-options NFSSERVER # Network File System server side code
+options NFSSERVER # Network File System server
 options PANICWAIT # Require keystroke to dump/reboot
 options DDB # Kernel debugger
 options DDB_HISTORY_SIZE=100 # Enable history editing in DDB

Index: 

CVS commit: src/sys/arch/atari/conf

2022-08-06 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Sun Aug  7 02:55:46 UTC 2022

Modified Files:
src/sys/arch/atari/conf: ATARITT FALCON HADES MILAN-ISAIDE MILAN-PCIIDE
SMALL030

Log Message:
Regen.


To generate a diff of this commit:
cvs rdiff -u -r1.124 -r1.125 src/sys/arch/atari/conf/ATARITT
cvs rdiff -u -r1.121 -r1.122 src/sys/arch/atari/conf/FALCON
cvs rdiff -u -r1.119 -r1.120 src/sys/arch/atari/conf/HADES
cvs rdiff -u -r1.97 -r1.98 src/sys/arch/atari/conf/MILAN-ISAIDE
cvs rdiff -u -r1.101 -r1.102 src/sys/arch/atari/conf/MILAN-PCIIDE
cvs rdiff -u -r1.27 -r1.28 src/sys/arch/atari/conf/SMALL030

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/amiga/conf

2022-08-06 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Sun Aug  7 02:53:43 UTC 2022

Modified Files:
src/sys/arch/amiga/conf: GENERIC INSTALL

Log Message:
Regen.


To generate a diff of this commit:
cvs rdiff -u -r1.335 -r1.336 src/sys/arch/amiga/conf/GENERIC
cvs rdiff -u -r1.140 -r1.141 src/sys/arch/amiga/conf/INSTALL

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/amiga/conf/GENERIC
diff -u src/sys/arch/amiga/conf/GENERIC:1.335 src/sys/arch/amiga/conf/GENERIC:1.336
--- src/sys/arch/amiga/conf/GENERIC:1.335	Sun May 29 10:51:42 2022
+++ src/sys/arch/amiga/conf/GENERIC	Sun Aug  7 02:53:42 2022
@@ -1,9 +1,9 @@
-# $NetBSD: GENERIC,v 1.335 2022/05/29 10:51:42 rin Exp $
+# $NetBSD: GENERIC,v 1.336 2022/08/07 02:53:42 simonb Exp $
 #
 # This file was automatically created.
 # Changes will be lost when make is run in this directory.
 #
-# Created from: # NetBSD: GENERIC.in,v 1.149 2022/05/29 10:43:19 andvar Exp $
+# Created from: # NetBSD: GENERIC.in,v 1.150 2022/08/07 02:52:23 simonb Exp $
 #
 ##
 # GENERIC machine description file
@@ -29,7 +29,7 @@ include "arch/amiga/conf/std.amiga"
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		"GENERIC-$Revision: 1.335 $"
+#ident 		"GENERIC-$Revision: 1.336 $"
 
 makeoptions	COPTS="-O2 -fno-reorder-blocks -fno-omit-frame-pointer"
 	# See share/mk/sys.mk. -fno-omit-frame-pointer is necessary for
@@ -120,12 +120,12 @@ file-system	TMPFS		# Efficient memory fi
 #options 	FFS_EI		# FFS Endian Independent support
 options 	WAPBL		# File system journaling support
 
+#options 	FFS_NO_SNAPSHOT	# No FFS snapshot support
 options 	QUOTA		# legacy UFS quotas
 options 	QUOTA2		# new, in-filesystem UFS quotas
-#options	UFS_DIRHASH	# UFS Large Directory Hashing - Experimental
-options 	NFSSERVER	# Network File System server side code
-#options 	FFS_NO_SNAPSHOT	# No FFS snapshot support
+options 	UFS_DIRHASH	# UFS Large Directory Hashing
 options 	UFS_EXTATTR	# Extended attribute support for UFS1
+options 	NFSSERVER	# Network File System server
 
 #options 	EXT2FS_SYSTEM_FLAGS # makes ext2fs file flags (append and
 # immutable) behave as system flags.

Index: src/sys/arch/amiga/conf/INSTALL
diff -u src/sys/arch/amiga/conf/INSTALL:1.140 src/sys/arch/amiga/conf/INSTALL:1.141
--- src/sys/arch/amiga/conf/INSTALL:1.140	Sun May 29 10:51:42 2022
+++ src/sys/arch/amiga/conf/INSTALL	Sun Aug  7 02:53:42 2022
@@ -1,9 +1,9 @@
-# $NetBSD: INSTALL,v 1.140 2022/05/29 10:51:42 rin Exp $
+# $NetBSD: INSTALL,v 1.141 2022/08/07 02:53:42 simonb Exp $
 #
 # This file was automatically created.
 # Changes will be lost when make is run in this directory.
 #
-# Created from: # NetBSD: GENERIC.in,v 1.149 2022/05/29 10:43:19 andvar Exp $
+# Created from: # NetBSD: GENERIC.in,v 1.150 2022/08/07 02:52:23 simonb Exp $
 #
 ##
 # GENERIC machine description file
@@ -29,7 +29,7 @@ include "arch/amiga/conf/std.amiga"
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		"GENERIC-$Revision: 1.140 $"
+#ident 		"GENERIC-$Revision: 1.141 $"
 
 makeoptions	COPTS="-Os -fno-omit-frame-pointer"
 



CVS commit: src/sys/arch/amiga/conf

2022-08-06 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Sun Aug  7 02:53:43 UTC 2022

Modified Files:
src/sys/arch/amiga/conf: GENERIC INSTALL

Log Message:
Regen.


To generate a diff of this commit:
cvs rdiff -u -r1.335 -r1.336 src/sys/arch/amiga/conf/GENERIC
cvs rdiff -u -r1.140 -r1.141 src/sys/arch/amiga/conf/INSTALL

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch

2022-08-06 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Sun Aug  7 02:52:30 UTC 2022

Modified Files:
src/sys/arch/acorn32/conf: GENERIC
src/sys/arch/alpha/conf: GENERIC
src/sys/arch/amd64/conf: ALL GENERIC XEN3_DOM0 XEN3_DOMU
src/sys/arch/amiga/conf: DRACO GENERIC.in
src/sys/arch/amigappc/conf: GENERIC NULL
src/sys/arch/arc/conf: GENERIC
src/sys/arch/atari/conf: GENERIC.in
src/sys/arch/bebox/conf: GENERIC
src/sys/arch/cats/conf: GENERIC
src/sys/arch/cesfic/conf: GENERIC
src/sys/arch/cobalt/conf: GENERIC
src/sys/arch/dreamcast/conf: G1IDE GENERIC
src/sys/arch/emips/conf: GENERIC
src/sys/arch/epoc32/conf: GENERIC
src/sys/arch/evbarm/conf: ADI_BRH ARMADAXP ARMADILLO210 ARMADILLO9
BCM5301X BCM56340 CP3100 CUBOX DUOVERO GEMINI GEMINI_MASTER
GEMINI_SLAVE GENERIC.common GUMSTIX HAWK HDL_G HPT5325 IMX31LITE
INTEGRATOR INTEGRATOR_CP IQ31244 IQ80310 IQ80321 IXDP425 IXM1200
IYONIX LUBBOCK MARVELL_NAS MINI2440 MMNET_GENERIC MPCSA_GENERIC
MV2120 N900 NAPPI NSLU2 OMAP5EVM OPENBLOCKS_A6 OPENBLOCKS_AX3
OSK5912 PANDABOARD PEPPER SHEEVAPLUG SMDK2410 SMDK2800 TEAMASA_NPWR
TEAMASA_NPWR_FC TISDP2420 TISDP2430 TS7200 TWINTAIL VIPER VTC100
ZAO425
src/sys/arch/evbmips/conf: ADM5120 ADM5120-NB ADM5120-USB ALCHEMY AP30
CI20 CPMBR1400 DB120 GDIUM LINKITSMART7688 LOONGSON MALTA MERAKI
MIPSSIM OCTEON RB153 RB433UAH SBMIPS WGT624V3 XLSATX ZYXELKX
src/sys/arch/evbppc/conf: DHT EV64260 EXPLORA451 MPC8536DS MPC8548CDS
OPENBLOCKS200 OPENBLOCKS266 OPENBLOCKS600 P2020DS P2020RDB PMPPC
RB800 RB850GX2 TWRP1025 VIRTEX_DFC VIRTEX_GSRD1 VIRTEX_GSRD2 WALNUT
src/sys/arch/evbsh3/conf: COMPUTEX7750 CQREEKSH3 KZSH401 NEXTVOD
T_SH7706LAN T_SH7706LSR
src/sys/arch/ews4800mips/conf: GENERIC
src/sys/arch/hp300/conf: GENERIC INSTALL
src/sys/arch/hpcmips/conf: GENERIC
src/sys/arch/hpcsh/conf: GENERIC
src/sys/arch/hppa/conf: GENERIC
src/sys/arch/i386/conf: ALL GENERIC XEN3PAE_DOM0 XEN3PAE_DOMU
src/sys/arch/ia64/conf: GENERIC GENERIC.SKI
src/sys/arch/ibmnws/conf: GENERIC
src/sys/arch/iyonix/conf: GENERIC
src/sys/arch/landisk/conf: GENERIC
src/sys/arch/luna68k/conf: GENERIC INSTALL
src/sys/arch/mac68k/conf: GENERIC
src/sys/arch/macppc/conf: GENERIC GENERIC_601 MAMBO POWERMAC_G5
POWERMAC_G5_11_2
src/sys/arch/mipsco/conf: GENERIC
src/sys/arch/mmeye/conf: GENERIC MMEYE_WLF
src/sys/arch/mvme68k/conf: GENERIC
src/sys/arch/mvmeppc/conf: GENERIC
src/sys/arch/netwinder/conf: GENERIC
src/sys/arch/news68k/conf: GENERIC GENERIC_TINY
src/sys/arch/newsmips/conf: GENERIC
src/sys/arch/next68k/conf: GENERIC
src/sys/arch/ofppc/conf: GENERIC
src/sys/arch/playstation2/conf: config.playstation2
src/sys/arch/pmax/conf: GENERIC GENERIC64
src/sys/arch/prep/conf: GENERIC
src/sys/arch/riscv/conf: GENERIC
src/sys/arch/rs6000/conf: GENERIC
src/sys/arch/sandpoint/conf: GENERIC
src/sys/arch/sbmips/conf: GENERIC
src/sys/arch/sgimips/conf: GENERIC32_IP12 GENERIC32_IP2x GENERIC32_IP3x
src/sys/arch/shark/conf: GENERIC
src/sys/arch/sparc/conf: GENERIC MRCOFFEE
src/sys/arch/sparc64/conf: GENERIC NONPLUS64
src/sys/arch/sun2/conf: GENERIC
src/sys/arch/sun3/conf: DISKLESS GENERIC GENERIC3X
src/sys/arch/vax/conf: GENERIC VAX780
src/sys/arch/x68k/conf: GENERIC
src/sys/arch/zaurus/conf: GENERIC

Log Message:
UFS/LFS dirhash:
- Enable UFS_DIRHASH if the architecture or kernel model specific config
  file can use 128MB of RAM or more.
- Remove experimental tag from UFS_DIRHASH; it's been with RUMP kernel
  and by a number of NetBSD developers for years.
- Add LFS_DIRHASH if LFS was enabled.
- Be somewhat consistent with FS options order.


To generate a diff of this commit:
cvs rdiff -u -r1.134 -r1.135 src/sys/arch/acorn32/conf/GENERIC
cvs rdiff -u -r1.414 -r1.415 src/sys/arch/alpha/conf/GENERIC
cvs rdiff -u -r1.172 -r1.173 src/sys/arch/amd64/conf/ALL
cvs rdiff -u -r1.595 -r1.596 src/sys/arch/amd64/conf/GENERIC
cvs rdiff -u -r1.196 -r1.197 src/sys/arch/amd64/conf/XEN3_DOM0
cvs rdiff -u -r1.98 -r1.99 src/sys/arch/amd64/conf/XEN3_DOMU
cvs rdiff -u -r1.200 -r1.201 src/sys/arch/amiga/conf/DRACO
cvs rdiff -u -r1.149 -r1.150 src/sys/arch/amiga/conf/GENERIC.in
cvs rdiff -u -r1.42 -r1.43 src/sys/arch/amigappc/conf/GENERIC
cvs rdiff -u -r1.61 -r1.62 src/sys/arch/amigappc/conf/NULL
cvs rdiff -u -r1.200 -r1.201 src/sys/arch/arc/conf/GENERIC
cvs rdiff -u -r1.123 -r1.124 src/sys/arch/atari/conf/GENERIC.in
cvs rdiff -u -r1.166 -r1.167 src/sys/arch/bebox/conf/GENERIC
cvs rdiff -u -r1.184 -r1.185 

CVS commit: src/sys/ufs

2022-08-06 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Sun Aug  7 02:33:47 UTC 2022

Modified Files:
src/sys/ufs/lfs: ulfs_dirhash.c
src/sys/ufs/ufs: ufs_dirhash.c

Log Message:
If UFS or LFS dirhash is enabled in the kernel, set the dirhash cache
size dependant on memory size.  If less than 128MB of memory, default
to no cache.  With 128MB of memory or more, use a maximum cache size of
1/64th of memory; cap maximum default cache size to 32MB (for systems
with 2GB of memory or more).

The dirhash cache sizes are still explicityly setable by sysctl(8) or
by adding relevant entry(s) to sysctl.conf(5).


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/ufs/lfs/ulfs_dirhash.c
cvs rdiff -u -r1.40 -r1.41 src/sys/ufs/ufs/ufs_dirhash.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/ufs

2022-08-06 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Sun Aug  7 02:33:47 UTC 2022

Modified Files:
src/sys/ufs/lfs: ulfs_dirhash.c
src/sys/ufs/ufs: ufs_dirhash.c

Log Message:
If UFS or LFS dirhash is enabled in the kernel, set the dirhash cache
size dependant on memory size.  If less than 128MB of memory, default
to no cache.  With 128MB of memory or more, use a maximum cache size of
1/64th of memory; cap maximum default cache size to 32MB (for systems
with 2GB of memory or more).

The dirhash cache sizes are still explicityly setable by sysctl(8) or
by adding relevant entry(s) to sysctl.conf(5).


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/ufs/lfs/ulfs_dirhash.c
cvs rdiff -u -r1.40 -r1.41 src/sys/ufs/ufs/ufs_dirhash.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/ufs/lfs/ulfs_dirhash.c
diff -u src/sys/ufs/lfs/ulfs_dirhash.c:1.18 src/sys/ufs/lfs/ulfs_dirhash.c:1.19
--- src/sys/ufs/lfs/ulfs_dirhash.c:1.18	Sat Mar 14 18:08:40 2020
+++ src/sys/ufs/lfs/ulfs_dirhash.c	Sun Aug  7 02:33:47 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: ulfs_dirhash.c,v 1.18 2020/03/14 18:08:40 ad Exp $	*/
+/*	$NetBSD: ulfs_dirhash.c,v 1.19 2022/08/07 02:33:47 simonb Exp $	*/
 /*  from NetBSD: ufs_dirhash.c,v 1.37 2014/12/20 00:28:05 christos Exp  */
 
 /*
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ulfs_dirhash.c,v 1.18 2020/03/14 18:08:40 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ulfs_dirhash.c,v 1.19 2022/08/07 02:33:47 simonb Exp $");
 
 /*
  * This implements a hash-based lookup scheme for ULFS directories.
@@ -57,13 +57,25 @@ __KERNEL_RCSID(0, "$NetBSD: ulfs_dirhash
 #include 
 #include 
 
+/*
+ * Defaults for dirhash cache sizes:
+ *  - use up to 1/64th of system memory.
+ *  - disable dirhash (set the cache size to 0 bytes) if the
+ *calculated value of hash is less than 2MB.
+ *  - cap maximum size of the dirhash cache at 32MB.
+ */
+#define	DIRHASH_DEFAULT_DIVIDER	64
+#define	MIN_DEFAULT_DIRHASH_MEM	(2 * 1024 * 1024)
+#define	MAX_DEFAULT_DIRHASH_MEM	(32 * 1024 * 1024)
+
+
 #define WRAPINCR(val, limit)	(((val) + 1 == (limit)) ? 0 : ((val) + 1))
 #define WRAPDECR(val, limit)	(((val) == 0) ? ((limit) - 1) : ((val) - 1))
 #define OFSFMT(ip)		((ip)->i_lfs->um_maxsymlinklen <= 0)
 #define BLKFREE2IDX(n)		((n) > DH_NFSTATS ? DH_NFSTATS : (n))
 
 static u_int ulfs_dirhashminblks = 5;
-static u_int ulfs_dirhashmaxmem = 2 * 1024 * 1024;
+static u_int ulfs_dirhashmaxmem = 0;
 static u_int ulfs_dirhashmem;
 static u_int ulfs_dirhashcheck = 0;
 
@@ -125,7 +137,9 @@ ulfsdirhash_build(struct inode *ip)
 
 	/* Check if we can/should use dirhash. */
 	if (ip->i_dirhash == NULL) {
-		if (ip->i_size < (ulfs_dirhashminblks * dirblksiz) || OFSFMT(ip))
+		if (ulfs_dirhashmaxmem == 0 ||
+		ip->i_size < (ulfs_dirhashminblks * dirblksiz) ||
+		OFSFMT(ip))
 			return (-1);
 	} else {
 		/* Hash exists, but sysctls could have changed. */
@@ -1155,6 +1169,26 @@ void
 ulfsdirhash_init(void)
 {
 
+	/*
+	 * Only initialise defaults for the dirhash size if it hasn't
+	 * hasn't been set.
+	 */
+	if (ulfs_dirhashmaxmem == 0) {
+		/* Use 64-bit math to avoid overflows. */
+		uint64_t physmem_bytes, hash_bytes;
+
+		physmem_bytes = ctob((uint64_t)physmem);
+		hash_bytes = physmem_bytes / DIRHASH_DEFAULT_DIVIDER;
+
+		if (hash_bytes < MIN_DEFAULT_DIRHASH_MEM)
+			hash_bytes = 0;
+
+		if (hash_bytes > MAX_DEFAULT_DIRHASH_MEM)
+			hash_bytes = MAX_DEFAULT_DIRHASH_MEM;
+
+		ulfs_dirhashmaxmem = (u_int)hash_bytes;
+	}
+
 	mutex_init(_lock, MUTEX_DEFAULT, IPL_NONE);
 	ulfsdirhashblk_cache = pool_cache_init(DH_NBLKOFF * sizeof(daddr_t), 0,
 	0, 0, "dirhashblk", NULL, IPL_NONE, NULL, NULL, NULL);

Index: src/sys/ufs/ufs/ufs_dirhash.c
diff -u src/sys/ufs/ufs/ufs_dirhash.c:1.40 src/sys/ufs/ufs/ufs_dirhash.c:1.41
--- src/sys/ufs/ufs/ufs_dirhash.c:1.40	Mon Mar 16 21:20:13 2020
+++ src/sys/ufs/ufs/ufs_dirhash.c	Sun Aug  7 02:33:47 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: ufs_dirhash.c,v 1.40 2020/03/16 21:20:13 pgoyette Exp $	*/
+/*	$NetBSD: ufs_dirhash.c,v 1.41 2022/08/07 02:33:47 simonb Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002 Ian Dowse.  All rights reserved.
@@ -28,7 +28,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ufs_dirhash.c,v 1.40 2020/03/16 21:20:13 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ufs_dirhash.c,v 1.41 2022/08/07 02:33:47 simonb Exp $");
 
 /*
  * This implements a hash-based lookup scheme for UFS directories.
@@ -55,13 +55,26 @@ __KERNEL_RCSID(0, "$NetBSD: ufs_dirhash.
 #include 
 #include 
 
+
+/*
+ * Defaults for dirhash cache sizes:
+ *  - use up to 1/64th of system memory.
+ *  - disable dirhash (set the cache size to 0 bytes) if the
+ *calculated value of hash is less than 2MB.
+ *  - cap maximum size of the dirhash cache at 32MB.
+ */
+#define	DIRHASH_DEFAULT_DIVIDER	64
+#define	MIN_DEFAULT_DIRHASH_MEM	(2 * 1024 * 1024)
+#define	MAX_DEFAULT_DIRHASH_MEM	(32 * 

CVS commit: src/common/lib/libc/arch/aarch64/atomic

2022-08-06 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Aug  6 21:31:33 UTC 2022

Modified Files:
src/common/lib/libc/arch/aarch64/atomic: Makefile.inc __aarch64_lse.S

Log Message:
aarch64: Implement __aarch64_casN_sync.

gcc generates calls to this symbol in programs that use
__sync_*_compare_and_swap, which require full sequential consistency
barriers, including store-before-load ordering on both sides of the
atomic; none of the release/acquire operations guarantee that, so we
have to insert explicit DMB instructions.

Note: gcc's own definition omits some of the DMB instructions, but I
can't prove that it's correct that way -- stores preceding the CAS
must complete before the load part of the CAS, and the store part of
the CAS must complete before loads following the CAS.  Maybe there's
some way to prove that one of these orderings is guaranteed some
other way than a DMB but I'm not seeing it, and store-before-load
ordering is hard to understand.

Patch by skrll@ based on a patch by mrg@, soliloquy in commit message
by me.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/common/lib/libc/arch/aarch64/atomic/Makefile.inc
cvs rdiff -u -r1.6 -r1.7 \
src/common/lib/libc/arch/aarch64/atomic/__aarch64_lse.S

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/common/lib/libc/arch/aarch64/atomic/Makefile.inc
diff -u src/common/lib/libc/arch/aarch64/atomic/Makefile.inc:1.4 src/common/lib/libc/arch/aarch64/atomic/Makefile.inc:1.5
--- src/common/lib/libc/arch/aarch64/atomic/Makefile.inc:1.4	Tue Apr 27 09:14:24 2021
+++ src/common/lib/libc/arch/aarch64/atomic/Makefile.inc	Sat Aug  6 21:31:33 2022
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.inc,v 1.4 2021/04/27 09:14:24 skrll Exp $
+# $NetBSD: Makefile.inc,v 1.5 2022/08/06 21:31:33 riastradh Exp $
 
 .if defined(LIB) && (${LIB} == "kern" || ${LIB} == "c" || ${LIB} == "pthread" \
 	|| ${LIB} == "rump")
@@ -14,7 +14,7 @@ SRCS.atomic+=	membar_ops.S
 #and cas nand or sub swap xor
 .for op in swp cas clr set eor add
 .for sz in 1 2 4 8
-.for ar in _relax _acq _rel _acq_rel
+.for ar in _relax _acq _rel _acq_rel _sync
 __aarch64_${op}${sz}${ar}.S: __aarch64_lse.S
 	${_MKTARGET_CREATE}
 	printf '#define OP ${op}\n#define OP_${op}\n#define SZ ${sz}\n#define AR ${ar}\n#define AR${ar}\n#include "__aarch64_lse.S"\n' > ${.TARGET}
@@ -23,7 +23,7 @@ SRCS.gen+=	__aarch64_${op}${sz}${ar}.S
 .endfor
 .endfor
 .for op in casp
-.for ar in _relax _acq _rel _acq_rel
+.for ar in _relax _acq _rel _acq_rel _sync
 __aarch64_${op}${ar}.S: __aarch64_lse.S
 	${_MKTARGET_CREATE}
 	printf '#define OP ${op}\n#define OP_${op}\n#define AR ${ar}\n#define AR${ar}\n#include "__aarch64_lse.S"\n' > ${.TARGET}

Index: src/common/lib/libc/arch/aarch64/atomic/__aarch64_lse.S
diff -u src/common/lib/libc/arch/aarch64/atomic/__aarch64_lse.S:1.6 src/common/lib/libc/arch/aarch64/atomic/__aarch64_lse.S:1.7
--- src/common/lib/libc/arch/aarch64/atomic/__aarch64_lse.S:1.6	Sat Jul 23 13:30:15 2022
+++ src/common/lib/libc/arch/aarch64/atomic/__aarch64_lse.S	Sat Aug  6 21:31:33 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: __aarch64_lse.S,v 1.6 2022/07/23 13:30:15 skrll Exp $ */
+/* $NetBSD: __aarch64_lse.S,v 1.7 2022/08/06 21:31:33 riastradh Exp $ */
 
 /*-
  * Copyright (c) 2021 The NetBSD Foundation, Inc.
@@ -64,21 +64,31 @@
 #if defined(AR_relax)
 #define ACQ
 #define REL
+#define DMB
 #endif
 
 #if defined(AR_acq)
 #define ACQ	a
 #define REL
+#define DMB
 #endif
 
 #if defined(AR_rel)
 #define ACQ
 #define REL	l
+#define DMB
 #endif
 
 #if defined(AR_acq_rel)
 #define ACQ	a
 #define REL	l
+#define DMB
+#endif
+
+#if defined(AR_sync)
+#define ACQ
+#define REL
+#define DMB	dmb ish
 #endif
 
 #if defined(OP_clr)
@@ -134,14 +144,18 @@
 ENTRY_NP(SWP_FUNC)
 #ifdef _HAVE_LSE
 	DO_LSE_INSN_IF_SUPPORTED(99f)
+	DMB
 	SWP	R0, R0, [x1]
+	DMB
 	ret
 99:
 #endif
 	mov	x4, x0			/* need x0 for return value	*/
+	DMB/* potential barrier		*/
 1:	LDXR	R0, [x1]		/* load old value		*/
 	STXR	w3, R4, [x1]		/* store new value		*/
 	cbnz	w3, 2f			/*   succeed?? no, try again	*/
+	DMB/* potential barrier		*/
 	ret/* return old value		*/
 2:	b	1b
 END(SWP_FUNC)
@@ -151,16 +165,20 @@ END(SWP_FUNC)
 ENTRY_NP(CAS_FUNC)
 #ifdef _HAVE_LSE
 	DO_LSE_INSN_IF_SUPPORTED(99f)
+	DMB
 	CAS	R0, R1, [x2]
+	DMB
 	ret
 99:
 #endif
 	mov	x4, x0			/* need x0 for return value	*/
+	DMB/* potential barrier		*/
 1:	LDXR	R0, [x2]		/* load old value		*/
 	cmp	R0, R4			/* compare			*/
 	b.ne	2f			/*   not equal? return		*/
 	STXR	w3, R1, [x2]		/* store new value		*/
 	cbnz	w3, 3f			/*   succeed? nope, try again.	*/
+	DMB/* potential barrier		*/
 2:	ret/* return.			*/
 3:	b	1b
 END(CAS_FUNC)
@@ -170,12 +188,15 @@ END(CAS_FUNC)
 ENTRY_NP(CASP_FUNC)
 #ifdef _HAVE_LSE
 	DO_LSE_INSN_IF_SUPPORTED(99f)
+	DMB
 	CASP	x0, x1, x2, x3, [x4]
+	DMB
 	ret
 99:
 #endif
 	mov	x5, x0			/* need x0 for return value	*/
 	mov	x6, x1			/* need x1 for return 

CVS commit: src/common/lib/libc/arch/aarch64/atomic

2022-08-06 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Aug  6 21:31:33 UTC 2022

Modified Files:
src/common/lib/libc/arch/aarch64/atomic: Makefile.inc __aarch64_lse.S

Log Message:
aarch64: Implement __aarch64_casN_sync.

gcc generates calls to this symbol in programs that use
__sync_*_compare_and_swap, which require full sequential consistency
barriers, including store-before-load ordering on both sides of the
atomic; none of the release/acquire operations guarantee that, so we
have to insert explicit DMB instructions.

Note: gcc's own definition omits some of the DMB instructions, but I
can't prove that it's correct that way -- stores preceding the CAS
must complete before the load part of the CAS, and the store part of
the CAS must complete before loads following the CAS.  Maybe there's
some way to prove that one of these orderings is guaranteed some
other way than a DMB but I'm not seeing it, and store-before-load
ordering is hard to understand.

Patch by skrll@ based on a patch by mrg@, soliloquy in commit message
by me.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/common/lib/libc/arch/aarch64/atomic/Makefile.inc
cvs rdiff -u -r1.6 -r1.7 \
src/common/lib/libc/arch/aarch64/atomic/__aarch64_lse.S

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.bin/make/unit-tests

2022-08-06 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Aug  6 21:26:06 UTC 2022

Modified Files:
src/usr.bin/make/unit-tests: parse-var.exp parse-var.mk
varmod-undefined.mk

Log Message:
tests/make: demonstrate bug in parsing of modifier parts

In the modifier ':S,from,to,', parsing the two parts 'from' and 'to' of
the modifier differs depending on whether the expression is actually
evaluated or merely parsed.  This not only applies to the ':S' modifier,
but also to ':C', ':@var@body@', ':!cmd!', ':[...]', ':?:', '::=' and
':from=to'.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/usr.bin/make/unit-tests/parse-var.exp \
src/usr.bin/make/unit-tests/parse-var.mk
cvs rdiff -u -r1.7 -r1.8 src/usr.bin/make/unit-tests/varmod-undefined.mk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/make/unit-tests/parse-var.exp
diff -u src/usr.bin/make/unit-tests/parse-var.exp:1.1 src/usr.bin/make/unit-tests/parse-var.exp:1.2
--- src/usr.bin/make/unit-tests/parse-var.exp:1.1	Sun Oct  4 06:53:15 2020
+++ src/usr.bin/make/unit-tests/parse-var.exp	Sat Aug  6 21:26:05 2022
@@ -1 +1,5 @@
-exit status 0
+make: Unfinished modifier for "BRACE_GROUP" (',' missing)
+make: "parse-var.mk" line 47: Malformed conditional (0 && ${BRACE_GROUP:S,${BRACE_PAIR:S,{,{{,},,})
+make: Fatal errors encountered -- cannot continue
+make: stopped in unit-tests
+exit status 1
Index: src/usr.bin/make/unit-tests/parse-var.mk
diff -u src/usr.bin/make/unit-tests/parse-var.mk:1.1 src/usr.bin/make/unit-tests/parse-var.mk:1.2
--- src/usr.bin/make/unit-tests/parse-var.mk:1.1	Sun Oct  4 06:53:15 2020
+++ src/usr.bin/make/unit-tests/parse-var.mk	Sat Aug  6 21:26:05 2022
@@ -1,13 +1,52 @@
-# $NetBSD: parse-var.mk,v 1.1 2020/10/04 06:53:15 rillig Exp $
+# $NetBSD: parse-var.mk,v 1.2 2022/08/06 21:26:05 rillig Exp $
+#
+# Tests for parsing variable expressions.
 
 .MAKEFLAGS: -dL
 
-# In variable assignments, there may be spaces on the left-hand side of the
-# assignment, but only if they occur inside variable expressions.
+# In variable assignments, there may be spaces in the middle of the left-hand
+# side of the assignment, but only if they occur inside variable expressions.
+# Leading spaces (but not tabs) are possible but unusual.
+# Trailing spaces are common in some coding styles, others omit them.
 VAR.${:U param }=	value
 .if ${VAR.${:U param }} != "value"
 .  error
 .endif
 
-all:
-	@:;
+
+# As of var.c 1.1027 from 2022-08-05, the exact way of parsing an expression
+# depends on whether the expression is actually evaluated or merely parsed.
+#
+# If it is evaluated, nested expressions are parsed correctly, parsing each
+# modifier according to its exact definition.  If the expression is merely
+# parsed but not evaluated (because its value would not influence the outcome
+# of the condition), and the expression contains a modifier, and that modifier
+# contains a nested expression, the nested expression is not parsed
+# correctly.  Instead, make only counts the opening and closing delimiters,
+# which fails for nested modifiers with unbalanced braces.
+#
+# See ParseModifierPartDollar.
+
+#.MAKEFLAGS: -dcpv
+# Keep these braces outside the conditions below, to keep them simple to
+# understand.  If the BRACE_PAIR had been replaced with ':U{}', the '}' would
+# have to be escaped, but not the '{'.  This asymmetry would have made the
+# example even more complicated to understand.
+BRACE_PAIR=	{}
+# In this test word, the '{{}' in the middle will be replaced.
+BRACE_GROUP=	
+
+# The inner ':S' modifier turns the word '{}' into '{{}'.
+# The outer ':S' modifier then replaces '{{}' with ''.
+# In the first case, the outer expression is relevant and is parsed correctly.
+.if 1 && ${BRACE_GROUP:S,${BRACE_PAIR:S,{,{{,},,}
+.endif
+# In the second case, the outer expression is irrelevant.  In this case, in
+# the parts of the outer ':S' modifier, make only counts the braces, and since
+# the inner expression '${:U...}' contains more '{' than '}', parsing fails.
+.if 0 && ${BRACE_GROUP:S,${BRACE_PAIR:S,{,{{,},,}
+.endif
+#.MAKEFLAGS: -d0
+
+
+all: .PHONY

Index: src/usr.bin/make/unit-tests/varmod-undefined.mk
diff -u src/usr.bin/make/unit-tests/varmod-undefined.mk:1.7 src/usr.bin/make/unit-tests/varmod-undefined.mk:1.8
--- src/usr.bin/make/unit-tests/varmod-undefined.mk:1.7	Sun Nov 15 20:20:58 2020
+++ src/usr.bin/make/unit-tests/varmod-undefined.mk	Sat Aug  6 21:26:05 2022
@@ -1,4 +1,4 @@
-# $NetBSD: varmod-undefined.mk,v 1.7 2020/11/15 20:20:58 rillig Exp $
+# $NetBSD: varmod-undefined.mk,v 1.8 2022/08/06 21:26:05 rillig Exp $
 #
 # Tests for the :U variable modifier, which returns the given string
 # if the variable is undefined.
@@ -29,7 +29,7 @@
 # The nested variable expressions may contain braces, and these braces don't
 # need to match pairwise.  In the following example, the :S modifier uses '{'
 # 

CVS commit: src/usr.bin/make/unit-tests

2022-08-06 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Aug  6 21:26:06 UTC 2022

Modified Files:
src/usr.bin/make/unit-tests: parse-var.exp parse-var.mk
varmod-undefined.mk

Log Message:
tests/make: demonstrate bug in parsing of modifier parts

In the modifier ':S,from,to,', parsing the two parts 'from' and 'to' of
the modifier differs depending on whether the expression is actually
evaluated or merely parsed.  This not only applies to the ':S' modifier,
but also to ':C', ':@var@body@', ':!cmd!', ':[...]', ':?:', '::=' and
':from=to'.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/usr.bin/make/unit-tests/parse-var.exp \
src/usr.bin/make/unit-tests/parse-var.mk
cvs rdiff -u -r1.7 -r1.8 src/usr.bin/make/unit-tests/varmod-undefined.mk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/kern

2022-08-06 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Aug  6 21:21:10 UTC 2022

Modified Files:
src/sys/kern: vfs_vnops.c

Log Message:
vnodeops(9): Take exclusive lock in read/seek for f_offset update.

Otherwise concurrent readers/seekers might clobber it.


To generate a diff of this commit:
cvs rdiff -u -r1.234 -r1.235 src/sys/kern/vfs_vnops.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/kern/vfs_vnops.c
diff -u src/sys/kern/vfs_vnops.c:1.234 src/sys/kern/vfs_vnops.c:1.235
--- src/sys/kern/vfs_vnops.c:1.234	Mon Jul 18 04:30:30 2022
+++ src/sys/kern/vfs_vnops.c	Sat Aug  6 21:21:10 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_vnops.c,v 1.234 2022/07/18 04:30:30 thorpej Exp $	*/
+/*	$NetBSD: vfs_vnops.c,v 1.235 2022/08/06 21:21:10 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -66,7 +66,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vfs_vnops.c,v 1.234 2022/07/18 04:30:30 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_vnops.c,v 1.235 2022/08/06 21:21:10 riastradh Exp $");
 
 #include "veriexec.h"
 
@@ -647,7 +647,10 @@ vn_read(file_t *fp, off_t *offset, struc
 		ioflag |= IO_ALTSEMANTICS;
 	if (fflag & FDIRECT)
 		ioflag |= IO_DIRECT;
-	vn_lock(vp, LK_SHARED | LK_RETRY);
+	if (offset == >f_offset && (flags & FOF_UPDATE_OFFSET) != 0)
+		vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
+	else
+		vn_lock(vp, LK_SHARED | LK_RETRY);
 	uio->uio_offset = *offset;
 	count = uio->uio_resid;
 	error = VOP_READ(vp, uio, ioflag, cred);
@@ -1135,7 +1138,10 @@ vn_seek(struct file *fp, off_t delta, in
 	if (vp->v_type == VFIFO)
 		return ESPIPE;
 
-	vn_lock(vp, LK_SHARED | LK_RETRY);
+	if (flags & FOF_UPDATE_OFFSET)
+		vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
+	else
+		vn_lock(vp, LK_SHARED | LK_RETRY);
 
 	/* Compute the old and new offsets.  */
 	oldoff = fp->f_offset;



CVS commit: src/sys/kern

2022-08-06 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Aug  6 21:21:10 UTC 2022

Modified Files:
src/sys/kern: vfs_vnops.c

Log Message:
vnodeops(9): Take exclusive lock in read/seek for f_offset update.

Otherwise concurrent readers/seekers might clobber it.


To generate a diff of this commit:
cvs rdiff -u -r1.234 -r1.235 src/sys/kern/vfs_vnops.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/fdt

2022-08-06 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Sat Aug  6 20:16:43 UTC 2022

Modified Files:
src/sys/dev/fdt: fdt_memory.c

Log Message:
In my previous change, it was necessary to consider the case where the first 
block size is zero.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/dev/fdt/fdt_memory.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/fdt_memory.c
diff -u src/sys/dev/fdt/fdt_memory.c:1.5 src/sys/dev/fdt/fdt_memory.c:1.6
--- src/sys/dev/fdt/fdt_memory.c:1.5	Thu Aug  4 11:58:55 2022
+++ src/sys/dev/fdt/fdt_memory.c	Sat Aug  6 20:16:42 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: fdt_memory.c,v 1.5 2022/08/04 11:58:55 ryo Exp $ */
+/* $NetBSD: fdt_memory.c,v 1.6 2022/08/06 20:16:42 ryo Exp $ */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
 #include "opt_fdt.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: fdt_memory.c,v 1.5 2022/08/04 11:58:55 ryo Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fdt_memory.c,v 1.6 2022/08/06 20:16:42 ryo Exp $");
 
 #include 
 #include 
@@ -83,16 +83,16 @@ fdt_memory_get(uint64_t *pstart, uint64_
 {
 	const int memory = OF_finddevice("/memory");
 	uint64_t cur_addr, cur_size;
-	int index;
+	int index, nadd;
 
-	for (index = 0;
+	for (index = 0, nadd = 0;
 	 fdtbus_get_reg64(memory, index, _addr, _size) == 0;
 	 index++) {
 		if (cur_size == 0)
 			continue;
 		fdt_memory_add_range(cur_addr, cur_size);
 
-		if (index == 0) {
+		if (nadd++ == 0) {
 			*pstart = cur_addr;
 			*pend = cur_addr + cur_size;
 			continue;
@@ -102,7 +102,7 @@ fdt_memory_get(uint64_t *pstart, uint64_
 		if (cur_addr + cur_size > *pend)
 			*pend = cur_addr + cur_size;
 	}
-	if (index == 0)
+	if (nadd == 0)
 		panic("Cannot determine memory size");
 }
 



CVS commit: src/sys/dev/fdt

2022-08-06 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Sat Aug  6 20:16:43 UTC 2022

Modified Files:
src/sys/dev/fdt: fdt_memory.c

Log Message:
In my previous change, it was necessary to consider the case where the first 
block size is zero.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/dev/fdt/fdt_memory.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src

2022-08-06 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Sat Aug  6 18:26:43 UTC 2022

Modified Files:
src/sys/fs/adosfs: adlookup.c
src/sys/fs/cd9660: cd9660_lookup.c
src/sys/fs/efs: efs_vnops.c
src/sys/fs/filecorefs: filecore_lookup.c
src/sys/fs/hfs: hfs_vnops.c
src/sys/fs/msdosfs: msdosfs_lookup.c
src/sys/netinet: sctp_usrreq.c
src/sys/ufs/ext2fs: ext2fs_lookup.c
src/sys/ufs/lfs: ulfs_lookup.c
src/sys/ufs/ufs: ufs_lookup.c
src/tests/dev/audio: audiotest.c
src/usr.bin/ftp: util.c
src/usr.bin/mail: complete.c
src/usr.sbin/cpuctl/arch: arm.c

Log Message:
s/blity/bility/ in various words, mainly in comments.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/fs/adosfs/adlookup.c
cvs rdiff -u -r1.31 -r1.32 src/sys/fs/cd9660/cd9660_lookup.c
cvs rdiff -u -r1.43 -r1.44 src/sys/fs/efs/efs_vnops.c
cvs rdiff -u -r1.21 -r1.22 src/sys/fs/filecorefs/filecore_lookup.c
cvs rdiff -u -r1.39 -r1.40 src/sys/fs/hfs/hfs_vnops.c
cvs rdiff -u -r1.40 -r1.41 src/sys/fs/msdosfs/msdosfs_lookup.c
cvs rdiff -u -r1.21 -r1.22 src/sys/netinet/sctp_usrreq.c
cvs rdiff -u -r1.91 -r1.92 src/sys/ufs/ext2fs/ext2fs_lookup.c
cvs rdiff -u -r1.46 -r1.47 src/sys/ufs/lfs/ulfs_lookup.c
cvs rdiff -u -r1.155 -r1.156 src/sys/ufs/ufs/ufs_lookup.c
cvs rdiff -u -r1.22 -r1.23 src/tests/dev/audio/audiotest.c
cvs rdiff -u -r1.163 -r1.164 src/usr.bin/ftp/util.c
cvs rdiff -u -r1.24 -r1.25 src/usr.bin/mail/complete.c
cvs rdiff -u -r1.5 -r1.6 src/usr.sbin/cpuctl/arch/arm.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/fs/adosfs/adlookup.c
diff -u src/sys/fs/adosfs/adlookup.c:1.21 src/sys/fs/adosfs/adlookup.c:1.22
--- src/sys/fs/adosfs/adlookup.c:1.21	Fri Jan 17 20:08:07 2020
+++ src/sys/fs/adosfs/adlookup.c	Sat Aug  6 18:26:41 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: adlookup.c,v 1.21 2020/01/17 20:08:07 ad Exp $	*/
+/*	$NetBSD: adlookup.c,v 1.22 2022/08/06 18:26:41 andvar Exp $	*/
 
 /*
  * Copyright (c) 1994 Christian E. Hopps
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: adlookup.c,v 1.21 2020/01/17 20:08:07 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: adlookup.c,v 1.22 2022/08/06 18:26:41 andvar Exp $");
 
 #include 
 #include 
@@ -96,7 +96,7 @@ adosfs_lookup(void *v)
 	nocache = 0;
 
 	/*
-	 * Check accessiblity of directory.
+	 * Check accessibility of directory.
 	 */
 	if ((error = VOP_ACCESS(vdp, VEXEC, ucp)) != 0)
 		return (error);

Index: src/sys/fs/cd9660/cd9660_lookup.c
diff -u src/sys/fs/cd9660/cd9660_lookup.c:1.31 src/sys/fs/cd9660/cd9660_lookup.c:1.32
--- src/sys/fs/cd9660/cd9660_lookup.c:1.31	Sat Apr  4 20:49:30 2020
+++ src/sys/fs/cd9660/cd9660_lookup.c	Sat Aug  6 18:26:41 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: cd9660_lookup.c,v 1.31 2020/04/04 20:49:30 ad Exp $	*/
+/*	$NetBSD: cd9660_lookup.c,v 1.32 2022/08/06 18:26:41 andvar Exp $	*/
 
 /*-
  * Copyright (c) 1989, 1993, 1994
@@ -39,7 +39,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cd9660_lookup.c,v 1.31 2020/04/04 20:49:30 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cd9660_lookup.c,v 1.32 2022/08/06 18:26:41 andvar Exp $");
 
 #include 
 #include 
@@ -132,7 +132,7 @@ cd9660_lookup(void *v)
 	imp = dp->i_mnt;
 
 	/*
-	 * Check accessiblity of directory.
+	 * Check accessibility of directory.
 	 */
 	if ((error = VOP_ACCESS(vdp, VEXEC, cred)) != 0)
 		return (error);

Index: src/sys/fs/efs/efs_vnops.c
diff -u src/sys/fs/efs/efs_vnops.c:1.43 src/sys/fs/efs/efs_vnops.c:1.44
--- src/sys/fs/efs/efs_vnops.c:1.43	Sun Jul 18 23:56:13 2021
+++ src/sys/fs/efs/efs_vnops.c	Sat Aug  6 18:26:41 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: efs_vnops.c,v 1.43 2021/07/18 23:56:13 dholland Exp $	*/
+/*	$NetBSD: efs_vnops.c,v 1.44 2022/08/06 18:26:41 andvar Exp $	*/
 
 /*
  * Copyright (c) 2006 Stephen M. Rumble 
@@ -17,7 +17,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: efs_vnops.c,v 1.43 2021/07/18 23:56:13 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: efs_vnops.c,v 1.44 2022/08/06 18:26:41 andvar Exp $");
 
 #include 
 #include 
@@ -125,7 +125,7 @@ efs_check_possible(struct vnode *vp, str
 }
 
 /*
- * Determine the accessiblity of a file based on the permissions allowed by the
+ * Determine the accessibility of a file based on the permissions allowed by the
  * specified credentials.
  *
  * Returns 0 on success.

Index: src/sys/fs/filecorefs/filecore_lookup.c
diff -u src/sys/fs/filecorefs/filecore_lookup.c:1.21 src/sys/fs/filecorefs/filecore_lookup.c:1.22
--- src/sys/fs/filecorefs/filecore_lookup.c:1.21	Sat Oct  4 13:27:24 2014
+++ src/sys/fs/filecorefs/filecore_lookup.c	Sat Aug  6 18:26:42 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: filecore_lookup.c,v 1.21 2014/10/04 13:27:24 hannken Exp $	*/
+/*	$NetBSD: filecore_lookup.c,v 1.22 2022/08/06 18:26:42 andvar Exp $	*/
 
 /*-
  * Copyright (c) 1989, 1993, 1994 The Regents of the University of California.
@@ -66,7 +66,7 @@
  */
 
 

CVS commit: src

2022-08-06 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Sat Aug  6 18:26:43 UTC 2022

Modified Files:
src/sys/fs/adosfs: adlookup.c
src/sys/fs/cd9660: cd9660_lookup.c
src/sys/fs/efs: efs_vnops.c
src/sys/fs/filecorefs: filecore_lookup.c
src/sys/fs/hfs: hfs_vnops.c
src/sys/fs/msdosfs: msdosfs_lookup.c
src/sys/netinet: sctp_usrreq.c
src/sys/ufs/ext2fs: ext2fs_lookup.c
src/sys/ufs/lfs: ulfs_lookup.c
src/sys/ufs/ufs: ufs_lookup.c
src/tests/dev/audio: audiotest.c
src/usr.bin/ftp: util.c
src/usr.bin/mail: complete.c
src/usr.sbin/cpuctl/arch: arm.c

Log Message:
s/blity/bility/ in various words, mainly in comments.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/fs/adosfs/adlookup.c
cvs rdiff -u -r1.31 -r1.32 src/sys/fs/cd9660/cd9660_lookup.c
cvs rdiff -u -r1.43 -r1.44 src/sys/fs/efs/efs_vnops.c
cvs rdiff -u -r1.21 -r1.22 src/sys/fs/filecorefs/filecore_lookup.c
cvs rdiff -u -r1.39 -r1.40 src/sys/fs/hfs/hfs_vnops.c
cvs rdiff -u -r1.40 -r1.41 src/sys/fs/msdosfs/msdosfs_lookup.c
cvs rdiff -u -r1.21 -r1.22 src/sys/netinet/sctp_usrreq.c
cvs rdiff -u -r1.91 -r1.92 src/sys/ufs/ext2fs/ext2fs_lookup.c
cvs rdiff -u -r1.46 -r1.47 src/sys/ufs/lfs/ulfs_lookup.c
cvs rdiff -u -r1.155 -r1.156 src/sys/ufs/ufs/ufs_lookup.c
cvs rdiff -u -r1.22 -r1.23 src/tests/dev/audio/audiotest.c
cvs rdiff -u -r1.163 -r1.164 src/usr.bin/ftp/util.c
cvs rdiff -u -r1.24 -r1.25 src/usr.bin/mail/complete.c
cvs rdiff -u -r1.5 -r1.6 src/usr.sbin/cpuctl/arch/arm.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/ic

2022-08-06 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Aug  6 17:53:49 UTC 2022

Modified Files:
src/sys/dev/ic: dwc_eqos.c

Log Message:
PR 56948: fix multicast hash filter setup


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/dev/ic/dwc_eqos.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/ic/dwc_eqos.c
diff -u src/sys/dev/ic/dwc_eqos.c:1.8 src/sys/dev/ic/dwc_eqos.c:1.9
--- src/sys/dev/ic/dwc_eqos.c:1.8	Thu Jul 21 18:12:24 2022
+++ src/sys/dev/ic/dwc_eqos.c	Sat Aug  6 17:53:49 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: dwc_eqos.c,v 1.8 2022/07/21 18:12:24 martin Exp $ */
+/* $NetBSD: dwc_eqos.c,v 1.9 2022/08/06 17:53:49 martin Exp $ */
 
 /*-
  * Copyright (c) 2022 Jared McNeill 
@@ -33,7 +33,7 @@
 #include "opt_net_mpsafe.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: dwc_eqos.c,v 1.8 2022/07/21 18:12:24 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dwc_eqos.c,v 1.9 2022/08/06 17:53:49 martin Exp $");
 
 #include 
 #include 
@@ -493,8 +493,8 @@ eqos_setup_rxfilter(struct eqos_softc *s
 	WR4(sc, GMAC_MAC_ADDRESS0_LOW, val);
 
 	/* Multicast hash filters */
-	WR4(sc, GMAC_MAC_HASH_TABLE_REG0, hash[1]);
-	WR4(sc, GMAC_MAC_HASH_TABLE_REG1, hash[0]);
+	WR4(sc, GMAC_MAC_HASH_TABLE_REG0, hash[0]);
+	WR4(sc, GMAC_MAC_HASH_TABLE_REG1, hash[1]);
 
 	DPRINTF(EDEB_NOTE, "writing new packet filter config "
 	"%08x, hash[1]=%08x, hash[0]=%08x\n", pfil, hash[1], hash[0]);



CVS commit: src/sys/dev/ic

2022-08-06 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Aug  6 17:53:49 UTC 2022

Modified Files:
src/sys/dev/ic: dwc_eqos.c

Log Message:
PR 56948: fix multicast hash filter setup


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/dev/ic/dwc_eqos.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/pci

2022-08-06 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Aug  6 15:38:42 UTC 2022

Modified Files:
src/sys/dev/pci: if_sip.c

Log Message:
sip(4): Tidy up DMA syncs.

- No membar_producer in sip_init_rxdesc -- use bus_dmamap_sync with
  BUS_DMASYNC_PREWRITE to order updates to the DMA descriptors.

- Omit needless membar_producer in sip_init_txdesc -- the hardware
  will not look at any of these descriptors until we set CMDSTS_OWN
  on the first one in the sequence, which is done later in the
  caller, sipcom_start.

- In gsip_rxintr, make sure to read cmdsts _before_ extsts, by
  separating them with BUS_DMASYNC_PREREAD.  Otherwise, the CPU might
  reorder the loads and read a stale extsts first before witnessing
  an updated cmdsts with the CMDSTS_OWN bit that transfers ownership
  of the rx packet to us.


To generate a diff of this commit:
cvs rdiff -u -r1.186 -r1.187 src/sys/dev/pci/if_sip.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/if_sip.c
diff -u src/sys/dev/pci/if_sip.c:1.186 src/sys/dev/pci/if_sip.c:1.187
--- src/sys/dev/pci/if_sip.c:1.186	Tue May 24 20:50:19 2022
+++ src/sys/dev/pci/if_sip.c	Sat Aug  6 15:38:42 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_sip.c,v 1.186 2022/05/24 20:50:19 andvar Exp $	*/
+/*	$NetBSD: if_sip.c,v 1.187 2022/08/06 15:38:42 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
@@ -73,7 +73,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_sip.c,v 1.186 2022/05/24 20:50:19 andvar Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_sip.c,v 1.187 2022/08/06 15:38:42 riastradh Exp $");
 
 #include 
 #include 
@@ -569,7 +569,6 @@ sip_init_txdesc(struct sip_softc *sc, in
 		sipd->sipd_words[sc->sc_bufptr_idx] = htole32(bufptr);
 	}
 	sipd->sipd_words[sc->sc_extsts_idx] = 0;
-	membar_producer();
 	sipd->sipd_words[sc->sc_cmdsts_idx] = htole32(cmdsts);
 	/* sip_cdtxsync() will be done later. */
 }
@@ -596,7 +595,7 @@ sip_init_rxdesc(struct sip_softc *sc, in
 		htole32(rxs->rxs_dmamap->dm_segs[0].ds_addr);
 	}
 	sipd->sipd_words[sc->sc_extsts_idx] = 0;
-	membar_producer();
+	sip_cdrxsync(sc, x, BUS_DMASYNC_PREWRITE);
 	sipd->sipd_words[sc->sc_cmdsts_idx] =
 	htole32(CMDSTS_INTR | (sc->sc_parm->p_rxbuf_len &
 				   sc->sc_bits.b_cmdsts_size_mask));
@@ -2126,9 +2125,6 @@ gsip_rxintr(struct sip_softc *sc)
 
 		cmdsts =
 		le32toh(sc->sc_rxdescs[i].sipd_words[sc->sc_cmdsts_idx]);
-		extsts =
-		le32toh(sc->sc_rxdescs[i].sipd_words[sc->sc_extsts_idx]);
-		len = CMDSTS_SIZE(sc, cmdsts);
 
 		/*
 		 * NOTE: OWN is set if owned by _consumer_.  We're the
@@ -2142,6 +2138,12 @@ gsip_rxintr(struct sip_softc *sc)
 			break;
 		}
 
+		sip_cdrxsync(sc, i, BUS_DMASYNC_POSTREAD);
+
+		extsts =
+		le32toh(sc->sc_rxdescs[i].sipd_words[sc->sc_extsts_idx]);
+		len = CMDSTS_SIZE(sc, cmdsts);
+
 		if (__predict_false(sc->sc_rxdiscard)) {
 			sip_init_rxdesc(sc, i);
 			if ((cmdsts & CMDSTS_MORE) == 0) {



CVS commit: src/sys/dev/pci

2022-08-06 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Aug  6 15:38:42 UTC 2022

Modified Files:
src/sys/dev/pci: if_sip.c

Log Message:
sip(4): Tidy up DMA syncs.

- No membar_producer in sip_init_rxdesc -- use bus_dmamap_sync with
  BUS_DMASYNC_PREWRITE to order updates to the DMA descriptors.

- Omit needless membar_producer in sip_init_txdesc -- the hardware
  will not look at any of these descriptors until we set CMDSTS_OWN
  on the first one in the sequence, which is done later in the
  caller, sipcom_start.

- In gsip_rxintr, make sure to read cmdsts _before_ extsts, by
  separating them with BUS_DMASYNC_PREREAD.  Otherwise, the CPU might
  reorder the loads and read a stale extsts first before witnessing
  an updated cmdsts with the CMDSTS_OWN bit that transfers ownership
  of the rx packet to us.


To generate a diff of this commit:
cvs rdiff -u -r1.186 -r1.187 src/sys/dev/pci/if_sip.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sbin/dmesg

2022-08-06 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Aug  6 10:22:22 UTC 2022

Modified Files:
src/sbin/dmesg: dmesg.c

Log Message:
Assert postts only if we really obtained a timestamp.


To generate a diff of this commit:
cvs rdiff -u -r1.50 -r1.51 src/sbin/dmesg/dmesg.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sbin/dmesg

2022-08-06 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Aug  6 10:22:22 UTC 2022

Modified Files:
src/sbin/dmesg: dmesg.c

Log Message:
Assert postts only if we really obtained a timestamp.


To generate a diff of this commit:
cvs rdiff -u -r1.50 -r1.51 src/sbin/dmesg/dmesg.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/dmesg/dmesg.c
diff -u src/sbin/dmesg/dmesg.c:1.50 src/sbin/dmesg/dmesg.c:1.51
--- src/sbin/dmesg/dmesg.c:1.50	Sat Aug  6 10:19:44 2022
+++ src/sbin/dmesg/dmesg.c	Sat Aug  6 10:22:22 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: dmesg.c,v 1.50 2022/08/06 10:19:44 rin Exp $	*/
+/*	$NetBSD: dmesg.c,v 1.51 2022/08/06 10:22:22 rin Exp $	*/
 /*-
  * Copyright (c) 1991, 1993
  *	The Regents of the University of California.  All rights reserved.
@@ -38,7 +38,7 @@ __COPYRIGHT("@(#) Copyright (c) 1991, 19
 #if 0
 static char sccsid[] = "@(#)dmesg.c	8.1 (Berkeley) 6/5/93";
 #else
-__RCSID("$NetBSD: dmesg.c,v 1.50 2022/08/06 10:19:44 rin Exp $");
+__RCSID("$NetBSD: dmesg.c,v 1.51 2022/08/06 10:22:22 rin Exp $");
 #endif
 #endif /* not lint */
 
@@ -327,7 +327,6 @@ main(int argc, char *argv[])
 ADDC(ch);
 ADDC('\0');
 tstamp = 0;
-postts = true;
 sec = fsec = 0;
 switch (sscanf(tbuf, "[%jd.%ld]", , )){
 case 0:
@@ -344,6 +343,7 @@ main(int argc, char *argv[])
 	/* Help */
 	continue;
 }
+postts = true;
 
 for (nsec = fsec, j = 9 - scale; --j >= 0; )
 	nsec *= 10;



CVS commit: src/sbin/dmesg

2022-08-06 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Aug  6 10:19:44 UTC 2022

Modified Files:
src/sbin/dmesg: dmesg.c

Log Message:
Do not declare unused tstamp for SMALL. NFC.


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/sbin/dmesg/dmesg.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/dmesg/dmesg.c
diff -u src/sbin/dmesg/dmesg.c:1.49 src/sbin/dmesg/dmesg.c:1.50
--- src/sbin/dmesg/dmesg.c:1.49	Sat Aug  6 10:16:18 2022
+++ src/sbin/dmesg/dmesg.c	Sat Aug  6 10:19:44 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: dmesg.c,v 1.49 2022/08/06 10:16:18 rin Exp $	*/
+/*	$NetBSD: dmesg.c,v 1.50 2022/08/06 10:19:44 rin Exp $	*/
 /*-
  * Copyright (c) 1991, 1993
  *	The Regents of the University of California.  All rights reserved.
@@ -38,7 +38,7 @@ __COPYRIGHT("@(#) Copyright (c) 1991, 19
 #if 0
 static char sccsid[] = "@(#)dmesg.c	8.1 (Berkeley) 6/5/93";
 #else
-__RCSID("$NetBSD: dmesg.c,v 1.49 2022/08/06 10:16:18 rin Exp $");
+__RCSID("$NetBSD: dmesg.c,v 1.50 2022/08/06 10:19:44 rin Exp $");
 #endif
 #endif /* not lint */
 
@@ -145,10 +145,11 @@ main(int argc, char *argv[])
 {
 	struct kern_msgbuf cur;
 	int ch, newl, log, i;
-	size_t tstamp, size;
+	size_t size;
 	char *p, *bufdata;
 	char buf[5];
 #ifndef SMALL
+	size_t tstamp;
 	char tbuf[64];
 	char *memf, *nlistf;
 	struct timespec boottime;
@@ -263,9 +264,10 @@ main(int argc, char *argv[])
 #ifndef SMALL
 	frac = false;
 	postts = false;
+	tstamp = 0;
 	scale = 0;
 #endif
-	for (tstamp = 0, newl = 1, log = i = 0, p = bufdata + cur.msg_bufx;
+	for (newl = 1, log = i = 0, p = bufdata + cur.msg_bufx;
 	i < cur.msg_bufs; i++, p++) {
 
 #ifndef SMALL
@@ -395,11 +397,9 @@ main(int argc, char *argv[])
 #ifndef SMALL
 if (!tstamp && postts) {
 	postts = false;
-#else
-if (!tstamp) {
-#endif
 	continue;
 }
+#endif
 /*FALLTHROUGH*/
 			default:
 #ifndef SMALL



CVS commit: src/sbin/dmesg

2022-08-06 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Aug  6 10:19:44 UTC 2022

Modified Files:
src/sbin/dmesg: dmesg.c

Log Message:
Do not declare unused tstamp for SMALL. NFC.


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/sbin/dmesg/dmesg.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sbin/dmesg

2022-08-06 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Aug  6 10:16:18 UTC 2022

Modified Files:
src/sbin/dmesg: dmesg.c

Log Message:
Get back to the statically-allocated tbuf.

If a string is longer than tbuf, it cannot be a timestamp.
Therefore, no need for buffering anymore in this case.


To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 src/sbin/dmesg/dmesg.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sbin/dmesg

2022-08-06 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Aug  6 10:16:18 UTC 2022

Modified Files:
src/sbin/dmesg: dmesg.c

Log Message:
Get back to the statically-allocated tbuf.

If a string is longer than tbuf, it cannot be a timestamp.
Therefore, no need for buffering anymore in this case.


To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 src/sbin/dmesg/dmesg.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/dmesg/dmesg.c
diff -u src/sbin/dmesg/dmesg.c:1.48 src/sbin/dmesg/dmesg.c:1.49
--- src/sbin/dmesg/dmesg.c:1.48	Sat Aug  6 09:42:33 2022
+++ src/sbin/dmesg/dmesg.c	Sat Aug  6 10:16:18 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: dmesg.c,v 1.48 2022/08/06 09:42:33 rin Exp $	*/
+/*	$NetBSD: dmesg.c,v 1.49 2022/08/06 10:16:18 rin Exp $	*/
 /*-
  * Copyright (c) 1991, 1993
  *	The Regents of the University of California.  All rights reserved.
@@ -38,7 +38,7 @@ __COPYRIGHT("@(#) Copyright (c) 1991, 19
 #if 0
 static char sccsid[] = "@(#)dmesg.c	8.1 (Berkeley) 6/5/93";
 #else
-__RCSID("$NetBSD: dmesg.c,v 1.48 2022/08/06 09:42:33 rin Exp $");
+__RCSID("$NetBSD: dmesg.c,v 1.49 2022/08/06 10:16:18 rin Exp $");
 #endif
 #endif /* not lint */
 
@@ -149,8 +149,7 @@ main(int argc, char *argv[])
 	char *p, *bufdata;
 	char buf[5];
 #ifndef SMALL
-	size_t tbuflen;
-	char *tbuf;
+	char tbuf[64];
 	char *memf, *nlistf;
 	struct timespec boottime;
 	struct timespec lasttime;
@@ -265,11 +264,6 @@ main(int argc, char *argv[])
 	frac = false;
 	postts = false;
 	scale = 0;
-
-	tbuflen = 64;
-	tbuf = malloc(tbuflen);
-	if (tbuf == NULL)
-		err(1, "malloc");
 #endif
 	for (tstamp = 0, newl = 1, log = i = 0, p = bufdata + cur.msg_bufx;
 	i < cur.msg_bufs; i++, p++) {
@@ -279,11 +273,14 @@ main(int argc, char *argv[])
 			p = bufdata;
 #define ADDC(c)\
 do {\
-	if (tstamp >= tbuflen - 1 &&	\
-	reallocarr(, tbuflen * 2, 1) == 0)			\
-		tbuflen *= 2;		\
-	if (tstamp < tbuflen - 1)	\
+	if (tstamp < sizeof(tbuf) - 1)	\
 		tbuf[tstamp++] = (c);	\
+	else {\
+		/* Cannot be a timestamp. */\
+		tstamp = 0;		\
+		tbuf[sizeof(tbuf) - 1] = '\0';\
+		goto not_tstamp;	\
+	}\
 	if (frac)			\
 		scale++;		\
 } while (0)
@@ -322,6 +319,8 @@ main(int argc, char *argv[])
 continue;
 #ifndef SMALL
 			case ']':
+if (tstamp == 0)
+	goto prchar;
 frac = false;
 ADDC(ch);
 ADDC('\0');
@@ -330,7 +329,7 @@ main(int argc, char *argv[])
 sec = fsec = 0;
 switch (sscanf(tbuf, "[%jd.%ld]", , )){
 case 0:
-	/* not a timestamp */
+ not_tstamp:/* not a timestamp */
 	PRTBUF();
 	continue;
 case 1:
@@ -361,14 +360,14 @@ main(int argc, char *argv[])
 			t++;
 
 	if (localtime_r(, ) != NULL) {
-		strftime(tbuf, tbuflen,
+		strftime(tbuf, sizeof(tbuf),
 		"%a %b %e %H:%M:%S %Z %Y",
 		);
 		printf("%s", tbuf);
 	}
 } else if (humantime > 1) {
 	const char *fp = fmtydhmsf(tbuf,
-	tbuflen, sec, fsec, humantime);
+	sizeof(tbuf), sec, fsec, humantime);
 	if (fp) {
 		printf("%s", fp);
 	}
@@ -410,6 +409,7 @@ main(int argc, char *argv[])
 		frac = true;
 	continue;
 }
+ prchar:
 #endif
 if (log)
 	continue;



CVS commit: src/sbin/dmesg

2022-08-06 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Aug  6 09:42:33 UTC 2022

Modified Files:
src/sbin/dmesg: dmesg.c

Log Message:
Oops, fix thinko in the previous.


To generate a diff of this commit:
cvs rdiff -u -r1.47 -r1.48 src/sbin/dmesg/dmesg.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/dmesg/dmesg.c
diff -u src/sbin/dmesg/dmesg.c:1.47 src/sbin/dmesg/dmesg.c:1.48
--- src/sbin/dmesg/dmesg.c:1.47	Sat Aug  6 09:39:32 2022
+++ src/sbin/dmesg/dmesg.c	Sat Aug  6 09:42:33 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: dmesg.c,v 1.47 2022/08/06 09:39:32 rin Exp $	*/
+/*	$NetBSD: dmesg.c,v 1.48 2022/08/06 09:42:33 rin Exp $	*/
 /*-
  * Copyright (c) 1991, 1993
  *	The Regents of the University of California.  All rights reserved.
@@ -38,7 +38,7 @@ __COPYRIGHT("@(#) Copyright (c) 1991, 19
 #if 0
 static char sccsid[] = "@(#)dmesg.c	8.1 (Berkeley) 6/5/93";
 #else
-__RCSID("$NetBSD: dmesg.c,v 1.47 2022/08/06 09:39:32 rin Exp $");
+__RCSID("$NetBSD: dmesg.c,v 1.48 2022/08/06 09:42:33 rin Exp $");
 #endif
 #endif /* not lint */
 
@@ -280,7 +280,7 @@ main(int argc, char *argv[])
 #define ADDC(c)\
 do {\
 	if (tstamp >= tbuflen - 1 &&	\
-	reallocarr(, tstamp * 2, 1) == 0)			\
+	reallocarr(, tbuflen * 2, 1) == 0)			\
 		tbuflen *= 2;		\
 	if (tstamp < tbuflen - 1)	\
 		tbuf[tstamp++] = (c);	\



CVS commit: src/sbin/dmesg

2022-08-06 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Aug  6 09:42:33 UTC 2022

Modified Files:
src/sbin/dmesg: dmesg.c

Log Message:
Oops, fix thinko in the previous.


To generate a diff of this commit:
cvs rdiff -u -r1.47 -r1.48 src/sbin/dmesg/dmesg.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/doc

2022-08-06 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sat Aug  6 09:39:50 UTC 2022

Modified Files:
src/doc: 3RDPARTY

Log Message:
binutils-2.39 out


To generate a diff of this commit:
cvs rdiff -u -r1.1866 -r1.1867 src/doc/3RDPARTY

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/doc/3RDPARTY
diff -u src/doc/3RDPARTY:1.1866 src/doc/3RDPARTY:1.1867
--- src/doc/3RDPARTY:1.1866	Fri Jul 29 12:49:16 2022
+++ src/doc/3RDPARTY	Sat Aug  6 09:39:50 2022
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.1866 2022/07/29 12:49:16 wiz Exp $
+#	$NetBSD: 3RDPARTY,v 1.1867 2022/08/06 09:39:50 wiz Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -499,11 +499,11 @@ When updating GDB, it is imperative to t
 
 Package:	binutils
 Version:	2.34
-Current Vers:	2.38
+Current Vers:	2.39
 Maintainer:	FSF
 Archive Site:	ftp://ftp.gnu.org/gnu/binutils/
 Home Page:	https://www.gnu.org/software/binutils/
-Date:		2022-02-09
+Date:		2022-08-06
 Mailing List:	bug-gnu-ut...@gnu.org
 Responsible:	thorpej, mrg
 License:	GPLv3, LGPLv3, GPLv2, LGPLv2, BSD



CVS commit: src/doc

2022-08-06 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sat Aug  6 09:39:50 UTC 2022

Modified Files:
src/doc: 3RDPARTY

Log Message:
binutils-2.39 out


To generate a diff of this commit:
cvs rdiff -u -r1.1866 -r1.1867 src/doc/3RDPARTY

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sbin/dmesg

2022-08-06 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Aug  6 09:39:32 UTC 2022

Modified Files:
src/sbin/dmesg: dmesg.c

Log Message:
Do not discard \[.*\] which is not identified as a timestamp.


To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.47 src/sbin/dmesg/dmesg.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/dmesg/dmesg.c
diff -u src/sbin/dmesg/dmesg.c:1.46 src/sbin/dmesg/dmesg.c:1.47
--- src/sbin/dmesg/dmesg.c:1.46	Sat Aug  6 09:33:56 2022
+++ src/sbin/dmesg/dmesg.c	Sat Aug  6 09:39:32 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: dmesg.c,v 1.46 2022/08/06 09:33:56 rin Exp $	*/
+/*	$NetBSD: dmesg.c,v 1.47 2022/08/06 09:39:32 rin Exp $	*/
 /*-
  * Copyright (c) 1991, 1993
  *	The Regents of the University of California.  All rights reserved.
@@ -38,7 +38,7 @@ __COPYRIGHT("@(#) Copyright (c) 1991, 19
 #if 0
 static char sccsid[] = "@(#)dmesg.c	8.1 (Berkeley) 6/5/93";
 #else
-__RCSID("$NetBSD: dmesg.c,v 1.46 2022/08/06 09:33:56 rin Exp $");
+__RCSID("$NetBSD: dmesg.c,v 1.47 2022/08/06 09:39:32 rin Exp $");
 #endif
 #endif /* not lint */
 
@@ -149,7 +149,8 @@ main(int argc, char *argv[])
 	char *p, *bufdata;
 	char buf[5];
 #ifndef SMALL
-	char tbuf[64];
+	size_t tbuflen;
+	char *tbuf;
 	char *memf, *nlistf;
 	struct timespec boottime;
 	struct timespec lasttime;
@@ -264,6 +265,11 @@ main(int argc, char *argv[])
 	frac = false;
 	postts = false;
 	scale = 0;
+
+	tbuflen = 64;
+	tbuf = malloc(tbuflen);
+	if (tbuf == NULL)
+		err(1, "malloc");
 #endif
 	for (tstamp = 0, newl = 1, log = i = 0, p = bufdata + cur.msg_bufx;
 	i < cur.msg_bufs; i++, p++) {
@@ -273,11 +279,22 @@ main(int argc, char *argv[])
 			p = bufdata;
 #define ADDC(c)\
 do {\
-	if (tstamp < sizeof(tbuf) - 1)	\
+	if (tstamp >= tbuflen - 1 &&	\
+	reallocarr(, tstamp * 2, 1) == 0)			\
+		tbuflen *= 2;		\
+	if (tstamp < tbuflen - 1)	\
 		tbuf[tstamp++] = (c);	\
 	if (frac)			\
 		scale++;		\
 } while (0)
+#define	PRTBUF()			\
+for (char *_p = tbuf; *_p != '\0'; _p++) {\
+	(void)vis(buf, *_p, VIS_NOSLASH, 0);\
+	if (buf[1] == 0)		\
+		(void)putchar(buf[0]);	\
+	else\
+		(void)printf("%s", buf);\
+}
 #endif
 		ch = *p;
 		if (ch == '\0')
@@ -312,15 +329,16 @@ main(int argc, char *argv[])
 postts = true;
 sec = fsec = 0;
 switch (sscanf(tbuf, "[%jd.%ld]", , )){
-case EOF:
 case 0:
-	/*???*/
+	/* not a timestamp */
+	PRTBUF();
 	continue;
 case 1:
-	fsec = 0;
+	fsec = 0; /* XXX PRTBUF()? */
 	break;
 case 2:
 	break;
+case EOF:
 default:
 	/* Help */
 	continue;
@@ -343,14 +361,14 @@ main(int argc, char *argv[])
 			t++;
 
 	if (localtime_r(, ) != NULL) {
-		strftime(tbuf, sizeof(tbuf),
+		strftime(tbuf, tbuflen,
 		"%a %b %e %H:%M:%S %Z %Y",
 		);
 		printf("%s", tbuf);
 	}
 } else if (humantime > 1) {
 	const char *fp = fmtydhmsf(tbuf,
-	sizeof(tbuf), sec, fsec, humantime);
+	tbuflen, sec, fsec, humantime);
 	if (fp) {
 		printf("%s", fp);
 	}
@@ -407,6 +425,13 @@ main(int argc, char *argv[])
 #endif
 			(void)printf("%s", buf);
 	}
+#ifndef SMALL
+	/* non-terminated [.*] */
+	if (tstamp) {
+		ADDC('\0');
+		PRTBUF();
+	}
+#endif
 	if (!newl)
 		(void)putchar('\n');
 	return EXIT_SUCCESS;



CVS commit: src/sbin/dmesg

2022-08-06 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Aug  6 09:39:32 UTC 2022

Modified Files:
src/sbin/dmesg: dmesg.c

Log Message:
Do not discard \[.*\] which is not identified as a timestamp.


To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.47 src/sbin/dmesg/dmesg.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sbin/dmesg

2022-08-06 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Aug  6 09:33:56 UTC 2022

Modified Files:
src/sbin/dmesg: dmesg.c

Log Message:
KNF. Do not unnecessarily define ADDC() for SMALL. No binary changes.


To generate a diff of this commit:
cvs rdiff -u -r1.45 -r1.46 src/sbin/dmesg/dmesg.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/dmesg/dmesg.c
diff -u src/sbin/dmesg/dmesg.c:1.45 src/sbin/dmesg/dmesg.c:1.46
--- src/sbin/dmesg/dmesg.c:1.45	Wed Jan  1 00:24:52 2020
+++ src/sbin/dmesg/dmesg.c	Sat Aug  6 09:33:56 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: dmesg.c,v 1.45 2020/01/01 00:24:52 kre Exp $	*/
+/*	$NetBSD: dmesg.c,v 1.46 2022/08/06 09:33:56 rin Exp $	*/
 /*-
  * Copyright (c) 1991, 1993
  *	The Regents of the University of California.  All rights reserved.
@@ -38,7 +38,7 @@ __COPYRIGHT("@(#) Copyright (c) 1991, 19
 #if 0
 static char sccsid[] = "@(#)dmesg.c	8.1 (Berkeley) 6/5/93";
 #else
-__RCSID("$NetBSD: dmesg.c,v 1.45 2020/01/01 00:24:52 kre Exp $");
+__RCSID("$NetBSD: dmesg.c,v 1.46 2022/08/06 09:33:56 rin Exp $");
 #endif
 #endif /* not lint */
 
@@ -271,15 +271,13 @@ main(int argc, char *argv[])
 #ifndef SMALL
 		if (p == bufdata + cur.msg_bufs)
 			p = bufdata;
-#define ADDC(c)\
-do {\
-	if (tstamp < sizeof(tbuf) - 1)	\
-		tbuf[tstamp++] = (c);	\
-	if (frac)			\
-		scale++;		\
-} while (/*CONSTCOND*/0)
-#else
-#define ADDC(c)
+#define ADDC(c)\
+do {\
+	if (tstamp < sizeof(tbuf) - 1)	\
+		tbuf[tstamp++] = (c);	\
+	if (frac)			\
+		scale++;		\
+} while (0)
 #endif
 		ch = *p;
 		if (ch == '\0')
@@ -389,10 +387,10 @@ main(int argc, char *argv[])
 			default:
 #ifndef SMALL
 if (tstamp) {
-ADDC(ch);
-if (ch == '.')
-	frac = true;
-continue;
+	ADDC(ch);
+	if (ch == '.')
+		frac = true;
+	continue;
 }
 #endif
 if (log)



CVS commit: src/sbin/dmesg

2022-08-06 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Aug  6 09:33:56 UTC 2022

Modified Files:
src/sbin/dmesg: dmesg.c

Log Message:
KNF. Do not unnecessarily define ADDC() for SMALL. No binary changes.


To generate a diff of this commit:
cvs rdiff -u -r1.45 -r1.46 src/sbin/dmesg/dmesg.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.bin/make/unit-tests

2022-08-06 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Aug  6 07:06:58 UTC 2022

Modified Files:
src/usr.bin/make/unit-tests: varmod.exp varmod.mk

Log Message:
tests/make: document parsing behavior of modifiers

The table was created by manually inspecting the code of the various
ApplyModifier functions in var.c.

The modifiers are listed in alphabetical order, except for the SysV
modifier, which is listed at the end since it is used as a fallback
modifier for many other modifiers and because it does not have a fixed
prefix.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/usr.bin/make/unit-tests/varmod.exp
cvs rdiff -u -r1.5 -r1.6 src/usr.bin/make/unit-tests/varmod.mk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/make/unit-tests/varmod.exp
diff -u src/usr.bin/make/unit-tests/varmod.exp:1.4 src/usr.bin/make/unit-tests/varmod.exp:1.5
--- src/usr.bin/make/unit-tests/varmod.exp:1.4	Sat Dec 19 22:33:11 2020
+++ src/usr.bin/make/unit-tests/varmod.exp	Sat Aug  6 07:06:58 2022
@@ -1,8 +1,8 @@
-make: "varmod.mk" line 42: To escape a dollar, use \$, not $$, at "$$:L} != """
-make: "varmod.mk" line 42: Invalid variable name ':', at "$:L} != """
-make: "varmod.mk" line 47: Dollar followed by nothing
-make: "varmod.mk" line 56: Missing delimiter ':' after modifier "P"
-make: "varmod.mk" line 57: Missing argument for ".error"
+make: "varmod.mk" line 93: To escape a dollar, use \$, not $$, at "$$:L} != """
+make: "varmod.mk" line 93: Invalid variable name ':', at "$:L} != """
+make: "varmod.mk" line 98: Dollar followed by nothing
+make: "varmod.mk" line 107: Missing delimiter ':' after modifier "P"
+make: "varmod.mk" line 108: Missing argument for ".error"
 make: Fatal errors encountered -- cannot continue
 make: stopped in unit-tests
 exit status 1

Index: src/usr.bin/make/unit-tests/varmod.mk
diff -u src/usr.bin/make/unit-tests/varmod.mk:1.5 src/usr.bin/make/unit-tests/varmod.mk:1.6
--- src/usr.bin/make/unit-tests/varmod.mk:1.5	Sat Dec 19 22:33:11 2020
+++ src/usr.bin/make/unit-tests/varmod.mk	Sat Aug  6 07:06:58 2022
@@ -1,7 +1,58 @@
-# $NetBSD: varmod.mk,v 1.5 2020/12/19 22:33:11 rillig Exp $
+# $NetBSD: varmod.mk,v 1.6 2022/08/06 07:06:58 rillig Exp $
 #
 # Tests for variable modifiers, such as :Q, :S,from,to or :Ufallback.
 
+# As of 2022-08-06, the possible behaviors during parsing are:
+#
+# * `strict`: the parsing style used by most modifiers:
+#   * either uses `ParseModifierPart` or parses the modifier literal
+#   * other modifiers may follow, separated by a ':'
+#
+# * `greedy`: calls `ParseModifierPart` with `ch->endc`; this means
+#   that no further modifiers are parsed in that expression.
+#
+# * `no-colon`: after parsing this modifier, the following modifier
+#   does not need to be separated by a colon.
+#   Omitting this colon is bad style.
+#
+# * `individual`: parsing this modifier does not follow the common
+#   pattern of calling `ParseModifierPart`.
+#
+# The SysV column says whether a parse error in the modifier falls back
+# trying the `:from=to` System V modifier.
+#
+# | **Operator** | **Behavior** | **Remarks**| **SysV** |
+# |--|--||--|
+# | `!`  | no-colon || no   |
+# | `:=` | greedy   || yes  |
+# | `?:` | greedy   || no   |
+# | `@`  | no-colon || no   |
+# | `C`  | no-colon || no   |
+# | `D`  | individual   | custom parser  | N/A  |
+# | `E`  | strict   || yes  |
+# | `H`  | strict   || yes  |
+# | `L`  | no-colon || N/A  |
+# | `M`  | individual   | custom parser  | N/A  |
+# | `N`  | individual   | custom parser  | N/A  |
+# | `O`  | strict   | only literal value | no   |
+# | `P`  | no-colon || N/A  |
+# | `Q`  | strict   || yes  |
+# | `R`  | strict   || yes  |
+# | `S`  | no-colon || N/A  |
+# | `T`  | strict   || N/A  |
+# | `U`  | individual   | custom parser  | N/A  |
+# | `[`  | strict   || no   |
+# | `_`  | individual   | strcspn| yes  |
+# | `gmtime` | strict   | only literal value | yes  |
+# | `hash`   | strict   || N/A  |
+# | `localtime`  | strict   | only literal value | yes  |
+# | `q`  | strict   || yes  |
+# | `range`  | strict   || N/A  |
+# | `sh`

CVS commit: src/usr.bin/make/unit-tests

2022-08-06 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Aug  6 07:06:58 UTC 2022

Modified Files:
src/usr.bin/make/unit-tests: varmod.exp varmod.mk

Log Message:
tests/make: document parsing behavior of modifiers

The table was created by manually inspecting the code of the various
ApplyModifier functions in var.c.

The modifiers are listed in alphabetical order, except for the SysV
modifier, which is listed at the end since it is used as a fallback
modifier for many other modifiers and because it does not have a fixed
prefix.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/usr.bin/make/unit-tests/varmod.exp
cvs rdiff -u -r1.5 -r1.6 src/usr.bin/make/unit-tests/varmod.mk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.