CVS commit: src/sys/kern

2023-07-28 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Sat Jul 29 04:06:32 UTC 2023

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

Log Message:
remove extra `_' to fix debug build


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/kern/sys_epoll.c

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

Modified files:

Index: src/sys/kern/sys_epoll.c
diff -u src/sys/kern/sys_epoll.c:1.1 src/sys/kern/sys_epoll.c:1.2
--- src/sys/kern/sys_epoll.c:1.1	Fri Jul 28 18:19:01 2023
+++ src/sys/kern/sys_epoll.c	Sat Jul 29 04:06:32 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: sys_epoll.c,v 1.1 2023/07/28 18:19:01 christos Exp $	*/
+/*	$NetBSD: sys_epoll.c,v 1.2 2023/07/29 04:06:32 pgoyette Exp $	*/
 
 /*-
  * SPDX-License-Identifier: BSD-2-Clause
@@ -28,7 +28,7 @@
  * SUCH DAMAGE.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sys_epoll.c,v 1.1 2023/07/28 18:19:01 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sys_epoll.c,v 1.2 2023/07/29 04:06:32 pgoyette Exp $");
 
 
 #include 
@@ -325,7 +325,7 @@ epoll_ctl_common(struct lwp *l, register
 		return epoll_delete_all_events(retval, epfd, fd);
 
 	default:
-		DPRINTF(("%s: invalid op %d\n", ___func__, op));
+		DPRINTF(("%s: invalid op %d\n", __func__, op));
 		return EINVAL;
 	}
 



CVS commit: src/sys/kern

2023-07-28 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Sat Jul 29 04:06:32 UTC 2023

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

Log Message:
remove extra `_' to fix debug build


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/kern/sys_epoll.c

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



CVS commit: src/lib/libc/sys

2023-07-28 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Fri Jul 28 23:41:16 UTC 2023

Modified Files:
src/lib/libc/sys: epoll.2 kqueue.2

Log Message:
Fix some macro( usage)s


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/lib/libc/sys/epoll.2
cvs rdiff -u -r1.59 -r1.60 src/lib/libc/sys/kqueue.2

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



CVS commit: src/lib/libc/sys

2023-07-28 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Fri Jul 28 23:41:16 UTC 2023

Modified Files:
src/lib/libc/sys: epoll.2 kqueue.2

Log Message:
Fix some macro( usage)s


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/lib/libc/sys/epoll.2
cvs rdiff -u -r1.59 -r1.60 src/lib/libc/sys/kqueue.2

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

Modified files:

Index: src/lib/libc/sys/epoll.2
diff -u src/lib/libc/sys/epoll.2:1.1 src/lib/libc/sys/epoll.2:1.2
--- src/lib/libc/sys/epoll.2:1.1	Fri Jul 28 18:19:00 2023
+++ src/lib/libc/sys/epoll.2	Fri Jul 28 23:41:16 2023
@@ -1,4 +1,4 @@
-.\"	$NetBSD: epoll.2,v 1.1 2023/07/28 18:19:00 christos Exp $
+.\"	$NetBSD: epoll.2,v 1.2 2023/07/28 23:41:16 wiz Exp $
 .\"
 .\" Copyright (c) 2023 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -94,16 +94,16 @@ The
 field is passed through the kernel and is intended to be used to identify the
 event.
 When used with
-.Fa epoll_ctl ,
+.Fn epoll_ctl ,
 the
 .Va events
 field consists of a mask of the events that the
 .Nm
 instance should watch for, and when being used with
-.Fa epoll_wait ,
-.Fa epoll_pwait ,
+.Fn epoll_wait ,
+.Fn epoll_pwait ,
 and
-.Fa epoll_pwait2
+.Fn epoll_pwait2
 consists of a mask of the events that occurred.
 The following are possible values for
 .Va events :
@@ -155,7 +155,7 @@ of
 to set the
 .Xr close 2
 on
-.Xr exec 2
+.Xr exec 3
 flag.
 .Pp
 .Fn epoll_ctl
@@ -216,9 +216,9 @@ should be specified as
 .Dv NULL .
 Additionally,
 a sigmask may be specified to
-.Fa epoll_pwait
+.Fn epoll_pwait
 and
-.Fa epoll_pwait2
+.Fn epoll_pwait2
 in
 .Fa sigmask
 to set the sigmask while

Index: src/lib/libc/sys/kqueue.2
diff -u src/lib/libc/sys/kqueue.2:1.59 src/lib/libc/sys/kqueue.2:1.60
--- src/lib/libc/sys/kqueue.2:1.59	Fri Jul 28 18:19:00 2023
+++ src/lib/libc/sys/kqueue.2	Fri Jul 28 23:41:16 2023
@@ -1,4 +1,4 @@
-.\"	$NetBSD: kqueue.2,v 1.59 2023/07/28 18:19:00 christos Exp $
+.\"	$NetBSD: kqueue.2,v 1.60 2023/07/28 23:41:16 wiz Exp $
 .\"
 .\" Copyright (c) 2000 Jonathan Lemon
 .\" All rights reserved.
@@ -571,7 +571,7 @@ contains the number of times the timeout
 This filter automatically sets
 .Dv EV_CLEAR
 in
-.va flags
+.Va flags
 for periodic timers.
 Timers created with
 .Dv NOTE_ABSTIME
@@ -582,7 +582,7 @@ or
 are also specified.
 .Dv CLOCK_REALTIME
 is the reference clock for timers created with
-.Dv NOTE_ABSTIME.
+.Dv NOTE_ABSTIME .
 .Pp
 The filter accepts the following flags in the
 .Va fflags



CVS commit: src/lib/libc/sys

2023-07-28 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Fri Jul 28 23:41:02 UTC 2023

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

Log Message:
Remove Pp that have no effect.


To generate a diff of this commit:
cvs rdiff -u -r1.50 -r1.51 src/lib/libc/sys/socket.2

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

Modified files:

Index: src/lib/libc/sys/socket.2
diff -u src/lib/libc/sys/socket.2:1.50 src/lib/libc/sys/socket.2:1.51
--- src/lib/libc/sys/socket.2:1.50	Thu Jul 20 23:28:44 2023
+++ src/lib/libc/sys/socket.2	Fri Jul 28 23:41:02 2023
@@ -1,4 +1,4 @@
-.\"	$NetBSD: socket.2,v 1.50 2023/07/20 23:28:44 gutteridge Exp $
+.\"	$NetBSD: socket.2,v 1.51 2023/07/28 23:41:02 wiz Exp $
 .\"
 .\" Copyright (c) 1983, 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -53,7 +53,6 @@ which should be used.
 These families are defined in the include file
 .Ao Pa sys/socket.h Ac .
 The currently understood formats are:
-.Pp
 .Bl -column -offset indent ".Dv PF_APPLETALK"
 .It Dv PF_LOCAL Ta local domain Po previously Tn UNIX domain Pc protocols
 .It Dv PF_INET Ta Tn ARPA Internet protocols
@@ -68,7 +67,6 @@ The socket has the indicated
 .Fa type ,
 which specifies the semantics of communication.
 Currently defined types are:
-.Pp
 .Bl -tag -offset indent -width Dv
 .It Dv SOCK_STREAM
 Provides sequenced, reliable, two-way connection based byte streams.
@@ -91,7 +89,6 @@ Not implemented.
 .Pp
 The following flags can be or'ed to the socket type to add conditions to
 the returned file descriptor:
-.Pp
 .Bl -tag -offset indent -width Dv
 .It Dv SOCK_CLOEXEC
 Set the close on exec property.



CVS commit: src/lib/libc/sys

2023-07-28 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Fri Jul 28 23:41:02 UTC 2023

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

Log Message:
Remove Pp that have no effect.


To generate a diff of this commit:
cvs rdiff -u -r1.50 -r1.51 src/lib/libc/sys/socket.2

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



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

2023-07-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Jul 28 22:05:44 UTC 2023

Modified Files:
src/tests/usr.bin/xlint/lint1: c11.c c23.c

Log Message:
tests/lint: test declarations in C11 and C23


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/usr.bin/xlint/lint1/c11.c
cvs rdiff -u -r1.6 -r1.7 src/tests/usr.bin/xlint/lint1/c23.c

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



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

2023-07-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Jul 28 22:05:44 UTC 2023

Modified Files:
src/tests/usr.bin/xlint/lint1: c11.c c23.c

Log Message:
tests/lint: test declarations in C11 and C23


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/usr.bin/xlint/lint1/c11.c
cvs rdiff -u -r1.6 -r1.7 src/tests/usr.bin/xlint/lint1/c23.c

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

Modified files:

Index: src/tests/usr.bin/xlint/lint1/c11.c
diff -u src/tests/usr.bin/xlint/lint1/c11.c:1.3 src/tests/usr.bin/xlint/lint1/c11.c:1.4
--- src/tests/usr.bin/xlint/lint1/c11.c:1.3	Thu Jul 13 20:30:21 2023
+++ src/tests/usr.bin/xlint/lint1/c11.c	Fri Jul 28 22:05:44 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: c11.c,v 1.3 2023/07/13 20:30:21 rillig Exp $	*/
+/*	$NetBSD: c11.c,v 1.4 2023/07/28 22:05:44 rillig Exp $	*/
 # 3 "c11.c"
 
 /*
@@ -6,7 +6,7 @@
  * functions, anonymous struct/union members, and several more.
  */
 
-/* lint1-flags: -Ac11 -w -X 236 -X 351 */
+/* lint1-flags: -Ac11 -w -X 192,231,236,351 */
 
 _Noreturn void exit(int);
 void _Noreturn exit(int);
@@ -42,6 +42,109 @@ three_times(void)
 	exit(0);
 }
 
+
+_Static_assert(1 > 0, "string");
+/* XXX: requires C23 or later */
+_Static_assert(1 > 0);
+
+
+// C11 6.7.6.1p3
+const int *ptr_to_constant;
+int *const constant_ptr;
+
+// C11 6.7.6.1p4
+typedef int *int_ptr;
+const int_ptr constant_ptr;
+
+// C11 6.7.6.2p7
+float fa[11], *afp[17];
+
+// C11 6.7.6.2p8
+extern int *x;
+extern int y[];
+
+// C11 6.7.6.2p9
+extern int n;
+extern int m;
+void fcompat(void)
+{
+	int a[n][6][m];
+	int (*p)[4][n+1];
+	int c[n][n][6][m];
+	int (*r)[n][n][n+1];
+	/* expect+2: warning: 'p' set but not used in function 'fcompat' [191] */
+	/* expect+1: warning: illegal combination of 'pointer to array[4] of array[1] of int' and 'pointer to array[6] of array[1] of int', op '=' [124] */
+	p = a;
+	/* expect+2: warning: 'r' set but not used in function 'fcompat' [191] */
+	/* expect+1: warning: illegal combination of 'pointer to array[1] of array[1] of array[1] of int' and 'pointer to array[1] of array[6] of array[1] of int', op '=' [124] */
+	r = c;
+}
+
+// C11 6.7.6.2p10
+extern int n;
+int A[n];
+extern int (*p2)[n];
+int B[100];
+void fvla(int m, int C[m][m]);
+void fvla(int m, int C[m][m])
+{
+	typedef int VLA[m][m];
+	struct tag {
+		int (*y)[n];
+		int z[n];
+	};
+	int D[m];
+	static int E[m];
+	/* expect+1: warning: nested 'extern' declaration of 'F' [352] */
+	extern int F[m];
+	int (*s)[m];
+	/* expect+1: warning: nested 'extern' declaration of 'r' [352] */
+	extern int (*r)[m];
+	/* expect+2: warning: illegal combination of 'pointer to array[1] of int' and 'pointer to int', op 'init' [124] */
+	/* expect+1: warning: 'q' set but not used in function 'fvla' [191] */
+	static int (*q)[m] = 
+}
+
+// C11 6.7.6.3p15
+int f(void), *fip(), (*pfi)();
+
+// C11 6.7.6.3p17
+int (*apfi[3])(int *x, int *y);
+
+// C11 6.7.6.3p18
+int (*fpfi(int (*)(long), int))(int, ...);
+
+// C11 6.7.6.3p19
+void addscalar(int n, int m, double a[n][n*m+300], double x);
+int main(void)
+{
+	double b[4][308];
+	/* expect+1: warning: converting 'pointer to array[308] of double' to incompatible 'pointer to array[1] of double' for argument 3 [153] */
+	addscalar(4, 2, b, 2.17);
+	return 0;
+}
+void addscalar(int n, int m, double a[n][n*m+300], double x)
+{
+	for (int i = 0; i < n; i++)
+		for (int j = 0, k = n*m+300; j < k; j++)
+			a[i][j] += x;
+}
+
+// C11 6.7.6.3p20
+double maximum(int n, int m, double a[n][m]);
+/* expect+1: error: null dimension [17] */
+double maximum(int n, int m, double a[*][*]);
+/* expect+1: error: null dimension [17] */
+double maximum(int n, int m, double a[ ][*]);
+double maximum(int n, int m, double a[ ][m]);
+
+void f1(double (* restrict a)[5]);
+void f2(double a[restrict][5]);
+/* expect+1: error: syntax error '3' [249] */
+void f3(double a[restrict 3][5]);
+void f4(double a[restrict static 3][5]);
+
+
 // In C11 mode, 'thread_local' is not yet known, but '_Thread_local' is.
 /* expect+2: error: old-style declaration; add 'int' [1] */
 /* expect+1: error: syntax error 'int' [249] */

