Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/sparc64/dev Sync with sparc: rename



details:   https://anonhg.NetBSD.org/src/rev/444960467b41
branches:  trunk
changeset: 559521:444960467b41
user:      pk <pk%NetBSD.org@localhost>
date:      Fri Mar 19 15:21:42 2004 +0000

description:
Sync with sparc: rename
        stdinnode => prom_stdin_node,
        fbnode => prom_stdout_node.

diffstat:

 sys/arch/sparc64/dev/cons.h     |  12 +++++++-
 sys/arch/sparc64/dev/consinit.c |  59 ++++++++++++++++++++++------------------
 2 files changed, 44 insertions(+), 27 deletions(-)

diffs (149 lines):

diff -r 8795bcc2b1a5 -r 444960467b41 sys/arch/sparc64/dev/cons.h
--- a/sys/arch/sparc64/dev/cons.h       Fri Mar 19 15:16:18 2004 +0000
+++ b/sys/arch/sparc64/dev/cons.h       Fri Mar 19 15:21:42 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cons.h,v 1.3 2000/05/19 05:26:17 eeh Exp $     */
+/*     $NetBSD: cons.h,v 1.4 2004/03/19 15:21:42 pk Exp $      */
 
 /*-
  * Copyright (c) 2000 Eduardo E. Horvath
@@ -66,3 +66,13 @@
 void zs_kgdb_init __P((void));
 void zskgdb __P((struct zs_chanstate *));
 #endif
+
+/*
+ * PROM I/O nodes and arguments are prepared by consinit().
+ * Drivers can examine these when looking for a console device match.
+ */
+extern int prom_stdin_node;
+extern int prom_stdout_node;
+extern char prom_stdin_args[]; /* not used on sun4u */
+extern char prom_stdout_args[];        /* not used on sun4u */
+
diff -r 8795bcc2b1a5 -r 444960467b41 sys/arch/sparc64/dev/consinit.c
--- a/sys/arch/sparc64/dev/consinit.c   Fri Mar 19 15:16:18 2004 +0000
+++ b/sys/arch/sparc64/dev/consinit.c   Fri Mar 19 15:21:42 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: consinit.c,v 1.14 2003/10/21 08:20:15 petrov Exp $     */
+/*     $NetBSD: consinit.c,v 1.15 2004/03/19 15:21:42 pk Exp $ */
 
 /*-
  * Copyright (c) 1999 Eduardo E. Horvath
@@ -29,7 +29,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: consinit.c,v 1.14 2003/10/21 08:20:15 petrov Exp $");
+__KERNEL_RCSID(0, "$NetBSD: consinit.c,v 1.15 2004/03/19 15:21:42 pk Exp $");
 
 #include "opt_ddb.h"
 #include "pcons.h"
@@ -112,7 +112,7 @@
 #ifdef DDB
        static int nplus = 0;
 #endif
-       
+
        while ((l = OF_read(stdin, &ch, 1)) != 1)
                /* void */;
 #ifdef DDB
@@ -161,13 +161,13 @@
                 /* Entering debugger. */
 #if NFB > 0
                 fb_unblank();
-#endif  
+#endif
        } else {
                 /* Resuming kernel. */
        }
 #if NPCONS > 0
        pcons_cnpollc(dev, on);
-#endif  
+#endif
 }
 
 /*****************************************************************/
@@ -178,6 +178,9 @@
 #define        DBPRINT(x)
 #endif
 
+int prom_stdin_node;
+int prom_stdout_node;
+
 /*
  * This function replaces sys/dev/cninit.c
  * Determine which device is the console using
@@ -186,47 +189,51 @@
 void
 consinit()
 {
-       register int chosen;
+       int chosen;
        char buffer[128];
-       extern int stdinnode, fbnode;
        char *consname = "unknown";
-       
+
        DBPRINT(("consinit()\r\n"));
-       if (cn_tab != &consdev_prom) return;
-       
+
+       if (cn_tab != &consdev_prom)
+               return;
+
+       chosen = OF_finddevice("/chosen");
+
        DBPRINT(("setting up stdin\r\n"));
-       chosen = OF_finddevice("/chosen");
        DBPRINT(("chosen = %x, stdin @ %p\r\n", chosen, &stdin));
        OF_getprop(chosen, "stdin",  &stdin, sizeof(stdin));
        DBPRINT(("stdin instance = %x\r\n", stdin));
-       
-       if ((stdinnode = OF_instance_to_package(stdin)) == 0) {
+
+       if ((prom_stdin_node = OF_instance_to_package(stdin)) == 0) {
                printf("WARNING: no PROM stdin\n");
-       } 
-               
-       DBPRINT(("stdin node = %x\r\n", stdinnode));
+       }
+
+       DBPRINT(("stdin node = %x\r\n", prom_stdin_node));
+
        DBPRINT(("setting up stdout\r\n"));
        OF_getprop(chosen, "stdout", &stdout, sizeof(stdout));
-       
        DBPRINT(("stdout instance = %x\r\n", stdout));
-       
-       if ((fbnode = OF_instance_to_package(stdout)) == 0)
+
+       if ((prom_stdout_node = OF_instance_to_package(stdout)) == 0)
                printf("WARNING: no PROM stdout\n");
-       
+
        DBPRINT(("stdout package = %x\r\n", fbnode));
+
        DBPRINT(("buffer @ %p\r\n", buffer));
-       
-       if (stdinnode && (OF_getproplen(stdinnode,"keyboard") >= 0)) {
-#if NKBD > 0           
+
+       if (prom_stdin_node != 0 &&
+           (OF_getproplen(prom_stdin_node, "keyboard") >= 0)) {
+#if NKBD > 0
                printf("cninit: kdb/display not configured\n");
 #endif
                consname = "keyboard/display";
-       } else if (fbnode && 
-               (OF_instance_to_path(stdin, buffer, sizeof(buffer)) >= 0)) {
+       } else if (prom_stdout_node != 0 &&
+                  (OF_instance_to_path(stdin, buffer, sizeof(buffer)) >= 0)) {
                consname = buffer;
        }
        printf("console is %s\n", consname);
- 
+
        /* Initialize PROM console */
        (*cn_tab->cn_probe)(cn_tab);
        (*cn_tab->cn_init)(cn_tab);



Home | Main Index | Thread Index | Old Index