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 adjust a bunch of debugging messages to...



details:   https://anonhg.NetBSD.org/src/rev/93380782dc40
branches:  trunk
changeset: 341871:93380782dc40
user:      mrg <mrg%NetBSD.org@localhost>
date:      Thu Nov 26 23:44:57 2015 +0000

description:
adjust a bunch of debugging messages to use __func__ and to normalise
newline usage (some sequences ended up printing blank lines.)

diffstat:

 sys/arch/sparc64/dev/psycho.c |  69 +++++++++++++++++++++---------------------
 1 files changed, 35 insertions(+), 34 deletions(-)

diffs (209 lines):

diff -r 951247939960 -r 93380782dc40 sys/arch/sparc64/dev/psycho.c
--- a/sys/arch/sparc64/dev/psycho.c     Thu Nov 26 23:29:05 2015 +0000
+++ b/sys/arch/sparc64/dev/psycho.c     Thu Nov 26 23:44:57 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: psycho.c,v 1.121 2015/10/02 05:22:52 msaitoh Exp $     */
+/*     $NetBSD: psycho.c,v 1.122 2015/11/26 23:44:57 mrg Exp $ */
 
 /*
  * Copyright (c) 1999, 2000 Matthew R. Green
@@ -55,7 +55,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: psycho.c,v 1.121 2015/10/02 05:22:52 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: psycho.c,v 1.122 2015/11/26 23:44:57 mrg Exp $");
 
 #include "opt_ddb.h"
 
@@ -865,8 +865,8 @@
                panic("could not get psycho bus-range, error %d", error);
        if (n != 2)
                panic("broken psycho bus-range");
-       DPRINTF(PDB_PROM, ("psycho debug: got `bus-range' for node %08x: %u - %u\n",
-                          node, brp[0], brp[1]));
+       DPRINTF(PDB_PROM, ("%s: got `bus-range' for node %08x: %u - %u\n",
+                          __func__, node, brp[0], brp[1]));
 }
 
 static void
@@ -876,8 +876,8 @@
        int len, busrange[2], *brp;
 
        DPRINTF(PDB_PROM,
-           ("psycho debug: fixing up `bus-range' for node %08x: %u - %u\n",
-           node0, brp0[0], brp0[1]));
+           ("%s: fixing up `bus-range' for node %08x: %u - %u\n",
+           __func__, node0, brp0[0], brp0[1]));
 
        /*
         * Check all nodes under this one and increase the bus range to
@@ -903,8 +903,8 @@
        }
 
        DPRINTF(PDB_PROM,
-           ("psycho debug: fixed up `bus-range' for node %08x: %u - %u\n",
-           node0, brp[0], brp[1]));
+           ("%s: fixed up `bus-range' for node %08x: %u - %u\n",
+           __func__, node0, brp[0], brp[1]));
 }
 
 static void
@@ -913,7 +913,8 @@
 
        if (prom_getprop(node, "ranges", sizeof(**rp), np, rp))
                panic("could not get psycho ranges");
-       DPRINTF(PDB_PROM, ("psycho debug: got `ranges' for node %08x: %d entries\n", node, *np));
+       DPRINTF(PDB_PROM, ("%s: got `ranges' for node %08x: %d entries\n",
+                         __func__, node, *np));
 }
 
 /*
@@ -1169,8 +1170,8 @@
        int ss;
 
        DPRINTF(PDB_BUSMAP,
-               ("_psycho_bus_map: type %d off %qx sz %qx flags %d",
-                       t->type, (unsigned long long)offset,
+               ("%s: type %d off %qx sz %qx flags %d",
+                       __func__, t->type, (unsigned long long)offset,
                        (unsigned long long)size, flags));
 
        ss = sparc_pci_childspace(t->type);
@@ -1179,9 +1180,9 @@
        pr = get_psychorange(pp, ss);
        if (pr != NULL) {
                paddr = BUS_ADDR(pr->phys_hi, pr->phys_lo + offset);
-               DPRINTF(PDB_BUSMAP, ("\n_psycho_bus_map: mapping paddr "
+               DPRINTF(PDB_BUSMAP, ("\n%s: mapping paddr "
                                     "space %lx offset %lx paddr %qx\n",
-                              (long)ss, (long)offset,
+                              __func__, (long)ss, (long)offset,
                               (unsigned long long)paddr));
                return ((*sc->sc_bustag->sparc_bus_map)(t, paddr, size,
                        flags, 0, hp));
@@ -1202,15 +1203,15 @@
 
        ss = sparc_pci_childspace(t->type);
 
-       DPRINTF(PDB_BUSMAP, ("_psycho_bus_mmap: prot %x flags %d pa %qx\n",
-               prot, flags, (unsigned long long)paddr));
+       DPRINTF(PDB_BUSMAP, ("%s: prot %x flags %d pa %qx\n",
+               __func__, prot, flags, (unsigned long long)paddr));
 
        pr = get_psychorange(pp, ss);
        if (pr != NULL) {
                paddr = BUS_ADDR(pr->phys_hi, pr->phys_lo + offset);
-               DPRINTF(PDB_BUSMAP, ("\n_psycho_bus_mmap: mapping paddr "
+               DPRINTF(PDB_BUSMAP, ("%s: mapping paddr "
                                     "space %lx offset %lx paddr %qx\n",
-                              (long)ss, (long)offset,
+                              __func__, (long)ss, (long)offset,
                               (unsigned long long)paddr));
                return (bus_space_mmap(sc->sc_bustag, paddr, off,
                                       prot, flags));
@@ -1233,8 +1234,8 @@
 
        addr = hp->_ptr;
        ss = sparc_pci_childspace(t->type);
-       DPRINTF(PDB_BUSMAP, ("psycho_bus_offset: type %d addr %" PRIx64
-                            " cspace %d", t->type, addr, ss));
+       DPRINTF(PDB_BUSMAP, ("%s: type %d addr %" PRIx64" cspace %d",
+                            __func__, t->type, addr, ss));
 
        pr = get_psychorange(pp, ss);
        if (pr != NULL) {
@@ -1242,17 +1243,17 @@
                        va = trunc_page((vaddr_t)addr);
                        if (pmap_extract(pmap_kernel(), va, &addr) == FALSE) {
                                DPRINTF(PDB_BUSMAP,
-                                       ("\n pmap_extract FAILED\n"));
+                                       ("- pmap_extract FAILED\n"));
                                return (-1);
                        }
                        addr += hp->_ptr & PGOFSET;
                }
                offset = BUS_ADDR_PADDR(addr) - pr->phys_lo;
-               DPRINTF(PDB_BUSMAP, ("\npsycho_bus_offset: paddr %" PRIx64
-                                    " offset %" PRIx64 "\n", addr, offset));
+               DPRINTF(PDB_BUSMAP, ("- paddr %" PRIx64" offset %" PRIx64 "\n",
+                                   addr, offset));
                return (offset);
        }
-       DPRINTF(PDB_BUSMAP, ("\n FAILED\n"));
+       DPRINTF(PDB_BUSMAP, ("- FAILED\n"));
        return (-1);
 }
 
@@ -1288,9 +1289,9 @@
         * interrupt which has a full vector that can be set arbitrarily.
         */
 
