CVS commit: src

2022-04-01 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Apr  1 23:16:32 UTC 2022

Modified Files:
src/tests/usr.bin/xlint/lint1: decl_direct_abstract.c
decl_direct_abstract.exp msg_012.c msg_012.exp msg_014.c
msg_014.exp msg_144.c msg_144.exp parse_type_name.c
parse_type_name.exp
src/usr.bin/xlint/lint1: err.c tree.c

Log Message:
lint: add type details to message about 'sizeof(function)'

The code in add_function is severely broken, it mixes up the return type
of the function with the argument types.  For now, at least show the
guessed type in the diagnostic, to allow human readers quickly spot the
bug.

Extend the test cases in decl_direct_abstract.c to show that the
behavior differs unreasonably if the first parameter of the function is
equal to its return type.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/tests/usr.bin/xlint/lint1/decl_direct_abstract.c
cvs rdiff -u -r1.4 -r1.5 \
src/tests/usr.bin/xlint/lint1/decl_direct_abstract.exp \
src/tests/usr.bin/xlint/lint1/msg_144.c
cvs rdiff -u -r1.3 -r1.4 src/tests/usr.bin/xlint/lint1/msg_012.c \
src/tests/usr.bin/xlint/lint1/msg_012.exp \
src/tests/usr.bin/xlint/lint1/msg_014.c \
src/tests/usr.bin/xlint/lint1/msg_014.exp \
src/tests/usr.bin/xlint/lint1/msg_144.exp
cvs rdiff -u -r1.7 -r1.8 src/tests/usr.bin/xlint/lint1/parse_type_name.c
cvs rdiff -u -r1.6 -r1.7 src/tests/usr.bin/xlint/lint1/parse_type_name.exp
cvs rdiff -u -r1.154 -r1.155 src/usr.bin/xlint/lint1/err.c
cvs rdiff -u -r1.413 -r1.414 src/usr.bin/xlint/lint1/tree.c

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

Modified files:

Index: src/tests/usr.bin/xlint/lint1/decl_direct_abstract.c
diff -u src/tests/usr.bin/xlint/lint1/decl_direct_abstract.c:1.5 src/tests/usr.bin/xlint/lint1/decl_direct_abstract.c:1.6
--- src/tests/usr.bin/xlint/lint1/decl_direct_abstract.c:1.5	Fri Apr  1 22:28:21 2022
+++ src/tests/usr.bin/xlint/lint1/decl_direct_abstract.c	Fri Apr  1 23:16:32 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: decl_direct_abstract.c,v 1.5 2022/04/01 22:28:21 rillig Exp $	*/
+/*	$NetBSD: decl_direct_abstract.c,v 1.6 2022/04/01 23:16:32 rillig Exp $	*/
 # 3 "decl_direct_abstract.c"
 
 /*
@@ -77,12 +77,119 @@ void int_array_3_array(int[3][7]);
 /* supported since cgram.y 1.363 from 2021-09-14 */
 void int_array_ast_array(int[*][7]);
 
-/* expect+1: error: cannot take size/alignment of function [144] */
+/* expect+1: error: cannot take size/alignment of function type 'function() returning int' [144] */
 unsigned long size_unspecified_args = sizeof(int());
 /* FIXME: Must be 'of function', not 'of void'. */
 /* expect+1: error: cannot take size/alignment of void [146] */
 unsigned long size_prototype_void = sizeof(int(void));
-/* TODO: error: cannot take size/alignment of function [144] */
+/* TODO: error: cannot take size/alignment of function type 'function(double) returning int' [144] */
 unsigned long size_prototype_unnamed = sizeof(int(double));
-/* TODO: error: cannot take size/alignment of function [144] */
+/* TODO: error: cannot take size/alignment of function type 'function(double) returning int' [144] */
 unsigned long size_prototype_named = sizeof(int(double dbl));
+
+/* expect+2: error: cannot take size/alignment of function type 'function() returning int' [144] */
+/* expect+1: error: negative array dimension (-1000) [20] */
+int size_unspecified_args_return_int[-1000 - (int)sizeof(int())];
+
+/* expect+2: error: cannot take size/alignment of function type 'function() returning char' [144] */
+/* expect+1: error: negative array dimension (-1000) [20] */
+int size_unspecified_args_return_char[-1000 - (int)sizeof(char())];
+
+/* FIXME: 'of void' must be 'of function'. */
+/* expect+2: error: cannot take size/alignment of void [146] */
+/* expect+1: error: negative array dimension (-1000) [20] */
+int size_prototype_void_return_int[-1000 - (int)sizeof(int(void))];
+
+/* FIXME: 'of void' must be 'of function'. */
+/* expect+2: error: cannot take size/alignment of void [146] */
+/* expect+1: error: negative array dimension (-1000) [20] */
+int size_prototype_void_return_double[-1000 - (int)sizeof(double(void))];
+
+/* expect+1: error: negative array dimension (-1008) [20] */
+int size_prototype_unnamed_return_int[-1000 - (int)sizeof(int(double))];
+
+/* expect+1: error: negative array dimension (-1008) [20] */
+int size_prototype_unnamed_return_pchar[-1000 - (int)sizeof(char *(double))];
+
+/* expect+1: error: negative array dimension (-1008) [20] */
+int size_prototype_named_return_int[-1000 - (int)sizeof(int(double dbl))];
+
+/* expect+1: error: negative array dimension (-1008) [20] */
+int size_prototype_named_return_pppchar[-1000 - (int)sizeof(char ***(double dbl))];
+
+
+typedef struct {
+	char a[1];
+} a01;
+
+typedef struct {
+	char a[4];
+} a04;
+
+typedef struct {
+	char a[8];
+} a08;
+
+typedef struct {
+	char a[32];
+} a32;

CVS commit: src

2022-04-01 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Apr  1 23:16:32 UTC 2022

Modified Files:
src/tests/usr.bin/xlint/lint1: decl_direct_abstract.c
decl_direct_abstract.exp msg_012.c msg_012.exp msg_014.c
msg_014.exp msg_144.c msg_144.exp parse_type_name.c
parse_type_name.exp
src/usr.bin/xlint/lint1: err.c tree.c

Log Message:
lint: add type details to message about 'sizeof(function)'

The code in add_function is severely broken, it mixes up the return type
of the function with the argument types.  For now, at least show the
guessed type in the diagnostic, to allow human readers quickly spot the
bug.

Extend the test cases in decl_direct_abstract.c to show that the
behavior differs unreasonably if the first parameter of the function is
equal to its return type.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/tests/usr.bin/xlint/lint1/decl_direct_abstract.c
cvs rdiff -u -r1.4 -r1.5 \
src/tests/usr.bin/xlint/lint1/decl_direct_abstract.exp \
src/tests/usr.bin/xlint/lint1/msg_144.c
cvs rdiff -u -r1.3 -r1.4 src/tests/usr.bin/xlint/lint1/msg_012.c \
src/tests/usr.bin/xlint/lint1/msg_012.exp \
src/tests/usr.bin/xlint/lint1/msg_014.c \
src/tests/usr.bin/xlint/lint1/msg_014.exp \
src/tests/usr.bin/xlint/lint1/msg_144.exp
cvs rdiff -u -r1.7 -r1.8 src/tests/usr.bin/xlint/lint1/parse_type_name.c
cvs rdiff -u -r1.6 -r1.7 src/tests/usr.bin/xlint/lint1/parse_type_name.exp
cvs rdiff -u -r1.154 -r1.155 src/usr.bin/xlint/lint1/err.c
cvs rdiff -u -r1.413 -r1.414 src/usr.bin/xlint/lint1/tree.c

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



CVS commit: src

2022-04-01 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Apr  1 22:28:21 UTC 2022

Modified Files:
src/tests/usr.bin/xlint/lint1: d_pr_22119.c d_pr_22119.exp
decl_direct_abstract.c decl_direct_abstract.exp msg_155.c
msg_155.exp
src/usr.bin/xlint/lint1: decl.c tree.c

Log Message:
lint: improve determination of abstract typename

Still not perfect, but at least a step in the right direction.  See
decl_direct_abstract.c for the missing edge cases.

See PR#22119.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/usr.bin/xlint/lint1/d_pr_22119.c \
src/tests/usr.bin/xlint/lint1/decl_direct_abstract.exp
cvs rdiff -u -r1.4 -r1.5 src/tests/usr.bin/xlint/lint1/d_pr_22119.exp \
src/tests/usr.bin/xlint/lint1/decl_direct_abstract.c
cvs rdiff -u -r1.9 -r1.10 src/tests/usr.bin/xlint/lint1/msg_155.c
cvs rdiff -u -r1.11 -r1.12 src/tests/usr.bin/xlint/lint1/msg_155.exp
cvs rdiff -u -r1.256 -r1.257 src/usr.bin/xlint/lint1/decl.c
cvs rdiff -u -r1.412 -r1.413 src/usr.bin/xlint/lint1/tree.c

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

Modified files:

Index: src/tests/usr.bin/xlint/lint1/d_pr_22119.c
diff -u src/tests/usr.bin/xlint/lint1/d_pr_22119.c:1.3 src/tests/usr.bin/xlint/lint1/d_pr_22119.c:1.4
--- src/tests/usr.bin/xlint/lint1/d_pr_22119.c:1.3	Sat Jan 15 14:22:03 2022
+++ src/tests/usr.bin/xlint/lint1/d_pr_22119.c	Fri Apr  1 22:28:21 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: d_pr_22119.c,v 1.3 2022/01/15 14:22:03 rillig Exp $	*/
+/*	$NetBSD: d_pr_22119.c,v 1.4 2022/04/01 22:28:21 rillig Exp $	*/
 # 3 "d_pr_22119.c"
 
 /*
@@ -15,5 +15,7 @@ func1(void)
 
 	/* expect+1: error: 'p' undefined [99] */
 	f1 = (void (*)(void))p;
+	/* expect+2: error: function returns illegal type 'function(void) returning pointer to void' [15] */
+	/* expect+1: error: invalid cast from 'int' to 'function() returning pointer to function(void) returning pointer to void' [147] */
 	f1 = (void *()(void))p;		/* crash before 2021-02-28 */
 }
Index: src/tests/usr.bin/xlint/lint1/decl_direct_abstract.exp
diff -u src/tests/usr.bin/xlint/lint1/decl_direct_abstract.exp:1.3 src/tests/usr.bin/xlint/lint1/decl_direct_abstract.exp:1.4
--- src/tests/usr.bin/xlint/lint1/decl_direct_abstract.exp:1.3	Tue Sep 14 19:06:27 2021
+++ src/tests/usr.bin/xlint/lint1/decl_direct_abstract.exp	Fri Apr  1 22:28:21 2022
@@ -5,8 +5,10 @@ decl_direct_abstract.c(50): error: canno
 decl_direct_abstract.c(52): error: cannot initialize 'double' from 'pointer to function(pointer to pointer to int) returning void' [185]
 decl_direct_abstract.c(54): error: cannot initialize 'double' from 'pointer to function(pointer to array[3] of int) returning void' [185]
 decl_direct_abstract.c(56): error: cannot initialize 'double' from 'pointer to function(pointer to array[unknown_size] of int) returning void' [185]
