Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/hpcsh console module refers hd64461video's needs-fl...



details:   https://anonhg.NetBSD.org/src/rev/94e1dd819a6f
branches:  trunk
changeset: 511868:94e1dd819a6f
user:      uch <uch%NetBSD.org@localhost>
date:      Thu Jun 28 17:03:47 2001 +0000

description:
console module refers hd64461video's needs-flag instead of hd64461if.
(pointed by MAEKAWA Masahide)

diffstat:

 sys/arch/hpcsh/conf/files.hpcsh |   6 +++---
 sys/arch/hpcsh/hpcsh/console.c  |  41 ++++++++++++++++++++++++-----------------
 2 files changed, 27 insertions(+), 20 deletions(-)

diffs (140 lines):

diff -r c278c2968f75 -r 94e1dd819a6f sys/arch/hpcsh/conf/files.hpcsh
--- a/sys/arch/hpcsh/conf/files.hpcsh   Thu Jun 28 15:46:00 2001 +0000
+++ b/sys/arch/hpcsh/conf/files.hpcsh   Thu Jun 28 17:03:47 2001 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: files.hpcsh,v 1.12 2001/06/04 17:08:36 uch Exp $
+#      $NetBSD: files.hpcsh,v 1.13 2001/06/28 17:03:47 uch Exp $
 #
 maxpartitions 8
 
@@ -63,7 +63,7 @@
 define hd64461if {}
 device hd64461if: hd64461if
 attach hd64461if at shb
-file   arch/hpcsh/dev/hd64461/hd64461.c        hd64461if needs-flag
+file   arch/hpcsh/dev/hd64461/hd64461.c        hd64461if
 
 device hd64461pcmcia: pcmciabus
 attach hd64461pcmcia at hd64461if
@@ -74,7 +74,7 @@
 
 device hd64461video: hpcfbif
 attach hd64461video at hd64461if
-file   arch/hpcsh/dev/hd64461/hd64461video.c   hd64461video
+file   arch/hpcsh/dev/hd64461/hd64461video.c   hd64461video    needs-flag
 file   dev/hpc/video_subr.c                    hd64461video
 
 # network devices MII bus
diff -r c278c2968f75 -r 94e1dd819a6f sys/arch/hpcsh/hpcsh/console.c
--- a/sys/arch/hpcsh/hpcsh/console.c    Thu Jun 28 15:46:00 2001 +0000
+++ b/sys/arch/hpcsh/hpcsh/console.c    Thu Jun 28 17:03:47 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: console.c,v 1.3 2001/06/04 17:08:36 uch Exp $  */
+/*     $NetBSD: console.c,v 1.4 2001/06/28 17:03:47 uch Exp $  */
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -42,7 +42,7 @@
 #include "sci.h"
 #include "scif.h"
 #include "com.h"
-#include "hd64461if.h"
+#include "hd64461video.h"
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -87,7 +87,7 @@
 #endif
 
 /* HD64461 video module */
-#if NHD64461IF > 0
+#if NHD64461VIDEO > 0
 cons_decl(hd64461video_);
 #if NWSKBD > 0
 #define hd64461video_cngetc    wskbd_cngetc
@@ -109,7 +109,7 @@
 #if NBICONSDEV > 0
        cons_init(bicons),
 #endif
-#if NHD64461IF > 0
+#if NHD64461VIDEO > 0
        cons_init(hd64461video_),
 #endif
 #if NSCI > 0
@@ -123,19 +123,18 @@
 #endif
        { 0 } /* terminator */
 };
-#define CN_SELECTED    (CN_REMOTE + 1)         /* highest priority */
-#define CN_ENABLE(x)   set_console(x##cnputc, x##cnprobe)
+#define CN_ENABLE(x)   set_console(x ## cnputc, x ## cnprobe)
 
 static int initialized;
+static int attach_kbd = 1;
 static void set_console(void (*)(dev_t, int), void (*)(struct consdev *));
 static void disable_console(void);
 static void cn_nonprobe(struct consdev *);
+static void enable_bicons(void);
 
 void
 consinit()
 {
-       int serial_console = 1;
-
        if (initialized)
                return;
 
@@ -145,14 +144,13 @@
        switch (bootinfo->bi_cnuse) {
        case BI_CNUSE_BUILTIN:
 #if NBICONSDEV > 0
-               CN_ENABLE(bicons);
-               serial_console = 0;
+               enable_bicons();
 #endif
                break;
        case BI_CNUSE_HD64461VIDEO:
-#if NHD64461IF > 0
+#if NHD64461VIDEO > 0
                CN_ENABLE(hd64461video_);
-               serial_console = 0;
+               attach_kbd = 1;
 #endif
                break;
        case BI_CNUSE_SCI:
@@ -173,17 +171,15 @@
        }
 
 #if NBICONSDEV > 0
-       if (!initialized) { /* use builtin console instead */
-               bootinfo->bi_cnuse = BI_CNUSE_BUILTIN;
-               CN_ENABLE(bicons);
-       }
+       if (!initialized) /* use builtin console instead */
+               enable_bicons();
 #endif
 
        if (initialized)
                cninit();
 
 #if NPFCKBD > 0
-       if (!serial_console)
+       if (attach_kbd)
                pfckbd_cnattach();
 #endif
 
@@ -222,3 +218,14 @@
 {
        cp->cn_pri = CN_DEAD;
 }
+
+#if NBICONSDEV > 0
+static void
+enable_bicons()
+{
+       bootinfo->bi_cnuse = BI_CNUSE_BUILTIN;
+       bicons_set_priority(CN_INTERNAL);
+       CN_ENABLE(bicons);
+       attach_kbd = 1;
+}
+#endif



Home | Main Index | Thread Index | Old Index