Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/sys Enable us to enter DDB from serial console when WSDI...



details:   https://anonhg.NetBSD.org/src/rev/a88a390f9fb5
branches:  trunk
changeset: 1000371:a88a390f9fb5
user:      rin <rin%NetBSD.org@localhost>
date:      Tue Jul 23 17:39:36 2019 +0000

description:
Enable us to enter DDB from serial console when WSDISPLAY_MULTICONS
is enabled. This is necessary for machines on which framebuffer
console cannot be disabled at run time.

opt_wsdisplay_compat.h is generated for all ports including those
that do not support wscons.

OK Jared

diffstat:

 sys/dev/wscons/wsdisplay.c |  17 +++++++++++++++--
 sys/sys/systm.h            |   8 +++++++-
 2 files changed, 22 insertions(+), 3 deletions(-)

diffs (68 lines):

diff -r 597b557ba431 -r a88a390f9fb5 sys/dev/wscons/wsdisplay.c
--- a/sys/dev/wscons/wsdisplay.c        Tue Jul 23 17:21:33 2019 +0000
+++ b/sys/dev/wscons/wsdisplay.c        Tue Jul 23 17:39:36 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: wsdisplay.c,v 1.155 2019/07/23 15:55:49 jmcneill Exp $ */
+/* $NetBSD: wsdisplay.c,v 1.156 2019/07/23 17:39:36 rin Exp $ */
 
 /*
  * Copyright (c) 1996, 1997 Christopher G. Demetriou.  All rights reserved.
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: wsdisplay.c,v 1.155 2019/07/23 15:55:49 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wsdisplay.c,v 1.156 2019/07/23 17:39:36 rin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_wsdisplay_compat.h"
@@ -277,6 +277,19 @@
 int wsdisplay_clearonclose;
 
 #ifdef WSDISPLAY_MULTICONS
+/*
+ * Replace cn_isconsole() so that we can enter DDB from old console.
+ */
+bool
+wsdisplay_cn_isconsole(dev_t dev)
+{
+
+       return (cn_tab != NULL && cn_tab->cn_dev == dev) ||
+           (cn_tab == &wsdisplay_cons && !wsdisplay_multicons_suspended &&
+           wsdisplay_multicons_enable && wsdisplay_ocn != NULL &&
+           wsdisplay_ocn->cn_dev == dev);
+}
+
 static void
 wsscreen_getc_poll(void *priv)
 {
diff -r 597b557ba431 -r a88a390f9fb5 sys/sys/systm.h
--- a/sys/sys/systm.h   Tue Jul 23 17:21:33 2019 +0000
+++ b/sys/sys/systm.h   Tue Jul 23 17:39:36 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: systm.h,v 1.285 2019/05/20 20:35:45 christos Exp $     */
+/*     $NetBSD: systm.h,v 1.286 2019/07/23 17:39:36 rin Exp $  */
 
 /*-
  * Copyright (c) 1982, 1988, 1991, 1993
@@ -44,6 +44,7 @@
 #include "opt_multiprocessor.h"
 #include "opt_gprof.h"
 #include "opt_kleak.h"
+#include "opt_wsdisplay_compat.h"
 #endif
 #if !defined(_KERNEL) && !defined(_STANDALONE)
 #include <stdbool.h>
@@ -541,7 +542,12 @@
 #define cn_trap()      console_debugger()
 #endif
 #ifndef cn_isconsole
+#ifndef WSDISPLAY_MULTICONS
 #define cn_isconsole(d)        (cn_tab != NULL && (d) == cn_tab->cn_dev)
+#else
+bool wsdisplay_cn_isconsole(dev_t);
+#define cn_isconsole(d)        wsdisplay_cn_isconsole(d)
+#endif
 #endif
 
 void cn_init_magic(cnm_state_t *);



Home | Main Index | Thread Index | Old Index