-decl_direct_abstract.c(59): error: cannot initialize 'double' from 'pointer to function(void) returning void' [185]
+decl_direct_abstract.c(59): error: cannot initialize 'double' from 'pointer to function(pointer to function() returning pointer to int) returning void' [185]
 decl_direct_abstract.c(61): error: cannot initialize 'double' from 'pointer to function(pointer to function(void) returning int) returning void' [185]
 decl_direct_abstract.c(63): error: cannot initialize 'double' from 'pointer to function(pointer to const pointer to function(unsigned int, ...) returning int) returning void' [185]
 decl_direct_abstract.c(70): error: null dimension [17]
 decl_direct_abstract.c(73): error: null dimension [17]
+decl_direct_abstract.c(81): error: cannot take size/alignment of function [144]
+decl_direct_abstract.c(84): error: cannot take size/alignment of void [146]

Index: src/tests/usr.bin/xlint/lint1/d_pr_22119.exp
diff -u src/tests/usr.bin/xlint/lint1/d_pr_22119.exp:1.4 src/tests/usr.bin/xlint/lint1/d_pr_22119.exp:1.5
--- src/tests/usr.bin/xlint/lint1/d_pr_22119.exp:1.4	Sat Jan 15 14:22:03 2022
+++ src/tests/usr.bin/xlint/lint1/d_pr_22119.exp	Fri Apr  1 22:28:21 2022
@@ -1 +1,3 @@
 d_pr_22119.c(17): error: 'p' undefined [99]
+d_pr_22119.c(20): error: function returns illegal type 'function(void) returning pointer to void' [15]
+d_pr_22119.c(20): error: invalid cast from 'int' to 'function() returning pointer to function(void) returning pointer to void' [147]
Index: src/tests/usr.bin/xlint/lint1/decl_direct_abstract.c
diff -u src/tests/usr.bin/xlint/lint1/decl_direct_abstract.c:1.4 src/tests/usr.bin/xlint/lint1/decl_direct_abstract.c:1.5
--- src/tests/usr.bin/xlint/lint1/decl_direct_abstract.c:1.4	Tue Sep 14 19:08:40 2021
+++ src/tests/usr.bin/xlint/lint1/decl_direct_abstract.c	Fri Apr  1 22:28:21 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: decl_direct_abstract.c,v 1.4 2021/09/14 19:08:40 rillig Exp $	*/
+/*	$NetBSD: decl_direct_abstract.c,v 1.5 2022/04/01 22:28:21 rillig Exp $	*/
 # 3 "decl_direct_abstract.c"
 
 /*
@@ -54,8 +54,8 @@ double 

CVS commit: src

2022-04-01 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Apr  1 22:28:21 UTC 2022

Modified Files:
src/tests/usr.bin/xlint/lint1: d_pr_22119.c d_pr_22119.exp
decl_direct_abstract.c decl_direct_abstract.exp msg_155.c
msg_155.exp
src/usr.bin/xlint/lint1: decl.c tree.c

Log Message:
lint: improve determination of abstract typename

Still not perfect, but at least a step in the right direction.  See
decl_direct_abstract.c for the missing edge cases.

See PR#22119.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/usr.bin/xlint/lint1/d_pr_22119.c \
src/tests/usr.bin/xlint/lint1/decl_direct_abstract.exp
cvs rdiff -u -r1.4 -r1.5 src/tests/usr.bin/xlint/lint1/d_pr_22119.exp \
src/tests/usr.bin/xlint/lint1/decl_direct_abstract.c
cvs rdiff -u -r1.9 -r1.10 src/tests/usr.bin/xlint/lint1/msg_155.c
cvs rdiff -u -r1.11 -r1.12 src/tests/usr.bin/xlint/lint1/msg_155.exp
cvs rdiff -u -r1.256 -r1.257 src/usr.bin/xlint/lint1/decl.c
cvs rdiff -u -r1.412 -r1.413 src/usr.bin/xlint/lint1/tree.c

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



CVS commit: src

2022-04-01 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Apr  1 22:07:23 UTC 2022

Modified Files:
src/tests/usr.bin/xlint/lint1: msg_015.c msg_015.exp
src/usr.bin/xlint/lint1: decl.c err.c

Log Message:
lint: add details to message about illegal return type


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/usr.bin/xlint/lint1/msg_015.c \
src/tests/usr.bin/xlint/lint1/msg_015.exp
cvs rdiff -u -r1.255 -r1.256 src/usr.bin/xlint/lint1/decl.c
cvs rdiff -u -r1.153 -r1.154 src/usr.bin/xlint/lint1/err.c

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

Modified files:

Index: src/tests/usr.bin/xlint/lint1/msg_015.c
diff -u src/tests/usr.bin/xlint/lint1/msg_015.c:1.3 src/tests/usr.bin/xlint/lint1/msg_015.c:1.4
--- src/tests/usr.bin/xlint/lint1/msg_015.c:1.3	Thu Aug 26 19:23:25 2021
+++ src/tests/usr.bin/xlint/lint1/msg_015.c	Fri Apr  1 22:07:23 2022
@@ -1,9 +1,9 @@
-/*	$NetBSD: msg_015.c,v 1.3 2021/08/26 19:23:25 rillig Exp $	*/
+/*	$NetBSD: msg_015.c,v 1.4 2022/04/01 22:07:23 rillig Exp $	*/
 # 3 "msg_015.c"
 
-// Test for message: function returns illegal type [15]
+// Test for message: function returns illegal type '%s' [15]
 
 typedef int array[5];
 
-/* expect+1: error: function returns illegal type [15] */
+/* expect+1: error: function returns illegal type 'array[5] of int' [15] */
 array invalid(void);
Index: src/tests/usr.bin/xlint/lint1/msg_015.exp
diff -u src/tests/usr.bin/xlint/lint1/msg_015.exp:1.3 src/tests/usr.bin/xlint/lint1/msg_015.exp:1.4
--- src/tests/usr.bin/xlint/lint1/msg_015.exp:1.3	Thu Aug 26 19:23:25 2021
+++ src/tests/usr.bin/xlint/lint1/msg_015.exp	Fri Apr  1 22:07:23 2022
@@ -1 +1 @@
-msg_015.c(9): error: function returns illegal type [15]
+msg_015.c(9): error: function returns illegal type 'array[5] of int' [15]

Index: src/usr.bin/xlint/lint1/decl.c
diff -u src/usr.bin/xlint/lint1/decl.c:1.255 src/usr.bin/xlint/lint1/decl.c:1.256
--- src/usr.bin/xlint/lint1/decl.c:1.255	Fri Apr  1 20:38:37 2022
+++ src/usr.bin/xlint/lint1/decl.c	Fri Apr  1 22:07:23 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: decl.c,v 1.255 2022/04/01 20:38:37 rillig Exp $ */
+/* $NetBSD: decl.c,v 1.256 2022/04/01 22:07:23 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -38,7 +38,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: decl.c,v 1.255 2022/04/01 20:38:37 rillig Exp $");
+__RCSID("$NetBSD: decl.c,v 1.256 2022/04/01 22:07:23 rillig Exp $");
 #endif
 
 #include 
@@ -973,8 +973,8 @@ check_type(sym_t *sym)
 		}
 		if (to == FUNC) {
 			if (t == FUNC || t == ARRAY) {
-/* function returns illegal type */
-error(15);
+/* function returns illegal type '%s' */
+error(15, type_name(tp));
 if (t == FUNC) {
 	*tpp = block_derive_type(*tpp, PTR);
 } else {

Index: src/usr.bin/xlint/lint1/err.c
diff -u src/usr.bin/xlint/lint1/err.c:1.153 src/usr.bin/xlint/lint1/err.c:1.154
--- src/usr.bin/xlint/lint1/err.c:1.153	Sun Feb 27 11:40:29 2022
+++ src/usr.bin/xlint/lint1/err.c	Fri Apr  1 22:07:23 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: err.c,v 1.153 2022/02/27 11:40:29 rillig Exp $	*/
+/*	$NetBSD: err.c,v 1.154 2022/04/01 22:07:23 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: err.c,v 1.153 2022/02/27 11:40:29 rillig Exp $");
+__RCSID("$NetBSD: err.c,v 1.154 2022/04/01 22:07:23 rillig Exp $");
 #endif
 
 #include 
@@ -69,7 +69,7 @@ const char *const msgs[] = {
 	"compiler takes size of function",			  /* 12 */
 	"incomplete enum type: %s",  /* 13 */
 	"compiler takes alignment of function",			  /* 14 */
-	"function returns illegal type",			  /* 15 */
+	"function returns illegal type '%s'",			  /* 15 */
 	"array of function is illegal",  /* 16 */
 	"null dimension",	  /* 17 */
 	"illegal use of 'void'",  /* 18 */



CVS commit: src

2022-04-01 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Apr  1 22:07:23 UTC 2022

Modified Files:
src/tests/usr.bin/xlint/lint1: msg_015.c msg_015.exp
src/usr.bin/xlint/lint1: decl.c err.c

Log Message:
lint: add details to message about illegal return type


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/usr.bin/xlint/lint1/msg_015.c \
src/tests/usr.bin/xlint/lint1/msg_015.exp
cvs rdiff -u -r1.255 -r1.256 src/usr.bin/xlint/lint1/decl.c
cvs rdiff -u -r1.153 -r1.154 src/usr.bin/xlint/lint1/err.c

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



CVS commit: src/distrib/notes

2022-04-01 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Fri Apr  1 21:53:35 UTC 2022

Modified Files:
src/distrib/notes/common: main
src/distrib/notes/sparc: contents install

Log Message:
Remove floppy installation instructions from sparc documentation.

Floppy generation was disabled before NetBSD 6.0 release due to size
constraints and unlikely to be restored soon or at all. PR port-sparc/56776.
ok martin.


To generate a diff of this commit:
cvs rdiff -u -r1.568 -r1.569 src/distrib/notes/common/main
cvs rdiff -u -r1.27 -r1.28 src/distrib/notes/sparc/contents
cvs rdiff -u -r1.60 -r1.61 src/distrib/notes/sparc/install

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

Modified files:

Index: src/distrib/notes/common/main
diff -u src/distrib/notes/common/main:1.568 src/distrib/notes/common/main:1.569
--- src/distrib/notes/common/main:1.568	Sun Feb  6 07:37:29 2022
+++ src/distrib/notes/common/main	Fri Apr  1 21:53:35 2022
@@ -1,4 +1,4 @@
-.\"	$NetBSD: main,v 1.568 2022/02/06 07:37:29 nia Exp $
+.\"	$NetBSD: main,v 1.569 2022/04/01 21:53:35 andvar Exp $
 .\"
 .\" Copyright (c) 1999-2012 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -206,10 +206,8 @@ If you have a CD-R, you can fetch the CD
 .\}
 .if \n[sparc] \{\
 Fetch a CD image,
-.Pa NetBSD-\*V-sparc.iso
-or the floppy disk images,
-.Pa sparc/install/floppy/disk1.gz No and Pa sparc/install/floppy/disk2 .
-You need either the pair of floppies or the CD to boot your system.
+.Pa NetBSD-\*V-sparc.iso .
+You need the CD to boot your system.
 .\}
 .if \n[sparc64] \{\
 This is either a CD image
@@ -234,7 +232,7 @@ When you boot the install
 .if \n[amd64] image or CD-ROM,
 .if \n[i386] image, CD-ROM or floppies,
 .if \n[macppc] kernel from floppies, hard drive, or CD-ROM,
-.if \n[sparc] floppies or CD-ROM,
+.if \n[sparc] CD-ROM,
 .if \n[sparc64] CD-ROM or installation kernel,
 the installation program
 can fetch these files for you (using, e.g., ftp)
@@ -312,8 +310,6 @@ If you are using the CD image, burn it n
 .It
 Make sure your sparc's CD-ROM drive is bootable.
 Burn the CD.
-Otherwise, write the floppy images directly to a pair of floppies
-(after uncompressing disk1.gz).
 .\}
 .if \n[sparc64] \{\
 .It
@@ -444,13 +440,6 @@ your model):
 .Dq Ic boot sd(,30,) ,
 or
 .Dq Ic boot cdrom .
