CVS commit: src/sys/arch/x86/include

2021-03-17 Thread NONAKA Kimihiro
Module Name:src
Committed By:   nonaka
Date:   Thu Mar 18 01:50:12 UTC 2021

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

Log Message:
LIR_HV priority should be lower than softint.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/x86/include/intrdefs.h

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

Modified files:

Index: src/sys/arch/x86/include/intrdefs.h
diff -u src/sys/arch/x86/include/intrdefs.h:1.24 src/sys/arch/x86/include/intrdefs.h:1.25
--- src/sys/arch/x86/include/intrdefs.h:1.24	Sat Apr 25 15:26:18 2020
+++ src/sys/arch/x86/include/intrdefs.h	Thu Mar 18 01:50:12 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: intrdefs.h,v 1.24 2020/04/25 15:26:18 bouyer Exp $	*/
+/*	$NetBSD: intrdefs.h,v 1.25 2021/03/18 01:50:12 nonaka Exp $	*/
 
 #ifndef _X86_INTRDEFS_H_
 #define _X86_INTRDEFS_H_
@@ -27,7 +27,6 @@
  */
 #define LIR_IPI		31
 #define LIR_TIMER	30
-#define LIR_HV		29
 
 /*
  * XXX These should be lowest numbered, but right now would
@@ -35,11 +34,12 @@
  * means that soft interrupt take priority over hardware
  * interrupts when lowering the priority level!
  */
-#define	SIR_SERIAL	28
-#define	SIR_NET		27
-#define	SIR_BIO		26
-#define	SIR_CLOCK	25
-#define	SIR_PREEMPT	24
+#define	SIR_SERIAL	29
+#define	SIR_NET		28
+#define	SIR_BIO		27
+#define	SIR_CLOCK	26
+#define	SIR_PREEMPT	25
+#define	LIR_HV		24
 #define	SIR_XENIPL_HIGH 23
 #define	SIR_XENIPL_SCHED 22
 #define	SIR_XENIPL_VM	21



CVS commit: src/lib/libwrap

2021-03-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Mar 18 01:49:09 UTC 2021

Modified Files:
src/lib/libwrap: hosts_access.c

Log Message:
simplify expression, daemon is an array can't be NULL.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/lib/libwrap/hosts_access.c

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

Modified files:

Index: src/lib/libwrap/hosts_access.c
diff -u src/lib/libwrap/hosts_access.c:1.23 src/lib/libwrap/hosts_access.c:1.24
--- src/lib/libwrap/hosts_access.c:1.23	Sun Mar  7 10:09:12 2021
+++ src/lib/libwrap/hosts_access.c	Wed Mar 17 21:49:09 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: hosts_access.c,v 1.23 2021/03/07 15:09:12 christos Exp $	*/
+/*	$NetBSD: hosts_access.c,v 1.24 2021/03/18 01:49:09 christos Exp $	*/
 
  /*
   * This module implements a simple access control language that is based on
@@ -24,7 +24,7 @@
 #if 0
 static char sccsid[] = "@(#) hosts_access.c 1.21 97/02/12 02:13:22";
 #else
-__RCSID("$NetBSD: hosts_access.c,v 1.23 2021/03/07 15:09:12 christos Exp $");
+__RCSID("$NetBSD: hosts_access.c,v 1.24 2021/03/18 01:49:09 christos Exp $");
 #endif
 #endif
 
@@ -108,17 +108,16 @@ static void
 pfilter_notify(struct request_info *request, int b)
 {
 static struct blocklist *blstate;
+int fd = request->fd != -1 ? request->fd : 3;
 
 if (blstate == NULL) {
 	blstate = blocklist_open();
 }
 if (request->client->sin != NULL) {
-	blocklist_sa_r(blstate, b, request->fd != -1 ? request->fd : 3,
-		request->client->sin, request->client->sin->sa_len,
-		request->daemon ? request->daemon : getprogname());
+	blocklist_sa_r(blstate, b, fd, request->client->sin,
+		request->client->sin->sa_len, request->daemon);
 } else {
-	blocklist_r(blstate, b, (request->fd != -1) ? request->fd : 3,
-		request->daemon ? request->daemon : getprogname());
+	blocklist_r(blstate, b, fd, request->daemon);
 }
 }
 



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

2021-03-17 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Wed Mar 17 15:45:31 UTC 2021

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

Log Message:
lint: add debug logging for C99-style initialization of arrays

No functional change outside debug mode.


To generate a diff of this commit:
cvs rdiff -u -r1.175 -r1.176 src/usr.bin/xlint/lint1/cgram.y
cvs rdiff -u -r1.75 -r1.76 src/usr.bin/xlint/lint1/externs1.h
cvs rdiff -u -r1.90 -r1.91 src/usr.bin/xlint/lint1/init.c

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

Modified files:

Index: src/usr.bin/xlint/lint1/cgram.y
diff -u src/usr.bin/xlint/lint1/cgram.y:1.175 src/usr.bin/xlint/lint1/cgram.y:1.176
--- src/usr.bin/xlint/lint1/cgram.y:1.175	Wed Mar 17 01:53:21 2021
+++ src/usr.bin/xlint/lint1/cgram.y	Wed Mar 17 15:45:30 2021
@@ -1,5 +1,5 @@
 %{
-/* $NetBSD: cgram.y,v 1.175 2021/03/17 01:53:21 rillig Exp $ */
+/* $NetBSD: cgram.y,v 1.176 2021/03/17 15:45:30 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -35,7 +35,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: cgram.y,v 1.175 2021/03/17 01:53:21 rillig Exp $");
+__RCSID("$NetBSD: cgram.y,v 1.176 2021/03/17 15:45:30 rillig Exp $");
 #endif
 
 #include 
@@ -107,7 +107,7 @@ RESTORE_WARN_FLAGS(const char *file, siz
 #define SAVE_WARN_FLAGS(f, l)	olwarn = lwarn
 #define RESTORE_WARN_FLAGS(f, l) \
 	(void)(olwarn == LWARN_BAD ? (clear_warn_flags(), 0) : (lwarn = olwarn))
-#define cgram_debug(fmt, args...) (void)0
+#define cgram_debug(fmt, args...) do { } while (false)
 #endif
 
 /* unbind the anonymous struct members from the struct */
