diff options
Diffstat (limited to 'usr/src/cmd/mdb/sun4u')
-rw-r--r-- | usr/src/cmd/mdb/sun4u/modules/opl/oplhwd/oplhwd.c | 77 | ||||
-rw-r--r-- | usr/src/cmd/mdb/sun4u/modules/unix/sfmmu.c | 80 | ||||
-rw-r--r-- | usr/src/cmd/mdb/sun4u/modules/unix/unix.c | 19 |
3 files changed, 87 insertions, 89 deletions
diff --git a/usr/src/cmd/mdb/sun4u/modules/opl/oplhwd/oplhwd.c b/usr/src/cmd/mdb/sun4u/modules/opl/oplhwd/oplhwd.c index 48aed6c313..5bdea9bc81 100644 --- a/usr/src/cmd/mdb/sun4u/modules/opl/oplhwd/oplhwd.c +++ b/usr/src/cmd/mdb/sun4u/modules/opl/oplhwd/oplhwd.c @@ -23,7 +23,6 @@ * Copyright 2007 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" #include <sys/mdb_modapi.h> #include <sys/types.h> @@ -151,7 +150,7 @@ dumpmemhwd(hwd_memory_t *memp, int v, int mv) mdb_printf("\tDIMM %d\tstatus\t0x%x (%s)\n", i, memp->mem_dimms[i].dimm_status, hwd_stat_decode( - memp->mem_dimms[i].dimm_status)); + memp->mem_dimms[i].dimm_status)); continue; } mdb_printf("\tDIMM %d\tstatus\t0x%x (%s)\tcapacity\t0x%llx\n", @@ -241,16 +240,16 @@ dumpchiphwd(hwd_cpu_chip_t *chipp, int ch, int v, int mv) mdb_printf("\tsharing\t%x\n", corep->core_l2_cache_sharing); mdb_printf("\t\tITLB entries\t0x%x\tDTLB entries " - "0x%x\n", corep->core_num_itlb_entries, + "0x%x\n", corep->core_num_itlb_entries, corep->core_num_dtlb_entries); } for (cp = 0; cp < HWD_CPUS_PER_CORE; cp++) { cpup = &corep->core_cpus[cp]; mdb_printf("\t\tCPU %d:\tstatus\t0x%x (%s)\tcpuid" - " = 0x%x\n", cp, cpup->cpu_status, - hwd_stat_decode(cpup->cpu_status), - cpup->cpu_cpuid); + " = 0x%x\n", cp, cpup->cpu_status, + hwd_stat_decode(cpup->cpu_status), + cpup->cpu_cpuid); if (v & DUMP_COMP_NAME) mdb_printf("\t\t\tcomponent name:%s\n", cpup->cpu_component_name); @@ -320,10 +319,10 @@ dumpahwd(int bd, int v) if (mdb_vread(&boardcfg, sizeof (opl_board_cfg_t), - tmptr + (bd * sizeof (opl_board_cfg_t))) == -1) { + tmptr + (bd * sizeof (opl_board_cfg_t))) == -1) { mdb_warn("failed to read opl_board_cfg at %p", - (tmptr + (bd * sizeof (opl_board_cfg_t)))); - return; + (tmptr + (bd * sizeof (opl_board_cfg_t)))); + return; } if (boardcfg.cfg_hwd == NULL) { @@ -335,9 +334,9 @@ dumpahwd(int bd, int v) /* We always need the header, for offsets */ if (mdb_vread(&hwd_hdr, sizeof (hwd_header_t), - (uintptr_t)boardcfg.cfg_hwd) == -1) { + (uintptr_t)boardcfg.cfg_hwd) == -1) { mdb_warn("failed to read hwd_header_t at %p\n", - boardcfg.cfg_hwd); + boardcfg.cfg_hwd); return; } @@ -370,7 +369,7 @@ dumpahwd(int bd, int v) if (mdb_vread(&hwd_sb_status, sizeof (hwd_sb_status_t), (uintptr_t)statusp) == -1) { mdb_warn("failed to read hwd_sb_status_t at %p\n", - statusp); + statusp); return; } mdb_printf("\nSTATUS:\tBoard\tStatus\n"); @@ -388,7 +387,7 @@ dumpahwd(int bd, int v) if (mdb_vread(&hwd_dinfo, sizeof (hwd_domain_info_t), (uintptr_t)dinfop) == -1) { mdb_warn("failed to read hwd_domain_info_t at %p\n", - dinfop); + dinfop); return; } mdb_printf("\nDomain info:\tReset reason\t0x%x", @@ -445,7 +444,7 @@ dumpahwd(int bd, int v) cmup = &hwd_sb.sb_cmu.cmu_ch; mdb_printf("\nCMU CH: status\t0x%x (%s)\tportid=0x%x" - " LSB = 0x%x\n", + " LSB = 0x%x\n", cmup->chan_status, hwd_stat_decode(cmup->chan_status), cmup->chan_portid, ((cmup->chan_portid) >> 4)); @@ -504,16 +503,16 @@ dumpahwd(int bd, int v) scp = &hwd_sb.sb_cmu.cmu_scs[sc]; - if (DONT_BOTHER(scp->sc_status, mv)) - mdb_printf("\nSC %d:\tstatus\t0x%x (%s)\n", - sc, scp->sc_status, - hwd_stat_decode(scp->sc_status)); - else { - mdb_printf("\nSC %d:\tstatus\t0x%x (%s)\t", - sc, scp->sc_status, - hwd_stat_decode(scp->sc_status)); - mdb_printf("register addr\t0x%llx\n", - scp->sc_register_address); + if (DONT_BOTHER(scp->sc_status, mv)) { + mdb_printf("\nSC %d:\tstatus\t0x%x (%s)\n", + sc, scp->sc_status, + hwd_stat_decode(scp->sc_status)); + } else { + mdb_printf("\nSC %d:\tstatus\t0x%x (%s)\t", + sc, scp->sc_status, + hwd_stat_decode(scp->sc_status)); + mdb_printf("register addr\t0x%llx\n", + scp->sc_register_address); } } @@ -607,7 +606,7 @@ oplhwd(uintptr_t addr, uint_t flags, int argc, const mdb_arg_t *argv) if (bdi < 0) { /* get active boards */ for (bdi = 0; bdi < OPL_MAX_BOARDS; bdi++) - dumpahwd(bdi, v_mode); + dumpahwd(bdi, v_mode); } else { dumpahwd(bdi, v_mode); } @@ -621,22 +620,22 @@ static void oplhwd_help(void) { mdb_printf("oplhwd will dump HWD only for a particular board" - " on which,"); + " on which,"); mdb_printf("an earlier DR operation has been executed.\n"); mdb_printf("-b NUM \tlist oplhwd entry for a board\n" - "-s \t\tlist oplhwd entry with SB status\n" - "-d \t\tlist oplhwd entry with Domain info.\n" - "-i \t\tlist oplhwd entry with SB info.\n" - "-h \t\tlist oplhwd entry with Chips details\n" - "-o \t\tlist oplhwd entry with Core details\n" - "-m \t\tlist oplhwd entry with Memory info.\n" - "-k \t\tlist oplhwd entry with Memory Bank info.\n" - "-r \t\tlist oplhwd entry with SC info.\n" - "-c \t\tlist oplhwd entry with CMU channels\n" - "-p \t\tlist oplhwd entry with PCI channels\n" - "-a \t\tlist oplhwd entry with all possible info.\n" - "-C \t\tlist oplhwd entry with component names\n" - "-v \t\tlist oplhwd entry in verbose mode\n"); + "-s \t\tlist oplhwd entry with SB status\n" + "-d \t\tlist oplhwd entry with Domain info.\n" + "-i \t\tlist oplhwd entry with SB info.\n" + "-h \t\tlist oplhwd entry with Chips details\n" + "-o \t\tlist oplhwd entry with Core details\n" + "-m \t\tlist oplhwd entry with Memory info.\n" + "-k \t\tlist oplhwd entry with Memory Bank info.\n" + "-r \t\tlist oplhwd entry with SC info.\n" + "-c \t\tlist oplhwd entry with CMU channels\n" + "-p \t\tlist oplhwd entry with PCI channels\n" + "-a \t\tlist oplhwd entry with all possible info.\n" + "-C \t\tlist oplhwd entry with component names\n" + "-v \t\tlist oplhwd entry in verbose mode\n"); } /* diff --git a/usr/src/cmd/mdb/sun4u/modules/unix/sfmmu.c b/usr/src/cmd/mdb/sun4u/modules/unix/sfmmu.c index 20b59d7e56..ce4a1035f1 100644 --- a/usr/src/cmd/mdb/sun4u/modules/unix/sfmmu.c +++ b/usr/src/cmd/mdb/sun4u/modules/unix/sfmmu.c @@ -131,7 +131,7 @@ sfmmu_vtop(uintptr_t addr, uint_t flags, int argc, const mdb_arg_t *argv) if (ret == 0) { mdb_printf("address space %p: virtual %lr mapped to physical " - "%llr", asp, addr, paddr); + "%llr", asp, addr, paddr); } else { return (DCMD_ERR); } @@ -174,7 +174,7 @@ sfmmu_vtop_common(struct as *asp, uintptr_t addr, physaddr_t *pap) static int sfmmu_vtop_impl(uintptr_t addr, sfmmu_t *sfmmup, sfmmu_t *msfmmup, - physaddr_t *pap) + physaddr_t *pap) { struct hmehash_bucket *uhme_hash; struct hmehash_bucket *khme_hash; @@ -225,7 +225,7 @@ sfmmu_vtop_impl(uintptr_t addr, sfmmu_t *sfmmup, sfmmu_t *msfmmup, } ism_blkp = &mism_blk; ism_map = ism_blkp->iblk_maps; - for (i = 0; ism_map[i].imap_ismhat && i < ISM_MAP_SLOTS; i++) { + for (i = 0; i < ISM_MAP_SLOTS && ism_map[i].imap_ismhat; i++) { if ((caddr_t)addr >= ism_start(ism_map[i]) && (caddr_t)addr < ism_end(ism_map[i])) { sfmmup = ism_hatid = ism_map[i].imap_ismhat; @@ -252,18 +252,18 @@ sfmmu_vtop_impl(uintptr_t addr, sfmmu_t *sfmmup, sfmmu_t *msfmmup, #ifdef __sparcv9 SFMMU_VTOP_DBG_DBG("hblktag=%lx %lx\n", - (uint64_t)hblktag.htag_tag[0], - (uint64_t)hblktag.htag_tag[1]); + (uint64_t)hblktag.htag_tag[0], + (uint64_t)hblktag.htag_tag[1]); #else SFMMU_VTOP_DBG_DBG("hblktag=%llx\n", - (uint64_t)hblktag.htag_tag); + (uint64_t)hblktag.htag_tag); #endif hmebp = shmebp = HME_HASH_FUNCTION(sfmmup, addr, hmeshift); SFMMU_VTOP_DBG_DBG("hmebp=%p\n", hmebp); if (mdb_vread(&mbucket, sizeof (mbucket), - (uintptr_t)hmebp) == -1) { + (uintptr_t)hmebp) == -1) { mdb_warn("couldn't read mbucket at %p\n", hmebp); return (DCMD_ERR); } @@ -271,7 +271,7 @@ sfmmu_vtop_impl(uintptr_t addr, sfmmu_t *sfmmup, sfmmu_t *msfmmup, hmebp = &mbucket; for (hmeblkp = hmebp->hmeblkp; hmeblkp; - hmeblkp = hmeblkp->hblk_next) { + hmeblkp = hmeblkp->hblk_next) { SFMMU_VTOP_DBG_DBG("hmeblkp=%p\n", hmeblkp); @@ -279,9 +279,9 @@ sfmmu_vtop_impl(uintptr_t addr, sfmmu_t *sfmmup, sfmmu_t *msfmmup, break; if (mdb_vread(&mhmeblkmax, sizeof (struct hme_blk), - (uintptr_t)hmeblkp) == -1) { + (uintptr_t)hmeblkp) == -1) { mdb_warn("couldn't read hme_blk at %p\n", - hmeblkp); + hmeblkp); return (DCMD_ERR); } @@ -298,7 +298,7 @@ sfmmu_vtop_impl(uintptr_t addr, sfmmu_t *sfmmup, sfmmu_t *msfmmup, sfmmu_vtop_print_hmeblk(hmeblkp); sfhmep = mdb_sfmmu_hblktohme(hmeblkp, (caddr_t)addr, - &sfhmeinx); + &sfhmeinx); SFMMU_VTOP_DBG_DBG("sfhmeinx=%d ", sfhmeinx); @@ -307,28 +307,26 @@ sfmmu_vtop_impl(uintptr_t addr, sfmmu_t *sfmmup, sfmmu_t *msfmmup, sizeof (struct sf_hment) * (sfhmeinx - 1); if (mdb_vread(sfhmep, sizeof (struct sf_hment), - thmeblkp) == -1) { + thmeblkp) == -1) { mdb_warn("couldn't read msfhme at %p\n", - sfhmep); + sfhmep); return (DCMD_ERR); } } SFMMU_VTOP_DBG_VRB("sfmmup=%p hmebp=%p hmeblkp=%p\n", - sfmmup, shmebp, thmeblkp); + sfmmup, shmebp, thmeblkp); tte = sfhmep->hme_tte; SFMMU_VTOP_DBG_VRB("tte=%llx ", tte.ll); if (TTE_IS_VALID(&tte)) { start_pfn = TTE_TO_TTEPFN(&tte); *pap = (start_pfn << MMU_PAGESHIFT) + - (addr & TTE_PAGE_OFFSET(tte.tte_size)); + (addr & TTE_PAGE_OFFSET(tte.tte_size)); pfn = *pap >> MMU_PAGESHIFT; pp = (sfhmep->hme_page != 0) ? - sfhmep->hme_page + (pfn - start_pfn) : - 0; - SFMMU_VTOP_DBG_VRB("pfn=%lx pp=%p\n", - pfn, pp); + sfhmep->hme_page + (pfn - start_pfn) : 0; + SFMMU_VTOP_DBG_VRB("pfn=%lx pp=%p\n", pfn, pp); ret = 0; } break; @@ -345,13 +343,13 @@ static void sfmmu_vtop_print_hmeblk(struct hme_blk *hmeblkp) { - if ((sfmmu_vtop_dbg & SFMMU_VTOP_DBG_DEBUG) == NULL) + if ((sfmmu_vtop_dbg & SFMMU_VTOP_DBG_DEBUG) == 0) return; mdb_printf(" hblk_nextpa=%llx\n", hmeblkp->hblk_nextpa); #ifdef __sparcv9 mdb_printf(" hblktag=%lx %lx\n", hmeblkp->hblk_tag.htag_tag[0], - hmeblkp->hblk_tag.htag_tag[1]); + hmeblkp->hblk_tag.htag_tag[1]); #else mdb_printf(" hblktag=%llx\n", hmeblkp->hblk_tag.htag_tag); #endif @@ -403,7 +401,7 @@ memseg_list(uintptr_t addr, uint_t flags, int argc, const mdb_arg_t *argv) if (DCMD_HDRSPEC(flags)) mdb_printf("%<u>%?s %?s %?s %?s %?s%</u>\n", "ADDR", - "PAGES", "EPAGES", "BASE", "END"); + "PAGES", "EPAGES", "BASE", "END"); if (mdb_vread(&ms, sizeof (struct memseg), addr) == -1) { mdb_warn("can't read memseg at %#lx", addr); @@ -411,7 +409,7 @@ memseg_list(uintptr_t addr, uint_t flags, int argc, const mdb_arg_t *argv) } mdb_printf("%0?lx %0?lx %0?lx %0?lx %0?lx\n", addr, - ms.pages, ms.epages, ms.pages_base, ms.pages_end); + ms.pages, ms.epages, ms.pages_base, ms.pages_end); return (DCMD_OK); } @@ -422,7 +420,7 @@ memseg_list(uintptr_t addr, uint_t flags, int argc, const mdb_arg_t *argv) int memseg_walk_init(mdb_walk_state_t *wsp) { - if (wsp->walk_addr != NULL) { + if (wsp->walk_addr != (uintptr_t)NULL) { mdb_warn("memseg only supports global walks\n"); return (WALK_ERR); } @@ -535,9 +533,9 @@ tsbinfo_list(uintptr_t addr, uint_t flags, int argc, const mdb_arg_t *argv) } if (mdb_getopts(argc, argv, - 'l', MDB_OPT_SETBITS, TRUE, &lflag, - 'a', MDB_OPT_SETBITS, TRUE, &aflag, - NULL) != argc) { + 'l', MDB_OPT_SETBITS, TRUE, &lflag, + 'a', MDB_OPT_SETBITS, TRUE, &aflag, + NULL) != argc) { return (DCMD_USAGE); } @@ -600,24 +598,24 @@ tsbinfo_list(uintptr_t addr, uint_t flags, int argc, const mdb_arg_t *argv) UM_SLEEP); if (mdb_vread(tsbp, sizeof (struct tsbe) * entries, - (uintptr_t)tsbinfo.tsb_va) == -1) { + (uintptr_t)tsbinfo.tsb_va) == -1) { mdb_warn("failed to read TSB at %p", tsbinfo.tsb_va); return (DCMD_ERR); } mdb_printf( - "TSB @ %lx (%d entries)\n" - "%-?s %-17s %s\n" - "%<u>%-?s %1s %1s %-11s " - "%1s %1s %1s %1s %1s %1s %8s " - "%1s %1s %1s %1s %1s %1s %1s " - "%1s %1s %1s %1s %1s %1s%</u>\n", - tsbinfo.tsb_va, entries, "", "TAG", "TTE", - "ADDR", "I", "L", "VA 63:22", - "V", "S", "N", "I", "H", "S", "PA 42:13", - "N", "U", "R", "W", "E", "X", "L", - "P", "V", "E", "P", "W", "G"); + "TSB @ %lx (%d entries)\n" + "%-?s %-17s %s\n" + "%<u>%-?s %1s %1s %-11s " + "%1s %1s %1s %1s %1s %1s %8s " + "%1s %1s %1s %1s %1s %1s %1s " + "%1s %1s %1s %1s %1s %1s%</u>\n", + tsbinfo.tsb_va, entries, "", "TAG", "TTE", + "ADDR", "I", "L", "VA 63:22", + "V", "S", "N", "I", "H", "S", "PA 42:13", + "N", "U", "R", "W", "E", "X", "L", + "P", "V", "E", "P", "W", "G"); tsbend = tsbp + entries; for (tsbstart = tsbp; tsbp < tsbend; tsbp++) { @@ -626,8 +624,8 @@ tsbinfo_list(uintptr_t addr, uint_t flags, int argc, const mdb_arg_t *argv) va = (caddr_t) (((uint64_t)tsbp->tte_tag.tag_vahi - << 32) + - tsbp->tte_tag.tag_valo); + << 32) + + tsbp->tte_tag.tag_valo); pa = (tsbp->tte_data.tte_pahi << 19) + tsbp->tte_data.tte_palo; mdb_printf("%0?lx %-1u %-1u %011lx " diff --git a/usr/src/cmd/mdb/sun4u/modules/unix/unix.c b/usr/src/cmd/mdb/sun4u/modules/unix/unix.c index 09303f5345..e43449f9db 100644 --- a/usr/src/cmd/mdb/sun4u/modules/unix/unix.c +++ b/usr/src/cmd/mdb/sun4u/modules/unix/unix.c @@ -676,7 +676,7 @@ ttrace_walk_init(mdb_walk_state_t *wsp) ttrace_cpu_data_t *tc; struct trap_trace_record *buf; - if (wsp->walk_addr != NULL) { + if (wsp->walk_addr != (uintptr_t)NULL) { mdb_warn("ttrace only supports global walks\n"); return (WALK_ERR); } @@ -965,7 +965,7 @@ httrace_walk_init(mdb_walk_state_t *wsp) struct htrap_trace_record *buf; htrap_trace_hdr_t *hdr; - if (wsp->walk_addr != NULL) { + if (wsp->walk_addr != (uintptr_t)NULL) { mdb_warn("httrace only supports global walks\n"); return (WALK_ERR); } @@ -1347,7 +1347,7 @@ vecint_walk_init(mdb_walk_state_t *wsp) { vecint_walk_data_t *vecint; - if (wsp->walk_addr != NULL) { + if (wsp->walk_addr != (uintptr_t)NULL) { mdb_warn("vecint walk only supports global walks\n"); return (WALK_ERR); } @@ -1378,13 +1378,14 @@ vecint_walk_step(mdb_walk_state_t *wsp) intr_vec_t iv; int status; - if (wsp->walk_addr == NULL) { + if (wsp->walk_addr == (uintptr_t)NULL) { while ((vecint->vec_idx < max) && ((wsp->walk_addr = - (uintptr_t)vecint->vec_table[vecint->vec_idx++]) == NULL)) + (uintptr_t)vecint->vec_table[vecint->vec_idx++]) == + (uintptr_t)NULL)) continue; } - if (wsp->walk_addr == NULL) + if (wsp->walk_addr == (uintptr_t)NULL) return (WALK_DONE); status = wsp->walk_callback(wsp->walk_addr, wsp->walk_data, @@ -1443,7 +1444,7 @@ softint_walk_init(mdb_walk_state_t *wsp) { intr_vec_t *list; - if (wsp->walk_addr != NULL) { + if (wsp->walk_addr != (uintptr_t)NULL) { mdb_warn("softint walk only supports global walks\n"); return (WALK_ERR); } @@ -1471,7 +1472,7 @@ softint_walk_step(mdb_walk_state_t *wsp) intr_vec_t iv; int status; - if (wsp->walk_addr == NULL) + if (wsp->walk_addr == (uintptr_t)NULL) return (WALK_DONE); status = wsp->walk_callback(wsp->walk_addr, wsp->walk_data, @@ -1568,7 +1569,7 @@ mutex_owner_step(mdb_walk_state_t *wsp) if (!MUTEX_TYPE_ADAPTIVE(&mtx)) return (WALK_DONE); - if ((owner = (uintptr_t)MUTEX_OWNER(&mtx)) == NULL) + if ((owner = (uintptr_t)MUTEX_OWNER(&mtx)) == (uintptr_t)NULL) return (WALK_DONE); if (mdb_vread(&thr, sizeof (thr), owner) != -1) |