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

2022-12-03 Thread Jan Schaumann
Module Name:src
Committed By:   jschauma
Date:   Sun Dec  4 02:53:17 UTC 2022

Modified Files:
src/tests/lib/libc/net: t_protoent.sh t_servent.sh

Log Message:
allow testing of files other than those in /etc

To test e.g., the file "/some/where/protocols" instead of "/etc/protocols",
set TEST_FILE=/some/where/protocols in your environment.

Note: this now compares the contents of the file you gave versus what
getprotoent(3)/getservent(3) uses (which still is /etc/protocols via
h_protoent.c / /etc/services or /var/db/services.cdb via h_servent.c).

When you have expected changes in the services or protocols file that
you're generating, this necessarily produces a difference.  To really
allow testing the file versus what the library function returns, you'd
have to install the file on the system running the test, but at least
with this change you can now generate the file and verify that it didn't
caused unexpected differences.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/tests/lib/libc/net/t_protoent.sh
cvs rdiff -u -r1.3 -r1.4 src/tests/lib/libc/net/t_servent.sh

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

Modified files:

Index: src/tests/lib/libc/net/t_protoent.sh
diff -u src/tests/lib/libc/net/t_protoent.sh:1.4 src/tests/lib/libc/net/t_protoent.sh:1.5
--- src/tests/lib/libc/net/t_protoent.sh:1.4	Mon Nov 28 17:41:00 2022
+++ src/tests/lib/libc/net/t_protoent.sh	Sun Dec  4 02:53:17 2022
@@ -1,4 +1,4 @@
-# $NetBSD: t_protoent.sh,v 1.4 2022/11/28 17:41:00 jschauma Exp $
+# $NetBSD: t_protoent.sh,v 1.5 2022/12/04 02:53:17 jschauma Exp $
 #
 # Copyright (c) 2008 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -24,6 +24,7 @@
 # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 # POSSIBILITY OF SUCH DAMAGE.
 #
+: ${TEST_FILE:="/etc/protocols"}
 
 atf_test_case protoent
 protoent_head()
@@ -38,7 +39,7 @@ protoent_body()
 	#  (2) fold all names for the same port/proto together
 	#  (3) prune duplicates
 	#
-	tr '\t' ' ' 

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

2022-12-03 Thread Jan Schaumann
Module Name:src
Committed By:   jschauma
Date:   Sun Dec  4 02:53:17 UTC 2022

Modified Files:
src/tests/lib/libc/net: t_protoent.sh t_servent.sh

Log Message:
allow testing of files other than those in /etc

To test e.g., the file "/some/where/protocols" instead of "/etc/protocols",
set TEST_FILE=/some/where/protocols in your environment.

Note: this now compares the contents of the file you gave versus what
getprotoent(3)/getservent(3) uses (which still is /etc/protocols via
h_protoent.c / /etc/services or /var/db/services.cdb via h_servent.c).

When you have expected changes in the services or protocols file that
you're generating, this necessarily produces a difference.  To really
allow testing the file versus what the library function returns, you'd
have to install the file on the system running the test, but at least
with this change you can now generate the file and verify that it didn't
caused unexpected differences.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/tests/lib/libc/net/t_protoent.sh
cvs rdiff -u -r1.3 -r1.4 src/tests/lib/libc/net/t_servent.sh

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



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

2022-12-03 Thread Jan Schaumann
Module Name:src
Committed By:   jschauma
Date:   Sun Dec  4 02:42:39 UTC 2022

Modified Files:
src/tests/lib/libc/net: t_servent.sh

Log Message:
whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/lib/libc/net/t_servent.sh

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

Modified files:

Index: src/tests/lib/libc/net/t_servent.sh
diff -u src/tests/lib/libc/net/t_servent.sh:1.2 src/tests/lib/libc/net/t_servent.sh:1.3
--- src/tests/lib/libc/net/t_servent.sh:1.2	Tue Mar  8 08:34:17 2016
+++ src/tests/lib/libc/net/t_servent.sh	Sun Dec  4 02:42:39 2022
@@ -1,4 +1,4 @@
-# $NetBSD: t_servent.sh,v 1.2 2016/03/08 08:34:17 joerg Exp $
+# $NetBSD: t_servent.sh,v 1.3 2022/12/04 02:42:39 jschauma Exp $
 #
 # Copyright (c) 2008 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -41,45 +41,45 @@ servent_body()
 	#  (3) prune duplicates
 	#
 	tr '\t' ' ' 2) {
-printf " ";
+			sub("#.*", "", $0);
+			gsub("  *", " ", $0);
+			if (NF==0) {
+next;
 			}
-			printf "%s", ar[i];
+			add($2, $1, 0);
+			for (i=3; i<=NF; i++) {
+add($2, $i, 1);
 			}
-			printf "\n";
-			delete ar;
 		}
+		END {
+			for (key in names) {
+portproto = key;
+sub("/", ", proto=", portproto);
+portproto = "port=" portproto;
+
+n = split(names[key], ar);
+printf "name=%s, %s, aliases=", ar[1], portproto;
+for (i=2; i<=n; i++) {
+	if (i>2) {
+		printf " ";
+	}
+	printf "%s", ar[i];
+}
+printf "\n";
+delete ar;
+			}
 		}
 	' | sort >exp
 



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

2022-12-03 Thread Jan Schaumann
Module Name:src
Committed By:   jschauma
Date:   Sun Dec  4 02:42:39 UTC 2022

Modified Files:
src/tests/lib/libc/net: t_servent.sh

Log Message:
whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/lib/libc/net/t_servent.sh

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



CVS commit: src/lib

2022-12-03 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Sun Dec  4 01:29:33 UTC 2022

Modified Files:
src/lib/libbluetooth: bluetooth.3
src/lib/libc/gen: cgetcap.3 getusershell.3 scandir.3 wordexp.3
src/lib/libc/inet: inet.3 inet6_option_space.3 inet6_rthdr_space.3
src/lib/libc/net: gethostbyname.3 getnetent.3 inet6_opt_init.3
inet6_option_space.3 inet6_rth_space.3 inet6_rthdr_space.3 rcmd.3
src/lib/libc/regex: regex.3
src/lib/libc/rpc: getrpcent.3
src/lib/libc/stdlib: getopt.3 jemalloc.3 random.3
src/lib/libc/sys: intro.2
src/lib/libcompat/4.1: stty.3
src/lib/libcompat/4.3: re_comp.3
src/lib/librmt: rmtops.3
src/lib/librt: aio_read.3
src/lib/libutil: getmntopts.3

