Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/sparc/sparc Implement notimplemented() for OpenFirm...



details:   https://anonhg.NetBSD.org/src/rev/7ddc232c5a1f
branches:  trunk
changeset: 510120:7ddc232c5a1f
user:      uwe <uwe%NetBSD.org@localhost>
date:      Sun May 20 20:38:24 2001 +0000

description:
Implement notimplemented() for OpenFirmware.
Implement opf_nextprop().
Reuse obp_v2_putstr for OF promops.

diffstat:

 sys/arch/sparc/sparc/promlib.c |  34 +++++++++++++++++++---------------
 1 files changed, 19 insertions(+), 15 deletions(-)

diffs (64 lines):

diff -r 1a4ce46271ec -r 7ddc232c5a1f sys/arch/sparc/sparc/promlib.c
--- a/sys/arch/sparc/sparc/promlib.c    Sun May 20 17:28:16 2001 +0000
+++ b/sys/arch/sparc/sparc/promlib.c    Sun May 20 20:38:24 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: promlib.c,v 1.6 1999/05/03 07:32:50 pk Exp $ */
+/*     $NetBSD: promlib.c,v 1.7 2001/05/20 20:38:24 uwe Exp $ */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -157,13 +157,21 @@
                (*sun4pvec->fbWriteStr)(str, n);
        } else
 #endif
-       if (obpvec->pv_romvec_vers < 2) {
-               (*obpvec->pv_putstr)(str, n);
-       } else {
-               int fd = *obpvec->pv_v2bootargs.v2_fd1;
-               (*obpvec->pv_v2devops.v2_write)(fd, str, n);
+       if (obpvec->pv_magic == OBP_MAGIC) {
+               if (obpvec->pv_romvec_vers < 2) {
+                       (*obpvec->pv_putstr)(str, n);
+               } else {
+                       int fd = *obpvec->pv_v2bootargs.v2_fd1;
+                       (*obpvec->pv_v2devops.v2_write)(fd, str, n);
+               }
+       } else {        /* assume OFW */
+               static int stdout_node;
+               if (stdout_node == 0) {
+                       int chosen = findchosen();
+                       OF_getprop(chosen, "stdout", &stdout_node, sizeof(int));
+               }
+               OF_write(stdout_node, str, n);
        }
-
 }
 
 
@@ -753,15 +761,10 @@
        int node;
        char *prop;
 {
-#if 0
-       if (OF_nextprop(node, prop, buf) != 0)
-               return (NULL);
-
+#define OF_NEXTPROP_BUF_SIZE 32        /* specified by the standard */
+       static char buf[OF_NEXTPROP_BUF_SIZE];
+       OF_nextprop(node, prop, buf);
        return (buf);
-#else
-       printf("opf_nextprop not implemented yet\n");
-       return (NULL);
-#endif
 }
 
 static void prom_init_oldmon __P((void));
@@ -943,6 +946,7 @@
        promops.po_putchar = obp_v2_putchar;
        promops.po_getchar = obp_v2_getchar;
        promops.po_peekchar = obp_v2_peekchar;
+       promops.po_putstr = obp_v2_putstr;
 
        promops.po_open = OF_open;
        promops.po_close = OF_close;



Home | Main Index | Thread Index | Old Index