Index: src/tests/usr.bin/xlint/lint1/c23.c
diff -u src/tests/usr.bin/xlint/lint1/c23.c:1.6 src/tests/usr.bin/xlint/lint1/c23.c:1.7
--- src/tests/usr.bin/xlint/lint1/c23.c:1.6	Tue Jul 25 16:56:35 2023
+++ src/tests/usr.bin/xlint/lint1/c23.c	Fri Jul 28 22:05:44 2023
@@ -1,10 +1,11 @@
-/*	$NetBSD: c23.c,v 1.6 2023/07/25 16:56:35 rillig Exp $	*/
+/*	$NetBSD: c23.c,v 1.7 2023/07/28 22:05:44 rillig Exp $	*/
 # 3 "c23.c"
 
 // Tests for the option -Ac23, which allows features from C23 and all earlier
 // ISO standards, but none of the GNU extensions.
 //
 // See also:
+//	c11.c
 //	msg_353.c		for empty initializer braces
 
 /* lint1-flags: -Ac23 -w -X 351 */
@@ -22,6 +23,11 @@ empty_initializer_braces(void)
 	return s.member;
 }
 
+
+_Static_assert(1 > 0, "string");
+_Static_assert(1 > 0);
+
+
 // The 

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

2023-07-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Jul 28 21:50:03 UTC 2023

Modified Files:
src/usr.bin/xlint/lint1: cgram.y debug.c decl.c externs1.h lint1.h

Log Message:
lint: extract 'vararg' and 'prototype' flags from global 'dcs'

These flags are only relevant for parameter lists, so add a separate
type for it.

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.465 -r1.466 src/usr.bin/xlint/lint1/cgram.y
cvs rdiff -u -r1.55 -r1.56 src/usr.bin/xlint/lint1/debug.c
cvs rdiff -u -r1.362 -r1.363 src/usr.bin/xlint/lint1/decl.c
cvs rdiff -u -r1.198 -r1.199 src/usr.bin/xlint/lint1/externs1.h
cvs rdiff -u -r1.195 -r1.196 src/usr.bin/xlint/lint1/lint1.h

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

Modified files:

