CVS commit: src/sys/arch/riscv

2020-11-03 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Nov  4 07:51:09 UTC 2020

Modified Files:
src/sys/arch/riscv/include: frame.h
src/sys/arch/riscv/riscv: genassym.cf

Log Message:
Fix some of the previous - I must have compile tested the wrong tree


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/riscv/include/frame.h
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/riscv/riscv/genassym.cf

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



CVS commit: src/sys/arch/riscv

2020-11-03 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Nov  4 07:51:09 UTC 2020

Modified Files:
src/sys/arch/riscv/include: frame.h
src/sys/arch/riscv/riscv: genassym.cf

Log Message:
Fix some of the previous - I must have compile tested the wrong tree


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/riscv/include/frame.h
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/riscv/riscv/genassym.cf

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/riscv/include/frame.h
diff -u src/sys/arch/riscv/include/frame.h:1.3 src/sys/arch/riscv/include/frame.h:1.4
--- src/sys/arch/riscv/include/frame.h:1.3	Wed Nov  4 06:56:56 2020
+++ src/sys/arch/riscv/include/frame.h	Wed Nov  4 07:51:08 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: frame.h,v 1.3 2020/11/04 06:56:56 skrll Exp $ */
+/* $NetBSD: frame.h,v 1.4 2020/11/04 07:51:08 skrll Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -36,9 +36,9 @@
 
 struct trapframe {
 	struct reg tf_regs __aligned(8);
-	register_t tf_stval;		// supervisor trap value
-	register_t tf_sepc;		// supervisor exception program counter
-	register_t tf_scause;		// supervisor cause register
+	register_t tf_tval;		// supervisor trap value
+	register_t tf_pc;		// supervisor exception program counter
+	register_t tf_cause;		// supervisor cause register
 	register_t tf_sr;		// supervisor status register
 #define tf_reg		tf_regs.r_reg
 #define tf_a0		tf_reg[_X_A0]

Index: src/sys/arch/riscv/riscv/genassym.cf
diff -u src/sys/arch/riscv/riscv/genassym.cf:1.8 src/sys/arch/riscv/riscv/genassym.cf:1.9
--- src/sys/arch/riscv/riscv/genassym.cf:1.8	Wed Nov  4 06:56:56 2020
+++ src/sys/arch/riscv/riscv/genassym.cf	Wed Nov  4 07:51:08 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: genassym.cf,v 1.8 2020/11/04 06:56:56 skrll Exp $
+#	$NetBSD: genassym.cf,v 1.9 2020/11/04 07:51:08 skrll Exp $
 #-
 # Copyright (c) 2014 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -107,8 +107,8 @@ define	TF_T5		offsetof(struct trapframe,
 define	TF_T6		offsetof(struct trapframe, tf_reg[_X_T6])
 define	TF_GP		offsetof(struct trapframe, tf_reg[_X_GP])
 define	TF_PC		offsetof(struct trapframe, tf_pc)
-define	TF_SCAUSE	offsetof(struct trapframe, tf_scause)
-define	TF_STVAL	offsetof(struct trapframe, tf_stval)
+define	TF_CAUSE	offsetof(struct trapframe, tf_cause)
+define	TF_TVA	L	offsetof(struct trapframe, tf_tval)
 define	TF_SR		offsetof(struct trapframe, tf_sr)
 
 define	L_CPU		offsetof(struct lwp, l_cpu)



Re: CVS commit: src/sys

2020-11-03 Thread Rin Okuyama

Hello again,

On 2020/11/02 3:51, Paul Goyette wrote:

Module Name:src
Committed By:   pgoyette
Date:   Sun Nov  1 18:51:03 UTC 2020

Modified Files:
src/sys/compat/netbsd32: netbsd32.h netbsd32_core.c
src/sys/kern: compat_stub.c files.kern kern_core.c kern_sig.c
sys_ptrace_common.c
src/sys/modules: Makefile
src/sys/modules/compat_netbsd32: Makefile
src/sys/modules/coredump: Makefile
src/sys/sys: compat_stub.h param.h signalvar.h
Added Files:
src/sys/modules/compat_netbsd32_coredump: Makefile

Log Message:
Separate the compat_netbsd32_coredump from the compat_netbsd32 and
coredump modules, into its own module.

Welcome to 7.99.75 !!!


To generate a diff of this commit:
cvs rdiff -u -r1.133 -r1.134 src/sys/compat/netbsd32/netbsd32.h
cvs rdiff -u -r1.15 -r1.16 src/sys/compat/netbsd32/netbsd32_core.c
cvs rdiff -u -r1.20 -r1.21 src/sys/kern/compat_stub.c
cvs rdiff -u -r1.53 -r1.54 src/sys/kern/files.kern
cvs rdiff -u -r1.33 -r1.34 src/sys/kern/kern_core.c
cvs rdiff -u -r1.394 -r1.395 src/sys/kern/kern_sig.c
cvs rdiff -u -r1.88 -r1.89 src/sys/kern/sys_ptrace_common.c
cvs rdiff -u -r1.247 -r1.248 src/sys/modules/Makefile
cvs rdiff -u -r1.35 -r1.36 src/sys/modules/compat_netbsd32/Makefile
cvs rdiff -u -r0 -r1.1 src/sys/modules/compat_netbsd32_coredump/Makefile
cvs rdiff -u -r1.7 -r1.8 src/sys/modules/coredump/Makefile
cvs rdiff -u -r1.24 -r1.25 src/sys/sys/compat_stub.h
cvs rdiff -u -r1.677 -r1.678 src/sys/sys/param.h
cvs rdiff -u -r1.102 -r1.103 src/sys/sys/signalvar.h

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


This commit breaks arm, i.e., ILP32 arch with COMPAT_NETBSD32. For arm,
coredump_elf32_hook is already hooked in the main kernel. Therefore,
compat_netbsd32_coredump_modcmd(MODULE_CMD_INIT) causes KASSERT failure:

panic: kernel diagnostic assertion "!*hooked" failed: file 
"../../../../kern/kern_module_hook.c", line 70

Does the attached patch seem reasonable to you?

Thanks,
rin
Index: sys/compat/netbsd32/netbsd32_core.c
===
RCS file: /home/netbsd/src/sys/compat/netbsd32/netbsd32_core.c,v
retrieving revision 1.16
diff -p -u -r1.16 netbsd32_core.c
--- sys/compat/netbsd32/netbsd32_core.c 1 Nov 2020 18:51:02 -   1.16
+++ sys/compat/netbsd32/netbsd32_core.c 4 Nov 2020 06:52:52 -
@@ -68,11 +68,15 @@ compat_netbsd32_coredump_modcmd(modcmd_t
switch (cmd) {
case MODULE_CMD_INIT:
MODULE_HOOK_SET(coredump_netbsd32_hook, real_coredump_netbsd32);
+#ifdef _LP64
MODULE_HOOK_SET(coredump_elf32_hook, real_coredump_elf32);
+#endif
return 0;
case MODULE_CMD_FINI:
MODULE_HOOK_UNSET(coredump_netbsd32_hook);
+#ifdef _LP64
MODULE_HOOK_UNSET(coredump_elf32_hook);
+#endif
return 0;
default:
return ENOTTY;


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

2020-11-03 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Nov  4 07:41:34 UTC 2020

Modified Files:
src/sys/arch/riscv/include: reg.h

Log Message:
whitespace in comments


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/riscv/include/reg.h

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



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

2020-11-03 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Nov  4 07:41:34 UTC 2020

Modified Files:
src/sys/arch/riscv/include: reg.h

Log Message:
whitespace in comments


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/riscv/include/reg.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/riscv/include/reg.h
diff -u src/sys/arch/riscv/include/reg.h:1.4 src/sys/arch/riscv/include/reg.h:1.5
--- src/sys/arch/riscv/include/reg.h:1.4	Wed Nov  4 07:40:15 2020
+++ src/sys/arch/riscv/include/reg.h	Wed Nov  4 07:41:34 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: reg.h,v 1.4 2020/11/04 07:40:15 skrll Exp $ */
+/* $NetBSD: reg.h,v 1.5 2020/11/04 07:41:34 skrll Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -32,18 +32,18 @@
 #ifndef _RISCV_REG_H_
 #define _RISCV_REG_H_
 
-// x0 = 0
-// x1 = ra (return address)
-// x2 = sp (stack pointer)
-// x3 = gp (global pointer)
-// x4 = tp (thread pointer)
-// x5-x7 = t0-t2 (temporary)
-// x8 = s0/fp (saved register / frame pointer)
-// x9 = s1 (saved register)
-// x10-x11 = a0-a1 (arguments/return values)
-// x12-x17 = a2-a7 (arguments)
-// x18-x27 = s2-s11 (saved registers)
-// x28-x31 = t3-r6 (temporaries)
+// x0		= 0
+// x1		= ra		(return address)
+// x2		= sp		(stack pointer)
+// x3		= gp		(global pointer)
+// x4		= tp		(thread pointer)
+// x5 - x7	= t0 - t2	(temporary)
+// x8		= s0/fp		(saved register / frame pointer)
+// x9		= s1		(saved register)
+// x10 - x11	= a0 - a1	(arguments/return values)
+// x12 - x17	= a2 - a7	(arguments)
+// x18 - x27	= s2 - s11	(saved registers)
+// x28 - x31	= t3 - r6	(temporaries)
 
 struct reg {	// synced with register_t in 
 #ifdef _LP64



Re: CVS commit: src/sys/kern

2020-11-03 Thread Rin Okuyama

Hi,

On 2020/10/26 0:55, Paul Goyette wrote:

Module Name:src
Committed By:   pgoyette
Date:   Sun Oct 25 15:55:37 UTC 2020

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

Log Message:
ptrace_Common is a module unto itself.  Don't use the ptrace module's
init/fini routines.


To generate a diff of this commit:
cvs rdiff -u -r1.87 -r1.88 src/sys/kern/sys_ptrace_common.c

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


This commit makes ptrace(2) unusable for non-privileged users;
ptrace_common_{init,fini}() should be called from somewhere.

Thanks,
rin


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

2020-11-03 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Nov  4 07:40:15 UTC 2020

Modified Files:
src/sys/arch/riscv/include: reg.h

Log Message:
typo in comment


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/riscv/include/reg.h

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



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

2020-11-03 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Nov  4 07:40:15 UTC 2020

Modified Files:
src/sys/arch/riscv/include: reg.h

Log Message:
typo in comment


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/riscv/include/reg.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/riscv/include/reg.h
diff -u src/sys/arch/riscv/include/reg.h:1.3 src/sys/arch/riscv/include/reg.h:1.4
--- src/sys/arch/riscv/include/reg.h:1.3	Wed Nov  4 06:24:44 2020
+++ src/sys/arch/riscv/include/reg.h	Wed Nov  4 07:40:15 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: reg.h,v 1.3 2020/11/04 06:24:44 skrll Exp $ */
+/* $NetBSD: reg.h,v 1.4 2020/11/04 07:40:15 skrll Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -42,7 +42,7 @@
 // x9 = s1 (saved register)
 // x10-x11 = a0-a1 (arguments/return values)
 // x12-x17 = a2-a7 (arguments)
-// x18-r27 = s2-s11 (saved registers)
+// x18-x27 = s2-s11 (saved registers)
 // x28-x31 = t3-r6 (temporaries)
 
 struct reg {	// synced with register_t in 



CVS commit: src/sys/arch/riscv

2020-11-03 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Nov  4 07:09:46 UTC 2020

Modified Files:
src/sys/arch/riscv/conf: kern.ldscript
src/sys/arch/riscv/htif: htif.c htif_cons.c htif_disk.c htif_var.h
src/sys/arch/riscv/include: insn.h locore.h
src/sys/arch/riscv/riscv: autoconf.c clock_machdep.c core_machdep.c
cpu_mainbus.c cpu_subr.c db_disasm.c db_machdep.c db_trace.c
exec_machdep.c fixup.c kobj_machdep.c locore.S mainbus.c
netbsd32_machdep.c process_machdep.c procfs_machdep.c
riscv_machdep.c sig_machdep.c softint_machdep.c spl.S stubs.c
sys_machdep.c trap.c

Log Message:
RCSID and whitespace police...


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/riscv/conf/kern.ldscript
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/riscv/htif/htif.c \
src/sys/arch/riscv/htif/htif_cons.c src/sys/arch/riscv/htif/htif_disk.c \
src/sys/arch/riscv/htif/htif_var.h
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/riscv/include/insn.h
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/riscv/include/locore.h
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/riscv/riscv/autoconf.c \
src/sys/arch/riscv/riscv/cpu_mainbus.c \
src/sys/arch/riscv/riscv/cpu_subr.c src/sys/arch/riscv/riscv/db_disasm.c \
src/sys/arch/riscv/riscv/db_trace.c \
src/sys/arch/riscv/riscv/exec_machdep.c src/sys/arch/riscv/riscv/fixup.c \
src/sys/arch/riscv/riscv/mainbus.c \
src/sys/arch/riscv/riscv/softint_machdep.c \
src/sys/arch/riscv/riscv/stubs.c src/sys/arch/riscv/riscv/sys_machdep.c
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/riscv/riscv/clock_machdep.c \
src/sys/arch/riscv/riscv/procfs_machdep.c
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/riscv/riscv/core_machdep.c \
src/sys/arch/riscv/riscv/netbsd32_machdep.c
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/riscv/riscv/db_machdep.c
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/riscv/riscv/kobj_machdep.c \
src/sys/arch/riscv/riscv/process_machdep.c \
src/sys/arch/riscv/riscv/sig_machdep.c src/sys/arch/riscv/riscv/spl.S
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/riscv/riscv/locore.S
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/riscv/riscv/riscv_machdep.c \
src/sys/arch/riscv/riscv/trap.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/riscv

2020-11-03 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Nov  4 07:09:46 UTC 2020

Modified Files:
src/sys/arch/riscv/conf: kern.ldscript
src/sys/arch/riscv/htif: htif.c htif_cons.c htif_disk.c htif_var.h
src/sys/arch/riscv/include: insn.h locore.h
src/sys/arch/riscv/riscv: autoconf.c clock_machdep.c core_machdep.c
cpu_mainbus.c cpu_subr.c db_disasm.c db_machdep.c db_trace.c
exec_machdep.c fixup.c kobj_machdep.c locore.S mainbus.c
netbsd32_machdep.c process_machdep.c procfs_machdep.c
riscv_machdep.c sig_machdep.c softint_machdep.c spl.S stubs.c
sys_machdep.c trap.c

Log Message:
RCSID and whitespace police...


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/riscv/conf/kern.ldscript
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/riscv/htif/htif.c \
src/sys/arch/riscv/htif/htif_cons.c src/sys/arch/riscv/htif/htif_disk.c \
src/sys/arch/riscv/htif/htif_var.h
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/riscv/include/insn.h
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/riscv/include/locore.h
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/riscv/riscv/autoconf.c \
src/sys/arch/riscv/riscv/cpu_mainbus.c \
src/sys/arch/riscv/riscv/cpu_subr.c src/sys/arch/riscv/riscv/db_disasm.c \
src/sys/arch/riscv/riscv/db_trace.c \
src/sys/arch/riscv/riscv/exec_machdep.c src/sys/arch/riscv/riscv/fixup.c \
src/sys/arch/riscv/riscv/mainbus.c \
src/sys/arch/riscv/riscv/softint_machdep.c \
src/sys/arch/riscv/riscv/stubs.c src/sys/arch/riscv/riscv/sys_machdep.c
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/riscv/riscv/clock_machdep.c \
src/sys/arch/riscv/riscv/procfs_machdep.c
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/riscv/riscv/core_machdep.c \
src/sys/arch/riscv/riscv/netbsd32_machdep.c
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/riscv/riscv/db_machdep.c
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/riscv/riscv/kobj_machdep.c \
src/sys/arch/riscv/riscv/process_machdep.c \
src/sys/arch/riscv/riscv/sig_machdep.c src/sys/arch/riscv/riscv/spl.S
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/riscv/riscv/locore.S
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/riscv/riscv/riscv_machdep.c \
src/sys/arch/riscv/riscv/trap.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/riscv/conf/kern.ldscript
diff -u src/sys/arch/riscv/conf/kern.ldscript:1.6 src/sys/arch/riscv/conf/kern.ldscript:1.7
--- src/sys/arch/riscv/conf/kern.ldscript:1.6	Sun Jun 16 07:42:52 2019
+++ src/sys/arch/riscv/conf/kern.ldscript	Wed Nov  4 07:09:45 2020
@@ -1,3 +1,5 @@
+/*	$NetBSD: kern.ldscript,v 1.7 2020/11/04 07:09:45 skrll Exp $	*/
+
 OUTPUT_ARCH(riscv)
 ENTRY(start)
 

Index: src/sys/arch/riscv/htif/htif.c
diff -u src/sys/arch/riscv/htif/htif.c:1.1 src/sys/arch/riscv/htif/htif.c:1.2
--- src/sys/arch/riscv/htif/htif.c:1.1	Sat Mar 28 16:13:56 2015
+++ src/sys/arch/riscv/htif/htif.c	Wed Nov  4 07:09:45 2020
@@ -1,3 +1,5 @@
+/*	$NetBSD: htif.c,v 1.2 2020/11/04 07:09:45 skrll Exp $	*/
+
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -29,7 +31,7 @@
 
 #include 
 
-__RCSID("$NetBSD: htif.c,v 1.1 2015/03/28 16:13:56 matt Exp $");
+__RCSID("$NetBSD: htif.c,v 1.2 2020/11/04 07:09:45 skrll Exp $");
 
 #include 
 #include 
Index: src/sys/arch/riscv/htif/htif_cons.c
diff -u src/sys/arch/riscv/htif/htif_cons.c:1.1 src/sys/arch/riscv/htif/htif_cons.c:1.2
--- src/sys/arch/riscv/htif/htif_cons.c:1.1	Sat Mar 28 16:13:56 2015
+++ src/sys/arch/riscv/htif/htif_cons.c	Wed Nov  4 07:09:45 2020
@@ -1,3 +1,5 @@
+/*	$NetBSD: htif_cons.c,v 1.2 2020/11/04 07:09:45 skrll Exp $	*/
+
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -29,7 +31,7 @@
 
 #include 
 
-__RCSID("$NetBSD: htif_cons.c,v 1.1 2015/03/28 16:13:56 matt Exp $");
+__RCSID("$NetBSD: htif_cons.c,v 1.2 2020/11/04 07:09:45 skrll Exp $");
 
 #include 
 #include 
Index: src/sys/arch/riscv/htif/htif_disk.c
diff -u src/sys/arch/riscv/htif/htif_disk.c:1.1 src/sys/arch/riscv/htif/htif_disk.c:1.2
--- src/sys/arch/riscv/htif/htif_disk.c:1.1	Sat Mar 28 16:13:56 2015
+++ src/sys/arch/riscv/htif/htif_disk.c	Wed Nov  4 07:09:45 2020
@@ -1,3 +1,5 @@
+/*	$NetBSD: htif_disk.c,v 1.2 2020/11/04 07:09:45 skrll Exp $	*/
+
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -29,7 +31,7 @@
 
 #include 
 
-__RCSID("$NetBSD: htif_disk.c,v 1.1 2015/03/28 16:13:56 matt Exp $");
+__RCSID("$NetBSD: htif_disk.c,v 1.2 2020/11/04 07:09:45 skrll Exp $");
 
 #include 
 #include 