@@ -1359,6 +1359,7 @@ range:
 
 designator:			/* C99 6.7.8 "Initialization" */
 	  T_LBRACK range T_RBRACK {
+		designator_push_subscript($2);
 		if (!Sflag)
 			/* array initializer with des.s is a C9X feature */
 			warning(321);

Index: src/usr.bin/xlint/lint1/externs1.h
diff -u src/usr.bin/xlint/lint1/externs1.h:1.75 src/usr.bin/xlint/lint1/externs1.h:1.76
--- src/usr.bin/xlint/lint1/externs1.h:1.75	Wed Mar 17 01:53:21 2021
+++ src/usr.bin/xlint/lint1/externs1.h	Wed Mar 17 15:45:30 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: externs1.h,v 1.75 2021/03/17 01:53:21 rillig Exp $	*/
+/*	$NetBSD: externs1.h,v 1.76 2021/03/17 15:45:30 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -300,6 +300,7 @@ extern	void	init_rbrace(void);
 extern	void	init_lbrace(void);
 extern	void	init_using_expr(tnode_t *);
 extern	void	push_member(sbuf_t *);
+extern	void	designator_push_subscript(range_t);
 
 /*
  * emit.c

Index: src/usr.bin/xlint/lint1/init.c
diff -u src/usr.bin/xlint/lint1/init.c:1.90 src/usr.bin/xlint/lint1/init.c:1.91
--- src/usr.bin/xlint/lint1/init.c:1.90	Wed Mar 17 15:37:42 2021
+++ src/usr.bin/xlint/lint1/init.c	Wed Mar 17 15:45:30 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: init.c,v 1.90 2021/03/17 15:37:42 rillig Exp $	*/
+/*	$NetBSD: init.c,v 1.91 2021/03/17 15:45:30 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: init.c,v 1.90 2021/03/17 15:37:42 rillig Exp $");
+__RCSID("$NetBSD: init.c,v 1.91 2021/03/17 15:45:30 rillig Exp $");
 #endif
 
 #include 
@@ -287,6 +287,22 @@ push_member(sbuf_t *sb)
 	}
 }
 
+/*
+ * A struct member that has array type is initialized using a designator.
+ *
+ * C99 example: struct { int member[4]; } var = { [2] = 12345 };
+ *
+ * GNU example: struct { int member[4]; } var = { [1 ... 3] = 12345 };
+ */
+void
+designator_push_subscript(range_t range)
+{
+	debug_enter();
+	debug_step("subscript range is %zu ... %zu", range.lo, range.hi);
+	debug_initstack();
+	debug_leave();
+}
+
 static void
 pop_member(void)
 {



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

2021-03-17 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Wed Mar 17 15:37:42 UTC 2021

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

Log Message:
lint: move debug logging for the designator to the top of the code

The debugging code is needed by the soon-to-be-added proper handling of
array subscript initializers such as '.member[123].member = 12345'.

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.89 -r1.90 src/usr.bin/xlint/lint1/init.c

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

Modified files:

Index: src/usr.bin/xlint/lint1/init.c
diff -u src/usr.bin/xlint/lint1/init.c:1.89 src/usr.bin/xlint/lint1/init.c:1.90
--- src/usr.bin/xlint/lint1/init.c:1.89	Mon Feb 22 15:09:50 2021
+++ src/usr.bin/xlint/lint1/init.c	Wed Mar 17 15:37:42 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: init.c,v 1.89 2021/02/22 15:09:50 rillig Exp $	*/
+/*	$NetBSD: init.c,v 1.90 2021/03/17 15:37:42 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: init.c,v 1.89 2021/02/22 15:09:50 rillig Exp $");
+__RCSID("$NetBSD: init.c,v 1.90 2021/03/17 15:37:42 rillig Exp $");
 #endif
 
 #include 
@@ -146,12 +146,18 @@ namlist_t	*namedmem = NULL;
 static	bool	init_array_using_string(tnode_t *);
 
 #ifndef DEBUG
+
 #define debug_printf(fmt, ...)	do { } while (false)
 #define debug_indent()		do { } while (false)
 #define debug_enter(a)		do { } while (false)
 #define debug_step(fmt, ...)	do { } while (false)
 #define debug_leave(a)		do { } while (false)
+#define debug_named_member()	do { } while (false)
+#define debug_initstack_element(elem) do { } while (false)
+#define debug_initstack()	do { } while (false)
+
 #else
+
 static int debug_ind = 0;
 
 static void __printflike(1, 2)
@@ -194,52 +200,6 @@ debug_leave(const char *func)
 	printf("%*s- %s\n", 2 * --debug_ind, "", func);
 }
 
-#define debug_enter() debug_enter(__func__)
-#define debug_leave() debug_leave(__func__)
-
-#endif
-
-void
-push_member(sbuf_t *sb)
-{
-	namlist_t *nam = xcalloc(1, sizeof (namlist_t));
-	nam->n_name = sb->sb_name;
-
-	debug_step("%s: '%s' %p", __func__, nam->n_name, nam);
-
-	if (namedmem == NULL) {
-		/*
-		 * XXX: Why is this a circular list?
-		 * XXX: Why is this a doubly-linked list?
-		 * A simple stack should suffice.
-		 */
-		nam->n_prev = nam->n_next = nam;
-		namedmem = nam;
-	} else {
-		namedmem->n_prev->n_next = nam;
-		nam->n_prev = namedmem->n_prev;
-		nam->n_next = namedmem;
-		namedmem->n_prev = nam;
-	}
-}
-
-static void
-pop_member(void)
-{
-	debug_step("%s: %s %p", __func__, namedmem->n_name, namedmem);
-	if (namedmem->n_next == namedmem) {
-		free(namedmem);
-		namedmem = NULL;
-	} else {
-		namlist_t *nam = namedmem;
-		namedmem = namedmem->n_next;
-		nam->n_prev->n_next = nam->n_next;
-		nam->n_next->n_prev = nam->n_prev;
-		free(nam);
-	}
-}
-
-#ifdef DEBUG
 static void
 debug_named_member(void)
 {
@@ -256,11 +216,7 @@ debug_named_member(void)
 	} while (name != namedmem);
 	debug_printf("\n");
 }
