CVS commit: src/external/mit/xorg/server/drivers/xf86-video-wsfb

2022-08-19 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Aug 20 01:02:44 UTC 2022

Modified Files:
src/external/mit/xorg/server/drivers/xf86-video-wsfb: Makefile

Log Message:
wsfb: Disable broken DGA support:
 - dga(1) crashes X server since pScrn->AdjustFrame is NULL.
 - If nop is provided as pScrn->AdjustFrame, dga(1) crashes X server *AND*
   kernel. This is because DGA uses physical address of framebuffer via
   /dev/mem (oops!), but we provide only mmap(2)'ed virtual address.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 \
src/external/mit/xorg/server/drivers/xf86-video-wsfb/Makefile

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

Modified files:

Index: src/external/mit/xorg/server/drivers/xf86-video-wsfb/Makefile
diff -u src/external/mit/xorg/server/drivers/xf86-video-wsfb/Makefile:1.5 src/external/mit/xorg/server/drivers/xf86-video-wsfb/Makefile:1.6
--- src/external/mit/xorg/server/drivers/xf86-video-wsfb/Makefile:1.5	Fri Aug  3 02:26:00 2018
+++ src/external/mit/xorg/server/drivers/xf86-video-wsfb/Makefile	Sat Aug 20 01:02:44 2022
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.5 2018/08/03 02:26:00 kamil Exp $
+#	$NetBSD: Makefile,v 1.6 2022/08/20 01:02:44 rin Exp $
 
 DRIVER=		xf86-video-wsfb
 DRIVER_NAME=	wsfb_drv