-.Pp
-The command to boot from floppy is either
-.Dq Ic boot fd(,,1)
-or
-.Dq Ic boot floppy .
-The installer will prompt you to insert the second floppy when it is ready
-for it.
 .\}
 .if \n[sparc64] \{\
 The command to boot from CD is:

Index: src/distrib/notes/sparc/contents
diff -u src/distrib/notes/sparc/contents:1.27 src/distrib/notes/sparc/contents:1.28
--- src/distrib/notes/sparc/contents:1.27	Fri Aug  7 00:43:51 2020
+++ src/distrib/notes/sparc/contents	Fri Apr  1 21:53:35 2022
@@ -1,4 +1,4 @@
-.\"	$NetBSD: contents,v 1.27 2020/08/07 00:43:51 snj Exp $
+.\"	$NetBSD: contents,v 1.28 2022/04/01 21:53:35 andvar Exp $
 .\"
 .\" Copyright (c) 1999-2005 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -109,10 +109,6 @@ see below.
 .
 Netbootable RAM disk kernel and the file system in the RAM disk; see below.
 .
-.		It Pa floppy/
-.
-\*M boot and installation floppies; see below.
-.
 .		It Pa miniroot/
 .
 \*M miniroot file system image; see below.

Index: src/distrib/notes/sparc/install
diff -u src/distrib/notes/sparc/install:1.60 src/distrib/notes/sparc/install:1.61
--- src/distrib/notes/sparc/install:1.60	Wed Dec  8 12:54:15 2021
+++ src/distrib/notes/sparc/install	Fri Apr  1 21:53:35 2022
@@ -1,4 +1,4 @@
-.\"	$NetBSD: install,v 1.60 2021/12/08 12:54:15 uwe Exp $
+.\"	$NetBSD: install,v 1.61 2022/04/01 21:53:35 andvar Exp $
 .\"
 .\" Copyright (c) 1999-2002 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -39,8 +39,6 @@ image copied to your local disk's swap p
 If your Sparc is hooked up in a network, you may configure another
 .Ul
 machine as a netboot server for your Sparc.
-Alternatively, there is a pair
-of floppy images that will boot your system and run the installer.
 .Pp
 For more information on the commands and variables available in
 the OpenBoot PROM (present in all sun4c and sun4m machines), go to
@@ -179,112 +177,6 @@ Proceed to the section
 .Sx Running the installation scripts.
 below.
 .
-.Ss2 Installing NetBSD by using the bootable floppies
-.
-The
-.Nx
-install floppies only work on the sun4c and sun4m machines.
-Making the install floppies is fairly straightforward.
-.Pp
-.Nx
-and SunOS use the same commands.
-First, get two 1.44 MB floppy disks and format them either using the
-.Xr fdformat 8
-command or a PC.
-.Pp
-.(disp
-.No # Ic "fdformat"
-.disp)
-.Pp
-Be sure that the `fdformat' command completes successfully before proceeding;
-on
-.Nx
-success is a string of all
-.Sq Li V 's ,
-and on
-.Tn SunOS
-success is a string of
-.Sq Li \&. 's .
-.Pp
-Next, transfer the two floppy images
-.Pq Pa installation/floppy/disk1.gz No and Pa 

CVS commit: src/distrib/notes

2022-04-01 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Fri Apr  1 21:53:35 UTC 2022

Modified Files:
src/distrib/notes/common: main
src/distrib/notes/sparc: contents install

Log Message:
Remove floppy installation instructions from sparc documentation.

Floppy generation was disabled before NetBSD 6.0 release due to size
constraints and unlikely to be restored soon or at all. PR port-sparc/56776.
ok martin.


To generate a diff of this commit:
cvs rdiff -u -r1.568 -r1.569 src/distrib/notes/common/main
cvs rdiff -u -r1.27 -r1.28 src/distrib/notes/sparc/contents
cvs rdiff -u -r1.60 -r1.61 src/distrib/notes/sparc/install

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

2022-04-01 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Apr  1 21:12:42 UTC 2022

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

Log Message:
tests/lint: fix comment about backslash-newline


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/tests/usr.bin/xlint/lint1/lex_char.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/lex_char.c
diff -u src/tests/usr.bin/xlint/lint1/lex_char.c:1.4 src/tests/usr.bin/xlint/lint1/lex_char.c:1.5
--- src/tests/usr.bin/xlint/lint1/lex_char.c:1.4	Tue Jun 29 07:28:01 2021
+++ src/tests/usr.bin/xlint/lint1/lex_char.c	Fri Apr  1 21:12:42 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: lex_char.c,v 1.4 2021/06/29 07:28:01 rillig Exp $	*/
+/*	$NetBSD: lex_char.c,v 1.5 2022/04/01 21:12:42 rillig Exp $	*/
 # 3 "lex_char.c"
 
 /*
@@ -60,8 +60,10 @@ test(void)
 }
 
 /*
- * Even though backslash-newline is not supported by C99, lint accepts it
- * in any mode, even for traditional C.
+ * The sequence backslash-newline is handled in an early stage of
+ * translation (C90 5.1.1.2 item 2, C99 5.1.1.2 item 2, C11 5.1.1.2 item 2),
+ * which allows it in character literals as well.  This doesn't typically
+ * occur in practice though.
  */
 char ch = '\
 \



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

2022-04-01 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Apr  1 21:12:42 UTC 2022

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

Log Message:
tests/lint: fix comment about backslash-newline


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/tests/usr.bin/xlint/lint1/lex_char.c

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



CVS commit: src

2022-04-01 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Fri Apr  1 21:09:24 UTC 2022

Modified Files:
src/distrib/sets/lists/debug: module.mi
src/distrib/sets/lists/modules: mi
src/sys/dev: cgd.c
src/sys/modules: Makefile
Added Files:
src/sys/modules/adiantum: Makefile

Log Message:
Create a loaable adiantum module, and make cgd require it.

This enablees use of a loadable cgd module, rather thtan requiring
it to be built-in.

Partially resolves kern/56772


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/distrib/sets/lists/debug/module.mi
cvs rdiff -u -r1.151 -r1.152 src/distrib/sets/lists/modules/mi
cvs rdiff -u -r1.144 -r1.145 src/sys/dev/cgd.c
cvs rdiff -u -r1.263 -r1.264 src/sys/modules/Makefile
cvs rdiff -u -r0 -r1.1 src/sys/modules/adiantum/Makefile

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

Modified files:

Index: src/distrib/sets/lists/debug/module.mi
diff -u src/distrib/sets/lists/debug/module.mi:1.17 src/distrib/sets/lists/debug/module.mi:1.18
--- src/distrib/sets/lists/debug/module.mi:1.17	Fri Apr  1 15:49:11 2022
+++ src/distrib/sets/lists/debug/module.mi	Fri Apr  1 21:09:24 2022
@@ -1,9 +1,11 @@
-# $NetBSD: module.mi,v 1.17 2022/04/01 15:49:11 pgoyette Exp $
+# $NetBSD: module.mi,v 1.18 2022/04/01 21:09:24 pgoyette Exp $
 ./usr/libdata/debug/@MODULEDIR@	modules-base-kernel	kmod,debug
 ./usr/libdata/debug/@MODULEDIR@/accf_dataready			modules-base-kernel	kmod,debug
 ./usr/libdata/debug/@MODULEDIR@/accf_dataready/accf_dataready.kmod.debug	modules-base-kernel	kmod,debug
 ./usr/libdata/debug/@MODULEDIR@/accf_httpready			modules-base-kernel	kmod,debug
 ./usr/libdata/debug/@MODULEDIR@/accf_httpready/accf_httpready.kmod.debug	modules-base-kernel	kmod,debug
+./usr/libdata/debug/@MODULEDIR@/adiantum			modules-base-kernel	kmod,debug
+./usr/libdata/debug/@MODULEDIR@/adiantum/adiantum.kmod.debug	modules-base-kernel	kmod,debug
 ./usr/libdata/debug/@MODULEDIR@/adosfsmodules-base-kernel	kmod,debug
 ./usr/libdata/debug/@MODULEDIR@/adosfs/adosfs.kmod.debug		modules-base-kernel	kmod,debug
 ./usr/libdata/debug/@MODULEDIR@/aiomodules-base-kernel	kmod,debug

Index: src/distrib/sets/lists/modules/mi
diff -u src/distrib/sets/lists/modules/mi:1.151 src/distrib/sets/lists/modules/mi:1.152
--- src/distrib/sets/lists/modules/mi:1.151	Fri Apr  1 15:49:11 2022
+++ src/distrib/sets/lists/modules/mi	Fri Apr  1 21:09:24 2022
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.151 2022/04/01 15:49:11 pgoyette Exp $
+# $NetBSD: mi,v 1.152 2022/04/01 21:09:24 pgoyette Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -11,6 +11,8 @@
 ./@MODULEDIR@/accf_httpready/accf_httpready.kmod	modules-base-kernel	kmod
 ./@MODULEDIR@/adosfsmodules-base-kernel	kmod
 ./@MODULEDIR@/adosfs/adosfs.kmod		modules-base-kernel	kmod
+./@MODULEDIR@/adiantummodules-base-kernel	kmod
+./@MODULEDIR@/adiantum/adiantum.kmod		modules-base-kernel	kmod
 ./@MODULEDIR@/aiomodules-base-kernel	kmod
 ./@MODULEDIR@/aio/aio.kmod			modules-base-kernel	kmod
 ./@MODULEDIR@/am2315temp			modules-base-kernel	kmod

Index: src/sys/dev/cgd.c
diff -u src/sys/dev/cgd.c:1.144 src/sys/dev/cgd.c:1.145
--- src/sys/dev/cgd.c:1.144	Fri Apr  1 00:21:19 2022
+++ src/sys/dev/cgd.c	Fri Apr  1 21:09:24 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: cgd.c,v 1.144 2022/04/01 00:21:19 riastradh Exp $ */
+/* $NetBSD: cgd.c,v 1.145 2022/04/01 21:09:24 pgoyette Exp $ */
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cgd.c,v 1.144 2022/04/01 00:21:19 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cgd.c,v 1.145 2022/04/01 21:09:24 pgoyette Exp $");
 
 #include 
 #include 
@@ -1723,7 +1723,7 @@ cgd_selftest(void)
 	aprint_debug("cgd: self-tests passed\n");
 }
 
-MODULE(MODULE_CLASS_DRIVER, cgd, "blowfish,des,dk_subr,bufq_fcfs");
+MODULE(MODULE_CLASS_DRIVER, cgd, "adiantum,blowfish,des,dk_subr,bufq_fcfs");
 
 #ifdef _MODULE
 CFDRIVER_DECL(cgd, DV_DISK, NULL);

Index: src/sys/modules/Makefile
diff -u src/sys/modules/Makefile:1.263 src/sys/modules/Makefile:1.264
--- src/sys/modules/Makefile:1.263	Fri Apr  1 15:49:11 2022
+++ src/sys/modules/Makefile	Fri Apr  1 21:09:24 2022
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.263 2022/04/01 15:49:11 pgoyette Exp $
+#	$NetBSD: Makefile,v 1.264 2022/04/01 21:09:24 pgoyette Exp $
 
 .include 
 
@@ -24,6 +24,7 @@ SUBDIR+=	compat_crypto_50
 SUBDIR+=	accf_dataready
 SUBDIR+=	accf_httpready
 SUBDIR+=	adosfs
+SUBDIR+=	adiantum
 SUBDIR+=	aio
 SUBDIR+=	audio
 SUBDIR+=	autofs

Added files:

Index: src/sys/modules/adiantum/Makefile
diff -u /dev/null src/sys/modules/adiantum/Makefile:1.1
--- /dev/null	Fri Apr  1 21:09:24 2022
+++ src/sys/modules/adiantum/Makefile	Fri Apr  1 21:09:24 2022
@@ -0,0 +1,10 @@
+#	$NetBSD: Makefile,v 1.1 2022/04/01 21:09:24 pgoyette Exp $
+
+.include "../Makefile.inc"
+
+.PATH:	${S}/crypto/adiantum
+
+KMOD=	

CVS commit: src

2022-04-01 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Fri Apr  1 21:09:24 UTC 2022

Modified Files:
src/distrib/sets/lists/debug: module.mi
src/distrib/sets/lists/modules: mi
src/sys/dev: cgd.c
src/sys/modules: Makefile
Added Files:
src/sys/modules/adiantum: Makefile

Log Message:
Create a loaable adiantum module, and make cgd require it.

This enablees use of a loadable cgd module, rather thtan requiring
it to be built-in.

Partially resolves kern/56772


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/distrib/sets/lists/debug/module.mi
cvs rdiff -u -r1.151 -r1.152 src/distrib/sets/lists/modules/mi
cvs rdiff -u -r1.144 -r1.145 src/sys/dev/cgd.c
cvs rdiff -u -r1.263 -r1.264 src/sys/modules/Makefile
cvs rdiff -u -r0 -r1.1 src/sys/modules/adiantum/Makefile

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



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

2022-04-01 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Apr  1 20:38:37 UTC 2022

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

Log Message:
lint: add debug logging for type declarators

This will help in fixing the wrong type in msg_347.c, as well as the
assertion failure for 'sizeof(int())'.


To generate a diff of this commit:
cvs rdiff -u -r1.254 -r1.255 src/usr.bin/xlint/lint1/decl.c

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

Modified files:

Index: src/usr.bin/xlint/lint1/decl.c
diff -u src/usr.bin/xlint/lint1/decl.c:1.254 src/usr.bin/xlint/lint1/decl.c:1.255
--- src/usr.bin/xlint/lint1/decl.c:1.254	Fri Apr  1 20:29:37 2022
+++ src/usr.bin/xlint/lint1/decl.c	Fri Apr  1 20:38:37 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: decl.c,v 1.254 2022/04/01 20:29:37 rillig Exp $ */
+/* $NetBSD: decl.c,v 1.255 2022/04/01 20:38:37 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -38,7 +38,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: decl.c,v 1.254 2022/04/01 20:29:37 rillig Exp $");
+__RCSID("$NetBSD: decl.c,v 1.255 2022/04/01 20:38:37 rillig Exp $");
 #endif
 
 #include 
@@ -1306,8 +1306,11 @@ add_pointer(sym_t *decl, qual_ptr *p)
 	tpp = >s_type;
 	while (*tpp != NULL && *tpp != dcs->d_type)
 		tpp = &(*tpp)->t_subt;
-	if (*tpp == NULL)
+	if (*tpp == NULL) {
+		debug_step("add_pointer: unchanged '%s'",
+		type_name(decl->s_type));
 		return decl;
+	}
 
 	while (p != NULL) {
 		*tpp = tp = block_zero_alloc(sizeof(*tp));
@@ -1319,6 +1322,7 @@ add_pointer(sym_t *decl, qual_ptr *p)
 		free(p);
 		p = next;
 	}
+	debug_step("add_pointer: '%s'", type_name(decl->s_type));
 	return decl;
 }
 
@@ -1334,8 +1338,11 @@ add_array(sym_t *decl, bool dim, int n)
 	tpp = >s_type;
 	while (*tpp != NULL && *tpp != dcs->d_type)
 		tpp = &(*tpp)->t_subt;
-	if (*tpp == NULL)
+	if (*tpp == NULL) {
+		debug_step("add_array: unchanged '%s'",
+		type_name(decl->s_type));
 		return decl;
+	}
 
 	*tpp = tp = block_zero_alloc(sizeof(*tp));
 	tp->t_tspec = ARRAY;
@@ -1353,6 +1360,7 @@ add_array(sym_t *decl, bool dim, int n)
 		setcomplete(tp, false);
 	}
 
+	debug_step("add_array: '%s'", type_name(decl->s_type));
 	return decl;
 }
 
@@ -1397,8 +1405,11 @@ add_function(sym_t *decl, sym_t *args)
 		 * may even be guaranteed to be NULL.
 		 */
 		tpp = &(*tpp)->t_subt;
-	if (*tpp == NULL)
+	if (*tpp == NULL) {
+		debug_step("add_function: unchanged '%s'",
+		type_name(decl->s_type));
 		return decl;	/* see msg_347 */
+	}
 
 	*tpp = tp = block_zero_alloc(sizeof(*tp));
 	tp->t_tspec = FUNC;
@@ -1407,6 +1418,7 @@ add_function(sym_t *decl, sym_t *args)
 		tp->t_args = args;
 	tp->t_vararg = dcs->d_vararg;
 
+	debug_step("add_function: '%s'", type_name(decl->s_type));
 	return decl;
 }
 



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

2022-04-01 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Apr  1 20:38:37 UTC 2022

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

Log Message:
lint: add debug logging for type declarators

This will help in fixing the wrong type in msg_347.c, as well as the
assertion failure for 'sizeof(int())'.


To generate a diff of this commit:
cvs rdiff -u -r1.254 -r1.255 src/usr.bin/xlint/lint1/decl.c

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



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

2022-04-01 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Apr  1 20:29:37 UTC 2022

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

Log Message:
lint: fix indentation and spacing, add a missing 'else' to 'else if'

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.253 -r1.254 src/usr.bin/xlint/lint1/decl.c

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

Modified files:

Index: src/usr.bin/xlint/lint1/decl.c
diff -u src/usr.bin/xlint/lint1/decl.c:1.253 src/usr.bin/xlint/lint1/decl.c:1.254
--- src/usr.bin/xlint/lint1/decl.c:1.253	Sun Mar 13 14:40:36 2022
+++ src/usr.bin/xlint/lint1/decl.c	Fri Apr  1 20:29:37 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: decl.c,v 1.253 2022/03/13 14:40:36 rillig Exp $ */
+/* $NetBSD: decl.c,v 1.254 2022/04/01 20:29:37 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -38,7 +38,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: decl.c,v 1.253 2022/03/13 14:40:36 rillig Exp $");
+__RCSID("$NetBSD: decl.c,v 1.254 2022/04/01 20:29:37 rillig Exp $");
 #endif
 
 #include 
@@ -988,7 +988,7 @@ check_type(sym_t *sym)
 	warning(228);
 }
 			}
-		} if (to == ARRAY) {
+		} else if (to == ARRAY) {
 			if (t == FUNC) {
 /* array of function is illegal */
 error(16);
@@ -1054,7 +1054,7 @@ check_type(sym_t *sym)
  * implementation-defined type".
  */
 static void
-check_bit_field_type(sym_t *dsym,  type_t **const inout_tp, tspec_t *inout_t)
+check_bit_field_type(sym_t *dsym, type_t **const inout_tp, tspec_t *inout_t)
 {
 	type_t *tp = *inout_tp;
 	tspec_t t = *inout_t;
@@ -1335,7 +1335,7 @@ add_array(sym_t *decl, bool dim, int n)
 	while (*tpp != NULL && *tpp != dcs->d_type)
 		tpp = &(*tpp)->t_subt;
 	if (*tpp == NULL)
-	return decl;
+		return decl;
 
 	*tpp = tp = block_zero_alloc(sizeof(*tp));
 	tp->t_tspec = ARRAY;
@@ -1398,7 +1398,7 @@ add_function(sym_t *decl, sym_t *args)
 		 */
 		tpp = &(*tpp)->t_subt;
 	if (*tpp == NULL)
-	return decl;	/* see msg_347 */
+		return decl;	/* see msg_347 */
 
 	*tpp = tp = block_zero_alloc(sizeof(*tp));
 	tp->t_tspec = FUNC;
@@ -2170,7 +2170,8 @@ eqtype(const type_t *tp1, const type_t *
 t = INT;
 			} else if (t == USHORT) {
 /* CONSTCOND */
-t = TARG_INT_MAX < TARG_USHRT_MAX || tflag ? UINT : INT;
+t = TARG_INT_MAX < TARG_USHRT_MAX || tflag
+? UINT : INT;
 			}
 		}
 
@@ -2320,7 +2321,7 @@ check_old_style_definition(sym_t *rdsym,
 		n++;
 	}
 
- end:
+end:
 	if (msg)
 		/* old style definition */
 		print_previous_declaration(300, rdsym);



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

2022-04-01 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Apr  1 20:29:37 UTC 2022

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

Log Message:
lint: fix indentation and spacing, add a missing 'else' to 'else if'

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.253 -r1.254 src/usr.bin/xlint/lint1/decl.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

2022-04-01 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri Apr  1 19:57:22 UTC 2022

Modified Files:
src/sys/arch/aarch64/aarch64: fpu.c
src/sys/arch/arm/vfp: vfp_init.c
src/sys/arch/x86/x86: cpu.c fpu.c

Log Message:
x86, arm: Allow fpu_kern_enter/leave while cold.

Normally these are forbidden above IPL_VM, so that FPU usage doesn't
block IPL_SCHED or IPL_HIGH interrupts.  But while cold, e.g. during
builtin module initialization at boot, all interrupts are blocked
anyway so it's a moot point.

Also initialize x86 cpu_info_primary.ci_kfpu_spl to -1 so we don't
trip over an assertion about it while cold -- the assertion is meant
to detect reentrance into fpu_kern_enter/leave, which is prohibited.

Also initialize cpu0's ci_kfpu_spl.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/aarch64/aarch64/fpu.c
cvs rdiff -u -r1.76 -r1.77 src/sys/arch/arm/vfp/vfp_init.c
cvs rdiff -u -r1.202 -r1.203 src/sys/arch/x86/x86/cpu.c
cvs rdiff -u -r1.76 -r1.77 src/sys/arch/x86/x86/fpu.c

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

Modified files:

Index: src/sys/arch/aarch64/aarch64/fpu.c
diff -u src/sys/arch/aarch64/aarch64/fpu.c:1.11 src/sys/arch/aarch64/aarch64/fpu.c:1.12
--- src/sys/arch/aarch64/aarch64/fpu.c:1.11	Fri Dec 11 18:03:33 2020
+++ src/sys/arch/aarch64/aarch64/fpu.c	Fri Apr  1 19:57:22 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: fpu.c,v 1.11 2020/12/11 18:03:33 skrll Exp $ */
+/* $NetBSD: fpu.c,v 1.12 2022/04/01 19:57:22 riastradh Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -31,11 +31,12 @@
 
 #include 
 
-__KERNEL_RCSID(1, "$NetBSD: fpu.c,v 1.11 2020/12/11 18:03:33 skrll Exp $");
+__KERNEL_RCSID(1, "$NetBSD: fpu.c,v 1.12 2022/04/01 19:57:22 riastradh Exp $");
 
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -213,7 +214,7 @@ fpu_kern_enter(void)
 	 */
 	s = splvm();
 	ci = curcpu();
-	KASSERTMSG(ci->ci_cpl <= IPL_VM, "cpl=%d", ci->ci_cpl);
+	KASSERTMSG(ci->ci_cpl <= IPL_VM || cold, "cpl=%d", ci->ci_cpl);
 	KASSERT(ci->ci_kfpu_spl == -1);
 	ci->ci_kfpu_spl = s;
 
@@ -241,7 +242,7 @@ fpu_kern_leave(void)
 
 	ci = curcpu();
 
-	KASSERT(ci->ci_cpl == IPL_VM);
+	KASSERT(ci->ci_cpl == IPL_VM || cold);
 	KASSERT(ci->ci_kfpu_spl != -1);
 
 	/*

Index: src/sys/arch/arm/vfp/vfp_init.c
diff -u src/sys/arch/arm/vfp/vfp_init.c:1.76 src/sys/arch/arm/vfp/vfp_init.c:1.77
--- src/sys/arch/arm/vfp/vfp_init.c:1.76	Sun Oct 31 16:23:48 2021
+++ src/sys/arch/arm/vfp/vfp_init.c	Fri Apr  1 19:57:22 2022
@@ -1,4 +1,4 @@
-/*  $NetBSD: vfp_init.c,v 1.76 2021/10/31 16:23:48 skrll Exp $ */
+/*  $NetBSD: vfp_init.c,v 1.77 2022/04/01 19:57:22 riastradh Exp $ */
 
 /*
  * Copyright (c) 2008 ARM Ltd
@@ -32,12 +32,13 @@
 #include "opt_cputypes.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vfp_init.c,v 1.76 2021/10/31 16:23:48 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfp_init.c,v 1.77 2022/04/01 19:57:22 riastradh Exp $");
 
 #include 
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -694,7 +695,7 @@ fpu_kern_enter(void)
 	 */
 	s = splvm();
 	ci = curcpu();
-	KASSERTMSG(ci->ci_cpl <= IPL_VM, "cpl=%d", ci->ci_cpl);
+	KASSERTMSG(ci->ci_cpl <= IPL_VM || cold, "cpl=%d", ci->ci_cpl);
 	KASSERT(ci->ci_kfpu_spl == -1);
 	ci->ci_kfpu_spl = s;
 
@@ -720,7 +721,7 @@ fpu_kern_leave(void)
 		return;
 	}
 
-	KASSERT(ci->ci_cpl == IPL_VM);
+	KASSERT(ci->ci_cpl == IPL_VM || cold);
 	KASSERT(ci->ci_kfpu_spl != -1);
 
 	/*

Index: src/sys/arch/x86/x86/cpu.c
diff -u src/sys/arch/x86/x86/cpu.c:1.202 src/sys/arch/x86/x86/cpu.c:1.203
--- src/sys/arch/x86/x86/cpu.c:1.202	Thu Oct  7 12:52:27 2021
+++ src/sys/arch/x86/x86/cpu.c	Fri Apr  1 19:57:22 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.c,v 1.202 2021/10/07 12:52:27 msaitoh Exp $	*/
+/*	$NetBSD: cpu.c,v 1.203 2022/04/01 19:57:22 riastradh Exp $	*/
 
 /*
  * Copyright (c) 2000-2020 NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.202 2021/10/07 12:52:27 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.203 2022/04/01 19:57:22 riastradh Exp $");
 
 #include "opt_ddb.h"
 #include "opt_mpbios.h"		/* for MPDEBUG */
@@ -175,6 +175,7 @@ struct cpu_info cpu_info_primary __align
 	.ci_idepth = -1,
 	.ci_curlwp = ,
 	.ci_curldt = -1,
+	.ci_kfpu_spl = -1,
 };
 
 struct cpu_info *cpu_info_list = _info_primary;

Index: src/sys/arch/x86/x86/fpu.c
diff -u src/sys/arch/x86/x86/fpu.c:1.76 src/sys/arch/x86/x86/fpu.c:1.77
--- src/sys/arch/x86/x86/fpu.c:1.76	Sat Oct 24 07:14:30 2020
+++ src/sys/arch/x86/x86/fpu.c	Fri Apr  1 19:57:22 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: fpu.c,v 1.76 2020/10/24 07:14:30 mgorny Exp $	*/
+/*	$NetBSD: fpu.c,v 1.77 2022/04/01 19:57:22 riastradh Exp $	*/
 
 /*
  * Copyright (c) 2008, 2019 The NetBSD Foundation, Inc.  All
@@ -96,7 +96,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: fpu.c,v 1.76 2020/10/24 07:14:30 mgorny Exp $");

CVS commit: src/sys/arch

2022-04-01 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri Apr  1 19:57:22 UTC 2022

Modified Files:
src/sys/arch/aarch64/aarch64: fpu.c
src/sys/arch/arm/vfp: vfp_init.c
src/sys/arch/x86/x86: cpu.c fpu.c

Log Message:
x86, arm: Allow fpu_kern_enter/leave while cold.

Normally these are forbidden above IPL_VM, so that FPU usage doesn't
block IPL_SCHED or IPL_HIGH interrupts.  But while cold, e.g. during
builtin module initialization at boot, all interrupts are blocked
anyway so it's a moot point.

Also initialize x86 cpu_info_primary.ci_kfpu_spl to -1 so we don't
trip over an assertion about it while cold -- the assertion is meant
to detect reentrance into fpu_kern_enter/leave, which is prohibited.

Also initialize cpu0's ci_kfpu_spl.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/aarch64/aarch64/fpu.c
cvs rdiff -u -r1.76 -r1.77 src/sys/arch/arm/vfp/vfp_init.c
cvs rdiff -u -r1.202 -r1.203 src/sys/arch/x86/x86/cpu.c
cvs rdiff -u -r1.76 -r1.77 src/sys/arch/x86/x86/fpu.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/i386/stand/lib

2022-04-01 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Fri Apr  1 19:02:12 UTC 2022

Modified Files:
src/sys/arch/i386/stand/lib: realprot.S

Log Message:
s/potected/protected and s/investication/investigation/ in comments.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/i386/stand/lib/realprot.S

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

Modified files:

Index: src/sys/arch/i386/stand/lib/realprot.S
diff -u src/sys/arch/i386/stand/lib/realprot.S:1.11 src/sys/arch/i386/stand/lib/realprot.S:1.12
--- src/sys/arch/i386/stand/lib/realprot.S:1.11	Tue Dec 24 19:00:56 2013
+++ src/sys/arch/i386/stand/lib/realprot.S	Fri Apr  1 19:02:12 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: realprot.S,v 1.11 2013/12/24 19:00:56 jakllsch Exp $	*/
+/*	$NetBSD: realprot.S,v 1.12 2022/04/01 19:02:12 andvar Exp $	*/
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -188,7 +188,7 @@ ENTRY(real_to_prot)
  *
  * It is speculated that the CPU is prefetching and decoding branch
  * targets and not invalidating this buffer on the long jump.
- * Further investication indicates that the caching of return addresses
+ * Further investigation indicates that the caching of return addresses
  * is most likely the problem.
  *
  * Previous versions just used some extra call/ret and a few NOPs, these
@@ -229,7 +229,7 @@ ENTRY(prot_to_real)
 	.code16
 	movl	%cr0, %eax
 	and 	$~CR0_PE, %eax
-	movl	%eax, %cr0		/* Disable potected mode */
+	movl	%eax, %cr0		/* Disable protected mode */
 
 	/* Jump far indirect to load real mode %cs */
 	ljmp	*%cs:toreal



CVS commit: src/sys/arch/i386/stand/lib

2022-04-01 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Fri Apr  1 19:02:12 UTC 2022

Modified Files:
src/sys/arch/i386/stand/lib: realprot.S

Log Message:
s/potected/protected and s/investication/investigation/ in comments.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/i386/stand/lib/realprot.S

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



CVS commit: src

2022-04-01 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Fri Apr  1 15:49:12 UTC 2022

Modified Files:
src/distrib/sets/lists/debug: module.mi
src/distrib/sets/lists/modules: mi
src/sys/dev/i2c: i2c.c i2c_subr.c
src/sys/modules: Makefile
src/sys/modules/iic: Makefile
Added Files:
src/sys/modules/i2c_subr: Makefile

Log Message:
Split i2c_subr.c into a separate module rather than including it in
the iic module.  There are valid configurations where i2c_subr code
can be both built-in and part of a loaded module (eg, piixpm is in
the kernel, but the iic module is loaded later).  This causes the
in-kernel linker to detect a duplicate symbol.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/distrib/sets/lists/debug/module.mi
cvs rdiff -u -r1.150 -r1.151 src/distrib/sets/lists/modules/mi
cvs rdiff -u -r1.85 -r1.86 src/sys/dev/i2c/i2c.c
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/i2c/i2c_subr.c
cvs rdiff -u -r1.262 -r1.263 src/sys/modules/Makefile
cvs rdiff -u -r0 -r1.1 src/sys/modules/i2c_subr/Makefile
cvs rdiff -u -r1.6 -r1.7 src/sys/modules/iic/Makefile

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

Modified files:

Index: src/distrib/sets/lists/debug/module.mi
diff -u src/distrib/sets/lists/debug/module.mi:1.16 src/distrib/sets/lists/debug/module.mi:1.17
--- src/distrib/sets/lists/debug/module.mi:1.16	Tue Dec  7 17:39:53 2021
+++ src/distrib/sets/lists/debug/module.mi	Fri Apr  1 15:49:11 2022
@@ -1,4 +1,4 @@
-# $NetBSD: module.mi,v 1.16 2021/12/07 17:39:53 brad Exp $
+# $NetBSD: module.mi,v 1.17 2022/04/01 15:49:11 pgoyette Exp $
 ./usr/libdata/debug/@MODULEDIR@	modules-base-kernel	kmod,debug
 ./usr/libdata/debug/@MODULEDIR@/accf_dataready			modules-base-kernel	kmod,debug
 ./usr/libdata/debug/@MODULEDIR@/accf_dataready/accf_dataready.kmod.debug	modules-base-kernel	kmod,debug
@@ -166,6 +166,8 @@
 ./usr/libdata/debug/@MODULEDIR@/i2c_bitbang/i2c_bitbang.kmod.debug	modules-base-kernel	kmod,debug
 ./usr/libdata/debug/@MODULEDIR@/i2cexecmodules-base-kernel	kmod,debug
 ./usr/libdata/debug/@MODULEDIR@/i2cexec/i2cexec.kmod.debug		modules-base-kernel	kmod,debug
+./usr/libdata/debug/@MODULEDIR@/i2c_subrmodules-base-kernel	kmod,debug
+./usr/libdata/debug/@MODULEDIR@/i2c_subr/i2c_subr.kmod.debug		modules-base-kernel	kmod,debug
 ./usr/libdata/debug/@MODULEDIR@/if_agrmodules-base-kernel	kmod,debug
 ./usr/libdata/debug/@MODULEDIR@/if_agr/if_agr.kmod.debug		modules-base-kernel	kmod,debug
 ./usr/libdata/debug/@MODULEDIR@/if_auemodules-base-kernel	kmod,debug

Index: src/distrib/sets/lists/modules/mi
diff -u src/distrib/sets/lists/modules/mi:1.150 src/distrib/sets/lists/modules/mi:1.151
--- src/distrib/sets/lists/modules/mi:1.150	Tue Dec  7 17:39:53 2021
+++ src/distrib/sets/lists/modules/mi	Fri Apr  1 15:49:11 2022
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.150 2021/12/07 17:39:53 brad Exp $
+# $NetBSD: mi,v 1.151 2022/04/01 15:49:11 pgoyette Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -189,6 +189,8 @@
 ./@MODULEDIR@/i2c_bitbang/i2c_bitbang.kmod	modules-base-kernel	kmod
 ./@MODULEDIR@/i2cexecmodules-base-kernel	kmod
 ./@MODULEDIR@/i2cexec/i2cexec.kmod		modules-base-kernel	kmod
+./@MODULEDIR@/i2c_subrmodules-base-kernel	kmod
+./@MODULEDIR@/i2c_subr/i2c_subr.kmod		modules-base-kernel	kmod
 ./@MODULEDIR@/if_agrmodules-base-kernel	kmod
 ./@MODULEDIR@/if_agr/if_agr.kmod		modules-base-kernel	kmod
 ./@MODULEDIR@/if_auemodules-base-kernel	kmod

Index: src/sys/dev/i2c/i2c.c
diff -u src/sys/dev/i2c/i2c.c:1.85 src/sys/dev/i2c/i2c.c:1.86
--- src/sys/dev/i2c/i2c.c:1.85	Mon Mar 28 12:33:21 2022
+++ src/sys/dev/i2c/i2c.c	Fri Apr  1 15:49:12 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: i2c.c,v 1.85 2022/03/28 12:33:21 riastradh Exp $	*/
+/*	$NetBSD: i2c.c,v 1.86 2022/04/01 15:49:12 pgoyette Exp $	*/
 
 /*
  * Copyright (c) 2003 Wasabi Systems, Inc.
@@ -53,7 +53,7 @@
 #endif /* _KERNEL_OPT */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: i2c.c,v 1.85 2022/03/28 12:33:21 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i2c.c,v 1.86 2022/04/01 15:49:12 pgoyette Exp $");
 
 #include 
 #include 
@@ -900,7 +900,7 @@ CFATTACH_DECL3_NEW(iic, sizeof(struct ii
 iic_match, iic_attach, iic_detach, NULL, iic_rescan, iic_child_detach,
 DVF_DETACH_SHUTDOWN);
 
-MODULE(MODULE_CLASS_DRIVER, iic, "i2cexec,i2c_bitbang");
+MODULE(MODULE_CLASS_DRIVER, iic, "i2cexec,i2c_bitbang,i2c_subr");
 
 #ifdef _MODULE
 #include "ioconf.c"

Index: src/sys/dev/i2c/i2c_subr.c
diff -u src/sys/dev/i2c/i2c_subr.c:1.1 src/sys/dev/i2c/i2c_subr.c:1.2
--- src/sys/dev/i2c/i2c_subr.c:1.1	Mon Oct  3 22:27:23 2011
+++ src/sys/dev/i2c/i2c_subr.c	Fri Apr  1 15:49:12 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: i2c_subr.c,v 1.1 2011/10/03 22:27:23 jmcneill Exp $	*/
+/*	$NetBSD: i2c_subr.c,v 1.2 2022/04/01 15:49:12 pgoyette Exp $	*/
 
 /*
  * Copyright (c) 2003 Wasabi Systems, Inc.
@@ -36,13 +36,29 @@
  */
 
 

CVS commit: src

2022-04-01 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Fri Apr  1 15:49:12 UTC 2022

Modified Files:
src/distrib/sets/lists/debug: module.mi
src/distrib/sets/lists/modules: mi
src/sys/dev/i2c: i2c.c i2c_subr.c
src/sys/modules: Makefile
src/sys/modules/iic: Makefile
Added Files:
src/sys/modules/i2c_subr: Makefile

Log Message:
Split i2c_subr.c into a separate module rather than including it in
the iic module.  There are valid configurations where i2c_subr code
can be both built-in and part of a loaded module (eg, piixpm is in
the kernel, but the iic module is loaded later).  This causes the
in-kernel linker to detect a duplicate symbol.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/distrib/sets/lists/debug/module.mi
cvs rdiff -u -r1.150 -r1.151 src/distrib/sets/lists/modules/mi
cvs rdiff -u -r1.85 -r1.86 src/sys/dev/i2c/i2c.c
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/i2c/i2c_subr.c
cvs rdiff -u -r1.262 -r1.263 src/sys/modules/Makefile
cvs rdiff -u -r0 -r1.1 src/sys/modules/i2c_subr/Makefile
cvs rdiff -u -r1.6 -r1.7 src/sys/modules/iic/Makefile

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



CVS commit: src/sys/dev/pci

2022-04-01 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Fri Apr  1 15:34:34 UTC 2022

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

Log Message:
Call iic_fini_tag() when the tag is no longer needed.

Without this, a LOCKDEBUG kernel can panic when trying to re-init the tag.


To generate a diff of this commit:
cvs rdiff -u -r1.66 -r1.67 src/sys/dev/pci/piixpm.c

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

Modified files:

Index: src/sys/dev/pci/piixpm.c
diff -u src/sys/dev/pci/piixpm.c:1.66 src/sys/dev/pci/piixpm.c:1.67
--- src/sys/dev/pci/piixpm.c:1.66	Tue Oct 12 08:36:29 2021
+++ src/sys/dev/pci/piixpm.c	Fri Apr  1 15:34:34 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: piixpm.c,v 1.66 2021/10/12 08:36:29 andvar Exp $ */
+/* $NetBSD: piixpm.c,v 1.67 2022/04/01 15:34:34 pgoyette Exp $ */
 /*	$OpenBSD: piixpm.c,v 1.39 2013/10/01 20:06:02 sf Exp $	*/
 
 /*
@@ -22,7 +22,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: piixpm.c,v 1.66 2021/10/12 08:36:29 andvar Exp $");
+__KERNEL_RCSID(0, "$NetBSD: piixpm.c,v 1.67 2022/04/01 15:34:34 pgoyette Exp $");
 
 #include 
 #include 
@@ -352,6 +352,8 @@ piixpm_rescan(device_t self, const char 
 		iba.iba_tag = tag;
 		sc->sc_i2c_device[i] =
 		config_found(self, , piixpm_iicbus_print, CFARGS_NONE);
+		if (sc->sc_i2c_device[i] == NULL)
+			iic_tag_fini(tag);
 	}
 
 	return 0;
@@ -365,6 +367,10 @@ piixpm_chdet(device_t self, device_t chi
 
 	for (i = 0; i < sc->sc_numbusses; i++) {
 		if (sc->sc_i2c_device[i] == child) {
+
+			struct i2c_controller *tag = >sc_i2c_tags[i];
+
+			iic_tag_fini(tag);
 			sc->sc_i2c_device[i] = NULL;
 			break;
 		}



CVS commit: src/sys/dev/pci

2022-04-01 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Fri Apr  1 15:34:34 UTC 2022

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

Log Message:
Call iic_fini_tag() when the tag is no longer needed.

Without this, a LOCKDEBUG kernel can panic when trying to re-init the tag.


To generate a diff of this commit:
cvs rdiff -u -r1.66 -r1.67 src/sys/dev/pci/piixpm.c

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



CVS commit: src/sys/fs/udf

2022-04-01 Thread Reinoud Zandijk
Module Name:src
Committed By:   reinoud
Date:   Fri Apr  1 08:26:28 UTC 2022

Modified Files:
src/sys/fs/udf: udf_vnops.c

Log Message:
Fix malformed DPRINTF() macro


To generate a diff of this commit:
cvs rdiff -u -r1.121 -r1.122 src/sys/fs/udf/udf_vnops.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/fs/udf/udf_vnops.c
diff -u src/sys/fs/udf/udf_vnops.c:1.121 src/sys/fs/udf/udf_vnops.c:1.122
--- src/sys/fs/udf/udf_vnops.c:1.121	Wed Mar 30 13:23:59 2022
+++ src/sys/fs/udf/udf_vnops.c	Fri Apr  1 08:26:27 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: udf_vnops.c,v 1.121 2022/03/30 13:23:59 christos Exp $ */
+/* $NetBSD: udf_vnops.c,v 1.122 2022/04/01 08:26:27 reinoud Exp $ */
 
 /*
  * Copyright (c) 2006, 2008 Reinoud Zandijk
@@ -32,7 +32,7 @@
 
 #include 
 #ifndef lint
-__KERNEL_RCSID(0, "$NetBSD: udf_vnops.c,v 1.121 2022/03/30 13:23:59 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: udf_vnops.c,v 1.122 2022/04/01 08:26:27 reinoud Exp $");
 #endif /* not lint */
 
 
@@ -1567,7 +1567,7 @@ udf_link(void *v)
 	udf_node = VTOI(vp);
 
 	if ((error = vn_lock(vp, LK_EXCLUSIVE))) {
-		DPRINTF("lock failed. %p\n", vp);
+		DPRINTF(LOCKING, ("exclusive lock failed for vnode %p\n", vp));
 		goto out;
 	}
 



CVS commit: src/sys/fs/udf

2022-04-01 Thread Reinoud Zandijk
Module Name:src
Committed By:   reinoud
Date:   Fri Apr  1 08:26:28 UTC 2022

Modified Files:
src/sys/fs/udf: udf_vnops.c

Log Message:
Fix malformed DPRINTF() macro


To generate a diff of this commit:
cvs rdiff -u -r1.121 -r1.122 src/sys/fs/udf/udf_vnops.c

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



CVS commit: src/sys/net/lagg

2022-04-01 Thread Shoichi YAMAGUCHI
Module Name:src
Committed By:   yamaguchi
Date:   Fri Apr  1 07:26:51 UTC 2022

Modified Files:
src/sys/net/lagg: if_lagg.c if_lagg_lacp.c

Log Message:
lagg(4): reimplement add and delete port

The IFNET_LOCK for the adding or deleting port became to
be held the whole time while the ifnet of the port is changed.


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.45 src/sys/net/lagg/if_lagg.c
cvs rdiff -u -r1.21 -r1.22 src/sys/net/lagg/if_lagg_lacp.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/net/lagg/if_lagg.c
diff -u src/sys/net/lagg/if_lagg.c:1.44 src/sys/net/lagg/if_lagg.c:1.45
--- src/sys/net/lagg/if_lagg.c:1.44	Thu Mar 31 07:59:05 2022
+++ src/sys/net/lagg/if_lagg.c	Fri Apr  1 07:26:51 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_lagg.c,v 1.44 2022/03/31 07:59:05 yamaguchi Exp $	*/
+/*	$NetBSD: if_lagg.c,v 1.45 2022/04/01 07:26:51 yamaguchi Exp $	*/
 
 /*
  * Copyright (c) 2005, 2006 Reyk Floeter 
@@ -20,7 +20,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_lagg.c,v 1.44 2022/03/31 07:59:05 yamaguchi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_lagg.c,v 1.45 2022/04/01 07:26:51 yamaguchi Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -133,7 +133,7 @@ static const struct lagg_proto lagg_prot
 	},
 };
 
-static int	lagg_chg_sadl(struct ifnet *, uint8_t *, size_t);
+static int	lagg_chg_sadl(struct ifnet *, const uint8_t *, size_t);
 static struct mbuf *
 		lagg_input_ethernet(struct ifnet *, struct mbuf *);
 static int	lagg_clone_create(struct if_clone *, int);
@@ -195,10 +195,10 @@ static void	lagg_port_teardown(struct la
 		bool);
 static void	lagg_port_syncvlan(struct lagg_softc *, struct lagg_port *);
 static void	lagg_port_purgevlan(struct lagg_softc *, struct lagg_port *);
-static void	lagg_lladdr_update(struct lagg_softc *);
 static void	lagg_capabilities_update(struct lagg_softc *);
 static void	lagg_sync_ifcaps(struct lagg_softc *);
 static void	lagg_sync_ethcaps(struct lagg_softc *);
+static void	lagg_sync_sadl(struct lagg_softc *);
 
 static struct if_clone	 lagg_cloner =
 IF_CLONE_INITIALIZER("lagg", lagg_clone_create, lagg_clone_destroy);
@@ -212,11 +212,13 @@ static enum lagg_iftypes
 		 lagg_iftype = LAGG_IF_TYPE_ETHERNET;
 
 #ifdef LAGG_DEBUG
+#define __LAGGDEBUGUSED
 #define LAGG_DPRINTF(_sc, _fmt, _args...)	do {	\
 	printf("%s: " _fmt, (_sc) != NULL ?		\
 	(_sc)->sc_if.if_xname : "lagg", ##_args);		\
 } while (0)
 #else
+#define __LAGGDEBUGUSED__unused
 #define LAGG_DPRINTF(_sc, _fmt, _args...)	__nothing
 #endif
 
@@ -413,7 +415,7 @@ lagg_clone_create(struct if_clone *ifc, 
 		sc->sc_lladdr_rand[0] |= 0x02; /* set G/L bit */
 		lagg_lladdr_cpy(sc->sc_lladdr, sc->sc_lladdr_rand);
 		ether_set_vlan_cb((struct ethercom *)ifp, lagg_vlan_cb);
-		ether_ifattach(ifp, sc->sc_lladdr);
+		ether_ifattach(ifp, sc->sc_lladdr_rand);
 		break;
 	default:
 		panic("unknown if type");
@@ -500,7 +502,7 @@ lagg_init_locked(struct lagg_softc *sc)
 	if (ISSET(ifp->if_flags, IFF_RUNNING))
 		lagg_stop_locked(sc);
 
-	lagg_lladdr_update(sc);
+	lagg_sync_sadl(sc);
 
 	SET(ifp->if_flags, IFF_RUNNING);
 
@@ -2009,85 +2011,42 @@ lagg_capabilities_update(struct lagg_sof
 }
 
 static int
-lagg_setup_mtu(struct lagg_softc *sc, struct lagg_port *lp)
+lagg_setmtu(struct ifnet *ifp, uint64_t mtu)
 {
-	struct ifnet *ifp, *ifp_port;
+	struct lagg_softc *sc __LAGGDEBUGUSED;
+	struct lagg_port *lp;
 	struct ifreq ifr;
 	int error;
 
-	ifp = >sc_if;
-	ifp_port = lp->lp_ifp;
-
-	KASSERT(IFNET_LOCKED(ifp_port));
+	KASSERT(IFNET_LOCKED(ifp));
 
-	error = 0;
 	memset(, 0, sizeof(ifr));
+	ifr.ifr_mtu = mtu;
+	lp = ifp->if_lagg;
 
-	if (SIMPLEQ_EMPTY(>sc_ports)) {
-		ifr.ifr_mtu = lp->lp_mtu;
-
-		if (ifp->if_mtu != (uint64_t)ifr.ifr_mtu) {
-			KASSERT(IFNET_LOCKED(ifp));
-			error = ether_ioctl(ifp, SIOCSIFMTU, );
-		}
+	if (lp != NULL) {
+		/* ioctl for port interface */
+		error = lp->lp_ioctl(ifp, SIOCSIFMTU, );
+		sc = lp->lp_softc;
 	} else {
-		ifr.ifr_mtu = sc->sc_if.if_mtu;
-
-		if (lp->lp_mtu != (uint64_t)ifr.ifr_mtu) {
-			if (lp->lp_ioctl == NULL) {
-LAGG_DPRINTF(sc,
-"cannot change MTU for %s\n",
-ifp_port->if_xname);
-return EINVAL;
-			}
+		/* ioctl for lagg interface */
+		error = ether_ioctl(ifp, SIOCSIFMTU, );
+		sc = ifp->if_softc;
+	}
 
-			strlcpy(ifr.ifr_name, ifp_port->if_xname,
-			sizeof(ifr.ifr_name));
-			error = lp->lp_ioctl(ifp_port,
-			SIOCSIFMTU, (void *));
-			if (error != 0) {
-LAGG_DPRINTF(sc,
-"invalid MTU %d for %s\n",
-ifr.ifr_mtu, ifp_port->if_xname);
-			}
-		}
+	if (error != 0) {
+		LAGG_DPRINTF(sc,
+		"couldn't change MTU for %s\n",
+		ifp->if_xname);
 	}
 
 	return error;
 }
 
 static void
-lagg_teardown_mtu(struct lagg_softc *sc, struct lagg_port *lp)
-{
-	struct ifnet *ifp_port;
-	struct ifreq ifr;
-	int error;
-
-	if (lp->lp_ioctl == NULL)
-		return;
-
-	ifp_port = lp->lp_ifp;

CVS commit: src/sys/net/lagg

2022-04-01 Thread Shoichi YAMAGUCHI
Module Name:src
Committed By:   yamaguchi
Date:   Fri Apr  1 07:26:51 UTC 2022

Modified Files:
src/sys/net/lagg: if_lagg.c if_lagg_lacp.c

Log Message:
lagg(4): reimplement add and delete port

The IFNET_LOCK for the adding or deleting port became to
be held the whole time while the ifnet of the port is changed.


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.45 src/sys/net/lagg/if_lagg.c
cvs rdiff -u -r1.21 -r1.22 src/sys/net/lagg/if_lagg_lacp.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-04-01 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Apr  1 06:51:12 UTC 2022

Modified Files:
src/sys/dev: efi.c

Log Message:
Trailing Whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/efi.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/efi.c
diff -u src/sys/dev/efi.c:1.2 src/sys/dev/efi.c:1.3
--- src/sys/dev/efi.c:1.2	Sun Oct 10 14:52:30 2021
+++ src/sys/dev/efi.c	Fri Apr  1 06:51:12 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: efi.c,v 1.2 2021/10/10 14:52:30 jmcneill Exp $ */
+/* $NetBSD: efi.c,v 1.3 2022/04/01 06:51:12 skrll Exp $ */
 
 /*-
  * Copyright (c) 2021 Jared McNeill 
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: efi.c,v 1.2 2021/10/10 14:52:30 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: efi.c,v 1.3 2022/04/01 06:51:12 skrll Exp $");
 
 #include 
 #include 
@@ -60,7 +60,7 @@ __KERNEL_RCSID(0, "$NetBSD: efi.c,v 1.2 
 
 #include "ioconf.h"
 
-/* 
+/*
  * Maximum length of an EFI variable name. The UEFI spec doesn't specify a
  * constraint, but we want to limit the size to act as a guard rail against
  * allocating too much kernel memory.



CVS commit: src/sys/dev

2022-04-01 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Apr  1 06:51:12 UTC 2022

Modified Files:
src/sys/dev: efi.c

Log Message:
Trailing Whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/efi.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/x86/include

2022-04-01 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Apr  1 06:49:17 UTC 2022

Modified Files:
src/sys/arch/x86/include: efi.h

Log Message:
Trailing whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/x86/include/efi.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/x86/include

2022-04-01 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Apr  1 06:49:17 UTC 2022

Modified Files:
src/sys/arch/x86/include: efi.h

Log Message:
Trailing whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/x86/include/efi.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/x86/include/efi.h
diff -u src/sys/arch/x86/include/efi.h:1.9 src/sys/arch/x86/include/efi.h:1.10
--- src/sys/arch/x86/include/efi.h:1.9	Fri Oct 18 00:54:48 2019
+++ src/sys/arch/x86/include/efi.h	Fri Apr  1 06:49:17 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: efi.h,v 1.9 2019/10/18 00:54:48 manu Exp $   */
+/* $NetBSD: efi.h,v 1.10 2022/04/01 06:49:17 skrll Exp $   */
 
 /*-
  * Copyright (c) 2004 Marcel Moolenaar
@@ -233,7 +233,7 @@ struct efi_bs {
efi_status  (*bs_calculatecrc32)(void *, uintn, uint32_t *);
efi_status  (*bs_copymem)(void *, void *, uintn);
efi_status  (*bs_setmem)(void *, uintn, uint8_t);
-   efi_status  (*bs_createeventex)(uint32_t, efi_tpl, 
+   efi_status  (*bs_createeventex)(uint32_t, efi_tpl,
 	   efi_event_notify, void *, struct uuid, efi_event *);
 };
 



CVS commit: src/share/man/man4

2022-04-01 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Fri Apr  1 06:32:10 UTC 2022

Modified Files:
src/share/man/man4: pms.4

Log Message:
Update documentation to clean up obsolete settings and add new ones.


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 src/share/man/man4/pms.4

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

Modified files:

Index: src/share/man/man4/pms.4
diff -u src/share/man/man4/pms.4:1.40 src/share/man/man4/pms.4:1.41
--- src/share/man/man4/pms.4:1.40	Thu Oct 21 07:33:13 2021
+++ src/share/man/man4/pms.4	Fri Apr  1 06:32:10 2022
@@ -1,4 +1,4 @@
-.\" $NetBSD: pms.4,v 1.40 2021/10/21 07:33:13 wiz Exp $
+.\" $NetBSD: pms.4,v 1.41 2022/04/01 06:32:10 blymn Exp $
 .\"
 .\" Copyright (c) 1993 Christopher G. Demetriou
 .\" All rights reserved.
@@ -182,11 +182,27 @@ fingers that are located in the button e
 If set to 0 (the default) finger movements will not be reported.
 If set to 1 finger movements will be reported.
 .It Dv hw.synaptics.button_boundary
-Sets the top edge of the button emulation region on a clickpad.
+.It Dv hw.synaptics.button_region_percent
+These two items are interrelated in that setting one will affect
+the value of the other.
 Since a clickpad only reports left clicks this region is used to emulate
 two or three buttons by detecting the finger location and reporting
 either a button 2 or button 3 click if the click occurs within
 the region bounded by button_boundary and the bottom of the clickpad.
+.Va hw.synaptics.button_boundary
+sets the top edge of the button emulation region on a clickpad and
+the percentage that represents this value is calculated and stored
+in
+.Va hw.synaptics.button_region_percent
+Conversely, if
+.Va hw.synaptics.button_region_percent
+is set then the equivalent value for
+.Va hw.synaptics.button_boundary
+is calculated and stored.
+Using a percentage allows the button region for trackpads that are able
+to report their maximum and minimum values to be reliably set to
+occupy a defined portion of the trackpad area instead of the user having
+to tweak an arbitrary number.
 .It Dv hw.synaptics.button3_edge
 This defines the left hand edge of the button 3 region.
 If a click occurs in the region bounded by button_boundary, button3_edge
@@ -203,33 +219,23 @@ event.
 For completeness, the region between the left hand side of the clickpad,
 button2_edge and button_boundary will be reported as a button1 event
 as will any clicks that occur outside the button emulation region.
-.It Dv hw.synaptics.finger_scroll-min
-The minimum finger width at which the driver will start reporting
-vertical movements as Z axis events.
-Effectively, this emulates a mouse scroll wheel by the user using two
-fingers together on the click pad.
-The default value is 5, this value cannot be less than 5 due to the way
-the clickpad reports finger width.
-.It Dv hw.synaptics.finger_scroll-max
-The maximum finger width at which the driver will report finger
-movement as Z axis events.
-The default value is 12 and cannot be greater than 14.
-.It Dv hw.synaptics.finger_scroll-hysteresis
-This defines the number of packets to continue with the Z axis emulation.
-Due to the nature of the clickpad maintaining constant contact can be
-difficult.
-This hysteresis value prevents the driver flipping between two finger
-scroll and normal mouse movement erratically.
-Each time a valid finger scroll width is detected the packet count is
-reset.
-If this variable is set too high then mouse movements will be interpreted
-as Z-axis events after the two finger scoll has finished.
-If the variable is set too low then there will be mouse movements observed
-during the two finger scroll.
 .It Dv hw.synaptics.aux_mid_button_scroll
 This causes Y-axis movement on the "passthrough device" (e.g. the TrackPoint
 on ThinkPads) to result in scrolling events instead of Y-axis movement when
 the middle button is held.
+.It Dv hw.synaptics.vert_scroll_percent
+Reserve this percentage of the trackpad for a vertical scroll region.
+This will reduce
+.Va hw.synaptics.edge_right
+by this percentage.
+.It Dv hw.synaptics.horizontal_scroll_percent
+Reserve this percentage of the trackpad for a horizontal scroll region.
+This will reduce
+.Va hw.synaptics.edge_bottom
+by this percentage.
+The 
+.Va hw.synaptics.button_boundary
+will be recalculated as a result of the change.
 .El
 .Pp
 The following



CVS commit: src/share/man/man4

2022-04-01 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Fri Apr  1 06:32:10 UTC 2022

Modified Files:
src/share/man/man4: pms.4

Log Message:
Update documentation to clean up obsolete settings and add new ones.


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 src/share/man/man4/pms.4

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



CVS commit: src/sys/dev/pckbport

2022-04-01 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Fri Apr  1 06:31:30 UTC 2022

Modified Files:
src/sys/dev/pckbport: synaptics.c synapticsvar.h

Log Message:
Fix regression introduced when fixing PR kern/56613 and related tweaks

* A trackpad with external buttons needs to mask a number of lower bits
  of the X and Y coordinates IFF a button is down.  This was not being
  done so a button held down looked like an out of range packet and
  was therefore dropped.

* Now that trackpads are probed for their boundaries make the emulated
  button boundary settable by a percentage, also allow the right and
  bottom boundaries to be adjusted by a percentage to allow for
  horizontal and vertical scroll regions.


To generate a diff of this commit:
cvs rdiff -u -r1.76 -r1.77 src/sys/dev/pckbport/synaptics.c
cvs rdiff -u -r1.13 -r1.14 src/sys/dev/pckbport/synapticsvar.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/dev/pckbport/synaptics.c
diff -u src/sys/dev/pckbport/synaptics.c:1.76 src/sys/dev/pckbport/synaptics.c:1.77
--- src/sys/dev/pckbport/synaptics.c:1.76	Thu Mar  3 21:03:14 2022
+++ src/sys/dev/pckbport/synaptics.c	Fri Apr  1 06:31:29 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: synaptics.c,v 1.76 2022/03/03 21:03:14 blymn Exp $	*/
+/*	$NetBSD: synaptics.c,v 1.77 2022/04/01 06:31:29 blymn Exp $	*/
 
 /*
  * Copyright (c) 2005, Steve C. Woodford
@@ -48,7 +48,7 @@
 #include "opt_pms.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: synaptics.c,v 1.76 2022/03/03 21:03:14 blymn Exp $");
+__KERNEL_RCSID(0, "$NetBSD: synaptics.c,v 1.77 2022/04/01 06:31:29 blymn Exp $");
 
 #include 
 #include 
@@ -112,9 +112,12 @@ static int synaptics_edge_bottom = SYNAP
 static int synaptics_edge_motion_delta = 32;
 static u_int synaptics_finger_high = SYNAPTICS_FINGER_LIGHT + 5;
 static u_int synaptics_finger_low = SYNAPTICS_FINGER_LIGHT - 10;
-static int synaptics_button_boundary = SYNAPTICS_EDGE_BOTTOM + 720;
-static int synaptics_button2 = SYNAPTICS_EDGE_LEFT + (SYNAPTICS_EDGE_RIGHT - SYNAPTICS_EDGE_LEFT) / 3;
-static int synaptics_button3 = SYNAPTICS_EDGE_LEFT + 2 * (SYNAPTICS_EDGE_RIGHT - SYNAPTICS_EDGE_LEFT) / 3;
+static int synaptics_horiz_pct = 0;
+static int synaptics_vert_pct = 0;
+static int synaptics_button_pct = 30;
+static int synaptics_button_boundary;
+static int synaptics_button2;
+static int synaptics_button3;
 static int synaptics_two_fingers_emul = 0;
 static int synaptics_scale_x = 16;
 static int synaptics_scale_y = 16;
@@ -163,6 +166,23 @@ static int synaptics_movement_threshold_
 static int synaptics_movement_enable_nodenum;
 static int synaptics_button_region_movement_nodenum;
 static int synaptics_aux_mid_button_scroll_nodenum;
+static int synaptics_horiz_pct_nodenum;
+static int synaptics_vert_pct_nodenum;
+static int synaptics_button_pct_nodenum;
+
+/*
+ * copy of edges so we can recalculate edge limit if there is 
+ * vertical scroll region
+ */
+static int synaptics_actual_edge_right;
+static int synaptics_actual_edge_bottom;
+
+static int synaptics_old_vert_pct = 0;
+static int synaptics_old_horiz_pct = 0;
+static int synaptics_old_button_pct = 0;
+static int synaptics_old_button_boundary = SYNAPTICS_EDGE_BOTTOM;
+static int synaptics_old_horiz_edge = SYNAPTICS_EDGE_BOTTOM;
+static int synaptics_old_vert_edge = SYNAPTICS_EDGE_RIGHT;
 
 /*
  * This holds the processed packet data, it is global because multiple
@@ -232,6 +252,84 @@ synaptics_special_write(struct pms_softc
 }
 
 static void
+pms_synaptics_set_boundaries(void)
+{
+	if (synaptics_vert_pct != synaptics_old_vert_pct ) {
+		synaptics_edge_right -= ((unsigned long) synaptics_vert_pct *
+		(synaptics_actual_edge_right - synaptics_edge_left)) / 100;
+		synaptics_old_vert_pct = synaptics_vert_pct;
+		synaptics_old_vert_edge = synaptics_edge_right;
+	}
+
+	if (synaptics_edge_right != synaptics_old_vert_edge) {
+		if (synaptics_edge_right >= synaptics_actual_edge_right) {
+			synaptics_vert_pct = 0;
+			synaptics_edge_right = synaptics_actual_edge_right;
+		} else {
+			synaptics_vert_pct = 100 -
+			((unsigned long) 100 * synaptics_edge_right) /
+			(synaptics_actual_edge_right - synaptics_edge_left);
+		}
+		synaptics_old_vert_edge = synaptics_edge_right;
+	}
+
+	if (synaptics_horiz_pct != synaptics_old_horiz_pct ) {
+		synaptics_edge_bottom = synaptics_actual_edge_bottom +
+		((unsigned long) synaptics_horiz_pct *
+		(synaptics_edge_top - synaptics_actual_edge_bottom)) / 100;
+		synaptics_old_horiz_pct = synaptics_horiz_pct;
+		synaptics_old_horiz_edge = synaptics_edge_bottom;
+	}
+
+	if (synaptics_edge_bottom != synaptics_old_horiz_edge) {
+		if (synaptics_edge_bottom <= synaptics_actual_edge_bottom) {
+			synaptics_vert_pct = 0;
+			synaptics_edge_bottom = synaptics_actual_edge_bottom;
+		} else {
+			synaptics_horiz_pct = 100 -
+			((unsigned long) 100 * synaptics_edge_bottom) /
+			(synaptics_edge_top - 

CVS commit: src/sys/dev/pckbport

2022-04-01 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Fri Apr  1 06:31:30 UTC 2022

Modified Files:
src/sys/dev/pckbport: synaptics.c synapticsvar.h

Log Message:
Fix regression introduced when fixing PR kern/56613 and related tweaks

* A trackpad with external buttons needs to mask a number of lower bits
  of the X and Y coordinates IFF a button is down.  This was not being
  done so a button held down looked like an out of range packet and
  was therefore dropped.

* Now that trackpads are probed for their boundaries make the emulated
  button boundary settable by a percentage, also allow the right and
  bottom boundaries to be adjusted by a percentage to allow for
  horizontal and vertical scroll regions.


To generate a diff of this commit:
cvs rdiff -u -r1.76 -r1.77 src/sys/dev/pckbport/synaptics.c
cvs rdiff -u -r1.13 -r1.14 src/sys/dev/pckbport/synapticsvar.h

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