Log Message:
Sections 2 and 3 have RETURN VALUES, not DIAGNOSTICS


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/lib/libbluetooth/bluetooth.3
cvs rdiff -u -r1.9 -r1.10 src/lib/libc/gen/cgetcap.3
cvs rdiff -u -r1.10 -r1.11 src/lib/libc/gen/getusershell.3
cvs rdiff -u -r1.16 -r1.17 src/lib/libc/gen/scandir.3
cvs rdiff -u -r1.4 -r1.5 src/lib/libc/gen/wordexp.3
cvs rdiff -u -r1.5 -r1.6 src/lib/libc/inet/inet.3
cvs rdiff -u -r1.3 -r1.4 src/lib/libc/inet/inet6_option_space.3 \
src/lib/libc/inet/inet6_rthdr_space.3
cvs rdiff -u -r1.29 -r1.30 src/lib/libc/net/gethostbyname.3
cvs rdiff -u -r1.16 -r1.17 src/lib/libc/net/getnetent.3
cvs rdiff -u -r1.2 -r1.3 src/lib/libc/net/inet6_opt_init.3 \
src/lib/libc/net/inet6_rth_space.3
cvs rdiff -u -r1.17 -r1.18 src/lib/libc/net/inet6_option_space.3 \
src/lib/libc/net/inet6_rthdr_space.3
cvs rdiff -u -r1.28 -r1.29 src/lib/libc/net/rcmd.3
cvs rdiff -u -r1.32 -r1.33 src/lib/libc/regex/regex.3
cvs rdiff -u -r1.14 -r1.15 src/lib/libc/rpc/getrpcent.3
cvs rdiff -u -r1.35 -r1.36 src/lib/libc/stdlib/getopt.3
cvs rdiff -u -r1.11 -r1.12 src/lib/libc/stdlib/jemalloc.3
cvs rdiff -u -r1.22 -r1.23 src/lib/libc/stdlib/random.3
cvs rdiff -u -r1.61 -r1.62 src/lib/libc/sys/intro.2
cvs rdiff -u -r1.10 -r1.11 src/lib/libcompat/4.1/stty.3
cvs rdiff -u -r1.12 -r1.13 src/lib/libcompat/4.3/re_comp.3
cvs rdiff -u -r1.15 -r1.16 src/lib/librmt/rmtops.3
cvs rdiff -u -r1.5 -r1.6 src/lib/librt/aio_read.3
cvs rdiff -u -r1.14 -r1.15 src/lib/libutil/getmntopts.3

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

Modified files:

Index: src/lib/libbluetooth/bluetooth.3
diff -u src/lib/libbluetooth/bluetooth.3:1.9 src/lib/libbluetooth/bluetooth.3:1.10
--- src/lib/libbluetooth/bluetooth.3:1.9	Mon Jul  3 21:32:49 2017
+++ src/lib/libbluetooth/bluetooth.3	Sun Dec  4 01:29:31 2022
@@ -1,4 +1,4 @@
-.\" $NetBSD: bluetooth.3,v 1.9 2017/07/03 21:32:49 wiz Exp $
+.\" $NetBSD: bluetooth.3,v 1.10 2022/12/04 01:29:31 uwe Exp $
 .\"
 .\" Copyright (c) 2003 Maksim Yevmenkin 
 .\" All rights reserved.