-       DPRINTF(PDB_INTR, ("\npsycho_intr_establish: ihandle %x vec %lx", ihandle, vec));
+       DPRINTF(PDB_INTR, ("%s: ihandle %x vec %lx", __func__, ihandle, vec));
        ino = INTINO(vec);
-       DPRINTF(PDB_INTR, (" ino %x", ino));
+       DPRINTF(PDB_INTR, (" ino %x\n", ino));
 
        /* If the device didn't ask for an IPL, use the one encoded. */
        if (level == IPL_NONE) level = INTLEV(vec);
@@ -1300,8 +1301,8 @@
                level = 2;
        }
 
-       DPRINTF(PDB_INTR, ("\npsycho: intr %lx: %p\nHunting for IRQ...\n",
-           (long)ino, intrlev[ino]));
+       DPRINTF(PDB_INTR, ("%s: intr %lx: %p\nHunting for IRQ...\n",
+           __func__, (long)ino, intrlev[ino]));
 
        /*
         * First look for PCI interrupts, otherwise the PCI A slot 0
@@ -1356,8 +1357,8 @@
        ih->ih_pending = 0;
 
        DPRINTF(PDB_INTR, (
-           "; installing handler %p arg %p with ino %u pil %u\n",
-           handler, arg, (u_int)ino, (u_int)ih->ih_pil));
+           "%s: installing handler %p arg %p with ino %u pil %u\n",
+           __func__, handler, arg, (u_int)ino, (u_int)ih->ih_pil));
 
        intr_establish(ih->ih_pil, level != IPL_VM, ih);
 
@@ -1370,8 +1371,8 @@
         */
        if (intrmapptr) {
                imap = *intrmapptr;
-               DPRINTF(PDB_INTR, ("; read intrmap = %016qx",
-                       (unsigned long long)imap));
+               DPRINTF(PDB_INTR, ("%s: read intrmap = %016qx",
+                       __func__, (unsigned long long)imap));
 
                /* Enable the interrupt */
                imap |= INTMAP_V|(CPU_UPAID << INTMAP_TID_SHIFT);
@@ -1379,7 +1380,7 @@
                DPRINTF(PDB_INTR, ("; writing intrmap = %016qx\n",
                        (unsigned long long)imap));
                *intrmapptr = imap;
-               DPRINTF(PDB_INTR, ("; reread intrmap = %016qx",
+               DPRINTF(PDB_INTR, ("; reread intrmap = %016qx\n",
                        (unsigned long long)(imap = *intrmapptr)));
        }
        if (intrclrptr) {
@@ -1425,7 +1426,7 @@
                splx(s);
        }
 #ifdef DEBUG
-       else DPRINTF(PDB_CONF, ("%s: bogus pcitag %x\n", __func__,
+       else DPRINTF(PDB_CONF, ("%s: bogus pcitag %x -", __func__,
                (int)PCITAG_OFFSET(tag)));
 #endif
        DPRINTF(PDB_CONF, (" returning %08x\n", (u_int)val));
@@ -1609,7 +1610,7 @@
        }
 
        psycho0->sc_last_stick = psycho_getstick();
-       DPRINTF(PDB_STICK, ("stick: %ld\n", psycho0->sc_last_stick));
+       DPRINTF(PDB_STICK, ("%s: %ld\n", __func__, psycho0->sc_last_stick));
 }
 
 void



Home | Main Index | Thread Index | Old Index