-#else
-#define debug_named_member()	do { } while (false)
-#endif
 
-#ifdef DEBUG
 static void
 debug_initstack_element(const initstack_element *elem)
 {
@@ -301,11 +257,52 @@ debug_initstack(void)
 		i++;
 	}
 }
-#else
-#define debug_initstack_element(elem) do { } while (false)
-#define debug_initstack()	do { } while (false)
+
+#define debug_enter() debug_enter(__func__)
+#define debug_leave() debug_leave(__func__)
+
 #endif
 
+void
+push_member(sbuf_t *sb)
+{
+	namlist_t *nam = xcalloc(1, sizeof (namlist_t));
+	nam->n_name = sb->sb_name;
+
+	debug_step("%s: '%s' %p", __func__, nam->n_name, nam);
+
+	if (namedmem == NULL) {
+		/*
+		 * XXX: Why is this a circular list?
+		 * XXX: Why is this a doubly-linked list?
+		 * A simple stack should suffice.
+		 */
+		nam->n_prev = nam->n_next = nam;
+		namedmem = nam;
+	} else {
+		namedmem->n_prev->n_next = nam;
+		nam->n_prev = namedmem->n_prev;
+		nam->n_next = namedmem;
+		namedmem->n_prev = nam;
+	}
+}
+
+static void
+pop_member(void)
+{
+	debug_step("%s: %s %p", __func__, namedmem->n_name, namedmem);
+	if (namedmem->n_next == namedmem) {
+		free(namedmem);
+		namedmem = NULL;
+	} else {
+		namlist_t *nam = namedmem;
+		namedmem = namedmem->n_next;
+		nam->n_prev->n_next = nam->n_next;
+		nam->n_next->n_prev = nam->n_prev;
+		free(nam);
+	}
+}
+
 /*
  * Initialize the initialization stack by putting an entry for the object
  * which is to be initialized on it.



CVS commit: src

2021-03-17 Thread Ryo ONODERA
Module Name:src
Committed By:   ryoon
Date:   Wed Mar 17 15:26:20 UTC 2021

Modified Files:
src: README.md

Log Message:
Improve URL consistency

Replace netbsd.org in URL with NetBSD.org and add www. to URL of web server.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/README.md

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

Modified files:

Index: src/README.md
diff -u src/README.md:1.5 src/README.md:1.6
--- src/README.md:1.5	Fri Jan 10 12:33:28 2020
+++ src/README.md	Wed Mar 17 15:26:20 2021
@@ -19,8 +19,8 @@ Additional build information available i
 Binaries
 
 
-- [Daily builds](https://nycdn.netbsd.org/pub/NetBSD-daily/HEAD/latest/)
-- [Releases](https://cdn.netbsd.org/pub/NetBSD/)
+- [Daily builds](https://nycdn.NetBSD.org/pub/NetBSD-daily/HEAD/latest/)
+- [Releases](https://cdn.NetBSD.org/pub/NetBSD/)
 
 Testing
 ---
@@ -32,9 +32,9 @@ On a running NetBSD system:
 Troubleshooting
 ---
 
-- Send bugs and patches [via web form](https://www.netbsd.org/cgi-bin/sendpr.cgi?gndb=netbsd).
-- Subscribe to the [mailing lists](https://www.netbsd.org/mailinglists/).
-  The [netbsd-users](https://netbsd.org/mailinglists/#netbsd-users) list is a good choice for many problems; watch [current-users](https://netbsd.org/mailinglists/#current-users) if you follow the bleeding edge of NetBSD-current.
+- Send bugs and patches [via web form](https://www.NetBSD.org/cgi-bin/sendpr.cgi?gndb=netbsd).
+- Subscribe to the [mailing lists](https://www.NetBSD.org/mailinglists/).
+  The [netbsd-users](https://www.NetBSD.org/mailinglists/#netbsd-users) list is a good choice for many problems; watch [current-users](https://www.NetBSD.org/mailinglists/#current-users) if you follow the bleeding edge of NetBSD-current.
 - Join the community IRC channel [#netbsd @ freenode](https://webchat.freenode.net/?channels=#netbsd).
 
 Latest sources
@@ -51,6 +51,6 @@ To work in the Git mirror, which is upda
 Additional Links
 
 
-- [The NetBSD Guide](https://www.netbsd.org/docs/guide/en/)
-- [NetBSD manual pages](http://man.netbsd.org/)
-- [NetBSD Cross-Reference](https://nxr.netbsd.org/)
+- [The NetBSD Guide](https://www.NetBSD.org/docs/guide/en/)
+- [NetBSD manual pages](http://man.NetBSD.org/)
+- [NetBSD Cross-Reference](https://nxr.NetBSD.org/)



CVS commit: xsrc/external/mit/xorg-server/dist/hw

2021-03-17 Thread Izumi Tsutsui
Module Name:xsrc
Committed By:   tsutsui
Date:   Wed Mar 17 15:02:27 UTC 2021

Modified Files:
xsrc/external/mit/xorg-server/dist/hw/netbsd/x68k: x68kKbd.c
x68kMouse.c
xsrc/external/mit/xorg-server/dist/hw/sun: sunKbd.c sunMouse.c

Log Message:
Fixes "FatalError re-entered, aborting" error when Xservers get SIGSEGV.

Handle a new DEVICE_ABORT mode perperly in deviceProc funtions.
Also don't exit via FatalError() on an unknown mode because it looks
upstream assumes DDX deviceProc functions don't treat it fatal:
 
https://gitlab.freedesktop.org/xorg/xserver/-/commit/9f79e93b6b3416055d08a0e8f9f16d5fd0649e36


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 \
xsrc/external/mit/xorg-server/dist/hw/netbsd/x68k/x68kKbd.c
cvs rdiff -u -r1.10 -r1.11 \
xsrc/external/mit/xorg-server/dist/hw/netbsd/x68k/x68kMouse.c
cvs rdiff -u -r1.9 -r1.10 xsrc/external/mit/xorg-server/dist/hw/sun/sunKbd.c
cvs rdiff -u -r1.4 -r1.5 xsrc/external/mit/xorg-server/dist/hw/sun/sunMouse.c

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

Modified files:

Index: xsrc/external/mit/xorg-server/dist/hw/netbsd/x68k/x68kKbd.c
diff -u xsrc/external/mit/xorg-server/dist/hw/netbsd/x68k/x68kKbd.c:1.11 xsrc/external/mit/xorg-server/dist/hw/netbsd/x68k/x68kKbd.c:1.12
--- xsrc/external/mit/xorg-server/dist/hw/netbsd/x68k/x68kKbd.c:1.11	Thu Mar 11 12:08:57 2021
+++ xsrc/external/mit/xorg-server/dist/hw/netbsd/x68k/x68kKbd.c	Wed Mar 17 15:02:27 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: x68kKbd.c,v 1.11 2021/03/11 12:08:57 tsutsui Exp $ */
+/* $NetBSD: x68kKbd.c,v 1.12 2021/03/17 15:02:27 tsutsui Exp $ */
 /*-
  * Copyright (c) 1996 Yasushi Yamasaki
  * All rights reserved.
@@ -160,8 +160,9 @@ x68kKbdProc(DeviceIntPtr pDev,	/* Keyboa
 RemoveNotifyFd(x68kKbdPriv.fd);
 pKeyboard->on = FALSE;
 break;
-default:
-FatalError("Unknown keyboard operation\n");
+
+case DEVICE_ABORT:
+break;
 }
 return Success;
 }

Index: xsrc/external/mit/xorg-server/dist/hw/netbsd/x68k/x68kMouse.c
diff -u xsrc/external/mit/xorg-server/dist/hw/netbsd/x68k/x68kMouse.c:1.10 xsrc/external/mit/xorg-server/dist/hw/netbsd/x68k/x68kMouse.c:1.11
--- xsrc/external/mit/xorg-server/dist/hw/netbsd/x68k/x68kMouse.c:1.10	Thu Mar 11 12:08:57 2021
+++ xsrc/external/mit/xorg-server/dist/hw/netbsd/x68k/x68kMouse.c	Wed Mar 17 15:02:27 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: x68kMouse.c,v 1.10 2021/03/11 12:08:57 tsutsui Exp $ */
+/* $NetBSD: x68kMouse.c,v 1.11 2021/03/17 15:02:27 tsutsui Exp $ */
 /*-
  * Copyright (c) 1996 Yasushi Yamasaki
  * All rights reserved.
@@ -195,6 +195,8 @@ x68kMouseProc(DeviceIntPtr device, int w
 		ErrorF("x68kMouseProc ioctl VUIDSFORMAT\n");
 	break;
 
+	case DEVICE_ABORT:
+	break;
 }
 return Success;
 }

Index: xsrc/external/mit/xorg-server/dist/hw/sun/sunKbd.c
diff -u xsrc/external/mit/xorg-server/dist/hw/sun/sunKbd.c:1.9 xsrc/external/mit/xorg-server/dist/hw/sun/sunKbd.c:1.10
--- xsrc/external/mit/xorg-server/dist/hw/sun/sunKbd.c:1.9	Thu Mar 11 13:12:34 2021
+++ xsrc/external/mit/xorg-server/dist/hw/sun/sunKbd.c	Wed Mar 17 15:02:27 2021
@@ -692,8 +692,9 @@ sunKbdProc(DeviceIntPtr device, int what
 	RemoveNotifyFd(pPriv->fd);
 	pKeyboard->on = FALSE;
 	break;
-default:
-	FatalError("Unknown keyboard operation\n");
+
+case DEVICE_ABORT:
+	break;
 }
 return Success;
 }

Index: xsrc/external/mit/xorg-server/dist/hw/sun/sunMouse.c
diff -u xsrc/external/mit/xorg-server/dist/hw/sun/sunMouse.c:1.4 xsrc/external/mit/xorg-server/dist/hw/sun/sunMouse.c:1.5
--- xsrc/external/mit/xorg-server/dist/hw/sun/sunMouse.c:1.4	Thu Mar 11 11:54:41 2021
+++ xsrc/external/mit/xorg-server/dist/hw/sun/sunMouse.c	Wed Mar 17 15:02:27 2021
@@ -180,6 +180,9 @@ sunMouseProc(DeviceIntPtr device, int wh
 	pMouse->on = FALSE;
 	RemoveNotifyFd(sunPtrPriv.fd);
 	break;
+
+	case DEVICE_ABORT:
+	break;
 }
 return Success;
 }



CVS commit: src/sys/arch/sandpoint/pci

2021-03-17 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Wed Mar 17 14:58:16 UTC 2021

Modified Files:
src/sys/arch/sandpoint/pci: pciide_machdep.c

Log Message:
Make this distinguishable with native PCI interrupt.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/sandpoint/pci/pciide_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/sandpoint/pci/pciide_machdep.c
diff -u src/sys/arch/sandpoint/pci/pciide_machdep.c:1.6 src/sys/arch/sandpoint/pci/pciide_machdep.c:1.7
--- src/sys/arch/sandpoint/pci/pciide_machdep.c:1.6	Wed Mar 17 14:50:11 2021
+++ src/sys/arch/sandpoint/pci/pciide_machdep.c	Wed Mar 17 14:58:16 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: pciide_machdep.c,v 1.6 2021/03/17 14:50:11 rin Exp $	*/
+/*	$NetBSD: pciide_machdep.c,v 1.7 2021/03/17 14:58:16 rin Exp $	*/
 
 /*
  * Copyright (c) 1998 Christopher G. Demetriou.  All rights reserved.
@@ -41,7 +41,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pciide_machdep.c,v 1.6 2021/03/17 14:50:11 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pciide_machdep.c,v 1.7 2021/03/17 14:58:16 rin Exp $");
 
 #include 
 #include 
@@ -63,10 +63,12 @@ pciide_machdep_compat_intr_establish(dev
 #if NISA > 0
 	int irq;
 	void *cookie;
+	char intr_xname[INTRDEVNAMEBUF];
 
 	irq = PCIIDE_COMPAT_IRQ(chan);
+	snprintf(intr_xname, sizeof(intr_xname), "%s isa", device_xname(dev));
 	cookie = isa_intr_establish_xname(NULL, irq, IST_LEVEL, IPL_BIO, func,
-	arg, device_xname(dev));
+	arg, intr_xname);
 	if (cookie == NULL)
 		return (NULL);
 	aprint_normal_dev(dev, "%s channel interrupting at irq %d\n",



CVS commit: src/sys/arch/sandpoint

2021-03-17 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Wed Mar 17 14:50:11 UTC 2021

Modified Files:
src/sys/arch/sandpoint/pci: pciide_machdep.c
src/sys/arch/sandpoint/sandpoint: com_eumb.c machdep.c nhpow.c satmgr.c

Log Message:
Switch to intr_establish_xname().


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/sandpoint/pci/pciide_machdep.c
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/sandpoint/sandpoint/com_eumb.c
cvs rdiff -u -r1.67 -r1.68 src/sys/arch/sandpoint/sandpoint/machdep.c
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/sandpoint/sandpoint/nhpow.c
cvs rdiff -u -r1.29 -r1.30 src/sys/arch/sandpoint/sandpoint/satmgr.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/sandpoint/pci/pciide_machdep.c
diff -u src/sys/arch/sandpoint/pci/pciide_machdep.c:1.5 src/sys/arch/sandpoint/pci/pciide_machdep.c:1.6
--- src/sys/arch/sandpoint/pci/pciide_machdep.c:1.5	Sat Jun 18 08:08:30 2011
+++ src/sys/arch/sandpoint/pci/pciide_machdep.c	Wed Mar 17 14:50:11 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: pciide_machdep.c,v 1.5 2011/06/18 08:08:30 matt Exp $	*/
+/*	$NetBSD: pciide_machdep.c,v 1.6 2021/03/17 14:50:11 rin Exp $	*/
 
 /*
  * Copyright (c) 1998 Christopher G. Demetriou.  All rights reserved.
@@ -41,7 +41,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pciide_machdep.c,v 1.5 2011/06/18 08:08:30 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pciide_machdep.c,v 1.6 2021/03/17 14:50:11 rin Exp $");
 
 #include 
 #include 
@@ -65,7 +65,8 @@ pciide_machdep_compat_intr_establish(dev
 	void *cookie;
 
 	irq = PCIIDE_COMPAT_IRQ(chan);
-	cookie = isa_intr_establish(NULL, irq, IST_LEVEL, IPL_BIO, func, arg);
+	cookie = isa_intr_establish_xname(NULL, irq, IST_LEVEL, IPL_BIO, func,
+	arg, device_xname(dev));
 	if (cookie == NULL)
 		return (NULL);
 	aprint_normal_dev(dev, "%s channel interrupting at irq %d\n",

Index: src/sys/arch/sandpoint/sandpoint/com_eumb.c
diff -u src/sys/arch/sandpoint/sandpoint/com_eumb.c:1.10 src/sys/arch/sandpoint/sandpoint/com_eumb.c:1.11
--- src/sys/arch/sandpoint/sandpoint/com_eumb.c:1.10	Sun Apr  7 15:44:44 2019
+++ src/sys/arch/sandpoint/sandpoint/com_eumb.c	Wed Mar 17 14:50:11 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: com_eumb.c,v 1.10 2019/04/07 15:44:44 jdc Exp $ */
+/* $NetBSD: com_eumb.c,v 1.11 2021/03/17 14:50:11 rin Exp $ */
 
 /*-
  * Copyright (c) 2007 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: com_eumb.c,v 1.10 2019/04/07 15:44:44 jdc Exp $");
+__KERNEL_RCSID(0, "$NetBSD: com_eumb.c,v 1.11 2021/03/17 14:50:11 rin Exp $");
 
 #include 
 #include 
@@ -101,7 +101,8 @@ com_eumb_attach(device_t parent, device_
 
 	com_attach_subr(sc);
 
-	intr_establish(epicirq + I8259_ICU, IST_LEVEL, IPL_SERIAL, comintr, sc);
+	intr_establish_xname(epicirq + I8259_ICU, IST_LEVEL, IPL_SERIAL,
+	comintr, sc, device_xname(self));
 	aprint_normal_dev(self, "interrupting at irq %d\n",
 	epicirq + I8259_ICU);
 }

Index: src/sys/arch/sandpoint/sandpoint/machdep.c
diff -u src/sys/arch/sandpoint/sandpoint/machdep.c:1.67 src/sys/arch/sandpoint/sandpoint/machdep.c:1.68
--- src/sys/arch/sandpoint/sandpoint/machdep.c:1.67	Sun Jul 15 05:16:44 2018
+++ src/sys/arch/sandpoint/sandpoint/machdep.c	Wed Mar 17 14:50:11 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.67 2018/07/15 05:16:44 maxv Exp $	*/
+/*	$NetBSD: machdep.c,v 1.68 2021/03/17 14:50:11 rin Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.67 2018/07/15 05:16:44 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.68 2021/03/17 14:50:11 rin Exp $");
 
 #include "opt_compat_netbsd.h"
 #include "opt_ddb.h"
@@ -257,7 +257,8 @@ cpu_startup(void)
 	 * set up i8259 as a cascade on EPIC irq 0.
 	 * XXX exceptional SP2 has 17
 	 */