@@ -208,7 +208,7 @@ if ((hp = bt_gethostbyaddr((const char *
 
 printf("name associated with %s is %s\en", bdstr, hp->h_name);
 .Ed
-.Sh DIAGNOSTICS
+.Sh RETURN VALUES
 Error return status from
 .Fn bt_gethostent ,
 .Fn bt_gethostbyname ,

Index: src/lib/libc/gen/cgetcap.3
diff -u src/lib/libc/gen/cgetcap.3:1.9 src/lib/libc/gen/cgetcap.3:1.10
--- src/lib/libc/gen/cgetcap.3:1.9	Tue Oct 24 18:42:06 2017
+++ src/lib/libc/gen/cgetcap.3	Sun Dec  4 01:29:32 2022
@@ -1,4 +1,4 @@
-.\"	$NetBSD: cgetcap.3,v 1.9 2017/10/24 18:42:06 abhinav Exp $
+.\"	$NetBSD: cgetcap.3,v 1.10 2022/12/04 01:29:32 uwe Exp $
 .\"
 .\" Copyright (c) 1992, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -315,7 +315,7 @@ is declared and all subsequent files in 
 can be used to control if
 .Qq tc
 expansion is performed or not.
-.Sh DIAGNOSTICS
+.Sh RETURN VALUES
 .Fn cgetent ,
 .Fn cgetset ,
 .Fn cgetmatch ,

Index: src/lib/libc/gen/getusershell.3
diff -u src/lib/libc/gen/getusershell.3:1.10 src/lib/libc/gen/getusershell.3:1.11
--- src/lib/libc/gen/getusershell.3:1.10	Tue Nov 23 04:38:19 2004
+++ src/lib/libc/gen/getusershell.3	Sun Dec  4 01:29:32 2022
@@ -1,4 +1,4 @@
-.\"	$NetBSD: getusershell.3,v 1.10 2004/11/23 04:38:19 lukem Exp $
+.\"	$NetBSD: getusershell.3,v 1.11 2022/12/04 01:29:32 uwe Exp $
 .\"
 .\" Copyright (c) 1985, 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -75,7 +75,7 @@ closes it.
 .Bl -tag -width /etc/shells -compact
 .It Pa /etc/shells
 .El
-.Sh DIAGNOSTICS
+.Sh RETURN VALUES
 The routine
 .Fn getusershell
 returns a null pointer (0) on

Index: src/lib/libc/gen/scandir.3
diff -u src/lib/libc/gen/scandir.3:1.16 src/lib/libc/gen/scandir.3:1.17
--- src/lib/libc/gen/scandir.3:1.16	Sat Dec 17 10:25:49 2016
+++ src/lib/libc/gen/scandir.3	Sun Dec  4 01:29:32 2022
@@ -1,4 +1,4 @@
-.\"	$NetBSD: scandir.3,v 1.16 2016/12/17 10:25:49 wiz Exp $
+.\"	$NetBSD: scandir.3,v 1.17 2022/12/04 01:29:32 uwe Exp $
 .\"
 .\" Copyright (c) 1983, 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.

CVS commit: src/lib

2022-12-03 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Sun Dec  4 01:29:33 UTC 2022

Modified Files:
src/lib/libbluetooth: bluetooth.3
src/lib/libc/gen: cgetcap.3 getusershell.3 scandir.3 wordexp.3
src/lib/libc/inet: inet.3 inet6_option_space.3 inet6_rthdr_space.3
src/lib/libc/net: gethostbyname.3 getnetent.3 inet6_opt_init.3
inet6_option_space.3 inet6_rth_space.3 inet6_rthdr_space.3 rcmd.3
src/lib/libc/regex: regex.3
src/lib/libc/rpc: getrpcent.3
src/lib/libc/stdlib: getopt.3 jemalloc.3 random.3
src/lib/libc/sys: intro.2
src/lib/libcompat/4.1: stty.3
src/lib/libcompat/4.3: re_comp.3
src/lib/librmt: rmtops.3
src/lib/librt: aio_read.3
src/lib/libutil: getmntopts.3

Log Message:
Sections 2 and 3 have RETURN VALUES, not DIAGNOSTICS


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/lib/libbluetooth/bluetooth.3
cvs rdiff -u -r1.9 -r1.10 src/lib/libc/gen/cgetcap.3
cvs rdiff -u -r1.10 -r1.11 src/lib/libc/gen/getusershell.3
cvs rdiff -u -r1.16 -r1.17 src/lib/libc/gen/scandir.3
cvs rdiff -u -r1.4 -r1.5 src/lib/libc/gen/wordexp.3
cvs rdiff -u -r1.5 -r1.6 src/lib/libc/inet/inet.3
cvs rdiff -u -r1.3 -r1.4 src/lib/libc/inet/inet6_option_space.3 \
src/lib/libc/inet/inet6_rthdr_space.3
cvs rdiff -u -r1.29 -r1.30 src/lib/libc/net/gethostbyname.3
cvs rdiff -u -r1.16 -r1.17 src/lib/libc/net/getnetent.3
cvs rdiff -u -r1.2 -r1.3 src/lib/libc/net/inet6_opt_init.3 \
src/lib/libc/net/inet6_rth_space.3
cvs rdiff -u -r1.17 -r1.18 src/lib/libc/net/inet6_option_space.3 \
src/lib/libc/net/inet6_rthdr_space.3
cvs rdiff -u -r1.28 -r1.29 src/lib/libc/net/rcmd.3
cvs rdiff -u -r1.32 -r1.33 src/lib/libc/regex/regex.3
cvs rdiff -u -r1.14 -r1.15 src/lib/libc/rpc/getrpcent.3
cvs rdiff -u -r1.35 -r1.36 src/lib/libc/stdlib/getopt.3
cvs rdiff -u -r1.11 -r1.12 src/lib/libc/stdlib/jemalloc.3
cvs rdiff -u -r1.22 -r1.23 src/lib/libc/stdlib/random.3
cvs rdiff -u -r1.61 -r1.62 src/lib/libc/sys/intro.2
cvs rdiff -u -r1.10 -r1.11 src/lib/libcompat/4.1/stty.3
cvs rdiff -u -r1.12 -r1.13 src/lib/libcompat/4.3/re_comp.3
cvs rdiff -u -r1.15 -r1.16 src/lib/librmt/rmtops.3
cvs rdiff -u -r1.5 -r1.6 src/lib/librt/aio_read.3
cvs rdiff -u -r1.14 -r1.15 src/lib/libutil/getmntopts.3

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



CVS commit: src/lib/libc/net

2022-12-03 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Sun Dec  4 00:13:11 UTC 2022

Modified Files:
src/lib/libc/net: getservent.3

Log Message:
getservent(3): Section 3 has RETURN VALUES, not DIAGNOSTICS

While here, don't claim that null pointer is zero.

We should probably just pick the wording from POSIX, but that yak is a
bit too big for me to shave at the moment.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/lib/libc/net/getservent.3

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

Modified files:

Index: src/lib/libc/net/getservent.3
diff -u src/lib/libc/net/getservent.3:1.15 src/lib/libc/net/getservent.3:1.16
--- src/lib/libc/net/getservent.3:1.15	Sat Dec  3 23:55:52 2022
+++ src/lib/libc/net/getservent.3	Sun Dec  4 00:13:11 2022
@@ -1,4 +1,4 @@
-.\"	$NetBSD: getservent.3,v 1.15 2022/12/03 23:55:52 jschauma Exp $
+.\"	$NetBSD: getservent.3,v 1.16 2022/12/04 00:13:11 uwe Exp $
 .\"
 .\" Copyright (c) 1983, 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -129,9 +129,8 @@ searches must also match the protocol.
 .It Pa /etc/services
 .It Pa /var/db/services.cdb
 .El
-.Sh DIAGNOSTICS
-Null pointer
-(0) returned on
+.Sh RETURN VALUES
+Null pointer is returned on
 .Dv EOF
 or error.
 .Sh SEE ALSO



CVS commit: src/lib/libc/net

2022-12-03 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Sun Dec  4 00:13:11 UTC 2022

Modified Files:
src/lib/libc/net: getservent.3

Log Message:
getservent(3): Section 3 has RETURN VALUES, not DIAGNOSTICS

While here, don't claim that null pointer is zero.

We should probably just pick the wording from POSIX, but that yak is a
bit too big for me to shave at the moment.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/lib/libc/net/getservent.3

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



CVS commit: src/lib/libc/net

2022-12-03 Thread Jan Schaumann
Module Name:src
Committed By:   jschauma
Date:   Sat Dec  3 23:55:52 UTC 2022

Modified Files:
src/lib/libc/net: getservent.3

Log Message:
reference /var/db/services.cdb / services_mkdb(8)


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/lib/libc/net/getservent.3

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



CVS commit: src/lib/libc/net

2022-12-03 Thread Jan Schaumann
Module Name:src
Committed By:   jschauma
Date:   Sat Dec  3 23:55:52 UTC 2022

Modified Files:
src/lib/libc/net: getservent.3

Log Message:
reference /var/db/services.cdb / services_mkdb(8)


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/lib/libc/net/getservent.3

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

Modified files:

Index: src/lib/libc/net/getservent.3
diff -u src/lib/libc/net/getservent.3:1.14 src/lib/libc/net/getservent.3:1.15
--- src/lib/libc/net/getservent.3:1.14	Thu Aug  7 16:43:10 2003
+++ src/lib/libc/net/getservent.3	Sat Dec  3 23:55:52 2022
@@ -1,4 +1,4 @@
-.\"	$NetBSD: getservent.3,v 1.14 2003/08/07 16:43:10 agc Exp $
+.\"	$NetBSD: getservent.3,v 1.15 2022/12/03 23:55:52 jschauma Exp $
 .\"
 .\" Copyright (c) 1983, 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -29,7 +29,7 @@
 .\"
 .\" @(#)getservent.3  8.4 (Berkeley) 5/25/95
 .\"
-.Dd May 25, 1995
+.Dd December 03, 2022
 .Dt GETSERVENT 3
 .Os
 .Sh NAME
@@ -127,6 +127,7 @@ searches must also match the protocol.
 .Sh FILES
 .Bl -tag -width /etc/services -compact
 .It Pa /etc/services
+.It Pa /var/db/services.cdb
 .El
 .Sh DIAGNOSTICS
 Null pointer
@@ -135,7 +136,8 @@ Null pointer
 or error.
 .Sh SEE ALSO
 .Xr getprotoent 3 ,
-.Xr services 5
+.Xr services 5 ,
+.Xr services_mkdb 8
 .Sh HISTORY
 The
 .Fn getservent ,



CVS commit: src/sys

2022-12-03 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Sat Dec  3 20:24:21 UTC 2022

Modified Files:
src/sys/arch/arm/include: armreg.h
src/sys/dev/tprof: tprof_armv7.c

Log Message:
move ARMv7 PMC register definitions to armreg.h from tprof_armv7.c


To generate a diff of this commit:
cvs rdiff -u -r1.135 -r1.136 src/sys/arch/arm/include/armreg.h
cvs rdiff -u -r1.10 -r1.11 src/sys/dev/tprof/tprof_armv7.c

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

Modified files:

Index: src/sys/arch/arm/include/armreg.h
diff -u src/sys/arch/arm/include/armreg.h:1.135 src/sys/arch/arm/include/armreg.h:1.136
--- src/sys/arch/arm/include/armreg.h:1.135	Fri May 20 19:34:22 2022
+++ src/sys/arch/arm/include/armreg.h	Sat Dec  3 20:24:21 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: armreg.h,v 1.135 2022/05/20 19:34:22 andvar Exp $	*/
+/*	$NetBSD: armreg.h,v 1.136 2022/12/03 20:24:21 ryo Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Ben Harris
@@ -485,6 +485,26 @@
 #define	ARM11_PMCEVT_RETURN_MISS	38	/* return addr. mispredicted */
 #define	ARM11_PMCEVT_CYCLE		255	/* Increment each cycle */
 
+/* ARMv7 PMCR, Performance Monitor Control Register */
+#define	PMCR_N			__BITS(15,11)
+#define	PMCR_D			__BIT(3)
+#define	PMCR_E			__BIT(0)
+
+/* ARMv7 INTEN{SET,CLR}, Performance Monitors Interrupt Enable Set register */
+#define	PMINTEN_C		__BIT(31)
+#define	PMINTEN_P		__BITS(30,0)
+#define	PMCNTEN_C		__BIT(31)
+#define	PMCNTEN_P		__BITS(30,0)
+
+/* ARMv7 PMOVSR, Performance Monitors Overflow Flag Status Register */
+#define	PMOVS_C			__BIT(31)
+#define	PMOVS_P			__BITS(30,0)
+
+/* ARMv7 PMXEVTYPER, Performance Monitors Event Type Select Register */
+#define	PMEVTYPER_P		__BIT(31)
+#define	PMEVTYPER_U		__BIT(30)
+#define	PMEVTYPER_EVTCOUNT	__BITS(7,0)
+
 /* Defines for ARM CORTEX performance counters */
 #define CORTEX_CNTENS_C __BIT(31)	/* Enables the cycle counter */
 #define CORTEX_CNTENC_C __BIT(31)	/* Disables the cycle counter */

Index: src/sys/dev/tprof/tprof_armv7.c
diff -u src/sys/dev/tprof/tprof_armv7.c:1.10 src/sys/dev/tprof/tprof_armv7.c:1.11
--- src/sys/dev/tprof/tprof_armv7.c:1.10	Thu Dec  1 00:32:52 2022
+++ src/sys/dev/tprof/tprof_armv7.c	Sat Dec  3 20:24:21 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: tprof_armv7.c,v 1.10 2022/12/01 00:32:52 ryo Exp $ */
+/* $NetBSD: tprof_armv7.c,v 1.11 2022/12/03 20:24:21 ryo Exp $ */
 
 /*-
  * Copyright (c) 2018 Jared McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: tprof_armv7.c,v 1.10 2022/12/01 00:32:52 ryo Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tprof_armv7.c,v 1.11 2022/12/03 20:24:21 ryo Exp $");
 
 #include 
 #include 
@@ -42,22 +42,6 @@ __KERNEL_RCSID(0, "$NetBSD: tprof_armv7.
 
 #include 
 
-#define	PMCR_N			__BITS(15,11)
-#define	PMCR_D			__BIT(3)
-#define	PMCR_E			__BIT(0)
-
-#define	PMINTEN_C		__BIT(31)
-#define	PMINTEN_P		__BITS(30,0)
-#define	PMCNTEN_C		__BIT(31)
-#define	PMCNTEN_P		__BITS(30,0)
-
-#define	PMOVS_C			__BIT(31)
-#define	PMOVS_P			__BITS(30,0)
-
-#define	PMEVTYPER_P		__BIT(31)
-#define	PMEVTYPER_U		__BIT(30)
-#define	PMEVTYPER_EVTCOUNT	__BITS(7,0)
-
 static uint16_t cortexa9_events[] = {
 	0x40, 0x41, 0x42,
 	0x50, 0x51,



CVS commit: src/sys

2022-12-03 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Sat Dec  3 20:24:21 UTC 2022

Modified Files:
src/sys/arch/arm/include: armreg.h
src/sys/dev/tprof: tprof_armv7.c

Log Message:
move ARMv7 PMC register definitions to armreg.h from tprof_armv7.c


To generate a diff of this commit:
cvs rdiff -u -r1.135 -r1.136 src/sys/arch/arm/include/armreg.h
cvs rdiff -u -r1.10 -r1.11 src/sys/dev/tprof/tprof_armv7.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/hp300/dev

2022-12-03 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Dec  3 16:56:41 UTC 2022

Modified Files:
src/sys/arch/hp300/dev: rd.c

Log Message:
Explicitly include  for hz(9) as man pages says.

XXX: it looks sys/param.h r1.615 and later also has extern int hz


To generate a diff of this commit:
cvs rdiff -u -r1.123 -r1.124 src/sys/arch/hp300/dev/rd.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/hp300/dev/rd.c
diff -u src/sys/arch/hp300/dev/rd.c:1.123 src/sys/arch/hp300/dev/rd.c:1.124
--- src/sys/arch/hp300/dev/rd.c:1.123	Sat Dec  3 06:08:18 2022
+++ src/sys/arch/hp300/dev/rd.c	Sat Dec  3 16:56:40 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: rd.c,v 1.123 2022/12/03 06:08:18 tsutsui Exp $	*/
+/*	$NetBSD: rd.c,v 1.124 2022/12/03 16:56:40 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@@ -72,12 +72,13 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rd.c,v 1.123 2022/12/03 06:08:18 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rd.c,v 1.124 2022/12/03 16:56:40 tsutsui Exp $");
 
 #include "opt_useleds.h"
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 



CVS commit: src/sys/arch/hp300/dev

2022-12-03 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Dec  3 16:56:41 UTC 2022

Modified Files:
src/sys/arch/hp300/dev: rd.c

Log Message:
Explicitly include  for hz(9) as man pages says.

XXX: it looks sys/param.h r1.615 and later also has extern int hz


To generate a diff of this commit:
cvs rdiff -u -r1.123 -r1.124 src/sys/arch/hp300/dev/rd.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

2022-12-03 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Sat Dec  3 16:06:20 UTC 2022

Modified Files:
src/sys/dev/ic: bwfm.c bwfmvar.h
src/sys/dev/sdmmc: if_bwfm_sdio.c

Log Message:
Fix bug in protocol parser that often caused fatal 'checksum error'.
Defer power save setting to interface start.
More verbose on errors.
Allow build without FDT.


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/sys/dev/ic/bwfm.c
cvs rdiff -u -r1.13 -r1.14 src/sys/dev/ic/bwfmvar.h
cvs rdiff -u -r1.29 -r1.30 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/ic/bwfm.c
diff -u src/sys/dev/ic/bwfm.c:1.32 src/sys/dev/ic/bwfm.c:1.33
--- src/sys/dev/ic/bwfm.c:1.32	Mon Mar 14 06:40:12 2022
+++ src/sys/dev/ic/bwfm.c	Sat Dec  3 16:06:20 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: bwfm.c,v 1.32 2022/03/14 06:40:12 mlelstv Exp $ */
+/* $NetBSD: bwfm.c,v 1.33 2022/12/03 16:06:20 mlelstv Exp $ */
 /* $OpenBSD: bwfm.c,v 1.5 2017/10/16 22:27:16 patrick Exp $ */
 /*
  * Copyright (c) 2010-2016 Broadcom Corporation
@@ -508,6 +508,12 @@ bwfm_start(struct ifnet *ifp)
 
 	/* TODO: return if no link? */
 
+	if (sc->sc_setpm) {
+		sc->sc_setpm = false;
+		if (bwfm_fwvar_cmd_set_int(sc, BWFM_C_SET_PM, sc->sc_pm))
+			printf("%s: could not set power\n", DEVNAME(sc));
+	}
+
 	for (;;) {
 		/* Discard management packets (fw handles this for us) */
 		IF_DEQUEUE(>ic_mgtq, m);
@@ -548,7 +554,6 @@ bwfm_init(struct ifnet *ifp)
 	struct ieee80211com *ic = >sc_ic;
 	uint8_t evmask[BWFM_EVENT_MASK_LEN];
 	struct bwfm_join_pref_params join_pref[2];
-	int pm;
 
 	if (bwfm_fwvar_var_set_int(sc, "mpc", 1)) {
 		printf("%s: could not set mpc\n", DEVNAME(sc));
@@ -630,15 +635,12 @@ bwfm_init(struct ifnet *ifp)
  * Use CAM (constantly awake) when we are running as AP
  * otherwise use fast power saving.
  */
-	pm = BWFM_PM_FAST_PS;
+	sc->sc_pm = BWFM_PM_FAST_PS;
 #ifndef IEEE80211_STA_ONLY
 	if (ic->ic_opmode == IEEE80211_M_HOSTAP)
-		pm = BWFM_PM_CAM;
+		sc->sc_pm = BWFM_PM_CAM;
 #endif
-	if (bwfm_fwvar_cmd_set_int(sc, BWFM_C_SET_PM, pm)) {
-		printf("%s: could not set power\n", DEVNAME(sc));
-		return EIO;
-	}
+	sc->sc_setpm = true;
 
 	bwfm_fwvar_var_set_int(sc, "txbf", 1);
 	bwfm_fwvar_cmd_set_int(sc, BWFM_C_UP, 0);
@@ -702,6 +704,8 @@ bwfm_stop(struct ifnet *ifp, int disable
 
 	if (sc->sc_bus_ops->bs_stop)
 		sc->sc_bus_ops->bs_stop(sc);
+
+	sc->sc_setpm = true;
 }
 
 void
@@ -728,22 +732,25 @@ bwfm_ioctl(struct ifnet *ifp, u_long cmd
 {
 	struct bwfm_softc *sc = ifp->if_softc;
 	struct ieee80211com *ic = >sc_ic;
-	int s, error = 0;
+	int s, error = 0, oflags;
 
 	s = splnet();
 
 	switch (cmd) {
 	case SIOCSIFFLAGS:
+		oflags = ifp->if_flags;
 		if ((error = ifioctl_common(ifp, cmd, data)) != 0)
 			break;
 		switch (ifp->if_flags & (IFF_UP | IFF_RUNNING)) {
 		case IFF_UP | IFF_RUNNING:
 			break;
 		case IFF_UP:
-			bwfm_init(ifp);
+			if ((oflags & IFF_UP) == 0)
+bwfm_init(ifp);
 			break;
 		case IFF_RUNNING:
-			bwfm_stop(ifp, 1);
+			if ((oflags & IFF_UP) != 0)
+bwfm_stop(ifp, 1);
 			break;
 		case 0:
 			break;

Index: src/sys/dev/ic/bwfmvar.h
diff -u src/sys/dev/ic/bwfmvar.h:1.13 src/sys/dev/ic/bwfmvar.h:1.14
--- src/sys/dev/ic/bwfmvar.h:1.13	Mon Mar 14 06:40:12 2022
+++ src/sys/dev/ic/bwfmvar.h	Sat Dec  3 16:06:20 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: bwfmvar.h,v 1.13 2022/03/14 06:40:12 mlelstv Exp $ */
+/* $NetBSD: bwfmvar.h,v 1.14 2022/12/03 16:06:20 mlelstv Exp $ */
 /* $OpenBSD: bwfmvar.h,v 1.1 2017/10/11 17:19:50 patrick Exp $ */
 /*
  * Copyright (c) 2010-2016 Broadcom Corporation
@@ -245,6 +245,9 @@ struct bwfm_softc {
 	size_t			sc_txcapsize;
 	uint8_t			*sc_cal;
 	size_t			sc_calsize;
+
+	int			sc_pm;
+	bool			sc_setpm;
 };
 
 void bwfm_attach(struct bwfm_softc *);

Index: src/sys/dev/sdmmc/if_bwfm_sdio.c
diff -u src/sys/dev/sdmmc/if_bwfm_sdio.c:1.29 src/sys/dev/sdmmc/if_bwfm_sdio.c:1.30
--- src/sys/dev/sdmmc/if_bwfm_sdio.c:1.29	Sat Jun 18 08:22:10 2022
+++ src/sys/dev/sdmmc/if_bwfm_sdio.c	Sat Dec  3 16:06:20 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: if_bwfm_sdio.c,v 1.29 2022/06/18 08:22:10 skrll Exp $ */
+/* $NetBSD: if_bwfm_sdio.c,v 1.30 2022/12/03 16:06:20 mlelstv Exp $ */
 /* $OpenBSD: if_bwfm_sdio.c,v 1.1 2017/10/11 17:19:50 patrick Exp $ */
 /*
  * Copyright (c) 2010-2016 Broadcom Corporation
@@ -17,6 +17,10 @@
  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
+#ifdef _KERNEL_OPT
+#include "opt_fdt.h"
+#endif
+
 #include 
 #include 
 
@@ -41,7 +45,9 @@
 
 #include 
 
+#ifdef FDT
 #include 
+#endif
 #include 
 #include 
 #include 
@@ -113,8 +119,10 @@ static int	bwfm_sdio_match(device_t, cfd
 static void	bwfm_sdio_attach(device_t, device_t, void *);
 static int	bwfm_sdio_detach(device_t, int);
 static void	bwfm_sdio_attachhook(device_t);
+#ifdef FDT
 static int	bwfm_fdt_find_phandle(device_t, device_t);
-static const char 

CVS commit: src/sys/dev

2022-12-03 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Sat Dec  3 16:06:20 UTC 2022

Modified Files:
src/sys/dev/ic: bwfm.c bwfmvar.h
src/sys/dev/sdmmc: if_bwfm_sdio.c

Log Message:
Fix bug in protocol parser that often caused fatal 'checksum error'.
Defer power save setting to interface start.
More verbose on errors.
Allow build without FDT.


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/sys/dev/ic/bwfm.c
cvs rdiff -u -r1.13 -r1.14 src/sys/dev/ic/bwfmvar.h
cvs rdiff -u -r1.29 -r1.30 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/lib/libc/arch/mips/sys

2022-12-03 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Dec  3 14:04:39 UTC 2022

Modified Files:
src/lib/libc/arch/mips/sys: cerror.S

Log Message:
Trailing whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/lib/libc/arch/mips/sys/cerror.S

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

Modified files:

Index: src/lib/libc/arch/mips/sys/cerror.S
diff -u src/lib/libc/arch/mips/sys/cerror.S:1.20 src/lib/libc/arch/mips/sys/cerror.S:1.21
--- src/lib/libc/arch/mips/sys/cerror.S:1.20	Sat Feb  6 06:58:59 2021
+++ src/lib/libc/arch/mips/sys/cerror.S	Sat Dec  3 14:04:39 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: cerror.S,v 1.20 2021/02/06 06:58:59 simonb Exp $	*/
+/*	$NetBSD: cerror.S,v 1.21 2022/12/03 14:04:39 skrll Exp $	*/
 
 /*-
  * Copyright (c) 1991, 1993
@@ -38,7 +38,7 @@
 #if 0
 	RCSID("from: @(#)cerror.s	8.1 (Berkeley) 6/16/93")
 #else
-	RCSID("$NetBSD: cerror.S,v 1.20 2021/02/06 06:58:59 simonb Exp $")
+	RCSID("$NetBSD: cerror.S,v 1.21 2022/12/03 14:04:39 skrll Exp $")
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -78,7 +78,7 @@ NESTED_NOPROFILE(__cerror, CALLFRAME_SIZ
 	# on the stack and not in the t3 reg (for the n32/n64 case).
 	j		ra
 END(__cerror)
-#else		
+#else
 	.globl	_C_LABEL(errno)
 LEAF_NOPROFILE(__cerror)
 	PIC_PROLOGUE(__cerror)



CVS commit: src/lib/libc/arch/mips/sys

2022-12-03 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Dec  3 14:04:39 UTC 2022

Modified Files:
src/lib/libc/arch/mips/sys: cerror.S

Log Message:
Trailing whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/lib/libc/arch/mips/sys/cerror.S

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



CVS commit: src/common/lib/libc/arch/arm/string

2022-12-03 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Dec  3 11:34:38 UTC 2022

Modified Files:
src/common/lib/libc/arch/arm/string: strlen_arm.S

Log Message:
Fix some comments


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/common/lib/libc/arch/arm/string/strlen_arm.S

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

Modified files:

Index: src/common/lib/libc/arch/arm/string/strlen_arm.S
diff -u src/common/lib/libc/arch/arm/string/strlen_arm.S:1.9 src/common/lib/libc/arch/arm/string/strlen_arm.S:1.10
--- src/common/lib/libc/arch/arm/string/strlen_arm.S:1.9	Tue May  6 16:02:11 2014
+++ src/common/lib/libc/arch/arm/string/strlen_arm.S	Sat Dec  3 11:34:38 2022
@@ -29,7 +29,7 @@
 
 #include 
 
-RCSID("$NetBSD: strlen_arm.S,v 1.9 2014/05/06 16:02:11 joerg Exp $")
+RCSID("$NetBSD: strlen_arm.S,v 1.10 2022/12/03 11:34:38 skrll Exp $")
 
 #if defined(__thumb__) && !defined(_ARM_ARCH_T2)
 #error Only Thumb2 or ARM supported
@@ -121,9 +121,9 @@ ENTRY(FUNCNAME)
 	 * (other tests for NULs in a word take more instructions/cycles).
 	 */
 	tst	r3, #BYTE0		/* is this byte 0? */
-	tstne	r3, #BYTE1		/*   no, is this byte 0? */
-	tstne	r3, #BYTE2		/*   no, is this byte 0? */
-	tstne	r3, #BYTE3		/*   no, is this byte 0? */
+	tstne	r3, #BYTE1		/*   no, is this byte 1? */
+	tstne	r3, #BYTE2		/*   no, is this byte 2? */
+	tstne	r3, #BYTE3		/*   no, is this byte 3? */
 	bne	.Lmain_loop		/*   no, then get next word */
 #endif
 #if defined(_ARM_ARCH_6)



CVS commit: src/common/lib/libc/arch/arm/string

2022-12-03 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Dec  3 11:34:38 UTC 2022

Modified Files:
src/common/lib/libc/arch/arm/string: strlen_arm.S

Log Message:
Fix some comments


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/common/lib/libc/arch/arm/string/strlen_arm.S

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



CVS commit: src/common/lib/libc/arch/arm/string

2022-12-03 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Dec  3 11:30:24 UTC 2022

Modified Files:
src/common/lib/libc/arch/arm/string: strlen_naive.S

Log Message:
improve a comment


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/common/lib/libc/arch/arm/string/strlen_naive.S

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

Modified files:

Index: src/common/lib/libc/arch/arm/string/strlen_naive.S
diff -u src/common/lib/libc/arch/arm/string/strlen_naive.S:1.8 src/common/lib/libc/arch/arm/string/strlen_naive.S:1.9
--- src/common/lib/libc/arch/arm/string/strlen_naive.S:1.8	Mon Aug 19 17:02:25 2013
+++ src/common/lib/libc/arch/arm/string/strlen_naive.S	Sat Dec  3 11:30:24 2022
@@ -28,7 +28,7 @@
  */
 #include 
 
-RCSID("$NetBSD: strlen_naive.S,v 1.8 2013/08/19 17:02:25 matt Exp $")
+RCSID("$NetBSD: strlen_naive.S,v 1.9 2022/12/03 11:30:24 skrll Exp $")
 
 #ifdef STRNLEN
 /* LINTSTUB: size_t strnlen(const char *, size_t) */
@@ -40,7 +40,7 @@ ENTRY(strnlen)
 #else
 	adds	ip, r0, r1	/* [maxlen] */
 #endif
-1:	cmp	r0, ip		/* is this of string? */
+1:	cmp	r0, ip		/* is this the end of string? */
 	beq	2f		/*   yes it is */
 #ifdef __thumb__
 	ldrb	r2, [r0]	/* read a byte */



CVS commit: src/common/lib/libc/arch/arm/string

2022-12-03 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Dec  3 11:30:24 UTC 2022

Modified Files:
src/common/lib/libc/arch/arm/string: strlen_naive.S

Log Message:
improve a comment


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/common/lib/libc/arch/arm/string/strlen_naive.S

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



CVS commit: src/sys/dev/ic

2022-12-03 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Dec  3 11:28:38 UTC 2022

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

Log Message:
KNF a comment


To generate a diff of this commit:
cvs rdiff -u -r1.379 -r1.380 src/sys/dev/ic/com.c

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

Modified files:

Index: src/sys/dev/ic/com.c
diff -u src/sys/dev/ic/com.c:1.379 src/sys/dev/ic/com.c:1.380
--- src/sys/dev/ic/com.c:1.379	Wed Oct 26 23:38:09 2022
+++ src/sys/dev/ic/com.c	Sat Dec  3 11:28:38 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: com.c,v 1.379 2022/10/26 23:38:09 riastradh Exp $ */
+/* $NetBSD: com.c,v 1.380 2022/12/03 11:28:38 skrll Exp $ */
 
 /*-
  * Copyright (c) 1998, 1999, 2004, 2008 The NetBSD Foundation, Inc.
@@ -70,7 +70,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: com.c,v 1.379 2022/10/26 23:38:09 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: com.c,v 1.380 2022/12/03 11:28:38 skrll Exp $");
 
 #include "opt_com.h"
 #include "opt_ddb.h"
@@ -2771,8 +2771,10 @@ com_kgdb_putc(void *arg, int c)
 }
 #endif /* KGDB */
 
-/* helper function to identify the com ports used by
- console or KGDB (and not yet autoconf attached) */
+/*
+ * helper function to identify the com ports used by
+ * console or KGDB (and not yet autoconf attached)
+ */
 int
 com_is_console(bus_space_tag_t iot, bus_addr_t iobase, bus_space_handle_t *ioh)
 {



CVS commit: src/sys/dev/ic

2022-12-03 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Dec  3 11:28:38 UTC 2022

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

Log Message:
KNF a comment


To generate a diff of this commit:
cvs rdiff -u -r1.379 -r1.380 src/sys/dev/ic/com.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/include

2022-12-03 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Dec  3 11:09:59 UTC 2022

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

Log Message:
leading whitespace... oops


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/sys/arch/riscv/include/sysreg.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/sysreg.h
diff -u src/sys/arch/riscv/include/sysreg.h:1.27 src/sys/arch/riscv/include/sysreg.h:1.28
--- src/sys/arch/riscv/include/sysreg.h:1.27	Fri Nov 18 06:53:06 2022
+++ src/sys/arch/riscv/include/sysreg.h	Sat Dec  3 11:09:59 2022
@@ -1,4 +1,4 @@
- /* $NetBSD: sysreg.h,v 1.27 2022/11/18 06:53:06 skrll Exp $ */
+/* $NetBSD: sysreg.h,v 1.28 2022/12/03 11:09:59 skrll Exp $ */
 
 /*
  * Copyright (c) 2014 The NetBSD Foundation, Inc.



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

2022-12-03 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Dec  3 11:09:59 UTC 2022

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

Log Message:
leading whitespace... oops


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/sys/arch/riscv/include/sysreg.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/sifive

2022-12-03 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Dec  3 09:40:56 UTC 2022

Modified Files:
src/sys/arch/riscv/sifive: files.sifive

Log Message:
Trailing whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/riscv/sifive/files.sifive

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/sifive/files.sifive
diff -u src/sys/arch/riscv/sifive/files.sifive:1.1 src/sys/arch/riscv/sifive/files.sifive:1.2
--- src/sys/arch/riscv/sifive/files.sifive:1.1	Fri Nov 25 12:35:44 2022
+++ src/sys/arch/riscv/sifive/files.sifive	Sat Dec  3 09:40:56 2022
@@ -1,10 +1,10 @@
-#	$NetBSD: files.sifive,v 1.1 2022/11/25 12:35:44 jmcneill Exp $
+#	$NetBSD: files.sifive,v 1.2 2022/12/03 09:40:56 skrll Exp $
 #
 # Configuration info for SiFive SoCs
 #
 #
 
 # FU540 Power Reset Clocking Interrupt (PRCI) subsystem
-device	prci	
+device	prci
 attach	prci at fdt with fu540_prci
 file	arch/riscv/sifive/fu540_prci.c		fu540_prci



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

2022-12-03 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Dec  3 09:40:56 UTC 2022

Modified Files:
src/sys/arch/riscv/sifive: files.sifive

Log Message:
Trailing whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/riscv/sifive/files.sifive

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



CVS commit: src/libexec/ld.elf_so/arch/riscv

2022-12-03 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Dec  3 09:39:44 UTC 2022

Modified Files:
src/libexec/ld.elf_so/arch/riscv: mdreloc.c rtld_start.S

Log Message:
Trailing whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/libexec/ld.elf_so/arch/riscv/mdreloc.c
cvs rdiff -u -r1.2 -r1.3 src/libexec/ld.elf_so/arch/riscv/rtld_start.S

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



CVS commit: src/libexec/ld.elf_so/arch/riscv

2022-12-03 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Dec  3 09:39:44 UTC 2022

Modified Files:
src/libexec/ld.elf_so/arch/riscv: mdreloc.c rtld_start.S

Log Message:
Trailing whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/libexec/ld.elf_so/arch/riscv/mdreloc.c
cvs rdiff -u -r1.2 -r1.3 src/libexec/ld.elf_so/arch/riscv/rtld_start.S

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

Modified files:

Index: src/libexec/ld.elf_so/arch/riscv/mdreloc.c
diff -u src/libexec/ld.elf_so/arch/riscv/mdreloc.c:1.5 src/libexec/ld.elf_so/arch/riscv/mdreloc.c:1.6
--- src/libexec/ld.elf_so/arch/riscv/mdreloc.c:1.5	Mon Apr 15 19:13:03 2019
+++ src/libexec/ld.elf_so/arch/riscv/mdreloc.c	Sat Dec  3 09:39:44 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: mdreloc.c,v 1.5 2019/04/15 19:13:03 maya Exp $	*/
+/*	$NetBSD: mdreloc.c,v 1.6 2022/12/03 09:39:44 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: mdreloc.c,v 1.5 2019/04/15 19:13:03 maya Exp $");
+__RCSID("$NetBSD: mdreloc.c,v 1.6 2022/12/03 09:39:44 skrll Exp $");
 #endif /* not lint */
 
 #include 
@@ -256,7 +256,7 @@ _rtld_bind(const Obj_Entry *obj, Elf_Wor
 int
 _rtld_relocate_plt_objects(const Obj_Entry *obj)
 {
-	
+
 	for (const Elf_Rel *rel = obj->pltrel; rel < obj->pltrellim; rel++) {
 		if (_rtld_relocate_plt_object(obj, rel, NULL) < 0)
 			return -1;

Index: src/libexec/ld.elf_so/arch/riscv/rtld_start.S
diff -u src/libexec/ld.elf_so/arch/riscv/rtld_start.S:1.2 src/libexec/ld.elf_so/arch/riscv/rtld_start.S:1.3
--- src/libexec/ld.elf_so/arch/riscv/rtld_start.S:1.2	Fri Mar 27 23:14:53 2015
+++ src/libexec/ld.elf_so/arch/riscv/rtld_start.S	Sat Dec  3 09:39:44 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: rtld_start.S,v 1.2 2015/03/27 23:14:53 matt Exp $	*/
+/*	$NetBSD: rtld_start.S,v 1.3 2022/12/03 09:39:44 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -110,7 +110,7 @@ ENTRY_NP(_rtld_bind_start)
 	REG_L	a5, XCALLFRAME_A5(sp)
 	REG_L	a6, XCALLFRAME_A6(sp)
 	REG_L	a7, XCALLFRAME_A7(sp)
-	REG_L	ra, XCALLFRAME_RA(sp)		
+	REG_L	ra, XCALLFRAME_RA(sp)
 	addi	sp, sp, XCALLFRAME_SIZ
 	jr	t0
 END(_rtld_bind_start)



CVS commit: src/lib/libc/arch/riscv

2022-12-03 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Dec  3 09:38:53 UTC 2022

Modified Files:
src/lib/libc/arch/riscv/gdtoa: gd_qnan.h
src/lib/libc/arch/riscv/gen: fpgetmask.c fpgetround.c fpgetsticky.c
fpsetmask.c fpsetround.c fpsetsticky.c resumecontext.c

Log Message:
Trailing whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/lib/libc/arch/riscv/gdtoa/gd_qnan.h
cvs rdiff -u -r1.1 -r1.2 src/lib/libc/arch/riscv/gen/fpgetmask.c \
src/lib/libc/arch/riscv/gen/fpgetround.c \
src/lib/libc/arch/riscv/gen/fpgetsticky.c \
src/lib/libc/arch/riscv/gen/fpsetmask.c \
src/lib/libc/arch/riscv/gen/fpsetround.c \
src/lib/libc/arch/riscv/gen/fpsetsticky.c \
src/lib/libc/arch/riscv/gen/resumecontext.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/libc/arch/riscv/gdtoa/gd_qnan.h
diff -u src/lib/libc/arch/riscv/gdtoa/gd_qnan.h:1.2 src/lib/libc/arch/riscv/gdtoa/gd_qnan.h:1.3
--- src/lib/libc/arch/riscv/gdtoa/gd_qnan.h:1.2	Sun Apr 14 19:25:27 2019
+++ src/lib/libc/arch/riscv/gdtoa/gd_qnan.h	Sat Dec  3 09:38:53 2022
@@ -1,6 +1,6 @@
-/* $NetBSD: gd_qnan.h,v 1.2 2019/04/14 19:25:27 maya Exp $ */
+/* $NetBSD: gd_qnan.h,v 1.3 2022/12/03 09:38:53 skrll Exp $ */
 
-/* 
+/*
  * The RISC-V Instruction Set Manual Volume I: User-Level ISA
  * Document Version 2.2
  *

Index: src/lib/libc/arch/riscv/gen/fpgetmask.c
diff -u src/lib/libc/arch/riscv/gen/fpgetmask.c:1.1 src/lib/libc/arch/riscv/gen/fpgetmask.c:1.2
--- src/lib/libc/arch/riscv/gen/fpgetmask.c:1.1	Fri Sep 19 17:36:25 2014
+++ src/lib/libc/arch/riscv/gen/fpgetmask.c	Sat Dec  3 09:38:53 2022
@@ -1,12 +1,12 @@
-/*	$NetBSD: fpgetmask.c,v 1.1 2014/09/19 17:36:25 matt Exp $	*/
+/*	$NetBSD: fpgetmask.c,v 1.2 2022/12/03 09:38:53 skrll Exp $	*/
 
 /*
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
  * All rights reserved.
- * 
+ *
  * This code is derived from software contributed to The NetBSD Foundation
  * by Dan Winship.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
@@ -15,7 +15,7 @@
  * 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
@@ -31,7 +31,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: fpgetmask.c,v 1.1 2014/09/19 17:36:25 matt Exp $");
+__RCSID("$NetBSD: fpgetmask.c,v 1.2 2022/12/03 09:38:53 skrll Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include "namespace.h"
Index: src/lib/libc/arch/riscv/gen/fpgetround.c
diff -u src/lib/libc/arch/riscv/gen/fpgetround.c:1.1 src/lib/libc/arch/riscv/gen/fpgetround.c:1.2
--- src/lib/libc/arch/riscv/gen/fpgetround.c:1.1	Fri Sep 19 17:36:25 2014
+++ src/lib/libc/arch/riscv/gen/fpgetround.c	Sat Dec  3 09:38:53 2022
@@ -1,12 +1,12 @@
-/*	$NetBSD: fpgetround.c,v 1.1 2014/09/19 17:36:25 matt Exp $	*/
+/*	$NetBSD: fpgetround.c,v 1.2 2022/12/03 09:38:53 skrll Exp $	*/
 
 /*
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
  * All rights reserved.
- * 
+ *
  * This code is derived from software contributed to The NetBSD Foundation
  * by Dan Winship.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
@@ -15,7 +15,7 @@
  * 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
@@ -31,7 +31,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: fpgetround.c,v 1.1 2014/09/19 17:36:25 matt Exp $");
+__RCSID("$NetBSD: fpgetround.c,v 1.2 2022/12/03 09:38:53 skrll Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include "namespace.h"
Index: src/lib/libc/arch/riscv/gen/fpgetsticky.c
diff -u src/lib/libc/arch/riscv/gen/fpgetsticky.c:1.1 src/lib/libc/arch/riscv/gen/fpgetsticky.c:1.2
--- src/lib/libc/arch/riscv/gen/fpgetsticky.c:1.1	Fri Sep 19 17:36:25 2014
+++ src/lib/libc/arch/riscv/gen/fpgetsticky.c	Sat Dec  3 09:38:53 2022
@@ -1,12 +1,12 @@
-/*	$NetBSD: fpgetsticky.c,v 1.1 2014/09/19 17:36:25 matt Exp $	*/
+/*	$NetBSD: fpgetsticky.c,v 1.2 2022/12/03 09:38:53 skrll 

CVS commit: src/lib/libc/arch/riscv

2022-12-03 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Dec  3 09:38:53 UTC 2022

Modified Files:
src/lib/libc/arch/riscv/gdtoa: gd_qnan.h
src/lib/libc/arch/riscv/gen: fpgetmask.c fpgetround.c fpgetsticky.c
fpsetmask.c fpsetround.c fpsetsticky.c resumecontext.c

Log Message:
Trailing whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/lib/libc/arch/riscv/gdtoa/gd_qnan.h
cvs rdiff -u -r1.1 -r1.2 src/lib/libc/arch/riscv/gen/fpgetmask.c \
src/lib/libc/arch/riscv/gen/fpgetround.c \
src/lib/libc/arch/riscv/gen/fpgetsticky.c \
src/lib/libc/arch/riscv/gen/fpsetmask.c \
src/lib/libc/arch/riscv/gen/fpsetround.c \
src/lib/libc/arch/riscv/gen/fpsetsticky.c \
src/lib/libc/arch/riscv/gen/resumecontext.c

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



CVS commit: src/libexec/ld.elf_so/arch/aarch64

2022-12-03 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Dec  3 09:10:40 UTC 2022

Modified Files:
src/libexec/ld.elf_so/arch/aarch64: mdreloc.c

Log Message:
Whitespace. NFC.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/libexec/ld.elf_so/arch/aarch64/mdreloc.c

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

Modified files:

Index: src/libexec/ld.elf_so/arch/aarch64/mdreloc.c
diff -u src/libexec/ld.elf_so/arch/aarch64/mdreloc.c:1.16 src/libexec/ld.elf_so/arch/aarch64/mdreloc.c:1.17
--- src/libexec/ld.elf_so/arch/aarch64/mdreloc.c:1.16	Tue Jun 21 06:52:17 2022
+++ src/libexec/ld.elf_so/arch/aarch64/mdreloc.c	Sat Dec  3 09:10:40 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: mdreloc.c,v 1.16 2022/06/21 06:52:17 skrll Exp $ */
+/* $NetBSD: mdreloc.c,v 1.17 2022/12/03 09:10:40 skrll Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -60,7 +60,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: mdreloc.c,v 1.16 2022/06/21 06:52:17 skrll Exp $");
+__RCSID("$NetBSD: mdreloc.c,v 1.17 2022/12/03 09:10:40 skrll Exp $");
 #endif /* not lint */
 
 #include 
@@ -288,15 +288,14 @@ _rtld_relocate_nonplt_objects(Obj_Entry 
 			rdbg(("TLS_DTPREL %s in %s --> %p",
 			obj->strtab + obj->symtab[symnum].st_name,
 			obj->path, (void *)*where));
-
 			break;
+
 		case R_TLS_TYPE(TLS_DTPMOD):
 			*where = (Elf_Addr)(defobj->tlsindex);
 
 			rdbg(("TLS_DTPMOD %s in %s --> %p",
 			obj->strtab + obj->symtab[symnum].st_name,
 			obj->path, (void *)*where));
-
 			break;
 
 		case R_TLS_TYPE(TLS_TPREL):



CVS commit: src/libexec/ld.elf_so/arch/aarch64

2022-12-03 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Dec  3 09:10:40 UTC 2022

Modified Files:
src/libexec/ld.elf_so/arch/aarch64: mdreloc.c

Log Message:
Whitespace. NFC.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/libexec/ld.elf_so/arch/aarch64/mdreloc.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/include

2022-12-03 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Dec  3 08:54:39 UTC 2022

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

Log Message:
Correct some pre-existing relocations and add some new ones.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/riscv/include/elf_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/riscv/include/elf_machdep.h
diff -u src/sys/arch/riscv/include/elf_machdep.h:1.8 src/sys/arch/riscv/include/elf_machdep.h:1.9
--- src/sys/arch/riscv/include/elf_machdep.h:1.8	Sat Mar 14 16:12:16 2020
+++ src/sys/arch/riscv/include/elf_machdep.h	Sat Dec  3 08:54:38 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: elf_machdep.h,v 1.8 2020/03/14 16:12:16 skrll Exp $ */
+/* $NetBSD: elf_machdep.h,v 1.9 2022/12/03 08:54:38 skrll Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -65,8 +65,8 @@
 #define R_RISCV_COPY		4
 #define R_RISCV_JMP_SLOT	5
 #define R_RISCV_TLS_DTPMOD32	6
-#define R_RISCV_TLS_DTPREL32	7
-#define R_RISCV_TLS_DTPMOD64	8
+#define R_RISCV_TLS_DTPMOD64	7
+#define R_RISCV_TLS_DTPREL32	8
 #define R_RISCV_TLS_DTPREL64	9
 #define R_RISCV_TLS_TPREL32	10
 #define R_RISCV_TLS_TPREL64	11
@@ -86,9 +86,9 @@
 #define R_RISCV_LO12_I		27	// (A >> 16) & 0x
 #define R_RISCV_LO12_S		28	// (S + A - P) >> 2
 #define R_RISCV_TPREL_HI20	29
-#define R_RISCV_TLREL_LO12_I	30
-#define R_RISCV_TLREL_LO12_S	31
-#define R_RISCV_TLREL_ADD	32
+#define R_RISCV_TPREL_LO12_I	30
+#define R_RISCV_TPREL_LO12_S	31
+#define R_RISCV_TPREL_ADD	32
 #define R_RISCV_ADD8		33
 #define R_RISCV_ADD16		34
 #define R_RISCV_ADD32		35
@@ -102,6 +102,18 @@
 #define R_RISCV_ALIGN		43
 #define R_RISCV_RVC_BRANCH	44
 #define R_RISCV_RVC_JUMP	45
+#define R_RISCV_RVC_LUI		46
+#define R_RISCV_GPREL_I		47
+#define R_RISCV_GPREL_S		48
+#define R_RISCV_TPREL_I		49
+#define R_RISCV_TPREL_S		50
+#define R_RISCV_RELAX		51
+#define R_RISCV_SUB6		52
+#define R_RISCV_SET6		53
+#define R_RISCV_SET8		54
+#define R_RISCV_SET16		55
+#define R_RISCV_SET32		56
+#define R_RISCV_32_PCREL	57
 
 /* These are aliases we can use R_TYPESZ */
 #define R_RISCV_ADDR32		R_RISCV_32



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

2022-12-03 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Dec  3 08:54:39 UTC 2022

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

Log Message:
Correct some pre-existing relocations and add some new ones.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/riscv/include/elf_machdep.h

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