Source-Changes-HG archive

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

[src/trunk]: src/sys/dev Fall back to nullcons if configured.



details:   https://anonhg.NetBSD.org/src/rev/ba88fc209fe1
branches:  trunk
changeset: 336267:ba88fc209fe1
user:      mlelstv <mlelstv%NetBSD.org@localhost>
date:      Mon Feb 23 06:54:12 2015 +0000

description:
Fall back to nullcons if configured.

diffstat:

 sys/dev/cons.c |  12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diffs (47 lines):

diff -r 7b682a1ba278 -r ba88fc209fe1 sys/dev/cons.c
--- a/sys/dev/cons.c    Mon Feb 23 04:16:17 2015 +0000
+++ b/sys/dev/cons.c    Mon Feb 23 06:54:12 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cons.c,v 1.72 2014/07/25 08:10:35 dholland Exp $       */
+/*     $NetBSD: cons.c,v 1.73 2015/02/23 06:54:12 mlelstv Exp $        */
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -39,7 +39,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cons.c,v 1.72 2014/07/25 08:10:35 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cons.c,v 1.73 2015/02/23 06:54:12 mlelstv Exp $");
 
 #include <sys/param.h>
 #include <sys/proc.h>
@@ -56,6 +56,8 @@
 
 #include <dev/cons.h>
 
+#include "nullcons.h"
+
 dev_type_open(cnopen);
 dev_type_close(cnclose);
 dev_type_read(cnread);
@@ -104,6 +106,11 @@
         * open() calls.
         */
        cndev = cn_tab->cn_dev;
+#if NNULLCONS > 0
+       if (cndev == NODEV) {
+               nullconsattach(0);
+       }
+#else /* NNULLCONS > 0 */
        if (cndev == NODEV) {
                /*
                 * This is most likely an error in the console attach
@@ -112,6 +119,7 @@
                 */
                panic("cnopen: no console device");
        }
+#endif /* NNULLCONS > 0 */
        if (dev == cndev) {
                /*
                 * This causes cnopen() to be called recursively, which



Home | Main Index | Thread Index | Old Index