-	intr_establish(16, IST_LEVEL, IPL_HIGH, pic_handle_intr, isa_pic);
+	intr_establish_xname(16, IST_LEVEL, IPL_HIGH, pic_handle_intr, isa_pic,
+	"i8259");
 #else
 	mpcpic_reserv16();
 	(void)setup_mpcpic(baseaddr);

Index: src/sys/arch/sandpoint/sandpoint/nhpow.c
diff -u src/sys/arch/sandpoint/sandpoint/nhpow.c:1.1 src/sys/arch/sandpoint/sandpoint/nhpow.c:1.2
--- src/sys/arch/sandpoint/sandpoint/nhpow.c:1.1	Sat Jan 14 19:39:25 2012
+++ src/sys/arch/sandpoint/sandpoint/nhpow.c	Wed Mar 17 14:50:11 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: nhpow.c,v 1.1 2012/01/14 19:39:25 phx Exp $ */
+/* $NetBSD: nhpow.c,v 1.2 2021/03/17 14:50:11 rin Exp $ */
 
 /*-
  * Copyright (c) 2012 Frank Wille.
@@ -32,7 +32,7 @@
  * NH230/231 power and LED control, button handling
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: nhpow.c,v 1.1 2012/01/14 19:39:25 phx Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nhpow.c,v 1.2 2021/03/17 14:50:11 rin Exp $");
 #include "gpio.h"
 
 #include 
@@ -152,7 +152,8 @@ nhpow_attach(device_t parent, device_t s
 	callout_init(>sc_ch_pbutton, 0);	/* power-button callout */
 