Index: src/sys/arch/riscv/htif/htif_var.h
diff -u src/sys/arch/riscv/htif/htif_var.h:1.1 src/sys/arch/riscv/htif/htif_var.h:1.2
--- src/sys/arch/riscv/htif/htif_var.h:1.1	Sat Mar 28 16:13:56 2015
+++ src/sys/arch/riscv/htif/htif_var.h	Wed Nov  4 07:09:45 2020
@@ -1,4 +1,5 @@
-/* $NetBSD: htif_var.h,v 1.1 2015/03/28 16:13:56 matt Exp $ */
+/* $NetBSD: htif_var.h,v 1.2 2020/11/04 

CVS commit: src/sys/arch/riscv

2020-11-03 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Nov  4 06:56:56 UTC 2020

Modified Files:
src/sys/arch/riscv/conf: GENERIC files.riscv
src/sys/arch/riscv/include: frame.h locore.h sysreg.h
src/sys/arch/riscv/riscv: core_machdep.c db_machdep.c genassym.cf
locore.S trap.c

Log Message:
Miscellaneous updates to reflect riscv-privileged-20190608.pdf

Some from zmcgrew@


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/riscv/conf/GENERIC
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/riscv/conf/files.riscv
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/riscv/include/frame.h
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/riscv/include/locore.h
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/riscv/include/sysreg.h
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/riscv/riscv/core_machdep.c
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/riscv/riscv/db_machdep.c
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/riscv/riscv/genassym.cf
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/riscv/riscv/locore.S
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/riscv/riscv/trap.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/riscv

2020-11-03 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Nov  4 06:56:56 UTC 2020

Modified Files:
src/sys/arch/riscv/conf: GENERIC files.riscv
src/sys/arch/riscv/include: frame.h locore.h sysreg.h
src/sys/arch/riscv/riscv: core_machdep.c db_machdep.c genassym.cf
locore.S trap.c

Log Message:
Miscellaneous updates to reflect riscv-privileged-20190608.pdf

Some from zmcgrew@


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/riscv/conf/GENERIC
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/riscv/conf/files.riscv
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/riscv/include/frame.h
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/riscv/include/locore.h
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/riscv/include/sysreg.h
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/riscv/riscv/core_machdep.c
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/riscv/riscv/db_machdep.c
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/riscv/riscv/genassym.cf
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/riscv/riscv/locore.S
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/riscv/riscv/trap.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/riscv/conf/GENERIC
diff -u src/sys/arch/riscv/conf/GENERIC:1.10 src/sys/arch/riscv/conf/GENERIC:1.11
--- src/sys/arch/riscv/conf/GENERIC:1.10	Sat Jun  1 12:42:27 2019
+++ src/sys/arch/riscv/conf/GENERIC	Wed Nov  4 06:56:56 2020
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.10 2019/06/01 12:42:27 maxv Exp $
+# $NetBSD: GENERIC,v 1.11 2020/11/04 06:56:56 skrll Exp $
 #
 # GENERIC machine description file
 #
@@ -22,12 +22,12 @@ include	"arch/riscv/conf/std.riscv64"
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		"GENERIC-$Revision: 1.10 $"
+#ident 		"GENERIC-$Revision: 1.11 $"
 
 maxusers	64		# estimated number of users
 
 # Standard system options
-
+#options 	FPE		# Floating-point extension support
 options 	NTP		# NTP phase/frequency locked loop
 
 options 	KTRACE		# system call tracing via ktrace(1)

Index: src/sys/arch/riscv/conf/files.riscv
diff -u src/sys/arch/riscv/conf/files.riscv:1.6 src/sys/arch/riscv/conf/files.riscv:1.7
--- src/sys/arch/riscv/conf/files.riscv:1.6	Wed Oct 21 13:31:51 2020
+++ src/sys/arch/riscv/conf/files.riscv	Wed Nov  4 06:56:56 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: files.riscv,v 1.6 2020/10/21 13:31:51 christos Exp $
+#	$NetBSD: files.riscv,v 1.7 2020/11/04 06:56:56 skrll Exp $
 #
 
 maxpartitions	16
@@ -14,7 +14,7 @@ file	arch/riscv/riscv/cpu_subr.c
 file	arch/riscv/riscv/db_disasm.c		ddb
 file	arch/riscv/riscv/db_trace.c		ddb
 file	arch/riscv/riscv/fixup.c
-file	arch/riscv/riscv/fpu.c
+file	arch/riscv/riscv/fpu.c			fpe
 file	arch/riscv/riscv/ipifuncs.c		multiprocessor
 file	arch/riscv/riscv/stubs.c
 file	arch/riscv/riscv/syscall.c		# syscall handler

Index: src/sys/arch/riscv/include/frame.h
diff -u src/sys/arch/riscv/include/frame.h:1.2 src/sys/arch/riscv/include/frame.h:1.3
--- src/sys/arch/riscv/include/frame.h:1.2	Sat Mar 14 16:12:16 2020
+++ src/sys/arch/riscv/include/frame.h	Wed Nov  4 06:56:56 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: frame.h,v 1.2 2020/03/14 16:12:16 skrll Exp $ */
+/* $NetBSD: frame.h,v 1.3 2020/11/04 06:56:56 skrll Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -36,10 +36,10 @@
 
 struct trapframe {
 	struct reg tf_regs __aligned(8);
-	register_t tf_badvaddr;
-	register_t tf_pc;
-	uint32_t tf_cause;		// 32-bit register
-	uint32_t tf_sr;			// 32-bit register
+	register_t tf_stval;		// supervisor trap value
+	register_t tf_sepc;		// supervisor exception program counter
+	register_t tf_scause;		// supervisor cause register
+	register_t tf_sr;		// supervisor status register
 #define tf_reg		tf_regs.r_reg
 #define tf_a0		tf_reg[_X_A0]
 #define tf_t0		tf_reg[_X_T0]

Index: src/sys/arch/riscv/include/locore.h
diff -u src/sys/arch/riscv/include/locore.h:1.5 src/sys/arch/riscv/include/locore.h:1.6
--- src/sys/arch/riscv/include/locore.h:1.5	Sat Mar 14 16:12:16 2020
+++ src/sys/arch/riscv/include/locore.h	Wed Nov  4 06:56:56 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: locore.h,v 1.5 2020/03/14 16:12:16 skrll Exp $ */
+/* $NetBSD: locore.h,v 1.6 2020/11/04 06:56:56 skrll Exp $ */
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -39,9 +39,9 @@
 
 struct trapframe {
 	struct reg tf_regs;
-	register_t tf_badaddr;
-	uint32_t tf_cause;		// 32-bit register
-	uint32_t tf_sr;			// 32-bit register
+	register_t tf_tval;
+	register_t tf_cause;
+	register_t tf_sr;
 #define tf_reg		tf_regs.r_reg
 #define tf_pc		tf_regs.r_pc
 #define tf_ra		tf_reg[_X_RA]
@@ -80,9 +80,9 @@ struct trapframe {
 // For COMPAT_NETBSD32 coredumps
 struct trapframe32 {
 	struct reg32 tf_regs;
-	register32_t tf_badaddr;
-	uint32_t tf_cause;		// 32-bit register
-	uint32_t tf_sr;			// 32-bit register
+	register32_t tf_tval;
+	register32_t tf_cause;
+	register32_t tf_sr;
 };
 
 #define FB_A0	0
@@ -105,7 +105,7 @@ struct trapframe32 {
 
 struct 

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

2020-11-03 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Nov  4 06:24:44 UTC 2020

Modified Files:
src/sys/arch/riscv/include: reg.h

Log Message:
Remove incorrect comment


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/riscv/include/reg.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/riscv/include/reg.h
diff -u src/sys/arch/riscv/include/reg.h:1.2 src/sys/arch/riscv/include/reg.h:1.3
--- src/sys/arch/riscv/include/reg.h:1.2	Fri Mar 27 06:57:21 2015
+++ src/sys/arch/riscv/include/reg.h	Wed Nov  4 06:24:44 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: reg.h,v 1.2 2015/03/27 06:57:21 matt Exp $ */
+/* $NetBSD: reg.h,v 1.3 2020/11/04 06:24:44 skrll Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -44,7 +44,6 @@
 // x12-x17 = a2-a7 (arguments)
 // x18-r27 = s2-s11 (saved registers)
 // x28-x31 = t3-r6 (temporaries)
-// x26-x30 = t0-t4 (temporary)
 
 struct reg {	// synced with register_t in 
 #ifdef _LP64



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

2020-11-03 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Nov  4 06:24:44 UTC 2020

Modified Files:
src/sys/arch/riscv/include: reg.h

Log Message:
Remove incorrect comment


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/riscv/include/reg.h

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



CVS commit: src/usr.bin/make

2020-11-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Wed Nov  4 06:09:55 UTC 2020

Modified Files:
src/usr.bin/make: parse.c

Log Message:
make(1): fix indentation in parse.c


To generate a diff of this commit:
cvs rdiff -u -r1.424 -r1.425 src/usr.bin/make/parse.c

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

Modified files:

Index: src/usr.bin/make/parse.c
diff -u src/usr.bin/make/parse.c:1.424 src/usr.bin/make/parse.c:1.425
--- src/usr.bin/make/parse.c:1.424	Wed Nov  4 04:49:32 2020
+++ src/usr.bin/make/parse.c	Wed Nov  4 06:09:55 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: parse.c,v 1.424 2020/11/04 04:49:32 rillig Exp $	*/
+/*	$NetBSD: parse.c,v 1.425 2020/11/04 06:09:55 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -117,7 +117,7 @@
 #include "pathnames.h"
 
 /*	"@(#)parse.c	8.3 (Berkeley) 3/19/94"	*/
-MAKE_RCSID("$NetBSD: parse.c,v 1.424 2020/11/04 04:49:32 rillig Exp $");
+MAKE_RCSID("$NetBSD: parse.c,v 1.425 2020/11/04 06:09:55 rillig Exp $");
 
 /* types and constants */
 
@@ -1850,7 +1850,7 @@ Parse_IsVar(const char *p, VarAssign *ou
 
 /* Scan for one of the assignment operators outside a variable expansion */
 while (*p != '\0') {
-char ch = *p++;
+	char ch = *p++;
 	if (ch == '(' || ch == '{') {
 	level++;
 	continue;



CVS commit: src/usr.bin/make

2020-11-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Wed Nov  4 06:09:55 UTC 2020

Modified Files:
src/usr.bin/make: parse.c

Log Message:
make(1): fix indentation in parse.c


To generate a diff of this commit:
cvs rdiff -u -r1.424 -r1.425 src/usr.bin/make/parse.c

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



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

2020-11-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Wed Nov  4 05:10:01 UTC 2020

Modified Files:
src/usr.bin/make/unit-tests: varparse-undef-partial.mk

Log Message:
make(1): fix typo and reasoning in test varparse-undef-partial.mk


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 \
src/usr.bin/make/unit-tests/varparse-undef-partial.mk

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

Modified files:

Index: src/usr.bin/make/unit-tests/varparse-undef-partial.mk
diff -u src/usr.bin/make/unit-tests/varparse-undef-partial.mk:1.2 src/usr.bin/make/unit-tests/varparse-undef-partial.mk:1.3
--- src/usr.bin/make/unit-tests/varparse-undef-partial.mk:1.2	Sun Sep 27 09:53:41 2020
+++ src/usr.bin/make/unit-tests/varparse-undef-partial.mk	Wed Nov  4 05:10:01 2020
@@ -1,4 +1,4 @@
-# $NetBSD: varparse-undef-partial.mk,v 1.2 2020/09/27 09:53:41 rillig Exp $
+# $NetBSD: varparse-undef-partial.mk,v 1.3 2020/11/04 05:10:01 rillig Exp $
 
 # When an undefined variable is expanded in a ':=' assignment, only the
 # initial '$' of the variable expression is skipped by the parser, while
@@ -9,7 +9,7 @@ LIST=	${DEF} ${UNDEF} ${VAR.${PARAM}} en
 DEF=	defined
 PARAM=	:Q
 
-# The expression ${VAR.{PARAM}} refers to the variable named "VAR.:Q",
+# The expression ${VAR.${PARAM}} refers to the variable named "VAR.:Q",
 # with the ":Q" being part of the name.  This variable is not defined,
 # therefore the initial '$' of that whole expression is skipped by the
 # parser (see Var_Subst, the Buf_AddByte in the else branch) and the rest
@@ -28,15 +28,15 @@ VAR.=		var-dot without parameter
 ${:UVAR.\:Q}=	var-dot with parameter :Q
 
 # At this point, the variable "VAR." is defined, therefore the expression
-# ${VAR.:Q} is expanded as usual.
+# ${VAR.:Q} is expanded, consisting of the variable name "VAR." and the
+# modifier ":Q".
 .if ${EVAL} != "defined  var-dot\\ without\\ parameter end"
 .  error ${EVAL}
 .endif
 
 # In contrast to the previous line, evaluating the original LIST again now
-# produces a different result since the ":Q" has already been inserted
-# literally into the expression.  The variable named "VAR.:Q" is defined,
-# therefore it is resolved as usual.  The ":Q" is interpreted as part of the
+# produces a different result since the variable named "VAR.:Q" is now
+# defined.  It is expanded as usual, interpreting the ":Q" as part of the
 # variable name, as would be expected from reading the variable expression.
 EVAL:=	${LIST}
 .if ${EVAL} != "defined  var-dot with parameter :Q end"



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

2020-11-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Wed Nov  4 05:10:01 UTC 2020

Modified Files:
src/usr.bin/make/unit-tests: varparse-undef-partial.mk

Log Message:
make(1): fix typo and reasoning in test varparse-undef-partial.mk


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 \
src/usr.bin/make/unit-tests/varparse-undef-partial.mk

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



CVS commit: src/usr.bin/make

2020-11-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Wed Nov  4 04:49:33 UTC 2020

Modified Files:
src/usr.bin/make: main.c make.h parse.c var.c
src/usr.bin/make/unit-tests: cmdline-undefined.mk

Log Message:
make(1): negate discardUndefined to preserveUndefined


To generate a diff of this commit:
cvs rdiff -u -r1.422 -r1.423 src/usr.bin/make/main.c
cvs rdiff -u -r1.182 -r1.183 src/usr.bin/make/make.h
cvs rdiff -u -r1.423 -r1.424 src/usr.bin/make/parse.c
cvs rdiff -u -r1.656 -r1.657 src/usr.bin/make/var.c
cvs rdiff -u -r1.1 -r1.2 src/usr.bin/make/unit-tests/cmdline-undefined.mk

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



CVS commit: src/usr.bin/make

2020-11-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Wed Nov  4 04:49:33 UTC 2020

Modified Files:
src/usr.bin/make: main.c make.h parse.c var.c
src/usr.bin/make/unit-tests: cmdline-undefined.mk

Log Message:
make(1): negate discardUndefined to preserveUndefined


To generate a diff of this commit:
cvs rdiff -u -r1.422 -r1.423 src/usr.bin/make/main.c
cvs rdiff -u -r1.182 -r1.183 src/usr.bin/make/make.h
cvs rdiff -u -r1.423 -r1.424 src/usr.bin/make/parse.c
cvs rdiff -u -r1.656 -r1.657 src/usr.bin/make/var.c
cvs rdiff -u -r1.1 -r1.2 src/usr.bin/make/unit-tests/cmdline-undefined.mk

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

Modified files:

Index: src/usr.bin/make/main.c
diff -u src/usr.bin/make/main.c:1.422 src/usr.bin/make/main.c:1.423
--- src/usr.bin/make/main.c:1.422	Wed Nov  4 03:37:51 2020
+++ src/usr.bin/make/main.c	Wed Nov  4 04:49:32 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.422 2020/11/04 03:37:51 rillig Exp $	*/
+/*	$NetBSD: main.c,v 1.423 2020/11/04 04:49:32 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -118,7 +118,7 @@
 #include "trace.h"
 
 /*	"@(#)main.c	8.3 (Berkeley) 3/19/94"	*/
-MAKE_RCSID("$NetBSD: main.c,v 1.422 2020/11/04 03:37:51 rillig Exp $");
+MAKE_RCSID("$NetBSD: main.c,v 1.423 2020/11/04 04:49:32 rillig Exp $");
 #if defined(MAKE_NATIVE) && !defined(lint)
 __COPYRIGHT("@(#) Copyright (c) 1988, 1989, 1990, 1993 "
 	"The Regents of the University of California.  "
@@ -138,7 +138,7 @@ Boolean			deleteOnError;	/* .DELETE_ON_E
 static int		maxJobTokens;	/* -j argument */
 Boolean			enterFlagObj;	/* -w and objdir != srcdir */
 
-Boolean discardUndefined;
+Boolean preserveUndefined;
 static int jp_0 = -1, jp_1 = -1;	/* ends of parent job pipe */
 Boolean			doing_depend;	/* Set while reading .depend */
 static Boolean		jobsRunning;	/* TRUE if the jobs might be running */
@@ -640,8 +640,6 @@ rearg:
 		argc -= arginc;
 	}
 
-	discardUndefined = TRUE;
-
 	/*
 	 * See if the rest of the arguments are variable assignments and
 	 * perform them if so. Else take them to be targets and stuff them

Index: src/usr.bin/make/make.h
diff -u src/usr.bin/make/make.h:1.182 src/usr.bin/make/make.h:1.183
--- src/usr.bin/make/make.h:1.182	Wed Nov  4 03:37:51 2020
+++ src/usr.bin/make/make.h	Wed Nov  4 04:49:32 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: make.h,v 1.182 2020/11/04 03:37:51 rillig Exp $	*/
+/*	$NetBSD: make.h,v 1.183 2020/11/04 04:49:32 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -445,10 +445,11 @@ extern time_t	now;		/* The time at the s
  * process */
 
 /*
- * If TRUE (default behavior), undefined subexpressions in a variable
- * expression are discarded.  If FALSE (only in variable assignments using the
- * ':=' assignment operator), they are preserved and possibly expanded later
- * when the variable from the subexpression has been defined.
+ * If FALSE (the default behavior), undefined subexpressions in a variable
+ * expression are discarded.  If TRUE (only during variable assignments using
+ * the ':=' assignment operator, in the top-level expansion), they are
+ * preserved and possibly expanded later when the variable from the
+ * subexpression has been defined.
  *
  * Example for a ':=' assignment:
  *	CFLAGS = $(.INCLUDES)
@@ -456,7 +457,7 @@ extern time_t	now;		/* The time at the s
  *	# If .INCLUDES (an undocumented special variable, by the way) is
  *	# still undefined, the updated CFLAGS becomes "-I.. $(.INCLUDES)".
  */
-extern Boolean discardUndefined;
+extern Boolean preserveUndefined;
 
 extern SearchPath *sysIncPath;	/* The system include path. */
 extern SearchPath *defSysIncPath; /* The default system include path. */

Index: src/usr.bin/make/parse.c
diff -u src/usr.bin/make/parse.c:1.423 src/usr.bin/make/parse.c:1.424
--- src/usr.bin/make/parse.c:1.423	Wed Nov  4 03:37:51 2020
+++ src/usr.bin/make/parse.c	Wed Nov  4 04:49:32 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: parse.c,v 1.423 2020/11/04 03:37:51 rillig Exp $	*/
+/*	$NetBSD: parse.c,v 1.424 2020/11/04 04:49:32 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -117,7 +117,7 @@
 #include "pathnames.h"
 
 /*	"@(#)parse.c	8.3 (Berkeley) 3/19/94"	*/
-MAKE_RCSID("$NetBSD: parse.c,v 1.423 2020/11/04 03:37:51 rillig Exp $");
+MAKE_RCSID("$NetBSD: parse.c,v 1.424 2020/11/04 04:49:32 rillig Exp $");
 
 /* types and constants */
 
@@ -1919,9 +1919,18 @@ VarAssign_EvalSubst(const char *name, co
 {
 const char *avalue = uvalue;
 char *evalue;
-Boolean savedDiscardUndefined = discardUndefined;
+Boolean savedPreserveUndefined = preserveUndefined;
 
-discardUndefined = FALSE;
+/* TODO: Can this assignment to preserveUndefined be moved further down
+ * to the actually interesting Var_Subst call, without affecting any
+ * edge cases?
+ *
+ * It might affect the implicit expansion of the variable name in the
+ * Var_Exists and Var_Set calls, even 

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

2020-11-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Wed Nov  4 04:47:56 UTC 2020

Modified Files:
src/usr.bin/make/unit-tests: cmdline-undefined.exp

Log Message:
make(1): fix line numbers in test output of cmdline-undefined.mk


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/usr.bin/make/unit-tests/cmdline-undefined.exp

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

Modified files:

Index: src/usr.bin/make/unit-tests/cmdline-undefined.exp
diff -u src/usr.bin/make/unit-tests/cmdline-undefined.exp:1.1 src/usr.bin/make/unit-tests/cmdline-undefined.exp:1.2
--- src/usr.bin/make/unit-tests/cmdline-undefined.exp:1.1	Wed Nov  4 04:24:57 2020
+++ src/usr.bin/make/unit-tests/cmdline-undefined.exp	Wed Nov  4 04:47:56 2020
@@ -1,17 +1,17 @@
 The = assignment operator
-make: "cmdline-undefined.mk" line 27: From the command line: Undefined is .
-make: "cmdline-undefined.mk" line 28: From .MAKEFLAGS '=': Undefined is .
-make: "cmdline-undefined.mk" line 29: From .MAKEFLAGS ':=': Undefined is .
-make: "cmdline-undefined.mk" line 33: From the command line: Undefined is now defined.
-make: "cmdline-undefined.mk" line 34: From .MAKEFLAGS '=': Undefined is now defined.
-make: "cmdline-undefined.mk" line 35: From .MAKEFLAGS ':=': Undefined is now defined.
+make: "cmdline-undefined.mk" line 29: From the command line: Undefined is .
+make: "cmdline-undefined.mk" line 30: From .MAKEFLAGS '=': Undefined is .
+make: "cmdline-undefined.mk" line 31: From .MAKEFLAGS ':=': Undefined is .
+make: "cmdline-undefined.mk" line 35: From the command line: Undefined is now defined.
+make: "cmdline-undefined.mk" line 36: From .MAKEFLAGS '=': Undefined is now defined.
+make: "cmdline-undefined.mk" line 37: From .MAKEFLAGS ':=': Undefined is now defined.
 
 The := assignment operator
-make: "cmdline-undefined.mk" line 27: From the command line: Undefined is .
-make: "cmdline-undefined.mk" line 28: From .MAKEFLAGS '=': Undefined is .
-make: "cmdline-undefined.mk" line 29: From .MAKEFLAGS ':=': Undefined is .
-make: "cmdline-undefined.mk" line 33: From the command line: Undefined is now defined.
-make: "cmdline-undefined.mk" line 34: From .MAKEFLAGS '=': Undefined is now defined.
-make: "cmdline-undefined.mk" line 35: From .MAKEFLAGS ':=': Undefined is now defined.
+make: "cmdline-undefined.mk" line 29: From the command line: Undefined is .
+make: "cmdline-undefined.mk" line 30: From .MAKEFLAGS '=': Undefined is .
+make: "cmdline-undefined.mk" line 31: From .MAKEFLAGS ':=': Undefined is .
+make: "cmdline-undefined.mk" line 35: From the command line: Undefined is now defined.
+make: "cmdline-undefined.mk" line 36: From .MAKEFLAGS '=': Undefined is now defined.
+make: "cmdline-undefined.mk" line 37: From .MAKEFLAGS ':=': Undefined is now defined.
 
 exit status 0



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

2020-11-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Wed Nov  4 04:47:56 UTC 2020

Modified Files:
src/usr.bin/make/unit-tests: cmdline-undefined.exp

Log Message:
make(1): fix line numbers in test output of cmdline-undefined.mk


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/usr.bin/make/unit-tests/cmdline-undefined.exp

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



CVS commit: src

2020-11-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Wed Nov  4 04:24:57 UTC 2020

Modified Files:
src/distrib/sets/lists/tests: mi
src/usr.bin/make: var.c
src/usr.bin/make/unit-tests: Makefile
Added Files:
src/usr.bin/make/unit-tests: cmdline-undefined.exp cmdline-undefined.mk

Log Message:
make(1): add test for undefined variables in command line arguments

The variable discardUndefined has an implicit negation in its name,
which makes it hard to understand.  Plus, most of the time it is true.
It's better to have a flag that is false most of the time and has a
positive name.

On the first attempt of inverting that variable, I stumbled upon
MainParseArgs, which initially leaves discardUndefined == FALSE, and
after handling the dashed options, sets it to TRUE.  This would make a
difference when more command line arguments would be added later via the
.MAKEFLAGS special target.

Upon further inspection, the only place where discardUndefined is used
is in VarAssign_EvalSubst in parse.c, and that place is not reachable
from any of the dashed options.  Therefore, discardUndefined could
already be set at the very beginning of MainParseArgs or even when
initializing the global variable itself, without any observable
difference.

Not even the ::= variable modifier could do anything about this since it
is not reachable from the dashed command line options as well, and in
addition, it expands its right-hand side in any case, always discarding
undefined variables.  Oh, these little inconsistencies everywhere.


To generate a diff of this commit:
cvs rdiff -u -r1.960 -r1.961 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.655 -r1.656 src/usr.bin/make/var.c
cvs rdiff -u -r1.187 -r1.188 src/usr.bin/make/unit-tests/Makefile
cvs rdiff -u -r0 -r1.1 src/usr.bin/make/unit-tests/cmdline-undefined.exp \
src/usr.bin/make/unit-tests/cmdline-undefined.mk

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

Modified files:

Index: src/distrib/sets/lists/tests/mi
diff -u src/distrib/sets/lists/tests/mi:1.960 src/distrib/sets/lists/tests/mi:1.961
--- src/distrib/sets/lists/tests/mi:1.960	Tue Nov  3 17:17:31 2020
+++ src/distrib/sets/lists/tests/mi	Wed Nov  4 04:24:57 2020
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.960 2020/11/03 17:17:31 rillig Exp $
+# $NetBSD: mi,v 1.961 2020/11/04 04:24:57 rillig Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -4819,6 +4819,8 @@
 ./usr/tests/usr.bin/make/unit-tests/cmd-errors.mktests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/cmd-interrupt.exptests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/cmd-interrupt.mktests-usr.bin-tests	compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/cmdline-undefined.exp			tests-usr.bin-tests	compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/cmdline-undefined.mk			tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/cmdline.exp	tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/cmdline.mk	tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/comment.exp	tests-usr.bin-tests	compattestfile,atf

Index: src/usr.bin/make/var.c
diff -u src/usr.bin/make/var.c:1.655 src/usr.bin/make/var.c:1.656
--- src/usr.bin/make/var.c:1.655	Wed Nov  4 03:37:51 2020
+++ src/usr.bin/make/var.c	Wed Nov  4 04:24:57 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: var.c,v 1.655 2020/11/04 03:37:51 rillig Exp $	*/
+/*	$NetBSD: var.c,v 1.656 2020/11/04 04:24:57 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -130,7 +130,7 @@
 #include "metachar.h"
 
 /*	"@(#)var.c	8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: var.c,v 1.655 2020/11/04 03:37:51 rillig Exp $");
+MAKE_RCSID("$NetBSD: var.c,v 1.656 2020/11/04 04:24:57 rillig Exp $");
 
 #define VAR_DEBUG1(fmt, arg1) DEBUG1(VAR, fmt, arg1)
 #define VAR_DEBUG2(fmt, arg1, arg2) DEBUG2(VAR, fmt, arg1, arg2)
@@ -2978,6 +2978,8 @@ ok:
 }
 
 delim = st->startc == '(' ? ')' : '}';
+/* TODO: Add test for using the ::= modifier in a := assignment line.
+ * Probably st->eflags should be passed down without VARE_ASSIGN here. */
 res = ParseModifierPart(pp, delim, st->eflags, st, , NULL, NULL, NULL);
 if (res != VPR_OK)
 	return AMR_CLEANUP;

Index: src/usr.bin/make/unit-tests/Makefile
diff -u src/usr.bin/make/unit-tests/Makefile:1.187 src/usr.bin/make/unit-tests/Makefile:1.188
--- src/usr.bin/make/unit-tests/Makefile:1.187	Tue Nov  3 17:17:31 2020
+++ src/usr.bin/make/unit-tests/Makefile	Wed Nov  4 04:24:57 2020
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.187 2020/11/03 17:17:31 rillig Exp $
+# $NetBSD: Makefile,v 1.188 2020/11/04 04:24:57 rillig Exp $
 #
 # Unit tests for make(1)
 #
@@ -41,6 +41,7 @@ TESTS+=		cmd-errors
 TESTS+=		cmd-errors-lint
 TESTS+=		cmd-interrupt
 TESTS+=		cmdline
+TESTS+=		cmdline-undefined
 TESTS+=		comment
 TESTS+=		

CVS commit: src

2020-11-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Wed Nov  4 04:24:57 UTC 2020

Modified Files:
src/distrib/sets/lists/tests: mi
src/usr.bin/make: var.c
src/usr.bin/make/unit-tests: Makefile
Added Files:
src/usr.bin/make/unit-tests: cmdline-undefined.exp cmdline-undefined.mk

Log Message:
make(1): add test for undefined variables in command line arguments

The variable discardUndefined has an implicit negation in its name,
which makes it hard to understand.  Plus, most of the time it is true.
It's better to have a flag that is false most of the time and has a
positive name.

On the first attempt of inverting that variable, I stumbled upon
MainParseArgs, which initially leaves discardUndefined == FALSE, and
after handling the dashed options, sets it to TRUE.  This would make a
difference when more command line arguments would be added later via the
.MAKEFLAGS special target.

Upon further inspection, the only place where discardUndefined is used
is in VarAssign_EvalSubst in parse.c, and that place is not reachable
from any of the dashed options.  Therefore, discardUndefined could
already be set at the very beginning of MainParseArgs or even when
initializing the global variable itself, without any observable
difference.

Not even the ::= variable modifier could do anything about this since it
is not reachable from the dashed command line options as well, and in
addition, it expands its right-hand side in any case, always discarding
undefined variables.  Oh, these little inconsistencies everywhere.


To generate a diff of this commit:
cvs rdiff -u -r1.960 -r1.961 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.655 -r1.656 src/usr.bin/make/var.c
cvs rdiff -u -r1.187 -r1.188 src/usr.bin/make/unit-tests/Makefile
cvs rdiff -u -r0 -r1.1 src/usr.bin/make/unit-tests/cmdline-undefined.exp \
src/usr.bin/make/unit-tests/cmdline-undefined.mk

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



CVS commit: src/usr.bin/make

2020-11-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Wed Nov  4 03:37:51 UTC 2020

Modified Files:
src/usr.bin/make: main.c make.h parse.c var.c

Log Message:
make(1): rename oldVars to discardUndefined

While here, moved all the documentation about this variable into a
single place.


To generate a diff of this commit:
cvs rdiff -u -r1.421 -r1.422 src/usr.bin/make/main.c
cvs rdiff -u -r1.181 -r1.182 src/usr.bin/make/make.h
cvs rdiff -u -r1.422 -r1.423 src/usr.bin/make/parse.c
cvs rdiff -u -r1.654 -r1.655 src/usr.bin/make/var.c

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

Modified files:

Index: src/usr.bin/make/main.c
diff -u src/usr.bin/make/main.c:1.421 src/usr.bin/make/main.c:1.422
--- src/usr.bin/make/main.c:1.421	Sun Nov  1 00:24:57 2020
+++ src/usr.bin/make/main.c	Wed Nov  4 03:37:51 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.421 2020/11/01 00:24:57 rillig Exp $	*/
+/*	$NetBSD: main.c,v 1.422 2020/11/04 03:37:51 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -118,7 +118,7 @@
 #include "trace.h"
 
 /*	"@(#)main.c	8.3 (Berkeley) 3/19/94"	*/
-MAKE_RCSID("$NetBSD: main.c,v 1.421 2020/11/01 00:24:57 rillig Exp $");
+MAKE_RCSID("$NetBSD: main.c,v 1.422 2020/11/04 03:37:51 rillig Exp $");
 #if defined(MAKE_NATIVE) && !defined(lint)
 __COPYRIGHT("@(#) Copyright (c) 1988, 1989, 1990, 1993 "
 	"The Regents of the University of California.  "
@@ -138,7 +138,7 @@ Boolean			deleteOnError;	/* .DELETE_ON_E
 static int		maxJobTokens;	/* -j argument */
 Boolean			enterFlagObj;	/* -w and objdir != srcdir */
 
-Boolean			oldVars;	/* variable substitution style */
+Boolean discardUndefined;
 static int jp_0 = -1, jp_1 = -1;	/* ends of parent job pipe */
 Boolean			doing_depend;	/* Set while reading .depend */
 static Boolean		jobsRunning;	/* TRUE if the jobs might be running */
@@ -640,7 +640,7 @@ rearg:
 		argc -= arginc;
 	}
 
-	oldVars = TRUE;
+	discardUndefined = TRUE;
 
 	/*
 	 * See if the rest of the arguments are variable assignments and

Index: src/usr.bin/make/make.h
diff -u src/usr.bin/make/make.h:1.181 src/usr.bin/make/make.h:1.182
--- src/usr.bin/make/make.h:1.181	Wed Nov  4 03:13:46 2020
+++ src/usr.bin/make/make.h	Wed Nov  4 03:37:51 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: make.h,v 1.181 2020/11/04 03:13:46 rillig Exp $	*/
+/*	$NetBSD: make.h,v 1.182 2020/11/04 03:37:51 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -444,11 +444,19 @@ extern char	var_Error[];	/* Value return
 extern time_t	now;		/* The time at the start of this whole
  * process */
 
-/* Do old-style variable substitution.
+/*
+ * If TRUE (default behavior), undefined subexpressions in a variable
+ * expression are discarded.  If FALSE (only in variable assignments using the
+ * ':=' assignment operator), they are preserved and possibly expanded later
+ * when the variable from the subexpression has been defined.
  *
- * The word "old" comes from 1993-03-21 or earlier, so it must be really old.
- * TODO: But what does this "old-style" mean?  What effects does it have? */
-extern Boolean	oldVars;
+ * Example for a ':=' assignment:
+ *	CFLAGS = $(.INCLUDES)
+ *	CFLAGS := -I.. $(CFLAGS)
+ *	# If .INCLUDES (an undocumented special variable, by the way) is
+ *	# still undefined, the updated CFLAGS becomes "-I.. $(.INCLUDES)".
+ */
+extern Boolean discardUndefined;
 
 extern SearchPath *sysIncPath;	/* The system include path. */
 extern SearchPath *defSysIncPath; /* The default system include path. */

Index: src/usr.bin/make/parse.c
diff -u src/usr.bin/make/parse.c:1.422 src/usr.bin/make/parse.c:1.423
--- src/usr.bin/make/parse.c:1.422	Mon Nov  2 22:50:55 2020
+++ src/usr.bin/make/parse.c	Wed Nov  4 03:37:51 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: parse.c,v 1.422 2020/11/02 22:50:55 rillig Exp $	*/
+/*	$NetBSD: parse.c,v 1.423 2020/11/04 03:37:51 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -117,7 +117,7 @@
 #include "pathnames.h"
 
 /*	"@(#)parse.c	8.3 (Berkeley) 3/19/94"	*/
-MAKE_RCSID("$NetBSD: parse.c,v 1.422 2020/11/02 22:50:55 rillig Exp $");
+MAKE_RCSID("$NetBSD: parse.c,v 1.423 2020/11/04 03:37:51 rillig Exp $");
 
 /* types and constants */
 
@@ -1919,20 +1919,9 @@ VarAssign_EvalSubst(const char *name, co
 {
 const char *avalue = uvalue;
 char *evalue;
-/*
- * Allow variables in the old value to be undefined, but leave their
- * expressions alone -- this is done by forcing oldVars to be false.
- * XXX: This can cause recursive variables, but that's not hard to do,
- * and this allows someone to do something like
- *
- *  CFLAGS = $(.INCLUDES)
- *  CFLAGS := -I.. $(CFLAGS)
- *
- * And not get an error.
- */
-Boolean oldOldVars = oldVars;
+Boolean savedDiscardUndefined = discardUndefined;
 
-oldVars = FALSE;
+discardUndefined = FALSE;
 
 /*
  * make sure that we set the variable the first time to nothing
@@ -1943,7 +1932,7 

CVS commit: src/usr.bin/make

2020-11-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Wed Nov  4 03:37:51 UTC 2020

Modified Files:
src/usr.bin/make: main.c make.h parse.c var.c

Log Message:
make(1): rename oldVars to discardUndefined

While here, moved all the documentation about this variable into a
single place.


To generate a diff of this commit:
cvs rdiff -u -r1.421 -r1.422 src/usr.bin/make/main.c
cvs rdiff -u -r1.181 -r1.182 src/usr.bin/make/make.h
cvs rdiff -u -r1.422 -r1.423 src/usr.bin/make/parse.c
cvs rdiff -u -r1.654 -r1.655 src/usr.bin/make/var.c

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



CVS commit: src/usr.bin/make

2020-11-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Wed Nov  4 03:13:46 UTC 2020

Modified Files:
src/usr.bin/make: make.h

Log Message:
make(1): add missing enum tag for GNodeMade


To generate a diff of this commit:
cvs rdiff -u -r1.180 -r1.181 src/usr.bin/make/make.h

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

Modified files:

Index: src/usr.bin/make/make.h
diff -u src/usr.bin/make/make.h:1.180 src/usr.bin/make/make.h:1.181
--- src/usr.bin/make/make.h:1.180	Wed Nov  4 02:57:42 2020
+++ src/usr.bin/make/make.h	Wed Nov  4 03:13:46 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: make.h,v 1.180 2020/11/04 02:57:42 rillig Exp $	*/
+/*	$NetBSD: make.h,v 1.181 2020/11/04 03:13:46 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -171,7 +171,7 @@ typedef int Boolean;
 #include "buf.h"
 #include "make_malloc.h"
 
-typedef enum  {
+typedef enum GNodeMade {
 UNMADE,			/* Not examined yet */
 DEFERRED,			/* Examined once (building child) */
 REQUESTED,			/* on toBeMade list */
@@ -456,7 +456,7 @@ extern SearchPath *defSysIncPath; /* The
 extern char	curdir[];	/* Startup directory */
 extern char	*progname;	/* The program name */
 extern char	*makeDependfile; /* .depend */
-extern char	**savedEnv;	 /* if we replaced environ this will be non-NULL */
+extern char	**savedEnv;	/* if we replaced environ this will be non-NULL */
 
 extern int	makelevel;
 



CVS commit: src/usr.bin/make

2020-11-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Wed Nov  4 03:13:46 UTC 2020

Modified Files:
src/usr.bin/make: make.h

Log Message:
make(1): add missing enum tag for GNodeMade


To generate a diff of this commit:
cvs rdiff -u -r1.180 -r1.181 src/usr.bin/make/make.h

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



CVS commit: src/usr.bin/make

2020-11-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Wed Nov  4 02:57:42 UTC 2020

Modified Files:
src/usr.bin/make: make.h

Log Message:
make(1): document that "old-style" variables are older than 1993


To generate a diff of this commit:
cvs rdiff -u -r1.179 -r1.180 src/usr.bin/make/make.h

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

Modified files:

Index: src/usr.bin/make/make.h
diff -u src/usr.bin/make/make.h:1.179 src/usr.bin/make/make.h:1.180
--- src/usr.bin/make/make.h:1.179	Sun Nov  1 17:47:26 2020
+++ src/usr.bin/make/make.h	Wed Nov  4 02:57:42 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: make.h,v 1.179 2020/11/01 17:47:26 rillig Exp $	*/
+/*	$NetBSD: make.h,v 1.180 2020/11/04 02:57:42 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -444,7 +444,11 @@ extern char	var_Error[];	/* Value return
 extern time_t	now;		/* The time at the start of this whole
  * process */
 
-extern Boolean	oldVars;	/* Do old-style variable substitution */
+/* Do old-style variable substitution.
+ *
+ * The word "old" comes from 1993-03-21 or earlier, so it must be really old.
+ * TODO: But what does this "old-style" mean?  What effects does it have? */
+extern Boolean	oldVars;
 
 extern SearchPath *sysIncPath;	/* The system include path. */
 extern SearchPath *defSysIncPath; /* The default system include path. */



CVS commit: src/usr.bin/make

2020-11-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Wed Nov  4 02:57:42 UTC 2020

Modified Files:
src/usr.bin/make: make.h

Log Message:
make(1): document that "old-style" variables are older than 1993


To generate a diff of this commit:
cvs rdiff -u -r1.179 -r1.180 src/usr.bin/make/make.h

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



CVS commit: src/usr.bin/make

2020-11-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Wed Nov  4 02:53:18 UTC 2020

Modified Files:
src/usr.bin/make: var.c

Log Message:
make(1): remove redundant condition from ApplyModifiersIndirect

Whenever varUndefined is returned from another function, that is only
done if eflags does not contain VARE_UNDEFERR.  Therefore, testing for
that flag is unnecessary.


To generate a diff of this commit:
cvs rdiff -u -r1.653 -r1.654 src/usr.bin/make/var.c

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



CVS commit: src/usr.bin/make

2020-11-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Wed Nov  4 02:53:18 UTC 2020

Modified Files:
src/usr.bin/make: var.c

Log Message:
make(1): remove redundant condition from ApplyModifiersIndirect

Whenever varUndefined is returned from another function, that is only
done if eflags does not contain VARE_UNDEFERR.  Therefore, testing for
that flag is unnecessary.


To generate a diff of this commit:
cvs rdiff -u -r1.653 -r1.654 src/usr.bin/make/var.c

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

Modified files:

Index: src/usr.bin/make/var.c
diff -u src/usr.bin/make/var.c:1.653 src/usr.bin/make/var.c:1.654
--- src/usr.bin/make/var.c:1.653	Wed Nov  4 02:26:21 2020
+++ src/usr.bin/make/var.c	Wed Nov  4 02:53:18 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: var.c,v 1.653 2020/11/04 02:26:21 rillig Exp $	*/
+/*	$NetBSD: var.c,v 1.654 2020/11/04 02:53:18 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -130,7 +130,7 @@
 #include "metachar.h"
 
 /*	"@(#)var.c	8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: var.c,v 1.653 2020/11/04 02:26:21 rillig Exp $");
+MAKE_RCSID("$NetBSD: var.c,v 1.654 2020/11/04 02:53:18 rillig Exp $");
 
 #define VAR_DEBUG1(fmt, arg1) DEBUG1(VAR, fmt, arg1)
 #define VAR_DEBUG2(fmt, arg1, arg2) DEBUG2(VAR, fmt, arg1, arg2)
@@ -3299,9 +3299,8 @@ ApplyModifiersIndirect(
 	st->val = ApplyModifiers(_pp, st->val, '\0', '\0', st->v,
  >exprFlags, st->ctxt, st->eflags,
  out_freeIt);
-	if (st->val == var_Error
-	|| (st->val == varUndefined && !(st->eflags & VARE_UNDEFERR))
-	|| *rval_pp != '\0') {
+	if (st->val == var_Error || st->val == varUndefined ||
+	*rval_pp != '\0') {
 	free(mods_freeIt);
 	*inout_p = p;
 	return AMIR_OUT;	/* error already reported */



CVS commit: src/usr.bin/make

2020-11-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Wed Nov  4 02:26:21 UTC 2020

Modified Files:
src/usr.bin/make: var.c

Log Message:
make(1): replace emptyString with allocated empty string

Special-casing this variable only made the code more complicated.
Furthermore, it is not related to error handling in any way and
therefore distracted the reader from this topic.


To generate a diff of this commit:
cvs rdiff -u -r1.652 -r1.653 src/usr.bin/make/var.c

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

Modified files:

Index: src/usr.bin/make/var.c
diff -u src/usr.bin/make/var.c:1.652 src/usr.bin/make/var.c:1.653
--- src/usr.bin/make/var.c:1.652	Mon Nov  2 21:34:40 2020
+++ src/usr.bin/make/var.c	Wed Nov  4 02:26:21 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: var.c,v 1.652 2020/11/02 21:34:40 rillig Exp $	*/
+/*	$NetBSD: var.c,v 1.653 2020/11/04 02:26:21 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -130,7 +130,7 @@
 #include "metachar.h"
 
 /*	"@(#)var.c	8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: var.c,v 1.652 2020/11/02 21:34:40 rillig Exp $");
+MAKE_RCSID("$NetBSD: var.c,v 1.653 2020/11/04 02:26:21 rillig Exp $");
 
 #define VAR_DEBUG1(fmt, arg1) DEBUG1(VAR, fmt, arg1)
 #define VAR_DEBUG2(fmt, arg1, arg2) DEBUG2(VAR, fmt, arg1, arg2)
@@ -157,11 +157,6 @@ char var_Error[] = "";
  * be deferred until it is defined in an actual target. */
 static char varUndefined[] = "";
 
-/* Special return value for Var_Parse, just to avoid allocating empty strings.
- * In contrast to var_Error and varUndefined, this is not an error marker but
- * just an ordinary successful return value. */
-static char emptyString[] = "";
-
 /*
  * Traditionally this make consumed $$ during := like any other expansion.
  * Other make's do not, and this make follows straight since 2016-01-09.
@@ -2299,7 +2294,7 @@ ApplyModifier_ShellCommand(const char **
 if (st->eflags & VARE_WANTRES)
 	st->newVal = Cmd_Exec(cmd, );
 else
-	st->newVal = emptyString;
+	st->newVal = bmake_strdup("");
 free(cmd);
 
 if (errfmt != NULL)
@@ -3014,7 +3009,7 @@ ok:
 	}
 }
 free(val);
-st->newVal = emptyString;
+st->newVal = bmake_strdup("");
 return AMR_OK;
 }
 
@@ -3138,7 +3133,7 @@ ApplyModifier_SunShell(const char **pp, 
 	if (errfmt)
 		Error(errfmt, st->val);
 	} else
-	st->newVal = emptyString;
+	st->newVal = bmake_strdup("");
 	*pp = p + 2;
 	return AMR_OK;
 } else
@@ -3412,10 +3407,8 @@ ApplyModifiers(
 		*out_freeIt = NULL;
 	}
 	st.val = st.newVal;
-	if (st.val != var_Error && st.val != varUndefined &&
-		st.val != emptyString) {
+	if (st.val != var_Error && st.val != varUndefined)
 		*out_freeIt = st.val;
-	}
 	}
 	if (*p == '\0' && st.endc != '\0') {
 	Error("Unclosed variable specification (expecting '%c') "



CVS commit: src/usr.bin/make

2020-11-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Wed Nov  4 02:26:21 UTC 2020

Modified Files:
src/usr.bin/make: var.c

Log Message:
make(1): replace emptyString with allocated empty string

Special-casing this variable only made the code more complicated.
Furthermore, it is not related to error handling in any way and
therefore distracted the reader from this topic.


To generate a diff of this commit:
cvs rdiff -u -r1.652 -r1.653 src/usr.bin/make/var.c

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



CVS commit: src/usr.bin/pmap

2020-11-03 Thread Chuck Silvers
Module Name:src
Committed By:   chs
Date:   Wed Nov  4 01:37:55 UTC 2020

Modified Files:
src/usr.bin/pmap: main.c pmap.c pmap.h

Log Message:
Restrict to root any command option that prints kernel addresses.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/usr.bin/pmap/main.c
cvs rdiff -u -r1.55 -r1.56 src/usr.bin/pmap/pmap.c
cvs rdiff -u -r1.12 -r1.13 src/usr.bin/pmap/pmap.h

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

Modified files:

Index: src/usr.bin/pmap/main.c
diff -u src/usr.bin/pmap/main.c:1.28 src/usr.bin/pmap/main.c:1.29
--- src/usr.bin/pmap/main.c:1.28	Sun Mar 22 14:41:32 2020
+++ src/usr.bin/pmap/main.c	Wed Nov  4 01:37:55 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.28 2020/03/22 14:41:32 ad Exp $ */
+/*	$NetBSD: main.c,v 1.29 2020/11/04 01:37:55 chs Exp $ */
 
 /*
  * Copyright (c) 2002, 2003, 2020 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: main.c,v 1.28 2020/03/22 14:41:32 ad Exp $");
+__RCSID("$NetBSD: main.c,v 1.29 2020/11/04 01:37:55 chs Exp $");
 #endif
 
 #include 
@@ -121,6 +121,7 @@ main(int argc, char *argv[])
 	struct kbit kbit, *vmspace;
 	u_long address;
 
+	uid = getuid();
 	egid = getegid();
 	if (setegid(getgid()) == -1)
 		err(1, "failed to reset privileges");
@@ -231,11 +232,12 @@ main(int argc, char *argv[])
 	print_ddb == 0)
 		print_solaris = 1;
 
-	/* get privs back if it appears to be safe, otherwise toss them */
-	if (kernel == NULL && kmem == NULL && address == 0)
-		rc = setegid(egid);
-	else
-		rc = setgid(getgid());
+	if ((kernel != NULL || kmem != NULL || address != 0 ||
+	 print_ddb || debug) && uid != 0)
+		errx(1, "one or more options specified is restricted to root");
+
+	/* get privs back since it appears to be safe. */
+	rc = setegid(egid);
 	if (rc == -1)
 		err(1, "failed to reset privileges");
 
@@ -283,8 +285,6 @@ main(int argc, char *argv[])
 		exit(0);
 	}
 
-	uid = getuid();
-
 	do {
 		if (pid == -1) {
 			if (argc == 0)

Index: src/usr.bin/pmap/pmap.c
diff -u src/usr.bin/pmap/pmap.c:1.55 src/usr.bin/pmap/pmap.c:1.56
--- src/usr.bin/pmap/pmap.c:1.55	Sun Mar 22 14:41:32 2020
+++ src/usr.bin/pmap/pmap.c	Wed Nov  4 01:37:55 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.55 2020/03/22 14:41:32 ad Exp $ */
+/*	$NetBSD: pmap.c,v 1.56 2020/11/04 01:37:55 chs Exp $ */
 
 /*
  * Copyright (c) 2002, 2003, 2020 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: pmap.c,v 1.55 2020/03/22 14:41:32 ad Exp $");
+__RCSID("$NetBSD: pmap.c,v 1.56 2020/11/04 01:37:55 chs Exp $");
 #endif
 
 #include 
@@ -483,9 +483,7 @@ dump_vm_map_entry(kvm_t *kd, struct kinf
 
 	if (print_all) {
 		sz = (size_t)((vme->end - vme->start) / 1024);
-		printf(A(vp) ?
-		   "%*s%0*"PRIxVADDR"-%0*"PRIxVADDR" %7luk %0*" PRIx64 " %c%c%c%c%c (%c%c%c) %d/%d/%d %02llu:%02llu %7llu - %s [%p]\n" :
-		   "%*s%0*"PRIxVADDR"-%0*"PRIxVADDR" %7luk %0*" PRIx64 " %c%c%c%c%c (%c%c%c) %d/%d/%d %02llu:%02llu %7llu - %s\n",
+		printf("%*s%0*"PRIxVADDR"-%0*"PRIxVADDR" %7luk %0*" PRIx64 " %c%c%c%c%c (%c%c%c) %d/%d/%d %02llu:%02llu %7llu - %s\n",
 		   indent(2), "",
 		   (int)sizeof(void *) * 2,
 		   vme->start,
@@ -508,7 +506,7 @@ dump_vm_map_entry(kvm_t *kd, struct kinf
 		   (unsigned long long)major(dev),
 		   (unsigned long long)minor(dev),
 		   (unsigned long long)inode,
-		   name, P(vp));
+		   name);
 	}
 
 	/* no access allowed, don't count space */

Index: src/usr.bin/pmap/pmap.h
diff -u src/usr.bin/pmap/pmap.h:1.12 src/usr.bin/pmap/pmap.h:1.13
--- src/usr.bin/pmap/pmap.h:1.12	Sun Mar 22 14:41:32 2020
+++ src/usr.bin/pmap/pmap.h	Wed Nov  4 01:37:55 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.h,v 1.12 2020/03/22 14:41:32 ad Exp $ */
+/*	$NetBSD: pmap.h,v 1.13 2020/11/04 01:37:55 chs Exp $ */
 
 /*
  * Copyright (c) 2002, 2003, 2020 The NetBSD Foundation, Inc.
@@ -98,8 +98,7 @@
 	((size_t)kvm_read((kd), (addr), (dst), (sz)) == (size_t)(sz))
 #define _KDEREF(kd, addr, dst, sz) do { \
 	if (!_KDEREFOK((kd), (addr), (dst), (sz))) \
-		errx(1, "trying to read %lu (%s) bytes from %lx: %s", \
-		(unsigned long)(sz), #sz, (addr), kvm_geterr(kd)); \
+		errx(1, "reading from kmem failed: %s", kvm_geterr(kd)); \
 } while (0/*CONSTCOND*/)
 
 /* suck the data using the structure */



CVS commit: src/usr.bin/pmap

2020-11-03 Thread Chuck Silvers
Module Name:src
Committed By:   chs
Date:   Wed Nov  4 01:37:55 UTC 2020

Modified Files:
src/usr.bin/pmap: main.c pmap.c pmap.h

Log Message:
Restrict to root any command option that prints kernel addresses.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/usr.bin/pmap/main.c
cvs rdiff -u -r1.55 -r1.56 src/usr.bin/pmap/pmap.c
cvs rdiff -u -r1.12 -r1.13 src/usr.bin/pmap/pmap.h

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



CVS commit: src/sys

2020-11-03 Thread Chuck Silvers
Module Name:src
Committed By:   chs
Date:   Wed Nov  4 01:30:19 UTC 2020

Modified Files:
src/sys/kern: init_main.c
src/sys/uvm: uvm_aobj.c uvm_init.c uvm_pdaemon.c

Log Message:
In uvmpd_tryownerlock(), if the initial try-lock of the owner lock fails
then rather than do more try-locks and eventually sleep for a tick,
take a hold on the current owner's lock, drop the page interlock,
and acquire the lock that we took the hold on in a blocking fashion.
After we get the lock, check if the lock that we acquired is still
the lock for the owner of the page that we're interested in.
If the owner hasn't changed then can proceed with this page,
otherwise we will skip this page and move on to a different page.
This dramatically reduces the amount of time that the pagedaemon
sleeps trying to get locks, since even 1 tick is an eternity to sleep
in this context and it was easy to trigger that case in practice,
and with this new method the pagedaemon only very rarely actually blocks
to acquire the lock that it wants since the object locks are adaptive,
and when the pagedaemon does block then the amount of time it spends
sleeping will be generally be much less than 1 tick.


To generate a diff of this commit:
cvs rdiff -u -r1.531 -r1.532 src/sys/kern/init_main.c
cvs rdiff -u -r1.151 -r1.152 src/sys/uvm/uvm_aobj.c
cvs rdiff -u -r1.54 -r1.55 src/sys/uvm/uvm_init.c
cvs rdiff -u -r1.130 -r1.131 src/sys/uvm/uvm_pdaemon.c

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



CVS commit: src/sys

2020-11-03 Thread Chuck Silvers
Module Name:src
Committed By:   chs
Date:   Wed Nov  4 01:30:19 UTC 2020

Modified Files:
src/sys/kern: init_main.c
src/sys/uvm: uvm_aobj.c uvm_init.c uvm_pdaemon.c

Log Message:
In uvmpd_tryownerlock(), if the initial try-lock of the owner lock fails
then rather than do more try-locks and eventually sleep for a tick,
take a hold on the current owner's lock, drop the page interlock,
and acquire the lock that we took the hold on in a blocking fashion.
After we get the lock, check if the lock that we acquired is still
the lock for the owner of the page that we're interested in.
If the owner hasn't changed then can proceed with this page,
otherwise we will skip this page and move on to a different page.
This dramatically reduces the amount of time that the pagedaemon
sleeps trying to get locks, since even 1 tick is an eternity to sleep
in this context and it was easy to trigger that case in practice,
and with this new method the pagedaemon only very rarely actually blocks
to acquire the lock that it wants since the object locks are adaptive,
and when the pagedaemon does block then the amount of time it spends
sleeping will be generally be much less than 1 tick.


To generate a diff of this commit:
cvs rdiff -u -r1.531 -r1.532 src/sys/kern/init_main.c
cvs rdiff -u -r1.151 -r1.152 src/sys/uvm/uvm_aobj.c
cvs rdiff -u -r1.54 -r1.55 src/sys/uvm/uvm_init.c
cvs rdiff -u -r1.130 -r1.131 src/sys/uvm/uvm_pdaemon.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/init_main.c
diff -u src/sys/kern/init_main.c:1.531 src/sys/kern/init_main.c:1.532
--- src/sys/kern/init_main.c:1.531	Tue Sep  8 16:00:35 2020
+++ src/sys/kern/init_main.c	Wed Nov  4 01:30:19 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: init_main.c,v 1.531 2020/09/08 16:00:35 riastradh Exp $	*/
+/*	$NetBSD: init_main.c,v 1.532 2020/11/04 01:30:19 chs Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2009, 2019 The NetBSD Foundation, Inc.
@@ -97,7 +97,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: init_main.c,v 1.531 2020/09/08 16:00:35 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: init_main.c,v 1.532 2020/11/04 01:30:19 chs Exp $");
 
 #include "opt_cnmagic.h"
 #include "opt_ddb.h"
@@ -329,7 +329,6 @@ main(void)
 
 	/* Initialize lock caches. */
 	mutex_obj_init();
-	rw_obj_init();
 
 	/* Initialize radix trees (used by numerous subsystems). */
 	radix_tree_init();

Index: src/sys/uvm/uvm_aobj.c
diff -u src/sys/uvm/uvm_aobj.c:1.151 src/sys/uvm/uvm_aobj.c:1.152
--- src/sys/uvm/uvm_aobj.c:1.151	Wed Aug 19 15:36:41 2020
+++ src/sys/uvm/uvm_aobj.c	Wed Nov  4 01:30:19 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_aobj.c,v 1.151 2020/08/19 15:36:41 chs Exp $	*/
+/*	$NetBSD: uvm_aobj.c,v 1.152 2020/11/04 01:30:19 chs Exp $	*/
 
 /*
  * Copyright (c) 1998 Chuck Silvers, Charles D. Cranor and
@@ -38,7 +38,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uvm_aobj.c,v 1.151 2020/08/19 15:36:41 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_aobj.c,v 1.152 2020/11/04 01:30:19 chs Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_uvmhist.h"
@@ -416,7 +416,7 @@ struct uvm_object *
 uao_create(voff_t size, int flags)
 {
 	static struct uvm_aobj kernel_object_store;
-	static krwlock_t kernel_object_lock __cacheline_aligned;
+	static krwlock_t bootstrap_kernel_object_lock;
 	static int kobj_alloced __diagused = 0;
 	pgoff_t pages = round_page((uint64_t)size) >> PAGE_SHIFT;
 	struct uvm_aobj *aobj;
@@ -458,25 +458,30 @@ uao_create(voff_t size, int flags)
  	 * we are still booting we should be the only thread around.
  	 */
 
-	if (flags == 0 || (flags & UAO_FLAG_KERNSWAP) != 0) {
+	const int kernswap = (flags & UAO_FLAG_KERNSWAP) != 0;
+	if (flags == 0 || kernswap) {
 #if defined(VMSWAP)
-		const int kernswap = (flags & UAO_FLAG_KERNSWAP) != 0;
 
 		/* allocate hash table or array depending on object size */
 		if (UAO_USES_SWHASH(aobj)) {
 			aobj->u_swhash = hashinit(UAO_SWHASH_BUCKETS(aobj),
-			HASH_LIST, kernswap ? false : true,
-			>u_swhashmask);
-			if (aobj->u_swhash == NULL)
-panic("uao_create: hashinit swhash failed");
+			HASH_LIST, true, >u_swhashmask);
 		} else {
 			aobj->u_swslots = kmem_zalloc(pages * sizeof(int),
-			kernswap ? KM_NOSLEEP : KM_SLEEP);
-			if (aobj->u_swslots == NULL)
-panic("uao_create: swslots allocation failed");
+			KM_SLEEP);
 		}
 #endif /* defined(VMSWAP) */
 
+		/*
+		 * Replace kernel_object's temporary static lock with
+		 * a regular rw_obj.  We cannot use uvm_obj_setlock()
+		 * because that would try to free the old lock.
+		 */
+
+		if (kernswap) {
+			aobj->u_obj.vmobjlock = rw_obj_alloc();
+			rw_destroy(_kernel_object_lock);
+		}
 		if (flags) {
 			aobj->u_flags &= ~UAO_FLAG_NOSWAP; /* clear noswap */
 			return >u_obj;
@@ -490,9 +495,9 @@ uao_create(voff_t size, int flags)
 	const bool kernobj = (flags & UAO_FLAG_KERNOBJ) != 0;
 	uvm_obj_init(>u_obj, _pager, !kernobj, refs);
 	if 

CVS commit: src/usr.bin/cvslatest

2020-11-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Nov  3 22:21:44 UTC 2020

Modified Files:
src/usr.bin/cvslatest: cvslatest.c

Log Message:
Handle dummy timestamp better and check for I/O errors. From khorben@


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/usr.bin/cvslatest/cvslatest.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/cvslatest

2020-11-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Nov  3 22:21:44 UTC 2020

Modified Files:
src/usr.bin/cvslatest: cvslatest.c

Log Message:
Handle dummy timestamp better and check for I/O errors. From khorben@


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/usr.bin/cvslatest/cvslatest.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/cvslatest/cvslatest.c
diff -u src/usr.bin/cvslatest/cvslatest.c:1.8 src/usr.bin/cvslatest/cvslatest.c:1.9
--- src/usr.bin/cvslatest/cvslatest.c:1.8	Sat Mar  9 11:18:22 2019
+++ src/usr.bin/cvslatest/cvslatest.c	Tue Nov  3 17:21:43 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: cvslatest.c,v 1.8 2019/03/09 16:18:22 christos Exp $	*/
+/*	$NetBSD: cvslatest.c,v 1.9 2020/11/03 22:21:43 christos Exp $	*/
 
 /*-
  * Copyright (c) 2016 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
 #endif
 
 #include 
-__RCSID("$NetBSD: cvslatest.c,v 1.8 2019/03/09 16:18:22 christos Exp $");
+__RCSID("$NetBSD: cvslatest.c,v 1.9 2020/11/03 22:21:43 christos Exp $");
 
 /*
  * Find the latest timestamp in a set of CVS trees, by examining the
@@ -115,10 +115,18 @@ getlatest(const FTSENT *e, const char *r
 			goto mal;
 		if ((dt = strtok(NULL, "/")) == NULL)
 			goto mal;
+		if (strcmp(dt, "dummy timestamp") == 0) {
+			warnx("Can't get timestamp from uncommitted file `%s'",
+			ename);
+			if (!ignore)
+exit(EXIT_FAILURE);
+			continue;
+		}
 		if ((p = strptime(dt, fmt, )) == NULL || *p) {
 			warnx("Malformed time `%s' in `%s'", dt, ename);
 			if (!ignore)
 exit(EXIT_FAILURE);
+			continue;
 		}
 		tm.tm_isdst = 0;	// We are in GMT anyway
 		if ((t = mktime()) == (time_t)-1)
@@ -132,6 +140,8 @@ getlatest(const FTSENT *e, const char *r
 printlat(lat);
 		}
 	}
+	if (ferror(fp))
+		err(EXIT_FAILURE, "Can't read `%s'", ename);
 
 	fclose(fp);
 	return;



CVS commit: src/sys/compat/linux/common

2020-11-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Nov  3 22:08:44 UTC 2020

Modified Files:
src/sys/compat/linux/common: linux_socket.c

Log Message:
PR/55780: Bernd Sieker: setsockopt in Linux emulation misses some options


To generate a diff of this commit:
cvs rdiff -u -r1.151 -r1.152 src/sys/compat/linux/common/linux_socket.c

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

Modified files:

Index: src/sys/compat/linux/common/linux_socket.c
diff -u src/sys/compat/linux/common/linux_socket.c:1.151 src/sys/compat/linux/common/linux_socket.c:1.152
--- src/sys/compat/linux/common/linux_socket.c:1.151	Sat Oct 24 05:01:56 2020
+++ src/sys/compat/linux/common/linux_socket.c	Tue Nov  3 17:08:44 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux_socket.c,v 1.151 2020/10/24 09:01:56 mgorny Exp $	*/
+/*	$NetBSD: linux_socket.c,v 1.152 2020/11/03 22:08:44 christos Exp $	*/
 
 /*-
  * Copyright (c) 1995, 1998, 2008 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: linux_socket.c,v 1.151 2020/10/24 09:01:56 mgorny Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_socket.c,v 1.152 2020/11/03 22:08:44 christos Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_inet.h"
@@ -861,11 +861,11 @@ linux_to_bsd_so_sockopt(int lopt)
 		return SO_DEBUG;
 	case LINUX_SO_REUSEADDR:
 		/*
-		 * Linux does not implement SO_REUSEPORT, but allows reuse of a
-		 * host:port pair through SO_REUSEADDR even if the address is not a
-		 * multicast-address.  Effectively, this means that we should use
-		 * SO_REUSEPORT to allow Linux applications to not exit with
-		 * EADDRINUSE
+		 * Linux does not implement SO_REUSEPORT, but allows reuse of
+		 * a host:port pair through SO_REUSEADDR even if the address
+		 * is not a multicast-address. Effectively, this means that we
+		 * should use SO_REUSEPORT to allow Linux applications to not
+		 * exit with EADDRINUSE
 		 */
 		return SO_REUSEPORT;
 	case LINUX_SO_TYPE:
@@ -880,20 +880,51 @@ linux_to_bsd_so_sockopt(int lopt)
 		return SO_SNDBUF;
 	case LINUX_SO_RCVBUF:
 		return SO_RCVBUF;
-	case LINUX_SO_SNDLOWAT:
-		return SO_SNDLOWAT;
-	case LINUX_SO_RCVLOWAT:
-		return SO_RCVLOWAT;
 	case LINUX_SO_KEEPALIVE:
 		return SO_KEEPALIVE;
 	case LINUX_SO_OOBINLINE:
 		return SO_OOBINLINE;
+	case LINUX_SO_NO_CHECK:
+	case LINUX_SO_PRIORITY:
+		return -1;
 	case LINUX_SO_LINGER:
 		return SO_LINGER;
+	case LINUX_SO_BSDCOMPAT:
+	case LINUX_SO_PASSCRED:
+	case LINUX_SO_PEERCRED:
+		return -1;
+	case LINUX_SO_RCVLOWAT:
+		return SO_RCVLOWAT;
+	case LINUX_SO_SNDLOWAT:
+		return SO_SNDLOWAT;
+	case LINUX_SO_RCVTIMEO:
+		return SO_RCVTIMEO;
+	case LINUX_SO_SNDTIMEO:
+		return SO_SNDTIMEO;
+	case LINUX_SO_SECURITY_AUTHENTICATION:
+	case LINUX_SO_SECURITY_ENCRYPTION_TRANSPORT:
+	case LINUX_SO_SECURITY_ENCRYPTION_NETWORK:
+	case LINUX_SO_BINDTODEVICE:
+	case LINUX_SO_ATTACH_FILTER:
+	case LINUX_SO_DETACH_FILTER:
+	case LINUX_SO_PEERNAME:
+		return -1;
+	case LINUX_SO_TIMESTAMP:
+		return SO_TIMESTAMP;
 	case LINUX_SO_ACCEPTCONN:
-		return SO_ACCEPTCONN;
-	case LINUX_SO_PRIORITY:
-	case LINUX_SO_NO_CHECK:
+	case LINUX_SO_PEERSEC:
+	case LINUX_SO_SNDBUFFORCE:
+	case LINUX_SO_RCVBUFFORCE:
+	case LINUX_SO_PASSSEC:
+	case LINUX_SO_TIMESTAMPNS:
+	case LINUX_SO_MARK:
+	case LINUX_SO_TIMESTAMPING:
+	case LINUX_SO_PROTOCOL:
+	case LINUX_SO_DOMAIN:
+	case LINUX_SO_RXQ_OVFL:
+	case LINUX_SO_WIFI_STATUS:
+	case LINUX_SO_PEEK_OFF:
+	case LINUX_SO_NOFCS:
 	default:
 		return -1;
 	}



CVS commit: src/sys/compat/linux/common

2020-11-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Nov  3 22:08:44 UTC 2020

Modified Files:
src/sys/compat/linux/common: linux_socket.c

Log Message:
PR/55780: Bernd Sieker: setsockopt in Linux emulation misses some options


To generate a diff of this commit:
cvs rdiff -u -r1.151 -r1.152 src/sys/compat/linux/common/linux_socket.c

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



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

2020-11-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Tue Nov  3 18:42:33 UTC 2020

Modified Files:
src/usr.bin/make/unit-tests: dir.mk modmisc.mk modts.mk
varmod-exclam-shell.mk

Log Message:
make(1): clean up unit tests


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/usr.bin/make/unit-tests/dir.mk \
src/usr.bin/make/unit-tests/modts.mk
cvs rdiff -u -r1.49 -r1.50 src/usr.bin/make/unit-tests/modmisc.mk
cvs rdiff -u -r1.3 -r1.4 src/usr.bin/make/unit-tests/varmod-exclam-shell.mk

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

Modified files:

Index: src/usr.bin/make/unit-tests/dir.mk
diff -u src/usr.bin/make/unit-tests/dir.mk:1.7 src/usr.bin/make/unit-tests/dir.mk:1.8
--- src/usr.bin/make/unit-tests/dir.mk:1.7	Sat Oct 31 21:30:03 2020
+++ src/usr.bin/make/unit-tests/dir.mk	Tue Nov  3 18:42:33 2020
@@ -1,4 +1,4 @@
-# $NetBSD: dir.mk,v 1.7 2020/10/31 21:30:03 rillig Exp $
+# $NetBSD: dir.mk,v 1.8 2020/11/03 18:42:33 rillig Exp $
 #
 # Tests for dir.c.
 
@@ -64,7 +64,8 @@ fetch fetch-post extract extract-post:
 	: $@
 
 # The expansions may have duplicates.
-# These are merged together because of the dependency line.
+# When the source of the dependency line is expanded later, each of the
+# expanded words will be the same.
 all: dup-{1,1,1,1,1,1,1}
 
 dup-1:
Index: src/usr.bin/make/unit-tests/modts.mk
diff -u src/usr.bin/make/unit-tests/modts.mk:1.7 src/usr.bin/make/unit-tests/modts.mk:1.8
--- src/usr.bin/make/unit-tests/modts.mk:1.7	Sat Oct 24 08:50:17 2020
+++ src/usr.bin/make/unit-tests/modts.mk	Tue Nov  3 18:42:33 2020
@@ -1,7 +1,6 @@
-# $NetBSD: modts.mk,v 1.7 2020/10/24 08:50:17 rillig Exp $
+# $NetBSD: modts.mk,v 1.8 2020/11/03 18:42:33 rillig Exp $
 
-LIST=	one two three
-LIST+=	four five six
+LIST=	one two three four five six
 
 FU_mod-ts=	a / b / cool
 

Index: src/usr.bin/make/unit-tests/modmisc.mk
diff -u src/usr.bin/make/unit-tests/modmisc.mk:1.49 src/usr.bin/make/unit-tests/modmisc.mk:1.50
--- src/usr.bin/make/unit-tests/modmisc.mk:1.49	Sat Oct 24 08:50:17 2020
+++ src/usr.bin/make/unit-tests/modmisc.mk	Tue Nov  3 18:42:33 2020
@@ -1,4 +1,4 @@
-# $NetBSD: modmisc.mk,v 1.49 2020/10/24 08:50:17 rillig Exp $
+# $NetBSD: modmisc.mk,v 1.50 2020/11/03 18:42:33 rillig Exp $
 #
 # miscellaneous modifier tests
 
@@ -48,9 +48,9 @@ emptyvar:
 	@echo @:${:@var@${var}@}
 
 # The :U modifier turns even the "" variable into something that has a value.
-# The resulting variable is empty, but is still considered to contain a
-# single empty word. This word can be accessed by the :S and :C modifiers,
-# but not by the :@ modifier since it explicitly skips empty words.
+# The value of the resulting expression is empty, but is still considered to
+# contain a single empty word. This word can be accessed by the :S and :C
+# modifiers, but not by the :@ modifier since it explicitly skips empty words.
 undefvar:
 	@echo S:${:U:S,^$,empty,}
 	@echo C:${:U:C,^$,empty,}
@@ -65,7 +65,7 @@ mod-break-many-words:
 	@echo $@: ${UNDEF:U:range=500:[#]}
 
 # To apply a modifier indirectly via another variable, the whole
-# modifier must be put into a single variable.
+# modifier must be put into a single variable expression.
 .if ${value:L:${:US}${:U,value,replacement,}} != "S,value,replacement,}"
 .  warning unexpected
 .endif

Index: src/usr.bin/make/unit-tests/varmod-exclam-shell.mk
diff -u src/usr.bin/make/unit-tests/varmod-exclam-shell.mk:1.3 src/usr.bin/make/unit-tests/varmod-exclam-shell.mk:1.4
--- src/usr.bin/make/unit-tests/varmod-exclam-shell.mk:1.3	Sat Oct 24 08:46:08 2020
+++ src/usr.bin/make/unit-tests/varmod-exclam-shell.mk	Tue Nov  3 18:42:33 2020
@@ -1,27 +1,36 @@
-# $NetBSD: varmod-exclam-shell.mk,v 1.3 2020/10/24 08:46:08 rillig Exp $
+# $NetBSD: varmod-exclam-shell.mk,v 1.4 2020/11/03 18:42:33 rillig Exp $
 #
-# Tests for the :!cmd! variable modifier.
+# Tests for the :!cmd! variable modifier, which evaluates the modifier
+# argument, independent of the value or the name of the original variable.
 
 .if ${:!echo hello | tr 'l' 'l'!} != "hello"
-.  warning unexpected
+.  error
 .endif
 
 # The output is truncated at the first null byte.
 # Cmd_Exec returns only a string pointer without length information.
+# Truncating the output is not necessarily intended but may also be a side
+# effect from the implementation.  Having null bytes in the output of a
+# shell command is so unusual that it doesn't matter in practice.
 .if ${:!echo hello | tr 'l' '\0'!} != "he"
-.  warning unexpected
+.  error
 .endif
 
+# The newline at the end of the output is stripped.
 .if ${:!echo!} != ""
-.  warning A newline at the end of the output must be stripped.
+.  error
 .endif
 
+# Only the final newline of the output is stripped.  All other newlines are
+# converted to spaces.
 .if ${:!echo;echo!} != " "
-.  warning Only a single newline at the end of the output is stripped.
+.  error
 .endif
 
+# Each newline in the 

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

2020-11-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Tue Nov  3 18:42:33 UTC 2020

Modified Files:
src/usr.bin/make/unit-tests: dir.mk modmisc.mk modts.mk
varmod-exclam-shell.mk

Log Message:
make(1): clean up unit tests


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/usr.bin/make/unit-tests/dir.mk \
src/usr.bin/make/unit-tests/modts.mk
cvs rdiff -u -r1.49 -r1.50 src/usr.bin/make/unit-tests/modmisc.mk
cvs rdiff -u -r1.3 -r1.4 src/usr.bin/make/unit-tests/varmod-exclam-shell.mk

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



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

2020-11-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Tue Nov  3 18:21:37 UTC 2020

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

Log Message:
make(1): in tests, replace "dollar character" with "dollar sign"


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

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



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

2020-11-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Tue Nov  3 18:21:37 UTC 2020

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

Log Message:
make(1): in tests, replace "dollar character" with "dollar sign"


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

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

Modified files:

Index: src/usr.bin/make/unit-tests/dollar.exp
diff -u src/usr.bin/make/unit-tests/dollar.exp:1.3 src/usr.bin/make/unit-tests/dollar.exp:1.4
--- src/usr.bin/make/unit-tests/dollar.exp:1.3	Sun May 17 09:37:48 2020
+++ src/usr.bin/make/unit-tests/dollar.exp	Tue Nov  3 18:21:36 2020
@@ -1,7 +1,7 @@
 
 Printing dollar from literals and variables
 
-To survive the parser, a dollar character must be doubled.
+To survive the parser, a dollar sign must be doubled.
1 dollar literal => 
1 dollar literal eol => <>
2 dollar literal => <$>
Index: src/usr.bin/make/unit-tests/dollar.mk
diff -u src/usr.bin/make/unit-tests/dollar.mk:1.3 src/usr.bin/make/unit-tests/dollar.mk:1.4
--- src/usr.bin/make/unit-tests/dollar.mk:1.3	Sun May 17 09:37:48 2020
+++ src/usr.bin/make/unit-tests/dollar.mk	Tue Nov  3 18:21:36 2020
@@ -1,6 +1,6 @@
-# $NetBSD: dollar.mk,v 1.3 2020/05/17 09:37:48 rillig Exp $
+# $NetBSD: dollar.mk,v 1.4 2020/11/03 18:21:36 rillig Exp $
 #
-# Test the various places where a dollar character can appear and
+# Test the various places where a dollar sign can appear and
 # see what happens.  There are lots of surprises here.
 #
 
@@ -30,7 +30,7 @@ ${:U'}=			single-quote-var-value'
 all:
 	$H 'Printing dollar from literals and variables'
 
-	$C 'To survive the parser, a dollar character must be doubled.'
+	$C 'To survive the parser, a dollar sign must be doubled.'
 	$T	'1 dollar literal'	'$'
 	$T	'1 dollar literal eol'	''$
 	$T	'2 dollar literal'	'$$'

Index: src/usr.bin/make/unit-tests/varmod-loop.mk
diff -u src/usr.bin/make/unit-tests/varmod-loop.mk:1.5 src/usr.bin/make/unit-tests/varmod-loop.mk:1.6
--- src/usr.bin/make/unit-tests/varmod-loop.mk:1.5	Sat Oct 31 12:34:03 2020
+++ src/usr.bin/make/unit-tests/varmod-loop.mk	Tue Nov  3 18:21:36 2020
@@ -1,4 +1,4 @@
-# $NetBSD: varmod-loop.mk,v 1.5 2020/10/31 12:34:03 rillig Exp $
+# $NetBSD: varmod-loop.mk,v 1.6 2020/11/03 18:21:36 rillig Exp $
 #
 # Tests for the :@var@...${var}...@ variable modifier.
 
@@ -57,7 +57,7 @@ mod-loop-varname-dollar:
 	@echo $@:${1 2 3:L:@v$$@($v)@:Q}.
 	@echo $@:${1 2 3:L:@v$$$@($v)@:Q}.
 
-# Demonstrate that it is possible to generate dollar characters using the
+# Demonstrate that it is possible to generate dollar signs using the
 # :@ modifier.
 #
 # These are edge cases that could have resulted in a parse error as well
Index: src/usr.bin/make/unit-tests/varmod-subst.mk
diff -u src/usr.bin/make/unit-tests/varmod-subst.mk:1.5 src/usr.bin/make/unit-tests/varmod-subst.mk:1.6
--- src/usr.bin/make/unit-tests/varmod-subst.mk:1.5	Tue Nov  3 18:18:31 2020
+++ src/usr.bin/make/unit-tests/varmod-subst.mk	Tue Nov  3 18:21:36 2020
@@ -1,4 +1,4 @@
-# $NetBSD: varmod-subst.mk,v 1.5 2020/11/03 18:18:31 rillig Exp $
+# $NetBSD: varmod-subst.mk,v 1.6 2020/11/03 18:21:36 rillig Exp $
 #
 # Tests for the :S,from,to, variable modifier.
 
@@ -132,7 +132,7 @@ mod-subst-chain:
 	# modifiers with the matching modifiers.
 	@echo ${:Uvalue:S,a,x,i}.
 
-# No matter how many dollar characters there are, they all get merged
+# No matter how many dollar signs there are, they all get merged
 # into a single dollar by the :S modifier.
 #
 # As of 2020-08-09, this is because ParseModifierPart sees a '$' and
@@ -156,7 +156,7 @@ mod-subst-dollar:
 	@echo $@:${:U40:S,^,,:Q}:
 # This generates no dollar at all:
 	@echo $@:${:UU8:S,^,${:U},:Q}:
-# Here is an alternative way to generate dollar characters.
+# Here is an alternative way to generate dollar signs.
 # It's unexpectedly complicated though.
 	@echo $@:${:U:range=5:ts\x24:C,[0-9],,g:Q}:
 # In modifiers, dollars are escaped using the backslash, not using another



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

2020-11-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Tue Nov  3 18:18:31 UTC 2020

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

Log Message:
make(1): add all printable ASCII characters to the varmod-subst test

I must have missed some of them when I originally wrote the test.  Not
sure how that happened.  While here, use the official Unicode names.


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

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

Modified files:

Index: src/usr.bin/make/unit-tests/varmod-subst.exp
diff -u src/usr.bin/make/unit-tests/varmod-subst.exp:1.2 src/usr.bin/make/unit-tests/varmod-subst.exp:1.3
--- src/usr.bin/make/unit-tests/varmod-subst.exp:1.2	Sun Aug 16 12:30:45 2020
+++ src/usr.bin/make/unit-tests/varmod-subst.exp	Tue Nov  3 18:18:31 2020
@@ -9,28 +9,39 @@ mod-subst-delimiter:
 1 two 3 horizontal tabulator
 1 two 3 space
 1 two 3 exclamation mark
-1 two 3 double quotes
-1 two 3 hash
-1 two 3 dollar
-1 two 3 percent
+1 two 3 quotation mark
+1 two 3 number sign
+1 two 3 dollar sign
+1 two 3 percent sign
+1 two 3 ampersand
 1 two 3 apostrophe
-1 two 3 opening parenthesis
-1 two 3 closing parenthesis
+1 two 3 left parenthesis
+1 two 3 right parenthesis
+1 two 3 asterisk
+1 two 3 plus sign
+1 two 3 comma
+1 two 3 hyphen-minus
+1 two 3 full stop
+1 two 3 solidus
 1 two 3 digit
 1 two 3 colon
-1 two 3 less than sign
-1 two 3 equal sign
-1 two 3 greater than sign
+1 two 3 semicolon
+1 two 3 less-than sign
+1 two 3 equals sign
+1 two 3 greater-than sign
 1 two 3 question mark
-1 two 3 at
-1 two 3 letter
-1 two 3 opening bracket
-1 two 3 backslash
-1 two 3 closing bracket
-1 two 3 caret
-1 two 3 opening brace
+1 two 3 commercial at
+1 two 3 capital letter
+1 two 3 left square bracket
+1 two 3 reverse solidus
+1 two 3 right square bracket
+1 two 3 circumflex accent
+1 two 3 low line
+1 two 3 grave accent
+1 two 3 small letter
+1 two 3 left curly bracket
 1 two 3 vertical line
-1 two 3 closing brace
+1 two 3 right curly bracket
 1 two 3 tilde
 mod-subst-chain:
 A B c.

Index: src/usr.bin/make/unit-tests/varmod-subst.mk
diff -u src/usr.bin/make/unit-tests/varmod-subst.mk:1.4 src/usr.bin/make/unit-tests/varmod-subst.mk:1.5
--- src/usr.bin/make/unit-tests/varmod-subst.mk:1.4	Sat Oct 24 08:46:08 2020
+++ src/usr.bin/make/unit-tests/varmod-subst.mk	Tue Nov  3 18:18:31 2020
@@ -1,4 +1,4 @@
-# $NetBSD: varmod-subst.mk,v 1.4 2020/10/24 08:46:08 rillig Exp $
+# $NetBSD: varmod-subst.mk,v 1.5 2020/11/03 18:18:31 rillig Exp $
 #
 # Tests for the :S,from,to, variable modifier.
 
@@ -78,30 +78,41 @@ mod-subst-delimiter:
 	@echo ${:U1 2 3:S	2	two	:Q} horizontal tabulator
 	@echo ${:U1 2 3:S 2 two :Q} space
 	@echo ${:U1 2 3:S!2!two!:Q} exclamation mark
-	@echo ${:U1 2 3:S"2"two":Q} double quotes
+	@echo ${:U1 2 3:S"2"two":Q} quotation mark
 	# In shell command lines, the hash does not need to be escaped.
 	# It needs to be escaped in variable assignment lines though.
-	@echo ${:U1 2 3:S#2#two#:Q} hash
-	@echo ${:U1 2 3:S$2$two$:Q} dollar
-	@echo ${:U1 2 3:S%2%two%:Q} percent
+	@echo ${:U1 2 3:S#2#two#:Q} number sign
+	@echo ${:U1 2 3:S$2$two$:Q} dollar sign
+	@echo ${:U1 2 3:S%2%two%:Q} percent sign
+	@echo ${:U1 2 3:S&2&:Q} ampersand
 	@echo ${:U1 2 3:S'2'two':Q} apostrophe
-	@echo ${:U1 2 3:S(2(two(:Q} opening parenthesis
-	@echo ${:U1 2 3:S)2)two):Q} closing parenthesis
+	@echo ${:U1 2 3:S(2(two(:Q} left parenthesis
+	@echo ${:U1 2 3:S)2)two):Q} right parenthesis
+	@echo ${:U1 2 3:S*2*two*:Q} asterisk
+	@echo ${:U1 2 3:S+2+two+:Q} plus sign
+	@echo ${:U1 2 3:S,2,two,:Q} comma
+	@echo ${:U1 2 3:S-2-two-:Q} hyphen-minus
+	@echo ${:U1 2 3:S.2.two.:Q} full stop
+	@echo ${:U1 2 3:S/2/two/:Q} solidus
 	@echo ${:U1 2 3:S121two1:Q} digit
 	@echo ${:U1 2 3:S:2:two::Q} colon
-	@echo ${:U1 2 3:S<22>two>:Q} greater than sign
+	@echo ${:U1 2 3:S;2;two;:Q} semicolon
+	@echo ${:U1 2 3:S<22>two>:Q} greater-than sign
 	@echo ${:U1 2 3:S?2?two?:Q} question mark
-	@echo ${:U1 2 3:S@2@two@:Q} at
-	@echo ${:U1 2 3:Sa2atwoa:Q} letter
-	@echo ${:U1 2 3:S[2[two[:Q} opening bracket
-	@echo ${:U1 2 3:S\2\two\:Q} backslash
-	@echo ${:U1 2 3:S]2]two]:Q} closing bracket
-	@echo ${:U1 2 3:S^2^two^:Q} caret
-	@echo ${:U1 2 3:S{2{two{:Q} opening brace
+	@echo ${:U1 2 3:S@2@two@:Q} commercial at
+	@echo ${:U1 2 3:SA2AtwoA:Q} capital letter
+	@echo ${:U1 2 3:S[2[two[:Q} left square bracket
+	@echo ${:U1 2 3:S\2\two\:Q} reverse solidus
+	@echo ${:U1 2 3:S]2]two]:Q} right square bracket
+	@echo ${:U1 2 3:S^2^two^:Q} circumflex accent
+	@echo ${:U1 2 3:S_2_two_:Q} low line
+	@echo ${:U1 2 3:S`2`two`:Q} grave accent
+	@echo ${:U1 2 3:Sa2atwoa:Q} small letter
+	@echo ${:U1 2 3:S{2{two{:Q} left curly bracket
 	@echo ${:U1 2 3:S|2|two|:Q} vertical line
-	@echo ${:U1 2 3:S}2}two}:Q} closing brace
+	@echo 

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

2020-11-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Tue Nov  3 18:18:31 UTC 2020

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

Log Message:
make(1): add all printable ASCII characters to the varmod-subst test

I must have missed some of them when I originally wrote the test.  Not
sure how that happened.  While here, use the official Unicode names.


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

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



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

2020-11-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Tue Nov  3 17:59:27 UTC 2020

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

Log Message:
make(1): document the interesting part of the test forsubst.mk


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/usr.bin/make/unit-tests/forsubst.mk

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

Modified files:

Index: src/usr.bin/make/unit-tests/forsubst.mk
diff -u src/usr.bin/make/unit-tests/forsubst.mk:1.2 src/usr.bin/make/unit-tests/forsubst.mk:1.3
--- src/usr.bin/make/unit-tests/forsubst.mk:1.2	Sat Oct 24 08:34:59 2020
+++ src/usr.bin/make/unit-tests/forsubst.mk	Tue Nov  3 17:59:27 2020
@@ -1,4 +1,16 @@
-# $NetBSD: forsubst.mk,v 1.2 2020/10/24 08:34:59 rillig Exp $
+# $NetBSD: forsubst.mk,v 1.3 2020/11/03 17:59:27 rillig Exp $
+#
+# The parser used to break dependency lines at ';' without regard for
+# substitution patterns.  Back then, the first ';' was interpreted as the
+# separator between the dependency and its commands.  This (perhaps coupled
+# with the new handling of .for variables in ${:U...) caused
+# interesting results for lines like:
+#
+# .for file in ${LIST}
+#   for-subst:   ${file:S;^;${here}/;g}
+# .endfor
+#
+# See the commit to unit-tests/forsubst (without the .mk) from 2009-10-07.
 
 all: for-subst
 



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

2020-11-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Tue Nov  3 17:59:27 UTC 2020

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

Log Message:
make(1): document the interesting part of the test forsubst.mk


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/usr.bin/make/unit-tests/forsubst.mk

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



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

2020-11-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Tue Nov  3 17:38:45 UTC 2020

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

Log Message:
make(1): clean up tests error.mk and escape.mk


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/usr.bin/make/unit-tests/error.exp \
src/usr.bin/make/unit-tests/error.mk
cvs rdiff -u -r1.13 -r1.14 src/usr.bin/make/unit-tests/escape.mk

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

Modified files:

Index: src/usr.bin/make/unit-tests/error.exp
diff -u src/usr.bin/make/unit-tests/error.exp:1.2 src/usr.bin/make/unit-tests/error.exp:1.3
--- src/usr.bin/make/unit-tests/error.exp:1.2	Mon Sep 28 01:24:34 2020
+++ src/usr.bin/make/unit-tests/error.exp	Tue Nov  3 17:38:45 2020
@@ -1,6 +1,6 @@
-make: "error.mk" line 3: just FYI
-make: "error.mk" line 4: warning: this could be serious
-make: "error.mk" line 5: this is fatal
+make: "error.mk" line 6: just FYI
+make: "error.mk" line 7: warning: this could be serious
+make: "error.mk" line 8: this is fatal
 
 make: stopped in unit-tests
 exit status 1
Index: src/usr.bin/make/unit-tests/error.mk
diff -u src/usr.bin/make/unit-tests/error.mk:1.2 src/usr.bin/make/unit-tests/error.mk:1.3
--- src/usr.bin/make/unit-tests/error.mk:1.2	Sat Oct 24 08:34:59 2020
+++ src/usr.bin/make/unit-tests/error.mk	Tue Nov  3 17:38:45 2020
@@ -1,10 +1,12 @@
-# $NetBSD: error.mk,v 1.2 2020/10/24 08:34:59 rillig Exp $
+# $NetBSD: error.mk,v 1.3 2020/11/03 17:38:45 rillig Exp $
+#
+# Demonstrate that the .error directive exits immediately, without
+# continuing parsing until the end of the file.
 
 .info just FYI
 .warning this could be serious
 .error this is fatal
+.info this is not reached because of the .error above
 
 all:
-
-.info.html:
-	@echo this should be ignored
+	: this is not reached because of the .error

Index: src/usr.bin/make/unit-tests/escape.mk
diff -u src/usr.bin/make/unit-tests/escape.mk:1.13 src/usr.bin/make/unit-tests/escape.mk:1.14
--- src/usr.bin/make/unit-tests/escape.mk:1.13	Sat Oct 24 08:50:17 2020
+++ src/usr.bin/make/unit-tests/escape.mk	Tue Nov  3 17:38:45 2020
@@ -1,4 +1,4 @@
-# $NetBSD: escape.mk,v 1.13 2020/10/24 08:50:17 rillig Exp $
+# $NetBSD: escape.mk,v 1.14 2020/11/03 17:38:45 rillig Exp $
 #
 # Test backslash escaping.
 
@@ -187,7 +187,7 @@ var-1bsnl-space: .PHONY __printvars \
 # Backslash-newline in a command is retained.
 #
 # The "#" in "# second line without space" makes it a comment instead
-# of a syntax error if the preceding line is parsed incorretly.
+# of a syntax error if the preceding line is parsed incorrectly.
 # The ":" in "third line':" makes it look like the start of a
 # target instead of a syntax error if the first line is parsed incorrectly.
 #
@@ -220,7 +220,7 @@ cmd-1bsnl-eof:
 # XXX: This may differ from POSIX, but matches gmake.
 #
 # When make passes two backslashes to the shell, the shell will pass one
-# backslash to the echo commant.
+# backslash to the echo command.
 #
 all: cmd-2bsnl
 cmd-2bsnl: .PHONY



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

2020-11-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Tue Nov  3 17:38:45 UTC 2020

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

Log Message:
make(1): clean up tests error.mk and escape.mk


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/usr.bin/make/unit-tests/error.exp \
src/usr.bin/make/unit-tests/error.mk
cvs rdiff -u -r1.13 -r1.14 src/usr.bin/make/unit-tests/escape.mk

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



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

2020-11-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Tue Nov  3 17:37:57 UTC 2020

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

Log Message:
make(1): in test forloop.mk, replace shell execution with .info

It's easier to read in the code, and the output has line information to
better relate the output to the code.


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

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



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

2020-11-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Tue Nov  3 17:37:57 UTC 2020

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

Log Message:
make(1): in test forloop.mk, replace shell execution with .info

It's easier to read in the code, and the output has line information to
better relate the output to the code.


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

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

Modified files:

Index: src/usr.bin/make/unit-tests/forloop.exp
diff -u src/usr.bin/make/unit-tests/forloop.exp:1.3 src/usr.bin/make/unit-tests/forloop.exp:1.4
--- src/usr.bin/make/unit-tests/forloop.exp:1.3	Sun Oct 25 16:15:48 2020
+++ src/usr.bin/make/unit-tests/forloop.exp	Tue Nov  3 17:37:57 2020
@@ -1,17 +1,17 @@
-x=one
-x="two and three"
-x=four
-x="five"
-x=-I/this
-x=-I"This or that"
-x=-Ithat
-x="-DTHIS=\"this and that\""
-cfl=-I/this -I"This or that" -Ithat "-DTHIS=\"this and that\""
-newline-item=(a)
-a=one b="two and three"
-a=four b="five"
-a=ONE b="TWO AND THREE"
-a=FOUR b="FIVE"
+make: "forloop.mk" line 14: x=one
+make: "forloop.mk" line 14: x="two and three"
+make: "forloop.mk" line 14: x=four
+make: "forloop.mk" line 14: x="five"
+make: "forloop.mk" line 20: x=-I/this
+make: "forloop.mk" line 20: x=-I"This or that"
+make: "forloop.mk" line 20: x=-Ithat
+make: "forloop.mk" line 20: x="-DTHIS=\"this and that\""
+make: "forloop.mk" line 27: cfl=-I/this -I"This or that" -Ithat "-DTHIS=\"this and that\""
+make: "forloop.mk" line 41: newline-item=(a)
+make: "forloop.mk" line 47: a=one b="two and three"
+make: "forloop.mk" line 47: a=four b="five"
+make: "forloop.mk" line 47: a=ONE b="TWO AND THREE"
+make: "forloop.mk" line 47: a=FOUR b="FIVE"
 We expect an error next:
 make: "forloop.mk" line 46: Wrong number of words (9) in .for substitution list with 2 variables
 make: Fatal errors encountered -- cannot continue

Index: src/usr.bin/make/unit-tests/forloop.mk
diff -u src/usr.bin/make/unit-tests/forloop.mk:1.6 src/usr.bin/make/unit-tests/forloop.mk:1.7
--- src/usr.bin/make/unit-tests/forloop.mk:1.6	Sat Oct 24 08:50:17 2020
+++ src/usr.bin/make/unit-tests/forloop.mk	Tue Nov  3 17:37:57 2020
@@ -1,4 +1,4 @@
-# $NetBSD: forloop.mk,v 1.6 2020/10/24 08:50:17 rillig Exp $
+# $NetBSD: forloop.mk,v 1.7 2020/11/03 17:37:57 rillig Exp $
 
 all: for-loop
 
@@ -11,40 +11,40 @@ XTRA_LIST=	xtra
 .else
 
 .  for x in ${LIST}
-X!=	echo 'x=$x' >&2; echo
+.info x=$x
 .  endfor
 
 CFL=	-I/this -I"This or that" -Ithat "-DTHIS=\"this and that\""
 cfl=
 .  for x in ${CFL}
-X!=	echo 'x=$x' >&2; echo
+.info x=$x
 .if empty(cfl)
 cfl=	$x
 .else
 cfl+=	$x
 .endif
 .  endfor
-X!=	echo 'cfl=${cfl}' >&2; echo
+.  info cfl=${cfl}
 
 .  if ${cfl} != ${CFL}
-.error ${.newline}'${cfl}' != ${.newline}'${CFL}'
+.error ${.newline}${cfl} != ${.newline}${CFL}
 .  endif
 
 .  for a b in ${EMPTY}
-X!=	echo 'a=$a b=$b' >&2; echo
+.info a=$a b=$b
 .  endfor
 
 # Since at least 1993, iteration stops at the first newline.
 # Back then, the .newline variable didn't exist, therefore it was unlikely
 # that a newline ever occurred.
 .  for var in a${.newline}b${.newline}c
-X!=	echo 'newline-item=('${var:Q}')' 1>&2; echo
+.info newline-item=(${var})
 .  endfor
 
 .endif	# for-fail
 
 .for a b in ${LIST} ${LIST:tu} ${XTRA_LIST}
-X!=	echo 'a=$a b=$b' >&2; echo
+.  info a=$a b=$b
 .endfor
 
 for-loop:



CVS commit: src

2020-11-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Tue Nov  3 17:17:31 UTC 2020

Modified Files:
src/distrib/sets/lists/tests: mi
src/usr.bin/make/unit-tests: Makefile directive-elif.exp
directive-elif.mk directive-export-env.mk
directive-export-literal.mk directive-export.exp
directive-export.mk directive-include.exp directive-include.mk
directive-info.exp directive-info.mk directive-undef.exp
directive-undef.mk directive-unexport-env.mk directive-unexport.exp
directive-unexport.mk directive-warning.exp directive-warning.mk
directive.exp directive.mk
Removed Files:
src/usr.bin/make/unit-tests: directives.exp directives.mk

Log Message:
make(1): move tests from directives.mk to separate tests


To generate a diff of this commit:
cvs rdiff -u -r1.959 -r1.960 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.186 -r1.187 src/usr.bin/make/unit-tests/Makefile
cvs rdiff -u -r1.1 -r1.2 src/usr.bin/make/unit-tests/directive-elif.exp \
src/usr.bin/make/unit-tests/directive-export.exp \
src/usr.bin/make/unit-tests/directive-info.exp \
src/usr.bin/make/unit-tests/directive-undef.exp \
src/usr.bin/make/unit-tests/directive-warning.exp \
src/usr.bin/make/unit-tests/directive.exp
cvs rdiff -u -r1.2 -r1.3 src/usr.bin/make/unit-tests/directive-elif.mk \
src/usr.bin/make/unit-tests/directive-export-env.mk \
src/usr.bin/make/unit-tests/directive-info.mk \
src/usr.bin/make/unit-tests/directive-unexport-env.mk \
src/usr.bin/make/unit-tests/directive-warning.mk \
src/usr.bin/make/unit-tests/directive.mk
cvs rdiff -u -r1.5 -r1.6 \
src/usr.bin/make/unit-tests/directive-export-literal.mk
cvs rdiff -u -r1.3 -r1.4 src/usr.bin/make/unit-tests/directive-export.mk \
src/usr.bin/make/unit-tests/directive-include.exp \
src/usr.bin/make/unit-tests/directive-include.mk \
src/usr.bin/make/unit-tests/directive-unexport.exp
cvs rdiff -u -r1.4 -r1.5 src/usr.bin/make/unit-tests/directive-undef.mk \
src/usr.bin/make/unit-tests/directive-unexport.mk
cvs rdiff -u -r1.5 -r0 src/usr.bin/make/unit-tests/directives.exp
cvs rdiff -u -r1.6 -r0 src/usr.bin/make/unit-tests/directives.mk

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/tests/mi
diff -u src/distrib/sets/lists/tests/mi:1.959 src/distrib/sets/lists/tests/mi:1.960
--- src/distrib/sets/lists/tests/mi:1.959	Mon Nov  2 20:43:27 2020
+++ src/distrib/sets/lists/tests/mi	Tue Nov  3 17:17:31 2020
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.959 2020/11/02 20:43:27 rillig Exp $
+# $NetBSD: mi,v 1.960 2020/11/03 17:17:31 rillig Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -5059,8 +5059,8 @@
 ./usr/tests/usr.bin/make/unit-tests/directive-warning.mk			tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/directive.exptests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/directive.mktests-usr.bin-tests	compattestfile,atf
-./usr/tests/usr.bin/make/unit-tests/directives.exptests-usr.bin-tests	compattestfile,atf
-./usr/tests/usr.bin/make/unit-tests/directives.mktests-usr.bin-tests	compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/directives.exptests-obsolete		obsolete
+./usr/tests/usr.bin/make/unit-tests/directives.mktests-obsolete		obsolete
 ./usr/tests/usr.bin/make/unit-tests/dollar.exp	tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/dollar.mk	tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/doterror.exptests-usr.bin-tests	compattestfile,atf

Index: src/usr.bin/make/unit-tests/Makefile
diff -u src/usr.bin/make/unit-tests/Makefile:1.186 src/usr.bin/make/unit-tests/Makefile:1.187
--- src/usr.bin/make/unit-tests/Makefile:1.186	Mon Nov  2 21:53:28 2020
+++ src/usr.bin/make/unit-tests/Makefile	Tue Nov  3 17:17:31 2020
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.186 2020/11/02 21:53:28 rillig Exp $
+# $NetBSD: Makefile,v 1.187 2020/11/03 17:17:31 rillig Exp $
 #
 # Unit tests for make(1)
 #
@@ -159,7 +159,6 @@ TESTS+=		directive-undef
 TESTS+=		directive-unexport
 TESTS+=		directive-unexport-env
 TESTS+=		directive-warning
-TESTS+=		directives
 TESTS+=		dollar
 TESTS+=		doterror
 TESTS+=		dotwait

Index: src/usr.bin/make/unit-tests/directive-elif.exp
diff -u src/usr.bin/make/unit-tests/directive-elif.exp:1.1 src/usr.bin/make/unit-tests/directive-elif.exp:1.2
--- src/usr.bin/make/unit-tests/directive-elif.exp:1.1	Sun Aug 16 12:07:51 2020
+++ src/usr.bin/make/unit-tests/directive-elif.exp	Tue Nov  3 17:17:31 2020
@@ -1 +1,15 @@
-exit status 0
+make: "directive-elif.mk" line 7: begin .elif misspellings tests, part 1
+make: "directive-elif.mk" line 9: 1-then
+make: "directive-elif.mk" line 18: begin .elif misspellings tests, part 2
+make: "directive-elif.mk" line 

CVS commit: src

2020-11-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Tue Nov  3 17:17:31 UTC 2020

Modified Files:
src/distrib/sets/lists/tests: mi
src/usr.bin/make/unit-tests: Makefile directive-elif.exp
directive-elif.mk directive-export-env.mk
directive-export-literal.mk directive-export.exp
directive-export.mk directive-include.exp directive-include.mk
directive-info.exp directive-info.mk directive-undef.exp
directive-undef.mk directive-unexport-env.mk directive-unexport.exp
directive-unexport.mk directive-warning.exp directive-warning.mk
directive.exp directive.mk
Removed Files:
src/usr.bin/make/unit-tests: directives.exp directives.mk

Log Message:
make(1): move tests from directives.mk to separate tests


To generate a diff of this commit:
cvs rdiff -u -r1.959 -r1.960 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.186 -r1.187 src/usr.bin/make/unit-tests/Makefile
cvs rdiff -u -r1.1 -r1.2 src/usr.bin/make/unit-tests/directive-elif.exp \
src/usr.bin/make/unit-tests/directive-export.exp \
src/usr.bin/make/unit-tests/directive-info.exp \
src/usr.bin/make/unit-tests/directive-undef.exp \
src/usr.bin/make/unit-tests/directive-warning.exp \
src/usr.bin/make/unit-tests/directive.exp
cvs rdiff -u -r1.2 -r1.3 src/usr.bin/make/unit-tests/directive-elif.mk \
src/usr.bin/make/unit-tests/directive-export-env.mk \
src/usr.bin/make/unit-tests/directive-info.mk \
src/usr.bin/make/unit-tests/directive-unexport-env.mk \
src/usr.bin/make/unit-tests/directive-warning.mk \
src/usr.bin/make/unit-tests/directive.mk
cvs rdiff -u -r1.5 -r1.6 \
src/usr.bin/make/unit-tests/directive-export-literal.mk
cvs rdiff -u -r1.3 -r1.4 src/usr.bin/make/unit-tests/directive-export.mk \
src/usr.bin/make/unit-tests/directive-include.exp \
src/usr.bin/make/unit-tests/directive-include.mk \
src/usr.bin/make/unit-tests/directive-unexport.exp
cvs rdiff -u -r1.4 -r1.5 src/usr.bin/make/unit-tests/directive-undef.mk \
src/usr.bin/make/unit-tests/directive-unexport.mk
cvs rdiff -u -r1.5 -r0 src/usr.bin/make/unit-tests/directives.exp
cvs rdiff -u -r1.6 -r0 src/usr.bin/make/unit-tests/directives.mk

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



CVS commit: xsrc/external/mit/xorg-server/dist/hw/netbsd/x68k

2020-11-03 Thread Izumi Tsutsui
Module Name:xsrc
Committed By:   tsutsui
Date:   Tue Nov  3 16:59:38 UTC 2020

Modified Files:
xsrc/external/mit/xorg-server/dist/hw/netbsd/x68k: x68kConfig.c
x68kGraph.c

Log Message:
Remove unnecessary pointer casts from malloc(3).


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 \
xsrc/external/mit/xorg-server/dist/hw/netbsd/x68k/x68kConfig.c
cvs rdiff -u -r1.7 -r1.8 \
xsrc/external/mit/xorg-server/dist/hw/netbsd/x68k/x68kGraph.c

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

Modified files:

Index: xsrc/external/mit/xorg-server/dist/hw/netbsd/x68k/x68kConfig.c
diff -u xsrc/external/mit/xorg-server/dist/hw/netbsd/x68k/x68kConfig.c:1.5 xsrc/external/mit/xorg-server/dist/hw/netbsd/x68k/x68kConfig.c:1.6
--- xsrc/external/mit/xorg-server/dist/hw/netbsd/x68k/x68kConfig.c:1.5	Sat Aug  1 20:09:03 2020
+++ xsrc/external/mit/xorg-server/dist/hw/netbsd/x68k/x68kConfig.c	Tue Nov  3 16:59:38 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: x68kConfig.c,v 1.5 2020/08/01 20:09:03 tsutsui Exp $ */
+/* $NetBSD: x68kConfig.c,v 1.6 2020/11/03 16:59:38 tsutsui Exp $ */
 /*-
  * Copyright (c) 1996 Yasushi Yamasaki
  * All rights reserved.
@@ -176,7 +176,7 @@ getToken(void)
 static int line = 1;
 Token *ret;
 
-ret = (Token *)malloc(sizeof(Token));
+ret = malloc(sizeof(Token));
 if (ret == NULL)
 FatalError("Out of memory");
 while (TRUE) {
@@ -202,7 +202,7 @@ getToken(void)
 /* is a symbol? */
 if (isalpha(c)) {
 int i = 0;
-ret->content.symbol = (char *)malloc(32 * sizeof(char));
+ret->content.symbol = malloc(32 * sizeof(char));
 if (ret->content.symbol == NULL)
 FatalError("Out of memory");
 do {
@@ -295,7 +295,7 @@ parseCommand(void)
 break;
 }
 argc++;
-argv = (Token **)realloc(argv, sizeof(Token *) * argc);
+argv = realloc(argv, sizeof(Token *) * argc);
 if (argv == NULL)
 FatalError("Out of memory");
 argv[argc-1] = token;
@@ -395,7 +395,7 @@ parseModeDef(int argc, Token **argv)
 
 checkArguments(18, argtype, argc-1, argv);
 
-mode = (Mode *)malloc(sizeof(Mode));
+mode = malloc(sizeof(Mode));
 if (mode == NULL)
 FatalError("Out of memory");
 mode->name = strdup(argv[1]->content.symbol);
@@ -545,7 +545,7 @@ parseMode(int argc, Token **argv)
 x68kFbProc[0].open = x68kGraphOpen;
 x68kFbProc[0].init = x68kGraphInit;
 x68kFbProc[0].close = x68kGraphClose;
-	x68kFormat = (PixmapFormatRec*) malloc (sizeof(PixmapFormatRec));
+	x68kFormat = malloc (sizeof(PixmapFormatRec));
 	x68kFormat->scanlinePad = BITMAP_SCANLINE_PAD;
 x68kFormat->bitsPerPixel = 16;
 switch (mode->depth) {

Index: xsrc/external/mit/xorg-server/dist/hw/netbsd/x68k/x68kGraph.c
diff -u xsrc/external/mit/xorg-server/dist/hw/netbsd/x68k/x68kGraph.c:1.7 xsrc/external/mit/xorg-server/dist/hw/netbsd/x68k/x68kGraph.c:1.8
--- xsrc/external/mit/xorg-server/dist/hw/netbsd/x68k/x68kGraph.c:1.7	Sat Aug  1 20:21:00 2020
+++ xsrc/external/mit/xorg-server/dist/hw/netbsd/x68k/x68kGraph.c	Tue Nov  3 16:59:38 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: x68kGraph.c,v 1.7 2020/08/01 20:21:00 tsutsui Exp $ */
+/* $NetBSD: x68kGraph.c,v 1.8 2020/11/03 16:59:38 tsutsui Exp $ */
 /*-
  * Copyright (c) 1996 Yasushi Yamasaki
  * All rights reserved.
@@ -264,9 +264,9 @@ x68kCfbFinishScreenInit(
 
 ndepths = 1;
 nvisuals = 1;
-depths = (DepthPtr)malloc( sizeof(DepthRec) );
-visuals = (VisualPtr)malloc( sizeof(VisualRec) );
-vid = (VisualID *)malloc( sizeof(VisualID) );
+depths = malloc( sizeof(DepthRec) );
+visuals = malloc( sizeof(VisualRec) );
+vid = malloc( sizeof(VisualID) );
 if( !depths || !visuals || !vid ) {
 free( depths );
 free( visuals );
@@ -296,9 +296,9 @@ x68kCfbFinishScreenInit(
 
 ndepths = 1;
 nvisuals = 1;
-depths = (DepthPtr)malloc( sizeof(DepthRec) );
-visuals = (VisualPtr)malloc( sizeof(VisualRec) );
-vid = (VisualID *)malloc( sizeof(VisualID) );
+depths = malloc( sizeof(DepthRec) );
+visuals = malloc( sizeof(VisualRec) );
+vid = malloc( sizeof(VisualID) );
 if( !depths || !visuals || !vid ) {
 free( depths );
 free( visuals );



CVS commit: xsrc/external/mit/xorg-server/dist/hw/netbsd/x68k

2020-11-03 Thread Izumi Tsutsui
Module Name:xsrc
Committed By:   tsutsui
Date:   Tue Nov  3 16:59:38 UTC 2020

Modified Files:
xsrc/external/mit/xorg-server/dist/hw/netbsd/x68k: x68kConfig.c
x68kGraph.c

Log Message:
Remove unnecessary pointer casts from malloc(3).


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 \
xsrc/external/mit/xorg-server/dist/hw/netbsd/x68k/x68kConfig.c
cvs rdiff -u -r1.7 -r1.8 \
xsrc/external/mit/xorg-server/dist/hw/netbsd/x68k/x68kGraph.c

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



CVS commit: [thorpej-futex] src/sys/sys

2020-11-03 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Tue Nov  3 16:05:51 UTC 2020

Modified Files:
src/sys/sys [thorpej-futex]: futex.h

Log Message:
Add definitions for FUTEX_NETBSD_RW_WAIT and FUTEX_NETBSD_RW_HANDOFF.
(Forgot to commit this file previously.)


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.4.2.1 src/sys/sys/futex.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/sys/futex.h
diff -u src/sys/sys/futex.h:1.4 src/sys/sys/futex.h:1.4.2.1
--- src/sys/sys/futex.h:1.4	Tue May  5 15:25:18 2020
+++ src/sys/sys/futex.h	Tue Nov  3 16:05:51 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: futex.h,v 1.4 2020/05/05 15:25:18 riastradh Exp $	*/
+/*	$NetBSD: futex.h,v 1.4.2.1 2020/11/03 16:05:51 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 2018, 2019 The NetBSD Foundation, Inc.
@@ -86,6 +86,10 @@
 #define FUTEX_WAIT_REQUEUE_PI		 11
 #define FUTEX_CMP_REQUEUE_PI		 12
 
+/* These futex operations are NetBSD extensions. */
+#define FUTEX_NETBSD_RW_WAIT		 64
+#define FUTEX_NETBSD_RW_HANDOFF		 65
+
 #define FUTEX_PRIVATE_FLAG		__BIT(7)
 #define FUTEX_CLOCK_REALTIME		__BIT(8)
 
@@ -133,6 +137,18 @@
 #define FUTEX_BITSET_MATCH_ANY  ((int)__BITS(0,31))
 
 /*
+ * The FUTEX_NETBSD_RW_WAIT and FUTEX_NETBSD_RW_HANDOFF operations
+ * define specific meanings for some of the futex word bits and val3.
+ *
+ * (futex & FUTEX_TID_MASK) is the owner in the write-locked case,
+ * and the count of readers in the read-locked case.
+ */
+#define FUTEX_RW_WRITE_LOCKED	FUTEX_SYNCOBJ_1
+#define FUTEX_RW_WRITE_WANTED	FUTEX_SYNCOBJ_0
+#define FUTEX_RW_READER		0
+#define FUTEX_RW_WRITER		1
+
+/*
  * The robust futex ABI consists of an array of 3 longwords, the address
  * of which is registered with the kernel on a per-thread basis:
  *



CVS commit: [thorpej-futex] src/sys/sys

2020-11-03 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Tue Nov  3 16:05:51 UTC 2020

Modified Files:
src/sys/sys [thorpej-futex]: futex.h

Log Message:
Add definitions for FUTEX_NETBSD_RW_WAIT and FUTEX_NETBSD_RW_HANDOFF.
(Forgot to commit this file previously.)


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.4.2.1 src/sys/sys/futex.h

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



CVS commit: xsrc/external/mit/xorg-server/dist/hw/netbsd/x68k

2020-11-03 Thread Izumi Tsutsui
Module Name:xsrc
Committed By:   tsutsui
Date:   Tue Nov  3 15:52:57 UTC 2020

Modified Files:
xsrc/external/mit/xorg-server/dist/hw/netbsd/x68k: x68k.h x68kFb.c
x68kReg.h

Log Message:
Avoid a use of __UNVOLATILE(3).  Tested on XM6i.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 \
xsrc/external/mit/xorg-server/dist/hw/netbsd/x68k/x68k.h \
xsrc/external/mit/xorg-server/dist/hw/netbsd/x68k/x68kFb.c
cvs rdiff -u -r1.3 -r1.4 \
xsrc/external/mit/xorg-server/dist/hw/netbsd/x68k/x68kReg.h

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



CVS commit: xsrc/external/mit/xorg-server/dist/hw/netbsd/x68k

2020-11-03 Thread Izumi Tsutsui
Module Name:xsrc
Committed By:   tsutsui
Date:   Tue Nov  3 15:52:57 UTC 2020

Modified Files:
xsrc/external/mit/xorg-server/dist/hw/netbsd/x68k: x68k.h x68kFb.c
x68kReg.h

Log Message:
Avoid a use of __UNVOLATILE(3).  Tested on XM6i.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 \
xsrc/external/mit/xorg-server/dist/hw/netbsd/x68k/x68k.h \
xsrc/external/mit/xorg-server/dist/hw/netbsd/x68k/x68kFb.c
cvs rdiff -u -r1.3 -r1.4 \
xsrc/external/mit/xorg-server/dist/hw/netbsd/x68k/x68kReg.h

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

Modified files:

Index: xsrc/external/mit/xorg-server/dist/hw/netbsd/x68k/x68k.h
diff -u xsrc/external/mit/xorg-server/dist/hw/netbsd/x68k/x68k.h:1.5 xsrc/external/mit/xorg-server/dist/hw/netbsd/x68k/x68k.h:1.6
--- xsrc/external/mit/xorg-server/dist/hw/netbsd/x68k/x68k.h:1.5	Wed Jul 22 21:24:20 2020
+++ xsrc/external/mit/xorg-server/dist/hw/netbsd/x68k/x68k.h	Tue Nov  3 15:52:57 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: x68k.h,v 1.5 2020/07/22 21:24:20 tsutsui Exp $ */
+/* $NetBSD: x68k.h,v 1.6 2020/11/03 15:52:57 tsutsui Exp $ */
 /*-
  * Copyright (c) 1996 Yasushi Yamasaki
  * All rights reserved.
@@ -79,7 +79,7 @@ typedef struct _X68kScreenRec {
 int scr_height; /* screen height   */
 int dpi;/* dots per inch   */
 uint8_t *fb;/* frame buffer VA */
-volatile FbReg *reg;/* control register VA */
+FbReg *reg; /* control register VA */
 X68kFbReg x68kreg;  /* control register*/
 int mapsize;/* size of mapped memory */
 ColormapPtr installedMap;   /* installed colormap*/
Index: xsrc/external/mit/xorg-server/dist/hw/netbsd/x68k/x68kFb.c
diff -u xsrc/external/mit/xorg-server/dist/hw/netbsd/x68k/x68kFb.c:1.5 xsrc/external/mit/xorg-server/dist/hw/netbsd/x68k/x68kFb.c:1.6
--- xsrc/external/mit/xorg-server/dist/hw/netbsd/x68k/x68kFb.c:1.5	Tue Nov  3 15:25:21 2020
+++ xsrc/external/mit/xorg-server/dist/hw/netbsd/x68k/x68kFb.c	Tue Nov  3 15:52:57 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: x68kFb.c,v 1.5 2020/11/03 15:25:21 tsutsui Exp $ */
+/* $NetBSD: x68kFb.c,v 1.6 2020/11/03 15:52:57 tsutsui Exp $ */
 /*-
  * Copyright (c) 1996 Yasushi Yamasaki
  * All rights reserved.
@@ -113,7 +113,7 @@ x68kFbCommonClose(X68kScreenRec *pPriv)
 x68kRegSetup(pPriv);
 
 /* unmap and close frame buffer */
-if ( munmap(__UNVOLATILE(pPriv->reg), pPriv->mapsize) == -1 )
+if ( munmap(pPriv->reg, pPriv->mapsize) == -1 )
 ErrorF("Can't unmap frame buffer");
 close(pPriv->fd);
 }

Index: xsrc/external/mit/xorg-server/dist/hw/netbsd/x68k/x68kReg.h
diff -u xsrc/external/mit/xorg-server/dist/hw/netbsd/x68k/x68kReg.h:1.3 xsrc/external/mit/xorg-server/dist/hw/netbsd/x68k/x68kReg.h:1.4
--- xsrc/external/mit/xorg-server/dist/hw/netbsd/x68k/x68kReg.h:1.3	Sat Aug  1 20:09:03 2020
+++ xsrc/external/mit/xorg-server/dist/hw/netbsd/x68k/x68kReg.h	Tue Nov  3 15:52:57 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: x68kReg.h,v 1.3 2020/08/01 20:09:03 tsutsui Exp $ */
+/* $NetBSD: x68kReg.h,v 1.4 2020/11/03 15:52:57 tsutsui Exp $ */
 /*-
  * Copyright (c) 1996 Yasushi Yamasaki
  * All rights reserved.
@@ -28,11 +28,11 @@
  * CRT controller
  */
 typedef struct {
-u_short r00, r01, r02, r03, r04, r05, r06, r07;
-u_short r08, r09, r10, r11, r12, r13, r14, r15;
-u_short r16, r17, r18, r19, r20, r21, r22, r23;
+volatile u_short r00, r01, r02, r03, r04, r05, r06, r07;
+volatile u_short r08, r09, r10, r11, r12, r13, r14, r15;
+volatile u_short r16, r17, r18, r19, r20, r21, r22, r23;
 char pad0[0x450];
-u_short ctrl;
+volatile u_short ctrl;
 char pad1[0x1b7e];
 } Crtc;
 
@@ -47,11 +47,11 @@ typedef struct {
  * video controller
  */
 typedef struct {
-u_short r0;
+volatile u_short r0;
 char pad0[0xfe];
-u_short r1;
+volatile u_short r1;
 char pad1[0xfe];
-u_short r2;
+volatile u_short r2;
 char pad2[0x19fe];
 } Videoc;
 
@@ -63,9 +63,9 @@ typedef struct {
 
 /* system port */
 typedef struct {
-u_short r1, r2, r3, r4;
+volatile u_short r1, r2, r3, r4;
 u_short pad0[2];
-u_short r5, r6;
+volatile u_short r5, r6;
 u_short pad[0x1ff0];
 } Sysport;
 
@@ -74,8 +74,8 @@ typedef struct {
  */
 typedef struct {
 Crtc crtc;
-u_short gpal[256];/* graphic palette */
-u_short tpal[256]; /* text palette */
+volatile u_short gpal[256];/* graphic palette */
+volatile u_short tpal[256]; /* text palette */
 Videoc videoc;
 u_short pad0[0xa000];
 Sysport sysport;



CVS commit: xsrc/external/mit/xorg-server/dist/hw/netbsd/x68k

2020-11-03 Thread Izumi Tsutsui
Module Name:xsrc
Committed By:   tsutsui
Date:   Tue Nov  3 15:27:45 UTC 2020

Modified Files:
xsrc/external/mit/xorg-server/dist/hw/netbsd/x68k: X68kConfig

Log Message:
Add ModeDef for 640x480x4bit PseudoColor.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 \
xsrc/external/mit/xorg-server/dist/hw/netbsd/x68k/X68kConfig

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

Modified files:

Index: xsrc/external/mit/xorg-server/dist/hw/netbsd/x68k/X68kConfig
diff -u xsrc/external/mit/xorg-server/dist/hw/netbsd/x68k/X68kConfig:1.1 xsrc/external/mit/xorg-server/dist/hw/netbsd/x68k/X68kConfig:1.2
--- xsrc/external/mit/xorg-server/dist/hw/netbsd/x68k/X68kConfig:1.1	Sat Mar  1 19:34:47 2014
+++ xsrc/external/mit/xorg-server/dist/hw/netbsd/x68k/X68kConfig	Tue Nov  3 15:27:45 2020
@@ -1,4 +1,4 @@
-;; $NetBSD: X68kConfig,v 1.1 2014/03/01 19:34:47 tsutsui Exp $
+;; $NetBSD: X68kConfig,v 1.2 2020/11/03 15:27:45 tsutsui Exp $
 ;;
 ;; X68kConfig: sample configuration for X68k
 ;; written by Yasushi Yamasaki
@@ -52,6 +52,14 @@
 919   17   81  5675   40  552   27
78930)
 
+;
+; 640x480x4bit PseudoColor
+; CRTC-R20 = 0x0417(1047) VIDEOC-R0 = 0x0004
+;
+(ModeDef Pseudo16Color640x480 Graphic 4 PseudoColor  640 480
+99   11   13   93  5241   33  513   27
+  104740)
+
 ;;
 ;; tricky modes
 ;;
@@ -100,6 +108,7 @@
 ;(Mode Monochrome1024x768)
 ;(Mode Pseudo16Color1024x768)
 ;(Mode NeedsMultiScan)
+;(Mode Pseudo16Color640x480)
 
 ;;
 ;; input devices



CVS commit: xsrc/external/mit/xorg-server/dist/hw/netbsd/x68k

2020-11-03 Thread Izumi Tsutsui
Module Name:xsrc
Committed By:   tsutsui
Date:   Tue Nov  3 15:27:45 UTC 2020

Modified Files:
xsrc/external/mit/xorg-server/dist/hw/netbsd/x68k: X68kConfig

Log Message:
Add ModeDef for 640x480x4bit PseudoColor.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 \
xsrc/external/mit/xorg-server/dist/hw/netbsd/x68k/X68kConfig

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



CVS commit: xsrc/external/mit/xorg-server/dist/hw/netbsd/x68k

2020-11-03 Thread Izumi Tsutsui
Module Name:xsrc
Committed By:   tsutsui
Date:   Tue Nov  3 15:25:21 UTC 2020

Modified Files:
xsrc/external/mit/xorg-server/dist/hw/netbsd/x68k: x68kFb.c

Log Message:
Restore video mode properly on exit even on CRT Mode 19 (640x480 31kHz VGA).


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 \
xsrc/external/mit/xorg-server/dist/hw/netbsd/x68k/x68kFb.c

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

Modified files:

Index: xsrc/external/mit/xorg-server/dist/hw/netbsd/x68k/x68kFb.c
diff -u xsrc/external/mit/xorg-server/dist/hw/netbsd/x68k/x68kFb.c:1.4 xsrc/external/mit/xorg-server/dist/hw/netbsd/x68k/x68kFb.c:1.5
--- xsrc/external/mit/xorg-server/dist/hw/netbsd/x68k/x68kFb.c:1.4	Sat Aug  1 20:09:03 2020
+++ xsrc/external/mit/xorg-server/dist/hw/netbsd/x68k/x68kFb.c	Tue Nov  3 15:25:21 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: x68kFb.c,v 1.4 2020/08/01 20:09:03 tsutsui Exp $ */
+/* $NetBSD: x68kFb.c,v 1.5 2020/11/03 15:25:21 tsutsui Exp $ */
 /*-
  * Copyright (c) 1996 Yasushi Yamasaki
  * All rights reserved.
@@ -30,6 +30,8 @@ static void x68kRegSetup(X68kScreenRec *
 
 DevPrivateKeyRec x68kScreenPrivateKeyRec;
 
+static int cons_dwidth;
+
 /*-
  * function "x68kFbCommonOpen"
  *
@@ -68,6 +70,7 @@ x68kFbCommonOpen(X68kScreenRec *pPriv, c
 pPriv->fb = (uint8_t *)((uint32_t)pPriv->reg + gi.gd_regsize);
 
 x68kRegSetup( pPriv );
+cons_dwidth = gi.gd_dwidth;
 
 return TRUE;
 }
@@ -83,7 +86,8 @@ x68kFbCommonOpen(X68kScreenRec *pPriv, c
 void
 x68kFbCommonClose(X68kScreenRec *pPriv)
 {
-X68kFbReg graphNone = {
+static const X68kFbReg graphNone_mode16 = {
+	/* CRT mode 16 (768x512 31.5kHz) */
 { 137,14, 28, 124,
   567, 5, 40, 552,
27, 0,  0,   0,
@@ -93,8 +97,19 @@ x68kFbCommonClose(X68kScreenRec *pPriv)
 { 0x0004, 0x21e4, 0x0020 },
 0
 };
+static const X68kFbReg graphNone_mode19 = {
+	/* CRT mode 19 (640x480 31.5kHz VGA mode) */
+{  99,11, 13,  93,
+  524, 1, 33, 513,
+   27, 0,  0,   0,
+0, 0,  0,   0,
+0, 0,  0,   0,
+   0x0417, 0,  0,   0, 0 },
+{ 0x0004, 0x21e4, 0x0020 },
+0
+};
 /* change video mode */
-pPriv->x68kreg = graphNone;
+pPriv->x68kreg = (cons_dwidth == 640) ? graphNone_mode19 : graphNone_mode16;
 x68kRegSetup(pPriv);
 
 /* unmap and close frame buffer */



CVS commit: xsrc/external/mit/xorg-server/dist/hw/netbsd/x68k

2020-11-03 Thread Izumi Tsutsui
Module Name:xsrc
Committed By:   tsutsui
Date:   Tue Nov  3 15:25:21 UTC 2020

Modified Files:
xsrc/external/mit/xorg-server/dist/hw/netbsd/x68k: x68kFb.c

Log Message:
Restore video mode properly on exit even on CRT Mode 19 (640x480 31kHz VGA).


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 \
xsrc/external/mit/xorg-server/dist/hw/netbsd/x68k/x68kFb.c

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



CVS commit: src/sys/net80211

2020-11-03 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Tue Nov  3 15:06:50 UTC 2020

Modified Files:
src/sys/net80211: ieee80211_crypto_ccmp.c ieee80211_crypto_tkip.c
ieee80211_crypto_wep.c

Log Message:
Use kmem_* instead of malloc/free and use interrupt versions as the
code can be called from interrupt.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/net80211/ieee80211_crypto_ccmp.c
cvs rdiff -u -r1.16 -r1.17 src/sys/net80211/ieee80211_crypto_tkip.c
cvs rdiff -u -r1.12 -r1.13 src/sys/net80211/ieee80211_crypto_wep.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/net80211/ieee80211_crypto_ccmp.c
diff -u src/sys/net80211/ieee80211_crypto_ccmp.c:1.18 src/sys/net80211/ieee80211_crypto_ccmp.c:1.19
--- src/sys/net80211/ieee80211_crypto_ccmp.c:1.18	Tue Jul 28 15:41:26 2020
+++ src/sys/net80211/ieee80211_crypto_ccmp.c	Tue Nov  3 15:06:50 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: ieee80211_crypto_ccmp.c,v 1.18 2020/07/28 15:41:26 riastradh Exp $	*/
+/*	$NetBSD: ieee80211_crypto_ccmp.c,v 1.19 2020/11/03 15:06:50 mlelstv Exp $	*/
 
 /*
  * Copyright (c) 2002-2005 Sam Leffler, Errno Consulting
@@ -36,7 +36,7 @@
 __FBSDID("$FreeBSD: src/sys/net80211/ieee80211_crypto_ccmp.c,v 1.7 2005/07/11 03:06:23 sam Exp $");
 #endif
 #ifdef __NetBSD__
-__KERNEL_RCSID(0, "$NetBSD: ieee80211_crypto_ccmp.c,v 1.18 2020/07/28 15:41:26 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ieee80211_crypto_ccmp.c,v 1.19 2020/11/03 15:06:50 mlelstv Exp $");
 #endif
 
 /*
@@ -106,7 +106,7 @@ ccmp_attach(struct ieee80211com *ic, str
 {
 	struct ccmp_ctx *ctx;
 
-	ctx = kmem_zalloc(sizeof(*ctx), KM_NOSLEEP);
+	ctx = kmem_intr_zalloc(sizeof(*ctx), KM_NOSLEEP);
 	if (ctx == NULL) {
 		ic->ic_stats.is_crypto_nomem++;
 		return NULL;
@@ -120,7 +120,7 @@ ccmp_detach(struct ieee80211_key *k)
 {
 	struct ccmp_ctx *ctx = k->wk_private;
 
-	kmem_free(ctx, sizeof(*ctx));
+	kmem_intr_free(ctx, sizeof(*ctx));
 }
 
 static int

Index: src/sys/net80211/ieee80211_crypto_tkip.c
diff -u src/sys/net80211/ieee80211_crypto_tkip.c:1.16 src/sys/net80211/ieee80211_crypto_tkip.c:1.17
--- src/sys/net80211/ieee80211_crypto_tkip.c:1.16	Thu Dec 19 16:29:50 2019
+++ src/sys/net80211/ieee80211_crypto_tkip.c	Tue Nov  3 15:06:50 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: ieee80211_crypto_tkip.c,v 1.16 2019/12/19 16:29:50 kamil Exp $	*/
+/*	$NetBSD: ieee80211_crypto_tkip.c,v 1.17 2020/11/03 15:06:50 mlelstv Exp $	*/
 
 /*
  * Copyright (c) 2002-2005 Sam Leffler, Errno Consulting
@@ -36,7 +36,7 @@
 __FBSDID("$FreeBSD: src/sys/net80211/ieee80211_crypto_tkip.c,v 1.10 2005/08/08 18:46:35 sam Exp $");
 #endif
 #ifdef __NetBSD__
-__KERNEL_RCSID(0, "$NetBSD: ieee80211_crypto_tkip.c,v 1.16 2019/12/19 16:29:50 kamil Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ieee80211_crypto_tkip.c,v 1.17 2020/11/03 15:06:50 mlelstv Exp $");
 #endif
 
 /*
@@ -49,7 +49,7 @@ __KERNEL_RCSID(0, "$NetBSD: ieee80211_cr
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 
@@ -118,7 +118,7 @@ tkip_attach(struct ieee80211com *ic, str
 {
 	struct tkip_ctx *ctx;
 
-	ctx = malloc(sizeof(struct tkip_ctx), M_DEVBUF, M_NOWAIT | M_ZERO);
+	ctx = kmem_intr_zalloc(sizeof(struct tkip_ctx), KM_NOSLEEP);
 	if (ctx == NULL) {
 		ic->ic_stats.is_crypto_nomem++;
 		return NULL;
@@ -133,7 +133,7 @@ tkip_detach(struct ieee80211_key *k)
 {
 	struct tkip_ctx *ctx = k->wk_private;
 
-	free(ctx, M_DEVBUF);
+	kmem_intr_free(ctx, sizeof(struct tkip_ctx));
 }
 
 static int

Index: src/sys/net80211/ieee80211_crypto_wep.c
diff -u src/sys/net80211/ieee80211_crypto_wep.c:1.12 src/sys/net80211/ieee80211_crypto_wep.c:1.13
--- src/sys/net80211/ieee80211_crypto_wep.c:1.12	Thu May  3 17:14:37 2018
+++ src/sys/net80211/ieee80211_crypto_wep.c	Tue Nov  3 15:06:50 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: ieee80211_crypto_wep.c,v 1.12 2018/05/03 17:14:37 maxv Exp $	*/
+/*	$NetBSD: ieee80211_crypto_wep.c,v 1.13 2020/11/03 15:06:50 mlelstv Exp $	*/
 
 /*
  * Copyright (c) 2002-2005 Sam Leffler, Errno Consulting
@@ -36,7 +36,7 @@
 __FBSDID("$FreeBSD: src/sys/net80211/ieee80211_crypto_wep.c,v 1.7 2005/06/10 16:11:24 sam Exp $");
 #endif
 #ifdef __NetBSD__
-__KERNEL_RCSID(0, "$NetBSD: ieee80211_crypto_wep.c,v 1.12 2018/05/03 17:14:37 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ieee80211_crypto_wep.c,v 1.13 2020/11/03 15:06:50 mlelstv Exp $");
 #endif
 
 /*
@@ -45,7 +45,7 @@ __KERNEL_RCSID(0, "$NetBSD: ieee80211_cr
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 
@@ -95,7 +95,7 @@ wep_attach(struct ieee80211com *ic, stru
 {
 	struct wep_ctx *ctx;
 
-	ctx = malloc(sizeof(struct wep_ctx), M_DEVBUF, M_NOWAIT | M_ZERO);
+	ctx = kmem_intr_zalloc(sizeof(struct wep_ctx), KM_NOSLEEP);
 	if (ctx == NULL) {
 		ic->ic_stats.is_crypto_nomem++;
 		return NULL;
@@ -111,7 +111,7 @@ wep_detach(struct ieee80211_key *k)
 {
 	struct wep_ctx *ctx = k->wk_private;
 
-	free(ctx, M_DEVBUF);
+	

CVS commit: src/sys/net80211

2020-11-03 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Tue Nov  3 15:06:50 UTC 2020

Modified Files:
src/sys/net80211: ieee80211_crypto_ccmp.c ieee80211_crypto_tkip.c
ieee80211_crypto_wep.c

Log Message:
Use kmem_* instead of malloc/free and use interrupt versions as the
code can be called from interrupt.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/net80211/ieee80211_crypto_ccmp.c
cvs rdiff -u -r1.16 -r1.17 src/sys/net80211/ieee80211_crypto_tkip.c
cvs rdiff -u -r1.12 -r1.13 src/sys/net80211/ieee80211_crypto_wep.c

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



CVS commit: src/sys/external/bsd/vchiq/dist/interface/vchiq_arm

2020-11-03 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Tue Nov  3 12:04:56 UTC 2020

Modified Files:
src/sys/external/bsd/vchiq/dist/interface/vchiq_arm: vchiq_core.h

Log Message:
state struct should use fixed size types. NFCI.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 \
src/sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_core.h

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



CVS commit: src/sys/external/bsd/vchiq/dist/interface/vchiq_arm

2020-11-03 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Tue Nov  3 12:04:56 UTC 2020

Modified Files:
src/sys/external/bsd/vchiq/dist/interface/vchiq_arm: vchiq_core.h

Log Message:
state struct should use fixed size types. NFCI.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 \
src/sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_core.h

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

Modified files:

Index: src/sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_core.h
diff -u src/sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_core.h:1.7 src/sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_core.h:1.8
--- src/sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_core.h:1.7	Tue Nov  3 08:41:30 2020
+++ src/sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_core.h	Tue Nov  3 12:04:56 2020
@@ -371,7 +371,7 @@ typedef struct vchiq_shared_state_struct
 	REMOTE_EVENT_T recycle;
 
 	/* The slot_queue index where the next recycled slot will be written. */
-	int slot_queue_recycle;
+	int32_t slot_queue_recycle;
 
 	/* This event should be signalled when a synchronous message is sent. */
 	REMOTE_EVENT_T sync_trigger;



CVS commit: src/external/bsd/tmux/dist

2020-11-03 Thread Tobias Nygren
Module Name:src
Committed By:   tnn
Date:   Tue Nov  3 10:52:58 UTC 2020

Modified Files:
src/external/bsd/tmux/dist: tmux.h

Log Message:
tmux.h: annotate file_vprint() as printflike


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/external/bsd/tmux/dist/tmux.h

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

Modified files:

Index: src/external/bsd/tmux/dist/tmux.h
diff -u src/external/bsd/tmux/dist/tmux.h:1.16 src/external/bsd/tmux/dist/tmux.h:1.17
--- src/external/bsd/tmux/dist/tmux.h:1.16	Sun Nov  1 15:16:05 2020
+++ src/external/bsd/tmux/dist/tmux.h	Tue Nov  3 10:52:58 2020
@@ -2185,7 +2185,7 @@ void	 file_fire_done(struct client_file 
 void	 file_fire_read(struct client_file *);
 int	 file_can_print(struct client *);
 void printflike(2, 3) file_print(struct client *, const char *, ...);
-void 	 file_vprint(struct client *, const char *, va_list);
+void printflike(2, 0) file_vprint(struct client *, const char *, va_list);
 void 	 file_print_buffer(struct client *, void *, size_t);
 void printflike(2, 3) file_error(struct client *, const char *, ...);
 void	 file_write(struct client *, const char *, int, const void *, size_t,



CVS commit: src/external/bsd/tmux/dist

2020-11-03 Thread Tobias Nygren
Module Name:src
Committed By:   tnn
Date:   Tue Nov  3 10:52:58 UTC 2020

Modified Files:
src/external/bsd/tmux/dist: tmux.h

Log Message:
tmux.h: annotate file_vprint() as printflike


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/external/bsd/tmux/dist/tmux.h

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



CVS commit: src/lib/libossaudio

2020-11-03 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Tue Nov  3 09:46:01 UTC 2020

Modified Files:
src/lib/libossaudio: ossaudio.c

Log Message:
ossaudio(3): Reduce code duplication for querying capabilities


To generate a diff of this commit:
cvs rdiff -u -r1.61 -r1.62 src/lib/libossaudio/ossaudio.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/libossaudio/ossaudio.c
diff -u src/lib/libossaudio/ossaudio.c:1.61 src/lib/libossaudio/ossaudio.c:1.62
--- src/lib/libossaudio/ossaudio.c:1.61	Tue Nov  3 09:36:12 2020
+++ src/lib/libossaudio/ossaudio.c	Tue Nov  3 09:46:00 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: ossaudio.c,v 1.61 2020/11/03 09:36:12 nia Exp $	*/
+/*	$NetBSD: ossaudio.c,v 1.62 2020/11/03 09:46:00 nia Exp $	*/
 
 /*-
  * Copyright (c) 1997, 2020 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: ossaudio.c,v 1.61 2020/11/03 09:36:12 nia Exp $");
+__RCSID("$NetBSD: ossaudio.c,v 1.62 2020/11/03 09:46:00 nia Exp $");
 
 /*
  * This is an Open Sound System compatibility layer, which provides
@@ -71,6 +71,8 @@ static int getaudiocount(void);
 static int getmixercount(void);
 static int getmixercontrolcount(int);
 
+static int getcaps(int, int *);
+
 static int getvol(u_int, u_char);
 static void setvol(int, int, bool);
 
@@ -126,7 +128,7 @@ audio_ioctl(int fd, unsigned long com, v
 	static int totalperrors = 0;
 	static int totalrerrors = 0;
 	oss_count_t osscount;
-	int idat, idata;
+	int idat;
 	int retval;
 
 	idat = 0;
@@ -520,19 +522,9 @@ audio_ioctl(int fd, unsigned long com, v
 			return retval;
 		break;
 	case SNDCTL_DSP_GETCAPS:
-		retval = ioctl(fd, AUDIO_GETPROPS, );
+		retval = getcaps(fd, (int *)argp);
 		if (retval < 0)
 			return retval;
-		idat = DSP_CAP_TRIGGER;
-		if (idata & AUDIO_PROP_FULLDUPLEX)
-			idat |= DSP_CAP_DUPLEX;
-		if (idata & AUDIO_PROP_MMAP)
-			idat |= DSP_CAP_MMAP;
-		if (idata & AUDIO_PROP_CAPTURE)
-			idat |= DSP_CAP_INPUT;
-		if (idata & AUDIO_PROP_PLAYBACK)
-			idat |= DSP_CAP_OUTPUT;
-		INTARG = idat;
 		break;
 	case SNDCTL_DSP_SETTRIGGER:
 		retval = ioctl(fd, AUDIO_GETBUFINFO, );
@@ -1018,7 +1010,6 @@ mixer_oss4_ioctl(int fd, unsigned long c
 	int newfd = -1, tmperrno;
 	int i, noffs;
 	int retval;
-	int props, caps;
 
 	/*
 	 * Note: it is difficult to translate the NetBSD concept of a "set"
@@ -1075,27 +1066,16 @@ mixer_oss4_ioctl(int fd, unsigned long c
 			errno = tmperrno;
 			return retval;
 		}
-		retval = ioctl(newfd, AUDIO_GETPROPS, );
-		if (retval < 0) {
+		if (getcaps(newfd, >caps) < 0) {
 			tmperrno = errno;
 			close(newfd);
 			errno = tmperrno;
 			return retval;
 		}
-		caps = DSP_CAP_TRIGGER;
-		if (props & AUDIO_PROP_FULLDUPLEX)
-			caps |= DSP_CAP_DUPLEX;
-		if (props & AUDIO_PROP_MMAP)
-			caps |= DSP_CAP_MMAP;
-		if (props & AUDIO_PROP_CAPTURE)
-			caps |= PCM_CAP_INPUT;
-		if (props & AUDIO_PROP_PLAYBACK)
-			caps |= PCM_CAP_OUTPUT;
 		snprintf(tmpai->name, sizeof(tmpai->name),
 		"%s %s", dev.name, dev.version);
 		tmpai->busy = 0;
 		tmpai->pid = -1;
-		tmpai->caps = caps;
 		ioctl(newfd, SNDCTL_DSP_GETFMTS, >iformats);
 		tmpai->oformats = tmpai->iformats;
 		tmpai->magic = -1; /* reserved for "internal use" */
@@ -1576,6 +1556,29 @@ global_oss4_ioctl(int fd, unsigned long 
 }
 
 static int
+getcaps(int fd, int *out)
+{
+	int props, caps;
+
+	if (ioctl(fd, AUDIO_GETPROPS, ) < 0)
+		return -1;
+
+	caps = DSP_CAP_TRIGGER;
+
+	if (props & AUDIO_PROP_FULLDUPLEX)
+		caps |= DSP_CAP_DUPLEX;
+	if (props & AUDIO_PROP_MMAP)
+		caps |= DSP_CAP_MMAP;
+	if (props & AUDIO_PROP_CAPTURE)
+		caps |= PCM_CAP_INPUT;
+	if (props & AUDIO_PROP_PLAYBACK)
+		caps |= PCM_CAP_OUTPUT;
+
+	*out = caps;
+	return 0;
+}
+
+static int
 getaudiocount(void)
 {
 	char devname[32];



CVS commit: src/lib/libossaudio

2020-11-03 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Tue Nov  3 09:46:01 UTC 2020

Modified Files:
src/lib/libossaudio: ossaudio.c

Log Message:
ossaudio(3): Reduce code duplication for querying capabilities


To generate a diff of this commit:
cvs rdiff -u -r1.61 -r1.62 src/lib/libossaudio/ossaudio.c

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



CVS commit: src/lib/libossaudio

2020-11-03 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Tue Nov  3 09:36:12 UTC 2020

Modified Files:
src/lib/libossaudio: ossaudio.c

Log Message:
ossaudio(3): Return device playback and capture capabilities in GETCAPS


To generate a diff of this commit:
cvs rdiff -u -r1.60 -r1.61 src/lib/libossaudio/ossaudio.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/libossaudio/ossaudio.c
diff -u src/lib/libossaudio/ossaudio.c:1.60 src/lib/libossaudio/ossaudio.c:1.61
--- src/lib/libossaudio/ossaudio.c:1.60	Tue Nov  3 08:24:33 2020
+++ src/lib/libossaudio/ossaudio.c	Tue Nov  3 09:36:12 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: ossaudio.c,v 1.60 2020/11/03 08:24:33 nia Exp $	*/
+/*	$NetBSD: ossaudio.c,v 1.61 2020/11/03 09:36:12 nia Exp $	*/
 
 /*-
  * Copyright (c) 1997, 2020 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: ossaudio.c,v 1.60 2020/11/03 08:24:33 nia Exp $");
+__RCSID("$NetBSD: ossaudio.c,v 1.61 2020/11/03 09:36:12 nia Exp $");
 
 /*
  * This is an Open Sound System compatibility layer, which provides
@@ -528,6 +528,10 @@ audio_ioctl(int fd, unsigned long com, v
 			idat |= DSP_CAP_DUPLEX;
 		if (idata & AUDIO_PROP_MMAP)
 			idat |= DSP_CAP_MMAP;
+		if (idata & AUDIO_PROP_CAPTURE)
+			idat |= DSP_CAP_INPUT;
+		if (idata & AUDIO_PROP_PLAYBACK)
+			idat |= DSP_CAP_OUTPUT;
 		INTARG = idat;
 		break;
 	case SNDCTL_DSP_SETTRIGGER:



CVS commit: src/lib/libossaudio

2020-11-03 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Tue Nov  3 09:36:12 UTC 2020

Modified Files:
src/lib/libossaudio: ossaudio.c

Log Message:
ossaudio(3): Return device playback and capture capabilities in GETCAPS


To generate a diff of this commit:
cvs rdiff -u -r1.60 -r1.61 src/lib/libossaudio/ossaudio.c

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



CVS commit: src/lib/libossaudio

2020-11-03 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Tue Nov  3 09:33:53 UTC 2020

Modified Files:
src/lib/libossaudio: soundcard.h

Log Message:
ossaudio(3): More capability defines from OSSv4


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/lib/libossaudio/soundcard.h

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

Modified files:

Index: src/lib/libossaudio/soundcard.h
diff -u src/lib/libossaudio/soundcard.h:1.31 src/lib/libossaudio/soundcard.h:1.32
--- src/lib/libossaudio/soundcard.h:1.31	Fri Oct 23 09:05:20 2020
+++ src/lib/libossaudio/soundcard.h	Tue Nov  3 09:33:53 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: soundcard.h,v 1.31 2020/10/23 09:05:20 nia Exp $	*/
+/*	$NetBSD: soundcard.h,v 1.32 2020/11/03 09:33:53 nia Exp $	*/
 
 /*-
  * Copyright (c) 1997, 2020 The NetBSD Foundation, Inc.
@@ -81,17 +81,42 @@
 #define SNDCTL_DSP_GETISPACE		_IOR ('P',13, struct audio_buf_info)
 #define SNDCTL_DSP_NONBLOCK		_IO  ('P',14)
 #define SNDCTL_DSP_GETCAPS		_IOR ('P',15, int)
-# define DSP_CAP_REVISION		0x00ff
-# define DSP_CAP_DUPLEX			0x0100
-# define DSP_CAP_REALTIME		0x0200
-# define DSP_CAP_BATCH			0x0400
-# define DSP_CAP_COPROC			0x0800
-# define DSP_CAP_TRIGGER		0x1000
-# define DSP_CAP_MMAP			0x2000
-# define PCM_CAP_INPUT			0x4000
-# define PCM_CAP_OUTPUT			0x8000
-# define PCM_CAP_MODEM			0x0001
-# define PCM_CAP_HIDDEN			0x0002
+/* PCM_CAP_* were known as DSP_CAP_ before OSS 4.0 */
+# define DSP_CAP_REVISION		PCM_CAP_REVISION
+# define DSP_CAP_DUPLEX			PCM_CAP_DUPLEX
+# define DSP_CAP_REALTIME		PCM_CAP_REALTIME
+# define DSP_CAP_BATCH			PCM_CAP_BATCH
+# define DSP_CAP_COPROC			PCM_CAP_COPROC
+# define DSP_CAP_TRIGGER		PCM_CAP_TRIGGER
+# define DSP_CAP_MMAP			PCM_CAP_MMAP
+# define DSP_CAP_INPUT			PCM_CAP_INPUT
+# define DSP_CAP_OUTPUT			PCM_CAP_OUTPUT
+# define DSP_CAP_MODEM			PCM_CAP_MODEM
+# define DSP_CAP_HIDDEN			PCM_CAP_HIDDEN
+# define DSP_CAP_VIRTUAL		PCM_CAP_VIRTUAL
+# define DSP_CAP_ANALOGOUT		PCM_CAP_ANALOGOUT
+# define DSP_CAP_ANALOGIN		PCM_CAP_ANALOGIN
+# define DSP_CAP_DIGITALOUT		PCM_CAP_DIGITALOUT
+# define DSP_CAP_DIGITALIN		PCM_CAP_DIGITALIN
+# define DSP_CAP_ADMASK			PCM_CAP_ADMASK
+# define PCM_CAP_REVISION		0x00ff	/* Unused in NetBSD */
+# define PCM_CAP_DUPLEX			0x0100	/* Full duplex */
+# define PCM_CAP_REALTIME		0x0200	/* Unused in NetBSD */
+# define PCM_CAP_BATCH			0x0400	/* Unused in NetBSD */
+# define PCM_CAP_COPROC			0x0800	/* Unused in NetBSD */
+# define PCM_CAP_TRIGGER		0x1000	/* Supports SETTRIGGER */
+# define PCM_CAP_MMAP			0x2000	/* Supports mmap() */
+# define PCM_CAP_INPUT			0x4000	/* Recording device */
+# define PCM_CAP_OUTPUT			0x8000	/* Playback device */
+# define PCM_CAP_MODEM			0x0001	/* Unused in NetBSD */
+# define PCM_CAP_HIDDEN			0x0002	/* Unused in NetBSD */
+# define PCM_CAP_VIRTUAL		0x0004	/* Unused in NetBSD */
+# define PCM_CAP_ANALOGOUT		0x0010	/* Unused in NetBSD */
+# define PCM_CAP_ANALOGIN		0x0020	/* Unused in NetBSD */
+# define PCM_CAP_DIGITALOUT		0x0040	/* Unused in NetBSD */
+# define PCM_CAP_DIGITALIN		0x0080	/* Unused in NetBSD */
+# define PCM_CAP_ADMASK			0x00f0	/* Unused in NetBSD */
+# define PCM_CAP_SPECIAL		0x0100	/* Unused in NetBSD */
 #define SNDCTL_DSP_GETTRIGGER		_IOR ('P', 16, int)
 #define SNDCTL_DSP_SETTRIGGER		_IOW ('P', 16, int)
 # define PCM_ENABLE_INPUT		0x0001



CVS commit: src/lib/libossaudio

2020-11-03 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Tue Nov  3 09:33:53 UTC 2020

Modified Files:
src/lib/libossaudio: soundcard.h

Log Message:
ossaudio(3): More capability defines from OSSv4


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/lib/libossaudio/soundcard.h

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



CVS commit: src/sys/dev/sdmmc

2020-11-03 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Tue Nov  3 09:26:41 UTC 2020

Modified Files:
src/sys/dev/sdmmc: if_bwfm_sdio.c

Log Message:
Continue parsing frames after empty payload.
Add diagnostic messages.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/dev/sdmmc/if_bwfm_sdio.c

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

Modified files:

Index: src/sys/dev/sdmmc/if_bwfm_sdio.c
diff -u src/sys/dev/sdmmc/if_bwfm_sdio.c:1.23 src/sys/dev/sdmmc/if_bwfm_sdio.c:1.24
--- src/sys/dev/sdmmc/if_bwfm_sdio.c:1.23	Wed Jul 22 17:23:12 2020
+++ src/sys/dev/sdmmc/if_bwfm_sdio.c	Tue Nov  3 09:26:41 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: if_bwfm_sdio.c,v 1.23 2020/07/22 17:23:12 riastradh Exp $ */
+/* $NetBSD: if_bwfm_sdio.c,v 1.24 2020/11/03 09:26:41 mlelstv Exp $ */
 /* $OpenBSD: if_bwfm_sdio.c,v 1.1 2017/10/11 17:19:50 patrick Exp $ */
 /*
  * Copyright (c) 2010-2016 Broadcom Corporation
@@ -1478,6 +1478,8 @@ bwfm_sdio_task1(struct bwfm_sdio_softc *
 		DPRINTF(("%s: hostint 0x%" PRIx32 "\n", DEVNAME(sc), hostint));
 		bwfm_sdio_dev_write(sc, SDPCMD_TOSBMAILBOX,
 		SDPCMD_TOSBMAILBOX_INT_ACK);
+		if (hostint & SDPCMD_TOHOSTMAILBOXDATA_FWHALT)
+			printf("%s: firmware halted\n", DEVNAME(sc));
 		if (hostint & SDPCMD_TOHOSTMAILBOXDATA_NAKHANDLED)
 			sc->sc_rxskip = false;
 		if (hostint & SDPCMD_TOHOSTMAILBOXDATA_DEVREADY ||
@@ -1726,6 +1728,8 @@ bwfm_sdio_rx_frames(struct bwfm_sdio_sof
 
 		flen = hwhdr->frmlen - (sizeof(*hwhdr) + sizeof(*swhdr));
 		if (flen == 0) {
+			DPRINTF(("%s: empty payload (frmlen=%u)\n",
+			DEVNAME(sc), hwhdr->frmlen));
 			nextlen = swhdr->nextlen << 4;
 			continue;
 		}
@@ -1794,11 +1798,10 @@ bwfm_sdio_rx_frames(struct bwfm_sdio_sof
 			}
 			m_adj(m, hoff);
 			/* don't pass empty packet to stack */
-			if (m->m_len == 0) {
+			if (m->m_len > 0)
+bwfm_rx(>sc_sc, m);
+			else
 m_freem(m);
-break;
-			}
-			bwfm_rx(>sc_sc, m);
 			nextlen = swhdr->nextlen << 4;
 			break;
 		case BWFM_SDIO_SWHDR_CHANNEL_GLOM:



CVS commit: src/sys/dev/sdmmc

2020-11-03 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Tue Nov  3 09:26:41 UTC 2020

Modified Files:
src/sys/dev/sdmmc: if_bwfm_sdio.c

Log Message:
Continue parsing frames after empty payload.
Add diagnostic messages.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/dev/sdmmc/if_bwfm_sdio.c

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



CVS commit: src/sys/external/bsd/vchiq/dist/interface/vchiq_arm

2020-11-03 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Nov  3 08:41:30 UTC 2020

Modified Files:
src/sys/external/bsd/vchiq/dist/interface/vchiq_arm: vchiq_2835_arm.c
vchiq_core.h

Log Message:
Fix build on aa64


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 \
src/sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_2835_arm.c
cvs rdiff -u -r1.6 -r1.7 \
src/sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_core.h

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

Modified files:

Index: src/sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_2835_arm.c
diff -u src/sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_2835_arm.c:1.22 src/sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_2835_arm.c:1.23
--- src/sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_2835_arm.c:1.22	Sat Sep 26 12:58:23 2020
+++ src/sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_2835_arm.c	Tue Nov  3 08:41:30 2020
@@ -42,6 +42,8 @@
 
 #include 
 
+#include 
+
 #include 
 #include 
 

Index: src/sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_core.h
diff -u src/sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_core.h:1.6 src/sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_core.h:1.7
--- src/sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_core.h:1.6	Sat Sep 26 12:58:23 2020
+++ src/sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_core.h	Tue Nov  3 08:41:30 2020
@@ -37,6 +37,8 @@
 #include 
 #include 
 
+#include 
+
 #include "vchiq_cfg.h"
 
 #include "vchiq.h"



CVS commit: src/sys/external/bsd/vchiq/dist/interface/vchiq_arm

2020-11-03 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Nov  3 08:41:30 UTC 2020

Modified Files:
src/sys/external/bsd/vchiq/dist/interface/vchiq_arm: vchiq_2835_arm.c
vchiq_core.h

Log Message:
Fix build on aa64


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 \
src/sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_2835_arm.c
cvs rdiff -u -r1.6 -r1.7 \
src/sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_core.h

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/include

2020-11-03 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Nov  3 08:34:17 UTC 2020

Modified Files:
src/sys/arch/arm/include: cdefs.h

Log Message:
The ARM C Language Extenstion document defines __ARCH_ARM as the integer
macro indicating the current ARM instruction set.  Let's use it.

PR/55778: evbarm64 GENERIC64 kernel fails to build with clang

XXX Handle the fact that for an ARM architecture ARMvX.Y then,
XXX __ARM_ARCH= X * 100 + Y. E.g. for ARMv8.1 __ARM_ARCH = 801.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/arm/include/cdefs.h

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/include

2020-11-03 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Nov  3 08:34:17 UTC 2020

Modified Files:
src/sys/arch/arm/include: cdefs.h

Log Message:
The ARM C Language Extenstion document defines __ARCH_ARM as the integer
macro indicating the current ARM instruction set.  Let's use it.

PR/55778: evbarm64 GENERIC64 kernel fails to build with clang

XXX Handle the fact that for an ARM architecture ARMvX.Y then,
XXX __ARM_ARCH= X * 100 + Y. E.g. for ARMv8.1 __ARM_ARCH = 801.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/arm/include/cdefs.h

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

Modified files:

Index: src/sys/arch/arm/include/cdefs.h
diff -u src/sys/arch/arm/include/cdefs.h:1.17 src/sys/arch/arm/include/cdefs.h:1.18
--- src/sys/arch/arm/include/cdefs.h:1.17	Sun Oct 11 16:22:02 2020
+++ src/sys/arch/arm/include/cdefs.h	Tue Nov  3 08:34:17 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: cdefs.h,v 1.17 2020/10/11 16:22:02 skrll Exp $	*/
+/*	$NetBSD: cdefs.h,v 1.18 2020/11/03 08:34:17 skrll Exp $	*/
 
 #ifndef	_ARM_CDEFS_H_
 #define	_ARM_CDEFS_H_
@@ -10,7 +10,8 @@
 #endif
 
 
-#if defined (__ARM_ARCH_8A__) || defined (__ARM_ARCH_8A)
+#if defined (__ARM_ARCH_8A__) || defined (__ARM_ARCH_8A) || \
+__ARM_ARCH == 8
 	/* __ARM_ARCH_8A__ is a typo */
 #define _ARM_ARCH_8
 #endif



CVS commit: src/lib/libossaudio

2020-11-03 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Tue Nov  3 08:24:33 UTC 2020

Modified Files:
src/lib/libossaudio: ossaudio.c

Log Message:
ossaudio(3): return correctly initialized return value in unlikely
error case. pointed out by tnn.


To generate a diff of this commit:
cvs rdiff -u -r1.59 -r1.60 src/lib/libossaudio/ossaudio.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/libossaudio/ossaudio.c
diff -u src/lib/libossaudio/ossaudio.c:1.59 src/lib/libossaudio/ossaudio.c:1.60
--- src/lib/libossaudio/ossaudio.c:1.59	Fri Oct 30 21:44:49 2020
+++ src/lib/libossaudio/ossaudio.c	Tue Nov  3 08:24:33 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: ossaudio.c,v 1.59 2020/10/30 21:44:49 nia Exp $	*/
+/*	$NetBSD: ossaudio.c,v 1.60 2020/11/03 08:24:33 nia Exp $	*/
 
 /*-
  * Copyright (c) 1997, 2020 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: ossaudio.c,v 1.59 2020/10/30 21:44:49 nia Exp $");
+__RCSID("$NetBSD: ossaudio.c,v 1.60 2020/11/03 08:24:33 nia Exp $");
 
 /*
  * This is an Open Sound System compatibility layer, which provides
@@ -187,9 +187,9 @@ audio_ioctl(int fd, unsigned long com, v
 			INTARG = 192000;
 		tmpinfo.play.sample_rate =
 		tmpinfo.record.sample_rate = INTARG;
-		if (ioctl(fd, AUDIO_SETINFO, ) < 0) {
+		retval = ioctl(fd, AUDIO_SETINFO, );
+		if (retval < 0)
 			return retval;
-		}
 		/* FALLTHRU */
 	case SOUND_PCM_READ_RATE:
 		retval = ioctl(fd, AUDIO_GETBUFINFO, );



CVS commit: src/lib/libossaudio

2020-11-03 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Tue Nov  3 08:24:33 UTC 2020

Modified Files:
src/lib/libossaudio: ossaudio.c

Log Message:
ossaudio(3): return correctly initialized return value in unlikely
error case. pointed out by tnn.


To generate a diff of this commit:
cvs rdiff -u -r1.59 -r1.60 src/lib/libossaudio/ossaudio.c

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