Re: CVS commit: src/sys/arch

2021-09-23 Thread Izumi Tsutsui
> Module Name:  src
> Committed By: skrll
> Date: Thu Sep 23 06:34:00 UTC 2021
> 
> Modified Files:
>   src/sys/arch/aarch64/aarch64: cpufunc.c
>   src/sys/arch/arm/arm32: cpu.c
> 
> Log Message:
> Print the cache information in similar formats and arm and aarch64, e.g.
 :
> aarch64 before
> [   1.030] cpu1: L1 48KB/64B*256L*3W PIPT Instruction cache
> [   1.030] cpu1: L1 32KB/64B*256L*2W PIPT Data cache
> [   1.030] cpu1: L2 2048KB/64B*2048L*16W PIPT Unified cache
> 
> aarch64 after
> [   1.030] cpu1: L1 48KB/64B 3-way (256 set) PIPT Instruction cache
> [   1.030] cpu1: L1 32KB/64B 2-way (256 set) PIPT Data cache
> [   1.030] cpu1: L2 2048KB/64B 16-way (2048 set) PIPT Unified cache

I prefer "line(s)" as before rather than "set(s)" since
the latter implies "N-way set associative cache".

---
Izumi Tsutsui


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

2021-09-20 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Mon Sep 20 08:31:09 UTC 2021

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

Log Message:
Add a comment that .set_leds function won't work correctly on cngetc(9).

I'm afraid all other keyboard drivers that have .set_leds function
(like sgimips/dev/zs_kbd.c) have the same issue.
Maybe we needs 'polled' flag in .set_leds function, or an independent
.set_leds accessop in struct wskbd_consops for cons(9).


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 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.37 src/sys/arch/luna68k/dev/lunaws.c:1.38
--- src/sys/arch/luna68k/dev/lunaws.c:1.37	Sun Sep 19 11:43:54 2021
+++ src/sys/arch/luna68k/dev/lunaws.c	Mon Sep 20 08:31:09 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: lunaws.c,v 1.37 2021/09/19 11:43:54 tsutsui Exp $ */
+/* $NetBSD: lunaws.c,v 1.38 2021/09/20 08:31:09 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.37 2021/09/19 11:43:54 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lunaws.c,v 1.38 2021/09/20 08:31:09 tsutsui Exp $");
 
 #include "opt_wsdisplay_compat.h"
 #include "wsmouse.h"
@@ -571,6 +571,16 @@ omkbd_set_leds(void *cookie, int leds)
 	struct ws_softc *sc = cookie;
 	uint8_t ledcmd;
 
+	/*
+	 * XXX:
+	 *  Why does MI wskbd(4) use a common .set_leds function
+	 *  for both kernel cons(9) and normal tty devices!?
+	 *
+	 *  When CAP key is pressed in cngetc(9) (like ddb(4) etc.)
+	 *  after wskbd(4) is attached, all LED commands are queued
+	 *  into txq[] and will never be sent until ddb(4) returns.
+	 */
+
 	sc->sc_leds = leds;
 	if ((leds & WSKBD_LED_CAPS) != 0) {
 		ledcmd = OMKBD_LED_ON_CAPS;



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

2021-09-20 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Mon Sep 20 08:31:09 UTC 2021

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

Log Message:
Add a comment that .set_leds function won't work correctly on cngetc(9).

I'm afraid all other keyboard drivers that have .set_leds function
(like sgimips/dev/zs_kbd.c) have the same issue.
Maybe we needs 'polled' flag in .set_leds function, or an independent
.set_leds accessop in struct wskbd_consops for cons(9).


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 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/luna68k/dev

2021-09-19 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sun Sep 19 11:43:54 UTC 2021

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

Log Message:
Use more C99 designated initializer.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 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.36 src/sys/arch/luna68k/dev/lunaws.c:1.37
--- src/sys/arch/luna68k/dev/lunaws.c:1.36	Sun Sep 19 07:55:17 2021
+++ src/sys/arch/luna68k/dev/lunaws.c	Sun Sep 19 11:43:54 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: lunaws.c,v 1.36 2021/09/19 07:55:17 tsutsui Exp $ */
+/* $NetBSD: lunaws.c,v 1.37 2021/09/19 11:43:54 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.36 2021/09/19 07:55:17 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lunaws.c,v 1.37 2021/09/19 11:43:54 tsutsui Exp $");
 
 #include "opt_wsdisplay_compat.h"
 #include "wsmouse.h"
@@ -161,9 +161,9 @@ static int  omms_ioctl(void *, u_long, v
 static void omms_disable(void *);
 
 static const struct wsmouse_accessops omms_accessops = {
-	omms_enable,
-	omms_ioctl,
-	omms_disable,
+	.enable  = omms_enable,
+	.ioctl   = omms_ioctl,
+	.disable = omms_disable,
 };
 #endif
 



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

2021-09-19 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sun Sep 19 11:43:54 UTC 2021

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

Log Message:
Use more C99 designated initializer.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 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/luna68k/dev

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

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

Log Message:
Handle CAP and Kana modifier key specification quirk of LUNA's keyboard.

LUNA's keyboard doesn't send any keycode when these modifier keys are
released.  Instead, it sends a pressed or released code per how each
modifier LED status will be changed when the modifier keys are pressed.
To handle this quirk in MI wskbd(4) layer, we have to send a faked
"pressed and released" sequence on passing keycodes to wskbd_input(9).

Tested on LUNA both on ttyE0 and WSKBD_RAW mode (on Xorg server).


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 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.35 src/sys/arch/luna68k/dev/lunaws.c:1.36
--- src/sys/arch/luna68k/dev/lunaws.c:1.35	Sat Sep 18 13:44:02 2021
+++ src/sys/arch/luna68k/dev/lunaws.c	Sun Sep 19 07:55:17 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: lunaws.c,v 1.35 2021/09/18 13:44:02 tsutsui Exp $ */
+/* $NetBSD: lunaws.c,v 1.36 2021/09/19 07:55:17 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.35 2021/09/18 13:44:02 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lunaws.c,v 1.36 2021/09/19 07:55:17 tsutsui Exp $");
 
 #include "opt_wsdisplay_compat.h"
 #include "wsmouse.h"
@@ -401,6 +401,14 @@ omkbd_input(struct ws_softc *sc, int dat
 		int c, j = 0;
 
 		c = omkbd_raw[key];
+		if (c == 0x70 /* Kana */ ||
+		c == 0x3a /* CAP  */) {
+			/* See comment in !sc->sc_rawkbd case */
+			cbuf[0] = c;
+			wskbd_rawinput(sc->sc_wskbddev, cbuf, 1);
+			cbuf[0] = c | 0x80;
+			wskbd_rawinput(sc->sc_wskbddev, cbuf, 1);
+		} else
 		if (c != 0x00) {
 			/* fake extended scancode if necessary */
 			if (c & 0x80)
@@ -415,8 +423,27 @@ omkbd_input(struct ws_softc *sc, int dat
 	} else
 #endif
 	{
-		if (sc->sc_wskbddev != NULL)
-			wskbd_input(sc->sc_wskbddev, type, key);
+		if (sc->sc_wskbddev != NULL) {
+			if (key == 0x0b /* Kana */ ||
+			key == 0x0e /* CAP  */) {
+/*
+ * LUNA's keyboard doesn't send any keycode
+ * when these modifier keys are released.
+ * Instead, it sends a pressed or released code
+ * per how each modifier LED status will be
+ * changed when the modifier keys are pressed.
+ * To handle this quirk in MI wskbd(4) layer,
+ * we have to send a faked
+ * "pressed and released" sequence here.
+ */
+wskbd_input(sc->sc_wskbddev,
+WSCONS_EVENT_KEY_DOWN, key);
+wskbd_input(sc->sc_wskbddev,
+WSCONS_EVENT_KEY_UP, key);
+			} else {
+wskbd_input(sc->sc_wskbddev, type, key);
+			}
+		}
 	}
 }
 



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

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

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

Log Message:
Handle CAP and Kana modifier key specification quirk of LUNA's keyboard.

LUNA's keyboard doesn't send any keycode when these modifier keys are
released.  Instead, it sends a pressed or released code per how each
modifier LED status will be changed when the modifier keys are pressed.
To handle this quirk in MI wskbd(4) layer, we have to send a faked
"pressed and released" sequence on passing keycodes to wskbd_input(9).

Tested on LUNA both on ttyE0 and WSKBD_RAW mode (on Xorg server).


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 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/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/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(v

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.



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

2021-09-08 Thread Izumi Tsutsui
> Module Name:  src
> Committed By: rin
> Date: Wed Sep  8 07:22:56 UTC 2021
> 
> Modified Files:
>   src/sys/arch/sh3/sh3: pmap.c
> 
> Log Message:
> Redo a part of rev 1.89:
> 
> - Remove redundant parentheses/braces/comments.
> - Fix indents.
> 
> No binary changes confirmed this time.

---
-   if (kva) {
+   if (kva)
entry |= PG_V | PG_SH |
((prot & VM_PROT_WRITE) ?
(PG_PR_KRW | PG_D) : PG_PR_KRO);
-   } else {
+   else
entry |= PG_V |
((prot & VM_PROT_WRITE) ?
(PG_PR_URW | PG_D) : PG_PR_URO);
-   }
}
---

This part doesn't match KNF:
 http://cvsweb.netbsd.org/bsdweb.cgi/src/share/misc/style#rev1.58

> Update style around single-line braces according to discussion.
> 
> https://mail-index.netbsd.org/tech-userlevel/2020/07/12/msg012536.html
> https://mail-index.netbsd.org/tech-kern/2020/07/12/msg026594.html
> 
> Retain some examples of technically unnecessary braces that likely
> aid legibility from the previous commit.

So I don't think removing existing ones per "redundant" is a valid reason.

---
Izumi Tsutsui


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

2021-09-04 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Sep  4 18:38:03 UTC 2021

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

Log Message:
Ignore mouse packets properly even if wsmouse(4) isn't configured.

The internal state of wskbd(4) could be mangled if mouse (which was
connected behind keyboard) was enabled by unexpected keyboard reset.
This could happen on the INSTALL kernel (no wsmouse(4) on it).

Based on a patch from moveccr, with several tweaks by me.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 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.33 src/sys/arch/luna68k/dev/lunaws.c:1.34
--- src/sys/arch/luna68k/dev/lunaws.c:1.33	Sat Aug  7 16:18:57 2021
+++ src/sys/arch/luna68k/dev/lunaws.c	Sat Sep  4 18:38:03 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: lunaws.c,v 1.33 2021/08/07 16:18:57 thorpej Exp $ */
+/* $NetBSD: lunaws.c,v 1.34 2021/09/04 18:38:03 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.33 2021/08/07 16:18:57 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lunaws.c,v 1.34 2021/09/04 18:38:03 tsutsui Exp $");
 
 #include "opt_wsdisplay_compat.h"
 #include "wsmouse.h"
@@ -77,9 +77,9 @@ struct ws_softc {
 	u_int		sc_rxqtail;
 #if NWSMOUSE > 0
 	device_t	sc_wsmousedev;
-	int		sc_msreport;
 	int		sc_msbuttons, sc_msdx, sc_msdy;
 #endif
+	int		sc_msreport;
 	void		*sc_si;
 	int		sc_rawkbd;
 };
@@ -184,9 +184,9 @@ wsattach(device_t parent, device_t self,
 	b.accesscookie = (void *)sc;
 	sc->sc_wsmousedev = config_found(self, , wsmousedevprint,
 	CFARGS(.iattr = "wsmousedev"));
-	sc->sc_msreport = 0;
 	}
 #endif
+	sc->sc_msreport = 0;
 }
 
 /*ARGSUSED*/
@@ -225,41 +225,42 @@ wssoftintr(void *arg)
 	while (sc->sc_rxqhead != sc->sc_rxqtail) {
 		code = sc->sc_rxq[sc->sc_rxqhead];
 		sc->sc_rxqhead = OMKBD_NEXTRXQ(sc->sc_rxqhead);
-#if NWSMOUSE > 0
 		/*
-		 * if (code >= 0x80 && code <= 0x87), then
+		 * if (code >= 0x80 && code <= 0x87), i.e.
+		 * if ((code & 0xf8) == 0x80), then
 		 * it's the first byte of 3 byte long mouse report
 		 *	code[0] & 07 -> LMR button condition
 		 *	code[1], [2] -> x,y delta
 		 * otherwise, key press or release event.
 		 */
-		if (sc->sc_msreport == 0) {
-			if (code < 0x80 || code > 0x87) {
-omkbd_input(sc, code);
-continue;
-			}
-			code = (code & 07) ^ 07;
-			/* LMR->RML: wsevent counts 0 for leftmost */
-			sc->sc_msbuttons = (code & 02);
-			if ((code & 01) != 0)
-sc->sc_msbuttons |= 04;
-			if ((code & 04) != 0)
-sc->sc_msbuttons |= 01;
-			sc->sc_msreport = 1;
-		} else if (sc->sc_msreport == 1) {
+		if (sc->sc_msreport == 1) {
+#if NWSMOUSE > 0
 			sc->sc_msdx = (int8_t)code;
+#endif
 			sc->sc_msreport = 2;
+			continue;
 		} else if (sc->sc_msreport == 2) {
+#if NWSMOUSE > 0
 			sc->sc_msdy = (int8_t)code;
 			wsmouse_input(sc->sc_wsmousedev,
 			sc->sc_msbuttons, sc->sc_msdx, sc->sc_msdy, 0, 0,
 			WSMOUSE_INPUT_DELTA);
-
+#endif
 			sc->sc_msreport = 0;
+			continue;
 		}
-#else
-		omkbd_input(sc, code);
+		if ((code & 0xf8) == 0x80) {
+#if NWSMOUSE > 0
+			/* buttons: Negative logic to positive */
+			code = ~code;
+			/* LMR->RML: wsevent counts 0 for leftmost */
+			sc->sc_msbuttons =
+			((code & 1) << 2) | (code & 2) | ((code & 4) >> 2);
 #endif
+			sc->sc_msreport = 1;
+			continue;
+		}
+		omkbd_input(sc, code);
 	}
 }
 
