CVS commit: src

2021-10-31 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Mon Nov  1 05:53:46 UTC 2021

Modified Files:
src/distrib/sets/lists/base: shl.mi
src/distrib/sets/lists/debug: shl.mi
src/include: signal.h
src/lib/libc: shlib_version
src/lib/libc/compat/sys: Makefile.inc
src/lib/libc/sys: Makefile.inc
Added Files:
src/lib/libc/compat/sys: compat___sigaction14_sigtramp.c
src/lib/libc/sys: Lint___sigaction_siginfo.c __sigaction_siginfo.c
Removed Files:
src/lib/libc/sys: Lint___sigaction14.c __sigaction14_sigtramp.c

Log Message:
Version the sigaction(2) libc wrapper.  The new version uses the "siginfo"
trampoline exclusively, thus relegating "sigcontext"-style handlers (which
have not been documented for many years now) to the dustbin of the compat
library.


To generate a diff of this commit:
cvs rdiff -u -r1.929 -r1.930 src/distrib/sets/lists/base/shl.mi
cvs rdiff -u -r1.286 -r1.287 src/distrib/sets/lists/debug/shl.mi
cvs rdiff -u -r1.57 -r1.58 src/include/signal.h
cvs rdiff -u -r1.292 -r1.293 src/lib/libc/shlib_version
cvs rdiff -u -r1.10 -r1.11 src/lib/libc/compat/sys/Makefile.inc
cvs rdiff -u -r0 -r1.1 \
src/lib/libc/compat/sys/compat___sigaction14_sigtramp.c
cvs rdiff -u -r1.1 -r0 src/lib/libc/sys/Lint___sigaction14.c
cvs rdiff -u -r0 -r1.1 src/lib/libc/sys/Lint___sigaction_siginfo.c \
src/lib/libc/sys/__sigaction_siginfo.c
cvs rdiff -u -r1.249 -r1.250 src/lib/libc/sys/Makefile.inc
cvs rdiff -u -r1.2 -r0 src/lib/libc/sys/__sigaction14_sigtramp.c

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

Modified files:

Index: src/distrib/sets/lists/base/shl.mi
diff -u src/distrib/sets/lists/base/shl.mi:1.929 src/distrib/sets/lists/base/shl.mi:1.930
--- src/distrib/sets/lists/base/shl.mi:1.929	Sat Oct 16 07:01:02 2021
+++ src/distrib/sets/lists/base/shl.mi	Mon Nov  1 05:53:45 2021
@@ -1,4 +1,4 @@
-# $NetBSD: shl.mi,v 1.929 2021/10/16 07:01:02 skrll Exp $
+# $NetBSD: shl.mi,v 1.930 2021/11/01 05:53:45 thorpej Exp $
 #
 # Note:	Don't delete entries from here - mark them as "obsolete" instead,
 #	unless otherwise stated below.
@@ -24,7 +24,7 @@
 ./lib/libblocklist.so.0.0			base-sys-shlib		dynamicroot
 ./lib/libc.so	base-sys-shlib		dynamicroot
 ./lib/libc.so.12base-sys-shlib		dynamicroot
-./lib/libc.so.12.219base-sys-shlib		dynamicroot
+./lib/libc.so.12.220base-sys-shlib		dynamicroot
 ./lib/libcrypt.sobase-sys-shlib		dynamicroot
 ./lib/libcrypt.so.1base-sys-shlib		dynamicroot
 ./lib/libcrypt.so.1.0base-sys-shlib		dynamicroot
@@ -251,7 +251,7 @@
 ./usr/lib/libc++.so.1.0base-sys-shlib		compatfile,libcxx
 ./usr/lib/libc.sobase-sys-shlib		compatfile
 ./usr/lib/libc.so.12base-sys-shlib		compatfile
-./usr/lib/libc.so.12.219			base-sys-shlib		compatfile
+./usr/lib/libc.so.12.220			base-sys-shlib		compatfile
 ./usr/lib/libcbor.sobase-sys-shlib		compatfile
 ./usr/lib/libcbor.so.0base-sys-shlib		compatfile
 ./usr/lib/libcbor.so.0.5			base-sys-shlib		compatfile

Index: src/distrib/sets/lists/debug/shl.mi
diff -u src/distrib/sets/lists/debug/shl.mi:1.286 src/distrib/sets/lists/debug/shl.mi:1.287
--- src/distrib/sets/lists/debug/shl.mi:1.286	Sat Oct 16 07:01:03 2021
+++ src/distrib/sets/lists/debug/shl.mi	Mon Nov  1 05:53:45 2021
@@ -1,10 +1,10 @@
-# $NetBSD: shl.mi,v 1.286 2021/10/16 07:01:03 skrll Exp $
+# $NetBSD: shl.mi,v 1.287 2021/11/01 05:53:45 thorpej Exp $
 ./usr/lib/libbfd_g.a		comp-c-debuglib	debuglib,compatfile,binutils
 ./usr/libdata/debug/lib		base-sys-usr	debug,dynamicroot,compatdir
 ./usr/libdata/debug/lib/libavl.so.0.0.debug			comp-zfs-debug	debug,dynamicroot,zfs
 ./usr/libdata/debug/lib/libblacklist.so.0.0.debug		comp-obsolete	obsolete,compatfile
 ./usr/libdata/debug/lib/libblocklist.so.0.0.debug		comp-sys-debug	debug,dynamicroot
-./usr/libdata/debug/lib/libc.so.12.219.debug			comp-sys-debug	debug,dynamicroot
+./usr/libdata/debug/lib/libc.so.12.220.debug			comp-sys-debug	debug,dynamicroot
 ./usr/libdata/debug/lib/libcrypt.so.1.0.debug			comp-sys-debug	debug,dynamicroot
 ./usr/libdata/debug/lib/libcrypto.so.12.0.debug			comp-sys-debug	debug,dynamicroot,openssl=10
 ./usr/libdata/debug/lib/libcrypto.so.14.0.debug			comp-sys-debug	debug,dynamicroot,openssl=11
@@ -84,7 +84,7 @@
 ./usr/libdata/debug/usr/lib/libbsdmalloc.so.0.0.debug		comp-sys-debug	debug,compatfile
 ./usr/libdata/debug/usr/lib/libbz2.so.1.1.debug			comp-sys-debug	debug,compatfile
 ./usr/libdata/debug/usr/lib/libc++.so.1.0.debug			comp-sys-debug	debug,compatfile,libcxx
-./usr/libdata/debug/usr/lib/libc.so.12.219.debug		comp-sys-debug	debug,compatfile
+./usr/libdata/debug/usr/lib/libc.so.12.220.debug		comp-sys-debug	debug,compatfile
 ./usr/libdata/debug/usr/lib/libcbor.so.0.5.debug		comp-sys-debug	debug,compatfile
 ./usr/libdata/debug/usr/lib/libcom_err.so.8.0.debug		comp-krb5-debug	debug,compatfile,kerberos
 ./usr/libdata/debug/usr/lib/libcrypt.so.1.0.debug		

CVS commit: src

2021-10-31 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Mon Nov  1 05:53:46 UTC 2021

Modified Files:
src/distrib/sets/lists/base: shl.mi
src/distrib/sets/lists/debug: shl.mi
src/include: signal.h
src/lib/libc: shlib_version
src/lib/libc/compat/sys: Makefile.inc
src/lib/libc/sys: Makefile.inc
Added Files:
src/lib/libc/compat/sys: compat___sigaction14_sigtramp.c
src/lib/libc/sys: Lint___sigaction_siginfo.c __sigaction_siginfo.c
Removed Files:
src/lib/libc/sys: Lint___sigaction14.c __sigaction14_sigtramp.c

Log Message:
Version the sigaction(2) libc wrapper.  The new version uses the "siginfo"
trampoline exclusively, thus relegating "sigcontext"-style handlers (which
have not been documented for many years now) to the dustbin of the compat
library.


To generate a diff of this commit:
cvs rdiff -u -r1.929 -r1.930 src/distrib/sets/lists/base/shl.mi
cvs rdiff -u -r1.286 -r1.287 src/distrib/sets/lists/debug/shl.mi
cvs rdiff -u -r1.57 -r1.58 src/include/signal.h
cvs rdiff -u -r1.292 -r1.293 src/lib/libc/shlib_version
cvs rdiff -u -r1.10 -r1.11 src/lib/libc/compat/sys/Makefile.inc
cvs rdiff -u -r0 -r1.1 \
src/lib/libc/compat/sys/compat___sigaction14_sigtramp.c
cvs rdiff -u -r1.1 -r0 src/lib/libc/sys/Lint___sigaction14.c
cvs rdiff -u -r0 -r1.1 src/lib/libc/sys/Lint___sigaction_siginfo.c \
src/lib/libc/sys/__sigaction_siginfo.c
cvs rdiff -u -r1.249 -r1.250 src/lib/libc/sys/Makefile.inc
cvs rdiff -u -r1.2 -r0 src/lib/libc/sys/__sigaction14_sigtramp.c

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



CVS commit: src/lib/libc/sys

2021-10-31 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Mon Nov  1 05:29:35 UTC 2021

Modified Files:
src/lib/libc/sys: sigaltstack.2

Log Message:
Don't mention the "struct sigaltstack" name of "stack_t".


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/lib/libc/sys/sigaltstack.2

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

Modified files:

Index: src/lib/libc/sys/sigaltstack.2
diff -u src/lib/libc/sys/sigaltstack.2:1.25 src/lib/libc/sys/sigaltstack.2:1.26
--- src/lib/libc/sys/sigaltstack.2:1.25	Mon Jul  3 21:32:50 2017
+++ src/lib/libc/sys/sigaltstack.2	Mon Nov  1 05:29:35 2021
@@ -1,4 +1,4 @@
-.\"	$NetBSD: sigaltstack.2,v 1.25 2017/07/03 21:32:50 wiz Exp $
+.\"	$NetBSD: sigaltstack.2,v 1.26 2021/11/01 05:29:35 thorpej Exp $
 .\"
 .\" Copyright (c) 1983, 1991, 1992, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -29,7 +29,7 @@
 .\"
 .\" @(#)sigaltstack.2	8.2 (Berkeley) 5/1/95
 .\"
-.Dd March 2, 2012
+.Dd October 31, 2021
 .Dt SIGALTSTACK 2
 .Os
 .Sh NAME
@@ -40,7 +40,7 @@
 .Sh SYNOPSIS
 .In signal.h
 .Bd -literal
