CVS commit: src/sys/dev/hil

2021-09-18 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sun Sep 19 04:55:58 UTC 2021

Modified Files:
src/sys/dev/hil: hilkbd.c hilms.c

Log Message:
Use C99 designated initializer for wscons ops.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/hil/hilkbd.c
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/hil/hilms.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/hil/hilkbd.c
diff -u src/sys/dev/hil/hilkbd.c:1.6 src/sys/dev/hil/hilkbd.c:1.7
--- src/sys/dev/hil/hilkbd.c:1.6	Sat Aug  7 16:19:11 2021
+++ src/sys/dev/hil/hilkbd.c	Sun Sep 19 04:55:58 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: hilkbd.c,v 1.6 2021/08/07 16:19:11 thorpej Exp $	*/
+/*	$NetBSD: hilkbd.c,v 1.7 2021/09/19 04:55:58 tsutsui Exp $	*/
 /*	$OpenBSD: hilkbd.c,v 1.14 2009/01/21 21:53:59 grange Exp $	*/
 /*
  * Copyright (c) 2003, Miodrag Vallat.
@@ -79,9 +79,9 @@ static void	hilkbd_set_leds(void *, int)
 static int	hilkbd_ioctl(void *, u_long, void *, int, struct lwp *);
 
 static const struct wskbd_accessops hilkbd_accessops = {
-	hilkbd_enable,
-	hilkbd_set_leds,
-	hilkbd_ioctl,
+	.enable   = hilkbd_enable,
+	.set_leds = hilkbd_set_leds,
+	.ioctl= hilkbd_ioctl,
 };
 
 static void	hilkbd_cngetc(void *, u_int *, int *);
@@ -89,26 +89,28 @@ static void	hilkbd_cnpollc(void *, int);
 static void	hilkbd_cnbell(void *, u_int, u_int, u_int);
 
 static const struct wskbd_consops hilkbd_consops = {
-	hilkbd_cngetc,
-	hilkbd_cnpollc,
-	hilkbd_cnbell,
+	.getc  = hilkbd_cngetc,
+	.pollc = hilkbd_cnpollc,
+	.bell  = hilkbd_cnbell,
 };
 
 static struct wskbd_mapdata hilkbd_keymapdata = {
-	hilkbd_keydesctab,
+	.keydesc = hilkbd_keydesctab,
+	.layout  =
 #ifdef HILKBD_LAYOUT
-	HILKBD_LAYOUT,
+	HILKBD_LAYOUT,
 #else
-	KB_US,
+	KB_US,
 #endif
 };
 
 static struct wskbd_mapdata hilkbd_keymapdata_ps2 = {
-	hilkbd_keydesctab_ps2,
+	.keydesc = hilkbd_keydesctab_ps2,
+	.layout = 
 #ifdef HILKBD_LAYOUT
-	HILKBD_LAYOUT,
+	HILKBD_LAYOUT,
 #else
-	KB_US,
+	KB_US,
 #endif
 };
 

Index: src/sys/dev/hil/hilms.c
diff -u src/sys/dev/hil/hilms.c:1.4 src/sys/dev/hil/hilms.c:1.5
--- src/sys/dev/hil/hilms.c:1.4	Sat Aug  7 16:19:11 2021
+++ src/sys/dev/hil/hilms.c	Sun Sep 19 04:55:58 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: hilms.c,v 1.4 2021/08/07 16:19:11 thorpej Exp $	*/
+/*	$NetBSD: hilms.c,v 1.5 2021/09/19 04:55:58 tsutsui Exp $	*/
 /*	$OpenBSD: hilms.c,v 1.5 2007/04/10 22:37:17 miod Exp $	*/
 /*
  * Copyright (c) 2003, Miodrag Vallat.
@@ -67,9 +67,9 @@ static int	hilms_ioctl(void *, u_long, v
 static void	hilms_disable(void *);
 
 static const struct wsmouse_accessops hilms_accessops = {
-	hilms_enable,
-	hilms_ioctl,
-	hilms_disable,
+	.enable  = hilms_enable,
+	.ioctl   = hilms_ioctl,
+	.disable = hilms_disable,
 };
 
 static void	hilms_callback(struct hildev_softc *, u_int, uint8_t *);



CVS commit: src/sys/dev/hil

2021-09-18 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sun Sep 19 04:55:58 UTC 2021

Modified Files:
src/sys/dev/hil: hilkbd.c hilms.c

Log Message:
Use C99 designated initializer for wscons ops.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/hil/hilkbd.c
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/hil/hilms.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/hppa/dev

2021-09-18 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Sat Sep 18 23:54:13 UTC 2021

Modified Files:
src/sys/arch/hppa/dev: dino.c

Log Message:
explain why we skip over dev 1f func 7 in config space access functions
no functional change


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/hppa/dev/dino.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/hppa/dev/dino.c
diff -u src/sys/arch/hppa/dev/dino.c:1.12 src/sys/arch/hppa/dev/dino.c:1.13
--- src/sys/arch/hppa/dev/dino.c:1.12	Sat Aug  7 16:18:55 2021
+++ src/sys/arch/hppa/dev/dino.c	Sat Sep 18 23:54:13 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: dino.c,v 1.12 2021/08/07 16:18:55 thorpej Exp $ */
+/*	$NetBSD: dino.c,v 1.13 2021/09/18 23:54:13 macallan Exp $ */
 
 /*	$OpenBSD: dino.c,v 1.5 2004/02/13 20:39:31 mickey Exp $	*/
 
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: dino.c,v 1.12 2021/08/07 16:18:55 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dino.c,v 1.13 2021/09/18 23:54:13 macallan Exp $");
 
 /* #include "cardbus.h" */
 