@@ -380,10 +381,7 @@ omkbd_ioctl(void *v, u_long cmd, void *d
 static int
 omms_enable(void *v)
 {
-	struct ws_softc *sc = v;
-
 	syscnputc((dev_t)1, 0x60); /* enable 3 byte long mouse reporting */
-	sc->sc_msreport = 0;
 	return 0;
 }
 
@@ -402,9 +400,6 @@ omms_ioctl(void *v, u_long cmd, void *da
 static void
 omms_disable(void *v)
 {
-	struct ws_softc *sc = v;
-
 	syscnputc((dev_t)1, 0x20); /* quiet mouse */
-	sc->sc_msreport = 0;
 }
 #endif



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

2021-09-04 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Sep  4 18:38:03 UTC 2021

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

Log Message:
Ignore mouse packets properly even if wsmouse(4) isn't configured.

The internal state of wskbd(4) could be mangled if mouse (which was
connected behind keyboard) was enabled by unexpected keyboard reset.
This could happen on the INSTALL kernel (no wsmouse(4) on it).

Based on a patch from moveccr, with several tweaks by me.


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

2021-09-04 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Sep  4 12:54:19 UTC 2021

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

Log Message:
Fix several styles and formats.


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/sys/arch/luna68k/dev/siotty.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/siotty.c
diff -u src/sys/arch/luna68k/dev/siotty.c:1.49 src/sys/arch/luna68k/dev/siotty.c:1.50
--- src/sys/arch/luna68k/dev/siotty.c:1.49	Sat Sep  4 12:44:23 2021
+++ src/sys/arch/luna68k/dev/siotty.c	Sat Sep  4 12:54:19 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: siotty.c,v 1.49 2021/09/04 12:44:23 tsutsui Exp $ */
+/* $NetBSD: siotty.c,v 1.50 2021/09/04 12:54:19 tsutsui Exp $ */
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -31,9 +31,10 @@
 
 #include 			/* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: siotty.c,v 1.49 2021/09/04 12:44:23 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: siotty.c,v 1.50 2021/09/04 12:54:19 tsutsui Exp $");
 
 #include "opt_ddb.h"
+#include "siotty.h"
 
 #include 
 #include 
@@ -105,7 +106,6 @@ u_int siotty_rbuf_size = SIOTTY_RING_SIZ
 
 static struct cnm_state	siotty_cnm_state;
 
-#include "siotty.h"
 static void siostart(struct tty *);
 static int  sioparam(struct tty *, struct termios *);
 static void siottyintr(void *);
@@ -415,14 +415,16 @@ sioparam(struct tty *tp, struct termios 
 	tp->t_ospeed = t->c_ospeed;
 	tp->t_cflag = t->c_cflag;
 
-	sc->sc_wr[WR3] &= 0x3f;
-	sc->sc_wr[WR5] &= 0x9f;
+	sc->sc_wr[WR3] &= ~WR3_RX8BIT;
+	sc->sc_wr[WR5] &= ~WR5_TX8BIT;
 	switch (tp->t_cflag & CSIZE) {
 	case CS7:
-		sc->sc_wr[WR3] |= WR3_RX7BIT; sc->sc_wr[WR5] |= WR5_TX7BIT;
+		sc->sc_wr[WR3] |= WR3_RX7BIT;
+		sc->sc_wr[WR5] |= WR5_TX7BIT;
 		break;
 	case CS8:
-		sc->sc_wr[WR3] |= WR3_RX8BIT; sc->sc_wr[WR5] |= WR5_TX8BIT;
+		sc->sc_wr[WR3] |= WR3_RX8BIT;
+		sc->sc_wr[WR5] |= WR5_TX8BIT;
 		break;
 	}
 	if ((tp->t_cflag & PARENB) != 0) {
@@ -524,9 +526,9 @@ sioopen(dev_t dev, int flag, int mode, s
 		/* raise RTS and DTR here; but, DTR lead is not wired */
 		/* then check DCD condition; but, DCD lead is not wired */
 #if 0
-		if ((sc->sc_flags & TIOCFLAG_SOFTCAR) != 0
-		|| (tp->t_cflag & MDMBUF) != 0
-		|| (getsiocsr(sc->sc_ctl) & RR_DCD) != 0)
+		if ((sc->sc_flags & TIOCFLAG_SOFTCAR) != 0 ||
+		(tp->t_cflag & MDMBUF) != 0 ||
+		(getsiocsr(sc->sc_ctl) & RR_DCD) != 0)
 			tp->t_state |= TS_CARR_ON;
 		else
 			tp->t_state &= ~TS_CARR_ON;
@@ -558,8 +560,8 @@ sioclose(dev_t dev, int flag, int mode, 
 	s = splserial();
 	siomctl(sc, TIOCM_BREAK, DMBIC);
 #if 0 /* because unable to feed DTR signal */
-	if ((tp->t_cflag & HUPCL) != 0
-	|| tp->t_wopen || (tp->t_state & TS_ISOPEN) == 0) {
+	if ((tp->t_cflag & HUPCL) != 0 ||
+	tp->t_wopen || (tp->t_state & TS_ISOPEN) == 0) {
 		siomctl(sc, TIOCM_DTR, DMBIC);
 		/* Yield CPU time to others for 1 second, then ... */
 		siomctl(sc, TIOCM_DTR, DMBIS);



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

2021-09-04 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Sep  4 12:54:19 UTC 2021

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

Log Message:
Fix several styles and formats.


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

2021-09-04 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Sep  4 12:44:23 UTC 2021

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

Log Message:
Use C99 designated initializer.


To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 src/sys/arch/luna68k/dev/siotty.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/siotty.c
diff -u src/sys/arch/luna68k/dev/siotty.c:1.48 src/sys/arch/luna68k/dev/siotty.c:1.49
--- src/sys/arch/luna68k/dev/siotty.c:1.48	Sat Sep  4 12:38:13 2021
+++ src/sys/arch/luna68k/dev/siotty.c	Sat Sep  4 12:44:23 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: siotty.c,v 1.48 2021/09/04 12:38:13 tsutsui Exp $ */
+/* $NetBSD: siotty.c,v 1.49 2021/09/04 12:44:23 tsutsui Exp $ */
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include 			/* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: siotty.c,v 1.48 2021/09/04 12:38:13 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: siotty.c,v 1.49 2021/09/04 12:44:23 tsutsui Exp $");
 
 #include "opt_ddb.h"
 
@@ -692,16 +692,16 @@ getsiocsr(struct sioreg *sio)
 /*-  console interface --*/
 
 struct consdev syscons = {
-	NULL,
-	NULL,
-	syscngetc,
-	syscnputc,
-	nullcnpollc,
-	NULL,
-	NULL,
-	NULL,
-	NODEV,
-	CN_REMOTE,
+	.cn_probe = NULL,
+	.cn_init  = NULL,
+	.cn_getc  = syscngetc,
+	.cn_putc  = syscnputc,
+	.cn_pollc = nullcnpollc,
+	.cn_bell  = NULL,
+	.cn_halt  = NULL,
+	.cn_flush = NULL,
+	.cn_dev   = NODEV,
+	.cn_pri   = CN_REMOTE,
 };
 
 /* EXPORT */ void



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

2021-09-04 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Sep  4 12:44:23 UTC 2021

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

Log Message:
Use C99 designated initializer.


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

2021-09-04 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Sep  4 12:38:13 UTC 2021

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

Log Message:
Use proper macro for device register addresses.


To generate a diff of this commit:
cvs rdiff -u -r1.47 -r1.48 src/sys/arch/luna68k/dev/siotty.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/siotty.c
diff -u src/sys/arch/luna68k/dev/siotty.c:1.47 src/sys/arch/luna68k/dev/siotty.c:1.48
--- src/sys/arch/luna68k/dev/siotty.c:1.47	Tue Dec 29 17:17:14 2020
+++ src/sys/arch/luna68k/dev/siotty.c	Sat Sep  4 12:38:13 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: siotty.c,v 1.47 2020/12/29 17:17:14 tsutsui Exp $ */
+/* $NetBSD: siotty.c,v 1.48 2021/09/04 12:38:13 tsutsui Exp $ */
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include 			/* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: siotty.c,v 1.47 2020/12/29 17:17:14 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: siotty.c,v 1.48 2021/09/04 12:38:13 tsutsui Exp $");
 
 #include "opt_ddb.h"
 
@@ -49,6 +49,7 @@ __KERNEL_RCSID(0, "$NetBSD: siotty.c,v 1
 #include 
 #include 
 
+#include 
 #include 
 
 #include 
@@ -711,7 +712,7 @@ syscninit(int channel)
  * boot/reset/poweron.  ROM monitor emits one line message on CH.A.
  */
 	struct sioreg *sio;
-	sio = (struct sioreg *)0x5100 + channel;
+	sio = (struct sioreg *)OBIO_SIO + channel;
 
 	syscons.cn_dev = makedev(cdevsw_lookup_major(_cdevsw),
  channel);
@@ -735,7 +736,7 @@ syscngetc(dev_t dev)
 	struct sioreg *sio;
 	int s, c;
 
-	sio = (struct sioreg *)0x5100 + ((int)dev & 0x1);
+	sio = (struct sioreg *)OBIO_SIO + ((int)dev & 0x1);
 	s = splhigh();
 	while ((getsiocsr(sio) & RR_RXRDY) == 0)
 		continue;
@@ -751,7 +752,7 @@ syscnputc(dev_t dev, int c)
 	struct sioreg *sio;
 	int s;
 
-	sio = (struct sioreg *)0x5100 + ((int)dev & 0x1);
+	sio = (struct sioreg *)OBIO_SIO + ((int)dev & 0x1);
 	s = splhigh();
 	while ((getsiocsr(sio) & RR_TXRDY) == 0)
 		continue;



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

2021-09-04 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Sep  4 12:38:13 UTC 2021

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

Log Message:
Use proper macro for device register addresses.


To generate a diff of this commit:
cvs rdiff -u -r1.47 -r1.48 src/sys/arch/luna68k/dev/siotty.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/cobalt

2021-09-03 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Sep  4 02:24:27 UTC 2021

Modified Files:
src/sys/arch/cobalt/conf: files.cobalt
Removed Files:
src/sys/arch/cobalt/cobalt: disksubr.c

Log Message:
Use MI subr_disk_mbr.c for proper MBR and bi-endian supprot.

No special MD handling in previous.  Briefly tested on gxemul 0.6.3.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r0 src/sys/arch/cobalt/cobalt/disksubr.c
cvs rdiff -u -r1.42 -r1.43 src/sys/arch/cobalt/conf/files.cobalt

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/cobalt/conf/files.cobalt
diff -u src/sys/arch/cobalt/conf/files.cobalt:1.42 src/sys/arch/cobalt/conf/files.cobalt:1.43
--- src/sys/arch/cobalt/conf/files.cobalt:1.42	Sat Apr 24 23:36:31 2021
+++ src/sys/arch/cobalt/conf/files.cobalt	Sat Sep  4 02:24:27 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: files.cobalt,v 1.42 2021/04/24 23:36:31 thorpej Exp $
+#	$NetBSD: files.cobalt,v 1.43 2021/09/04 02:24:27 tsutsui Exp $
 
 maxpartitions 16
 
@@ -41,10 +41,11 @@ file arch/cobalt/dev/gt.c		gt
 file arch/cobalt/dev/gt_io_space.c	gt
 file arch/cobalt/dev/gt_mem_space.c	gt
 
+file kern/subr_disk_mbr.c
+
 file arch/cobalt/cobalt/autoconf.c
 file arch/cobalt/cobalt/bus.c
 file arch/cobalt/cobalt/console.c
-file arch/cobalt/cobalt/disksubr.c
 file arch/cobalt/cobalt/interrupt.c
 file arch/cobalt/cobalt/machdep.c
 



CVS commit: src/sys/arch/cobalt

2021-09-03 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Sep  4 02:24:27 UTC 2021

Modified Files:
src/sys/arch/cobalt/conf: files.cobalt
Removed Files:
src/sys/arch/cobalt/cobalt: disksubr.c

Log Message:
Use MI subr_disk_mbr.c for proper MBR and bi-endian supprot.

No special MD handling in previous.  Briefly tested on gxemul 0.6.3.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r0 src/sys/arch/cobalt/cobalt/disksubr.c
cvs rdiff -u -r1.42 -r1.43 src/sys/arch/cobalt/conf/files.cobalt

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



CVS commit: src/sys/arch/cobalt/cobalt

2021-09-03 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Sep  4 02:19:56 UTC 2021

Modified Files:
src/sys/arch/cobalt/cobalt: console.c

Log Message:
Use C99 designated initializer.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/cobalt/cobalt/console.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/cobalt/cobalt/console.c
diff -u src/sys/arch/cobalt/cobalt/console.c:1.12 src/sys/arch/cobalt/cobalt/console.c:1.13
--- src/sys/arch/cobalt/cobalt/console.c:1.12	Fri Jul  1 20:36:42 2011
+++ src/sys/arch/cobalt/cobalt/console.c	Sat Sep  4 02:19:56 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: console.c,v 1.12 2011/07/01 20:36:42 dyoung Exp $	*/
+/*	$NetBSD: console.c,v 1.13 2021/09/04 02:19:56 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 2000 Soren S. Jorvang.  All rights reserved.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: console.c,v 1.12 2011/07/01 20:36:42 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: console.c,v 1.13 2021/09/04 02:19:56 tsutsui Exp $");
 
 #include 
 #include 
@@ -50,18 +50,59 @@ int	console_present = 0;	/* Do we have a
 
 struct	consdev	constab[] = {
 #if NCOM_MAINBUS > 0
-	{ com_mainbus_cnprobe, com_mainbus_cninit,
-	NULL, NULL, NULL, NULL, NULL, NULL, 0, CN_DEAD },
+	{
+		.cn_probe = com_mainbus_cnprobe,
+		.cn_init  = com_mainbus_cninit,
+		.cn_getc  = NULL,
+		.cn_putc  = NULL,
+		.cn_pollc = NULL,
+		.cn_bell  = NULL,
+		.cn_halt  = NULL,
+		.cn_flush = NULL,
+		.cn_dev   = 0,
+		.cn_pri   = CN_DEAD
+	},
 #endif
 #if NZSC > 0
-	{ zscnprobe, zscninit, zscngetc, zscnputc, nullcnpollc,
-	NULL, NULL, NULL, NODEV, CN_DEAD },
+	{
+		.cn_probe = zscnprobe,
+		.cn_init  = zscninit,
+		.cn_getc  = zscngetc,
+		.cn_putc  = zscnputc,
+		.cn_pollc = nullcnpollc,
+		.cn_bell  = NULL,
+		.cn_halt  = NULL,
+		.cn_flush = NULL,
+		.cn_dev   = NODEV,
+		.cn_pri   = CN_DEAD
+	},
 #endif
 #if NNULLCONS > 0
-	{ nullcnprobe, nullcninit,
-	NULL, NULL, NULL, NULL, NULL, NULL, 0, CN_DEAD },
+	{
+		.cn_probe = nullcnprobe,
+		.cn_init  = nullcninit,
+		.cn_getc  = NULL,
+		.cn_putc  = NULL,
+		.cn_pollc = NULL,
+		.cn_bell  = NULL,
+		.cn_halt  = NULL,
+		.cn_flush = NULL,
+		.cn_dev   = 0,
+		.cn_pri   = CN_DEAD
+	},
 #endif
-	{ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, CN_DEAD }
+	{
+		.cn_probe = NULL,
+		.cn_init  = NULL,
+		.cn_getc  = NULL,
+		.cn_putc  = NULL,
+		.cn_pollc = NULL,
+		.cn_bell  = NULL,
+		.cn_halt  = NULL,
+		.cn_flush = NULL,
+		.cn_dev   = 0,
+		.cn_pri   = CN_DEAD
+	}
 };
 
 #define CONSOLE_PROBE	0x0020001c	/* console flag passed by firmware */



CVS commit: src/sys/arch/cobalt/cobalt

2021-09-03 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Sep  4 02:19:56 UTC 2021

Modified Files:
src/sys/arch/cobalt/cobalt: console.c

Log Message:
Use C99 designated initializer.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/cobalt/cobalt/console.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/luna68k/stand/boot

2021-09-03 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Fri Sep  3 16:21:15 UTC 2021

Modified Files:
src/sys/arch/luna68k/stand/boot: kbd.c

Log Message:
Ignore mouse packets to avoid unexpected data handled as keyboard input.

Patch from moveccr.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/luna68k/stand/boot/kbd.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/stand/boot/kbd.c
diff -u src/sys/arch/luna68k/stand/boot/kbd.c:1.4 src/sys/arch/luna68k/stand/boot/kbd.c:1.5
--- src/sys/arch/luna68k/stand/boot/kbd.c:1.4	Sat Feb 14 13:06:28 2015
+++ src/sys/arch/luna68k/stand/boot/kbd.c	Fri Sep  3 16:21:15 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: kbd.c,v 1.4 2015/02/14 13:06:28 tsutsui Exp $	*/
+/*	$NetBSD: kbd.c,v 1.5 2021/09/03 16:21:15 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1992 OMRON Corporation.
@@ -213,12 +213,23 @@ static const struct kbd_keymap kbd_keyma
 int	shift_flag = 0;
 int	ctrl_flag  = 0;
 int	meta_flag  = 0;
+int	mouse_flag  = 0;
 
 int
 kbd_decode(uint8_t code)
 {
 	unsigned int c, updown = 0;
 
+	/* ignore mouse data */
+	if (mouse_flag != 0) {
+		mouse_flag--;
+		return KC_IGNORE;
+	}
+	if ((code & 0xf8) == 0x80) {
+		mouse_flag = 2;
+		return KC_IGNORE;
+	}
+
 	if (code & 0x80)
 		updown = 1;
 



CVS commit: src/sys/arch/luna68k/stand/boot

2021-09-03 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Fri Sep  3 16:21:15 UTC 2021

Modified Files:
src/sys/arch/luna68k/stand/boot: kbd.c

Log Message:
Ignore mouse packets to avoid unexpected data handled as keyboard input.

Patch from moveccr.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/luna68k/stand/boot/kbd.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/server/xorg-server/hw

2021-08-21 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Aug 21 15:57:00 UTC 2021

Modified Files:
src/external/mit/xorg/server/xorg-server/hw/netbsd/x68k: Makefile
src/external/mit/xorg/server/xorg-server/hw/sun: Makefile.Xsun

Log Message:
Fix link erorrs on ancient monolithic Xservers after DRI3 was enabled.

https://mail-index.netbsd.org/source-changes/2021/08/19/msg131652.html
> fix dri3 extension building and build it.
>
> needed for amdgpu.

XXX: I wonder if each Xorg server extension can be enabled/disabled
 per ${MACHINE} basis rather than in MI include/dix-config.h header.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 \
src/external/mit/xorg/server/xorg-server/hw/netbsd/x68k/Makefile
cvs rdiff -u -r1.5 -r1.6 \
src/external/mit/xorg/server/xorg-server/hw/sun/Makefile.Xsun

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/xorg-server/hw/netbsd/x68k/Makefile
diff -u src/external/mit/xorg/server/xorg-server/hw/netbsd/x68k/Makefile:1.11 src/external/mit/xorg/server/xorg-server/hw/netbsd/x68k/Makefile:1.12
--- src/external/mit/xorg/server/xorg-server/hw/netbsd/x68k/Makefile:1.11	Mon Mar 22 14:11:02 2021
+++ src/external/mit/xorg/server/xorg-server/hw/netbsd/x68k/Makefile	Sat Aug 21 15:57:00 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.11 2021/03/22 14:11:02 tsutsui Exp $
+#	$NetBSD: Makefile,v 1.12 2021/08/21 15:57:00 tsutsui Exp $
 
 .include 
 
@@ -52,6 +52,7 @@ LDADD+= ${LDADD.dix} \
 	${LDADD.damageext} \
 	${LDADD.miext/damage} \
 	${LDADD.miext/sync} \
+	${LDADD.dri3} \
 	${LDADD.Xi} \
 	-lXfont2 \
 	-lpixman-1 \
@@ -73,6 +74,7 @@ DPADD+= ${LDADD.dix} \
 	${DPADD.damageext} \
 	${DPADD.miext/damage} \
 	${DPADD.miext/sync} \
+	${DPADD.dri3} \
 	${DPADD.Xi} \
 	${LIBXFONT2} \
 	${LIBPIXMAN-1} \

Index: src/external/mit/xorg/server/xorg-server/hw/sun/Makefile.Xsun
diff -u src/external/mit/xorg/server/xorg-server/hw/sun/Makefile.Xsun:1.5 src/external/mit/xorg/server/xorg-server/hw/sun/Makefile.Xsun:1.6
--- src/external/mit/xorg/server/xorg-server/hw/sun/Makefile.Xsun:1.5	Wed Aug  5 15:48:09 2020
+++ src/external/mit/xorg/server/xorg-server/hw/sun/Makefile.Xsun	Sat Aug 21 15:57:00 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.Xsun,v 1.5 2020/08/05 15:48:09 tsutsui Exp $
+#	$NetBSD: Makefile.Xsun,v 1.6 2021/08/21 15:57:00 tsutsui Exp $
 
 .include 
 
@@ -94,6 +94,7 @@ LDADD+= ${LDADD.dix} \
 	${LDADD.damageext} \
 	${LDADD.miext/damage} \
 	${LDADD.miext/sync} \
+	${LDADD.dri3} \
 	${LDADD.Xi} \
 	-lXfont2 \
 	-lpixman-1 \
@@ -114,6 +115,7 @@ DPADD+= ${LDADD.dix} \
 	${DPADD.damageext} \
 	${DPADD.miext/damage} \
 	${DPADD.miext/sync} \
+	${DPADD.dri3} \
 	${DPADD.Xi} \
 	${LIBXFONT2} \
 	${LIBPIXMAN-1} \



CVS commit: src/external/mit/xorg/server/xorg-server/hw

2021-08-21 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Aug 21 15:57:00 UTC 2021

Modified Files:
src/external/mit/xorg/server/xorg-server/hw/netbsd/x68k: Makefile
src/external/mit/xorg/server/xorg-server/hw/sun: Makefile.Xsun

Log Message:
Fix link erorrs on ancient monolithic Xservers after DRI3 was enabled.

https://mail-index.netbsd.org/source-changes/2021/08/19/msg131652.html
> fix dri3 extension building and build it.
>
> needed for amdgpu.

XXX: I wonder if each Xorg server extension can be enabled/disabled
 per ${MACHINE} basis rather than in MI include/dix-config.h header.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 \
src/external/mit/xorg/server/xorg-server/hw/netbsd/x68k/Makefile
cvs rdiff -u -r1.5 -r1.6 \
src/external/mit/xorg/server/xorg-server/hw/sun/Makefile.Xsun

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



Re: CVS commit: src

2021-07-24 Thread Izumi Tsutsui
> Log Message:
> Fix all remaining typos, mainly in comments but also in few definitions and 
> log messages, reported by me in PR kern/54889.
> Also fixed some additional typos in comments, found on review of same files 
> or typos.
 :
> cvs rdiff -u -r1.51 -r1.52 src/sys/arch/sh3/sh3/exception_vector.S
> cvs rdiff -u -r1.83 -r1.84 src/sys/arch/sh3/sh3/pmap.c

---
 #define__PMAP_PTP_PG_N (PAGE_SIZE / sizeof(pt_entry_t))
 #define__PMAP_PTP_INDEX(va)(((va) >> __PMAP_PTP_SHIFT) & 
(__PMAP_PTP_N - 1))
-#define__PMAP_PTP_OFSET(va)((va >> PGSHIFT) & (__PMAP_PTP_PG_N - 
1))
+#define__PMAP_PTP_OFFSET(va)   ((va >> PGSHIFT) & (__PMAP_PTP_PG_N - 
1))
--- 

This "OFSET" seems corresponding to historical MI "PGOFSET" macro defined
in  (though I don't know if the "OFSET" had particular
meanings, other than its strlen).

---
Izumi Tsutsui


Re: CVS commit: src/usr.sbin/sysinst

2020-10-12 Thread Izumi Tsutsui
martin@ wrote:

> Module Name:  src
> Committed By: martin
> Date: Mon Oct 12 14:29:41 UTC 2020
> 
> Modified Files:
>   src/usr.sbin/sysinst: disks.c
> 
> Log Message:
> Remove very strange code that special-cased MSDOS file systems and refused
> to newfs the partition (despite explicit request to do so) if it was
> mountable.
> Accidently carried over from a dim and distant past, before we had
> fsck_newfs.

http://cvsweb.netbsd.org/cgi-bin/cvsweb.cgi/src/distrib/utils/sysinst/Attic/disks.c#rev1.98
http://cvsweb.netbsd.org/cgi-bin/cvsweb.cgi/src/distrib/utils/sysinst/arch/arc/Attic/md.c#rev1.29

IIRC I added it to avoid users from accidentally destroy existing native
Windows partition (for NetBSD/arc that initially required FAT partition).

---
Izumi Tsutsui


Re: CVS commit: [netbsd-9] src/doc

2020-08-17 Thread Izumi Tsutsui
> Module Name:  src
> Committed By: martin
> Date: Mon Aug 17 11:31:07 UTC 2020
> 
> Modified Files:
>   src/doc [netbsd-9]: CHANGES-9.1
> 
> Log Message:
> Tickets #1050 - #1054
> 
> 
> To generate a diff of this commit:
> cvs rdiff -u -r1.1.2.95 -r1.1.2.96 src/doc/CHANGES-9.1

>> +xsrc/external/mit/xorg-server/dist/fb/fb.h  1.3
>> +xsrc/external/mit/xorg-server/dist/fb/fbfill.c  1.2,1.3

This should be only 1.2 (no 1.3 yet).

>> +xsrc/external/mit/xorg-server/dist/fb/fbtile.c  1.1-1.3

Maybe only 1.3 is enough (1.2 was file removal).

>> +xsrc/external/mit/xorg-server/dist/fb/wfbrename.h   1.2
>> +external/mit/xorg/server/xorg-server/fb/Makefile.fb 1.12

---
Izumi Tsutsui


Re: CVS commit: src/external/mit/xorg/server/xorg-server/hw/sun

2020-07-23 Thread Izumi Tsutsui
> Module Name:  src
> Committed By: mrg
> Date: Thu Jul 23 09:59:36 UTC 2020
> 
> Modified Files:
>   src/external/mit/xorg/server/xorg-server/hw/sun: Makefile.Xsun
> 
> Log Message:
> fix build:
> - add .../xorg subdir to the path
> - add dbe and present extensions, both wanted via linkage

This is caused by the following .if clause in bsd.x11.mk:

---
.if !(${MACHINE} == "acorn32"   || \
${MACHINE} == "amiga"   || \
${MACHINE} == "pmax"|| \
${MACHINE} == "sun3"|| \
${MACHINE} == "x68k"|| \
${MACHINE} == "vax")
#   EXT_DEFINES
X11FLAGS.EXTENSION+=-DXF86VIDMODE

X11FLAGS.DIX+=  -DDBE -DXRECORD -DPRESENT
---

Maybe disabling these DIX flags is enough to avoid errors.

I'm not sure what is the intention of the above MACHINE list,
but it should be ${MKXORG_SERVER} == "yes" instead?

> .. but maybe these shouldn't be built?  they're not in sets.

I've already disabled them for sparc and sparc64.
They have been enabled in Makefile.common since initial import..
(to prepare future porting work?)

---
Izumi Tsutsui


Re: CVS commit: src/usr.bin/make

2020-07-19 Thread Izumi Tsutsui
kardel@ wrote:

> nbmake currently fails to build the tree.
> 
> config.status: creating buildmake.sh
>  compile  arch.c
>  compile  buf.c
>  compile  compat.c
>  compile  cond.c
>  compile  dir.c
>  compile  for.c
>  compile  hash.c
>  compile  job.c
>  compile  main.c
>  compile  make.c
>  compile  make_malloc.c
>  compile  meta.c
>  compile  metachar.c
>  compile  parse.c
>  compile  str.c
>  compile  strlist.c
>  compile  suff.c
>  compile  targ.c
>  compile  trace.c
>  compile  util.c
>  compile  var.c
>  compile  lstAppend.c
>  compile  lstAtEnd.c
>  compile  lstAtFront.c
>  compile  lstClose.c
>  compile  lstConcat.c
>  compile  lstDatum.c
>  compile  lstDeQueue.c
>  compile  lstDestroy.c
>  compile  lstDupl.c
>  compile  lstEnQueue.c
>  compile  lstFind.c
>  compile  lstFindFrom.c
>  compile  lstFirst.c
>  compile  lstForEach.c
>  compile  lstForEachFrom.c
>  compile  lstInit.c
>  compile  lstInsert.c
>  compile  lstIsAtEnd.c
>  compile  lstIsEmpty.c
>  compile  lstLast.c
>  compile  lstMember.c
>  compile  lstNext.c
>  compile  lstOpen.c
>  compile  lstPrev.c
>  compile  lstRemove.c
>  compile  lstReplace.c
>  compile  lstSucc.c
> link  nbmake
> ===> MAKECONF file:   /etc/mk.conf
>   objdir  /src/NetBSD/native/src/obj.evbarm/tools
> nbmake: "/src/NetBSD/native/src/share/mk/bsd.nls.mk" line 18: Unknown 
> directive
> nbmake: "/src/NetBSD/native/src/share/mk/bsd.nls.mk" line 19: Unknown 
> directive
> nbmake: Fatal errors encountered -- cannot continue
> ERROR: bomb_getmakevar TOOLDIR: /tmp/nbbuild851/nbmake failed

Also reported:
 https://mail-index.netbsd.org/current-users/2020/07/19/msg039168.html
 https://releng.netbsd.org/builds/HEAD/202007191220Z/
and still broken here.

Could you please fix or revert changes?

Thanks,
---
Izumi Tsutsui


Re: CVS commit: src/sys/arch/mips/mips

2020-06-09 Thread Izumi Tsutsui
ommon/lib/libc/string 
-I/s/cvs/src/sys/lib/libkern/../../../common/lib/libc/arch/mips/string 
-I/s/cvs/src/sys/lib/libkern/../../../common/lib/libc/hash/sha3 
-I/s/cvs/src/sys/external/bsd/libnv/dist -c 
/s/cvs/src/sys/arch/mips/mips/mips_machdep.c -o mips_machdep.o && :
*** Error code 1
---

"#if (MIPS32 + MIPS32R2 + MIPS64 + MIPS64R2) > 0" is necessary?

---
Izumi Tsutsui


Re: CVS commit: src/distrib/common/bootimage

2020-05-29 Thread Izumi Tsutsui
> Makefile.installimage refers to it before including Makefile.bootimage and 
> this test was causing make to throw an error:
> 
>
> https://nxr.netbsd.org/xref/src/distrib/common/bootimage/Makefile.installimage#41
> 
> All other users (i386, amd64) of Makefile.installimage explicitly set 
> USE_MBR=yes. That's why it wasn't an issue before now.

Ah, I see.  Sorry for a stupid question.

---
Izumi Tsutsui


Re: CVS commit: src/distrib/common/bootimage

2020-05-28 Thread Izumi Tsutsui
> Modified Files:
>   src/distrib/common/bootimage: Makefile.installimage
> 
> Log Message:
> Default USE_MBR to no

Is this necessary?

src/distrib/common/bootimage/Makefile.bootimage (included from
Makefile.installimage) already has "USE_MBR?= no" line.

---
Izumi Tsutsui


Re: CVS commit: src/sys/external/bsd/drm2/dist/drm/radeon

2020-04-27 Thread Izumi Tsutsui
> Module Name:  src
> Committed By: tsutsui
> Date: Mon Apr 27 16:57:31 UTC 2020
> 
> Modified Files:
>   src/sys/external/bsd/drm2/dist/drm/radeon: radeon_ttm.c
> 
> Log Message:
> Fix possible bus_dmamap_load(9) leak.  PR/55127
> 
> "Looks good to me" from riastradh@.
> Note it was also commented "that code path is likely to be reached"

Mis-quoted, it should be "not likely".

> so maybe pullups are not necessary.

---
Izumi Tsutsui


Re: CVS commit: src/distrib/utils/libhack

2020-04-17 Thread Izumi Tsutsui
jdolecek@ wrote:

> Module Name:  src
> Committed By: jdolecek
> Date: Fri Apr 17 14:55:24 UTC 2020
> 
> Modified Files:
>   src/distrib/utils/libhack: Makefile.inc
> 
> Log Message:
> include aligned_alloc(3), now needed for newfs and fsck_ffs

Could you consider to disable such extra futures in SMALL case,
i.e. in src/distrib/utils/x_newfs and src/distrib/utils/x_fsck_ffs,
to avoid another overflow on several install media?

Thanks,
---
Izumi Tsutsui


Re: CVS commit: src/sys/dev/pckbport

2020-02-26 Thread Izumi Tsutsui
> Modified Files:
>   src/sys/dev/pckbport: synaptics.c
> 
> Log Message:
> Messages in pms_synaptics_input() should not start with "pms_input"
> 
> Use "pms_synaptics_input" instead.

Maybe it's better to use ("%s", __func__) C99 predefined identifier.

---
Izumi Tsutsui


Re: MAX_PAGE_SIZE for m68k (Re: CVScommit:src/sys/arch/arm/include/arm32)

2020-01-15 Thread Izumi Tsutsui
Override the PAGE_* definitions to be compile-time constants.
+ * Use common m68k definitions to define PAGE_SIZE and related constants.
  */
-#definePAGE_SHIFT  PGSHIFT
-#definePAGE_SIZE   (1 << PAGE_SHIFT)
-#definePAGE_MASK   (PAGE_SIZE - 1)
+#include 
 
 /*
  * USRSTACK is the top (end) of the user stack.
Index: sys/arch/mvme68k/include/vmparam.h
===
RCS file: /cvsroot/src/sys/arch/mvme68k/include/vmparam.h,v
retrieving revision 1.37
diff -u -p -d -r1.37 vmparam.h
--- sys/arch/mvme68k/include/vmparam.h  28 Jun 2019 15:17:44 -  1.37
+++ sys/arch/mvme68k/include/vmparam.h  15 Jan 2020 17:13:02 -
@@ -46,13 +46,9 @@
  */
 
 /*
- * hp300 pmap derived m68k ports can use 4K or 8K pages.
- * The page size is specified by PGSHIFT in .
- * Override the PAGE_* definitions to be compile-time constants.
+ * Use common m68k definitions to define PAGE_SIZE and related constants.
  */
-#definePAGE_SHIFT  PGSHIFT
-#definePAGE_SIZE   (1 << PAGE_SHIFT)
-#definePAGE_MASK   (PAGE_SIZE - 1)
+#include 
 
 /*
  * USRSTACK is the top (end) of the user stack.
Index: sys/arch/news68k/include/vmparam.h
===
RCS file: /cvsroot/src/sys/arch/news68k/include/vmparam.h,v
retrieving revision 1.22
diff -u -p -d -r1.22 vmparam.h
--- sys/arch/news68k/include/vmparam.h  28 Jun 2019 15:17:44 -  1.22
+++ sys/arch/news68k/include/vmparam.h  15 Jan 2020 17:13:02 -
@@ -46,13 +46,9 @@
  */
 
 /*
- * hp300 pmap derived m68k ports can use 4K or 8K pages.
- * The page size is specified by PGSHIFT in .
- * Override the PAGE_* definitions to be compile-time constants.
+ * Use common m68k definitions to define PAGE_SIZE and related constants.
  */
-#definePAGE_SHIFT  PGSHIFT
-#definePAGE_SIZE   (1 << PAGE_SHIFT)
-#definePAGE_MASK   (PAGE_SIZE - 1)
+#include 
 
 /*
  * USRSTACK is the top (end) of the user stack.
Index: sys/arch/next68k/include/vmparam.h
===
RCS file: /cvsroot/src/sys/arch/next68k/include/vmparam.h,v
retrieving revision 1.26
diff -u -p -d -r1.26 vmparam.h
--- sys/arch/next68k/include/vmparam.h  28 Jun 2019 15:17:44 -  1.26
+++ sys/arch/next68k/include/vmparam.h  15 Jan 2020 17:13:02 -
@@ -53,13 +53,9 @@
  */
 
 /*
- * hp300 pmap derived m68k ports can use 4K or 8K pages.
- * The page size is specified by PGSHIFT in .
- * Override the PAGE_* definitions to be compile-time constants.
+ * Use common m68k definitions to define PAGE_SIZE and related constants.
  */
-#definePAGE_SHIFT  PGSHIFT
-#definePAGE_SIZE   (1 << PAGE_SHIFT)
-#definePAGE_MASK   (PAGE_SIZE - 1)
+#include 
 
 /*
  * USRSTACK is the top (end) of the user stack.
Index: sys/arch/sun3/include/vmparam.h
===
RCS file: /cvsroot/src/sys/arch/sun3/include/vmparam.h,v
retrieving revision 1.37
diff -u -p -d -r1.37 vmparam.h
--- sys/arch/sun3/include/vmparam.h 7 Jan 2013 16:58:09 -   1.37
+++ sys/arch/sun3/include/vmparam.h 15 Jan 2020 17:13:03 -
@@ -32,12 +32,9 @@
 #define __USE_TOPDOWN_VM
 
 /*
- * We use 8K pages on both the sun3 and sun3x.  Override PAGE_*
- * to be compile-time constants.
+ * Use common m68k definitions to define PAGE_SIZE and related constants.
  */
-#definePAGE_SHIFT  13
-#definePAGE_SIZE   (1 << PAGE_SHIFT)
-#definePAGE_MASK   (PAGE_SIZE - 1)
+#include 
 
 #defineUSRSTACKkernbase/* for modules */
 #defineUSRSTACK3   KERNBASE3   /* for asm not in modules */
Index: sys/arch/x68k/include/vmparam.h
===
RCS file: /cvsroot/src/sys/arch/x68k/include/vmparam.h,v
retrieving revision 1.39
diff -u -p -d -r1.39 vmparam.h
--- sys/arch/x68k/include/vmparam.h 28 Jun 2019 15:17:44 -  1.39
+++ sys/arch/x68k/include/vmparam.h 15 Jan 2020 17:13:03 -
@@ -46,13 +46,9 @@
  */
 
 /*
- * hp300 pmap derived m68k ports can use 4K or 8K pages.
- * The page size is specified by PGSHIFT in .
- * Override the PAGE_* definitions to be compile-time constants.
+ * Use common m68k definitions to define PAGE_SIZE and related constants.
  */
-#definePAGE_SHIFT  PGSHIFT
-#definePAGE_SIZE   (1 << PAGE_SHIFT)
-#definePAGE_MASK   (PAGE_SIZE - 1)
+#include 
 
 /*
  * USRSTACK is the top (end) of the user stack.

---
Izumi Tsutsui


Re: MAX_PAGE_SIZE for m68k (Re: CVS commit:src/sys/arch/arm/include/arm32)

2020-01-14 Thread Izumi Tsutsui
> > The arm PAGE_SIZE_{MIN,MAX} should go away after nick eliminates the
> > need for the 8K pages. This leaves us with m68k to deal with...
> > Do modules work on m68k?

Yes, at least on NetBSD/news68k 9.0_RC1:
(though something wrong in modunload(8))
---
# uname -a
NetBSD  9.0_RC1 NetBSD 9.0_RC1 (GENERIC) #0: Wed Nov 27 16:14:52 UTC 2019  
mkre...@mkrepro.netbsd.org:/usr/src/sys/arch/news68k/compile/GENERIC news68k
# modstat | grep ext2fs
# modload ext2fs
# modstat | grep ext2fs
ext2fs  vfs  filesys  -0   47856 ufs
# dd if=/dev/zero of=/tmp/img bs=1m count=1
1+0 records in
1+0 records out
1048576 bytes transferred in 1.260 secs (832203 bytes/sec)
# vnconfig vnd0 /tmp/img
 newfs_ext2fs -I /dev/rvnd0c
/dev/rvnd0c: 1.0MB (2048 sectors) block size 1024, fragment size 1024
using 1 block groups of 8.0MB, 8192 blks, 128 inodes.
super-block backups (for fsck_ext2fs -b #) at:
# mount_ext2fs /dev/vnd0a /mnt
# mount 
/dev/sd0a on / type ffs (log, local)
/dev/sd0g on /usr type ffs (log, local)
/dev/vnd0a on /mnt type ext2fs (local)
# umount /mnt
# modunload ext2fs
# mount_ext2fs /dev/vnd0a /mnt
# umount /mnt
# modunload ext2fs
[ 853.1800080] WARNING: module error: module `ext2fs' not found
modunload: ext2fs: No such file or directory
# mount_ext2fs /dev/vnd0a /mnt
# mount
/dev/sd0a on / type ffs (log, local)
/dev/sd0g on /usr type ffs (log, local)
/dev/vnd0a on /mnt type ext2fs (local)
# ls -l /mnt
total 12
drwx--  2 root  wheel  12288 Jan 14 16:10 lost+found
# 
---

Note there is something wrong around ksyms(4) on NetBSD/sun3 9.0_RC1...
---
# uname -a
NetBSD  9.0_RC1 NetBSD 9.0_RC1 (MODULAR) #0: Tue Jan 14 23:20:20 JST 2020  
tsutsui@mirage:/s/netbsd-9/src/sys/arch/sun3/compile/MODULAR sun3
# modload ext2fs
[  50.9300220] kobj_checksyms, 988: [ext2fs]: linker error: symbol `memcpy' not 
found
[  50.9700220] kobj_checksyms, 988: [ext2fs]: linker error: symbol `memcmp' not 
found
[  51.0200220] WARNING: module error: unable to affix module `ext2fs', error 8
modload: ext2fs: Exec format error
# savecore
savecore: (null): _version not in namelist
# 
---
(IIRC it worked when I tweaked symbols to share module binaries
 between sun3 and sun3x...)

> > Should modules be shared between kernels with
> > different page sizes? Then perhaps we don't need a new constant?
> 
> On m68k, I think the following two statements are true:
> 
> a) The platform should use a constant PAGE_SIZE to the extent possible
> because it's a slow platform.

Yes, and this is already true.

> b) Modules should be built such that they can use a non-fixed PAGE_SIZE.

No, this is not necessary, because modules are built for each $MACHINE
and (a) each $MACHINE has fixed PAGE_SIZE.

> But (b) also requires that all of the OTHER non-same constants on m68k
> are avoided (take a closer look at  for example).
> Those probably should be properly hidden from module builds so that
> we can at least *catch* such cases.

(b) is not necessary, so it's simply okay to have a macro that represents
"maximum page size for the ${MACHINE_ARCH}" for jemalloc(3), isn't it?

---
Izumi Tsutsui


Re: MAX_PAGE_SIZE for m68k (Re: CVS commit: src/sys/arch/arm/include/arm32)

2020-01-13 Thread Izumi Tsutsui
christos@ wrote:

> >Now I get the following erro during local tests of
> >"build.sh -U -m hp300 release" on NetBSD/i386 9.0_RC1 host:
> >
> >---
> >#create  compat_util/compat_exec.d
 :
> >In file included from /s/cvs/src/sys/sys/param.h:149:0,
> > from /s/cvs/src/sys/compat/common/compat_exec.c:41:
> >./m68k/pmap_motorola.h:165:5: error: operator '*' has no left operand
> > #if PAGE_SIZE == 8192 /* NBPG / (SG4_LEV1SIZE * sizeof(st_entry_t)) */
> > ^
> >nbmkdep: compile failed.
> >*** [compat_exec.d] Error code 1
> 
> try cc -E?

It turns out the problem is more complicated.

 has the following definitions:

https://nxr.netbsd.org/xref/src/sys/uvm/uvm_param.h?r=1.38#135
---
135  * If MIN_PAGE_SIZE and MAX_PAGE_SIZE are not equal, then we must use
136  * non-constant PAGE_SIZE, et al for LKMs.
137  */
138 #if (MIN_PAGE_SIZE != MAX_PAGE_SIZE)
139 #define __uvmexp_pagesize
140 #if defined(_LKM) || defined(_MODULE)
141 #undef PAGE_SIZE
142 #undef PAGE_MASK
143 #undef PAGE_SHIFT
144 #endif
145 #endif
146 
147 /*
148  * Now provide PAGE_SIZE, PAGE_MASK, and PAGE_SHIFT if we do not
149  * have ones that are compile-time constants.
150  */
151 #if !defined(PAGE_SIZE)
152 extern const int *const uvmexp_pagesize;
153 extern const int *const uvmexp_pagemask;
154 extern const int *const uvmexp_pageshift;
155 #define PAGE_SIZE   (*uvmexp_pagesize)  /* size of page */
156 #define PAGE_MASK   (*uvmexp_pagemask)  /* size of page - 1 */
157 #define PAGE_SHIFT  (*uvmexp_pageshift) /* bits to shift for 
pages */
158 #endif /* PAGE_SIZE */
---

I.e.  assumes PAGE_SIZE is not compile time constant
for MODULEs if (MIN_PAGE_SIZE != MAX_PAGE_SIZE).

Probably this is the same reason of recent arm build failures:
 https://releng.netbsd.org/builds/HEAD/202001130720Z/
 https://releng.netbsd.org/builds/HEAD/202001130720Z/evbarm-earm.build.failed
---
/tmp/genassym.Lq8h9d/assym.c:57:1: error: asm operand 0 probably doesn't match 
constraints [-Werror]
 __asm("XYZZY VM_MIN_ADDRESS %0" : : "n" (VM_MIN_ADDRESS));
 ^
/tmp/genassym.Lq8h9d/assym.c:58:1: error: asm operand 0 probably doesn't match 
constraints [-Werror]
 __asm("XYZZY VM_MAXUSER_ADDRESS %0" : : "n" (VM_MAXUSER_ADDRESS));
 ^
/tmp/genassym.Lq8h9d/assym.c:97:1: error: asm operand 0 probably doesn't match 
constraints [-Werror]
 __asm("XYZZY PAGE_MASK %0" : : "n" (PAGE_MASK));
 ^
/tmp/genassym.Lq8h9d/assym.c:98:1: error: asm operand 0 probably doesn't match 
constraints [-Werror]
 __asm("XYZZY PAGE_SIZE %0" : : "n" (PAGE_SIZE));
 ^
---

Should we prepare independent constant for
"possible pagesize value among different MACHINE with the same MACHINE_ARCH"
for jemalloc(3)?

---
Izumi Tsutsui


MAX_PAGE_SIZE for m68k (Re: CVS commit: src/sys/arch/arm/include/arm32)

2020-01-13 Thread Izumi Tsutsui
christos@ wrote:

> LGTM too.

> >> thorpej@ wrote:
 :
> >> How about the attached diff? (untested, just for review)
> > 
> > This looks good to me.

Now I get the following erro during local tests of
"build.sh -U -m hp300 release" on NetBSD/i386 9.0_RC1 host:

---
#create  compat_util/compat_exec.d
CC=/s/cvs/src/obj.hp300/tooldir.NetBSD-9.0_RC1-i386/bin/m68k--netbsdelf-gcc 
/s/cvs/src/obj.hp300/tooldir.NetBSD-9.0_RC1-i386/bin/nbmkdep -f 
compat_exec.d.tmp  --   -std=gnu99   -I/s/cvs/src/common/include -DDIAGNOSTIC 
--sysroot=/s/cvs/src/obj.hp300/destdir.hp300 -I/s/cvs/src/common/include 
-DDIAGNOSTIC -nostdinc -I. -I/s/cvs/src/sys/modules/compat_util -isystem 
/s/cvs/src/sys -isystem /s/cvs/src/sys/arch -isystem 
/s/cvs/src/sys/../common/include -D_KERNEL -D_LKM -D_MODULE 
-DSYSCTL_INCLUDE_DESCR /s/cvs/src/sys/compat/common/compat_exec.c &&  mv -f 
compat_exec.d.tmp compat_exec.d
In file included from /s/cvs/src/sys/sys/param.h:149:0,
 from /s/cvs/src/sys/compat/common/compat_exec.c:41:
./m68k/pmap_motorola.h:165:5: error: operator '*' has no left operand
 #if PAGE_SIZE == 8192 /* NBPG / (SG4_LEV1SIZE * sizeof(st_entry_t)) */
 ^
nbmkdep: compile failed.
*** [compat_exec.d] Error code 1

---

I'm not sure why my  change causes this error,
but I also wonder if we should use "PGSHIFT == 13" rather than
"PAGE_SIZE == 8192" in ..

---
Izumi Tsutsui


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

2020-01-11 Thread Izumi Tsutsui
PAGE_SIZE - 1)
+#include 
 
 /*
  * USRSTACK is the top (end) of the user stack.
Index: next68k/include/vmparam.h
===
RCS file: /cvsroot/src/sys/arch/next68k/include/vmparam.h,v
retrieving revision 1.26
diff -u -p -d -r1.26 vmparam.h
--- next68k/include/vmparam.h   28 Jun 2019 15:17:44 -  1.26
+++ next68k/include/vmparam.h   12 Jan 2020 06:29:56 -
@@ -53,13 +53,9 @@
  */
 
 /*
- * hp300 pmap derived m68k ports can use 4K or 8K pages.
- * The page size is specified by PGSHIFT in .
- * Override the PAGE_* definitions to be compile-time constants.
+ * Use common m68k definitions to define PAGE_SIZE and related constants.
  */
-#definePAGE_SHIFT  PGSHIFT
-#definePAGE_SIZE   (1 << PAGE_SHIFT)
-#definePAGE_MASK   (PAGE_SIZE - 1)
+#include 
 
 /*
  * USRSTACK is the top (end) of the user stack.
Index: sun3/include/vmparam.h
===
RCS file: /cvsroot/src/sys/arch/sun3/include/vmparam.h,v
retrieving revision 1.37
diff -u -p -d -r1.37 vmparam.h
--- sun3/include/vmparam.h  7 Jan 2013 16:58:09 -   1.37
+++ sun3/include/vmparam.h  12 Jan 2020 06:29:56 -
@@ -32,12 +32,9 @@
 #define __USE_TOPDOWN_VM
 
 /*
- * We use 8K pages on both the sun3 and sun3x.  Override PAGE_*
- * to be compile-time constants.
+ * Use common m68k definitions to define PAGE_SIZE and related constants.
  */
-#definePAGE_SHIFT  13
-#definePAGE_SIZE   (1 << PAGE_SHIFT)
-#definePAGE_MASK   (PAGE_SIZE - 1)
+#include 
 
 #defineUSRSTACKkernbase/* for modules */
 #defineUSRSTACK3   KERNBASE3   /* for asm not in modules */
Index: x68k/include/vmparam.h
===
RCS file: /cvsroot/src/sys/arch/x68k/include/vmparam.h,v
retrieving revision 1.39
diff -u -p -d -r1.39 vmparam.h
--- x68k/include/vmparam.h  28 Jun 2019 15:17:44 -  1.39
+++ x68k/include/vmparam.h  12 Jan 2020 06:29:56 -
@@ -46,13 +46,9 @@
  */
 
 /*
- * hp300 pmap derived m68k ports can use 4K or 8K pages.
- * The page size is specified by PGSHIFT in .
- * Override the PAGE_* definitions to be compile-time constants.
+ * Use common m68k definitions to define PAGE_SIZE and related constants.
  */
-#definePAGE_SHIFT  PGSHIFT
-#definePAGE_SIZE   (1 << PAGE_SHIFT)
-#definePAGE_MASK   (PAGE_SIZE - 1)
+#include 
 
 /*
  * USRSTACK is the top (end) of the user stack.

---
Izumi Tsutsui


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

2020-01-11 Thread Izumi Tsutsui
> >m68k also needs this? (currently no common  though)
> 
> Good catch. Yup, looks like it:
 :
> 
> #define   MIN_PAGE_SHIFT  11  /* sun2 */
> #define   MAX_PAGE_SHIFT  13  /* amiga,atari,sun3 */
> #define   MIN_PAGE_SIZE   (1 << MIN_PAGE_SHIFT)
> #define   MAX_PAGE_SIZE   (1 << MAX_PAGE_SHIFT)

sun2 is different MACHINE_ARCH (m68000) from other m68k ports,
so MIN_PAGE_SHIFT should be 12.

> Should I take care of it or can you?

I just wonder which header file these definitions should be in.
Is  ok?

PGSHIFT is defined in  and
PAGE_SHIFT and PAGE_SIZE is in ,
but there is no common .

---
Izumi Tsutsui


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

2020-01-11 Thread Izumi Tsutsui
> Module Name:  src
> Committed By: christos
> Date: Sat Jan 11 19:06:35 UTC 2020
> 
> Modified Files:
>   src/sys/arch/arm/include/arm32: vmparam.h
> 
> Log Message:
> Define the min and max page size supported for the benefit of jemalloc
> 
> 
> To generate a diff of this commit:
> cvs rdiff -u -r1.45 -r1.46 src/sys/arch/arm/include/arm32/vmparam.h

--- src/sys/arch/arm/include/arm32/vmparam.h:1.45   Wed Jun 19 09:54:42 2019
+++ src/sys/arch/arm/include/arm32/vmparam.hSat Jan 11 19:06:34 2020
@@ -84,6 +84,11 @@
 #definePAGE_SIZE   (1 << PAGE_SHIFT)
 #definePAGE_MASK   (PAGE_SIZE - 1)
 
+#defineMIN_PAGE_SHIFT  12  /* normal */
+#defineMAX_PAGE_SHIFT  13  /* _ARM_ARCH_6 */
+#defineMIN_PAGE_SIZE   (1 << MIN_PAGE_SHIFT)
+#defineMAX_PAGE_SIZE   (1 << MAX_PAGE_SHIFT)
+
 /*
  * Mach derived constants
  */

---

m68k also needs this? (currently no common  though)

---
Izumi Tsutsui


Re: CVS commit: src/sys/arch/zaurus/conf

2020-01-05 Thread Izumi Tsutsui
> >> I don't see how as sys/arch/zaurus/conf/INSTALL doesn't define DDB.
> >
> > On zaurus GENERIC also has a size restriction (due to bootloader).
> 
> Yes, I understand that. What I don't understand is how my
> sys/arch/arm/conf/Makefile.arm change affects the zaurus INSTALL kernel
> size because INSTALL specifically disables DDB and my patch is
> conditional on DDB

As martin wrote, the problem is not INSTALL but GENERIC
because zaurus GENERIC is large (~5MB) enough.

> My patch allows COPTS to be overridden as
> 
> 
> http://src.illumos.org/source/xref/netbsd-src/sys/conf/Makefile.kern.inc#69
> 
> has
> 
> 69 DEFCOPTS?= -O2
> 70 COPTS?=${DEFCOPTS}
> 
> which I believe allows COPTS to be overridden by
> 
> makeoptions COPTS="..."

If it's users' responsibility to explicitly add "-mapcs-frame" in COPTS 
when they want to build a kernel with both COPTS="-Os" and options DDB,
it's okay for me.  (I'm afraid zaurus GENERIC needs -Os in near future)

---
Izumi Tsutsui


Re: CVS commit: src/sys/arch/zaurus/conf

2020-01-04 Thread Izumi Tsutsui
> > The problem is caused by sys/arch/arm/conf/Makefile.arm.
> > It defines "COPTS+= -mapcs-frame" in recent rev 1.52
> >   
> > http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/arch/arm/conf/Makefile.arm#rev1.52
> > but MI sys/conf/Makefile.kern.inc defines COPTS+=-O2
> > only if COPTS is empty.
> 
> I don't see how as sys/arch/zaurus/conf/INSTALL doesn't define DDB.

On zaurus GENERIC also has a size restriction (due to bootloader).

> > This affects not only zaurus but all arm ports?
> 
> Maybe this patch is better?

I wonder if it will work as expected if COPTS+="-Os" is
already specified with options DDB, if -mapcs-frame
is mandatory for DDB. But if -fno-omit-frame-pointer
in Makefile.amd64 may have the similar problem,
it's also okay for arm, IMO.

Maybe it's less probematic to add a new option (COPTS_MD etc.)
and add it to COPTS after including Makefile.kern.inc,
i.e. in "(11) Appending make options." in Makefile.arm?

---
Izumi Tsutsui


Re: CVS commit: src/sys/arch/zaurus/conf

2020-01-03 Thread Izumi Tsutsui
I wrote:
> > The missing COPTS was an accident or fallout from some other changes?
> 
> Isn't it specified in -current?

The problem is caused by sys/arch/arm/conf/Makefile.arm.
It defines "COPTS+= -mapcs-frame" in recent rev 1.52
 http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/arch/arm/conf/Makefile.arm#rev1.52
but MI sys/conf/Makefile.kern.inc defines COPTS+=-O2
only if COPTS is empty.
 
This affects not only zaurus but all arm ports?

---
Index: sys/arch/arm/conf/Makefile.arm
===
RCS file: /cvsroot/src/sys/arch/arm/conf/Makefile.arm,v
retrieving revision 1.52
diff -u -p -d -r1.52 Makefile.arm
--- sys/arch/arm/conf/Makefile.arm  2 Jan 2020 14:33:55 -   1.52
+++ sys/arch/arm/conf/Makefile.arm  3 Jan 2020 18:35:36 -
@@ -78,7 +78,7 @@ CFLAGS+=  -mno-unaligned-access
 
 OPT_DDB=   %DDB%
 .if !empty(OPT_DDB) && ${HAVE_GCC:U0} > 0
-COPTS+=-mapcs-frame
+CFLAGS+=   -mapcs-frame
 .endif
 
 ##

---
Izumi Tsutsui
 


Re: CVS commit: src/sys/arch/zaurus/conf

2020-01-03 Thread Izumi Tsutsui
> > - zbsdmod.o has 5MB buffers to store a copied kernel binary
> > - zbsdmod.o reads a kernel from the 5MB buffer and loads sections
> >   into the target addresses
> >  
> > https://nxr.netbsd.org/xref/src/sys/arch/zaurus/stand/zbsdmod/zbsdmod.c?r=1.12#94
> 
> Ah ok - thanks for explanation. So the dropping of ctf sections makes sense.

Yes.

> The missing COPTS was an accident or fallout from some other changes?

Isn't it specified in -current?
I think -O2 comes from MI src/sys/conf/Makefile.kern.inc:
 https://nxr.netbsd.org/xref/src/sys/conf/Makefile.kern.inc?r=1.268#69

On netbsd-9, GENERIC build uses -O2:
---
% /s/netbsd-9/src/obj.zaurus/tooldir.NetBSD-9.0_RC1-i386/bin/nbmake-zaurus 
init_main.o
#   compile  GENERIC/init_main.o
/s/netbsd-9/src/obj.zaurus/tooldir.NetBSD-9.0_RC1-i386/bin/arm--netbsdelf-eabi-gcc
 -mfloat-abi=soft -ffreestanding -fno-zero-initialized-in-bss 
-fno-delete-null-pointer-checks -O2 -msoft-float -fno-strict-aliasing 
-fno-common -std=gnu99 -Werror -Wall -Wno-main -Wno-format-zero-length 
-Wpointer-arith -Wmissing-prototypes -Wstrict-prototypes -Wold-style-definition 
-Wswitch -Wshadow -Wcast-qual -Wwrite-strings -Wno-unreachable-code 
-Wno-pointer-sign -Wno-attributes -Wno-sign-compare -mcpu=xscale 
--sysroot=/s/netbsd-9/src/obj.zaurus/destdir.zaurus -Dzaurus -I. 
-I../../../../external/bsd/libnv/dist -I../../../../../common/lib/libx86emu 
-I../../../../../common/lib/libc/misc -I../../../../../common/include 
-I../../../../arch -I../../../.. -nostdinc -DCOMPAT_UTILS -DCOMPAT_44 
-DDIAGNOSTIC -DW100_LCD_WRITETHROUGH -D_KERNEL -D_KERNEL_OPT -std=gnu99 
-I../../../../lib/libkern/../../../common/lib/libc/quad 
-I../../../../lib/libkern/../../../common/lib/libc/string 
-I../../../../lib/libker!
 n/../../../common/lib/libc/arch/arm/string -c ../../../../kern/init_main.c -o 
init_main.o
/s/netbsd-9/src/obj.zaurus/tooldir.NetBSD-9.0_RC1-i386/bin/nbctfconvert -g -L 
VERSION init_main.o
---

zaurus/conf/INSTALL has COPTS="-Os" in its config, though.

---
Izumi Tsutsui


Re: CVS commit: src/sys/arch/zaurus/conf

2020-01-03 Thread Izumi Tsutsui
martin@ wrote:

> Module Name:  src
> Committed By: martin
> Date: Fri Jan  3 10:01:07 UTC 2020
> 
> Modified Files:
>   src/sys/arch/zaurus/conf: Makefile.zaurus.inc ldscript.zaurus
> 
> Log Message:
> Drop CTF sections from this size restricted kernel (especially as the
> size check is on the total size of the binary, not any content/sections -
> is this a bug?)

No, it (checking the total size of the binary) is by design.

- a kernel binary is loaded by a Linux kernel module (named zbsdmod.o)
  on the native Zaurus Linux
- to load a NetBSD kernel, the whole binary is copied into /proc/zboot
  node, created by the zbsdmod.o module
- zbsdmod.o has 5MB buffers to store a copied kernel binary
- zbsdmod.o reads a kernel from the 5MB buffer and loads sections
  into the target addresses
 
https://nxr.netbsd.org/xref/src/sys/arch/zaurus/stand/zbsdmod/zbsdmod.c?r=1.12#94

---
Izumi Tsutsui


Re: CVS commit: src/usr.sbin/postinstall

2020-01-02 Thread Izumi Tsutsui
(Cc'ed to source-changed-d@, not source-changes@)
m...@eterna.com.au wrote:

> "Izumi Tsutsui" writes:
> > Module Name:src
> > Committed By:   tsutsui
> > Date:   Sun Dec 29 22:19:13 UTC 2019
> > 
> > Modified Files:
> > src/usr.sbin/postinstall: postinstall.in
> > 
> > Log Message:
> > Make sure rc, rc.subr, and rc.shutdown are properly updated.
> > 
> > Currently there is no info which rc* files should be updated
> > or not on upgrade (at least rc.conf and rc.local shouldn't),
> > so put back an explicit list in the postinstall script.
> > "Go for it" by christos@ in PR/54741.
> > 
> > Should be pulled up to netbsd-9.
> 
> thanks for making this less bad.
> 
> i wonder if we can have some system in place where we will
> only update these files if we can check they're unmodified,
> eg, each file would have some hash(es) of known versions,
> and if they're found not to match, fail the 'fix' operation
> and allow the user to update manually.  (this will make it
> trip every time, unfortunately, but this seems less bad 
> than overriding local changes - i've been known to change
> rc and rc.subr for various reasons..)

Maybe we should define which files can be configurable or not
in rc(8) man page?

The visible problem is checkyesnox() in rc.subr was added
in netbsd-8 and src/etc/rc.d/network requires checkyesnox().
I.e. rc.d scripts and rc.subr need to be sync'ed on upgrade.

Anyway maybe we need another PR for this.
---
Izumi Tsutsui


Re: CVS commit: src/distrib/notes/common

2019-12-02 Thread Izumi Tsutsui
> Module Name:  src
> Committed By: uwe
> Date: Mon Dec  2 17:28:36 UTC 2019
> 
> Modified Files:
>   src/distrib/notes/common: legal.common
> 
> Log Message:
> Drop entries for "K. Kobayashi" and "K. Kobayashi and H. Shimokawa"
> that are no longer referenced in tree.

http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/dev/ieee1394/fwohci.c?rev=1.144=text/x-cvsweb-markup
 etc.

---
Izumi Tsutsui


Re: CVS commit: src/distrib/notes/common

2019-12-02 Thread Izumi Tsutsui
> Module Name:  src
> Committed By: uwe
> Date: Mon Dec  2 20:57:17 UTC 2019
> 
> Modified Files:
>   src/distrib/notes/common: legal.common
> 
> Log Message:
> Drop the entry for Yasushi Yamasaki.  Nothing in the tree requires it.

X68k Xserver sources do:
 
http://cvsweb.netbsd.org/bsdweb.cgi/xsrc/external/mit/xorg-server/dist/hw/netbsd/x68k/x68kFb.c?rev=1.2=text/x-cvsweb-markup

---
Izumi Tsutsui


CVS commit: src/sys/arch/zaurus

2019-11-13 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Wed Nov 13 17:59:57 UTC 2019

Modified Files:
src/sys/arch/zaurus/conf: GENERIC INSTALL
src/sys/arch/zaurus/stand/zbsdmod: zbsdmod.c
src/sys/arch/zaurus/zaurus: machdep.c

Log Message:
Make zaurus kernels use symbol tables loaded by the bootloader.

Now COPY_SYMTAB is no longer necessary and it saves ~500kbytes of
GENERIC, so re-enable options DDB (i.e. revert GENERIC rev 1.85).

Also fix zbsdmod.o (a kernel loader for Zaurus Linux) to load symbols
at a proper address as the MI sys/lib/libsa/loadfile_elf32.c does.

No particular comment on port-zaurus@:
 https://mail-index.netbsd.org/port-zaurus/2019/11/11/msg86.html

Note zbsdmod.c (derived from OpenBSD/zaurus) assumed that the loaded
kernels had "esym" variable at the top of its data section and
implicitly overwrote it with the address of loaded symbol tables.
OpenBSD/zaurus kernels used the esym value written by the zbsdmod.o
to initialize ksyms(4) on startup, but we will avoid such implicit
MD interface between the bootloader and kernels (though we don't
bother to add a symbol address value into bootinfo but just assume
symbols are loaded at end[] of a loaded kernel, as per the MI
libsa loadfile() implementation).

Worth to pullup to both netbsd-8 and netbsd-9.


To generate a diff of this commit:
cvs rdiff -u -r1.88 -r1.89 src/sys/arch/zaurus/conf/GENERIC
cvs rdiff -u -r1.39 -r1.40 src/sys/arch/zaurus/conf/INSTALL
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/zaurus/stand/zbsdmod/zbsdmod.c
cvs rdiff -u -r1.44 -r1.45 src/sys/arch/zaurus/zaurus/machdep.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/zaurus

2019-11-13 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Wed Nov 13 17:59:57 UTC 2019

Modified Files:
src/sys/arch/zaurus/conf: GENERIC INSTALL
src/sys/arch/zaurus/stand/zbsdmod: zbsdmod.c
src/sys/arch/zaurus/zaurus: machdep.c

Log Message:
Make zaurus kernels use symbol tables loaded by the bootloader.

Now COPY_SYMTAB is no longer necessary and it saves ~500kbytes of
GENERIC, so re-enable options DDB (i.e. revert GENERIC rev 1.85).

Also fix zbsdmod.o (a kernel loader for Zaurus Linux) to load symbols
at a proper address as the MI sys/lib/libsa/loadfile_elf32.c does.

No particular comment on port-zaurus@:
 https://mail-index.netbsd.org/port-zaurus/2019/11/11/msg86.html

Note zbsdmod.c (derived from OpenBSD/zaurus) assumed that the loaded
kernels had "esym" variable at the top of its data section and
implicitly overwrote it with the address of loaded symbol tables.
OpenBSD/zaurus kernels used the esym value written by the zbsdmod.o
to initialize ksyms(4) on startup, but we will avoid such implicit
MD interface between the bootloader and kernels (though we don't
bother to add a symbol address value into bootinfo but just assume
symbols are loaded at end[] of a loaded kernel, as per the MI
libsa loadfile() implementation).

Worth to pullup to both netbsd-8 and netbsd-9.


To generate a diff of this commit:
cvs rdiff -u -r1.88 -r1.89 src/sys/arch/zaurus/conf/GENERIC
cvs rdiff -u -r1.39 -r1.40 src/sys/arch/zaurus/conf/INSTALL
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/zaurus/stand/zbsdmod/zbsdmod.c
cvs rdiff -u -r1.44 -r1.45 src/sys/arch/zaurus/zaurus/machdep.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/zaurus/conf/GENERIC
diff -u src/sys/arch/zaurus/conf/GENERIC:1.88 src/sys/arch/zaurus/conf/GENERIC:1.89
--- src/sys/arch/zaurus/conf/GENERIC:1.88	Sat Nov  2 23:13:00 2019
+++ src/sys/arch/zaurus/conf/GENERIC	Wed Nov 13 17:59:56 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: GENERIC,v 1.88 2019/11/02 23:13:00 tsutsui Exp $
+#	$NetBSD: GENERIC,v 1.89 2019/11/13 17:59:56 tsutsui Exp $
 #
 # GENERIC machine description file
 #
@@ -150,11 +150,10 @@ options 	WSDISPLAY_COMPAT_RAWKBD		# can 
 options 	DIAGNOSTIC		# internal consistency checks
 #options 	DEBUG
 #options 	VERBOSE_INIT_ARM	# verbose bootstraping messages
-#options 	DDB			# in-kernel debugger
-#options 	DDB_HISTORY_SIZE=100	# Enable history editing in DDB
+options 	DDB			# in-kernel debugger
+options 	DDB_HISTORY_SIZE=100	# Enable history editing in DDB
 #options 	KGDB
 #makeoptions 	DEBUG="-g"		# compile full symbol table
-makeoptions	COPY_SYMTAB=1
 
 
 # Kernel root file system and dump configuration.

Index: src/sys/arch/zaurus/conf/INSTALL
diff -u src/sys/arch/zaurus/conf/INSTALL:1.39 src/sys/arch/zaurus/conf/INSTALL:1.40
--- src/sys/arch/zaurus/conf/INSTALL:1.39	Thu Feb  7 20:56:27 2019
+++ src/sys/arch/zaurus/conf/INSTALL	Wed Nov 13 17:59:56 2019
@@ -1,4 +1,4 @@
-# $NetBSD: INSTALL,v 1.39 2019/02/07 20:56:27 rin Exp $
+# $NetBSD: INSTALL,v 1.40 2019/11/13 17:59:56 tsutsui Exp $
 #
 # INSTALL config file (GENERIC with memory disk root)
 #
@@ -59,7 +59,6 @@ options 		RASOPS_SMALL
 no options 		DIAGNOSTIC
 no options 		DDB
 no options 		DDB_HISTORY_SIZE
-no makeoptions	COPY_SYMTAB
 
 no options 		PXA2X0_DMAC_DMOVER_CONCURRENCY
 

Index: src/sys/arch/zaurus/stand/zbsdmod/zbsdmod.c
diff -u src/sys/arch/zaurus/stand/zbsdmod/zbsdmod.c:1.11 src/sys/arch/zaurus/stand/zbsdmod/zbsdmod.c:1.12
--- src/sys/arch/zaurus/stand/zbsdmod/zbsdmod.c:1.11	Mon Oct 28 15:26:09 2019
+++ src/sys/arch/zaurus/stand/zbsdmod/zbsdmod.c	Wed Nov 13 17:59:56 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: zbsdmod.c,v 1.11 2019/10/28 15:26:09 tsutsui Exp $	*/
+/*	$NetBSD: zbsdmod.c,v 1.12 2019/11/13 17:59:56 tsutsui Exp $	*/
 /*	$OpenBSD: zbsdmod.c,v 1.7 2005/05/02 02:45:29 uwe Exp $	*/
 
 /*
@@ -139,8 +139,8 @@ elf32bsdboot(void)
 			if (maxv < posv)
 maxv = posv;
 		}
-		if (IS_DATA(phdr[i]) && IS_BSS(phdr[i])) {
-			posv += phdr[i].p_memsz;
+		if (IS_BSS(phdr[i])) {
+			posv += phdr[i].p_memsz - phdr[i].p_filesz;
 			if (maxv < posv)
 maxv = posv;
 		}

Index: src/sys/arch/zaurus/zaurus/machdep.c
diff -u src/sys/arch/zaurus/zaurus/machdep.c:1.44 src/sys/arch/zaurus/zaurus/machdep.c:1.45
--- src/sys/arch/zaurus/zaurus/machdep.c:1.44	Mon Nov  4 10:36:18 2019
+++ src/sys/arch/zaurus/zaurus/machdep.c	Wed Nov 13 17:59:56 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.44 2019/11/04 10:36:18 tsutsui Exp $	*/
+/*	$NetBSD: machdep.c,v 1.45 2019/11/13 17:59:56 tsutsui Exp $	*/
 /*	$OpenBSD: zaurus_machdep.c,v 1.25 2006/06/20 18:24:04 todd Exp $	*/
 
 /*
@@ -107,7 +107,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.44 2019/11/04 10:36:18 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.45 2019/11/13 17:59:56 tsutsui Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -247,6 +247,12 @@ struct bootinfo _bootinfo;
 struct bootinfo *bootinfo;

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

2019-11-13 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Wed Nov 13 17:52:12 UTC 2019

Modified Files:
src/sys/arch/arm/sa11x0: sa11x0_ost.c

Log Message:
Fix another attach failure of zaudio(4) WM8731 on Zaurus SL-C7x0/860.

When kernels were configured for both CPU_XSCALE_PXA270 and
CPU_XSCALE_PXA250, the OST freq value was not set until tc_init(9)
then all delay(9) during configure(9) returned immediately.
While here, use proper macro with description for readability.

Should be pulled up to netbsd-8 and netbsd-9.
(though zaudio(4) won't work on netbsd-8)


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/sys/arch/arm/sa11x0/sa11x0_ost.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/sa11x0/sa11x0_ost.c
diff -u src/sys/arch/arm/sa11x0/sa11x0_ost.c:1.32 src/sys/arch/arm/sa11x0/sa11x0_ost.c:1.33
--- src/sys/arch/arm/sa11x0/sa11x0_ost.c:1.32	Sun Oct  9 14:43:17 2016
+++ src/sys/arch/arm/sa11x0/sa11x0_ost.c	Wed Nov 13 17:52:12 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: sa11x0_ost.c,v 1.32 2016/10/09 14:43:17 christos Exp $	*/
+/*	$NetBSD: sa11x0_ost.c,v 1.33 2019/11/13 17:52:12 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1997 Mark Brinicombe.
@@ -38,7 +38,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sa11x0_ost.c,v 1.32 2016/10/09 14:43:17 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sa11x0_ost.c,v 1.33 2019/11/13 17:52:12 tsutsui Exp $");
 
 #include 
 #include 
@@ -80,14 +80,23 @@ struct saost_softc {
 
 static struct saost_softc *saost_sc = NULL;
 
+#define PXA270_OST_FREQ		325		/* PXA270 uses 3.25MHz */
+#define SAOST_FREQ		3686400		/* Others use 3.6864MHz */
+#define SAOST_MAXFREQ		SAOST_FREQ
+
 #if defined(CPU_XSCALE_PXA270) && defined(CPU_XSCALE_PXA250)
+/*
+ * On dynamic configuration, assume fastest frequency for early delay(9)
+ * before tc_init(9), because longer delay(9) is almost harmless during
+ * device probe and initialization.
+ */
 #include  
-static uint32_t freq;
-#define TIMER_FREQUENCY freq
+static uint32_t saost_freq = SAOST_MAXFREQ;
+#define TIMER_FREQUENCY		saost_freq
 #elif defined(CPU_XSCALE_PXA270)
-#define TIMER_FREQUENCY 325 /* PXA270 uses 3.25MHz */
+#define TIMER_FREQUENCY		PXA270_OST_FREQ
 #else
-#define TIMER_FREQUENCY 3686400 /* 3.6864MHz */
+#define TIMER_FREQUENCY		SAOST_FREQ
 #endif
 
 #ifndef STATHZ
@@ -230,7 +239,7 @@ cpu_initclocks(void)
 	stathz = STATHZ;
 	profhz = stathz;
 #if defined(CPU_XSCALE_PXA270) && defined(CPU_XSCALE_PXA250)
-	TIMER_FREQUENCY = (CPU_IS_PXA250) ? 3686400 : 325;
+	TIMER_FREQUENCY = (CPU_IS_PXA270) ? PXA270_OST_FREQ : SAOST_FREQ;
 #endif
 	sc->sc_statclock_step = TIMER_FREQUENCY / stathz;
 



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

2019-11-13 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Wed Nov 13 17:52:12 UTC 2019

Modified Files:
src/sys/arch/arm/sa11x0: sa11x0_ost.c

Log Message:
Fix another attach failure of zaudio(4) WM8731 on Zaurus SL-C7x0/860.

When kernels were configured for both CPU_XSCALE_PXA270 and
CPU_XSCALE_PXA250, the OST freq value was not set until tc_init(9)
then all delay(9) during configure(9) returned immediately.
While here, use proper macro with description for readability.

Should be pulled up to netbsd-8 and netbsd-9.
(though zaudio(4) won't work on netbsd-8)


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/sys/arch/arm/sa11x0/sa11x0_ost.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/zaurus/zaurus

2019-11-13 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Wed Nov 13 17:48:03 UTC 2019

Modified Files:
src/sys/arch/zaurus/zaurus: autoconf.c

Log Message:
Fix attach failure of zaudio(4) WM8731 (C7x0/860) and WM8750 (C1000/3x00).

The new MI iic(4) layer requires an explicit quirk info of PROBE_STRATEGY
via device properties.  Fixes PR kern/54658.

Should be pulled up to netbsd-9.


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

2019-11-13 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Wed Nov 13 17:48:03 UTC 2019

Modified Files:
src/sys/arch/zaurus/zaurus: autoconf.c

Log Message:
Fix attach failure of zaudio(4) WM8731 (C7x0/860) and WM8750 (C1000/3x00).

The new MI iic(4) layer requires an explicit quirk info of PROBE_STRATEGY
via device properties.  Fixes PR kern/54658.

Should be pulled up to netbsd-9.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/zaurus/zaurus/autoconf.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/zaurus/zaurus/autoconf.c
diff -u src/sys/arch/zaurus/zaurus/autoconf.c:1.12 src/sys/arch/zaurus/zaurus/autoconf.c:1.13
--- src/sys/arch/zaurus/zaurus/autoconf.c:1.12	Sun Jul 29 18:05:47 2012
+++ src/sys/arch/zaurus/zaurus/autoconf.c	Wed Nov 13 17:48:03 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: autoconf.c,v 1.12 2012/07/29 18:05:47 mlelstv Exp $	*/
+/*	$NetBSD: autoconf.c,v 1.13 2019/11/13 17:48:03 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.12 2012/07/29 18:05:47 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.13 2019/11/13 17:48:03 tsutsui Exp $");
 
 #include "opt_md.h"
 
@@ -43,6 +43,8 @@ __KERNEL_RCSID(0, "$NetBSD: autoconf.c,v
 #include 
 #include 
 
+#include 
+
 #include 
 #include 
 #include 
@@ -219,5 +221,13 @@ void
 device_register(device_t dev, void *aux)
 {
 
-	/* Nothing to do */
+	/*
+	 * I2C bus conntected to pxaiic(4) for zaudio(4) devices has
+	 * limited capabilities.
+	 */
+	if (device_is_a(dev, "iic") &&
+	device_is_a(dev->dv_parent, "ziic")) {
+		(void)prop_dictionary_set_cstring_nocopy(device_properties(dev),
+		I2C_PROP_INDIRECT_PROBE_STRATEGY, I2C_PROBE_STRATEGY_NONE);
+	}
 }



CVS commit: src/sys/arch/zaurus/zaurus

2019-11-04 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Mon Nov  4 10:36:18 UTC 2019

Modified Files:
src/sys/arch/zaurus/zaurus: machdep.c

Log Message:
Fix build with VERBOSE_INIT_ARM without DIAGNOSTIC.


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 src/sys/arch/zaurus/zaurus/machdep.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/zaurus/zaurus/machdep.c
diff -u src/sys/arch/zaurus/zaurus/machdep.c:1.43 src/sys/arch/zaurus/zaurus/machdep.c:1.44
--- src/sys/arch/zaurus/zaurus/machdep.c:1.43	Sat Oct 19 14:42:30 2019
+++ src/sys/arch/zaurus/zaurus/machdep.c	Mon Nov  4 10:36:18 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.43 2019/10/19 14:42:30 tsutsui Exp $	*/
+/*	$NetBSD: machdep.c,v 1.44 2019/11/04 10:36:18 tsutsui Exp $	*/
 /*	$OpenBSD: zaurus_machdep.c,v 1.25 2006/06/20 18:24:04 todd Exp $	*/
 
 /*
@@ -107,7 +107,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.43 2019/10/19 14:42:30 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.44 2019/11/04 10:36:18 tsutsui Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -635,7 +635,7 @@ hw_isc1000(void)
 vaddr_t
 initarm(void *arg)
 {
-#ifdef DIAGNOSTIC
+#if defined(DIAGNOSTIC) || defined(VERBOSE_INIT_ARM)
 	extern vsize_t xscale_minidata_clean_size; /* used in KASSERT */
 #endif
 	extern vaddr_t xscale_cache_clean_addr;



CVS commit: src/sys/arch/zaurus/zaurus

2019-11-04 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Mon Nov  4 10:36:18 UTC 2019

Modified Files:
src/sys/arch/zaurus/zaurus: machdep.c

Log Message:
Fix build with VERBOSE_INIT_ARM without DIAGNOSTIC.


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 src/sys/arch/zaurus/zaurus/machdep.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/zaurus/conf

2019-11-02 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Nov  2 23:13:00 UTC 2019

Modified Files:
src/sys/arch/zaurus/conf: GENERIC

Log Message:
Put back options WSDISPLAY_COMPAT_RAWKBD. It's required by Xorg server.

Should be pulled up to netbsd-9.


To generate a diff of this commit:
cvs rdiff -u -r1.87 -r1.88 src/sys/arch/zaurus/conf/GENERIC

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/zaurus/conf/GENERIC
diff -u src/sys/arch/zaurus/conf/GENERIC:1.87 src/sys/arch/zaurus/conf/GENERIC:1.88
--- src/sys/arch/zaurus/conf/GENERIC:1.87	Wed Aug 21 04:17:41 2019
+++ src/sys/arch/zaurus/conf/GENERIC	Sat Nov  2 23:13:00 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: GENERIC,v 1.87 2019/08/21 04:17:41 msaitoh Exp $
+#	$NetBSD: GENERIC,v 1.88 2019/11/02 23:13:00 tsutsui Exp $
 #
 # GENERIC machine description file
 #
@@ -143,7 +143,7 @@ options 	WS_KERNEL_FG=WSCOL_GREEN
 # compatibility to other console drivers
 options 	WSDISPLAY_COMPAT_PCVT		# emulate some ioctls
 options 	WSDISPLAY_COMPAT_USL		# wsconscfg VT handling
-# options 	WSDISPLAY_COMPAT_RAWKBD		# can get raw scancodes
+options 	WSDISPLAY_COMPAT_RAWKBD		# can get raw scancodes
 
 # Development and Debugging options
 



CVS commit: src/sys/arch/zaurus/conf

2019-11-02 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Nov  2 23:13:00 UTC 2019

Modified Files:
src/sys/arch/zaurus/conf: GENERIC

Log Message:
Put back options WSDISPLAY_COMPAT_RAWKBD. It's required by Xorg server.

Should be pulled up to netbsd-9.


To generate a diff of this commit:
cvs rdiff -u -r1.87 -r1.88 src/sys/arch/zaurus/conf/GENERIC

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



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

2019-11-02 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Nov  2 23:03:53 UTC 2019

Modified Files:
src/sys/arch/zaurus/dev: zrc.c

Log Message:
Fix build errors with options WSDISPLAY_COMPAT_RAWKBD.

- Add missing RAWKEY_* macro definitions (taken from OpenBSD)
- Explicitly include "opt_wsdisplay_compat.h" for
  #ifdef WSDISPLAY_COMPAT_RAWKBD conditionals.
  (it is not properly pulled at least in netbsd-8)
 https://mail-index.netbsd.org/port-zaurus/2019/11/02/msg83.html

Should be pulled up to netbsd-8 and netbsd-9.


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

2019-11-02 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Nov  2 23:03:53 UTC 2019

Modified Files:
src/sys/arch/zaurus/dev: zrc.c

Log Message:
Fix build errors with options WSDISPLAY_COMPAT_RAWKBD.

- Add missing RAWKEY_* macro definitions (taken from OpenBSD)
- Explicitly include "opt_wsdisplay_compat.h" for
  #ifdef WSDISPLAY_COMPAT_RAWKBD conditionals.
  (it is not properly pulled at least in netbsd-8)
 https://mail-index.netbsd.org/port-zaurus/2019/11/02/msg83.html

Should be pulled up to netbsd-8 and netbsd-9.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/zaurus/dev/zrc.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/zaurus/dev/zrc.c
diff -u src/sys/arch/zaurus/dev/zrc.c:1.9 src/sys/arch/zaurus/dev/zrc.c:1.10
--- src/sys/arch/zaurus/dev/zrc.c:1.9	Sat Oct 27 17:18:14 2012
+++ src/sys/arch/zaurus/dev/zrc.c	Sat Nov  2 23:03:53 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: zrc.c,v 1.9 2012/10/27 17:18:14 chs Exp $	*/
+/*	$NetBSD: zrc.c,v 1.10 2019/11/02 23:03:53 tsutsui Exp $	*/
 /*	$OpenBSD: zaurus_remote.c,v 1.1 2005/11/17 05:26:31 uwe Exp $	*/
 
 /*
@@ -17,8 +17,10 @@
  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
+#include "opt_wsdisplay_compat.h"
+
 #include 
-__KERNEL_RCSID(0, "$NetBSD: zrc.c,v 1.9 2012/10/27 17:18:14 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: zrc.c,v 1.10 2019/11/02 23:03:53 tsutsui Exp $");
 
 #include 
 #include 
@@ -131,6 +133,11 @@ static const keysym_t zrc_keydesc[] = {
 };
 
 #ifdef WSDISPLAY_COMPAT_RAWKBD
+/* XXX see OpenBSD's  */
+#define	RAWKEY_Null		0x00
+#define	RAWKEY_AudioMute	0x85
+#define	RAWKEY_AudioLower	0x86
+#define	RAWKEY_AudioRaise 	0x87
 #define	RAWKEY_AudioRewind	0xa0
 #define	RAWKEY_AudioForward	0xa1
 #define	RAWKEY_AudioPlay	0xa2



CVS commit: src/sys/dev/rasops

2019-11-01 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Nov  2 01:14:57 UTC 2019

Modified Files:
src/sys/dev/rasops: rasops.h

Log Message:
Fix "Alignment Fault 3" kernel failure of NetBSD/zaurus 8.1 GENERIC.

#ifdef switch per kernel config options in definition of device driver
structure in header files could be problematic.

See my post in port-zaurus@ for details:
 https://mail-index.netbsd.org/port-zaurus/2019/10/31/msg79.html

Should be pulled up to netbsd-8 and netbsd-9.


To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 src/sys/dev/rasops/rasops.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/rasops

2019-11-01 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Nov  2 01:14:57 UTC 2019

Modified Files:
src/sys/dev/rasops: rasops.h

Log Message:
Fix "Alignment Fault 3" kernel failure of NetBSD/zaurus 8.1 GENERIC.

#ifdef switch per kernel config options in definition of device driver
structure in header files could be problematic.

See my post in port-zaurus@ for details:
 https://mail-index.netbsd.org/port-zaurus/2019/10/31/msg79.html

Should be pulled up to netbsd-8 and netbsd-9.


To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 src/sys/dev/rasops/rasops.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/rasops/rasops.h
diff -u src/sys/dev/rasops/rasops.h:1.48 src/sys/dev/rasops/rasops.h:1.49
--- src/sys/dev/rasops/rasops.h:1.48	Wed Aug 14 00:51:10 2019
+++ src/sys/dev/rasops/rasops.h	Sat Nov  2 01:14:57 2019
@@ -1,4 +1,4 @@
-/* 	$NetBSD: rasops.h,v 1.48 2019/08/14 00:51:10 rin Exp $ */
+/* 	$NetBSD: rasops.h,v 1.49 2019/11/02 01:14:57 tsutsui Exp $ */
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -149,10 +149,8 @@ struct rasops_info {
 	/* Callbacks so we can share some code */
 	void	(*ri_do_cursor)(struct rasops_info *);
 
-#if NRASOPS_ROTATION > 0
 	/* Used to intercept putchar to permit display rotation */
 	struct	wsdisplay_emulops ri_real_ops;
-#endif
 };
 
 #define CHAR_IN_FONT(c, font)		\



CVS commit: src/sys/arch/zaurus/stand/zbsdmod

2019-10-28 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Mon Oct 28 15:26:09 UTC 2019

Modified Files:
src/sys/arch/zaurus/stand/zbsdmod: compat_linux.h zbsdmod.c

Log Message:
Make sure to clear bss before jumping to a kernel copied from load buffer.

This will fix yet another boot failure issue
"screen white-out after loading a kernel"
 https://mail-index.netbsd.org/port-zaurus/2019/10/26/msg72.html

Should be pulled up to netbsd-8 and netbsd-9.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/zaurus/stand/zbsdmod/compat_linux.h
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/zaurus/stand/zbsdmod/zbsdmod.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/zaurus/stand/zbsdmod

2019-10-28 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Mon Oct 28 15:26:09 UTC 2019

Modified Files:
src/sys/arch/zaurus/stand/zbsdmod: compat_linux.h zbsdmod.c

Log Message:
Make sure to clear bss before jumping to a kernel copied from load buffer.

This will fix yet another boot failure issue
"screen white-out after loading a kernel"
 https://mail-index.netbsd.org/port-zaurus/2019/10/26/msg72.html

Should be pulled up to netbsd-8 and netbsd-9.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/zaurus/stand/zbsdmod/compat_linux.h
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/zaurus/stand/zbsdmod/zbsdmod.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/zaurus/stand/zbsdmod/compat_linux.h
diff -u src/sys/arch/zaurus/stand/zbsdmod/compat_linux.h:1.6 src/sys/arch/zaurus/stand/zbsdmod/compat_linux.h:1.7
--- src/sys/arch/zaurus/stand/zbsdmod/compat_linux.h:1.6	Sun Dec 11 14:05:39 2011
+++ src/sys/arch/zaurus/stand/zbsdmod/compat_linux.h	Mon Oct 28 15:26:09 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: compat_linux.h,v 1.6 2011/12/11 14:05:39 nonaka Exp $	*/
+/*	$NetBSD: compat_linux.h,v 1.7 2019/10/28 15:26:09 tsutsui Exp $	*/
 /*	$OpenBSD: compat_linux.h,v 1.5 2006/01/15 17:58:27 deraadt Exp $	*/
 
 /*
@@ -64,6 +64,7 @@ extern	int register_chrdev(unsigned int,
 extern	int unregister_chrdev(unsigned int, const char *);
 extern	void printk(const char *, ...) __printflike(1, 2);
 extern	void *memcpy(void *, const void *, size_t);
+extern	void *memset(void *, int, size_t);
 
 /* procfs support */
 struct proc_dir_entry {

Index: src/sys/arch/zaurus/stand/zbsdmod/zbsdmod.c
diff -u src/sys/arch/zaurus/stand/zbsdmod/zbsdmod.c:1.10 src/sys/arch/zaurus/stand/zbsdmod/zbsdmod.c:1.11
--- src/sys/arch/zaurus/stand/zbsdmod/zbsdmod.c:1.10	Sat Oct 26 09:58:40 2019
+++ src/sys/arch/zaurus/stand/zbsdmod/zbsdmod.c	Mon Oct 28 15:26:09 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: zbsdmod.c,v 1.10 2019/10/26 09:58:40 tsutsui Exp $	*/
+/*	$NetBSD: zbsdmod.c,v 1.11 2019/10/28 15:26:09 tsutsui Exp $	*/
 /*	$OpenBSD: zbsdmod.c,v 1.7 2005/05/02 02:45:29 uwe Exp $	*/
 
 /*
@@ -262,6 +262,10 @@ elf32bsdboot(void)
 (((char *)elf) + phdr[i].p_offset)[sz];
 			}
 		}
+		if (IS_BSS(phdr[i])) {
+			memset((void *)(phdr[i].p_vaddr + phdr[i].p_filesz), 0,
+			phdr[i].p_memsz - phdr[i].p_filesz);
+		}
 	}
 
 	addr = (int *)(elf->e_entry);



CVS commit: src/sys/arch/zaurus/stand/zbsdmod

2019-10-26 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Oct 26 10:10:14 UTC 2019

Modified Files:
src/sys/arch/zaurus/stand/zbsdmod: Makefile

Log Message:
Misc cleanup to avoid future confusion.

- Remove more unnecessary debug sections
- Use DBG instead of COPTS to specify -Os as defined in bsd.prog.mk
- Use CFLAGS and CPPFLAGS correctly
- Explicitly set -ffreestanding


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/zaurus/stand/zbsdmod/Makefile

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



CVS commit: src/sys/arch/zaurus/stand/zbsdmod

2019-10-26 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Oct 26 10:10:14 UTC 2019

Modified Files:
src/sys/arch/zaurus/stand/zbsdmod: Makefile

Log Message:
Misc cleanup to avoid future confusion.

- Remove more unnecessary debug sections
- Use DBG instead of COPTS to specify -Os as defined in bsd.prog.mk
- Use CFLAGS and CPPFLAGS correctly
- Explicitly set -ffreestanding


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/zaurus/stand/zbsdmod/Makefile

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/zaurus/stand/zbsdmod/Makefile
diff -u src/sys/arch/zaurus/stand/zbsdmod/Makefile:1.11 src/sys/arch/zaurus/stand/zbsdmod/Makefile:1.12
--- src/sys/arch/zaurus/stand/zbsdmod/Makefile:1.11	Mon Sep 23 13:42:37 2019
+++ src/sys/arch/zaurus/stand/zbsdmod/Makefile	Sat Oct 26 10:10:14 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.11 2019/09/23 13:42:37 christos Exp $
+#	$NetBSD: Makefile,v 1.12 2019/10/26 10:10:14 tsutsui Exp $
 
 WARNS?=	4
 
@@ -10,8 +10,18 @@ OBJS=	zbsdmod.o
 SRCS=	zbsdmod.c
 NOMAN=	# defined
 
+OBJCOPY_FLAGS=			\
+	-R .debug_abbrev	\
+	-R .debug_aranges	\
+	-R .debug_info		\
+	-R .debug_line		\
+	-R .debug_loc		\
+	-R .debug_ranges	\
+	-R .debug_str		\
+	-R .eh_frame
+
 realall: ${OBJS}
-	${OBJCOPY} -R .eh_frame ${.OBJDIR}/zbsdmod.o
+	${OBJCOPY} ${OBJCOPY_FLAGS} ${.OBJDIR}/zbsdmod.o
 
 .include 
 .include 
@@ -21,11 +31,12 @@ afterinstall:
 		${OBJS} ${DESTDIR}/${BINDIR}
 
 CPUFLAGS=
-COPTS=		-Os
+DBG=		-Os
 CFLAGS+=	-fno-strict-aliasing
-CFLAGS+=	-DMACHINE=\"${MACHINE}\" -DUTS_RELEASE=\"2.4.20\"
-CPPFLAGS+=	${ARM_APCS_FLAGS} -mcpu=xscale
-CPPFLAGS+=  -nostdinc -D_STANDALONE
+CFLAGS+=	-ffreestanding -nostdinc
+CFLAGS+=	${ARM_APCS_FLAGS} -mcpu=xscale
+CPPFLAGS+=	-DMACHINE=\"${MACHINE}\" -DUTS_RELEASE=\"2.4.20\"
+CPPFLAGS+=	-D_STANDALONE
 CPPFLAGS+=	-I${.OBJDIR} -I${S}
 
 release: check_RELEASEDIR



CVS commit: src/sys/arch/zaurus/stand/zbsdmod

2019-10-26 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Oct 26 09:58:40 UTC 2019

Modified Files:
src/sys/arch/zaurus/stand/zbsdmod: zbsdmod.c

Log Message:
Fix another boot failure issue of NetBSD/zaurus 8.x and later.

It looks some cacheline alignment restriction so that zbsdmod.o in
NetBSD/zaurus 8.x release cannot jump to a loaded kernel properly.
Adding an explicit alingment pseudo op to put all instructions
between I-cache flush and jumping to the loaded kernel into the
same cacheline solves the issue.

See my post in port-zaurus@ for details:
 https://mail-index.netbsd.org/port-zaurus/2019/10/22/msg69.html

Should be pulled up to netbsd-8 and netbsd-9.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/zaurus/stand/zbsdmod/zbsdmod.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/zaurus/stand/zbsdmod/zbsdmod.c
diff -u src/sys/arch/zaurus/stand/zbsdmod/zbsdmod.c:1.9 src/sys/arch/zaurus/stand/zbsdmod/zbsdmod.c:1.10
--- src/sys/arch/zaurus/stand/zbsdmod/zbsdmod.c:1.9	Mon Dec  2 18:36:11 2013
+++ src/sys/arch/zaurus/stand/zbsdmod/zbsdmod.c	Sat Oct 26 09:58:40 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: zbsdmod.c,v 1.9 2013/12/02 18:36:11 joerg Exp $	*/
+/*	$NetBSD: zbsdmod.c,v 1.10 2019/10/26 09:58:40 tsutsui Exp $	*/
 /*	$OpenBSD: zbsdmod.c,v 1.7 2005/05/02 02:45:29 uwe Exp $	*/
 
 /*
@@ -284,6 +284,13 @@ elf32bsdboot(void)
 		"mov	r1, r1;"
 		"sub	pc, pc, #4;"
 		"mov	r1, #(0x0010 | 0x0020);"
+		/*
+		 * Put the rest of instructions into the same cacheline
+		 * to make sure no I$ refill after invalidation.
+		 */
+		"b	2f;"
+		".align 5;"
+		"2:"
 		"mcr	p15, 0, r1, c1, c0, 0;" /* Write new control register */
 		"mcr	p15, 0, r1, c8, c7, 0;" /* invalidate I+D TLB */
 		"mcr	p15, 0, r1, c7, c5, 0;" /* invalidate I$ and BTB */



CVS commit: src/sys/arch/zaurus/stand/zbsdmod

2019-10-26 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Oct 26 09:58:40 UTC 2019

Modified Files:
src/sys/arch/zaurus/stand/zbsdmod: zbsdmod.c

Log Message:
Fix another boot failure issue of NetBSD/zaurus 8.x and later.

It looks some cacheline alignment restriction so that zbsdmod.o in
NetBSD/zaurus 8.x release cannot jump to a loaded kernel properly.
Adding an explicit alingment pseudo op to put all instructions
between I-cache flush and jumping to the loaded kernel into the
same cacheline solves the issue.

See my post in port-zaurus@ for details:
 https://mail-index.netbsd.org/port-zaurus/2019/10/22/msg69.html

Should be pulled up to netbsd-8 and netbsd-9.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/zaurus/stand/zbsdmod/zbsdmod.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/zaurus/conf

2019-10-26 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Oct 26 09:49:14 UTC 2019

Modified Files:
src/sys/arch/zaurus/conf: Makefile.zaurus.inc

Log Message:
Explicitly set empty LINKENTRY to keep ENTRY address specified in ldscript.

This fixes kernel boot failures of NetBSD/zaurus 8.x and later.
While here, also set empty TEXTADDR also specified in ldscript.

See my post in port-zaurus@ for details:
 https://mail-index.netbsd.org/port-zaurus/2019/10/22/msg69.html

Should be pulled up to netbsd-8 and netbsd-9.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/zaurus/conf/Makefile.zaurus.inc

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/zaurus/conf/Makefile.zaurus.inc
diff -u src/sys/arch/zaurus/conf/Makefile.zaurus.inc:1.9 src/sys/arch/zaurus/conf/Makefile.zaurus.inc:1.10
--- src/sys/arch/zaurus/conf/Makefile.zaurus.inc:1.9	Tue Aug 25 02:38:15 2015
+++ src/sys/arch/zaurus/conf/Makefile.zaurus.inc	Sat Oct 26 09:49:13 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.zaurus.inc,v 1.9 2015/08/25 02:38:15 uebayasi Exp $
+#	$NetBSD: Makefile.zaurus.inc,v 1.10 2019/10/26 09:49:13 tsutsui Exp $
 
 MACHINE_ARCH?=		arm
 CPPFLAGS+=		-D${MACHINE}
@@ -20,6 +20,8 @@ SYSTEM_LD_TAIL_EXTRA+=; \
 KERNEL_BASE_VIRT=	$(LOADADDRESS)
 
 KERNLDSCRIPT=		ldscript
+TEXTADDR=		# defined in ldscript
+LINKENTRY=		# defined in ldscript
 
 EXTRA_CLEAN+=		netbsd.map assym.d ldscript tmp
 



CVS commit: src/sys/arch/zaurus/conf

2019-10-26 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Oct 26 09:49:14 UTC 2019

Modified Files:
src/sys/arch/zaurus/conf: Makefile.zaurus.inc

Log Message:
Explicitly set empty LINKENTRY to keep ENTRY address specified in ldscript.

This fixes kernel boot failures of NetBSD/zaurus 8.x and later.
While here, also set empty TEXTADDR also specified in ldscript.

See my post in port-zaurus@ for details:
 https://mail-index.netbsd.org/port-zaurus/2019/10/22/msg69.html

Should be pulled up to netbsd-8 and netbsd-9.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/zaurus/conf/Makefile.zaurus.inc

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



CVS commit: src/sys/arch/zaurus/zaurus

2019-10-19 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Oct 19 14:42:30 UTC 2019

Modified Files:
src/sys/arch/zaurus/zaurus: machdep.c

Log Message:
Fix a build error with options VERBOSE_INIT_ARM.


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.43 src/sys/arch/zaurus/zaurus/machdep.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/zaurus/zaurus

2019-10-19 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Oct 19 14:42:30 UTC 2019

Modified Files:
src/sys/arch/zaurus/zaurus: machdep.c

Log Message:
Fix a build error with options VERBOSE_INIT_ARM.


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.43 src/sys/arch/zaurus/zaurus/machdep.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/zaurus/zaurus/machdep.c
diff -u src/sys/arch/zaurus/zaurus/machdep.c:1.42 src/sys/arch/zaurus/zaurus/machdep.c:1.43
--- src/sys/arch/zaurus/zaurus/machdep.c:1.42	Tue Jul 16 14:41:49 2019
+++ src/sys/arch/zaurus/zaurus/machdep.c	Sat Oct 19 14:42:30 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.42 2019/07/16 14:41:49 skrll Exp $	*/
+/*	$NetBSD: machdep.c,v 1.43 2019/10/19 14:42:30 tsutsui Exp $	*/
 /*	$OpenBSD: zaurus_machdep.c,v 1.25 2006/06/20 18:24:04 todd Exp $	*/
 
 /*
@@ -107,7 +107,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.42 2019/07/16 14:41:49 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.43 2019/10/19 14:42:30 tsutsui Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -772,7 +772,7 @@ initarm(void *arg)
 
 #ifdef VERBOSE_INIT_ARM
 	/* Tell the user about the memory */
-	printf("physmemory: %d pages at 0x%08lx -> 0x%08lx\n", physmem,
+	printf("physmemory: %lu pages at 0x%08lx -> 0x%08lx\n", physmem,
 	physical_start, physical_end - 1);
 #endif
 



CVS commit: src/sys

2019-09-14 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Sep 14 17:11:39 UTC 2019

Modified Files:
src/sys/arch/dreamcast/dev/g1: wdc_g1.c
src/sys/dev/ic: wdc.c wdcvar.h

Log Message:
Restore interface to pass a MD reset function to MI wdcprobe().

Fixes silent hang on G1IDE on Dreamcast. PR kern/54538
Should be pulled up to netbsd-9 with the previous changes.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/dreamcast/dev/g1/wdc_g1.c
cvs rdiff -u -r1.291 -r1.292 src/sys/dev/ic/wdc.c
cvs rdiff -u -r1.98 -r1.99 src/sys/dev/ic/wdcvar.h

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



CVS commit: src/sys

2019-09-14 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Sep 14 17:11:39 UTC 2019

Modified Files:
src/sys/arch/dreamcast/dev/g1: wdc_g1.c
src/sys/dev/ic: wdc.c wdcvar.h

Log Message:
Restore interface to pass a MD reset function to MI wdcprobe().

Fixes silent hang on G1IDE on Dreamcast. PR kern/54538
Should be pulled up to netbsd-9 with the previous changes.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/dreamcast/dev/g1/wdc_g1.c
cvs rdiff -u -r1.291 -r1.292 src/sys/dev/ic/wdc.c
cvs rdiff -u -r1.98 -r1.99 src/sys/dev/ic/wdcvar.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/dreamcast/dev/g1/wdc_g1.c
diff -u src/sys/arch/dreamcast/dev/g1/wdc_g1.c:1.4 src/sys/arch/dreamcast/dev/g1/wdc_g1.c:1.5
--- src/sys/arch/dreamcast/dev/g1/wdc_g1.c:1.4	Mon Sep  9 22:01:23 2019
+++ src/sys/arch/dreamcast/dev/g1/wdc_g1.c	Sat Sep 14 17:11:39 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: wdc_g1.c,v 1.4 2019/09/09 22:01:23 jdolecek Exp $ */
+/* $NetBSD: wdc_g1.c,v 1.5 2019/09/14 17:11:39 tsutsui Exp $ */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -62,9 +62,7 @@ struct wdc_g1_softc {
 
 static int	wdc_g1_probe(device_t, cfdata_t, void *);
 static void	wdc_g1_attach(device_t, device_t, void *);
-#if 0
 static void	wdc_g1_do_reset(struct ata_channel *, int);
-#endif
 static int	wdc_g1_intr(void *);
 
 CFATTACH_DECL_NEW(wdc_g1bus, sizeof(struct wdc_g1_softc),
@@ -76,18 +74,11 @@ wdc_g1_probe(device_t parent, cfdata_t c
 	struct g1bus_attach_args *ga = aux;
 	struct wdc_regs wdr;
 	int result = 0, i;
-#ifdef ATADEBUG
-	struct device dev;
-#endif
 
 	*((volatile uint32_t *)0xa05f74e4) = 0x1f;
 	for (i = 0; i < 0x20 / 4; i++)
 		(void)((volatile uint32_t *)0xa000)[i];
 
-#if 0
-	wdc.reset = wdc_g1_do_reset;
-#endif
-
 	wdr.cmd_iot = ga->ga_memt;
 	if (bus_space_map(wdr.cmd_iot, WDC_G1_CMD_ADDR,
 	WDC_G1_REG_NPORTS * 4, 0, _baseioh))
@@ -106,12 +97,7 @@ wdc_g1_probe(device_t parent, cfdata_t c
 	WDC_G1_AUXREG_NPORTS, 0, _ioh))
 	  goto outunmap;
 
-#ifdef ATADEBUG
-	/* fake up device name for ATADEBUG_PRINT() with DEBUG_PROBE */
-	memset(, 0, sizeof(dev));
-	strncat(dev.dv_xname, "wdc(g1probe)", sizeof(dev.dv_xname));
-#endif
-	result = wdcprobe();
+	result = wdcprobe_with_reset(, wdc_g1_do_reset);
 	
 	bus_space_unmap(wdr.ctl_iot, wdr.ctl_ioh, WDC_G1_AUXREG_NPORTS);
  outunmap:
@@ -157,9 +143,7 @@ wdc_g1_attach(struct device *parent, str
 	sc->sc_wdcdev.sc_atac.atac_channels = sc->wdc_chanlist;
 	sc->sc_wdcdev.sc_atac.atac_nchannels = 1;
 	sc->sc_wdcdev.wdc_maxdrives = 2;
-#if 0
 	sc->sc_wdcdev.reset = wdc_g1_do_reset;
-#endif
 	sc->ata_channel.ch_channel = 0;
 	sc->ata_channel.ch_atac = >sc_wdcdev.sc_atac;
 
@@ -180,12 +164,11 @@ wdc_g1_intr(void *arg)
 	return wdcintr(arg);
 }
 
-#if 0
 /*
- * This does what the generic wdc_do_reset() does, only with unnecessary
- * additional GD-ROM reset. Keep code around in case this turns out to be
- * actually useful/necessary. ATAPI code should do it's own reset in either
- * case anyway.
+ * This does what the generic wdc_do_reset() does, with additional
+ * GD-ROM reset. GD-ROM is a very early ATAPI device appeared in 1998
+ * and it doesn't reset itself by the WDCTL_RST in AUX_CTLR but requires
+ * ATAPI_SOFT_RESET command to reset whole device as a master.
  */
 static void
 wdc_g1_do_reset(struct ata_channel *chp, int poll)
@@ -220,4 +203,3 @@ wdc_g1_do_reset(struct ata_channel *chp,
 	if (poll != 0)
 		splx(s);
 }
-#endif

Index: src/sys/dev/ic/wdc.c
diff -u src/sys/dev/ic/wdc.c:1.291 src/sys/dev/ic/wdc.c:1.292
--- src/sys/dev/ic/wdc.c:1.291	Sat Oct 27 05:38:08 2018
+++ src/sys/dev/ic/wdc.c	Sat Sep 14 17:11:39 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: wdc.c,v 1.291 2018/10/27 05:38:08 maya Exp $ */
+/*	$NetBSD: wdc.c,v 1.292 2019/09/14 17:11:39 tsutsui Exp $ */
 
 /*
  * Copyright (c) 1998, 2001, 2003 Manuel Bouyer.  All rights reserved.
@@ -58,7 +58,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: wdc.c,v 1.291 2018/10/27 05:38:08 maya Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wdc.c,v 1.292 2019/09/14 17:11:39 tsutsui Exp $");
 
 #include "opt_ata.h"
 #include "opt_wdc.h"
@@ -477,6 +477,14 @@ wdc_drvprobe(struct ata_channel *chp)
 int
 wdcprobe(struct wdc_regs *wdr)
 {
+
+	return wdcprobe_with_reset(wdr, NULL);
+}
+
+int
+wdcprobe_with_reset(struct wdc_regs *wdr,
+void (*do_reset)(struct ata_channel *, int))
+{
 	struct wdc_softc wdc;
 	struct ata_channel ch;
 	int rv;
@@ -487,9 +495,8 @@ wdcprobe(struct wdc_regs *wdr)
 	ch.ch_atac = _atac;
 	wdc.regs = wdr;
 
-	/* default reset method */
-	if (wdc.reset == NULL)
-		wdc.reset = wdc_do_reset;
+	/* check the MD reset method */
+	wdc.reset = (do_reset != NULL) ? do_reset : wdc_do_reset;
 
 	rv = wdcprobe1(, 1);
 

Index: src/sys/dev/ic/wdcvar.h
diff -u src/sys/dev/ic/wdcvar.h:1.98 src/sys/dev/ic/wdcvar.h:1.99
--- src/sys/dev/ic/wdcvar.h:1.98	Sat Oct  7 16:05:32 

CVS commit: src/sys/arch/luna68k

2019-06-29 Thread Izumi Tsutsui
The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include 			/* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: lunafb.c,v 1.38 2019/06/30 02:11:56 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lunafb.c,v 1.39 2019/06/30 05:04:48 tsutsui Exp $");
 
 #include 
 #include 
@@ -74,10 +74,10 @@ struct bt458 {
 	uint8_t  pad3[3];
 };
 
-#define	OMFB_RFCNT	0xB100	/* video h-origin/v-origin */
-#define	OMFB_RAMDAC	0xC110	/* Bt454/Bt458 RAMDAC */
+#define	OMFB_RFCNT	BMAP_RFCNT	/* video h-origin/v-origin */
+#define	OMFB_RAMDAC	BMAP_PALLET2	/* Bt454/Bt458 RAMDAC */
 
-#define	OMFB_SIZE	(0xB130 - 0xB108 + PAGE_SIZE)
+#define	OMFB_SIZE	(BMAP_FN0 - BMAP_BMP + PAGE_SIZE)
 
 struct hwcmap {
 #define CMAP_SIZE 256

Index: src/sys/arch/luna68k/dev/omrasopsvar.h
diff -u src/sys/arch/luna68k/dev/omrasopsvar.h:1.3 src/sys/arch/luna68k/dev/omrasopsvar.h:1.4
--- src/sys/arch/luna68k/dev/omrasopsvar.h:1.3	Sat Oct  4 16:58:17 2014
+++ src/sys/arch/luna68k/dev/omrasopsvar.h	Sun Jun 30 05:04:48 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: omrasopsvar.h,v 1.3 2014/10/04 16:58:17 tsutsui Exp $ */
+/* $NetBSD: omrasopsvar.h,v 1.4 2019/06/30 05:04:48 tsutsui Exp $ */
 /*
  * Copyright (c) 2013 Kenji Aoyama
  *
@@ -20,10 +20,12 @@
  * XXX: We consider only 1bpp and 4bpp for now
  */
 
-#define OMFB_PLANEMASK	0xB104	/* BMSEL register */
-#define OMFB_FB_WADDR	0xB1080008	/* common plane */
-#define OMFB_FB_RADDR	0xB10C0008	/* plane #0 */
-#define OMFB_ROPFUNC	0xB12C	/* common ROP function */
+#include 
+
+#define OMFB_PLANEMASK	BMAP_BMSEL	/* BMSEL register */
+#define OMFB_FB_WADDR	(BMAP_BMP + 8)	/* common plane */
+#define OMFB_FB_RADDR	(BMAP_BMAP0 + 8)/* plane #0 */
+#define OMFB_ROPFUNC	BMAP_FN		/* common ROP function */
 
 /*
  * Helper macros

Index: src/sys/arch/luna68k/dev/xp.c
diff -u src/sys/arch/luna68k/dev/xp.c:1.4 src/sys/arch/luna68k/dev/xp.c:1.5
--- src/sys/arch/luna68k/dev/xp.c:1.4	Thu Jun  1 02:45:06 2017
+++ src/sys/arch/luna68k/dev/xp.c	Sun Jun 30 05:04:48 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: xp.c,v 1.4 2017/06/01 02:45:06 chs Exp $ */
+/* $NetBSD: xp.c,v 1.5 2019/06/30 05:04:48 tsutsui Exp $ */
 
 /*-
  * Copyright (c) 2016 Izumi Tsutsui.  All rights reserved.
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: xp.c,v 1.4 2017/06/01 02:45:06 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xp.c,v 1.5 2019/06/30 05:04:48 tsutsui Exp $");
 
 #include 
 #include 
@@ -42,13 +42,16 @@ __KERNEL_RCSID(0, "$NetBSD: xp.c,v 1.4 2
 #include 
 
 #include 
+#include 
 #include 
 
 #include "ioconf.h"
 
-#define XP_SHM_BASE	0x7100
+#define TRI_PORT_RAM_XP_OFFSET	0x0
+
+#define XP_SHM_BASE	(TRI_PORT_RAM + TRI_PORT_RAM_XP_OFFSET)
 #define XP_SHM_SIZE	0x0001	/* 64KB for XP; rest 64KB for lance */
-#define XP_TAS_ADDR	0x6100
+#define XP_TAS_ADDR	OBIO_TAS
 
 struct xp_softc {
 	device_t	sc_dev;
@@ -105,7 +108,7 @@ static bool xp_matched;
  *
  * XXX: PIO port functions should be shared with machdep.c for DIP SWs
  */
-#define PIO_ADDR	0x4900
+#define PIO_ADDR	OBIO_PIO0_BASE
 #define PORT_A		0
 #define PORT_B		1
 #define PORT_C		2

Index: src/sys/arch/luna68k/luna68k/locore.s
diff -u src/sys/arch/luna68k/luna68k/locore.s:1.63 src/sys/arch/luna68k/luna68k/locore.s:1.64
--- src/sys/arch/luna68k/luna68k/locore.s:1.63	Wed Dec 19 13:57:47 2018
+++ src/sys/arch/luna68k/luna68k/locore.s	Sun Jun 30 05:04:49 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: locore.s,v 1.63 2018/12/19 13:57:47 maxv Exp $ */
+/* $NetBSD: locore.s,v 1.64 2019/06/30 05:04:49 tsutsui Exp $ */
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -50,6 +50,7 @@
 #include "assym.h"
 #include 
 #include 
+#include 
 
 #include "ksyms.h"
 
@@ -116,13 +117,13 @@ ASENTRY_NOPROFILE(start)
 	RELOC(lowram,%a0)
 	movl	%a5,%a0@		| store start of physical memory
 
-	movl	#0x4100,%a0		| available memory in bytes
+	movl	#PROM_ADDR,%a0		| available memory in bytes
 	movl	%a0@(12),%a0		| (int *)base[3])
 	movl	%a0@,%d5
 	RELOC(memavail,%a0)
 	movl	%d5,%a0@		| save memavail
 
-	movl	#0x4100,%a0		| planemask; 0x0f or 0xff
+	movl	#PROM_ADDR,%a0		| planemask; 0x0f or 0xff
 	movl	%a0@(184),%a0		| (int *)base[46]
 	movl	%a0@,%d5
 	RELOC(hwplanemask,%a0)
@@ -157,7 +158,7 @@ Lstart0:
 	 * save argument of 'x' command on boot per machine type
 	 * XXX: assume CPU_68040 is LUNA-II
 	 */
-	movl	#0x4100,%a0
+	movl	#PROM_ADDR,%a0
 	cmpl	#CPU_68040,%d0		| 68040?
 	jne	1f			| no, assume 68030 LUNA
 	movl	%a0@(8),%a0		| arg at (char *)base[2] on LUNA-II
@@ -644,9 +645,9 @@ ENTRY_NOPROFILE(intrhand_vectored)
 #if 1	/* XXX wild timer -- how can I disable/enable the interrupt? */
 ENTRY_NOPROFILE(lev5intr)
 	addql	#1,_C_LABEL(idepth)
-	btst	#7,0x6300		| check whether system clock
+	btst	#7,OBIO_CLOCK		| check whether system clock
 	beq	1f
-	movb	#1,0x6300		| clear the interrupt
+	movb	#1,OBIO_CLOCK		| clear the interrupt
 	tstl	_C_LABEL(clock_enable)	| is hardclock()

CVS commit: src/sys/arch/luna68k

2019-06-29 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sun Jun 30 05:04:49 UTC 2019

Modified Files:
src/sys/arch/luna68k/dev: if_le.c lcd.c lunafb.c omrasopsvar.h xp.c
src/sys/arch/luna68k/luna68k: locore.s machdep.c
src/sys/arch/luna68k/stand/boot: autoconf.c bmd.c getsecs.c if_le.c
sio.c
Added Files:
src/sys/arch/luna68k/include: board.h

Log Message:
Pull OpenBSD/luna88k board.h to define SX9100 board device addresses.

Also replace magic addresses with macro where appropriate.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/luna68k/dev/if_le.c
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/luna68k/dev/lcd.c
cvs rdiff -u -r1.38 -r1.39 src/sys/arch/luna68k/dev/lunafb.c
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/luna68k/dev/omrasopsvar.h
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/luna68k/dev/xp.c
cvs rdiff -u -r0 -r1.1 src/sys/arch/luna68k/include/board.h
cvs rdiff -u -r1.63 -r1.64 src/sys/arch/luna68k/luna68k/locore.s
cvs rdiff -u -r1.102 -r1.103 src/sys/arch/luna68k/luna68k/machdep.c
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/luna68k/stand/boot/autoconf.c
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/luna68k/stand/boot/bmd.c
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/luna68k/stand/boot/getsecs.c
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/luna68k/stand/boot/if_le.c
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/luna68k/stand/boot/sio.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/luna68k/dev

2019-06-29 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sun Jun 30 02:11:56 UTC 2019

Modified Files:
src/sys/arch/luna68k/dev: if_le.c lcd.c lunafb.c siotty.c

Log Message:
Misc KNF.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/luna68k/dev/if_le.c
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/luna68k/dev/lcd.c
cvs rdiff -u -r1.37 -r1.38 src/sys/arch/luna68k/dev/lunafb.c
cvs rdiff -u -r1.44 -r1.45 src/sys/arch/luna68k/dev/siotty.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/if_le.c
diff -u src/sys/arch/luna68k/dev/if_le.c:1.7 src/sys/arch/luna68k/dev/if_le.c:1.8
--- src/sys/arch/luna68k/dev/if_le.c:1.7	Mon Sep 23 17:27:09 2013
+++ src/sys/arch/luna68k/dev/if_le.c	Sun Jun 30 02:11:56 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: if_le.c,v 1.7 2013/09/23 17:27:09 tsutsui Exp $ */
+/* $NetBSD: if_le.c,v 1.8 2019/06/30 02:11:56 tsutsui Exp $ */
 
 /*-
  * Copyright (c) 1992, 1993
@@ -73,7 +73,7 @@
 
 #include 			/* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: if_le.c,v 1.7 2013/09/23 17:27:09 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_le.c,v 1.8 2019/06/30 02:11:56 tsutsui Exp $");
 
 #include "opt_inet.h"
 
@@ -152,7 +152,7 @@ lerdcsr(struct lance_softc *sc, uint16_t
 
 	ler1->ler1_rap = port;
 	val = ler1->ler1_rdp;
-	return (val);
+	return val;
 }
 
 static int
@@ -161,9 +161,9 @@ le_match(device_t parent, cfdata_t cf, v
 	struct mainbus_attach_args *ma = aux;
 
 	if (strcmp(ma->ma_name, le_cd.cd_name))
-		return (0);
+		return 0;
 
-	return (1);
+	return 1;
 }
 
 void

Index: src/sys/arch/luna68k/dev/lcd.c
diff -u src/sys/arch/luna68k/dev/lcd.c:1.9 src/sys/arch/luna68k/dev/lcd.c:1.10
--- src/sys/arch/luna68k/dev/lcd.c:1.9	Thu Mar  8 03:12:02 2018
+++ src/sys/arch/luna68k/dev/lcd.c	Sun Jun 30 02:11:56 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: lcd.c,v 1.9 2018/03/08 03:12:02 mrg Exp $ */
+/* $NetBSD: lcd.c,v 1.10 2019/06/30 02:11:56 tsutsui Exp $ */
 /* $OpenBSD: lcd.c,v 1.7 2015/02/10 22:42:35 miod Exp $ */
 
 /*-
@@ -32,7 +32,7 @@
 
 #include 		/* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: lcd.c,v 1.9 2018/03/08 03:12:02 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lcd.c,v 1.10 2019/06/30 02:11:56 tsutsui Exp $");
 
 #include 
 #include 
@@ -71,10 +71,10 @@ __KERNEL_RCSID(0, "$NetBSD: lcd.c,v 1.9 
 #define LCD_MAXBUFLEN	80
 
 struct pio {
-	volatile u_int8_t portA;
-	volatile u_int8_t portB;
-	volatile u_int8_t portC;
-	volatile u_int8_t cntrl;
+	volatile uint8_t portA;
+	volatile uint8_t portB;
+	volatile uint8_t portC;
+	volatile uint8_t cntrl;
 };
 
 /* Autoconf stuff */
@@ -344,6 +344,7 @@ lcdshow(char *s)
 void
 greeting(void)
 {
+
 	lcdctrl(LCD_INIT);
 	lcdctrl(LCD_ENTRY);
 	lcdctrl(LCD_ON);

Index: src/sys/arch/luna68k/dev/lunafb.c
diff -u src/sys/arch/luna68k/dev/lunafb.c:1.37 src/sys/arch/luna68k/dev/lunafb.c:1.38
--- src/sys/arch/luna68k/dev/lunafb.c:1.37	Wed Jan 24 05:35:58 2018
+++ src/sys/arch/luna68k/dev/lunafb.c	Sun Jun 30 02:11:56 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: lunafb.c,v 1.37 2018/01/24 05:35:58 riastradh Exp $ */
+/* $NetBSD: lunafb.c,v 1.38 2019/06/30 02:11:56 tsutsui Exp $ */
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include 			/* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: lunafb.c,v 1.37 2018/01/24 05:35:58 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lunafb.c,v 1.38 2019/06/30 02:11:56 tsutsui Exp $");
 
 #include 
 #include 
@@ -346,7 +346,7 @@ omsetcmap(struct omfb_softc *sc, struct 
 
 	cmsize = sc->sc_dc->dc_cmsize;
 	if (index >= cmsize || count > cmsize - index)
-		return (EINVAL);
+		return EINVAL;
 
 	error = copyin(p->red, [index], count);
 	if (error)

Index: src/sys/arch/luna68k/dev/siotty.c
diff -u src/sys/arch/luna68k/dev/siotty.c:1.44 src/sys/arch/luna68k/dev/siotty.c:1.45
--- src/sys/arch/luna68k/dev/siotty.c:1.44	Fri Aug 21 10:48:06 2015
+++ src/sys/arch/luna68k/dev/siotty.c	Sun Jun 30 02:11:56 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: siotty.c,v 1.44 2015/08/21 10:48:06 christos Exp $ */
+/* $NetBSD: siotty.c,v 1.45 2019/06/30 02:11:56 tsutsui Exp $ */
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include 			/* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: siotty.c,v 1.44 2015/08/21 10:48:06 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: siotty.c,v 1.45 2019/06/30 02:11:56 tsutsui Exp $");
 
 #include "opt_ddb.h"
 
@@ -602,7 +602,7 @@ siopoll(dev_t dev, int events, struct lw
 
 	sc = device_lookup_private(_cd, minor(dev));
 	tp = sc->sc_tty;
-	return ((*tp->t_linesw->l_poll)(tp, events, l));
+	return (*tp->t_linesw->l_poll)(tp, events, l);
 }
 
 int



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

2019-06-29 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sun Jun 30 02:11:56 UTC 2019

Modified Files:
src/sys/arch/luna68k/dev: if_le.c lcd.c lunafb.c siotty.c

Log Message:
Misc KNF.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/luna68k/dev/if_le.c
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/luna68k/dev/lcd.c
cvs rdiff -u -r1.37 -r1.38 src/sys/arch/luna68k/dev/lunafb.c
cvs rdiff -u -r1.44 -r1.45 src/sys/arch/luna68k/dev/siotty.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/atari

2019-06-29 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Jun 29 16:41:19 UTC 2019

Modified Files:
src/sys/arch/atari/atari: autoconf.c
src/sys/arch/atari/dev: grf.c hdfd.c ite.c ite_cc.c ite_et.c ncr5380.c
wdc_mb.c
src/sys/arch/atari/isa: fdcisa.c

Log Message:
Make local functions static.


To generate a diff of this commit:
cvs rdiff -u -r1.66 -r1.67 src/sys/arch/atari/atari/autoconf.c
cvs rdiff -u -r1.49 -r1.50 src/sys/arch/atari/dev/grf.c
cvs rdiff -u -r1.84 -r1.85 src/sys/arch/atari/dev/hdfd.c
cvs rdiff -u -r1.78 -r1.79 src/sys/arch/atari/dev/ite.c
cvs rdiff -u -r1.39 -r1.40 src/sys/arch/atari/dev/ite_cc.c
cvs rdiff -u -r1.30 -r1.31 src/sys/arch/atari/dev/ite_et.c
cvs rdiff -u -r1.72 -r1.73 src/sys/arch/atari/dev/ncr5380.c
cvs rdiff -u -r1.40 -r1.41 src/sys/arch/atari/dev/wdc_mb.c
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/atari/isa/fdcisa.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/atari

2019-06-29 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Jun 29 16:41:19 UTC 2019

Modified Files:
src/sys/arch/atari/atari: autoconf.c
src/sys/arch/atari/dev: grf.c hdfd.c ite.c ite_cc.c ite_et.c ncr5380.c
wdc_mb.c
src/sys/arch/atari/isa: fdcisa.c

Log Message:
Make local functions static.


To generate a diff of this commit:
cvs rdiff -u -r1.66 -r1.67 src/sys/arch/atari/atari/autoconf.c
cvs rdiff -u -r1.49 -r1.50 src/sys/arch/atari/dev/grf.c
cvs rdiff -u -r1.84 -r1.85 src/sys/arch/atari/dev/hdfd.c
cvs rdiff -u -r1.78 -r1.79 src/sys/arch/atari/dev/ite.c
cvs rdiff -u -r1.39 -r1.40 src/sys/arch/atari/dev/ite_cc.c
cvs rdiff -u -r1.30 -r1.31 src/sys/arch/atari/dev/ite_et.c
cvs rdiff -u -r1.72 -r1.73 src/sys/arch/atari/dev/ncr5380.c
cvs rdiff -u -r1.40 -r1.41 src/sys/arch/atari/dev/wdc_mb.c
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/atari/isa/fdcisa.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/atari/atari/autoconf.c
diff -u src/sys/arch/atari/atari/autoconf.c:1.66 src/sys/arch/atari/atari/autoconf.c:1.67
--- src/sys/arch/atari/atari/autoconf.c:1.66	Fri May  3 01:08:28 2019
+++ src/sys/arch/atari/atari/autoconf.c	Sat Jun 29 16:41:18 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: autoconf.c,v 1.66 2019/05/03 01:08:28 tsutsui Exp $	*/
+/*	$NetBSD: autoconf.c,v 1.67 2019/06/29 16:41:18 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1995 Leo Weppelman
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.66 2019/05/03 01:08:28 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.67 2019/06/29 16:41:18 tsutsui Exp $");
 
 #include "opt_md.h"
 
@@ -55,10 +55,10 @@ __KERNEL_RCSID(0, "$NetBSD: autoconf.c,v
 #include "ioconf.h"
 
 static void findroot(void);
-int mbmatch(device_t, cfdata_t, void *);
-void mbattach(device_t, device_t, void *);
+static int mbmatch(device_t, cfdata_t, void *);
+static void mbattach(device_t, device_t, void *);
 #if 0
-int mbprint(void *, const char *);
+static int mbprint(void *, const char *);
 #endif
 
 int atari_realconfig;
@@ -293,7 +293,7 @@ CFATTACH_DECL_NEW(mainbus, 0,
 
 static int mb_attached;
 
-int
+static int
 mbmatch(device_t parent, cfdata_t cf, void *aux)
 {
 
@@ -308,7 +308,7 @@ mbmatch(device_t parent, cfdata_t cf, vo
 /*
  * "find" all the things that should be there.
  */
-void
+static void
 mbattach(device_t parent, device_t self, void *aux)
 {
 
@@ -332,7 +332,7 @@ mbattach(device_t parent, device_t self,
 }
 
 #if 0
-int
+static int
 mbprint(void *aux, const char *pnp)
 {
 

Index: src/sys/arch/atari/dev/grf.c
diff -u src/sys/arch/atari/dev/grf.c:1.49 src/sys/arch/atari/dev/grf.c:1.50
--- src/sys/arch/atari/dev/grf.c:1.49	Fri Jul 25 08:10:32 2014
+++ src/sys/arch/atari/dev/grf.c	Sat Jun 29 16:41:18 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: grf.c,v 1.49 2014/07/25 08:10:32 dholland Exp $	*/
+/*	$NetBSD: grf.c,v 1.50 2019/06/29 16:41:18 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1995 Leo Weppelman
@@ -46,7 +46,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: grf.c,v 1.49 2014/07/25 08:10:32 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: grf.c,v 1.50 2019/06/29 16:41:18 tsutsui Exp $");
 
 #include 
 #include 
@@ -90,9 +90,9 @@ int grfon(dev_t);
 int grfoff(dev_t);
 int grfsinfo(dev_t, struct grfdyninfo *);
 
-int grfbusprint(void *, const char *);
-int grfbusmatch(device_t, cfdata_t, void *);
-void grfbusattach(device_t, device_t, void *);
+static int grfbusprint(void *, const char *);
+static int grfbusmatch(device_t, cfdata_t, void *);
+static void grfbusattach(device_t, device_t, void *);
 
 /*
  * pointers to grf drivers device structs 
@@ -127,7 +127,7 @@ const struct cdevsw grf_cdevsw = {
  */
 static cfdata_t cfdata_gbus  = NULL;
 
-int
+static int
 grfbusmatch(device_t parent, cfdata_t cf, void *aux)
 {
 
@@ -139,7 +139,7 @@ grfbusmatch(device_t parent, cfdata_t cf
 	return 1;	/* Always there	*/
 }
 
-void
+static void
 grfbusattach(device_t parent, device_t self, void *aux)
 {
 	grf_auxp_t	grf_auxp;
@@ -155,7 +155,7 @@ grfbusattach(device_t parent, device_t s
 	}
 }
 
-int
+static int
 grfbusprint(void *aux, const char *name)
 {
 

Index: src/sys/arch/atari/dev/hdfd.c
diff -u src/sys/arch/atari/dev/hdfd.c:1.84 src/sys/arch/atari/dev/hdfd.c:1.85
--- src/sys/arch/atari/dev/hdfd.c:1.84	Fri Feb  8 08:47:35 2019
+++ src/sys/arch/atari/dev/hdfd.c	Sat Jun 29 16:41:18 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: hdfd.c,v 1.84 2019/02/08 08:47:35 mrg Exp $	*/
+/*	$NetBSD: hdfd.c,v 1.85 2019/06/29 16:41:18 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 1996 Leo Weppelman
@@ -91,7 +91,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: hdfd.c,v 1.84 2019/02/08 08:47:35 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hdfd.c,v 1.85 2019/06/29 16:41:18 tsutsui Exp $");
 
 #include "opt_ddb.h"
 
@@ -202,9 +202,9 @@ struct fdc_softc {
 };
 
 /* controller driver configuration */
-int	fdcprobe(device_t, cfdata_t, void *);
-int	fdprint(void *, 

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

2019-06-29 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Jun 29 16:37:49 UTC 2019

Modified Files:
src/sys/arch/atari/dev: clock.c

Log Message:
Misc cosmetics and cleanup.


To generate a diff of this commit:
cvs rdiff -u -r1.59 -r1.60 src/sys/arch/atari/dev/clock.c

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

Modified files:

Index: src/sys/arch/atari/dev/clock.c
diff -u src/sys/arch/atari/dev/clock.c:1.59 src/sys/arch/atari/dev/clock.c:1.60
--- src/sys/arch/atari/dev/clock.c:1.59	Fri Jul 25 08:10:32 2014
+++ src/sys/arch/atari/dev/clock.c	Sat Jun 29 16:37:49 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: clock.c,v 1.59 2014/07/25 08:10:32 dholland Exp $	*/
+/*	$NetBSD: clock.c,v 1.60 2019/06/29 16:37:49 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -39,7 +39,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.59 2014/07/25 08:10:32 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.60 2019/06/29 16:37:49 tsutsui Exp $");
 
 #include 
 #include 
@@ -157,7 +157,7 @@ static int	profmin;	/* profclock divisor
 static int	clk2min;	/* current, from above choices		*/
 #endif
 
-int
+static int
 clockmatch(device_t parent, cfdata_t cf, void *aux)
 {
 
@@ -169,7 +169,8 @@ clockmatch(device_t parent, cfdata_t cf,
 /*
  * Start the real-time clock.
  */
-void clockattach(device_t parent, device_t self, void *aux)
+static void
+clockattach(device_t parent, device_t self, void *aux)
 {
 	struct clock_softc *sc = device_private(self);
 	struct todr_chip_handle	*tch;
@@ -221,7 +222,8 @@ void clockattach(device_t parent, device
 #endif /* STATCLOCK */
 }
 
-void cpu_initclocks(void)
+void
+cpu_initclocks(void)
 {
 
 	MFP->mf_tacr  = T_Q200;		/* Start timer			*/
@@ -316,7 +318,7 @@ init_delay(void)
 	 */
 	MFP->mf_tbcr  = 0;		/* Stop timer			*/
 	MFP->mf_iera &= ~IA_TIMB;	/* Disable timer interrupts	*/
-	MFP->mf_tbdr  = 0;	
+	MFP->mf_tbdr  = 0;
 	MFP->mf_tbcr  = T_Q004;	/* Start timer			*/
 }
 
@@ -559,9 +561,9 @@ rtcwrite(dev_t dev, struct uio *uio, int
 	 */
 	length = uio->uio_resid;
 	if (uio->uio_offset || (length != sizeof(buffer)
-	  && length != sizeof(buffer) - 1))
+	&& length != sizeof(buffer) - 1))
 		return EINVAL;
-	
+
 	if ((error = uiomove((void *)buffer, sizeof(buffer), uio)))
 		return error;
 
@@ -580,7 +582,7 @@ rtcwrite(dev_t dev, struct uio *uio, int
 	clkregs[MC_DOM]   = twodigits(buffer, 6);
 	clkregs[MC_MONTH] = twodigits(buffer, 4);
 	s = twodigits(buffer, 0) * 100 + twodigits(buffer, 2);
-	clkregs[MC_YEAR]  = s - GEMSTARTOFTIME; 
+	clkregs[MC_YEAR]  = s - GEMSTARTOFTIME;
 
 	s = splclock();
 	MC146818_PUTTOD(RTC, );



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

2019-06-29 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Jun 29 16:37:49 UTC 2019

Modified Files:
src/sys/arch/atari/dev: clock.c

Log Message:
Misc cosmetics and cleanup.


To generate a diff of this commit:
cvs rdiff -u -r1.59 -r1.60 src/sys/arch/atari/dev/clock.c

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



CVS commit: src/sys/arch/atari/stand/loadkmap

2019-06-29 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Jun 29 16:29:24 UTC 2019

Modified Files:
src/sys/arch/atari/stand/loadkmap: loadkmap.c

Log Message:
Misc KNF and cleanup.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/atari/stand/loadkmap/loadkmap.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/atari/stand/loadkmap

2019-06-29 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Jun 29 16:29:24 UTC 2019

Modified Files:
src/sys/arch/atari/stand/loadkmap: loadkmap.c

Log Message:
Misc KNF and cleanup.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/atari/stand/loadkmap/loadkmap.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/atari/stand/loadkmap/loadkmap.c
diff -u src/sys/arch/atari/stand/loadkmap/loadkmap.c:1.11 src/sys/arch/atari/stand/loadkmap/loadkmap.c:1.12
--- src/sys/arch/atari/stand/loadkmap/loadkmap.c:1.11	Wed Aug 12 17:53:03 2015
+++ src/sys/arch/atari/stand/loadkmap/loadkmap.c	Sat Jun 29 16:29:24 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: loadkmap.c,v 1.11 2015/08/12 17:53:03 tsutsui Exp $	*/
+/*	$NetBSD: loadkmap.c,v 1.12 2019/06/29 16:29:24 tsutsui Exp $	*/
 
 #include 
 #include 
@@ -25,19 +25,19 @@ main(int argc, char *argv[])
 		if ((argc == 3) && !strcmp(argv[1], "-f")) {
 			mapfile = argv[2];
 			set_sysmap = 1;
-		}
-		else {
+		} else {
 			fprintf(stderr, "%s [-f] keymap\n", argv[0]);
 			exit(1);
 		}
-	}
-	else mapfile = argv[1];
+	} else
+		mapfile = argv[1];
 
 	if (argc == 1)
 		rc = dump_kmap();
-	else rc = load_kmap(mapfile, set_sysmap);
+	else
+		rc = load_kmap(mapfile, set_sysmap);
 
-	exit (rc);
+	exit(rc);
 }
 
 
@@ -45,36 +45,36 @@ static int
 load_kmap(const char *file, int set_sysmap)
 {
 	int	fd;
-	char	buf[sizeof (struct kbdmap)];
+	char	buf[sizeof(struct kbdmap)];
 	int	ioc;
 
 	ioc = set_sysmap ? ITEIOCSSKMAP : ITEIOCSKMAP;
 	
-	if ((fd = open (file, 0)) >= 0) {
-		if (read (fd, buf, sizeof (buf)) == sizeof (buf)) {
-			if (ioctl (0, ioc, buf) == 0) {
+	if ((fd = open(file, 0)) >= 0) {
+		if (read(fd, buf, sizeof(buf)) == sizeof(buf)) {
+			if (ioctl(0, ioc, buf) == 0) {
 close(fd);
 return 0;
-			}
-			else perror("ITEIOCSKMAP");
-		}
-		else perror("read kmap");
+			} else
+perror("ITEIOCSKMAP");
+		} else
+			perror("read kmap");
 
 		close(fd);
-	}
-	else perror("open kmap");
+	} else
+		perror("open kmap");
 	return 1;
 }
 
 static int
 dump_kmap(void)
 {
-	char buf[sizeof (struct kbdmap)];
+	char buf[sizeof(struct kbdmap)];
 
-	if (ioctl (0, ITEIOCGKMAP, buf) == 0) {
-		write (1, buf, sizeof (buf));
+	if (ioctl(0, ITEIOCGKMAP, buf) == 0) {
+		write(1, buf, sizeof(buf));
 		return 0;
 	}
-	perror ("ITEIOCGKMAP");
+	perror("ITEIOCGKMAP");
 	return 1;
 }



CVS commit: src/sys/arch/atari/atari

2019-06-28 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Jun 29 03:22:53 UTC 2019

Modified Files:
src/sys/arch/atari/atari: machdep.c

Log Message:
Remove obsolete stuff.


To generate a diff of this commit:
cvs rdiff -u -r1.179 -r1.180 src/sys/arch/atari/atari/machdep.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/atari/atari/machdep.c
diff -u src/sys/arch/atari/atari/machdep.c:1.179 src/sys/arch/atari/atari/machdep.c:1.180
--- src/sys/arch/atari/atari/machdep.c:1.179	Sat Jun 29 03:19:49 2019
+++ src/sys/arch/atari/atari/machdep.c	Sat Jun 29 03:22:52 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.179 2019/06/29 03:19:49 tsutsui Exp $	*/
+/*	$NetBSD: machdep.c,v 1.180 2019/06/29 03:22:52 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -39,7 +39,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.179 2019/06/29 03:19:49 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.180 2019/06/29 03:22:52 tsutsui Exp $");
 
 #include "opt_ddb.h"
 #include "opt_compat_netbsd.h"
@@ -70,13 +70,8 @@ __KERNEL_RCSID(0, "$NetBSD: machdep.c,v 
 #include 
 #include 
 #include 
-#if defined(DDB) && defined(__ELF__)
 #include 
-#endif
-
-#undef PS	/* XXX netccitt/pk.h conflict with machine/reg.h? */
 
-#define	MAXMEM	64*1024	/* XXX - from cmap.h */
 #include 
 
 #include 
@@ -163,12 +158,8 @@ consinit(void)
 		extern int end;
 		extern int *esym;
 
-#ifndef __ELF__
-		ksyms_addsyms_elf(*(int *), ((int *)) + 1, esym);
-#else
 		ksyms_addsyms_elf((int)esym - (int) - sizeof(Elf32_Ehdr),
 		(void *), esym);
-#endif
 	}
 #endif
 #if defined (DDB)



CVS commit: src/sys/arch/atari/atari

2019-06-28 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Jun 29 03:19:49 UTC 2019

Modified Files:
src/sys/arch/atari/atari: machdep.c

Log Message:
Fix PR/54325 (use of dangling pointer).


To generate a diff of this commit:
cvs rdiff -u -r1.178 -r1.179 src/sys/arch/atari/atari/machdep.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/atari/atari/machdep.c
diff -u src/sys/arch/atari/atari/machdep.c:1.178 src/sys/arch/atari/atari/machdep.c:1.179
--- src/sys/arch/atari/atari/machdep.c:1.178	Sat Jun 29 03:10:51 2019
+++ src/sys/arch/atari/atari/machdep.c	Sat Jun 29 03:19:49 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.178 2019/06/29 03:10:51 tsutsui Exp $	*/
+/*	$NetBSD: machdep.c,v 1.179 2019/06/29 03:19:49 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -39,7 +39,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.178 2019/06/29 03:10:51 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.179 2019/06/29 03:19:49 tsutsui Exp $");
 
 #include "opt_ddb.h"
 #include "opt_compat_netbsd.h"
@@ -236,6 +236,8 @@ static void
 identifycpu(void)
 {
 	const char *mach, *mmu, *fpu, *cpu;
+	uint32_t pcr;
+	char cputxt[30];
 
 	switch (machineid & ATARI_ANYMACH) {
 	case ATARI_TT:
@@ -261,17 +263,12 @@ identifycpu(void)
 
 	switch (cputype) {
 	case CPU_68060:
-		{
-			uint32_t	pcr;
-			char		cputxt[30];
-
-			__asm(".word 0x4e7a,0x0808;"
-			"movl %%d0,%0" : "=d"(pcr) : : "d0");
-			snprintf(cputxt, sizeof(cputxt), "68%s060 rev.%d",
-			pcr & 0x1 ? "LC/EC" : "", (pcr >> 8) & 0xff);
-			cpu = cputxt;
-			mmu = "/MMU";
-		}
+		__asm(".word 0x4e7a,0x0808;"
+		"movl %%d0,%0" : "=d"(pcr) : : "d0");
+		snprintf(cputxt, sizeof(cputxt), "68%s060 rev.%d",
+		pcr & 0x1 ? "LC/EC" : "", (pcr >> 8) & 0xff);
+		cpu = cputxt;
+		mmu = "/MMU";
 		break;
 	case CPU_68040:
 		cpu = "m68040";



  1   2   3   4   5   >