-typedef struct sigaltstack {
+typedef struct {
 	void   *ss_sp;
 	size_t	ss_size;
 	int ss_flags;



CVS commit: src/lib/libc/sys

2021-10-31 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Mon Nov  1 05:29:35 UTC 2021

Modified Files:
src/lib/libc/sys: sigaltstack.2

Log Message:
Don't mention the "struct sigaltstack" name of "stack_t".


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/lib/libc/sys/sigaltstack.2

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



CVS commit: src/sys

2021-10-31 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Mon Nov  1 05:26:28 UTC 2021

Modified Files:
src/sys/kern: init_sysent.c syscalls.c syscalls_autoload.c
systrace_args.c
src/sys/rump/include/rump: rump_syscalls.h
src/sys/rump/librump/rumpkern: rump_syscalls.c
src/sys/sys: syscall.h syscallargs.h

Log Message:
regen for "struct sigaltstack" -> "stack_t"


To generate a diff of this commit:
cvs rdiff -u -r1.338 -r1.339 src/sys/kern/init_sysent.c
cvs rdiff -u -r1.326 -r1.327 src/sys/kern/syscalls.c
cvs rdiff -u -r1.42 -r1.43 src/sys/kern/syscalls_autoload.c
cvs rdiff -u -r1.48 -r1.49 src/sys/kern/systrace_args.c
cvs rdiff -u -r1.125 -r1.126 src/sys/rump/include/rump/rump_syscalls.h
cvs rdiff -u -r1.156 -r1.157 src/sys/rump/librump/rumpkern/rump_syscalls.c
cvs rdiff -u -r1.320 -r1.321 src/sys/sys/syscall.h
cvs rdiff -u -r1.304 -r1.305 src/sys/sys/syscallargs.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/kern/init_sysent.c
diff -u src/sys/kern/init_sysent.c:1.338 src/sys/kern/init_sysent.c:1.339
--- src/sys/kern/init_sysent.c:1.338	Sun Sep 19 15:52:04 2021
+++ src/sys/kern/init_sysent.c	Mon Nov  1 05:26:27 2021
@@ -1,14 +1,14 @@
-/* $NetBSD: init_sysent.c,v 1.338 2021/09/19 15:52:04 thorpej Exp $ */
+/* $NetBSD: init_sysent.c,v 1.339 2021/11/01 05:26:27 thorpej Exp $ */
 
 /*
  * System call switch table.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * created from	NetBSD: syscalls.master,v 1.308 2021/09/19 15:51:27 thorpej Exp
+ * created from	NetBSD: syscalls.master,v 1.309 2021/11/01 05:07:17 thorpej Exp
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: init_sysent.c,v 1.338 2021/09/19 15:52:04 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: init_sysent.c,v 1.339 2021/11/01 05:26:27 thorpej Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_modular.h"

Index: src/sys/kern/syscalls.c
diff -u src/sys/kern/syscalls.c:1.326 src/sys/kern/syscalls.c:1.327
--- src/sys/kern/syscalls.c:1.326	Sun Sep 19 15:52:04 2021
+++ src/sys/kern/syscalls.c	Mon Nov  1 05:26:27 2021
@@ -1,14 +1,14 @@
-/* $NetBSD: syscalls.c,v 1.326 2021/09/19 15:52:04 thorpej Exp $ */
+/* $NetBSD: syscalls.c,v 1.327 2021/11/01 05:26:27 thorpej Exp $ */
 
 /*
  * System call names.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * created from	NetBSD: syscalls.master,v 1.308 2021/09/19 15:51:27 thorpej Exp
+ * created from	NetBSD: syscalls.master,v 1.309 2021/11/01 05:07:17 thorpej Exp
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: syscalls.c,v 1.326 2021/09/19 15:52:04 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: syscalls.c,v 1.327 2021/11/01 05:26:27 thorpej Exp $");
 
 #if defined(_KERNEL_OPT)
 #ifdef _KERNEL_OPT

Index: src/sys/kern/syscalls_autoload.c
diff -u src/sys/kern/syscalls_autoload.c:1.42 src/sys/kern/syscalls_autoload.c:1.43
--- src/sys/kern/syscalls_autoload.c:1.42	Sun Sep 19 15:52:04 2021
+++ src/sys/kern/syscalls_autoload.c	Mon Nov  1 05:26:27 2021
@@ -1,14 +1,14 @@
-/* $NetBSD: syscalls_autoload.c,v 1.42 2021/09/19 15:52:04 thorpej Exp $ */
+/* $NetBSD: syscalls_autoload.c,v 1.43 2021/11/01 05:26:27 thorpej Exp $ */
 
 /*
  * System call autoload table.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * created from	NetBSD: syscalls.master,v 1.308 2021/09/19 15:51:27 thorpej Exp
+ * created from	NetBSD: syscalls.master,v 1.309 2021/11/01 05:07:17 thorpej Exp
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: syscalls_autoload.c,v 1.42 2021/09/19 15:52:04 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: syscalls_autoload.c,v 1.43 2021/11/01 05:26:27 thorpej Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_modular.h"

Index: src/sys/kern/systrace_args.c
diff -u src/sys/kern/systrace_args.c:1.48 src/sys/kern/systrace_args.c:1.49
--- src/sys/kern/systrace_args.c:1.48	Sun Sep 19 15:52:04 2021
+++ src/sys/kern/systrace_args.c	Mon Nov  1 05:26:27 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: systrace_args.c,v 1.48 2021/09/19 15:52:04 thorpej Exp $ */
+/* $NetBSD: systrace_args.c,v 1.49 2021/11/01 05:26:27 thorpej Exp $ */
 
 /*
  * System call argument to DTrace register array conversion.
@@ -2094,8 +2094,8 @@ systrace_args(register_t sysnum, const v
 	/* sys___sigaltstack14 */
 	case 281: {
 		const struct sys___sigaltstack14_args *p = params;
-		uarg[0] = (intptr_t) SCARG(p, nss); /* const struct sigaltstack * */
-		uarg[1] = (intptr_t) SCARG(p, oss); /* struct sigaltstack * */
+		uarg[0] = (intptr_t) SCARG(p, nss); /* const stack_t * */
+		uarg[1] = (intptr_t) SCARG(p, oss); /* stack_t * */
 		*n_args = 2;
 		break;
 	}
@@ -7345,10 +7345,10 @@ systrace_entry_setargdesc(int sysnum, in
 	case 281:
 		switch(ndx) {
 		case 0:
-			p = "const struct sigaltstack *";
+			p = "const stack_t *";
 			break;
 		case 1:
-			p = "struct sigaltstack *";
+			p = "stack_t *";
 			break;
 		default:
 			break;

Index: src/sys/rump/include/rump/rump_syscalls.h
diff -u 

CVS commit: src/sys

2021-10-31 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Mon Nov  1 05:26:28 UTC 2021

Modified Files:
src/sys/kern: init_sysent.c syscalls.c syscalls_autoload.c
systrace_args.c
src/sys/rump/include/rump: rump_syscalls.h
src/sys/rump/librump/rumpkern: rump_syscalls.c
src/sys/sys: syscall.h syscallargs.h

Log Message:
regen for "struct sigaltstack" -> "stack_t"


To generate a diff of this commit:
cvs rdiff -u -r1.338 -r1.339 src/sys/kern/init_sysent.c
cvs rdiff -u -r1.326 -r1.327 src/sys/kern/syscalls.c
cvs rdiff -u -r1.42 -r1.43 src/sys/kern/syscalls_autoload.c
cvs rdiff -u -r1.48 -r1.49 src/sys/kern/systrace_args.c
cvs rdiff -u -r1.125 -r1.126 src/sys/rump/include/rump/rump_syscalls.h
cvs rdiff -u -r1.156 -r1.157 src/sys/rump/librump/rumpkern/rump_syscalls.c
cvs rdiff -u -r1.320 -r1.321 src/sys/sys/syscall.h
cvs rdiff -u -r1.304 -r1.305 src/sys/sys/syscallargs.h

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



CVS commit: src/sys

2021-10-31 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Mon Nov  1 05:07:17 UTC 2021

Modified Files:
src/sys/arch/aarch64/aarch64: netbsd32_machdep.c sig_machdep.c
src/sys/arch/amd64/amd64: netbsd32_machdep.c
src/sys/arch/powerpc/powerpc: sig_machdep.c
src/sys/arch/sh3/sh3: sh3_machdep.c
src/sys/arch/vax/vax: sig_machdep.c
src/sys/compat/common: compat_sigaltstack.h kern_sig_43.c
src/sys/compat/linux/arch/aarch64: linux_machdep.c
src/sys/compat/linux/arch/i386: linux_machdep.c
src/sys/compat/linux/common: linux_signal.c linux_signal.h
src/sys/compat/linux32/arch/amd64: linux32_machdep.c
src/sys/compat/linux32/common: linux32_signal.c linux32_signal.h
src/sys/compat/netbsd32: netbsd32_compat_43.c
src/sys/compat/sys: signalvar.h
src/sys/kern: sys_sig.c syscalls.master
src/sys/sys: signalvar.h

Log Message:
Use "stack_t" instead of "struct sigaltstack", as the former is the
newer standardized name.  NFC.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/aarch64/aarch64/netbsd32_machdep.c
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/aarch64/aarch64/sig_machdep.c
cvs rdiff -u -r1.138 -r1.139 src/sys/arch/amd64/amd64/netbsd32_machdep.c
cvs rdiff -u -r1.53 -r1.54 src/sys/arch/powerpc/powerpc/sig_machdep.c
cvs rdiff -u -r1.110 -r1.111 src/sys/arch/sh3/sh3/sh3_machdep.c
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/vax/vax/sig_machdep.c
cvs rdiff -u -r1.3 -r1.4 src/sys/compat/common/compat_sigaltstack.h
cvs rdiff -u -r1.37 -r1.38 src/sys/compat/common/kern_sig_43.c
cvs rdiff -u -r1.2 -r1.3 src/sys/compat/linux/arch/aarch64/linux_machdep.c
cvs rdiff -u -r1.168 -r1.169 src/sys/compat/linux/arch/i386/linux_machdep.c
cvs rdiff -u -r1.87 -r1.88 src/sys/compat/linux/common/linux_signal.c
cvs rdiff -u -r1.33 -r1.34 src/sys/compat/linux/common/linux_signal.h
cvs rdiff -u -r1.46 -r1.47 \
src/sys/compat/linux32/arch/amd64/linux32_machdep.c
cvs rdiff -u -r1.22 -r1.23 src/sys/compat/linux32/common/linux32_signal.c
cvs rdiff -u -r1.3 -r1.4 src/sys/compat/linux32/common/linux32_signal.h
cvs rdiff -u -r1.62 -r1.63 src/sys/compat/netbsd32/netbsd32_compat_43.c
cvs rdiff -u -r1.2 -r1.3 src/sys/compat/sys/signalvar.h
cvs rdiff -u -r1.53 -r1.54 src/sys/kern/sys_sig.c
cvs rdiff -u -r1.308 -r1.309 src/sys/kern/syscalls.master
cvs rdiff -u -r1.103 -r1.104 src/sys/sys/signalvar.h

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



CVS commit: src/sys

2021-10-31 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Mon Nov  1 05:07:17 UTC 2021

Modified Files:
src/sys/arch/aarch64/aarch64: netbsd32_machdep.c sig_machdep.c
src/sys/arch/amd64/amd64: netbsd32_machdep.c
src/sys/arch/powerpc/powerpc: sig_machdep.c
src/sys/arch/sh3/sh3: sh3_machdep.c
src/sys/arch/vax/vax: sig_machdep.c
src/sys/compat/common: compat_sigaltstack.h kern_sig_43.c
src/sys/compat/linux/arch/aarch64: linux_machdep.c
src/sys/compat/linux/arch/i386: linux_machdep.c
src/sys/compat/linux/common: linux_signal.c linux_signal.h
src/sys/compat/linux32/arch/amd64: linux32_machdep.c
src/sys/compat/linux32/common: linux32_signal.c linux32_signal.h
src/sys/compat/netbsd32: netbsd32_compat_43.c
src/sys/compat/sys: signalvar.h
src/sys/kern: sys_sig.c syscalls.master
src/sys/sys: signalvar.h

Log Message:
Use "stack_t" instead of "struct sigaltstack", as the former is the
newer standardized name.  NFC.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/aarch64/aarch64/netbsd32_machdep.c
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/aarch64/aarch64/sig_machdep.c
cvs rdiff -u -r1.138 -r1.139 src/sys/arch/amd64/amd64/netbsd32_machdep.c
cvs rdiff -u -r1.53 -r1.54 src/sys/arch/powerpc/powerpc/sig_machdep.c
cvs rdiff -u -r1.110 -r1.111 src/sys/arch/sh3/sh3/sh3_machdep.c
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/vax/vax/sig_machdep.c
cvs rdiff -u -r1.3 -r1.4 src/sys/compat/common/compat_sigaltstack.h
cvs rdiff -u -r1.37 -r1.38 src/sys/compat/common/kern_sig_43.c
cvs rdiff -u -r1.2 -r1.3 src/sys/compat/linux/arch/aarch64/linux_machdep.c
cvs rdiff -u -r1.168 -r1.169 src/sys/compat/linux/arch/i386/linux_machdep.c
cvs rdiff -u -r1.87 -r1.88 src/sys/compat/linux/common/linux_signal.c
cvs rdiff -u -r1.33 -r1.34 src/sys/compat/linux/common/linux_signal.h
cvs rdiff -u -r1.46 -r1.47 \
src/sys/compat/linux32/arch/amd64/linux32_machdep.c
cvs rdiff -u -r1.22 -r1.23 src/sys/compat/linux32/common/linux32_signal.c
cvs rdiff -u -r1.3 -r1.4 src/sys/compat/linux32/common/linux32_signal.h
cvs rdiff -u -r1.62 -r1.63 src/sys/compat/netbsd32/netbsd32_compat_43.c
cvs rdiff -u -r1.2 -r1.3 src/sys/compat/sys/signalvar.h
cvs rdiff -u -r1.53 -r1.54 src/sys/kern/sys_sig.c
cvs rdiff -u -r1.308 -r1.309 src/sys/kern/syscalls.master
cvs rdiff -u -r1.103 -r1.104 src/sys/sys/signalvar.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/aarch64/aarch64/netbsd32_machdep.c
diff -u src/sys/arch/aarch64/aarch64/netbsd32_machdep.c:1.20 src/sys/arch/aarch64/aarch64/netbsd32_machdep.c:1.21
--- src/sys/arch/aarch64/aarch64/netbsd32_machdep.c:1.20	Wed Oct 27 04:14:59 2021
+++ src/sys/arch/aarch64/aarch64/netbsd32_machdep.c	Mon Nov  1 05:07:15 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_machdep.c,v 1.20 2021/10/27 04:14:59 thorpej Exp $	*/
+/*	$NetBSD: netbsd32_machdep.c,v 1.21 2021/11/01 05:07:15 thorpej Exp $	*/
 
 /*
  * Copyright (c) 2018 Ryo Shimizu 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.20 2021/10/27 04:14:59 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.21 2021/11/01 05:07:15 thorpej Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_netbsd.h"
@@ -306,7 +306,7 @@ netbsd32_sendsig_siginfo(const ksiginfo_
 	struct lwp * const l = curlwp;
 	struct proc * const p = l->l_proc;
 	struct trapframe * const tf = lwp_trapframe(l);
-	struct sigaltstack * const ss = >l_sigstk;
+	stack_t * const ss = >l_sigstk;
 	const int signo = ksi->ksi_signo;
 	const struct sigaction * const sa = (p, signo);
 	const struct sigact_sigdesc * const sdesc =

Index: src/sys/arch/aarch64/aarch64/sig_machdep.c
diff -u src/sys/arch/aarch64/aarch64/sig_machdep.c:1.7 src/sys/arch/aarch64/aarch64/sig_machdep.c:1.8
--- src/sys/arch/aarch64/aarch64/sig_machdep.c:1.7	Wed Oct 27 04:14:59 2021
+++ src/sys/arch/aarch64/aarch64/sig_machdep.c	Mon Nov  1 05:07:15 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: sig_machdep.c,v 1.7 2021/10/27 04:14:59 thorpej Exp $ */
+/* $NetBSD: sig_machdep.c,v 1.8 2021/11/01 05:07:15 thorpej Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include 
 
-__KERNEL_RCSID(1, "$NetBSD: sig_machdep.c,v 1.7 2021/10/27 04:14:59 thorpej Exp $");
+__KERNEL_RCSID(1, "$NetBSD: sig_machdep.c,v 1.8 2021/11/01 05:07:15 thorpej Exp $");
 
 #include 
 #include 
@@ -48,7 +48,7 @@ sendsig_siginfo(const ksiginfo_t *ksi, c
 	struct lwp * const l = curlwp;
 	struct proc * const p = l->l_proc;
 	struct trapframe * const tf = lwp_trapframe(l);
-	struct sigaltstack * const ss = >l_sigstk;
+	stack_t * const ss = >l_sigstk;
 	const struct sigact_sigdesc * const sd =
 	>p_sigacts->sa_sigdesc[ksi->ksi_signo];
 

Index: src/sys/arch/amd64/amd64/netbsd32_machdep.c
diff -u src/sys/arch/amd64/amd64/netbsd32_machdep.c:1.138 

CVS commit: src

2021-10-31 Thread Alistair G. Crooks
Module Name:src
Committed By:   agc
Date:   Mon Nov  1 03:09:59 UTC 2021

Modified Files:
src/external/apache2/argon2/dist/phc-winner-argon2/src: argon2.c core.c
src/lib/libcrypt: Makefile

Log Message:
Remove the

COPTS.*+=   -Wno-error=.*

lines for building argon2 sources, by fixing the problems at source.

Addresses Rin Okuyama's concerns on tech-userlevel/tech-crypto in

Message-ID: 


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 \
src/external/apache2/argon2/dist/phc-winner-argon2/src/argon2.c
cvs rdiff -u -r1.2 -r1.3 \
src/external/apache2/argon2/dist/phc-winner-argon2/src/core.c
cvs rdiff -u -r1.32 -r1.33 src/lib/libcrypt/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/apache2/argon2/dist/phc-winner-argon2/src/argon2.c
diff -u src/external/apache2/argon2/dist/phc-winner-argon2/src/argon2.c:1.1 src/external/apache2/argon2/dist/phc-winner-argon2/src/argon2.c:1.2
--- src/external/apache2/argon2/dist/phc-winner-argon2/src/argon2.c:1.1	Wed Oct  9 13:13:09 2019
+++ src/external/apache2/argon2/dist/phc-winner-argon2/src/argon2.c	Mon Nov  1 03:09:59 2021
@@ -283,7 +283,7 @@ int argon2_verify(const char *encoded, c
 goto fail;
 }
 
-ctx.pwd = (uint8_t *)pwd;
+ctx.pwd = __UNCONST(pwd);
 ctx.pwdlen = (uint32_t)pwdlen;
 
 ret = decode_string(, encoded, type);
@@ -346,7 +346,7 @@ int argon2_verify_ctx(argon2_context *co
 return ret;
 }
 
-if (argon2_compare((uint8_t *)hash, context->out, context->outlen)) {
+if (argon2_compare((const uint8_t *)hash, context->out, context->outlen)) {
 return ARGON2_VERIFY_MISMATCH;
 }
 

Index: src/external/apache2/argon2/dist/phc-winner-argon2/src/core.c
diff -u src/external/apache2/argon2/dist/phc-winner-argon2/src/core.c:1.2 src/external/apache2/argon2/dist/phc-winner-argon2/src/core.c:1.3
--- src/external/apache2/argon2/dist/phc-winner-argon2/src/core.c:1.2	Sun Oct 17 10:44:21 2021
+++ src/external/apache2/argon2/dist/phc-winner-argon2/src/core.c	Mon Nov  1 03:09:59 2021
@@ -414,7 +414,7 @@ int validate_inputs(const argon2_context
 }
 }
 
-if (ARGON2_MIN_PWD_LENGTH > context->pwdlen) {
+if (ARGON2_MIN_PWD_LENGTH + 1 > context->pwdlen + 1) {
   return ARGON2_PWD_TOO_SHORT;
 }
 
@@ -443,7 +443,7 @@ int validate_inputs(const argon2_context
 return ARGON2_SECRET_PTR_MISMATCH;
 }
 } else {
-if (ARGON2_MIN_SECRET > context->secretlen) {
+if (ARGON2_MIN_SECRET + 1 > context->secretlen + 1) {
 return ARGON2_SECRET_TOO_SHORT;
 }
 if (ARGON2_MAX_SECRET < context->secretlen) {
@@ -457,7 +457,7 @@ int validate_inputs(const argon2_context
 return ARGON2_AD_PTR_MISMATCH;
 }
 } else {
-if (ARGON2_MIN_AD_LENGTH > context->adlen) {
+if (ARGON2_MIN_AD_LENGTH + 1 > context->adlen + 1) {
 return ARGON2_AD_TOO_SHORT;
 }
 if (ARGON2_MAX_AD_LENGTH < context->adlen) {
@@ -470,7 +470,7 @@ int validate_inputs(const argon2_context
 return ARGON2_MEMORY_TOO_LITTLE;
 }
 
-if (ARGON2_MAX_MEMORY < context->m_cost) {
+if (ARGON2_MAX_MEMORY - 1 < context->m_cost - 1) {
 return ARGON2_MEMORY_TOO_MUCH;
 }
 

Index: src/lib/libcrypt/Makefile
diff -u src/lib/libcrypt/Makefile:1.32 src/lib/libcrypt/Makefile:1.33
--- src/lib/libcrypt/Makefile:1.32	Sun Oct 31 09:16:08 2021
+++ src/lib/libcrypt/Makefile	Mon Nov  1 03:09:58 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.32 2021/10/31 09:16:08 nia Exp $
+#	$NetBSD: Makefile,v 1.33 2021/11/01 03:09:58 agc Exp $
 
 USE_FORT?=	yes	# cryptographic software
 
@@ -28,8 +28,6 @@ SRCS+=		crypt-argon2.c
 SRCS+=		${src}
 COPTS.${src}+=	-fvisibility=hidden
 .  endfor
-COPTS.argon2.c+=	-Wno-error=cast-qual
-COPTS.core.c+=		-Wno-error=type-limits
 .  if ${MACHINE} == "vax"
 COPTS.blake2b.c+=	-O0
 .  endif



CVS commit: src

2021-10-31 Thread Alistair G. Crooks
Module Name:src
Committed By:   agc
Date:   Mon Nov  1 03:09:59 UTC 2021

Modified Files:
src/external/apache2/argon2/dist/phc-winner-argon2/src: argon2.c core.c
src/lib/libcrypt: Makefile

Log Message:
Remove the

COPTS.*+=   -Wno-error=.*

lines for building argon2 sources, by fixing the problems at source.

Addresses Rin Okuyama's concerns on tech-userlevel/tech-crypto in

Message-ID: 


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 \
src/external/apache2/argon2/dist/phc-winner-argon2/src/argon2.c
cvs rdiff -u -r1.2 -r1.3 \
src/external/apache2/argon2/dist/phc-winner-argon2/src/core.c
cvs rdiff -u -r1.32 -r1.33 src/lib/libcrypt/Makefile

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



CVS commit: src/tests/usr.bin/indent

2021-10-31 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Oct 31 23:33:13 UTC 2021

Modified Files:
src/tests/usr.bin/indent: token_for_exprs.c

Log Message:
tests/indent: test formatting of 'CPU_INFO_FOREACH(cii, ci)'


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/usr.bin/indent/token_for_exprs.c

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

Modified files:

Index: src/tests/usr.bin/indent/token_for_exprs.c
diff -u src/tests/usr.bin/indent/token_for_exprs.c:1.1 src/tests/usr.bin/indent/token_for_exprs.c:1.2
--- src/tests/usr.bin/indent/token_for_exprs.c:1.1	Mon Oct 18 22:30:34 2021
+++ src/tests/usr.bin/indent/token_for_exprs.c	Sun Oct 31 23:33:12 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: token_for_exprs.c,v 1.1 2021/10/18 22:30:34 rillig Exp $ */
+/* $NetBSD: token_for_exprs.c,v 1.2 2021/10/31 23:33:12 rillig Exp $ */
 /* $FreeBSD$ */
 
 /*
@@ -56,3 +56,16 @@ function(void)
 #indent end
 
 #indent run-equals-input
+
+
+/*
+ * Another variant of a 'for' loop, seen in sys/arch/arm/apple/apple_intc.c.
+ */
+#indent input
+{
+	for (CPU_INFO_FOREACH(cii, ci)) {
+	}
+}
+#indent end
+
+#indent run-equals-input



CVS commit: src/tests/usr.bin/indent

2021-10-31 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Oct 31 23:33:13 UTC 2021

Modified Files:
src/tests/usr.bin/indent: token_for_exprs.c

Log Message:
tests/indent: test formatting of 'CPU_INFO_FOREACH(cii, ci)'


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/usr.bin/indent/token_for_exprs.c

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



CVS commit: src

2021-10-31 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Oct 31 23:15:44 UTC 2021

Modified Files:
src/tests/usr.bin/xlint/lint1: msg_348.c msg_348.exp
src/usr.bin/xlint/lint1: tree.c

Log Message:
lint: fix invalid memory access in array[enum] check

Lint checks whether in an expression 'array[enum]', the array size
matches the value of the maximum enum constant.

The previous tests for this check were missing the case where an enum
name was explicitly cast to an integer type and then used as an array
index. In this situation, the resulting type of the array index is a
plain 'int' without any information about its previous 'enum' history.

An entirely different case is when the 'enum' is implicitly converted to
an integer type, as in the test color_name_too_many. There, for the
final type of the array index, rn->tn_type->t_is_enum is true, which
means that rn->tn_type->t_enum is properly filled.

The bug was a simple typo, I had forgotten a tn_left indirection, which
is necessary to get the type before the implicit conversion.

Found and reported by Christos, triggered by src/lib/libperfuse/ops.c
1.89 line 1226 expression 'VTTOIF(vap->va_type)'.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/usr.bin/xlint/lint1/msg_348.c \
src/tests/usr.bin/xlint/lint1/msg_348.exp
cvs rdiff -u -r1.387 -r1.388 src/usr.bin/xlint/lint1/tree.c

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



CVS commit: src

2021-10-31 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Oct 31 23:15:44 UTC 2021

Modified Files:
src/tests/usr.bin/xlint/lint1: msg_348.c msg_348.exp
src/usr.bin/xlint/lint1: tree.c

Log Message:
lint: fix invalid memory access in array[enum] check

Lint checks whether in an expression 'array[enum]', the array size
matches the value of the maximum enum constant.

The previous tests for this check were missing the case where an enum
name was explicitly cast to an integer type and then used as an array
index. In this situation, the resulting type of the array index is a
plain 'int' without any information about its previous 'enum' history.

An entirely different case is when the 'enum' is implicitly converted to
an integer type, as in the test color_name_too_many. There, for the
final type of the array index, rn->tn_type->t_is_enum is true, which
means that rn->tn_type->t_enum is properly filled.

The bug was a simple typo, I had forgotten a tn_left indirection, which
is necessary to get the type before the implicit conversion.

Found and reported by Christos, triggered by src/lib/libperfuse/ops.c
1.89 line 1226 expression 'VTTOIF(vap->va_type)'.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/usr.bin/xlint/lint1/msg_348.c \
src/tests/usr.bin/xlint/lint1/msg_348.exp
cvs rdiff -u -r1.387 -r1.388 src/usr.bin/xlint/lint1/tree.c

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

Modified files:

Index: src/tests/usr.bin/xlint/lint1/msg_348.c
diff -u src/tests/usr.bin/xlint/lint1/msg_348.c:1.1 src/tests/usr.bin/xlint/lint1/msg_348.c:1.2
--- src/tests/usr.bin/xlint/lint1/msg_348.c:1.1	Sat Oct 30 22:04:42 2021
+++ src/tests/usr.bin/xlint/lint1/msg_348.c	Sun Oct 31 23:15:44 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg_348.c,v 1.1 2021/10/30 22:04:42 rillig Exp $	*/
+/*	$NetBSD: msg_348.c,v 1.2 2021/10/31 23:15:44 rillig Exp $	*/
 # 3 "msg_348.c"
 
 // Test for message 348: maximum value %d of '%s' does not match maximum array index %d [348]
@@ -72,6 +72,17 @@ color_name_cast_from_int(int c)
 }
 
 const char *
+color_name_explicit_cast_to_int(enum color color)
+{
+	static const char *name[] = {
+	"red",
+	"green",
+	};
+	/* expect+1: warning: maximum value 2 of 'enum color' does not match maximum array index 1 [348] */
+	return name[(int)color];
+}
+
+const char *
 color_name_computed_pointer(enum color color, const char *name)
 {
 	/* No warning since 'name' is not an array. */
Index: src/tests/usr.bin/xlint/lint1/msg_348.exp
diff -u src/tests/usr.bin/xlint/lint1/msg_348.exp:1.1 src/tests/usr.bin/xlint/lint1/msg_348.exp:1.2
--- src/tests/usr.bin/xlint/lint1/msg_348.exp:1.1	Sat Oct 30 22:04:42 2021
+++ src/tests/usr.bin/xlint/lint1/msg_348.exp	Sun Oct 31 23:15:44 2021
@@ -1,4 +1,5 @@
 msg_348.c(32): warning: maximum value 2 of 'enum color' does not match maximum array index 1 [348]
 msg_348.c(45): warning: maximum value 2 of 'enum color' does not match maximum array index 3 [348]
-msg_348.c(92): warning: integral constant too large [56]
-msg_348.c(94): warning: integral constant too large [56]
+msg_348.c(82): warning: maximum value 2 of 'enum color' does not match maximum array index 1 [348]
+msg_348.c(103): warning: integral constant too large [56]
+msg_348.c(105): warning: integral constant too large [56]

Index: src/usr.bin/xlint/lint1/tree.c
diff -u src/usr.bin/xlint/lint1/tree.c:1.387 src/usr.bin/xlint/lint1/tree.c:1.388
--- src/usr.bin/xlint/lint1/tree.c:1.387	Sun Oct 31 16:42:16 2021
+++ src/usr.bin/xlint/lint1/tree.c	Sun Oct 31 23:15:44 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: tree.c,v 1.387 2021/10/31 16:42:16 christos Exp $	*/
+/*	$NetBSD: tree.c,v 1.388 2021/10/31 23:15:44 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: tree.c,v 1.387 2021/10/31 16:42:16 christos Exp $");
+__RCSID("$NetBSD: tree.c,v 1.388 2021/10/31 23:15:44 rillig Exp $");
 #endif
 
 #include 
@@ -1793,12 +1793,9 @@ check_enum_array_index(const tnode_t *ln
 		return;
 	if (rn->tn_left->tn_type->t_tspec != ENUM)
 		return;
-	// XXX: why?
-	if (rn->tn_type->t_enum == NULL)
-		return;
 
 	max_enum_value = INT_MIN;
-	ec = rn->tn_type->t_enum->en_first_enumerator;
+	ec = rn->tn_left->tn_type->t_enum->en_first_enumerator;
 	for (; ec != NULL; ec = ec->s_next) {
 		int64_t ev = ec->s_value.v_quad;
 		lint_assert(INT_MIN <= ev && ev <= INT_MAX);
@@ -1811,7 +1808,8 @@ check_enum_array_index(const tnode_t *ln
 		return;
 
 	/* maximum value %d of '%s' does not match maximum array index %d */
-	warning(348, max_enum_value, type_name(rn->tn_type), max_array_index);
+	warning(348, max_enum_value, type_name(rn->tn_left->tn_type),
+	max_array_index);
 }
 
 /*



CVS commit: src/usr.bin/indent

2021-10-31 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Oct 31 22:38:12 UTC 2021

Modified Files:
src/usr.bin/indent: args.c indent.c indent.h lexi.c

Log Message:
indent: clean up

Initialize buffers in reading order, make comments more expressive,
rename add_typename to register_typename, remove unused macro.

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.67 -r1.68 src/usr.bin/indent/args.c
cvs rdiff -u -r1.202 -r1.203 src/usr.bin/indent/indent.c
cvs rdiff -u -r1.73 -r1.74 src/usr.bin/indent/indent.h
cvs rdiff -u -r1.127 -r1.128 src/usr.bin/indent/lexi.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/indent/args.c
diff -u src/usr.bin/indent/args.c:1.67 src/usr.bin/indent/args.c:1.68
--- src/usr.bin/indent/args.c:1.67	Fri Oct 29 19:52:59 2021
+++ src/usr.bin/indent/args.c	Sun Oct 31 22:38:12 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: args.c,v 1.67 2021/10/29 19:52:59 rillig Exp $	*/
+/*	$NetBSD: args.c,v 1.68 2021/10/31 22:38:12 rillig Exp $	*/
 
 /*-
  * SPDX-License-Identifier: BSD-4-Clause
@@ -43,7 +43,7 @@ static char sccsid[] = "@(#)args.c	8.1 (
 
 #include 
 #if defined(__NetBSD__)
-__RCSID("$NetBSD: args.c,v 1.67 2021/10/29 19:52:59 rillig Exp $");
+__RCSID("$NetBSD: args.c,v 1.68 2021/10/31 22:38:12 rillig Exp $");
 #elif defined(__FreeBSD__)
 __FBSDID("$FreeBSD: head/usr.bin/indent/args.c 336318 2018-07-15 21:04:21Z pstef $");
 #endif
@@ -142,7 +142,7 @@ add_typedefs_from_file(const char *fname
 while ((fgets(line, BUFSIZ, file)) != NULL) {
 	/* Remove trailing whitespace */
 	line[strcspn(line, " \t\n\r")] = '\0';
-	add_typename(line);
+	register_typename(line);
 }
 (void)fclose(file);
 }
@@ -184,7 +184,7 @@ set_special_option(const char *arg, cons
 	arg_end = arg + 1;
 	if (arg_end[0] == '\0')
 	goto need_param;
-	add_typename(arg_end);
+	register_typename(arg_end);
 	return true;
 }
 

Index: src/usr.bin/indent/indent.c
diff -u src/usr.bin/indent/indent.c:1.202 src/usr.bin/indent/indent.c:1.203
--- src/usr.bin/indent/indent.c:1.202	Sun Oct 31 21:43:43 2021
+++ src/usr.bin/indent/indent.c	Sun Oct 31 22:38:12 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: indent.c,v 1.202 2021/10/31 21:43:43 rillig Exp $	*/
+/*	$NetBSD: indent.c,v 1.203 2021/10/31 22:38:12 rillig Exp $	*/
 
 /*-
  * SPDX-License-Identifier: BSD-4-Clause
@@ -43,7 +43,7 @@ static char sccsid[] = "@(#)indent.c	5.1
 
 #include 
 #if defined(__NetBSD__)
-__RCSID("$NetBSD: indent.c,v 1.202 2021/10/31 21:43:43 rillig Exp $");
+__RCSID("$NetBSD: indent.c,v 1.203 2021/10/31 22:38:12 rillig Exp $");
 #elif defined(__FreeBSD__)
 __FBSDID("$FreeBSD: head/usr.bin/indent/indent.c 340138 2018-11-04 19:24:49Z oshogbo $");
 #endif
@@ -507,9 +507,9 @@ main_init_globals(void)
 
 buf_init();
 
-buf_init();
 buf_init();
 buf_init();
+buf_init();
 
 ps.s_sym[0] = psym_stmt_list;
 ps.prev_token = lsym_semicolon;

Index: src/usr.bin/indent/indent.h
diff -u src/usr.bin/indent/indent.h:1.73 src/usr.bin/indent/indent.h:1.74
--- src/usr.bin/indent/indent.h:1.73	Sun Oct 31 20:40:42 2021
+++ src/usr.bin/indent/indent.h	Sun Oct 31 22:38:12 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: indent.h,v 1.73 2021/10/31 20:40:42 rillig Exp $	*/
+/*	$NetBSD: indent.h,v 1.74 2021/10/31 22:38:12 rillig Exp $	*/
 
 /*-
  * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
@@ -76,14 +76,14 @@ typedef enum lexer_symbol {
 lsym_preprocessing,		/* '#' */
 lsym_newline,
 lsym_form_feed,
-lsym_comment,		/* the initial '/' '*' or '//' of a comment */
+lsym_comment,		/* the initial '/ *' or '//' of a comment */
 lsym_lparen_or_lbracket,
 lsym_rparen_or_rbracket,
 lsym_lbrace,
 lsym_rbrace,
 lsym_period,
-lsym_unary_op,		/* e.g. '+' or '&' */
-lsym_binary_op,		/* e.g. '<<' or '+' or '&&' or '/=' */
+lsym_unary_op,		/* e.g. '*', '&', '-' or leading '++' */
+lsym_binary_op,		/* e.g. '*', '&', '<<', '&&' or '/=' */
 lsym_postfix_op,		/* trailing '++' or '--' */
 lsym_question,		/* the '?' from a '?:' expression */
 lsym_colon,
@@ -360,7 +360,7 @@ void debug_println(const char *, ...)__p
 #define		debug_vis_range(prefix, s, e, suffix) do { } while (false)
 #endif
 
-void add_typename(const char *);
+void register_typename(const char *);
 int compute_code_indent(void);
 int compute_label_indent(void);
 int indentation_after_range(int, const char *, const char *);

Index: src/usr.bin/indent/lexi.c
diff -u src/usr.bin/indent/lexi.c:1.127 src/usr.bin/indent/lexi.c:1.128
--- src/usr.bin/indent/lexi.c:1.127	Sun Oct 31 20:59:26 2021
+++ src/usr.bin/indent/lexi.c	Sun Oct 31 22:38:12 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: lexi.c,v 1.127 2021/10/31 20:59:26 rillig Exp $	*/
+/*	$NetBSD: lexi.c,v 1.128 2021/10/31 22:38:12 rillig Exp $	*/
 
 /*-
  * SPDX-License-Identifier: BSD-4-Clause
@@ -43,7 +43,7 @@ static char sccsid[] = "@(#)lexi.c	8.1 (
 
 #include 
 #if 

CVS commit: src/usr.bin/indent

2021-10-31 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Oct 31 22:38:12 UTC 2021

Modified Files:
src/usr.bin/indent: args.c indent.c indent.h lexi.c

Log Message:
indent: clean up

Initialize buffers in reading order, make comments more expressive,
rename add_typename to register_typename, remove unused macro.

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.67 -r1.68 src/usr.bin/indent/args.c
cvs rdiff -u -r1.202 -r1.203 src/usr.bin/indent/indent.c
cvs rdiff -u -r1.73 -r1.74 src/usr.bin/indent/indent.h
cvs rdiff -u -r1.127 -r1.128 src/usr.bin/indent/lexi.c

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



CVS commit: src/lib/libc

2021-10-31 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sun Oct 31 22:24:36 UTC 2021

Modified Files:
src/lib/libc/arch/aarch64: Makefile.inc
src/lib/libc/arch/alpha: Makefile.inc
src/lib/libc/arch/arm: Makefile.inc
src/lib/libc/arch/hppa: Makefile.inc
src/lib/libc/arch/i386: Makefile.inc
src/lib/libc/arch/ia64: Makefile.inc
src/lib/libc/arch/m68k: Makefile.inc
src/lib/libc/arch/mips: Makefile.inc
src/lib/libc/arch/or1k: Makefile.inc
src/lib/libc/arch/powerpc: Makefile.inc
src/lib/libc/arch/powerpc64: Makefile.inc
src/lib/libc/arch/riscv: Makefile.inc
src/lib/libc/arch/sh3: Makefile.inc
src/lib/libc/arch/sparc: Makefile.inc
src/lib/libc/arch/sparc64: Makefile.inc
src/lib/libc/arch/vax: Makefile.inc
src/lib/libc/arch/x86_64: Makefile.inc
src/lib/libc/sys: Makefile.inc

Log Message:
Tidy up how __sigaction14_sigtramp.c is added to SRCS.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/lib/libc/arch/aarch64/Makefile.inc
cvs rdiff -u -r1.20 -r1.21 src/lib/libc/arch/alpha/Makefile.inc
cvs rdiff -u -r1.28 -r1.29 src/lib/libc/arch/arm/Makefile.inc
cvs rdiff -u -r1.10 -r1.11 src/lib/libc/arch/hppa/Makefile.inc
cvs rdiff -u -r1.22 -r1.23 src/lib/libc/arch/i386/Makefile.inc
cvs rdiff -u -r1.3 -r1.4 src/lib/libc/arch/ia64/Makefile.inc
cvs rdiff -u -r1.17 -r1.18 src/lib/libc/arch/m68k/Makefile.inc
cvs rdiff -u -r1.15 -r1.16 src/lib/libc/arch/mips/Makefile.inc
cvs rdiff -u -r1.2 -r1.3 src/lib/libc/arch/or1k/Makefile.inc
cvs rdiff -u -r1.14 -r1.15 src/lib/libc/arch/powerpc/Makefile.inc
cvs rdiff -u -r1.3 -r1.4 src/lib/libc/arch/powerpc64/Makefile.inc
cvs rdiff -u -r1.1 -r1.2 src/lib/libc/arch/riscv/Makefile.inc
cvs rdiff -u -r1.7 -r1.8 src/lib/libc/arch/sh3/Makefile.inc
cvs rdiff -u -r1.15 -r1.16 src/lib/libc/arch/sparc/Makefile.inc
cvs rdiff -u -r1.20 -r1.21 src/lib/libc/arch/sparc64/Makefile.inc
cvs rdiff -u -r1.9 -r1.10 src/lib/libc/arch/vax/Makefile.inc
cvs rdiff -u -r1.7 -r1.8 src/lib/libc/arch/x86_64/Makefile.inc
cvs rdiff -u -r1.248 -r1.249 src/lib/libc/sys/Makefile.inc

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

Modified files:

Index: src/lib/libc/arch/aarch64/Makefile.inc
diff -u src/lib/libc/arch/aarch64/Makefile.inc:1.2 src/lib/libc/arch/aarch64/Makefile.inc:1.3
--- src/lib/libc/arch/aarch64/Makefile.inc:1.2	Wed Apr 15 19:13:46 2015
+++ src/lib/libc/arch/aarch64/Makefile.inc	Sun Oct 31 22:24:34 2021
@@ -1,6 +1,6 @@
-# $NetBSD: Makefile.inc,v 1.2 2015/04/15 19:13:46 mrg Exp $
+# $NetBSD: Makefile.inc,v 1.3 2021/10/31 22:24:34 thorpej Exp $
 
-SRCS+=	__sigaction14_sigtramp.c __sigtramp2.S
+SRCS+=	__sigtramp2.S
 #SRCS+= qdivrem.c
 
 CPPFLAGS += -I.

Index: src/lib/libc/arch/alpha/Makefile.inc
diff -u src/lib/libc/arch/alpha/Makefile.inc:1.20 src/lib/libc/arch/alpha/Makefile.inc:1.21
--- src/lib/libc/arch/alpha/Makefile.inc:1.20	Sun Oct 26 07:43:07 2008
+++ src/lib/libc/arch/alpha/Makefile.inc	Sun Oct 31 22:24:34 2021
@@ -1,7 +1,7 @@
-#	$NetBSD: Makefile.inc,v 1.20 2008/10/26 07:43:07 mrg Exp $
+#	$NetBSD: Makefile.inc,v 1.21 2021/10/31 22:24:34 thorpej Exp $
 
 SRCS+=	__longjmp14.c
-SRCS+=	__sigaction14_sigtramp.c __sigtramp2.S
+SRCS+=	__sigtramp2.S
 
 # `source' files built from m4 source
 SRCS+=	__divqu.S __divq.S __divlu.S __divl.S

Index: src/lib/libc/arch/arm/Makefile.inc
diff -u src/lib/libc/arch/arm/Makefile.inc:1.28 src/lib/libc/arch/arm/Makefile.inc:1.29
--- src/lib/libc/arch/arm/Makefile.inc:1.28	Thu Aug 20 16:13:40 2015
+++ src/lib/libc/arch/arm/Makefile.inc	Sun Oct 31 22:24:34 2021
@@ -1,9 +1,9 @@
-# $NetBSD: Makefile.inc,v 1.28 2015/08/20 16:13:40 pooka Exp $
+# $NetBSD: Makefile.inc,v 1.29 2021/10/31 22:24:34 thorpej Exp $
 
 .include 
 
 .if ${RUMPRUN} != "yes"
-SRCS+=	__aeabi_read_tp.S __sigaction14_sigtramp.c __sigtramp2.S
+SRCS+=	__aeabi_read_tp.S __sigtramp2.S
 .endif
 
 .if empty(LIBC_MACHINE_ARCH:Mearmv7*)

Index: src/lib/libc/arch/hppa/Makefile.inc
diff -u src/lib/libc/arch/hppa/Makefile.inc:1.10 src/lib/libc/arch/hppa/Makefile.inc:1.11
--- src/lib/libc/arch/hppa/Makefile.inc:1.10	Wed Feb 19 13:01:51 2014
+++ src/lib/libc/arch/hppa/Makefile.inc	Sun Oct 31 22:24:34 2021
@@ -1,8 +1,8 @@
-#	$NetBSD: Makefile.inc,v 1.10 2014/02/19 13:01:51 skrll Exp $
+#	$NetBSD: Makefile.inc,v 1.11 2021/10/31 22:24:34 thorpej Exp $
 
 #	$OpenBSD: Makefile.inc,v 1.3 1999/12/25 06:02:10 mickey Exp $
 
-SRCS+=	__sigaction14_sigtramp.c __sigtramp2.S
+SRCS+=	__sigtramp2.S
 
 SRCS+= bcopy.c
 

Index: src/lib/libc/arch/i386/Makefile.inc
diff -u src/lib/libc/arch/i386/Makefile.inc:1.22 src/lib/libc/arch/i386/Makefile.inc:1.23
--- src/lib/libc/arch/i386/Makefile.inc:1.22	Mon Oct 12 23:56:08 2020
+++ src/lib/libc/arch/i386/Makefile.inc	Sun Oct 31 22:24:34 2021
@@ -1,7 +1,7 @@
-#	$NetBSD: Makefile.inc,v 1.22 2020/10/12 23:56:08 kamil Exp $
+#	$NetBSD: Makefile.inc,v 1.23 2021/10/31 

CVS commit: src/lib/libc

2021-10-31 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sun Oct 31 22:24:36 UTC 2021

Modified Files:
src/lib/libc/arch/aarch64: Makefile.inc
src/lib/libc/arch/alpha: Makefile.inc
src/lib/libc/arch/arm: Makefile.inc
src/lib/libc/arch/hppa: Makefile.inc
src/lib/libc/arch/i386: Makefile.inc
src/lib/libc/arch/ia64: Makefile.inc
src/lib/libc/arch/m68k: Makefile.inc
src/lib/libc/arch/mips: Makefile.inc
src/lib/libc/arch/or1k: Makefile.inc
src/lib/libc/arch/powerpc: Makefile.inc
src/lib/libc/arch/powerpc64: Makefile.inc
src/lib/libc/arch/riscv: Makefile.inc
src/lib/libc/arch/sh3: Makefile.inc
src/lib/libc/arch/sparc: Makefile.inc
src/lib/libc/arch/sparc64: Makefile.inc
src/lib/libc/arch/vax: Makefile.inc
src/lib/libc/arch/x86_64: Makefile.inc
src/lib/libc/sys: Makefile.inc

Log Message:
Tidy up how __sigaction14_sigtramp.c is added to SRCS.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/lib/libc/arch/aarch64/Makefile.inc
cvs rdiff -u -r1.20 -r1.21 src/lib/libc/arch/alpha/Makefile.inc
cvs rdiff -u -r1.28 -r1.29 src/lib/libc/arch/arm/Makefile.inc
cvs rdiff -u -r1.10 -r1.11 src/lib/libc/arch/hppa/Makefile.inc
cvs rdiff -u -r1.22 -r1.23 src/lib/libc/arch/i386/Makefile.inc
cvs rdiff -u -r1.3 -r1.4 src/lib/libc/arch/ia64/Makefile.inc
cvs rdiff -u -r1.17 -r1.18 src/lib/libc/arch/m68k/Makefile.inc
cvs rdiff -u -r1.15 -r1.16 src/lib/libc/arch/mips/Makefile.inc
cvs rdiff -u -r1.2 -r1.3 src/lib/libc/arch/or1k/Makefile.inc
cvs rdiff -u -r1.14 -r1.15 src/lib/libc/arch/powerpc/Makefile.inc
cvs rdiff -u -r1.3 -r1.4 src/lib/libc/arch/powerpc64/Makefile.inc
cvs rdiff -u -r1.1 -r1.2 src/lib/libc/arch/riscv/Makefile.inc
cvs rdiff -u -r1.7 -r1.8 src/lib/libc/arch/sh3/Makefile.inc
cvs rdiff -u -r1.15 -r1.16 src/lib/libc/arch/sparc/Makefile.inc
cvs rdiff -u -r1.20 -r1.21 src/lib/libc/arch/sparc64/Makefile.inc
cvs rdiff -u -r1.9 -r1.10 src/lib/libc/arch/vax/Makefile.inc
cvs rdiff -u -r1.7 -r1.8 src/lib/libc/arch/x86_64/Makefile.inc
cvs rdiff -u -r1.248 -r1.249 src/lib/libc/sys/Makefile.inc

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



CVS commit: src/sys/arch/aarch64/include

2021-10-31 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Oct 31 22:06:32 UTC 2021

Modified Files:
src/sys/arch/aarch64/include: db_machdep.h

Log Message:
Fix crash(8) build


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/aarch64/include/db_machdep.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/aarch64/include/db_machdep.h
diff -u src/sys/arch/aarch64/include/db_machdep.h:1.15 src/sys/arch/aarch64/include/db_machdep.h:1.16
--- src/sys/arch/aarch64/include/db_machdep.h:1.15	Sun Oct 31 16:23:47 2021
+++ src/sys/arch/aarch64/include/db_machdep.h	Sun Oct 31 22:06:32 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: db_machdep.h,v 1.15 2021/10/31 16:23:47 skrll Exp $ */
+/* $NetBSD: db_machdep.h,v 1.16 2021/10/31 22:06:32 skrll Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -221,12 +221,6 @@ db_addr_t db_branch_taken(db_expr_t, db_
 void db_pteinfo(vaddr_t, void (*)(const char *, ...) __printflike(1, 2));
 void db_pte_print(pt_entry_t, int, void (*)(const char *, ...) __printflike(1, 2));
 void db_ttbrdump(bool, vaddr_t, void (*pr)(const char *, ...) __printflike(1, 2));
-#endif
-
-void dump_trapframe(struct trapframe *, void (*)(const char *, ...) __printflike(1, 2));
-
-void dump_switchframe(struct trapframe *, void (*)(const char *, ...) __printflike(1, 2));
-const char *strdisasm(vaddr_t, uint64_t);
 void db_machdep_cpu_init(void);
 void db_machdep_init(struct cpu_info * const);
 
@@ -237,6 +231,12 @@ void aarch64_watchpoint_set(int, vaddr_t
 #define WATCHPOINT_ACCESS_STORE		0x02
 #define WATCHPOINT_ACCESS_LOADSTORE	0x03
 #define WATCHPOINT_ACCESS_MASK		0x03
+#endif
+
+void dump_trapframe(struct trapframe *, void (*)(const char *, ...) __printflike(1, 2));
+
+void dump_switchframe(struct trapframe *, void (*)(const char *, ...) __printflike(1, 2));
+const char *strdisasm(vaddr_t, uint64_t);
 
 #define DB_ELF_SYMBOLS
 



CVS commit: src/sys/arch/aarch64/include

2021-10-31 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Oct 31 22:06:32 UTC 2021

Modified Files:
src/sys/arch/aarch64/include: db_machdep.h

Log Message:
Fix crash(8) build


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/aarch64/include/db_machdep.h

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



CVS commit: src

2021-10-31 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Oct 31 21:43:43 UTC 2021

Modified Files:
src/tests/usr.bin/indent: opt_pcs.c
src/usr.bin/indent: indent.c

Log Message:
indent: for '-pcs', add blank between function and '('

Before indent-2021.09.30.21.48.12, the blank had always been added, even
in '-npcs' mode. Since then, the blank had never been added.

Now, add the blank in '-pcs' mode and omit it in '-npcs' mode.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/tests/usr.bin/indent/opt_pcs.c
cvs rdiff -u -r1.201 -r1.202 src/usr.bin/indent/indent.c

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

Modified files:

Index: src/tests/usr.bin/indent/opt_pcs.c
diff -u src/tests/usr.bin/indent/opt_pcs.c:1.7 src/tests/usr.bin/indent/opt_pcs.c:1.8
--- src/tests/usr.bin/indent/opt_pcs.c:1.7	Sun Oct 31 21:31:55 2021
+++ src/tests/usr.bin/indent/opt_pcs.c	Sun Oct 31 21:43:43 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: opt_pcs.c,v 1.7 2021/10/31 21:31:55 rillig Exp $ */
+/* $NetBSD: opt_pcs.c,v 1.8 2021/10/31 21:43:43 rillig Exp $ */
 /* $FreeBSD$ */
 
 /*
@@ -47,15 +47,16 @@ void ( * signal ( void ( * handler ) ( i
 int var = (function)(arg);
 #indent end
 
-/* TODO: add a blank between ')' and '('. */
 #indent run -npsl -di0 -pcs
+void (*signal(void (*handler) (int))) (int);
+int var = (function) (arg);
+#indent end
+
+#indent run -npsl -di0 -npcs
 void (*signal(void (*handler)(int)))(int);
 int var = (function)(arg);
 #indent end
 
-#indent run-equals-prev-output -npsl -di0 -npcs
-
-
 /*
  * The option '-pcs' also applies to 'sizeof' and 'offsetof', even though
  * these are not functions.

Index: src/usr.bin/indent/indent.c
diff -u src/usr.bin/indent/indent.c:1.201 src/usr.bin/indent/indent.c:1.202
--- src/usr.bin/indent/indent.c:1.201	Sun Oct 31 20:40:42 2021
+++ src/usr.bin/indent/indent.c	Sun Oct 31 21:43:43 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: indent.c,v 1.201 2021/10/31 20:40:42 rillig Exp $	*/
+/*	$NetBSD: indent.c,v 1.202 2021/10/31 21:43:43 rillig Exp $	*/
 
 /*-
  * SPDX-License-Identifier: BSD-4-Clause
@@ -43,7 +43,7 @@ static char sccsid[] = "@(#)indent.c	5.1
 
 #include 
 #if defined(__NetBSD__)
-__RCSID("$NetBSD: indent.c,v 1.201 2021/10/31 20:40:42 rillig Exp $");
+__RCSID("$NetBSD: indent.c,v 1.202 2021/10/31 21:43:43 rillig Exp $");
 #elif defined(__FreeBSD__)
 __FBSDID("$FreeBSD: head/usr.bin/indent/indent.c 340138 2018-11-04 19:24:49Z oshogbo $");
 #endif
@@ -739,17 +739,17 @@ want_blank_before_lparen(void)
 {
 if (!ps.want_blank)
 	return false;
+if (opt.proc_calls_space)
+	return true;
 if (ps.prev_token == lsym_rparen_or_rbracket)
 	return false;
 if (ps.prev_token == lsym_offsetof)
-	return opt.proc_calls_space;
+	return false;
 if (ps.prev_token == lsym_sizeof)
-	return opt.proc_calls_space || opt.blank_after_sizeof;
-if (ps.prev_token != lsym_ident && ps.prev_token != lsym_funcname)
-	return true;
-if (opt.proc_calls_space)
-	return true;
-return ps.prev_is_type;
+	return opt.blank_after_sizeof;
+if (ps.prev_token == lsym_ident || ps.prev_token == lsym_funcname)
+	return ps.prev_is_type;
+return true;
 }
 
 static void



CVS commit: src

2021-10-31 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Oct 31 21:43:43 UTC 2021

Modified Files:
src/tests/usr.bin/indent: opt_pcs.c
src/usr.bin/indent: indent.c

Log Message:
indent: for '-pcs', add blank between function and '('

Before indent-2021.09.30.21.48.12, the blank had always been added, even
in '-npcs' mode. Since then, the blank had never been added.

Now, add the blank in '-pcs' mode and omit it in '-npcs' mode.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/tests/usr.bin/indent/opt_pcs.c
cvs rdiff -u -r1.201 -r1.202 src/usr.bin/indent/indent.c

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



CVS commit: src/tests/usr.bin/indent

2021-10-31 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Oct 31 21:31:55 UTC 2021

Modified Files:
src/tests/usr.bin/indent: opt_pcs.c

Log Message:
tests/indent: test function declaration with '-pcs' and '-npcs'

The conditions in want_blank_before_lparen are not ordered correctly.
opt.proc_calls_space should override ')('.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/tests/usr.bin/indent/opt_pcs.c

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

Modified files:

Index: src/tests/usr.bin/indent/opt_pcs.c
diff -u src/tests/usr.bin/indent/opt_pcs.c:1.6 src/tests/usr.bin/indent/opt_pcs.c:1.7
--- src/tests/usr.bin/indent/opt_pcs.c:1.6	Sun Oct 31 21:06:56 2021
+++ src/tests/usr.bin/indent/opt_pcs.c	Sun Oct 31 21:31:55 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: opt_pcs.c,v 1.6 2021/10/31 21:06:56 rillig Exp $ */
+/* $NetBSD: opt_pcs.c,v 1.7 2021/10/31 21:31:55 rillig Exp $ */
 /* $FreeBSD$ */
 
 /*
@@ -43,12 +43,17 @@ example(void)
 
 
 #indent input
+void ( * signal ( void ( * handler ) ( int ) ) ) ( int ) ;
 int var = (function)(arg);
 #indent end
 
-/* TODO: add space between the parentheses. */
-#indent run-equals-input -di0 -pcs
-#indent run-equals-input -di0 -npcs
+/* TODO: add a blank between ')' and '('. */
+#indent run -npsl -di0 -pcs
+void (*signal(void (*handler)(int)))(int);
+int var = (function)(arg);
+#indent end
+
+#indent run-equals-prev-output -npsl -di0 -npcs
 
 
 /*



CVS commit: src/tests/usr.bin/indent

2021-10-31 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Oct 31 21:31:55 UTC 2021

Modified Files:
src/tests/usr.bin/indent: opt_pcs.c

Log Message:
tests/indent: test function declaration with '-pcs' and '-npcs'

The conditions in want_blank_before_lparen are not ordered correctly.
opt.proc_calls_space should override ')('.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/tests/usr.bin/indent/opt_pcs.c

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



Re: CVS commit: src/sys/arch

2021-10-31 Thread Tobias Nygren
On Sun, 31 Oct 2021 16:23:48 +
Nick Hudson  wrote:

> Modified Files:
>   src/sys/arch/aarch64/include: cpu.h cpufunc.h db_machdep.h
...
> Log Message:
> Rework Arm (32bit and 64bit) AP startup so that cpu_hatch doesn't sleep.

Hi,

I'm afraid this broke the userland build.
I think db_machdep_init(...) should move to the ifdef _KERNEL block?

   compile  crash/db_autoconf.o
In file included from /usr/src/../obj/usr.sbin/crash/machine/db_machdep.h:4,
 from /usr/src/usr.sbin/crash/../../sys/ddb/ddb.h:35,
 from /usr/src/usr.sbin/crash/../../sys/ddb/db_autoconf.c:39:
/usr/src/../obj/usr.sbin/crash/aarch64/db_machdep.h:231:29: error: 'struct 
cpu_info' declared inside parameter list will not be visible outside of this 
definition or declaration [-Werror]
  231 | void db_machdep_init(struct cpu_info * const);

-Tobias


CVS commit: src/tests/usr.bin/indent

2021-10-31 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Oct 31 21:06:56 UTC 2021

Modified Files:
src/tests/usr.bin/indent: opt_pcs.c

Log Message:
tests/indent: test indirect function call with '-pcs' and '-npcs'


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/tests/usr.bin/indent/opt_pcs.c

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

Modified files:

Index: src/tests/usr.bin/indent/opt_pcs.c
diff -u src/tests/usr.bin/indent/opt_pcs.c:1.5 src/tests/usr.bin/indent/opt_pcs.c:1.6
--- src/tests/usr.bin/indent/opt_pcs.c:1.5	Sun Oct 24 11:42:57 2021
+++ src/tests/usr.bin/indent/opt_pcs.c	Sun Oct 31 21:06:56 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: opt_pcs.c,v 1.5 2021/10/24 11:42:57 rillig Exp $ */
+/* $NetBSD: opt_pcs.c,v 1.6 2021/10/31 21:06:56 rillig Exp $ */
 /* $FreeBSD$ */
 
 /*
@@ -41,6 +41,16 @@ example(void)
 }
 #indent end
 
+
+#indent input
+int var = (function)(arg);
+#indent end
+
+/* TODO: add space between the parentheses. */
+#indent run-equals-input -di0 -pcs
+#indent run-equals-input -di0 -npcs
+
+
 /*
  * The option '-pcs' also applies to 'sizeof' and 'offsetof', even though
  * these are not functions.



CVS commit: src/tests/usr.bin/indent

2021-10-31 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Oct 31 21:06:56 UTC 2021

Modified Files:
src/tests/usr.bin/indent: opt_pcs.c

Log Message:
tests/indent: test indirect function call with '-pcs' and '-npcs'


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/tests/usr.bin/indent/opt_pcs.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/indent

2021-10-31 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Oct 31 20:59:26 UTC 2021

Modified Files:
src/usr.bin/indent: lexi.c

Log Message:
indent: remove redundant keyword.is_type

It is still confusing that not all type keywords end up as lsym_type.
Those that occur inside parentheses end up as identifiers instead. To
see whether an identifier is a typename, query ps.curr_is_type and
ps.prev_is_type.

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.126 -r1.127 src/usr.bin/indent/lexi.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/indent

2021-10-31 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Oct 31 20:59:26 UTC 2021

Modified Files:
src/usr.bin/indent: lexi.c

Log Message:
indent: remove redundant keyword.is_type

It is still confusing that not all type keywords end up as lsym_type.
Those that occur inside parentheses end up as identifiers instead. To
see whether an identifier is a typename, query ps.curr_is_type and
ps.prev_is_type.

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.126 -r1.127 src/usr.bin/indent/lexi.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/indent/lexi.c
diff -u src/usr.bin/indent/lexi.c:1.126 src/usr.bin/indent/lexi.c:1.127
--- src/usr.bin/indent/lexi.c:1.126	Sun Oct 31 20:40:42 2021
+++ src/usr.bin/indent/lexi.c	Sun Oct 31 20:59:26 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: lexi.c,v 1.126 2021/10/31 20:40:42 rillig Exp $	*/
+/*	$NetBSD: lexi.c,v 1.127 2021/10/31 20:59:26 rillig Exp $	*/
 
 /*-
  * SPDX-License-Identifier: BSD-4-Clause
@@ -43,7 +43,7 @@ static char sccsid[] = "@(#)lexi.c	8.1 (
 
 #include 
 #if defined(__NetBSD__)
-__RCSID("$NetBSD: lexi.c,v 1.126 2021/10/31 20:40:42 rillig Exp $");
+__RCSID("$NetBSD: lexi.c,v 1.127 2021/10/31 20:59:26 rillig Exp $");
 #elif defined(__FreeBSD__)
 __FBSDID("$FreeBSD: head/usr.bin/indent/lexi.c 337862 2018-08-15 18:19:45Z pstef $");
 #endif
@@ -51,57 +51,61 @@ __FBSDID("$FreeBSD: head/usr.bin/indent/
 #include 
 #include 
 #include 
-#include 
 
 #include "indent.h"
 
+/*
+ * While inside lexi_alnum, this constant just marks a type, independently of
+ * the parentheses level.
+ */
+#define lsym_type lsym_type_at_paren_level_0
+
 /* must be sorted alphabetically, is used in binary search */
 static const struct keyword {
 const char *name;
 lexer_symbol lsym;
-bool is_type;
 } keywords[] = {
-{"_Bool", lsym_eof, true},
-{"_Complex", lsym_eof, true},
-{"_Imaginary", lsym_eof, true},
-{"auto", lsym_storage_class, false},
-{"bool", lsym_eof, true},
-{"break", lsym_ident, false},
-{"case", lsym_case_label, false},
-{"char", lsym_eof, true},
-{"complex", lsym_eof, true},
-{"const", lsym_eof, true},
-{"continue", lsym_ident, false},
-{"default", lsym_case_label, false},
-{"do", lsym_do, false},
-{"double", lsym_eof, true},
-{"else", lsym_else, false},
-{"enum", lsym_tag, false},
-{"extern", lsym_storage_class, false},
-{"float", lsym_eof, true},
-{"for", lsym_for, false},
-{"goto", lsym_ident, false},
-{"if", lsym_if, false},
-{"imaginary", lsym_eof, true},
-{"inline", lsym_ident, false},
-{"int", lsym_eof, true},
-{"long", lsym_eof, true},
-{"offsetof", lsym_offsetof, false},
-{"register", lsym_storage_class, false},
-{"restrict", lsym_ident, false},
-{"return", lsym_ident, false},
-{"short", lsym_eof, true},
-{"signed", lsym_eof, true},
-{"sizeof", lsym_sizeof, false},
-{"static", lsym_storage_class, false},
-{"struct", lsym_tag, false},
-{"switch", lsym_switch, false},
-{"typedef", lsym_typedef, false},
-{"union", lsym_tag, false},
-{"unsigned", lsym_eof, true},
-{"void", lsym_eof, true},
-{"volatile", lsym_eof, true},
-{"while", lsym_while, false}
+{"_Bool", lsym_type},
+{"_Complex", lsym_type},
+{"_Imaginary", lsym_type},
+{"auto", lsym_storage_class},
+{"bool", lsym_type},
+{"break", lsym_ident},
+{"case", lsym_case_label},
+{"char", lsym_type},
+{"complex", lsym_type},
+{"const", lsym_type},
+{"continue", lsym_ident},
+{"default", lsym_case_label},
+{"do", lsym_do},
+{"double", lsym_type},
+{"else", lsym_else},
+{"enum", lsym_tag},
+{"extern", lsym_storage_class},
+{"float", lsym_type},
+{"for", lsym_for},
+{"goto", lsym_ident},
+{"if", lsym_if},
+{"imaginary", lsym_type},
+{"inline", lsym_ident},
+{"int", lsym_type},
+{"long", lsym_type},
+{"offsetof", lsym_offsetof},
+{"register", lsym_storage_class},
+{"restrict", lsym_ident},
+{"return", lsym_ident},
+{"short", lsym_type},
+{"signed", lsym_type},
+{"sizeof", lsym_sizeof},
+{"static", lsym_storage_class},
+{"struct", lsym_tag},
+{"switch", lsym_switch},
+{"typedef", lsym_typedef},
+{"union", lsym_tag},
+{"unsigned", lsym_type},
+{"void", lsym_type},
+{"volatile", lsym_type},
+{"while", lsym_while}
 };
 
 static struct {
@@ -499,11 +503,9 @@ lexi_alnum(void)
 	}
 
 } else {			/* we have a keyword */
-	ps.curr_is_type = kw->is_type;
+	ps.curr_is_type = kw->lsym == lsym_type;
 	ps.next_unary = true;
-
-	assert((kw->lsym == lsym_eof) == kw->is_type);
-	if (kw->lsym != lsym_eof && kw->lsym != lsym_tag)
+	if (kw->lsym != lsym_tag && kw->lsym != lsym_type)
 	return kw->lsym;
 
 found_typename:



CVS commit: src/usr.bin/indent

2021-10-31 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Oct 31 20:40:42 UTC 2021

Modified Files:
src/usr.bin/indent: indent.c indent.h lexi.c

Log Message:
indent: replace kw_tag with lsym_tag

This leaves only one special type of token, which is lsym_ident, which
in some cases represents a type name and in other cases an identifier,
constant or string literal.

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.200 -r1.201 src/usr.bin/indent/indent.c
cvs rdiff -u -r1.72 -r1.73 src/usr.bin/indent/indent.h
cvs rdiff -u -r1.125 -r1.126 src/usr.bin/indent/lexi.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/indent/indent.c
diff -u src/usr.bin/indent/indent.c:1.200 src/usr.bin/indent/indent.c:1.201
--- src/usr.bin/indent/indent.c:1.200	Sun Oct 31 19:57:44 2021
+++ src/usr.bin/indent/indent.c	Sun Oct 31 20:40:42 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: indent.c,v 1.200 2021/10/31 19:57:44 rillig Exp $	*/
+/*	$NetBSD: indent.c,v 1.201 2021/10/31 20:40:42 rillig Exp $	*/
 
 /*-
  * SPDX-License-Identifier: BSD-4-Clause
@@ -43,7 +43,7 @@ static char sccsid[] = "@(#)indent.c	5.1
 
 #include 
 #if defined(__NetBSD__)
-__RCSID("$NetBSD: indent.c,v 1.200 2021/10/31 19:57:44 rillig Exp $");
+__RCSID("$NetBSD: indent.c,v 1.201 2021/10/31 20:40:42 rillig Exp $");
 #elif defined(__FreeBSD__)
 __FBSDID("$FreeBSD: head/usr.bin/indent/indent.c 340138 2018-11-04 19:24:49Z oshogbo $");
 #endif
@@ -749,7 +749,7 @@ want_blank_before_lparen(void)
 	return true;
 if (opt.proc_calls_space)
 	return true;
-return ps.prev_keyword != kw_0;
+return ps.prev_is_type;
 }
 
 static void

Index: src/usr.bin/indent/indent.h
diff -u src/usr.bin/indent/indent.h:1.72 src/usr.bin/indent/indent.h:1.73
--- src/usr.bin/indent/indent.h:1.72	Sun Oct 31 19:57:44 2021
+++ src/usr.bin/indent/indent.h	Sun Oct 31 20:40:42 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: indent.h,v 1.72 2021/10/31 19:57:44 rillig Exp $	*/
+/*	$NetBSD: indent.h,v 1.73 2021/10/31 20:40:42 rillig Exp $	*/
 
 /*-
  * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
@@ -244,13 +244,6 @@ extern struct options {
  * printed */
 } opt;
 