@@ -11,3 +11,11 @@ CPPFLAGS+=	-DHAVE_CONFIG_H -I${X11SRCDIR
 CWARNFLAGS.clang+=	-Wno-format
 
 .include "../Makefile.xf86-driver"
+
+# XXX
+# DGA support for this driver is broken:
+# - dga(1) crashes X server since pScrn->AdjustFrame is NULL.
+# - If nop is provided as pScrn->AdjustFrame, dga(1) crashes X server *AND*
+#   kernel. This is because DGA uses physical address of framebuffer via
+#   /dev/mem (oops!), but we provide only mmap(2)'ed virtual address.
+CPPFLAGS+=	-UXFreeXDGA



CVS commit: src/external/mit/xorg/server/drivers/xf86-video-wsfb

2022-08-19 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Aug 20 01:02:44 UTC 2022

Modified Files:
src/external/mit/xorg/server/drivers/xf86-video-wsfb: Makefile

Log Message:
wsfb: Disable broken DGA support:
 - dga(1) crashes X server since pScrn->AdjustFrame is NULL.
 - If nop is provided as pScrn->AdjustFrame, dga(1) crashes X server *AND*
   kernel. This is because DGA uses physical address of framebuffer via
   /dev/mem (oops!), but we provide only mmap(2)'ed virtual address.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 \
src/external/mit/xorg/server/drivers/xf86-video-wsfb/Makefile

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



CVS commit: src/doc

2022-08-19 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Fri Aug 19 21:37:12 UTC 2022

Modified Files:
src/doc: 3RDPARTY

Log Message:
gcc-12.2.0 out


To generate a diff of this commit:
cvs rdiff -u -r1.1869 -r1.1870 src/doc/3RDPARTY

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

Modified files:

Index: src/doc/3RDPARTY
diff -u src/doc/3RDPARTY:1.1869 src/doc/3RDPARTY:1.1870
--- src/doc/3RDPARTY:1.1869	Wed Aug 17 12:24:42 2022
+++ src/doc/3RDPARTY	Fri Aug 19 21:37:12 2022
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.1869 2022/08/17 12:24:42 kre Exp $
+#	$NetBSD: 3RDPARTY,v 1.1870 2022/08/19 21:37:12 wiz Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -451,7 +451,7 @@ There is a flex2netbsd script to help ne
 
 Package:	gcc
 Version:	10.4.0
-Current Vers:	10.4.0/11.3.0/12.1.0
+Current Vers:	10.4.0/11.3.0/12.2.0
 Maintainer:	FSF
 Archive Site:	ftp://ftp.gnu.org/gnu/gcc/
 Home Page:	https://www.gnu.org/software/gcc/



CVS commit: src/doc

2022-08-19 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Fri Aug 19 21:37:12 UTC 2022

Modified Files:
src/doc: 3RDPARTY

Log Message:
gcc-12.2.0 out


To generate a diff of this commit:
cvs rdiff -u -r1.1869 -r1.1870 src/doc/3RDPARTY

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



Re: CVS commit: src/bin/sh

2022-08-19 Thread Robert Elz
Date:Fri, 19 Aug 2022 15:37:59 +
From:nia 
Message-ID:  

  | I wish editing mode and whether editing was enabled was more clearly
  | divorced.

That might be arranged, I will take a look and see what would be
involved (the major issue is making sure things get updated properly
when the user switches preferred editors - like if one is set as default
in some startup file, and the user then overrides that in another).
If things were to change such that most editing on/off decisions were
made by a separate option than emacs/vi mode, that issue would need
watching to make sure it is not forgotten/ignored.

And wrt:

  | it "feels right" that runtime commands take precedence over config files.

If it was the user manually typing "set -o vi" then yes, I'd agree that
generally that should probably take precedence.   But it almost never is,
those commands are almost always in a "config file" (like .profile or .shrc
or whatever the user wants to call the file in $ENV if they have one).

So what we really have, most of the time, is competing config files, and
and given the brutal nature of what set -o editor does, compared to the
more nuanced (at least, can be) EDITRC file, in this instance I think I'd
have EDITRC override the option's setup - apart from anything else, that's
how it has always been, and people are more likely to have a setup which
expects that, than the other way.

What might be possible however, is to have a change (or enabling, perhaps)
of editing mode, after the shell has issued its first prompt (ie: when it
is reading from the terminal - we know it is the terminal since none of this
stuff applies in any case other than an interactive shell reading from a tty)
have the shell only do the EL_SET "editor" command and not process EDITRC
again at all (if editing was enabled in a startup file, that will have
already been read, before the first prompt).   If the user after manually
choosing their editor of choice, wants their .editrc file processed again,
they can use the inputrc built in to read an editline config file of their
choice (like "inputrc $EDITRC" perhaps), or simply assign a new value to
EDITRC (like EDITRC=$EDITRC).   Either of those will cause the file to be
processed.   This ought to be relatively easy to implement, if it is 
conssidered a worthwhile enhancement (none of this affects me one way or
the other, I set vi mode before the prompt, and cetainly never change it
again, and I don't use a .editrc file (setting vi command maps, and everything
else the default works for me -- I don't use tabcomplete).

kre



CVS commit: src

2022-08-19 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Aug 19 19:40:39 UTC 2022

Modified Files:
src/tests/usr.bin/xlint/lint1: msg_267.c op_shl_lp64.c
src/usr.bin/xlint/lint1: err.c tree.c

Log Message:
lint: add more details to message about large bit-shifts


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/tests/usr.bin/xlint/lint1/msg_267.c
cvs rdiff -u -r1.3 -r1.4 src/tests/usr.bin/xlint/lint1/op_shl_lp64.c
cvs rdiff -u -r1.182 -r1.183 src/usr.bin/xlint/lint1/err.c
cvs rdiff -u -r1.475 -r1.476 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/msg_267.c
diff -u src/tests/usr.bin/xlint/lint1/msg_267.c:1.5 src/tests/usr.bin/xlint/lint1/msg_267.c:1.6
--- src/tests/usr.bin/xlint/lint1/msg_267.c:1.5	Fri Aug 19 19:13:04 2022
+++ src/tests/usr.bin/xlint/lint1/msg_267.c	Fri Aug 19 19:40:39 2022
@@ -1,19 +1,19 @@
-/*	$NetBSD: msg_267.c,v 1.5 2022/08/19 19:13:04 rillig Exp $	*/
+/*	$NetBSD: msg_267.c,v 1.6 2022/08/19 19:40:39 rillig Exp $	*/
 # 3 "msg_267.c"
 
-// Test for message: shift equal to size of object [267]
+// Test for message: shift amount %u equals bit-size of '%s' [267]
 
 int
 shr32(unsigned int x)
 {
-	/* expect+1: warning: shift equal to size of object [267] */
+	/* expect+1: warning: shift amount 32 equals bit-size of 'unsigned int' [267] */
 	return x >> 32;
 }
 
 int
 shl32(unsigned int x)
 {
-	/* expect+1: warning: shift equal to size of object [267] */
+	/* expect+1: warning: shift amount 32 equals bit-size of 'unsigned int' [267] */
 	return x << 32;
 }
 
@@ -26,7 +26,50 @@ shl32(unsigned int x)
 unsigned
 function(unsigned __attribute__((mode(TI))) arg)
 {
-	/* XXX: The 'size' usually means the size in bytes, not in bits. */
-	/* expect+1: warning: shift equal to size of object [267] */
+	/* expect+1: warning: shift amount 32 equals bit-size of 'unsigned int' [267] */
 	return (arg >> 32) & 3;
 }
+
+unsigned
+shift_bit_field(void)
+{
+	struct {
+		unsigned bit_field:18;
+	} s = { 12345 };
+
+	/*
+	 * A warning may be useful here for '>>' with a shift amount >= 18.
+	 *
+	 * For '<<' and bit-size <= 31, a warning only makes sense for shift
+	 * amounts >= 31, as it is legitimate to rely on the default integer
+	 * promotions of the left-hand operand. The default integer promotion
+	 * turns the type into 'int', not 'unsigned int', therefore the 31.
+	 * Using the same warning text would be confusing though.
+	 *
+	 * For '<<' and bit-size == 32, the standard case applies.
+	 *
+	 * As of 2022-08-19, Clang-tidy doesn't warn about any of these.
+	 */
+	return
+	(s.bit_field >> 17) &
+	(s.bit_field >> 18) &
+	(s.bit_field >> 19) &
+	(s.bit_field >> 31) &
+	/* XXX: Why 'int:18', not 'unsigned int:18'? */
+	/* expect+1: warning: shift amount 32 equals bit-size of 'int:18' [267] */
+	(s.bit_field >> 32) &
+	/* XXX: Why 'int', not 'unsigned int:18'? */
+	/* expect+1: warning: shift amount 33 is greater than bit-size 32 of 'int' [122] */
+	(s.bit_field >> 33) &
+	(s.bit_field << 17) &
+	(s.bit_field << 18) &
+	(s.bit_field << 19) &
+	(s.bit_field << 31) &
+	/* XXX: Why 'int:18', not 'unsigned int:18'? */
+	/* expect+1: warning: shift amount 32 equals bit-size of 'int:18' [267] */
+	(s.bit_field << 32) &
+	/* XXX: Why 'int', not 'unsigned int:18'? */
+	/* expect+1: warning: shift amount 33 is greater than bit-size 32 of 'int' [122] */
+	(s.bit_field << 33) &
+	15;
+}

Index: src/tests/usr.bin/xlint/lint1/op_shl_lp64.c
diff -u src/tests/usr.bin/xlint/lint1/op_shl_lp64.c:1.3 src/tests/usr.bin/xlint/lint1/op_shl_lp64.c:1.4
--- src/tests/usr.bin/xlint/lint1/op_shl_lp64.c:1.3	Sat Aug 21 11:50:57 2021
+++ src/tests/usr.bin/xlint/lint1/op_shl_lp64.c	Fri Aug 19 19:40:39 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: op_shl_lp64.c,v 1.3 2021/08/21 11:50:57 rillig Exp $	*/
+/*	$NetBSD: op_shl_lp64.c,v 1.4 2022/08/19 19:40:39 rillig Exp $	*/
 # 3 "op_shl_lp64.c"
 
 /*
@@ -19,7 +19,7 @@ const __uint128_t zero105 =
 - (((__uint128_t)1) << 9);
 
 const __uint128_t shl_128_129 =
-/* expect+1: warning: shift equal to size of object [267] */
+/* expect+1: warning: shift amount 128 equals bit-size of '__uint128_t' [267] */
 (((__uint128_t)1) << 128)
 /* expect+1: warning: shift amount 129 is greater than bit-size 128 of '__uint128_t' [122] */
 - (((__uint128_t)1) << 129);

Index: src/usr.bin/xlint/lint1/err.c
diff -u src/usr.bin/xlint/lint1/err.c:1.182 src/usr.bin/xlint/lint1/err.c:1.183
--- src/usr.bin/xlint/lint1/err.c:1.182	Sat Jul 16 22:36:06 2022
+++ src/usr.bin/xlint/lint1/err.c	Fri Aug 19 19:40:39 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: err.c,v 1.182 2022/07/16 22:36:06 rillig Exp $	*/
+/*	$NetBSD: err.c,v 1.183 2022/08/19 19:40:39 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if 

CVS commit: src

2022-08-19 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Aug 19 19:40:39 UTC 2022

Modified Files:
src/tests/usr.bin/xlint/lint1: msg_267.c op_shl_lp64.c
src/usr.bin/xlint/lint1: err.c tree.c

Log Message:
lint: add more details to message about large bit-shifts


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/tests/usr.bin/xlint/lint1/msg_267.c
cvs rdiff -u -r1.3 -r1.4 src/tests/usr.bin/xlint/lint1/op_shl_lp64.c
cvs rdiff -u -r1.182 -r1.183 src/usr.bin/xlint/lint1/err.c
cvs rdiff -u -r1.475 -r1.476 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/tests/usr.bin/xlint/lint1

2022-08-19 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Aug 19 19:13:04 UTC 2022

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

Log Message:
tests/lint: demonstrate wrong warning about bit-shift


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/tests/usr.bin/xlint/lint1/msg_267.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_267.c
diff -u src/tests/usr.bin/xlint/lint1/msg_267.c:1.4 src/tests/usr.bin/xlint/lint1/msg_267.c:1.5
--- src/tests/usr.bin/xlint/lint1/msg_267.c:1.4	Thu Jun 16 21:24:41 2022
+++ src/tests/usr.bin/xlint/lint1/msg_267.c	Fri Aug 19 19:13:04 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg_267.c,v 1.4 2022/06/16 21:24:41 rillig Exp $	*/
+/*	$NetBSD: msg_267.c,v 1.5 2022/08/19 19:13:04 rillig Exp $	*/
 # 3 "msg_267.c"
 
 // Test for message: shift equal to size of object [267]
@@ -16,3 +16,17 @@ shl32(unsigned int x)
 	/* expect+1: warning: shift equal to size of object [267] */
 	return x << 32;
 }
+
+/*
+ * As of 2022-08-19, lint ignores the GCC-specific 'mode' attribute, treating
+ * the tetra-int as a plain single-int, thus having width 32.
+ *
+ * https://gcc.gnu.org/onlinedocs/gccint/Machine-Modes.html
+ */
+unsigned
+function(unsigned __attribute__((mode(TI))) arg)
+{
+	/* XXX: The 'size' usually means the size in bytes, not in bits. */
+	/* expect+1: warning: shift equal to size of object [267] */
+	return (arg >> 32) & 3;
+}



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

2022-08-19 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Aug 19 19:13:04 UTC 2022

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

Log Message:
tests/lint: demonstrate wrong warning about bit-shift


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

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



CVS commit: src/external/mit/xorg/bin/xdm

2022-08-19 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Fri Aug 19 15:55:37 UTC 2022

Modified Files:
src/external/mit/xorg/bin/xdm: Makefile

Log Message:
xdm: Include "sbin" directories (and games) in DEF_USER_PATH.

Upstream's configure.ac picks a DEF_USER_PATH on a per-OS basis.

Most of these include the "sbin" directories, with NetBSD being the
(only?) exception.

However, this is inconsistent with the way a typical login shell is
initialized (when using the default skeleton files).  To avoid user
confusion, harmonize DEF_USER_PATH with our other defaults and with
other OSes.

PR xsrc/54851


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/external/mit/xorg/bin/xdm/Makefile

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

Modified files:

Index: src/external/mit/xorg/bin/xdm/Makefile
diff -u src/external/mit/xorg/bin/xdm/Makefile:1.18 src/external/mit/xorg/bin/xdm/Makefile:1.19
--- src/external/mit/xorg/bin/xdm/Makefile:1.18	Tue Aug 16 22:44:06 2022
+++ src/external/mit/xorg/bin/xdm/Makefile	Fri Aug 19 15:55:36 2022
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.18 2022/08/16 22:44:06 mrg Exp $
+#	$NetBSD: Makefile,v 1.19 2022/08/19 15:55:36 nia Exp $
 
 .include 
 
@@ -13,7 +13,7 @@ SRCS+=		Login.c greet.c verify.c
 CPPFLAGS+=	-DSTATIC_GREETER_LIB
 .endif
 
-DEF_USER_PATH=	/bin:/usr/bin:/usr/pkg/bin:/usr/local/bin:${X11BINDIR}
+DEF_USER_PATH=	/sbin:/usr/sbin:/bin:/usr/bin:/usr/games:/usr/pkg/sbin:/usr/pkg/bin:/usr/local/sbin:/usr/local/bin:${X11BINDIR}
 DEF_SYSTEM_PATH=/sbin:/usr/sbin:/bin:/usr/bin:${X11BINDIR}
 
 CPPFLAGS+=		-DRETSIGTYPE=void



CVS commit: src/external/mit/xorg/bin/xdm

2022-08-19 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Fri Aug 19 15:55:37 UTC 2022

Modified Files:
src/external/mit/xorg/bin/xdm: Makefile

Log Message:
xdm: Include "sbin" directories (and games) in DEF_USER_PATH.

Upstream's configure.ac picks a DEF_USER_PATH on a per-OS basis.

Most of these include the "sbin" directories, with NetBSD being the
(only?) exception.

However, this is inconsistent with the way a typical login shell is
initialized (when using the default skeleton files).  To avoid user
confusion, harmonize DEF_USER_PATH with our other defaults and with
other OSes.

PR xsrc/54851


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/external/mit/xorg/bin/xdm/Makefile

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



Re: CVS commit: src/bin/sh

2022-08-19 Thread nia
On Fri, Aug 19, 2022 at 04:15:52AM +0700, Robert Elz wrote:
> The effect of "set -o editor" (for whichever editor it uses), that
> is when the shell does: el_set(el, EL_EDITOR, editor); is to essentially
> set up all the key bindings so they match what that editor expects them
> to be.   Doing that after having processed .editrc seems backwards to me,
> as whatever that file did (at least for key bindings) is going to be lost.

This makes sense.  I have been mulling over whether NetBSD should
install an ~/.editrc file by default, and in this case it "feels
right" that runtime commands take precedence over config files.

However, there's some non-trivial ways this can go wrong, including
your example.

I wish editing mode and whether editing was enabled was more clearly
divorced.


CVS commit: src/bin/sh

2022-08-19 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Fri Aug 19 13:37:03 UTC 2022

Modified Files:
src/bin/sh: sh.1

Log Message:
Improve the description of the read builtin command.


To generate a diff of this commit:
cvs rdiff -u -r1.243 -r1.244 src/bin/sh/sh.1

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

Modified files:

Index: src/bin/sh/sh.1
diff -u src/bin/sh/sh.1:1.243 src/bin/sh/sh.1:1.244
--- src/bin/sh/sh.1:1.243	Fri Jan  7 05:30:30 2022
+++ src/bin/sh/sh.1	Fri Aug 19 13:37:03 2022
@@ -1,4 +1,4 @@
-.\"	$NetBSD: sh.1,v 1.243 2022/01/07 05:30:30 lukem Exp $
+.\"	$NetBSD: sh.1,v 1.244 2022/08/19 13:37:03 kre Exp $
 .\" Copyright (c) 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
 .\"
@@ -3537,23 +3537,29 @@ and the built-in uses a separately cache
 .It Ic read Oo Fl p Ar prompt Oc Oo Fl r Oc Ar variable Op Ar ...
 The
 .Ar prompt
-is printed if the
+is printed on standard error if the
 .Fl p
 option is specified and the standard input is a terminal.
 Then a line is read from the standard input.
 The trailing newline is deleted from the
 line and the line is split as described in the field splitting section of the
 .Sx Word Expansions
-section above, and the pieces are assigned to the variables in order.
-If there are more pieces than variables, the remaining pieces
+section above.
+The pieces are assigned to the
+.Ar variable Ns s
+in order.
+If there are more pieces than variables,
+the remaining pieces
 (along with the characters in
 .Ev IFS
-that separated them) are assigned to the last variable.
+that separated them) are all assigned to the last
+.Ar variable .
 If there are more variables than pieces,
 the remaining variables are assigned the null string.
 The
 .Ic read
