Module Name: src Committed By: mrg Date: Thu Nov 26 23:44:57 UTC 2015
Modified Files: src/sys/arch/sparc64/dev: psycho.c Log Message: adjust a bunch of debugging messages to use __func__ and to normalise newline usage (some sequences ended up printing blank lines.) To generate a diff of this commit: cvs rdiff -u -r1.121 -r1.122 src/sys/arch/sparc64/dev/psycho.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/arch/sparc64/dev/psycho.c diff -u src/sys/arch/sparc64/dev/psycho.c:1.121 src/sys/arch/sparc64/dev/psycho.c:1.122 --- src/sys/arch/sparc64/dev/psycho.c:1.121 Fri Oct 2 05:22:52 2015 +++ src/sys/arch/sparc64/dev/psycho.c Thu Nov 26 23:44:57 2015 @@ -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 @@ psycho_get_bus_range(int node, int *brp) 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 @@ psycho_fixup_bus_range(int node0, int *b 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 @@ psycho_fixup_bus_range(int node0, int *b } 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 @@ psycho_get_ranges(int node, struct psych 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 @@ _psycho_bus_map(bus_space_tag_t t, bus_a 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 @@ _psycho_bus_map(bus_space_tag_t t, bus_a 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 @@ psycho_bus_mmap(bus_space_tag_t t, bus_a 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 @@ psycho_bus_offset(bus_space_tag_t t, bus 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 @@ psycho_bus_offset(bus_space_tag_t t, bus 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 @@ psycho_intr_establish(bus_space_tag_t t, * 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 @@ psycho_intr_establish(bus_space_tag_t t, 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 @@ found: 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 @@ found: */ 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 @@ found: 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 @@ psycho_pci_conf_read(pci_chipset_tag_t p 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 @@ psycho_setstick(long cnt) } 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