-enum keyword_kind {
-kw_0,
-kw_tag,			/* 'struct', 'union', 'enum' */
-kw_type
-};
-
-
 extern bool found_err;
 extern int blank_lines_to_output;
 extern bool blank_line_before;
@@ -267,8 +260,8 @@ extern bool inhibit_formatting;	/* true 
 
 extern struct parser_state {
 lexer_symbol prev_token;
-enum keyword_kind prev_keyword;
-enum keyword_kind curr_keyword;
+bool prev_is_type;
+bool curr_is_type;
 bool curr_newline;
 bool curr_col_1;		/* whether the current token started in column
  * 1 of the unformatted input */

Index: src/usr.bin/indent/lexi.c
diff -u src/usr.bin/indent/lexi.c:1.125 src/usr.bin/indent/lexi.c:1.126
--- src/usr.bin/indent/lexi.c:1.125	Sun Oct 31 19:57:44 2021
+++ src/usr.bin/indent/lexi.c	Sun Oct 31 20:40:42 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: lexi.c,v 1.125 2021/10/31 19:57:44 rillig Exp $	*/
+/*	$NetBSD: lexi.c,v 1.126 2021/10/31 20:40:42 rillig Exp $	*/
 
 /*-
  * SPDX-License-Identifier: BSD-4-Clause
@@ -43,7 +43,7 @@ static char sccsid[] = "@(#)lexi.c	8.1 (
 
 #include 
 #if defined(__NetBSD__)
-__RCSID("$NetBSD: lexi.c,v 1.125 2021/10/31 19:57:44 rillig Exp $");
+__RCSID("$NetBSD: lexi.c,v 1.126 2021/10/31 20:40:42 rillig Exp $");
 #elif defined(__FreeBSD__)
 __FBSDID("$FreeBSD: head/usr.bin/indent/lexi.c 337862 2018-08-15 18:19:45Z pstef $");
 #endif
@@ -59,49 +59,49 @@ __FBSDID("$FreeBSD: head/usr.bin/indent/
 static const struct keyword {
 const char *name;
 lexer_symbol lsym;
-enum keyword_kind kind;
+bool is_type;
 } keywords[] = {
-{"_Bool", lsym_eof, kw_type},
-{"_Complex", lsym_eof, kw_type},
-{"_Imaginary", lsym_eof, kw_type},
-{"auto", lsym_storage_class, kw_0},
-{"bool", lsym_eof, kw_type},
-{"break", lsym_ident, kw_0},
-{"case", lsym_case_label, kw_0},
-{"char", lsym_eof, kw_type},
-{"complex", lsym_eof, kw_type},
-{"const", lsym_eof, kw_type},
-{"continue", lsym_ident, kw_0},
-{"default", lsym_case_label, kw_0},
-{"do", lsym_do, kw_0},
-{"double", lsym_eof, kw_type},
-{"else", lsym_else, kw_0},
-{"enum", lsym_eof, kw_tag},
-{"extern", lsym_storage_class, kw_0},
-{"float", lsym_eof, kw_type},
-{"for", lsym_for, kw_0},
-{"goto", lsym_ident, kw_0},
-{"if", lsym_if, kw_0},
-{"imaginary", lsym_eof, kw_type},
-{"inline", lsym_ident, kw_0},
-{"int", lsym_eof, kw_type},
-{"long", lsym_eof, kw_type},
-{"offsetof", lsym_offsetof, kw_0},
-{"register", lsym_storage_class, kw_0},
-{"restrict", lsym_ident, kw_0},
-{"return", lsym_ident, kw_0},
-{"short", lsym_eof, kw_type},
-{"signed", lsym_eof, kw_type},
-{"sizeof", lsym_sizeof, kw_0},
-{"static", lsym_storage_class, kw_0},
-{"struct", lsym_eof, 

CVS commit: src/usr.bin/indent

2021-10-31 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Oct 31 20:40:42 UTC 2021

Modified Files:
src/usr.bin/indent: indent.c indent.h lexi.c

Log Message:
indent: replace kw_tag with lsym_tag

This leaves only one special type of token, which is lsym_ident, which
in some cases represents a type name and in other cases an identifier,
constant or string literal.

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.200 -r1.201 src/usr.bin/indent/indent.c
cvs rdiff -u -r1.72 -r1.73 src/usr.bin/indent/indent.h
cvs rdiff -u -r1.125 -r1.126 src/usr.bin/indent/lexi.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/indent

2021-10-31 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Oct 31 19:57:44 UTC 2021

Modified Files:
src/usr.bin/indent: indent.c indent.h lexi.c

Log Message:
indent: replace simple cases of keyword_kind with lexer_symbol

The remaining keyword kinds 'tag' and 'type' require a bit more thought,
so do them in a separate step.

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.199 -r1.200 src/usr.bin/indent/indent.c
cvs rdiff -u -r1.71 -r1.72 src/usr.bin/indent/indent.h
cvs rdiff -u -r1.124 -r1.125 src/usr.bin/indent/lexi.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/indent/indent.c
diff -u src/usr.bin/indent/indent.c:1.199 src/usr.bin/indent/indent.c:1.200
--- src/usr.bin/indent/indent.c:1.199	Sun Oct 31 19:20:52 2021
+++ src/usr.bin/indent/indent.c	Sun Oct 31 19:57:44 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: indent.c,v 1.199 2021/10/31 19:20:52 rillig Exp $	*/
+/*	$NetBSD: indent.c,v 1.200 2021/10/31 19:57:44 rillig Exp $	*/
 
 /*-
  * SPDX-License-Identifier: BSD-4-Clause
@@ -43,7 +43,7 @@ static char sccsid[] = "@(#)indent.c	5.1
 
 #include 
 #if defined(__NetBSD__)
-__RCSID("$NetBSD: indent.c,v 1.199 2021/10/31 19:20:52 rillig Exp $");
+__RCSID("$NetBSD: indent.c,v 1.200 2021/10/31 19:57:44 rillig Exp $");
 #elif defined(__FreeBSD__)
 __FBSDID("$FreeBSD: head/usr.bin/indent/indent.c 340138 2018-11-04 19:24:49Z oshogbo $");
 #endif
@@ -793,7 +793,7 @@ process_lparen_or_lbracket(int decl_ind,
 }
 
 /* parenthesized type following sizeof or offsetof is not a cast */