Index: src/usr.bin/xlint/lint1/cgram.y
diff -u src/usr.bin/xlint/lint1/cgram.y:1.465 src/usr.bin/xlint/lint1/cgram.y:1.466
--- src/usr.bin/xlint/lint1/cgram.y:1.465	Sat Jul 15 21:47:35 2023
+++ src/usr.bin/xlint/lint1/cgram.y	Fri Jul 28 21:50:03 2023
@@ -1,5 +1,5 @@
 %{
-/* $NetBSD: cgram.y,v 1.465 2023/07/15 21:47:35 rillig Exp $ */
+/* $NetBSD: cgram.y,v 1.466 2023/07/28 21:50:03 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -35,7 +35,7 @@
 
 #include 
 #if defined(__RCSID)
-__RCSID("$NetBSD: cgram.y,v 1.465 2023/07/15 21:47:35 rillig Exp $");
+__RCSID("$NetBSD: cgram.y,v 1.466 2023/07/28 21:50:03 rillig Exp $");
 #endif
 
 #include 
@@ -143,6 +143,7 @@ is_either(const char *s, const char *a, 
 	tspec_t	y_tspec;
 	type_qualifiers y_type_qualifiers;
 	function_specifier y_function_specifier;
+	struct parameter_list y_parameter_list;
 	type_t	*y_type;
 	tnode_t	*y_tnode;
 	range_t	y_range;
@@ -351,7 +352,7 @@ is_either(const char *s, const char *a, 
 %type			notype_param_declarator
 %type			direct_param_declarator
 %type			direct_notype_param_declarator
-%type			param_list
+%type		param_list
 /* No type for id_list_lparen. */
 /* No type for abstract_decl_lparen. */
 %type		array_size_opt
@@ -361,10 +362,10 @@ is_either(const char *s, const char *a, 
 %type			abstract_declaration
 %type			abstract_declarator
 %type			direct_abstract_declarator
-%type			abstract_decl_param_list
+%type		abstract_decl_param_list
 /* No type for abstract_decl_lparen. */
-%type			vararg_parameter_type_list
-%type			parameter_type_list
+%type		vararg_parameter_type_list
+%type		parameter_type_list
 %type			parameter_declaration
 /* No type for braced_initializer. */
 /* No type for initializer. */
@@ -1411,7 +1412,7 @@ direct_notype_param_declarator:
 
 param_list:
 	id_list_lparen identifier_list T_RPAREN {
-		$$ = $2;
+		$$ = (struct parameter_list){ .first = $2 };
 	}
 |	abstract_decl_param_list
 ;
@@ -1539,15 +1540,15 @@ direct_abstract_declarator:
 
 abstract_decl_param_list:	/* specific to lint */
 	abstract_decl_lparen T_RPAREN type_attribute_opt {
-		$$ = NULL;
+		$$ = (struct parameter_list){ .first = NULL };
 	}
 |	abstract_decl_lparen vararg_parameter_type_list T_RPAREN
 	type_attribute_opt {
-		dcs->d_prototype = true;
 		$$ = $2;
+		$$.prototype = true;
 	}
 |	abstract_decl_lparen error T_RPAREN type_attribute_opt {
-		$$ = NULL;
+		$$ = (struct parameter_list){ .first = NULL };
 	}
 ;
 
@@ -1561,8 +1562,8 @@ abstract_decl_lparen:		/* specific to li
 vararg_parameter_type_list:	/* specific to lint */
 	parameter_type_list
 |	parameter_type_list T_COMMA T_ELLIPSIS {
-		dcs->d_vararg = true;
 		$$ = $1;
+		$$.vararg = true;
 	}
 |	T_ELLIPSIS {
 		/* TODO: C99 6.7.5 makes this an error as well. */
@@ -1573,16 +1574,18 @@ vararg_parameter_type_list:	/* specific 
 			/* ANSI C requires formal parameter before '...' */
 			warning(84);
 		}
-		dcs->d_vararg = true;
-		$$ = NULL;
+		$$ = (struct parameter_list){ .vararg = true };
 	}
 ;
 
 /* XXX: C99 6.7.5 defines the same name, but it looks different. */
 parameter_type_list:
-	parameter_declaration
+	parameter_declaration {
+		$$ = (struct parameter_list){ .first = $1 };
+	}
 |	parameter_type_list T_COMMA parameter_declaration {
-		$$ = concat_symbols($1, $3);
+		$$ = $1;
+		$$.first = concat_symbols($1.first, $3);
 	}
 ;
 

Index: src/usr.bin/xlint/lint1/debug.c
diff -u src/usr.bin/xlint/lint1/debug.c:1.55 src/usr.bin/xlint/lint1/debug.c:1.56
--- src/usr.bin/xlint/lint1/debug.c:1.55	Thu Jul 13 23:27:20 2023
+++ src/usr.bin/xlint/lint1/debug.c	Fri Jul 28 21:50:03 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: debug.c,v 1.55 2023/07/13 23:27:20 rillig Exp $ */
+/* $NetBSD: debug.c,v 1.56 2023/07/28 21:50:03 rillig Exp $ */
 
 /*-
  * Copyright (c) 2021 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
 
 #include 
 #if defined(__RCSID)
-__RCSID("$NetBSD: debug.c,v 1.55 2023/07/13 23:27:20 rillig Exp $");
+__RCSID("$NetBSD: debug.c,v 1.56 2023/07/28 21:50:03 rillig Exp $");
 #endif
 
 #include 
@@ -440,8 +440,6 @@ debug_decl_level(const decl_level *dl)
 	debug_word(dl->d_multiple_storage_classes, 

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

2023-07-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Jul 28 21:50:03 UTC 2023

Modified Files:
src/usr.bin/xlint/lint1: cgram.y debug.c decl.c externs1.h lint1.h

Log Message:
lint: extract 'vararg' and 'prototype' flags from global 'dcs'

These flags are only relevant for parameter lists, so add a separate
type for it.

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.465 -r1.466 src/usr.bin/xlint/lint1/cgram.y
cvs rdiff -u -r1.55 -r1.56 src/usr.bin/xlint/lint1/debug.c
cvs rdiff -u -r1.362 -r1.363 src/usr.bin/xlint/lint1/decl.c
cvs rdiff -u -r1.198 -r1.199 src/usr.bin/xlint/lint1/externs1.h
cvs rdiff -u -r1.195 -r1.196 src/usr.bin/xlint/lint1/lint1.h

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



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

2023-07-28 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jul 28 19:01:45 UTC 2023

Modified Files:
src/sys/compat/linux/arch/aarch64: linux_syscall.h linux_syscallargs.h
linux_syscalls.c linux_sysent.c linux_systrace_args.c
src/sys/compat/linux/arch/alpha: linux_syscall.h linux_syscallargs.h
linux_syscalls.c linux_sysent.c
src/sys/compat/linux/arch/arm: linux_syscall.h linux_syscallargs.h
linux_syscalls.c linux_sysent.c linux_systrace_args.c
src/sys/compat/linux/arch/i386: linux_syscall.h linux_syscallargs.h
linux_syscalls.c linux_sysent.c linux_systrace_args.c
src/sys/compat/linux/arch/m68k: linux_syscall.h linux_syscallargs.h
linux_syscalls.c linux_sysent.c
src/sys/compat/linux/arch/mips: linux_syscall.h linux_syscallargs.h
linux_syscalls.c linux_sysent.c
src/sys/compat/linux/arch/powerpc: linux_syscall.h linux_syscallargs.h
linux_syscalls.c linux_sysent.c

Log Message:
regen


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/compat/linux/arch/aarch64/linux_syscall.h \
src/sys/compat/linux/arch/aarch64/linux_syscallargs.h \
src/sys/compat/linux/arch/aarch64/linux_syscalls.c \
src/sys/compat/linux/arch/aarch64/linux_sysent.c \
src/sys/compat/linux/arch/aarch64/linux_systrace_args.c
cvs rdiff -u -r1.115 -r1.116 src/sys/compat/linux/arch/alpha/linux_syscall.h \
src/sys/compat/linux/arch/alpha/linux_sysent.c
cvs rdiff -u -r1.114 -r1.115 \
src/sys/compat/linux/arch/alpha/linux_syscallargs.h
cvs rdiff -u -r1.116 -r1.117 src/sys/compat/linux/arch/alpha/linux_syscalls.c
cvs rdiff -u -r1.88 -r1.89 src/sys/compat/linux/arch/arm/linux_syscall.h \
src/sys/compat/linux/arch/arm/linux_syscallargs.h \
src/sys/compat/linux/arch/arm/linux_syscalls.c \
src/sys/compat/linux/arch/arm/linux_sysent.c
cvs rdiff -u -r1.21 -r1.22 \
src/sys/compat/linux/arch/arm/linux_systrace_args.c
cvs rdiff -u -r1.122 -r1.123 src/sys/compat/linux/arch/i386/linux_syscall.h \
src/sys/compat/linux/arch/i386/linux_syscallargs.h \
src/sys/compat/linux/arch/i386/linux_sysent.c
cvs rdiff -u -r1.123 -r1.124 src/sys/compat/linux/arch/i386/linux_syscalls.c
cvs rdiff -u -r1.17 -r1.18 \
src/sys/compat/linux/arch/i386/linux_systrace_args.c
cvs rdiff -u -r1.114 -r1.115 src/sys/compat/linux/arch/m68k/linux_syscall.h \
src/sys/compat/linux/arch/m68k/linux_syscalls.c \
src/sys/compat/linux/arch/m68k/linux_sysent.c
cvs rdiff -u -r1.113 -r1.114 \
src/sys/compat/linux/arch/m68k/linux_syscallargs.h
cvs rdiff -u -r1.86 -r1.87 src/sys/compat/linux/arch/mips/linux_syscall.h
cvs rdiff -u -r1.85 -r1.86 src/sys/compat/linux/arch/mips/linux_syscallargs.h \
src/sys/compat/linux/arch/mips/linux_syscalls.c \
src/sys/compat/linux/arch/mips/linux_sysent.c
cvs rdiff -u -r1.92 -r1.93 src/sys/compat/linux/arch/powerpc/linux_syscall.h \
src/sys/compat/linux/arch/powerpc/linux_sysent.c
cvs rdiff -u -r1.91 -r1.92 \
src/sys/compat/linux/arch/powerpc/linux_syscallargs.h \
src/sys/compat/linux/arch/powerpc/linux_syscalls.c

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



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

2023-07-28 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jul 28 19:01:11 UTC 2023

Modified Files:
src/sys/compat/linux/arch/aarch64: syscalls.master
src/sys/compat/linux/arch/alpha: syscalls.conf syscalls.master
src/sys/compat/linux/arch/arm: syscalls.master
src/sys/compat/linux/arch/i386: syscalls.master
src/sys/compat/linux/arch/m68k: syscalls.master
src/sys/compat/linux/arch/mips: syscalls.master
src/sys/compat/linux/arch/powerpc: syscalls.master

Log Message:
add epoll syscalls


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/compat/linux/arch/aarch64/syscalls.master
cvs rdiff -u -r1.3 -r1.4 src/sys/compat/linux/arch/alpha/syscalls.conf
cvs rdiff -u -r1.102 -r1.103 src/sys/compat/linux/arch/alpha/syscalls.master
cvs rdiff -u -r1.75 -r1.76 src/sys/compat/linux/arch/arm/syscalls.master
cvs rdiff -u -r1.130 -r1.131 src/sys/compat/linux/arch/i386/syscalls.master
cvs rdiff -u -r1.101 -r1.102 src/sys/compat/linux/arch/m68k/syscalls.master
cvs rdiff -u -r1.74 -r1.75 src/sys/compat/linux/arch/mips/syscalls.master
cvs rdiff -u -r1.80 -r1.81 src/sys/compat/linux/arch/powerpc/syscalls.master

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



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

2023-07-28 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jul 28 19:01:11 UTC 2023

Modified Files:
src/sys/compat/linux/arch/aarch64: syscalls.master
src/sys/compat/linux/arch/alpha: syscalls.conf syscalls.master
src/sys/compat/linux/arch/arm: syscalls.master
src/sys/compat/linux/arch/i386: syscalls.master
src/sys/compat/linux/arch/m68k: syscalls.master
src/sys/compat/linux/arch/mips: syscalls.master
src/sys/compat/linux/arch/powerpc: syscalls.master

Log Message:
add epoll syscalls


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/compat/linux/arch/aarch64/syscalls.master
cvs rdiff -u -r1.3 -r1.4 src/sys/compat/linux/arch/alpha/syscalls.conf
cvs rdiff -u -r1.102 -r1.103 src/sys/compat/linux/arch/alpha/syscalls.master
cvs rdiff -u -r1.75 -r1.76 src/sys/compat/linux/arch/arm/syscalls.master
cvs rdiff -u -r1.130 -r1.131 src/sys/compat/linux/arch/i386/syscalls.master
cvs rdiff -u -r1.101 -r1.102 src/sys/compat/linux/arch/m68k/syscalls.master
cvs rdiff -u -r1.74 -r1.75 src/sys/compat/linux/arch/mips/syscalls.master
cvs rdiff -u -r1.80 -r1.81 src/sys/compat/linux/arch/powerpc/syscalls.master

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

Modified files:

Index: src/sys/compat/linux/arch/aarch64/syscalls.master
diff -u src/sys/compat/linux/arch/aarch64/syscalls.master:1.5 src/sys/compat/linux/arch/aarch64/syscalls.master:1.6
--- src/sys/compat/linux/arch/aarch64/syscalls.master:1.5	Mon Jul 10 17:08:26 2023
+++ src/sys/compat/linux/arch/aarch64/syscalls.master	Fri Jul 28 15:01:10 2023
@@ -1,4 +1,4 @@
-	$NetBSD: syscalls.master,v 1.5 2023/07/10 21:08:26 christos Exp $
+	$NetBSD: syscalls.master,v 1.6 2023/07/28 19:01:10 christos Exp $
 
 ;	@(#)syscalls.master	8.1 (Berkeley) 7/19/93
 
@@ -97,9 +97,12 @@
 18	UNIMPL		lookup_dcookie
 19	STD		{ int|linux_sys||eventfd2(unsigned int initval, \
 			int flags); }
-20	UNIMPL		epoll_create1
-21	UNIMPL		epoll_ctl
-22	UNIMPL		epoll_pwait
+20	STD		{ int|linux_sys||epoll_create1(int flags); }
+21	STD		{ int|linux_sys||epoll_ctl(int epfd, int op, int fd, \
+			struct linux_epoll_event *event); }
+22	STD		{ int|linux_sys||epoll_pwait(int epfd, \
+			struct linux_epoll_event *events, int maxevents, \
+			int timeout, const linux_sigset_t *sigmask); }
 23	NOARGS		{ int|sys||dup(int fd); }
 24	STD		{ int|linux_sys||dup3(int from, int to, int flags); }
 25	STD		{ int|linux_sys||fcntl(int fd, int cmd, void *arg); }
@@ -679,3 +682,7 @@
 
 ; we want a "nosys" syscall, we'll just add an extra entry for it.
 440	STD		{ int|linux_sys||nosys(void); }
+441	STD		{ int|linux_sys||epoll_pwait2(int epfd, \
+			struct linux_epoll_event *events, int maxevents, \
+			const struct linux_timespec *timeout, \
+			const linux_sigset_t *sigmask); }

Index: src/sys/compat/linux/arch/alpha/syscalls.conf
diff -u src/sys/compat/linux/arch/alpha/syscalls.conf:1.3 src/sys/compat/linux/arch/alpha/syscalls.conf:1.4
--- src/sys/compat/linux/arch/alpha/syscalls.conf:1.3	Fri Mar 30 13:31:28 2001
+++ src/sys/compat/linux/arch/alpha/syscalls.conf	Fri Jul 28 15:01:11 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: syscalls.conf,v 1.3 2001/03/30 18:31:28 jdolecek Exp $
+#	$NetBSD: syscalls.conf,v 1.4 2023/07/28 19:01:11 christos Exp $
 
 sysnames="linux_syscalls.c"
 sysnumhdr="linux_syscall.h"
@@ -10,6 +10,6 @@ libcompatopts=""
 switchname="linux_sysent"
 namesname="linux_syscallnames"
 constprefix="LINUX_SYS_"
-nsysent=512
+nsysent=1024
 
 sys_nosys="linux_sys_nosys"

Index: src/sys/compat/linux/arch/alpha/syscalls.master
diff -u src/sys/compat/linux/arch/alpha/syscalls.master:1.102 src/sys/compat/linux/arch/alpha/syscalls.master:1.103
--- src/sys/compat/linux/arch/alpha/syscalls.master:1.102	Wed Dec  1 23:29:47 2021
+++ src/sys/compat/linux/arch/alpha/syscalls.master	Fri Jul 28 15:01:11 2023
@@ -1,4 +1,4 @@
-	$NetBSD: syscalls.master,v 1.102 2021/12/02 04:29:47 ryo Exp $
+	$NetBSD: syscalls.master,v 1.103 2023/07/28 19:01:11 christos Exp $
 ;
 ;	@(#)syscalls.master	8.1 (Berkeley) 7/19/93
 
@@ -655,9 +655,12 @@
 404	UNIMPL		/* unused */
 405	STD		{ int|linux_sys||exit_group(int error_code); }
 406	UNIMPL		lookup_dcookie
-407	UNIMPL		sys_epoll_create
-408	UNIMPL		sys_epoll_ctl
-409	UNIMPL		sys_epoll_wait
+407	STD		{ int|linux_sys||epoll_create(int size); }
+408	STD		{ int|linux_sys||epoll_ctl(int epfd, int op, int fd, \
+			struct linux_epoll_event *event); }
+409	STD		{ int|linux_sys||epoll_wait(int epfd, \
+			struct linux_epoll_event *events, int maxevents, \
+			int timeout); }
 410	UNIMPL		remap_file_pages
 411	STD		{ int|linux_sys||set_tid_address(int *tid); }
 412	UNIMPL		restart_syscall
@@ -759,7 +762,9 @@
 471	UNIMPL		vmsplice
 472	UNIMPL		move_pages
 473	UNIMPL		getcpu
-474	UNIMPL		epoll_wait
+474	STD		{ int|linux_sys||epoll_pwait(int epfd, \
+			struct linux_epoll_event *events, int maxevents, \
+			int timeout, const 

Re: CVS commit: src/sys/kern

2023-07-28 Thread Taylor R Campbell
> Date: Fri, 28 Jul 2023 23:40:40 +0900
> From: Izumi Tsutsui 
> 
> > Module Name:src
> > Committed By:   riastradh
> > Date:   Fri Jul 28 10:37:28 UTC 2023
> > 
> > Modified Files:
> > src/sys/kern: kern_tc.c
> > 
> > Log Message:
> > timecounter(9): Link to phk's timecounter paper for reference.
> 
> Maybe it's better to refer our timecounter(9) man page?
> https://man.netbsd.org/timecounter.9

That's fine to add, but the man page is about the interface, not about
the algorithm.  The paper is a critical reference for obscure details
of the algorithm that are not obvious from the interface.

The man page should perhaps also mention more of the API contract,
like the relation between tc_frequency, tc_counter_mask, and hz.

> (that refers http://phk.freebsd.dk/pubs/timecounter.pdf though)

No opinion on which URL to use as long as it goes to the right paper
(and preferably https).


CVS commit: src/sys/compat/linux/arch/amd64

2023-07-28 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jul 28 18:20:53 UTC 2023

Modified Files:
src/sys/compat/linux/arch/amd64: linux_syscall.h linux_syscallargs.h
linux_syscalls.c linux_sysent.c linux_systrace_args.c

Log Message:
regen


To generate a diff of this commit:
cvs rdiff -u -r1.77 -r1.78 src/sys/compat/linux/arch/amd64/linux_syscall.h \
src/sys/compat/linux/arch/amd64/linux_syscallargs.h \
src/sys/compat/linux/arch/amd64/linux_syscalls.c \
src/sys/compat/linux/arch/amd64/linux_sysent.c
cvs rdiff -u -r1.21 -r1.22 \
src/sys/compat/linux/arch/amd64/linux_systrace_args.c

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

Modified files:

Index: src/sys/compat/linux/arch/amd64/linux_syscall.h
diff -u src/sys/compat/linux/arch/amd64/linux_syscall.h:1.77 src/sys/compat/linux/arch/amd64/linux_syscall.h:1.78
--- src/sys/compat/linux/arch/amd64/linux_syscall.h:1.77	Sun Jul  9 22:37:46 2023
+++ src/sys/compat/linux/arch/amd64/linux_syscall.h	Fri Jul 28 14:20:52 2023
@@ -1,10 +1,10 @@
-/* $NetBSD: linux_syscall.h,v 1.77 2023/07/10 02:37:46 christos Exp $ */
+/* $NetBSD: linux_syscall.h,v 1.78 2023/07/28 18:20:52 christos Exp $ */
 
 /*
  * System call numbers.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * created from	NetBSD: syscalls.master,v 1.68 2023/07/10 02:31:55 christos Exp
+ * created from	NetBSD: syscalls.master,v 1.69 2023/07/28 18:19:00 christos Exp
  */
 
 #ifndef _LINUX_SYS_SYSCALL_H_
@@ -564,6 +564,9 @@
 /* syscall: "sched_getaffinity" ret: "int" args: "pid_t" "unsigned int" "unsigned long *" */
 #define	LINUX_SYS_sched_getaffinity	204
 
+/* syscall: "epoll_create" ret: "int" args: "int" */
+#define	LINUX_SYS_epoll_create	213
+
 /* syscall: "getdents64" ret: "int" args: "int" "struct linux_dirent64 *" "unsigned int" */
 #define	LINUX_SYS_getdents64	217
 
@@ -603,6 +606,12 @@
 /* syscall: "exit_group" ret: "int" args: "int" */
 #define	LINUX_SYS_exit_group	231
 
+/* syscall: "epoll_wait" ret: "int" args: "int" "struct linux_epoll_event *" "int" "int" */
+#define	LINUX_SYS_epoll_wait	232
+
+/* syscall: "epoll_ctl" ret: "int" args: "int" "int" "int" "struct linux_epoll_event *" */
+#define	LINUX_SYS_epoll_ctl	233
+
 /* syscall: "tgkill" ret: "int" args: "int" "int" "int" */
 #define	LINUX_SYS_tgkill	234
 
@@ -660,6 +669,9 @@
 /* syscall: "utimensat" ret: "int" args: "int" "const char *" "struct linux_timespec *" "int" */
 #define	LINUX_SYS_utimensat	280
 
+/* syscall: "epoll_pwait" ret: "int" args: "int" "struct linux_epoll_event *" "int" "int" "const linux_sigset_t *" */
+#define	LINUX_SYS_epoll_pwait	281
+
 /* syscall: "timerfd_create" ret: "int" args: "clockid_t" "int" */
 #define	LINUX_SYS_timerfd_create	283
 
@@ -681,6 +693,9 @@
 /* syscall: "eventfd2" ret: "int" args: "unsigned int" "int" */
 #define	LINUX_SYS_eventfd2	290
 
+/* syscall: "epoll_create1" ret: "int" args: "int" */
+#define	LINUX_SYS_epoll_create1	291
+
 /* syscall: "dup3" ret: "int" args: "int" "int" "int" */
 #define	LINUX_SYS_dup3	292
 
@@ -708,6 +723,9 @@
 /* syscall: "memfd_create" ret: "int" args: "const char *" "unsigned int" */
 #define	LINUX_SYS_memfd_create	319
 
+/* syscall: "epoll_pwait2" ret: "int" args: "int" "struct linux_epoll_event *" "int" "const struct linux_timespec *" "const linux_sigset_t *" */
+#define	LINUX_SYS_epoll_pwait2	441
+
 /* syscall: "nosys" ret: "int" args: */
 #define	LINUX_SYS_nosys	451
 
Index: src/sys/compat/linux/arch/amd64/linux_syscallargs.h
diff -u src/sys/compat/linux/arch/amd64/linux_syscallargs.h:1.77 src/sys/compat/linux/arch/amd64/linux_syscallargs.h:1.78
--- src/sys/compat/linux/arch/amd64/linux_syscallargs.h:1.77	Sun Jul  9 22:37:46 2023
+++ src/sys/compat/linux/arch/amd64/linux_syscallargs.h	Fri Jul 28 14:20:52 2023
@@ -1,10 +1,10 @@
-/* $NetBSD: linux_syscallargs.h,v 1.77 2023/07/10 02:37:46 christos Exp $ */
+/* $NetBSD: linux_syscallargs.h,v 1.78 2023/07/28 18:20:52 christos Exp $ */
 
 /*
  * System call argument lists.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * created from	NetBSD: syscalls.master,v 1.68 2023/07/10 02:31:55 christos Exp
+ * created from	NetBSD: syscalls.master,v 1.69 2023/07/28 18:19:00 christos Exp
  */
 
 #ifndef _LINUX_SYS_SYSCALLARGS_H_
@@ -837,6 +837,11 @@ struct linux_sys_sched_getaffinity_args 
 };
 check_syscall_args(linux_sys_sched_getaffinity)
 
+struct linux_sys_epoll_create_args {
+	syscallarg(int) size;
+};
+check_syscall_args(linux_sys_epoll_create)
+
 struct linux_sys_getdents64_args {
 	syscallarg(int) fd;
 	syscallarg(struct linux_dirent64 *) dent;
@@ -913,6 +918,22 @@ struct linux_sys_exit_group_args {
 };
 check_syscall_args(linux_sys_exit_group)
 
+struct linux_sys_epoll_wait_args {
+	syscallarg(int) epfd;
+	syscallarg(struct linux_epoll_event *) events;
+	syscallarg(int) maxevents;
+	syscallarg(int) timeout;
+};
+check_syscall_args(linux_sys_epoll_wait)
+
+struct 

CVS commit: src/sys/compat/linux/arch/amd64

2023-07-28 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jul 28 18:20:53 UTC 2023

Modified Files:
src/sys/compat/linux/arch/amd64: linux_syscall.h linux_syscallargs.h
linux_syscalls.c linux_sysent.c linux_systrace_args.c

Log Message:
regen


To generate a diff of this commit:
cvs rdiff -u -r1.77 -r1.78 src/sys/compat/linux/arch/amd64/linux_syscall.h \
src/sys/compat/linux/arch/amd64/linux_syscallargs.h \
src/sys/compat/linux/arch/amd64/linux_syscalls.c \
src/sys/compat/linux/arch/amd64/linux_sysent.c
cvs rdiff -u -r1.21 -r1.22 \
src/sys/compat/linux/arch/amd64/linux_systrace_args.c

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



CVS commit: src/sys

2023-07-28 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jul 28 18:20:29 UTC 2023

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

Log Message:
regen


To generate a diff of this commit:
cvs rdiff -u -r1.340 -r1.341 src/sys/kern/init_sysent.c
cvs rdiff -u -r1.328 -r1.329 src/sys/kern/syscalls.c
cvs rdiff -u -r1.44 -r1.45 src/sys/kern/syscalls_autoload.c
cvs rdiff -u -r1.50 -r1.51 src/sys/kern/systrace_args.c
cvs rdiff -u -r1.127 -r1.128 src/sys/rump/include/rump/rump_syscalls.h
cvs rdiff -u -r1.158 -r1.159 src/sys/rump/librump/rumpkern/rump_syscalls.c
cvs rdiff -u -r1.7 -r1.8 src/sys/rump/librump/rumpkern/rumpkern_syscalls.c
cvs rdiff -u -r1.323 -r1.324 src/sys/sys/syscall.h
cvs rdiff -u -r1.306 -r1.307 src/sys/sys/syscallargs.h

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

Modified files:

Index: src/sys/kern/init_sysent.c
diff -u src/sys/kern/init_sysent.c:1.340 src/sys/kern/init_sysent.c:1.341
--- src/sys/kern/init_sysent.c:1.340	Sun Jul  9 22:37:05 2023
+++ src/sys/kern/init_sysent.c	Fri Jul 28 14:20:28 2023
@@ -1,14 +1,14 @@
-/* $NetBSD: init_sysent.c,v 1.340 2023/07/10 02:37:05 christos Exp $ */
+/* $NetBSD: init_sysent.c,v 1.341 2023/07/28 18:20:28 christos Exp $ */
 
 /*
  * System call switch table.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * created from	NetBSD: syscalls.master,v 1.310 2023/07/10 02:33:04 christos Exp
+ * created from	NetBSD: syscalls.master,v 1.311 2023/07/28 18:19:01 christos Exp
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: init_sysent.c,v 1.340 2023/07/10 02:37:05 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: init_sysent.c,v 1.341 2023/07/28 18:20:28 christos Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_modular.h"
@@ -127,6 +127,12 @@ __KERNEL_RCSID(0, "$NetBSD: init_sysent.
 #define	compat_90(func) sys_nosys
 #endif
 
+#ifdef COMPAT_100
+#define	compat_100(func) __CONCAT(compat_100_,func)
+#else
+#define	compat_100(func) sys_nosys
+#endif
+
 #define	s(type)	sizeof(type)
 #define	n(type)	(sizeof(type)/sizeof (register_t))
 #define	ns(type)	.sy_narg = n(type), .sy_argsize = s(type)
@@ -2112,10 +2118,10 @@ struct sysent sysent[] = {
 		.sy_call = (sy_call_t *)sys_nomodule
 	},		/* 434 = compat_60__lwp_park */
 	{
-		ns(struct sys___kevent50_args),
+		ns(struct compat_100_sys___kevent50_args),
 		.sy_flags = SYCALL_ARG_PTR,
-		.sy_call = (sy_call_t *)sys___kevent50
-	},		/* 435 = __kevent50 */
+		.sy_call = (sy_call_t *)sys_nomodule
+	},		/* 435 = compat_100___kevent50 */
 	{
 		ns(struct sys___pselect50_args),
 		.sy_flags = SYCALL_ARG_PTR,
@@ -2443,17 +2449,24 @@ struct sysent sysent[] = {
 		.sy_call = (sy_call_t *)sys_memfd_create
 	},		/* 500 = memfd_create */
 	{
-		.sy_call = sys_nosys,
-	},		/* 501 = filler */
+		ns(struct sys___kevent100_args),
+		.sy_flags = SYCALL_ARG_PTR,
+		.sy_call = (sy_call_t *)sys___kevent100
+	},		/* 501 = __kevent100 */
 	{
-		.sy_call = sys_nosys,
-	},		/* 502 = filler */
+		ns(struct sys_epoll_create1_args),
+		.sy_call = (sy_call_t *)sys_epoll_create1
+	},		/* 502 = epoll_create1 */
 	{
-		.sy_call = sys_nosys,
-	},		/* 503 = filler */
+		ns(struct sys_epoll_ctl_args),
+		.sy_flags = SYCALL_ARG_PTR,
+		.sy_call = (sy_call_t *)sys_epoll_ctl
+	},		/* 503 = epoll_ctl */
 	{
-		.sy_call = sys_nosys,
-	},		/* 504 = filler */
+		ns(struct sys_epoll_pwait2_args),
+		.sy_flags = SYCALL_ARG_PTR,
+		.sy_call = (sy_call_t *)sys_epoll_pwait2
+	},		/* 504 = epoll_pwait2 */
 	{
 		.sy_call = sys_nosys,
 	},		/* 505 = filler */