-built-in will indicate success unless EOF is encountered on input, in
+built-in will indicate success unless EOF, or a read error,
+is encountered on input, in
 which case failure is returned.
 .Pp
 By default, unless the
@@ -3562,8 +3568,14 @@ option is specified, the backslash
 .Dq \e
 acts as an escape character, causing the following character to be treated
 literally.
-If a backslash is followed by a newline, the backslash and the
-newline will be deleted.
+This is the only form of quoting that applies.
+If an unescaped backslash is followed by a newline,
+the backslash and the newline will be deleted,
+and replaced by the contents of the following line,
+which is processed as if it had been part of the original line.
+This includes reading yet more input if necessary, 
+until a line is read that is not terminated by
+an unescaped backslash immediately before the newline.
 .\"
 .Pp
 .It Ic readonly Ar name Ns Oo =value Oc ...



CVS commit: src/bin/sh

2022-08-19 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Fri Aug 19 13:37:03 UTC 2022

Modified Files:
src/bin/sh: sh.1

Log Message:
Improve the description of the read builtin command.


To generate a diff of this commit:
cvs rdiff -u -r1.243 -r1.244 src/bin/sh/sh.1

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



CVS commit: src/bin/sh

2022-08-19 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Fri Aug 19 12:52:32 UTC 2022