-if (ps.prev_keyword == kw_offsetof || ps.prev_keyword == kw_sizeof)
+if (ps.prev_token == lsym_offsetof || ps.prev_token == lsym_sizeof)
 	ps.not_cast_mask |= 1 << ps.p_l_follow;
 }
 

Index: src/usr.bin/indent/indent.h
diff -u src/usr.bin/indent/indent.h:1.71 src/usr.bin/indent/indent.h:1.72
--- src/usr.bin/indent/indent.h:1.71	Sun Oct 31 19:20:52 2021
+++ src/usr.bin/indent/indent.h	Sun Oct 31 19:57:44 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: indent.h,v 1.71 2021/10/31 19:20:52 rillig Exp $	*/
+/*	$NetBSD: indent.h,v 1.72 2021/10/31 19:57:44 rillig Exp $	*/
 
 /*-
  * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
@@ -246,20 +246,8 @@ extern struct options {
 
 enum keyword_kind {
 kw_0,
-kw_offsetof,
-kw_sizeof,
 kw_tag,			/* 'struct', 'union', 'enum' */
-kw_type,
-kw_for,
-kw_if,
-kw_while,
-kw_do,
-kw_else,
-kw_switch,
-kw_case_or_default,
-kw_storage_class,
-kw_typedef,
-kw_other
+kw_type
 };
 
 

Index: src/usr.bin/indent/lexi.c
diff -u src/usr.bin/indent/lexi.c:1.124 src/usr.bin/indent/lexi.c:1.125
--- src/usr.bin/indent/lexi.c:1.124	Sun Oct 31 19:20:52 2021
+++ src/usr.bin/indent/lexi.c	Sun Oct 31 19:57:44 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: lexi.c,v 1.124 2021/10/31 19:20:52 rillig Exp $	*/
+/*	$NetBSD: lexi.c,v 1.125 2021/10/31 19:57:44 rillig Exp $	*/
 
 /*-
  * SPDX-License-Identifier: BSD-4-Clause
@@ -43,7 +43,7 @@ static char sccsid[] = "@(#)lexi.c	8.1 (
 
 #include 
 #if defined(__NetBSD__)
-__RCSID("$NetBSD: lexi.c,v 1.124 2021/10/31 19:20:52 rillig Exp $");
+__RCSID("$NetBSD: lexi.c,v 1.125 2021/10/31 19:57:44 rillig Exp $");
 #elif defined(__FreeBSD__)
 __FBSDID("$FreeBSD: head/usr.bin/indent/lexi.c 337862 2018-08-15 18:19:45Z pstef $");
 #endif
@@ -51,55 +51,57 @@ __FBSDID("$FreeBSD: head/usr.bin/indent/
 #include 
 #include 
 #include 
+#include 
 
 #include "indent.h"
 
 /* must be sorted alphabetically, is used in binary search */
 static const struct keyword {
 const char *name;
+lexer_symbol lsym;
 enum keyword_kind kind;
 } keywords[] = {
-{"_Bool", kw_type},
-{"_Complex", kw_type},
-{"_Imaginary", kw_type},
-{"auto", kw_storage_class},
-{"bool", kw_type},
-{"break", kw_other},
-{"case", kw_case_or_default},
-{"char", kw_type},
-{"complex", kw_type},
-{"const", kw_type},
-{"continue", kw_other},
-{"default", kw_case_or_default},
-{"do", kw_do},
-{"double", kw_type},
-{"else", kw_else},
-{"enum", kw_tag},
-{"extern", kw_storage_class},
-{"float", kw_type},
-{"for", kw_for},
-{"goto", kw_other},
-{"if", kw_if},
-{"imaginary", kw_type},
-{"inline", kw_other},
-{"int", kw_type},
-{"long", kw_type},
-{"offsetof", kw_offsetof},
-{"register", kw_storage_class},
-{"restrict", kw_other},
-{"return", kw_other},
-{"short", kw_type},
-{"signed", kw_type},
-{"sizeof", kw_sizeof},
-{"static", kw_storage_class},
-{"struct", kw_tag},
-{"switch", kw_switch},
-{"typedef", kw_typedef},
-{"union", kw_tag},
-{"unsigned", kw_type},
-{"void", kw_type},
-{"volatile", kw_type},
-{"while", kw_while}
+{"_Bool", lsym_eof, kw_type},
+{"_Complex", lsym_eof, kw_type},
+{"_Imaginary", lsym_eof, kw_type},
+{"auto", lsym_storage_class, kw_0},
+{"bool", 

CVS commit: src/usr.bin/indent

2021-10-31 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Oct 31 19:57:44 UTC 2021

Modified Files:
src/usr.bin/indent: indent.c indent.h lexi.c

Log Message:
indent: replace simple cases of keyword_kind with lexer_symbol

The remaining keyword kinds 'tag' and 'type' require a bit more thought,
so do them in a separate step.

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.199 -r1.200 src/usr.bin/indent/indent.c
cvs rdiff -u -r1.71 -r1.72 src/usr.bin/indent/indent.h
cvs rdiff -u -r1.124 -r1.125 src/usr.bin/indent/lexi.c

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



CVS commit: src

2021-10-31 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Oct 31 19:20:53 UTC 2021

Modified Files:
src/tests/usr.bin/indent: fmt_decl.c
src/usr.bin/indent: indent.c indent.h lexi.c

Log Message:
indent: rename lsym_type to better reflect reality

Type names that occur in parentheses are parsed as lsym_ident having the
subtype kw_type instead.

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/tests/usr.bin/indent/fmt_decl.c
cvs rdiff -u -r1.198 -r1.199 src/usr.bin/indent/indent.c
cvs rdiff -u -r1.70 -r1.71 src/usr.bin/indent/indent.h
cvs rdiff -u -r1.123 -r1.124 src/usr.bin/indent/lexi.c

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

Modified files:

Index: src/tests/usr.bin/indent/fmt_decl.c
diff -u src/tests/usr.bin/indent/fmt_decl.c:1.11 src/tests/usr.bin/indent/fmt_decl.c:1.12
--- src/tests/usr.bin/indent/fmt_decl.c:1.11	Sun Oct 31 19:13:41 2021
+++ src/tests/usr.bin/indent/fmt_decl.c	Sun Oct 31 19:20:53 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: fmt_decl.c,v 1.11 2021/10/31 19:13:41 rillig Exp $	*/
+/*	$NetBSD: fmt_decl.c,v 1.12 2021/10/31 19:20:53 rillig Exp $	*/
 /* $FreeBSD: head/usr.bin/indent/tests/declarations.0 334478 2018-06-01 09:41:15Z pstef $ */
 
 /* See FreeBSD r303570 */
@@ -62,7 +62,7 @@ typedef struct Complex {
  * As of 2021-10-31, indent parses the following function definition as these
  * tokens:
  *
- * line 1: type type "void"
+ * line 1: type_at_paren_level_0 type "void"
  * line 1: newline "\n"
  * line 2: funcname "t1"
  * line 2: newline "\n"		repeated, see search_stmt

Index: src/usr.bin/indent/indent.c
diff -u src/usr.bin/indent/indent.c:1.198 src/usr.bin/indent/indent.c:1.199
--- src/usr.bin/indent/indent.c:1.198	Sun Oct 31 10:09:43 2021
+++ src/usr.bin/indent/indent.c	Sun Oct 31 19:20:52 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: indent.c,v 1.198 2021/10/31 10:09:43 rillig Exp $	*/
+/*	$NetBSD: indent.c,v 1.199 2021/10/31 19:20:52 rillig Exp $	*/
 
 /*-
  * SPDX-License-Identifier: BSD-4-Clause
@@ -43,7 +43,7 @@ static char sccsid[] = "@(#)indent.c	5.1
 
 #include 
 #if defined(__NetBSD__)
-__RCSID("$NetBSD: indent.c,v 1.198 2021/10/31 10:09:43 rillig Exp $");
+__RCSID("$NetBSD: indent.c,v 1.199 2021/10/31 19:20:52 rillig Exp $");
 #elif defined(__FreeBSD__)
 __FBSDID("$FreeBSD: head/usr.bin/indent/indent.c 340138 2018-11-04 19:24:49Z oshogbo $");
 #endif
@@ -1493,7 +1493,7 @@ main_loop(void)
 	if (ps.p_l_follow > 0)
 		goto copy_token;
 	/* FALLTHROUGH */
-	case lsym_type:
+	case lsym_type_at_paren_level_0:
 	process_type(_ind, _to_var);
 	goto copy_token;
 

Index: src/usr.bin/indent/indent.h
diff -u src/usr.bin/indent/indent.h:1.70 src/usr.bin/indent/indent.h:1.71
--- src/usr.bin/indent/indent.h:1.70	Sun Oct 31 10:09:43 2021
+++ src/usr.bin/indent/indent.h	Sun Oct 31 19:20:52 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: indent.h,v 1.70 2021/10/31 10:09:43 rillig Exp $	*/
+/*	$NetBSD: indent.h,v 1.71 2021/10/31 19:20:52 rillig Exp $	*/
 
 /*-
  * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
@@ -91,7 +91,7 @@ typedef enum lexer_symbol {
 lsym_semicolon,
 lsym_typedef,
 lsym_storage_class,
-lsym_type,
+lsym_type_at_paren_level_0,
 lsym_tag,			/* 'struct', 'union' or 'enum' */
 lsym_case_label,		/* 'case' or 'default' */
 lsym_string_prefix,		/* 'L' */

Index: src/usr.bin/indent/lexi.c
diff -u src/usr.bin/indent/lexi.c:1.123 src/usr.bin/indent/lexi.c:1.124
--- src/usr.bin/indent/lexi.c:1.123	Sun Oct 31 19:13:41 2021
+++ src/usr.bin/indent/lexi.c	Sun Oct 31 19:20:52 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: lexi.c,v 1.123 2021/10/31 19:13:41 rillig Exp $	*/
+/*	$NetBSD: lexi.c,v 1.124 2021/10/31 19:20:52 rillig Exp $	*/
 
 /*-
  * SPDX-License-Identifier: BSD-4-Clause
@@ -43,7 +43,7 @@ static char sccsid[] = "@(#)lexi.c	8.1 (
 
 #include 
 #if defined(__NetBSD__)
-__RCSID("$NetBSD: lexi.c,v 1.123 2021/10/31 19:13:41 rillig Exp $");
+__RCSID("$NetBSD: lexi.c,v 1.124 2021/10/31 19:20:52 rillig Exp $");
 #elif defined(__FreeBSD__)
 __FBSDID("$FreeBSD: head/usr.bin/indent/lexi.c 337862 2018-08-15 18:19:45Z pstef $");
 #endif
@@ -232,7 +232,7 @@ lsym_name(lexer_symbol sym)
 	"semicolon",
 	"typedef",
 	"storage_class",
-	"type",
+	"type_at_paren_level_0",
 	"tag",
 	"case_label",
 	"string_prefix",
@@ -506,7 +506,7 @@ lexi_alnum(void)
 
 if (ps.prev_token == lsym_tag && ps.p_l_follow == 0) {
 	ps.next_unary = true;
-	return lsym_type;
+	return lsym_type_at_paren_level_0;
 }
 
 /* Operator after identifier is binary unless last token was 'struct'. */
@@ -553,7 +553,7 @@ found_typename:
 	if (kw != NULL && kw->kind == kw_tag)
 		return lsym_tag;
 	if (ps.p_l_follow == 0)
-		return lsym_type;
+		return lsym_type_at_paren_level_0;
 	}
 }
 
@@ -573,7 +573,7 @@ no_function_definition:;
 } else if (probably_typename()) {
 	ps.curr_keyword = kw_type;
 	ps.next_unary = true;
-	return lsym_type;
+	return 

CVS commit: src

2021-10-31 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Oct 31 19:20:53 UTC 2021

Modified Files:
src/tests/usr.bin/indent: fmt_decl.c
src/usr.bin/indent: indent.c indent.h lexi.c

Log Message:
indent: rename lsym_type to better reflect reality

Type names that occur in parentheses are parsed as lsym_ident having the
subtype kw_type instead.

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/tests/usr.bin/indent/fmt_decl.c
cvs rdiff -u -r1.198 -r1.199 src/usr.bin/indent/indent.c
cvs rdiff -u -r1.70 -r1.71 src/usr.bin/indent/indent.h
cvs rdiff -u -r1.123 -r1.124 src/usr.bin/indent/lexi.c

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



CVS commit: src

2021-10-31 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Oct 31 19:13:41 UTC 2021

Modified Files:
src/tests/usr.bin/indent: fmt_decl.c lex_ident.c
src/usr.bin/indent: lexi.c

Log Message:
indent: remove support for pre-1978 variable initialization


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/tests/usr.bin/indent/fmt_decl.c
cvs rdiff -u -r1.1 -r1.2 src/tests/usr.bin/indent/lex_ident.c
cvs rdiff -u -r1.122 -r1.123 src/usr.bin/indent/lexi.c

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

Modified files:

Index: src/tests/usr.bin/indent/fmt_decl.c
diff -u src/tests/usr.bin/indent/fmt_decl.c:1.10 src/tests/usr.bin/indent/fmt_decl.c:1.11
--- src/tests/usr.bin/indent/fmt_decl.c:1.10	Sun Oct 31 19:08:39 2021
+++ src/tests/usr.bin/indent/fmt_decl.c	Sun Oct 31 19:13:41 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: fmt_decl.c,v 1.10 2021/10/31 19:08:39 rillig Exp $	*/
+/*	$NetBSD: fmt_decl.c,v 1.11 2021/10/31 19:13:41 rillig Exp $	*/
 /* $FreeBSD: head/usr.bin/indent/tests/declarations.0 334478 2018-06-01 09:41:15Z pstef $ */
 
 /* See FreeBSD r303570 */
@@ -446,8 +446,8 @@ int a - 1;
 #indent end
 
 #indent run -di0
-int a -1;
+int a - 1;
 {
-	int a -1;
+	int a - 1;
 }
 #indent end

Index: src/tests/usr.bin/indent/lex_ident.c
diff -u src/tests/usr.bin/indent/lex_ident.c:1.1 src/tests/usr.bin/indent/lex_ident.c:1.2
--- src/tests/usr.bin/indent/lex_ident.c:1.1	Fri Oct 22 19:27:53 2021
+++ src/tests/usr.bin/indent/lex_ident.c	Sun Oct 31 19:13:41 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: lex_ident.c,v 1.1 2021/10/22 19:27:53 rillig Exp $ */
+/* $NetBSD: lex_ident.c,v 1.2 2021/10/31 19:13:41 rillig Exp $ */
 /* $FreeBSD$ */
 
 /*
@@ -62,5 +62,5 @@ int identifier\n;
 #indent end
 
 #indent run
-int		identifier \n;
+int		identifier \ n;
 #indent end

Index: src/usr.bin/indent/lexi.c
diff -u src/usr.bin/indent/lexi.c:1.122 src/usr.bin/indent/lexi.c:1.123
--- src/usr.bin/indent/lexi.c:1.122	Sun Oct 31 17:22:47 2021
+++ src/usr.bin/indent/lexi.c	Sun Oct 31 19:13:41 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: lexi.c,v 1.122 2021/10/31 17:22:47 rillig Exp $	*/
+/*	$NetBSD: lexi.c,v 1.123 2021/10/31 19:13:41 rillig Exp $	*/
 
 /*-
  * SPDX-License-Identifier: BSD-4-Clause
@@ -43,7 +43,7 @@ static char sccsid[] = "@(#)lexi.c	8.1 (
 
 #include 
 #if defined(__NetBSD__)
-__RCSID("$NetBSD: lexi.c,v 1.122 2021/10/31 17:22:47 rillig Exp $");
+__RCSID("$NetBSD: lexi.c,v 1.123 2021/10/31 19:13:41 rillig Exp $");
 #elif defined(__FreeBSD__)
 __FBSDID("$FreeBSD: head/usr.bin/indent/lexi.c 337862 2018-08-15 18:19:45Z pstef $");
 #endif
@@ -576,10 +576,6 @@ no_function_definition:;
 	return lsym_type;
 }
 
-if (ps.prev_token == lsym_type)	/* if this is a declared variable,
-	 * then following sign is unary */
-	ps.next_unary = true;	/* will make "int a -1" work */
-
 return lsym_ident;		/* the ident is not in the list */
 }
 