CVS commit: src/share/man/man4

2021-03-17 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Wed Mar 17 14:10:29 UTC 2021

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

Log Message:
pci(4): many more drivers


To generate a diff of this commit:
cvs rdiff -u -r1.118 -r1.119 src/share/man/man4/pci.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/pci.4
diff -u src/share/man/man4/pci.4:1.118 src/share/man/man4/pci.4:1.119
--- src/share/man/man4/pci.4:1.118	Wed Mar 17 13:42:03 2021
+++ src/share/man/man4/pci.4	Wed Mar 17 14:10:29 2021
@@ -1,4 +1,4 @@
-.\"	$NetBSD: pci.4,v 1.118 2021/03/17 13:42:03 nia Exp $
+.\"	$NetBSD: pci.4,v 1.119 2021/03/17 14:10:29 nia Exp $
 .\"
 .\" Copyright (c) 1997 Jason R. Thorpe.  All rights reserved.
 .\" Copyright (c) 1997 Jonathan Stone
@@ -138,6 +138,10 @@ QLogic ISP-1020, ISP-1040, and ISP-2100 
 LSI Logic & Dell MegaRAID SAS RAID controllers.
 .It Xr mly 4
 Mylex AcceleRAID and eXtremeRAID controllers with v6 firmware.
+.It Xr mpii 4
+LSI Logic Fusion-MPT Message Passing Interface II SAS controllers.
+.It Xr mpt 4
+LSI Logic Fusion-MPT SCSI/Fibre Channel/SAS controllers.
 .It Xr nca 4
 Domex 536 SCSI interfaces.
 .It Xr pcscp 4