@@ -2491,7 +2504,7 @@ const uint32_t sysent_nomodbits[] = {
 	0x0200fc01,	/* syscalls 320-351 */
 	0x006000f0,	/* syscalls 352-383 */
 	0x007fe338,	/* syscalls 384-415 */
-	0x1c470040,	/* syscalls 416-447 */
+	0x1c4f0040,	/* syscalls 416-447 */
 	0x,	/* syscalls 448-479 */
 	0x,	/* syscalls 480-511 */
 };

Index: src/sys/kern/syscalls.c
diff -u src/sys/kern/syscalls.c:1.328 src/sys/kern/syscalls.c:1.329
--- src/sys/kern/syscalls.c:1.328	Sun Jul  9 22:37:05 2023
+++ src/sys/kern/syscalls.c	Fri Jul 28 14:20:28 2023
@@ -1,14 +1,14 @@
-/* $NetBSD: syscalls.c,v 1.328 2023/07/10 02:37:05 christos Exp $ */
+/* $NetBSD: syscalls.c,v 1.329 2023/07/28 18:20:28 christos Exp $ */
 
 /*
  * System call names.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * created from	NetBSD: syscalls.master,v 1.310 2023/07/10 02:33:04 christos Exp
+ * created from	NetBSD: syscalls.master,v 1.311 2023/07/28 18:19:01 christos Exp
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: syscalls.c,v 1.328 2023/07/10 02:37:05 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: syscalls.c,v 1.329 2023/07/28 18:20:28 christos Exp $");
 
 #if defined(_KERNEL_OPT)
 #ifdef _KERNEL_OPT
@@ -481,7 +481,7 @@ const char *const 

CVS commit: src/sys

2023-07-28 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jul 28 18:20:29 UTC 2023

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

Log Message:
regen


To generate a diff of this commit:
cvs rdiff -u -r1.340 -r1.341 src/sys/kern/init_sysent.c
cvs rdiff -u -r1.328 -r1.329 src/sys/kern/syscalls.c
cvs rdiff -u -r1.44 -r1.45 src/sys/kern/syscalls_autoload.c
cvs rdiff -u -r1.50 -r1.51 src/sys/kern/systrace_args.c
cvs rdiff -u -r1.127 -r1.128 src/sys/rump/include/rump/rump_syscalls.h
cvs rdiff -u -r1.158 -r1.159 src/sys/rump/librump/rumpkern/rump_syscalls.c
cvs rdiff -u -r1.7 -r1.8 src/sys/rump/librump/rumpkern/rumpkern_syscalls.c
cvs rdiff -u -r1.323 -r1.324 src/sys/sys/syscall.h
cvs rdiff -u -r1.306 -r1.307 src/sys/sys/syscallargs.h

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



CVS commit: src

2023-07-28 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jul 28 18:19:01 UTC 2023

Modified Files:
src/distrib/sets/lists/comp: mi
src/distrib/sets/lists/debug: mi
src/distrib/sets/lists/tests: mi
src/lib/libc/compat/sys: compat_kevent.c
src/lib/libc/sys: Makefile.inc kqueue.2
src/lib/libpthread: pthread_cancelstub.c
src/lib/librumpclient: rumpclient.c
src/lib/librumphijack: hijack.c
src/sys/compat/common: compat_100_mod.c compat_mod.h files.common
kern_select_50.c
src/sys/compat/linux/arch/amd64: syscalls.master
src/sys/compat/linux/common: linux_misc.c linux_misc.h
src/sys/compat/sys: event.h
src/sys/kern: files.kern kern_event.c makesyscalls.sh syscalls.conf
syscalls.master
src/sys/rump: Makefile.rump rump.sysmap
src/sys/sys: Makefile event.h syscall.h
src/tests/kernel: Makefile
Added Files:
src/lib/libc/sys: epoll.2 epoll.c
src/sys/compat/common: kern_event_100.c
src/sys/kern: sys_epoll.c
src/sys/sys: epoll.h
src/tests/kernel: t_epoll.c

Log Message:
Add epoll(2) from Theodore Preduta as part of GSoC 2023


To generate a diff of this commit:
cvs rdiff -u -r1.2437 -r1.2438 src/distrib/sets/lists/comp/mi
cvs rdiff -u -r1.406 -r1.407 src/distrib/sets/lists/debug/mi
cvs rdiff -u -r1.1277 -r1.1278 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.2 -r1.3 src/lib/libc/compat/sys/compat_kevent.c
cvs rdiff -u -r1.251 -r1.252 src/lib/libc/sys/Makefile.inc
cvs rdiff -u -r0 -r1.1 src/lib/libc/sys/epoll.2 src/lib/libc/sys/epoll.c
cvs rdiff -u -r1.58 -r1.59 src/lib/libc/sys/kqueue.2
cvs rdiff -u -r1.43 -r1.44 src/lib/libpthread/pthread_cancelstub.c
cvs rdiff -u -r1.69 -r1.70 src/lib/librumpclient/rumpclient.c
cvs rdiff -u -r1.136 -r1.137 src/lib/librumphijack/hijack.c
cvs rdiff -u -r1.1 -r1.2 src/sys/compat/common/compat_100_mod.c
cvs rdiff -u -r1.7 -r1.8 src/sys/compat/common/compat_mod.h
cvs rdiff -u -r1.8 -r1.9 src/sys/compat/common/files.common
cvs rdiff -u -r0 -r1.1 src/sys/compat/common/kern_event_100.c
cvs rdiff -u -r1.3 -r1.4 src/sys/compat/common/kern_select_50.c
cvs rdiff -u -r1.68 -r1.69 src/sys/compat/linux/arch/amd64/syscalls.master
cvs rdiff -u -r1.257 -r1.258 src/sys/compat/linux/common/linux_misc.c
cvs rdiff -u -r1.26 -r1.27 src/sys/compat/linux/common/linux_misc.h
cvs rdiff -u -r1.2 -r1.3 src/sys/compat/sys/event.h
cvs rdiff -u -r1.59 -r1.60 src/sys/kern/files.kern
cvs rdiff -u -r1.148 -r1.149 src/sys/kern/kern_event.c
cvs rdiff -u -r1.186 -r1.187 src/sys/kern/makesyscalls.sh
cvs rdiff -u -r0 -r1.1 src/sys/kern/sys_epoll.c
cvs rdiff -u -r1.31 -r1.32 src/sys/kern/syscalls.conf
cvs rdiff -u -r1.310 -r1.311 src/sys/kern/syscalls.master
cvs rdiff -u -r1.134 -r1.135 src/sys/rump/Makefile.rump
cvs rdiff -u -r1.9 -r1.10 src/sys/rump/rump.sysmap
cvs rdiff -u -r1.180 -r1.181 src/sys/sys/Makefile
cvs rdiff -u -r0 -r1.1 src/sys/sys/epoll.h
cvs rdiff -u -r1.54 -r1.55 src/sys/sys/event.h
cvs rdiff -u -r1.322 -r1.323 src/sys/sys/syscall.h
cvs rdiff -u -r1.72 -r1.73 src/tests/kernel/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/kernel/t_epoll.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/comp/mi
diff -u src/distrib/sets/lists/comp/mi:1.2437 src/distrib/sets/lists/comp/mi:1.2438
--- src/distrib/sets/lists/comp/mi:1.2437	Sun Jul  9 22:31:54 2023
+++ src/distrib/sets/lists/comp/mi	Fri Jul 28 14:18:59 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: mi,v 1.2437 2023/07/10 02:31:54 christos Exp $
+#	$NetBSD: mi,v 1.2438 2023/07/28 18:18:59 christos Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 ./etc/mtree/set.compcomp-sys-root
@@ -3328,6 +3328,7 @@
 ./usr/include/sys/elfdefinitions.h		comp-c-include
 ./usr/include/sys/endian.h			comp-c-include
 ./usr/include/sys/envsys.h			comp-c-include
+./usr/include/sys/epoll.h			comp-c-include
 ./usr/include/sys/errno.h			comp-c-include
 ./usr/include/sys/evcnt.h			comp-c-include
 ./usr/include/sys/event.h			comp-c-include
@@ -13211,6 +13212,16 @@
 ./usr/share/man/html2/dup.html			comp-c-htmlman		html
 ./usr/share/man/html2/dup2.html			comp-c-htmlman		html
 ./usr/share/man/html2/dup3.html			comp-c-htmlman		html
+./usr/share/man/html2/epoll.html		comp-c-htmlman		html
+./usr/share/man/html2/epoll_create.html		comp-c-htmlman		html
+./usr/share/man/html2/epoll_create1.html	comp-c-htmlman		html
+./usr/share/man/html2/epoll_ctl.html		comp-c-htmlman		html
+./usr/share/man/html2/epoll_data.html		comp-c-htmlman		html
+./usr/share/man/html2/epoll_data_t.html		comp-c-htmlman		html
+./usr/share/man/html2/epoll_event.html		comp-c-htmlman		html
+./usr/share/man/html2/epoll_pwait.html		comp-c-htmlman		html
+./usr/share/man/html2/epoll_pwait2.html		comp-c-htmlman		html
+./usr/share/man/html2/epoll_wait.html		comp-c-htmlman		html
 ./usr/share/man/html2/errno.html		

CVS commit: src

2023-07-28 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jul 28 18:19:01 UTC 2023

Modified Files:
src/distrib/sets/lists/comp: mi
src/distrib/sets/lists/debug: mi
src/distrib/sets/lists/tests: mi
src/lib/libc/compat/sys: compat_kevent.c
src/lib/libc/sys: Makefile.inc kqueue.2
src/lib/libpthread: pthread_cancelstub.c
src/lib/librumpclient: rumpclient.c
src/lib/librumphijack: hijack.c
src/sys/compat/common: compat_100_mod.c compat_mod.h files.common
kern_select_50.c
src/sys/compat/linux/arch/amd64: syscalls.master
src/sys/compat/linux/common: linux_misc.c linux_misc.h
src/sys/compat/sys: event.h
src/sys/kern: files.kern kern_event.c makesyscalls.sh syscalls.conf
syscalls.master
src/sys/rump: Makefile.rump rump.sysmap
src/sys/sys: Makefile event.h syscall.h
src/tests/kernel: Makefile
Added Files:
src/lib/libc/sys: epoll.2 epoll.c
src/sys/compat/common: kern_event_100.c
src/sys/kern: sys_epoll.c
src/sys/sys: epoll.h
src/tests/kernel: t_epoll.c

Log Message:
Add epoll(2) from Theodore Preduta as part of GSoC 2023


To generate a diff of this commit:
cvs rdiff -u -r1.2437 -r1.2438 src/distrib/sets/lists/comp/mi
cvs rdiff -u -r1.406 -r1.407 src/distrib/sets/lists/debug/mi
cvs rdiff -u -r1.1277 -r1.1278 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.2 -r1.3 src/lib/libc/compat/sys/compat_kevent.c
cvs rdiff -u -r1.251 -r1.252 src/lib/libc/sys/Makefile.inc
cvs rdiff -u -r0 -r1.1 src/lib/libc/sys/epoll.2 src/lib/libc/sys/epoll.c
cvs rdiff -u -r1.58 -r1.59 src/lib/libc/sys/kqueue.2
cvs rdiff -u -r1.43 -r1.44 src/lib/libpthread/pthread_cancelstub.c
cvs rdiff -u -r1.69 -r1.70 src/lib/librumpclient/rumpclient.c
cvs rdiff -u -r1.136 -r1.137 src/lib/librumphijack/hijack.c
cvs rdiff -u -r1.1 -r1.2 src/sys/compat/common/compat_100_mod.c
cvs rdiff -u -r1.7 -r1.8 src/sys/compat/common/compat_mod.h
cvs rdiff -u -r1.8 -r1.9 src/sys/compat/common/files.common
cvs rdiff -u -r0 -r1.1 src/sys/compat/common/kern_event_100.c
cvs rdiff -u -r1.3 -r1.4 src/sys/compat/common/kern_select_50.c
cvs rdiff -u -r1.68 -r1.69 src/sys/compat/linux/arch/amd64/syscalls.master
cvs rdiff -u -r1.257 -r1.258 src/sys/compat/linux/common/linux_misc.c
cvs rdiff -u -r1.26 -r1.27 src/sys/compat/linux/common/linux_misc.h
cvs rdiff -u -r1.2 -r1.3 src/sys/compat/sys/event.h
cvs rdiff -u -r1.59 -r1.60 src/sys/kern/files.kern
cvs rdiff -u -r1.148 -r1.149 src/sys/kern/kern_event.c
cvs rdiff -u -r1.186 -r1.187 src/sys/kern/makesyscalls.sh
cvs rdiff -u -r0 -r1.1 src/sys/kern/sys_epoll.c
cvs rdiff -u -r1.31 -r1.32 src/sys/kern/syscalls.conf
cvs rdiff -u -r1.310 -r1.311 src/sys/kern/syscalls.master
cvs rdiff -u -r1.134 -r1.135 src/sys/rump/Makefile.rump
cvs rdiff -u -r1.9 -r1.10 src/sys/rump/rump.sysmap
cvs rdiff -u -r1.180 -r1.181 src/sys/sys/Makefile
cvs rdiff -u -r0 -r1.1 src/sys/sys/epoll.h
cvs rdiff -u -r1.54 -r1.55 src/sys/sys/event.h
cvs rdiff -u -r1.322 -r1.323 src/sys/sys/syscall.h
cvs rdiff -u -r1.72 -r1.73 src/tests/kernel/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/kernel/t_epoll.c

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



Re: CVS commit: src/sys/kern

2023-07-28 Thread Izumi Tsutsui
> Module Name:  src
> Committed By: riastradh
> Date: Fri Jul 28 10:37:28 UTC 2023
> 
> Modified Files:
>   src/sys/kern: kern_tc.c
> 
> Log Message:
> timecounter(9): Link to phk's timecounter paper for reference.

Maybe it's better to refer our timecounter(9) man page?
https://man.netbsd.org/timecounter.9
(that refers http://phk.freebsd.dk/pubs/timecounter.pdf though)

---
Izumi Tsutsui


CVS commit: xsrc/external/mit/ctwm/dist

2023-07-28 Thread Christos Zoulas
Module Name:xsrc
Committed By:   christos
Date:   Fri Jul 28 14:27:35 UTC 2023

Modified Files:
xsrc/external/mit/ctwm/dist: menus.c

Log Message:
Gcc complains about overflow writing 53 bytes into a region of size 35,
and it is correct for the alphabet copying line, which correctly comments
about the overflow too.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 xsrc/external/mit/ctwm/dist/menus.c

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



CVS commit: xsrc/external/mit/ctwm/dist

2023-07-28 Thread Christos Zoulas
Module Name:xsrc
Committed By:   christos
Date:   Fri Jul 28 14:27:35 UTC 2023

Modified Files:
xsrc/external/mit/ctwm/dist: menus.c

Log Message:
Gcc complains about overflow writing 53 bytes into a region of size 35,
and it is correct for the alphabet copying line, which correctly comments
about the overflow too.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 xsrc/external/mit/ctwm/dist/menus.c

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

Modified files:

Index: xsrc/external/mit/ctwm/dist/menus.c
diff -u xsrc/external/mit/ctwm/dist/menus.c:1.11 xsrc/external/mit/ctwm/dist/menus.c:1.12
--- xsrc/external/mit/ctwm/dist/menus.c:1.11	Wed Jul  5 04:39:10 2023
+++ xsrc/external/mit/ctwm/dist/menus.c	Fri Jul 28 10:27:35 2023
@@ -1659,7 +1659,7 @@ mk_twmkeys_entry(const FuncKey *key)
 	char *ret;
 	// S+  C+  5(Mx+)  5(Ax+)
 #define MSLEN (2 + 2 + 5 * 3 + 5 * 3)
-	char modStr[MSLEN + 1];
+	char modStr[64];
 	char *modStrCur = modStr;
 
 	// Init



CVS commit: src/usr.sbin/iostat

2023-07-28 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Fri Jul 28 12:03:33 UTC 2023

Modified Files:
src/usr.sbin/iostat: iostat.8 iostat.c

Log Message:
ostat: use standard option order (AaBb...)

Fix macro usage while here


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/usr.sbin/iostat/iostat.8
cvs rdiff -u -r1.70 -r1.71 src/usr.sbin/iostat/iostat.c

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



CVS commit: src/usr.sbin/iostat

2023-07-28 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Fri Jul 28 12:03:33 UTC 2023

Modified Files:
src/usr.sbin/iostat: iostat.8 iostat.c

Log Message:
ostat: use standard option order (AaBb...)

Fix macro usage while here


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/usr.sbin/iostat/iostat.8
cvs rdiff -u -r1.70 -r1.71 src/usr.sbin/iostat/iostat.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/iostat/iostat.8
diff -u src/usr.sbin/iostat/iostat.8:1.29 src/usr.sbin/iostat/iostat.8:1.30
--- src/usr.sbin/iostat/iostat.8:1.29	Fri Jul 28 09:18:58 2023
+++ src/usr.sbin/iostat/iostat.8	Fri Jul 28 12:03:33 2023
@@ -1,4 +1,4 @@
-.\"	$NetBSD: iostat.8,v 1.29 2023/07/28 09:18:58 mrg Exp $
+.\"	$NetBSD: iostat.8,v 1.30 2023/07/28 12:03:33 wiz Exp $
 .\"
 .\" Copyright (c) 1985, 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -37,7 +37,7 @@
 .Nd report I/O statistics
 .Sh SYNOPSIS
 .Nm
-.Op Fl CdDITxXyz
+.Op Fl CDdITXxyz
 .Op Fl c Ar count
 .Op Fl H Ar height
 .Op Fl W Ar width
@@ -65,14 +65,25 @@ to print raw, unaveraged values (totals)
 Only the last disk option specified
 .Fl ( d ,
 .Fl D ,
-.Fl x ,
 .Fl X ,
+.Fl x ,
 or
 .Fl y )
 is used.
 .Pp
 The options are as follows:
 .Bl -tag -width XNXsystemX
+.It Fl C
+Show CPU statistics.
+This is enabled by default unless any of the
+.Fl D ,
+.Fl d ,
+.Fl T ,
+.Fl X ,
+.Fl x ,
+or
+.Fl y
+flags are used.
 .It Fl c Ar count
 Repeat the display
 .Ar count
@@ -84,26 +95,6 @@ each subsequent report is for the time p
 If no
 .Ar wait
 interval is specified, the default is 1 second.
-.It Fl C
-Show CPU statistics.
-This is enabled by default unless any of the
-.Fl d ,
-.Fl D ,
-.Fl T ,
-.Fl x ,
-.Fl X ,
-or
-.Fl y
-flags are used.
-.It Fl d
-Show disk statistics.
-This is the default.
-Displays
-number of transfers per second,
-kilobytes per transfer,
-and
-megabytes transferred per second.
-Use of this flag disables the default display of CPU and tty statistics.
 .It Fl D
 Show alternative disk statistics.
 Displays
@@ -116,6 +107,15 @@ during the
 period (or since boot with
 .Fl I ) .
 Use of this flag disables the default display.
+.It Fl d
+Show disk statistics.
+This is the default.
+Displays
+number of transfers per second,
+kilobytes per transfer,
+and
+megabytes transferred per second.
+Use of this flag disables the default display of CPU and tty statistics.
 .It Fl H Ar height
 Set the page size (length, or height) explicitly, as the number of lines,
 .Ar height .
@@ -140,19 +140,19 @@ started running, rather than since the s
 In this case the first output would necessarily be zero,
 so is suppressed.
 Consequently this option produces no output if neither
-.Fl w
-nor
 .Fl c
+nor
+.Fl w
 is given.
 .ii
 .It Fl T
 Show tty statistics.
 This is enabled by default unless one, or more, of the
 .Fl C ,
-.Fl d ,
 .Fl D ,
-.Fl x ,
+.Fl d ,
 .Fl X ,
+.Fl x ,
 or
 .Fl y
 flags are used.
@@ -168,13 +168,6 @@ include a column after each relevant out
 showing the difference between this output and the previous.
 These added columns will be blank in the first displayed output.
 .uu
-.It Fl w Ar wait
-Pause
-.Ar wait
-seconds between each display.
-If no repeat
-.Ar count
-is specified, the default is infinity.
 .It Fl W Ar width
 Set the page width explicitly, as the number of columns of characters,
 .Ar width .
@@ -188,6 +181,20 @@ This width is used only to determine the
 by default when no drive list is given.
 In other cases output will be as wide as needed to display the
 data requested.
+.It Fl w Ar wait
+Pause
+.Ar wait
+seconds between each display.
+If no repeat
+.Ar count
+is specified, the default is infinity.
+.It Fl X
+Show limited alternative disk statistics.
+Displays megabytes transferred, and time spent in transfers, during the
+.Ar wait
+period (or since boot with
+.Fl I ) .
+Use of this flag disables the default display.
 .It Fl x
 Show extended disk statistics.
 Each disk is displayed on a line of its own with all available
@@ -201,13 +208,6 @@ The
 and
 .Fl T
 options are ignored with this output format.
-.It Fl X
-Show limited alternative disk statistics.
-Displays megabytes transferred, and time spent in transfers, during the
-.Ar wait
-period (or since boot with
-.Fl I ) .
-Use of this flag disables the default display.
 .It Fl y
 Shows the extended statistics (as with
 .Fl x )
@@ -354,7 +354,7 @@ The archaic option format:
 .ti +3n
 .Nm
 .Op Ar drives ...
-.Oo Ar wait Op Ar count Oc
+.Oo Ar wait Oo Ar count Oc Oc
 .br
 remains supported (the first
 .Ar drive

Index: src/usr.sbin/iostat/iostat.c
diff -u src/usr.sbin/iostat/iostat.c:1.70 src/usr.sbin/iostat/iostat.c:1.71
--- src/usr.sbin/iostat/iostat.c:1.70	Fri Jul 28 09:18:58 2023
+++ src/usr.sbin/iostat/iostat.c	Fri Jul 28 12:03:33 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: iostat.c,v 1.70 2023/07/28 09:18:58 mrg Exp $	*/
+/*	$NetBSD: 

CVS commit: src/lib/csu/arch/vax

2023-07-28 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Fri Jul 28 11:22:43 UTC 2023

Modified Files:
src/lib/csu/arch/vax: crt0.S

Log Message:
vax/csu: __start: Use 0x as entry mask instead of 0x0101 (two NOPs)

This was a quite common trick to able to load executables with a.out
headers stripped. Now, the system boots successfully into multi-user
mode without this trick.

Thanks ragge@ for kind explanation:
https://mail-index.netbsd.org/port-vax/2023/07/28/msg004397.html


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/lib/csu/arch/vax/crt0.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/csu/arch/vax/crt0.S
diff -u src/lib/csu/arch/vax/crt0.S:1.4 src/lib/csu/arch/vax/crt0.S:1.5
--- src/lib/csu/arch/vax/crt0.S:1.4	Mon Nov 26 17:37:46 2018
+++ src/lib/csu/arch/vax/crt0.S	Fri Jul 28 11:22:43 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: crt0.S,v 1.4 2018/11/26 17:37:46 joerg Exp $ */
+/* $NetBSD: crt0.S,v 1.5 2023/07/28 11:22:43 rin Exp $ */
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -31,11 +31,11 @@
 
 #include 
 
