summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorpk <pk@NetBSD.org>2004-03-19 15:21:42 +0000
committerpk <pk@NetBSD.org>2004-03-19 15:21:42 +0000
commit6c02638ef293d3ee609ab97089dde45010ffd8e6 (patch)
treec5ccb4ecd0836cda943068490554fc5c3f3a2d3d /sys
parentb2c52e1175eac9a52a1598c990b557c22c458f84 (diff)
Sync with sparc: rename
stdinnode => prom_stdin_node, fbnode => prom_stdout_node.
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/sparc64/dev/cons.h12
-rw-r--r--sys/arch/sparc64/dev/consinit.c59
2 files changed, 44 insertions, 27 deletions
diff --git a/sys/arch/sparc64/dev/cons.h b/sys/arch/sparc64/dev/cons.h
index 514b80365b0..f1f7abfaf10 100644
--- a/sys/arch/sparc64/dev/cons.h
+++ b/sys/arch/sparc64/dev/cons.h
@@ -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 @@ zs_get_chan_addr __P((int zsc_unit, int channel));
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 --git a/sys/arch/sparc64/dev/consinit.c b/sys/arch/sparc64/dev/consinit.c
index e8a0fa64239..f431e005161 100644
--- a/sys/arch/sparc64/dev/consinit.c
+++ b/sys/arch/sparc64/dev/consinit.c
@@ -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 @@ prom_cngetc(dev)
#ifdef DDB
static int nplus = 0;
#endif
-
+
while ((l = OF_read(stdin, &ch, 1)) != 1)
/* void */;
#ifdef DDB
@@ -161,13 +161,13 @@ prom_cnpollc(dev, on)
/* 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 @@ prom_cnpollc(dev, on)
#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 @@ prom_cnpollc(dev, on)
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;
-
- DBPRINT(("setting up stdin\r\n"));
+
+ if (cn_tab != &consdev_prom)
+ return;
+
chosen = OF_finddevice("/chosen");
+
+ DBPRINT(("setting up stdin\r\n"));
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);