@@ -155,20 +159,34 @@ The Adaptec AAC family of RAID controlle
 AHCI 1.0 and 1.1 compliant SATA controllers.
 .It Xr amr 4
 The AMI and LSI Logic MegaRAID family of RAID controllers.
+.It Xr arcmsr 4
+Areca Technology Corporation SATA/SAS RAID controllers.
 .It Xr cac 4
 Compaq array controllers.
+.It Xr ciss 4
+HP/Compaq Smart ARRAY 5/6 RAID controllers.
 .It Xr icp 4
 ICP Vortex GDT and Intel Storage RAID controllers.
+.It Xr ixpide 4
+ATI Technologies IXP IDE controllers
 .It Xr mlx 4
 Mylex DAC960 and DEC SWXCR RAID controllers.
+.It Xr nside 4
+National Semiconductor PC87415 PCI-IDE controllers.
 .It Xr nvme 4
 Non-Volatile Memory (NVM Express) host controllers.
 .It Xr pciide 4
 IDE disk controllers.
 .It Xr rtsx 4
 Realtek SD card readers.
+.It Xr svwsata 4
+Serverworks Serial ATA disk controllers.
+.It Xr twa 4
+3ware Apache RAID controllers.
 .It Xr twe 4
 3Ware Escalade RAID controllers.
+.It Xr viaide 4
+AMD, NVIDIA and VIA IDE disk controllers.
 .El
 .Ss Wired network interfaces
 .Bl -tag -width pcdisplay(4) -offset indent
@@ -190,6 +208,8 @@ Elastic Network Adapter interfaces.
 3Com 3c590, 3c595, 3c900, and 3c905 Ethernet interfaces.
 .It Xr epic 4
 SMC83C170 (EPIC/100) Ethernet interfaces.
+.It Xr et 4
+Agere/LSI ET1310/ET1301 10/100/1000 Ethernet interfaces.
 .It Xr ex 4
 3Com 3c900, 3c905, and 3c980 Ethernet interfaces.
 .It Xr fxp 4
@@ -202,11 +222,15 @@ Sun Microelectronics STP2002-STQ Etherne
 Intel 82598EB, 82599, X540 and X550 10 Gigabit Ethernet interfaces.
 .It Xr ixl 4
 Intel 700 series Ethernet interfaces.
+.It Xr jme 4
+JMicron Technologies JMC250/JMC260 Ethernet interfaces.
 .It Xr le 4
 PCNet-PCI Ethernet interfaces.
 Note, the
 .Xr pcn 4
 driver supersedes this driver.
+.It Xr lii 4
+Attansic/Atheros L2 Fast-Ethernet interfaces.
 .It Xr mcx 4
 Mellanox 5th generation Ethernet devices.
 .It Xr msk 4
@@ -344,6 +368,8 @@ Generic PCI bridges, including expansion
 Brooktree 848 compatible TV cards.
 .It Xr ehci 4
 USB EHCI host controllers.
+.It Xr ibmcd 4
+IBM 4810 BSP cash drawer ports.
 .It Xr iop 4
 I2O I/O processors.
 .It Xr oboe 4



CVS commit: src/share/man/man4

2021-03-17 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Wed Mar 17 13:42:03 UTC 2021

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

Log Message:
add ale(4) and bge(4) to pci.4


To generate a diff of this commit:
cvs rdiff -u -r1.117 -r1.118 src/share/man/man4/pci.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/pci.4
diff -u src/share/man/man4/pci.4:1.117 src/share/man/man4/pci.4:1.118
--- src/share/man/man4/pci.4:1.117	Wed Mar 17 13:12:33 2021
+++ src/share/man/man4/pci.4	Wed Mar 17 13:42:03 2021
@@ -1,4 +1,4 @@
-.\"	$NetBSD: pci.4,v 1.117 2021/03/17 13:12:33 nia Exp $
+.\"	$NetBSD: pci.4,v 1.118 2021/03/17 13:42:03 nia Exp $
 .\"
 .\" Copyright (c) 1997 Jason R. Thorpe.  All rights reserved.
 .\" Copyright (c) 1997 Jonathan Stone