-RCSID("$NetBSD: crt0.S,v 1.4 2018/11/26 17:37:46 joerg Exp $")
+RCSID("$NetBSD: crt0.S,v 1.5 2023/07/28 11:22:43 rin Exp $")
 
 STRONG_ALIAS(_start,__start)
 
-_ENTRY(__start, 0x0101)
+_ENTRY(__start, 0x)
 	pushl	%r9		/* ps_strings */
 	pushl	%r7		/* cleanup */
 	calls	$2,___start



CVS commit: src/lib/csu/arch/vax

2023-07-28 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Fri Jul 28 11:22:43 UTC 2023

Modified Files:
src/lib/csu/arch/vax: crt0.S

Log Message:
vax/csu: __start: Use 0x as entry mask instead of 0x0101 (two NOPs)

This was a quite common trick to able to load executables with a.out
headers stripped. Now, the system boots successfully into multi-user
mode without this trick.

Thanks ragge@ for kind explanation:
https://mail-index.netbsd.org/port-vax/2023/07/28/msg004397.html


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/lib/csu/arch/vax/crt0.S

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



CVS commit: src/sys/arch/xen/xen

2023-07-28 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri Jul 28 10:39:14 UTC 2023

Modified Files:
src/sys/arch/xen/xen: xen_clock.c