Modified Files:
src/bin/sh: miscbltin.c

Log Message:
Don't output the error for bad usage (no var name given)
after already writing the prompt (set with the -p option).

That results in nonsense like:

$ read -p foo
fooread: arg count

While here, improve the error message so it means something.

Now we will get:

$ read -p foo
read: variable name required
Usage: read [-r] [-p prompt] var...

[Detected by code reading while doing the work for the previous fix]


To generate a diff of this commit:
cvs rdiff -u -r1.51 -r1.52 src/bin/sh/miscbltin.c

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



CVS commit: src/bin/sh

2022-08-19 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Fri Aug 19 12:52:32 UTC 2022

Modified Files:
src/bin/sh: miscbltin.c

Log Message:
Don't output the error for bad usage (no var name given)
after already writing the prompt (set with the -p option).

That results in nonsense like:

$ read -p foo
fooread: arg count

While here, improve the error message so it means something.

Now we will get:

$ read -p foo
read: variable name required
Usage: read [-r] [-p prompt] var...

[Detected by code reading while doing the work for the previous fix]


To generate a diff of this commit:
cvs rdiff -u -r1.51 -r1.52 src/bin/sh/miscbltin.c

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

Modified files:

Index: src/bin/sh/miscbltin.c
diff -u src/bin/sh/miscbltin.c:1.51 src/bin/sh/miscbltin.c:1.52
--- src/bin/sh/miscbltin.c:1.51	Fri Aug 19 12:17:18 2022
+++ src/bin/sh/miscbltin.c	Fri Aug 19 12:52:31 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: miscbltin.c,v 1.51 2022/08/19 12:17:18 kre Exp $	*/
+/*	$NetBSD: miscbltin.c,v 1.52 2022/08/19 12:52:31 kre Exp $	*/
 
 /*-
  * Copyright (c) 1991, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)miscbltin.c	8.4 (Berkeley) 5/4/95";
 #else
-__RCSID("$NetBSD: miscbltin.c,v 1.51 2022/08/19 12:17:18 kre Exp $");
+__RCSID("$NetBSD: miscbltin.c,v 1.52 2022/08/19 12:52:31 kre Exp $");
 #endif
 #endif /* not lint */
 