CVS commit: src

2021-10-31 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Oct 31 19:13:41 UTC 2021

Modified Files:
src/tests/usr.bin/indent: fmt_decl.c lex_ident.c
src/usr.bin/indent: lexi.c

Log Message:
indent: remove support for pre-1978 variable initialization


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/tests/usr.bin/indent/fmt_decl.c
cvs rdiff -u -r1.1 -r1.2 src/tests/usr.bin/indent/lex_ident.c
cvs rdiff -u -r1.122 -r1.123 src/usr.bin/indent/lexi.c

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



CVS commit: src/tests/usr.bin/indent

2021-10-31 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Oct 31 19:08:39 UTC 2021

Modified Files:
src/tests/usr.bin/indent: fmt_decl.c

Log Message:
tests/indent: test support for ancient initialization without '='


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/tests/usr.bin/indent/fmt_decl.c

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

Modified files:

Index: src/tests/usr.bin/indent/fmt_decl.c
diff -u src/tests/usr.bin/indent/fmt_decl.c:1.9 src/tests/usr.bin/indent/fmt_decl.c:1.10
--- src/tests/usr.bin/indent/fmt_decl.c:1.9	Sun Oct 31 17:22:48 2021
+++ src/tests/usr.bin/indent/fmt_decl.c	Sun Oct 31 19:08:39 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: fmt_decl.c,v 1.9 2021/10/31 17:22:48 rillig Exp $	*/
+/*	$NetBSD: fmt_decl.c,v 1.10 2021/10/31 19:08:39 rillig Exp $	*/
 /* $FreeBSD: head/usr.bin/indent/tests/declarations.0 334478 2018-06-01 09:41:15Z pstef $ */
 
 /* See FreeBSD r303570 */
@@ -431,3 +431,23 @@ main(void)
 	char *(*	f2)();
 }
 #indent end
+
+
+/*
+ * In some ancient time long before ISO C90, variable declarations with
+ * initializer could be written without '='. The C Programming Language from
+ * 1978 doesn't mention this form anymore.
+ */
+#indent input
+int a - 1;
+{
+int a - 1;
+}
+#indent end
+
+#indent run -di0
+int a -1;
+{
+	int a -1;
+}
+#indent end



CVS commit: src/tests/usr.bin/indent

2021-10-31 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Oct 31 19:08:39 UTC 2021

Modified Files:
src/tests/usr.bin/indent: fmt_decl.c

Log Message:
tests/indent: test support for ancient initialization without '='


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/tests/usr.bin/indent/fmt_decl.c

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



CVS commit: src/usr.sbin/mopd

2021-10-31 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Oct 31 18:06:42 UTC 2021

Modified Files:
src/usr.sbin/mopd: Makefile.inc
src/usr.sbin/mopd/common: Makefile
src/usr.sbin/mopd/mopchk: Makefile
src/usr.sbin/mopd/mopcopy: Makefile
src/usr.sbin/mopd/mopd: Makefile
src/usr.sbin/mopd/mopprobe: Makefile
src/usr.sbin/mopd/moptrace: Makefile

Log Message:
Put the NOAOUT in one place


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/usr.sbin/mopd/Makefile.inc
cvs rdiff -u -r1.22 -r1.23 src/usr.sbin/mopd/common/Makefile
cvs rdiff -u -r1.6 -r1.7 src/usr.sbin/mopd/mopchk/Makefile
cvs rdiff -u -r1.2 -r1.3 src/usr.sbin/mopd/mopcopy/Makefile
cvs rdiff -u -r1.13 -r1.14 src/usr.sbin/mopd/mopd/Makefile
cvs rdiff -u -r1.10 -r1.11 src/usr.sbin/mopd/mopprobe/Makefile
cvs rdiff -u -r1.6 -r1.7 src/usr.sbin/mopd/moptrace/Makefile

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



CVS commit: src/usr.sbin/mopd

2021-10-31 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Oct 31 18:06:42 UTC 2021

Modified Files:
src/usr.sbin/mopd: Makefile.inc
src/usr.sbin/mopd/common: Makefile
src/usr.sbin/mopd/mopchk: Makefile
src/usr.sbin/mopd/mopcopy: Makefile
src/usr.sbin/mopd/mopd: Makefile
src/usr.sbin/mopd/mopprobe: Makefile
src/usr.sbin/mopd/moptrace: Makefile

Log Message:
Put the NOAOUT in one place


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/usr.sbin/mopd/Makefile.inc
cvs rdiff -u -r1.22 -r1.23 src/usr.sbin/mopd/common/Makefile
cvs rdiff -u -r1.6 -r1.7 src/usr.sbin/mopd/mopchk/Makefile
cvs rdiff -u -r1.2 -r1.3 src/usr.sbin/mopd/mopcopy/Makefile
cvs rdiff -u -r1.13 -r1.14 src/usr.sbin/mopd/mopd/Makefile
cvs rdiff -u -r1.10 -r1.11 src/usr.sbin/mopd/mopprobe/Makefile
cvs rdiff -u -r1.6 -r1.7 src/usr.sbin/mopd/moptrace/Makefile

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

Modified files:

Index: src/usr.sbin/mopd/Makefile.inc
diff -u src/usr.sbin/mopd/Makefile.inc:1.11 src/usr.sbin/mopd/Makefile.inc:1.12
--- src/usr.sbin/mopd/Makefile.inc:1.11	Thu May 29 22:16:10 2014
+++ src/usr.sbin/mopd/Makefile.inc	Sun Oct 31 14:06:42 2021
@@ -1,8 +1,11 @@
-#	$NetBSD: Makefile.inc,v 1.11 2014/05/30 02:16:10 joerg Exp $
+#	$NetBSD: Makefile.inc,v 1.12 2021/10/31 18:06:42 christos Exp $
 
+USE_FORT?=yes	# network server
 .include 
 
-USE_FORT?=yes	# network server
+.if ${MACHINE_CPU} == "mips"
+CPPFLAGS+= -DNOAOUT
+.endif
 
 LIBCOMMON != cd ${.CURDIR}/../common && ${PRINTOBJDIR}
 CPPFLAGS+=-I${.CURDIR}/../common

Index: src/usr.sbin/mopd/common/Makefile
diff -u src/usr.sbin/mopd/common/Makefile:1.22 src/usr.sbin/mopd/common/Makefile:1.23
--- src/usr.sbin/mopd/common/Makefile:1.22	Sun Oct 31 13:50:35 2021
+++ src/usr.sbin/mopd/common/Makefile	Sun Oct 31 14:06:42 2021
@@ -1,25 +1,21 @@
-#	$NetBSD: Makefile,v 1.22 2021/10/31 17:50:35 christos Exp $
+#	$NetBSD: Makefile,v 1.23 2021/10/31 18:06:42 christos Exp $
 
 LIBISPRIVATE=	yes
 
+.include 
+
 LIB=	common
 SRCS=	cmp.c device.c dl.c file.c get.c log.c loop-bsd.c mopdef.c nma.c pf.c \
 	print.c put.c rc.c version.c
 CLEANFILES= version.c
 
-.include 
-
-.if ${MACHINE_CPU} == "mips"
-CPPFLAGS+= -DNOAOUT
-.endif
-
 version.c: VERSION
 	${_MKTARGET_CREATE}
 	rm -f version.c; \
 	${TOOL_SED} 's/.*/char version[] = "&";/' ${.ALLSRC} > version.c
 
-.include 
 
 COPTS.print.c+=	-Wno-pointer-sign
-
 COPTS.pf.c+=	${GCC_NO_STRINGOP_TRUNCATION}
+
+.include 

Index: src/usr.sbin/mopd/mopchk/Makefile
diff -u src/usr.sbin/mopd/mopchk/Makefile:1.6 src/usr.sbin/mopd/mopchk/Makefile:1.7
--- src/usr.sbin/mopd/mopchk/Makefile:1.6	Thu Oct 16 03:36:44 1997
+++ src/usr.sbin/mopd/mopchk/Makefile	Sun Oct 31 14:06:42 2021
@@ -1,4 +1,6 @@
-#	$NetBSD: Makefile,v 1.6 1997/10/16 07:36:44 lukem Exp $
+#	$NetBSD: Makefile,v 1.7 2021/10/31 18:06:42 christos Exp $
+
+.include 
 
 PROG=	mopchk
 

Index: src/usr.sbin/mopd/mopcopy/Makefile
diff -u src/usr.sbin/mopd/mopcopy/Makefile:1.2 src/usr.sbin/mopd/mopcopy/Makefile:1.3
--- src/usr.sbin/mopd/mopcopy/Makefile:1.2	Thu Aug 20 18:26:19 2009
+++ src/usr.sbin/mopd/mopcopy/Makefile	Sun Oct 31 14:06:42 2021
@@ -1,10 +1,7 @@
-#	$NetBSD: Makefile,v 1.2 2009/08/20 22:26:19 he Exp $
+#	$NetBSD: Makefile,v 1.3 2021/10/31 18:06:42 christos Exp $
 
-PROG=	mopcopy
+.include 
 
-.include 
-.if ${MACHINE_CPU} == "mips"
-CFLAGS+= -DNOAOUT
-.endif
+PROG=	mopcopy
 
 .include 

Index: src/usr.sbin/mopd/mopd/Makefile
diff -u src/usr.sbin/mopd/mopd/Makefile:1.13 src/usr.sbin/mopd/mopd/Makefile:1.14
--- src/usr.sbin/mopd/mopd/Makefile:1.13	Sun Oct 13 03:28:19 2019
+++ src/usr.sbin/mopd/mopd/Makefile	Sun Oct 31 14:06:42 2021
@@ -1,4 +1,6 @@
-#	$NetBSD: Makefile,v 1.13 2019/10/13 07:28:19 mrg Exp $
+#	$NetBSD: Makefile,v 1.14 2021/10/31 18:06:42 christos Exp $
+
+.include 
 
 PROG=	mopd
 SRCS=	mopd.c process.c
@@ -7,6 +9,7 @@ MAN=	mopd.8
 LDADD+=	-lutil
 DPADD+=	${LIBUTIL}
 
+COPTS.process.c+=	-Wno-pointer-sign ${GCC_NO_FORMAT_TRUNCATION}
+
 .include 
 
-COPTS.process.c+=	-Wno-pointer-sign ${GCC_NO_FORMAT_TRUNCATION}

Index: src/usr.sbin/mopd/mopprobe/Makefile
diff -u src/usr.sbin/mopd/mopprobe/Makefile:1.10 src/usr.sbin/mopd/mopprobe/Makefile:1.11
--- src/usr.sbin/mopd/mopprobe/Makefile:1.10	Fri Aug 10 08:10:29 2012
+++ src/usr.sbin/mopd/mopprobe/Makefile	Sun Oct 31 14:06:42 2021
@@ -1,7 +1,10 @@
-#	$NetBSD: Makefile,v 1.10 2012/08/10 12:10:29 joerg Exp $
+#	$NetBSD: Makefile,v 1.11 2021/10/31 18:06:42 christos Exp $
+
+.include 
 
 PROG=	mopprobe
 
+COPTS.mopprobe.c+=	-Wno-pointer-sign
+
 .include 
 
-COPTS.mopprobe.c+=	-Wno-pointer-sign

Index: src/usr.sbin/mopd/moptrace/Makefile
diff -u src/usr.sbin/mopd/moptrace/Makefile:1.6 src/usr.sbin/mopd/moptrace/Makefile:1.7
--- src/usr.sbin/mopd/moptrace/Makefile:1.6	Thu Oct 16 03:37:09 1997
+++ src/usr.sbin/mopd/moptrace/Makefile	Sun Oct 31 14:06:42 2021
@@ -1,4 +1,6 @@
-#	$NetBSD: Makefile,v 1.6 

CVS commit: src/usr.sbin/mopd/common

2021-10-31 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Oct 31 17:50:35 UTC 2021

Modified Files:
src/usr.sbin/mopd/common: Makefile

Log Message:
USE CPPFLAGS instead of CFLAGS for -D !


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/usr.sbin/mopd/common/Makefile

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

Modified files:

Index: src/usr.sbin/mopd/common/Makefile
diff -u src/usr.sbin/mopd/common/Makefile:1.21 src/usr.sbin/mopd/common/Makefile:1.22
--- src/usr.sbin/mopd/common/Makefile:1.21	Sun Oct 13 03:28:19 2019
+++ src/usr.sbin/mopd/common/Makefile	Sun Oct 31 13:50:35 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.21 2019/10/13 07:28:19 mrg Exp $
+#	$NetBSD: Makefile,v 1.22 2021/10/31 17:50:35 christos Exp $
 
 LIBISPRIVATE=	yes
 
@@ -10,7 +10,7 @@ CLEANFILES= version.c
 .include 
 
 .if ${MACHINE_CPU} == "mips"
-CFLAGS+= -DNOAOUT
+CPPFLAGS+= -DNOAOUT
 .endif
 
 version.c: VERSION



CVS commit: src/usr.sbin/mopd/common

2021-10-31 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Oct 31 17:50:35 UTC 2021

Modified Files:
src/usr.sbin/mopd/common: Makefile

Log Message:
USE CPPFLAGS instead of CFLAGS for -D !


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/usr.sbin/mopd/common/Makefile

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



CVS commit: src/sys/arch/arm/cortex

2021-10-31 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Oct 31 17:24:11 UTC 2021

Modified Files:
src/sys/arch/arm/cortex: gicv3_its.c

Log Message:
Fix non-DIAGNOSTIC builds (hopefully). No idea why this didn't fail to
build for me without DIAGNOSTIC.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/arch/arm/cortex/gicv3_its.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/cortex/gicv3_its.c
diff -u src/sys/arch/arm/cortex/gicv3_its.c:1.33 src/sys/arch/arm/cortex/gicv3_its.c:1.34
--- src/sys/arch/arm/cortex/gicv3_its.c:1.33	Sun Oct 31 16:23:47 2021
+++ src/sys/arch/arm/cortex/gicv3_its.c	Sun Oct 31 17:24:11 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: gicv3_its.c,v 1.33 2021/10/31 16:23:47 skrll Exp $ */
+/* $NetBSD: gicv3_its.c,v 1.34 2021/10/31 17:24:11 skrll Exp $ */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
 #define _INTR_PRIVATE
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: gicv3_its.c,v 1.33 2021/10/31 16:23:47 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gicv3_its.c,v 1.34 2021/10/31 17:24:11 skrll Exp $");
 
 #include 
 #include 