Log Message:
xen_clock(4): New hardclock dtrace probes.

sdt:xen:hardclock:tick(last, now)
  fires on every hardclock tick

sdt:xen:hardclock:jump(last, now, nticks)
  fires on every hardclock tick when (now - last) >= 2*NS_PER_TICK,
  i.e., this call to the timer interrupt handler requires multiple
  hardclock ticks


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/xen/xen/xen_clock.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/xen/xen/xen_clock.c
diff -u src/sys/arch/xen/xen/xen_clock.c:1.14 src/sys/arch/xen/xen/xen_clock.c:1.15
--- src/sys/arch/xen/xen/xen_clock.c:1.14	Fri Jul 28 10:39:01 2023
+++ src/sys/arch/xen/xen/xen_clock.c	Fri Jul 28 10:39:14 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: xen_clock.c,v 1.14 2023/07/28 10:39:01 riastradh Exp $	*/
+/*	$NetBSD: xen_clock.c,v 1.15 2023/07/28 10:39:14 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2017, 2018 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
 #endif
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: xen_clock.c,v 1.14 2023/07/28 10:39:01 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xen_clock.c,v 1.15 2023/07/28 10:39:14 riastradh Exp $");
 
 #include 
 #include 
@@ -120,6 +120,13 @@ SDT_PROBE_DEFINE3(sdt, xen, timecounter,
 SDT_PROBE_DEFINE2(sdt, xen, hardclock, systime__backward,
 "uint64_t"/*last_systime_ns*/,
 "uint64_t"/*this_systime_ns*/);
