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 in pci_conf_read() and pci_conf_write()...



details:   https://anonhg.NetBSD.org/src/rev/c5c88d715617
branches:  trunk
changeset: 515008:c5c88d715617
user:      mrg <mrg%NetBSD.org@localhost>
date:      Sat Sep 15 19:32:14 2001 +0000

description:
in pci_conf_read() and pci_conf_write(), convert all printf()'s to only
occur if SPDB_CONF (and hence DEBUG).  also convert the panic in
pci_conf_write() to a SPDB_CONF warning and a return.

this cleans up pcictl(8) support.

diffstat:

 sys/arch/sparc64/dev/pci_machdep.c |  13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

diffs (34 lines):

diff -r 024fa4cd6cc2 -r c5c88d715617 sys/arch/sparc64/dev/pci_machdep.c
--- a/sys/arch/sparc64/dev/pci_machdep.c        Sat Sep 15 18:35:00 2001 +0000
+++ b/sys/arch/sparc64/dev/pci_machdep.c        Sat Sep 15 19:32:14 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pci_machdep.c,v 1.23 2001/08/23 16:14:12 eeh Exp $     */
+/*     $NetBSD: pci_machdep.c,v 1.24 2001/09/15 19:32:14 mrg Exp $     */
 
 /*
  * Copyright (c) 1999, 2000 Matthew R. Green
@@ -359,8 +359,8 @@
                        PCITAG_OFFSET(tag) + reg);
        }
 #ifdef DEBUG
-       else printf("pci_conf_read: bogus pcitag %x\n",
-               (int)PCITAG_OFFSET(tag));
+       else DPRINTF(SPDB_CONF, ("pci_conf_read: bogus pcitag %x\n",
+               (int)PCITAG_OFFSET(tag)));
 #endif
        DPRINTF(SPDB_CONF, (" returning %08x\n", (u_int)val));
 
@@ -384,8 +384,11 @@
                (long long)(sc->sc_configaddr + PCITAG_OFFSET(tag) + reg), 
                (int)PCITAG_OFFSET(tag) + reg));
 
-       if (PCITAG_NODE(tag) == -1)
-               panic("pci_conf_write: bad addr");
+       /* If we don't know it, just punt it.  */
+       if (PCITAG_NODE(tag) == -1) {
+               DPRINTF(SPDB_CONF, ("pci_conf_write: bad addr"));
+               return;
+       }
                
        bus_space_write_4(sc->sc_configtag, sc->sc_configaddr, 
                PCITAG_OFFSET(tag) + reg, data);



Home | Main Index | Thread Index | Old Index