@@ -589,7 +589,6 @@ gicv3_its_msi_intr_establish(struct arm_
 pci_intr_handle_t ih, int ipl, int (*func)(void *), void *arg, const char *xname)
 {
 	struct gicv3_its * const its = msi->msi_priv;
-	const struct pci_attach_args *pa;
 	void *intrh;
 
 	const int lpi = __SHIFTOUT(ih, ARM_PCI_INTR_IRQ);
@@ -601,8 +600,7 @@ gicv3_its_msi_intr_establish(struct arm_
 		return NULL;
 
 	/* Invalidate LPI configuration tables */
-	pa = its->its_pa[lpi - its->its_pic->pic_irqbase];
-	KASSERT(pa != NULL);
+	KASSERT(its->its_pa[lpi - its->its_pic->pic_irqbase] != NULL);
 	const uint32_t devid = its->its_devid[lpi - its->its_pic->pic_irqbase];
 	gits_command_inv(its, devid, lpi - its->its_pic->pic_irqbase);
 
@@ -771,7 +769,6 @@ gicv3_its_cpu_init(void *priv, struct cp
 {
 	struct gicv3_its * const its = priv;
 	struct gicv3_softc * const sc = its->its_gic;
-	const struct pci_attach_args *pa;
 	uint64_t rdbase;
 	size_t irq;
 
@@ -798,8 +795,7 @@ gicv3_its_cpu_init(void *priv, struct cp
 	for (irq = 0; irq < its->its_pic->pic_maxsources; irq++) {
 		if (its->its_targets[irq] != ci)
 			continue;
-		pa = its->its_pa[irq];
-		KASSERT(pa != NULL);
+		KASSERT(its->its_pa[irq] != NULL);
 
 		const uint32_t devid = its->its_devid[irq];
 		gits_command_movi(its, devid, irq, cpu_index(ci));



CVS commit: src/sys/arch/arm/cortex

2021-10-31 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Oct 31 17:24:11 UTC 2021

Modified Files:
src/sys/arch/arm/cortex: gicv3_its.c

Log Message:
Fix non-DIAGNOSTIC builds (hopefully). No idea why this didn't fail to
build for me without DIAGNOSTIC.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/arch/arm/cortex/gicv3_its.c

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



CVS commit: src

2021-10-31 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Oct 31 17:22:48 UTC 2021

Modified Files:
src/tests/usr.bin/indent: fmt_decl.c
src/usr.bin/indent: lexi.c

Log Message:
indent: in debug log, print token subtype in same line

The keyword 'void' is parsed as lsym_type in some cases and lsym_ident
in others. Its corresponding keyword is always kw_type though. Put the
subtype into the same line as the other token information.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/tests/usr.bin/indent/fmt_decl.c
cvs rdiff -u -r1.121 -r1.122 src/usr.bin/indent/lexi.c

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



CVS commit: src

2021-10-31 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Oct 31 17:22:48 UTC 2021

Modified Files:
src/tests/usr.bin/indent: fmt_decl.c
src/usr.bin/indent: lexi.c

Log Message:
indent: in debug log, print token subtype in same line

The keyword 'void' is parsed as lsym_type in some cases and lsym_ident
in others. Its corresponding keyword is always kw_type though. Put the
subtype into the same line as the other token information.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/tests/usr.bin/indent/fmt_decl.c
cvs rdiff -u -r1.121 -r1.122 src/usr.bin/indent/lexi.c

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

Modified files:

Index: src/tests/usr.bin/indent/fmt_decl.c
diff -u src/tests/usr.bin/indent/fmt_decl.c:1.8 src/tests/usr.bin/indent/fmt_decl.c:1.9
--- src/tests/usr.bin/indent/fmt_decl.c:1.8	Sun Oct 31 10:56:19 2021
+++ src/tests/usr.bin/indent/fmt_decl.c	Sun Oct 31 17:22:48 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: fmt_decl.c,v 1.8 2021/10/31 10:56:19 rillig Exp $	*/
+/*	$NetBSD: fmt_decl.c,v 1.9 2021/10/31 17:22:48 rillig Exp $	*/
 /* $FreeBSD: head/usr.bin/indent/tests/declarations.0 334478 2018-06-01 09:41:15Z pstef $ */
 
 /* See FreeBSD r303570 */
@@ -62,27 +62,27 @@ typedef struct Complex {
  * As of 2021-10-31, indent parses the following function definition as these
  * tokens:
  *
- * line 1: type "void"
+ * line 1: type type "void"
  * line 1: newline "\n"
  * line 2: funcname "t1"
  * line 2: newline "\n"		repeated, see search_stmt
  * line 3: funcname "t1"	XXX: wrong line_no
  * line 3: lparen_or_lbracket "("
- * line 3: ident "char"		XXX: should be 'type', intuitively
+ * line 3: ident type "char"
  * line 3: unary_op "*"
  * line 3: ident "a"
  * line 3: comma ","
- * line 3: ident "int"		XXX: should be 'type'
+ * line 3: ident type "int"
  * line 3: ident "b"
  * line 3: comma ","
  * line 3: newline "\n"
- * line 4: ident "void"		XXX: should be 'type'
+ * line 4: ident type "void"
  * line 4: lparen_or_lbracket "("
  * line 4: unary_op "*"
  * line 4: ident "fn"
  * line 4: rparen_or_rbracket ")"
  * line 4: lparen_or_lbracket "("
- * line 4: ident "void"		XXX: should be 'type'
+ * line 4: ident type "void"
  * line 4: rparen_or_rbracket ")"
  * line 4: rparen_or_rbracket ")"
  * line 4: newline "\n"

Index: src/usr.bin/indent/lexi.c
diff -u src/usr.bin/indent/lexi.c:1.121 src/usr.bin/indent/lexi.c:1.122
--- src/usr.bin/indent/lexi.c:1.121	Sun Oct 31 10:09:43 2021
+++ src/usr.bin/indent/lexi.c	Sun Oct 31 17:22:47 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: lexi.c,v 1.121 2021/10/31 10:09:43 rillig Exp $	*/
+/*	$NetBSD: lexi.c,v 1.122 2021/10/31 17:22:47 rillig Exp $	*/
 
 /*-
  * SPDX-License-Identifier: BSD-4-Clause
@@ -43,7 +43,7 @@ static char sccsid[] = "@(#)lexi.c	8.1 (
 
 #include 
 #if defined(__NetBSD__)
-__RCSID("$NetBSD: lexi.c,v 1.121 2021/10/31 10:09:43 rillig Exp $");
+__RCSID("$NetBSD: lexi.c,v 1.122 2021/10/31 17:22:47 rillig Exp $");
 #elif defined(__FreeBSD__)
 __FBSDID("$FreeBSD: head/usr.bin/indent/lexi.c 337862 2018-08-15 18:19:45Z pstef $");
 #endif
@@ -305,14 +305,16 @@ debug_lexi(lexer_symbol lsym)
 
 debug_println("");
 debug_printf("line %d: %s", line_no, lsym_name(lsym));
+if (ps.curr_keyword != kw_0)
+	debug_printf(" %s", kw_name(ps.curr_keyword));
 debug_vis_range(" \"", token.s, token.e, "\"\n");
+
 debug_print_buf("label", );
 debug_print_buf("code", );
 debug_print_buf("comment", );
 
-// prev_token
+debug_println("ps.prev_token = %s", lsym_name(ps.prev_token));
 debug_ps_keyword(prev_keyword);
-debug_ps_keyword(curr_keyword);
 debug_ps_bool(curr_newline);
 debug_ps_bool(curr_col_1);
 debug_ps_bool(next_unary);



CVS commit: src/usr.bin/xlint/lint1

2021-10-31 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Oct 31 16:42:16 UTC 2021

Modified Files:
src/usr.bin/xlint/lint1: tree.c

Log Message:
Avoid null pointer exception hpcmips/mipsel src/lib/libperfuse/ops.c


To generate a diff of this commit:
cvs rdiff -u -r1.386 -r1.387 src/usr.bin/xlint/lint1/tree.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/xlint/lint1/tree.c
diff -u src/usr.bin/xlint/lint1/tree.c:1.386 src/usr.bin/xlint/lint1/tree.c:1.387
--- src/usr.bin/xlint/lint1/tree.c:1.386	Sat Oct 30 18:04:42 2021
+++ src/usr.bin/xlint/lint1/tree.c	Sun Oct 31 12:42:16 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: tree.c,v 1.386 2021/10/30 22:04:42 rillig Exp $	*/
+/*	$NetBSD: tree.c,v 1.387 2021/10/31 16:42:16 christos Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: tree.c,v 1.386 2021/10/30 22:04:42 rillig Exp $");
+__RCSID("$NetBSD: tree.c,v 1.387 2021/10/31 16:42:16 christos Exp $");
 #endif
 
 #include 
@@ -1793,6 +1793,9 @@ check_enum_array_index(const tnode_t *ln
 		return;
 	if (rn->tn_left->tn_type->t_tspec != ENUM)
 		return;
+	// XXX: why?
+	if (rn->tn_type->t_enum == NULL)
+		return;
 
 	max_enum_value = INT_MIN;
 	ec = rn->tn_type->t_enum->en_first_enumerator;



CVS commit: src/usr.bin/xlint/lint1

2021-10-31 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Oct 31 16:42:16 UTC 2021

Modified Files:
src/usr.bin/xlint/lint1: tree.c

Log Message:
Avoid null pointer exception hpcmips/mipsel src/lib/libperfuse/ops.c


To generate a diff of this commit:
cvs rdiff -u -r1.386 -r1.387 src/usr.bin/xlint/lint1/tree.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/arm/pic

2021-10-31 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Oct 31 16:29:18 UTC 2021

Modified Files:
src/sys/arch/arm/pic: pic.c

Log Message:
Only perform pic_unblock_percpu if all of the following are true
- mp_online, i.e. APs are running.
- is_mpsafe, i.e. the interrupt handler is MP safe
- is_percpu, i.e. the interrupt actually requires it!

The last one (is_percpu) is true for GIC PPI+SGI only.


To generate a diff of this commit:
cvs rdiff -u -r1.74 -r1.75 src/sys/arch/arm/pic/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/arm/pic/pic.c
diff -u src/sys/arch/arm/pic/pic.c:1.74 src/sys/arch/arm/pic/pic.c:1.75
--- src/sys/arch/arm/pic/pic.c:1.74	Sun Oct 31 16:24:47 2021
+++ src/sys/arch/arm/pic/pic.c	Sun Oct 31 16:29:18 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: pic.c,v 1.74 2021/10/31 16:24:47 skrll Exp $	*/
+/*	$NetBSD: pic.c,v 1.75 2021/10/31 16:29:18 skrll Exp $	*/
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -33,7 +33,7 @@
 #include "opt_multiprocessor.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pic.c,v 1.74 2021/10/31 16:24:47 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pic.c,v 1.75 2021/10/31 16:29:18 skrll Exp $");
 
 #include 
 #include 
@@ -792,7 +792,7 @@ pic_establish_intr(struct pic_softc *pic
 	(*pic->pic_ops->pic_establish_irq)(pic, is);
 
 unblock:
-	if (!mp_online || !is->is_mpsafe) {
+	if (!mp_online || !is->is_mpsafe || !is->is_percpu) {
 		(*pic->pic_ops->pic_unblock_irqs)(pic, is->is_irq & ~0x1f,
 		__BIT(is->is_irq & 0x1f));
 	} else {



CVS commit: src/sys/arch/arm/pic

2021-10-31 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Oct 31 16:29:18 UTC 2021

Modified Files:
src/sys/arch/arm/pic: pic.c

Log Message:
Only perform pic_unblock_percpu if all of the following are true
- mp_online, i.e. APs are running.
- is_mpsafe, i.e. the interrupt handler is MP safe
- is_percpu, i.e. the interrupt actually requires it!

The last one (is_percpu) is true for GIC PPI+SGI only.


To generate a diff of this commit:
cvs rdiff -u -r1.74 -r1.75 src/sys/arch/arm/pic/pic.c

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



CVS commit: src/sys/kern

2021-10-31 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Oct 31 16:26:26 UTC 2021

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

Log Message:
Revert the 2015 change I made that allowed sleeping in the idle lwp
if it wasn't running yet, e.g. in cpu_hatch
---
 sys/kern/kern_lock.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/sys/kern/kern_lock.c b/sys/kern/kern_lock.c
index 40557427de86..c0c9d8adaf9e 100644
--- a/sys/kern/kern_lock.c
+++ b/sys/kern/kern_lock.c
@@ -89,8 +89,7 @@ assert_sleepable(void)
} while (pctr != lwp_pctr());

reason = NULL;
-   if (idle && !cold &&
-   kcpuset_isset(kcpuset_running, cpu_index(curcpu( {
+   if (idle && !cold) {
reason = "idle";
}
if (cpu_intr_p()) {
--
2.25.1


To generate a diff of this commit:
cvs rdiff -u -r1.172 -r1.173 src/sys/kern/kern_lock.c

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

Modified files:

Index: src/sys/kern/kern_lock.c
diff -u src/sys/kern/kern_lock.c:1.172 src/sys/kern/kern_lock.c:1.173
--- src/sys/kern/kern_lock.c:1.172	Tue Dec 22 01:57:29 2020
+++ src/sys/kern/kern_lock.c	Sun Oct 31 16:26:26 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_lock.c,v 1.172 2020/12/22 01:57:29 ad Exp $	*/
+/*	$NetBSD: kern_lock.c,v 1.173 2021/10/31 16:26:26 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2002, 2006, 2007, 2008, 2009, 2020 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_lock.c,v 1.172 2020/12/22 01:57:29 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_lock.c,v 1.173 2021/10/31 16:26:26 skrll Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_lockdebug.h"
@@ -89,8 +89,7 @@ assert_sleepable(void)
 	} while (pctr != lwp_pctr());
 
 	reason = NULL;
-	if (idle && !cold &&
-	kcpuset_isset(kcpuset_running, cpu_index(curcpu( {
+	if (idle && !cold) {
 		reason = "idle";
 	}
 	if (cpu_intr_p()) {



CVS commit: src/sys/kern

2021-10-31 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Oct 31 16:26:26 UTC 2021

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

Log Message:
Revert the 2015 change I made that allowed sleeping in the idle lwp
if it wasn't running yet, e.g. in cpu_hatch
---
 sys/kern/kern_lock.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/sys/kern/kern_lock.c b/sys/kern/kern_lock.c
index 40557427de86..c0c9d8adaf9e 100644
--- a/sys/kern/kern_lock.c
+++ b/sys/kern/kern_lock.c
@@ -89,8 +89,7 @@ assert_sleepable(void)
} while (pctr != lwp_pctr());

reason = NULL;
-   if (idle && !cold &&
-   kcpuset_isset(kcpuset_running, cpu_index(curcpu( {
+   if (idle && !cold) {
reason = "idle";
}
if (cpu_intr_p()) {
--
2.25.1


To generate a diff of this commit:
cvs rdiff -u -r1.172 -r1.173 src/sys/kern/kern_lock.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/arm/pic

2021-10-31 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Oct 31 16:24:47 UTC 2021

Modified Files:
src/sys/arch/arm/pic: pic.c

Log Message:
Assert we can sleep in pic_add


To generate a diff of this commit:
cvs rdiff -u -r1.73 -r1.74 src/sys/arch/arm/pic/pic.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/arm/pic

2021-10-31 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Oct 31 16:24:47 UTC 2021

Modified Files:
src/sys/arch/arm/pic: pic.c

Log Message:
Assert we can sleep in pic_add


To generate a diff of this commit:
cvs rdiff -u -r1.73 -r1.74 src/sys/arch/arm/pic/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/arm/pic/pic.c
diff -u src/sys/arch/arm/pic/pic.c:1.73 src/sys/arch/arm/pic/pic.c:1.74
--- src/sys/arch/arm/pic/pic.c:1.73	Sun Oct 31 16:23:48 2021
+++ src/sys/arch/arm/pic/pic.c	Sun Oct 31 16:24:47 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: pic.c,v 1.73 2021/10/31 16:23:48 skrll Exp $	*/
+/*	$NetBSD: pic.c,v 1.74 2021/10/31 16:24:47 skrll Exp $	*/
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -33,7 +33,7 @@
 #include "opt_multiprocessor.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pic.c,v 1.73 2021/10/31 16:23:48 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pic.c,v 1.74 2021/10/31 16:24:47 skrll Exp $");
 
 #include 
 #include 
@@ -613,6 +613,8 @@ pic_add(struct pic_softc *pic, int irqba
 	size_t sourcebase;
 	static ONCE_DECL(pic_once);
 
+	ASSERT_SLEEPABLE();
+
 	RUN_ONCE(_once, pic_init);
 
 	KASSERT(strlen(pic->pic_name) > 0);



CVS commit: src/sys/arch

2021-10-31 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Oct 31 16:23:48 UTC 2021

Modified Files:
src/sys/arch/aarch64/aarch64: aarch64_machdep.c cpu.c cpufunc.c
db_machdep.c locore.S
src/sys/arch/aarch64/include: cpu.h cpufunc.h db_machdep.h
src/sys/arch/arm/apple: apple_intc.c
src/sys/arch/arm/arm: cpu_subr.c undefined.c
src/sys/arch/arm/arm32: arm32_boot.c arm32_machdep.c cpu.c
src/sys/arch/arm/broadcom: bcm2835_intr.c
src/sys/arch/arm/cortex: gicv3_its.c gicv3_its.h gtmr.c
src/sys/arch/arm/include: cpu.h locore.h undefined.h
src/sys/arch/arm/pic: pic.c
src/sys/arch/arm/vfp: vfp_init.c

Log Message:
Rework Arm (32bit and 64bit) AP startup so that cpu_hatch doesn't sleep.

The AP initialisation code in cpu_init_secondary_processor will read and
initialise the required system registers and state for the BP to attach
and report.

Rework the interrupt handler code for this new sequence. Thankfully,
this removes a bunch of code for bcm2836mp.

The VFP detection handler on <= armv7 relies on the global undefined
handler being in place until the BP attaches vfp. That is, after the
APs have been spun up.

gicv3_its.c has a serialisation issue which is protected against in
the gicv3_its_cpu_init, which is called from cpu_hatch, with a spin
lock. The serialisation issue needs addressing more completely.

Tested on RPI3, Apple M1, QEMU, and lx2k

Fixes PR port-arm/56264:
   diagnostic assertion "l->l_stat == LSONPROC" failed on RPI3


To generate a diff of this commit:
cvs rdiff -u -r1.62 -r1.63 src/sys/arch/aarch64/aarch64/aarch64_machdep.c
cvs rdiff -u -r1.66 -r1.67 src/sys/arch/aarch64/aarch64/cpu.c
cvs rdiff -u -r1.31 -r1.32 src/sys/arch/aarch64/aarch64/cpufunc.c
cvs rdiff -u -r1.41 -r1.42 src/sys/arch/aarch64/aarch64/db_machdep.c
cvs rdiff -u -r1.81 -r1.82 src/sys/arch/aarch64/aarch64/locore.S
cvs rdiff -u -r1.42 -r1.43 src/sys/arch/aarch64/include/cpu.h
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/aarch64/include/cpufunc.h
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/aarch64/include/db_machdep.h
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/apple/apple_intc.c
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/arm/cpu_subr.c
cvs rdiff -u -r1.71 -r1.72 src/sys/arch/arm/arm/undefined.c
cvs rdiff -u -r1.43 -r1.44 src/sys/arch/arm/arm32/arm32_boot.c
cvs rdiff -u -r1.140 -r1.141 src/sys/arch/arm/arm32/arm32_machdep.c
cvs rdiff -u -r1.151 -r1.152 src/sys/arch/arm/arm32/cpu.c
cvs rdiff -u -r1.41 -r1.42 src/sys/arch/arm/broadcom/bcm2835_intr.c
cvs rdiff -u -r1.32 -r1.33 src/sys/arch/arm/cortex/gicv3_its.c
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/arm/cortex/gicv3_its.h
cvs rdiff -u -r1.45 -r1.46 src/sys/arch/arm/cortex/gtmr.c
cvs rdiff -u -r1.119 -r1.120 src/sys/arch/arm/include/cpu.h
cvs rdiff -u -r1.36 -r1.37 src/sys/arch/arm/include/locore.h
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/arm/include/undefined.h
cvs rdiff -u -r1.72 -r1.73 src/sys/arch/arm/pic/pic.c
cvs rdiff -u -r1.75 -r1.76 src/sys/arch/arm/vfp/vfp_init.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/aarch64_machdep.c
diff -u src/sys/arch/aarch64/aarch64/aarch64_machdep.c:1.62 src/sys/arch/aarch64/aarch64/aarch64_machdep.c:1.63
--- src/sys/arch/aarch64/aarch64/aarch64_machdep.c:1.62	Fri Oct  8 21:41:29 2021
+++ src/sys/arch/aarch64/aarch64/aarch64_machdep.c	Sun Oct 31 16:23:47 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: aarch64_machdep.c,v 1.62 2021/10/08 21:41:29 ryo Exp $ */
+/* $NetBSD: aarch64_machdep.c,v 1.63 2021/10/31 16:23:47 skrll Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(1, "$NetBSD: aarch64_machdep.c,v 1.62 2021/10/08 21:41:29 ryo Exp $");
+__KERNEL_RCSID(1, "$NetBSD: aarch64_machdep.c,v 1.63 2021/10/31 16:23:47 skrll Exp $");
 
 #include "opt_arm_debug.h"
 #include "opt_cpuoptions.h"
@@ -359,7 +359,7 @@ initarm_common(vaddr_t kvm_base, vsize_t
 	VM_MAX_KERNEL_ADDRESS);
 
 #ifdef DDB
-	db_machdep_init();
+	db_machdep_cpu_init();
 #endif
 
 	uvm_md_init();

Index: src/sys/arch/aarch64/aarch64/cpu.c
diff -u src/sys/arch/aarch64/aarch64/cpu.c:1.66 src/sys/arch/aarch64/aarch64/cpu.c:1.67
--- src/sys/arch/aarch64/aarch64/cpu.c:1.66	Sat Oct 30 10:47:03 2021
+++ src/sys/arch/aarch64/aarch64/cpu.c	Sun Oct 31 16:23:47 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu.c,v 1.66 2021/10/30 10:47:03 skrll Exp $ */
+/* $NetBSD: cpu.c,v 1.67 2021/10/31 16:23:47 skrll Exp $ */
 
 /*
  * Copyright (c) 2017 Ryo Shimizu 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(1, "$NetBSD: cpu.c,v 1.66 2021/10/30 10:47:03 skrll Exp $");
+__KERNEL_RCSID(1, "$NetBSD: cpu.c,v 1.67 2021/10/31 16:23:47 skrll Exp $");
 
 #include "locators.h"
 #include "opt_arm_debug.h"
@@ -72,12 +72,13 @@ __KERNEL_RCSID(1, "$NetBSD: cpu.c,v 1.66
 #endif
 
 void cpu_attach(device_t, cpuid_t);
+void cpu_setup_id(struct cpu_info *);
+
 static 

CVS commit: src/sys/arch

2021-10-31 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Oct 31 16:23:48 UTC 2021

Modified Files:
src/sys/arch/aarch64/aarch64: aarch64_machdep.c cpu.c cpufunc.c
db_machdep.c locore.S
src/sys/arch/aarch64/include: cpu.h cpufunc.h db_machdep.h
src/sys/arch/arm/apple: apple_intc.c
src/sys/arch/arm/arm: cpu_subr.c undefined.c
src/sys/arch/arm/arm32: arm32_boot.c arm32_machdep.c cpu.c
src/sys/arch/arm/broadcom: bcm2835_intr.c
src/sys/arch/arm/cortex: gicv3_its.c gicv3_its.h gtmr.c
src/sys/arch/arm/include: cpu.h locore.h undefined.h
src/sys/arch/arm/pic: pic.c
src/sys/arch/arm/vfp: vfp_init.c

Log Message:
Rework Arm (32bit and 64bit) AP startup so that cpu_hatch doesn't sleep.

The AP initialisation code in cpu_init_secondary_processor will read and
initialise the required system registers and state for the BP to attach
and report.

Rework the interrupt handler code for this new sequence. Thankfully,
this removes a bunch of code for bcm2836mp.

The VFP detection handler on <= armv7 relies on the global undefined
handler being in place until the BP attaches vfp. That is, after the
APs have been spun up.

gicv3_its.c has a serialisation issue which is protected against in
the gicv3_its_cpu_init, which is called from cpu_hatch, with a spin
lock. The serialisation issue needs addressing more completely.

Tested on RPI3, Apple M1, QEMU, and lx2k

Fixes PR port-arm/56264:
   diagnostic assertion "l->l_stat == LSONPROC" failed on RPI3


To generate a diff of this commit:
cvs rdiff -u -r1.62 -r1.63 src/sys/arch/aarch64/aarch64/aarch64_machdep.c
cvs rdiff -u -r1.66 -r1.67 src/sys/arch/aarch64/aarch64/cpu.c
cvs rdiff -u -r1.31 -r1.32 src/sys/arch/aarch64/aarch64/cpufunc.c
cvs rdiff -u -r1.41 -r1.42 src/sys/arch/aarch64/aarch64/db_machdep.c
cvs rdiff -u -r1.81 -r1.82 src/sys/arch/aarch64/aarch64/locore.S
cvs rdiff -u -r1.42 -r1.43 src/sys/arch/aarch64/include/cpu.h
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/aarch64/include/cpufunc.h
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/aarch64/include/db_machdep.h
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/apple/apple_intc.c
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/arm/cpu_subr.c
cvs rdiff -u -r1.71 -r1.72 src/sys/arch/arm/arm/undefined.c
cvs rdiff -u -r1.43 -r1.44 src/sys/arch/arm/arm32/arm32_boot.c
cvs rdiff -u -r1.140 -r1.141 src/sys/arch/arm/arm32/arm32_machdep.c
cvs rdiff -u -r1.151 -r1.152 src/sys/arch/arm/arm32/cpu.c
cvs rdiff -u -r1.41 -r1.42 src/sys/arch/arm/broadcom/bcm2835_intr.c
cvs rdiff -u -r1.32 -r1.33 src/sys/arch/arm/cortex/gicv3_its.c
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/arm/cortex/gicv3_its.h
cvs rdiff -u -r1.45 -r1.46 src/sys/arch/arm/cortex/gtmr.c
cvs rdiff -u -r1.119 -r1.120 src/sys/arch/arm/include/cpu.h
cvs rdiff -u -r1.36 -r1.37 src/sys/arch/arm/include/locore.h
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/arm/include/undefined.h
cvs rdiff -u -r1.72 -r1.73 src/sys/arch/arm/pic/pic.c
cvs rdiff -u -r1.75 -r1.76 src/sys/arch/arm/vfp/vfp_init.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/arm/cortex

2021-10-31 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Oct 31 15:32:14 UTC 2021

Modified Files:
src/sys/arch/arm/cortex: gic_splfuncs_armv8.S

Log Message:
Reload tpidr_el1 into x3 and re-test newipl vs cpl on restart.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/arm/cortex/gic_splfuncs_armv8.S

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/cortex/gic_splfuncs_armv8.S
diff -u src/sys/arch/arm/cortex/gic_splfuncs_armv8.S:1.2 src/sys/arch/arm/cortex/gic_splfuncs_armv8.S:1.3
--- src/sys/arch/arm/cortex/gic_splfuncs_armv8.S:1.2	Sat Oct 30 20:23:12 2021
+++ src/sys/arch/arm/cortex/gic_splfuncs_armv8.S	Sun Oct 31 15:32:14 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: gic_splfuncs_armv8.S,v 1.2 2021/10/30 20:23:12 jmcneill Exp $ */
+/* $NetBSD: gic_splfuncs_armv8.S,v 1.3 2021/10/31 15:32:14 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2021 Jared McNeill 
@@ -29,7 +29,7 @@
 #include 
 #include "assym.h"
 
-RCSID("$NetBSD: gic_splfuncs_armv8.S,v 1.2 2021/10/30 20:23:12 jmcneill Exp $")
+RCSID("$NetBSD: gic_splfuncs_armv8.S,v 1.3 2021/10/31 15:32:14 jmcneill Exp $")
 
 #ifdef __HAVE_PREEMPTION
 #define	DISABLE_PREEMPTION			\
@@ -84,12 +84,12 @@ ENTRY_NP(gic_splx)
 	DISABLE_PREEMPTION
 	ldr	x1, [x3, #L_CPU]		/* get curcpu */
 
+.Lagain:
 	/* If newipl >= cpl, just return */
 	ldr	w2, [x1, #CI_CPL]
 	cmp	w0, w2
 	b.hs	.Ldone
 
-.Lagain:
 	/* Slow path if ci_intr_depth != 0 */
 	ldr	w2, [x1, #CI_INTR_DEPTH]
 	cbnz	w2, .Lslow
@@ -120,9 +120,9 @@ ENTRY_NP(gic_splx)
 	ret
 
 .Lrestart:
-	/* Reload w0 and x1 */
-	mrs	x1, tpidr_el1			/* get curlwp */
-	ldr	x1, [x1, #L_CPU]		/* get curcpu */
+	/* Reload registers */
+	mrs	x3, tpidr_el1			/* get curlwp */
+	ldr	x1, [x3, #L_CPU]		/* get curcpu */
 	ldr	w0, [x1, #CI_SPLX_SAVEDIPL]	/* get newipl */
 	b	.Lagain
 	



CVS commit: src/sys/arch/arm/cortex

2021-10-31 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Oct 31 15:32:14 UTC 2021

Modified Files:
src/sys/arch/arm/cortex: gic_splfuncs_armv8.S

Log Message:
Reload tpidr_el1 into x3 and re-test newipl vs cpl on restart.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/arm/cortex/gic_splfuncs_armv8.S

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



CVS commit: [netbsd-8] src/doc

2021-10-31 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Oct 31 14:49:33 UTC 2021

Modified Files:
src/doc [netbsd-8]: CHANGES-8.3

Log Message:
Ticket #1705


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.107 -r1.1.2.108 src/doc/CHANGES-8.3

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

Modified files:

Index: src/doc/CHANGES-8.3
diff -u src/doc/CHANGES-8.3:1.1.2.107 src/doc/CHANGES-8.3:1.1.2.108
--- src/doc/CHANGES-8.3:1.1.2.107	Mon Oct 25 18:17:04 2021
+++ src/doc/CHANGES-8.3	Sun Oct 31 14:49:33 2021
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-8.3,v 1.1.2.107 2021/10/25 18:17:04 martin Exp $
+# $NetBSD: CHANGES-8.3,v 1.1.2.108 2021/10/31 14:49:33 martin Exp $
 
 A complete list of changes from the NetBSD 8.2 release to the NetBSD 8.3
 release:
@@ -2187,3 +2187,9 @@ sys/net/if_ethersubr.c1.302
 	Fix handling of VLAN 0 tag.
 	[ryo, ticket #1704]
 
+lib/libcrypt/crypt-sha1.c			1.10
+
+	libcrypt: Fix a floating point exception when a low number of HMAC-SHA1
+	iterations are specified.
+	[nia, ticket #1705]
+



CVS commit: [netbsd-8] src/doc

2021-10-31 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Oct 31 14:49:33 UTC 2021

Modified Files:
src/doc [netbsd-8]: CHANGES-8.3

Log Message:
Ticket #1705


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.107 -r1.1.2.108 src/doc/CHANGES-8.3

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



CVS commit: [netbsd-8] src/lib/libcrypt

2021-10-31 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Oct 31 14:48:42 UTC 2021

Modified Files:
src/lib/libcrypt [netbsd-8]: crypt-sha1.c

Log Message:
Pull up following revision(s) (requested by nia in ticket #1705):

lib/libcrypt/crypt-sha1.c: revision 1.10

libcrypt: Fix a floating point exception when a low number of HMAC-SHA1
iterations are specified.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.8.18.1 src/lib/libcrypt/crypt-sha1.c

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

Modified files:

Index: src/lib/libcrypt/crypt-sha1.c
diff -u src/lib/libcrypt/crypt-sha1.c:1.8 src/lib/libcrypt/crypt-sha1.c:1.8.18.1
--- src/lib/libcrypt/crypt-sha1.c:1.8	Wed Aug 28 17:47:07 2013
+++ src/lib/libcrypt/crypt-sha1.c	Sun Oct 31 14:48:42 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: crypt-sha1.c,v 1.8 2013/08/28 17:47:07 riastradh Exp $ */
+/* $NetBSD: crypt-sha1.c,v 1.8.18.1 2021/10/31 14:48:42 martin Exp $ */
 
 /*
  * Copyright (c) 2004, Juniper Networks, Inc.
@@ -31,7 +31,7 @@
 
 #include 
 #if !defined(lint)
-__RCSID("$NetBSD: crypt-sha1.c,v 1.8 2013/08/28 17:47:07 riastradh Exp $");
+__RCSID("$NetBSD: crypt-sha1.c,v 1.8.18.1 2021/10/31 14:48:42 martin Exp $");
 #endif /* not lint */
 
 #include 
@@ -71,24 +71,15 @@ __RCSID("$NetBSD: crypt-sha1.c,v 1.8 201
 unsigned int
 __crypt_sha1_iterations (unsigned int hint)
 {
-static int once = 1;
-
 /*
  * We treat CRYPT_SHA1_ITERATIONS as a hint.
  * Make it harder for someone to pre-compute hashes for a
  * dictionary attack by not using the same iteration count for
  * every entry.
  */
-
-if (once) {
-	int pid = getpid();
-	
-	srandom(time(NULL) ^ (pid * pid));
-	once = 0;
-}
-if (hint == 0)
+if (hint < 4)
 	hint = CRYPT_SHA1_ITERATIONS;
-return hint - (random() % (hint / 4));
+return hint - arc4random_uniform(hint / 4);
 }
 
 /*



CVS commit: [netbsd-8] src/lib/libcrypt

2021-10-31 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Oct 31 14:48:42 UTC 2021

Modified Files:
src/lib/libcrypt [netbsd-8]: crypt-sha1.c

Log Message:
Pull up following revision(s) (requested by nia in ticket #1705):

lib/libcrypt/crypt-sha1.c: revision 1.10

libcrypt: Fix a floating point exception when a low number of HMAC-SHA1
iterations are specified.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.8.18.1 src/lib/libcrypt/crypt-sha1.c

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



CVS commit: [netbsd-9] src/doc

2021-10-31 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Oct 31 14:47:59 UTC 2021

Modified Files:
src/doc [netbsd-9]: CHANGES-9.3

Log Message:
Ticket #1370


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.44 -r1.1.2.45 src/doc/CHANGES-9.3

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

Modified files:

Index: src/doc/CHANGES-9.3
diff -u src/doc/CHANGES-9.3:1.1.2.44 src/doc/CHANGES-9.3:1.1.2.45
--- src/doc/CHANGES-9.3:1.1.2.44	Mon Oct 25 18:11:55 2021
+++ src/doc/CHANGES-9.3	Sun Oct 31 14:47:59 2021
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-9.3,v 1.1.2.44 2021/10/25 18:11:55 martin Exp $
+# $NetBSD: CHANGES-9.3,v 1.1.2.45 2021/10/31 14:47:59 martin Exp $
 
 A complete list of changes from the NetBSD 9.2 release to the NetBSD 9.3
 release:
@@ -919,3 +919,10 @@ sys/net/if_ethersubr.c1.302
 	Fix handling of VLAN 0 tag.
 	[ryo, ticket #1369]
 
+lib/libcrypt/crypt-sha1.c			1.10
+
+	libcrypt: Fix a floating point exception when a low number of HMAC-SHA1
+	iterations are specified.
+	[nia, ticket #1370]
+
+



CVS commit: [netbsd-9] src/doc

2021-10-31 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Oct 31 14:47:59 UTC 2021

Modified Files:
src/doc [netbsd-9]: CHANGES-9.3

Log Message:
Ticket #1370


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.44 -r1.1.2.45 src/doc/CHANGES-9.3

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



CVS commit: [netbsd-9] src/lib/libcrypt

2021-10-31 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Oct 31 14:47:05 UTC 2021

Modified Files:
src/lib/libcrypt [netbsd-9]: crypt-sha1.c

Log Message:
Pull up following revision(s) (requested by nia in ticket #1370):

lib/libcrypt/crypt-sha1.c: revision 1.10

libcrypt: Fix a floating point exception when a low number of HMAC-SHA1
iterations are specified.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.8.28.1 src/lib/libcrypt/crypt-sha1.c

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

Modified files:

Index: src/lib/libcrypt/crypt-sha1.c
diff -u src/lib/libcrypt/crypt-sha1.c:1.8 src/lib/libcrypt/crypt-sha1.c:1.8.28.1
--- src/lib/libcrypt/crypt-sha1.c:1.8	Wed Aug 28 17:47:07 2013
+++ src/lib/libcrypt/crypt-sha1.c	Sun Oct 31 14:47:04 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: crypt-sha1.c,v 1.8 2013/08/28 17:47:07 riastradh Exp $ */
+/* $NetBSD: crypt-sha1.c,v 1.8.28.1 2021/10/31 14:47:04 martin Exp $ */
 
 /*
  * Copyright (c) 2004, Juniper Networks, Inc.
@@ -31,7 +31,7 @@
 
 #include 
 #if !defined(lint)
-__RCSID("$NetBSD: crypt-sha1.c,v 1.8 2013/08/28 17:47:07 riastradh Exp $");
+__RCSID("$NetBSD: crypt-sha1.c,v 1.8.28.1 2021/10/31 14:47:04 martin Exp $");
 #endif /* not lint */
 
 #include 
@@ -71,24 +71,15 @@ __RCSID("$NetBSD: crypt-sha1.c,v 1.8 201
 unsigned int
 __crypt_sha1_iterations (unsigned int hint)
 {
-static int once = 1;
-
 /*
  * We treat CRYPT_SHA1_ITERATIONS as a hint.
  * Make it harder for someone to pre-compute hashes for a
  * dictionary attack by not using the same iteration count for
  * every entry.
  */
-
-if (once) {
-	int pid = getpid();
-	
-	srandom(time(NULL) ^ (pid * pid));
-	once = 0;
-}
-if (hint == 0)
+if (hint < 4)
 	hint = CRYPT_SHA1_ITERATIONS;
-return hint - (random() % (hint / 4));
+return hint - arc4random_uniform(hint / 4);
 }
 
 /*



CVS commit: [netbsd-9] src/lib/libcrypt

2021-10-31 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Oct 31 14:47:05 UTC 2021

Modified Files:
src/lib/libcrypt [netbsd-9]: crypt-sha1.c

Log Message:
Pull up following revision(s) (requested by nia in ticket #1370):

lib/libcrypt/crypt-sha1.c: revision 1.10

libcrypt: Fix a floating point exception when a low number of HMAC-SHA1
iterations are specified.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.8.28.1 src/lib/libcrypt/crypt-sha1.c

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



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

2021-10-31 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Oct 31 12:34:48 UTC 2021

Modified Files:
src/sys/arch/evbarm/conf: std.generic64

Log Message:
Disable GIC_SPLFUNCS (still crashy)


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/evbarm/conf/std.generic64

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

Modified files:

Index: src/sys/arch/evbarm/conf/std.generic64
diff -u src/sys/arch/evbarm/conf/std.generic64:1.17 src/sys/arch/evbarm/conf/std.generic64:1.18
--- src/sys/arch/evbarm/conf/std.generic64:1.17	Sat Oct 30 19:28:40 2021
+++ src/sys/arch/evbarm/conf/std.generic64	Sun Oct 31 12:34:48 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: std.generic64,v 1.17 2021/10/30 19:28:40 jmcneill Exp $
+#	$NetBSD: std.generic64,v 1.18 2021/10/31 12:34:48 jmcneill Exp $
 #
 #	generic NetBSD/evbarm64 with FDT support
 
@@ -16,7 +16,7 @@ options 	DRAM_BLOCKS=256
 options 	EVBARM_BOARDTYPE="FDT"
 options 	FDT# Flattened Device Tree support
 options 	FPU_VFP
-options 	GIC_SPLFUNCS
+#options 	GIC_SPLFUNCS			# Experimental
 options 	MODULAR
 options 	MODULAR_DEFAULT_AUTOLOAD
 options 	PCI_NETBSD_CONFIGURE



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

2021-10-31 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Oct 31 12:34:48 UTC 2021

Modified Files:
src/sys/arch/evbarm/conf: std.generic64

Log Message:
Disable GIC_SPLFUNCS (still crashy)


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/evbarm/conf/std.generic64

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



CVS commit: src/tests/lib/libc/stdio

2021-10-31 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Sun Oct 31 11:36:26 UTC 2021

Modified Files:
src/tests/lib/libc/stdio: t_intr.sh

Log Message:
Skip the test when there is insufficient disk space.  Fixes PR misc/56324.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/tests/lib/libc/stdio/t_intr.sh

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



CVS commit: src/tests/lib/libc/stdio

2021-10-31 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Sun Oct 31 11:36:26 UTC 2021

Modified Files:
src/tests/lib/libc/stdio: t_intr.sh

Log Message:
Skip the test when there is insufficient disk space.  Fixes PR misc/56324.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/tests/lib/libc/stdio/t_intr.sh

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

Modified files:

Index: src/tests/lib/libc/stdio/t_intr.sh
diff -u src/tests/lib/libc/stdio/t_intr.sh:1.5 src/tests/lib/libc/stdio/t_intr.sh:1.6
--- src/tests/lib/libc/stdio/t_intr.sh:1.5	Thu Sep  9 21:47:47 2021
+++ src/tests/lib/libc/stdio/t_intr.sh	Sun Oct 31 11:36:26 2021
@@ -1,4 +1,4 @@
-# $NetBSD: t_intr.sh,v 1.5 2021/09/09 21:47:47 rillig Exp $
+# $NetBSD: t_intr.sh,v 1.6 2021/10/31 11:36:26 gson Exp $
 #
 # Copyright (c) 2021 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -36,6 +36,12 @@ SSIZE=256000
 TMOUT=20
 
 h_test() {
+	local avail=$( df -m . | awk '{if (int($4) > 0) print $4}' )
+	local need=$(( 2 * $MAX * 8 / 100 ))
+	if [ $avail -lt $need ]; then
+		atf_skip "not enough free space in working directory"
+	fi
+
 	"${DIR}/h_makenumbers" "$1" > numbers.in
 	"${DIR}/h_intr" \
 	-p "$2" -a ${SSIZE} -b ${BSIZE} -t ${TMOUT} \



CVS commit: src/tests/usr.bin/indent

2021-10-31 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Oct 31 10:56:19 UTC 2021

Modified Files:
src/tests/usr.bin/indent: fmt_decl.c

Log Message:
tests/indent: document that 'void' is not always parsed as a type


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/tests/usr.bin/indent/fmt_decl.c

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

Modified files:

Index: src/tests/usr.bin/indent/fmt_decl.c
diff -u src/tests/usr.bin/indent/fmt_decl.c:1.7 src/tests/usr.bin/indent/fmt_decl.c:1.8
--- src/tests/usr.bin/indent/fmt_decl.c:1.7	Sat Oct 30 11:41:49 2021
+++ src/tests/usr.bin/indent/fmt_decl.c	Sun Oct 31 10:56:19 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: fmt_decl.c,v 1.7 2021/10/30 11:41:49 rillig Exp $	*/
+/*	$NetBSD: fmt_decl.c,v 1.8 2021/10/31 10:56:19 rillig Exp $	*/
 /* $FreeBSD: head/usr.bin/indent/tests/declarations.0 334478 2018-06-01 09:41:15Z pstef $ */
 
 /* See FreeBSD r303570 */
@@ -58,6 +58,40 @@ typedef struct Complex {
 #indent end
 
 
+/*
+ * As of 2021-10-31, indent parses the following function definition as these
+ * tokens:
+ *
+ * line 1: type "void"
+ * line 1: newline "\n"
+ * line 2: funcname "t1"
+ * line 2: newline "\n"		repeated, see search_stmt
+ * line 3: funcname "t1"	XXX: wrong line_no
+ * line 3: lparen_or_lbracket "("
+ * line 3: ident "char"		XXX: should be 'type', intuitively
+ * line 3: unary_op "*"
+ * line 3: ident "a"
+ * line 3: comma ","
+ * line 3: ident "int"		XXX: should be 'type'
+ * line 3: ident "b"
+ * line 3: comma ","
+ * line 3: newline "\n"
+ * line 4: ident "void"		XXX: should be 'type'
+ * line 4: lparen_or_lbracket "("
+ * line 4: unary_op "*"
+ * line 4: ident "fn"
+ * line 4: rparen_or_rbracket ")"
+ * line 4: lparen_or_lbracket "("
+ * line 4: ident "void"		XXX: should be 'type'
+ * line 4: rparen_or_rbracket ")"
+ * line 4: rparen_or_rbracket ")"
+ * line 4: newline "\n"
+ * line 5: lbrace "{"
+ * line 5: lbrace "{"		repeated, see search_stmt
+ * line 5: newline "\n"		FIXME: there is no newline in the source
+ * line 6: rbrace "}"
+ * line 6: eof "\n"
+ */
 #indent input
 void
 t1 (char *a, int b,



CVS commit: src/tests/usr.bin/indent

2021-10-31 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Oct 31 10:56:19 UTC 2021

Modified Files:
src/tests/usr.bin/indent: fmt_decl.c

Log Message:
tests/indent: document that 'void' is not always parsed as a type


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/tests/usr.bin/indent/fmt_decl.c

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



CVS commit: src/usr.sbin/timed/timed

2021-10-31 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Sun Oct 31 10:47:18 UTC 2021

Modified Files:
src/usr.sbin/timed/timed: timed.c

Log Message:
timed(8): avoid hand-rolling arc4random_uniform


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/usr.sbin/timed/timed/timed.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/timed/timed/timed.c
diff -u src/usr.sbin/timed/timed/timed.c:1.26 src/usr.sbin/timed/timed/timed.c:1.27
--- src/usr.sbin/timed/timed/timed.c:1.26	Sun Feb  4 09:01:13 2018
+++ src/usr.sbin/timed/timed/timed.c	Sun Oct 31 10:47:18 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: timed.c,v 1.26 2018/02/04 09:01:13 mrg Exp $	*/
+/*	$NetBSD: timed.c,v 1.27 2021/10/31 10:47:18 nia Exp $	*/
 
 /*-
  * Copyright (c) 1985, 1993 The Regents of the University of California.
@@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1985, 19
 #if 0
 static char sccsid[] = "@(#)timed.c	8.2 (Berkeley) 3/26/95";
 #else
-__RCSID("$NetBSD: timed.c,v 1.26 2018/02/04 09:01:13 mrg Exp $");
+__RCSID("$NetBSD: timed.c,v 1.27 2021/10/31 10:47:18 nia Exp $");
 #endif
 #endif /* not lint */
 
@@ -239,11 +239,8 @@ main(int argc, char *argv[])
 			err(EXIT_FAILURE, "bind");
 	}
 
-	/* choose a unique seed for random number generation */
-	(void)gettimeofday(, 0);
-	srandom((unsigned long)(ntime.tv_sec + ntime.tv_usec));
-
-	sequence = (u_short)random(); /* initial seq number */
+	/* initial seq number */
+	sequence = (u_short)arc4random_uniform(UINT16_MAX);
 
 	/* rounds kernel variable time to multiple of 5 ms. */
 	ntime.tv_sec = 0;
@@ -334,11 +331,10 @@ main(int argc, char *argv[])
 
 
 	/* microseconds to delay before responding to a broadcast */
-	delay1 = casual(1L, 100*1000L);
+	delay1 = 1L + arc4random_uniform((100 * 1000L) - 1L);
 
 	/* election timer delay in secs. */
-	delay2 = casual((long)MINTOUT, (long)MAXTOUT);
-
+	delay2 = MINTOUT + arc4random_uniform(MAXTOUT - MINTOUT);
 
 	if (!debug) {
 		daemon(debug, 0);
@@ -654,18 +650,6 @@ pickslavenet(struct netinfo *ntp)
 	makeslave(ntp);
 }
 
-/*
- * returns a random number in the range [inf, sup]
- */
-long
-casual(long inf, long sup)
-{
-	double value;
-
-	value = ((double)(random() & 0x7fff)) / (0x7fff*1.0);
-	return(inf + (sup - inf)*value);
-}
-
 char *
 date(void)
 {



CVS commit: src/usr.sbin/timed/timed

2021-10-31 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Sun Oct 31 10:47:18 UTC 2021

Modified Files:
src/usr.sbin/timed/timed: timed.c

Log Message:
timed(8): avoid hand-rolling arc4random_uniform


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/usr.sbin/timed/timed/timed.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/indent

2021-10-31 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Oct 31 10:09:43 UTC 2021

Modified Files:
src/usr.bin/indent: indent.c indent.h lexi.c

Log Message:
indent: add separate lexer symbol for offsetof

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.197 -r1.198 src/usr.bin/indent/indent.c
cvs rdiff -u -r1.69 -r1.70 src/usr.bin/indent/indent.h
cvs rdiff -u -r1.120 -r1.121 src/usr.bin/indent/lexi.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/indent/indent.c
diff -u src/usr.bin/indent/indent.c:1.197 src/usr.bin/indent/indent.c:1.198
--- src/usr.bin/indent/indent.c:1.197	Sun Oct 31 10:00:37 2021
+++ src/usr.bin/indent/indent.c	Sun Oct 31 10:09:43 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: indent.c,v 1.197 2021/10/31 10:00:37 rillig Exp $	*/
+/*	$NetBSD: indent.c,v 1.198 2021/10/31 10:09:43 rillig Exp $	*/
 
 /*-
  * SPDX-License-Identifier: BSD-4-Clause
@@ -43,7 +43,7 @@ static char sccsid[] = "@(#)indent.c	5.1
 
 #include 
 #if defined(__NetBSD__)
-__RCSID("$NetBSD: indent.c,v 1.197 2021/10/31 10:00:37 rillig Exp $");
+__RCSID("$NetBSD: indent.c,v 1.198 2021/10/31 10:09:43 rillig Exp $");
 #elif defined(__FreeBSD__)
 __FBSDID("$FreeBSD: head/usr.bin/indent/indent.c 340138 2018-11-04 19:24:49Z oshogbo $");
 #endif
@@ -741,15 +741,15 @@ want_blank_before_lparen(void)
 	return false;
 if (ps.prev_token == lsym_rparen_or_rbracket)
 	return false;
+if (ps.prev_token == lsym_offsetof)
+	return opt.proc_calls_space;
 if (ps.prev_token == lsym_sizeof)
 	return opt.proc_calls_space || opt.blank_after_sizeof;
 if (ps.prev_token != lsym_ident && ps.prev_token != lsym_funcname)
 	return true;
 if (opt.proc_calls_space)
 	return true;
-if (ps.prev_keyword == kw_sizeof)
-	return opt.blank_after_sizeof;
-return ps.prev_keyword != kw_0 && ps.prev_keyword != kw_offsetof;
+return ps.prev_keyword != kw_0;
 }
 
 static void
@@ -1497,6 +1497,7 @@ main_loop(void)
 	process_type(_ind, _to_var);
 	goto copy_token;
 
+	case lsym_offsetof:
 	case lsym_sizeof:
 	case lsym_ident:
 	case lsym_funcname:

Index: src/usr.bin/indent/indent.h
diff -u src/usr.bin/indent/indent.h:1.69 src/usr.bin/indent/indent.h:1.70
--- src/usr.bin/indent/indent.h:1.69	Sun Oct 31 10:00:37 2021
+++ src/usr.bin/indent/indent.h	Sun Oct 31 10:09:43 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: indent.h,v 1.69 2021/10/31 10:00:37 rillig Exp $	*/
+/*	$NetBSD: indent.h,v 1.70 2021/10/31 10:09:43 rillig Exp $	*/
 
 /*-
  * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
@@ -96,6 +96,7 @@ typedef enum lexer_symbol {
 lsym_case_label,		/* 'case' or 'default' */
 lsym_string_prefix,		/* 'L' */
 lsym_sizeof,
+lsym_offsetof,
 lsym_ident,			/* identifier, constant or string */
 lsym_funcname,
 lsym_do,

Index: src/usr.bin/indent/lexi.c
diff -u src/usr.bin/indent/lexi.c:1.120 src/usr.bin/indent/lexi.c:1.121
--- src/usr.bin/indent/lexi.c:1.120	Sun Oct 31 10:00:37 2021
+++ src/usr.bin/indent/lexi.c	Sun Oct 31 10:09:43 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: lexi.c,v 1.120 2021/10/31 10:00:37 rillig Exp $	*/
+/*	$NetBSD: lexi.c,v 1.121 2021/10/31 10:09:43 rillig Exp $	*/
 
 /*-
  * SPDX-License-Identifier: BSD-4-Clause
@@ -43,7 +43,7 @@ static char sccsid[] = "@(#)lexi.c	8.1 (
 
 #include 
 #if defined(__NetBSD__)
-__RCSID("$NetBSD: lexi.c,v 1.120 2021/10/31 10:00:37 rillig Exp $");
+__RCSID("$NetBSD: lexi.c,v 1.121 2021/10/31 10:09:43 rillig Exp $");
 #elif defined(__FreeBSD__)
 __FBSDID("$FreeBSD: head/usr.bin/indent/lexi.c 337862 2018-08-15 18:19:45Z pstef $");
 #endif
@@ -237,6 +237,7 @@ lsym_name(lexer_symbol sym)
 	"case_label",
 	"string_prefix",
 	"sizeof",
+	"offsetof",
 	"ident",
 	"funcname",
 	"do",
@@ -535,6 +536,7 @@ lexi_alnum(void)
 	case kw_do:		return lsym_do;
 	case kw_storage_class:	return lsym_storage_class;
 	case kw_typedef:	return lsym_typedef;
+	case kw_offsetof:	return lsym_offsetof;
 	case kw_sizeof:		return lsym_sizeof;
 	default:		return lsym_ident;
 	}



CVS commit: src/usr.bin/indent

2021-10-31 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Oct 31 10:09:43 UTC 2021

Modified Files:
src/usr.bin/indent: indent.c indent.h lexi.c

Log Message:
indent: add separate lexer symbol for offsetof

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.197 -r1.198 src/usr.bin/indent/indent.c
cvs rdiff -u -r1.69 -r1.70 src/usr.bin/indent/indent.h
cvs rdiff -u -r1.120 -r1.121 src/usr.bin/indent/lexi.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/indent

2021-10-31 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Oct 31 10:00:38 UTC 2021

Modified Files:
src/usr.bin/indent: indent.c indent.h lexi.c

Log Message:
indent: add separate lexer symbol for sizeof

The plan is to get rid of the type keyword_kind, which largely overlaps
with lexer_symbol.

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.196 -r1.197 src/usr.bin/indent/indent.c
cvs rdiff -u -r1.68 -r1.69 src/usr.bin/indent/indent.h
cvs rdiff -u -r1.119 -r1.120 src/usr.bin/indent/lexi.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/indent/indent.c
diff -u src/usr.bin/indent/indent.c:1.196 src/usr.bin/indent/indent.c:1.197
--- src/usr.bin/indent/indent.c:1.196	Sat Oct 30 23:27:33 2021
+++ src/usr.bin/indent/indent.c	Sun Oct 31 10:00:37 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: indent.c,v 1.196 2021/10/30 23:27:33 rillig Exp $	*/
+/*	$NetBSD: indent.c,v 1.197 2021/10/31 10:00:37 rillig Exp $	*/
 
 /*-
  * SPDX-License-Identifier: BSD-4-Clause
@@ -43,7 +43,7 @@ static char sccsid[] = "@(#)indent.c	5.1
 
 #include 
 #if defined(__NetBSD__)
-__RCSID("$NetBSD: indent.c,v 1.196 2021/10/30 23:27:33 rillig Exp $");
+__RCSID("$NetBSD: indent.c,v 1.197 2021/10/31 10:00:37 rillig Exp $");
 #elif defined(__FreeBSD__)
 __FBSDID("$FreeBSD: head/usr.bin/indent/indent.c 340138 2018-11-04 19:24:49Z oshogbo $");
 #endif
@@ -741,6 +741,8 @@ want_blank_before_lparen(void)
 	return false;
 if (ps.prev_token == lsym_rparen_or_rbracket)
 	return false;
+if (ps.prev_token == lsym_sizeof)
+	return opt.proc_calls_space || opt.blank_after_sizeof;
 if (ps.prev_token != lsym_ident && ps.prev_token != lsym_funcname)
 	return true;
 if (opt.proc_calls_space)
@@ -1495,8 +1497,9 @@ main_loop(void)
 	process_type(_ind, _to_var);
 	goto copy_token;
 
-	case lsym_funcname:
+	case lsym_sizeof:
 	case lsym_ident:
+	case lsym_funcname:
 	process_ident(lsym, decl_ind, tabs_to_var, _expr,
 		_nl, hd);
 copy_token:

Index: src/usr.bin/indent/indent.h
diff -u src/usr.bin/indent/indent.h:1.68 src/usr.bin/indent/indent.h:1.69
--- src/usr.bin/indent/indent.h:1.68	Sun Oct 31 09:52:37 2021
+++ src/usr.bin/indent/indent.h	Sun Oct 31 10:00:37 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: indent.h,v 1.68 2021/10/31 09:52:37 rillig Exp $	*/
+/*	$NetBSD: indent.h,v 1.69 2021/10/31 10:00:37 rillig Exp $	*/
 
 /*-
  * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
@@ -95,6 +95,7 @@ typedef enum lexer_symbol {
 lsym_tag,			/* 'struct', 'union' or 'enum' */
 lsym_case_label,		/* 'case' or 'default' */
 lsym_string_prefix,		/* 'L' */
+lsym_sizeof,
 lsym_ident,			/* identifier, constant or string */
 lsym_funcname,
 lsym_do,

Index: src/usr.bin/indent/lexi.c
diff -u src/usr.bin/indent/lexi.c:1.119 src/usr.bin/indent/lexi.c:1.120
--- src/usr.bin/indent/lexi.c:1.119	Sun Oct 31 09:52:37 2021
+++ src/usr.bin/indent/lexi.c	Sun Oct 31 10:00:37 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: lexi.c,v 1.119 2021/10/31 09:52:37 rillig Exp $	*/
+/*	$NetBSD: lexi.c,v 1.120 2021/10/31 10:00:37 rillig Exp $	*/
 
 /*-
  * SPDX-License-Identifier: BSD-4-Clause
@@ -43,7 +43,7 @@ static char sccsid[] = "@(#)lexi.c	8.1 (
 
 #include 
 #if defined(__NetBSD__)
-__RCSID("$NetBSD: lexi.c,v 1.119 2021/10/31 09:52:37 rillig Exp $");
+__RCSID("$NetBSD: lexi.c,v 1.120 2021/10/31 10:00:37 rillig Exp $");
 #elif defined(__FreeBSD__)
 __FBSDID("$FreeBSD: head/usr.bin/indent/lexi.c 337862 2018-08-15 18:19:45Z pstef $");
 #endif
@@ -236,6 +236,7 @@ lsym_name(lexer_symbol sym)
 	"tag",
 	"case_label",
 	"string_prefix",
+	"sizeof",
 	"ident",
 	"funcname",
 	"do",
@@ -534,6 +535,7 @@ lexi_alnum(void)
 	case kw_do:		return lsym_do;
 	case kw_storage_class:	return lsym_storage_class;
 	case kw_typedef:	return lsym_typedef;
+	case kw_sizeof:		return lsym_sizeof;
 	default:		return lsym_ident;
 	}
 	/* INDENT ON */



CVS commit: src/usr.bin/indent

2021-10-31 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Oct 31 10:00:38 UTC 2021

Modified Files:
src/usr.bin/indent: indent.c indent.h lexi.c

Log Message:
indent: add separate lexer symbol for sizeof

The plan is to get rid of the type keyword_kind, which largely overlaps
with lexer_symbol.

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.196 -r1.197 src/usr.bin/indent/indent.c
cvs rdiff -u -r1.68 -r1.69 src/usr.bin/indent/indent.h
cvs rdiff -u -r1.119 -r1.120 src/usr.bin/indent/lexi.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/indent

2021-10-31 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Oct 31 09:52:37 UTC 2021

Modified Files:
src/usr.bin/indent: indent.h lexi.c

Log Message:
indent: clean up definition of keywords

Rename kw_struct_or_union_or_enum to the shorter kw_tag.

Merge kw_jump with kw_inline_or_restrict since they are handled in the
same way.

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.67 -r1.68 src/usr.bin/indent/indent.h
cvs rdiff -u -r1.118 -r1.119 src/usr.bin/indent/lexi.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/indent/indent.h
diff -u src/usr.bin/indent/indent.h:1.67 src/usr.bin/indent/indent.h:1.68
--- src/usr.bin/indent/indent.h:1.67	Sat Oct 30 22:41:18 2021
+++ src/usr.bin/indent/indent.h	Sun Oct 31 09:52:37 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: indent.h,v 1.67 2021/10/30 22:41:18 rillig Exp $	*/
+/*	$NetBSD: indent.h,v 1.68 2021/10/31 09:52:37 rillig Exp $	*/
 
 /*-
  * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
@@ -246,7 +246,7 @@ enum keyword_kind {
 kw_0,
 kw_offsetof,
 kw_sizeof,
-kw_struct_or_union_or_enum,
+kw_tag,			/* 'struct', 'union', 'enum' */
 kw_type,
 kw_for,
 kw_if,
@@ -255,10 +255,9 @@ enum keyword_kind {
 kw_else,
 kw_switch,
 kw_case_or_default,
-kw_jump,
 kw_storage_class,
 kw_typedef,
-kw_inline_or_restrict
+kw_other
 };
 
 

Index: src/usr.bin/indent/lexi.c
diff -u src/usr.bin/indent/lexi.c:1.118 src/usr.bin/indent/lexi.c:1.119
--- src/usr.bin/indent/lexi.c:1.118	Sun Oct 31 09:41:48 2021
+++ src/usr.bin/indent/lexi.c	Sun Oct 31 09:52:37 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: lexi.c,v 1.118 2021/10/31 09:41:48 rillig Exp $	*/
+/*	$NetBSD: lexi.c,v 1.119 2021/10/31 09:52:37 rillig Exp $	*/
 
 /*-
  * SPDX-License-Identifier: BSD-4-Clause
@@ -43,7 +43,7 @@ static char sccsid[] = "@(#)lexi.c	8.1 (
 
 #include 
 #if defined(__NetBSD__)
-__RCSID("$NetBSD: lexi.c,v 1.118 2021/10/31 09:41:48 rillig Exp $");
+__RCSID("$NetBSD: lexi.c,v 1.119 2021/10/31 09:52:37 rillig Exp $");
 #elif defined(__FreeBSD__)
 __FBSDID("$FreeBSD: head/usr.bin/indent/lexi.c 337862 2018-08-15 18:19:45Z pstef $");
 #endif
@@ -64,38 +64,38 @@ static const struct keyword {
 {"_Imaginary", kw_type},
 {"auto", kw_storage_class},
 {"bool", kw_type},
-{"break", kw_jump},
+{"break", kw_other},
 {"case", kw_case_or_default},
 {"char", kw_type},
 {"complex", kw_type},
 {"const", kw_type},
-{"continue", kw_jump},
+{"continue", kw_other},
 {"default", kw_case_or_default},
 {"do", kw_do},
 {"double", kw_type},
 {"else", kw_else},
-{"enum", kw_struct_or_union_or_enum},
+{"enum", kw_tag},
 {"extern", kw_storage_class},
 {"float", kw_type},
 {"for", kw_for},
-{"goto", kw_jump},
+{"goto", kw_other},
 {"if", kw_if},
 {"imaginary", kw_type},
-{"inline", kw_inline_or_restrict},
+{"inline", kw_other},
 {"int", kw_type},
 {"long", kw_type},
 {"offsetof", kw_offsetof},
 {"register", kw_storage_class},
-{"restrict", kw_inline_or_restrict},
-{"return", kw_jump},
+{"restrict", kw_other},
+{"return", kw_other},
 {"short", kw_type},
 {"signed", kw_type},
 {"sizeof", kw_sizeof},
 {"static", kw_storage_class},
-{"struct", kw_struct_or_union_or_enum},
+{"struct", kw_tag},
 {"switch", kw_switch},
 {"typedef", kw_typedef},
-{"union", kw_struct_or_union_or_enum},
+{"union", kw_tag},
 {"unsigned", kw_type},
 {"void", kw_type},
 {"volatile", kw_type},
@@ -256,7 +256,7 @@ kw_name(enum keyword_kind kw)
 	"0",
 	"offsetof",
 	"sizeof",
-	"struct_or_union_or_enum",
+	"tag",
 	"type",
 	"for",
 	"if",
@@ -265,10 +265,9 @@ kw_name(enum keyword_kind kw)
 	"else",
 	"switch",
 	"case_or_default",
-	"jump",
 	"storage_class",
 	"typedef",
-	"inline_or_restrict",
+	"other",
 };
 
 return name[kw];
@@ -524,7 +523,7 @@ lexi_alnum(void)
 
 	/* INDENT OFF */
 	switch (kw->kind) {
-	case kw_struct_or_union_or_enum:
+	case kw_tag:
 	case kw_type:		goto found_typename;
 	case kw_case_or_default: return lsym_case_label;
 	case kw_for:		return lsym_for;
@@ -545,7 +544,7 @@ found_typename:
 	ps.cast_mask |= (1 << ps.p_l_follow) & ~ps.not_cast_mask;
 	}
 	if (ps.prev_token != lsym_period && ps.prev_token != lsym_unary_op) {
-	if (kw != NULL && kw->kind == kw_struct_or_union_or_enum)
+	if (kw != NULL && kw->kind == kw_tag)
 		return lsym_tag;
 	if (ps.p_l_follow == 0)
 		return lsym_type;



CVS commit: src/usr.bin/indent

2021-10-31 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Oct 31 09:52:37 UTC 2021

Modified Files:
src/usr.bin/indent: indent.h lexi.c

Log Message:
indent: clean up definition of keywords

Rename kw_struct_or_union_or_enum to the shorter kw_tag.

Merge kw_jump with kw_inline_or_restrict since they are handled in the
same way.

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.67 -r1.68 src/usr.bin/indent/indent.h
cvs rdiff -u -r1.118 -r1.119 src/usr.bin/indent/lexi.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/indent

2021-10-31 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Oct 31 09:41:48 UTC 2021

Modified Files:
src/usr.bin/indent: lexi.c

Log Message:
indent: condense lexi_alnum

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.117 -r1.118 src/usr.bin/indent/lexi.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/indent

2021-10-31 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Oct 31 09:41:48 UTC 2021

Modified Files:
src/usr.bin/indent: lexi.c

Log Message:
indent: condense lexi_alnum

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.117 -r1.118 src/usr.bin/indent/lexi.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/indent/lexi.c
diff -u src/usr.bin/indent/lexi.c:1.117 src/usr.bin/indent/lexi.c:1.118
--- src/usr.bin/indent/lexi.c:1.117	Sat Oct 30 22:36:07 2021
+++ src/usr.bin/indent/lexi.c	Sun Oct 31 09:41:48 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: lexi.c,v 1.117 2021/10/30 22:36:07 rillig Exp $	*/
+/*	$NetBSD: lexi.c,v 1.118 2021/10/31 09:41:48 rillig Exp $	*/
 
 /*-
  * SPDX-License-Identifier: BSD-4-Clause
@@ -43,7 +43,7 @@ static char sccsid[] = "@(#)lexi.c	8.1 (
 
 #include 
 #if defined(__NetBSD__)
-__RCSID("$NetBSD: lexi.c,v 1.117 2021/10/30 22:36:07 rillig Exp $");
+__RCSID("$NetBSD: lexi.c,v 1.118 2021/10/31 09:41:48 rillig Exp $");
 #elif defined(__FreeBSD__)
 __FBSDID("$FreeBSD: head/usr.bin/indent/lexi.c 337862 2018-08-15 18:19:45Z pstef $");
 #endif
@@ -522,53 +522,33 @@ lexi_alnum(void)
 	ps.curr_keyword = kw->kind;
 	ps.next_unary = true;
 
+	/* INDENT OFF */
 	switch (kw->kind) {
-	case kw_switch:
-	return lsym_switch;
-
-	case kw_case_or_default:
-	return lsym_case_label;
-
 	case kw_struct_or_union_or_enum:
-	case kw_type:
-found_typename:
-	if (ps.p_l_follow > 0) {
-		/* inside parentheses: cast, param list, offsetof or sizeof */
-		ps.cast_mask |= (1 << ps.p_l_follow) & ~ps.not_cast_mask;
-	}
-	if (ps.prev_token == lsym_period ||
-		ps.prev_token == lsym_unary_op)
-		break;
+	case kw_type:		goto found_typename;
+	case kw_case_or_default: return lsym_case_label;
+	case kw_for:		return lsym_for;
+	case kw_if:		return lsym_if;
+	case kw_else:		return lsym_else;
+	case kw_switch:		return lsym_switch;
+	case kw_while:		return lsym_while;
+	case kw_do:		return lsym_do;
+	case kw_storage_class:	return lsym_storage_class;
+	case kw_typedef:	return lsym_typedef;
+	default:		return lsym_ident;
+	}
+	/* INDENT ON */
+
+found_typename:
+	if (ps.p_l_follow > 0) {
+	/* inside parentheses: cast, param list, offsetof or sizeof */
+	ps.cast_mask |= (1 << ps.p_l_follow) & ~ps.not_cast_mask;
+	}
+	if (ps.prev_token != lsym_period && ps.prev_token != lsym_unary_op) {
 	if (kw != NULL && kw->kind == kw_struct_or_union_or_enum)
 		return lsym_tag;
-	if (ps.p_l_follow > 0)
-		break;
-	return lsym_type;
-
-	case kw_for:
-	return lsym_for;
-
-	case kw_if:
-	return lsym_if;
-
-	case kw_while:
-	return lsym_while;
-
-	case kw_do:
-	return lsym_do;
-
-	case kw_else:
-	return lsym_else;
-
-	case kw_storage_class:
-	return lsym_storage_class;
-
-	case kw_typedef:
-	return lsym_typedef;
-
-	default:		/* all others are treated like any other
- * identifier */
-	return lsym_ident;
+	if (ps.p_l_follow == 0)
+		return lsym_type;
 	}
 }
 
@@ -577,13 +557,13 @@ lexi_alnum(void)
 
 	for (const char *p = inp.s; p < inp.e;)
 	if (*p++ == ')' && (*p == ';' || *p == ','))
-		goto not_proc;
+		goto no_function_definition;
 
 	strncpy(ps.procname, token.s, sizeof ps.procname - 1);
 	if (ps.in_decl)
 	ps.in_parameter_declaration = true;
 	return lsym_funcname;
-not_proc:;
+no_function_definition:;
 
 } else if (probably_typename()) {
 	ps.curr_keyword = kw_type;



CVS commit: src/lib/libcrypt

2021-10-31 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Sun Oct 31 09:16:08 UTC 2021

Modified Files:
src/lib/libcrypt: Makefile

Log Message:
libcrypt: Compile with USE_FORT, for this is cryptographic software.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/lib/libcrypt/Makefile

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

Modified files:

Index: src/lib/libcrypt/Makefile
diff -u src/lib/libcrypt/Makefile:1.31 src/lib/libcrypt/Makefile:1.32
--- src/lib/libcrypt/Makefile:1.31	Tue Oct 26 20:37:18 2021
+++ src/lib/libcrypt/Makefile	Sun Oct 31 09:16:08 2021
@@ -1,4 +1,6 @@
-#	$NetBSD: Makefile,v 1.31 2021/10/26 20:37:18 nia Exp $
+#	$NetBSD: Makefile,v 1.32 2021/10/31 09:16:08 nia Exp $
+
+USE_FORT?=	yes	# cryptographic software
 
 .include 
 



CVS commit: src/lib/libcrypt

2021-10-31 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Sun Oct 31 09:16:08 UTC 2021

Modified Files:
src/lib/libcrypt: Makefile

Log Message:
libcrypt: Compile with USE_FORT, for this is cryptographic software.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/lib/libcrypt/Makefile

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



CVS commit: src/sys/arch/aarch64/include

2021-10-31 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Oct 31 08:21:25 UTC 2021

Modified Files:
src/sys/arch/aarch64/include: cpu.h

Log Message:
Annotate some cpu_info members


To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.42 src/sys/arch/aarch64/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/aarch64/include/cpu.h
diff -u src/sys/arch/aarch64/include/cpu.h:1.41 src/sys/arch/aarch64/include/cpu.h:1.42
--- src/sys/arch/aarch64/include/cpu.h:1.41	Tue Oct 26 06:02:00 2021
+++ src/sys/arch/aarch64/include/cpu.h	Sun Oct 31 08:21:24 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu.h,v 1.41 2021/10/26 06:02:00 skrll Exp $ */
+/* $NetBSD: cpu.h,v 1.42 2021/10/31 08:21:24 skrll Exp $ */
 
 /*-
  * Copyright (c) 2014, 2020 The NetBSD Foundation, Inc.
@@ -134,8 +134,10 @@ struct cpu_info {
 	/* ACPI */
 	uint32_t ci_acpiid;	/* ACPI Processor Unique ID */
 
+	/* sysctl(9) exposed system registers */
 	struct aarch64_sysctl_cpu_id ci_id;
 
+	/* cache information and function pointers */
 	struct aarch64_cache_info *ci_cacheinfo;
 	struct aarch64_cpufuncs ci_cpufuncs;
 



CVS commit: src/sys/arch/aarch64/include

2021-10-31 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Oct 31 08:21:25 UTC 2021

Modified Files:
src/sys/arch/aarch64/include: cpu.h

Log Message:
Annotate some cpu_info members


To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.42 src/sys/arch/aarch64/include/cpu.h

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



CVS commit: src/doc/roadmaps

2021-10-31 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Sun Oct 31 08:19:29 UTC 2021

Modified Files:
src/doc/roadmaps: networking

Log Message:
Update networking roadmap.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/doc/roadmaps/networking

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

Modified files:

Index: src/doc/roadmaps/networking
diff -u src/doc/roadmaps/networking:1.14 src/doc/roadmaps/networking:1.15
--- src/doc/roadmaps/networking:1.14	Fri Jul 20 01:43:31 2018
+++ src/doc/roadmaps/networking	Sun Oct 31 08:19:29 2021
@@ -1,4 +1,4 @@
-$NetBSD: networking,v 1.14 2018/07/20 01:43:31 maya Exp $
+$NetBSD: networking,v 1.15 2021/10/31 08:19:29 nia Exp $
 
 NetBSD Networking Roadmap
 =
@@ -39,8 +39,11 @@ Status: committed, done
 
 Resync FreeBSD stack to get support for n, ac, VAP
 
-Responsible: phil
-Status: started porting FreeBSD code
+Responsible: martin, phil
+Status: see various wiki pages
+https://wiki.netbsd.org/Wifi_renewal_on_hg/
+https://wiki.netbsd.org/Converting_drivers_to_the_new_wifi_stack/
+https://wiki.netbsd.org/Driver_state_matrix/
 Comment[christos]: This will add VAP support too, and needs changes to all
 the specific drivers.
 
@@ -77,6 +80,8 @@ Add support for multicast DNS (name.loca
 Responsible: tsarna
 Status: not started
 Comment[christos]: XXX: Fill in the project description and justification.
+Comment[nia]: isn't this completed? we have mdnsd(8) and multicast support
+in nsswitch.conf(5)
 
 
 6. tcp support in libsa



CVS commit: src/doc/roadmaps

2021-10-31 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Sun Oct 31 08:19:29 UTC 2021

Modified Files:
src/doc/roadmaps: networking

Log Message:
Update networking roadmap.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/doc/roadmaps/networking

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



CVS commit: src/doc/roadmaps

2021-10-31 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Sun Oct 31 08:11:13 UTC 2021

Modified Files:
src/doc/roadmaps: ports

Log Message:
drm++


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/doc/roadmaps/ports

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

Modified files:

Index: src/doc/roadmaps/ports
diff -u src/doc/roadmaps/ports:1.8 src/doc/roadmaps/ports:1.9
--- src/doc/roadmaps/ports:1.8	Fri Jul 20 01:52:07 2018
+++ src/doc/roadmaps/ports	Sun Oct 31 08:11:13 2021
@@ -1,4 +1,4 @@
-$NetBSD: ports,v 1.8 2018/07/20 01:52:07 maya Exp $
+$NetBSD: ports,v 1.9 2021/10/31 08:11:13 nia Exp $
 
 NetBSD Ports Roadmap
 
@@ -29,7 +29,7 @@ Explanations
 
  0. DRMKMS update
 
-The DRM drivers get old with time. The current drivers are from Linux 3.15,
+The DRM drivers get old with time. The current drivers are from Linux 4.4,
 having a newer version would be nice.
 
 - As of July 2018, maya is working on this.



CVS commit: src/doc/roadmaps

2021-10-31 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Sun Oct 31 08:11:13 UTC 2021

Modified Files:
src/doc/roadmaps: ports

Log Message:
drm++


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/doc/roadmaps/ports

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



CVS commit: src/sys/arch/aarch64/aarch64

2021-10-31 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Oct 31 07:56:55 UTC 2021

Modified Files:
src/sys/arch/aarch64/aarch64: cpufunc.c

Log Message:
Sprinkle some const


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/sys/arch/aarch64/aarch64/cpufunc.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/cpufunc.c
diff -u src/sys/arch/aarch64/aarch64/cpufunc.c:1.30 src/sys/arch/aarch64/aarch64/cpufunc.c:1.31
--- src/sys/arch/aarch64/aarch64/cpufunc.c:1.30	Sat Oct 23 06:48:31 2021
+++ src/sys/arch/aarch64/aarch64/cpufunc.c	Sun Oct 31 07:56:55 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpufunc.c,v 1.30 2021/10/23 06:48:31 skrll Exp $	*/
+/*	$NetBSD: cpufunc.c,v 1.31 2021/10/31 07:56:55 skrll Exp $	*/
 
 /*
  * Copyright (c) 2017 Ryo Shimizu 
@@ -30,7 +30,7 @@
 #include "opt_multiprocessor.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cpufunc.c,v 1.30 2021/10/23 06:48:31 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpufunc.c,v 1.31 2021/10/31 07:56:55 skrll Exp $");
 
 #include 
 #include 
@@ -313,11 +313,10 @@ prt_cache(device_t self, struct aarch64_
 void
 aarch64_printcacheinfo(device_t dev)
 {
-	struct aarch64_cache_info *cinfo;
+	struct cpu_info * const ci = curcpu();
+	struct aarch64_cache_info * const cinfo = ci->ci_cacheinfo;
 	int level;
 
-	cinfo = curcpu()->ci_cacheinfo;
-
 	for (level = 0; level < MAX_CACHE_LEVEL; level++)
 		if (prt_cache(dev, cinfo, level) < 0)
 			break;
@@ -382,11 +381,10 @@ ln_dcache_inv_all(int level, struct aarc
 void
 aarch64_dcache_wbinv_all(void)
 {
-	struct aarch64_cache_info *cinfo;
+	struct cpu_info * const ci = curcpu();
+	struct aarch64_cache_info * const cinfo = ci->ci_cacheinfo;
 	int level;
 
-	cinfo = curcpu()->ci_cacheinfo;
-
 	for (level = 0; level < MAX_CACHE_LEVEL; level++) {
 		if (cinfo[level].cacheable == CACHE_CACHEABLE_NONE)
 			break;
@@ -400,11 +398,10 @@ aarch64_dcache_wbinv_all(void)
 void
 aarch64_dcache_inv_all(void)
 {
-	struct aarch64_cache_info *cinfo;
+	struct cpu_info * const ci = curcpu();
+	struct aarch64_cache_info * const cinfo = ci->ci_cacheinfo;
 	int level;
 
-	cinfo = curcpu()->ci_cacheinfo;
-
 	for (level = 0; level < MAX_CACHE_LEVEL; level++) {
 		if (cinfo[level].cacheable == CACHE_CACHEABLE_NONE)
 			break;
@@ -418,11 +415,10 @@ aarch64_dcache_inv_all(void)
 void
 aarch64_dcache_wb_all(void)
 {
-	struct aarch64_cache_info *cinfo;
+	struct cpu_info * const ci = curcpu();
+	struct aarch64_cache_info * const cinfo = ci->ci_cacheinfo;
 	int level;
 
-	cinfo = curcpu()->ci_cacheinfo;
-
 	for (level = 0; level < MAX_CACHE_LEVEL; level++) {
 		if (cinfo[level].cacheable == CACHE_CACHEABLE_NONE)
 			break;



CVS commit: src/sys/arch/aarch64/aarch64

2021-10-31 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Oct 31 07:56:55 UTC 2021

Modified Files:
src/sys/arch/aarch64/aarch64: cpufunc.c

Log Message:
Sprinkle some const


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/sys/arch/aarch64/aarch64/cpufunc.c

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