+SDT_PROBE_DEFINE2(sdt, xen, hardclock, tick,
+"uint64_t"/*last_systime_ns*/,
+"uint64_t"/*this_systime_ns*/);
+SDT_PROBE_DEFINE3(sdt, xen, hardclock, jump,
+"uint64_t"/*last_systime_ns*/,
+"uint64_t"/*this_systime_ns*/,
+"uint64_t"/*nticks*/);
 SDT_PROBE_DEFINE3(sdt, xen, hardclock, missed,
 "uint64_t"/*last_systime_ns*/,
 "uint64_t"/*this_systime_ns*/,
@@ -800,7 +807,8 @@ again:
 	 */
 	last = ci->ci_xen_hardclock_systime_ns;
 	now = xen_vcputime_systime_ns();
-	if (now < last) {
+	SDT_PROBE2(sdt, xen, hardclock, tick,  last, now);
+	if (__predict_false(now < last)) {
 		SDT_PROBE2(sdt, xen, hardclock, systime__backward,
 		last, now);
 #if XEN_CLOCK_DEBUG
@@ -818,6 +826,10 @@ again:
 	 * times as appears necessary based on how much time has
 	 * passed.
 	 */
+	if (__predict_false(delta >= 2*ns_per_tick)) {
+		SDT_PROBE3(sdt, xen, hardclock, jump,
+		last, now, delta/ns_per_tick);
+	}
 	while (delta >= ns_per_tick) {
 		ci->ci_xen_hardclock_systime_ns += ns_per_tick;
 		delta -= ns_per_tick;



CVS commit: src/sys/arch/xen/xen

2023-07-28 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri Jul 28 10:39:14 UTC 2023

Modified Files:
src/sys/arch/xen/xen: xen_clock.c

Log Message:
xen_clock(4): New hardclock dtrace probes.

sdt:xen:hardclock:tick(last, now)
  fires on every hardclock tick

sdt:xen:hardclock:jump(last, now, nticks)
  fires on every hardclock tick when (now - last) >= 2*NS_PER_TICK,
  i.e., this call to the timer interrupt handler requires multiple
  hardclock ticks


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/xen/xen/xen_clock.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/xen/xen

2023-07-28 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri Jul 28 10:39:01 UTC 2023

Modified Files:
src/sys/arch/xen/xen: xen_clock.c

Log Message:
xen_clock(4): Compute NS_PER_TICK only once per call.

This involves a division by an unknown number, so let's cache it.

XXX Could do better by precomputing it in xen_resumeclocks, with some
effort to ensure concurrent calls don't stomp on each other.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/xen/xen/xen_clock.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/xen/xen/xen_clock.c
diff -u src/sys/arch/xen/xen/xen_clock.c:1.13 src/sys/arch/xen/xen/xen_clock.c:1.14
--- src/sys/arch/xen/xen/xen_clock.c:1.13	Fri Jul 28 10:38:44 2023
+++ src/sys/arch/xen/xen/xen_clock.c	Fri Jul 28 10:39:01 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: xen_clock.c,v 1.13 2023/07/28 10:38:44 riastradh Exp $	*/
+/*	$NetBSD: xen_clock.c,v 1.14 2023/07/28 10:39:01 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2017, 2018 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
 #endif
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: xen_clock.c,v 1.13 2023/07/28 10:38:44 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xen_clock.c,v 1.14 2023/07/28 10:39:01 riastradh Exp $");
 
 #include 
 #include 
@@ -782,6 +782,7 @@ xen_resumeclocks(struct cpu_info *ci)
 static int
 xen_timer_handler(void *cookie, struct clockframe *frame)
 {
+	const uint64_t ns_per_tick = NS_PER_TICK;
 	struct cpu_info *ci = curcpu();
 	uint64_t last, now, delta, next;
 	int error;
@@ -817,11 +818,11 @@ again:
 	 * times as appears necessary based on how much time has
 	 * passed.
 	 */
-	while (delta >= NS_PER_TICK) {
-		ci->ci_xen_hardclock_systime_ns += NS_PER_TICK;
-		delta -= NS_PER_TICK;
+	while (delta >= ns_per_tick) {
+		ci->ci_xen_hardclock_systime_ns += ns_per_tick;
+		delta -= ns_per_tick;
 		hardclock(frame);
-		if (__predict_false(delta >= NS_PER_TICK)) {
+		if (__predict_false(delta >= ns_per_tick)) {
 			SDT_PROBE3(sdt, xen, hardclock, missed,
 			last, now, delta);
 			ci->ci_xen_missed_hardclock_evcnt.ev_count++;
@@ -833,7 +834,7 @@ again:
 	 * time is in the past, so update our idea of what the Xen
 	 * system time is and try again.
 	 */
-	next = ci->ci_xen_hardclock_systime_ns + NS_PER_TICK;
+	next = ci->ci_xen_hardclock_systime_ns + ns_per_tick;
 	error = HYPERVISOR_set_timer_op(next);
 	if (error)
 		goto again;



CVS commit: src/sys/arch/xen/xen

2023-07-28 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri Jul 28 10:39:01 UTC 2023

Modified Files:
src/sys/arch/xen/xen: xen_clock.c

Log Message:
xen_clock(4): Compute NS_PER_TICK only once per call.

This involves a division by an unknown number, so let's cache it.

XXX Could do better by precomputing it in xen_resumeclocks, with some
effort to ensure concurrent calls don't stomp on each other.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/xen/xen/xen_clock.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/xen/xen

2023-07-28 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri Jul 28 10:38:44 UTC 2023

Modified Files:
src/sys/arch/xen/xen: xen_clock.c

Log Message:
xen_clock(4): Fix whitespace and sprinkle comments.

No functional change intended.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/xen/xen/xen_clock.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/xen/xen/xen_clock.c
diff -u src/sys/arch/xen/xen/xen_clock.c:1.12 src/sys/arch/xen/xen/xen_clock.c:1.13
--- src/sys/arch/xen/xen/xen_clock.c:1.12	Mon Jul 17 10:12:54 2023
+++ src/sys/arch/xen/xen/xen_clock.c	Fri Jul 28 10:38:44 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: xen_clock.c,v 1.12 2023/07/17 10:12:54 bouyer Exp $	*/
+/*	$NetBSD: xen_clock.c,v 1.13 2023/07/28 10:38:44 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2017, 2018 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
 #endif
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: xen_clock.c,v 1.12 2023/07/17 10:12:54 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xen_clock.c,v 1.13 2023/07/28 10:38:44 riastradh Exp $");
 
 #include 
 #include 
@@ -673,11 +673,31 @@ xen_suspendclocks(struct cpu_info *ci)
 	KASSERT(ci == curcpu());
 	KASSERT(kpreempt_disabled());
 
+	/*
+	 * Find the VIRQ_TIMER event channel and close it so new timer
+	 * interrupt events stop getting delivered to it.
+	 *
+	 * XXX Should this happen later?  This is not the reverse order
+	 * of xen_resumeclocks.  It is apparently necessary in this
+	 * order only because we don't stash evtchn anywhere, but we
+	 * could stash it.
+	 */
 	evtch = unbind_virq_from_evtch(VIRQ_TIMER);
 	KASSERT(evtch != -1);
 
+	/*
+	 * Mask the event channel so we stop getting new interrupts on
+	 * it.
+	 */
 	hypervisor_mask_event(evtch);
-	event_remove_handler(evtch, 
+
+	/*
+	 * Now that we are no longer getting new interrupts, remove the
+	 * handler and wait for any existing calls to the handler to
+	 * complete.  After this point, there can be no concurrent
+	 * calls to xen_timer_handler.
+	 */
+	event_remove_handler(evtch,
 	__FPTRCAST(int (*)(void *), xen_timer_handler), ci);
 
 	aprint_verbose("Xen clock: removed event channel %d\n", evtch);
@@ -705,9 +725,16 @@ xen_resumeclocks(struct cpu_info *ci)
 	KASSERT(ci == curcpu());
 	KASSERT(kpreempt_disabled());
 
+	/*
+	 * Allocate an event channel to receive VIRQ_TIMER events.
+	 */
 	evtch = bind_virq_to_evtch(VIRQ_TIMER);
 	KASSERT(evtch != -1);
 
+	/*
+	 * Set an event handler for VIRQ_TIMER events to call
+	 * xen_timer_handler.
+	 */
 	snprintf(intr_xname, sizeof(intr_xname), "%s clock",
 	device_xname(ci->ci_dev));
 	/* XXX sketchy function pointer cast -- fix the API, please */
@@ -716,7 +743,6 @@ xen_resumeclocks(struct cpu_info *ci)
 	ci, IPL_CLOCK, NULL, intr_xname, true, ci) == NULL)
 		panic("failed to establish timer interrupt handler");
 
-
 	aprint_verbose("Xen %s: using event channel %d\n", intr_xname, evtch);
 
 	/* Disarm the periodic timer on Xen>=3.1 which is allegedly buggy.  */
@@ -729,11 +755,15 @@ xen_resumeclocks(struct cpu_info *ci)
 	/* Pretend the last hardclock happened right now.  */
 	ci->ci_xen_hardclock_systime_ns = xen_vcputime_systime_ns();
 
-
 	/* Arm the one-shot timer.  */
 	error = HYPERVISOR_set_timer_op(ci->ci_xen_hardclock_systime_ns +
 	NS_PER_TICK);
 	KASSERT(error == 0);
+
+	/*
+	 * Ready to go.  Unmask the event.  After this point, Xen may
+	 * start calling xen_timer_handler.
+	 */
 	hypervisor_unmask_event(evtch);
 
 	/* We'd better not have switched CPUs.  */



CVS commit: src/sys/arch/xen/xen

2023-07-28 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri Jul 28 10:38:44 UTC 2023

Modified Files:
src/sys/arch/xen/xen: xen_clock.c

Log Message:
xen_clock(4): Fix whitespace and sprinkle comments.

No functional change intended.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/xen/xen/xen_clock.c

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



CVS commit: src/sys/kern

2023-07-28 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri Jul 28 10:37:28 UTC 2023

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

Log Message:
timecounter(9): Link to phk's timecounter paper for reference.

No functional change intended.


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

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

Modified files:

Index: src/sys/kern/kern_tc.c
diff -u src/sys/kern/kern_tc.c:1.74 src/sys/kern/kern_tc.c:1.75
--- src/sys/kern/kern_tc.c:1.74	Thu Jul 27 01:48:49 2023
+++ src/sys/kern/kern_tc.c	Fri Jul 28 10:37:28 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: kern_tc.c,v 1.74 2023/07/27 01:48:49 riastradh Exp $ */
+/* $NetBSD: kern_tc.c,v 1.75 2023/07/28 10:37:28 riastradh Exp $ */
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -38,9 +38,13 @@
  * ---
  */
 
+/*
+ * https://papers.freebsd.org/2002/phk-timecounters.files/timecounter.pdf
+ */
+
 #include 
 /* __FBSDID("$FreeBSD: src/sys/kern/kern_tc.c,v 1.166 2005/09/19 22:16:31 andre Exp $"); */
-__KERNEL_RCSID(0, "$NetBSD: kern_tc.c,v 1.74 2023/07/27 01:48:49 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_tc.c,v 1.75 2023/07/28 10:37:28 riastradh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ntp.h"



CVS commit: src/sys/kern

2023-07-28 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri Jul 28 10:37:28 UTC 2023

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

Log Message:
timecounter(9): Link to phk's timecounter paper for reference.

No functional change intended.


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

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



CVS commit: src/crypto/external/bsd/openssh/dist

2023-07-28 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Fri Jul 28 09:47:37 UTC 2023

Modified Files:
src/crypto/external/bsd/openssh/dist: sshd.c

Log Message:
openssh: Apply __dead to print_config() to fix build with clang


To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 src/crypto/external/bsd/openssh/dist/sshd.c

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



CVS commit: src/crypto/external/bsd/openssh/dist

2023-07-28 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Fri Jul 28 09:47:37 UTC 2023

Modified Files:
src/crypto/external/bsd/openssh/dist: sshd.c

Log Message:
openssh: Apply __dead to print_config() to fix build with clang


To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 src/crypto/external/bsd/openssh/dist/sshd.c

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

Modified files:

Index: src/crypto/external/bsd/openssh/dist/sshd.c
diff -u src/crypto/external/bsd/openssh/dist/sshd.c:1.48 src/crypto/external/bsd/openssh/dist/sshd.c:1.49
--- src/crypto/external/bsd/openssh/dist/sshd.c:1.48	Wed Jul 26 17:58:16 2023
+++ src/crypto/external/bsd/openssh/dist/sshd.c	Fri Jul 28 09:47:37 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: sshd.c,v 1.48 2023/07/26 17:58:16 christos Exp $	*/
+/*	$NetBSD: sshd.c,v 1.49 2023/07/28 09:47:37 rin Exp $	*/
 /* $OpenBSD: sshd.c,v 1.600 2023/03/08 04:43:12 guenther Exp $ */
 /*
  * Author: Tatu Ylonen 
@@ -44,7 +44,7 @@
  */
 
 #include "includes.h"
-__RCSID("$NetBSD: sshd.c,v 1.48 2023/07/26 17:58:16 christos Exp $");
+__RCSID("$NetBSD: sshd.c,v 1.49 2023/07/28 09:47:37 rin Exp $");
 #include 
 #include 
 #include 
@@ -1484,7 +1484,7 @@ prepare_proctitle(int ac, char **av)
 	return ret;
 }
 
-static void
+__dead static void
 print_config(struct ssh *ssh, struct connection_info *connection_info)
 {
 	/*



CVS commit: src/usr.sbin/iostat

2023-07-28 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Fri Jul 28 09:18:59 UTC 2023

Modified Files:
src/usr.sbin/iostat: iostat.8 iostat.c

Log Message:
add iostat -X option, limited alternative statistics.

this is like the "-D" option, except it skips the xfers/s, and
reports MB/s instead of KB/s.  allows for far more devices to
be displayed per line by default (about 50% more.)


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/usr.sbin/iostat/iostat.8
cvs rdiff -u -r1.69 -r1.70 src/usr.sbin/iostat/iostat.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/iostat/iostat.8
diff -u src/usr.sbin/iostat/iostat.8:1.28 src/usr.sbin/iostat/iostat.8:1.29
--- src/usr.sbin/iostat/iostat.8:1.28	Sat Jun 18 11:33:13 2022
+++ src/usr.sbin/iostat/iostat.8	Fri Jul 28 09:18:58 2023
@@ -1,4 +1,4 @@
-.\"	$NetBSD: iostat.8,v 1.28 2022/06/18 11:33:13 kre Exp $
+.\"	$NetBSD: iostat.8,v 1.29 2023/07/28 09:18:58 mrg Exp $
 .\"
 .\" Copyright (c) 1985, 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -29,7 +29,7 @@
 .\"
 .\"	from: @(#)iostat.8	8.1 (Berkeley) 6/6/93
 .\"
-.Dd June 18, 2022
+.Dd July 28, 2023
 .Dt IOSTAT 8
 .Os
 .Sh NAME
@@ -37,7 +37,7 @@
 .Nd report I/O statistics
 .Sh SYNOPSIS
 .Nm
-.Op Fl CdDITxyz
+.Op Fl CdDITxXyz
 .Op Fl c Ar count
 .Op Fl H Ar height
 .Op Fl W Ar width
@@ -66,6 +66,7 @@ Only the last disk option specified
 .Fl ( d ,
 .Fl D ,
 .Fl x ,
+.Fl X ,
 or
 .Fl y )
 is used.
@@ -90,6 +91,7 @@ This is enabled by default unless any of
 .Fl D ,
 .Fl T ,
 .Fl x ,
+.Fl X ,
 or
 .Fl y
 flags are used.
@@ -150,6 +152,7 @@ This is enabled by default unless one, o
 .Fl d ,
 .Fl D ,
 .Fl x ,
+.Fl X ,
 or
 .Fl y
 flags are used.
@@ -198,6 +201,13 @@ The
 and
 .Fl T
 options are ignored with this output format.
+.It Fl X
+Show limited alternative disk statistics.
+Displays megabytes transferred, and time spent in transfers, during the
+.Ar wait
+period (or since boot with
+.Fl I ) .
+Use of this flag disables the default display.
 .It Fl y
 Shows the extended statistics (as with
 .Fl x )
@@ -255,6 +265,7 @@ Megabytes transferred per second
 The alternative display format, (selected with
 .Fl D ) ,
 presents the following values:
+.Pp
 .Bl -tag -width indent -compact
 .It xfr
 Disk transfers
@@ -267,6 +278,7 @@ Seconds spent in disk activity
 With the
 .Fl y
 flag, the following queuing measurements are added:
+.Pp
 .Bl -tag -width indent -compact
 .It wait
 Number of I/O requests queued up
@@ -281,6 +293,17 @@ Seconds spent in the waiting queue.
 Queuing data might not be available from all drivers
 and is then shown as zeros.
 .El
+.Pp
+With the
+.Fl X
+flag, the following queuing measurements are added:
+.Pp
+.Bl -tag -width indent -compact
+.It MB/s
+Megabytes transferred per second
+.It time
+Seconds spent in disk activity
+.El
 .It cpu
 .Bl -tag -width indent -compact
 .It \
@@ -322,6 +345,10 @@ Collection of queuing values and the
 .Fl y
 option were added in
 .Nx 8.0 .
+The
+.Fl X
+option was added in
+.Nx 11.0 .
 The archaic option format:
 .br
 .ti +3n

Index: src/usr.sbin/iostat/iostat.c
diff -u src/usr.sbin/iostat/iostat.c:1.69 src/usr.sbin/iostat/iostat.c:1.70
--- src/usr.sbin/iostat/iostat.c:1.69	Sat Jun 18 11:33:13 2022
+++ src/usr.sbin/iostat/iostat.c	Fri Jul 28 09:18:58 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: iostat.c,v 1.69 2022/06/18 11:33:13 kre Exp $	*/
+/*	$NetBSD: iostat.c,v 1.70 2023/07/28 09:18:58 mrg Exp $	*/
 
 /*
  * Copyright (c) 1996 John M. Vinopal
@@ -71,7 +71,7 @@ __COPYRIGHT("@(#) Copyright (c) 1986, 19
 #if 0
 static char sccsid[] = "@(#)iostat.c	8.3 (Berkeley) 4/28/95";
 #else
-__RCSID("$NetBSD: iostat.c,v 1.69 2022/06/18 11:33:13 kre Exp $");
+__RCSID("$NetBSD: iostat.c,v 1.70 2023/07/28 09:18:58 mrg Exp $");
 #endif
 #endif /* not lint */
 
@@ -107,19 +107,20 @@ static char Line_Marker[] = "___
 #define	MIN(a,b)	(((a)<(b))?(a):(b))
 
 #define	ISSET(x, a)	((x) & (a))
-#define	SHOW_CPU	(1<<0)
-#define	SHOW_TTY	(1<<1)
-#define	SHOW_STATS_1	(1<<2)
-#define	SHOW_STATS_2	(1<<3)
-#define	SHOW_STATS_X	(1<<4)
-#define	SHOW_STATS_Y	(1<<5)
-#define	SHOW_UPDATES	(1<<6)
-#define	SHOW_TOTALS	(1<<7)
-#define	SHOW_NEW_TOTALS	(1<<8)
-#define	SUPPRESS_ZERO	(1<<9)
+#define	SHOW_CPU	(1u<<0)
+#define	SHOW_TTY	(1u<<1)
+#define	SHOW_STATS_1	(1u<<2)
+#define	SHOW_STATS_2	(1u<<3)
+#define	SHOW_STATS_3	(1u<<4)
+#define	SHOW_STATS_X	(1u<<5)
+#define	SHOW_STATS_Y	(1u<<6)
+#define	SHOW_UPDATES	(1u<<7)
+#define	SHOW_TOTALS	(1u<<8)
+#define	SHOW_NEW_TOTALS	(1u<<9)
+#define	SUPPRESS_ZERO	(1u<<10)
 
 #define	SHOW_STATS_ALL	(SHOW_STATS_1 | SHOW_STATS_2 |	\
-			SHOW_STATS_X | SHOW_STATS_Y)
+			 SHOW_STATS_3 | SHOW_STATS_X | SHOW_STATS_Y)
 
 /*
  * Decide how many screen columns each output statistic is given
@@ -165,6 +166,8 @@ static char Line_Marker[] = "___
 #define	LAYOUT_DRIVE_2_TBUSY	9	/*		time	*/
 #define	LAYOUT_DRIVE_2_BUSY	5	

CVS commit: src/usr.sbin/iostat

2023-07-28 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Fri Jul 28 09:18:59 UTC 2023

Modified Files:
src/usr.sbin/iostat: iostat.8 iostat.c

Log Message:
add iostat -X option, limited alternative statistics.

this is like the "-D" option, except it skips the xfers/s, and
reports MB/s instead of KB/s.  allows for far more devices to
be displayed per line by default (about 50% more.)


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/usr.sbin/iostat/iostat.8
cvs rdiff -u -r1.69 -r1.70 src/usr.sbin/iostat/iostat.c

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



CVS commit: src/tools/gcc

2023-07-28 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Fri Jul 28 08:05:29 UTC 2023

Modified Files:
src/tools/gcc: Makefile mknative-gcc.old

Log Message:
gcc 10 is now in gcc.old, make mknative-gcc.old gcc-10 happy.


To generate a diff of this commit:
cvs rdiff -u -r1.105 -r1.106 src/tools/gcc/Makefile
cvs rdiff -u -r1.10 -r1.11 src/tools/gcc/mknative-gcc.old

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

Modified files:

Index: src/tools/gcc/Makefile
diff -u src/tools/gcc/Makefile:1.105 src/tools/gcc/Makefile:1.106
--- src/tools/gcc/Makefile:1.105	Sat Sep 18 01:47:10 2021
+++ src/tools/gcc/Makefile	Fri Jul 28 08:05:29 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.105 2021/09/18 01:47:10 christos Exp $
+#	$NetBSD: Makefile,v 1.106 2023/07/28 08:05:29 mrg Exp $
 
 .include 
 
@@ -8,7 +8,7 @@ MODULE=		${EXTERNAL_GCC_SUBDIR}
 GCCDIST=	${.CURDIR}/../../external/gpl3/${EXTERNAL_GCC_SUBDIR}/dist
 GNUHOSTDIST=	${GCCDIST}
 
-.if ${HAVE_GCC} == 9
+.if ${HAVE_GCC} == 10
 MKNATIVE=		${.CURDIR}/mknative-gcc.old
 .endif
 

Index: src/tools/gcc/mknative-gcc.old
diff -u src/tools/gcc/mknative-gcc.old:1.10 src/tools/gcc/mknative-gcc.old:1.11
--- src/tools/gcc/mknative-gcc.old:1.10	Sun Apr 11 01:44:14 2021
+++ src/tools/gcc/mknative-gcc.old	Fri Jul 28 08:05:29 2023
@@ -1,10 +1,10 @@
 #!/bin/sh
-#	$NetBSD: mknative-gcc.old,v 1.10 2021/04/11 01:44:14 mrg Exp $
+#	$NetBSD: mknative-gcc.old,v 1.11 2023/07/28 08:05:29 mrg Exp $
 #
 # Shell script for generating all the constants needed for a native
 # platform build of gcc.
 #
-# This version is for GCC 9.3
+# This version is for GCC 10.3
 
 # initialise
 
@@ -234,8 +234,10 @@ get_libstdcxx_v3 () {
 	_headers1="$_headers1 pb_headers1 pb_headers2 pb_headers3 pb_headers4"
 	_headers1="$_headers1 pb_headers5 pb_headers6 pb_headers7"
 	_headers1="$_headers1 bits_headers ext_headers host_headers"
-	_headers1="$_headers1 thread_host_headers pstl_headers"
+	_headers1="$_headers1 pstl_headers"
 	_headers1="$_headers1 profile_headers profile_impl_headers"
+	_headers1="$_headers1 experimental_headers experimental_bits_headers"
+	_headers1="$_headers1 ext_host_headers"
 
 	# build files
 	for h in $_build_headers; do
@@ -274,12 +276,10 @@ get_libstdcxx_v3 () {
 			sed -e 's/^G_libc__17convenience_la_SOURCES=/G_CPP17_SOURCES=/'
 		getvars $_PLATFORM/libstdc++-v3/src/c++11/Makefile \
 			libc__11convenience_la_SOURCES | \
-			sed -e 's/^G_libc__11convenience_la_SOURCES=/G_CPP11_SOURCES=/' \
-			-e 's/codecvt.cc/c11-codecvt.cc/'
+			sed -e 's/^G_libc__11convenience_la_SOURCES=/G_CPP11_SOURCES=/'
 		getvars $_PLATFORM/libstdc++-v3/src/c++98/Makefile \
 			GLIBCXX_ABI_FLAGS libc__98convenience_la_SOURCES | \
-			sed -e 's/^G_libc__98convenience_la_SOURCES=/G_CPP98_SOURCES=/' \
-			-e 's/codecvt.cc/c98-codecvt.cc/'
+			sed -e 's/^G_libc__98convenience_la_SOURCES=/G_CPP98_SOURCES=/'
 		getvars $_PLATFORM/libstdc++-v3/src/filesystem/Makefile \
 			libstdc__fs_la_SOURCES | \
 			sed -e 's/^G_libstdc__fs_la_SOURCES=/G_FILESYSTEM_SOURCES=/'
@@ -312,9 +312,11 @@ get_libsanitizer () {
 		getvars $_PLATFORM/libsanitizer/lsan/Makefile \
 			lsan_files
 		getvars $_PLATFORM/libsanitizer/tsan/Makefile \
-			tsan_plugin_files
+			tsan_files
 		getvars $_PLATFORM/libsanitizer/ubsan/Makefile \
-			ubsan_plugin_files
+			ubsan_files
+		getvars $_PLATFORM/libsanitizer/interception/Makefile \
+			interception_files
 
 	} | sanitise_includes \
 	  | write_mk $_OUTDIRBASE/lib/$_subdir/arch/$_MACHINE_ARCH/defs.mk
@@ -399,7 +401,7 @@ get_gcc () {
 			| write_mk $_OUTDIRBASE/usr.bin/common-target/arch/$_MACHINE_ARCH.mk
 
 	write_c $_OUTDIRBASE/usr.bin/libcpp/arch/$_MACHINE_ARCH/config.h <$_TMPDIR/libcpp/config.h
-	hfiles='auto-host configargs config bconfig bversion plugin-version multilib tm'
+	hfiles='auto-host configargs config bconfig bversion plugin-version multilib tm omp-device-properties'
 	for f in $hfiles; do
 		write_c $_OUTDIRBASE/usr.bin/$_subdir/arch/$_MACHINE_ARCH/$f.h <$_TMPDIR/gcc/$f.h
 		if [ "${_MACHINE_ARCH}" = "powerpc" -a "${f}" = "configargs" ]
@@ -491,7 +493,7 @@ gcc*)
 	get_gcc_libiberty gcc
 	get_libobjc libobjc
 	get_libstdcxx_v3 libstdc++-v3 gcc
-	# XXX not yet
+	# wants libstdc++-v3 built
 	# get_libsanitizer libsanitizer
 	get_libdecnumber libdecnumber
 	get_libgomp libgomp



CVS commit: src/tools/gcc

2023-07-28 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Fri Jul 28 08:05:29 UTC 2023

Modified Files:
src/tools/gcc: Makefile mknative-gcc.old

Log Message:
gcc 10 is now in gcc.old, make mknative-gcc.old gcc-10 happy.


To generate a diff of this commit:
cvs rdiff -u -r1.105 -r1.106 src/tools/gcc/Makefile
cvs rdiff -u -r1.10 -r1.11 src/tools/gcc/mknative-gcc.old

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



CVS commit: src/lib/csu/arch/vax

2023-07-28 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Fri Jul 28 07:17:30 UTC 2023

Modified Files:
src/lib/csu/arch/vax: crtbegin.S

Log Message:
vax/csu: Use register name provided by asm.h. No binary changes.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/lib/csu/arch/vax/crtbegin.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/csu/arch/vax/crtbegin.S
diff -u src/lib/csu/arch/vax/crtbegin.S:1.8 src/lib/csu/arch/vax/crtbegin.S:1.9
--- src/lib/csu/arch/vax/crtbegin.S:1.8	Fri Jul 28 07:04:41 2023
+++ src/lib/csu/arch/vax/crtbegin.S	Fri Jul 28 07:17:30 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: crtbegin.S,v 1.8 2023/07/28 07:04:41 rin Exp $	*/
+/*	$NetBSD: crtbegin.S,v 1.9 2023/07/28 07:17:30 rin Exp $	*/
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -30,7 +30,7 @@
 
 #include 
 
-RCSID("$NetBSD: crtbegin.S,v 1.8 2023/07/28 07:04:41 rin Exp $")
+RCSID("$NetBSD: crtbegin.S,v 1.9 2023/07/28 07:17:30 rin Exp $")
 
 	.section	.ctors, "aw", @progbits
 	.p2align 2
@@ -82,7 +82,7 @@ __dso_handle:
 
 	.hidden __do_global_dtors_aux
 
-_ENTRY(__do_global_dtors_aux, 0x0100)		/* save r8 */
+_ENTRY(__do_global_dtors_aux, R8)
 	tstb	__finished			/* done this already? */
 	bneq	4f
 	movb	$1, __finished			/* mark it as done */
@@ -132,7 +132,7 @@ END(__do_global_dtors_aux)
 
 	.hidden __do_global_ctors_aux
 
-_ENTRY(__do_global_ctors_aux, 0x0100)		/* save r8 */
+_ENTRY(__do_global_ctors_aux, R8)
 	tstb	__initialized
 	bneq	4f
 	movb	$1, __initialized



CVS commit: src/lib/csu/arch/vax

2023-07-28 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Fri Jul 28 07:17:30 UTC 2023

Modified Files:
src/lib/csu/arch/vax: crtbegin.S

Log Message:
vax/csu: Use register name provided by asm.h. No binary changes.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/lib/csu/arch/vax/crtbegin.S

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



CVS commit: src/lib/csu/arch/vax

2023-07-28 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Fri Jul 28 07:04:41 UTC 2023

Modified Files:
src/lib/csu/arch/vax: crtbegin.S

Log Message:
vax/csu: __do_global_ctors_aux: Save actually-used r8, instead of r11

Thanks Kalvis Duckmanton for report and patch on tech-toolchain:
https://mail-index.netbsd.org/tech-toolchain/2023/07/28/msg004321.html


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/lib/csu/arch/vax/crtbegin.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/csu/arch/vax/crtbegin.S
diff -u src/lib/csu/arch/vax/crtbegin.S:1.7 src/lib/csu/arch/vax/crtbegin.S:1.8
--- src/lib/csu/arch/vax/crtbegin.S:1.7	Sun Mar 16 11:41:30 2014
+++ src/lib/csu/arch/vax/crtbegin.S	Fri Jul 28 07:04:41 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: crtbegin.S,v 1.7 2014/03/16 11:41:30 joerg Exp $	*/
+/*	$NetBSD: crtbegin.S,v 1.8 2023/07/28 07:04:41 rin Exp $	*/
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -30,7 +30,7 @@
 
 #include 
 
-RCSID("$NetBSD: crtbegin.S,v 1.7 2014/03/16 11:41:30 joerg Exp $")
+RCSID("$NetBSD: crtbegin.S,v 1.8 2023/07/28 07:04:41 rin Exp $")
 
 	.section	.ctors, "aw", @progbits
 	.p2align 2
@@ -132,7 +132,7 @@ END(__do_global_dtors_aux)
 
 	.hidden __do_global_ctors_aux
 
-_ENTRY(__do_global_ctors_aux, 0x0800)
+_ENTRY(__do_global_ctors_aux, 0x0100)		/* save r8 */
 	tstb	__initialized
 	bneq	4f
 	movb	$1, __initialized



CVS commit: src/lib/csu/arch/vax

2023-07-28 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Fri Jul 28 07:04:41 UTC 2023

Modified Files:
src/lib/csu/arch/vax: crtbegin.S

Log Message:
vax/csu: __do_global_ctors_aux: Save actually-used r8, instead of r11

Thanks Kalvis Duckmanton for report and patch on tech-toolchain:
https://mail-index.netbsd.org/tech-toolchain/2023/07/28/msg004321.html


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/lib/csu/arch/vax/crtbegin.S

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



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

2023-07-28 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Fri Jul 28 06:21:02 UTC 2023

Modified Files:
src/sys/arch/arm/arm32: bus_dma.c

Log Message:
arm/bus_dma: Fix misleading comment:

- * For a virtually-indexed write-back cache, we need
- * to do the following things:
+ * For a write-back cache, we need to do the following things:

This comment was written long ago when we supported only virtually-
indexed caches for arm. But subsequent comments are valid also for
physically-indexed cache.


To generate a diff of this commit:
cvs rdiff -u -r1.143 -r1.144 src/sys/arch/arm/arm32/bus_dma.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/arm32/bus_dma.c
diff -u src/sys/arch/arm/arm32/bus_dma.c:1.143 src/sys/arch/arm/arm32/bus_dma.c:1.144
--- src/sys/arch/arm/arm32/bus_dma.c:1.143	Mon Apr  3 06:42:57 2023
+++ src/sys/arch/arm/arm32/bus_dma.c	Fri Jul 28 06:21:02 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus_dma.c,v 1.143 2023/04/03 06:42:57 skrll Exp $	*/
+/*	$NetBSD: bus_dma.c,v 1.144 2023/07/28 06:21:02 rin Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2020 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
 #include "opt_cputypes.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.143 2023/04/03 06:42:57 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.144 2023/07/28 06:21:02 rin Exp $");
 
 #include 
 
@@ -1114,8 +1114,7 @@ _bus_dmamap_sync(bus_dma_tag_t t, bus_dm
 	len, offset, map->dm_mapsize);
 
 	/*
-	 * For a virtually-indexed write-back cache, we need
-	 * to do the following things:
+	 * For a write-back cache, we need to do the following things:
 	 *
 	 *	PREREAD -- Invalidate the D-cache.  We do this
 	 *	here in case a write-back is required by the back-end.



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

2023-07-28 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Fri Jul 28 06:21:02 UTC 2023

Modified Files:
src/sys/arch/arm/arm32: bus_dma.c

Log Message:
arm/bus_dma: Fix misleading comment:

- * For a virtually-indexed write-back cache, we need
- * to do the following things:
+ * For a write-back cache, we need to do the following things:

This comment was written long ago when we supported only virtually-
indexed caches for arm. But subsequent comments are valid also for
physically-indexed cache.


To generate a diff of this commit:
cvs rdiff -u -r1.143 -r1.144 src/sys/arch/arm/arm32/bus_dma.c

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