Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/sgimips/dev read dbaud from ARCS and use that for c...



details:   https://anonhg.NetBSD.org/src/rev/7d15b2e91ea4
branches:  trunk
changeset: 515917:7d15b2e91ea4
user:      pooka <pooka%NetBSD.org@localhost>
date:      Mon Oct 08 15:53:07 2001 +0000

description:
read dbaud from ARCS and use that for com rate, not hardcoded 38400

diffstat:

 sys/arch/sgimips/dev/com_mace.c |  19 ++++++++++++-------
 1 files changed, 12 insertions(+), 7 deletions(-)

diffs (52 lines):

diff -r 51cc8b6d4d62 -r 7d15b2e91ea4 sys/arch/sgimips/dev/com_mace.c
--- a/sys/arch/sgimips/dev/com_mace.c   Mon Oct 08 15:35:06 2001 +0000
+++ b/sys/arch/sgimips/dev/com_mace.c   Mon Oct 08 15:53:07 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: com_mace.c,v 1.1 2000/06/14 16:13:53 soren Exp $       */
+/*     $NetBSD: com_mace.c,v 1.2 2001/10/08 15:53:07 pooka Exp $       */
 
 /*
  * Copyright (c) 2000 Soren S. Jorvang
@@ -53,6 +53,9 @@
 
 #include <sgimips/dev/macevar.h>
 
+#include <dev/arcbios/arcbios.h>
+#include <dev/arcbios/arcbiosvar.h>
+
 #include <dev/ic/comreg.h>
 #include <dev/ic/comvar.h>
 
@@ -91,6 +94,8 @@
        struct com_mace_softc *msc = (void *)self;
        struct com_softc *sc = &msc->sc_com;
        struct mace_attach_args *maa = aux;
+       unsigned long rate;
+       char *dbaud;
 
        sc->sc_iot = maa->maa_st;
        sc->sc_ioh = maa->maa_sh;
@@ -111,17 +116,17 @@
        console = GetEnvironmentVariable("console");
 
        if console[0] = 'd'
-
-       dbaud = GetEnvironmentVariable("dbaud");
-
-       rate = strtoul(dbaud);
-
 #endif
+       dbaud = ARCBIOS->GetEnvironmentVariable("dbaud");
+       if (dbaud != NULL)
+               rate = strtoul(dbaud, NULL, 10);
+       else
+               rate = 9600;
 
        delay(10000); 
        /* if console    & dbaud */
        if (console == 0) {
-               comcnattach(sc->sc_iot, sc->sc_ioh, 38400, COM_FREQ, CONMODE);
+               comcnattach(sc->sc_iot, sc->sc_ioh, rate, COM_FREQ, CONMODE);
                console = 1;
        }
        delay(10000);



Home | Main Index | Thread Index | Old Index