@@ -111,14 +111,15 @@ readcmd(int argc, char **argv)
 			rflag = 1;
 	}
 
+	if (*(ap = argptr) == NULL)
+		error("variable name required\n"
+			"Usage: read [-r] [-p prompt] var...");
+
 	if (prompt && isatty(0)) {
 		out2str(prompt);
 		flushall();
 	}
 
-	if (*(ap = argptr) == NULL)
-		error("arg count");
-
 	if ((ifs = bltinlookup("IFS", 1)) == NULL)
 		ifs = " \t\n";
 



CVS commit: src/sys/sys

2022-08-19 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri Aug 19 12:49:55 UTC 2022

Modified Files:
src/sys/sys: uuid.h

Log Message:
sys/uuid.h: Need sys/types.h for uintN_t.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/sys/uuid.h

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

Modified files:

Index: src/sys/sys/uuid.h
diff -u src/sys/sys/uuid.h:1.6 src/sys/sys/uuid.h:1.7
--- src/sys/sys/uuid.h:1.6	Sat Oct  4 11:15:44 2014
+++ src/sys/sys/uuid.h	Fri Aug 19 12:49:55 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: uuid.h,v 1.6 2014/10/04 11:15:44 riastradh Exp $	*/
+/*	$NetBSD: uuid.h,v 1.7 2022/08/19 12:49:55 riastradh Exp $	*/
 
 /*
  * Copyright (c) 2002 Marcel Moolenaar
@@ -32,6 +32,7 @@
 #define	_SYS_UUID_H_
 
 #include 
+#include 
 
 /* Length of a node address (an IEEE 802 address). */
 #define	_UUID_NODE_LEN		6



CVS commit: src/sys/sys

2022-08-19 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri Aug 19 12:49:55 UTC 2022

Modified Files:
src/sys/sys: uuid.h

Log Message:
sys/uuid.h: Need sys/types.h for uintN_t.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/sys/uuid.h

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



CVS commit: src/bin/sh

2022-08-19 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Fri Aug 19 12:17:18 UTC 2022

Modified Files:
src/bin/sh: miscbltin.c

Log Message:
PR bin/56972  Fix escape ('\') handling in sh read builtin.

In 1.35 (March 2005) (the big read fixup), most escape handling and IFS
processing in the read builtin was corrected.  However 2 cases were missed,
one is a word (something to be assigned to any variable but the last) in
which every character is escaped (the code was relying on a non-escaped char
to set the "in a word" status), and second trailing IFS whitespace at
the end of the line was being deleted, even if the chars had been escaped
(the escape chars are no longer present).

See the PR for more details (including the case that detected the problem).

After fixing this, I looked at the FreeBSD code (normally might do it
before, but these fixes were trivial) to check their implementation.
Their code does similar things to ours now does, but in a completely
different way, their read builtin is more complex than ours needs to
be (they handle more options).   For anyone tempted to simply incorporate
their code, note that it relies upon infrastructure changes elsewhere
in the shell, so would not be a simple cut and drop in exercise.

This needs pullups to -3 -4 -5 -6 -7 -8 and -9 (fortunately this is
happening before -10 is branched, so will never be broken this way there).


To generate a diff of this commit:
cvs rdiff -u -r1.50 -r1.51 src/bin/sh/miscbltin.c

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



CVS commit: src/bin/sh

2022-08-19 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Fri Aug 19 12:17:18 UTC 2022

Modified Files:
src/bin/sh: miscbltin.c

Log Message:
PR bin/56972  Fix escape ('\') handling in sh read builtin.

In 1.35 (March 2005) (the big read fixup), most escape handling and IFS
processing in the read builtin was corrected.  However 2 cases were missed,
one is a word (something to be assigned to any variable but the last) in
which every character is escaped (the code was relying on a non-escaped char
to set the "in a word" status), and second trailing IFS whitespace at
the end of the line was being deleted, even if the chars had been escaped
(the escape chars are no longer present).

See the PR for more details (including the case that detected the problem).

After fixing this, I looked at the FreeBSD code (normally might do it
before, but these fixes were trivial) to check their implementation.
Their code does similar things to ours now does, but in a completely
different way, their read builtin is more complex than ours needs to
be (they handle more options).   For anyone tempted to simply incorporate
their code, note that it relies upon infrastructure changes elsewhere
in the shell, so would not be a simple cut and drop in exercise.

This needs pullups to -3 -4 -5 -6 -7 -8 and -9 (fortunately this is
happening before -10 is branched, so will never be broken this way there).


To generate a diff of this commit:
cvs rdiff -u -r1.50 -r1.51 src/bin/sh/miscbltin.c

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

Modified files:

Index: src/bin/sh/miscbltin.c
diff -u src/bin/sh/miscbltin.c:1.50 src/bin/sh/miscbltin.c:1.51
--- src/bin/sh/miscbltin.c:1.50	Sat Apr 16 14:26:26 2022
+++ src/bin/sh/miscbltin.c	Fri Aug 19 12:17:18 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: miscbltin.c,v 1.50 2022/04/16 14:26:26 kre Exp $	*/
+/*	$NetBSD: miscbltin.c,v 1.51 2022/08/19 12:17:18 kre Exp $	*/
 
 /*-
  * Copyright (c) 1991, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)miscbltin.c	8.4 (Berkeley) 5/4/95";
 #else
-__RCSID("$NetBSD: miscbltin.c,v 1.50 2022/04/16 14:26:26 kre Exp $");
+__RCSID("$NetBSD: miscbltin.c,v 1.51 2022/08/19 12:17:18 kre Exp $");
 #endif
 #endif /* not lint */
 
@@ -100,6 +100,7 @@ readcmd(int argc, char **argv)
 	int i;
 	int is_ifs;
 	int saveall = 0;
+	ptrdiff_t wordlen = 0;
 
 	rflag = 0;
 	prompt = NULL;
@@ -137,7 +138,7 @@ readcmd(int argc, char **argv)
 break;
 			}
 			if (c != '\n')
-STPUTC(c, p);
+goto wdch;
 			continue;
 		}
 		if (c == '\n')