@@ -175,8 +175,13 @@ Realtek SD card readers.
 .It Xr alc 4
 Atheros AR813x/AR815x/AR816x/AR817x and Killer E2200/2400/2500
 10/100/1000 Ethernet interfaces.
+.It Xr ale 4
+Atheros AR8121/AR8113/AR8114 (Attansic L1E) 10/100/1000 Ethernet
+interfaces.
 .It Xr aq 4
 Aquantia AQC multigigabit Ethernet interfaces.
+.It Xr bge 4
+Broadcom BCM57xx/BCM590x 10/100/1000 Ethernet interfaces.
 .It Xr bnx 4
 Broadcom NetXtreme II 10/100/1000 Ethernet interfaces.
 .It Xr ena 4



CVS commit: src/share/man/man4

2021-03-17 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Wed Mar 17 13:12:33 UTC 2021

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

Log Message:
add alc(4)


To generate a diff of this commit:
cvs rdiff -u -r1.116 -r1.117 src/share/man/man4/pci.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/pci.4
diff -u src/share/man/man4/pci.4:1.116 src/share/man/man4/pci.4:1.117
--- src/share/man/man4/pci.4:1.116	Fri Mar 12 08:28:20 2021
+++ src/share/man/man4/pci.4	Wed Mar 17 13:12:33 2021
@@ -1,4 +1,4 @@
-.\"	$NetBSD: pci.4,v 1.116 2021/03/12 08:28:20 nia Exp $
+.\"	$NetBSD: pci.4,v 1.117 2021/03/17 13:12:33 nia Exp $
 .\"
 .\" Copyright (c) 1997 Jason R. Thorpe.  All rights reserved.
 .\" Copyright (c) 1997 Jonathan Stone
@@ -29,7 +29,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 March 12, 2021
+.Dd March 17, 2021
 .Dt PCI 4
 .Os
 .Sh NAME
@@ -172,6 +172,9 @@ Realtek SD card readers.
 .El
 .Ss Wired network interfaces
 .Bl -tag -width pcdisplay(4) -offset indent
+.It Xr alc 4
+Atheros AR813x/AR815x/AR816x/AR817x and Killer E2200/2400/2500
+10/100/1000 Ethernet interfaces.
 .It Xr aq 4
 Aquantia AQC multigigabit Ethernet interfaces.
 .It Xr bnx 4



CVS commit: src/sys/arch/mips

2021-03-17 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Wed Mar 17 11:05:37 UTC 2021

Modified Files:
src/sys/arch/mips/include: cpuregs.h
src/sys/arch/mips/mips: trap.c

Log Message:
Handle gas/gcc generating a break/trap 6 for integer overflow and
break/trap 7 for integer divide by zero and setting the SIGFPE
si_code of FPE_INTOVF or FPE_INTDIV respectively.  The break/trap
6/7 seems to have existed since the early days of MIPS but not
well documented anywhere.

Fixes ATF lib/libc/gen/t_siginfo::sigfpe_int .


To generate a diff of this commit:
cvs rdiff -u -r1.109 -r1.110 src/sys/arch/mips/include/cpuregs.h
cvs rdiff -u -r1.258 -r1.259 src/sys/arch/mips/mips/trap.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/mips/include/cpuregs.h
diff -u src/sys/arch/mips/include/cpuregs.h:1.109 src/sys/arch/mips/include/cpuregs.h:1.110
--- src/sys/arch/mips/include/cpuregs.h:1.109	Sat Aug 22 03:41:33 2020
+++ src/sys/arch/mips/include/cpuregs.h	Wed Mar 17 11:05:37 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpuregs.h,v 1.109 2020/08/22 03:41:33 simonb Exp $	*/
+/*	$NetBSD: cpuregs.h,v 1.110 2021/03/17 11:05:37 simonb Exp $	*/
 
 /*
  * Copyright (c) 2009 Miodrag Vallat.
@@ -679,6 +679,8 @@
 #define	MIPS_BREAK_INSTR	0x000d
 #define	MIPS_BREAK_VAL_MASK	0x03ff
 #define	MIPS_BREAK_VAL_SHIFT	16
+#define	MIPS_BREAK_INTOVERFLOW	  6 /* used by gas to indicate int overflow */
+#define	MIPS_BREAK_INTDIVZERO	  7 /* used by gas/gcc to indicate int div by zero */
 #define	MIPS_BREAK_KDB_VAL	512
 #define	MIPS_BREAK_SSTEP_VAL	513
 #define	MIPS_BREAK_BRKPT_VAL	514

Index: src/sys/arch/mips/mips/trap.c
diff -u src/sys/arch/mips/mips/trap.c:1.258 src/sys/arch/mips/mips/trap.c:1.259
--- src/sys/arch/mips/mips/trap.c:1.258	Sat Mar 13 17:14:11 2021
+++ src/sys/arch/mips/mips/trap.c	Wed Mar 17 11:05:37 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: trap.c,v 1.258 2021/03/13 17:14:11 skrll Exp $	*/
+/*	$NetBSD: trap.c,v 1.259 2021/03/17 11:05:37 simonb Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -39,7 +39,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.258 2021/03/13 17:14:11 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.259 2021/03/17 11:05:37 simonb Exp $");
 
 #include "opt_cputype.h"	/* which mips CPU levels do we support? */
 #include "opt_ddb.h"