@@ -347,8 +347,18 @@ dino_conf_read(void *v, pcitag_t tag, in
 
 	/*
 	 * XXX
-	 * accessing dev 1f / func 7 on the 2nd Dino causes a machine check
-	 * exception on my C200
+	 * thus sayeth the Dino manual:
+	 * 7.7.1 Generating PCI Special Cycles thru PA I/O Space
+	 * When the PCI_CONFIG_ADDR registers BUS_NUM is the equal to the
+	 * DINO’s bus number, 8’h00, DEV_NUM and Function fields are all ones,
+	 * and the REG_NUM field is all zeros the next write to PCI_CONFIG_DATA
+	 * register will generate a special cycle on DINO’s PCI bus. If the
+	 * BUS_NUM field does not equal DINO bus number then a type 1
+	 * transaction will be forwarded to PCI as described above.
+	 * Note: Dino is using a legal PCI configuration address to generate a
+	 * PCI special cycle. System firmware and software should not attempt
+	 * to read or write to this configuration address when walking the
+	 * PCI bus through configuration address space.
 	 */
 	if ((tag & 0xff00) == 0xff00)
 		return -1;
@@ -377,9 +387,7 @@ dino_conf_write(void *v, pcitag_t tag, i
 		return;
 
 	/*
-	 * XXX
-	 * accessing dev 1f / func 7 on the 2nd Dino causes a machine check
-	 * exception on my C200
+	 * don't try to access dev 1f / func 7, see comment in dino_conf_read()
 	 */
 	if ((tag & 0xff00) == 0xff00) return;
 
@@ -1644,7 +1652,7 @@ dinoattach(device_t parent, device_t sel
 		return;
 	}
 
-	sc->sc_regs = r = (volatile struct dino_regs *)sc->sc_bh;
+	sc->sc_regs = r = (volatile struct dino_regs *)sc->sc_bh;	
 #ifdef trust_the_firmware_to_proper_initialize_everything
 	r->io_addr_en = 0;
 	r->io_control = 0x80;
@@ -1652,7 +1660,7 @@ dinoattach(device_t parent, device_t sel
 	r->papr = 0;
 	r->io_fbb_en |= 1;
 	r->damode = 0;
-	r->gmask &= ~1;	/* allow GSC bus req */
+	r->gmask &= ~1; /* allow GSC bus req */
 	r->pciror = 0;
 	r->pciwor = 0;
 	r->brdg_feat = 0xc000;



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

2021-09-18 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Sat Sep 18 23:54:13 UTC 2021

Modified Files:
src/sys/arch/hppa/dev: dino.c

Log Message:
explain why we skip over dev 1f func 7 in config space access functions
no functional change


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/hppa/dev/dino.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/sh3/sh3

2021-09-18 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Sat Sep 18 21:34:57 UTC 2021

Modified Files:
src/sys/arch/sh3/sh3: cpu_in_cksum.S

Log Message:
Fix trailing backslashes in a macro that got misaligned.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/sh3/sh3/cpu_in_cksum.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/sh3/sh3/cpu_in_cksum.S
diff -u src/sys/arch/sh3/sh3/cpu_in_cksum.S:1.10 src/sys/arch/sh3/sh3/cpu_in_cksum.S:1.11
--- src/sys/arch/sh3/sh3/cpu_in_cksum.S:1.10	Sat Sep 18 19:21:39 2021
+++ src/sys/arch/sh3/sh3/cpu_in_cksum.S	Sat Sep 18 21:34:56 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu_in_cksum.S,v 1.10 2021/09/18 19:21:39 uwe Exp $	*/
+/*	$NetBSD: cpu_in_cksum.S,v 1.11 2021/09/18 21:34:56 uwe Exp $	*/
 
 /*-
  * Copyright (c) 2000 SHIMIZU Ryo 
@@ -34,7 +34,7 @@
 #include 
 #include "assym.h"
 
-__KERNEL_RCSID(0, "$NetBSD: cpu_in_cksum.S,v 1.10 2021/09/18 19:21:39 uwe Exp $")
+__KERNEL_RCSID(0, "$NetBSD: cpu_in_cksum.S,v 1.11 2021/09/18 21:34:56 uwe Exp $")
 
 
 #define	reg_byte_swapped	r1
@@ -58,9 +58,9 @@ __KERNEL_RCSID(0, "$NetBSD: cpu_in_cksum
 
 #if _BYTE_ORDER == BIG_ENDIAN
 #define	ADDB	\
-	mov.b	@reg_w+, r0		; \
-	ROL; \
-	extu.b	r0, r0	; \
+	mov.b	@reg_w+, r0	; \
+	ROL			; \
+	extu.b	r0, r0		; \
 	add	r0, reg_sum	; \
 	not	reg_byte_swapped, reg_byte_swapped
 #else



CVS commit: src/sys/arch/sh3/sh3

2021-09-18 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Sat Sep 18 21:34:57 UTC 2021

Modified Files:
src/sys/arch/sh3/sh3: cpu_in_cksum.S

Log Message:
Fix trailing backslashes in a macro that got misaligned.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/sh3/sh3/cpu_in_cksum.S

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



CVS commit: src/external/gpl3/gcc/dist/gcc/config/aarch64

2021-09-18 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Sep 18 19:59:11 UTC 2021

Modified Files:
src/external/gpl3/gcc/dist/gcc/config/aarch64: aarch64.h

Log Message:
oops, re-enable host_detect_local_cpu for NetBSD


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 \
src/external/gpl3/gcc/dist/gcc/config/aarch64/aarch64.h

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



CVS commit: src/external/gpl3/gcc/dist/gcc/config/aarch64

2021-09-18 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Sep 18 19:59:11 UTC 2021

Modified Files:
src/external/gpl3/gcc/dist/gcc/config/aarch64: aarch64.h

Log Message:
oops, re-enable host_detect_local_cpu for NetBSD


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 \
src/external/gpl3/gcc/dist/gcc/config/aarch64/aarch64.h

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

Modified files:

Index: src/external/gpl3/gcc/dist/gcc/config/aarch64/aarch64.h
diff -u src/external/gpl3/gcc/dist/gcc/config/aarch64/aarch64.h:1.2 src/external/gpl3/gcc/dist/gcc/config/aarch64/aarch64.h:1.3
--- src/external/gpl3/gcc/dist/gcc/config/aarch64/aarch64.h:1.2	Sat Sep 18 10:45:11 2021
+++ src/external/gpl3/gcc/dist/gcc/config/aarch64/aarch64.h	Sat Sep 18 19:59:11 2021
@@ -1200,7 +1200,7 @@ extern const char *aarch64_rewrite_mcpu 
 #define MCPU_TO_MARCH_SPEC_FUNCTIONS \
   { "rewrite_mcpu", aarch64_rewrite_mcpu },
 
-#if defined(__aarch64__) && defined(__linux__)
+#if defined(__aarch64__) && (defined(__linux__) || defined(__NetBSD__))
 extern const char *host_detect_local_cpu (int argc, const char **argv);
 #define HAVE_LOCAL_CPU_DETECT
 # define EXTRA_SPEC_FUNCTIONS		\



CVS commit: src/sys/arch/sh3/sh3

2021-09-18 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Sat Sep 18 19:21:39 UTC 2021

Modified Files:
src/sys/arch/sh3/sh3: cpu_in_cksum.S

Log Message:
Fix one comment edit missed in previous.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/sh3/sh3/cpu_in_cksum.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/sh3/sh3/cpu_in_cksum.S
diff -u src/sys/arch/sh3/sh3/cpu_in_cksum.S:1.9 src/sys/arch/sh3/sh3/cpu_in_cksum.S:1.10
--- src/sys/arch/sh3/sh3/cpu_in_cksum.S:1.9	Sat Sep 18 15:09:05 2021
+++ src/sys/arch/sh3/sh3/cpu_in_cksum.S	Sat Sep 18 19:21:39 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu_in_cksum.S,v 1.9 2021/09/18 15:09:05 uwe Exp $	*/
+/*	$NetBSD: cpu_in_cksum.S,v 1.10 2021/09/18 19:21:39 uwe Exp $	*/
 
 /*-
  * Copyright (c) 2000 SHIMIZU Ryo 
@@ -34,7 +34,7 @@
 #include 
 #include "assym.h"
 
-__KERNEL_RCSID(0, "$NetBSD: cpu_in_cksum.S,v 1.9 2021/09/18 15:09:05 uwe Exp $")
+__KERNEL_RCSID(0, "$NetBSD: cpu_in_cksum.S,v 1.10 2021/09/18 19:21:39 uwe Exp $")
 
 
 #define	reg_byte_swapped	r1
@@ -213,7 +213,7 @@ mbuf_loop_done:
 
 	tst	reg_byte_swapped, reg_byte_swapped
 	bt/s	1f
-	REDUCE		/* 1st instruction break only r0(r0) */
+	REDUCE		/* 1st instruction break only r0 */
 	ROL
 1:
 



CVS commit: src/sys/arch/sh3/sh3

2021-09-18 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Sat Sep 18 19:21:39 UTC 2021

Modified Files:
src/sys/arch/sh3/sh3: cpu_in_cksum.S

Log Message:
Fix one comment edit missed in previous.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/sh3/sh3/cpu_in_cksum.S

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



re: CVS commit: src/external/gpl3/gcc/dist/gcc/config

2021-09-18 Thread matthew green
"Jared D. McNeill" writes:
> Module Name:  src
> Committed By: jmcneill
> Date: Sat Sep 18 10:45:11 UTC 2021
>
> Modified Files:
>   src/external/gpl3/gcc/dist/gcc/config: host-darwin.c
>   src/external/gpl3/gcc/dist/gcc/config/aarch64: aarch64.h
>
> Log Message:
> Fix build on macOS 11.6 arm64 hosts.
>
>
> To generate a diff of this commit:
> cvs rdiff -u -r1.1.1.10 -r1.2 \
> src/external/gpl3/gcc/dist/gcc/config/host-darwin.c
> cvs rdiff -u -r1.1.1.13 -r1.2 \
> src/external/gpl3/gcc/dist/gcc/config/aarch64/aarch64.h

the 2nd change here likely broke netbsd, which also has
support for this.  it's probably fine to add || __NetBSD__
to this conditional since those are the only two ports
that support this feature.


.mrg.


CVS commit: src/share/man/man4

2021-09-18 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Sep 18 18:14:07 UTC 2021

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

Log Message:
Fix pasto.  WSKBDIO_*BELL ioctls take struct wskbd_bell_data.

Bump date.

XXX1: the wskbd(4) (and all otther wscons(4) related) man page should
  describe more details of all ioctls.
  (usage, args and return values including structures).
XXX2: the wsbell(4) man page has description about all WSKBDIO_*BELL ioctls
  and struct wskbd_bell_data, but maybe they should be moved into this
  wskbd(4) man page and wsbell(4) should be changed to xref wskbd(4).


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/share/man/man4/wskbd.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/wskbd.4
diff -u src/share/man/man4/wskbd.4:1.25 src/share/man/man4/wskbd.4:1.26
--- src/share/man/man4/wskbd.4:1.25	Tue May 11 14:51:34 2021
+++ src/share/man/man4/wskbd.4	Sat Sep 18 18:14:07 2021
@@ -1,4 +1,4 @@
-.\" $NetBSD: wskbd.4,v 1.25 2021/05/11 14:51:34 nia Exp $
+.\" $NetBSD: wskbd.4,v 1.26 2021/09/18 18:14:07 tsutsui Exp $
 .\"
 .\" Copyright (c) 1999
 .\" 	Matthias Drochner.  All rights reserved.
@@ -24,7 +24,7 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.Dd May 11, 2021
+.Dd September 18, 2021
 .Dt WSKBD 4
 .Os
 .Sh NAME
@@ -234,7 +234,7 @@ Get the keyboard type.
 Get the keyboard mode, 0 means translated through keyboard map, 1 means raw.
 .It Dv WSKBDIO_SETMODE
 Set the keyboard mode.
-.It Dv WSKBDIO_COMPLEXBELL , WSKBDIO_SETBELL , WSKBDIO_GETBELL , WSKBDIO_SETDEFAULTBELL , WSKBDIO_GETDEFAULTBELL Pq Vt "struct wsmouse_repeat"
+.It Dv WSKBDIO_COMPLEXBELL , WSKBDIO_SETBELL , WSKBDIO_GETBELL , WSKBDIO_SETDEFAULTBELL , WSKBDIO_GETDEFAULTBELL Pq Vt "struct wskbd_bell_data"
 Get and set keyboard bell settings.
 .It Dv WSKBDIO_SETKEYREPEAT , WSKBDIO_GETKEYREPEAT , WSKBDIO_SETDEFAULTKEYREPEAT , WSKBDIO_GETDEFAULTKEYREPEAT Pq Vt "struct wskbd_keyrepeat_data"
 Get and set keyboard autorepeat settings.



CVS commit: src/share/man/man4

2021-09-18 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Sep 18 18:14:07 UTC 2021

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

Log Message:
Fix pasto.  WSKBDIO_*BELL ioctls take struct wskbd_bell_data.

Bump date.

XXX1: the wskbd(4) (and all otther wscons(4) related) man page should
  describe more details of all ioctls.
  (usage, args and return values including structures).
XXX2: the wsbell(4) man page has description about all WSKBDIO_*BELL ioctls
  and struct wskbd_bell_data, but maybe they should be moved into this
  wskbd(4) man page and wsbell(4) should be changed to xref wskbd(4).


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/share/man/man4/wskbd.4

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



CVS commit: src/share/man/man9

2021-09-18 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Sep 18 18:01:18 UTC 2021

Modified Files:
src/share/man/man9: timecounter.9

Log Message:
Update description of struct timecounter (u_int64_t -> uint64_t).

It has been changed since src/sys/sys/timetc.h rev 1.8.
Bump date.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/share/man/man9/timecounter.9

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/man9/timecounter.9
diff -u src/share/man/man9/timecounter.9:1.10 src/share/man/man9/timecounter.9:1.11
--- src/share/man/man9/timecounter.9:1.10	Thu Aug 27 14:14:00 2020
+++ src/share/man/man9/timecounter.9	Sat Sep 18 18:01:18 2021
@@ -1,4 +1,4 @@
-.\"	$NetBSD: timecounter.9,v 1.10 2020/08/27 14:14:00 fcambus Exp $
+.\"	$NetBSD: timecounter.9,v 1.11 2021/09/18 18:01:18 tsutsui Exp $
 .\"	$OpenBSD: tc_init.9,v 1.4 2007/05/31 19:20:01 jmc Exp $
 .\"
 .\" Copyright (c) 2004 Alexander Yurchenko 
@@ -37,7 +37,7 @@
 .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd June 8, 2010
+.Dd September 18, 2021
 .Dt TIMECOUNTER 9
 .Os
 .Sh NAME
@@ -74,7 +74,7 @@ struct timecounter {
 	timecounter_get_t	*tc_get_timecount;
 	timecounter_pps_t	*tc_poll_pps;
 	u_int 			tc_counter_mask;
-	u_int64_t		tc_frequency;
+	uint64_t		tc_frequency;
 	const char		*tc_name;
 	int			tc_quality;
 	void			*tc_priv;



CVS commit: src/share/man/man9

2021-09-18 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Sep 18 18:01:18 UTC 2021

Modified Files:
src/share/man/man9: timecounter.9

Log Message:
Update description of struct timecounter (u_int64_t -> uint64_t).

It has been changed since src/sys/sys/timetc.h rev 1.8.
Bump date.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/share/man/man9/timecounter.9

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



CVS commit: src/sys

2021-09-18 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Sep 18 15:14:41 UTC 2021

Modified Files:
src/sys/arch/dreamcast/dev/maple: mkbd.c
src/sys/arch/ews4800mips/dev: ewskbd.c
src/sys/arch/ews4800mips/sbd: kbms_sbdio.c
src/sys/arch/mac68k/dev: akbd.c
src/sys/arch/sgimips/dev: zs_kbd.c
src/sys/dev/hpc: hpcfb.c

Log Message:
Remove unnecessary (and unimplemented) WSKBD_*BELL ioctls in kbd drivers.

It looks the only ioctl(4) to be implemented for WSKBDIO_*BELL in
the backend keyboard driver is WSKBDIO_COMPLEXBELL.
All other BELL ioctls (WSKBDIO_BELL, WSKBDIO_SETBELL, WSKBDIO_GETBELL,
WSKBDIO_SETDEFAULTBELL, and WSKBDIO_GETDEFAULTBELL) are handled in the
MI wskbd driver (in wskbd_displayioctl() in src/sys/dev/wscons/wskbd.c).


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/arch/dreamcast/dev/maple/mkbd.c
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/ews4800mips/dev/ewskbd.c
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/ews4800mips/sbd/kbms_sbdio.c
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/mac68k/dev/akbd.c
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/sgimips/dev/zs_kbd.c
cvs rdiff -u -r1.63 -r1.64 src/sys/dev/hpc/hpcfb.c

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



CVS commit: src/sys

2021-09-18 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Sep 18 15:14:41 UTC 2021

Modified Files:
src/sys/arch/dreamcast/dev/maple: mkbd.c
src/sys/arch/ews4800mips/dev: ewskbd.c
src/sys/arch/ews4800mips/sbd: kbms_sbdio.c
src/sys/arch/mac68k/dev: akbd.c
src/sys/arch/sgimips/dev: zs_kbd.c
src/sys/dev/hpc: hpcfb.c

Log Message:
Remove unnecessary (and unimplemented) WSKBD_*BELL ioctls in kbd drivers.

It looks the only ioctl(4) to be implemented for WSKBDIO_*BELL in
the backend keyboard driver is WSKBDIO_COMPLEXBELL.
All other BELL ioctls (WSKBDIO_BELL, WSKBDIO_SETBELL, WSKBDIO_GETBELL,
WSKBDIO_SETDEFAULTBELL, and WSKBDIO_GETDEFAULTBELL) are handled in the
MI wskbd driver (in wskbd_displayioctl() in src/sys/dev/wscons/wskbd.c).


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/arch/dreamcast/dev/maple/mkbd.c
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/ews4800mips/dev/ewskbd.c
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/ews4800mips/sbd/kbms_sbdio.c
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/mac68k/dev/akbd.c
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/sgimips/dev/zs_kbd.c
cvs rdiff -u -r1.63 -r1.64 src/sys/dev/hpc/hpcfb.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/dreamcast/dev/maple/mkbd.c
diff -u src/sys/arch/dreamcast/dev/maple/mkbd.c:1.31 src/sys/arch/dreamcast/dev/maple/mkbd.c:1.32
--- src/sys/arch/dreamcast/dev/maple/mkbd.c:1.31	Sat Aug  7 16:18:48 2021
+++ src/sys/arch/dreamcast/dev/maple/mkbd.c	Sat Sep 18 15:14:40 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: mkbd.c,v 1.31 2021/08/07 16:18:48 thorpej Exp $	*/
+/*	$NetBSD: mkbd.c,v 1.32 2021/09/18 15:14:40 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 2001 Marcus Comstedt
@@ -33,7 +33,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: mkbd.c,v 1.31 2021/08/07 16:18:48 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mkbd.c,v 1.32 2021/09/18 15:14:40 tsutsui Exp $");
 
 #include 
 #include 
@@ -216,7 +216,6 @@ mkbd_ioctl(void *v, u_long cmd, void *da
 	case WSKBDIO_GETLEDS:
 		*(int *) data = 0;
 		return 0;
-	case WSKBDIO_BELL:
 	case WSKBDIO_COMPLEXBELL:
 		return 0;
 	}

Index: src/sys/arch/ews4800mips/dev/ewskbd.c
diff -u src/sys/arch/ews4800mips/dev/ewskbd.c:1.13 src/sys/arch/ews4800mips/dev/ewskbd.c:1.14
--- src/sys/arch/ews4800mips/dev/ewskbd.c:1.13	Sat Aug  7 16:18:53 2021
+++ src/sys/arch/ews4800mips/dev/ewskbd.c	Sat Sep 18 15:14:40 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: ewskbd.c,v 1.13 2021/08/07 16:18:53 thorpej Exp $	*/
+/*	$NetBSD: ewskbd.c,v 1.14 2021/09/18 15:14:40 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 2005 Izumi Tsutsui.  All rights reserved.
@@ -59,7 +59,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ewskbd.c,v 1.13 2021/08/07 16:18:53 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ewskbd.c,v 1.14 2021/09/18 15:14:40 tsutsui Exp $");
 
 #include 
 #include 
@@ -494,12 +494,7 @@ ewskbd_wskbd_ioctl(void *cookie, u_long 
 		break;
 
 #ifdef notyet
-	case WSKBDIO_BELL:
 	case WSKBDIO_COMPLEXBELL:
-	case WSKBDIO_SETBELL:
-	case WSKBDIO_GETBELL:
-	case WSKBDIO_SETDEFAULTBELL:
-	case WSKBDIO_GETDEFAULTBELL:
 	case WSKBDIO_SETKEYREPEAT:
 	case WSKBDIO_GETKEYREPEAT:
 	case WSKBDIO_SETDEFAULTKEYREPEAT:

Index: src/sys/arch/ews4800mips/sbd/kbms_sbdio.c
diff -u src/sys/arch/ews4800mips/sbd/kbms_sbdio.c:1.13 src/sys/arch/ews4800mips/sbd/kbms_sbdio.c:1.14
--- src/sys/arch/ews4800mips/sbd/kbms_sbdio.c:1.13	Sat Aug  7 16:18:53 2021
+++ src/sys/arch/ews4800mips/sbd/kbms_sbdio.c	Sat Sep 18 15:14:40 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: kbms_sbdio.c,v 1.13 2021/08/07 16:18:53 thorpej Exp $	*/
+/*	$NetBSD: kbms_sbdio.c,v 1.14 2021/09/18 15:14:40 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 2004, 2005 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kbms_sbdio.c,v 1.13 2021/08/07 16:18:53 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kbms_sbdio.c,v 1.14 2021/09/18 15:14:40 tsutsui Exp $");
 
 #include 
 #include 
@@ -408,7 +408,6 @@ kbd_ioctl(void *arg, u_long cmd, void *d
 	case WSKBDIO_GETLEDS:
 		*(int *)data = sc->sc_leds;
 		return 0;
-	case WSKBDIO_BELL:
 	case WSKBDIO_COMPLEXBELL:
 		return 0;
 	}

Index: src/sys/arch/mac68k/dev/akbd.c
diff -u src/sys/arch/mac68k/dev/akbd.c:1.26 src/sys/arch/mac68k/dev/akbd.c:1.27
--- src/sys/arch/mac68k/dev/akbd.c:1.26	Sat Aug  7 16:18:57 2021
+++ src/sys/arch/mac68k/dev/akbd.c	Sat Sep 18 15:14:40 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: akbd.c,v 1.26 2021/08/07 16:18:57 thorpej Exp $	*/
+/*	$NetBSD: akbd.c,v 1.27 2021/09/18 15:14:40 tsutsui Exp $	*/
 
 /*
  * Copyright (C) 1998	Colin Wood
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: akbd.c,v 1.26 2021/08/07 16:18:57 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: akbd.c,v 1.27 2021/09/18 15:14:40 tsutsui Exp $");
 
 #include "opt_adb.h"
 
@@ -471,7 +471,6 @@ akbd_ioctl(void *v, u_long cmd, void *da
 	case WSKBDIO_GETLEDS:
 		*(int *)data = 0;
 		return 0;
-	case 

CVS commit: src/sys/arch/sh3/sh3

2021-09-18 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Sat Sep 18 15:09:05 UTC 2021

Modified Files:
src/sys/arch/sh3/sh3: cpu_in_cksum.S

Log Message:
Do not obfuscate r0 as "reg_tmp0".

Using r0 as a temp is a common choice.  Some instructions _must_ use
r0 as the destination (like mova or instructions with immediates).
ABI uses r0 as the return register.  So a helpful name is not that
helpful for the former use case (temp) and is confusing for the latter
two (ISA or ABI constraints).  Same object code is generated.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/sh3/sh3/cpu_in_cksum.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/sh3/sh3/cpu_in_cksum.S
diff -u src/sys/arch/sh3/sh3/cpu_in_cksum.S:1.8 src/sys/arch/sh3/sh3/cpu_in_cksum.S:1.9
--- src/sys/arch/sh3/sh3/cpu_in_cksum.S:1.8	Sat Sep 18 14:57:10 2021
+++ src/sys/arch/sh3/sh3/cpu_in_cksum.S	Sat Sep 18 15:09:05 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu_in_cksum.S,v 1.8 2021/09/18 14:57:10 uwe Exp $	*/
+/*	$NetBSD: cpu_in_cksum.S,v 1.9 2021/09/18 15:09:05 uwe Exp $	*/
 
 /*-
  * Copyright (c) 2000 SHIMIZU Ryo 
@@ -34,10 +34,9 @@
 #include 
 #include "assym.h"
 
-__KERNEL_RCSID(0, "$NetBSD: cpu_in_cksum.S,v 1.8 2021/09/18 14:57:10 uwe Exp $")
+__KERNEL_RCSID(0, "$NetBSD: cpu_in_cksum.S,v 1.9 2021/09/18 15:09:05 uwe Exp $")
 
 
-#define	reg_tmp0		r0
 #define	reg_byte_swapped	r1
 #define	reg_mlen		r2
 #define	reg_tmp3		r3
@@ -49,39 +48,39 @@ __KERNEL_RCSID(0, "$NetBSD: cpu_in_cksum
 
 
 #define	REDUCE	\
-	swap.w	reg_sum, reg_tmp0	; \
+	swap.w	reg_sum, r0		; \
 	extu.w	reg_sum, reg_sum	; \
-	extu.w	reg_tmp0, reg_tmp0	; \
-	add	reg_tmp0, reg_sum
+	extu.w	r0, r0			; \
+	add	r0, reg_sum
 
 #define	ROL	\
 	shll8	reg_sum
 
 #if _BYTE_ORDER == BIG_ENDIAN
 #define	ADDB	\
-	mov.b	@reg_w+, reg_tmp0	; \
+	mov.b	@reg_w+, r0		; \
 	ROL; \
-	extu.b	reg_tmp0, reg_tmp0	; \
-	add	reg_tmp0, reg_sum	; \
+	extu.b	r0, r0	; \
+	add	r0, reg_sum	; \
 	not	reg_byte_swapped, reg_byte_swapped
 #else
 #define	ADDB	\
-	mov.b	@reg_w+, reg_tmp0	; \
-	extu.b	reg_tmp0, reg_tmp0	; \
-	add	reg_tmp0, reg_sum	; \
-	ROL; \
+	mov.b	@reg_w+, r0	; \
+	extu.b	r0, r0		; \
+	add	r0, reg_sum	; \
+	ROL			; \
 	not	reg_byte_swapped, reg_byte_swapped
 #endif
 
 
 #define	ADDS	\
-	mov.w	@reg_w+, reg_tmp0	; \
-	extu.w	reg_tmp0, reg_tmp0	; \
-	add	reg_tmp0, reg_sum
+	mov.w	@reg_w+, r0	; \
+	extu.w	r0, r0		; \
+	add	r0, reg_sum
 
 #define	ADDCL	\
-	mov.l	@reg_w+, reg_tmp0	; \
-	addc	reg_tmp0, reg_sum
+	mov.l	@reg_w+, r0	; \
+	addc	r0, reg_sum
 
 #define	FORWARD1	\
 	add	#-1, reg_mlen
@@ -149,38 +148,38 @@ mbuf_loop:
 	sub	reg_mlen, reg_len
 
 
-	mov	reg_w, reg_tmp0
-	tst	#1, reg_tmp0
+	mov	reg_w, r0
+	tst	#1, r0
 	bt/s	1f
-	REDUCE		/* 1st instruction break only reg_tmp0(r0) */
+	REDUCE		/* 1st instruction break only r0 */
 	ADDB
 	FORWARD1
 1:
 
 
-	mov	#1, reg_tmp0
-	cmp/gt	reg_tmp0, reg_mlen
+	mov	#1, r0
+	cmp/gt	r0, reg_mlen
 	bf/s	1f
-	mov	reg_w, reg_tmp0
-	tst	#2, reg_tmp0
+	mov	reg_w, r0
+	tst	#2, r0
 	bt/s	1f
-	REDUCE		/* 1st instruction break only reg_tmp0(r0) */
+	REDUCE		/* 1st instruction break only r0 */
 	ADDS
 	FORWARD2
 1:
 
 
 
-	mov	#127, reg_tmp0
-	cmp/hi	reg_tmp0, reg_mlen
+	mov	#127, r0
+	cmp/hi	r0, reg_mlen
 	bf	1f
 
 do_cksum128:
 	bsr	cksum128
 	 nop
 
-	mov	#127, reg_tmp0
-	cmp/hi	reg_tmp0, reg_mlen
+	mov	#127, r0
+	cmp/hi	r0, reg_mlen
 	bt	do_cksum128
 1:
 
@@ -190,8 +189,8 @@ do_cksum128:
 
 	REDUCE
 
-	mov	#1, reg_tmp0
-	cmp/gt	reg_tmp0, reg_mlen
+	mov	#1, r0
+	cmp/gt	r0, reg_mlen
 	bf	1f
 	ADDS
 	FORWARD2
@@ -214,7 +213,7 @@ mbuf_loop_done:
 
 	tst	reg_byte_swapped, reg_byte_swapped
 	bt/s	1f
-	REDUCE		/* 1st instruction break only reg_tmp0(r0) */
+	REDUCE		/* 1st instruction break only r0(r0) */
 	ROL
 1:
 
@@ -230,13 +229,13 @@ in_cksum_return:
 
 
 out_of_mbufs:
-	mova	.L_message_out_of_data, reg_tmp0
+	mova	.L_message_out_of_data, r0
 	mov.l	.L_printf, reg_tmp3
 
 	mov.l	reg_sum, @-sp	/* save: call clobbered register */
 
 1:	CALL	reg_tmp3
-	 mov	reg_tmp0, r4
+	 mov	r0, r4
 
 	bra	in_cksum_return
 	 mov.l	@sp+, reg_sum	/* restore */
@@ -256,14 +255,14 @@ out_of_mbufs:
 
 	.align	2
 cksum128mod:
-	mov	reg_mlen, reg_tmp0
-	and	#124, reg_tmp0
-	sub	reg_tmp0, reg_mlen
-	mov	reg_tmp0, reg_tmp3
-
-	mova	cksum128_tail, reg_tmp0
-	sub	reg_tmp3, reg_tmp0
-	jmp	@reg_tmp0
+	mov	reg_mlen, r0
+	and	#124, r0
+	sub	r0, reg_mlen
+	mov	r0, reg_tmp3
+
+	mova	cksum128_tail, r0
+	sub	reg_tmp3, r0
+	jmp	@r0
 	 clrt
 
 	.align	2
@@ -305,6 +304,6 @@ cksum128_unroll:
 	ADDCL
 	ADDCL
 cksum128_tail:
-	mov	#0, reg_tmp0
+	mov	#0, r0
 	rts
-	 addc	reg_tmp0, reg_sum
+	 addc	r0, reg_sum



CVS commit: src/sys/arch/sh3/sh3

2021-09-18 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Sat Sep 18 15:09:05 UTC 2021

Modified Files:
src/sys/arch/sh3/sh3: cpu_in_cksum.S

Log Message:
Do not obfuscate r0 as "reg_tmp0".

Using r0 as a temp is a common choice.  Some instructions _must_ use
r0 as the destination (like mova or instructions with immediates).
ABI uses r0 as the return register.  So a helpful name is not that
helpful for the former use case (temp) and is confusing for the latter
two (ISA or ABI constraints).  Same object code is generated.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/sh3/sh3/cpu_in_cksum.S

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



CVS commit: src/sys/arch/sh3/sh3

2021-09-18 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Sat Sep 18 14:57:10 UTC 2021

Modified Files:
src/sys/arch/sh3/sh3: cpu_in_cksum.S

Log Message:
Space after comma in operands.  Same object code is generated.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/sh3/sh3/cpu_in_cksum.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/sh3/sh3/cpu_in_cksum.S
diff -u src/sys/arch/sh3/sh3/cpu_in_cksum.S:1.7 src/sys/arch/sh3/sh3/cpu_in_cksum.S:1.8
--- src/sys/arch/sh3/sh3/cpu_in_cksum.S:1.7	Sat Sep 18 06:32:41 2021
+++ src/sys/arch/sh3/sh3/cpu_in_cksum.S	Sat Sep 18 14:57:10 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu_in_cksum.S,v 1.7 2021/09/18 06:32:41 rin Exp $	*/
+/*	$NetBSD: cpu_in_cksum.S,v 1.8 2021/09/18 14:57:10 uwe Exp $	*/
 
 /*-
  * Copyright (c) 2000 SHIMIZU Ryo 
@@ -34,7 +34,7 @@
 #include 
 #include "assym.h"
 
-__KERNEL_RCSID(0, "$NetBSD: cpu_in_cksum.S,v 1.7 2021/09/18 06:32:41 rin Exp $")
+__KERNEL_RCSID(0, "$NetBSD: cpu_in_cksum.S,v 1.8 2021/09/18 14:57:10 uwe Exp $")
 
 
 #define	reg_tmp0		r0
@@ -49,45 +49,45 @@ __KERNEL_RCSID(0, "$NetBSD: cpu_in_cksum
 
 
 #define	REDUCE	\
-	swap.w	reg_sum,reg_tmp0	; \
-	extu.w	reg_sum,reg_sum		; \
-	extu.w	reg_tmp0,reg_tmp0	; \
-	add	reg_tmp0,reg_sum
+	swap.w	reg_sum, reg_tmp0	; \
+	extu.w	reg_sum, reg_sum	; \
+	extu.w	reg_tmp0, reg_tmp0	; \
+	add	reg_tmp0, reg_sum
 
 #define	ROL	\
 	shll8	reg_sum
 
 #if _BYTE_ORDER == BIG_ENDIAN
 #define	ADDB	\
-	mov.b	@reg_w+,reg_tmp0	; \
+	mov.b	@reg_w+, reg_tmp0	; \
 	ROL; \
-	extu.b	reg_tmp0,reg_tmp0	; \
-	add	reg_tmp0,reg_sum	; \
-	not	reg_byte_swapped,reg_byte_swapped
+	extu.b	reg_tmp0, reg_tmp0	; \
+	add	reg_tmp0, reg_sum	; \
+	not	reg_byte_swapped, reg_byte_swapped
 #else
 #define	ADDB	\
-	mov.b	@reg_w+,reg_tmp0	; \
-	extu.b	reg_tmp0,reg_tmp0	; \
-	add	reg_tmp0,reg_sum	; \
+	mov.b	@reg_w+, reg_tmp0	; \
+	extu.b	reg_tmp0, reg_tmp0	; \
+	add	reg_tmp0, reg_sum	; \
 	ROL; \
-	not	reg_byte_swapped,reg_byte_swapped
+	not	reg_byte_swapped, reg_byte_swapped
 #endif
 
 
 #define	ADDS	\
-	mov.w	@reg_w+,reg_tmp0	; \
-	extu.w	reg_tmp0,reg_tmp0	; \
-	add	reg_tmp0,reg_sum
+	mov.w	@reg_w+, reg_tmp0	; \
+	extu.w	reg_tmp0, reg_tmp0	; \
+	add	reg_tmp0, reg_sum
 
 #define	ADDCL	\
-	mov.l	@reg_w+,reg_tmp0	; \
-	addc	reg_tmp0,reg_sum
+	mov.l	@reg_w+, reg_tmp0	; \
+	addc	reg_tmp0, reg_sum
 
 #define	FORWARD1	\
-	add	#-1,reg_mlen
+	add	#-1, reg_mlen
 
 #define	FORWARD2	\
-	add	#-2,reg_mlen
+	add	#-2, reg_mlen
 
 
 /*
@@ -97,7 +97,7 @@ __KERNEL_RCSID(0, "$NetBSD: cpu_in_cksum
  * LINTSTUB: Func: int cpu_in_cksum(struct mbuf *m, int len, int off, uint32_t initial_sum);
  */
 ENTRY(cpu_in_cksum)
-	sts.l	pr,@-sp
+	sts.l	pr, @-sp
 	PIC_PROLOGUE(.L_got)
 
 	tst	reg_len, reg_len
@@ -128,13 +128,13 @@ ENTRY(cpu_in_cksum)
 
 
 mbuf_loop:
-	tst	reg_m,reg_m
+	tst	reg_m, reg_m
 	bt	out_of_mbufs
 
-	mov.l	@(M_LEN,reg_m),reg_mlen
-	tst	reg_mlen,reg_mlen
+	mov.l	@(M_LEN, reg_m), reg_mlen
+	tst	reg_mlen, reg_mlen
 	bt/s	mbuf_loop_continue
-	mov.l	@(M_DATA,reg_m),reg_w
+	mov.l	@(M_DATA, reg_m), reg_w
 
 
 	!! Entry point for mbuf loop.  We jump here after we have
@@ -142,15 +142,15 @@ mbuf_loop:
 	!! offset.  reg_mlen and reg_w were adjusted to point at the
 	!! first interesting byte of data.
 .L_mbuf_loop_enter:
-	cmp/ge	reg_mlen,reg_len
+	cmp/ge	reg_mlen, reg_len
 	bt	1f
-	mov	reg_len,reg_mlen
+	mov	reg_len, reg_mlen
 1:
-	sub	reg_mlen,reg_len
+	sub	reg_mlen, reg_len
 
 
-	mov	reg_w,reg_tmp0
-	tst	#1,reg_tmp0
+	mov	reg_w, reg_tmp0
+	tst	#1, reg_tmp0
 	bt/s	1f
 	REDUCE		/* 1st instruction break only reg_tmp0(r0) */
 	ADDB
@@ -158,11 +158,11 @@ mbuf_loop:
 1:
 
 
-	mov	#1,reg_tmp0
-	cmp/gt	reg_tmp0,reg_mlen
+	mov	#1, reg_tmp0
+	cmp/gt	reg_tmp0, reg_mlen
 	bf/s	1f
-	mov	reg_w,reg_tmp0
-	tst	#2,reg_tmp0
+	mov	reg_w, reg_tmp0
+	tst	#2, reg_tmp0
 	bt/s	1f
 	REDUCE		/* 1st instruction break only reg_tmp0(r0) */
 	ADDS
@@ -171,16 +171,16 @@ mbuf_loop:
 
 
 
-	mov	#127,reg_tmp0
-	cmp/hi	reg_tmp0,reg_mlen
+	mov	#127, reg_tmp0
+	cmp/hi	reg_tmp0, reg_mlen
 	bf	1f
 
 do_cksum128:
 	bsr	cksum128
 	 nop
 
-	mov	#127,reg_tmp0
-	cmp/hi	reg_tmp0,reg_mlen
+	mov	#127, reg_tmp0
+	cmp/hi	reg_tmp0, reg_mlen
 	bt	do_cksum128
 1:
 
@@ -190,29 +190,29 @@ do_cksum128:
 
 	REDUCE
 
-	mov	#1,reg_tmp0
-	cmp/gt	reg_tmp0,reg_mlen
+	mov	#1, reg_tmp0
+	cmp/gt	reg_tmp0, reg_mlen
 	bf	1f
 	ADDS
 	FORWARD2
 1:
 
-	mov	reg_mlen,r0
-	tst	#1,r0
+	mov	reg_mlen, r0
+	tst	#1, r0
 	bt	1f
 	ADDB
 1:
 
 
 mbuf_loop_continue:
-	mov.l	@(M_NEXT,reg_m),reg_m
+	mov.l	@(M_NEXT, reg_m), reg_m
 
-	tst	reg_len,reg_len
+	tst	reg_len, reg_len
 	bf/s	mbuf_loop
 mbuf_loop_done:
 
 
-	tst	reg_byte_swapped,reg_byte_swapped
+	tst	reg_byte_swapped, reg_byte_swapped
 	bt/s	1f
 	REDUCE		/* 1st instruction break only reg_tmp0(r0) */
 	ROL
@@ -222,24 +222,24 @@ mbuf_loop_done:
 	REDUCE
 
 in_cksum_return:
-	not	reg_sum,r0
+	not	reg_sum, r0
 	PIC_EPILOGUE
-	lds.l	@sp+,pr
+	lds.l	

CVS commit: src/sys/arch/sh3/sh3

2021-09-18 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Sat Sep 18 14:57:10 UTC 2021

Modified Files:
src/sys/arch/sh3/sh3: cpu_in_cksum.S

Log Message:
Space after comma in operands.  Same object code is generated.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/sh3/sh3/cpu_in_cksum.S

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



CVS commit: src/games/fortune/datfiles

2021-09-18 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Sat Sep 18 14:24:04 UTC 2021

Modified Files:
src/games/fortune/datfiles: fortunes-o.real

Log Message:
Ken Thompson on the i960.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/games/fortune/datfiles/fortunes-o.real

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

Modified files:

Index: src/games/fortune/datfiles/fortunes-o.real
diff -u src/games/fortune/datfiles/fortunes-o.real:1.13 src/games/fortune/datfiles/fortunes-o.real:1.14
--- src/games/fortune/datfiles/fortunes-o.real:1.13	Wed Dec 13 21:11:27 2017
+++ src/games/fortune/datfiles/fortunes-o.real	Sat Sep 18 14:24:04 2021
@@ -1733,3 +1733,6 @@ There is a road to freedom.  Its milesto
 Order, Cleanliness, Sobriety, Truthfulness, Sacrifice, and love of the
 Fatherland.
 -- Adolf Hitler
+%
+I just hate to be pushed around by some fucking machine.
+		-- Ken Thompson, on the i960



CVS commit: src/games/fortune/datfiles

2021-09-18 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Sat Sep 18 14:24:04 UTC 2021

Modified Files:
src/games/fortune/datfiles: fortunes-o.real

Log Message:
Ken Thompson on the i960.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/games/fortune/datfiles/fortunes-o.real

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



CVS commit: src/doc

2021-09-18 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Sep 18 13:46:25 UTC 2021

Modified Files:
src/doc: CHANGES

Log Message:
Mention about luna68k keyboard LED and buzzer command support for wskbd(4).


To generate a diff of this commit:
cvs rdiff -u -r1.2828 -r1.2829 src/doc/CHANGES

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



CVS commit: src/doc

2021-09-18 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Sep 18 13:46:25 UTC 2021

Modified Files:
src/doc: CHANGES

Log Message:
Mention about luna68k keyboard LED and buzzer command support for wskbd(4).


To generate a diff of this commit:
cvs rdiff -u -r1.2828 -r1.2829 src/doc/CHANGES

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

Modified files:

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.2828 src/doc/CHANGES:1.2829
--- src/doc/CHANGES:1.2828	Sat Sep 11 22:34:17 2021
+++ src/doc/CHANGES	Sat Sep 18 13:46:25 2021
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2828 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2829 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -418,3 +418,5 @@ Changes from NetBSD 9.0 to NetBSD 10.0:
 	OpenSSH: Import 8.7. [christos 20210902]
 	efiboot: Add support for specifying a banner in boot.cfg. [nia 20210907]
 	pxeboot: Add support for specifying a banner in boot.cfg. [nia 20210907]
+	luna68k: Add support for keyboard LED and buzzer controls via wskbd(4).
+		[tsutsui 20210918]



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

2021-09-18 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Sep 18 13:44:02 UTC 2021

Modified Files:
src/sys/arch/luna68k/dev: lunaws.c

Log Message:
Implement transmitting keyboard LED and buzzer control commands.

- enable TX on uPD7201 for keyboard port
- prepare TX queue and handle it in hardware interrupt and softint(9)
- send proper LED commands on WSKBDIO_SETLEDS
  (XXX: KANA LED is not handled in wscons)
- return current LED settings on WSKBDIO_GETLEDS
- implement WSKBDIO_COMPLEXBELL by parsing struct wskbd_bell_data and
  send proper buzzer commands
- handle pitch, period, and volume in cnbell(9)
  (XXX: no description in cnbell(9) man pages)
- use proper queued TX function for omms_enable() and omms_disable()
- add DPRINTF()s for debug
- use C99 designated initializer and misc cosmetics

Tested on LUNA and its keyboard (3W4SD-098NDT).


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sys/arch/luna68k/dev/lunaws.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/luna68k/dev/lunaws.c
diff -u src/sys/arch/luna68k/dev/lunaws.c:1.34 src/sys/arch/luna68k/dev/lunaws.c:1.35
--- src/sys/arch/luna68k/dev/lunaws.c:1.34	Sat Sep  4 18:38:03 2021
+++ src/sys/arch/luna68k/dev/lunaws.c	Sat Sep 18 13:44:02 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: lunaws.c,v 1.34 2021/09/04 18:38:03 tsutsui Exp $ */
+/* $NetBSD: lunaws.c,v 1.35 2021/09/18 13:44:02 tsutsui Exp $ */
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include 			/* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: lunaws.c,v 1.34 2021/09/04 18:38:03 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lunaws.c,v 1.35 2021/09/18 13:44:02 tsutsui Exp $");
 
 #include "opt_wsdisplay_compat.h"
 #include "wsmouse.h"
@@ -57,10 +57,43 @@ __KERNEL_RCSID(0, "$NetBSD: lunaws.c,v 1
 #define OMKBD_RXQ_LEN		64
 #define OMKBD_RXQ_LEN_MASK	(OMKBD_RXQ_LEN - 1)
 #define OMKBD_NEXTRXQ(x)	(((x) + 1) & OMKBD_RXQ_LEN_MASK)
+#define OMKBD_TXQ_LEN		16
+#define OMKBD_TXQ_LEN_MASK	(OMKBD_TXQ_LEN - 1)
+#define OMKBD_NEXTTXQ(x)	(((x) + 1) & OMKBD_TXQ_LEN_MASK)
+
+/* Keyboard commands */
+/*  000Xb : LED commands */
+#define OMKBD_LED_ON_KANA	0x10	/* kana LED on */
+#define OMKBD_LED_OFF_KANA	0x00	/* kana LED off */
+#define OMKBD_LED_ON_CAPS	0x11	/* caps LED on */
+#define OMKBD_LED_OFF_CAPS	0x01	/* caps LED off */
+/*  010Xb : buzzer commands */
+#define OMKBD_BUZZER		0x40
+#define OMKBD_BUZZER_PERIOD	0x18
+#define OMKBD_BUZZER_40MS	0x00
+#define OMKBD_BUZZER_150MS	0x08
+#define OMKBD_BUZZER_400MS	0x10
+#define OMKBD_BUZZER_700MS	0x18
+#define OMKBD_BUZZER_PITCH	0x07
+#define OMKBD_BUZZER_6000HZ	0x00
+#define OMKBD_BUZZER_3000HZ	0x01
+#define OMKBD_BUZZER_1500HZ	0x02
+#define OMKBD_BUZZER_1000HZ	0x03
+#define OMKBD_BUZZER_600HZ	0x04
+#define OMKBD_BUZZER_300HZ	0x05
+#define OMKBD_BUZZER_150HZ	0x06
+#define OMKBD_BUZZER_100HZ	0x07
+/*  011Xb : mouse on command */
+#define OMKBD_MOUSE_ON		0x60
+/*  001Xb : mouse off command */
+#define OMKBD_MOUSE_OFF		0x20
+
+#define OMKBD_BUZZER_DEFAULT	\
+	(OMKBD_BUZZER | OMKBD_BUZZER_40MS | OMKBD_BUZZER_1500HZ)
 
 static const uint8_t ch1_regs[6] = {
 	WR0_RSTINT,/* Reset E/S Interrupt */
-	WR1_RXALLS,/* Rx per char, No Tx */
+	WR1_RXALLS | WR1_TXENBL,		/* Rx per char, Tx */
 	0,	/* */
 	WR3_RX8BIT | WR3_RXENBL,		/* Rx */
 	WR4_BAUD96 | WR4_STOP1 | WR4_NPARITY,	/* Tx/Rx */
@@ -75,6 +108,12 @@ struct ws_softc {
 	uint8_t		sc_rxq[OMKBD_RXQ_LEN];
 	u_int		sc_rxqhead;
 	u_int		sc_rxqtail;
+	uint8_t		sc_txq[OMKBD_TXQ_LEN];
+	u_int		sc_txqhead;
+	u_int		sc_txqtail;
+	bool		sc_tx_busy;
+	bool		sc_tx_done;
+	int		sc_leds;
 #if NWSMOUSE > 0
 	device_t	sc_wsmousedev;
 	int		sc_msbuttons, sc_msdx, sc_msdy;
@@ -84,28 +123,36 @@ struct ws_softc {
 	int		sc_rawkbd;
 };
 
-static void omkbd_input(void *, int);
-static void omkbd_decode(void *, int, u_int *, int *);
+static void omkbd_input(struct ws_softc *, int);
+static void omkbd_send(struct ws_softc *, uint8_t);
+static void omkbd_decode(struct ws_softc *, int, u_int *, int *);
+
 static int  omkbd_enable(void *, int);
 static void omkbd_set_leds(void *, int);
 static int  omkbd_ioctl(void *, u_long, void *, int, struct lwp *);
 
+static void omkbd_complex_buzzer(struct ws_softc *, struct wskbd_bell_data *);
+static uint8_t omkbd_get_buzcmd(struct ws_softc *, struct wskbd_bell_data *,
+uint8_t);
+
 static const struct wskbd_mapdata omkbd_keymapdata = {
-	omkbd_keydesctab,
-	KB_JP,
+	.keydesc = omkbd_keydesctab,
+	.layout  = KB_JP,
 };
 static const struct wskbd_accessops omkbd_accessops = {
-	omkbd_enable,
-	omkbd_set_leds,
-	omkbd_ioctl,
+	.enable   = omkbd_enable,
+	.set_leds = omkbd_set_leds,
+	.ioctl= omkbd_ioctl,
 };
 
 void	ws_cnattach(void);
 static void ws_cngetc(void *, u_int *, int *);
 static void ws_cnpollc(void *, int);
+static void ws_cnbell(void *, u_int, u_int, u_int);
 static const struct 

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

2021-09-18 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Sep 18 13:44:02 UTC 2021

Modified Files:
src/sys/arch/luna68k/dev: lunaws.c

Log Message:
Implement transmitting keyboard LED and buzzer control commands.

- enable TX on uPD7201 for keyboard port
- prepare TX queue and handle it in hardware interrupt and softint(9)
- send proper LED commands on WSKBDIO_SETLEDS
  (XXX: KANA LED is not handled in wscons)
- return current LED settings on WSKBDIO_GETLEDS
- implement WSKBDIO_COMPLEXBELL by parsing struct wskbd_bell_data and
  send proper buzzer commands
- handle pitch, period, and volume in cnbell(9)
  (XXX: no description in cnbell(9) man pages)
- use proper queued TX function for omms_enable() and omms_disable()
- add DPRINTF()s for debug
- use C99 designated initializer and misc cosmetics

Tested on LUNA and its keyboard (3W4SD-098NDT).


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sys/arch/luna68k/dev/lunaws.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

2021-09-18 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Sep 18 12:25:07 UTC 2021

Modified Files:
src/sys/arch/aarch64/aarch64: genassym.cf vectors.S
src/sys/arch/aarch64/include: cpu.h
src/sys/arch/arm/cortex: gic_splfuncs.c
src/sys/arch/evbarm/conf: std.generic64

Log Message:
gic_splx: performance optimizations

Avoid any kind of register access (DAIF, PMR, etc), barriers, and atomic
operations in the common case where no interrupt fires between spl being
raised and lowered.

This introduces a per-CPU return address (ci_splx_restart) used by the
vector handler to restart a sequence in splx that compares the new ipl
with the per-CPU hardware priority state stored in ci_hwpl.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/arch/aarch64/aarch64/genassym.cf
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/aarch64/aarch64/vectors.S
cvs rdiff -u -r1.38 -r1.39 src/sys/arch/aarch64/include/cpu.h
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/cortex/gic_splfuncs.c
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/evbarm/conf/std.generic64

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/genassym.cf
diff -u src/sys/arch/aarch64/aarch64/genassym.cf:1.33 src/sys/arch/aarch64/aarch64/genassym.cf:1.34
--- src/sys/arch/aarch64/aarch64/genassym.cf:1.33	Fri Dec 11 18:03:33 2020
+++ src/sys/arch/aarch64/aarch64/genassym.cf	Sat Sep 18 12:25:06 2021
@@ -1,4 +1,4 @@
-# $NetBSD: genassym.cf,v 1.33 2020/12/11 18:03:33 skrll Exp $
+# $NetBSD: genassym.cf,v 1.34 2021/09/18 12:25:06 jmcneill Exp $
 #-
 # Copyright (c) 2014 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -296,6 +296,7 @@ define	CI_MTX_COUNT		offsetof(struct cpu
 define	CI_SOFTINTS		offsetof(struct cpu_info, ci_softints)
 define	CI_IDLELWP		offsetof(struct cpu_info, ci_data.cpu_idlelwp)
 define	CI_CC_NINTR		offsetof(struct cpu_info, ci_data.cpu_nintr)
+define	CI_SPLX_RESTART		offsetof(struct cpu_info, ci_splx_restart)
 
 define	V_RESCHED_KPREEMPT	ilog2(RESCHED_KPREEMPT)
 

Index: src/sys/arch/aarch64/aarch64/vectors.S
diff -u src/sys/arch/aarch64/aarch64/vectors.S:1.23 src/sys/arch/aarch64/aarch64/vectors.S:1.24
--- src/sys/arch/aarch64/aarch64/vectors.S:1.23	Mon Aug 30 23:20:00 2021
+++ src/sys/arch/aarch64/aarch64/vectors.S	Sat Sep 18 12:25:06 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: vectors.S,v 1.23 2021/08/30 23:20:00 jmcneill Exp $	*/
+/*	$NetBSD: vectors.S,v 1.24 2021/09/18 12:25:06 jmcneill Exp $	*/
 
 #include 
 #include 
@@ -9,8 +9,9 @@
 #include "opt_cpuoptions.h"
 #include "opt_ddb.h"
 #include "opt_dtrace.h"
+#include "opt_gic.h"
 
-RCSID("$NetBSD: vectors.S,v 1.23 2021/08/30 23:20:00 jmcneill Exp $")
+RCSID("$NetBSD: vectors.S,v 1.24 2021/09/18 12:25:06 jmcneill Exp $")
 
 	ARMV8_DEFINE_OPTIONS
 
@@ -220,7 +221,23 @@ ENTRY_NP(el1_trap_exit)
 
 	unwind_x3_x30
 
-#if TF_PC + 8 == TF_SPSR
+#ifdef GIC_SPLFUNCS
+	mrs	x0, tpidr_el1		/* get curlwp */
+	ldr	x0, [x0, #L_CPU]	/* get curcpu */
+
+	/*
+	 * If ci_intr_depth == 0 and ci_splx_restart != 0, return
+	 * to splx restart. Otherwise return to exception pc.
+	 */
+	ldr	w1, [x0, #CI_INTR_DEPTH]
+	cbnz	w1, 1f
+	ldr	x0, [x0, #CI_SPLX_RESTART]
+	cbnz	x0, 2f
+1:
+	ldr	x0, [sp, #TF_PC]
+2:
+	ldr	x1, [sp, #TF_SPSR]
+#elif TF_PC + 8 == TF_SPSR
 	ldp	x0, x1, [sp, #TF_PC]
 #else
 	ldr	x0, [sp, #TF_PC]

Index: src/sys/arch/aarch64/include/cpu.h
diff -u src/sys/arch/aarch64/include/cpu.h:1.38 src/sys/arch/aarch64/include/cpu.h:1.39
--- src/sys/arch/aarch64/include/cpu.h:1.38	Sat Aug 14 17:51:18 2021
+++ src/sys/arch/aarch64/include/cpu.h	Sat Sep 18 12:25:06 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu.h,v 1.38 2021/08/14 17:51:18 ryo Exp $ */
+/* $NetBSD: cpu.h,v 1.39 2021/09/18 12:25:06 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2014, 2020 The NetBSD Foundation, Inc.
@@ -108,6 +108,8 @@ struct cpu_info {
 	volatile uint32_t ci_blocked_pics;
 	volatile uint32_t ci_pending_pics;
 	volatile uint32_t ci_pending_ipls;
+	void *ci_splx_restart;
+	int ci_splx_savedipl;
 
 	int ci_kfpu_spl;
 

Index: src/sys/arch/arm/cortex/gic_splfuncs.c
diff -u src/sys/arch/arm/cortex/gic_splfuncs.c:1.1 src/sys/arch/arm/cortex/gic_splfuncs.c:1.2
--- src/sys/arch/arm/cortex/gic_splfuncs.c:1.1	Tue Aug 10 15:33:09 2021
+++ src/sys/arch/arm/cortex/gic_splfuncs.c	Sat Sep 18 12:25:07 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: gic_splfuncs.c,v 1.1 2021/08/10 15:33:09 jmcneill Exp $ */
+/* $NetBSD: gic_splfuncs.c,v 1.2 2021/09/18 12:25:07 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2021 Jared McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: gic_splfuncs.c,v 1.1 2021/08/10 15:33:09 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gic_splfuncs.c,v 1.2 2021/09/18 12:25:07 jmcneill Exp $");
 
 #include 
 #include 
@@ -75,26 +75,52 @@ gic_spllower(int newipl)
 static void
 gic_splx(int newipl)
 {
-	struct cpu_info * const ci = curcpu();
+	struct cpu_info *ci = curcpu();
+	register_t psw;
 
 

CVS commit: src/sys/arch

2021-09-18 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Sep 18 12:25:07 UTC 2021

Modified Files:
src/sys/arch/aarch64/aarch64: genassym.cf vectors.S
src/sys/arch/aarch64/include: cpu.h
src/sys/arch/arm/cortex: gic_splfuncs.c
src/sys/arch/evbarm/conf: std.generic64

Log Message:
gic_splx: performance optimizations

Avoid any kind of register access (DAIF, PMR, etc), barriers, and atomic
operations in the common case where no interrupt fires between spl being
raised and lowered.

This introduces a per-CPU return address (ci_splx_restart) used by the
vector handler to restart a sequence in splx that compares the new ipl
with the per-CPU hardware priority state stored in ci_hwpl.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/arch/aarch64/aarch64/genassym.cf
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/aarch64/aarch64/vectors.S
cvs rdiff -u -r1.38 -r1.39 src/sys/arch/aarch64/include/cpu.h
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/cortex/gic_splfuncs.c
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/evbarm/conf/std.generic64

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

2021-09-18 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Sep 18 10:46:17 UTC 2021

Modified Files:
src/usr.bin/xlint/lint1: lex.c tree.c

Log Message:
use isfinite(3) instead of finite(3) for portability

Fixes tools build on macOS 11.6 arm64 hosts.


To generate a diff of this commit:
cvs rdiff -u -r1.83 -r1.84 src/usr.bin/xlint/lint1/lex.c
cvs rdiff -u -r1.381 -r1.382 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/usr.bin/xlint/lint1/lex.c
diff -u src/usr.bin/xlint/lint1/lex.c:1.83 src/usr.bin/xlint/lint1/lex.c:1.84
--- src/usr.bin/xlint/lint1/lex.c:1.83	Fri Sep 17 21:06:04 2021
+++ src/usr.bin/xlint/lint1/lex.c	Sat Sep 18 10:46:17 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: lex.c,v 1.83 2021/09/17 21:06:04 christos Exp $ */
+/* $NetBSD: lex.c,v 1.84 2021/09/18 10:46:17 jmcneill Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -38,7 +38,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: lex.c,v 1.83 2021/09/17 21:06:04 christos Exp $");
+__RCSID("$NetBSD: lex.c,v 1.84 2021/09/18 10:46:17 jmcneill Exp $");
 #endif
 
 #include 
@@ -735,7 +735,7 @@ lex_floating_constant(const char *yytext
 
 	if (typ == FLOAT) {
 		f = (float)d;
-		if (finite(f) == 0) {
+		if (isfinite(f) == 0) {
 			/* floating-point constant out of range */
 			warning(248);
 			f = f > 0 ? FLT_MAX : -FLT_MAX;

Index: src/usr.bin/xlint/lint1/tree.c
diff -u src/usr.bin/xlint/lint1/tree.c:1.381 src/usr.bin/xlint/lint1/tree.c:1.382
--- src/usr.bin/xlint/lint1/tree.c:1.381	Sun Sep 12 10:06:03 2021
+++ src/usr.bin/xlint/lint1/tree.c	Sat Sep 18 10:46:17 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: tree.c,v 1.381 2021/09/12 10:06:03 rillig Exp $	*/
+/*	$NetBSD: tree.c,v 1.382 2021/09/18 10:46:17 jmcneill Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: tree.c,v 1.381 2021/09/12 10:06:03 rillig Exp $");
+__RCSID("$NetBSD: tree.c,v 1.382 2021/09/18 10:46:17 jmcneill Exp $");
 #endif
 
 #include 
@@ -,7 +,7 @@ fold_float(tnode_t *tn)
 	}
 
 	lint_assert(fpe != 0 || isnan((double)v->v_ldbl) == 0);
-	if (fpe != 0 || finite((double)v->v_ldbl) == 0 ||
+	if (fpe != 0 || isfinite((double)v->v_ldbl) == 0 ||
 	(t == FLOAT &&
 	 (v->v_ldbl > FLT_MAX || v->v_ldbl < -FLT_MAX)) ||
 	(t == DOUBLE &&



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

2021-09-18 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Sep 18 10:46:17 UTC 2021

Modified Files:
src/usr.bin/xlint/lint1: lex.c tree.c

Log Message:
use isfinite(3) instead of finite(3) for portability

Fixes tools build on macOS 11.6 arm64 hosts.


To generate a diff of this commit:
cvs rdiff -u -r1.83 -r1.84 src/usr.bin/xlint/lint1/lex.c
cvs rdiff -u -r1.381 -r1.382 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/external/gpl3/gcc/dist/gcc/config

2021-09-18 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Sep 18 10:45:11 UTC 2021

Modified Files:
src/external/gpl3/gcc/dist/gcc/config: host-darwin.c
src/external/gpl3/gcc/dist/gcc/config/aarch64: aarch64.h

Log Message:
Fix build on macOS 11.6 arm64 hosts.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.10 -r1.2 \
src/external/gpl3/gcc/dist/gcc/config/host-darwin.c
cvs rdiff -u -r1.1.1.13 -r1.2 \
src/external/gpl3/gcc/dist/gcc/config/aarch64/aarch64.h

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

Modified files:

Index: src/external/gpl3/gcc/dist/gcc/config/host-darwin.c
diff -u src/external/gpl3/gcc/dist/gcc/config/host-darwin.c:1.1.1.10 src/external/gpl3/gcc/dist/gcc/config/host-darwin.c:1.2
--- src/external/gpl3/gcc/dist/gcc/config/host-darwin.c:1.1.1.10	Sat Apr 10 22:09:44 2021
+++ src/external/gpl3/gcc/dist/gcc/config/host-darwin.c	Sat Sep 18 10:45:11 2021
@@ -22,6 +22,8 @@
 #include "coretypes.h"
 #include "diagnostic-core.h"
 #include "config/host-darwin.h"
+#include "hosthooks.h"
+#include "hosthooks-def.h"
 
 /* Yes, this is really supposed to work.  */
 /* This allows for a pagesize of 16384, which we have on Darwin20, but should
@@ -78,3 +80,5 @@ darwin_gt_pch_use_address (void *addr, s
 
   return ret;
 }
+
+const struct host_hooks host_hooks = HOST_HOOKS_INITIALIZER;

Index: src/external/gpl3/gcc/dist/gcc/config/aarch64/aarch64.h
diff -u src/external/gpl3/gcc/dist/gcc/config/aarch64/aarch64.h:1.1.1.13 src/external/gpl3/gcc/dist/gcc/config/aarch64/aarch64.h:1.2
--- src/external/gpl3/gcc/dist/gcc/config/aarch64/aarch64.h:1.1.1.13	Sat Apr 10 22:09:46 2021
+++ src/external/gpl3/gcc/dist/gcc/config/aarch64/aarch64.h	Sat Sep 18 10:45:11 2021
@@ -1200,7 +1200,7 @@ extern const char *aarch64_rewrite_mcpu 
 #define MCPU_TO_MARCH_SPEC_FUNCTIONS \
   { "rewrite_mcpu", aarch64_rewrite_mcpu },
 
-#if defined(__aarch64__)
+#if defined(__aarch64__) && defined(__linux__)
 extern const char *host_detect_local_cpu (int argc, const char **argv);
 #define HAVE_LOCAL_CPU_DETECT
 # define EXTRA_SPEC_FUNCTIONS		\



CVS commit: src/external/gpl3/gcc/dist/gcc/config

2021-09-18 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Sep 18 10:45:11 UTC 2021

Modified Files:
src/external/gpl3/gcc/dist/gcc/config: host-darwin.c
src/external/gpl3/gcc/dist/gcc/config/aarch64: aarch64.h

Log Message:
Fix build on macOS 11.6 arm64 hosts.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.10 -r1.2 \
src/external/gpl3/gcc/dist/gcc/config/host-darwin.c
cvs rdiff -u -r1.1.1.13 -r1.2 \
src/external/gpl3/gcc/dist/gcc/config/aarch64/aarch64.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/arm/arm

2021-09-18 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Sep 18 09:49:57 UTC 2021

Modified Files:
src/sys/arch/arm/arm: bus_stubs.c

Log Message:
bus_space_is_equal: fix crash when called with NULL tag


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/arm/arm/bus_stubs.c

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

Modified files:

Index: src/sys/arch/arm/arm/bus_stubs.c
diff -u src/sys/arch/arm/arm/bus_stubs.c:1.2 src/sys/arch/arm/arm/bus_stubs.c:1.3
--- src/sys/arch/arm/arm/bus_stubs.c:1.2	Wed Sep  8 11:02:05 2021
+++ src/sys/arch/arm/arm/bus_stubs.c	Sat Sep 18 09:49:57 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus_stubs.c,v 1.2 2021/09/08 11:02:05 jmcneill Exp $	*/
+/*	$NetBSD: bus_stubs.c,v 1.3 2021/09/18 09:49:57 jmcneill Exp $	*/
 
 /*
  * Copyright (c) 2020 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: bus_stubs.c,v 1.2 2021/09/08 11:02:05 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bus_stubs.c,v 1.3 2021/09/18 09:49:57 jmcneill Exp $");
 
 #include 
 #include 
@@ -40,7 +40,11 @@ __KERNEL_RCSID(0, "$NetBSD: bus_stubs.c,
 bool
 bus_space_is_equal(bus_space_tag_t t1, bus_space_tag_t t2)
 {
-	return t1->bs_cookie == t2->bs_cookie;
+	if (t1 == t2) {
+		return true;
+	}
+
+	return t1 != NULL && t2 != NULL && t1->bs_cookie == t2->bs_cookie;
 }
 
 int



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

2021-09-18 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Sep 18 09:49:57 UTC 2021

Modified Files:
src/sys/arch/arm/arm: bus_stubs.c

Log Message:
bus_space_is_equal: fix crash when called with NULL tag


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/arm/arm/bus_stubs.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/sh3/sh3

2021-09-18 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Sep 18 06:32:41 UTC 2021

Modified Files:
src/sys/arch/sh3/sh3: cpu_in_cksum.S

Log Message:
Support __PIC__ build, in order to avoid text relocations for
/usr/tests/net/in_cksum/in_cksum.

Now, all the tests for in_cksum successfully pass for sh[34].

No binary changes for kernel.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/sh3/sh3/cpu_in_cksum.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/sh3/sh3/cpu_in_cksum.S
diff -u src/sys/arch/sh3/sh3/cpu_in_cksum.S:1.6 src/sys/arch/sh3/sh3/cpu_in_cksum.S:1.7
--- src/sys/arch/sh3/sh3/cpu_in_cksum.S:1.6	Sat Sep 18 06:31:46 2021
+++ src/sys/arch/sh3/sh3/cpu_in_cksum.S	Sat Sep 18 06:32:41 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu_in_cksum.S,v 1.6 2021/09/18 06:31:46 rin Exp $	*/
+/*	$NetBSD: cpu_in_cksum.S,v 1.7 2021/09/18 06:32:41 rin Exp $	*/
 
 /*-
  * Copyright (c) 2000 SHIMIZU Ryo 
@@ -34,7 +34,7 @@
 #include 
 #include "assym.h"
 
-__KERNEL_RCSID(0, "$NetBSD: cpu_in_cksum.S,v 1.6 2021/09/18 06:31:46 rin Exp $")
+__KERNEL_RCSID(0, "$NetBSD: cpu_in_cksum.S,v 1.7 2021/09/18 06:32:41 rin Exp $")
 
 
 #define	reg_tmp0		r0
@@ -98,6 +98,7 @@ __KERNEL_RCSID(0, "$NetBSD: cpu_in_cksum
  */
 ENTRY(cpu_in_cksum)
 	sts.l	pr,@-sp
+	PIC_PROLOGUE(.L_got)
 
 	tst	reg_len, reg_len
 	bt/s	mbuf_loop_done
@@ -222,6 +223,7 @@ mbuf_loop_done:
 
 in_cksum_return:
 	not	reg_sum,r0
+	PIC_EPILOGUE
 	lds.l	@sp+,pr
 	rts
 	 extu.w	r0,r0
@@ -233,15 +235,17 @@ out_of_mbufs:
 
 	mov.l	reg_sum,@-sp	/* save: call clobbered register */
 
-	jsr	@reg_tmp3
+1:	CALL	reg_tmp3
 	 mov	reg_tmp0,r4
 
 	bra	in_cksum_return
 	 mov.l	@sp+,reg_sum	/* restore */
 
 	.align 2
+.L_got:
+	PIC_GOT_DATUM
 .L_printf:
-	.long	_C_LABEL(printf)
+	CALL_DATUM(_C_LABEL(printf), 1b)
 
 	.align 2	/* mova target */
 .L_message_out_of_data:



CVS commit: src/sys/arch/sh3/sh3

2021-09-18 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Sep 18 06:32:41 UTC 2021

Modified Files:
src/sys/arch/sh3/sh3: cpu_in_cksum.S

Log Message:
Support __PIC__ build, in order to avoid text relocations for
/usr/tests/net/in_cksum/in_cksum.

Now, all the tests for in_cksum successfully pass for sh[34].

No binary changes for kernel.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/sh3/sh3/cpu_in_cksum.S

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



CVS commit: src/sys/arch/sh3/sh3

2021-09-18 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Sep 18 06:31:46 UTC 2021

Modified Files:
src/sys/arch/sh3/sh3: cpu_in_cksum.S

Log Message:
cksum128mod: Prepare jump address by 'mova', instead of 'mov.l'.

Since both this 'mova' and 'and #imm' above must be used against r0,
we need extra 'mov r0, r3'. However, this should still be good both for
sh3 and sh4:

- For sh3, 'mov.l' at odd half-word address is removed; pipeline hazard
  due to instruction fetch is resolved.

- For sh4, data cache line is no longer assigned for this 'mov.l'.

Also:

- Upcoming __PIC__ support (in order to avoid text relocations when built
  in tests/net/in_cksum) becomes simpler; no need CALL_DATUM_LOCAL() for
  cksum128_tail.

- Shave off 4 bytes from text.

No regression is observed for sh3 (hpcsh) and sh4 (landisk).


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/sh3/sh3/cpu_in_cksum.S

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



CVS commit: src/sys/arch/sh3/sh3

2021-09-18 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Sep 18 06:31:46 UTC 2021

Modified Files:
src/sys/arch/sh3/sh3: cpu_in_cksum.S

Log Message:
cksum128mod: Prepare jump address by 'mova', instead of 'mov.l'.

Since both this 'mova' and 'and #imm' above must be used against r0,
we need extra 'mov r0, r3'. However, this should still be good both for
sh3 and sh4:

- For sh3, 'mov.l' at odd half-word address is removed; pipeline hazard
  due to instruction fetch is resolved.

- For sh4, data cache line is no longer assigned for this 'mov.l'.

Also:

- Upcoming __PIC__ support (in order to avoid text relocations when built
  in tests/net/in_cksum) becomes simpler; no need CALL_DATUM_LOCAL() for
  cksum128_tail.

- Shave off 4 bytes from text.

No regression is observed for sh3 (hpcsh) and sh4 (landisk).


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/sh3/sh3/cpu_in_cksum.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/sh3/sh3/cpu_in_cksum.S
diff -u src/sys/arch/sh3/sh3/cpu_in_cksum.S:1.5 src/sys/arch/sh3/sh3/cpu_in_cksum.S:1.6
--- src/sys/arch/sh3/sh3/cpu_in_cksum.S:1.5	Tue Jan  6 17:43:16 2015
+++ src/sys/arch/sh3/sh3/cpu_in_cksum.S	Sat Sep 18 06:31:46 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu_in_cksum.S,v 1.5 2015/01/06 17:43:16 christos Exp $	*/
+/*	$NetBSD: cpu_in_cksum.S,v 1.6 2021/09/18 06:31:46 rin Exp $	*/
 
 /*-
  * Copyright (c) 2000 SHIMIZU Ryo 
@@ -34,7 +34,7 @@
 #include 
 #include "assym.h"
 
-__KERNEL_RCSID(0, "$NetBSD: cpu_in_cksum.S,v 1.5 2015/01/06 17:43:16 christos Exp $")
+__KERNEL_RCSID(0, "$NetBSD: cpu_in_cksum.S,v 1.6 2021/09/18 06:31:46 rin Exp $")
 
 
 #define	reg_tmp0		r0
@@ -255,18 +255,14 @@ cksum128mod:
 	mov	reg_mlen,reg_tmp0
 	and	#124,reg_tmp0
 	sub	reg_tmp0,reg_mlen
+	mov	reg_tmp0,reg_tmp3
 
-	mov.l	.L_cksum128_tail_p,reg_tmp3
-	sub	reg_tmp0,reg_tmp3
-	jmp	@reg_tmp3
+	mova	cksum128_tail,reg_tmp0
+	sub	reg_tmp3,reg_tmp0
+	jmp	@reg_tmp0
 	 clrt
 
 	.align	2
-.L_cksum128_tail_p:
-	.long	cksum128_tail
-
-
-	.align	2
 cksum128:
 	add	#-128,reg_mlen
 	clrt