CVS commit: src/sys/arch/atari/stand/bootxxx

2020-07-01 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Wed Jul  1 23:37:10 UTC 2020

Modified Files:
src/sys/arch/atari/stand/bootxxx: Makefile.bootxxx

Log Message:
Correct SRCS; bsdstart.S not bsdstart.s.

Fix build with bsd.dep.mk rev 1.87, which requires more strict
filename matching.

Found by martin.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/atari/stand/bootxxx/Makefile.bootxxx

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

Modified files:

Index: src/sys/arch/atari/stand/bootxxx/Makefile.bootxxx
diff -u src/sys/arch/atari/stand/bootxxx/Makefile.bootxxx:1.8 src/sys/arch/atari/stand/bootxxx/Makefile.bootxxx:1.9
--- src/sys/arch/atari/stand/bootxxx/Makefile.bootxxx:1.8	Sun Jan 12 15:26:28 2014
+++ src/sys/arch/atari/stand/bootxxx/Makefile.bootxxx	Wed Jul  1 23:37:10 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.bootxxx,v 1.8 2014/01/12 15:26:28 tsutsui Exp $
+#	$NetBSD: Makefile.bootxxx,v 1.9 2020/07/01 23:37:10 rin Exp $
 
 NOMAN=	# defined
 
@@ -39,7 +39,7 @@ LINKFLAGS=	-static -N -e start -Ttext ${
 #
 # Warning: start.S should be the first source!
 #
-SRCS=	start.S bootxxx.c aout.c bsdstart.s elf.c filesystem.c sysinfo.c
+SRCS=	start.S bootxxx.c aout.c bsdstart.S elf.c filesystem.c sysinfo.c
 
 LIBS=	${LIBSA} ${LIBKERN}
 



CVS commit: src/sys/arch/atari/stand/bootxxx

2020-07-01 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Wed Jul  1 23:37:10 UTC 2020

Modified Files:
src/sys/arch/atari/stand/bootxxx: Makefile.bootxxx

Log Message:
Correct SRCS; bsdstart.S not bsdstart.s.

Fix build with bsd.dep.mk rev 1.87, which requires more strict
filename matching.

Found by martin.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/atari/stand/bootxxx/Makefile.bootxxx

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-07-01 Thread Simon J. Gerraty
Module Name:src
Committed By:   sjg
Date:   Wed Jul  1 18:02:27 UTC 2020

Modified Files:
src/usr.bin/make: var.c
src/usr.bin/make/unit-tests: varmisc.exp varmisc.mk

Log Message:
Fix parsing of nested variables during .for loop

Recent change to cond.c to avoid eval of unnecessary
terms had side effect on constructs like:

.for s in 1 2
.if defined(MAN$s) && !empty(MAN$s)
MAN+= ${MAN$s}
.endif
.endfor

resulting in MAN being flagged as recursive.

When Var_Parse encounters a variable within a variable name
we want to force it to be expanded.
But given the way get_mpt_arg calls Var_Parse we need to check
whether we actually started parsing a variable yet.


To generate a diff of this commit:
cvs rdiff -u -r1.224 -r1.225 src/usr.bin/make/var.c
cvs rdiff -u -r1.7 -r1.8 src/usr.bin/make/unit-tests/varmisc.exp
cvs rdiff -u -r1.8 -r1.9 src/usr.bin/make/unit-tests/varmisc.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-07-01 Thread Simon J. Gerraty
Module Name:src
Committed By:   sjg
Date:   Wed Jul  1 18:02:27 UTC 2020

Modified Files:
src/usr.bin/make: var.c
src/usr.bin/make/unit-tests: varmisc.exp varmisc.mk

Log Message:
Fix parsing of nested variables during .for loop

Recent change to cond.c to avoid eval of unnecessary
terms had side effect on constructs like:

.for s in 1 2
.if defined(MAN$s) && !empty(MAN$s)
MAN+= ${MAN$s}
.endif
.endfor

resulting in MAN being flagged as recursive.

When Var_Parse encounters a variable within a variable name
we want to force it to be expanded.
But given the way get_mpt_arg calls Var_Parse we need to check
whether we actually started parsing a variable yet.


To generate a diff of this commit:
cvs rdiff -u -r1.224 -r1.225 src/usr.bin/make/var.c
cvs rdiff -u -r1.7 -r1.8 src/usr.bin/make/unit-tests/varmisc.exp
cvs rdiff -u -r1.8 -r1.9 src/usr.bin/make/unit-tests/varmisc.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/var.c
diff -u src/usr.bin/make/var.c:1.224 src/usr.bin/make/var.c:1.225
--- src/usr.bin/make/var.c:1.224	Fri Jun  5 19:20:46 2020
+++ src/usr.bin/make/var.c	Wed Jul  1 18:02:26 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: var.c,v 1.224 2020/06/05 19:20:46 sjg Exp $	*/
+/*	$NetBSD: var.c,v 1.225 2020/07/01 18:02:26 sjg Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: var.c,v 1.224 2020/06/05 19:20:46 sjg Exp $";
+static char rcsid[] = "$NetBSD: var.c,v 1.225 2020/07/01 18:02:26 sjg Exp $";
 #else
 #include 
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)var.c	8.3 (Berkeley) 3/19/94";
 #else
-__RCSID("$NetBSD: var.c,v 1.224 2020/06/05 19:20:46 sjg Exp $");
+__RCSID("$NetBSD: var.c,v 1.225 2020/07/01 18:02:26 sjg Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -3859,12 +3859,17 @@ Var_Parse(const char *str, GNode *ctxt, 
 		break;
 	}
 	/*
-	 * A variable inside a variable, expand
+	 * A variable inside a variable, expand.
+	 * If we really started looking at a variable
+	 * (str[0] == '$'), then force VARF_WANTRES
+	 * since we need the nested variable expanded to
+	 * get the correct name to lookup.
 	 */
 	if (*tstr == '$') {
 		int rlen;
 		void *freeIt;
-		char *rval = Var_Parse(tstr, ctxt, flags,  , );
+		char *rval = Var_Parse(tstr, ctxt,
+		flags|((*str == '$') ? VARF_WANTRES : 0),  , );
 		if (rval != NULL) {
 		Buf_AddBytes(, strlen(rval), rval);
 		}

Index: src/usr.bin/make/unit-tests/varmisc.exp
diff -u src/usr.bin/make/unit-tests/varmisc.exp:1.7 src/usr.bin/make/unit-tests/varmisc.exp:1.8
--- src/usr.bin/make/unit-tests/varmisc.exp:1.7	Tue Jan 31 18:56:35 2017
+++ src/usr.bin/make/unit-tests/varmisc.exp	Wed Jul  1 18:02:26 2020
@@ -22,4 +22,5 @@ date=20160401
 Version=123.456.789 == 123456789
 Literal=3.4.5 == 3004005
 We have target specific vars
+MAN= make.1
 exit status 0

Index: src/usr.bin/make/unit-tests/varmisc.mk
diff -u src/usr.bin/make/unit-tests/varmisc.mk:1.8 src/usr.bin/make/unit-tests/varmisc.mk:1.9
--- src/usr.bin/make/unit-tests/varmisc.mk:1.8	Tue Jan 31 18:56:35 2017
+++ src/usr.bin/make/unit-tests/varmisc.mk	Wed Jul  1 18:02:26 2020
@@ -1,9 +1,9 @@
-# $Id: varmisc.mk,v 1.8 2017/01/31 18:56:35 sjg Exp $
+# $Id: varmisc.mk,v 1.9 2020/07/01 18:02:26 sjg Exp $
 #
 # Miscellaneous variable tests.
 
 all: unmatched_var_paren D_true U_true D_false U_false Q_lhs Q_rhs NQ_none \
-	strftime cmpv
+	strftime cmpv manok
 
 unmatched_var_paren:
 	@echo ${foo::=foo-text}
@@ -60,3 +60,15 @@ cmpv:
 	@echo Version=${Version} == ${Version:${M_cmpv}}
 	@echo Literal=3.4.5 == ${3.4.5:L:${M_cmpv}}
 	@echo We have ${${.TARGET:T}.only}
+
+# catch misshandling of nested vars in .for loop
+MAN=
+MAN1= make.1
+.for s in 1 2
+.if defined(MAN$s) && !empty(MAN$s)
+MAN+= ${MAN$s}
+.endif
+.endfor
+
+manok:
+	@echo MAN=${MAN}



CVS commit: src/sys/dev/pci

2020-07-01 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Wed Jul  1 17:57:14 UTC 2020

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

Log Message:
revert, not working


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.45 src/sys/dev/pci/cmdide.c

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



CVS commit: src/sys/dev/pci

2020-07-01 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Wed Jul  1 17:57:14 UTC 2020

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

Log Message:
revert, not working


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.45 src/sys/dev/pci/cmdide.c

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

Modified files:

Index: src/sys/dev/pci/cmdide.c
diff -u src/sys/dev/pci/cmdide.c:1.44 src/sys/dev/pci/cmdide.c:1.45
--- src/sys/dev/pci/cmdide.c:1.44	Wed Jul  1 15:10:01 2020
+++ src/sys/dev/pci/cmdide.c	Wed Jul  1 17:57:14 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: cmdide.c,v 1.44 2020/07/01 15:10:01 jdolecek Exp $	*/
+/*	$NetBSD: cmdide.c,v 1.45 2020/07/01 17:57:14 jdolecek Exp $	*/
 
 /*
  * Copyright (c) 1999, 2000, 2001 Manuel Bouyer.
@@ -25,7 +25,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cmdide.c,v 1.44 2020/07/01 15:10:01 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cmdide.c,v 1.45 2020/07/01 17:57:14 jdolecek Exp $");
 
 #include 
 #include 
@@ -238,15 +238,9 @@ cmd_pci_intr(void *arg)
 	for (i = 0; i < sc->sc_wdcdev.sc_atac.atac_nchannels; i++) {
 		cp = >pciide_channels[i];
 		wdc_cp = >ata_channel;
-
 		/* If a compat channel skip. */
 		if (cp->compat)
 			continue;
-
-		/* if this channel not waiting for intr, skip */
-		if ((wdc_cp->ch_flags & ATACH_IRQ_WAIT) == 0)
-			continue;
-
 		if ((i == 0 && (priirq & CMD_CONF_DRV0_INTR)) ||
 		(i == 1 && (secirq & CMD_ARTTIM23_IRQ))) {
 			crv = wdcintr(wdc_cp);



CVS commit: src/sys/dev/pci

2020-07-01 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Wed Jul  1 15:10:01 UTC 2020

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

Log Message:
ignore interrupt when not expecting one, particularly don't invoke
the irqack in this case

seems cmdide doesn't honour WDCTL_IDS when executing polled commands,
and there is a race where the irqack call interferes with polled
command and causes a lockup

reported by Martin Husemann


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 src/sys/dev/pci/cmdide.c

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

Modified files:

Index: src/sys/dev/pci/cmdide.c
diff -u src/sys/dev/pci/cmdide.c:1.43 src/sys/dev/pci/cmdide.c:1.44
--- src/sys/dev/pci/cmdide.c:1.43	Sun Oct 22 13:13:55 2017
+++ src/sys/dev/pci/cmdide.c	Wed Jul  1 15:10:01 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: cmdide.c,v 1.43 2017/10/22 13:13:55 jdolecek Exp $	*/
+/*	$NetBSD: cmdide.c,v 1.44 2020/07/01 15:10:01 jdolecek Exp $	*/
 
 /*
  * Copyright (c) 1999, 2000, 2001 Manuel Bouyer.
@@ -25,7 +25,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cmdide.c,v 1.43 2017/10/22 13:13:55 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cmdide.c,v 1.44 2020/07/01 15:10:01 jdolecek Exp $");
 
 #include 
 #include 
@@ -238,9 +238,15 @@ cmd_pci_intr(void *arg)
 	for (i = 0; i < sc->sc_wdcdev.sc_atac.atac_nchannels; i++) {
 		cp = >pciide_channels[i];
 		wdc_cp = >ata_channel;
+
 		/* If a compat channel skip. */
 		if (cp->compat)
 			continue;
+
+		/* if this channel not waiting for intr, skip */
+		if ((wdc_cp->ch_flags & ATACH_IRQ_WAIT) == 0)
+			continue;
+
 		if ((i == 0 && (priirq & CMD_CONF_DRV0_INTR)) ||
 		(i == 1 && (secirq & CMD_ARTTIM23_IRQ))) {
 			crv = wdcintr(wdc_cp);



CVS commit: src/sys/dev/pci

2020-07-01 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Wed Jul  1 15:10:01 UTC 2020

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

Log Message:
ignore interrupt when not expecting one, particularly don't invoke
the irqack in this case

seems cmdide doesn't honour WDCTL_IDS when executing polled commands,
and there is a race where the irqack call interferes with polled
command and causes a lockup

reported by Martin Husemann


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 src/sys/dev/pci/cmdide.c

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



CVS commit: src

2020-07-01 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Wed Jul  1 13:49:26 UTC 2020

Modified Files:
src/distrib/sets/lists/tests: mi
src/tests/kernel: Makefile
Added Files:
src/tests/kernel: t_magic_symlinks.sh

Log Message:
Add basic checks for magic symlink(7)'s. These include a case for PR lib/55361,
although it seems that realpath(3) has bigger problems with these symlinks.


To generate a diff of this commit:
cvs rdiff -u -r1.869 -r1.870 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.67 -r1.68 src/tests/kernel/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/kernel/t_magic_symlinks.sh

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



CVS commit: src

2020-07-01 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Wed Jul  1 13:49:26 UTC 2020

Modified Files:
src/distrib/sets/lists/tests: mi
src/tests/kernel: Makefile
Added Files:
src/tests/kernel: t_magic_symlinks.sh

Log Message:
Add basic checks for magic symlink(7)'s. These include a case for PR lib/55361,
although it seems that realpath(3) has bigger problems with these symlinks.


To generate a diff of this commit:
cvs rdiff -u -r1.869 -r1.870 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.67 -r1.68 src/tests/kernel/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/kernel/t_magic_symlinks.sh

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.869 src/distrib/sets/lists/tests/mi:1.870
--- src/distrib/sets/lists/tests/mi:1.869	Wed Jul  1 07:16:38 2020
+++ src/distrib/sets/lists/tests/mi	Wed Jul  1 13:49:26 2020
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.869 2020/07/01 07:16:38 jruoho Exp $
+# $NetBSD: mi,v 1.870 2020/07/01 13:49:26 jruoho Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -2202,6 +2202,7 @@
 ./usr/tests/kernel/t_lockf			tests-kernel-tests	compattestfile,atf
 ./usr/tests/kernel/t_lwpctl			tests-obsolete		obsolete
 ./usr/tests/kernel/t_mkdir			tests-obsolete		obsolete
+./usr/tests/kernel/t_magic_symlinks		tests-kernel-tests	compattestfile,atf
 ./usr/tests/kernel/t_mqueue			tests-kernel-tests	compattestfile,atf
 ./usr/tests/kernel/t_nointerpreter		tests-kernel-tests	atf
 ./usr/tests/kernel/t_origin			tests-kernel-tests	compattestfile,atf

Index: src/tests/kernel/Makefile
diff -u src/tests/kernel/Makefile:1.67 src/tests/kernel/Makefile:1.68
--- src/tests/kernel/Makefile:1.67	Thu Jun 25 16:16:48 2020
+++ src/tests/kernel/Makefile	Wed Jul  1 13:49:26 2020
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.67 2020/06/25 16:16:48 jruoho Exp $
+# $NetBSD: Makefile,v 1.68 2020/07/01 13:49:26 jruoho Exp $
 
 NOMAN=		# defined
 
@@ -26,6 +26,7 @@ TESTS_SH+=	t_umountstress
 TESTS_SH+=	t_ps_strings
 TESTS_SH+=	t_trapsignal
 TESTS_SH+=	t_interp
+TESTS_SH+=	t_magic_symlinks
 TESTS_SH+=	t_nointerpreter
 TESTS_SH+=	t_origin
 TESTS_SH+=	t_procpath

Added files:

Index: src/tests/kernel/t_magic_symlinks.sh
diff -u /dev/null src/tests/kernel/t_magic_symlinks.sh:1.1
--- /dev/null	Wed Jul  1 13:49:27 2020
+++ src/tests/kernel/t_magic_symlinks.sh	Wed Jul  1 13:49:26 2020
@@ -0,0 +1,254 @@
+# $NetBSD: t_magic_symlinks.sh,v 1.1 2020/07/01 13:49:26 jruoho Exp $
+#
+# Copyright (c) 2020 The NetBSD Foundation, Inc.
+# All rights reserved.
+#
+# This code is derived from software contributed to The NetBSD Foundation
+# by Jukka Ruohonen.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#notice, this list of conditions and the following disclaimer in the
+#documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+tmpdir="/tmp/test-magic-symlink"
+
+init() {
+
+	enabled=$(sysctl vfs.generic.magiclinks | awk '{print $3}')
+
+	if [ $enabled -eq 0 ]; then
+		sysctl -w vfs.generic.magiclinks=1 >/dev/null 2>&1
+		echo "Initialized vfs.generic.magiclinks=1"
+	fi
+
+	mkdir "$tmpdir"
+	echo "$enabled" > "$tmpdir/enabled"
+}
+
+clean() {
+
+	enabled=$(cat "$tmpdir/enabled")
+
+	if [ $enabled -eq 0 ]; then
+		sysctl -w vfs.generic.magiclinks=$enabled >/dev/null 2>&1
+		echo "Restored vfs.generic.magiclinks=$enabled"
+	fi
+
+	rm -rf $tmpdir
+}
+
+check() {
+
+	init
+	cd "$tmpdir"
+	mkdir "$1"
+	echo 1 > "$1/magic"
+	ln -s "$2" "link"
+	cd "link"
+
+	if [ -z $(pwd | grep "$1") ]; then
+		atf_fail "kernel does not handle magic symlinks properly"
+	fi
+
+	if [ ! $(cat "magic") -eq 1 ]; then
+		atf_fail "kernel does not handle magic symlinks properly"
+	fi
+}
+
+# @domainname
+#
+atf_test_case domainname cleanup

CVS commit: src/usr.sbin/hdaudioctl

2020-07-01 Thread Stephen Borrill
Module Name:src
Committed By:   sborrill
Date:   Wed Jul  1 12:19:45 UTC 2020

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

Log Message:
When using show subcommand, display node ID (nid) in hexadecimal to match
the HD audio documentation. Diverge slightly by using 0xXX instead of XXh
format for consistency with the list subcommand.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/usr.sbin/hdaudioctl/hdaudioctl.c

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

Modified files:

Index: src/usr.sbin/hdaudioctl/hdaudioctl.c
diff -u src/usr.sbin/hdaudioctl/hdaudioctl.c:1.4 src/usr.sbin/hdaudioctl/hdaudioctl.c:1.5
--- src/usr.sbin/hdaudioctl/hdaudioctl.c:1.4	Mon Jun 15 20:29:29 2020
+++ src/usr.sbin/hdaudioctl/hdaudioctl.c	Wed Jul  1 12:19:45 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: hdaudioctl.c,v 1.4 2020/06/15 20:29:29 riastradh Exp $ */
+/* $NetBSD: hdaudioctl.c,v 1.5 2020/07/01 12:19:45 sborrill Exp $ */
 
 /*
  * Copyright (c) 2009 Precedence Technologies Ltd 
@@ -292,9 +292,9 @@ hdaudioctl_show(int fd, int argc, char *
 	array = prop_dictionary_get(response, "pin-config");
 	iter = prop_array_iterator(array);
 	prop_object_iterator_reset(iter);
-	printf("nid Data As Seq Device Conn  Jack"
+	printf("nid  Data As Seq Device Conn  Jack"
 	"Location   Color   Misc\n");
-	printf("="
+	printf("=="
 	"===\n");
 	while ((obj = prop_object_iterator_next(iter)) != NULL) {
 		dict = (prop_dictionary_t)obj;
@@ -305,7 +305,7 @@ hdaudioctl_show(int fd, int argc, char *
 		jack = pin_jacks[(config >> 16) & 0xf];
 		loc = pin_locations[(config >> 24) & 0x3f];
 		color = pin_colors[(config >> 12) & 0xf];
-		printf("%3d %08X %2d %3d %-14s %-5s %-7s %-10s %-7s %4X\n",
+		printf("0x%2X %08X %2d %3d %-14s %-5s %-7s %-10s %-7s %4X\n",
 		nid, config, ((config >> 4U) & 0xf), (config & 0xf),
 		device, conn, jack, loc, color, ((config >> 8U) & 0xf));
 	}



CVS commit: src/usr.sbin/hdaudioctl

2020-07-01 Thread Stephen Borrill
Module Name:src
Committed By:   sborrill
Date:   Wed Jul  1 12:19:45 UTC 2020

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

Log Message:
When using show subcommand, display node ID (nid) in hexadecimal to match
the HD audio documentation. Diverge slightly by using 0xXX instead of XXh
format for consistency with the list subcommand.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/usr.sbin/hdaudioctl/hdaudioctl.c

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



CVS commit: src/tests/sys/crypto/aes

2020-07-01 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Jul  1 09:58:29 UTC 2020

Modified Files:
src/tests/sys/crypto/aes: Makefile

Log Message:
Pass the requisite -msse options for i386.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/sys/crypto/aes/Makefile

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

Modified files:

Index: src/tests/sys/crypto/aes/Makefile
diff -u src/tests/sys/crypto/aes/Makefile:1.1 src/tests/sys/crypto/aes/Makefile:1.2
--- src/tests/sys/crypto/aes/Makefile:1.1	Tue Jun 30 20:32:11 2020
+++ src/tests/sys/crypto/aes/Makefile	Wed Jul  1 09:58:29 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.1 2020/06/30 20:32:11 riastradh Exp $
+#	$NetBSD: Makefile,v 1.2 2020/07/01 09:58:29 riastradh Exp $
 
 .include 
 
@@ -51,11 +51,16 @@ SRCS.t_aes+=	aes_sse2_dec.c
 SRCS.t_aes+=	aes_sse2_enc.c
 SRCS.t_aes+=	aes_sse2_impl.c
 SRCS.t_aes+=	aes_sse2_subr.c
+COPTS.aes_sse2.c+=	-msse -msse2
+COPTS.aes_sse2_dec.c+=	-msse -msse2
+COPTS.aes_sse2_enc.c+=	-msse -msse2
+COPTS.aes_sse2_subr.c+=	-msse -msse2
 
 SRCS.t_aes+=	aes_ssse3.c
 SRCS.t_aes+=	aes_ssse3_impl.c
 SRCS.t_aes+=	aes_ssse3_subr.c
-COPTS.aes_ssse3.c+=	-msse3 -mssse3
+COPTS.aes_ssse3.c+=		-msse -msse2 -msse3 -mssse3
+COPTS.aes_ssse3_subr.c+=	-msse -msse2 -msse3 -mssse3
 
 SRCS.t_aes+=	aes_via.c
 



CVS commit: src/tests/sys/crypto/aes

2020-07-01 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Jul  1 09:58:29 UTC 2020

Modified Files:
src/tests/sys/crypto/aes: Makefile

Log Message:
Pass the requisite -msse options for i386.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/sys/crypto/aes/Makefile

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



CVS commit: src/external/gpl3/gcc.old/usr.bin/cc1plus

2020-07-01 Thread Luke Mewburn
Module Name:src
Committed By:   lukem
Date:   Wed Jul  1 08:25:44 UTC 2020

Modified Files:
src/external/gpl3/gcc.old/usr.bin/cc1plus: Makefile

Log Message:
Fix addition of C++ .cc source to SRCS

Fix assumption that all of the source files are .c, as some are .cc.

Not tested, based on similar change to
  external/gpl3/gcc/usr.bin/cc1plus/Makefile


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/external/gpl3/gcc.old/usr.bin/cc1plus/Makefile

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

Modified files:

Index: src/external/gpl3/gcc.old/usr.bin/cc1plus/Makefile
diff -u src/external/gpl3/gcc.old/usr.bin/cc1plus/Makefile:1.8 src/external/gpl3/gcc.old/usr.bin/cc1plus/Makefile:1.9
--- src/external/gpl3/gcc.old/usr.bin/cc1plus/Makefile:1.8	Thu Sep 26 08:03:59 2019
+++ src/external/gpl3/gcc.old/usr.bin/cc1plus/Makefile	Wed Jul  1 08:25:44 2020
@@ -1,7 +1,8 @@
-#	$NetBSD: Makefile,v 1.8 2019/09/26 08:03:59 mrg Exp $
+#	$NetBSD: Makefile,v 1.9 2020/07/01 08:25:44 lukem Exp $
 
 PROG=		cc1plus
-SRCS=		${G_CXX_OBJS:S,c-family/,,:S,cp/,,:Nlibcpp.a:.o=.c} main.c ${PROG}-checksum.c
+SRCS=		${G_CXX_OBJS:S,c-family/,,:S,cp/,,:S,constraint.o,constraint.cc,:S,logic.o,logic.cc,:Nlibcpp.a:.o=.c}
+SRCS+=		main.c ${PROG}-checksum.c
 
 # XXX
 NOMAN=	1



CVS commit: src/external/gpl3/gcc.old/usr.bin/cc1plus

2020-07-01 Thread Luke Mewburn
Module Name:src
Committed By:   lukem
Date:   Wed Jul  1 08:25:44 UTC 2020

Modified Files:
src/external/gpl3/gcc.old/usr.bin/cc1plus: Makefile

Log Message:
Fix addition of C++ .cc source to SRCS

Fix assumption that all of the source files are .c, as some are .cc.

Not tested, based on similar change to
  external/gpl3/gcc/usr.bin/cc1plus/Makefile


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/external/gpl3/gcc.old/usr.bin/cc1plus/Makefile

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



CVS commit: src/usr.sbin/cpuctl/arch

2020-07-01 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Wed Jul  1 08:03:10 UTC 2020

Modified Files:
src/usr.sbin/cpuctl/arch: aarch64.c

Log Message:
show clidr_el1 and ctr_el0.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/usr.sbin/cpuctl/arch/aarch64.c

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

Modified files:

Index: src/usr.sbin/cpuctl/arch/aarch64.c
diff -u src/usr.sbin/cpuctl/arch/aarch64.c:1.9 src/usr.sbin/cpuctl/arch/aarch64.c:1.10
--- src/usr.sbin/cpuctl/arch/aarch64.c:1.9	Sun May 10 21:42:05 2020
+++ src/usr.sbin/cpuctl/arch/aarch64.c	Wed Jul  1 08:03:10 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: aarch64.c,v 1.9 2020/05/10 21:42:05 riastradh Exp $	*/
+/*	$NetBSD: aarch64.c,v 1.10 2020/07/01 08:03:10 ryo Exp $	*/
 
 /*
  * Copyright (c) 2018 Ryo Shimizu 
@@ -29,7 +29,7 @@
 #include 
 
 #ifndef lint
-__RCSID("$NetBSD: aarch64.c,v 1.9 2020/05/10 21:42:05 riastradh Exp $");
+__RCSID("$NetBSD: aarch64.c,v 1.10 2020/07/01 08:03:10 ryo Exp $");
 #endif /* no lint */
 
 #include 
@@ -60,8 +60,11 @@ struct impltab {
 };
 
 struct fieldinfo {
-	int bitpos;
-	int bitwidth;
+	unsigned int flags;
+#define FIELDINFO_FLAGS_DEC	0x0001
+#define FIELDINFO_FLAGS_4LOG2	0x0002
+	unsigned char bitpos;
+	unsigned char bitwidth;
 	const char *name;
 	const char * const *info;
 };
@@ -549,13 +552,108 @@ struct fieldinfo mvfr2_fieldinfo[] = {
 	{ .bitwidth = 0 }	/* end of table */
 };
 
+/* CLIDR_EL1 - Cache Level ID Register */
+const char * const clidr_cachetype[8] = { /* 8=3bit */
+	[0] = "None",
+	[1] = "Instruction cache",
+	[2] = "Data cache",
+	[3] = "Instruction and Data cache",
+	[4] = "Unified cache"
+};
+
+struct fieldinfo clidr_fieldinfo[] = {
+	{
+		.bitpos = 0, .bitwidth = 3, .name = "L1",
+		.info = clidr_cachetype
+	},
+	{
+		.bitpos = 3, .bitwidth = 3, .name = "L2",
+		.info = clidr_cachetype
+	},
+	{
+		.bitpos = 6, .bitwidth = 3, .name = "L3",
+		.info = clidr_cachetype
+	},
+	{
+		.bitpos = 9, .bitwidth = 3, .name = "L4",
+		.info = clidr_cachetype
+	},
+	{
+		.bitpos = 12, .bitwidth = 3, .name = "L5",
+		.info = clidr_cachetype
+	},
+	{
+		.bitpos = 15, .bitwidth = 3, .name = "L6",
+		.info = clidr_cachetype
+	},
+	{
+		.bitpos = 18, .bitwidth = 3, .name = "L7",
+		.info = clidr_cachetype
+	},
+	{
+		.bitpos = 21, .bitwidth = 3, .name = "LoUU",
+		.flags = FIELDINFO_FLAGS_DEC
+	},
+	{
+		.bitpos = 24, .bitwidth = 3, .name = "LoC",
+		.flags = FIELDINFO_FLAGS_DEC
+	},
+	{
+		.bitpos = 27, .bitwidth = 3, .name = "LoUIS",
+		.flags = FIELDINFO_FLAGS_DEC
+	},
+	{
+		.bitpos = 30, .bitwidth = 3, .name = "ICB",
+		.flags = FIELDINFO_FLAGS_DEC
+	},
+	{ .bitwidth = 0 }	/* end of table */
+};
+
+struct fieldinfo ctr_fieldinfo[] = {
+	{
+		.bitpos = 0, .bitwidth = 4, .name = "IminLine",
+		.flags = FIELDINFO_FLAGS_DEC | FIELDINFO_FLAGS_4LOG2
+	},
+	{
+		.bitpos = 16, .bitwidth = 4, .name = "DminLine",
+		.flags = FIELDINFO_FLAGS_DEC | FIELDINFO_FLAGS_4LOG2
+	},
+	{
+		.bitpos = 14, .bitwidth = 2, .name = "L1 Icache policy",
+		.info = (const char *[4]) { /* 4=2bit */
+			[0] = "VMID aware PIPT (VPIPT)",
+			[1] = "ASID-tagged VIVT (AIVIVT)",
+			[2] = "VIPT",
+			[3] = "PIPT"
+		},
+	},
+	{
+		.bitpos = 20, .bitwidth = 4, .name = "ERG",
+		.flags = FIELDINFO_FLAGS_DEC | FIELDINFO_FLAGS_4LOG2
+	},
+	{
+		.bitpos = 24, .bitwidth = 4, .name = "CWG",
+		.flags = FIELDINFO_FLAGS_DEC | FIELDINFO_FLAGS_4LOG2
+	},
+	{
+		.bitpos = 28, .bitwidth = 1, .name = "DIC",
+		.flags = FIELDINFO_FLAGS_DEC
+	},
+	{
+		.bitpos = 29, .bitwidth = 1, .name = "IDC",
+		.flags = FIELDINFO_FLAGS_DEC
+	},
+	{ .bitwidth = 0 }	/* end of table */
+};
+
+
 static void
 print_fieldinfo(const char *cpuname, const char *setname,
 struct fieldinfo *fieldinfo, uint64_t data)
 {
 	uint64_t v;
 	const char *info;
-	int i;
+	int i, flags;
 
 #define WIDTHMASK(w)	(0xULL >> (64 - (w)))
 
@@ -563,13 +661,24 @@ print_fieldinfo(const char *cpuname, con
 		v = (data >> fieldinfo[i].bitpos) &
 		WIDTHMASK(fieldinfo[i].bitwidth);
 
-		info = fieldinfo[i].info[v];
-		if (info == NULL)
-			printf("%s: %s: %s: 0x%"PRIx64"\n",
-			cpuname, setname, fieldinfo[i].name, v);
-		else
-			printf("%s: %s: %s: %s\n",
-			cpuname, setname, fieldinfo[i].name, info);
+		flags = fieldinfo[i].flags;
+		info = NULL;
+		if (fieldinfo[i].info != NULL)
+			info = fieldinfo[i].info[v];
+
+		printf("%s: %s: %s: ",
+		cpuname, setname, fieldinfo[i].name);
+
+		if (info == NULL) {
+			if (flags & FIELDINFO_FLAGS_4LOG2)
+v = 4 * (1 << v);
+			if (flags & FIELDINFO_FLAGS_DEC)
+printf("%"PRIu64"\n", v);
+			else
+printf("0x%"PRIx64"\n", v);
+		} else {
+			printf("%s\n", info);
+		}
 	}
 }
 
@@ -671,6 +780,7 @@ identifycpu(int fd, const char *cpuname)
 
 	snprintf(path, sizeof path, "machdep.%s.cpu_id", cpuname);
 	len = sizeof(sysctlbuf);
+	memset(sysctlbuf, 0, len);
 	if (sysctlbyname(path, id, , 0, 0) == -1)
 		err(1, "couldn't get %s", path);

CVS commit: src/usr.sbin/cpuctl/arch

2020-07-01 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Wed Jul  1 08:03:10 UTC 2020

Modified Files:
src/usr.sbin/cpuctl/arch: aarch64.c

Log Message:
show clidr_el1 and ctr_el0.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/usr.sbin/cpuctl/arch/aarch64.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

2020-07-01 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Wed Jul  1 08:02:13 UTC 2020

Modified Files:
src/sys/arch/aarch64/aarch64: trap.c
src/sys/arch/arm/include: cputypes.h

Log Message:
add workaround for Neoverse N1 erratum 1542419


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/sys/arch/aarch64/aarch64/trap.c
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/arm/include/cputypes.h

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

Modified files:

Index: src/sys/arch/aarch64/aarch64/trap.c
diff -u src/sys/arch/aarch64/aarch64/trap.c:1.28 src/sys/arch/aarch64/aarch64/trap.c:1.29
--- src/sys/arch/aarch64/aarch64/trap.c:1.28	Wed Jul  1 08:01:07 2020
+++ src/sys/arch/aarch64/aarch64/trap.c	Wed Jul  1 08:02:13 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: trap.c,v 1.28 2020/07/01 08:01:07 ryo Exp $ */
+/* $NetBSD: trap.c,v 1.29 2020/07/01 08:02:13 ryo Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include 
 
-__KERNEL_RCSID(1, "$NetBSD: trap.c,v 1.28 2020/07/01 08:01:07 ryo Exp $");
+__KERNEL_RCSID(1, "$NetBSD: trap.c,v 1.29 2020/07/01 08:02:13 ryo Exp $");
 
 #include "opt_arm_intr_impl.h"
 #include "opt_compat_netbsd32.h"
@@ -338,6 +338,11 @@ configure_cpu_traps(void)
 		if (__SHIFTOUT(ctr_el0_cpu, CTR_EL0_DIC) == 1)
 			ctr_el0_cpu |= CTR_EL0_IMIN_LINE;
 
+		/* Neoverse N1 erratum 1542419 */
+		if (CPU_ID_NEOVERSEN1_P(ci->ci_id.ac_midr) &&
+		__SHIFTOUT(ctr_el0_cpu, CTR_EL0_DIC) == 1)
+			ctr_el0_cpu &= ~CTR_EL0_DIC;
+
 		if (cii == 0) {
 			ctr_el0_usr = ctr_el0_cpu;
 			continue;

Index: src/sys/arch/arm/include/cputypes.h
diff -u src/sys/arch/arm/include/cputypes.h:1.12 src/sys/arch/arm/include/cputypes.h:1.13
--- src/sys/arch/arm/include/cputypes.h:1.12	Mon Jan 27 12:56:44 2020
+++ src/sys/arch/arm/include/cputypes.h	Wed Jul  1 08:02:13 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: cputypes.h,v 1.12 2020/01/27 12:56:44 skrll Exp $	*/
+/*	$NetBSD: cputypes.h,v 1.13 2020/07/01 08:02:13 ryo Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Ben Harris
@@ -198,6 +198,8 @@
 #define CPU_ID_CORTEX_A76AE_P(n) ((n & 0xff0ff0f0) == 0x410fd0e0)
 #define CPU_ID_CORTEX_A77_P(n)	((n & 0xff0ff0f0) == 0x410fd0f0)
 
+#define CPU_ID_NEOVERSEN1_P(n)	((n & 0xff00) == 0x410fd0c0)
+
 #define CPU_ID_THUNDERXRX	0x43000a10
 #define CPU_ID_THUNDERXP1d0	0x43000a10
 #define CPU_ID_THUNDERXP1d1	0x43000a11



CVS commit: src/sys/arch

2020-07-01 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Wed Jul  1 08:02:13 UTC 2020

Modified Files:
src/sys/arch/aarch64/aarch64: trap.c
src/sys/arch/arm/include: cputypes.h

Log Message:
add workaround for Neoverse N1 erratum 1542419


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/sys/arch/aarch64/aarch64/trap.c
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/arm/include/cputypes.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/aarch64

2020-07-01 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Wed Jul  1 08:01:07 UTC 2020

Modified Files:
src/sys/arch/aarch64/aarch64: aarch64_machdep.c cpu.c trap.c
src/sys/arch/aarch64/include: armreg.h cpu.h machdep.h

Log Message:
- On some systems with a different cache line size (and DIC,IDC) per CPU, trap 
"mrs Xt,ctr_el0" instruction
  to return the minimum cache line size of the system to userland.
- add CLIDR_EL1 and CTR_EL0 to struct aarch64_sysctl_cpu_id.

On most systems, cache line size is the same for all CPUs, so this mechanism 
won't be required.
Rather, this is primarily for errata support, which will be committed later.


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 src/sys/arch/aarch64/aarch64/aarch64_machdep.c
cvs rdiff -u -r1.51 -r1.52 src/sys/arch/aarch64/aarch64/cpu.c
cvs rdiff -u -r1.27 -r1.28 src/sys/arch/aarch64/aarch64/trap.c
cvs rdiff -u -r1.49 -r1.50 src/sys/arch/aarch64/include/armreg.h
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/aarch64/include/cpu.h
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/aarch64/include/machdep.h

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

Modified files:

Index: src/sys/arch/aarch64/aarch64/aarch64_machdep.c
diff -u src/sys/arch/aarch64/aarch64/aarch64_machdep.c:1.43 src/sys/arch/aarch64/aarch64/aarch64_machdep.c:1.44
--- src/sys/arch/aarch64/aarch64/aarch64_machdep.c:1.43	Sun Jun 21 17:25:03 2020
+++ src/sys/arch/aarch64/aarch64/aarch64_machdep.c	Wed Jul  1 08:01:07 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: aarch64_machdep.c,v 1.43 2020/06/21 17:25:03 jmcneill Exp $ */
+/* $NetBSD: aarch64_machdep.c,v 1.44 2020/07/01 08:01:07 ryo Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(1, "$NetBSD: aarch64_machdep.c,v 1.43 2020/06/21 17:25:03 jmcneill Exp $");
+__KERNEL_RCSID(1, "$NetBSD: aarch64_machdep.c,v 1.44 2020/07/01 08:01:07 ryo Exp $");
 
 #include "opt_arm_debug.h"
 #include "opt_cpuoptions.h"
@@ -523,6 +523,8 @@ machdep_init(void)
 {
 	/* clear cpu reset hook for early boot */
 	cpu_reset_address0 = NULL;
+
+	configure_cpu_traps();
 }
 
 #ifdef MODULAR

Index: src/sys/arch/aarch64/aarch64/cpu.c
diff -u src/sys/arch/aarch64/aarch64/cpu.c:1.51 src/sys/arch/aarch64/aarch64/cpu.c:1.52
--- src/sys/arch/aarch64/aarch64/cpu.c:1.51	Wed Jul  1 07:59:16 2020
+++ src/sys/arch/aarch64/aarch64/cpu.c	Wed Jul  1 08:01:07 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu.c,v 1.51 2020/07/01 07:59:16 ryo Exp $ */
+/* $NetBSD: cpu.c,v 1.52 2020/07/01 08:01:07 ryo Exp $ */
 
 /*
  * Copyright (c) 2017 Ryo Shimizu 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(1, "$NetBSD: cpu.c,v 1.51 2020/07/01 07:59:16 ryo Exp $");
+__KERNEL_RCSID(1, "$NetBSD: cpu.c,v 1.52 2020/07/01 08:01:07 ryo Exp $");
 
 #include "locators.h"
 #include "opt_arm_debug.h"
@@ -503,6 +503,9 @@ cpu_setup_id(struct cpu_info *ci)
 	id->ac_mvfr1 = reg_mvfr1_el1_read();
 	id->ac_mvfr2 = reg_mvfr2_el1_read();
 
+	id->ac_clidr = reg_clidr_el1_read();
+	id->ac_ctr   = reg_ctr_el0_read();
+
 	/* Only in ARMv8.2. */
 	id->ac_aa64zfr0  = 0 /* reg_id_aa64zfr0_el1_read() */;
 

Index: src/sys/arch/aarch64/aarch64/trap.c
diff -u src/sys/arch/aarch64/aarch64/trap.c:1.27 src/sys/arch/aarch64/aarch64/trap.c:1.28
--- src/sys/arch/aarch64/aarch64/trap.c:1.27	Mon Apr 13 05:40:25 2020
+++ src/sys/arch/aarch64/aarch64/trap.c	Wed Jul  1 08:01:07 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: trap.c,v 1.27 2020/04/13 05:40:25 maxv Exp $ */
+/* $NetBSD: trap.c,v 1.28 2020/07/01 08:01:07 ryo Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include 
 
-__KERNEL_RCSID(1, "$NetBSD: trap.c,v 1.27 2020/04/13 05:40:25 maxv Exp $");
+__KERNEL_RCSID(1, "$NetBSD: trap.c,v 1.28 2020/07/01 08:01:07 ryo Exp $");
 
 #include "opt_arm_intr_impl.h"
 #include "opt_compat_netbsd32.h"
@@ -42,6 +42,7 @@ __KERNEL_RCSID(1, "$NetBSD: trap.c,v 1.2
 #include 
 #include 
 #include 
+#include 
 #ifdef KDB
 #include 
 #endif
@@ -50,6 +51,7 @@ __KERNEL_RCSID(1, "$NetBSD: trap.c,v 1.2
 #include 
 #include 
 #include 
+#include 
 
 #ifdef ARM_INTR_IMPL
 #include ARM_INTR_IMPL
@@ -88,6 +90,12 @@ dtrace_trap_func_t		dtrace_trap_func = N
 int (*dtrace_invop_jump_addr)(struct trapframe *);
 #endif
 
+enum emul_arm_result {
+	EMUL_ARM_SUCCESS = 0,
+	EMUL_ARM_UNKNOWN,
+	EMUL_ARM_FAULT,
+};
+
 const char * const trap_names[] = {
 	[ESR_EC_UNKNOWN]	= "Unknown Reason (Illegal Instruction)",
 	[ESR_EC_SERROR]		= "SError Interrupt",
@@ -247,6 +255,142 @@ trap_el1h_sync(struct trapframe *tf)
 	}
 }
 
+/*
+ * There are some systems with different cache line sizes for each cpu.
+ * Userland programs can be preempted between CPUs at any time, so in such
+ * a system, the minimum cache line size must be visible to userland.
+ */
+#define CTR_EL0_USR_MASK	\
+	(CTR_EL0_DIC | CTR_EL0_IDC | CTR_EL0_DMIN_LINE | CTR_EL0_IMIN_LINE)
+uint64_t ctr_el0_usr __read_mostly;
+
+static xcfunc_t

CVS commit: src/sys/arch/aarch64

2020-07-01 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Wed Jul  1 08:01:07 UTC 2020

Modified Files:
src/sys/arch/aarch64/aarch64: aarch64_machdep.c cpu.c trap.c
src/sys/arch/aarch64/include: armreg.h cpu.h machdep.h

Log Message:
- On some systems with a different cache line size (and DIC,IDC) per CPU, trap 
"mrs Xt,ctr_el0" instruction
  to return the minimum cache line size of the system to userland.
- add CLIDR_EL1 and CTR_EL0 to struct aarch64_sysctl_cpu_id.

On most systems, cache line size is the same for all CPUs, so this mechanism 
won't be required.
Rather, this is primarily for errata support, which will be committed later.


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 src/sys/arch/aarch64/aarch64/aarch64_machdep.c
cvs rdiff -u -r1.51 -r1.52 src/sys/arch/aarch64/aarch64/cpu.c
cvs rdiff -u -r1.27 -r1.28 src/sys/arch/aarch64/aarch64/trap.c
cvs rdiff -u -r1.49 -r1.50 src/sys/arch/aarch64/include/armreg.h
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/aarch64/include/cpu.h
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/aarch64/include/machdep.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/aarch64

2020-07-01 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Wed Jul  1 07:59:16 UTC 2020

Modified Files:
src/sys/arch/aarch64/aarch64: cpu.c cpufunc.c cpufunc_asm_armv8.S
src/sys/arch/aarch64/include: cpu.h cpufunc.h

Log Message:
Switch the Icache sync operation to the necessary and sufficient one according 
to the CTR_EL0.DIC and CTR_EL0.IDC flags.

If CTR_EL0.DIC=1, Icache invalidation is not required.
If CTR_EL0.IDC=1, Dcache clean before Icache invalidation is not required.
CLIDR_EL1.LoC is 0, or CLIDR_EL1.LoUIS and CLIDR_EL1.LoUU are 0, Dcache clean 
is not required as well.

SEE ALSO ARMARM, "CTR_EL0 Cache Type Register", and "CLIDR_EL1 Cache Level ID 
Register"


To generate a diff of this commit:
cvs rdiff -u -r1.50 -r1.51 src/sys/arch/aarch64/aarch64/cpu.c
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/aarch64/aarch64/cpufunc.c
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/aarch64/aarch64/cpufunc_asm_armv8.S
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/aarch64/include/cpu.h
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/aarch64/include/cpufunc.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/aarch64

2020-07-01 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Wed Jul  1 07:59:16 UTC 2020

Modified Files:
src/sys/arch/aarch64/aarch64: cpu.c cpufunc.c cpufunc_asm_armv8.S
src/sys/arch/aarch64/include: cpu.h cpufunc.h

Log Message:
Switch the Icache sync operation to the necessary and sufficient one according 
to the CTR_EL0.DIC and CTR_EL0.IDC flags.

If CTR_EL0.DIC=1, Icache invalidation is not required.
If CTR_EL0.IDC=1, Dcache clean before Icache invalidation is not required.
CLIDR_EL1.LoC is 0, or CLIDR_EL1.LoUIS and CLIDR_EL1.LoUU are 0, Dcache clean 
is not required as well.

SEE ALSO ARMARM, "CTR_EL0 Cache Type Register", and "CLIDR_EL1 Cache Level ID 
Register"


To generate a diff of this commit:
cvs rdiff -u -r1.50 -r1.51 src/sys/arch/aarch64/aarch64/cpu.c
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/aarch64/aarch64/cpufunc.c
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/aarch64/aarch64/cpufunc_asm_armv8.S
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/aarch64/include/cpu.h
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/aarch64/include/cpufunc.h

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

Modified files:

Index: src/sys/arch/aarch64/aarch64/cpu.c
diff -u src/sys/arch/aarch64/aarch64/cpu.c:1.50 src/sys/arch/aarch64/aarch64/cpu.c:1.51
--- src/sys/arch/aarch64/aarch64/cpu.c:1.50	Mon Jun 29 23:56:30 2020
+++ src/sys/arch/aarch64/aarch64/cpu.c	Wed Jul  1 07:59:16 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu.c,v 1.50 2020/06/29 23:56:30 riastradh Exp $ */
+/* $NetBSD: cpu.c,v 1.51 2020/07/01 07:59:16 ryo Exp $ */
 
 /*
  * Copyright (c) 2017 Ryo Shimizu 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(1, "$NetBSD: cpu.c,v 1.50 2020/06/29 23:56:30 riastradh Exp $");
+__KERNEL_RCSID(1, "$NetBSD: cpu.c,v 1.51 2020/07/01 07:59:16 ryo Exp $");
 
 #include "locators.h"
 #include "opt_arm_debug.h"
@@ -239,7 +239,7 @@ cpu_identify(device_t self, struct cpu_i
 static void
 cpu_identify1(device_t self, struct cpu_info *ci)
 {
-	uint64_t ctr, sctlr;	/* for cache */
+	uint64_t ctr, clidr, sctlr;	/* for cache */
 
 	/* SCTLR - System Control Register */
 	sctlr = reg_sctlr_el1_read();
@@ -277,14 +277,21 @@ cpu_identify1(device_t self, struct cpu_
 	 * CTR - Cache Type Register
 	 */
 	ctr = reg_ctr_el0_read();
+	clidr = reg_clidr_el1_read();
 	aprint_verbose_dev(self, "Cache Writeback Granule %" PRIu64 "B,"
 	" Exclusives Reservation Granule %" PRIu64 "B\n",
 	__SHIFTOUT(ctr, CTR_EL0_CWG_LINE) * 4,
 	__SHIFTOUT(ctr, CTR_EL0_ERG_LINE) * 4);
 
-	aprint_verbose_dev(self, "Dcache line %ld, Icache line %ld\n",
+	aprint_verbose_dev(self, "Dcache line %ld, Icache line %ld"
+	", DIC=%lu, IDC=%lu, LoUU=%lu, LoC=%lu, LoUIS=%lu\n",
 	sizeof(int) << __SHIFTOUT(ctr, CTR_EL0_DMIN_LINE),
-	sizeof(int) << __SHIFTOUT(ctr, CTR_EL0_IMIN_LINE));
+	sizeof(int) << __SHIFTOUT(ctr, CTR_EL0_IMIN_LINE),
+	__SHIFTOUT(ctr, CTR_EL0_DIC),
+	__SHIFTOUT(ctr, CTR_EL0_IDC),
+	__SHIFTOUT(clidr, CLIDR_LOUU),
+	__SHIFTOUT(clidr, CLIDR_LOC),
+	__SHIFTOUT(clidr, CLIDR_LOUIS));
 }
 
 

Index: src/sys/arch/aarch64/aarch64/cpufunc.c
diff -u src/sys/arch/aarch64/aarch64/cpufunc.c:1.20 src/sys/arch/aarch64/aarch64/cpufunc.c:1.21
--- src/sys/arch/aarch64/aarch64/cpufunc.c:1.20	Mon May 25 05:13:16 2020
+++ src/sys/arch/aarch64/aarch64/cpufunc.c	Wed Jul  1 07:59:16 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpufunc.c,v 1.20 2020/05/25 05:13:16 ryo Exp $	*/
+/*	$NetBSD: cpufunc.c,v 1.21 2020/07/01 07:59:16 ryo Exp $	*/
 
 /*
  * Copyright (c) 2017 Ryo Shimizu 
@@ -30,7 +30,7 @@
 #include "opt_multiprocessor.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cpufunc.c,v 1.20 2020/05/25 05:13:16 ryo Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpufunc.c,v 1.21 2020/07/01 07:59:16 ryo Exp $");
 
 #include 
 #include 
@@ -426,13 +426,31 @@ int
 set_cpufuncs(void)
 {
 	struct cpu_info * const ci = curcpu();
+	const uint64_t ctr = reg_ctr_el0_read();
+	const uint64_t clidr = reg_clidr_el1_read();
 	const uint32_t midr __unused = reg_midr_el1_read();
 
 	/* install default functions */
 	ci->ci_cpufuncs.cf_set_ttbr0 = aarch64_set_ttbr0;
+	ci->ci_cpufuncs.cf_icache_sync_range = aarch64_icache_sync_range;
 
+	/*
+	 * install core/cluster specific functions
+	 */
+
+	/* Icache sync op */
+	if (__SHIFTOUT(ctr, CTR_EL0_DIC) == 1) {
+		/* Icache invalidation to the PoU is not required */
+		ci->ci_cpufuncs.cf_icache_sync_range =
+		aarch64_icache_barrier_range;
+	} else if (__SHIFTOUT(ctr, CTR_EL0_IDC) == 1 ||
+	__SHIFTOUT(clidr, CLIDR_LOC) == 0 ||
+	(__SHIFTOUT(clidr, CLIDR_LOUIS) == 0 && __SHIFTOUT(clidr, CLIDR_LOUU) == 0)) {
+		/* Dcache clean to the PoU is not required for Icache */
+		ci->ci_cpufuncs.cf_icache_sync_range =
+		aarch64_icache_inv_range;
+	}
 
-	/* install core/cluster specific functions */
 #ifdef CPU_THUNDERX
 	/* Cavium erratum 27456 */
 	if ((midr == CPU_ID_THUNDERXP1d0) ||

Index: src/sys/arch/aarch64/aarch64/cpufunc_asm_armv8.S
diff -u 

CVS commit: src/external/gpl3/gcc.old/usr.bin/lto-wrapper

2020-07-01 Thread Luke Mewburn
Module Name:src
Committed By:   lukem
Date:   Wed Jul  1 07:54:24 UTC 2020

Modified Files:
src/external/gpl3/gcc.old/usr.bin/lto-wrapper: Makefile

Log Message:
use ggc-none.c not ggc-none.o in SRCS

not tested, based on similar change to
 external/gpl3/gcc/usr.bin/lto-wrapper/Makefile


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 \
src/external/gpl3/gcc.old/usr.bin/lto-wrapper/Makefile

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

Modified files:

Index: src/external/gpl3/gcc.old/usr.bin/lto-wrapper/Makefile
diff -u src/external/gpl3/gcc.old/usr.bin/lto-wrapper/Makefile:1.6 src/external/gpl3/gcc.old/usr.bin/lto-wrapper/Makefile:1.7
--- src/external/gpl3/gcc.old/usr.bin/lto-wrapper/Makefile:1.6	Thu Sep 26 08:04:17 2019
+++ src/external/gpl3/gcc.old/usr.bin/lto-wrapper/Makefile	Wed Jul  1 07:54:24 2020
@@ -1,11 +1,11 @@
-#	$NetBSD: Makefile,v 1.6 2019/09/26 08:04:17 mrg Exp $
+#	$NetBSD: Makefile,v 1.7 2020/07/01 07:54:24 lukem Exp $
 
 NOMAN=1
 PROG=		lto-wrapper
 # XXX pullout from LTO_WRAPPER_OBJS
 SRCS=		lto-wrapper.c \
 		collect-utils.c \
-		ggc-none.o
+		ggc-none.c
 
 BINDIR=		/usr/libexec
 



CVS commit: src/external/gpl3/gcc.old/usr.bin/lto-wrapper

2020-07-01 Thread Luke Mewburn
Module Name:src
Committed By:   lukem
Date:   Wed Jul  1 07:54:24 UTC 2020

Modified Files:
src/external/gpl3/gcc.old/usr.bin/lto-wrapper: Makefile

Log Message:
use ggc-none.c not ggc-none.o in SRCS

not tested, based on similar change to
 external/gpl3/gcc/usr.bin/lto-wrapper/Makefile


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 \
src/external/gpl3/gcc.old/usr.bin/lto-wrapper/Makefile

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



CVS commit: src/share/mk

2020-07-01 Thread Luke Mewburn
Module Name:src
Committed By:   lukem
Date:   Wed Jul  1 07:38:29 UTC 2020

Modified Files:
src/share/mk: bsd.dep.mk

Log Message:
bsd.dep.mk: fix "make tags" (again)

[repeat revision 1.85]

Fix "make tags" to actually build a tags file:
- Use !commands() instead of !target(), so that the rule actually works
- Write to ${.OBJDIR}/tags for read-only source (don't know why ${.TARGET}
  isn't sufficient).
- Only match *.[cly] from ${.ALLSRCS} - just excluding *.h causes failures
  because of ${targ}: subdir-${targ} in bsd.subdir.mk.

Thanks to uwe@ for assistance.


To generate a diff of this commit:
cvs rdiff -u -r1.86 -r1.87 src/share/mk/bsd.dep.mk

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

Modified files:

Index: src/share/mk/bsd.dep.mk
diff -u src/share/mk/bsd.dep.mk:1.86 src/share/mk/bsd.dep.mk:1.87
--- src/share/mk/bsd.dep.mk:1.86	Mon Jun 22 01:04:26 2020
+++ src/share/mk/bsd.dep.mk	Wed Jul  1 07:38:29 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.dep.mk,v 1.86 2020/06/22 01:04:26 lukem Exp $
+#	$NetBSD: bsd.dep.mk,v 1.87 2020/07/01 07:38:29 lukem Exp $
 
 # Basic targets
 realdepend:	beforedepend .depend afterdepend
@@ -94,16 +94,16 @@ _MKDEP_FILEFLAGS=
 
 # Clean rules
 .if defined(SRCS) && !empty(SRCS)
-CLEANDIRFILES+= .depend ${__DPSRCS.d} ${__DPSRCS.d:.d=.d.tmp} ${.CURDIR}/tags ${CLEANDEPEND}
+CLEANDIRFILES+= .depend ${__DPSRCS.d} ${__DPSRCS.d:.d=.d.tmp} tags ${CLEANDEPEND}
 .endif
 
 # Custom rules
-.if !target(tags)
+.if !commands(tags)
 tags: ${SRCS}
 .if defined(SRCS) && !empty(SRCS)
 	${_MKTARGET_CREATE}
-	-cd "${.CURDIR}"; ctags -f /dev/stdout ${.ALLSRC:N*.h} | \
-	${TOOL_SED} "s;\${.CURDIR}/;;" > tags
+	-cd "${.CURDIR}"; ctags -f /dev/stdout ${.ALLSRC:M*.[cly]} | \
+	${TOOL_SED} "s;\${.CURDIR}/;;" > ${.OBJDIR}/tags
 .endif
 .endif
 



CVS commit: src/share/mk

2020-07-01 Thread Luke Mewburn
Module Name:src
Committed By:   lukem
Date:   Wed Jul  1 07:38:29 UTC 2020

Modified Files:
src/share/mk: bsd.dep.mk

Log Message:
bsd.dep.mk: fix "make tags" (again)

[repeat revision 1.85]

Fix "make tags" to actually build a tags file:
- Use !commands() instead of !target(), so that the rule actually works
- Write to ${.OBJDIR}/tags for read-only source (don't know why ${.TARGET}
  isn't sufficient).
- Only match *.[cly] from ${.ALLSRCS} - just excluding *.h causes failures
  because of ${targ}: subdir-${targ} in bsd.subdir.mk.

Thanks to uwe@ for assistance.


To generate a diff of this commit:
cvs rdiff -u -r1.86 -r1.87 src/share/mk/bsd.dep.mk

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



CVS commit: src

2020-07-01 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Wed Jul  1 07:16:38 UTC 2020

Modified Files:
src/distrib/sets/lists/debug: mi
src/distrib/sets/lists/tests: mi
src/tests/lib/libc/stdlib: Makefile
Added Files:
src/tests/lib/libc/stdlib: t_a64l.c

Log Message:
Add basic checks for a64l(3), l64a(3), and l64a_r(3).


To generate a diff of this commit:
cvs rdiff -u -r1.322 -r1.323 src/distrib/sets/lists/debug/mi
cvs rdiff -u -r1.868 -r1.869 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.32 -r1.33 src/tests/lib/libc/stdlib/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/lib/libc/stdlib/t_a64l.c

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

Modified files:

Index: src/distrib/sets/lists/debug/mi
diff -u src/distrib/sets/lists/debug/mi:1.322 src/distrib/sets/lists/debug/mi:1.323
--- src/distrib/sets/lists/debug/mi:1.322	Tue Jun 30 20:32:10 2020
+++ src/distrib/sets/lists/debug/mi	Wed Jul  1 07:16:38 2020
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.322 2020/06/30 20:32:10 riastradh Exp $
+# $NetBSD: mi,v 1.323 2020/07/01 07:16:38 jruoho Exp $
 ./etc/mtree/set.debug   comp-sys-root
 ./usr/lib	comp-sys-usr		compatdir
 ./usr/lib/i18n/libBIG5_g.a			comp-c-debuglib		debuglib,compatfile
@@ -2081,6 +2081,7 @@
 ./usr/libdata/debug/usr/tests/lib/libc/stdlib/h_atexit.debug		tests-lib-debug		debug,atf,compattestfile
 ./usr/libdata/debug/usr/tests/lib/libc/stdlib/h_getopt.debug		tests-lib-debug		debug,atf,compattestfile
 ./usr/libdata/debug/usr/tests/lib/libc/stdlib/h_getopt_long.debug	tests-lib-debug		debug,atf,compattestfile
+./usr/libdata/debug/usr/tests/lib/libc/stdlib/t_a64l.debug		tests-lib-debug		debug,atf,compattestfile
 ./usr/libdata/debug/usr/tests/lib/libc/stdlib/t_abs.debug		tests-lib-debug		debug,atf,compattestfile
 ./usr/libdata/debug/usr/tests/lib/libc/stdlib/t_atoi.debug		tests-lib-debug		debug,atf,compattestfile
 ./usr/libdata/debug/usr/tests/lib/libc/stdlib/t_div.debug		tests-lib-debug		debug,atf,compattestfile

Index: src/distrib/sets/lists/tests/mi
diff -u src/distrib/sets/lists/tests/mi:1.868 src/distrib/sets/lists/tests/mi:1.869
--- src/distrib/sets/lists/tests/mi:1.868	Tue Jun 30 23:51:47 2020
+++ src/distrib/sets/lists/tests/mi	Wed Jul  1 07:16:38 2020
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.868 2020/06/30 23:51:47 lukem Exp $
+# $NetBSD: mi,v 1.869 2020/07/01 07:16:38 jruoho Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -3068,6 +3068,7 @@
 ./usr/tests/lib/libc/stdlib/h_atexit		tests-lib-tests		compattestfile,atf
 ./usr/tests/lib/libc/stdlib/h_getopt		tests-lib-tests		compattestfile,atf
 ./usr/tests/lib/libc/stdlib/h_getopt_long	tests-lib-tests		compattestfile,atf
+./usr/tests/lib/libc/stdlib/t_a64l		tests-lib-tests		compattestfile,atf
 ./usr/tests/lib/libc/stdlib/t_abs		tests-lib-tests		compattestfile,atf
 ./usr/tests/lib/libc/stdlib/t_atexit		tests-lib-tests		compattestfile,atf
 ./usr/tests/lib/libc/stdlib/t_atoi		tests-lib-tests		compattestfile,atf

Index: src/tests/lib/libc/stdlib/Makefile
diff -u src/tests/lib/libc/stdlib/Makefile:1.32 src/tests/lib/libc/stdlib/Makefile:1.33
--- src/tests/lib/libc/stdlib/Makefile:1.32	Tue Jun 30 16:09:40 2020
+++ src/tests/lib/libc/stdlib/Makefile	Wed Jul  1 07:16:37 2020
@@ -1,9 +1,10 @@
-# $NetBSD: Makefile,v 1.32 2020/06/30 16:09:40 jruoho Exp $
+# $NetBSD: Makefile,v 1.33 2020/07/01 07:16:37 jruoho Exp $
 
 .include 
 
 TESTSDIR=	${TESTSBASE}/lib/libc/stdlib
 
+TESTS_C+=	t_a64l
 TESTS_C+=	t_abs
 TESTS_C+=	t_atoi
 TESTS_C+=	t_div

Added files:

Index: src/tests/lib/libc/stdlib/t_a64l.c
diff -u /dev/null src/tests/lib/libc/stdlib/t_a64l.c:1.1
--- /dev/null	Wed Jul  1 07:16:38 2020
+++ src/tests/lib/libc/stdlib/t_a64l.c	Wed Jul  1 07:16:37 2020
@@ -0,0 +1,111 @@
+/* $NetBSD: t_a64l.c,v 1.1 2020/07/01 07:16:37 jruoho Exp $ */
+
+/*-
+ * Copyright (c) 2020 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jukka Ruohonen.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 

CVS commit: src

2020-07-01 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Wed Jul  1 07:16:38 UTC 2020

Modified Files:
src/distrib/sets/lists/debug: mi
src/distrib/sets/lists/tests: mi
src/tests/lib/libc/stdlib: Makefile
Added Files:
src/tests/lib/libc/stdlib: t_a64l.c

Log Message:
Add basic checks for a64l(3), l64a(3), and l64a_r(3).


To generate a diff of this commit:
cvs rdiff -u -r1.322 -r1.323 src/distrib/sets/lists/debug/mi
cvs rdiff -u -r1.868 -r1.869 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.32 -r1.33 src/tests/lib/libc/stdlib/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/lib/libc/stdlib/t_a64l.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/w

2020-07-01 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Jul  1 06:31:18 UTC 2020

Modified Files:
src/usr.bin/w: Makefile

Log Message:
Forbid gcc to whine about intended format truncation


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

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

Modified files:

Index: src/usr.bin/w/Makefile
diff -u src/usr.bin/w/Makefile:1.21 src/usr.bin/w/Makefile:1.22
--- src/usr.bin/w/Makefile:1.21	Fri Oct 21 02:26:09 2011
+++ src/usr.bin/w/Makefile	Wed Jul  1 06:31:18 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.21 2011/10/21 02:26:09 christos Exp $
+#	$NetBSD: Makefile,v 1.22 2020/07/01 06:31:18 martin Exp $
 #	@(#)Makefile	8.1 (Berkeley) 6/6/93
 
 .include 
@@ -14,5 +14,6 @@ CPPFLAGS+= -DSUPPORT_UTMP -DSUPPORT_UTMP
 .PATH: ${NETBSDSRCDIR}/bin/ps
 
 COPTS.pr_time.c += -Wno-format-y2k
+COPTS.w.c += ${GCC_NO_FORMAT_TRUNCATION}
 
 .include 



CVS commit: src/usr.bin/w

2020-07-01 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Jul  1 06:31:18 UTC 2020

Modified Files:
src/usr.bin/w: Makefile

Log Message:
Forbid gcc to whine about intended format truncation


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

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