@@ -164,12 +165,14 @@ readcmd(int argc, char **argv)
 		}
 
 		if (is_ifs == 0) {
+  wdch:;
 			/* append this character to the current variable */
 			startword = 0;
 			if (saveall)
 /* Not just a spare terminator */
 saveall++;
 			STPUTC(c, p);
+			wordlen = p - stackblock();
 			continue;
 		}
 
@@ -187,11 +190,12 @@ readcmd(int argc, char **argv)
 		setvar(*ap, stackblock(), 0);
 		ap++;
 		STARTSTACKSTR(p);
+		wordlen = 0;
 	}
 	STACKSTRNUL(p);
 
 	/* Remove trailing IFS chars */
-	for (; stackblock() <= --p; *p = 0) {
+	for (; stackblock() + wordlen <= --p; *p = 0) {
 		if (!strchr(ifs, *p))
 			break;
 		if (strchr(" \t\n", *p))



CVS commit: src/sys/arch/aarch64

2022-08-19 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Fri Aug 19 08:17:32 UTC 2022

Modified Files:
src/sys/arch/aarch64/aarch64: aarch64_machdep.c pmap.c
src/sys/arch/aarch64/include: pte.h

Log Message:
Fixed a bug that pte's __BIT(63,48) could be set when accessing addresses above 
0x0001 in /dev/mem with mmap().


To generate a diff of this commit:
cvs rdiff -u -r1.65 -r1.66 src/sys/arch/aarch64/aarch64/aarch64_machdep.c
cvs rdiff -u -r1.138 -r1.139 src/sys/arch/aarch64/aarch64/pmap.c
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/aarch64/include/pte.h

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



CVS commit: src/sys/arch/aarch64

2022-08-19 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Fri Aug 19 08:17:32 UTC 2022

Modified Files:
src/sys/arch/aarch64/aarch64: aarch64_machdep.c pmap.c
src/sys/arch/aarch64/include: pte.h

Log Message:
Fixed a bug that pte's __BIT(63,48) could be set when accessing addresses above 
0x0001 in /dev/mem with mmap().


To generate a diff of this commit:
cvs rdiff -u -r1.65 -r1.66 src/sys/arch/aarch64/aarch64/aarch64_machdep.c
cvs rdiff -u -r1.138 -r1.139 src/sys/arch/aarch64/aarch64/pmap.c
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/aarch64/include/pte.h

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

Modified files:

Index: src/sys/arch/aarch64/aarch64/aarch64_machdep.c
diff -u src/sys/arch/aarch64/aarch64/aarch64_machdep.c:1.65 src/sys/arch/aarch64/aarch64/aarch64_machdep.c:1.66
--- src/sys/arch/aarch64/aarch64/aarch64_machdep.c:1.65	Sat Mar 12 09:16:05 2022
+++ src/sys/arch/aarch64/aarch64/aarch64_machdep.c	Fri Aug 19 08:17:32 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: aarch64_machdep.c,v 1.65 2022/03/12 09:16:05 skrll Exp $ */
+/* $NetBSD: aarch64_machdep.c,v 1.66 2022/08/19 08:17:32 ryo Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(1, "$NetBSD: aarch64_machdep.c,v 1.65 2022/03/12 09:16:05 skrll Exp $");
+__KERNEL_RCSID(1, "$NetBSD: aarch64_machdep.c,v 1.66 2022/08/19 08:17:32 ryo Exp $");
 
 #include "opt_arm_debug.h"
 #include "opt_cpuoptions.h"
@@ -619,6 +619,9 @@ mm_md_physacc(paddr_t pa, vm_prot_t prot
 	if (in_dram_p(pa, 0))
 		return 0;
 
+	if (pa >= AARCH64_MAX_PA)
+		return EFAULT;
+
 	return kauth_authorize_machdep(kauth_cred_get(),
 	KAUTH_MACHDEP_UNMANAGEDMEM, NULL, NULL, NULL, NULL);
 }

Index: src/sys/arch/aarch64/aarch64/pmap.c
diff -u src/sys/arch/aarch64/aarch64/pmap.c:1.138 src/sys/arch/aarch64/aarch64/pmap.c:1.139
--- src/sys/arch/aarch64/aarch64/pmap.c:1.138	Fri Aug 19 07:45:50 2022
+++ src/sys/arch/aarch64/aarch64/pmap.c	Fri Aug 19 08:17:32 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.138 2022/08/19 07:45:50 ryo Exp $	*/
+/*	$NetBSD: pmap.c,v 1.139 2022/08/19 08:17:32 ryo Exp $	*/
 
 /*
  * Copyright (c) 2017 Ryo Shimizu 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.138 2022/08/19 07:45:50 ryo Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.139 2022/08/19 08:17:32 ryo Exp $");
 
 #include "opt_arm_debug.h"
 #include "opt_cpuoptions.h"
@@ -1915,6 +1915,7 @@ _pmap_enter(struct pmap *pm, vaddr_t va,
 	KASSERT_PM_ADDR(pm, va);
 	KASSERT(!IN_DIRECTMAP_ADDR(va));
 	KASSERT((prot & VM_PROT_ALL) != VM_PROT_NONE);
+	KASSERT(pa < AARCH64_MAX_PA);
 
 #ifdef PMAPCOUNTERS
 	PMAP_COUNT(mappings);

Index: src/sys/arch/aarch64/include/pte.h
diff -u src/sys/arch/aarch64/include/pte.h:1.13 src/sys/arch/aarch64/include/pte.h:1.14
--- src/sys/arch/aarch64/include/pte.h:1.13	Sun Oct 10 07:15:25 2021
+++ src/sys/arch/aarch64/include/pte.h	Fri Aug 19 08:17:32 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: pte.h,v 1.13 2021/10/10 07:15:25 skrll Exp $ */
+/* $NetBSD: pte.h,v 1.14 2022/08/19 08:17:32 ryo Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -93,6 +93,7 @@ typedef uint64_t pt_entry_t;	/* L3(4k) t
 #define L1_BLK_OA		__BITS(47, 30)	/* 1GB */
 #define L2_BLK_OA		__BITS(47, 21)	/* 2MB */
 #define L3_PAG_OA		__BITS(47, 12)	/* 4KB */
+#define AARCH64_MAX_PA		__BIT(48)
 
 
 /* L0 table, 512GB/entry * 512 */



CVS commit: src/sys/dev/pci

2022-08-19 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Aug 19 07:52:22 UTC 2022

Modified Files:
src/sys/dev/pci: if_bge.c if_bgevar.h

Log Message:
Make bge_detaching a bool. NFC.


To generate a diff of this commit:
cvs rdiff -u -r1.379 -r1.380 src/sys/dev/pci/if_bge.c
cvs rdiff -u -r1.35 -r1.36 src/sys/dev/pci/if_bgevar.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/pci/if_bge.c
diff -u src/sys/dev/pci/if_bge.c:1.379 src/sys/dev/pci/if_bge.c:1.380
--- src/sys/dev/pci/if_bge.c:1.379	Fri Aug 19 07:48:43 2022
+++ src/sys/dev/pci/if_bge.c	Fri Aug 19 07:52:22 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_bge.c,v 1.379 2022/08/19 07:48:43 skrll Exp $	*/
+/*	$NetBSD: if_bge.c,v 1.380 2022/08/19 07:52:22 skrll Exp $	*/
 
 /*
  * Copyright (c) 2001 Wind River Systems
@@ -79,7 +79,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_bge.c,v 1.379 2022/08/19 07:48:43 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_bge.c,v 1.380 2022/08/19 07:52:22 skrll Exp $");
 
 #include 
 #include 
@@ -6134,7 +6134,7 @@ bge_stop_locked(struct ifnet *ifp, int d
 	KASSERT(mutex_owned(sc->sc_core_lock));
 
 	if (disable) {
-		sc->bge_detaching = 1;
+		sc->bge_detaching = true;
 		callout_halt(>bge_timeout, NULL);
 	} else
 		callout_stop(>bge_timeout);

Index: src/sys/dev/pci/if_bgevar.h
diff -u src/sys/dev/pci/if_bgevar.h:1.35 src/sys/dev/pci/if_bgevar.h:1.36
--- src/sys/dev/pci/if_bgevar.h:1.35	Fri Aug 19 07:48:43 2022
+++ src/sys/dev/pci/if_bgevar.h	Fri Aug 19 07:52:22 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_bgevar.h,v 1.35 2022/08/19 07:48:43 skrll Exp $	*/
+/*	$NetBSD: if_bgevar.h,v 1.36 2022/08/19 07:52:22 skrll Exp $	*/
 /*
  * Copyright (c) 2001 Wind River Systems
  * Copyright (c) 1997, 1998, 1999, 2001
@@ -350,7 +350,7 @@ struct bge_softc {
 	int			bge_txcnt;
 	struct callout		bge_timeout;
 	int			bge_pending_rxintr_change;
-	int			bge_detaching;
+	bool			bge_detaching;
 	SLIST_HEAD(, txdmamap_pool_entry) txdma_list;
 	struct txdmamap_pool_entry *txdma[BGE_TX_RING_CNT];
 



CVS commit: src/sys/dev/pci

2022-08-19 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Aug 19 07:52:22 UTC 2022

Modified Files:
src/sys/dev/pci: if_bge.c if_bgevar.h

Log Message:
Make bge_detaching a bool. NFC.


To generate a diff of this commit:
cvs rdiff -u -r1.379 -r1.380 src/sys/dev/pci/if_bge.c
cvs rdiff -u -r1.35 -r1.36 src/sys/dev/pci/if_bgevar.h

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



CVS commit: src/sys/dev/pci

2022-08-19 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Aug 19 07:48:43 UTC 2022

Modified Files:
src/sys/dev/pci: if_bge.c if_bgevar.h

Log Message:
softc member naming consistency with wm(4). (Taylor made me do it... not
really)


To generate a diff of this commit:
cvs rdiff -u -r1.378 -r1.379 src/sys/dev/pci/if_bge.c
cvs rdiff -u -r1.34 -r1.35 src/sys/dev/pci/if_bgevar.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/pci/if_bge.c
diff -u src/sys/dev/pci/if_bge.c:1.378 src/sys/dev/pci/if_bge.c:1.379
--- src/sys/dev/pci/if_bge.c:1.378	Fri Aug 19 07:43:54 2022
+++ src/sys/dev/pci/if_bge.c	Fri Aug 19 07:48:43 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_bge.c,v 1.378 2022/08/19 07:43:54 skrll Exp $	*/
+/*	$NetBSD: if_bge.c,v 1.379 2022/08/19 07:48:43 skrll Exp $	*/
 
 /*
  * Copyright (c) 2001 Wind River Systems
@@ -79,7 +79,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_bge.c,v 1.378 2022/08/19 07:43:54 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_bge.c,v 1.379 2022/08/19 07:48:43 skrll Exp $");
 
 #include 
 #include 
@@ -6048,7 +6048,7 @@ bge_watchdog(struct ifnet *ifp)
 
 	KASSERT(mutex_owned(sc->sc_core_lock));
 
-	if (!sc->sc_triggerreset && bge_watchdog_check(sc))
+	if (!sc->sc_trigger_reset && bge_watchdog_check(sc))
 		return true;
 
 	aprint_error_dev(sc->bge_dev, "watchdog timeout -- resetting\n");
@@ -6419,7 +6419,7 @@ bge_sysctl_init(struct bge_softc *sc)
 	CTLFLAG_READWRITE,
 	CTLTYPE_BOOL, "trigger_reset",
 	SYSCTL_DESCR("Trigger an interface reset"),
-	NULL, 0, >sc_triggerreset, 0, CTL_CREATE,
+	NULL, 0, >sc_trigger_reset, 0, CTL_CREATE,
 	CTL_EOL)) != 0) {
 		goto out;
 	}

Index: src/sys/dev/pci/if_bgevar.h
diff -u src/sys/dev/pci/if_bgevar.h:1.34 src/sys/dev/pci/if_bgevar.h:1.35
--- src/sys/dev/pci/if_bgevar.h:1.34	Sun Aug 14 09:03:05 2022
+++ src/sys/dev/pci/if_bgevar.h	Fri Aug 19 07:48:43 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_bgevar.h,v 1.34 2022/08/14 09:03:05 skrll Exp $	*/
+/*	$NetBSD: if_bgevar.h,v 1.35 2022/08/19 07:48:43 skrll Exp $	*/
 /*
  * Copyright (c) 2001 Wind River Systems
  * Copyright (c) 1997, 1998, 1999, 2001
@@ -363,7 +363,7 @@ struct bge_softc {
 	struct work sc_reset_work;
 	volatile unsigned sc_reset_pending;
 
-	bool sc_triggerreset;
+	bool sc_trigger_reset;
 };
 
 #endif /* _DEV_PCI_IF_BGEVAR_H_ */



CVS commit: src/sys/dev/pci

2022-08-19 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Aug 19 07:48:43 UTC 2022

Modified Files:
src/sys/dev/pci: if_bge.c if_bgevar.h

Log Message:
softc member naming consistency with wm(4). (Taylor made me do it... not
really)


To generate a diff of this commit:
cvs rdiff -u -r1.378 -r1.379 src/sys/dev/pci/if_bge.c
cvs rdiff -u -r1.34 -r1.35 src/sys/dev/pci/if_bgevar.h

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



CVS commit: src/sys/arch/aarch64/aarch64

2022-08-19 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Fri Aug 19 07:45:50 UTC 2022

Modified Files:
src/sys/arch/aarch64/aarch64: pmap.c

Log Message:
When accessed in mmap by the device pager, pmap_enter() may be called with prot 
== PROT_WRITE.


To generate a diff of this commit:
cvs rdiff -u -r1.137 -r1.138 src/sys/arch/aarch64/aarch64/pmap.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/pmap.c
diff -u src/sys/arch/aarch64/aarch64/pmap.c:1.137 src/sys/arch/aarch64/aarch64/pmap.c:1.138
--- src/sys/arch/aarch64/aarch64/pmap.c:1.137	Tue May  3 20:09:54 2022
+++ src/sys/arch/aarch64/aarch64/pmap.c	Fri Aug 19 07:45:50 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.137 2022/05/03 20:09:54 skrll Exp $	*/
+/*	$NetBSD: pmap.c,v 1.138 2022/08/19 07:45:50 ryo Exp $	*/
 
 /*
  * Copyright (c) 2017 Ryo Shimizu 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.137 2022/05/03 20:09:54 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.138 2022/08/19 07:45:50 ryo Exp $");
 
 #include "opt_arm_debug.h"
 #include "opt_cpuoptions.h"
@@ -1914,7 +1914,7 @@ _pmap_enter(struct pmap *pm, vaddr_t va,
 
 	KASSERT_PM_ADDR(pm, va);
 	KASSERT(!IN_DIRECTMAP_ADDR(va));
-	KASSERT(prot & VM_PROT_READ);
+	KASSERT((prot & VM_PROT_ALL) != VM_PROT_NONE);
 
 #ifdef PMAPCOUNTERS
 	PMAP_COUNT(mappings);



CVS commit: src/sys/arch/aarch64/aarch64

2022-08-19 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Fri Aug 19 07:45:50 UTC 2022

Modified Files:
src/sys/arch/aarch64/aarch64: pmap.c

Log Message:
When accessed in mmap by the device pager, pmap_enter() may be called with prot 
== PROT_WRITE.


To generate a diff of this commit:
cvs rdiff -u -r1.137 -r1.138 src/sys/arch/aarch64/aarch64/pmap.c

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



CVS commit: src/sys/dev/pci

2022-08-19 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Aug 19 07:43:54 UTC 2022

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

Log Message:
Should be checking ifp->if_flags in bge_init and not sc->bge_if_flags.

Spotted by Taylor.


To generate a diff of this commit:
cvs rdiff -u -r1.377 -r1.378 src/sys/dev/pci/if_bge.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/if_bge.c
diff -u src/sys/dev/pci/if_bge.c:1.377 src/sys/dev/pci/if_bge.c:1.378
--- src/sys/dev/pci/if_bge.c:1.377	Sun Aug 14 09:04:17 2022
+++ src/sys/dev/pci/if_bge.c	Fri Aug 19 07:43:54 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_bge.c,v 1.377 2022/08/14 09:04:17 skrll Exp $	*/
+/*	$NetBSD: if_bge.c,v 1.378 2022/08/19 07:43:54 skrll Exp $	*/
 
 /*
  * Copyright (c) 2001 Wind River Systems
@@ -79,7 +79,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_bge.c,v 1.377 2022/08/14 09:04:17 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_bge.c,v 1.378 2022/08/19 07:43:54 skrll Exp $");
 
 #include 
 #include 
@@ -5669,7 +5669,7 @@ bge_init_locked(struct ifnet *ifp)
 	((uint32_t)htons(m[1]) << 16) | htons(m[2]));
 
 	/* Enable or disable promiscuous mode as needed. */
-	if (sc->bge_if_flags & IFF_PROMISC)
+	if (ifp->if_flags & IFF_PROMISC)
 		BGE_SETBIT(sc, BGE_RX_MODE, BGE_RXMODE_RX_PROMISC);
 	else
 		BGE_CLRBIT(sc, BGE_RX_MODE, BGE_RXMODE_RX_PROMISC);



CVS commit: src/sys/dev/pci

2022-08-19 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Aug 19 07:43:54 UTC 2022

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

Log Message:
Should be checking ifp->if_flags in bge_init and not sc->bge_if_flags.

Spotted by Taylor.


To generate a diff of this commit:
cvs rdiff -u -r1.377 -r1.378 src/sys/dev/pci/if_bge.c

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