@@ -159,7 +159,6 @@ void
 trap(uint32_t status, uint32_t cause, vaddr_t vaddr, vaddr_t pc,
 struct trapframe *tf)
 {
-	int type;
 	struct lwp * const l = curlwp;
 	struct proc * const p = curproc;
 	struct trapframe * const utf = l->l_md.md_utf;
@@ -168,6 +167,9 @@ trap(uint32_t status, uint32_t cause, va
 	ksiginfo_t ksi;
 	extern void fswintrberr(void);
 	void *onfault;
+	InstFmt insn;
+	uint32_t instr;
+	int type;
 	int rv = 0;
 
 	KSI_INIT_TRAP();
@@ -547,21 +549,46 @@ trap(uint32_t status, uint32_t cause, va
 		goto dopanic;
 #endif
 	case T_BREAK+T_USER: {
-		uint32_t instr;
-
 		/* compute address of break instruction */
 		vaddr_t va = pc + (cause & MIPS_CR_BR_DELAY ? sizeof(int) : 0);
 
 		/* read break instruction */
 		instr = mips_ufetch32((void *)va);
+		insn.word = instr;
 
 		if (l->l_md.md_ss_addr != va || instr != MIPS_BREAK_SSTEP) {
+			bool advance_pc = false;
+
 			ksi.ksi_trap = type & ~T_USER;
 			ksi.ksi_signo = SIGTRAP;
 			ksi.ksi_addr = (void *)va;
 			ksi.ksi_code = TRAP_TRACE;
-			/* we broke, skip it to avoid infinite loop */
-			if (instr == MIPS_BREAK_INSTR)
+
+			if ((insn.JType.op == OP_SPECIAL) &&
+			(insn.RType.func == OP_BREAK)) {
+int code = (insn.RType.rs << 5) | insn.RType.rt;
+switch (code) {
+case 0:
+	/* we broke, skip it to avoid infinite loop */
+	advance_pc = true;
+	break;
+case MIPS_BREAK_INTOVERFLOW:
+	ksi.ksi_signo = SIGFPE;
+	ksi.ksi_code = FPE_INTOVF;
+	advance_pc = true;
+	break;
+case MIPS_BREAK_INTDIVZERO:
+	ksi.ksi_signo = SIGFPE;
+	ksi.ksi_code = FPE_INTDIV;
+	advance_pc = true;
+	break;
+default:
+	/* do nothing */
+	break;
+}
+			}
+
+			if (advance_pc)
 tf->tf_regs[_R_PC] += 4;
 			break;
 		}
@@ -627,12 +654,40 @@ trap(uint32_t status, uint32_t cause, va
 		userret(l);
 		return; /* GEN */
 	case T_OVFLOW+T_USER:
-	case T_TRAP+T_USER:
+	case T_TRAP+T_USER: {
+		/* compute address of trap/faulting instruction */
+		vaddr_t va = pc + (cause & MIPS_CR_BR_DELAY ? sizeof(int) : 0);
+		bool advance_pc = false;
+
+		/* read break instruction */
+		instr = mips_ufetch32((void *)va);
+		insn.word = instr;
+
 		ksi.ksi_trap = type & ~T_USER;
 		ksi.ksi_signo = SIGFPE;
 		ksi.ksi_addr = (void *)(intptr_t)pc /*utf->tf_regs[_R_PC]*/;
 		ksi.ksi_code = FPE_FLTOVF; /* XXX */
+
+		if ((insn.JType.op == OP_SPECIAL) &&
+		(insn.RType.func == OP_TEQ)) {
+			int code = (insn.RType.rd << 5) | insn.RType.shamt;
+			switch (code) {
+			case MIPS_BREAK_INTOVERFLOW:
+ksi.ksi_code = FPE_INTOVF;
+advance_pc = 

CVS commit: src/lib/libc/sys

2021-03-17 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Wed Mar 17 08:13:29 UTC 2021

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

Log Message:
Remove superfluous article.


To generate a diff of this commit:
cvs rdiff -u -r1.64 -r1.65 src/lib/libc/sys/open.2

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

Modified files:

Index: src/lib/libc/sys/open.2
diff -u src/lib/libc/sys/open.2:1.64 src/lib/libc/sys/open.2:1.65
--- src/lib/libc/sys/open.2:1.64	Wed Mar 17 08:04:39 2021
+++ src/lib/libc/sys/open.2	Wed Mar 17 08:13:29 2021
@@ -1,4 +1,4 @@
-.\"	$NetBSD: open.2,v 1.64 2021/03/17 08:04:39 dholland Exp $
+.\"	$NetBSD: open.2,v 1.65 2021/03/17 08:13:29 wiz Exp $
 .\"
 .\" Copyright (c) 1980, 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -103,7 +103,7 @@ The
 are specified by
 .Em or Ns 'ing
 the values listed below.
-Applications must specify exactly one of the these four values
+Applications must specify exactly one of these four values
 (file access methods):
 .Bl -tag -offset indent -width O_DIRECTORY
 .It Dv O_RDONLY



CVS commit: src/lib/libc/sys

2021-03-17 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Wed Mar 17 08:04:39 UTC 2021

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

Log Message:
Clarify use of open flags in open(2).

(Avoid using values of three that are equal to four.)


To generate a diff of this commit:
cvs rdiff -u -r1.63 -r1.64 src/lib/libc/sys/open.2

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

Modified files:

Index: src/lib/libc/sys/open.2
diff -u src/lib/libc/sys/open.2:1.63 src/lib/libc/sys/open.2:1.64
--- src/lib/libc/sys/open.2:1.63	Mon Nov 30 00:21:35 2020
+++ src/lib/libc/sys/open.2	Wed Mar 17 08:04:39 2021
@@ -1,4 +1,4 @@
-.\"	$NetBSD: open.2,v 1.63 2020/11/30 00:21:35 riastradh Exp $
+.\"	$NetBSD: open.2,v 1.64 2021/03/17 08:04:39 dholland Exp $
 .\"
 .\" Copyright (c) 1980, 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -29,7 +29,7 @@
 .\"
 .\" @(#)open.2	8.2 (Berkeley) 11/16/93
 .\"
-.Dd September 16, 2019
+.Dd March 17, 2021
 .Dt OPEN 2
 .Os
 .Sh NAME
@@ -103,7 +103,7 @@ The
 are specified by
 .Em or Ns 'ing
 the values listed below.
-Applications must specify exactly one of the first three values
+Applications must specify exactly one of the these four values
 (file access methods):
 .Bl -tag -offset indent -width O_DIRECTORY
 .It Dv O_RDONLY
@@ -116,7 +116,7 @@ Open for execute only.
 Open for reading and writing.
 .El
 .Pp
-Any combination of the following may be used:
+Any combination of the following may be used as well:
 .Bl -tag -offset indent -width O_DIRECTORY
 .It Dv O_NONBLOCK
 Do not block on open or for data to become available.